@shipeasy/openapi 1.5.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/README.md +37 -0
  2. package/dist/chunk-EPLLHLZN.js +1616 -0
  3. package/dist/chunk-EPLLHLZN.js.map +1 -0
  4. package/dist/chunk-SPH5HWCD.js +3326 -0
  5. package/dist/chunk-SPH5HWCD.js.map +1 -0
  6. package/dist/client-pVkoo3Bf.d.ts +11186 -0
  7. package/dist/client.d.ts +1 -0
  8. package/dist/client.js +215 -0
  9. package/dist/client.js.map +1 -0
  10. package/dist/custom.d.ts +64 -0
  11. package/dist/custom.js +292 -0
  12. package/dist/custom.js.map +1 -0
  13. package/dist/index.d.ts +29 -17
  14. package/dist/index.js +253 -2458
  15. package/dist/index.js.map +1 -0
  16. package/dist/node-context.d.ts +85 -0
  17. package/dist/node-context.js +110 -0
  18. package/dist/node-context.js.map +1 -0
  19. package/dist/schemas.d.ts +7920 -0
  20. package/dist/schemas.js +1083 -0
  21. package/dist/schemas.js.map +1 -0
  22. package/openapi.json +15297 -3044
  23. package/openapi.yaml +13979 -0
  24. package/package.json +37 -21
  25. package/spec/components/errors.yaml +53 -0
  26. package/spec/components/parameters.yaml +24 -0
  27. package/spec/components/responses.yaml +107 -0
  28. package/spec/components/schemas/alert-rules.yaml +175 -0
  29. package/spec/components/schemas/attributes.yaml +157 -0
  30. package/spec/components/schemas/common.yaml +87 -0
  31. package/spec/components/schemas/configs.yaml +371 -0
  32. package/spec/components/schemas/connectors.yaml +593 -0
  33. package/spec/components/schemas/errors-api.yaml +209 -0
  34. package/spec/components/schemas/events.yaml +321 -0
  35. package/spec/components/schemas/experiments.yaml +865 -0
  36. package/spec/components/schemas/gate-templates.yaml +198 -0
  37. package/spec/components/schemas/gates.yaml +890 -0
  38. package/spec/components/schemas/i18n.yaml +478 -0
  39. package/spec/components/schemas/keys.yaml +186 -0
  40. package/spec/components/schemas/killswitches.yaml +309 -0
  41. package/spec/components/schemas/metrics.yaml +547 -0
  42. package/spec/components/schemas/ops.yaml +1011 -0
  43. package/spec/components/schemas/projects.yaml +222 -0
  44. package/spec/components/schemas/search.yaml +46 -0
  45. package/spec/components/schemas/universes.yaml +127 -0
  46. package/spec/openapi.yaml +348 -0
  47. package/spec/paths/alert-rules.yaml +250 -0
  48. package/spec/paths/attributes.yaml +261 -0
  49. package/spec/paths/configs.yaml +744 -0
  50. package/spec/paths/connectors.yaml +748 -0
  51. package/spec/paths/errors.yaml +382 -0
  52. package/spec/paths/events.yaml +366 -0
  53. package/spec/paths/experiments.yaml +777 -0
  54. package/spec/paths/gate-templates.yaml +263 -0
  55. package/spec/paths/gates.yaml +451 -0
  56. package/spec/paths/i18n.yaml +544 -0
  57. package/spec/paths/keys.yaml +181 -0
  58. package/spec/paths/killswitches.yaml +557 -0
  59. package/spec/paths/metrics.yaml +302 -0
  60. package/spec/paths/ops.yaml +446 -0
  61. package/spec/paths/projects.yaml +210 -0
  62. package/spec/paths/search.yaml +62 -0
  63. package/spec/paths/universes.yaml +247 -0
  64. package/dist/resources/alert-rules.d.ts +0 -50
  65. package/dist/resources/alert-rules.js +0 -75
  66. package/dist/resources/configs.d.ts +0 -681
  67. package/dist/resources/configs.js +0 -509
  68. package/dist/resources/experiments.d.ts +0 -849
  69. package/dist/resources/experiments.js +0 -707
  70. package/dist/resources/gates.d.ts +0 -808
  71. package/dist/resources/gates.js +0 -522
  72. package/dist/resources/index.d.ts +0 -2749
  73. package/dist/resources/index.js +0 -2391
  74. package/dist/resources/killswitches.d.ts +0 -436
  75. package/dist/resources/killswitches.js +0 -514
  76. package/dist/resources/universes.d.ts +0 -185
  77. package/dist/resources/universes.js +0 -234
  78. package/dist/schemas/alert-rules.d.ts +0 -65
  79. package/dist/schemas/alert-rules.js +0 -37
  80. package/dist/schemas/configs.d.ts +0 -154
  81. package/dist/schemas/configs.js +0 -134
  82. package/dist/schemas/constants.d.ts +0 -6
  83. package/dist/schemas/constants.js +0 -7
  84. package/dist/schemas/experiments.d.ts +0 -229
  85. package/dist/schemas/experiments.js +0 -221
  86. package/dist/schemas/folder.d.ts +0 -10
  87. package/dist/schemas/folder.js +0 -8
  88. package/dist/schemas/gates.d.ts +0 -386
  89. package/dist/schemas/gates.js +0 -190
  90. package/dist/schemas/index.d.ts +0 -11
  91. package/dist/schemas/index.js +0 -762
  92. package/dist/schemas/killswitches.d.ts +0 -110
  93. package/dist/schemas/killswitches.js +0 -226
  94. package/dist/schemas/metric-name.d.ts +0 -5
  95. package/dist/schemas/metric-name.js +0 -6
  96. package/dist/schemas/pagination.d.ts +0 -37
  97. package/dist/schemas/pagination.js +0 -44
  98. package/dist/schemas/universes.d.ts +0 -35
  99. package/dist/schemas/universes.js +0 -55
  100. package/dist/transport.d.ts +0 -30
  101. package/dist/transport.js +0 -44
@@ -1,386 +0,0 @@
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
- gate_pass: "gate_pass";
21
- exp_in: "exp_in";
22
- }>;
23
- value: z.ZodUnknown;
24
- }, z.core.$strip>;
25
- declare const gateNameSchema: z.ZodString;
26
- declare const rampSchema: z.ZodObject<{
27
- from: z.ZodNumber;
28
- to: z.ZodNumber;
29
- startAt: z.ZodNumber;
30
- durationMs: z.ZodNumber;
31
- }, z.core.$strip>;
32
- declare const stackedGateEntrySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
33
- id: z.ZodString;
34
- type: z.ZodLiteral<"condition">;
35
- name: z.ZodOptional<z.ZodString>;
36
- fromTemplate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
37
- pass: z.ZodOptional<z.ZodEnum<{
38
- all: "all";
39
- any: "any";
40
- }>>;
41
- rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
42
- attr: z.ZodString;
43
- op: z.ZodEnum<{
44
- eq: "eq";
45
- neq: "neq";
46
- in: "in";
47
- not_in: "not_in";
48
- gt: "gt";
49
- gte: "gte";
50
- lt: "lt";
51
- lte: "lte";
52
- contains: "contains";
53
- regex: "regex";
54
- semver_gt: "semver_gt";
55
- semver_gte: "semver_gte";
56
- semver_lt: "semver_lt";
57
- semver_lte: "semver_lte";
58
- gate_pass: "gate_pass";
59
- exp_in: "exp_in";
60
- }>;
61
- value: z.ZodUnknown;
62
- }, z.core.$strip>>>;
63
- rolloutPct: z.ZodOptional<z.ZodNumber>;
64
- bucketBy: z.ZodOptional<z.ZodString>;
65
- salt: z.ZodOptional<z.ZodString>;
66
- ramp: z.ZodOptional<z.ZodObject<{
67
- from: z.ZodNumber;
68
- to: z.ZodNumber;
69
- startAt: z.ZodNumber;
70
- durationMs: z.ZodNumber;
71
- }, z.core.$strip>>;
72
- locked: z.ZodOptional<z.ZodBoolean>;
73
- }, z.core.$strip>, z.ZodObject<{
74
- id: z.ZodString;
75
- type: z.ZodLiteral<"rollout">;
76
- name: z.ZodOptional<z.ZodString>;
77
- fromTemplate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
78
- rolloutPct: z.ZodNumber;
79
- bucketBy: z.ZodOptional<z.ZodString>;
80
- salt: z.ZodOptional<z.ZodString>;
81
- ramp: z.ZodOptional<z.ZodObject<{
82
- from: z.ZodNumber;
83
- to: z.ZodNumber;
84
- startAt: z.ZodNumber;
85
- durationMs: z.ZodNumber;
86
- }, z.core.$strip>>;
87
- locked: z.ZodOptional<z.ZodBoolean>;
88
- }, z.core.$strip>], "type">;
89
- declare const gateMetadataPatchSchema: z.ZodObject<{
90
- title: z.ZodOptional<z.ZodString>;
91
- description: z.ZodOptional<z.ZodString>;
92
- folder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
93
- group: z.ZodOptional<z.ZodString>;
94
- owner_email: z.ZodOptional<z.ZodString>;
95
- }, z.core.$strip>;
96
- declare const gateCreateSchema: z.ZodObject<{
97
- title: z.ZodOptional<z.ZodString>;
98
- description: z.ZodOptional<z.ZodString>;
99
- folder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
100
- group: z.ZodOptional<z.ZodString>;
101
- owner_email: z.ZodOptional<z.ZodString>;
102
- name: z.ZodString;
103
- enabled: z.ZodDefault<z.ZodBoolean>;
104
- rollout_pct: z.ZodDefault<z.ZodNumber>;
105
- rollout_percent: z.ZodOptional<z.ZodNumber>;
106
- rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
107
- attr: z.ZodString;
108
- op: z.ZodEnum<{
109
- eq: "eq";
110
- neq: "neq";
111
- in: "in";
112
- not_in: "not_in";
113
- gt: "gt";
114
- gte: "gte";
115
- lt: "lt";
116
- lte: "lte";
117
- contains: "contains";
118
- regex: "regex";
119
- semver_gt: "semver_gt";
120
- semver_gte: "semver_gte";
121
- semver_lt: "semver_lt";
122
- semver_lte: "semver_lte";
123
- gate_pass: "gate_pass";
124
- exp_in: "exp_in";
125
- }>;
126
- value: z.ZodUnknown;
127
- }, z.core.$strip>>>;
128
- salt: z.ZodOptional<z.ZodString>;
129
- stack: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
130
- id: z.ZodString;
131
- type: z.ZodLiteral<"condition">;
132
- name: z.ZodOptional<z.ZodString>;
133
- fromTemplate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
134
- pass: z.ZodOptional<z.ZodEnum<{
135
- all: "all";
136
- any: "any";
137
- }>>;
138
- rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
139
- attr: z.ZodString;
140
- op: z.ZodEnum<{
141
- eq: "eq";
142
- neq: "neq";
143
- in: "in";
144
- not_in: "not_in";
145
- gt: "gt";
146
- gte: "gte";
147
- lt: "lt";
148
- lte: "lte";
149
- contains: "contains";
150
- regex: "regex";
151
- semver_gt: "semver_gt";
152
- semver_gte: "semver_gte";
153
- semver_lt: "semver_lt";
154
- semver_lte: "semver_lte";
155
- gate_pass: "gate_pass";
156
- exp_in: "exp_in";
157
- }>;
158
- value: z.ZodUnknown;
159
- }, z.core.$strip>>>;
160
- rolloutPct: z.ZodOptional<z.ZodNumber>;
161
- bucketBy: z.ZodOptional<z.ZodString>;
162
- salt: z.ZodOptional<z.ZodString>;
163
- ramp: z.ZodOptional<z.ZodObject<{
164
- from: z.ZodNumber;
165
- to: z.ZodNumber;
166
- startAt: z.ZodNumber;
167
- durationMs: z.ZodNumber;
168
- }, z.core.$strip>>;
169
- locked: z.ZodOptional<z.ZodBoolean>;
170
- }, z.core.$strip>, z.ZodObject<{
171
- id: z.ZodString;
172
- type: z.ZodLiteral<"rollout">;
173
- name: z.ZodOptional<z.ZodString>;
174
- fromTemplate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
175
- rolloutPct: z.ZodNumber;
176
- bucketBy: z.ZodOptional<z.ZodString>;
177
- salt: z.ZodOptional<z.ZodString>;
178
- ramp: z.ZodOptional<z.ZodObject<{
179
- from: z.ZodNumber;
180
- to: z.ZodNumber;
181
- startAt: z.ZodNumber;
182
- durationMs: z.ZodNumber;
183
- }, z.core.$strip>>;
184
- locked: z.ZodOptional<z.ZodBoolean>;
185
- }, z.core.$strip>], "type">>>>;
186
- }, z.core.$strip>;
187
- declare const gateUpdateSchema: z.ZodObject<{
188
- title: z.ZodOptional<z.ZodString>;
189
- description: z.ZodOptional<z.ZodString>;
190
- folder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
191
- group: z.ZodOptional<z.ZodString>;
192
- owner_email: z.ZodOptional<z.ZodString>;
193
- rollout_pct: z.ZodOptional<z.ZodNumber>;
194
- rollout_percent: z.ZodOptional<z.ZodNumber>;
195
- rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
196
- attr: z.ZodString;
197
- op: z.ZodEnum<{
198
- eq: "eq";
199
- neq: "neq";
200
- in: "in";
201
- not_in: "not_in";
202
- gt: "gt";
203
- gte: "gte";
204
- lt: "lt";
205
- lte: "lte";
206
- contains: "contains";
207
- regex: "regex";
208
- semver_gt: "semver_gt";
209
- semver_gte: "semver_gte";
210
- semver_lt: "semver_lt";
211
- semver_lte: "semver_lte";
212
- gate_pass: "gate_pass";
213
- exp_in: "exp_in";
214
- }>;
215
- value: z.ZodUnknown;
216
- }, z.core.$strip>>>;
217
- enabled: z.ZodOptional<z.ZodBoolean>;
218
- stack: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
219
- id: z.ZodString;
220
- type: z.ZodLiteral<"condition">;
221
- name: z.ZodOptional<z.ZodString>;
222
- fromTemplate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
223
- pass: z.ZodOptional<z.ZodEnum<{
224
- all: "all";
225
- any: "any";
226
- }>>;
227
- rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
228
- attr: z.ZodString;
229
- op: z.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
- semver_gt: "semver_gt";
241
- semver_gte: "semver_gte";
242
- semver_lt: "semver_lt";
243
- semver_lte: "semver_lte";
244
- gate_pass: "gate_pass";
245
- exp_in: "exp_in";
246
- }>;
247
- value: z.ZodUnknown;
248
- }, z.core.$strip>>>;
249
- rolloutPct: z.ZodOptional<z.ZodNumber>;
250
- bucketBy: z.ZodOptional<z.ZodString>;
251
- salt: z.ZodOptional<z.ZodString>;
252
- ramp: z.ZodOptional<z.ZodObject<{
253
- from: z.ZodNumber;
254
- to: z.ZodNumber;
255
- startAt: z.ZodNumber;
256
- durationMs: z.ZodNumber;
257
- }, z.core.$strip>>;
258
- locked: z.ZodOptional<z.ZodBoolean>;
259
- }, z.core.$strip>, z.ZodObject<{
260
- id: z.ZodString;
261
- type: z.ZodLiteral<"rollout">;
262
- name: z.ZodOptional<z.ZodString>;
263
- fromTemplate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
264
- rolloutPct: z.ZodNumber;
265
- bucketBy: z.ZodOptional<z.ZodString>;
266
- salt: z.ZodOptional<z.ZodString>;
267
- ramp: z.ZodOptional<z.ZodObject<{
268
- from: z.ZodNumber;
269
- to: z.ZodNumber;
270
- startAt: z.ZodNumber;
271
- durationMs: z.ZodNumber;
272
- }, z.core.$strip>>;
273
- locked: z.ZodOptional<z.ZodBoolean>;
274
- }, z.core.$strip>], "type">>>>;
275
- }, z.core.$strip>;
276
- type GateCreateInput = z.input<typeof gateCreateSchema>;
277
- type GateUpdateInput = z.input<typeof gateUpdateSchema>;
278
- type StackedGateEntryInput = z.input<typeof stackedGateEntrySchema>;
279
- declare const gateResponseSchema: z.ZodObject<{
280
- id: z.ZodString;
281
- name: z.ZodString;
282
- enabled: z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber]>;
283
- rolloutPct: z.ZodNumber;
284
- rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
285
- attr: z.ZodString;
286
- op: z.ZodEnum<{
287
- eq: "eq";
288
- neq: "neq";
289
- in: "in";
290
- not_in: "not_in";
291
- gt: "gt";
292
- gte: "gte";
293
- lt: "lt";
294
- lte: "lte";
295
- contains: "contains";
296
- regex: "regex";
297
- semver_gt: "semver_gt";
298
- semver_gte: "semver_gte";
299
- semver_lt: "semver_lt";
300
- semver_lte: "semver_lte";
301
- gate_pass: "gate_pass";
302
- exp_in: "exp_in";
303
- }>;
304
- value: z.ZodUnknown;
305
- }, z.core.$strip>>>;
306
- salt: z.ZodOptional<z.ZodString>;
307
- title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
308
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
309
- folder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
310
- groupName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
311
- ownerEmail: z.ZodOptional<z.ZodNullable<z.ZodString>>;
312
- stack: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
313
- id: z.ZodString;
314
- type: z.ZodLiteral<"condition">;
315
- name: z.ZodOptional<z.ZodString>;
316
- fromTemplate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
317
- pass: z.ZodOptional<z.ZodEnum<{
318
- all: "all";
319
- any: "any";
320
- }>>;
321
- rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
322
- attr: z.ZodString;
323
- op: z.ZodEnum<{
324
- eq: "eq";
325
- neq: "neq";
326
- in: "in";
327
- not_in: "not_in";
328
- gt: "gt";
329
- gte: "gte";
330
- lt: "lt";
331
- lte: "lte";
332
- contains: "contains";
333
- regex: "regex";
334
- semver_gt: "semver_gt";
335
- semver_gte: "semver_gte";
336
- semver_lt: "semver_lt";
337
- semver_lte: "semver_lte";
338
- gate_pass: "gate_pass";
339
- exp_in: "exp_in";
340
- }>;
341
- value: z.ZodUnknown;
342
- }, z.core.$strip>>>;
343
- rolloutPct: z.ZodOptional<z.ZodNumber>;
344
- bucketBy: z.ZodOptional<z.ZodString>;
345
- salt: z.ZodOptional<z.ZodString>;
346
- ramp: z.ZodOptional<z.ZodObject<{
347
- from: z.ZodNumber;
348
- to: z.ZodNumber;
349
- startAt: z.ZodNumber;
350
- durationMs: z.ZodNumber;
351
- }, z.core.$strip>>;
352
- locked: z.ZodOptional<z.ZodBoolean>;
353
- }, z.core.$strip>, z.ZodObject<{
354
- id: z.ZodString;
355
- type: z.ZodLiteral<"rollout">;
356
- name: z.ZodOptional<z.ZodString>;
357
- fromTemplate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
358
- rolloutPct: z.ZodNumber;
359
- bucketBy: z.ZodOptional<z.ZodString>;
360
- salt: z.ZodOptional<z.ZodString>;
361
- ramp: z.ZodOptional<z.ZodObject<{
362
- from: z.ZodNumber;
363
- to: z.ZodNumber;
364
- startAt: z.ZodNumber;
365
- durationMs: z.ZodNumber;
366
- }, z.core.$strip>>;
367
- locked: z.ZodOptional<z.ZodBoolean>;
368
- }, z.core.$strip>], "type">>>>;
369
- updatedAt: z.ZodString;
370
- }, z.core.$strip>;
371
- declare const gateCreateResponseSchema: z.ZodObject<{
372
- id: z.ZodString;
373
- name: z.ZodString;
374
- }, z.core.$strip>;
375
- declare const gateUpdateResponseSchema: z.ZodObject<{
376
- id: z.ZodString;
377
- }, z.core.$strip>;
378
- declare const gateDeleteResponseSchema: z.ZodObject<{
379
- ok: z.ZodLiteral<true>;
380
- }, z.core.$strip>;
381
- declare const gateToggleResponseSchema: z.ZodObject<{
382
- id: z.ZodString;
383
- enabled: z.ZodBoolean;
384
- }, z.core.$strip>;
385
-
386
- export { type GateCreateInput, type GateUpdateInput, type StackedGateEntryInput, gateCreateResponseSchema, gateCreateSchema, gateDeleteResponseSchema, gateMetadataPatchSchema, gateNameSchema, gateResponseSchema, gateRuleSchema, gateToggleResponseSchema, gateUpdateResponseSchema, gateUpdateSchema, rampSchema, stackedGateEntrySchema };
@@ -1,190 +0,0 @@
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
- "gate_pass",
31
- "exp_in"
32
- ]).describe(
33
- '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). Cross-resource references (evaluated only on the worker hot path, where both KV blobs load): `gate_pass` (`value` is another gate\'s name \u2014 true when that gate passes for the same caller); `exp_in` (`attr` is a running experiment\'s name, `value` is a group name, `"$holdout"`, or `"$any"` \u2014 true when the caller is in that variant / the universe holdout / any variant).'
34
- ),
35
- value: z2.unknown().describe(
36
- '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`; referenced gate name for `gate_pass`; group name / `"$holdout"` / `"$any"` for `exp_in`.'
37
- )
38
- }).describe(
39
- "Single targeting predicate. A gate's `rules` array is evaluated with AND semantics; use the gatekeeper `stack` for OR / fall-through logic."
40
- );
41
- var gateNameSchema = z2.string().regex(
42
- /^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)?$/,
43
- "lowercase, digits, _/-; optional folder.name shape"
44
- ).max(128).describe(
45
- "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."
46
- );
47
- var rampSchema = z2.object({
48
- from: z2.number().int().min(0).max(1e4).describe("Start of the ramp in basis points (0\u201310000)."),
49
- to: z2.number().int().min(0).max(1e4).describe("End of the ramp in basis points (0\u201310000)."),
50
- startAt: z2.number().int().nonnegative().describe("Ramp start, epoch milliseconds (UTC)."),
51
- durationMs: z2.number().int().positive().describe("Ramp length in milliseconds.")
52
- }).describe(
53
- "Linear rollout ramp. The effective rollout % interpolates `from`\u2192`to` over `[startAt, startAt+durationMs]`, clamped outside that window, evaluated against the wall-clock at eval time. Overrides the entry's static `rolloutPct` while present."
54
- );
55
- var stackedConditionSchema = z2.object({
56
- id: z2.string().min(1).describe(
57
- "Client-supplied stable id for the stack entry (used for React keys, audit diffs, and as the default per-condition rollout salt)."
58
- ),
59
- type: z2.literal("condition").describe("Discriminator. `condition` = rule-based predicate sub-gate."),
60
- name: z2.string().optional().describe("Human label shown in the dashboard."),
61
- fromTemplate: z2.string().nullable().optional().describe(
62
- "Id of the project template this entry was seeded from, or `null` if hand-authored."
63
- ),
64
- pass: z2.enum(["all", "any"]).optional().describe("Combinator across `rules`. `all` = AND (default), `any` = OR."),
65
- rules: z2.array(gateRuleSchema).default([]).describe("Predicates evaluated under `pass`. Empty array = match nothing."),
66
- rolloutPct: z2.number().int().min(0).max(1e4).optional().describe(
67
- "Per-condition rollout in basis points. After the rules match, the caller is bucketed at this %; in-bucket \u2192 gate `true`, otherwise fall through to the next entry. Absent \u21D2 10000 (100%, every matching caller passes)."
68
- ),
69
- bucketBy: z2.string().optional().describe("Attribute used to hash the caller into the per-condition bucket. Default `userID`."),
70
- salt: z2.string().optional().describe("Per-condition hash salt. Defaults to the entry `id`, then the gate salt."),
71
- ramp: rampSchema.optional(),
72
- locked: z2.boolean().optional().describe("If `true`, dashboard hides edit controls (e.g. the trailing public-floor entry).")
73
- }).describe(
74
- "Rule-based sub-gate. When the rules match and the caller falls in the per-condition rollout bucket, evaluation short-circuits and the gate returns `true`; otherwise it falls through to the next entry."
75
- );
76
- var stackedRolloutSchema = z2.object({
77
- id: z2.string().min(1).describe("Client-supplied stable id for the stack entry."),
78
- type: z2.literal("rollout").describe("Discriminator. `rollout` = percentage-bucket sub-gate."),
79
- name: z2.string().optional().describe("Human label shown in the dashboard."),
80
- fromTemplate: z2.string().nullable().optional().describe("Source template id, or `null`."),
81
- rolloutPct: z2.number().int().min(0).max(1e4).describe(
82
- "Bucket size in basis points (0\u201310000 = 0%\u2013100%). `5000` = 50%, `100` = 1%, allows sub-1% precision."
83
- ),
84
- bucketBy: z2.string().optional().describe(
85
- "Attribute used to hash the caller into a bucket. Defaults to `user.userID`. Use e.g. `accountID` to bucket whole accounts together."
86
- ),
87
- salt: z2.string().optional().describe(
88
- "Per-entry hash salt. Defaults to the gate's salt. Set explicitly to keep two rollouts independent or correlated across gates."
89
- ),
90
- ramp: rampSchema.optional(),
91
- locked: z2.boolean().optional().describe("If `true`, dashboard hides edit controls.")
92
- }).describe(
93
- "Percentage-rollout sub-gate. Hashes `bucketBy` (default `userID`) with `salt` and returns `true` for `rolloutPct/10000` fraction of callers (or the ramp's effective % when `ramp` is set)."
94
- );
95
- var stackedGateEntrySchema = z2.discriminatedUnion("type", [stackedConditionSchema, stackedRolloutSchema]).describe(
96
- "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."
97
- );
98
- var gateMetadataFields = {
99
- title: z2.string().max(140).optional().describe("Human-readable title shown in the dashboard. Free-form, no key format constraint."),
100
- description: z2.string().max(2e3).optional().describe("Long-form description / runbook. Markdown is rendered in the dashboard."),
101
- folder: folderSchema,
102
- group: z2.string().max(64).optional().describe("Group label for dashboard organisation (e.g. team or product area)."),
103
- owner_email: z2.string().max(190).optional().describe("Owner contact. Displayed verbatim; not used for auth.")
104
- };
105
- var gateMetadataPatchSchema = z2.object(gateMetadataFields);
106
- var gateCreateSchema = z2.object({
107
- name: gateNameSchema,
108
- enabled: z2.boolean().default(true).describe(
109
- "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."
110
- ),
111
- rollout_pct: z2.number().int().min(0).max(1e4).default(0).describe(
112
- "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."
113
- ),
114
- rollout_percent: z2.number().min(0).max(100).optional().describe(
115
- "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."
116
- ),
117
- rules: z2.array(gateRuleSchema).default([]).describe(
118
- "Targeting predicates. AND-combined. If non-empty, the gate returns `true` only for callers that satisfy every rule **and** fall under `rollout_pct`."
119
- ),
120
- salt: z2.string().min(1).max(64).optional().describe(
121
- "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."
122
- ),
123
- stack: z2.array(stackedGateEntrySchema).nullable().optional().describe(
124
- "Optional gatekeeper stack. When provided, takes precedence over `rules` + `rollout_pct` at evaluation time. Omit (or pass `null`) for a flat gate."
125
- ),
126
- ...gateMetadataFields
127
- }).describe(
128
- "Body for `POST /api/admin/gates`. At minimum supply `name`; everything else has sensible defaults."
129
- );
130
- var gateUpdateSchema = z2.object({
131
- rollout_pct: z2.number().int().min(0).max(1e4).optional().describe(
132
- "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."
133
- ),
134
- rollout_percent: z2.number().min(0).max(100).optional().describe(
135
- "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."
136
- ),
137
- rules: z2.array(gateRuleSchema).optional().describe(
138
- "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']`)."
139
- ),
140
- enabled: z2.boolean().optional().describe(
141
- "Master switch. `false` makes the gate evaluate to `false` for every caller regardless of `rollout_pct`, `rules`, or `stack` \u2014 use as kill switch."
142
- ),
143
- stack: z2.array(stackedGateEntrySchema).nullable().optional().describe(
144
- "Replaces the gatekeeper stack wholesale. Send `null` to revert to flat `rules` + `rollout_pct` evaluation."
145
- ),
146
- ...gateMetadataFields
147
- }).describe(
148
- "Body for `PATCH /api/admin/gates/{id}`. Partial \u2014 only supplied fields change. Array fields (`rules`, `stack`) replace, not merge."
149
- );
150
- var gateResponseSchema = z2.object({
151
- id: z2.string().describe("Stable opaque gate id (`gat_\u2026`)."),
152
- name: gateNameSchema,
153
- /** D1 stores enabled as 0/1; clients see either form. */
154
- 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."),
155
- /** Rollout percentage in basis points (0–10000 = 0%–100%). */
156
- rolloutPct: z2.number().int().min(0).max(1e4).describe("Current rollout in basis points (0\u201310000)."),
157
- rules: z2.array(gateRuleSchema).optional(),
158
- salt: z2.string().optional().describe("Hash salt used for percentage bucketing."),
159
- title: z2.string().nullable().optional(),
160
- description: z2.string().nullable().optional(),
161
- folder: z2.string().nullable().optional(),
162
- groupName: z2.string().nullable().optional().describe("Group label (note: `groupName` in response, `group` in request)."),
163
- ownerEmail: z2.string().nullable().optional().describe("Owner email (note: `ownerEmail` in response, `owner_email` in request)."),
164
- stack: z2.array(stackedGateEntrySchema).nullable().optional(),
165
- updatedAt: z2.string().describe("ISO-8601 timestamp of last mutation.")
166
- });
167
- var gateCreateResponseSchema = z2.object({
168
- id: z2.string().describe("Newly assigned gate id (`gat_\u2026`)."),
169
- name: gateNameSchema
170
- });
171
- 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.");
172
- var gateDeleteResponseSchema = z2.object({ ok: z2.literal(true) });
173
- var gateToggleResponseSchema = z2.object({
174
- id: z2.string(),
175
- enabled: z2.boolean()
176
- });
177
- export {
178
- gateCreateResponseSchema,
179
- gateCreateSchema,
180
- gateDeleteResponseSchema,
181
- gateMetadataPatchSchema,
182
- gateNameSchema,
183
- gateResponseSchema,
184
- gateRuleSchema,
185
- gateToggleResponseSchema,
186
- gateUpdateResponseSchema,
187
- gateUpdateSchema,
188
- rampSchema,
189
- stackedGateEntrySchema
190
- };
@@ -1,11 +0,0 @@
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, rampSchema, 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, NotificationTarget, alertRuleCreateSchema, alertRuleUpdateSchema, notificationTargetSchema } from './alert-rules.js';
11
- import 'zod';