@shware/analytics 2.2.0 → 2.2.2
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/dist/next/index.cjs +2 -21
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.mjs +2 -21
- package/dist/next/index.mjs.map +1 -1
- package/dist/react-router/index.cjs +2 -20
- package/dist/react-router/index.cjs.map +1 -1
- package/dist/react-router/index.mjs +2 -20
- package/dist/react-router/index.mjs.map +1 -1
- package/dist/schema/index.cjs +10 -6
- package/dist/schema/index.cjs.map +1 -1
- package/dist/schema/index.d.cts +8 -8
- package/dist/schema/index.d.ts +8 -8
- package/dist/schema/index.mjs +10 -6
- package/dist/schema/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/next/index.cjs
CHANGED
|
@@ -40,7 +40,6 @@ var import_navigation = require("next/navigation");
|
|
|
40
40
|
var import_script = __toESM(require("next/script"), 1);
|
|
41
41
|
var import_web_vitals = require("next/web-vitals");
|
|
42
42
|
var import_react = require("react");
|
|
43
|
-
var import_link = require("../link/index.cjs");
|
|
44
43
|
var import_fbq = require("../track/fbq.cjs");
|
|
45
44
|
var import_track = require("../track/index.cjs");
|
|
46
45
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -76,26 +75,8 @@ function Analytics({
|
|
|
76
75
|
}) {
|
|
77
76
|
const pathname = (0, import_navigation.usePathname)();
|
|
78
77
|
(0, import_react.useEffect)(() => {
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
let link = null;
|
|
82
|
-
if (params.has("s")) link = await (0, import_link.getLink)(params.get("s"));
|
|
83
|
-
const properties = {
|
|
84
|
-
pathname,
|
|
85
|
-
referrer: document.referrer,
|
|
86
|
-
fbclid: params.get("fbclid"),
|
|
87
|
-
gclid: params.get("gclid"),
|
|
88
|
-
gad_source: params.get("gad_source"),
|
|
89
|
-
gad_campaignid: params.get("gad_campaignid"),
|
|
90
|
-
utm_source: (link == null ? void 0 : link.utm_source) ?? params.get("utm_source"),
|
|
91
|
-
utm_medium: (link == null ? void 0 : link.utm_medium) ?? params.get("utm_medium"),
|
|
92
|
-
utm_campaign: (link == null ? void 0 : link.utm_campaign) ?? params.get("utm_campaign"),
|
|
93
|
-
utm_term: (link == null ? void 0 : link.utm_term) ?? params.get("utm_term"),
|
|
94
|
-
utm_content: (link == null ? void 0 : link.utm_content) ?? params.get("utm_content")
|
|
95
|
-
};
|
|
96
|
-
(0, import_track.track)("page_view", properties, { enableThirdPartyTracking: false });
|
|
97
|
-
};
|
|
98
|
-
trackUTM();
|
|
78
|
+
const properties = { pathname, referrer: document.referrer };
|
|
79
|
+
(0, import_track.track)("page_view", properties, { enableThirdPartyTracking: false });
|
|
99
80
|
}, [pathname]);
|
|
100
81
|
(0, import_web_vitals.useReportWebVitals)((metric) => {
|
|
101
82
|
if (!reportWebVitals) return;
|
package/dist/next/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/next/index.tsx"],"sourcesContent":["'use client';\n\nimport { usePathname } from 'next/navigation';\nimport Script from 'next/script';\nimport { useReportWebVitals } from 'next/web-vitals';\nimport { useEffect } from 'react';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/next/index.tsx"],"sourcesContent":["'use client';\n\nimport { usePathname } from 'next/navigation';\nimport Script from 'next/script';\nimport { useReportWebVitals } from 'next/web-vitals';\nimport { useEffect } from 'react';\nimport { mapFBEvent } from '../track/fbq';\nimport { track } from '../track/index';\nimport type { Pixel, PixelId } from '../track/fbq';\nimport type { Gtag, GaId, GtmId } from '../track/gtag';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\n\ntype HotjarId = `${number}`;\n\ndeclare global {\n interface Window extends Gtag, Pixel {}\n}\n\ninterface Props {\n gaId?: GaId;\n gtmId?: GtmId;\n pixelId?: PixelId;\n hotjarId?: HotjarId;\n facebookAppId?: string;\n nonce?: string;\n debugMode?: boolean;\n reportWebVitals?: boolean;\n}\n\nexport function sendGAEvent<T extends EventName>(\n name: TrackName<T>,\n properties?: TrackProperties<T>\n) {\n if (!window.gtag) {\n console.warn('GA 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({\n gaId,\n nonce,\n debugMode,\n pixelId,\n hotjarId,\n facebookAppId,\n reportWebVitals = true,\n}: Props) {\n const pathname = usePathname();\n\n useEffect(() => {\n const properties = { pathname, referrer: document.referrer };\n track('page_view', properties, { enableThirdPartyTracking: false });\n }, [pathname]);\n\n useReportWebVitals((metric) => {\n if (!reportWebVitals) return;\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 id=\"gtag\"\n nonce={nonce}\n src={`https://www.googletagmanager.com/gtag/js?id=${gaId}`}\n />\n <Script\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 <Script\n id=\"pixel\"\n strategy=\"afterInteractive\"\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 {hotjarId && (\n <Script\n id=\"hotjar\"\n strategy=\"afterInteractive\"\n dangerouslySetInnerHTML={{\n __html: `\n (function(h,o,t,j,a,r){\n h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};\n h._hjSettings={hjid:${hotjarId},hjsv:6};\n a=o.getElementsByTagName('head')[0];\n r=o.createElement('script');r.async=1;\n r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;\n a.appendChild(r);\n })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');\n `,\n }}\n />\n )}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,wBAA4B;AAC5B,oBAAmB;AACnB,wBAAmC;AACnC,mBAA0B;AAC1B,iBAA2B;AAC3B,mBAAsB;AAmFE;AA7DjB,SAAS,YACd,MACA,YACA;AACA,MAAI,CAAC,OAAO,MAAM;AAChB,YAAQ,KAAK,6BAA6B;AAC1C;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,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AA,QACT,yBAAyB;AAAA,UACvB,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAiBO,OAAO;AAAA;AAAA,QAExB;AAAA;AAAA,IACF;AAAA,IAED,YACC;AAAA,MAAC,cAAAA;AAAA,MAAA;AAAA,QACC,IAAG;AAAA,QACH,UAAS;AAAA,QACT,yBAAyB;AAAA,UACvB,QAAQ;AAAA;AAAA;AAAA,oCAGgB,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAOlC;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ;","names":["Script"]}
|
package/dist/next/index.mjs
CHANGED
|
@@ -5,7 +5,6 @@ import { usePathname } from "next/navigation";
|
|
|
5
5
|
import Script from "next/script";
|
|
6
6
|
import { useReportWebVitals } from "next/web-vitals";
|
|
7
7
|
import { useEffect } from "react";
|
|
8
|
-
import { getLink } from "../link/index.mjs";
|
|
9
8
|
import { mapFBEvent } from "../track/fbq.mjs";
|
|
10
9
|
import { track } from "../track/index.mjs";
|
|
11
10
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -41,26 +40,8 @@ function Analytics({
|
|
|
41
40
|
}) {
|
|
42
41
|
const pathname = usePathname();
|
|
43
42
|
useEffect(() => {
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
let link = null;
|
|
47
|
-
if (params.has("s")) link = await getLink(params.get("s"));
|
|
48
|
-
const properties = {
|
|
49
|
-
pathname,
|
|
50
|
-
referrer: document.referrer,
|
|
51
|
-
fbclid: params.get("fbclid"),
|
|
52
|
-
gclid: params.get("gclid"),
|
|
53
|
-
gad_source: params.get("gad_source"),
|
|
54
|
-
gad_campaignid: params.get("gad_campaignid"),
|
|
55
|
-
utm_source: (link == null ? void 0 : link.utm_source) ?? params.get("utm_source"),
|
|
56
|
-
utm_medium: (link == null ? void 0 : link.utm_medium) ?? params.get("utm_medium"),
|
|
57
|
-
utm_campaign: (link == null ? void 0 : link.utm_campaign) ?? params.get("utm_campaign"),
|
|
58
|
-
utm_term: (link == null ? void 0 : link.utm_term) ?? params.get("utm_term"),
|
|
59
|
-
utm_content: (link == null ? void 0 : link.utm_content) ?? params.get("utm_content")
|
|
60
|
-
};
|
|
61
|
-
track("page_view", properties, { enableThirdPartyTracking: false });
|
|
62
|
-
};
|
|
63
|
-
trackUTM();
|
|
43
|
+
const properties = { pathname, referrer: document.referrer };
|
|
44
|
+
track("page_view", properties, { enableThirdPartyTracking: false });
|
|
64
45
|
}, [pathname]);
|
|
65
46
|
useReportWebVitals((metric) => {
|
|
66
47
|
if (!reportWebVitals) return;
|
package/dist/next/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/next/index.tsx"],"sourcesContent":["'use client';\n\nimport { usePathname } from 'next/navigation';\nimport Script from 'next/script';\nimport { useReportWebVitals } from 'next/web-vitals';\nimport { useEffect } from 'react';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/next/index.tsx"],"sourcesContent":["'use client';\n\nimport { usePathname } from 'next/navigation';\nimport Script from 'next/script';\nimport { useReportWebVitals } from 'next/web-vitals';\nimport { useEffect } from 'react';\nimport { mapFBEvent } from '../track/fbq';\nimport { track } from '../track/index';\nimport type { Pixel, PixelId } from '../track/fbq';\nimport type { Gtag, GaId, GtmId } from '../track/gtag';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\n\ntype HotjarId = `${number}`;\n\ndeclare global {\n interface Window extends Gtag, Pixel {}\n}\n\ninterface Props {\n gaId?: GaId;\n gtmId?: GtmId;\n pixelId?: PixelId;\n hotjarId?: HotjarId;\n facebookAppId?: string;\n nonce?: string;\n debugMode?: boolean;\n reportWebVitals?: boolean;\n}\n\nexport function sendGAEvent<T extends EventName>(\n name: TrackName<T>,\n properties?: TrackProperties<T>\n) {\n if (!window.gtag) {\n console.warn('GA 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({\n gaId,\n nonce,\n debugMode,\n pixelId,\n hotjarId,\n facebookAppId,\n reportWebVitals = true,\n}: Props) {\n const pathname = usePathname();\n\n useEffect(() => {\n const properties = { pathname, referrer: document.referrer };\n track('page_view', properties, { enableThirdPartyTracking: false });\n }, [pathname]);\n\n useReportWebVitals((metric) => {\n if (!reportWebVitals) return;\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 id=\"gtag\"\n nonce={nonce}\n src={`https://www.googletagmanager.com/gtag/js?id=${gaId}`}\n />\n <Script\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 <Script\n id=\"pixel\"\n strategy=\"afterInteractive\"\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 {hotjarId && (\n <Script\n id=\"hotjar\"\n strategy=\"afterInteractive\"\n dangerouslySetInnerHTML={{\n __html: `\n (function(h,o,t,j,a,r){\n h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};\n h._hjSettings={hjid:${hotjarId},hjsv:6};\n a=o.getElementsByTagName('head')[0];\n r=o.createElement('script');r.async=1;\n r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;\n a.appendChild(r);\n })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');\n `,\n }}\n />\n )}\n </>\n );\n}\n"],"mappings":";;;AAEA,SAAS,mBAAmB;AAC5B,OAAO,YAAY;AACnB,SAAS,0BAA0B;AACnC,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAC3B,SAAS,aAAa;AAmFE,SAEhB,UAFgB,KAEhB,YAFgB;AA7DjB,SAAS,YACd,MACA,YACA;AACA,MAAI,CAAC,OAAO,MAAM;AAChB,YAAQ,KAAK,6BAA6B;AAC1C;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,mBAAmB,OAAO;AAAA,EACnD,OAAO;AACL,QAAI,MAAM,aAAa,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AA,QAExB;AAAA;AAAA,IACF;AAAA,IAED,YACC;AAAA,MAAC;AAAA;AAAA,QACC,IAAG;AAAA,QACH,UAAS;AAAA,QACT,yBAAyB;AAAA,UACvB,QAAQ;AAAA;AAAA;AAAA,oCAGgB,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAOlC;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ;","names":[]}
|
|
@@ -28,7 +28,6 @@ module.exports = __toCommonJS(react_router_exports);
|
|
|
28
28
|
var import_react = require("react");
|
|
29
29
|
var import_react_router = require("react-router");
|
|
30
30
|
var import_web_vitals = require("web-vitals");
|
|
31
|
-
var import_link = require("../link/index.cjs");
|
|
32
31
|
var import_fbq = require("../track/fbq.cjs");
|
|
33
32
|
var import_track = require("../track/index.cjs");
|
|
34
33
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -74,25 +73,8 @@ function Analytics({
|
|
|
74
73
|
const { pathname } = (0, import_react_router.useLocation)();
|
|
75
74
|
const [params] = (0, import_react_router.useSearchParams)();
|
|
76
75
|
(0, import_react.useEffect)(() => {
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
if (params.has("s")) link = await (0, import_link.getLink)(params.get("s"));
|
|
80
|
-
const properties = {
|
|
81
|
-
pathname,
|
|
82
|
-
referrer: document.referrer,
|
|
83
|
-
fbclid: params.get("fbclid"),
|
|
84
|
-
gclid: params.get("gclid"),
|
|
85
|
-
gad_source: params.get("gad_source"),
|
|
86
|
-
gad_campaignid: params.get("gad_campaignid"),
|
|
87
|
-
utm_source: (link == null ? void 0 : link.utm_source) ?? params.get("utm_source"),
|
|
88
|
-
utm_medium: (link == null ? void 0 : link.utm_medium) ?? params.get("utm_medium"),
|
|
89
|
-
utm_campaign: (link == null ? void 0 : link.utm_campaign) ?? params.get("utm_campaign"),
|
|
90
|
-
utm_term: (link == null ? void 0 : link.utm_term) ?? params.get("utm_term"),
|
|
91
|
-
utm_content: (link == null ? void 0 : link.utm_content) ?? params.get("utm_content")
|
|
92
|
-
};
|
|
93
|
-
(0, import_track.track)("page_view", properties, { enableThirdPartyTracking: false });
|
|
94
|
-
};
|
|
95
|
-
trackUTM();
|
|
76
|
+
const properties = { pathname, referrer: document.referrer };
|
|
77
|
+
(0, import_track.track)("page_view", properties, { enableThirdPartyTracking: false });
|
|
96
78
|
}, [pathname, params]);
|
|
97
79
|
useReportWebVitals((metric) => {
|
|
98
80
|
if (!reportWebVitals) return;
|
|
@@ -1 +1 @@
|
|
|
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 {
|
|
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 { mapFBEvent } from '../track/fbq';\nimport { track } from '../track/index';\nimport type { Pixel, PixelId } from '../track/fbq';\nimport type { Gtag, GaId, GtmId } from '../track/gtag';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\n\ntype HotjarId = `${number}`;\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 hotjarId?: HotjarId;\n facebookAppId?: string;\n nonce?: string;\n debugMode?: boolean;\n reportWebVitals?: 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({\n gaId,\n nonce,\n debugMode,\n pixelId,\n hotjarId,\n facebookAppId,\n reportWebVitals = true,\n}: Props) {\n const { pathname } = useLocation();\n const [params] = useSearchParams();\n\n useEffect(() => {\n const properties = { pathname, referrer: document.referrer };\n track('page_view', properties, { enableThirdPartyTracking: false });\n }, [pathname, params]);\n\n useReportWebVitals((metric) => {\n if (!reportWebVitals) return;\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 <script\n async\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 {hotjarId && (\n <script\n async\n id=\"hotjar\"\n dangerouslySetInnerHTML={{\n __html: `\n (function(h,o,t,j,a,r){\n h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};\n h._hjSettings={hjid:${hotjarId},hjsv:6};\n a=o.getElementsByTagName('head')[0];\n r=o.createElement('script');r.async=1;\n r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;\n a.appendChild(r);\n })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');\n `,\n }}\n />\n )}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA0B;AAC1B,0BAA6C;AAC7C,wBAAgE;AAChE,iBAA2B;AAC3B,mBAAsB;AA8FE;AAvFxB,SAAS,mBAAmB,mBAA6C;AACvE,8BAAU,MAAM;AACd,iCAAM,iBAAiB;AACvB,iCAAM,iBAAiB;AACvB,iCAAM,iBAAiB;AACvB,iCAAM,iBAAiB;AACvB,kCAAO,iBAAiB;AAAA,EAC1B,GAAG,CAAC,iBAAiB,CAAC;AACxB;AAiBO,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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AA;AAAA;AAAA;AAAA,gCAIU,IAAI,IAAI,YAAY,6BAA6B,EAAE;AAAA;AAAA,UAEvE;AAAA;AAAA,MACF;AAAA,OACF;AAAA,IAED,WACC;AAAA,MAAC;AAAA;AAAA,QACC,OAAK;AAAA,QACL,IAAG;AAAA,QACH,yBAAyB;AAAA,UACvB,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAiBO,OAAO;AAAA;AAAA,QAExB;AAAA;AAAA,IACF;AAAA,IAED,YACC;AAAA,MAAC;AAAA;AAAA,QACC,OAAK;AAAA,QACL,IAAG;AAAA,QACH,yBAAyB;AAAA,UACvB,QAAQ;AAAA;AAAA;AAAA,oCAGgB,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAOlC;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ;","names":[]}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { useEffect } from "react";
|
|
3
3
|
import { useLocation, useSearchParams } from "react-router";
|
|
4
4
|
import { onLCP, onCLS, onINP, onFCP, onTTFB } from "web-vitals";
|
|
5
|
-
import { getLink } from "../link/index.mjs";
|
|
6
5
|
import { mapFBEvent } from "../track/fbq.mjs";
|
|
7
6
|
import { track } from "../track/index.mjs";
|
|
8
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -48,25 +47,8 @@ function Analytics({
|
|
|
48
47
|
const { pathname } = useLocation();
|
|
49
48
|
const [params] = useSearchParams();
|
|
50
49
|
useEffect(() => {
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
if (params.has("s")) link = await getLink(params.get("s"));
|
|
54
|
-
const properties = {
|
|
55
|
-
pathname,
|
|
56
|
-
referrer: document.referrer,
|
|
57
|
-
fbclid: params.get("fbclid"),
|
|
58
|
-
gclid: params.get("gclid"),
|
|
59
|
-
gad_source: params.get("gad_source"),
|
|
60
|
-
gad_campaignid: params.get("gad_campaignid"),
|
|
61
|
-
utm_source: (link == null ? void 0 : link.utm_source) ?? params.get("utm_source"),
|
|
62
|
-
utm_medium: (link == null ? void 0 : link.utm_medium) ?? params.get("utm_medium"),
|
|
63
|
-
utm_campaign: (link == null ? void 0 : link.utm_campaign) ?? params.get("utm_campaign"),
|
|
64
|
-
utm_term: (link == null ? void 0 : link.utm_term) ?? params.get("utm_term"),
|
|
65
|
-
utm_content: (link == null ? void 0 : link.utm_content) ?? params.get("utm_content")
|
|
66
|
-
};
|
|
67
|
-
track("page_view", properties, { enableThirdPartyTracking: false });
|
|
68
|
-
};
|
|
69
|
-
trackUTM();
|
|
50
|
+
const properties = { pathname, referrer: document.referrer };
|
|
51
|
+
track("page_view", properties, { enableThirdPartyTracking: false });
|
|
70
52
|
}, [pathname, params]);
|
|
71
53
|
useReportWebVitals((metric) => {
|
|
72
54
|
if (!reportWebVitals) return;
|
|
@@ -1 +1 @@
|
|
|
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 {
|
|
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 { mapFBEvent } from '../track/fbq';\nimport { track } from '../track/index';\nimport type { Pixel, PixelId } from '../track/fbq';\nimport type { Gtag, GaId, GtmId } from '../track/gtag';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\n\ntype HotjarId = `${number}`;\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 hotjarId?: HotjarId;\n facebookAppId?: string;\n nonce?: string;\n debugMode?: boolean;\n reportWebVitals?: 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({\n gaId,\n nonce,\n debugMode,\n pixelId,\n hotjarId,\n facebookAppId,\n reportWebVitals = true,\n}: Props) {\n const { pathname } = useLocation();\n const [params] = useSearchParams();\n\n useEffect(() => {\n const properties = { pathname, referrer: document.referrer };\n track('page_view', properties, { enableThirdPartyTracking: false });\n }, [pathname, params]);\n\n useReportWebVitals((metric) => {\n if (!reportWebVitals) return;\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 <script\n async\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 {hotjarId && (\n <script\n async\n id=\"hotjar\"\n dangerouslySetInnerHTML={{\n __html: `\n (function(h,o,t,j,a,r){\n h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};\n h._hjSettings={hjid:${hotjarId},hjsv:6};\n a=o.getElementsByTagName('head')[0];\n r=o.createElement('script');r.async=1;\n r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;\n a.appendChild(r);\n })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');\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,kBAAkB;AAC3B,SAAS,aAAa;AA8FE,SAEhB,UAFgB,KAEhB,YAFgB;AAvFxB,SAAS,mBAAmB,mBAA6C;AACvE,YAAU,MAAM;AACd,UAAM,iBAAiB;AACvB,UAAM,iBAAiB;AACvB,UAAM,iBAAiB;AACvB,UAAM,iBAAiB;AACvB,WAAO,iBAAiB;AAAA,EAC1B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BAAiB,oBAAC,UAAK,UAAS,aAAY,SAAS,eAAe;AAAA,IACpE,QACC,iCACE;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,OAAK;AAAA,UACL,IAAG;AAAA,UACH;AAAA,UACA,KAAK,+CAA+C,IAAI;AAAA;AAAA,MAC1D;AAAA,MACA;AAAA,QAAC;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;AAAA,MAAC;AAAA;AAAA,QACC,OAAK;AAAA,QACL,IAAG;AAAA,QACH,yBAAyB;AAAA,UACvB,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAiBO,OAAO;AAAA;AAAA,QAExB;AAAA;AAAA,IACF;AAAA,IAED,YACC;AAAA,MAAC;AAAA;AAAA,QACC,OAAK;AAAA,QACL,IAAG;AAAA,QACH,yBAAyB;AAAA,UACvB,QAAQ;AAAA;AAAA;AAAA,oCAGgB,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAOlC;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ;","names":[]}
|
package/dist/schema/index.cjs
CHANGED
|
@@ -184,6 +184,10 @@ var createFeedbackSchema = (0, import_mini.object)({
|
|
|
184
184
|
email: (0, import_mini.email)().check((0, import_mini.maxLength)(320)),
|
|
185
185
|
message: (0, import_mini.string)().check((0, import_mini.minLength)(1), (0, import_mini.maxLength)(65536))
|
|
186
186
|
});
|
|
187
|
+
var noEmptyString = (0, import_mini.pipe)(
|
|
188
|
+
(0, import_mini.string)().check((0, import_mini.maxLength)(256)),
|
|
189
|
+
(0, import_mini.transform)((v) => v ? v : void 0)
|
|
190
|
+
);
|
|
187
191
|
var createLinkSchema = (0, import_mini.object)({
|
|
188
192
|
/** The URL that the user is redirected to. */
|
|
189
193
|
url: (0, import_mini.url)().check((0, import_mini.minLength)(1), (0, import_mini.maxLength)(1024)),
|
|
@@ -192,7 +196,7 @@ var createLinkSchema = (0, import_mini.object)({
|
|
|
192
196
|
* Campaign ID. Used to identify a specific campaign or promotion. This is a required key for GA4
|
|
193
197
|
* data import. Use the same IDs that you use when uploading campaign cost data.
|
|
194
198
|
*/
|
|
195
|
-
utm_id: (0, import_mini.optional)(
|
|
199
|
+
utm_id: (0, import_mini.optional)(noEmptyString),
|
|
196
200
|
/** Referrer, for example: google, newsletter4, billboard */
|
|
197
201
|
utm_source: (0, import_mini.string)().check((0, import_mini.minLength)(1), (0, import_mini.maxLength)(256)),
|
|
198
202
|
// required
|
|
@@ -203,29 +207,29 @@ var createLinkSchema = (0, import_mini.object)({
|
|
|
203
207
|
utm_campaign: (0, import_mini.string)().check((0, import_mini.minLength)(1), (0, import_mini.maxLength)(256)),
|
|
204
208
|
// required
|
|
205
209
|
/** Paid keyword */
|
|
206
|
-
utm_term: (0, import_mini.optional)(
|
|
210
|
+
utm_term: (0, import_mini.optional)(noEmptyString),
|
|
207
211
|
/**
|
|
208
212
|
* Use to differentiate creatives. For example, if you have two call-to-action links within the
|
|
209
213
|
* same email message, you can use utm_content and set different values for each so you can tell
|
|
210
214
|
* which version is more effective.
|
|
211
215
|
*/
|
|
212
|
-
utm_content: (0, import_mini.optional)(
|
|
216
|
+
utm_content: (0, import_mini.optional)(noEmptyString),
|
|
213
217
|
/**
|
|
214
218
|
* The platform responsible for directing traffic to a given Analytics property (such as a buying
|
|
215
219
|
* platform that sets budgets and targeting criteria or a platform that manages organic traffic
|
|
216
220
|
* data). For example: Search Ads 360 or Display & Video 360.
|
|
217
221
|
*/
|
|
218
|
-
utm_source_platform: (0, import_mini.optional)(
|
|
222
|
+
utm_source_platform: (0, import_mini.optional)(noEmptyString),
|
|
219
223
|
/**
|
|
220
224
|
* Type of creative, for example: display, native, video, search, utm_creative_format is not
|
|
221
225
|
* currently reported in Google Analytics 4 properties.
|
|
222
226
|
*/
|
|
223
|
-
utm_creative_format: (0, import_mini.optional)(
|
|
227
|
+
utm_creative_format: (0, import_mini.optional)(noEmptyString),
|
|
224
228
|
/**
|
|
225
229
|
* Targeting criteria applied to a campaign, for example: remarketing, prospecting,
|
|
226
230
|
* utm_marketing_tactic is not currently reported in Google Analytics 4 properties.
|
|
227
231
|
* */
|
|
228
|
-
utm_marketing_tactic: (0, import_mini.optional)(
|
|
232
|
+
utm_marketing_tactic: (0, import_mini.optional)(noEmptyString)
|
|
229
233
|
});
|
|
230
234
|
// Annotate the CommonJS export names for ESM import in node:
|
|
231
235
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/schema/index.ts"],"sourcesContent":["import {\n optional,\n object,\n string,\n regex,\n number,\n boolean,\n null as _null,\n coerce,\n enum as _enum,\n trim,\n union,\n record,\n array,\n iso,\n minLength,\n maxLength,\n refine,\n pipe,\n transform,\n email,\n type z,\n uuid,\n url,\n} from 'zod/mini';\n\nconst items = array(\n record(\n string().check(trim(), minLength(1), maxLength(128)),\n union([string().check(maxLength(512)), number(), boolean(), _null()])\n )\n);\n\n/** @deprecated */\nexport const createTrackEventSchemaV1 = array(\n object({\n name: string().check(trim(), minLength(1), maxLength(64)),\n visitor_id: coerce.bigint(),\n timestamp: iso.datetime(),\n tags: object({\n os: optional(string()),\n os_name: optional(string()),\n os_version: optional(string()),\n browser: optional(string()),\n browser_name: optional(string()),\n browser_version: optional(string()),\n platform: optional(_enum(['ios', 'android', 'web', 'macos', 'windows', 'linux', 'unknown'])),\n device: optional(string()),\n device_id: optional(string().check(trim(), minLength(1), maxLength(36))),\n device_type: optional(string()),\n device_vendor: optional(string()),\n device_pixel_ratio: optional(string()),\n screen_resolution: optional(\n pipe(\n string().check(regex(/^\\d+x\\d+$/)),\n transform((v) => v as `${number}x${number}`)\n )\n ),\n release: optional(string()),\n language: optional(string()),\n time_zone: optional(string()),\n environment: optional(_enum(['development', 'production'])),\n source_url: optional(string()),\n source: optional(_enum(['web', 'app', 'offline'])),\n // meta ads\n fbc: optional(string()),\n fbp: optional(string()),\n fbclid: optional(string()),\n ad_id: optional(string()),\n ad_name: optional(string()),\n adset_id: optional(string()),\n adset_name: optional(string()),\n campaign_id: optional(string()),\n campaign_name: optional(string()),\n placement: optional(string()),\n site_source_name: optional(string()),\n // google ads\n gclid: optional(string()),\n gclsrc: optional(string()),\n gad_source: optional(string()),\n gad_campaignid: optional(string()),\n advertising_id: optional(string()),\n // utm params\n utm_source: optional(string()),\n utm_medium: optional(string()),\n utm_campaign: optional(string()),\n utm_term: optional(string()),\n utm_content: optional(string()),\n }),\n properties: optional(\n record(\n string().check(trim(), minLength(1), maxLength(128)),\n union([string().check(maxLength(512)), number(), boolean(), _null(), items])\n ).check(refine((data) => Object.keys(data).length <= 64))\n ),\n })\n).check(minLength(1), maxLength(100));\n\nexport const createTrackEventSchema = array(\n object({\n name: string().check(trim(), minLength(1), maxLength(64)),\n visitor_id: uuid(),\n timestamp: iso.datetime(),\n tags: object({\n os: optional(string()),\n os_name: optional(string()),\n os_version: optional(string()),\n browser: optional(string()),\n browser_name: optional(string()),\n browser_version: optional(string()),\n platform: optional(_enum(['ios', 'android', 'web', 'macos', 'windows', 'linux', 'unknown'])),\n device: optional(string()),\n device_id: optional(string().check(trim(), minLength(1), maxLength(36))),\n device_type: optional(string()),\n device_vendor: optional(string()),\n device_pixel_ratio: optional(string()),\n screen_resolution: optional(\n pipe(\n string().check(regex(/^\\d+x\\d+$/)),\n transform((v) => v as `${number}x${number}`)\n )\n ),\n release: optional(string()),\n language: optional(string()),\n time_zone: optional(string()),\n environment: optional(_enum(['development', 'production'])),\n source_url: optional(string()),\n source: optional(_enum(['web', 'app', 'offline'])),\n // meta ads\n fbc: optional(string()),\n fbp: optional(string()),\n fbclid: optional(string()),\n ad_id: optional(string()),\n ad_name: optional(string()),\n adset_id: optional(string()),\n adset_name: optional(string()),\n campaign_id: optional(string()),\n campaign_name: optional(string()),\n placement: optional(string()),\n site_source_name: optional(string()),\n // google ads\n gclid: optional(string()),\n gclsrc: optional(string()),\n gad_source: optional(string()),\n gad_campaignid: optional(string()),\n advertising_id: optional(string()),\n // utm params\n utm_source: optional(string()),\n utm_medium: optional(string()),\n utm_campaign: optional(string()),\n utm_term: optional(string()),\n utm_content: optional(string()),\n }),\n properties: optional(\n record(\n string().check(trim(), minLength(1), maxLength(128)),\n union([string().check(maxLength(512)), number(), boolean(), _null(), items])\n ).check(refine((data) => Object.keys(data).length <= 64))\n ),\n })\n).check(minLength(1), maxLength(100));\n\nexport const createVisitorSchema = object({\n device_id: string().check(trim(), minLength(1), maxLength(36)),\n properties: optional(\n record(\n string().check(trim(), minLength(1), maxLength(128)),\n union([string().check(maxLength(512)), number(), boolean(), _null()])\n ).check(refine((data) => Object.keys(data).length <= 64))\n ),\n});\n\nexport const updateVisitorSchema = object({\n user_id: optional(uuid()),\n properties: optional(\n record(\n string().check(trim(), minLength(1), maxLength(128)),\n union([string().check(maxLength(512)), number(), boolean(), _null()])\n ).check(refine((data) => Object.keys(data).length <= 64))\n ),\n});\n\nexport const createFeedbackSchema = object({\n name: string().check(minLength(1), maxLength(256)),\n email: email().check(maxLength(320)),\n message: string().check(minLength(1), maxLength(65536)),\n});\n\n/**\n * The schema for creating a link.\n * @see https://support.google.com/analytics/answer/10917952\n * */\nexport const createLinkSchema = object({\n /** The URL that the user is redirected to. */\n url: url().check(minLength(1), maxLength(1024)), // required\n\n /**\n * Campaign ID. Used to identify a specific campaign or promotion. This is a required key for GA4\n * data import. Use the same IDs that you use when uploading campaign cost data.\n */\n utm_id: optional(string().check(maxLength(256))),\n\n /** Referrer, for example: google, newsletter4, billboard */\n utm_source: string().check(minLength(1), maxLength(256)), // required\n\n /** Marketing medium, for example: cpc, banner, email */\n utm_medium: string().check(minLength(1), maxLength(256)), // required\n\n /** Product, slogan, promo code, for example: spring_sale */\n utm_campaign: string().check(minLength(1), maxLength(256)), // required\n\n /** Paid keyword */\n utm_term: optional(string().check(maxLength(256))),\n\n /**\n * Use to differentiate creatives. For example, if you have two call-to-action links within the\n * same email message, you can use utm_content and set different values for each so you can tell\n * which version is more effective.\n */\n utm_content: optional(string().check(maxLength(256))),\n\n /**\n * The platform responsible for directing traffic to a given Analytics property (such as a buying\n * platform that sets budgets and targeting criteria or a platform that manages organic traffic\n * data). For example: Search Ads 360 or Display & Video 360.\n */\n utm_source_platform: optional(string().check(maxLength(256))),\n\n /**\n * Type of creative, for example: display, native, video, search, utm_creative_format is not\n * currently reported in Google Analytics 4 properties.\n */\n utm_creative_format: optional(string().check(maxLength(256))),\n\n /**\n * Targeting criteria applied to a campaign, for example: remarketing, prospecting,\n * utm_marketing_tactic is not currently reported in Google Analytics 4 properties.\n * */\n utm_marketing_tactic: optional(string().check(maxLength(256))),\n});\n\nexport type CreateFeedbackDTO = z.output<typeof createFeedbackSchema>;\nexport type CreateLinkDTO = z.output<typeof createLinkSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAwBO;AAEP,IAAM,YAAQ;AAAA,MACZ;AAAA,QACE,oBAAO,EAAE,UAAM,kBAAK,OAAG,uBAAU,CAAC,OAAG,uBAAU,GAAG,CAAC;AAAA,QACnD,mBAAM,KAAC,oBAAO,EAAE,UAAM,uBAAU,GAAG,CAAC,OAAG,oBAAO,OAAG,qBAAQ,OAAG,YAAAA,MAAM,CAAC,CAAC;AAAA,EACtE;AACF;AAGO,IAAM,+BAA2B;AAAA,MACtC,oBAAO;AAAA,IACL,UAAM,oBAAO,EAAE,UAAM,kBAAK,OAAG,uBAAU,CAAC,OAAG,uBAAU,EAAE,CAAC;AAAA,IACxD,YAAY,mBAAO,OAAO;AAAA,IAC1B,WAAW,gBA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AAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM9C,YAAQ,0BAAS,oBAAO,EAAE,UAAM,uBAAU,GAAG,CAAC,CAAC;AAAA;AAAA,EAG/C,gBAAY,oBAAO,EAAE,UAAM,uBAAU,CAAC,OAAG,uBAAU,GAAG,CAAC;AAAA;AAAA;AAAA,EAGvD,gBAAY,oBAAO,EAAE,UAAM,uBAAU,CAAC,OAAG,uBAAU,GAAG,CAAC;AAAA;AAAA;AAAA,EAGvD,kBAAc,oBAAO,EAAE,UAAM,uBAAU,CAAC,OAAG,uBAAU,GAAG,CAAC;AAAA;AAAA;AAAA,EAGzD,cAAU,0BAAS,oBAAO,EAAE,UAAM,uBAAU,GAAG,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOjD,iBAAa,0BAAS,oBAAO,EAAE,UAAM,uBAAU,GAAG,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOpD,yBAAqB,0BAAS,oBAAO,EAAE,UAAM,uBAAU,GAAG,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,EAM5D,yBAAqB,0BAAS,oBAAO,EAAE,UAAM,uBAAU,GAAG,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,EAM5D,0BAAsB,0BAAS,oBAAO,EAAE,UAAM,uBAAU,GAAG,CAAC,CAAC;AAC/D,CAAC;","names":["_null","_enum"]}
|
|
1
|
+
{"version":3,"sources":["../../src/schema/index.ts"],"sourcesContent":["import {\n optional,\n object,\n string,\n regex,\n number,\n boolean,\n null as _null,\n coerce,\n enum as _enum,\n trim,\n union,\n record,\n array,\n iso,\n minLength,\n maxLength,\n refine,\n pipe,\n transform,\n email,\n type z,\n uuid,\n url,\n} from 'zod/mini';\n\nconst items = array(\n record(\n string().check(trim(), minLength(1), maxLength(128)),\n union([string().check(maxLength(512)), number(), boolean(), _null()])\n )\n);\n\n/** @deprecated */\nexport const createTrackEventSchemaV1 = array(\n object({\n name: string().check(trim(), minLength(1), maxLength(64)),\n visitor_id: coerce.bigint(),\n timestamp: iso.datetime(),\n tags: object({\n os: optional(string()),\n os_name: optional(string()),\n os_version: optional(string()),\n browser: optional(string()),\n browser_name: optional(string()),\n browser_version: optional(string()),\n platform: optional(_enum(['ios', 'android', 'web', 'macos', 'windows', 'linux', 'unknown'])),\n device: optional(string()),\n device_id: optional(string().check(trim(), minLength(1), maxLength(36))),\n device_type: optional(string()),\n device_vendor: optional(string()),\n device_pixel_ratio: optional(string()),\n screen_resolution: optional(\n pipe(\n string().check(regex(/^\\d+x\\d+$/)),\n transform((v) => v as `${number}x${number}`)\n )\n ),\n release: optional(string()),\n language: optional(string()),\n time_zone: optional(string()),\n environment: optional(_enum(['development', 'production'])),\n source_url: optional(string()),\n source: optional(_enum(['web', 'app', 'offline'])),\n // meta ads\n fbc: optional(string()),\n fbp: optional(string()),\n fbclid: optional(string()),\n ad_id: optional(string()),\n ad_name: optional(string()),\n adset_id: optional(string()),\n adset_name: optional(string()),\n campaign_id: optional(string()),\n campaign_name: optional(string()),\n placement: optional(string()),\n site_source_name: optional(string()),\n // google ads\n gclid: optional(string()),\n gclsrc: optional(string()),\n gad_source: optional(string()),\n gad_campaignid: optional(string()),\n advertising_id: optional(string()),\n // utm params\n utm_source: optional(string()),\n utm_medium: optional(string()),\n utm_campaign: optional(string()),\n utm_term: optional(string()),\n utm_content: optional(string()),\n }),\n properties: optional(\n record(\n string().check(trim(), minLength(1), maxLength(128)),\n union([string().check(maxLength(512)), number(), boolean(), _null(), items])\n ).check(refine((data) => Object.keys(data).length <= 64))\n ),\n })\n).check(minLength(1), maxLength(100));\n\nexport const createTrackEventSchema = array(\n object({\n name: string().check(trim(), minLength(1), maxLength(64)),\n visitor_id: uuid(),\n timestamp: iso.datetime(),\n tags: object({\n os: optional(string()),\n os_name: optional(string()),\n os_version: optional(string()),\n browser: optional(string()),\n browser_name: optional(string()),\n browser_version: optional(string()),\n platform: optional(_enum(['ios', 'android', 'web', 'macos', 'windows', 'linux', 'unknown'])),\n device: optional(string()),\n device_id: optional(string().check(trim(), minLength(1), maxLength(36))),\n device_type: optional(string()),\n device_vendor: optional(string()),\n device_pixel_ratio: optional(string()),\n screen_resolution: optional(\n pipe(\n string().check(regex(/^\\d+x\\d+$/)),\n transform((v) => v as `${number}x${number}`)\n )\n ),\n release: optional(string()),\n language: optional(string()),\n time_zone: optional(string()),\n environment: optional(_enum(['development', 'production'])),\n source_url: optional(string()),\n source: optional(_enum(['web', 'app', 'offline'])),\n // meta ads\n fbc: optional(string()),\n fbp: optional(string()),\n fbclid: optional(string()),\n ad_id: optional(string()),\n ad_name: optional(string()),\n adset_id: optional(string()),\n adset_name: optional(string()),\n campaign_id: optional(string()),\n campaign_name: optional(string()),\n placement: optional(string()),\n site_source_name: optional(string()),\n // google ads\n gclid: optional(string()),\n gclsrc: optional(string()),\n gad_source: optional(string()),\n gad_campaignid: optional(string()),\n advertising_id: optional(string()),\n // utm params\n utm_source: optional(string()),\n utm_medium: optional(string()),\n utm_campaign: optional(string()),\n utm_term: optional(string()),\n utm_content: optional(string()),\n }),\n properties: optional(\n record(\n string().check(trim(), minLength(1), maxLength(128)),\n union([string().check(maxLength(512)), number(), boolean(), _null(), items])\n ).check(refine((data) => Object.keys(data).length <= 64))\n ),\n })\n).check(minLength(1), maxLength(100));\n\nexport const createVisitorSchema = object({\n device_id: string().check(trim(), minLength(1), maxLength(36)),\n properties: optional(\n record(\n string().check(trim(), minLength(1), maxLength(128)),\n union([string().check(maxLength(512)), number(), boolean(), _null()])\n ).check(refine((data) => Object.keys(data).length <= 64))\n ),\n});\n\nexport const updateVisitorSchema = object({\n user_id: optional(uuid()),\n properties: optional(\n record(\n string().check(trim(), minLength(1), maxLength(128)),\n union([string().check(maxLength(512)), number(), boolean(), _null()])\n ).check(refine((data) => Object.keys(data).length <= 64))\n ),\n});\n\nexport const createFeedbackSchema = object({\n name: string().check(minLength(1), maxLength(256)),\n email: email().check(maxLength(320)),\n message: string().check(minLength(1), maxLength(65536)),\n});\n\nconst noEmptyString = pipe(\n string().check(maxLength(256)),\n transform((v) => (v ? v : undefined))\n);\n\n/**\n * The schema for creating a link.\n * @see https://support.google.com/analytics/answer/10917952\n * */\nexport const createLinkSchema = object({\n /** The URL that the user is redirected to. */\n url: url().check(minLength(1), maxLength(1024)), // required\n\n /**\n * Campaign ID. Used to identify a specific campaign or promotion. This is a required key for GA4\n * data import. Use the same IDs that you use when uploading campaign cost data.\n */\n utm_id: optional(noEmptyString),\n\n /** Referrer, for example: google, newsletter4, billboard */\n utm_source: string().check(minLength(1), maxLength(256)), // required\n\n /** Marketing medium, for example: cpc, banner, email */\n utm_medium: string().check(minLength(1), maxLength(256)), // required\n\n /** Product, slogan, promo code, for example: spring_sale */\n utm_campaign: string().check(minLength(1), maxLength(256)), // required\n\n /** Paid keyword */\n utm_term: optional(noEmptyString),\n\n /**\n * Use to differentiate creatives. For example, if you have two call-to-action links within the\n * same email message, you can use utm_content and set different values for each so you can tell\n * which version is more effective.\n */\n utm_content: optional(noEmptyString),\n\n /**\n * The platform responsible for directing traffic to a given Analytics property (such as a buying\n * platform that sets budgets and targeting criteria or a platform that manages organic traffic\n * data). For example: Search Ads 360 or Display & Video 360.\n */\n utm_source_platform: optional(noEmptyString),\n\n /**\n * Type of creative, for example: display, native, video, search, utm_creative_format is not\n * currently reported in Google Analytics 4 properties.\n */\n utm_creative_format: optional(noEmptyString),\n\n /**\n * Targeting criteria applied to a campaign, for example: remarketing, prospecting,\n * utm_marketing_tactic is not currently reported in Google Analytics 4 properties.\n * */\n utm_marketing_tactic: optional(noEmptyString),\n});\n\nexport type CreateFeedbackDTO = z.output<typeof createFeedbackSchema>;\nexport type CreateLinkDTO = z.output<typeof createLinkSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAwBO;AAEP,IAAM,YAAQ;AAAA,MACZ;AAAA,QAC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ackEventSchemaV1: z.ZodMiniArray<z.ZodMiniObject<{
|
|
|
13
13
|
browser_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
14
14
|
browser_version: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
15
15
|
platform: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
16
|
-
unknown: "unknown";
|
|
17
16
|
ios: "ios";
|
|
18
17
|
android: "android";
|
|
19
18
|
web: "web";
|
|
20
19
|
macos: "macos";
|
|
21
20
|
windows: "windows";
|
|
22
21
|
linux: "linux";
|
|
22
|
+
unknown: "unknown";
|
|
23
23
|
}>>;
|
|
24
24
|
device: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
25
25
|
device_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
@@ -76,13 +76,13 @@ declare const createTrackEventSchema: z.ZodMiniArray<z.ZodMiniObject<{
|
|
|
76
76
|
browser_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
77
77
|
browser_version: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
78
78
|
platform: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
79
|
-
unknown: "unknown";
|
|
80
79
|
ios: "ios";
|
|
81
80
|
android: "android";
|
|
82
81
|
web: "web";
|
|
83
82
|
macos: "macos";
|
|
84
83
|
windows: "windows";
|
|
85
84
|
linux: "linux";
|
|
85
|
+
unknown: "unknown";
|
|
86
86
|
}>>;
|
|
87
87
|
device: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
88
88
|
device_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
@@ -151,7 +151,7 @@ declare const createLinkSchema: z.ZodMiniObject<{
|
|
|
151
151
|
* Campaign ID. Used to identify a specific campaign or promotion. This is a required key for GA4
|
|
152
152
|
* data import. Use the same IDs that you use when uploading campaign cost data.
|
|
153
153
|
*/
|
|
154
|
-
utm_id: z.ZodMiniOptional<z.ZodMiniString<string
|
|
154
|
+
utm_id: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
|
|
155
155
|
/** Referrer, for example: google, newsletter4, billboard */
|
|
156
156
|
utm_source: z.ZodMiniString<string>;
|
|
157
157
|
/** Marketing medium, for example: cpc, banner, email */
|
|
@@ -159,29 +159,29 @@ declare const createLinkSchema: z.ZodMiniObject<{
|
|
|
159
159
|
/** Product, slogan, promo code, for example: spring_sale */
|
|
160
160
|
utm_campaign: z.ZodMiniString<string>;
|
|
161
161
|
/** Paid keyword */
|
|
162
|
-
utm_term: z.ZodMiniOptional<z.ZodMiniString<string
|
|
162
|
+
utm_term: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
|
|
163
163
|
/**
|
|
164
164
|
* Use to differentiate creatives. For example, if you have two call-to-action links within the
|
|
165
165
|
* same email message, you can use utm_content and set different values for each so you can tell
|
|
166
166
|
* which version is more effective.
|
|
167
167
|
*/
|
|
168
|
-
utm_content: z.ZodMiniOptional<z.ZodMiniString<string
|
|
168
|
+
utm_content: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
|
|
169
169
|
/**
|
|
170
170
|
* The platform responsible for directing traffic to a given Analytics property (such as a buying
|
|
171
171
|
* platform that sets budgets and targeting criteria or a platform that manages organic traffic
|
|
172
172
|
* data). For example: Search Ads 360 or Display & Video 360.
|
|
173
173
|
*/
|
|
174
|
-
utm_source_platform: z.ZodMiniOptional<z.ZodMiniString<string
|
|
174
|
+
utm_source_platform: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
|
|
175
175
|
/**
|
|
176
176
|
* Type of creative, for example: display, native, video, search, utm_creative_format is not
|
|
177
177
|
* currently reported in Google Analytics 4 properties.
|
|
178
178
|
*/
|
|
179
|
-
utm_creative_format: z.ZodMiniOptional<z.ZodMiniString<string
|
|
179
|
+
utm_creative_format: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
|
|
180
180
|
/**
|
|
181
181
|
* Targeting criteria applied to a campaign, for example: remarketing, prospecting,
|
|
182
182
|
* utm_marketing_tactic is not currently reported in Google Analytics 4 properties.
|
|
183
183
|
* */
|
|
184
|
-
utm_marketing_tactic: z.ZodMiniOptional<z.ZodMiniString<string
|
|
184
|
+
utm_marketing_tactic: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
|
|
185
185
|
}, z.core.$strip>;
|
|
186
186
|
type CreateFeedbackDTO = z.output<typeof createFeedbackSchema>;
|
|
187
187
|
type CreateLinkDTO = z.output<typeof createLinkSchema>;
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -13,13 +13,13 @@ declare const createTrackEventSchemaV1: z.ZodMiniArray<z.ZodMiniObject<{
|
|
|
13
13
|
browser_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
14
14
|
browser_version: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
15
15
|
platform: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
16
|
-
unknown: "unknown";
|
|
17
16
|
ios: "ios";
|
|
18
17
|
android: "android";
|
|
19
18
|
web: "web";
|
|
20
19
|
macos: "macos";
|
|
21
20
|
windows: "windows";
|
|
22
21
|
linux: "linux";
|
|
22
|
+
unknown: "unknown";
|
|
23
23
|
}>>;
|
|
24
24
|
device: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
25
25
|
device_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
@@ -76,13 +76,13 @@ declare const createTrackEventSchema: z.ZodMiniArray<z.ZodMiniObject<{
|
|
|
76
76
|
browser_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
77
77
|
browser_version: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
78
78
|
platform: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
79
|
-
unknown: "unknown";
|
|
80
79
|
ios: "ios";
|
|
81
80
|
android: "android";
|
|
82
81
|
web: "web";
|
|
83
82
|
macos: "macos";
|
|
84
83
|
windows: "windows";
|
|
85
84
|
linux: "linux";
|
|
85
|
+
unknown: "unknown";
|
|
86
86
|
}>>;
|
|
87
87
|
device: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
88
88
|
device_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
@@ -151,7 +151,7 @@ declare const createLinkSchema: z.ZodMiniObject<{
|
|
|
151
151
|
* Campaign ID. Used to identify a specific campaign or promotion. This is a required key for GA4
|
|
152
152
|
* data import. Use the same IDs that you use when uploading campaign cost data.
|
|
153
153
|
*/
|
|
154
|
-
utm_id: z.ZodMiniOptional<z.ZodMiniString<string
|
|
154
|
+
utm_id: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
|
|
155
155
|
/** Referrer, for example: google, newsletter4, billboard */
|
|
156
156
|
utm_source: z.ZodMiniString<string>;
|
|
157
157
|
/** Marketing medium, for example: cpc, banner, email */
|
|
@@ -159,29 +159,29 @@ declare const createLinkSchema: z.ZodMiniObject<{
|
|
|
159
159
|
/** Product, slogan, promo code, for example: spring_sale */
|
|
160
160
|
utm_campaign: z.ZodMiniString<string>;
|
|
161
161
|
/** Paid keyword */
|
|
162
|
-
utm_term: z.ZodMiniOptional<z.ZodMiniString<string
|
|
162
|
+
utm_term: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
|
|
163
163
|
/**
|
|
164
164
|
* Use to differentiate creatives. For example, if you have two call-to-action links within the
|
|
165
165
|
* same email message, you can use utm_content and set different values for each so you can tell
|
|
166
166
|
* which version is more effective.
|
|
167
167
|
*/
|
|
168
|
-
utm_content: z.ZodMiniOptional<z.ZodMiniString<string
|
|
168
|
+
utm_content: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
|
|
169
169
|
/**
|
|
170
170
|
* The platform responsible for directing traffic to a given Analytics property (such as a buying
|
|
171
171
|
* platform that sets budgets and targeting criteria or a platform that manages organic traffic
|
|
172
172
|
* data). For example: Search Ads 360 or Display & Video 360.
|
|
173
173
|
*/
|
|
174
|
-
utm_source_platform: z.ZodMiniOptional<z.ZodMiniString<string
|
|
174
|
+
utm_source_platform: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
|
|
175
175
|
/**
|
|
176
176
|
* Type of creative, for example: display, native, video, search, utm_creative_format is not
|
|
177
177
|
* currently reported in Google Analytics 4 properties.
|
|
178
178
|
*/
|
|
179
|
-
utm_creative_format: z.ZodMiniOptional<z.ZodMiniString<string
|
|
179
|
+
utm_creative_format: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
|
|
180
180
|
/**
|
|
181
181
|
* Targeting criteria applied to a campaign, for example: remarketing, prospecting,
|
|
182
182
|
* utm_marketing_tactic is not currently reported in Google Analytics 4 properties.
|
|
183
183
|
* */
|
|
184
|
-
utm_marketing_tactic: z.ZodMiniOptional<z.ZodMiniString<string
|
|
184
|
+
utm_marketing_tactic: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
|
|
185
185
|
}, z.core.$strip>;
|
|
186
186
|
type CreateFeedbackDTO = z.output<typeof createFeedbackSchema>;
|
|
187
187
|
type CreateLinkDTO = z.output<typeof createLinkSchema>;
|
package/dist/schema/index.mjs
CHANGED
|
@@ -178,6 +178,10 @@ var createFeedbackSchema = object({
|
|
|
178
178
|
email: email().check(maxLength(320)),
|
|
179
179
|
message: string().check(minLength(1), maxLength(65536))
|
|
180
180
|
});
|
|
181
|
+
var noEmptyString = pipe(
|
|
182
|
+
string().check(maxLength(256)),
|
|
183
|
+
transform((v) => v ? v : void 0)
|
|
184
|
+
);
|
|
181
185
|
var createLinkSchema = object({
|
|
182
186
|
/** The URL that the user is redirected to. */
|
|
183
187
|
url: url().check(minLength(1), maxLength(1024)),
|
|
@@ -186,7 +190,7 @@ var createLinkSchema = object({
|
|
|
186
190
|
* Campaign ID. Used to identify a specific campaign or promotion. This is a required key for GA4
|
|
187
191
|
* data import. Use the same IDs that you use when uploading campaign cost data.
|
|
188
192
|
*/
|
|
189
|
-
utm_id: optional(
|
|
193
|
+
utm_id: optional(noEmptyString),
|
|
190
194
|
/** Referrer, for example: google, newsletter4, billboard */
|
|
191
195
|
utm_source: string().check(minLength(1), maxLength(256)),
|
|
192
196
|
// required
|
|
@@ -197,29 +201,29 @@ var createLinkSchema = object({
|
|
|
197
201
|
utm_campaign: string().check(minLength(1), maxLength(256)),
|
|
198
202
|
// required
|
|
199
203
|
/** Paid keyword */
|
|
200
|
-
utm_term: optional(
|
|
204
|
+
utm_term: optional(noEmptyString),
|
|
201
205
|
/**
|
|
202
206
|
* Use to differentiate creatives. For example, if you have two call-to-action links within the
|
|
203
207
|
* same email message, you can use utm_content and set different values for each so you can tell
|
|
204
208
|
* which version is more effective.
|
|
205
209
|
*/
|
|
206
|
-
utm_content: optional(
|
|
210
|
+
utm_content: optional(noEmptyString),
|
|
207
211
|
/**
|
|
208
212
|
* The platform responsible for directing traffic to a given Analytics property (such as a buying
|
|
209
213
|
* platform that sets budgets and targeting criteria or a platform that manages organic traffic
|
|
210
214
|
* data). For example: Search Ads 360 or Display & Video 360.
|
|
211
215
|
*/
|
|
212
|
-
utm_source_platform: optional(
|
|
216
|
+
utm_source_platform: optional(noEmptyString),
|
|
213
217
|
/**
|
|
214
218
|
* Type of creative, for example: display, native, video, search, utm_creative_format is not
|
|
215
219
|
* currently reported in Google Analytics 4 properties.
|
|
216
220
|
*/
|
|
217
|
-
utm_creative_format: optional(
|
|
221
|
+
utm_creative_format: optional(noEmptyString),
|
|
218
222
|
/**
|
|
219
223
|
* Targeting criteria applied to a campaign, for example: remarketing, prospecting,
|
|
220
224
|
* utm_marketing_tactic is not currently reported in Google Analytics 4 properties.
|
|
221
225
|
* */
|
|
222
|
-
utm_marketing_tactic: optional(
|
|
226
|
+
utm_marketing_tactic: optional(noEmptyString)
|
|
223
227
|
});
|
|
224
228
|
export {
|
|
225
229
|
createFeedbackSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/schema/index.ts"],"sourcesContent":["import {\n optional,\n object,\n string,\n regex,\n number,\n boolean,\n null as _null,\n coerce,\n enum as _enum,\n trim,\n union,\n record,\n array,\n iso,\n minLength,\n maxLength,\n refine,\n pipe,\n transform,\n email,\n type z,\n uuid,\n url,\n} from 'zod/mini';\n\nconst items = array(\n record(\n string().check(trim(), minLength(1), maxLength(128)),\n union([string().check(maxLength(512)), number(), boolean(), _null()])\n )\n);\n\n/** @deprecated */\nexport const createTrackEventSchemaV1 = array(\n object({\n name: string().check(trim(), minLength(1), maxLength(64)),\n visitor_id: coerce.bigint(),\n timestamp: iso.datetime(),\n tags: object({\n os: optional(string()),\n os_name: optional(string()),\n os_version: optional(string()),\n browser: optional(string()),\n browser_name: optional(string()),\n browser_version: optional(string()),\n platform: optional(_enum(['ios', 'android', 'web', 'macos', 'windows', 'linux', 'unknown'])),\n device: optional(string()),\n device_id: optional(string().check(trim(), minLength(1), maxLength(36))),\n device_type: optional(string()),\n device_vendor: optional(string()),\n device_pixel_ratio: optional(string()),\n screen_resolution: optional(\n pipe(\n string().check(regex(/^\\d+x\\d+$/)),\n transform((v) => v as `${number}x${number}`)\n )\n ),\n release: optional(string()),\n language: optional(string()),\n time_zone: optional(string()),\n environment: optional(_enum(['development', 'production'])),\n source_url: optional(string()),\n source: optional(_enum(['web', 'app', 'offline'])),\n // meta ads\n fbc: optional(string()),\n fbp: optional(string()),\n fbclid: optional(string()),\n ad_id: optional(string()),\n ad_name: optional(string()),\n adset_id: optional(string()),\n adset_name: optional(string()),\n campaign_id: optional(string()),\n campaign_name: optional(string()),\n placement: optional(string()),\n site_source_name: optional(string()),\n // google ads\n gclid: optional(string()),\n gclsrc: optional(string()),\n gad_source: optional(string()),\n gad_campaignid: optional(string()),\n advertising_id: optional(string()),\n // utm params\n utm_source: optional(string()),\n utm_medium: optional(string()),\n utm_campaign: optional(string()),\n utm_term: optional(string()),\n utm_content: optional(string()),\n }),\n properties: optional(\n record(\n string().check(trim(), minLength(1), maxLength(128)),\n union([string().check(maxLength(512)), number(), boolean(), _null(), items])\n ).check(refine((data) => Object.keys(data).length <= 64))\n ),\n })\n).check(minLength(1), maxLength(100));\n\nexport const createTrackEventSchema = array(\n object({\n name: string().check(trim(), minLength(1), maxLength(64)),\n visitor_id: uuid(),\n timestamp: iso.datetime(),\n tags: object({\n os: optional(string()),\n os_name: optional(string()),\n os_version: optional(string()),\n browser: optional(string()),\n browser_name: optional(string()),\n browser_version: optional(string()),\n platform: optional(_enum(['ios', 'android', 'web', 'macos', 'windows', 'linux', 'unknown'])),\n device: optional(string()),\n device_id: optional(string().check(trim(), minLength(1), maxLength(36))),\n device_type: optional(string()),\n device_vendor: optional(string()),\n device_pixel_ratio: optional(string()),\n screen_resolution: optional(\n pipe(\n string().check(regex(/^\\d+x\\d+$/)),\n transform((v) => v as `${number}x${number}`)\n )\n ),\n release: optional(string()),\n language: optional(string()),\n time_zone: optional(string()),\n environment: optional(_enum(['development', 'production'])),\n source_url: optional(string()),\n source: optional(_enum(['web', 'app', 'offline'])),\n // meta ads\n fbc: optional(string()),\n fbp: optional(string()),\n fbclid: optional(string()),\n ad_id: optional(string()),\n ad_name: optional(string()),\n adset_id: optional(string()),\n adset_name: optional(string()),\n campaign_id: optional(string()),\n campaign_name: optional(string()),\n placement: optional(string()),\n site_source_name: optional(string()),\n // google ads\n gclid: optional(string()),\n gclsrc: optional(string()),\n gad_source: optional(string()),\n gad_campaignid: optional(string()),\n advertising_id: optional(string()),\n // utm params\n utm_source: optional(string()),\n utm_medium: optional(string()),\n utm_campaign: optional(string()),\n utm_term: optional(string()),\n utm_content: optional(string()),\n }),\n properties: optional(\n record(\n string().check(trim(), minLength(1), maxLength(128)),\n union([string().check(maxLength(512)), number(), boolean(), _null(), items])\n ).check(refine((data) => Object.keys(data).length <= 64))\n ),\n })\n).check(minLength(1), maxLength(100));\n\nexport const createVisitorSchema = object({\n device_id: string().check(trim(), minLength(1), maxLength(36)),\n properties: optional(\n record(\n string().check(trim(), minLength(1), maxLength(128)),\n union([string().check(maxLength(512)), number(), boolean(), _null()])\n ).check(refine((data) => Object.keys(data).length <= 64))\n ),\n});\n\nexport const updateVisitorSchema = object({\n user_id: optional(uuid()),\n properties: optional(\n record(\n string().check(trim(), minLength(1), maxLength(128)),\n union([string().check(maxLength(512)), number(), boolean(), _null()])\n ).check(refine((data) => Object.keys(data).length <= 64))\n ),\n});\n\nexport const createFeedbackSchema = object({\n name: string().check(minLength(1), maxLength(256)),\n email: email().check(maxLength(320)),\n message: string().check(minLength(1), maxLength(65536)),\n});\n\n/**\n * The schema for creating a link.\n * @see https://support.google.com/analytics/answer/10917952\n * */\nexport const createLinkSchema = object({\n /** The URL that the user is redirected to. */\n url: url().check(minLength(1), maxLength(1024)), // required\n\n /**\n * Campaign ID. Used to identify a specific campaign or promotion. This is a required key for GA4\n * data import. Use the same IDs that you use when uploading campaign cost data.\n */\n utm_id: optional(string().check(maxLength(256))),\n\n /** Referrer, for example: google, newsletter4, billboard */\n utm_source: string().check(minLength(1), maxLength(256)), // required\n\n /** Marketing medium, for example: cpc, banner, email */\n utm_medium: string().check(minLength(1), maxLength(256)), // required\n\n /** Product, slogan, promo code, for example: spring_sale */\n utm_campaign: string().check(minLength(1), maxLength(256)), // required\n\n /** Paid keyword */\n utm_term: optional(string().check(maxLength(256))),\n\n /**\n * Use to differentiate creatives. For example, if you have two call-to-action links within the\n * same email message, you can use utm_content and set different values for each so you can tell\n * which version is more effective.\n */\n utm_content: optional(string().check(maxLength(256))),\n\n /**\n * The platform responsible for directing traffic to a given Analytics property (such as a buying\n * platform that sets budgets and targeting criteria or a platform that manages organic traffic\n * data). For example: Search Ads 360 or Display & Video 360.\n */\n utm_source_platform: optional(string().check(maxLength(256))),\n\n /**\n * Type of creative, for example: display, native, video, search, utm_creative_format is not\n * currently reported in Google Analytics 4 properties.\n */\n utm_creative_format: optional(string().check(maxLength(256))),\n\n /**\n * Targeting criteria applied to a campaign, for example: remarketing, prospecting,\n * utm_marketing_tactic is not currently reported in Google Analytics 4 properties.\n * */\n utm_marketing_tactic: optional(string().check(maxLength(256))),\n});\n\nexport type CreateFeedbackDTO = z.output<typeof createFeedbackSchema>;\nexport type CreateLinkDTO = z.output<typeof createLinkSchema>;\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AAEP,IAAM,QAAQ;AAAA,EACZ;AAAA,IACE,OAAO,EAAE,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,UAAU,GAAG,CAAC;AAAA,IACnD,MAAM,CAAC,OAAO,EAAE,MAAM,UAAU,GAAG,CAAC,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC,CAAC;AAAA,EACtE;AACF;AAGO,IAAM,2BAA2B;AAAA,EACtC,OAAO;AAAA,IACL,MAAM,OAAO,EAAE,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,UAAU,EAAE,CAAC;AAAA,IACxD,YAAY,OAAO,OAAO;AAAA,IAC1B,WAAW,IAAI,SAAS;AAAA,IACxB,MAAM,OAAO;AAAA,MACX,IAAI,SAAS,OAAO,CAAC;AAAA,MACrB,SAAS,SAAS,OAAO,CAAC;AAAA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,UAAU,GAAG,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOpD,qBAAqB,SAAS,OAAO,EAAE,MAAM,UAAU,GAAG,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,EAM5D,qBAAqB,SAAS,OAAO,EAAE,MAAM,UAAU,GAAG,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,EAM5D,sBAAsB,SAAS,OAAO,EAAE,MAAM,UAAU,GAAG,CAAC,CAAC;AAC/D,CAAC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/schema/index.ts"],"sourcesContent":["import {\n optional,\n object,\n string,\n regex,\n number,\n boolean,\n null as _null,\n coerce,\n enum as _enum,\n trim,\n union,\n record,\n array,\n iso,\n minLength,\n maxLength,\n refine,\n pipe,\n transform,\n email,\n type z,\n uuid,\n url,\n} from 'zod/mini';\n\nconst items = array(\n record(\n string().check(trim(), minLength(1), maxLength(128)),\n union([string().check(maxLength(512)), number(), boolean(), _null()])\n )\n);\n\n/** @deprecated */\nexport const createTrackEventSchemaV1 = array(\n object({\n name: string().check(trim(), minLength(1), maxLength(64)),\n visitor_id: coerce.bigint(),\n timestamp: iso.datetime(),\n tags: object({\n os: optional(string()),\n os_name: optional(string()),\n os_version: optional(string()),\n browser: optional(string()),\n browser_name: optional(string()),\n browser_version: optional(string()),\n platform: optional(_enum(['ios', 'android', 'web', 'macos', 'windows', 'linux', 'unknown'])),\n device: optional(string()),\n device_id: optional(string().check(trim(), minLength(1), maxLength(36))),\n device_type: optional(string()),\n device_vendor: optional(string()),\n device_pixel_ratio: optional(string()),\n screen_resolution: optional(\n pipe(\n string().check(regex(/^\\d+x\\d+$/)),\n transform((v) => v as `${number}x${number}`)\n )\n ),\n release: optional(string()),\n language: optional(string()),\n time_zone: optional(string()),\n environment: optional(_enum(['development', 'production'])),\n source_url: optional(string()),\n source: optional(_enum(['web', 'app', 'offline'])),\n // meta ads\n fbc: optional(string()),\n fbp: optional(string()),\n fbclid: optional(string()),\n ad_id: optional(string()),\n ad_name: optional(string()),\n adset_id: optional(string()),\n adset_name: optional(string()),\n campaign_id: optional(string()),\n campaign_name: optional(string()),\n placement: optional(string()),\n site_source_name: optional(string()),\n // google ads\n gclid: optional(string()),\n gclsrc: optional(string()),\n gad_source: optional(string()),\n gad_campaignid: optional(string()),\n advertising_id: optional(string()),\n // utm params\n utm_source: optional(string()),\n utm_medium: optional(string()),\n utm_campaign: optional(string()),\n utm_term: optional(string()),\n utm_content: optional(string()),\n }),\n properties: optional(\n record(\n string().check(trim(), minLength(1), maxLength(128)),\n union([string().check(maxLength(512)), number(), boolean(), _null(), items])\n ).check(refine((data) => Object.keys(data).length <= 64))\n ),\n })\n).check(minLength(1), maxLength(100));\n\nexport const createTrackEventSchema = array(\n object({\n name: string().check(trim(), minLength(1), maxLength(64)),\n visitor_id: uuid(),\n timestamp: iso.datetime(),\n tags: object({\n os: optional(string()),\n os_name: optional(string()),\n os_version: optional(string()),\n browser: optional(string()),\n browser_name: optional(string()),\n browser_version: optional(string()),\n platform: optional(_enum(['ios', 'android', 'web', 'macos', 'windows', 'linux', 'unknown'])),\n device: optional(string()),\n device_id: optional(string().check(trim(), minLength(1), maxLength(36))),\n device_type: optional(string()),\n device_vendor: optional(string()),\n device_pixel_ratio: optional(string()),\n screen_resolution: optional(\n pipe(\n string().check(regex(/^\\d+x\\d+$/)),\n transform((v) => v as `${number}x${number}`)\n )\n ),\n release: optional(string()),\n language: optional(string()),\n time_zone: optional(string()),\n environment: optional(_enum(['development', 'production'])),\n source_url: optional(string()),\n source: optional(_enum(['web', 'app', 'offline'])),\n // meta ads\n fbc: optional(string()),\n fbp: optional(string()),\n fbclid: optional(string()),\n ad_id: optional(string()),\n ad_name: optional(string()),\n adset_id: optional(string()),\n adset_name: optional(string()),\n campaign_id: optional(string()),\n campaign_name: optional(string()),\n placement: optional(string()),\n site_source_name: optional(string()),\n // google ads\n gclid: optional(string()),\n gclsrc: optional(string()),\n gad_source: optional(string()),\n gad_campaignid: optional(string()),\n advertising_id: optional(string()),\n // utm params\n utm_source: optional(string()),\n utm_medium: optional(string()),\n utm_campaign: optional(string()),\n utm_term: optional(string()),\n utm_content: optional(string()),\n }),\n properties: optional(\n record(\n string().check(trim(), minLength(1), maxLength(128)),\n union([string().check(maxLength(512)), number(), boolean(), _null(), items])\n ).check(refine((data) => Object.keys(data).length <= 64))\n ),\n })\n).check(minLength(1), maxLength(100));\n\nexport const createVisitorSchema = object({\n device_id: string().check(trim(), minLength(1), maxLength(36)),\n properties: optional(\n record(\n string().check(trim(), minLength(1), maxLength(128)),\n union([string().check(maxLength(512)), number(), boolean(), _null()])\n ).check(refine((data) => Object.keys(data).length <= 64))\n ),\n});\n\nexport const updateVisitorSchema = object({\n user_id: optional(uuid()),\n properties: optional(\n record(\n string().check(trim(), minLength(1), maxLength(128)),\n union([string().check(maxLength(512)), number(), boolean(), _null()])\n ).check(refine((data) => Object.keys(data).length <= 64))\n ),\n});\n\nexport const createFeedbackSchema = object({\n name: string().check(minLength(1), maxLength(256)),\n email: email().check(maxLength(320)),\n message: string().check(minLength(1), maxLength(65536)),\n});\n\nconst noEmptyString = pipe(\n string().check(maxLength(256)),\n transform((v) => (v ? v : undefined))\n);\n\n/**\n * The schema for creating a link.\n * @see https://support.google.com/analytics/answer/10917952\n * */\nexport const createLinkSchema = object({\n /** The URL that the user is redirected to. */\n url: url().check(minLength(1), maxLength(1024)), // required\n\n /**\n * Campaign ID. Used to identify a specific campaign or promotion. This is a required key for GA4\n * data import. Use the same IDs that you use when uploading campaign cost data.\n */\n utm_id: optional(noEmptyString),\n\n /** Referrer, for example: google, newsletter4, billboard */\n utm_source: string().check(minLength(1), maxLength(256)), // required\n\n /** Marketing medium, for example: cpc, banner, email */\n utm_medium: string().check(minLength(1), maxLength(256)), // required\n\n /** Product, slogan, promo code, for example: spring_sale */\n utm_campaign: string().check(minLength(1), maxLength(256)), // required\n\n /** Paid keyword */\n utm_term: optional(noEmptyString),\n\n /**\n * Use to differentiate creatives. For example, if you have two call-to-action links within the\n * same email message, you can use utm_content and set different values for each so you can tell\n * which version is more effective.\n */\n utm_content: optional(noEmptyString),\n\n /**\n * The platform responsible for directing traffic to a given Analytics property (such as a buying\n * platform that sets budgets and targeting criteria or a platform that manages organic traffic\n * data). For example: Search Ads 360 or Display & Video 360.\n */\n utm_source_platform: optional(noEmptyString),\n\n /**\n * Type of creative, for example: display, native, video, search, utm_creative_format is not\n * currently reported in Google Analytics 4 properties.\n */\n utm_creative_format: optional(noEmptyString),\n\n /**\n * Targeting criteria applied to a campaign, for example: remarketing, prospecting,\n * utm_marketing_tactic is not currently reported in Google Analytics 4 properties.\n * */\n utm_marketing_tactic: optional(noEmptyString),\n});\n\nexport type CreateFeedbackDTO = z.output<typeof createFeedbackSchema>;\nexport type CreateLinkDTO = z.output<typeof createLinkSchema>;\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AAEP,IAAM,QAAQ;AAAA,EACZ;AAAA,IACE,OAAO,EAAE,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,UAAU,GAAG,CAAC;AAAA,IACnD,MAAM,CAAC,OAAO,EAAE,MAAM,UAAU,GAAG,CAAC,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC,CAAC;AAAA,EACtE;AACF;AAGO,IAAM,2BAA2B;AAAA,EACtC,OAAO;AAAA,IACL,MAAM,OAAO,EAAE,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,UAAU,EAAE,CAAC;AAAA,IACxD,YAAY,OAAO,OAAO;AAAA,IAC1B,WAAW,IAAI,SAAS;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