@asgardeo/javascript 0.7.3 → 0.8.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/index.d.ts CHANGED
@@ -34,6 +34,7 @@ export { default as getBrandingPreference, GetBrandingPreferenceConfig } from '.
34
34
  export { default as executeEmbeddedSignInFlowV2 } from './api/v2/executeEmbeddedSignInFlowV2';
35
35
  export { default as executeEmbeddedSignUpFlowV2 } from './api/v2/executeEmbeddedSignUpFlowV2';
36
36
  export { default as executeEmbeddedUserOnboardingFlowV2, EmbeddedUserOnboardingFlowResponse, } from './api/v2/executeEmbeddedUserOnboardingFlowV2';
37
+ export { default as getFlowMetaV2 } from './api/v2/getFlowMetaV2';
37
38
  export { default as ApplicationNativeAuthenticationConstants } from './constants/ApplicationNativeAuthenticationConstants';
38
39
  export { default as TokenConstants } from './constants/TokenConstants';
39
40
  export { default as OIDCRequestConstants } from './constants/OIDCRequestConstants';
@@ -48,6 +49,7 @@ export { EmbeddedSignInFlowInitiateResponse, EmbeddedSignInFlowStatus, EmbeddedS
48
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
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';
50
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
+ export { FlowMetaType, ApplicationMetadata, OUMetadata, DesignMetadata, I18nMetadata, FlowMetadataResponse, GetFlowMetaRequestConfig, FlowMetaTheme, FlowMetaThemeColorSet, FlowMetaThemeBackground, FlowMetaThemeTextColors, FlowMetaThemeColors, FlowMetaThemeColorScheme, FlowMetaThemeShape, FlowMetaThemeTypography, } from './models/v2/flow-meta-v2';
51
53
  export { EmbeddedFlowType, EmbeddedFlowStatus, EmbeddedFlowExecuteResponse, EmbeddedFlowResponseType, EmbeddedSignUpFlowData, EmbeddedFlowComponent, EmbeddedFlowComponentType, EmbeddedFlowExecuteRequestPayload, EmbeddedFlowExecuteRequestConfig, EmbeddedFlowExecuteErrorResponse, } from './models/embedded-flow';
52
54
  export { FlowMode } from './models/flow';
53
55
  export { AsgardeoClient } from './models/client';
package/dist/index.js CHANGED
@@ -1036,7 +1036,7 @@ var _AsgardeoAuthClient = class _AsgardeoAuthClient {
1036
1036
  } else {
1037
1037
  this.instanceIdValue += 1;
1038
1038
  }
1039
- if (instanceID) {
1039
+ if (instanceID !== void 0) {
1040
1040
  this.instanceIdValue = instanceID;
1041
1041
  }
1042
1042
  if (!clientId) {
@@ -3138,6 +3138,65 @@ var executeEmbeddedUserOnboardingFlowV2 = async ({
3138
3138
  };
3139
3139
  var executeEmbeddedUserOnboardingFlowV2_default = executeEmbeddedUserOnboardingFlowV2;
3140
3140
 
3141
+ // src/api/v2/getFlowMetaV2.ts
3142
+ var getFlowMetaV2 = async ({
3143
+ url,
3144
+ baseUrl,
3145
+ type,
3146
+ id,
3147
+ language,
3148
+ namespace,
3149
+ ...requestConfig
3150
+ }) => {
3151
+ if (!type) {
3152
+ throw new AsgardeoAPIError(
3153
+ 'The "type" parameter is required',
3154
+ "getFlowMetaV2-ValidationError-001",
3155
+ "javascript",
3156
+ 400,
3157
+ 'The "type" query parameter must be either "APP" or "OU".'
3158
+ );
3159
+ }
3160
+ if (!id) {
3161
+ throw new AsgardeoAPIError(
3162
+ 'The "id" parameter is required',
3163
+ "getFlowMetaV2-ValidationError-002",
3164
+ "javascript",
3165
+ 400,
3166
+ 'The "id" query parameter must be a valid UUID of the target application or organization unit.'
3167
+ );
3168
+ }
3169
+ const queryParams = new URLSearchParams({
3170
+ id,
3171
+ type,
3172
+ ...language ? { language } : {},
3173
+ ...namespace ? { namespace } : {}
3174
+ });
3175
+ const baseEndpoint = url ?? `${baseUrl}/flow/meta`;
3176
+ const endpoint = `${baseEndpoint}?${queryParams.toString()}`;
3177
+ const response = await fetch(endpoint, {
3178
+ ...requestConfig,
3179
+ headers: {
3180
+ Accept: "application/json",
3181
+ ...requestConfig.headers
3182
+ },
3183
+ method: "GET"
3184
+ });
3185
+ if (!response.ok) {
3186
+ const errorText = await response.text();
3187
+ throw new AsgardeoAPIError(
3188
+ `Flow metadata request failed: ${errorText}`,
3189
+ "getFlowMetaV2-ResponseError-001",
3190
+ "javascript",
3191
+ response.status,
3192
+ response.statusText
3193
+ );
3194
+ }
3195
+ const flowMetadata = await response.json();
3196
+ return flowMetadata;
3197
+ };
3198
+ var getFlowMetaV2_default = getFlowMetaV2;
3199
+
3141
3200
  // src/constants/ApplicationNativeAuthenticationConstants.ts
3142
3201
  var ApplicationNativeAuthenticationConstants = {
3143
3202
  SupportedAuthenticators: {
@@ -3254,6 +3313,13 @@ var EmbeddedFlowEventType = /* @__PURE__ */ ((EmbeddedFlowEventType2) => {
3254
3313
  return EmbeddedFlowEventType2;
3255
3314
  })(EmbeddedFlowEventType || {});
3256
3315
 
3316
+ // src/models/v2/flow-meta-v2.ts
3317
+ var FlowMetaType = /* @__PURE__ */ ((FlowMetaType2) => {
3318
+ FlowMetaType2["App"] = "APP";
3319
+ FlowMetaType2["Ou"] = "OU";
3320
+ return FlowMetaType2;
3321
+ })(FlowMetaType || {});
3322
+
3257
3323
  // src/models/flow.ts
3258
3324
  var FlowMode = /* @__PURE__ */ ((FlowMode2) => {
3259
3325
  FlowMode2["Embedded"] = "DIRECT";
@@ -4747,6 +4813,7 @@ export {
4747
4813
  EmbeddedSignUpFlowStatus as EmbeddedSignUpFlowStatusV2,
4748
4814
  EmbeddedSignUpFlowType as EmbeddedSignUpFlowTypeV2,
4749
4815
  FieldType,
4816
+ FlowMetaType,
4750
4817
  FlowMode,
4751
4818
  IsomorphicCrypto,
4752
4819
  OIDCRequestConstants_default as OIDCRequestConstants,
@@ -4784,6 +4851,7 @@ export {
4784
4851
  get_default as get,
4785
4852
  getAllOrganizations_default as getAllOrganizations,
4786
4853
  getBrandingPreference_default as getBrandingPreference,
4854
+ getFlowMetaV2_default as getFlowMetaV2,
4787
4855
  getLatestStateParam_default as getLatestStateParam,
4788
4856
  getMeOrganizations_default as getMeOrganizations,
4789
4857
  getOrganization_default as getOrganization,