@shipeasy/openapi 1.5.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 (101) 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 -17
  14. package/dist/index.js +253 -2458
  15. package/dist/index.js.map +1 -0
  16. package/dist/node-context.d.ts +85 -0
  17. package/dist/node-context.js +110 -0
  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 +37 -21
  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/resources/alert-rules.d.ts +0 -50
  65. package/dist/resources/alert-rules.js +0 -75
  66. package/dist/resources/configs.d.ts +0 -681
  67. package/dist/resources/configs.js +0 -509
  68. package/dist/resources/experiments.d.ts +0 -849
  69. package/dist/resources/experiments.js +0 -707
  70. package/dist/resources/gates.d.ts +0 -808
  71. package/dist/resources/gates.js +0 -522
  72. package/dist/resources/index.d.ts +0 -2749
  73. package/dist/resources/index.js +0 -2391
  74. package/dist/resources/killswitches.d.ts +0 -436
  75. package/dist/resources/killswitches.js +0 -514
  76. package/dist/resources/universes.d.ts +0 -185
  77. package/dist/resources/universes.js +0 -234
  78. package/dist/schemas/alert-rules.d.ts +0 -65
  79. package/dist/schemas/alert-rules.js +0 -37
  80. package/dist/schemas/configs.d.ts +0 -154
  81. package/dist/schemas/configs.js +0 -134
  82. package/dist/schemas/constants.d.ts +0 -6
  83. package/dist/schemas/constants.js +0 -7
  84. package/dist/schemas/experiments.d.ts +0 -229
  85. package/dist/schemas/experiments.js +0 -221
  86. package/dist/schemas/folder.d.ts +0 -10
  87. package/dist/schemas/folder.js +0 -8
  88. package/dist/schemas/gates.d.ts +0 -386
  89. package/dist/schemas/gates.js +0 -190
  90. package/dist/schemas/index.d.ts +0 -11
  91. package/dist/schemas/index.js +0 -762
  92. package/dist/schemas/killswitches.d.ts +0 -110
  93. package/dist/schemas/killswitches.js +0 -226
  94. package/dist/schemas/metric-name.d.ts +0 -5
  95. package/dist/schemas/metric-name.js +0 -6
  96. package/dist/schemas/pagination.d.ts +0 -37
  97. package/dist/schemas/pagination.js +0 -44
  98. package/dist/schemas/universes.d.ts +0 -35
  99. package/dist/schemas/universes.js +0 -55
  100. package/dist/transport.d.ts +0 -30
  101. package/dist/transport.js +0 -44
@@ -0,0 +1,478 @@
1
+ ListI18nProfilesResponse:
2
+ type: array
3
+ items:
4
+ type: object
5
+ properties:
6
+ id:
7
+ type: string
8
+ description: Stable opaque profile id.
9
+ name:
10
+ type: string
11
+ description: Profile handle, e.g. `en:prod` or `fr:prod`.
12
+ isDefault:
13
+ description: "`1` for the project's single default profile (always seeded as `en:prod`), else `0`."
14
+ type: number
15
+ createdAt:
16
+ description: ISO-8601 timestamp of creation.
17
+ type: string
18
+ deletedAt:
19
+ description: ISO-8601 soft-delete timestamp, or `null` if live.
20
+ anyOf:
21
+ - type: string
22
+ - type: "null"
23
+ required:
24
+ - id
25
+ - name
26
+ additionalProperties: false
27
+ description: One i18n locale profile.
28
+ CreateI18nProfileRequest:
29
+ type: object
30
+ properties:
31
+ name:
32
+ type: string
33
+ minLength: 1
34
+ maxLength: 64
35
+ pattern: ^[a-z0-9][a-z0-9_:.-]*$
36
+ description: Profile handle to create, e.g. `en:prod` or `fr:prod`. Lowercase alphanumeric start, then letters/digits/`_`/`:`/`.`/`-`; max 64 chars. The locale is encoded in the handle, so no separate locale fields are accepted.
37
+ required:
38
+ - name
39
+ additionalProperties: false
40
+ description: Body for `POST /api/admin/i18n/profiles`. Only `name` is accepted.
41
+ CreateI18nProfileResponse:
42
+ type: object
43
+ properties:
44
+ id:
45
+ type: string
46
+ description: Newly assigned profile id.
47
+ name:
48
+ type: string
49
+ description: Profile handle that was created.
50
+ required:
51
+ - id
52
+ - name
53
+ additionalProperties: false
54
+ description: Created profile id + name.
55
+ ListI18nKeysResponse:
56
+ type: object
57
+ properties:
58
+ keys:
59
+ type: array
60
+ items:
61
+ type: object
62
+ properties:
63
+ id:
64
+ type: string
65
+ description: Stable opaque key id.
66
+ key:
67
+ type: string
68
+ description: Dotted key path, e.g. `home.cta`.
69
+ value:
70
+ type: string
71
+ description: Current translated value for the key.
72
+ description:
73
+ description: Optional human note stored with the key.
74
+ anyOf:
75
+ - type: string
76
+ - type: "null"
77
+ variables:
78
+ description: "`{{var}}` placeholder names in the value, or `null` when there are none."
79
+ anyOf:
80
+ - type: array
81
+ items:
82
+ type: string
83
+ - type: "null"
84
+ profileId:
85
+ description: Owning profile id.
86
+ type: string
87
+ chunkId:
88
+ description: Owning chunk (authoring grouping) id.
89
+ type: string
90
+ updatedAt:
91
+ description: ISO-8601 timestamp of the last edit.
92
+ type: string
93
+ updatedBy:
94
+ description: Actor email that last edited the key.
95
+ type: string
96
+ required:
97
+ - id
98
+ - key
99
+ - value
100
+ additionalProperties: {}
101
+ description: One i18n key row.
102
+ description: The page of matching keys.
103
+ total:
104
+ type: number
105
+ description: Total matching keys across all pages (ignores `limit`/`offset`).
106
+ required:
107
+ - keys
108
+ - total
109
+ additionalProperties: false
110
+ description: A page of i18n keys plus the total count. (The client also tolerates a bare array.)
111
+ PushI18nKeysRequest:
112
+ type: object
113
+ properties:
114
+ profile_id:
115
+ type: string
116
+ format: uuid
117
+ description: Target profile id to add keys to.
118
+ chunk:
119
+ description: Logical grouping the new keys are filed under. Defaults to `default`.
120
+ type: string
121
+ minLength: 1
122
+ maxLength: 64
123
+ default: default
124
+ keys:
125
+ type: array
126
+ minItems: 1
127
+ maxItems: 5000
128
+ items:
129
+ type: object
130
+ properties:
131
+ key:
132
+ type: string
133
+ minLength: 1
134
+ maxLength: 256
135
+ description: Dotted key path, e.g. `home.cta`.
136
+ value:
137
+ type: string
138
+ description: Translated value for the key.
139
+ description:
140
+ type: string
141
+ description: Optional human note stored with the key.
142
+ variables:
143
+ type: array
144
+ maxItems: 32
145
+ items:
146
+ type: string
147
+ minLength: 1
148
+ maxLength: 64
149
+ description: Optional explicit list of `{{var}}` placeholder names in the value. Auto-derived from the value when omitted.
150
+ required:
151
+ - key
152
+ - value
153
+ additionalProperties: false
154
+ description: Keys to add. Insert-only — existing keys are reported back as `skipped`.
155
+ required:
156
+ - profile_id
157
+ - keys
158
+ additionalProperties: false
159
+ description: "Body for `POST /api/admin/i18n/keys`. Insert-only: keys that already exist are never overwritten — use `PUT /keys/{id}` to change a value."
160
+ PushI18nKeysResponse:
161
+ type: object
162
+ properties:
163
+ added:
164
+ type: array
165
+ items:
166
+ type: string
167
+ description: Key names that were newly inserted.
168
+ skipped:
169
+ type: array
170
+ items:
171
+ type: string
172
+ description: Key names that already existed and were left untouched.
173
+ pushed_count:
174
+ type: number
175
+ description: Number of keys inserted (== `added.length`).
176
+ skipped_count:
177
+ type: number
178
+ description: Number of keys skipped (== `skipped.length`).
179
+ chunk:
180
+ description: The chunk the keys were filed under.
181
+ type: string
182
+ required:
183
+ - added
184
+ - skipped
185
+ - pushed_count
186
+ - skipped_count
187
+ additionalProperties: false
188
+ description: Result of an insert-only key push.
189
+ UpdateI18nKeyRequest:
190
+ type: object
191
+ properties:
192
+ value:
193
+ type: string
194
+ description: New value for the key (the only overwrite path).
195
+ description:
196
+ description: Optional human note to store with the key.
197
+ type: string
198
+ variables:
199
+ description: Explicit `{{var}}` placeholder names in the value. Omit to auto-derive them from the value.
200
+ type: array
201
+ maxItems: 32
202
+ items:
203
+ type: string
204
+ minLength: 1
205
+ maxLength: 64
206
+ required:
207
+ - value
208
+ additionalProperties: false
209
+ description: Body for `PUT /api/admin/i18n/keys/{id}`. Updates one existing key's value.
210
+ UpdateI18nKeyResponse:
211
+ type: object
212
+ properties:
213
+ id:
214
+ type: string
215
+ description: Id of the key that was updated.
216
+ required:
217
+ - id
218
+ additionalProperties: false
219
+ description: Updated key id.
220
+ ListI18nDraftsResponse:
221
+ type: array
222
+ items:
223
+ type: object
224
+ properties:
225
+ id:
226
+ type: string
227
+ description: Stable opaque draft id.
228
+ name:
229
+ description: Draft name, e.g. the target locale being staged.
230
+ type: string
231
+ profileId:
232
+ description: Profile the draft targets.
233
+ type: string
234
+ sourceProfileId:
235
+ description: Profile the draft was seeded from, or `null`.
236
+ anyOf:
237
+ - type: string
238
+ - type: "null"
239
+ status:
240
+ description: Lifecycle state of the draft.
241
+ type: string
242
+ enum:
243
+ - open
244
+ - merged
245
+ - abandoned
246
+ createdBy:
247
+ description: Actor email that created the draft.
248
+ type: string
249
+ createdAt:
250
+ description: ISO-8601 timestamp of creation.
251
+ type: string
252
+ publishedAt:
253
+ description: ISO-8601 merge/publish timestamp, or `null`.
254
+ anyOf:
255
+ - type: string
256
+ - type: "null"
257
+ required:
258
+ - id
259
+ additionalProperties: {}
260
+ description: One staged translation draft.
261
+ I18nDraft:
262
+ type: object
263
+ properties:
264
+ id:
265
+ type: string
266
+ description: Stable opaque draft id.
267
+ name:
268
+ type: string
269
+ description: Draft name, e.g. the target locale being staged.
270
+ profileId:
271
+ type: string
272
+ description: Profile the draft targets.
273
+ sourceProfileId:
274
+ anyOf:
275
+ - type: string
276
+ - type: "null"
277
+ description: Profile the draft was seeded from, or `null`.
278
+ status:
279
+ type: string
280
+ enum:
281
+ - open
282
+ - merged
283
+ - abandoned
284
+ description: Lifecycle state of the draft.
285
+ createdBy:
286
+ type: string
287
+ description: Actor email that created the draft.
288
+ createdAt:
289
+ type: string
290
+ description: ISO-8601 timestamp of creation.
291
+ publishedAt:
292
+ anyOf:
293
+ - type: string
294
+ - type: "null"
295
+ description: ISO-8601 merge/publish timestamp, or `null`.
296
+ required:
297
+ - id
298
+ additionalProperties: {}
299
+ description: One staged translation draft.
300
+ CreateI18nDraftRequest:
301
+ type: object
302
+ properties:
303
+ name:
304
+ type: string
305
+ minLength: 1
306
+ maxLength: 64
307
+ description: Draft name, e.g. the target locale being staged.
308
+ profile_id:
309
+ type: string
310
+ format: uuid
311
+ description: Profile the draft targets.
312
+ source_profile_id:
313
+ type: string
314
+ format: uuid
315
+ description: Optional profile to seed the draft's keys from.
316
+ required:
317
+ - name
318
+ - profile_id
319
+ additionalProperties: false
320
+ description: Body for `POST /api/admin/i18n/drafts`. Stages a new translation draft against a target profile, optionally seeding from a source profile.
321
+ CreateI18nDraftResponse:
322
+ $ref: "#/I18nDraft"
323
+ UpdateI18nDraftRequest:
324
+ type: object
325
+ properties:
326
+ status:
327
+ type: string
328
+ enum:
329
+ - open
330
+ - merged
331
+ - abandoned
332
+ description: New lifecycle state for the draft.
333
+ additionalProperties: false
334
+ description: Body for `PATCH /api/admin/i18n/drafts/{draftId}`. Transitions the draft's lifecycle state.
335
+ UpdateI18nDraftResponse:
336
+ $ref: "#/I18nDraft"
337
+ PublishI18nProfileRequest:
338
+ type: object
339
+ properties:
340
+ chunk:
341
+ description: Optional chunk label to stamp on the audit log. Publishing is profile-wide regardless — the whole profile is snapshotted into one KV blob.
342
+ type: string
343
+ additionalProperties: false
344
+ description: Body for `POST /api/admin/i18n/profiles/{profileId}/publish`. The `chunk` is an audit label only.
345
+ PublishI18nProfileResponse:
346
+ type: object
347
+ properties:
348
+ ok:
349
+ type: boolean
350
+ const: true
351
+ description: Always `true` on success.
352
+ profile_id:
353
+ type: string
354
+ description: Profile that was published.
355
+ chunk:
356
+ anyOf:
357
+ - type: string
358
+ - type: "null"
359
+ description: Audit chunk label, or `null` when none was given.
360
+ published_at:
361
+ type: string
362
+ description: ISO-8601 timestamp of the publish.
363
+ version:
364
+ type: string
365
+ description: New KV snapshot version that was shipped.
366
+ key_count:
367
+ type: number
368
+ description: Number of keys in the published snapshot.
369
+ changed:
370
+ type: boolean
371
+ description: Whether the snapshot's contents actually changed since the last publish.
372
+ purged:
373
+ type: string
374
+ enum:
375
+ - purged
376
+ - skipped
377
+ - failed
378
+ description: "CDN purge outcome: `purged` ok, `skipped` (no creds), or `failed` (edge still stale)."
379
+ kv_verified:
380
+ type: boolean
381
+ description: Whether a KV read-back confirmed the new version persisted.
382
+ warning:
383
+ description: Human-readable caveat when the publish landed but is not fully live.
384
+ type: string
385
+ required:
386
+ - ok
387
+ - profile_id
388
+ - chunk
389
+ - published_at
390
+ - version
391
+ - key_count
392
+ - changed
393
+ - purged
394
+ - kv_verified
395
+ additionalProperties: false
396
+ description: Result of a profile-wide publish.
397
+ SetI18nLabelRequest:
398
+ type: object
399
+ properties:
400
+ key:
401
+ type: string
402
+ minLength: 1
403
+ maxLength: 256
404
+ description: Dotted key path to set, e.g. `home.cta`.
405
+ value:
406
+ type: string
407
+ description: New value for the key. Inserted when the key is new, overwritten when it exists.
408
+ profile:
409
+ description: Profile name to target, e.g. `en:prod`. Omit to target the project's default-marked profile.
410
+ type: string
411
+ minLength: 1
412
+ maxLength: 64
413
+ description:
414
+ description: Optional human note to store with the key.
415
+ type: string
416
+ required:
417
+ - key
418
+ - value
419
+ additionalProperties: false
420
+ description: "Body for `POST /api/admin/i18n/set`. Upserts one key's value and publishes the profile live."
421
+ SetI18nLabelResponse:
422
+ type: object
423
+ properties:
424
+ ok:
425
+ type: boolean
426
+ const: true
427
+ description: Always `true` on success.
428
+ profile:
429
+ type: string
430
+ description: Name of the profile that was published.
431
+ profile_id:
432
+ type: string
433
+ description: Id of the profile that was published.
434
+ key:
435
+ type: string
436
+ description: The key that was set.
437
+ value:
438
+ type: string
439
+ description: The value that was stored.
440
+ published_at:
441
+ type: string
442
+ description: ISO-8601 timestamp of the publish.
443
+ version:
444
+ type: string
445
+ description: New KV snapshot version that was shipped.
446
+ key_count:
447
+ type: number
448
+ description: Number of keys in the published snapshot.
449
+ changed:
450
+ type: boolean
451
+ description: Whether the snapshot's contents actually changed since the last publish.
452
+ purged:
453
+ type: string
454
+ enum:
455
+ - purged
456
+ - skipped
457
+ - failed
458
+ description: "CDN purge outcome: `purged` ok, `skipped` (no creds), or `failed` (edge still stale)."
459
+ kv_verified:
460
+ type: boolean
461
+ description: Whether a KV read-back confirmed the new version persisted.
462
+ warning:
463
+ description: Human-readable caveat when the publish landed but is not fully live.
464
+ type: string
465
+ required:
466
+ - ok
467
+ - profile
468
+ - profile_id
469
+ - key
470
+ - value
471
+ - published_at
472
+ - version
473
+ - key_count
474
+ - changed
475
+ - purged
476
+ - kv_verified
477
+ additionalProperties: false
478
+ description: Result of a one-shot set-and-publish.
@@ -0,0 +1,186 @@
1
+ ListKeysResponse:
2
+ type: object
3
+ properties:
4
+ data:
5
+ type: array
6
+ items:
7
+ $ref: "#/KeyRecord"
8
+ next_cursor:
9
+ anyOf:
10
+ - type: string
11
+ - type: "null"
12
+ description: Opaque cursor for the next page, or `null` on the last page. Pass it back as the `cursor` query parameter.
13
+ required:
14
+ - data
15
+ - next_cursor
16
+ additionalProperties: false
17
+ description: One page of API keys plus a keyset `next_cursor` (ordered `created_at desc, id desc`).
18
+ KeyRecord:
19
+ type: object
20
+ description: A single API key as returned by the list endpoint. Response fields are snake_case. The raw token is never returned here — only its `last4` tail. `last4` and the typed `scopes` may be `null` for keys minted before those columns existed.
21
+ properties:
22
+ id:
23
+ type: string
24
+ description: Stable opaque key id (UUID). Use it to revoke the key.
25
+ type:
26
+ type: string
27
+ enum:
28
+ - server
29
+ - client
30
+ - admin
31
+ - ops
32
+ description: "Key kind. `server` (back-end, full SDK auth), `client` (public, browser-embeddable), `admin` (CLI/devtools auth token), `ops` (restricted unattended-trigger credential)."
33
+ env:
34
+ type: string
35
+ enum:
36
+ - dev
37
+ - staging
38
+ - prod
39
+ description: Environment the key is bound to. The worker derives the read env from the key, so this is the isolation boundary. `admin`/`ops` keys are env-agnostic and pinned to `prod`.
40
+ created_at:
41
+ type: string
42
+ description: ISO-8601 timestamp the key was minted.
43
+ revoked_at:
44
+ anyOf:
45
+ - type: string
46
+ - type: "null"
47
+ description: ISO-8601 timestamp the key was revoked, or `null` while the key is active.
48
+ expires_at:
49
+ anyOf:
50
+ - type: string
51
+ - type: "null"
52
+ description: ISO-8601 expiry, or `null` for a key that never expires. `admin` keys are fixed at 90 days; `ops` keys use a short sliding window.
53
+ created_by_email:
54
+ anyOf:
55
+ - type: string
56
+ - type: "null"
57
+ description: Email of the human or actor that minted the key, or `null` when not attributable (e.g. CLI device-flow).
58
+ name:
59
+ anyOf:
60
+ - type: string
61
+ - type: "null"
62
+ description: Human label for the key. `null` for unnamed dashboard mints; programmatic mints auto-name themselves.
63
+ scopes:
64
+ anyOf:
65
+ - type: array
66
+ items:
67
+ type: string
68
+ - type: "null"
69
+ description: Permission strings recorded on the key for audit/display, or `null` when none were set.
70
+ last4:
71
+ anyOf:
72
+ - type: string
73
+ - type: "null"
74
+ description: Last 4 characters of the raw token, so the dashboard mask is matchable against the held key. `null` for keys minted before this column.
75
+ required:
76
+ - id
77
+ - type
78
+ - env
79
+ - created_at
80
+ - revoked_at
81
+ - expires_at
82
+ - created_by_email
83
+ - name
84
+ - scopes
85
+ - last4
86
+ additionalProperties: false
87
+ CreateKeyRequest:
88
+ type: object
89
+ description: |-
90
+ Body for `POST /api/admin/keys`. Only `type` is required.
91
+
92
+ `env` is **required** for `server` and `client` keys (the key is bound to one environment — that binding is the read-env isolation boundary). For `admin` and `ops` keys `env` is ignored and the key is pinned to `prod`.
93
+ properties:
94
+ type:
95
+ type: string
96
+ enum:
97
+ - server
98
+ - client
99
+ - admin
100
+ - ops
101
+ description: "Key kind to mint. `server` (back-end), `client` (public, browser), `admin` (CLI/devtools token), `ops` (restricted unattended-trigger credential). `admin`/`ops` keys don't count toward the plan key limit."
102
+ name:
103
+ type: string
104
+ minLength: 1
105
+ maxLength: 80
106
+ description: Optional human label. Programmatic (API) mints that omit it get an auto-generated descriptive name; dashboard mints may leave it blank.
107
+ scopes:
108
+ type: array
109
+ items:
110
+ type: string
111
+ enum:
112
+ - experiments:read
113
+ - gates:evaluate
114
+ - events:write
115
+ - configs:write
116
+ - experiments:write
117
+ description: Optional permission strings recorded on the key for audit/display.
118
+ expiresInDays:
119
+ anyOf:
120
+ - type: integer
121
+ minimum: 1
122
+ maximum: 3650
123
+ - type: "null"
124
+ description: "Days until the key expires (1–3650), or `null`/omitted for a key that never expires. Ignored for `admin` keys (fixed 90-day expiry) and `ops` keys (short sliding window)."
125
+ env:
126
+ type: string
127
+ enum:
128
+ - dev
129
+ - staging
130
+ - prod
131
+ description: Environment to bind the key to. Always required. For `server`/`client` keys it is the isolation boundary the worker reads from; `admin`/`ops` keys are env-agnostic and pinned to `prod` by the handler regardless of the value sent.
132
+ required:
133
+ - type
134
+ - env
135
+ additionalProperties: false
136
+ CreateKeyResponse:
137
+ type: object
138
+ description: The minted key. The plaintext `key` is returned **once**, here — it is stored hashed and can never be retrieved again.
139
+ properties:
140
+ id:
141
+ type: string
142
+ description: Stable opaque key id (UUID). Use it to revoke the key.
143
+ type:
144
+ type: string
145
+ enum:
146
+ - server
147
+ - client
148
+ - admin
149
+ - ops
150
+ description: The kind of key that was minted.
151
+ env:
152
+ type: string
153
+ enum:
154
+ - dev
155
+ - staging
156
+ - prod
157
+ description: Environment the key is bound to (`prod` for `admin`/`ops`).
158
+ key:
159
+ type: string
160
+ description: The plaintext API token (e.g. `sdk_server_…`). Returned once — store it now; it cannot be recovered.
161
+ expires_at:
162
+ anyOf:
163
+ - type: string
164
+ - type: "null"
165
+ description: ISO-8601 expiry, or `null` if the key never expires.
166
+ required:
167
+ - id
168
+ - type
169
+ - env
170
+ - key
171
+ - expires_at
172
+ additionalProperties: false
173
+ RevokeKeyResponse:
174
+ type: object
175
+ description: Confirms the key is revoked. Idempotent — revoking an already-revoked key returns the same shape.
176
+ properties:
177
+ id:
178
+ type: string
179
+ description: Id of the key that was revoked.
180
+ revoked:
181
+ type: boolean
182
+ const: true
183
+ required:
184
+ - id
185
+ - revoked
186
+ additionalProperties: false