@chordcommerce/analytics 1.17.1 → 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 +8 -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,5 @@
1
+ "use strict";
2
+ // This client was automatically generated by Segment Typewriter. ** Do Not Edit **
3
+ // To update this file, run:
4
+ // npx typewriter
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ import type { EventProperties } from './types/index.js';
2
+ export declare const pruneNullValues: (props: EventProperties) => EventProperties;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pruneNullValues = void 0;
4
+ var pruneNullValues = function (props) {
5
+ if (typeof props !== 'object' || props === null)
6
+ return props;
7
+ if (!Array.isArray(props)) {
8
+ for (var key in props) {
9
+ if (props.hasOwnProperty(key)) {
10
+ props[key] = (0, exports.pruneNullValues)(props[key]);
11
+ if (props[key] === null)
12
+ delete props[key];
13
+ }
14
+ }
15
+ }
16
+ else {
17
+ for (var i = 0; i < props.length; i++) {
18
+ props[i] = (0, exports.pruneNullValues)(props[i]);
19
+ if (props[i] === null)
20
+ props.splice(i--, 1);
21
+ }
22
+ }
23
+ return props;
24
+ };
25
+ exports.pruneNullValues = pruneNullValues;
@@ -0,0 +1,43 @@
1
+ import { z } from 'zod';
2
+ export declare const productInProductsSchema: z.ZodEffects<z.ZodObject<{
3
+ product_id: z.ZodString;
4
+ sku: z.ZodString;
5
+ products: z.ZodArray<z.ZodObject<{
6
+ product_id: z.ZodString;
7
+ sku: z.ZodString;
8
+ }, "strip", z.ZodTypeAny, {
9
+ product_id?: string;
10
+ sku?: string;
11
+ }, {
12
+ product_id?: string;
13
+ sku?: string;
14
+ }>, "many">;
15
+ }, "strip", z.ZodTypeAny, {
16
+ product_id?: string;
17
+ sku?: string;
18
+ products?: {
19
+ product_id?: string;
20
+ sku?: string;
21
+ }[];
22
+ }, {
23
+ product_id?: string;
24
+ sku?: string;
25
+ products?: {
26
+ product_id?: string;
27
+ sku?: string;
28
+ }[];
29
+ }>, {
30
+ product_id?: string;
31
+ sku?: string;
32
+ products?: {
33
+ product_id?: string;
34
+ sku?: string;
35
+ }[];
36
+ }, {
37
+ product_id?: string;
38
+ sku?: string;
39
+ products?: {
40
+ product_id?: string;
41
+ sku?: string;
42
+ }[];
43
+ }>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.productInProductsSchema = void 0;
4
+ var zod_1 = require("zod");
5
+ exports.productInProductsSchema = zod_1.z
6
+ .object({
7
+ product_id: zod_1.z.string(),
8
+ sku: zod_1.z.string(),
9
+ products: zod_1.z.array(zod_1.z.object({ product_id: zod_1.z.string(), sku: zod_1.z.string() })),
10
+ })
11
+ .refine(function (event) {
12
+ var productInCart = event.products.find(function (p) {
13
+ return p.product_id === event.product_id && p.sku === event.sku;
14
+ });
15
+ return !!productInCart;
16
+ }, {
17
+ message: '`products` array must contain the product_id and sku provided',
18
+ });
@@ -0,0 +1,4 @@
1
+ export * from './custom.js';
2
+ export * from './objects.js';
3
+ export * from './tracking-plan-map.js';
4
+ export * from './tracking-plan.js';
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./custom.js"), exports);
18
+ __exportStar(require("./objects.js"), exports);
19
+ __exportStar(require("./tracking-plan-map.js"), exports);
20
+ __exportStar(require("./tracking-plan.js"), exports);