@shipeasy/openapi 1.5.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 (101) 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 -17
  14. package/dist/index.js +253 -2458
  15. package/dist/index.js.map +1 -0
  16. package/dist/node-context.d.ts +85 -0
  17. package/dist/node-context.js +110 -0
  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 +37 -21
  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/resources/alert-rules.d.ts +0 -50
  65. package/dist/resources/alert-rules.js +0 -75
  66. package/dist/resources/configs.d.ts +0 -681
  67. package/dist/resources/configs.js +0 -509
  68. package/dist/resources/experiments.d.ts +0 -849
  69. package/dist/resources/experiments.js +0 -707
  70. package/dist/resources/gates.d.ts +0 -808
  71. package/dist/resources/gates.js +0 -522
  72. package/dist/resources/index.d.ts +0 -2749
  73. package/dist/resources/index.js +0 -2391
  74. package/dist/resources/killswitches.d.ts +0 -436
  75. package/dist/resources/killswitches.js +0 -514
  76. package/dist/resources/universes.d.ts +0 -185
  77. package/dist/resources/universes.js +0 -234
  78. package/dist/schemas/alert-rules.d.ts +0 -65
  79. package/dist/schemas/alert-rules.js +0 -37
  80. package/dist/schemas/configs.d.ts +0 -154
  81. package/dist/schemas/configs.js +0 -134
  82. package/dist/schemas/constants.d.ts +0 -6
  83. package/dist/schemas/constants.js +0 -7
  84. package/dist/schemas/experiments.d.ts +0 -229
  85. package/dist/schemas/experiments.js +0 -221
  86. package/dist/schemas/folder.d.ts +0 -10
  87. package/dist/schemas/folder.js +0 -8
  88. package/dist/schemas/gates.d.ts +0 -386
  89. package/dist/schemas/gates.js +0 -190
  90. package/dist/schemas/index.d.ts +0 -11
  91. package/dist/schemas/index.js +0 -762
  92. package/dist/schemas/killswitches.d.ts +0 -110
  93. package/dist/schemas/killswitches.js +0 -226
  94. package/dist/schemas/metric-name.d.ts +0 -5
  95. package/dist/schemas/metric-name.js +0 -6
  96. package/dist/schemas/pagination.d.ts +0 -37
  97. package/dist/schemas/pagination.js +0 -44
  98. package/dist/schemas/universes.d.ts +0 -35
  99. package/dist/schemas/universes.js +0 -55
  100. package/dist/transport.d.ts +0 -30
  101. package/dist/transport.js +0 -44
@@ -0,0 +1,451 @@
1
+ /api/admin/gates:
2
+ get:
3
+ operationId: listGates
4
+ summary: List feature gates
5
+ description: |-
6
+ Returns a single page of gates ordered by `updated_at desc, id desc`. Use the `cursor` query parameter to paginate.
7
+
8
+ **Use case:** Snapshot every gate in the project — for example to render an admin overview or to drive a CI check that asserts no gate is left at 100% in staging.
9
+ tags:
10
+ - Flags
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 feature gates
18
+ content:
19
+ application/json:
20
+ schema:
21
+ $ref: ../components/schemas/gates.yaml#/ListGatesResponse
22
+ example:
23
+ data:
24
+ - id: gat_01j7w7m9q4hxbf6npe6s9zr3vc
25
+ name: checkout_v2
26
+ enabled: 1
27
+ rolloutPct: 5000
28
+ rules:
29
+ - attr: country
30
+ op: in
31
+ value:
32
+ - US
33
+ - CA
34
+ - GB
35
+ - attr: plan
36
+ op: neq
37
+ value: free
38
+ salt: 9c1f4f1f2c0c4a5fa1c2b6d3e7c8e3a1
39
+ title: Checkout v2
40
+ description: New checkout flow. Pro users in US/CA/GB only.
41
+ folder: checkout
42
+ groupName: growth
43
+ ownerEmail: ana@example.com
44
+ stack: null
45
+ updatedAt: 2026-05-09T16:01:22.000Z
46
+ next_cursor: null
47
+ "400":
48
+ $ref: ../components/responses.yaml#/BadRequest
49
+ "401":
50
+ $ref: ../components/responses.yaml#/Unauthorized
51
+ "403":
52
+ $ref: ../components/responses.yaml#/Forbidden
53
+ "404":
54
+ $ref: ../components/responses.yaml#/NotFound
55
+ "409":
56
+ $ref: ../components/responses.yaml#/Conflict
57
+ "422":
58
+ $ref: ../components/responses.yaml#/UnprocessableEntity
59
+ x-error-codes:
60
+ - BAD_REQUEST
61
+ - UNAUTHORIZED
62
+ - FORBIDDEN
63
+ x-cli:
64
+ name: list
65
+ post:
66
+ operationId: createGate
67
+ summary: Create a feature gate
68
+ description: |-
69
+ Creates a new gate. Default `enabled: true` at the supplied `rollout_pct` (`0` = fully dark).
70
+
71
+ Only `name` is required. Request fields use snake_case (`owner_email`); the GET response returns camelCase (`ownerEmail`, `groupName`).
72
+
73
+ Returns `409` if `name` already exists in the project (case-sensitive).
74
+
75
+ **Use cases**
76
+
77
+ - **Dark create + ramp later** — `{ "name": "checkout_v2" }` at 0% rollout. Ramp via PATCH after deploy validation.
78
+ - **Targeted rollout** — supply `rules` to gate the caller (e.g. only `plan = pro` users) plus a `rollout_pct` to bucket within that audience.
79
+ - **Gatekeeper stack** — supply `stack` instead of `rules`/`rollout_pct` for `internal ∪ beta ∪ public` fall-through. Stack entries evaluated top-to-bottom; first match wins.
80
+ - **Dashboard metadata** — populate `title`, `description`, `folder`, `group`, `owner_email` so the admin UI is self-documenting from day one.
81
+ - **Disabled on create** — pre-provision with `enabled: false` for a future launch; flip on with `POST /{id}/enable` at go-live.
82
+ tags:
83
+ - Flags
84
+ parameters:
85
+ - $ref: ../components/parameters.yaml#/ProjectId
86
+ requestBody:
87
+ required: true
88
+ content:
89
+ application/json:
90
+ schema:
91
+ $ref: ../components/schemas/gates.yaml#/CreateGateRequest
92
+ examples:
93
+ minimal:
94
+ summary: Minimal — dark gate, name only
95
+ description: "Smallest valid body. The gate is created `enabled: true` at `rollout_pct: 0`, with no rules. Ramp it later via PATCH."
96
+ value:
97
+ name: checkout_v2
98
+ targeted:
99
+ summary: Targeted rollout — rules + percentage
100
+ description: "Gate Pro users in US/CA/GB, then hash 10% of that audience into the on-bucket (`rollout_pct: 1000` = 10.00%). Adds dashboard metadata so the gate is self-documenting."
101
+ value:
102
+ name: checkout_v2
103
+ rollout_pct: 1000
104
+ rules:
105
+ - attr: country
106
+ op: in
107
+ value:
108
+ - US
109
+ - CA
110
+ - GB
111
+ - attr: plan
112
+ op: neq
113
+ value: free
114
+ title: Checkout v2
115
+ description: New checkout flow. Pro users in US/CA/GB only.
116
+ folder: checkout
117
+ group: growth
118
+ owner_email: ana@example.com
119
+ gatekeeperStack:
120
+ summary: Gatekeeper stack — internal ∪ beta ∪ public
121
+ description: "Three-layer fall-through: employees always on, opted-in beta accounts always on, then 25% of everyone else. First match wins; evaluation stops as soon as one entry returns `true`."
122
+ value:
123
+ name: checkout_v2
124
+ title: Checkout v2
125
+ owner_email: ana@example.com
126
+ stack:
127
+ - id: 01HKJ0EMP
128
+ type: condition
129
+ name: Employees
130
+ pass: any
131
+ rules:
132
+ - attr: email
133
+ op: regex
134
+ value: "@acme\\.com$"
135
+ - id: 01HKJ0BETA
136
+ type: condition
137
+ name: Beta opt-in
138
+ pass: all
139
+ rules:
140
+ - attr: beta_opt_in
141
+ op: eq
142
+ value: true
143
+ - id: 01HKJ0PUB
144
+ type: rollout
145
+ name: Public
146
+ rolloutPct: 2500
147
+ bucketBy: userID
148
+ locked: true
149
+ disabledOnCreate:
150
+ summary: Disabled on create — provision then enable later
151
+ description: "Create with `enabled: false` so the gate evaluates to `false` for every caller until a follow-up `POST /{id}/enable`. Useful when provisioning ahead of a launch."
152
+ value:
153
+ name: checkout_v2
154
+ enabled: false
155
+ rollout_pct: 0
156
+ responses:
157
+ "201":
158
+ description: Create a feature gate
159
+ content:
160
+ application/json:
161
+ schema:
162
+ $ref: ../components/schemas/gates.yaml#/CreateGateResponse
163
+ example:
164
+ id: gat_01j7w7m9q4hxbf6npe6s9zr3vc
165
+ name: checkout_v2
166
+ "400":
167
+ $ref: ../components/responses.yaml#/BadRequest
168
+ "401":
169
+ $ref: ../components/responses.yaml#/Unauthorized
170
+ "403":
171
+ $ref: ../components/responses.yaml#/Forbidden
172
+ "404":
173
+ $ref: ../components/responses.yaml#/NotFound
174
+ "409":
175
+ $ref: ../components/responses.yaml#/Conflict
176
+ "422":
177
+ $ref: ../components/responses.yaml#/UnprocessableEntity
178
+ x-error-codes:
179
+ - BAD_REQUEST
180
+ - UNAUTHORIZED
181
+ - FORBIDDEN
182
+ - ALREADY_EXISTS
183
+ - VALIDATION
184
+ x-cli:
185
+ name: create
186
+ positional:
187
+ - name
188
+ /api/admin/gates/{id}:
189
+ patch:
190
+ operationId: updateGate
191
+ summary: Update a feature gate
192
+ description: |-
193
+ Partial update — only supplied fields change. Array fields (`rules`, `stack`) **replace** wholesale; there is no merge or append.
194
+
195
+ `name` and the gate id are immutable. The response carries only `{ id }` — re-fetch via `GET /api/admin/gates` for the new row.
196
+
197
+ **Use cases**
198
+
199
+ - **Ramp rollout** — `{ "rollout_pct": 5000 }` for 50%. Basis points (0–10000); `100` = 1%.
200
+ - **Kill switch** — `{ "enabled": false }`. Forces evaluation to `false` for every caller regardless of rules/rollout. Re-enable with `POST /{id}/enable` or `{ "enabled": true }`.
201
+ - **Modify a rule's `in` set** — send the full new `rules` array. To add `'GB'` to `['US','CA']`: `{ "rules": [{ "attr": "country", "op": "in", "value": ["US","CA","GB"] }] }`. No per-rule patch endpoint.
202
+ - **Add targeting from scratch** — `{ "rules": [{ "attr": "email", "op": "regex", "value": "@acme\\.com$" }] }`.
203
+ - **Switch to gatekeeper stack** — send a non-null `stack`. To revert to flat eval, send `{ "stack": null }`.
204
+ - **Update metadata** — any subset of `title`, `description`, `folder`, `group`, `owner_email`.
205
+ tags:
206
+ - Flags
207
+ parameters:
208
+ - $ref: ../components/parameters.yaml#/ProjectId
209
+ - name: id
210
+ in: path
211
+ required: true
212
+ description: Stable opaque gate id (`gat_…`) or the gate's `name`.
213
+ schema:
214
+ type: string
215
+ requestBody:
216
+ required: true
217
+ content:
218
+ application/json:
219
+ schema:
220
+ $ref: ../components/schemas/gates.yaml#/UpdateGateRequest
221
+ examples:
222
+ rampRollout:
223
+ summary: Ramp rollout — 0 → 50%
224
+ description: Single-field patch. `5000` basis points = 50%.
225
+ value:
226
+ rollout_pct: 5000
227
+ killSwitch:
228
+ summary: Kill switch — disable the gate
229
+ description: Forces evaluation to `false` for every caller, regardless of rules or rollout. Same effect as `POST /{id}/disable` but composable with other patches.
230
+ value:
231
+ enabled: false
232
+ extendInRule:
233
+ summary: Add a value to an `in` rule
234
+ description: Array fields replace wholesale — there is no per-rule patch. To add `'AU'` to a country whitelist that previously held `['US','CA','GB']`, send the full new `rules` array. Same pattern applies to `not_in`.
235
+ value:
236
+ rules:
237
+ - attr: country
238
+ op: in
239
+ value:
240
+ - US
241
+ - CA
242
+ - GB
243
+ - AU
244
+ - attr: plan
245
+ op: neq
246
+ value: free
247
+ replaceStack:
248
+ summary: Replace gatekeeper stack
249
+ description: 'Stack is replace-wholesale. Send the full new ordered list. Pass `"stack": null` to revert the gate to flat `rules` + `rollout_pct` evaluation.'
250
+ value:
251
+ stack:
252
+ - id: 01HKJ0EMP
253
+ type: condition
254
+ name: Employees
255
+ pass: any
256
+ rules:
257
+ - attr: email
258
+ op: regex
259
+ value: "@acme\\.com$"
260
+ - id: 01HKJ0PUB
261
+ type: rollout
262
+ name: Public
263
+ rolloutPct: 5000
264
+ locked: true
265
+ updateMetadata:
266
+ summary: Update dashboard metadata
267
+ description: Any subset of `title`, `description`, `folder`, `group`, `owner_email`. Snake-case in the request; the GET response returns camelCase (`groupName`, `ownerEmail`).
268
+ value:
269
+ title: Checkout v2 (50%)
270
+ description: Bumped to 50% after passing canary. Added AU.
271
+ folder: checkout
272
+ owner_email: ana@example.com
273
+ responses:
274
+ "200":
275
+ description: Update a feature gate
276
+ content:
277
+ application/json:
278
+ schema:
279
+ $ref: ../components/schemas/gates.yaml#/UpdateGateResponse
280
+ example:
281
+ id: gat_01j7w7m9q4hxbf6npe6s9zr3vc
282
+ "400":
283
+ $ref: ../components/responses.yaml#/BadRequest
284
+ "401":
285
+ $ref: ../components/responses.yaml#/Unauthorized
286
+ "403":
287
+ $ref: ../components/responses.yaml#/Forbidden
288
+ "404":
289
+ $ref: ../components/responses.yaml#/NotFound
290
+ "409":
291
+ $ref: ../components/responses.yaml#/Conflict
292
+ "422":
293
+ $ref: ../components/responses.yaml#/UnprocessableEntity
294
+ x-error-codes:
295
+ - BAD_REQUEST
296
+ - UNAUTHORIZED
297
+ - FORBIDDEN
298
+ - NOT_FOUND
299
+ - VALIDATION
300
+ x-cli:
301
+ name: update
302
+ positional:
303
+ - id
304
+ delete:
305
+ operationId: deleteGate
306
+ summary: Delete a feature gate
307
+ description: |-
308
+ Soft-deletes the gate. Returns 409 if the gate is still referenced by a running experiment as a targeting gate — stop the experiment first.
309
+
310
+ **Use case:** Tear down a gate after a feature has fully shipped and the rollout flag is no longer needed.
311
+ tags:
312
+ - Flags
313
+ parameters:
314
+ - $ref: ../components/parameters.yaml#/ProjectId
315
+ - name: id
316
+ in: path
317
+ required: true
318
+ description: Stable opaque gate id (`gat_…`) or the gate's `name`.
319
+ schema:
320
+ type: string
321
+ responses:
322
+ "200":
323
+ description: Delete a feature gate
324
+ content:
325
+ application/json:
326
+ schema:
327
+ $ref: ../components/schemas/gates.yaml#/DeleteGateResponse
328
+ example:
329
+ ok: true
330
+ "400":
331
+ $ref: ../components/responses.yaml#/BadRequest
332
+ "401":
333
+ $ref: ../components/responses.yaml#/Unauthorized
334
+ "403":
335
+ $ref: ../components/responses.yaml#/Forbidden
336
+ "404":
337
+ $ref: ../components/responses.yaml#/NotFound
338
+ "409":
339
+ $ref: ../components/responses.yaml#/Conflict
340
+ "422":
341
+ $ref: ../components/responses.yaml#/UnprocessableEntity
342
+ x-error-codes:
343
+ - BAD_REQUEST
344
+ - UNAUTHORIZED
345
+ - FORBIDDEN
346
+ - NOT_FOUND
347
+ - REFERENCED_IN_USE
348
+ x-cli:
349
+ name: archive
350
+ positional:
351
+ - id
352
+ /api/admin/gates/{id}/enable:
353
+ post:
354
+ operationId: enableGate
355
+ summary: Enable a gate
356
+ description: |-
357
+ Sets `enabled: true`. The current `rollout_pct` is preserved.
358
+
359
+ **Use case:** Re-enable a previously disabled gate without re-issuing a full update.
360
+ tags:
361
+ - Flags
362
+ parameters:
363
+ - $ref: ../components/parameters.yaml#/ProjectId
364
+ - name: id
365
+ in: path
366
+ required: true
367
+ description: Stable opaque gate id (`gat_…`) or the gate's `name`.
368
+ schema:
369
+ type: string
370
+ responses:
371
+ "201":
372
+ description: Enable a gate
373
+ content:
374
+ application/json:
375
+ schema:
376
+ $ref: ../components/schemas/gates.yaml#/EnableGateResponse
377
+ example:
378
+ id: gat_01j7w7m9q4hxbf6npe6s9zr3vc
379
+ enabled: true
380
+ "400":
381
+ $ref: ../components/responses.yaml#/BadRequest
382
+ "401":
383
+ $ref: ../components/responses.yaml#/Unauthorized
384
+ "403":
385
+ $ref: ../components/responses.yaml#/Forbidden
386
+ "404":
387
+ $ref: ../components/responses.yaml#/NotFound
388
+ "409":
389
+ $ref: ../components/responses.yaml#/Conflict
390
+ "422":
391
+ $ref: ../components/responses.yaml#/UnprocessableEntity
392
+ x-error-codes:
393
+ - BAD_REQUEST
394
+ - UNAUTHORIZED
395
+ - FORBIDDEN
396
+ - NOT_FOUND
397
+ - VALIDATION
398
+ x-cli:
399
+ name: enable
400
+ positional:
401
+ - id
402
+ /api/admin/gates/{id}/disable:
403
+ post:
404
+ operationId: disableGate
405
+ summary: Disable a gate
406
+ description: |-
407
+ Sets `enabled: false` so the gate evaluates to `false` for every caller, regardless of `rollout_pct` or `rules`. Use as a quick kill switch.
408
+
409
+ **Use case:** Flip a gate off in production without redeploying — the canonical kill-switch flow.
410
+ tags:
411
+ - Flags
412
+ parameters:
413
+ - $ref: ../components/parameters.yaml#/ProjectId
414
+ - name: id
415
+ in: path
416
+ required: true
417
+ description: Stable opaque gate id (`gat_…`) or the gate's `name`.
418
+ schema:
419
+ type: string
420
+ responses:
421
+ "201":
422
+ description: Disable a gate
423
+ content:
424
+ application/json:
425
+ schema:
426
+ $ref: ../components/schemas/gates.yaml#/DisableGateResponse
427
+ example:
428
+ id: gat_01j7w7m9q4hxbf6npe6s9zr3vc
429
+ enabled: false
430
+ "400":
431
+ $ref: ../components/responses.yaml#/BadRequest
432
+ "401":
433
+ $ref: ../components/responses.yaml#/Unauthorized
434
+ "403":
435
+ $ref: ../components/responses.yaml#/Forbidden
436
+ "404":
437
+ $ref: ../components/responses.yaml#/NotFound
438
+ "409":
439
+ $ref: ../components/responses.yaml#/Conflict
440
+ "422":
441
+ $ref: ../components/responses.yaml#/UnprocessableEntity
442
+ x-error-codes:
443
+ - BAD_REQUEST
444
+ - UNAUTHORIZED
445
+ - FORBIDDEN
446
+ - NOT_FOUND
447
+ - VALIDATION
448
+ x-cli:
449
+ name: disable
450
+ positional:
451
+ - id