Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
426 changes: 417 additions & 9 deletions reference.md

Large diffs are not rendered by default.

111 changes: 89 additions & 22 deletions src/management/api/requests/requests.ts

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/management/api/resources/actions/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class ActionsClient {
*
* @example
* await client.actions.list({
* triggerId: "triggerId",
* triggerId: "post-login",
* actionName: "actionName",
* deployed: true,
* page: 1,
Expand All @@ -77,7 +77,7 @@ export class ActionsClient {
): Promise<core.WithRawResponse<Management.ListActionsPaginatedResponseContent>> => {
const { triggerId, actionName, deployed, page = 0, per_page: perPage = 50, installed } = request;
const _queryParams: Record<string, unknown> = {
triggerId,
triggerId: triggerId !== undefined ? triggerId : undefined,
actionName,
deployed,
page,
Expand Down Expand Up @@ -171,7 +171,7 @@ export class ActionsClient {
* await client.actions.create({
* name: "name",
* supported_triggers: [{
* id: "id"
* id: "post-login"
* }]
* })
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class BindingsClient {
* @throws {@link Management.TooManyRequestsError}
*
* @example
* await client.actions.triggers.bindings.list("triggerId", {
* await client.actions.triggers.bindings.list("post-login", {
* page: 1,
* per_page: 1
* })
Expand Down Expand Up @@ -147,7 +147,7 @@ export class BindingsClient {
* @throws {@link Management.TooManyRequestsError}
*
* @example
* await client.actions.triggers.bindings.updateMany("triggerId")
* await client.actions.triggers.bindings.updateMany("post-login")
*/
public updateMany(
triggerId: Management.ActionTriggerTypeEnum,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ export class ClientGrantsClient {
*
* @example
* await client.clientGrants.create({
* client_id: "client_id",
* audience: "audience"
* })
*/
Expand Down
178 changes: 178 additions & 0 deletions src/management/api/resources/clients/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export class ClientsClient {
* is_global: true,
* is_first_party: true,
* app_type: "app_type",
* external_client_id: "external_client_id",
* q: "q"
* })
*/
Expand All @@ -107,6 +108,7 @@ export class ClientsClient {
is_global: isGlobal,
is_first_party: isFirstParty,
app_type: appType,
external_client_id: externalClientId,
q,
} = request;
const _queryParams: Record<string, unknown> = {
Expand All @@ -118,6 +120,7 @@ export class ClientsClient {
is_global: isGlobal,
is_first_party: isFirstParty,
app_type: appType,
external_client_id: externalClientId,
q,
};
const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
Expand Down Expand Up @@ -289,6 +292,181 @@ export class ClientsClient {
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/clients");
}

/**
*
* Fetches and validates a Client ID Metadata Document without creating a client.
* Returns the raw metadata and how it would be mapped to Auth0 client fields.
* This endpoint is useful for testing metadata URIs before creating CIMD clients.
*
*
* @param {Management.PreviewCimdMetadataRequestContent} request
* @param {ClientsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
* @throws {@link Management.ForbiddenError}
* @throws {@link Management.TooManyRequestsError}
* @throws {@link Management.InternalServerError}
*
* @example
* await client.clients.previewCimdMetadata({
* external_client_id: "external_client_id"
* })
*/
public previewCimdMetadata(
request: Management.PreviewCimdMetadataRequestContent,
requestOptions?: ClientsClient.RequestOptions,
): core.HttpResponsePromise<Management.PreviewCimdMetadataResponseContent> {
return core.HttpResponsePromise.fromPromise(this.__previewCimdMetadata(request, requestOptions));
}

private async __previewCimdMetadata(
request: Management.PreviewCimdMetadataRequestContent,
requestOptions?: ClientsClient.RequestOptions,
): Promise<core.WithRawResponse<Management.PreviewCimdMetadataResponseContent>> {
const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
_authRequest.headers,
this._options?.headers,
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.ManagementEnvironment.Default,
"clients/cimd/preview",
),
method: "POST",
headers: _headers,
contentType: "application/json",
queryParameters: requestOptions?.queryParams,
requestType: "json",
body: request,
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
logging: this._options.logging,
});
if (_response.ok) {
return {
data: _response.body as Management.PreviewCimdMetadataResponseContent,
rawResponse: _response.rawResponse,
};
}

if (_response.error.reason === "status-code") {
switch (_response.error.statusCode) {
case 400:
throw new Management.BadRequestError(_response.error.body as unknown, _response.rawResponse);
case 401:
throw new Management.UnauthorizedError(_response.error.body as unknown, _response.rawResponse);
case 403:
throw new Management.ForbiddenError(_response.error.body as unknown, _response.rawResponse);
case 429:
throw new Management.TooManyRequestsError(_response.error.body as unknown, _response.rawResponse);
case 500:
throw new Management.InternalServerError(_response.error.body as unknown, _response.rawResponse);
default:
throw new errors.ManagementError({
statusCode: _response.error.statusCode,
body: _response.error.body,
rawResponse: _response.rawResponse,
});
}
}

return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/clients/cimd/preview");
}

/**
*
* Idempotent registration for Client ID Metadata Document (CIMD) clients.
* Uses external_client_id as the unique identifier for upsert operations.
* **Create:** Returns 201 when a new client is created (requires \
*
* @param {Management.RegisterCimdClientRequestContent} request
* @param {ClientsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
* @throws {@link Management.ForbiddenError}
* @throws {@link Management.TooManyRequestsError}
* @throws {@link Management.InternalServerError}
*
* @example
* await client.clients.registerCimdClient({
* external_client_id: "external_client_id"
* })
*/
public registerCimdClient(
request: Management.RegisterCimdClientRequestContent,
requestOptions?: ClientsClient.RequestOptions,
): core.HttpResponsePromise<Management.RegisterCimdClientResponseContent> {
return core.HttpResponsePromise.fromPromise(this.__registerCimdClient(request, requestOptions));
}

private async __registerCimdClient(
request: Management.RegisterCimdClientRequestContent,
requestOptions?: ClientsClient.RequestOptions,
): Promise<core.WithRawResponse<Management.RegisterCimdClientResponseContent>> {
const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
_authRequest.headers,
this._options?.headers,
requestOptions?.headers,
);
const _response = await (this._options.fetcher ?? core.fetcher)({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.ManagementEnvironment.Default,
"clients/cimd/register",
),
method: "POST",
headers: _headers,
contentType: "application/json",
queryParameters: requestOptions?.queryParams,
requestType: "json",
body: request,
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
logging: this._options.logging,
});
if (_response.ok) {
return {
data: _response.body as Management.RegisterCimdClientResponseContent,
rawResponse: _response.rawResponse,
};
}

if (_response.error.reason === "status-code") {
switch (_response.error.statusCode) {
case 400:
throw new Management.BadRequestError(_response.error.body as unknown, _response.rawResponse);
case 401:
throw new Management.UnauthorizedError(_response.error.body as unknown, _response.rawResponse);
case 403:
throw new Management.ForbiddenError(_response.error.body as unknown, _response.rawResponse);
case 429:
throw new Management.TooManyRequestsError(_response.error.body as unknown, _response.rawResponse);
case 500:
throw new Management.InternalServerError(_response.error.body as unknown, _response.rawResponse);
default:
throw new errors.ManagementError({
statusCode: _response.error.statusCode,
body: _response.error.body,
rawResponse: _response.rawResponse,
});
}
}

return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/clients/cimd/register");
}

/**
* Retrieve client details by ID. Clients are SSO connections or Applications linked with your Auth0 tenant. A list of fields to include or exclude may also be specified.
* For more information, read <a href="https://www.auth0.com/docs/get-started/applications"> Applications in Auth0</a> and <a href="https://www.auth0.com/docs/authenticate/single-sign-on"> Single Sign-On</a>.
Expand Down
Loading
Loading