@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,8 +1,8 @@
1
1
  // Generated by ts-to-zod
2
- import { z } from 'zod';
3
- export const identifyTraitsSchema = z.record(z.any()).and(z.object({
2
+ import * as z from 'zod';
3
+ export const identifyTraitsSchema = z.record(z.string(), z.any()).and(z.object({
4
4
  address: z
5
- .record(z.any())
5
+ .record(z.string(), z.any())
6
6
  .and(z.object({
7
7
  city: z.string().optional(),
8
8
  country: z.string().optional(),
@@ -15,7 +15,7 @@ export const identifyTraitsSchema = z.record(z.any()).and(z.object({
15
15
  avatar: z.string().optional(),
16
16
  birthday: z.string().optional(),
17
17
  company: z
18
- .record(z.any())
18
+ .record(z.string(), z.any())
19
19
  .and(z.object({
20
20
  name: z.string().optional(),
21
21
  id: z.union([z.string(), z.number()]).optional(),
@@ -59,6 +59,26 @@ export const lineItemSchema = productSchema.extend({
59
59
  line_item_id: z.string().optional(),
60
60
  quantity: z.number(),
61
61
  });
62
+ export const checkoutSchema = z.object({
63
+ affiliation: z.string().optional(),
64
+ checkout_type: z.string().optional(),
65
+ coupon: z.string().optional(),
66
+ currency: z.string().optional(),
67
+ discount: z.number().optional(),
68
+ order_id: z.string().optional(),
69
+ order_name: z.string().optional(),
70
+ products: z.array(lineItemSchema),
71
+ revenue: z.number().optional(),
72
+ shipping: z.number().optional(),
73
+ tax: z.number().optional(),
74
+ value: z.number().optional(),
75
+ });
76
+ export const cartSchema = z.object({
77
+ cart_id: z.string().optional(),
78
+ currency: z.string().optional(),
79
+ products: z.array(lineItemSchema),
80
+ value: z.number().optional(),
81
+ });
62
82
  export const orderSchema = z.object({
63
83
  affiliation: z.string().optional(),
64
84
  campaign_id: z.number().optional(),
@@ -72,7 +92,7 @@ export const orderSchema = z.object({
72
92
  has_subscription: z.boolean().optional(),
73
93
  is_recurring: z.boolean().optional(),
74
94
  last_name: z.string().optional(),
75
- metadata: z.record(z.unknown()).optional(),
95
+ metadata: z.record(z.string(), z.unknown()).optional(),
76
96
  order_date: z.string().optional(),
77
97
  order_id: z.string().optional(),
78
98
  phone: z.string().optional(),
@@ -80,7 +100,7 @@ export const orderSchema = z.object({
80
100
  .array(lineItemSchema.and(z.object({
81
101
  bundle_size: z.number().optional(),
82
102
  cross_sold_quantity: z.number().optional(),
83
- variant_metadata: z.record(z.unknown()).optional(),
103
+ variant_metadata: z.record(z.string(), z.unknown()).optional(),
84
104
  })))
85
105
  .optional(),
86
106
  purl_link: z.string().optional(),
@@ -100,26 +120,5 @@ export const orderSchema = z.object({
100
120
  tax: z.number().optional(),
101
121
  template_id: z.number().optional(),
102
122
  total: z.number().optional(),
103
- tracking_ids: z.record(z.unknown()).optional(),
104
- });
105
- export const checkoutSchema = z.object({
106
- affiliation: z.string().optional(),
107
- checkout_type: z.string().optional(),
108
- coupon: z.string().optional(),
109
- currency: z.string().optional(),
110
- discount: z.number().optional(),
111
- order_id: z.string().optional(),
112
- order_name: z.string().optional(),
113
- products: z.array(lineItemSchema),
114
- revenue: z.number().optional(),
115
- shipping: z.number().optional(),
116
- tax: z.number().optional(),
117
- value: z.number().optional(),
118
- step: z.number().optional(),
119
- });
120
- export const cartSchema = z.object({
121
- cart_id: z.string().optional(),
122
- currency: z.string().optional(),
123
- products: z.array(lineItemSchema),
124
- value: z.number().optional(),
123
+ tracking_ids: z.record(z.string(), z.unknown()).optional(),
125
124
  });