@chordcommerce/analytics 1.17.0 → 1.18.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 (48) hide show
  1. package/README.md +48 -0
  2. package/dist/cjs/client/cdp.d.ts +3 -0
  3. package/dist/cjs/client/cdp.js +123 -0
  4. package/dist/cjs/client/consent/index.d.ts +11 -0
  5. package/dist/cjs/client/consent/index.js +241 -0
  6. package/dist/cjs/client/consent/ketch.d.ts +16 -0
  7. package/dist/cjs/client/consent/ketch.js +53 -0
  8. package/dist/cjs/client/consent/onetrust.d.ts +22 -0
  9. package/dist/cjs/client/consent/onetrust.js +61 -0
  10. package/dist/cjs/client/consent/segment.d.ts +17 -0
  11. package/dist/cjs/client/consent/segment.js +155 -0
  12. package/dist/cjs/client/consent/shopify.d.ts +21 -0
  13. package/dist/cjs/client/consent/shopify.js +51 -0
  14. package/dist/cjs/client/index.d.ts +111 -0
  15. package/dist/cjs/client/index.js +861 -0
  16. package/dist/cjs/client/utils.d.ts +1 -0
  17. package/dist/cjs/client/utils.js +12 -0
  18. package/dist/cjs/index.d.ts +2 -0
  19. package/dist/cjs/index.js +18 -0
  20. package/dist/cjs/setupTests.d.ts +1 -0
  21. package/dist/cjs/setupTests.js +6 -0
  22. package/dist/cjs/types/client.d.ts +96 -0
  23. package/dist/cjs/types/client.js +2 -0
  24. package/dist/cjs/types/consent.d.ts +11 -0
  25. package/dist/cjs/types/consent.js +2 -0
  26. package/dist/cjs/types/formatters.d.ts +114 -0
  27. package/dist/cjs/types/formatters.js +2 -0
  28. package/dist/cjs/types/index.d.ts +7 -0
  29. package/dist/cjs/types/index.js +22 -0
  30. package/dist/cjs/types/input.d.ts +396 -0
  31. package/dist/cjs/types/input.js +2 -0
  32. package/dist/cjs/types/objects.d.ts +379 -0
  33. package/dist/cjs/types/objects.js +2 -0
  34. package/dist/cjs/types/typewriter.d.ts +6502 -0
  35. package/dist/cjs/types/typewriter.js +5 -0
  36. package/dist/cjs/utils.d.ts +2 -0
  37. package/dist/cjs/utils.js +25 -0
  38. package/dist/cjs/validators/custom.d.ts +43 -0
  39. package/dist/cjs/validators/custom.js +18 -0
  40. package/dist/cjs/validators/index.d.ts +4 -0
  41. package/dist/cjs/validators/index.js +20 -0
  42. package/dist/cjs/validators/objects.d.ts +696 -0
  43. package/dist/cjs/validators/objects.js +128 -0
  44. package/dist/cjs/validators/tracking-plan-map.d.ts +6603 -0
  45. package/dist/cjs/validators/tracking-plan-map.js +72 -0
  46. package/dist/cjs/validators/tracking-plan.d.ts +9275 -0
  47. package/dist/cjs/validators/tracking-plan.js +1682 -0
  48. package/package.json +4 -2
@@ -0,0 +1,379 @@
1
+ export interface Cart {
2
+ /**
3
+ * Cart ID
4
+ */
5
+ cart_id?: string;
6
+ /**
7
+ * Currency code of the transaction (for example, "USD")
8
+ */
9
+ currency?: string;
10
+ /**
11
+ * Products in the cart
12
+ */
13
+ products: LineItem[];
14
+ /**
15
+ * Revenue ($) with discounts and coupons added in
16
+ */
17
+ value?: number;
18
+ }
19
+ export interface IdentifyTraits {
20
+ /**
21
+ * Street address of a user.
22
+ */
23
+ address?: {
24
+ city?: string;
25
+ country?: string;
26
+ postalCode?: string;
27
+ state?: string;
28
+ street?: string;
29
+ [property: string]: any;
30
+ };
31
+ /**
32
+ * Age of a user
33
+ */
34
+ age?: number;
35
+ /**
36
+ * URL to an avatar image for the user
37
+ */
38
+ avatar?: string;
39
+ /**
40
+ * User’s birthday. Segment recommends using ISO-8601 date strings.
41
+ */
42
+ birthday?: string;
43
+ /**
44
+ * Company the user represents
45
+ */
46
+ company?: {
47
+ name?: string;
48
+ id?: string | number;
49
+ industry?: string;
50
+ employeeCount?: number;
51
+ plan?: string;
52
+ [property: string]: any;
53
+ };
54
+ /**
55
+ * Date the user’s account was first created. Segment recommends using ISO-8601 date strings.
56
+ */
57
+ createdAt?: string;
58
+ /**
59
+ * Description of the user
60
+ */
61
+ description?: string;
62
+ /**
63
+ * Email address of a user
64
+ */
65
+ email?: string;
66
+ /**
67
+ * First name of a user
68
+ */
69
+ firstName?: string;
70
+ /**
71
+ * Gender of a user
72
+ */
73
+ gender?: string;
74
+ /**
75
+ * Unique ID in your database for a user
76
+ */
77
+ id?: string;
78
+ /**
79
+ * Last name of a user
80
+ */
81
+ lastName?: string;
82
+ /**
83
+ * Full name of a user. If you only pass a first and last name Segment automatically fills in the full name for you.
84
+ */
85
+ name?: string;
86
+ /**
87
+ * Phone number of a user
88
+ */
89
+ phone?: string;
90
+ /**
91
+ * Title of a user, usually related to their position at a specific company. Example: “VP of Engineering”
92
+ */
93
+ title?: string;
94
+ /**
95
+ * User’s username. This should be unique to each user, like the usernames of Twitter or GitHub.
96
+ */
97
+ username?: string;
98
+ /**
99
+ * Website of a user
100
+ */
101
+ website?: string;
102
+ /**
103
+ * Additional custom user traits.
104
+ */
105
+ [property: string]: any;
106
+ }
107
+ export interface LineItem extends Product {
108
+ /**
109
+ * Coupon code associated with a product (for example, "MAY_DEALS_3")
110
+ */
111
+ coupon?: string;
112
+ /**
113
+ * Database ID of the line item
114
+ */
115
+ line_item_id?: string;
116
+ /**
117
+ * Quantity of the product
118
+ */
119
+ quantity: number;
120
+ }
121
+ export interface Order {
122
+ /**
123
+ * Store or affiliation from which this transaction occurred (for example, "Google Store")
124
+ */
125
+ affiliation?: string;
126
+ /**
127
+ * Order metadata "campaign_id"
128
+ */
129
+ campaign_id?: number;
130
+ /**
131
+ * Channel where order was placed (for example, "chord")
132
+ */
133
+ channel?: string;
134
+ /**
135
+ * Checkout provider (for example, "stripe")
136
+ */
137
+ checkout_type?: string;
138
+ /**
139
+ * Transaction coupon redeemed with the transaction
140
+ */
141
+ coupon?: string;
142
+ /**
143
+ * Currency code of the transaction (for example, "USD")
144
+ */
145
+ currency?: string;
146
+ /**
147
+ * Total discount associated with the transaction
148
+ */
149
+ discount?: number;
150
+ /**
151
+ * Email address associated with the order
152
+ */
153
+ email?: string;
154
+ /**
155
+ * First name in the shipping address for the order
156
+ */
157
+ first_name?: string;
158
+ /**
159
+ * Order contains a subscription
160
+ */
161
+ has_subscription?: boolean;
162
+ /**
163
+ * Order contains a subscription
164
+ */
165
+ is_recurring?: boolean;
166
+ /**
167
+ * Last name in the shipping address for the order
168
+ */
169
+ last_name?: string;
170
+ /**
171
+ * Metadata of the order
172
+ */
173
+ metadata?: {
174
+ [k: string]: unknown;
175
+ };
176
+ /**
177
+ * Date and time order was placed
178
+ */
179
+ order_date?: string;
180
+ /**
181
+ * Order/transaction ID
182
+ */
183
+ order_id?: string;
184
+ /**
185
+ * Phone number associated with the order
186
+ */
187
+ phone?: string;
188
+ /**
189
+ * Products in the order
190
+ */
191
+ products?: (LineItem & {
192
+ /**
193
+ * Number of SKUs in the bundle
194
+ */
195
+ bundle_size?: number;
196
+ /**
197
+ * Quantity sold via cross-selling
198
+ */
199
+ cross_sold_quantity?: number;
200
+ /**
201
+ * Metadata of the product variant
202
+ */
203
+ variant_metadata?: {
204
+ [k: string]: unknown;
205
+ };
206
+ })[];
207
+ /**
208
+ * URL for customer to share to receive referral credit
209
+ */
210
+ purl_link?: string;
211
+ /**
212
+ * ID for referral that customer used to place the order
213
+ */
214
+ referral_identifier_id?: string;
215
+ /**
216
+ * Revenue ($) associated with the transaction (excluding shipping and tax)
217
+ */
218
+ revenue?: number;
219
+ /**
220
+ * Shipping cost associated with the transaction
221
+ */
222
+ shipping?: number;
223
+ /**
224
+ * City in the shipping address for the order
225
+ */
226
+ shipping_city?: string;
227
+ /**
228
+ * Country in the shipping address for the order
229
+ */
230
+ shipping_country?: string;
231
+ shipping_method_details?: {
232
+ /**
233
+ * Code of shipping method chosen for the order (for example, "standard_shipping")
234
+ */
235
+ shipping_code?: string;
236
+ /**
237
+ * Name of shipping method chosen for the order (for example, "Standard Shipping")
238
+ */
239
+ shipping_method?: string;
240
+ };
241
+ /**
242
+ * State in the shipping address for the order
243
+ */
244
+ shipping_state?: string;
245
+ /**
246
+ * Zipcode in the shipping address for the order
247
+ */
248
+ shipping_zipcode?: string;
249
+ /**
250
+ * Total tax associated with the transaction
251
+ */
252
+ tax?: number;
253
+ /**
254
+ * Order metadata "template_id"
255
+ */
256
+ template_id?: number;
257
+ /**
258
+ * Revenue ($) with discounts and coupons added in.
259
+ */
260
+ total?: number;
261
+ /**
262
+ * Tracking IDs for third party integrations
263
+ */
264
+ tracking_ids?: {
265
+ [k: string]: unknown;
266
+ };
267
+ }
268
+ export interface Product {
269
+ /**
270
+ * Product affiliation to designate a supplying company or brick and mortar store location (for example, "Google Store")
271
+ */
272
+ affiliation?: string;
273
+ /**
274
+ * Brand associated with the product
275
+ */
276
+ brand?: string;
277
+ /**
278
+ * Product belongs to a bundle
279
+ */
280
+ bundle?: boolean;
281
+ /**
282
+ * Product category
283
+ */
284
+ category?: string;
285
+ /**
286
+ * Short description of the product
287
+ */
288
+ description?: string;
289
+ /**
290
+ * Image URL of the product
291
+ */
292
+ image_url?: string;
293
+ /**
294
+ * Name of the product
295
+ */
296
+ name: string;
297
+ /**
298
+ * Option values of the product variant
299
+ */
300
+ option_values?: string[];
301
+ /**
302
+ * Position in the product list (for example, 3)
303
+ */
304
+ position?: number;
305
+ /**
306
+ * Price ($) of the product
307
+ */
308
+ price: number;
309
+ /**
310
+ * Database ID of the product
311
+ */
312
+ product_id: string;
313
+ /**
314
+ * SKU of the product variant
315
+ */
316
+ sku: string;
317
+ /**
318
+ * Slug of the product, often used in URLs (for example, "product-red")
319
+ */
320
+ slug?: string;
321
+ /**
322
+ * URL of the product page
323
+ */
324
+ url?: string;
325
+ /**
326
+ * Name of the product variant
327
+ */
328
+ variant?: string;
329
+ }
330
+ export interface Checkout {
331
+ /**
332
+ * Store or affiliation from which this transaction occurred (for example, "Google Store")
333
+ */
334
+ affiliation?: string;
335
+ /**
336
+ * Checkout provider (for example, "stripe")
337
+ */
338
+ checkout_type?: string;
339
+ /**
340
+ * Transaction coupon redeemed with the transaction
341
+ */
342
+ coupon?: string;
343
+ /**
344
+ * Currency code of the transaction (for example, "USD")
345
+ */
346
+ currency?: string;
347
+ /**
348
+ * Total discount associated with the transaction
349
+ */
350
+ discount?: number;
351
+ /**
352
+ * Order/transaction ID
353
+ */
354
+ order_id?: string;
355
+ /**
356
+ * Order number (for example, "CHORD-000111222")
357
+ */
358
+ order_name?: string;
359
+ /**
360
+ * Products in the checkout
361
+ */
362
+ products: LineItem[];
363
+ /**
364
+ * Revenue ($) associated with the transaction (excluding shipping and tax)
365
+ */
366
+ revenue?: number;
367
+ /**
368
+ * Shipping cost associated with the transaction
369
+ */
370
+ shipping?: number;
371
+ /**
372
+ * Total tax associated with the transaction
373
+ */
374
+ tax?: number;
375
+ /**
376
+ * Revenue ($) with discounts and coupons added in
377
+ */
378
+ value?: number;
379
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });