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