@krak-stack/auth 0.1.53 → 0.1.55
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/README.md +6 -0
- package/dist/api.d.ts +434 -225
- package/dist/components/admin-organizations.js +8 -1
- package/dist/components/admin-users.js +8 -1
- package/dist/components/auth-client-api.d.ts +43 -0
- package/dist/components/index.d.ts +2 -2
- package/dist/components/member-required.js +21 -7
- package/dist/components/organization-switcher.d.ts +54 -13
- package/dist/components/organization-switcher.js +394 -139
- package/dist/extra/api.group.d.ts +43 -0
- package/dist/extra/schema.d.ts +43 -0
- package/dist/extra/schema.js +13 -1
- package/dist/index.d.ts +1 -1
- package/dist/schema.d.ts +165 -2
- package/dist/schema.js +203 -9
- package/dist/server/api.group.d.ts +129 -6
- package/dist/server/schema.d.ts +86 -4
- package/dist/service.d.ts +368 -36
- package/package.json +1 -1
|
@@ -16,6 +16,7 @@ import { assetUrl, organizationBranding } from "./utils";
|
|
|
16
16
|
const defaultMessages = {
|
|
17
17
|
en: {
|
|
18
18
|
admin_column_created: "Created",
|
|
19
|
+
admin_column_id: "ID",
|
|
19
20
|
admin_column_members: "Members",
|
|
20
21
|
admin_column_organization: "Organization",
|
|
21
22
|
admin_column_projects: "Projects",
|
|
@@ -31,6 +32,7 @@ const defaultMessages = {
|
|
|
31
32
|
},
|
|
32
33
|
fr: {
|
|
33
34
|
admin_column_created: "Créé",
|
|
35
|
+
admin_column_id: "ID",
|
|
34
36
|
admin_column_members: "Membres",
|
|
35
37
|
admin_column_organization: "Organisation",
|
|
36
38
|
admin_column_projects: "Projets",
|
|
@@ -120,7 +122,7 @@ export function AdminOrganizationsTable({ from, reloadKey = 0, search, }) {
|
|
|
120
122
|
onFailure: () => false,
|
|
121
123
|
onSuccess: () => false,
|
|
122
124
|
});
|
|
123
|
-
return (_jsxs("div", { className: "flex flex-col gap-4", children: [error ? _jsx(ErrorMessage, { text: error }) : null, _jsx(DataTable, { columns: organizationColumns(m, locale, baseUrl), data: organizations, features: {
|
|
125
|
+
return (_jsxs("div", { className: "flex flex-col gap-4", children: [error ? _jsx(ErrorMessage, { text: error }) : null, _jsx(DataTable, { columns: organizationColumns(m, locale, baseUrl), data: organizations, defaultColumnVisibility: { id: false }, features: {
|
|
124
126
|
export: { baseName: "organizations" },
|
|
125
127
|
gallery: false,
|
|
126
128
|
pagination: { mode: "server", rowCount: total },
|
|
@@ -156,6 +158,11 @@ export function AdminOrganizationsTable({ from, reloadKey = 0, search, }) {
|
|
|
156
158
|
} })) : null] }));
|
|
157
159
|
}
|
|
158
160
|
const organizationColumns = (m, locale, baseUrl) => [
|
|
161
|
+
{
|
|
162
|
+
accessorKey: "id",
|
|
163
|
+
header: m.admin_column_id,
|
|
164
|
+
cell: ({ row }) => (_jsx("span", { className: "text-muted-foreground font-mono text-xs", children: row.original.id })),
|
|
165
|
+
},
|
|
159
166
|
{
|
|
160
167
|
accessorKey: "name",
|
|
161
168
|
header: m.admin_column_organization,
|
|
@@ -22,6 +22,7 @@ const defaultMessages = {
|
|
|
22
22
|
admin_ban_description: "Are you sure you want to ban {name} ({email})? They will not be able to sign in.",
|
|
23
23
|
admin_ban_title: "Ban user",
|
|
24
24
|
admin_column_created: "Created",
|
|
25
|
+
admin_column_id: "ID",
|
|
25
26
|
admin_column_last_signed_in: "Last signed in",
|
|
26
27
|
admin_column_organizations: "Organizations",
|
|
27
28
|
admin_column_projects: "Projects",
|
|
@@ -51,6 +52,7 @@ const defaultMessages = {
|
|
|
51
52
|
admin_ban_description: "Êtes-vous sûr de vouloir bannir {name} ({email}) ? Il ne pourra plus se connecter.",
|
|
52
53
|
admin_ban_title: "Bannir l'utilisateur",
|
|
53
54
|
admin_column_created: "Créé",
|
|
55
|
+
admin_column_id: "ID",
|
|
54
56
|
admin_column_last_signed_in: "Dernière connexion",
|
|
55
57
|
admin_column_organizations: "Organisations",
|
|
56
58
|
admin_column_projects: "Projets",
|
|
@@ -181,7 +183,7 @@ export function AdminUsersTable({ from, reloadKey = 0, search, }) {
|
|
|
181
183
|
await navigate({ to: "/" });
|
|
182
184
|
await router.invalidate();
|
|
183
185
|
};
|
|
184
|
-
return (_jsxs(_Fragment, { children: [error ? _jsx(ErrorMessage, { text: error }) : null, impersonateError ? _jsx(ErrorMessage, { text: impersonateError }) : null, _jsx(DataTable, { columns: userColumns(m, baseUrl), data: users, features: {
|
|
186
|
+
return (_jsxs(_Fragment, { children: [error ? _jsx(ErrorMessage, { text: error }) : null, impersonateError ? _jsx(ErrorMessage, { text: impersonateError }) : null, _jsx(DataTable, { columns: userColumns(m, baseUrl), data: users, defaultColumnVisibility: { id: false }, features: {
|
|
185
187
|
export: { baseName: "users" },
|
|
186
188
|
gallery: false,
|
|
187
189
|
pagination: { mode: "server", rowCount: total },
|
|
@@ -282,6 +284,11 @@ export function useAdminUsersTotal(search) {
|
|
|
282
284
|
});
|
|
283
285
|
}
|
|
284
286
|
const userColumns = (m, baseUrl) => [
|
|
287
|
+
{
|
|
288
|
+
accessorKey: "id",
|
|
289
|
+
header: m.admin_column_id,
|
|
290
|
+
cell: ({ row }) => (_jsx("span", { className: "text-muted-foreground font-mono text-xs", children: row.original.id })),
|
|
291
|
+
},
|
|
285
292
|
{
|
|
286
293
|
accessorKey: "email",
|
|
287
294
|
header: m.admin_column_user,
|
|
@@ -442,12 +442,55 @@ export declare const authClientApi: (baseUrl?: string | undefined) => AtomHttpAp
|
|
|
442
442
|
readonly key: import("effect/Schema").String;
|
|
443
443
|
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError | typeof import("../extra/schema").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getOrganizationPublicProfile", "GET", "/api/auth/organization-profile", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
444
444
|
readonly organizationId: import("effect/Schema").String;
|
|
445
|
+
readonly locale: import("effect/Schema").optional<import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>>;
|
|
445
446
|
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
446
447
|
readonly id: import("effect/Schema").String;
|
|
447
448
|
readonly name: import("effect/Schema").String;
|
|
448
449
|
readonly slug: import("effect/Schema").String;
|
|
449
450
|
readonly displayName: import("effect/Schema").String;
|
|
450
451
|
readonly contactEmail: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
452
|
+
readonly emails: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
453
|
+
readonly email: import("effect/Schema").NonEmptyString;
|
|
454
|
+
readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
455
|
+
readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
|
|
456
|
+
readonly label: import("effect/Schema").NonEmptyString;
|
|
457
|
+
}>>;
|
|
458
|
+
}>>>;
|
|
459
|
+
readonly phones: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
460
|
+
readonly number: import("effect/Schema").NonEmptyString;
|
|
461
|
+
readonly extension: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
462
|
+
readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
463
|
+
readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
|
|
464
|
+
readonly label: import("effect/Schema").NonEmptyString;
|
|
465
|
+
}>>;
|
|
466
|
+
}>>>;
|
|
467
|
+
readonly websites: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
468
|
+
readonly url: import("effect/Schema").NonEmptyString;
|
|
469
|
+
readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
470
|
+
readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
|
|
471
|
+
readonly label: import("effect/Schema").NonEmptyString;
|
|
472
|
+
}>>;
|
|
473
|
+
}>>>;
|
|
474
|
+
readonly socials: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
475
|
+
readonly platform: import("effect/Schema").Literals<readonly ["facebook", "github", "instagram", "linkedin", "tiktok", "x", "youtube"]>;
|
|
476
|
+
readonly url: import("effect/Schema").NonEmptyString;
|
|
477
|
+
readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
478
|
+
readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
|
|
479
|
+
readonly label: import("effect/Schema").NonEmptyString;
|
|
480
|
+
}>>;
|
|
481
|
+
}>>>;
|
|
482
|
+
readonly addresses: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
483
|
+
readonly streetAddress: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
484
|
+
readonly locality: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
485
|
+
readonly region: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
486
|
+
readonly postalCode: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
487
|
+
readonly country: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
488
|
+
readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
489
|
+
readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
|
|
490
|
+
readonly label: import("effect/Schema").NonEmptyString;
|
|
491
|
+
}>>;
|
|
492
|
+
readonly formatted: import("effect/Schema").String;
|
|
493
|
+
}>>>;
|
|
451
494
|
readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
452
495
|
readonly icon: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
453
496
|
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getProjectPublicConfig", "GET", "/api/auth/project-config", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
@@ -9,7 +9,7 @@ export { AdminOrganizationForm } from "./admin-organization-form";
|
|
|
9
9
|
export { AdminUsersTable, useAdminUsersTotal } from "./admin-users";
|
|
10
10
|
export { assetUrl } from "./utils";
|
|
11
11
|
export type { KrakstackAuthContextValue, KrakstackAuthLocale, KrakstackAuthProviderProps, } from "./auth-provider";
|
|
12
|
-
export type { OrganizationSwitcherDialog, OrganizationSwitcherProps, } from "./organization-switcher";
|
|
12
|
+
export type { OrganizationSwitcherDialog, OrganizationSwitcherFeatures, OrganizationSwitcherProps, } from "./organization-switcher";
|
|
13
13
|
export type { UserButtonDialog } from "./user-button";
|
|
14
14
|
export type { AuthUiClient } from "./auth-client";
|
|
15
|
-
export type { MemberRequiredMessages, MemberRequiredProps } from "./member-required";
|
|
15
|
+
export type { MemberRequiredMessages, MemberRequiredProps, } from "./member-required";
|
|
@@ -53,6 +53,8 @@ const isFullOrganization = (value) => {
|
|
|
53
53
|
if (!("displayName" in value) || typeof value.displayName !== "string") {
|
|
54
54
|
return false;
|
|
55
55
|
}
|
|
56
|
+
if ("emails" in value && !Array.isArray(value.emails))
|
|
57
|
+
return false;
|
|
56
58
|
return true;
|
|
57
59
|
};
|
|
58
60
|
const interpolate = (value, params) => Object.entries(params ?? {}).reduce((current, [key, replacement]) => current.replace(`{${key}}`, replacement), value);
|
|
@@ -62,21 +64,26 @@ const labels = (locale, overrides) => ({
|
|
|
62
64
|
});
|
|
63
65
|
const invitationMatches = (invitation, organizationId) => invitation.status === "pending" &&
|
|
64
66
|
invitation.organizationId === organizationId;
|
|
65
|
-
const organizationContactEmail = (organization, fallback) => organization?.contactEmail ??
|
|
67
|
+
const organizationContactEmail = (organization, fallback) => organization?.contactEmail ??
|
|
68
|
+
organization?.emails?.[0]?.email ??
|
|
69
|
+
fallback ??
|
|
70
|
+
null;
|
|
66
71
|
const organizationDisplayName = (invitation, organization, fallback) => organization?.displayName ??
|
|
67
72
|
organization?.name ??
|
|
68
73
|
invitation?.organization?.name ??
|
|
69
74
|
invitation?.organizationName ??
|
|
70
75
|
fallback;
|
|
71
|
-
const organizationProfileUrl = (baseUrl, organizationId) => {
|
|
76
|
+
const organizationProfileUrl = (baseUrl, organizationId, locale) => {
|
|
72
77
|
const root = baseUrl?.trim() ||
|
|
73
78
|
(typeof window === "undefined" ? "" : window.location.origin);
|
|
74
79
|
const url = new URL("/api/auth/organization-profile", root);
|
|
75
80
|
url.searchParams.set("organizationId", organizationId);
|
|
81
|
+
if (locale)
|
|
82
|
+
url.searchParams.set("locale", locale);
|
|
76
83
|
return url;
|
|
77
84
|
};
|
|
78
|
-
const getOrganizationPublicProfile = async (baseUrl, organizationId) => {
|
|
79
|
-
const response = await fetch(organizationProfileUrl(baseUrl, organizationId), {
|
|
85
|
+
const getOrganizationPublicProfile = async (baseUrl, organizationId, locale) => {
|
|
86
|
+
const response = await fetch(organizationProfileUrl(baseUrl, organizationId, locale), {
|
|
80
87
|
credentials: "include",
|
|
81
88
|
});
|
|
82
89
|
if (!response.ok)
|
|
@@ -85,7 +92,7 @@ const getOrganizationPublicProfile = async (baseUrl, organizationId) => {
|
|
|
85
92
|
return isFullOrganization(body) ? body : null;
|
|
86
93
|
};
|
|
87
94
|
const accessAtom = Atom.family((authClient) => Atom.family((key) => {
|
|
88
|
-
const { baseUrl, organizationId } = JSON.parse(key);
|
|
95
|
+
const { baseUrl, locale, organizationId } = JSON.parse(key);
|
|
89
96
|
return Atom.keepAlive(Atom.make(Effect.tryPromise({
|
|
90
97
|
try: async () => {
|
|
91
98
|
const activeResult = await authClient.organization.setActive({
|
|
@@ -94,7 +101,7 @@ const accessAtom = Atom.family((authClient) => Atom.family((key) => {
|
|
|
94
101
|
if (!activeResult.error)
|
|
95
102
|
return { allowed: true };
|
|
96
103
|
const [organization, invitationsResult] = await Promise.all([
|
|
97
|
-
getOrganizationPublicProfile(baseUrl, organizationId).catch(() => null),
|
|
104
|
+
getOrganizationPublicProfile(baseUrl, organizationId, locale).catch(() => null),
|
|
98
105
|
authClient.organization.listUserInvitations({}),
|
|
99
106
|
]);
|
|
100
107
|
return {
|
|
@@ -106,7 +113,13 @@ const accessAtom = Atom.family((authClient) => Atom.family((key) => {
|
|
|
106
113
|
catch: (error) => error,
|
|
107
114
|
})));
|
|
108
115
|
}));
|
|
109
|
-
const accessAtomKey = ({ authRefreshVersion, baseUrl, organizationId, userId, }) => JSON.stringify({
|
|
116
|
+
const accessAtomKey = ({ authRefreshVersion, baseUrl, locale, organizationId, userId, }) => JSON.stringify({
|
|
117
|
+
authRefreshVersion,
|
|
118
|
+
baseUrl,
|
|
119
|
+
locale,
|
|
120
|
+
organizationId,
|
|
121
|
+
userId,
|
|
122
|
+
});
|
|
110
123
|
export function MemberRequired({ authClient: providedAuthClient, organizationId, contactEmail, children, messages, }) {
|
|
111
124
|
const auth = useKrakstackAuth();
|
|
112
125
|
const authClient = providedAuthClient ?? auth?.authClient;
|
|
@@ -122,6 +135,7 @@ export function MemberRequired({ authClient: providedAuthClient, organizationId,
|
|
|
122
135
|
const currentAccessKey = accessAtomKey({
|
|
123
136
|
authRefreshVersion,
|
|
124
137
|
baseUrl,
|
|
138
|
+
locale,
|
|
125
139
|
organizationId,
|
|
126
140
|
userId,
|
|
127
141
|
});
|
|
@@ -4,7 +4,20 @@ import type { AuthUiClient } from "./auth-client";
|
|
|
4
4
|
declare const messages: {
|
|
5
5
|
readonly en: {
|
|
6
6
|
readonly api_key_rate_limit_notice: "API keys are subject to the same rate limits as your account.";
|
|
7
|
-
readonly
|
|
7
|
+
readonly organization_contact: "Contact methods";
|
|
8
|
+
readonly organization_contact_add_email: "Add email";
|
|
9
|
+
readonly organization_contact_add_phone: "Add phone";
|
|
10
|
+
readonly organization_contact_add_social: "Add social profile";
|
|
11
|
+
readonly organization_contact_add_website: "Add website";
|
|
12
|
+
readonly organization_contact_email_type: "Email";
|
|
13
|
+
readonly organization_contact_extension: "Extension";
|
|
14
|
+
readonly organization_contact_label: "Label";
|
|
15
|
+
readonly organization_contact_phone_type: "Phone";
|
|
16
|
+
readonly organization_contact_platform: "Platform";
|
|
17
|
+
readonly organization_contact_remove: "Remove contact method";
|
|
18
|
+
readonly organization_contact_social_type: "Social";
|
|
19
|
+
readonly organization_contact_url: "URL";
|
|
20
|
+
readonly organization_contact_website_type: "Website";
|
|
8
21
|
readonly organization_create_description: "Create a workspace for team-based access.";
|
|
9
22
|
readonly organization_create_error: "Could not create the organization.";
|
|
10
23
|
readonly organization_copy_id: "Copy organization ID";
|
|
@@ -38,10 +51,17 @@ declare const messages: {
|
|
|
38
51
|
readonly organization_invite_member_description: "Send an invitation to join this organization with the selected role.";
|
|
39
52
|
readonly organization_invite_member_title: "Invite a member";
|
|
40
53
|
readonly organization_loading: "Loading...";
|
|
41
|
-
readonly
|
|
54
|
+
readonly organization_address: "Address";
|
|
55
|
+
readonly organization_address_add: "Add address";
|
|
56
|
+
readonly organization_address_country: "Country";
|
|
57
|
+
readonly organization_address_locality: "City or locality";
|
|
58
|
+
readonly organization_address_postal_code: "Postal code";
|
|
59
|
+
readonly organization_address_region: "State, province, or region";
|
|
60
|
+
readonly organization_address_street: "Street address";
|
|
42
61
|
readonly organization_parent: "Parent organization";
|
|
43
62
|
readonly organization_parent_description: "Optionally group this organization under another organization.";
|
|
44
63
|
readonly organization_parent_none: "No parent organization";
|
|
64
|
+
readonly organization_profile: "Profile";
|
|
45
65
|
readonly organization_icon: "Icon";
|
|
46
66
|
readonly organization_logo: "Logo";
|
|
47
67
|
readonly organization_logo_upload_error: "Could not upload the organization logo.";
|
|
@@ -64,7 +84,7 @@ declare const messages: {
|
|
|
64
84
|
readonly organization_role_member: "Member";
|
|
65
85
|
readonly organization_role_owner: "Owner";
|
|
66
86
|
readonly organization_role_support: "Support";
|
|
67
|
-
readonly organization_slug: "
|
|
87
|
+
readonly organization_slug: "Slug";
|
|
68
88
|
readonly organization_slug_description: "Leave blank to generate one from the name.";
|
|
69
89
|
readonly organization_switcher_empty: "You do not belong to any organizations yet.";
|
|
70
90
|
readonly organization_switcher_label: "Organization";
|
|
@@ -72,8 +92,6 @@ declare const messages: {
|
|
|
72
92
|
readonly organization_switcher_no_other_organizations: "No other organizations.";
|
|
73
93
|
readonly organization_switcher_personal: "Personal";
|
|
74
94
|
readonly organization_translation_description: "Localized organization details stored in metadata.";
|
|
75
|
-
readonly organization_translation_english: "English profile";
|
|
76
|
-
readonly organization_translation_french: "French profile";
|
|
77
95
|
readonly organization_translation_name: "Name";
|
|
78
96
|
readonly organization_update_error: "Could not update the organization.";
|
|
79
97
|
readonly table_empty: "No results.";
|
|
@@ -95,7 +113,20 @@ declare const messages: {
|
|
|
95
113
|
};
|
|
96
114
|
readonly fr: {
|
|
97
115
|
readonly api_key_rate_limit_notice: "Les clés API sont soumises aux mêmes limites de débit que votre compte.";
|
|
98
|
-
readonly
|
|
116
|
+
readonly organization_contact: "Moyens de contact";
|
|
117
|
+
readonly organization_contact_add_email: "Ajouter un courriel";
|
|
118
|
+
readonly organization_contact_add_phone: "Ajouter un téléphone";
|
|
119
|
+
readonly organization_contact_add_social: "Ajouter un profil social";
|
|
120
|
+
readonly organization_contact_add_website: "Ajouter un site Web";
|
|
121
|
+
readonly organization_contact_email_type: "Courriel";
|
|
122
|
+
readonly organization_contact_extension: "Poste";
|
|
123
|
+
readonly organization_contact_label: "Libellé";
|
|
124
|
+
readonly organization_contact_phone_type: "Téléphone";
|
|
125
|
+
readonly organization_contact_platform: "Plateforme";
|
|
126
|
+
readonly organization_contact_remove: "Supprimer le moyen de contact";
|
|
127
|
+
readonly organization_contact_social_type: "Réseau social";
|
|
128
|
+
readonly organization_contact_url: "URL";
|
|
129
|
+
readonly organization_contact_website_type: "Site Web";
|
|
99
130
|
readonly organization_create_description: "Créez un espace de travail pour l'accès en équipe.";
|
|
100
131
|
readonly organization_create_error: "Impossible de créer l'organisation.";
|
|
101
132
|
readonly organization_copy_id: "Copier l'ID de l'organisation";
|
|
@@ -129,10 +160,17 @@ declare const messages: {
|
|
|
129
160
|
readonly organization_invite_member_description: "Envoyez une invitation à rejoindre cette organisation avec le rôle sélectionné.";
|
|
130
161
|
readonly organization_invite_member_title: "Inviter un membre";
|
|
131
162
|
readonly organization_loading: "Chargement...";
|
|
132
|
-
readonly
|
|
163
|
+
readonly organization_address: "Adresse";
|
|
164
|
+
readonly organization_address_add: "Ajouter une adresse";
|
|
165
|
+
readonly organization_address_country: "Pays";
|
|
166
|
+
readonly organization_address_locality: "Ville ou localité";
|
|
167
|
+
readonly organization_address_postal_code: "Code postal";
|
|
168
|
+
readonly organization_address_region: "État, province ou région";
|
|
169
|
+
readonly organization_address_street: "Adresse municipale";
|
|
133
170
|
readonly organization_parent: "Organisation parente";
|
|
134
171
|
readonly organization_parent_description: "Regroupez facultativement cette organisation sous une autre organisation.";
|
|
135
172
|
readonly organization_parent_none: "Aucune organisation parente";
|
|
173
|
+
readonly organization_profile: "Profil";
|
|
136
174
|
readonly organization_icon: "Icône";
|
|
137
175
|
readonly organization_logo: "Logo";
|
|
138
176
|
readonly organization_logo_upload_error: "Impossible de téléverser le logo de l'organisation.";
|
|
@@ -155,7 +193,7 @@ declare const messages: {
|
|
|
155
193
|
readonly organization_role_member: "Membre";
|
|
156
194
|
readonly organization_role_owner: "Propriétaire";
|
|
157
195
|
readonly organization_role_support: "Support";
|
|
158
|
-
readonly organization_slug: "Slug
|
|
196
|
+
readonly organization_slug: "Slug";
|
|
159
197
|
readonly organization_slug_description: "Laissez vide pour en générer un à partir du nom.";
|
|
160
198
|
readonly organization_switcher_empty: "Vous n'appartenez encore à aucune organisation.";
|
|
161
199
|
readonly organization_switcher_label: "Organisation";
|
|
@@ -163,8 +201,6 @@ declare const messages: {
|
|
|
163
201
|
readonly organization_switcher_no_other_organizations: "Aucune autre organisation.";
|
|
164
202
|
readonly organization_switcher_personal: "Personnel";
|
|
165
203
|
readonly organization_translation_description: "Détails localisés de l'organisation stockés dans les métadonnées.";
|
|
166
|
-
readonly organization_translation_english: "Profil anglais";
|
|
167
|
-
readonly organization_translation_french: "Profil français";
|
|
168
204
|
readonly organization_translation_name: "Nom";
|
|
169
205
|
readonly organization_update_error: "Impossible de mettre à jour l'organisation.";
|
|
170
206
|
readonly table_empty: "Aucun résultat.";
|
|
@@ -187,17 +223,22 @@ declare const messages: {
|
|
|
187
223
|
};
|
|
188
224
|
type OrganizationSwitcherMessageKey = keyof (typeof messages)["en"];
|
|
189
225
|
export type OrganizationSwitcherMessages = Partial<Record<OrganizationSwitcherMessageKey, string>>;
|
|
226
|
+
export type OrganizationSwitcherFeatures = {
|
|
227
|
+
organizationSwitching?: boolean;
|
|
228
|
+
organizationCreation?: boolean;
|
|
229
|
+
userInvitations?: boolean;
|
|
230
|
+
};
|
|
190
231
|
export type OrganizationSwitcherProps = {
|
|
191
232
|
authClient?: AuthUiClient;
|
|
192
233
|
baseUrl?: string | undefined;
|
|
193
234
|
side?: ComponentProps<typeof DropdownMenuContent>["side"];
|
|
194
235
|
className?: string;
|
|
195
236
|
defaultDialog?: OrganizationSwitcherDialog | null;
|
|
237
|
+
features?: OrganizationSwitcherFeatures;
|
|
196
238
|
hideTrigger?: boolean;
|
|
197
239
|
menuActions?: ReactNode;
|
|
198
240
|
renderUnauthenticated?: () => ReactNode;
|
|
199
|
-
|
|
200
|
-
organizationWhitelist?: readonly string[];
|
|
241
|
+
allowedOrganizationIds?: readonly string[];
|
|
201
242
|
messages?: OrganizationSwitcherMessages;
|
|
202
243
|
dialog?: OrganizationSwitcherDialog | null;
|
|
203
244
|
onChange?: (organization: OrganizationSummary | null) => void;
|
|
@@ -213,5 +254,5 @@ type OrganizationSummary = {
|
|
|
213
254
|
parentId?: string | null;
|
|
214
255
|
};
|
|
215
256
|
export type OrganizationSwitcherDialog = "create" | "manage" | "members" | "apiKeys" | "invitations";
|
|
216
|
-
export declare function OrganizationSwitcher({ authClient: providedAuthClient, baseUrl, side, className, defaultDialog, hideTrigger, menuActions, renderUnauthenticated,
|
|
257
|
+
export declare function OrganizationSwitcher({ authClient: providedAuthClient, baseUrl, side, className, defaultDialog, features, hideTrigger, menuActions, renderUnauthenticated, allowedOrganizationIds, messages, dialog: controlledDialog, onChange, onCreate, onDialogChange, }: OrganizationSwitcherProps): import("react").JSX.Element;
|
|
217
258
|
export {};
|