@usestatemachines/sdk 0.1.1 → 0.3.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.
Files changed (76) hide show
  1. package/README.md +265 -75
  2. package/agents/SKILL.md +33 -46
  3. package/agents/index.js +7 -7
  4. package/agents/llms.txt +25 -40
  5. package/agents/prompt.md +11 -34
  6. package/esm/extensions/apps.d.ts +18 -0
  7. package/esm/extensions/apps.js +39 -0
  8. package/esm/extensions/client.d.ts +66 -3
  9. package/esm/extensions/client.js +236 -35
  10. package/esm/extensions/errors.d.ts +50 -6
  11. package/esm/extensions/errors.js +37 -3
  12. package/esm/extensions/index.d.ts +5 -3
  13. package/esm/extensions/index.js +2 -1
  14. package/esm/extensions/running-environment.d.ts +32 -0
  15. package/esm/extensions/running-environment.js +44 -0
  16. package/esm/extensions/signal.d.ts +1 -2
  17. package/esm/extensions/signal.js +9 -4
  18. package/esm/extensions/wait.d.ts +11 -3
  19. package/esm/extensions/wait.js +23 -13
  20. package/esm/funcs/create-environment-definition.d.ts +11 -0
  21. package/esm/funcs/create-environment-definition.js +94 -0
  22. package/esm/funcs/environments-list.js +1 -0
  23. package/esm/funcs/snapshots-capture.d.ts +11 -0
  24. package/esm/funcs/snapshots-capture.js +94 -0
  25. package/esm/funcs/snapshots-delete.d.ts +11 -0
  26. package/esm/funcs/snapshots-delete.js +92 -0
  27. package/esm/funcs/snapshots-get.d.ts +11 -0
  28. package/esm/funcs/snapshots-get.js +92 -0
  29. package/esm/funcs/snapshots-list.d.ts +11 -0
  30. package/esm/funcs/snapshots-list.js +98 -0
  31. package/esm/funcs/snapshots-update.d.ts +11 -0
  32. package/esm/funcs/snapshots-update.js +93 -0
  33. package/esm/lib/config.d.ts +2 -2
  34. package/esm/lib/config.js +2 -2
  35. package/esm/models/app-instance-snapshot.d.ts +15 -0
  36. package/esm/models/app-instance-snapshot.js +19 -0
  37. package/esm/models/connection-secret.d.ts +16 -0
  38. package/esm/models/connection-secret.js +13 -0
  39. package/esm/models/connection.d.ts +14 -0
  40. package/esm/models/connection.js +14 -0
  41. package/esm/models/create-environment-input.d.ts +6 -2
  42. package/esm/models/create-environment-input.js +3 -1
  43. package/esm/models/environment-app.d.ts +1 -0
  44. package/esm/models/environment-app.js +1 -0
  45. package/esm/models/environment-snapshot.d.ts +39 -0
  46. package/esm/models/environment-snapshot.js +41 -0
  47. package/esm/models/environment.d.ts +1 -0
  48. package/esm/models/environment.js +1 -0
  49. package/esm/models/error-response.d.ts +5 -0
  50. package/esm/models/error-response.js +5 -0
  51. package/esm/models/index.d.ts +2 -0
  52. package/esm/models/index.js +2 -0
  53. package/esm/models/operations/capture-snapshot.d.ts +41 -0
  54. package/esm/models/operations/capture-snapshot.js +36 -0
  55. package/esm/models/operations/create-environment-definition.d.ts +143 -0
  56. package/esm/models/operations/create-environment-definition.js +90 -0
  57. package/esm/models/operations/delete-snapshot.d.ts +23 -0
  58. package/esm/models/operations/delete-snapshot.js +20 -0
  59. package/esm/models/operations/get-snapshot.d.ts +23 -0
  60. package/esm/models/operations/get-snapshot.js +20 -0
  61. package/esm/models/operations/index.d.ts +6 -0
  62. package/esm/models/operations/index.js +6 -0
  63. package/esm/models/operations/list-environments.d.ts +2 -0
  64. package/esm/models/operations/list-environments.js +1 -0
  65. package/esm/models/operations/list-snapshots.d.ts +30 -0
  66. package/esm/models/operations/list-snapshots.js +25 -0
  67. package/esm/models/operations/reveal-connection.d.ts +26 -4
  68. package/esm/models/operations/reveal-connection.js +28 -2
  69. package/esm/models/operations/update-snapshot.d.ts +37 -0
  70. package/esm/models/operations/update-snapshot.js +29 -0
  71. package/esm/sdk/sdk.d.ts +6 -1
  72. package/esm/sdk/sdk.js +10 -0
  73. package/esm/sdk/snapshots.d.ts +9 -0
  74. package/esm/sdk/snapshots.js +27 -0
  75. package/openapi.json +1471 -144
  76. package/package.json +10 -11
package/openapi.json CHANGED
@@ -100,6 +100,47 @@
100
100
  ],
101
101
  "type": "object"
102
102
  },
103
+ "AppInstanceSnapshot": {
104
+ "properties": {
105
+ "appId": {
106
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
107
+ "type": "string"
108
+ },
109
+ "appInstanceKey": {
110
+ "pattern": "^[a-z][a-z0-9-]{0,39}$",
111
+ "type": "string"
112
+ },
113
+ "appReleaseId": {
114
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
115
+ "type": "string"
116
+ },
117
+ "capturedAt": {
118
+ "format": "date-time",
119
+ "type": ["string", "null"]
120
+ },
121
+ "id": {
122
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
123
+ "type": "string"
124
+ },
125
+ "sizeBytes": {
126
+ "type": ["number", "null"]
127
+ },
128
+ "sourceAppInstanceId": {
129
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
130
+ "type": "string"
131
+ }
132
+ },
133
+ "required": [
134
+ "id",
135
+ "sourceAppInstanceId",
136
+ "appInstanceKey",
137
+ "appId",
138
+ "appReleaseId",
139
+ "capturedAt",
140
+ "sizeBytes"
141
+ ],
142
+ "type": "object"
143
+ },
103
144
  "Catalog": {
104
145
  "properties": {
105
146
  "apps": {
@@ -139,6 +180,49 @@
139
180
  "baseUrl": {
140
181
  "type": ["string", "null"]
141
182
  },
183
+ "connections": {
184
+ "items": {
185
+ "additionalProperties": false,
186
+ "properties": {
187
+ "actorId": {
188
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
189
+ "type": "string"
190
+ },
191
+ "authentication": {
192
+ "type": "string"
193
+ },
194
+ "key": {
195
+ "pattern": "^[a-z][a-z0-9-]{0,39}$",
196
+ "type": "string"
197
+ },
198
+ "parameters": {
199
+ "additionalProperties": {
200
+ "type": "string"
201
+ },
202
+ "type": "object"
203
+ },
204
+ "secrets": {
205
+ "items": {
206
+ "type": "string"
207
+ },
208
+ "type": "array"
209
+ }
210
+ },
211
+ "required": [
212
+ "key",
213
+ "actorId",
214
+ "authentication",
215
+ "parameters",
216
+ "secrets"
217
+ ],
218
+ "type": "object"
219
+ },
220
+ "type": "array"
221
+ },
222
+ "defaultConnection": {
223
+ "pattern": "^[a-z][a-z0-9-]{0,39}$",
224
+ "type": ["string", "null"]
225
+ },
142
226
  "environmentId": {
143
227
  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
144
228
  "type": "string"
@@ -159,6 +243,8 @@
159
243
  "baseUrl",
160
244
  "expiresAt",
161
245
  "actors",
246
+ "connections",
247
+ "defaultConnection",
162
248
  "apis"
163
249
  ],
164
250
  "type": "object"
@@ -176,6 +262,10 @@
176
262
  "pattern": "^[a-z][a-z0-9-]{0,39}$",
177
263
  "type": "string"
178
264
  },
265
+ "connectionKey": {
266
+ "pattern": "^[a-z][a-z0-9-]{0,39}$",
267
+ "type": ["string", "null"]
268
+ },
179
269
  "environmentId": {
180
270
  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
181
271
  "type": "string"
@@ -186,9 +276,44 @@
186
276
  "expiresAt": {
187
277
  "format": "date-time",
188
278
  "type": "string"
279
+ },
280
+ "native": {
281
+ "properties": {
282
+ "authentication": {
283
+ "type": "string"
284
+ },
285
+ "baseUrl": {
286
+ "type": "string"
287
+ },
288
+ "credentials": {
289
+ "additionalProperties": {
290
+ "type": "string"
291
+ },
292
+ "type": "object"
293
+ },
294
+ "key": {
295
+ "pattern": "^[a-z][a-z0-9-]{0,39}$",
296
+ "type": "string"
297
+ },
298
+ "parameters": {
299
+ "additionalProperties": {
300
+ "type": "string"
301
+ },
302
+ "type": "object"
303
+ }
304
+ },
305
+ "required": [
306
+ "key",
307
+ "authentication",
308
+ "baseUrl",
309
+ "parameters",
310
+ "credentials"
311
+ ],
312
+ "type": "object"
189
313
  }
190
314
  },
191
315
  "required": [
316
+ "connectionKey",
192
317
  "environmentId",
193
318
  "appKey",
194
319
  "actorId",
@@ -246,9 +371,21 @@
246
371
  "maxLength": 120,
247
372
  "minLength": 1,
248
373
  "type": "string"
374
+ },
375
+ "snapshotAppInstanceKeys": {
376
+ "items": {
377
+ "pattern": "^[a-z][a-z0-9-]{0,39}$",
378
+ "type": "string"
379
+ },
380
+ "maxItems": 10,
381
+ "minItems": 1,
382
+ "type": "array"
383
+ },
384
+ "snapshotId": {
385
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
386
+ "type": "string"
249
387
  }
250
388
  },
251
- "required": ["apps"],
252
389
  "type": "object"
253
390
  },
254
391
  "Credential": {
@@ -345,6 +482,11 @@
345
482
  "name": {
346
483
  "type": ["string", "null"]
347
484
  },
485
+ "sourceEnvironmentSnapshotId": {
486
+ "default": null,
487
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
488
+ "type": ["string", "null"]
489
+ },
348
490
  "startedAt": {
349
491
  "format": "date-time",
350
492
  "type": ["string", "null"]
@@ -437,6 +579,11 @@
437
579
  "region": {
438
580
  "type": ["string", "null"]
439
581
  },
582
+ "sourceAppInstanceSnapshotId": {
583
+ "default": null,
584
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
585
+ "type": ["string", "null"]
586
+ },
440
587
  "status": {
441
588
  "enum": [
442
589
  "pending",
@@ -482,6 +629,80 @@
482
629
  "required": ["defaultMinutes", "maximumMinutes"],
483
630
  "type": "object"
484
631
  },
632
+ "EnvironmentSnapshot": {
633
+ "properties": {
634
+ "appInstanceSnapshots": {
635
+ "items": {
636
+ "$ref": "#/components/schemas/AppInstanceSnapshot"
637
+ },
638
+ "type": "array"
639
+ },
640
+ "consistency": {
641
+ "enum": ["per-app-instance"],
642
+ "type": "string"
643
+ },
644
+ "createdAt": {
645
+ "format": "date-time",
646
+ "type": "string"
647
+ },
648
+ "createdBy": {
649
+ "$ref": "#/components/schemas/Actor"
650
+ },
651
+ "deletedAt": {
652
+ "format": "date-time",
653
+ "type": ["string", "null"]
654
+ },
655
+ "errorCode": {
656
+ "type": ["string", "null"]
657
+ },
658
+ "id": {
659
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
660
+ "type": "string"
661
+ },
662
+ "name": {
663
+ "type": ["string", "null"]
664
+ },
665
+ "readyAt": {
666
+ "format": "date-time",
667
+ "type": ["string", "null"]
668
+ },
669
+ "sizeBytes": {
670
+ "type": ["number", "null"]
671
+ },
672
+ "sourceEnvironmentId": {
673
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
674
+ "type": "string"
675
+ },
676
+ "status": {
677
+ "enum": ["capturing", "ready", "failed"],
678
+ "type": "string"
679
+ },
680
+ "version": {
681
+ "type": "integer"
682
+ },
683
+ "workspaceId": {
684
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
685
+ "type": "string"
686
+ }
687
+ },
688
+ "required": [
689
+ "id",
690
+ "workspaceId",
691
+ "name",
692
+ "sourceEnvironmentId",
693
+ "createdBy",
694
+ "status",
695
+ "consistency",
696
+ "version",
697
+ "createdAt",
698
+ "readyAt",
699
+ "deletedAt",
700
+ "errorCode",
701
+ "sizeBytes",
702
+ "appInstanceSnapshots"
703
+ ],
704
+ "type": "object"
705
+ },
485
706
  "ErrorResponse": {
486
707
  "properties": {
487
708
  "error": {
@@ -489,15 +710,19 @@
489
710
  "code": {
490
711
  "enum": [
491
712
  "body-too-large",
713
+ "connection-not-authorized",
492
714
  "connection-unavailable",
493
715
  "environment-limit",
494
716
  "forbidden",
495
717
  "idempotency-conflict",
496
718
  "identity-request-rejected",
719
+ "initialization-busy",
720
+ "initialization-unavailable",
497
721
  "internal-error",
498
722
  "invalid-cursor",
499
723
  "invalid-request",
500
724
  "invalid-response",
725
+ "invalid-setup",
501
726
  "invalid-webhook",
502
727
  "last-owner",
503
728
  "last-workspace",
@@ -509,6 +734,7 @@
509
734
  "request-capacity-reached",
510
735
  "request-timeout",
511
736
  "service-unavailable",
737
+ "snapshot-limit",
512
738
  "unauthorized",
513
739
  "version-conflict",
514
740
  "workspace-archived",
@@ -1602,14 +1828,35 @@
1602
1828
  "content": {
1603
1829
  "application/json": {
1604
1830
  "schema": {
1605
- "properties": {
1606
- "actorId": {
1607
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
1608
- "type": "string"
1831
+ "anyOf": [
1832
+ {
1833
+ "additionalProperties": false,
1834
+ "properties": {
1835
+ "connectionKey": {
1836
+ "pattern": "^[a-z][a-z0-9-]{0,39}$",
1837
+ "type": "string"
1838
+ }
1839
+ },
1840
+ "required": ["connectionKey"],
1841
+ "type": "object"
1842
+ },
1843
+ {
1844
+ "additionalProperties": false,
1845
+ "properties": {
1846
+ "actorId": {
1847
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
1848
+ "type": "string"
1849
+ }
1850
+ },
1851
+ "required": ["actorId"],
1852
+ "type": "object"
1853
+ },
1854
+ {
1855
+ "additionalProperties": false,
1856
+ "properties": {},
1857
+ "type": "object"
1609
1858
  }
1610
- },
1611
- "required": ["actorId"],
1612
- "type": "object"
1859
+ ]
1613
1860
  }
1614
1861
  }
1615
1862
  },
@@ -2036,17 +2283,16 @@
2036
2283
  "x-state-credentials": ["user", "api_key"]
2037
2284
  }
2038
2285
  },
2039
- "/v1/workspaces": {
2040
- "get": {
2041
- "operationId": "listWorkspaces",
2286
+ "/v1/snapshots/{snapshotId}": {
2287
+ "delete": {
2288
+ "operationId": "deleteSnapshot",
2042
2289
  "parameters": [
2043
2290
  {
2044
- "in": "query",
2045
- "name": "archived",
2046
- "required": false,
2291
+ "in": "path",
2292
+ "name": "snapshotId",
2293
+ "required": true,
2047
2294
  "schema": {
2048
- "default": "exclude",
2049
- "enum": ["exclude", "include", "only"],
2295
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
2050
2296
  "type": "string"
2051
2297
  }
2052
2298
  }
@@ -2058,10 +2304,7 @@
2058
2304
  "schema": {
2059
2305
  "properties": {
2060
2306
  "data": {
2061
- "items": {
2062
- "$ref": "#/components/schemas/Workspace"
2063
- },
2064
- "type": "array"
2307
+ "$ref": "#/components/schemas/EnvironmentSnapshot"
2065
2308
  }
2066
2309
  },
2067
2310
  "required": ["data"],
@@ -2069,7 +2312,7 @@
2069
2312
  }
2070
2313
  }
2071
2314
  },
2072
- "description": "The current organization's workspaces"
2315
+ "description": "Environment snapshot removed from the library"
2073
2316
  },
2074
2317
  "400": {
2075
2318
  "content": {
@@ -2178,15 +2421,13 @@
2178
2421
  }
2179
2422
  ],
2180
2423
  "x-state-credentials": ["user", "api_key"]
2181
- }
2182
- },
2183
- "/v1/workspaces/{workspaceId}": {
2424
+ },
2184
2425
  "get": {
2185
- "operationId": "getWorkspace",
2426
+ "operationId": "getSnapshot",
2186
2427
  "parameters": [
2187
2428
  {
2188
2429
  "in": "path",
2189
- "name": "workspaceId",
2430
+ "name": "snapshotId",
2190
2431
  "required": true,
2191
2432
  "schema": {
2192
2433
  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
@@ -2201,7 +2442,7 @@
2201
2442
  "schema": {
2202
2443
  "properties": {
2203
2444
  "data": {
2204
- "$ref": "#/components/schemas/Workspace"
2445
+ "$ref": "#/components/schemas/EnvironmentSnapshot"
2205
2446
  }
2206
2447
  },
2207
2448
  "required": ["data"],
@@ -2209,7 +2450,7 @@
2209
2450
  }
2210
2451
  }
2211
2452
  },
2212
- "description": "Workspace"
2453
+ "description": "Environment snapshot and its app instance snapshots"
2213
2454
  },
2214
2455
  "400": {
2215
2456
  "content": {
@@ -2318,79 +2559,1139 @@
2318
2559
  }
2319
2560
  ],
2320
2561
  "x-state-credentials": ["user", "api_key"]
2321
- }
2322
- },
2323
- "/v1/workspaces/{workspaceId}/environments": {
2324
- "get": {
2325
- "operationId": "listEnvironments",
2562
+ },
2563
+ "patch": {
2564
+ "operationId": "updateSnapshot",
2326
2565
  "parameters": [
2327
2566
  {
2328
2567
  "in": "path",
2329
- "name": "workspaceId",
2568
+ "name": "snapshotId",
2330
2569
  "required": true,
2331
2570
  "schema": {
2332
2571
  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
2333
2572
  "type": "string"
2334
2573
  }
2335
- },
2336
- {
2337
- "in": "query",
2338
- "name": "limit",
2339
- "required": false,
2340
- "schema": {
2341
- "default": 50,
2342
- "maximum": 100,
2343
- "minimum": 1,
2344
- "type": "integer"
2345
- }
2346
- },
2347
- {
2348
- "in": "query",
2349
- "name": "cursor",
2350
- "required": false,
2351
- "schema": {
2352
- "maxLength": 2048,
2353
- "type": "string"
2354
- }
2355
- },
2356
- {
2357
- "in": "query",
2358
- "name": "status",
2359
- "required": false,
2360
- "schema": {
2361
- "default": "all",
2362
- "enum": ["live", "ended", "all"],
2363
- "type": "string"
2574
+ }
2575
+ ],
2576
+ "requestBody": {
2577
+ "content": {
2578
+ "application/json": {
2579
+ "schema": {
2580
+ "properties": {
2581
+ "expectedVersion": {
2582
+ "minimum": 1,
2583
+ "type": "integer"
2584
+ },
2585
+ "name": {
2586
+ "maxLength": 120,
2587
+ "minLength": 1,
2588
+ "type": ["string", "null"]
2589
+ }
2590
+ },
2591
+ "required": ["name", "expectedVersion"],
2592
+ "type": "object"
2593
+ }
2364
2594
  }
2365
2595
  },
2366
- {
2367
- "in": "query",
2368
- "name": "search",
2369
- "required": false,
2596
+ "required": true
2597
+ },
2598
+ "responses": {
2599
+ "200": {
2600
+ "content": {
2601
+ "application/json": {
2602
+ "schema": {
2603
+ "properties": {
2604
+ "data": {
2605
+ "$ref": "#/components/schemas/EnvironmentSnapshot"
2606
+ }
2607
+ },
2608
+ "required": ["data"],
2609
+ "type": "object"
2610
+ }
2611
+ }
2612
+ },
2613
+ "description": "Environment snapshot renamed"
2614
+ },
2615
+ "400": {
2616
+ "content": {
2617
+ "application/json": {
2618
+ "schema": {
2619
+ "$ref": "#/components/schemas/ErrorResponse"
2620
+ }
2621
+ }
2622
+ },
2623
+ "description": "Invalid request"
2624
+ },
2625
+ "401": {
2626
+ "content": {
2627
+ "application/json": {
2628
+ "schema": {
2629
+ "$ref": "#/components/schemas/ErrorResponse"
2630
+ }
2631
+ }
2632
+ },
2633
+ "description": "Authentication required"
2634
+ },
2635
+ "403": {
2636
+ "content": {
2637
+ "application/json": {
2638
+ "schema": {
2639
+ "$ref": "#/components/schemas/ErrorResponse"
2640
+ }
2641
+ }
2642
+ },
2643
+ "description": "Permission denied"
2644
+ },
2645
+ "404": {
2646
+ "content": {
2647
+ "application/json": {
2648
+ "schema": {
2649
+ "$ref": "#/components/schemas/ErrorResponse"
2650
+ }
2651
+ }
2652
+ },
2653
+ "description": "Resource not found"
2654
+ },
2655
+ "409": {
2656
+ "content": {
2657
+ "application/json": {
2658
+ "schema": {
2659
+ "$ref": "#/components/schemas/ErrorResponse"
2660
+ }
2661
+ }
2662
+ },
2663
+ "description": "Conflicting request or version"
2664
+ },
2665
+ "413": {
2666
+ "content": {
2667
+ "application/json": {
2668
+ "schema": {
2669
+ "$ref": "#/components/schemas/ErrorResponse"
2670
+ }
2671
+ }
2672
+ },
2673
+ "description": "Request body too large"
2674
+ },
2675
+ "422": {
2676
+ "content": {
2677
+ "application/json": {
2678
+ "schema": {
2679
+ "$ref": "#/components/schemas/ErrorResponse"
2680
+ }
2681
+ }
2682
+ },
2683
+ "description": "Unsupported configuration"
2684
+ },
2685
+ "429": {
2686
+ "content": {
2687
+ "application/json": {
2688
+ "schema": {
2689
+ "$ref": "#/components/schemas/ErrorResponse"
2690
+ }
2691
+ }
2692
+ },
2693
+ "description": "Admission limit reached"
2694
+ },
2695
+ "500": {
2696
+ "content": {
2697
+ "application/json": {
2698
+ "schema": {
2699
+ "$ref": "#/components/schemas/ErrorResponse"
2700
+ }
2701
+ }
2702
+ },
2703
+ "description": "Unexpected failure"
2704
+ },
2705
+ "503": {
2706
+ "content": {
2707
+ "application/json": {
2708
+ "schema": {
2709
+ "$ref": "#/components/schemas/ErrorResponse"
2710
+ }
2711
+ }
2712
+ },
2713
+ "description": "Dependency unavailable"
2714
+ }
2715
+ },
2716
+ "security": [
2717
+ {
2718
+ "bearerAuth": []
2719
+ }
2720
+ ],
2721
+ "x-state-credentials": ["user", "api_key"]
2722
+ }
2723
+ },
2724
+ "/v1/workspaces": {
2725
+ "get": {
2726
+ "operationId": "listWorkspaces",
2727
+ "parameters": [
2728
+ {
2729
+ "in": "query",
2730
+ "name": "archived",
2731
+ "required": false,
2732
+ "schema": {
2733
+ "default": "exclude",
2734
+ "enum": ["exclude", "include", "only"],
2735
+ "type": "string"
2736
+ }
2737
+ }
2738
+ ],
2739
+ "responses": {
2740
+ "200": {
2741
+ "content": {
2742
+ "application/json": {
2743
+ "schema": {
2744
+ "properties": {
2745
+ "data": {
2746
+ "items": {
2747
+ "$ref": "#/components/schemas/Workspace"
2748
+ },
2749
+ "type": "array"
2750
+ }
2751
+ },
2752
+ "required": ["data"],
2753
+ "type": "object"
2754
+ }
2755
+ }
2756
+ },
2757
+ "description": "The current organization's workspaces"
2758
+ },
2759
+ "400": {
2760
+ "content": {
2761
+ "application/json": {
2762
+ "schema": {
2763
+ "$ref": "#/components/schemas/ErrorResponse"
2764
+ }
2765
+ }
2766
+ },
2767
+ "description": "Invalid request"
2768
+ },
2769
+ "401": {
2770
+ "content": {
2771
+ "application/json": {
2772
+ "schema": {
2773
+ "$ref": "#/components/schemas/ErrorResponse"
2774
+ }
2775
+ }
2776
+ },
2777
+ "description": "Authentication required"
2778
+ },
2779
+ "403": {
2780
+ "content": {
2781
+ "application/json": {
2782
+ "schema": {
2783
+ "$ref": "#/components/schemas/ErrorResponse"
2784
+ }
2785
+ }
2786
+ },
2787
+ "description": "Permission denied"
2788
+ },
2789
+ "404": {
2790
+ "content": {
2791
+ "application/json": {
2792
+ "schema": {
2793
+ "$ref": "#/components/schemas/ErrorResponse"
2794
+ }
2795
+ }
2796
+ },
2797
+ "description": "Resource not found"
2798
+ },
2799
+ "409": {
2800
+ "content": {
2801
+ "application/json": {
2802
+ "schema": {
2803
+ "$ref": "#/components/schemas/ErrorResponse"
2804
+ }
2805
+ }
2806
+ },
2807
+ "description": "Conflicting request or version"
2808
+ },
2809
+ "413": {
2810
+ "content": {
2811
+ "application/json": {
2812
+ "schema": {
2813
+ "$ref": "#/components/schemas/ErrorResponse"
2814
+ }
2815
+ }
2816
+ },
2817
+ "description": "Request body too large"
2818
+ },
2819
+ "422": {
2820
+ "content": {
2821
+ "application/json": {
2822
+ "schema": {
2823
+ "$ref": "#/components/schemas/ErrorResponse"
2824
+ }
2825
+ }
2826
+ },
2827
+ "description": "Unsupported configuration"
2828
+ },
2829
+ "429": {
2830
+ "content": {
2831
+ "application/json": {
2832
+ "schema": {
2833
+ "$ref": "#/components/schemas/ErrorResponse"
2834
+ }
2835
+ }
2836
+ },
2837
+ "description": "Admission limit reached"
2838
+ },
2839
+ "500": {
2840
+ "content": {
2841
+ "application/json": {
2842
+ "schema": {
2843
+ "$ref": "#/components/schemas/ErrorResponse"
2844
+ }
2845
+ }
2846
+ },
2847
+ "description": "Unexpected failure"
2848
+ },
2849
+ "503": {
2850
+ "content": {
2851
+ "application/json": {
2852
+ "schema": {
2853
+ "$ref": "#/components/schemas/ErrorResponse"
2854
+ }
2855
+ }
2856
+ },
2857
+ "description": "Dependency unavailable"
2858
+ }
2859
+ },
2860
+ "security": [
2861
+ {
2862
+ "bearerAuth": []
2863
+ }
2864
+ ],
2865
+ "x-state-credentials": ["user", "api_key"]
2866
+ }
2867
+ },
2868
+ "/v1/workspaces/{workspaceId}": {
2869
+ "get": {
2870
+ "operationId": "getWorkspace",
2871
+ "parameters": [
2872
+ {
2873
+ "in": "path",
2874
+ "name": "workspaceId",
2875
+ "required": true,
2876
+ "schema": {
2877
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
2878
+ "type": "string"
2879
+ }
2880
+ }
2881
+ ],
2882
+ "responses": {
2883
+ "200": {
2884
+ "content": {
2885
+ "application/json": {
2886
+ "schema": {
2887
+ "properties": {
2888
+ "data": {
2889
+ "$ref": "#/components/schemas/Workspace"
2890
+ }
2891
+ },
2892
+ "required": ["data"],
2893
+ "type": "object"
2894
+ }
2895
+ }
2896
+ },
2897
+ "description": "Workspace"
2898
+ },
2899
+ "400": {
2900
+ "content": {
2901
+ "application/json": {
2902
+ "schema": {
2903
+ "$ref": "#/components/schemas/ErrorResponse"
2904
+ }
2905
+ }
2906
+ },
2907
+ "description": "Invalid request"
2908
+ },
2909
+ "401": {
2910
+ "content": {
2911
+ "application/json": {
2912
+ "schema": {
2913
+ "$ref": "#/components/schemas/ErrorResponse"
2914
+ }
2915
+ }
2916
+ },
2917
+ "description": "Authentication required"
2918
+ },
2919
+ "403": {
2920
+ "content": {
2921
+ "application/json": {
2922
+ "schema": {
2923
+ "$ref": "#/components/schemas/ErrorResponse"
2924
+ }
2925
+ }
2926
+ },
2927
+ "description": "Permission denied"
2928
+ },
2929
+ "404": {
2930
+ "content": {
2931
+ "application/json": {
2932
+ "schema": {
2933
+ "$ref": "#/components/schemas/ErrorResponse"
2934
+ }
2935
+ }
2936
+ },
2937
+ "description": "Resource not found"
2938
+ },
2939
+ "409": {
2940
+ "content": {
2941
+ "application/json": {
2942
+ "schema": {
2943
+ "$ref": "#/components/schemas/ErrorResponse"
2944
+ }
2945
+ }
2946
+ },
2947
+ "description": "Conflicting request or version"
2948
+ },
2949
+ "413": {
2950
+ "content": {
2951
+ "application/json": {
2952
+ "schema": {
2953
+ "$ref": "#/components/schemas/ErrorResponse"
2954
+ }
2955
+ }
2956
+ },
2957
+ "description": "Request body too large"
2958
+ },
2959
+ "422": {
2960
+ "content": {
2961
+ "application/json": {
2962
+ "schema": {
2963
+ "$ref": "#/components/schemas/ErrorResponse"
2964
+ }
2965
+ }
2966
+ },
2967
+ "description": "Unsupported configuration"
2968
+ },
2969
+ "429": {
2970
+ "content": {
2971
+ "application/json": {
2972
+ "schema": {
2973
+ "$ref": "#/components/schemas/ErrorResponse"
2974
+ }
2975
+ }
2976
+ },
2977
+ "description": "Admission limit reached"
2978
+ },
2979
+ "500": {
2980
+ "content": {
2981
+ "application/json": {
2982
+ "schema": {
2983
+ "$ref": "#/components/schemas/ErrorResponse"
2984
+ }
2985
+ }
2986
+ },
2987
+ "description": "Unexpected failure"
2988
+ },
2989
+ "503": {
2990
+ "content": {
2991
+ "application/json": {
2992
+ "schema": {
2993
+ "$ref": "#/components/schemas/ErrorResponse"
2994
+ }
2995
+ }
2996
+ },
2997
+ "description": "Dependency unavailable"
2998
+ }
2999
+ },
3000
+ "security": [
3001
+ {
3002
+ "bearerAuth": []
3003
+ }
3004
+ ],
3005
+ "x-state-credentials": ["user", "api_key"]
3006
+ }
3007
+ },
3008
+ "/v1/workspaces/{workspaceId}/environment-definitions": {
3009
+ "post": {
3010
+ "operationId": "createEnvironmentDefinition",
3011
+ "parameters": [
3012
+ {
3013
+ "in": "path",
3014
+ "name": "workspaceId",
3015
+ "required": true,
3016
+ "schema": {
3017
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
3018
+ "type": "string"
3019
+ }
3020
+ },
3021
+ {
3022
+ "in": "header",
3023
+ "name": "idempotency-key",
3024
+ "required": true,
3025
+ "schema": {
3026
+ "maxLength": 128,
3027
+ "minLength": 8,
3028
+ "pattern": "^[A-Za-z0-9._:-]+$",
3029
+ "type": "string"
3030
+ }
3031
+ }
3032
+ ],
3033
+ "requestBody": {
3034
+ "content": {
3035
+ "application/json": {
3036
+ "schema": {
3037
+ "anyOf": [
3038
+ {
3039
+ "additionalProperties": false,
3040
+ "properties": {
3041
+ "apps": {
3042
+ "anyOf": [
3043
+ {
3044
+ "items": {
3045
+ "pattern": "^[a-z][a-z0-9-]{0,39}$",
3046
+ "type": "string"
3047
+ },
3048
+ "maxItems": 10,
3049
+ "minItems": 1,
3050
+ "type": "array"
3051
+ },
3052
+ {
3053
+ "additionalProperties": {
3054
+ "additionalProperties": false,
3055
+ "properties": {
3056
+ "app": {
3057
+ "maxLength": 128,
3058
+ "minLength": 1,
3059
+ "type": "string"
3060
+ },
3061
+ "configure": {
3062
+ "additionalProperties": true,
3063
+ "description": "Native values validated by the selected replica release.",
3064
+ "type": "object"
3065
+ },
3066
+ "connections": {
3067
+ "additionalProperties": true,
3068
+ "description": "Native values validated by the selected replica release.",
3069
+ "type": "object"
3070
+ },
3071
+ "defaultConnection": {
3072
+ "pattern": "^[a-z][a-z0-9-]{0,39}$",
3073
+ "type": "string"
3074
+ },
3075
+ "preset": {
3076
+ "maxLength": 128,
3077
+ "minLength": 1,
3078
+ "type": "string"
3079
+ },
3080
+ "release": {
3081
+ "maxLength": 128,
3082
+ "minLength": 1,
3083
+ "type": "string"
3084
+ },
3085
+ "resources": {
3086
+ "additionalProperties": true,
3087
+ "description": "Native values validated by the selected replica release.",
3088
+ "type": "object"
3089
+ },
3090
+ "settings": {
3091
+ "additionalProperties": true,
3092
+ "description": "Native values validated by the selected replica release.",
3093
+ "type": "object"
3094
+ }
3095
+ },
3096
+ "required": ["app"],
3097
+ "type": "object"
3098
+ },
3099
+ "type": "object"
3100
+ }
3101
+ ]
3102
+ },
3103
+ "labels": {
3104
+ "additionalProperties": {
3105
+ "maxLength": 256,
3106
+ "type": "string"
3107
+ },
3108
+ "default": {},
3109
+ "type": "object"
3110
+ },
3111
+ "lifetimeMinutes": {
3112
+ "maximum": 1440,
3113
+ "minimum": 1,
3114
+ "type": "integer"
3115
+ },
3116
+ "name": {
3117
+ "maxLength": 120,
3118
+ "minLength": 1,
3119
+ "type": "string"
3120
+ },
3121
+ "version": {
3122
+ "default": 1,
3123
+ "enum": [1],
3124
+ "type": "number"
3125
+ }
3126
+ },
3127
+ "required": ["apps"],
3128
+ "type": "object"
3129
+ },
3130
+ {
3131
+ "additionalProperties": false,
3132
+ "properties": {
3133
+ "from": {
3134
+ "additionalProperties": false,
3135
+ "properties": {
3136
+ "snapshot": {
3137
+ "maxLength": 128,
3138
+ "minLength": 1,
3139
+ "type": "string"
3140
+ }
3141
+ },
3142
+ "required": ["snapshot"],
3143
+ "type": "object"
3144
+ },
3145
+ "version": {
3146
+ "default": 1,
3147
+ "enum": [1],
3148
+ "type": "number"
3149
+ }
3150
+ },
3151
+ "required": ["from"],
3152
+ "type": "object"
3153
+ }
3154
+ ]
3155
+ }
3156
+ }
3157
+ },
3158
+ "required": true
3159
+ },
3160
+ "responses": {
3161
+ "202": {
3162
+ "content": {
3163
+ "application/json": {
3164
+ "schema": {
3165
+ "properties": {
3166
+ "data": {
3167
+ "$ref": "#/components/schemas/Environment"
3168
+ }
3169
+ },
3170
+ "required": ["data"],
3171
+ "type": "object"
3172
+ }
3173
+ }
3174
+ },
3175
+ "description": "Environment accepted from its setup definition"
3176
+ },
3177
+ "400": {
3178
+ "content": {
3179
+ "application/json": {
3180
+ "schema": {
3181
+ "$ref": "#/components/schemas/ErrorResponse"
3182
+ }
3183
+ }
3184
+ },
3185
+ "description": "Invalid request"
3186
+ },
3187
+ "401": {
3188
+ "content": {
3189
+ "application/json": {
3190
+ "schema": {
3191
+ "$ref": "#/components/schemas/ErrorResponse"
3192
+ }
3193
+ }
3194
+ },
3195
+ "description": "Authentication required"
3196
+ },
3197
+ "403": {
3198
+ "content": {
3199
+ "application/json": {
3200
+ "schema": {
3201
+ "$ref": "#/components/schemas/ErrorResponse"
3202
+ }
3203
+ }
3204
+ },
3205
+ "description": "Permission denied"
3206
+ },
3207
+ "404": {
3208
+ "content": {
3209
+ "application/json": {
3210
+ "schema": {
3211
+ "$ref": "#/components/schemas/ErrorResponse"
3212
+ }
3213
+ }
3214
+ },
3215
+ "description": "Resource not found"
3216
+ },
3217
+ "409": {
3218
+ "content": {
3219
+ "application/json": {
3220
+ "schema": {
3221
+ "$ref": "#/components/schemas/ErrorResponse"
3222
+ }
3223
+ }
3224
+ },
3225
+ "description": "Conflicting request or version"
3226
+ },
3227
+ "413": {
3228
+ "content": {
3229
+ "application/json": {
3230
+ "schema": {
3231
+ "$ref": "#/components/schemas/ErrorResponse"
3232
+ }
3233
+ }
3234
+ },
3235
+ "description": "Request body too large"
3236
+ },
3237
+ "422": {
3238
+ "content": {
3239
+ "application/json": {
3240
+ "schema": {
3241
+ "$ref": "#/components/schemas/ErrorResponse"
3242
+ }
3243
+ }
3244
+ },
3245
+ "description": "Unsupported configuration"
3246
+ },
3247
+ "429": {
3248
+ "content": {
3249
+ "application/json": {
3250
+ "schema": {
3251
+ "$ref": "#/components/schemas/ErrorResponse"
3252
+ }
3253
+ }
3254
+ },
3255
+ "description": "Admission limit reached"
3256
+ },
3257
+ "500": {
3258
+ "content": {
3259
+ "application/json": {
3260
+ "schema": {
3261
+ "$ref": "#/components/schemas/ErrorResponse"
3262
+ }
3263
+ }
3264
+ },
3265
+ "description": "Unexpected failure"
3266
+ },
3267
+ "503": {
3268
+ "content": {
3269
+ "application/json": {
3270
+ "schema": {
3271
+ "$ref": "#/components/schemas/ErrorResponse"
3272
+ }
3273
+ }
3274
+ },
3275
+ "description": "Dependency unavailable"
3276
+ }
3277
+ },
3278
+ "security": [
3279
+ {
3280
+ "bearerAuth": []
3281
+ }
3282
+ ],
3283
+ "x-state-credentials": ["user", "api_key"]
3284
+ }
3285
+ },
3286
+ "/v1/workspaces/{workspaceId}/environments": {
3287
+ "get": {
3288
+ "operationId": "listEnvironments",
3289
+ "parameters": [
3290
+ {
3291
+ "in": "path",
3292
+ "name": "workspaceId",
3293
+ "required": true,
3294
+ "schema": {
3295
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
3296
+ "type": "string"
3297
+ }
3298
+ },
3299
+ {
3300
+ "in": "query",
3301
+ "name": "limit",
3302
+ "required": false,
3303
+ "schema": {
3304
+ "default": 50,
3305
+ "maximum": 100,
3306
+ "minimum": 1,
3307
+ "type": "integer"
3308
+ }
3309
+ },
3310
+ {
3311
+ "in": "query",
3312
+ "name": "cursor",
3313
+ "required": false,
3314
+ "schema": {
3315
+ "maxLength": 2048,
3316
+ "type": "string"
3317
+ }
3318
+ },
3319
+ {
3320
+ "in": "query",
3321
+ "name": "status",
3322
+ "required": false,
3323
+ "schema": {
3324
+ "default": "all",
3325
+ "enum": ["live", "ended", "all"],
3326
+ "type": "string"
3327
+ }
3328
+ },
3329
+ {
3330
+ "in": "query",
3331
+ "name": "snapshotId",
3332
+ "required": false,
3333
+ "schema": {
3334
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
3335
+ "type": "string"
3336
+ }
3337
+ },
3338
+ {
3339
+ "in": "query",
3340
+ "name": "search",
3341
+ "required": false,
3342
+ "schema": {
3343
+ "maxLength": 120,
3344
+ "type": "string"
3345
+ }
3346
+ },
3347
+ {
3348
+ "in": "query",
3349
+ "name": "label",
3350
+ "required": false,
3351
+ "schema": {
3352
+ "anyOf": [
3353
+ {
3354
+ "maxLength": 320,
3355
+ "type": "string"
3356
+ },
3357
+ {
3358
+ "items": {
3359
+ "maxLength": 320,
3360
+ "type": "string"
3361
+ },
3362
+ "maxItems": 32,
3363
+ "type": "array"
3364
+ }
3365
+ ]
3366
+ }
3367
+ }
3368
+ ],
3369
+ "responses": {
3370
+ "200": {
3371
+ "content": {
3372
+ "application/json": {
3373
+ "schema": {
3374
+ "properties": {
3375
+ "data": {
3376
+ "items": {
3377
+ "$ref": "#/components/schemas/Environment"
3378
+ },
3379
+ "type": "array"
3380
+ },
3381
+ "nextCursor": {
3382
+ "type": ["string", "null"]
3383
+ }
3384
+ },
3385
+ "required": ["data", "nextCursor"],
3386
+ "type": "object"
3387
+ }
3388
+ }
3389
+ },
3390
+ "description": "The workspace's environments, newest first"
3391
+ },
3392
+ "400": {
3393
+ "content": {
3394
+ "application/json": {
3395
+ "schema": {
3396
+ "$ref": "#/components/schemas/ErrorResponse"
3397
+ }
3398
+ }
3399
+ },
3400
+ "description": "Invalid request"
3401
+ },
3402
+ "401": {
3403
+ "content": {
3404
+ "application/json": {
3405
+ "schema": {
3406
+ "$ref": "#/components/schemas/ErrorResponse"
3407
+ }
3408
+ }
3409
+ },
3410
+ "description": "Authentication required"
3411
+ },
3412
+ "403": {
3413
+ "content": {
3414
+ "application/json": {
3415
+ "schema": {
3416
+ "$ref": "#/components/schemas/ErrorResponse"
3417
+ }
3418
+ }
3419
+ },
3420
+ "description": "Permission denied"
3421
+ },
3422
+ "404": {
3423
+ "content": {
3424
+ "application/json": {
3425
+ "schema": {
3426
+ "$ref": "#/components/schemas/ErrorResponse"
3427
+ }
3428
+ }
3429
+ },
3430
+ "description": "Resource not found"
3431
+ },
3432
+ "409": {
3433
+ "content": {
3434
+ "application/json": {
3435
+ "schema": {
3436
+ "$ref": "#/components/schemas/ErrorResponse"
3437
+ }
3438
+ }
3439
+ },
3440
+ "description": "Conflicting request or version"
3441
+ },
3442
+ "413": {
3443
+ "content": {
3444
+ "application/json": {
3445
+ "schema": {
3446
+ "$ref": "#/components/schemas/ErrorResponse"
3447
+ }
3448
+ }
3449
+ },
3450
+ "description": "Request body too large"
3451
+ },
3452
+ "422": {
3453
+ "content": {
3454
+ "application/json": {
3455
+ "schema": {
3456
+ "$ref": "#/components/schemas/ErrorResponse"
3457
+ }
3458
+ }
3459
+ },
3460
+ "description": "Unsupported configuration"
3461
+ },
3462
+ "429": {
3463
+ "content": {
3464
+ "application/json": {
3465
+ "schema": {
3466
+ "$ref": "#/components/schemas/ErrorResponse"
3467
+ }
3468
+ }
3469
+ },
3470
+ "description": "Admission limit reached"
3471
+ },
3472
+ "500": {
3473
+ "content": {
3474
+ "application/json": {
3475
+ "schema": {
3476
+ "$ref": "#/components/schemas/ErrorResponse"
3477
+ }
3478
+ }
3479
+ },
3480
+ "description": "Unexpected failure"
3481
+ },
3482
+ "503": {
3483
+ "content": {
3484
+ "application/json": {
3485
+ "schema": {
3486
+ "$ref": "#/components/schemas/ErrorResponse"
3487
+ }
3488
+ }
3489
+ },
3490
+ "description": "Dependency unavailable"
3491
+ }
3492
+ },
3493
+ "security": [
3494
+ {
3495
+ "bearerAuth": []
3496
+ }
3497
+ ],
3498
+ "x-state-credentials": ["user", "api_key"]
3499
+ },
3500
+ "post": {
3501
+ "operationId": "createEnvironments",
3502
+ "parameters": [
3503
+ {
3504
+ "in": "path",
3505
+ "name": "workspaceId",
3506
+ "required": true,
3507
+ "schema": {
3508
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
3509
+ "type": "string"
3510
+ }
3511
+ },
3512
+ {
3513
+ "in": "header",
3514
+ "name": "idempotency-key",
3515
+ "required": true,
3516
+ "schema": {
3517
+ "maxLength": 128,
3518
+ "minLength": 8,
3519
+ "pattern": "^[A-Za-z0-9._:-]+$",
3520
+ "type": "string"
3521
+ }
3522
+ }
3523
+ ],
3524
+ "requestBody": {
3525
+ "content": {
3526
+ "application/json": {
3527
+ "schema": {
3528
+ "$ref": "#/components/schemas/CreateEnvironmentInput"
3529
+ }
3530
+ }
3531
+ },
3532
+ "required": true
3533
+ },
3534
+ "responses": {
3535
+ "202": {
3536
+ "content": {
3537
+ "application/json": {
3538
+ "schema": {
3539
+ "properties": {
3540
+ "data": {
3541
+ "items": {
3542
+ "$ref": "#/components/schemas/Environment"
3543
+ },
3544
+ "type": "array"
3545
+ }
3546
+ },
3547
+ "required": ["data"],
3548
+ "type": "object"
3549
+ }
3550
+ }
3551
+ },
3552
+ "description": "Environments accepted; each app starts in its own sandbox"
3553
+ },
3554
+ "400": {
3555
+ "content": {
3556
+ "application/json": {
3557
+ "schema": {
3558
+ "$ref": "#/components/schemas/ErrorResponse"
3559
+ }
3560
+ }
3561
+ },
3562
+ "description": "Invalid request"
3563
+ },
3564
+ "401": {
3565
+ "content": {
3566
+ "application/json": {
3567
+ "schema": {
3568
+ "$ref": "#/components/schemas/ErrorResponse"
3569
+ }
3570
+ }
3571
+ },
3572
+ "description": "Authentication required"
3573
+ },
3574
+ "403": {
3575
+ "content": {
3576
+ "application/json": {
3577
+ "schema": {
3578
+ "$ref": "#/components/schemas/ErrorResponse"
3579
+ }
3580
+ }
3581
+ },
3582
+ "description": "Permission denied"
3583
+ },
3584
+ "404": {
3585
+ "content": {
3586
+ "application/json": {
3587
+ "schema": {
3588
+ "$ref": "#/components/schemas/ErrorResponse"
3589
+ }
3590
+ }
3591
+ },
3592
+ "description": "Resource not found"
3593
+ },
3594
+ "409": {
3595
+ "content": {
3596
+ "application/json": {
3597
+ "schema": {
3598
+ "$ref": "#/components/schemas/ErrorResponse"
3599
+ }
3600
+ }
3601
+ },
3602
+ "description": "Conflicting request or version"
3603
+ },
3604
+ "413": {
3605
+ "content": {
3606
+ "application/json": {
3607
+ "schema": {
3608
+ "$ref": "#/components/schemas/ErrorResponse"
3609
+ }
3610
+ }
3611
+ },
3612
+ "description": "Request body too large"
3613
+ },
3614
+ "422": {
3615
+ "content": {
3616
+ "application/json": {
3617
+ "schema": {
3618
+ "$ref": "#/components/schemas/ErrorResponse"
3619
+ }
3620
+ }
3621
+ },
3622
+ "description": "Unsupported configuration"
3623
+ },
3624
+ "429": {
3625
+ "content": {
3626
+ "application/json": {
3627
+ "schema": {
3628
+ "$ref": "#/components/schemas/ErrorResponse"
3629
+ }
3630
+ }
3631
+ },
3632
+ "description": "Admission limit reached"
3633
+ },
3634
+ "500": {
3635
+ "content": {
3636
+ "application/json": {
3637
+ "schema": {
3638
+ "$ref": "#/components/schemas/ErrorResponse"
3639
+ }
3640
+ }
3641
+ },
3642
+ "description": "Unexpected failure"
3643
+ },
3644
+ "503": {
3645
+ "content": {
3646
+ "application/json": {
3647
+ "schema": {
3648
+ "$ref": "#/components/schemas/ErrorResponse"
3649
+ }
3650
+ }
3651
+ },
3652
+ "description": "Dependency unavailable"
3653
+ }
3654
+ },
3655
+ "security": [
3656
+ {
3657
+ "bearerAuth": []
3658
+ }
3659
+ ],
3660
+ "x-state-credentials": ["user", "api_key"]
3661
+ }
3662
+ },
3663
+ "/v1/workspaces/{workspaceId}/events": {
3664
+ "get": {
3665
+ "operationId": "listWorkspaceEvents",
3666
+ "parameters": [
3667
+ {
3668
+ "in": "path",
3669
+ "name": "workspaceId",
3670
+ "required": true,
2370
3671
  "schema": {
2371
- "maxLength": 120,
3672
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
2372
3673
  "type": "string"
2373
3674
  }
2374
3675
  },
2375
3676
  {
2376
3677
  "in": "query",
2377
- "name": "label",
3678
+ "name": "limit",
2378
3679
  "required": false,
2379
3680
  "schema": {
2380
- "anyOf": [
2381
- {
2382
- "maxLength": 320,
2383
- "type": "string"
2384
- },
2385
- {
2386
- "items": {
2387
- "maxLength": 320,
2388
- "type": "string"
2389
- },
2390
- "maxItems": 32,
2391
- "type": "array"
2392
- }
2393
- ]
3681
+ "default": 50,
3682
+ "maximum": 100,
3683
+ "minimum": 1,
3684
+ "type": "integer"
3685
+ }
3686
+ },
3687
+ {
3688
+ "in": "query",
3689
+ "name": "cursor",
3690
+ "required": false,
3691
+ "schema": {
3692
+ "maxLength": 64,
3693
+ "pattern": "^\\d+$",
3694
+ "type": "string"
2394
3695
  }
2395
3696
  }
2396
3697
  ],
@@ -2399,23 +3700,11 @@
2399
3700
  "content": {
2400
3701
  "application/json": {
2401
3702
  "schema": {
2402
- "properties": {
2403
- "data": {
2404
- "items": {
2405
- "$ref": "#/components/schemas/Environment"
2406
- },
2407
- "type": "array"
2408
- },
2409
- "nextCursor": {
2410
- "type": ["string", "null"]
2411
- }
2412
- },
2413
- "required": ["data", "nextCursor"],
2414
- "type": "object"
3703
+ "$ref": "#/components/schemas/EventPage"
2415
3704
  }
2416
3705
  }
2417
3706
  },
2418
- "description": "The workspace's environments, newest first"
3707
+ "description": "Workspace activity, newest first"
2419
3708
  },
2420
3709
  "400": {
2421
3710
  "content": {
@@ -2524,9 +3813,11 @@
2524
3813
  }
2525
3814
  ],
2526
3815
  "x-state-credentials": ["user", "api_key"]
2527
- },
2528
- "post": {
2529
- "operationId": "createEnvironments",
3816
+ }
3817
+ },
3818
+ "/v1/workspaces/{workspaceId}/snapshots": {
3819
+ "get": {
3820
+ "operationId": "listSnapshots",
2530
3821
  "parameters": [
2531
3822
  {
2532
3823
  "in": "path",
@@ -2538,46 +3829,57 @@
2538
3829
  }
2539
3830
  },
2540
3831
  {
2541
- "in": "header",
2542
- "name": "idempotency-key",
2543
- "required": true,
3832
+ "in": "query",
3833
+ "name": "limit",
3834
+ "required": false,
2544
3835
  "schema": {
2545
- "maxLength": 128,
2546
- "minLength": 8,
2547
- "pattern": "^[A-Za-z0-9._:-]+$",
3836
+ "default": 50,
3837
+ "maximum": 100,
3838
+ "minimum": 1,
3839
+ "type": "integer"
3840
+ }
3841
+ },
3842
+ {
3843
+ "in": "query",
3844
+ "name": "cursor",
3845
+ "required": false,
3846
+ "schema": {
3847
+ "maxLength": 2048,
3848
+ "type": "string"
3849
+ }
3850
+ },
3851
+ {
3852
+ "in": "query",
3853
+ "name": "sourceEnvironmentId",
3854
+ "required": false,
3855
+ "schema": {
3856
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
2548
3857
  "type": "string"
2549
3858
  }
2550
3859
  }
2551
3860
  ],
2552
- "requestBody": {
2553
- "content": {
2554
- "application/json": {
2555
- "schema": {
2556
- "$ref": "#/components/schemas/CreateEnvironmentInput"
2557
- }
2558
- }
2559
- },
2560
- "required": true
2561
- },
2562
3861
  "responses": {
2563
- "202": {
3862
+ "200": {
2564
3863
  "content": {
2565
3864
  "application/json": {
2566
3865
  "schema": {
2567
3866
  "properties": {
2568
3867
  "data": {
2569
3868
  "items": {
2570
- "$ref": "#/components/schemas/Environment"
3869
+ "$ref": "#/components/schemas/EnvironmentSnapshot"
2571
3870
  },
2572
3871
  "type": "array"
3872
+ },
3873
+ "nextCursor": {
3874
+ "type": ["string", "null"]
2573
3875
  }
2574
3876
  },
2575
- "required": ["data"],
3877
+ "required": ["data", "nextCursor"],
2576
3878
  "type": "object"
2577
3879
  }
2578
3880
  }
2579
3881
  },
2580
- "description": "Environments accepted; each app starts in its own sandbox"
3882
+ "description": "Workspace environment snapshots, newest first"
2581
3883
  },
2582
3884
  "400": {
2583
3885
  "content": {
@@ -2686,11 +3988,9 @@
2686
3988
  }
2687
3989
  ],
2688
3990
  "x-state-credentials": ["user", "api_key"]
2689
- }
2690
- },
2691
- "/v1/workspaces/{workspaceId}/events": {
2692
- "get": {
2693
- "operationId": "listWorkspaceEvents",
3991
+ },
3992
+ "post": {
3993
+ "operationId": "captureSnapshot",
2694
3994
  "parameters": [
2695
3995
  {
2696
3996
  "in": "path",
@@ -2702,37 +4002,64 @@
2702
4002
  }
2703
4003
  },
2704
4004
  {
2705
- "in": "query",
2706
- "name": "limit",
2707
- "required": false,
2708
- "schema": {
2709
- "default": 50,
2710
- "maximum": 100,
2711
- "minimum": 1,
2712
- "type": "integer"
2713
- }
2714
- },
2715
- {
2716
- "in": "query",
2717
- "name": "cursor",
2718
- "required": false,
4005
+ "in": "header",
4006
+ "name": "idempotency-key",
4007
+ "required": true,
2719
4008
  "schema": {
2720
- "maxLength": 64,
2721
- "pattern": "^\\d+$",
4009
+ "maxLength": 128,
4010
+ "minLength": 8,
4011
+ "pattern": "^[A-Za-z0-9._:-]+$",
2722
4012
  "type": "string"
2723
4013
  }
2724
4014
  }
2725
4015
  ],
4016
+ "requestBody": {
4017
+ "content": {
4018
+ "application/json": {
4019
+ "schema": {
4020
+ "properties": {
4021
+ "appInstanceKeys": {
4022
+ "items": {
4023
+ "pattern": "^[a-z][a-z0-9-]{0,39}$",
4024
+ "type": "string"
4025
+ },
4026
+ "maxItems": 10,
4027
+ "minItems": 1,
4028
+ "type": "array"
4029
+ },
4030
+ "environmentId": {
4031
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
4032
+ "type": "string"
4033
+ },
4034
+ "name": {
4035
+ "maxLength": 120,
4036
+ "minLength": 1,
4037
+ "type": "string"
4038
+ }
4039
+ },
4040
+ "required": ["environmentId"],
4041
+ "type": "object"
4042
+ }
4043
+ }
4044
+ },
4045
+ "required": true
4046
+ },
2726
4047
  "responses": {
2727
- "200": {
4048
+ "202": {
2728
4049
  "content": {
2729
4050
  "application/json": {
2730
4051
  "schema": {
2731
- "$ref": "#/components/schemas/EventPage"
4052
+ "properties": {
4053
+ "data": {
4054
+ "$ref": "#/components/schemas/EnvironmentSnapshot"
4055
+ }
4056
+ },
4057
+ "required": ["data"],
4058
+ "type": "object"
2732
4059
  }
2733
4060
  }
2734
4061
  },
2735
- "description": "Workspace activity, newest first"
4062
+ "description": "Environment snapshot capture accepted"
2736
4063
  },
2737
4064
  "400": {
2738
4065
  "content": {