@shware/analytics 2.15.3 → 2.15.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +8 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +8 -0
- package/dist/index.mjs.map +1 -1
- package/dist/schema/index.cjs +35 -2
- package/dist/schema/index.cjs.map +1 -1
- package/dist/schema/index.d.cts +22 -40
- package/dist/schema/index.d.ts +22 -40
- package/dist/schema/index.mjs +31 -2
- package/dist/schema/index.mjs.map +1 -1
- package/dist/track/types.cjs.map +1 -1
- package/dist/track/types.d.cts +2 -2
- package/dist/track/types.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -20,6 +20,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
+
ALL_ENVIRONMENTS: () => import_schema.ALL_ENVIRONMENTS,
|
|
24
|
+
ALL_PLATFORMS: () => import_schema.ALL_PLATFORMS,
|
|
25
|
+
Environment: () => import_schema.Environment,
|
|
26
|
+
Platform: () => import_schema.Platform,
|
|
23
27
|
createFeedbackSchema: () => import_schema.createFeedbackSchema,
|
|
24
28
|
createLink: () => import_link.createLink,
|
|
25
29
|
createLinkSchema: () => import_schema.createLinkSchema,
|
|
@@ -46,6 +50,10 @@ var import_schema = require("./schema/index.cjs");
|
|
|
46
50
|
var import_stripe = require("./utils/stripe.cjs");
|
|
47
51
|
// Annotate the CommonJS export names for ESM import in node:
|
|
48
52
|
0 && (module.exports = {
|
|
53
|
+
ALL_ENVIRONMENTS,
|
|
54
|
+
ALL_PLATFORMS,
|
|
55
|
+
Environment,
|
|
56
|
+
Platform,
|
|
49
57
|
createFeedbackSchema,
|
|
50
58
|
createLink,
|
|
51
59
|
createLinkSchema,
|
package/dist/index.cjs.map
CHANGED
|
@@ -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 { sendFeedback } from './feedback/index';\nexport { createLink, getLink, type Link } from './link/index';\nexport {\n createTrackEventSchemaV1,\n createTrackEventSchema,\n createVisitorSchema,\n updateVisitorSchema,\n createFeedbackSchema,\n createLinkSchema,\n type CreateFeedbackDTO,\n type CreateLinkDTO,\n} from './schema/index';\nexport { stripeMinorUnits } from './utils/stripe';\n\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA+B;AAC/B,mBAAkC;AAClC,qBAAuC;AACvC,sBAA6B;AAC7B,kBAA+C;AAC/C,
|
|
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 { sendFeedback } from './feedback/index';\nexport { createLink, getLink, type Link } from './link/index';\nexport {\n Platform,\n Environment,\n ALL_PLATFORMS,\n ALL_ENVIRONMENTS,\n createTrackEventSchemaV1,\n createTrackEventSchema,\n createVisitorSchema,\n updateVisitorSchema,\n createFeedbackSchema,\n createLinkSchema,\n type CreateFeedbackDTO,\n type CreateLinkDTO,\n} from './schema/index';\nexport { stripeMinorUnits } from './utils/stripe';\n\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA+B;AAC/B,mBAAkC;AAClC,qBAAuC;AACvC,sBAA6B;AAC7B,kBAA+C;AAC/C,oBAaO;AACP,oBAAiC;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -3,7 +3,7 @@ export { track, trackAsync } from './track/index.cjs';
|
|
|
3
3
|
export { getVisitor, setVisitor } from './visitor/index.cjs';
|
|
4
4
|
export { sendFeedback } from './feedback/index.cjs';
|
|
5
5
|
export { Link, createLink, getLink } from './link/index.cjs';
|
|
6
|
-
export { CreateFeedbackDTO, CreateLinkDTO, createFeedbackSchema, createLinkSchema, createTrackEventSchema, createTrackEventSchemaV1, createVisitorSchema, updateVisitorSchema } from './schema/index.cjs';
|
|
6
|
+
export { ALL_ENVIRONMENTS, ALL_PLATFORMS, CreateFeedbackDTO, CreateLinkDTO, Environment, Platform, createFeedbackSchema, createLinkSchema, createTrackEventSchema, createTrackEventSchemaV1, createVisitorSchema, updateVisitorSchema } from './schema/index.cjs';
|
|
7
7
|
export { stripeMinorUnits } from './utils/stripe.cjs';
|
|
8
8
|
export { AllowedPropertyValues, TrackProperties, TrackTags, UserProvidedData } from './track/types.cjs';
|
|
9
9
|
export { VisitorProperties } from './visitor/types.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { track, trackAsync } from './track/index.js';
|
|
|
3
3
|
export { getVisitor, setVisitor } from './visitor/index.js';
|
|
4
4
|
export { sendFeedback } from './feedback/index.js';
|
|
5
5
|
export { Link, createLink, getLink } from './link/index.js';
|
|
6
|
-
export { CreateFeedbackDTO, CreateLinkDTO, createFeedbackSchema, createLinkSchema, createTrackEventSchema, createTrackEventSchemaV1, createVisitorSchema, updateVisitorSchema } from './schema/index.js';
|
|
6
|
+
export { ALL_ENVIRONMENTS, ALL_PLATFORMS, CreateFeedbackDTO, CreateLinkDTO, Environment, Platform, createFeedbackSchema, createLinkSchema, createTrackEventSchema, createTrackEventSchemaV1, createVisitorSchema, updateVisitorSchema } from './schema/index.js';
|
|
7
7
|
export { stripeMinorUnits } from './utils/stripe.js';
|
|
8
8
|
export { AllowedPropertyValues, TrackProperties, TrackTags, UserProvidedData } from './track/types.js';
|
|
9
9
|
export { VisitorProperties } from './visitor/types.js';
|
package/dist/index.mjs
CHANGED
|
@@ -5,6 +5,10 @@ import { getVisitor, setVisitor } from "./visitor/index.mjs";
|
|
|
5
5
|
import { sendFeedback } from "./feedback/index.mjs";
|
|
6
6
|
import { createLink, getLink } from "./link/index.mjs";
|
|
7
7
|
import {
|
|
8
|
+
Platform,
|
|
9
|
+
Environment,
|
|
10
|
+
ALL_PLATFORMS,
|
|
11
|
+
ALL_ENVIRONMENTS,
|
|
8
12
|
createTrackEventSchemaV1,
|
|
9
13
|
createTrackEventSchema,
|
|
10
14
|
createVisitorSchema,
|
|
@@ -14,6 +18,10 @@ import {
|
|
|
14
18
|
} from "./schema/index.mjs";
|
|
15
19
|
import { stripeMinorUnits } from "./utils/stripe.mjs";
|
|
16
20
|
export {
|
|
21
|
+
ALL_ENVIRONMENTS,
|
|
22
|
+
ALL_PLATFORMS,
|
|
23
|
+
Environment,
|
|
24
|
+
Platform,
|
|
17
25
|
createFeedbackSchema,
|
|
18
26
|
createLink,
|
|
19
27
|
createLinkSchema,
|
package/dist/index.mjs.map
CHANGED
|
@@ -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 { sendFeedback } from './feedback/index';\nexport { createLink, getLink, type Link } from './link/index';\nexport {\n createTrackEventSchemaV1,\n createTrackEventSchema,\n createVisitorSchema,\n updateVisitorSchema,\n createFeedbackSchema,\n createLinkSchema,\n type CreateFeedbackDTO,\n type CreateLinkDTO,\n} from './schema/index';\nexport { stripeMinorUnits } from './utils/stripe';\n\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,oBAAoB;AAC7B,SAAS,YAAY,eAA0B;AAC/C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,wBAAwB;","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 { sendFeedback } from './feedback/index';\nexport { createLink, getLink, type Link } from './link/index';\nexport {\n Platform,\n Environment,\n ALL_PLATFORMS,\n ALL_ENVIRONMENTS,\n createTrackEventSchemaV1,\n createTrackEventSchema,\n createVisitorSchema,\n updateVisitorSchema,\n createFeedbackSchema,\n createLinkSchema,\n type CreateFeedbackDTO,\n type CreateLinkDTO,\n} from './schema/index';\nexport { stripeMinorUnits } from './utils/stripe';\n\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,oBAAoB;AAC7B,SAAS,YAAY,eAA0B;AAC/C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,wBAAwB;","names":[]}
|
package/dist/schema/index.cjs
CHANGED
|
@@ -20,6 +20,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/schema/index.ts
|
|
21
21
|
var schema_exports = {};
|
|
22
22
|
__export(schema_exports, {
|
|
23
|
+
ALL_ENVIRONMENTS: () => ALL_ENVIRONMENTS,
|
|
24
|
+
ALL_PLATFORMS: () => ALL_PLATFORMS,
|
|
25
|
+
Environment: () => Environment,
|
|
26
|
+
Platform: () => Platform,
|
|
23
27
|
createFeedbackSchema: () => createFeedbackSchema,
|
|
24
28
|
createLinkSchema: () => createLinkSchema,
|
|
25
29
|
createTrackEventSchema: () => createTrackEventSchema,
|
|
@@ -37,6 +41,31 @@ var items = (0, import_mini.array)(
|
|
|
37
41
|
(0, import_mini.union)([(0, import_mini.string)().check((0, import_mini.maxLength)(512)), (0, import_mini.number)(), (0, import_mini.boolean)(), (0, import_mini.null)()])
|
|
38
42
|
)
|
|
39
43
|
);
|
|
44
|
+
var Platform = /* @__PURE__ */ ((Platform2) => {
|
|
45
|
+
Platform2["ios"] = "ios";
|
|
46
|
+
Platform2["android"] = "android";
|
|
47
|
+
Platform2["web"] = "web";
|
|
48
|
+
Platform2["macos"] = "macos";
|
|
49
|
+
Platform2["windows"] = "windows";
|
|
50
|
+
Platform2["linux"] = "linux";
|
|
51
|
+
Platform2["unknown"] = "unknown";
|
|
52
|
+
return Platform2;
|
|
53
|
+
})(Platform || {});
|
|
54
|
+
var Environment = /* @__PURE__ */ ((Environment2) => {
|
|
55
|
+
Environment2["development"] = "development";
|
|
56
|
+
Environment2["production"] = "production";
|
|
57
|
+
return Environment2;
|
|
58
|
+
})(Environment || {});
|
|
59
|
+
var ALL_PLATFORMS = [
|
|
60
|
+
"ios" /* ios */,
|
|
61
|
+
"android" /* android */,
|
|
62
|
+
"web" /* web */,
|
|
63
|
+
"macos" /* macos */,
|
|
64
|
+
"windows" /* windows */,
|
|
65
|
+
"linux" /* linux */,
|
|
66
|
+
"unknown" /* unknown */
|
|
67
|
+
];
|
|
68
|
+
var ALL_ENVIRONMENTS = ["development" /* development */, "production" /* production */];
|
|
40
69
|
var tagsSchema = (0, import_mini.object)({
|
|
41
70
|
os: (0, import_mini.optional)((0, import_mini.string)()),
|
|
42
71
|
os_name: (0, import_mini.optional)((0, import_mini.string)()),
|
|
@@ -44,7 +73,7 @@ var tagsSchema = (0, import_mini.object)({
|
|
|
44
73
|
browser: (0, import_mini.optional)((0, import_mini.string)()),
|
|
45
74
|
browser_name: (0, import_mini.optional)((0, import_mini.string)()),
|
|
46
75
|
browser_version: (0, import_mini.optional)((0, import_mini.string)()),
|
|
47
|
-
platform: (0, import_mini.
|
|
76
|
+
platform: (0, import_mini.enum)(Platform),
|
|
48
77
|
device: (0, import_mini.optional)((0, import_mini.string)()),
|
|
49
78
|
device_id: (0, import_mini.optional)((0, import_mini.string)().check((0, import_mini.trim)(), (0, import_mini.minLength)(1), (0, import_mini.maxLength)(36))),
|
|
50
79
|
device_type: (0, import_mini.optional)((0, import_mini.string)()),
|
|
@@ -61,7 +90,7 @@ var tagsSchema = (0, import_mini.object)({
|
|
|
61
90
|
release: (0, import_mini.optional)((0, import_mini.string)()),
|
|
62
91
|
language: (0, import_mini.optional)((0, import_mini.string)()),
|
|
63
92
|
time_zone: (0, import_mini.optional)((0, import_mini.string)()),
|
|
64
|
-
environment: (0, import_mini.
|
|
93
|
+
environment: (0, import_mini.enum)(Environment),
|
|
65
94
|
source_url: (0, import_mini.optional)((0, import_mini.string)()),
|
|
66
95
|
source: (0, import_mini.optional)((0, import_mini.enum)(["web", "app", "offline"])),
|
|
67
96
|
// app info
|
|
@@ -207,6 +236,10 @@ var createLinkSchema = (0, import_mini.object)({
|
|
|
207
236
|
});
|
|
208
237
|
// Annotate the CommonJS export names for ESM import in node:
|
|
209
238
|
0 && (module.exports = {
|
|
239
|
+
ALL_ENVIRONMENTS,
|
|
240
|
+
ALL_PLATFORMS,
|
|
241
|
+
Environment,
|
|
242
|
+
Platform,
|
|
210
243
|
createFeedbackSchema,
|
|
211
244
|
createLinkSchema,
|
|
212
245
|
createTrackEventSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/schema/index.ts"],"sourcesContent":["import {\n enum as _enum,\n null as _null,\n array,\n boolean,\n coerce,\n email,\n iso,\n maxLength,\n minLength,\n number,\n object,\n optional,\n pipe,\n record,\n refine,\n regex,\n string,\n transform,\n trim,\n union,\n url,\n uuid,\n type z,\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\nexport const tagsSchema = 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(number()),\n screen_width: optional(number()),\n screen_height: optional(number()),\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 // app info\n advertising_id: optional(string()),\n install_referrer: optional(string()),\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 // reddit ads\n rdt_cid: optional(string()),\n rdt_uuid: optional(string()),\n // click ids\n dclid: optional(string()),\n ko_click_id: optional(string()),\n li_fat_id: optional(string()),\n msclkid: optional(string()),\n sccid: optional(string()),\n ttclid: optional(string()),\n twclid: optional(string()),\n wbraid: optional(string()),\n yclid: 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 utm_id: optional(string()),\n utm_source_platform: optional(string()),\n utm_creative_format: optional(string()),\n utm_marketing_tactic: optional(string()),\n});\n\nexport const propertiesSchema = 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/** @deprecated */\nexport const createTrackEventSchemaV1 = array(\n object({\n name: string().check(trim(), minLength(1), maxLength(64)),\n visitor_id: coerce.bigint(),\n session_id: uuid(),\n timestamp: iso.datetime(),\n tags: tagsSchema,\n properties: propertiesSchema,\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 session_id: uuid(),\n timestamp: iso.datetime(),\n tags: tagsSchema,\n properties: propertiesSchema,\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 distinct_id: optional(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 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;AAAA;AAAA,kBAwBO;AAEP,IAAM,YAAQ;AAAA,MACZ;AAAA,QACE,oBAAO,EAAE,UAAM,kBAAK,O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GAAG,CAAC;AAAA,EACjD,WAAO,mBAAM,EAAE,UAAM,uBAAU,GAAG,CAAC;AAAA,EACnC,aAAS,oBAAO,EAAE,UAAM,uBAAU,CAAC,OAAG,uBAAU,KAAK,CAAC;AACxD,CAAC;AAED,IAAM,oBAAgB;AAAA,MACpB,oBAAO,EAAE,UAAM,uBAAU,GAAG,CAAC;AAAA,MAC7B,uBAAU,CAAC,MAAO,IAAI,IAAI,MAAU;AACtC;AAMO,IAAM,uBAAmB,oBAAO;AAAA;AAAA,EAErC,SAAK,iBAAI,EAAE,UAAM,uBAAU,CAAC,OAAG,uBAAU,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM9C,YAAQ,sBAAS,aAAa;AAAA;AAAA,EAG9B,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,sBAAS,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOhC,iBAAa,sBAAS,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOnC,yBAAqB,sBAAS,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA,EAM3C,yBAAqB,sBAAS,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA,EAM3C,0BAAsB,sBAAS,aAAa;AAC9C,CAAC;","names":["_null","_enum"]}
|
|
1
|
+
{"version":3,"sources":["../../src/schema/index.ts"],"sourcesContent":["import {\n enum as _enum,\n null as _null,\n array,\n boolean,\n coerce,\n email,\n iso,\n maxLength,\n minLength,\n number,\n object,\n optional,\n pipe,\n record,\n refine,\n regex,\n string,\n transform,\n trim,\n union,\n url,\n uuid,\n type z,\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\nexport enum Platform {\n ios = 'ios',\n android = 'android',\n web = 'web',\n macos = 'macos',\n windows = 'windows',\n linux = 'linux',\n unknown = 'unknown',\n}\n\nexport enum Environment {\n development = 'development',\n production = 'production',\n}\n\nexport const ALL_PLATFORMS = [\n Platform.ios,\n Platform.android,\n Platform.web,\n Platform.macos,\n Platform.windows,\n Platform.linux,\n Platform.unknown,\n] as const;\n\nexport const ALL_ENVIRONMENTS = [Environment.development, Environment.production] as const;\n\nexport const tagsSchema = 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: _enum(Platform),\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(number()),\n screen_width: optional(number()),\n screen_height: optional(number()),\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: _enum(Environment),\n source_url: optional(string()),\n source: optional(_enum(['web', 'app', 'offline'])),\n // app info\n advertising_id: optional(string()),\n install_referrer: optional(string()),\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 // reddit ads\n rdt_cid: optional(string()),\n rdt_uuid: optional(string()),\n // click ids\n dclid: optional(string()),\n ko_click_id: optional(string()),\n li_fat_id: optional(string()),\n msclkid: optional(string()),\n sccid: optional(string()),\n ttclid: optional(string()),\n twclid: optional(string()),\n wbraid: optional(string()),\n yclid: 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 utm_id: optional(string()),\n utm_source_platform: optional(string()),\n utm_creative_format: optional(string()),\n utm_marketing_tactic: optional(string()),\n});\n\nexport const propertiesSchema = 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/** @deprecated */\nexport const createTrackEventSchemaV1 = array(\n object({\n name: string().check(trim(), minLength(1), maxLength(64)),\n visitor_id: coerce.bigint(),\n session_id: uuid(),\n timestamp: iso.datetime(),\n tags: tagsSchema,\n properties: propertiesSchema,\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 session_id: uuid(),\n timestamp: iso.datetime(),\n tags: tagsSchema,\n properties: propertiesSchema,\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 distinct_id: optional(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 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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAwBO;AAEP,IAAM,YAAQ;AAAA,MACZ;AAAA,QACE,oBAAO,EAAE,UAAM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AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOnC,yBAAqB,sBAAS,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA,EAM3C,yBAAqB,sBAAS,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA,EAM3C,0BAAsB,sBAAS,aAAa;AAC9C,CAAC;","names":["_null","Platform","Environment","_enum"]}
|
package/dist/schema/index.d.cts
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import { z, iso } from 'zod/mini';
|
|
2
2
|
|
|
3
|
+
declare enum Platform {
|
|
4
|
+
ios = "ios",
|
|
5
|
+
android = "android",
|
|
6
|
+
web = "web",
|
|
7
|
+
macos = "macos",
|
|
8
|
+
windows = "windows",
|
|
9
|
+
linux = "linux",
|
|
10
|
+
unknown = "unknown"
|
|
11
|
+
}
|
|
12
|
+
declare enum Environment {
|
|
13
|
+
development = "development",
|
|
14
|
+
production = "production"
|
|
15
|
+
}
|
|
16
|
+
declare const ALL_PLATFORMS: readonly [Platform.ios, Platform.android, Platform.web, Platform.macos, Platform.windows, Platform.linux, Platform.unknown];
|
|
17
|
+
declare const ALL_ENVIRONMENTS: readonly [Environment.development, Environment.production];
|
|
3
18
|
declare const tagsSchema: z.ZodMiniObject<{
|
|
4
19
|
os: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
5
20
|
os_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
@@ -7,15 +22,7 @@ declare const tagsSchema: z.ZodMiniObject<{
|
|
|
7
22
|
browser: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
8
23
|
browser_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
9
24
|
browser_version: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
10
|
-
platform: z.
|
|
11
|
-
ios: "ios";
|
|
12
|
-
android: "android";
|
|
13
|
-
web: "web";
|
|
14
|
-
macos: "macos";
|
|
15
|
-
windows: "windows";
|
|
16
|
-
linux: "linux";
|
|
17
|
-
unknown: "unknown";
|
|
18
|
-
}>>;
|
|
25
|
+
platform: z.ZodMiniEnum<typeof Platform>;
|
|
19
26
|
device: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
20
27
|
device_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
21
28
|
device_type: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
@@ -27,10 +34,7 @@ declare const tagsSchema: z.ZodMiniObject<{
|
|
|
27
34
|
release: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
28
35
|
language: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
29
36
|
time_zone: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
30
|
-
environment: z.
|
|
31
|
-
development: "development";
|
|
32
|
-
production: "production";
|
|
33
|
-
}>>;
|
|
37
|
+
environment: z.ZodMiniEnum<typeof Environment>;
|
|
34
38
|
source_url: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
35
39
|
source: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
36
40
|
web: "web";
|
|
@@ -89,15 +93,7 @@ declare const createTrackEventSchemaV1: z.ZodMiniArray<z.ZodMiniObject<{
|
|
|
89
93
|
browser: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
90
94
|
browser_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
91
95
|
browser_version: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
92
|
-
platform: z.
|
|
93
|
-
ios: "ios";
|
|
94
|
-
android: "android";
|
|
95
|
-
web: "web";
|
|
96
|
-
macos: "macos";
|
|
97
|
-
windows: "windows";
|
|
98
|
-
linux: "linux";
|
|
99
|
-
unknown: "unknown";
|
|
100
|
-
}>>;
|
|
96
|
+
platform: z.ZodMiniEnum<typeof Platform>;
|
|
101
97
|
device: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
102
98
|
device_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
103
99
|
device_type: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
@@ -109,10 +105,7 @@ declare const createTrackEventSchemaV1: z.ZodMiniArray<z.ZodMiniObject<{
|
|
|
109
105
|
release: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
110
106
|
language: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
111
107
|
time_zone: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
112
|
-
environment: z.
|
|
113
|
-
development: "development";
|
|
114
|
-
production: "production";
|
|
115
|
-
}>>;
|
|
108
|
+
environment: z.ZodMiniEnum<typeof Environment>;
|
|
116
109
|
source_url: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
117
110
|
source: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
118
111
|
web: "web";
|
|
@@ -171,15 +164,7 @@ declare const createTrackEventSchema: z.ZodMiniArray<z.ZodMiniObject<{
|
|
|
171
164
|
browser: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
172
165
|
browser_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
173
166
|
browser_version: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
174
|
-
platform: z.
|
|
175
|
-
ios: "ios";
|
|
176
|
-
android: "android";
|
|
177
|
-
web: "web";
|
|
178
|
-
macos: "macos";
|
|
179
|
-
windows: "windows";
|
|
180
|
-
linux: "linux";
|
|
181
|
-
unknown: "unknown";
|
|
182
|
-
}>>;
|
|
167
|
+
platform: z.ZodMiniEnum<typeof Platform>;
|
|
183
168
|
device: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
184
169
|
device_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
185
170
|
device_type: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
@@ -191,10 +176,7 @@ declare const createTrackEventSchema: z.ZodMiniArray<z.ZodMiniObject<{
|
|
|
191
176
|
release: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
192
177
|
language: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
193
178
|
time_zone: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
194
|
-
environment: z.
|
|
195
|
-
development: "development";
|
|
196
|
-
production: "production";
|
|
197
|
-
}>>;
|
|
179
|
+
environment: z.ZodMiniEnum<typeof Environment>;
|
|
198
180
|
source_url: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
199
181
|
source: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
200
182
|
web: "web";
|
|
@@ -301,4 +283,4 @@ declare const createLinkSchema: z.ZodMiniObject<{
|
|
|
301
283
|
type CreateFeedbackDTO = z.output<typeof createFeedbackSchema>;
|
|
302
284
|
type CreateLinkDTO = z.output<typeof createLinkSchema>;
|
|
303
285
|
|
|
304
|
-
export { type CreateFeedbackDTO, type CreateLinkDTO, createFeedbackSchema, createLinkSchema, createTrackEventSchema, createTrackEventSchemaV1, createVisitorSchema, propertiesSchema, tagsSchema, updateVisitorSchema };
|
|
286
|
+
export { ALL_ENVIRONMENTS, ALL_PLATFORMS, type CreateFeedbackDTO, type CreateLinkDTO, Environment, Platform, createFeedbackSchema, createLinkSchema, createTrackEventSchema, createTrackEventSchemaV1, createVisitorSchema, propertiesSchema, tagsSchema, updateVisitorSchema };
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import { z, iso } from 'zod/mini';
|
|
2
2
|
|
|
3
|
+
declare enum Platform {
|
|
4
|
+
ios = "ios",
|
|
5
|
+
android = "android",
|
|
6
|
+
web = "web",
|
|
7
|
+
macos = "macos",
|
|
8
|
+
windows = "windows",
|
|
9
|
+
linux = "linux",
|
|
10
|
+
unknown = "unknown"
|
|
11
|
+
}
|
|
12
|
+
declare enum Environment {
|
|
13
|
+
development = "development",
|
|
14
|
+
production = "production"
|
|
15
|
+
}
|
|
16
|
+
declare const ALL_PLATFORMS: readonly [Platform.ios, Platform.android, Platform.web, Platform.macos, Platform.windows, Platform.linux, Platform.unknown];
|
|
17
|
+
declare const ALL_ENVIRONMENTS: readonly [Environment.development, Environment.production];
|
|
3
18
|
declare const tagsSchema: z.ZodMiniObject<{
|
|
4
19
|
os: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
5
20
|
os_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
@@ -7,15 +22,7 @@ declare const tagsSchema: z.ZodMiniObject<{
|
|
|
7
22
|
browser: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
8
23
|
browser_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
9
24
|
browser_version: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
10
|
-
platform: z.
|
|
11
|
-
ios: "ios";
|
|
12
|
-
android: "android";
|
|
13
|
-
web: "web";
|
|
14
|
-
macos: "macos";
|
|
15
|
-
windows: "windows";
|
|
16
|
-
linux: "linux";
|
|
17
|
-
unknown: "unknown";
|
|
18
|
-
}>>;
|
|
25
|
+
platform: z.ZodMiniEnum<typeof Platform>;
|
|
19
26
|
device: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
20
27
|
device_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
21
28
|
device_type: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
@@ -27,10 +34,7 @@ declare const tagsSchema: z.ZodMiniObject<{
|
|
|
27
34
|
release: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
28
35
|
language: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
29
36
|
time_zone: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
30
|
-
environment: z.
|
|
31
|
-
development: "development";
|
|
32
|
-
production: "production";
|
|
33
|
-
}>>;
|
|
37
|
+
environment: z.ZodMiniEnum<typeof Environment>;
|
|
34
38
|
source_url: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
35
39
|
source: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
36
40
|
web: "web";
|
|
@@ -89,15 +93,7 @@ declare const createTrackEventSchemaV1: z.ZodMiniArray<z.ZodMiniObject<{
|
|
|
89
93
|
browser: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
90
94
|
browser_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
91
95
|
browser_version: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
92
|
-
platform: z.
|
|
93
|
-
ios: "ios";
|
|
94
|
-
android: "android";
|
|
95
|
-
web: "web";
|
|
96
|
-
macos: "macos";
|
|
97
|
-
windows: "windows";
|
|
98
|
-
linux: "linux";
|
|
99
|
-
unknown: "unknown";
|
|
100
|
-
}>>;
|
|
96
|
+
platform: z.ZodMiniEnum<typeof Platform>;
|
|
101
97
|
device: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
102
98
|
device_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
103
99
|
device_type: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
@@ -109,10 +105,7 @@ declare const createTrackEventSchemaV1: z.ZodMiniArray<z.ZodMiniObject<{
|
|
|
109
105
|
release: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
110
106
|
language: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
111
107
|
time_zone: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
112
|
-
environment: z.
|
|
113
|
-
development: "development";
|
|
114
|
-
production: "production";
|
|
115
|
-
}>>;
|
|
108
|
+
environment: z.ZodMiniEnum<typeof Environment>;
|
|
116
109
|
source_url: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
117
110
|
source: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
118
111
|
web: "web";
|
|
@@ -171,15 +164,7 @@ declare const createTrackEventSchema: z.ZodMiniArray<z.ZodMiniObject<{
|
|
|
171
164
|
browser: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
172
165
|
browser_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
173
166
|
browser_version: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
174
|
-
platform: z.
|
|
175
|
-
ios: "ios";
|
|
176
|
-
android: "android";
|
|
177
|
-
web: "web";
|
|
178
|
-
macos: "macos";
|
|
179
|
-
windows: "windows";
|
|
180
|
-
linux: "linux";
|
|
181
|
-
unknown: "unknown";
|
|
182
|
-
}>>;
|
|
167
|
+
platform: z.ZodMiniEnum<typeof Platform>;
|
|
183
168
|
device: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
184
169
|
device_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
185
170
|
device_type: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
@@ -191,10 +176,7 @@ declare const createTrackEventSchema: z.ZodMiniArray<z.ZodMiniObject<{
|
|
|
191
176
|
release: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
192
177
|
language: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
193
178
|
time_zone: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
194
|
-
environment: z.
|
|
195
|
-
development: "development";
|
|
196
|
-
production: "production";
|
|
197
|
-
}>>;
|
|
179
|
+
environment: z.ZodMiniEnum<typeof Environment>;
|
|
198
180
|
source_url: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
199
181
|
source: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
200
182
|
web: "web";
|
|
@@ -301,4 +283,4 @@ declare const createLinkSchema: z.ZodMiniObject<{
|
|
|
301
283
|
type CreateFeedbackDTO = z.output<typeof createFeedbackSchema>;
|
|
302
284
|
type CreateLinkDTO = z.output<typeof createLinkSchema>;
|
|
303
285
|
|
|
304
|
-
export { type CreateFeedbackDTO, type CreateLinkDTO, createFeedbackSchema, createLinkSchema, createTrackEventSchema, createTrackEventSchemaV1, createVisitorSchema, propertiesSchema, tagsSchema, updateVisitorSchema };
|
|
286
|
+
export { ALL_ENVIRONMENTS, ALL_PLATFORMS, type CreateFeedbackDTO, type CreateLinkDTO, Environment, Platform, createFeedbackSchema, createLinkSchema, createTrackEventSchema, createTrackEventSchemaV1, createVisitorSchema, propertiesSchema, tagsSchema, updateVisitorSchema };
|
package/dist/schema/index.mjs
CHANGED
|
@@ -29,6 +29,31 @@ var items = array(
|
|
|
29
29
|
union([string().check(maxLength(512)), number(), boolean(), _null()])
|
|
30
30
|
)
|
|
31
31
|
);
|
|
32
|
+
var Platform = /* @__PURE__ */ ((Platform2) => {
|
|
33
|
+
Platform2["ios"] = "ios";
|
|
34
|
+
Platform2["android"] = "android";
|
|
35
|
+
Platform2["web"] = "web";
|
|
36
|
+
Platform2["macos"] = "macos";
|
|
37
|
+
Platform2["windows"] = "windows";
|
|
38
|
+
Platform2["linux"] = "linux";
|
|
39
|
+
Platform2["unknown"] = "unknown";
|
|
40
|
+
return Platform2;
|
|
41
|
+
})(Platform || {});
|
|
42
|
+
var Environment = /* @__PURE__ */ ((Environment2) => {
|
|
43
|
+
Environment2["development"] = "development";
|
|
44
|
+
Environment2["production"] = "production";
|
|
45
|
+
return Environment2;
|
|
46
|
+
})(Environment || {});
|
|
47
|
+
var ALL_PLATFORMS = [
|
|
48
|
+
"ios" /* ios */,
|
|
49
|
+
"android" /* android */,
|
|
50
|
+
"web" /* web */,
|
|
51
|
+
"macos" /* macos */,
|
|
52
|
+
"windows" /* windows */,
|
|
53
|
+
"linux" /* linux */,
|
|
54
|
+
"unknown" /* unknown */
|
|
55
|
+
];
|
|
56
|
+
var ALL_ENVIRONMENTS = ["development" /* development */, "production" /* production */];
|
|
32
57
|
var tagsSchema = object({
|
|
33
58
|
os: optional(string()),
|
|
34
59
|
os_name: optional(string()),
|
|
@@ -36,7 +61,7 @@ var tagsSchema = object({
|
|
|
36
61
|
browser: optional(string()),
|
|
37
62
|
browser_name: optional(string()),
|
|
38
63
|
browser_version: optional(string()),
|
|
39
|
-
platform:
|
|
64
|
+
platform: _enum(Platform),
|
|
40
65
|
device: optional(string()),
|
|
41
66
|
device_id: optional(string().check(trim(), minLength(1), maxLength(36))),
|
|
42
67
|
device_type: optional(string()),
|
|
@@ -53,7 +78,7 @@ var tagsSchema = object({
|
|
|
53
78
|
release: optional(string()),
|
|
54
79
|
language: optional(string()),
|
|
55
80
|
time_zone: optional(string()),
|
|
56
|
-
environment:
|
|
81
|
+
environment: _enum(Environment),
|
|
57
82
|
source_url: optional(string()),
|
|
58
83
|
source: optional(_enum(["web", "app", "offline"])),
|
|
59
84
|
// app info
|
|
@@ -198,6 +223,10 @@ var createLinkSchema = object({
|
|
|
198
223
|
utm_marketing_tactic: optional(noEmptyString)
|
|
199
224
|
});
|
|
200
225
|
export {
|
|
226
|
+
ALL_ENVIRONMENTS,
|
|
227
|
+
ALL_PLATFORMS,
|
|
228
|
+
Environment,
|
|
229
|
+
Platform,
|
|
201
230
|
createFeedbackSchema,
|
|
202
231
|
createLinkSchema,
|
|
203
232
|
createTrackEventSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/schema/index.ts"],"sourcesContent":["import {\n enum as _enum,\n null as _null,\n array,\n boolean,\n coerce,\n email,\n iso,\n maxLength,\n minLength,\n number,\n object,\n optional,\n pipe,\n record,\n refine,\n regex,\n string,\n transform,\n trim,\n union,\n url,\n uuid,\n type z,\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\nexport const tagsSchema = 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(number()),\n screen_width: optional(number()),\n screen_height: optional(number()),\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 // app info\n advertising_id: optional(string()),\n install_referrer: optional(string()),\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 // reddit ads\n rdt_cid: optional(string()),\n rdt_uuid: optional(string()),\n // click ids\n dclid: optional(string()),\n ko_click_id: optional(string()),\n li_fat_id: optional(string()),\n msclkid: optional(string()),\n sccid: optional(string()),\n ttclid: optional(string()),\n twclid: optional(string()),\n wbraid: optional(string()),\n yclid: 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 utm_id: optional(string()),\n utm_source_platform: optional(string()),\n utm_creative_format: optional(string()),\n utm_marketing_tactic: optional(string()),\n});\n\nexport const propertiesSchema = 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/** @deprecated */\nexport const createTrackEventSchemaV1 = array(\n object({\n name: string().check(trim(), minLength(1), maxLength(64)),\n visitor_id: coerce.bigint(),\n session_id: uuid(),\n timestamp: iso.datetime(),\n tags: tagsSchema,\n properties: propertiesSchema,\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 session_id: uuid(),\n timestamp: iso.datetime(),\n tags: tagsSchema,\n properties: propertiesSchema,\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 distinct_id: optional(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 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,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;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;AAEO,IAAM,aAAa,OAAO;AAAA,EAC/B,IAAI,SAAS,OAAO,CAAC;AAAA,EACrB,SAAS,SAAS,OAAO,CAAC;AAAA,EAC1B,YAAY,SAAS,OAAO,CAAC;AAAA,EAC7B,SAAS,SAAS,OAAO,CAAC;AAAA,EAC1B,cAAc,SAAS,OAAO,CAAC;AAAA,EAC/B,iBAAiB,SAAS,OAAO,CAAC;AAAA,EAClC,UAAU,SAAS,MAAM,CAAC,OAAO,WAAW,OAAO,SAAS,WAAW,SAAS,SAAS,CAAC,CAAC;AAAA,EAC3F,QAAQ,SAAS,OAAO,CAAC;AAAA,EACzB,WAAW,SAAS,OAAO,EAAE,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,UAAU,EAAE,CAAC,CAAC;AAAA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AAsB,SAAS,aAAa;AAC9C,CAAC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/schema/index.ts"],"sourcesContent":["import {\n enum as _enum,\n null as _null,\n array,\n boolean,\n coerce,\n email,\n iso,\n maxLength,\n minLength,\n number,\n object,\n optional,\n pipe,\n record,\n refine,\n regex,\n string,\n transform,\n trim,\n union,\n url,\n uuid,\n type z,\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\nexport enum Platform {\n ios = 'ios',\n android = 'android',\n web = 'web',\n macos = 'macos',\n windows = 'windows',\n linux = 'linux',\n unknown = 'unknown',\n}\n\nexport enum Environment {\n development = 'development',\n production = 'production',\n}\n\nexport const ALL_PLATFORMS = [\n Platform.ios,\n Platform.android,\n Platform.web,\n Platform.macos,\n Platform.windows,\n Platform.linux,\n Platform.unknown,\n] as const;\n\nexport const ALL_ENVIRONMENTS = [Environment.development, Environment.production] as const;\n\nexport const tagsSchema = 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: _enum(Platform),\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(number()),\n screen_width: optional(number()),\n screen_height: optional(number()),\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: _enum(Environment),\n source_url: optional(string()),\n source: optional(_enum(['web', 'app', 'offline'])),\n // app info\n advertising_id: optional(string()),\n install_referrer: optional(string()),\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 // reddit ads\n rdt_cid: optional(string()),\n rdt_uuid: optional(string()),\n // click ids\n dclid: optional(string()),\n ko_click_id: optional(string()),\n li_fat_id: optional(string()),\n msclkid: optional(string()),\n sccid: optional(string()),\n ttclid: optional(string()),\n twclid: optional(string()),\n wbraid: optional(string()),\n yclid: 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 utm_id: optional(string()),\n utm_source_platform: optional(string()),\n utm_creative_format: optional(string()),\n utm_marketing_tactic: optional(string()),\n});\n\nexport const propertiesSchema = 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/** @deprecated */\nexport const createTrackEventSchemaV1 = array(\n object({\n name: string().check(trim(), minLength(1), maxLength(64)),\n visitor_id: coerce.bigint(),\n session_id: uuid(),\n timestamp: iso.datetime(),\n tags: tagsSchema,\n properties: propertiesSchema,\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 session_id: uuid(),\n timestamp: iso.datetime(),\n tags: tagsSchema,\n properties: propertiesSchema,\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 distinct_id: optional(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 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 CreateLink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OhC,aAAa,SAAS,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOnC,qBAAqB,SAAS,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA,EAM3C,qBAAqB,SAAS,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA,EAM3C,sBAAsB,SAAS,aAAa;AAC9C,CAAC;","names":["Platform","Environment"]}
|
package/dist/track/types.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/track/types.ts"],"sourcesContent":["import type { UserProvidedData as GAUserProvidedData, StandardEvents } from './gtag';\n\nexport type AllowedPropertyValues = string | number | boolean | null;\nexport type EventName = Lowercase<string> | 'CLS' | 'FCP' | 'INP' | 'LCP' | 'TTFB';\n\nexport type TrackName<T extends EventName = EventName> = T extends keyof StandardEvents\n ? T\n : EventName;\nexport type TrackProperties<T extends EventName = EventName> = T extends keyof StandardEvents\n ? StandardEvents[T]\n : Record<Lowercase<string>, AllowedPropertyValues>;\n\nexport interface UserData {\n userId: string;\n email?: string;\n firstName?: string;\n lastName?: string;\n phone?: string;\n dateOfBirth?: string;\n gender?: string;\n city?: string;\n state?: string;\n postal?: string;\n country?: string;\n}\n\nexport interface UserProvidedData extends GAUserProvidedData {\n user_id?: string;\n ip_address?: string;\n user_agent?: string;\n gender?: 'female' | 'male';\n birthday?: { year: number; month: number; day: number };\n // meta specific\n fb_login_id?: string;\n fb_page_id?: string;\n}\n\nexport type ThirdPartyTracker = <T extends EventName>(\n name: TrackName<T>,\n properties?: TrackProperties<T>,\n event_id?: string\n) => void;\n\nexport interface PlatformInfo {\n os?: string;\n os_name?: string;\n os_version?: string;\n browser?: string;\n browser_name?: string;\n browser_version?: string;\n platform
|
|
1
|
+
{"version":3,"sources":["../../src/track/types.ts"],"sourcesContent":["import type { UserProvidedData as GAUserProvidedData, StandardEvents } from './gtag';\n\nexport type AllowedPropertyValues = string | number | boolean | null;\nexport type EventName = Lowercase<string> | 'CLS' | 'FCP' | 'INP' | 'LCP' | 'TTFB';\n\nexport type TrackName<T extends EventName = EventName> = T extends keyof StandardEvents\n ? T\n : EventName;\nexport type TrackProperties<T extends EventName = EventName> = T extends keyof StandardEvents\n ? StandardEvents[T]\n : Record<Lowercase<string>, AllowedPropertyValues>;\n\nexport interface UserData {\n userId: string;\n email?: string;\n firstName?: string;\n lastName?: string;\n phone?: string;\n dateOfBirth?: string;\n gender?: string;\n city?: string;\n state?: string;\n postal?: string;\n country?: string;\n}\n\nexport interface UserProvidedData extends GAUserProvidedData {\n user_id?: string;\n ip_address?: string;\n user_agent?: string;\n gender?: 'female' | 'male';\n birthday?: { year: number; month: number; day: number };\n // meta specific\n fb_login_id?: string;\n fb_page_id?: string;\n}\n\nexport type ThirdPartyTracker = <T extends EventName>(\n name: TrackName<T>,\n properties?: TrackProperties<T>,\n event_id?: string\n) => void;\n\nexport interface PlatformInfo {\n os?: string;\n os_name?: string;\n os_version?: string;\n browser?: string;\n browser_name?: string;\n browser_version?: string;\n platform: 'ios' | 'android' | 'web' | 'macos' | 'windows' | 'linux' | 'unknown';\n}\n\nexport interface DeviceInfo {\n device?: string;\n device_id?: string;\n device_type?: string;\n device_vendor?: string;\n device_model_id?: string;\n device_pixel_ratio?: number;\n screen_width?: number;\n screen_height?: number;\n screen_resolution?: `${number}x${number}`;\n}\n\nexport interface AppInfo {\n /** iOS: IDFA, Android: Android Advertising ID */\n advertising_id?: string;\n install_referrer?: string;\n}\n\nexport interface EnvironmentInfo {\n release?: string;\n language?: string;\n time_zone?: string | null;\n environment: 'development' | 'production';\n}\n\nexport interface SourceInfo {\n source_url?: string;\n source?: 'app' | 'web' | 'offline';\n}\n\nexport interface AdvertisingInfo {\n /**\n * Meta pixel fields\n * ref: https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/customer-information-parameters#fbc\n * Stored in the _fbc/_fbp browser cookie under your domain\n * ref: https://www.facebook.com/business/help/2360940870872492?checkpoint_src=any\n */\n fbc?: string;\n fbp?: string;\n fbclid?: string;\n ad_id?: string;\n ad_name?: string;\n adset_id?: string;\n adset_name?: string;\n campaign_id?: string;\n campaign_name?: string;\n placement?: string;\n site_source_name?: string;\n /** Google Analytics fields */\n gclid?: string;\n gclsrc?: string;\n gad_source?: string;\n gad_campaignid?: string;\n /** Reddit Ads fields */\n rdt_cid?: string;\n rdt_uuid?: string;\n /** LinkedIn Ads fields: get click id from url params or first-party cookie */\n li_fat_id?: string;\n // click ids\n dclid?: string; // Google Display Network\n ko_click_id?: string; // Kakao Ads\n msclkid?: string; // Microsoft Ads (Bing Ads)\n sccid?: string; // Snapchat Ads\n ttclid?: string; // TikTok Ads\n twclid?: string; // Twitter Ads (X Ads)\n wbraid?: string; // Google Ads (for iOS privacy)\n yclid?: string; // Yandex Ads\n}\n\nexport interface UTMParams {\n utm_source?: string;\n utm_medium?: string;\n utm_campaign?: string;\n utm_term?: string;\n utm_content?: string;\n utm_id?: string;\n utm_source_platform?: string;\n utm_creative_format?: string;\n utm_marketing_tactic?: string;\n}\n\nexport interface TrackTags\n extends\n PlatformInfo,\n DeviceInfo,\n AppInfo,\n EnvironmentInfo,\n SourceInfo,\n AdvertisingInfo,\n UTMParams {\n idempotency_key?: string;\n [key: string]: string | number | boolean | null | undefined;\n}\n\nexport type CreateTrackEventDTO<T extends EventName = EventName> = {\n name: TrackName<T>;\n tags: TrackTags;\n visitor_id: string;\n session_id: string;\n properties?: TrackProperties<T>;\n timestamp: string;\n}[];\n\nexport interface TrackEvent<T extends EventName = EventName> {\n id: string;\n name: TrackName<T>;\n tags: TrackTags;\n visitor_id: string;\n session_id: string;\n properties?: TrackProperties<T>;\n created_at: string;\n}\n\nexport type TrackEventResponse = {\n /** track event id: Meta Pixel will use event_id and event_name for deduplication */\n id: string;\n}[];\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
package/dist/track/types.d.cts
CHANGED
|
@@ -38,7 +38,7 @@ interface PlatformInfo {
|
|
|
38
38
|
browser?: string;
|
|
39
39
|
browser_name?: string;
|
|
40
40
|
browser_version?: string;
|
|
41
|
-
platform
|
|
41
|
+
platform: 'ios' | 'android' | 'web' | 'macos' | 'windows' | 'linux' | 'unknown';
|
|
42
42
|
}
|
|
43
43
|
interface DeviceInfo {
|
|
44
44
|
device?: string;
|
|
@@ -60,7 +60,7 @@ interface EnvironmentInfo {
|
|
|
60
60
|
release?: string;
|
|
61
61
|
language?: string;
|
|
62
62
|
time_zone?: string | null;
|
|
63
|
-
environment
|
|
63
|
+
environment: 'development' | 'production';
|
|
64
64
|
}
|
|
65
65
|
interface SourceInfo {
|
|
66
66
|
source_url?: string;
|
package/dist/track/types.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ interface PlatformInfo {
|
|
|
38
38
|
browser?: string;
|
|
39
39
|
browser_name?: string;
|
|
40
40
|
browser_version?: string;
|
|
41
|
-
platform
|
|
41
|
+
platform: 'ios' | 'android' | 'web' | 'macos' | 'windows' | 'linux' | 'unknown';
|
|
42
42
|
}
|
|
43
43
|
interface DeviceInfo {
|
|
44
44
|
device?: string;
|
|
@@ -60,7 +60,7 @@ interface EnvironmentInfo {
|
|
|
60
60
|
release?: string;
|
|
61
61
|
language?: string;
|
|
62
62
|
time_zone?: string | null;
|
|
63
|
-
environment
|
|
63
|
+
environment: 'development' | 'production';
|
|
64
64
|
}
|
|
65
65
|
interface SourceInfo {
|
|
66
66
|
source_url?: string;
|