@shipeasy/openapi 2.3.0 → 2.5.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 (46) hide show
  1. package/dist/{chunk-PRN4AEAM.js → chunk-DBTSD3W5.js} +1085 -261
  2. package/dist/chunk-DBTSD3W5.js.map +1 -0
  3. package/dist/{chunk-LYNWK55D.js → chunk-RDMD5XQT.js} +171 -1
  4. package/dist/chunk-RDMD5XQT.js.map +1 -0
  5. package/dist/{client-DO5HTb_L.d.ts → client-ObcuFHaV.d.ts} +5605 -2734
  6. package/dist/client.d.ts +1 -1
  7. package/dist/client.js +47 -1
  8. package/dist/custom.d.ts +9 -4
  9. package/dist/custom.js +57 -9
  10. package/dist/custom.js.map +1 -1
  11. package/dist/index.d.ts +2 -2
  12. package/dist/index.js +48 -2
  13. package/dist/index.js.map +1 -1
  14. package/dist/schemas.d.ts +3171 -485
  15. package/dist/schemas.js +229 -1
  16. package/openapi.json +13264 -8071
  17. package/openapi.yaml +5108 -1550
  18. package/package.json +1 -1
  19. package/spec/components/errors.yaml +3 -0
  20. package/spec/components/schemas/alerts.yaml +138 -0
  21. package/spec/components/schemas/attributes.yaml +53 -3
  22. package/spec/components/schemas/common.yaml +10 -0
  23. package/spec/components/schemas/configs.yaml +91 -3
  24. package/spec/components/schemas/connectors.yaml +5 -1
  25. package/spec/components/schemas/errors-api.yaml +51 -4
  26. package/spec/components/schemas/experiments.yaml +347 -87
  27. package/spec/components/schemas/gates.yaml +350 -277
  28. package/spec/components/schemas/i18n.yaml +169 -40
  29. package/spec/components/schemas/killswitches.yaml +36 -0
  30. package/spec/components/schemas/metrics.yaml +199 -7
  31. package/spec/components/schemas/ops.yaml +961 -29
  32. package/spec/components/schemas/projects.yaml +129 -3
  33. package/spec/openapi.yaml +58 -0
  34. package/spec/paths/alerts.yaml +184 -0
  35. package/spec/paths/attributes.yaml +23 -5
  36. package/spec/paths/configs.yaml +98 -21
  37. package/spec/paths/errors.yaml +16 -0
  38. package/spec/paths/experiments.yaml +236 -16
  39. package/spec/paths/gates.yaml +137 -0
  40. package/spec/paths/i18n.yaml +290 -6
  41. package/spec/paths/killswitches.yaml +6 -0
  42. package/spec/paths/metrics.yaml +186 -0
  43. package/spec/paths/ops.yaml +382 -0
  44. package/spec/paths/projects.yaml +60 -0
  45. package/dist/chunk-LYNWK55D.js.map +0 -1
  46. package/dist/chunk-PRN4AEAM.js.map +0 -1
@@ -20,9 +20,9 @@
20
20
  example:
21
21
  - id: i18n_01j7w8a1b2c3
22
22
  name: en:prod
23
- locales:
24
- - en
25
- default_locale: en
23
+ isDefault: 1
24
+ createdAt: 2026-04-12T10:14:08.000Z
25
+ deletedAt: null
26
26
  "400":
27
27
  $ref: ../components/responses.yaml#/BadRequest
28
28
  "401":
@@ -60,9 +60,6 @@
60
60
  $ref: ../components/schemas/i18n.yaml#/CreateI18nProfileRequest
61
61
  example:
62
62
  name: fr:prod
63
- locales:
64
- - fr
65
- default_locale: fr
66
63
  responses:
67
64
  "201":
68
65
  description: Create an i18n profile
@@ -229,6 +226,58 @@
229
226
  - VALIDATION
230
227
  x-cli:
231
228
  name: push
229
+ put:
230
+ operationId: upsertI18nKeys
231
+ summary: Bulk upsert i18n keys (overwrite)
232
+ description: |-
233
+ Bulk upsert keys into a profile — existing keys ARE overwritten, new ones inserted. The profile's KV snapshot is rebuilt and the CDN purged before the call returns, so the edits go live on their own.
234
+
235
+ This is the overwrite counterpart of the insert-only `pushI18nKeys`. It backs the devtools overlay's in-product "Apply changes" label editing and is deliberately not surfaced by the CLI or MCP — those surfaces only expose the insert-only push so a whole `en.json` can't wholesale-overwrite prod.
236
+
237
+ **Use case:** Apply a batch of in-product label edits (devtools overlay) in one call.
238
+ tags:
239
+ - Keys
240
+ parameters:
241
+ - $ref: ../components/parameters.yaml#/ProjectId
242
+ requestBody:
243
+ required: true
244
+ content:
245
+ application/json:
246
+ schema:
247
+ $ref: ../components/schemas/i18n.yaml#/UpsertI18nKeysRequest
248
+ example:
249
+ profile_id: 3f1a6c2e-1b2c-4d5e-8f90-0a1b2c3d4e5f
250
+ keys:
251
+ - key: checkout.cta
252
+ value: Buy it now
253
+ responses:
254
+ "200":
255
+ description: Bulk upsert i18n keys (overwrite)
256
+ content:
257
+ application/json:
258
+ schema:
259
+ $ref: ../components/schemas/i18n.yaml#/UpsertI18nKeysResponse
260
+ example:
261
+ upserted: 1
262
+ chunk: default
263
+ "400":
264
+ $ref: ../components/responses.yaml#/BadRequest
265
+ "401":
266
+ $ref: ../components/responses.yaml#/Unauthorized
267
+ "403":
268
+ $ref: ../components/responses.yaml#/Forbidden
269
+ "404":
270
+ $ref: ../components/responses.yaml#/NotFound
271
+ "409":
272
+ $ref: ../components/responses.yaml#/Conflict
273
+ "422":
274
+ $ref: ../components/responses.yaml#/UnprocessableEntity
275
+ x-error-codes:
276
+ - BAD_REQUEST
277
+ - UNAUTHORIZED
278
+ - FORBIDDEN
279
+ - NOT_FOUND
280
+ - VALIDATION
232
281
  /api/admin/i18n/keys/{id}:
233
282
  put:
234
283
  operationId: updateI18nKey
@@ -288,6 +337,94 @@
288
337
  name: update
289
338
  positional:
290
339
  - id
340
+ delete:
341
+ operationId: deleteI18nKey
342
+ summary: Delete one i18n key
343
+ description: |-
344
+ Permanently delete a single key from its profile. The profile's KV snapshot is rebuilt and the CDN purged as part of this call, so the removal goes live on its own.
345
+
346
+ **Use case:** Remove a stale or mistakenly-pushed key without touching the rest of the profile.
347
+ tags:
348
+ - Keys
349
+ parameters:
350
+ - $ref: ../components/parameters.yaml#/ProjectId
351
+ - name: id
352
+ in: path
353
+ required: true
354
+ description: The key's id.
355
+ schema:
356
+ $ref: ../components/schemas/common.yaml#/ResourceId
357
+ responses:
358
+ "200":
359
+ description: Delete one i18n key
360
+ content:
361
+ application/json:
362
+ schema:
363
+ $ref: ../components/schemas/i18n.yaml#/DeleteI18nKeyResponse
364
+ example:
365
+ ok: true
366
+ "400":
367
+ $ref: ../components/responses.yaml#/BadRequest
368
+ "401":
369
+ $ref: ../components/responses.yaml#/Unauthorized
370
+ "403":
371
+ $ref: ../components/responses.yaml#/Forbidden
372
+ "404":
373
+ $ref: ../components/responses.yaml#/NotFound
374
+ "409":
375
+ $ref: ../components/responses.yaml#/Conflict
376
+ "422":
377
+ $ref: ../components/responses.yaml#/UnprocessableEntity
378
+ x-error-codes:
379
+ - BAD_REQUEST
380
+ - UNAUTHORIZED
381
+ - FORBIDDEN
382
+ - NOT_FOUND
383
+ /api/admin/i18n/profiles/{profileId}:
384
+ delete:
385
+ operationId: deleteI18nProfile
386
+ summary: Delete an i18n profile
387
+ description: |-
388
+ Soft-delete a locale profile. The project's default profile cannot be deleted (409). The profile's keys are retained in the database but the profile no longer resolves for listing or publishing.
389
+
390
+ **Use case:** Retire a locale that is no longer shipped.
391
+ tags:
392
+ - Profiles
393
+ parameters:
394
+ - $ref: ../components/parameters.yaml#/ProjectId
395
+ - name: profileId
396
+ in: path
397
+ required: true
398
+ description: The profile id to delete.
399
+ schema:
400
+ $ref: ../components/schemas/common.yaml#/ResourceId
401
+ responses:
402
+ "200":
403
+ description: Delete an i18n profile
404
+ content:
405
+ application/json:
406
+ schema:
407
+ $ref: ../components/schemas/i18n.yaml#/DeleteI18nProfileResponse
408
+ example:
409
+ ok: true
410
+ "400":
411
+ $ref: ../components/responses.yaml#/BadRequest
412
+ "401":
413
+ $ref: ../components/responses.yaml#/Unauthorized
414
+ "403":
415
+ $ref: ../components/responses.yaml#/Forbidden
416
+ "404":
417
+ $ref: ../components/responses.yaml#/NotFound
418
+ "409":
419
+ $ref: ../components/responses.yaml#/Conflict
420
+ "422":
421
+ $ref: ../components/responses.yaml#/UnprocessableEntity
422
+ x-error-codes:
423
+ - BAD_REQUEST
424
+ - UNAUTHORIZED
425
+ - FORBIDDEN
426
+ - NOT_FOUND
427
+ - READ_ONLY
291
428
  /api/admin/i18n/drafts:
292
429
  get:
293
430
  operationId: listI18nDrafts
@@ -437,6 +574,153 @@
437
574
  name: update
438
575
  positional:
439
576
  - draftId
577
+ delete:
578
+ operationId: deleteI18nDraft
579
+ summary: Delete a translation draft
580
+ description: |-
581
+ Permanently delete a staged translation draft. Its staged keys are removed with it; the target profile's live keys are untouched.
582
+
583
+ **Use case:** Discard a draft that will never ship instead of leaving it abandoned.
584
+ tags:
585
+ - Drafts
586
+ parameters:
587
+ - $ref: ../components/parameters.yaml#/ProjectId
588
+ - name: draftId
589
+ in: path
590
+ required: true
591
+ description: The draft id to delete.
592
+ schema:
593
+ $ref: ../components/schemas/common.yaml#/ResourceId
594
+ responses:
595
+ "200":
596
+ description: Delete a translation draft
597
+ content:
598
+ application/json:
599
+ schema:
600
+ $ref: ../components/schemas/i18n.yaml#/DeleteI18nDraftResponse
601
+ example:
602
+ ok: true
603
+ "400":
604
+ $ref: ../components/responses.yaml#/BadRequest
605
+ "401":
606
+ $ref: ../components/responses.yaml#/Unauthorized
607
+ "403":
608
+ $ref: ../components/responses.yaml#/Forbidden
609
+ "404":
610
+ $ref: ../components/responses.yaml#/NotFound
611
+ "409":
612
+ $ref: ../components/responses.yaml#/Conflict
613
+ "422":
614
+ $ref: ../components/responses.yaml#/UnprocessableEntity
615
+ x-error-codes:
616
+ - BAD_REQUEST
617
+ - UNAUTHORIZED
618
+ - FORBIDDEN
619
+ - NOT_FOUND
620
+ /api/admin/i18n/drafts/{draftId}/keys:
621
+ get:
622
+ operationId: listI18nDraftKeys
623
+ summary: List a draft's staged keys
624
+ description: |-
625
+ Returns every staged key in a translation draft — the values queued to ship when the draft is merged.
626
+
627
+ **Use case:** Review a machine-translation draft's staged strings before marking it merged.
628
+ tags:
629
+ - Drafts
630
+ parameters:
631
+ - $ref: ../components/parameters.yaml#/ProjectId
632
+ - name: draftId
633
+ in: path
634
+ required: true
635
+ description: The draft id to list staged keys for.
636
+ schema:
637
+ $ref: ../components/schemas/common.yaml#/ResourceId
638
+ responses:
639
+ "200":
640
+ description: List a draft's staged keys
641
+ content:
642
+ application/json:
643
+ schema:
644
+ $ref: ../components/schemas/i18n.yaml#/ListI18nDraftKeysResponse
645
+ example:
646
+ - id: dk_01j7
647
+ draftId: draft_01j7
648
+ key: checkout.cta
649
+ value: Achetez maintenant
650
+ description: null
651
+ variables: null
652
+ updatedBy: owner@acme.com
653
+ updatedAt: 2026-07-01T10:14:08.000Z
654
+ "400":
655
+ $ref: ../components/responses.yaml#/BadRequest
656
+ "401":
657
+ $ref: ../components/responses.yaml#/Unauthorized
658
+ "403":
659
+ $ref: ../components/responses.yaml#/Forbidden
660
+ "404":
661
+ $ref: ../components/responses.yaml#/NotFound
662
+ "409":
663
+ $ref: ../components/responses.yaml#/Conflict
664
+ "422":
665
+ $ref: ../components/responses.yaml#/UnprocessableEntity
666
+ x-error-codes:
667
+ - BAD_REQUEST
668
+ - UNAUTHORIZED
669
+ - FORBIDDEN
670
+ - NOT_FOUND
671
+ post:
672
+ operationId: upsertI18nDraftKey
673
+ summary: Upsert one staged draft key
674
+ description: |-
675
+ Upsert a single staged key into an **open** draft — inserted when new, overwritten when it already exists. A draft that is `merged` or `abandoned` rejects the write (400). `{{var}}` placeholder names are auto-derived from the value.
676
+
677
+ **Use case:** Stage or correct one translation in a draft under review without touching the live profile.
678
+ tags:
679
+ - Drafts
680
+ parameters:
681
+ - $ref: ../components/parameters.yaml#/ProjectId
682
+ - name: draftId
683
+ in: path
684
+ required: true
685
+ description: The draft id to stage the key into.
686
+ schema:
687
+ $ref: ../components/schemas/common.yaml#/ResourceId
688
+ requestBody:
689
+ required: true
690
+ content:
691
+ application/json:
692
+ schema:
693
+ $ref: ../components/schemas/i18n.yaml#/UpsertI18nDraftKeyRequest
694
+ example:
695
+ key: checkout.cta
696
+ value: Achetez maintenant
697
+ responses:
698
+ "201":
699
+ description: Upsert one staged draft key
700
+ content:
701
+ application/json:
702
+ schema:
703
+ $ref: ../components/schemas/i18n.yaml#/UpsertI18nDraftKeyResponse
704
+ example:
705
+ ok: true
706
+ "400":
707
+ $ref: ../components/responses.yaml#/BadRequest
708
+ "401":
709
+ $ref: ../components/responses.yaml#/Unauthorized
710
+ "403":
711
+ $ref: ../components/responses.yaml#/Forbidden
712
+ "404":
713
+ $ref: ../components/responses.yaml#/NotFound
714
+ "409":
715
+ $ref: ../components/responses.yaml#/Conflict
716
+ "422":
717
+ $ref: ../components/responses.yaml#/UnprocessableEntity
718
+ x-error-codes:
719
+ - BAD_REQUEST
720
+ - UNAUTHORIZED
721
+ - FORBIDDEN
722
+ - NOT_FOUND
723
+ - VALIDATION
440
724
  /api/admin/i18n/profiles/{profileId}/publish:
441
725
  post:
442
726
  operationId: publishI18nProfile
@@ -25,6 +25,9 @@
25
25
  - id: ksw_01j7w9d8h2k4m6n8p0q2r4s6t8
26
26
  name: payments.checkout
27
27
  description: Master kill for the checkout flow. Trip to fall back to the legacy provider.
28
+ folder: payments
29
+ creatorEmail: ana@example.com
30
+ createdAt: 2026-05-01T10:12:00.000Z
28
31
  updatedAt: 2026-05-09T18:22:11.000Z
29
32
  envs:
30
33
  dev:
@@ -183,6 +186,9 @@
183
186
  id: ksw_01j7w9d8h2k4m6n8p0q2r4s6t8
184
187
  name: payments.checkout
185
188
  description: Master kill for the checkout flow. Trip to fall back to the legacy provider.
189
+ folder: payments
190
+ creatorEmail: ana@example.com
191
+ createdAt: 2026-05-01T10:12:00.000Z
186
192
  updatedAt: 2026-05-09T18:22:11.000Z
187
193
  envs:
188
194
  dev:
@@ -29,6 +29,7 @@
29
29
  metric: checkout_completed
30
30
  filters: []
31
31
  direction: higher_better
32
+ version: 1
32
33
  "400":
33
34
  $ref: ../components/responses.yaml#/BadRequest
34
35
  "401":
@@ -184,6 +185,7 @@
184
185
  filters: []
185
186
  direction: higher_better
186
187
  winsorizePct: 99
188
+ version: 1
187
189
  "400":
188
190
  $ref: ../components/responses.yaml#/BadRequest
189
191
  "401":
@@ -312,3 +314,187 @@
312
314
  name: archive
313
315
  positional:
314
316
  - id
317
+ /api/admin/metrics/{id}/experiments:
318
+ get:
319
+ operationId: listMetricExperiments
320
+ summary: List experiments using a metric
321
+ description: |-
322
+ Returns every experiment that attaches this metric — as `goal`, `guardrail`, or `secondary` — ordered with running experiments first, then by role weight (goal > guardrail > secondary).
323
+
324
+ **Use case:** See who depends on a metric before editing or archiving it — e.g. the metric detail panel's "used by" list.
325
+ tags:
326
+ - Metrics
327
+ parameters:
328
+ - $ref: ../components/parameters.yaml#/ProjectId
329
+ - name: id
330
+ in: path
331
+ required: true
332
+ description: Stable opaque metric id (`met_…`) or the metric's `name`.
333
+ schema:
334
+ $ref: ../components/schemas/common.yaml#/ResourceId
335
+ responses:
336
+ "200":
337
+ description: List experiments using a metric
338
+ content:
339
+ application/json:
340
+ schema:
341
+ $ref: ../components/schemas/metrics.yaml#/ListMetricExperimentsResponse
342
+ example:
343
+ experiments:
344
+ - id: exp_01j7wb12c3d4e5f6g7h8j9k0l1
345
+ name: checkout_button_color
346
+ status: running
347
+ role: goal
348
+ - id: exp_01j7wb98x7y6z5w4v3u2t1s0r9
349
+ name: pricing_page_copy
350
+ status: stopped
351
+ role: guardrail
352
+ "400":
353
+ $ref: ../components/responses.yaml#/BadRequest
354
+ "401":
355
+ $ref: ../components/responses.yaml#/Unauthorized
356
+ "403":
357
+ $ref: ../components/responses.yaml#/Forbidden
358
+ "404":
359
+ $ref: ../components/responses.yaml#/NotFound
360
+ "409":
361
+ $ref: ../components/responses.yaml#/Conflict
362
+ "422":
363
+ $ref: ../components/responses.yaml#/UnprocessableEntity
364
+ x-error-codes:
365
+ - BAD_REQUEST
366
+ - UNAUTHORIZED
367
+ - FORBIDDEN
368
+ - NOT_FOUND
369
+ x-cli:
370
+ name: experiments
371
+ positional:
372
+ - id
373
+ /api/admin/metrics/{id}/unarchive:
374
+ post:
375
+ operationId: unarchiveMetric
376
+ summary: Unarchive a metric
377
+ description: |-
378
+ Reverses a soft-delete (archive), making the metric live again. Idempotent — unarchiving a metric that is already live succeeds with no effect.
379
+
380
+ **Use case:** Undo an accidental archive (the metrics list "Undo" toast calls this).
381
+ tags:
382
+ - Metrics
383
+ parameters:
384
+ - $ref: ../components/parameters.yaml#/ProjectId
385
+ - name: id
386
+ in: path
387
+ required: true
388
+ description: Stable opaque metric id (`met_…`) or the metric's `name`.
389
+ schema:
390
+ $ref: ../components/schemas/common.yaml#/ResourceId
391
+ responses:
392
+ "200":
393
+ description: Unarchive a metric
394
+ content:
395
+ application/json:
396
+ schema:
397
+ $ref: ../components/schemas/metrics.yaml#/UnarchiveMetricResponse
398
+ example:
399
+ ok: true
400
+ "400":
401
+ $ref: ../components/responses.yaml#/BadRequest
402
+ "401":
403
+ $ref: ../components/responses.yaml#/Unauthorized
404
+ "403":
405
+ $ref: ../components/responses.yaml#/Forbidden
406
+ "404":
407
+ $ref: ../components/responses.yaml#/NotFound
408
+ "409":
409
+ $ref: ../components/responses.yaml#/Conflict
410
+ "422":
411
+ $ref: ../components/responses.yaml#/UnprocessableEntity
412
+ x-error-codes:
413
+ - BAD_REQUEST
414
+ - UNAUTHORIZED
415
+ - FORBIDDEN
416
+ - NOT_FOUND
417
+ x-cli:
418
+ name: unarchive
419
+ positional:
420
+ - id
421
+ /api/admin/metrics/{id}/series:
422
+ post:
423
+ operationId: getMetricSeries
424
+ summary: Get a metric's time series
425
+ description: |-
426
+ Compiles the metric's typed IR into Analytics Engine SQL and returns the bucketed series over the requested window (near-real-time; ingest lag is seconds). The window bounds are epoch **seconds**; `to` must be strictly greater than `from`. The response echoes the SQL that produced the rows.
427
+
428
+ Returns `422` when the stored definition can't compile (e.g. a label or event has gone away — re-save the metric), and `502`/`503` when the analytics upstream fails or isn't configured.
429
+
430
+ **Use case:** Render the metric trend chart / sparkline, or pull raw bucketed values to feed an external dashboard.
431
+ tags:
432
+ - Metrics
433
+ parameters:
434
+ - $ref: ../components/parameters.yaml#/ProjectId
435
+ - name: id
436
+ in: path
437
+ required: true
438
+ description: Stable opaque metric id (`met_…`).
439
+ schema:
440
+ $ref: ../components/schemas/common.yaml#/ResourceId
441
+ requestBody:
442
+ required: true
443
+ content:
444
+ application/json:
445
+ schema:
446
+ $ref: ../components/schemas/metrics.yaml#/GetMetricSeriesRequest
447
+ examples:
448
+ lastDayHourly:
449
+ summary: Last 24h, hourly buckets
450
+ description: Hourly metric values over a one-day window (bounds in epoch seconds).
451
+ value:
452
+ from: 1751000400
453
+ to: 1751086800
454
+ bucket: 3600
455
+ responses:
456
+ "200":
457
+ description: Get a metric's time series
458
+ content:
459
+ application/json:
460
+ schema:
461
+ $ref: ../components/schemas/metrics.yaml#/GetMetricSeriesResponse
462
+ example:
463
+ sql: |-
464
+ SELECT intDiv(toUInt32(double2), 3600) * 3600 AS t,
465
+ sum(_sample_interval) AS v
466
+ FROM shipeasy_metric_events
467
+ WHERE index1 = 'e976b15e-2f0d-4c6e-9b1a-3a7c1f2d8e90'
468
+ AND blob1 = 'checkout_completed'
469
+ AND double2 >= 1751000400 AND double2 < 1751086800
470
+ GROUP BY t
471
+ ORDER BY t
472
+ rows:
473
+ - t: 1751000400
474
+ v: 412
475
+ - t: 1751004000
476
+ v: 531
477
+ - t: 1751007600
478
+ v: 468
479
+ "400":
480
+ $ref: ../components/responses.yaml#/BadRequest
481
+ "401":
482
+ $ref: ../components/responses.yaml#/Unauthorized
483
+ "403":
484
+ $ref: ../components/responses.yaml#/Forbidden
485
+ "404":
486
+ $ref: ../components/responses.yaml#/NotFound
487
+ "409":
488
+ $ref: ../components/responses.yaml#/Conflict
489
+ "422":
490
+ $ref: ../components/responses.yaml#/UnprocessableEntity
491
+ x-error-codes:
492
+ - BAD_REQUEST
493
+ - UNAUTHORIZED
494
+ - FORBIDDEN
495
+ - NOT_FOUND
496
+ - VALIDATION
497
+ x-cli:
498
+ name: series
499
+ positional:
500
+ - id