@shware/analytics 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -28,6 +28,7 @@ declare function setVisitor(properties: VisitorProperties): Promise<Visitor>;
28
28
 
29
29
  declare const createTrackEventSchema: z.ZodObject<{
30
30
  name: z.ZodString;
31
+ visitor_id: z.ZodBigInt;
31
32
  tags: z.ZodObject<{
32
33
  os: z.ZodOptional<z.ZodString>;
33
34
  os_name: z.ZodOptional<z.ZodString>;
@@ -41,7 +42,7 @@ declare const createTrackEventSchema: z.ZodObject<{
41
42
  device_type: z.ZodOptional<z.ZodString>;
42
43
  device_vendor: z.ZodOptional<z.ZodString>;
43
44
  device_pixel_ratio: z.ZodOptional<z.ZodString>;
44
- screen_resolution: z.ZodOptional<z.ZodString>;
45
+ screen_resolution: z.ZodOptional<z.ZodEffects<z.ZodString, `${number}x${number}`, string>>;
45
46
  release: z.ZodOptional<z.ZodString>;
46
47
  language: z.ZodOptional<z.ZodString>;
47
48
  timezone: z.ZodOptional<z.ZodString>;
@@ -69,7 +70,7 @@ declare const createTrackEventSchema: z.ZodObject<{
69
70
  device_type?: string | undefined;
70
71
  device_vendor?: string | undefined;
71
72
  device_pixel_ratio?: string | undefined;
72
- screen_resolution?: string | undefined;
73
+ screen_resolution?: `${number}x${number}` | undefined;
73
74
  release?: string | undefined;
74
75
  language?: string | undefined;
75
76
  timezone?: string | undefined;
@@ -115,6 +116,7 @@ declare const createTrackEventSchema: z.ZodObject<{
115
116
  }>;
116
117
  properties: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
117
118
  }, "strip", z.ZodTypeAny, {
119
+ visitor_id: bigint;
118
120
  name: string;
119
121
  tags: {
120
122
  os?: string | undefined;
@@ -129,7 +131,7 @@ declare const createTrackEventSchema: z.ZodObject<{
129
131
  device_type?: string | undefined;
130
132
  device_vendor?: string | undefined;
131
133
  device_pixel_ratio?: string | undefined;
132
- screen_resolution?: string | undefined;
134
+ screen_resolution?: `${number}x${number}` | undefined;
133
135
  release?: string | undefined;
134
136
  language?: string | undefined;
135
137
  timezone?: string | undefined;
@@ -147,6 +149,7 @@ declare const createTrackEventSchema: z.ZodObject<{
147
149
  };
148
150
  properties: Record<string, string | number | boolean | null>;
149
151
  }, {
152
+ visitor_id: bigint;
150
153
  name: string;
151
154
  tags: {
152
155
  os?: string | undefined;
package/dist/index.mjs CHANGED
@@ -92,6 +92,7 @@ function track(name, properties, trackOptions = defaultOptions) {
92
92
 
93
93
  const createTrackEventSchema = z.object({
94
94
  name: z.string().trim().min(1).max(64),
95
+ visitor_id: z.coerce.bigint(),
95
96
  tags: z.object({
96
97
  os: z.string().optional(),
97
98
  os_name: z.string().optional(),
@@ -105,7 +106,7 @@ const createTrackEventSchema = z.object({
105
106
  device_type: z.string().optional(),
106
107
  device_vendor: z.string().optional(),
107
108
  device_pixel_ratio: z.string().optional(),
108
- screen_resolution: z.string().regex(/^\d+x\d+$/).optional(),
109
+ screen_resolution: z.string().regex(/^\d+x\d+$/).transform((v) => v).optional(),
109
110
  release: z.string().optional(),
110
111
  language: z.string().optional(),
111
112
  timezone: z.string().optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shware/analytics",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "tsc --watch",