@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.
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ import { GetOrganizationUnitChildrenConfig, OrganizationUnitListResponse } from '../../models/v2/organization-unit';
19
+ /**
20
+ * Retrieves the child organization units of a given parent OU.
21
+ *
22
+ * @param config - Request configuration including `baseUrl`/`url`, `organizationUnitId`,
23
+ * and optional `limit`/`offset` pagination parameters.
24
+ * @returns A promise that resolves with the paginated list of child organization units.
25
+ *
26
+ * @throws {AsgardeoAPIError} When the server returns a non-OK response.
27
+ *
28
+ * @example
29
+ * ```typescript
30
+ * const children = await getOrganizationUnitChildren({
31
+ * baseUrl: 'https://localhost:8090',
32
+ * organizationUnitId: '0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1',
33
+ * limit: 10,
34
+ * offset: 0,
35
+ * });
36
+ * console.log(children.organizationUnits);
37
+ * ```
38
+ *
39
+ * @experimental This function targets the Asgardeo V2 platform API
40
+ */
41
+ declare const getOrganizationUnitChildren: ({ url, baseUrl, organizationUnitId, limit, offset, ...requestConfig }: GetOrganizationUnitChildrenConfig) => Promise<OrganizationUnitListResponse>;
42
+ export default getOrganizationUnitChildren;
package/dist/cjs/index.js CHANGED
@@ -104,6 +104,7 @@ __export(index_exports, {
104
104
  getLatestStateParam: () => getLatestStateParam_default,
105
105
  getMeOrganizations: () => getMeOrganizations_default,
106
106
  getOrganization: () => getOrganization_default,
107
+ getOrganizationUnitChildren: () => getOrganizationUnitChildren_default,
107
108
  getRedirectBasedSignUpUrl: () => getRedirectBasedSignUpUrl_default,
108
109
  getSchemas: () => getSchemas_default,
109
110
  getScim2Me: () => getScim2Me_default,
@@ -3413,6 +3414,52 @@ var getFlowMetaV2 = async ({
3413
3414
  };
3414
3415
  var getFlowMetaV2_default = getFlowMetaV2;
3415
3416
 
3417
+ // src/api/v2/getOrganizationUnitChildren.ts
3418
+ var getOrganizationUnitChildren = async ({
3419
+ url,
3420
+ baseUrl,
3421
+ organizationUnitId,
3422
+ limit = 10,
3423
+ offset = 0,
3424
+ ...requestConfig
3425
+ }) => {
3426
+ if (!organizationUnitId) {
3427
+ throw new AsgardeoAPIError(
3428
+ "Organization Unit ID is required",
3429
+ "getOrganizationUnitChildren-ValidationError-001",
3430
+ "javascript",
3431
+ 400,
3432
+ "If an organization unit ID is not provided, the request cannot be constructed correctly."
3433
+ );
3434
+ }
3435
+ const queryParams = new URLSearchParams({
3436
+ limit: String(limit),
3437
+ offset: String(offset)
3438
+ });
3439
+ const endpoint = url ?? `${baseUrl}/organization-units/${organizationUnitId}/ous?${queryParams.toString()}`;
3440
+ const response = await fetch(endpoint, {
3441
+ ...requestConfig,
3442
+ headers: {
3443
+ Accept: "application/json",
3444
+ ...requestConfig.headers
3445
+ },
3446
+ method: "GET"
3447
+ });
3448
+ if (!response.ok) {
3449
+ const errorText = await response.text();
3450
+ throw new AsgardeoAPIError(
3451
+ `Failed to fetch organization unit children: ${errorText}`,
3452
+ "getOrganizationUnitChildren-ResponseError-001",
3453
+ "javascript",
3454
+ response.status,
3455
+ response.statusText
3456
+ );
3457
+ }
3458
+ const listResponse = await response.json();
3459
+ return listResponse;
3460
+ };
3461
+ var getOrganizationUnitChildren_default = getOrganizationUnitChildren;
3462
+
3416
3463
  // src/constants/ApplicationNativeAuthenticationConstants.ts
3417
3464
  var ApplicationNativeAuthenticationConstants = {
3418
3465
  SupportedAuthenticators: {
@@ -3487,6 +3534,7 @@ var EmbeddedFlowComponentType2 = /* @__PURE__ */ ((EmbeddedFlowComponentType3) =
3487
3534
  EmbeddedFlowComponentType3["Icon"] = "ICON";
3488
3535
  EmbeddedFlowComponentType3["Image"] = "IMAGE";
3489
3536
  EmbeddedFlowComponentType3["OtpInput"] = "OTP_INPUT";
3537
+ EmbeddedFlowComponentType3["OuSelect"] = "OU_SELECT";
3490
3538
  EmbeddedFlowComponentType3["PasswordInput"] = "PASSWORD_INPUT";
3491
3539
  EmbeddedFlowComponentType3["PhoneInput"] = "PHONE_INPUT";
3492
3540
  EmbeddedFlowComponentType3["RichText"] = "RICH_TEXT";
@@ -3843,11 +3891,13 @@ var lightTheme = {
3843
3891
  error: {
3844
3892
  contrastText: "#d52828",
3845
3893
  dark: "#b71c1c",
3894
+ light: "#fef2f2",
3846
3895
  main: "#d32f2f"
3847
3896
  },
3848
3897
  info: {
3849
3898
  contrastText: "#43aeda",
3850
3899
  dark: "#01579b",
3900
+ light: "#eff6ff",
3851
3901
  main: "#bbebff"
3852
3902
  },
3853
3903
  primary: {
@@ -3858,11 +3908,13 @@ var lightTheme = {
3858
3908
  secondary: {
3859
3909
  contrastText: "#ffffff",
3860
3910
  dark: "#212121",
3911
+ light: "#f3f4f6",
3861
3912
  main: "#424242"
3862
3913
  },
3863
3914
  success: {
3864
3915
  contrastText: "#00a807",
3865
3916
  dark: "#388e3c",
3917
+ light: "#f0fdf4",
3866
3918
  main: "#4caf50"
3867
3919
  },
3868
3920
  text: {
@@ -3873,6 +3925,7 @@ var lightTheme = {
3873
3925
  warning: {
3874
3926
  contrastText: "#be7100",
3875
3927
  dark: "#f57c00",
3928
+ light: "#fffbeb",
3876
3929
  main: "#ff9800"
3877
3930
  }
3878
3931
  },
@@ -3952,11 +4005,13 @@ var darkTheme = {
3952
4005
  error: {
3953
4006
  contrastText: "#d52828",
3954
4007
  dark: "#b71c1c",
4008
+ light: "#2d1515",
3955
4009
  main: "#d32f2f"
3956
4010
  },
3957
4011
  info: {
3958
4012
  contrastText: "#43aeda",
3959
4013
  dark: "#01579b",
4014
+ light: "#0f1f35",
3960
4015
  main: "#bbebff"
3961
4016
  },
3962
4017
  primary: {
@@ -3967,11 +4022,13 @@ var darkTheme = {
3967
4022
  secondary: {
3968
4023
  contrastText: "#ffffff",
3969
4024
  dark: "#212121",
4025
+ light: "#2a2a2a",
3970
4026
  main: "#8b8b8b"
3971
4027
  },
3972
4028
  success: {
3973
4029
  contrastText: "#00a807",
3974
4030
  dark: "#388e3c",
4031
+ light: "#132d1a",
3975
4032
  main: "#4caf50"
3976
4033
  },
3977
4034
  text: {
@@ -3982,6 +4039,7 @@ var darkTheme = {
3982
4039
  warning: {
3983
4040
  contrastText: "#be7100",
3984
4041
  dark: "#f57c00",
4042
+ light: "#2d2310",
3985
4043
  main: "#ff9800"
3986
4044
  }
3987
4045
  },
@@ -4076,6 +4134,9 @@ var toCssVariables = (theme) => {
4076
4134
  if (theme.colors?.secondary?.contrastText) {
4077
4135
  cssVars[`--${prefix}-color-secondary-contrastText`] = theme.colors.secondary.contrastText;
4078
4136
  }
4137
+ if (theme.colors?.secondary?.light) {
4138
+ cssVars[`--${prefix}-color-secondary-light`] = theme.colors.secondary.light;
4139
+ }
4079
4140
  if (theme.colors?.background?.surface) {
4080
4141
  cssVars[`--${prefix}-color-background-surface`] = theme.colors.background.surface;
4081
4142
  }
@@ -4091,24 +4152,36 @@ var toCssVariables = (theme) => {
4091
4152
  if (theme.colors?.error?.contrastText) {
4092
4153
  cssVars[`--${prefix}-color-error-contrastText`] = theme.colors.error.contrastText;
4093
4154
  }
4155
+ if (theme.colors?.error?.light) {
4156
+ cssVars[`--${prefix}-color-error-light`] = theme.colors.error.light;
4157
+ }
4094
4158
  if (theme.colors?.success?.main) {
4095
4159
  cssVars[`--${prefix}-color-success-main`] = theme.colors.success.main;
4096
4160
  }
4097
4161
  if (theme.colors?.success?.contrastText) {
4098
4162
  cssVars[`--${prefix}-color-success-contrastText`] = theme.colors.success.contrastText;
4099
4163
  }
4164
+ if (theme.colors?.success?.light) {
4165
+ cssVars[`--${prefix}-color-success-light`] = theme.colors.success.light;
4166
+ }
4100
4167
  if (theme.colors?.warning?.main) {
4101
4168
  cssVars[`--${prefix}-color-warning-main`] = theme.colors.warning.main;
4102
4169
  }
4103
4170
  if (theme.colors?.warning?.contrastText) {
4104
4171
  cssVars[`--${prefix}-color-warning-contrastText`] = theme.colors.warning.contrastText;
4105
4172
  }
4173
+ if (theme.colors?.warning?.light) {
4174
+ cssVars[`--${prefix}-color-warning-light`] = theme.colors.warning.light;
4175
+ }
4106
4176
  if (theme.colors?.info?.main) {
4107
4177
  cssVars[`--${prefix}-color-info-main`] = theme.colors.info.main;
4108
4178
  }
4109
4179
  if (theme.colors?.info?.contrastText) {
4110
4180
  cssVars[`--${prefix}-color-info-contrastText`] = theme.colors.info.contrastText;
4111
4181
  }
4182
+ if (theme.colors?.info?.light) {
4183
+ cssVars[`--${prefix}-color-info-light`] = theme.colors.info.light;
4184
+ }
4112
4185
  if (theme.colors?.text?.primary) {
4113
4186
  cssVars[`--${prefix}-color-text-primary`] = theme.colors.text.primary;
4114
4187
  }
@@ -5420,6 +5493,7 @@ var transformBrandingPreferenceToTheme_default = transformBrandingPreferenceToTh
5420
5493
  getLatestStateParam,
5421
5494
  getMeOrganizations,
5422
5495
  getOrganization,
5496
+ getOrganizationUnitChildren,
5423
5497
  getRedirectBasedSignUpUrl,
5424
5498
  getSchemas,
5425
5499
  getScim2Me,