auth0 5.3.1 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/management/BaseClient.d.ts +4 -4
- package/dist/cjs/management/api/requests/requests.d.ts +21 -8
- package/dist/cjs/management/api/resources/actions/client/Client.js +25 -37
- package/dist/cjs/management/api/resources/actions/resources/modules/client/Client.js +22 -28
- package/dist/cjs/management/api/resources/actions/resources/modules/resources/versions/client/Client.js +11 -14
- package/dist/cjs/management/api/resources/actions/resources/triggers/resources/bindings/client/Client.js +11 -14
- package/dist/cjs/management/api/resources/actions/resources/versions/client/Client.js +12 -15
- package/dist/cjs/management/api/resources/branding/resources/phone/resources/providers/client/Client.js +10 -11
- package/dist/cjs/management/api/resources/branding/resources/phone/resources/templates/client/Client.js +10 -11
- package/dist/cjs/management/api/resources/clientGrants/client/Client.js +15 -26
- package/dist/cjs/management/api/resources/clientGrants/resources/organizations/client/Client.js +11 -14
- package/dist/cjs/management/api/resources/clients/client/Client.js +29 -49
- package/dist/cjs/management/api/resources/clients/resources/connections/client/Client.js +18 -28
- package/dist/cjs/management/api/resources/connectionProfiles/client/Client.js +11 -14
- package/dist/cjs/management/api/resources/connections/client/Client.d.ts +2 -2
- package/dist/cjs/management/api/resources/connections/client/Client.js +34 -49
- package/dist/cjs/management/api/resources/connections/resources/clients/client/Client.js +11 -14
- package/dist/cjs/management/api/resources/connections/resources/directoryProvisioning/client/Client.js +13 -16
- package/dist/cjs/management/api/resources/connections/resources/keys/client/Client.d.ts +19 -0
- package/dist/cjs/management/api/resources/connections/resources/keys/client/Client.js +71 -1
- package/dist/cjs/management/api/resources/connections/resources/scimConfiguration/client/Client.d.ts +18 -0
- package/dist/cjs/management/api/resources/connections/resources/scimConfiguration/client/Client.js +78 -1
- package/dist/cjs/management/api/resources/connections/resources/users/client/Client.js +3 -2
- package/dist/cjs/management/api/resources/customDomains/client/Client.js +13 -20
- package/dist/cjs/management/api/resources/deviceCredentials/client/Client.js +17 -32
- package/dist/cjs/management/api/resources/emails/resources/provider/client/Client.js +11 -14
- package/dist/cjs/management/api/resources/eventStreams/client/Client.js +11 -14
- package/dist/cjs/management/api/resources/eventStreams/resources/deliveries/client/Client.js +15 -26
- package/dist/cjs/management/api/resources/flows/client/Client.js +21 -37
- package/dist/cjs/management/api/resources/flows/resources/executions/client/Client.js +14 -23
- package/dist/cjs/management/api/resources/flows/resources/vault/resources/connections/client/Client.js +12 -17
- package/dist/cjs/management/api/resources/forms/client/Client.js +20 -34
- package/dist/cjs/management/api/resources/groups/client/Client.js +16 -29
- package/dist/cjs/management/api/resources/groups/resources/members/client/Client.js +13 -20
- package/dist/cjs/management/api/resources/hooks/client/Client.js +18 -30
- package/dist/cjs/management/api/resources/jobs/resources/usersImports/client/Client.js +14 -14
- package/dist/cjs/management/api/resources/keys/resources/encryption/client/Client.js +12 -17
- package/dist/cjs/management/api/resources/logs/client/Client.js +16 -29
- package/dist/cjs/management/api/resources/networkAcls/client/Client.js +12 -17
- package/dist/cjs/management/api/resources/organizations/client/Client.js +12 -17
- package/dist/cjs/management/api/resources/organizations/resources/clientGrants/client/Client.js +15 -31
- package/dist/cjs/management/api/resources/organizations/resources/discoveryDomains/client/Client.js +11 -14
- package/dist/cjs/management/api/resources/organizations/resources/enabledConnections/client/Client.js +12 -17
- package/dist/cjs/management/api/resources/organizations/resources/invitations/client/Client.js +26 -40
- package/dist/cjs/management/api/resources/organizations/resources/members/client/Client.js +13 -20
- package/dist/cjs/management/api/resources/organizations/resources/members/resources/roles/client/Client.js +12 -17
- package/dist/cjs/management/api/resources/prompts/resources/rendering/client/Client.js +17 -32
- package/dist/cjs/management/api/resources/resourceServers/client/Client.js +24 -39
- package/dist/cjs/management/api/resources/roles/client/Client.js +13 -20
- package/dist/cjs/management/api/resources/roles/resources/permissions/client/Client.js +12 -17
- package/dist/cjs/management/api/resources/roles/resources/users/client/Client.js +11 -14
- package/dist/cjs/management/api/resources/rules/client/Client.js +26 -40
- package/dist/cjs/management/api/resources/selfServiceProfiles/client/Client.js +12 -17
- package/dist/cjs/management/api/resources/stats/client/Client.js +4 -7
- package/dist/cjs/management/api/resources/tenants/resources/settings/client/Client.js +11 -14
- package/dist/cjs/management/api/resources/tokenExchangeProfiles/client/Client.js +11 -14
- package/dist/cjs/management/api/resources/userAttributeProfiles/client/Client.js +11 -14
- package/dist/cjs/management/api/resources/userBlocks/client/Client.js +24 -25
- package/dist/cjs/management/api/resources/userGrants/client/Client.js +18 -28
- package/dist/cjs/management/api/resources/users/client/Client.js +42 -67
- package/dist/cjs/management/api/resources/users/resources/authenticationMethods/client/Client.js +12 -17
- package/dist/cjs/management/api/resources/users/resources/connectedAccounts/client/Client.js +11 -14
- package/dist/cjs/management/api/resources/users/resources/groups/client/Client.js +13 -20
- package/dist/cjs/management/api/resources/users/resources/logs/client/Client.js +13 -20
- package/dist/cjs/management/api/resources/users/resources/organizations/client/Client.js +12 -17
- package/dist/cjs/management/api/resources/users/resources/permissions/client/Client.js +12 -17
- package/dist/cjs/management/api/resources/users/resources/refreshToken/client/Client.js +11 -14
- package/dist/cjs/management/api/resources/users/resources/roles/client/Client.js +12 -17
- package/dist/cjs/management/api/resources/users/resources/sessions/client/Client.js +11 -14
- package/dist/cjs/management/api/resources/verifiableCredentials/resources/verification/resources/templates/client/Client.js +11 -14
- package/dist/cjs/management/api/types/types.d.ts +4448 -4299
- package/dist/cjs/management/api/types/types.js +41 -12
- package/dist/cjs/management/auth/BearerAuthProvider.d.ts +14 -10
- package/dist/cjs/management/auth/BearerAuthProvider.js +15 -6
- package/dist/cjs/management/core/fetcher/EndpointSupplier.d.ts +2 -2
- package/dist/cjs/management/core/fetcher/Fetcher.d.ts +1 -2
- package/dist/cjs/management/core/fetcher/Fetcher.js +7 -1
- package/dist/cjs/management/core/form-data-utils/FormDataWrapper.js +1 -1
- package/dist/cjs/management/core/headers.d.ts +2 -2
- package/dist/cjs/management/core/pagination/CustomPager.d.ts +29 -44
- package/dist/cjs/management/core/pagination/CustomPager.js +60 -42
- package/dist/cjs/management/core/pagination/exports.d.ts +0 -1
- package/dist/cjs/management/core/pagination/exports.js +0 -3
- package/dist/cjs/management/core/pagination/index.d.ts +1 -1
- package/dist/cjs/management/core/pagination/index.js +2 -1
- package/dist/cjs/management/version.d.ts +1 -1
- package/dist/cjs/management/version.js +1 -1
- package/dist/esm/management/BaseClient.d.mts +4 -4
- package/dist/esm/management/api/requests/requests.d.mts +21 -8
- package/dist/esm/management/api/resources/actions/client/Client.mjs +25 -37
- package/dist/esm/management/api/resources/actions/resources/modules/client/Client.mjs +22 -28
- package/dist/esm/management/api/resources/actions/resources/modules/resources/versions/client/Client.mjs +11 -14
- package/dist/esm/management/api/resources/actions/resources/triggers/resources/bindings/client/Client.mjs +11 -14
- package/dist/esm/management/api/resources/actions/resources/versions/client/Client.mjs +12 -15
- package/dist/esm/management/api/resources/branding/resources/phone/resources/providers/client/Client.mjs +10 -11
- package/dist/esm/management/api/resources/branding/resources/phone/resources/templates/client/Client.mjs +10 -11
- package/dist/esm/management/api/resources/clientGrants/client/Client.mjs +15 -26
- package/dist/esm/management/api/resources/clientGrants/resources/organizations/client/Client.mjs +11 -14
- package/dist/esm/management/api/resources/clients/client/Client.mjs +29 -49
- package/dist/esm/management/api/resources/clients/resources/connections/client/Client.mjs +18 -28
- package/dist/esm/management/api/resources/connectionProfiles/client/Client.mjs +11 -14
- package/dist/esm/management/api/resources/connections/client/Client.d.mts +2 -2
- package/dist/esm/management/api/resources/connections/client/Client.mjs +34 -49
- package/dist/esm/management/api/resources/connections/resources/clients/client/Client.mjs +11 -14
- package/dist/esm/management/api/resources/connections/resources/directoryProvisioning/client/Client.mjs +13 -16
- package/dist/esm/management/api/resources/connections/resources/keys/client/Client.d.mts +19 -0
- package/dist/esm/management/api/resources/connections/resources/keys/client/Client.mjs +71 -1
- package/dist/esm/management/api/resources/connections/resources/scimConfiguration/client/Client.d.mts +18 -0
- package/dist/esm/management/api/resources/connections/resources/scimConfiguration/client/Client.mjs +78 -1
- package/dist/esm/management/api/resources/connections/resources/users/client/Client.mjs +3 -2
- package/dist/esm/management/api/resources/customDomains/client/Client.mjs +13 -20
- package/dist/esm/management/api/resources/deviceCredentials/client/Client.mjs +17 -32
- package/dist/esm/management/api/resources/emails/resources/provider/client/Client.mjs +11 -14
- package/dist/esm/management/api/resources/eventStreams/client/Client.mjs +11 -14
- package/dist/esm/management/api/resources/eventStreams/resources/deliveries/client/Client.mjs +15 -26
- package/dist/esm/management/api/resources/flows/client/Client.mjs +21 -37
- package/dist/esm/management/api/resources/flows/resources/executions/client/Client.mjs +14 -23
- package/dist/esm/management/api/resources/flows/resources/vault/resources/connections/client/Client.mjs +12 -17
- package/dist/esm/management/api/resources/forms/client/Client.mjs +20 -34
- package/dist/esm/management/api/resources/groups/client/Client.mjs +16 -29
- package/dist/esm/management/api/resources/groups/resources/members/client/Client.mjs +13 -20
- package/dist/esm/management/api/resources/hooks/client/Client.mjs +18 -30
- package/dist/esm/management/api/resources/jobs/resources/usersImports/client/Client.mjs +14 -14
- package/dist/esm/management/api/resources/keys/resources/encryption/client/Client.mjs +12 -17
- package/dist/esm/management/api/resources/logs/client/Client.mjs +16 -29
- package/dist/esm/management/api/resources/networkAcls/client/Client.mjs +12 -17
- package/dist/esm/management/api/resources/organizations/client/Client.mjs +12 -17
- package/dist/esm/management/api/resources/organizations/resources/clientGrants/client/Client.mjs +15 -31
- package/dist/esm/management/api/resources/organizations/resources/discoveryDomains/client/Client.mjs +11 -14
- package/dist/esm/management/api/resources/organizations/resources/enabledConnections/client/Client.mjs +12 -17
- package/dist/esm/management/api/resources/organizations/resources/invitations/client/Client.mjs +26 -40
- package/dist/esm/management/api/resources/organizations/resources/members/client/Client.mjs +13 -20
- package/dist/esm/management/api/resources/organizations/resources/members/resources/roles/client/Client.mjs +12 -17
- package/dist/esm/management/api/resources/prompts/resources/rendering/client/Client.mjs +17 -32
- package/dist/esm/management/api/resources/resourceServers/client/Client.mjs +24 -39
- package/dist/esm/management/api/resources/roles/client/Client.mjs +13 -20
- package/dist/esm/management/api/resources/roles/resources/permissions/client/Client.mjs +12 -17
- package/dist/esm/management/api/resources/roles/resources/users/client/Client.mjs +11 -14
- package/dist/esm/management/api/resources/rules/client/Client.mjs +26 -40
- package/dist/esm/management/api/resources/selfServiceProfiles/client/Client.mjs +12 -17
- package/dist/esm/management/api/resources/stats/client/Client.mjs +4 -7
- package/dist/esm/management/api/resources/tenants/resources/settings/client/Client.mjs +11 -14
- package/dist/esm/management/api/resources/tokenExchangeProfiles/client/Client.mjs +11 -14
- package/dist/esm/management/api/resources/userAttributeProfiles/client/Client.mjs +11 -14
- package/dist/esm/management/api/resources/userBlocks/client/Client.mjs +24 -25
- package/dist/esm/management/api/resources/userGrants/client/Client.mjs +18 -28
- package/dist/esm/management/api/resources/users/client/Client.mjs +42 -67
- package/dist/esm/management/api/resources/users/resources/authenticationMethods/client/Client.mjs +12 -17
- package/dist/esm/management/api/resources/users/resources/connectedAccounts/client/Client.mjs +11 -14
- package/dist/esm/management/api/resources/users/resources/groups/client/Client.mjs +13 -20
- package/dist/esm/management/api/resources/users/resources/logs/client/Client.mjs +13 -20
- package/dist/esm/management/api/resources/users/resources/organizations/client/Client.mjs +12 -17
- package/dist/esm/management/api/resources/users/resources/permissions/client/Client.mjs +12 -17
- package/dist/esm/management/api/resources/users/resources/refreshToken/client/Client.mjs +11 -14
- package/dist/esm/management/api/resources/users/resources/roles/client/Client.mjs +12 -17
- package/dist/esm/management/api/resources/users/resources/sessions/client/Client.mjs +11 -14
- package/dist/esm/management/api/resources/verifiableCredentials/resources/verification/resources/templates/client/Client.mjs +11 -14
- package/dist/esm/management/api/types/types.d.mts +4448 -4299
- package/dist/esm/management/api/types/types.mjs +32 -3
- package/dist/esm/management/auth/BearerAuthProvider.d.mts +14 -10
- package/dist/esm/management/auth/BearerAuthProvider.mjs +15 -6
- package/dist/esm/management/core/fetcher/EndpointSupplier.d.mts +2 -2
- package/dist/esm/management/core/fetcher/Fetcher.d.mts +1 -2
- package/dist/esm/management/core/fetcher/Fetcher.mjs +7 -1
- package/dist/esm/management/core/form-data-utils/FormDataWrapper.mjs +1 -1
- package/dist/esm/management/core/headers.d.mts +2 -2
- package/dist/esm/management/core/pagination/CustomPager.d.mts +29 -44
- package/dist/esm/management/core/pagination/CustomPager.mjs +58 -41
- package/dist/esm/management/core/pagination/exports.d.mts +0 -1
- package/dist/esm/management/core/pagination/exports.mjs +1 -1
- package/dist/esm/management/core/pagination/index.d.mts +1 -1
- package/dist/esm/management/core/pagination/index.mjs +1 -1
- package/dist/esm/management/version.d.mts +1 -1
- package/dist/esm/management/version.mjs +1 -1
- package/package.json +4 -3
- package/reference.md +271 -119
|
@@ -726,6 +726,7 @@ export const AculRenderingModeEnum = {
|
|
|
726
726
|
Advanced: "advanced",
|
|
727
727
|
Standard: "standard",
|
|
728
728
|
};
|
|
729
|
+
/** Assessors to clear. */
|
|
729
730
|
export const AssessorsTypeEnum = {
|
|
730
731
|
NewDevice: "new-device",
|
|
731
732
|
};
|
|
@@ -1012,6 +1013,7 @@ export const ClientTokenEndpointAuthMethodOrNullEnum = {
|
|
|
1012
1013
|
};
|
|
1013
1014
|
export const ClientTokenExchangeTypeEnum = {
|
|
1014
1015
|
CustomAuthentication: "custom_authentication",
|
|
1016
|
+
OnBehalfOfTokenExchange: "on_behalf_of_token_exchange",
|
|
1015
1017
|
};
|
|
1016
1018
|
/** The access type for the connected account. */
|
|
1017
1019
|
export const ConnectedAccountAccessTypeEnum = {
|
|
@@ -1034,6 +1036,11 @@ export const ConnectionDigestAlgorithmEnumSaml = {
|
|
|
1034
1036
|
Sha1: "sha1",
|
|
1035
1037
|
Sha256: "sha256",
|
|
1036
1038
|
};
|
|
1039
|
+
/** Algorithm used for DPoP proof JWT signing. */
|
|
1040
|
+
export const ConnectionDpopSigningAlgEnum = {
|
|
1041
|
+
Es256: "ES256",
|
|
1042
|
+
Ed25519: "Ed25519",
|
|
1043
|
+
};
|
|
1037
1044
|
export var ConnectionEmailEmail;
|
|
1038
1045
|
(function (ConnectionEmailEmail) {
|
|
1039
1046
|
/** Email template syntax type */
|
|
@@ -1043,10 +1050,13 @@ export var ConnectionEmailEmail;
|
|
|
1043
1050
|
})(ConnectionEmailEmail || (ConnectionEmailEmail = {}));
|
|
1044
1051
|
/** Algorithm allowed to verify the ID tokens. */
|
|
1045
1052
|
export const ConnectionIdTokenSignedResponseAlgEnum = {
|
|
1053
|
+
Es256: "ES256",
|
|
1054
|
+
Es384: "ES384",
|
|
1055
|
+
Ps256: "PS256",
|
|
1056
|
+
Ps384: "PS384",
|
|
1046
1057
|
Rs256: "RS256",
|
|
1058
|
+
Rs384: "RS384",
|
|
1047
1059
|
Rs512: "RS512",
|
|
1048
|
-
Ps256: "PS256",
|
|
1049
|
-
Es256: "ES256",
|
|
1050
1060
|
};
|
|
1051
1061
|
/** Order of precedence for attribute types */
|
|
1052
1062
|
export const ConnectionIdentifierPrecedenceEnum = {
|
|
@@ -1562,6 +1572,10 @@ export const ConnectionSignatureAlgorithmEnumSaml = {
|
|
|
1562
1572
|
RsaSha1: "rsa-sha1",
|
|
1563
1573
|
RsaSha256: "rsa-sha256",
|
|
1564
1574
|
};
|
|
1575
|
+
/** OAuth 1.0a signature algorithm used when signing request-token and access-token calls for this connection (RSA-SHA1 only). */
|
|
1576
|
+
export const ConnectionSignatureMethodOAuth1 = {
|
|
1577
|
+
RsaSha1: "RSA-SHA1",
|
|
1578
|
+
};
|
|
1565
1579
|
/** Specifies the signup behavior for password authentication */
|
|
1566
1580
|
export const ConnectionSignupBehaviorEnum = {
|
|
1567
1581
|
Allow: "allow",
|
|
@@ -1645,8 +1659,11 @@ export const ConnectionTokenEndpointAuthMethodEnum = {
|
|
|
1645
1659
|
/** Algorithm used to sign client_assertions. */
|
|
1646
1660
|
export const ConnectionTokenEndpointAuthSigningAlgEnum = {
|
|
1647
1661
|
Es256: "ES256",
|
|
1662
|
+
Es384: "ES384",
|
|
1648
1663
|
Ps256: "PS256",
|
|
1664
|
+
Ps384: "PS384",
|
|
1649
1665
|
Rs256: "RS256",
|
|
1666
|
+
Rs384: "RS384",
|
|
1650
1667
|
Rs512: "RS512",
|
|
1651
1668
|
};
|
|
1652
1669
|
/** OIDC communication channel type. 'back_channel' (confidential client) exchanges tokens server-side for stronger security; 'front_channel' handles responses in the browser. */
|
|
@@ -3645,6 +3662,16 @@ export const PhoneTemplateNotificationTypeEnum = {
|
|
|
3645
3662
|
BlockedAccount: "blocked_account",
|
|
3646
3663
|
PasswordBreach: "password_breach",
|
|
3647
3664
|
};
|
|
3665
|
+
/** Selected Signing Algorithm */
|
|
3666
|
+
export const PostConnectionKeysAlgEnum = {
|
|
3667
|
+
Rs256: "RS256",
|
|
3668
|
+
Rs384: "RS384",
|
|
3669
|
+
Rs512: "RS512",
|
|
3670
|
+
Ps256: "PS256",
|
|
3671
|
+
Ps384: "PS384",
|
|
3672
|
+
Es256: "ES256",
|
|
3673
|
+
Es384: "ES384",
|
|
3674
|
+
};
|
|
3648
3675
|
/** Applies to phone authentication methods only. The preferred communication method. */
|
|
3649
3676
|
export const PreferredAuthenticationMethodEnum = {
|
|
3650
3677
|
Voice: "voice",
|
|
@@ -3804,7 +3831,6 @@ export const ResourceServerProofOfPossessionMechanismEnum = {
|
|
|
3804
3831
|
/** Specifies which client types require Proof-of-Possession */
|
|
3805
3832
|
export const ResourceServerProofOfPossessionRequiredForEnum = {
|
|
3806
3833
|
PublicClients: "public_clients",
|
|
3807
|
-
ConfidentialClients: "confidential_clients",
|
|
3808
3834
|
AllClients: "all_clients",
|
|
3809
3835
|
};
|
|
3810
3836
|
/** Defines the client flows policy for the resource server */
|
|
@@ -3845,9 +3871,12 @@ export const ResourceServerTokenEncryptionFormatEnum = {
|
|
|
3845
3871
|
/** Selected Signing Algorithm */
|
|
3846
3872
|
export const RotateConnectionKeysSigningAlgEnum = {
|
|
3847
3873
|
Rs256: "RS256",
|
|
3874
|
+
Rs384: "RS384",
|
|
3848
3875
|
Rs512: "RS512",
|
|
3849
3876
|
Ps256: "PS256",
|
|
3877
|
+
Ps384: "PS384",
|
|
3850
3878
|
Es256: "ES256",
|
|
3879
|
+
Es384: "ES384",
|
|
3851
3880
|
};
|
|
3852
3881
|
/** Name of the screen */
|
|
3853
3882
|
export const ScreenGroupNameEnum = {
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import * as core from "../core/index.mjs";
|
|
2
|
-
|
|
3
|
-
interface AuthOptions {
|
|
4
|
-
token: core.Supplier<core.BearerToken>;
|
|
5
|
-
}
|
|
6
|
-
interface Options extends AuthOptions {
|
|
7
|
-
}
|
|
8
|
-
}
|
|
2
|
+
declare const TOKEN_PARAM: "token";
|
|
9
3
|
export declare class BearerAuthProvider implements core.AuthProvider {
|
|
10
|
-
private readonly
|
|
4
|
+
private readonly options;
|
|
11
5
|
constructor(options: BearerAuthProvider.Options);
|
|
12
|
-
static canCreate(options: BearerAuthProvider.Options): boolean;
|
|
13
|
-
getAuthRequest(
|
|
6
|
+
static canCreate(options: Partial<BearerAuthProvider.Options>): boolean;
|
|
7
|
+
getAuthRequest({ endpointMetadata, }?: {
|
|
14
8
|
endpointMetadata?: core.EndpointMetadata;
|
|
15
9
|
}): Promise<core.AuthRequest>;
|
|
16
10
|
}
|
|
11
|
+
export declare namespace BearerAuthProvider {
|
|
12
|
+
const AUTH_SCHEME: "bearerAuth";
|
|
13
|
+
const AUTH_CONFIG_ERROR_MESSAGE: string;
|
|
14
|
+
type Options = AuthOptions;
|
|
15
|
+
type AuthOptions = {
|
|
16
|
+
[TOKEN_PARAM]: core.Supplier<core.BearerToken>;
|
|
17
|
+
};
|
|
18
|
+
function createInstance(options: Options): core.AuthProvider;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -10,19 +10,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
import * as core from "../core/index.mjs";
|
|
12
12
|
import * as errors from "../errors/index.mjs";
|
|
13
|
+
const TOKEN_PARAM = "token";
|
|
13
14
|
export class BearerAuthProvider {
|
|
14
15
|
constructor(options) {
|
|
15
|
-
this.
|
|
16
|
+
this.options = options;
|
|
16
17
|
}
|
|
17
18
|
static canCreate(options) {
|
|
18
|
-
return options
|
|
19
|
+
return (options === null || options === void 0 ? void 0 : options[TOKEN_PARAM]) != null;
|
|
19
20
|
}
|
|
20
|
-
getAuthRequest(
|
|
21
|
-
return __awaiter(this,
|
|
22
|
-
const token = yield core.Supplier.get(this.
|
|
21
|
+
getAuthRequest() {
|
|
22
|
+
return __awaiter(this, arguments, void 0, function* ({ endpointMetadata, } = {}) {
|
|
23
|
+
const token = yield core.Supplier.get(this.options[TOKEN_PARAM]);
|
|
23
24
|
if (token == null) {
|
|
24
25
|
throw new errors.ManagementError({
|
|
25
|
-
message:
|
|
26
|
+
message: BearerAuthProvider.AUTH_CONFIG_ERROR_MESSAGE,
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
29
|
return {
|
|
@@ -31,3 +32,11 @@ export class BearerAuthProvider {
|
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
34
|
}
|
|
35
|
+
(function (BearerAuthProvider) {
|
|
36
|
+
BearerAuthProvider.AUTH_SCHEME = "bearerAuth";
|
|
37
|
+
BearerAuthProvider.AUTH_CONFIG_ERROR_MESSAGE = `Please provide '${TOKEN_PARAM}' when initializing the client`;
|
|
38
|
+
function createInstance(options) {
|
|
39
|
+
return new BearerAuthProvider(options);
|
|
40
|
+
}
|
|
41
|
+
BearerAuthProvider.createInstance = createInstance;
|
|
42
|
+
})(BearerAuthProvider || (BearerAuthProvider = {}));
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { EndpointMetadata } from "./EndpointMetadata.mjs";
|
|
2
2
|
import type { Supplier } from "./Supplier.mjs";
|
|
3
3
|
type EndpointSupplierFn<T> = (arg: {
|
|
4
|
-
endpointMetadata
|
|
4
|
+
endpointMetadata?: EndpointMetadata;
|
|
5
5
|
}) => T | Promise<T>;
|
|
6
6
|
export type EndpointSupplier<T> = Supplier<T> | EndpointSupplierFn<T>;
|
|
7
7
|
export declare const EndpointSupplier: {
|
|
8
8
|
get: <T>(supplier: EndpointSupplier<T>, arg: {
|
|
9
|
-
endpointMetadata
|
|
9
|
+
endpointMetadata?: EndpointMetadata;
|
|
10
10
|
}) => Promise<T>;
|
|
11
11
|
};
|
|
12
12
|
export {};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { type LogConfig, type Logger } from "../logging/logger.mjs";
|
|
2
2
|
import type { APIResponse } from "./APIResponse.mjs";
|
|
3
3
|
import type { EndpointMetadata } from "./EndpointMetadata.mjs";
|
|
4
|
-
import { EndpointSupplier } from "./EndpointSupplier.mjs";
|
|
5
4
|
export type FetchFunction = <R = unknown>(args: Fetcher.Args) => Promise<APIResponse<R, Fetcher.Error>>;
|
|
6
5
|
export declare namespace Fetcher {
|
|
7
6
|
interface Args {
|
|
8
7
|
url: string;
|
|
9
8
|
method: string;
|
|
10
9
|
contentType?: string;
|
|
11
|
-
headers?: Record<string,
|
|
10
|
+
headers?: Record<string, unknown>;
|
|
12
11
|
queryParameters?: Record<string, unknown>;
|
|
13
12
|
body?: unknown;
|
|
14
13
|
timeoutMs?: number;
|
|
@@ -152,7 +152,13 @@ function getHeaders(args) {
|
|
|
152
152
|
return __awaiter(this, void 0, void 0, function* () {
|
|
153
153
|
var _a;
|
|
154
154
|
const newHeaders = new Headers();
|
|
155
|
-
newHeaders.set("Accept", args.responseType === "json"
|
|
155
|
+
newHeaders.set("Accept", args.responseType === "json"
|
|
156
|
+
? "application/json"
|
|
157
|
+
: args.responseType === "text"
|
|
158
|
+
? "text/plain"
|
|
159
|
+
: args.responseType === "sse"
|
|
160
|
+
? "text/event-stream"
|
|
161
|
+
: "*/*");
|
|
156
162
|
if (args.body !== undefined && args.contentType != null) {
|
|
157
163
|
newHeaders.set("Content-Type", args.contentType);
|
|
158
164
|
}
|
|
@@ -115,7 +115,7 @@ function streamToBuffer(stream) {
|
|
|
115
115
|
}
|
|
116
116
|
return Buffer.from(result);
|
|
117
117
|
}
|
|
118
|
-
throw new Error(
|
|
118
|
+
throw new Error(`Unsupported stream type: ${typeof stream}. Expected Node.js Readable stream or Web ReadableStream.`);
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
121
|
function convertToBlob(value, contentType) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function mergeHeaders
|
|
2
|
-
export declare function mergeOnlyDefinedHeaders
|
|
1
|
+
export declare function mergeHeaders(...headersArray: (Record<string, unknown> | null | undefined)[]): Record<string, unknown>;
|
|
2
|
+
export declare function mergeOnlyDefinedHeaders(...headersArray: (Record<string, unknown> | null | undefined)[]): Record<string, unknown>;
|
|
@@ -1,49 +1,34 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { BaseRequestOptions, NormalizedClientOptions } from "../../BaseClient.mjs";
|
|
2
|
+
import type { APIResponse } from "../fetcher/APIResponse.mjs";
|
|
3
|
+
import type { Fetcher } from "../fetcher/Fetcher.mjs";
|
|
4
|
+
import type { RawResponse } from "../fetcher/index.mjs";
|
|
2
5
|
/**
|
|
3
|
-
* Parser function type for custom pagination.
|
|
4
|
-
* SDK authors implement this to define how to extract items and determine pagination state.
|
|
5
|
-
*
|
|
6
|
-
* @template TItem The type of items in the paginated response.
|
|
7
|
-
* @template TRequest The type of the request object.
|
|
8
|
-
* @template TResponse The type of the API response.
|
|
9
|
-
*/
|
|
10
|
-
export type CustomPagerParser<TItem, TRequest, TResponse> = (request: TRequest, response: WithRawResponse<TResponse>) => Promise<{
|
|
11
|
-
/** The request to use for fetching the next page, if any */
|
|
12
|
-
nextRequest?: TRequest;
|
|
13
|
-
/** Whether there is a next page available */
|
|
14
|
-
hasNextPage: boolean;
|
|
15
|
-
/** The request to use for fetching the previous page, if any */
|
|
16
|
-
previousRequest?: TRequest;
|
|
17
|
-
/** Whether there is a previous page available */
|
|
18
|
-
hasPreviousPage: boolean;
|
|
19
|
-
/** The items extracted from the current response */
|
|
20
|
-
items: TItem[];
|
|
21
|
-
}>;
|
|
22
|
-
/**
|
|
23
|
-
* A custom pager for paginated API responses where the pagination logic
|
|
24
|
-
* must be implemented by the SDK author.
|
|
25
|
-
*
|
|
26
|
-
* SDK authors provide a parser callback to extract items and determine
|
|
27
|
-
* pagination state from responses.
|
|
28
6
|
*
|
|
29
7
|
* @template TItem The type of the items in the page.
|
|
30
|
-
* @template TRequest The type of the request object.
|
|
31
8
|
* @template TResponse The type of the API response.
|
|
32
9
|
*/
|
|
33
|
-
export declare class CustomPager<TItem,
|
|
10
|
+
export declare class CustomPager<TItem, TResponse> implements AsyncIterable<TItem> {
|
|
34
11
|
/** The items from the current page */
|
|
35
12
|
data: TItem[];
|
|
36
13
|
/** The raw HTTP response */
|
|
37
14
|
rawResponse: RawResponse;
|
|
38
15
|
/** The parsed response object */
|
|
39
16
|
response: TResponse;
|
|
40
|
-
private
|
|
41
|
-
private parser;
|
|
17
|
+
private sendRequest;
|
|
42
18
|
private nextRequest?;
|
|
43
19
|
private previousRequest?;
|
|
44
20
|
private _hasNextPage;
|
|
45
21
|
private _hasPreviousPage;
|
|
46
|
-
|
|
22
|
+
constructor(args: {
|
|
23
|
+
response: TResponse;
|
|
24
|
+
rawResponse: RawResponse;
|
|
25
|
+
items: TItem[];
|
|
26
|
+
hasNextPage: boolean;
|
|
27
|
+
hasPreviousPage: boolean;
|
|
28
|
+
nextRequest?: Fetcher.Args;
|
|
29
|
+
previousRequest?: Fetcher.Args;
|
|
30
|
+
sendRequest: (request: Fetcher.Args) => Promise<APIResponse<TResponse, Fetcher.Error>>;
|
|
31
|
+
});
|
|
47
32
|
/**
|
|
48
33
|
* @returns whether there is a next page to load
|
|
49
34
|
*/
|
|
@@ -52,6 +37,13 @@ export declare class CustomPager<TItem, TRequest, TResponse> implements AsyncIte
|
|
|
52
37
|
* @returns whether there is a previous page to load
|
|
53
38
|
*/
|
|
54
39
|
hasPreviousPage(): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Returns the current page data.
|
|
42
|
+
* This is an alias for the `data` property for consistency with other pagination APIs.
|
|
43
|
+
*
|
|
44
|
+
* @returns the items from the current page
|
|
45
|
+
*/
|
|
46
|
+
getCurrentPage(): TItem[];
|
|
55
47
|
/**
|
|
56
48
|
* Retrieves the next page of results.
|
|
57
49
|
* @returns this pager with updated data
|
|
@@ -66,17 +58,10 @@ export declare class CustomPager<TItem, TRequest, TResponse> implements AsyncIte
|
|
|
66
58
|
getPreviousPage(): Promise<this>;
|
|
67
59
|
private iterMessages;
|
|
68
60
|
[Symbol.asyncIterator](): AsyncIterator<TItem, void, unknown>;
|
|
69
|
-
/**
|
|
70
|
-
* Creates a CustomPager by making the initial request and parsing the response.
|
|
71
|
-
*
|
|
72
|
-
* @param args.sendRequest Function to send a request and get a response
|
|
73
|
-
* @param args.initialRequest The initial request to start pagination
|
|
74
|
-
* @param args.parse The parser function to extract items and pagination state
|
|
75
|
-
* @returns A new CustomPager instance
|
|
76
|
-
*/
|
|
77
|
-
static create<TItem, TRequest, TResponse>(args: {
|
|
78
|
-
sendRequest: (request: TRequest) => HttpResponsePromise<TResponse>;
|
|
79
|
-
initialRequest: TRequest;
|
|
80
|
-
parse: CustomPagerParser<TItem, TRequest, TResponse>;
|
|
81
|
-
}): Promise<CustomPager<TItem, TRequest, TResponse>>;
|
|
82
61
|
}
|
|
62
|
+
export declare function createCustomPager<TItem, TResponse>({ sendRequest, initialHttpRequest, clientOptions, }: {
|
|
63
|
+
sendRequest: (request: Fetcher.Args) => Promise<APIResponse<TResponse, Fetcher.Error>>;
|
|
64
|
+
initialHttpRequest: Fetcher.Args;
|
|
65
|
+
clientOptions: NormalizedClientOptions;
|
|
66
|
+
requestOptions?: BaseRequestOptions;
|
|
67
|
+
}): Promise<CustomPager<TItem, TResponse>>;
|
|
@@ -28,14 +28,8 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
|
28
28
|
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
|
-
* A custom pager for paginated API responses where the pagination logic
|
|
32
|
-
* must be implemented by the SDK author.
|
|
33
|
-
*
|
|
34
|
-
* SDK authors provide a parser callback to extract items and determine
|
|
35
|
-
* pagination state from responses.
|
|
36
31
|
*
|
|
37
32
|
* @template TItem The type of the items in the page.
|
|
38
|
-
* @template TRequest The type of the request object.
|
|
39
33
|
* @template TResponse The type of the API response.
|
|
40
34
|
*/
|
|
41
35
|
export class CustomPager {
|
|
@@ -47,8 +41,7 @@ export class CustomPager {
|
|
|
47
41
|
this._hasPreviousPage = args.hasPreviousPage;
|
|
48
42
|
this.nextRequest = args.nextRequest;
|
|
49
43
|
this.previousRequest = args.previousRequest;
|
|
50
|
-
this.
|
|
51
|
-
this.parser = args.parser;
|
|
44
|
+
this.sendRequest = args.sendRequest;
|
|
52
45
|
}
|
|
53
46
|
/**
|
|
54
47
|
* @returns whether there is a next page to load
|
|
@@ -62,6 +55,15 @@ export class CustomPager {
|
|
|
62
55
|
hasPreviousPage() {
|
|
63
56
|
return this._hasPreviousPage;
|
|
64
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Returns the current page data.
|
|
60
|
+
* This is an alias for the `data` property for consistency with other pagination APIs.
|
|
61
|
+
*
|
|
62
|
+
* @returns the items from the current page
|
|
63
|
+
*/
|
|
64
|
+
getCurrentPage() {
|
|
65
|
+
return this.data;
|
|
66
|
+
}
|
|
65
67
|
/**
|
|
66
68
|
* Retrieves the next page of results.
|
|
67
69
|
* @returns this pager with updated data
|
|
@@ -72,14 +74,19 @@ export class CustomPager {
|
|
|
72
74
|
if (!this._hasNextPage || !this.nextRequest) {
|
|
73
75
|
throw new Error("No next page available");
|
|
74
76
|
}
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
+
const response = yield this.sendRequest(this.nextRequest);
|
|
78
|
+
if (!response.ok) {
|
|
79
|
+
const reason = response.error.reason === "status-code" ? `HTTP ${response.error.statusCode}` : response.error.reason;
|
|
80
|
+
throw new Error(`Failed to fetch next page: ${reason}`);
|
|
81
|
+
}
|
|
82
|
+
const data = response.body;
|
|
83
|
+
const rawResponse = response.rawResponse;
|
|
84
|
+
const parsed = yield parse({ request: this.nextRequest, data, rawResponse });
|
|
77
85
|
this.response = data;
|
|
78
86
|
this.rawResponse = rawResponse;
|
|
79
87
|
this.data = parsed.items;
|
|
80
88
|
this._hasNextPage = parsed.hasNextPage;
|
|
81
89
|
this._hasPreviousPage = parsed.hasPreviousPage;
|
|
82
|
-
this.context.currentRequest = this.nextRequest;
|
|
83
90
|
this.nextRequest = parsed.nextRequest;
|
|
84
91
|
this.previousRequest = parsed.previousRequest;
|
|
85
92
|
return this;
|
|
@@ -95,14 +102,19 @@ export class CustomPager {
|
|
|
95
102
|
if (!this._hasPreviousPage || !this.previousRequest) {
|
|
96
103
|
throw new Error("No previous page available");
|
|
97
104
|
}
|
|
98
|
-
const
|
|
99
|
-
|
|
105
|
+
const response = yield this.sendRequest(this.previousRequest);
|
|
106
|
+
if (!response.ok) {
|
|
107
|
+
const reason = response.error.reason === "status-code" ? `HTTP ${response.error.statusCode}` : response.error.reason;
|
|
108
|
+
throw new Error(`Failed to fetch previous page: ${reason}`);
|
|
109
|
+
}
|
|
110
|
+
const data = response.body;
|
|
111
|
+
const rawResponse = response.rawResponse;
|
|
112
|
+
const parsed = yield parse({ request: this.previousRequest, data, rawResponse });
|
|
100
113
|
this.response = data;
|
|
101
114
|
this.rawResponse = rawResponse;
|
|
102
115
|
this.data = parsed.items;
|
|
103
116
|
this._hasNextPage = parsed.hasNextPage;
|
|
104
117
|
this._hasPreviousPage = parsed.hasPreviousPage;
|
|
105
|
-
this.context.currentRequest = this.previousRequest;
|
|
106
118
|
this.nextRequest = parsed.nextRequest;
|
|
107
119
|
this.previousRequest = parsed.previousRequest;
|
|
108
120
|
return this;
|
|
@@ -141,32 +153,37 @@ export class CustomPager {
|
|
|
141
153
|
}
|
|
142
154
|
});
|
|
143
155
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
context: {
|
|
165
|
-
sendRequest: args.sendRequest,
|
|
166
|
-
currentRequest: args.initialRequest,
|
|
167
|
-
},
|
|
168
|
-
parser: args.parse,
|
|
169
|
-
});
|
|
156
|
+
}
|
|
157
|
+
export function createCustomPager(_a) {
|
|
158
|
+
return __awaiter(this, arguments, void 0, function* ({ sendRequest, initialHttpRequest, clientOptions, }) {
|
|
159
|
+
const response = yield sendRequest(initialHttpRequest);
|
|
160
|
+
if (!response.ok) {
|
|
161
|
+
const reason = response.error.reason === "status-code" ? `HTTP ${response.error.statusCode}` : response.error.reason;
|
|
162
|
+
throw new Error(`Failed to fetch initial page: ${reason}`);
|
|
163
|
+
}
|
|
164
|
+
const data = response.body;
|
|
165
|
+
const rawResponse = response.rawResponse;
|
|
166
|
+
const parsed = yield parse({ request: initialHttpRequest, data, rawResponse });
|
|
167
|
+
return new CustomPager({
|
|
168
|
+
response: data,
|
|
169
|
+
rawResponse,
|
|
170
|
+
items: parsed.items,
|
|
171
|
+
hasNextPage: parsed.hasNextPage,
|
|
172
|
+
hasPreviousPage: parsed.hasPreviousPage,
|
|
173
|
+
nextRequest: parsed.nextRequest,
|
|
174
|
+
previousRequest: parsed.previousRequest,
|
|
175
|
+
sendRequest: sendRequest,
|
|
170
176
|
});
|
|
171
|
-
}
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
function parse(args) {
|
|
180
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
181
|
+
// Placeholder implementation.
|
|
182
|
+
// TODO: Replace this with actual parsing logic.
|
|
183
|
+
return {
|
|
184
|
+
items: [],
|
|
185
|
+
hasNextPage: false,
|
|
186
|
+
hasPreviousPage: false,
|
|
187
|
+
};
|
|
188
|
+
});
|
|
172
189
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { CustomPager,
|
|
1
|
+
export { CustomPager, createCustomPager } from "./CustomPager.mjs";
|
|
2
2
|
export { Page } from "./Page.mjs";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { CustomPager } from "./CustomPager.mjs";
|
|
1
|
+
export { CustomPager, createCustomPager } from "./CustomPager.mjs";
|
|
2
2
|
export { Page } from "./Page.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "5.
|
|
1
|
+
export declare const SDK_VERSION = "5.4.0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "5.
|
|
1
|
+
export const SDK_VERSION = "5.4.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "auth0",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"msw": "2.11.2",
|
|
88
88
|
"@types/node": "^18.19.70",
|
|
89
89
|
"typescript": "~5.7.2",
|
|
90
|
-
"prettier": "3.4
|
|
90
|
+
"prettier": "3.7.4",
|
|
91
91
|
"typedoc": "^0.28.7",
|
|
92
92
|
"typedoc-plugin-missing-exports": "^4.0.0",
|
|
93
93
|
"nock": "^14.0.6",
|
|
@@ -106,7 +106,8 @@
|
|
|
106
106
|
"fs": false,
|
|
107
107
|
"os": false,
|
|
108
108
|
"path": false,
|
|
109
|
-
"stream": false
|
|
109
|
+
"stream": false,
|
|
110
|
+
"crypto": false
|
|
110
111
|
},
|
|
111
112
|
"packageManager": "yarn@1.22.22",
|
|
112
113
|
"engines": {
|