@shware/analytics 0.3.17 → 0.4.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 (40) hide show
  1. package/dist/index.cjs +3 -0
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +2 -1
  4. package/dist/index.d.ts +2 -1
  5. package/dist/index.mjs +2 -0
  6. package/dist/index.mjs.map +1 -1
  7. package/dist/react-router/index.cjs +0 -1
  8. package/dist/react-router/index.cjs.map +1 -1
  9. package/dist/react-router/index.mjs +1 -2
  10. package/dist/react-router/index.mjs.map +1 -1
  11. package/dist/schema/index.cjs +50 -50
  12. package/dist/schema/index.cjs.map +1 -1
  13. package/dist/schema/index.d.cts +28 -151
  14. package/dist/schema/index.d.ts +28 -151
  15. package/dist/schema/index.mjs +1 -1
  16. package/dist/schema/index.mjs.map +1 -1
  17. package/dist/server/conversions-api.cjs +10 -2
  18. package/dist/server/conversions-api.cjs.map +1 -1
  19. package/dist/server/conversions-api.mjs +10 -2
  20. package/dist/server/conversions-api.mjs.map +1 -1
  21. package/dist/track/index.cjs +3 -8
  22. package/dist/track/index.cjs.map +1 -1
  23. package/dist/track/index.mjs +3 -8
  24. package/dist/track/index.mjs.map +1 -1
  25. package/dist/track/types.cjs.map +1 -1
  26. package/dist/track/types.d.cts +1 -1
  27. package/dist/track/types.d.ts +1 -1
  28. package/dist/utils/stripe.cjs +53 -0
  29. package/dist/utils/stripe.cjs.map +1 -0
  30. package/dist/utils/stripe.d.cts +5 -0
  31. package/dist/utils/stripe.d.ts +5 -0
  32. package/dist/utils/stripe.mjs +27 -0
  33. package/dist/utils/stripe.mjs.map +1 -0
  34. package/dist/utils/token-bucket.cjs +73 -0
  35. package/dist/utils/token-bucket.cjs.map +1 -0
  36. package/dist/utils/token-bucket.d.cts +20 -0
  37. package/dist/utils/token-bucket.d.ts +20 -0
  38. package/dist/utils/token-bucket.mjs +48 -0
  39. package/dist/utils/token-bucket.mjs.map +1 -0
  40. package/package.json +7 -8
package/dist/index.cjs CHANGED
@@ -25,6 +25,7 @@ __export(index_exports, {
25
25
  getVisitor: () => import_visitor.getVisitor,
26
26
  setVisitor: () => import_visitor.setVisitor,
27
27
  setupAnalytics: () => import_setup.setupAnalytics,
28
+ stripeMinorUnits: () => import_stripe.stripeMinorUnits,
28
29
  track: () => import_track.track,
29
30
  trackAsync: () => import_track.trackAsync,
30
31
  updateVisitorSchema: () => import_schema.updateVisitorSchema
@@ -34,6 +35,7 @@ var import_setup = require("./setup/index.cjs");
34
35
  var import_track = require("./track/index.cjs");
35
36
  var import_visitor = require("./visitor/index.cjs");
36
37
  var import_schema = require("./schema/index.cjs");
38
+ var import_stripe = require("./utils/stripe.cjs");
37
39
  // Annotate the CommonJS export names for ESM import in node:
38
40
  0 && (module.exports = {
39
41
  createTrackEventSchema,
@@ -41,6 +43,7 @@ var import_schema = require("./schema/index.cjs");
41
43
  getVisitor,
42
44
  setVisitor,
43
45
  setupAnalytics,
46
+ stripeMinorUnits,
44
47
  track,
45
48
  trackAsync,
46
49
  updateVisitorSchema
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { setupAnalytics } from './setup/index';\nexport { track, trackAsync } from './track/index';\nexport { getVisitor, setVisitor } from './visitor/index';\nexport { createTrackEventSchema, createVisitorSchema, updateVisitorSchema } from './schema/index';\nexport type {\n TrackProperties,\n TrackTags,\n AllowedPropertyValues,\n UserProvidedData,\n} from './track/types';\nexport type { VisitorProperties } from './visitor/types';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA+B;AAC/B,mBAAkC;AAClC,qBAAuC;AACvC,oBAAiF;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { setupAnalytics } from './setup/index';\nexport { track, trackAsync } from './track/index';\nexport { getVisitor, setVisitor } from './visitor/index';\nexport { createTrackEventSchema, createVisitorSchema, updateVisitorSchema } from './schema/index';\nexport { stripeMinorUnits } from './utils/stripe';\nexport type {\n TrackProperties,\n TrackTags,\n AllowedPropertyValues,\n UserProvidedData,\n} from './track/types';\nexport type { VisitorProperties } from './visitor/types';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA+B;AAC/B,mBAAkC;AAClC,qBAAuC;AACvC,oBAAiF;AACjF,oBAAiC;","names":[]}
package/dist/index.d.cts CHANGED
@@ -2,8 +2,9 @@ export { setupAnalytics } from './setup/index.cjs';
2
2
  export { track, trackAsync } from './track/index.cjs';
3
3
  export { getVisitor, setVisitor } from './visitor/index.cjs';
4
4
  export { createTrackEventSchema, createVisitorSchema, updateVisitorSchema } from './schema/index.cjs';
5
+ export { stripeMinorUnits } from './utils/stripe.cjs';
5
6
  export { AllowedPropertyValues, TrackProperties, TrackTags, UserProvidedData } from './track/types.cjs';
6
7
  export { VisitorProperties } from './visitor/types.cjs';
7
8
  import 'axios';
8
- import 'zod';
9
+ import 'zod/v4';
9
10
  import './track/gtag.cjs';
package/dist/index.d.ts CHANGED
@@ -2,8 +2,9 @@ export { setupAnalytics } from './setup/index.js';
2
2
  export { track, trackAsync } from './track/index.js';
3
3
  export { getVisitor, setVisitor } from './visitor/index.js';
4
4
  export { createTrackEventSchema, createVisitorSchema, updateVisitorSchema } from './schema/index.js';
5
+ export { stripeMinorUnits } from './utils/stripe.js';
5
6
  export { AllowedPropertyValues, TrackProperties, TrackTags, UserProvidedData } from './track/types.js';
6
7
  export { VisitorProperties } from './visitor/types.js';
7
8
  import 'axios';
8
- import 'zod';
9
+ import 'zod/v4';
9
10
  import './track/gtag.js';
package/dist/index.mjs CHANGED
@@ -3,12 +3,14 @@ import { setupAnalytics } from "./setup/index.mjs";
3
3
  import { track, trackAsync } from "./track/index.mjs";
4
4
  import { getVisitor, setVisitor } from "./visitor/index.mjs";
5
5
  import { createTrackEventSchema, createVisitorSchema, updateVisitorSchema } from "./schema/index.mjs";
6
+ import { stripeMinorUnits } from "./utils/stripe.mjs";
6
7
  export {
7
8
  createTrackEventSchema,
8
9
  createVisitorSchema,
9
10
  getVisitor,
10
11
  setVisitor,
11
12
  setupAnalytics,
13
+ stripeMinorUnits,
12
14
  track,
13
15
  trackAsync,
14
16
  updateVisitorSchema
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { setupAnalytics } from './setup/index';\nexport { track, trackAsync } from './track/index';\nexport { getVisitor, setVisitor } from './visitor/index';\nexport { createTrackEventSchema, createVisitorSchema, updateVisitorSchema } from './schema/index';\nexport type {\n TrackProperties,\n TrackTags,\n AllowedPropertyValues,\n UserProvidedData,\n} from './track/types';\nexport type { VisitorProperties } from './visitor/types';\n"],"mappings":";AAAA,SAAS,sBAAsB;AAC/B,SAAS,OAAO,kBAAkB;AAClC,SAAS,YAAY,kBAAkB;AACvC,SAAS,wBAAwB,qBAAqB,2BAA2B;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { setupAnalytics } from './setup/index';\nexport { track, trackAsync } from './track/index';\nexport { getVisitor, setVisitor } from './visitor/index';\nexport { createTrackEventSchema, createVisitorSchema, updateVisitorSchema } from './schema/index';\nexport { stripeMinorUnits } from './utils/stripe';\nexport type {\n TrackProperties,\n TrackTags,\n AllowedPropertyValues,\n UserProvidedData,\n} from './track/types';\nexport type { VisitorProperties } from './visitor/types';\n"],"mappings":";AAAA,SAAS,sBAAsB;AAC/B,SAAS,OAAO,kBAAkB;AAClC,SAAS,YAAY,kBAAkB;AACvC,SAAS,wBAAwB,qBAAqB,2BAA2B;AACjF,SAAS,wBAAwB;","names":[]}
@@ -34,7 +34,6 @@ var import_jsx_runtime = require("react/jsx-runtime");
34
34
  function useReportWebVitals(reportWebVitalsFn) {
35
35
  (0, import_react.useEffect)(() => {
36
36
  (0, import_web_vitals.onCLS)(reportWebVitalsFn);
37
- (0, import_web_vitals.onFID)(reportWebVitalsFn);
38
37
  (0, import_web_vitals.onLCP)(reportWebVitalsFn);
39
38
  (0, import_web_vitals.onINP)(reportWebVitalsFn);
40
39
  (0, import_web_vitals.onFCP)(reportWebVitalsFn);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/react-router/index.tsx"],"sourcesContent":["import { useEffect } from 'react';\nimport { useLocation, useSearchParams } from 'react-router';\nimport { onLCP, onFID, onCLS, onINP, onFCP, onTTFB, type Metric } from 'web-vitals';\nimport { track } from '../track/index';\nimport { mapFBEvent } from '../track/fbq';\nimport type { Gtag, GaId, GtmId } from '../track/gtag';\nimport type { Pixel, PixelId } from '../track/fbq';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\n\nfunction useReportWebVitals(reportWebVitalsFn: (metric: Metric) => void) {\n useEffect(() => {\n onCLS(reportWebVitalsFn);\n onFID(reportWebVitalsFn);\n onLCP(reportWebVitalsFn);\n onINP(reportWebVitalsFn);\n onFCP(reportWebVitalsFn);\n onTTFB(reportWebVitalsFn);\n }, [reportWebVitalsFn]);\n}\n\ndeclare global {\n interface Window extends Gtag, Pixel {}\n}\n\ninterface Props {\n gaId?: GaId;\n gtmId?: GtmId;\n pixelId?: PixelId;\n facebookAppId?: string;\n nonce?: string;\n debugMode?: boolean;\n}\n\nexport function sendGAEvent<T extends EventName>(\n name: TrackName<T>,\n properties?: TrackProperties<T>\n) {\n if (typeof window === 'undefined' || !window.gtag) {\n console.warn('gtag has not been initialized');\n return;\n }\n window.gtag('event', name, properties);\n}\n\nexport function sendFBEvent<T extends EventName>(\n name: TrackName<T>,\n properties?: TrackProperties<T>,\n event_id?: string\n) {\n if (typeof window === 'undefined' || !window.fbq) {\n console.warn('fbq has not been initialized');\n return;\n }\n const { fbq } = window;\n const options = { eventID: event_id };\n const [type, fbEventName, fbEventProperties] = mapFBEvent(name, properties);\n if (type === 'track') {\n fbq(type, fbEventName, fbEventProperties, options);\n } else {\n fbq(type, fbEventName, fbEventProperties, options);\n }\n}\n\nexport function Analytics({ gaId, nonce, debugMode, pixelId, facebookAppId }: Props) {\n const { pathname } = useLocation();\n const [params] = useSearchParams();\n\n useEffect(() => {\n const properties = {\n pathname,\n referrer: document.referrer,\n gclid: params.get('gclid'),\n fbclid: params.get('fbclid'),\n utm_source: params.get('utm_source'),\n utm_medium: params.get('utm_medium'),\n utm_campaign: params.get('utm_campaign'),\n utm_term: params.get('utm_term'),\n utm_content: params.get('utm_content'),\n };\n\n /**\n * Pixel:\n * Each time the Pixel loads, it automatically calls fbq('track', 'PageView') to track a\n * PageView standard event.\n */\n track('page_view', properties, { enableThirdPartyTracking: false });\n }, [pathname, params]);\n\n useReportWebVitals((metric) => {\n const properties = {\n id: metric.id,\n rating: metric.rating,\n value: metric.value,\n delta: metric.delta,\n navigation_type: metric.navigationType,\n non_interaction: true, // avoids affecting bounce rate.\n };\n track(metric.name, properties);\n });\n\n return (\n <>\n {facebookAppId && <meta property=\"fb:app_id\" content={facebookAppId} />}\n {gaId && (\n <>\n <script\n async\n id=\"gtag\"\n nonce={nonce}\n src={`https://www.googletagmanager.com/gtag/js?id=${gaId}`}\n />\n <script\n async\n nonce={nonce}\n id=\"gtag-init\"\n dangerouslySetInnerHTML={{\n __html: `\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '${gaId}'${debugMode ? \" ,{ 'debug_mode': true }\" : ''});\n `,\n }}\n />\n </>\n )}\n {pixelId && (\n <>\n <script\n id=\"pixel\"\n dangerouslySetInnerHTML={{\n __html: `\n !(function (f, b, e, v, n, t, s) {\n if (f.fbq) return;\n n = f.fbq = function () {\n n.callMethod ? n.callMethod.apply(n, arguments) : n.queue.push(arguments);\n };\n if (!f._fbq) f._fbq = n;\n n.push = n;\n n.loaded = !0;\n n.version = '2.0';\n n.queue = [];\n t = b.createElement(e);\n t.async = !0;\n t.src = v;\n s = b.getElementsByTagName(e)[0];\n s.parentNode.insertBefore(t, s);\n })(window, document, 'script', 'https://connect.facebook.net/en_US/fbevents.js');\n fbq('init', '${pixelId}');\n fbq('track', 'PageView');`,\n }}\n />\n </>\n )}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA0B;AAC1B,0BAA6C;AAC7C,wBAAuE;AACvE,mBAAsB;AACtB,iBAA2B;AAkGH;AA7FxB,SAAS,mBAAmB,mBAA6C;AACvE,8BAAU,MAAM;AACd,iCAAM,iBAAiB;AACvB,iCAAM,iBAAiB;AACvB,iCAAM,iBAAiB;AACvB,iCAAM,iBAAiB;AACvB,iCAAM,iBAAiB;AACvB,kCAAO,iBAAiB;AAAA,EAC1B,GAAG,CAAC,iBAAiB,CAAC;AACxB;AAeO,SAAS,YACd,MACA,YACA;AACA,MAAI,OAAO,WAAW,eAAe,CAAC,OAAO,MAAM;AACjD,YAAQ,KAAK,+BAA+B;AAC5C;AAAA,EACF;AACA,SAAO,KAAK,SAAS,MAAM,UAAU;AACvC;AAEO,SAAS,YACd,MACA,YACA,UACA;AACA,MAAI,OAAO,WAAW,eAAe,CAAC,OAAO,KAAK;AAChD,YAAQ,KAAK,8BAA8B;AAC3C;AAAA,EACF;AACA,QAAM,EAAE,IAAI,IAAI;AAChB,QAAM,UAAU,EAAE,SAAS,SAAS;AACpC,QAAM,CAAC,MAAM,aAAa,iBAAiB,QAAI,uBAAW,MAAM,UAAU;AAC1E,MAAI,SAAS,SAAS;AACpB,QAAI,MAAM,aAAa,mBAAmB,OAAO;AAAA,EACnD,OAAO;AACL,QAAI,MAAM,aAAa,mBAAmB,OAAO;AAAA,EACnD;AACF;AAEO,SAAS,UAAU,EAAE,MAAM,OAAO,WAAW,SAAS,cAAc,GAAU;AACnF,QAAM,EAAE,SAAS,QAAI,iCAAY;AACjC,QAAM,CAAC,MAAM,QAAI,qCAAgB;AAEjC,8BAAU,MAAM;A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AA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAiBO,OAAO;AAAA;AAAA,QAExB;AAAA;AAAA,IACF,GACF;AAAA,KAEJ;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/react-router/index.tsx"],"sourcesContent":["import { useEffect } from 'react';\nimport { useLocation, useSearchParams } from 'react-router';\nimport { onLCP, onCLS, onINP, onFCP, onTTFB, type Metric } from 'web-vitals';\nimport { track } from '../track/index';\nimport { mapFBEvent } from '../track/fbq';\nimport type { Gtag, GaId, GtmId } from '../track/gtag';\nimport type { Pixel, PixelId } from '../track/fbq';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\n\nfunction useReportWebVitals(reportWebVitalsFn: (metric: Metric) => void) {\n useEffect(() => {\n onCLS(reportWebVitalsFn);\n onLCP(reportWebVitalsFn);\n onINP(reportWebVitalsFn);\n onFCP(reportWebVitalsFn);\n onTTFB(reportWebVitalsFn);\n }, [reportWebVitalsFn]);\n}\n\ndeclare global {\n interface Window extends Gtag, Pixel {}\n}\n\ninterface Props {\n gaId?: GaId;\n gtmId?: GtmId;\n pixelId?: PixelId;\n facebookAppId?: string;\n nonce?: string;\n debugMode?: boolean;\n}\n\nexport function sendGAEvent<T extends EventName>(\n name: TrackName<T>,\n properties?: TrackProperties<T>\n) {\n if (typeof window === 'undefined' || !window.gtag) {\n console.warn('gtag has not been initialized');\n return;\n }\n window.gtag('event', name, properties);\n}\n\nexport function sendFBEvent<T extends EventName>(\n name: TrackName<T>,\n properties?: TrackProperties<T>,\n event_id?: string\n) {\n if (typeof window === 'undefined' || !window.fbq) {\n console.warn('fbq has not been initialized');\n return;\n }\n const { fbq } = window;\n const options = { eventID: event_id };\n const [type, fbEventName, fbEventProperties] = mapFBEvent(name, properties);\n if (type === 'track') {\n fbq(type, fbEventName, fbEventProperties, options);\n } else {\n fbq(type, fbEventName, fbEventProperties, options);\n }\n}\n\nexport function Analytics({ gaId, nonce, debugMode, pixelId, facebookAppId }: Props) {\n const { pathname } = useLocation();\n const [params] = useSearchParams();\n\n useEffect(() => {\n const properties = {\n pathname,\n referrer: document.referrer,\n gclid: params.get('gclid'),\n fbclid: params.get('fbclid'),\n utm_source: params.get('utm_source'),\n utm_medium: params.get('utm_medium'),\n utm_campaign: params.get('utm_campaign'),\n utm_term: params.get('utm_term'),\n utm_content: params.get('utm_content'),\n };\n\n /**\n * Pixel:\n * Each time the Pixel loads, it automatically calls fbq('track', 'PageView') to track a\n * PageView standard event.\n */\n track('page_view', properties, { enableThirdPartyTracking: false });\n }, [pathname, params]);\n\n useReportWebVitals((metric) => {\n const properties = {\n id: metric.id,\n rating: metric.rating,\n value: metric.value,\n delta: metric.delta,\n navigation_type: metric.navigationType,\n non_interaction: true, // avoids affecting bounce rate.\n };\n track(metric.name, properties);\n });\n\n return (\n <>\n {facebookAppId && <meta property=\"fb:app_id\" content={facebookAppId} />}\n {gaId && (\n <>\n <script\n async\n id=\"gtag\"\n nonce={nonce}\n src={`https://www.googletagmanager.com/gtag/js?id=${gaId}`}\n />\n <script\n async\n nonce={nonce}\n id=\"gtag-init\"\n dangerouslySetInnerHTML={{\n __html: `\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '${gaId}'${debugMode ? \" ,{ 'debug_mode': true }\" : ''});\n `,\n }}\n />\n </>\n )}\n {pixelId && (\n <>\n <script\n id=\"pixel\"\n dangerouslySetInnerHTML={{\n __html: `\n !(function (f, b, e, v, n, t, s) {\n if (f.fbq) return;\n n = f.fbq = function () {\n n.callMethod ? n.callMethod.apply(n, arguments) : n.queue.push(arguments);\n };\n if (!f._fbq) f._fbq = n;\n n.push = n;\n n.loaded = !0;\n n.version = '2.0';\n n.queue = [];\n t = b.createElement(e);\n t.async = !0;\n t.src = v;\n s = b.getElementsByTagName(e)[0];\n s.parentNode.insertBefore(t, s);\n })(window, document, 'script', 'https://connect.facebook.net/en_US/fbevents.js');\n fbq('init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AAA,IACF,GACF;AAAA,KAEJ;AAEJ;","names":[]}
@@ -1,14 +1,13 @@
1
1
  // src/react-router/index.tsx
2
2
  import { useEffect } from "react";
3
3
  import { useLocation, useSearchParams } from "react-router";
4
- import { onLCP, onFID, onCLS, onINP, onFCP, onTTFB } from "web-vitals";
4
+ import { onLCP, onCLS, onINP, onFCP, onTTFB } from "web-vitals";
5
5
  import { track } from "../track/index.mjs";
6
6
  import { mapFBEvent } from "../track/fbq.mjs";
7
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
8
  function useReportWebVitals(reportWebVitalsFn) {
9
9
  useEffect(() => {
10
10
  onCLS(reportWebVitalsFn);
11
- onFID(reportWebVitalsFn);
12
11
  onLCP(reportWebVitalsFn);
13
12
  onINP(reportWebVitalsFn);
14
13
  onFCP(reportWebVitalsFn);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/react-router/index.tsx"],"sourcesContent":["import { useEffect } from 'react';\nimport { useLocation, useSearchParams } from 'react-router';\nimport { onLCP, onFID, onCLS, onINP, onFCP, onTTFB, type Metric } from 'web-vitals';\nimport { track } from '../track/index';\nimport { mapFBEvent } from '../track/fbq';\nimport type { Gtag, GaId, GtmId } from '../track/gtag';\nimport type { Pixel, PixelId } from '../track/fbq';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\n\nfunction useReportWebVitals(reportWebVitalsFn: (metric: Metric) => void) {\n useEffect(() => {\n onCLS(reportWebVitalsFn);\n onFID(reportWebVitalsFn);\n onLCP(reportWebVitalsFn);\n onINP(reportWebVitalsFn);\n onFCP(reportWebVitalsFn);\n onTTFB(reportWebVitalsFn);\n }, [reportWebVitalsFn]);\n}\n\ndeclare global {\n interface Window extends Gtag, Pixel {}\n}\n\ninterface Props {\n gaId?: GaId;\n gtmId?: GtmId;\n pixelId?: PixelId;\n facebookAppId?: string;\n nonce?: string;\n debugMode?: boolean;\n}\n\nexport function sendGAEvent<T extends EventName>(\n name: TrackName<T>,\n properties?: TrackProperties<T>\n) {\n if (typeof window === 'undefined' || !window.gtag) {\n console.warn('gtag has not been initialized');\n return;\n }\n window.gtag('event', name, properties);\n}\n\nexport function sendFBEvent<T extends EventName>(\n name: TrackName<T>,\n properties?: TrackProperties<T>,\n event_id?: string\n) {\n if (typeof window === 'undefined' || !window.fbq) {\n console.warn('fbq has not been initialized');\n return;\n }\n const { fbq } = window;\n const options = { eventID: event_id };\n const [type, fbEventName, fbEventProperties] = mapFBEvent(name, properties);\n if (type === 'track') {\n fbq(type, fbEventName, fbEventProperties, options);\n } else {\n fbq(type, fbEventName, fbEventProperties, options);\n }\n}\n\nexport function Analytics({ gaId, nonce, debugMode, pixelId, facebookAppId }: Props) {\n const { pathname } = useLocation();\n const [params] = useSearchParams();\n\n useEffect(() => {\n const properties = {\n pathname,\n referrer: document.referrer,\n gclid: params.get('gclid'),\n fbclid: params.get('fbclid'),\n utm_source: params.get('utm_source'),\n utm_medium: params.get('utm_medium'),\n utm_campaign: params.get('utm_campaign'),\n utm_term: params.get('utm_term'),\n utm_content: params.get('utm_content'),\n };\n\n /**\n * Pixel:\n * Each time the Pixel loads, it automatically calls fbq('track', 'PageView') to track a\n * PageView standard event.\n */\n track('page_view', properties, { enableThirdPartyTracking: false });\n }, [pathname, params]);\n\n useReportWebVitals((metric) => {\n const properties = {\n id: metric.id,\n rating: metric.rating,\n value: metric.value,\n delta: metric.delta,\n navigation_type: metric.navigationType,\n non_interaction: true, // avoids affecting bounce rate.\n };\n track(metric.name, properties);\n });\n\n return (\n <>\n {facebookAppId && <meta property=\"fb:app_id\" content={facebookAppId} />}\n {gaId && (\n <>\n <script\n async\n id=\"gtag\"\n nonce={nonce}\n src={`https://www.googletagmanager.com/gtag/js?id=${gaId}`}\n />\n <script\n async\n nonce={nonce}\n id=\"gtag-init\"\n dangerouslySetInnerHTML={{\n __html: `\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '${gaId}'${debugMode ? \" ,{ 'debug_mode': true }\" : ''});\n `,\n }}\n />\n </>\n )}\n {pixelId && (\n <>\n <script\n id=\"pixel\"\n dangerouslySetInnerHTML={{\n __html: `\n !(function (f, b, e, v, n, t, s) {\n if (f.fbq) return;\n n = f.fbq = function () {\n n.callMethod ? n.callMethod.apply(n, arguments) : n.queue.push(arguments);\n };\n if (!f._fbq) f._fbq = n;\n n.push = n;\n n.loaded = !0;\n n.version = '2.0';\n n.queue = [];\n t = b.createElement(e);\n t.async = !0;\n t.src = v;\n s = b.getElementsByTagName(e)[0];\n s.parentNode.insertBefore(t, s);\n })(window, document, 'script', 'https://connect.facebook.net/en_US/fbevents.js');\n fbq('init', '${pixelId}');\n fbq('track', 'PageView');`,\n }}\n />\n </>\n )}\n </>\n );\n}\n"],"mappings":";AAAA,SAAS,iBAAiB;AAC1B,SAAS,aAAa,uBAAuB;AAC7C,SAAS,OAAO,OAAO,OAAO,OAAO,OAAO,cAA2B;AACvE,SAAS,aAAa;AACtB,SAAS,kBAAkB;AAkGH,SAEhB,UAFgB,KAEhB,YAFgB;AA7FxB,SAAS,mBAAmB,mBAA6C;AACvE,YAAU,MAAM;AACd,UAAM,iBAAiB;AACvB,UAAM,iBAAiB;AACvB,UAAM,iBAAiB;AACvB,UAAM,iBAAiB;AACvB,UAAM,iBAAiB;AACvB,WAAO,iBAAiB;AAAA,EAC1B,GAAG,CAAC,iBAAiB,CAAC;AACxB;AAeO,SAAS,YACd,MACA,YACA;AACA,MAAI,OAAO,WAAW,eAAe,CAAC,OAAO,MAAM;AACjD,YAAQ,KAAK,+BAA+B;AAC5C;AAAA,EACF;AACA,SAAO,KAAK,SAAS,MAAM,UAAU;AACvC;AAEO,SAAS,YACd,MACA,YACA,UACA;AACA,MAAI,OAAO,WAAW,eAAe,CAAC,OAAO,KAAK;AAChD,YAAQ,KAAK,8BAA8B;AAC3C;AAAA,EACF;AACA,QAAM,EAAE,IAAI,IAAI;AAChB,QAAM,UAAU,EAAE,SAAS,SAAS;AACpC,QAAM,CA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AC;AAAA;AAAA,UACC,OAAK;AAAA,UACL;AAAA,UACA,IAAG;AAAA,UACH,yBAAyB;AAAA,YACvB,QAAQ;AAAA;AAAA;AAAA;AAAA,gCAIU,IAAI,IAAI,YAAY,6BAA6B,EAAE;AAAA;AAAA,UAEvE;AAAA;AAAA,MACF;AAAA,OACF;AAAA,IAED,WACC,gCACE;AAAA,MAAC;AAAA;AAAA,QACC,IAAG;AAAA,QACH,yBAAyB;AAAA,UACvB,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAiBO,OAAO;AAAA;AAAA,QAExB;AAAA;AAAA,IACF,GACF;AAAA,KAEJ;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/react-router/index.tsx"],"sourcesContent":["import { useEffect } from 'react';\nimport { useLocation, useSearchParams } from 'react-router';\nimport { onLCP, onCLS, onINP, onFCP, onTTFB, type Metric } from 'web-vitals';\nimport { track } from '../track/index';\nimport { mapFBEvent } from '../track/fbq';\nimport type { Gtag, GaId, GtmId } from '../track/gtag';\nimport type { Pixel, PixelId } from '../track/fbq';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\n\nfunction useReportWebVitals(reportWebVitalsFn: (metric: Metric) => void) {\n useEffect(() => {\n onCLS(reportWebVitalsFn);\n onLCP(reportWebVitalsFn);\n onINP(reportWebVitalsFn);\n onFCP(reportWebVitalsFn);\n onTTFB(reportWebVitalsFn);\n }, [reportWebVitalsFn]);\n}\n\ndeclare global {\n interface Window extends Gtag, Pixel {}\n}\n\ninterface Props {\n gaId?: GaId;\n gtmId?: GtmId;\n pixelId?: PixelId;\n facebookAppId?: string;\n nonce?: string;\n debugMode?: boolean;\n}\n\nexport function sendGAEvent<T extends EventName>(\n name: TrackName<T>,\n properties?: TrackProperties<T>\n) {\n if (typeof window === 'undefined' || !window.gtag) {\n console.warn('gtag has not been initialized');\n return;\n }\n window.gtag('event', name, properties);\n}\n\nexport function sendFBEvent<T extends EventName>(\n name: TrackName<T>,\n properties?: TrackProperties<T>,\n event_id?: string\n) {\n if (typeof window === 'undefined' || !window.fbq) {\n console.warn('fbq has not been initialized');\n return;\n }\n const { fbq } = window;\n const options = { eventID: event_id };\n const [type, fbEventName, fbEventProperties] = mapFBEvent(name, properties);\n if (type === 'track') {\n fbq(type, fbEventName, fbEventProperties, options);\n } else {\n fbq(type, fbEventName, fbEventProperties, options);\n }\n}\n\nexport function Analytics({ gaId, nonce, debugMode, pixelId, facebookAppId }: Props) {\n const { pathname } = useLocation();\n const [params] = useSearchParams();\n\n useEffect(() => {\n const properties = {\n pathname,\n referrer: document.referrer,\n gclid: params.get('gclid'),\n fbclid: params.get('fbclid'),\n utm_source: params.get('utm_source'),\n utm_medium: params.get('utm_medium'),\n utm_campaign: params.get('utm_campaign'),\n utm_term: params.get('utm_term'),\n utm_content: params.get('utm_content'),\n };\n\n /**\n * Pixel:\n * Each time the Pixel loads, it automatically calls fbq('track', 'PageView') to track a\n * PageView standard event.\n */\n track('page_view', properties, { enableThirdPartyTracking: false });\n }, [pathname, params]);\n\n useReportWebVitals((metric) => {\n const properties = {\n id: metric.id,\n rating: metric.rating,\n value: metric.value,\n delta: metric.delta,\n navigation_type: metric.navigationType,\n non_interaction: true, // avoids affecting bounce rate.\n };\n track(metric.name, properties);\n });\n\n return (\n <>\n {facebookAppId && <meta property=\"fb:app_id\" content={facebookAppId} />}\n {gaId && (\n <>\n <script\n async\n id=\"gtag\"\n nonce={nonce}\n src={`https://www.googletagmanager.com/gtag/js?id=${gaId}`}\n />\n <script\n async\n nonce={nonce}\n id=\"gtag-init\"\n dangerouslySetInnerHTML={{\n __html: `\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '${gaId}'${debugMode ? \" ,{ 'debug_mode': true }\" : ''});\n `,\n }}\n />\n </>\n )}\n {pixelId && (\n <>\n <script\n id=\"pixel\"\n dangerouslySetInnerHTML={{\n __html: `\n !(function (f, b, e, v, n, t, s) {\n if (f.fbq) return;\n n = f.fbq = function () {\n n.callMethod ? n.callMethod.apply(n, arguments) : n.queue.push(arguments);\n };\n if (!f._fbq) f._fbq = n;\n n.push = n;\n n.loaded = !0;\n n.version = '2.0';\n n.queue = [];\n t = b.createElement(e);\n t.async = !0;\n t.src = v;\n s = b.getElementsByTagName(e)[0];\n s.parentNode.insertBefore(t, s);\n })(window, document, 'script', 'https://connect.facebook.net/en_US/fbevents.js');\n fbq('init', '${pixelId}');\n fbq('track', 'PageView');`,\n }}\n />\n </>\n )}\n </>\n );\n}\n"],"mappings":";AAAA,SAAS,iBAAiB;AAC1B,SAAS,aAAa,uBAAuB;AAC7C,SAAS,OAAO,OAAO,OAAO,OAAO,cAA2B;AAChE,SAAS,aAAa;AACtB,SAAS,kBAAkB;AAiGH,SAEhB,UAFgB,KAEhB,YAFgB;AA5FxB,SAAS,mBAAmB,mBAA6C;AACvE,YAAU,MAAM;AACd,UAAM,iBAAiB;AACvB,UAAM,iBAAiB;AACvB,UAAM,iBAAiB;AACvB,UAAM,iBAAiB;AACvB,WAAO,iBAAiB;AAAA,EAC1B,GAAG,CAAC,iBAAiB,CAAC;AACxB;AAeO,SAAS,YACd,MACA,YACA;AACA,MAAI,OAAO,WAAW,eAAe,CAAC,OAAO,MAAM;AACjD,YAAQ,KAAK,+BAA+B;AAC5C;AAAA,EACF;AACA,SAAO,KAAK,SAAS,MAAM,UAAU;AACvC;AAEO,SAAS,YACd,MACA,YACA,UACA;AACA,MAAI,OAAO,WAAW,eAAe,CAAC,OAAO,KAAK;AAChD,YAAQ,KAAK,8BAA8B;AAC3C;AAAA,EACF;AACA,QAAM,EAAE,IAAI,IAAI;AAChB,QAAM,UAAU,EAAE,SAAS,SAAS;AACpC,QAAM,CAAC,MAAM,aAAa,iBAAiB,IAAI,WAAW,MAAM,UAAU;AAC1E,MAAI,SAAS,SAAS;AACpB,QAAI,MAAM,aAAa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A;AAAA;AAAA;AAAA,gCAIU,IAAI,IAAI,YAAY,6BAA6B,EAAE;AAAA;AAAA,UAEvE;AAAA;AAAA,MACF;AAAA,OACF;AAAA,IAED,WACC,gCACE;AAAA,MAAC;AAAA;AAAA,QACC,IAAG;AAAA,QACH,yBAAyB;AAAA,UACvB,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAiBO,OAAO;AAAA;AAAA,QAExB;AAAA;AAAA,IACF,GACF;AAAA,KAEJ;AAEJ;","names":[]}
@@ -25,63 +25,63 @@ __export(schema_exports, {
25
25
  updateVisitorSchema: () => updateVisitorSchema
26
26
  });
27
27
  module.exports = __toCommonJS(schema_exports);
28
- var import_zod = require("zod");
29
- var items = import_zod.z.array(
30
- import_zod.z.record(
31
- import_zod.z.string().trim().min(1).max(128),
32
- import_zod.z.union([import_zod.z.string().max(512), import_zod.z.number(), import_zod.z.boolean(), import_zod.z.null()])
28
+ var import_v4 = require("zod/v4");
29
+ var items = import_v4.z.array(
30
+ import_v4.z.record(
31
+ import_v4.z.string().trim().min(1).max(128),
32
+ import_v4.z.union([import_v4.z.string().max(512), import_v4.z.number(), import_v4.z.boolean(), import_v4.z.null()])
33
33
  )
34
34
  );
35
- var createTrackEventSchema = import_zod.z.object({
36
- name: import_zod.z.string().trim().min(1).max(64),
37
- visitor_id: import_zod.z.coerce.bigint(),
38
- timestamp: import_zod.z.string().datetime(),
39
- tags: import_zod.z.object({
40
- os: import_zod.z.string().optional(),
41
- os_name: import_zod.z.string().optional(),
42
- os_version: import_zod.z.string().optional(),
43
- browser: import_zod.z.string().optional(),
44
- browser_name: import_zod.z.string().optional(),
45
- browser_version: import_zod.z.string().optional(),
46
- platform: import_zod.z.enum(["ios", "android", "web", "macos", "windows", "linux", "unknown"]).optional(),
47
- device: import_zod.z.string().optional(),
48
- device_id: import_zod.z.string().trim().min(1).max(36).optional(),
49
- device_type: import_zod.z.string().optional(),
50
- device_vendor: import_zod.z.string().optional(),
51
- device_pixel_ratio: import_zod.z.string().optional(),
52
- screen_resolution: import_zod.z.string().regex(/^\d+x\d+$/).transform((v) => v).optional(),
53
- release: import_zod.z.string().optional(),
54
- language: import_zod.z.string().optional(),
55
- time_zone: import_zod.z.string().optional(),
56
- environment: import_zod.z.enum(["development", "production"]).optional(),
57
- source_url: import_zod.z.string().optional(),
58
- source: import_zod.z.enum(["web", "app", "offline"]).optional(),
59
- fbc: import_zod.z.string().optional(),
60
- fbp: import_zod.z.string().optional(),
61
- gclid: import_zod.z.string().optional(),
62
- advertising_id: import_zod.z.string().optional(),
63
- utm_source: import_zod.z.string().optional(),
64
- utm_medium: import_zod.z.string().optional(),
65
- utm_campaign: import_zod.z.string().optional(),
66
- utm_term: import_zod.z.string().optional(),
67
- utm_content: import_zod.z.string().optional()
35
+ var createTrackEventSchema = import_v4.z.object({
36
+ name: import_v4.z.string().trim().min(1).max(64),
37
+ visitor_id: import_v4.z.coerce.bigint(),
38
+ timestamp: import_v4.z.string().datetime(),
39
+ tags: import_v4.z.object({
40
+ os: import_v4.z.string().optional(),
41
+ os_name: import_v4.z.string().optional(),
42
+ os_version: import_v4.z.string().optional(),
43
+ browser: import_v4.z.string().optional(),
44
+ browser_name: import_v4.z.string().optional(),
45
+ browser_version: import_v4.z.string().optional(),
46
+ platform: import_v4.z.enum(["ios", "android", "web", "macos", "windows", "linux", "unknown"]).optional(),
47
+ device: import_v4.z.string().optional(),
48
+ device_id: import_v4.z.string().trim().min(1).max(36).optional(),
49
+ device_type: import_v4.z.string().optional(),
50
+ device_vendor: import_v4.z.string().optional(),
51
+ device_pixel_ratio: import_v4.z.string().optional(),
52
+ screen_resolution: import_v4.z.string().regex(/^\d+x\d+$/).transform((v) => v).optional(),
53
+ release: import_v4.z.string().optional(),
54
+ language: import_v4.z.string().optional(),
55
+ time_zone: import_v4.z.string().optional(),
56
+ environment: import_v4.z.enum(["development", "production"]).optional(),
57
+ source_url: import_v4.z.string().optional(),
58
+ source: import_v4.z.enum(["web", "app", "offline"]).optional(),
59
+ fbc: import_v4.z.string().optional(),
60
+ fbp: import_v4.z.string().optional(),
61
+ gclid: import_v4.z.string().optional(),
62
+ advertising_id: import_v4.z.string().optional(),
63
+ utm_source: import_v4.z.string().optional(),
64
+ utm_medium: import_v4.z.string().optional(),
65
+ utm_campaign: import_v4.z.string().optional(),
66
+ utm_term: import_v4.z.string().optional(),
67
+ utm_content: import_v4.z.string().optional()
68
68
  }),
69
- properties: import_zod.z.record(
70
- import_zod.z.string().trim().min(1).max(128),
71
- import_zod.z.union([import_zod.z.string().max(512), import_zod.z.number(), import_zod.z.boolean(), import_zod.z.null(), items])
69
+ properties: import_v4.z.record(
70
+ import_v4.z.string().trim().min(1).max(128),
71
+ import_v4.z.union([import_v4.z.string().max(512), import_v4.z.number(), import_v4.z.boolean(), import_v4.z.null(), items])
72
72
  ).refine((data) => Object.keys(data).length <= 64).optional()
73
73
  }).array().min(1).max(100);
74
- var createVisitorSchema = import_zod.z.object({
75
- device_id: import_zod.z.string().trim().min(1).max(36),
76
- properties: import_zod.z.record(
77
- import_zod.z.string().trim().min(1).max(128),
78
- import_zod.z.union([import_zod.z.string().max(512), import_zod.z.number(), import_zod.z.boolean(), import_zod.z.null()])
74
+ var createVisitorSchema = import_v4.z.object({
75
+ device_id: import_v4.z.string().trim().min(1).max(36),
76
+ properties: import_v4.z.record(
77
+ import_v4.z.string().trim().min(1).max(128),
78
+ import_v4.z.union([import_v4.z.string().max(512), import_v4.z.number(), import_v4.z.boolean(), import_v4.z.null()])
79
79
  ).refine((data) => Object.keys(data).length <= 64).optional()
80
80
  });
81
- var updateVisitorSchema = import_zod.z.object({
82
- properties: import_zod.z.record(
83
- import_zod.z.string().trim().min(1).max(128),
84
- import_zod.z.union([import_zod.z.string().max(512), import_zod.z.number(), import_zod.z.boolean(), import_zod.z.null()])
81
+ var updateVisitorSchema = import_v4.z.object({
82
+ properties: import_v4.z.record(
83
+ import_v4.z.string().trim().min(1).max(128),
84
+ import_v4.z.union([import_v4.z.string().max(512), import_v4.z.number(), import_v4.z.boolean(), import_v4.z.null()])
85
85
  ).refine((data) => Object.keys(data).length <= 64)
86
86
  });
87
87
  // Annotate the CommonJS export names for ESM import in node:
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/schema/index.ts"],"sourcesContent":["import { z } from 'zod';\n\nconst items = z.array(\n z.record(\n z.string().trim().min(1).max(128),\n z.union([z.string().max(512), z.number(), z.boolean(), z.null()])\n )\n);\n\nexport const createTrackEventSchema = z\n .object({\n name: z.string().trim().min(1).max(64),\n visitor_id: z.coerce.bigint(),\n timestamp: z.string().datetime(),\n tags: z.object({\n os: z.string().optional(),\n os_name: z.string().optional(),\n os_version: z.string().optional(),\n browser: z.string().optional(),\n browser_name: z.string().optional(),\n browser_version: z.string().optional(),\n platform: z\n .enum(['ios', 'android', 'web', 'macos', 'windows', 'linux', 'unknown'])\n .optional(),\n device: z.string().optional(),\n device_id: z.string().trim().min(1).max(36).optional(),\n device_type: z.string().optional(),\n device_vendor: z.string().optional(),\n device_pixel_ratio: z.string().optional(),\n screen_resolution: z\n .string()\n .regex(/^\\d+x\\d+$/)\n .transform((v) => v as `${number}x${number}`)\n .optional(),\n release: z.string().optional(),\n language: z.string().optional(),\n time_zone: z.string().optional(),\n environment: z.enum(['development', 'production']).optional(),\n source_url: z.string().optional(),\n source: z.enum(['web', 'app', 'offline']).optional(),\n fbc: z.string().optional(),\n fbp: z.string().optional(),\n gclid: z.string().optional(),\n advertising_id: z.string().optional(),\n utm_source: z.string().optional(),\n utm_medium: z.string().optional(),\n utm_campaign: z.string().optional(),\n utm_term: z.string().optional(),\n utm_content: z.string().optional(),\n }),\n properties: z\n .record(\n z.string().trim().min(1).max(128),\n z.union([z.string().max(512), z.number(), z.boolean(), z.null(), items])\n )\n .refine((data) => Object.keys(data).length <= 64)\n .optional(),\n })\n .array()\n .min(1)\n .max(100);\n\nexport const createVisitorSchema = z.object({\n device_id: z.string().trim().min(1).max(36),\n properties: z\n .record(\n z.string().trim().min(1).max(128),\n z.union([z.string().max(512), z.number(), z.boolean(), z.null()])\n )\n .refine((data) => Object.keys(data).length <= 64)\n .optional(),\n});\n\nexport const updateVisitorSchema = z.object({\n properties: z\n .record(\n z.string().trim().min(1).max(128),\n z.union([z.string().max(512), z.number(), z.boolean(), z.null()])\n )\n .refine((data) => Object.keys(data).length <= 64),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAkB;AAElB,IAAM,QAAQ,aAAE;AAAA,EACd,aAAE;AAAA,IACA,aAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,IAChC,aAAE,MAAM,CAAC,aAAE,OAAO,EAAE,IAAI,GAAG,GAAG,aAAE,OAAO,GAAG,aAAE,QAAQ,GAAG,aAAE,KAAK,CAAC,CAAC;AAAA,EAClE;AACF;AAEO,IAAM,yBAAyB,aACnC,OAAO;AAAA,EACN,MAAM,aAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE;AAAA,EACrC,YAAY,aAAE,OAAO,OAAO;AAAA,EAC5B,WAAW,aAAE,OAAO,EAAE,SAAS;AAAA,EAC/B,MAAM,aAAE,OAAO;AAAA,IACb,IAAI,aAAE,OAAO,EAAE,SAAS;AAAA,IACxB,SAAS,aAAE,OAAO,EAAE,SAAS;AAAA,IAC7B,YAAY,aAAE,OAAO,EAAE,SAAS;AAAA,IAChC,SAAS,aAAE,OAAO,EAAE,SAAS;AAAA,IAC7B,cAAc,aAAE,OAAO,EAAE,SAAS;AAAA,IAClC,iBAAiB,aAAE,OAAO,EAAE,SAAS;AAAA,IACrC,UAAU,aACP,KAAK,CAAC,OAAO,WAAW,OAAO,SAAS,WAAW,SAAS,SAAS,CAAC,EACtE,SAAS;AAAA,IACZ,QAAQ,aAAE,OAAO,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AAG,aAAE,KAAK,GAAG,KAAK,CAAC;AAAA,EACzE,EACC,OAAO,CAAC,SAAS,OAAO,KAAK,IAAI,EAAE,UAAU,EAAE,EAC/C,SAAS;AACd,CAAC,EACA,MAAM,EACN,IAAI,CAAC,EACL,IAAI,GAAG;AAEH,IAAM,sBAAsB,aAAE,OAAO;AAAA,EAC1C,WAAW,aAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE;AAAA,EAC1C,YAAY,aACT;AAAA,IACC,aAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,IAChC,aAAE,MAAM,CAAC,aAAE,OAAO,EAAE,IAAI,GAAG,GAAG,aAAE,OAAO,GAAG,aAAE,QAAQ,GAAG,aAAE,KAAK,CAAC,CAAC;AAAA,EAClE,EACC,OAAO,CAAC,SAAS,OAAO,KAAK,IAAI,EAAE,UAAU,EAAE,EAC/C,SAAS;AACd,CAAC;AAEM,IAAM,sBAAsB,aAAE,OAAO;AAAA,EAC1C,YAAY,aACT;AAAA,IACC,aAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,IAChC,aAAE,MAAM,CAAC,aAAE,OAAO,EAAE,IAAI,GAAG,GAAG,aAAE,OAAO,GAAG,aAAE,QAAQ,GAAG,aAAE,KAAK,CAAC,CAAC;AAAA,EAClE,EACC,OAAO,CAAC,SAAS,OAAO,KAAK,IAAI,EAAE,UAAU,EAAE;AACpD,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../src/schema/index.ts"],"sourcesContent":["import { z } from 'zod/v4';\n\nconst items = z.array(\n z.record(\n z.string().trim().min(1).max(128),\n z.union([z.string().max(512), z.number(), z.boolean(), z.null()])\n )\n);\n\nexport const createTrackEventSchema = z\n .object({\n name: z.string().trim().min(1).max(64),\n visitor_id: z.coerce.bigint(),\n timestamp: z.string().datetime(),\n tags: z.object({\n os: z.string().optional(),\n os_name: z.string().optional(),\n os_version: z.string().optional(),\n browser: z.string().optional(),\n browser_name: z.string().optional(),\n browser_version: z.string().optional(),\n platform: z\n .enum(['ios', 'android', 'web', 'macos', 'windows', 'linux', 'unknown'])\n .optional(),\n device: z.string().optional(),\n device_id: z.string().trim().min(1).max(36).optional(),\n device_type: z.string().optional(),\n device_vendor: z.string().optional(),\n device_pixel_ratio: z.string().optional(),\n screen_resolution: z\n .string()\n .regex(/^\\d+x\\d+$/)\n .transform((v) => v as `${number}x${number}`)\n .optional(),\n release: z.string().optional(),\n language: z.string().optional(),\n time_zone: z.string().optional(),\n environment: z.enum(['development', 'production']).optional(),\n source_url: z.string().optional(),\n source: z.enum(['web', 'app', 'offline']).optional(),\n fbc: z.string().optional(),\n fbp: z.string().optional(),\n gclid: z.string().optional(),\n advertising_id: z.string().optional(),\n utm_source: z.string().optional(),\n utm_medium: z.string().optional(),\n utm_campaign: z.string().optional(),\n utm_term: z.string().optional(),\n utm_content: z.string().optional(),\n }),\n properties: z\n .record(\n z.string().trim().min(1).max(128),\n z.union([z.string().max(512), z.number(), z.boolean(), z.null(), items])\n )\n .refine((data) => Object.keys(data).length <= 64)\n .optional(),\n })\n .array()\n .min(1)\n .max(100);\n\nexport const createVisitorSchema = z.object({\n device_id: z.string().trim().min(1).max(36),\n properties: z\n .record(\n z.string().trim().min(1).max(128),\n z.union([z.string().max(512), z.number(), z.boolean(), z.null()])\n )\n .refine((data) => Object.keys(data).length <= 64)\n .optional(),\n});\n\nexport const updateVisitorSchema = z.object({\n properties: z\n .record(\n z.string().trim().min(1).max(128),\n z.union([z.string().max(512), z.number(), z.boolean(), z.null()])\n )\n .refine((data) => Object.keys(data).length <= 64),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAkB;AAElB,IAAM,QAAQ,YAAE;AAAA,EACd,YAAE;AAAA,IACA,YAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IA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Q,GAAG,YAAE,KAAK,CAAC,CAAC;AAAA,EAClE,EACC,OAAO,CAAC,SAAS,OAAO,KAAK,IAAI,EAAE,UAAU,EAAE,EAC/C,SAAS;AACd,CAAC;AAEM,IAAM,sBAAsB,YAAE,OAAO;AAAA,EAC1C,YAAY,YACT;AAAA,IACC,YAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,IAChC,YAAE,MAAM,CAAC,YAAE,OAAO,EAAE,IAAI,GAAG,GAAG,YAAE,OAAO,GAAG,YAAE,QAAQ,GAAG,YAAE,KAAK,CAAC,CAAC;AAAA,EAClE,EACC,OAAO,CAAC,SAAS,OAAO,KAAK,IAAI,EAAE,UAAU,EAAE;AACpD,CAAC;","names":[]}
@@ -1,8 +1,8 @@
1
- import { z } from 'zod';
1
+ import { z } from 'zod/v4';
2
2
 
3
3
  declare const createTrackEventSchema: z.ZodArray<z.ZodObject<{
4
4
  name: z.ZodString;
5
- visitor_id: z.ZodBigInt;
5
+ visitor_id: z.ZodCoercedBigInt<unknown>;
6
6
  timestamp: z.ZodString;
7
7
  tags: z.ZodObject<{
8
8
  os: z.ZodOptional<z.ZodString>;
@@ -11,19 +11,34 @@ declare const createTrackEventSchema: z.ZodArray<z.ZodObject<{
11
11
  browser: z.ZodOptional<z.ZodString>;
12
12
  browser_name: z.ZodOptional<z.ZodString>;
13
13
  browser_version: z.ZodOptional<z.ZodString>;
14
- platform: z.ZodOptional<z.ZodEnum<["ios", "android", "web", "macos", "windows", "linux", "unknown"]>>;
14
+ platform: z.ZodOptional<z.ZodEnum<{
15
+ ios: "ios";
16
+ android: "android";
17
+ web: "web";
18
+ macos: "macos";
19
+ windows: "windows";
20
+ linux: "linux";
21
+ unknown: "unknown";
22
+ }>>;
15
23
  device: z.ZodOptional<z.ZodString>;
16
24
  device_id: z.ZodOptional<z.ZodString>;
17
25
  device_type: z.ZodOptional<z.ZodString>;
18
26
  device_vendor: z.ZodOptional<z.ZodString>;
19
27
  device_pixel_ratio: z.ZodOptional<z.ZodString>;
20
- screen_resolution: z.ZodOptional<z.ZodEffects<z.ZodString, `${number}x${number}`, string>>;
28
+ screen_resolution: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`${number}x${number}`, string>>>;
21
29
  release: z.ZodOptional<z.ZodString>;
22
30
  language: z.ZodOptional<z.ZodString>;
23
31
  time_zone: z.ZodOptional<z.ZodString>;
24
- environment: z.ZodOptional<z.ZodEnum<["development", "production"]>>;
32
+ environment: z.ZodOptional<z.ZodEnum<{
33
+ development: "development";
34
+ production: "production";
35
+ }>>;
25
36
  source_url: z.ZodOptional<z.ZodString>;
26
- source: z.ZodOptional<z.ZodEnum<["web", "app", "offline"]>>;
37
+ source: z.ZodOptional<z.ZodEnum<{
38
+ web: "web";
39
+ app: "app";
40
+ offline: "offline";
41
+ }>>;
27
42
  fbc: z.ZodOptional<z.ZodString>;
28
43
  fbp: z.ZodOptional<z.ZodString>;
29
44
  gclid: z.ZodOptional<z.ZodString>;
@@ -33,153 +48,15 @@ declare const createTrackEventSchema: z.ZodArray<z.ZodObject<{
33
48
  utm_campaign: z.ZodOptional<z.ZodString>;
34
49
  utm_term: z.ZodOptional<z.ZodString>;
35
50
  utm_content: z.ZodOptional<z.ZodString>;
36
- }, "strip", z.ZodTypeAny, {
37
- os?: string | undefined;
38
- os_name?: string | undefined;
39
- os_version?: string | undefined;
40
- browser?: string | undefined;
41
- browser_name?: string | undefined;
42
- browser_version?: string | undefined;
43
- platform?: "unknown" | "ios" | "android" | "web" | "macos" | "windows" | "linux" | undefined;
44
- device?: string | undefined;
45
- device_id?: string | undefined;
46
- device_type?: string | undefined;
47
- device_vendor?: string | undefined;
48
- device_pixel_ratio?: string | undefined;
49
- screen_resolution?: `${number}x${number}` | undefined;
50
- release?: string | undefined;
51
- language?: string | undefined;
52
- time_zone?: string | undefined;
53
- environment?: "development" | "production" | undefined;
54
- source_url?: string | undefined;
55
- source?: "web" | "app" | "offline" | undefined;
56
- fbc?: string | undefined;
57
- fbp?: string | undefined;
58
- gclid?: string | undefined;
59
- advertising_id?: string | undefined;
60
- utm_source?: string | undefined;
61
- utm_medium?: string | undefined;
62
- utm_campaign?: string | undefined;
63
- utm_term?: string | undefined;
64
- utm_content?: string | undefined;
65
- }, {
66
- os?: string | undefined;
67
- os_name?: string | undefined;
68
- os_version?: string | undefined;
69
- browser?: string | undefined;
70
- browser_name?: string | undefined;
71
- browser_version?: string | undefined;
72
- platform?: "unknown" | "ios" | "android" | "web" | "macos" | "windows" | "linux" | undefined;
73
- device?: string | undefined;
74
- device_id?: string | undefined;
75
- device_type?: string | undefined;
76
- device_vendor?: string | undefined;
77
- device_pixel_ratio?: string | undefined;
78
- screen_resolution?: string | undefined;
79
- release?: string | undefined;
80
- language?: string | undefined;
81
- time_zone?: string | undefined;
82
- environment?: "development" | "production" | undefined;
83
- source_url?: string | undefined;
84
- source?: "web" | "app" | "offline" | undefined;
85
- fbc?: string | undefined;
86
- fbp?: string | undefined;
87
- gclid?: string | undefined;
88
- advertising_id?: string | undefined;
89
- utm_source?: string | undefined;
90
- utm_medium?: string | undefined;
91
- utm_campaign?: string | undefined;
92
- utm_term?: string | undefined;
93
- utm_content?: string | undefined;
94
- }>;
95
- properties: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, "many">]>>, Record<string, string | number | boolean | Record<string, string | number | boolean | null>[] | null>, Record<string, string | number | boolean | Record<string, string | number | boolean | null>[] | null>>>;
96
- }, "strip", z.ZodTypeAny, {
97
- name: string;
98
- visitor_id: bigint;
99
- timestamp: string;
100
- tags: {
101
- os?: string | undefined;
102
- os_name?: string | undefined;
103
- os_version?: string | undefined;
104
- browser?: string | undefined;
105
- browser_name?: string | undefined;
106
- browser_version?: string | undefined;
107
- platform?: "unknown" | "ios" | "android" | "web" | "macos" | "windows" | "linux" | undefined;
108
- device?: string | undefined;
109
- device_id?: string | undefined;
110
- device_type?: string | undefined;
111
- device_vendor?: string | undefined;
112
- device_pixel_ratio?: string | undefined;
113
- screen_resolution?: `${number}x${number}` | undefined;
114
- release?: string | undefined;
115
- language?: string | undefined;
116
- time_zone?: string | undefined;
117
- environment?: "development" | "production" | undefined;
118
- source_url?: string | undefined;
119
- source?: "web" | "app" | "offline" | undefined;
120
- fbc?: string | undefined;
121
- fbp?: string | undefined;
122
- gclid?: string | undefined;
123
- advertising_id?: string | undefined;
124
- utm_source?: string | undefined;
125
- utm_medium?: string | undefined;
126
- utm_campaign?: string | undefined;
127
- utm_term?: string | undefined;
128
- utm_content?: string | undefined;
129
- };
130
- properties?: Record<string, string | number | boolean | Record<string, string | number | boolean | null>[] | null> | undefined;
131
- }, {
132
- name: string;
133
- visitor_id: bigint;
134
- timestamp: string;
135
- tags: {
136
- os?: string | undefined;
137
- os_name?: string | undefined;
138
- os_version?: string | undefined;
139
- browser?: string | undefined;
140
- browser_name?: string | undefined;
141
- browser_version?: string | undefined;
142
- platform?: "unknown" | "ios" | "android" | "web" | "macos" | "windows" | "linux" | undefined;
143
- device?: string | undefined;
144
- device_id?: string | undefined;
145
- device_type?: string | undefined;
146
- device_vendor?: string | undefined;
147
- device_pixel_ratio?: string | undefined;
148
- screen_resolution?: string | undefined;
149
- release?: string | undefined;
150
- language?: string | undefined;
151
- time_zone?: string | undefined;
152
- environment?: "development" | "production" | undefined;
153
- source_url?: string | undefined;
154
- source?: "web" | "app" | "offline" | undefined;
155
- fbc?: string | undefined;
156
- fbp?: string | undefined;
157
- gclid?: string | undefined;
158
- advertising_id?: string | undefined;
159
- utm_source?: string | undefined;
160
- utm_medium?: string | undefined;
161
- utm_campaign?: string | undefined;
162
- utm_term?: string | undefined;
163
- utm_content?: string | undefined;
164
- };
165
- properties?: Record<string, string | number | boolean | Record<string, string | number | boolean | null>[] | null> | undefined;
166
- }>, "many">;
51
+ }, z.core.$strip>;
52
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>]>>>;
53
+ }, z.core.$strip>>;
167
54
  declare const createVisitorSchema: z.ZodObject<{
168
55
  device_id: z.ZodString;
169
- properties: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, Record<string, string | number | boolean | null>, Record<string, string | number | boolean | null>>>;
170
- }, "strip", z.ZodTypeAny, {
171
- device_id: string;
172
- properties?: Record<string, string | number | boolean | null> | undefined;
173
- }, {
174
- device_id: string;
175
- properties?: Record<string, string | number | boolean | null> | undefined;
176
- }>;
56
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
57
+ }, z.core.$strip>;
177
58
  declare const updateVisitorSchema: z.ZodObject<{
178
- properties: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, Record<string, string | number | boolean | null>, Record<string, string | number | boolean | null>>;
179
- }, "strip", z.ZodTypeAny, {
180
- properties: Record<string, string | number | boolean | null>;
181
- }, {
182
- properties: Record<string, string | number | boolean | null>;
183
- }>;
59
+ properties: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
60
+ }, z.core.$strip>;
184
61
 
185
62
  export { createTrackEventSchema, createVisitorSchema, updateVisitorSchema };