@shipeasy/openapi 3.1.0 → 3.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 (45) hide show
  1. package/README.md +1 -1
  2. package/dist/{chunk-V4ZESAIF.js → chunk-75Z4SQOM.js} +141 -1
  3. package/dist/chunk-75Z4SQOM.js.map +1 -0
  4. package/dist/{chunk-UV333BIK.js → chunk-ZYK74ZIW.js} +569 -119
  5. package/dist/chunk-ZYK74ZIW.js.map +1 -0
  6. package/dist/{client-yqGYju-M.d.ts → client-DAGqRpF1.d.ts} +2209 -401
  7. package/dist/client.d.ts +1 -1
  8. package/dist/client.js +33 -1
  9. package/dist/custom.d.ts +5 -5
  10. package/dist/custom.js +128 -84
  11. package/dist/custom.js.map +1 -1
  12. package/dist/index.d.ts +2 -2
  13. package/dist/index.js +34 -2
  14. package/dist/index.js.map +1 -1
  15. package/dist/schemas.d.ts +2007 -891
  16. package/dist/schemas.js +179 -1
  17. package/openapi-sdk.json +1769 -0
  18. package/openapi.json +5861 -2597
  19. package/openapi.yaml +2739 -452
  20. package/package.json +6 -4
  21. package/spec/components/responses.yaml +39 -0
  22. package/spec/components/schemas/alert-rules.yaml +405 -7
  23. package/spec/components/schemas/alerts.yaml +9 -7
  24. package/spec/components/schemas/common.yaml +2 -2
  25. package/spec/components/schemas/connectors.yaml +69 -6
  26. package/spec/components/schemas/events.yaml +20 -9
  27. package/spec/components/schemas/gates.yaml +87 -0
  28. package/spec/components/schemas/keys.yaml +32 -2
  29. package/spec/components/schemas/killswitches.yaml +64 -0
  30. package/spec/components/schemas/metrics.yaml +131 -251
  31. package/spec/components/schemas/ops.yaml +555 -22
  32. package/spec/components/schemas/projects.yaml +18 -0
  33. package/spec/components/schemas/tags.yaml +91 -0
  34. package/spec/openapi-sdk.yaml +86 -0
  35. package/spec/openapi.yaml +61 -0
  36. package/spec/paths/alerts.yaml +5 -3
  37. package/spec/paths/gates.yaml +282 -0
  38. package/spec/paths/i18n.yaml +2 -1
  39. package/spec/paths/keys.yaml +79 -0
  40. package/spec/paths/killswitches.yaml +96 -0
  41. package/spec/paths/metrics.yaml +26 -17
  42. package/spec/paths/ops.yaml +566 -10
  43. package/spec/paths/tags.yaml +270 -0
  44. package/dist/chunk-UV333BIK.js.map +0 -1
  45. package/dist/chunk-V4ZESAIF.js.map +0 -1
@@ -32,6 +32,7 @@
32
32
  expires_at: null
33
33
  created_by_email: ana@example.com
34
34
  name: production back-end
35
+ description: Held by the checkout service; rotate with the quarterly credential sweep
35
36
  scopes:
36
37
  - gates:evaluate
37
38
  - events:write
@@ -131,6 +132,84 @@
131
132
  - PLAN_LIMIT
132
133
  x-cli:
133
134
  name: create
135
+ /api/admin/keys/{id}:
136
+ patch:
137
+ operationId: updateKey
138
+ summary: Update an API key's label
139
+ description: |-
140
+ Renames a key or re-notes what it is for. **Only `name` and `description` are editable** — everything that gives the key its authority (`type`, `env`, `scopes`, `expires_at`) is fixed at mint, because the worker derives the read env and permissions from the key itself. To change any of those, rotate: mint a replacement and revoke this one.
141
+
142
+ Omitted fields are left untouched; send `null` to clear one. Returns the updated key row. Revoked keys can still be relabelled (the audit trail outlives the credential). Returns `404` if no such key exists in the project.
143
+
144
+ **Use case:** A key minted by `shipeasy setup` carries an auto-composed provenance label — rename it to the service that actually holds it and note the rotation owner.
145
+ tags:
146
+ - API Keys
147
+ parameters:
148
+ - $ref: ../components/parameters.yaml#/ProjectId
149
+ - name: id
150
+ in: path
151
+ required: true
152
+ description: Stable opaque key id (UUID) returned by `create` / `list`.
153
+ schema:
154
+ $ref: ../components/schemas/common.yaml#/ResourceId
155
+ requestBody:
156
+ required: true
157
+ content:
158
+ application/json:
159
+ schema:
160
+ $ref: ../components/schemas/keys.yaml#/UpdateKeyRequest
161
+ examples:
162
+ rename:
163
+ summary: Rename and note the key
164
+ value:
165
+ name: checkout-service · production
166
+ description: Held by the checkout service; rotation owner is the payments team
167
+ clearDescription:
168
+ summary: Clear the note
169
+ value:
170
+ description: null
171
+ responses:
172
+ "200":
173
+ description: Update an API key's label
174
+ content:
175
+ application/json:
176
+ schema:
177
+ $ref: ../components/schemas/keys.yaml#/KeyRecord
178
+ example:
179
+ id: 3f2a9b1c-7d4e-4a8f-9c2b-1e5d6f7a8b90
180
+ type: server
181
+ env: prod
182
+ created_at: 2026-05-09T16:01:22.000Z
183
+ revoked_at: null
184
+ expires_at: null
185
+ created_by_email: ana@example.com
186
+ name: checkout-service · production
187
+ description: Held by the checkout service; rotation owner is the payments team
188
+ scopes:
189
+ - gates:evaluate
190
+ - events:write
191
+ last4: a1b2
192
+ "400":
193
+ $ref: ../components/responses.yaml#/BadRequest
194
+ "401":
195
+ $ref: ../components/responses.yaml#/Unauthorized
196
+ "403":
197
+ $ref: ../components/responses.yaml#/Forbidden
198
+ "404":
199
+ $ref: ../components/responses.yaml#/NotFound
200
+ "409":
201
+ $ref: ../components/responses.yaml#/Conflict
202
+ "422":
203
+ $ref: ../components/responses.yaml#/UnprocessableEntity
204
+ x-error-codes:
205
+ - UNAUTHORIZED
206
+ - FORBIDDEN
207
+ - NOT_FOUND
208
+ - VALIDATION
209
+ x-cli:
210
+ name: update
211
+ positional:
212
+ - id
134
213
  /api/admin/keys/{id}/revoke:
135
214
  post:
136
215
  operationId: revokeKey
@@ -579,3 +579,99 @@
579
579
  name: set-value
580
580
  positional:
581
581
  - id
582
+ /api/admin/killswitches/{id}/toggle:
583
+ post:
584
+ operationId: toggleKillswitch
585
+ summary: Toggle a killswitch or one of its switches
586
+ description: |-
587
+ Flips a killswitch on one environment and publishes a new version there. This is the one-call incident verb: it reads the current value, flips it, and publishes, so you don't have to fetch the killswitch first.
588
+
589
+ Every body field is optional, which is what makes the call widen cleanly:
590
+
591
+ - **Flip the killswitch** — `{}`. Flips the flat `value` on `prod`.
592
+ - **Flip one sub-switch** — `{ "switchKey": "eu_region" }`. Flips that entry on `prod`, creating it (from `false`) if it isn't in the map yet.
593
+ - **Set it idempotently** — `{ "switchKey": "eu_region", "value": true }`. Publishes exactly that value, so a retried call can't undo the first one. A `null` `value` means "flip", not "set to null".
594
+ - **Choose the environment** — add `"env": "staging"`. Omitted, `env` is `prod`.
595
+
596
+ The response reports both `previous` and `value`, so a caller that asked for a flip can see what it actually changed.
597
+
598
+ Prefer this over `PUT /{id}/value` and `PUT /{id}/switch` unless you specifically need those endpoints' unconditional set semantics.
599
+ tags:
600
+ - Killswitch
601
+ parameters:
602
+ - $ref: ../components/parameters.yaml#/ProjectId
603
+ - name: id
604
+ in: path
605
+ required: true
606
+ description: Stable opaque killswitch id (`ksw_…`) or the killswitch's `name`.
607
+ schema:
608
+ $ref: ../components/schemas/common.yaml#/ResourceId
609
+ requestBody:
610
+ required: false
611
+ content:
612
+ application/json:
613
+ schema:
614
+ $ref: ../components/schemas/killswitches.yaml#/ToggleKillswitchRequest
615
+ examples:
616
+ flipOnProd:
617
+ summary: Flip the killswitch on prod
618
+ description: No body fields — reads the flat `value` on prod and publishes its opposite.
619
+ value: {}
620
+ flipOneSwitch:
621
+ summary: Flip one sub-switch on prod
622
+ description: Flips `switches.eu_region` on prod, leaving the flat `value` and every other key alone.
623
+ value:
624
+ switchKey: eu_region
625
+ setOneSwitch:
626
+ summary: Trip one sub-switch idempotently
627
+ description: Publishes `switches.eu_region = true` on prod whatever it was before — safe to retry.
628
+ value:
629
+ switchKey: eu_region
630
+ value: true
631
+ setOneSwitchOnStaging:
632
+ summary: Trip one sub-switch on a chosen env
633
+ description: The same idempotent set, published on staging instead of prod.
634
+ value:
635
+ switchKey: eu_region
636
+ value: true
637
+ env: staging
638
+ responses:
639
+ "200":
640
+ description: Toggle a killswitch or one of its switches
641
+ content:
642
+ application/json:
643
+ schema:
644
+ $ref: ../components/schemas/killswitches.yaml#/ToggleKillswitchResponse
645
+ example:
646
+ id: ksw_01j7w9d8h2k4m6n8p0q2r4s6t8
647
+ env: prod
648
+ switchKey: eu_region
649
+ previous: false
650
+ value: true
651
+ version: 7
652
+ published:
653
+ value: false
654
+ switches:
655
+ eu_region: true
656
+ "400":
657
+ $ref: ../components/responses.yaml#/BadRequest
658
+ "401":
659
+ $ref: ../components/responses.yaml#/Unauthorized
660
+ "403":
661
+ $ref: ../components/responses.yaml#/Forbidden
662
+ "404":
663
+ $ref: ../components/responses.yaml#/NotFound
664
+ "409":
665
+ $ref: ../components/responses.yaml#/Conflict
666
+ "422":
667
+ $ref: ../components/responses.yaml#/UnprocessableEntity
668
+ x-error-codes:
669
+ - BAD_REQUEST
670
+ - UNAUTHORIZED
671
+ - FORBIDDEN
672
+ - NOT_FOUND
673
+ - VALIDATION
674
+ x-cli:
675
+ name: toggle
676
+ positional:
677
+ - id
@@ -23,11 +23,14 @@
23
23
  name: checkouts
24
24
  folder: null
25
25
  eventName: checkout_completed
26
- query: count_users(checkout_completed)
26
+ query: count(checkout_completed)
27
27
  queryIr:
28
- agg: { kind: count_users }
29
- metric: checkout_completed
30
- filters: []
28
+ v: 2
29
+ expr:
30
+ node: agg
31
+ event: checkout_completed
32
+ agg: { kind: count }
33
+ filters: []
31
34
  direction: higher_better
32
35
  version: 1
33
36
  "400":
@@ -61,7 +64,7 @@
61
64
 
62
65
  **Use cases**
63
66
 
64
- - **Track an event** — `count_users(<event>)` for unique-user counts.
67
+ - **Track an event** — `count(<event>)` for event counts.
65
68
  - **Sum a value** — `sum(<event>, <label>)` for revenue / quantity metrics.
66
69
  - **Experiment success metric** — create the metric, then attach its id to an experiment.
67
70
  tags:
@@ -75,13 +78,13 @@
75
78
  schema:
76
79
  $ref: ../components/schemas/metrics.yaml#/CreateMetricRequest
77
80
  examples:
78
- countUsers:
79
- summary: Count unique users (DSL)
80
- description: Unique users who completed checkout, expressed with the query DSL.
81
+ countEvents:
82
+ summary: Count an event (DSL)
83
+ description: Completed checkouts, expressed with the query DSL.
81
84
  value:
82
85
  name: checkouts
83
86
  event_name: checkout_completed
84
- query: count_users(checkout_completed)
87
+ query: count(checkout_completed)
85
88
  sumRevenue:
86
89
  summary: Sum a value label (DSL)
87
90
  description: Total revenue, summing the `amount` property of the `purchase` event.
@@ -98,10 +101,13 @@
98
101
  name: checkouts
99
102
  event_name: checkout_completed
100
103
  query_ir:
101
- agg:
102
- kind: count_users
103
- metric: checkout_completed
104
- filters: []
104
+ v: 2
105
+ expr:
106
+ node: agg
107
+ event: checkout_completed
108
+ agg:
109
+ kind: count
110
+ filters: []
105
111
  responses:
106
112
  "201":
107
113
  description: Create a metric
@@ -179,10 +185,13 @@
179
185
  eventName: purchase
180
186
  query: sum(purchase, amount)
181
187
  queryIr:
182
- agg: { kind: sum }
183
- metric: purchase
184
- valueLabel: amount
185
- filters: []
188
+ v: 2
189
+ expr:
190
+ node: agg
191
+ event: purchase
192
+ agg: { kind: sum }
193
+ valueLabel: amount
194
+ filters: []
186
195
  direction: higher_better
187
196
  winsorizePct: 99
188
197
  version: 1