@asgardeo/nextjs 0.1.1 → 0.1.3
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/AsgardeoNextClient.d.ts +6 -4
- package/dist/AsgardeoNextClient.js +89 -12
- package/dist/AsgardeoNextClient.js.map +1 -1
- package/dist/cjs/index.js +18 -0
- package/dist/cjs/index.js.map +3 -3
- package/dist/client/components/presentation/CreateOrganization/CreateOrganization.d.ts +67 -0
- package/dist/client/components/presentation/CreateOrganization/CreateOrganization.js +109 -0
- package/dist/client/components/presentation/CreateOrganization/CreateOrganization.js.map +1 -0
- package/dist/client/components/presentation/Organization/Organization.d.ts +66 -0
- package/dist/client/components/presentation/Organization/Organization.js +55 -0
- package/dist/client/components/presentation/Organization/Organization.js.map +1 -0
- package/dist/client/components/presentation/OrganizationList/OrganizationList.d.ts +92 -0
- package/dist/client/components/presentation/OrganizationList/OrganizationList.js +120 -0
- package/dist/client/components/presentation/OrganizationList/OrganizationList.js.map +1 -0
- package/dist/client/components/presentation/OrganizationProfile/OrganizationProfile.d.ts +119 -0
- package/dist/client/components/presentation/OrganizationProfile/OrganizationProfile.js +145 -0
- package/dist/client/components/presentation/OrganizationProfile/OrganizationProfile.js.map +1 -0
- package/dist/client/components/presentation/OrganizationSwitcher/OrganizationSwitcher.d.ts +71 -0
- package/dist/client/components/presentation/OrganizationSwitcher/OrganizationSwitcher.js +102 -0
- package/dist/client/components/presentation/OrganizationSwitcher/OrganizationSwitcher.js.map +1 -0
- package/dist/client/components/presentation/UserProfile/UserProfile.js +3 -4
- package/dist/client/components/presentation/UserProfile/UserProfile.js.map +1 -1
- package/dist/client/contexts/Asgardeo/AsgardeoContext.js +2 -0
- package/dist/client/contexts/Asgardeo/AsgardeoContext.js.map +1 -1
- package/dist/client/contexts/Asgardeo/AsgardeoProvider.d.ts +11 -1
- package/dist/client/contexts/Asgardeo/AsgardeoProvider.js +44 -6
- package/dist/client/contexts/Asgardeo/AsgardeoProvider.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/server/AsgardeoProvider.js +28 -1
- package/dist/server/AsgardeoProvider.js.map +1 -1
- package/dist/server/actions/createOrganizationAction.d.ts +37 -0
- package/dist/server/actions/createOrganizationAction.js +40 -0
- package/dist/server/actions/createOrganizationAction.js.map +1 -0
- package/dist/server/actions/getCurrentOrganizationAction.d.ts +37 -0
- package/dist/server/actions/getCurrentOrganizationAction.js +40 -0
- package/dist/server/actions/getCurrentOrganizationAction.js.map +1 -0
- package/dist/server/actions/getOrganizationAction.d.ts +37 -0
- package/dist/server/actions/getOrganizationAction.js +40 -0
- package/dist/server/actions/getOrganizationAction.js.map +1 -0
- package/dist/server/actions/getOrganizationsAction.d.ts +37 -0
- package/dist/server/actions/getOrganizationsAction.js +40 -0
- package/dist/server/actions/getOrganizationsAction.js.map +1 -0
- package/dist/server/actions/switchOrganizationAction.d.ts +33 -0
- package/dist/server/actions/switchOrganizationAction.js +40 -0
- package/dist/server/actions/switchOrganizationAction.js.map +1 -0
- package/dist/server/actions/updateUserProfileAction.d.ts +2 -8
- package/dist/server/actions/updateUserProfileAction.js +2 -2
- package/dist/server/actions/updateUserProfileAction.js.map +1 -1
- package/dist/utils/decorateConfigWithNextEnv.js +3 -1
- package/dist/utils/decorateConfigWithNextEnv.js.map +1 -1
- package/package.json +3 -11
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import { AsgardeoNodeClient, EmbeddedFlowExecuteRequestPayload, EmbeddedFlowExecuteResponse, SignInOptions, SignOutOptions, SignUpOptions, User, UserProfile, Organization, EmbeddedSignInFlowHandleRequestPayload, EmbeddedFlowExecuteRequestConfig, ExtendedAuthorizeRequestUrlParams } from '@asgardeo/node';
|
|
18
|
+
import { AsgardeoNodeClient, EmbeddedFlowExecuteRequestPayload, EmbeddedFlowExecuteResponse, SignInOptions, SignOutOptions, SignUpOptions, User, UserProfile, Organization, EmbeddedSignInFlowHandleRequestPayload, EmbeddedFlowExecuteRequestConfig, ExtendedAuthorizeRequestUrlParams, CreateOrganizationPayload, OrganizationDetails } from '@asgardeo/node';
|
|
19
19
|
import { AsgardeoNextConfig } from './models/config';
|
|
20
20
|
/**
|
|
21
21
|
* Client for mplementing Asgardeo in Next.js applications.
|
|
@@ -43,9 +43,11 @@ declare class AsgardeoNextClient<T extends AsgardeoNextConfig = AsgardeoNextConf
|
|
|
43
43
|
getUser(userId?: string): Promise<User>;
|
|
44
44
|
getUserProfile(userId?: string): Promise<UserProfile>;
|
|
45
45
|
updateUserProfile(payload: any, userId?: string): Promise<User>;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
createOrganization(payload: CreateOrganizationPayload, userId?: string): Promise<Organization>;
|
|
47
|
+
getOrganization(organizationId: string, userId?: string): Promise<OrganizationDetails>;
|
|
48
|
+
getOrganizations(userId?: string): Promise<Organization[]>;
|
|
49
|
+
getCurrentOrganization(userId?: string): Promise<Organization | null>;
|
|
50
|
+
switchOrganization(organization: Organization, userId?: string): Promise<void>;
|
|
49
51
|
isLoading(): boolean;
|
|
50
52
|
isSignedIn(sessionId?: string): Promise<boolean>;
|
|
51
53
|
getAccessToken(sessionId?: string): Promise<string>;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import { AsgardeoNodeClient, AsgardeoRuntimeError, LegacyAsgardeoNodeClient, initializeEmbeddedSignInFlow, executeEmbeddedSignInFlow, generateUserProfile, flattenUserSchema, getScim2Me, getSchemas, generateFlattenedUserProfile, updateMeProfile, executeEmbeddedSignUpFlow, } from '@asgardeo/node';
|
|
18
|
+
import { AsgardeoNodeClient, AsgardeoRuntimeError, LegacyAsgardeoNodeClient, initializeEmbeddedSignInFlow, executeEmbeddedSignInFlow, generateUserProfile, flattenUserSchema, getScim2Me, getSchemas, generateFlattenedUserProfile, updateMeProfile, executeEmbeddedSignUpFlow, getMeOrganizations, createOrganization, getOrganization, deriveOrganizationHandleFromBaseUrl } from '@asgardeo/node';
|
|
19
19
|
import getSessionId from './server/actions/getSessionId';
|
|
20
20
|
import decorateConfigWithNextEnv from './utils/decorateConfigWithNextEnv';
|
|
21
21
|
import getClientOrigin from './server/actions/getClientOrigin';
|
|
@@ -56,13 +56,17 @@ class AsgardeoNextClient extends AsgardeoNodeClient {
|
|
|
56
56
|
}
|
|
57
57
|
async initialize(config) {
|
|
58
58
|
if (this.isInitialized) {
|
|
59
|
-
console.warn('[AsgardeoNextClient] Client is already initialized');
|
|
60
59
|
return Promise.resolve(true);
|
|
61
60
|
}
|
|
62
|
-
const { baseUrl, clientId, clientSecret, signInUrl, afterSignInUrl, afterSignOutUrl, signUpUrl, ...rest } = decorateConfigWithNextEnv(config);
|
|
61
|
+
const { baseUrl, organizationHandle, clientId, clientSecret, signInUrl, afterSignInUrl, afterSignOutUrl, signUpUrl, ...rest } = decorateConfigWithNextEnv(config);
|
|
63
62
|
this.isInitialized = true;
|
|
63
|
+
let resolvedOrganizationHandle = organizationHandle;
|
|
64
|
+
if (!resolvedOrganizationHandle) {
|
|
65
|
+
resolvedOrganizationHandle = deriveOrganizationHandleFromBaseUrl(baseUrl);
|
|
66
|
+
}
|
|
64
67
|
const origin = await getClientOrigin();
|
|
65
68
|
return this.asgardeo.initialize({
|
|
69
|
+
organizationHandle: resolvedOrganizationHandle,
|
|
66
70
|
baseUrl,
|
|
67
71
|
clientId,
|
|
68
72
|
clientSecret,
|
|
@@ -126,8 +130,8 @@ class AsgardeoNextClient extends AsgardeoNodeClient {
|
|
|
126
130
|
catch (error) {
|
|
127
131
|
return {
|
|
128
132
|
schemas: [],
|
|
129
|
-
flattenedProfile: await this.asgardeo.getDecodedIdToken(),
|
|
130
|
-
profile: await this.asgardeo.getDecodedIdToken(),
|
|
133
|
+
flattenedProfile: await this.asgardeo.getDecodedIdToken(userId),
|
|
134
|
+
profile: await this.asgardeo.getDecodedIdToken(userId),
|
|
131
135
|
};
|
|
132
136
|
}
|
|
133
137
|
}
|
|
@@ -145,17 +149,90 @@ class AsgardeoNextClient extends AsgardeoNodeClient {
|
|
|
145
149
|
});
|
|
146
150
|
}
|
|
147
151
|
catch (error) {
|
|
148
|
-
throw new AsgardeoRuntimeError(`Failed to update user profile: ${error instanceof Error ? error.message :
|
|
152
|
+
throw new AsgardeoRuntimeError(`Failed to update user profile: ${error instanceof Error ? error.message : String(error)}`, 'AsgardeoNextClient-UpdateProfileError-001', 'react', 'An error occurred while updating the user profile. Please check your configuration and network connection.');
|
|
149
153
|
}
|
|
150
154
|
}
|
|
151
|
-
async
|
|
152
|
-
|
|
155
|
+
async createOrganization(payload, userId) {
|
|
156
|
+
try {
|
|
157
|
+
const configData = await this.asgardeo.getConfigData();
|
|
158
|
+
const baseUrl = configData?.baseUrl;
|
|
159
|
+
return await createOrganization({
|
|
160
|
+
payload,
|
|
161
|
+
baseUrl,
|
|
162
|
+
headers: {
|
|
163
|
+
Authorization: `Bearer ${await this.getAccessToken(userId)}`,
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
catch (error) {
|
|
168
|
+
throw new AsgardeoRuntimeError(`Failed to create organization: ${error instanceof Error ? error.message : String(error)}`, 'AsgardeoReactClient-createOrganization-RuntimeError-001', 'nextjs', 'An error occurred while creating the organization. Please check your configuration and network connection.');
|
|
169
|
+
}
|
|
153
170
|
}
|
|
154
|
-
|
|
155
|
-
|
|
171
|
+
async getOrganization(organizationId, userId) {
|
|
172
|
+
try {
|
|
173
|
+
const configData = await this.asgardeo.getConfigData();
|
|
174
|
+
const baseUrl = configData?.baseUrl;
|
|
175
|
+
return await getOrganization({
|
|
176
|
+
baseUrl,
|
|
177
|
+
organizationId,
|
|
178
|
+
headers: {
|
|
179
|
+
Authorization: `Bearer ${await this.getAccessToken(userId)}`,
|
|
180
|
+
},
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
catch (error) {
|
|
184
|
+
throw new AsgardeoRuntimeError(`Failed to fetch the organization details of ${organizationId}: ${String(error)}`, 'AsgardeoReactClient-getOrganization-RuntimeError-001', 'nextjs', `An error occurred while fetching the organization with the id: ${organizationId}.`);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
async getOrganizations(userId) {
|
|
188
|
+
try {
|
|
189
|
+
const configData = await this.asgardeo.getConfigData();
|
|
190
|
+
const baseUrl = configData?.baseUrl;
|
|
191
|
+
const organizations = await getMeOrganizations({
|
|
192
|
+
baseUrl,
|
|
193
|
+
headers: {
|
|
194
|
+
Authorization: `Bearer ${await this.getAccessToken(userId)}`,
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
return organizations;
|
|
198
|
+
}
|
|
199
|
+
catch (error) {
|
|
200
|
+
throw new AsgardeoRuntimeError('Failed to fetch organizations.', 'react-AsgardeoReactClient-GetOrganizationsError-001', 'react', 'An error occurred while fetching the organizations associated with the user.');
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
async getCurrentOrganization(userId) {
|
|
204
|
+
const idToken = await this.asgardeo.getDecodedIdToken(userId);
|
|
205
|
+
return {
|
|
206
|
+
orgHandle: idToken?.org_handle,
|
|
207
|
+
name: idToken?.org_name,
|
|
208
|
+
id: idToken?.org_id,
|
|
209
|
+
};
|
|
156
210
|
}
|
|
157
|
-
|
|
158
|
-
|
|
211
|
+
async switchOrganization(organization, userId) {
|
|
212
|
+
try {
|
|
213
|
+
const configData = await this.asgardeo.getConfigData();
|
|
214
|
+
const scopes = configData?.scopes;
|
|
215
|
+
if (!organization.id) {
|
|
216
|
+
throw new AsgardeoRuntimeError('Organization ID is required for switching organizations', 'react-AsgardeoReactClient-ValidationError-001', 'react', 'The organization object must contain a valid ID to perform the organization switch.');
|
|
217
|
+
}
|
|
218
|
+
const exchangeConfig = {
|
|
219
|
+
attachToken: false,
|
|
220
|
+
data: {
|
|
221
|
+
client_id: '{{clientId}}',
|
|
222
|
+
grant_type: 'organization_switch',
|
|
223
|
+
scope: '{{scopes}}',
|
|
224
|
+
switching_organization: organization.id,
|
|
225
|
+
token: '{{accessToken}}',
|
|
226
|
+
},
|
|
227
|
+
id: 'organization-switch',
|
|
228
|
+
returnsSession: true,
|
|
229
|
+
signInRequired: true,
|
|
230
|
+
};
|
|
231
|
+
await this.asgardeo.exchangeToken(exchangeConfig, userId);
|
|
232
|
+
}
|
|
233
|
+
catch (error) {
|
|
234
|
+
throw new AsgardeoRuntimeError(`Failed to switch organization: ${error instanceof Error ? error.message : String(error)}`, 'AsgardeoReactClient-RuntimeError-003', 'nextjs', 'An error occurred while switching to the specified organization. Please try again.');
|
|
235
|
+
}
|
|
159
236
|
}
|
|
160
237
|
isLoading() {
|
|
161
238
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsgardeoNextClient.js","sourceRoot":"","sources":["../src/AsgardeoNextClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EAGpB,wBAAwB,EAMxB,4BAA4B,EAG5B,yBAAyB,EAGzB,mBAAmB,EACnB,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,4BAA4B,EAC5B,eAAe,EACf,yBAAyB,
|
|
1
|
+
{"version":3,"file":"AsgardeoNextClient.js","sourceRoot":"","sources":["../src/AsgardeoNextClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EAGpB,wBAAwB,EAMxB,4BAA4B,EAG5B,yBAAyB,EAGzB,mBAAmB,EACnB,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,4BAA4B,EAC5B,eAAe,EACf,yBAAyB,EACzB,kBAAkB,EAElB,kBAAkB,EAElB,eAAe,EAEf,mCAAmC,EACpC,MAAM,gBAAgB,CAAC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C;IACJ,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,sBAAsB,CACjC,YAA+C,EAC/C,MAAe;QAEf,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,iBAAiB;QAC5B,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE,CAAC;IAC3C,CAAC;CACF;AAED,eAAe,kBAAkB,CAAC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -31,6 +31,12 @@ var index_exports = {};
|
|
|
31
31
|
__export(index_exports, {
|
|
32
32
|
AsgardeoNext: () => import_AsgardeoNextClient.default,
|
|
33
33
|
AsgardeoProvider: () => import_AsgardeoProvider.default,
|
|
34
|
+
CreateOrganization: () => import_CreateOrganization.default,
|
|
35
|
+
CreateOrganizationProps: () => import_CreateOrganization2.CreateOrganizationProps,
|
|
36
|
+
OrganizationProfile: () => import_OrganizationProfile.default,
|
|
37
|
+
OrganizationProfileProps: () => import_OrganizationProfile2.OrganizationProfileProps,
|
|
38
|
+
OrganizationSwitcher: () => import_OrganizationSwitcher.default,
|
|
39
|
+
OrganizationSwitcherProps: () => import_OrganizationSwitcher2.OrganizationSwitcherProps,
|
|
34
40
|
SignIn: () => import_SignIn.default,
|
|
35
41
|
SignInButton: () => import_SignInButton.default,
|
|
36
42
|
SignOutButton: () => import_SignOutButton.default,
|
|
@@ -55,6 +61,12 @@ var import_useAsgardeo = __toESM(require("./client/contexts/Asgardeo/useAsgardeo
|
|
|
55
61
|
__reExport(index_exports, require("./client/contexts/Asgardeo/useAsgardeo"), module.exports);
|
|
56
62
|
var import_isSignedIn = __toESM(require("./server/actions/isSignedIn"), 1);
|
|
57
63
|
var import_handleOAuthCallbackAction = __toESM(require("./server/actions/handleOAuthCallbackAction"), 1);
|
|
64
|
+
var import_CreateOrganization = __toESM(require("./client/components/presentation/CreateOrganization/CreateOrganization"), 1);
|
|
65
|
+
var import_CreateOrganization2 = require("./client/components/presentation/CreateOrganization/CreateOrganization");
|
|
66
|
+
var import_OrganizationProfile = __toESM(require("./client/components/presentation/OrganizationProfile/OrganizationProfile"), 1);
|
|
67
|
+
var import_OrganizationProfile2 = require("./client/components/presentation/OrganizationProfile/OrganizationProfile");
|
|
68
|
+
var import_OrganizationSwitcher = __toESM(require("./client/components/presentation/OrganizationSwitcher/OrganizationSwitcher"), 1);
|
|
69
|
+
var import_OrganizationSwitcher2 = require("./client/components/presentation/OrganizationSwitcher/OrganizationSwitcher");
|
|
58
70
|
var import_SignedIn = __toESM(require("./client/components/control/SignedIn/SignedIn"), 1);
|
|
59
71
|
var import_SignedIn2 = require("./client/components/control/SignedIn/SignedIn");
|
|
60
72
|
var import_SignedOut = __toESM(require("./client/components/control/SignedOut/SignedOut"), 1);
|
|
@@ -73,6 +85,12 @@ var import_asgardeoMiddleware = __toESM(require("./middleware/asgardeoMiddleware
|
|
|
73
85
|
0 && (module.exports = {
|
|
74
86
|
AsgardeoNext,
|
|
75
87
|
AsgardeoProvider,
|
|
88
|
+
CreateOrganization,
|
|
89
|
+
CreateOrganizationProps,
|
|
90
|
+
OrganizationProfile,
|
|
91
|
+
OrganizationProfileProps,
|
|
92
|
+
OrganizationSwitcher,
|
|
93
|
+
OrganizationSwitcherProps,
|
|
76
94
|
SignIn,
|
|
77
95
|
SignInButton,
|
|
78
96
|
SignOutButton,
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"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\nexport {default as AsgardeoProvider} from './server/AsgardeoProvider';\nexport * from './server/AsgardeoProvider';\n\nexport {default as useAsgardeo} from './client/contexts/Asgardeo/useAsgardeo';\nexport * from './client/contexts/Asgardeo/useAsgardeo';\n\nexport {default as isSignedIn} from './server/actions/isSignedIn';\n\nexport {default as handleOAuthCallback} from './server/actions/handleOAuthCallbackAction';\n\nexport {default as SignedIn} from './client/components/control/SignedIn/SignedIn';\nexport {SignedInProps} from './client/components/control/SignedIn/SignedIn';\n\nexport {default as SignedOut} from './client/components/control/SignedOut/SignedOut';\nexport {SignedOutProps} from './client/components/control/SignedOut/SignedOut';\n\nexport {default as SignInButton} from './client/components/actions/SignInButton/SignInButton';\nexport type {SignInButtonProps} from './client/components/actions/SignInButton/SignInButton';\n\nexport {default as SignUpButton} from './client/components/actions/SignUpButton/SignUpButton';\nexport type {SignUpButtonProps} from './client/components/actions/SignUpButton/SignUpButton';\n\nexport {default as SignIn} from './client/components/presentation/SignIn/SignIn';\nexport type {SignInProps} from './client/components/presentation/SignIn/SignIn';\n\nexport {default as SignOutButton} from './client/components/actions/SignOutButton/SignOutButton';\nexport type {SignOutButtonProps} from './client/components/actions/SignOutButton/SignOutButton';\n\nexport {default as User} from './client/components/presentation/User/User';\nexport type {UserProps} from './client/components/presentation/User/User';\n\nexport {default as SignUp} from './client/components/presentation/SignUp/SignUp';\nexport type {SignUpProps} from './client/components/presentation/SignUp/SignUp';\n\nexport {default as UserDropdown} from './client/components/presentation/UserDropdown/UserDropdown';\nexport type {UserDropdownProps} from './client/components/presentation/UserDropdown/UserDropdown';\n\nexport {default as UserProfile} from './client/components/presentation/UserProfile/UserProfile';\nexport type {UserProfileProps} from './client/components/presentation/UserProfile/UserProfile';\n\nexport {default as AsgardeoNext} from './AsgardeoNextClient';\n\nexport {default as asgardeoMiddleware} from './middleware/asgardeoMiddleware';\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBA,8BAA0C;AAC1C,0BAAc,sCAnBd;AAqBA,yBAAqC;AACrC,0BAAc,mDAtBd;AAwBA,wBAAoC;AAEpC,uCAA6C;AAE7C,sBAAkC;AAClC,
|
|
6
|
-
"names": ["import_SignedIn", "import_SignedOut"]
|
|
4
|
+
"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\nexport {default as AsgardeoProvider} from './server/AsgardeoProvider';\nexport * from './server/AsgardeoProvider';\n\nexport {default as useAsgardeo} from './client/contexts/Asgardeo/useAsgardeo';\nexport * from './client/contexts/Asgardeo/useAsgardeo';\n\nexport {default as isSignedIn} from './server/actions/isSignedIn';\n\nexport {default as handleOAuthCallback} from './server/actions/handleOAuthCallbackAction';\n\nexport {default as CreateOrganization} from './client/components/presentation/CreateOrganization/CreateOrganization';\nexport {CreateOrganizationProps} from './client/components/presentation/CreateOrganization/CreateOrganization';\n\nexport {default as OrganizationProfile} from './client/components/presentation/OrganizationProfile/OrganizationProfile';\nexport {OrganizationProfileProps} from './client/components/presentation/OrganizationProfile/OrganizationProfile';\n\nexport {default as OrganizationSwitcher} from './client/components/presentation/OrganizationSwitcher/OrganizationSwitcher';\nexport {OrganizationSwitcherProps} from './client/components/presentation/OrganizationSwitcher/OrganizationSwitcher';\n\nexport {default as SignedIn} from './client/components/control/SignedIn/SignedIn';\nexport {SignedInProps} from './client/components/control/SignedIn/SignedIn';\n\nexport {default as SignedOut} from './client/components/control/SignedOut/SignedOut';\nexport {SignedOutProps} from './client/components/control/SignedOut/SignedOut';\n\nexport {default as SignInButton} from './client/components/actions/SignInButton/SignInButton';\nexport type {SignInButtonProps} from './client/components/actions/SignInButton/SignInButton';\n\nexport {default as SignUpButton} from './client/components/actions/SignUpButton/SignUpButton';\nexport type {SignUpButtonProps} from './client/components/actions/SignUpButton/SignUpButton';\n\nexport {default as SignIn} from './client/components/presentation/SignIn/SignIn';\nexport type {SignInProps} from './client/components/presentation/SignIn/SignIn';\n\nexport {default as SignOutButton} from './client/components/actions/SignOutButton/SignOutButton';\nexport type {SignOutButtonProps} from './client/components/actions/SignOutButton/SignOutButton';\n\nexport {default as User} from './client/components/presentation/User/User';\nexport type {UserProps} from './client/components/presentation/User/User';\n\nexport {default as SignUp} from './client/components/presentation/SignUp/SignUp';\nexport type {SignUpProps} from './client/components/presentation/SignUp/SignUp';\n\nexport {default as UserDropdown} from './client/components/presentation/UserDropdown/UserDropdown';\nexport type {UserDropdownProps} from './client/components/presentation/UserDropdown/UserDropdown';\n\nexport {default as UserProfile} from './client/components/presentation/UserProfile/UserProfile';\nexport type {UserProfileProps} from './client/components/presentation/UserProfile/UserProfile';\n\nexport {default as AsgardeoNext} from './AsgardeoNextClient';\n\nexport {default as asgardeoMiddleware} from './middleware/asgardeoMiddleware';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBA,8BAA0C;AAC1C,0BAAc,sCAnBd;AAqBA,yBAAqC;AACrC,0BAAc,mDAtBd;AAwBA,wBAAoC;AAEpC,uCAA6C;AAE7C,gCAA4C;AAC5C,IAAAA,6BAAsC;AAEtC,iCAA6C;AAC7C,IAAAC,8BAAuC;AAEvC,kCAA8C;AAC9C,IAAAC,+BAAwC;AAExC,sBAAkC;AAClC,IAAAC,mBAA4B;AAE5B,uBAAmC;AACnC,IAAAC,oBAA6B;AAE7B,0BAAsC;AAGtC,0BAAsC;AAGtC,oBAAgC;AAGhC,2BAAuC;AAGvC,kBAA8B;AAG9B,oBAAgC;AAGhC,0BAAsC;AAGtC,yBAAqC;AAGrC,gCAAsC;AAEtC,gCAA4C;",
|
|
6
|
+
"names": ["import_CreateOrganization", "import_OrganizationProfile", "import_OrganizationSwitcher", "import_SignedIn", "import_SignedOut"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, 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 { FC, ReactElement } from 'react';
|
|
19
|
+
import { BaseCreateOrganizationProps } from '@asgardeo/react';
|
|
20
|
+
import { CreateOrganizationPayload } from '@asgardeo/node';
|
|
21
|
+
/**
|
|
22
|
+
* Props interface for the CreateOrganization component.
|
|
23
|
+
*/
|
|
24
|
+
export interface CreateOrganizationProps extends Omit<BaseCreateOrganizationProps, 'onSubmit' | 'loading' | 'error'> {
|
|
25
|
+
/**
|
|
26
|
+
* Fallback element to render when the user is not signed in.
|
|
27
|
+
*/
|
|
28
|
+
fallback?: ReactElement;
|
|
29
|
+
/**
|
|
30
|
+
* Custom organization creation handler (will use default API if not provided).
|
|
31
|
+
*/
|
|
32
|
+
onCreateOrganization?: (payload: CreateOrganizationPayload) => Promise<any>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* CreateOrganization component that provides organization creation functionality.
|
|
36
|
+
* This component automatically integrates with the Asgardeo and Organization contexts.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```tsx
|
|
40
|
+
* import { CreateOrganization } from '@asgardeo/react';
|
|
41
|
+
*
|
|
42
|
+
* // Basic usage - uses default API and contexts
|
|
43
|
+
* <CreateOrganization
|
|
44
|
+
* onSuccess={(org) => console.log('Created:', org)}
|
|
45
|
+
* onCancel={() => navigate('/organizations')}
|
|
46
|
+
* />
|
|
47
|
+
*
|
|
48
|
+
* // With custom organization creation handler
|
|
49
|
+
* <CreateOrganization
|
|
50
|
+
* onCreateOrganization={async (payload) => {
|
|
51
|
+
* const result = await myCustomAPI.createOrganization(payload);
|
|
52
|
+
* return result;
|
|
53
|
+
* }}
|
|
54
|
+
* onSuccess={(org) => {
|
|
55
|
+
* console.log('Organization created:', org.name);
|
|
56
|
+
* // Custom success logic here
|
|
57
|
+
* }}
|
|
58
|
+
* />
|
|
59
|
+
*
|
|
60
|
+
* // With fallback for unauthenticated users
|
|
61
|
+
* <CreateOrganization
|
|
62
|
+
* fallback={<div>Please sign in to create an organization</div>}
|
|
63
|
+
* />
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
export declare const CreateOrganization: FC<CreateOrganizationProps>;
|
|
67
|
+
export default CreateOrganization;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, 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
|
+
'use client';
|
|
19
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
+
import { useState } from 'react';
|
|
21
|
+
import { BaseCreateOrganization, useOrganization } from '@asgardeo/react';
|
|
22
|
+
import useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';
|
|
23
|
+
import createOrganizationAction from '../../../../server/actions/createOrganizationAction';
|
|
24
|
+
import getSessionId from '../../../../server/actions/getSessionId';
|
|
25
|
+
/**
|
|
26
|
+
* CreateOrganization component that provides organization creation functionality.
|
|
27
|
+
* This component automatically integrates with the Asgardeo and Organization contexts.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* import { CreateOrganization } from '@asgardeo/react';
|
|
32
|
+
*
|
|
33
|
+
* // Basic usage - uses default API and contexts
|
|
34
|
+
* <CreateOrganization
|
|
35
|
+
* onSuccess={(org) => console.log('Created:', org)}
|
|
36
|
+
* onCancel={() => navigate('/organizations')}
|
|
37
|
+
* />
|
|
38
|
+
*
|
|
39
|
+
* // With custom organization creation handler
|
|
40
|
+
* <CreateOrganization
|
|
41
|
+
* onCreateOrganization={async (payload) => {
|
|
42
|
+
* const result = await myCustomAPI.createOrganization(payload);
|
|
43
|
+
* return result;
|
|
44
|
+
* }}
|
|
45
|
+
* onSuccess={(org) => {
|
|
46
|
+
* console.log('Organization created:', org.name);
|
|
47
|
+
* // Custom success logic here
|
|
48
|
+
* }}
|
|
49
|
+
* />
|
|
50
|
+
*
|
|
51
|
+
* // With fallback for unauthenticated users
|
|
52
|
+
* <CreateOrganization
|
|
53
|
+
* fallback={<div>Please sign in to create an organization</div>}
|
|
54
|
+
* />
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export const CreateOrganization = ({ onCreateOrganization, fallback = _jsx(_Fragment, {}), onSuccess, defaultParentId, ...props }) => {
|
|
58
|
+
const { isSignedIn, baseUrl } = useAsgardeo();
|
|
59
|
+
const { currentOrganization, revalidateOrganizations } = useOrganization();
|
|
60
|
+
const [loading, setLoading] = useState(false);
|
|
61
|
+
const [error, setError] = useState(null);
|
|
62
|
+
// Don't render if not authenticated
|
|
63
|
+
if (!isSignedIn && fallback) {
|
|
64
|
+
return fallback;
|
|
65
|
+
}
|
|
66
|
+
if (!isSignedIn) {
|
|
67
|
+
return _jsx(_Fragment, {});
|
|
68
|
+
}
|
|
69
|
+
// Use current organization as parent if no defaultParentId provided
|
|
70
|
+
const parentId = defaultParentId || currentOrganization?.id || '';
|
|
71
|
+
const handleSubmit = async (payload) => {
|
|
72
|
+
setLoading(true);
|
|
73
|
+
setError(null);
|
|
74
|
+
try {
|
|
75
|
+
let result;
|
|
76
|
+
if (onCreateOrganization) {
|
|
77
|
+
// Use the provided custom creation function
|
|
78
|
+
result = await onCreateOrganization(payload);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
// Use the default API
|
|
82
|
+
if (!baseUrl) {
|
|
83
|
+
throw new Error('Base URL is required for organization creation');
|
|
84
|
+
}
|
|
85
|
+
result = await createOrganizationAction({
|
|
86
|
+
...payload,
|
|
87
|
+
parentId,
|
|
88
|
+
}, (await getSessionId()));
|
|
89
|
+
}
|
|
90
|
+
// Refresh organizations list to include the new organization
|
|
91
|
+
await revalidateOrganizations();
|
|
92
|
+
// Call success callback if provided
|
|
93
|
+
if (onSuccess) {
|
|
94
|
+
onSuccess(result);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
catch (createError) {
|
|
98
|
+
const errorMessage = createError instanceof Error ? createError.message : 'Failed to create organization';
|
|
99
|
+
setError(errorMessage);
|
|
100
|
+
throw createError; // Re-throw to allow form to handle it
|
|
101
|
+
}
|
|
102
|
+
finally {
|
|
103
|
+
setLoading(false);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
return (_jsx(BaseCreateOrganization, { onSubmit: handleSubmit, loading: loading, error: error, defaultParentId: parentId, onSuccess: onSuccess, ...props }));
|
|
107
|
+
};
|
|
108
|
+
export default CreateOrganization;
|
|
109
|
+
//# sourceMappingURL=CreateOrganization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateOrganization.js","sourceRoot":"","sources":["../../../../../src/client/components/presentation/CreateOrganization/CreateOrganization.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,YAAY,CAAC;;AAEb,OAAO,EAAmB,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAC,sBAAsB,EAA+B,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAErG,OAAO,WAAW,MAAM,wCAAwC,CAAC;AACjE,OAAO,wBAAwB,MAAM,qDAAqD,CAAC;AAC3F,OAAO,YAAY,MAAM,yCAAyC,CAAC;AAgBnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAgC,CAAC,EAC9D,oBAAoB,EACpB,QAAQ,GAAG,mBAAK,EAChB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CAAoC;YACpC,IAAI,SAAS,EAAE,CAAC;gBACd,SAAS,CAAC,MAAM,CAAC,CAAC;YACpB,CAAC;QACH,CAAC;QAAC,OAAO,WAAW,EAAE,CAAC;YACrB,MAAM,YAAY,GAAW,WAAW,YAAY,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,+BAA+B,CAAC;YAClH,QAAQ,CAAC,YAAY,CAAC,CAAC;YACvB,MAAM,WAAW,CAAC,CAAC,sCAAsC;QAC3D,CAAC;gBAAS,CAAC;YACT,UAAU,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,sBAAsB,IACrB,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,QAAQ,EACzB,SAAS,EAAE,SAAS,KAChB,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, 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 { Organization as IOrganization } from '@asgardeo/node';
|
|
19
|
+
import { FC, ReactNode } from 'react';
|
|
20
|
+
import { BaseOrganizationProps } from '@asgardeo/react';
|
|
21
|
+
/**
|
|
22
|
+
* Props for the Organization component.
|
|
23
|
+
* Extends BaseOrganizationProps but makes the organization prop optional since it will be obtained from useOrganization
|
|
24
|
+
*/
|
|
25
|
+
export interface OrganizationProps extends Omit<BaseOrganizationProps, 'organization'> {
|
|
26
|
+
/**
|
|
27
|
+
* Render prop that takes the organization object and returns a ReactNode.
|
|
28
|
+
* @param organization - The current organization object from Organization context.
|
|
29
|
+
* @returns A ReactNode to render.
|
|
30
|
+
*/
|
|
31
|
+
children: (organization: IOrganization | null) => ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Optional element to render when no organization is selected.
|
|
34
|
+
*/
|
|
35
|
+
fallback?: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A component that uses render props to expose the current organization object.
|
|
39
|
+
* This component automatically retrieves the current organization from Organization context.
|
|
40
|
+
*
|
|
41
|
+
* @remarks This component is only supported in browser based React applications (CSR).
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```tsx
|
|
45
|
+
* import { Organization } from '@asgardeo/auth-react';
|
|
46
|
+
*
|
|
47
|
+
* const App = () => {
|
|
48
|
+
* return (
|
|
49
|
+
* <Organization fallback={<p>No organization selected</p>}>
|
|
50
|
+
* {(organization) => (
|
|
51
|
+
* <div>
|
|
52
|
+
* <h1>Current Organization: {organization.name}!</h1>
|
|
53
|
+
* <p>ID: {organization.id}</p>
|
|
54
|
+
* <p>Role: {organization.role}</p>
|
|
55
|
+
* {organization.memberCount && (
|
|
56
|
+
* <p>Members: {organization.memberCount}</p>
|
|
57
|
+
* )}
|
|
58
|
+
* </div>
|
|
59
|
+
* )}
|
|
60
|
+
* </Organization>
|
|
61
|
+
* );
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
declare const Organization: FC<OrganizationProps>;
|
|
66
|
+
export default Organization;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, 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
|
+
'use client';
|
|
19
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
+
import { BaseOrganization, useOrganization } from '@asgardeo/react';
|
|
21
|
+
/**
|
|
22
|
+
* A component that uses render props to expose the current organization object.
|
|
23
|
+
* This component automatically retrieves the current organization from Organization context.
|
|
24
|
+
*
|
|
25
|
+
* @remarks This component is only supported in browser based React applications (CSR).
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* import { Organization } from '@asgardeo/auth-react';
|
|
30
|
+
*
|
|
31
|
+
* const App = () => {
|
|
32
|
+
* return (
|
|
33
|
+
* <Organization fallback={<p>No organization selected</p>}>
|
|
34
|
+
* {(organization) => (
|
|
35
|
+
* <div>
|
|
36
|
+
* <h1>Current Organization: {organization.name}!</h1>
|
|
37
|
+
* <p>ID: {organization.id}</p>
|
|
38
|
+
* <p>Role: {organization.role}</p>
|
|
39
|
+
* {organization.memberCount && (
|
|
40
|
+
* <p>Members: {organization.memberCount}</p>
|
|
41
|
+
* )}
|
|
42
|
+
* </div>
|
|
43
|
+
* )}
|
|
44
|
+
* </Organization>
|
|
45
|
+
* );
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
const Organization = ({ children, fallback = null }) => {
|
|
50
|
+
const { currentOrganization } = useOrganization();
|
|
51
|
+
return (_jsx(BaseOrganization, { organization: currentOrganization, fallback: fallback, children: children }));
|
|
52
|
+
};
|
|
53
|
+
Organization.displayName = 'Organization';
|
|
54
|
+
export default Organization;
|
|
55
|
+
//# sourceMappingURL=Organization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Organization.js","sourceRoot":"","sources":["../../../../../src/client/components/presentation/Organization/Organization.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,YAAY,CAAC;;AAIb,OAAO,EAAC,gBAAgB,EAAyB,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAoBzF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,YAAY,GAA0B,CAAC,EAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,EAAC,EAAgB,EAAE;IACxF,MAAM,EAAC,mBAAmB,EAAC,GAAG,eAAe,EAAE,CAAC;IAEhD,OAAO,CACL,KAAC,gBAAgB,IAAC,YAAY,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ,YACpE,QAAQ,GACQ,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAE1C,eAAe,YAAY,CAAC"}
|