@shipeasy/openapi 1.6.0 → 2.1.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 (151) hide show
  1. package/README.md +37 -0
  2. package/dist/chunk-EPLLHLZN.js +1616 -0
  3. package/dist/chunk-EPLLHLZN.js.map +1 -0
  4. package/dist/chunk-SPH5HWCD.js +3326 -0
  5. package/dist/chunk-SPH5HWCD.js.map +1 -0
  6. package/dist/client-pVkoo3Bf.d.ts +11186 -0
  7. package/dist/client.d.ts +1 -0
  8. package/dist/client.js +215 -0
  9. package/dist/client.js.map +1 -0
  10. package/dist/custom.d.ts +64 -0
  11. package/dist/custom.js +292 -0
  12. package/dist/custom.js.map +1 -0
  13. package/dist/index.d.ts +29 -41
  14. package/dist/index.js +258 -4375
  15. package/dist/index.js.map +1 -0
  16. package/dist/node-context.d.ts +81 -33
  17. package/dist/node-context.js +98 -44
  18. package/dist/node-context.js.map +1 -0
  19. package/dist/schemas.d.ts +7920 -0
  20. package/dist/schemas.js +1083 -0
  21. package/dist/schemas.js.map +1 -0
  22. package/openapi.json +15297 -3044
  23. package/openapi.yaml +13979 -0
  24. package/package.json +33 -26
  25. package/spec/components/errors.yaml +53 -0
  26. package/spec/components/parameters.yaml +24 -0
  27. package/spec/components/responses.yaml +107 -0
  28. package/spec/components/schemas/alert-rules.yaml +175 -0
  29. package/spec/components/schemas/attributes.yaml +157 -0
  30. package/spec/components/schemas/common.yaml +87 -0
  31. package/spec/components/schemas/configs.yaml +371 -0
  32. package/spec/components/schemas/connectors.yaml +593 -0
  33. package/spec/components/schemas/errors-api.yaml +209 -0
  34. package/spec/components/schemas/events.yaml +321 -0
  35. package/spec/components/schemas/experiments.yaml +865 -0
  36. package/spec/components/schemas/gate-templates.yaml +198 -0
  37. package/spec/components/schemas/gates.yaml +890 -0
  38. package/spec/components/schemas/i18n.yaml +478 -0
  39. package/spec/components/schemas/keys.yaml +186 -0
  40. package/spec/components/schemas/killswitches.yaml +309 -0
  41. package/spec/components/schemas/metrics.yaml +547 -0
  42. package/spec/components/schemas/ops.yaml +1011 -0
  43. package/spec/components/schemas/projects.yaml +222 -0
  44. package/spec/components/schemas/search.yaml +46 -0
  45. package/spec/components/schemas/universes.yaml +127 -0
  46. package/spec/openapi.yaml +348 -0
  47. package/spec/paths/alert-rules.yaml +250 -0
  48. package/spec/paths/attributes.yaml +261 -0
  49. package/spec/paths/configs.yaml +744 -0
  50. package/spec/paths/connectors.yaml +748 -0
  51. package/spec/paths/errors.yaml +382 -0
  52. package/spec/paths/events.yaml +366 -0
  53. package/spec/paths/experiments.yaml +777 -0
  54. package/spec/paths/gate-templates.yaml +263 -0
  55. package/spec/paths/gates.yaml +451 -0
  56. package/spec/paths/i18n.yaml +544 -0
  57. package/spec/paths/keys.yaml +181 -0
  58. package/spec/paths/killswitches.yaml +557 -0
  59. package/spec/paths/metrics.yaml +302 -0
  60. package/spec/paths/ops.yaml +446 -0
  61. package/spec/paths/projects.yaml +210 -0
  62. package/spec/paths/search.yaml +62 -0
  63. package/spec/paths/universes.yaml +247 -0
  64. package/dist/operations/attributes.d.ts +0 -33
  65. package/dist/operations/attributes.js +0 -16
  66. package/dist/operations/cli-adapter.d.ts +0 -35
  67. package/dist/operations/cli-adapter.js +0 -91
  68. package/dist/operations/coerce.d.ts +0 -32
  69. package/dist/operations/coerce.js +0 -53
  70. package/dist/operations/configs.d.ts +0 -28
  71. package/dist/operations/configs.js +0 -119
  72. package/dist/operations/docs.d.ts +0 -37
  73. package/dist/operations/docs.js +0 -39
  74. package/dist/operations/events.d.ts +0 -28
  75. package/dist/operations/events.js +0 -121
  76. package/dist/operations/experiments.d.ts +0 -28
  77. package/dist/operations/experiments.js +0 -280
  78. package/dist/operations/gates.d.ts +0 -28
  79. package/dist/operations/gates.js +0 -132
  80. package/dist/operations/i18n.d.ts +0 -28
  81. package/dist/operations/i18n.js +0 -121
  82. package/dist/operations/index.d.ts +0 -63
  83. package/dist/operations/index.js +0 -1751
  84. package/dist/operations/killswitches.d.ts +0 -28
  85. package/dist/operations/killswitches.js +0 -126
  86. package/dist/operations/mcp-adapter.d.ts +0 -35
  87. package/dist/operations/mcp-adapter.js +0 -94
  88. package/dist/operations/metrics.d.ts +0 -30
  89. package/dist/operations/metrics.js +0 -114
  90. package/dist/operations/ops.d.ts +0 -28
  91. package/dist/operations/ops.js +0 -313
  92. package/dist/operations/projects.d.ts +0 -28
  93. package/dist/operations/projects.js +0 -36
  94. package/dist/operations/sdk-docs.d.ts +0 -28
  95. package/dist/operations/sdk-docs.js +0 -160
  96. package/dist/operations/types.d.ts +0 -138
  97. package/dist/operations/types.js +0 -9
  98. package/dist/operations/universes.d.ts +0 -28
  99. package/dist/operations/universes.js +0 -93
  100. package/dist/operations/util.d.ts +0 -33
  101. package/dist/operations/util.js +0 -9
  102. package/dist/resources/alert-rules.d.ts +0 -50
  103. package/dist/resources/alert-rules.js +0 -75
  104. package/dist/resources/attributes.d.ts +0 -19
  105. package/dist/resources/attributes.js +0 -10
  106. package/dist/resources/configs.d.ts +0 -681
  107. package/dist/resources/configs.js +0 -509
  108. package/dist/resources/events.d.ts +0 -61
  109. package/dist/resources/events.js +0 -42
  110. package/dist/resources/experiments.d.ts +0 -849
  111. package/dist/resources/experiments.js +0 -707
  112. package/dist/resources/gates.d.ts +0 -808
  113. package/dist/resources/gates.js +0 -522
  114. package/dist/resources/i18n.d.ts +0 -84
  115. package/dist/resources/i18n.js +0 -60
  116. package/dist/resources/index.d.ts +0 -2767
  117. package/dist/resources/index.js +0 -2563
  118. package/dist/resources/killswitches.d.ts +0 -436
  119. package/dist/resources/killswitches.js +0 -514
  120. package/dist/resources/metrics.d.ts +0 -54
  121. package/dist/resources/metrics.js +0 -40
  122. package/dist/resources/ops.d.ts +0 -88
  123. package/dist/resources/ops.js +0 -36
  124. package/dist/resources/projects.d.ts +0 -54
  125. package/dist/resources/projects.js +0 -14
  126. package/dist/resources/universes.d.ts +0 -185
  127. package/dist/resources/universes.js +0 -234
  128. package/dist/schemas/alert-rules.d.ts +0 -65
  129. package/dist/schemas/alert-rules.js +0 -37
  130. package/dist/schemas/configs.d.ts +0 -154
  131. package/dist/schemas/configs.js +0 -134
  132. package/dist/schemas/constants.d.ts +0 -6
  133. package/dist/schemas/constants.js +0 -7
  134. package/dist/schemas/experiments.d.ts +0 -229
  135. package/dist/schemas/experiments.js +0 -221
  136. package/dist/schemas/folder.d.ts +0 -10
  137. package/dist/schemas/folder.js +0 -8
  138. package/dist/schemas/gates.d.ts +0 -386
  139. package/dist/schemas/gates.js +0 -190
  140. package/dist/schemas/index.d.ts +0 -11
  141. package/dist/schemas/index.js +0 -762
  142. package/dist/schemas/killswitches.d.ts +0 -110
  143. package/dist/schemas/killswitches.js +0 -226
  144. package/dist/schemas/metric-name.d.ts +0 -5
  145. package/dist/schemas/metric-name.js +0 -6
  146. package/dist/schemas/pagination.d.ts +0 -37
  147. package/dist/schemas/pagination.js +0 -44
  148. package/dist/schemas/universes.d.ts +0 -35
  149. package/dist/schemas/universes.js +0 -55
  150. package/dist/transport.d.ts +0 -30
  151. package/dist/transport.js +0 -44
@@ -0,0 +1,744 @@
1
+ /api/admin/configs:
2
+ get:
3
+ operationId: listConfigs
4
+ summary: List dynamic configs
5
+ description: |-
6
+ Returns a single page of configs ordered by `updated_at desc, id desc`. Each row includes the latest published `version` per env and any active drafts.
7
+
8
+ **Use case:** Snapshot every config in the project — e.g. CI check that asserts no env is stuck on a stale default or that every config has a published value on prod.
9
+ tags:
10
+ - Configs
11
+ parameters:
12
+ - $ref: ../components/parameters.yaml#/ProjectId
13
+ - $ref: ../components/parameters.yaml#/PaginationLimit
14
+ - $ref: ../components/parameters.yaml#/PaginationCursor
15
+ responses:
16
+ "200":
17
+ description: List dynamic configs
18
+ content:
19
+ application/json:
20
+ schema:
21
+ $ref: ../components/schemas/configs.yaml#/ListConfigsResponse
22
+ example:
23
+ data:
24
+ - id: cfg_01j7wae5h6j7k8l9m0n1p2q3r4
25
+ name: pricing.tiers
26
+ description: Pricing tier definitions consumed by the checkout flow.
27
+ schema:
28
+ type: object
29
+ properties:
30
+ tiers:
31
+ type: array
32
+ items:
33
+ type: object
34
+ required:
35
+ - tiers
36
+ updatedAt: 2026-05-09T18:22:11.000Z
37
+ envs:
38
+ dev:
39
+ version: 5
40
+ publishedAt: 2026-05-09T18:22:11.000Z
41
+ publishedBy: ana@example.com
42
+ stage:
43
+ version: 4
44
+ publishedAt: 2026-05-08T11:05:22.000Z
45
+ publishedBy: ana@example.com
46
+ prod:
47
+ version: 4
48
+ publishedAt: 2026-05-08T11:05:22.000Z
49
+ publishedBy: ana@example.com
50
+ drafts:
51
+ dev:
52
+ updatedAt: 2026-05-10T09:31:00.000Z
53
+ authorEmail: bo@example.com
54
+ baseVersion: 5
55
+ next_cursor: null
56
+ "400":
57
+ $ref: ../components/responses.yaml#/BadRequest
58
+ "401":
59
+ $ref: ../components/responses.yaml#/Unauthorized
60
+ "403":
61
+ $ref: ../components/responses.yaml#/Forbidden
62
+ "404":
63
+ $ref: ../components/responses.yaml#/NotFound
64
+ "409":
65
+ $ref: ../components/responses.yaml#/Conflict
66
+ "422":
67
+ $ref: ../components/responses.yaml#/UnprocessableEntity
68
+ x-error-codes:
69
+ - BAD_REQUEST
70
+ - UNAUTHORIZED
71
+ - FORBIDDEN
72
+ x-cli:
73
+ name: list
74
+ post:
75
+ operationId: createConfig
76
+ summary: Create a dynamic config
77
+ description: |-
78
+ Creates a new config with the given `schema`. The initial `value` (or an empty object) is published as version 1 on **every** env.
79
+
80
+ Returns `409` if `name` already exists in the project, `400` if `value` doesn't validate against `schema`.
81
+
82
+ **Use cases**
83
+
84
+ - **Minimal create** — `name` + `schema`. Initial value defaults to `{}`.
85
+ - **Seeded create** — supply a flat `value` to publish the same object on every env.
86
+ - **Per-env seed** — supply a `{ env: value }` map for different per-env starting values.
87
+ tags:
88
+ - Configs
89
+ parameters:
90
+ - $ref: ../components/parameters.yaml#/ProjectId
91
+ requestBody:
92
+ required: true
93
+ content:
94
+ application/json:
95
+ schema:
96
+ $ref: ../components/schemas/configs.yaml#/CreateConfigRequest
97
+ examples:
98
+ minimal:
99
+ summary: Minimal — name + schema
100
+ description: Smallest valid body. Initial value defaults to `{}` on every env.
101
+ value:
102
+ name: pricing.tiers
103
+ schema:
104
+ type: object
105
+ properties:
106
+ tiers:
107
+ type: array
108
+ required:
109
+ - tiers
110
+ seededValue:
111
+ summary: Seeded — schema + initial value
112
+ description: Seed the same JSON object on every env at version 1.
113
+ value:
114
+ name: pricing.tiers
115
+ description: Pricing tier definitions consumed by checkout.
116
+ schema:
117
+ type: object
118
+ properties:
119
+ tiers:
120
+ type: array
121
+ required:
122
+ - tiers
123
+ value:
124
+ tiers:
125
+ - name: free
126
+ - name: pro
127
+ perEnvSeed:
128
+ summary: Per-env seed
129
+ description: "Pass a `{ env: value }` map to seed different initial values per env."
130
+ value:
131
+ name: pricing.tiers
132
+ schema:
133
+ type: object
134
+ properties:
135
+ tiers:
136
+ type: array
137
+ required:
138
+ - tiers
139
+ value:
140
+ dev:
141
+ tiers:
142
+ - name: free
143
+ - name: pro
144
+ - name: enterprise
145
+ stage:
146
+ tiers:
147
+ - name: free
148
+ - name: pro
149
+ prod:
150
+ tiers:
151
+ - name: free
152
+ - name: pro
153
+ responses:
154
+ "201":
155
+ description: Create a dynamic config
156
+ content:
157
+ application/json:
158
+ schema:
159
+ $ref: ../components/schemas/configs.yaml#/CreateConfigResponse
160
+ example:
161
+ id: cfg_01j7wae5h6j7k8l9m0n1p2q3r4
162
+ name: pricing.tiers
163
+ "400":
164
+ $ref: ../components/responses.yaml#/BadRequest
165
+ "401":
166
+ $ref: ../components/responses.yaml#/Unauthorized
167
+ "403":
168
+ $ref: ../components/responses.yaml#/Forbidden
169
+ "404":
170
+ $ref: ../components/responses.yaml#/NotFound
171
+ "409":
172
+ $ref: ../components/responses.yaml#/Conflict
173
+ "422":
174
+ $ref: ../components/responses.yaml#/UnprocessableEntity
175
+ x-error-codes:
176
+ - BAD_REQUEST
177
+ - UNAUTHORIZED
178
+ - FORBIDDEN
179
+ - ALREADY_EXISTS
180
+ - VALIDATION
181
+ x-cli:
182
+ name: create
183
+ positional:
184
+ - name
185
+ /api/admin/configs/{id}:
186
+ get:
187
+ operationId: getConfig
188
+ summary: Get one config
189
+ description: |-
190
+ Returns config metadata plus the latest published values per env and any active draft values. Use this to fetch the JSON the editor renders.
191
+
192
+ **Use case:** Fetch one config's current published values and any in-flight drafts.
193
+ tags:
194
+ - Configs
195
+ parameters:
196
+ - $ref: ../components/parameters.yaml#/ProjectId
197
+ - name: id
198
+ in: path
199
+ required: true
200
+ description: Stable opaque config id (`cfg_…`) or the config's `name`.
201
+ schema:
202
+ type: string
203
+ responses:
204
+ "200":
205
+ description: Get one config
206
+ content:
207
+ application/json:
208
+ schema:
209
+ $ref: ../components/schemas/configs.yaml#/GetConfigResponse
210
+ example:
211
+ id: cfg_01j7wae5h6j7k8l9m0n1p2q3r4
212
+ name: pricing.tiers
213
+ description: Pricing tier definitions consumed by the checkout flow.
214
+ schema:
215
+ type: object
216
+ properties:
217
+ tiers:
218
+ type: array
219
+ items:
220
+ type: object
221
+ required:
222
+ - tiers
223
+ updatedAt: 2026-05-09T18:22:11.000Z
224
+ envs:
225
+ dev:
226
+ version: 5
227
+ publishedAt: 2026-05-09T18:22:11.000Z
228
+ publishedBy: ana@example.com
229
+ stage:
230
+ version: 4
231
+ publishedAt: 2026-05-08T11:05:22.000Z
232
+ publishedBy: ana@example.com
233
+ prod:
234
+ version: 4
235
+ publishedAt: 2026-05-08T11:05:22.000Z
236
+ publishedBy: ana@example.com
237
+ drafts:
238
+ dev:
239
+ updatedAt: 2026-05-10T09:31:00.000Z
240
+ authorEmail: bo@example.com
241
+ baseVersion: 5
242
+ values:
243
+ dev:
244
+ tiers:
245
+ - name: free
246
+ - name: pro
247
+ stage:
248
+ tiers:
249
+ - name: free
250
+ - name: pro
251
+ prod:
252
+ tiers:
253
+ - name: free
254
+ - name: pro
255
+ draftValues:
256
+ dev:
257
+ tiers:
258
+ - name: free
259
+ - name: pro
260
+ - name: enterprise
261
+ "400":
262
+ $ref: ../components/responses.yaml#/BadRequest
263
+ "401":
264
+ $ref: ../components/responses.yaml#/Unauthorized
265
+ "403":
266
+ $ref: ../components/responses.yaml#/Forbidden
267
+ "404":
268
+ $ref: ../components/responses.yaml#/NotFound
269
+ "409":
270
+ $ref: ../components/responses.yaml#/Conflict
271
+ "422":
272
+ $ref: ../components/responses.yaml#/UnprocessableEntity
273
+ x-error-codes:
274
+ - BAD_REQUEST
275
+ - UNAUTHORIZED
276
+ - FORBIDDEN
277
+ - NOT_FOUND
278
+ x-cli:
279
+ name: get
280
+ positional:
281
+ - id
282
+ patch:
283
+ operationId: updateConfig
284
+ summary: Update a dynamic config
285
+ description: |-
286
+ Partial update. When `value` is supplied it is **republished on every env** (new version per env). When `schema` is supplied it replaces the current schema; every existing value is re-validated.
287
+
288
+ For env-scoped edits, use the draft/publish flow (`PUT /{id}/drafts` then `POST /{id}/publish`) instead.
289
+
290
+ **Use cases**
291
+
292
+ - **Republish flat value** — `{ "value": {…} }` sets the same value on every env.
293
+ - **Schema migration** — `{ "schema": {…} }` replaces the schema; existing values are re-validated.
294
+ - **Env-scoped edits** — use `PUT /{id}/drafts` + `POST /{id}/publish` instead of PATCH.
295
+ tags:
296
+ - Configs
297
+ parameters:
298
+ - $ref: ../components/parameters.yaml#/ProjectId
299
+ - name: id
300
+ in: path
301
+ required: true
302
+ description: Stable opaque config id (`cfg_…`) or the config's `name`.
303
+ schema:
304
+ type: string
305
+ requestBody:
306
+ required: true
307
+ content:
308
+ application/json:
309
+ schema:
310
+ $ref: ../components/schemas/configs.yaml#/UpdateConfigRequest
311
+ examples:
312
+ flatValue:
313
+ summary: Flat value — republish on every env
314
+ description: Sets the same JSON object as a new version on dev/stage/prod.
315
+ value:
316
+ value:
317
+ tiers:
318
+ - name: free
319
+ - name: pro
320
+ schemaOnly:
321
+ summary: Schema-only update
322
+ description: Replaces the schema. Existing values must still validate or the update fails.
323
+ value:
324
+ schema:
325
+ type: object
326
+ properties:
327
+ tiers:
328
+ type: array
329
+ trial_days:
330
+ type: integer
331
+ required:
332
+ - tiers
333
+ responses:
334
+ "200":
335
+ description: Update a dynamic config
336
+ content:
337
+ application/json:
338
+ schema:
339
+ $ref: ../components/schemas/configs.yaml#/UpdateConfigResponse
340
+ example:
341
+ id: cfg_01j7wae5h6j7k8l9m0n1p2q3r4
342
+ "400":
343
+ $ref: ../components/responses.yaml#/BadRequest
344
+ "401":
345
+ $ref: ../components/responses.yaml#/Unauthorized
346
+ "403":
347
+ $ref: ../components/responses.yaml#/Forbidden
348
+ "404":
349
+ $ref: ../components/responses.yaml#/NotFound
350
+ "409":
351
+ $ref: ../components/responses.yaml#/Conflict
352
+ "422":
353
+ $ref: ../components/responses.yaml#/UnprocessableEntity
354
+ x-error-codes:
355
+ - BAD_REQUEST
356
+ - UNAUTHORIZED
357
+ - FORBIDDEN
358
+ - NOT_FOUND
359
+ - VALIDATION
360
+ x-cli:
361
+ name: update
362
+ positional:
363
+ - id
364
+ delete:
365
+ operationId: deleteConfig
366
+ summary: Delete a dynamic config
367
+ description: |-
368
+ Soft-deletes the config and rebuilds the project's flags KV blob.
369
+
370
+ **Use case:** Tear down a config after its consumers have stopped reading it.
371
+ tags:
372
+ - Configs
373
+ parameters:
374
+ - $ref: ../components/parameters.yaml#/ProjectId
375
+ - name: id
376
+ in: path
377
+ required: true
378
+ description: Stable opaque config id (`cfg_…`) or the config's `name`.
379
+ schema:
380
+ type: string
381
+ responses:
382
+ "200":
383
+ description: Delete a dynamic config
384
+ content:
385
+ application/json:
386
+ schema:
387
+ $ref: ../components/schemas/configs.yaml#/DeleteConfigResponse
388
+ example:
389
+ ok: true
390
+ "400":
391
+ $ref: ../components/responses.yaml#/BadRequest
392
+ "401":
393
+ $ref: ../components/responses.yaml#/Unauthorized
394
+ "403":
395
+ $ref: ../components/responses.yaml#/Forbidden
396
+ "404":
397
+ $ref: ../components/responses.yaml#/NotFound
398
+ "409":
399
+ $ref: ../components/responses.yaml#/Conflict
400
+ "422":
401
+ $ref: ../components/responses.yaml#/UnprocessableEntity
402
+ x-error-codes:
403
+ - BAD_REQUEST
404
+ - UNAUTHORIZED
405
+ - FORBIDDEN
406
+ - NOT_FOUND
407
+ x-cli:
408
+ name: archive
409
+ positional:
410
+ - id
411
+ /api/admin/configs/{id}/drafts:
412
+ put:
413
+ operationId: saveConfigDraft
414
+ summary: Save a draft value
415
+ description: |-
416
+ Stages a value for one env without publishing. The draft is validated against the config's current schema and stored alongside the `baseVersion` it was forked from.
417
+
418
+ Saving over an existing draft overwrites it. Use `POST /{id}/publish` to promote it to a new published version.
419
+
420
+ **Use case:** Iterate on a config value on dev without affecting prod — preview in staging, then publish.
421
+ tags:
422
+ - Configs
423
+ parameters:
424
+ - $ref: ../components/parameters.yaml#/ProjectId
425
+ - name: id
426
+ in: path
427
+ required: true
428
+ description: Stable opaque config id (`cfg_…`) or the config's `name`.
429
+ schema:
430
+ type: string
431
+ requestBody:
432
+ required: true
433
+ content:
434
+ application/json:
435
+ schema:
436
+ $ref: ../components/schemas/configs.yaml#/SaveConfigDraftRequest
437
+ examples:
438
+ stageDev:
439
+ summary: Stage a dev draft
440
+ description: Stages a new value on dev without touching stage/prod.
441
+ value:
442
+ env: dev
443
+ value:
444
+ tiers:
445
+ - name: free
446
+ - name: pro
447
+ - name: enterprise
448
+ responses:
449
+ "200":
450
+ description: Save a draft value
451
+ content:
452
+ application/json:
453
+ schema:
454
+ $ref: ../components/schemas/configs.yaml#/SaveConfigDraftResponse
455
+ example:
456
+ id: cfg_01j7wae5h6j7k8l9m0n1p2q3r4
457
+ env: dev
458
+ baseVersion: 5
459
+ updatedAt: 2026-05-10T09:31:00.000Z
460
+ "400":
461
+ $ref: ../components/responses.yaml#/BadRequest
462
+ "401":
463
+ $ref: ../components/responses.yaml#/Unauthorized
464
+ "403":
465
+ $ref: ../components/responses.yaml#/Forbidden
466
+ "404":
467
+ $ref: ../components/responses.yaml#/NotFound
468
+ "409":
469
+ $ref: ../components/responses.yaml#/Conflict
470
+ "422":
471
+ $ref: ../components/responses.yaml#/UnprocessableEntity
472
+ x-error-codes:
473
+ - BAD_REQUEST
474
+ - UNAUTHORIZED
475
+ - FORBIDDEN
476
+ - NOT_FOUND
477
+ - VALIDATION
478
+ x-cli:
479
+ name: draft
480
+ positional:
481
+ - id
482
+ delete:
483
+ operationId: discardConfigDraft
484
+ summary: Discard a draft
485
+ description: |-
486
+ Drops the in-flight draft on one env. Published values are unaffected.
487
+
488
+ **Use case:** Abandon an in-progress draft after deciding not to ship it.
489
+ tags:
490
+ - Configs
491
+ parameters:
492
+ - $ref: ../components/parameters.yaml#/ProjectId
493
+ - name: id
494
+ in: path
495
+ required: true
496
+ description: Stable opaque config id (`cfg_…`) or the config's `name`.
497
+ schema:
498
+ type: string
499
+ requestBody:
500
+ required: true
501
+ content:
502
+ application/json:
503
+ schema:
504
+ $ref: ../components/schemas/configs.yaml#/DiscardConfigDraftRequest
505
+ examples:
506
+ discardDev:
507
+ summary: Discard the dev draft
508
+ description: Drops the staged dev draft without publishing.
509
+ value:
510
+ env: dev
511
+ responses:
512
+ "200":
513
+ description: Discard a draft
514
+ content:
515
+ application/json:
516
+ schema:
517
+ $ref: ../components/schemas/configs.yaml#/DiscardConfigDraftResponse
518
+ example:
519
+ ok: true
520
+ "400":
521
+ $ref: ../components/responses.yaml#/BadRequest
522
+ "401":
523
+ $ref: ../components/responses.yaml#/Unauthorized
524
+ "403":
525
+ $ref: ../components/responses.yaml#/Forbidden
526
+ "404":
527
+ $ref: ../components/responses.yaml#/NotFound
528
+ "409":
529
+ $ref: ../components/responses.yaml#/Conflict
530
+ "422":
531
+ $ref: ../components/responses.yaml#/UnprocessableEntity
532
+ x-error-codes:
533
+ - BAD_REQUEST
534
+ - UNAUTHORIZED
535
+ - FORBIDDEN
536
+ - NOT_FOUND
537
+ x-cli:
538
+ name: discard-draft
539
+ positional:
540
+ - id
541
+ /api/admin/configs/{id}/publish:
542
+ post:
543
+ operationId: publishConfigDraft
544
+ summary: Publish a draft
545
+ description: |-
546
+ Promotes the staged draft on one env to a new published version. The draft must still validate against the current schema.
547
+
548
+ Returns `404` if there is no draft for the given env.
549
+
550
+ **Use case:** Ship a staged change once you've validated it on a lower env.
551
+ tags:
552
+ - Configs
553
+ parameters:
554
+ - $ref: ../components/parameters.yaml#/ProjectId
555
+ - name: id
556
+ in: path
557
+ required: true
558
+ description: Stable opaque config id (`cfg_…`) or the config's `name`.
559
+ schema:
560
+ type: string
561
+ requestBody:
562
+ required: true
563
+ content:
564
+ application/json:
565
+ schema:
566
+ $ref: ../components/schemas/configs.yaml#/PublishConfigDraftRequest
567
+ examples:
568
+ publishDev:
569
+ summary: Publish the dev draft
570
+ description: Promotes the dev draft to a new published version on dev.
571
+ value:
572
+ env: dev
573
+ publishProd:
574
+ summary: Publish to prod
575
+ description: Promotes the prod draft after staging signed off.
576
+ value:
577
+ env: prod
578
+ responses:
579
+ "201":
580
+ description: Publish a draft
581
+ content:
582
+ application/json:
583
+ schema:
584
+ $ref: ../components/schemas/configs.yaml#/PublishConfigDraftResponse
585
+ example:
586
+ id: cfg_01j7wae5h6j7k8l9m0n1p2q3r4
587
+ env: dev
588
+ version: 6
589
+ "400":
590
+ $ref: ../components/responses.yaml#/BadRequest
591
+ "401":
592
+ $ref: ../components/responses.yaml#/Unauthorized
593
+ "403":
594
+ $ref: ../components/responses.yaml#/Forbidden
595
+ "404":
596
+ $ref: ../components/responses.yaml#/NotFound
597
+ "409":
598
+ $ref: ../components/responses.yaml#/Conflict
599
+ "422":
600
+ $ref: ../components/responses.yaml#/UnprocessableEntity
601
+ x-error-codes:
602
+ - BAD_REQUEST
603
+ - UNAUTHORIZED
604
+ - FORBIDDEN
605
+ - NOT_FOUND
606
+ - INVALID_TRANSITION
607
+ - VALIDATION
608
+ x-cli:
609
+ name: publish
610
+ positional:
611
+ - id
612
+ /api/admin/configs/{id}/activity:
613
+ get:
614
+ operationId: listConfigActivity
615
+ summary: List config activity
616
+ description: |-
617
+ Returns recent audit rows for one config (create, update, draft.save, publish, delete) ordered newest first. Use the `limit` query parameter to cap the result (1–100, default 20).
618
+
619
+ **Use case:** Render the activity panel in the config editor or drive a slack notification on publish events.
620
+ tags:
621
+ - Configs
622
+ parameters:
623
+ - $ref: ../components/parameters.yaml#/ProjectId
624
+ - name: id
625
+ in: path
626
+ required: true
627
+ description: Stable opaque config id (`cfg_…`) or the config's `name`.
628
+ schema:
629
+ type: string
630
+ - name: limit
631
+ in: query
632
+ required: false
633
+ description: Max rows to return (1–100). Defaults to 20.
634
+ schema:
635
+ default: 20
636
+ type: integer
637
+ minimum: 1
638
+ maximum: 100
639
+ responses:
640
+ "200":
641
+ description: List config activity
642
+ content:
643
+ application/json:
644
+ schema:
645
+ $ref: ../components/schemas/configs.yaml#/ListConfigActivityResponse
646
+ example:
647
+ - id: act_01j7waf01a2b3c4d5e6f7g8h9i
648
+ action: config.publish
649
+ actorEmail: ana@example.com
650
+ actorType: user
651
+ payload:
652
+ env: dev
653
+ version: 6
654
+ createdAt: 2026-05-10T09:31:42.000Z
655
+ "400":
656
+ $ref: ../components/responses.yaml#/BadRequest
657
+ "401":
658
+ $ref: ../components/responses.yaml#/Unauthorized
659
+ "403":
660
+ $ref: ../components/responses.yaml#/Forbidden
661
+ "404":
662
+ $ref: ../components/responses.yaml#/NotFound
663
+ "409":
664
+ $ref: ../components/responses.yaml#/Conflict
665
+ "422":
666
+ $ref: ../components/responses.yaml#/UnprocessableEntity
667
+ x-error-codes:
668
+ - BAD_REQUEST
669
+ - UNAUTHORIZED
670
+ - FORBIDDEN
671
+ - NOT_FOUND
672
+ x-cli:
673
+ name: activity
674
+ positional:
675
+ - id
676
+ /api/admin/configs/{id}/schema:
677
+ patch:
678
+ operationId: updateConfigSchema
679
+ summary: Update a config schema
680
+ description: |-
681
+ Replaces a config's JSON Schema in place. Every existing published value is re-validated against the new schema before it lands; the update fails if any value no longer validates.
682
+
683
+ **Use case:** Evolve a config's shape (add/remove a field) without republishing values.
684
+ tags:
685
+ - Configs
686
+ parameters:
687
+ - $ref: ../components/parameters.yaml#/ProjectId
688
+ - name: id
689
+ in: path
690
+ required: true
691
+ description: Stable opaque config id (`cfg_…`) or the config's `name`.
692
+ schema:
693
+ type: string
694
+ requestBody:
695
+ required: true
696
+ content:
697
+ application/json:
698
+ schema:
699
+ $ref: ../components/schemas/configs.yaml#/UpdateConfigSchemaRequest
700
+ examples:
701
+ addField:
702
+ summary: Add a field to the schema
703
+ description: Replaces the schema; existing values must still validate or the update fails.
704
+ value:
705
+ schema:
706
+ type: object
707
+ properties:
708
+ tiers:
709
+ type: array
710
+ trial_days:
711
+ type: integer
712
+ required:
713
+ - tiers
714
+ responses:
715
+ "200":
716
+ description: Update a config schema
717
+ content:
718
+ application/json:
719
+ schema:
720
+ $ref: ../components/schemas/configs.yaml#/UpdateConfigSchemaResponse
721
+ example:
722
+ id: cfg_01j7wae5h6j7k8l9m0n1p2q3r4
723
+ "400":
724
+ $ref: ../components/responses.yaml#/BadRequest
725
+ "401":
726
+ $ref: ../components/responses.yaml#/Unauthorized
727
+ "403":
728
+ $ref: ../components/responses.yaml#/Forbidden
729
+ "404":
730
+ $ref: ../components/responses.yaml#/NotFound
731
+ "409":
732
+ $ref: ../components/responses.yaml#/Conflict
733
+ "422":
734
+ $ref: ../components/responses.yaml#/UnprocessableEntity
735
+ x-error-codes:
736
+ - BAD_REQUEST
737
+ - UNAUTHORIZED
738
+ - FORBIDDEN
739
+ - NOT_FOUND
740
+ - VALIDATION
741
+ x-cli:
742
+ name: update-schema
743
+ positional:
744
+ - id