auth0 6.4.0 → 7.1.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/README.md +20 -15
- package/dist/cjs/index.d.ts +0 -2
- package/dist/cjs/index.js +0 -2
- package/dist/cjs/lib/errors.d.ts +0 -18
- package/dist/cjs/lib/errors.js +1 -25
- package/dist/cjs/lib/middleware/auth0-client-telemetry.d.ts +3 -7
- package/dist/cjs/lib/middleware/auth0-client-telemetry.js +1 -25
- package/dist/cjs/lib/models.d.ts +0 -24
- package/dist/cjs/lib/models.js +0 -53
- package/dist/cjs/management/Client.d.ts +5 -5
- package/dist/cjs/management/Client.js +28 -28
- package/dist/cjs/management/api/errors/GatewayTimeoutError.d.ts +5 -0
- package/dist/cjs/management/api/errors/GatewayTimeoutError.js +54 -0
- package/dist/cjs/management/api/errors/index.d.ts +1 -0
- package/dist/cjs/management/api/errors/index.js +1 -0
- package/dist/cjs/management/api/requests/requests.d.ts +112 -88
- package/dist/cjs/management/api/resources/experimentation/client/Client.d.ts +12 -0
- package/dist/cjs/management/api/resources/experimentation/client/Client.js +16 -0
- package/dist/cjs/management/api/resources/experimentation/exports.d.ts +3 -0
- package/dist/cjs/management/api/resources/experimentation/exports.js +22 -0
- package/dist/cjs/management/api/resources/experimentation/index.d.ts +2 -0
- package/dist/cjs/management/api/resources/experimentation/index.js +18 -0
- package/dist/cjs/management/api/resources/experimentation/resources/experiments/client/Client.d.ts +34 -0
- package/dist/cjs/management/api/resources/experimentation/resources/experiments/client/Client.js +131 -0
- package/dist/cjs/management/api/resources/experimentation/resources/experiments/client/index.js +2 -0
- package/dist/cjs/management/api/resources/experimentation/resources/experiments/exports.d.ts +2 -0
- package/dist/cjs/management/api/resources/{organizationTemplates → experimentation/resources/experiments}/exports.js +2 -2
- package/dist/cjs/management/api/resources/experimentation/resources/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/experimentation/resources/index.js +37 -0
- package/dist/cjs/management/api/resources/guardian/client/Client.d.ts +40 -1
- package/dist/cjs/management/api/resources/guardian/client/Client.js +172 -0
- package/dist/cjs/management/api/resources/guardian/resources/factors/client/Client.d.ts +3 -0
- package/dist/cjs/management/api/resources/guardian/resources/factors/client/Client.js +11 -6
- package/dist/cjs/management/api/resources/guardian/resources/factors/resources/email/client/Client.d.ts +46 -0
- package/dist/cjs/management/api/resources/guardian/resources/factors/resources/email/client/Client.js +181 -0
- package/dist/cjs/management/api/resources/guardian/resources/factors/resources/email/client/index.js +2 -0
- package/dist/cjs/management/api/resources/guardian/resources/factors/resources/email/exports.d.ts +2 -0
- package/dist/cjs/management/api/resources/guardian/resources/factors/resources/email/exports.js +21 -0
- package/dist/cjs/management/api/resources/guardian/resources/factors/resources/email/index.d.ts +1 -0
- package/dist/cjs/{lib → management/api/resources/guardian/resources/factors/resources/email}/index.js +1 -2
- package/dist/cjs/management/api/resources/guardian/resources/factors/resources/index.d.ts +1 -0
- package/dist/cjs/management/api/resources/guardian/resources/factors/resources/index.js +2 -1
- package/dist/cjs/management/api/resources/guardian/resources/factors/resources/phone/client/Client.d.ts +33 -0
- package/dist/cjs/management/api/resources/guardian/resources/factors/resources/phone/client/Client.js +122 -0
- package/dist/cjs/management/api/resources/index.d.ts +1 -1
- package/dist/cjs/management/api/resources/index.js +2 -2
- package/dist/cjs/management/api/resources/organizations/client/Client.d.ts +36 -0
- package/dist/cjs/management/api/resources/organizations/client/Client.js +104 -0
- package/dist/cjs/management/api/resources/resourceServers/client/Client.d.ts +29 -0
- package/dist/cjs/management/api/resources/resourceServers/client/Client.js +103 -0
- package/dist/cjs/management/api/types/types.d.ts +226 -51
- package/dist/cjs/management/api/types/types.js +37 -36
- package/dist/cjs/management/version.d.ts +1 -1
- package/dist/cjs/management/version.js +1 -1
- package/dist/cjs/management/wrapper/ManagementClient.d.ts +9 -2
- package/dist/cjs/management/wrapper/ManagementClient.js +0 -1
- package/dist/cjs/management/wrapper/token-provider.d.ts +4 -2
- package/dist/cjs/management/wrapper/token-provider.js +142 -11
- package/dist/cjs/utils.d.ts +0 -18
- package/dist/cjs/utils.js +1 -32
- package/dist/esm/index.d.mts +0 -2
- package/dist/esm/index.mjs +0 -2
- package/dist/esm/lib/errors.d.mts +0 -18
- package/dist/esm/lib/errors.mjs +0 -22
- package/dist/esm/lib/middleware/auth0-client-telemetry.d.mts +3 -7
- package/dist/esm/lib/middleware/auth0-client-telemetry.mjs +1 -25
- package/dist/esm/lib/models.d.mts +0 -24
- package/dist/esm/lib/models.mjs +1 -49
- package/dist/esm/management/Client.d.mts +5 -5
- package/dist/esm/management/Client.mjs +7 -7
- package/dist/esm/management/api/errors/GatewayTimeoutError.d.mts +5 -0
- package/dist/esm/management/api/errors/GatewayTimeoutError.mjs +17 -0
- package/dist/esm/management/api/errors/index.d.mts +1 -0
- package/dist/esm/management/api/errors/index.mjs +1 -0
- package/dist/esm/management/api/requests/requests.d.mts +112 -88
- package/dist/esm/management/api/resources/experimentation/client/Client.d.mts +12 -0
- package/dist/esm/management/api/resources/experimentation/client/Client.mjs +12 -0
- package/dist/esm/management/api/resources/experimentation/client/index.d.mts +1 -0
- package/dist/esm/management/api/resources/experimentation/client/index.mjs +1 -0
- package/dist/esm/management/api/resources/experimentation/exports.d.mts +3 -0
- package/dist/esm/management/api/resources/experimentation/exports.mjs +4 -0
- package/dist/esm/management/api/resources/experimentation/index.d.mts +2 -0
- package/dist/esm/management/api/resources/experimentation/index.mjs +2 -0
- package/dist/esm/management/api/resources/experimentation/resources/experiments/client/Client.d.mts +34 -0
- package/dist/esm/management/api/resources/experimentation/resources/experiments/client/Client.mjs +94 -0
- package/dist/esm/management/api/resources/experimentation/resources/experiments/client/index.d.mts +1 -0
- package/dist/esm/management/api/resources/experimentation/resources/experiments/client/index.mjs +1 -0
- package/dist/esm/management/api/resources/experimentation/resources/experiments/exports.d.mts +2 -0
- package/dist/esm/management/api/resources/{organizationTemplates → experimentation/resources/experiments}/exports.mjs +1 -1
- package/dist/esm/management/api/resources/experimentation/resources/index.d.mts +1 -0
- package/dist/esm/management/api/resources/experimentation/resources/index.mjs +1 -0
- package/dist/esm/management/api/resources/guardian/client/Client.d.mts +40 -1
- package/dist/esm/management/api/resources/guardian/client/Client.mjs +139 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/client/Client.d.mts +3 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/client/Client.mjs +5 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/resources/email/client/Client.d.mts +46 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/resources/email/client/Client.mjs +144 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/resources/email/client/index.d.mts +1 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/resources/email/client/index.mjs +1 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/resources/email/exports.d.mts +2 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/resources/email/exports.mjs +3 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/resources/email/index.d.mts +1 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/resources/email/index.mjs +1 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/resources/index.d.mts +1 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/resources/index.mjs +1 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/resources/phone/client/Client.d.mts +33 -0
- package/dist/esm/management/api/resources/guardian/resources/factors/resources/phone/client/Client.mjs +122 -0
- package/dist/esm/management/api/resources/index.d.mts +1 -1
- package/dist/esm/management/api/resources/index.mjs +1 -1
- package/dist/esm/management/api/resources/organizations/client/Client.d.mts +36 -0
- package/dist/esm/management/api/resources/organizations/client/Client.mjs +104 -0
- package/dist/esm/management/api/resources/resourceServers/client/Client.d.mts +29 -0
- package/dist/esm/management/api/resources/resourceServers/client/Client.mjs +103 -0
- package/dist/esm/management/api/types/types.d.mts +226 -51
- package/dist/esm/management/api/types/types.mjs +34 -33
- package/dist/esm/management/version.d.mts +1 -1
- package/dist/esm/management/version.mjs +1 -1
- package/dist/esm/management/wrapper/ManagementClient.d.mts +9 -2
- package/dist/esm/management/wrapper/ManagementClient.mjs +0 -1
- package/dist/esm/management/wrapper/token-provider.d.mts +4 -2
- package/dist/esm/management/wrapper/token-provider.mjs +142 -11
- package/dist/esm/utils.d.mts +0 -18
- package/dist/esm/utils.mjs +0 -30
- package/package.json +45 -23
- package/reference.md +654 -389
- package/dist/cjs/auth/backchannel.d.ts +0 -158
- package/dist/cjs/auth/backchannel.js +0 -135
- package/dist/cjs/auth/base-auth-api.d.ts +0 -41
- package/dist/cjs/auth/base-auth-api.js +0 -109
- package/dist/cjs/auth/client-authentication.d.ts +0 -27
- package/dist/cjs/auth/client-authentication.js +0 -82
- package/dist/cjs/auth/database.d.ts +0 -157
- package/dist/cjs/auth/database.js +0 -94
- package/dist/cjs/auth/id-token-validator.d.ts +0 -18
- package/dist/cjs/auth/id-token-validator.js +0 -158
- package/dist/cjs/auth/index.d.ts +0 -65
- package/dist/cjs/auth/index.js +0 -80
- package/dist/cjs/auth/oauth.d.ts +0 -462
- package/dist/cjs/auth/oauth.js +0 -280
- package/dist/cjs/auth/passwordless.d.ts +0 -165
- package/dist/cjs/auth/passwordless.js +0 -173
- package/dist/cjs/auth/tokenExchange.d.ts +0 -166
- package/dist/cjs/auth/tokenExchange.js +0 -74
- package/dist/cjs/lib/index.d.ts +0 -3
- package/dist/cjs/lib/runtime.d.ts +0 -61
- package/dist/cjs/lib/runtime.js +0 -222
- package/dist/cjs/management/api/resources/organizationTemplates/client/Client.d.ts +0 -106
- package/dist/cjs/management/api/resources/organizationTemplates/client/Client.js +0 -411
- package/dist/cjs/management/api/resources/organizationTemplates/exports.d.ts +0 -2
- package/dist/cjs/userinfo/index.d.ts +0 -87
- package/dist/cjs/userinfo/index.js +0 -104
- package/dist/esm/auth/backchannel.d.mts +0 -158
- package/dist/esm/auth/backchannel.mjs +0 -131
- package/dist/esm/auth/base-auth-api.d.mts +0 -41
- package/dist/esm/auth/base-auth-api.mjs +0 -103
- package/dist/esm/auth/client-authentication.d.mts +0 -27
- package/dist/esm/auth/client-authentication.mjs +0 -45
- package/dist/esm/auth/database.d.mts +0 -157
- package/dist/esm/auth/database.mjs +0 -90
- package/dist/esm/auth/id-token-validator.d.mts +0 -18
- package/dist/esm/auth/id-token-validator.mjs +0 -120
- package/dist/esm/auth/index.d.mts +0 -65
- package/dist/esm/auth/index.mjs +0 -60
- package/dist/esm/auth/oauth.d.mts +0 -462
- package/dist/esm/auth/oauth.mjs +0 -276
- package/dist/esm/auth/passwordless.d.mts +0 -165
- package/dist/esm/auth/passwordless.mjs +0 -169
- package/dist/esm/auth/tokenExchange.d.mts +0 -166
- package/dist/esm/auth/tokenExchange.mjs +0 -70
- package/dist/esm/lib/index.d.mts +0 -3
- package/dist/esm/lib/index.mjs +0 -2
- package/dist/esm/lib/runtime.d.mts +0 -61
- package/dist/esm/lib/runtime.mjs +0 -201
- package/dist/esm/management/api/resources/organizationTemplates/client/Client.d.mts +0 -106
- package/dist/esm/management/api/resources/organizationTemplates/client/Client.mjs +0 -374
- package/dist/esm/management/api/resources/organizationTemplates/exports.d.mts +0 -2
- package/dist/esm/userinfo/index.d.mts +0 -87
- package/dist/esm/userinfo/index.mjs +0 -98
- /package/dist/cjs/management/api/resources/{organizationTemplates → experimentation}/client/index.d.ts +0 -0
- /package/dist/cjs/management/api/resources/{organizationTemplates → experimentation}/client/index.js +0 -0
- /package/dist/{esm/management/api/resources/organizationTemplates/client/index.d.mts → cjs/management/api/resources/experimentation/resources/experiments/client/index.d.ts} +0 -0
- /package/dist/cjs/management/api/resources/{organizationTemplates → experimentation/resources/experiments}/index.d.ts +0 -0
- /package/dist/cjs/management/api/resources/{organizationTemplates → experimentation/resources/experiments}/index.js +0 -0
- /package/dist/{esm/management/api/resources/organizationTemplates/client/index.mjs → cjs/management/api/resources/guardian/resources/factors/resources/email/client/index.d.ts} +0 -0
- /package/dist/esm/management/api/resources/{organizationTemplates → experimentation/resources/experiments}/index.d.mts +0 -0
- /package/dist/esm/management/api/resources/{organizationTemplates → experimentation/resources/experiments}/index.mjs +0 -0
|
@@ -19,9 +19,9 @@ exports.FlowActionFlowDelayFlowParams = exports.FlowActionFlowDelayFlow = export
|
|
|
19
19
|
exports.FlowsVaultConnectioSetupTypeApiKeyEnum = exports.FlowsVaultConnectioSetupJwtAlgorithmEnum = exports.FlowActionZapierTriggerWebhookParams = exports.FlowActionZapierTriggerWebhook = exports.FlowActionXmlSerializeXml = exports.FlowActionXmlParseXml = exports.FlowActionWhatsappSendMessageParams = exports.FlowActionWhatsappSendMessage = exports.FlowActionTwilioSendSms = exports.FlowActionTwilioMakeCall = exports.FlowActionTelegramSendMessage = exports.FlowActionStripeUpdateCustomer = exports.FlowActionStripeGetCustomer = exports.FlowActionStripeFindCustomers = exports.FlowActionStripeDeleteTaxId = exports.FlowActionStripeCreatePortalSession = exports.FlowActionStripeCreateCustomer = exports.FlowActionStripeAddTaxId = exports.FlowActionSlackPostMessageParamsAttachment = exports.FlowActionSlackPostMessage = exports.FlowActionSendgridSendEmail = exports.FlowActionSalesforceUpdateLead = exports.FlowActionSalesforceSearchLeadsParams = exports.FlowActionSalesforceSearchLeads = exports.FlowActionSalesforceGetLead = exports.FlowActionSalesforceCreateLead = exports.FlowActionPipedriveAddPerson = exports.FlowActionPipedriveAddOrganization = exports.FlowActionPipedriveAddDeal = exports.FlowActionOtpVerifyCode = exports.FlowActionOtpGenerateCode = exports.FlowActionMailjetSendEmail = exports.FlowActionMailchimpUpsertMember = exports.FlowActionJwtVerifyJwt = exports.FlowActionJwtSignJwt = exports.FlowActionJwtDecodeJwt = exports.FlowActionJsonSerializeJson = exports.FlowActionJsonParseJson = exports.FlowActionJsonCreateJson = exports.FlowActionHubspotUpsertContact = exports.FlowActionHubspotGetContact = exports.FlowActionHubspotEnrollContact = exports.FlowActionHttpSendRequestParams = exports.FlowActionHttpSendRequest = exports.FlowActionGoogleSheetsAddRow = exports.FlowActionFlowStoreVars = exports.FlowActionFlowReturnJson = exports.FlowActionFlowMapValue = exports.FlowActionFlowErrorMessage = exports.FlowActionFlowDoNothing = void 0;
|
|
20
20
|
exports.FormFieldFileConfigCategoryEnum = exports.FormFieldDateConfigFormatEnum = exports.FormEndingNodeId = exports.FormComponentCategoryWidgetConst = exports.FormComponentCategoryFieldConst = exports.FormComponentCategoryBlockConst = exports.FormBlockTypeRichTextConst = exports.FormBlockTypeResendButtonConst = exports.FormBlockTypePreviousButtonConst = exports.FormBlockTypeNextButtonConst = exports.FormBlockTypeJumpButtonConst = exports.FormBlockTypeImageConst = exports.FormBlockTypeHtmlConst = exports.FormBlockTypeDividerConst = exports.FormBlockResendButtonConfigTextAlignmentEnum = exports.FormBlockImageConfigPositionEnum = exports.ForbiddenSchema = exports.FlowsVaultConnectionSetupTypeOauthClientCredentialsEnum = exports.FlowsVaultConnectionSetupTypeBasicAuthEnum = exports.FlowsVaultConnectionSetupTypeApiKeyEnum = exports.FlowsVaultConnectionHttpApiKeySetupInEnum = exports.FlowsVaultConnectionAppIdZapierEnum = exports.FlowsVaultConnectionAppIdWhatsappEnum = exports.FlowsVaultConnectionAppIdTwilioEnum = exports.FlowsVaultConnectionAppIdTelegramEnum = exports.FlowsVaultConnectionAppIdStripeEnum = exports.FlowsVaultConnectionAppIdSlackEnum = exports.FlowsVaultConnectionAppIdSendgridEnum = exports.FlowsVaultConnectionAppIdSalesforceEnum = exports.FlowsVaultConnectionAppIdPipedriveEnum = exports.FlowsVaultConnectionAppIdMailjetEnum = exports.FlowsVaultConnectionAppIdMailchimpEnum = exports.FlowsVaultConnectionAppIdJwtEnum = exports.FlowsVaultConnectionAppIdHubspotEnum = exports.FlowsVaultConnectionAppIdHttpEnum = exports.FlowsVaultConnectionAppIdGoogleSheetsEnum = exports.FlowsVaultConnectionAppIdDocusignEnum = exports.FlowsVaultConnectionAppIdClearbitEnum = exports.FlowsVaultConnectionAppIdBigqueryEnum = exports.FlowsVaultConnectionAppIdAuth0Enum = exports.FlowsVaultConnectionAppIdAirtableEnum = exports.FlowsVaultConnectionAppIdActivecampaignEnum = exports.FlowsVaultConnectioSetupTypeWebhookEnum = exports.FlowsVaultConnectioSetupTypeTokenEnum = exports.FlowsVaultConnectioSetupTypeOauthJwtEnum = exports.FlowsVaultConnectioSetupTypeOauthCodeEnum = exports.FlowsVaultConnectioSetupTypeOauthAppEnum = exports.FlowsVaultConnectioSetupTypeKeyPairEnum = exports.FlowsVaultConnectioSetupTypeJwtEnum = exports.FlowsVaultConnectioSetupTypeBearerEnum = void 0;
|
|
21
21
|
exports.LogStreamEventBridgeSinkRegionEnum = exports.LogStreamEventBridgeEnum = exports.LogStreamDatadogRegionEnum = exports.LogStreamDatadogEnum = exports.ListFlowsRequestParametersHydrateEnum = exports.JobFileFormatEnum = exports.IntegrationRequiredParamTypeEnum = exports.IntegrationFeatureTypeEnum = exports.IdentityProviderOnlyAuth0Enum = exports.IdentityProviderEnum = exports.HookTriggerIdEnum = exports.GuardianFactorsProviderSmsProviderEnum = exports.GuardianFactorsProviderPushNotificationProviderDataEnum = exports.GuardianFactorPhoneFactorMessageTypeEnum = exports.GuardianFactorNameEnum = exports.GuardianEnrollmentStatus = exports.GuardianEnrollmentFactorEnum = exports.GroupTypeEnum = exports.GroupMemberTypeEnum = exports.GetFlowRequestParametersHydrateEnum = exports.GetFlowExecutionRequestParametersHydrateEnum = exports.FormsRequestParametersHydrateEnum = exports.FormWidgetTypeRecaptchaConst = exports.FormWidgetTypeGMapsAddressConst = exports.FormWidgetTypeAuth0VerifiableCredentialsConst = exports.FormNodeTypeStepConst = exports.FormNodeTypeRouterConst = exports.FormNodeTypeFlowConst = exports.FormFieldTypeUrlConst = exports.FormFieldTypeTextConst = exports.FormFieldTypeTelConst = exports.FormFieldTypeSocialConst = exports.FormFieldTypePaymentConst = exports.FormFieldTypePasswordConst = exports.FormFieldTypeNumberConst = exports.FormFieldTypeLegalConst = exports.FormFieldTypeFileConst = exports.FormFieldTypeEmailConst = exports.FormFieldTypeDropdownConst = exports.FormFieldTypeDateConst = exports.FormFieldTypeCustomConst = exports.FormFieldTypeChoiceConst = exports.FormFieldTypeCardsConst = exports.FormFieldTypeBooleanConst = exports.FormFieldPaymentConfigProviderEnum = exports.FormFieldPaymentConfigChargeTypeSubscriptionConst = exports.FormFieldPaymentConfigChargeTypeOneOffConst = exports.FormFieldPaymentConfigChargeOneOffCurrencyEnum = exports.FormFieldPasswordConfigHashEnum = exports.FormFieldFileConfigStorageTypeEnum = void 0;
|
|
22
|
-
exports.
|
|
23
|
-
exports.
|
|
24
|
-
exports.XssProtectionMode = void 0;
|
|
22
|
+
exports.RateLimitPolicyResourceEnum = exports.RateLimitPolicyConsumerEnum = exports.PublicKeyCredentialTypeEnum = exports.PublicKeyCredentialAlgorithmEnum = exports.PromptLanguageEnum = exports.PromptGroupNameEnum = exports.PreferredAuthenticationMethodEnum = exports.PostConnectionKeysAlgEnum = exports.PhoneTemplateNotificationTypeEnum = exports.PhoneProviderProtectionBackoffStrategyEnum = exports.PhoneProviderNameEnum = exports.PhoneProviderDeliveryMethodEnum = exports.PhoneProviderChannelEnum = exports.PasswordSequentialCharactersPolicyEnum = exports.PasswordMaxLengthExceededPolicyEnum = exports.PasswordIdenticalCharactersPolicyEnum = exports.PasswordDefaultDictionariesEnum = exports.PasswordCharacterTypeRulePolicyEnum = exports.PasswordCharacterTypeEnum = exports.PartialGroupsEnum = exports.OrganizationUsageEnum = exports.OrganizationThirdPartyClientAccessEnum = exports.OrganizationTemplateRoleVisibilityEnum = exports.OrganizationTemplateAllowedStrategyEnum = exports.OrganizationSortFieldEnum = exports.OrganizationMemberEffectiveRoleSource = exports.OrganizationDiscoveryDomainStatus = exports.OrganizationDeletionBehaviorEnum = exports.OrganizationClientMetadataOrganizationUsageEnum = exports.OrganizationAccessLevelEnumWithNull = exports.OrganizationAccessLevelEnum = exports.NotFoundSchema = exports.NetworkAclRuleScopeEnum = exports.NetworkAclKeyAlgorithmEnum = exports.MfaPolicyEnum = exports.LogStreamSumoEnum = exports.LogStreamStatusEnum = exports.LogStreamSplunkEnum = exports.LogStreamSegmentEnum = exports.LogStreamPiiMethodEnum = exports.LogStreamPiiLogFieldsEnum = exports.LogStreamPiiAlgorithmEnum = exports.LogStreamMixpanelRegionEnum = exports.LogStreamMixpanelEnum = exports.LogStreamHttpEnum = exports.LogStreamHttpContentFormatEnum = exports.LogStreamFilterTypeEnum = exports.LogStreamFilterGroupNameEnum = exports.LogStreamEventGridRegionEnum = exports.LogStreamEventGridEnum = void 0;
|
|
23
|
+
exports.UserEnrollmentStatusEnum = exports.UserEnrollmentAuthMethodEnum = exports.UserEffectiveRoleSource = exports.UserEffectivePermissionSourceEnum = exports.UserEffectivePermissionRoleSourceEnum = exports.UserAuthenticationMethodPropertiesEnum = exports.UserAttributeProfileUserIdOidcStrategyOverrideMapping = exports.UserAttributeProfileUserIdOidcMappingEnum = exports.UniversalLoginExperienceEnum = exports.UnauthorizedSchema = exports.TwilioProviderDeliveryMethodEnum = exports.TooManyRequestsSchema = exports.TokenExchangeProfileTypeEnum = exports.TenantSettingsSupportedLocalesEnum = exports.TenantSettingsResourceParameterProfile = exports.TenantSettingsDynamicClientRegistrationSecurityMode = exports.TenantSettingsDeviceFlowCharset = exports.TenantSettingsCountryCodesModeResponse = exports.TenantSettingsCountryCodesMode = exports.SynchronizeGroupsEnum = exports.SuspiciousIpThrottlingShieldsEnum = exports.SupportedLocales = exports.SignupStatusEnum = exports.SigningAlgorithmEnum = exports.SessionCookieModeEnum = exports.SessionCookieMetadataModeEnum = exports.SelfServiceProfileSsoTicketProvisioningScopeEnum = exports.SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum = exports.SelfServiceProfileSsoTicketDomainVerificationEnum = exports.SelfServiceProfileCustomTextPageEnum = exports.SelfServiceProfileCustomTextLanguageEnum = exports.SelfServiceProfileAllowedStrategyEnum = exports.SearchParserEnum = exports.SearchEngineVersionsEnum = exports.ScreenGroupNameEnum = exports.RotateConnectionKeysSigningAlgEnum = exports.RoleTypeEnum = exports.ResourceServerTokenEncryptionFormatEnum = exports.ResourceServerTokenEncryptionAlgorithmEnum = exports.ResourceServerTokenDialectSchemaEnum = exports.ResourceServerTokenDialectResponseEnum = exports.ResourceServerSubjectTypeAuthorizationUserPolicyEnum = exports.ResourceServerSubjectTypeAuthorizationClientPolicyEnum = exports.ResourceServerSubjectTypeAuthorizationAnonymousUserPolicyEnum = exports.ResourceServerSortFieldEnum = exports.ResourceServerProofOfPossessionRequiredForEnum = exports.ResourceServerProofOfPossessionMechanismEnum = exports.ResourceServerConsentPolicyEnum = exports.RefreshTokenRotationTypeEnum = exports.RefreshTokenExpirationTypeEnum = void 0;
|
|
24
|
+
exports.XssProtectionMode = exports.X509CertificateCredentialTypeEnum = exports.VerificationMethodEnum = exports.UserMultifactorProviderEnum = exports.UserIdentityProviderEnum = void 0;
|
|
25
25
|
exports.OauthScope = {
|
|
26
26
|
/**
|
|
27
27
|
* Create Actions */
|
|
@@ -275,6 +275,9 @@ exports.OauthScope = {
|
|
|
275
275
|
/**
|
|
276
276
|
* Read Events */
|
|
277
277
|
ReadEvents: "read:events",
|
|
278
|
+
/**
|
|
279
|
+
* Update Experimentation */
|
|
280
|
+
UpdateExperimentation: "update:experimentation",
|
|
278
281
|
/**
|
|
279
282
|
* Create Flows */
|
|
280
283
|
CreateFlows: "create:flows",
|
|
@@ -755,15 +758,9 @@ exports.OauthScope = {
|
|
|
755
758
|
/**
|
|
756
759
|
* Delete Organization Client Associations */
|
|
757
760
|
DeleteOrganizationClients: "delete:organization_clients",
|
|
758
|
-
/**
|
|
759
|
-
* Create Organization Templates */
|
|
760
|
-
CreateOrganizationTemplates: "create:organization_templates",
|
|
761
761
|
/**
|
|
762
762
|
* Read Organization Templates */
|
|
763
763
|
ReadOrganizationTemplates: "read:organization_templates",
|
|
764
|
-
/**
|
|
765
|
-
* Update Organization Templates */
|
|
766
|
-
UpdateOrganizationTemplates: "update:organization_templates",
|
|
767
764
|
/**
|
|
768
765
|
* Create Network ACL Keys */
|
|
769
766
|
CreateNetworkAclKeys: "create:network_acl_keys",
|
|
@@ -1379,23 +1376,14 @@ exports.ConnectionIdentityProviderEnum = {
|
|
|
1379
1376
|
Yahoo: "yahoo",
|
|
1380
1377
|
Yandex: "yandex",
|
|
1381
1378
|
NotionMcp: "notion-mcp",
|
|
1382
|
-
|
|
1383
|
-
|
|
1379
|
+
Asana: "asana",
|
|
1380
|
+
Atlassian: "atlassian",
|
|
1384
1381
|
CloudflareMcp: "cloudflare-mcp",
|
|
1385
|
-
|
|
1386
|
-
FigmaMcp: "figma-mcp",
|
|
1387
|
-
GitlabMcp: "gitlab-mcp",
|
|
1388
|
-
GustoMcp: "gusto-mcp",
|
|
1389
|
-
HerokuMcp: "heroku-mcp",
|
|
1382
|
+
Gitlab: "gitlab",
|
|
1390
1383
|
HubspotMcp: "hubspot-mcp",
|
|
1391
|
-
IntercomMcp: "intercom-mcp",
|
|
1392
1384
|
LinearMcp: "linear-mcp",
|
|
1393
|
-
PagerdutyMcp: "pagerduty-mcp",
|
|
1394
1385
|
SentryMcp: "sentry-mcp",
|
|
1395
|
-
|
|
1396
|
-
SupabaseMcp: "supabase-mcp",
|
|
1397
|
-
VercelMcp: "vercel-mcp",
|
|
1398
|
-
XeroMcp: "xero-mcp",
|
|
1386
|
+
Slack: "slack",
|
|
1399
1387
|
};
|
|
1400
1388
|
/** Signing key use, whether for encryption or signing */
|
|
1401
1389
|
exports.ConnectionKeyUseEnum = {
|
|
@@ -1889,23 +1877,14 @@ exports.ConnectionStrategyEnum = {
|
|
|
1889
1877
|
Yahoo: "yahoo",
|
|
1890
1878
|
Yandex: "yandex",
|
|
1891
1879
|
NotionMcp: "notion-mcp",
|
|
1892
|
-
|
|
1893
|
-
|
|
1880
|
+
Asana: "asana",
|
|
1881
|
+
Atlassian: "atlassian",
|
|
1894
1882
|
CloudflareMcp: "cloudflare-mcp",
|
|
1895
|
-
|
|
1896
|
-
FigmaMcp: "figma-mcp",
|
|
1897
|
-
GitlabMcp: "gitlab-mcp",
|
|
1898
|
-
GustoMcp: "gusto-mcp",
|
|
1899
|
-
HerokuMcp: "heroku-mcp",
|
|
1883
|
+
Gitlab: "gitlab",
|
|
1900
1884
|
HubspotMcp: "hubspot-mcp",
|
|
1901
|
-
IntercomMcp: "intercom-mcp",
|
|
1902
1885
|
LinearMcp: "linear-mcp",
|
|
1903
|
-
PagerdutyMcp: "pagerduty-mcp",
|
|
1904
1886
|
SentryMcp: "sentry-mcp",
|
|
1905
|
-
|
|
1906
|
-
SupabaseMcp: "supabase-mcp",
|
|
1907
|
-
VercelMcp: "vercel-mcp",
|
|
1908
|
-
XeroMcp: "xero-mcp",
|
|
1887
|
+
Slack: "slack",
|
|
1909
1888
|
Auth0Adldap: "auth0-adldap",
|
|
1910
1889
|
};
|
|
1911
1890
|
/** SMS template syntax type. Set to 'md_with_macros' to enable macro processing in templates. */
|
|
@@ -2413,7 +2392,7 @@ exports.DefaultMethodPhoneNumberIdentifierEnum = {
|
|
|
2413
2392
|
exports.DeviceCredentialPublicKeyTypeEnum = {
|
|
2414
2393
|
PublicKey: "public_key",
|
|
2415
2394
|
};
|
|
2416
|
-
/** Type of credentials to retrieve. Must be `public_key`, `refresh_token` or `rotating_refresh_token`.
|
|
2395
|
+
/** Type of credentials to retrieve. Must be `public_key`, `refresh_token` or `rotating_refresh_token`. If none is provided a combined list of `refresh_tokens` and `public_keys` will be returned (and no `rotating_refresh_token`), in this case `page`, `per_page` and `include_totals` will be ignored. */
|
|
2417
2396
|
exports.DeviceCredentialTypeEnum = {
|
|
2418
2397
|
PublicKey: "public_key",
|
|
2419
2398
|
RefreshToken: "refresh_token",
|
|
@@ -6546,6 +6525,12 @@ exports.OrganizationMemberEffectiveRoleSource = {
|
|
|
6546
6525
|
Direct: "direct",
|
|
6547
6526
|
Groups: "groups",
|
|
6548
6527
|
};
|
|
6528
|
+
/** Field name to sort results by in ascending order only. Defaults to insertion order (oldest first) if not provided. */
|
|
6529
|
+
exports.OrganizationSortFieldEnum = {
|
|
6530
|
+
Name: "name",
|
|
6531
|
+
DisplayName: "display_name",
|
|
6532
|
+
CreatedAt: "created_at",
|
|
6533
|
+
};
|
|
6549
6534
|
/** An allowed enterprise connection strategy. */
|
|
6550
6535
|
exports.OrganizationTemplateAllowedStrategyEnum = {
|
|
6551
6536
|
Adfs: "adfs",
|
|
@@ -6824,6 +6809,17 @@ exports.ResourceServerProofOfPossessionRequiredForEnum = {
|
|
|
6824
6809
|
PublicClients: "public_clients",
|
|
6825
6810
|
AllClients: "all_clients",
|
|
6826
6811
|
};
|
|
6812
|
+
/** Field name to sort results by in ascending order only. Defaults to insertion order (oldest first) if not provided. */
|
|
6813
|
+
exports.ResourceServerSortFieldEnum = {
|
|
6814
|
+
Identifier: "identifier",
|
|
6815
|
+
Name: "name",
|
|
6816
|
+
UpdatedAt: "updated_at",
|
|
6817
|
+
};
|
|
6818
|
+
/** Defines the anonymous user flows policy for the resource server */
|
|
6819
|
+
exports.ResourceServerSubjectTypeAuthorizationAnonymousUserPolicyEnum = {
|
|
6820
|
+
DenyAll: "deny_all",
|
|
6821
|
+
RequireClientGrant: "require_client_grant",
|
|
6822
|
+
};
|
|
6827
6823
|
/** Defines the client flows policy for the resource server */
|
|
6828
6824
|
exports.ResourceServerSubjectTypeAuthorizationClientPolicyEnum = {
|
|
6829
6825
|
DenyAll: "deny_all",
|
|
@@ -6974,6 +6970,11 @@ exports.SearchEngineVersionsEnum = {
|
|
|
6974
6970
|
V2: "v2",
|
|
6975
6971
|
V3: "v3",
|
|
6976
6972
|
};
|
|
6973
|
+
/** Query parser to use for the filter expression. Use "scim" for SCIM filter syntax or "lucene" for Lucene query syntax (default). */
|
|
6974
|
+
exports.SearchParserEnum = {
|
|
6975
|
+
Scim: "scim",
|
|
6976
|
+
Lucene: "lucene",
|
|
6977
|
+
};
|
|
6977
6978
|
exports.SelfServiceProfileAllowedStrategyEnum = {
|
|
6978
6979
|
Oidc: "oidc",
|
|
6979
6980
|
Samlp: "samlp",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "
|
|
1
|
+
export declare const SDK_VERSION = "7.1.0";
|
|
@@ -15,7 +15,7 @@ export declare namespace ManagementClient {
|
|
|
15
15
|
* @group Management API
|
|
16
16
|
* @public
|
|
17
17
|
*/
|
|
18
|
-
interface ManagementClientOptions extends Omit<FernClient.Options, "token" | "environment" | "fetcher" | "baseUrl"
|
|
18
|
+
interface ManagementClientOptions extends Omit<FernClient.Options, "token" | "environment" | "fetcher" | "baseUrl"> {
|
|
19
19
|
/** Auth0 domain (e.g., 'your-tenant.auth0.com') */
|
|
20
20
|
domain: string;
|
|
21
21
|
/**
|
|
@@ -114,7 +114,14 @@ export declare namespace ManagementClient {
|
|
|
114
114
|
clientAssertionSigningKey: string;
|
|
115
115
|
/** Algorithm for signing the client assertion. Defaults to RS256 */
|
|
116
116
|
clientAssertionSigningAlg?: string;
|
|
117
|
-
/**
|
|
117
|
+
/**
|
|
118
|
+
* Enable mTLS for token endpoint calls.
|
|
119
|
+
*
|
|
120
|
+
* mTLS (RFC 8705) is a transport-layer concern that is independent of the client
|
|
121
|
+
* authentication method: a client authenticating with `private_key_jwt` can still present a
|
|
122
|
+
* TLS client certificate to obtain a certificate-bound access token. This mirrors v6, which
|
|
123
|
+
* added the `mtls.` endpoint alias from `useMTLS` alone regardless of the auth method.
|
|
124
|
+
*/
|
|
118
125
|
useMTLS?: boolean;
|
|
119
126
|
}
|
|
120
127
|
/**
|
|
@@ -74,7 +74,6 @@ class ManagementClient extends Client_js_1.ManagementClient {
|
|
|
74
74
|
const token = (0, auth_helpers_js_1.createTokenSupplier)(_options);
|
|
75
75
|
// Temporarily remove fetcher from options to avoid people passing it for now
|
|
76
76
|
delete _options.fetcher;
|
|
77
|
-
delete _options.fetch;
|
|
78
77
|
// Prepare the base client options
|
|
79
78
|
let clientOptions = Object.assign(Object.assign({}, _options), { baseUrl,
|
|
80
79
|
headers,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { ManagementClient } from "./ManagementClient.js";
|
|
1
|
+
import type { ManagementClient } from "./ManagementClient.js";
|
|
2
2
|
export declare class TokenProvider {
|
|
3
3
|
private readonly options;
|
|
4
|
-
private authenticationClient;
|
|
5
4
|
private expiresAt;
|
|
6
5
|
private accessToken;
|
|
7
6
|
private pending;
|
|
@@ -12,4 +11,7 @@ export declare class TokenProvider {
|
|
|
12
11
|
audience: string;
|
|
13
12
|
});
|
|
14
13
|
getAccessToken(): Promise<string>;
|
|
14
|
+
private fetchToken;
|
|
15
|
+
private buildClientAssertion;
|
|
16
|
+
private buildTelemetryHeader;
|
|
15
17
|
}
|
|
@@ -10,31 +10,162 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.TokenProvider = void 0;
|
|
13
|
-
const
|
|
14
|
-
const
|
|
13
|
+
const jose_1 = require("jose");
|
|
14
|
+
const utils_js_1 = require("../../utils.js");
|
|
15
|
+
const ManagementError_js_1 = require("../errors/ManagementError.js");
|
|
16
|
+
const LEEWAY = 10 * 1000; // 10s refresh-ahead in ms
|
|
15
17
|
class TokenProvider {
|
|
16
18
|
constructor(options) {
|
|
17
19
|
this.options = options;
|
|
18
20
|
this.expiresAt = 0;
|
|
19
21
|
this.accessToken = "";
|
|
20
|
-
|
|
22
|
+
// Validate domain: must be a bare hostname, no slashes or query strings.
|
|
23
|
+
if (/[/?#]/.test(options.domain)) {
|
|
24
|
+
throw new Error(`ManagementClient: invalid domain "${options.domain}". Provide a bare hostname, e.g. "tenant.auth0.com".`);
|
|
25
|
+
}
|
|
26
|
+
if (options.useMTLS) {
|
|
27
|
+
const { fetch: customFetch } = options;
|
|
28
|
+
if (!customFetch) {
|
|
29
|
+
throw new Error("ManagementClient: useMTLS requires a custom fetch implementation. " +
|
|
30
|
+
"Provide a `fetch` option configured with your mTLS client certificate.");
|
|
31
|
+
}
|
|
32
|
+
// mTLS (RFC 8705) is a transport-layer concern independent of the client authentication
|
|
33
|
+
// method. It combines with both `clientSecret` and `clientAssertionSigningKey`: the TLS
|
|
34
|
+
// client certificate yields a certificate-bound token regardless of how the client
|
|
35
|
+
// authenticates. v6 supported this, so no auth-method restriction is imposed here.
|
|
36
|
+
}
|
|
21
37
|
}
|
|
22
38
|
getAccessToken() {
|
|
23
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
40
|
if (!this.accessToken || Date.now() > this.expiresAt - LEEWAY) {
|
|
25
|
-
this.pending =
|
|
26
|
-
|
|
27
|
-
this.authenticationClient.oauth.clientCredentialsGrant({
|
|
28
|
-
audience: this.options.audience,
|
|
29
|
-
});
|
|
30
|
-
const { data: { access_token: accessToken, expires_in: expiresIn }, } = yield this.pending.finally(() => {
|
|
41
|
+
this.pending = this.pending || this.fetchToken();
|
|
42
|
+
const result = yield this.pending.finally(() => {
|
|
31
43
|
delete this.pending;
|
|
32
44
|
});
|
|
33
|
-
this.expiresAt =
|
|
34
|
-
this.accessToken = accessToken;
|
|
45
|
+
this.expiresAt = result.expiresAt;
|
|
46
|
+
this.accessToken = result.accessToken;
|
|
35
47
|
}
|
|
36
48
|
return this.accessToken;
|
|
37
49
|
});
|
|
38
50
|
}
|
|
51
|
+
fetchToken() {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
var _a;
|
|
54
|
+
const { domain, clientId, audience } = this.options;
|
|
55
|
+
const tokenUrl = this.options.useMTLS ? `https://mtls.${domain}/oauth/token` : `https://${domain}/oauth/token`;
|
|
56
|
+
const body = new URLSearchParams({
|
|
57
|
+
grant_type: "client_credentials",
|
|
58
|
+
client_id: clientId,
|
|
59
|
+
audience,
|
|
60
|
+
});
|
|
61
|
+
if ("clientSecret" in this.options) {
|
|
62
|
+
body.set("client_secret", this.options.clientSecret);
|
|
63
|
+
}
|
|
64
|
+
else if ("clientAssertionSigningKey" in this.options) {
|
|
65
|
+
const assertion = yield this.buildClientAssertion(domain, clientId);
|
|
66
|
+
body.set("client_assertion", assertion);
|
|
67
|
+
body.set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer");
|
|
68
|
+
}
|
|
69
|
+
// Build request headers. Start with user-supplied plain-string headers so they can be
|
|
70
|
+
// overridden by SDK-controlled values (Content-Type, Auth0-Client) set below.
|
|
71
|
+
// Supplier-function headers (Fern's Supplier<string | null | undefined> type) are skipped —
|
|
72
|
+
// they require async resolution and are not supported on the token endpoint path.
|
|
73
|
+
const userHeaders = (_a = this.options.headers) !== null && _a !== void 0 ? _a : {};
|
|
74
|
+
const headers = {};
|
|
75
|
+
for (const [key, value] of Object.entries(userHeaders)) {
|
|
76
|
+
if (typeof value === "string") {
|
|
77
|
+
headers[key.toLowerCase()] = value;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
headers["content-type"] = "application/x-www-form-urlencoded";
|
|
81
|
+
const telemetryHeader = this.buildTelemetryHeader();
|
|
82
|
+
if (telemetryHeader) {
|
|
83
|
+
headers["auth0-client"] = telemetryHeader;
|
|
84
|
+
}
|
|
85
|
+
// Use custom fetch for mTLS, else global fetch.
|
|
86
|
+
// `fetch` is defined on BaseClientOptions (src/management/BaseClient.ts) which is Fern-generated.
|
|
87
|
+
// If that file is regenerated, verify `fetch?: typeof fetch` is still present — token acquisition
|
|
88
|
+
// for mTLS depends on it being forwarded here.
|
|
89
|
+
const { fetch: customFetch } = this.options;
|
|
90
|
+
const fetcher = customFetch !== null && customFetch !== void 0 ? customFetch : fetch;
|
|
91
|
+
let response;
|
|
92
|
+
try {
|
|
93
|
+
response = yield fetcher(tokenUrl, {
|
|
94
|
+
method: "POST",
|
|
95
|
+
headers,
|
|
96
|
+
body: body.toString(),
|
|
97
|
+
signal: AbortSignal.timeout(10000),
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
catch (err) {
|
|
101
|
+
// Built-in fetch aborts with a "TimeoutError"; node-fetch (used on the mTLS path with a
|
|
102
|
+
// custom fetch) aborts with an "AbortError". Match both so a token-request timeout maps
|
|
103
|
+
// to a 408 regardless of the underlying fetch implementation.
|
|
104
|
+
if (err instanceof Error && (err.name === "TimeoutError" || err.name === "AbortError")) {
|
|
105
|
+
throw new ManagementError_js_1.ManagementError({
|
|
106
|
+
message: "ManagementClient: token request timed out",
|
|
107
|
+
statusCode: 408,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
throw err;
|
|
111
|
+
}
|
|
112
|
+
if (!response.ok) {
|
|
113
|
+
// Read the body exactly once. `response.json()` followed by `response.text()` throws
|
|
114
|
+
// "Body has already been read", which would swallow non-JSON error payloads (e.g. proxy
|
|
115
|
+
// or WAF 502s). Read text, then attempt to parse it as JSON.
|
|
116
|
+
const raw = yield response.text().catch(() => "");
|
|
117
|
+
let errorBody;
|
|
118
|
+
try {
|
|
119
|
+
errorBody = raw ? JSON.parse(raw) : response.statusText;
|
|
120
|
+
}
|
|
121
|
+
catch (_b) {
|
|
122
|
+
errorBody = raw || response.statusText;
|
|
123
|
+
}
|
|
124
|
+
throw new ManagementError_js_1.ManagementError({
|
|
125
|
+
message: "ManagementClient: token request failed",
|
|
126
|
+
statusCode: response.status,
|
|
127
|
+
body: errorBody,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
const json = (yield response.json());
|
|
131
|
+
return {
|
|
132
|
+
accessToken: json.access_token,
|
|
133
|
+
expiresAt: Date.now() + json.expires_in * 1000,
|
|
134
|
+
};
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
buildClientAssertion(domain, clientId) {
|
|
138
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
139
|
+
const { clientAssertionSigningKey, clientAssertionSigningAlg = "RS256" } = this
|
|
140
|
+
.options;
|
|
141
|
+
const key = yield (0, jose_1.importPKCS8)(clientAssertionSigningKey, clientAssertionSigningAlg);
|
|
142
|
+
const now = Math.floor(Date.now() / 1000);
|
|
143
|
+
return new jose_1.SignJWT({})
|
|
144
|
+
.setProtectedHeader({ alg: clientAssertionSigningAlg })
|
|
145
|
+
.setIssuedAt(now)
|
|
146
|
+
.setIssuer(clientId)
|
|
147
|
+
.setSubject(clientId)
|
|
148
|
+
.setAudience(`https://${domain}/`)
|
|
149
|
+
.setExpirationTime(now + 180) // 3 min lifetime
|
|
150
|
+
.setJti(crypto.randomUUID())
|
|
151
|
+
.sign(key);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
buildTelemetryHeader() {
|
|
155
|
+
var _a;
|
|
156
|
+
const opts = this.options;
|
|
157
|
+
if (opts.telemetry === false)
|
|
158
|
+
return null;
|
|
159
|
+
const nodeAuth0Info = (0, utils_js_1.generateClientInfo)();
|
|
160
|
+
const info = opts.clientInfo
|
|
161
|
+
? { name: opts.clientInfo.name, version: String((_a = opts.clientInfo.version) !== null && _a !== void 0 ? _a : nodeAuth0Info.version) }
|
|
162
|
+
: { name: nodeAuth0Info.name, version: nodeAuth0Info.version };
|
|
163
|
+
// NOTE: auth0-auth-js TelemetryConfig does not support env fields.
|
|
164
|
+
// The runtime fingerprint (env.node / env.cloudflare-workers) present in the
|
|
165
|
+
// original node-auth0 Auth0-Client header is intentionally omitted here.
|
|
166
|
+
// This is a known, accepted delta vs the pre-v7 token request telemetry shape.
|
|
167
|
+
// Use jose's base64url encoder for runtime portability (Buffer is Node-only).
|
|
168
|
+
return jose_1.base64url.encode(new TextEncoder().encode(JSON.stringify(info)));
|
|
169
|
+
}
|
|
39
170
|
}
|
|
40
171
|
exports.TokenProvider = TokenProvider;
|
package/dist/cjs/utils.d.ts
CHANGED
|
@@ -5,21 +5,3 @@ export declare const generateClientInfo: () => {
|
|
|
5
5
|
[x: string]: string;
|
|
6
6
|
};
|
|
7
7
|
};
|
|
8
|
-
/**
|
|
9
|
-
* @private
|
|
10
|
-
*/
|
|
11
|
-
export declare const mtlsPrefix = "mtls";
|
|
12
|
-
type SyncGetter<T> = () => T;
|
|
13
|
-
type AsyncGetter<T> = () => Promise<T>;
|
|
14
|
-
/**
|
|
15
|
-
* Resolves a value that can be a static value, a synchronous function, or an asynchronous function.
|
|
16
|
-
*
|
|
17
|
-
* @template T - The type of the value to be resolved.
|
|
18
|
-
* @param {T | SyncGetter<T> | AsyncGetter<T>} value - The value to be resolved. It can be:
|
|
19
|
-
* - A static value of type T.
|
|
20
|
-
* - A synchronous function that returns a value of type T.
|
|
21
|
-
* - An asynchronous function that returns a Promise of type T.
|
|
22
|
-
* @returns {Promise<T>} A promise that resolves to the value of type T.
|
|
23
|
-
*/
|
|
24
|
-
export declare const resolveValueToPromise: <T>(value: T | SyncGetter<T> | AsyncGetter<T>) => Promise<T>;
|
|
25
|
-
export {};
|
package/dist/cjs/utils.js
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
3
|
+
exports.generateClientInfo = void 0;
|
|
13
4
|
const version_js_1 = require("./management/version.js");
|
|
14
5
|
const index_js_1 = require("./management/core/index.js");
|
|
15
6
|
const generateClientInfo = () => {
|
|
@@ -26,25 +17,3 @@ const generateClientInfo = () => {
|
|
|
26
17
|
};
|
|
27
18
|
};
|
|
28
19
|
exports.generateClientInfo = generateClientInfo;
|
|
29
|
-
/**
|
|
30
|
-
* @private
|
|
31
|
-
*/
|
|
32
|
-
exports.mtlsPrefix = "mtls";
|
|
33
|
-
/**
|
|
34
|
-
* Resolves a value that can be a static value, a synchronous function, or an asynchronous function.
|
|
35
|
-
*
|
|
36
|
-
* @template T - The type of the value to be resolved.
|
|
37
|
-
* @param {T | SyncGetter<T> | AsyncGetter<T>} value - The value to be resolved. It can be:
|
|
38
|
-
* - A static value of type T.
|
|
39
|
-
* - A synchronous function that returns a value of type T.
|
|
40
|
-
* - An asynchronous function that returns a Promise of type T.
|
|
41
|
-
* @returns {Promise<T>} A promise that resolves to the value of type T.
|
|
42
|
-
*/
|
|
43
|
-
const resolveValueToPromise = (value) => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
|
-
if (typeof value === "function") {
|
|
45
|
-
const result = value(); // Call the function
|
|
46
|
-
return result instanceof Promise ? result : Promise.resolve(result); // Handle sync/async
|
|
47
|
-
}
|
|
48
|
-
return Promise.resolve(value); // Static value
|
|
49
|
-
});
|
|
50
|
-
exports.resolveValueToPromise = resolveValueToPromise;
|
package/dist/esm/index.d.mts
CHANGED
package/dist/esm/index.mjs
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error thrown when the API returns an error response that can't be parsed to a more specific Error instance.
|
|
3
|
-
*/
|
|
4
|
-
export declare class ResponseError extends Error {
|
|
5
|
-
statusCode: number;
|
|
6
|
-
body: string;
|
|
7
|
-
headers: Headers;
|
|
8
|
-
name: "ResponseError";
|
|
9
|
-
constructor(statusCode: number, body: string, headers: Headers, msg?: string);
|
|
10
|
-
}
|
|
11
1
|
/**
|
|
12
2
|
* Error thrown when the request is aborted due to a timeout.
|
|
13
3
|
*/
|
|
@@ -15,14 +5,6 @@ export declare class TimeoutError extends Error {
|
|
|
15
5
|
name: "TimeoutError";
|
|
16
6
|
constructor();
|
|
17
7
|
}
|
|
18
|
-
/**
|
|
19
|
-
* Error thrown when there is a network error.
|
|
20
|
-
*/
|
|
21
|
-
export declare class FetchError extends Error {
|
|
22
|
-
cause: Error;
|
|
23
|
-
name: "FetchError";
|
|
24
|
-
constructor(cause: Error, msg?: string);
|
|
25
|
-
}
|
|
26
8
|
/**
|
|
27
9
|
* Error thrown when a required argument was not provided.
|
|
28
10
|
*/
|
package/dist/esm/lib/errors.mjs
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error thrown when the API returns an error response that can't be parsed to a more specific Error instance.
|
|
3
|
-
*/
|
|
4
|
-
export class ResponseError extends Error {
|
|
5
|
-
constructor(statusCode, body, headers, msg) {
|
|
6
|
-
super(msg);
|
|
7
|
-
this.statusCode = statusCode;
|
|
8
|
-
this.body = body;
|
|
9
|
-
this.headers = headers;
|
|
10
|
-
this.name = "ResponseError";
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
1
|
/**
|
|
14
2
|
* Error thrown when the request is aborted due to a timeout.
|
|
15
3
|
*/
|
|
@@ -19,16 +7,6 @@ export class TimeoutError extends Error {
|
|
|
19
7
|
this.name = "TimeoutError";
|
|
20
8
|
}
|
|
21
9
|
}
|
|
22
|
-
/**
|
|
23
|
-
* Error thrown when there is a network error.
|
|
24
|
-
*/
|
|
25
|
-
export class FetchError extends Error {
|
|
26
|
-
constructor(cause, msg) {
|
|
27
|
-
super(msg);
|
|
28
|
-
this.cause = cause;
|
|
29
|
-
this.name = "FetchError";
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
10
|
/**
|
|
33
11
|
* Error thrown when a required argument was not provided.
|
|
34
12
|
*/
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ClientOptions } from "../models.mjs";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* for automatic header injection and as a standalone utility for manual telemetry header generation.
|
|
3
|
+
* Generates the Auth0-Client telemetry header value.
|
|
5
4
|
* @private
|
|
6
5
|
*/
|
|
7
|
-
export declare class Auth0ClientTelemetry
|
|
6
|
+
export declare class Auth0ClientTelemetry {
|
|
8
7
|
clientInfo: {
|
|
9
8
|
name: string;
|
|
10
9
|
[key: string]: unknown;
|
|
@@ -12,9 +11,6 @@ export declare class Auth0ClientTelemetry implements Middleware {
|
|
|
12
11
|
constructor(options: ClientOptions);
|
|
13
12
|
/**
|
|
14
13
|
* Get the Auth0-Client header value for telemetry.
|
|
15
|
-
* This method can be used when you need to manually add telemetry headers
|
|
16
|
-
* instead of using the middleware system.
|
|
17
14
|
*/
|
|
18
15
|
getAuth0ClientHeader(): string | undefined;
|
|
19
|
-
pre?(context: RequestContext): Promise<FetchParams | void>;
|
|
20
16
|
}
|
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
import { generateClientInfo } from "../../utils.mjs";
|
|
11
2
|
import { base64url } from "jose";
|
|
12
3
|
/**
|
|
13
|
-
*
|
|
14
|
-
* for automatic header injection and as a standalone utility for manual telemetry header generation.
|
|
4
|
+
* Generates the Auth0-Client telemetry header value.
|
|
15
5
|
* @private
|
|
16
6
|
*/
|
|
17
7
|
export class Auth0ClientTelemetry {
|
|
@@ -20,8 +10,6 @@ export class Auth0ClientTelemetry {
|
|
|
20
10
|
}
|
|
21
11
|
/**
|
|
22
12
|
* Get the Auth0-Client header value for telemetry.
|
|
23
|
-
* This method can be used when you need to manually add telemetry headers
|
|
24
|
-
* instead of using the middleware system.
|
|
25
13
|
*/
|
|
26
14
|
getAuth0ClientHeader() {
|
|
27
15
|
if ("string" === typeof this.clientInfo.name && this.clientInfo.name.length > 0) {
|
|
@@ -29,16 +17,4 @@ export class Auth0ClientTelemetry {
|
|
|
29
17
|
}
|
|
30
18
|
return undefined;
|
|
31
19
|
}
|
|
32
|
-
pre(context) {
|
|
33
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
const headerValue = this.getAuth0ClientHeader();
|
|
35
|
-
if (headerValue) {
|
|
36
|
-
context.init.headers = Object.assign(Object.assign({}, context.init.headers), { "Auth0-Client": headerValue });
|
|
37
|
-
}
|
|
38
|
-
return {
|
|
39
|
-
url: context.url,
|
|
40
|
-
init: context.init,
|
|
41
|
-
};
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
20
|
}
|
|
@@ -71,30 +71,6 @@ export interface ApiResponse<T> {
|
|
|
71
71
|
status: number;
|
|
72
72
|
statusText: string;
|
|
73
73
|
}
|
|
74
|
-
export declare class JSONApiResponse<T> implements ApiResponse<T> {
|
|
75
|
-
data: T;
|
|
76
|
-
headers: Headers;
|
|
77
|
-
readonly status: number;
|
|
78
|
-
readonly statusText: string;
|
|
79
|
-
constructor(data: T, headers: Headers, status: number, statusText: string);
|
|
80
|
-
static fromResponse<T = unknown>(raw: Response): Promise<JSONApiResponse<T>>;
|
|
81
|
-
}
|
|
82
|
-
export declare class VoidApiResponse implements ApiResponse<undefined> {
|
|
83
|
-
headers: Headers;
|
|
84
|
-
readonly status: number;
|
|
85
|
-
readonly statusText: string;
|
|
86
|
-
data: undefined;
|
|
87
|
-
constructor(headers: Headers, status: number, statusText: string);
|
|
88
|
-
static fromResponse(raw: Response): Promise<VoidApiResponse>;
|
|
89
|
-
}
|
|
90
|
-
export declare class TextApiResponse implements ApiResponse<string> {
|
|
91
|
-
data: string;
|
|
92
|
-
headers: Headers;
|
|
93
|
-
readonly status: number;
|
|
94
|
-
readonly statusText: string;
|
|
95
|
-
constructor(data: string, headers: Headers, status: number, statusText: string);
|
|
96
|
-
static fromResponse(raw: Response): Promise<TextApiResponse>;
|
|
97
|
-
}
|
|
98
74
|
export interface FetchParams {
|
|
99
75
|
url: string | URL | Request;
|
|
100
76
|
init: RequestInit;
|