@thunderid/react 0.3.3 → 0.3.5
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/ThunderIDReactClient.d.ts +1 -5
- package/dist/ThunderIDReactClient.d.ts.map +1 -1
- package/dist/ThunderIDReactClient.js +1 -68
- package/dist/ThunderIDReactClient.js.map +1 -1
- package/dist/cjs/ThunderIDReactClient.cjs +0 -67
- package/dist/cjs/ThunderIDReactClient.cjs.map +1 -1
- package/dist/cjs/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.cjs +1 -1
- package/dist/cjs/components/presentation/UserAvatar/BaseUserAvatar.cjs +57 -0
- package/dist/cjs/components/presentation/UserAvatar/BaseUserAvatar.cjs.map +1 -0
- package/dist/cjs/components/presentation/UserAvatar/UserAvatar.cjs +36 -0
- package/dist/cjs/components/presentation/UserAvatar/UserAvatar.cjs.map +1 -0
- package/dist/cjs/components/presentation/UserDropdown/BaseUserDropdown.cjs +6 -5
- package/dist/cjs/components/presentation/UserDropdown/BaseUserDropdown.cjs.map +1 -1
- package/dist/cjs/components/presentation/auth/AuthOptionFactory.cjs +3 -15
- package/dist/cjs/components/presentation/auth/AuthOptionFactory.cjs.map +1 -1
- package/dist/cjs/contexts/Theme/ThemeContext.cjs.map +1 -1
- package/dist/cjs/contexts/Theme/ThemeProvider.cjs +2 -5
- package/dist/cjs/contexts/Theme/ThemeProvider.cjs.map +1 -1
- package/dist/cjs/contexts/ThunderID/ThunderIDContext.cjs +0 -2
- package/dist/cjs/contexts/ThunderID/ThunderIDContext.cjs.map +1 -1
- package/dist/cjs/contexts/ThunderID/ThunderIDProvider.cjs +14 -90
- package/dist/cjs/contexts/ThunderID/ThunderIDProvider.cjs.map +1 -1
- package/dist/cjs/index.cjs +6 -51
- package/dist/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.js +1 -1
- package/dist/components/presentation/UserAvatar/BaseUserAvatar.d.ts +50 -0
- package/dist/components/presentation/UserAvatar/BaseUserAvatar.d.ts.map +1 -0
- package/dist/components/presentation/UserAvatar/BaseUserAvatar.js +55 -0
- package/dist/components/presentation/UserAvatar/BaseUserAvatar.js.map +1 -0
- package/dist/components/presentation/UserAvatar/UserAvatar.d.ts +46 -0
- package/dist/components/presentation/UserAvatar/UserAvatar.d.ts.map +1 -0
- package/dist/components/presentation/UserAvatar/UserAvatar.js +34 -0
- package/dist/components/presentation/UserAvatar/UserAvatar.js.map +1 -0
- package/dist/components/presentation/UserDropdown/BaseUserDropdown.d.ts.map +1 -1
- package/dist/components/presentation/UserDropdown/BaseUserDropdown.js +6 -5
- package/dist/components/presentation/UserDropdown/BaseUserDropdown.js.map +1 -1
- package/dist/components/presentation/auth/AuthOptionFactory.d.ts +2 -2
- package/dist/components/presentation/auth/AuthOptionFactory.d.ts.map +1 -1
- package/dist/components/presentation/auth/AuthOptionFactory.js +3 -15
- package/dist/components/presentation/auth/AuthOptionFactory.js.map +1 -1
- package/dist/contexts/Theme/ThemeContext.d.ts +0 -12
- package/dist/contexts/Theme/ThemeContext.d.ts.map +1 -1
- package/dist/contexts/Theme/ThemeContext.js.map +1 -1
- package/dist/contexts/Theme/ThemeProvider.d.ts +0 -4
- package/dist/contexts/Theme/ThemeProvider.d.ts.map +1 -1
- package/dist/contexts/Theme/ThemeProvider.js +2 -5
- package/dist/contexts/Theme/ThemeProvider.js.map +1 -1
- package/dist/contexts/ThunderID/ThunderIDContext.d.ts +2 -3
- package/dist/contexts/ThunderID/ThunderIDContext.d.ts.map +1 -1
- package/dist/contexts/ThunderID/ThunderIDContext.js +0 -2
- package/dist/contexts/ThunderID/ThunderIDContext.js.map +1 -1
- package/dist/contexts/ThunderID/ThunderIDProvider.d.ts.map +1 -1
- package/dist/contexts/ThunderID/ThunderIDProvider.js +15 -91
- package/dist/contexts/ThunderID/ThunderIDProvider.js.map +1 -1
- package/dist/index.d.ts +4 -40
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -27
- package/package.json +2 -2
- package/dist/api/createOrganization.d.ts +0 -86
- package/dist/api/createOrganization.d.ts.map +0 -1
- package/dist/api/createOrganization.js +0 -80
- package/dist/api/createOrganization.js.map +0 -1
- package/dist/api/getAllOrganizations.d.ts +0 -78
- package/dist/api/getAllOrganizations.d.ts.map +0 -1
- package/dist/api/getAllOrganizations.js +0 -71
- package/dist/api/getAllOrganizations.js.map +0 -1
- package/dist/api/getMeOrganizations.d.ts +0 -82
- package/dist/api/getMeOrganizations.d.ts.map +0 -1
- package/dist/api/getMeOrganizations.js +0 -75
- package/dist/api/getMeOrganizations.js.map +0 -1
- package/dist/api/getOrganization.d.ts +0 -74
- package/dist/api/getOrganization.d.ts.map +0 -1
- package/dist/api/getOrganization.js +0 -67
- package/dist/api/getOrganization.js.map +0 -1
- package/dist/api/getSchemas.d.ts +0 -72
- package/dist/api/getSchemas.d.ts.map +0 -1
- package/dist/api/getSchemas.js +0 -65
- package/dist/api/getSchemas.js.map +0 -1
- package/dist/api/updateOrganization.d.ts +0 -81
- package/dist/api/updateOrganization.d.ts.map +0 -1
- package/dist/api/updateOrganization.js +0 -74
- package/dist/api/updateOrganization.js.map +0 -1
- package/dist/cjs/api/createOrganization.cjs +0 -82
- package/dist/cjs/api/createOrganization.cjs.map +0 -1
- package/dist/cjs/api/getAllOrganizations.cjs +0 -73
- package/dist/cjs/api/getAllOrganizations.cjs.map +0 -1
- package/dist/cjs/api/getMeOrganizations.cjs +0 -77
- package/dist/cjs/api/getMeOrganizations.cjs.map +0 -1
- package/dist/cjs/api/getOrganization.cjs +0 -69
- package/dist/cjs/api/getOrganization.cjs.map +0 -1
- package/dist/cjs/api/getSchemas.cjs +0 -67
- package/dist/cjs/api/getSchemas.cjs.map +0 -1
- package/dist/cjs/api/updateOrganization.cjs +0 -76
- package/dist/cjs/api/updateOrganization.cjs.map +0 -1
- package/dist/cjs/components/control/OrganizationContext/OrganizationContext.cjs +0 -34
- package/dist/cjs/components/control/OrganizationContext/OrganizationContext.cjs.map +0 -1
- package/dist/cjs/components/control/OrganizationContext/OrganizationContextController.cjs +0 -58
- package/dist/cjs/components/control/OrganizationContext/OrganizationContextController.cjs.map +0 -1
- package/dist/cjs/components/presentation/CreateOrganization/BaseCreateOrganization.cjs +0 -183
- package/dist/cjs/components/presentation/CreateOrganization/BaseCreateOrganization.cjs.map +0 -1
- package/dist/cjs/components/presentation/CreateOrganization/BaseCreateOrganization.styles.cjs +0 -150
- package/dist/cjs/components/presentation/CreateOrganization/BaseCreateOrganization.styles.cjs.map +0 -1
- package/dist/cjs/components/presentation/CreateOrganization/CreateOrganization.cjs +0 -90
- package/dist/cjs/components/presentation/CreateOrganization/CreateOrganization.cjs.map +0 -1
- package/dist/cjs/components/presentation/Organization/BaseOrganization.cjs +0 -41
- package/dist/cjs/components/presentation/Organization/BaseOrganization.cjs.map +0 -1
- package/dist/cjs/components/presentation/Organization/Organization.cjs +0 -49
- package/dist/cjs/components/presentation/Organization/Organization.cjs.map +0 -1
- package/dist/cjs/components/presentation/OrganizationList/BaseOrganizationList.cjs +0 -257
- package/dist/cjs/components/presentation/OrganizationList/BaseOrganizationList.cjs.map +0 -1
- package/dist/cjs/components/presentation/OrganizationList/BaseOrganizationList.styles.cjs +0 -236
- package/dist/cjs/components/presentation/OrganizationList/BaseOrganizationList.styles.cjs.map +0 -1
- package/dist/cjs/components/presentation/OrganizationList/OrganizationList.cjs +0 -86
- package/dist/cjs/components/presentation/OrganizationList/OrganizationList.cjs.map +0 -1
- package/dist/cjs/components/presentation/OrganizationList/OrganizationList.styles.cjs +0 -75
- package/dist/cjs/components/presentation/OrganizationList/OrganizationList.styles.cjs.map +0 -1
- package/dist/cjs/components/presentation/OrganizationProfile/BaseOrganizationProfile.cjs +0 -328
- package/dist/cjs/components/presentation/OrganizationProfile/BaseOrganizationProfile.cjs.map +0 -1
- package/dist/cjs/components/presentation/OrganizationProfile/BaseOrganizationProfile.styles.cjs +0 -166
- package/dist/cjs/components/presentation/OrganizationProfile/BaseOrganizationProfile.styles.cjs.map +0 -1
- package/dist/cjs/components/presentation/OrganizationProfile/OrganizationProfile.cjs +0 -126
- package/dist/cjs/components/presentation/OrganizationProfile/OrganizationProfile.cjs.map +0 -1
- package/dist/cjs/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.cjs +0 -288
- package/dist/cjs/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.cjs.map +0 -1
- package/dist/cjs/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.styles.cjs +0 -237
- package/dist/cjs/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.styles.cjs.map +0 -1
- package/dist/cjs/components/presentation/OrganizationSwitcher/OrganizationSwitcher.cjs +0 -127
- package/dist/cjs/components/presentation/OrganizationSwitcher/OrganizationSwitcher.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.cjs +0 -183
- package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.cjs.map +0 -1
- package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.styles.cjs +0 -128
- package/dist/cjs/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.styles.cjs.map +0 -1
- package/dist/cjs/components/primitives/Icons/Building.cjs +0 -75
- package/dist/cjs/components/primitives/Icons/Building.cjs.map +0 -1
- package/dist/cjs/contexts/Branding/BrandingContext.cjs +0 -12
- package/dist/cjs/contexts/Branding/BrandingContext.cjs.map +0 -1
- package/dist/cjs/contexts/Branding/BrandingProvider.cjs +0 -96
- package/dist/cjs/contexts/Branding/BrandingProvider.cjs.map +0 -1
- package/dist/cjs/contexts/Branding/useBrandingContext.cjs +0 -40
- package/dist/cjs/contexts/Branding/useBrandingContext.cjs.map +0 -1
- package/dist/cjs/contexts/Organization/OrganizationContext.cjs +0 -27
- package/dist/cjs/contexts/Organization/OrganizationContext.cjs.map +0 -1
- package/dist/cjs/contexts/Organization/OrganizationProvider.cjs +0 -97
- package/dist/cjs/contexts/Organization/OrganizationProvider.cjs.map +0 -1
- package/dist/cjs/contexts/Organization/useOrganization.cjs +0 -100
- package/dist/cjs/contexts/Organization/useOrganization.cjs.map +0 -1
- package/dist/cjs/hooks/useBranding.cjs +0 -71
- package/dist/cjs/hooks/useBranding.cjs.map +0 -1
- package/dist/components/control/OrganizationContext/OrganizationContext.d.ts +0 -40
- package/dist/components/control/OrganizationContext/OrganizationContext.d.ts.map +0 -1
- package/dist/components/control/OrganizationContext/OrganizationContext.js +0 -32
- package/dist/components/control/OrganizationContext/OrganizationContext.js.map +0 -1
- package/dist/components/control/OrganizationContext/OrganizationContextController.d.ts +0 -35
- package/dist/components/control/OrganizationContext/OrganizationContextController.d.ts.map +0 -1
- package/dist/components/control/OrganizationContext/OrganizationContextController.js +0 -55
- package/dist/components/control/OrganizationContext/OrganizationContextController.js.map +0 -1
- package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.d.ts +0 -60
- package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.d.ts.map +0 -1
- package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.js +0 -178
- package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.js.map +0 -1
- package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.styles.d.ts +0 -27
- package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.styles.d.ts.map +0 -1
- package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.styles.js +0 -147
- package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.styles.js.map +0 -1
- package/dist/components/presentation/CreateOrganization/CreateOrganization.d.ts +0 -68
- package/dist/components/presentation/CreateOrganization/CreateOrganization.d.ts.map +0 -1
- package/dist/components/presentation/CreateOrganization/CreateOrganization.js +0 -87
- package/dist/components/presentation/CreateOrganization/CreateOrganization.js.map +0 -1
- package/dist/components/presentation/Organization/BaseOrganization.d.ts +0 -67
- package/dist/components/presentation/Organization/BaseOrganization.d.ts.map +0 -1
- package/dist/components/presentation/Organization/BaseOrganization.js +0 -39
- package/dist/components/presentation/Organization/BaseOrganization.js.map +0 -1
- package/dist/components/presentation/Organization/Organization.d.ts +0 -67
- package/dist/components/presentation/Organization/Organization.d.ts.map +0 -1
- package/dist/components/presentation/Organization/Organization.js +0 -47
- package/dist/components/presentation/Organization/Organization.js.map +0 -1
- package/dist/components/presentation/OrganizationList/BaseOrganizationList.d.ts +0 -135
- package/dist/components/presentation/OrganizationList/BaseOrganizationList.d.ts.map +0 -1
- package/dist/components/presentation/OrganizationList/BaseOrganizationList.js +0 -252
- package/dist/components/presentation/OrganizationList/BaseOrganizationList.js.map +0 -1
- package/dist/components/presentation/OrganizationList/BaseOrganizationList.styles.d.ts +0 -27
- package/dist/components/presentation/OrganizationList/BaseOrganizationList.styles.d.ts.map +0 -1
- package/dist/components/presentation/OrganizationList/BaseOrganizationList.styles.js +0 -233
- package/dist/components/presentation/OrganizationList/BaseOrganizationList.styles.js.map +0 -1
- package/dist/components/presentation/OrganizationList/OrganizationList.d.ts +0 -93
- package/dist/components/presentation/OrganizationList/OrganizationList.d.ts.map +0 -1
- package/dist/components/presentation/OrganizationList/OrganizationList.js +0 -82
- package/dist/components/presentation/OrganizationList/OrganizationList.js.map +0 -1
- package/dist/components/presentation/OrganizationList/OrganizationList.styles.d.ts +0 -27
- package/dist/components/presentation/OrganizationList/OrganizationList.styles.d.ts.map +0 -1
- package/dist/components/presentation/OrganizationList/OrganizationList.styles.js +0 -72
- package/dist/components/presentation/OrganizationList/OrganizationList.styles.js.map +0 -1
- package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.d.ts +0 -160
- package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.d.ts.map +0 -1
- package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.js +0 -323
- package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.js.map +0 -1
- package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.styles.d.ts +0 -27
- package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.styles.d.ts.map +0 -1
- package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.styles.js +0 -163
- package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.styles.js.map +0 -1
- package/dist/components/presentation/OrganizationProfile/OrganizationProfile.d.ts +0 -120
- package/dist/components/presentation/OrganizationProfile/OrganizationProfile.d.ts.map +0 -1
- package/dist/components/presentation/OrganizationProfile/OrganizationProfile.js +0 -122
- package/dist/components/presentation/OrganizationProfile/OrganizationProfile.js.map +0 -1
- package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.d.ts +0 -149
- package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.d.ts.map +0 -1
- package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.js +0 -282
- package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.js.map +0 -1
- package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.styles.d.ts +0 -27
- package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.styles.d.ts.map +0 -1
- package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.styles.js +0 -234
- package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.styles.js.map +0 -1
- package/dist/components/presentation/OrganizationSwitcher/OrganizationSwitcher.d.ts +0 -71
- package/dist/components/presentation/OrganizationSwitcher/OrganizationSwitcher.d.ts.map +0 -1
- package/dist/components/presentation/OrganizationSwitcher/OrganizationSwitcher.js +0 -124
- package/dist/components/presentation/OrganizationSwitcher/OrganizationSwitcher.js.map +0 -1
- package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.d.ts +0 -30
- package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.d.ts.map +0 -1
- package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.js +0 -179
- package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.js.map +0 -1
- package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.styles.d.ts +0 -21
- package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.styles.d.ts.map +0 -1
- package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.styles.js +0 -125
- package/dist/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.styles.js.map +0 -1
- package/dist/components/presentation/auth/OrganizationUnitPicker/index.d.ts +0 -20
- package/dist/components/presentation/auth/OrganizationUnitPicker/index.d.ts.map +0 -1
- package/dist/components/primitives/Icons/Building.js +0 -73
- package/dist/components/primitives/Icons/Building.js.map +0 -1
- package/dist/contexts/Branding/BrandingContext.d.ts +0 -53
- package/dist/contexts/Branding/BrandingContext.d.ts.map +0 -1
- package/dist/contexts/Branding/BrandingContext.js +0 -10
- package/dist/contexts/Branding/BrandingContext.js.map +0 -1
- package/dist/contexts/Branding/BrandingProvider.d.ts +0 -89
- package/dist/contexts/Branding/BrandingProvider.d.ts.map +0 -1
- package/dist/contexts/Branding/BrandingProvider.js +0 -92
- package/dist/contexts/Branding/BrandingProvider.js.map +0 -1
- package/dist/contexts/Branding/useBrandingContext.d.ts +0 -45
- package/dist/contexts/Branding/useBrandingContext.d.ts.map +0 -1
- package/dist/contexts/Branding/useBrandingContext.js +0 -38
- package/dist/contexts/Branding/useBrandingContext.js.map +0 -1
- package/dist/contexts/Organization/OrganizationContext.d.ts +0 -41
- package/dist/contexts/Organization/OrganizationContext.d.ts.map +0 -1
- package/dist/contexts/Organization/OrganizationContext.js +0 -25
- package/dist/contexts/Organization/OrganizationContext.js.map +0 -1
- package/dist/contexts/Organization/OrganizationProvider.d.ts +0 -94
- package/dist/contexts/Organization/OrganizationProvider.d.ts.map +0 -1
- package/dist/contexts/Organization/OrganizationProvider.js +0 -93
- package/dist/contexts/Organization/OrganizationProvider.js.map +0 -1
- package/dist/contexts/Organization/useOrganization.d.ts +0 -105
- package/dist/contexts/Organization/useOrganization.d.ts.map +0 -1
- package/dist/contexts/Organization/useOrganization.js +0 -98
- package/dist/contexts/Organization/useOrganization.js.map +0 -1
- package/dist/hooks/useBranding.d.ts +0 -128
- package/dist/hooks/useBranding.d.ts.map +0 -1
- package/dist/hooks/useBranding.js +0 -69
- package/dist/hooks/useBranding.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createOrganization.cjs","names":["response: HttpResponse<any>","FetchHttpClient"],"sources":["../../../src/api/createOrganization.ts"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n Organization,\n HttpResponse,\n FetchHttpClient,\n HttpRequestConfig,\n createOrganization as baseCreateOrganization,\n CreateOrganizationConfig as BaseCreateOrganizationConfig,\n} from '@thunderid/browser';\n\n/**\n * Configuration for the createOrganization request (React-specific)\n */\nexport interface CreateOrganizationConfig extends Omit<BaseCreateOrganizationConfig, 'fetcher'> {\n /**\n * Optional custom fetcher function. If not provided, the ThunderID SPA client's httpClient will be used\n * which is a wrapper around axios http.request\n */\n fetcher?: (url: string, config: RequestInit) => Promise<Response>;\n /**\n * Optional instance ID for multi-instance support. Defaults to 0.\n */\n instanceId?: number;\n}\n\n/**\n * Creates a new organization.\n * This function uses the ThunderID SPA client's httpClient by default, but allows for custom fetchers.\n *\n * @param config - Configuration object containing baseUrl, payload and optional request config.\n * @returns A promise that resolves with the created organization information.\n * @example\n * ```typescript\n * // Using default ThunderID SPA client httpClient\n * try {\n * const organization = await createOrganization({\n * baseUrl: \"https://localhost:8090\",\n * payload: {\n * description: \"Share your screens\",\n * name: \"Team Viewer\",\n * orgHandle: \"team-viewer\",\n * parentId: \"f4825104-4948-40d9-ab65-a960eee3e3d5\",\n * type: \"TENANT\"\n * }\n * });\n * console.log(organization);\n * } catch (error) {\n * if (error instanceof ThunderIDAPIError) {\n * console.error('Failed to create organization:', error.message);\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Using custom fetcher\n * try {\n * const organization = await createOrganization({\n * baseUrl: \"https://localhost:8090\",\n * payload: {\n * description: \"Share your screens\",\n * name: \"Team Viewer\",\n * orgHandle: \"team-viewer\",\n * parentId: \"f4825104-4948-40d9-ab65-a960eee3e3d5\",\n * type: \"TENANT\"\n * },\n * fetcher: customFetchFunction\n * });\n * console.log(organization);\n * } catch (error) {\n * if (error instanceof ThunderIDAPIError) {\n * console.error('Failed to create organization:', error.message);\n * }\n * }\n * ```\n */\nconst createOrganization = async ({\n fetcher,\n instanceId = 0,\n ...requestConfig\n}: CreateOrganizationConfig): Promise<Organization> => {\n const defaultFetcher = async (url: string, config: RequestInit): Promise<Response> => {\n const httpClient: FetchHttpClient = FetchHttpClient.getInstance(instanceId);\n const response: HttpResponse<any> = await httpClient.request({\n data: config.body ? JSON.parse(config.body as string) : undefined,\n headers: config.headers as Record<string, string>,\n method: config.method || 'POST',\n url,\n } as HttpRequestConfig);\n\n return {\n json: () => Promise.resolve(response.data),\n ok: response.status >= 200 && response.status < 300,\n status: response.status,\n statusText: response.statusText || '',\n text: () => Promise.resolve(typeof response.data === 'string' ? response.data : JSON.stringify(response.data)),\n } as Response;\n };\n\n return baseCreateOrganization({\n ...requestConfig,\n fetcher: fetcher || defaultFetcher,\n });\n};\n\nexport default createOrganization;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6FA,MAAM,qBAAqB,OAAO,EAChC,SACA,aAAa,EACb,GAAG,oBACkD;CACrD,MAAM,iBAAiB,OAAO,KAAa,WAA2C;EAEpF,MAAMA,WAA8B,MADAC,oCAAgB,YAAY,WAAW,CACtB,QAAQ;GAC3D,MAAM,OAAO,OAAO,KAAK,MAAM,OAAO,KAAe,GAAG;GACxD,SAAS,OAAO;GAChB,QAAQ,OAAO,UAAU;GACzB;GACD,CAAsB;AAEvB,SAAO;GACL,YAAY,QAAQ,QAAQ,SAAS,KAAK;GAC1C,IAAI,SAAS,UAAU,OAAO,SAAS,SAAS;GAChD,QAAQ,SAAS;GACjB,YAAY,SAAS,cAAc;GACnC,YAAY,QAAQ,QAAQ,OAAO,SAAS,SAAS,WAAW,SAAS,OAAO,KAAK,UAAU,SAAS,KAAK,CAAC;GAC/G;;AAGH,oDAA8B;EAC5B,GAAG;EACH,SAAS,WAAW;EACrB,CAAC;;AAGJ,iCAAe"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let __thunderid_browser = require("@thunderid/browser");
|
|
3
|
-
__thunderid_browser = require_rolldown_runtime.__toESM(__thunderid_browser);
|
|
4
|
-
|
|
5
|
-
//#region src/api/getAllOrganizations.ts
|
|
6
|
-
/**
|
|
7
|
-
* Retrieves all organizations with pagination support.
|
|
8
|
-
* This function uses the ThunderID SPA client's httpClient by default, but allows for custom fetchers.
|
|
9
|
-
*
|
|
10
|
-
* @param config - Configuration object containing baseUrl, optional query parameters, and request config.
|
|
11
|
-
* @returns A promise that resolves with the paginated organizations information.
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* // Using default ThunderID SPA client httpClient
|
|
15
|
-
* try {
|
|
16
|
-
* const response = await getAllOrganizations({
|
|
17
|
-
* baseUrl: "https://localhost:8090",
|
|
18
|
-
* filter: "",
|
|
19
|
-
* limit: 10,
|
|
20
|
-
* recursive: false
|
|
21
|
-
* });
|
|
22
|
-
* console.log(response.organizations);
|
|
23
|
-
* } catch (error) {
|
|
24
|
-
* if (error instanceof ThunderIDAPIError) {
|
|
25
|
-
* console.error('Failed to get organizations:', error.message);
|
|
26
|
-
* }
|
|
27
|
-
* }
|
|
28
|
-
* ```
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* ```typescript
|
|
32
|
-
* // Using custom fetcher
|
|
33
|
-
* try {
|
|
34
|
-
* const response = await getAllOrganizations({
|
|
35
|
-
* baseUrl: "https://localhost:8090",
|
|
36
|
-
* filter: "",
|
|
37
|
-
* limit: 10,
|
|
38
|
-
* recursive: false,
|
|
39
|
-
* fetcher: customFetchFunction
|
|
40
|
-
* });
|
|
41
|
-
* console.log(response.organizations);
|
|
42
|
-
* } catch (error) {
|
|
43
|
-
* if (error instanceof ThunderIDAPIError) {
|
|
44
|
-
* console.error('Failed to get organizations:', error.message);
|
|
45
|
-
* }
|
|
46
|
-
* }
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
const getAllOrganizations = async ({ fetcher, instanceId = 0,...requestConfig }) => {
|
|
50
|
-
const defaultFetcher = async (url, config) => {
|
|
51
|
-
const response = await __thunderid_browser.FetchHttpClient.getInstance(instanceId).request({
|
|
52
|
-
headers: config.headers,
|
|
53
|
-
method: config.method || "GET",
|
|
54
|
-
url
|
|
55
|
-
});
|
|
56
|
-
return {
|
|
57
|
-
json: () => Promise.resolve(response.data),
|
|
58
|
-
ok: response.status >= 200 && response.status < 300,
|
|
59
|
-
status: response.status,
|
|
60
|
-
statusText: response.statusText || "",
|
|
61
|
-
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
return (0, __thunderid_browser.getAllOrganizations)({
|
|
65
|
-
...requestConfig,
|
|
66
|
-
fetcher: fetcher || defaultFetcher
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
var getAllOrganizations_default = getAllOrganizations;
|
|
70
|
-
|
|
71
|
-
//#endregion
|
|
72
|
-
exports.default = getAllOrganizations_default;
|
|
73
|
-
//# sourceMappingURL=getAllOrganizations.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getAllOrganizations.cjs","names":["response: HttpResponse<any>","FetchHttpClient"],"sources":["../../../src/api/getAllOrganizations.ts"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n HttpResponse,\n FetchHttpClient,\n HttpRequestConfig,\n getAllOrganizations as baseGetAllOrganizations,\n GetAllOrganizationsConfig as BaseGetAllOrganizationsConfig,\n AllOrganizationsApiResponse,\n} from '@thunderid/browser';\n\n/**\n * Configuration for the getAllOrganizations request (React-specific)\n */\nexport interface GetAllOrganizationsConfig extends Omit<BaseGetAllOrganizationsConfig, 'fetcher'> {\n /**\n * Optional custom fetcher function. If not provided, the ThunderID SPA client's httpClient will be used\n * which is a wrapper around axios http.request\n */\n fetcher?: (url: string, config: RequestInit) => Promise<Response>;\n /**\n * Optional instance ID for multi-instance support. Defaults to 0.\n */\n instanceId?: number;\n}\n\n/**\n * Retrieves all organizations with pagination support.\n * This function uses the ThunderID SPA client's httpClient by default, but allows for custom fetchers.\n *\n * @param config - Configuration object containing baseUrl, optional query parameters, and request config.\n * @returns A promise that resolves with the paginated organizations information.\n * @example\n * ```typescript\n * // Using default ThunderID SPA client httpClient\n * try {\n * const response = await getAllOrganizations({\n * baseUrl: \"https://localhost:8090\",\n * filter: \"\",\n * limit: 10,\n * recursive: false\n * });\n * console.log(response.organizations);\n * } catch (error) {\n * if (error instanceof ThunderIDAPIError) {\n * console.error('Failed to get organizations:', error.message);\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Using custom fetcher\n * try {\n * const response = await getAllOrganizations({\n * baseUrl: \"https://localhost:8090\",\n * filter: \"\",\n * limit: 10,\n * recursive: false,\n * fetcher: customFetchFunction\n * });\n * console.log(response.organizations);\n * } catch (error) {\n * if (error instanceof ThunderIDAPIError) {\n * console.error('Failed to get organizations:', error.message);\n * }\n * }\n * ```\n */\nconst getAllOrganizations = async ({\n fetcher,\n instanceId = 0,\n ...requestConfig\n}: GetAllOrganizationsConfig): Promise<AllOrganizationsApiResponse> => {\n const defaultFetcher = async (url: string, config: RequestInit): Promise<Response> => {\n const httpClient: FetchHttpClient = FetchHttpClient.getInstance(instanceId);\n const response: HttpResponse<any> = await httpClient.request({\n headers: config.headers as Record<string, string>,\n method: config.method || 'GET',\n url,\n } as HttpRequestConfig);\n\n return {\n json: () => Promise.resolve(response.data),\n ok: response.status >= 200 && response.status < 300,\n status: response.status,\n statusText: response.statusText || '',\n text: () => Promise.resolve(typeof response.data === 'string' ? response.data : JSON.stringify(response.data)),\n } as Response;\n };\n\n return baseGetAllOrganizations({\n ...requestConfig,\n fetcher: fetcher || defaultFetcher,\n });\n};\n\nexport default getAllOrganizations;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqFA,MAAM,sBAAsB,OAAO,EACjC,SACA,aAAa,EACb,GAAG,oBACkE;CACrE,MAAM,iBAAiB,OAAO,KAAa,WAA2C;EAEpF,MAAMA,WAA8B,MADAC,oCAAgB,YAAY,WAAW,CACtB,QAAQ;GAC3D,SAAS,OAAO;GAChB,QAAQ,OAAO,UAAU;GACzB;GACD,CAAsB;AAEvB,SAAO;GACL,YAAY,QAAQ,QAAQ,SAAS,KAAK;GAC1C,IAAI,SAAS,UAAU,OAAO,SAAS,SAAS;GAChD,QAAQ,SAAS;GACjB,YAAY,SAAS,cAAc;GACnC,YAAY,QAAQ,QAAQ,OAAO,SAAS,SAAS,WAAW,SAAS,OAAO,KAAK,UAAU,SAAS,KAAK,CAAC;GAC/G;;AAGH,qDAA+B;EAC7B,GAAG;EACH,SAAS,WAAW;EACrB,CAAC;;AAGJ,kCAAe"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let __thunderid_browser = require("@thunderid/browser");
|
|
3
|
-
__thunderid_browser = require_rolldown_runtime.__toESM(__thunderid_browser);
|
|
4
|
-
|
|
5
|
-
//#region src/api/getMeOrganizations.ts
|
|
6
|
-
/**
|
|
7
|
-
* Retrieves the organizations associated with the current user.
|
|
8
|
-
* This function uses the ThunderID SPA client's httpClient by default, but allows for custom fetchers.
|
|
9
|
-
*
|
|
10
|
-
* @param config - Configuration object containing baseUrl, optional query parameters, and request config.
|
|
11
|
-
* @returns A promise that resolves with the organizations information.
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* // Using default ThunderID SPA client httpClient
|
|
15
|
-
* try {
|
|
16
|
-
* const organizations = await getMeOrganizations({
|
|
17
|
-
* baseUrl: "https://localhost:8090",
|
|
18
|
-
* after: "",
|
|
19
|
-
* before: "",
|
|
20
|
-
* filter: "",
|
|
21
|
-
* limit: 10,
|
|
22
|
-
* recursive: false
|
|
23
|
-
* });
|
|
24
|
-
* console.log(organizations);
|
|
25
|
-
* } catch (error) {
|
|
26
|
-
* if (error instanceof ThunderIDAPIError) {
|
|
27
|
-
* console.error('Failed to get organizations:', error.message);
|
|
28
|
-
* }
|
|
29
|
-
* }
|
|
30
|
-
* ```
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```typescript
|
|
34
|
-
* // Using custom fetcher
|
|
35
|
-
* try {
|
|
36
|
-
* const organizations = await getMeOrganizations({
|
|
37
|
-
* baseUrl: "https://localhost:8090",
|
|
38
|
-
* after: "",
|
|
39
|
-
* before: "",
|
|
40
|
-
* filter: "",
|
|
41
|
-
* limit: 10,
|
|
42
|
-
* recursive: false,
|
|
43
|
-
* fetcher: customFetchFunction
|
|
44
|
-
* });
|
|
45
|
-
* console.log(organizations);
|
|
46
|
-
* } catch (error) {
|
|
47
|
-
* if (error instanceof ThunderIDAPIError) {
|
|
48
|
-
* console.error('Failed to get organizations:', error.message);
|
|
49
|
-
* }
|
|
50
|
-
* }
|
|
51
|
-
* ```
|
|
52
|
-
*/
|
|
53
|
-
const getMeOrganizations = async ({ fetcher, instanceId = 0,...requestConfig }) => {
|
|
54
|
-
const defaultFetcher = async (url, config) => {
|
|
55
|
-
const response = await __thunderid_browser.FetchHttpClient.getInstance(instanceId).request({
|
|
56
|
-
headers: config.headers,
|
|
57
|
-
method: config.method || "GET",
|
|
58
|
-
url
|
|
59
|
-
});
|
|
60
|
-
return {
|
|
61
|
-
json: () => Promise.resolve(response.data),
|
|
62
|
-
ok: response.status >= 200 && response.status < 300,
|
|
63
|
-
status: response.status,
|
|
64
|
-
statusText: response.statusText || "",
|
|
65
|
-
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
return (0, __thunderid_browser.getMeOrganizations)({
|
|
69
|
-
...requestConfig,
|
|
70
|
-
fetcher: fetcher || defaultFetcher
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
var getMeOrganizations_default = getMeOrganizations;
|
|
74
|
-
|
|
75
|
-
//#endregion
|
|
76
|
-
exports.default = getMeOrganizations_default;
|
|
77
|
-
//# sourceMappingURL=getMeOrganizations.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getMeOrganizations.cjs","names":["response: HttpResponse<any>","FetchHttpClient"],"sources":["../../../src/api/getMeOrganizations.ts"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n Organization,\n HttpResponse,\n FetchHttpClient,\n HttpRequestConfig,\n getMeOrganizations as baseGetMeOrganizations,\n GetMeOrganizationsConfig as BaseGetMeOrganizationsConfig,\n} from '@thunderid/browser';\n\n/**\n * Configuration for the getMeOrganizations request (React-specific)\n */\nexport interface GetMeOrganizationsConfig extends Omit<BaseGetMeOrganizationsConfig, 'fetcher'> {\n /**\n * Optional custom fetcher function. If not provided, the ThunderID SPA client's httpClient will be used\n * which is a wrapper around axios http.request\n */\n fetcher?: (url: string, config: RequestInit) => Promise<Response>;\n /**\n * Optional instance ID for multi-instance support. Defaults to 0.\n */\n instanceId?: number;\n}\n\n/**\n * Retrieves the organizations associated with the current user.\n * This function uses the ThunderID SPA client's httpClient by default, but allows for custom fetchers.\n *\n * @param config - Configuration object containing baseUrl, optional query parameters, and request config.\n * @returns A promise that resolves with the organizations information.\n * @example\n * ```typescript\n * // Using default ThunderID SPA client httpClient\n * try {\n * const organizations = await getMeOrganizations({\n * baseUrl: \"https://localhost:8090\",\n * after: \"\",\n * before: \"\",\n * filter: \"\",\n * limit: 10,\n * recursive: false\n * });\n * console.log(organizations);\n * } catch (error) {\n * if (error instanceof ThunderIDAPIError) {\n * console.error('Failed to get organizations:', error.message);\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Using custom fetcher\n * try {\n * const organizations = await getMeOrganizations({\n * baseUrl: \"https://localhost:8090\",\n * after: \"\",\n * before: \"\",\n * filter: \"\",\n * limit: 10,\n * recursive: false,\n * fetcher: customFetchFunction\n * });\n * console.log(organizations);\n * } catch (error) {\n * if (error instanceof ThunderIDAPIError) {\n * console.error('Failed to get organizations:', error.message);\n * }\n * }\n * ```\n */\nconst getMeOrganizations = async ({\n fetcher,\n instanceId = 0,\n ...requestConfig\n}: GetMeOrganizationsConfig): Promise<Organization[]> => {\n const defaultFetcher = async (url: string, config: RequestInit): Promise<Response> => {\n const httpClient: FetchHttpClient = FetchHttpClient.getInstance(instanceId);\n const response: HttpResponse<any> = await httpClient.request({\n headers: config.headers as Record<string, string>,\n method: config.method || 'GET',\n url,\n } as HttpRequestConfig);\n\n return {\n json: () => Promise.resolve(response.data),\n ok: response.status >= 200 && response.status < 300,\n status: response.status,\n statusText: response.statusText || '',\n text: () => Promise.resolve(typeof response.data === 'string' ? response.data : JSON.stringify(response.data)),\n } as Response;\n };\n\n return baseGetMeOrganizations({\n ...requestConfig,\n fetcher: fetcher || defaultFetcher,\n });\n};\n\nexport default getMeOrganizations;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyFA,MAAM,qBAAqB,OAAO,EAChC,SACA,aAAa,EACb,GAAG,oBACoD;CACvD,MAAM,iBAAiB,OAAO,KAAa,WAA2C;EAEpF,MAAMA,WAA8B,MADAC,oCAAgB,YAAY,WAAW,CACtB,QAAQ;GAC3D,SAAS,OAAO;GAChB,QAAQ,OAAO,UAAU;GACzB;GACD,CAAsB;AAEvB,SAAO;GACL,YAAY,QAAQ,QAAQ,SAAS,KAAK;GAC1C,IAAI,SAAS,UAAU,OAAO,SAAS,SAAS;GAChD,QAAQ,SAAS;GACjB,YAAY,SAAS,cAAc;GACnC,YAAY,QAAQ,QAAQ,OAAO,SAAS,SAAS,WAAW,SAAS,OAAO,KAAK,UAAU,SAAS,KAAK,CAAC;GAC/G;;AAGH,oDAA8B;EAC5B,GAAG;EACH,SAAS,WAAW;EACrB,CAAC;;AAGJ,iCAAe"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let __thunderid_browser = require("@thunderid/browser");
|
|
3
|
-
__thunderid_browser = require_rolldown_runtime.__toESM(__thunderid_browser);
|
|
4
|
-
|
|
5
|
-
//#region src/api/getOrganization.ts
|
|
6
|
-
/**
|
|
7
|
-
* Retrieves detailed information for a specific organization.
|
|
8
|
-
* This function uses the ThunderID SPA client's httpClient by default, but allows for custom fetchers.
|
|
9
|
-
*
|
|
10
|
-
* @param config - Configuration object containing baseUrl, organizationId, and request config.
|
|
11
|
-
* @returns A promise that resolves with the organization details.
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* // Using default ThunderID SPA client httpClient
|
|
15
|
-
* try {
|
|
16
|
-
* const organization = await getOrganization({
|
|
17
|
-
* baseUrl: "https://localhost:8090",
|
|
18
|
-
* organizationId: "0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1"
|
|
19
|
-
* });
|
|
20
|
-
* console.log(organization);
|
|
21
|
-
* } catch (error) {
|
|
22
|
-
* if (error instanceof ThunderIDAPIError) {
|
|
23
|
-
* console.error('Failed to get organization:', error.message);
|
|
24
|
-
* }
|
|
25
|
-
* }
|
|
26
|
-
* ```
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```typescript
|
|
30
|
-
* // Using custom fetcher
|
|
31
|
-
* try {
|
|
32
|
-
* const organization = await getOrganization({
|
|
33
|
-
* baseUrl: "https://localhost:8090",
|
|
34
|
-
* organizationId: "0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1",
|
|
35
|
-
* fetcher: customFetchFunction
|
|
36
|
-
* });
|
|
37
|
-
* console.log(organization);
|
|
38
|
-
* } catch (error) {
|
|
39
|
-
* if (error instanceof ThunderIDAPIError) {
|
|
40
|
-
* console.error('Failed to get organization:', error.message);
|
|
41
|
-
* }
|
|
42
|
-
* }
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
const getOrganization = async ({ fetcher, instanceId = 0,...requestConfig }) => {
|
|
46
|
-
const defaultFetcher = async (url, config) => {
|
|
47
|
-
const response = await __thunderid_browser.FetchHttpClient.getInstance(instanceId).request({
|
|
48
|
-
headers: config.headers,
|
|
49
|
-
method: config.method || "GET",
|
|
50
|
-
url
|
|
51
|
-
});
|
|
52
|
-
return {
|
|
53
|
-
json: () => Promise.resolve(response.data),
|
|
54
|
-
ok: response.status >= 200 && response.status < 300,
|
|
55
|
-
status: response.status,
|
|
56
|
-
statusText: response.statusText || "",
|
|
57
|
-
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
return (0, __thunderid_browser.getOrganization)({
|
|
61
|
-
...requestConfig,
|
|
62
|
-
fetcher: fetcher || defaultFetcher
|
|
63
|
-
});
|
|
64
|
-
};
|
|
65
|
-
var getOrganization_default = getOrganization;
|
|
66
|
-
|
|
67
|
-
//#endregion
|
|
68
|
-
exports.default = getOrganization_default;
|
|
69
|
-
//# sourceMappingURL=getOrganization.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getOrganization.cjs","names":["response: HttpResponse<any>","FetchHttpClient"],"sources":["../../../src/api/getOrganization.ts"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n HttpResponse,\n FetchHttpClient,\n HttpRequestConfig,\n getOrganization as baseGetOrganization,\n GetOrganizationConfig as BaseGetOrganizationConfig,\n OrganizationDetails,\n} from '@thunderid/browser';\n\n/**\n * Configuration for the getOrganization request (React-specific)\n */\nexport interface GetOrganizationConfig extends Omit<BaseGetOrganizationConfig, 'fetcher'> {\n /**\n * Optional custom fetcher function. If not provided, the ThunderID SPA client's httpClient will be used\n * which is a wrapper around axios http.request\n */\n fetcher?: (url: string, config: RequestInit) => Promise<Response>;\n /**\n * Optional instance ID for multi-instance support. Defaults to 0.\n */\n instanceId?: number;\n}\n\n/**\n * Retrieves detailed information for a specific organization.\n * This function uses the ThunderID SPA client's httpClient by default, but allows for custom fetchers.\n *\n * @param config - Configuration object containing baseUrl, organizationId, and request config.\n * @returns A promise that resolves with the organization details.\n * @example\n * ```typescript\n * // Using default ThunderID SPA client httpClient\n * try {\n * const organization = await getOrganization({\n * baseUrl: \"https://localhost:8090\",\n * organizationId: \"0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1\"\n * });\n * console.log(organization);\n * } catch (error) {\n * if (error instanceof ThunderIDAPIError) {\n * console.error('Failed to get organization:', error.message);\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Using custom fetcher\n * try {\n * const organization = await getOrganization({\n * baseUrl: \"https://localhost:8090\",\n * organizationId: \"0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1\",\n * fetcher: customFetchFunction\n * });\n * console.log(organization);\n * } catch (error) {\n * if (error instanceof ThunderIDAPIError) {\n * console.error('Failed to get organization:', error.message);\n * }\n * }\n * ```\n */\nconst getOrganization = async ({\n fetcher,\n instanceId = 0,\n ...requestConfig\n}: GetOrganizationConfig): Promise<OrganizationDetails> => {\n const defaultFetcher = async (url: string, config: RequestInit): Promise<Response> => {\n const httpClient: FetchHttpClient = FetchHttpClient.getInstance(instanceId);\n const response: HttpResponse<any> = await httpClient.request({\n headers: config.headers as Record<string, string>,\n method: config.method || 'GET',\n url,\n } as HttpRequestConfig);\n\n return {\n json: () => Promise.resolve(response.data),\n ok: response.status >= 200 && response.status < 300,\n status: response.status,\n statusText: response.statusText || '',\n text: () => Promise.resolve(typeof response.data === 'string' ? response.data : JSON.stringify(response.data)),\n } as Response;\n };\n\n return baseGetOrganization({\n ...requestConfig,\n fetcher: fetcher || defaultFetcher,\n });\n};\n\nexport default getOrganization;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiFA,MAAM,kBAAkB,OAAO,EAC7B,SACA,aAAa,EACb,GAAG,oBACsD;CACzD,MAAM,iBAAiB,OAAO,KAAa,WAA2C;EAEpF,MAAMA,WAA8B,MADAC,oCAAgB,YAAY,WAAW,CACtB,QAAQ;GAC3D,SAAS,OAAO;GAChB,QAAQ,OAAO,UAAU;GACzB;GACD,CAAsB;AAEvB,SAAO;GACL,YAAY,QAAQ,QAAQ,SAAS,KAAK;GAC1C,IAAI,SAAS,UAAU,OAAO,SAAS,SAAS;GAChD,QAAQ,SAAS;GACjB,YAAY,SAAS,cAAc;GACnC,YAAY,QAAQ,QAAQ,OAAO,SAAS,SAAS,WAAW,SAAS,OAAO,KAAK,UAAU,SAAS,KAAK,CAAC;GAC/G;;AAGH,iDAA2B;EACzB,GAAG;EACH,SAAS,WAAW;EACrB,CAAC;;AAGJ,8BAAe"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let __thunderid_browser = require("@thunderid/browser");
|
|
3
|
-
__thunderid_browser = require_rolldown_runtime.__toESM(__thunderid_browser);
|
|
4
|
-
|
|
5
|
-
//#region src/api/getSchemas.ts
|
|
6
|
-
/**
|
|
7
|
-
* Retrieves the SCIM2 schemas from the specified endpoint.
|
|
8
|
-
* This function uses the ThunderID SPA client's httpClient by default, but allows for custom fetchers.
|
|
9
|
-
*
|
|
10
|
-
* @param config - Request configuration object.
|
|
11
|
-
* @returns A promise that resolves with the SCIM2 schemas information.
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* // Using default ThunderID SPA client httpClient
|
|
15
|
-
* try {
|
|
16
|
-
* const schemas = await getSchemas({
|
|
17
|
-
* url: "https://localhost:8090/scim2/Schemas",
|
|
18
|
-
* });
|
|
19
|
-
* console.log(schemas);
|
|
20
|
-
* } catch (error) {
|
|
21
|
-
* if (error instanceof ThunderIDAPIError) {
|
|
22
|
-
* console.error('Failed to get schemas:', error.message);
|
|
23
|
-
* }
|
|
24
|
-
* }
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* ```typescript
|
|
29
|
-
* // Using custom fetcher
|
|
30
|
-
* try {
|
|
31
|
-
* const schemas = await getSchemas({
|
|
32
|
-
* url: "https://localhost:8090/scim2/Schemas",
|
|
33
|
-
* fetcher: customFetchFunction
|
|
34
|
-
* });
|
|
35
|
-
* console.log(schemas);
|
|
36
|
-
* } catch (error) {
|
|
37
|
-
* if (error instanceof ThunderIDAPIError) {
|
|
38
|
-
* console.error('Failed to get schemas:', error.message);
|
|
39
|
-
* }
|
|
40
|
-
* }
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
const getSchemas = async ({ fetcher, instanceId = 0,...requestConfig }) => {
|
|
44
|
-
const defaultFetcher = async (url, config) => {
|
|
45
|
-
const response = await __thunderid_browser.FetchHttpClient.getInstance(instanceId).request({
|
|
46
|
-
headers: config.headers,
|
|
47
|
-
method: config.method || "GET",
|
|
48
|
-
url
|
|
49
|
-
});
|
|
50
|
-
return {
|
|
51
|
-
json: () => Promise.resolve(response.data),
|
|
52
|
-
ok: response.status >= 200 && response.status < 300,
|
|
53
|
-
status: response.status,
|
|
54
|
-
statusText: response.statusText || "",
|
|
55
|
-
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
return (0, __thunderid_browser.getSchemas)({
|
|
59
|
-
...requestConfig,
|
|
60
|
-
fetcher: fetcher || defaultFetcher
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
|
-
var getSchemas_default = getSchemas;
|
|
64
|
-
|
|
65
|
-
//#endregion
|
|
66
|
-
exports.default = getSchemas_default;
|
|
67
|
-
//# sourceMappingURL=getSchemas.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSchemas.cjs","names":["response: HttpResponse<any>","FetchHttpClient"],"sources":["../../../src/api/getSchemas.ts"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n Schema,\n HttpResponse,\n FetchHttpClient,\n HttpRequestConfig,\n getSchemas as baseGetSchemas,\n GetSchemasConfig as BaseGetSchemasConfig,\n} from '@thunderid/browser';\n\n/**\n * Configuration for the getSchemas request (React-specific)\n */\nexport interface GetSchemasConfig extends Omit<BaseGetSchemasConfig, 'fetcher'> {\n /**\n * Optional custom fetcher function. If not provided, the ThunderID SPA client's httpClient will be used\n * which is a wrapper around axios http.request\n */\n fetcher?: (url: string, config: RequestInit) => Promise<Response>;\n /**\n * Optional instance ID for multi-instance support. Defaults to 0.\n */\n instanceId?: number;\n}\n\n/**\n * Retrieves the SCIM2 schemas from the specified endpoint.\n * This function uses the ThunderID SPA client's httpClient by default, but allows for custom fetchers.\n *\n * @param config - Request configuration object.\n * @returns A promise that resolves with the SCIM2 schemas information.\n * @example\n * ```typescript\n * // Using default ThunderID SPA client httpClient\n * try {\n * const schemas = await getSchemas({\n * url: \"https://localhost:8090/scim2/Schemas\",\n * });\n * console.log(schemas);\n * } catch (error) {\n * if (error instanceof ThunderIDAPIError) {\n * console.error('Failed to get schemas:', error.message);\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Using custom fetcher\n * try {\n * const schemas = await getSchemas({\n * url: \"https://localhost:8090/scim2/Schemas\",\n * fetcher: customFetchFunction\n * });\n * console.log(schemas);\n * } catch (error) {\n * if (error instanceof ThunderIDAPIError) {\n * console.error('Failed to get schemas:', error.message);\n * }\n * }\n * ```\n */\nconst getSchemas = async ({fetcher, instanceId = 0, ...requestConfig}: GetSchemasConfig): Promise<Schema[]> => {\n const defaultFetcher = async (url: string, config: RequestInit): Promise<Response> => {\n const httpClient: FetchHttpClient = FetchHttpClient.getInstance(instanceId);\n const response: HttpResponse<any> = await httpClient.request({\n headers: config.headers as Record<string, string>,\n method: config.method || 'GET',\n url,\n } as HttpRequestConfig);\n\n return {\n json: () => Promise.resolve(response.data),\n ok: response.status >= 200 && response.status < 300,\n status: response.status,\n statusText: response.statusText || '',\n text: () => Promise.resolve(typeof response.data === 'string' ? response.data : JSON.stringify(response.data)),\n } as Response;\n };\n\n return baseGetSchemas({\n ...requestConfig,\n fetcher: fetcher || defaultFetcher,\n });\n};\n\nexport default getSchemas;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+EA,MAAM,aAAa,OAAO,EAAC,SAAS,aAAa,EAAG,GAAG,oBAAwD;CAC7G,MAAM,iBAAiB,OAAO,KAAa,WAA2C;EAEpF,MAAMA,WAA8B,MADAC,oCAAgB,YAAY,WAAW,CACtB,QAAQ;GAC3D,SAAS,OAAO;GAChB,QAAQ,OAAO,UAAU;GACzB;GACD,CAAsB;AAEvB,SAAO;GACL,YAAY,QAAQ,QAAQ,SAAS,KAAK;GAC1C,IAAI,SAAS,UAAU,OAAO,SAAS,SAAS;GAChD,QAAQ,SAAS;GACjB,YAAY,SAAS,cAAc;GACnC,YAAY,QAAQ,QAAQ,OAAO,SAAS,SAAS,WAAW,SAAS,OAAO,KAAK,UAAU,SAAS,KAAK,CAAC;GAC/G;;AAGH,4CAAsB;EACpB,GAAG;EACH,SAAS,WAAW;EACrB,CAAC;;AAGJ,yBAAe"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let __thunderid_browser = require("@thunderid/browser");
|
|
3
|
-
__thunderid_browser = require_rolldown_runtime.__toESM(__thunderid_browser);
|
|
4
|
-
|
|
5
|
-
//#region src/api/updateOrganization.ts
|
|
6
|
-
/**
|
|
7
|
-
* Updates the organization information using the Organizations Management API.
|
|
8
|
-
* This function uses the ThunderID SPA client's httpClient by default, but allows for custom fetchers.
|
|
9
|
-
*
|
|
10
|
-
* @param config - Configuration object with baseUrl, organizationId, operations and optional request config.
|
|
11
|
-
* @returns A promise that resolves with the updated organization information.
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* // Using the helper function to create operations automatically
|
|
15
|
-
* const operations = createPatchOperations({
|
|
16
|
-
* name: "Updated Organization Name", // Will use REPLACE
|
|
17
|
-
* description: "", // Will use REMOVE (empty string)
|
|
18
|
-
* customField: "Some value" // Will use REPLACE
|
|
19
|
-
* });
|
|
20
|
-
*
|
|
21
|
-
* await updateOrganization({
|
|
22
|
-
* baseUrl: "https://localhost:8090",
|
|
23
|
-
* organizationId: "0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1",
|
|
24
|
-
* operations
|
|
25
|
-
* });
|
|
26
|
-
*
|
|
27
|
-
* // Or manually specify operations
|
|
28
|
-
* await updateOrganization({
|
|
29
|
-
* baseUrl: "https://localhost:8090",
|
|
30
|
-
* organizationId: "0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1",
|
|
31
|
-
* operations: [
|
|
32
|
-
* { operation: "REPLACE", path: "/name", value: "Updated Organization Name" },
|
|
33
|
-
* { operation: "REMOVE", path: "/description" }
|
|
34
|
-
* ]
|
|
35
|
-
* });
|
|
36
|
-
* ```
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* ```typescript
|
|
40
|
-
* // Using custom fetcher
|
|
41
|
-
* await updateOrganization({
|
|
42
|
-
* baseUrl: "https://localhost:8090",
|
|
43
|
-
* organizationId: "0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1",
|
|
44
|
-
* operations: [
|
|
45
|
-
* { operation: "REPLACE", path: "/name", value: "Updated Organization Name" }
|
|
46
|
-
* ],
|
|
47
|
-
* fetcher: customFetchFunction
|
|
48
|
-
* });
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
const updateOrganization = async ({ fetcher, instanceId = 0,...requestConfig }) => {
|
|
52
|
-
const defaultFetcher = async (url, config) => {
|
|
53
|
-
const response = await __thunderid_browser.FetchHttpClient.getInstance(instanceId).request({
|
|
54
|
-
data: config.body ? JSON.parse(config.body) : void 0,
|
|
55
|
-
headers: config.headers,
|
|
56
|
-
method: config.method || "PATCH",
|
|
57
|
-
url
|
|
58
|
-
});
|
|
59
|
-
return {
|
|
60
|
-
json: () => Promise.resolve(response.data),
|
|
61
|
-
ok: response.status >= 200 && response.status < 300,
|
|
62
|
-
status: response.status,
|
|
63
|
-
statusText: response.statusText || "",
|
|
64
|
-
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
return (0, __thunderid_browser.updateOrganization)({
|
|
68
|
-
...requestConfig,
|
|
69
|
-
fetcher: fetcher || defaultFetcher
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
var updateOrganization_default = updateOrganization;
|
|
73
|
-
|
|
74
|
-
//#endregion
|
|
75
|
-
exports.default = updateOrganization_default;
|
|
76
|
-
//# sourceMappingURL=updateOrganization.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"updateOrganization.cjs","names":["response: HttpResponse<any>","FetchHttpClient"],"sources":["../../../src/api/updateOrganization.ts"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n HttpResponse,\n FetchHttpClient,\n HttpRequestConfig,\n updateOrganization as baseUpdateOrganization,\n UpdateOrganizationConfig as BaseUpdateOrganizationConfig,\n OrganizationDetails,\n createPatchOperations,\n} from '@thunderid/browser';\n\n/**\n * Configuration for the updateOrganization request (React-specific)\n */\nexport interface UpdateOrganizationConfig extends Omit<BaseUpdateOrganizationConfig, 'fetcher'> {\n /**\n * Optional custom fetcher function. If not provided, the ThunderID SPA client's httpClient will be used\n * which is a wrapper around axios http.request\n */\n fetcher?: (url: string, config: RequestInit) => Promise<Response>;\n /**\n * Optional instance ID for multi-instance support. Defaults to 0.\n */\n instanceId?: number;\n}\n\n/**\n * Updates the organization information using the Organizations Management API.\n * This function uses the ThunderID SPA client's httpClient by default, but allows for custom fetchers.\n *\n * @param config - Configuration object with baseUrl, organizationId, operations and optional request config.\n * @returns A promise that resolves with the updated organization information.\n * @example\n * ```typescript\n * // Using the helper function to create operations automatically\n * const operations = createPatchOperations({\n * name: \"Updated Organization Name\", // Will use REPLACE\n * description: \"\", // Will use REMOVE (empty string)\n * customField: \"Some value\" // Will use REPLACE\n * });\n *\n * await updateOrganization({\n * baseUrl: \"https://localhost:8090\",\n * organizationId: \"0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1\",\n * operations\n * });\n *\n * // Or manually specify operations\n * await updateOrganization({\n * baseUrl: \"https://localhost:8090\",\n * organizationId: \"0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1\",\n * operations: [\n * { operation: \"REPLACE\", path: \"/name\", value: \"Updated Organization Name\" },\n * { operation: \"REMOVE\", path: \"/description\" }\n * ]\n * });\n * ```\n *\n * @example\n * ```typescript\n * // Using custom fetcher\n * await updateOrganization({\n * baseUrl: \"https://localhost:8090\",\n * organizationId: \"0d5e071b-d3d3-475d-b3c6-1a20ee2fa9b1\",\n * operations: [\n * { operation: \"REPLACE\", path: \"/name\", value: \"Updated Organization Name\" }\n * ],\n * fetcher: customFetchFunction\n * });\n * ```\n */\nconst updateOrganization = async ({\n fetcher,\n instanceId = 0,\n ...requestConfig\n}: UpdateOrganizationConfig): Promise<OrganizationDetails> => {\n const defaultFetcher = async (url: string, config: RequestInit): Promise<Response> => {\n const httpClient: FetchHttpClient = FetchHttpClient.getInstance(instanceId);\n const response: HttpResponse<any> = await httpClient.request({\n data: config.body ? JSON.parse(config.body as string) : undefined,\n headers: config.headers as Record<string, string>,\n method: config.method || 'PATCH',\n url,\n } as HttpRequestConfig);\n\n return {\n json: () => Promise.resolve(response.data),\n ok: response.status >= 200 && response.status < 300,\n status: response.status,\n statusText: response.statusText || '',\n text: () => Promise.resolve(typeof response.data === 'string' ? response.data : JSON.stringify(response.data)),\n } as Response;\n };\n\n return baseUpdateOrganization({\n ...requestConfig,\n fetcher: fetcher || defaultFetcher,\n });\n};\n\n// Re-export the helper function\nexport {createPatchOperations};\n\nexport default updateOrganization;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwFA,MAAM,qBAAqB,OAAO,EAChC,SACA,aAAa,EACb,GAAG,oBACyD;CAC5D,MAAM,iBAAiB,OAAO,KAAa,WAA2C;EAEpF,MAAMA,WAA8B,MADAC,oCAAgB,YAAY,WAAW,CACtB,QAAQ;GAC3D,MAAM,OAAO,OAAO,KAAK,MAAM,OAAO,KAAe,GAAG;GACxD,SAAS,OAAO;GAChB,QAAQ,OAAO,UAAU;GACzB;GACD,CAAsB;AAEvB,SAAO;GACL,YAAY,QAAQ,QAAQ,SAAS,KAAK;GAC1C,IAAI,SAAS,UAAU,OAAO,SAAS,SAAS;GAChD,QAAQ,SAAS;GACjB,YAAY,SAAS,cAAc;GACnC,YAAY,QAAQ,QAAQ,OAAO,SAAS,SAAS,WAAW,SAAS,OAAO,KAAK,UAAU,SAAS,KAAK,CAAC;GAC/G;;AAGH,oDAA8B;EAC5B,GAAG;EACH,SAAS,WAAW;EACrB,CAAC;;AAMJ,iCAAe"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_useThunderID = require('../../../contexts/ThunderID/useThunderID.cjs');
|
|
3
|
-
const require_ThunderIDProvider = require('../../../contexts/ThunderID/ThunderIDProvider.cjs');
|
|
4
|
-
const require_OrganizationContextController = require('./OrganizationContextController.cjs');
|
|
5
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
-
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
7
|
-
|
|
8
|
-
//#region src/components/control/OrganizationContext/OrganizationContext.tsx
|
|
9
|
-
const OrganizationContext = ({ instanceId, baseUrl, clientId, afterSignInUrl, afterSignOutUrl, targetOrganizationId, sourceInstanceId, scopes, children,...rest }) => {
|
|
10
|
-
const { isSignedIn: isSourceSignedIn, instanceId: sourceInstanceIdFromContext, baseUrl: sourceBaseUrl, clientId: sourceClientId } = require_useThunderID.default();
|
|
11
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThunderIDProvider.default, {
|
|
12
|
-
instanceId,
|
|
13
|
-
baseUrl: baseUrl || sourceBaseUrl,
|
|
14
|
-
clientId: clientId || sourceClientId,
|
|
15
|
-
afterSignInUrl,
|
|
16
|
-
afterSignOutUrl,
|
|
17
|
-
scopes,
|
|
18
|
-
organizationChain: {
|
|
19
|
-
sourceInstanceId: sourceInstanceId || sourceInstanceIdFromContext,
|
|
20
|
-
targetOrganizationId
|
|
21
|
-
},
|
|
22
|
-
...rest,
|
|
23
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_OrganizationContextController.default, {
|
|
24
|
-
targetOrganizationId,
|
|
25
|
-
isSourceSignedIn,
|
|
26
|
-
children
|
|
27
|
-
})
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
var OrganizationContext_default = OrganizationContext;
|
|
31
|
-
|
|
32
|
-
//#endregion
|
|
33
|
-
exports.default = OrganizationContext_default;
|
|
34
|
-
//# sourceMappingURL=OrganizationContext.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OrganizationContext.cjs","names":["OrganizationContext: FC<PropsWithChildren<OrganizationContextProps>>","useThunderID","ThunderIDProvider","OrganizationContextController"],"sources":["../../../../../src/components/control/OrganizationContext/OrganizationContext.tsx"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FC, PropsWithChildren} from 'react';\nimport OrganizationContextController from './OrganizationContextController';\nimport ThunderIDProvider, {ThunderIDProviderProps} from '../../../contexts/ThunderID/ThunderIDProvider';\nimport useThunderID from '../../../contexts/ThunderID/useThunderID';\n\nexport interface OrganizationContextProps extends Omit<ThunderIDProviderProps, 'organizationChain' | 'baseUrl'> {\n /**\n * Optional base URL for the organization context. If not provided, it will default to the source provider's base URL.\n */\n baseUrl?: string;\n /**\n * Instance ID for this organization context. Must be unique across the app if multiple contexts are used.\n */\n instanceId: number;\n /**\n * Optional source instance ID. If not provided, immediate parent provider is used as source.\n */\n sourceInstanceId?: number;\n /**\n * ID of the organization to authenticate with\n */\n targetOrganizationId: string;\n}\n\nconst OrganizationContext: FC<PropsWithChildren<OrganizationContextProps>> = ({\n instanceId,\n baseUrl,\n clientId,\n afterSignInUrl,\n afterSignOutUrl,\n targetOrganizationId,\n sourceInstanceId,\n scopes,\n children,\n ...rest\n}: PropsWithChildren<OrganizationContextProps>) => {\n // Get the source provider's signed-in status\n const {\n isSignedIn: isSourceSignedIn,\n instanceId: sourceInstanceIdFromContext,\n baseUrl: sourceBaseUrl,\n clientId: sourceClientId,\n } = useThunderID();\n\n return (\n <ThunderIDProvider\n instanceId={instanceId}\n baseUrl={baseUrl || sourceBaseUrl}\n clientId={clientId || sourceClientId}\n afterSignInUrl={afterSignInUrl}\n afterSignOutUrl={afterSignOutUrl}\n scopes={scopes}\n organizationChain={{\n sourceInstanceId: sourceInstanceId || sourceInstanceIdFromContext,\n targetOrganizationId,\n }}\n {...rest}\n >\n <OrganizationContextController targetOrganizationId={targetOrganizationId} isSourceSignedIn={isSourceSignedIn}>\n {children}\n </OrganizationContextController>\n </ThunderIDProvider>\n );\n};\n\nexport default OrganizationContext;\n"],"mappings":";;;;;;;;AA0CA,MAAMA,uBAAwE,EAC5E,YACA,SACA,UACA,gBACA,iBACA,sBACA,kBACA,QACA,SACA,GAAG,WAC8C;CAEjD,MAAM,EACJ,YAAY,kBACZ,YAAY,6BACZ,SAAS,eACT,UAAU,mBACRC,8BAAc;AAElB,QACE,2CAACC;EACa;EACZ,SAAS,WAAW;EACpB,UAAU,YAAY;EACN;EACC;EACT;EACR,mBAAmB;GACjB,kBAAkB,oBAAoB;GACtC;GACD;EACD,GAAI;YAEJ,2CAACC;GAAoD;GAAwC;GAC1F;IAC6B;GACd;;AAIxB,kCAAe"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_useThunderID = require('../../../contexts/ThunderID/useThunderID.cjs');
|
|
3
|
-
let react = require("react");
|
|
4
|
-
react = require_rolldown_runtime.__toESM(react);
|
|
5
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
-
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
7
|
-
|
|
8
|
-
//#region src/components/control/OrganizationContext/OrganizationContextController.tsx
|
|
9
|
-
const OrganizationContextController = ({ targetOrganizationId, isSourceSignedIn, children }) => {
|
|
10
|
-
const { isInitialized, isSignedIn, switchOrganization, isLoading } = require_useThunderID.default();
|
|
11
|
-
const hasAuthenticatedRef = (0, react.useRef)(false);
|
|
12
|
-
const isAuthenticatingRef = (0, react.useRef)(false);
|
|
13
|
-
/**
|
|
14
|
-
* Handle the organization switch when:
|
|
15
|
-
* - Current instance is initialized and NOT signed in
|
|
16
|
-
* - Source provider IS signed in
|
|
17
|
-
* Uses the `switchOrganization` function from the ThunderID context.
|
|
18
|
-
*/
|
|
19
|
-
(0, react.useEffect)(() => {
|
|
20
|
-
const performOrganizationSwitch = async () => {
|
|
21
|
-
if (hasAuthenticatedRef.current || isAuthenticatingRef.current) return;
|
|
22
|
-
if (!isInitialized || isLoading) return;
|
|
23
|
-
if (isSignedIn) {
|
|
24
|
-
hasAuthenticatedRef.current = true;
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
if (!isSourceSignedIn) return;
|
|
28
|
-
try {
|
|
29
|
-
isAuthenticatingRef.current = true;
|
|
30
|
-
hasAuthenticatedRef.current = true;
|
|
31
|
-
await switchOrganization({
|
|
32
|
-
id: targetOrganizationId,
|
|
33
|
-
name: "",
|
|
34
|
-
orgHandle: ""
|
|
35
|
-
});
|
|
36
|
-
} catch (error) {
|
|
37
|
-
console.error("Linked organization authentication failed:", error);
|
|
38
|
-
hasAuthenticatedRef.current = false;
|
|
39
|
-
} finally {
|
|
40
|
-
isAuthenticatingRef.current = false;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
performOrganizationSwitch();
|
|
44
|
-
}, [
|
|
45
|
-
isInitialized,
|
|
46
|
-
isSignedIn,
|
|
47
|
-
isLoading,
|
|
48
|
-
isSourceSignedIn,
|
|
49
|
-
targetOrganizationId,
|
|
50
|
-
switchOrganization
|
|
51
|
-
]);
|
|
52
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children });
|
|
53
|
-
};
|
|
54
|
-
var OrganizationContextController_default = OrganizationContextController;
|
|
55
|
-
|
|
56
|
-
//#endregion
|
|
57
|
-
exports.default = OrganizationContextController_default;
|
|
58
|
-
//# sourceMappingURL=OrganizationContextController.cjs.map
|
package/dist/cjs/components/control/OrganizationContext/OrganizationContextController.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OrganizationContextController.cjs","names":["OrganizationContextController: FC<OrganizationContextControllerProps>","useThunderID","hasAuthenticatedRef: React.MutableRefObject<boolean>","isAuthenticatingRef: React.MutableRefObject<boolean>"],"sources":["../../../../../src/components/control/OrganizationContext/OrganizationContextController.tsx"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {Organization} from '@thunderid/browser';\nimport {FC, useEffect, useRef} from 'react';\nimport useThunderID from '../../../contexts/ThunderID/useThunderID';\n\ninterface OrganizationContextControllerProps {\n /**\n * Children to render\n */\n children: React.ReactNode;\n /**\n * Whether the source provider is signed in\n */\n isSourceSignedIn: boolean;\n /**\n * ID of the organization to authenticate with\n */\n targetOrganizationId: string;\n}\n\nconst OrganizationContextController: FC<OrganizationContextControllerProps> = ({\n targetOrganizationId,\n isSourceSignedIn,\n children,\n}: OrganizationContextControllerProps) => {\n const {isInitialized, isSignedIn, switchOrganization, isLoading} = useThunderID();\n const hasAuthenticatedRef: React.MutableRefObject<boolean> = useRef(false);\n const isAuthenticatingRef: React.MutableRefObject<boolean> = useRef(false);\n\n /**\n * Handle the organization switch when:\n * - Current instance is initialized and NOT signed in\n * - Source provider IS signed in\n * Uses the `switchOrganization` function from the ThunderID context.\n */\n useEffect(() => {\n const performOrganizationSwitch = async (): Promise<void> => {\n // Prevent multiple authentication attempts\n if (hasAuthenticatedRef.current || isAuthenticatingRef.current) {\n return;\n }\n\n // Wait for initialization to complete\n if (!isInitialized || isLoading) {\n return;\n }\n\n // Only proceed if user is not already signed in to this instance\n if (isSignedIn) {\n hasAuthenticatedRef.current = true;\n return;\n }\n\n // CRITICAL: Only proceed if source provider is signed in\n if (!isSourceSignedIn) {\n return;\n }\n\n try {\n isAuthenticatingRef.current = true;\n hasAuthenticatedRef.current = true;\n\n // Build the organization object for authentication\n const targetOrganization: Organization = {\n id: targetOrganizationId,\n name: '', // Name will be populated after authentication\n orgHandle: '', // Will be populated after authentication\n };\n\n // Call the switchOrganization API from context (handles token exchange)\n await switchOrganization(targetOrganization);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Linked organization authentication failed:', error);\n\n // Reset the flag to allow retry\n hasAuthenticatedRef.current = false;\n } finally {\n isAuthenticatingRef.current = false;\n }\n };\n\n performOrganizationSwitch();\n }, [isInitialized, isSignedIn, isLoading, isSourceSignedIn, targetOrganizationId, switchOrganization]);\n\n return <>{children}</>;\n};\n\nexport default OrganizationContextController;\n"],"mappings":";;;;;;;;AAqCA,MAAMA,iCAAyE,EAC7E,sBACA,kBACA,eACwC;CACxC,MAAM,EAAC,eAAe,YAAY,oBAAoB,cAAaC,8BAAc;CACjF,MAAMC,wCAA8D,MAAM;CAC1E,MAAMC,wCAA8D,MAAM;;;;;;;AAQ1E,4BAAgB;EACd,MAAM,4BAA4B,YAA2B;AAE3D,OAAI,oBAAoB,WAAW,oBAAoB,QACrD;AAIF,OAAI,CAAC,iBAAiB,UACpB;AAIF,OAAI,YAAY;AACd,wBAAoB,UAAU;AAC9B;;AAIF,OAAI,CAAC,iBACH;AAGF,OAAI;AACF,wBAAoB,UAAU;AAC9B,wBAAoB,UAAU;AAU9B,UAAM,mBAPmC;KACvC,IAAI;KACJ,MAAM;KACN,WAAW;KACZ,CAG2C;YACrC,OAAO;AAEd,YAAQ,MAAM,8CAA8C,MAAM;AAGlE,wBAAoB,UAAU;aACtB;AACR,wBAAoB,UAAU;;;AAIlC,6BAA2B;IAC1B;EAAC;EAAe;EAAY;EAAW;EAAkB;EAAsB;EAAmB,CAAC;AAEtG,QAAO,yEAAG,WAAY;;AAGxB,4CAAe"}
|