@shware/analytics 2.15.3 → 2.15.4

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.
@@ -44,7 +44,7 @@ var tagsSchema = (0, import_mini.object)({
44
44
  browser: (0, import_mini.optional)((0, import_mini.string)()),
45
45
  browser_name: (0, import_mini.optional)((0, import_mini.string)()),
46
46
  browser_version: (0, import_mini.optional)((0, import_mini.string)()),
47
- platform: (0, import_mini.optional)((0, import_mini.enum)(["ios", "android", "web", "macos", "windows", "linux", "unknown"])),
47
+ platform: (0, import_mini.enum)(["ios", "android", "web", "macos", "windows", "linux", "unknown"]),
48
48
  device: (0, import_mini.optional)((0, import_mini.string)()),
49
49
  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
50
  device_type: (0, import_mini.optional)((0, import_mini.string)()),
@@ -61,7 +61,7 @@ var tagsSchema = (0, import_mini.object)({
61
61
  release: (0, import_mini.optional)((0, import_mini.string)()),
62
62
  language: (0, import_mini.optional)((0, import_mini.string)()),
63
63
  time_zone: (0, import_mini.optional)((0, import_mini.string)()),
64
- environment: (0, import_mini.optional)((0, import_mini.enum)(["development", "production"])),
64
+ environment: (0, import_mini.enum)(["development", "production"]),
65
65
  source_url: (0, import_mini.optional)((0, import_mini.string)()),
66
66
  source: (0, import_mini.optional)((0, import_mini.enum)(["web", "app", "offline"])),
67
67
  // app info
@@ -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,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;AAEO,IAAM,iBAAa,oBAAO;AAAA,EAC/B,QAAI,0BAAS,oBAAO,CAAC;AAAA,EACrB,aAAS,0BAAS,oBAAO,CAAC;AAAA,EAC1B,gBAAY,0BAAS,oBAAO,CAAC;AAAA,EAC7B,aAAS,0BAAS,oBAAO,CAAC;AAAA,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BAAU,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 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(['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: _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,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;AAEO,IAAM,iBAAa,oBAAO;AAAA,EAC/B,QAAI,0BAAS,oBAAO,CAAC;AAAA,EACrB,aAAS,0BAAS,oBAAO,CAAC;AAAA,EAC1B,gBAAY,0BAAS,oBAAO,CAAC;AAAA,EAC7B,aAAS,0BAAS,oBAAO,CAAC;AAAA,EAC1B,kBAAc,0BAAS,oBAAO,CAAC;AAAA,EAC/B,qBAAiB,0BAAS,oBAAO,CAAC;AAAA,EAClC,cAAU,YAAAC,MAAM,CAAC,OAAO,WAAW,OAAO,SAAS,WAAW,SAAS,SAAS,CAAC;AAAA,EACjF,YAAQ,0BAAS,oBAAO,CAAC;AAAA,EACzB,eAAW,0BAAS,oBAAO,EAAE,UAAM,kBAAK,OAAG,uBAAU,CA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AE,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"]}
@@ -7,7 +7,7 @@ declare const tagsSchema: z.ZodMiniObject<{
7
7
  browser: z.ZodMiniOptional<z.ZodMiniString<string>>;
8
8
  browser_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
9
9
  browser_version: z.ZodMiniOptional<z.ZodMiniString<string>>;
10
- platform: z.ZodMiniOptional<z.ZodMiniEnum<{
10
+ platform: z.ZodMiniEnum<{
11
11
  ios: "ios";
12
12
  android: "android";
13
13
  web: "web";
@@ -15,7 +15,7 @@ declare const tagsSchema: z.ZodMiniObject<{
15
15
  windows: "windows";
16
16
  linux: "linux";
17
17
  unknown: "unknown";
18
- }>>;
18
+ }>;
19
19
  device: z.ZodMiniOptional<z.ZodMiniString<string>>;
20
20
  device_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
21
21
  device_type: z.ZodMiniOptional<z.ZodMiniString<string>>;
@@ -27,10 +27,10 @@ declare const tagsSchema: z.ZodMiniObject<{
27
27
  release: z.ZodMiniOptional<z.ZodMiniString<string>>;
28
28
  language: z.ZodMiniOptional<z.ZodMiniString<string>>;
29
29
  time_zone: z.ZodMiniOptional<z.ZodMiniString<string>>;
30
- environment: z.ZodMiniOptional<z.ZodMiniEnum<{
30
+ environment: z.ZodMiniEnum<{
31
31
  development: "development";
32
32
  production: "production";
33
- }>>;
33
+ }>;
34
34
  source_url: z.ZodMiniOptional<z.ZodMiniString<string>>;
35
35
  source: z.ZodMiniOptional<z.ZodMiniEnum<{
36
36
  web: "web";
@@ -89,7 +89,7 @@ declare const createTrackEventSchemaV1: z.ZodMiniArray<z.ZodMiniObject<{
89
89
  browser: z.ZodMiniOptional<z.ZodMiniString<string>>;
90
90
  browser_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
91
91
  browser_version: z.ZodMiniOptional<z.ZodMiniString<string>>;
92
- platform: z.ZodMiniOptional<z.ZodMiniEnum<{
92
+ platform: z.ZodMiniEnum<{
93
93
  ios: "ios";
94
94
  android: "android";
95
95
  web: "web";
@@ -97,7 +97,7 @@ declare const createTrackEventSchemaV1: z.ZodMiniArray<z.ZodMiniObject<{
97
97
  windows: "windows";
98
98
  linux: "linux";
99
99
  unknown: "unknown";
100
- }>>;
100
+ }>;
101
101
  device: z.ZodMiniOptional<z.ZodMiniString<string>>;
102
102
  device_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
103
103
  device_type: z.ZodMiniOptional<z.ZodMiniString<string>>;
@@ -109,10 +109,10 @@ declare const createTrackEventSchemaV1: z.ZodMiniArray<z.ZodMiniObject<{
109
109
  release: z.ZodMiniOptional<z.ZodMiniString<string>>;
110
110
  language: z.ZodMiniOptional<z.ZodMiniString<string>>;
111
111
  time_zone: z.ZodMiniOptional<z.ZodMiniString<string>>;
112
- environment: z.ZodMiniOptional<z.ZodMiniEnum<{
112
+ environment: z.ZodMiniEnum<{
113
113
  development: "development";
114
114
  production: "production";
115
- }>>;
115
+ }>;
116
116
  source_url: z.ZodMiniOptional<z.ZodMiniString<string>>;
117
117
  source: z.ZodMiniOptional<z.ZodMiniEnum<{
118
118
  web: "web";
@@ -171,7 +171,7 @@ declare const createTrackEventSchema: z.ZodMiniArray<z.ZodMiniObject<{
171
171
  browser: z.ZodMiniOptional<z.ZodMiniString<string>>;
172
172
  browser_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
173
173
  browser_version: z.ZodMiniOptional<z.ZodMiniString<string>>;
174
- platform: z.ZodMiniOptional<z.ZodMiniEnum<{
174
+ platform: z.ZodMiniEnum<{
175
175
  ios: "ios";
176
176
  android: "android";
177
177
  web: "web";
@@ -179,7 +179,7 @@ declare const createTrackEventSchema: z.ZodMiniArray<z.ZodMiniObject<{
179
179
  windows: "windows";
180
180
  linux: "linux";
181
181
  unknown: "unknown";
182
- }>>;
182
+ }>;
183
183
  device: z.ZodMiniOptional<z.ZodMiniString<string>>;
184
184
  device_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
185
185
  device_type: z.ZodMiniOptional<z.ZodMiniString<string>>;
@@ -191,10 +191,10 @@ declare const createTrackEventSchema: z.ZodMiniArray<z.ZodMiniObject<{
191
191
  release: z.ZodMiniOptional<z.ZodMiniString<string>>;
192
192
  language: z.ZodMiniOptional<z.ZodMiniString<string>>;
193
193
  time_zone: z.ZodMiniOptional<z.ZodMiniString<string>>;
194
- environment: z.ZodMiniOptional<z.ZodMiniEnum<{
194
+ environment: z.ZodMiniEnum<{
195
195
  development: "development";
196
196
  production: "production";
197
- }>>;
197
+ }>;
198
198
  source_url: z.ZodMiniOptional<z.ZodMiniString<string>>;
199
199
  source: z.ZodMiniOptional<z.ZodMiniEnum<{
200
200
  web: "web";
@@ -7,7 +7,7 @@ declare const tagsSchema: z.ZodMiniObject<{
7
7
  browser: z.ZodMiniOptional<z.ZodMiniString<string>>;
8
8
  browser_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
9
9
  browser_version: z.ZodMiniOptional<z.ZodMiniString<string>>;
10
- platform: z.ZodMiniOptional<z.ZodMiniEnum<{
10
+ platform: z.ZodMiniEnum<{
11
11
  ios: "ios";
12
12
  android: "android";
13
13
  web: "web";
@@ -15,7 +15,7 @@ declare const tagsSchema: z.ZodMiniObject<{
15
15
  windows: "windows";
16
16
  linux: "linux";
17
17
  unknown: "unknown";
18
- }>>;
18
+ }>;
19
19
  device: z.ZodMiniOptional<z.ZodMiniString<string>>;
20
20
  device_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
21
21
  device_type: z.ZodMiniOptional<z.ZodMiniString<string>>;
@@ -27,10 +27,10 @@ declare const tagsSchema: z.ZodMiniObject<{
27
27
  release: z.ZodMiniOptional<z.ZodMiniString<string>>;
28
28
  language: z.ZodMiniOptional<z.ZodMiniString<string>>;
29
29
  time_zone: z.ZodMiniOptional<z.ZodMiniString<string>>;
30
- environment: z.ZodMiniOptional<z.ZodMiniEnum<{
30
+ environment: z.ZodMiniEnum<{
31
31
  development: "development";
32
32
  production: "production";
33
- }>>;
33
+ }>;
34
34
  source_url: z.ZodMiniOptional<z.ZodMiniString<string>>;
35
35
  source: z.ZodMiniOptional<z.ZodMiniEnum<{
36
36
  web: "web";
@@ -89,7 +89,7 @@ declare const createTrackEventSchemaV1: z.ZodMiniArray<z.ZodMiniObject<{
89
89
  browser: z.ZodMiniOptional<z.ZodMiniString<string>>;
90
90
  browser_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
91
91
  browser_version: z.ZodMiniOptional<z.ZodMiniString<string>>;
92
- platform: z.ZodMiniOptional<z.ZodMiniEnum<{
92
+ platform: z.ZodMiniEnum<{
93
93
  ios: "ios";
94
94
  android: "android";
95
95
  web: "web";
@@ -97,7 +97,7 @@ declare const createTrackEventSchemaV1: z.ZodMiniArray<z.ZodMiniObject<{
97
97
  windows: "windows";
98
98
  linux: "linux";
99
99
  unknown: "unknown";
100
- }>>;
100
+ }>;
101
101
  device: z.ZodMiniOptional<z.ZodMiniString<string>>;
102
102
  device_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
103
103
  device_type: z.ZodMiniOptional<z.ZodMiniString<string>>;
@@ -109,10 +109,10 @@ declare const createTrackEventSchemaV1: z.ZodMiniArray<z.ZodMiniObject<{
109
109
  release: z.ZodMiniOptional<z.ZodMiniString<string>>;
110
110
  language: z.ZodMiniOptional<z.ZodMiniString<string>>;
111
111
  time_zone: z.ZodMiniOptional<z.ZodMiniString<string>>;
112
- environment: z.ZodMiniOptional<z.ZodMiniEnum<{
112
+ environment: z.ZodMiniEnum<{
113
113
  development: "development";
114
114
  production: "production";
115
- }>>;
115
+ }>;
116
116
  source_url: z.ZodMiniOptional<z.ZodMiniString<string>>;
117
117
  source: z.ZodMiniOptional<z.ZodMiniEnum<{
118
118
  web: "web";
@@ -171,7 +171,7 @@ declare const createTrackEventSchema: z.ZodMiniArray<z.ZodMiniObject<{
171
171
  browser: z.ZodMiniOptional<z.ZodMiniString<string>>;
172
172
  browser_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
173
173
  browser_version: z.ZodMiniOptional<z.ZodMiniString<string>>;
174
- platform: z.ZodMiniOptional<z.ZodMiniEnum<{
174
+ platform: z.ZodMiniEnum<{
175
175
  ios: "ios";
176
176
  android: "android";
177
177
  web: "web";
@@ -179,7 +179,7 @@ declare const createTrackEventSchema: z.ZodMiniArray<z.ZodMiniObject<{
179
179
  windows: "windows";
180
180
  linux: "linux";
181
181
  unknown: "unknown";
182
- }>>;
182
+ }>;
183
183
  device: z.ZodMiniOptional<z.ZodMiniString<string>>;
184
184
  device_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
185
185
  device_type: z.ZodMiniOptional<z.ZodMiniString<string>>;
@@ -191,10 +191,10 @@ declare const createTrackEventSchema: z.ZodMiniArray<z.ZodMiniObject<{
191
191
  release: z.ZodMiniOptional<z.ZodMiniString<string>>;
192
192
  language: z.ZodMiniOptional<z.ZodMiniString<string>>;
193
193
  time_zone: z.ZodMiniOptional<z.ZodMiniString<string>>;
194
- environment: z.ZodMiniOptional<z.ZodMiniEnum<{
194
+ environment: z.ZodMiniEnum<{
195
195
  development: "development";
196
196
  production: "production";
197
- }>>;
197
+ }>;
198
198
  source_url: z.ZodMiniOptional<z.ZodMiniString<string>>;
199
199
  source: z.ZodMiniOptional<z.ZodMiniEnum<{
200
200
  web: "web";
@@ -36,7 +36,7 @@ var tagsSchema = object({
36
36
  browser: optional(string()),
37
37
  browser_name: optional(string()),
38
38
  browser_version: optional(string()),
39
- platform: optional(_enum(["ios", "android", "web", "macos", "windows", "linux", "unknown"])),
39
+ platform: _enum(["ios", "android", "web", "macos", "windows", "linux", "unknown"]),
40
40
  device: optional(string()),
41
41
  device_id: optional(string().check(trim(), minLength(1), maxLength(36))),
42
42
  device_type: optional(string()),
@@ -53,7 +53,7 @@ var tagsSchema = object({
53
53
  release: optional(string()),
54
54
  language: optional(string()),
55
55
  time_zone: optional(string()),
56
- environment: optional(_enum(["development", "production"])),
56
+ environment: _enum(["development", "production"]),
57
57
  source_url: optional(string()),
58
58
  source: optional(_enum(["web", "app", "offline"])),
59
59
  // app info
@@ -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,EACvE,aAAa,SAAS,OAAO,CAAC;AAAA,EAC9B,eAAe,SAAS,OAAO,CAAC;AAAA,EAChC,oBAAoB,SAAS,OAAO,CAAC;AAAA,EACrC,cAAc,SAAS,OAAO,CAAC;A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E,UAAU,EAAE,CAAC;AAAA,EAC1D;AACF,CAAC;AAEM,IAAM,uBAAuB,OAAO;AAAA,EACzC,MAAM,OAAO,EAAE,MAAM,UAAU,CAAC,GAAG,UAAU,GAAG,CAAC;AAAA,EACjD,OAAO,MAAM,EAAE,MAAM,UAAU,GAAG,CAAC;AAAA,EACnC,SAAS,OAAO,EAAE,MAAM,UAAU,CAAC,GAAG,UAAU,KAAK,CAAC;AACxD,CAAC;AAED,IAAM,gBAAgB;AAAA,EACpB,OAAO,EAAE,MAAM,UAAU,GAAG,CAAC;AAAA,EAC7B,UAAU,CAAC,MAAO,IAAI,IAAI,MAAU;AACtC;AAMO,IAAM,mBAAmB,OAAO;AAAA;AAAA,EAErC,KAAK,IAAI,EAAE,MAAM,UAAU,CAAC,GAAG,UAAU,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM9C,QAAQ,SAAS,aAAa;AAAA;AAAA,EAG9B,YAAY,OAAO,EAAE,MAAM,UAAU,CAAC,GAAG,UAAU,GAAG,CAAC;AAAA;AAAA;AAAA,EAGvD,YAAY,OAAO,EAAE,MAAM,UAAU,CAAC,GAAG,UAAU,GAAG,CAAC;AAAA;AAAA;AAAA,EAGvD,cAAc,OAAO,EAAE,MAAM,UAAU,CAAC,GAAG,UAAU,GAAG,CAAC;AAAA;AAAA;AAAA,EAGzD,UAAU,SAAS,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOhC,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":[]}
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: _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: _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,UA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AU,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM9C,QAAQ,SAAS,aAAa;AAAA;AAAA,EAG9B,YAAY,OAAO,EAAE,MAAM,UAAU,CAAC,GAAG,UAAU,GAAG,CAAC;AAAA;AAAA;AAAA,EAGvD,YAAY,OAAO,EAAE,MAAM,UAAU,CAAC,GAAG,UAAU,GAAG,CAAC;AAAA;AAAA;AAAA,EAGvD,cAAc,OAAO,EAAE,MAAM,UAAU,CAAC,GAAG,UAAU,GAAG,CAAC;AAAA;AAAA;AAAA,EAGzD,UAAU,SAAS,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOhC,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":[]}
@@ -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?: '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":[]}
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":[]}
@@ -38,7 +38,7 @@ interface PlatformInfo {
38
38
  browser?: string;
39
39
  browser_name?: string;
40
40
  browser_version?: string;
41
- platform?: 'ios' | 'android' | 'web' | 'macos' | 'windows' | 'linux' | 'unknown';
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?: 'development' | 'production';
63
+ environment: 'development' | 'production';
64
64
  }
65
65
  interface SourceInfo {
66
66
  source_url?: string;
@@ -38,7 +38,7 @@ interface PlatformInfo {
38
38
  browser?: string;
39
39
  browser_name?: string;
40
40
  browser_version?: string;
41
- platform?: 'ios' | 'android' | 'web' | 'macos' | 'windows' | 'linux' | 'unknown';
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?: 'development' | 'production';
63
+ environment: 'development' | 'production';
64
64
  }
65
65
  interface SourceInfo {
66
66
  source_url?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shware/analytics",
3
- "version": "2.15.3",
3
+ "version": "2.15.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "repository": {