@stapel/workspaces-react 0.1.0 → 0.4.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.
Files changed (65) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/README.md +45 -3
  3. package/dist/api/generated/schema.d.ts +759 -0
  4. package/dist/api/generated/schema.d.ts.map +1 -0
  5. package/dist/api/generated/schema.js +2 -0
  6. package/dist/api/generated/schema.js.map +1 -0
  7. package/dist/api/types.d.ts +22 -6
  8. package/dist/api/types.d.ts.map +1 -1
  9. package/dist/api/workspacesApi.d.ts +3 -3
  10. package/dist/api/workspacesApi.d.ts.map +1 -1
  11. package/dist/api/workspacesApi.js +14 -1
  12. package/dist/api/workspacesApi.js.map +1 -1
  13. package/dist/flows/registry.d.ts +22 -0
  14. package/dist/flows/registry.d.ts.map +1 -0
  15. package/dist/flows/registry.js +20 -0
  16. package/dist/flows/registry.js.map +1 -0
  17. package/dist/headless/Members.d.ts +6 -1
  18. package/dist/headless/Members.d.ts.map +1 -1
  19. package/dist/headless/Members.js +1 -1
  20. package/dist/headless/Members.js.map +1 -1
  21. package/dist/headless/WorkspacesProvider.d.ts +5 -4
  22. package/dist/headless/WorkspacesProvider.d.ts.map +1 -1
  23. package/dist/headless/WorkspacesProvider.js +5 -7
  24. package/dist/headless/WorkspacesProvider.js.map +1 -1
  25. package/dist/index.d.ts +3 -3
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +1 -1
  28. package/dist/index.js.map +1 -1
  29. package/dist/model/context.d.ts +6 -9
  30. package/dist/model/context.d.ts.map +1 -1
  31. package/dist/model/context.js +11 -16
  32. package/dist/model/context.js.map +1 -1
  33. package/dist/model/queries.d.ts +6 -4
  34. package/dist/model/queries.d.ts.map +1 -1
  35. package/dist/model/queries.js +8 -5
  36. package/dist/model/queries.js.map +1 -1
  37. package/dist/model/queryKeys.d.ts +2 -0
  38. package/dist/model/queryKeys.d.ts.map +1 -1
  39. package/dist/model/queryKeys.js +3 -0
  40. package/dist/model/queryKeys.js.map +1 -1
  41. package/dist/model/runtime.d.ts +12 -21
  42. package/dist/model/runtime.d.ts.map +1 -1
  43. package/dist/model/runtime.js +2 -14
  44. package/dist/model/runtime.js.map +1 -1
  45. package/llms.txt +14 -14
  46. package/manifest.json +34 -32
  47. package/package.json +5 -4
  48. package/src/analytics/generated/events.json +1 -1
  49. package/src/api/generated/schema.ts +761 -0
  50. package/src/api/types.ts +23 -6
  51. package/src/api/workspacesApi.ts +17 -5
  52. package/src/flows/registry.ts +32 -0
  53. package/src/headless/Members.tsx +7 -2
  54. package/src/headless/WorkspacesProvider.tsx +6 -11
  55. package/src/index.ts +4 -3
  56. package/src/model/context.tsx +16 -17
  57. package/src/model/queries.ts +16 -7
  58. package/src/model/queryKeys.ts +9 -0
  59. package/src/model/runtime.ts +14 -35
  60. package/dist/flows/generated/flows.gen.d.ts +0 -19
  61. package/dist/flows/generated/flows.gen.d.ts.map +0 -1
  62. package/dist/flows/generated/flows.gen.js +0 -23
  63. package/dist/flows/generated/flows.gen.js.map +0 -1
  64. package/src/flows/generated/flows.gen.ts +0 -38
  65. package/src/flows/generated/flows.json +0 -1
@@ -1,18 +1,6 @@
1
- import { createStapelClient } from "@stapel/core";
1
+ import { createModuleRuntime } from "@stapel/core";
2
2
  import { createWorkspacesApi } from "../api/workspacesApi.js";
3
3
  export function createWorkspacesRuntime(options) {
4
- const analytics = options.analytics ?? null;
5
- const client = createStapelClient({
6
- baseUrl: options.baseUrl,
7
- ...(options.fetch !== undefined ? { fetch: options.fetch } : {}),
8
- ...(options.credentials !== undefined
9
- ? { credentials: options.credentials }
10
- : {}),
11
- ...(options.defaultHeaders !== undefined
12
- ? { defaultHeaders: options.defaultHeaders }
13
- : {}),
14
- });
15
- const api = createWorkspacesApi(client);
16
- return { client, api, analytics };
4
+ return createModuleRuntime(createWorkspacesApi, options);
17
5
  }
18
6
  //# sourceMappingURL=runtime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/model/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AA2B9D,MAAM,UAAU,uBAAuB,CACrC,OAAuC;IAEvC,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC;IAC5C,MAAM,MAAM,GAAG,kBAAkB,CAAC;QAChC,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,GAAG,CAAC,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAChE,GAAG,CAAC,OAAO,CAAC,WAAW,KAAK,SAAS;YACnC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE;YACtC,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,OAAO,CAAC,cAAc,KAAK,SAAS;YACtC,CAAC,CAAC,EAAE,cAAc,EAAE,OAAO,CAAC,cAAc,EAAE;YAC5C,CAAC,CAAC,EAAE,CAAC;KACR,CAAC,CAAC;IACH,MAAM,GAAG,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACxC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC;AACpC,CAAC"}
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/model/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAkB9D,MAAM,UAAU,uBAAuB,CACrC,OAAuC;IAEvC,OAAO,mBAAmB,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;AAC3D,CAAC"}
package/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
- # @stapel/workspaces-react 0.1.0
1
+ # @stapel/workspaces-react 0.4.1
2
2
 
3
- Headless React flow pair for stapel-workspaces (contract >=0.3 <0.4) — business + state, zero visual opinion.
3
+ Headless React flow pair for stapel-workspaces (contract >=0.4 <0.5) — 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
 
@@ -20,18 +20,18 @@ api (typed client) · model (hooks, session) · flows (machines) · headless ·
20
20
 
21
21
  ## Operations (typed; use the named op, never a path string)
22
22
  Request/response schema names are in manifest.json + the generated types.
23
- - workspaces_api_create: POST /workspaces/api/
24
- - workspaces_api_destroy: DELETE /workspaces/api/{workspace_id}
25
- - workspaces_api_internal_members_retrieve: GET /workspaces/api/internal/{workspace_id}/members/{user_id}
26
- - workspaces_api_internal_users_personal_create: POST /workspaces/api/internal/users/{user_id}/personal
27
- - workspaces_api_invitations_accept_create: POST /workspaces/api/invitations/accept
28
- - workspaces_api_members_destroy: DELETE /workspaces/api/{workspace_id}/members/{user_id}
29
- - workspaces_api_members_invite_create: POST /workspaces/api/{workspace_id}/members/invite
30
- - workspaces_api_members_partial_update: PATCH /workspaces/api/{workspace_id}/members/{user_id}
31
- - workspaces_api_members_retrieve: GET /workspaces/api/{workspace_id}/members
32
- - workspaces_api_partial_update: PATCH /workspaces/api/{workspace_id}
33
- - workspaces_api_retrieve: GET /workspaces/api/
34
- - workspaces_api_retrieve_2: GET /workspaces/api/{workspace_id}
23
+ - workspaces_api_v1_create: POST /workspaces/api/v1/
24
+ - workspaces_api_v1_destroy: DELETE /workspaces/api/v1/{workspace_id}
25
+ - workspaces_api_v1_internal_members_retrieve: GET /workspaces/api/v1/internal/{workspace_id}/members/{user_id}
26
+ - workspaces_api_v1_internal_users_personal_create: POST /workspaces/api/v1/internal/users/{user_id}/personal
27
+ - workspaces_api_v1_invitations_accept_create: POST /workspaces/api/v1/invitations/accept
28
+ - workspaces_api_v1_members_destroy: DELETE /workspaces/api/v1/{workspace_id}/members/{user_id}
29
+ - workspaces_api_v1_members_invite_create: POST /workspaces/api/v1/{workspace_id}/members/invite
30
+ - workspaces_api_v1_members_list: GET /workspaces/api/v1/{workspace_id}/members
31
+ - workspaces_api_v1_members_partial_update: PATCH /workspaces/api/v1/{workspace_id}/members/{user_id}
32
+ - workspaces_api_v1_partial_update: PATCH /workspaces/api/v1/{workspace_id}
33
+ - workspaces_api_v1_retrieve: GET /workspaces/api/v1/
34
+ - workspaces_api_v1_retrieve_2: GET /workspaces/api/v1/{workspace_id}
35
35
 
36
36
  ## Query hooks (server state; keys come only from the key factory)
37
37
  - useAcceptInvitation (mutation) → acceptInvitation
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.1.0",
4
+ "version": "0.4.1",
5
5
  "backend": {
6
6
  "module": "stapel-workspaces",
7
- "contract": ">=0.3 <0.4"
7
+ "contract": ">=0.4 <0.5"
8
8
  },
9
9
  "layers": [
10
10
  "api",
@@ -16,86 +16,86 @@
16
16
  "flows": {},
17
17
  "machines": [],
18
18
  "operations": {
19
- "workspaces_api_create": {
19
+ "workspaces_api_v1_create": {
20
20
  "method": "POST",
21
- "path": "/workspaces/api/",
21
+ "path": "/workspaces/api/v1/",
22
22
  "tag": "Workspaces",
23
23
  "request": "WorkspaceCreateRequest",
24
24
  "response": "WorkspaceResponse"
25
25
  },
26
- "workspaces_api_destroy": {
26
+ "workspaces_api_v1_destroy": {
27
27
  "method": "DELETE",
28
- "path": "/workspaces/api/{workspace_id}",
28
+ "path": "/workspaces/api/v1/{workspace_id}",
29
29
  "tag": "Workspaces",
30
30
  "request": null,
31
31
  "response": null
32
32
  },
33
- "workspaces_api_internal_members_retrieve": {
33
+ "workspaces_api_v1_internal_members_retrieve": {
34
34
  "method": "GET",
35
- "path": "/workspaces/api/internal/{workspace_id}/members/{user_id}",
35
+ "path": "/workspaces/api/v1/internal/{workspace_id}/members/{user_id}",
36
36
  "tag": "Internal",
37
37
  "request": null,
38
38
  "response": "MemberResponse"
39
39
  },
40
- "workspaces_api_internal_users_personal_create": {
40
+ "workspaces_api_v1_internal_users_personal_create": {
41
41
  "method": "POST",
42
- "path": "/workspaces/api/internal/users/{user_id}/personal",
42
+ "path": "/workspaces/api/v1/internal/users/{user_id}/personal",
43
43
  "tag": "Internal",
44
44
  "request": null,
45
45
  "response": "InternalPersonalWorkspaceResponse"
46
46
  },
47
- "workspaces_api_invitations_accept_create": {
47
+ "workspaces_api_v1_invitations_accept_create": {
48
48
  "method": "POST",
49
- "path": "/workspaces/api/invitations/accept",
49
+ "path": "/workspaces/api/v1/invitations/accept",
50
50
  "tag": "Members",
51
51
  "request": "InvitationAcceptRequest",
52
52
  "response": "MemberResponse"
53
53
  },
54
- "workspaces_api_members_destroy": {
54
+ "workspaces_api_v1_members_destroy": {
55
55
  "method": "DELETE",
56
- "path": "/workspaces/api/{workspace_id}/members/{user_id}",
56
+ "path": "/workspaces/api/v1/{workspace_id}/members/{user_id}",
57
57
  "tag": "Members",
58
58
  "request": null,
59
59
  "response": null
60
60
  },
61
- "workspaces_api_members_invite_create": {
61
+ "workspaces_api_v1_members_invite_create": {
62
62
  "method": "POST",
63
- "path": "/workspaces/api/{workspace_id}/members/invite",
63
+ "path": "/workspaces/api/v1/{workspace_id}/members/invite",
64
64
  "tag": "Members",
65
65
  "request": "MemberInviteRequest",
66
66
  "response": "MemberInviteResponse"
67
67
  },
68
- "workspaces_api_members_partial_update": {
68
+ "workspaces_api_v1_members_list": {
69
+ "method": "GET",
70
+ "path": "/workspaces/api/v1/{workspace_id}/members",
71
+ "tag": "Members",
72
+ "request": null,
73
+ "response": "PaginatedMemberResponseList"
74
+ },
75
+ "workspaces_api_v1_members_partial_update": {
69
76
  "method": "PATCH",
70
- "path": "/workspaces/api/{workspace_id}/members/{user_id}",
77
+ "path": "/workspaces/api/v1/{workspace_id}/members/{user_id}",
71
78
  "tag": "Members",
72
79
  "request": "PatchedMemberUpdateRequest",
73
80
  "response": "MemberResponse"
74
81
  },
75
- "workspaces_api_members_retrieve": {
76
- "method": "GET",
77
- "path": "/workspaces/api/{workspace_id}/members",
78
- "tag": "Members",
79
- "request": null,
80
- "response": "MemberListResponse"
81
- },
82
- "workspaces_api_partial_update": {
82
+ "workspaces_api_v1_partial_update": {
83
83
  "method": "PATCH",
84
- "path": "/workspaces/api/{workspace_id}",
84
+ "path": "/workspaces/api/v1/{workspace_id}",
85
85
  "tag": "Workspaces",
86
86
  "request": "PatchedWorkspaceUpdateRequest",
87
87
  "response": "WorkspaceResponse"
88
88
  },
89
- "workspaces_api_retrieve": {
89
+ "workspaces_api_v1_retrieve": {
90
90
  "method": "GET",
91
- "path": "/workspaces/api/",
91
+ "path": "/workspaces/api/v1/",
92
92
  "tag": "Workspaces",
93
93
  "request": null,
94
94
  "response": "WorkspaceListResponse"
95
95
  },
96
- "workspaces_api_retrieve_2": {
96
+ "workspaces_api_v1_retrieve_2": {
97
97
  "method": "GET",
98
- "path": "/workspaces/api/{workspace_id}",
98
+ "path": "/workspaces/api/v1/{workspace_id}",
99
99
  "tag": "Workspaces",
100
100
  "request": null,
101
101
  "response": "WorkspaceResponse"
@@ -154,7 +154,8 @@
154
154
  "queryKey": [
155
155
  "workspaces",
156
156
  "members",
157
- "{workspaceId}"
157
+ "{workspaceId}",
158
+ "{params}"
158
159
  ]
159
160
  },
160
161
  "useRemoveMember": {
@@ -684,6 +685,7 @@
684
685
  "MemberRoleChange",
685
686
  "MemberRoleUpdate",
686
687
  "MembersBag",
688
+ "MembersParams",
687
689
  "Remediation",
688
690
  "Schemas",
689
691
  "WorkspaceCreate",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stapel/workspaces-react",
3
- "version": "0.1.0",
3
+ "version": "0.4.1",
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": {
@@ -66,9 +66,9 @@
66
66
  "size-limit": "^11.2.0",
67
67
  "typescript": "^5.8.3",
68
68
  "vitest": "^3.2.4",
69
+ "@stapel/core": "^0.4.0",
69
70
  "@stapel/showcase": "^0.2.0",
70
- "@stapel/tokens": "^0.2.0",
71
- "@stapel/core": "^0.3.0"
71
+ "@stapel/tokens": "^0.4.0"
72
72
  },
73
73
  "engines": {
74
74
  "node": ">=22"
@@ -78,7 +78,8 @@
78
78
  },
79
79
  "scripts": {
80
80
  "build": "tsc -p tsconfig.json",
81
- "test": "tsc -p tsconfig.demo.json && vitest run",
81
+ "test": "tsc -p tsconfig.demo.json && vitest run --exclude test/prodBundlePurity.test.ts",
82
+ "test:pack": "vitest run test/prodBundlePurity.test.ts",
82
83
  "lint": "eslint .",
83
84
  "size": "size-limit"
84
85
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$generated": "by scripts/gen-events.mjs — do not edit; drift-gated (pnpm gen:events:check)",
3
3
  "package": "@stapel/workspaces-react",
4
- "version": "0.1.0",
4
+ "version": "0.4.1",
5
5
  "defined": [],
6
6
  "flows": []
7
7
  }