@stapel/workspaces-react 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/dist/api/generated/schema.d.ts +384 -4
- package/dist/api/generated/schema.d.ts.map +1 -1
- package/dist/api/types.d.ts +20 -5
- package/dist/api/types.d.ts.map +1 -1
- package/dist/api/workspacesApi.d.ts +23 -1
- package/dist/api/workspacesApi.d.ts.map +1 -1
- package/dist/api/workspacesApi.js +4 -0
- package/dist/api/workspacesApi.js.map +1 -1
- package/dist/default/InviteAcceptPage.d.ts +28 -0
- package/dist/default/InviteAcceptPage.d.ts.map +1 -0
- package/dist/default/InviteAcceptPage.js +141 -0
- package/dist/default/InviteAcceptPage.js.map +1 -0
- package/dist/default/MembersManager.d.ts +4 -4
- package/dist/default/MembersManager.d.ts.map +1 -1
- package/dist/default/MembersManager.js +61 -56
- package/dist/default/MembersManager.js.map +1 -1
- package/dist/default/index.d.ts +2 -0
- package/dist/default/index.d.ts.map +1 -1
- package/dist/default/index.js +1 -0
- package/dist/default/index.js.map +1 -1
- package/dist/flows/inviteAcceptFlow.d.ts +155 -0
- package/dist/flows/inviteAcceptFlow.d.ts.map +1 -0
- package/dist/flows/inviteAcceptFlow.js +126 -0
- package/dist/flows/inviteAcceptFlow.js.map +1 -0
- package/dist/headless/Can.d.ts +40 -0
- package/dist/headless/Can.d.ts.map +1 -0
- package/dist/headless/Can.js +30 -0
- package/dist/headless/Can.js.map +1 -0
- package/dist/headless/InviteAcceptFlow.d.ts +44 -0
- package/dist/headless/InviteAcceptFlow.d.ts.map +1 -0
- package/dist/headless/InviteAcceptFlow.js +67 -0
- package/dist/headless/InviteAcceptFlow.js.map +1 -0
- package/dist/headless/RoleSelect.d.ts +41 -0
- package/dist/headless/RoleSelect.d.ts.map +1 -0
- package/dist/headless/RoleSelect.js +34 -0
- package/dist/headless/RoleSelect.js.map +1 -0
- package/dist/i18n/generated/errors.gen.d.ts +48 -0
- package/dist/i18n/generated/errors.gen.d.ts.map +1 -1
- package/dist/i18n/generated/errors.gen.js +24 -0
- package/dist/i18n/generated/errors.gen.js.map +1 -1
- package/dist/i18n/generated/errors.ru.gen.d.ts.map +1 -1
- package/dist/i18n/generated/errors.ru.gen.js +8 -0
- package/dist/i18n/generated/errors.ru.gen.js.map +1 -1
- package/dist/i18n/keys.d.ts +28 -0
- package/dist/i18n/keys.d.ts.map +1 -1
- package/dist/i18n/keys.js +64 -0
- package/dist/i18n/keys.js.map +1 -1
- package/dist/i18n/ru.d.ts.map +1 -1
- package/dist/i18n/ru.js +30 -0
- package/dist/i18n/ru.js.map +1 -1
- package/dist/index.d.ts +14 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -2
- package/dist/index.js.map +1 -1
- package/dist/model/capabilities.d.ts +21 -0
- package/dist/model/capabilities.d.ts.map +1 -0
- package/dist/model/capabilities.js +32 -0
- package/dist/model/capabilities.js.map +1 -0
- package/dist/model/emailMask.d.ts +22 -0
- package/dist/model/emailMask.d.ts.map +1 -0
- package/dist/model/emailMask.js +36 -0
- package/dist/model/emailMask.js.map +1 -0
- package/dist/model/mutations.d.ts +23 -3
- package/dist/model/mutations.d.ts.map +1 -1
- package/dist/model/mutations.js +39 -1
- package/dist/model/mutations.js.map +1 -1
- package/dist/model/queries.d.ts +56 -6
- package/dist/model/queries.d.ts.map +1 -1
- package/dist/model/queries.js +75 -7
- package/dist/model/queries.js.map +1 -1
- package/dist/model/queryKeys.d.ts +2 -0
- package/dist/model/queryKeys.d.ts.map +1 -1
- package/dist/model/queryKeys.js +6 -0
- package/dist/model/queryKeys.js.map +1 -1
- package/llms.txt +40 -15
- package/manifest.json +225 -3
- package/package.json +5 -5
- package/src/analytics/generated/events.json +1 -1
- package/src/api/generated/schema.ts +384 -4
- package/src/api/types.ts +20 -5
- package/src/api/workspacesApi.ts +50 -0
- package/src/default/InviteAcceptPage.tsx +373 -0
- package/src/default/MembersManager.tsx +155 -145
- package/src/default/index.ts +2 -0
- package/src/flows/inviteAcceptFlow.ts +289 -0
- package/src/headless/Can.tsx +49 -0
- package/src/headless/InviteAcceptFlow.tsx +105 -0
- package/src/headless/RoleSelect.tsx +58 -0
- package/src/i18n/generated/errors.gen.ts +24 -0
- package/src/i18n/generated/errors.json +62 -0
- package/src/i18n/generated/errors.ru.gen.ts +8 -0
- package/src/i18n/keys.ts +68 -0
- package/src/i18n/ru.ts +34 -0
- package/src/index.ts +26 -0
- package/src/model/capabilities.ts +37 -0
- package/src/model/emailMask.ts +37 -0
- package/src/model/mutations.ts +56 -4
- package/src/model/queries.ts +99 -7
- package/src/model/queryKeys.ts +10 -0
package/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# @stapel/workspaces-react 0.
|
|
1
|
+
# @stapel/workspaces-react 0.7.0
|
|
2
2
|
|
|
3
|
-
Headless React flow pair for stapel-workspaces (contract >=0.
|
|
3
|
+
Headless React flow pair for stapel-workspaces (contract >=0.8 <0.9) — business + state, zero visual opinion.
|
|
4
4
|
Built on @stapel/core: typed client + StapelApiError envelope, auth token refresh,
|
|
5
5
|
verification-403 interception, i18n engine, analytics facade, TanStack Query layer.
|
|
6
6
|
|
|
@@ -16,37 +16,50 @@ verification-403 interception, i18n engine, analytics facade, TanStack Query lay
|
|
|
16
16
|
## Layers
|
|
17
17
|
api (typed client) · model (hooks, session) · flows (machines) · headless · i18n
|
|
18
18
|
|
|
19
|
+
## Machines (createFlowMachine; analytics funnel flow.<id>.<step>)
|
|
20
|
+
- createInviteAcceptFlow
|
|
21
|
+
|
|
19
22
|
## Documented flows (flows.json — canonical id, steps, endpoints)
|
|
20
23
|
|
|
21
24
|
## Operations (typed; use the named op, never a path string)
|
|
22
25
|
Request/response schema names are in manifest.json + the generated types.
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
26
|
+
Paths are relative to `/workspaces/api/v1/`.
|
|
27
|
+
- workspaces_api_v1_create: POST /
|
|
28
|
+
- workspaces_api_v1_destroy: DELETE /{workspace_id}
|
|
29
|
+
- workspaces_api_v1_internal_members_retrieve: GET /internal/{workspace_id}/members/{user_id}
|
|
30
|
+
- workspaces_api_v1_internal_users_personal_create: POST /internal/users/{user_id}/personal
|
|
31
|
+
- workspaces_api_v1_invitations_accept_create: POST /invitations/accept
|
|
32
|
+
- workspaces_api_v1_invitations_claim_create: POST /invitations/{token}/claim
|
|
33
|
+
- workspaces_api_v1_invitations_decline_create: POST /invitations/{token}/decline
|
|
34
|
+
- workspaces_api_v1_invitations_retrieve: GET /invitations/{token}
|
|
35
|
+
- workspaces_api_v1_members_destroy: DELETE /{workspace_id}/members/{user_id}
|
|
36
|
+
- workspaces_api_v1_members_invite_create: POST /{workspace_id}/members/invite
|
|
37
|
+
- workspaces_api_v1_members_list: GET /{workspace_id}/members
|
|
38
|
+
- workspaces_api_v1_members_partial_update: PATCH /{workspace_id}/members/{user_id}
|
|
39
|
+
- workspaces_api_v1_members_provision_create: POST /{workspace_id}/members/provision
|
|
40
|
+
- workspaces_api_v1_partial_update: PATCH /{workspace_id}
|
|
41
|
+
- workspaces_api_v1_retrieve: GET /
|
|
42
|
+
- workspaces_api_v1_retrieve_2: GET /{workspace_id}
|
|
43
|
+
- workspaces_api_v1_roles_retrieve: GET /roles
|
|
35
44
|
|
|
36
45
|
## Query hooks (server state; keys come only from the key factory)
|
|
37
46
|
- useAcceptInvitation (mutation) → acceptInvitation
|
|
47
|
+
- useClaimInvitation (mutation) → claimInvitation
|
|
38
48
|
- useCreateWorkspace (mutation) → createWorkspace
|
|
49
|
+
- useDeclineInvitation (mutation) → declineInvitation
|
|
39
50
|
- useDeleteWorkspace (mutation) → deleteWorkspace
|
|
51
|
+
- useInvitationPreview (query) → getInvitationPreview
|
|
40
52
|
- useInviteMembers (mutation) → inviteMembers
|
|
41
53
|
- useMembers (query) → listMembers
|
|
42
54
|
- useRemoveMember (mutation) → removeMember
|
|
55
|
+
- useRoles (query) → listRoles
|
|
43
56
|
- useUpdateMemberRole (mutation) → updateMemberRole
|
|
44
57
|
- useUpdateWorkspace (mutation) → updateWorkspace
|
|
45
58
|
- useWorkspace (query) → getWorkspace
|
|
46
59
|
- useWorkspaces (query) → listWorkspaces
|
|
47
60
|
|
|
48
61
|
## Errors (render t(code, params); UX from remediation)
|
|
49
|
-
|
|
62
|
+
60 keys (full catalog: manifest.json §errors). By remediation: fix_input 28 · retry 12 · contact_support 7 · wait_and_retry 6 · verify 5 · reauthenticate 2.
|
|
50
63
|
Param-bearing keys (interpolation slots matter):
|
|
51
64
|
- error.400.field.blank [400] → fix_input {field}
|
|
52
65
|
- error.400.field.does_not_exist [400] → fix_input {field}
|
|
@@ -59,6 +72,9 @@ Param-bearing keys (interpolation slots matter):
|
|
|
59
72
|
- error.400.field.null [400] → fix_input {field}
|
|
60
73
|
- error.400.field.required [400] → fix_input {field}
|
|
61
74
|
- error.400.field.unique [400] → fix_input {field}
|
|
75
|
+
- error.402.member_limit_reached [402] → fix_input {limit}
|
|
76
|
+
- error.403.membership_suspended [403] → fix_input {reason}
|
|
77
|
+
- error.403.missing_capability [403] → contact_support {capability}
|
|
62
78
|
- error.429.rate_limit [429] → wait_and_retry {retry_after_minutes}
|
|
63
79
|
|
|
64
80
|
## Analytics events (typed; defineEvent → events.json, drift-gated)
|
|
@@ -82,13 +98,22 @@ const { tracked } = useTracked();
|
|
|
82
98
|
|
|
83
99
|
## Demos (defineDemo → manifest.demos; compiled, linted, rendered examples)
|
|
84
100
|
- workspaces.accept → <AcceptInvitation> [default] demo/AcceptInvitation.demo.tsx
|
|
101
|
+
- workspaces.can → <Can> [default] demo/Can.demo.tsx
|
|
102
|
+
- workspaces.invite-accept → <InviteAcceptFlow> [default] demo/InviteAcceptFlow.demo.tsx
|
|
85
103
|
- workspaces.list → <WorkspaceList> [default] demo/WorkspaceList.demo.tsx
|
|
86
104
|
- workspaces.members → <Members> [default] demo/Members.demo.tsx
|
|
87
105
|
- workspaces.provider → <WorkspacesProvider> [default] demo/Workspaces.demo.tsx
|
|
106
|
+
- workspaces.role-select → <RoleSelect> [default] demo/RoleSelect.demo.tsx
|
|
88
107
|
Each source file is the canonical usage snippet (open the default variant).
|
|
89
108
|
|
|
90
109
|
## Snippets
|
|
91
110
|
```tsx
|
|
111
|
+
// A flow machine drives state; you render each step.
|
|
112
|
+
const flow = createInviteAcceptFlow({ api: useWorkspacesApi() });
|
|
113
|
+
const s = useFlow(flow.machine);
|
|
114
|
+
if (s.step.endsWith('Error')) return <p>{t(s.error.code, s.error.params)}</p>;
|
|
115
|
+
```
|
|
116
|
+
```tsx
|
|
92
117
|
// Error rendering + remediation branch (one pattern for every pair).
|
|
93
118
|
const r = explainWorkspacesError(err.code); // 'wait_and_retry' | 'verify' | ...
|
|
94
119
|
return <Alert action={r}>{t(err.code, err.params)}</Alert>;
|
package/manifest.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$generated": "by scripts/gen-manifest.mjs — do not edit; drift-gated (pnpm gen:manifest:check)",
|
|
3
3
|
"package": "@stapel/workspaces-react",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.7.0",
|
|
5
5
|
"backend": {
|
|
6
6
|
"module": "stapel-workspaces",
|
|
7
|
-
"contract": ">=0.
|
|
7
|
+
"contract": ">=0.8 <0.9"
|
|
8
8
|
},
|
|
9
9
|
"layers": [
|
|
10
10
|
"api",
|
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
"i18n"
|
|
15
15
|
],
|
|
16
16
|
"flows": {},
|
|
17
|
-
"machines": [
|
|
17
|
+
"machines": [
|
|
18
|
+
"createInviteAcceptFlow"
|
|
19
|
+
],
|
|
18
20
|
"operations": {
|
|
19
21
|
"workspaces_api_v1_create": {
|
|
20
22
|
"method": "POST",
|
|
@@ -51,6 +53,27 @@
|
|
|
51
53
|
"request": "InvitationAcceptRequest",
|
|
52
54
|
"response": "MemberResponse"
|
|
53
55
|
},
|
|
56
|
+
"workspaces_api_v1_invitations_claim_create": {
|
|
57
|
+
"method": "POST",
|
|
58
|
+
"path": "/workspaces/api/v1/invitations/{token}/claim",
|
|
59
|
+
"tag": "Members",
|
|
60
|
+
"request": null,
|
|
61
|
+
"response": "InvitationClaimResponse"
|
|
62
|
+
},
|
|
63
|
+
"workspaces_api_v1_invitations_decline_create": {
|
|
64
|
+
"method": "POST",
|
|
65
|
+
"path": "/workspaces/api/v1/invitations/{token}/decline",
|
|
66
|
+
"tag": "Members",
|
|
67
|
+
"request": null,
|
|
68
|
+
"response": null
|
|
69
|
+
},
|
|
70
|
+
"workspaces_api_v1_invitations_retrieve": {
|
|
71
|
+
"method": "GET",
|
|
72
|
+
"path": "/workspaces/api/v1/invitations/{token}",
|
|
73
|
+
"tag": "Members",
|
|
74
|
+
"request": null,
|
|
75
|
+
"response": "InvitationPreviewResponse"
|
|
76
|
+
},
|
|
54
77
|
"workspaces_api_v1_members_destroy": {
|
|
55
78
|
"method": "DELETE",
|
|
56
79
|
"path": "/workspaces/api/v1/{workspace_id}/members/{user_id}",
|
|
@@ -79,6 +102,13 @@
|
|
|
79
102
|
"request": "PatchedMemberUpdateRequest",
|
|
80
103
|
"response": "MemberResponse"
|
|
81
104
|
},
|
|
105
|
+
"workspaces_api_v1_members_provision_create": {
|
|
106
|
+
"method": "POST",
|
|
107
|
+
"path": "/workspaces/api/v1/{workspace_id}/members/provision",
|
|
108
|
+
"tag": "Members",
|
|
109
|
+
"request": "ProvisionMemberRequest",
|
|
110
|
+
"response": "ProvisionMemberResponse"
|
|
111
|
+
},
|
|
82
112
|
"workspaces_api_v1_partial_update": {
|
|
83
113
|
"method": "PATCH",
|
|
84
114
|
"path": "/workspaces/api/v1/{workspace_id}",
|
|
@@ -99,6 +129,13 @@
|
|
|
99
129
|
"tag": "Workspaces",
|
|
100
130
|
"request": null,
|
|
101
131
|
"response": "WorkspaceResponse"
|
|
132
|
+
},
|
|
133
|
+
"workspaces_api_v1_roles_retrieve": {
|
|
134
|
+
"method": "GET",
|
|
135
|
+
"path": "/workspaces/api/v1/roles",
|
|
136
|
+
"tag": "Workspaces",
|
|
137
|
+
"request": null,
|
|
138
|
+
"response": "RoleListResponse"
|
|
102
139
|
}
|
|
103
140
|
},
|
|
104
141
|
"hooks": {
|
|
@@ -106,12 +143,21 @@
|
|
|
106
143
|
"kind": "mutation",
|
|
107
144
|
"operation": "acceptInvitation",
|
|
108
145
|
"invalidates": [
|
|
146
|
+
[
|
|
147
|
+
"workspaces",
|
|
148
|
+
"invitation-preview",
|
|
149
|
+
"{token}"
|
|
150
|
+
],
|
|
109
151
|
[
|
|
110
152
|
"workspaces",
|
|
111
153
|
"list"
|
|
112
154
|
]
|
|
113
155
|
]
|
|
114
156
|
},
|
|
157
|
+
"useClaimInvitation": {
|
|
158
|
+
"kind": "mutation",
|
|
159
|
+
"operation": "claimInvitation"
|
|
160
|
+
},
|
|
115
161
|
"useCreateWorkspace": {
|
|
116
162
|
"kind": "mutation",
|
|
117
163
|
"operation": "createWorkspace",
|
|
@@ -122,6 +168,17 @@
|
|
|
122
168
|
]
|
|
123
169
|
]
|
|
124
170
|
},
|
|
171
|
+
"useDeclineInvitation": {
|
|
172
|
+
"kind": "mutation",
|
|
173
|
+
"operation": "declineInvitation",
|
|
174
|
+
"invalidates": [
|
|
175
|
+
[
|
|
176
|
+
"workspaces",
|
|
177
|
+
"invitation-preview",
|
|
178
|
+
"{token}"
|
|
179
|
+
]
|
|
180
|
+
]
|
|
181
|
+
},
|
|
125
182
|
"useDeleteWorkspace": {
|
|
126
183
|
"kind": "mutation",
|
|
127
184
|
"operation": "deleteWorkspace",
|
|
@@ -137,6 +194,15 @@
|
|
|
137
194
|
]
|
|
138
195
|
]
|
|
139
196
|
},
|
|
197
|
+
"useInvitationPreview": {
|
|
198
|
+
"kind": "query",
|
|
199
|
+
"operation": "getInvitationPreview",
|
|
200
|
+
"queryKey": [
|
|
201
|
+
"workspaces",
|
|
202
|
+
"invitation-preview",
|
|
203
|
+
"{token}"
|
|
204
|
+
]
|
|
205
|
+
},
|
|
140
206
|
"useInviteMembers": {
|
|
141
207
|
"kind": "mutation",
|
|
142
208
|
"operation": "inviteMembers",
|
|
@@ -169,6 +235,14 @@
|
|
|
169
235
|
]
|
|
170
236
|
]
|
|
171
237
|
},
|
|
238
|
+
"useRoles": {
|
|
239
|
+
"kind": "query",
|
|
240
|
+
"operation": "listRoles",
|
|
241
|
+
"queryKey": [
|
|
242
|
+
"workspaces",
|
|
243
|
+
"roles"
|
|
244
|
+
]
|
|
245
|
+
},
|
|
172
246
|
"useUpdateMemberRole": {
|
|
173
247
|
"kind": "mutation",
|
|
174
248
|
"operation": "updateMemberRole",
|
|
@@ -325,6 +399,11 @@
|
|
|
325
399
|
"params": [],
|
|
326
400
|
"remediation": "fix_input"
|
|
327
401
|
},
|
|
402
|
+
"error.400.invalid_provision_username": {
|
|
403
|
+
"status": 400,
|
|
404
|
+
"params": [],
|
|
405
|
+
"remediation": "fix_input"
|
|
406
|
+
},
|
|
328
407
|
"error.400.invalid_role": {
|
|
329
408
|
"status": 400,
|
|
330
409
|
"params": [],
|
|
@@ -335,6 +414,11 @@
|
|
|
335
414
|
"params": [],
|
|
336
415
|
"remediation": "fix_input"
|
|
337
416
|
},
|
|
417
|
+
"error.400.invitation_declined": {
|
|
418
|
+
"status": 400,
|
|
419
|
+
"params": [],
|
|
420
|
+
"remediation": "contact_support"
|
|
421
|
+
},
|
|
338
422
|
"error.400.invitation_expired": {
|
|
339
423
|
"status": 400,
|
|
340
424
|
"params": [],
|
|
@@ -370,6 +454,18 @@
|
|
|
370
454
|
"params": [],
|
|
371
455
|
"remediation": "reauthenticate"
|
|
372
456
|
},
|
|
457
|
+
"error.402.entitlement_required": {
|
|
458
|
+
"status": 402,
|
|
459
|
+
"params": [],
|
|
460
|
+
"remediation": "fix_input"
|
|
461
|
+
},
|
|
462
|
+
"error.402.member_limit_reached": {
|
|
463
|
+
"status": 402,
|
|
464
|
+
"params": [
|
|
465
|
+
"limit"
|
|
466
|
+
],
|
|
467
|
+
"remediation": "fix_input"
|
|
468
|
+
},
|
|
373
469
|
"error.402.payment_required": {
|
|
374
470
|
"status": 402,
|
|
375
471
|
"params": [],
|
|
@@ -390,6 +486,20 @@
|
|
|
390
486
|
"params": [],
|
|
391
487
|
"remediation": "fix_input"
|
|
392
488
|
},
|
|
489
|
+
"error.403.membership_suspended": {
|
|
490
|
+
"status": 403,
|
|
491
|
+
"params": [
|
|
492
|
+
"reason"
|
|
493
|
+
],
|
|
494
|
+
"remediation": "fix_input"
|
|
495
|
+
},
|
|
496
|
+
"error.403.missing_capability": {
|
|
497
|
+
"status": 403,
|
|
498
|
+
"params": [
|
|
499
|
+
"capability"
|
|
500
|
+
],
|
|
501
|
+
"remediation": "contact_support"
|
|
502
|
+
},
|
|
393
503
|
"error.403.network_blocked": {
|
|
394
504
|
"status": 403,
|
|
395
505
|
"params": [],
|
|
@@ -455,6 +565,11 @@
|
|
|
455
565
|
"params": [],
|
|
456
566
|
"remediation": "fix_input"
|
|
457
567
|
},
|
|
568
|
+
"error.409.email_already_registered": {
|
|
569
|
+
"status": 409,
|
|
570
|
+
"params": [],
|
|
571
|
+
"remediation": "reauthenticate"
|
|
572
|
+
},
|
|
458
573
|
"error.410.gone": {
|
|
459
574
|
"status": 410,
|
|
460
575
|
"params": [],
|
|
@@ -501,6 +616,11 @@
|
|
|
501
616
|
"status": 500,
|
|
502
617
|
"params": [],
|
|
503
618
|
"remediation": "contact_support"
|
|
619
|
+
},
|
|
620
|
+
"error.503.auth_unavailable": {
|
|
621
|
+
"status": 503,
|
|
622
|
+
"params": [],
|
|
623
|
+
"remediation": "wait_and_retry"
|
|
504
624
|
}
|
|
505
625
|
},
|
|
506
626
|
"events": {
|
|
@@ -522,6 +642,34 @@
|
|
|
522
642
|
],
|
|
523
643
|
"source": "demo/AcceptInvitation.demo.tsx"
|
|
524
644
|
},
|
|
645
|
+
{
|
|
646
|
+
"id": "workspaces.can",
|
|
647
|
+
"title": "Capability gate",
|
|
648
|
+
"description": "The headless Can gates UI on the caller's my_capabilities in a workspace, with the backend's wildcard matcher (* and prefix.*) ported client-side. Static children render only when allowed; the render-prop variant hands the verdict out for disabled-state UI. UI convenience only — the backend re-checks every operation.",
|
|
649
|
+
"component": "Can",
|
|
650
|
+
"tokens": [
|
|
651
|
+
"card-bg",
|
|
652
|
+
"card-border"
|
|
653
|
+
],
|
|
654
|
+
"variants": [
|
|
655
|
+
"default"
|
|
656
|
+
],
|
|
657
|
+
"source": "demo/Can.demo.tsx"
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
"id": "workspaces.invite-accept",
|
|
661
|
+
"title": "Invite accept flow",
|
|
662
|
+
"description": "The headless InviteAcceptFlow drives the /invite/{token} journey: public preview routing (accept prompt / wrong account / login / claim), the grant_token hand-off seam to auth (onLoginGrant), the basic-data slot, and accept/decline. Every screen is the host's; InviteAcceptPage is the reference skin.",
|
|
663
|
+
"component": "InviteAcceptFlow",
|
|
664
|
+
"tokens": [
|
|
665
|
+
"card-bg",
|
|
666
|
+
"button-primary-bg"
|
|
667
|
+
],
|
|
668
|
+
"variants": [
|
|
669
|
+
"default"
|
|
670
|
+
],
|
|
671
|
+
"source": "demo/InviteAcceptFlow.demo.tsx"
|
|
672
|
+
},
|
|
525
673
|
{
|
|
526
674
|
"id": "workspaces.list",
|
|
527
675
|
"title": "Workspace list",
|
|
@@ -562,6 +710,20 @@
|
|
|
562
710
|
"default"
|
|
563
711
|
],
|
|
564
712
|
"source": "demo/Workspaces.demo.tsx"
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
"id": "workspaces.role-select",
|
|
716
|
+
"title": "Role select (registry)",
|
|
717
|
+
"description": "The headless RoleSelect reads the effective role registry (builtin four + the deployment's STAPEL_WORKSPACES[\"ROLES\"] overlay) from GET /roles and resolves labels via workspaces.role.<key> with a raw-name fallback — role UI stops hardcoding the builtin four.",
|
|
718
|
+
"component": "RoleSelect",
|
|
719
|
+
"tokens": [
|
|
720
|
+
"card-bg",
|
|
721
|
+
"card-border"
|
|
722
|
+
],
|
|
723
|
+
"variants": [
|
|
724
|
+
"default"
|
|
725
|
+
],
|
|
726
|
+
"source": "demo/RoleSelect.demo.tsx"
|
|
565
727
|
}
|
|
566
728
|
],
|
|
567
729
|
"i18nKeys": [
|
|
@@ -582,8 +744,10 @@
|
|
|
582
744
|
"error.400.field.required",
|
|
583
745
|
"error.400.field.unique",
|
|
584
746
|
"error.400.invalid_ad_id",
|
|
747
|
+
"error.400.invalid_provision_username",
|
|
585
748
|
"error.400.invalid_role",
|
|
586
749
|
"error.400.invitation_already_used",
|
|
750
|
+
"error.400.invitation_declined",
|
|
587
751
|
"error.400.invitation_expired",
|
|
588
752
|
"error.400.invitation_revoked",
|
|
589
753
|
"error.400.validation_error",
|
|
@@ -591,10 +755,14 @@
|
|
|
591
755
|
"error.400.verification_invalid_factor",
|
|
592
756
|
"error.400.workspace_slug_taken",
|
|
593
757
|
"error.401.unauthorized",
|
|
758
|
+
"error.402.entitlement_required",
|
|
759
|
+
"error.402.member_limit_reached",
|
|
594
760
|
"error.402.payment_required",
|
|
595
761
|
"error.403.forbidden",
|
|
596
762
|
"error.403.forbidden_workspace",
|
|
597
763
|
"error.403.last_owner_cannot_be_removed",
|
|
764
|
+
"error.403.membership_suspended",
|
|
765
|
+
"error.403.missing_capability",
|
|
598
766
|
"error.403.network_blocked",
|
|
599
767
|
"error.403.verification_enrollment_required",
|
|
600
768
|
"error.403.verification_required",
|
|
@@ -608,6 +776,7 @@
|
|
|
608
776
|
"error.406.not_acceptable",
|
|
609
777
|
"error.408.request_timeout",
|
|
610
778
|
"error.409.conflict",
|
|
779
|
+
"error.409.email_already_registered",
|
|
611
780
|
"error.410.gone",
|
|
612
781
|
"error.413.payload_too_large",
|
|
613
782
|
"error.415.unsupported_media_type",
|
|
@@ -617,10 +786,35 @@
|
|
|
617
786
|
"error.429.rate_limit",
|
|
618
787
|
"error.429.too_many_requests",
|
|
619
788
|
"error.500.internal",
|
|
789
|
+
"error.503.auth_unavailable",
|
|
620
790
|
"workspaces.accept.accept",
|
|
621
791
|
"workspaces.accept.accepted",
|
|
622
792
|
"workspaces.accept.accepting",
|
|
623
793
|
"workspaces.error.unknown",
|
|
794
|
+
"workspaces.invite.acceptTitle",
|
|
795
|
+
"workspaces.invite.accepted",
|
|
796
|
+
"workspaces.invite.basicDataContinueCta",
|
|
797
|
+
"workspaces.invite.basicDataTitle",
|
|
798
|
+
"workspaces.invite.claiming",
|
|
799
|
+
"workspaces.invite.createAccountCta",
|
|
800
|
+
"workspaces.invite.declineCta",
|
|
801
|
+
"workspaces.invite.declined",
|
|
802
|
+
"workspaces.invite.emailLine",
|
|
803
|
+
"workspaces.invite.exchangeFailed",
|
|
804
|
+
"workspaces.invite.exchanging",
|
|
805
|
+
"workspaces.invite.joinCta",
|
|
806
|
+
"workspaces.invite.loading",
|
|
807
|
+
"workspaces.invite.loginTitle",
|
|
808
|
+
"workspaces.invite.newUserHint",
|
|
809
|
+
"workspaces.invite.retryCta",
|
|
810
|
+
"workspaces.invite.roleLine",
|
|
811
|
+
"workspaces.invite.switchAccountCta",
|
|
812
|
+
"workspaces.invite.unavailable.accepted",
|
|
813
|
+
"workspaces.invite.unavailable.declined",
|
|
814
|
+
"workspaces.invite.unavailable.expired",
|
|
815
|
+
"workspaces.invite.unavailable.revoked",
|
|
816
|
+
"workspaces.invite.wrongAccount",
|
|
817
|
+
"workspaces.invite.wrongAccountHint",
|
|
624
818
|
"workspaces.list.create",
|
|
625
819
|
"workspaces.list.creating",
|
|
626
820
|
"workspaces.list.empty",
|
|
@@ -641,6 +835,10 @@
|
|
|
641
835
|
"workspaces.members.subtitle",
|
|
642
836
|
"workspaces.members.title",
|
|
643
837
|
"workspaces.members.update_role",
|
|
838
|
+
"workspaces.role.admin",
|
|
839
|
+
"workspaces.role.member",
|
|
840
|
+
"workspaces.role.owner",
|
|
841
|
+
"workspaces.role.viewer",
|
|
644
842
|
"workspaces.settings.danger_zone.delete",
|
|
645
843
|
"workspaces.settings.danger_zone.delete_confirm",
|
|
646
844
|
"workspaces.settings.danger_zone.title",
|
|
@@ -655,7 +853,10 @@
|
|
|
655
853
|
"exports": {
|
|
656
854
|
"runtime": [
|
|
657
855
|
"AcceptInvitation",
|
|
856
|
+
"Can",
|
|
857
|
+
"InviteAcceptFlow",
|
|
658
858
|
"Members",
|
|
859
|
+
"RoleSelect",
|
|
659
860
|
"WORKSPACES_ERRORS",
|
|
660
861
|
"WORKSPACES_ERROR_CODES",
|
|
661
862
|
"WORKSPACES_FLOWS",
|
|
@@ -663,21 +864,31 @@
|
|
|
663
864
|
"WorkspaceList",
|
|
664
865
|
"WorkspacesProvider",
|
|
665
866
|
"WorkspacesRuntimeContext",
|
|
867
|
+
"capabilityMatches",
|
|
666
868
|
"createFlowMachine",
|
|
869
|
+
"createInviteAcceptFlow",
|
|
667
870
|
"createWorkspacesApi",
|
|
668
871
|
"createWorkspacesRuntime",
|
|
872
|
+
"emailMatchesMask",
|
|
669
873
|
"explainWorkspacesError",
|
|
670
874
|
"flowEndpoints",
|
|
875
|
+
"hasCapability",
|
|
671
876
|
"isErrorCode",
|
|
877
|
+
"maskEmail",
|
|
672
878
|
"registerWorkspacesI18n",
|
|
673
879
|
"toFlowError",
|
|
674
880
|
"useAcceptInvitation",
|
|
881
|
+
"useCapabilities",
|
|
882
|
+
"useClaimInvitation",
|
|
675
883
|
"useCreateWorkspace",
|
|
884
|
+
"useDeclineInvitation",
|
|
676
885
|
"useDeleteWorkspace",
|
|
677
886
|
"useFlow",
|
|
887
|
+
"useInvitationPreview",
|
|
678
888
|
"useInviteMembers",
|
|
679
889
|
"useMembers",
|
|
680
890
|
"useRemoveMember",
|
|
891
|
+
"useRoles",
|
|
681
892
|
"useUpdateMemberRole",
|
|
682
893
|
"useUpdateWorkspace",
|
|
683
894
|
"useWorkspace",
|
|
@@ -691,6 +902,8 @@
|
|
|
691
902
|
],
|
|
692
903
|
"types": [
|
|
693
904
|
"AcceptInvitationBag",
|
|
905
|
+
"CanBag",
|
|
906
|
+
"CapabilitiesResult",
|
|
694
907
|
"CreateWorkspacesRuntimeOptions",
|
|
695
908
|
"FlowEndpoint",
|
|
696
909
|
"FlowError",
|
|
@@ -699,6 +912,12 @@
|
|
|
699
912
|
"FlowStateBase",
|
|
700
913
|
"Invitation",
|
|
701
914
|
"InvitationAccept",
|
|
915
|
+
"InvitationClaim",
|
|
916
|
+
"InvitationPreview",
|
|
917
|
+
"InviteAcceptFlowBag",
|
|
918
|
+
"InviteAcceptFlowController",
|
|
919
|
+
"InviteAcceptFlowDeps",
|
|
920
|
+
"InviteAcceptState",
|
|
702
921
|
"MemberData",
|
|
703
922
|
"MemberInvite",
|
|
704
923
|
"MemberInviteResult",
|
|
@@ -708,6 +927,9 @@
|
|
|
708
927
|
"MembersBag",
|
|
709
928
|
"MembersParams",
|
|
710
929
|
"Remediation",
|
|
930
|
+
"RoleInfo",
|
|
931
|
+
"RoleList",
|
|
932
|
+
"RoleSelectBag",
|
|
711
933
|
"Schemas",
|
|
712
934
|
"WorkspaceCreate",
|
|
713
935
|
"WorkspaceData",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stapel/workspaces-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Headless React flow pair for stapel-workspaces: typed API client, TanStack Query hooks, flow machines, headless components, and i18n keys. Zero visual opinion.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
{
|
|
50
50
|
"name": "i18n/ru subpath (opt-in locale: en floor + generated ru + ru UI)",
|
|
51
51
|
"path": "dist/i18n/ru.js",
|
|
52
|
-
"limit": "
|
|
52
|
+
"limit": "5 KB"
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
"name": "default — the settings skin (antd) must stay out of the main bundle",
|
|
@@ -82,9 +82,9 @@
|
|
|
82
82
|
"size-limit": "^11.2.0",
|
|
83
83
|
"typescript": "^5.8.3",
|
|
84
84
|
"vitest": "^3.2.4",
|
|
85
|
-
"@stapel/core": "^0.
|
|
86
|
-
"@stapel/
|
|
87
|
-
"@stapel/
|
|
85
|
+
"@stapel/core": "^0.8.0",
|
|
86
|
+
"@stapel/tokens": "^0.5.0",
|
|
87
|
+
"@stapel/showcase": "^0.2.0"
|
|
88
88
|
},
|
|
89
89
|
"engines": {
|
|
90
90
|
"node": ">=22"
|