@asgardeo/javascript 0.2.9 → 0.2.11
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/api/v2/executeEmbeddedSignInFlowV2.d.ts +2 -1
- package/dist/api/v2/executeEmbeddedSignUpFlowV2.d.ts +2 -1
- package/dist/cjs/index.js +115 -52
- package/dist/cjs/index.js.map +4 -4
- package/dist/index.d.ts +3 -2
- package/dist/index.js +111 -52
- package/dist/index.js.map +4 -4
- package/dist/models/embedded-flow.d.ts +1 -1
- package/dist/models/v2/embedded-flow-v2.d.ts +307 -0
- package/dist/models/v2/embedded-signin-flow-v2.d.ts +261 -31
- package/dist/models/v2/embedded-signup-flow-v2.d.ts +91 -57
- package/package.json +2 -2
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import { EmbeddedFlowExecuteRequestConfigV2
|
|
18
|
+
import { EmbeddedFlowExecuteRequestConfig as EmbeddedFlowExecuteRequestConfigV2 } from '../../models/v2/embedded-flow-v2';
|
|
19
|
+
import { EmbeddedSignInFlowResponse as EmbeddedSignInFlowResponseV2 } from '../../models/v2/embedded-signin-flow-v2';
|
|
19
20
|
declare const executeEmbeddedSignInFlowV2: ({ url, baseUrl, payload, authId, ...requestConfig }: EmbeddedFlowExecuteRequestConfigV2) => Promise<EmbeddedSignInFlowResponseV2>;
|
|
20
21
|
export default executeEmbeddedSignInFlowV2;
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import { EmbeddedFlowExecuteRequestConfigV2
|
|
18
|
+
import { EmbeddedFlowExecuteRequestConfig as EmbeddedFlowExecuteRequestConfigV2 } from '../../models/v2/embedded-flow-v2';
|
|
19
|
+
import { EmbeddedSignUpFlowResponse as EmbeddedSignUpFlowResponseV2 } from '../../models/v2/embedded-signup-flow-v2';
|
|
19
20
|
declare const executeEmbeddedSignUpFlowV2: ({ url, baseUrl, payload, authId, ...requestConfig }: EmbeddedFlowExecuteRequestConfigV2) => Promise<EmbeddedSignUpFlowResponseV2>;
|
|
20
21
|
export default executeEmbeddedSignUpFlowV2;
|
package/dist/cjs/index.js
CHANGED
|
@@ -29,20 +29,24 @@ __export(index_exports, {
|
|
|
29
29
|
AsgardeoJavaScriptClient: () => AsgardeoJavaScriptClient_default,
|
|
30
30
|
AsgardeoRuntimeError: () => AsgardeoRuntimeError,
|
|
31
31
|
DEFAULT_THEME: () => DEFAULT_THEME,
|
|
32
|
+
EmbeddedFlowActionVariantV2: () => EmbeddedFlowActionVariant,
|
|
32
33
|
EmbeddedFlowComponentType: () => EmbeddedFlowComponentType,
|
|
34
|
+
EmbeddedFlowComponentTypeV2: () => EmbeddedFlowComponentType2,
|
|
35
|
+
EmbeddedFlowEventTypeV2: () => EmbeddedFlowEventType,
|
|
33
36
|
EmbeddedFlowResponseType: () => EmbeddedFlowResponseType,
|
|
34
37
|
EmbeddedFlowStatus: () => EmbeddedFlowStatus,
|
|
38
|
+
EmbeddedFlowTextVariantV2: () => EmbeddedFlowTextVariant,
|
|
35
39
|
EmbeddedFlowType: () => EmbeddedFlowType,
|
|
36
40
|
EmbeddedSignInFlowAuthenticatorKnownIdPType: () => EmbeddedSignInFlowAuthenticatorKnownIdPType,
|
|
37
41
|
EmbeddedSignInFlowAuthenticatorParamType: () => EmbeddedSignInFlowAuthenticatorParamType,
|
|
38
42
|
EmbeddedSignInFlowAuthenticatorPromptType: () => EmbeddedSignInFlowAuthenticatorPromptType,
|
|
39
|
-
EmbeddedSignInFlowStatus: () =>
|
|
40
|
-
EmbeddedSignInFlowStatusV2: () =>
|
|
43
|
+
EmbeddedSignInFlowStatus: () => EmbeddedSignInFlowStatus2,
|
|
44
|
+
EmbeddedSignInFlowStatusV2: () => EmbeddedSignInFlowStatus,
|
|
41
45
|
EmbeddedSignInFlowStepType: () => EmbeddedSignInFlowStepType,
|
|
42
|
-
EmbeddedSignInFlowType: () =>
|
|
43
|
-
EmbeddedSignInFlowTypeV2: () =>
|
|
44
|
-
EmbeddedSignUpFlowStatusV2: () =>
|
|
45
|
-
EmbeddedSignUpFlowTypeV2: () =>
|
|
46
|
+
EmbeddedSignInFlowType: () => EmbeddedSignInFlowType2,
|
|
47
|
+
EmbeddedSignInFlowTypeV2: () => EmbeddedSignInFlowType,
|
|
48
|
+
EmbeddedSignUpFlowStatusV2: () => EmbeddedSignUpFlowStatus,
|
|
49
|
+
EmbeddedSignUpFlowTypeV2: () => EmbeddedSignUpFlowType,
|
|
46
50
|
FieldType: () => FieldType,
|
|
47
51
|
FlowMode: () => FlowMode,
|
|
48
52
|
IsomorphicCrypto: () => IsomorphicCrypto,
|
|
@@ -2179,17 +2183,17 @@ var EmbeddedFlowResponseType = /* @__PURE__ */ ((EmbeddedFlowResponseType2) => {
|
|
|
2179
2183
|
EmbeddedFlowResponseType2["View"] = "VIEW";
|
|
2180
2184
|
return EmbeddedFlowResponseType2;
|
|
2181
2185
|
})(EmbeddedFlowResponseType || {});
|
|
2182
|
-
var EmbeddedFlowComponentType = /* @__PURE__ */ ((
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
return
|
|
2186
|
+
var EmbeddedFlowComponentType = /* @__PURE__ */ ((EmbeddedFlowComponentType3) => {
|
|
2187
|
+
EmbeddedFlowComponentType3["Button"] = "BUTTON";
|
|
2188
|
+
EmbeddedFlowComponentType3["Checkbox"] = "CHECKBOX";
|
|
2189
|
+
EmbeddedFlowComponentType3["Divider"] = "DIVIDER";
|
|
2190
|
+
EmbeddedFlowComponentType3["Form"] = "FORM";
|
|
2191
|
+
EmbeddedFlowComponentType3["Image"] = "IMAGE";
|
|
2192
|
+
EmbeddedFlowComponentType3["Input"] = "INPUT";
|
|
2193
|
+
EmbeddedFlowComponentType3["Radio"] = "RADIO";
|
|
2194
|
+
EmbeddedFlowComponentType3["Select"] = "SELECT";
|
|
2195
|
+
EmbeddedFlowComponentType3["Typography"] = "TYPOGRAPHY";
|
|
2196
|
+
return EmbeddedFlowComponentType3;
|
|
2193
2197
|
})(EmbeddedFlowComponentType || {});
|
|
2194
2198
|
|
|
2195
2199
|
// src/api/executeEmbeddedSignUpFlow.ts
|
|
@@ -2973,17 +2977,17 @@ var getBrandingPreference = async ({
|
|
|
2973
2977
|
var getBrandingPreference_default = getBrandingPreference;
|
|
2974
2978
|
|
|
2975
2979
|
// src/models/v2/embedded-signin-flow-v2.ts
|
|
2976
|
-
var
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
return
|
|
2981
|
-
})(
|
|
2982
|
-
var
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
return
|
|
2986
|
-
})(
|
|
2980
|
+
var EmbeddedSignInFlowStatus = /* @__PURE__ */ ((EmbeddedSignInFlowStatus3) => {
|
|
2981
|
+
EmbeddedSignInFlowStatus3["Complete"] = "COMPLETE";
|
|
2982
|
+
EmbeddedSignInFlowStatus3["Incomplete"] = "INCOMPLETE";
|
|
2983
|
+
EmbeddedSignInFlowStatus3["Error"] = "ERROR";
|
|
2984
|
+
return EmbeddedSignInFlowStatus3;
|
|
2985
|
+
})(EmbeddedSignInFlowStatus || {});
|
|
2986
|
+
var EmbeddedSignInFlowType = /* @__PURE__ */ ((EmbeddedSignInFlowType3) => {
|
|
2987
|
+
EmbeddedSignInFlowType3["Redirection"] = "REDIRECTION";
|
|
2988
|
+
EmbeddedSignInFlowType3["View"] = "VIEW";
|
|
2989
|
+
return EmbeddedSignInFlowType3;
|
|
2990
|
+
})(EmbeddedSignInFlowType || {});
|
|
2987
2991
|
|
|
2988
2992
|
// src/api/v2/executeEmbeddedSignInFlowV2.ts
|
|
2989
2993
|
var executeEmbeddedSignInFlowV2 = async ({
|
|
@@ -3003,6 +3007,10 @@ var executeEmbeddedSignInFlowV2 = async ({
|
|
|
3003
3007
|
);
|
|
3004
3008
|
}
|
|
3005
3009
|
let endpoint = url ?? `${baseUrl}/flow/execute`;
|
|
3010
|
+
const cleanPayload = typeof payload === "object" && payload !== null ? Object.fromEntries(Object.entries(payload).filter(([key]) => key !== "verbose")) : payload;
|
|
3011
|
+
const hasOnlyAppIdAndFlowType = typeof cleanPayload === "object" && cleanPayload !== null && "applicationId" in cleanPayload && "flowType" in cleanPayload && Object.keys(cleanPayload).length === 2;
|
|
3012
|
+
const hasOnlyFlowId = typeof cleanPayload === "object" && cleanPayload !== null && "flowId" in cleanPayload && Object.keys(cleanPayload).length === 1;
|
|
3013
|
+
const requestPayload = hasOnlyAppIdAndFlowType || hasOnlyFlowId ? { ...cleanPayload, verbose: true } : cleanPayload;
|
|
3006
3014
|
const response = await fetch(endpoint, {
|
|
3007
3015
|
...requestConfig,
|
|
3008
3016
|
method: requestConfig.method || "POST",
|
|
@@ -3011,7 +3019,7 @@ var executeEmbeddedSignInFlowV2 = async ({
|
|
|
3011
3019
|
Accept: "application/json",
|
|
3012
3020
|
...requestConfig.headers
|
|
3013
3021
|
},
|
|
3014
|
-
body: JSON.stringify(
|
|
3022
|
+
body: JSON.stringify(requestPayload)
|
|
3015
3023
|
});
|
|
3016
3024
|
if (!response.ok) {
|
|
3017
3025
|
const errorText = await response.text();
|
|
@@ -3069,17 +3077,17 @@ var executeEmbeddedSignInFlowV2 = async ({
|
|
|
3069
3077
|
var executeEmbeddedSignInFlowV2_default = executeEmbeddedSignInFlowV2;
|
|
3070
3078
|
|
|
3071
3079
|
// src/models/v2/embedded-signup-flow-v2.ts
|
|
3072
|
-
var
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
return
|
|
3077
|
-
})(
|
|
3078
|
-
var
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
return
|
|
3082
|
-
})(
|
|
3080
|
+
var EmbeddedSignUpFlowStatus = /* @__PURE__ */ ((EmbeddedSignUpFlowStatus2) => {
|
|
3081
|
+
EmbeddedSignUpFlowStatus2["Complete"] = "COMPLETE";
|
|
3082
|
+
EmbeddedSignUpFlowStatus2["Incomplete"] = "INCOMPLETE";
|
|
3083
|
+
EmbeddedSignUpFlowStatus2["Error"] = "ERROR";
|
|
3084
|
+
return EmbeddedSignUpFlowStatus2;
|
|
3085
|
+
})(EmbeddedSignUpFlowStatus || {});
|
|
3086
|
+
var EmbeddedSignUpFlowType = /* @__PURE__ */ ((EmbeddedSignUpFlowType2) => {
|
|
3087
|
+
EmbeddedSignUpFlowType2["Redirection"] = "REDIRECTION";
|
|
3088
|
+
EmbeddedSignUpFlowType2["View"] = "VIEW";
|
|
3089
|
+
return EmbeddedSignUpFlowType2;
|
|
3090
|
+
})(EmbeddedSignUpFlowType || {});
|
|
3083
3091
|
|
|
3084
3092
|
// src/api/v2/executeEmbeddedSignUpFlowV2.ts
|
|
3085
3093
|
var executeEmbeddedSignUpFlowV2 = async ({
|
|
@@ -3099,6 +3107,10 @@ var executeEmbeddedSignUpFlowV2 = async ({
|
|
|
3099
3107
|
);
|
|
3100
3108
|
}
|
|
3101
3109
|
let endpoint = url ?? `${baseUrl}/flow/execute`;
|
|
3110
|
+
const cleanPayload = typeof payload === "object" && payload !== null ? Object.fromEntries(Object.entries(payload).filter(([key]) => key !== "verbose")) : payload;
|
|
3111
|
+
const hasOnlyAppIdAndFlowType = typeof cleanPayload === "object" && cleanPayload !== null && "applicationId" in cleanPayload && "flowType" in cleanPayload && Object.keys(cleanPayload).length === 2;
|
|
3112
|
+
const hasOnlyFlowId = typeof cleanPayload === "object" && cleanPayload !== null && "flowId" in cleanPayload && Object.keys(cleanPayload).length === 1;
|
|
3113
|
+
const requestPayload = hasOnlyAppIdAndFlowType || hasOnlyFlowId ? { ...cleanPayload, verbose: true } : cleanPayload;
|
|
3102
3114
|
const response = await fetch(endpoint, {
|
|
3103
3115
|
...requestConfig,
|
|
3104
3116
|
method: requestConfig.method || "POST",
|
|
@@ -3107,7 +3119,7 @@ var executeEmbeddedSignUpFlowV2 = async ({
|
|
|
3107
3119
|
Accept: "application/json",
|
|
3108
3120
|
...requestConfig.headers
|
|
3109
3121
|
},
|
|
3110
|
-
body: JSON.stringify(
|
|
3122
|
+
body: JSON.stringify(requestPayload)
|
|
3111
3123
|
});
|
|
3112
3124
|
if (!response.ok) {
|
|
3113
3125
|
const errorText = await response.text();
|
|
@@ -3204,17 +3216,17 @@ var Platform = /* @__PURE__ */ ((Platform2) => {
|
|
|
3204
3216
|
})(Platform || {});
|
|
3205
3217
|
|
|
3206
3218
|
// src/models/embedded-signin-flow.ts
|
|
3207
|
-
var
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
return
|
|
3213
|
-
})(
|
|
3214
|
-
var
|
|
3215
|
-
|
|
3216
|
-
return
|
|
3217
|
-
})(
|
|
3219
|
+
var EmbeddedSignInFlowStatus2 = /* @__PURE__ */ ((EmbeddedSignInFlowStatus3) => {
|
|
3220
|
+
EmbeddedSignInFlowStatus3["FailCompleted"] = "FAIL_COMPLETED";
|
|
3221
|
+
EmbeddedSignInFlowStatus3["FailIncomplete"] = "FAIL_INCOMPLETE";
|
|
3222
|
+
EmbeddedSignInFlowStatus3["Incomplete"] = "INCOMPLETE";
|
|
3223
|
+
EmbeddedSignInFlowStatus3["SuccessCompleted"] = "SUCCESS_COMPLETED";
|
|
3224
|
+
return EmbeddedSignInFlowStatus3;
|
|
3225
|
+
})(EmbeddedSignInFlowStatus2 || {});
|
|
3226
|
+
var EmbeddedSignInFlowType2 = /* @__PURE__ */ ((EmbeddedSignInFlowType3) => {
|
|
3227
|
+
EmbeddedSignInFlowType3["Authentication"] = "AUTHENTICATION";
|
|
3228
|
+
return EmbeddedSignInFlowType3;
|
|
3229
|
+
})(EmbeddedSignInFlowType2 || {});
|
|
3218
3230
|
var EmbeddedSignInFlowStepType = /* @__PURE__ */ ((EmbeddedSignInFlowStepType2) => {
|
|
3219
3231
|
EmbeddedSignInFlowStepType2["AuthenticatorPrompt"] = "AUTHENTICATOR_PROMPT";
|
|
3220
3232
|
EmbeddedSignInFlowStepType2["MultiOptionsPrompt"] = "MULTI_OPTIONS_PROMPT";
|
|
@@ -3237,6 +3249,53 @@ var EmbeddedSignInFlowAuthenticatorPromptType = /* @__PURE__ */ ((EmbeddedSignIn
|
|
|
3237
3249
|
return EmbeddedSignInFlowAuthenticatorPromptType2;
|
|
3238
3250
|
})(EmbeddedSignInFlowAuthenticatorPromptType || {});
|
|
3239
3251
|
|
|
3252
|
+
// src/models/v2/embedded-flow-v2.ts
|
|
3253
|
+
var EmbeddedFlowComponentType2 = /* @__PURE__ */ ((EmbeddedFlowComponentType3) => {
|
|
3254
|
+
EmbeddedFlowComponentType3["TextInput"] = "TEXT_INPUT";
|
|
3255
|
+
EmbeddedFlowComponentType3["PasswordInput"] = "PASSWORD_INPUT";
|
|
3256
|
+
EmbeddedFlowComponentType3["EmailInput"] = "EMAIL_INPUT";
|
|
3257
|
+
EmbeddedFlowComponentType3["Text"] = "TEXT";
|
|
3258
|
+
EmbeddedFlowComponentType3["Action"] = "ACTION";
|
|
3259
|
+
EmbeddedFlowComponentType3["Block"] = "BLOCK";
|
|
3260
|
+
return EmbeddedFlowComponentType3;
|
|
3261
|
+
})(EmbeddedFlowComponentType2 || {});
|
|
3262
|
+
var EmbeddedFlowActionVariant = /* @__PURE__ */ ((EmbeddedFlowActionVariant2) => {
|
|
3263
|
+
EmbeddedFlowActionVariant2["Primary"] = "PRIMARY";
|
|
3264
|
+
EmbeddedFlowActionVariant2["Secondary"] = "SECONDARY";
|
|
3265
|
+
EmbeddedFlowActionVariant2["Tertiary"] = "TERTIARY";
|
|
3266
|
+
EmbeddedFlowActionVariant2["Danger"] = "DANGER";
|
|
3267
|
+
EmbeddedFlowActionVariant2["Success"] = "SUCCESS";
|
|
3268
|
+
EmbeddedFlowActionVariant2["Info"] = "INFO";
|
|
3269
|
+
EmbeddedFlowActionVariant2["Warning"] = "WARNING";
|
|
3270
|
+
EmbeddedFlowActionVariant2["Link"] = "LINK";
|
|
3271
|
+
return EmbeddedFlowActionVariant2;
|
|
3272
|
+
})(EmbeddedFlowActionVariant || {});
|
|
3273
|
+
var EmbeddedFlowTextVariant = /* @__PURE__ */ ((EmbeddedFlowTextVariant2) => {
|
|
3274
|
+
EmbeddedFlowTextVariant2["Heading1"] = "HEADING_1";
|
|
3275
|
+
EmbeddedFlowTextVariant2["Heading2"] = "HEADING_2";
|
|
3276
|
+
EmbeddedFlowTextVariant2["Heading3"] = "HEADING_3";
|
|
3277
|
+
EmbeddedFlowTextVariant2["Heading4"] = "HEADING_4";
|
|
3278
|
+
EmbeddedFlowTextVariant2["Heading5"] = "HEADING_5";
|
|
3279
|
+
EmbeddedFlowTextVariant2["Heading6"] = "HEADING_6";
|
|
3280
|
+
EmbeddedFlowTextVariant2["Subtitle1"] = "SUBTITLE_1";
|
|
3281
|
+
EmbeddedFlowTextVariant2["Subtitle2"] = "SUBTITLE_2";
|
|
3282
|
+
EmbeddedFlowTextVariant2["Body1"] = "BODY_1";
|
|
3283
|
+
EmbeddedFlowTextVariant2["Body2"] = "BODY_2";
|
|
3284
|
+
EmbeddedFlowTextVariant2["Caption"] = "CAPTION";
|
|
3285
|
+
EmbeddedFlowTextVariant2["Overline"] = "OVERLINE";
|
|
3286
|
+
EmbeddedFlowTextVariant2["ButtonText"] = "BUTTON_TEXT";
|
|
3287
|
+
return EmbeddedFlowTextVariant2;
|
|
3288
|
+
})(EmbeddedFlowTextVariant || {});
|
|
3289
|
+
var EmbeddedFlowEventType = /* @__PURE__ */ ((EmbeddedFlowEventType2) => {
|
|
3290
|
+
EmbeddedFlowEventType2["Trigger"] = "TRIGGER";
|
|
3291
|
+
EmbeddedFlowEventType2["Submit"] = "SUBMIT";
|
|
3292
|
+
EmbeddedFlowEventType2["Navigate"] = "NAVIGATE";
|
|
3293
|
+
EmbeddedFlowEventType2["Cancel"] = "CANCEL";
|
|
3294
|
+
EmbeddedFlowEventType2["Reset"] = "RESET";
|
|
3295
|
+
EmbeddedFlowEventType2["Back"] = "BACK";
|
|
3296
|
+
return EmbeddedFlowEventType2;
|
|
3297
|
+
})(EmbeddedFlowEventType || {});
|
|
3298
|
+
|
|
3240
3299
|
// src/models/flow.ts
|
|
3241
3300
|
var FlowMode = /* @__PURE__ */ ((FlowMode2) => {
|
|
3242
3301
|
FlowMode2["Embedded"] = "DIRECT";
|
|
@@ -4723,9 +4782,13 @@ var transformBrandingPreferenceToTheme_default = transformBrandingPreferenceToTh
|
|
|
4723
4782
|
AsgardeoJavaScriptClient,
|
|
4724
4783
|
AsgardeoRuntimeError,
|
|
4725
4784
|
DEFAULT_THEME,
|
|
4785
|
+
EmbeddedFlowActionVariantV2,
|
|
4726
4786
|
EmbeddedFlowComponentType,
|
|
4787
|
+
EmbeddedFlowComponentTypeV2,
|
|
4788
|
+
EmbeddedFlowEventTypeV2,
|
|
4727
4789
|
EmbeddedFlowResponseType,
|
|
4728
4790
|
EmbeddedFlowStatus,
|
|
4791
|
+
EmbeddedFlowTextVariantV2,
|
|
4729
4792
|
EmbeddedFlowType,
|
|
4730
4793
|
EmbeddedSignInFlowAuthenticatorKnownIdPType,
|
|
4731
4794
|
EmbeddedSignInFlowAuthenticatorParamType,
|