@shipeasy/openapi 1.0.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.
@@ -0,0 +1,2522 @@
1
+ import { Transport } from '../transport.js';
2
+ import '@shipeasy/core/pagination';
3
+ import * as zod_v4_core from 'zod/v4/core';
4
+ import * as zod from 'zod';
5
+ import { KillswitchesClient } from './killswitches.js';
6
+ export { killswitchesClient, killswitchesResource } from './killswitches.js';
7
+ import { UniversesClient } from './universes.js';
8
+ export { universesClient, universesResource } from './universes.js';
9
+ import { ConfigsClient } from './configs.js';
10
+ export { configsClient, configsResource } from './configs.js';
11
+ import { ExperimentsClient } from './experiments.js';
12
+ export { experimentsClient, experimentsResource } from './experiments.js';
13
+ import { GatesClient } from './gates.js';
14
+ export { gatesClient, gatesResource } from './gates.js';
15
+ import '@shipeasy/core/schemas/gates';
16
+ import '@shipeasy/core/schemas/universes';
17
+ import '@shipeasy/core/schemas/killswitches';
18
+ import '@shipeasy/core/schemas/configs';
19
+ import '@shipeasy/core/schemas/experiments';
20
+
21
+ /**
22
+ * Aggregate admin client. Each resource lives in its own file under
23
+ * ./resources/ — add a new entry here when you implement a new one.
24
+ *
25
+ * Both @shipeasy/cli and @shipeasy/mcp consume this client; do not duplicate
26
+ * endpoint paths or request shapes in the consumer packages.
27
+ */
28
+ declare function createAdminClient(transport: Transport): {
29
+ transport: Transport;
30
+ gates: GatesClient;
31
+ experiments: ExperimentsClient;
32
+ configs: ConfigsClient;
33
+ universes: UniversesClient;
34
+ killswitches: KillswitchesClient;
35
+ };
36
+ type AdminClient = ReturnType<typeof createAdminClient>;
37
+ /**
38
+ * Resource registry. MCP enumerates this to generate its tool catalog (one
39
+ * tool per CRUD verb + one per action). CLI can iterate it to auto-wire
40
+ * commander subcommands. Order is the surface order users see.
41
+ */
42
+ declare const RESOURCE_REGISTRY: readonly [{
43
+ readonly name: "gates";
44
+ readonly basePath: "/api/admin/gates";
45
+ readonly describeOne: "feature gate";
46
+ readonly describeMany: "feature gates";
47
+ readonly tag: {
48
+ readonly name: "Gates";
49
+ readonly description: string;
50
+ };
51
+ readonly schemas: {
52
+ readonly create: zod.ZodObject<{
53
+ title: zod.ZodOptional<zod.ZodString>;
54
+ description: zod.ZodOptional<zod.ZodString>;
55
+ folder: zod.ZodOptional<zod.ZodString>;
56
+ group: zod.ZodOptional<zod.ZodString>;
57
+ owner_email: zod.ZodOptional<zod.ZodString>;
58
+ name: zod.ZodString;
59
+ enabled: zod.ZodDefault<zod.ZodBoolean>;
60
+ rollout_pct: zod.ZodDefault<zod.ZodNumber>;
61
+ rules: zod.ZodDefault<zod.ZodArray<zod.ZodObject<{
62
+ attr: zod.ZodString;
63
+ op: zod.ZodEnum<{
64
+ eq: "eq";
65
+ neq: "neq";
66
+ in: "in";
67
+ not_in: "not_in";
68
+ gt: "gt";
69
+ gte: "gte";
70
+ lt: "lt";
71
+ lte: "lte";
72
+ contains: "contains";
73
+ regex: "regex";
74
+ }>;
75
+ value: zod.ZodUnknown;
76
+ }, zod_v4_core.$strip>>>;
77
+ salt: zod.ZodOptional<zod.ZodString>;
78
+ stack: zod.ZodOptional<zod.ZodNullable<zod.ZodArray<zod.ZodDiscriminatedUnion<[zod.ZodObject<{
79
+ id: zod.ZodString;
80
+ type: zod.ZodLiteral<"condition">;
81
+ name: zod.ZodOptional<zod.ZodString>;
82
+ fromTemplate: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
83
+ pass: zod.ZodOptional<zod.ZodEnum<{
84
+ all: "all";
85
+ any: "any";
86
+ }>>;
87
+ rules: zod.ZodDefault<zod.ZodArray<zod.ZodObject<{
88
+ attr: zod.ZodString;
89
+ op: zod.ZodEnum<{
90
+ eq: "eq";
91
+ neq: "neq";
92
+ in: "in";
93
+ not_in: "not_in";
94
+ gt: "gt";
95
+ gte: "gte";
96
+ lt: "lt";
97
+ lte: "lte";
98
+ contains: "contains";
99
+ regex: "regex";
100
+ }>;
101
+ value: zod.ZodUnknown;
102
+ }, zod_v4_core.$strip>>>;
103
+ locked: zod.ZodOptional<zod.ZodBoolean>;
104
+ }, zod_v4_core.$strip>, zod.ZodObject<{
105
+ id: zod.ZodString;
106
+ type: zod.ZodLiteral<"rollout">;
107
+ name: zod.ZodOptional<zod.ZodString>;
108
+ fromTemplate: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
109
+ rolloutPct: zod.ZodNumber;
110
+ bucketBy: zod.ZodOptional<zod.ZodString>;
111
+ salt: zod.ZodOptional<zod.ZodString>;
112
+ locked: zod.ZodOptional<zod.ZodBoolean>;
113
+ }, zod_v4_core.$strip>], "type">>>>;
114
+ }, zod_v4_core.$strip>;
115
+ readonly update: zod.ZodObject<{
116
+ title: zod.ZodOptional<zod.ZodString>;
117
+ description: zod.ZodOptional<zod.ZodString>;
118
+ folder: zod.ZodOptional<zod.ZodString>;
119
+ group: zod.ZodOptional<zod.ZodString>;
120
+ owner_email: zod.ZodOptional<zod.ZodString>;
121
+ rollout_pct: zod.ZodOptional<zod.ZodNumber>;
122
+ rules: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
123
+ attr: zod.ZodString;
124
+ op: zod.ZodEnum<{
125
+ eq: "eq";
126
+ neq: "neq";
127
+ in: "in";
128
+ not_in: "not_in";
129
+ gt: "gt";
130
+ gte: "gte";
131
+ lt: "lt";
132
+ lte: "lte";
133
+ contains: "contains";
134
+ regex: "regex";
135
+ }>;
136
+ value: zod.ZodUnknown;
137
+ }, zod_v4_core.$strip>>>;
138
+ enabled: zod.ZodOptional<zod.ZodBoolean>;
139
+ stack: zod.ZodOptional<zod.ZodNullable<zod.ZodArray<zod.ZodDiscriminatedUnion<[zod.ZodObject<{
140
+ id: zod.ZodString;
141
+ type: zod.ZodLiteral<"condition">;
142
+ name: zod.ZodOptional<zod.ZodString>;
143
+ fromTemplate: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
144
+ pass: zod.ZodOptional<zod.ZodEnum<{
145
+ all: "all";
146
+ any: "any";
147
+ }>>;
148
+ rules: zod.ZodDefault<zod.ZodArray<zod.ZodObject<{
149
+ attr: zod.ZodString;
150
+ op: zod.ZodEnum<{
151
+ eq: "eq";
152
+ neq: "neq";
153
+ in: "in";
154
+ not_in: "not_in";
155
+ gt: "gt";
156
+ gte: "gte";
157
+ lt: "lt";
158
+ lte: "lte";
159
+ contains: "contains";
160
+ regex: "regex";
161
+ }>;
162
+ value: zod.ZodUnknown;
163
+ }, zod_v4_core.$strip>>>;
164
+ locked: zod.ZodOptional<zod.ZodBoolean>;
165
+ }, zod_v4_core.$strip>, zod.ZodObject<{
166
+ id: zod.ZodString;
167
+ type: zod.ZodLiteral<"rollout">;
168
+ name: zod.ZodOptional<zod.ZodString>;
169
+ fromTemplate: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
170
+ rolloutPct: zod.ZodNumber;
171
+ bucketBy: zod.ZodOptional<zod.ZodString>;
172
+ salt: zod.ZodOptional<zod.ZodString>;
173
+ locked: zod.ZodOptional<zod.ZodBoolean>;
174
+ }, zod_v4_core.$strip>], "type">>>>;
175
+ }, zod_v4_core.$strip>;
176
+ };
177
+ readonly actions: readonly [{
178
+ readonly name: "enable";
179
+ readonly description: "Enable a gate";
180
+ }, {
181
+ readonly name: "disable";
182
+ readonly description: "Disable a gate";
183
+ }];
184
+ readonly endpoints: readonly [{
185
+ readonly operationId: "listGates";
186
+ readonly method: "GET";
187
+ readonly path: "";
188
+ readonly summary: "List feature gates";
189
+ readonly description: "Returns a single page of gates ordered by `updated_at desc, id desc`. Use the `cursor` query parameter to paginate.";
190
+ readonly response: zod.ZodObject<{
191
+ data: zod.ZodArray<zod.ZodObject<{
192
+ id: zod.ZodString;
193
+ name: zod.ZodString;
194
+ enabled: zod.ZodUnion<readonly [zod.ZodBoolean, zod.ZodNumber]>;
195
+ rolloutPct: zod.ZodNumber;
196
+ rules: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
197
+ attr: zod.ZodString;
198
+ op: zod.ZodEnum<{
199
+ eq: "eq";
200
+ neq: "neq";
201
+ in: "in";
202
+ not_in: "not_in";
203
+ gt: "gt";
204
+ gte: "gte";
205
+ lt: "lt";
206
+ lte: "lte";
207
+ contains: "contains";
208
+ regex: "regex";
209
+ }>;
210
+ value: zod.ZodUnknown;
211
+ }, zod_v4_core.$strip>>>;
212
+ salt: zod.ZodOptional<zod.ZodString>;
213
+ title: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
214
+ description: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
215
+ folder: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
216
+ groupName: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
217
+ ownerEmail: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
218
+ stack: zod.ZodOptional<zod.ZodNullable<zod.ZodArray<zod.ZodDiscriminatedUnion<[zod.ZodObject<{
219
+ id: zod.ZodString;
220
+ type: zod.ZodLiteral<"condition">;
221
+ name: zod.ZodOptional<zod.ZodString>;
222
+ fromTemplate: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
223
+ pass: zod.ZodOptional<zod.ZodEnum<{
224
+ all: "all";
225
+ any: "any";
226
+ }>>;
227
+ rules: zod.ZodDefault<zod.ZodArray<zod.ZodObject<{
228
+ attr: zod.ZodString;
229
+ op: zod.ZodEnum<{
230
+ eq: "eq";
231
+ neq: "neq";
232
+ in: "in";
233
+ not_in: "not_in";
234
+ gt: "gt";
235
+ gte: "gte";
236
+ lt: "lt";
237
+ lte: "lte";
238
+ contains: "contains";
239
+ regex: "regex";
240
+ }>;
241
+ value: zod.ZodUnknown;
242
+ }, zod_v4_core.$strip>>>;
243
+ locked: zod.ZodOptional<zod.ZodBoolean>;
244
+ }, zod_v4_core.$strip>, zod.ZodObject<{
245
+ id: zod.ZodString;
246
+ type: zod.ZodLiteral<"rollout">;
247
+ name: zod.ZodOptional<zod.ZodString>;
248
+ fromTemplate: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
249
+ rolloutPct: zod.ZodNumber;
250
+ bucketBy: zod.ZodOptional<zod.ZodString>;
251
+ salt: zod.ZodOptional<zod.ZodString>;
252
+ locked: zod.ZodOptional<zod.ZodBoolean>;
253
+ }, zod_v4_core.$strip>], "type">>>>;
254
+ updatedAt: zod.ZodString;
255
+ }, zod_v4_core.$strip>>;
256
+ next_cursor: zod.ZodNullable<zod.ZodString>;
257
+ }, zod_v4_core.$strip>;
258
+ readonly examples: {
259
+ readonly response: {
260
+ readonly data: readonly [{
261
+ readonly id: "gat_01j7w7m9q4hxbf6npe6s9zr3vc";
262
+ readonly name: "checkout_v2";
263
+ readonly enabled: 1;
264
+ readonly rolloutPct: 5000;
265
+ readonly rules: readonly [{
266
+ readonly attr: "country";
267
+ readonly op: "in";
268
+ readonly value: readonly ["US", "CA", "GB"];
269
+ }, {
270
+ readonly attr: "plan";
271
+ readonly op: "neq";
272
+ readonly value: "free";
273
+ }];
274
+ readonly salt: "9c1f4f1f2c0c4a5fa1c2b6d3e7c8e3a1";
275
+ readonly title: "Checkout v2";
276
+ readonly description: "New checkout flow. Pro users in US/CA/GB only.";
277
+ readonly folder: "checkout";
278
+ readonly groupName: "growth";
279
+ readonly ownerEmail: "ana@example.com";
280
+ readonly stack: null;
281
+ readonly updatedAt: "2026-05-09T16:01:22.000Z";
282
+ }];
283
+ readonly next_cursor: null;
284
+ };
285
+ };
286
+ readonly useCase: "Snapshot every gate in the project — for example to render an admin overview or to drive a CI check that asserts no gate is left at 100% in staging.";
287
+ }, {
288
+ readonly operationId: "createGate";
289
+ readonly method: "POST";
290
+ readonly path: "";
291
+ readonly summary: "Create a feature gate";
292
+ readonly description: string;
293
+ readonly successStatus: 201;
294
+ readonly request: zod.ZodObject<{
295
+ title: zod.ZodOptional<zod.ZodString>;
296
+ description: zod.ZodOptional<zod.ZodString>;
297
+ folder: zod.ZodOptional<zod.ZodString>;
298
+ group: zod.ZodOptional<zod.ZodString>;
299
+ owner_email: zod.ZodOptional<zod.ZodString>;
300
+ name: zod.ZodString;
301
+ enabled: zod.ZodDefault<zod.ZodBoolean>;
302
+ rollout_pct: zod.ZodDefault<zod.ZodNumber>;
303
+ rules: zod.ZodDefault<zod.ZodArray<zod.ZodObject<{
304
+ attr: zod.ZodString;
305
+ op: zod.ZodEnum<{
306
+ eq: "eq";
307
+ neq: "neq";
308
+ in: "in";
309
+ not_in: "not_in";
310
+ gt: "gt";
311
+ gte: "gte";
312
+ lt: "lt";
313
+ lte: "lte";
314
+ contains: "contains";
315
+ regex: "regex";
316
+ }>;
317
+ value: zod.ZodUnknown;
318
+ }, zod_v4_core.$strip>>>;
319
+ salt: zod.ZodOptional<zod.ZodString>;
320
+ stack: zod.ZodOptional<zod.ZodNullable<zod.ZodArray<zod.ZodDiscriminatedUnion<[zod.ZodObject<{
321
+ id: zod.ZodString;
322
+ type: zod.ZodLiteral<"condition">;
323
+ name: zod.ZodOptional<zod.ZodString>;
324
+ fromTemplate: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
325
+ pass: zod.ZodOptional<zod.ZodEnum<{
326
+ all: "all";
327
+ any: "any";
328
+ }>>;
329
+ rules: zod.ZodDefault<zod.ZodArray<zod.ZodObject<{
330
+ attr: zod.ZodString;
331
+ op: zod.ZodEnum<{
332
+ eq: "eq";
333
+ neq: "neq";
334
+ in: "in";
335
+ not_in: "not_in";
336
+ gt: "gt";
337
+ gte: "gte";
338
+ lt: "lt";
339
+ lte: "lte";
340
+ contains: "contains";
341
+ regex: "regex";
342
+ }>;
343
+ value: zod.ZodUnknown;
344
+ }, zod_v4_core.$strip>>>;
345
+ locked: zod.ZodOptional<zod.ZodBoolean>;
346
+ }, zod_v4_core.$strip>, zod.ZodObject<{
347
+ id: zod.ZodString;
348
+ type: zod.ZodLiteral<"rollout">;
349
+ name: zod.ZodOptional<zod.ZodString>;
350
+ fromTemplate: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
351
+ rolloutPct: zod.ZodNumber;
352
+ bucketBy: zod.ZodOptional<zod.ZodString>;
353
+ salt: zod.ZodOptional<zod.ZodString>;
354
+ locked: zod.ZodOptional<zod.ZodBoolean>;
355
+ }, zod_v4_core.$strip>], "type">>>>;
356
+ }, zod_v4_core.$strip>;
357
+ readonly response: zod.ZodObject<{
358
+ id: zod.ZodString;
359
+ name: zod.ZodString;
360
+ }, zod_v4_core.$strip>;
361
+ readonly examples: {
362
+ readonly requestExamples: {
363
+ readonly minimal: {
364
+ readonly summary: "Minimal — dark gate, name only";
365
+ readonly description: "Smallest valid body. The gate is created `enabled: true` at `rollout_pct: 0`, with no rules. Ramp it later via PATCH.";
366
+ readonly value: {
367
+ readonly name: "checkout_v2";
368
+ };
369
+ };
370
+ readonly targeted: {
371
+ readonly summary: "Targeted rollout — rules + percentage";
372
+ readonly description: "Gate Pro users in US/CA/GB, then hash 10% of that audience into the on-bucket (`rollout_pct: 1000` = 10.00%). Adds dashboard metadata so the gate is self-documenting.";
373
+ readonly value: {
374
+ readonly name: "checkout_v2";
375
+ readonly rollout_pct: 1000;
376
+ readonly rules: readonly [{
377
+ readonly attr: "country";
378
+ readonly op: "in";
379
+ readonly value: readonly ["US", "CA", "GB"];
380
+ }, {
381
+ readonly attr: "plan";
382
+ readonly op: "neq";
383
+ readonly value: "free";
384
+ }];
385
+ readonly title: "Checkout v2";
386
+ readonly description: "New checkout flow. Pro users in US/CA/GB only.";
387
+ readonly folder: "checkout";
388
+ readonly group: "growth";
389
+ readonly owner_email: "ana@example.com";
390
+ };
391
+ };
392
+ readonly gatekeeperStack: {
393
+ readonly summary: "Gatekeeper stack — internal ∪ beta ∪ public";
394
+ readonly description: "Three-layer fall-through: employees always on, opted-in beta accounts always on, then 25% of everyone else. First match wins; evaluation stops as soon as one entry returns `true`.";
395
+ readonly value: {
396
+ readonly name: "checkout_v2";
397
+ readonly title: "Checkout v2";
398
+ readonly owner_email: "ana@example.com";
399
+ readonly stack: readonly [{
400
+ readonly id: "01HKJ0EMP";
401
+ readonly type: "condition";
402
+ readonly name: "Employees";
403
+ readonly pass: "any";
404
+ readonly rules: readonly [{
405
+ readonly attr: "email";
406
+ readonly op: "regex";
407
+ readonly value: "@acme\\.com$";
408
+ }];
409
+ }, {
410
+ readonly id: "01HKJ0BETA";
411
+ readonly type: "condition";
412
+ readonly name: "Beta opt-in";
413
+ readonly pass: "all";
414
+ readonly rules: readonly [{
415
+ readonly attr: "beta_opt_in";
416
+ readonly op: "eq";
417
+ readonly value: true;
418
+ }];
419
+ }, {
420
+ readonly id: "01HKJ0PUB";
421
+ readonly type: "rollout";
422
+ readonly name: "Public";
423
+ readonly rolloutPct: 2500;
424
+ readonly bucketBy: "userID";
425
+ readonly locked: true;
426
+ }];
427
+ };
428
+ };
429
+ readonly disabledOnCreate: {
430
+ readonly summary: "Disabled on create — provision then enable later";
431
+ readonly description: "Create with `enabled: false` so the gate evaluates to `false` for every caller until a follow-up `POST /{id}/enable`. Useful when provisioning ahead of a launch.";
432
+ readonly value: {
433
+ readonly name: "checkout_v2";
434
+ readonly enabled: false;
435
+ readonly rollout_pct: 0;
436
+ };
437
+ };
438
+ };
439
+ readonly response: {
440
+ readonly id: "gat_01j7w7m9q4hxbf6npe6s9zr3vc";
441
+ readonly name: "checkout_v2";
442
+ };
443
+ };
444
+ readonly useCase: string;
445
+ }, {
446
+ readonly operationId: "updateGate";
447
+ readonly method: "PATCH";
448
+ readonly path: "/{id}";
449
+ readonly summary: "Update a feature gate";
450
+ readonly description: string;
451
+ readonly pathParams: {
452
+ readonly id: "Stable opaque gate id (`gat_…`).";
453
+ };
454
+ readonly request: zod.ZodObject<{
455
+ title: zod.ZodOptional<zod.ZodString>;
456
+ description: zod.ZodOptional<zod.ZodString>;
457
+ folder: zod.ZodOptional<zod.ZodString>;
458
+ group: zod.ZodOptional<zod.ZodString>;
459
+ owner_email: zod.ZodOptional<zod.ZodString>;
460
+ rollout_pct: zod.ZodOptional<zod.ZodNumber>;
461
+ rules: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
462
+ attr: zod.ZodString;
463
+ op: zod.ZodEnum<{
464
+ eq: "eq";
465
+ neq: "neq";
466
+ in: "in";
467
+ not_in: "not_in";
468
+ gt: "gt";
469
+ gte: "gte";
470
+ lt: "lt";
471
+ lte: "lte";
472
+ contains: "contains";
473
+ regex: "regex";
474
+ }>;
475
+ value: zod.ZodUnknown;
476
+ }, zod_v4_core.$strip>>>;
477
+ enabled: zod.ZodOptional<zod.ZodBoolean>;
478
+ stack: zod.ZodOptional<zod.ZodNullable<zod.ZodArray<zod.ZodDiscriminatedUnion<[zod.ZodObject<{
479
+ id: zod.ZodString;
480
+ type: zod.ZodLiteral<"condition">;
481
+ name: zod.ZodOptional<zod.ZodString>;
482
+ fromTemplate: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
483
+ pass: zod.ZodOptional<zod.ZodEnum<{
484
+ all: "all";
485
+ any: "any";
486
+ }>>;
487
+ rules: zod.ZodDefault<zod.ZodArray<zod.ZodObject<{
488
+ attr: zod.ZodString;
489
+ op: zod.ZodEnum<{
490
+ eq: "eq";
491
+ neq: "neq";
492
+ in: "in";
493
+ not_in: "not_in";
494
+ gt: "gt";
495
+ gte: "gte";
496
+ lt: "lt";
497
+ lte: "lte";
498
+ contains: "contains";
499
+ regex: "regex";
500
+ }>;
501
+ value: zod.ZodUnknown;
502
+ }, zod_v4_core.$strip>>>;
503
+ locked: zod.ZodOptional<zod.ZodBoolean>;
504
+ }, zod_v4_core.$strip>, zod.ZodObject<{
505
+ id: zod.ZodString;
506
+ type: zod.ZodLiteral<"rollout">;
507
+ name: zod.ZodOptional<zod.ZodString>;
508
+ fromTemplate: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
509
+ rolloutPct: zod.ZodNumber;
510
+ bucketBy: zod.ZodOptional<zod.ZodString>;
511
+ salt: zod.ZodOptional<zod.ZodString>;
512
+ locked: zod.ZodOptional<zod.ZodBoolean>;
513
+ }, zod_v4_core.$strip>], "type">>>>;
514
+ }, zod_v4_core.$strip>;
515
+ readonly response: zod.ZodObject<{
516
+ id: zod.ZodString;
517
+ }, zod_v4_core.$strip>;
518
+ readonly examples: {
519
+ readonly requestExamples: {
520
+ readonly rampRollout: {
521
+ readonly summary: "Ramp rollout — 0 → 50%";
522
+ readonly description: "Single-field patch. `5000` basis points = 50%.";
523
+ readonly value: {
524
+ readonly rollout_pct: 5000;
525
+ };
526
+ };
527
+ readonly killSwitch: {
528
+ readonly summary: "Kill switch — disable the gate";
529
+ readonly description: "Forces evaluation to `false` for every caller, regardless of rules or rollout. Same effect as `POST /{id}/disable` but composable with other patches.";
530
+ readonly value: {
531
+ readonly enabled: false;
532
+ };
533
+ };
534
+ readonly extendInRule: {
535
+ readonly summary: "Add a value to an `in` rule";
536
+ readonly description: "Array fields replace wholesale — there is no per-rule patch. To add `'AU'` to a country whitelist that previously held `['US','CA','GB']`, send the full new `rules` array. Same pattern applies to `not_in`.";
537
+ readonly value: {
538
+ readonly rules: readonly [{
539
+ readonly attr: "country";
540
+ readonly op: "in";
541
+ readonly value: readonly ["US", "CA", "GB", "AU"];
542
+ }, {
543
+ readonly attr: "plan";
544
+ readonly op: "neq";
545
+ readonly value: "free";
546
+ }];
547
+ };
548
+ };
549
+ readonly replaceStack: {
550
+ readonly summary: "Replace gatekeeper stack";
551
+ readonly description: "Stack is replace-wholesale. Send the full new ordered list. Pass `\"stack\": null` to revert the gate to flat `rules` + `rollout_pct` evaluation.";
552
+ readonly value: {
553
+ readonly stack: readonly [{
554
+ readonly id: "01HKJ0EMP";
555
+ readonly type: "condition";
556
+ readonly name: "Employees";
557
+ readonly pass: "any";
558
+ readonly rules: readonly [{
559
+ readonly attr: "email";
560
+ readonly op: "regex";
561
+ readonly value: "@acme\\.com$";
562
+ }];
563
+ }, {
564
+ readonly id: "01HKJ0PUB";
565
+ readonly type: "rollout";
566
+ readonly name: "Public";
567
+ readonly rolloutPct: 5000;
568
+ readonly locked: true;
569
+ }];
570
+ };
571
+ };
572
+ readonly updateMetadata: {
573
+ readonly summary: "Update dashboard metadata";
574
+ readonly description: "Any subset of `title`, `description`, `folder`, `group`, `owner_email`. Snake-case in the request; the GET response returns camelCase (`groupName`, `ownerEmail`).";
575
+ readonly value: {
576
+ readonly title: "Checkout v2 (50%)";
577
+ readonly description: "Bumped to 50% after passing canary. Added AU.";
578
+ readonly folder: "checkout";
579
+ readonly owner_email: "ana@example.com";
580
+ };
581
+ };
582
+ };
583
+ readonly response: {
584
+ readonly id: "gat_01j7w7m9q4hxbf6npe6s9zr3vc";
585
+ };
586
+ };
587
+ readonly useCase: string;
588
+ }, {
589
+ readonly operationId: "deleteGate";
590
+ readonly method: "DELETE";
591
+ readonly path: "/{id}";
592
+ readonly summary: "Delete a feature gate";
593
+ readonly description: "Soft-deletes the gate. Returns 409 if the gate is still referenced by a running experiment as a targeting gate — stop the experiment first.";
594
+ readonly pathParams: {
595
+ readonly id: "Stable opaque gate id (`gat_…`).";
596
+ };
597
+ readonly response: zod.ZodObject<{
598
+ ok: zod.ZodLiteral<true>;
599
+ }, zod_v4_core.$strip>;
600
+ readonly examples: {
601
+ readonly response: {
602
+ readonly ok: true;
603
+ };
604
+ };
605
+ readonly useCase: "Tear down a gate after a feature has fully shipped and the rollout flag is no longer needed.";
606
+ }, {
607
+ readonly operationId: "enableGate";
608
+ readonly method: "POST";
609
+ readonly path: "/{id}/enable";
610
+ readonly summary: "Enable a gate";
611
+ readonly description: "Sets `enabled: true`. The current `rollout_pct` is preserved.";
612
+ readonly pathParams: {
613
+ readonly id: "Stable opaque gate id.";
614
+ };
615
+ readonly response: zod.ZodObject<{
616
+ id: zod.ZodString;
617
+ enabled: zod.ZodBoolean;
618
+ }, zod_v4_core.$strip>;
619
+ readonly examples: {
620
+ readonly response: {
621
+ readonly id: "gat_01j7w7m9q4hxbf6npe6s9zr3vc";
622
+ readonly enabled: true;
623
+ };
624
+ };
625
+ readonly useCase: "Re-enable a previously disabled gate without re-issuing a full update.";
626
+ }, {
627
+ readonly operationId: "disableGate";
628
+ readonly method: "POST";
629
+ readonly path: "/{id}/disable";
630
+ readonly summary: "Disable a gate";
631
+ readonly description: "Sets `enabled: false` so the gate evaluates to `false` for every caller, regardless of `rollout_pct` or `rules`. Use as a quick kill switch.";
632
+ readonly pathParams: {
633
+ readonly id: "Stable opaque gate id.";
634
+ };
635
+ readonly response: zod.ZodObject<{
636
+ id: zod.ZodString;
637
+ enabled: zod.ZodBoolean;
638
+ }, zod_v4_core.$strip>;
639
+ readonly examples: {
640
+ readonly response: {
641
+ readonly id: "gat_01j7w7m9q4hxbf6npe6s9zr3vc";
642
+ readonly enabled: false;
643
+ };
644
+ };
645
+ readonly useCase: "Flip a gate off in production without redeploying — the canonical kill-switch flow.";
646
+ }];
647
+ }, {
648
+ readonly name: "experiments";
649
+ readonly basePath: "/api/admin/experiments";
650
+ readonly describeOne: "experiment";
651
+ readonly describeMany: "experiments";
652
+ readonly tag: {
653
+ readonly name: "Experiments";
654
+ readonly description: string;
655
+ };
656
+ readonly schemas: {
657
+ readonly create: zod.ZodObject<{
658
+ name: zod.ZodString;
659
+ description: zod.ZodDefault<zod.ZodNullable<zod.ZodString>>;
660
+ tag: zod.ZodDefault<zod.ZodNullable<zod.ZodString>>;
661
+ universe: zod.ZodString;
662
+ targeting_gate: zod.ZodDefault<zod.ZodNullable<zod.ZodString>>;
663
+ allocation_pct: zod.ZodDefault<zod.ZodNumber>;
664
+ salt: zod.ZodOptional<zod.ZodString>;
665
+ params: zod.ZodDefault<zod.ZodRecord<zod.ZodString, zod.ZodEnum<{
666
+ string: "string";
667
+ number: "number";
668
+ bool: "bool";
669
+ }>>>;
670
+ groups: zod.ZodArray<zod.ZodObject<{
671
+ name: zod.ZodString;
672
+ weight: zod.ZodNumber;
673
+ params: zod.ZodDefault<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
674
+ }, zod_v4_core.$strip>>;
675
+ significance_threshold: zod.ZodDefault<zod.ZodNumber>;
676
+ min_runtime_days: zod.ZodDefault<zod.ZodNumber>;
677
+ min_sample_size: zod.ZodDefault<zod.ZodNumber>;
678
+ sequential_testing: zod.ZodDefault<zod.ZodBoolean>;
679
+ }, zod_v4_core.$strip>;
680
+ readonly update: zod.ZodObject<{
681
+ name: zod.ZodOptional<zod.ZodString>;
682
+ description: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
683
+ tag: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
684
+ targeting_gate: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
685
+ allocation_pct: zod.ZodOptional<zod.ZodNumber>;
686
+ salt: zod.ZodOptional<zod.ZodString>;
687
+ universe: zod.ZodOptional<zod.ZodString>;
688
+ params: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodEnum<{
689
+ string: "string";
690
+ number: "number";
691
+ bool: "bool";
692
+ }>>>;
693
+ groups: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
694
+ name: zod.ZodString;
695
+ weight: zod.ZodNumber;
696
+ params: zod.ZodDefault<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
697
+ }, zod_v4_core.$strip>>>;
698
+ significance_threshold: zod.ZodOptional<zod.ZodNumber>;
699
+ min_runtime_days: zod.ZodOptional<zod.ZodNumber>;
700
+ min_sample_size: zod.ZodOptional<zod.ZodNumber>;
701
+ sequential_testing: zod.ZodOptional<zod.ZodBoolean>;
702
+ }, zod_v4_core.$strip>;
703
+ };
704
+ readonly actions: readonly [{
705
+ readonly name: "start";
706
+ readonly description: "Transition draft experiment to running";
707
+ }, {
708
+ readonly name: "stop";
709
+ readonly description: "Stop a running experiment";
710
+ }, {
711
+ readonly name: "archive";
712
+ readonly description: "Archive a stopped experiment";
713
+ }, {
714
+ readonly name: "reanalyze";
715
+ readonly description: "Re-run analysis pass for the experiment";
716
+ }];
717
+ readonly endpoints: readonly [{
718
+ readonly operationId: "listExperiments";
719
+ readonly method: "GET";
720
+ readonly path: "";
721
+ readonly summary: "List experiments";
722
+ readonly description: "Returns a single page of non-archived experiments ordered by `updated_at desc, id desc`. Use the `cursor` query parameter to paginate.";
723
+ readonly response: zod.ZodObject<{
724
+ data: zod.ZodArray<zod.ZodObject<{
725
+ id: zod.ZodString;
726
+ name: zod.ZodString;
727
+ description: zod.ZodNullable<zod.ZodString>;
728
+ tag: zod.ZodNullable<zod.ZodString>;
729
+ status: zod.ZodEnum<{
730
+ draft: "draft";
731
+ running: "running";
732
+ stopped: "stopped";
733
+ archived: "archived";
734
+ }>;
735
+ universe: zod.ZodString;
736
+ targetingGate: zod.ZodNullable<zod.ZodString>;
737
+ allocationPct: zod.ZodNumber;
738
+ salt: zod.ZodString;
739
+ params: zod.ZodRecord<zod.ZodString, zod.ZodEnum<{
740
+ string: "string";
741
+ number: "number";
742
+ bool: "bool";
743
+ }>>;
744
+ groups: zod.ZodArray<zod.ZodObject<{
745
+ name: zod.ZodString;
746
+ weight: zod.ZodNumber;
747
+ params: zod.ZodDefault<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
748
+ }, zod_v4_core.$strip>>;
749
+ significanceThreshold: zod.ZodNumber;
750
+ minRuntimeDays: zod.ZodNumber;
751
+ minSampleSize: zod.ZodNumber;
752
+ sequentialTesting: zod.ZodBoolean;
753
+ startedAt: zod.ZodNullable<zod.ZodString>;
754
+ stoppedAt: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
755
+ updatedAt: zod.ZodString;
756
+ }, zod_v4_core.$strip>>;
757
+ next_cursor: zod.ZodNullable<zod.ZodString>;
758
+ }, zod_v4_core.$strip>;
759
+ readonly examples: {
760
+ readonly response: {
761
+ readonly data: readonly [{
762
+ id: string;
763
+ name: string;
764
+ description: string;
765
+ tag: string;
766
+ status: string;
767
+ universe: string;
768
+ targetingGate: null;
769
+ allocationPct: number;
770
+ salt: string;
771
+ params: {
772
+ cta_color: string;
773
+ };
774
+ groups: {
775
+ name: string;
776
+ weight: number;
777
+ params: {
778
+ cta_color: string;
779
+ };
780
+ }[];
781
+ significanceThreshold: number;
782
+ minRuntimeDays: number;
783
+ minSampleSize: number;
784
+ sequentialTesting: boolean;
785
+ startedAt: string;
786
+ stoppedAt: null;
787
+ updatedAt: string;
788
+ }];
789
+ readonly next_cursor: null;
790
+ };
791
+ };
792
+ readonly useCase: "Snapshot every active experiment in the project — e.g. render an overview dashboard or drive a CI check that no experiment has been running past its `min_runtime_days`.";
793
+ }, {
794
+ readonly operationId: "getExperiment";
795
+ readonly method: "GET";
796
+ readonly path: "/{id}";
797
+ readonly summary: "Get one experiment";
798
+ readonly description: "Returns the full experiment row including groups, params, allocation, and lifecycle timestamps.";
799
+ readonly pathParams: {
800
+ readonly id: "Stable opaque experiment id (`exp_…`) or the experiment's `name`.";
801
+ };
802
+ readonly response: zod.ZodObject<{
803
+ id: zod.ZodString;
804
+ name: zod.ZodString;
805
+ description: zod.ZodNullable<zod.ZodString>;
806
+ tag: zod.ZodNullable<zod.ZodString>;
807
+ status: zod.ZodEnum<{
808
+ draft: "draft";
809
+ running: "running";
810
+ stopped: "stopped";
811
+ archived: "archived";
812
+ }>;
813
+ universe: zod.ZodString;
814
+ targetingGate: zod.ZodNullable<zod.ZodString>;
815
+ allocationPct: zod.ZodNumber;
816
+ salt: zod.ZodString;
817
+ params: zod.ZodRecord<zod.ZodString, zod.ZodEnum<{
818
+ string: "string";
819
+ number: "number";
820
+ bool: "bool";
821
+ }>>;
822
+ groups: zod.ZodArray<zod.ZodObject<{
823
+ name: zod.ZodString;
824
+ weight: zod.ZodNumber;
825
+ params: zod.ZodDefault<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
826
+ }, zod_v4_core.$strip>>;
827
+ significanceThreshold: zod.ZodNumber;
828
+ minRuntimeDays: zod.ZodNumber;
829
+ minSampleSize: zod.ZodNumber;
830
+ sequentialTesting: zod.ZodBoolean;
831
+ startedAt: zod.ZodNullable<zod.ZodString>;
832
+ stoppedAt: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
833
+ updatedAt: zod.ZodString;
834
+ }, zod_v4_core.$strip>;
835
+ readonly examples: {
836
+ readonly response: {
837
+ id: string;
838
+ name: string;
839
+ description: string;
840
+ tag: string;
841
+ status: string;
842
+ universe: string;
843
+ targetingGate: null;
844
+ allocationPct: number;
845
+ salt: string;
846
+ params: {
847
+ cta_color: string;
848
+ };
849
+ groups: {
850
+ name: string;
851
+ weight: number;
852
+ params: {
853
+ cta_color: string;
854
+ };
855
+ }[];
856
+ significanceThreshold: number;
857
+ minRuntimeDays: number;
858
+ minSampleSize: number;
859
+ sequentialTesting: boolean;
860
+ startedAt: string;
861
+ stoppedAt: null;
862
+ updatedAt: string;
863
+ };
864
+ };
865
+ readonly useCase: "Fetch one experiment to render the detail page or to inspect its current allocation and group weights.";
866
+ }, {
867
+ readonly operationId: "createExperiment";
868
+ readonly method: "POST";
869
+ readonly path: "";
870
+ readonly summary: "Create an experiment";
871
+ readonly description: string;
872
+ readonly successStatus: 201;
873
+ readonly request: zod.ZodObject<{
874
+ name: zod.ZodString;
875
+ description: zod.ZodDefault<zod.ZodNullable<zod.ZodString>>;
876
+ tag: zod.ZodDefault<zod.ZodNullable<zod.ZodString>>;
877
+ universe: zod.ZodString;
878
+ targeting_gate: zod.ZodDefault<zod.ZodNullable<zod.ZodString>>;
879
+ allocation_pct: zod.ZodDefault<zod.ZodNumber>;
880
+ salt: zod.ZodOptional<zod.ZodString>;
881
+ params: zod.ZodDefault<zod.ZodRecord<zod.ZodString, zod.ZodEnum<{
882
+ string: "string";
883
+ number: "number";
884
+ bool: "bool";
885
+ }>>>;
886
+ groups: zod.ZodArray<zod.ZodObject<{
887
+ name: zod.ZodString;
888
+ weight: zod.ZodNumber;
889
+ params: zod.ZodDefault<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
890
+ }, zod_v4_core.$strip>>;
891
+ significance_threshold: zod.ZodDefault<zod.ZodNumber>;
892
+ min_runtime_days: zod.ZodDefault<zod.ZodNumber>;
893
+ min_sample_size: zod.ZodDefault<zod.ZodNumber>;
894
+ sequential_testing: zod.ZodDefault<zod.ZodBoolean>;
895
+ }, zod_v4_core.$strip>;
896
+ readonly response: zod.ZodObject<{
897
+ id: zod.ZodString;
898
+ name: zod.ZodString;
899
+ }, zod_v4_core.$strip>;
900
+ readonly examples: {
901
+ readonly requestExamples: {
902
+ readonly minimal: {
903
+ readonly summary: "Minimal — two-group 50/50";
904
+ readonly description: "Smallest valid body. Two groups at 50/50, no allocation, no targeting.";
905
+ readonly value: {
906
+ readonly name: "checkout_button_color";
907
+ readonly universe: "primary_users";
908
+ readonly groups: readonly [{
909
+ readonly name: "control";
910
+ readonly weight: 5000;
911
+ }, {
912
+ readonly name: "treatment";
913
+ readonly weight: 5000;
914
+ }];
915
+ };
916
+ };
917
+ readonly targeted: {
918
+ readonly summary: "Targeted — gate + allocation + params";
919
+ readonly description: "Gate the audience with a `targeting_gate`, allocate 50% of it, and parameterise the variants.";
920
+ readonly value: {
921
+ readonly name: "checkout_button_color";
922
+ readonly description: "Green CTA on checkout for Pro users.";
923
+ readonly universe: "primary_users";
924
+ readonly targeting_gate: "pro_plan_only";
925
+ readonly allocation_pct: 5000;
926
+ readonly params: {
927
+ readonly cta_color: "string";
928
+ };
929
+ readonly groups: readonly [{
930
+ readonly name: "control";
931
+ readonly weight: 5000;
932
+ readonly params: {
933
+ readonly cta_color: "blue";
934
+ };
935
+ }, {
936
+ readonly name: "treatment";
937
+ readonly weight: 5000;
938
+ readonly params: {
939
+ readonly cta_color: "green";
940
+ };
941
+ }];
942
+ };
943
+ };
944
+ readonly multivariant: {
945
+ readonly summary: "Multivariant — three groups";
946
+ readonly description: "Three variants splitting 40/30/30. Requires the sum to equal 10000.";
947
+ readonly value: {
948
+ readonly name: "headline_test";
949
+ readonly universe: "primary_users";
950
+ readonly groups: readonly [{
951
+ readonly name: "control";
952
+ readonly weight: 4000;
953
+ }, {
954
+ readonly name: "alt_a";
955
+ readonly weight: 3000;
956
+ }, {
957
+ readonly name: "alt_b";
958
+ readonly weight: 3000;
959
+ }];
960
+ };
961
+ };
962
+ readonly sequential: {
963
+ readonly summary: "Sequential testing — Premium plan";
964
+ readonly description: "Enable always-valid sequential tests. Requires Premium plan or higher.";
965
+ readonly value: {
966
+ readonly name: "checkout_button_color";
967
+ readonly universe: "primary_users";
968
+ readonly groups: readonly [{
969
+ readonly name: "control";
970
+ readonly weight: 5000;
971
+ }, {
972
+ readonly name: "treatment";
973
+ readonly weight: 5000;
974
+ }];
975
+ readonly sequential_testing: true;
976
+ readonly min_runtime_days: 14;
977
+ };
978
+ };
979
+ };
980
+ readonly response: {
981
+ readonly id: "exp_01j7wb12c3d4e5f6g7h8j9k0l1";
982
+ readonly name: "checkout_button_color";
983
+ };
984
+ };
985
+ readonly useCase: string;
986
+ }, {
987
+ readonly operationId: "updateExperiment";
988
+ readonly method: "PATCH";
989
+ readonly path: "/{id}";
990
+ readonly summary: "Update an experiment";
991
+ readonly description: string;
992
+ readonly pathParams: {
993
+ readonly id: "Stable opaque experiment id.";
994
+ };
995
+ readonly request: zod.ZodObject<{
996
+ name: zod.ZodOptional<zod.ZodString>;
997
+ description: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
998
+ tag: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
999
+ targeting_gate: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
1000
+ allocation_pct: zod.ZodOptional<zod.ZodNumber>;
1001
+ salt: zod.ZodOptional<zod.ZodString>;
1002
+ universe: zod.ZodOptional<zod.ZodString>;
1003
+ params: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodEnum<{
1004
+ string: "string";
1005
+ number: "number";
1006
+ bool: "bool";
1007
+ }>>>;
1008
+ groups: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
1009
+ name: zod.ZodString;
1010
+ weight: zod.ZodNumber;
1011
+ params: zod.ZodDefault<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
1012
+ }, zod_v4_core.$strip>>>;
1013
+ significance_threshold: zod.ZodOptional<zod.ZodNumber>;
1014
+ min_runtime_days: zod.ZodOptional<zod.ZodNumber>;
1015
+ min_sample_size: zod.ZodOptional<zod.ZodNumber>;
1016
+ sequential_testing: zod.ZodOptional<zod.ZodBoolean>;
1017
+ }, zod_v4_core.$strip>;
1018
+ readonly response: zod.ZodObject<{
1019
+ id: zod.ZodString;
1020
+ }, zod_v4_core.$strip>;
1021
+ readonly examples: {
1022
+ readonly requestExamples: {
1023
+ readonly rampAllocation: {
1024
+ readonly summary: "Ramp allocation — 0 → 50%";
1025
+ readonly description: "Bumps the share of the targeted audience enrolled. Allowed only when the experiment is in `draft`.";
1026
+ readonly value: {
1027
+ readonly allocation_pct: 5000;
1028
+ };
1029
+ };
1030
+ readonly changeWeights: {
1031
+ readonly summary: "Change group weights";
1032
+ readonly description: "Replace the groups array — weights must still sum to 10000.";
1033
+ readonly value: {
1034
+ readonly groups: readonly [{
1035
+ readonly name: "control";
1036
+ readonly weight: 2500;
1037
+ }, {
1038
+ readonly name: "treatment";
1039
+ readonly weight: 7500;
1040
+ }];
1041
+ };
1042
+ };
1043
+ readonly tighterSignificance: {
1044
+ readonly summary: "Tighter significance threshold";
1045
+ readonly description: "Drop the p-value cutoff from 0.05 → 0.01. Requires Pro plan or higher.";
1046
+ readonly value: {
1047
+ readonly significance_threshold: 0.01;
1048
+ };
1049
+ };
1050
+ readonly updateMetadata: {
1051
+ readonly summary: "Update metadata";
1052
+ readonly description: "Change description/tag/targeting_gate freely on running experiments.";
1053
+ readonly value: {
1054
+ readonly description: "Bumped to 50% after passing canary on 25%.";
1055
+ readonly tag: "checkout";
1056
+ };
1057
+ };
1058
+ };
1059
+ readonly response: {
1060
+ readonly id: "exp_01j7wb12c3d4e5f6g7h8j9k0l1";
1061
+ };
1062
+ };
1063
+ readonly useCase: string;
1064
+ }, {
1065
+ readonly operationId: "deleteExperiment";
1066
+ readonly method: "DELETE";
1067
+ readonly path: "/{id}";
1068
+ readonly summary: "Delete an experiment";
1069
+ readonly description: "Archives the experiment (soft-delete via status transition). Returns `409` if the experiment is still `running` — stop it first.";
1070
+ readonly pathParams: {
1071
+ readonly id: "Stable opaque experiment id.";
1072
+ };
1073
+ readonly response: zod.ZodObject<{
1074
+ ok: zod.ZodLiteral<true>;
1075
+ }, zod_v4_core.$strip>;
1076
+ readonly examples: {
1077
+ readonly response: {
1078
+ readonly ok: true;
1079
+ };
1080
+ };
1081
+ readonly useCase: "Tear down an experiment after the analysis is signed off.";
1082
+ }, {
1083
+ readonly operationId: "setExperimentStatus";
1084
+ readonly method: "POST";
1085
+ readonly path: "/{id}/status";
1086
+ readonly summary: "Transition experiment status";
1087
+ readonly description: string;
1088
+ readonly pathParams: {
1089
+ readonly id: "Stable opaque experiment id.";
1090
+ };
1091
+ readonly request: zod.ZodObject<{
1092
+ status: zod.ZodEnum<{
1093
+ draft: "draft";
1094
+ running: "running";
1095
+ stopped: "stopped";
1096
+ archived: "archived";
1097
+ }>;
1098
+ }, zod_v4_core.$strip>;
1099
+ readonly response: zod.ZodObject<{
1100
+ id: zod.ZodString;
1101
+ status: zod.ZodEnum<{
1102
+ draft: "draft";
1103
+ running: "running";
1104
+ stopped: "stopped";
1105
+ archived: "archived";
1106
+ }>;
1107
+ }, zod_v4_core.$strip>;
1108
+ readonly examples: {
1109
+ readonly requestExamples: {
1110
+ readonly start: {
1111
+ readonly summary: "Start — draft → running";
1112
+ readonly description: "Begins allocation. The experiment counts against the plan's `experiments_running` limit.";
1113
+ readonly value: {
1114
+ readonly status: "running";
1115
+ };
1116
+ };
1117
+ readonly stop: {
1118
+ readonly summary: "Stop — running → stopped";
1119
+ readonly description: "Halts allocation. Existing exposures remain analysable.";
1120
+ readonly value: {
1121
+ readonly status: "stopped";
1122
+ };
1123
+ };
1124
+ readonly archive: {
1125
+ readonly summary: "Archive — stopped → archived";
1126
+ readonly description: "Soft-deletes the experiment. List endpoints exclude archived rows by default.";
1127
+ readonly value: {
1128
+ readonly status: "archived";
1129
+ };
1130
+ };
1131
+ };
1132
+ readonly response: {
1133
+ readonly id: "exp_01j7wb12c3d4e5f6g7h8j9k0l1";
1134
+ readonly status: "running";
1135
+ };
1136
+ };
1137
+ readonly useCase: string;
1138
+ }, {
1139
+ readonly operationId: "setExperimentMetrics";
1140
+ readonly method: "POST";
1141
+ readonly path: "/{id}/metrics";
1142
+ readonly summary: "Attach metrics";
1143
+ readonly description: string;
1144
+ readonly pathParams: {
1145
+ readonly id: "Stable opaque experiment id.";
1146
+ };
1147
+ readonly request: zod.ZodObject<{
1148
+ metrics: zod.ZodArray<zod.ZodObject<{
1149
+ metric_id: zod.ZodString;
1150
+ role: zod.ZodEnum<{
1151
+ goal: "goal";
1152
+ guardrail: "guardrail";
1153
+ secondary: "secondary";
1154
+ }>;
1155
+ }, zod_v4_core.$strip>>;
1156
+ }, zod_v4_core.$strip>;
1157
+ readonly response: zod.ZodObject<{
1158
+ id: zod.ZodString;
1159
+ metrics: zod.ZodArray<zod.ZodObject<{
1160
+ metric_id: zod.ZodString;
1161
+ role: zod.ZodEnum<{
1162
+ goal: "goal";
1163
+ guardrail: "guardrail";
1164
+ secondary: "secondary";
1165
+ }>;
1166
+ }, zod_v4_core.$strip>>;
1167
+ }, zod_v4_core.$strip>;
1168
+ readonly examples: {
1169
+ readonly requestExamples: {
1170
+ readonly standard: {
1171
+ readonly summary: "Standard — one goal + one guardrail";
1172
+ readonly description: "Attaches one decision metric and one safety metric.";
1173
+ readonly value: {
1174
+ readonly metrics: readonly [{
1175
+ readonly metric_id: "met_checkout_completed";
1176
+ readonly role: "goal";
1177
+ }, {
1178
+ readonly metric_id: "met_page_errors";
1179
+ readonly role: "guardrail";
1180
+ }];
1181
+ };
1182
+ };
1183
+ readonly detach: {
1184
+ readonly summary: "Detach all";
1185
+ readonly description: "Send an empty array to clear every metric.";
1186
+ readonly value: {
1187
+ readonly metrics: readonly [];
1188
+ };
1189
+ };
1190
+ };
1191
+ readonly response: {
1192
+ readonly id: "exp_01j7wb12c3d4e5f6g7h8j9k0l1";
1193
+ readonly metrics: readonly [{
1194
+ readonly metric_id: "met_checkout_completed";
1195
+ readonly role: "goal";
1196
+ }, {
1197
+ readonly metric_id: "met_page_errors";
1198
+ readonly role: "guardrail";
1199
+ }];
1200
+ };
1201
+ };
1202
+ readonly useCase: string;
1203
+ }, {
1204
+ readonly operationId: "getExperimentResults";
1205
+ readonly method: "GET";
1206
+ readonly path: "/{id}/results";
1207
+ readonly summary: "Get analysis results";
1208
+ readonly description: "Returns the latest analysis output for the experiment — one row per metric/group/day, including sample size, mean, % delta vs. control, p-value, and a sample-ratio mismatch flag.";
1209
+ readonly pathParams: {
1210
+ readonly id: "Stable opaque experiment id.";
1211
+ };
1212
+ readonly response: zod.ZodObject<{
1213
+ experiment: zod.ZodObject<{
1214
+ id: zod.ZodString;
1215
+ name: zod.ZodString;
1216
+ status: zod.ZodEnum<{
1217
+ draft: "draft";
1218
+ running: "running";
1219
+ stopped: "stopped";
1220
+ archived: "archived";
1221
+ }>;
1222
+ }, zod_v4_core.$strip>;
1223
+ results: zod.ZodArray<zod.ZodObject<{
1224
+ metric: zod.ZodString;
1225
+ group_name: zod.ZodString;
1226
+ ds: zod.ZodString;
1227
+ n: zod.ZodNullable<zod.ZodNumber>;
1228
+ mean: zod.ZodNullable<zod.ZodNumber>;
1229
+ delta_pct: zod.ZodNullable<zod.ZodNumber>;
1230
+ p_value: zod.ZodNullable<zod.ZodNumber>;
1231
+ srm_detected: zod.ZodNullable<zod.ZodNumber>;
1232
+ }, zod_v4_core.$strip>>;
1233
+ }, zod_v4_core.$strip>;
1234
+ readonly examples: {
1235
+ readonly response: {
1236
+ readonly experiment: {
1237
+ readonly id: "exp_01j7wb12c3d4e5f6g7h8j9k0l1";
1238
+ readonly name: "checkout_button_color";
1239
+ readonly status: "running";
1240
+ };
1241
+ readonly results: readonly [{
1242
+ readonly metric: "checkout_completed";
1243
+ readonly group_name: "control";
1244
+ readonly ds: "2026-05-09";
1245
+ readonly n: 12421;
1246
+ readonly mean: 0.1834;
1247
+ readonly delta_pct: null;
1248
+ readonly p_value: null;
1249
+ readonly srm_detected: 0;
1250
+ }, {
1251
+ readonly metric: "checkout_completed";
1252
+ readonly group_name: "treatment";
1253
+ readonly ds: "2026-05-09";
1254
+ readonly n: 12519;
1255
+ readonly mean: 0.1922;
1256
+ readonly delta_pct: 4.8;
1257
+ readonly p_value: 0.018;
1258
+ readonly srm_detected: 0;
1259
+ }];
1260
+ };
1261
+ };
1262
+ readonly useCase: "Render the results table on the experiment detail page or drive an automated decision once a `goal` metric reaches significance.";
1263
+ }, {
1264
+ readonly operationId: "getExperimentTimeseries";
1265
+ readonly method: "GET";
1266
+ readonly path: "/{id}/timeseries";
1267
+ readonly summary: "Get analysis timeseries";
1268
+ readonly description: "Same row shape as `/results`, but returns every daily slice rather than the latest. Filter to a single metric with the `metric` query parameter.";
1269
+ readonly pathParams: {
1270
+ readonly id: "Stable opaque experiment id.";
1271
+ };
1272
+ readonly queryParams: {
1273
+ readonly metric: {
1274
+ readonly schema: zod.ZodOptional<zod.ZodString>;
1275
+ readonly description: "Optional metric name to filter the series.";
1276
+ };
1277
+ };
1278
+ readonly response: zod.ZodObject<{
1279
+ experiment: zod.ZodObject<{
1280
+ id: zod.ZodString;
1281
+ name: zod.ZodString;
1282
+ status: zod.ZodEnum<{
1283
+ draft: "draft";
1284
+ running: "running";
1285
+ stopped: "stopped";
1286
+ archived: "archived";
1287
+ }>;
1288
+ }, zod_v4_core.$strip>;
1289
+ series: zod.ZodArray<zod.ZodObject<{
1290
+ metric: zod.ZodString;
1291
+ group_name: zod.ZodString;
1292
+ ds: zod.ZodString;
1293
+ n: zod.ZodNullable<zod.ZodNumber>;
1294
+ mean: zod.ZodNullable<zod.ZodNumber>;
1295
+ delta_pct: zod.ZodNullable<zod.ZodNumber>;
1296
+ p_value: zod.ZodNullable<zod.ZodNumber>;
1297
+ srm_detected: zod.ZodNullable<zod.ZodNumber>;
1298
+ }, zod_v4_core.$strip>>;
1299
+ }, zod_v4_core.$strip>;
1300
+ readonly examples: {
1301
+ readonly response: {
1302
+ readonly experiment: {
1303
+ readonly id: "exp_01j7wb12c3d4e5f6g7h8j9k0l1";
1304
+ readonly name: "checkout_button_color";
1305
+ readonly status: "running";
1306
+ };
1307
+ readonly series: readonly [{
1308
+ readonly metric: "checkout_completed";
1309
+ readonly group_name: "treatment";
1310
+ readonly ds: "2026-05-08";
1311
+ readonly n: 11200;
1312
+ readonly mean: 0.1903;
1313
+ readonly delta_pct: 3.9;
1314
+ readonly p_value: 0.034;
1315
+ readonly srm_detected: 0;
1316
+ }, {
1317
+ readonly metric: "checkout_completed";
1318
+ readonly group_name: "treatment";
1319
+ readonly ds: "2026-05-09";
1320
+ readonly n: 12519;
1321
+ readonly mean: 0.1922;
1322
+ readonly delta_pct: 4.8;
1323
+ readonly p_value: 0.018;
1324
+ readonly srm_detected: 0;
1325
+ }];
1326
+ };
1327
+ };
1328
+ readonly useCase: "Drive a chart of metric movement over the experiment runtime, or sanity-check the lift is monotonic before deciding.";
1329
+ }, {
1330
+ readonly operationId: "reanalyzeExperiment";
1331
+ readonly method: "POST";
1332
+ readonly path: "/{id}/reanalyze";
1333
+ readonly summary: "Re-queue analysis";
1334
+ readonly description: "Requeues the daily analysis pass for this experiment outside the normal cron cadence. Useful after attaching a new metric or correcting an event taxonomy. The job runs asynchronously.";
1335
+ readonly pathParams: {
1336
+ readonly id: "Stable opaque experiment id.";
1337
+ };
1338
+ readonly response: zod.ZodObject<{
1339
+ id: zod.ZodString;
1340
+ queued: zod.ZodLiteral<true>;
1341
+ }, zod_v4_core.$strip>;
1342
+ readonly examples: {
1343
+ readonly response: {
1344
+ readonly id: "exp_01j7wb12c3d4e5f6g7h8j9k0l1";
1345
+ readonly queued: true;
1346
+ };
1347
+ };
1348
+ readonly useCase: "Force-refresh results after wiring up a new metric without waiting for the next nightly cron tick.";
1349
+ }];
1350
+ }, {
1351
+ readonly name: "configs";
1352
+ readonly basePath: "/api/admin/configs";
1353
+ readonly describeOne: "config";
1354
+ readonly describeMany: "configs";
1355
+ readonly tag: {
1356
+ readonly name: "Configs";
1357
+ readonly description: string;
1358
+ };
1359
+ readonly schemas: {
1360
+ readonly create: zod.ZodObject<{
1361
+ name: zod.ZodString;
1362
+ description: zod.ZodOptional<zod.ZodString>;
1363
+ schema: zod.ZodRecord<zod.ZodString, zod.ZodUnknown>;
1364
+ value: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodUnknown, zod.ZodRecord<zod.ZodEnum<{
1365
+ dev: "dev";
1366
+ staging: "staging";
1367
+ prod: "prod";
1368
+ }>, zod.ZodUnknown>]>>;
1369
+ }, zod_v4_core.$strip>;
1370
+ readonly update: zod.ZodObject<{
1371
+ schema: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
1372
+ value: zod.ZodOptional<zod.ZodUnknown>;
1373
+ }, zod_v4_core.$strip>;
1374
+ readonly saveDraft: zod.ZodObject<{
1375
+ env: zod.ZodEnum<{
1376
+ dev: "dev";
1377
+ staging: "staging";
1378
+ prod: "prod";
1379
+ }>;
1380
+ value: zod.ZodUnknown;
1381
+ }, zod_v4_core.$strip>;
1382
+ readonly publish: zod.ZodObject<{
1383
+ env: zod.ZodEnum<{
1384
+ dev: "dev";
1385
+ staging: "staging";
1386
+ prod: "prod";
1387
+ }>;
1388
+ }, zod_v4_core.$strip>;
1389
+ };
1390
+ readonly actions: readonly [{
1391
+ readonly name: "publish";
1392
+ readonly description: "Publish a config draft for an env";
1393
+ }, {
1394
+ readonly name: "saveDraft";
1395
+ readonly description: "Save a draft value for an env";
1396
+ }, {
1397
+ readonly name: "discardDraft";
1398
+ readonly description: "Discard a draft for an env";
1399
+ }];
1400
+ readonly endpoints: readonly [{
1401
+ readonly operationId: "listConfigs";
1402
+ readonly method: "GET";
1403
+ readonly path: "";
1404
+ readonly summary: "List dynamic configs";
1405
+ 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.";
1406
+ readonly response: zod.ZodObject<{
1407
+ data: zod.ZodArray<zod.ZodObject<{
1408
+ id: zod.ZodString;
1409
+ name: zod.ZodString;
1410
+ description: zod.ZodNullable<zod.ZodString>;
1411
+ schema: zod.ZodRecord<zod.ZodString, zod.ZodUnknown>;
1412
+ updatedAt: zod.ZodString;
1413
+ envs: zod.ZodRecord<zod.ZodEnum<{
1414
+ dev: "dev";
1415
+ staging: "staging";
1416
+ prod: "prod";
1417
+ }>, zod.ZodObject<{
1418
+ version: zod.ZodNumber;
1419
+ publishedAt: zod.ZodString;
1420
+ publishedBy: zod.ZodString;
1421
+ }, zod_v4_core.$strip>>;
1422
+ drafts: zod.ZodRecord<zod.ZodEnum<{
1423
+ dev: "dev";
1424
+ staging: "staging";
1425
+ prod: "prod";
1426
+ }>, zod.ZodObject<{
1427
+ updatedAt: zod.ZodString;
1428
+ authorEmail: zod.ZodString;
1429
+ baseVersion: zod.ZodNumber;
1430
+ }, zod_v4_core.$strip>>;
1431
+ values: zod.ZodOptional<zod.ZodRecord<zod.ZodEnum<{
1432
+ dev: "dev";
1433
+ staging: "staging";
1434
+ prod: "prod";
1435
+ }>, zod.ZodUnknown>>;
1436
+ draftValues: zod.ZodOptional<zod.ZodRecord<zod.ZodEnum<{
1437
+ dev: "dev";
1438
+ staging: "staging";
1439
+ prod: "prod";
1440
+ }>, zod.ZodUnknown>>;
1441
+ }, zod_v4_core.$strip>>;
1442
+ next_cursor: zod.ZodNullable<zod.ZodString>;
1443
+ }, zod_v4_core.$strip>;
1444
+ readonly examples: {
1445
+ readonly response: {
1446
+ readonly data: readonly [{
1447
+ id: string;
1448
+ name: string;
1449
+ description: string;
1450
+ schema: {
1451
+ type: string;
1452
+ properties: {
1453
+ tiers: {
1454
+ type: string;
1455
+ items: {
1456
+ type: string;
1457
+ };
1458
+ };
1459
+ };
1460
+ required: string[];
1461
+ };
1462
+ updatedAt: string;
1463
+ envs: {
1464
+ dev: {
1465
+ version: number;
1466
+ publishedAt: string;
1467
+ publishedBy: string;
1468
+ };
1469
+ stage: {
1470
+ version: number;
1471
+ publishedAt: string;
1472
+ publishedBy: string;
1473
+ };
1474
+ prod: {
1475
+ version: number;
1476
+ publishedAt: string;
1477
+ publishedBy: string;
1478
+ };
1479
+ };
1480
+ drafts: {
1481
+ dev: {
1482
+ updatedAt: string;
1483
+ authorEmail: string;
1484
+ baseVersion: number;
1485
+ };
1486
+ };
1487
+ }];
1488
+ readonly next_cursor: null;
1489
+ };
1490
+ };
1491
+ 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.";
1492
+ }, {
1493
+ readonly operationId: "getConfig";
1494
+ readonly method: "GET";
1495
+ readonly path: "/{id}";
1496
+ readonly summary: "Get one config";
1497
+ 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.";
1498
+ readonly pathParams: {
1499
+ readonly id: "Stable opaque config id (`cfg_…`) or the config's `name`.";
1500
+ };
1501
+ readonly response: zod.ZodObject<{
1502
+ id: zod.ZodString;
1503
+ name: zod.ZodString;
1504
+ description: zod.ZodNullable<zod.ZodString>;
1505
+ schema: zod.ZodRecord<zod.ZodString, zod.ZodUnknown>;
1506
+ updatedAt: zod.ZodString;
1507
+ envs: zod.ZodRecord<zod.ZodEnum<{
1508
+ dev: "dev";
1509
+ staging: "staging";
1510
+ prod: "prod";
1511
+ }>, zod.ZodObject<{
1512
+ version: zod.ZodNumber;
1513
+ publishedAt: zod.ZodString;
1514
+ publishedBy: zod.ZodString;
1515
+ }, zod_v4_core.$strip>>;
1516
+ drafts: zod.ZodRecord<zod.ZodEnum<{
1517
+ dev: "dev";
1518
+ staging: "staging";
1519
+ prod: "prod";
1520
+ }>, zod.ZodObject<{
1521
+ updatedAt: zod.ZodString;
1522
+ authorEmail: zod.ZodString;
1523
+ baseVersion: zod.ZodNumber;
1524
+ }, zod_v4_core.$strip>>;
1525
+ values: zod.ZodOptional<zod.ZodRecord<zod.ZodEnum<{
1526
+ dev: "dev";
1527
+ staging: "staging";
1528
+ prod: "prod";
1529
+ }>, zod.ZodUnknown>>;
1530
+ draftValues: zod.ZodOptional<zod.ZodRecord<zod.ZodEnum<{
1531
+ dev: "dev";
1532
+ staging: "staging";
1533
+ prod: "prod";
1534
+ }>, zod.ZodUnknown>>;
1535
+ }, zod_v4_core.$strip>;
1536
+ readonly examples: {
1537
+ readonly response: {
1538
+ readonly values: {
1539
+ readonly dev: {
1540
+ readonly tiers: readonly [{
1541
+ readonly name: "free";
1542
+ }, {
1543
+ readonly name: "pro";
1544
+ }];
1545
+ };
1546
+ readonly stage: {
1547
+ readonly tiers: readonly [{
1548
+ readonly name: "free";
1549
+ }, {
1550
+ readonly name: "pro";
1551
+ }];
1552
+ };
1553
+ readonly prod: {
1554
+ readonly tiers: readonly [{
1555
+ readonly name: "free";
1556
+ }, {
1557
+ readonly name: "pro";
1558
+ }];
1559
+ };
1560
+ };
1561
+ readonly draftValues: {
1562
+ readonly dev: {
1563
+ readonly tiers: readonly [{
1564
+ readonly name: "free";
1565
+ }, {
1566
+ readonly name: "pro";
1567
+ }, {
1568
+ readonly name: "enterprise";
1569
+ }];
1570
+ };
1571
+ };
1572
+ readonly id: string;
1573
+ readonly name: string;
1574
+ readonly description: string;
1575
+ readonly schema: {
1576
+ type: string;
1577
+ properties: {
1578
+ tiers: {
1579
+ type: string;
1580
+ items: {
1581
+ type: string;
1582
+ };
1583
+ };
1584
+ };
1585
+ required: string[];
1586
+ };
1587
+ readonly updatedAt: string;
1588
+ readonly envs: {
1589
+ dev: {
1590
+ version: number;
1591
+ publishedAt: string;
1592
+ publishedBy: string;
1593
+ };
1594
+ stage: {
1595
+ version: number;
1596
+ publishedAt: string;
1597
+ publishedBy: string;
1598
+ };
1599
+ prod: {
1600
+ version: number;
1601
+ publishedAt: string;
1602
+ publishedBy: string;
1603
+ };
1604
+ };
1605
+ readonly drafts: {
1606
+ dev: {
1607
+ updatedAt: string;
1608
+ authorEmail: string;
1609
+ baseVersion: number;
1610
+ };
1611
+ };
1612
+ };
1613
+ };
1614
+ readonly useCase: "Fetch one config's current published values and any in-flight drafts.";
1615
+ }, {
1616
+ readonly operationId: "createConfig";
1617
+ readonly method: "POST";
1618
+ readonly path: "";
1619
+ readonly summary: "Create a dynamic config";
1620
+ readonly description: string;
1621
+ readonly successStatus: 201;
1622
+ readonly request: zod.ZodObject<{
1623
+ name: zod.ZodString;
1624
+ description: zod.ZodOptional<zod.ZodString>;
1625
+ schema: zod.ZodRecord<zod.ZodString, zod.ZodUnknown>;
1626
+ value: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodUnknown, zod.ZodRecord<zod.ZodEnum<{
1627
+ dev: "dev";
1628
+ staging: "staging";
1629
+ prod: "prod";
1630
+ }>, zod.ZodUnknown>]>>;
1631
+ }, zod_v4_core.$strip>;
1632
+ readonly response: zod.ZodObject<{
1633
+ id: zod.ZodString;
1634
+ name: zod.ZodString;
1635
+ }, zod_v4_core.$strip>;
1636
+ readonly examples: {
1637
+ readonly requestExamples: {
1638
+ readonly minimal: {
1639
+ readonly summary: "Minimal — name + schema";
1640
+ readonly description: "Smallest valid body. Initial value defaults to `{}` on every env.";
1641
+ readonly value: {
1642
+ readonly name: "pricing.tiers";
1643
+ readonly schema: {
1644
+ readonly type: "object";
1645
+ readonly properties: {
1646
+ readonly tiers: {
1647
+ readonly type: "array";
1648
+ };
1649
+ };
1650
+ readonly required: readonly ["tiers"];
1651
+ };
1652
+ };
1653
+ };
1654
+ readonly seededValue: {
1655
+ readonly summary: "Seeded — schema + initial value";
1656
+ readonly description: "Seed the same JSON object on every env at version 1.";
1657
+ readonly value: {
1658
+ readonly name: "pricing.tiers";
1659
+ readonly description: "Pricing tier definitions consumed by checkout.";
1660
+ readonly schema: {
1661
+ readonly type: "object";
1662
+ readonly properties: {
1663
+ readonly tiers: {
1664
+ readonly type: "array";
1665
+ };
1666
+ };
1667
+ readonly required: readonly ["tiers"];
1668
+ };
1669
+ readonly value: {
1670
+ readonly tiers: readonly [{
1671
+ readonly name: "free";
1672
+ }, {
1673
+ readonly name: "pro";
1674
+ }];
1675
+ };
1676
+ };
1677
+ };
1678
+ readonly perEnvSeed: {
1679
+ readonly summary: "Per-env seed";
1680
+ readonly description: "Pass a `{ env: value }` map to seed different initial values per env.";
1681
+ readonly value: {
1682
+ readonly name: "pricing.tiers";
1683
+ readonly schema: {
1684
+ readonly type: "object";
1685
+ readonly properties: {
1686
+ readonly tiers: {
1687
+ readonly type: "array";
1688
+ };
1689
+ };
1690
+ readonly required: readonly ["tiers"];
1691
+ };
1692
+ readonly value: {
1693
+ readonly dev: {
1694
+ readonly tiers: readonly [{
1695
+ readonly name: "free";
1696
+ }, {
1697
+ readonly name: "pro";
1698
+ }, {
1699
+ readonly name: "enterprise";
1700
+ }];
1701
+ };
1702
+ readonly stage: {
1703
+ readonly tiers: readonly [{
1704
+ readonly name: "free";
1705
+ }, {
1706
+ readonly name: "pro";
1707
+ }];
1708
+ };
1709
+ readonly prod: {
1710
+ readonly tiers: readonly [{
1711
+ readonly name: "free";
1712
+ }, {
1713
+ readonly name: "pro";
1714
+ }];
1715
+ };
1716
+ };
1717
+ };
1718
+ };
1719
+ };
1720
+ readonly response: {
1721
+ readonly id: "cfg_01j7wae5h6j7k8l9m0n1p2q3r4";
1722
+ readonly name: "pricing.tiers";
1723
+ };
1724
+ };
1725
+ readonly useCase: string;
1726
+ }, {
1727
+ readonly operationId: "updateConfig";
1728
+ readonly method: "PATCH";
1729
+ readonly path: "/{id}";
1730
+ readonly summary: "Update a dynamic config";
1731
+ readonly description: string;
1732
+ readonly pathParams: {
1733
+ readonly id: "Stable opaque config id.";
1734
+ };
1735
+ readonly request: zod.ZodObject<{
1736
+ schema: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
1737
+ value: zod.ZodOptional<zod.ZodUnknown>;
1738
+ }, zod_v4_core.$strip>;
1739
+ readonly response: zod.ZodObject<{
1740
+ id: zod.ZodString;
1741
+ }, zod_v4_core.$strip>;
1742
+ readonly examples: {
1743
+ readonly requestExamples: {
1744
+ readonly flatValue: {
1745
+ readonly summary: "Flat value — republish on every env";
1746
+ readonly description: "Sets the same JSON object as a new version on dev/stage/prod.";
1747
+ readonly value: {
1748
+ readonly value: {
1749
+ readonly tiers: readonly [{
1750
+ readonly name: "free";
1751
+ }, {
1752
+ readonly name: "pro";
1753
+ }];
1754
+ };
1755
+ };
1756
+ };
1757
+ readonly schemaOnly: {
1758
+ readonly summary: "Schema-only update";
1759
+ readonly description: "Replaces the schema. Existing values must still validate or the update fails.";
1760
+ readonly value: {
1761
+ readonly schema: {
1762
+ readonly type: "object";
1763
+ readonly properties: {
1764
+ readonly tiers: {
1765
+ readonly type: "array";
1766
+ };
1767
+ readonly trial_days: {
1768
+ readonly type: "integer";
1769
+ };
1770
+ };
1771
+ readonly required: readonly ["tiers"];
1772
+ };
1773
+ };
1774
+ };
1775
+ };
1776
+ readonly response: {
1777
+ readonly id: "cfg_01j7wae5h6j7k8l9m0n1p2q3r4";
1778
+ };
1779
+ };
1780
+ readonly useCase: string;
1781
+ }, {
1782
+ readonly operationId: "deleteConfig";
1783
+ readonly method: "DELETE";
1784
+ readonly path: "/{id}";
1785
+ readonly summary: "Delete a dynamic config";
1786
+ readonly description: "Soft-deletes the config and rebuilds the project's flags KV blob.";
1787
+ readonly pathParams: {
1788
+ readonly id: "Stable opaque config id.";
1789
+ };
1790
+ readonly response: zod.ZodObject<{
1791
+ ok: zod.ZodLiteral<true>;
1792
+ }, zod_v4_core.$strip>;
1793
+ readonly examples: {
1794
+ readonly response: {
1795
+ readonly ok: true;
1796
+ };
1797
+ };
1798
+ readonly useCase: "Tear down a config after its consumers have stopped reading it.";
1799
+ }, {
1800
+ readonly operationId: "saveConfigDraft";
1801
+ readonly method: "PUT";
1802
+ readonly path: "/{id}/drafts";
1803
+ readonly summary: "Save a draft value";
1804
+ readonly description: string;
1805
+ readonly pathParams: {
1806
+ readonly id: "Stable opaque config id.";
1807
+ };
1808
+ readonly request: zod.ZodObject<{
1809
+ env: zod.ZodEnum<{
1810
+ dev: "dev";
1811
+ staging: "staging";
1812
+ prod: "prod";
1813
+ }>;
1814
+ value: zod.ZodUnknown;
1815
+ }, zod_v4_core.$strip>;
1816
+ readonly response: zod.ZodObject<{
1817
+ id: zod.ZodString;
1818
+ env: zod.ZodEnum<{
1819
+ dev: "dev";
1820
+ staging: "staging";
1821
+ prod: "prod";
1822
+ }>;
1823
+ baseVersion: zod.ZodNumber;
1824
+ updatedAt: zod.ZodString;
1825
+ }, zod_v4_core.$strip>;
1826
+ readonly examples: {
1827
+ readonly requestExamples: {
1828
+ readonly stageDev: {
1829
+ readonly summary: "Stage a dev draft";
1830
+ readonly description: "Stages a new value on dev without touching stage/prod.";
1831
+ readonly value: {
1832
+ readonly env: "dev";
1833
+ readonly value: {
1834
+ readonly tiers: readonly [{
1835
+ readonly name: "free";
1836
+ }, {
1837
+ readonly name: "pro";
1838
+ }, {
1839
+ readonly name: "enterprise";
1840
+ }];
1841
+ };
1842
+ };
1843
+ };
1844
+ };
1845
+ readonly response: {
1846
+ readonly id: "cfg_01j7wae5h6j7k8l9m0n1p2q3r4";
1847
+ readonly env: "dev";
1848
+ readonly baseVersion: 5;
1849
+ readonly updatedAt: "2026-05-10T09:31:00.000Z";
1850
+ };
1851
+ };
1852
+ readonly useCase: "Iterate on a config value on dev without affecting prod — preview in staging, then publish.";
1853
+ }, {
1854
+ readonly operationId: "discardConfigDraft";
1855
+ readonly method: "DELETE";
1856
+ readonly path: "/{id}/drafts";
1857
+ readonly summary: "Discard a draft";
1858
+ readonly description: "Drops the in-flight draft on one env. Published values are unaffected.";
1859
+ readonly pathParams: {
1860
+ readonly id: "Stable opaque config id.";
1861
+ };
1862
+ readonly request: zod.ZodObject<{
1863
+ env: zod.ZodEnum<{
1864
+ dev: "dev";
1865
+ staging: "staging";
1866
+ prod: "prod";
1867
+ }>;
1868
+ }, zod_v4_core.$strip>;
1869
+ readonly response: zod.ZodObject<{
1870
+ ok: zod.ZodLiteral<true>;
1871
+ }, zod_v4_core.$strip>;
1872
+ readonly examples: {
1873
+ readonly requestExamples: {
1874
+ readonly discardDev: {
1875
+ readonly summary: "Discard the dev draft";
1876
+ readonly description: "Drops the staged dev draft without publishing.";
1877
+ readonly value: {
1878
+ readonly env: "dev";
1879
+ };
1880
+ };
1881
+ };
1882
+ readonly response: {
1883
+ readonly ok: true;
1884
+ };
1885
+ };
1886
+ readonly useCase: "Abandon an in-progress draft after deciding not to ship it.";
1887
+ }, {
1888
+ readonly operationId: "publishConfigDraft";
1889
+ readonly method: "POST";
1890
+ readonly path: "/{id}/publish";
1891
+ readonly summary: "Publish a draft";
1892
+ readonly description: string;
1893
+ readonly pathParams: {
1894
+ readonly id: "Stable opaque config id.";
1895
+ };
1896
+ readonly request: zod.ZodObject<{
1897
+ env: zod.ZodEnum<{
1898
+ dev: "dev";
1899
+ staging: "staging";
1900
+ prod: "prod";
1901
+ }>;
1902
+ }, zod_v4_core.$strip>;
1903
+ readonly response: zod.ZodObject<{
1904
+ id: zod.ZodString;
1905
+ env: zod.ZodEnum<{
1906
+ dev: "dev";
1907
+ staging: "staging";
1908
+ prod: "prod";
1909
+ }>;
1910
+ version: zod.ZodNumber;
1911
+ }, zod_v4_core.$strip>;
1912
+ readonly examples: {
1913
+ readonly requestExamples: {
1914
+ readonly publishDev: {
1915
+ readonly summary: "Publish the dev draft";
1916
+ readonly description: "Promotes the dev draft to a new published version on dev.";
1917
+ readonly value: {
1918
+ readonly env: "dev";
1919
+ };
1920
+ };
1921
+ readonly publishProd: {
1922
+ readonly summary: "Publish to prod";
1923
+ readonly description: "Promotes the prod draft after staging signed off.";
1924
+ readonly value: {
1925
+ readonly env: "prod";
1926
+ };
1927
+ };
1928
+ };
1929
+ readonly response: {
1930
+ readonly id: "cfg_01j7wae5h6j7k8l9m0n1p2q3r4";
1931
+ readonly env: "dev";
1932
+ readonly version: 6;
1933
+ };
1934
+ };
1935
+ readonly useCase: "Ship a staged change once you've validated it on a lower env.";
1936
+ }, {
1937
+ readonly operationId: "listConfigActivity";
1938
+ readonly method: "GET";
1939
+ readonly path: "/{id}/activity";
1940
+ readonly summary: "List config activity";
1941
+ 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).";
1942
+ readonly pathParams: {
1943
+ readonly id: "Stable opaque config id.";
1944
+ };
1945
+ readonly queryParams: {
1946
+ readonly limit: {
1947
+ readonly schema: zod.ZodDefault<zod.ZodCoercedNumber<unknown>>;
1948
+ readonly description: "Max rows to return (1–100). Defaults to 20.";
1949
+ };
1950
+ };
1951
+ readonly response: zod.ZodArray<zod.ZodObject<{
1952
+ id: zod.ZodString;
1953
+ action: zod.ZodString;
1954
+ actorEmail: zod.ZodString;
1955
+ actorType: zod.ZodEnum<{
1956
+ user: "user";
1957
+ cli: "cli";
1958
+ system: "system";
1959
+ }>;
1960
+ payload: zod.ZodNullable<zod.ZodUnknown>;
1961
+ createdAt: zod.ZodString;
1962
+ }, zod_v4_core.$strip>>;
1963
+ readonly examples: {
1964
+ readonly response: readonly [{
1965
+ readonly id: "act_01j7waf01a2b3c4d5e6f7g8h9i";
1966
+ readonly action: "config.publish";
1967
+ readonly actorEmail: "ana@example.com";
1968
+ readonly actorType: "user";
1969
+ readonly payload: {
1970
+ readonly env: "dev";
1971
+ readonly version: 6;
1972
+ };
1973
+ readonly createdAt: "2026-05-10T09:31:42.000Z";
1974
+ }];
1975
+ };
1976
+ readonly useCase: "Render the activity panel in the config editor or drive a slack notification on publish events.";
1977
+ }];
1978
+ }, {
1979
+ readonly name: "universes";
1980
+ readonly basePath: "/api/admin/universes";
1981
+ readonly describeOne: "universe";
1982
+ readonly describeMany: "universes";
1983
+ readonly tag: {
1984
+ readonly name: "Universes";
1985
+ readonly description: string;
1986
+ };
1987
+ readonly schemas: {
1988
+ readonly create: zod.ZodObject<{
1989
+ name: zod.ZodString;
1990
+ unit_type: zod.ZodDefault<zod.ZodString>;
1991
+ holdout_range: zod.ZodDefault<zod.ZodNullable<zod.ZodTuple<[zod.ZodNumber, zod.ZodNumber], null>>>;
1992
+ }, zod_v4_core.$strip>;
1993
+ readonly update: zod.ZodObject<{
1994
+ holdout_range: zod.ZodOptional<zod.ZodNullable<zod.ZodTuple<[zod.ZodNumber, zod.ZodNumber], null>>>;
1995
+ }, zod_v4_core.$strip>;
1996
+ };
1997
+ readonly actions: readonly [];
1998
+ readonly endpoints: readonly [{
1999
+ readonly operationId: "listUniverses";
2000
+ readonly method: "GET";
2001
+ readonly path: "";
2002
+ readonly summary: "List universes";
2003
+ readonly description: "Returns a single page of universes ordered by `created_at desc, id desc`. The universes table has no `updated_at`, so this list is keyed on creation time.";
2004
+ readonly response: zod.ZodObject<{
2005
+ data: zod.ZodArray<zod.ZodObject<{
2006
+ id: zod.ZodString;
2007
+ name: zod.ZodString;
2008
+ unitType: zod.ZodString;
2009
+ holdoutRange: zod.ZodNullable<zod.ZodTuple<[zod.ZodNumber, zod.ZodNumber], null>>;
2010
+ createdAt: zod.ZodString;
2011
+ }, zod_v4_core.$strip>>;
2012
+ next_cursor: zod.ZodNullable<zod.ZodString>;
2013
+ }, zod_v4_core.$strip>;
2014
+ readonly examples: {
2015
+ readonly response: {
2016
+ readonly data: readonly [{
2017
+ readonly id: "uni_01j7w8a1b2c3d4e5f6g7h8i9j0";
2018
+ readonly name: "primary_users";
2019
+ readonly unitType: "user_id";
2020
+ readonly holdoutRange: readonly [9500, 9999];
2021
+ readonly createdAt: "2026-04-12T10:14:08.000Z";
2022
+ }];
2023
+ readonly next_cursor: null;
2024
+ };
2025
+ };
2026
+ readonly useCase: "Snapshot every universe in the project — for example to audit which `unit_type` and `holdout_range` are in use before launching a new experiment.";
2027
+ }, {
2028
+ readonly operationId: "createUniverse";
2029
+ readonly method: "POST";
2030
+ readonly path: "";
2031
+ readonly summary: "Create a universe";
2032
+ readonly description: string;
2033
+ readonly successStatus: 201;
2034
+ readonly request: zod.ZodObject<{
2035
+ name: zod.ZodString;
2036
+ unit_type: zod.ZodDefault<zod.ZodString>;
2037
+ holdout_range: zod.ZodDefault<zod.ZodNullable<zod.ZodTuple<[zod.ZodNumber, zod.ZodNumber], null>>>;
2038
+ }, zod_v4_core.$strip>;
2039
+ readonly response: zod.ZodObject<{
2040
+ id: zod.ZodString;
2041
+ name: zod.ZodString;
2042
+ }, zod_v4_core.$strip>;
2043
+ readonly examples: {
2044
+ readonly requestExamples: {
2045
+ readonly minimal: {
2046
+ readonly summary: "Minimal — name only";
2047
+ readonly description: "Smallest valid body. Creates a `user_id`-keyed universe with no holdout.";
2048
+ readonly value: {
2049
+ readonly name: "primary_users";
2050
+ };
2051
+ };
2052
+ readonly holdout: {
2053
+ readonly summary: "Holdout — reserve 5% for measurement";
2054
+ readonly description: "Reserves buckets 9500–9999 (5% of callers) as the holdout. Pro plan or higher.";
2055
+ readonly value: {
2056
+ readonly name: "primary_users";
2057
+ readonly holdout_range: readonly [9500, 9999];
2058
+ };
2059
+ };
2060
+ readonly accountLevel: {
2061
+ readonly summary: "Account-level randomisation";
2062
+ readonly description: "Bucket whole accounts together via `unit_type: 'account_id'`.";
2063
+ readonly value: {
2064
+ readonly name: "saas_accounts";
2065
+ readonly unit_type: "account_id";
2066
+ };
2067
+ };
2068
+ };
2069
+ readonly response: {
2070
+ readonly id: "uni_01j7w8a1b2c3d4e5f6g7h8i9j0";
2071
+ readonly name: "primary_users";
2072
+ };
2073
+ };
2074
+ readonly useCase: string;
2075
+ }, {
2076
+ readonly operationId: "updateUniverse";
2077
+ readonly method: "PATCH";
2078
+ readonly path: "/{id}";
2079
+ readonly summary: "Update a universe";
2080
+ readonly description: string;
2081
+ readonly pathParams: {
2082
+ readonly id: "Stable opaque universe id (`uni_…`).";
2083
+ };
2084
+ readonly request: zod.ZodObject<{
2085
+ holdout_range: zod.ZodOptional<zod.ZodNullable<zod.ZodTuple<[zod.ZodNumber, zod.ZodNumber], null>>>;
2086
+ }, zod_v4_core.$strip>;
2087
+ readonly response: zod.ZodObject<{
2088
+ id: zod.ZodString;
2089
+ }, zod_v4_core.$strip>;
2090
+ readonly examples: {
2091
+ readonly requestExamples: {
2092
+ readonly setHoldout: {
2093
+ readonly summary: "Set holdout — reserve 5%";
2094
+ readonly description: "Reserve buckets 9500–9999 as the holdout. Pro plan or higher.";
2095
+ readonly value: {
2096
+ readonly holdout_range: readonly [9500, 9999];
2097
+ };
2098
+ };
2099
+ readonly removeHoldout: {
2100
+ readonly summary: "Remove holdout";
2101
+ readonly description: "Disable the holdout entirely.";
2102
+ readonly value: {
2103
+ readonly holdout_range: null;
2104
+ };
2105
+ };
2106
+ };
2107
+ readonly response: {
2108
+ readonly id: "uni_01j7w8a1b2c3d4e5f6g7h8i9j0";
2109
+ };
2110
+ };
2111
+ readonly useCase: string;
2112
+ }, {
2113
+ readonly operationId: "deleteUniverse";
2114
+ readonly method: "DELETE";
2115
+ readonly path: "/{id}";
2116
+ readonly summary: "Delete a universe";
2117
+ readonly description: "Soft-deletes the universe. Returns `409` if any non-archived experiment still references it — archive those experiments first.";
2118
+ readonly pathParams: {
2119
+ readonly id: "Stable opaque universe id.";
2120
+ };
2121
+ readonly response: zod.ZodObject<{
2122
+ ok: zod.ZodLiteral<true>;
2123
+ }, zod_v4_core.$strip>;
2124
+ readonly examples: {
2125
+ readonly response: {
2126
+ readonly ok: true;
2127
+ };
2128
+ };
2129
+ readonly useCase: "Tear down a universe after every experiment that used it has been archived.";
2130
+ }];
2131
+ }, {
2132
+ readonly name: "killswitches";
2133
+ readonly basePath: "/api/admin/killswitches";
2134
+ readonly describeOne: "killswitch";
2135
+ readonly describeMany: "killswitches";
2136
+ readonly tag: {
2137
+ readonly name: "Killswitches";
2138
+ readonly description: string;
2139
+ };
2140
+ readonly schemas: {
2141
+ readonly create: zod.ZodObject<{
2142
+ name: zod.ZodString;
2143
+ description: zod.ZodOptional<zod.ZodString>;
2144
+ value: zod.ZodOptional<zod.ZodBoolean>;
2145
+ switches: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodBoolean>>;
2146
+ }, zod_v4_core.$strip>;
2147
+ readonly update: zod.ZodObject<{
2148
+ description: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
2149
+ value: zod.ZodOptional<zod.ZodBoolean>;
2150
+ switches: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodBoolean>>;
2151
+ }, zod_v4_core.$strip>;
2152
+ readonly setSwitch: zod.ZodObject<{
2153
+ env: zod.ZodEnum<{
2154
+ dev: "dev";
2155
+ staging: "staging";
2156
+ prod: "prod";
2157
+ }>;
2158
+ switchKey: zod.ZodString;
2159
+ value: zod.ZodBoolean;
2160
+ }, zod_v4_core.$strip>;
2161
+ readonly unsetSwitch: zod.ZodObject<{
2162
+ env: zod.ZodEnum<{
2163
+ dev: "dev";
2164
+ staging: "staging";
2165
+ prod: "prod";
2166
+ }>;
2167
+ switchKey: zod.ZodString;
2168
+ }, zod_v4_core.$strip>;
2169
+ };
2170
+ readonly actions: readonly [{
2171
+ readonly name: "setSwitch";
2172
+ readonly description: "Set or update one switch entry on one env";
2173
+ }, {
2174
+ readonly name: "unsetSwitch";
2175
+ readonly description: "Remove one switch entry from one env";
2176
+ }];
2177
+ readonly endpoints: readonly [{
2178
+ readonly operationId: "listKillswitches";
2179
+ readonly method: "GET";
2180
+ readonly path: "";
2181
+ readonly summary: "List killswitches";
2182
+ readonly description: "Returns a single page of killswitches ordered by `updated_at desc, id desc`. Each row includes the latest published `value`/`switches`/`version` per env.";
2183
+ readonly response: zod.ZodObject<{
2184
+ data: zod.ZodArray<zod.ZodObject<{
2185
+ id: zod.ZodString;
2186
+ name: zod.ZodString;
2187
+ description: zod.ZodNullable<zod.ZodString>;
2188
+ updatedAt: zod.ZodString;
2189
+ envs: zod.ZodRecord<zod.ZodEnum<{
2190
+ dev: "dev";
2191
+ staging: "staging";
2192
+ prod: "prod";
2193
+ }>, zod.ZodObject<{
2194
+ value: zod.ZodBoolean;
2195
+ switches: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodBoolean>>;
2196
+ version: zod.ZodNumber;
2197
+ publishedAt: zod.ZodString;
2198
+ }, zod_v4_core.$strip>>;
2199
+ }, zod_v4_core.$strip>>;
2200
+ next_cursor: zod.ZodNullable<zod.ZodString>;
2201
+ }, zod_v4_core.$strip>;
2202
+ readonly examples: {
2203
+ readonly response: {
2204
+ readonly data: readonly [{
2205
+ id: string;
2206
+ name: string;
2207
+ description: string;
2208
+ updatedAt: string;
2209
+ envs: {
2210
+ dev: {
2211
+ value: boolean;
2212
+ version: number;
2213
+ publishedAt: string;
2214
+ };
2215
+ stage: {
2216
+ value: boolean;
2217
+ version: number;
2218
+ publishedAt: string;
2219
+ };
2220
+ prod: {
2221
+ value: boolean;
2222
+ switches: {
2223
+ eu_region: boolean;
2224
+ };
2225
+ version: number;
2226
+ publishedAt: string;
2227
+ };
2228
+ };
2229
+ }];
2230
+ readonly next_cursor: null;
2231
+ };
2232
+ };
2233
+ readonly useCase: "Snapshot every killswitch in the project — e.g. to render an incident-response runbook listing every kill and its current trip state.";
2234
+ }, {
2235
+ readonly operationId: "getKillswitch";
2236
+ readonly method: "GET";
2237
+ readonly path: "/{id}";
2238
+ readonly summary: "Get one killswitch";
2239
+ readonly description: "Returns the killswitch metadata plus the latest published `value`/`switches`/`version` per env.";
2240
+ readonly pathParams: {
2241
+ readonly id: "Stable opaque killswitch id (`ksw_…`).";
2242
+ };
2243
+ readonly response: zod.ZodObject<{
2244
+ id: zod.ZodString;
2245
+ name: zod.ZodString;
2246
+ description: zod.ZodNullable<zod.ZodString>;
2247
+ updatedAt: zod.ZodString;
2248
+ envs: zod.ZodRecord<zod.ZodEnum<{
2249
+ dev: "dev";
2250
+ staging: "staging";
2251
+ prod: "prod";
2252
+ }>, zod.ZodObject<{
2253
+ value: zod.ZodBoolean;
2254
+ switches: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodBoolean>>;
2255
+ version: zod.ZodNumber;
2256
+ publishedAt: zod.ZodString;
2257
+ }, zod_v4_core.$strip>>;
2258
+ }, zod_v4_core.$strip>;
2259
+ readonly examples: {
2260
+ readonly response: {
2261
+ id: string;
2262
+ name: string;
2263
+ description: string;
2264
+ updatedAt: string;
2265
+ envs: {
2266
+ dev: {
2267
+ value: boolean;
2268
+ version: number;
2269
+ publishedAt: string;
2270
+ };
2271
+ stage: {
2272
+ value: boolean;
2273
+ version: number;
2274
+ publishedAt: string;
2275
+ };
2276
+ prod: {
2277
+ value: boolean;
2278
+ switches: {
2279
+ eu_region: boolean;
2280
+ };
2281
+ version: number;
2282
+ publishedAt: string;
2283
+ };
2284
+ };
2285
+ };
2286
+ };
2287
+ readonly useCase: "Fetch the current state of one killswitch — e.g. to verify a trip propagated before declaring an incident mitigated.";
2288
+ }, {
2289
+ readonly operationId: "createKillswitch";
2290
+ readonly method: "POST";
2291
+ readonly path: "";
2292
+ readonly summary: "Create a killswitch";
2293
+ readonly description: string;
2294
+ readonly successStatus: 201;
2295
+ readonly request: zod.ZodObject<{
2296
+ name: zod.ZodString;
2297
+ description: zod.ZodOptional<zod.ZodString>;
2298
+ value: zod.ZodOptional<zod.ZodBoolean>;
2299
+ switches: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodBoolean>>;
2300
+ }, zod_v4_core.$strip>;
2301
+ readonly response: zod.ZodObject<{
2302
+ id: zod.ZodString;
2303
+ name: zod.ZodString;
2304
+ }, zod_v4_core.$strip>;
2305
+ readonly examples: {
2306
+ readonly requestExamples: {
2307
+ readonly minimal: {
2308
+ readonly summary: "Minimal — name only, untripped";
2309
+ readonly description: "Smallest valid body. Creates a killswitch with `value: false` on every env.";
2310
+ readonly value: {
2311
+ readonly name: "payments.checkout";
2312
+ };
2313
+ };
2314
+ readonly preTripped: {
2315
+ readonly summary: "Pre-tripped on create";
2316
+ readonly description: "Ship the killswitch already tripped (`value: true`) — useful when provisioning a kill ahead of a deploy you want to ship with the feature off.";
2317
+ readonly value: {
2318
+ readonly name: "payments.checkout";
2319
+ readonly description: "Master kill for the new checkout flow.";
2320
+ readonly value: true;
2321
+ };
2322
+ };
2323
+ readonly withSwitches: {
2324
+ readonly summary: "With per-region switches";
2325
+ readonly description: "Seed a `switches` map so specific named call sites can be tripped independently of the flat `value`.";
2326
+ readonly value: {
2327
+ readonly name: "payments.checkout";
2328
+ readonly value: false;
2329
+ readonly switches: {
2330
+ readonly eu_region: true;
2331
+ readonly apac_region: false;
2332
+ };
2333
+ };
2334
+ };
2335
+ };
2336
+ readonly response: {
2337
+ readonly id: "ksw_01j7w9d8h2k4m6n8p0q2r4s6t8";
2338
+ readonly name: "payments.checkout";
2339
+ };
2340
+ };
2341
+ readonly useCase: string;
2342
+ }, {
2343
+ readonly operationId: "updateKillswitch";
2344
+ readonly method: "PATCH";
2345
+ readonly path: "/{id}";
2346
+ readonly summary: "Update a killswitch";
2347
+ readonly description: string;
2348
+ readonly pathParams: {
2349
+ readonly id: "Stable opaque killswitch id.";
2350
+ };
2351
+ readonly request: zod.ZodObject<{
2352
+ description: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
2353
+ value: zod.ZodOptional<zod.ZodBoolean>;
2354
+ switches: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodBoolean>>;
2355
+ }, zod_v4_core.$strip>;
2356
+ readonly response: zod.ZodObject<{
2357
+ id: zod.ZodString;
2358
+ }, zod_v4_core.$strip>;
2359
+ readonly examples: {
2360
+ readonly requestExamples: {
2361
+ readonly trip: {
2362
+ readonly summary: "Trip the killswitch on every env";
2363
+ readonly description: "Sets `value: true` on dev/stage/prod, bumping each env's version by one.";
2364
+ readonly value: {
2365
+ readonly value: true;
2366
+ };
2367
+ };
2368
+ readonly untrip: {
2369
+ readonly summary: "Untrip on every env";
2370
+ readonly description: "Sets `value: false` on every env.";
2371
+ readonly value: {
2372
+ readonly value: false;
2373
+ };
2374
+ };
2375
+ readonly replaceSwitches: {
2376
+ readonly summary: "Replace switches map";
2377
+ readonly description: "Replaces the per-key overrides wholesale on every env. Pass `{}` to clear.";
2378
+ readonly value: {
2379
+ readonly switches: {
2380
+ readonly eu_region: true;
2381
+ readonly apac_region: true;
2382
+ };
2383
+ };
2384
+ };
2385
+ readonly updateDescription: {
2386
+ readonly summary: "Description-only update";
2387
+ readonly description: "Doesn't bump versions or trigger a republish — only metadata changes.";
2388
+ readonly value: {
2389
+ readonly description: "Master kill — owner: payments-platform";
2390
+ };
2391
+ };
2392
+ };
2393
+ readonly response: {
2394
+ readonly id: "ksw_01j7w9d8h2k4m6n8p0q2r4s6t8";
2395
+ };
2396
+ };
2397
+ readonly useCase: string;
2398
+ }, {
2399
+ readonly operationId: "deleteKillswitch";
2400
+ readonly method: "DELETE";
2401
+ readonly path: "/{id}";
2402
+ readonly summary: "Delete a killswitch";
2403
+ readonly description: "Soft-deletes the killswitch and rebuilds the project's flags KV blob so SDKs stop seeing it.";
2404
+ readonly pathParams: {
2405
+ readonly id: "Stable opaque killswitch id.";
2406
+ };
2407
+ readonly response: zod.ZodObject<{
2408
+ ok: zod.ZodLiteral<true>;
2409
+ }, zod_v4_core.$strip>;
2410
+ readonly examples: {
2411
+ readonly response: {
2412
+ readonly ok: true;
2413
+ };
2414
+ };
2415
+ readonly useCase: "Tear down a killswitch after the feature it protected has been removed.";
2416
+ }, {
2417
+ readonly operationId: "setKillswitchSwitch";
2418
+ readonly method: "PUT";
2419
+ readonly path: "/{id}/switch";
2420
+ readonly summary: "Set one switch entry";
2421
+ readonly description: string;
2422
+ readonly pathParams: {
2423
+ readonly id: "Stable opaque killswitch id.";
2424
+ };
2425
+ readonly request: zod.ZodObject<{
2426
+ env: zod.ZodEnum<{
2427
+ dev: "dev";
2428
+ staging: "staging";
2429
+ prod: "prod";
2430
+ }>;
2431
+ switchKey: zod.ZodString;
2432
+ value: zod.ZodBoolean;
2433
+ }, zod_v4_core.$strip>;
2434
+ readonly response: zod.ZodObject<{
2435
+ id: zod.ZodString;
2436
+ env: zod.ZodEnum<{
2437
+ dev: "dev";
2438
+ staging: "staging";
2439
+ prod: "prod";
2440
+ }>;
2441
+ switchKey: zod.ZodString;
2442
+ value: zod.ZodBoolean;
2443
+ }, zod_v4_core.$strip>;
2444
+ readonly examples: {
2445
+ readonly requestExamples: {
2446
+ readonly tripRegion: {
2447
+ readonly summary: "Trip eu_region on prod";
2448
+ readonly description: "Sets `switches.eu_region = true` on prod only. Other envs and the flat `value` are unchanged.";
2449
+ readonly value: {
2450
+ readonly env: "prod";
2451
+ readonly switchKey: "eu_region";
2452
+ readonly value: true;
2453
+ };
2454
+ };
2455
+ readonly untripRegion: {
2456
+ readonly summary: "Untrip eu_region on prod";
2457
+ readonly description: "Flip the same entry back off without removing it from the map.";
2458
+ readonly value: {
2459
+ readonly env: "prod";
2460
+ readonly switchKey: "eu_region";
2461
+ readonly value: false;
2462
+ };
2463
+ };
2464
+ };
2465
+ readonly response: {
2466
+ readonly id: "ksw_01j7w9d8h2k4m6n8p0q2r4s6t8";
2467
+ readonly env: "prod";
2468
+ readonly switchKey: "eu_region";
2469
+ readonly value: true;
2470
+ };
2471
+ };
2472
+ readonly useCase: string;
2473
+ }, {
2474
+ readonly operationId: "unsetKillswitchSwitch";
2475
+ readonly method: "DELETE";
2476
+ readonly path: "/{id}/switch";
2477
+ readonly summary: "Remove one switch entry";
2478
+ readonly description: string;
2479
+ readonly pathParams: {
2480
+ readonly id: "Stable opaque killswitch id.";
2481
+ };
2482
+ readonly request: zod.ZodObject<{
2483
+ env: zod.ZodEnum<{
2484
+ dev: "dev";
2485
+ staging: "staging";
2486
+ prod: "prod";
2487
+ }>;
2488
+ switchKey: zod.ZodString;
2489
+ }, zod_v4_core.$strip>;
2490
+ readonly response: zod.ZodObject<{
2491
+ id: zod.ZodString;
2492
+ env: zod.ZodEnum<{
2493
+ dev: "dev";
2494
+ staging: "staging";
2495
+ prod: "prod";
2496
+ }>;
2497
+ switchKey: zod.ZodString;
2498
+ removed: zod.ZodBoolean;
2499
+ }, zod_v4_core.$strip>;
2500
+ readonly examples: {
2501
+ readonly requestExamples: {
2502
+ readonly removeRegion: {
2503
+ readonly summary: "Remove eu_region from prod";
2504
+ readonly description: "Drops the `eu_region` override on prod so the flat `value` applies again.";
2505
+ readonly value: {
2506
+ readonly env: "prod";
2507
+ readonly switchKey: "eu_region";
2508
+ };
2509
+ };
2510
+ };
2511
+ readonly response: {
2512
+ readonly id: "ksw_01j7w9d8h2k4m6n8p0q2r4s6t8";
2513
+ readonly env: "prod";
2514
+ readonly switchKey: "eu_region";
2515
+ readonly removed: true;
2516
+ };
2517
+ };
2518
+ readonly useCase: "Clean up a per-region override after the incident is resolved so the flat `value` governs again.";
2519
+ }];
2520
+ }];
2521
+
2522
+ export { type AdminClient, RESOURCE_REGISTRY, createAdminClient };