@shipeasy/openapi 1.6.0 → 2.2.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-643YSMLU.js +1616 -0
  3. package/dist/chunk-643YSMLU.js.map +1 -0
  4. package/dist/chunk-MRW3DJ57.js +3385 -0
  5. package/dist/chunk-MRW3DJ57.js.map +1 -0
  6. package/dist/client-K0ShmsC7.d.ts +11284 -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 +86 -0
  11. package/dist/custom.js +300 -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 +7973 -0
  20. package/dist/schemas.js +1099 -0
  21. package/dist/schemas.js.map +1 -0
  22. package/openapi.json +15922 -3232
  23. package/openapi.yaml +14277 -0
  24. package/package.json +33 -26
  25. package/spec/components/errors.yaml +53 -0
  26. package/spec/components/parameters.yaml +32 -0
  27. package/spec/components/responses.yaml +122 -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 +92 -0
  31. package/spec/components/schemas/configs.yaml +371 -0
  32. package/spec/components/schemas/connectors.yaml +587 -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 +237 -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 +1013 -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 +367 -0
  47. package/spec/paths/alert-rules.yaml +258 -0
  48. package/spec/paths/attributes.yaml +272 -0
  49. package/spec/paths/configs.yaml +758 -0
  50. package/spec/paths/connectors.yaml +782 -0
  51. package/spec/paths/errors.yaml +382 -0
  52. package/spec/paths/events.yaml +380 -0
  53. package/spec/paths/experiments.yaml +803 -0
  54. package/spec/paths/gate-templates.yaml +267 -0
  55. package/spec/paths/gates.yaml +465 -0
  56. package/spec/paths/i18n.yaml +557 -0
  57. package/spec/paths/keys.yaml +182 -0
  58. package/spec/paths/killswitches.yaml +574 -0
  59. package/spec/paths/metrics.yaml +313 -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 +255 -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,313 @@
1
+ /api/admin/metrics:
2
+ get:
3
+ operationId: listMetrics
4
+ summary: List metrics
5
+ description: |-
6
+ Returns every metric in the project (not paginated) — name, folder, source event, the typed `queryIr`, and the rendered query.
7
+
8
+ **Use case:** Audit every metric defined in the project — for example to find the metric id to attach as an experiment's success metric.
9
+ tags:
10
+ - Metrics
11
+ parameters:
12
+ - $ref: ../components/parameters.yaml#/ProjectId
13
+ - $ref: ../components/parameters.yaml#/Q
14
+ responses:
15
+ "200":
16
+ description: List metrics
17
+ content:
18
+ application/json:
19
+ schema:
20
+ $ref: ../components/schemas/metrics.yaml#/ListMetricsResponse
21
+ example:
22
+ - id: met_01j7w8a1b2c3d4e5f6g7h8i9j0
23
+ name: checkouts
24
+ folder: null
25
+ eventName: checkout_completed
26
+ query: count_users(checkout_completed)
27
+ queryIr:
28
+ agg: { kind: count_users }
29
+ metric: checkout_completed
30
+ filters: []
31
+ direction: higher_better
32
+ "400":
33
+ $ref: ../components/responses.yaml#/BadRequest
34
+ "401":
35
+ $ref: ../components/responses.yaml#/Unauthorized
36
+ "403":
37
+ $ref: ../components/responses.yaml#/Forbidden
38
+ "404":
39
+ $ref: ../components/responses.yaml#/NotFound
40
+ "409":
41
+ $ref: ../components/responses.yaml#/Conflict
42
+ "422":
43
+ $ref: ../components/responses.yaml#/UnprocessableEntity
44
+ x-error-codes:
45
+ - BAD_REQUEST
46
+ - UNAUTHORIZED
47
+ - FORBIDDEN
48
+ x-cli:
49
+ name: list
50
+ post:
51
+ operationId: createMetric
52
+ summary: Create a metric
53
+ description: |-
54
+ Creates an event-backed metric. Pass the query as the DSL string (`query`) **or**
55
+ the typed IR (`query_ir`) — exactly one. `event_name` must equal the event the
56
+ query references.
57
+
58
+ Returns `409` if a metric with the same `name` already exists, and `422` if the
59
+ query is invalid or references an unregistered event / label.
60
+
61
+ **Use cases**
62
+
63
+ - **Track an event** — `count_users(<event>)` for unique-user counts.
64
+ - **Sum a value** — `sum(<event>, <label>)` for revenue / quantity metrics.
65
+ - **Experiment success metric** — create the metric, then attach its id to an experiment.
66
+ tags:
67
+ - Metrics
68
+ parameters:
69
+ - $ref: ../components/parameters.yaml#/ProjectId
70
+ requestBody:
71
+ required: true
72
+ content:
73
+ application/json:
74
+ schema:
75
+ $ref: ../components/schemas/metrics.yaml#/CreateMetricRequest
76
+ examples:
77
+ countUsers:
78
+ summary: Count unique users (DSL)
79
+ description: Unique users who completed checkout, expressed with the query DSL.
80
+ value:
81
+ name: checkouts
82
+ event_name: checkout_completed
83
+ query: count_users(checkout_completed)
84
+ sumRevenue:
85
+ summary: Sum a value label (DSL)
86
+ description: Total revenue, summing the `amount` property of the `purchase` event.
87
+ value:
88
+ name: revenue
89
+ folder: checkout
90
+ event_name: purchase
91
+ query: sum(purchase, amount)
92
+ direction: higher_better
93
+ typedIr:
94
+ summary: Typed IR
95
+ description: Same metric supplied as the structured `query_ir` instead of the DSL.
96
+ value:
97
+ name: checkouts
98
+ event_name: checkout_completed
99
+ query_ir:
100
+ agg:
101
+ kind: count_users
102
+ metric: checkout_completed
103
+ filters: []
104
+ responses:
105
+ "201":
106
+ description: Create a metric
107
+ content:
108
+ application/json:
109
+ schema:
110
+ $ref: ../components/schemas/metrics.yaml#/CreateMetricResponse
111
+ example:
112
+ id: met_01j7w8a1b2c3d4e5f6g7h8i9j0
113
+ name: checkouts
114
+ links:
115
+ GetMetric:
116
+ operationId: getMetric
117
+ parameters: { id: $response.body#/id }
118
+ UpdateMetric:
119
+ operationId: updateMetric
120
+ parameters: { id: $response.body#/id }
121
+ DeleteMetric:
122
+ operationId: deleteMetric
123
+ parameters: { id: $response.body#/id }
124
+ "400":
125
+ $ref: ../components/responses.yaml#/BadRequest
126
+ "401":
127
+ $ref: ../components/responses.yaml#/Unauthorized
128
+ "403":
129
+ $ref: ../components/responses.yaml#/Forbidden
130
+ "404":
131
+ $ref: ../components/responses.yaml#/NotFound
132
+ "409":
133
+ $ref: ../components/responses.yaml#/Conflict
134
+ "422":
135
+ $ref: ../components/responses.yaml#/UnprocessableEntity
136
+ x-error-codes:
137
+ - BAD_REQUEST
138
+ - UNAUTHORIZED
139
+ - FORBIDDEN
140
+ - ALREADY_EXISTS
141
+ - EVENT_PENDING
142
+ - REFERENCED_NOT_FOUND
143
+ - VALIDATION
144
+ x-cli:
145
+ name: create
146
+ positional:
147
+ - name
148
+ /api/admin/metrics/{id}:
149
+ get:
150
+ operationId: getMetric
151
+ summary: Get a metric
152
+ description: |-
153
+ Fetch one metric by its id or name, including the rendered DSL query and the typed IR.
154
+
155
+ **Use case:** Inspect a single metric's full definition before reusing it in an experiment or alert rule.
156
+ tags:
157
+ - Metrics
158
+ parameters:
159
+ - $ref: ../components/parameters.yaml#/ProjectId
160
+ - name: id
161
+ in: path
162
+ required: true
163
+ description: Stable opaque metric id (`met_…`) or the metric's `name`.
164
+ schema:
165
+ $ref: ../components/schemas/common.yaml#/ResourceId
166
+ responses:
167
+ "200":
168
+ description: Get a metric
169
+ content:
170
+ application/json:
171
+ schema:
172
+ $ref: ../components/schemas/metrics.yaml#/GetMetricResponse
173
+ example:
174
+ id: met_01j7w8a1b2c3d4e5f6g7h8i9j0
175
+ name: revenue
176
+ folder: checkout
177
+ eventName: purchase
178
+ query: sum(purchase, amount)
179
+ queryIr:
180
+ agg: { kind: sum }
181
+ metric: purchase
182
+ valueLabel: amount
183
+ filters: []
184
+ direction: higher_better
185
+ winsorizePct: 99
186
+ "400":
187
+ $ref: ../components/responses.yaml#/BadRequest
188
+ "401":
189
+ $ref: ../components/responses.yaml#/Unauthorized
190
+ "403":
191
+ $ref: ../components/responses.yaml#/Forbidden
192
+ "404":
193
+ $ref: ../components/responses.yaml#/NotFound
194
+ "409":
195
+ $ref: ../components/responses.yaml#/Conflict
196
+ "422":
197
+ $ref: ../components/responses.yaml#/UnprocessableEntity
198
+ x-error-codes:
199
+ - BAD_REQUEST
200
+ - UNAUTHORIZED
201
+ - FORBIDDEN
202
+ - NOT_FOUND
203
+ x-cli:
204
+ name: show
205
+ positional:
206
+ - id
207
+ patch:
208
+ operationId: updateMetric
209
+ summary: Update a metric
210
+ description: |-
211
+ Update a metric's definition — folder, source event, query (`query` DSL or typed `query_ir`), winsorisation, minimum detectable effect, or direction. `name` is immutable. Provide at most one of `query` / `query_ir`.
212
+
213
+ **Use case:** Refine a metric's query or guardrail direction without recreating it.
214
+ tags:
215
+ - Metrics
216
+ parameters:
217
+ - $ref: ../components/parameters.yaml#/ProjectId
218
+ - name: id
219
+ in: path
220
+ required: true
221
+ description: Stable opaque metric id (`met_…`) or the metric's `name`.
222
+ schema:
223
+ $ref: ../components/schemas/common.yaml#/ResourceId
224
+ requestBody:
225
+ required: true
226
+ content:
227
+ application/json:
228
+ schema:
229
+ $ref: ../components/schemas/metrics.yaml#/UpdateMetricRequest
230
+ example:
231
+ direction: lower_better
232
+ winsorize_pct: 95
233
+ responses:
234
+ "200":
235
+ description: Update a metric
236
+ content:
237
+ application/json:
238
+ schema:
239
+ $ref: ../components/schemas/metrics.yaml#/GetMetricResponse
240
+ example:
241
+ id: met_01j7w8a1b2c3d4e5f6g7h8i9j0
242
+ name: revenue
243
+ direction: lower_better
244
+ "400":
245
+ $ref: ../components/responses.yaml#/BadRequest
246
+ "401":
247
+ $ref: ../components/responses.yaml#/Unauthorized
248
+ "403":
249
+ $ref: ../components/responses.yaml#/Forbidden
250
+ "404":
251
+ $ref: ../components/responses.yaml#/NotFound
252
+ "409":
253
+ $ref: ../components/responses.yaml#/Conflict
254
+ "422":
255
+ $ref: ../components/responses.yaml#/UnprocessableEntity
256
+ x-error-codes:
257
+ - BAD_REQUEST
258
+ - UNAUTHORIZED
259
+ - FORBIDDEN
260
+ - NOT_FOUND
261
+ - VALIDATION
262
+ x-cli:
263
+ name: update
264
+ positional:
265
+ - id
266
+ delete:
267
+ operationId: deleteMetric
268
+ summary: Archive a metric
269
+ description: |-
270
+ Soft-deletes (archives) the metric. Returns `409` if it is attached to a running experiment — stop those experiments first.
271
+
272
+ **Use case:** Retire a metric once no running experiment depends on it (the user-facing verb is `archive`).
273
+ tags:
274
+ - Metrics
275
+ parameters:
276
+ - $ref: ../components/parameters.yaml#/ProjectId
277
+ - name: id
278
+ in: path
279
+ required: true
280
+ description: Stable opaque metric id (`met_…`) or the metric's `name`.
281
+ schema:
282
+ $ref: ../components/schemas/common.yaml#/ResourceId
283
+ responses:
284
+ "200":
285
+ description: Archive a metric
286
+ content:
287
+ application/json:
288
+ schema:
289
+ $ref: ../components/schemas/metrics.yaml#/DeleteMetricResponse
290
+ example:
291
+ ok: true
292
+ "400":
293
+ $ref: ../components/responses.yaml#/BadRequest
294
+ "401":
295
+ $ref: ../components/responses.yaml#/Unauthorized
296
+ "403":
297
+ $ref: ../components/responses.yaml#/Forbidden
298
+ "404":
299
+ $ref: ../components/responses.yaml#/NotFound
300
+ "409":
301
+ $ref: ../components/responses.yaml#/Conflict
302
+ "422":
303
+ $ref: ../components/responses.yaml#/UnprocessableEntity
304
+ x-error-codes:
305
+ - BAD_REQUEST
306
+ - UNAUTHORIZED
307
+ - FORBIDDEN
308
+ - NOT_FOUND
309
+ - REFERENCED_IN_USE
310
+ x-cli:
311
+ name: archive
312
+ positional:
313
+ - id