@asgardeo/javascript 0.13.0 → 0.15.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
@@ -35,6 +35,7 @@ export { default as executeEmbeddedSignInFlowV2 } from './api/v2/executeEmbedded
35
35
  export { default as executeEmbeddedSignUpFlowV2 } from './api/v2/executeEmbeddedSignUpFlowV2';
36
36
  export { default as executeEmbeddedUserOnboardingFlowV2, EmbeddedUserOnboardingFlowResponse, } from './api/v2/executeEmbeddedUserOnboardingFlowV2';
37
37
  export { default as getFlowMetaV2 } from './api/v2/getFlowMetaV2';
38
+ export { default as getOrganizationUnitChildren } from './api/v2/getOrganizationUnitChildren';
38
39
  export { default as ApplicationNativeAuthenticationConstants } from './constants/ApplicationNativeAuthenticationConstants';
39
40
  export { default as TokenConstants } from './constants/TokenConstants';
40
41
  export { default as OIDCRequestConstants } from './constants/OIDCRequestConstants';
@@ -49,6 +50,7 @@ export { EmbeddedSignInFlowInitiateResponse, EmbeddedSignInFlowStatus, EmbeddedS
49
50
  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
51
  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
52
  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';
53
+ export { OrganizationUnit, OrganizationUnitListResponse, GetOrganizationUnitChildrenConfig, } from './models/v2/organization-unit';
52
54
  export { FlowMetaType, ApplicationMetadata, OUMetadata, DesignMetadata, I18nMetadata, FlowMetadataResponse, GetFlowMetaRequestConfig, FlowMetaTheme, FlowMetaThemeColorSet, FlowMetaThemeBackground, FlowMetaThemeTextColors, FlowMetaThemeColors, FlowMetaThemeColorScheme, FlowMetaThemeShape, FlowMetaThemeTypography, } from './models/v2/flow-meta-v2';
53
55
  export { EmbeddedFlowType, EmbeddedFlowStatus, EmbeddedFlowExecuteResponse, EmbeddedFlowResponseType, EmbeddedSignUpFlowData, EmbeddedFlowComponent, EmbeddedFlowComponentType, EmbeddedFlowExecuteRequestPayload, EmbeddedFlowExecuteRequestConfig, EmbeddedFlowExecuteErrorResponse, } from './models/embedded-flow';
54
56
  export { FlowMode } from './models/flow';
package/dist/index.js CHANGED
@@ -3282,6 +3282,52 @@ var getFlowMetaV2 = async ({
3282
3282
  };
3283
3283
  var getFlowMetaV2_default = getFlowMetaV2;
3284
3284
 
3285
+ // src/api/v2/getOrganizationUnitChildren.ts
3286
+ var getOrganizationUnitChildren = async ({
3287
+ url,
3288
+ baseUrl,
3289
+ organizationUnitId,
3290
+ limit = 10,
3291
+ offset = 0,
3292
+ ...requestConfig
3293
+ }) => {
3294
+ if (!organizationUnitId) {
3295
+ throw new AsgardeoAPIError(
3296
+ "Organization Unit ID is required",
3297
+ "getOrganizationUnitChildren-ValidationError-001",
3298
+ "javascript",
3299
+ 400,
3300
+ "If an organization unit ID is not provided, the request cannot be constructed correctly."
3301
+ );
3302
+ }
3303
+ const queryParams = new URLSearchParams({
3304
+ limit: String(limit),
3305
+ offset: String(offset)
3306
+ });
3307
+ const endpoint = url ?? `${baseUrl}/organization-units/${organizationUnitId}/ous?${queryParams.toString()}`;
3308
+ const response = await fetch(endpoint, {
3309
+ ...requestConfig,
3310
+ headers: {
3311
+ Accept: "application/json",
3312
+ ...requestConfig.headers
3313
+ },
3314
+ method: "GET"
3315
+ });
3316
+ if (!response.ok) {
3317
+ const errorText = await response.text();
3318
+ throw new AsgardeoAPIError(
3319
+ `Failed to fetch organization unit children: ${errorText}`,
3320
+ "getOrganizationUnitChildren-ResponseError-001",
3321
+ "javascript",
3322
+ response.status,
3323
+ response.statusText
3324
+ );
3325
+ }
3326
+ const listResponse = await response.json();
3327
+ return listResponse;
3328
+ };
3329
+ var getOrganizationUnitChildren_default = getOrganizationUnitChildren;
3330
+
3285
3331
  // src/constants/ApplicationNativeAuthenticationConstants.ts
3286
3332
  var ApplicationNativeAuthenticationConstants = {
3287
3333
  SupportedAuthenticators: {
@@ -3356,6 +3402,7 @@ var EmbeddedFlowComponentType2 = /* @__PURE__ */ ((EmbeddedFlowComponentType3) =
3356
3402
  EmbeddedFlowComponentType3["Icon"] = "ICON";
3357
3403
  EmbeddedFlowComponentType3["Image"] = "IMAGE";
3358
3404
  EmbeddedFlowComponentType3["OtpInput"] = "OTP_INPUT";
3405
+ EmbeddedFlowComponentType3["OuSelect"] = "OU_SELECT";
3359
3406
  EmbeddedFlowComponentType3["PasswordInput"] = "PASSWORD_INPUT";
3360
3407
  EmbeddedFlowComponentType3["PhoneInput"] = "PHONE_INPUT";
3361
3408
  EmbeddedFlowComponentType3["RichText"] = "RICH_TEXT";
@@ -3712,11 +3759,13 @@ var lightTheme = {
3712
3759
  error: {
3713
3760
  contrastText: "#d52828",
3714
3761
  dark: "#b71c1c",
3762
+ light: "#fef2f2",
3715
3763
  main: "#d32f2f"
3716
3764
  },
3717
3765
  info: {
3718
3766
  contrastText: "#43aeda",
3719
3767
  dark: "#01579b",
3768
+ light: "#eff6ff",
3720
3769
  main: "#bbebff"
3721
3770
  },
3722
3771
  primary: {
@@ -3727,11 +3776,13 @@ var lightTheme = {
3727
3776
  secondary: {
3728
3777
  contrastText: "#ffffff",
3729
3778
  dark: "#212121",
3779
+ light: "#f3f4f6",
3730
3780
  main: "#424242"
3731
3781
  },
3732
3782
  success: {
3733
3783
  contrastText: "#00a807",
3734
3784
  dark: "#388e3c",
3785
+ light: "#f0fdf4",
3735
3786
  main: "#4caf50"
3736
3787
  },
3737
3788
  text: {
@@ -3742,6 +3793,7 @@ var lightTheme = {
3742
3793
  warning: {
3743
3794
  contrastText: "#be7100",
3744
3795
  dark: "#f57c00",
3796
+ light: "#fffbeb",
3745
3797
  main: "#ff9800"
3746
3798
  }
3747
3799
  },
@@ -3821,11 +3873,13 @@ var darkTheme = {
3821
3873
  error: {
3822
3874
  contrastText: "#d52828",
3823
3875
  dark: "#b71c1c",
3876
+ light: "#2d1515",
3824
3877
  main: "#d32f2f"
3825
3878
  },
3826
3879
  info: {
3827
3880
  contrastText: "#43aeda",
3828
3881
  dark: "#01579b",
3882
+ light: "#0f1f35",
3829
3883
  main: "#bbebff"
3830
3884
  },
3831
3885
  primary: {
@@ -3836,11 +3890,13 @@ var darkTheme = {
3836
3890
  secondary: {
3837
3891
  contrastText: "#ffffff",
3838
3892
  dark: "#212121",
3893
+ light: "#2a2a2a",
3839
3894
  main: "#8b8b8b"
3840
3895
  },
3841
3896
  success: {
3842
3897
  contrastText: "#00a807",
3843
3898
  dark: "#388e3c",
3899
+ light: "#132d1a",
3844
3900
  main: "#4caf50"
3845
3901
  },
3846
3902
  text: {
@@ -3851,6 +3907,7 @@ var darkTheme = {
3851
3907
  warning: {
3852
3908
  contrastText: "#be7100",
3853
3909
  dark: "#f57c00",
3910
+ light: "#2d2310",
3854
3911
  main: "#ff9800"
3855
3912
  }
3856
3913
  },
@@ -3945,6 +4002,9 @@ var toCssVariables = (theme) => {
3945
4002
  if (theme.colors?.secondary?.contrastText) {
3946
4003
  cssVars[`--${prefix}-color-secondary-contrastText`] = theme.colors.secondary.contrastText;
3947
4004
  }
4005
+ if (theme.colors?.secondary?.light) {
4006
+ cssVars[`--${prefix}-color-secondary-light`] = theme.colors.secondary.light;
4007
+ }
3948
4008
  if (theme.colors?.background?.surface) {
3949
4009
  cssVars[`--${prefix}-color-background-surface`] = theme.colors.background.surface;
3950
4010
  }
@@ -3960,24 +4020,36 @@ var toCssVariables = (theme) => {
3960
4020
  if (theme.colors?.error?.contrastText) {
3961
4021
  cssVars[`--${prefix}-color-error-contrastText`] = theme.colors.error.contrastText;
3962
4022
  }
4023
+ if (theme.colors?.error?.light) {
4024
+ cssVars[`--${prefix}-color-error-light`] = theme.colors.error.light;
4025
+ }
3963
4026
  if (theme.colors?.success?.main) {
3964
4027
  cssVars[`--${prefix}-color-success-main`] = theme.colors.success.main;
3965
4028
  }
3966
4029
  if (theme.colors?.success?.contrastText) {
3967
4030
  cssVars[`--${prefix}-color-success-contrastText`] = theme.colors.success.contrastText;
3968
4031
  }
4032
+ if (theme.colors?.success?.light) {
4033
+ cssVars[`--${prefix}-color-success-light`] = theme.colors.success.light;
4034
+ }
3969
4035
  if (theme.colors?.warning?.main) {
3970
4036
  cssVars[`--${prefix}-color-warning-main`] = theme.colors.warning.main;
3971
4037
  }
3972
4038
  if (theme.colors?.warning?.contrastText) {
3973
4039
  cssVars[`--${prefix}-color-warning-contrastText`] = theme.colors.warning.contrastText;
3974
4040
  }
4041
+ if (theme.colors?.warning?.light) {
4042
+ cssVars[`--${prefix}-color-warning-light`] = theme.colors.warning.light;
4043
+ }
3975
4044
  if (theme.colors?.info?.main) {
3976
4045
  cssVars[`--${prefix}-color-info-main`] = theme.colors.info.main;
3977
4046
  }
3978
4047
  if (theme.colors?.info?.contrastText) {
3979
4048
  cssVars[`--${prefix}-color-info-contrastText`] = theme.colors.info.contrastText;
3980
4049
  }
4050
+ if (theme.colors?.info?.light) {
4051
+ cssVars[`--${prefix}-color-info-light`] = theme.colors.info.light;
4052
+ }
3981
4053
  if (theme.colors?.text?.primary) {
3982
4054
  cssVars[`--${prefix}-color-text-primary`] = theme.colors.text.primary;
3983
4055
  }
@@ -5288,6 +5360,7 @@ export {
5288
5360
  getLatestStateParam_default as getLatestStateParam,
5289
5361
  getMeOrganizations_default as getMeOrganizations,
5290
5362
  getOrganization_default as getOrganization,
5363
+ getOrganizationUnitChildren_default as getOrganizationUnitChildren,
5291
5364
  getRedirectBasedSignUpUrl_default as getRedirectBasedSignUpUrl,
5292
5365
  getSchemas_default as getSchemas,
5293
5366
  getScim2Me_default as getScim2Me,