@thunderid/javascript 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/dist/DefaultCacheStore.d.ts +31 -0
- package/dist/DefaultCacheStore.d.ts.map +1 -0
- package/dist/DefaultCrypto.d.ts +30 -0
- package/dist/DefaultCrypto.d.ts.map +1 -0
- package/dist/HttpClient.d.ts +65 -0
- package/dist/HttpClient.d.ts.map +1 -0
- package/dist/IsomorphicCrypto.d.ts +64 -0
- package/dist/IsomorphicCrypto.d.ts.map +1 -0
- package/dist/StorageManager.d.ts +66 -0
- package/dist/StorageManager.d.ts.map +1 -0
- package/dist/ThunderIDJavaScriptClient.d.ts +66 -0
- package/dist/ThunderIDJavaScriptClient.d.ts.map +1 -0
- package/dist/__legacy__/client.d.ts +485 -0
- package/dist/__legacy__/client.d.ts.map +1 -0
- package/dist/__legacy__/helpers/authentication-helper.d.ts +38 -0
- package/dist/__legacy__/helpers/authentication-helper.d.ts.map +1 -0
- package/dist/__legacy__/helpers/index.d.ts +19 -0
- package/dist/__legacy__/helpers/index.d.ts.map +1 -0
- package/dist/__legacy__/models/client-config.d.ts +106 -0
- package/dist/__legacy__/models/client-config.d.ts.map +1 -0
- package/dist/__legacy__/models/index.d.ts +19 -0
- package/dist/__legacy__/models/index.d.ts.map +1 -0
- package/dist/api/createOrganization.d.ts +130 -0
- package/dist/api/createOrganization.d.ts.map +1 -0
- package/dist/api/executeEmbeddedSignInFlow.d.ts +22 -0
- package/dist/api/executeEmbeddedSignInFlow.d.ts.map +1 -0
- package/dist/api/executeEmbeddedSignUpFlow.d.ts +45 -0
- package/dist/api/executeEmbeddedSignUpFlow.d.ts.map +1 -0
- package/dist/api/getAllOrganizations.d.ts +104 -0
- package/dist/api/getAllOrganizations.d.ts.map +1 -0
- package/dist/api/getBrandingPreference.d.ts +104 -0
- package/dist/api/getBrandingPreference.d.ts.map +1 -0
- package/dist/api/getMeOrganizations.d.ts +120 -0
- package/dist/api/getMeOrganizations.d.ts.map +1 -0
- package/dist/api/getOrganization.d.ts +110 -0
- package/dist/api/getOrganization.d.ts.map +1 -0
- package/dist/api/getSchemas.d.ts +90 -0
- package/dist/api/getSchemas.d.ts.map +1 -0
- package/dist/api/getScim2Me.d.ts +90 -0
- package/dist/api/getScim2Me.d.ts.map +1 -0
- package/dist/api/getUserInfo.d.ts +38 -0
- package/dist/api/getUserInfo.d.ts.map +1 -0
- package/dist/api/initializeEmbeddedSignInFlow.d.ts +52 -0
- package/dist/api/initializeEmbeddedSignInFlow.d.ts.map +1 -0
- package/dist/api/updateMeProfile.d.ts +83 -0
- package/dist/api/updateMeProfile.d.ts.map +1 -0
- package/dist/api/updateOrganization.d.ts +119 -0
- package/dist/api/updateOrganization.d.ts.map +1 -0
- package/dist/api/v2/executeEmbeddedRecoveryFlowV2.d.ts +57 -0
- package/dist/api/v2/executeEmbeddedRecoveryFlowV2.d.ts.map +1 -0
- package/dist/api/v2/executeEmbeddedSignInFlowV2.d.ts +22 -0
- package/dist/api/v2/executeEmbeddedSignInFlowV2.d.ts.map +1 -0
- package/dist/api/v2/executeEmbeddedSignUpFlowV2.d.ts +22 -0
- package/dist/api/v2/executeEmbeddedSignUpFlowV2.d.ts.map +1 -0
- package/dist/api/v2/executeEmbeddedUserOnboardingFlowV2.d.ts +89 -0
- package/dist/api/v2/executeEmbeddedUserOnboardingFlowV2.d.ts.map +1 -0
- package/dist/api/v2/getFlowMetaV2.d.ts +56 -0
- package/dist/api/v2/getFlowMetaV2.d.ts.map +1 -0
- package/dist/api/v2/getOrganizationUnitChildren.d.ts +43 -0
- package/dist/api/v2/getOrganizationUnitChildren.d.ts.map +1 -0
- package/dist/cjs/index.cjs +7693 -0
- package/dist/constants/ApplicationNativeAuthenticationConstants.d.ts +40 -0
- package/dist/constants/ApplicationNativeAuthenticationConstants.d.ts.map +1 -0
- package/dist/constants/OIDCDiscoveryConstants.d.ts +65 -0
- package/dist/constants/OIDCDiscoveryConstants.d.ts.map +1 -0
- package/dist/constants/OIDCRequestConstants.d.ts +43 -0
- package/dist/constants/OIDCRequestConstants.d.ts.map +1 -0
- package/dist/constants/PKCEConstants.d.ts +45 -0
- package/dist/constants/PKCEConstants.d.ts.map +1 -0
- package/dist/constants/ScopeConstants.d.ts +43 -0
- package/dist/constants/ScopeConstants.d.ts.map +1 -0
- package/dist/constants/TokenConstants.d.ts +48 -0
- package/dist/constants/TokenConstants.d.ts.map +1 -0
- package/dist/constants/TokenExchangeConstants.d.ts +44 -0
- package/dist/constants/TokenExchangeConstants.d.ts.map +1 -0
- package/dist/constants/VendorConstants.d.ts +32 -0
- package/dist/constants/VendorConstants.d.ts.map +1 -0
- package/dist/constants/v2/OIDCDiscoveryConstants.d.ts +40 -0
- package/dist/constants/v2/OIDCDiscoveryConstants.d.ts.map +1 -0
- package/dist/edge/index.js +7568 -0
- package/dist/errors/ThunderIDAPIError.d.ts +59 -0
- package/dist/errors/ThunderIDAPIError.d.ts.map +1 -0
- package/dist/errors/ThunderIDError.d.ts +50 -0
- package/dist/errors/ThunderIDError.d.ts.map +1 -0
- package/dist/errors/ThunderIDRuntimeError.d.ts +51 -0
- package/dist/errors/ThunderIDRuntimeError.d.ts.map +1 -0
- package/dist/errors/exception.d.ts +27 -0
- package/dist/errors/exception.d.ts.map +1 -0
- package/dist/i18n/constants/TranslationBundleConstants.d.ts +35 -0
- package/dist/i18n/constants/TranslationBundleConstants.d.ts.map +1 -0
- package/dist/i18n/models/i18n.d.ts +127 -0
- package/dist/i18n/models/i18n.d.ts.map +1 -0
- package/dist/i18n/translations/en-US.d.ts +21 -0
- package/dist/i18n/translations/en-US.d.ts.map +1 -0
- package/dist/i18n/translations/fr-FR.d.ts +21 -0
- package/dist/i18n/translations/fr-FR.d.ts.map +1 -0
- package/dist/i18n/translations/hi-IN.d.ts +21 -0
- package/dist/i18n/translations/hi-IN.d.ts.map +1 -0
- package/dist/i18n/translations/index.d.ts +26 -0
- package/dist/i18n/translations/index.d.ts.map +1 -0
- package/dist/i18n/translations/ja-JP.d.ts +21 -0
- package/dist/i18n/translations/ja-JP.d.ts.map +1 -0
- package/dist/i18n/translations/pt-BR.d.ts +21 -0
- package/dist/i18n/translations/pt-BR.d.ts.map +1 -0
- package/dist/i18n/translations/pt-PT.d.ts +21 -0
- package/dist/i18n/translations/pt-PT.d.ts.map +1 -0
- package/dist/i18n/translations/si-LK.d.ts +21 -0
- package/dist/i18n/translations/si-LK.d.ts.map +1 -0
- package/dist/i18n/translations/ta-IN.d.ts +21 -0
- package/dist/i18n/translations/ta-IN.d.ts.map +1 -0
- package/dist/i18n/translations/te-IN.d.ts +21 -0
- package/dist/i18n/translations/te-IN.d.ts.map +1 -0
- package/dist/i18n/utils/getDefaultI18nBundles.d.ts +28 -0
- package/dist/i18n/utils/getDefaultI18nBundles.d.ts.map +1 -0
- package/dist/i18n/utils/normalizeTranslations.d.ts +42 -0
- package/dist/i18n/utils/normalizeTranslations.d.ts.map +1 -0
- package/dist/index.d.ts +143 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7568 -0
- package/dist/models/agent.d.ts +45 -0
- package/dist/models/agent.d.ts.map +1 -0
- package/dist/models/auth-code-response.d.ts +35 -0
- package/dist/models/auth-code-response.d.ts.map +1 -0
- package/dist/models/branding-preference.d.ts +249 -0
- package/dist/models/branding-preference.d.ts.map +1 -0
- package/dist/models/client.d.ts +213 -0
- package/dist/models/client.d.ts.map +1 -0
- package/dist/models/config.d.ts +483 -0
- package/dist/models/config.d.ts.map +1 -0
- package/dist/models/crypto.d.ts +101 -0
- package/dist/models/crypto.d.ts.map +1 -0
- package/dist/models/embedded-flow.d.ts +167 -0
- package/dist/models/embedded-flow.d.ts.map +1 -0
- package/dist/models/embedded-signin-flow.d.ts +100 -0
- package/dist/models/embedded-signin-flow.d.ts.map +1 -0
- package/dist/models/field.d.ts +32 -0
- package/dist/models/field.d.ts.map +1 -0
- package/dist/models/flow.d.ts +31 -0
- package/dist/models/flow.d.ts.map +1 -0
- package/dist/models/http.d.ts +46 -0
- package/dist/models/http.d.ts.map +1 -0
- package/dist/models/oauth-request.d.ts +24 -0
- package/dist/models/oauth-request.d.ts.map +1 -0
- package/dist/models/oauth-response.d.ts +19 -0
- package/dist/models/oauth-response.d.ts.map +1 -0
- package/dist/models/oidc-discovery.d.ts +370 -0
- package/dist/models/oidc-discovery.d.ts.map +1 -0
- package/dist/models/oidc-endpoints.d.ts +72 -0
- package/dist/models/oidc-endpoints.d.ts.map +1 -0
- package/dist/models/organization.d.ts +34 -0
- package/dist/models/organization.d.ts.map +1 -0
- package/dist/models/platforms.d.ts +38 -0
- package/dist/models/platforms.d.ts.map +1 -0
- package/dist/models/scim2-schema.d.ts +66 -0
- package/dist/models/scim2-schema.d.ts.map +1 -0
- package/dist/models/session.d.ts +32 -0
- package/dist/models/session.d.ts.map +1 -0
- package/dist/models/store.d.ts +84 -0
- package/dist/models/store.d.ts.map +1 -0
- package/dist/models/token-endpoint-auth.d.ts +30 -0
- package/dist/models/token-endpoint-auth.d.ts.map +1 -0
- package/dist/models/token.d.ts +181 -0
- package/dist/models/token.d.ts.map +1 -0
- package/dist/models/user.d.ts +34 -0
- package/dist/models/user.d.ts.map +1 -0
- package/dist/models/utility-types.d.ts +21 -0
- package/dist/models/utility-types.d.ts.map +1 -0
- package/dist/models/v2/embedded-flow-v2.d.ts +494 -0
- package/dist/models/v2/embedded-flow-v2.d.ts.map +1 -0
- package/dist/models/v2/embedded-recovery-flow-v2.d.ts +143 -0
- package/dist/models/v2/embedded-recovery-flow-v2.d.ts.map +1 -0
- package/dist/models/v2/embedded-signin-flow-v2.d.ts +340 -0
- package/dist/models/v2/embedded-signin-flow-v2.d.ts.map +1 -0
- package/dist/models/v2/embedded-signup-flow-v2.d.ts +272 -0
- package/dist/models/v2/embedded-signup-flow-v2.d.ts.map +1 -0
- package/dist/models/v2/extensions/components.d.ts +89 -0
- package/dist/models/v2/extensions/components.d.ts.map +1 -0
- package/dist/models/v2/flow-meta-v2.d.ts +299 -0
- package/dist/models/v2/flow-meta-v2.d.ts.map +1 -0
- package/dist/models/v2/organization-unit.d.ts +103 -0
- package/dist/models/v2/organization-unit.d.ts.map +1 -0
- package/dist/models/v2/translation.d.ts +35 -0
- package/dist/models/v2/translation.d.ts.map +1 -0
- package/dist/models/v2/vars.d.ts +36 -0
- package/dist/models/v2/vars.d.ts.map +1 -0
- package/dist/theme/createTheme.d.ts +23 -0
- package/dist/theme/createTheme.d.ts.map +1 -0
- package/dist/theme/types.d.ts +381 -0
- package/dist/theme/types.d.ts.map +1 -0
- package/dist/utils/arrayBufferToBase64url.d.ts +49 -0
- package/dist/utils/arrayBufferToBase64url.d.ts.map +1 -0
- package/dist/utils/base64Encode.d.ts +36 -0
- package/dist/utils/base64Encode.d.ts.map +1 -0
- package/dist/utils/base64urlToArrayBuffer.d.ts +56 -0
- package/dist/utils/base64urlToArrayBuffer.d.ts.map +1 -0
- package/dist/utils/bem.d.ts +47 -0
- package/dist/utils/bem.d.ts.map +1 -0
- package/dist/utils/deepMerge.d.ts +45 -0
- package/dist/utils/deepMerge.d.ts.map +1 -0
- package/dist/utils/deriveOrganizationHandleFromBaseUrl.d.ts +48 -0
- package/dist/utils/deriveOrganizationHandleFromBaseUrl.d.ts.map +1 -0
- package/dist/utils/extractPkceStorageKeyFromState.d.ts +33 -0
- package/dist/utils/extractPkceStorageKeyFromState.d.ts.map +1 -0
- package/dist/utils/extractTenantDomainFromIdTokenPayload.d.ts +32 -0
- package/dist/utils/extractTenantDomainFromIdTokenPayload.d.ts.map +1 -0
- package/dist/utils/extractUserClaimsFromIdToken.d.ts +47 -0
- package/dist/utils/extractUserClaimsFromIdToken.d.ts.map +1 -0
- package/dist/utils/flattenUserSchema.d.ts +65 -0
- package/dist/utils/flattenUserSchema.d.ts.map +1 -0
- package/dist/utils/formatDate.d.ts +34 -0
- package/dist/utils/formatDate.d.ts.map +1 -0
- package/dist/utils/generateFlattenedUserProfile.d.ts +54 -0
- package/dist/utils/generateFlattenedUserProfile.d.ts.map +1 -0
- package/dist/utils/generatePkceStorageKey.d.ts +35 -0
- package/dist/utils/generatePkceStorageKey.d.ts.map +1 -0
- package/dist/utils/generateStateParamForRequestCorrelation.d.ts +35 -0
- package/dist/utils/generateStateParamForRequestCorrelation.d.ts.map +1 -0
- package/dist/utils/generateUserProfile.d.ts +56 -0
- package/dist/utils/generateUserProfile.d.ts.map +1 -0
- package/dist/utils/get.d.ts +30 -0
- package/dist/utils/get.d.ts.map +1 -0
- package/dist/utils/getAuthorizeRequestUrlParams.d.ts +61 -0
- package/dist/utils/getAuthorizeRequestUrlParams.d.ts.map +1 -0
- package/dist/utils/getLatestStateParam.d.ts +41 -0
- package/dist/utils/getLatestStateParam.d.ts.map +1 -0
- package/dist/utils/getRedirectBasedSignUpUrl.d.ts +30 -0
- package/dist/utils/getRedirectBasedSignUpUrl.d.ts.map +1 -0
- package/dist/utils/identifyPlatform.d.ts +31 -0
- package/dist/utils/identifyPlatform.d.ts.map +1 -0
- package/dist/utils/isEmpty.d.ts +49 -0
- package/dist/utils/isEmpty.d.ts.map +1 -0
- package/dist/utils/isRecognizedBaseUrlPattern.d.ts +33 -0
- package/dist/utils/isRecognizedBaseUrlPattern.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +143 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/parseApiErrorMessage.d.ts +29 -0
- package/dist/utils/parseApiErrorMessage.d.ts.map +1 -0
- package/dist/utils/processOpenIDScopes.d.ts +42 -0
- package/dist/utils/processOpenIDScopes.d.ts.map +1 -0
- package/dist/utils/processUsername.d.ts +74 -0
- package/dist/utils/processUsername.d.ts.map +1 -0
- package/dist/utils/removeTrailingSlash.d.ts +32 -0
- package/dist/utils/removeTrailingSlash.d.ts.map +1 -0
- package/dist/utils/resolveFieldName.d.ts +20 -0
- package/dist/utils/resolveFieldName.d.ts.map +1 -0
- package/dist/utils/resolveFieldType.d.ts +21 -0
- package/dist/utils/resolveFieldType.d.ts.map +1 -0
- package/dist/utils/set.d.ts +31 -0
- package/dist/utils/set.d.ts.map +1 -0
- package/dist/utils/transformBrandingPreferenceToTheme.d.ts +49 -0
- package/dist/utils/transformBrandingPreferenceToTheme.d.ts.map +1 -0
- package/dist/utils/v2/containsMetaFlowTemplateLiteral.d.ts +57 -0
- package/dist/utils/v2/containsMetaFlowTemplateLiteral.d.ts.map +1 -0
- package/dist/utils/v2/countryCodeToFlagEmoji.d.ts +26 -0
- package/dist/utils/v2/countryCodeToFlagEmoji.d.ts.map +1 -0
- package/dist/utils/v2/extractEmojiFromUri.d.ts +32 -0
- package/dist/utils/v2/extractEmojiFromUri.d.ts.map +1 -0
- package/dist/utils/v2/isEmojiUri.d.ts +34 -0
- package/dist/utils/v2/isEmojiUri.d.ts.map +1 -0
- package/dist/utils/v2/isMetaFlowTemplateLiteral.d.ts +45 -0
- package/dist/utils/v2/isMetaFlowTemplateLiteral.d.ts.map +1 -0
- package/dist/utils/v2/isTranslationFlowTemplateLiteral.d.ts +45 -0
- package/dist/utils/v2/isTranslationFlowTemplateLiteral.d.ts.map +1 -0
- package/dist/utils/v2/parseFlowTemplateLiteral.d.ts +96 -0
- package/dist/utils/v2/parseFlowTemplateLiteral.d.ts.map +1 -0
- package/dist/utils/v2/resolveFlowTemplateLiterals.d.ts +42 -0
- package/dist/utils/v2/resolveFlowTemplateLiterals.d.ts.map +1 -0
- package/dist/utils/v2/resolveLocaleDisplayName.d.ts +30 -0
- package/dist/utils/v2/resolveLocaleDisplayName.d.ts.map +1 -0
- package/dist/utils/v2/resolveLocaleEmoji.d.ts +31 -0
- package/dist/utils/v2/resolveLocaleEmoji.d.ts.map +1 -0
- package/dist/utils/v2/resolveMeta.d.ts +35 -0
- package/dist/utils/v2/resolveMeta.d.ts.map +1 -0
- package/dist/utils/withVendorCSSClassPrefix.d.ts +33 -0
- package/dist/utils/withVendorCSSClassPrefix.d.ts.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Check whether a string contains a `{{ meta(key) }}` flow template literal anywhere within it.
|
|
20
|
+
*
|
|
21
|
+
* Unlike {@link isMetaFlowTemplateLiteral}, which requires the **entire** string to be the
|
|
22
|
+
* template, this function detects the pattern embedded inside a larger string such as an
|
|
23
|
+
* HTML label or sentence.
|
|
24
|
+
*
|
|
25
|
+
* Whitespace around `{{` / `}}` is allowed, e.g. `{{ meta(application.signUpUrl) }}`.
|
|
26
|
+
*
|
|
27
|
+
* @param str - The string to search (may be a plain value or an HTML fragment).
|
|
28
|
+
* @param key - The meta path to look for, e.g. `"application.signUpUrl"`.
|
|
29
|
+
* @returns `true` if the pattern is found anywhere in `str`, `false` otherwise.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* containsMetaFlowTemplateLiteral('<a href="{{meta(application.signUpUrl)}}">Sign up</a>', 'application.signUpUrl')
|
|
34
|
+
* // true
|
|
35
|
+
*
|
|
36
|
+
* containsMetaFlowTemplateLiteral('<a href="https://example.com">Sign up</a>', 'application.signUpUrl')
|
|
37
|
+
* // false
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export default function containsMetaFlowTemplateLiteral(str: string, key: string): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Replace all occurrences of `{{ meta(key) }}` (with optional whitespace) in `str`
|
|
43
|
+
* with `replacement`.
|
|
44
|
+
*
|
|
45
|
+
* @param str - The source string.
|
|
46
|
+
* @param key - The meta path to replace, e.g. `"application.signUpUrl"`.
|
|
47
|
+
* @param replacement - The value to substitute for each match.
|
|
48
|
+
* @returns A new string with all occurrences replaced.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* replaceMetaFlowTemplateLiteral('Sign up at {{ meta(application.signUpUrl) }}', 'application.signUpUrl', 'https://example.com')
|
|
53
|
+
* // 'Sign up at https://example.com'
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare function replaceMetaFlowTemplateLiteral(str: string, key: string, replacement: string): string;
|
|
57
|
+
//# sourceMappingURL=containsMetaFlowTemplateLiteral.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"containsMetaFlowTemplateLiteral.d.ts","sourceRoot":"","sources":["../../../src/utils/v2/containsMetaFlowTemplateLiteral.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAYH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,OAAO,UAAU,+BAA+B,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAEzF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAKpG"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Converts a two-letter ISO 3166-1 alpha-2 country code to a flag emoji using
|
|
20
|
+
* Unicode Regional Indicator Symbols (U+1F1E6–U+1F1FF).
|
|
21
|
+
*
|
|
22
|
+
* @param countryCode - Two-letter uppercase country code (e.g. "US", "GB")
|
|
23
|
+
* @returns Flag emoji string (e.g. "🇺🇸", "🇬🇧")
|
|
24
|
+
*/
|
|
25
|
+
export default function countryCodeToFlagEmoji(countryCode: string): string;
|
|
26
|
+
//# sourceMappingURL=countryCodeToFlagEmoji.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"countryCodeToFlagEmoji.d.ts","sourceRoot":"","sources":["../../../src/utils/v2/countryCodeToFlagEmoji.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAM1E"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Extracts the emoji character from an `emoji:` URI.
|
|
20
|
+
*
|
|
21
|
+
* @param uri - A URI string in the form `"emoji:<emoji>"`.
|
|
22
|
+
* @returns The emoji character, or an empty string if the URI is not a valid emoji URI.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* extractEmojiFromUri("emoji:🐯"); // "🐯"
|
|
27
|
+
* extractEmojiFromUri("https://example.com"); // ""
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
declare const extractEmojiFromUri: (uri: string) => string;
|
|
31
|
+
export default extractEmojiFromUri;
|
|
32
|
+
//# sourceMappingURL=extractEmojiFromUri.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractEmojiFromUri.d.ts","sourceRoot":"","sources":["../../../src/utils/v2/extractEmojiFromUri.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,mBAAmB,GAAI,KAAK,MAAM,KAAG,MAM1C,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
export declare const EMOJI_URI_SCHEME = "emoji:";
|
|
19
|
+
/**
|
|
20
|
+
* Checks whether a given URI uses the `emoji:` scheme (e.g. `"emoji:🐯"`).
|
|
21
|
+
*
|
|
22
|
+
* @param uri - The URI string to check.
|
|
23
|
+
* @returns `true` if the URI starts with `"emoji:"`, `false` otherwise.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* isEmojiUri("emoji:🐯"); // true
|
|
28
|
+
* isEmojiUri("https://example.com/logo.png"); // false
|
|
29
|
+
* isEmojiUri(""); // false
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
declare const isEmojiUri: (uri: string) => boolean;
|
|
33
|
+
export default isEmojiUri;
|
|
34
|
+
//# sourceMappingURL=isEmojiUri.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isEmojiUri.d.ts","sourceRoot":"","sources":["../../../src/utils/v2/isEmojiUri.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,eAAO,MAAM,gBAAgB,WAAW,CAAC;AAEzC;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,UAAU,GAAI,KAAK,MAAM,KAAG,OAAsE,CAAC;AAEzG,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Regular expression to match a meta flow template literal `{{meta(key)}}` (exact, full-string match).
|
|
20
|
+
* Optional whitespace around `{{` / `}}` is allowed.
|
|
21
|
+
*/
|
|
22
|
+
export declare const META_FLOW_TEMPLATE_LITERAL_PATTERN: RegExp;
|
|
23
|
+
/**
|
|
24
|
+
* Regular expression to extract the path from a meta flow template literal `{{meta(path)}}`.
|
|
25
|
+
*/
|
|
26
|
+
export declare const META_FLOW_TEMPLATE_LITERAL_KEY_PATTERN: RegExp;
|
|
27
|
+
/**
|
|
28
|
+
* Check if a string is exactly a meta flow template literal (`{{ meta(path) }}`).
|
|
29
|
+
*
|
|
30
|
+
* This checks that the **entire** string is the template pattern. Use
|
|
31
|
+
* {@link FLOW_TEMPLATE_LITERAL_REGEX} from `parseFlowTemplateLiteral` to detect
|
|
32
|
+
* templates embedded inside a larger string.
|
|
33
|
+
*
|
|
34
|
+
* @param value - The string to test.
|
|
35
|
+
* @returns `true` if the trimmed value matches the pattern, `false` otherwise.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* isMetaFlowTemplateLiteral('{{ meta(application.name) }}') // true
|
|
40
|
+
* isMetaFlowTemplateLiteral('hello world') // false
|
|
41
|
+
* isMetaFlowTemplateLiteral('Login to {{ meta(app.name) }}') // false — embedded, not exact
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export default function isMetaFlowTemplateLiteral(value: string): boolean;
|
|
45
|
+
//# sourceMappingURL=isMetaFlowTemplateLiteral.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isMetaFlowTemplateLiteral.d.ts","sourceRoot":"","sources":["../../../src/utils/v2/isMetaFlowTemplateLiteral.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;GAGG;AACH,eAAO,MAAM,kCAAkC,QAAkC,CAAC;AAElF;;GAEG;AACH,eAAO,MAAM,sCAAsC,QAAoC,CAAC;AAExF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAExE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Regular expression to match a translation flow template literal `{{t(key)}}` (exact, full-string match).
|
|
20
|
+
* Optional whitespace around `{{` / `}}` is allowed.
|
|
21
|
+
*/
|
|
22
|
+
export declare const TRANSLATION_FLOW_TEMPLATE_LITERAL_PATTERN: RegExp;
|
|
23
|
+
/**
|
|
24
|
+
* Regular expression to extract the key from a translation flow template literal `{{t(key)}}`.
|
|
25
|
+
*/
|
|
26
|
+
export declare const TRANSLATION_FLOW_TEMPLATE_LITERAL_KEY_PATTERN: RegExp;
|
|
27
|
+
/**
|
|
28
|
+
* Check if a string is exactly a translation flow template literal (`{{ t(key) }}`).
|
|
29
|
+
*
|
|
30
|
+
* This checks that the **entire** string is the template pattern. Use
|
|
31
|
+
* {@link FLOW_TEMPLATE_LITERAL_REGEX} from `parseFlowTemplateLiteral` to detect
|
|
32
|
+
* templates embedded inside a larger string.
|
|
33
|
+
*
|
|
34
|
+
* @param value - The string to test.
|
|
35
|
+
* @returns `true` if the trimmed value matches the pattern, `false` otherwise.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* isTranslationFlowTemplateLiteral('{{ t(signin:heading) }}') // true
|
|
40
|
+
* isTranslationFlowTemplateLiteral('hello world') // false
|
|
41
|
+
* isTranslationFlowTemplateLiteral('Login via {{ t(key) }}') // false — embedded, not exact
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export default function isTranslationFlowTemplateLiteral(value: string): boolean;
|
|
45
|
+
//# sourceMappingURL=isTranslationFlowTemplateLiteral.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isTranslationFlowTemplateLiteral.d.ts","sourceRoot":"","sources":["../../../src/utils/v2/isTranslationFlowTemplateLiteral.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;GAGG;AACH,eAAO,MAAM,yCAAyC,QAA+B,CAAC;AAEtF;;GAEG;AACH,eAAO,MAAM,6CAA6C,QAAiC,CAAC;AAE5F;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,OAAO,UAAU,gCAAgC,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE/E"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Regular expression to detect a flow template literal wrapped in double braces.
|
|
20
|
+
* Matches patterns like `{{ t(key) }}`, `{{ meta(key) }}`, etc.
|
|
21
|
+
*
|
|
22
|
+
* Note: this regex has no `g` flag — use `new RegExp(FLOW_TEMPLATE_LITERAL_REGEX.source, 'g')`
|
|
23
|
+
* when global replacement is needed (e.g. in resolveFlowTemplateLiterals).
|
|
24
|
+
*/
|
|
25
|
+
export declare const FLOW_TEMPLATE_LITERAL_REGEX: RegExp;
|
|
26
|
+
/**
|
|
27
|
+
* Regular expression to parse a function-call expression inside flow template braces.
|
|
28
|
+
* Matches `funcName(arg)` and captures the function name and argument.
|
|
29
|
+
*/
|
|
30
|
+
export declare const FLOW_TEMPLATE_FUNCTION_REGEX: RegExp;
|
|
31
|
+
/**
|
|
32
|
+
* Flow template literal types supported by the SDK.
|
|
33
|
+
*
|
|
34
|
+
* Values correspond to the function name used in the template expression,
|
|
35
|
+
* so that a `{ t }` object from `useTranslation()` can be passed directly
|
|
36
|
+
* as a handler map.
|
|
37
|
+
*/
|
|
38
|
+
export declare enum FlowTemplateLiteralType {
|
|
39
|
+
/** Meta template literal — `{{ meta(path) }}` — resolves against flow/page metadata */
|
|
40
|
+
META = "meta",
|
|
41
|
+
/** Translation template literal — `{{ t(key) }}` */
|
|
42
|
+
TRANSLATION = "t",
|
|
43
|
+
/** Unknown or unsupported template literal format */
|
|
44
|
+
UNKNOWN = "unknown"
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Result of parsing a flow template literal.
|
|
48
|
+
*/
|
|
49
|
+
export interface FlowTemplateLiteralResult {
|
|
50
|
+
/**
|
|
51
|
+
* The extracted key or path from the template literal.
|
|
52
|
+
* e.g. `"signin:heading"` from `"{{ t(signin:heading) }}"`.
|
|
53
|
+
*/
|
|
54
|
+
key?: string;
|
|
55
|
+
/** The original template literal content before parsing */
|
|
56
|
+
originalValue: string;
|
|
57
|
+
/** The type of flow template literal that was detected */
|
|
58
|
+
type: FlowTemplateLiteralType;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Map of handler functions keyed by {@link FlowTemplateLiteralType}.
|
|
62
|
+
*
|
|
63
|
+
* When provided to a resolver, the matching handler is called with the extracted key.
|
|
64
|
+
* Because `FlowTemplateLiteralType.TRANSLATION === 't'`, you can pass the `{ t }` object
|
|
65
|
+
* from `useTranslation()` directly.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* const { t } = useTranslation();
|
|
70
|
+
* // handler map: { t: (key) => string }
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export type FlowTemplateLiteralHandlers = Partial<Record<FlowTemplateLiteralType, (key: string) => string>>;
|
|
74
|
+
/**
|
|
75
|
+
* Parse a flow template literal content string and extract its type and key.
|
|
76
|
+
*
|
|
77
|
+
* Supports function-call expressions like:
|
|
78
|
+
* - `t(signin:heading)` → type `TRANSLATION`, key `"signin:heading"`
|
|
79
|
+
* - `meta(application.name)` → type `META`, key `"application.name"`
|
|
80
|
+
*
|
|
81
|
+
* Surrounding quotes on the key argument are stripped automatically.
|
|
82
|
+
*
|
|
83
|
+
* @param content - The content inside the template literal braces (without `{{ }}`).
|
|
84
|
+
* @returns Parsed flow template literal information.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```typescript
|
|
88
|
+
* parseFlowTemplateLiteral('t(signin:heading)')
|
|
89
|
+
* // { type: FlowTemplateLiteralType.TRANSLATION, key: 'signin:heading', originalValue: 't(signin:heading)' }
|
|
90
|
+
*
|
|
91
|
+
* parseFlowTemplateLiteral('meta(application.name)')
|
|
92
|
+
* // { type: FlowTemplateLiteralType.META, key: 'application.name', originalValue: 'meta(application.name)' }
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
export default function parseFlowTemplateLiteral(content: string): FlowTemplateLiteralResult;
|
|
96
|
+
//# sourceMappingURL=parseFlowTemplateLiteral.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseFlowTemplateLiteral.d.ts","sourceRoot":"","sources":["../../../src/utils/v2/parseFlowTemplateLiteral.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,QAA0B,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,4BAA4B,QAAuB,CAAC;AAEjE;;;;;;GAMG;AACH,oBAAY,uBAAuB;IACjC,uFAAuF;IACvF,IAAI,SAAS;IACb,oDAAoD;IACpD,WAAW,MAAM;IACjB,qDAAqD;IACrD,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,aAAa,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,IAAI,EAAE,uBAAuB,CAAC;CAC/B;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC,uBAAuB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC;AAE5G;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,yBAAyB,CAmB3F"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import { TranslationFn } from '../../models/v2/translation';
|
|
19
|
+
import { ResolveFlowTemplateLiteralsOptions } from '../../models/v2/vars';
|
|
20
|
+
/**
|
|
21
|
+
* Resolves all flow template literal expressions in a string.
|
|
22
|
+
*
|
|
23
|
+
* Supported patterns:
|
|
24
|
+
* - `{{ t(key) }}` — resolved via the i18n translation function.
|
|
25
|
+
* Colon-separated namespaces are converted to dots:
|
|
26
|
+
* `{{ t(signin:heading.label) }}` → `t('signin.heading.label')`
|
|
27
|
+
* - `{{ meta(path) }}` — resolved via a dot-path lookup on FlowMetadataResponse.
|
|
28
|
+
* `{{ meta(application.name) }}` → `meta.application?.name`
|
|
29
|
+
*
|
|
30
|
+
* Flow template literals can be embedded inside larger strings:
|
|
31
|
+
* `"Login using {{ meta(application.name) }}"` → `"Login using My App"`
|
|
32
|
+
*
|
|
33
|
+
* Unrecognized expressions are left unchanged.
|
|
34
|
+
*
|
|
35
|
+
* @template TFn - The concrete translation function type.
|
|
36
|
+
*
|
|
37
|
+
* @param text - The string to resolve (may contain zero or more flow template literals)
|
|
38
|
+
* @param options - Resolution context: translation function and optional flow metadata
|
|
39
|
+
* @returns The resolved string
|
|
40
|
+
*/
|
|
41
|
+
export default function resolveFlowTemplateLiterals<TFn extends TranslationFn = TranslationFn>(text: string | undefined, { t, meta }: ResolveFlowTemplateLiteralsOptions<TFn>): string;
|
|
42
|
+
//# sourceMappingURL=resolveFlowTemplateLiterals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveFlowTemplateLiterals.d.ts","sourceRoot":"","sources":["../../../src/utils/v2/resolveFlowTemplateLiterals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAQH,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAC,kCAAkC,EAAC,MAAM,sBAAsB,CAAC;AAOxE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,OAAO,UAAU,2BAA2B,CAAC,GAAG,SAAS,aAAa,GAAG,aAAa,EAC3F,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,EAAC,CAAC,EAAE,IAAI,EAAC,EAAE,kCAAkC,CAAC,GAAG,CAAC,GACjD,MAAM,CAoBR"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Resolves a BCP 47 locale tag to a human-readable display name using the
|
|
20
|
+
* `Intl.DisplayNames` API.
|
|
21
|
+
*
|
|
22
|
+
* Falls back to the raw locale code if the runtime does not support
|
|
23
|
+
* `Intl.DisplayNames` or if resolution returns `undefined`.
|
|
24
|
+
*
|
|
25
|
+
* @param locale - BCP 47 locale tag to resolve (e.g. "en", "fr", "zh-Hant")
|
|
26
|
+
* @param displayLocale - Locale used for the display name language (defaults to "en")
|
|
27
|
+
* @returns Human-readable language name (e.g. "English", "French")
|
|
28
|
+
*/
|
|
29
|
+
export default function resolveLocaleDisplayName(locale: string, displayLocale: string): string;
|
|
30
|
+
//# sourceMappingURL=resolveLocaleDisplayName.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveLocaleDisplayName.d.ts","sourceRoot":"","sources":["../../../src/utils/v2/resolveLocaleDisplayName.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAO9F"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Resolves a BCP 47 locale tag to a flag emoji.
|
|
20
|
+
*
|
|
21
|
+
* Resolution order:
|
|
22
|
+
* 1. Country subtag when present (e.g. `"en-US"` → 🇺🇸)
|
|
23
|
+
* 2. Language-to-country fallback map (e.g. `"en"` → 🇬🇧)
|
|
24
|
+
* 3. Globe emoji 🌐 for unrecognised codes
|
|
25
|
+
*
|
|
26
|
+
* @param locale - BCP 47 locale tag (e.g. "en", "en-US", "fr-CA")
|
|
27
|
+
* @returns Flag or globe emoji string
|
|
28
|
+
*/
|
|
29
|
+
declare function resolveLocaleEmoji(locale: string): string;
|
|
30
|
+
export default resolveLocaleEmoji;
|
|
31
|
+
//# sourceMappingURL=resolveLocaleEmoji.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveLocaleEmoji.d.ts","sourceRoot":"","sources":["../../../src/utils/v2/resolveLocaleEmoji.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAiDH;;;;;;;;;;GAUG;AACH,iBAAS,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAYlD;AACD,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import { FlowMetadataResponse } from '../../models/v2/flow-meta-v2';
|
|
19
|
+
/**
|
|
20
|
+
* Resolves a dot-path expression against a FlowMetadataResponse object.
|
|
21
|
+
*
|
|
22
|
+
* Supports both camelCase paths (e.g. `logoUrl`) and snake_case API responses
|
|
23
|
+
* (e.g. `logo_url`). When a camelCase segment is not found directly, the
|
|
24
|
+
* function falls back to its snake_case equivalent.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* resolveMeta('application.name', meta) // → 'My App'
|
|
28
|
+
* resolveMeta('ou.name', meta) // → 'My Org'
|
|
29
|
+
*
|
|
30
|
+
* @param path - Dot-separated path into the meta object (e.g. 'application.name')
|
|
31
|
+
* @param meta - The FlowMetadataResponse to look up
|
|
32
|
+
* @returns The resolved string value, or empty string if not found
|
|
33
|
+
*/
|
|
34
|
+
export default function resolveMeta(path: string, meta: FlowMetadataResponse): string;
|
|
35
|
+
//# sourceMappingURL=resolveMeta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveMeta.d.ts","sourceRoot":"","sources":["../../../src/utils/v2/resolveMeta.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,oBAAoB,EAAC,MAAM,8BAA8B,CAAC;AAElE;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,GAAG,MAAM,CAapF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Adds a vendor-specific prefix to a CSS class name.
|
|
20
|
+
*
|
|
21
|
+
* @param className - The original CSS class name to be prefixed
|
|
22
|
+
* @returns A new string with the vendor prefix added to the class name
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* // Usage with clsx
|
|
27
|
+
* clsx(withVendorCSSClassPrefix('sign-in-button'), className)
|
|
28
|
+
* // Result: "wso2-sign-in-button"
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
declare const withVendorCSSClassPrefix: (className: string) => string;
|
|
32
|
+
export default withVendorCSSClassPrefix;
|
|
33
|
+
//# sourceMappingURL=withVendorCSSClassPrefix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withVendorCSSClassPrefix.d.ts","sourceRoot":"","sources":["../../src/utils/withVendorCSSClassPrefix.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,wBAAwB,GAAI,WAAW,MAAM,KAAG,MAAyD,CAAC;AAEhH,eAAe,wBAAwB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@thunderid/javascript",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "JavaScript Ecosystem SDK for ThunderID",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"thunderid",
|
|
7
|
+
"javascript",
|
|
8
|
+
"javascript-ecosystem",
|
|
9
|
+
"agnostic",
|
|
10
|
+
"js"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://github.com/thunder-id/thunderid/tree/main/sdks/javascript#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/thunder-id/thunderid/issues"
|
|
15
|
+
},
|
|
16
|
+
"author": "WSO2",
|
|
17
|
+
"license": "Apache-2.0",
|
|
18
|
+
"type": "module",
|
|
19
|
+
"main": "dist/cjs/index.cjs",
|
|
20
|
+
"module": "dist/index.js",
|
|
21
|
+
"exports": {
|
|
22
|
+
"edge-light": "./dist/edge/index.js",
|
|
23
|
+
"import": "./dist/index.js",
|
|
24
|
+
"require": "./dist/cjs/index.cjs"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist",
|
|
28
|
+
"README.md",
|
|
29
|
+
"LICENSE"
|
|
30
|
+
],
|
|
31
|
+
"types": "dist/index.d.ts",
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/thunder-id/thunderid",
|
|
35
|
+
"directory": "sdks/javascript"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/node": "24.7.2",
|
|
39
|
+
"eslint": "9.39.4",
|
|
40
|
+
"prettier": "3.6.2",
|
|
41
|
+
"rimraf": "6.1.3",
|
|
42
|
+
"rolldown": "1.0.0-beta.45",
|
|
43
|
+
"typescript": "5.9.3",
|
|
44
|
+
"vitest": "4.1.3",
|
|
45
|
+
"@thunderid/eslint-plugin": "^0.0.0",
|
|
46
|
+
"@thunderid/prettier-config": "^0.0.0"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"jose": "5.2.0",
|
|
50
|
+
"tslib": "2.8.1"
|
|
51
|
+
},
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"access": "public"
|
|
54
|
+
},
|
|
55
|
+
"scripts": {
|
|
56
|
+
"build": "pnpm clean && rolldown -c rolldown.config.js && tsc -p tsconfig.lib.json --emitDeclarationOnly --outDir dist",
|
|
57
|
+
"clean": "rimraf dist",
|
|
58
|
+
"format:check": "prettier --check --cache .",
|
|
59
|
+
"format:fix": "prettier --write --cache .",
|
|
60
|
+
"lint": "eslint . --ext .js,.jsx,.ts,.tsx,.cjs,.mjs",
|
|
61
|
+
"lint:fix": "eslint . --fix --ext .js,.jsx,.ts,.tsx,.cjs,.mjs",
|
|
62
|
+
"test": "vitest",
|
|
63
|
+
"typecheck": "tsc -p tsconfig.lib.json"
|
|
64
|
+
}
|
|
65
|
+
}
|