@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.
- package/README.md +1 -1
- package/dist/cjs/client/cdp.js +2 -2
- package/dist/cjs/client/consent/index.js +2 -2
- package/dist/cjs/client/consent/onetrust-api.d.ts +1 -1
- package/dist/cjs/client/consent/onetrust.d.ts +2 -2
- package/dist/cjs/client/consent/segment.js +19 -6
- package/dist/cjs/client/consent/shopify.d.ts +5 -1
- package/dist/cjs/client/consent/shopify.js +70 -21
- package/dist/cjs/client/index.js +16 -8
- package/dist/cjs/client/utils.js +1 -2
- package/dist/cjs/utils.d.ts +1 -1
- package/dist/cjs/utils.js +2 -2
- package/dist/cjs/validators/custom.d.ts +4 -38
- package/dist/cjs/validators/custom.js +5 -5
- package/dist/cjs/validators/objects.d.ts +73 -584
- package/dist/cjs/validators/objects.js +110 -111
- package/dist/cjs/validators/tracking-plan-map.d.ts +172 -5126
- package/dist/cjs/validators/tracking-plan.d.ts +272 -7008
- package/dist/cjs/validators/tracking-plan.js +1722 -1649
- package/dist/client/consent/onetrust-api.d.ts +1 -1
- package/dist/client/consent/onetrust.d.ts +2 -2
- package/dist/client/consent/segment.js +1 -1
- package/dist/client/consent/shopify.d.ts +5 -1
- package/dist/client/consent/shopify.js +70 -21
- package/dist/client/index.js +84 -84
- package/dist/tsconfig-build-cjs.tsbuildinfo +1 -0
- package/dist/utils.d.ts +1 -1
- package/dist/validators/custom.d.ts +4 -38
- package/dist/validators/custom.js +1 -1
- package/dist/validators/objects.d.ts +73 -584
- package/dist/validators/objects.js +27 -28
- package/dist/validators/tracking-plan-map.d.ts +172 -5126
- package/dist/validators/tracking-plan.d.ts +272 -7008
- package/dist/validators/tracking-plan.js +219 -146
- package/package.json +4 -4
|
@@ -1,128 +1,127 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.orderSchema = exports.cartSchema = exports.checkoutSchema = exports.lineItemSchema = exports.productSchema = exports.identifyTraitsSchema = void 0;
|
|
4
4
|
// Generated by ts-to-zod
|
|
5
|
-
var
|
|
6
|
-
exports.identifyTraitsSchema =
|
|
7
|
-
address:
|
|
8
|
-
.record(
|
|
9
|
-
.and(
|
|
10
|
-
city:
|
|
11
|
-
country:
|
|
12
|
-
postalCode:
|
|
13
|
-
state:
|
|
14
|
-
street:
|
|
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:
|
|
18
|
-
avatar:
|
|
19
|
-
birthday:
|
|
20
|
-
company:
|
|
21
|
-
.record(
|
|
22
|
-
.and(
|
|
23
|
-
name:
|
|
24
|
-
id:
|
|
25
|
-
industry:
|
|
26
|
-
employeeCount:
|
|
27
|
-
plan:
|
|
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:
|
|
31
|
-
description:
|
|
32
|
-
email:
|
|
33
|
-
firstName:
|
|
34
|
-
gender:
|
|
35
|
-
id:
|
|
36
|
-
lastName:
|
|
37
|
-
name:
|
|
38
|
-
phone:
|
|
39
|
-
title:
|
|
40
|
-
username:
|
|
41
|
-
website:
|
|
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 =
|
|
44
|
-
affiliation:
|
|
45
|
-
brand:
|
|
46
|
-
bundle:
|
|
47
|
-
category:
|
|
48
|
-
description:
|
|
49
|
-
image_url:
|
|
50
|
-
name:
|
|
51
|
-
option_values:
|
|
52
|
-
position:
|
|
53
|
-
price:
|
|
54
|
-
product_id:
|
|
55
|
-
sku:
|
|
56
|
-
slug:
|
|
57
|
-
url:
|
|
58
|
-
variant:
|
|
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:
|
|
62
|
-
line_item_id:
|
|
63
|
-
quantity:
|
|
61
|
+
coupon: z.string().optional(),
|
|
62
|
+
line_item_id: z.string().optional(),
|
|
63
|
+
quantity: z.number(),
|
|
64
64
|
});
|
|
65
|
-
exports.
|
|
66
|
-
affiliation:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
products:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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:
|
|
90
|
-
referral_identifier_id:
|
|
91
|
-
revenue:
|
|
92
|
-
shipping:
|
|
93
|
-
shipping_city:
|
|
94
|
-
shipping_country:
|
|
95
|
-
shipping_method_details:
|
|
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:
|
|
98
|
-
shipping_method:
|
|
117
|
+
shipping_code: z.string().optional(),
|
|
118
|
+
shipping_method: z.string().optional(),
|
|
99
119
|
})
|
|
100
120
|
.optional(),
|
|
101
|
-
shipping_state:
|
|
102
|
-
shipping_zipcode:
|
|
103
|
-
tax:
|
|
104
|
-
template_id:
|
|
105
|
-
total:
|
|
106
|
-
tracking_ids:
|
|
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
|
});
|