@shware/analytics 0.2.1 → 0.2.3
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.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/schema/index.cjs +2 -2
- package/dist/schema/index.cjs.map +1 -1
- package/dist/schema/index.d.cts +6 -6
- package/dist/schema/index.d.ts +6 -6
- package/dist/schema/index.mjs +2 -2
- package/dist/schema/index.mjs.map +1 -1
- package/dist/track/types.cjs.map +1 -1
- package/dist/track/types.d.cts +1 -1
- package/dist/track/types.d.ts +1 -1
- package/package.json +2 -1
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { setupAnalytics } from './setup/index';\nexport { track } from './track/index';\nexport { getVisitor, setVisitor } from './visitor/index';\nexport { createTrackEventSchema, createVisitorSchema, updateVisitorSchema } from './schema/index';\nexport type { TrackProperties, TrackTags } from './track/types';\nexport type { VisitorProperties } from './visitor/types';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA+B;AAC/B,mBAAsB;AACtB,qBAAuC;AACvC,oBAAiF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { setupAnalytics } from './setup/index';\nexport { track } from './track/index';\nexport { getVisitor, setVisitor } from './visitor/index';\nexport { createTrackEventSchema, createVisitorSchema, updateVisitorSchema } from './schema/index';\nexport type { TrackProperties, TrackTags, AllowedPropertyValues } from './track/types';\nexport type { VisitorProperties } from './visitor/types';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA+B;AAC/B,mBAAsB;AACtB,qBAAuC;AACvC,oBAAiF;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ export { setupAnalytics } from './setup/index.cjs';
|
|
|
2
2
|
export { track } from './track/index.cjs';
|
|
3
3
|
export { getVisitor, setVisitor } from './visitor/index.cjs';
|
|
4
4
|
export { createTrackEventSchema, createVisitorSchema, updateVisitorSchema } from './schema/index.cjs';
|
|
5
|
-
export { TrackProperties, TrackTags } from './track/types.cjs';
|
|
5
|
+
export { AllowedPropertyValues, TrackProperties, TrackTags } from './track/types.cjs';
|
|
6
6
|
export { VisitorProperties } from './visitor/types.cjs';
|
|
7
7
|
import 'axios';
|
|
8
8
|
import 'zod';
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { setupAnalytics } from './setup/index.js';
|
|
|
2
2
|
export { track } from './track/index.js';
|
|
3
3
|
export { getVisitor, setVisitor } from './visitor/index.js';
|
|
4
4
|
export { createTrackEventSchema, createVisitorSchema, updateVisitorSchema } from './schema/index.js';
|
|
5
|
-
export { TrackProperties, TrackTags } from './track/types.js';
|
|
5
|
+
export { AllowedPropertyValues, TrackProperties, TrackTags } from './track/types.js';
|
|
6
6
|
export { VisitorProperties } from './visitor/types.js';
|
|
7
7
|
import 'axios';
|
|
8
8
|
import 'zod';
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { setupAnalytics } from './setup/index';\nexport { track } from './track/index';\nexport { getVisitor, setVisitor } from './visitor/index';\nexport { createTrackEventSchema, createVisitorSchema, updateVisitorSchema } from './schema/index';\nexport type { TrackProperties, TrackTags } from './track/types';\nexport type { VisitorProperties } from './visitor/types';\n"],"mappings":";AAAA,SAAS,sBAAsB;AAC/B,SAAS,aAAa;AACtB,SAAS,YAAY,kBAAkB;AACvC,SAAS,wBAAwB,qBAAqB,2BAA2B;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { setupAnalytics } from './setup/index';\nexport { track } from './track/index';\nexport { getVisitor, setVisitor } from './visitor/index';\nexport { createTrackEventSchema, createVisitorSchema, updateVisitorSchema } from './schema/index';\nexport type { TrackProperties, TrackTags, AllowedPropertyValues } from './track/types';\nexport type { VisitorProperties } from './visitor/types';\n"],"mappings":";AAAA,SAAS,sBAAsB;AAC/B,SAAS,aAAa;AACtB,SAAS,YAAY,kBAAkB;AACvC,SAAS,wBAAwB,qBAAqB,2BAA2B;","names":[]}
|
package/dist/schema/index.cjs
CHANGED
|
@@ -62,14 +62,14 @@ var createTrackEventSchema = import_zod.z.object({
|
|
|
62
62
|
properties: import_zod.z.record(
|
|
63
63
|
import_zod.z.string().trim().min(1).max(128),
|
|
64
64
|
import_zod.z.union([import_zod.z.string().max(512), import_zod.z.number(), import_zod.z.boolean(), import_zod.z.null()])
|
|
65
|
-
).refine((data) => Object.keys(data).length <= 64)
|
|
65
|
+
).refine((data) => Object.keys(data).length <= 64).optional()
|
|
66
66
|
});
|
|
67
67
|
var createVisitorSchema = import_zod.z.object({
|
|
68
68
|
device_id: import_zod.z.string().trim().min(1).max(36),
|
|
69
69
|
properties: import_zod.z.record(
|
|
70
70
|
import_zod.z.string().trim().min(1).max(128),
|
|
71
71
|
import_zod.z.union([import_zod.z.string().max(512), import_zod.z.number(), import_zod.z.boolean(), import_zod.z.null()])
|
|
72
|
-
).refine((data) => Object.keys(data).length <= 64)
|
|
72
|
+
).refine((data) => Object.keys(data).length <= 64).optional()
|
|
73
73
|
});
|
|
74
74
|
var updateVisitorSchema = import_zod.z.object({
|
|
75
75
|
properties: import_zod.z.record(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/schema/index.ts"],"sourcesContent":["import { z } from 'zod';\n\nexport const createTrackEventSchema = z.object({\n name: z.string().trim().min(1).max(64),\n visitor_id: z.coerce.bigint(),\n tags: z.object({\n os: z.string().optional(),\n os_name: z.string().optional(),\n os_version: z.string().optional(),\n browser: z.string().optional(),\n browser_name: z.string().optional(),\n browser_version: z.string().optional(),\n platform: z.enum(['ios', 'android', 'web', 'macos', 'windows', 'linux', 'unknown']).optional(),\n device: z.string().optional(),\n device_id: z.string().trim().min(1).max(36).optional(),\n device_type: z.string().optional(),\n device_vendor: z.string().optional(),\n device_pixel_ratio: z.string().optional(),\n screen_resolution: z\n .string()\n .regex(/^\\d+x\\d+$/)\n .transform((v) => v as `${number}x${number}`)\n .optional(),\n release: z.string().optional(),\n language: z.string().optional(),\n timezone: z.string().optional(),\n environment: z.enum(['development', 'production']).optional(),\n source_url: z.string().optional(),\n source: z.enum(['web', 'app', 'offline']).optional(),\n fbc: z.string().optional(),\n fbp: z.string().optional(),\n gclid: z.string().optional(),\n advertising_id: z.string().optional(),\n utm_source: z.string().optional(),\n utm_medium: z.string().optional(),\n utm_campaign: z.string().optional(),\n utm_term: z.string().optional(),\n utm_content: z.string().optional(),\n }),\n properties: z\n .record(\n z.string().trim().min(1).max(128),\n z.union([z.string().max(512), z.number(), z.boolean(), z.null()])\n )\n .refine((data) => Object.keys(data).length <= 64),\n});\n\nexport const createVisitorSchema = z.object({\n device_id: z.string().trim().min(1).max(36),\n properties: z\n .record(\n z.string().trim().min(1).max(128),\n z.union([z.string().max(512), z.number(), z.boolean(), z.null()])\n )\n .refine((data) => Object.keys(data).length <= 64),\n});\n\nexport const updateVisitorSchema = z.object({\n properties: z\n .record(\n z.string().trim().min(1).max(128),\n z.union([z.string().max(512), z.number(), z.boolean(), z.null()])\n )\n .refine((data) => Object.keys(data).length <= 64),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAkB;AAEX,IAAM,yBAAyB,aAAE,OAAO;AAAA,EAC7C,MAAM,aAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE;AAAA,EACrC,YAAY,aAAE,OAAO,OAAO;AAAA,EAC5B,MAAM,aAAE,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EAAE,SAAS;AAAA,IAChC,YAAY,aAAE,OAAO,EAAE,SAAS;AAAA,IAChC,cAAc,aAAE,OAAO,EAAE,SAAS;AAAA,IAClC,UAAU,aAAE,OAAO,EAAE,SAAS;AAAA,IAC9B,aAAa,aAAE,OAAO,EAAE,SAAS;AAAA,EACnC,CAAC;AAAA,EACD,YAAY,aACT;AAAA,IACC,aAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,IAChC,aAAE,MAAM,CAAC,aAAE,OAAO,EAAE,IAAI,GAAG,GAAG,aAAE,OAAO,GAAG,aAAE,QAAQ,GAAG,aAAE,KAAK,CAAC,CAAC;AAAA,EAClE,EACC,OAAO,CAAC,SAAS,OAAO,KAAK,IAAI,EAAE,UAAU,EAAE;
|
|
1
|
+
{"version":3,"sources":["../../src/schema/index.ts"],"sourcesContent":["import { z } from 'zod';\n\nexport const createTrackEventSchema = z.object({\n name: z.string().trim().min(1).max(64),\n visitor_id: z.coerce.bigint(),\n tags: z.object({\n os: z.string().optional(),\n os_name: z.string().optional(),\n os_version: z.string().optional(),\n browser: z.string().optional(),\n browser_name: z.string().optional(),\n browser_version: z.string().optional(),\n platform: z.enum(['ios', 'android', 'web', 'macos', 'windows', 'linux', 'unknown']).optional(),\n device: z.string().optional(),\n device_id: z.string().trim().min(1).max(36).optional(),\n device_type: z.string().optional(),\n device_vendor: z.string().optional(),\n device_pixel_ratio: z.string().optional(),\n screen_resolution: z\n .string()\n .regex(/^\\d+x\\d+$/)\n .transform((v) => v as `${number}x${number}`)\n .optional(),\n release: z.string().optional(),\n language: z.string().optional(),\n timezone: z.string().optional(),\n environment: z.enum(['development', 'production']).optional(),\n source_url: z.string().optional(),\n source: z.enum(['web', 'app', 'offline']).optional(),\n fbc: z.string().optional(),\n fbp: z.string().optional(),\n gclid: z.string().optional(),\n advertising_id: z.string().optional(),\n utm_source: z.string().optional(),\n utm_medium: z.string().optional(),\n utm_campaign: z.string().optional(),\n utm_term: z.string().optional(),\n utm_content: z.string().optional(),\n }),\n properties: z\n .record(\n z.string().trim().min(1).max(128),\n z.union([z.string().max(512), z.number(), z.boolean(), z.null()])\n )\n .refine((data) => Object.keys(data).length <= 64)\n .optional(),\n});\n\nexport const createVisitorSchema = z.object({\n device_id: z.string().trim().min(1).max(36),\n properties: z\n .record(\n z.string().trim().min(1).max(128),\n z.union([z.string().max(512), z.number(), z.boolean(), z.null()])\n )\n .refine((data) => Object.keys(data).length <= 64)\n .optional(),\n});\n\nexport const updateVisitorSchema = z.object({\n properties: z\n .record(\n z.string().trim().min(1).max(128),\n z.union([z.string().max(512), z.number(), z.boolean(), z.null()])\n )\n .refine((data) => Object.keys(data).length <= 64),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAkB;AAEX,IAAM,yBAAyB,aAAE,OAAO;AAAA,EAC7C,MAAM,aAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE;AAAA,EACrC,YAAY,aAAE,OAAO,OAAO;AAAA,EAC5B,MAAM,aAAE,OAAO;AAAA,IACb,IAAI,aAAE,OAAO,EAAE,SAAS;AAAA,IACxB,SAAS,aAAE,OAAO,EAAE,SAAS;AAAA,IAC7B,YAAY,aAAE,OAAO,EAAE,SAAS;AAAA,IAChC,SAAS,aAAE,OAAO,EAAE,SAAS;AAAA,IAC7B,cAAc,aAAE,OAAO,EAAE,SAAS;AAAA,IAClC,iBAAiB,aAAE,OAAO,EAAE,SAAS;AAAA,IACrC,UAAU,aAAE,KAAK,CAAC,OAAO,WAAW,OAAO,SAAS,WAAW,SAAS,SAAS,CAAC,EAAE,SAAS;AAAA,IAC7F,QAAQ,aAAE,OAAO,EAAE,SAAS;AAAA,IAC5B,WAAW,aAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAS;AAAA,IACrD,aAAa,aAAE,OAAO,E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,sBAAsB,aAAE,OAAO;AAAA,EAC1C,WAAW,aAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE;AAAA,EAC1C,YAAY,aACT;AAAA,IACC,aAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,IAChC,aAAE,MAAM,CAAC,aAAE,OAAO,EAAE,IAAI,GAAG,GAAG,aAAE,OAAO,GAAG,aAAE,QAAQ,GAAG,aAAE,KAAK,CAAC,CAAC;AAAA,EAClE,EACC,OAAO,CAAC,SAAS,OAAO,KAAK,IAAI,EAAE,UAAU,EAAE,EAC/C,SAAS;AACd,CAAC;AAEM,IAAM,sBAAsB,aAAE,OAAO;AAAA,EAC1C,YAAY,aACT;AAAA,IACC,aAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,IAChC,aAAE,MAAM,CAAC,aAAE,OAAO,EAAE,IAAI,GAAG,GAAG,aAAE,OAAO,GAAG,aAAE,QAAQ,GAAG,aAAE,KAAK,CAAC,CAAC;AAAA,EAClE,EACC,OAAO,CAAC,SAAS,OAAO,KAAK,IAAI,EAAE,UAAU,EAAE;AACpD,CAAC;","names":[]}
|
package/dist/schema/index.d.cts
CHANGED
|
@@ -91,7 +91,7 @@ declare const createTrackEventSchema: z.ZodObject<{
|
|
|
91
91
|
utm_term?: string | undefined;
|
|
92
92
|
utm_content?: string | undefined;
|
|
93
93
|
}>;
|
|
94
|
-
properties: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, Record<string, string | number | boolean | null>, Record<string, string | number | boolean | null
|
|
94
|
+
properties: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, Record<string, string | number | boolean | null>, Record<string, string | number | boolean | null>>>;
|
|
95
95
|
}, "strip", z.ZodTypeAny, {
|
|
96
96
|
visitor_id: bigint;
|
|
97
97
|
name: string;
|
|
@@ -125,7 +125,7 @@ declare const createTrackEventSchema: z.ZodObject<{
|
|
|
125
125
|
utm_term?: string | undefined;
|
|
126
126
|
utm_content?: string | undefined;
|
|
127
127
|
};
|
|
128
|
-
properties
|
|
128
|
+
properties?: Record<string, string | number | boolean | null> | undefined;
|
|
129
129
|
}, {
|
|
130
130
|
visitor_id: bigint;
|
|
131
131
|
name: string;
|
|
@@ -159,17 +159,17 @@ declare const createTrackEventSchema: z.ZodObject<{
|
|
|
159
159
|
utm_term?: string | undefined;
|
|
160
160
|
utm_content?: string | undefined;
|
|
161
161
|
};
|
|
162
|
-
properties
|
|
162
|
+
properties?: Record<string, string | number | boolean | null> | undefined;
|
|
163
163
|
}>;
|
|
164
164
|
declare const createVisitorSchema: z.ZodObject<{
|
|
165
165
|
device_id: z.ZodString;
|
|
166
|
-
properties: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, Record<string, string | number | boolean | null>, Record<string, string | number | boolean | null
|
|
166
|
+
properties: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, Record<string, string | number | boolean | null>, Record<string, string | number | boolean | null>>>;
|
|
167
167
|
}, "strip", z.ZodTypeAny, {
|
|
168
168
|
device_id: string;
|
|
169
|
-
properties
|
|
169
|
+
properties?: Record<string, string | number | boolean | null> | undefined;
|
|
170
170
|
}, {
|
|
171
171
|
device_id: string;
|
|
172
|
-
properties
|
|
172
|
+
properties?: Record<string, string | number | boolean | null> | undefined;
|
|
173
173
|
}>;
|
|
174
174
|
declare const updateVisitorSchema: z.ZodObject<{
|
|
175
175
|
properties: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, Record<string, string | number | boolean | null>, Record<string, string | number | boolean | null>>;
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -91,7 +91,7 @@ declare const createTrackEventSchema: z.ZodObject<{
|
|
|
91
91
|
utm_term?: string | undefined;
|
|
92
92
|
utm_content?: string | undefined;
|
|
93
93
|
}>;
|
|
94
|
-
properties: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, Record<string, string | number | boolean | null>, Record<string, string | number | boolean | null
|
|
94
|
+
properties: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, Record<string, string | number | boolean | null>, Record<string, string | number | boolean | null>>>;
|
|
95
95
|
}, "strip", z.ZodTypeAny, {
|
|
96
96
|
visitor_id: bigint;
|
|
97
97
|
name: string;
|
|
@@ -125,7 +125,7 @@ declare const createTrackEventSchema: z.ZodObject<{
|
|
|
125
125
|
utm_term?: string | undefined;
|
|
126
126
|
utm_content?: string | undefined;
|
|
127
127
|
};
|
|
128
|
-
properties
|
|
128
|
+
properties?: Record<string, string | number | boolean | null> | undefined;
|
|
129
129
|
}, {
|
|
130
130
|
visitor_id: bigint;
|
|
131
131
|
name: string;
|
|
@@ -159,17 +159,17 @@ declare const createTrackEventSchema: z.ZodObject<{
|
|
|
159
159
|
utm_term?: string | undefined;
|
|
160
160
|
utm_content?: string | undefined;
|
|
161
161
|
};
|
|
162
|
-
properties
|
|
162
|
+
properties?: Record<string, string | number | boolean | null> | undefined;
|
|
163
163
|
}>;
|
|
164
164
|
declare const createVisitorSchema: z.ZodObject<{
|
|
165
165
|
device_id: z.ZodString;
|
|
166
|
-
properties: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, Record<string, string | number | boolean | null>, Record<string, string | number | boolean | null
|
|
166
|
+
properties: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, Record<string, string | number | boolean | null>, Record<string, string | number | boolean | null>>>;
|
|
167
167
|
}, "strip", z.ZodTypeAny, {
|
|
168
168
|
device_id: string;
|
|
169
|
-
properties
|
|
169
|
+
properties?: Record<string, string | number | boolean | null> | undefined;
|
|
170
170
|
}, {
|
|
171
171
|
device_id: string;
|
|
172
|
-
properties
|
|
172
|
+
properties?: Record<string, string | number | boolean | null> | undefined;
|
|
173
173
|
}>;
|
|
174
174
|
declare const updateVisitorSchema: z.ZodObject<{
|
|
175
175
|
properties: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, Record<string, string | number | boolean | null>, Record<string, string | number | boolean | null>>;
|
package/dist/schema/index.mjs
CHANGED
|
@@ -36,14 +36,14 @@ var createTrackEventSchema = z.object({
|
|
|
36
36
|
properties: z.record(
|
|
37
37
|
z.string().trim().min(1).max(128),
|
|
38
38
|
z.union([z.string().max(512), z.number(), z.boolean(), z.null()])
|
|
39
|
-
).refine((data) => Object.keys(data).length <= 64)
|
|
39
|
+
).refine((data) => Object.keys(data).length <= 64).optional()
|
|
40
40
|
});
|
|
41
41
|
var createVisitorSchema = z.object({
|
|
42
42
|
device_id: z.string().trim().min(1).max(36),
|
|
43
43
|
properties: z.record(
|
|
44
44
|
z.string().trim().min(1).max(128),
|
|
45
45
|
z.union([z.string().max(512), z.number(), z.boolean(), z.null()])
|
|
46
|
-
).refine((data) => Object.keys(data).length <= 64)
|
|
46
|
+
).refine((data) => Object.keys(data).length <= 64).optional()
|
|
47
47
|
});
|
|
48
48
|
var updateVisitorSchema = z.object({
|
|
49
49
|
properties: z.record(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/schema/index.ts"],"sourcesContent":["import { z } from 'zod';\n\nexport const createTrackEventSchema = z.object({\n name: z.string().trim().min(1).max(64),\n visitor_id: z.coerce.bigint(),\n tags: z.object({\n os: z.string().optional(),\n os_name: z.string().optional(),\n os_version: z.string().optional(),\n browser: z.string().optional(),\n browser_name: z.string().optional(),\n browser_version: z.string().optional(),\n platform: z.enum(['ios', 'android', 'web', 'macos', 'windows', 'linux', 'unknown']).optional(),\n device: z.string().optional(),\n device_id: z.string().trim().min(1).max(36).optional(),\n device_type: z.string().optional(),\n device_vendor: z.string().optional(),\n device_pixel_ratio: z.string().optional(),\n screen_resolution: z\n .string()\n .regex(/^\\d+x\\d+$/)\n .transform((v) => v as `${number}x${number}`)\n .optional(),\n release: z.string().optional(),\n language: z.string().optional(),\n timezone: z.string().optional(),\n environment: z.enum(['development', 'production']).optional(),\n source_url: z.string().optional(),\n source: z.enum(['web', 'app', 'offline']).optional(),\n fbc: z.string().optional(),\n fbp: z.string().optional(),\n gclid: z.string().optional(),\n advertising_id: z.string().optional(),\n utm_source: z.string().optional(),\n utm_medium: z.string().optional(),\n utm_campaign: z.string().optional(),\n utm_term: z.string().optional(),\n utm_content: z.string().optional(),\n }),\n properties: z\n .record(\n z.string().trim().min(1).max(128),\n z.union([z.string().max(512), z.number(), z.boolean(), z.null()])\n )\n .refine((data) => Object.keys(data).length <= 64),\n});\n\nexport const createVisitorSchema = z.object({\n device_id: z.string().trim().min(1).max(36),\n properties: z\n .record(\n z.string().trim().min(1).max(128),\n z.union([z.string().max(512), z.number(), z.boolean(), z.null()])\n )\n .refine((data) => Object.keys(data).length <= 64),\n});\n\nexport const updateVisitorSchema = z.object({\n properties: z\n .record(\n z.string().trim().min(1).max(128),\n z.union([z.string().max(512), z.number(), z.boolean(), z.null()])\n )\n .refine((data) => Object.keys(data).length <= 64),\n});\n"],"mappings":";AAAA,SAAS,SAAS;AAEX,IAAM,yBAAyB,EAAE,OAAO;AAAA,EAC7C,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE;AAAA,EACrC,YAAY,EA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AAE,SAAS;AAAA,IACpC,YAAY,EAAE,OAAO,EAAE,SAAS;AAAA,IAChC,YAAY,EAAE,OAAO,EAAE,SAAS;AAAA,IAChC,cAAc,EAAE,OAAO,EAAE,SAAS;AAAA,IAClC,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,IAC9B,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,EACnC,CAAC;AAAA,EACD,YAAY,EACT;AAAA,IACC,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,IAChC,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,IAAI,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,KAAK,CAAC,CAAC;AAAA,EAClE,EACC,OAAO,CAAC,SAAS,OAAO,KAAK,IAAI,EAAE,UAAU,EAAE;
|
|
1
|
+
{"version":3,"sources":["../../src/schema/index.ts"],"sourcesContent":["import { z } from 'zod';\n\nexport const createTrackEventSchema = z.object({\n name: z.string().trim().min(1).max(64),\n visitor_id: z.coerce.bigint(),\n tags: z.object({\n os: z.string().optional(),\n os_name: z.string().optional(),\n os_version: z.string().optional(),\n browser: z.string().optional(),\n browser_name: z.string().optional(),\n browser_version: z.string().optional(),\n platform: z.enum(['ios', 'android', 'web', 'macos', 'windows', 'linux', 'unknown']).optional(),\n device: z.string().optional(),\n device_id: z.string().trim().min(1).max(36).optional(),\n device_type: z.string().optional(),\n device_vendor: z.string().optional(),\n device_pixel_ratio: z.string().optional(),\n screen_resolution: z\n .string()\n .regex(/^\\d+x\\d+$/)\n .transform((v) => v as `${number}x${number}`)\n .optional(),\n release: z.string().optional(),\n language: z.string().optional(),\n timezone: z.string().optional(),\n environment: z.enum(['development', 'production']).optional(),\n source_url: z.string().optional(),\n source: z.enum(['web', 'app', 'offline']).optional(),\n fbc: z.string().optional(),\n fbp: z.string().optional(),\n gclid: z.string().optional(),\n advertising_id: z.string().optional(),\n utm_source: z.string().optional(),\n utm_medium: z.string().optional(),\n utm_campaign: z.string().optional(),\n utm_term: z.string().optional(),\n utm_content: z.string().optional(),\n }),\n properties: z\n .record(\n z.string().trim().min(1).max(128),\n z.union([z.string().max(512), z.number(), z.boolean(), z.null()])\n )\n .refine((data) => Object.keys(data).length <= 64)\n .optional(),\n});\n\nexport const createVisitorSchema = z.object({\n device_id: z.string().trim().min(1).max(36),\n properties: z\n .record(\n z.string().trim().min(1).max(128),\n z.union([z.string().max(512), z.number(), z.boolean(), z.null()])\n )\n .refine((data) => Object.keys(data).length <= 64)\n .optional(),\n});\n\nexport const updateVisitorSchema = z.object({\n properties: z\n .record(\n z.string().trim().min(1).max(128),\n z.union([z.string().max(512), z.number(), z.boolean(), z.null()])\n )\n .refine((data) => Object.keys(data).length <= 64),\n});\n"],"mappings":";AAAA,SAAS,SAAS;AAEX,IAAM,yBAAyB,EAAE,OAAO;AAAA,EAC7C,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE;AAAA,EACrC,YAAY,EAAE,OAAO,OAAO;AAAA,EAC5B,MAAM,EAAE,OAAO;AAAA,IACb,IAAI,EAAE,OAAO,EAAE,SAAS;AAAA,IACxB,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,IAC7B,YAAY,EAAE,OAAO,EAAE,SAAS;AAAA,IAChC,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,IAC7B,cAAc,EAAE,OAAO,EAAE,SAAS;AAAA,IAClC,iBAAiB,EAAE,OAAO,EAAE,SAAS;AAAA,IACrC,UAAU,EAAE,KAAK,CAAC,OAAO,WAAW,OAAO,SAAS,WAAW,SAAS,SAAS,CAAC,EAAE,SAAS;AAAA,IAC7F,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,IAC5B,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAS;AAAA,IACrD,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,IACj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;AAAA,EAC1C,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE;AAAA,EAC1C,YAAY,EACT;AAAA,IACC,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,IAChC,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,IAAI,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,KAAK,CAAC,CAAC;AAAA,EAClE,EACC,OAAO,CAAC,SAAS,OAAO,KAAK,IAAI,EAAE,UAAU,EAAE,EAC/C,SAAS;AACd,CAAC;AAEM,IAAM,sBAAsB,EAAE,OAAO;AAAA,EAC1C,YAAY,EACT;AAAA,IACC,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,IAChC,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,IAAI,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,KAAK,CAAC,CAAC;AAAA,EAClE,EACC,OAAO,CAAC,SAAS,OAAO,KAAK,IAAI,EAAE,UAAU,EAAE;AACpD,CAAC;","names":[]}
|
package/dist/track/types.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/track/types.ts"],"sourcesContent":["import type { StandardEvents, UserProvidedData as GAUserProvidedData } from './gtag';\n\nexport type AllowedPropertyValues = string | number | boolean | null;\nexport type EventName = Lowercase<string> | 'CLS' | 'FCP' | 'FID' | '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?: string;\n screen_width?: number;\n screen_height?: number;\n screen_resolution?: `${number}x${number}`;\n}\n\nexport interface AppInfo {\n install_referrer?: string;\n}\n\nexport interface EnvironmentInfo {\n release?: string;\n language?: string;\n timezone?: string;\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 */\n fbc?: string;\n fbp?: string;\n /**\n * Google Analytics fields\n */\n gclid?: string;\n /** iOS: IDFA, Android: Android Advertising ID */\n advertising_id?: string;\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}\n\nexport interface TrackTags\n extends 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 interface CreateTrackEventDTO<T extends EventName = EventName> {\n name: TrackName<T>;\n tags: TrackTags;\n visitor_id: string;\n properties?: TrackProperties<T>;\n timestamp: string;\n}\n\nexport interface TrackEvent<T extends EventName = EventName> {\n id: string | bigint;\n name: TrackName<T>;\n tags: TrackTags;\n visitor_id: string | bigint;\n properties?: TrackProperties<T>;\n created_at: string;\n}\n\nexport interface TrackEventResponse {\n /**\n * track event id\n * some tracking system will use event_id and event_name for deduplication\n * */\n id: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/track/types.ts"],"sourcesContent":["import type { StandardEvents, UserProvidedData as GAUserProvidedData } from './gtag';\n\nexport type AllowedPropertyValues = string | number | boolean | null;\nexport type EventName = Lowercase<string> | 'CLS' | 'FCP' | 'FID' | '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?: string;\n screen_width?: number;\n screen_height?: number;\n screen_resolution?: `${number}x${number}`;\n}\n\nexport interface AppInfo {\n install_referrer?: string;\n}\n\nexport interface EnvironmentInfo {\n release?: string;\n language?: string;\n timezone?: 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 */\n fbc?: string;\n fbp?: string;\n /**\n * Google Analytics fields\n */\n gclid?: string;\n /** iOS: IDFA, Android: Android Advertising ID */\n advertising_id?: string;\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}\n\nexport interface TrackTags\n extends 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 interface CreateTrackEventDTO<T extends EventName = EventName> {\n name: TrackName<T>;\n tags: TrackTags;\n visitor_id: string;\n properties?: TrackProperties<T>;\n timestamp: string;\n}\n\nexport interface TrackEvent<T extends EventName = EventName> {\n id: string | bigint;\n name: TrackName<T>;\n tags: TrackTags;\n visitor_id: string | bigint;\n properties?: TrackProperties<T>;\n created_at: string;\n}\n\nexport interface TrackEventResponse {\n /**\n * track event id\n * some tracking system will use event_id and event_name for deduplication\n * */\n id: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
package/dist/track/types.d.cts
CHANGED
package/dist/track/types.d.ts
CHANGED