@shware/analytics 0.1.2 → 0.1.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.
- package/dist/index.d.mts +10 -3
- package/dist/index.mjs +11 -5
- package/package.json +1 -1
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>;
|
|
@@ -192,5 +192,12 @@ declare const createVisitorSchema: z.ZodObject<{
|
|
|
192
192
|
device_id: string;
|
|
193
193
|
properties: Record<string, string | number | boolean | null>;
|
|
194
194
|
}>;
|
|
195
|
+
declare const updateVisitorSchema: z.ZodObject<{
|
|
196
|
+
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>>;
|
|
197
|
+
}, "strip", z.ZodTypeAny, {
|
|
198
|
+
properties: Record<string, string | number | boolean | null>;
|
|
199
|
+
}, {
|
|
200
|
+
properties: Record<string, string | number | boolean | null>;
|
|
201
|
+
}>;
|
|
195
202
|
|
|
196
|
-
export { TrackProperties, TrackTags, VisitorProperties, createTrackEventSchema, createVisitorSchema, getVisitor, setVisitor, setupAnalytics, track };
|
|
203
|
+
export { TrackProperties, TrackTags, VisitorProperties, createTrackEventSchema, createVisitorSchema, getVisitor, setVisitor, setupAnalytics, track, updateVisitorSchema };
|
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
|
+
const updateVisitorSchema = 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
|
-
export { createTrackEventSchema, createVisitorSchema, getVisitor, setVisitor, setupAnalytics, track };
|
|
144
|
+
export { createTrackEventSchema, createVisitorSchema, getVisitor, setVisitor, setupAnalytics, track, updateVisitorSchema };
|