@reservamos/browser-analytics 0.3.0 → 0.3.1-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.
- package/dist/browser-analytics.cjs +3 -3
- package/dist/browser-analytics.cjs.map +1 -1
- package/dist/browser-analytics.d.ts +223 -2
- package/dist/browser-analytics.esm.js +37 -22
- package/dist/browser-analytics.esm.js.map +1 -1
- package/dist/browser-analytics.iife.js +3 -3
- package/dist/browser-analytics.iife.js.map +1 -1
- package/package.json +1 -1
- package/src/events/passengersCreated/passengersCreatedSchema.ts +2 -0
- package/src/events/paymentAttempt/paymentAttemptSchema.ts +9 -1
- package/src/events/purchaseAttempt/purchaseAttemptSchema.ts +9 -1
- package/src/events/purchaseCanceled/index.ts +7 -0
- package/src/events/purchaseCanceled/purchaseCanceledSchema.ts +19 -0
- package/src/events/purchaseCanceled/trackPurchaseCanceled.ts +19 -0
- package/src/events/sharedSchemas/passengerSchema.ts +12 -0
- package/src/index.ts +4 -0
|
@@ -117,6 +117,15 @@ declare const passengersCreatedSchema: z.ZodObject<{
|
|
|
117
117
|
"android",
|
|
118
118
|
"app"
|
|
119
119
|
]>, "web" | "web-mobile" | "ios" | "android" | "app", "web" | "web-mobile" | "ios" | "android" | "app">;
|
|
120
|
+
Passengers: z.ZodOptional<z.ZodArray<z.ZodType<{
|
|
121
|
+
"Passenger Name": string;
|
|
122
|
+
"Passenger Document Type": string;
|
|
123
|
+
"Passenger Document Id": number;
|
|
124
|
+
}, z.ZodTypeDef, {
|
|
125
|
+
"Passenger Name": string;
|
|
126
|
+
"Passenger Document Type": string;
|
|
127
|
+
"Passenger Document Id": number;
|
|
128
|
+
}>, "many">>;
|
|
120
129
|
}, "strict", z.ZodTypeAny, {
|
|
121
130
|
product: "web" | "web-mobile" | "ios" | "android" | "app";
|
|
122
131
|
Trips: {
|
|
@@ -150,6 +159,11 @@ declare const passengersCreatedSchema: z.ZodObject<{
|
|
|
150
159
|
"Passenger Count": number;
|
|
151
160
|
Total: number;
|
|
152
161
|
"Trip Count"?: number | undefined;
|
|
162
|
+
Passengers?: {
|
|
163
|
+
"Passenger Name": string;
|
|
164
|
+
"Passenger Document Type": string;
|
|
165
|
+
"Passenger Document Id": number;
|
|
166
|
+
}[] | undefined;
|
|
153
167
|
}, {
|
|
154
168
|
product: "web" | "web-mobile" | "ios" | "android" | "app";
|
|
155
169
|
Trips: {
|
|
@@ -183,10 +197,16 @@ declare const passengersCreatedSchema: z.ZodObject<{
|
|
|
183
197
|
"Passenger Count": number;
|
|
184
198
|
Total: number;
|
|
185
199
|
"Trip Count"?: number | undefined;
|
|
200
|
+
Passengers?: {
|
|
201
|
+
"Passenger Name": string;
|
|
202
|
+
"Passenger Document Type": string;
|
|
203
|
+
"Passenger Document Id": number;
|
|
204
|
+
}[] | undefined;
|
|
186
205
|
}>;
|
|
187
206
|
export type PassengersCreatedProps = z.infer<typeof passengersCreatedSchema>;
|
|
188
207
|
declare function trackPassengersCreated(eventProps: PassengersCreatedProps, meta?: EventMetadata): void;
|
|
189
208
|
declare const paymentAttemptSchema: z.ZodObject<{
|
|
209
|
+
"Operation Id": z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
190
210
|
Trips: z.ZodArray<z.ZodType<{
|
|
191
211
|
"Departure Arrival": string;
|
|
192
212
|
"Departure Destination": string;
|
|
@@ -253,6 +273,15 @@ declare const paymentAttemptSchema: z.ZodObject<{
|
|
|
253
273
|
"android",
|
|
254
274
|
"app"
|
|
255
275
|
]>, "web" | "web-mobile" | "ios" | "android" | "app", "web" | "web-mobile" | "ios" | "android" | "app">;
|
|
276
|
+
Passengers: z.ZodOptional<z.ZodArray<z.ZodType<{
|
|
277
|
+
"Passenger Name": string;
|
|
278
|
+
"Passenger Document Type": string;
|
|
279
|
+
"Passenger Document Id": number;
|
|
280
|
+
}, z.ZodTypeDef, {
|
|
281
|
+
"Passenger Name": string;
|
|
282
|
+
"Passenger Document Type": string;
|
|
283
|
+
"Passenger Document Id": number;
|
|
284
|
+
}>, "many">>;
|
|
256
285
|
}, "strict", z.ZodTypeAny, {
|
|
257
286
|
product: "web" | "web-mobile" | "ios" | "android" | "app";
|
|
258
287
|
Trips: {
|
|
@@ -287,6 +316,12 @@ declare const paymentAttemptSchema: z.ZodObject<{
|
|
|
287
316
|
"Trip Count": number;
|
|
288
317
|
Total: number;
|
|
289
318
|
"Payment Type": string;
|
|
319
|
+
Passengers?: {
|
|
320
|
+
"Passenger Name": string;
|
|
321
|
+
"Passenger Document Type": string;
|
|
322
|
+
"Passenger Document Id": number;
|
|
323
|
+
}[] | undefined;
|
|
324
|
+
"Operation Id"?: string | undefined;
|
|
290
325
|
}, {
|
|
291
326
|
product: "web" | "web-mobile" | "ios" | "android" | "app";
|
|
292
327
|
Trips: {
|
|
@@ -321,6 +356,12 @@ declare const paymentAttemptSchema: z.ZodObject<{
|
|
|
321
356
|
"Trip Count": number;
|
|
322
357
|
Total: number;
|
|
323
358
|
"Payment Type": string;
|
|
359
|
+
Passengers?: {
|
|
360
|
+
"Passenger Name": string;
|
|
361
|
+
"Passenger Document Type": string;
|
|
362
|
+
"Passenger Document Id": number;
|
|
363
|
+
}[] | undefined;
|
|
364
|
+
"Operation Id"?: string | undefined;
|
|
324
365
|
}>;
|
|
325
366
|
export type PaymentAttemptProps = z.infer<typeof paymentAttemptSchema>;
|
|
326
367
|
declare const pickedDepartureSchema: z.ZodObject<{
|
|
@@ -384,6 +425,7 @@ declare const pickedDepartureSchema: z.ZodObject<{
|
|
|
384
425
|
export type PickedDepartureProps = z.infer<typeof pickedDepartureSchema>;
|
|
385
426
|
declare function trackSearch(eventData: PickedDepartureProps, meta?: EventMetadata): void;
|
|
386
427
|
declare const purchaseAttemptSchema: z.ZodObject<{
|
|
428
|
+
"Operation Id": z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
387
429
|
Trips: z.ZodArray<z.ZodType<{
|
|
388
430
|
"Departure Arrival": string;
|
|
389
431
|
"Departure Destination": string;
|
|
@@ -449,6 +491,15 @@ declare const purchaseAttemptSchema: z.ZodObject<{
|
|
|
449
491
|
"android",
|
|
450
492
|
"app"
|
|
451
493
|
]>, "web" | "web-mobile" | "ios" | "android" | "app", "web" | "web-mobile" | "ios" | "android" | "app">;
|
|
494
|
+
Passengers: z.ZodOptional<z.ZodArray<z.ZodType<{
|
|
495
|
+
"Passenger Name": string;
|
|
496
|
+
"Passenger Document Type": string;
|
|
497
|
+
"Passenger Document Id": number;
|
|
498
|
+
}, z.ZodTypeDef, {
|
|
499
|
+
"Passenger Name": string;
|
|
500
|
+
"Passenger Document Type": string;
|
|
501
|
+
"Passenger Document Id": number;
|
|
502
|
+
}>, "many">>;
|
|
452
503
|
}, "strict", z.ZodTypeAny, {
|
|
453
504
|
product: "web" | "web-mobile" | "ios" | "android" | "app";
|
|
454
505
|
Trips: {
|
|
@@ -482,6 +533,12 @@ declare const purchaseAttemptSchema: z.ZodObject<{
|
|
|
482
533
|
"Passenger Count": number;
|
|
483
534
|
"Trip Count": number;
|
|
484
535
|
Total: number;
|
|
536
|
+
Passengers?: {
|
|
537
|
+
"Passenger Name": string;
|
|
538
|
+
"Passenger Document Type": string;
|
|
539
|
+
"Passenger Document Id": number;
|
|
540
|
+
}[] | undefined;
|
|
541
|
+
"Operation Id"?: string | undefined;
|
|
485
542
|
}, {
|
|
486
543
|
product: "web" | "web-mobile" | "ios" | "android" | "app";
|
|
487
544
|
Trips: {
|
|
@@ -515,9 +572,172 @@ declare const purchaseAttemptSchema: z.ZodObject<{
|
|
|
515
572
|
"Passenger Count": number;
|
|
516
573
|
"Trip Count": number;
|
|
517
574
|
Total: number;
|
|
575
|
+
Passengers?: {
|
|
576
|
+
"Passenger Name": string;
|
|
577
|
+
"Passenger Document Type": string;
|
|
578
|
+
"Passenger Document Id": number;
|
|
579
|
+
}[] | undefined;
|
|
580
|
+
"Operation Id"?: string | undefined;
|
|
518
581
|
}>;
|
|
519
582
|
export type PurchaseAttemptProps = z.infer<typeof purchaseAttemptSchema>;
|
|
520
583
|
declare function trackPurchaseAttempt(eventData: PurchaseAttemptProps, meta?: EventMetadata): void;
|
|
584
|
+
declare const purchaseCanceledSchema: z.ZodObject<{
|
|
585
|
+
"Operation Id": z.ZodEffects<z.ZodString, string, string>;
|
|
586
|
+
Trips: z.ZodOptional<z.ZodArray<z.ZodType<{
|
|
587
|
+
"Departure Arrival": string;
|
|
588
|
+
"Departure Destination": string;
|
|
589
|
+
"Departure Destination Terminal": string;
|
|
590
|
+
"Departure Line": string;
|
|
591
|
+
"Departure Origin": string;
|
|
592
|
+
"Departure Origin Terminal": string;
|
|
593
|
+
"Departure Price": number;
|
|
594
|
+
"Departure Route": string;
|
|
595
|
+
"Departure Stops": number;
|
|
596
|
+
"Departure Time": string;
|
|
597
|
+
"Departure Transport Type": string;
|
|
598
|
+
"Departure Transporter": string;
|
|
599
|
+
"Recommended Trip": boolean;
|
|
600
|
+
"Return Arrival"?: string | undefined;
|
|
601
|
+
"Return Destination"?: string | undefined;
|
|
602
|
+
"Return Destination Terminal"?: string | undefined;
|
|
603
|
+
"Return Line"?: string | undefined;
|
|
604
|
+
"Return Origin"?: string | undefined;
|
|
605
|
+
"Return Origin Terminal"?: string | undefined;
|
|
606
|
+
"Return Price"?: number | undefined;
|
|
607
|
+
"Return Route"?: string | undefined;
|
|
608
|
+
"Return Stops"?: number | undefined;
|
|
609
|
+
"Return Time"?: string | undefined;
|
|
610
|
+
"Return Transport Type"?: string | undefined;
|
|
611
|
+
"Return Transporter"?: string | undefined;
|
|
612
|
+
"Recommended Trip Type"?: string | undefined;
|
|
613
|
+
}, z.ZodTypeDef, {
|
|
614
|
+
"Departure Arrival": string;
|
|
615
|
+
"Departure Destination": string;
|
|
616
|
+
"Departure Destination Terminal": string;
|
|
617
|
+
"Departure Line": string;
|
|
618
|
+
"Departure Origin": string;
|
|
619
|
+
"Departure Origin Terminal": string;
|
|
620
|
+
"Departure Price": number;
|
|
621
|
+
"Departure Route": string;
|
|
622
|
+
"Departure Stops": number;
|
|
623
|
+
"Departure Time": string;
|
|
624
|
+
"Departure Transport Type": string;
|
|
625
|
+
"Departure Transporter": string;
|
|
626
|
+
"Recommended Trip": boolean;
|
|
627
|
+
"Return Arrival"?: string | undefined;
|
|
628
|
+
"Return Destination"?: string | undefined;
|
|
629
|
+
"Return Destination Terminal"?: string | undefined;
|
|
630
|
+
"Return Line"?: string | undefined;
|
|
631
|
+
"Return Origin"?: string | undefined;
|
|
632
|
+
"Return Origin Terminal"?: string | undefined;
|
|
633
|
+
"Return Price"?: number | undefined;
|
|
634
|
+
"Return Route"?: string | undefined;
|
|
635
|
+
"Return Stops"?: number | undefined;
|
|
636
|
+
"Return Time"?: string | undefined;
|
|
637
|
+
"Return Transport Type"?: string | undefined;
|
|
638
|
+
"Return Transporter"?: string | undefined;
|
|
639
|
+
"Recommended Trip Type"?: string | undefined;
|
|
640
|
+
}>, "many">>;
|
|
641
|
+
"Passenger Count": z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
642
|
+
Total: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
643
|
+
"Trip Count": z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
644
|
+
product: z.ZodEffects<z.ZodEnum<[
|
|
645
|
+
"web",
|
|
646
|
+
"web-mobile",
|
|
647
|
+
"ios",
|
|
648
|
+
"android",
|
|
649
|
+
"app"
|
|
650
|
+
]>, "web" | "web-mobile" | "ios" | "android" | "app", "web" | "web-mobile" | "ios" | "android" | "app">;
|
|
651
|
+
Passengers: z.ZodOptional<z.ZodArray<z.ZodType<{
|
|
652
|
+
"Passenger Name": string;
|
|
653
|
+
"Passenger Document Type": string;
|
|
654
|
+
"Passenger Document Id": number;
|
|
655
|
+
}, z.ZodTypeDef, {
|
|
656
|
+
"Passenger Name": string;
|
|
657
|
+
"Passenger Document Type": string;
|
|
658
|
+
"Passenger Document Id": number;
|
|
659
|
+
}>, "many">>;
|
|
660
|
+
}, "strip", z.ZodTypeAny, {
|
|
661
|
+
product: "web" | "web-mobile" | "ios" | "android" | "app";
|
|
662
|
+
"Operation Id": string;
|
|
663
|
+
Trips?: {
|
|
664
|
+
"Departure Arrival": string;
|
|
665
|
+
"Departure Destination": string;
|
|
666
|
+
"Departure Destination Terminal": string;
|
|
667
|
+
"Departure Line": string;
|
|
668
|
+
"Departure Origin": string;
|
|
669
|
+
"Departure Origin Terminal": string;
|
|
670
|
+
"Departure Price": number;
|
|
671
|
+
"Departure Route": string;
|
|
672
|
+
"Departure Stops": number;
|
|
673
|
+
"Departure Time": string;
|
|
674
|
+
"Departure Transport Type": string;
|
|
675
|
+
"Departure Transporter": string;
|
|
676
|
+
"Recommended Trip": boolean;
|
|
677
|
+
"Return Arrival"?: string | undefined;
|
|
678
|
+
"Return Destination"?: string | undefined;
|
|
679
|
+
"Return Destination Terminal"?: string | undefined;
|
|
680
|
+
"Return Line"?: string | undefined;
|
|
681
|
+
"Return Origin"?: string | undefined;
|
|
682
|
+
"Return Origin Terminal"?: string | undefined;
|
|
683
|
+
"Return Price"?: number | undefined;
|
|
684
|
+
"Return Route"?: string | undefined;
|
|
685
|
+
"Return Stops"?: number | undefined;
|
|
686
|
+
"Return Time"?: string | undefined;
|
|
687
|
+
"Return Transport Type"?: string | undefined;
|
|
688
|
+
"Return Transporter"?: string | undefined;
|
|
689
|
+
"Recommended Trip Type"?: string | undefined;
|
|
690
|
+
}[] | undefined;
|
|
691
|
+
"Passenger Count"?: number | undefined;
|
|
692
|
+
"Trip Count"?: number | undefined;
|
|
693
|
+
Total?: number | undefined;
|
|
694
|
+
Passengers?: {
|
|
695
|
+
"Passenger Name": string;
|
|
696
|
+
"Passenger Document Type": string;
|
|
697
|
+
"Passenger Document Id": number;
|
|
698
|
+
}[] | undefined;
|
|
699
|
+
}, {
|
|
700
|
+
product: "web" | "web-mobile" | "ios" | "android" | "app";
|
|
701
|
+
"Operation Id": string;
|
|
702
|
+
Trips?: {
|
|
703
|
+
"Departure Arrival": string;
|
|
704
|
+
"Departure Destination": string;
|
|
705
|
+
"Departure Destination Terminal": string;
|
|
706
|
+
"Departure Line": string;
|
|
707
|
+
"Departure Origin": string;
|
|
708
|
+
"Departure Origin Terminal": string;
|
|
709
|
+
"Departure Price": number;
|
|
710
|
+
"Departure Route": string;
|
|
711
|
+
"Departure Stops": number;
|
|
712
|
+
"Departure Time": string;
|
|
713
|
+
"Departure Transport Type": string;
|
|
714
|
+
"Departure Transporter": string;
|
|
715
|
+
"Recommended Trip": boolean;
|
|
716
|
+
"Return Arrival"?: string | undefined;
|
|
717
|
+
"Return Destination"?: string | undefined;
|
|
718
|
+
"Return Destination Terminal"?: string | undefined;
|
|
719
|
+
"Return Line"?: string | undefined;
|
|
720
|
+
"Return Origin"?: string | undefined;
|
|
721
|
+
"Return Origin Terminal"?: string | undefined;
|
|
722
|
+
"Return Price"?: number | undefined;
|
|
723
|
+
"Return Route"?: string | undefined;
|
|
724
|
+
"Return Stops"?: number | undefined;
|
|
725
|
+
"Return Time"?: string | undefined;
|
|
726
|
+
"Return Transport Type"?: string | undefined;
|
|
727
|
+
"Return Transporter"?: string | undefined;
|
|
728
|
+
"Recommended Trip Type"?: string | undefined;
|
|
729
|
+
}[] | undefined;
|
|
730
|
+
"Passenger Count"?: number | undefined;
|
|
731
|
+
"Trip Count"?: number | undefined;
|
|
732
|
+
Total?: number | undefined;
|
|
733
|
+
Passengers?: {
|
|
734
|
+
"Passenger Name": string;
|
|
735
|
+
"Passenger Document Type": string;
|
|
736
|
+
"Passenger Document Id": number;
|
|
737
|
+
}[] | undefined;
|
|
738
|
+
}>;
|
|
739
|
+
export type PurchaseCanceledProps = z.infer<typeof purchaseCanceledSchema>;
|
|
740
|
+
declare function trackPurchaseCanceled(eventData: PurchaseCanceledProps, meta?: EventData): void;
|
|
521
741
|
declare const searchSchema: z.ZodObject<{
|
|
522
742
|
Departure: z.ZodEffects<z.ZodString, string, string>;
|
|
523
743
|
"Departure Delta": z.ZodNumber;
|
|
@@ -538,6 +758,7 @@ declare const searchSchema: z.ZodObject<{
|
|
|
538
758
|
]>, "web" | "web-mobile" | "ios" | "android" | "app", "web" | "web-mobile" | "ios" | "android" | "app">;
|
|
539
759
|
}, "strip", z.ZodTypeAny, {
|
|
540
760
|
product: "web" | "web-mobile" | "ios" | "android" | "app";
|
|
761
|
+
Passengers: number;
|
|
541
762
|
Departure: string;
|
|
542
763
|
Destination: string;
|
|
543
764
|
"Destination Terminal": string;
|
|
@@ -545,11 +766,11 @@ declare const searchSchema: z.ZodObject<{
|
|
|
545
766
|
"Origin Terminal": string;
|
|
546
767
|
Route: string;
|
|
547
768
|
"Departure Delta": number;
|
|
548
|
-
Passengers: number;
|
|
549
769
|
Return?: string | undefined;
|
|
550
770
|
"Trip Length"?: number | undefined;
|
|
551
771
|
}, {
|
|
552
772
|
product: "web" | "web-mobile" | "ios" | "android" | "app";
|
|
773
|
+
Passengers: number;
|
|
553
774
|
Departure: string;
|
|
554
775
|
Destination: string;
|
|
555
776
|
"Destination Terminal": string;
|
|
@@ -557,7 +778,6 @@ declare const searchSchema: z.ZodObject<{
|
|
|
557
778
|
"Origin Terminal": string;
|
|
558
779
|
Route: string;
|
|
559
780
|
"Departure Delta": number;
|
|
560
|
-
Passengers: number;
|
|
561
781
|
Return?: string | undefined;
|
|
562
782
|
"Trip Length"?: number | undefined;
|
|
563
783
|
}>;
|
|
@@ -770,6 +990,7 @@ declare const analytics: {
|
|
|
770
990
|
purchaseAttempt: typeof trackPurchaseAttempt;
|
|
771
991
|
pickedDeparture: typeof trackSearch;
|
|
772
992
|
customEvent: typeof trackCustomEvent;
|
|
993
|
+
purchaseCanceled: typeof trackPurchaseCanceled;
|
|
773
994
|
};
|
|
774
995
|
};
|
|
775
996
|
|
|
@@ -13080,16 +13080,16 @@ const productValidation = z.enum(PRODUCT_TYPES).refine((val) => PRODUCT_TYPES.in
|
|
|
13080
13080
|
const interestInHomeSchema = z.object({
|
|
13081
13081
|
product: productValidation
|
|
13082
13082
|
});
|
|
13083
|
-
const EVENT_NAME$
|
|
13083
|
+
const EVENT_NAME$9 = "Interest In Home";
|
|
13084
13084
|
function trackInterestInHome(eventData, meta = {}) {
|
|
13085
|
-
trackEvent(EVENT_NAME$
|
|
13085
|
+
trackEvent(EVENT_NAME$9, eventData, meta);
|
|
13086
13086
|
}
|
|
13087
13087
|
const interestInSearchSchema = z.object({
|
|
13088
13088
|
product: productValidation
|
|
13089
13089
|
});
|
|
13090
|
-
const EVENT_NAME$
|
|
13090
|
+
const EVENT_NAME$8 = "Interest In Search";
|
|
13091
13091
|
function trackInterestInSearch(eventData, meta = {}) {
|
|
13092
|
-
trackEvent(EVENT_NAME$
|
|
13092
|
+
trackEvent(EVENT_NAME$8, eventData, meta);
|
|
13093
13093
|
}
|
|
13094
13094
|
const dateValidation = (val) => {
|
|
13095
13095
|
const dateRegex2 = /^\d{4}-\d{2}-\d{2}$/;
|
|
@@ -13124,6 +13124,11 @@ const arrayField = (schema, fieldName, minLength) => {
|
|
|
13124
13124
|
);
|
|
13125
13125
|
}
|
|
13126
13126
|
};
|
|
13127
|
+
const passengerSchema = z.object({
|
|
13128
|
+
"Passenger Name": stringField("Passenger Name"),
|
|
13129
|
+
"Passenger Document Type": stringField("Document Type"),
|
|
13130
|
+
"Passenger Document Id": intField("Document ID")
|
|
13131
|
+
}).strict();
|
|
13127
13132
|
const tripSchema = z.object({
|
|
13128
13133
|
"Departure Arrival": dateField("Departure Arrival"),
|
|
13129
13134
|
"Departure Destination": stringField("Departure Destination"),
|
|
@@ -13161,23 +13166,26 @@ const passengersCreatedSchema = z.object({
|
|
|
13161
13166
|
"Passenger Count": intField("Passenger Count"),
|
|
13162
13167
|
"Trip Count": intField("Trip Count").optional(),
|
|
13163
13168
|
"Total": numberField("Total"),
|
|
13164
|
-
"product": productValidation
|
|
13169
|
+
"product": productValidation,
|
|
13170
|
+
"Passengers": arrayField(passengerSchema, "Passengers", 1).optional()
|
|
13165
13171
|
}).strict();
|
|
13166
|
-
const EVENT_NAME$
|
|
13172
|
+
const EVENT_NAME$7 = "Passengers Created";
|
|
13167
13173
|
function trackPassengersCreated(eventProps, meta = {}) {
|
|
13168
|
-
trackEvent(EVENT_NAME$
|
|
13174
|
+
trackEvent(EVENT_NAME$7, eventProps, meta);
|
|
13169
13175
|
}
|
|
13170
13176
|
const paymentAttemptSchema = z.object({
|
|
13177
|
+
"Operation Id": stringField("Operation Id").optional(),
|
|
13171
13178
|
"Trips": arrayField(tripSchema, "Trips", 1),
|
|
13172
13179
|
"Passenger Count": intField("Passenger Count"),
|
|
13173
13180
|
"Trip Count": intField("Trip Count"),
|
|
13174
13181
|
"Payment Type": z.string().min(1, "Payment Type is required"),
|
|
13175
13182
|
"Total": numberField("Total"),
|
|
13176
|
-
"product": productValidation
|
|
13183
|
+
"product": productValidation,
|
|
13184
|
+
"Passengers": arrayField(passengerSchema, "Passengers", 1).optional()
|
|
13177
13185
|
}).strict();
|
|
13178
|
-
const EVENT_NAME$
|
|
13186
|
+
const EVENT_NAME$6 = "Payment Attempt";
|
|
13179
13187
|
const trackPaymentAttempt = async (eventProps, meta = {}) => {
|
|
13180
|
-
trackEvent(EVENT_NAME$
|
|
13188
|
+
trackEvent(EVENT_NAME$6, eventProps, meta);
|
|
13181
13189
|
};
|
|
13182
13190
|
const pickedDepartureSchema = z.object({
|
|
13183
13191
|
"Arrival": z.string().refine(dateValidation, {
|
|
@@ -13201,20 +13209,22 @@ const pickedDepartureSchema = z.object({
|
|
|
13201
13209
|
"Recommended Trip": z.boolean(),
|
|
13202
13210
|
"Recommended Trip Type": z.string().optional()
|
|
13203
13211
|
});
|
|
13204
|
-
const EVENT_NAME$
|
|
13212
|
+
const EVENT_NAME$5 = "Picked Departure";
|
|
13205
13213
|
function trackSearch$1(eventData, meta = {}) {
|
|
13206
|
-
trackEvent(EVENT_NAME$
|
|
13214
|
+
trackEvent(EVENT_NAME$5, eventData, meta);
|
|
13207
13215
|
}
|
|
13208
13216
|
const purchaseAttemptSchema = z.object({
|
|
13217
|
+
"Operation Id": stringField("Operation Id").optional(),
|
|
13209
13218
|
"Trips": arrayField(tripSchema, "Trips", 1),
|
|
13210
13219
|
"Passenger Count": intField("Passenger Count"),
|
|
13211
13220
|
"Trip Count": intField("Trip Count"),
|
|
13212
13221
|
"Total": numberField("Total"),
|
|
13213
|
-
"product": productValidation
|
|
13222
|
+
"product": productValidation,
|
|
13223
|
+
"Passengers": arrayField(passengerSchema, "Passengers", 1).optional()
|
|
13214
13224
|
}).strict();
|
|
13215
|
-
const EVENT_NAME$
|
|
13225
|
+
const EVENT_NAME$4 = "Purchase Attempt";
|
|
13216
13226
|
function trackPurchaseAttempt(eventData, meta = {}) {
|
|
13217
|
-
trackEvent(EVENT_NAME$
|
|
13227
|
+
trackEvent(EVENT_NAME$4, eventData, meta);
|
|
13218
13228
|
}
|
|
13219
13229
|
const searchSchema = z.object({
|
|
13220
13230
|
"Departure": z.string().refine(dateValidation, {
|
|
@@ -13233,9 +13243,9 @@ const searchSchema = z.object({
|
|
|
13233
13243
|
"Trip Length": z.number().positive().optional(),
|
|
13234
13244
|
"product": productValidation
|
|
13235
13245
|
});
|
|
13236
|
-
const EVENT_NAME$
|
|
13246
|
+
const EVENT_NAME$3 = "Search";
|
|
13237
13247
|
function trackSearch(eventData, meta = {}) {
|
|
13238
|
-
trackEvent(EVENT_NAME$
|
|
13248
|
+
trackEvent(EVENT_NAME$3, eventData, meta);
|
|
13239
13249
|
}
|
|
13240
13250
|
const seatChangeSchema = z.object({
|
|
13241
13251
|
"Arrival": z.string().refine(dateValidation, {
|
|
@@ -13259,13 +13269,13 @@ const seatChangeSchema = z.object({
|
|
|
13259
13269
|
}),
|
|
13260
13270
|
"product": productValidation
|
|
13261
13271
|
});
|
|
13262
|
-
const EVENT_NAME$
|
|
13272
|
+
const EVENT_NAME$2 = "Seat Change";
|
|
13263
13273
|
function trackSeatChange(eventProps, meta = {}) {
|
|
13264
|
-
trackEvent(EVENT_NAME$
|
|
13274
|
+
trackEvent(EVENT_NAME$2, eventProps, meta);
|
|
13265
13275
|
}
|
|
13266
|
-
const EVENT_NAME = "View Results";
|
|
13276
|
+
const EVENT_NAME$1 = "View Results";
|
|
13267
13277
|
function trackViewResults(eventData, meta = {}) {
|
|
13268
|
-
trackEvent(EVENT_NAME, eventData, meta);
|
|
13278
|
+
trackEvent(EVENT_NAME$1, eventData, meta);
|
|
13269
13279
|
}
|
|
13270
13280
|
const viewResultsSchema = z.object({
|
|
13271
13281
|
"Bus count": z.number().int("Bus count must be an integer"),
|
|
@@ -16046,6 +16056,10 @@ async function init(config) {
|
|
|
16046
16056
|
function isTrackerReady() {
|
|
16047
16057
|
return mixpanelService.isReady();
|
|
16048
16058
|
}
|
|
16059
|
+
const EVENT_NAME = "Purchase Canceled";
|
|
16060
|
+
function trackPurchaseCanceled(eventData, meta = {}) {
|
|
16061
|
+
trackEvent(EVENT_NAME, eventData, meta);
|
|
16062
|
+
}
|
|
16049
16063
|
const analytics = {
|
|
16050
16064
|
init,
|
|
16051
16065
|
isReady: isTrackerReady,
|
|
@@ -16067,7 +16081,8 @@ const analytics = {
|
|
|
16067
16081
|
paymentAttempt: trackPaymentAttempt,
|
|
16068
16082
|
purchaseAttempt: trackPurchaseAttempt,
|
|
16069
16083
|
pickedDeparture: trackSearch$1,
|
|
16070
|
-
customEvent: trackCustomEvent
|
|
16084
|
+
customEvent: trackCustomEvent,
|
|
16085
|
+
purchaseCanceled: trackPurchaseCanceled
|
|
16071
16086
|
}
|
|
16072
16087
|
};
|
|
16073
16088
|
export {
|