@ninetailed/experience.js-utils 7.16.0 → 7.17.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.
package/index.cjs.js CHANGED
@@ -16,18 +16,10 @@ var ComponentTypeEnum;
16
16
  ComponentTypeEnum["EntryReplacement"] = "EntryReplacement";
17
17
  ComponentTypeEnum["InlineVariable"] = "InlineVariable";
18
18
  })(ComponentTypeEnum || (ComponentTypeEnum = {}));
19
- var InlineVariableComponentValueTypeEnum;
20
- (function (InlineVariableComponentValueTypeEnum) {
21
- InlineVariableComponentValueTypeEnum["String"] = "String";
22
- InlineVariableComponentValueTypeEnum["Object"] = "Object";
23
- })(InlineVariableComponentValueTypeEnum || (InlineVariableComponentValueTypeEnum = {}));
24
19
  const entryReplacementVariantSchema = zod.z.object({
25
20
  id: zod.z.string(),
26
21
  hidden: zod.z.boolean().default(false)
27
22
  });
28
- const variableVariantSchema = zod.z.object({
29
- value: zod.z.union([zod.z.string(), experience_jsShared.SerializableObject])
30
- });
31
23
  const EntryReplacementComponentSchema = zod.z.object({
32
24
  type: zod.z.literal(ComponentTypeEnum.EntryReplacement),
33
25
  baseline: entryReplacementVariantSchema,
@@ -39,9 +31,9 @@ function isEntryReplacementComponent(component) {
39
31
  const InlineVariableComponentSchema = zod.z.object({
40
32
  type: zod.z.literal(ComponentTypeEnum.InlineVariable),
41
33
  key: zod.z.string(),
42
- valueType: zod.z.nativeEnum(InlineVariableComponentValueTypeEnum),
43
- baseline: variableVariantSchema,
44
- variants: zod.z.array(variableVariantSchema)
34
+ valueType: zod.z.nativeEnum(experience_jsShared.InlineVariableComponentValueTypeEnum),
35
+ baseline: experience_jsShared.variableVariantSchema,
36
+ variants: zod.z.array(experience_jsShared.variableVariantSchema)
45
37
  });
46
38
  function isInlineVariableComponent(component) {
47
39
  return component.type === ComponentTypeEnum.InlineVariable;
package/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { SerializableObject, logger } from '@ninetailed/experience.js-shared';
1
+ import { InlineVariableComponentValueTypeEnum, variableVariantSchema, logger } from '@ninetailed/experience.js-shared';
2
2
  import { z } from 'zod';
3
3
 
4
4
  const Audience = z.object({
@@ -12,18 +12,10 @@ let ComponentTypeEnum = /*#__PURE__*/function (ComponentTypeEnum) {
12
12
  ComponentTypeEnum["InlineVariable"] = "InlineVariable";
13
13
  return ComponentTypeEnum;
14
14
  }({});
15
- let InlineVariableComponentValueTypeEnum = /*#__PURE__*/function (InlineVariableComponentValueTypeEnum) {
16
- InlineVariableComponentValueTypeEnum["String"] = "String";
17
- InlineVariableComponentValueTypeEnum["Object"] = "Object";
18
- return InlineVariableComponentValueTypeEnum;
19
- }({});
20
15
  const entryReplacementVariantSchema = z.object({
21
16
  id: z.string(),
22
17
  hidden: z.boolean().default(false)
23
18
  });
24
- const variableVariantSchema = z.object({
25
- value: z.union([z.string(), SerializableObject])
26
- });
27
19
  const EntryReplacementComponentSchema = z.object({
28
20
  type: z.literal(ComponentTypeEnum.EntryReplacement),
29
21
  baseline: entryReplacementVariantSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ninetailed/experience.js-utils",
3
- "version": "7.16.0",
3
+ "version": "7.17.0",
4
4
  "description": "Ninetailed Experience.js Utils",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -9,8 +9,8 @@
9
9
  "directory": "packages/utils/javascript"
10
10
  },
11
11
  "dependencies": {
12
- "@ninetailed/experience.js": "7.16.0",
13
- "@ninetailed/experience.js-shared": "7.16.0",
12
+ "@ninetailed/experience.js": "7.17.0",
13
+ "@ninetailed/experience.js-shared": "7.17.0",
14
14
  "zod": "3.23.0"
15
15
  },
16
16
  "module": "./index.esm.js",
@@ -1,14 +1,9 @@
1
- import { Baseline, VariantRef } from '@ninetailed/experience.js';
2
- import { SerializableObject } from '@ninetailed/experience.js-shared';
1
+ import { VariantRef, Baseline, InlineVariableComponentValueTypeEnum } from '@ninetailed/experience.js-shared';
3
2
  import { z } from 'zod';
4
3
  export declare enum ComponentTypeEnum {
5
4
  EntryReplacement = "EntryReplacement",
6
5
  InlineVariable = "InlineVariable"
7
6
  }
8
- export declare enum InlineVariableComponentValueTypeEnum {
9
- String = "String",
10
- Object = "Object"
11
- }
12
7
  export declare const entryReplacementVariantSchema: z.ZodObject<{
13
8
  id: z.ZodString;
14
9
  hidden: z.ZodDefault<z.ZodBoolean>;
@@ -19,13 +14,6 @@ export declare const entryReplacementVariantSchema: z.ZodObject<{
19
14
  id: string;
20
15
  hidden?: boolean | undefined;
21
16
  }>;
22
- export declare const variableVariantSchema: z.ZodObject<{
23
- value: z.ZodUnion<[z.ZodString, z.ZodType<SerializableObject, z.ZodTypeDef, unknown>]>;
24
- }, "strip", z.ZodTypeAny, {
25
- value: string | SerializableObject;
26
- }, {
27
- value?: unknown;
28
- }>;
29
17
  export declare const EntryReplacementComponentSchema: z.ZodObject<{
30
18
  type: z.ZodLiteral<ComponentTypeEnum.EntryReplacement>;
31
19
  baseline: z.ZodObject<{
@@ -77,26 +65,26 @@ export declare const InlineVariableComponentSchema: z.ZodObject<{
77
65
  key: z.ZodString;
78
66
  valueType: z.ZodNativeEnum<typeof InlineVariableComponentValueTypeEnum>;
79
67
  baseline: z.ZodObject<{
80
- value: z.ZodUnion<[z.ZodString, z.ZodType<SerializableObject, z.ZodTypeDef, unknown>]>;
68
+ value: z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodType<import("@ninetailed/experience.js-shared").Properties, z.ZodTypeDef, unknown>]>;
81
69
  }, "strip", z.ZodTypeAny, {
82
- value: string | SerializableObject;
70
+ value: string | number | boolean | import("@ninetailed/experience.js-shared").Properties;
83
71
  }, {
84
72
  value?: unknown;
85
73
  }>;
86
74
  variants: z.ZodArray<z.ZodObject<{
87
- value: z.ZodUnion<[z.ZodString, z.ZodType<SerializableObject, z.ZodTypeDef, unknown>]>;
75
+ value: z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodType<import("@ninetailed/experience.js-shared").Properties, z.ZodTypeDef, unknown>]>;
88
76
  }, "strip", z.ZodTypeAny, {
89
- value: string | SerializableObject;
77
+ value: string | number | boolean | import("@ninetailed/experience.js-shared").Properties;
90
78
  }, {
91
79
  value?: unknown;
92
80
  }>, "many">;
93
81
  }, "strip", z.ZodTypeAny, {
94
82
  type: ComponentTypeEnum.InlineVariable;
95
83
  baseline: {
96
- value: string | SerializableObject;
84
+ value: string | number | boolean | import("@ninetailed/experience.js-shared").Properties;
97
85
  };
98
86
  variants: {
99
- value: string | SerializableObject;
87
+ value: string | number | boolean | import("@ninetailed/experience.js-shared").Properties;
100
88
  }[];
101
89
  key: string;
102
90
  valueType: InlineVariableComponentValueTypeEnum;
@@ -160,26 +148,26 @@ export declare const ExperienceConfigComponentSchema: z.ZodEffects<z.ZodDiscrimi
160
148
  key: z.ZodString;
161
149
  valueType: z.ZodNativeEnum<typeof InlineVariableComponentValueTypeEnum>;
162
150
  baseline: z.ZodObject<{
163
- value: z.ZodUnion<[z.ZodString, z.ZodType<SerializableObject, z.ZodTypeDef, unknown>]>;
151
+ value: z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodType<import("@ninetailed/experience.js-shared").Properties, z.ZodTypeDef, unknown>]>;
164
152
  }, "strip", z.ZodTypeAny, {
165
- value: string | SerializableObject;
153
+ value: string | number | boolean | import("@ninetailed/experience.js-shared").Properties;
166
154
  }, {
167
155
  value?: unknown;
168
156
  }>;
169
157
  variants: z.ZodArray<z.ZodObject<{
170
- value: z.ZodUnion<[z.ZodString, z.ZodType<SerializableObject, z.ZodTypeDef, unknown>]>;
158
+ value: z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodType<import("@ninetailed/experience.js-shared").Properties, z.ZodTypeDef, unknown>]>;
171
159
  }, "strip", z.ZodTypeAny, {
172
- value: string | SerializableObject;
160
+ value: string | number | boolean | import("@ninetailed/experience.js-shared").Properties;
173
161
  }, {
174
162
  value?: unknown;
175
163
  }>, "many">;
176
164
  }, "strip", z.ZodTypeAny, {
177
165
  type: ComponentTypeEnum.InlineVariable;
178
166
  baseline: {
179
- value: string | SerializableObject;
167
+ value: string | number | boolean | import("@ninetailed/experience.js-shared").Properties;
180
168
  };
181
169
  variants: {
182
- value: string | SerializableObject;
170
+ value: string | number | boolean | import("@ninetailed/experience.js-shared").Properties;
183
171
  }[];
184
172
  key: string;
185
173
  valueType: InlineVariableComponentValueTypeEnum;
@@ -206,10 +194,10 @@ export declare const ExperienceConfigComponentSchema: z.ZodEffects<z.ZodDiscrimi
206
194
  } | {
207
195
  type: ComponentTypeEnum.InlineVariable;
208
196
  baseline: {
209
- value: string | SerializableObject;
197
+ value: string | number | boolean | import("@ninetailed/experience.js-shared").Properties;
210
198
  };
211
199
  variants: {
212
- value: string | SerializableObject;
200
+ value: string | number | boolean | import("@ninetailed/experience.js-shared").Properties;
213
201
  }[];
214
202
  key: string;
215
203
  valueType: InlineVariableComponentValueTypeEnum;
@@ -264,26 +252,26 @@ export declare const Config: z.ZodObject<{
264
252
  key: z.ZodString;
265
253
  valueType: z.ZodNativeEnum<typeof InlineVariableComponentValueTypeEnum>;
266
254
  baseline: z.ZodObject<{
267
- value: z.ZodUnion<[z.ZodString, z.ZodType<SerializableObject, z.ZodTypeDef, unknown>]>;
255
+ value: z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodType<import("@ninetailed/experience.js-shared").Properties, z.ZodTypeDef, unknown>]>;
268
256
  }, "strip", z.ZodTypeAny, {
269
- value: string | SerializableObject;
257
+ value: string | number | boolean | import("@ninetailed/experience.js-shared").Properties;
270
258
  }, {
271
259
  value?: unknown;
272
260
  }>;
273
261
  variants: z.ZodArray<z.ZodObject<{
274
- value: z.ZodUnion<[z.ZodString, z.ZodType<SerializableObject, z.ZodTypeDef, unknown>]>;
262
+ value: z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodType<import("@ninetailed/experience.js-shared").Properties, z.ZodTypeDef, unknown>]>;
275
263
  }, "strip", z.ZodTypeAny, {
276
- value: string | SerializableObject;
264
+ value: string | number | boolean | import("@ninetailed/experience.js-shared").Properties;
277
265
  }, {
278
266
  value?: unknown;
279
267
  }>, "many">;
280
268
  }, "strip", z.ZodTypeAny, {
281
269
  type: ComponentTypeEnum.InlineVariable;
282
270
  baseline: {
283
- value: string | SerializableObject;
271
+ value: string | number | boolean | import("@ninetailed/experience.js-shared").Properties;
284
272
  };
285
273
  variants: {
286
- value: string | SerializableObject;
274
+ value: string | number | boolean | import("@ninetailed/experience.js-shared").Properties;
287
275
  }[];
288
276
  key: string;
289
277
  valueType: InlineVariableComponentValueTypeEnum;
@@ -310,10 +298,10 @@ export declare const Config: z.ZodObject<{
310
298
  } | {
311
299
  type: ComponentTypeEnum.InlineVariable;
312
300
  baseline: {
313
- value: string | SerializableObject;
301
+ value: string | number | boolean | import("@ninetailed/experience.js-shared").Properties;
314
302
  };
315
303
  variants: {
316
- value: string | SerializableObject;
304
+ value: string | number | boolean | import("@ninetailed/experience.js-shared").Properties;
317
305
  }[];
318
306
  key: string;
319
307
  valueType: InlineVariableComponentValueTypeEnum;
@@ -335,10 +323,10 @@ export declare const Config: z.ZodObject<{
335
323
  } | {
336
324
  type: ComponentTypeEnum.InlineVariable;
337
325
  baseline: {
338
- value: string | SerializableObject;
326
+ value: string | number | boolean | import("@ninetailed/experience.js-shared").Properties;
339
327
  };
340
328
  variants: {
341
- value: string | SerializableObject;
329
+ value: string | number | boolean | import("@ninetailed/experience.js-shared").Properties;
342
330
  }[];
343
331
  key: string;
344
332
  valueType: InlineVariableComponentValueTypeEnum;