diff --git a/src/deprecations.ts b/src/deprecations.ts new file mode 100644 index 000000000..be81e7abe --- /dev/null +++ b/src/deprecations.ts @@ -0,0 +1,44 @@ +// These can be removed in the next major. +import { + EmailProviderCreate, + EmailProviderCreateNameEnum, + EmailProviderUpdate, + EmailProviderUpdateNameEnum, + EmailProviderUpdateCredentials, + ClientCreateOidcLogout, + ClientOidcLogout, + ClientUpdateOidcLogout, +} from './management/__generated/models/index.js'; + +/** + * @deprecated Use {@link EmailProviderUpdate} instead. + */ +export type PatchProviderRequest = EmailProviderUpdate; +/** + * @deprecated Use {@link EmailProviderUpdateNameEnum} instead. + */ +export const PatchProviderRequestNameEnum = EmailProviderUpdateNameEnum; +/** + * @deprecated Use {@link EmailProviderCreate} instead. + */ +export type PostProviderRequest = EmailProviderCreate; +/** + * @deprecated Use {@link EmailProviderCreateNameEnum} instead. + */ +export const PostProviderRequestNameEnum = EmailProviderCreateNameEnum; +/** + * @deprecated Use {@link EmailProviderUpdateCredentials} instead. + */ +export type PostProviderRequestCredentials = EmailProviderUpdateCredentials; +/** + * @deprecated Use {@link ClientCreateOidcLogout} instead. + */ +export type ClientCreateOidcBackchannelLogout = ClientCreateOidcLogout; +/** + * @deprecated Use {@link ClientOidcLogout} instead. + */ +export type ClientOidcBackchannelLogout = ClientOidcLogout; +/** + * @deprecated Use {@link ClientUpdateOidcLogout} instead. + */ +export type ClientUpdateOidcBackchannelLogout = ClientUpdateOidcLogout; diff --git a/src/index.ts b/src/index.ts index f29bd4d92..a0adba413 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,3 +3,4 @@ export * from './auth/index.js'; export * from './userinfo/index.js'; export * from './lib/errors.js'; export * from './lib/models.js'; +export * from './deprecations.js'; diff --git a/src/management/__generated/managers/emails-manager.ts b/src/management/__generated/managers/emails-manager.ts index df9eac0e2..b31172386 100644 --- a/src/management/__generated/managers/emails-manager.ts +++ b/src/management/__generated/managers/emails-manager.ts @@ -2,8 +2,8 @@ import * as runtime from '../../../lib/runtime.js'; import type { InitOverride, ApiResponse } from '../../../lib/runtime.js'; import type { EmailProvider, - PatchProviderRequest, - PostProviderRequest, + EmailProviderCreate, + EmailProviderUpdate, GetProviderRequest, } from '../models/index.js'; @@ -58,7 +58,7 @@ export class EmailsManager extends BaseAPI { * @throws {RequiredError} */ async update( - bodyParameters: PatchProviderRequest, + bodyParameters: EmailProviderUpdate, initOverrides?: InitOverride ): Promise> { const headerParameters: runtime.HTTPHeaders = {}; @@ -89,7 +89,7 @@ export class EmailsManager extends BaseAPI { * @throws {RequiredError} */ async configure( - bodyParameters: PostProviderRequest, + bodyParameters: EmailProviderCreate, initOverrides?: InitOverride ): Promise> { const headerParameters: runtime.HTTPHeaders = {}; diff --git a/src/management/__generated/managers/grants-manager.ts b/src/management/__generated/managers/grants-manager.ts index 485edfd0d..17262cdfe 100644 --- a/src/management/__generated/managers/grants-manager.ts +++ b/src/management/__generated/managers/grants-manager.ts @@ -59,7 +59,7 @@ export class GrantsManager extends BaseAPI { const response = await this.request( { - path: `/grants/`, + path: `/grants`, method: 'DELETE', query: queryParameters, }, diff --git a/src/management/__generated/managers/organizations-manager.ts b/src/management/__generated/managers/organizations-manager.ts index 6bf3af73d..a2940a518 100644 --- a/src/management/__generated/managers/organizations-manager.ts +++ b/src/management/__generated/managers/organizations-manager.ts @@ -362,19 +362,34 @@ export class OrganizationsManager extends BaseAPI { } /** - * List organization members. This endpoint supports two types of pagination: + * List organization members. + * + * + * + * This endpoint supports two types of pagination: + * * - Offset pagination * - Checkpoint pagination * - * Checkpoint pagination must be used if you need to retrieve more than 1000 organization members. + * Checkpoint pagination must be used if you need to retrieve more than 1000 + * organization members. * *

Checkpoint Pagination

* - * To search by checkpoint, use the following parameters: - * - from: Optional id from which to start selection. - * - take: The total amount of entries to retrieve when using the from parameter. Defaults to 50. - * - * Note: The first time you call this endpoint using Checkpoint Pagination, you should omit the from parameter. If there are more results, a next value will be included in the response. You can use this for subsequent API calls. When next is no longer included in the response, this indicates there are no more pages remaining. + * To search by checkpoint, use the following parameters: - from: Optional id from which to start selection. - take: The + * total amount of entries to retrieve when using the from parameter. Defaults to 50. Note: The first time you call this + * endpoint using Checkpoint Pagination, you should omit the from parameter. If there are more results, a + * next value will be included in the response. You can use this for subsequent API calls. When + * next is no longer included in the response, this indicates there are no more pages remaining. * * Get members who belong to an organization * diff --git a/src/management/__generated/managers/roles-manager.ts b/src/management/__generated/managers/roles-manager.ts index c33ad4855..8fa1490dc 100644 --- a/src/management/__generated/managers/roles-manager.ts +++ b/src/management/__generated/managers/roles-manager.ts @@ -12,7 +12,7 @@ import type { GetRolePermission200ResponseOneOf, Permission, GetRoleUser200ResponseOneOf, - GetMembers200ResponseOneOfInner, + GetRoleUser200ResponseOneOfInner, GetOrganizationMemberRoles200ResponseOneOf, DeleteRolePermissionAssignmentRequest, DeleteRolesByIdRequest, @@ -166,7 +166,7 @@ export class RolesManager extends BaseAPI { async getUsers( requestParameters?: GetRoleUserRequest, initOverrides?: InitOverride - ): Promise>>; + ): Promise>>; async getUsers( requestParameters: GetRoleUserRequest, initOverrides?: InitOverride diff --git a/src/management/__generated/models/index.ts b/src/management/__generated/models/index.ts index 572fd9b0e..e7d2d79fa 100644 --- a/src/management/__generated/models/index.ts +++ b/src/management/__generated/models/index.ts @@ -95,7 +95,7 @@ export interface Client { allowed_logout_urls: Array; /** */ - oidc_backchannel_logout: ClientOidcBackchannelLogout; + oidc_logout: ClientOidcLogout; /** * List of grant types supported for this application. Can include `authorization_code`, `implicit`, `refresh_token`, `client_credentials`, `password`, `http://auth0.com/oauth/grant-type/password-realm`, `http://auth0.com/oauth/grant-type/mfa-oob`, `http://auth0.com/oauth/grant-type/mfa-otp`, `http://auth0.com/oauth/grant-type/mfa-recovery-code`, and `urn:ietf:params:oauth:grant-type:device_code`. * @@ -893,7 +893,7 @@ export interface ClientCreate { callbacks?: Array; /** */ - oidc_backchannel_logout?: ClientCreateOidcBackchannelLogout; + oidc_logout?: ClientCreateOidcLogout; /** * Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs. * @@ -1825,7 +1825,7 @@ export interface ClientCreateNativeSocialLoginFacebook { /** * Configuration for OIDC backchannel logout */ -export interface ClientCreateOidcBackchannelLogout { +export interface ClientCreateOidcLogout { /** * Comma-separated list of URLs that are valid to call back from Auth0 for OIDC backchannel logout. Currently only one URL is allowed. * @@ -2011,7 +2011,7 @@ export interface ClientNativeSocialLoginFacebook { /** * Configuration for OIDC backchannel logout */ -export interface ClientOidcBackchannelLogout { +export interface ClientOidcLogout { [key: string]: any | any; /** * Comma-separated list of URLs that are valid to call back from Auth0 for OIDC backchannel logout. Currently only one URL is allowed. @@ -2126,7 +2126,7 @@ export interface ClientUpdate { callbacks?: Array; /** */ - oidc_backchannel_logout?: ClientUpdateOidcBackchannelLogout | null; + oidc_logout?: ClientUpdateOidcLogout | null; /** * A set of URLs that represents valid origins for CORS * @@ -2517,7 +2517,7 @@ export interface ClientUpdateMobileIos { /** * Configuration for OIDC backchannel logout */ -export interface ClientUpdateOidcBackchannelLogout { +export interface ClientUpdateOidcLogout { /** * Comma-separated list of URLs that are valid to call back from Auth0 for OIDC backchannel logout. Currently only one URL is allowed. * @@ -3364,6 +3364,48 @@ export interface EmailProvider { */ settings: { [key: string]: any }; } +/** + * + */ +export interface EmailProviderCreate { + /** + * Name of the email provider. Can be `mailgun`, `mandrill`, `sendgrid`, `ses`, `sparkpost`, `smtp`, `azure_cs`, or `ms365`. + * + */ + name: EmailProviderCreateNameEnum; + /** + * Whether the provider is enabled (true) or disabled (false). + * + */ + enabled?: boolean; + /** + * Email address to use as "from" when no other address specified. + * + */ + default_from_address?: string; + /** + */ + credentials: EmailProviderUpdateCredentials; + /** + * Specific provider setting + * + */ + settings?: { [key: string]: any } | null; +} + +export const EmailProviderCreateNameEnum = { + mailgun: 'mailgun', + mandrill: 'mandrill', + sendgrid: 'sendgrid', + ses: 'ses', + sparkpost: 'sparkpost', + smtp: 'smtp', + azure_cs: 'azure_cs', + ms365: 'ms365', +} as const; +export type EmailProviderCreateNameEnum = + (typeof EmailProviderCreateNameEnum)[keyof typeof EmailProviderCreateNameEnum]; + /** * Credentials required to use the provider. */ @@ -3394,6 +3436,52 @@ export interface EmailProviderCredentials { */ smtp_user: string; } +/** + * + */ +export interface EmailProviderUpdate { + /** + * Name of the email provider. Can be `mailgun`, `mandrill`, `sendgrid`, `ses`, `sparkpost`, `smtp`, `azure_cs`, or `ms365`. + * + */ + name?: EmailProviderUpdateNameEnum; + /** + * Whether the provider is enabled (true) or disabled (false). + * + */ + enabled?: boolean; + /** + * Email address to use as "from" when no other address specified. + * + */ + default_from_address?: string; + /** + */ + credentials?: EmailProviderUpdateCredentials; + /** + * Specific provider setting + * + */ + settings?: { [key: string]: any } | null; +} + +export const EmailProviderUpdateNameEnum = { + mailgun: 'mailgun', + mandrill: 'mandrill', + sendgrid: 'sendgrid', + ses: 'ses', + sparkpost: 'sparkpost', + smtp: 'smtp', + azure_cs: 'azure_cs', + ms365: 'ms365', +} as const; +export type EmailProviderUpdateNameEnum = + (typeof EmailProviderUpdateNameEnum)[keyof typeof EmailProviderUpdateNameEnum]; + +/** + * Credentials required to use the provider. + */ +export type EmailProviderUpdateCredentials = any; /** * */ @@ -5917,6 +6005,24 @@ export interface GetMembers200ResponseOneOfInner { * */ email: string; + /** + */ + roles: Array; +} +/** + * + */ +export interface GetMembers200ResponseOneOfInnerRolesInner { + /** + * ID for this role. + * + */ + id: string; + /** + * Name of this role. + * + */ + name: string; } /** * @@ -5969,12 +6075,12 @@ export interface GetOrganizationMemberRoles200ResponseOneOfInner { */ id: string; /** - * Name of the role. + * Name of this role. * */ name: string; /** - * Description of the role. + * Description of this role. * */ description: string; @@ -6204,7 +6310,7 @@ export interface GetRolePermission200ResponseOneOf { * */ export type GetRoleUser200Response = - | Array + | Array | GetRoleUser200ResponseOneOf | GetRoleUser200ResponseOneOf1; /** @@ -6222,7 +6328,7 @@ export interface GetRoleUser200ResponseOneOf { total: number; /** */ - users: Array; + users: Array; } /** * @@ -6233,7 +6339,32 @@ export interface GetRoleUser200ResponseOneOf1 { next: string; /** */ - users: Array; + users: Array; +} +/** + * + */ +export interface GetRoleUser200ResponseOneOfInner { + /** + * ID of this user. + * + */ + user_id: string; + /** + * URL to a picture for this user. + * + */ + picture: string; + /** + * Name of this user. + * + */ + name: string; + /** + * Email address of this user. + * + */ + email: string; } /** * @@ -7581,48 +7712,6 @@ export interface PatchOrganizationsByIdRequestBranding { */ colors?: GetOrganizations200ResponseOneOfInnerBrandingColors; } -/** - * - */ -export interface PatchProviderRequest { - /** - * Name of the email provider. Can be `mailgun`, `mandrill`, `sendgrid`, `ses`, `sparkpost`, `smtp`, `azure_cs`, or `ms365`. - * - */ - name?: PatchProviderRequestNameEnum; - /** - * Whether the provider is enabled (true) or disabled (false). - * - */ - enabled?: boolean; - /** - * Email address to use as "from" when no other address specified. - * - */ - default_from_address?: string; - /** - */ - credentials?: PostProviderRequestCredentials; - /** - * Specific provider setting - * - */ - settings?: { [key: string]: any } | null; -} - -export const PatchProviderRequestNameEnum = { - mailgun: 'mailgun', - mandrill: 'mandrill', - sendgrid: 'sendgrid', - ses: 'ses', - sparkpost: 'sparkpost', - smtp: 'smtp', - azure_cs: 'azure_cs', - ms365: 'ms365', -} as const; -export type PatchProviderRequestNameEnum = - (typeof PatchProviderRequestNameEnum)[keyof typeof PatchProviderRequestNameEnum]; - /** * */ @@ -9469,52 +9558,6 @@ export interface PostPermissionsRequest { */ permissions: Array; } -/** - * - */ -export interface PostProviderRequest { - /** - * Name of the email provider. Can be `mailgun`, `mandrill`, `sendgrid`, `ses`, `sparkpost`, `smtp`, `azure_cs`, or `ms365`. - * - */ - name: PostProviderRequestNameEnum; - /** - * Whether the provider is enabled (true) or disabled (false). - * - */ - enabled?: boolean; - /** - * Email address to use as "from" when no other address specified. - * - */ - default_from_address?: string; - /** - */ - credentials: PostProviderRequestCredentials; - /** - * Specific provider setting - * - */ - settings?: { [key: string]: any } | null; -} - -export const PostProviderRequestNameEnum = { - mailgun: 'mailgun', - mandrill: 'mandrill', - sendgrid: 'sendgrid', - ses: 'ses', - sparkpost: 'sparkpost', - smtp: 'smtp', - azure_cs: 'azure_cs', - ms365: 'ms365', -} as const; -export type PostProviderRequestNameEnum = - (typeof PostProviderRequestNameEnum)[keyof typeof PostProviderRequestNameEnum]; - -/** - * Credentials required to use the provider. - */ -export type PostProviderRequestCredentials = any; /** * */ @@ -10778,6 +10821,11 @@ export interface TenantSettings { * */ allow_organization_name_in_authentication_api: boolean; + /** + * Whether to enable flexible factors for MFA in the PostLogin action + * + */ + customize_mfa_in_postlogin_action: boolean; } export const TenantSettingsEnabledLocalesEnum = { @@ -11135,6 +11183,11 @@ export interface TenantSettingsUpdate { /** */ sessions?: TenantSettingsUpdateSessions | null; + /** + * Whether to enable flexible factors for MFA in the PostLogin action + * + */ + customize_mfa_in_postlogin_action?: boolean | null; /** * Whether to accept an organization name instead of an ID on auth endpoints * diff --git a/test/management/grants.test.ts b/test/management/grants.test.ts index b437347c7..a884b3cfb 100644 --- a/test/management/grants.test.ts +++ b/test/management/grants.test.ts @@ -154,7 +154,7 @@ describe('GrantsManager', () => { let request: nock.Scope; beforeEach(() => { - request = nock(API_URL).delete(`/grants/?user_id=${user_id}`).reply(200, {}); + request = nock(API_URL).delete(`/grants?user_id=${user_id}`).reply(200, {}); }); it('should return a promise when no callback is given', (done) => {