@usestatemachines/sdk 0.2.0 → 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 (64) hide show
  1. package/README.md +95 -5
  2. package/agents/SKILL.md +10 -3
  3. package/agents/index.js +6 -6
  4. package/agents/llms.txt +8 -2
  5. package/agents/prompt.md +1 -1
  6. package/esm/extensions/apps.d.ts +11 -1
  7. package/esm/extensions/apps.js +16 -0
  8. package/esm/extensions/client.d.ts +36 -3
  9. package/esm/extensions/client.js +96 -11
  10. package/esm/extensions/errors.d.ts +26 -1
  11. package/esm/extensions/errors.js +34 -1
  12. package/esm/extensions/index.d.ts +4 -4
  13. package/esm/extensions/index.js +1 -1
  14. package/esm/extensions/running-environment.d.ts +4 -1
  15. package/esm/extensions/running-environment.js +9 -0
  16. package/esm/extensions/wait.d.ts +10 -3
  17. package/esm/extensions/wait.js +22 -12
  18. package/esm/funcs/environments-list.js +1 -0
  19. package/esm/funcs/snapshots-capture.d.ts +11 -0
  20. package/esm/funcs/snapshots-capture.js +94 -0
  21. package/esm/funcs/snapshots-delete.d.ts +11 -0
  22. package/esm/funcs/snapshots-delete.js +92 -0
  23. package/esm/funcs/snapshots-get.d.ts +11 -0
  24. package/esm/funcs/snapshots-get.js +92 -0
  25. package/esm/funcs/snapshots-list.d.ts +11 -0
  26. package/esm/funcs/snapshots-list.js +98 -0
  27. package/esm/funcs/snapshots-update.d.ts +11 -0
  28. package/esm/funcs/snapshots-update.js +93 -0
  29. package/esm/lib/config.d.ts +2 -2
  30. package/esm/lib/config.js +2 -2
  31. package/esm/models/app-instance-snapshot.d.ts +15 -0
  32. package/esm/models/app-instance-snapshot.js +19 -0
  33. package/esm/models/create-environment-input.d.ts +6 -2
  34. package/esm/models/create-environment-input.js +3 -1
  35. package/esm/models/environment-app.d.ts +1 -0
  36. package/esm/models/environment-app.js +1 -0
  37. package/esm/models/environment-snapshot.d.ts +39 -0
  38. package/esm/models/environment-snapshot.js +41 -0
  39. package/esm/models/environment.d.ts +1 -0
  40. package/esm/models/environment.js +1 -0
  41. package/esm/models/error-response.d.ts +1 -0
  42. package/esm/models/error-response.js +1 -0
  43. package/esm/models/index.d.ts +2 -0
  44. package/esm/models/index.js +2 -0
  45. package/esm/models/operations/capture-snapshot.d.ts +41 -0
  46. package/esm/models/operations/capture-snapshot.js +36 -0
  47. package/esm/models/operations/delete-snapshot.d.ts +23 -0
  48. package/esm/models/operations/delete-snapshot.js +20 -0
  49. package/esm/models/operations/get-snapshot.d.ts +23 -0
  50. package/esm/models/operations/get-snapshot.js +20 -0
  51. package/esm/models/operations/index.d.ts +5 -0
  52. package/esm/models/operations/index.js +5 -0
  53. package/esm/models/operations/list-environments.d.ts +2 -0
  54. package/esm/models/operations/list-environments.js +1 -0
  55. package/esm/models/operations/list-snapshots.d.ts +30 -0
  56. package/esm/models/operations/list-snapshots.js +25 -0
  57. package/esm/models/operations/update-snapshot.d.ts +37 -0
  58. package/esm/models/operations/update-snapshot.js +29 -0
  59. package/esm/sdk/sdk.d.ts +3 -0
  60. package/esm/sdk/sdk.js +5 -0
  61. package/esm/sdk/snapshots.d.ts +9 -0
  62. package/esm/sdk/snapshots.js +27 -0
  63. package/openapi.json +1195 -255
  64. 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": {
@@ -330,9 +371,21 @@
330
371
  "maxLength": 120,
331
372
  "minLength": 1,
332
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"
333
387
  }
334
388
  },
335
- "required": ["apps"],
336
389
  "type": "object"
337
390
  },
338
391
  "Credential": {
@@ -429,6 +482,11 @@
429
482
  "name": {
430
483
  "type": ["string", "null"]
431
484
  },
485
+ "sourceEnvironmentSnapshotId": {
486
+ "default": null,
487
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
488
+ "type": ["string", "null"]
489
+ },
432
490
  "startedAt": {
433
491
  "format": "date-time",
434
492
  "type": ["string", "null"]
@@ -521,6 +579,11 @@
521
579
  "region": {
522
580
  "type": ["string", "null"]
523
581
  },
582
+ "sourceAppInstanceSnapshotId": {
583
+ "default": null,
584
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
585
+ "type": ["string", "null"]
586
+ },
524
587
  "status": {
525
588
  "enum": [
526
589
  "pending",
@@ -566,6 +629,80 @@
566
629
  "required": ["defaultMinutes", "maximumMinutes"],
567
630
  "type": "object"
568
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
+ },
569
706
  "ErrorResponse": {
570
707
  "properties": {
571
708
  "error": {
@@ -597,6 +734,7 @@
597
734
  "request-capacity-reached",
598
735
  "request-timeout",
599
736
  "service-unavailable",
737
+ "snapshot-limit",
600
738
  "unauthorized",
601
739
  "version-conflict",
602
740
  "workspace-archived",
@@ -2145,17 +2283,16 @@
2145
2283
  "x-state-credentials": ["user", "api_key"]
2146
2284
  }
2147
2285
  },
2148
- "/v1/workspaces": {
2149
- "get": {
2150
- "operationId": "listWorkspaces",
2286
+ "/v1/snapshots/{snapshotId}": {
2287
+ "delete": {
2288
+ "operationId": "deleteSnapshot",
2151
2289
  "parameters": [
2152
2290
  {
2153
- "in": "query",
2154
- "name": "archived",
2155
- "required": false,
2291
+ "in": "path",
2292
+ "name": "snapshotId",
2293
+ "required": true,
2156
2294
  "schema": {
2157
- "default": "exclude",
2158
- "enum": ["exclude", "include", "only"],
2295
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
2159
2296
  "type": "string"
2160
2297
  }
2161
2298
  }
@@ -2167,10 +2304,7 @@
2167
2304
  "schema": {
2168
2305
  "properties": {
2169
2306
  "data": {
2170
- "items": {
2171
- "$ref": "#/components/schemas/Workspace"
2172
- },
2173
- "type": "array"
2307
+ "$ref": "#/components/schemas/EnvironmentSnapshot"
2174
2308
  }
2175
2309
  },
2176
2310
  "required": ["data"],
@@ -2178,7 +2312,7 @@
2178
2312
  }
2179
2313
  }
2180
2314
  },
2181
- "description": "The current organization's workspaces"
2315
+ "description": "Environment snapshot removed from the library"
2182
2316
  },
2183
2317
  "400": {
2184
2318
  "content": {
@@ -2287,15 +2421,13 @@
2287
2421
  }
2288
2422
  ],
2289
2423
  "x-state-credentials": ["user", "api_key"]
2290
- }
2291
- },
2292
- "/v1/workspaces/{workspaceId}": {
2424
+ },
2293
2425
  "get": {
2294
- "operationId": "getWorkspace",
2426
+ "operationId": "getSnapshot",
2295
2427
  "parameters": [
2296
2428
  {
2297
2429
  "in": "path",
2298
- "name": "workspaceId",
2430
+ "name": "snapshotId",
2299
2431
  "required": true,
2300
2432
  "schema": {
2301
2433
  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
@@ -2310,7 +2442,7 @@
2310
2442
  "schema": {
2311
2443
  "properties": {
2312
2444
  "data": {
2313
- "$ref": "#/components/schemas/Workspace"
2445
+ "$ref": "#/components/schemas/EnvironmentSnapshot"
2314
2446
  }
2315
2447
  },
2316
2448
  "required": ["data"],
@@ -2318,7 +2450,7 @@
2318
2450
  }
2319
2451
  }
2320
2452
  },
2321
- "description": "Workspace"
2453
+ "description": "Environment snapshot and its app instance snapshots"
2322
2454
  },
2323
2455
  "400": {
2324
2456
  "content": {
@@ -2427,155 +2559,973 @@
2427
2559
  }
2428
2560
  ],
2429
2561
  "x-state-credentials": ["user", "api_key"]
2430
- }
2431
- },
2432
- "/v1/workspaces/{workspaceId}/environment-definitions": {
2433
- "post": {
2434
- "operationId": "createEnvironmentDefinition",
2562
+ },
2563
+ "patch": {
2564
+ "operationId": "updateSnapshot",
2435
2565
  "parameters": [
2436
2566
  {
2437
2567
  "in": "path",
2438
- "name": "workspaceId",
2568
+ "name": "snapshotId",
2439
2569
  "required": true,
2440
2570
  "schema": {
2441
2571
  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
2442
2572
  "type": "string"
2443
2573
  }
2444
- },
2445
- {
2446
- "in": "header",
2447
- "name": "idempotency-key",
2448
- "required": true,
2449
- "schema": {
2450
- "maxLength": 128,
2451
- "minLength": 8,
2452
- "pattern": "^[A-Za-z0-9._:-]+$",
2453
- "type": "string"
2454
- }
2455
2574
  }
2456
2575
  ],
2457
2576
  "requestBody": {
2458
2577
  "content": {
2459
2578
  "application/json": {
2460
2579
  "schema": {
2461
- "anyOf": [
2462
- {
2463
- "additionalProperties": false,
2464
- "properties": {
2465
- "apps": {
2466
- "anyOf": [
2467
- {
2468
- "items": {
2469
- "pattern": "^[a-z][a-z0-9-]{0,39}$",
2470
- "type": "string"
2471
- },
2472
- "maxItems": 10,
2473
- "minItems": 1,
2474
- "type": "array"
2475
- },
2476
- {
2477
- "additionalProperties": {
2478
- "additionalProperties": false,
2479
- "properties": {
2480
- "app": {
2481
- "maxLength": 128,
2482
- "minLength": 1,
2483
- "type": "string"
2484
- },
2485
- "configure": {
2486
- "additionalProperties": true,
2487
- "description": "Native values validated by the selected replica release.",
2488
- "type": "object"
2489
- },
2490
- "connections": {
2491
- "additionalProperties": true,
2492
- "description": "Native values validated by the selected replica release.",
2493
- "type": "object"
2494
- },
2495
- "defaultConnection": {
2496
- "pattern": "^[a-z][a-z0-9-]{0,39}$",
2497
- "type": "string"
2498
- },
2499
- "preset": {
2500
- "maxLength": 128,
2501
- "minLength": 1,
2502
- "type": "string"
2503
- },
2504
- "release": {
2505
- "maxLength": 128,
2506
- "minLength": 1,
2507
- "type": "string"
2508
- },
2509
- "resources": {
2510
- "additionalProperties": true,
2511
- "description": "Native values validated by the selected replica release.",
2512
- "type": "object"
2513
- },
2514
- "settings": {
2515
- "additionalProperties": true,
2516
- "description": "Native values validated by the selected replica release.",
2517
- "type": "object"
2518
- }
2519
- },
2520
- "required": ["app"],
2521
- "type": "object"
2522
- },
2523
- "type": "object"
2524
- }
2525
- ]
2526
- },
2527
- "labels": {
2528
- "additionalProperties": {
2529
- "maxLength": 256,
2530
- "type": "string"
2531
- },
2532
- "default": {},
2533
- "type": "object"
2534
- },
2535
- "lifetimeMinutes": {
2536
- "maximum": 1440,
2537
- "minimum": 1,
2538
- "type": "integer"
2539
- },
2540
- "name": {
2541
- "maxLength": 120,
2542
- "minLength": 1,
2543
- "type": "string"
2544
- },
2545
- "version": {
2546
- "default": 1,
2547
- "enum": [1],
2548
- "type": "number"
2549
- }
2550
- },
2551
- "required": ["apps"],
2552
- "type": "object"
2580
+ "properties": {
2581
+ "expectedVersion": {
2582
+ "minimum": 1,
2583
+ "type": "integer"
2553
2584
  },
2554
- {
2555
- "additionalProperties": false,
2556
- "properties": {
2557
- "from": {
2558
- "additionalProperties": false,
2559
- "properties": {
2560
- "snapshot": {
2561
- "maxLength": 128,
2562
- "minLength": 1,
2563
- "type": "string"
2585
+ "name": {
2586
+ "maxLength": 120,
2587
+ "minLength": 1,
2588
+ "type": ["string", "null"]
2589
+ }
2590
+ },
2591
+ "required": ["name", "expectedVersion"],
2592
+ "type": "object"
2593
+ }
2594
+ }
2595
+ },
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"
2564
3140
  }
2565
3141
  },
2566
3142
  "required": ["snapshot"],
2567
3143
  "type": "object"
2568
3144
  },
2569
- "version": {
2570
- "default": 1,
2571
- "enum": [1],
2572
- "type": "number"
2573
- }
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"
2574
3380
  },
2575
- "required": ["from"],
2576
- "type": "object"
2577
- }
2578
- ]
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"
2579
3529
  }
2580
3530
  }
2581
3531
  },
@@ -2588,7 +3538,10 @@
2588
3538
  "schema": {
2589
3539
  "properties": {
2590
3540
  "data": {
2591
- "$ref": "#/components/schemas/Environment"
3541
+ "items": {
3542
+ "$ref": "#/components/schemas/Environment"
3543
+ },
3544
+ "type": "array"
2592
3545
  }
2593
3546
  },
2594
3547
  "required": ["data"],
@@ -2596,7 +3549,7 @@
2596
3549
  }
2597
3550
  }
2598
3551
  },
2599
- "description": "Environment accepted from its setup definition"
3552
+ "description": "Environments accepted; each app starts in its own sandbox"
2600
3553
  },
2601
3554
  "400": {
2602
3555
  "content": {
@@ -2707,9 +3660,9 @@
2707
3660
  "x-state-credentials": ["user", "api_key"]
2708
3661
  }
2709
3662
  },
2710
- "/v1/workspaces/{workspaceId}/environments": {
3663
+ "/v1/workspaces/{workspaceId}/events": {
2711
3664
  "get": {
2712
- "operationId": "listEnvironments",
3665
+ "operationId": "listWorkspaceEvents",
2713
3666
  "parameters": [
2714
3667
  {
2715
3668
  "in": "path",
@@ -2736,49 +3689,10 @@
2736
3689
  "name": "cursor",
2737
3690
  "required": false,
2738
3691
  "schema": {
2739
- "maxLength": 2048,
2740
- "type": "string"
2741
- }
2742
- },
2743
- {
2744
- "in": "query",
2745
- "name": "status",
2746
- "required": false,
2747
- "schema": {
2748
- "default": "all",
2749
- "enum": ["live", "ended", "all"],
2750
- "type": "string"
2751
- }
2752
- },
2753
- {
2754
- "in": "query",
2755
- "name": "search",
2756
- "required": false,
2757
- "schema": {
2758
- "maxLength": 120,
3692
+ "maxLength": 64,
3693
+ "pattern": "^\\d+$",
2759
3694
  "type": "string"
2760
3695
  }
2761
- },
2762
- {
2763
- "in": "query",
2764
- "name": "label",
2765
- "required": false,
2766
- "schema": {
2767
- "anyOf": [
2768
- {
2769
- "maxLength": 320,
2770
- "type": "string"
2771
- },
2772
- {
2773
- "items": {
2774
- "maxLength": 320,
2775
- "type": "string"
2776
- },
2777
- "maxItems": 32,
2778
- "type": "array"
2779
- }
2780
- ]
2781
- }
2782
3696
  }
2783
3697
  ],
2784
3698
  "responses": {
@@ -2786,23 +3700,11 @@
2786
3700
  "content": {
2787
3701
  "application/json": {
2788
3702
  "schema": {
2789
- "properties": {
2790
- "data": {
2791
- "items": {
2792
- "$ref": "#/components/schemas/Environment"
2793
- },
2794
- "type": "array"
2795
- },
2796
- "nextCursor": {
2797
- "type": ["string", "null"]
2798
- }
2799
- },
2800
- "required": ["data", "nextCursor"],
2801
- "type": "object"
3703
+ "$ref": "#/components/schemas/EventPage"
2802
3704
  }
2803
3705
  }
2804
3706
  },
2805
- "description": "The workspace's environments, newest first"
3707
+ "description": "Workspace activity, newest first"
2806
3708
  },
2807
3709
  "400": {
2808
3710
  "content": {
@@ -2911,9 +3813,11 @@
2911
3813
  }
2912
3814
  ],
2913
3815
  "x-state-credentials": ["user", "api_key"]
2914
- },
2915
- "post": {
2916
- "operationId": "createEnvironments",
3816
+ }
3817
+ },
3818
+ "/v1/workspaces/{workspaceId}/snapshots": {
3819
+ "get": {
3820
+ "operationId": "listSnapshots",
2917
3821
  "parameters": [
2918
3822
  {
2919
3823
  "in": "path",
@@ -2925,46 +3829,57 @@
2925
3829
  }
2926
3830
  },
2927
3831
  {
2928
- "in": "header",
2929
- "name": "idempotency-key",
2930
- "required": true,
3832
+ "in": "query",
3833
+ "name": "limit",
3834
+ "required": false,
2931
3835
  "schema": {
2932
- "maxLength": 128,
2933
- "minLength": 8,
2934
- "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}$",
2935
3857
  "type": "string"
2936
3858
  }
2937
3859
  }
2938
3860
  ],
2939
- "requestBody": {
2940
- "content": {
2941
- "application/json": {
2942
- "schema": {
2943
- "$ref": "#/components/schemas/CreateEnvironmentInput"
2944
- }
2945
- }
2946
- },
2947
- "required": true
2948
- },
2949
3861
  "responses": {
2950
- "202": {
3862
+ "200": {
2951
3863
  "content": {
2952
3864
  "application/json": {
2953
3865
  "schema": {
2954
3866
  "properties": {
2955
3867
  "data": {
2956
3868
  "items": {
2957
- "$ref": "#/components/schemas/Environment"
3869
+ "$ref": "#/components/schemas/EnvironmentSnapshot"
2958
3870
  },
2959
3871
  "type": "array"
3872
+ },
3873
+ "nextCursor": {
3874
+ "type": ["string", "null"]
2960
3875
  }
2961
3876
  },
2962
- "required": ["data"],
3877
+ "required": ["data", "nextCursor"],
2963
3878
  "type": "object"
2964
3879
  }
2965
3880
  }
2966
3881
  },
2967
- "description": "Environments accepted; each app starts in its own sandbox"
3882
+ "description": "Workspace environment snapshots, newest first"
2968
3883
  },
2969
3884
  "400": {
2970
3885
  "content": {
@@ -3073,11 +3988,9 @@
3073
3988
  }
3074
3989
  ],
3075
3990
  "x-state-credentials": ["user", "api_key"]
3076
- }
3077
- },
3078
- "/v1/workspaces/{workspaceId}/events": {
3079
- "get": {
3080
- "operationId": "listWorkspaceEvents",
3991
+ },
3992
+ "post": {
3993
+ "operationId": "captureSnapshot",
3081
3994
  "parameters": [
3082
3995
  {
3083
3996
  "in": "path",
@@ -3089,37 +4002,64 @@
3089
4002
  }
3090
4003
  },
3091
4004
  {
3092
- "in": "query",
3093
- "name": "limit",
3094
- "required": false,
3095
- "schema": {
3096
- "default": 50,
3097
- "maximum": 100,
3098
- "minimum": 1,
3099
- "type": "integer"
3100
- }
3101
- },
3102
- {
3103
- "in": "query",
3104
- "name": "cursor",
3105
- "required": false,
4005
+ "in": "header",
4006
+ "name": "idempotency-key",
4007
+ "required": true,
3106
4008
  "schema": {
3107
- "maxLength": 64,
3108
- "pattern": "^\\d+$",
4009
+ "maxLength": 128,
4010
+ "minLength": 8,
4011
+ "pattern": "^[A-Za-z0-9._:-]+$",
3109
4012
  "type": "string"
3110
4013
  }
3111
4014
  }
3112
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
+ },
3113
4047
  "responses": {
3114
- "200": {
4048
+ "202": {
3115
4049
  "content": {
3116
4050
  "application/json": {
3117
4051
  "schema": {
3118
- "$ref": "#/components/schemas/EventPage"
4052
+ "properties": {
4053
+ "data": {
4054
+ "$ref": "#/components/schemas/EnvironmentSnapshot"
4055
+ }
4056
+ },
4057
+ "required": ["data"],
4058
+ "type": "object"
3119
4059
  }
3120
4060
  }
3121
4061
  },
3122
- "description": "Workspace activity, newest first"
4062
+ "description": "Environment snapshot capture accepted"
3123
4063
  },
3124
4064
  "400": {
3125
4065
  "content": {