@messagevisor/core 0.0.1 → 0.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 (211) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/LICENSE +21 -0
  3. package/README.md +7 -0
  4. package/jest.config.js +8 -0
  5. package/lib/benchmark/index.d.ts +2 -0
  6. package/lib/benchmark/index.js +417 -0
  7. package/lib/benchmark/index.js.map +1 -0
  8. package/lib/builder/index.d.ts +70 -0
  9. package/lib/builder/index.js +831 -0
  10. package/lib/builder/index.js.map +1 -0
  11. package/lib/cli/index.d.ts +28 -0
  12. package/lib/cli/index.js +182 -0
  13. package/lib/cli/index.js.map +1 -0
  14. package/lib/config/index.d.ts +61 -0
  15. package/lib/config/index.js +255 -0
  16. package/lib/config/index.js.map +1 -0
  17. package/lib/create/index.d.ts +2 -0
  18. package/lib/create/index.js +405 -0
  19. package/lib/create/index.js.map +1 -0
  20. package/lib/datasource/filesystemAdapter.d.ts +44 -0
  21. package/lib/datasource/filesystemAdapter.js +424 -0
  22. package/lib/datasource/filesystemAdapter.js.map +1 -0
  23. package/lib/datasource/index.d.ts +39 -0
  24. package/lib/datasource/index.js +96 -0
  25. package/lib/datasource/index.js.map +1 -0
  26. package/lib/error.d.ts +6 -0
  27. package/lib/error.js +49 -0
  28. package/lib/error.js.map +1 -0
  29. package/lib/evaluate/cli.d.ts +8 -0
  30. package/lib/evaluate/cli.js +179 -0
  31. package/lib/evaluate/cli.js.map +1 -0
  32. package/lib/evaluate/index.d.ts +10 -0
  33. package/lib/evaluate/index.js +131 -0
  34. package/lib/evaluate/index.js.map +1 -0
  35. package/lib/examples/coerceExampleIsoDates.d.ts +12 -0
  36. package/lib/examples/coerceExampleIsoDates.js +81 -0
  37. package/lib/examples/coerceExampleIsoDates.js.map +1 -0
  38. package/lib/examples/index.d.ts +63 -0
  39. package/lib/examples/index.js +713 -0
  40. package/lib/examples/index.js.map +1 -0
  41. package/lib/exporter/index.d.ts +60 -0
  42. package/lib/exporter/index.js +610 -0
  43. package/lib/exporter/index.js.map +1 -0
  44. package/lib/find-duplicates/index.d.ts +41 -0
  45. package/lib/find-duplicates/index.js +297 -0
  46. package/lib/find-duplicates/index.js.map +1 -0
  47. package/lib/generate-code/index.d.ts +11 -0
  48. package/lib/generate-code/index.js +157 -0
  49. package/lib/generate-code/index.js.map +1 -0
  50. package/lib/generate-code/typescript.d.ts +14 -0
  51. package/lib/generate-code/typescript.js +307 -0
  52. package/lib/generate-code/typescript.js.map +1 -0
  53. package/lib/importer/index.d.ts +64 -0
  54. package/lib/importer/index.js +1092 -0
  55. package/lib/importer/index.js.map +1 -0
  56. package/lib/index.d.ts +18 -0
  57. package/lib/index.js +35 -0
  58. package/lib/index.js.map +1 -0
  59. package/lib/info/index.d.ts +17 -0
  60. package/lib/info/index.js +132 -0
  61. package/lib/info/index.js.map +1 -0
  62. package/lib/init/index.d.ts +30 -0
  63. package/lib/init/index.js +348 -0
  64. package/lib/init/index.js.map +1 -0
  65. package/lib/lint/index.d.ts +1 -0
  66. package/lib/lint/index.js +6 -0
  67. package/lib/lint/index.js.map +1 -0
  68. package/lib/linter/attributeSchema.d.ts +7 -0
  69. package/lib/linter/attributeSchema.js +36 -0
  70. package/lib/linter/attributeSchema.js.map +1 -0
  71. package/lib/linter/checkLocaleCircularDependency.d.ts +7 -0
  72. package/lib/linter/checkLocaleCircularDependency.js +42 -0
  73. package/lib/linter/checkLocaleCircularDependency.js.map +1 -0
  74. package/lib/linter/conditionSchema.d.ts +3 -0
  75. package/lib/linter/conditionSchema.js +283 -0
  76. package/lib/linter/conditionSchema.js.map +1 -0
  77. package/lib/linter/formatSchema.d.ts +325 -0
  78. package/lib/linter/formatSchema.js +165 -0
  79. package/lib/linter/formatSchema.js.map +1 -0
  80. package/lib/linter/icuStyleLint.d.ts +6 -0
  81. package/lib/linter/icuStyleLint.js +226 -0
  82. package/lib/linter/icuStyleLint.js.map +1 -0
  83. package/lib/linter/index.d.ts +34 -0
  84. package/lib/linter/index.js +557 -0
  85. package/lib/linter/index.js.map +1 -0
  86. package/lib/linter/localeSchema.d.ts +672 -0
  87. package/lib/linter/localeSchema.js +50 -0
  88. package/lib/linter/localeSchema.js.map +1 -0
  89. package/lib/linter/messageSchema.d.ts +35 -0
  90. package/lib/linter/messageSchema.js +115 -0
  91. package/lib/linter/messageSchema.js.map +1 -0
  92. package/lib/linter/printError.d.ts +8 -0
  93. package/lib/linter/printError.js +41 -0
  94. package/lib/linter/printError.js.map +1 -0
  95. package/lib/linter/schema.d.ts +33 -0
  96. package/lib/linter/schema.js +192 -0
  97. package/lib/linter/schema.js.map +1 -0
  98. package/lib/linter/segmentSchema.d.ts +8 -0
  99. package/lib/linter/segmentSchema.js +18 -0
  100. package/lib/linter/segmentSchema.js.map +1 -0
  101. package/lib/linter/targetSchema.d.ts +337 -0
  102. package/lib/linter/targetSchema.js +39 -0
  103. package/lib/linter/targetSchema.js.map +1 -0
  104. package/lib/linter/testSchema.d.ts +71 -0
  105. package/lib/linter/testSchema.js +165 -0
  106. package/lib/linter/testSchema.js.map +1 -0
  107. package/lib/linter/zodHelpers.d.ts +2 -0
  108. package/lib/linter/zodHelpers.js +15 -0
  109. package/lib/linter/zodHelpers.js.map +1 -0
  110. package/lib/list/index.d.ts +8 -0
  111. package/lib/list/index.js +524 -0
  112. package/lib/list/index.js.map +1 -0
  113. package/lib/matrix.d.ts +4 -0
  114. package/lib/matrix.js +66 -0
  115. package/lib/matrix.js.map +1 -0
  116. package/lib/promoter/index.d.ts +65 -0
  117. package/lib/promoter/index.js +1208 -0
  118. package/lib/promoter/index.js.map +1 -0
  119. package/lib/prune/index.d.ts +37 -0
  120. package/lib/prune/index.js +673 -0
  121. package/lib/prune/index.js.map +1 -0
  122. package/lib/sets.d.ts +10 -0
  123. package/lib/sets.js +120 -0
  124. package/lib/sets.js.map +1 -0
  125. package/lib/tester/cliFormat.d.ts +8 -0
  126. package/lib/tester/cliFormat.js +15 -0
  127. package/lib/tester/cliFormat.js.map +1 -0
  128. package/lib/tester/index.d.ts +35 -0
  129. package/lib/tester/index.js +713 -0
  130. package/lib/tester/index.js.map +1 -0
  131. package/lib/tester/matrix.d.ts +14 -0
  132. package/lib/tester/matrix.js +76 -0
  133. package/lib/tester/matrix.js.map +1 -0
  134. package/lib/tester/prettyDuration.d.ts +1 -0
  135. package/lib/tester/prettyDuration.js +30 -0
  136. package/lib/tester/prettyDuration.js.map +1 -0
  137. package/lib/tester/printTestResult.d.ts +2 -0
  138. package/lib/tester/printTestResult.js +32 -0
  139. package/lib/tester/printTestResult.js.map +1 -0
  140. package/lib/tester/types.d.ts +29 -0
  141. package/lib/tester/types.js +3 -0
  142. package/lib/tester/types.js.map +1 -0
  143. package/package.json +41 -13
  144. package/src/benchmark/index.spec.ts +375 -0
  145. package/src/benchmark/index.ts +433 -0
  146. package/src/builder/index.spec.ts +822 -0
  147. package/src/builder/index.ts +920 -0
  148. package/src/cli/index.spec.ts +54 -0
  149. package/src/cli/index.ts +150 -0
  150. package/src/config/index.spec.ts +70 -0
  151. package/src/config/index.ts +259 -0
  152. package/src/create/index.spec.ts +272 -0
  153. package/src/create/index.ts +295 -0
  154. package/src/datasource/filesystemAdapter.ts +313 -0
  155. package/src/datasource/index.ts +135 -0
  156. package/src/error.ts +33 -0
  157. package/src/evaluate/cli.spec.ts +368 -0
  158. package/src/evaluate/cli.ts +130 -0
  159. package/src/evaluate/index.ts +161 -0
  160. package/src/examples/coerceExampleIsoDates.spec.ts +81 -0
  161. package/src/examples/coerceExampleIsoDates.ts +98 -0
  162. package/src/examples/index.spec.ts +453 -0
  163. package/src/examples/index.ts +854 -0
  164. package/src/exporter/index.spec.ts +443 -0
  165. package/src/exporter/index.ts +643 -0
  166. package/src/find-duplicates/index.spec.ts +289 -0
  167. package/src/find-duplicates/index.ts +314 -0
  168. package/src/generate-code/index.ts +92 -0
  169. package/src/generate-code/typescript.spec.ts +241 -0
  170. package/src/generate-code/typescript.ts +284 -0
  171. package/src/importer/index.spec.ts +1101 -0
  172. package/src/importer/index.ts +1190 -0
  173. package/src/index.ts +18 -0
  174. package/src/info/index.ts +67 -0
  175. package/src/init/index.spec.ts +279 -0
  176. package/src/init/index.ts +292 -0
  177. package/src/lint/index.ts +1 -0
  178. package/src/linter/attributeSchema.ts +38 -0
  179. package/src/linter/checkLocaleCircularDependency.ts +51 -0
  180. package/src/linter/conditionSchema.ts +386 -0
  181. package/src/linter/formatSchema.ts +170 -0
  182. package/src/linter/icuStyleLint.ts +312 -0
  183. package/src/linter/index.spec.ts +824 -0
  184. package/src/linter/index.ts +460 -0
  185. package/src/linter/localeSchema.ts +70 -0
  186. package/src/linter/messageSchema.ts +152 -0
  187. package/src/linter/printError.ts +52 -0
  188. package/src/linter/schema.ts +230 -0
  189. package/src/linter/segmentSchema.ts +15 -0
  190. package/src/linter/targetSchema.ts +50 -0
  191. package/src/linter/testSchema.spec.ts +405 -0
  192. package/src/linter/testSchema.ts +239 -0
  193. package/src/linter/zodHelpers.ts +16 -0
  194. package/src/list/index.spec.ts +431 -0
  195. package/src/list/index.ts +463 -0
  196. package/src/matrix.ts +69 -0
  197. package/src/promoter/index.spec.ts +584 -0
  198. package/src/promoter/index.ts +1267 -0
  199. package/src/prune/index.spec.ts +418 -0
  200. package/src/prune/index.ts +693 -0
  201. package/src/sets.ts +74 -0
  202. package/src/tester/cliFormat.ts +11 -0
  203. package/src/tester/featurevisorIntegration.spec.ts +101 -0
  204. package/src/tester/index.spec.ts +577 -0
  205. package/src/tester/index.ts +679 -0
  206. package/src/tester/matrix.ts +106 -0
  207. package/src/tester/prettyDuration.ts +34 -0
  208. package/src/tester/printTestResult.ts +40 -0
  209. package/src/tester/types.ts +32 -0
  210. package/tsconfig.cjs.json +11 -0
  211. package/tsconfig.typecheck.json +4 -0
@@ -0,0 +1,283 @@
1
+ "use strict";
2
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
+ if (ar || !(i in from)) {
5
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
6
+ ar[i] = from[i];
7
+ }
8
+ }
9
+ return to.concat(ar || Array.prototype.slice.call(from));
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.getConditionsZodSchema = getConditionsZodSchema;
13
+ var zod_1 = require("zod");
14
+ var zodHelpers_1 = require("./zodHelpers");
15
+ var commonOperators = ["equals", "notEquals"];
16
+ var numericOperators = ["greaterThan", "greaterThanOrEquals", "lessThan", "lessThanOrEquals"];
17
+ var stringOperators = ["contains", "notContains", "startsWith", "endsWith"];
18
+ var dateOperators = ["before", "after"];
19
+ var arrayOperators = ["includes", "notIncludes"];
20
+ var membershipOperators = ["in", "notIn"];
21
+ var operatorsWithoutValue = ["exists", "notExists"];
22
+ var featureOperators = ["isEnabled", "isDisabled"];
23
+ var experimentOperators = ["hasVariation"];
24
+ function isPrimitiveValue(value) {
25
+ return value === null || ["string", "number", "boolean"].includes(typeof value);
26
+ }
27
+ function valuesEqual(left, right) {
28
+ return JSON.stringify(left) === JSON.stringify(right);
29
+ }
30
+ function resolveAttributePath(attributePath, attributesByKey) {
31
+ var _a = attributePath.split("."), rootKey = _a[0], rest = _a.slice(1);
32
+ var rootAttribute = attributesByKey[rootKey];
33
+ if (!rootAttribute) {
34
+ return null;
35
+ }
36
+ var current = rootAttribute;
37
+ if (rest.length === 0) {
38
+ return { kind: "schema", schema: current };
39
+ }
40
+ for (var index = 0; index < rest.length; index++) {
41
+ var segment = rest[index];
42
+ if (current.type !== "object") {
43
+ return null;
44
+ }
45
+ if (current.properties && current.properties[segment]) {
46
+ current = current.properties[segment];
47
+ continue;
48
+ }
49
+ if (!current.properties && !current.additionalProperties) {
50
+ return index === rest.length - 1 ? { kind: "flat-object-property" } : null;
51
+ }
52
+ if (current.additionalProperties) {
53
+ current = current.additionalProperties;
54
+ continue;
55
+ }
56
+ return null;
57
+ }
58
+ return { kind: "schema", schema: current };
59
+ }
60
+ function getLeafTypes(leaf) {
61
+ if (leaf.kind === "flat-object-property") {
62
+ return ["primitive"];
63
+ }
64
+ if (leaf.schema.oneOf) {
65
+ return Array.from(new Set(leaf.schema.oneOf.flatMap(function (branch) {
66
+ return getLeafTypes({ kind: "schema", schema: branch });
67
+ })));
68
+ }
69
+ return leaf.schema.type ? [leaf.schema.type] : [];
70
+ }
71
+ function matchesSchemaValue(schema, value) {
72
+ if (schema.oneOf) {
73
+ return (schema.oneOf.filter(function (branch) { return matchesSchemaValue(branch, value); }).length === 1);
74
+ }
75
+ if (schema.const !== undefined) {
76
+ return valuesEqual(schema.const, value);
77
+ }
78
+ if (schema.enum) {
79
+ return schema.enum.some(function (entry) { return valuesEqual(entry, value); });
80
+ }
81
+ if (!schema.type) {
82
+ return true;
83
+ }
84
+ if (schema.type === "string" || schema.type === "date") {
85
+ if (typeof value !== "string" && !(value instanceof Date))
86
+ return false;
87
+ var stringValue = value instanceof Date ? value.toISOString() : value;
88
+ if (schema.minLength !== undefined && stringValue.length < schema.minLength)
89
+ return false;
90
+ if (schema.maxLength !== undefined && stringValue.length > schema.maxLength)
91
+ return false;
92
+ if (schema.pattern !== undefined && !new RegExp(schema.pattern).test(stringValue))
93
+ return false;
94
+ return true;
95
+ }
96
+ if (schema.type === "boolean") {
97
+ return typeof value === "boolean";
98
+ }
99
+ if (schema.type === "integer" || schema.type === "double") {
100
+ if (typeof value !== "number")
101
+ return false;
102
+ if (schema.type === "integer" && !Number.isInteger(value))
103
+ return false;
104
+ if (schema.minimum !== undefined && value < schema.minimum)
105
+ return false;
106
+ if (schema.maximum !== undefined && value > schema.maximum)
107
+ return false;
108
+ return true;
109
+ }
110
+ if (schema.type === "array") {
111
+ return Array.isArray(value) && value.every(function (entry) { return typeof entry === "string"; });
112
+ }
113
+ if (schema.type === "object") {
114
+ return typeof value === "object" && value !== null && !Array.isArray(value);
115
+ }
116
+ return true;
117
+ }
118
+ function matchesLeafValue(leaf, value) {
119
+ if (leaf.kind === "flat-object-property") {
120
+ return isPrimitiveValue(value);
121
+ }
122
+ return matchesSchemaValue(leaf.schema, value);
123
+ }
124
+ function addIssue(ctx, message, path) {
125
+ if (path === void 0) { path = ["value"]; }
126
+ ctx.addIssue({
127
+ code: zod_1.z.ZodIssueCode.custom,
128
+ message: message,
129
+ path: path,
130
+ });
131
+ }
132
+ function validateAttributeAwareCondition(data, ctx, attributesByKey) {
133
+ var leaf = resolveAttributePath(data.attribute, attributesByKey);
134
+ if (!leaf) {
135
+ return;
136
+ }
137
+ var leafTypes = getLeafTypes(leaf);
138
+ if (operatorsWithoutValue.includes(data.operator)) {
139
+ return;
140
+ }
141
+ if (leaf.kind === "schema" && leaf.schema.type === "object") {
142
+ addIssue(ctx, "Attribute \"".concat(data.attribute, "\" resolves to an object. Use a nested attribute path or `exists`/`notExists`."));
143
+ return;
144
+ }
145
+ if (numericOperators.includes(data.operator) &&
146
+ !leafTypes.some(function (type) { return ["integer", "double"].includes(type); })) {
147
+ addIssue(ctx, "Operator \"".concat(data.operator, "\" can only be used with integer or double attributes."));
148
+ return;
149
+ }
150
+ if (stringOperators.includes(data.operator) &&
151
+ !leafTypes.some(function (type) { return ["string", "date"].includes(type); })) {
152
+ addIssue(ctx, "Operator \"".concat(data.operator, "\" can only be used with string or date attributes."));
153
+ return;
154
+ }
155
+ if (dateOperators.includes(data.operator) &&
156
+ !leafTypes.some(function (type) { return ["string", "date"].includes(type); })) {
157
+ addIssue(ctx, "Operator \"".concat(data.operator, "\" can only be used with string or date attributes."));
158
+ return;
159
+ }
160
+ if (arrayOperators.includes(data.operator)) {
161
+ if (!leafTypes.includes("array")) {
162
+ addIssue(ctx, "Operator \"".concat(data.operator, "\" can only be used with array attributes."));
163
+ return;
164
+ }
165
+ if (typeof data.value !== "string") {
166
+ addIssue(ctx, "Operator \"".concat(data.operator, "\" only supports string values."));
167
+ }
168
+ return;
169
+ }
170
+ if (membershipOperators.includes(data.operator)) {
171
+ if (!Array.isArray(data.value)) {
172
+ return;
173
+ }
174
+ data.value.forEach(function (entry, index) {
175
+ if (!matchesLeafValue(leaf, entry)) {
176
+ addIssue(ctx, "Value at index ".concat(index, " does not match the schema of attribute \"").concat(data.attribute, "\"."), ["value", index]);
177
+ }
178
+ });
179
+ return;
180
+ }
181
+ if (commonOperators.includes(data.operator) &&
182
+ data.value !== null &&
183
+ !matchesLeafValue(leaf, data.value)) {
184
+ addIssue(ctx, "Value does not match the schema of attribute \"".concat(data.attribute, "\"."));
185
+ }
186
+ }
187
+ function getConditionsZodSchema(attributesByKey) {
188
+ var conditionZodSchema = zod_1.z.lazy(function () {
189
+ var attributeCondition = zod_1.z
190
+ .object({
191
+ attribute: (0, zodHelpers_1.refineWithMessage)(zod_1.z.string(), function (value) { return resolveAttributePath(value, attributesByKey) !== null; }, function (value) { return "Unknown attribute \"".concat(value, "\""); }),
192
+ operator: zod_1.z.enum(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], commonOperators, true), numericOperators, true), stringOperators, true), dateOperators, true), arrayOperators, true), membershipOperators, true), operatorsWithoutValue, true)),
193
+ value: zod_1.z
194
+ .union([
195
+ zod_1.z.string(),
196
+ zod_1.z.array(zod_1.z.union([zod_1.z.string(), zod_1.z.number(), zod_1.z.boolean(), zod_1.z.null()])),
197
+ zod_1.z.number(),
198
+ zod_1.z.boolean(),
199
+ zod_1.z.date(),
200
+ zod_1.z.null(),
201
+ ])
202
+ .optional(),
203
+ regexFlags: zod_1.z.never().optional(),
204
+ })
205
+ .strict()
206
+ .superRefine(function (data, ctx) {
207
+ if (operatorsWithoutValue.includes(data.operator) && typeof data.value !== "undefined") {
208
+ addIssue(ctx, "when operator is \"".concat(data.operator, "\", value must not be provided"));
209
+ }
210
+ if (!operatorsWithoutValue.includes(data.operator) && typeof data.value === "undefined") {
211
+ addIssue(ctx, "when operator is \"".concat(data.operator, "\", value must be provided"));
212
+ }
213
+ if (numericOperators.includes(data.operator) && typeof data.value !== "number") {
214
+ addIssue(ctx, "when operator is \"".concat(data.operator, "\", value must be a number"));
215
+ }
216
+ if (__spreadArray(__spreadArray(__spreadArray([], stringOperators, true), dateOperators, true), arrayOperators, true).includes(data.operator) &&
217
+ typeof data.value !== "string") {
218
+ addIssue(ctx, "when operator is \"".concat(data.operator, "\", value must be a string"));
219
+ }
220
+ if (membershipOperators.includes(data.operator) && !Array.isArray(data.value)) {
221
+ addIssue(ctx, "when operator is \"".concat(data.operator, "\", value must be an array"));
222
+ }
223
+ validateAttributeAwareCondition(data, ctx, attributesByKey);
224
+ });
225
+ var featureCondition = zod_1.z
226
+ .object({
227
+ feature: zod_1.z.string(),
228
+ operator: zod_1.z.string(),
229
+ attribute: zod_1.z.never().optional(),
230
+ experiment: zod_1.z.never().optional(),
231
+ value: zod_1.z.unknown().optional(),
232
+ regexFlags: zod_1.z.never().optional(),
233
+ })
234
+ .strict()
235
+ .superRefine(function (data, ctx) {
236
+ if (!featureOperators.includes(data.operator)) {
237
+ addIssue(ctx, "Feature conditions only support operators \"isEnabled\" and \"isDisabled\".", [
238
+ "operator",
239
+ ]);
240
+ }
241
+ if (typeof data.value !== "undefined") {
242
+ addIssue(ctx, "Feature conditions must not define `value`; the flag state comes from resolveFlag.", ["value"]);
243
+ }
244
+ });
245
+ var experimentCondition = zod_1.z
246
+ .object({
247
+ experiment: zod_1.z.string(),
248
+ operator: zod_1.z.string(),
249
+ value: zod_1.z.unknown().optional(),
250
+ attribute: zod_1.z.never().optional(),
251
+ feature: zod_1.z.never().optional(),
252
+ regexFlags: zod_1.z.never().optional(),
253
+ })
254
+ .strict()
255
+ .superRefine(function (data, ctx) {
256
+ if (data.operator !== "hasVariation") {
257
+ addIssue(ctx, "Experiment conditions only support operator \"hasVariation\".", [
258
+ "operator",
259
+ ]);
260
+ }
261
+ if (typeof data.value === "undefined") {
262
+ addIssue(ctx, "Experiment conditions must define `value` with the expected variation.", ["value"]);
263
+ return;
264
+ }
265
+ if (typeof data.value !== "string") {
266
+ addIssue(ctx, "Experiment condition `value` must be a string variation.", ["value"]);
267
+ }
268
+ });
269
+ var andCondition = zod_1.z.object({ and: zod_1.z.array(conditionZodSchema).min(1) }).strict();
270
+ var orCondition = zod_1.z.object({ or: zod_1.z.array(conditionZodSchema).min(1) }).strict();
271
+ var notCondition = zod_1.z.object({ not: zod_1.z.array(conditionZodSchema).min(1) }).strict();
272
+ return zod_1.z.union([
273
+ attributeCondition,
274
+ featureCondition,
275
+ experimentCondition,
276
+ andCondition,
277
+ orCondition,
278
+ notCondition,
279
+ ]);
280
+ });
281
+ return zod_1.z.union([zod_1.z.literal("*"), conditionZodSchema, zod_1.z.array(conditionZodSchema).min(1)]);
282
+ }
283
+ //# sourceMappingURL=conditionSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditionSchema.js","sourceRoot":"","sources":["../../src/linter/conditionSchema.ts"],"names":[],"mappings":";;;;;;;;;;;AA6PA,wDAoIC;AA/XD,2BAAwB;AAExB,2CAAiD;AAEjD,IAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AAChD,IAAM,gBAAgB,GAAG,CAAC,aAAa,EAAE,qBAAqB,EAAE,UAAU,EAAE,kBAAkB,CAAC,CAAC;AAChG,IAAM,eAAe,GAAG,CAAC,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAC9E,IAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC1C,IAAM,cAAc,GAAG,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AACnD,IAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5C,IAAM,qBAAqB,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AACtD,IAAM,gBAAgB,GAAG,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;AACrD,IAAM,mBAAmB,GAAG,CAAC,cAAc,CAAC,CAAC;AAU7C,SAAS,gBAAgB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AK,CAAC;YACb,kBAAkB;YAClB,gBAAgB;YAChB,mBAAmB;YACnB,YAAY;YACZ,WAAW;YACX,YAAY;SACb,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,kBAAkB,EAAE,OAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3F,CAAC"}
@@ -0,0 +1,325 @@
1
+ import { z } from "zod";
2
+ export declare const formatPresetsZodSchema: z.ZodObject<{
3
+ number: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
4
+ style: z.ZodOptional<z.ZodEnum<{
5
+ decimal: "decimal";
6
+ percent: "percent";
7
+ currency: "currency";
8
+ unit: "unit";
9
+ }>>;
10
+ currency: z.ZodOptional<z.ZodString>;
11
+ currencyDisplay: z.ZodOptional<z.ZodEnum<{
12
+ symbol: "symbol";
13
+ code: "code";
14
+ name: "name";
15
+ narrowSymbol: "narrowSymbol";
16
+ }>>;
17
+ currencySign: z.ZodOptional<z.ZodEnum<{
18
+ standard: "standard";
19
+ accounting: "accounting";
20
+ }>>;
21
+ unit: z.ZodOptional<z.ZodString>;
22
+ unitDisplay: z.ZodOptional<z.ZodEnum<{
23
+ long: "long";
24
+ short: "short";
25
+ narrow: "narrow";
26
+ }>>;
27
+ useGrouping: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodEnum<{
28
+ auto: "auto";
29
+ always: "always";
30
+ min2: "min2";
31
+ }>]>>;
32
+ minimumIntegerDigits: z.ZodOptional<z.ZodNumber>;
33
+ minimumFractionDigits: z.ZodOptional<z.ZodNumber>;
34
+ maximumFractionDigits: z.ZodOptional<z.ZodNumber>;
35
+ minimumSignificantDigits: z.ZodOptional<z.ZodNumber>;
36
+ maximumSignificantDigits: z.ZodOptional<z.ZodNumber>;
37
+ notation: z.ZodOptional<z.ZodEnum<{
38
+ standard: "standard";
39
+ compact: "compact";
40
+ scientific: "scientific";
41
+ engineering: "engineering";
42
+ }>>;
43
+ compactDisplay: z.ZodOptional<z.ZodEnum<{
44
+ long: "long";
45
+ short: "short";
46
+ }>>;
47
+ signDisplay: z.ZodOptional<z.ZodEnum<{
48
+ auto: "auto";
49
+ always: "always";
50
+ never: "never";
51
+ exceptZero: "exceptZero";
52
+ negative: "negative";
53
+ }>>;
54
+ roundingPriority: z.ZodOptional<z.ZodEnum<{
55
+ auto: "auto";
56
+ morePrecision: "morePrecision";
57
+ lessPrecision: "lessPrecision";
58
+ }>>;
59
+ roundingIncrement: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<5>, z.ZodLiteral<10>, z.ZodLiteral<20>, z.ZodLiteral<25>, z.ZodLiteral<50>, z.ZodLiteral<100>, z.ZodLiteral<200>, z.ZodLiteral<250>, z.ZodLiteral<500>, z.ZodLiteral<1000>, z.ZodLiteral<2000>, z.ZodLiteral<2500>, z.ZodLiteral<5000>]>>;
60
+ roundingMode: z.ZodOptional<z.ZodEnum<{
61
+ ceil: "ceil";
62
+ floor: "floor";
63
+ expand: "expand";
64
+ trunc: "trunc";
65
+ halfCeil: "halfCeil";
66
+ halfFloor: "halfFloor";
67
+ halfExpand: "halfExpand";
68
+ halfTrunc: "halfTrunc";
69
+ halfEven: "halfEven";
70
+ }>>;
71
+ trailingZeroDisplay: z.ZodOptional<z.ZodEnum<{
72
+ auto: "auto";
73
+ stripIfInteger: "stripIfInteger";
74
+ }>>;
75
+ numberingSystem: z.ZodOptional<z.ZodString>;
76
+ }, z.core.$strict>>>;
77
+ date: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
78
+ timeZone: z.ZodOptional<z.ZodString>;
79
+ calendar: z.ZodOptional<z.ZodString>;
80
+ numberingSystem: z.ZodOptional<z.ZodString>;
81
+ hour12: z.ZodOptional<z.ZodBoolean>;
82
+ hourCycle: z.ZodOptional<z.ZodEnum<{
83
+ h11: "h11";
84
+ h12: "h12";
85
+ h23: "h23";
86
+ h24: "h24";
87
+ }>>;
88
+ dateStyle: z.ZodOptional<z.ZodEnum<{
89
+ long: "long";
90
+ short: "short";
91
+ medium: "medium";
92
+ full: "full";
93
+ }>>;
94
+ timeStyle: z.ZodOptional<z.ZodEnum<{
95
+ long: "long";
96
+ short: "short";
97
+ medium: "medium";
98
+ full: "full";
99
+ }>>;
100
+ formatMatcher: z.ZodOptional<z.ZodEnum<{
101
+ "best fit": "best fit";
102
+ basic: "basic";
103
+ }>>;
104
+ fractionalSecondDigits: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
105
+ weekday: z.ZodOptional<z.ZodEnum<{
106
+ long: "long";
107
+ short: "short";
108
+ narrow: "narrow";
109
+ }>>;
110
+ era: z.ZodOptional<z.ZodEnum<{
111
+ long: "long";
112
+ short: "short";
113
+ narrow: "narrow";
114
+ }>>;
115
+ year: z.ZodOptional<z.ZodEnum<{
116
+ numeric: "numeric";
117
+ "2-digit": "2-digit";
118
+ }>>;
119
+ month: z.ZodOptional<z.ZodEnum<{
120
+ long: "long";
121
+ short: "short";
122
+ narrow: "narrow";
123
+ numeric: "numeric";
124
+ "2-digit": "2-digit";
125
+ }>>;
126
+ day: z.ZodOptional<z.ZodEnum<{
127
+ numeric: "numeric";
128
+ "2-digit": "2-digit";
129
+ }>>;
130
+ dayPeriod: z.ZodOptional<z.ZodEnum<{
131
+ long: "long";
132
+ short: "short";
133
+ narrow: "narrow";
134
+ }>>;
135
+ hour: z.ZodOptional<z.ZodEnum<{
136
+ numeric: "numeric";
137
+ "2-digit": "2-digit";
138
+ }>>;
139
+ minute: z.ZodOptional<z.ZodEnum<{
140
+ numeric: "numeric";
141
+ "2-digit": "2-digit";
142
+ }>>;
143
+ second: z.ZodOptional<z.ZodEnum<{
144
+ numeric: "numeric";
145
+ "2-digit": "2-digit";
146
+ }>>;
147
+ timeZoneName: z.ZodOptional<z.ZodEnum<{
148
+ long: "long";
149
+ short: "short";
150
+ shortOffset: "shortOffset";
151
+ longOffset: "longOffset";
152
+ shortGeneric: "shortGeneric";
153
+ longGeneric: "longGeneric";
154
+ }>>;
155
+ }, z.core.$strict>>>;
156
+ time: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
157
+ timeZone: z.ZodOptional<z.ZodString>;
158
+ calendar: z.ZodOptional<z.ZodString>;
159
+ numberingSystem: z.ZodOptional<z.ZodString>;
160
+ hour12: z.ZodOptional<z.ZodBoolean>;
161
+ hourCycle: z.ZodOptional<z.ZodEnum<{
162
+ h11: "h11";
163
+ h12: "h12";
164
+ h23: "h23";
165
+ h24: "h24";
166
+ }>>;
167
+ dateStyle: z.ZodOptional<z.ZodEnum<{
168
+ long: "long";
169
+ short: "short";
170
+ medium: "medium";
171
+ full: "full";
172
+ }>>;
173
+ timeStyle: z.ZodOptional<z.ZodEnum<{
174
+ long: "long";
175
+ short: "short";
176
+ medium: "medium";
177
+ full: "full";
178
+ }>>;
179
+ formatMatcher: z.ZodOptional<z.ZodEnum<{
180
+ "best fit": "best fit";
181
+ basic: "basic";
182
+ }>>;
183
+ fractionalSecondDigits: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
184
+ weekday: z.ZodOptional<z.ZodEnum<{
185
+ long: "long";
186
+ short: "short";
187
+ narrow: "narrow";
188
+ }>>;
189
+ era: z.ZodOptional<z.ZodEnum<{
190
+ long: "long";
191
+ short: "short";
192
+ narrow: "narrow";
193
+ }>>;
194
+ year: z.ZodOptional<z.ZodEnum<{
195
+ numeric: "numeric";
196
+ "2-digit": "2-digit";
197
+ }>>;
198
+ month: z.ZodOptional<z.ZodEnum<{
199
+ long: "long";
200
+ short: "short";
201
+ narrow: "narrow";
202
+ numeric: "numeric";
203
+ "2-digit": "2-digit";
204
+ }>>;
205
+ day: z.ZodOptional<z.ZodEnum<{
206
+ numeric: "numeric";
207
+ "2-digit": "2-digit";
208
+ }>>;
209
+ dayPeriod: z.ZodOptional<z.ZodEnum<{
210
+ long: "long";
211
+ short: "short";
212
+ narrow: "narrow";
213
+ }>>;
214
+ hour: z.ZodOptional<z.ZodEnum<{
215
+ numeric: "numeric";
216
+ "2-digit": "2-digit";
217
+ }>>;
218
+ minute: z.ZodOptional<z.ZodEnum<{
219
+ numeric: "numeric";
220
+ "2-digit": "2-digit";
221
+ }>>;
222
+ second: z.ZodOptional<z.ZodEnum<{
223
+ numeric: "numeric";
224
+ "2-digit": "2-digit";
225
+ }>>;
226
+ timeZoneName: z.ZodOptional<z.ZodEnum<{
227
+ long: "long";
228
+ short: "short";
229
+ shortOffset: "shortOffset";
230
+ longOffset: "longOffset";
231
+ shortGeneric: "shortGeneric";
232
+ longGeneric: "longGeneric";
233
+ }>>;
234
+ }, z.core.$strict>>>;
235
+ relative: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
236
+ numeric: z.ZodOptional<z.ZodEnum<{
237
+ auto: "auto";
238
+ always: "always";
239
+ }>>;
240
+ style: z.ZodOptional<z.ZodEnum<{
241
+ long: "long";
242
+ short: "short";
243
+ narrow: "narrow";
244
+ }>>;
245
+ }, z.core.$strict>>>;
246
+ dateTimeRange: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
247
+ timeZone: z.ZodOptional<z.ZodString>;
248
+ calendar: z.ZodOptional<z.ZodString>;
249
+ numberingSystem: z.ZodOptional<z.ZodString>;
250
+ hour12: z.ZodOptional<z.ZodBoolean>;
251
+ hourCycle: z.ZodOptional<z.ZodEnum<{
252
+ h11: "h11";
253
+ h12: "h12";
254
+ h23: "h23";
255
+ h24: "h24";
256
+ }>>;
257
+ dateStyle: z.ZodOptional<z.ZodEnum<{
258
+ long: "long";
259
+ short: "short";
260
+ medium: "medium";
261
+ full: "full";
262
+ }>>;
263
+ timeStyle: z.ZodOptional<z.ZodEnum<{
264
+ long: "long";
265
+ short: "short";
266
+ medium: "medium";
267
+ full: "full";
268
+ }>>;
269
+ formatMatcher: z.ZodOptional<z.ZodEnum<{
270
+ "best fit": "best fit";
271
+ basic: "basic";
272
+ }>>;
273
+ fractionalSecondDigits: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
274
+ weekday: z.ZodOptional<z.ZodEnum<{
275
+ long: "long";
276
+ short: "short";
277
+ narrow: "narrow";
278
+ }>>;
279
+ era: z.ZodOptional<z.ZodEnum<{
280
+ long: "long";
281
+ short: "short";
282
+ narrow: "narrow";
283
+ }>>;
284
+ year: z.ZodOptional<z.ZodEnum<{
285
+ numeric: "numeric";
286
+ "2-digit": "2-digit";
287
+ }>>;
288
+ month: z.ZodOptional<z.ZodEnum<{
289
+ long: "long";
290
+ short: "short";
291
+ narrow: "narrow";
292
+ numeric: "numeric";
293
+ "2-digit": "2-digit";
294
+ }>>;
295
+ day: z.ZodOptional<z.ZodEnum<{
296
+ numeric: "numeric";
297
+ "2-digit": "2-digit";
298
+ }>>;
299
+ dayPeriod: z.ZodOptional<z.ZodEnum<{
300
+ long: "long";
301
+ short: "short";
302
+ narrow: "narrow";
303
+ }>>;
304
+ hour: z.ZodOptional<z.ZodEnum<{
305
+ numeric: "numeric";
306
+ "2-digit": "2-digit";
307
+ }>>;
308
+ minute: z.ZodOptional<z.ZodEnum<{
309
+ numeric: "numeric";
310
+ "2-digit": "2-digit";
311
+ }>>;
312
+ second: z.ZodOptional<z.ZodEnum<{
313
+ numeric: "numeric";
314
+ "2-digit": "2-digit";
315
+ }>>;
316
+ timeZoneName: z.ZodOptional<z.ZodEnum<{
317
+ long: "long";
318
+ short: "short";
319
+ shortOffset: "shortOffset";
320
+ longOffset: "longOffset";
321
+ shortGeneric: "shortGeneric";
322
+ longGeneric: "longGeneric";
323
+ }>>;
324
+ }, z.core.$strict>>>;
325
+ }, z.core.$strict>;