@asgardeo/javascript 0.9.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +55 -23
- package/dist/cjs/index.js.map +3 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +51 -22
- package/dist/index.js.map +3 -3
- package/dist/models/v2/embedded-flow-v2.d.ts +64 -1
- package/dist/models/v2/vars.d.ts +2 -2
- package/dist/utils/v2/containsMetaFlowTemplateLiteral.d.ts +56 -0
- package/dist/utils/v2/extractEmojiFromUri.d.ts +31 -0
- package/dist/utils/v2/isEmojiUri.d.ts +33 -0
- package/dist/utils/v2/isMetaFlowTemplateLiteral.d.ts +44 -0
- package/dist/utils/v2/isTranslationFlowTemplateLiteral.d.ts +44 -0
- package/dist/utils/v2/parseFlowTemplateLiteral.d.ts +95 -0
- package/dist/utils/v2/{resolveVars.d.ts → resolveFlowTemplateLiterals.d.ts} +6 -6
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export { AsgardeoAuthException } from './errors/exception';
|
|
|
46
46
|
export { AllOrganizationsApiResponse } from './models/organization';
|
|
47
47
|
export { Platform } from './models/platforms';
|
|
48
48
|
export { EmbeddedSignInFlowInitiateResponse, EmbeddedSignInFlowStatus, EmbeddedSignInFlowType, EmbeddedSignInFlowStepType, EmbeddedSignInFlowAuthenticator, EmbeddedSignInFlowLink, EmbeddedSignInFlowHandleRequestPayload, EmbeddedSignInFlowHandleResponse, EmbeddedSignInFlowAuthenticatorParamType, EmbeddedSignInFlowAuthenticatorPromptType, EmbeddedSignInFlowAuthenticatorKnownIdPType, } from './models/embedded-signin-flow';
|
|
49
|
-
export { EmbeddedFlowComponentType as EmbeddedFlowComponentTypeV2, EmbeddedFlowActionVariant as EmbeddedFlowActionVariantV2, EmbeddedFlowTextVariant as EmbeddedFlowTextVariantV2, EmbeddedFlowEventType as EmbeddedFlowEventTypeV2, EmbeddedFlowComponent as EmbeddedFlowComponentV2, EmbeddedFlowResponseData as EmbeddedFlowResponseDataV2, EmbeddedFlowExecuteRequestConfig as EmbeddedFlowExecuteRequestConfigV2, } from './models/v2/embedded-flow-v2';
|
|
49
|
+
export { EmbeddedFlowComponentType as EmbeddedFlowComponentTypeV2, EmbeddedFlowActionVariant as EmbeddedFlowActionVariantV2, EmbeddedFlowTextVariant as EmbeddedFlowTextVariantV2, EmbeddedFlowEventType as EmbeddedFlowEventTypeV2, EmbeddedFlowComponent as EmbeddedFlowComponentV2, EmbeddedFlowResponseData as EmbeddedFlowResponseDataV2, EmbeddedFlowExecuteRequestConfig as EmbeddedFlowExecuteRequestConfigV2, ConsentAttributeElement as ConsentAttributeElementV2, ConsentPurposeDecision as ConsentPurposeDecisionV2, ConsentDecisions as ConsentDecisionsV2, ConsentPurposeData as ConsentPurposeDataV2, ConsentPromptData as ConsentPromptDataV2, } from './models/v2/embedded-flow-v2';
|
|
50
50
|
export { EmbeddedSignInFlowStatus as EmbeddedSignInFlowStatusV2, EmbeddedSignInFlowType as EmbeddedSignInFlowTypeV2, ExtendedEmbeddedSignInFlowResponse as ExtendedEmbeddedSignInFlowResponseV2, EmbeddedSignInFlowResponse as EmbeddedSignInFlowResponseV2, EmbeddedSignInFlowCompleteResponse as EmbeddedSignInFlowCompleteResponseV2, EmbeddedSignInFlowInitiateRequest as EmbeddedSignInFlowInitiateRequestV2, EmbeddedSignInFlowRequest as EmbeddedSignInFlowRequestV2, } from './models/v2/embedded-signin-flow-v2';
|
|
51
51
|
export { EmbeddedSignUpFlowStatus as EmbeddedSignUpFlowStatusV2, EmbeddedSignUpFlowType as EmbeddedSignUpFlowTypeV2, ExtendedEmbeddedSignUpFlowResponse as ExtendedEmbeddedSignUpFlowResponseV2, EmbeddedSignUpFlowResponse as EmbeddedSignUpFlowResponseV2, EmbeddedSignUpFlowCompleteResponse as EmbeddedSignUpFlowCompleteResponseV2, EmbeddedSignUpFlowInitiateRequest as EmbeddedSignUpFlowInitiateRequestV2, EmbeddedSignUpFlowRequest as EmbeddedSignUpFlowRequestV2, EmbeddedSignUpFlowErrorResponse as EmbeddedSignUpFlowErrorResponseV2, } from './models/v2/embedded-signup-flow-v2';
|
|
52
52
|
export { FlowMetaType, ApplicationMetadata, OUMetadata, DesignMetadata, I18nMetadata, FlowMetadataResponse, GetFlowMetaRequestConfig, FlowMetaTheme, FlowMetaThemeColorSet, FlowMetaThemeBackground, FlowMetaThemeTextColors, FlowMetaThemeColors, FlowMetaThemeColorScheme, FlowMetaThemeShape, FlowMetaThemeTypography, } from './models/v2/flow-meta-v2';
|
|
@@ -66,7 +66,7 @@ export { User, UserProfile } from './models/user';
|
|
|
66
66
|
export { SessionData } from './models/session';
|
|
67
67
|
export { Organization } from './models/organization';
|
|
68
68
|
export { TranslationFn } from './models/v2/translation';
|
|
69
|
-
export {
|
|
69
|
+
export { ResolveFlowTemplateLiteralsOptions } from './models/v2/vars';
|
|
70
70
|
export { BrandingPreference, BrandingPreferenceConfig, BrandingLayout, BrandingTheme, ThemeVariant, ButtonsConfig, ColorsConfig, ColorVariants, BrandingOrganizationDetails, UrlsConfig, } from './models/branding-preference';
|
|
71
71
|
export { Schema, SchemaAttribute, WellKnownSchemaIds, FlattenedSchema } from './models/scim2-schema';
|
|
72
72
|
export { RecursivePartial } from './models/utility-types';
|
|
@@ -91,13 +91,15 @@ export { default as generateFlattenedUserProfile } from './utils/generateFlatten
|
|
|
91
91
|
export { default as getRedirectBasedSignUpUrl } from './utils/getRedirectBasedSignUpUrl';
|
|
92
92
|
export { default as identifyPlatform } from './utils/identifyPlatform';
|
|
93
93
|
export { default as isEmpty } from './utils/isEmpty';
|
|
94
|
+
export { default as isEmojiUri, EMOJI_URI_SCHEME } from './utils/v2/isEmojiUri';
|
|
95
|
+
export { default as extractEmojiFromUri } from './utils/v2/extractEmojiFromUri';
|
|
94
96
|
export { default as set } from './utils/set';
|
|
95
97
|
export { default as get } from './utils/get';
|
|
96
98
|
export { default as removeTrailingSlash } from './utils/removeTrailingSlash';
|
|
97
99
|
export { default as resolveFieldType } from './utils/resolveFieldType';
|
|
98
100
|
export { default as resolveFieldName } from './utils/resolveFieldName';
|
|
99
101
|
export { default as resolveMeta } from './utils/v2/resolveMeta';
|
|
100
|
-
export { default as
|
|
102
|
+
export { default as resolveFlowTemplateLiterals } from './utils/v2/resolveFlowTemplateLiterals';
|
|
101
103
|
export { default as countryCodeToFlagEmoji } from './utils/v2/countryCodeToFlagEmoji';
|
|
102
104
|
export { default as resolveLocaleDisplayName } from './utils/v2/resolveLocaleDisplayName';
|
|
103
105
|
export { default as resolveLocaleEmoji } from './utils/v2/resolveLocaleEmoji';
|
package/dist/index.js
CHANGED
|
@@ -3324,6 +3324,7 @@ var EmbeddedSignInFlowAuthenticatorPromptType = /* @__PURE__ */ ((EmbeddedSignIn
|
|
|
3324
3324
|
var EmbeddedFlowComponentType2 = /* @__PURE__ */ ((EmbeddedFlowComponentType3) => {
|
|
3325
3325
|
EmbeddedFlowComponentType3["Action"] = "ACTION";
|
|
3326
3326
|
EmbeddedFlowComponentType3["Block"] = "BLOCK";
|
|
3327
|
+
EmbeddedFlowComponentType3["Consent"] = "CONSENT";
|
|
3327
3328
|
EmbeddedFlowComponentType3["Divider"] = "DIVIDER";
|
|
3328
3329
|
EmbeddedFlowComponentType3["EmailInput"] = "EMAIL_INPUT";
|
|
3329
3330
|
EmbeddedFlowComponentType3["Icon"] = "ICON";
|
|
@@ -3336,6 +3337,7 @@ var EmbeddedFlowComponentType2 = /* @__PURE__ */ ((EmbeddedFlowComponentType3) =
|
|
|
3336
3337
|
EmbeddedFlowComponentType3["Stack"] = "STACK";
|
|
3337
3338
|
EmbeddedFlowComponentType3["Text"] = "TEXT";
|
|
3338
3339
|
EmbeddedFlowComponentType3["TextInput"] = "TEXT_INPUT";
|
|
3340
|
+
EmbeddedFlowComponentType3["Timer"] = "TIMER";
|
|
3339
3341
|
return EmbeddedFlowComponentType3;
|
|
3340
3342
|
})(EmbeddedFlowComponentType2 || {});
|
|
3341
3343
|
var EmbeddedFlowActionVariant = /* @__PURE__ */ ((EmbeddedFlowActionVariant2) => {
|
|
@@ -4867,6 +4869,20 @@ var getRedirectBasedSignUpUrl = (config) => {
|
|
|
4867
4869
|
};
|
|
4868
4870
|
var getRedirectBasedSignUpUrl_default = getRedirectBasedSignUpUrl;
|
|
4869
4871
|
|
|
4872
|
+
// src/utils/v2/isEmojiUri.ts
|
|
4873
|
+
var EMOJI_URI_SCHEME = "emoji:";
|
|
4874
|
+
var isEmojiUri = (uri) => typeof uri === "string" && uri.startsWith(EMOJI_URI_SCHEME);
|
|
4875
|
+
var isEmojiUri_default = isEmojiUri;
|
|
4876
|
+
|
|
4877
|
+
// src/utils/v2/extractEmojiFromUri.ts
|
|
4878
|
+
var extractEmojiFromUri = (uri) => {
|
|
4879
|
+
if (!isEmojiUri_default(uri)) {
|
|
4880
|
+
return "";
|
|
4881
|
+
}
|
|
4882
|
+
return uri.slice(EMOJI_URI_SCHEME.length);
|
|
4883
|
+
};
|
|
4884
|
+
var extractEmojiFromUri_default = extractEmojiFromUri;
|
|
4885
|
+
|
|
4870
4886
|
// src/utils/removeTrailingSlash.ts
|
|
4871
4887
|
var removeTrailingSlash = (path) => path.endsWith("/") ? path.slice(0, -1) : path;
|
|
4872
4888
|
var removeTrailingSlash_default = removeTrailingSlash;
|
|
@@ -4918,30 +4934,40 @@ function resolveMeta(path, meta) {
|
|
|
4918
4934
|
return value != null ? String(value) : "";
|
|
4919
4935
|
}
|
|
4920
4936
|
|
|
4921
|
-
// src/utils/v2/
|
|
4922
|
-
|
|
4937
|
+
// src/utils/v2/parseFlowTemplateLiteral.ts
|
|
4938
|
+
var FLOW_TEMPLATE_LITERAL_REGEX = /\{\{\s*([^}]+)\s*\}\}/;
|
|
4939
|
+
var FLOW_TEMPLATE_FUNCTION_REGEX = /^(\w+)\(([^)]+)\)$/;
|
|
4940
|
+
function parseFlowTemplateLiteral(content) {
|
|
4941
|
+
const originalValue = content;
|
|
4942
|
+
const match = FLOW_TEMPLATE_FUNCTION_REGEX.exec(content);
|
|
4943
|
+
if (!match) {
|
|
4944
|
+
return { originalValue, type: "unknown" /* UNKNOWN */ };
|
|
4945
|
+
}
|
|
4946
|
+
const [, functionName, rawKey] = match;
|
|
4947
|
+
const key = rawKey.trim().replace(/^['"]|['"]$/g, "");
|
|
4948
|
+
switch (functionName) {
|
|
4949
|
+
case "t" /* TRANSLATION */:
|
|
4950
|
+
return { key, originalValue, type: "t" /* TRANSLATION */ };
|
|
4951
|
+
case "meta" /* META */:
|
|
4952
|
+
return { key, originalValue, type: "meta" /* META */ };
|
|
4953
|
+
default:
|
|
4954
|
+
return { originalValue, type: "unknown" /* UNKNOWN */ };
|
|
4955
|
+
}
|
|
4956
|
+
}
|
|
4957
|
+
|
|
4958
|
+
// src/utils/v2/resolveFlowTemplateLiterals.ts
|
|
4959
|
+
var FLOW_TEMPLATE_LITERAL_REGEX_GLOBAL = new RegExp(FLOW_TEMPLATE_LITERAL_REGEX.source, "g");
|
|
4960
|
+
function resolveFlowTemplateLiterals(text, { t, meta }) {
|
|
4923
4961
|
if (!text) {
|
|
4924
4962
|
return "";
|
|
4925
4963
|
}
|
|
4926
|
-
return text.replace(
|
|
4927
|
-
const
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
}
|
|
4934
|
-
return t(key.replace(/:/g, "."));
|
|
4935
|
-
}
|
|
4936
|
-
if (meta) {
|
|
4937
|
-
const metaMatch = trimmed.match(/^meta\((.+)\)$/);
|
|
4938
|
-
if (metaMatch) {
|
|
4939
|
-
let path = metaMatch[1].trim();
|
|
4940
|
-
if (path.startsWith('"') && path.endsWith('"') || path.startsWith("'") && path.endsWith("'")) {
|
|
4941
|
-
path = path.slice(1, -1);
|
|
4942
|
-
}
|
|
4943
|
-
return resolveMeta(path, meta);
|
|
4944
|
-
}
|
|
4964
|
+
return text.replace(FLOW_TEMPLATE_LITERAL_REGEX_GLOBAL, (match, content) => {
|
|
4965
|
+
const parsed = parseFlowTemplateLiteral(content.trim());
|
|
4966
|
+
if (parsed.type === "t" /* TRANSLATION */ && parsed.key) {
|
|
4967
|
+
return t(parsed.key.replace(/:/g, "."));
|
|
4968
|
+
}
|
|
4969
|
+
if (parsed.type === "meta" /* META */ && parsed.key && meta) {
|
|
4970
|
+
return resolveMeta(parsed.key, meta);
|
|
4945
4971
|
}
|
|
4946
4972
|
return match;
|
|
4947
4973
|
});
|
|
@@ -5166,6 +5192,7 @@ export {
|
|
|
5166
5192
|
AsgardeoJavaScriptClient_default as AsgardeoJavaScriptClient,
|
|
5167
5193
|
AsgardeoRuntimeError,
|
|
5168
5194
|
DEFAULT_THEME,
|
|
5195
|
+
EMOJI_URI_SCHEME,
|
|
5169
5196
|
EmbeddedFlowActionVariant as EmbeddedFlowActionVariantV2,
|
|
5170
5197
|
EmbeddedFlowComponentType,
|
|
5171
5198
|
EmbeddedFlowComponentType2 as EmbeddedFlowComponentTypeV2,
|
|
@@ -5215,6 +5242,7 @@ export {
|
|
|
5215
5242
|
executeEmbeddedSignUpFlow_default as executeEmbeddedSignUpFlow,
|
|
5216
5243
|
executeEmbeddedSignUpFlowV2_default as executeEmbeddedSignUpFlowV2,
|
|
5217
5244
|
executeEmbeddedUserOnboardingFlowV2_default as executeEmbeddedUserOnboardingFlowV2,
|
|
5245
|
+
extractEmojiFromUri_default as extractEmojiFromUri,
|
|
5218
5246
|
extractPkceStorageKeyFromState_default as extractPkceStorageKeyFromState,
|
|
5219
5247
|
extractUserClaimsFromIdToken_default as extractUserClaimsFromIdToken,
|
|
5220
5248
|
flattenUserSchema_default as flattenUserSchema,
|
|
@@ -5235,6 +5263,7 @@ export {
|
|
|
5235
5263
|
identifyPlatform_default as identifyPlatform,
|
|
5236
5264
|
info,
|
|
5237
5265
|
initializeEmbeddedSignInFlow_default as initializeEmbeddedSignInFlow,
|
|
5266
|
+
isEmojiUri_default as isEmojiUri,
|
|
5238
5267
|
isEmpty_default as isEmpty,
|
|
5239
5268
|
isRecognizedBaseUrlPattern_default as isRecognizedBaseUrlPattern,
|
|
5240
5269
|
logger_default as logger,
|
|
@@ -5243,10 +5272,10 @@ export {
|
|
|
5243
5272
|
removeTrailingSlash_default as removeTrailingSlash,
|
|
5244
5273
|
resolveFieldName_default as resolveFieldName,
|
|
5245
5274
|
resolveFieldType_default as resolveFieldType,
|
|
5275
|
+
resolveFlowTemplateLiterals,
|
|
5246
5276
|
resolveLocaleDisplayName,
|
|
5247
5277
|
resolveLocaleEmoji_default as resolveLocaleEmoji,
|
|
5248
5278
|
resolveMeta,
|
|
5249
|
-
resolveVars,
|
|
5250
5279
|
set_default as set,
|
|
5251
5280
|
transformBrandingPreferenceToTheme_default as transformBrandingPreferenceToTheme,
|
|
5252
5281
|
updateMeProfile_default as updateMeProfile,
|