@streamoid/settings 0.4.7 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +139 -11
- package/dist/index.d.ts +139 -11
- package/dist/index.js +474 -229
- package/dist/index.mjs +474 -230
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -233,21 +233,46 @@ interface SettingsWorkspaceAdapter {
|
|
|
233
233
|
/** Toggle this workspace's `orgVisibility` within its parent org. */
|
|
234
234
|
setOrgVisibility?: (visibility: "private" | "shared") => Promise<void>;
|
|
235
235
|
}
|
|
236
|
+
/**
|
|
237
|
+
* An organization membership role.
|
|
238
|
+
*
|
|
239
|
+
* `guest` is an outsider who accepted an invite to a single workspace inside
|
|
240
|
+
* the organization. They hold a membership row — so they show up in these
|
|
241
|
+
* responses — but inherit nothing from the org: no implicit access to its
|
|
242
|
+
* shared workspaces, and every org-level write is refused by the backend.
|
|
243
|
+
*
|
|
244
|
+
* Gate write affordances on `=== "admin"`, never on `!== "member"`: a role this
|
|
245
|
+
* union does not yet name must read as least-privileged, not as an editor.
|
|
246
|
+
*
|
|
247
|
+
* Deliberately NOT applied to `autoJoinRole` or to workspace/team roles — a
|
|
248
|
+
* domain claim that auto-joins its own company as guests is a contradiction,
|
|
249
|
+
* and a workspace role of "guest" is not a value the backend accepts.
|
|
250
|
+
*/
|
|
251
|
+
type SettingsOrganizationRole = "admin" | "member" | "guest";
|
|
236
252
|
interface SettingsOrganizationListItem {
|
|
237
253
|
_id: string;
|
|
238
254
|
name: string;
|
|
239
255
|
imageUrl?: string;
|
|
240
|
-
role?:
|
|
256
|
+
role?: SettingsOrganizationRole;
|
|
241
257
|
}
|
|
242
258
|
interface SettingsOrganizationCurrent {
|
|
243
259
|
id: string;
|
|
244
260
|
name?: string;
|
|
245
261
|
imageUrl?: string;
|
|
246
|
-
role?:
|
|
262
|
+
role?: SettingsOrganizationRole | string;
|
|
263
|
+
/**
|
|
264
|
+
* Whether the viewer may invite into this organization.
|
|
265
|
+
*
|
|
266
|
+
* Orthogonal to `role`, not implied by it: a guest row can carry it too, so
|
|
267
|
+
* gate on `role !== "guest" && (role === "admin" || inviteAccess)`. The
|
|
268
|
+
* shorter `role === "admin" || inviteAccess` is the escalation the backend
|
|
269
|
+
* explicitly refuses.
|
|
270
|
+
*/
|
|
271
|
+
inviteAccess?: boolean;
|
|
247
272
|
}
|
|
248
273
|
interface OrganizationMember {
|
|
249
274
|
_id: string;
|
|
250
|
-
role:
|
|
275
|
+
role: SettingsOrganizationRole;
|
|
251
276
|
inviteAccess: boolean;
|
|
252
277
|
/** Populated user. Rows whose user document was deleted come back from the
|
|
253
278
|
* API with a null `user` — OrganizationContent drops those on fetch, so
|
|
@@ -357,9 +382,21 @@ interface SettingsOrganizationAdapter {
|
|
|
357
382
|
role: "admin" | "member";
|
|
358
383
|
inviteAccess?: boolean;
|
|
359
384
|
}) => Promise<void>;
|
|
360
|
-
/** Optional: gates write affordances inside the Organization tab.
|
|
385
|
+
/** Optional: gates write affordances inside the Organization tab. Can report
|
|
386
|
+
* "guest", so callers must gate on `=== "admin"` rather than `!== "member"`. */
|
|
361
387
|
getHighestRole?: () => Promise<{
|
|
362
|
-
role:
|
|
388
|
+
role: SettingsOrganizationRole;
|
|
389
|
+
/**
|
|
390
|
+
* The viewer's own email domain, and whether it can be claimed at all.
|
|
391
|
+
*
|
|
392
|
+
* A self-serve domain claim can only ever be the claimer's OWN domain —
|
|
393
|
+
* there is no DNS verification, so the backend refuses any other — which
|
|
394
|
+
* makes one boolean about one known domain the entire answer. Server
|
|
395
|
+
* computed on purpose: the disposable-domain lists it consults are
|
|
396
|
+
* provisioned at runtime, so no bundled list could agree with it.
|
|
397
|
+
*/
|
|
398
|
+
emailDomain?: string | null;
|
|
399
|
+
canClaimEmailDomain?: boolean;
|
|
363
400
|
}>;
|
|
364
401
|
fetchWorkspaces: () => Promise<OrganizationWorkspaceItem[]>;
|
|
365
402
|
fetchJoinRequests: () => Promise<OrganizationJoinRequest[]>;
|
|
@@ -675,7 +712,18 @@ interface SettingsApiAdapter {
|
|
|
675
712
|
/** Send an invitation to `email` with the given permissions. */
|
|
676
713
|
inviteMember: (input: {
|
|
677
714
|
email: string;
|
|
678
|
-
} & MemberPermissionsPayload
|
|
715
|
+
} & MemberPermissionsPayload & {
|
|
716
|
+
/**
|
|
717
|
+
* Standing in the workspace's ORGANIZATION, independent of `role`,
|
|
718
|
+
* which is the role inside the workspace. Omit for "no preference" —
|
|
719
|
+
* the backend then derives it from the invitee's email domain, which
|
|
720
|
+
* is what it has always done.
|
|
721
|
+
*
|
|
722
|
+
* Deliberately not on MemberPermissionsPayload: that type is shared
|
|
723
|
+
* with `updateMemberRole`, and org membership is not editable there.
|
|
724
|
+
*/
|
|
725
|
+
organizationRole?: "member" | "guest";
|
|
726
|
+
}) => Promise<void>;
|
|
679
727
|
/**
|
|
680
728
|
* Canonical name for role updates. CXO's underlying service is named
|
|
681
729
|
* `changeUserRole(workspaceId, payload)`; the adapter wraps that. Both
|
|
@@ -755,6 +803,18 @@ interface SettingsNavigationAdapter {
|
|
|
755
803
|
getCheckoutReturnUrl?: (kind: "success" | "cancel") => string;
|
|
756
804
|
/** Imperative navigate to another settings tab. */
|
|
757
805
|
navigateToTab: (tab: SettingsTab) => void;
|
|
806
|
+
/**
|
|
807
|
+
* Go back to whatever the user was doing before they opened settings.
|
|
808
|
+
*
|
|
809
|
+
* Distinct from `close`: closing is "leave settings" and lands wherever the
|
|
810
|
+
* host decides settings' parent is; back is "the screen I came from", which
|
|
811
|
+
* only the history knows. Omit it and the shell calls
|
|
812
|
+
* `window.history.back()`, which is right in every host today — settings is
|
|
813
|
+
* a route, and the browser already knows where the user was. Supply it when
|
|
814
|
+
* your router keeps its own stack, or pass `onBack={null}` on
|
|
815
|
+
* `<SettingsContent>` to render no back control at all.
|
|
816
|
+
*/
|
|
817
|
+
back?: () => void;
|
|
758
818
|
/**
|
|
759
819
|
* Leave settings entirely. Supplying this makes the shell render a close (×)
|
|
760
820
|
* button and dismiss on Escape. Hosts that would rather pass a callback
|
|
@@ -880,8 +940,19 @@ interface SettingsContentProps {
|
|
|
880
940
|
* no close affordance is rendered — that is the pre-0.3.8 behaviour.
|
|
881
941
|
*/
|
|
882
942
|
onClose?: () => void;
|
|
943
|
+
/**
|
|
944
|
+
* Go back to the screen the user came from, rendered as a `← Back` control
|
|
945
|
+
* above the breadcrumb.
|
|
946
|
+
*
|
|
947
|
+
* Defaults to `adapters.navigation.back`, and to `window.history.back()`
|
|
948
|
+
* when neither is supplied — settings is a route in every host, so the
|
|
949
|
+
* browser already knows where the user was, and requiring a prop would mean
|
|
950
|
+
* the control appeared in whichever app remembered to pass one. Pass `null`
|
|
951
|
+
* to render no back control.
|
|
952
|
+
*/
|
|
953
|
+
onBack?: (() => void) | null;
|
|
883
954
|
}
|
|
884
|
-
declare function SettingsContent({ adapters, activeTab, onClose, hiddenApps, }: SettingsContentProps): react.JSX.Element;
|
|
955
|
+
declare function SettingsContent({ adapters, activeTab, onClose, onBack, hiddenApps, }: SettingsContentProps): react.JSX.Element;
|
|
885
956
|
|
|
886
957
|
interface WorkspaceData {
|
|
887
958
|
id: string;
|
|
@@ -1135,7 +1206,36 @@ interface OrganizationInviteModalProps {
|
|
|
1135
1206
|
mode: ModalMode$1;
|
|
1136
1207
|
/** Update mode: the target member's email (read-only display). */
|
|
1137
1208
|
userEmail?: string;
|
|
1209
|
+
/** admin/member only — the toggle below cannot express any other role, so
|
|
1210
|
+
* pass `lockRole` for a target whose role is outside that pair. */
|
|
1138
1211
|
initialRole?: "admin" | "member";
|
|
1212
|
+
/**
|
|
1213
|
+
* Show the target's role read-only and disable Save, leaving Remove as the
|
|
1214
|
+
* only action.
|
|
1215
|
+
*
|
|
1216
|
+
* For an organization guest: the toggle offers Admin and Member and nothing
|
|
1217
|
+
* else, so opening it on a guest preselected "Member" and quietly promoted
|
|
1218
|
+
* them the moment Save was pressed — even by an admin who came only to flip
|
|
1219
|
+
* `inviteAccess`, which is itself the thing a guest must never hold. Removing
|
|
1220
|
+
* a guest happens through this same modal, so refusing to open it was not an
|
|
1221
|
+
* option.
|
|
1222
|
+
*/
|
|
1223
|
+
lockRole?: boolean;
|
|
1224
|
+
/**
|
|
1225
|
+
* Whether the viewer's own email domain can be claimed at all. Defaults to
|
|
1226
|
+
* true, preserving today's behaviour for any host that does not pass it.
|
|
1227
|
+
*
|
|
1228
|
+
* A domain claim can only ever be the claimer's OWN domain — there is no DNS
|
|
1229
|
+
* verification, so the backend refuses any other — and a public provider
|
|
1230
|
+
* like gmail.com can never be claimed by anybody. Offering the tab in that
|
|
1231
|
+
* case advertises the one mechanism that would solve bulk onboarding and
|
|
1232
|
+
* then fails after submit, which is worse than not offering it.
|
|
1233
|
+
*/
|
|
1234
|
+
canClaimDomain?: boolean;
|
|
1235
|
+
/** The viewer's own email domain: the only one they could ever claim. */
|
|
1236
|
+
claimableDomain?: string | null;
|
|
1237
|
+
/** Label for the read-only role shown when `lockRole` is set. */
|
|
1238
|
+
lockedRoleLabel?: string;
|
|
1139
1239
|
initialInviteAccess?: boolean;
|
|
1140
1240
|
/** Lets a pending-invite row reopen this modal to resend without edits. */
|
|
1141
1241
|
allowSubmitWithoutChanges?: boolean;
|
|
@@ -1156,7 +1256,7 @@ interface OrganizationInviteModalProps {
|
|
|
1156
1256
|
}) => void;
|
|
1157
1257
|
onRemove?: () => void;
|
|
1158
1258
|
}
|
|
1159
|
-
declare function OrganizationInviteModal({ open, mode, userEmail, initialRole, initialInviteAccess, allowSubmitWithoutChanges, canRemove, onClose, onInviteEmail, onInviteDomain, onUpdate, onRemove, }: OrganizationInviteModalProps): react.JSX.Element | null;
|
|
1259
|
+
declare function OrganizationInviteModal({ open, mode, userEmail, initialRole, lockRole, canClaimDomain, claimableDomain, lockedRoleLabel, initialInviteAccess, allowSubmitWithoutChanges, canRemove, onClose, onInviteEmail, onInviteDomain, onUpdate, onRemove, }: OrganizationInviteModalProps): react.JSX.Element | null;
|
|
1160
1260
|
|
|
1161
1261
|
interface ConfirmLeaveModalProps {
|
|
1162
1262
|
open: boolean;
|
|
@@ -1191,6 +1291,12 @@ interface StoreOption {
|
|
|
1191
1291
|
_id: string;
|
|
1192
1292
|
name?: string;
|
|
1193
1293
|
}
|
|
1294
|
+
/**
|
|
1295
|
+
* Standing in the workspace's parent organization, as distinct from `role`,
|
|
1296
|
+
* which is the role inside the workspace itself. The two are independent: an
|
|
1297
|
+
* external collaborator is routinely a workspace admin and an org guest.
|
|
1298
|
+
*/
|
|
1299
|
+
type OrganizationStanding = "colleague" | "guest";
|
|
1194
1300
|
interface InviteUpdateModalProps {
|
|
1195
1301
|
open: boolean;
|
|
1196
1302
|
mode: ModalMode;
|
|
@@ -1233,10 +1339,32 @@ interface InviteUpdateModalProps {
|
|
|
1233
1339
|
onRemove?: () => void;
|
|
1234
1340
|
/** Controls whether the Remove user button is enabled. Defaults to true. */
|
|
1235
1341
|
canRemove?: boolean;
|
|
1236
|
-
/**
|
|
1237
|
-
|
|
1342
|
+
/**
|
|
1343
|
+
* Offer the invitee an explicit standing in the workspace's parent
|
|
1344
|
+
* organization.
|
|
1345
|
+
*
|
|
1346
|
+
* Omit it and nothing renders and nothing is submitted — the backend keeps
|
|
1347
|
+
* deriving the standing from the invitee's email domain, which is today's
|
|
1348
|
+
* behaviour. Pass it only when the workspace HAS an organization and the
|
|
1349
|
+
* inviter may grant membership in it; showing the choice to someone who
|
|
1350
|
+
* cannot grant it produces an invite the backend quietly downgrades.
|
|
1351
|
+
*/
|
|
1352
|
+
showOrganizationStanding?: boolean;
|
|
1353
|
+
/** Name of the parent organization, for the option copy. */
|
|
1354
|
+
organizationName?: string;
|
|
1355
|
+
/**
|
|
1356
|
+
* Hide the Guest option. For an invitee whose email domain the organization
|
|
1357
|
+
* already claims, guest is not expressible: the backend takes the higher of
|
|
1358
|
+
* the requested and domain-derived roles, so choosing it would appear to
|
|
1359
|
+
* work and change nothing.
|
|
1360
|
+
*/
|
|
1361
|
+
allowGuestStanding?: boolean;
|
|
1362
|
+
/** Defaults to "guest" — the least-privileged of the two. */
|
|
1363
|
+
initialOrganizationStanding?: OrganizationStanding;
|
|
1364
|
+
/** Called only in invite mode; receives (permissions, email, standing) */
|
|
1365
|
+
onInvite?: (permissions: UserPermissions, email: string, organizationStanding?: OrganizationStanding) => void;
|
|
1238
1366
|
}
|
|
1239
|
-
declare function InviteUpdateModal({ open, mode, userEmail, stores, hiddenApps, allowSubmitWithoutChanges, initialPermissions, onClose, onSave, onRemove, canRemove, onInvite, }: InviteUpdateModalProps): react.JSX.Element | null;
|
|
1367
|
+
declare function InviteUpdateModal({ open, mode, userEmail, stores, hiddenApps, allowSubmitWithoutChanges, initialPermissions, onClose, onSave, onRemove, canRemove, showOrganizationStanding, organizationName, allowGuestStanding, initialOrganizationStanding, onInvite, }: InviteUpdateModalProps): react.JSX.Element | null;
|
|
1240
1368
|
|
|
1241
1369
|
interface ExportDateModalProps {
|
|
1242
1370
|
title: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -233,21 +233,46 @@ interface SettingsWorkspaceAdapter {
|
|
|
233
233
|
/** Toggle this workspace's `orgVisibility` within its parent org. */
|
|
234
234
|
setOrgVisibility?: (visibility: "private" | "shared") => Promise<void>;
|
|
235
235
|
}
|
|
236
|
+
/**
|
|
237
|
+
* An organization membership role.
|
|
238
|
+
*
|
|
239
|
+
* `guest` is an outsider who accepted an invite to a single workspace inside
|
|
240
|
+
* the organization. They hold a membership row — so they show up in these
|
|
241
|
+
* responses — but inherit nothing from the org: no implicit access to its
|
|
242
|
+
* shared workspaces, and every org-level write is refused by the backend.
|
|
243
|
+
*
|
|
244
|
+
* Gate write affordances on `=== "admin"`, never on `!== "member"`: a role this
|
|
245
|
+
* union does not yet name must read as least-privileged, not as an editor.
|
|
246
|
+
*
|
|
247
|
+
* Deliberately NOT applied to `autoJoinRole` or to workspace/team roles — a
|
|
248
|
+
* domain claim that auto-joins its own company as guests is a contradiction,
|
|
249
|
+
* and a workspace role of "guest" is not a value the backend accepts.
|
|
250
|
+
*/
|
|
251
|
+
type SettingsOrganizationRole = "admin" | "member" | "guest";
|
|
236
252
|
interface SettingsOrganizationListItem {
|
|
237
253
|
_id: string;
|
|
238
254
|
name: string;
|
|
239
255
|
imageUrl?: string;
|
|
240
|
-
role?:
|
|
256
|
+
role?: SettingsOrganizationRole;
|
|
241
257
|
}
|
|
242
258
|
interface SettingsOrganizationCurrent {
|
|
243
259
|
id: string;
|
|
244
260
|
name?: string;
|
|
245
261
|
imageUrl?: string;
|
|
246
|
-
role?:
|
|
262
|
+
role?: SettingsOrganizationRole | string;
|
|
263
|
+
/**
|
|
264
|
+
* Whether the viewer may invite into this organization.
|
|
265
|
+
*
|
|
266
|
+
* Orthogonal to `role`, not implied by it: a guest row can carry it too, so
|
|
267
|
+
* gate on `role !== "guest" && (role === "admin" || inviteAccess)`. The
|
|
268
|
+
* shorter `role === "admin" || inviteAccess` is the escalation the backend
|
|
269
|
+
* explicitly refuses.
|
|
270
|
+
*/
|
|
271
|
+
inviteAccess?: boolean;
|
|
247
272
|
}
|
|
248
273
|
interface OrganizationMember {
|
|
249
274
|
_id: string;
|
|
250
|
-
role:
|
|
275
|
+
role: SettingsOrganizationRole;
|
|
251
276
|
inviteAccess: boolean;
|
|
252
277
|
/** Populated user. Rows whose user document was deleted come back from the
|
|
253
278
|
* API with a null `user` — OrganizationContent drops those on fetch, so
|
|
@@ -357,9 +382,21 @@ interface SettingsOrganizationAdapter {
|
|
|
357
382
|
role: "admin" | "member";
|
|
358
383
|
inviteAccess?: boolean;
|
|
359
384
|
}) => Promise<void>;
|
|
360
|
-
/** Optional: gates write affordances inside the Organization tab.
|
|
385
|
+
/** Optional: gates write affordances inside the Organization tab. Can report
|
|
386
|
+
* "guest", so callers must gate on `=== "admin"` rather than `!== "member"`. */
|
|
361
387
|
getHighestRole?: () => Promise<{
|
|
362
|
-
role:
|
|
388
|
+
role: SettingsOrganizationRole;
|
|
389
|
+
/**
|
|
390
|
+
* The viewer's own email domain, and whether it can be claimed at all.
|
|
391
|
+
*
|
|
392
|
+
* A self-serve domain claim can only ever be the claimer's OWN domain —
|
|
393
|
+
* there is no DNS verification, so the backend refuses any other — which
|
|
394
|
+
* makes one boolean about one known domain the entire answer. Server
|
|
395
|
+
* computed on purpose: the disposable-domain lists it consults are
|
|
396
|
+
* provisioned at runtime, so no bundled list could agree with it.
|
|
397
|
+
*/
|
|
398
|
+
emailDomain?: string | null;
|
|
399
|
+
canClaimEmailDomain?: boolean;
|
|
363
400
|
}>;
|
|
364
401
|
fetchWorkspaces: () => Promise<OrganizationWorkspaceItem[]>;
|
|
365
402
|
fetchJoinRequests: () => Promise<OrganizationJoinRequest[]>;
|
|
@@ -675,7 +712,18 @@ interface SettingsApiAdapter {
|
|
|
675
712
|
/** Send an invitation to `email` with the given permissions. */
|
|
676
713
|
inviteMember: (input: {
|
|
677
714
|
email: string;
|
|
678
|
-
} & MemberPermissionsPayload
|
|
715
|
+
} & MemberPermissionsPayload & {
|
|
716
|
+
/**
|
|
717
|
+
* Standing in the workspace's ORGANIZATION, independent of `role`,
|
|
718
|
+
* which is the role inside the workspace. Omit for "no preference" —
|
|
719
|
+
* the backend then derives it from the invitee's email domain, which
|
|
720
|
+
* is what it has always done.
|
|
721
|
+
*
|
|
722
|
+
* Deliberately not on MemberPermissionsPayload: that type is shared
|
|
723
|
+
* with `updateMemberRole`, and org membership is not editable there.
|
|
724
|
+
*/
|
|
725
|
+
organizationRole?: "member" | "guest";
|
|
726
|
+
}) => Promise<void>;
|
|
679
727
|
/**
|
|
680
728
|
* Canonical name for role updates. CXO's underlying service is named
|
|
681
729
|
* `changeUserRole(workspaceId, payload)`; the adapter wraps that. Both
|
|
@@ -755,6 +803,18 @@ interface SettingsNavigationAdapter {
|
|
|
755
803
|
getCheckoutReturnUrl?: (kind: "success" | "cancel") => string;
|
|
756
804
|
/** Imperative navigate to another settings tab. */
|
|
757
805
|
navigateToTab: (tab: SettingsTab) => void;
|
|
806
|
+
/**
|
|
807
|
+
* Go back to whatever the user was doing before they opened settings.
|
|
808
|
+
*
|
|
809
|
+
* Distinct from `close`: closing is "leave settings" and lands wherever the
|
|
810
|
+
* host decides settings' parent is; back is "the screen I came from", which
|
|
811
|
+
* only the history knows. Omit it and the shell calls
|
|
812
|
+
* `window.history.back()`, which is right in every host today — settings is
|
|
813
|
+
* a route, and the browser already knows where the user was. Supply it when
|
|
814
|
+
* your router keeps its own stack, or pass `onBack={null}` on
|
|
815
|
+
* `<SettingsContent>` to render no back control at all.
|
|
816
|
+
*/
|
|
817
|
+
back?: () => void;
|
|
758
818
|
/**
|
|
759
819
|
* Leave settings entirely. Supplying this makes the shell render a close (×)
|
|
760
820
|
* button and dismiss on Escape. Hosts that would rather pass a callback
|
|
@@ -880,8 +940,19 @@ interface SettingsContentProps {
|
|
|
880
940
|
* no close affordance is rendered — that is the pre-0.3.8 behaviour.
|
|
881
941
|
*/
|
|
882
942
|
onClose?: () => void;
|
|
943
|
+
/**
|
|
944
|
+
* Go back to the screen the user came from, rendered as a `← Back` control
|
|
945
|
+
* above the breadcrumb.
|
|
946
|
+
*
|
|
947
|
+
* Defaults to `adapters.navigation.back`, and to `window.history.back()`
|
|
948
|
+
* when neither is supplied — settings is a route in every host, so the
|
|
949
|
+
* browser already knows where the user was, and requiring a prop would mean
|
|
950
|
+
* the control appeared in whichever app remembered to pass one. Pass `null`
|
|
951
|
+
* to render no back control.
|
|
952
|
+
*/
|
|
953
|
+
onBack?: (() => void) | null;
|
|
883
954
|
}
|
|
884
|
-
declare function SettingsContent({ adapters, activeTab, onClose, hiddenApps, }: SettingsContentProps): react.JSX.Element;
|
|
955
|
+
declare function SettingsContent({ adapters, activeTab, onClose, onBack, hiddenApps, }: SettingsContentProps): react.JSX.Element;
|
|
885
956
|
|
|
886
957
|
interface WorkspaceData {
|
|
887
958
|
id: string;
|
|
@@ -1135,7 +1206,36 @@ interface OrganizationInviteModalProps {
|
|
|
1135
1206
|
mode: ModalMode$1;
|
|
1136
1207
|
/** Update mode: the target member's email (read-only display). */
|
|
1137
1208
|
userEmail?: string;
|
|
1209
|
+
/** admin/member only — the toggle below cannot express any other role, so
|
|
1210
|
+
* pass `lockRole` for a target whose role is outside that pair. */
|
|
1138
1211
|
initialRole?: "admin" | "member";
|
|
1212
|
+
/**
|
|
1213
|
+
* Show the target's role read-only and disable Save, leaving Remove as the
|
|
1214
|
+
* only action.
|
|
1215
|
+
*
|
|
1216
|
+
* For an organization guest: the toggle offers Admin and Member and nothing
|
|
1217
|
+
* else, so opening it on a guest preselected "Member" and quietly promoted
|
|
1218
|
+
* them the moment Save was pressed — even by an admin who came only to flip
|
|
1219
|
+
* `inviteAccess`, which is itself the thing a guest must never hold. Removing
|
|
1220
|
+
* a guest happens through this same modal, so refusing to open it was not an
|
|
1221
|
+
* option.
|
|
1222
|
+
*/
|
|
1223
|
+
lockRole?: boolean;
|
|
1224
|
+
/**
|
|
1225
|
+
* Whether the viewer's own email domain can be claimed at all. Defaults to
|
|
1226
|
+
* true, preserving today's behaviour for any host that does not pass it.
|
|
1227
|
+
*
|
|
1228
|
+
* A domain claim can only ever be the claimer's OWN domain — there is no DNS
|
|
1229
|
+
* verification, so the backend refuses any other — and a public provider
|
|
1230
|
+
* like gmail.com can never be claimed by anybody. Offering the tab in that
|
|
1231
|
+
* case advertises the one mechanism that would solve bulk onboarding and
|
|
1232
|
+
* then fails after submit, which is worse than not offering it.
|
|
1233
|
+
*/
|
|
1234
|
+
canClaimDomain?: boolean;
|
|
1235
|
+
/** The viewer's own email domain: the only one they could ever claim. */
|
|
1236
|
+
claimableDomain?: string | null;
|
|
1237
|
+
/** Label for the read-only role shown when `lockRole` is set. */
|
|
1238
|
+
lockedRoleLabel?: string;
|
|
1139
1239
|
initialInviteAccess?: boolean;
|
|
1140
1240
|
/** Lets a pending-invite row reopen this modal to resend without edits. */
|
|
1141
1241
|
allowSubmitWithoutChanges?: boolean;
|
|
@@ -1156,7 +1256,7 @@ interface OrganizationInviteModalProps {
|
|
|
1156
1256
|
}) => void;
|
|
1157
1257
|
onRemove?: () => void;
|
|
1158
1258
|
}
|
|
1159
|
-
declare function OrganizationInviteModal({ open, mode, userEmail, initialRole, initialInviteAccess, allowSubmitWithoutChanges, canRemove, onClose, onInviteEmail, onInviteDomain, onUpdate, onRemove, }: OrganizationInviteModalProps): react.JSX.Element | null;
|
|
1259
|
+
declare function OrganizationInviteModal({ open, mode, userEmail, initialRole, lockRole, canClaimDomain, claimableDomain, lockedRoleLabel, initialInviteAccess, allowSubmitWithoutChanges, canRemove, onClose, onInviteEmail, onInviteDomain, onUpdate, onRemove, }: OrganizationInviteModalProps): react.JSX.Element | null;
|
|
1160
1260
|
|
|
1161
1261
|
interface ConfirmLeaveModalProps {
|
|
1162
1262
|
open: boolean;
|
|
@@ -1191,6 +1291,12 @@ interface StoreOption {
|
|
|
1191
1291
|
_id: string;
|
|
1192
1292
|
name?: string;
|
|
1193
1293
|
}
|
|
1294
|
+
/**
|
|
1295
|
+
* Standing in the workspace's parent organization, as distinct from `role`,
|
|
1296
|
+
* which is the role inside the workspace itself. The two are independent: an
|
|
1297
|
+
* external collaborator is routinely a workspace admin and an org guest.
|
|
1298
|
+
*/
|
|
1299
|
+
type OrganizationStanding = "colleague" | "guest";
|
|
1194
1300
|
interface InviteUpdateModalProps {
|
|
1195
1301
|
open: boolean;
|
|
1196
1302
|
mode: ModalMode;
|
|
@@ -1233,10 +1339,32 @@ interface InviteUpdateModalProps {
|
|
|
1233
1339
|
onRemove?: () => void;
|
|
1234
1340
|
/** Controls whether the Remove user button is enabled. Defaults to true. */
|
|
1235
1341
|
canRemove?: boolean;
|
|
1236
|
-
/**
|
|
1237
|
-
|
|
1342
|
+
/**
|
|
1343
|
+
* Offer the invitee an explicit standing in the workspace's parent
|
|
1344
|
+
* organization.
|
|
1345
|
+
*
|
|
1346
|
+
* Omit it and nothing renders and nothing is submitted — the backend keeps
|
|
1347
|
+
* deriving the standing from the invitee's email domain, which is today's
|
|
1348
|
+
* behaviour. Pass it only when the workspace HAS an organization and the
|
|
1349
|
+
* inviter may grant membership in it; showing the choice to someone who
|
|
1350
|
+
* cannot grant it produces an invite the backend quietly downgrades.
|
|
1351
|
+
*/
|
|
1352
|
+
showOrganizationStanding?: boolean;
|
|
1353
|
+
/** Name of the parent organization, for the option copy. */
|
|
1354
|
+
organizationName?: string;
|
|
1355
|
+
/**
|
|
1356
|
+
* Hide the Guest option. For an invitee whose email domain the organization
|
|
1357
|
+
* already claims, guest is not expressible: the backend takes the higher of
|
|
1358
|
+
* the requested and domain-derived roles, so choosing it would appear to
|
|
1359
|
+
* work and change nothing.
|
|
1360
|
+
*/
|
|
1361
|
+
allowGuestStanding?: boolean;
|
|
1362
|
+
/** Defaults to "guest" — the least-privileged of the two. */
|
|
1363
|
+
initialOrganizationStanding?: OrganizationStanding;
|
|
1364
|
+
/** Called only in invite mode; receives (permissions, email, standing) */
|
|
1365
|
+
onInvite?: (permissions: UserPermissions, email: string, organizationStanding?: OrganizationStanding) => void;
|
|
1238
1366
|
}
|
|
1239
|
-
declare function InviteUpdateModal({ open, mode, userEmail, stores, hiddenApps, allowSubmitWithoutChanges, initialPermissions, onClose, onSave, onRemove, canRemove, onInvite, }: InviteUpdateModalProps): react.JSX.Element | null;
|
|
1367
|
+
declare function InviteUpdateModal({ open, mode, userEmail, stores, hiddenApps, allowSubmitWithoutChanges, initialPermissions, onClose, onSave, onRemove, canRemove, showOrganizationStanding, organizationName, allowGuestStanding, initialOrganizationStanding, onInvite, }: InviteUpdateModalProps): react.JSX.Element | null;
|
|
1240
1368
|
|
|
1241
1369
|
interface ExportDateModalProps {
|
|
1242
1370
|
title: string;
|