@shipeasy/openapi 1.0.0 → 1.2.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 (40) hide show
  1. package/dist/index.d.ts +9 -7
  2. package/dist/index.js +504 -2672
  3. package/dist/resources/alert-rules.d.ts +48 -0
  4. package/dist/resources/alert-rules.js +66 -0
  5. package/dist/resources/configs.d.ts +6 -2
  6. package/dist/resources/configs.js +67 -2375
  7. package/dist/resources/experiments.d.ts +100 -2
  8. package/dist/resources/experiments.js +158 -105
  9. package/dist/resources/gates.d.ts +51 -8
  10. package/dist/resources/gates.js +102 -70
  11. package/dist/resources/index.d.ts +166 -10
  12. package/dist/resources/index.js +503 -2671
  13. package/dist/resources/killswitches.d.ts +6 -2
  14. package/dist/resources/killswitches.js +113 -2412
  15. package/dist/resources/universes.d.ts +7 -4
  16. package/dist/resources/universes.js +30 -20
  17. package/dist/schemas/alert-rules.d.ts +43 -0
  18. package/dist/schemas/alert-rules.js +27 -0
  19. package/dist/schemas/configs.d.ts +154 -0
  20. package/dist/schemas/configs.js +134 -0
  21. package/dist/schemas/constants.d.ts +6 -0
  22. package/dist/schemas/constants.js +7 -0
  23. package/dist/schemas/experiments.d.ts +245 -0
  24. package/dist/schemas/experiments.js +216 -0
  25. package/dist/schemas/folder.d.ts +10 -0
  26. package/dist/schemas/folder.js +8 -0
  27. package/dist/schemas/gates.d.ts +304 -0
  28. package/dist/schemas/gates.js +172 -0
  29. package/dist/schemas/index.d.ts +11 -0
  30. package/dist/schemas/index.js +729 -0
  31. package/dist/schemas/killswitches.d.ts +110 -0
  32. package/dist/schemas/killswitches.js +226 -0
  33. package/dist/schemas/metric-name.d.ts +5 -0
  34. package/dist/schemas/metric-name.js +6 -0
  35. package/dist/schemas/pagination.d.ts +37 -0
  36. package/dist/schemas/pagination.js +44 -0
  37. package/dist/schemas/universes.d.ts +35 -0
  38. package/dist/schemas/universes.js +55 -0
  39. package/openapi.json +1257 -228
  40. package/package.json +13 -10
@@ -0,0 +1,304 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const gateRuleSchema: z.ZodObject<{
4
+ attr: z.ZodString;
5
+ op: z.ZodEnum<{
6
+ eq: "eq";
7
+ neq: "neq";
8
+ in: "in";
9
+ not_in: "not_in";
10
+ gt: "gt";
11
+ gte: "gte";
12
+ lt: "lt";
13
+ lte: "lte";
14
+ contains: "contains";
15
+ regex: "regex";
16
+ semver_gt: "semver_gt";
17
+ semver_gte: "semver_gte";
18
+ semver_lt: "semver_lt";
19
+ semver_lte: "semver_lte";
20
+ }>;
21
+ value: z.ZodUnknown;
22
+ }, z.core.$strip>;
23
+ declare const gateNameSchema: z.ZodString;
24
+ declare const stackedGateEntrySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
25
+ id: z.ZodString;
26
+ type: z.ZodLiteral<"condition">;
27
+ name: z.ZodOptional<z.ZodString>;
28
+ fromTemplate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
29
+ pass: z.ZodOptional<z.ZodEnum<{
30
+ all: "all";
31
+ any: "any";
32
+ }>>;
33
+ rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
34
+ attr: z.ZodString;
35
+ op: z.ZodEnum<{
36
+ eq: "eq";
37
+ neq: "neq";
38
+ in: "in";
39
+ not_in: "not_in";
40
+ gt: "gt";
41
+ gte: "gte";
42
+ lt: "lt";
43
+ lte: "lte";
44
+ contains: "contains";
45
+ regex: "regex";
46
+ semver_gt: "semver_gt";
47
+ semver_gte: "semver_gte";
48
+ semver_lt: "semver_lt";
49
+ semver_lte: "semver_lte";
50
+ }>;
51
+ value: z.ZodUnknown;
52
+ }, z.core.$strip>>>;
53
+ locked: z.ZodOptional<z.ZodBoolean>;
54
+ }, z.core.$strip>, z.ZodObject<{
55
+ id: z.ZodString;
56
+ type: z.ZodLiteral<"rollout">;
57
+ name: z.ZodOptional<z.ZodString>;
58
+ fromTemplate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
59
+ rolloutPct: z.ZodNumber;
60
+ bucketBy: z.ZodOptional<z.ZodString>;
61
+ salt: z.ZodOptional<z.ZodString>;
62
+ locked: z.ZodOptional<z.ZodBoolean>;
63
+ }, z.core.$strip>], "type">;
64
+ declare const gateMetadataPatchSchema: z.ZodObject<{
65
+ title: z.ZodOptional<z.ZodString>;
66
+ description: z.ZodOptional<z.ZodString>;
67
+ folder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
68
+ group: z.ZodOptional<z.ZodString>;
69
+ owner_email: z.ZodOptional<z.ZodString>;
70
+ }, z.core.$strip>;
71
+ declare const gateCreateSchema: z.ZodObject<{
72
+ title: z.ZodOptional<z.ZodString>;
73
+ description: z.ZodOptional<z.ZodString>;
74
+ folder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
75
+ group: z.ZodOptional<z.ZodString>;
76
+ owner_email: z.ZodOptional<z.ZodString>;
77
+ name: z.ZodString;
78
+ enabled: z.ZodDefault<z.ZodBoolean>;
79
+ rollout_pct: z.ZodDefault<z.ZodNumber>;
80
+ rollout_percent: z.ZodOptional<z.ZodNumber>;
81
+ rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
82
+ attr: z.ZodString;
83
+ op: z.ZodEnum<{
84
+ eq: "eq";
85
+ neq: "neq";
86
+ in: "in";
87
+ not_in: "not_in";
88
+ gt: "gt";
89
+ gte: "gte";
90
+ lt: "lt";
91
+ lte: "lte";
92
+ contains: "contains";
93
+ regex: "regex";
94
+ semver_gt: "semver_gt";
95
+ semver_gte: "semver_gte";
96
+ semver_lt: "semver_lt";
97
+ semver_lte: "semver_lte";
98
+ }>;
99
+ value: z.ZodUnknown;
100
+ }, z.core.$strip>>>;
101
+ salt: z.ZodOptional<z.ZodString>;
102
+ stack: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
103
+ id: z.ZodString;
104
+ type: z.ZodLiteral<"condition">;
105
+ name: z.ZodOptional<z.ZodString>;
106
+ fromTemplate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
107
+ pass: z.ZodOptional<z.ZodEnum<{
108
+ all: "all";
109
+ any: "any";
110
+ }>>;
111
+ rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
112
+ attr: z.ZodString;
113
+ op: z.ZodEnum<{
114
+ eq: "eq";
115
+ neq: "neq";
116
+ in: "in";
117
+ not_in: "not_in";
118
+ gt: "gt";
119
+ gte: "gte";
120
+ lt: "lt";
121
+ lte: "lte";
122
+ contains: "contains";
123
+ regex: "regex";
124
+ semver_gt: "semver_gt";
125
+ semver_gte: "semver_gte";
126
+ semver_lt: "semver_lt";
127
+ semver_lte: "semver_lte";
128
+ }>;
129
+ value: z.ZodUnknown;
130
+ }, z.core.$strip>>>;
131
+ locked: z.ZodOptional<z.ZodBoolean>;
132
+ }, z.core.$strip>, z.ZodObject<{
133
+ id: z.ZodString;
134
+ type: z.ZodLiteral<"rollout">;
135
+ name: z.ZodOptional<z.ZodString>;
136
+ fromTemplate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
137
+ rolloutPct: z.ZodNumber;
138
+ bucketBy: z.ZodOptional<z.ZodString>;
139
+ salt: z.ZodOptional<z.ZodString>;
140
+ locked: z.ZodOptional<z.ZodBoolean>;
141
+ }, z.core.$strip>], "type">>>>;
142
+ }, z.core.$strip>;
143
+ declare const gateUpdateSchema: z.ZodObject<{
144
+ title: z.ZodOptional<z.ZodString>;
145
+ description: z.ZodOptional<z.ZodString>;
146
+ folder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
147
+ group: z.ZodOptional<z.ZodString>;
148
+ owner_email: z.ZodOptional<z.ZodString>;
149
+ rollout_pct: z.ZodOptional<z.ZodNumber>;
150
+ rollout_percent: z.ZodOptional<z.ZodNumber>;
151
+ rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
152
+ attr: z.ZodString;
153
+ op: z.ZodEnum<{
154
+ eq: "eq";
155
+ neq: "neq";
156
+ in: "in";
157
+ not_in: "not_in";
158
+ gt: "gt";
159
+ gte: "gte";
160
+ lt: "lt";
161
+ lte: "lte";
162
+ contains: "contains";
163
+ regex: "regex";
164
+ semver_gt: "semver_gt";
165
+ semver_gte: "semver_gte";
166
+ semver_lt: "semver_lt";
167
+ semver_lte: "semver_lte";
168
+ }>;
169
+ value: z.ZodUnknown;
170
+ }, z.core.$strip>>>;
171
+ enabled: z.ZodOptional<z.ZodBoolean>;
172
+ stack: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
173
+ id: z.ZodString;
174
+ type: z.ZodLiteral<"condition">;
175
+ name: z.ZodOptional<z.ZodString>;
176
+ fromTemplate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
177
+ pass: z.ZodOptional<z.ZodEnum<{
178
+ all: "all";
179
+ any: "any";
180
+ }>>;
181
+ rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
182
+ attr: z.ZodString;
183
+ op: z.ZodEnum<{
184
+ eq: "eq";
185
+ neq: "neq";
186
+ in: "in";
187
+ not_in: "not_in";
188
+ gt: "gt";
189
+ gte: "gte";
190
+ lt: "lt";
191
+ lte: "lte";
192
+ contains: "contains";
193
+ regex: "regex";
194
+ semver_gt: "semver_gt";
195
+ semver_gte: "semver_gte";
196
+ semver_lt: "semver_lt";
197
+ semver_lte: "semver_lte";
198
+ }>;
199
+ value: z.ZodUnknown;
200
+ }, z.core.$strip>>>;
201
+ locked: z.ZodOptional<z.ZodBoolean>;
202
+ }, z.core.$strip>, z.ZodObject<{
203
+ id: z.ZodString;
204
+ type: z.ZodLiteral<"rollout">;
205
+ name: z.ZodOptional<z.ZodString>;
206
+ fromTemplate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
207
+ rolloutPct: z.ZodNumber;
208
+ bucketBy: z.ZodOptional<z.ZodString>;
209
+ salt: z.ZodOptional<z.ZodString>;
210
+ locked: z.ZodOptional<z.ZodBoolean>;
211
+ }, z.core.$strip>], "type">>>>;
212
+ }, z.core.$strip>;
213
+ type GateCreateInput = z.input<typeof gateCreateSchema>;
214
+ type GateUpdateInput = z.input<typeof gateUpdateSchema>;
215
+ type StackedGateEntryInput = z.input<typeof stackedGateEntrySchema>;
216
+ declare const gateResponseSchema: z.ZodObject<{
217
+ id: z.ZodString;
218
+ name: z.ZodString;
219
+ enabled: z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber]>;
220
+ rolloutPct: z.ZodNumber;
221
+ rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
222
+ attr: z.ZodString;
223
+ op: z.ZodEnum<{
224
+ eq: "eq";
225
+ neq: "neq";
226
+ in: "in";
227
+ not_in: "not_in";
228
+ gt: "gt";
229
+ gte: "gte";
230
+ lt: "lt";
231
+ lte: "lte";
232
+ contains: "contains";
233
+ regex: "regex";
234
+ semver_gt: "semver_gt";
235
+ semver_gte: "semver_gte";
236
+ semver_lt: "semver_lt";
237
+ semver_lte: "semver_lte";
238
+ }>;
239
+ value: z.ZodUnknown;
240
+ }, z.core.$strip>>>;
241
+ salt: z.ZodOptional<z.ZodString>;
242
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
243
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
244
+ folder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
245
+ groupName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
246
+ ownerEmail: z.ZodOptional<z.ZodNullable<z.ZodString>>;
247
+ stack: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
248
+ id: z.ZodString;
249
+ type: z.ZodLiteral<"condition">;
250
+ name: z.ZodOptional<z.ZodString>;
251
+ fromTemplate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
252
+ pass: z.ZodOptional<z.ZodEnum<{
253
+ all: "all";
254
+ any: "any";
255
+ }>>;
256
+ rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
257
+ attr: z.ZodString;
258
+ op: z.ZodEnum<{
259
+ eq: "eq";
260
+ neq: "neq";
261
+ in: "in";
262
+ not_in: "not_in";
263
+ gt: "gt";
264
+ gte: "gte";
265
+ lt: "lt";
266
+ lte: "lte";
267
+ contains: "contains";
268
+ regex: "regex";
269
+ semver_gt: "semver_gt";
270
+ semver_gte: "semver_gte";
271
+ semver_lt: "semver_lt";
272
+ semver_lte: "semver_lte";
273
+ }>;
274
+ value: z.ZodUnknown;
275
+ }, z.core.$strip>>>;
276
+ locked: z.ZodOptional<z.ZodBoolean>;
277
+ }, z.core.$strip>, z.ZodObject<{
278
+ id: z.ZodString;
279
+ type: z.ZodLiteral<"rollout">;
280
+ name: z.ZodOptional<z.ZodString>;
281
+ fromTemplate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
282
+ rolloutPct: z.ZodNumber;
283
+ bucketBy: z.ZodOptional<z.ZodString>;
284
+ salt: z.ZodOptional<z.ZodString>;
285
+ locked: z.ZodOptional<z.ZodBoolean>;
286
+ }, z.core.$strip>], "type">>>>;
287
+ updatedAt: z.ZodString;
288
+ }, z.core.$strip>;
289
+ declare const gateCreateResponseSchema: z.ZodObject<{
290
+ id: z.ZodString;
291
+ name: z.ZodString;
292
+ }, z.core.$strip>;
293
+ declare const gateUpdateResponseSchema: z.ZodObject<{
294
+ id: z.ZodString;
295
+ }, z.core.$strip>;
296
+ declare const gateDeleteResponseSchema: z.ZodObject<{
297
+ ok: z.ZodLiteral<true>;
298
+ }, z.core.$strip>;
299
+ declare const gateToggleResponseSchema: z.ZodObject<{
300
+ id: z.ZodString;
301
+ enabled: z.ZodBoolean;
302
+ }, z.core.$strip>;
303
+
304
+ export { type GateCreateInput, type GateUpdateInput, type StackedGateEntryInput, gateCreateResponseSchema, gateCreateSchema, gateDeleteResponseSchema, gateMetadataPatchSchema, gateNameSchema, gateResponseSchema, gateRuleSchema, gateToggleResponseSchema, gateUpdateResponseSchema, gateUpdateSchema, stackedGateEntrySchema };
@@ -0,0 +1,172 @@
1
+ // src/schemas/gates.ts
2
+ import { z as z2 } from "zod";
3
+
4
+ // src/schemas/folder.ts
5
+ import { z } from "zod";
6
+ var folderSchema = z.string().max(256).regex(/^[a-zA-Z0-9_-]+$/, "Folder must be alphanumeric, `_` or `-` (no `/`).").nullable().optional().describe(
7
+ "Optional folder name used to group items in the dashboard. Part of the SDK lookup key: an item in folder `checkout` named `new-cart` is referenced as `checkout/new-cart` from the SDK."
8
+ );
9
+
10
+ // src/schemas/gates.ts
11
+ var gateRuleSchema = z2.object({
12
+ attr: z2.string().min(1).describe(
13
+ "Attribute key on the evaluation context (e.g. `country`, `plan`, `email`). Matched case-sensitively against `Shipeasy.checkGate(user, name)` input."
14
+ ),
15
+ op: z2.enum([
16
+ "eq",
17
+ "neq",
18
+ "in",
19
+ "not_in",
20
+ "gt",
21
+ "gte",
22
+ "lt",
23
+ "lte",
24
+ "contains",
25
+ "regex",
26
+ "semver_gt",
27
+ "semver_gte",
28
+ "semver_lt",
29
+ "semver_lte"
30
+ ]).describe(
31
+ "Comparison operator. Equality: `eq`/`neq`. Set membership: `in`/`not_in` (value is an array). Numeric order: `gt`/`gte`/`lt`/`lte`. Semver order: `semver_gt`/`semver_gte`/`semver_lt`/`semver_lte` (value is a dotted version like `4.2.0`). String: `contains` (substring), `regex` (JS-flavour pattern, value is the pattern string)."
32
+ ),
33
+ value: z2.unknown().describe(
34
+ "Operand. Shape depends on `op`: scalar for `eq/neq/gt/gte/lt/lte/contains/semver_*`; array of scalars for `in/not_in`; string pattern for `regex`."
35
+ )
36
+ }).describe(
37
+ "Single targeting predicate. A gate's `rules` array is evaluated with AND semantics; use the gatekeeper `stack` for OR / fall-through logic."
38
+ );
39
+ var gateNameSchema = z2.string().regex(
40
+ /^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)?$/,
41
+ "lowercase, digits, _/-; optional folder.name shape"
42
+ ).max(128).describe(
43
+ "Stable gate key used by SDKs (`Shipeasy.checkGate(user, '<name>')`). Single segment or `folder.name`. Lowercase letters, digits, `_` or `-`; max 128 chars. Immutable after create \u2014 rename = delete + recreate."
44
+ );
45
+ var stackedConditionSchema = z2.object({
46
+ id: z2.string().min(1).describe(
47
+ "Client-supplied stable id for the stack entry (used for React keys, audit diffs)."
48
+ ),
49
+ type: z2.literal("condition").describe("Discriminator. `condition` = rule-based predicate sub-gate."),
50
+ name: z2.string().optional().describe("Human label shown in the dashboard."),
51
+ fromTemplate: z2.string().nullable().optional().describe(
52
+ "Id of the project template this entry was seeded from, or `null` if hand-authored."
53
+ ),
54
+ pass: z2.enum(["all", "any"]).optional().describe("Combinator across `rules`. `all` = AND (default), `any` = OR."),
55
+ rules: z2.array(gateRuleSchema).default([]).describe("Predicates evaluated under `pass`. Empty array = match nothing."),
56
+ locked: z2.boolean().optional().describe("If `true`, dashboard hides edit controls (e.g. the trailing public-floor entry).")
57
+ }).describe(
58
+ "Rule-based sub-gate. When matched, evaluation short-circuits and the gate returns `true` for the current caller."
59
+ );
60
+ var stackedRolloutSchema = z2.object({
61
+ id: z2.string().min(1).describe("Client-supplied stable id for the stack entry."),
62
+ type: z2.literal("rollout").describe("Discriminator. `rollout` = percentage-bucket sub-gate."),
63
+ name: z2.string().optional().describe("Human label shown in the dashboard."),
64
+ fromTemplate: z2.string().nullable().optional().describe("Source template id, or `null`."),
65
+ rolloutPct: z2.number().int().min(0).max(1e4).describe(
66
+ "Bucket size in basis points (0\u201310000 = 0%\u2013100%). `5000` = 50%, `100` = 1%, allows sub-1% precision."
67
+ ),
68
+ bucketBy: z2.string().optional().describe(
69
+ "Attribute used to hash the caller into a bucket. Defaults to `user.userID`. Use e.g. `accountID` to bucket whole accounts together."
70
+ ),
71
+ salt: z2.string().optional().describe(
72
+ "Per-entry hash salt. Defaults to the gate's salt. Set explicitly to keep two rollouts independent or correlated across gates."
73
+ ),
74
+ locked: z2.boolean().optional().describe("If `true`, dashboard hides edit controls.")
75
+ }).describe(
76
+ "Percentage-rollout sub-gate. Hashes `bucketBy` (default `userID`) with `salt` and returns `true` for `rolloutPct/10000` fraction of callers."
77
+ );
78
+ var stackedGateEntrySchema = z2.discriminatedUnion("type", [stackedConditionSchema, stackedRolloutSchema]).describe(
79
+ "One entry in the ordered gatekeeper stack. Evaluated top-to-bottom; first matching entry decides. Mix `condition` and `rollout` entries to express `internal-only` + `1% beta` + `50% public` in a single gate."
80
+ );
81
+ var gateMetadataFields = {
82
+ title: z2.string().max(140).optional().describe("Human-readable title shown in the dashboard. Free-form, no key format constraint."),
83
+ description: z2.string().max(2e3).optional().describe("Long-form description / runbook. Markdown is rendered in the dashboard."),
84
+ folder: folderSchema,
85
+ group: z2.string().max(64).optional().describe("Group label for dashboard organisation (e.g. team or product area)."),
86
+ owner_email: z2.string().max(190).optional().describe("Owner contact. Displayed verbatim; not used for auth.")
87
+ };
88
+ var gateMetadataPatchSchema = z2.object(gateMetadataFields);
89
+ var gateCreateSchema = z2.object({
90
+ name: gateNameSchema,
91
+ enabled: z2.boolean().default(true).describe(
92
+ "Master switch. Defaults to `true`. Set `false` to create the gate disabled (evaluates to `false` regardless of rules/rollout); flip on via `POST /{id}/enable` or PATCH."
93
+ ),
94
+ rollout_pct: z2.number().int().min(0).max(1e4).default(0).describe(
95
+ "Initial rollout in **basis points** (0\u201310000 = 0%\u2013100%) \u2014 `100` here means **1%**, not 100%. Use `rollout_percent` (0\u2013100) below if you'd rather think in percent. Use `0` to create the gate dark and ramp via PATCH after deploy validation."
96
+ ),
97
+ rollout_percent: z2.number().min(0).max(100).optional().describe(
98
+ "Initial rollout as a **percentage** (0\u2013100, fractional ok). Friendlier alias for `rollout_pct`; converted internally to basis points (e.g. `100` here = 10000 bp = 100%). If both `rollout_pct` and `rollout_percent` are set, `rollout_percent` wins."
99
+ ),
100
+ rules: z2.array(gateRuleSchema).default([]).describe(
101
+ "Targeting predicates. AND-combined. If non-empty, the gate returns `true` only for callers that satisfy every rule **and** fall under `rollout_pct`."
102
+ ),
103
+ salt: z2.string().min(1).max(64).optional().describe(
104
+ "Hash salt for percentage bucketing. Auto-generated if omitted. Provide explicitly to keep a gate's buckets stable across delete/recreate. **Immutable after create** \u2014 there is no PATCH for `salt` because changing it would re-bucket every caller."
105
+ ),
106
+ stack: z2.array(stackedGateEntrySchema).nullable().optional().describe(
107
+ "Optional gatekeeper stack. When provided, takes precedence over `rules` + `rollout_pct` at evaluation time. Omit (or pass `null`) for a flat gate."
108
+ ),
109
+ ...gateMetadataFields
110
+ }).describe(
111
+ "Body for `POST /api/admin/gates`. At minimum supply `name`; everything else has sensible defaults."
112
+ );
113
+ var gateUpdateSchema = z2.object({
114
+ rollout_pct: z2.number().int().min(0).max(1e4).optional().describe(
115
+ "New rollout in **basis points** (0\u201310000 = 0%\u2013100%) \u2014 `100` here means **1%**. Use `rollout_percent` (0\u2013100) below for percent. Omit both to leave unchanged."
116
+ ),
117
+ rollout_percent: z2.number().min(0).max(100).optional().describe(
118
+ "New rollout as a **percentage** (0\u2013100). Friendlier alias for `rollout_pct`; converted internally. Wins over `rollout_pct` if both are supplied. Omit both to leave unchanged."
119
+ ),
120
+ rules: z2.array(gateRuleSchema).optional().describe(
121
+ "Replaces the rule list wholesale. To add a value to an `in` rule, send the full new `rules` array with the augmented `value` (e.g. previous `['US','CA']` \u2192 `['US','CA','GB']`)."
122
+ ),
123
+ enabled: z2.boolean().optional().describe(
124
+ "Master switch. `false` makes the gate evaluate to `false` for every caller regardless of `rollout_pct`, `rules`, or `stack` \u2014 use as kill switch."
125
+ ),
126
+ stack: z2.array(stackedGateEntrySchema).nullable().optional().describe(
127
+ "Replaces the gatekeeper stack wholesale. Send `null` to revert to flat `rules` + `rollout_pct` evaluation."
128
+ ),
129
+ ...gateMetadataFields
130
+ }).describe(
131
+ "Body for `PATCH /api/admin/gates/{id}`. Partial \u2014 only supplied fields change. Array fields (`rules`, `stack`) replace, not merge."
132
+ );
133
+ var gateResponseSchema = z2.object({
134
+ id: z2.string().describe("Stable opaque gate id (`gat_\u2026`)."),
135
+ name: gateNameSchema,
136
+ /** D1 stores enabled as 0/1; clients see either form. */
137
+ enabled: z2.union([z2.boolean(), z2.number().int().min(0).max(1)]).describe("Master switch. Returned as `1`/`0` from D1; treat truthy as enabled."),
138
+ /** Rollout percentage in basis points (0–10000 = 0%–100%). */
139
+ rolloutPct: z2.number().int().min(0).max(1e4).describe("Current rollout in basis points (0\u201310000)."),
140
+ rules: z2.array(gateRuleSchema).optional(),
141
+ salt: z2.string().optional().describe("Hash salt used for percentage bucketing."),
142
+ title: z2.string().nullable().optional(),
143
+ description: z2.string().nullable().optional(),
144
+ folder: z2.string().nullable().optional(),
145
+ groupName: z2.string().nullable().optional().describe("Group label (note: `groupName` in response, `group` in request)."),
146
+ ownerEmail: z2.string().nullable().optional().describe("Owner email (note: `ownerEmail` in response, `owner_email` in request)."),
147
+ stack: z2.array(stackedGateEntrySchema).nullable().optional(),
148
+ updatedAt: z2.string().describe("ISO-8601 timestamp of last mutation.")
149
+ });
150
+ var gateCreateResponseSchema = z2.object({
151
+ id: z2.string().describe("Newly assigned gate id (`gat_\u2026`)."),
152
+ name: gateNameSchema
153
+ });
154
+ var gateUpdateResponseSchema = z2.object({ id: z2.string().describe("Gate id that was updated.") }).describe("Update returns only the id \u2014 re-fetch via `GET /api/admin/gates` for the full row.");
155
+ var gateDeleteResponseSchema = z2.object({ ok: z2.literal(true) });
156
+ var gateToggleResponseSchema = z2.object({
157
+ id: z2.string(),
158
+ enabled: z2.boolean()
159
+ });
160
+ export {
161
+ gateCreateResponseSchema,
162
+ gateCreateSchema,
163
+ gateDeleteResponseSchema,
164
+ gateMetadataPatchSchema,
165
+ gateNameSchema,
166
+ gateResponseSchema,
167
+ gateRuleSchema,
168
+ gateToggleResponseSchema,
169
+ gateUpdateResponseSchema,
170
+ gateUpdateSchema,
171
+ stackedGateEntrySchema
172
+ };
@@ -0,0 +1,11 @@
1
+ export { CONFIG_ENVS, CONFIG_KINDS, ConfigEnv, ConfigKind } from './constants.js';
2
+ export { CursorParts, DEFAULT_PAGE_SIZE, MAX_PAGE_SIZE, Page, PageQuery, decodeCursor, encodeCursor, pageQuerySchema } from './pagination.js';
3
+ export { FolderInput, folderSchema } from './folder.js';
4
+ export { metricNameSchema } from './metric-name.js';
5
+ export { ConfigCreateInput, ConfigDraftUpsertInput, ConfigPublishInput, ConfigSchemaUpdateInput, ConfigUpdateInput, JsonSchemaInput, configActivityEntrySchema, configActivityResponseSchema, configCreateResponseSchema, configCreateSchema, configDeleteResponseSchema, configDraftDiscardResponseSchema, configDraftSaveResponseSchema, configDraftUpsertSchema, configEnvSchema, configKindSchema, configNameSchema, configPublishResponseSchema, configPublishSchema, configResponseSchema, configSchemaUpdateSchema, configUpdateResponseSchema, configUpdateSchema, jsonSchemaSchema } from './configs.js';
6
+ export { GateCreateInput, GateUpdateInput, StackedGateEntryInput, gateCreateResponseSchema, gateCreateSchema, gateDeleteResponseSchema, gateMetadataPatchSchema, gateNameSchema, gateResponseSchema, gateRuleSchema, gateToggleResponseSchema, gateUpdateResponseSchema, gateUpdateSchema, stackedGateEntrySchema } from './gates.js';
7
+ export { KillswitchCreateInput, KillswitchSwitchSetInput, KillswitchSwitchUnsetInput, KillswitchUpdateInput, KillswitchValue, KillswitchValueSetInput, SWITCH_KEY_RE, killswitchCreateResponseSchema, killswitchCreateSchema, killswitchDeleteResponseSchema, killswitchResponseSchema, killswitchSwitchSetResponseSchema, killswitchSwitchSetSchema, killswitchSwitchUnsetResponseSchema, killswitchSwitchUnsetSchema, killswitchUpdateResponseSchema, killswitchUpdateSchema, killswitchValueSchema, killswitchValueSetSchema, switchKeySchema } from './killswitches.js';
8
+ export { UniverseCreateInput, UniverseUpdateInput, holdoutRangeSchema, universeCreateResponseSchema, universeCreateSchema, universeDeleteResponseSchema, universeNameSchema, universeResponseSchema, universeUpdateResponseSchema, universeUpdateSchema } from './universes.js';
9
+ export { ExperimentCreateInput, ExperimentInlineMetric, ExperimentUpdateInput, bucketBySchema, experimentCreateResponseSchema, experimentCreateSchema, experimentDeleteResponseSchema, experimentGroupSchema, experimentInlineMetricSchema, experimentMetricsResponseSchema, experimentMetricsUpdateSchema, experimentNameSchema, experimentReanalyzeResponseSchema, experimentResponseSchema, experimentResultsResponseSchema, experimentStatusResponseSchema, experimentStatusUpdateSchema, experimentTimeseriesResponseSchema, experimentUpdateResponseSchema, experimentUpdateSchema, paramSchemaSchema } from './experiments.js';
10
+ export { ALERT_COMPARATORS, ALERT_SEVERITIES, AlertRuleCreate, AlertRuleUpdate, alertRuleCreateSchema, alertRuleUpdateSchema } from './alert-rules.js';
11
+ import 'zod';