@productcraft/platform-auth 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api.md +54 -54
- package/dist/index.cjs +55 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +56 -56
- package/dist/index.d.ts +56 -56
- package/dist/index.js +55 -55
- package/dist/index.js.map +1 -1
- package/manifest.json +46 -46
- package/package.json +2 -2
package/api.md
CHANGED
|
@@ -242,7 +242,7 @@ Introspect caller's membership + effective policy + enabled services in a worksp
|
|
|
242
242
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
243
243
|
|
|
244
244
|
```ts
|
|
245
|
-
const introspectWorkspace = await platform.introspect.workspaces.retrieve("
|
|
245
|
+
const introspectWorkspace = await platform.introspect.workspaces.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
246
246
|
```
|
|
247
247
|
|
|
248
248
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#get-v1-introspect-workspaces-workspace-id)
|
|
@@ -324,7 +324,7 @@ Idempotent: hiding a guide that is already hidden returns it unchanged, with its
|
|
|
324
324
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
325
325
|
|
|
326
326
|
```ts
|
|
327
|
-
const hiddenGuide = await platform.me.hiddenGuides.hide("
|
|
327
|
+
const hiddenGuide = await platform.me.hiddenGuides.hide("dashboard");
|
|
328
328
|
```
|
|
329
329
|
|
|
330
330
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#put-v1-me-hidden-guides-key)
|
|
@@ -385,7 +385,7 @@ Idempotent: showing a guide that is not hidden is a no-op.
|
|
|
385
385
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
386
386
|
|
|
387
387
|
```ts
|
|
388
|
-
await platform.me.hiddenGuides.unhide("
|
|
388
|
+
await platform.me.hiddenGuides.unhide("dashboard");
|
|
389
389
|
```
|
|
390
390
|
|
|
391
391
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#delete-v1-me-hidden-guides-key)
|
|
@@ -430,7 +430,7 @@ Revokes the whole grant family — the grant, its authorization codes, its refre
|
|
|
430
430
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
431
431
|
|
|
432
432
|
```ts
|
|
433
|
-
await platform.oauth.connections.delete("
|
|
433
|
+
await platform.oauth.connections.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
434
434
|
```
|
|
435
435
|
|
|
436
436
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#delete-v1-oauth-connections-grant-id)
|
|
@@ -479,7 +479,7 @@ Revokes the whole grant family for a grant made by any member of this workspace
|
|
|
479
479
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
480
480
|
|
|
481
481
|
```ts
|
|
482
|
-
await platform.oauth.workspaces.connections.delete("
|
|
482
|
+
await platform.oauth.workspaces.connections.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
483
483
|
```
|
|
484
484
|
|
|
485
485
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#delete-v1-oauth-workspaces-workspace-id-connections-grant-id)
|
|
@@ -503,10 +503,10 @@ The workspace-side half of revocation, for owners and admins: every grant made a
|
|
|
503
503
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
504
504
|
|
|
505
505
|
```ts
|
|
506
|
-
for await (const connection of platform.oauth.workspaces.connections.list("
|
|
506
|
+
for await (const connection of platform.oauth.workspaces.connections.list("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f")) {
|
|
507
507
|
console.log(connection);
|
|
508
508
|
}
|
|
509
|
-
const page = await platform.oauth.workspaces.connections.list("
|
|
509
|
+
const page = await platform.oauth.workspaces.connections.list("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", {}, { timeout: 5_000 });
|
|
510
510
|
```
|
|
511
511
|
|
|
512
512
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#get-v1-oauth-workspaces-workspace-id-connections)
|
|
@@ -528,7 +528,7 @@ A workspace revocation is durable: the member re-running the connect flow does n
|
|
|
528
528
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
529
529
|
|
|
530
530
|
```ts
|
|
531
|
-
await platform.oauth.workspaces.connections.restore("
|
|
531
|
+
await platform.oauth.workspaces.connections.restore("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
532
532
|
```
|
|
533
533
|
|
|
534
534
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#post-v1-oauth-workspaces-workspace-id-connections-grant-id-restore)
|
|
@@ -549,7 +549,7 @@ Revoke one of the caller's own sessions. Takes effect immediately — the refres
|
|
|
549
549
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
550
550
|
|
|
551
551
|
```ts
|
|
552
|
-
const revokeSession = await platform.sessions.delete("
|
|
552
|
+
const revokeSession = await platform.sessions.delete("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
553
553
|
```
|
|
554
554
|
|
|
555
555
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#delete-v1-session-id)
|
|
@@ -733,7 +733,7 @@ Delete a workspace (requires workspace.delete). Cookie/JWT only — irreversible
|
|
|
733
733
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
734
734
|
|
|
735
735
|
```ts
|
|
736
|
-
await platform.workspaces.delete("
|
|
736
|
+
await platform.workspaces.delete("acme");
|
|
737
737
|
```
|
|
738
738
|
|
|
739
739
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug)
|
|
@@ -776,7 +776,7 @@ Get workspace details.
|
|
|
776
776
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
777
777
|
|
|
778
778
|
```ts
|
|
779
|
-
const workspace = await platform.workspaces.retrieve("
|
|
779
|
+
const workspace = await platform.workspaces.retrieve("acme");
|
|
780
780
|
```
|
|
781
781
|
|
|
782
782
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug)
|
|
@@ -798,7 +798,7 @@ Update workspace display name, slug, or settings. Slug renames broadcast a `work
|
|
|
798
798
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
799
799
|
|
|
800
800
|
```ts
|
|
801
|
-
const workspace = await platform.workspaces.update("
|
|
801
|
+
const workspace = await platform.workspaces.update("acme", { display_name: "string" });
|
|
802
802
|
```
|
|
803
803
|
|
|
804
804
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug)
|
|
@@ -824,7 +824,7 @@ Mint a new PAK. Choose what it can do with `preset` (a ready-made set such as `m
|
|
|
824
824
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
825
825
|
|
|
826
826
|
```ts
|
|
827
|
-
const mintPak = await platform.workspaces.apiKeys.create("
|
|
827
|
+
const mintPak = await platform.workspaces.apiKeys.create("acme", { name: "Production social client" });
|
|
828
828
|
```
|
|
829
829
|
|
|
830
830
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-api-keys)
|
|
@@ -846,7 +846,7 @@ Revoke a PAK. Default behaviour: introspect returns null on the next upstream ca
|
|
|
846
846
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
847
847
|
|
|
848
848
|
```ts
|
|
849
|
-
await platform.workspaces.apiKeys.delete("
|
|
849
|
+
await platform.workspaces.apiKeys.delete("acme", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
850
850
|
```
|
|
851
851
|
|
|
852
852
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-api-keys-id)
|
|
@@ -871,10 +871,10 @@ Newest first, as the standard cursor-paginated `{data, pagination}` envelope (20
|
|
|
871
871
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
872
872
|
|
|
873
873
|
```ts
|
|
874
|
-
for await (const apiKey of platform.workspaces.apiKeys.list("
|
|
874
|
+
for await (const apiKey of platform.workspaces.apiKeys.list("acme")) {
|
|
875
875
|
console.log(apiKey);
|
|
876
876
|
}
|
|
877
|
-
const page = await platform.workspaces.apiKeys.list("
|
|
877
|
+
const page = await platform.workspaces.apiKeys.list("acme", {}, { timeout: 5_000 });
|
|
878
878
|
```
|
|
879
879
|
|
|
880
880
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-api-keys)
|
|
@@ -896,7 +896,7 @@ Describe the key a mint with this `preset` or these `policy_ids` would create, w
|
|
|
896
896
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
897
897
|
|
|
898
898
|
```ts
|
|
899
|
-
const pakGrantPreview = await platform.workspaces.apiKeys.preview("
|
|
899
|
+
const pakGrantPreview = await platform.workspaces.apiKeys.preview("acme", { policy_ids: ["11111111-1111-1111-1111-111111111111"] });
|
|
900
900
|
```
|
|
901
901
|
|
|
902
902
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-api-keys-preview)
|
|
@@ -916,7 +916,7 @@ Get a single PAK by id.
|
|
|
916
916
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
917
917
|
|
|
918
918
|
```ts
|
|
919
|
-
const publicApiKey = await platform.workspaces.apiKeys.retrieve("
|
|
919
|
+
const publicApiKey = await platform.workspaces.apiKeys.retrieve("acme", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
920
920
|
```
|
|
921
921
|
|
|
922
922
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-api-keys-id)
|
|
@@ -938,7 +938,7 @@ Mint a replacement for an existing PAK, carrying its name, description and polic
|
|
|
938
938
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
939
939
|
|
|
940
940
|
```ts
|
|
941
|
-
const rotatePak = await platform.workspaces.apiKeys.rotate("
|
|
941
|
+
const rotatePak = await platform.workspaces.apiKeys.rotate("acme", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { grace_hours: 24 });
|
|
942
942
|
```
|
|
943
943
|
|
|
944
944
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-api-keys-id-rotate)
|
|
@@ -961,7 +961,7 @@ Update a PAK’s name or description (does not touch bindings).
|
|
|
961
961
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
962
962
|
|
|
963
963
|
```ts
|
|
964
|
-
const publicApiKey = await platform.workspaces.apiKeys.update("
|
|
964
|
+
const publicApiKey = await platform.workspaces.apiKeys.update("acme", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { description: "string" });
|
|
965
965
|
```
|
|
966
966
|
|
|
967
967
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug-api-keys-id)
|
|
@@ -984,7 +984,7 @@ Replace the managed-policy bindings on a PAK. Re-runs caller-narrowing on the me
|
|
|
984
984
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
985
985
|
|
|
986
986
|
```ts
|
|
987
|
-
const publicApiKey = await platform.workspaces.apiKeys.updateBindings("
|
|
987
|
+
const publicApiKey = await platform.workspaces.apiKeys.updateBindings("acme", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { policy_ids: ["string"] });
|
|
988
988
|
```
|
|
989
989
|
|
|
990
990
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug-api-keys-id-bindings)
|
|
@@ -1007,7 +1007,7 @@ List the ready-made permission sets a workspace key can be minted with (`preset`
|
|
|
1007
1007
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1008
1008
|
|
|
1009
1009
|
```ts
|
|
1010
|
-
for await (const preset of platform.workspaces.apiKeys.presets.list("
|
|
1010
|
+
for await (const preset of platform.workspaces.apiKeys.presets.list("acme")) {
|
|
1011
1011
|
console.log(preset);
|
|
1012
1012
|
}
|
|
1013
1013
|
```
|
|
@@ -1036,10 +1036,10 @@ Audit timeline for workspace-scoped events — workspace, member, role, invite,
|
|
|
1036
1036
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1037
1037
|
|
|
1038
1038
|
```ts
|
|
1039
|
-
for await (const auditFeed of platform.workspaces.auditFeed.list("
|
|
1039
|
+
for await (const auditFeed of platform.workspaces.auditFeed.list("acme")) {
|
|
1040
1040
|
console.log(auditFeed);
|
|
1041
1041
|
}
|
|
1042
|
-
const page = await platform.workspaces.auditFeed.list("
|
|
1042
|
+
const page = await platform.workspaces.auditFeed.list("acme", {}, { timeout: 5_000 });
|
|
1043
1043
|
```
|
|
1044
1044
|
|
|
1045
1045
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-audit-feed)
|
|
@@ -1066,7 +1066,7 @@ The response is streamed: rows are walked in keyset batches and written as they
|
|
|
1066
1066
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1067
1067
|
|
|
1068
1068
|
```ts
|
|
1069
|
-
const response = await platform.workspaces.auditLogs.export("
|
|
1069
|
+
const response = await platform.workspaces.auditLogs.export("acme");
|
|
1070
1070
|
const text = await response.text();
|
|
1071
1071
|
```
|
|
1072
1072
|
|
|
@@ -1088,10 +1088,10 @@ List workspace audit log entries, newest first. Filter by `?action=`, `?actor_id
|
|
|
1088
1088
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1089
1089
|
|
|
1090
1090
|
```ts
|
|
1091
|
-
for await (const auditLog of platform.workspaces.auditLogs.list("
|
|
1091
|
+
for await (const auditLog of platform.workspaces.auditLogs.list("acme")) {
|
|
1092
1092
|
console.log(auditLog);
|
|
1093
1093
|
}
|
|
1094
|
-
const page = await platform.workspaces.auditLogs.list("
|
|
1094
|
+
const page = await platform.workspaces.auditLogs.list("acme", {}, { timeout: 5_000 });
|
|
1095
1095
|
```
|
|
1096
1096
|
|
|
1097
1097
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-audit-logs)
|
|
@@ -1112,7 +1112,7 @@ Clear the workspace avatar and delete the stored object. Gated by `workspace.set
|
|
|
1112
1112
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1113
1113
|
|
|
1114
1114
|
```ts
|
|
1115
|
-
await platform.workspaces.avatar.clear("
|
|
1115
|
+
await platform.workspaces.avatar.clear("acme");
|
|
1116
1116
|
```
|
|
1117
1117
|
|
|
1118
1118
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-avatar)
|
|
@@ -1132,7 +1132,7 @@ Upload (or replace) the workspace identity avatar. Gated by `workspace.settings.
|
|
|
1132
1132
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1133
1133
|
|
|
1134
1134
|
```ts
|
|
1135
|
-
const workspaceAvatarUrl = await platform.workspaces.avatar.upload("
|
|
1135
|
+
const workspaceAvatarUrl = await platform.workspaces.avatar.upload("acme", { file: new File(["…"], "image.png", { type: "image/png" }) });
|
|
1136
1136
|
```
|
|
1137
1137
|
|
|
1138
1138
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-avatar)
|
|
@@ -1182,7 +1182,7 @@ Create a workspace invite link. Cookie/JWT only — invites bring new humans int
|
|
|
1182
1182
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1183
1183
|
|
|
1184
1184
|
```ts
|
|
1185
|
-
const workspaceInvite = await platform.workspaces.invites.create("
|
|
1185
|
+
const workspaceInvite = await platform.workspaces.invites.create("acme", { email: "alice@example.com" });
|
|
1186
1186
|
```
|
|
1187
1187
|
|
|
1188
1188
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-invites)
|
|
@@ -1201,7 +1201,7 @@ Revoke a workspace invite. Cookie/JWT only.
|
|
|
1201
1201
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1202
1202
|
|
|
1203
1203
|
```ts
|
|
1204
|
-
await platform.workspaces.invites.delete("
|
|
1204
|
+
await platform.workspaces.invites.delete("acme", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
1205
1205
|
```
|
|
1206
1206
|
|
|
1207
1207
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-invites-invite-id)
|
|
@@ -1224,10 +1224,10 @@ List workspace invites, newest first. Cursor-paginated.
|
|
|
1224
1224
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1225
1225
|
|
|
1226
1226
|
```ts
|
|
1227
|
-
for await (const invite of platform.workspaces.invites.list("
|
|
1227
|
+
for await (const invite of platform.workspaces.invites.list("acme")) {
|
|
1228
1228
|
console.log(invite);
|
|
1229
1229
|
}
|
|
1230
|
-
const page = await platform.workspaces.invites.list("
|
|
1230
|
+
const page = await platform.workspaces.invites.list("acme", {}, { timeout: 5_000 });
|
|
1231
1231
|
```
|
|
1232
1232
|
|
|
1233
1233
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-invites)
|
|
@@ -1249,7 +1249,7 @@ Remove a member from a workspace (or self-leave).
|
|
|
1249
1249
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1250
1250
|
|
|
1251
1251
|
```ts
|
|
1252
|
-
await platform.workspaces.members.delete("
|
|
1252
|
+
await platform.workspaces.members.delete("acme", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
1253
1253
|
```
|
|
1254
1254
|
|
|
1255
1255
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-members-account-id)
|
|
@@ -1272,10 +1272,10 @@ List workspace members, oldest join first. Narrow with `?q=` (name / username /
|
|
|
1272
1272
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1273
1273
|
|
|
1274
1274
|
```ts
|
|
1275
|
-
for await (const member of platform.workspaces.members.list("
|
|
1275
|
+
for await (const member of platform.workspaces.members.list("acme")) {
|
|
1276
1276
|
console.log(member);
|
|
1277
1277
|
}
|
|
1278
|
-
const page = await platform.workspaces.members.list("
|
|
1278
|
+
const page = await platform.workspaces.members.list("acme", {}, { timeout: 5_000 });
|
|
1279
1279
|
```
|
|
1280
1280
|
|
|
1281
1281
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-members)
|
|
@@ -1298,7 +1298,7 @@ Update a member's role. Body: { roleId } or { role: "owner"|"admin"|"member" }.
|
|
|
1298
1298
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1299
1299
|
|
|
1300
1300
|
```ts
|
|
1301
|
-
const updateMemberRole = await platform.workspaces.members.updateRole("
|
|
1301
|
+
const updateMemberRole = await platform.workspaces.members.updateRole("acme", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { role: "owner" });
|
|
1302
1302
|
```
|
|
1303
1303
|
|
|
1304
1304
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug-members-account-id-role)
|
|
@@ -1323,7 +1323,7 @@ Create a managed policy. Cookie/JWT only — policy authoring is a human-admin s
|
|
|
1323
1323
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1324
1324
|
|
|
1325
1325
|
```ts
|
|
1326
|
-
const managedPolicy = await platform.workspaces.policies.create("
|
|
1326
|
+
const managedPolicy = await platform.workspaces.policies.create("acme", {
|
|
1327
1327
|
name: "mail-readonly",
|
|
1328
1328
|
policy: [{ actions: ["mail.read", "mail.list"], effect: "allow", resources: ["*"] }],
|
|
1329
1329
|
});
|
|
@@ -1345,7 +1345,7 @@ Delete a managed policy. Cascades: API keys lose the binding (deny-all if no oth
|
|
|
1345
1345
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1346
1346
|
|
|
1347
1347
|
```ts
|
|
1348
|
-
const managedPolicyDeleted = await platform.workspaces.policies.delete("
|
|
1348
|
+
const managedPolicyDeleted = await platform.workspaces.policies.delete("acme", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
1349
1349
|
```
|
|
1350
1350
|
|
|
1351
1351
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-policies-policy-id)
|
|
@@ -1366,10 +1366,10 @@ List managed policies in a workspace, alphabetically. 20/page (max 100), cursor-
|
|
|
1366
1366
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1367
1367
|
|
|
1368
1368
|
```ts
|
|
1369
|
-
for await (const policy of platform.workspaces.policies.list("
|
|
1369
|
+
for await (const policy of platform.workspaces.policies.list("acme")) {
|
|
1370
1370
|
console.log(policy);
|
|
1371
1371
|
}
|
|
1372
|
-
const page = await platform.workspaces.policies.list("
|
|
1372
|
+
const page = await platform.workspaces.policies.list("acme", {}, { timeout: 5_000 });
|
|
1373
1373
|
```
|
|
1374
1374
|
|
|
1375
1375
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-policies)
|
|
@@ -1387,7 +1387,7 @@ Get a managed policy by id.
|
|
|
1387
1387
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1388
1388
|
|
|
1389
1389
|
```ts
|
|
1390
|
-
const managedPolicyDetail = await platform.workspaces.policies.retrieve("
|
|
1390
|
+
const managedPolicyDetail = await platform.workspaces.policies.retrieve("acme", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
1391
1391
|
```
|
|
1392
1392
|
|
|
1393
1393
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-policies-policy-id)
|
|
@@ -1410,7 +1410,7 @@ Update a managed policy. Owners and admins; a policy bound to a role, or a prese
|
|
|
1410
1410
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1411
1411
|
|
|
1412
1412
|
```ts
|
|
1413
|
-
const managedPolicyDetail = await platform.workspaces.policies.update("
|
|
1413
|
+
const managedPolicyDetail = await platform.workspaces.policies.update("acme", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { description: "Read-only access to all Mail resources" });
|
|
1414
1414
|
```
|
|
1415
1415
|
|
|
1416
1416
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug-policies-policy-id)
|
|
@@ -1431,7 +1431,7 @@ List every known workspace action (catalog of statement actions).
|
|
|
1431
1431
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1432
1432
|
|
|
1433
1433
|
```ts
|
|
1434
|
-
const workspaceActionCatalog = await platform.workspaces.policies.actions.catalog("
|
|
1434
|
+
const workspaceActionCatalog = await platform.workspaces.policies.actions.catalog("acme");
|
|
1435
1435
|
```
|
|
1436
1436
|
|
|
1437
1437
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-policies-actions-catalog)
|
|
@@ -1457,7 +1457,7 @@ Create a new custom role. Cookie/JWT only — role authoring is a human-admin su
|
|
|
1457
1457
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1458
1458
|
|
|
1459
1459
|
```ts
|
|
1460
|
-
const workspaceRole = await platform.workspaces.roles.create("
|
|
1460
|
+
const workspaceRole = await platform.workspaces.roles.create("acme", { name: "BillingAdmin" });
|
|
1461
1461
|
```
|
|
1462
1462
|
|
|
1463
1463
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-roles)
|
|
@@ -1478,7 +1478,7 @@ Delete a custom role (fails if it has members). Cookie/JWT only — role authori
|
|
|
1478
1478
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1479
1479
|
|
|
1480
1480
|
```ts
|
|
1481
|
-
await platform.workspaces.roles.delete("
|
|
1481
|
+
await platform.workspaces.roles.delete("acme", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
1482
1482
|
```
|
|
1483
1483
|
|
|
1484
1484
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-roles-role-id)
|
|
@@ -1499,10 +1499,10 @@ List roles in a workspace. System roles first, then alphabetical. 20/page (max 1
|
|
|
1499
1499
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1500
1500
|
|
|
1501
1501
|
```ts
|
|
1502
|
-
for await (const role of platform.workspaces.roles.list("
|
|
1502
|
+
for await (const role of platform.workspaces.roles.list("acme")) {
|
|
1503
1503
|
console.log(role);
|
|
1504
1504
|
}
|
|
1505
|
-
const page = await platform.workspaces.roles.list("
|
|
1505
|
+
const page = await platform.workspaces.roles.list("acme", {}, { timeout: 5_000 });
|
|
1506
1506
|
```
|
|
1507
1507
|
|
|
1508
1508
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-roles)
|
|
@@ -1522,7 +1522,7 @@ Get a role + its permissions.
|
|
|
1522
1522
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1523
1523
|
|
|
1524
1524
|
```ts
|
|
1525
|
-
const workspaceRole = await platform.workspaces.roles.retrieve("
|
|
1525
|
+
const workspaceRole = await platform.workspaces.roles.retrieve("acme", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
1526
1526
|
```
|
|
1527
1527
|
|
|
1528
1528
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-roles-role-id)
|
|
@@ -1545,7 +1545,7 @@ Update a role or replace its permission set. Cookie/JWT only — role authoring
|
|
|
1545
1545
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1546
1546
|
|
|
1547
1547
|
```ts
|
|
1548
|
-
const workspaceRole = await platform.workspaces.roles.update("
|
|
1548
|
+
const workspaceRole = await platform.workspaces.roles.update("acme", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { description: "string" });
|
|
1549
1549
|
```
|
|
1550
1550
|
|
|
1551
1551
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug-roles-role-id)
|
|
@@ -1568,7 +1568,7 @@ Disable a service (settings are retained).
|
|
|
1568
1568
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1569
1569
|
|
|
1570
1570
|
```ts
|
|
1571
|
-
await platform.workspaces.services.disable("
|
|
1571
|
+
await platform.workspaces.services.disable("acme", "mail");
|
|
1572
1572
|
```
|
|
1573
1573
|
|
|
1574
1574
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#delete-v1-workspaces-workspace-slug-services-service)
|
|
@@ -1590,7 +1590,7 @@ Enable (or re-enable) a service for this workspace.
|
|
|
1590
1590
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1591
1591
|
|
|
1592
1592
|
```ts
|
|
1593
|
-
const workspaceServiceState = await platform.workspaces.services.enable("
|
|
1593
|
+
const workspaceServiceState = await platform.workspaces.services.enable("acme", "mail", { settings: {} });
|
|
1594
1594
|
```
|
|
1595
1595
|
|
|
1596
1596
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#post-v1-workspaces-workspace-slug-services-service)
|
|
@@ -1609,7 +1609,7 @@ List services activated on this workspace. Complete — one row per product, not
|
|
|
1609
1609
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1610
1610
|
|
|
1611
1611
|
```ts
|
|
1612
|
-
const listWorkspaceServices = await platform.workspaces.services.list("
|
|
1612
|
+
const listWorkspaceServices = await platform.workspaces.services.list("acme");
|
|
1613
1613
|
```
|
|
1614
1614
|
|
|
1615
1615
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#get-v1-workspaces-workspace-slug-services)
|
|
@@ -1631,7 +1631,7 @@ Replace the settings jsonb for an active service.
|
|
|
1631
1631
|
| 429 | `RateLimitError` | `RATE_LIMITED` | Rate limited: too many requests from this client IP in the last 60 seconds (`RATE_LIMITED`); wait `Retry-After` seconds. |
|
|
1632
1632
|
|
|
1633
1633
|
```ts
|
|
1634
|
-
const workspaceServiceState = await platform.workspaces.services.updateSettings("
|
|
1634
|
+
const workspaceServiceState = await platform.workspaces.services.updateSettings("acme", "mail", { default_sender: "noreply@acme.com" });
|
|
1635
1635
|
```
|
|
1636
1636
|
|
|
1637
1637
|
[HTTP reference](https://productcraft.co/docs/platform/api-reference#patch-v1-workspaces-workspace-slug-services-service-settings)
|