@thunderid/javascript 0.11.1 → 0.11.3

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.
Files changed (232) hide show
  1. package/dist/DefaultCacheStore.d.ts +0 -17
  2. package/dist/DefaultCacheStore.d.ts.map +1 -1
  3. package/dist/DefaultCrypto.d.ts +0 -17
  4. package/dist/DefaultCrypto.d.ts.map +1 -1
  5. package/dist/HttpClient.d.ts +0 -17
  6. package/dist/HttpClient.d.ts.map +1 -1
  7. package/dist/IsomorphicCrypto.d.ts +0 -17
  8. package/dist/IsomorphicCrypto.d.ts.map +1 -1
  9. package/dist/StorageManager.d.ts +0 -17
  10. package/dist/StorageManager.d.ts.map +1 -1
  11. package/dist/ThunderIDJavaScriptClient.d.ts +7 -17
  12. package/dist/ThunderIDJavaScriptClient.d.ts.map +1 -1
  13. package/dist/api/executeEmbeddedRecoveryFlow.d.ts +0 -17
  14. package/dist/api/executeEmbeddedRecoveryFlow.d.ts.map +1 -1
  15. package/dist/api/executeEmbeddedSignInFlow.d.ts +0 -17
  16. package/dist/api/executeEmbeddedSignInFlow.d.ts.map +1 -1
  17. package/dist/api/executeEmbeddedSignUpFlow.d.ts +0 -17
  18. package/dist/api/executeEmbeddedSignUpFlow.d.ts.map +1 -1
  19. package/dist/api/executeEmbeddedUserOnboardingFlow.d.ts +0 -17
  20. package/dist/api/executeEmbeddedUserOnboardingFlow.d.ts.map +1 -1
  21. package/dist/api/getFlowMeta.d.ts +0 -17
  22. package/dist/api/getFlowMeta.d.ts.map +1 -1
  23. package/dist/api/getOrganizationUnitChildren.d.ts +0 -17
  24. package/dist/api/getOrganizationUnitChildren.d.ts.map +1 -1
  25. package/dist/api/getUserInfo.d.ts +0 -17
  26. package/dist/api/getUserInfo.d.ts.map +1 -1
  27. package/dist/api/getUsersMe.d.ts +0 -17
  28. package/dist/api/getUsersMe.d.ts.map +1 -1
  29. package/dist/api/updateMeProfile.d.ts +0 -17
  30. package/dist/api/updateMeProfile.d.ts.map +1 -1
  31. package/dist/cjs/index.cjs +750 -1144
  32. package/dist/constants/ApplicationNativeAuthenticationConstants.d.ts +0 -17
  33. package/dist/constants/ApplicationNativeAuthenticationConstants.d.ts.map +1 -1
  34. package/dist/constants/OIDCDiscoveryConstants.d.ts +0 -17
  35. package/dist/constants/OIDCDiscoveryConstants.d.ts.map +1 -1
  36. package/dist/constants/OIDCRequestConstants.d.ts +0 -17
  37. package/dist/constants/OIDCRequestConstants.d.ts.map +1 -1
  38. package/dist/constants/PKCEConstants.d.ts +0 -17
  39. package/dist/constants/PKCEConstants.d.ts.map +1 -1
  40. package/dist/constants/ScopeConstants.d.ts +0 -17
  41. package/dist/constants/ScopeConstants.d.ts.map +1 -1
  42. package/dist/constants/TokenConstants.d.ts +3 -17
  43. package/dist/constants/TokenConstants.d.ts.map +1 -1
  44. package/dist/constants/TokenExchangeConstants.d.ts +0 -17
  45. package/dist/constants/TokenExchangeConstants.d.ts.map +1 -1
  46. package/dist/constants/VendorConstants.d.ts +0 -17
  47. package/dist/constants/VendorConstants.d.ts.map +1 -1
  48. package/dist/edge/index.js +750 -1145
  49. package/dist/errors/ThunderIDAPIError.d.ts +0 -17
  50. package/dist/errors/ThunderIDAPIError.d.ts.map +1 -1
  51. package/dist/errors/ThunderIDError.d.ts +0 -17
  52. package/dist/errors/ThunderIDError.d.ts.map +1 -1
  53. package/dist/errors/ThunderIDRuntimeError.d.ts +0 -17
  54. package/dist/errors/ThunderIDRuntimeError.d.ts.map +1 -1
  55. package/dist/errors/exception.d.ts +0 -17
  56. package/dist/errors/exception.d.ts.map +1 -1
  57. package/dist/i18n/constants/TranslationBundleConstants.d.ts +0 -17
  58. package/dist/i18n/constants/TranslationBundleConstants.d.ts.map +1 -1
  59. package/dist/i18n/models/i18n.d.ts +0 -17
  60. package/dist/i18n/models/i18n.d.ts.map +1 -1
  61. package/dist/i18n/translations/en-US.d.ts +0 -17
  62. package/dist/i18n/translations/en-US.d.ts.map +1 -1
  63. package/dist/i18n/translations/fr-FR.d.ts +0 -17
  64. package/dist/i18n/translations/fr-FR.d.ts.map +1 -1
  65. package/dist/i18n/translations/hi-IN.d.ts +0 -17
  66. package/dist/i18n/translations/hi-IN.d.ts.map +1 -1
  67. package/dist/i18n/translations/index.d.ts +0 -17
  68. package/dist/i18n/translations/index.d.ts.map +1 -1
  69. package/dist/i18n/translations/ja-JP.d.ts +0 -17
  70. package/dist/i18n/translations/ja-JP.d.ts.map +1 -1
  71. package/dist/i18n/translations/pt-BR.d.ts +0 -17
  72. package/dist/i18n/translations/pt-BR.d.ts.map +1 -1
  73. package/dist/i18n/translations/pt-PT.d.ts +0 -17
  74. package/dist/i18n/translations/pt-PT.d.ts.map +1 -1
  75. package/dist/i18n/translations/si-LK.d.ts +0 -17
  76. package/dist/i18n/translations/si-LK.d.ts.map +1 -1
  77. package/dist/i18n/translations/ta-IN.d.ts +0 -17
  78. package/dist/i18n/translations/ta-IN.d.ts.map +1 -1
  79. package/dist/i18n/translations/te-IN.d.ts +0 -17
  80. package/dist/i18n/translations/te-IN.d.ts.map +1 -1
  81. package/dist/i18n/utils/getDefaultI18nBundles.d.ts +0 -17
  82. package/dist/i18n/utils/getDefaultI18nBundles.d.ts.map +1 -1
  83. package/dist/i18n/utils/normalizeTranslations.d.ts +0 -17
  84. package/dist/i18n/utils/normalizeTranslations.d.ts.map +1 -1
  85. package/dist/index.d.ts +2 -17
  86. package/dist/index.d.ts.map +1 -1
  87. package/dist/index.js +750 -1145
  88. package/dist/models/agent.d.ts +0 -17
  89. package/dist/models/agent.d.ts.map +1 -1
  90. package/dist/models/auth-code-response.d.ts +0 -17
  91. package/dist/models/auth-code-response.d.ts.map +1 -1
  92. package/dist/models/ciba.d.ts +0 -17
  93. package/dist/models/ciba.d.ts.map +1 -1
  94. package/dist/models/client.d.ts +0 -17
  95. package/dist/models/client.d.ts.map +1 -1
  96. package/dist/models/config.d.ts +53 -23
  97. package/dist/models/config.d.ts.map +1 -1
  98. package/dist/models/crypto.d.ts +0 -17
  99. package/dist/models/crypto.d.ts.map +1 -1
  100. package/dist/models/embedded-flow.d.ts +0 -17
  101. package/dist/models/embedded-flow.d.ts.map +1 -1
  102. package/dist/models/embedded-recovery-flow.d.ts +0 -17
  103. package/dist/models/embedded-recovery-flow.d.ts.map +1 -1
  104. package/dist/models/embedded-signin-flow.d.ts +5 -17
  105. package/dist/models/embedded-signin-flow.d.ts.map +1 -1
  106. package/dist/models/embedded-signup-flow.d.ts +0 -17
  107. package/dist/models/embedded-signup-flow.d.ts.map +1 -1
  108. package/dist/models/extensions/components.d.ts +0 -17
  109. package/dist/models/extensions/components.d.ts.map +1 -1
  110. package/dist/models/field.d.ts +0 -17
  111. package/dist/models/field.d.ts.map +1 -1
  112. package/dist/models/flow-meta.d.ts +0 -17
  113. package/dist/models/flow-meta.d.ts.map +1 -1
  114. package/dist/models/flow.d.ts +1 -19
  115. package/dist/models/flow.d.ts.map +1 -1
  116. package/dist/models/http.d.ts +0 -17
  117. package/dist/models/http.d.ts.map +1 -1
  118. package/dist/models/oauth-request.d.ts +0 -17
  119. package/dist/models/oauth-request.d.ts.map +1 -1
  120. package/dist/models/oauth-response.d.ts +0 -17
  121. package/dist/models/oauth-response.d.ts.map +1 -1
  122. package/dist/models/oidc-discovery.d.ts +0 -17
  123. package/dist/models/oidc-discovery.d.ts.map +1 -1
  124. package/dist/models/oidc-endpoints.d.ts +0 -17
  125. package/dist/models/oidc-endpoints.d.ts.map +1 -1
  126. package/dist/models/session.d.ts +0 -17
  127. package/dist/models/session.d.ts.map +1 -1
  128. package/dist/models/store.d.ts +0 -17
  129. package/dist/models/store.d.ts.map +1 -1
  130. package/dist/models/token-endpoint-auth.d.ts +0 -17
  131. package/dist/models/token-endpoint-auth.d.ts.map +1 -1
  132. package/dist/models/token.d.ts +0 -17
  133. package/dist/models/token.d.ts.map +1 -1
  134. package/dist/models/translation.d.ts +0 -17
  135. package/dist/models/translation.d.ts.map +1 -1
  136. package/dist/models/user.d.ts +0 -17
  137. package/dist/models/user.d.ts.map +1 -1
  138. package/dist/models/utility-types.d.ts +0 -17
  139. package/dist/models/utility-types.d.ts.map +1 -1
  140. package/dist/models/vars.d.ts +0 -17
  141. package/dist/models/vars.d.ts.map +1 -1
  142. package/dist/theme/createTheme.d.ts +0 -17
  143. package/dist/theme/createTheme.d.ts.map +1 -1
  144. package/dist/theme/types.d.ts +0 -17
  145. package/dist/theme/types.d.ts.map +1 -1
  146. package/dist/utils/AuthenticationHelper.d.ts +11 -17
  147. package/dist/utils/AuthenticationHelper.d.ts.map +1 -1
  148. package/dist/utils/arrayBufferToBase64url.d.ts +0 -17
  149. package/dist/utils/arrayBufferToBase64url.d.ts.map +1 -1
  150. package/dist/utils/base64Encode.d.ts +0 -17
  151. package/dist/utils/base64Encode.d.ts.map +1 -1
  152. package/dist/utils/base64urlToArrayBuffer.d.ts +0 -17
  153. package/dist/utils/base64urlToArrayBuffer.d.ts.map +1 -1
  154. package/dist/utils/bem.d.ts +0 -17
  155. package/dist/utils/bem.d.ts.map +1 -1
  156. package/dist/utils/buildValidatorFromRules.d.ts +0 -17
  157. package/dist/utils/buildValidatorFromRules.d.ts.map +1 -1
  158. package/dist/utils/containsMetaFlowTemplateLiteral.d.ts +0 -17
  159. package/dist/utils/containsMetaFlowTemplateLiteral.d.ts.map +1 -1
  160. package/dist/utils/countryCodeToFlagEmoji.d.ts +0 -17
  161. package/dist/utils/countryCodeToFlagEmoji.d.ts.map +1 -1
  162. package/dist/utils/deepMerge.d.ts +0 -17
  163. package/dist/utils/deepMerge.d.ts.map +1 -1
  164. package/dist/utils/evaluateValidationRule.d.ts +0 -17
  165. package/dist/utils/evaluateValidationRule.d.ts.map +1 -1
  166. package/dist/utils/extractEmojiFromUri.d.ts +0 -17
  167. package/dist/utils/extractEmojiFromUri.d.ts.map +1 -1
  168. package/dist/utils/extractPkceStorageKeyFromState.d.ts +0 -17
  169. package/dist/utils/extractPkceStorageKeyFromState.d.ts.map +1 -1
  170. package/dist/utils/extractTenantDomainFromIdTokenPayload.d.ts +0 -17
  171. package/dist/utils/extractTenantDomainFromIdTokenPayload.d.ts.map +1 -1
  172. package/dist/utils/extractUserClaimsFromIdToken.d.ts +0 -17
  173. package/dist/utils/extractUserClaimsFromIdToken.d.ts.map +1 -1
  174. package/dist/utils/formatDate.d.ts +0 -17
  175. package/dist/utils/formatDate.d.ts.map +1 -1
  176. package/dist/utils/generatePkceStorageKey.d.ts +0 -17
  177. package/dist/utils/generatePkceStorageKey.d.ts.map +1 -1
  178. package/dist/utils/generateStateParamForRequestCorrelation.d.ts +0 -17
  179. package/dist/utils/generateStateParamForRequestCorrelation.d.ts.map +1 -1
  180. package/dist/utils/get.d.ts +0 -17
  181. package/dist/utils/get.d.ts.map +1 -1
  182. package/dist/utils/getAuthorizeRequestUrlParams.d.ts +0 -17
  183. package/dist/utils/getAuthorizeRequestUrlParams.d.ts.map +1 -1
  184. package/dist/utils/getLatestStateParam.d.ts +0 -17
  185. package/dist/utils/getLatestStateParam.d.ts.map +1 -1
  186. package/dist/utils/getRedirectBasedSignUpUrl.d.ts +0 -17
  187. package/dist/utils/getRedirectBasedSignUpUrl.d.ts.map +1 -1
  188. package/dist/utils/getVendorPrefix.d.ts +0 -17
  189. package/dist/utils/getVendorPrefix.d.ts.map +1 -1
  190. package/dist/utils/injectRequestedPermissions.d.ts +0 -17
  191. package/dist/utils/injectRequestedPermissions.d.ts.map +1 -1
  192. package/dist/utils/isEmojiUri.d.ts +0 -17
  193. package/dist/utils/isEmojiUri.d.ts.map +1 -1
  194. package/dist/utils/isEmpty.d.ts +0 -17
  195. package/dist/utils/isEmpty.d.ts.map +1 -1
  196. package/dist/utils/isMetaFlowTemplateLiteral.d.ts +0 -17
  197. package/dist/utils/isMetaFlowTemplateLiteral.d.ts.map +1 -1
  198. package/dist/utils/isRecognizedBaseUrlPattern.d.ts +0 -17
  199. package/dist/utils/isRecognizedBaseUrlPattern.d.ts.map +1 -1
  200. package/dist/utils/isTranslationFlowTemplateLiteral.d.ts +0 -17
  201. package/dist/utils/isTranslationFlowTemplateLiteral.d.ts.map +1 -1
  202. package/dist/utils/logger.d.ts +0 -17
  203. package/dist/utils/logger.d.ts.map +1 -1
  204. package/dist/utils/parseApiErrorMessage.d.ts +0 -17
  205. package/dist/utils/parseApiErrorMessage.d.ts.map +1 -1
  206. package/dist/utils/parseFlowTemplateLiteral.d.ts +0 -17
  207. package/dist/utils/parseFlowTemplateLiteral.d.ts.map +1 -1
  208. package/dist/utils/processOpenIDScopes.d.ts +0 -17
  209. package/dist/utils/processOpenIDScopes.d.ts.map +1 -1
  210. package/dist/utils/processUsername.d.ts +0 -17
  211. package/dist/utils/processUsername.d.ts.map +1 -1
  212. package/dist/utils/removeTrailingSlash.d.ts +0 -17
  213. package/dist/utils/removeTrailingSlash.d.ts.map +1 -1
  214. package/dist/utils/resolveFieldName.d.ts +0 -17
  215. package/dist/utils/resolveFieldName.d.ts.map +1 -1
  216. package/dist/utils/resolveFlowTemplateLiterals.d.ts +0 -17
  217. package/dist/utils/resolveFlowTemplateLiterals.d.ts.map +1 -1
  218. package/dist/utils/resolveLocaleDisplayName.d.ts +0 -17
  219. package/dist/utils/resolveLocaleDisplayName.d.ts.map +1 -1
  220. package/dist/utils/resolveLocaleEmoji.d.ts +0 -17
  221. package/dist/utils/resolveLocaleEmoji.d.ts.map +1 -1
  222. package/dist/utils/resolveMeta.d.ts +0 -17
  223. package/dist/utils/resolveMeta.d.ts.map +1 -1
  224. package/dist/utils/resolveResourceEndpoint.d.ts +48 -0
  225. package/dist/utils/resolveResourceEndpoint.d.ts.map +1 -0
  226. package/dist/utils/set.d.ts +0 -17
  227. package/dist/utils/set.d.ts.map +1 -1
  228. package/dist/utils/startCase.d.ts +0 -17
  229. package/dist/utils/startCase.d.ts.map +1 -1
  230. package/dist/utils/withVendorCSSClassPrefix.d.ts +1 -18
  231. package/dist/utils/withVendorCSSClassPrefix.d.ts.map +1 -1
  232. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -14,23 +14,6 @@ var __export = (all) => {
14
14
  //#endregion
15
15
  //#region src/constants/TokenConstants.ts
16
16
  /**
17
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
18
- *
19
- * WSO2 LLC. licenses this file to you under the Apache License,
20
- * Version 2.0 (the "License"); you may not use this file except
21
- * in compliance with the License.
22
- * You may obtain a copy of the License at
23
- *
24
- * http://www.apache.org/licenses/LICENSE-2.0
25
- *
26
- * Unless required by applicable law or agreed to in writing,
27
- * software distributed under the License is distributed on an
28
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
29
- * KIND, either express or implied. See the License for the
30
- * specific language governing permissions and limitations
31
- * under the License.
32
- */
33
- /**
34
17
  * Constants related to OIDC token management and storage.
35
18
  * This object contains configuration values and storage keys
36
19
  * used in token validation and management processes.
@@ -59,30 +42,14 @@ const TokenConstants = {
59
42
  "ML-DSA-65",
60
43
  "ML-DSA-87"
61
44
  ] },
62
- Storage: { StorageKeys: { REFRESH_TOKEN_TIMER: "refresh_token_timer" } }
45
+ Storage: { StorageKeys: { REFRESH_TOKEN_TIMER: "refresh_token_timer" } },
46
+ Lifecycle: { CLIENT_CREDENTIALS_REFRESH_MARGIN_MS: 3e4 }
63
47
  };
64
48
  var TokenConstants_default = TokenConstants;
65
49
 
66
50
  //#endregion
67
51
  //#region src/errors/exception.ts
68
52
  /**
69
- * Copyright (c) 2020, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
70
- *
71
- * WSO2 LLC. licenses this file to you under the Apache License,
72
- * Version 2.0 (the "License"); you may not use this file except
73
- * in compliance with the License.
74
- * You may obtain a copy of the License at
75
- *
76
- * http://www.apache.org/licenses/LICENSE-2.0
77
- *
78
- * Unless required by applicable law or agreed to in writing,
79
- * software distributed under the License is distributed on an
80
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
81
- * KIND, either express or implied. See the License for the
82
- * specific language governing permissions and limitations
83
- * under the License.
84
- */
85
- /**
86
53
  * @deprecated Use `ThunderIDRuntimeError` for runtime errors and `ThunderIDAPIError` for API errors.
87
54
  */
88
55
  var ThunderIDAuthException = class extends Error {
@@ -170,23 +137,6 @@ var IsomorphicCrypto = class {
170
137
  //#endregion
171
138
  //#region src/errors/ThunderIDError.ts
172
139
  /**
173
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
174
- *
175
- * WSO2 LLC. licenses this file to you under the Apache License,
176
- * Version 2.0 (the "License"); you may not use this file except
177
- * in compliance with the License.
178
- * You may obtain a copy of the License at
179
- *
180
- * http://www.apache.org/licenses/LICENSE-2.0
181
- *
182
- * Unless required by applicable law or agreed to in writing,
183
- * software distributed under the License is distributed on an
184
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
185
- * KIND, either express or implied. See the License for the
186
- * specific language governing permissions and limitations
187
- * under the License.
188
- */
189
- /**
190
140
  * Base class for all ThunderID errors. This class extends the native Error class
191
141
  * and adds support for error codes and proper stack traces. Each error is prefixed
192
142
  * with a lightning emoji and the SDK name for easy identification.
@@ -235,23 +185,6 @@ var ThunderIDError = class ThunderIDError extends Error {
235
185
  //#endregion
236
186
  //#region src/utils/parseApiErrorMessage.ts
237
187
  /**
238
- * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
239
- *
240
- * WSO2 LLC. licenses this file to you under the Apache License,
241
- * Version 2.0 (the "License"); you may not use this file except
242
- * in compliance with the License.
243
- * You may obtain a copy of the License at
244
- *
245
- * http://www.apache.org/licenses/LICENSE-2.0
246
- *
247
- * Unless required by applicable law or agreed to in writing,
248
- * software distributed under the License is distributed on an
249
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
250
- * KIND, either express or implied. See the License for the
251
- * specific language governing permissions and limitations
252
- * under the License.
253
- */
254
- /**
255
188
  * Attempts to extract a human-readable message from a structured API error response body.
256
189
  *
257
190
  * The backend returns errors in the following form:
@@ -414,23 +347,6 @@ let EmbeddedSignInFlowType = /* @__PURE__ */ function(EmbeddedSignInFlowType$1)
414
347
  //#endregion
415
348
  //#region src/utils/injectRequestedPermissions.ts
416
349
  /**
417
- * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
418
- *
419
- * WSO2 LLC. licenses this file to you under the Apache License,
420
- * Version 2.0 (the "License"); you may not use this file except
421
- * in compliance with the License.
422
- * You may obtain a copy of the License at
423
- *
424
- * http://www.apache.org/licenses/LICENSE-2.0
425
- *
426
- * Unless required by applicable law or agreed to in writing,
427
- * software distributed under the License is distributed on an
428
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
429
- * KIND, either express or implied. See the License for the
430
- * specific language governing permissions and limitations
431
- * under the License.
432
- */
433
- /**
434
350
  * Strips the top-level `scopes` field from a payload and injects it as
435
351
  * `inputs.requested_permissions` (space-separated string).
436
352
  *
@@ -452,175 +368,512 @@ const injectRequestedPermissions = (payload) => {
452
368
  var injectRequestedPermissions_default = injectRequestedPermissions;
453
369
 
454
370
  //#endregion
455
- //#region src/api/executeEmbeddedSignInFlow.ts
456
- const executeEmbeddedSignInFlow = async ({ url, baseUrl, payload, authId, flowSecret,...requestConfig }) => {
457
- if (!payload) throw new ThunderIDAPIError("Authorization payload is required", "executeEmbeddedSignInFlow-ValidationError-002", "javascript", 400, "If an authorization payload is not provided, the request cannot be constructed correctly.");
458
- const endpoint = url ?? `${baseUrl}/flow/execute`;
459
- const cleanPayload = typeof payload === "object" && payload !== null ? Object.fromEntries(Object.entries(payload).filter(([key]) => key !== "verbose")) : payload;
460
- const isNewFlowStart = typeof cleanPayload === "object" && cleanPayload !== null && "applicationId" in cleanPayload && "flowType" in cleanPayload;
461
- const hasOnlyFlowId = typeof cleanPayload === "object" && cleanPayload !== null && "executionId" in cleanPayload && Object.keys(cleanPayload).length === 1;
462
- const basePayload = isNewFlowStart ? injectRequestedPermissions_default(cleanPayload) : cleanPayload;
463
- const requestPayload = isNewFlowStart || hasOnlyFlowId ? {
464
- ...basePayload,
465
- verbose: true
466
- } : basePayload;
467
- const response = await fetch(endpoint, {
468
- ...requestConfig,
469
- body: JSON.stringify(requestPayload),
470
- headers: {
471
- Accept: "application/json",
472
- "Content-Type": "application/json",
473
- ...isNewFlowStart && flowSecret ? { "Flow-Secret": flowSecret } : {},
474
- ...requestConfig.headers
475
- },
476
- method: requestConfig.method || "POST"
477
- });
478
- if (!response.ok) throw new ThunderIDAPIError(await response.text(), "executeEmbeddedSignInFlow-ResponseError-001", "javascript", response.status, response.statusText, "Authorization request failed");
479
- const flowResponse = await response.json();
480
- if (flowResponse.flowStatus === EmbeddedSignInFlowStatus.Complete && flowResponse.assertion && authId) try {
481
- const oauth2Response = await fetch(`${baseUrl}/oauth2/auth/callback`, {
482
- body: JSON.stringify({
483
- assertion: flowResponse.assertion,
484
- authId
485
- }),
486
- credentials: "include",
487
- headers: {
488
- Accept: "application/json",
489
- "Content-Type": "application/json",
490
- ...requestConfig.headers
491
- },
492
- method: "POST"
493
- });
494
- if (!oauth2Response.ok) throw new ThunderIDAPIError(await oauth2Response.text(), "executeEmbeddedSignInFlow-OAuth2Error-002", "javascript", oauth2Response.status, oauth2Response.statusText, "OAuth2 authorization failed");
495
- const oauth2Result = await oauth2Response.json();
496
- return {
497
- flowStatus: flowResponse.flowStatus,
498
- redirectUrl: oauth2Result["redirect_uri"]
499
- };
500
- } catch (authError) {
501
- if (authError instanceof ThunderIDAPIError) throw authError;
502
- throw new ThunderIDAPIError(authError instanceof Error ? authError.message : "Unknown error", "executeEmbeddedSignInFlow-OAuth2Error-001", "javascript", 500, "Failed to complete OAuth2 authorization after successful embedded sign-in flow.", "OAuth2 authorization failed");
503
- }
504
- return flowResponse;
371
+ //#region src/utils/logger.ts
372
+ const PREFIX = "⚡ ThunderID";
373
+ /**
374
+ * Default logger configuration
375
+ */
376
+ const DEFAULT_CONFIG$1 = {
377
+ level: "info",
378
+ prefix: `${PREFIX}`,
379
+ showLevel: true,
380
+ timestamps: true
505
381
  };
506
- var executeEmbeddedSignInFlow_default = executeEmbeddedSignInFlow;
507
-
508
- //#endregion
509
- //#region src/models/embedded-signup-flow.ts
510
382
  /**
511
- * Status enumeration for ThunderID embedded sign-up flow operations.
512
- *
513
- * These statuses indicate the current state of the registration flow and determine
514
- * the next action required by the client application. Each status provides specific
515
- * guidance on how to proceed with the user registration process.
516
- *
517
- * @example
518
- * ```typescript
519
- * switch (response.flowStatus) {
520
- * case EmbeddedSignUpFlowStatus.Incomplete:
521
- * // More user input needed - render registration form components
522
- * break;
523
- * case EmbeddedSignUpFlowStatus.Complete:
524
- * // Registration successful - handle completion
525
- * break;
526
- * case EmbeddedSignUpFlowStatus.Error:
527
- * // Registration failed - show error details
528
- * const errorResponse = response as EmbeddedSignUpFlowErrorResponse;
529
- * showError(errorResponse.error.description.defaultValue);
530
- * break;
531
- * }
532
- * ```
533
- *
534
- * @experimental Part of the new ThunderID API
383
+ * Environment detection utilities
535
384
  */
536
- let EmbeddedSignUpFlowStatus = /* @__PURE__ */ function(EmbeddedSignUpFlowStatus$1) {
385
+ const isBrowser = () => typeof window !== "undefined" && typeof window.document !== "undefined";
386
+ const isNode = () => typeof process !== "undefined" && process.versions && process.versions.node;
387
+ /**
388
+ * Color codes for terminal output (Node.js)
389
+ */
390
+ const COLORS = {
391
+ blue: "\x1B[34m",
392
+ bright: "\x1B[1m",
393
+ cyan: "\x1B[36m",
394
+ dim: "\x1B[2m",
395
+ gray: "\x1B[90m",
396
+ green: "\x1B[32m",
397
+ magenta: "\x1B[35m",
398
+ red: "\x1B[31m",
399
+ reset: "\x1B[0m",
400
+ white: "\x1B[37m",
401
+ yellow: "\x1B[33m"
402
+ };
403
+ /**
404
+ * Browser console styling
405
+ */
406
+ const BROWSER_STYLES = {
407
+ debug: "color: #6b7280; font-weight: normal;",
408
+ error: "color: #dc2626; font-weight: bold;",
409
+ info: "color: #2563eb; font-weight: bold;",
410
+ prefix: "color: #7c3aed; font-weight: bold;",
411
+ timestamp: "color: #6b7280; font-size: 0.9em;",
412
+ warn: "color: #d97706; font-weight: bold;"
413
+ };
414
+ const LOG_LEVEL_ORDER = {
415
+ debug: 0,
416
+ error: 3,
417
+ info: 1,
418
+ warn: 2
419
+ };
420
+ /**
421
+ * Universal logger class that works in both browser and Node.js environments
422
+ */
423
+ var Logger = class Logger {
424
+ config;
425
+ constructor(config = {}) {
426
+ this.config = {
427
+ ...DEFAULT_CONFIG$1,
428
+ ...config
429
+ };
430
+ }
537
431
  /**
538
- * Sign-up flow completed successfully.
539
- *
540
- * The user has successfully registered and the flow can proceed to
541
- * OAuth2 completion or redirection. Check for redirectUrl or assertion
542
- * data in the response for next steps.
432
+ * Update logger configuration
543
433
  */
544
- EmbeddedSignUpFlowStatus$1["Complete"] = "COMPLETE";
434
+ configure(config) {
435
+ this.config = {
436
+ ...this.config,
437
+ ...config
438
+ };
439
+ }
545
440
  /**
546
- * Sign-up flow encountered an error and cannot proceed.
547
- *
548
- * Registration failed due to validation errors, duplicate user,
549
- * system errors, or other issues. The response will be of type
550
- * `EmbeddedSignUpFlowErrorResponse` containing detailed failure
551
- * information that can be displayed to the user.
552
- *
553
- * @see {@link EmbeddedSignUpFlowErrorResponse} for error response structure
441
+ * Get current configuration
554
442
  */
555
- EmbeddedSignUpFlowStatus$1["Error"] = "ERROR";
443
+ getConfig() {
444
+ return { ...this.config };
445
+ }
556
446
  /**
557
- * Sign-up flow requires additional user input.
558
- *
559
- * More registration steps are needed. The response will contain
560
- * components in data.meta.components that should be rendered to
561
- * collect additional user information (e.g., profile data, verification).
447
+ * Check if a log level should be output
562
448
  */
563
- EmbeddedSignUpFlowStatus$1["Incomplete"] = "INCOMPLETE";
564
- return EmbeddedSignUpFlowStatus$1;
565
- }({});
566
- /**
567
- * Type enumeration for ThunderID embedded sign-up flow responses.
568
- *
569
- * Determines the nature of the registration flow response and how the client
570
- * should handle the returned data. This affects both UI rendering and flow
571
- * continuation logic during the user registration process.
572
- *
573
- * @experimental Part of the new ThunderID API
574
- */
575
- let EmbeddedSignUpFlowType = /* @__PURE__ */ function(EmbeddedSignUpFlowType$1) {
449
+ shouldLog(level) {
450
+ return LOG_LEVEL_ORDER[level] >= LOG_LEVEL_ORDER[this.config.level];
451
+ }
576
452
  /**
577
- * Response requires external redirection.
578
- *
579
- * Used for social registration providers, external identity providers,
580
- * or other flows that require navigating to an external URL during
581
- * the registration process. The response will contain redirection information.
453
+ * Get timestamp string
582
454
  */
583
- EmbeddedSignUpFlowType$1["Redirection"] = "REDIRECTION";
455
+ static getTimestamp() {
456
+ return (/* @__PURE__ */ new Date()).toISOString();
457
+ }
584
458
  /**
585
- * Response contains view components for rendering.
586
- *
587
- * Standard embedded registration flow response containing UI components
588
- * that should be rendered within the current application context.
589
- * Most common type for embedded user registration.
459
+ * Get log level string
590
460
  */
591
- EmbeddedSignUpFlowType$1["View"] = "VIEW";
592
- return EmbeddedSignUpFlowType$1;
593
- }({});
594
-
595
- //#endregion
596
- //#region src/api/executeEmbeddedSignUpFlow.ts
597
- const executeEmbeddedSignUpFlow = async ({ url, baseUrl, payload, authId,...requestConfig }) => {
598
- if (!payload) throw new ThunderIDAPIError("Registration payload is required", "executeEmbeddedSignUpFlow-ValidationError-002", "javascript", 400, "If a registration payload is not provided, the request cannot be constructed correctly.");
599
- const endpoint = url ?? `${baseUrl}/flow/execute`;
600
- const cleanPayload = typeof payload === "object" && payload !== null ? Object.fromEntries(Object.entries(payload).filter(([key]) => key !== "verbose")) : payload;
601
- const isNewFlowStart = typeof cleanPayload === "object" && cleanPayload !== null && "applicationId" in cleanPayload && "flowType" in cleanPayload;
602
- const hasOnlyFlowId = typeof cleanPayload === "object" && cleanPayload !== null && "executionId" in cleanPayload && Object.keys(cleanPayload).length === 1;
603
- const basePayload = isNewFlowStart ? injectRequestedPermissions_default(cleanPayload) : cleanPayload;
604
- const requestPayload = isNewFlowStart || hasOnlyFlowId ? {
605
- ...basePayload,
606
- verbose: true
607
- } : basePayload;
608
- const response = await fetch(endpoint, {
609
- ...requestConfig,
610
- body: JSON.stringify(requestPayload),
611
- headers: {
612
- Accept: "application/json",
613
- "Content-Type": "application/json",
614
- ...requestConfig.headers
615
- },
616
- method: requestConfig.method || "POST"
617
- });
618
- if (!response.ok) throw new ThunderIDAPIError(await response.text(), "executeEmbeddedSignUpFlow-ResponseError-001", "javascript", response.status, response.statusText, "Registration request failed");
619
- const flowResponse = await response.json();
620
- if (flowResponse.flowStatus === EmbeddedSignUpFlowStatus.Complete && flowResponse.assertion && authId) try {
621
- const oauth2Response = await fetch(`${baseUrl}/oauth2/auth/callback`, {
622
- body: JSON.stringify({
623
- assertion: flowResponse.assertion,
461
+ static getLevelString(level) {
462
+ switch (level) {
463
+ case "debug": return "DEBUG";
464
+ case "info": return "INFO";
465
+ case "warn": return "WARN";
466
+ case "error": return "ERROR";
467
+ default: return "UNKNOWN";
468
+ }
469
+ }
470
+ /**
471
+ * Format message for Node.js terminal
472
+ */
473
+ formatForNode(level, message) {
474
+ const parts = [];
475
+ if (this.config.timestamps) parts.push(`${COLORS.gray}[${Logger.getTimestamp()}]${COLORS.reset}`);
476
+ if (this.config.prefix) parts.push(`${COLORS.magenta}${this.config.prefix}${COLORS.reset}`);
477
+ if (this.config.showLevel) {
478
+ const levelStr = Logger.getLevelString(level);
479
+ let coloredLevel;
480
+ switch (level) {
481
+ case "debug":
482
+ coloredLevel = `${COLORS.gray}[${levelStr}]${COLORS.reset}`;
483
+ break;
484
+ case "info":
485
+ coloredLevel = `${COLORS.blue}[${levelStr}]${COLORS.reset}`;
486
+ break;
487
+ case "warn":
488
+ coloredLevel = `${COLORS.yellow}[${levelStr}]${COLORS.reset}`;
489
+ break;
490
+ case "error":
491
+ coloredLevel = `${COLORS.red}[${levelStr}]${COLORS.reset}`;
492
+ break;
493
+ default: coloredLevel = `[${levelStr}]`;
494
+ }
495
+ parts.push(coloredLevel);
496
+ }
497
+ parts.push(message);
498
+ return parts.join(" ");
499
+ }
500
+ /**
501
+ * Log message using appropriate method
502
+ */
503
+ logMessage(level, message, ...args) {
504
+ if (!this.shouldLog(level)) return;
505
+ if (this.config.formatter) {
506
+ this.config.formatter(level, message, ...args);
507
+ return;
508
+ }
509
+ if (isBrowser()) this.logToBrowser(level, message, ...args);
510
+ else if (isNode()) this.logToNode(level, message, ...args);
511
+ else console.log(message, ...args);
512
+ }
513
+ /**
514
+ * Log to browser console with styling
515
+ */
516
+ logToBrowser(level, message, ...args) {
517
+ const parts = [];
518
+ const styles = [];
519
+ if (this.config.timestamps) {
520
+ parts.push(`%c[${Logger.getTimestamp()}]`);
521
+ styles.push(BROWSER_STYLES.timestamp);
522
+ }
523
+ if (this.config.prefix) {
524
+ parts.push(`%c${this.config.prefix}`);
525
+ styles.push(BROWSER_STYLES.prefix);
526
+ }
527
+ if (this.config.showLevel) {
528
+ const levelStr = Logger.getLevelString(level);
529
+ parts.push(`%c[${levelStr}]`);
530
+ switch (level) {
531
+ case "debug":
532
+ styles.push(BROWSER_STYLES.debug);
533
+ break;
534
+ case "info":
535
+ styles.push(BROWSER_STYLES.info);
536
+ break;
537
+ case "warn":
538
+ styles.push(BROWSER_STYLES.warn);
539
+ break;
540
+ case "error":
541
+ styles.push(BROWSER_STYLES.error);
542
+ break;
543
+ default: styles.push("");
544
+ }
545
+ }
546
+ parts.push(`%c${message}`);
547
+ styles.push("color: inherit; font-weight: normal;");
548
+ const formattedMessage = parts.join(" ");
549
+ switch (level) {
550
+ case "debug":
551
+ console.debug(formattedMessage, ...styles, ...args);
552
+ break;
553
+ case "info":
554
+ console.info(formattedMessage, ...styles, ...args);
555
+ break;
556
+ case "warn":
557
+ console.warn(formattedMessage, ...styles, ...args);
558
+ break;
559
+ case "error":
560
+ console.error(formattedMessage, ...styles, ...args);
561
+ break;
562
+ default: console.log(formattedMessage, ...styles, ...args);
563
+ }
564
+ }
565
+ /**
566
+ * Log to Node.js console
567
+ */
568
+ logToNode(level, message, ...args) {
569
+ const formattedMessage = this.formatForNode(level, message);
570
+ switch (level) {
571
+ case "debug":
572
+ console.debug(formattedMessage, ...args);
573
+ break;
574
+ case "info":
575
+ console.info(formattedMessage, ...args);
576
+ break;
577
+ case "warn":
578
+ console.warn(formattedMessage, ...args);
579
+ break;
580
+ case "error":
581
+ console.error(formattedMessage, ...args);
582
+ break;
583
+ default: console.log(formattedMessage, ...args);
584
+ }
585
+ }
586
+ /**
587
+ * Log debug message
588
+ */
589
+ debug(message, ...args) {
590
+ this.logMessage("debug", message, ...args);
591
+ }
592
+ /**
593
+ * Log info message
594
+ */
595
+ info(message, ...args) {
596
+ this.logMessage("info", message, ...args);
597
+ }
598
+ /**
599
+ * Log warning message
600
+ */
601
+ warn(message, ...args) {
602
+ this.logMessage("warn", message, ...args);
603
+ }
604
+ /**
605
+ * Log error message
606
+ */
607
+ error(message, ...args) {
608
+ this.logMessage("error", message, ...args);
609
+ }
610
+ /**
611
+ * Create a child logger with additional prefix
612
+ */
613
+ child(prefix) {
614
+ const childPrefix = this.config.prefix ? `${this.config.prefix} - ${prefix}` : prefix;
615
+ return new Logger({
616
+ ...this.config,
617
+ prefix: childPrefix
618
+ });
619
+ }
620
+ /**
621
+ * Set log level
622
+ */
623
+ setLevel(level) {
624
+ this.config.level = level;
625
+ }
626
+ /**
627
+ * Get current log level
628
+ */
629
+ getLevel() {
630
+ return this.config.level;
631
+ }
632
+ };
633
+ /**
634
+ * Default logger instance
635
+ */
636
+ const logger = new Logger();
637
+ /**
638
+ * Create a new logger instance with custom configuration
639
+ */
640
+ const createLogger = (config) => new Logger(config);
641
+ /**
642
+ * Default export - global logger instance
643
+ */
644
+ var logger_default = logger;
645
+ /**
646
+ * Named exports for convenience
647
+ */
648
+ const debug = (message, ...args) => logger.debug(message, ...args);
649
+ const info = (message, ...args) => logger.info(message, ...args);
650
+ const warn = (message, ...args) => logger.warn(message, ...args);
651
+ const error = (message, ...args) => logger.error(message, ...args);
652
+ /**
653
+ * Configure the default logger
654
+ */
655
+ const configure = (config) => logger.configure(config);
656
+ /**
657
+ * Create component-specific loggers
658
+ */
659
+ const createComponentLogger = (component) => logger.child(component);
660
+ /**
661
+ * Create package-specific logger
662
+ */
663
+ const createPackageLogger = (packageName) => createLogger({
664
+ level: "info",
665
+ prefix: `${PREFIX} - ${packageName}`,
666
+ showLevel: true,
667
+ timestamps: true
668
+ });
669
+ /**
670
+ * Create package component logger (package + component)
671
+ */
672
+ const createPackageComponentLogger = (packageName, component) => {
673
+ return createPackageLogger(packageName).child(component);
674
+ };
675
+
676
+ //#endregion
677
+ //#region src/api/executeEmbeddedSignInFlow.ts
678
+ const readErrorAssertion = (body) => {
679
+ try {
680
+ return JSON.parse(body).errorAssertion;
681
+ } catch {
682
+ return;
683
+ }
684
+ };
685
+ const postAuthCallback = async (baseUrl, body, headers) => {
686
+ const oauth2Response = await fetch(`${baseUrl}/oauth2/auth/callback`, {
687
+ body: JSON.stringify(body),
688
+ credentials: "include",
689
+ headers: {
690
+ Accept: "application/json",
691
+ "Content-Type": "application/json",
692
+ ...headers
693
+ },
694
+ method: "POST"
695
+ });
696
+ if (!oauth2Response.ok) {
697
+ const oauth2ErrorText = await oauth2Response.text();
698
+ logger_default.error(`OAuth2 authorization failed. The callback responded ${oauth2Response.status} ${oauth2Response.statusText}:`, oauth2ErrorText);
699
+ throw new ThunderIDAPIError("OAuth2 authorization failed", "executeEmbeddedSignInFlow-OAuth2Error-002", "javascript", oauth2Response.status, oauth2Response.statusText);
700
+ }
701
+ return oauth2Response.json();
702
+ };
703
+ const relayFailure = async (baseUrl, authId, errorAssertion, headers, flowResponse) => {
704
+ const oauth2Result = await postAuthCallback(baseUrl, {
705
+ assertion: errorAssertion,
706
+ authId
707
+ }, headers);
708
+ return {
709
+ ...flowResponse,
710
+ flowStatus: EmbeddedSignInFlowStatus.Error,
711
+ redirectUrl: oauth2Result["redirect_uri"]
712
+ };
713
+ };
714
+ const executeEmbeddedSignInFlow = async ({ url, baseUrl, payload, authId, flowSecret,...requestConfig }) => {
715
+ if (!payload) throw new ThunderIDAPIError("Authorization payload is required", "executeEmbeddedSignInFlow-ValidationError-002", "javascript", 400, "If an authorization payload is not provided, the request cannot be constructed correctly.");
716
+ const endpoint = url ?? `${baseUrl}/flow/execute`;
717
+ const cleanPayload = typeof payload === "object" && payload !== null ? Object.fromEntries(Object.entries(payload).filter(([key]) => key !== "verbose")) : payload;
718
+ const isNewFlowStart = typeof cleanPayload === "object" && cleanPayload !== null && "applicationId" in cleanPayload && "flowType" in cleanPayload;
719
+ const hasOnlyFlowId = typeof cleanPayload === "object" && cleanPayload !== null && "executionId" in cleanPayload && Object.keys(cleanPayload).length === 1;
720
+ const basePayload = isNewFlowStart ? injectRequestedPermissions_default(cleanPayload) : cleanPayload;
721
+ const requestPayload = isNewFlowStart || hasOnlyFlowId ? {
722
+ ...basePayload,
723
+ verbose: true
724
+ } : basePayload;
725
+ const response = await fetch(endpoint, {
726
+ ...requestConfig,
727
+ body: JSON.stringify(requestPayload),
728
+ headers: {
729
+ Accept: "application/json",
730
+ "Content-Type": "application/json",
731
+ ...isNewFlowStart && flowSecret ? { "Flow-Secret": flowSecret } : {},
732
+ ...requestConfig.headers
733
+ },
734
+ method: requestConfig.method || "POST"
735
+ });
736
+ if (!response.ok) {
737
+ const errorText = await response.text();
738
+ const errorAssertion = readErrorAssertion(errorText);
739
+ if (authId && errorAssertion) return await relayFailure(baseUrl, authId, errorAssertion, requestConfig.headers);
740
+ throw new ThunderIDAPIError(errorText, "executeEmbeddedSignInFlow-ResponseError-001", "javascript", response.status, response.statusText, "Authorization request failed");
741
+ }
742
+ const flowResponse = await response.json();
743
+ if (flowResponse.flowStatus === EmbeddedSignInFlowStatus.Complete && flowResponse.assertion && authId) try {
744
+ const oauth2Result = await postAuthCallback(baseUrl, {
745
+ assertion: flowResponse.assertion,
746
+ authId
747
+ }, requestConfig.headers);
748
+ return {
749
+ flowStatus: flowResponse.flowStatus,
750
+ redirectUrl: oauth2Result["redirect_uri"]
751
+ };
752
+ } catch (authError) {
753
+ if (authError instanceof ThunderIDAPIError) throw authError;
754
+ throw new ThunderIDAPIError(authError instanceof Error ? authError.message : "Unknown error", "executeEmbeddedSignInFlow-OAuth2Error-001", "javascript", 500, "Failed to complete OAuth2 authorization after successful embedded sign-in flow.", "OAuth2 authorization failed");
755
+ }
756
+ if (flowResponse.flowStatus === EmbeddedSignInFlowStatus.Error && flowResponse.errorAssertion && authId) return relayFailure(baseUrl, authId, flowResponse.errorAssertion, requestConfig.headers, flowResponse);
757
+ return flowResponse;
758
+ };
759
+ var executeEmbeddedSignInFlow_default = executeEmbeddedSignInFlow;
760
+
761
+ //#endregion
762
+ //#region src/models/embedded-signup-flow.ts
763
+ /**
764
+ * Status enumeration for ThunderID embedded sign-up flow operations.
765
+ *
766
+ * These statuses indicate the current state of the registration flow and determine
767
+ * the next action required by the client application. Each status provides specific
768
+ * guidance on how to proceed with the user registration process.
769
+ *
770
+ * @example
771
+ * ```typescript
772
+ * switch (response.flowStatus) {
773
+ * case EmbeddedSignUpFlowStatus.Incomplete:
774
+ * // More user input needed - render registration form components
775
+ * break;
776
+ * case EmbeddedSignUpFlowStatus.Complete:
777
+ * // Registration successful - handle completion
778
+ * break;
779
+ * case EmbeddedSignUpFlowStatus.Error:
780
+ * // Registration failed - show error details
781
+ * const errorResponse = response as EmbeddedSignUpFlowErrorResponse;
782
+ * showError(errorResponse.error.description.defaultValue);
783
+ * break;
784
+ * }
785
+ * ```
786
+ *
787
+ * @experimental Part of the new ThunderID API
788
+ */
789
+ let EmbeddedSignUpFlowStatus = /* @__PURE__ */ function(EmbeddedSignUpFlowStatus$1) {
790
+ /**
791
+ * Sign-up flow completed successfully.
792
+ *
793
+ * The user has successfully registered and the flow can proceed to
794
+ * OAuth2 completion or redirection. Check for redirectUrl or assertion
795
+ * data in the response for next steps.
796
+ */
797
+ EmbeddedSignUpFlowStatus$1["Complete"] = "COMPLETE";
798
+ /**
799
+ * Sign-up flow encountered an error and cannot proceed.
800
+ *
801
+ * Registration failed due to validation errors, duplicate user,
802
+ * system errors, or other issues. The response will be of type
803
+ * `EmbeddedSignUpFlowErrorResponse` containing detailed failure
804
+ * information that can be displayed to the user.
805
+ *
806
+ * @see {@link EmbeddedSignUpFlowErrorResponse} for error response structure
807
+ */
808
+ EmbeddedSignUpFlowStatus$1["Error"] = "ERROR";
809
+ /**
810
+ * Sign-up flow requires additional user input.
811
+ *
812
+ * More registration steps are needed. The response will contain
813
+ * components in data.meta.components that should be rendered to
814
+ * collect additional user information (e.g., profile data, verification).
815
+ */
816
+ EmbeddedSignUpFlowStatus$1["Incomplete"] = "INCOMPLETE";
817
+ return EmbeddedSignUpFlowStatus$1;
818
+ }({});
819
+ /**
820
+ * Type enumeration for ThunderID embedded sign-up flow responses.
821
+ *
822
+ * Determines the nature of the registration flow response and how the client
823
+ * should handle the returned data. This affects both UI rendering and flow
824
+ * continuation logic during the user registration process.
825
+ *
826
+ * @experimental Part of the new ThunderID API
827
+ */
828
+ let EmbeddedSignUpFlowType = /* @__PURE__ */ function(EmbeddedSignUpFlowType$1) {
829
+ /**
830
+ * Response requires external redirection.
831
+ *
832
+ * Used for social registration providers, external identity providers,
833
+ * or other flows that require navigating to an external URL during
834
+ * the registration process. The response will contain redirection information.
835
+ */
836
+ EmbeddedSignUpFlowType$1["Redirection"] = "REDIRECTION";
837
+ /**
838
+ * Response contains view components for rendering.
839
+ *
840
+ * Standard embedded registration flow response containing UI components
841
+ * that should be rendered within the current application context.
842
+ * Most common type for embedded user registration.
843
+ */
844
+ EmbeddedSignUpFlowType$1["View"] = "VIEW";
845
+ return EmbeddedSignUpFlowType$1;
846
+ }({});
847
+
848
+ //#endregion
849
+ //#region src/api/executeEmbeddedSignUpFlow.ts
850
+ const executeEmbeddedSignUpFlow = async ({ url, baseUrl, payload, authId,...requestConfig }) => {
851
+ if (!payload) throw new ThunderIDAPIError("Registration payload is required", "executeEmbeddedSignUpFlow-ValidationError-002", "javascript", 400, "If a registration payload is not provided, the request cannot be constructed correctly.");
852
+ const endpoint = url ?? `${baseUrl}/flow/execute`;
853
+ const cleanPayload = typeof payload === "object" && payload !== null ? Object.fromEntries(Object.entries(payload).filter(([key]) => key !== "verbose")) : payload;
854
+ const isNewFlowStart = typeof cleanPayload === "object" && cleanPayload !== null && "applicationId" in cleanPayload && "flowType" in cleanPayload;
855
+ const hasOnlyFlowId = typeof cleanPayload === "object" && cleanPayload !== null && "executionId" in cleanPayload && Object.keys(cleanPayload).length === 1;
856
+ const basePayload = isNewFlowStart ? injectRequestedPermissions_default(cleanPayload) : cleanPayload;
857
+ const requestPayload = isNewFlowStart || hasOnlyFlowId ? {
858
+ ...basePayload,
859
+ verbose: true
860
+ } : basePayload;
861
+ const response = await fetch(endpoint, {
862
+ ...requestConfig,
863
+ body: JSON.stringify(requestPayload),
864
+ headers: {
865
+ Accept: "application/json",
866
+ "Content-Type": "application/json",
867
+ ...requestConfig.headers
868
+ },
869
+ method: requestConfig.method || "POST"
870
+ });
871
+ if (!response.ok) throw new ThunderIDAPIError(await response.text(), "executeEmbeddedSignUpFlow-ResponseError-001", "javascript", response.status, response.statusText, "Registration request failed");
872
+ const flowResponse = await response.json();
873
+ if (flowResponse.flowStatus === EmbeddedSignUpFlowStatus.Complete && flowResponse.assertion && authId) try {
874
+ const oauth2Response = await fetch(`${baseUrl}/oauth2/auth/callback`, {
875
+ body: JSON.stringify({
876
+ assertion: flowResponse.assertion,
624
877
  authId
625
878
  }),
626
879
  credentials: "include",
@@ -709,23 +962,6 @@ var executeEmbeddedRecoveryFlow_default = executeEmbeddedRecoveryFlow;
709
962
 
710
963
  //#endregion
711
964
  //#region src/models/embedded-flow.ts
712
- /**
713
- * Copyright (c) 2025-2026, WSO2 LLC. (https://www.wso2.com).
714
- *
715
- * WSO2 LLC. licenses this file to you under the Apache License,
716
- * Version 2.0 (the "License"); you may not use this file except
717
- * in compliance with the License.
718
- * You may obtain a copy of the License at
719
- *
720
- * http://www.apache.org/licenses/LICENSE-2.0
721
- *
722
- * Unless required by applicable law or agreed to in writing,
723
- * software distributed under the License is distributed on an
724
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
725
- * KIND, either express or implied. See the License for the
726
- * specific language governing permissions and limitations
727
- * under the License.
728
- */
729
965
  let EmbeddedFlowType = /* @__PURE__ */ function(EmbeddedFlowType$1) {
730
966
  EmbeddedFlowType$1["Authentication"] = "AUTHENTICATION";
731
967
  EmbeddedFlowType$1["Recovery"] = "RECOVERY";
@@ -1090,23 +1326,6 @@ var getUserInfo_default = getUserInfo;
1090
1326
  //#endregion
1091
1327
  //#region src/utils/processUsername.ts
1092
1328
  /**
1093
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
1094
- *
1095
- * WSO2 LLC. licenses this file to you under the Apache License,
1096
- * Version 2.0 (the "License"); you may not use this file except
1097
- * in compliance with the License.
1098
- * You may obtain a copy of the License at
1099
- *
1100
- * http://www.apache.org/licenses/LICENSE-2.0
1101
- *
1102
- * Unless required by applicable law or agreed to in writing,
1103
- * software distributed under the License is distributed on an
1104
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1105
- * KIND, either express or implied. See the License for the
1106
- * specific language governing permissions and limitations
1107
- * under the License.
1108
- */
1109
- /**
1110
1329
  * Regular expression to match userstore prefixes in usernames.
1111
1330
  * Matches patterns like "DEFAULT/", "ASGARDEO_USER/", "PRIMARY/", etc.
1112
1331
  * The pattern matches any uppercase letters, numbers, and underscores followed by a forward slash.
@@ -1341,23 +1560,6 @@ var updateMeProfile_default = updateMeProfile;
1341
1560
  //#endregion
1342
1561
  //#region src/constants/ApplicationNativeAuthenticationConstants.ts
1343
1562
  /**
1344
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
1345
- *
1346
- * WSO2 LLC. licenses this file to you under the Apache License,
1347
- * Version 2.0 (the "License"); you may not use this file except
1348
- * in compliance with the License.
1349
- * You may obtain a copy of the License at
1350
- *
1351
- * http://www.apache.org/licenses/LICENSE-2.0
1352
- *
1353
- * Unless required by applicable law or agreed to in writing,
1354
- * software distributed under the License is distributed on an
1355
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1356
- * KIND, either express or implied. See the License for the
1357
- * specific language governing permissions and limitations
1358
- * under the License.
1359
- */
1360
- /**
1361
1563
  * Constants representing Application Native Authentication related configurations and constants.
1362
1564
  */
1363
1565
  const ApplicationNativeAuthenticationConstants = { SupportedAuthenticators: {
@@ -1381,23 +1583,6 @@ var ApplicationNativeAuthenticationConstants_default = ApplicationNativeAuthenti
1381
1583
  //#endregion
1382
1584
  //#region src/constants/ScopeConstants.ts
1383
1585
  /**
1384
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
1385
- *
1386
- * WSO2 LLC. licenses this file to you under the Apache License,
1387
- * Version 2.0 (the "License"); you may not use this file except
1388
- * in compliance with the License.
1389
- * You may obtain a copy of the License at
1390
- *
1391
- * http://www.apache.org/licenses/LICENSE-2.0
1392
- *
1393
- * Unless required by applicable law or agreed to in writing,
1394
- * software distributed under the License is distributed on an
1395
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1396
- * KIND, either express or implied. See the License for the
1397
- * specific language governing permissions and limitations
1398
- * under the License.
1399
- */
1400
- /**
1401
1586
  * Constants for OAuth 2.0 and OpenID Connect scopes.
1402
1587
  * These scopes define the level of access that the client application
1403
1588
  * is requesting from the authorization server.
@@ -1443,23 +1628,6 @@ var OIDCRequestConstants_default = OIDCRequestConstants;
1443
1628
  //#endregion
1444
1629
  //#region src/constants/VendorConstants.ts
1445
1630
  /**
1446
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
1447
- *
1448
- * WSO2 LLC. licenses this file to you under the Apache License,
1449
- * Version 2.0 (the "License"); you may not use this file except
1450
- * in compliance with the License.
1451
- * You may obtain a copy of the License at
1452
- *
1453
- * http://www.apache.org/licenses/LICENSE-2.0
1454
- *
1455
- * Unless required by applicable law or agreed to in writing,
1456
- * software distributed under the License is distributed on an
1457
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1458
- * KIND, either express or implied. See the License for the
1459
- * specific language governing permissions and limitations
1460
- * under the License.
1461
- */
1462
- /**
1463
1631
  * Constants for vendor-specific configurations.
1464
1632
  * By default, the vendor is inferred as ThunderID.
1465
1633
  *
@@ -1561,23 +1729,6 @@ let EmbeddedRecoveryFlowType = /* @__PURE__ */ function(EmbeddedRecoveryFlowType
1561
1729
  //#endregion
1562
1730
  //#region src/models/flow-meta.ts
1563
1731
  /**
1564
- * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
1565
- *
1566
- * WSO2 LLC. licenses this file to you under the Apache License,
1567
- * Version 2.0 (the "License"); you may not use this file except
1568
- * in compliance with the License.
1569
- * You may obtain a copy of the License at
1570
- *
1571
- * http://www.apache.org/licenses/LICENSE-2.0
1572
- *
1573
- * Unless required by applicable law or agreed to in writing,
1574
- * software distributed under the License is distributed on an
1575
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1576
- * KIND, either express or implied. See the License for the
1577
- * specific language governing permissions and limitations
1578
- * under the License.
1579
- */
1580
- /**
1581
1732
  * The type of entity to retrieve flow metadata for.
1582
1733
  *
1583
1734
  * @example
@@ -1601,33 +1752,15 @@ let FlowMetaType = /* @__PURE__ */ function(FlowMetaType$1) {
1601
1752
 
1602
1753
  //#endregion
1603
1754
  //#region src/models/flow.ts
1604
- /**
1605
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
1606
- *
1607
- * WSO2 LLC. licenses this file to you under the Apache License,
1608
- * Version 2.0 (the "License"); you may not use this file except
1609
- * in compliance with the License.
1610
- * You may obtain a copy of the License at
1611
- *
1612
- * http://www.apache.org/licenses/LICENSE-2.0
1613
- *
1614
- * Unless required by applicable law or agreed to in writing,
1615
- * software distributed under the License is distributed on an
1616
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1617
- * KIND, either express or implied. See the License for the
1618
- * specific language governing permissions and limitations
1619
- * under the License.
1620
- */
1621
1755
  let FlowMode = /* @__PURE__ */ function(FlowMode$1) {
1622
1756
  /**
1623
1757
  * This mode is suitable for embedded sign-in, sign-up, etc. flows where the authentication
1624
1758
  * UIs are rendered within the application.
1625
- * @see {@link https://is.docs.wso2.com/en/7.1.0/references/app-native-authentication/}
1626
1759
  */
1627
1760
  FlowMode$1["Embedded"] = "DIRECT";
1628
1761
  /**
1629
1762
  * Traditional redirect based sign-in, sign-up, etc. flows where the authentication
1630
- * UIs are from a external Identity Provider (ex: WSO2 Identity Server or ThunderID).
1763
+ * UIs are from a external Identity Provider (ex: ThunderID).
1631
1764
  */
1632
1765
  FlowMode$1["Redirect"] = "REDIRECTION";
1633
1766
  return FlowMode$1;
@@ -1635,23 +1768,6 @@ let FlowMode = /* @__PURE__ */ function(FlowMode$1) {
1635
1768
 
1636
1769
  //#endregion
1637
1770
  //#region src/models/field.ts
1638
- /**
1639
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
1640
- *
1641
- * WSO2 LLC. licenses this file to you under the Apache License,
1642
- * Version 2.0 (the "License"); you may not use this file except
1643
- * in compliance with the License.
1644
- * You may obtain a copy of the License at
1645
- *
1646
- * http://www.apache.org/licenses/LICENSE-2.0
1647
- *
1648
- * Unless required by applicable law or agreed to in writing,
1649
- * software distributed under the License is distributed on an
1650
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1651
- * KIND, either express or implied. See the License for the
1652
- * specific language governing permissions and limitations
1653
- * under the License.
1654
- */
1655
1771
  let FieldType = /* @__PURE__ */ function(FieldType$1) {
1656
1772
  FieldType$1["Checkbox"] = "CHECKBOX";
1657
1773
  FieldType$1["Date"] = "DATE";
@@ -1671,23 +1787,6 @@ let FieldType = /* @__PURE__ */ function(FieldType$1) {
1671
1787
  //#endregion
1672
1788
  //#region src/constants/OIDCDiscoveryConstants.ts
1673
1789
  /**
1674
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
1675
- *
1676
- * WSO2 LLC. licenses this file to you under the Apache License,
1677
- * Version 2.0 (the "License"); you may not use this file except
1678
- * in compliance with the License.
1679
- * You may obtain a copy of the License at
1680
- *
1681
- * http://www.apache.org/licenses/LICENSE-2.0
1682
- *
1683
- * Unless required by applicable law or agreed to in writing,
1684
- * software distributed under the License is distributed on an
1685
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1686
- * KIND, either express or implied. See the License for the
1687
- * specific language governing permissions and limitations
1688
- * under the License.
1689
- */
1690
- /**
1691
1790
  * Constants related to OpenID Connect (OIDC) metadata and endpoints.
1692
1791
  * This object contains all the standard OIDC endpoints and storage keys
1693
1792
  * used throughout the application for authentication and authorization.
@@ -1699,511 +1798,171 @@ let FieldType = /* @__PURE__ */ function(FieldType$1) {
1699
1798
  *
1700
1799
  * @example
1701
1800
  * ```typescript
1702
- * // Using an endpoint
1703
- * const authEndpoint = OIDCDiscoveryConstants.Endpoints.AUTHORIZATION;
1704
- *
1705
- * // Using a storage key
1706
- * const tokenKey = OIDCDiscoveryConstants.Storage.StorageKeys.Endpoints.TOKEN;
1707
- * ```
1708
- */
1709
- const OIDCDiscoveryConstants = {
1710
- Endpoints: {
1711
- AUTHORIZATION: "/oauth2/authorize",
1712
- END_SESSION: "/oauth2/logout",
1713
- ISSUER: "/oauth2/token",
1714
- JWKS: "/oauth2/jwks",
1715
- REVOCATION: "/oauth2/revoke",
1716
- SESSION_IFRAME: "/oidc/checksession",
1717
- TOKEN: "/oauth2/token",
1718
- USERINFO: "/oauth2/userinfo"
1719
- },
1720
- Storage: { StorageKeys: {
1721
- Endpoints: {
1722
- AUTHORIZATION: "authorization_endpoint",
1723
- END_SESSION: "end_session_endpoint",
1724
- ISSUER: "issuer",
1725
- JWKS: "jwks_uri",
1726
- REVOCATION: "revocation_endpoint",
1727
- SESSION_IFRAME: "check_session_iframe",
1728
- TOKEN: "token_endpoint",
1729
- USERINFO: "userinfo_endpoint"
1730
- },
1731
- OPENID_PROVIDER_CONFIG_INITIATED: "op_config_initiated"
1732
- } }
1733
- };
1734
- var OIDCDiscoveryConstants_default = OIDCDiscoveryConstants;
1735
-
1736
- //#endregion
1737
- //#region src/constants/PKCEConstants.ts
1738
- /**
1739
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
1740
- *
1741
- * WSO2 LLC. licenses this file to you under the Apache License,
1742
- * Version 2.0 (the "License"); you may not use this file except
1743
- * in compliance with the License.
1744
- * You may obtain a copy of the License at
1745
- *
1746
- * http://www.apache.org/licenses/LICENSE-2.0
1747
- *
1748
- * Unless required by applicable law or agreed to in writing,
1749
- * software distributed under the License is distributed on an
1750
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1751
- * KIND, either express or implied. See the License for the
1752
- * specific language governing permissions and limitations
1753
- * under the License.
1754
- */
1755
- /**
1756
- * Constants related to Proof Key for Code Exchange (PKCE) implementation.
1757
- * This object contains all the necessary constants for implementing PKCE
1758
- * flow in the OAuth 2.0 authorization code grant.
1759
- *
1760
- * @remarks
1761
- * PKCE is an extension to the authorization code flow to prevent CSRF and
1762
- * authorization code injection attacks. The constants are organized into
1763
- * storage-related sections for managing PKCE state.
1764
- *
1765
- * @example
1766
- * ```typescript
1767
- * // Using storage keys
1768
- * const codeVerifierKey = PKCEConstants.Storage.StorageKeys.CODE_VERIFIER;
1769
- * const separator = PKCEConstants.Storage.StorageKeys.SEPARATOR;
1770
- * ```
1771
- */
1772
- const PKCEConstants = {
1773
- DEFAULT_CODE_CHALLENGE_METHOD: "S256",
1774
- Storage: { StorageKeys: {
1775
- CODE_VERIFIER: "pkce_code_verifier",
1776
- SEPARATOR: "#"
1777
- } }
1778
- };
1779
- var PKCEConstants_default = PKCEConstants;
1780
-
1781
- //#endregion
1782
- //#region src/DefaultCacheStore.ts
1783
- /**
1784
- * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
1785
- *
1786
- * WSO2 LLC. licenses this file to you under the Apache License,
1787
- * Version 2.0 (the "License"); you may not use this file except
1788
- * in compliance with the License.
1789
- * You may obtain a copy of the License at
1790
- *
1791
- * http://www.apache.org/licenses/LICENSE-2.0
1792
- *
1793
- * Unless required by applicable law or agreed to in writing,
1794
- * software distributed under the License is distributed on an
1795
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1796
- * KIND, either express or implied. See the License for the
1797
- * specific language governing permissions and limitations
1798
- * under the License.
1799
- */
1800
- var DefaultCacheStore = class {
1801
- cache;
1802
- constructor() {
1803
- this.cache = /* @__PURE__ */ new Map();
1804
- }
1805
- get length() {
1806
- return this.cache.size;
1807
- }
1808
- getItem(key) {
1809
- return this.cache.get(key) ?? null;
1810
- }
1811
- setItem(key, value) {
1812
- this.cache.set(key, value);
1813
- }
1814
- removeItem(key) {
1815
- this.cache.delete(key);
1816
- }
1817
- clear() {
1818
- this.cache.clear();
1819
- }
1820
- key(index) {
1821
- return Array.from(this.cache.keys())[index] ?? null;
1822
- }
1823
- async setData(key, value) {
1824
- this.cache.set(key, value);
1825
- }
1826
- async getData(key) {
1827
- return this.cache.get(key) ?? "{}";
1828
- }
1829
- async removeData(key) {
1830
- this.cache.delete(key);
1831
- }
1832
- };
1833
-
1834
- //#endregion
1835
- //#region src/DefaultCrypto.ts
1836
- /**
1837
- * Default implementation of the Crypto interface using the 'jose' library
1838
- * and the native Web Crypto API.
1839
- */
1840
- var DefaultCrypto = class {
1841
- base64URLDecode(value) {
1842
- const decodedArray = jose.base64url.decode(value);
1843
- return new TextDecoder().decode(decodedArray);
1844
- }
1845
- base64URLEncode(value) {
1846
- return jose.base64url.encode(value);
1847
- }
1848
- generateRandomBytes(length) {
1849
- return crypto.getRandomValues(new Uint8Array(length));
1850
- }
1851
- async hashSha256(data) {
1852
- const dataBuffer = new TextEncoder().encode(data);
1853
- const hashBuffer = await crypto.subtle.digest("SHA-256", dataBuffer);
1854
- return new Uint8Array(hashBuffer);
1855
- }
1856
- async verifyJwt(idToken, jwk, algorithms, clientId, issuer, subject, clockTolerance, validateJwtIssuer = true) {
1857
- const key = await jose.importJWK(jwk);
1858
- await jose.jwtVerify(idToken, key, {
1859
- algorithms,
1860
- audience: [clientId],
1861
- clockTolerance,
1862
- issuer: validateJwtIssuer ? issuer : void 0,
1863
- subject
1864
- });
1865
- return true;
1866
- }
1867
- };
1868
-
1869
- //#endregion
1870
- //#region src/models/store.ts
1871
- /**
1872
- * Enum representing different types of data stores used in the application.
1873
- */
1874
- let Stores = /* @__PURE__ */ function(Stores$1) {
1875
- /**
1876
- * Store for configuration data that defines the application's behavior and settings.
1877
- */
1878
- Stores$1["ConfigData"] = "config_data";
1879
- /**
1880
- * Store for OpenID Connect provider metadata, including endpoints and configuration.
1881
- */
1882
- Stores$1["OIDCProviderMetaData"] = "oidc_provider_meta_data";
1883
- /**
1884
- * Store for persisted data that needs to be retained across sessions and application restarts.
1885
- */
1886
- Stores$1["PersistedData"] = "persisted_data";
1887
- /**
1888
- * Store for user session-related data like tokens and authentication state.
1889
- */
1890
- Stores$1["SessionData"] = "session_data";
1891
- /**
1892
- * Store for temporary data that needs to persist only for a short duration.
1893
- */
1894
- Stores$1["TemporaryData"] = "temporary_data";
1895
- /**
1896
- * Store for data that leverages local storage if available, falling back to the configured storage.
1897
- */
1898
- Stores$1["HybridData"] = "hybrid_data";
1899
- return Stores$1;
1900
- }({});
1901
-
1902
- //#endregion
1903
- //#region src/utils/logger.ts
1904
- const PREFIX = "⚡ ThunderID";
1905
- /**
1906
- * Default logger configuration
1907
- */
1908
- const DEFAULT_CONFIG$1 = {
1909
- level: "info",
1910
- prefix: `${PREFIX}`,
1911
- showLevel: true,
1912
- timestamps: true
1913
- };
1914
- /**
1915
- * Environment detection utilities
1916
- */
1917
- const isBrowser = () => typeof window !== "undefined" && typeof window.document !== "undefined";
1918
- const isNode = () => typeof process !== "undefined" && process.versions && process.versions.node;
1919
- /**
1920
- * Color codes for terminal output (Node.js)
1921
- */
1922
- const COLORS = {
1923
- blue: "\x1B[34m",
1924
- bright: "\x1B[1m",
1925
- cyan: "\x1B[36m",
1926
- dim: "\x1B[2m",
1927
- gray: "\x1B[90m",
1928
- green: "\x1B[32m",
1929
- magenta: "\x1B[35m",
1930
- red: "\x1B[31m",
1931
- reset: "\x1B[0m",
1932
- white: "\x1B[37m",
1933
- yellow: "\x1B[33m"
1934
- };
1935
- /**
1936
- * Browser console styling
1801
+ * // Using an endpoint
1802
+ * const authEndpoint = OIDCDiscoveryConstants.Endpoints.AUTHORIZATION;
1803
+ *
1804
+ * // Using a storage key
1805
+ * const tokenKey = OIDCDiscoveryConstants.Storage.StorageKeys.Endpoints.TOKEN;
1806
+ * ```
1937
1807
  */
1938
- const BROWSER_STYLES = {
1939
- debug: "color: #6b7280; font-weight: normal;",
1940
- error: "color: #dc2626; font-weight: bold;",
1941
- info: "color: #2563eb; font-weight: bold;",
1942
- prefix: "color: #7c3aed; font-weight: bold;",
1943
- timestamp: "color: #6b7280; font-size: 0.9em;",
1944
- warn: "color: #d97706; font-weight: bold;"
1945
- };
1946
- const LOG_LEVEL_ORDER = {
1947
- debug: 0,
1948
- error: 3,
1949
- info: 1,
1950
- warn: 2
1808
+ const OIDCDiscoveryConstants = {
1809
+ Endpoints: {
1810
+ AUTHORIZATION: "/oauth2/authorize",
1811
+ END_SESSION: "/oauth2/logout",
1812
+ ISSUER: "/oauth2/token",
1813
+ JWKS: "/oauth2/jwks",
1814
+ REVOCATION: "/oauth2/revoke",
1815
+ SESSION_IFRAME: "/oidc/checksession",
1816
+ TOKEN: "/oauth2/token",
1817
+ USERINFO: "/oauth2/userinfo"
1818
+ },
1819
+ Storage: { StorageKeys: {
1820
+ Endpoints: {
1821
+ AUTHORIZATION: "authorization_endpoint",
1822
+ END_SESSION: "end_session_endpoint",
1823
+ ISSUER: "issuer",
1824
+ JWKS: "jwks_uri",
1825
+ REVOCATION: "revocation_endpoint",
1826
+ SESSION_IFRAME: "check_session_iframe",
1827
+ TOKEN: "token_endpoint",
1828
+ USERINFO: "userinfo_endpoint"
1829
+ },
1830
+ OPENID_PROVIDER_CONFIG_INITIATED: "op_config_initiated"
1831
+ } }
1951
1832
  };
1833
+ var OIDCDiscoveryConstants_default = OIDCDiscoveryConstants;
1834
+
1835
+ //#endregion
1836
+ //#region src/constants/PKCEConstants.ts
1952
1837
  /**
1953
- * Universal logger class that works in both browser and Node.js environments
1838
+ * Constants related to Proof Key for Code Exchange (PKCE) implementation.
1839
+ * This object contains all the necessary constants for implementing PKCE
1840
+ * flow in the OAuth 2.0 authorization code grant.
1841
+ *
1842
+ * @remarks
1843
+ * PKCE is an extension to the authorization code flow to prevent CSRF and
1844
+ * authorization code injection attacks. The constants are organized into
1845
+ * storage-related sections for managing PKCE state.
1846
+ *
1847
+ * @example
1848
+ * ```typescript
1849
+ * // Using storage keys
1850
+ * const codeVerifierKey = PKCEConstants.Storage.StorageKeys.CODE_VERIFIER;
1851
+ * const separator = PKCEConstants.Storage.StorageKeys.SEPARATOR;
1852
+ * ```
1954
1853
  */
1955
- var Logger = class Logger {
1956
- config;
1957
- constructor(config = {}) {
1958
- this.config = {
1959
- ...DEFAULT_CONFIG$1,
1960
- ...config
1961
- };
1854
+ const PKCEConstants = {
1855
+ DEFAULT_CODE_CHALLENGE_METHOD: "S256",
1856
+ Storage: { StorageKeys: {
1857
+ CODE_VERIFIER: "pkce_code_verifier",
1858
+ SEPARATOR: "#"
1859
+ } }
1860
+ };
1861
+ var PKCEConstants_default = PKCEConstants;
1862
+
1863
+ //#endregion
1864
+ //#region src/DefaultCacheStore.ts
1865
+ var DefaultCacheStore = class {
1866
+ cache;
1867
+ constructor() {
1868
+ this.cache = /* @__PURE__ */ new Map();
1962
1869
  }
1963
- /**
1964
- * Update logger configuration
1965
- */
1966
- configure(config) {
1967
- this.config = {
1968
- ...this.config,
1969
- ...config
1970
- };
1870
+ get length() {
1871
+ return this.cache.size;
1971
1872
  }
1972
- /**
1973
- * Get current configuration
1974
- */
1975
- getConfig() {
1976
- return { ...this.config };
1873
+ getItem(key) {
1874
+ return this.cache.get(key) ?? null;
1977
1875
  }
1978
- /**
1979
- * Check if a log level should be output
1980
- */
1981
- shouldLog(level) {
1982
- return LOG_LEVEL_ORDER[level] >= LOG_LEVEL_ORDER[this.config.level];
1876
+ setItem(key, value) {
1877
+ this.cache.set(key, value);
1983
1878
  }
1984
- /**
1985
- * Get timestamp string
1986
- */
1987
- static getTimestamp() {
1988
- return (/* @__PURE__ */ new Date()).toISOString();
1879
+ removeItem(key) {
1880
+ this.cache.delete(key);
1989
1881
  }
1990
- /**
1991
- * Get log level string
1992
- */
1993
- static getLevelString(level) {
1994
- switch (level) {
1995
- case "debug": return "DEBUG";
1996
- case "info": return "INFO";
1997
- case "warn": return "WARN";
1998
- case "error": return "ERROR";
1999
- default: return "UNKNOWN";
2000
- }
1882
+ clear() {
1883
+ this.cache.clear();
2001
1884
  }
2002
- /**
2003
- * Format message for Node.js terminal
2004
- */
2005
- formatForNode(level, message) {
2006
- const parts = [];
2007
- if (this.config.timestamps) parts.push(`${COLORS.gray}[${Logger.getTimestamp()}]${COLORS.reset}`);
2008
- if (this.config.prefix) parts.push(`${COLORS.magenta}${this.config.prefix}${COLORS.reset}`);
2009
- if (this.config.showLevel) {
2010
- const levelStr = Logger.getLevelString(level);
2011
- let coloredLevel;
2012
- switch (level) {
2013
- case "debug":
2014
- coloredLevel = `${COLORS.gray}[${levelStr}]${COLORS.reset}`;
2015
- break;
2016
- case "info":
2017
- coloredLevel = `${COLORS.blue}[${levelStr}]${COLORS.reset}`;
2018
- break;
2019
- case "warn":
2020
- coloredLevel = `${COLORS.yellow}[${levelStr}]${COLORS.reset}`;
2021
- break;
2022
- case "error":
2023
- coloredLevel = `${COLORS.red}[${levelStr}]${COLORS.reset}`;
2024
- break;
2025
- default: coloredLevel = `[${levelStr}]`;
2026
- }
2027
- parts.push(coloredLevel);
2028
- }
2029
- parts.push(message);
2030
- return parts.join(" ");
1885
+ key(index) {
1886
+ return Array.from(this.cache.keys())[index] ?? null;
2031
1887
  }
2032
- /**
2033
- * Log message using appropriate method
2034
- */
2035
- logMessage(level, message, ...args) {
2036
- if (!this.shouldLog(level)) return;
2037
- if (this.config.formatter) {
2038
- this.config.formatter(level, message, ...args);
2039
- return;
2040
- }
2041
- if (isBrowser()) this.logToBrowser(level, message, ...args);
2042
- else if (isNode()) this.logToNode(level, message, ...args);
2043
- else console.log(message, ...args);
1888
+ async setData(key, value) {
1889
+ this.cache.set(key, value);
2044
1890
  }
2045
- /**
2046
- * Log to browser console with styling
2047
- */
2048
- logToBrowser(level, message, ...args) {
2049
- const parts = [];
2050
- const styles = [];
2051
- if (this.config.timestamps) {
2052
- parts.push(`%c[${Logger.getTimestamp()}]`);
2053
- styles.push(BROWSER_STYLES.timestamp);
2054
- }
2055
- if (this.config.prefix) {
2056
- parts.push(`%c${this.config.prefix}`);
2057
- styles.push(BROWSER_STYLES.prefix);
2058
- }
2059
- if (this.config.showLevel) {
2060
- const levelStr = Logger.getLevelString(level);
2061
- parts.push(`%c[${levelStr}]`);
2062
- switch (level) {
2063
- case "debug":
2064
- styles.push(BROWSER_STYLES.debug);
2065
- break;
2066
- case "info":
2067
- styles.push(BROWSER_STYLES.info);
2068
- break;
2069
- case "warn":
2070
- styles.push(BROWSER_STYLES.warn);
2071
- break;
2072
- case "error":
2073
- styles.push(BROWSER_STYLES.error);
2074
- break;
2075
- default: styles.push("");
2076
- }
2077
- }
2078
- parts.push(`%c${message}`);
2079
- styles.push("color: inherit; font-weight: normal;");
2080
- const formattedMessage = parts.join(" ");
2081
- switch (level) {
2082
- case "debug":
2083
- console.debug(formattedMessage, ...styles, ...args);
2084
- break;
2085
- case "info":
2086
- console.info(formattedMessage, ...styles, ...args);
2087
- break;
2088
- case "warn":
2089
- console.warn(formattedMessage, ...styles, ...args);
2090
- break;
2091
- case "error":
2092
- console.error(formattedMessage, ...styles, ...args);
2093
- break;
2094
- default: console.log(formattedMessage, ...styles, ...args);
2095
- }
1891
+ async getData(key) {
1892
+ return this.cache.get(key) ?? "{}";
2096
1893
  }
2097
- /**
2098
- * Log to Node.js console
2099
- */
2100
- logToNode(level, message, ...args) {
2101
- const formattedMessage = this.formatForNode(level, message);
2102
- switch (level) {
2103
- case "debug":
2104
- console.debug(formattedMessage, ...args);
2105
- break;
2106
- case "info":
2107
- console.info(formattedMessage, ...args);
2108
- break;
2109
- case "warn":
2110
- console.warn(formattedMessage, ...args);
2111
- break;
2112
- case "error":
2113
- console.error(formattedMessage, ...args);
2114
- break;
2115
- default: console.log(formattedMessage, ...args);
2116
- }
1894
+ async removeData(key) {
1895
+ this.cache.delete(key);
1896
+ }
1897
+ };
1898
+
1899
+ //#endregion
1900
+ //#region src/DefaultCrypto.ts
1901
+ /**
1902
+ * Default implementation of the Crypto interface using the 'jose' library
1903
+ * and the native Web Crypto API.
1904
+ */
1905
+ var DefaultCrypto = class {
1906
+ base64URLDecode(value) {
1907
+ const decodedArray = jose.base64url.decode(value);
1908
+ return new TextDecoder().decode(decodedArray);
2117
1909
  }
2118
- /**
2119
- * Log debug message
2120
- */
2121
- debug(message, ...args) {
2122
- this.logMessage("debug", message, ...args);
1910
+ base64URLEncode(value) {
1911
+ return jose.base64url.encode(value);
1912
+ }
1913
+ generateRandomBytes(length) {
1914
+ return crypto.getRandomValues(new Uint8Array(length));
1915
+ }
1916
+ async hashSha256(data) {
1917
+ const dataBuffer = new TextEncoder().encode(data);
1918
+ const hashBuffer = await crypto.subtle.digest("SHA-256", dataBuffer);
1919
+ return new Uint8Array(hashBuffer);
1920
+ }
1921
+ async verifyJwt(idToken, jwk, algorithms, clientId, issuer, subject, clockTolerance, validateJwtIssuer = true) {
1922
+ const key = await jose.importJWK(jwk);
1923
+ await jose.jwtVerify(idToken, key, {
1924
+ algorithms,
1925
+ audience: [clientId],
1926
+ clockTolerance,
1927
+ issuer: validateJwtIssuer ? issuer : void 0,
1928
+ subject
1929
+ });
1930
+ return true;
2123
1931
  }
1932
+ };
1933
+
1934
+ //#endregion
1935
+ //#region src/models/store.ts
1936
+ /**
1937
+ * Enum representing different types of data stores used in the application.
1938
+ */
1939
+ let Stores = /* @__PURE__ */ function(Stores$1) {
2124
1940
  /**
2125
- * Log info message
1941
+ * Store for configuration data that defines the application's behavior and settings.
2126
1942
  */
2127
- info(message, ...args) {
2128
- this.logMessage("info", message, ...args);
2129
- }
1943
+ Stores$1["ConfigData"] = "config_data";
2130
1944
  /**
2131
- * Log warning message
1945
+ * Store for OpenID Connect provider metadata, including endpoints and configuration.
2132
1946
  */
2133
- warn(message, ...args) {
2134
- this.logMessage("warn", message, ...args);
2135
- }
1947
+ Stores$1["OIDCProviderMetaData"] = "oidc_provider_meta_data";
2136
1948
  /**
2137
- * Log error message
1949
+ * Store for persisted data that needs to be retained across sessions and application restarts.
2138
1950
  */
2139
- error(message, ...args) {
2140
- this.logMessage("error", message, ...args);
2141
- }
1951
+ Stores$1["PersistedData"] = "persisted_data";
2142
1952
  /**
2143
- * Create a child logger with additional prefix
1953
+ * Store for user session-related data like tokens and authentication state.
2144
1954
  */
2145
- child(prefix) {
2146
- const childPrefix = this.config.prefix ? `${this.config.prefix} - ${prefix}` : prefix;
2147
- return new Logger({
2148
- ...this.config,
2149
- prefix: childPrefix
2150
- });
2151
- }
1955
+ Stores$1["SessionData"] = "session_data";
2152
1956
  /**
2153
- * Set log level
1957
+ * Store for temporary data that needs to persist only for a short duration.
2154
1958
  */
2155
- setLevel(level) {
2156
- this.config.level = level;
2157
- }
1959
+ Stores$1["TemporaryData"] = "temporary_data";
2158
1960
  /**
2159
- * Get current log level
1961
+ * Store for data that leverages local storage if available, falling back to the configured storage.
2160
1962
  */
2161
- getLevel() {
2162
- return this.config.level;
2163
- }
2164
- };
2165
- /**
2166
- * Default logger instance
2167
- */
2168
- const logger = new Logger();
2169
- /**
2170
- * Create a new logger instance with custom configuration
2171
- */
2172
- const createLogger = (config) => new Logger(config);
2173
- /**
2174
- * Default export - global logger instance
2175
- */
2176
- var logger_default = logger;
2177
- /**
2178
- * Named exports for convenience
2179
- */
2180
- const debug = (message, ...args) => logger.debug(message, ...args);
2181
- const info = (message, ...args) => logger.info(message, ...args);
2182
- const warn = (message, ...args) => logger.warn(message, ...args);
2183
- const error = (message, ...args) => logger.error(message, ...args);
2184
- /**
2185
- * Configure the default logger
2186
- */
2187
- const configure = (config) => logger.configure(config);
2188
- /**
2189
- * Create component-specific loggers
2190
- */
2191
- const createComponentLogger = (component) => logger.child(component);
2192
- /**
2193
- * Create package-specific logger
2194
- */
2195
- const createPackageLogger = (packageName) => createLogger({
2196
- level: "info",
2197
- prefix: `${PREFIX} - ${packageName}`,
2198
- showLevel: true,
2199
- timestamps: true
2200
- });
2201
- /**
2202
- * Create package component logger (package + component)
2203
- */
2204
- const createPackageComponentLogger = (packageName, component) => {
2205
- return createPackageLogger(packageName).child(component);
2206
- };
1963
+ Stores$1["HybridData"] = "hybrid_data";
1964
+ return Stores$1;
1965
+ }({});
2207
1966
 
2208
1967
  //#endregion
2209
1968
  //#region src/StorageManager.ts
@@ -2526,24 +2285,43 @@ const processOpenIDScopes = (scopes) => {
2526
2285
  var processOpenIDScopes_default = processOpenIDScopes;
2527
2286
 
2528
2287
  //#endregion
2529
- //#region src/constants/TokenExchangeConstants.ts
2288
+ //#region src/utils/resolveResourceEndpoint.ts
2289
+ /**
2290
+ * The `config.endpoints` keys that address resource-server endpoints rather than OIDC/OAuth
2291
+ * endpoints. Used to keep these overrides out of the resolved OIDC provider metadata.
2292
+ */
2293
+ const RESOURCE_ENDPOINT_KEYS = [
2294
+ "flowExecute",
2295
+ "flowMeta",
2296
+ "usersMe"
2297
+ ];
2530
2298
  /**
2531
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
2299
+ * Resolves the absolute `url` to use for a resource-server endpoint, honoring (in order of
2300
+ * precedence) an explicit per-call URL, then a `config.endpoints` override.
2532
2301
  *
2533
- * WSO2 LLC. licenses this file to you under the Apache License,
2534
- * Version 2.0 (the "License"); you may not use this file except
2535
- * in compliance with the License.
2536
- * You may obtain a copy of the License at
2302
+ * Returns `undefined` when neither is set, so the calling API function falls back to deriving the
2303
+ * endpoint from `baseUrl` (i.e. `${baseUrl}/flow/execute`) exactly as before. Callers should keep
2304
+ * passing `baseUrl` alongside the resolved `url` to preserve that fallback.
2537
2305
  *
2538
- * http://www.apache.org/licenses/LICENSE-2.0
2306
+ * @param key - The resource endpoint to resolve.
2307
+ * @param config - The client config carrying optional `endpoints` overrides.
2308
+ * @param explicitUrl - An explicit URL provided by the immediate caller; takes highest precedence.
2309
+ * @returns The resolved override URL, or `undefined` to defer to `baseUrl`-based resolution.
2539
2310
  *
2540
- * Unless required by applicable law or agreed to in writing,
2541
- * software distributed under the License is distributed on an
2542
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
2543
- * KIND, either express or implied. See the License for the
2544
- * specific language governing permissions and limitations
2545
- * under the License.
2311
+ * @example
2312
+ * ```typescript
2313
+ * const response = await executeEmbeddedUserOnboardingFlow({
2314
+ * baseUrl: config.baseUrl,
2315
+ * url: resolveResourceEndpoint('flowExecute', config),
2316
+ * payload,
2317
+ * });
2318
+ * ```
2546
2319
  */
2320
+ const resolveResourceEndpoint = (key, config, explicitUrl) => explicitUrl ?? config?.endpoints?.[key] ?? void 0;
2321
+ var resolveResourceEndpoint_default = resolveResourceEndpoint;
2322
+
2323
+ //#endregion
2324
+ //#region src/constants/TokenExchangeConstants.ts
2547
2325
  /**
2548
2326
  * Constants for OAuth 2.0 Token Exchange operations.
2549
2327
  * This object contains placeholders used in token exchange requests
@@ -2595,6 +2373,25 @@ var AuthenticationHelper = class {
2595
2373
  this.cryptoHelper = cryptoHelperInstance;
2596
2374
  }
2597
2375
  /**
2376
+ * Maps the config-defined OIDC endpoint overrides to their discovery-metadata form.
2377
+ *
2378
+ * Endpoint names are converted from camelCase to snake_case, and resource-server endpoints
2379
+ * (`RESOURCE_ENDPOINT_KEYS`) are excluded — those are resolved separately via
2380
+ * `resolveResourceEndpoint` and must not leak into the OIDC provider metadata.
2381
+ *
2382
+ * @param configData - The resolved auth client config.
2383
+ * @returns A snake_cased map of the OIDC endpoint overrides (empty when none are configured).
2384
+ */
2385
+ mapConfiguredOidcEndpoints(configData) {
2386
+ const endpoints = {};
2387
+ if (!configData.endpoints) return endpoints;
2388
+ Object.keys(configData.endpoints).filter((endpointName) => !RESOURCE_ENDPOINT_KEYS.includes(endpointName)).forEach((endpointName) => {
2389
+ const snakeCasedName = endpointName.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);
2390
+ endpoints[snakeCasedName] = configData.endpoints ? configData.endpoints[endpointName] : "";
2391
+ });
2392
+ return endpoints;
2393
+ }
2394
+ /**
2598
2395
  * Merges explicit endpoint overrides from config into the discovery response.
2599
2396
  * Config-defined endpoint names (camelCase) are converted to snake_case before merging.
2600
2397
  *
@@ -2602,15 +2399,10 @@ var AuthenticationHelper = class {
2602
2399
  * @returns The discovery response with any config-specified endpoint overrides applied.
2603
2400
  */
2604
2401
  async resolveEndpoints(response) {
2605
- const oidcProviderMetaData = {};
2606
2402
  const configData = await this.config();
2607
- if (configData.endpoints) Object.keys(configData.endpoints).forEach((endpointName) => {
2608
- const snakeCasedName = endpointName.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);
2609
- oidcProviderMetaData[snakeCasedName] = configData?.endpoints ? configData.endpoints[endpointName] : "";
2610
- });
2611
2403
  return {
2612
2404
  ...response,
2613
- ...oidcProviderMetaData
2405
+ ...this.mapConfiguredOidcEndpoints(configData)
2614
2406
  };
2615
2407
  }
2616
2408
  /**
@@ -2621,7 +2413,6 @@ var AuthenticationHelper = class {
2621
2413
  * @throws {ThunderIDAuthException} When required endpoints are absent from the config.
2622
2414
  */
2623
2415
  async resolveEndpointsExplicitly() {
2624
- const oidcProviderMetaData = {};
2625
2416
  const configData = await this.config();
2626
2417
  const requiredEndpoints = [
2627
2418
  OIDCDiscoveryConstants_default.Storage.StorageKeys.Endpoints.AUTHORIZATION,
@@ -2636,11 +2427,7 @@ var AuthenticationHelper = class {
2636
2427
  if (!(configData.endpoints ? requiredEndpoints.every((reqEndpointName) => configData.endpoints ? Object.keys(configData.endpoints).some((endpointName) => {
2637
2428
  return endpointName.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`) === reqEndpointName;
2638
2429
  }) : false) : false)) throw new ThunderIDAuthException("JS-AUTH_HELPER-REE-NF01", "Required endpoints missing", "Some or all of the required endpoints are missing in the object passed to the `endpoints` attribute of the`AuthConfig` object.");
2639
- if (configData.endpoints) Object.keys(configData.endpoints).forEach((endpointName) => {
2640
- const snakeCasedName = endpointName.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);
2641
- oidcProviderMetaData[snakeCasedName] = configData?.endpoints ? configData.endpoints[endpointName] : "";
2642
- });
2643
- return { ...oidcProviderMetaData };
2430
+ return { ...this.mapConfiguredOidcEndpoints(configData) };
2644
2431
  }
2645
2432
  /**
2646
2433
  * Derives OIDC endpoint URLs from the configured `baseUrl`.
@@ -2651,14 +2438,10 @@ var AuthenticationHelper = class {
2651
2438
  * @throws {ThunderIDAuthException} When `baseUrl` is not defined in the config.
2652
2439
  */
2653
2440
  async resolveEndpointsByBaseURL() {
2654
- const oidcProviderMetaData = {};
2655
2441
  const configData = await this.config();
2656
2442
  const { baseUrl } = configData;
2657
2443
  if (!baseUrl) throw new ThunderIDAuthException("JS-AUTH_HELPER_REBO-NF01", "Base URL not defined.", "Base URL is not defined in AuthClient config.");
2658
- if (configData.endpoints) Object.keys(configData.endpoints).forEach((endpointName) => {
2659
- const snakeCasedName = endpointName.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);
2660
- oidcProviderMetaData[snakeCasedName] = configData?.endpoints ? configData.endpoints[endpointName] : "";
2661
- });
2444
+ const oidcProviderMetaData = this.mapConfiguredOidcEndpoints(configData);
2662
2445
  const endpointKeys = OIDCDiscoveryConstants_default.Storage.StorageKeys.Endpoints;
2663
2446
  const endpointPaths = OIDCDiscoveryConstants_default.Endpoints;
2664
2447
  return {
@@ -2814,23 +2597,6 @@ var base64Encode_default = base64Encode;
2814
2597
  //#endregion
2815
2598
  //#region src/utils/deepMerge.ts
2816
2599
  /**
2817
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
2818
- *
2819
- * WSO2 LLC. licenses this file to you under the Apache License,
2820
- * Version 2.0 (the "License"); you may not use this file except
2821
- * in compliance with the License.
2822
- * You may obtain a copy of the License at
2823
- *
2824
- * http://www.apache.org/licenses/LICENSE-2.0
2825
- *
2826
- * Unless required by applicable law or agreed to in writing,
2827
- * software distributed under the License is distributed on an
2828
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
2829
- * KIND, either express or implied. See the License for the
2830
- * specific language governing permissions and limitations
2831
- * under the License.
2832
- */
2833
- /**
2834
2600
  * Checks if a value is a plain object (not an array, function, date, etc.)
2835
2601
  *
2836
2602
  * @param value - The value to check
@@ -3086,8 +2852,18 @@ var ThunderIDJavaScriptClient = class {
3086
2852
  return createdAt + parseInt(expiresInString, 10) * 1e3 > (/* @__PURE__ */ new Date()).getTime();
3087
2853
  }
3088
2854
  async getAccessToken(sessionId) {
2855
+ if ((await this.configProvider()).grantType === "client_credentials") {
2856
+ const sessionData = await this.storageManager.getSessionData(sessionId);
2857
+ if (sessionData?.access_token && this.isCachedTokenStillValid(sessionData)) return sessionData.access_token;
2858
+ return (await this.requestClientCredentialsToken(sessionId)).accessToken;
2859
+ }
3089
2860
  return (await this.storageManager.getSessionData(sessionId))?.access_token;
3090
2861
  }
2862
+ isCachedTokenStillValid(sessionData) {
2863
+ if (!sessionData.created_at || !sessionData.expires_in) return false;
2864
+ const expiresInMs = parseInt(sessionData.expires_in, 10) * 1e3;
2865
+ return sessionData.created_at + expiresInMs - TokenConstants_default.Lifecycle.CLIENT_CREDENTIALS_REFRESH_MARGIN_MS > Date.now();
2866
+ }
3091
2867
  clearSession(sessionId) {
3092
2868
  this.authHelper.clearSession(sessionId);
3093
2869
  }
@@ -3360,6 +3136,56 @@ var ThunderIDJavaScriptClient = class {
3360
3136
  if (!tokenResponse.ok) throw new ThunderIDAuthException("JS-AUTH_CORE-RAT2-HE04", `Refreshing access token failed with ${tokenResponse.statusText}`, await tokenResponse.json());
3361
3137
  return this.authHelper.handleTokenResponse(tokenResponse, userId);
3362
3138
  }
3139
+ /**
3140
+ * Requests a machine-to-machine access token via the `client_credentials` grant
3141
+ * (RFC 6749 §4.4) and caches it under the given session key. Unlike the user-facing
3142
+ * flows, there's no id_token or refresh_token: the service authenticates as itself.
3143
+ */
3144
+ async requestClientCredentialsToken(sessionId) {
3145
+ if (!await this.storageManager.getTemporaryDataParameter(OIDCDiscoveryConstants_default.Storage.StorageKeys.OPENID_PROVIDER_CONFIG_INITIATED)) await this.loadOpenIDProviderConfiguration(false);
3146
+ const tokenEndpoint = (await this.oidcProviderMetaDataProvider()).token_endpoint;
3147
+ const configData = await this.configProvider();
3148
+ if (!tokenEndpoint || tokenEndpoint.trim().length === 0) throw new ThunderIDAuthException("JS-AUTH_CORE-RCCT-NF01", "Token endpoint not found.", "No token endpoint was found in the OIDC provider meta data returned by the well-known endpoint or the token endpoint passed to the SDK is empty.");
3149
+ const body = new URLSearchParams();
3150
+ body.set("grant_type", "client_credentials");
3151
+ body.set("client_id", configData.clientId ?? "");
3152
+ const hasSecret = Boolean(configData.clientSecret && configData.clientSecret.trim().length > 0);
3153
+ const tokenEndpointAuthMethod = configData.tokenRequest?.authMethod ?? "client_secret_basic";
3154
+ if (hasSecret && tokenEndpointAuthMethod === "client_secret_post") body.set("client_secret", configData.clientSecret);
3155
+ const scope = Array.isArray(configData.scopes) ? configData.scopes.join(" ") : configData.scopes;
3156
+ if (scope) body.set("scope", scope);
3157
+ if (configData.tokenRequest?.params) Object.entries(configData.tokenRequest.params).forEach(([key, value]) => {
3158
+ body.set(key, value);
3159
+ });
3160
+ const tokenRequestHeaders = {
3161
+ Accept: "application/json",
3162
+ "Content-Type": "application/x-www-form-urlencoded"
3163
+ };
3164
+ if (hasSecret && tokenEndpointAuthMethod === "client_secret_basic") tokenRequestHeaders["Authorization"] = `Basic ${base64Encode_default(`${encodeURIComponent(configData.clientId)}:${encodeURIComponent(configData.clientSecret)}`)}`;
3165
+ let tokenResponse;
3166
+ try {
3167
+ tokenResponse = await fetch(tokenEndpoint, {
3168
+ body,
3169
+ headers: tokenRequestHeaders,
3170
+ method: "POST"
3171
+ });
3172
+ } catch (error$1) {
3173
+ throw new ThunderIDAuthException("JS-AUTH_CORE-RCCT-NE02", "Requesting client credentials token failed.", error$1 ?? "The request to get the client credentials access token failed.");
3174
+ }
3175
+ if (!tokenResponse.ok) throw new ThunderIDAuthException("JS-AUTH_CORE-RCCT-HE03", `Requesting client credentials token failed with ${tokenResponse.statusText}`, await tokenResponse.json());
3176
+ const parsedResponse = await tokenResponse.json();
3177
+ parsedResponse.created_at = (/* @__PURE__ */ new Date()).getTime();
3178
+ await this.storageManager.setSessionData(parsedResponse, sessionId);
3179
+ return {
3180
+ accessToken: parsedResponse.access_token,
3181
+ createdAt: parsedResponse.created_at,
3182
+ expiresIn: parsedResponse.expires_in,
3183
+ idToken: parsedResponse.id_token ?? "",
3184
+ refreshToken: parsedResponse.refresh_token ?? "",
3185
+ scope: parsedResponse.scope,
3186
+ tokenType: parsedResponse.token_type
3187
+ };
3188
+ }
3363
3189
  async revokeAccessToken(userId) {
3364
3190
  const revokeTokenEndpoint = (await this.oidcProviderMetaDataProvider()).revocation_endpoint;
3365
3191
  const configData = await this.configProvider();
@@ -3994,23 +3820,6 @@ var createTheme_default = createTheme;
3994
3820
  //#endregion
3995
3821
  //#region src/utils/arrayBufferToBase64url.ts
3996
3822
  /**
3997
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3998
- *
3999
- * WSO2 LLC. licenses this file to you under the Apache License,
4000
- * Version 2.0 (the "License"); you may not use this file except
4001
- * in compliance with the License.
4002
- * You may obtain a copy of the License at
4003
- *
4004
- * http://www.apache.org/licenses/LICENSE-2.0
4005
- *
4006
- * Unless required by applicable law or agreed to in writing,
4007
- * software distributed under the License is distributed on an
4008
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
4009
- * KIND, either express or implied. See the License for the
4010
- * specific language governing permissions and limitations
4011
- * under the License.
4012
- */
4013
- /**
4014
3823
  * Converts an ArrayBuffer to a base64url encoded string.
4015
3824
  *
4016
3825
  * Base64url encoding is a URL-safe variant of base64 encoding that:
@@ -4050,23 +3859,6 @@ var arrayBufferToBase64url_default = arrayBufferToBase64url;
4050
3859
  //#endregion
4051
3860
  //#region src/utils/base64urlToArrayBuffer.ts
4052
3861
  /**
4053
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
4054
- *
4055
- * WSO2 LLC. licenses this file to you under the Apache License,
4056
- * Version 2.0 (the "License"); you may not use this file except
4057
- * in compliance with the License.
4058
- * You may obtain a copy of the License at
4059
- *
4060
- * http://www.apache.org/licenses/LICENSE-2.0
4061
- *
4062
- * Unless required by applicable law or agreed to in writing,
4063
- * software distributed under the License is distributed on an
4064
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
4065
- * KIND, either express or implied. See the License for the
4066
- * specific language governing permissions and limitations
4067
- * under the License.
4068
- */
4069
- /**
4070
3862
  * Converts a base64url encoded string back to an ArrayBuffer.
4071
3863
  *
4072
3864
  * This function performs the inverse operation of base64url encoding by:
@@ -4115,23 +3907,6 @@ var base64urlToArrayBuffer_default = base64urlToArrayBuffer;
4115
3907
  //#endregion
4116
3908
  //#region src/utils/bem.ts
4117
3909
  /**
4118
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
4119
- *
4120
- * WSO2 LLC. licenses this file to you under the Apache License,
4121
- * Version 2.0 (the "License"); you may not use this file except
4122
- * in compliance with the License.
4123
- * You may obtain a copy of the License at
4124
- *
4125
- * http://www.apache.org/licenses/LICENSE-2.0
4126
- *
4127
- * Unless required by applicable law or agreed to in writing,
4128
- * software distributed under the License is distributed on an
4129
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
4130
- * KIND, either express or implied. See the License for the
4131
- * specific language governing permissions and limitations
4132
- * under the License.
4133
- */
4134
- /**
4135
3910
  * Creates a BEM-style class name by combining a base class with element and/or modifier
4136
3911
  *
4137
3912
  * @param baseClass - The base CSS class string (usually from emotion's css function)
@@ -4169,23 +3944,6 @@ var bem_default = bem;
4169
3944
  //#endregion
4170
3945
  //#region src/utils/formatDate.ts
4171
3946
  /**
4172
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
4173
- *
4174
- * WSO2 LLC. licenses this file to you under the Apache License,
4175
- * Version 2.0 (the "License"); you may not use this file except
4176
- * in compliance with the License.
4177
- * You may obtain a copy of the License at
4178
- *
4179
- * http://www.apache.org/licenses/LICENSE-2.0
4180
- *
4181
- * Unless required by applicable law or agreed to in writing,
4182
- * software distributed under the License is distributed on an
4183
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
4184
- * KIND, either express or implied. See the License for the
4185
- * specific language governing permissions and limitations
4186
- * under the License.
4187
- */
4188
- /**
4189
3947
  * Formats a date string to a human-readable format.
4190
3948
  *
4191
3949
  * @param dateString - The date string to format (optional)
@@ -4336,23 +4094,6 @@ var getRedirectBasedSignUpUrl_default = getRedirectBasedSignUpUrl;
4336
4094
  //#endregion
4337
4095
  //#region src/utils/isEmpty.ts
4338
4096
  /**
4339
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
4340
- *
4341
- * WSO2 LLC. licenses this file to you under the Apache License,
4342
- * Version 2.0 (the "License"); you may not use this file except
4343
- * in compliance with the License.
4344
- * You may obtain a copy of the License at
4345
- *
4346
- * http://www.apache.org/licenses/LICENSE-2.0
4347
- *
4348
- * Unless required by applicable law or agreed to in writing,
4349
- * software distributed under the License is distributed on an
4350
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
4351
- * KIND, either express or implied. See the License for the
4352
- * specific language governing permissions and limitations
4353
- * under the License.
4354
- */
4355
- /**
4356
4097
  * Checks if a value is considered empty.
4357
4098
  *
4358
4099
  * A value is considered empty if it is:
@@ -4392,23 +4133,6 @@ var isEmpty_default = isEmpty;
4392
4133
 
4393
4134
  //#endregion
4394
4135
  //#region src/utils/isEmojiUri.ts
4395
- /**
4396
- * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
4397
- *
4398
- * WSO2 LLC. licenses this file to you under the Apache License,
4399
- * Version 2.0 (the "License"); you may not use this file except
4400
- * in compliance with the License.
4401
- * You may obtain a copy of the License at
4402
- *
4403
- * http://www.apache.org/licenses/LICENSE-2.0
4404
- *
4405
- * Unless required by applicable law or agreed to in writing,
4406
- * software distributed under the License is distributed on an
4407
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
4408
- * KIND, either express or implied. See the License for the
4409
- * specific language governing permissions and limitations
4410
- * under the License.
4411
- */
4412
4136
  const EMOJI_URI_SCHEME = "emoji:";
4413
4137
  /**
4414
4138
  * Checks whether a given URI uses the `emoji:` scheme (e.g. `"emoji:🐯"`).
@@ -4449,23 +4173,6 @@ var extractEmojiFromUri_default = extractEmojiFromUri;
4449
4173
  //#endregion
4450
4174
  //#region src/utils/set.ts
4451
4175
  /**
4452
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
4453
- *
4454
- * WSO2 LLC. licenses this file to you under the Apache License,
4455
- * Version 2.0 (the "License"); you may not use this file except
4456
- * in compliance with the License.
4457
- * You may obtain a copy of the License at
4458
- *
4459
- * http://www.apache.org/licenses/LICENSE-2.0
4460
- *
4461
- * Unless required by applicable law or agreed to in writing,
4462
- * software distributed under the License is distributed on an
4463
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
4464
- * KIND, either express or implied. See the License for the
4465
- * specific language governing permissions and limitations
4466
- * under the License.
4467
- */
4468
- /**
4469
4176
  * Sets the value at path of object. If a portion of path doesn't exist,
4470
4177
  * it's created. Arrays are created for missing index properties while
4471
4178
  * objects are created for all other missing properties.
@@ -4495,23 +4202,6 @@ var set_default = set;
4495
4202
  //#endregion
4496
4203
  //#region src/utils/get.ts
4497
4204
  /**
4498
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
4499
- *
4500
- * WSO2 LLC. licenses this file to you under the Apache License,
4501
- * Version 2.0 (the "License"); you may not use this file except
4502
- * in compliance with the License.
4503
- * You may obtain a copy of the License at
4504
- *
4505
- * http://www.apache.org/licenses/LICENSE-2.0
4506
- *
4507
- * Unless required by applicable law or agreed to in writing,
4508
- * software distributed under the License is distributed on an
4509
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
4510
- * KIND, either express or implied. See the License for the
4511
- * specific language governing permissions and limitations
4512
- * under the License.
4513
- */
4514
- /**
4515
4205
  * Gets the value at path of object. If the resolved value is undefined,
4516
4206
  * the defaultValue is returned in its place.
4517
4207
  * Similar to Lodash's get() function
@@ -4531,23 +4221,6 @@ var get_default = get;
4531
4221
  //#endregion
4532
4222
  //#region src/utils/startCase.ts
4533
4223
  /**
4534
- * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
4535
- *
4536
- * WSO2 LLC. licenses this file to you under the Apache License,
4537
- * Version 2.0 (the "License"); you may not use this file except
4538
- * in compliance with the License.
4539
- * You may obtain a copy of the License at
4540
- *
4541
- * http://www.apache.org/licenses/LICENSE-2.0
4542
- *
4543
- * Unless required by applicable law or agreed to in writing,
4544
- * software distributed under the License is distributed on an
4545
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
4546
- * KIND, either express or implied. See the License for the
4547
- * specific language governing permissions and limitations
4548
- * under the License.
4549
- */
4550
- /**
4551
4224
  * Converts the first character of `string` to upper case.
4552
4225
  *
4553
4226
  * @param string - The string to convert.
@@ -4572,23 +4245,6 @@ var startCase_default = startCase;
4572
4245
  //#endregion
4573
4246
  //#region src/utils/removeTrailingSlash.ts
4574
4247
  /**
4575
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
4576
- *
4577
- * WSO2 LLC. licenses this file to you under the Apache License,
4578
- * Version 2.0 (the "License"); you may not use this file except
4579
- * in compliance with the License.
4580
- * You may obtain a copy of the License at
4581
- *
4582
- * http://www.apache.org/licenses/LICENSE-2.0
4583
- *
4584
- * Unless required by applicable law or agreed to in writing,
4585
- * software distributed under the License is distributed on an
4586
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
4587
- * KIND, either express or implied. See the License for the
4588
- * specific language governing permissions and limitations
4589
- * under the License.
4590
- */
4591
- /**
4592
4248
  * Removes a trailing slash from a path string if it exists.
4593
4249
  *
4594
4250
  * @param path - The string path to process
@@ -4641,23 +4297,6 @@ function resolveMeta(path, meta) {
4641
4297
  //#endregion
4642
4298
  //#region src/utils/parseFlowTemplateLiteral.ts
4643
4299
  /**
4644
- * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
4645
- *
4646
- * WSO2 LLC. licenses this file to you under the Apache License,
4647
- * Version 2.0 (the "License"); you may not use this file except
4648
- * in compliance with the License.
4649
- * You may obtain a copy of the License at
4650
- *
4651
- * http://www.apache.org/licenses/LICENSE-2.0
4652
- *
4653
- * Unless required by applicable law or agreed to in writing,
4654
- * software distributed under the License is distributed on an
4655
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
4656
- * KIND, either express or implied. See the License for the
4657
- * specific language governing permissions and limitations
4658
- * under the License.
4659
- */
4660
- /**
4661
4300
  * Regular expression to detect a flow template literal wrapped in double braces.
4662
4301
  * Matches patterns like `{{ t(key) }}`, `{{ meta(key) }}`, etc.
4663
4302
  *
@@ -4774,23 +4413,6 @@ function resolveFlowTemplateLiterals(text, { t, meta }) {
4774
4413
  //#endregion
4775
4414
  //#region src/utils/countryCodeToFlagEmoji.ts
4776
4415
  /**
4777
- * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
4778
- *
4779
- * WSO2 LLC. licenses this file to you under the Apache License,
4780
- * Version 2.0 (the "License"); you may not use this file except
4781
- * in compliance with the License.
4782
- * You may obtain a copy of the License at
4783
- *
4784
- * http://www.apache.org/licenses/LICENSE-2.0
4785
- *
4786
- * Unless required by applicable law or agreed to in writing,
4787
- * software distributed under the License is distributed on an
4788
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
4789
- * KIND, either express or implied. See the License for the
4790
- * specific language governing permissions and limitations
4791
- * under the License.
4792
- */
4793
- /**
4794
4416
  * Converts a two-letter ISO 3166-1 alpha-2 country code to a flag emoji using
4795
4417
  * Unicode Regional Indicator Symbols (U+1F1E6–U+1F1FF).
4796
4418
  *
@@ -4804,23 +4426,6 @@ function countryCodeToFlagEmoji(countryCode) {
4804
4426
  //#endregion
4805
4427
  //#region src/utils/resolveLocaleDisplayName.ts
4806
4428
  /**
4807
- * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
4808
- *
4809
- * WSO2 LLC. licenses this file to you under the Apache License,
4810
- * Version 2.0 (the "License"); you may not use this file except
4811
- * in compliance with the License.
4812
- * You may obtain a copy of the License at
4813
- *
4814
- * http://www.apache.org/licenses/LICENSE-2.0
4815
- *
4816
- * Unless required by applicable law or agreed to in writing,
4817
- * software distributed under the License is distributed on an
4818
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
4819
- * KIND, either express or implied. See the License for the
4820
- * specific language governing permissions and limitations
4821
- * under the License.
4822
- */
4823
- /**
4824
4429
  * Resolves a BCP 47 locale tag to a human-readable display name using the
4825
4430
  * `Intl.DisplayNames` API.
4826
4431
  *
@@ -4992,7 +4597,7 @@ var buildValidatorFromRules_default = buildValidatorFromRules;
4992
4597
  * ```typescript
4993
4598
  * // Usage with clsx
4994
4599
  * clsx(withVendorCSSClassPrefix('sign-in-button'), className)
4995
- * // Result: "wso2-sign-in-button"
4600
+ * // Result: "thunderid-sign-in-button"
4996
4601
  * ```
4997
4602
  */
4998
4603
  const withVendorCSSClassPrefix = (className) => `${VendorConstants_default.VENDOR_PREFIX}-${className}`;
@@ -6100,4 +5705,4 @@ const normalizeTranslations = (translations) => {
6100
5705
  var normalizeTranslations_default = normalizeTranslations;
6101
5706
 
6102
5707
  //#endregion
6103
- export { ApplicationNativeAuthenticationConstants_default as ApplicationNativeAuthenticationConstants, AuthenticationHelper_default as AuthenticationHelper, DEFAULT_THEME, DEFAULT_VALIDATION_MESSAGE_KEYS, EMOJI_URI_SCHEME, EmbeddedFlowActionVariant, EmbeddedFlowComponentType, EmbeddedFlowEventType, EmbeddedFlowResponseType, EmbeddedFlowTextVariant, EmbeddedFlowType, EmbeddedRecoveryFlowStatus, EmbeddedRecoveryFlowType, EmbeddedSignInFlowStatus, EmbeddedSignInFlowType, EmbeddedSignUpFlowStatus, EmbeddedSignUpFlowType, FieldType, FlowMetaType, FlowMode, HttpClient, IsomorphicCrypto, OIDCRequestConstants_default as OIDCRequestConstants, StorageManager_default as StorageManager, ThunderIDAPIError, ThunderIDAuthException, ThunderIDError, ThunderIDJavaScriptClient_default as ThunderIDJavaScriptClient, ThunderIDRuntimeError, TokenConstants_default as TokenConstants, TranslationBundleConstants_default as TranslationBundleConstants, VendorConstants_default as VendorConstants, arrayBufferToBase64url_default as arrayBufferToBase64url, base64urlToArrayBuffer_default as base64urlToArrayBuffer, bem_default as bem, buildValidatorFromRules_default as buildValidatorFromRules, configure as configureLogger, countryCodeToFlagEmoji, createComponentLogger, createLogger, createPackageComponentLogger, createPackageLogger, createTheme_default as createTheme, debug, deepMerge_default as deepMerge, error, evaluateValidationRule_default as evaluateValidationRule, executeEmbeddedRecoveryFlow_default as executeEmbeddedRecoveryFlow, executeEmbeddedSignInFlow_default as executeEmbeddedSignInFlow, executeEmbeddedSignUpFlow_default as executeEmbeddedSignUpFlow, executeEmbeddedUserOnboardingFlow_default as executeEmbeddedUserOnboardingFlow, extractEmojiFromUri_default as extractEmojiFromUri, extractPkceStorageKeyFromState_default as extractPkceStorageKeyFromState, extractUserClaimsFromIdToken_default as extractUserClaimsFromIdToken, formatDate_default as formatDate, generateFlattenedUserProfile_default as generateFlattenedUserProfile, get_default as get, getDefaultI18nBundles_default as getDefaultI18nBundles, getFlowMeta_default as getFlowMeta, getLatestStateParam_default as getLatestStateParam, getOrganizationUnitChildren_default as getOrganizationUnitChildren, getRedirectBasedSignUpUrl_default as getRedirectBasedSignUpUrl, getUserInfo_default as getUserInfo, getUsersMe_default as getUsersMe, getVendorPrefix_default as getVendorPrefix, info, isEmojiUri_default as isEmojiUri, isEmpty_default as isEmpty, isRecognizedBaseUrlPattern_default as isRecognizedBaseUrlPattern, logger_default as logger, normalizeTranslations_default as normalizeTranslations, processOpenIDScopes_default as processOpenIDScopes, processUsername_default as processUsername, removeTrailingSlash_default as removeTrailingSlash, resolveFieldName_default as resolveFieldName, resolveFlowTemplateLiterals, resolveLocaleDisplayName, resolveLocaleEmoji_default as resolveLocaleEmoji, resolveMeta, set_default as set, startCase_default as startCase, updateMeProfile_default as updateMeProfile, warn, withVendorCSSClassPrefix_default as withVendorCSSClassPrefix };
5708
+ export { ApplicationNativeAuthenticationConstants_default as ApplicationNativeAuthenticationConstants, AuthenticationHelper_default as AuthenticationHelper, DEFAULT_THEME, DEFAULT_VALIDATION_MESSAGE_KEYS, EMOJI_URI_SCHEME, EmbeddedFlowActionVariant, EmbeddedFlowComponentType, EmbeddedFlowEventType, EmbeddedFlowResponseType, EmbeddedFlowTextVariant, EmbeddedFlowType, EmbeddedRecoveryFlowStatus, EmbeddedRecoveryFlowType, EmbeddedSignInFlowStatus, EmbeddedSignInFlowType, EmbeddedSignUpFlowStatus, EmbeddedSignUpFlowType, FieldType, FlowMetaType, FlowMode, HttpClient, IsomorphicCrypto, OIDCRequestConstants_default as OIDCRequestConstants, StorageManager_default as StorageManager, ThunderIDAPIError, ThunderIDAuthException, ThunderIDError, ThunderIDJavaScriptClient_default as ThunderIDJavaScriptClient, ThunderIDRuntimeError, TokenConstants_default as TokenConstants, TranslationBundleConstants_default as TranslationBundleConstants, VendorConstants_default as VendorConstants, arrayBufferToBase64url_default as arrayBufferToBase64url, base64urlToArrayBuffer_default as base64urlToArrayBuffer, bem_default as bem, buildValidatorFromRules_default as buildValidatorFromRules, configure as configureLogger, countryCodeToFlagEmoji, createComponentLogger, createLogger, createPackageComponentLogger, createPackageLogger, createTheme_default as createTheme, debug, deepMerge_default as deepMerge, error, evaluateValidationRule_default as evaluateValidationRule, executeEmbeddedRecoveryFlow_default as executeEmbeddedRecoveryFlow, executeEmbeddedSignInFlow_default as executeEmbeddedSignInFlow, executeEmbeddedSignUpFlow_default as executeEmbeddedSignUpFlow, executeEmbeddedUserOnboardingFlow_default as executeEmbeddedUserOnboardingFlow, extractEmojiFromUri_default as extractEmojiFromUri, extractPkceStorageKeyFromState_default as extractPkceStorageKeyFromState, extractUserClaimsFromIdToken_default as extractUserClaimsFromIdToken, formatDate_default as formatDate, generateFlattenedUserProfile_default as generateFlattenedUserProfile, get_default as get, getDefaultI18nBundles_default as getDefaultI18nBundles, getFlowMeta_default as getFlowMeta, getLatestStateParam_default as getLatestStateParam, getOrganizationUnitChildren_default as getOrganizationUnitChildren, getRedirectBasedSignUpUrl_default as getRedirectBasedSignUpUrl, getUserInfo_default as getUserInfo, getUsersMe_default as getUsersMe, getVendorPrefix_default as getVendorPrefix, info, isEmojiUri_default as isEmojiUri, isEmpty_default as isEmpty, isRecognizedBaseUrlPattern_default as isRecognizedBaseUrlPattern, logger_default as logger, normalizeTranslations_default as normalizeTranslations, processOpenIDScopes_default as processOpenIDScopes, processUsername_default as processUsername, removeTrailingSlash_default as removeTrailingSlash, resolveFieldName_default as resolveFieldName, resolveFlowTemplateLiterals, resolveLocaleDisplayName, resolveLocaleEmoji_default as resolveLocaleEmoji, resolveMeta, resolveResourceEndpoint_default as resolveResourceEndpoint, set_default as set, startCase_default as startCase, updateMeProfile_default as updateMeProfile, warn, withVendorCSSClassPrefix_default as withVendorCSSClassPrefix };