@shipeasy/openapi 3.2.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 (39) hide show
  1. package/README.md +1 -1
  2. package/dist/{chunk-RTN572TI.js → chunk-75Z4SQOM.js} +75 -1
  3. package/dist/chunk-75Z4SQOM.js.map +1 -0
  4. package/dist/{chunk-DW33MG4B.js → chunk-ZYK74ZIW.js} +426 -121
  5. package/dist/chunk-ZYK74ZIW.js.map +1 -0
  6. package/dist/{client-BPVn4hMC.d.ts → client-DAGqRpF1.d.ts} +1362 -238
  7. package/dist/client.d.ts +1 -1
  8. package/dist/client.js +19 -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 +20 -2
  14. package/dist/index.js.map +1 -1
  15. package/dist/schemas.d.ts +1648 -907
  16. package/dist/schemas.js +113 -1
  17. package/openapi-sdk.json +31 -9
  18. package/openapi.json +4040 -2083
  19. package/openapi.yaml +1775 -408
  20. package/package.json +1 -1
  21. package/spec/components/schemas/alert-rules.yaml +405 -7
  22. package/spec/components/schemas/alerts.yaml +9 -7
  23. package/spec/components/schemas/common.yaml +2 -2
  24. package/spec/components/schemas/connectors.yaml +69 -6
  25. package/spec/components/schemas/events.yaml +20 -9
  26. package/spec/components/schemas/keys.yaml +30 -0
  27. package/spec/components/schemas/metrics.yaml +131 -251
  28. package/spec/components/schemas/ops.yaml +377 -29
  29. package/spec/components/schemas/projects.yaml +18 -0
  30. package/spec/components/schemas/tags.yaml +91 -0
  31. package/spec/openapi.yaml +43 -0
  32. package/spec/paths/alerts.yaml +5 -3
  33. package/spec/paths/i18n.yaml +2 -1
  34. package/spec/paths/keys.yaml +79 -0
  35. package/spec/paths/metrics.yaml +26 -17
  36. package/spec/paths/ops.yaml +388 -11
  37. package/spec/paths/tags.yaml +270 -0
  38. package/dist/chunk-DW33MG4B.js.map +0 -1
  39. package/dist/chunk-RTN572TI.js.map +0 -1
@@ -186,252 +186,38 @@ GetMetricResponse:
186
186
  additionalProperties: {}
187
187
  description: A metric definition.
188
188
  QueryIr:
189
- description: Typed query IR — the structured alternative to the `query` DSL string. Exactly one of `query` / `query_ir` is supplied per metric body.
189
+ description: >-
190
+ A metric definition as a typed expression tree — the structured alternative
191
+ to the `query` DSL string, and what the API stores. Exactly one of `query` /
192
+ `query_ir` is supplied per metric body; `query` is the same definition
193
+ written as text, and is the spelling to prefer.
194
+
195
+ Until 2026-08-10 this documented a single aggregation (`{agg, metric,
196
+ filters}`, with `ratio` as a special case). That shape no longer exists —
197
+ stored metrics were migrated and the code that read it was deleted — so a
198
+ body sending it is rejected. Send the `query` string instead, or the tree
199
+ below.
190
200
  type: object
191
201
  properties:
192
- agg:
193
- oneOf:
194
- - type: object
195
- properties:
196
- kind:
197
- type: string
198
- const: count_users
199
- required:
200
- - kind
201
- additionalProperties: false
202
- - type: object
203
- properties:
204
- kind:
205
- type: string
206
- const: count_events
207
- required:
208
- - kind
209
- additionalProperties: false
210
- - type: object
211
- properties:
212
- kind:
213
- type: string
214
- const: sum
215
- required:
216
- - kind
217
- additionalProperties: false
218
- - type: object
219
- properties:
220
- kind:
221
- type: string
222
- const: avg
223
- required:
224
- - kind
225
- additionalProperties: false
226
- - type: object
227
- properties:
228
- kind:
229
- type: string
230
- const: min
231
- required:
232
- - kind
233
- additionalProperties: false
234
- - type: object
235
- properties:
236
- kind:
237
- type: string
238
- const: max
239
- required:
240
- - kind
241
- additionalProperties: false
242
- - type: object
243
- properties:
244
- kind:
245
- type: string
246
- const: unique
247
- required:
248
- - kind
249
- additionalProperties: false
250
- - type: object
251
- properties:
252
- kind:
253
- type: string
254
- const: quantile
255
- p:
256
- anyOf:
257
- - type: number
258
- const: 0.5
259
- - type: number
260
- const: 0.75
261
- - type: number
262
- const: 0.9
263
- - type: number
264
- const: 0.95
265
- - type: number
266
- const: 0.99
267
- - type: number
268
- const: 0.999
269
- description: Quantile fraction (0.5 = p50 … 0.999 = p999).
270
- required:
271
- - kind
272
- - p
273
- additionalProperties: false
274
- - type: object
275
- properties:
276
- kind:
277
- type: string
278
- const: retention_Nd
279
- n:
280
- type: integer
281
- minimum: 1
282
- maximum: 90
283
- description: Retention window in days (1–90).
284
- required:
285
- - kind
286
- - n
287
- additionalProperties: false
288
- - type: object
289
- properties:
290
- kind:
291
- type: string
292
- const: ratio
293
- numerator:
294
- type: object
295
- properties:
296
- agg:
297
- type: string
298
- enum:
299
- - count_users
300
- - count_events
301
- description: Counting mode for this ratio arm.
302
- metric:
303
- type: string
304
- minLength: 1
305
- maxLength: 128
306
- description: Source event name for this ratio arm.
307
- filters:
308
- description: Optional label filters.
309
- maxItems: 16
310
- type: array
311
- items:
312
- type: object
313
- properties:
314
- label:
315
- type: string
316
- pattern: ^[a-z_][a-z0-9_]{0,63}$
317
- description: Event property / label identifier.
318
- op:
319
- type: string
320
- enum:
321
- - =
322
- - "!="
323
- - =~
324
- - "!~"
325
- description: Match operator (`=~`/`!~` are regex).
326
- value:
327
- type: string
328
- maxLength: 512
329
- description: Quoted filter value (coerced for numeric labels).
330
- required:
331
- - label
332
- - op
333
- - value
334
- additionalProperties: false
335
- description: One label filter on the source event.
336
- required:
337
- - agg
338
- - metric
339
- additionalProperties: false
340
- description: Numerator or denominator arm of a `ratio` aggregation.
341
- denominator:
342
- type: object
343
- properties:
344
- agg:
345
- type: string
346
- enum:
347
- - count_users
348
- - count_events
349
- description: Counting mode for this ratio arm.
350
- metric:
351
- type: string
352
- minLength: 1
353
- maxLength: 128
354
- description: Source event name for this ratio arm.
355
- filters:
356
- description: Optional label filters.
357
- maxItems: 16
358
- type: array
359
- items:
360
- type: object
361
- properties:
362
- label:
363
- type: string
364
- pattern: ^[a-z_][a-z0-9_]{0,63}$
365
- description: Event property / label identifier.
366
- op:
367
- type: string
368
- enum:
369
- - =
370
- - "!="
371
- - =~
372
- - "!~"
373
- description: Match operator (`=~`/`!~` are regex).
374
- value:
375
- type: string
376
- maxLength: 512
377
- description: Quoted filter value (coerced for numeric labels).
378
- required:
379
- - label
380
- - op
381
- - value
382
- additionalProperties: false
383
- description: One label filter on the source event.
384
- required:
385
- - agg
386
- - metric
387
- additionalProperties: false
388
- description: Numerator or denominator arm of a `ratio` aggregation.
389
- required:
390
- - kind
391
- - numerator
392
- - denominator
393
- additionalProperties: false
394
- description: Aggregation function applied to the source event.
395
- metric:
396
- type: string
397
- minLength: 1
398
- maxLength: 128
399
- description: Source event name (must equal `event_name`).
400
- valueLabel:
401
- description: Numeric property summed/averaged for `sum`/`avg`/quantile aggregations.
402
- type: string
403
- minLength: 1
404
- maxLength: 128
405
- filters:
406
- default: []
407
- description: Label filters on the event.
408
- maxItems: 16
409
- type: array
410
- items:
411
- type: object
412
- properties:
413
- label:
414
- type: string
415
- pattern: ^[a-z_][a-z0-9_]{0,63}$
416
- description: Event property / label identifier.
417
- op:
418
- type: string
419
- enum:
420
- - =
421
- - "!="
422
- - =~
423
- - "!~"
424
- description: Match operator (`=~`/`!~` are regex).
425
- value:
426
- type: string
427
- maxLength: 512
428
- description: Quoted filter value (coerced for numeric labels).
429
- required:
430
- - label
431
- - op
432
- - value
433
- additionalProperties: false
434
- description: One label filter on the source event.
202
+ v:
203
+ type: integer
204
+ const: 2
205
+ description: Storage version of the definition. `2` is the only one.
206
+ expr:
207
+ type: object
208
+ additionalProperties: true
209
+ description: >-
210
+ The expression tree: aggregate leaves (`{node: "agg", event, agg,
211
+ filters, valueLabel?}`), arithmetic over them (`{node: "binary", op,
212
+ left, right}`), scalars, and function calls (`{node: "call", fn, arg,
213
+ params?}`). A ratio is ordinary division of two leaves.
214
+
215
+ Deliberately opaque here rather than mirrored node by node: the grammar
216
+ belongs to the query language, a second copy of it in this spec would
217
+ drift from the one the server enforces, and the server validates every
218
+ tree by planning it before the metric saves. `GET /api/admin/metrics`
219
+ returns the grammar itself; the `query` string is the same tree in the
220
+ form humans and the CLI write.
435
221
  groupBy:
436
222
  type: object
437
223
  properties:
@@ -440,23 +226,27 @@ QueryIr:
440
226
  enum:
441
227
  - by
442
228
  - without
443
- description: "`by` keeps the listed labels; `without` drops them."
229
+ description: "`by` names the output dimensions; `without` names the ones to drop."
444
230
  labels:
445
- maxItems: 5
446
231
  type: array
232
+ maxItems: 8
447
233
  items:
448
234
  type: string
449
235
  pattern: ^[a-z_][a-z0-9_]{0,63}$
450
236
  description: Event property / label identifier.
451
- description: Labels to group by (max 5).
237
+ description: Labels the grouping names.
452
238
  required:
453
239
  - op
454
240
  - labels
455
241
  additionalProperties: false
456
- description: Optional group-by clause (ignored for experiment analysis).
242
+ description: >-
243
+ How the series is split. On the envelope rather than in `expr` because
244
+ every leaf of one expression shares it.
245
+ display:
246
+ $ref: "#/MetricDisplayConfig"
457
247
  required:
458
- - agg
459
- - metric
248
+ - v
249
+ - expr
460
250
  additionalProperties: false
461
251
  MetricEventName:
462
252
  type: string
@@ -492,6 +282,68 @@ MetricDisplayUnit:
492
282
  anyOf:
493
283
  - type: string
494
284
  - type: "null"
285
+ MetricDisplayName:
286
+ description: >-
287
+ What a human calls the metric — "Checkout revenue" beside the
288
+ `checkout.revenue` that identifies it. Unlike `name` it is free text, it is
289
+ editable, and nothing addresses the metric by it: the dashboard leads with it
290
+ and falls back to `name` when it is absent, so a metric nobody named simply
291
+ reads as its key. Send `null` to clear it.
292
+ maxLength: 200
293
+ anyOf:
294
+ - type: string
295
+ - type: "null"
296
+ MetricDisplayConfig:
297
+ description: >-
298
+ How the metric's series is DRAWN, as opposed to what it measures. Both parts
299
+ used to be DSL functions (`expected(q, seasonal)`, `forecast(q, …)`), which
300
+ meant turning a band on minted a different metric; they are properties now,
301
+ so every chart of the metric picks them up and nothing that JUDGES the metric
302
+ — an alert rule, the experiment analyzer — reads them at all.
303
+ type: object
304
+ properties:
305
+ band:
306
+ description: >-
307
+ Shade the seasonal baseline around the series. The fit is the median of
308
+ this hour of the week over the four weeks before the window, and it is
309
+ the SAME fit an `anomaly` alert rule fires on — so the shaded region is
310
+ exactly where such a rule would stay quiet, whether or not one exists.
311
+ type: object
312
+ properties:
313
+ method:
314
+ type: string
315
+ enum:
316
+ - seasonal
317
+ sigma:
318
+ type: number
319
+ exclusiveMinimum: 0
320
+ description: Half-width of the band in sigma-equivalents. Omit for 3, the sigma an alert rule also defaults to.
321
+ required:
322
+ - method
323
+ additionalProperties: false
324
+ forecast:
325
+ description: Project the series past the end of the window. Projected buckets are marked, so a chart can draw an estimate differently from a measurement.
326
+ type: object
327
+ properties:
328
+ method:
329
+ type: string
330
+ enum:
331
+ - linear
332
+ - seasonal
333
+ description: >-
334
+ `linear` continues a least-squares slope over the window it is
335
+ already reading. `seasonal` de-seasonalises against the four weeks
336
+ before the window, fits the trend on the remainder and adds the
337
+ hour-of-week term back — ask for it when the metric has a shape.
338
+ horizon:
339
+ type: integer
340
+ minimum: 1
341
+ maximum: 500
342
+ description: Buckets to project. Omit for a quarter of the window, which is the same claim at every bucket width.
343
+ required:
344
+ - method
345
+ additionalProperties: false
346
+ additionalProperties: false
495
347
  CreateMetricRequest:
496
348
  oneOf:
497
349
  - $ref: "#/CreateMetricWithQuery"
@@ -502,6 +354,8 @@ CreateMetricWithQuery:
502
354
  properties:
503
355
  name:
504
356
  $ref: ./common.yaml#/MetricName
357
+ display_name:
358
+ $ref: "#/MetricDisplayName"
505
359
  folder:
506
360
  $ref: ./common.yaml#/Folder
507
361
  event_name:
@@ -516,6 +370,8 @@ CreateMetricWithQuery:
516
370
  $ref: "#/MetricDirection"
517
371
  unit:
518
372
  $ref: "#/MetricDisplayUnit"
373
+ display:
374
+ $ref: "#/MetricDisplayConfig"
519
375
  required:
520
376
  - name
521
377
  - event_name
@@ -527,6 +383,8 @@ CreateMetricWithQueryIr:
527
383
  properties:
528
384
  name:
529
385
  $ref: ./common.yaml#/MetricName
386
+ display_name:
387
+ $ref: "#/MetricDisplayName"
530
388
  folder:
531
389
  $ref: ./common.yaml#/Folder
532
390
  event_name:
@@ -541,6 +399,8 @@ CreateMetricWithQueryIr:
541
399
  $ref: "#/MetricDirection"
542
400
  unit:
543
401
  $ref: "#/MetricDisplayUnit"
402
+ display:
403
+ $ref: "#/MetricDisplayConfig"
544
404
  required:
545
405
  - name
546
406
  - event_name
@@ -556,6 +416,8 @@ UpdateMetricRequest:
556
416
  UpdateMetricWithQuery:
557
417
  type: object
558
418
  properties:
419
+ display_name:
420
+ $ref: "#/MetricDisplayName"
559
421
  folder:
560
422
  $ref: ./common.yaml#/Folder
561
423
  event_name:
@@ -570,6 +432,8 @@ UpdateMetricWithQuery:
570
432
  $ref: "#/MetricDirection"
571
433
  unit:
572
434
  $ref: "#/MetricDisplayUnit"
435
+ display:
436
+ $ref: "#/MetricDisplayConfig"
573
437
  required:
574
438
  - query
575
439
  additionalProperties: false
@@ -577,6 +441,8 @@ UpdateMetricWithQuery:
577
441
  UpdateMetricWithQueryIr:
578
442
  type: object
579
443
  properties:
444
+ display_name:
445
+ $ref: "#/MetricDisplayName"
580
446
  folder:
581
447
  $ref: ./common.yaml#/Folder
582
448
  event_name:
@@ -591,6 +457,8 @@ UpdateMetricWithQueryIr:
591
457
  $ref: "#/MetricDirection"
592
458
  unit:
593
459
  $ref: "#/MetricDisplayUnit"
460
+ display:
461
+ $ref: "#/MetricDisplayConfig"
594
462
  required:
595
463
  - query_ir
596
464
  additionalProperties: false
@@ -598,6 +466,8 @@ UpdateMetricWithQueryIr:
598
466
  UpdateMetricFields:
599
467
  type: object
600
468
  properties:
469
+ display_name:
470
+ $ref: "#/MetricDisplayName"
601
471
  folder:
602
472
  $ref: ./common.yaml#/Folder
603
473
  event_name:
@@ -610,8 +480,10 @@ UpdateMetricFields:
610
480
  $ref: "#/MetricDirection"
611
481
  unit:
612
482
  $ref: "#/MetricDisplayUnit"
483
+ display:
484
+ $ref: "#/MetricDisplayConfig"
613
485
  additionalProperties: false
614
- description: Update-metric variant that leaves the query untouched (metadata-only edit — folder, event, winsorisation, default minimum effect of interest, direction, display unit).
486
+ description: Update-metric variant that leaves the query untouched (metadata-only edit — folder, event, winsorisation, default minimum effect of interest, direction, display unit, band and projection).
615
487
  CreateMetricResponse:
616
488
  type: object
617
489
  properties:
@@ -729,6 +601,14 @@ GetMetricSeriesResponse:
729
601
  v:
730
602
  type: number
731
603
  description: Aggregated metric value in the bucket (sample-interval weighted).
604
+ lo:
605
+ type: number
606
+ description: |
607
+ Lower edge of the seasonal band — what this hour of the week normally holds, `sigma` below the median of the four weeks before the window. Present only for a metric whose `display.band` is on, and always alongside `hi`.
608
+ hi:
609
+ type: number
610
+ description: |
611
+ Upper edge of the seasonal band. Present only for a metric whose `display.band` is on, and always alongside `lo`. A point outside `[lo, hi]` is exactly a bucket an `anomaly` alert rule at the same sigma would breach on — the band a chart draws and the condition a rule fires on come from one fit.
732
612
  required:
733
613
  - t
734
614
  - v