@thunderid/javascript 0.0.1
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/LICENSE +201 -0
- package/dist/DefaultCacheStore.d.ts +31 -0
- package/dist/DefaultCacheStore.d.ts.map +1 -0
- package/dist/DefaultCrypto.d.ts +30 -0
- package/dist/DefaultCrypto.d.ts.map +1 -0
- package/dist/HttpClient.d.ts +65 -0
- package/dist/HttpClient.d.ts.map +1 -0
- package/dist/IsomorphicCrypto.d.ts +64 -0
- package/dist/IsomorphicCrypto.d.ts.map +1 -0
- package/dist/StorageManager.d.ts +66 -0
- package/dist/StorageManager.d.ts.map +1 -0
- package/dist/ThunderIDJavaScriptClient.d.ts +66 -0
- package/dist/ThunderIDJavaScriptClient.d.ts.map +1 -0
- package/dist/__legacy__/client.d.ts +485 -0
- package/dist/__legacy__/client.d.ts.map +1 -0
- package/dist/__legacy__/helpers/authentication-helper.d.ts +38 -0
- package/dist/__legacy__/helpers/authentication-helper.d.ts.map +1 -0
- package/dist/__legacy__/helpers/index.d.ts +19 -0
- package/dist/__legacy__/helpers/index.d.ts.map +1 -0
- package/dist/__legacy__/models/client-config.d.ts +106 -0
- package/dist/__legacy__/models/client-config.d.ts.map +1 -0
- package/dist/__legacy__/models/index.d.ts +19 -0
- package/dist/__legacy__/models/index.d.ts.map +1 -0
- package/dist/api/createOrganization.d.ts +130 -0
- package/dist/api/createOrganization.d.ts.map +1 -0
- package/dist/api/executeEmbeddedSignInFlow.d.ts +22 -0
- package/dist/api/executeEmbeddedSignInFlow.d.ts.map +1 -0
- package/dist/api/executeEmbeddedSignUpFlow.d.ts +45 -0
- package/dist/api/executeEmbeddedSignUpFlow.d.ts.map +1 -0
- package/dist/api/getAllOrganizations.d.ts +104 -0
- package/dist/api/getAllOrganizations.d.ts.map +1 -0
- package/dist/api/getBrandingPreference.d.ts +104 -0
- package/dist/api/getBrandingPreference.d.ts.map +1 -0
- package/dist/api/getMeOrganizations.d.ts +120 -0
- package/dist/api/getMeOrganizations.d.ts.map +1 -0
- package/dist/api/getOrganization.d.ts +110 -0
- package/dist/api/getOrganization.d.ts.map +1 -0
- package/dist/api/getSchemas.d.ts +90 -0
- package/dist/api/getSchemas.d.ts.map +1 -0
- package/dist/api/getScim2Me.d.ts +90 -0
- package/dist/api/getScim2Me.d.ts.map +1 -0
- package/dist/api/getUserInfo.d.ts +38 -0
- package/dist/api/getUserInfo.d.ts.map +1 -0
- package/dist/api/initializeEmbeddedSignInFlow.d.ts +52 -0
- package/dist/api/initializeEmbeddedSignInFlow.d.ts.map +1 -0
- package/dist/api/updateMeProfile.d.ts +83 -0
- package/dist/api/updateMeProfile.d.ts.map +1 -0
- package/dist/api/updateOrganization.d.ts +119 -0
- package/dist/api/updateOrganization.d.ts.map +1 -0
- package/dist/api/v2/executeEmbeddedRecoveryFlowV2.d.ts +57 -0
- package/dist/api/v2/executeEmbeddedRecoveryFlowV2.d.ts.map +1 -0
- package/dist/api/v2/executeEmbeddedSignInFlowV2.d.ts +22 -0
- package/dist/api/v2/executeEmbeddedSignInFlowV2.d.ts.map +1 -0
- package/dist/api/v2/executeEmbeddedSignUpFlowV2.d.ts +22 -0
- package/dist/api/v2/executeEmbeddedSignUpFlowV2.d.ts.map +1 -0
- package/dist/api/v2/executeEmbeddedUserOnboardingFlowV2.d.ts +89 -0
- package/dist/api/v2/executeEmbeddedUserOnboardingFlowV2.d.ts.map +1 -0
- package/dist/api/v2/getFlowMetaV2.d.ts +56 -0
- package/dist/api/v2/getFlowMetaV2.d.ts.map +1 -0
- package/dist/api/v2/getOrganizationUnitChildren.d.ts +43 -0
- package/dist/api/v2/getOrganizationUnitChildren.d.ts.map +1 -0
- package/dist/cjs/index.cjs +7693 -0
- package/dist/constants/ApplicationNativeAuthenticationConstants.d.ts +40 -0
- package/dist/constants/ApplicationNativeAuthenticationConstants.d.ts.map +1 -0
- package/dist/constants/OIDCDiscoveryConstants.d.ts +65 -0
- package/dist/constants/OIDCDiscoveryConstants.d.ts.map +1 -0
- package/dist/constants/OIDCRequestConstants.d.ts +43 -0
- package/dist/constants/OIDCRequestConstants.d.ts.map +1 -0
- package/dist/constants/PKCEConstants.d.ts +45 -0
- package/dist/constants/PKCEConstants.d.ts.map +1 -0
- package/dist/constants/ScopeConstants.d.ts +43 -0
- package/dist/constants/ScopeConstants.d.ts.map +1 -0
- package/dist/constants/TokenConstants.d.ts +48 -0
- package/dist/constants/TokenConstants.d.ts.map +1 -0
- package/dist/constants/TokenExchangeConstants.d.ts +44 -0
- package/dist/constants/TokenExchangeConstants.d.ts.map +1 -0
- package/dist/constants/VendorConstants.d.ts +32 -0
- package/dist/constants/VendorConstants.d.ts.map +1 -0
- package/dist/constants/v2/OIDCDiscoveryConstants.d.ts +40 -0
- package/dist/constants/v2/OIDCDiscoveryConstants.d.ts.map +1 -0
- package/dist/edge/index.js +7568 -0
- package/dist/errors/ThunderIDAPIError.d.ts +59 -0
- package/dist/errors/ThunderIDAPIError.d.ts.map +1 -0
- package/dist/errors/ThunderIDError.d.ts +50 -0
- package/dist/errors/ThunderIDError.d.ts.map +1 -0
- package/dist/errors/ThunderIDRuntimeError.d.ts +51 -0
- package/dist/errors/ThunderIDRuntimeError.d.ts.map +1 -0
- package/dist/errors/exception.d.ts +27 -0
- package/dist/errors/exception.d.ts.map +1 -0
- package/dist/i18n/constants/TranslationBundleConstants.d.ts +35 -0
- package/dist/i18n/constants/TranslationBundleConstants.d.ts.map +1 -0
- package/dist/i18n/models/i18n.d.ts +127 -0
- package/dist/i18n/models/i18n.d.ts.map +1 -0
- package/dist/i18n/translations/en-US.d.ts +21 -0
- package/dist/i18n/translations/en-US.d.ts.map +1 -0
- package/dist/i18n/translations/fr-FR.d.ts +21 -0
- package/dist/i18n/translations/fr-FR.d.ts.map +1 -0
- package/dist/i18n/translations/hi-IN.d.ts +21 -0
- package/dist/i18n/translations/hi-IN.d.ts.map +1 -0
- package/dist/i18n/translations/index.d.ts +26 -0
- package/dist/i18n/translations/index.d.ts.map +1 -0
- package/dist/i18n/translations/ja-JP.d.ts +21 -0
- package/dist/i18n/translations/ja-JP.d.ts.map +1 -0
- package/dist/i18n/translations/pt-BR.d.ts +21 -0
- package/dist/i18n/translations/pt-BR.d.ts.map +1 -0
- package/dist/i18n/translations/pt-PT.d.ts +21 -0
- package/dist/i18n/translations/pt-PT.d.ts.map +1 -0
- package/dist/i18n/translations/si-LK.d.ts +21 -0
- package/dist/i18n/translations/si-LK.d.ts.map +1 -0
- package/dist/i18n/translations/ta-IN.d.ts +21 -0
- package/dist/i18n/translations/ta-IN.d.ts.map +1 -0
- package/dist/i18n/translations/te-IN.d.ts +21 -0
- package/dist/i18n/translations/te-IN.d.ts.map +1 -0
- package/dist/i18n/utils/getDefaultI18nBundles.d.ts +28 -0
- package/dist/i18n/utils/getDefaultI18nBundles.d.ts.map +1 -0
- package/dist/i18n/utils/normalizeTranslations.d.ts +42 -0
- package/dist/i18n/utils/normalizeTranslations.d.ts.map +1 -0
- package/dist/index.d.ts +143 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7568 -0
- package/dist/models/agent.d.ts +45 -0
- package/dist/models/agent.d.ts.map +1 -0
- package/dist/models/auth-code-response.d.ts +35 -0
- package/dist/models/auth-code-response.d.ts.map +1 -0
- package/dist/models/branding-preference.d.ts +249 -0
- package/dist/models/branding-preference.d.ts.map +1 -0
- package/dist/models/client.d.ts +213 -0
- package/dist/models/client.d.ts.map +1 -0
- package/dist/models/config.d.ts +483 -0
- package/dist/models/config.d.ts.map +1 -0
- package/dist/models/crypto.d.ts +101 -0
- package/dist/models/crypto.d.ts.map +1 -0
- package/dist/models/embedded-flow.d.ts +167 -0
- package/dist/models/embedded-flow.d.ts.map +1 -0
- package/dist/models/embedded-signin-flow.d.ts +100 -0
- package/dist/models/embedded-signin-flow.d.ts.map +1 -0
- package/dist/models/field.d.ts +32 -0
- package/dist/models/field.d.ts.map +1 -0
- package/dist/models/flow.d.ts +31 -0
- package/dist/models/flow.d.ts.map +1 -0
- package/dist/models/http.d.ts +46 -0
- package/dist/models/http.d.ts.map +1 -0
- package/dist/models/oauth-request.d.ts +24 -0
- package/dist/models/oauth-request.d.ts.map +1 -0
- package/dist/models/oauth-response.d.ts +19 -0
- package/dist/models/oauth-response.d.ts.map +1 -0
- package/dist/models/oidc-discovery.d.ts +370 -0
- package/dist/models/oidc-discovery.d.ts.map +1 -0
- package/dist/models/oidc-endpoints.d.ts +72 -0
- package/dist/models/oidc-endpoints.d.ts.map +1 -0
- package/dist/models/organization.d.ts +34 -0
- package/dist/models/organization.d.ts.map +1 -0
- package/dist/models/platforms.d.ts +38 -0
- package/dist/models/platforms.d.ts.map +1 -0
- package/dist/models/scim2-schema.d.ts +66 -0
- package/dist/models/scim2-schema.d.ts.map +1 -0
- package/dist/models/session.d.ts +32 -0
- package/dist/models/session.d.ts.map +1 -0
- package/dist/models/store.d.ts +84 -0
- package/dist/models/store.d.ts.map +1 -0
- package/dist/models/token-endpoint-auth.d.ts +30 -0
- package/dist/models/token-endpoint-auth.d.ts.map +1 -0
- package/dist/models/token.d.ts +181 -0
- package/dist/models/token.d.ts.map +1 -0
- package/dist/models/user.d.ts +34 -0
- package/dist/models/user.d.ts.map +1 -0
- package/dist/models/utility-types.d.ts +21 -0
- package/dist/models/utility-types.d.ts.map +1 -0
- package/dist/models/v2/embedded-flow-v2.d.ts +494 -0
- package/dist/models/v2/embedded-flow-v2.d.ts.map +1 -0
- package/dist/models/v2/embedded-recovery-flow-v2.d.ts +143 -0
- package/dist/models/v2/embedded-recovery-flow-v2.d.ts.map +1 -0
- package/dist/models/v2/embedded-signin-flow-v2.d.ts +340 -0
- package/dist/models/v2/embedded-signin-flow-v2.d.ts.map +1 -0
- package/dist/models/v2/embedded-signup-flow-v2.d.ts +272 -0
- package/dist/models/v2/embedded-signup-flow-v2.d.ts.map +1 -0
- package/dist/models/v2/extensions/components.d.ts +89 -0
- package/dist/models/v2/extensions/components.d.ts.map +1 -0
- package/dist/models/v2/flow-meta-v2.d.ts +299 -0
- package/dist/models/v2/flow-meta-v2.d.ts.map +1 -0
- package/dist/models/v2/organization-unit.d.ts +103 -0
- package/dist/models/v2/organization-unit.d.ts.map +1 -0
- package/dist/models/v2/translation.d.ts +35 -0
- package/dist/models/v2/translation.d.ts.map +1 -0
- package/dist/models/v2/vars.d.ts +36 -0
- package/dist/models/v2/vars.d.ts.map +1 -0
- package/dist/theme/createTheme.d.ts +23 -0
- package/dist/theme/createTheme.d.ts.map +1 -0
- package/dist/theme/types.d.ts +381 -0
- package/dist/theme/types.d.ts.map +1 -0
- package/dist/utils/arrayBufferToBase64url.d.ts +49 -0
- package/dist/utils/arrayBufferToBase64url.d.ts.map +1 -0
- package/dist/utils/base64Encode.d.ts +36 -0
- package/dist/utils/base64Encode.d.ts.map +1 -0
- package/dist/utils/base64urlToArrayBuffer.d.ts +56 -0
- package/dist/utils/base64urlToArrayBuffer.d.ts.map +1 -0
- package/dist/utils/bem.d.ts +47 -0
- package/dist/utils/bem.d.ts.map +1 -0
- package/dist/utils/deepMerge.d.ts +45 -0
- package/dist/utils/deepMerge.d.ts.map +1 -0
- package/dist/utils/deriveOrganizationHandleFromBaseUrl.d.ts +48 -0
- package/dist/utils/deriveOrganizationHandleFromBaseUrl.d.ts.map +1 -0
- package/dist/utils/extractPkceStorageKeyFromState.d.ts +33 -0
- package/dist/utils/extractPkceStorageKeyFromState.d.ts.map +1 -0
- package/dist/utils/extractTenantDomainFromIdTokenPayload.d.ts +32 -0
- package/dist/utils/extractTenantDomainFromIdTokenPayload.d.ts.map +1 -0
- package/dist/utils/extractUserClaimsFromIdToken.d.ts +47 -0
- package/dist/utils/extractUserClaimsFromIdToken.d.ts.map +1 -0
- package/dist/utils/flattenUserSchema.d.ts +65 -0
- package/dist/utils/flattenUserSchema.d.ts.map +1 -0
- package/dist/utils/formatDate.d.ts +34 -0
- package/dist/utils/formatDate.d.ts.map +1 -0
- package/dist/utils/generateFlattenedUserProfile.d.ts +54 -0
- package/dist/utils/generateFlattenedUserProfile.d.ts.map +1 -0
- package/dist/utils/generatePkceStorageKey.d.ts +35 -0
- package/dist/utils/generatePkceStorageKey.d.ts.map +1 -0
- package/dist/utils/generateStateParamForRequestCorrelation.d.ts +35 -0
- package/dist/utils/generateStateParamForRequestCorrelation.d.ts.map +1 -0
- package/dist/utils/generateUserProfile.d.ts +56 -0
- package/dist/utils/generateUserProfile.d.ts.map +1 -0
- package/dist/utils/get.d.ts +30 -0
- package/dist/utils/get.d.ts.map +1 -0
- package/dist/utils/getAuthorizeRequestUrlParams.d.ts +61 -0
- package/dist/utils/getAuthorizeRequestUrlParams.d.ts.map +1 -0
- package/dist/utils/getLatestStateParam.d.ts +41 -0
- package/dist/utils/getLatestStateParam.d.ts.map +1 -0
- package/dist/utils/getRedirectBasedSignUpUrl.d.ts +30 -0
- package/dist/utils/getRedirectBasedSignUpUrl.d.ts.map +1 -0
- package/dist/utils/identifyPlatform.d.ts +31 -0
- package/dist/utils/identifyPlatform.d.ts.map +1 -0
- package/dist/utils/isEmpty.d.ts +49 -0
- package/dist/utils/isEmpty.d.ts.map +1 -0
- package/dist/utils/isRecognizedBaseUrlPattern.d.ts +33 -0
- package/dist/utils/isRecognizedBaseUrlPattern.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +143 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/parseApiErrorMessage.d.ts +29 -0
- package/dist/utils/parseApiErrorMessage.d.ts.map +1 -0
- package/dist/utils/processOpenIDScopes.d.ts +42 -0
- package/dist/utils/processOpenIDScopes.d.ts.map +1 -0
- package/dist/utils/processUsername.d.ts +74 -0
- package/dist/utils/processUsername.d.ts.map +1 -0
- package/dist/utils/removeTrailingSlash.d.ts +32 -0
- package/dist/utils/removeTrailingSlash.d.ts.map +1 -0
- package/dist/utils/resolveFieldName.d.ts +20 -0
- package/dist/utils/resolveFieldName.d.ts.map +1 -0
- package/dist/utils/resolveFieldType.d.ts +21 -0
- package/dist/utils/resolveFieldType.d.ts.map +1 -0
- package/dist/utils/set.d.ts +31 -0
- package/dist/utils/set.d.ts.map +1 -0
- package/dist/utils/transformBrandingPreferenceToTheme.d.ts +49 -0
- package/dist/utils/transformBrandingPreferenceToTheme.d.ts.map +1 -0
- package/dist/utils/v2/containsMetaFlowTemplateLiteral.d.ts +57 -0
- package/dist/utils/v2/containsMetaFlowTemplateLiteral.d.ts.map +1 -0
- package/dist/utils/v2/countryCodeToFlagEmoji.d.ts +26 -0
- package/dist/utils/v2/countryCodeToFlagEmoji.d.ts.map +1 -0
- package/dist/utils/v2/extractEmojiFromUri.d.ts +32 -0
- package/dist/utils/v2/extractEmojiFromUri.d.ts.map +1 -0
- package/dist/utils/v2/isEmojiUri.d.ts +34 -0
- package/dist/utils/v2/isEmojiUri.d.ts.map +1 -0
- package/dist/utils/v2/isMetaFlowTemplateLiteral.d.ts +45 -0
- package/dist/utils/v2/isMetaFlowTemplateLiteral.d.ts.map +1 -0
- package/dist/utils/v2/isTranslationFlowTemplateLiteral.d.ts +45 -0
- package/dist/utils/v2/isTranslationFlowTemplateLiteral.d.ts.map +1 -0
- package/dist/utils/v2/parseFlowTemplateLiteral.d.ts +96 -0
- package/dist/utils/v2/parseFlowTemplateLiteral.d.ts.map +1 -0
- package/dist/utils/v2/resolveFlowTemplateLiterals.d.ts +42 -0
- package/dist/utils/v2/resolveFlowTemplateLiterals.d.ts.map +1 -0
- package/dist/utils/v2/resolveLocaleDisplayName.d.ts +30 -0
- package/dist/utils/v2/resolveLocaleDisplayName.d.ts.map +1 -0
- package/dist/utils/v2/resolveLocaleEmoji.d.ts +31 -0
- package/dist/utils/v2/resolveLocaleEmoji.d.ts.map +1 -0
- package/dist/utils/v2/resolveMeta.d.ts +35 -0
- package/dist/utils/v2/resolveMeta.d.ts.map +1 -0
- package/dist/utils/withVendorCSSClassPrefix.d.ts +33 -0
- package/dist/utils/withVendorCSSClassPrefix.d.ts.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import { EmbeddedFlowResponseData as EmbeddedFlowResponseDataV2 } from './embedded-flow-v2';
|
|
19
|
+
import { EmbeddedFlowResponseType as EmbeddedFlowResponseTypeV1, EmbeddedFlowType as EmbeddedFlowTypeV1 } from '../embedded-flow';
|
|
20
|
+
/**
|
|
21
|
+
* Status enumeration for ThunderID embedded sign-in flow operations.
|
|
22
|
+
*
|
|
23
|
+
* These statuses indicate the current state of the sign-in flow and determine
|
|
24
|
+
* the next action required by the client application. Each status provides
|
|
25
|
+
* specific guidance on how to proceed with the authentication process.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* switch (response.flowStatus) {
|
|
30
|
+
* case EmbeddedSignInFlowStatus.Incomplete:
|
|
31
|
+
* // More user input needed - render form components
|
|
32
|
+
* break;
|
|
33
|
+
* case EmbeddedSignInFlowStatus.Complete:
|
|
34
|
+
* // Authentication successful - handle completion
|
|
35
|
+
* break;
|
|
36
|
+
* case EmbeddedSignInFlowStatus.Error:
|
|
37
|
+
* // Authentication failed - show error message
|
|
38
|
+
* break;
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @experimental Part of the new ThunderID API
|
|
43
|
+
*/
|
|
44
|
+
export declare enum EmbeddedSignInFlowStatus {
|
|
45
|
+
/**
|
|
46
|
+
* Sign-in flow completed successfully.
|
|
47
|
+
*
|
|
48
|
+
* The user has been authenticated and the flow can proceed to
|
|
49
|
+
* OAuth2 completion or redirection. Check for redirectUrl or
|
|
50
|
+
* assertion data in the response.
|
|
51
|
+
*/
|
|
52
|
+
Complete = "COMPLETE",
|
|
53
|
+
/**
|
|
54
|
+
* Sign-in flow encountered an error.
|
|
55
|
+
*
|
|
56
|
+
* Authentication failed due to invalid credentials, system error,
|
|
57
|
+
* or other issues. Check error details in the response and handle
|
|
58
|
+
* appropriately (retry, show error message, etc.).
|
|
59
|
+
*/
|
|
60
|
+
Error = "ERROR",
|
|
61
|
+
/**
|
|
62
|
+
* Sign-in flow requires additional user input.
|
|
63
|
+
*
|
|
64
|
+
* More authentication steps are needed. The response will contain
|
|
65
|
+
* components in data.meta.components that should be rendered to
|
|
66
|
+
* collect additional user input (e.g., MFA, password, etc.).
|
|
67
|
+
*/
|
|
68
|
+
Incomplete = "INCOMPLETE"
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Type enumeration for ThunderID embedded sign-in flow responses.
|
|
72
|
+
*
|
|
73
|
+
* Determines the nature of the flow response and how the client should
|
|
74
|
+
* handle the returned data. This affects both UI rendering and flow
|
|
75
|
+
* continuation logic.
|
|
76
|
+
*
|
|
77
|
+
* @experimental Part of the new ThunderID API
|
|
78
|
+
*/
|
|
79
|
+
export declare enum EmbeddedSignInFlowType {
|
|
80
|
+
/**
|
|
81
|
+
* Response requires external redirection.
|
|
82
|
+
*
|
|
83
|
+
* Used for social login providers, external identity providers,
|
|
84
|
+
* or other flows that require navigating to an external URL.
|
|
85
|
+
* The response will contain redirection information.
|
|
86
|
+
*/
|
|
87
|
+
Redirection = "REDIRECTION",
|
|
88
|
+
/**
|
|
89
|
+
* Response contains view components for rendering.
|
|
90
|
+
*
|
|
91
|
+
* Standard embedded flow response containing UI components
|
|
92
|
+
* that should be rendered within the current application
|
|
93
|
+
* context. Most common type for embedded authentication.
|
|
94
|
+
*/
|
|
95
|
+
View = "VIEW"
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Extended response structure for ThunderID embedded sign-in flow.
|
|
99
|
+
*
|
|
100
|
+
* This interface defines additional properties that are added at the SDK level
|
|
101
|
+
* to enhance the basic API response with client-side computed values. These
|
|
102
|
+
* properties provide convenience for common post-authentication operations.
|
|
103
|
+
*
|
|
104
|
+
* @remarks This response structure is enhanced by the SDK and contains
|
|
105
|
+
* properties beyond the raw API response. It's designed to simplify
|
|
106
|
+
* post-authentication handling for client applications.
|
|
107
|
+
*
|
|
108
|
+
* @experimental This interface is part of the new ThunderID platform
|
|
109
|
+
*/
|
|
110
|
+
export interface ExtendedEmbeddedSignInFlowResponse {
|
|
111
|
+
/**
|
|
112
|
+
* Computed redirect URL for post-authentication navigation.
|
|
113
|
+
*
|
|
114
|
+
* This URL is determined by the SDK based on the flow completion result
|
|
115
|
+
* and configured redirect settings. When present, the client application
|
|
116
|
+
* should navigate to this URL to complete the authentication process.
|
|
117
|
+
*
|
|
118
|
+
* @example "https://myapp.com/dashboard?session=abc123"
|
|
119
|
+
*/
|
|
120
|
+
redirectUrl?: string;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Primary response structure for ThunderID embedded sign-in flow operations.
|
|
124
|
+
*
|
|
125
|
+
* This is the main response interface returned by the sign-in API, combining
|
|
126
|
+
* the enhanced SDK properties with the core API response data. It provides all
|
|
127
|
+
* information needed to handle the current state of the authentication flow.
|
|
128
|
+
*
|
|
129
|
+
* The response structure adapts based on the flow status:
|
|
130
|
+
* - INCOMPLETE: Contains components for user interaction
|
|
131
|
+
* - COMPLETE: Contains completion data and potential redirection info
|
|
132
|
+
* - ERROR: Contains error information for troubleshooting
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```typescript
|
|
136
|
+
* const response: EmbeddedSignInFlowResponse = {
|
|
137
|
+
* executionId: "flow_12345",
|
|
138
|
+
* flowStatus: EmbeddedSignInFlowStatus.Incomplete,
|
|
139
|
+
* type: EmbeddedSignInFlowType.View,
|
|
140
|
+
* data: {
|
|
141
|
+
* meta: {
|
|
142
|
+
* components: [
|
|
143
|
+
* {
|
|
144
|
+
* id: "username_field",
|
|
145
|
+
* type: EmbeddedFlowComponentType.TextInput,
|
|
146
|
+
* label: "Username",
|
|
147
|
+
* required: true
|
|
148
|
+
* }
|
|
149
|
+
* ]
|
|
150
|
+
* }
|
|
151
|
+
* }
|
|
152
|
+
* };
|
|
153
|
+
* ```
|
|
154
|
+
*
|
|
155
|
+
* @experimental This interface is part of the new ThunderID platform
|
|
156
|
+
*/
|
|
157
|
+
export interface EmbeddedSignInFlowResponse extends ExtendedEmbeddedSignInFlowResponse {
|
|
158
|
+
/**
|
|
159
|
+
* JWT assertion returned when the flow reaches COMPLETE status on the V2 platform.
|
|
160
|
+
* Used to establish the session without a separate OAuth2 redirect.
|
|
161
|
+
*/
|
|
162
|
+
assertion?: string;
|
|
163
|
+
/**
|
|
164
|
+
* Per-step challenge token for replay protection.
|
|
165
|
+
* Must be included in the next request to continue this flow.
|
|
166
|
+
*/
|
|
167
|
+
challengeToken?: string;
|
|
168
|
+
/**
|
|
169
|
+
* Core response data containing UI components and flow metadata.
|
|
170
|
+
* Includes both modern meta.components structure and legacy fields for compatibility.
|
|
171
|
+
*/
|
|
172
|
+
data: EmbeddedFlowResponseDataV2 & {
|
|
173
|
+
/**
|
|
174
|
+
* Legacy action definitions for backward compatibility.
|
|
175
|
+
* @deprecated Use data.meta.components for new implementations
|
|
176
|
+
*/
|
|
177
|
+
actions?: {
|
|
178
|
+
/** Unique action identifier */
|
|
179
|
+
id: string;
|
|
180
|
+
/** Action type identifier */
|
|
181
|
+
type: EmbeddedFlowResponseTypeV1;
|
|
182
|
+
}[];
|
|
183
|
+
/**
|
|
184
|
+
* Legacy input field definitions for backward compatibility.
|
|
185
|
+
* @deprecated Use data.meta.components for new implementations
|
|
186
|
+
*/
|
|
187
|
+
inputs?: {
|
|
188
|
+
/** Field name identifier */
|
|
189
|
+
name: string;
|
|
190
|
+
/** Whether the field is required */
|
|
191
|
+
required: boolean;
|
|
192
|
+
/** Input field type */
|
|
193
|
+
type: string;
|
|
194
|
+
}[];
|
|
195
|
+
};
|
|
196
|
+
/**
|
|
197
|
+
* Unique identifier for this specific flow instance.
|
|
198
|
+
* Used to maintain state across multiple API calls during the authentication process.
|
|
199
|
+
*/
|
|
200
|
+
executionId: string;
|
|
201
|
+
/**
|
|
202
|
+
* Optional reason for flow failure in case of an error.
|
|
203
|
+
* Provides additional context when flowStatus is set to ERROR.
|
|
204
|
+
*/
|
|
205
|
+
failureReason?: string;
|
|
206
|
+
/**
|
|
207
|
+
* Current status of the sign-in flow.
|
|
208
|
+
* Determines the next action required by the client application.
|
|
209
|
+
*/
|
|
210
|
+
flowStatus: EmbeddedSignInFlowStatus;
|
|
211
|
+
/**
|
|
212
|
+
* Type of response indicating how to handle the returned data.
|
|
213
|
+
* Affects both UI rendering and navigation logic.
|
|
214
|
+
*/
|
|
215
|
+
type: EmbeddedSignInFlowType;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Response structure for completed ThunderID embedded sign-in flows.
|
|
219
|
+
*
|
|
220
|
+
* This interface defines the response format when the embedded sign-in flow
|
|
221
|
+
* reaches the COMPLETE status and requires OAuth2 flow completion. It contains
|
|
222
|
+
* the redirect URI that should be used for the final authentication step.
|
|
223
|
+
*
|
|
224
|
+
* @example
|
|
225
|
+
* ```typescript
|
|
226
|
+
* const completeResponse: EmbeddedSignInFlowCompleteResponse = {
|
|
227
|
+
* redirect_uri: "https://myapp.com/callback?code=abc123&state=xyz789"
|
|
228
|
+
* };
|
|
229
|
+
*
|
|
230
|
+
* // Typically handled automatically by the SDK
|
|
231
|
+
* window.location.href = completeResponse.redirect_uri;
|
|
232
|
+
* ```
|
|
233
|
+
*
|
|
234
|
+
* @experimental This interface is part of the new ThunderID platform
|
|
235
|
+
*/
|
|
236
|
+
export interface EmbeddedSignInFlowCompleteResponse {
|
|
237
|
+
/**
|
|
238
|
+
* OAuth2 redirect URI for completing the authentication flow.
|
|
239
|
+
*
|
|
240
|
+
* Contains the final redirect URL with authorization code, state,
|
|
241
|
+
* and other OAuth2 parameters needed to complete the authentication
|
|
242
|
+
* process. This URL should be navigated to automatically or manually
|
|
243
|
+
* depending on the application's requirements.
|
|
244
|
+
*/
|
|
245
|
+
redirect_uri: string;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Request payload for initiating ThunderID embedded sign-in flows.
|
|
249
|
+
*
|
|
250
|
+
* This type defines the minimum required information to start a new
|
|
251
|
+
* embedded sign-in flow. The flow type determines the kind of authentication
|
|
252
|
+
* process that will be initiated (e.g., standard login, MFA, etc.).
|
|
253
|
+
*
|
|
254
|
+
* @example
|
|
255
|
+
* ```typescript
|
|
256
|
+
* const initRequest: EmbeddedSignInFlowInitiateRequest = {
|
|
257
|
+
* applicationId: "app_12345",
|
|
258
|
+
* flowType: EmbeddedFlowType.Authentication
|
|
259
|
+
* };
|
|
260
|
+
*
|
|
261
|
+
* const response = await executeEmbeddedSignInFlow({
|
|
262
|
+
* baseUrl: "https://api.asgardeo.io/t/myorg",
|
|
263
|
+
* payload: initRequest
|
|
264
|
+
* });
|
|
265
|
+
* ```
|
|
266
|
+
*
|
|
267
|
+
* @experimental This type is part of the new ThunderID platform
|
|
268
|
+
*/
|
|
269
|
+
export interface EmbeddedSignInFlowInitiateRequest {
|
|
270
|
+
/**
|
|
271
|
+
* Unique identifier of the application initiating the sign-in flow.
|
|
272
|
+
* Must be a valid application ID registered in the ThunderID organization.
|
|
273
|
+
*/
|
|
274
|
+
applicationId: string;
|
|
275
|
+
/**
|
|
276
|
+
* Type of embedded flow to initiate.
|
|
277
|
+
* Determines the authentication process and available options.
|
|
278
|
+
*/
|
|
279
|
+
flowType: EmbeddedFlowTypeV1;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Request payload for executing steps in ThunderID embedded sign-in flows.
|
|
283
|
+
*
|
|
284
|
+
* This interface defines the structure for subsequent requests after flow initiation.
|
|
285
|
+
* It supports both continuing existing flows (with executionId) and submitting user
|
|
286
|
+
* input data collected from the rendered components.
|
|
287
|
+
*
|
|
288
|
+
* @example
|
|
289
|
+
* ```typescript
|
|
290
|
+
* // Continue existing flow with user input
|
|
291
|
+
* const stepRequest: EmbeddedSignInFlowRequest = {
|
|
292
|
+
* executionId: "flow_12345",
|
|
293
|
+
* action: "action_001",
|
|
294
|
+
* inputs: {
|
|
295
|
+
* username: "user@example.com",
|
|
296
|
+
* password: "securePassword123"
|
|
297
|
+
* }
|
|
298
|
+
* };
|
|
299
|
+
*
|
|
300
|
+
* // Submit to continue the flow
|
|
301
|
+
* const response = await executeEmbeddedSignInFlow({
|
|
302
|
+
* baseUrl: "https://api.asgardeo.io/t/myorg",
|
|
303
|
+
* payload: stepRequest
|
|
304
|
+
* });
|
|
305
|
+
* ```
|
|
306
|
+
*
|
|
307
|
+
* @experimental This interface is part of the new ThunderID platform
|
|
308
|
+
*/
|
|
309
|
+
export interface EmbeddedSignInFlowRequest extends Partial<EmbeddedSignInFlowInitiateRequest> {
|
|
310
|
+
/**
|
|
311
|
+
* Identifier of the specific action being triggered.
|
|
312
|
+
* Corresponds to action components in the UI (e.g., submit button, social login).
|
|
313
|
+
*/
|
|
314
|
+
action?: string;
|
|
315
|
+
/**
|
|
316
|
+
* Per-step challenge token received from the previous flow response.
|
|
317
|
+
* Required when continuing an existing flow to prevent replay attacks.
|
|
318
|
+
*/
|
|
319
|
+
challengeToken?: string;
|
|
320
|
+
/**
|
|
321
|
+
* Identifier of the flow instance to continue.
|
|
322
|
+
* Required when submitting data for an existing flow.
|
|
323
|
+
*/
|
|
324
|
+
executionId?: string;
|
|
325
|
+
/**
|
|
326
|
+
* User input data collected from the form components.
|
|
327
|
+
* Keys should match the component identifiers from the response.
|
|
328
|
+
*
|
|
329
|
+
* @example
|
|
330
|
+
* ```typescript
|
|
331
|
+
* {
|
|
332
|
+
* "username": "john.doe@example.com",
|
|
333
|
+
* "password": "mySecurePassword",
|
|
334
|
+
* "rememberMe": true
|
|
335
|
+
* }
|
|
336
|
+
* ```
|
|
337
|
+
*/
|
|
338
|
+
inputs?: Record<string, any>;
|
|
339
|
+
}
|
|
340
|
+
//# sourceMappingURL=embedded-signin-flow-v2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embedded-signin-flow-v2.d.ts","sourceRoot":"","sources":["../../../src/models/v2/embedded-signin-flow-v2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,wBAAwB,IAAI,0BAA0B,EAAC,MAAM,oBAAoB,CAAC;AAC1F,OAAO,EACL,wBAAwB,IAAI,0BAA0B,EACtD,gBAAgB,IAAI,kBAAkB,EACvC,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,oBAAY,wBAAwB;IAClC;;;;;;OAMG;IACH,QAAQ,aAAa;IAErB;;;;;;OAMG;IACH,KAAK,UAAU;IAEf;;;;;;OAMG;IACH,UAAU,eAAe;CAC1B;AAED;;;;;;;;GAQG;AACH,oBAAY,sBAAsB;IAChC;;;;;;OAMG;IACH,WAAW,gBAAgB;IAE3B;;;;;;OAMG;IACH,IAAI,SAAS;CACd;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,kCAAkC;IACjD;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,WAAW,0BAA2B,SAAQ,kCAAkC;IACpF;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,IAAI,EAAE,0BAA0B,GAAG;QACjC;;;WAGG;QACH,OAAO,CAAC,EAAE;YACR,+BAA+B;YAC/B,EAAE,EAAE,MAAM,CAAC;YACX,6BAA6B;YAC7B,IAAI,EAAE,0BAA0B,CAAC;SAClC,EAAE,CAAC;QAEJ;;;WAGG;QACH,MAAM,CAAC,EAAE;YACP,4BAA4B;YAC5B,IAAI,EAAE,MAAM,CAAC;YACb,oCAAoC;YACpC,QAAQ,EAAE,OAAO,CAAC;YAClB,uBAAuB;YACvB,IAAI,EAAE,MAAM,CAAC;SACd,EAAE,CAAC;KACL,CAAC;IAEF;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,UAAU,EAAE,wBAAwB,CAAC;IAErC;;;OAGG;IACH,IAAI,EAAE,sBAAsB,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,kCAAkC;IACjD;;;;;;;OAOG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,iCAAiC;IAChD;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,QAAQ,EAAE,kBAAkB,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,WAAW,yBAA0B,SAAQ,OAAO,CAAC,iCAAiC,CAAC;IAC3F;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B"}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import { EmbeddedFlowResponseType as EmbeddedFlowResponseTypeV1, EmbeddedFlowType as EmbeddedFlowTypeV1 } from '../embedded-flow';
|
|
19
|
+
/**
|
|
20
|
+
* Status enumeration for ThunderID embedded sign-up flow operations.
|
|
21
|
+
*
|
|
22
|
+
* These statuses indicate the current state of the registration flow and determine
|
|
23
|
+
* the next action required by the client application. Each status provides specific
|
|
24
|
+
* guidance on how to proceed with the user registration process.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* switch (response.flowStatus) {
|
|
29
|
+
* case EmbeddedSignUpFlowStatus.Incomplete:
|
|
30
|
+
* // More user input needed - render registration form components
|
|
31
|
+
* break;
|
|
32
|
+
* case EmbeddedSignUpFlowStatus.Complete:
|
|
33
|
+
* // Registration successful - handle completion
|
|
34
|
+
* break;
|
|
35
|
+
* case EmbeddedSignUpFlowStatus.Error:
|
|
36
|
+
* // Registration failed - show detailed error message
|
|
37
|
+
* const errorResponse = response as EmbeddedSignUpFlowErrorResponse;
|
|
38
|
+
* showError(errorResponse.failureReason);
|
|
39
|
+
* break;
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @experimental Part of the new ThunderID API
|
|
44
|
+
*/
|
|
45
|
+
export declare enum EmbeddedSignUpFlowStatus {
|
|
46
|
+
/**
|
|
47
|
+
* Sign-up flow completed successfully.
|
|
48
|
+
*
|
|
49
|
+
* The user has successfully registered and the flow can proceed to
|
|
50
|
+
* OAuth2 completion or redirection. Check for redirectUrl or assertion
|
|
51
|
+
* data in the response for next steps.
|
|
52
|
+
*/
|
|
53
|
+
Complete = "COMPLETE",
|
|
54
|
+
/**
|
|
55
|
+
* Sign-up flow encountered an error and cannot proceed.
|
|
56
|
+
*
|
|
57
|
+
* Registration failed due to validation errors, duplicate user,
|
|
58
|
+
* system errors, or other issues. The response will be of type
|
|
59
|
+
* `EmbeddedSignUpFlowErrorResponse` containing detailed failure
|
|
60
|
+
* information that can be displayed to the user.
|
|
61
|
+
*
|
|
62
|
+
* @see {@link EmbeddedSignUpFlowErrorResponse} for error response structure
|
|
63
|
+
*/
|
|
64
|
+
Error = "ERROR",
|
|
65
|
+
/**
|
|
66
|
+
* Sign-up flow requires additional user input.
|
|
67
|
+
*
|
|
68
|
+
* More registration steps are needed. The response will contain
|
|
69
|
+
* components in data.meta.components that should be rendered to
|
|
70
|
+
* collect additional user information (e.g., profile data, verification).
|
|
71
|
+
*/
|
|
72
|
+
Incomplete = "INCOMPLETE"
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Type enumeration for ThunderID embedded sign-up flow responses.
|
|
76
|
+
*
|
|
77
|
+
* Determines the nature of the registration flow response and how the client
|
|
78
|
+
* should handle the returned data. This affects both UI rendering and flow
|
|
79
|
+
* continuation logic during the user registration process.
|
|
80
|
+
*
|
|
81
|
+
* @experimental Part of the new ThunderID API
|
|
82
|
+
*/
|
|
83
|
+
export declare enum EmbeddedSignUpFlowType {
|
|
84
|
+
/**
|
|
85
|
+
* Response requires external redirection.
|
|
86
|
+
*
|
|
87
|
+
* Used for social registration providers, external identity providers,
|
|
88
|
+
* or other flows that require navigating to an external URL during
|
|
89
|
+
* the registration process. The response will contain redirection information.
|
|
90
|
+
*/
|
|
91
|
+
Redirection = "REDIRECTION",
|
|
92
|
+
/**
|
|
93
|
+
* Response contains view components for rendering.
|
|
94
|
+
*
|
|
95
|
+
* Standard embedded registration flow response containing UI components
|
|
96
|
+
* that should be rendered within the current application context.
|
|
97
|
+
* Most common type for embedded user registration.
|
|
98
|
+
*/
|
|
99
|
+
View = "VIEW"
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Extended response structure for the embedded sign-up flow.
|
|
103
|
+
* @remarks This response is only done from the SDK level.
|
|
104
|
+
* @experimental
|
|
105
|
+
*/
|
|
106
|
+
export interface ExtendedEmbeddedSignUpFlowResponse {
|
|
107
|
+
/**
|
|
108
|
+
* The URL to redirect the user after completing the sign-up flow.
|
|
109
|
+
*/
|
|
110
|
+
redirectUrl?: string;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Response structure for the new ThunderID embedded sign-up flow.
|
|
114
|
+
*
|
|
115
|
+
* This interface defines the structure for successful sign-up flow responses
|
|
116
|
+
* from ThunderID APIs. For error responses, see `EmbeddedSignUpFlowErrorResponse`.
|
|
117
|
+
*
|
|
118
|
+
* **Flow States:**
|
|
119
|
+
* - `INCOMPLETE`: More user input required, `data` contains form components
|
|
120
|
+
* - `COMPLETE`: Sign-up finished, may contain redirect information
|
|
121
|
+
* - For `ERROR` status, a separate `EmbeddedSignUpFlowErrorResponse` structure is used
|
|
122
|
+
*
|
|
123
|
+
* **Component-Driven UI:**
|
|
124
|
+
* The `data.inputs` and `data.actions` are transformed by the React transformer
|
|
125
|
+
* into component-driven format for consistent UI rendering across different
|
|
126
|
+
* ThunderID versions.
|
|
127
|
+
*
|
|
128
|
+
* @experimental Part of the new ThunderID API
|
|
129
|
+
* @see {@link EmbeddedSignUpFlowErrorResponse} for error response structure
|
|
130
|
+
* @see {@link EmbeddedSignUpFlowStatus} for available flow statuses
|
|
131
|
+
*/
|
|
132
|
+
export interface EmbeddedSignUpFlowResponse extends ExtendedEmbeddedSignUpFlowResponse {
|
|
133
|
+
/**
|
|
134
|
+
* Per-step challenge token for replay protection.
|
|
135
|
+
* Must be included in the next request to continue this flow.
|
|
136
|
+
*/
|
|
137
|
+
challengeToken?: string;
|
|
138
|
+
/**
|
|
139
|
+
* Flow data containing form inputs and available actions.
|
|
140
|
+
* This is transformed to component-driven format by the React transformer.
|
|
141
|
+
*/
|
|
142
|
+
data: {
|
|
143
|
+
/**
|
|
144
|
+
* Available actions the user can take (e.g., form submission, social sign-up).
|
|
145
|
+
*/
|
|
146
|
+
actions?: {
|
|
147
|
+
id: string;
|
|
148
|
+
type: EmbeddedFlowResponseTypeV1;
|
|
149
|
+
}[];
|
|
150
|
+
/**
|
|
151
|
+
* Input fields required for the current step of the sign-up flow.
|
|
152
|
+
*/
|
|
153
|
+
inputs?: {
|
|
154
|
+
name: string;
|
|
155
|
+
required: boolean;
|
|
156
|
+
type: string;
|
|
157
|
+
}[];
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Unique identifier for this sign-up flow instance.
|
|
161
|
+
*/
|
|
162
|
+
executionId: string;
|
|
163
|
+
/**
|
|
164
|
+
* Optional reason for flow failure in case of an error.
|
|
165
|
+
* Provides additional context when flowStatus is set to ERROR.
|
|
166
|
+
*/
|
|
167
|
+
failureReason?: string;
|
|
168
|
+
/**
|
|
169
|
+
* Current status of the sign-up flow.
|
|
170
|
+
* Determines whether more input is needed or the flow is complete.
|
|
171
|
+
*/
|
|
172
|
+
flowStatus: EmbeddedSignUpFlowStatus;
|
|
173
|
+
/**
|
|
174
|
+
* Type of response, indicating the expected user interaction.
|
|
175
|
+
*/
|
|
176
|
+
type: EmbeddedSignUpFlowType;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Response structure for the new ThunderID embedded sign-up flow when the flow is complete.
|
|
180
|
+
* @experimental
|
|
181
|
+
*/
|
|
182
|
+
export interface EmbeddedSignUpFlowCompleteResponse {
|
|
183
|
+
redirect_uri: string;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Request payload for initiating the new ThunderID embedded sign-up flow.
|
|
187
|
+
* @experimental
|
|
188
|
+
*/
|
|
189
|
+
export interface EmbeddedSignUpFlowInitiateRequest {
|
|
190
|
+
applicationId: string;
|
|
191
|
+
flowType: EmbeddedFlowTypeV1;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Request payload for executing steps in the new ThunderID embedded sign-up flow.
|
|
195
|
+
* @experimental
|
|
196
|
+
*/
|
|
197
|
+
export interface EmbeddedSignUpFlowRequest extends Partial<EmbeddedSignUpFlowInitiateRequest> {
|
|
198
|
+
action?: string;
|
|
199
|
+
challengeToken?: string;
|
|
200
|
+
executionId?: string;
|
|
201
|
+
inputs?: Record<string, any>;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Error response structure for the new ThunderID embedded sign-up flow.
|
|
205
|
+
*
|
|
206
|
+
* This interface defines the structure of error responses returned by ThunderID APIs
|
|
207
|
+
* when sign-up operations fail. Unlike ThunderIDV1 which uses generic error codes and
|
|
208
|
+
* descriptions, ThunderID provides more specific failure reasons within the flow context.
|
|
209
|
+
*
|
|
210
|
+
* **Key Differences from ThunderIDV1:**
|
|
211
|
+
* - Uses `failureReason` instead of `message`/`description` for error details
|
|
212
|
+
* - Maintains flow context with `executionId` for tracking failed operations
|
|
213
|
+
* - Uses structured `flowStatus` enum instead of generic error codes
|
|
214
|
+
* - Provides empty `data` object for consistency with success responses
|
|
215
|
+
*
|
|
216
|
+
* **Error Handling:**
|
|
217
|
+
* This error response format is automatically detected and processed by the
|
|
218
|
+
* `extractErrorMessage()` and `checkForErrorResponse()` functions in the transformer
|
|
219
|
+
* to extract meaningful error messages for display to users.
|
|
220
|
+
*
|
|
221
|
+
* @example
|
|
222
|
+
* ```typescript
|
|
223
|
+
* // Typical ThunderID error response
|
|
224
|
+
* const errorResponse: EmbeddedSignUpFlowErrorResponse = {
|
|
225
|
+
* executionId: "0ccfeaf9-18b3-43a5-bcc1-07d863dcb2c0",
|
|
226
|
+
* flowStatus: EmbeddedSignUpFlowStatus.Error,
|
|
227
|
+
* data: {},
|
|
228
|
+
* failureReason: "User already exists with the provided username."
|
|
229
|
+
* };
|
|
230
|
+
*
|
|
231
|
+
* // This will be automatically transformed to a user-friendly error message:
|
|
232
|
+
* // "User already exists with the provided username."
|
|
233
|
+
* ```
|
|
234
|
+
*
|
|
235
|
+
* @experimental This is part of the new ThunderID API and may change in future versions
|
|
236
|
+
* @see {@link EmbeddedSignUpFlowStatus.Error} for the error status enum value
|
|
237
|
+
* @see {@link EmbeddedSignUpFlowResponse} for the corresponding success response structure
|
|
238
|
+
*/
|
|
239
|
+
export interface EmbeddedSignUpFlowErrorResponse {
|
|
240
|
+
/**
|
|
241
|
+
* Additional response data, typically empty for error responses.
|
|
242
|
+
* Maintained for structural consistency with successful flow responses
|
|
243
|
+
* which contain components, actions, and other flow data.
|
|
244
|
+
*/
|
|
245
|
+
data: Record<string, any>;
|
|
246
|
+
/**
|
|
247
|
+
* Human-readable explanation of why the sign-up operation failed.
|
|
248
|
+
*
|
|
249
|
+
* This field contains specific error details that can be directly displayed
|
|
250
|
+
* to users, such as:
|
|
251
|
+
* - "User already exists with the provided username."
|
|
252
|
+
* - "Invalid email address format."
|
|
253
|
+
* - "Password does not meet complexity requirements."
|
|
254
|
+
*
|
|
255
|
+
* Unlike generic error codes, this provides contextual information
|
|
256
|
+
* that helps users understand and resolve the issue.
|
|
257
|
+
*/
|
|
258
|
+
/**
|
|
259
|
+
* Unique identifier for the sign-up flow instance.
|
|
260
|
+
* This ID is used to track the flow state and correlate error responses
|
|
261
|
+
* with the specific sign-up attempt that failed.
|
|
262
|
+
*/
|
|
263
|
+
executionId: string;
|
|
264
|
+
failureReason: string;
|
|
265
|
+
/**
|
|
266
|
+
* Status of the sign-up flow, which will be `EmbeddedSignUpFlowStatus.Error`
|
|
267
|
+
* for error responses. This field is used by error detection logic to
|
|
268
|
+
* identify failed flow responses.
|
|
269
|
+
*/
|
|
270
|
+
flowStatus: EmbeddedSignUpFlowStatus;
|
|
271
|
+
}
|
|
272
|
+
//# sourceMappingURL=embedded-signup-flow-v2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embedded-signup-flow-v2.d.ts","sourceRoot":"","sources":["../../../src/models/v2/embedded-signup-flow-v2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,wBAAwB,IAAI,0BAA0B,EACtD,gBAAgB,IAAI,kBAAkB,EACvC,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,oBAAY,wBAAwB;IAClC;;;;;;OAMG;IACH,QAAQ,aAAa;IAErB;;;;;;;;;OASG;IACH,KAAK,UAAU;IAEf;;;;;;OAMG;IACH,UAAU,eAAe;CAC1B;AAED;;;;;;;;GAQG;AACH,oBAAY,sBAAsB;IAChC;;;;;;OAMG;IACH,WAAW,gBAAgB;IAE3B;;;;;;OAMG;IACH,IAAI,SAAS;CACd;AAED;;;;GAIG;AACH,MAAM,WAAW,kCAAkC;IACjD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,0BAA2B,SAAQ,kCAAkC;IACpF;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,IAAI,EAAE;QACJ;;WAEG;QACH,OAAO,CAAC,EAAE;YACR,EAAE,EAAE,MAAM,CAAC;YACX,IAAI,EAAE,0BAA0B,CAAC;SAClC,EAAE,CAAC;QAEJ;;WAEG;QACH,MAAM,CAAC,EAAE;YACP,IAAI,EAAE,MAAM,CAAC;YACb,QAAQ,EAAE,OAAO,CAAC;YAClB,IAAI,EAAE,MAAM,CAAC;SACd,EAAE,CAAC;KACL,CAAC;IAEF;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,UAAU,EAAE,wBAAwB,CAAC;IAErC;;OAEG;IACH,IAAI,EAAE,sBAAsB,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,kCAAkC;IACjD,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,iCAAiC;IAChD,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,kBAAkB,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,yBAA0B,SAAQ,OAAO,CAAC,iCAAiC,CAAC;IAC3F,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE1B;;;;;;;;;;;OAWG;IACH;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,UAAU,EAAE,wBAAwB,CAAC;CACtC"}
|