@chordcommerce/analytics 1.24.3 → 1.24.5

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 (35) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/client/cdp.js +2 -2
  3. package/dist/cjs/client/consent/index.js +2 -2
  4. package/dist/cjs/client/consent/onetrust-api.d.ts +1 -1
  5. package/dist/cjs/client/consent/onetrust.d.ts +2 -2
  6. package/dist/cjs/client/consent/segment.js +19 -6
  7. package/dist/cjs/client/consent/shopify.d.ts +5 -1
  8. package/dist/cjs/client/consent/shopify.js +70 -21
  9. package/dist/cjs/client/index.js +16 -8
  10. package/dist/cjs/client/utils.js +1 -2
  11. package/dist/cjs/utils.d.ts +1 -1
  12. package/dist/cjs/utils.js +2 -2
  13. package/dist/cjs/validators/custom.d.ts +4 -38
  14. package/dist/cjs/validators/custom.js +5 -5
  15. package/dist/cjs/validators/objects.d.ts +73 -584
  16. package/dist/cjs/validators/objects.js +110 -111
  17. package/dist/cjs/validators/tracking-plan-map.d.ts +172 -5126
  18. package/dist/cjs/validators/tracking-plan.d.ts +272 -7008
  19. package/dist/cjs/validators/tracking-plan.js +1722 -1649
  20. package/dist/client/consent/onetrust-api.d.ts +1 -1
  21. package/dist/client/consent/onetrust.d.ts +2 -2
  22. package/dist/client/consent/segment.js +1 -1
  23. package/dist/client/consent/shopify.d.ts +5 -1
  24. package/dist/client/consent/shopify.js +70 -21
  25. package/dist/client/index.js +84 -84
  26. package/dist/tsconfig-build-cjs.tsbuildinfo +1 -0
  27. package/dist/utils.d.ts +1 -1
  28. package/dist/validators/custom.d.ts +4 -38
  29. package/dist/validators/custom.js +1 -1
  30. package/dist/validators/objects.d.ts +73 -584
  31. package/dist/validators/objects.js +27 -28
  32. package/dist/validators/tracking-plan-map.d.ts +172 -5126
  33. package/dist/validators/tracking-plan.d.ts +272 -7008
  34. package/dist/validators/tracking-plan.js +219 -146
  35. package/package.json +4 -4
@@ -1,128 +1,127 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cartSchema = exports.checkoutSchema = exports.orderSchema = exports.lineItemSchema = exports.productSchema = exports.identifyTraitsSchema = void 0;
3
+ exports.orderSchema = exports.cartSchema = exports.checkoutSchema = exports.lineItemSchema = exports.productSchema = exports.identifyTraitsSchema = void 0;
4
4
  // Generated by ts-to-zod
5
- var zod_1 = require("zod");
6
- exports.identifyTraitsSchema = zod_1.z.record(zod_1.z.any()).and(zod_1.z.object({
7
- address: zod_1.z
8
- .record(zod_1.z.any())
9
- .and(zod_1.z.object({
10
- city: zod_1.z.string().optional(),
11
- country: zod_1.z.string().optional(),
12
- postalCode: zod_1.z.string().optional(),
13
- state: zod_1.z.string().optional(),
14
- street: zod_1.z.string().optional(),
5
+ var z = require("zod");
6
+ exports.identifyTraitsSchema = z.record(z.string(), z.any()).and(z.object({
7
+ address: z
8
+ .record(z.string(), z.any())
9
+ .and(z.object({
10
+ city: z.string().optional(),
11
+ country: z.string().optional(),
12
+ postalCode: z.string().optional(),
13
+ state: z.string().optional(),
14
+ street: z.string().optional(),
15
15
  }))
16
16
  .optional(),
17
- age: zod_1.z.number().optional(),
18
- avatar: zod_1.z.string().optional(),
19
- birthday: zod_1.z.string().optional(),
20
- company: zod_1.z
21
- .record(zod_1.z.any())
22
- .and(zod_1.z.object({
23
- name: zod_1.z.string().optional(),
24
- id: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(),
25
- industry: zod_1.z.string().optional(),
26
- employeeCount: zod_1.z.number().optional(),
27
- plan: zod_1.z.string().optional(),
17
+ age: z.number().optional(),
18
+ avatar: z.string().optional(),
19
+ birthday: z.string().optional(),
20
+ company: z
21
+ .record(z.string(), z.any())
22
+ .and(z.object({
23
+ name: z.string().optional(),
24
+ id: z.union([z.string(), z.number()]).optional(),
25
+ industry: z.string().optional(),
26
+ employeeCount: z.number().optional(),
27
+ plan: z.string().optional(),
28
28
  }))
29
29
  .optional(),
30
- createdAt: zod_1.z.string().optional(),
31
- description: zod_1.z.string().optional(),
32
- email: zod_1.z.string().optional(),
33
- firstName: zod_1.z.string().optional(),
34
- gender: zod_1.z.string().optional(),
35
- id: zod_1.z.string().optional(),
36
- lastName: zod_1.z.string().optional(),
37
- name: zod_1.z.string().optional(),
38
- phone: zod_1.z.string().optional(),
39
- title: zod_1.z.string().optional(),
40
- username: zod_1.z.string().optional(),
41
- website: zod_1.z.string().optional(),
30
+ createdAt: z.string().optional(),
31
+ description: z.string().optional(),
32
+ email: z.string().optional(),
33
+ firstName: z.string().optional(),
34
+ gender: z.string().optional(),
35
+ id: z.string().optional(),
36
+ lastName: z.string().optional(),
37
+ name: z.string().optional(),
38
+ phone: z.string().optional(),
39
+ title: z.string().optional(),
40
+ username: z.string().optional(),
41
+ website: z.string().optional(),
42
42
  }));
43
- exports.productSchema = zod_1.z.object({
44
- affiliation: zod_1.z.string().optional(),
45
- brand: zod_1.z.string().optional(),
46
- bundle: zod_1.z.boolean().optional(),
47
- category: zod_1.z.string().optional(),
48
- description: zod_1.z.string().optional(),
49
- image_url: zod_1.z.string().optional(),
50
- name: zod_1.z.string(),
51
- option_values: zod_1.z.array(zod_1.z.string()).optional(),
52
- position: zod_1.z.number().optional(),
53
- price: zod_1.z.number(),
54
- product_id: zod_1.z.string(),
55
- sku: zod_1.z.string(),
56
- slug: zod_1.z.string().optional(),
57
- url: zod_1.z.string().optional(),
58
- variant: zod_1.z.string().optional(),
43
+ exports.productSchema = z.object({
44
+ affiliation: z.string().optional(),
45
+ brand: z.string().optional(),
46
+ bundle: z.boolean().optional(),
47
+ category: z.string().optional(),
48
+ description: z.string().optional(),
49
+ image_url: z.string().optional(),
50
+ name: z.string(),
51
+ option_values: z.array(z.string()).optional(),
52
+ position: z.number().optional(),
53
+ price: z.number(),
54
+ product_id: z.string(),
55
+ sku: z.string(),
56
+ slug: z.string().optional(),
57
+ url: z.string().optional(),
58
+ variant: z.string().optional(),
59
59
  });
60
60
  exports.lineItemSchema = exports.productSchema.extend({
61
- coupon: zod_1.z.string().optional(),
62
- line_item_id: zod_1.z.string().optional(),
63
- quantity: zod_1.z.number(),
61
+ coupon: z.string().optional(),
62
+ line_item_id: z.string().optional(),
63
+ quantity: z.number(),
64
64
  });
65
- exports.orderSchema = zod_1.z.object({
66
- affiliation: zod_1.z.string().optional(),
67
- campaign_id: zod_1.z.number().optional(),
68
- channel: zod_1.z.string().optional(),
69
- checkout_type: zod_1.z.string().optional(),
70
- coupon: zod_1.z.string().optional(),
71
- currency: zod_1.z.string().optional(),
72
- discount: zod_1.z.number().optional(),
73
- email: zod_1.z.string().optional(),
74
- first_name: zod_1.z.string().optional(),
75
- has_subscription: zod_1.z.boolean().optional(),
76
- is_recurring: zod_1.z.boolean().optional(),
77
- last_name: zod_1.z.string().optional(),
78
- metadata: zod_1.z.record(zod_1.z.unknown()).optional(),
79
- order_date: zod_1.z.string().optional(),
80
- order_id: zod_1.z.string().optional(),
81
- phone: zod_1.z.string().optional(),
82
- products: zod_1.z
83
- .array(exports.lineItemSchema.and(zod_1.z.object({
84
- bundle_size: zod_1.z.number().optional(),
85
- cross_sold_quantity: zod_1.z.number().optional(),
86
- variant_metadata: zod_1.z.record(zod_1.z.unknown()).optional(),
65
+ exports.checkoutSchema = z.object({
66
+ affiliation: z.string().optional(),
67
+ checkout_type: z.string().optional(),
68
+ coupon: z.string().optional(),
69
+ currency: z.string().optional(),
70
+ discount: z.number().optional(),
71
+ order_id: z.string().optional(),
72
+ order_name: z.string().optional(),
73
+ products: z.array(exports.lineItemSchema),
74
+ revenue: z.number().optional(),
75
+ shipping: z.number().optional(),
76
+ tax: z.number().optional(),
77
+ value: z.number().optional(),
78
+ });
79
+ exports.cartSchema = z.object({
80
+ cart_id: z.string().optional(),
81
+ currency: z.string().optional(),
82
+ products: z.array(exports.lineItemSchema),
83
+ value: z.number().optional(),
84
+ });
85
+ exports.orderSchema = z.object({
86
+ affiliation: z.string().optional(),
87
+ campaign_id: z.number().optional(),
88
+ channel: z.string().optional(),
89
+ checkout_type: z.string().optional(),
90
+ coupon: z.string().optional(),
91
+ currency: z.string().optional(),
92
+ discount: z.number().optional(),
93
+ email: z.string().optional(),
94
+ first_name: z.string().optional(),
95
+ has_subscription: z.boolean().optional(),
96
+ is_recurring: z.boolean().optional(),
97
+ last_name: z.string().optional(),
98
+ metadata: z.record(z.string(), z.unknown()).optional(),
99
+ order_date: z.string().optional(),
100
+ order_id: z.string().optional(),
101
+ phone: z.string().optional(),
102
+ products: z
103
+ .array(exports.lineItemSchema.and(z.object({
104
+ bundle_size: z.number().optional(),
105
+ cross_sold_quantity: z.number().optional(),
106
+ variant_metadata: z.record(z.string(), z.unknown()).optional(),
87
107
  })))
88
108
  .optional(),
89
- purl_link: zod_1.z.string().optional(),
90
- referral_identifier_id: zod_1.z.string().optional(),
91
- revenue: zod_1.z.number().optional(),
92
- shipping: zod_1.z.number().optional(),
93
- shipping_city: zod_1.z.string().optional(),
94
- shipping_country: zod_1.z.string().optional(),
95
- shipping_method_details: zod_1.z
109
+ purl_link: z.string().optional(),
110
+ referral_identifier_id: z.string().optional(),
111
+ revenue: z.number().optional(),
112
+ shipping: z.number().optional(),
113
+ shipping_city: z.string().optional(),
114
+ shipping_country: z.string().optional(),
115
+ shipping_method_details: z
96
116
  .object({
97
- shipping_code: zod_1.z.string().optional(),
98
- shipping_method: zod_1.z.string().optional(),
117
+ shipping_code: z.string().optional(),
118
+ shipping_method: z.string().optional(),
99
119
  })
100
120
  .optional(),
101
- shipping_state: zod_1.z.string().optional(),
102
- shipping_zipcode: zod_1.z.string().optional(),
103
- tax: zod_1.z.number().optional(),
104
- template_id: zod_1.z.number().optional(),
105
- total: zod_1.z.number().optional(),
106
- tracking_ids: zod_1.z.record(zod_1.z.unknown()).optional(),
107
- });
108
- exports.checkoutSchema = zod_1.z.object({
109
- affiliation: zod_1.z.string().optional(),
110
- checkout_type: zod_1.z.string().optional(),
111
- coupon: zod_1.z.string().optional(),
112
- currency: zod_1.z.string().optional(),
113
- discount: zod_1.z.number().optional(),
114
- order_id: zod_1.z.string().optional(),
115
- order_name: zod_1.z.string().optional(),
116
- products: zod_1.z.array(exports.lineItemSchema),
117
- revenue: zod_1.z.number().optional(),
118
- shipping: zod_1.z.number().optional(),
119
- tax: zod_1.z.number().optional(),
120
- value: zod_1.z.number().optional(),
121
- step: zod_1.z.number().optional(),
122
- });
123
- exports.cartSchema = zod_1.z.object({
124
- cart_id: zod_1.z.string().optional(),
125
- currency: zod_1.z.string().optional(),
126
- products: zod_1.z.array(exports.lineItemSchema),
127
- value: zod_1.z.number().optional(),
121
+ shipping_state: z.string().optional(),
122
+ shipping_zipcode: z.string().optional(),
123
+ tax: z.number().optional(),
124
+ template_id: z.number().optional(),
125
+ total: z.number().optional(),
126
+ tracking_ids: z.record(z.string(), z.unknown()).optional(),
128
127
  });