@shware/analytics 0.1.2 → 0.1.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.d.mts CHANGED
@@ -114,7 +114,7 @@ declare const createTrackEventSchema: z.ZodObject<{
114
114
  utm_term?: string | undefined;
115
115
  utm_content?: string | undefined;
116
116
  }>;
117
- properties: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
117
+ 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>>;
118
118
  }, "strip", z.ZodTypeAny, {
119
119
  visitor_id: bigint;
120
120
  name: string;
@@ -184,7 +184,7 @@ declare const createTrackEventSchema: z.ZodObject<{
184
184
  }>;
185
185
  declare const createVisitorSchema: z.ZodObject<{
186
186
  device_id: z.ZodString;
187
- properties: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
187
+ 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>>;
188
188
  }, "strip", z.ZodTypeAny, {
189
189
  device_id: string;
190
190
  properties: Record<string, string | number | boolean | null>;
package/dist/index.mjs CHANGED
@@ -124,15 +124,21 @@ const createTrackEventSchema = z.object({
124
124
  }),
125
125
  properties: z.record(
126
126
  z.string().trim().min(1).max(128),
127
- z.union([z.string(), z.number(), z.boolean(), z.null()])
128
- )
127
+ z.union([z.string().max(512), z.number(), z.boolean(), z.null()])
128
+ ).refine((data) => Object.keys(data).length <= 64)
129
129
  });
130
130
  const createVisitorSchema = z.object({
131
131
  device_id: z.string().trim().min(1).max(36),
132
132
  properties: z.record(
133
133
  z.string().trim().min(1).max(128),
134
- z.union([z.string(), z.number(), z.boolean(), z.null()])
135
- )
134
+ z.union([z.string().max(512), z.number(), z.boolean(), z.null()])
135
+ ).refine((data) => Object.keys(data).length <= 64)
136
+ });
137
+ z.object({
138
+ properties: z.record(
139
+ z.string().trim().min(1).max(128),
140
+ z.union([z.string().max(512), z.number(), z.boolean(), z.null()])
141
+ ).refine((data) => Object.keys(data).length <= 64)
136
142
  });
137
143
 
138
144
  export { createTrackEventSchema, createVisitorSchema, getVisitor, setVisitor, setupAnalytics, track };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shware/analytics",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "tsc --watch",