@asgardeo/javascript 0.19.2 → 0.20.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/dist/AsgardeoJavaScriptClient.d.ts +2 -1
- package/dist/AsgardeoJavaScriptClient.d.ts.map +1 -1
- package/dist/api/createOrganization.d.ts.map +1 -1
- package/dist/api/executeEmbeddedSignInFlow.d.ts.map +1 -1
- package/dist/api/executeEmbeddedSignUpFlow.d.ts.map +1 -1
- package/dist/api/getAllOrganizations.d.ts.map +1 -1
- package/dist/api/getBrandingPreference.d.ts.map +1 -1
- package/dist/api/getMeOrganizations.d.ts.map +1 -1
- package/dist/api/getOrganization.d.ts.map +1 -1
- package/dist/api/getSchemas.d.ts.map +1 -1
- package/dist/api/getScim2Me.d.ts.map +1 -1
- package/dist/api/getUserInfo.d.ts.map +1 -1
- package/dist/api/initializeEmbeddedSignInFlow.d.ts.map +1 -1
- package/dist/api/updateMeProfile.d.ts.map +1 -1
- package/dist/api/updateOrganization.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/api/v2/executeEmbeddedSignUpFlowV2.d.ts.map +1 -1
- package/dist/api/v2/executeEmbeddedUserOnboardingFlowV2.d.ts.map +1 -1
- package/dist/api/v2/getFlowMetaV2.d.ts.map +1 -1
- package/dist/api/v2/getOrganizationUnitChildren.d.ts.map +1 -1
- package/dist/cjs/index.js +147 -40
- package/dist/cjs/index.js.map +4 -4
- package/dist/edge/index.js +144 -40
- package/dist/edge/index.js.map +4 -4
- package/dist/errors/AsgardeoAPIError.d.ts +9 -3
- package/dist/errors/AsgardeoAPIError.d.ts.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +144 -40
- package/dist/index.js.map +4 -4
- package/dist/models/client.d.ts +8 -1
- package/dist/models/client.d.ts.map +1 -1
- package/dist/models/config.d.ts +1 -1
- package/dist/models/config.d.ts.map +1 -1
- package/dist/models/embedded-flow.d.ts +3 -2
- package/dist/models/embedded-flow.d.ts.map +1 -1
- 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/utils/parseApiErrorMessage.d.ts +29 -0
- package/dist/utils/parseApiErrorMessage.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -20,11 +20,16 @@ import AsgardeoError from './AsgardeoError';
|
|
|
20
20
|
* Base class for all API-related errors in Asgardeo. This class extends AsgardeoError
|
|
21
21
|
* and adds support for HTTP status codes and status text.
|
|
22
22
|
*
|
|
23
|
+
* The `message` parameter may be either a plain string or a raw JSON error body from the
|
|
24
|
+
* Asgardeo API — the constructor will extract a human-readable message automatically.
|
|
25
|
+
* An optional `prefix` is prepended to the resolved message (e.g. "Failed to fetch user profile").
|
|
26
|
+
*
|
|
23
27
|
* @example
|
|
24
28
|
* ```typescript
|
|
25
29
|
* throw new AsgardeoAPIError(
|
|
26
30
|
* "Failed to fetch user data",
|
|
27
31
|
* "API_FETCH_ERROR",
|
|
32
|
+
* "javascript",
|
|
28
33
|
* 404,
|
|
29
34
|
* "Not Found"
|
|
30
35
|
* );
|
|
@@ -36,14 +41,15 @@ export default class AsgardeoAPIError extends AsgardeoError {
|
|
|
36
41
|
/**
|
|
37
42
|
* Creates an instance of AsgardeoAPIError.
|
|
38
43
|
*
|
|
39
|
-
* @param message - Human-readable description
|
|
44
|
+
* @param message - Human-readable description or raw API error response body
|
|
40
45
|
* @param code - A unique error code that identifies the error type
|
|
46
|
+
* @param origin - The SDK origin (e.g. 'react', 'vue')
|
|
41
47
|
* @param statusCode - HTTP status code of the failed request
|
|
42
48
|
* @param statusText - HTTP status text of the failed request
|
|
43
|
-
* @param
|
|
49
|
+
* @param prefix - Optional prefix prepended to the resolved message
|
|
44
50
|
* @constructor
|
|
45
51
|
*/
|
|
46
|
-
constructor(message: string, code: string, origin: string, statusCode?: number, statusText?: string);
|
|
52
|
+
constructor(message: string, code: string, origin: string, statusCode?: number, statusText?: string, prefix?: string);
|
|
47
53
|
/**
|
|
48
54
|
* Returns a string representation of the API error
|
|
49
55
|
* @returns Formatted error string with name, code, status, and message
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsgardeoAPIError.d.ts","sourceRoot":"","sources":["../../src/errors/AsgardeoAPIError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,aAAa,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"AsgardeoAPIError.d.ts","sourceRoot":"","sources":["../../src/errors/AsgardeoAPIError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAG5C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,aAAa;aAgBvC,UAAU,CAAC,EAAE,MAAM;aACnB,UAAU,CAAC,EAAE,MAAM;IAhBrC;;;;;;;;;;OAUG;gBAED,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACE,UAAU,CAAC,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,EACnC,MAAM,CAAC,EAAE,MAAM;IAajB;;;OAGG;IACa,QAAQ,IAAI,MAAM;CAInC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2020, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
|
|
2
|
+
* Copyright (c) 2020-2026, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
|
|
3
3
|
*
|
|
4
4
|
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
5
|
* Version 2.0 (the "License"); you may not use this file except
|
|
@@ -33,6 +33,7 @@ export { default as updateMeProfile, UpdateMeProfileConfig } from './api/updateM
|
|
|
33
33
|
export { default as getBrandingPreference, GetBrandingPreferenceConfig } from './api/getBrandingPreference';
|
|
34
34
|
export { default as executeEmbeddedSignInFlowV2 } from './api/v2/executeEmbeddedSignInFlowV2';
|
|
35
35
|
export { default as executeEmbeddedSignUpFlowV2 } from './api/v2/executeEmbeddedSignUpFlowV2';
|
|
36
|
+
export { default as executeEmbeddedRecoveryFlowV2 } from './api/v2/executeEmbeddedRecoveryFlowV2';
|
|
36
37
|
export { default as executeEmbeddedUserOnboardingFlowV2, EmbeddedUserOnboardingFlowResponse, } from './api/v2/executeEmbeddedUserOnboardingFlowV2';
|
|
37
38
|
export { default as getFlowMetaV2 } from './api/v2/getFlowMetaV2';
|
|
38
39
|
export { default as getOrganizationUnitChildren } from './api/v2/getOrganizationUnitChildren';
|
|
@@ -50,6 +51,7 @@ export { EmbeddedSignInFlowInitiateResponse, EmbeddedSignInFlowStatus, EmbeddedS
|
|
|
50
51
|
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';
|
|
51
52
|
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';
|
|
52
53
|
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';
|
|
54
|
+
export { EmbeddedRecoveryFlowStatus as EmbeddedRecoveryFlowStatusV2, EmbeddedRecoveryFlowType as EmbeddedRecoveryFlowTypeV2, EmbeddedRecoveryFlowResponse as EmbeddedRecoveryFlowResponseV2, EmbeddedRecoveryFlowInitiateRequest as EmbeddedRecoveryFlowInitiateRequestV2, EmbeddedRecoveryFlowRequest as EmbeddedRecoveryFlowRequestV2, EmbeddedRecoveryFlowErrorResponse as EmbeddedRecoveryFlowErrorResponseV2, } from './models/v2/embedded-recovery-flow-v2';
|
|
53
55
|
export { OrganizationUnit, OrganizationUnitListResponse, GetOrganizationUnitChildrenConfig, } from './models/v2/organization-unit';
|
|
54
56
|
export { FlowMetaType, ApplicationMetadata, OUMetadata, DesignMetadata, I18nMetadata, FlowMetadataResponse, GetFlowMetaRequestConfig, FlowMetaTheme, FlowMetaThemeColorSet, FlowMetaThemeBackground, FlowMetaThemeTextColors, FlowMetaThemeColors, FlowMetaThemeColorScheme, FlowMetaThemeShape, FlowMetaThemeTypography, } from './models/v2/flow-meta-v2';
|
|
55
57
|
export { EmbeddedFlowType, EmbeddedFlowStatus, EmbeddedFlowExecuteResponse, EmbeddedFlowResponseType, EmbeddedSignUpFlowData, EmbeddedFlowComponent, EmbeddedFlowComponentType, EmbeddedFlowExecuteRequestPayload, EmbeddedFlowExecuteRequestConfig, EmbeddedFlowExecuteErrorResponse, } from './models/embedded-flow';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAC,OAAO,IAAI,4BAA4B,EAAC,MAAM,oCAAoC,CAAC;AAC3F,OAAO,EAAC,OAAO,IAAI,yBAAyB,EAAC,MAAM,iCAAiC,CAAC;AACrF,OAAO,EAAC,OAAO,IAAI,yBAAyB,EAAC,MAAM,iCAAiC,CAAC;AACrF,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAC,OAAO,IAAI,UAAU,EAAE,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAC,OAAO,IAAI,UAAU,EAAE,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAC,OAAO,IAAI,mBAAmB,EAAE,yBAAyB,EAAC,MAAM,2BAA2B,CAAC;AACpG,OAAO,EACL,OAAO,IAAI,kBAAkB,EAC7B,yBAAyB,EACzB,wB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MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAC,OAAO,IAAI,2BAA2B,EAAC,MAAM,wCAAwC,CAAC;AAC9F,OAAO,EAAC,OAAO,IAAI,sBAAsB,EAAC,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAC,OAAO,IAAI,wBAAwB,EAAC,MAAM,qCAAqC,CAAC;AACxF,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAC,OAAO,IAAI,mBAAmB,EAAC,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAC,OAAO,IAAI,wBAAwB,EAAC,MAAM,kCAAkC,CAAC;AACrF,OAAO,EAAC,OAAO,IAAI,kCAAkC,EAAC,MAAM,4CAA4C,CAAC;AAEzG,OAAO,EACL,OAAO,IAAI,MAAM,EACjB,YAAY,EACZ,qBAAqB,EACrB,mBAAmB,EACnB,4BAA4B,EAC5B,QAAQ,EACR,SAAS,IAAI,eAAe,EAC5B,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,KAAK,GACN,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAE3D,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,SAAS,EAAE,iBAAiB,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2021,20 +2021,37 @@ var _AsgardeoAuthClient = class _AsgardeoAuthClient {
|
|
|
2021
2021
|
__publicField(_AsgardeoAuthClient, "authHelperInstance");
|
|
2022
2022
|
var AsgardeoAuthClient = _AsgardeoAuthClient;
|
|
2023
2023
|
|
|
2024
|
+
// src/utils/parseApiErrorMessage.ts
|
|
2025
|
+
var parseApiErrorMessage = (errorText) => {
|
|
2026
|
+
try {
|
|
2027
|
+
const parsed = JSON.parse(errorText);
|
|
2028
|
+
const description = parsed["description"];
|
|
2029
|
+
const message = parsed["message"];
|
|
2030
|
+
if (description?.defaultValue) return description.defaultValue;
|
|
2031
|
+
if (message?.defaultValue) return message.defaultValue;
|
|
2032
|
+
} catch {
|
|
2033
|
+
}
|
|
2034
|
+
return errorText;
|
|
2035
|
+
};
|
|
2036
|
+
var parseApiErrorMessage_default = parseApiErrorMessage;
|
|
2037
|
+
|
|
2024
2038
|
// src/errors/AsgardeoAPIError.ts
|
|
2025
2039
|
var AsgardeoAPIError = class extends AsgardeoError {
|
|
2026
2040
|
/**
|
|
2027
2041
|
* Creates an instance of AsgardeoAPIError.
|
|
2028
2042
|
*
|
|
2029
|
-
* @param message - Human-readable description
|
|
2043
|
+
* @param message - Human-readable description or raw API error response body
|
|
2030
2044
|
* @param code - A unique error code that identifies the error type
|
|
2045
|
+
* @param origin - The SDK origin (e.g. 'react', 'vue')
|
|
2031
2046
|
* @param statusCode - HTTP status code of the failed request
|
|
2032
2047
|
* @param statusText - HTTP status text of the failed request
|
|
2033
|
-
* @param
|
|
2048
|
+
* @param prefix - Optional prefix prepended to the resolved message
|
|
2034
2049
|
* @constructor
|
|
2035
2050
|
*/
|
|
2036
|
-
constructor(message, code, origin, statusCode, statusText) {
|
|
2037
|
-
|
|
2051
|
+
constructor(message, code, origin, statusCode, statusText, prefix) {
|
|
2052
|
+
const parsed = parseApiErrorMessage_default(message);
|
|
2053
|
+
const resolvedMessage = prefix ? `${prefix}: ${parsed}` : parsed;
|
|
2054
|
+
super(resolvedMessage, code, origin);
|
|
2038
2055
|
this.statusCode = statusCode;
|
|
2039
2056
|
this.statusText = statusText;
|
|
2040
2057
|
Object.defineProperty(this, "name", {
|
|
@@ -2101,11 +2118,12 @@ var initializeEmbeddedSignInFlow = async ({
|
|
|
2101
2118
|
if (!response.ok) {
|
|
2102
2119
|
const errorText = await response.text();
|
|
2103
2120
|
throw new AsgardeoAPIError(
|
|
2104
|
-
|
|
2121
|
+
errorText,
|
|
2105
2122
|
"initializeEmbeddedSignInFlow-ResponseError-001",
|
|
2106
2123
|
"javascript",
|
|
2107
2124
|
response.status,
|
|
2108
|
-
response.statusText
|
|
2125
|
+
response.statusText,
|
|
2126
|
+
"Authorization request failed"
|
|
2109
2127
|
);
|
|
2110
2128
|
}
|
|
2111
2129
|
return await response.json();
|
|
@@ -2165,11 +2183,12 @@ var executeEmbeddedSignInFlow = async ({
|
|
|
2165
2183
|
if (!response.ok) {
|
|
2166
2184
|
const errorText = await response.text();
|
|
2167
2185
|
throw new AsgardeoAPIError(
|
|
2168
|
-
|
|
2186
|
+
errorText,
|
|
2169
2187
|
"initializeEmbeddedSignInFlow-ResponseError-001",
|
|
2170
2188
|
"javascript",
|
|
2171
2189
|
response.status,
|
|
2172
|
-
response.statusText
|
|
2190
|
+
response.statusText,
|
|
2191
|
+
"Authorization request failed"
|
|
2173
2192
|
);
|
|
2174
2193
|
}
|
|
2175
2194
|
return await response.json();
|
|
@@ -2191,6 +2210,7 @@ var executeEmbeddedSignInFlow_default = executeEmbeddedSignInFlow;
|
|
|
2191
2210
|
// src/models/embedded-flow.ts
|
|
2192
2211
|
var EmbeddedFlowType = /* @__PURE__ */ ((EmbeddedFlowType2) => {
|
|
2193
2212
|
EmbeddedFlowType2["Authentication"] = "AUTHENTICATION";
|
|
2213
|
+
EmbeddedFlowType2["Recovery"] = "RECOVERY";
|
|
2194
2214
|
EmbeddedFlowType2["Registration"] = "REGISTRATION";
|
|
2195
2215
|
EmbeddedFlowType2["UserOnboarding"] = "USER_ONBOARDING";
|
|
2196
2216
|
return EmbeddedFlowType2;
|
|
@@ -2262,11 +2282,12 @@ var executeEmbeddedSignUpFlow = async ({
|
|
|
2262
2282
|
if (!response.ok) {
|
|
2263
2283
|
const errorText = await response.text();
|
|
2264
2284
|
throw new AsgardeoAPIError(
|
|
2265
|
-
|
|
2285
|
+
errorText,
|
|
2266
2286
|
"javascript-executeEmbeddedSignUpFlow-ResponseError-100",
|
|
2267
2287
|
"javascript",
|
|
2268
2288
|
response.status,
|
|
2269
|
-
response.statusText
|
|
2289
|
+
response.statusText,
|
|
2290
|
+
"Embedded SignUp flow execution failed"
|
|
2270
2291
|
);
|
|
2271
2292
|
}
|
|
2272
2293
|
return await response.json();
|
|
@@ -2311,11 +2332,12 @@ var getUserInfo = async ({ url, ...requestConfig }) => {
|
|
|
2311
2332
|
if (!response.ok) {
|
|
2312
2333
|
const errorText = await response.text();
|
|
2313
2334
|
throw new AsgardeoAPIError(
|
|
2314
|
-
|
|
2335
|
+
errorText,
|
|
2315
2336
|
"getUserInfo-ResponseError-001",
|
|
2316
2337
|
"javascript",
|
|
2317
2338
|
response.status,
|
|
2318
|
-
response.statusText
|
|
2339
|
+
response.statusText,
|
|
2340
|
+
"Failed to fetch user info"
|
|
2319
2341
|
);
|
|
2320
2342
|
}
|
|
2321
2343
|
return await response.json();
|
|
@@ -2389,11 +2411,12 @@ var getScim2Me = async ({ url, baseUrl, fetcher, ...requestConfig }) => {
|
|
|
2389
2411
|
if (!response?.ok) {
|
|
2390
2412
|
const errorText = await response.text();
|
|
2391
2413
|
throw new AsgardeoAPIError(
|
|
2392
|
-
|
|
2414
|
+
errorText,
|
|
2393
2415
|
"getScim2Me-ResponseError-001",
|
|
2394
2416
|
"javascript",
|
|
2395
2417
|
response.status,
|
|
2396
|
-
response.statusText
|
|
2418
|
+
response.statusText,
|
|
2419
|
+
"Failed to fetch user profile"
|
|
2397
2420
|
);
|
|
2398
2421
|
}
|
|
2399
2422
|
const user = await response.json();
|
|
@@ -2442,11 +2465,12 @@ var getSchemas = async ({ url, baseUrl, fetcher, ...requestConfig }) => {
|
|
|
2442
2465
|
if (!response?.ok) {
|
|
2443
2466
|
const errorText = await response.text();
|
|
2444
2467
|
throw new AsgardeoAPIError(
|
|
2445
|
-
|
|
2468
|
+
errorText,
|
|
2446
2469
|
"getSchemas-ResponseError-001",
|
|
2447
2470
|
"javascript",
|
|
2448
2471
|
response.status,
|
|
2449
|
-
response.statusText
|
|
2472
|
+
response.statusText,
|
|
2473
|
+
"Failed to fetch SCIM2 schemas"
|
|
2450
2474
|
);
|
|
2451
2475
|
}
|
|
2452
2476
|
return await response.json();
|
|
@@ -2510,11 +2534,12 @@ var getAllOrganizations = async ({
|
|
|
2510
2534
|
if (!response?.ok) {
|
|
2511
2535
|
const errorText = await response.text();
|
|
2512
2536
|
throw new AsgardeoAPIError(
|
|
2513
|
-
|
|
2537
|
+
errorText,
|
|
2514
2538
|
"getAllOrganizations-ResponseError-001",
|
|
2515
2539
|
"javascript",
|
|
2516
2540
|
response.status,
|
|
2517
|
-
response.statusText
|
|
2541
|
+
response.statusText,
|
|
2542
|
+
"Failed to get organizations"
|
|
2518
2543
|
);
|
|
2519
2544
|
}
|
|
2520
2545
|
const data = await response.json();
|
|
@@ -2587,11 +2612,12 @@ var createOrganization = async ({
|
|
|
2587
2612
|
if (!response?.ok) {
|
|
2588
2613
|
const errorText = await response.text();
|
|
2589
2614
|
throw new AsgardeoAPIError(
|
|
2590
|
-
|
|
2615
|
+
errorText,
|
|
2591
2616
|
"createOrganization-ResponseError-001",
|
|
2592
2617
|
"javascript",
|
|
2593
2618
|
response.status,
|
|
2594
|
-
response.statusText
|
|
2619
|
+
response.statusText,
|
|
2620
|
+
"Failed to create organization"
|
|
2595
2621
|
);
|
|
2596
2622
|
}
|
|
2597
2623
|
return await response.json();
|
|
@@ -2661,11 +2687,12 @@ var getMeOrganizations = async ({
|
|
|
2661
2687
|
if (!response?.ok) {
|
|
2662
2688
|
const errorText = await response.text();
|
|
2663
2689
|
throw new AsgardeoAPIError(
|
|
2664
|
-
|
|
2690
|
+
errorText,
|
|
2665
2691
|
"getMeOrganizations-ResponseError-001",
|
|
2666
2692
|
"javascript",
|
|
2667
2693
|
response.status,
|
|
2668
|
-
response.statusText
|
|
2694
|
+
response.statusText,
|
|
2695
|
+
"Failed to fetch associated organizations of the user"
|
|
2669
2696
|
);
|
|
2670
2697
|
}
|
|
2671
2698
|
const data = await response.json();
|
|
@@ -2728,11 +2755,12 @@ var getOrganization = async ({
|
|
|
2728
2755
|
if (!response?.ok) {
|
|
2729
2756
|
const errorText = await response.text();
|
|
2730
2757
|
throw new AsgardeoAPIError(
|
|
2731
|
-
|
|
2758
|
+
errorText,
|
|
2732
2759
|
"getOrganization-ResponseError-001",
|
|
2733
2760
|
"javascript",
|
|
2734
2761
|
response.status,
|
|
2735
|
-
response.statusText
|
|
2762
|
+
response.statusText,
|
|
2763
|
+
"Failed to fetch organization details"
|
|
2736
2764
|
);
|
|
2737
2765
|
}
|
|
2738
2766
|
return await response.json();
|
|
@@ -2823,11 +2851,12 @@ var updateOrganization = async ({
|
|
|
2823
2851
|
if (!response?.ok) {
|
|
2824
2852
|
const errorText = await response.text();
|
|
2825
2853
|
throw new AsgardeoAPIError(
|
|
2826
|
-
|
|
2854
|
+
errorText,
|
|
2827
2855
|
"updateOrganization-ResponseError-001",
|
|
2828
2856
|
"javascript",
|
|
2829
2857
|
response.status,
|
|
2830
|
-
response.statusText
|
|
2858
|
+
response.statusText,
|
|
2859
|
+
"Failed to update organization"
|
|
2831
2860
|
);
|
|
2832
2861
|
}
|
|
2833
2862
|
return await response.json();
|
|
@@ -2904,11 +2933,12 @@ var updateMeProfile = async ({
|
|
|
2904
2933
|
if (!response?.ok) {
|
|
2905
2934
|
const errorText = await response.text();
|
|
2906
2935
|
throw new AsgardeoAPIError(
|
|
2907
|
-
|
|
2936
|
+
errorText,
|
|
2908
2937
|
"updateMeProfile-ResponseError-001",
|
|
2909
2938
|
"javascript",
|
|
2910
2939
|
response.status,
|
|
2911
|
-
response.statusText
|
|
2940
|
+
response.statusText,
|
|
2941
|
+
"Failed to update user profile"
|
|
2912
2942
|
);
|
|
2913
2943
|
}
|
|
2914
2944
|
return processUsername_default(await response.json());
|
|
@@ -2972,11 +3002,12 @@ var getBrandingPreference = async ({
|
|
|
2972
3002
|
if (!response?.ok) {
|
|
2973
3003
|
const errorText = await response.text();
|
|
2974
3004
|
throw new AsgardeoAPIError(
|
|
2975
|
-
|
|
3005
|
+
errorText,
|
|
2976
3006
|
"getBrandingPreference-ResponseError-001",
|
|
2977
3007
|
"javascript",
|
|
2978
3008
|
response.status,
|
|
2979
|
-
response.statusText
|
|
3009
|
+
response.statusText,
|
|
3010
|
+
"Failed to get branding preference"
|
|
2980
3011
|
);
|
|
2981
3012
|
}
|
|
2982
3013
|
const data = await response.json();
|
|
@@ -3044,11 +3075,12 @@ var executeEmbeddedSignInFlowV2 = async ({
|
|
|
3044
3075
|
if (!response.ok) {
|
|
3045
3076
|
const errorText = await response.text();
|
|
3046
3077
|
throw new AsgardeoAPIError(
|
|
3047
|
-
|
|
3078
|
+
errorText,
|
|
3048
3079
|
"executeEmbeddedSignInFlow-ResponseError-001",
|
|
3049
3080
|
"javascript",
|
|
3050
3081
|
response.status,
|
|
3051
|
-
response.statusText
|
|
3082
|
+
response.statusText,
|
|
3083
|
+
"Authorization request failed"
|
|
3052
3084
|
);
|
|
3053
3085
|
}
|
|
3054
3086
|
const flowResponse = await response.json();
|
|
@@ -3144,11 +3176,12 @@ var executeEmbeddedSignUpFlowV2 = async ({
|
|
|
3144
3176
|
if (!response.ok) {
|
|
3145
3177
|
const errorText = await response.text();
|
|
3146
3178
|
throw new AsgardeoAPIError(
|
|
3147
|
-
|
|
3179
|
+
errorText,
|
|
3148
3180
|
"executeEmbeddedSignUpFlow-ResponseError-001",
|
|
3149
3181
|
"javascript",
|
|
3150
3182
|
response.status,
|
|
3151
|
-
response.statusText
|
|
3183
|
+
response.statusText,
|
|
3184
|
+
"Registration request failed"
|
|
3152
3185
|
);
|
|
3153
3186
|
}
|
|
3154
3187
|
const flowResponse = await response.json();
|
|
@@ -3196,6 +3229,55 @@ var executeEmbeddedSignUpFlowV2 = async ({
|
|
|
3196
3229
|
};
|
|
3197
3230
|
var executeEmbeddedSignUpFlowV2_default = executeEmbeddedSignUpFlowV2;
|
|
3198
3231
|
|
|
3232
|
+
// src/api/v2/executeEmbeddedRecoveryFlowV2.ts
|
|
3233
|
+
var executeEmbeddedRecoveryFlowV2 = async ({
|
|
3234
|
+
url,
|
|
3235
|
+
baseUrl,
|
|
3236
|
+
payload,
|
|
3237
|
+
...requestConfig
|
|
3238
|
+
}) => {
|
|
3239
|
+
if (!payload) {
|
|
3240
|
+
throw new AsgardeoAPIError(
|
|
3241
|
+
"Recovery payload is required",
|
|
3242
|
+
"executeEmbeddedRecoveryFlow-ValidationError-002",
|
|
3243
|
+
"javascript",
|
|
3244
|
+
400,
|
|
3245
|
+
"If a recovery payload is not provided, the request cannot be constructed correctly."
|
|
3246
|
+
);
|
|
3247
|
+
}
|
|
3248
|
+
const endpoint = url ?? `${baseUrl}/flow/execute`;
|
|
3249
|
+
const cleanPayload = typeof payload === "object" && payload !== null ? Object.fromEntries(Object.entries(payload).filter(([key]) => key !== "verbose")) : payload;
|
|
3250
|
+
const hasOnlyAppIdAndFlowType = typeof cleanPayload === "object" && cleanPayload !== null && "applicationId" in cleanPayload && "flowType" in cleanPayload && Object.keys(cleanPayload).length === 2;
|
|
3251
|
+
const hasOnlyFlowId = typeof cleanPayload === "object" && cleanPayload !== null && "executionId" in cleanPayload && Object.keys(cleanPayload).length === 1;
|
|
3252
|
+
const requestPayload = hasOnlyAppIdAndFlowType || hasOnlyFlowId ? {
|
|
3253
|
+
...cleanPayload,
|
|
3254
|
+
verbose: true
|
|
3255
|
+
} : cleanPayload;
|
|
3256
|
+
const response = await fetch(endpoint, {
|
|
3257
|
+
...requestConfig,
|
|
3258
|
+
body: JSON.stringify(requestPayload),
|
|
3259
|
+
headers: {
|
|
3260
|
+
Accept: "application/json",
|
|
3261
|
+
"Content-Type": "application/json",
|
|
3262
|
+
...requestConfig.headers
|
|
3263
|
+
},
|
|
3264
|
+
method: requestConfig.method || "POST"
|
|
3265
|
+
});
|
|
3266
|
+
if (!response.ok) {
|
|
3267
|
+
const errorText = await response.text();
|
|
3268
|
+
throw new AsgardeoAPIError(
|
|
3269
|
+
`Recovery request failed: ${errorText}`,
|
|
3270
|
+
"executeEmbeddedRecoveryFlow-ResponseError-001",
|
|
3271
|
+
"javascript",
|
|
3272
|
+
response.status,
|
|
3273
|
+
response.statusText
|
|
3274
|
+
);
|
|
3275
|
+
}
|
|
3276
|
+
const flowResponse = await response.json();
|
|
3277
|
+
return flowResponse;
|
|
3278
|
+
};
|
|
3279
|
+
var executeEmbeddedRecoveryFlowV2_default = executeEmbeddedRecoveryFlowV2;
|
|
3280
|
+
|
|
3199
3281
|
// src/api/v2/executeEmbeddedUserOnboardingFlowV2.ts
|
|
3200
3282
|
var executeEmbeddedUserOnboardingFlowV2 = async ({
|
|
3201
3283
|
url,
|
|
@@ -3234,11 +3316,12 @@ var executeEmbeddedUserOnboardingFlowV2 = async ({
|
|
|
3234
3316
|
if (!response.ok) {
|
|
3235
3317
|
const errorText = await response.text();
|
|
3236
3318
|
throw new AsgardeoAPIError(
|
|
3237
|
-
|
|
3319
|
+
errorText,
|
|
3238
3320
|
"executeEmbeddedUserOnboardingFlow-ResponseError-001",
|
|
3239
3321
|
"javascript",
|
|
3240
3322
|
response.status,
|
|
3241
|
-
response.statusText
|
|
3323
|
+
response.statusText,
|
|
3324
|
+
"User onboarding request failed"
|
|
3242
3325
|
);
|
|
3243
3326
|
}
|
|
3244
3327
|
const flowResponse = await response.json();
|
|
@@ -3275,11 +3358,12 @@ var getFlowMetaV2 = async ({
|
|
|
3275
3358
|
if (!response.ok) {
|
|
3276
3359
|
const errorText = await response.text();
|
|
3277
3360
|
throw new AsgardeoAPIError(
|
|
3278
|
-
|
|
3361
|
+
errorText,
|
|
3279
3362
|
"getFlowMetaV2-ResponseError-001",
|
|
3280
3363
|
"javascript",
|
|
3281
3364
|
response.status,
|
|
3282
|
-
response.statusText
|
|
3365
|
+
response.statusText,
|
|
3366
|
+
"Flow metadata request failed"
|
|
3283
3367
|
);
|
|
3284
3368
|
}
|
|
3285
3369
|
const flowMetadata = await response.json();
|
|
@@ -3321,11 +3405,12 @@ var getOrganizationUnitChildren = async ({
|
|
|
3321
3405
|
if (!response.ok) {
|
|
3322
3406
|
const errorText = await response.text();
|
|
3323
3407
|
throw new AsgardeoAPIError(
|
|
3324
|
-
|
|
3408
|
+
errorText,
|
|
3325
3409
|
"getOrganizationUnitChildren-ResponseError-001",
|
|
3326
3410
|
"javascript",
|
|
3327
3411
|
response.status,
|
|
3328
|
-
response.statusText
|
|
3412
|
+
response.statusText,
|
|
3413
|
+
"Failed to fetch organization unit children"
|
|
3329
3414
|
);
|
|
3330
3415
|
}
|
|
3331
3416
|
const listResponse = await response.json();
|
|
@@ -3457,6 +3542,19 @@ var EmbeddedFlowEventType = /* @__PURE__ */ ((EmbeddedFlowEventType2) => {
|
|
|
3457
3542
|
return EmbeddedFlowEventType2;
|
|
3458
3543
|
})(EmbeddedFlowEventType || {});
|
|
3459
3544
|
|
|
3545
|
+
// src/models/v2/embedded-recovery-flow-v2.ts
|
|
3546
|
+
var EmbeddedRecoveryFlowStatus = /* @__PURE__ */ ((EmbeddedRecoveryFlowStatus2) => {
|
|
3547
|
+
EmbeddedRecoveryFlowStatus2["Complete"] = "COMPLETE";
|
|
3548
|
+
EmbeddedRecoveryFlowStatus2["Error"] = "ERROR";
|
|
3549
|
+
EmbeddedRecoveryFlowStatus2["Incomplete"] = "INCOMPLETE";
|
|
3550
|
+
return EmbeddedRecoveryFlowStatus2;
|
|
3551
|
+
})(EmbeddedRecoveryFlowStatus || {});
|
|
3552
|
+
var EmbeddedRecoveryFlowType = /* @__PURE__ */ ((EmbeddedRecoveryFlowType2) => {
|
|
3553
|
+
EmbeddedRecoveryFlowType2["Redirection"] = "REDIRECTION";
|
|
3554
|
+
EmbeddedRecoveryFlowType2["View"] = "VIEW";
|
|
3555
|
+
return EmbeddedRecoveryFlowType2;
|
|
3556
|
+
})(EmbeddedRecoveryFlowType || {});
|
|
3557
|
+
|
|
3460
3558
|
// src/models/v2/flow-meta-v2.ts
|
|
3461
3559
|
var FlowMetaType = /* @__PURE__ */ ((FlowMetaType2) => {
|
|
3462
3560
|
FlowMetaType2["App"] = "APP";
|
|
@@ -3661,6 +3759,9 @@ var AsgardeoJavaScriptClient = class {
|
|
|
3661
3759
|
signOut(_options, _sessionIdOrAfterSignOut, _afterSignOut) {
|
|
3662
3760
|
throw new Error("Method not implemented.");
|
|
3663
3761
|
}
|
|
3762
|
+
recover(_payload) {
|
|
3763
|
+
throw new Error("Method not implemented.");
|
|
3764
|
+
}
|
|
3664
3765
|
signUp(_optionsOrPayload) {
|
|
3665
3766
|
throw new Error("Method not implemented.");
|
|
3666
3767
|
}
|
|
@@ -5423,6 +5524,8 @@ export {
|
|
|
5423
5524
|
EmbeddedFlowStatus,
|
|
5424
5525
|
EmbeddedFlowTextVariant as EmbeddedFlowTextVariantV2,
|
|
5425
5526
|
EmbeddedFlowType,
|
|
5527
|
+
EmbeddedRecoveryFlowStatus as EmbeddedRecoveryFlowStatusV2,
|
|
5528
|
+
EmbeddedRecoveryFlowType as EmbeddedRecoveryFlowTypeV2,
|
|
5426
5529
|
EmbeddedSignInFlowAuthenticatorKnownIdPType,
|
|
5427
5530
|
EmbeddedSignInFlowAuthenticatorParamType,
|
|
5428
5531
|
EmbeddedSignInFlowAuthenticatorPromptType,
|
|
@@ -5460,6 +5563,7 @@ export {
|
|
|
5460
5563
|
deepMerge_default as deepMerge,
|
|
5461
5564
|
deriveOrganizationHandleFromBaseUrl_default as deriveOrganizationHandleFromBaseUrl,
|
|
5462
5565
|
error,
|
|
5566
|
+
executeEmbeddedRecoveryFlowV2_default as executeEmbeddedRecoveryFlowV2,
|
|
5463
5567
|
executeEmbeddedSignInFlow_default as executeEmbeddedSignInFlow,
|
|
5464
5568
|
executeEmbeddedSignInFlowV2_default as executeEmbeddedSignInFlowV2,
|
|
5465
5569
|
executeEmbeddedSignUpFlow_default as executeEmbeddedSignUpFlow,
|