@shware/analytics 2.15.5 → 2.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -22,8 +22,6 @@ var index_exports = {};
22
22
  __export(index_exports, {
23
23
  ALL_ENVIRONMENTS: () => import_schema.ALL_ENVIRONMENTS,
24
24
  ALL_PLATFORMS: () => import_schema.ALL_PLATFORMS,
25
- Environment: () => import_schema.Environment,
26
- Platform: () => import_schema.Platform,
27
25
  createFeedbackSchema: () => import_schema.createFeedbackSchema,
28
26
  createLink: () => import_link.createLink,
29
27
  createLinkSchema: () => import_schema.createLinkSchema,
@@ -52,8 +50,6 @@ var import_stripe = require("./utils/stripe.cjs");
52
50
  0 && (module.exports = {
53
51
  ALL_ENVIRONMENTS,
54
52
  ALL_PLATFORMS,
55
- Environment,
56
- Platform,
57
53
  createFeedbackSchema,
58
54
  createLink,
59
55
  createLinkSchema,
@@ -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 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":[]}
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 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 Platform,\n Environment,\n TrackTags,\n TrackProperties,\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,mBAA+B;AAC/B,mBAAkC;AAClC,qBAAuC;AACvC,sBAA6B;AAC7B,kBAA+C;AAC/C,oBAWO;AACP,oBAAiC;","names":[]}
package/dist/index.d.cts CHANGED
@@ -3,9 +3,9 @@ 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 { ALL_ENVIRONMENTS, ALL_PLATFORMS, CreateFeedbackDTO, CreateLinkDTO, Environment, Platform, createFeedbackSchema, createLinkSchema, createTrackEventSchema, createTrackEventSchemaV1, createVisitorSchema, updateVisitorSchema } from './schema/index.cjs';
6
+ export { ALL_ENVIRONMENTS, ALL_PLATFORMS, CreateFeedbackDTO, CreateLinkDTO, createFeedbackSchema, createLinkSchema, createTrackEventSchema, createTrackEventSchemaV1, createVisitorSchema, updateVisitorSchema } from './schema/index.cjs';
7
7
  export { stripeMinorUnits } from './utils/stripe.cjs';
8
- export { AllowedPropertyValues, TrackProperties, TrackTags, UserProvidedData } from './track/types.cjs';
8
+ export { AllowedPropertyValues, Environment, Platform, TrackProperties, TrackTags, UserProvidedData } from './track/types.cjs';
9
9
  export { VisitorProperties } from './visitor/types.cjs';
10
10
  import 'zod/mini';
11
11
  import './track/gtag.cjs';
package/dist/index.d.ts CHANGED
@@ -3,9 +3,9 @@ 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 { ALL_ENVIRONMENTS, ALL_PLATFORMS, CreateFeedbackDTO, CreateLinkDTO, Environment, Platform, createFeedbackSchema, createLinkSchema, createTrackEventSchema, createTrackEventSchemaV1, createVisitorSchema, updateVisitorSchema } from './schema/index.js';
6
+ export { ALL_ENVIRONMENTS, ALL_PLATFORMS, CreateFeedbackDTO, CreateLinkDTO, createFeedbackSchema, createLinkSchema, createTrackEventSchema, createTrackEventSchemaV1, createVisitorSchema, updateVisitorSchema } from './schema/index.js';
7
7
  export { stripeMinorUnits } from './utils/stripe.js';
8
- export { AllowedPropertyValues, TrackProperties, TrackTags, UserProvidedData } from './track/types.js';
8
+ export { AllowedPropertyValues, Environment, Platform, TrackProperties, TrackTags, UserProvidedData } from './track/types.js';
9
9
  export { VisitorProperties } from './visitor/types.js';
10
10
  import 'zod/mini';
11
11
  import './track/gtag.js';
package/dist/index.mjs CHANGED
@@ -5,8 +5,6 @@ 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
8
  ALL_PLATFORMS,
11
9
  ALL_ENVIRONMENTS,
12
10
  createTrackEventSchemaV1,
@@ -20,8 +18,6 @@ import { stripeMinorUnits } from "./utils/stripe.mjs";
20
18
  export {
21
19
  ALL_ENVIRONMENTS,
22
20
  ALL_PLATFORMS,
23
- Environment,
24
- Platform,
25
21
  createFeedbackSchema,
26
22
  createLink,
27
23
  createLinkSchema,
@@ -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 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":[]}
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 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 Platform,\n Environment,\n TrackTags,\n TrackProperties,\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,OAGK;AACP,SAAS,wBAAwB;","names":[]}
@@ -22,8 +22,6 @@ var schema_exports = {};
22
22
  __export(schema_exports, {
23
23
  ALL_ENVIRONMENTS: () => ALL_ENVIRONMENTS,
24
24
  ALL_PLATFORMS: () => ALL_PLATFORMS,
25
- Environment: () => Environment,
26
- Platform: () => Platform,
27
25
  createFeedbackSchema: () => createFeedbackSchema,
28
26
  createLinkSchema: () => createLinkSchema,
29
27
  createTrackEventSchema: () => createTrackEventSchema,
@@ -41,31 +39,16 @@ var items = (0, import_mini.array)(
41
39
  (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)()])
42
40
  )
43
41
  );
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
42
  var ALL_PLATFORMS = [
60
- "ios" /* ios */,
61
- "android" /* android */,
62
- "web" /* web */,
63
- "macos" /* macos */,
64
- "windows" /* windows */,
65
- "linux" /* linux */,
66
- "unknown" /* unknown */
43
+ "ios",
44
+ "android",
45
+ "web",
46
+ "macos",
47
+ "windows",
48
+ "linux",
49
+ "unknown"
67
50
  ];
68
- var ALL_ENVIRONMENTS = ["development" /* development */, "production" /* production */];
51
+ var ALL_ENVIRONMENTS = ["development", "production"];
69
52
  var tagsSchema = (0, import_mini.object)({
70
53
  os: (0, import_mini.optional)((0, import_mini.string)()),
71
54
  os_name: (0, import_mini.optional)((0, import_mini.string)()),
@@ -73,7 +56,7 @@ var tagsSchema = (0, import_mini.object)({
73
56
  browser: (0, import_mini.optional)((0, import_mini.string)()),
74
57
  browser_name: (0, import_mini.optional)((0, import_mini.string)()),
75
58
  browser_version: (0, import_mini.optional)((0, import_mini.string)()),
76
- platform: (0, import_mini.enum)(Platform),
59
+ platform: (0, import_mini.enum)(ALL_PLATFORMS),
77
60
  device: (0, import_mini.optional)((0, import_mini.string)()),
78
61
  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))),
79
62
  device_type: (0, import_mini.optional)((0, import_mini.string)()),
@@ -90,7 +73,7 @@ var tagsSchema = (0, import_mini.object)({
90
73
  release: (0, import_mini.optional)((0, import_mini.string)()),
91
74
  language: (0, import_mini.optional)((0, import_mini.string)()),
92
75
  time_zone: (0, import_mini.optional)((0, import_mini.string)()),
93
- environment: (0, import_mini.enum)(Environment),
76
+ environment: (0, import_mini.enum)(ALL_ENVIRONMENTS),
94
77
  source_url: (0, import_mini.optional)((0, import_mini.string)()),
95
78
  source: (0, import_mini.optional)((0, import_mini.enum)(["web", "app", "offline"])),
96
79
  // app info
@@ -158,6 +141,8 @@ var createTrackEventSchema = (0, import_mini.array)(
158
141
  name: (0, import_mini.string)().check((0, import_mini.trim)(), (0, import_mini.minLength)(1), (0, import_mini.maxLength)(64)),
159
142
  visitor_id: (0, import_mini.uuid)(),
160
143
  session_id: (0, import_mini.uuid)(),
144
+ platform: (0, import_mini.enum)(ALL_PLATFORMS),
145
+ environment: (0, import_mini.enum)(ALL_ENVIRONMENTS),
161
146
  timestamp: import_mini.iso.datetime(),
162
147
  tags: tagsSchema,
163
148
  properties: propertiesSchema
@@ -165,6 +150,8 @@ var createTrackEventSchema = (0, import_mini.array)(
165
150
  ).check((0, import_mini.minLength)(1), (0, import_mini.maxLength)(100));
166
151
  var createVisitorSchema = (0, import_mini.object)({
167
152
  device_id: (0, import_mini.string)().check((0, import_mini.trim)(), (0, import_mini.minLength)(1), (0, import_mini.maxLength)(36)),
153
+ platform: (0, import_mini.enum)(ALL_PLATFORMS),
154
+ environment: (0, import_mini.enum)(ALL_ENVIRONMENTS),
168
155
  properties: (0, import_mini.optional)(
169
156
  (0, import_mini.record)(
170
157
  (0, import_mini.string)().check((0, import_mini.trim)(), (0, import_mini.minLength)(1), (0, import_mini.maxLength)(128)),
@@ -238,8 +225,6 @@ var createLinkSchema = (0, import_mini.object)({
238
225
  0 && (module.exports = {
239
226
  ALL_ENVIRONMENTS,
240
227
  ALL_PLATFORMS,
241
- Environment,
242
- Platform,
243
228
  createFeedbackSchema,
244
229
  createLinkSchema,
245
230
  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 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,kBAAK,OAAG,uBAAU,CAAC,OAAG,uBAAU,GAAG,CAAC;AAAA,QACnD,mBAAM,KAAC,oBAAO,EAAE,UAAM,uBAAU,GAAG,CAAC,OAAG,oBAAO,OAAG,qBAAQ,OAA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AAAA,EAM3C,0BAAsB,sBAAS,aAAa;AAC9C,CAAC;","names":["_null","Platform","Environment","_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';\nimport type { Environment, Platform } from '../track/types';\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 ALL_PLATFORMS = [\n 'ios',\n 'android',\n 'web',\n 'macos',\n 'windows',\n 'linux',\n 'unknown',\n] as const satisfies Platform[];\n\nexport const ALL_ENVIRONMENTS = ['development', 'production'] as const satisfies Environment[];\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(ALL_PLATFORMS),\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(ALL_ENVIRONMENTS),\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 platform: _enum(ALL_PLATFORMS),\n environment: _enum(ALL_ENVIRONMENTS),\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 platform: _enum(ALL_PLATFORMS),\n environment: _enum(ALL_ENVIRONMENTS),\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 CreateTrackEventDTO = z.output<typeof createTrackEventSchema>;\nexport type CreateFeedbackDTO = z.output<typeof createFeedbackSchema>;\nexport type CreateLinkDTO = z.output<typeof createLinkSchema>;\nexport type CreateVisitorDTO = z.output<typeof createVisitorSchema>;\nexport type UpdateVisitorDTO = z.output<typeof updateVisitorSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAwBO;AAGP,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,gBAAgB;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,mBAAmB,CAAC,eAAe,YAAY;AAErD,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,aAAa;AAAA,EAC7B,YAAQ,0BAAS,oBAAO,CAAC;AAAA,EACzB,eAAW,0BAAS,oBAAO,EAAE,UAAM,kBAAK,OAAG,uBAAU,CAAC,OAAG,uBAAU,EAAE,CAAC,CAAC;AAAA,EACvE,iBAAa,0BAAS,oBAAO,CAAC;AAAA,EAC9B,mBAAe,0B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AC;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,20 +1,7 @@
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
+ declare const ALL_PLATFORMS: ["ios", "android", "web", "macos", "windows", "linux", "unknown"];
4
+ declare const ALL_ENVIRONMENTS: ["development", "production"];
18
5
  declare const tagsSchema: z.ZodMiniObject<{
19
6
  os: z.ZodMiniOptional<z.ZodMiniString<string>>;
20
7
  os_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
@@ -22,7 +9,15 @@ declare const tagsSchema: z.ZodMiniObject<{
22
9
  browser: z.ZodMiniOptional<z.ZodMiniString<string>>;
23
10
  browser_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
24
11
  browser_version: z.ZodMiniOptional<z.ZodMiniString<string>>;
25
- platform: z.ZodMiniEnum<typeof Platform>;
12
+ platform: z.ZodMiniEnum<{
13
+ ios: "ios";
14
+ android: "android";
15
+ web: "web";
16
+ macos: "macos";
17
+ windows: "windows";
18
+ linux: "linux";
19
+ unknown: "unknown";
20
+ }>;
26
21
  device: z.ZodMiniOptional<z.ZodMiniString<string>>;
27
22
  device_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
28
23
  device_type: z.ZodMiniOptional<z.ZodMiniString<string>>;
@@ -34,7 +29,10 @@ declare const tagsSchema: z.ZodMiniObject<{
34
29
  release: z.ZodMiniOptional<z.ZodMiniString<string>>;
35
30
  language: z.ZodMiniOptional<z.ZodMiniString<string>>;
36
31
  time_zone: z.ZodMiniOptional<z.ZodMiniString<string>>;
37
- environment: z.ZodMiniEnum<typeof Environment>;
32
+ environment: z.ZodMiniEnum<{
33
+ development: "development";
34
+ production: "production";
35
+ }>;
38
36
  source_url: z.ZodMiniOptional<z.ZodMiniString<string>>;
39
37
  source: z.ZodMiniOptional<z.ZodMiniEnum<{
40
38
  web: "web";
@@ -93,7 +91,15 @@ declare const createTrackEventSchemaV1: z.ZodMiniArray<z.ZodMiniObject<{
93
91
  browser: z.ZodMiniOptional<z.ZodMiniString<string>>;
94
92
  browser_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
95
93
  browser_version: z.ZodMiniOptional<z.ZodMiniString<string>>;
96
- platform: z.ZodMiniEnum<typeof Platform>;
94
+ platform: z.ZodMiniEnum<{
95
+ ios: "ios";
96
+ android: "android";
97
+ web: "web";
98
+ macos: "macos";
99
+ windows: "windows";
100
+ linux: "linux";
101
+ unknown: "unknown";
102
+ }>;
97
103
  device: z.ZodMiniOptional<z.ZodMiniString<string>>;
98
104
  device_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
99
105
  device_type: z.ZodMiniOptional<z.ZodMiniString<string>>;
@@ -105,7 +111,10 @@ declare const createTrackEventSchemaV1: z.ZodMiniArray<z.ZodMiniObject<{
105
111
  release: z.ZodMiniOptional<z.ZodMiniString<string>>;
106
112
  language: z.ZodMiniOptional<z.ZodMiniString<string>>;
107
113
  time_zone: z.ZodMiniOptional<z.ZodMiniString<string>>;
108
- environment: z.ZodMiniEnum<typeof Environment>;
114
+ environment: z.ZodMiniEnum<{
115
+ development: "development";
116
+ production: "production";
117
+ }>;
109
118
  source_url: z.ZodMiniOptional<z.ZodMiniString<string>>;
110
119
  source: z.ZodMiniOptional<z.ZodMiniEnum<{
111
120
  web: "web";
@@ -156,6 +165,19 @@ declare const createTrackEventSchema: z.ZodMiniArray<z.ZodMiniObject<{
156
165
  name: z.ZodMiniString<string>;
157
166
  visitor_id: z.ZodMiniUUID;
158
167
  session_id: z.ZodMiniUUID;
168
+ platform: z.ZodMiniEnum<{
169
+ ios: "ios";
170
+ android: "android";
171
+ web: "web";
172
+ macos: "macos";
173
+ windows: "windows";
174
+ linux: "linux";
175
+ unknown: "unknown";
176
+ }>;
177
+ environment: z.ZodMiniEnum<{
178
+ development: "development";
179
+ production: "production";
180
+ }>;
159
181
  timestamp: iso.ZodMiniISODateTime;
160
182
  tags: z.ZodMiniObject<{
161
183
  os: z.ZodMiniOptional<z.ZodMiniString<string>>;
@@ -164,7 +186,15 @@ declare const createTrackEventSchema: z.ZodMiniArray<z.ZodMiniObject<{
164
186
  browser: z.ZodMiniOptional<z.ZodMiniString<string>>;
165
187
  browser_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
166
188
  browser_version: z.ZodMiniOptional<z.ZodMiniString<string>>;
167
- platform: z.ZodMiniEnum<typeof Platform>;
189
+ platform: z.ZodMiniEnum<{
190
+ ios: "ios";
191
+ android: "android";
192
+ web: "web";
193
+ macos: "macos";
194
+ windows: "windows";
195
+ linux: "linux";
196
+ unknown: "unknown";
197
+ }>;
168
198
  device: z.ZodMiniOptional<z.ZodMiniString<string>>;
169
199
  device_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
170
200
  device_type: z.ZodMiniOptional<z.ZodMiniString<string>>;
@@ -176,7 +206,10 @@ declare const createTrackEventSchema: z.ZodMiniArray<z.ZodMiniObject<{
176
206
  release: z.ZodMiniOptional<z.ZodMiniString<string>>;
177
207
  language: z.ZodMiniOptional<z.ZodMiniString<string>>;
178
208
  time_zone: z.ZodMiniOptional<z.ZodMiniString<string>>;
179
- environment: z.ZodMiniEnum<typeof Environment>;
209
+ environment: z.ZodMiniEnum<{
210
+ development: "development";
211
+ production: "production";
212
+ }>;
180
213
  source_url: z.ZodMiniOptional<z.ZodMiniString<string>>;
181
214
  source: z.ZodMiniOptional<z.ZodMiniEnum<{
182
215
  web: "web";
@@ -225,6 +258,19 @@ declare const createTrackEventSchema: z.ZodMiniArray<z.ZodMiniObject<{
225
258
  }, z.core.$strip>>;
226
259
  declare const createVisitorSchema: z.ZodMiniObject<{
227
260
  device_id: z.ZodMiniString<string>;
261
+ platform: z.ZodMiniEnum<{
262
+ ios: "ios";
263
+ android: "android";
264
+ web: "web";
265
+ macos: "macos";
266
+ windows: "windows";
267
+ linux: "linux";
268
+ unknown: "unknown";
269
+ }>;
270
+ environment: z.ZodMiniEnum<{
271
+ development: "development";
272
+ production: "production";
273
+ }>;
228
274
  properties: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>, z.ZodMiniBoolean<boolean>, z.ZodMiniNull]>>>;
229
275
  }, z.core.$strip>;
230
276
  declare const updateVisitorSchema: z.ZodMiniObject<{
@@ -280,7 +326,10 @@ declare const createLinkSchema: z.ZodMiniObject<{
280
326
  * */
281
327
  utm_marketing_tactic: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
282
328
  }, z.core.$strip>;
329
+ type CreateTrackEventDTO = z.output<typeof createTrackEventSchema>;
283
330
  type CreateFeedbackDTO = z.output<typeof createFeedbackSchema>;
284
331
  type CreateLinkDTO = z.output<typeof createLinkSchema>;
332
+ type CreateVisitorDTO = z.output<typeof createVisitorSchema>;
333
+ type UpdateVisitorDTO = z.output<typeof updateVisitorSchema>;
285
334
 
286
- export { ALL_ENVIRONMENTS, ALL_PLATFORMS, type CreateFeedbackDTO, type CreateLinkDTO, Environment, Platform, createFeedbackSchema, createLinkSchema, createTrackEventSchema, createTrackEventSchemaV1, createVisitorSchema, propertiesSchema, tagsSchema, updateVisitorSchema };
335
+ export { ALL_ENVIRONMENTS, ALL_PLATFORMS, type CreateFeedbackDTO, type CreateLinkDTO, type CreateTrackEventDTO, type CreateVisitorDTO, type UpdateVisitorDTO, createFeedbackSchema, createLinkSchema, createTrackEventSchema, createTrackEventSchemaV1, createVisitorSchema, propertiesSchema, tagsSchema, updateVisitorSchema };
@@ -1,20 +1,7 @@
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
+ declare const ALL_PLATFORMS: ["ios", "android", "web", "macos", "windows", "linux", "unknown"];
4
+ declare const ALL_ENVIRONMENTS: ["development", "production"];
18
5
  declare const tagsSchema: z.ZodMiniObject<{
19
6
  os: z.ZodMiniOptional<z.ZodMiniString<string>>;
20
7
  os_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
@@ -22,7 +9,15 @@ declare const tagsSchema: z.ZodMiniObject<{
22
9
  browser: z.ZodMiniOptional<z.ZodMiniString<string>>;
23
10
  browser_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
24
11
  browser_version: z.ZodMiniOptional<z.ZodMiniString<string>>;
25
- platform: z.ZodMiniEnum<typeof Platform>;
12
+ platform: z.ZodMiniEnum<{
13
+ ios: "ios";
14
+ android: "android";
15
+ web: "web";
16
+ macos: "macos";
17
+ windows: "windows";
18
+ linux: "linux";
19
+ unknown: "unknown";
20
+ }>;
26
21
  device: z.ZodMiniOptional<z.ZodMiniString<string>>;
27
22
  device_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
28
23
  device_type: z.ZodMiniOptional<z.ZodMiniString<string>>;
@@ -34,7 +29,10 @@ declare const tagsSchema: z.ZodMiniObject<{
34
29
  release: z.ZodMiniOptional<z.ZodMiniString<string>>;
35
30
  language: z.ZodMiniOptional<z.ZodMiniString<string>>;
36
31
  time_zone: z.ZodMiniOptional<z.ZodMiniString<string>>;
37
- environment: z.ZodMiniEnum<typeof Environment>;
32
+ environment: z.ZodMiniEnum<{
33
+ development: "development";
34
+ production: "production";
35
+ }>;
38
36
  source_url: z.ZodMiniOptional<z.ZodMiniString<string>>;
39
37
  source: z.ZodMiniOptional<z.ZodMiniEnum<{
40
38
  web: "web";
@@ -93,7 +91,15 @@ declare const createTrackEventSchemaV1: z.ZodMiniArray<z.ZodMiniObject<{
93
91
  browser: z.ZodMiniOptional<z.ZodMiniString<string>>;
94
92
  browser_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
95
93
  browser_version: z.ZodMiniOptional<z.ZodMiniString<string>>;
96
- platform: z.ZodMiniEnum<typeof Platform>;
94
+ platform: z.ZodMiniEnum<{
95
+ ios: "ios";
96
+ android: "android";
97
+ web: "web";
98
+ macos: "macos";
99
+ windows: "windows";
100
+ linux: "linux";
101
+ unknown: "unknown";
102
+ }>;
97
103
  device: z.ZodMiniOptional<z.ZodMiniString<string>>;
98
104
  device_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
99
105
  device_type: z.ZodMiniOptional<z.ZodMiniString<string>>;
@@ -105,7 +111,10 @@ declare const createTrackEventSchemaV1: z.ZodMiniArray<z.ZodMiniObject<{
105
111
  release: z.ZodMiniOptional<z.ZodMiniString<string>>;
106
112
  language: z.ZodMiniOptional<z.ZodMiniString<string>>;
107
113
  time_zone: z.ZodMiniOptional<z.ZodMiniString<string>>;
108
- environment: z.ZodMiniEnum<typeof Environment>;
114
+ environment: z.ZodMiniEnum<{
115
+ development: "development";
116
+ production: "production";
117
+ }>;
109
118
  source_url: z.ZodMiniOptional<z.ZodMiniString<string>>;
110
119
  source: z.ZodMiniOptional<z.ZodMiniEnum<{
111
120
  web: "web";
@@ -156,6 +165,19 @@ declare const createTrackEventSchema: z.ZodMiniArray<z.ZodMiniObject<{
156
165
  name: z.ZodMiniString<string>;
157
166
  visitor_id: z.ZodMiniUUID;
158
167
  session_id: z.ZodMiniUUID;
168
+ platform: z.ZodMiniEnum<{
169
+ ios: "ios";
170
+ android: "android";
171
+ web: "web";
172
+ macos: "macos";
173
+ windows: "windows";
174
+ linux: "linux";
175
+ unknown: "unknown";
176
+ }>;
177
+ environment: z.ZodMiniEnum<{
178
+ development: "development";
179
+ production: "production";
180
+ }>;
159
181
  timestamp: iso.ZodMiniISODateTime;
160
182
  tags: z.ZodMiniObject<{
161
183
  os: z.ZodMiniOptional<z.ZodMiniString<string>>;
@@ -164,7 +186,15 @@ declare const createTrackEventSchema: z.ZodMiniArray<z.ZodMiniObject<{
164
186
  browser: z.ZodMiniOptional<z.ZodMiniString<string>>;
165
187
  browser_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
166
188
  browser_version: z.ZodMiniOptional<z.ZodMiniString<string>>;
167
- platform: z.ZodMiniEnum<typeof Platform>;
189
+ platform: z.ZodMiniEnum<{
190
+ ios: "ios";
191
+ android: "android";
192
+ web: "web";
193
+ macos: "macos";
194
+ windows: "windows";
195
+ linux: "linux";
196
+ unknown: "unknown";
197
+ }>;
168
198
  device: z.ZodMiniOptional<z.ZodMiniString<string>>;
169
199
  device_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
170
200
  device_type: z.ZodMiniOptional<z.ZodMiniString<string>>;
@@ -176,7 +206,10 @@ declare const createTrackEventSchema: z.ZodMiniArray<z.ZodMiniObject<{
176
206
  release: z.ZodMiniOptional<z.ZodMiniString<string>>;
177
207
  language: z.ZodMiniOptional<z.ZodMiniString<string>>;
178
208
  time_zone: z.ZodMiniOptional<z.ZodMiniString<string>>;
179
- environment: z.ZodMiniEnum<typeof Environment>;
209
+ environment: z.ZodMiniEnum<{
210
+ development: "development";
211
+ production: "production";
212
+ }>;
180
213
  source_url: z.ZodMiniOptional<z.ZodMiniString<string>>;
181
214
  source: z.ZodMiniOptional<z.ZodMiniEnum<{
182
215
  web: "web";
@@ -225,6 +258,19 @@ declare const createTrackEventSchema: z.ZodMiniArray<z.ZodMiniObject<{
225
258
  }, z.core.$strip>>;
226
259
  declare const createVisitorSchema: z.ZodMiniObject<{
227
260
  device_id: z.ZodMiniString<string>;
261
+ platform: z.ZodMiniEnum<{
262
+ ios: "ios";
263
+ android: "android";
264
+ web: "web";
265
+ macos: "macos";
266
+ windows: "windows";
267
+ linux: "linux";
268
+ unknown: "unknown";
269
+ }>;
270
+ environment: z.ZodMiniEnum<{
271
+ development: "development";
272
+ production: "production";
273
+ }>;
228
274
  properties: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>, z.ZodMiniBoolean<boolean>, z.ZodMiniNull]>>>;
229
275
  }, z.core.$strip>;
230
276
  declare const updateVisitorSchema: z.ZodMiniObject<{
@@ -280,7 +326,10 @@ declare const createLinkSchema: z.ZodMiniObject<{
280
326
  * */
281
327
  utm_marketing_tactic: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
282
328
  }, z.core.$strip>;
329
+ type CreateTrackEventDTO = z.output<typeof createTrackEventSchema>;
283
330
  type CreateFeedbackDTO = z.output<typeof createFeedbackSchema>;
284
331
  type CreateLinkDTO = z.output<typeof createLinkSchema>;
332
+ type CreateVisitorDTO = z.output<typeof createVisitorSchema>;
333
+ type UpdateVisitorDTO = z.output<typeof updateVisitorSchema>;
285
334
 
286
- export { ALL_ENVIRONMENTS, ALL_PLATFORMS, type CreateFeedbackDTO, type CreateLinkDTO, Environment, Platform, createFeedbackSchema, createLinkSchema, createTrackEventSchema, createTrackEventSchemaV1, createVisitorSchema, propertiesSchema, tagsSchema, updateVisitorSchema };
335
+ export { ALL_ENVIRONMENTS, ALL_PLATFORMS, type CreateFeedbackDTO, type CreateLinkDTO, type CreateTrackEventDTO, type CreateVisitorDTO, type UpdateVisitorDTO, createFeedbackSchema, createLinkSchema, createTrackEventSchema, createTrackEventSchemaV1, createVisitorSchema, propertiesSchema, tagsSchema, updateVisitorSchema };
@@ -29,31 +29,16 @@ 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
32
  var ALL_PLATFORMS = [
48
- "ios" /* ios */,
49
- "android" /* android */,
50
- "web" /* web */,
51
- "macos" /* macos */,
52
- "windows" /* windows */,
53
- "linux" /* linux */,
54
- "unknown" /* unknown */
33
+ "ios",
34
+ "android",
35
+ "web",
36
+ "macos",
37
+ "windows",
38
+ "linux",
39
+ "unknown"
55
40
  ];
56
- var ALL_ENVIRONMENTS = ["development" /* development */, "production" /* production */];
41
+ var ALL_ENVIRONMENTS = ["development", "production"];
57
42
  var tagsSchema = object({
58
43
  os: optional(string()),
59
44
  os_name: optional(string()),
@@ -61,7 +46,7 @@ var tagsSchema = object({
61
46
  browser: optional(string()),
62
47
  browser_name: optional(string()),
63
48
  browser_version: optional(string()),
64
- platform: _enum(Platform),
49
+ platform: _enum(ALL_PLATFORMS),
65
50
  device: optional(string()),
66
51
  device_id: optional(string().check(trim(), minLength(1), maxLength(36))),
67
52
  device_type: optional(string()),
@@ -78,7 +63,7 @@ var tagsSchema = object({
78
63
  release: optional(string()),
79
64
  language: optional(string()),
80
65
  time_zone: optional(string()),
81
- environment: _enum(Environment),
66
+ environment: _enum(ALL_ENVIRONMENTS),
82
67
  source_url: optional(string()),
83
68
  source: optional(_enum(["web", "app", "offline"])),
84
69
  // app info
@@ -146,6 +131,8 @@ var createTrackEventSchema = array(
146
131
  name: string().check(trim(), minLength(1), maxLength(64)),
147
132
  visitor_id: uuid(),
148
133
  session_id: uuid(),
134
+ platform: _enum(ALL_PLATFORMS),
135
+ environment: _enum(ALL_ENVIRONMENTS),
149
136
  timestamp: iso.datetime(),
150
137
  tags: tagsSchema,
151
138
  properties: propertiesSchema
@@ -153,6 +140,8 @@ var createTrackEventSchema = array(
153
140
  ).check(minLength(1), maxLength(100));
154
141
  var createVisitorSchema = object({
155
142
  device_id: string().check(trim(), minLength(1), maxLength(36)),
143
+ platform: _enum(ALL_PLATFORMS),
144
+ environment: _enum(ALL_ENVIRONMENTS),
156
145
  properties: optional(
157
146
  record(
158
147
  string().check(trim(), minLength(1), maxLength(128)),
@@ -225,8 +214,6 @@ var createLinkSchema = object({
225
214
  export {
226
215
  ALL_ENVIRONMENTS,
227
216
  ALL_PLATFORMS,
228
- Environment,
229
- Platform,
230
217
  createFeedbackSchema,
231
218
  createLinkSchema,
232
219
  createTrackEventSchema,