@shipeasy/openapi 1.6.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 (151) 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 -41
  14. package/dist/index.js +258 -4375
  15. package/dist/index.js.map +1 -0
  16. package/dist/node-context.d.ts +81 -33
  17. package/dist/node-context.js +98 -44
  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 +33 -26
  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/operations/attributes.d.ts +0 -33
  65. package/dist/operations/attributes.js +0 -16
  66. package/dist/operations/cli-adapter.d.ts +0 -35
  67. package/dist/operations/cli-adapter.js +0 -91
  68. package/dist/operations/coerce.d.ts +0 -32
  69. package/dist/operations/coerce.js +0 -53
  70. package/dist/operations/configs.d.ts +0 -28
  71. package/dist/operations/configs.js +0 -119
  72. package/dist/operations/docs.d.ts +0 -37
  73. package/dist/operations/docs.js +0 -39
  74. package/dist/operations/events.d.ts +0 -28
  75. package/dist/operations/events.js +0 -121
  76. package/dist/operations/experiments.d.ts +0 -28
  77. package/dist/operations/experiments.js +0 -280
  78. package/dist/operations/gates.d.ts +0 -28
  79. package/dist/operations/gates.js +0 -132
  80. package/dist/operations/i18n.d.ts +0 -28
  81. package/dist/operations/i18n.js +0 -121
  82. package/dist/operations/index.d.ts +0 -63
  83. package/dist/operations/index.js +0 -1751
  84. package/dist/operations/killswitches.d.ts +0 -28
  85. package/dist/operations/killswitches.js +0 -126
  86. package/dist/operations/mcp-adapter.d.ts +0 -35
  87. package/dist/operations/mcp-adapter.js +0 -94
  88. package/dist/operations/metrics.d.ts +0 -30
  89. package/dist/operations/metrics.js +0 -114
  90. package/dist/operations/ops.d.ts +0 -28
  91. package/dist/operations/ops.js +0 -313
  92. package/dist/operations/projects.d.ts +0 -28
  93. package/dist/operations/projects.js +0 -36
  94. package/dist/operations/sdk-docs.d.ts +0 -28
  95. package/dist/operations/sdk-docs.js +0 -160
  96. package/dist/operations/types.d.ts +0 -138
  97. package/dist/operations/types.js +0 -9
  98. package/dist/operations/universes.d.ts +0 -28
  99. package/dist/operations/universes.js +0 -93
  100. package/dist/operations/util.d.ts +0 -33
  101. package/dist/operations/util.js +0 -9
  102. package/dist/resources/alert-rules.d.ts +0 -50
  103. package/dist/resources/alert-rules.js +0 -75
  104. package/dist/resources/attributes.d.ts +0 -19
  105. package/dist/resources/attributes.js +0 -10
  106. package/dist/resources/configs.d.ts +0 -681
  107. package/dist/resources/configs.js +0 -509
  108. package/dist/resources/events.d.ts +0 -61
  109. package/dist/resources/events.js +0 -42
  110. package/dist/resources/experiments.d.ts +0 -849
  111. package/dist/resources/experiments.js +0 -707
  112. package/dist/resources/gates.d.ts +0 -808
  113. package/dist/resources/gates.js +0 -522
  114. package/dist/resources/i18n.d.ts +0 -84
  115. package/dist/resources/i18n.js +0 -60
  116. package/dist/resources/index.d.ts +0 -2767
  117. package/dist/resources/index.js +0 -2563
  118. package/dist/resources/killswitches.d.ts +0 -436
  119. package/dist/resources/killswitches.js +0 -514
  120. package/dist/resources/metrics.d.ts +0 -54
  121. package/dist/resources/metrics.js +0 -40
  122. package/dist/resources/ops.d.ts +0 -88
  123. package/dist/resources/ops.js +0 -36
  124. package/dist/resources/projects.d.ts +0 -54
  125. package/dist/resources/projects.js +0 -14
  126. package/dist/resources/universes.d.ts +0 -185
  127. package/dist/resources/universes.js +0 -234
  128. package/dist/schemas/alert-rules.d.ts +0 -65
  129. package/dist/schemas/alert-rules.js +0 -37
  130. package/dist/schemas/configs.d.ts +0 -154
  131. package/dist/schemas/configs.js +0 -134
  132. package/dist/schemas/constants.d.ts +0 -6
  133. package/dist/schemas/constants.js +0 -7
  134. package/dist/schemas/experiments.d.ts +0 -229
  135. package/dist/schemas/experiments.js +0 -221
  136. package/dist/schemas/folder.d.ts +0 -10
  137. package/dist/schemas/folder.js +0 -8
  138. package/dist/schemas/gates.d.ts +0 -386
  139. package/dist/schemas/gates.js +0 -190
  140. package/dist/schemas/index.d.ts +0 -11
  141. package/dist/schemas/index.js +0 -762
  142. package/dist/schemas/killswitches.d.ts +0 -110
  143. package/dist/schemas/killswitches.js +0 -226
  144. package/dist/schemas/metric-name.d.ts +0 -5
  145. package/dist/schemas/metric-name.js +0 -6
  146. package/dist/schemas/pagination.d.ts +0 -37
  147. package/dist/schemas/pagination.js +0 -44
  148. package/dist/schemas/universes.d.ts +0 -35
  149. package/dist/schemas/universes.js +0 -55
  150. package/dist/transport.d.ts +0 -30
  151. package/dist/transport.js +0 -44
@@ -0,0 +1,890 @@
1
+ ListGatesResponse:
2
+ type: object
3
+ properties:
4
+ data:
5
+ type: array
6
+ items:
7
+ type: object
8
+ properties:
9
+ id:
10
+ type: string
11
+ description: Stable opaque gate id (`gat_…`).
12
+ name:
13
+ type: string
14
+ maxLength: 128
15
+ pattern: ^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)?$
16
+ description: 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 — rename = delete + recreate.
17
+ enabled:
18
+ anyOf:
19
+ - type: boolean
20
+ - type: integer
21
+ minimum: 0
22
+ maximum: 1
23
+ description: Master switch. Returned as `1`/`0` from D1; treat truthy as enabled.
24
+ rolloutPct:
25
+ type: integer
26
+ minimum: 0
27
+ maximum: 10000
28
+ description: Current rollout in basis points (0–10000).
29
+ rules:
30
+ type: array
31
+ items:
32
+ type: object
33
+ properties:
34
+ attr:
35
+ type: string
36
+ minLength: 1
37
+ description: Attribute key on the evaluation context (e.g. `country`, `plan`, `email`). Matched case-sensitively against `Shipeasy.checkGate(user, name)` input.
38
+ op:
39
+ type: string
40
+ enum:
41
+ - eq
42
+ - neq
43
+ - in
44
+ - not_in
45
+ - gt
46
+ - gte
47
+ - lt
48
+ - lte
49
+ - contains
50
+ - regex
51
+ - semver_gt
52
+ - semver_gte
53
+ - semver_lt
54
+ - semver_lte
55
+ - gate_pass
56
+ - exp_in
57
+ description: "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 — 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\"` — true when the caller is in that variant / the universe holdout / any variant)."
58
+ value:
59
+ description: '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`.'
60
+ required:
61
+ - attr
62
+ - op
63
+ - value
64
+ additionalProperties: false
65
+ description: Single targeting predicate. A gate's `rules` array is evaluated with AND semantics; use the gatekeeper `stack` for OR / fall-through logic.
66
+ salt:
67
+ description: Hash salt used for percentage bucketing.
68
+ type: string
69
+ title:
70
+ anyOf:
71
+ - type: string
72
+ - type: "null"
73
+ description:
74
+ anyOf:
75
+ - type: string
76
+ - type: "null"
77
+ folder:
78
+ anyOf:
79
+ - type: string
80
+ - type: "null"
81
+ groupName:
82
+ description: "Group label (note: `groupName` in response, `group` in request)."
83
+ anyOf:
84
+ - type: string
85
+ - type: "null"
86
+ ownerEmail:
87
+ description: "Owner email (note: `ownerEmail` in response, `owner_email` in request)."
88
+ anyOf:
89
+ - type: string
90
+ - type: "null"
91
+ stack:
92
+ anyOf:
93
+ - type: array
94
+ items:
95
+ oneOf:
96
+ - type: object
97
+ properties:
98
+ id:
99
+ type: string
100
+ minLength: 1
101
+ description: Client-supplied stable id for the stack entry (used for React keys, audit diffs, and as the default per-condition rollout salt).
102
+ type:
103
+ type: string
104
+ const: condition
105
+ description: Discriminator. `condition` = rule-based predicate sub-gate.
106
+ name:
107
+ description: Human label shown in the dashboard.
108
+ type: string
109
+ fromTemplate:
110
+ description: Id of the project template this entry was seeded from, or `null` if hand-authored.
111
+ anyOf:
112
+ - type: string
113
+ - type: "null"
114
+ pass:
115
+ description: Combinator across `rules`. `all` = AND (default), `any` = OR.
116
+ type: string
117
+ enum:
118
+ - all
119
+ - any
120
+ rules:
121
+ default: []
122
+ description: Predicates evaluated under `pass`. Empty array = match nothing.
123
+ type: array
124
+ items:
125
+ type: object
126
+ properties:
127
+ attr:
128
+ type: string
129
+ minLength: 1
130
+ description: Attribute key on the evaluation context (e.g. `country`, `plan`, `email`). Matched case-sensitively against `Shipeasy.checkGate(user, name)` input.
131
+ op:
132
+ type: string
133
+ enum:
134
+ - eq
135
+ - neq
136
+ - in
137
+ - not_in
138
+ - gt
139
+ - gte
140
+ - lt
141
+ - lte
142
+ - contains
143
+ - regex
144
+ - semver_gt
145
+ - semver_gte
146
+ - semver_lt
147
+ - semver_lte
148
+ - gate_pass
149
+ - exp_in
150
+ description: "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 — 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\"` — true when the caller is in that variant / the universe holdout / any variant)."
151
+ value:
152
+ description: '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`.'
153
+ required:
154
+ - attr
155
+ - op
156
+ - value
157
+ additionalProperties: false
158
+ description: Single targeting predicate. A gate's `rules` array is evaluated with AND semantics; use the gatekeeper `stack` for OR / fall-through logic.
159
+ rolloutPct:
160
+ description: Per-condition rollout in basis points. After the rules match, the caller is bucketed at this %; in-bucket → gate `true`, otherwise fall through to the next entry. Absent ⇒ 10000 (100%, every matching caller passes).
161
+ type: integer
162
+ minimum: 0
163
+ maximum: 10000
164
+ bucketBy:
165
+ description: Attribute used to hash the caller into the per-condition bucket. Default `userID`.
166
+ type: string
167
+ salt:
168
+ description: Per-condition hash salt. Defaults to the entry `id`, then the gate salt.
169
+ type: string
170
+ ramp:
171
+ type: object
172
+ properties:
173
+ from:
174
+ type: integer
175
+ minimum: 0
176
+ maximum: 10000
177
+ description: Start of the ramp in basis points (0–10000).
178
+ to:
179
+ type: integer
180
+ minimum: 0
181
+ maximum: 10000
182
+ description: End of the ramp in basis points (0–10000).
183
+ startAt:
184
+ type: integer
185
+ minimum: 0
186
+ maximum: 9007199254740991
187
+ description: Ramp start, epoch milliseconds (UTC).
188
+ durationMs:
189
+ type: integer
190
+ exclusiveMinimum: 0
191
+ maximum: 9007199254740991
192
+ description: Ramp length in milliseconds.
193
+ required:
194
+ - from
195
+ - to
196
+ - startAt
197
+ - durationMs
198
+ additionalProperties: false
199
+ description: Linear rollout ramp. The effective rollout % interpolates `from`→`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.
200
+ locked:
201
+ description: If `true`, dashboard hides edit controls (e.g. the trailing public-floor entry).
202
+ type: boolean
203
+ required:
204
+ - id
205
+ - type
206
+ additionalProperties: false
207
+ description: 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.
208
+ - type: object
209
+ properties:
210
+ id:
211
+ type: string
212
+ minLength: 1
213
+ description: Client-supplied stable id for the stack entry.
214
+ type:
215
+ type: string
216
+ const: rollout
217
+ description: Discriminator. `rollout` = percentage-bucket sub-gate.
218
+ name:
219
+ description: Human label shown in the dashboard.
220
+ type: string
221
+ fromTemplate:
222
+ description: Source template id, or `null`.
223
+ anyOf:
224
+ - type: string
225
+ - type: "null"
226
+ rolloutPct:
227
+ type: integer
228
+ minimum: 0
229
+ maximum: 10000
230
+ description: Bucket size in basis points (0–10000 = 0%–100%). `5000` = 50%, `100` = 1%, allows sub-1% precision.
231
+ bucketBy:
232
+ description: Attribute used to hash the caller into a bucket. Defaults to `user.userID`. Use e.g. `accountID` to bucket whole accounts together.
233
+ type: string
234
+ salt:
235
+ description: Per-entry hash salt. Defaults to the gate's salt. Set explicitly to keep two rollouts independent or correlated across gates.
236
+ type: string
237
+ ramp:
238
+ type: object
239
+ properties:
240
+ from:
241
+ type: integer
242
+ minimum: 0
243
+ maximum: 10000
244
+ description: Start of the ramp in basis points (0–10000).
245
+ to:
246
+ type: integer
247
+ minimum: 0
248
+ maximum: 10000
249
+ description: End of the ramp in basis points (0–10000).
250
+ startAt:
251
+ type: integer
252
+ minimum: 0
253
+ maximum: 9007199254740991
254
+ description: Ramp start, epoch milliseconds (UTC).
255
+ durationMs:
256
+ type: integer
257
+ exclusiveMinimum: 0
258
+ maximum: 9007199254740991
259
+ description: Ramp length in milliseconds.
260
+ required:
261
+ - from
262
+ - to
263
+ - startAt
264
+ - durationMs
265
+ additionalProperties: false
266
+ description: Linear rollout ramp. The effective rollout % interpolates `from`→`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.
267
+ locked:
268
+ description: If `true`, dashboard hides edit controls.
269
+ type: boolean
270
+ required:
271
+ - id
272
+ - type
273
+ - rolloutPct
274
+ additionalProperties: false
275
+ description: 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).
276
+ description: 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.
277
+ - type: "null"
278
+ updatedAt:
279
+ type: string
280
+ description: ISO-8601 timestamp of last mutation.
281
+ required:
282
+ - id
283
+ - name
284
+ - enabled
285
+ - rolloutPct
286
+ - updatedAt
287
+ additionalProperties: false
288
+ next_cursor:
289
+ anyOf:
290
+ - type: string
291
+ - type: "null"
292
+ required:
293
+ - data
294
+ - next_cursor
295
+ additionalProperties: false
296
+ CreateGateRequest:
297
+ type: object
298
+ properties:
299
+ name:
300
+ type: string
301
+ maxLength: 128
302
+ pattern: ^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)?$
303
+ description: 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 — rename = delete + recreate.
304
+ enabled:
305
+ default: true
306
+ description: 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.
307
+ type: boolean
308
+ rollout_pct:
309
+ default: 0
310
+ description: Initial rollout in **basis points** (0–10000 = 0%–100%) — `100` here means **1%**, not 100%. Use `rollout_percent` (0–100) below if you'd rather think in percent. Use `0` to create the gate dark and ramp via PATCH after deploy validation.
311
+ type: integer
312
+ minimum: 0
313
+ maximum: 10000
314
+ rollout_percent:
315
+ description: Initial rollout as a **percentage** (0–100, 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.
316
+ type: number
317
+ minimum: 0
318
+ maximum: 100
319
+ rules:
320
+ default: []
321
+ description: Targeting predicates. AND-combined. If non-empty, the gate returns `true` only for callers that satisfy every rule **and** fall under `rollout_pct`.
322
+ type: array
323
+ items:
324
+ type: object
325
+ properties:
326
+ attr:
327
+ type: string
328
+ minLength: 1
329
+ description: Attribute key on the evaluation context (e.g. `country`, `plan`, `email`). Matched case-sensitively against `Shipeasy.checkGate(user, name)` input.
330
+ op:
331
+ type: string
332
+ enum:
333
+ - eq
334
+ - neq
335
+ - in
336
+ - not_in
337
+ - gt
338
+ - gte
339
+ - lt
340
+ - lte
341
+ - contains
342
+ - regex
343
+ - semver_gt
344
+ - semver_gte
345
+ - semver_lt
346
+ - semver_lte
347
+ - gate_pass
348
+ - exp_in
349
+ description: "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 — 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\"` — true when the caller is in that variant / the universe holdout / any variant)."
350
+ value:
351
+ description: '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`.'
352
+ required:
353
+ - attr
354
+ - op
355
+ - value
356
+ additionalProperties: false
357
+ description: Single targeting predicate. A gate's `rules` array is evaluated with AND semantics; use the gatekeeper `stack` for OR / fall-through logic.
358
+ salt:
359
+ description: Hash salt for percentage bucketing. Auto-generated if omitted. Provide explicitly to keep a gate's buckets stable across delete/recreate. **Immutable after create** — there is no PATCH for `salt` because changing it would re-bucket every caller.
360
+ type: string
361
+ minLength: 1
362
+ maxLength: 64
363
+ stack:
364
+ description: Optional gatekeeper stack. When provided, takes precedence over `rules` + `rollout_pct` at evaluation time. Omit (or pass `null`) for a flat gate.
365
+ anyOf:
366
+ - type: array
367
+ items:
368
+ oneOf:
369
+ - type: object
370
+ properties:
371
+ id:
372
+ type: string
373
+ minLength: 1
374
+ description: Client-supplied stable id for the stack entry (used for React keys, audit diffs, and as the default per-condition rollout salt).
375
+ type:
376
+ type: string
377
+ const: condition
378
+ description: Discriminator. `condition` = rule-based predicate sub-gate.
379
+ name:
380
+ description: Human label shown in the dashboard.
381
+ type: string
382
+ fromTemplate:
383
+ description: Id of the project template this entry was seeded from, or `null` if hand-authored.
384
+ anyOf:
385
+ - type: string
386
+ - type: "null"
387
+ pass:
388
+ description: Combinator across `rules`. `all` = AND (default), `any` = OR.
389
+ type: string
390
+ enum:
391
+ - all
392
+ - any
393
+ rules:
394
+ default: []
395
+ description: Predicates evaluated under `pass`. Empty array = match nothing.
396
+ type: array
397
+ items:
398
+ type: object
399
+ properties:
400
+ attr:
401
+ type: string
402
+ minLength: 1
403
+ description: Attribute key on the evaluation context (e.g. `country`, `plan`, `email`). Matched case-sensitively against `Shipeasy.checkGate(user, name)` input.
404
+ op:
405
+ type: string
406
+ enum:
407
+ - eq
408
+ - neq
409
+ - in
410
+ - not_in
411
+ - gt
412
+ - gte
413
+ - lt
414
+ - lte
415
+ - contains
416
+ - regex
417
+ - semver_gt
418
+ - semver_gte
419
+ - semver_lt
420
+ - semver_lte
421
+ - gate_pass
422
+ - exp_in
423
+ description: "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 — 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\"` — true when the caller is in that variant / the universe holdout / any variant)."
424
+ value:
425
+ description: '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`.'
426
+ required:
427
+ - attr
428
+ - op
429
+ - value
430
+ additionalProperties: false
431
+ description: Single targeting predicate. A gate's `rules` array is evaluated with AND semantics; use the gatekeeper `stack` for OR / fall-through logic.
432
+ rolloutPct:
433
+ description: Per-condition rollout in basis points. After the rules match, the caller is bucketed at this %; in-bucket → gate `true`, otherwise fall through to the next entry. Absent ⇒ 10000 (100%, every matching caller passes).
434
+ type: integer
435
+ minimum: 0
436
+ maximum: 10000
437
+ bucketBy:
438
+ description: Attribute used to hash the caller into the per-condition bucket. Default `userID`.
439
+ type: string
440
+ salt:
441
+ description: Per-condition hash salt. Defaults to the entry `id`, then the gate salt.
442
+ type: string
443
+ ramp:
444
+ type: object
445
+ properties:
446
+ from:
447
+ type: integer
448
+ minimum: 0
449
+ maximum: 10000
450
+ description: Start of the ramp in basis points (0–10000).
451
+ to:
452
+ type: integer
453
+ minimum: 0
454
+ maximum: 10000
455
+ description: End of the ramp in basis points (0–10000).
456
+ startAt:
457
+ type: integer
458
+ minimum: 0
459
+ maximum: 9007199254740991
460
+ description: Ramp start, epoch milliseconds (UTC).
461
+ durationMs:
462
+ type: integer
463
+ exclusiveMinimum: 0
464
+ maximum: 9007199254740991
465
+ description: Ramp length in milliseconds.
466
+ required:
467
+ - from
468
+ - to
469
+ - startAt
470
+ - durationMs
471
+ additionalProperties: false
472
+ description: Linear rollout ramp. The effective rollout % interpolates `from`→`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.
473
+ locked:
474
+ description: If `true`, dashboard hides edit controls (e.g. the trailing public-floor entry).
475
+ type: boolean
476
+ required:
477
+ - id
478
+ - type
479
+ additionalProperties: false
480
+ description: 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.
481
+ - type: object
482
+ properties:
483
+ id:
484
+ type: string
485
+ minLength: 1
486
+ description: Client-supplied stable id for the stack entry.
487
+ type:
488
+ type: string
489
+ const: rollout
490
+ description: Discriminator. `rollout` = percentage-bucket sub-gate.
491
+ name:
492
+ description: Human label shown in the dashboard.
493
+ type: string
494
+ fromTemplate:
495
+ description: Source template id, or `null`.
496
+ anyOf:
497
+ - type: string
498
+ - type: "null"
499
+ rolloutPct:
500
+ type: integer
501
+ minimum: 0
502
+ maximum: 10000
503
+ description: Bucket size in basis points (0–10000 = 0%–100%). `5000` = 50%, `100` = 1%, allows sub-1% precision.
504
+ bucketBy:
505
+ description: Attribute used to hash the caller into a bucket. Defaults to `user.userID`. Use e.g. `accountID` to bucket whole accounts together.
506
+ type: string
507
+ salt:
508
+ description: Per-entry hash salt. Defaults to the gate's salt. Set explicitly to keep two rollouts independent or correlated across gates.
509
+ type: string
510
+ ramp:
511
+ type: object
512
+ properties:
513
+ from:
514
+ type: integer
515
+ minimum: 0
516
+ maximum: 10000
517
+ description: Start of the ramp in basis points (0–10000).
518
+ to:
519
+ type: integer
520
+ minimum: 0
521
+ maximum: 10000
522
+ description: End of the ramp in basis points (0–10000).
523
+ startAt:
524
+ type: integer
525
+ minimum: 0
526
+ maximum: 9007199254740991
527
+ description: Ramp start, epoch milliseconds (UTC).
528
+ durationMs:
529
+ type: integer
530
+ exclusiveMinimum: 0
531
+ maximum: 9007199254740991
532
+ description: Ramp length in milliseconds.
533
+ required:
534
+ - from
535
+ - to
536
+ - startAt
537
+ - durationMs
538
+ additionalProperties: false
539
+ description: Linear rollout ramp. The effective rollout % interpolates `from`→`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.
540
+ locked:
541
+ description: If `true`, dashboard hides edit controls.
542
+ type: boolean
543
+ required:
544
+ - id
545
+ - type
546
+ - rolloutPct
547
+ additionalProperties: false
548
+ description: 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).
549
+ description: 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.
550
+ - type: "null"
551
+ title:
552
+ description: Human-readable title shown in the dashboard. Free-form, no key format constraint.
553
+ type: string
554
+ maxLength: 140
555
+ description:
556
+ description: Long-form description / runbook. Markdown is rendered in the dashboard.
557
+ type: string
558
+ maxLength: 2000
559
+ folder:
560
+ $ref: ./common.yaml#/Folder
561
+ group:
562
+ description: Group label for dashboard organisation (e.g. team or product area).
563
+ type: string
564
+ maxLength: 64
565
+ owner_email:
566
+ description: Owner contact. Displayed verbatim; not used for auth.
567
+ type: string
568
+ maxLength: 190
569
+ required:
570
+ - name
571
+ additionalProperties: false
572
+ description: Body for `POST /api/admin/gates`. At minimum supply `name`; everything else has sensible defaults.
573
+ CreateGateResponse:
574
+ type: object
575
+ properties:
576
+ id:
577
+ type: string
578
+ description: Newly assigned gate id (`gat_…`).
579
+ name:
580
+ type: string
581
+ maxLength: 128
582
+ pattern: ^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?)?$
583
+ description: 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 — rename = delete + recreate.
584
+ required:
585
+ - id
586
+ - name
587
+ additionalProperties: false
588
+ UpdateGateRequest:
589
+ type: object
590
+ properties:
591
+ rollout_pct:
592
+ description: New rollout in **basis points** (0–10000 = 0%–100%) — `100` here means **1%**. Use `rollout_percent` (0–100) below for percent. Omit both to leave unchanged.
593
+ type: integer
594
+ minimum: 0
595
+ maximum: 10000
596
+ rollout_percent:
597
+ description: New rollout as a **percentage** (0–100). Friendlier alias for `rollout_pct`; converted internally. Wins over `rollout_pct` if both are supplied. Omit both to leave unchanged.
598
+ type: number
599
+ minimum: 0
600
+ maximum: 100
601
+ rules:
602
+ description: 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']` → `['US','CA','GB']`).
603
+ type: array
604
+ items:
605
+ type: object
606
+ properties:
607
+ attr:
608
+ type: string
609
+ minLength: 1
610
+ description: Attribute key on the evaluation context (e.g. `country`, `plan`, `email`). Matched case-sensitively against `Shipeasy.checkGate(user, name)` input.
611
+ op:
612
+ type: string
613
+ enum:
614
+ - eq
615
+ - neq
616
+ - in
617
+ - not_in
618
+ - gt
619
+ - gte
620
+ - lt
621
+ - lte
622
+ - contains
623
+ - regex
624
+ - semver_gt
625
+ - semver_gte
626
+ - semver_lt
627
+ - semver_lte
628
+ - gate_pass
629
+ - exp_in
630
+ description: "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 — 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\"` — true when the caller is in that variant / the universe holdout / any variant)."
631
+ value:
632
+ description: '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`.'
633
+ required:
634
+ - attr
635
+ - op
636
+ - value
637
+ additionalProperties: false
638
+ description: Single targeting predicate. A gate's `rules` array is evaluated with AND semantics; use the gatekeeper `stack` for OR / fall-through logic.
639
+ enabled:
640
+ description: Master switch. `false` makes the gate evaluate to `false` for every caller regardless of `rollout_pct`, `rules`, or `stack` — use as kill switch.
641
+ type: boolean
642
+ stack:
643
+ description: Replaces the gatekeeper stack wholesale. Send `null` to revert to flat `rules` + `rollout_pct` evaluation.
644
+ anyOf:
645
+ - type: array
646
+ items:
647
+ oneOf:
648
+ - type: object
649
+ properties:
650
+ id:
651
+ type: string
652
+ minLength: 1
653
+ description: Client-supplied stable id for the stack entry (used for React keys, audit diffs, and as the default per-condition rollout salt).
654
+ type:
655
+ type: string
656
+ const: condition
657
+ description: Discriminator. `condition` = rule-based predicate sub-gate.
658
+ name:
659
+ description: Human label shown in the dashboard.
660
+ type: string
661
+ fromTemplate:
662
+ description: Id of the project template this entry was seeded from, or `null` if hand-authored.
663
+ anyOf:
664
+ - type: string
665
+ - type: "null"
666
+ pass:
667
+ description: Combinator across `rules`. `all` = AND (default), `any` = OR.
668
+ type: string
669
+ enum:
670
+ - all
671
+ - any
672
+ rules:
673
+ default: []
674
+ description: Predicates evaluated under `pass`. Empty array = match nothing.
675
+ type: array
676
+ items:
677
+ type: object
678
+ properties:
679
+ attr:
680
+ type: string
681
+ minLength: 1
682
+ description: Attribute key on the evaluation context (e.g. `country`, `plan`, `email`). Matched case-sensitively against `Shipeasy.checkGate(user, name)` input.
683
+ op:
684
+ type: string
685
+ enum:
686
+ - eq
687
+ - neq
688
+ - in
689
+ - not_in
690
+ - gt
691
+ - gte
692
+ - lt
693
+ - lte
694
+ - contains
695
+ - regex
696
+ - semver_gt
697
+ - semver_gte
698
+ - semver_lt
699
+ - semver_lte
700
+ - gate_pass
701
+ - exp_in
702
+ description: "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 — 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\"` — true when the caller is in that variant / the universe holdout / any variant)."
703
+ value:
704
+ description: '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`.'
705
+ required:
706
+ - attr
707
+ - op
708
+ - value
709
+ additionalProperties: false
710
+ description: Single targeting predicate. A gate's `rules` array is evaluated with AND semantics; use the gatekeeper `stack` for OR / fall-through logic.
711
+ rolloutPct:
712
+ description: Per-condition rollout in basis points. After the rules match, the caller is bucketed at this %; in-bucket → gate `true`, otherwise fall through to the next entry. Absent ⇒ 10000 (100%, every matching caller passes).
713
+ type: integer
714
+ minimum: 0
715
+ maximum: 10000
716
+ bucketBy:
717
+ description: Attribute used to hash the caller into the per-condition bucket. Default `userID`.
718
+ type: string
719
+ salt:
720
+ description: Per-condition hash salt. Defaults to the entry `id`, then the gate salt.
721
+ type: string
722
+ ramp:
723
+ type: object
724
+ properties:
725
+ from:
726
+ type: integer
727
+ minimum: 0
728
+ maximum: 10000
729
+ description: Start of the ramp in basis points (0–10000).
730
+ to:
731
+ type: integer
732
+ minimum: 0
733
+ maximum: 10000
734
+ description: End of the ramp in basis points (0–10000).
735
+ startAt:
736
+ type: integer
737
+ minimum: 0
738
+ maximum: 9007199254740991
739
+ description: Ramp start, epoch milliseconds (UTC).
740
+ durationMs:
741
+ type: integer
742
+ exclusiveMinimum: 0
743
+ maximum: 9007199254740991
744
+ description: Ramp length in milliseconds.
745
+ required:
746
+ - from
747
+ - to
748
+ - startAt
749
+ - durationMs
750
+ additionalProperties: false
751
+ description: Linear rollout ramp. The effective rollout % interpolates `from`→`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.
752
+ locked:
753
+ description: If `true`, dashboard hides edit controls (e.g. the trailing public-floor entry).
754
+ type: boolean
755
+ required:
756
+ - id
757
+ - type
758
+ additionalProperties: false
759
+ description: 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.
760
+ - type: object
761
+ properties:
762
+ id:
763
+ type: string
764
+ minLength: 1
765
+ description: Client-supplied stable id for the stack entry.
766
+ type:
767
+ type: string
768
+ const: rollout
769
+ description: Discriminator. `rollout` = percentage-bucket sub-gate.
770
+ name:
771
+ description: Human label shown in the dashboard.
772
+ type: string
773
+ fromTemplate:
774
+ description: Source template id, or `null`.
775
+ anyOf:
776
+ - type: string
777
+ - type: "null"
778
+ rolloutPct:
779
+ type: integer
780
+ minimum: 0
781
+ maximum: 10000
782
+ description: Bucket size in basis points (0–10000 = 0%–100%). `5000` = 50%, `100` = 1%, allows sub-1% precision.
783
+ bucketBy:
784
+ description: Attribute used to hash the caller into a bucket. Defaults to `user.userID`. Use e.g. `accountID` to bucket whole accounts together.
785
+ type: string
786
+ salt:
787
+ description: Per-entry hash salt. Defaults to the gate's salt. Set explicitly to keep two rollouts independent or correlated across gates.
788
+ type: string
789
+ ramp:
790
+ type: object
791
+ properties:
792
+ from:
793
+ type: integer
794
+ minimum: 0
795
+ maximum: 10000
796
+ description: Start of the ramp in basis points (0–10000).
797
+ to:
798
+ type: integer
799
+ minimum: 0
800
+ maximum: 10000
801
+ description: End of the ramp in basis points (0–10000).
802
+ startAt:
803
+ type: integer
804
+ minimum: 0
805
+ maximum: 9007199254740991
806
+ description: Ramp start, epoch milliseconds (UTC).
807
+ durationMs:
808
+ type: integer
809
+ exclusiveMinimum: 0
810
+ maximum: 9007199254740991
811
+ description: Ramp length in milliseconds.
812
+ required:
813
+ - from
814
+ - to
815
+ - startAt
816
+ - durationMs
817
+ additionalProperties: false
818
+ description: Linear rollout ramp. The effective rollout % interpolates `from`→`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.
819
+ locked:
820
+ description: If `true`, dashboard hides edit controls.
821
+ type: boolean
822
+ required:
823
+ - id
824
+ - type
825
+ - rolloutPct
826
+ additionalProperties: false
827
+ description: 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).
828
+ description: 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.
829
+ - type: "null"
830
+ title:
831
+ description: Human-readable title shown in the dashboard. Free-form, no key format constraint.
832
+ type: string
833
+ maxLength: 140
834
+ description:
835
+ description: Long-form description / runbook. Markdown is rendered in the dashboard.
836
+ type: string
837
+ maxLength: 2000
838
+ folder:
839
+ $ref: ./common.yaml#/Folder
840
+ group:
841
+ description: Group label for dashboard organisation (e.g. team or product area).
842
+ type: string
843
+ maxLength: 64
844
+ owner_email:
845
+ description: Owner contact. Displayed verbatim; not used for auth.
846
+ type: string
847
+ maxLength: 190
848
+ additionalProperties: false
849
+ description: Body for `PATCH /api/admin/gates/{id}`. Partial — only supplied fields change. Array fields (`rules`, `stack`) replace, not merge.
850
+ UpdateGateResponse:
851
+ type: object
852
+ properties:
853
+ id:
854
+ type: string
855
+ description: Gate id that was updated.
856
+ required:
857
+ - id
858
+ additionalProperties: false
859
+ description: Update returns only the id — re-fetch via `GET /api/admin/gates` for the full row.
860
+ DeleteGateResponse:
861
+ type: object
862
+ properties:
863
+ ok:
864
+ type: boolean
865
+ const: true
866
+ required:
867
+ - ok
868
+ additionalProperties: false
869
+ EnableGateResponse:
870
+ type: object
871
+ properties:
872
+ id:
873
+ type: string
874
+ enabled:
875
+ type: boolean
876
+ required:
877
+ - id
878
+ - enabled
879
+ additionalProperties: false
880
+ DisableGateResponse:
881
+ type: object
882
+ properties:
883
+ id:
884
+ type: string
885
+ enabled:
886
+ type: boolean
887
+ required:
888
+ - id
889
+ - enabled
890
+ additionalProperties: false