@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
@@ -1,681 +0,0 @@
1
- import { z } from 'zod';
2
- import { configCreateSchema, configUpdateSchema, configDraftUpsertSchema, configPublishSchema } from '../schemas/configs.js';
3
- import { PageQuery, Page } from '../schemas/pagination.js';
4
- import { Transport } from '../transport.js';
5
-
6
- /** Use input types so callers can omit fields the server defaults. */
7
- type ConfigCreateInput = z.input<typeof configCreateSchema>;
8
- type ConfigUpdateInput = z.input<typeof configUpdateSchema>;
9
- type ConfigDraftUpsertInput = z.input<typeof configDraftUpsertSchema>;
10
- type ConfigPublishInput = z.input<typeof configPublishSchema>;
11
- interface Config {
12
- id: string;
13
- name: string;
14
- description?: string | null;
15
- schema: Record<string, unknown>;
16
- values?: Record<string, unknown>;
17
- drafts?: Record<string, unknown>;
18
- updatedAt: string;
19
- }
20
- interface ConfigActivityEntry {
21
- id: string;
22
- action: string;
23
- env?: string | null;
24
- actor?: string | null;
25
- payload?: unknown;
26
- createdAt: string;
27
- }
28
- interface ConfigsClient {
29
- list(opts?: Partial<PageQuery>): Promise<Page<Config>>;
30
- listAll(): Promise<Config[]>;
31
- get(id: string): Promise<Config>;
32
- resolve(idOrName: string): Promise<Config>;
33
- create(input: ConfigCreateInput): Promise<Config>;
34
- update(id: string, input: ConfigUpdateInput): Promise<Config>;
35
- delete(id: string): Promise<{
36
- ok: true;
37
- }>;
38
- /** Save a draft value for the given env (PUT /:id/drafts). */
39
- saveDraft(id: string, input: ConfigDraftUpsertInput): Promise<unknown>;
40
- /** Discard a draft for the given env (DELETE /:id/drafts with body). */
41
- discardDraft(id: string, input: ConfigPublishInput): Promise<unknown>;
42
- /** Publish a previously saved draft (POST /:id/publish). */
43
- publish(id: string, input: ConfigPublishInput): Promise<unknown>;
44
- activity(id: string, limit?: number): Promise<ConfigActivityEntry[]>;
45
- }
46
- declare function configsClient(t: Transport): ConfigsClient;
47
- declare const configsResource: {
48
- readonly name: "configs";
49
- readonly basePath: "/api/admin/configs";
50
- readonly describeOne: "config";
51
- readonly describeMany: "configs";
52
- readonly tag: {
53
- readonly name: "Configs";
54
- readonly description: string;
55
- };
56
- readonly schemas: {
57
- readonly create: z.ZodObject<{
58
- name: z.ZodString;
59
- description: z.ZodOptional<z.ZodString>;
60
- folder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
61
- schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
62
- value: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnknown, z.ZodRecord<z.ZodEnum<{
63
- dev: "dev";
64
- staging: "staging";
65
- prod: "prod";
66
- }>, z.ZodUnknown>]>>;
67
- }, z.core.$strip>;
68
- readonly update: z.ZodObject<{
69
- schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
70
- value: z.ZodOptional<z.ZodUnknown>;
71
- folder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
72
- }, z.core.$strip>;
73
- readonly saveDraft: z.ZodObject<{
74
- env: z.ZodEnum<{
75
- dev: "dev";
76
- staging: "staging";
77
- prod: "prod";
78
- }>;
79
- value: z.ZodUnknown;
80
- }, z.core.$strip>;
81
- readonly publish: z.ZodObject<{
82
- env: z.ZodEnum<{
83
- dev: "dev";
84
- staging: "staging";
85
- prod: "prod";
86
- }>;
87
- }, z.core.$strip>;
88
- };
89
- readonly actions: readonly [{
90
- readonly name: "publish";
91
- readonly description: "Publish a config draft for an env";
92
- }, {
93
- readonly name: "saveDraft";
94
- readonly description: "Save a draft value for an env";
95
- }, {
96
- readonly name: "discardDraft";
97
- readonly description: "Discard a draft for an env";
98
- }];
99
- readonly endpoints: readonly [{
100
- readonly operationId: "listConfigs";
101
- readonly method: "GET";
102
- readonly path: "";
103
- readonly summary: "List dynamic configs";
104
- readonly description: "Returns a single page of configs ordered by `updated_at desc, id desc`. Each row includes the latest published `version` per env and any active drafts.";
105
- readonly response: z.ZodObject<{
106
- data: z.ZodArray<z.ZodObject<{
107
- id: z.ZodString;
108
- name: z.ZodString;
109
- description: z.ZodNullable<z.ZodString>;
110
- schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
111
- updatedAt: z.ZodString;
112
- envs: z.ZodRecord<z.ZodEnum<{
113
- dev: "dev";
114
- staging: "staging";
115
- prod: "prod";
116
- }>, z.ZodObject<{
117
- version: z.ZodNumber;
118
- publishedAt: z.ZodString;
119
- publishedBy: z.ZodString;
120
- }, z.core.$strip>>;
121
- drafts: z.ZodRecord<z.ZodEnum<{
122
- dev: "dev";
123
- staging: "staging";
124
- prod: "prod";
125
- }>, z.ZodObject<{
126
- updatedAt: z.ZodString;
127
- authorEmail: z.ZodString;
128
- baseVersion: z.ZodNumber;
129
- }, z.core.$strip>>;
130
- values: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
131
- dev: "dev";
132
- staging: "staging";
133
- prod: "prod";
134
- }>, z.ZodUnknown>>;
135
- draftValues: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
136
- dev: "dev";
137
- staging: "staging";
138
- prod: "prod";
139
- }>, z.ZodUnknown>>;
140
- }, z.core.$strip>>;
141
- next_cursor: z.ZodNullable<z.ZodString>;
142
- }, z.core.$strip>;
143
- readonly examples: {
144
- readonly response: {
145
- readonly data: readonly [{
146
- id: string;
147
- name: string;
148
- description: string;
149
- schema: {
150
- type: string;
151
- properties: {
152
- tiers: {
153
- type: string;
154
- items: {
155
- type: string;
156
- };
157
- };
158
- };
159
- required: string[];
160
- };
161
- updatedAt: string;
162
- envs: {
163
- dev: {
164
- version: number;
165
- publishedAt: string;
166
- publishedBy: string;
167
- };
168
- stage: {
169
- version: number;
170
- publishedAt: string;
171
- publishedBy: string;
172
- };
173
- prod: {
174
- version: number;
175
- publishedAt: string;
176
- publishedBy: string;
177
- };
178
- };
179
- drafts: {
180
- dev: {
181
- updatedAt: string;
182
- authorEmail: string;
183
- baseVersion: number;
184
- };
185
- };
186
- }];
187
- readonly next_cursor: null;
188
- };
189
- };
190
- readonly useCase: "Snapshot every config in the project — e.g. CI check that asserts no env is stuck on a stale default or that every config has a published value on prod.";
191
- }, {
192
- readonly operationId: "getConfig";
193
- readonly method: "GET";
194
- readonly path: "/{id}";
195
- readonly summary: "Get one config";
196
- readonly description: "Returns config metadata plus the latest published values per env and any active draft values. Use this to fetch the JSON the editor renders.";
197
- readonly pathParams: {
198
- readonly id: "Stable opaque config id (`cfg_…`) or the config's `name`.";
199
- };
200
- readonly response: z.ZodObject<{
201
- id: z.ZodString;
202
- name: z.ZodString;
203
- description: z.ZodNullable<z.ZodString>;
204
- schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
205
- updatedAt: z.ZodString;
206
- envs: z.ZodRecord<z.ZodEnum<{
207
- dev: "dev";
208
- staging: "staging";
209
- prod: "prod";
210
- }>, z.ZodObject<{
211
- version: z.ZodNumber;
212
- publishedAt: z.ZodString;
213
- publishedBy: z.ZodString;
214
- }, z.core.$strip>>;
215
- drafts: z.ZodRecord<z.ZodEnum<{
216
- dev: "dev";
217
- staging: "staging";
218
- prod: "prod";
219
- }>, z.ZodObject<{
220
- updatedAt: z.ZodString;
221
- authorEmail: z.ZodString;
222
- baseVersion: z.ZodNumber;
223
- }, z.core.$strip>>;
224
- values: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
225
- dev: "dev";
226
- staging: "staging";
227
- prod: "prod";
228
- }>, z.ZodUnknown>>;
229
- draftValues: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
230
- dev: "dev";
231
- staging: "staging";
232
- prod: "prod";
233
- }>, z.ZodUnknown>>;
234
- }, z.core.$strip>;
235
- readonly examples: {
236
- readonly response: {
237
- readonly values: {
238
- readonly dev: {
239
- readonly tiers: readonly [{
240
- readonly name: "free";
241
- }, {
242
- readonly name: "pro";
243
- }];
244
- };
245
- readonly stage: {
246
- readonly tiers: readonly [{
247
- readonly name: "free";
248
- }, {
249
- readonly name: "pro";
250
- }];
251
- };
252
- readonly prod: {
253
- readonly tiers: readonly [{
254
- readonly name: "free";
255
- }, {
256
- readonly name: "pro";
257
- }];
258
- };
259
- };
260
- readonly draftValues: {
261
- readonly dev: {
262
- readonly tiers: readonly [{
263
- readonly name: "free";
264
- }, {
265
- readonly name: "pro";
266
- }, {
267
- readonly name: "enterprise";
268
- }];
269
- };
270
- };
271
- readonly id: string;
272
- readonly name: string;
273
- readonly description: string;
274
- readonly schema: {
275
- type: string;
276
- properties: {
277
- tiers: {
278
- type: string;
279
- items: {
280
- type: string;
281
- };
282
- };
283
- };
284
- required: string[];
285
- };
286
- readonly updatedAt: string;
287
- readonly envs: {
288
- dev: {
289
- version: number;
290
- publishedAt: string;
291
- publishedBy: string;
292
- };
293
- stage: {
294
- version: number;
295
- publishedAt: string;
296
- publishedBy: string;
297
- };
298
- prod: {
299
- version: number;
300
- publishedAt: string;
301
- publishedBy: string;
302
- };
303
- };
304
- readonly drafts: {
305
- dev: {
306
- updatedAt: string;
307
- authorEmail: string;
308
- baseVersion: number;
309
- };
310
- };
311
- };
312
- };
313
- readonly useCase: "Fetch one config's current published values and any in-flight drafts.";
314
- }, {
315
- readonly operationId: "createConfig";
316
- readonly method: "POST";
317
- readonly path: "";
318
- readonly summary: "Create a dynamic config";
319
- readonly description: string;
320
- readonly successStatus: 201;
321
- readonly request: z.ZodObject<{
322
- name: z.ZodString;
323
- description: z.ZodOptional<z.ZodString>;
324
- folder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
325
- schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
326
- value: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnknown, z.ZodRecord<z.ZodEnum<{
327
- dev: "dev";
328
- staging: "staging";
329
- prod: "prod";
330
- }>, z.ZodUnknown>]>>;
331
- }, z.core.$strip>;
332
- readonly response: z.ZodObject<{
333
- id: z.ZodString;
334
- name: z.ZodString;
335
- }, z.core.$strip>;
336
- readonly examples: {
337
- readonly requestExamples: {
338
- readonly minimal: {
339
- readonly summary: "Minimal — name + schema";
340
- readonly description: "Smallest valid body. Initial value defaults to `{}` on every env.";
341
- readonly value: {
342
- readonly name: "pricing.tiers";
343
- readonly schema: {
344
- readonly type: "object";
345
- readonly properties: {
346
- readonly tiers: {
347
- readonly type: "array";
348
- };
349
- };
350
- readonly required: readonly ["tiers"];
351
- };
352
- };
353
- };
354
- readonly seededValue: {
355
- readonly summary: "Seeded — schema + initial value";
356
- readonly description: "Seed the same JSON object on every env at version 1.";
357
- readonly value: {
358
- readonly name: "pricing.tiers";
359
- readonly description: "Pricing tier definitions consumed by checkout.";
360
- readonly schema: {
361
- readonly type: "object";
362
- readonly properties: {
363
- readonly tiers: {
364
- readonly type: "array";
365
- };
366
- };
367
- readonly required: readonly ["tiers"];
368
- };
369
- readonly value: {
370
- readonly tiers: readonly [{
371
- readonly name: "free";
372
- }, {
373
- readonly name: "pro";
374
- }];
375
- };
376
- };
377
- };
378
- readonly perEnvSeed: {
379
- readonly summary: "Per-env seed";
380
- readonly description: "Pass a `{ env: value }` map to seed different initial values per env.";
381
- readonly value: {
382
- readonly name: "pricing.tiers";
383
- readonly schema: {
384
- readonly type: "object";
385
- readonly properties: {
386
- readonly tiers: {
387
- readonly type: "array";
388
- };
389
- };
390
- readonly required: readonly ["tiers"];
391
- };
392
- readonly value: {
393
- readonly dev: {
394
- readonly tiers: readonly [{
395
- readonly name: "free";
396
- }, {
397
- readonly name: "pro";
398
- }, {
399
- readonly name: "enterprise";
400
- }];
401
- };
402
- readonly stage: {
403
- readonly tiers: readonly [{
404
- readonly name: "free";
405
- }, {
406
- readonly name: "pro";
407
- }];
408
- };
409
- readonly prod: {
410
- readonly tiers: readonly [{
411
- readonly name: "free";
412
- }, {
413
- readonly name: "pro";
414
- }];
415
- };
416
- };
417
- };
418
- };
419
- };
420
- readonly response: {
421
- readonly id: "cfg_01j7wae5h6j7k8l9m0n1p2q3r4";
422
- readonly name: "pricing.tiers";
423
- };
424
- };
425
- readonly useCase: string;
426
- }, {
427
- readonly operationId: "updateConfig";
428
- readonly method: "PATCH";
429
- readonly path: "/{id}";
430
- readonly summary: "Update a dynamic config";
431
- readonly description: string;
432
- readonly pathParams: {
433
- readonly id: "Stable opaque config id.";
434
- };
435
- readonly request: z.ZodObject<{
436
- schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
437
- value: z.ZodOptional<z.ZodUnknown>;
438
- folder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
439
- }, z.core.$strip>;
440
- readonly response: z.ZodObject<{
441
- id: z.ZodString;
442
- }, z.core.$strip>;
443
- readonly examples: {
444
- readonly requestExamples: {
445
- readonly flatValue: {
446
- readonly summary: "Flat value — republish on every env";
447
- readonly description: "Sets the same JSON object as a new version on dev/stage/prod.";
448
- readonly value: {
449
- readonly value: {
450
- readonly tiers: readonly [{
451
- readonly name: "free";
452
- }, {
453
- readonly name: "pro";
454
- }];
455
- };
456
- };
457
- };
458
- readonly schemaOnly: {
459
- readonly summary: "Schema-only update";
460
- readonly description: "Replaces the schema. Existing values must still validate or the update fails.";
461
- readonly value: {
462
- readonly schema: {
463
- readonly type: "object";
464
- readonly properties: {
465
- readonly tiers: {
466
- readonly type: "array";
467
- };
468
- readonly trial_days: {
469
- readonly type: "integer";
470
- };
471
- };
472
- readonly required: readonly ["tiers"];
473
- };
474
- };
475
- };
476
- };
477
- readonly response: {
478
- readonly id: "cfg_01j7wae5h6j7k8l9m0n1p2q3r4";
479
- };
480
- };
481
- readonly useCase: string;
482
- }, {
483
- readonly operationId: "deleteConfig";
484
- readonly method: "DELETE";
485
- readonly path: "/{id}";
486
- readonly summary: "Delete a dynamic config";
487
- readonly description: "Soft-deletes the config and rebuilds the project's flags KV blob.";
488
- readonly pathParams: {
489
- readonly id: "Stable opaque config id.";
490
- };
491
- readonly response: z.ZodObject<{
492
- ok: z.ZodLiteral<true>;
493
- }, z.core.$strip>;
494
- readonly examples: {
495
- readonly response: {
496
- readonly ok: true;
497
- };
498
- };
499
- readonly useCase: "Tear down a config after its consumers have stopped reading it.";
500
- }, {
501
- readonly operationId: "saveConfigDraft";
502
- readonly method: "PUT";
503
- readonly path: "/{id}/drafts";
504
- readonly summary: "Save a draft value";
505
- readonly description: string;
506
- readonly pathParams: {
507
- readonly id: "Stable opaque config id.";
508
- };
509
- readonly request: z.ZodObject<{
510
- env: z.ZodEnum<{
511
- dev: "dev";
512
- staging: "staging";
513
- prod: "prod";
514
- }>;
515
- value: z.ZodUnknown;
516
- }, z.core.$strip>;
517
- readonly response: z.ZodObject<{
518
- id: z.ZodString;
519
- env: z.ZodEnum<{
520
- dev: "dev";
521
- staging: "staging";
522
- prod: "prod";
523
- }>;
524
- baseVersion: z.ZodNumber;
525
- updatedAt: z.ZodString;
526
- }, z.core.$strip>;
527
- readonly examples: {
528
- readonly requestExamples: {
529
- readonly stageDev: {
530
- readonly summary: "Stage a dev draft";
531
- readonly description: "Stages a new value on dev without touching stage/prod.";
532
- readonly value: {
533
- readonly env: "dev";
534
- readonly value: {
535
- readonly tiers: readonly [{
536
- readonly name: "free";
537
- }, {
538
- readonly name: "pro";
539
- }, {
540
- readonly name: "enterprise";
541
- }];
542
- };
543
- };
544
- };
545
- };
546
- readonly response: {
547
- readonly id: "cfg_01j7wae5h6j7k8l9m0n1p2q3r4";
548
- readonly env: "dev";
549
- readonly baseVersion: 5;
550
- readonly updatedAt: "2026-05-10T09:31:00.000Z";
551
- };
552
- };
553
- readonly useCase: "Iterate on a config value on dev without affecting prod — preview in staging, then publish.";
554
- }, {
555
- readonly operationId: "discardConfigDraft";
556
- readonly method: "DELETE";
557
- readonly path: "/{id}/drafts";
558
- readonly summary: "Discard a draft";
559
- readonly description: "Drops the in-flight draft on one env. Published values are unaffected.";
560
- readonly pathParams: {
561
- readonly id: "Stable opaque config id.";
562
- };
563
- readonly request: z.ZodObject<{
564
- env: z.ZodEnum<{
565
- dev: "dev";
566
- staging: "staging";
567
- prod: "prod";
568
- }>;
569
- }, z.core.$strip>;
570
- readonly response: z.ZodObject<{
571
- ok: z.ZodLiteral<true>;
572
- }, z.core.$strip>;
573
- readonly examples: {
574
- readonly requestExamples: {
575
- readonly discardDev: {
576
- readonly summary: "Discard the dev draft";
577
- readonly description: "Drops the staged dev draft without publishing.";
578
- readonly value: {
579
- readonly env: "dev";
580
- };
581
- };
582
- };
583
- readonly response: {
584
- readonly ok: true;
585
- };
586
- };
587
- readonly useCase: "Abandon an in-progress draft after deciding not to ship it.";
588
- }, {
589
- readonly operationId: "publishConfigDraft";
590
- readonly method: "POST";
591
- readonly path: "/{id}/publish";
592
- readonly summary: "Publish a draft";
593
- readonly description: string;
594
- readonly pathParams: {
595
- readonly id: "Stable opaque config id.";
596
- };
597
- readonly request: z.ZodObject<{
598
- env: z.ZodEnum<{
599
- dev: "dev";
600
- staging: "staging";
601
- prod: "prod";
602
- }>;
603
- }, z.core.$strip>;
604
- readonly response: z.ZodObject<{
605
- id: z.ZodString;
606
- env: z.ZodEnum<{
607
- dev: "dev";
608
- staging: "staging";
609
- prod: "prod";
610
- }>;
611
- version: z.ZodNumber;
612
- }, z.core.$strip>;
613
- readonly examples: {
614
- readonly requestExamples: {
615
- readonly publishDev: {
616
- readonly summary: "Publish the dev draft";
617
- readonly description: "Promotes the dev draft to a new published version on dev.";
618
- readonly value: {
619
- readonly env: "dev";
620
- };
621
- };
622
- readonly publishProd: {
623
- readonly summary: "Publish to prod";
624
- readonly description: "Promotes the prod draft after staging signed off.";
625
- readonly value: {
626
- readonly env: "prod";
627
- };
628
- };
629
- };
630
- readonly response: {
631
- readonly id: "cfg_01j7wae5h6j7k8l9m0n1p2q3r4";
632
- readonly env: "dev";
633
- readonly version: 6;
634
- };
635
- };
636
- readonly useCase: "Ship a staged change once you've validated it on a lower env.";
637
- }, {
638
- readonly operationId: "listConfigActivity";
639
- readonly method: "GET";
640
- readonly path: "/{id}/activity";
641
- readonly summary: "List config activity";
642
- readonly description: "Returns recent audit rows for one config (create, update, draft.save, publish, delete) ordered newest first. Use the `limit` query parameter to cap the result (1–100, default 20).";
643
- readonly pathParams: {
644
- readonly id: "Stable opaque config id.";
645
- };
646
- readonly queryParams: {
647
- readonly limit: {
648
- readonly schema: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
649
- readonly description: "Max rows to return (1–100). Defaults to 20.";
650
- };
651
- };
652
- readonly response: z.ZodArray<z.ZodObject<{
653
- id: z.ZodString;
654
- action: z.ZodString;
655
- actorEmail: z.ZodString;
656
- actorType: z.ZodEnum<{
657
- user: "user";
658
- cli: "cli";
659
- system: "system";
660
- }>;
661
- payload: z.ZodNullable<z.ZodUnknown>;
662
- createdAt: z.ZodString;
663
- }, z.core.$strip>>;
664
- readonly examples: {
665
- readonly response: readonly [{
666
- readonly id: "act_01j7waf01a2b3c4d5e6f7g8h9i";
667
- readonly action: "config.publish";
668
- readonly actorEmail: "ana@example.com";
669
- readonly actorType: "user";
670
- readonly payload: {
671
- readonly env: "dev";
672
- readonly version: 6;
673
- };
674
- readonly createdAt: "2026-05-10T09:31:42.000Z";
675
- }];
676
- };
677
- readonly useCase: "Render the activity panel in the config editor or drive a slack notification on publish events.";
678
- }];
679
- };
680
-
681
- export { type Config, type ConfigActivityEntry, type ConfigCreateInput, type ConfigDraftUpsertInput, type ConfigPublishInput, type ConfigUpdateInput, type ConfigsClient, configsClient, configsResource };