@asgardeo/javascript 0.8.1 → 0.8.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.
- package/dist/cjs/index.js +75 -1
- package/dist/cjs/index.js.map +3 -3
- package/dist/index.d.ts +4 -1
- package/dist/index.js +72 -1
- package/dist/index.js.map +3 -3
- package/dist/models/config.d.ts +41 -1
- package/dist/utils/v2/countryCodeToFlagEmoji.d.ts +25 -0
- package/dist/utils/v2/resolveLocaleDisplayName.d.ts +29 -0
- package/dist/utils/v2/resolveLocaleEmoji.d.ts +30 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export { FlowMetaType, ApplicationMetadata, OUMetadata, DesignMetadata, I18nMeta
|
|
|
53
53
|
export { EmbeddedFlowType, EmbeddedFlowStatus, EmbeddedFlowExecuteResponse, EmbeddedFlowResponseType, EmbeddedSignUpFlowData, EmbeddedFlowComponent, EmbeddedFlowComponentType, EmbeddedFlowExecuteRequestPayload, EmbeddedFlowExecuteRequestConfig, EmbeddedFlowExecuteErrorResponse, } from './models/embedded-flow';
|
|
54
54
|
export { FlowMode } from './models/flow';
|
|
55
55
|
export { AsgardeoClient } from './models/client';
|
|
56
|
-
export { BaseConfig, Config, Preferences, ThemePreferences, I18nPreferences, WithPreferences, SignInOptions, SignOutOptions, SignUpOptions, } from './models/config';
|
|
56
|
+
export { BaseConfig, Config, Preferences, ThemePreferences, I18nPreferences, I18nStorageStrategy, WithPreferences, SignInOptions, SignOutOptions, SignUpOptions, } from './models/config';
|
|
57
57
|
export { TokenResponse, IdToken, TokenExchangeRequestConfig } from './models/token';
|
|
58
58
|
export { AgentConfig } from './models/agent';
|
|
59
59
|
export { AuthCodeResponse } from './models/auth-code-response';
|
|
@@ -98,6 +98,9 @@ export { default as resolveFieldType } from './utils/resolveFieldType';
|
|
|
98
98
|
export { default as resolveFieldName } from './utils/resolveFieldName';
|
|
99
99
|
export { default as resolveMeta } from './utils/v2/resolveMeta';
|
|
100
100
|
export { default as resolveVars } from './utils/v2/resolveVars';
|
|
101
|
+
export { default as countryCodeToFlagEmoji } from './utils/v2/countryCodeToFlagEmoji';
|
|
102
|
+
export { default as resolveLocaleDisplayName } from './utils/v2/resolveLocaleDisplayName';
|
|
103
|
+
export { default as resolveLocaleEmoji } from './utils/v2/resolveLocaleEmoji';
|
|
101
104
|
export { default as processOpenIDScopes } from './utils/processOpenIDScopes';
|
|
102
105
|
export { default as withVendorCSSClassPrefix } from './utils/withVendorCSSClassPrefix';
|
|
103
106
|
export { default as transformBrandingPreferenceToTheme } from './utils/transformBrandingPreferenceToTheme';
|
package/dist/index.js
CHANGED
|
@@ -3455,7 +3455,7 @@ var DefaultCrypto = class {
|
|
|
3455
3455
|
const key = await jose.importJWK(jwk);
|
|
3456
3456
|
await jose.jwtVerify(idToken, key, {
|
|
3457
3457
|
algorithms,
|
|
3458
|
-
audience: clientId,
|
|
3458
|
+
audience: [clientId],
|
|
3459
3459
|
clockTolerance,
|
|
3460
3460
|
issuer: validateJwtIssuer ? issuer : void 0,
|
|
3461
3461
|
subject
|
|
@@ -4916,6 +4916,74 @@ function resolveVars(text, { t, meta }) {
|
|
|
4916
4916
|
});
|
|
4917
4917
|
}
|
|
4918
4918
|
|
|
4919
|
+
// src/utils/v2/countryCodeToFlagEmoji.ts
|
|
4920
|
+
function countryCodeToFlagEmoji(countryCode) {
|
|
4921
|
+
return countryCode.toUpperCase().split("").map((char) => String.fromCodePoint(127462 - 65 + char.charCodeAt(0))).join("");
|
|
4922
|
+
}
|
|
4923
|
+
|
|
4924
|
+
// src/utils/v2/resolveLocaleDisplayName.ts
|
|
4925
|
+
function resolveLocaleDisplayName(locale, displayLocale) {
|
|
4926
|
+
try {
|
|
4927
|
+
const displayNames = new Intl.DisplayNames([displayLocale], { type: "language" });
|
|
4928
|
+
return displayNames.of(locale) ?? locale;
|
|
4929
|
+
} catch {
|
|
4930
|
+
return locale;
|
|
4931
|
+
}
|
|
4932
|
+
}
|
|
4933
|
+
|
|
4934
|
+
// src/utils/v2/resolveLocaleEmoji.ts
|
|
4935
|
+
var LANGUAGE_TO_COUNTRY = {
|
|
4936
|
+
am: "ET",
|
|
4937
|
+
ar: "SA",
|
|
4938
|
+
bn: "BD",
|
|
4939
|
+
cs: "CZ",
|
|
4940
|
+
da: "DK",
|
|
4941
|
+
de: "DE",
|
|
4942
|
+
el: "GR",
|
|
4943
|
+
en: "GB",
|
|
4944
|
+
es: "ES",
|
|
4945
|
+
fa: "IR",
|
|
4946
|
+
fi: "FI",
|
|
4947
|
+
fr: "FR",
|
|
4948
|
+
he: "IL",
|
|
4949
|
+
hi: "IN",
|
|
4950
|
+
hu: "HU",
|
|
4951
|
+
id: "ID",
|
|
4952
|
+
it: "IT",
|
|
4953
|
+
ja: "JP",
|
|
4954
|
+
ko: "KR",
|
|
4955
|
+
ml: "IN",
|
|
4956
|
+
ms: "MY",
|
|
4957
|
+
nl: "NL",
|
|
4958
|
+
no: "NO",
|
|
4959
|
+
pl: "PL",
|
|
4960
|
+
pt: "PT",
|
|
4961
|
+
ro: "RO",
|
|
4962
|
+
ru: "RU",
|
|
4963
|
+
si: "LK",
|
|
4964
|
+
sk: "SK",
|
|
4965
|
+
sv: "SE",
|
|
4966
|
+
sw: "KE",
|
|
4967
|
+
ta: "IN",
|
|
4968
|
+
th: "TH",
|
|
4969
|
+
tr: "TR",
|
|
4970
|
+
uk: "UA",
|
|
4971
|
+
ur: "PK",
|
|
4972
|
+
vi: "VN",
|
|
4973
|
+
zh: "CN"
|
|
4974
|
+
};
|
|
4975
|
+
function resolveLocaleEmoji(locale) {
|
|
4976
|
+
const parts = locale.split("-");
|
|
4977
|
+
const languageCode = parts[0].toLowerCase();
|
|
4978
|
+
const countrySubtag = parts.length > 1 ? parts[parts.length - 1].toUpperCase() : void 0;
|
|
4979
|
+
const countryCode = countrySubtag ?? LANGUAGE_TO_COUNTRY[languageCode];
|
|
4980
|
+
if (!countryCode || countryCode.length !== 2) {
|
|
4981
|
+
return "\u{1F310}";
|
|
4982
|
+
}
|
|
4983
|
+
return countryCodeToFlagEmoji(countryCode);
|
|
4984
|
+
}
|
|
4985
|
+
var resolveLocaleEmoji_default = resolveLocaleEmoji;
|
|
4986
|
+
|
|
4919
4987
|
// src/utils/withVendorCSSClassPrefix.ts
|
|
4920
4988
|
var withVendorCSSClassPrefix = (className) => `${VendorConstants_default.VENDOR_PREFIX}-${className}`;
|
|
4921
4989
|
var withVendorCSSClassPrefix_default = withVendorCSSClassPrefix;
|
|
@@ -5099,6 +5167,7 @@ export {
|
|
|
5099
5167
|
base64urlToArrayBuffer_default as base64urlToArrayBuffer,
|
|
5100
5168
|
bem_default as bem,
|
|
5101
5169
|
configure as configureLogger,
|
|
5170
|
+
countryCodeToFlagEmoji,
|
|
5102
5171
|
createComponentLogger,
|
|
5103
5172
|
createLogger,
|
|
5104
5173
|
createOrganization_default as createOrganization,
|
|
@@ -5143,6 +5212,8 @@ export {
|
|
|
5143
5212
|
removeTrailingSlash_default as removeTrailingSlash,
|
|
5144
5213
|
resolveFieldName_default as resolveFieldName,
|
|
5145
5214
|
resolveFieldType_default as resolveFieldType,
|
|
5215
|
+
resolveLocaleDisplayName,
|
|
5216
|
+
resolveLocaleEmoji_default as resolveLocaleEmoji,
|
|
5146
5217
|
resolveMeta,
|
|
5147
5218
|
resolveVars,
|
|
5148
5219
|
set_default as set,
|