@reservamos/browser-analytics 0.1.3 → 0.1.4-alpha.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.
@@ -2,10 +2,78 @@
2
2
 
3
3
  import { z } from 'zod';
4
4
 
5
- /**
6
- First test event to track, it purpose is to test the tracking library and the identification service.ws
7
- */
8
- export declare function trackTest(): void;
5
+ declare const IdentifySchema: z.ZodObject<{
6
+ firstName: z.ZodOptional<z.ZodString>;
7
+ lastName: z.ZodOptional<z.ZodString>;
8
+ email: z.ZodOptional<z.ZodString>;
9
+ phone: z.ZodOptional<z.ZodString>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ email?: string | undefined;
12
+ firstName?: string | undefined;
13
+ lastName?: string | undefined;
14
+ phone?: string | undefined;
15
+ }, {
16
+ email?: string | undefined;
17
+ firstName?: string | undefined;
18
+ lastName?: string | undefined;
19
+ phone?: string | undefined;
20
+ }>;
21
+ export type DefaultProperties = z.infer<typeof IdentifySchema>;
22
+ export interface UserProperties extends DefaultProperties, Record<string, string | number | boolean | undefined> {
23
+ }
24
+ declare function identify(userId: string, properties?: UserProperties): Promise<void>;
25
+ declare const searchSchema: z.ZodObject<{
26
+ Departure: z.ZodEffects<z.ZodString, string, string>;
27
+ "Departure Delta": z.ZodNumber;
28
+ Destination: z.ZodString;
29
+ "Destination Terminal": z.ZodString;
30
+ "User Fingerprint": z.ZodOptional<z.ZodEffects<z.ZodUnion<[
31
+ z.ZodString,
32
+ z.ZodNull
33
+ ]>, string | null, string | null>>;
34
+ Origin: z.ZodString;
35
+ "Origin Terminal": z.ZodString;
36
+ Passengers: z.ZodNumber;
37
+ Return: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
38
+ Route: z.ZodString;
39
+ "Trip Length": z.ZodOptional<z.ZodNumber>;
40
+ product: z.ZodEffects<z.ZodEnum<[
41
+ "web",
42
+ "web-mobile",
43
+ "ios",
44
+ "android",
45
+ "app"
46
+ ]>, "web" | "web-mobile" | "ios" | "android" | "app", "web" | "web-mobile" | "ios" | "android" | "app">;
47
+ }, "strip", z.ZodTypeAny, {
48
+ product: "web" | "web-mobile" | "ios" | "android" | "app";
49
+ Departure: string;
50
+ "Departure Delta": number;
51
+ Destination: string;
52
+ "Destination Terminal": string;
53
+ Origin: string;
54
+ "Origin Terminal": string;
55
+ Passengers: number;
56
+ Route: string;
57
+ "User Fingerprint"?: string | null | undefined;
58
+ Return?: string | undefined;
59
+ "Trip Length"?: number | undefined;
60
+ }, {
61
+ product: "web" | "web-mobile" | "ios" | "android" | "app";
62
+ Departure: string;
63
+ "Departure Delta": number;
64
+ Destination: string;
65
+ "Destination Terminal": string;
66
+ Origin: string;
67
+ "Origin Terminal": string;
68
+ Passengers: number;
69
+ Route: string;
70
+ "User Fingerprint"?: string | null | undefined;
71
+ Return?: string | undefined;
72
+ "Trip Length"?: number | undefined;
73
+ }>;
74
+ export type SearchProps = z.infer<typeof searchSchema>;
75
+ declare function trackSearch(eventData: SearchProps): void;
76
+ declare function trackTest(): void;
9
77
  declare const InitConfigSchema: z.ZodObject<{
10
78
  /**
11
79
  * The Mixpanel token used for authenticating API requests.
@@ -33,19 +101,18 @@ declare const InitConfigSchema: z.ZodObject<{
33
101
  * Configuration object for initializing the tracking library.
34
102
  */
35
103
  export type InitConfig = z.infer<typeof InitConfigSchema>;
36
- /**
37
- * Initializes the tracking library with the provided configuration.
38
- * @param {InitConfig} config - The configuration object for initialization.
39
- * @throws {Error} Throws an error if the configuration is invalid.
40
- */
41
- export declare function init(config: InitConfig): Promise<void>;
42
- declare const tracker: {
104
+ declare function init(config: InitConfig): Promise<void>;
105
+ declare const analytics: {
43
106
  init: typeof init;
44
- trackTest: typeof trackTest;
107
+ identify: typeof identify;
108
+ track: {
109
+ test: typeof trackTest;
110
+ search: typeof trackSearch;
111
+ };
45
112
  };
46
113
 
47
114
  export {
48
- tracker as default,
115
+ analytics as default,
49
116
  };
50
117
 
51
118
  export {};