@_henriquewilson/gabirubi-domain 1.3.81 → 1.3.82
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/model/journey.d.mts +50 -26
- package/dist/model/journey.d.ts +50 -26
- package/dist/model/journey.js +3 -0
- package/dist/model/journey.js.map +1 -1
- package/dist/model/journey.mjs +3 -0
- package/dist/model/journey.mjs.map +1 -1
- package/dist/model/subscription.model.d.mts +8 -8
- package/dist/model/subscription.model.d.ts +8 -8
- package/dist/model/user.model.d.mts +2 -2
- package/dist/model/user.model.d.ts +2 -2
- package/dist/test/activity.test.js +3 -0
- package/dist/test/activity.test.js.map +1 -1
- package/dist/test/activity.test.mjs +3 -0
- package/dist/test/activity.test.mjs.map +1 -1
- package/package.json +1 -1
package/dist/model/journey.d.mts
CHANGED
|
@@ -55,14 +55,17 @@ declare const PlanSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
55
55
|
pixPrice: z.ZodNumber;
|
|
56
56
|
portalPrice: z.ZodOptional<z.ZodNumber>;
|
|
57
57
|
pixPortalPrice: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
exStudentPrice: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
pixExStudentPrice: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
exStudentOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">>;
|
|
58
61
|
period: z.ZodDefault<z.ZodEnum<["month", "biannual", "year"]>>;
|
|
59
62
|
mode: z.ZodEnum<["payment", "setup", "subscription"]>;
|
|
60
63
|
stripePrice: z.ZodString;
|
|
61
64
|
stripePortalPrice: z.ZodString;
|
|
62
65
|
}>, "strip", z.ZodTypeAny, {
|
|
63
66
|
id: string | number;
|
|
64
|
-
enabled: boolean;
|
|
65
67
|
title: string;
|
|
68
|
+
enabled: boolean;
|
|
66
69
|
price: number;
|
|
67
70
|
pixPrice: number;
|
|
68
71
|
period: "month" | "biannual" | "year";
|
|
@@ -75,6 +78,9 @@ declare const PlanSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
75
78
|
description?: string | undefined;
|
|
76
79
|
portalPrice?: number | undefined;
|
|
77
80
|
pixPortalPrice?: number | undefined;
|
|
81
|
+
exStudentPrice?: number | undefined;
|
|
82
|
+
pixExStudentPrice?: number | undefined;
|
|
83
|
+
exStudentOf?: (string | number)[] | undefined;
|
|
78
84
|
}, {
|
|
79
85
|
title: string;
|
|
80
86
|
price: number;
|
|
@@ -86,10 +92,13 @@ declare const PlanSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
86
92
|
createdAt?: unknown;
|
|
87
93
|
updatedAt?: unknown;
|
|
88
94
|
order?: number | null | undefined;
|
|
89
|
-
enabled?: boolean | undefined;
|
|
90
95
|
description?: string | undefined;
|
|
96
|
+
enabled?: boolean | undefined;
|
|
91
97
|
portalPrice?: number | undefined;
|
|
92
98
|
pixPortalPrice?: number | undefined;
|
|
99
|
+
exStudentPrice?: number | undefined;
|
|
100
|
+
pixExStudentPrice?: number | undefined;
|
|
101
|
+
exStudentOf?: (string | number)[] | undefined;
|
|
93
102
|
period?: "month" | "biannual" | "year" | undefined;
|
|
94
103
|
}>;
|
|
95
104
|
declare const JourneySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
@@ -353,14 +362,17 @@ declare const JourneySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
|
|
|
353
362
|
pixPrice: z.ZodNumber;
|
|
354
363
|
portalPrice: z.ZodOptional<z.ZodNumber>;
|
|
355
364
|
pixPortalPrice: z.ZodOptional<z.ZodNumber>;
|
|
365
|
+
exStudentPrice: z.ZodOptional<z.ZodNumber>;
|
|
366
|
+
pixExStudentPrice: z.ZodOptional<z.ZodNumber>;
|
|
367
|
+
exStudentOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">>;
|
|
356
368
|
period: z.ZodDefault<z.ZodEnum<["month", "biannual", "year"]>>;
|
|
357
369
|
mode: z.ZodEnum<["payment", "setup", "subscription"]>;
|
|
358
370
|
stripePrice: z.ZodString;
|
|
359
371
|
stripePortalPrice: z.ZodString;
|
|
360
372
|
}>, "strip", z.ZodTypeAny, {
|
|
361
373
|
id: string | number;
|
|
362
|
-
enabled: boolean;
|
|
363
374
|
title: string;
|
|
375
|
+
enabled: boolean;
|
|
364
376
|
price: number;
|
|
365
377
|
pixPrice: number;
|
|
366
378
|
period: "month" | "biannual" | "year";
|
|
@@ -373,6 +385,9 @@ declare const JourneySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
|
|
|
373
385
|
description?: string | undefined;
|
|
374
386
|
portalPrice?: number | undefined;
|
|
375
387
|
pixPortalPrice?: number | undefined;
|
|
388
|
+
exStudentPrice?: number | undefined;
|
|
389
|
+
pixExStudentPrice?: number | undefined;
|
|
390
|
+
exStudentOf?: (string | number)[] | undefined;
|
|
376
391
|
}, {
|
|
377
392
|
title: string;
|
|
378
393
|
price: number;
|
|
@@ -384,10 +399,13 @@ declare const JourneySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
|
|
|
384
399
|
createdAt?: unknown;
|
|
385
400
|
updatedAt?: unknown;
|
|
386
401
|
order?: number | null | undefined;
|
|
387
|
-
enabled?: boolean | undefined;
|
|
388
402
|
description?: string | undefined;
|
|
403
|
+
enabled?: boolean | undefined;
|
|
389
404
|
portalPrice?: number | undefined;
|
|
390
405
|
pixPortalPrice?: number | undefined;
|
|
406
|
+
exStudentPrice?: number | undefined;
|
|
407
|
+
pixExStudentPrice?: number | undefined;
|
|
408
|
+
exStudentOf?: (string | number)[] | undefined;
|
|
391
409
|
period?: "month" | "biannual" | "year" | undefined;
|
|
392
410
|
}>, "many">>;
|
|
393
411
|
}>, z.objectUtil.extendShape<{
|
|
@@ -465,8 +483,8 @@ declare const JourneySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
|
|
|
465
483
|
stripeProductId?: string | undefined;
|
|
466
484
|
plans?: {
|
|
467
485
|
id: string | number;
|
|
468
|
-
enabled: boolean;
|
|
469
486
|
title: string;
|
|
487
|
+
enabled: boolean;
|
|
470
488
|
price: number;
|
|
471
489
|
pixPrice: number;
|
|
472
490
|
period: "month" | "biannual" | "year";
|
|
@@ -479,6 +497,9 @@ declare const JourneySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
|
|
|
479
497
|
description?: string | undefined;
|
|
480
498
|
portalPrice?: number | undefined;
|
|
481
499
|
pixPortalPrice?: number | undefined;
|
|
500
|
+
exStudentPrice?: number | undefined;
|
|
501
|
+
pixExStudentPrice?: number | undefined;
|
|
502
|
+
exStudentOf?: (string | number)[] | undefined;
|
|
482
503
|
}[] | undefined;
|
|
483
504
|
}, {
|
|
484
505
|
type: "simple" | "modular" | "free";
|
|
@@ -555,10 +576,13 @@ declare const JourneySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
|
|
|
555
576
|
createdAt?: unknown;
|
|
556
577
|
updatedAt?: unknown;
|
|
557
578
|
order?: number | null | undefined;
|
|
558
|
-
enabled?: boolean | undefined;
|
|
559
579
|
description?: string | undefined;
|
|
580
|
+
enabled?: boolean | undefined;
|
|
560
581
|
portalPrice?: number | undefined;
|
|
561
582
|
pixPortalPrice?: number | undefined;
|
|
583
|
+
exStudentPrice?: number | undefined;
|
|
584
|
+
pixExStudentPrice?: number | undefined;
|
|
585
|
+
exStudentOf?: (string | number)[] | undefined;
|
|
562
586
|
period?: "month" | "biannual" | "year" | undefined;
|
|
563
587
|
}[] | undefined;
|
|
564
588
|
}>;
|
|
@@ -611,34 +635,34 @@ declare const ModuleSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.ex
|
|
|
611
635
|
createdAt?: FirebaseFirestore.Timestamp | null | undefined;
|
|
612
636
|
updatedAt?: FirebaseFirestore.Timestamp | null | undefined;
|
|
613
637
|
order?: number | null | undefined;
|
|
638
|
+
publishOnDate?: FirebaseFirestore.Timestamp | null | undefined;
|
|
639
|
+
unpublishOnDate?: FirebaseFirestore.Timestamp | null | undefined;
|
|
640
|
+
rss?: string | undefined;
|
|
641
|
+
isExclusive?: boolean | null | undefined;
|
|
614
642
|
previous?: {
|
|
615
643
|
id: string | number;
|
|
616
644
|
createdAt?: FirebaseFirestore.Timestamp | null | undefined;
|
|
617
645
|
updatedAt?: FirebaseFirestore.Timestamp | null | undefined;
|
|
618
646
|
order?: number | null | undefined;
|
|
619
647
|
}[] | undefined;
|
|
620
|
-
publishOnDate?: FirebaseFirestore.Timestamp | null | undefined;
|
|
621
|
-
unpublishOnDate?: FirebaseFirestore.Timestamp | null | undefined;
|
|
622
|
-
rss?: string | undefined;
|
|
623
|
-
isExclusive?: boolean | null | undefined;
|
|
624
648
|
}, {
|
|
625
649
|
title: string;
|
|
626
650
|
id?: unknown;
|
|
627
651
|
createdAt?: unknown;
|
|
628
652
|
updatedAt?: unknown;
|
|
629
653
|
order?: number | null | undefined;
|
|
630
|
-
previous?: {
|
|
631
|
-
id?: unknown;
|
|
632
|
-
createdAt?: unknown;
|
|
633
|
-
updatedAt?: unknown;
|
|
634
|
-
order?: number | null | undefined;
|
|
635
|
-
}[] | undefined;
|
|
636
654
|
publishOnDate?: unknown;
|
|
637
655
|
unpublishOnDate?: unknown;
|
|
638
656
|
published?: boolean | undefined;
|
|
639
657
|
isPrivate?: boolean | undefined;
|
|
640
658
|
rss?: string | undefined;
|
|
641
659
|
isExclusive?: boolean | null | undefined;
|
|
660
|
+
previous?: {
|
|
661
|
+
id?: unknown;
|
|
662
|
+
createdAt?: unknown;
|
|
663
|
+
updatedAt?: unknown;
|
|
664
|
+
order?: number | null | undefined;
|
|
665
|
+
}[] | undefined;
|
|
642
666
|
}>;
|
|
643
667
|
declare const JourneyContentTypeSchema: z.ZodEnum<["video", "document", "audio", "text", "soundcloud", "youtube", "form", "live", "file"]>;
|
|
644
668
|
declare const ActivitySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
@@ -863,16 +887,16 @@ declare const ModuleWithActivities: z.ZodObject<z.objectUtil.extendShape<z.objec
|
|
|
863
887
|
createdAt?: FirebaseFirestore.Timestamp | null | undefined;
|
|
864
888
|
updatedAt?: FirebaseFirestore.Timestamp | null | undefined;
|
|
865
889
|
order?: number | null | undefined;
|
|
890
|
+
publishOnDate?: FirebaseFirestore.Timestamp | null | undefined;
|
|
891
|
+
unpublishOnDate?: FirebaseFirestore.Timestamp | null | undefined;
|
|
892
|
+
rss?: string | undefined;
|
|
893
|
+
isExclusive?: boolean | null | undefined;
|
|
866
894
|
previous?: {
|
|
867
895
|
id: string | number;
|
|
868
896
|
createdAt?: FirebaseFirestore.Timestamp | null | undefined;
|
|
869
897
|
updatedAt?: FirebaseFirestore.Timestamp | null | undefined;
|
|
870
898
|
order?: number | null | undefined;
|
|
871
899
|
}[] | undefined;
|
|
872
|
-
publishOnDate?: FirebaseFirestore.Timestamp | null | undefined;
|
|
873
|
-
unpublishOnDate?: FirebaseFirestore.Timestamp | null | undefined;
|
|
874
|
-
rss?: string | undefined;
|
|
875
|
-
isExclusive?: boolean | null | undefined;
|
|
876
900
|
}, {
|
|
877
901
|
title: string;
|
|
878
902
|
activities: {
|
|
@@ -900,18 +924,18 @@ declare const ModuleWithActivities: z.ZodObject<z.objectUtil.extendShape<z.objec
|
|
|
900
924
|
createdAt?: unknown;
|
|
901
925
|
updatedAt?: unknown;
|
|
902
926
|
order?: number | null | undefined;
|
|
903
|
-
previous?: {
|
|
904
|
-
id?: unknown;
|
|
905
|
-
createdAt?: unknown;
|
|
906
|
-
updatedAt?: unknown;
|
|
907
|
-
order?: number | null | undefined;
|
|
908
|
-
}[] | undefined;
|
|
909
927
|
publishOnDate?: unknown;
|
|
910
928
|
unpublishOnDate?: unknown;
|
|
911
929
|
published?: boolean | undefined;
|
|
912
930
|
isPrivate?: boolean | undefined;
|
|
913
931
|
rss?: string | undefined;
|
|
914
932
|
isExclusive?: boolean | null | undefined;
|
|
933
|
+
previous?: {
|
|
934
|
+
id?: unknown;
|
|
935
|
+
createdAt?: unknown;
|
|
936
|
+
updatedAt?: unknown;
|
|
937
|
+
order?: number | null | undefined;
|
|
938
|
+
}[] | undefined;
|
|
915
939
|
}>;
|
|
916
940
|
type ModuleWithActivities = z.infer<typeof ModuleWithActivities>;
|
|
917
941
|
type Activity = z.infer<typeof ActivitySchema>;
|
package/dist/model/journey.d.ts
CHANGED
|
@@ -55,14 +55,17 @@ declare const PlanSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
55
55
|
pixPrice: z.ZodNumber;
|
|
56
56
|
portalPrice: z.ZodOptional<z.ZodNumber>;
|
|
57
57
|
pixPortalPrice: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
exStudentPrice: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
pixExStudentPrice: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
exStudentOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">>;
|
|
58
61
|
period: z.ZodDefault<z.ZodEnum<["month", "biannual", "year"]>>;
|
|
59
62
|
mode: z.ZodEnum<["payment", "setup", "subscription"]>;
|
|
60
63
|
stripePrice: z.ZodString;
|
|
61
64
|
stripePortalPrice: z.ZodString;
|
|
62
65
|
}>, "strip", z.ZodTypeAny, {
|
|
63
66
|
id: string | number;
|
|
64
|
-
enabled: boolean;
|
|
65
67
|
title: string;
|
|
68
|
+
enabled: boolean;
|
|
66
69
|
price: number;
|
|
67
70
|
pixPrice: number;
|
|
68
71
|
period: "month" | "biannual" | "year";
|
|
@@ -75,6 +78,9 @@ declare const PlanSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
75
78
|
description?: string | undefined;
|
|
76
79
|
portalPrice?: number | undefined;
|
|
77
80
|
pixPortalPrice?: number | undefined;
|
|
81
|
+
exStudentPrice?: number | undefined;
|
|
82
|
+
pixExStudentPrice?: number | undefined;
|
|
83
|
+
exStudentOf?: (string | number)[] | undefined;
|
|
78
84
|
}, {
|
|
79
85
|
title: string;
|
|
80
86
|
price: number;
|
|
@@ -86,10 +92,13 @@ declare const PlanSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
86
92
|
createdAt?: unknown;
|
|
87
93
|
updatedAt?: unknown;
|
|
88
94
|
order?: number | null | undefined;
|
|
89
|
-
enabled?: boolean | undefined;
|
|
90
95
|
description?: string | undefined;
|
|
96
|
+
enabled?: boolean | undefined;
|
|
91
97
|
portalPrice?: number | undefined;
|
|
92
98
|
pixPortalPrice?: number | undefined;
|
|
99
|
+
exStudentPrice?: number | undefined;
|
|
100
|
+
pixExStudentPrice?: number | undefined;
|
|
101
|
+
exStudentOf?: (string | number)[] | undefined;
|
|
93
102
|
period?: "month" | "biannual" | "year" | undefined;
|
|
94
103
|
}>;
|
|
95
104
|
declare const JourneySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
@@ -353,14 +362,17 @@ declare const JourneySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
|
|
|
353
362
|
pixPrice: z.ZodNumber;
|
|
354
363
|
portalPrice: z.ZodOptional<z.ZodNumber>;
|
|
355
364
|
pixPortalPrice: z.ZodOptional<z.ZodNumber>;
|
|
365
|
+
exStudentPrice: z.ZodOptional<z.ZodNumber>;
|
|
366
|
+
pixExStudentPrice: z.ZodOptional<z.ZodNumber>;
|
|
367
|
+
exStudentOf: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">>;
|
|
356
368
|
period: z.ZodDefault<z.ZodEnum<["month", "biannual", "year"]>>;
|
|
357
369
|
mode: z.ZodEnum<["payment", "setup", "subscription"]>;
|
|
358
370
|
stripePrice: z.ZodString;
|
|
359
371
|
stripePortalPrice: z.ZodString;
|
|
360
372
|
}>, "strip", z.ZodTypeAny, {
|
|
361
373
|
id: string | number;
|
|
362
|
-
enabled: boolean;
|
|
363
374
|
title: string;
|
|
375
|
+
enabled: boolean;
|
|
364
376
|
price: number;
|
|
365
377
|
pixPrice: number;
|
|
366
378
|
period: "month" | "biannual" | "year";
|
|
@@ -373,6 +385,9 @@ declare const JourneySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
|
|
|
373
385
|
description?: string | undefined;
|
|
374
386
|
portalPrice?: number | undefined;
|
|
375
387
|
pixPortalPrice?: number | undefined;
|
|
388
|
+
exStudentPrice?: number | undefined;
|
|
389
|
+
pixExStudentPrice?: number | undefined;
|
|
390
|
+
exStudentOf?: (string | number)[] | undefined;
|
|
376
391
|
}, {
|
|
377
392
|
title: string;
|
|
378
393
|
price: number;
|
|
@@ -384,10 +399,13 @@ declare const JourneySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
|
|
|
384
399
|
createdAt?: unknown;
|
|
385
400
|
updatedAt?: unknown;
|
|
386
401
|
order?: number | null | undefined;
|
|
387
|
-
enabled?: boolean | undefined;
|
|
388
402
|
description?: string | undefined;
|
|
403
|
+
enabled?: boolean | undefined;
|
|
389
404
|
portalPrice?: number | undefined;
|
|
390
405
|
pixPortalPrice?: number | undefined;
|
|
406
|
+
exStudentPrice?: number | undefined;
|
|
407
|
+
pixExStudentPrice?: number | undefined;
|
|
408
|
+
exStudentOf?: (string | number)[] | undefined;
|
|
391
409
|
period?: "month" | "biannual" | "year" | undefined;
|
|
392
410
|
}>, "many">>;
|
|
393
411
|
}>, z.objectUtil.extendShape<{
|
|
@@ -465,8 +483,8 @@ declare const JourneySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
|
|
|
465
483
|
stripeProductId?: string | undefined;
|
|
466
484
|
plans?: {
|
|
467
485
|
id: string | number;
|
|
468
|
-
enabled: boolean;
|
|
469
486
|
title: string;
|
|
487
|
+
enabled: boolean;
|
|
470
488
|
price: number;
|
|
471
489
|
pixPrice: number;
|
|
472
490
|
period: "month" | "biannual" | "year";
|
|
@@ -479,6 +497,9 @@ declare const JourneySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
|
|
|
479
497
|
description?: string | undefined;
|
|
480
498
|
portalPrice?: number | undefined;
|
|
481
499
|
pixPortalPrice?: number | undefined;
|
|
500
|
+
exStudentPrice?: number | undefined;
|
|
501
|
+
pixExStudentPrice?: number | undefined;
|
|
502
|
+
exStudentOf?: (string | number)[] | undefined;
|
|
482
503
|
}[] | undefined;
|
|
483
504
|
}, {
|
|
484
505
|
type: "simple" | "modular" | "free";
|
|
@@ -555,10 +576,13 @@ declare const JourneySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
|
|
|
555
576
|
createdAt?: unknown;
|
|
556
577
|
updatedAt?: unknown;
|
|
557
578
|
order?: number | null | undefined;
|
|
558
|
-
enabled?: boolean | undefined;
|
|
559
579
|
description?: string | undefined;
|
|
580
|
+
enabled?: boolean | undefined;
|
|
560
581
|
portalPrice?: number | undefined;
|
|
561
582
|
pixPortalPrice?: number | undefined;
|
|
583
|
+
exStudentPrice?: number | undefined;
|
|
584
|
+
pixExStudentPrice?: number | undefined;
|
|
585
|
+
exStudentOf?: (string | number)[] | undefined;
|
|
562
586
|
period?: "month" | "biannual" | "year" | undefined;
|
|
563
587
|
}[] | undefined;
|
|
564
588
|
}>;
|
|
@@ -611,34 +635,34 @@ declare const ModuleSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.ex
|
|
|
611
635
|
createdAt?: FirebaseFirestore.Timestamp | null | undefined;
|
|
612
636
|
updatedAt?: FirebaseFirestore.Timestamp | null | undefined;
|
|
613
637
|
order?: number | null | undefined;
|
|
638
|
+
publishOnDate?: FirebaseFirestore.Timestamp | null | undefined;
|
|
639
|
+
unpublishOnDate?: FirebaseFirestore.Timestamp | null | undefined;
|
|
640
|
+
rss?: string | undefined;
|
|
641
|
+
isExclusive?: boolean | null | undefined;
|
|
614
642
|
previous?: {
|
|
615
643
|
id: string | number;
|
|
616
644
|
createdAt?: FirebaseFirestore.Timestamp | null | undefined;
|
|
617
645
|
updatedAt?: FirebaseFirestore.Timestamp | null | undefined;
|
|
618
646
|
order?: number | null | undefined;
|
|
619
647
|
}[] | undefined;
|
|
620
|
-
publishOnDate?: FirebaseFirestore.Timestamp | null | undefined;
|
|
621
|
-
unpublishOnDate?: FirebaseFirestore.Timestamp | null | undefined;
|
|
622
|
-
rss?: string | undefined;
|
|
623
|
-
isExclusive?: boolean | null | undefined;
|
|
624
648
|
}, {
|
|
625
649
|
title: string;
|
|
626
650
|
id?: unknown;
|
|
627
651
|
createdAt?: unknown;
|
|
628
652
|
updatedAt?: unknown;
|
|
629
653
|
order?: number | null | undefined;
|
|
630
|
-
previous?: {
|
|
631
|
-
id?: unknown;
|
|
632
|
-
createdAt?: unknown;
|
|
633
|
-
updatedAt?: unknown;
|
|
634
|
-
order?: number | null | undefined;
|
|
635
|
-
}[] | undefined;
|
|
636
654
|
publishOnDate?: unknown;
|
|
637
655
|
unpublishOnDate?: unknown;
|
|
638
656
|
published?: boolean | undefined;
|
|
639
657
|
isPrivate?: boolean | undefined;
|
|
640
658
|
rss?: string | undefined;
|
|
641
659
|
isExclusive?: boolean | null | undefined;
|
|
660
|
+
previous?: {
|
|
661
|
+
id?: unknown;
|
|
662
|
+
createdAt?: unknown;
|
|
663
|
+
updatedAt?: unknown;
|
|
664
|
+
order?: number | null | undefined;
|
|
665
|
+
}[] | undefined;
|
|
642
666
|
}>;
|
|
643
667
|
declare const JourneyContentTypeSchema: z.ZodEnum<["video", "document", "audio", "text", "soundcloud", "youtube", "form", "live", "file"]>;
|
|
644
668
|
declare const ActivitySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
@@ -863,16 +887,16 @@ declare const ModuleWithActivities: z.ZodObject<z.objectUtil.extendShape<z.objec
|
|
|
863
887
|
createdAt?: FirebaseFirestore.Timestamp | null | undefined;
|
|
864
888
|
updatedAt?: FirebaseFirestore.Timestamp | null | undefined;
|
|
865
889
|
order?: number | null | undefined;
|
|
890
|
+
publishOnDate?: FirebaseFirestore.Timestamp | null | undefined;
|
|
891
|
+
unpublishOnDate?: FirebaseFirestore.Timestamp | null | undefined;
|
|
892
|
+
rss?: string | undefined;
|
|
893
|
+
isExclusive?: boolean | null | undefined;
|
|
866
894
|
previous?: {
|
|
867
895
|
id: string | number;
|
|
868
896
|
createdAt?: FirebaseFirestore.Timestamp | null | undefined;
|
|
869
897
|
updatedAt?: FirebaseFirestore.Timestamp | null | undefined;
|
|
870
898
|
order?: number | null | undefined;
|
|
871
899
|
}[] | undefined;
|
|
872
|
-
publishOnDate?: FirebaseFirestore.Timestamp | null | undefined;
|
|
873
|
-
unpublishOnDate?: FirebaseFirestore.Timestamp | null | undefined;
|
|
874
|
-
rss?: string | undefined;
|
|
875
|
-
isExclusive?: boolean | null | undefined;
|
|
876
900
|
}, {
|
|
877
901
|
title: string;
|
|
878
902
|
activities: {
|
|
@@ -900,18 +924,18 @@ declare const ModuleWithActivities: z.ZodObject<z.objectUtil.extendShape<z.objec
|
|
|
900
924
|
createdAt?: unknown;
|
|
901
925
|
updatedAt?: unknown;
|
|
902
926
|
order?: number | null | undefined;
|
|
903
|
-
previous?: {
|
|
904
|
-
id?: unknown;
|
|
905
|
-
createdAt?: unknown;
|
|
906
|
-
updatedAt?: unknown;
|
|
907
|
-
order?: number | null | undefined;
|
|
908
|
-
}[] | undefined;
|
|
909
927
|
publishOnDate?: unknown;
|
|
910
928
|
unpublishOnDate?: unknown;
|
|
911
929
|
published?: boolean | undefined;
|
|
912
930
|
isPrivate?: boolean | undefined;
|
|
913
931
|
rss?: string | undefined;
|
|
914
932
|
isExclusive?: boolean | null | undefined;
|
|
933
|
+
previous?: {
|
|
934
|
+
id?: unknown;
|
|
935
|
+
createdAt?: unknown;
|
|
936
|
+
updatedAt?: unknown;
|
|
937
|
+
order?: number | null | undefined;
|
|
938
|
+
}[] | undefined;
|
|
915
939
|
}>;
|
|
916
940
|
type ModuleWithActivities = z.infer<typeof ModuleWithActivities>;
|
|
917
941
|
type Activity = z.infer<typeof ActivitySchema>;
|
package/dist/model/journey.js
CHANGED
|
@@ -151,6 +151,9 @@ var PlanSchema = ModelSchema.extend({
|
|
|
151
151
|
pixPrice: import_zod3.z.number(),
|
|
152
152
|
portalPrice: import_zod3.z.number().optional(),
|
|
153
153
|
pixPortalPrice: import_zod3.z.number().optional(),
|
|
154
|
+
exStudentPrice: import_zod3.z.number().optional(),
|
|
155
|
+
pixExStudentPrice: import_zod3.z.number().optional(),
|
|
156
|
+
exStudentOf: import_zod3.z.array(IdModelSchema).optional(),
|
|
154
157
|
period: import_zod3.z.enum([
|
|
155
158
|
"month",
|
|
156
159
|
"biannual",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/henriquewilson/Developer/Projects/gabirubi-domain/dist/model/journey.js","../../src/model/journey.ts","../../src/model.ts","../../src/model/shared.ts"],"names":["__create","Object","create","__defProp","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__getProtoOf","getPrototypeOf","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toESM","mod","isNodeMode","__esModule","value","__toCommonJS","journey_exports","ActivitySchema","JourneyButtonSchema","JourneyContentTypeSchema","JourneySchema","ModuleSchema","ModuleWithActivities","PlanSchema","PublishOnDate","module","exports","import_zod","require","import_firestore","TimestampOrNow","z","preprocess","arg","Timestamp","now","custom","nullish","optional","import_cuid","generateFirestoreId","cuid","IdModelSchema","import_zod2","union","string","number","IdModelProcess","val","ModelSchema","object","id","createdAt","updatedAt","order","coerce","PreviousSchema","extend","previous","lazy","array","EnabledSchema","enabled","boolean","publishOnDate","unpublishOnDate","published","import_zod3","default","type","enum","label","link","title","description","price","pixPrice","portalPrice","pixPortalPrice","period","mode","stripePrice","stripePortalPrice","activitiesCounter","lastNewsDate","thumbnail","expirationDate","startDate","gridButton","tag","actionToUnlock","content","buttons","settings","info","chat","openingMessageDay","closingMessageNight","chatIsEnabled","chatURLs","stripeProductId","plans","merge","isPrivate","rss","isExclusive","contentType","files","url","hideComments","showChat","reference","tagsStr","activities"],"mappings":"AAAA;AACA,IAAIA,WAAWC,OAAOC,MAAM;AAC5B,IAAIC,YAAYF,OAAOG,cAAc;AACrC,IAAIC,mBAAmBJ,OAAOK,wBAAwB;AACtD,IAAIC,oBAAoBN,OAAOO,mBAAmB;AAClD,IAAIC,eAAeR,OAAOS,cAAc;AACxC,IAAIC,eAAeV,OAAOW,SAAS,CAACC,cAAc;AAClD,IAAIC,WAAW,SAACC,QAAQC;IACtB,IAAK,IAAIC,QAAQD,IACfb,UAAUY,QAAQE,MAAM;QAAEC,KAAKF,GAAG,CAACC,KAAK;QAAEE,YAAY;IAAK;AAC/D;AACA,IAAIC,cAAc,SAACC,IAAIC,MAAMC,QAAQC;IACnC,IAAIF,QAAQ,OAAOA,SAAS,YAAY,OAAOA,SAAS,YAAY;YAC7D,kCAAA,2BAAA;;;gBAAA,IAAIG,MAAJ;gBACH,IAAI,CAACd,aAAae,IAAI,CAACL,IAAII,QAAQA,QAAQF,QACzCpB,UAAUkB,IAAII,KAAK;oBAAEP,KAAK;+BAAMI,IAAI,CAACG,IAAI;;oBAAEN,YAAY,CAAEK,CAAAA,OAAOnB,iBAAiBiB,MAAMG,IAAG,KAAMD,KAAKL,UAAU;gBAAC;;YAFpH,QAAK,YAAWZ,kBAAkBe,0BAA7B,SAAA,6BAAA,QAAA,yBAAA;;YAAA;YAAA;;;qBAAA,6BAAA;oBAAA;;;oBAAA;0BAAA;;;;IAGP;IACA,OAAOD;AACT;AACA,IAAIM,UAAU,SAACC,KAAKC,YAAYd;WAAYA,SAASa,OAAO,OAAO5B,SAASS,aAAamB,QAAQ,CAAC,GAAGR,YACnG,sEAAsE;IACtE,iEAAiE;IACjE,sEAAsE;IACtE,qEAAqE;IACrES,cAAc,CAACD,OAAO,CAACA,IAAIE,UAAU,GAAG3B,UAAUY,QAAQ,WAAW;QAAEgB,OAAOH;QAAKT,YAAY;IAAK,KAAKJ,QACzGa;;AAEF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,IAAA,CAAK;IAAC;IAAS;IAAY;IAAS;IAAQ;IAAc;IAAW;IAAQ;IAAQ;CAAO;AAE/H,IAAMrD,iBAAiBgC,YAAYQ,MAAA,CAAO;IAC/CgB,OAAON,YAAApC,CAAA,CAAEc,MAAA;IACT6B,aAAaP,YAAApC,CAAA,CAAEc,MAAA,GAASP,QAAA;IACxBoE,aAAavF;IACbwE,SAASxB,YAAApC,CAAA,CAAEc,MAAA;IACX8D,OAAOxC,YAAApC,CAAA,CAAE6B,KAAA,CAAMO,YAAApC,CAAA,CAAEmB,MAAA,CAAO;QACtBqB,OAAOJ,YAAApC,CAAA,CAAEc,MAAA,GAASP,QAAA;QAClBsE,KAAKzC,YAAApC,CAAA,CAAEc,MAAA;IACT,IAAIP,QAAA;IACJuE,cAAc1C,YAAApC,CAAA,CAAEgC,OAAA,GAAUK,OAAA,CAAQ;IAClC0C,UAAU3C,YAAApC,CAAA,CAAEgC,OAAA,GAAUK,OAAA,CAAQ;IAC9B2C,WAAW5C,YAAApC,CAAA,CAAEc,MAAA,GAASP,QAAA;IACtB0E,SAAS7C,YAAApC,CAAA,CAAEc,MAAA,GAASP,QAAA;AACtB,GAAGgE,KAAA,CAAM9E;AAEF,IAAMF,uBAAuBD,aAAaoC,MAAA,CAAO;IACtDwD,YAAYhG,eAAe2C,KAAA;AAC7B;ADsEA,6DAA6D;AAC7D,KAAMnC,CAAAA,OAAOC,OAAO,GAAG;IACrBT,gBAAAA;IACAC,qBAAAA;IACAC,0BAAAA;IACAC,eAAAA;IACAC,cAAAA;IACAC,sBAAAA;IACAC,YAAAA;IACAC,eAAAA;AACF,CAAA","sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/model/journey.ts\nvar journey_exports = {};\n__export(journey_exports, {\n ActivitySchema: () => ActivitySchema,\n JourneyButtonSchema: () => JourneyButtonSchema,\n JourneyContentTypeSchema: () => JourneyContentTypeSchema,\n JourneySchema: () => JourneySchema,\n ModuleSchema: () => ModuleSchema,\n ModuleWithActivities: () => ModuleWithActivities,\n PlanSchema: () => PlanSchema,\n PublishOnDate: () => PublishOnDate\n});\nmodule.exports = __toCommonJS(journey_exports);\n\n// src/model.ts\nvar import_zod2 = require(\"zod\");\n\n// src/model/shared.ts\nvar import_firestore = require(\"@google-cloud/firestore\");\nvar import_zod = require(\"zod\");\nvar TimestampOrNow = import_zod.z.preprocess(\n (arg) => arg === void 0 ? import_firestore.Timestamp.now() : arg,\n import_zod.z.custom()\n).nullish().optional();\n\n// src/model.ts\nvar import_cuid = __toESM(require(\"cuid\"));\nvar generateFirestoreId = () => {\n return (0, import_cuid.default)();\n};\nvar IdModelSchema = import_zod2.z.union([import_zod2.z.string(), import_zod2.z.number()]);\nvar IdModelProcess = import_zod2.z.preprocess((val) => {\n if (val === void 0 || val === null) {\n return generateFirestoreId();\n }\n return val;\n}, IdModelSchema);\nvar ModelSchema = import_zod2.z.object({\n id: IdModelProcess,\n createdAt: TimestampOrNow,\n updatedAt: TimestampOrNow,\n order: import_zod2.z.coerce.number().nullish().optional()\n});\nvar PreviousSchema = ModelSchema.extend({\n previous: import_zod2.z.lazy(() => ModelSchema.array().optional())\n});\nvar EnabledSchema = import_zod2.z.object({\n enabled: import_zod2.z.boolean().optional()\n});\n\n// src/model/journey.ts\nvar import_zod3 = require(\"zod\");\nvar PublishOnDate = ModelSchema.extend({\n publishOnDate: TimestampOrNow,\n unpublishOnDate: TimestampOrNow,\n published: import_zod3.z.boolean().default(false)\n});\nvar JourneyButtonSchema = import_zod3.z.object({\n type: import_zod3.z.enum([\"primary\", \"warning\", \"normal\"]),\n label: import_zod3.z.string(),\n link: import_zod3.z.string(),\n target: import_zod3.z.enum([\"_blank\", \"_self\"]).default(\"_self\")\n});\nvar PlanSchema = ModelSchema.extend({\n title: import_zod3.z.string(),\n description: import_zod3.z.string().optional(),\n enabled: import_zod3.z.boolean().default(true),\n price: import_zod3.z.number(),\n pixPrice: import_zod3.z.number(),\n portalPrice: import_zod3.z.number().optional(),\n pixPortalPrice: import_zod3.z.number().optional(),\n period: import_zod3.z.enum([\"month\", \"biannual\", \"year\"]).default(\"month\"),\n mode: import_zod3.z.enum([\"payment\", \"setup\", \"subscription\"]),\n stripePrice: import_zod3.z.string(),\n stripePortalPrice: import_zod3.z.string()\n});\nvar JourneySchema = ModelSchema.extend({\n activitiesCounter: import_zod3.z.number(),\n lastNewsDate: TimestampOrNow,\n title: import_zod3.z.string(),\n type: import_zod3.z.enum([\"simple\", \"modular\", \"free\"]),\n description: import_zod3.z.string().optional(),\n thumbnail: import_zod3.z.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: import_zod3.z.string().optional(),\n actionToUnlock: import_zod3.z.object({\n type: import_zod3.z.enum([\"link\", \"message\"]),\n content: import_zod3.z.string(),\n buttons: import_zod3.z.array(JourneyButtonSchema).optional()\n }).optional(),\n settings: import_zod3.z.object({\n info: import_zod3.z.object({\n thumbnail: import_zod3.z.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: import_zod3.z.string().optional(),\n actionToUnlock: import_zod3.z.object({\n type: import_zod3.z.enum([\"link\", \"message\"]),\n content: import_zod3.z.string(),\n buttons: import_zod3.z.array(JourneyButtonSchema).optional()\n }).optional()\n }).optional(),\n chat: import_zod3.z.object({\n openingMessageDay: import_zod3.z.string().optional(),\n // closingMessageDay: z.string().optional(),\n // openingMessageNight: z.string().optional(),\n closingMessageNight: import_zod3.z.string().optional(),\n chatIsEnabled: import_zod3.z.boolean().default(false),\n chatURLs: import_zod3.z.array(import_zod3.z.string()).optional()\n }).optional()\n }).optional(),\n stripeProductId: import_zod3.z.string().optional(),\n plans: import_zod3.z.array(PlanSchema).optional()\n}).merge(PublishOnDate);\nvar ModuleSchema = ModelSchema.extend({\n title: import_zod3.z.string(),\n isPrivate: import_zod3.z.boolean().default(true),\n rss: import_zod3.z.string().optional(),\n isExclusive: import_zod3.z.boolean().nullish().optional()\n}).merge(PreviousSchema).merge(PublishOnDate);\nvar JourneyContentTypeSchema = import_zod3.z.enum([\"video\", \"document\", \"audio\", \"text\", \"soundcloud\", \"youtube\", \"form\", \"live\", \"file\"]);\nvar ActivitySchema = ModelSchema.extend({\n title: import_zod3.z.string(),\n description: import_zod3.z.string().optional(),\n contentType: JourneyContentTypeSchema,\n content: import_zod3.z.string(),\n files: import_zod3.z.array(import_zod3.z.object({\n label: import_zod3.z.string().optional(),\n url: import_zod3.z.string()\n })).optional(),\n hideComments: import_zod3.z.boolean().default(false),\n showChat: import_zod3.z.boolean().default(false),\n reference: import_zod3.z.string().optional(),\n tagsStr: import_zod3.z.string().optional()\n}).merge(PublishOnDate);\nvar ModuleWithActivities = ModuleSchema.extend({\n activities: ActivitySchema.array()\n});\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n ActivitySchema,\n JourneyButtonSchema,\n JourneyContentTypeSchema,\n JourneySchema,\n ModuleSchema,\n ModuleWithActivities,\n PlanSchema,\n PublishOnDate\n});\n","import {ModelSchema, PreviousSchema} from \"../model\";\nimport {z} from \"zod\";\nimport {TimestampOrNow} from \"./shared\";\n\nexport const PublishOnDate = ModelSchema.extend({\n publishOnDate: TimestampOrNow,\n unpublishOnDate: TimestampOrNow,\n published: z.boolean().default(false),\n})\n\nexport const JourneyButtonSchema = z.object({\n type: z.enum(['primary', 'warning', 'normal']),\n label: z.string(),\n link: z.string(),\n target: z.enum(['_blank', '_self']).default('_self'),\n})\n\nexport const PlanSchema = ModelSchema.extend({\n title: z.string(),\n description: z.string().optional(),\n enabled: z.boolean().default(true),\n price: z.number(),\n pixPrice: z.number(),\n portalPrice: z.number().optional(),\n pixPortalPrice: z.number().optional(),\n period: z.enum(['month', 'biannual', 'year']).default('month'),\n mode: z.enum(['payment', 'setup', 'subscription']),\n stripePrice: z.string(),\n stripePortalPrice: z.string(),\n})\n\nexport const JourneySchema = ModelSchema.extend({\n activitiesCounter: z.number(),\n lastNewsDate: TimestampOrNow,\n title: z.string(),\n type: z.enum(['simple', 'modular', 'free']),\n description: z.string().optional(),\n thumbnail: z.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: z.string().optional(),\n actionToUnlock: z.object({\n type: z.enum(['link', 'message']),\n content: z.string(),\n buttons: z.array(JourneyButtonSchema).optional()\n }).optional(),\n settings: z.object({\n info: z.object({\n thumbnail: z.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: z.string().optional(),\n actionToUnlock: z.object({\n type: z.enum(['link', 'message']),\n content: z.string(),\n buttons: z.array(JourneyButtonSchema).optional()\n }).optional(),\n }).optional(),\n chat: z.object({\n openingMessageDay: z.string().optional(),\n // closingMessageDay: z.string().optional(),\n // openingMessageNight: z.string().optional(),\n closingMessageNight: z.string().optional(),\n chatIsEnabled: z.boolean().default(false),\n chatURLs: z.array(z.string()).optional(),\n }).optional()\n }).optional(),\n stripeProductId: z.string().optional(),\n plans: z.array(PlanSchema).optional(),\n}).merge(PublishOnDate)\n\n\nexport const ModuleSchema = ModelSchema.extend({\n title: z.string(),\n isPrivate: z.boolean().default(true),\n rss: z.string().optional(),\n isExclusive: z.boolean().nullish().optional(),\n}).merge(PreviousSchema).merge(PublishOnDate)\n\nexport const JourneyContentTypeSchema = z.enum(['video', 'document', 'audio', 'text', 'soundcloud', 'youtube', 'form', 'live', 'file'])\n\nexport const ActivitySchema = ModelSchema.extend({\n title: z.string(),\n description: z.string().optional(),\n contentType: JourneyContentTypeSchema,\n content: z.string(),\n files: z.array(z.object({\n label: z.string().optional(),\n url: z.string()\n })).optional(),\n hideComments: z.boolean().default(false),\n showChat: z.boolean().default(false),\n reference: z.string().optional(),\n tagsStr: z.string().optional(),\n}).merge(PublishOnDate);\n\nexport const ModuleWithActivities = ModuleSchema.extend({\n activities: ActivitySchema.array()\n})\n\nexport type Module = z.infer<typeof ModuleSchema>\nexport type Journey = z.infer<typeof JourneySchema>\nexport type Plan = z.infer<typeof PlanSchema>\nexport type ModuleWithActivities = z.infer<typeof ModuleWithActivities>\nexport type Activity = z.infer<typeof ActivitySchema>\nexport type JourneyContentType = z.infer<typeof JourneyContentTypeSchema>\n","import {z} from \"zod\";\nimport {TimestampOrNow} from \"./model/shared\";\nimport cuid from 'cuid';\n\nexport const generateFirestoreId = () => {\n return cuid();\n}\n\nexport const IdModelSchema = z.union([z.string(), z.number()])\n\nconst IdModelProcess = z.preprocess((val) => {\n if (val === undefined || val === null) {\n return generateFirestoreId();\n }\n return val;\n}, IdModelSchema);\n\nexport const ModelSchema = z.object({\n id: IdModelProcess,\n createdAt: TimestampOrNow,\n updatedAt: TimestampOrNow,\n order: z.coerce.number().nullish().optional()\n});\n\nexport const PreviousSchema = ModelSchema.extend({\n previous: z.lazy(() => ModelSchema.array().optional())\n})\n\nexport const EnabledSchema = z.object({\n enabled: z.boolean().optional()\n})\n\nexport type IdModel = z.infer<typeof IdModelSchema>;\nexport type Model = z.infer<typeof ModelSchema>;\nexport type Previous = z.infer<typeof PreviousSchema>;\nexport type Enabled = z.infer<typeof EnabledSchema>;\nexport type PartialWithId<T extends Model> = Partial<T> & {\n id: NonNullable<T['id']>\n}\n\n\n","import { Timestamp } from '@google-cloud/firestore';\nimport {z} from \"zod\";\n\nexport const TimestampOrNow = z\n .preprocess(\n (arg) => (arg === undefined ? Timestamp.now() : arg),\n z.custom<Timestamp>(),\n )\n .nullish().optional();\n"]}
|
|
1
|
+
{"version":3,"sources":["/Users/henriquewilson/Developer/Projects/gabirubi-domain/dist/model/journey.js","../../src/model/journey.ts","../../src/model.ts","../../src/model/shared.ts"],"names":["__create","Object","create","__defProp","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__getProtoOf","getPrototypeOf","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toESM","mod","isNodeMode","__esModule","value","__toCommonJS","journey_exports","ActivitySchema","JourneyButtonSchema","JourneyContentTypeSchema","JourneySchema","ModuleSchema","ModuleWithActivities","PlanSchema","PublishOnDate","module","exports","import_zod","require","import_firestore","TimestampOrNow","z","preprocess","arg","Timestamp","now","custom","nullish","optional","import_cuid","generateFirestoreId","cuid","IdModelSchema","import_zod2","union","string","number","IdModelProcess","val","ModelSchema","object","id","createdAt","updatedAt","order","coerce","PreviousSchema","extend","previous","lazy","array","EnabledSchema","enabled","boolean","publishOnDate","unpublishOnDate","published","import_zod3","default","type","enum","label","link","title","description","price","pixPrice","portalPrice","pixPortalPrice","exStudentPrice","pixExStudentPrice","exStudentOf","period","mode","stripePrice","stripePortalPrice","activitiesCounter","lastNewsDate","thumbnail","expirationDate","startDate","gridButton","tag","actionToUnlock","content","buttons","settings","info","chat","openingMessageDay","closingMessageNight","chatIsEnabled","chatURLs","stripeProductId","plans","merge","isPrivate","rss","isExclusive","contentType","files","url","hideComments","showChat","reference","tagsStr","activities"],"mappings":"AAAA;AACA,IAAIA,WAAWC,OAAOC,MAAM;AAC5B,IAAIC,YAAYF,OAAOG,cAAc;AACrC,IAAIC,mBAAmBJ,OAAOK,wBAAwB;AACtD,IAAIC,oBAAoBN,OAAOO,mBAAmB;AAClD,IAAIC,eAAeR,OAAOS,cAAc;AACxC,IAAIC,eAAeV,OAAOW,SAAS,CAACC,cAAc;AAClD,IAAIC,WAAW,SAACC,QAAQC;IACtB,IAAK,IAAIC,QAAQD,IACfb,UAAUY,QAAQE,MAAM;QAAEC,KAAKF,GAAG,CAACC,KAAK;QAAEE,YAAY;IAAK;AAC/D;AACA,IAAIC,cAAc,SAACC,IAAIC,MAAMC,QAAQC;IACnC,IAAIF,QAAQ,OAAOA,SAAS,YAAY,OAAOA,SAAS,YAAY;YAC7D,kCAAA,2BAAA;;;gBAAA,IAAIG,MAAJ;gBACH,IAAI,CAACd,aAAae,IAAI,CAACL,IAAII,QAAQA,QAAQF,QACzCpB,UAAUkB,IAAII,KAAK;oBAAEP,KAAK;+BAAMI,IAAI,CAACG,IAAI;;oBAAEN,YAAY,CAAEK,CAAAA,OAAOnB,iBAAiBiB,MAAMG,IAAG,KAAMD,KAAKL,UAAU;gBAAC;;YAFpH,QAAK,YAAWZ,kBAAkBe,0BAA7B,SAAA,6BAAA,QAAA,yBAAA;;YAAA;YAAA;;;qBAAA,6BAAA;oBAAA;;;oBAAA;0BAAA;;;;IAGP;IACA,OAAOD;AACT;AACA,IAAIM,UAAU,SAACC,KAAKC,YAAYd;WAAYA,SAASa,OAAO,OAAO5B,SAASS,aAAamB,QAAQ,CAAC,GAAGR,YACnG,sEAAsE;IACtE,iEAAiE;IACjE,sEAAsE;IACtE,qEAA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AAA;IACAC,0BAAAA;IACAC,eAAAA;IACAC,cAAAA;IACAC,sBAAAA;IACAC,YAAAA;IACAC,eAAAA;AACF,CAAA","sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/model/journey.ts\nvar journey_exports = {};\n__export(journey_exports, {\n ActivitySchema: () => ActivitySchema,\n JourneyButtonSchema: () => JourneyButtonSchema,\n JourneyContentTypeSchema: () => JourneyContentTypeSchema,\n JourneySchema: () => JourneySchema,\n ModuleSchema: () => ModuleSchema,\n ModuleWithActivities: () => ModuleWithActivities,\n PlanSchema: () => PlanSchema,\n PublishOnDate: () => PublishOnDate\n});\nmodule.exports = __toCommonJS(journey_exports);\n\n// src/model.ts\nvar import_zod2 = require(\"zod\");\n\n// src/model/shared.ts\nvar import_firestore = require(\"@google-cloud/firestore\");\nvar import_zod = require(\"zod\");\nvar TimestampOrNow = import_zod.z.preprocess(\n (arg) => arg === void 0 ? import_firestore.Timestamp.now() : arg,\n import_zod.z.custom()\n).nullish().optional();\n\n// src/model.ts\nvar import_cuid = __toESM(require(\"cuid\"));\nvar generateFirestoreId = () => {\n return (0, import_cuid.default)();\n};\nvar IdModelSchema = import_zod2.z.union([import_zod2.z.string(), import_zod2.z.number()]);\nvar IdModelProcess = import_zod2.z.preprocess((val) => {\n if (val === void 0 || val === null) {\n return generateFirestoreId();\n }\n return val;\n}, IdModelSchema);\nvar ModelSchema = import_zod2.z.object({\n id: IdModelProcess,\n createdAt: TimestampOrNow,\n updatedAt: TimestampOrNow,\n order: import_zod2.z.coerce.number().nullish().optional()\n});\nvar PreviousSchema = ModelSchema.extend({\n previous: import_zod2.z.lazy(() => ModelSchema.array().optional())\n});\nvar EnabledSchema = import_zod2.z.object({\n enabled: import_zod2.z.boolean().optional()\n});\n\n// src/model/journey.ts\nvar import_zod3 = require(\"zod\");\nvar PublishOnDate = ModelSchema.extend({\n publishOnDate: TimestampOrNow,\n unpublishOnDate: TimestampOrNow,\n published: import_zod3.z.boolean().default(false)\n});\nvar JourneyButtonSchema = import_zod3.z.object({\n type: import_zod3.z.enum([\"primary\", \"warning\", \"normal\"]),\n label: import_zod3.z.string(),\n link: import_zod3.z.string(),\n target: import_zod3.z.enum([\"_blank\", \"_self\"]).default(\"_self\")\n});\nvar PlanSchema = ModelSchema.extend({\n title: import_zod3.z.string(),\n description: import_zod3.z.string().optional(),\n enabled: import_zod3.z.boolean().default(true),\n price: import_zod3.z.number(),\n pixPrice: import_zod3.z.number(),\n portalPrice: import_zod3.z.number().optional(),\n pixPortalPrice: import_zod3.z.number().optional(),\n exStudentPrice: import_zod3.z.number().optional(),\n pixExStudentPrice: import_zod3.z.number().optional(),\n exStudentOf: import_zod3.z.array(IdModelSchema).optional(),\n period: import_zod3.z.enum([\"month\", \"biannual\", \"year\"]).default(\"month\"),\n mode: import_zod3.z.enum([\"payment\", \"setup\", \"subscription\"]),\n stripePrice: import_zod3.z.string(),\n stripePortalPrice: import_zod3.z.string()\n});\nvar JourneySchema = ModelSchema.extend({\n activitiesCounter: import_zod3.z.number(),\n lastNewsDate: TimestampOrNow,\n title: import_zod3.z.string(),\n type: import_zod3.z.enum([\"simple\", \"modular\", \"free\"]),\n description: import_zod3.z.string().optional(),\n thumbnail: import_zod3.z.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: import_zod3.z.string().optional(),\n actionToUnlock: import_zod3.z.object({\n type: import_zod3.z.enum([\"link\", \"message\"]),\n content: import_zod3.z.string(),\n buttons: import_zod3.z.array(JourneyButtonSchema).optional()\n }).optional(),\n settings: import_zod3.z.object({\n info: import_zod3.z.object({\n thumbnail: import_zod3.z.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: import_zod3.z.string().optional(),\n actionToUnlock: import_zod3.z.object({\n type: import_zod3.z.enum([\"link\", \"message\"]),\n content: import_zod3.z.string(),\n buttons: import_zod3.z.array(JourneyButtonSchema).optional()\n }).optional()\n }).optional(),\n chat: import_zod3.z.object({\n openingMessageDay: import_zod3.z.string().optional(),\n // closingMessageDay: z.string().optional(),\n // openingMessageNight: z.string().optional(),\n closingMessageNight: import_zod3.z.string().optional(),\n chatIsEnabled: import_zod3.z.boolean().default(false),\n chatURLs: import_zod3.z.array(import_zod3.z.string()).optional()\n }).optional()\n }).optional(),\n stripeProductId: import_zod3.z.string().optional(),\n plans: import_zod3.z.array(PlanSchema).optional()\n}).merge(PublishOnDate);\nvar ModuleSchema = ModelSchema.extend({\n title: import_zod3.z.string(),\n isPrivate: import_zod3.z.boolean().default(true),\n rss: import_zod3.z.string().optional(),\n isExclusive: import_zod3.z.boolean().nullish().optional()\n}).merge(PreviousSchema).merge(PublishOnDate);\nvar JourneyContentTypeSchema = import_zod3.z.enum([\"video\", \"document\", \"audio\", \"text\", \"soundcloud\", \"youtube\", \"form\", \"live\", \"file\"]);\nvar ActivitySchema = ModelSchema.extend({\n title: import_zod3.z.string(),\n description: import_zod3.z.string().optional(),\n contentType: JourneyContentTypeSchema,\n content: import_zod3.z.string(),\n files: import_zod3.z.array(import_zod3.z.object({\n label: import_zod3.z.string().optional(),\n url: import_zod3.z.string()\n })).optional(),\n hideComments: import_zod3.z.boolean().default(false),\n showChat: import_zod3.z.boolean().default(false),\n reference: import_zod3.z.string().optional(),\n tagsStr: import_zod3.z.string().optional()\n}).merge(PublishOnDate);\nvar ModuleWithActivities = ModuleSchema.extend({\n activities: ActivitySchema.array()\n});\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n ActivitySchema,\n JourneyButtonSchema,\n JourneyContentTypeSchema,\n JourneySchema,\n ModuleSchema,\n ModuleWithActivities,\n PlanSchema,\n PublishOnDate\n});\n","import {IdModelSchema, ModelSchema, PreviousSchema} from \"../model\";\nimport {z} from \"zod\";\nimport {TimestampOrNow} from \"./shared\";\n\nexport const PublishOnDate = ModelSchema.extend({\n publishOnDate: TimestampOrNow,\n unpublishOnDate: TimestampOrNow,\n published: z.boolean().default(false),\n})\n\nexport const JourneyButtonSchema = z.object({\n type: z.enum(['primary', 'warning', 'normal']),\n label: z.string(),\n link: z.string(),\n target: z.enum(['_blank', '_self']).default('_self'),\n})\n\nexport const PlanSchema = ModelSchema.extend({\n title: z.string(),\n description: z.string().optional(),\n enabled: z.boolean().default(true),\n price: z.number(),\n pixPrice: z.number(),\n portalPrice: z.number().optional(),\n pixPortalPrice: z.number().optional(),\n exStudentPrice: z.number().optional(),\n pixExStudentPrice: z.number().optional(),\n exStudentOf: z.array(IdModelSchema).optional(),\n period: z.enum(['month', 'biannual', 'year']).default('month'),\n mode: z.enum(['payment', 'setup', 'subscription']),\n stripePrice: z.string(),\n stripePortalPrice: z.string(),\n})\n\nexport const JourneySchema = ModelSchema.extend({\n activitiesCounter: z.number(),\n lastNewsDate: TimestampOrNow,\n title: z.string(),\n type: z.enum(['simple', 'modular', 'free']),\n description: z.string().optional(),\n thumbnail: z.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: z.string().optional(),\n actionToUnlock: z.object({\n type: z.enum(['link', 'message']),\n content: z.string(),\n buttons: z.array(JourneyButtonSchema).optional()\n }).optional(),\n settings: z.object({\n info: z.object({\n thumbnail: z.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: z.string().optional(),\n actionToUnlock: z.object({\n type: z.enum(['link', 'message']),\n content: z.string(),\n buttons: z.array(JourneyButtonSchema).optional()\n }).optional(),\n }).optional(),\n chat: z.object({\n openingMessageDay: z.string().optional(),\n // closingMessageDay: z.string().optional(),\n // openingMessageNight: z.string().optional(),\n closingMessageNight: z.string().optional(),\n chatIsEnabled: z.boolean().default(false),\n chatURLs: z.array(z.string()).optional(),\n }).optional()\n }).optional(),\n stripeProductId: z.string().optional(),\n plans: z.array(PlanSchema).optional(),\n}).merge(PublishOnDate)\n\n\nexport const ModuleSchema = ModelSchema.extend({\n title: z.string(),\n isPrivate: z.boolean().default(true),\n rss: z.string().optional(),\n isExclusive: z.boolean().nullish().optional(),\n}).merge(PreviousSchema).merge(PublishOnDate)\n\nexport const JourneyContentTypeSchema = z.enum(['video', 'document', 'audio', 'text', 'soundcloud', 'youtube', 'form', 'live', 'file'])\n\nexport const ActivitySchema = ModelSchema.extend({\n title: z.string(),\n description: z.string().optional(),\n contentType: JourneyContentTypeSchema,\n content: z.string(),\n files: z.array(z.object({\n label: z.string().optional(),\n url: z.string()\n })).optional(),\n hideComments: z.boolean().default(false),\n showChat: z.boolean().default(false),\n reference: z.string().optional(),\n tagsStr: z.string().optional(),\n}).merge(PublishOnDate);\n\nexport const ModuleWithActivities = ModuleSchema.extend({\n activities: ActivitySchema.array()\n})\n\nexport type Module = z.infer<typeof ModuleSchema>\nexport type Journey = z.infer<typeof JourneySchema>\nexport type Plan = z.infer<typeof PlanSchema>\nexport type ModuleWithActivities = z.infer<typeof ModuleWithActivities>\nexport type Activity = z.infer<typeof ActivitySchema>\nexport type JourneyContentType = z.infer<typeof JourneyContentTypeSchema>\n","import {z} from \"zod\";\nimport {TimestampOrNow} from \"./model/shared\";\nimport cuid from 'cuid';\n\nexport const generateFirestoreId = () => {\n return cuid();\n}\n\nexport const IdModelSchema = z.union([z.string(), z.number()])\n\nconst IdModelProcess = z.preprocess((val) => {\n if (val === undefined || val === null) {\n return generateFirestoreId();\n }\n return val;\n}, IdModelSchema);\n\nexport const ModelSchema = z.object({\n id: IdModelProcess,\n createdAt: TimestampOrNow,\n updatedAt: TimestampOrNow,\n order: z.coerce.number().nullish().optional()\n});\n\nexport const PreviousSchema = ModelSchema.extend({\n previous: z.lazy(() => ModelSchema.array().optional())\n})\n\nexport const EnabledSchema = z.object({\n enabled: z.boolean().optional()\n})\n\nexport type IdModel = z.infer<typeof IdModelSchema>;\nexport type Model = z.infer<typeof ModelSchema>;\nexport type Previous = z.infer<typeof PreviousSchema>;\nexport type Enabled = z.infer<typeof EnabledSchema>;\nexport type PartialWithId<T extends Model> = Partial<T> & {\n id: NonNullable<T['id']>\n}\n\n\n","import { Timestamp } from '@google-cloud/firestore';\nimport {z} from \"zod\";\n\nexport const TimestampOrNow = z\n .preprocess(\n (arg) => (arg === undefined ? Timestamp.now() : arg),\n z.custom<Timestamp>(),\n )\n .nullish().optional();\n"]}
|
package/dist/model/journey.mjs
CHANGED
|
@@ -63,6 +63,9 @@ var PlanSchema = ModelSchema.extend({
|
|
|
63
63
|
pixPrice: z3.number(),
|
|
64
64
|
portalPrice: z3.number().optional(),
|
|
65
65
|
pixPortalPrice: z3.number().optional(),
|
|
66
|
+
exStudentPrice: z3.number().optional(),
|
|
67
|
+
pixExStudentPrice: z3.number().optional(),
|
|
68
|
+
exStudentOf: z3.array(IdModelSchema).optional(),
|
|
66
69
|
period: z3.enum([
|
|
67
70
|
"month",
|
|
68
71
|
"biannual",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/henriquewilson/Developer/Projects/gabirubi-domain/dist/model/journey.mjs","../../src/model.ts","../../src/model/shared.ts","../../src/model/journey.ts"],"names":["z","Timestamp","TimestampOrNow","preprocess","arg","now","custom","nullish","optional","cuid","generateFirestoreId","IdModelSchema","union","string","number","IdModelProcess","val","ModelSchema","object","id","createdAt","updatedAt","order","coerce","PreviousSchema","extend","previous","lazy","array","EnabledSchema","enabled","boolean","PublishOnDate","publishOnDate","unpublishOnDate","published","default","JourneyButtonSchema","type","enum","label","link","target","PlanSchema","title","description","price","pixPrice","portalPrice","pixPortalPrice","period","mode","stripePrice","stripePortalPrice","JourneySchema","activitiesCounter","lastNewsDate","thumbnail","expirationDate","startDate","gridButton","tag","actionToUnlock","content","buttons","settings","info","chat","openingMessageDay","closingMessageNight","chatIsEnabled","chatURLs","stripeProductId","plans","merge","ModuleSchema","isPrivate","rss","isExclusive","JourneyContentTypeSchema","ActivitySchema","contentType","files","url","hideComments","showChat","reference","tagsStr","ModuleWithActivities","activities"],"mappings":"AAAA,eAAe;ACAf,SAAQA,KAAAA,EAAAA,QAAQ,MAAA;ADGhB,sBAAsB;AEHtB,SAASC,SAAA,QAAiB,0BAAA;AAC1B,SAAQD,CAAA,QAAQ,MAAA;AAET,IAAME,iBAAiBF,EAC3BG,UAAA,CACC,SAACC;WAASA,QAAQ,KAAA,IAAYH,UAAUI,GAAA,KAAQD;GAChDJ,EAAEM,MAAA,IAEHC,OAAA,GAAUC,QAAA;AFGb,eAAe;ACTf,OAAOC,UAAU,OAAA;AAEV,IAAMC,sBAAsB;IACjC,OAAOD;AACT;AAEO,IAAME,gBAAgBX,GAAEY,KAAA,CAAM;IAACZ,GAAEa,MAAA;IAAUb,GAAEc,MAAA;CAAS;AAE7D,IAAMC,iBA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AAcpF,GAAE+B,OAAA,GAAUK,OAAA,CAAQ;IAClCiD,UAAUrF,GAAE+B,OAAA,GAAUK,OAAA,CAAQ;IAC9BkD,WAAWtF,GAAEa,MAAA,GAASL,QAAA;IACtB+E,SAASvF,GAAEa,MAAA,GAASL,QAAA;AACtB,GAAGkE,KAAA,CAAM1C;AAEF,IAAMwD,uBAAuBb,aAAalD,MAAA,CAAO;IACtDgE,YAAYT,eAAepD,KAAA;AAC7B;AH2BA,SACEoD,cAAc,EACd3C,mBAAmB,EACnB0C,wBAAwB,EACxBzB,aAAa,EACbqB,YAAY,EACZa,oBAAoB,EACpB7C,UAAU,EACVX,aAAa,GACb","sourcesContent":["// src/model.ts\nimport { z as z2 } from \"zod\";\n\n// src/model/shared.ts\nimport { Timestamp } from \"@google-cloud/firestore\";\nimport { z } from \"zod\";\nvar TimestampOrNow = z.preprocess(\n (arg) => arg === void 0 ? Timestamp.now() : arg,\n z.custom()\n).nullish().optional();\n\n// src/model.ts\nimport cuid from \"cuid\";\nvar generateFirestoreId = () => {\n return cuid();\n};\nvar IdModelSchema = z2.union([z2.string(), z2.number()]);\nvar IdModelProcess = z2.preprocess((val) => {\n if (val === void 0 || val === null) {\n return generateFirestoreId();\n }\n return val;\n}, IdModelSchema);\nvar ModelSchema = z2.object({\n id: IdModelProcess,\n createdAt: TimestampOrNow,\n updatedAt: TimestampOrNow,\n order: z2.coerce.number().nullish().optional()\n});\nvar PreviousSchema = ModelSchema.extend({\n previous: z2.lazy(() => ModelSchema.array().optional())\n});\nvar EnabledSchema = z2.object({\n enabled: z2.boolean().optional()\n});\n\n// src/model/journey.ts\nimport { z as z3 } from \"zod\";\nvar PublishOnDate = ModelSchema.extend({\n publishOnDate: TimestampOrNow,\n unpublishOnDate: TimestampOrNow,\n published: z3.boolean().default(false)\n});\nvar JourneyButtonSchema = z3.object({\n type: z3.enum([\"primary\", \"warning\", \"normal\"]),\n label: z3.string(),\n link: z3.string(),\n target: z3.enum([\"_blank\", \"_self\"]).default(\"_self\")\n});\nvar PlanSchema = ModelSchema.extend({\n title: z3.string(),\n description: z3.string().optional(),\n enabled: z3.boolean().default(true),\n price: z3.number(),\n pixPrice: z3.number(),\n portalPrice: z3.number().optional(),\n pixPortalPrice: z3.number().optional(),\n period: z3.enum([\"month\", \"biannual\", \"year\"]).default(\"month\"),\n mode: z3.enum([\"payment\", \"setup\", \"subscription\"]),\n stripePrice: z3.string(),\n stripePortalPrice: z3.string()\n});\nvar JourneySchema = ModelSchema.extend({\n activitiesCounter: z3.number(),\n lastNewsDate: TimestampOrNow,\n title: z3.string(),\n type: z3.enum([\"simple\", \"modular\", \"free\"]),\n description: z3.string().optional(),\n thumbnail: z3.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: z3.string().optional(),\n actionToUnlock: z3.object({\n type: z3.enum([\"link\", \"message\"]),\n content: z3.string(),\n buttons: z3.array(JourneyButtonSchema).optional()\n }).optional(),\n settings: z3.object({\n info: z3.object({\n thumbnail: z3.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: z3.string().optional(),\n actionToUnlock: z3.object({\n type: z3.enum([\"link\", \"message\"]),\n content: z3.string(),\n buttons: z3.array(JourneyButtonSchema).optional()\n }).optional()\n }).optional(),\n chat: z3.object({\n openingMessageDay: z3.string().optional(),\n // closingMessageDay: z.string().optional(),\n // openingMessageNight: z.string().optional(),\n closingMessageNight: z3.string().optional(),\n chatIsEnabled: z3.boolean().default(false),\n chatURLs: z3.array(z3.string()).optional()\n }).optional()\n }).optional(),\n stripeProductId: z3.string().optional(),\n plans: z3.array(PlanSchema).optional()\n}).merge(PublishOnDate);\nvar ModuleSchema = ModelSchema.extend({\n title: z3.string(),\n isPrivate: z3.boolean().default(true),\n rss: z3.string().optional(),\n isExclusive: z3.boolean().nullish().optional()\n}).merge(PreviousSchema).merge(PublishOnDate);\nvar JourneyContentTypeSchema = z3.enum([\"video\", \"document\", \"audio\", \"text\", \"soundcloud\", \"youtube\", \"form\", \"live\", \"file\"]);\nvar ActivitySchema = ModelSchema.extend({\n title: z3.string(),\n description: z3.string().optional(),\n contentType: JourneyContentTypeSchema,\n content: z3.string(),\n files: z3.array(z3.object({\n label: z3.string().optional(),\n url: z3.string()\n })).optional(),\n hideComments: z3.boolean().default(false),\n showChat: z3.boolean().default(false),\n reference: z3.string().optional(),\n tagsStr: z3.string().optional()\n}).merge(PublishOnDate);\nvar ModuleWithActivities = ModuleSchema.extend({\n activities: ActivitySchema.array()\n});\nexport {\n ActivitySchema,\n JourneyButtonSchema,\n JourneyContentTypeSchema,\n JourneySchema,\n ModuleSchema,\n ModuleWithActivities,\n PlanSchema,\n PublishOnDate\n};\n","import {z} from \"zod\";\nimport {TimestampOrNow} from \"./model/shared\";\nimport cuid from 'cuid';\n\nexport const generateFirestoreId = () => {\n return cuid();\n}\n\nexport const IdModelSchema = z.union([z.string(), z.number()])\n\nconst IdModelProcess = z.preprocess((val) => {\n if (val === undefined || val === null) {\n return generateFirestoreId();\n }\n return val;\n}, IdModelSchema);\n\nexport const ModelSchema = z.object({\n id: IdModelProcess,\n createdAt: TimestampOrNow,\n updatedAt: TimestampOrNow,\n order: z.coerce.number().nullish().optional()\n});\n\nexport const PreviousSchema = ModelSchema.extend({\n previous: z.lazy(() => ModelSchema.array().optional())\n})\n\nexport const EnabledSchema = z.object({\n enabled: z.boolean().optional()\n})\n\nexport type IdModel = z.infer<typeof IdModelSchema>;\nexport type Model = z.infer<typeof ModelSchema>;\nexport type Previous = z.infer<typeof PreviousSchema>;\nexport type Enabled = z.infer<typeof EnabledSchema>;\nexport type PartialWithId<T extends Model> = Partial<T> & {\n id: NonNullable<T['id']>\n}\n\n\n","import { Timestamp } from '@google-cloud/firestore';\nimport {z} from \"zod\";\n\nexport const TimestampOrNow = z\n .preprocess(\n (arg) => (arg === undefined ? Timestamp.now() : arg),\n z.custom<Timestamp>(),\n )\n .nullish().optional();\n","import {ModelSchema, PreviousSchema} from \"../model\";\nimport {z} from \"zod\";\nimport {TimestampOrNow} from \"./shared\";\n\nexport const PublishOnDate = ModelSchema.extend({\n publishOnDate: TimestampOrNow,\n unpublishOnDate: TimestampOrNow,\n published: z.boolean().default(false),\n})\n\nexport const JourneyButtonSchema = z.object({\n type: z.enum(['primary', 'warning', 'normal']),\n label: z.string(),\n link: z.string(),\n target: z.enum(['_blank', '_self']).default('_self'),\n})\n\nexport const PlanSchema = ModelSchema.extend({\n title: z.string(),\n description: z.string().optional(),\n enabled: z.boolean().default(true),\n price: z.number(),\n pixPrice: z.number(),\n portalPrice: z.number().optional(),\n pixPortalPrice: z.number().optional(),\n period: z.enum(['month', 'biannual', 'year']).default('month'),\n mode: z.enum(['payment', 'setup', 'subscription']),\n stripePrice: z.string(),\n stripePortalPrice: z.string(),\n})\n\nexport const JourneySchema = ModelSchema.extend({\n activitiesCounter: z.number(),\n lastNewsDate: TimestampOrNow,\n title: z.string(),\n type: z.enum(['simple', 'modular', 'free']),\n description: z.string().optional(),\n thumbnail: z.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: z.string().optional(),\n actionToUnlock: z.object({\n type: z.enum(['link', 'message']),\n content: z.string(),\n buttons: z.array(JourneyButtonSchema).optional()\n }).optional(),\n settings: z.object({\n info: z.object({\n thumbnail: z.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: z.string().optional(),\n actionToUnlock: z.object({\n type: z.enum(['link', 'message']),\n content: z.string(),\n buttons: z.array(JourneyButtonSchema).optional()\n }).optional(),\n }).optional(),\n chat: z.object({\n openingMessageDay: z.string().optional(),\n // closingMessageDay: z.string().optional(),\n // openingMessageNight: z.string().optional(),\n closingMessageNight: z.string().optional(),\n chatIsEnabled: z.boolean().default(false),\n chatURLs: z.array(z.string()).optional(),\n }).optional()\n }).optional(),\n stripeProductId: z.string().optional(),\n plans: z.array(PlanSchema).optional(),\n}).merge(PublishOnDate)\n\n\nexport const ModuleSchema = ModelSchema.extend({\n title: z.string(),\n isPrivate: z.boolean().default(true),\n rss: z.string().optional(),\n isExclusive: z.boolean().nullish().optional(),\n}).merge(PreviousSchema).merge(PublishOnDate)\n\nexport const JourneyContentTypeSchema = z.enum(['video', 'document', 'audio', 'text', 'soundcloud', 'youtube', 'form', 'live', 'file'])\n\nexport const ActivitySchema = ModelSchema.extend({\n title: z.string(),\n description: z.string().optional(),\n contentType: JourneyContentTypeSchema,\n content: z.string(),\n files: z.array(z.object({\n label: z.string().optional(),\n url: z.string()\n })).optional(),\n hideComments: z.boolean().default(false),\n showChat: z.boolean().default(false),\n reference: z.string().optional(),\n tagsStr: z.string().optional(),\n}).merge(PublishOnDate);\n\nexport const ModuleWithActivities = ModuleSchema.extend({\n activities: ActivitySchema.array()\n})\n\nexport type Module = z.infer<typeof ModuleSchema>\nexport type Journey = z.infer<typeof JourneySchema>\nexport type Plan = z.infer<typeof PlanSchema>\nexport type ModuleWithActivities = z.infer<typeof ModuleWithActivities>\nexport type Activity = z.infer<typeof ActivitySchema>\nexport type JourneyContentType = z.infer<typeof JourneyContentTypeSchema>\n"]}
|
|
1
|
+
{"version":3,"sources":["/Users/henriquewilson/Developer/Projects/gabirubi-domain/dist/model/journey.mjs","../../src/model.ts","../../src/model/shared.ts","../../src/model/journey.ts"],"names":["z","Timestamp","TimestampOrNow","preprocess","arg","now","custom","nullish","optional","cuid","generateFirestoreId","IdModelSchema","union","string","number","IdModelProcess","val","ModelSchema","object","id","createdAt","updatedAt","order","coerce","PreviousSchema","extend","previous","lazy","array","EnabledSchema","enabled","boolean","PublishOnDate","publishOnDate","unpublishOnDate","published","default","JourneyButtonSchema","type","enum","label","link","target","PlanSchema","title","description","price","pixPrice","portalPrice","pixPortalPrice","exStudentPrice","pixExStudentPrice","exStudentOf","period","mode","stripePrice","stripePortalPrice","JourneySchema","activitiesCounter","lastNewsDate","thumbnail","expirationDate","startDate","gridButton","tag","actionToUnlock","content","buttons","settings","info","chat","openingMessageDay","closingMessageNight","chatIsEnabled","chatURLs","stripeProductId","plans","merge","ModuleSchema","isPrivate","rss","isExclusive","JourneyContentTypeSchema","ActivitySchema","contentType","files","url","hideComments","showChat","reference","tagsStr","ModuleWithActivities","activities"],"mappings":"AAAA,eAAe;ACAf,SAAQA,KAAAA,EAAAA,QAAQ,MAAA;ADGhB,sBAAsB;AEHtB,SAASC,SAAA,QAAiB,0BAAA;AAC1B,SAAQD,CAAA,QAAQ,MAAA;AAET,IAAME,iBAAiBF,EAC3BG,UAAA,CACC,SAACC;WAASA,QAAQ,KAAA,IAAYH,UAAUI,GAAA,KAAQD;GAChDJ,EAAEM,MAAA,IAEHC,OAAA,GAAUC,QAAA;AFGb,eAAe;ACTf,OAAOC,UAAU,OAAA;AAEV,IAAMC,sBAAsB;IACjC,OAAOD;AACT;AAEO,IAAME,gBAAgBX,GAAEY,KAAA,CAAM;IAACZ,GAAEa,MAAA;IAAUb,GAAEc,MAAA;CAAS;AAE7D,IAAMC,iBAAiBf,GAAEG,UAAA,CAAW,SAACa;IACnC,IAAIA,QAAQ,KAAA,KAAaA,QAAQ,MAAM;QACrC,OAAON;IACT;IACA,OAAOM;AACT,GAAGL;AAEI,IAAMM,cAAcjB,GAAEkB,MAAA,CAAO;IAClCC,IAAIJ;IACJK,WAAWlB;IACXmB,WAAWnB;IACXoB,OAAOtB,GAAEuB,MAAA,CAAOT,MAAA,GAASP,OAAA,GAAUC,QAAA;AACrC;AAEO,IAAMgB,iBAAiBP,YAAYQ,MAAA,CAAO;IAC/CC,UAAU1B,GAAE2B,IAAA,CAAK;eAAMV,YAAYW,KAAA,GAAQpB,QAAA;;AAC7C;AAEO,IAAMqB,gBAAgB7B,GAAEkB,MAAA,CAAO;IACpCY,SAAS9B,GAAE+B,OAAA,GAAUvB,QAAA;AACvB;ADMA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EACZa,oBAAoB,EACpBhD,UAAU,EACVX,aAAa,GACb","sourcesContent":["// src/model.ts\nimport { z as z2 } from \"zod\";\n\n// src/model/shared.ts\nimport { Timestamp } from \"@google-cloud/firestore\";\nimport { z } from \"zod\";\nvar TimestampOrNow = z.preprocess(\n (arg) => arg === void 0 ? Timestamp.now() : arg,\n z.custom()\n).nullish().optional();\n\n// src/model.ts\nimport cuid from \"cuid\";\nvar generateFirestoreId = () => {\n return cuid();\n};\nvar IdModelSchema = z2.union([z2.string(), z2.number()]);\nvar IdModelProcess = z2.preprocess((val) => {\n if (val === void 0 || val === null) {\n return generateFirestoreId();\n }\n return val;\n}, IdModelSchema);\nvar ModelSchema = z2.object({\n id: IdModelProcess,\n createdAt: TimestampOrNow,\n updatedAt: TimestampOrNow,\n order: z2.coerce.number().nullish().optional()\n});\nvar PreviousSchema = ModelSchema.extend({\n previous: z2.lazy(() => ModelSchema.array().optional())\n});\nvar EnabledSchema = z2.object({\n enabled: z2.boolean().optional()\n});\n\n// src/model/journey.ts\nimport { z as z3 } from \"zod\";\nvar PublishOnDate = ModelSchema.extend({\n publishOnDate: TimestampOrNow,\n unpublishOnDate: TimestampOrNow,\n published: z3.boolean().default(false)\n});\nvar JourneyButtonSchema = z3.object({\n type: z3.enum([\"primary\", \"warning\", \"normal\"]),\n label: z3.string(),\n link: z3.string(),\n target: z3.enum([\"_blank\", \"_self\"]).default(\"_self\")\n});\nvar PlanSchema = ModelSchema.extend({\n title: z3.string(),\n description: z3.string().optional(),\n enabled: z3.boolean().default(true),\n price: z3.number(),\n pixPrice: z3.number(),\n portalPrice: z3.number().optional(),\n pixPortalPrice: z3.number().optional(),\n exStudentPrice: z3.number().optional(),\n pixExStudentPrice: z3.number().optional(),\n exStudentOf: z3.array(IdModelSchema).optional(),\n period: z3.enum([\"month\", \"biannual\", \"year\"]).default(\"month\"),\n mode: z3.enum([\"payment\", \"setup\", \"subscription\"]),\n stripePrice: z3.string(),\n stripePortalPrice: z3.string()\n});\nvar JourneySchema = ModelSchema.extend({\n activitiesCounter: z3.number(),\n lastNewsDate: TimestampOrNow,\n title: z3.string(),\n type: z3.enum([\"simple\", \"modular\", \"free\"]),\n description: z3.string().optional(),\n thumbnail: z3.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: z3.string().optional(),\n actionToUnlock: z3.object({\n type: z3.enum([\"link\", \"message\"]),\n content: z3.string(),\n buttons: z3.array(JourneyButtonSchema).optional()\n }).optional(),\n settings: z3.object({\n info: z3.object({\n thumbnail: z3.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: z3.string().optional(),\n actionToUnlock: z3.object({\n type: z3.enum([\"link\", \"message\"]),\n content: z3.string(),\n buttons: z3.array(JourneyButtonSchema).optional()\n }).optional()\n }).optional(),\n chat: z3.object({\n openingMessageDay: z3.string().optional(),\n // closingMessageDay: z.string().optional(),\n // openingMessageNight: z.string().optional(),\n closingMessageNight: z3.string().optional(),\n chatIsEnabled: z3.boolean().default(false),\n chatURLs: z3.array(z3.string()).optional()\n }).optional()\n }).optional(),\n stripeProductId: z3.string().optional(),\n plans: z3.array(PlanSchema).optional()\n}).merge(PublishOnDate);\nvar ModuleSchema = ModelSchema.extend({\n title: z3.string(),\n isPrivate: z3.boolean().default(true),\n rss: z3.string().optional(),\n isExclusive: z3.boolean().nullish().optional()\n}).merge(PreviousSchema).merge(PublishOnDate);\nvar JourneyContentTypeSchema = z3.enum([\"video\", \"document\", \"audio\", \"text\", \"soundcloud\", \"youtube\", \"form\", \"live\", \"file\"]);\nvar ActivitySchema = ModelSchema.extend({\n title: z3.string(),\n description: z3.string().optional(),\n contentType: JourneyContentTypeSchema,\n content: z3.string(),\n files: z3.array(z3.object({\n label: z3.string().optional(),\n url: z3.string()\n })).optional(),\n hideComments: z3.boolean().default(false),\n showChat: z3.boolean().default(false),\n reference: z3.string().optional(),\n tagsStr: z3.string().optional()\n}).merge(PublishOnDate);\nvar ModuleWithActivities = ModuleSchema.extend({\n activities: ActivitySchema.array()\n});\nexport {\n ActivitySchema,\n JourneyButtonSchema,\n JourneyContentTypeSchema,\n JourneySchema,\n ModuleSchema,\n ModuleWithActivities,\n PlanSchema,\n PublishOnDate\n};\n","import {z} from \"zod\";\nimport {TimestampOrNow} from \"./model/shared\";\nimport cuid from 'cuid';\n\nexport const generateFirestoreId = () => {\n return cuid();\n}\n\nexport const IdModelSchema = z.union([z.string(), z.number()])\n\nconst IdModelProcess = z.preprocess((val) => {\n if (val === undefined || val === null) {\n return generateFirestoreId();\n }\n return val;\n}, IdModelSchema);\n\nexport const ModelSchema = z.object({\n id: IdModelProcess,\n createdAt: TimestampOrNow,\n updatedAt: TimestampOrNow,\n order: z.coerce.number().nullish().optional()\n});\n\nexport const PreviousSchema = ModelSchema.extend({\n previous: z.lazy(() => ModelSchema.array().optional())\n})\n\nexport const EnabledSchema = z.object({\n enabled: z.boolean().optional()\n})\n\nexport type IdModel = z.infer<typeof IdModelSchema>;\nexport type Model = z.infer<typeof ModelSchema>;\nexport type Previous = z.infer<typeof PreviousSchema>;\nexport type Enabled = z.infer<typeof EnabledSchema>;\nexport type PartialWithId<T extends Model> = Partial<T> & {\n id: NonNullable<T['id']>\n}\n\n\n","import { Timestamp } from '@google-cloud/firestore';\nimport {z} from \"zod\";\n\nexport const TimestampOrNow = z\n .preprocess(\n (arg) => (arg === undefined ? Timestamp.now() : arg),\n z.custom<Timestamp>(),\n )\n .nullish().optional();\n","import {IdModelSchema, ModelSchema, PreviousSchema} from \"../model\";\nimport {z} from \"zod\";\nimport {TimestampOrNow} from \"./shared\";\n\nexport const PublishOnDate = ModelSchema.extend({\n publishOnDate: TimestampOrNow,\n unpublishOnDate: TimestampOrNow,\n published: z.boolean().default(false),\n})\n\nexport const JourneyButtonSchema = z.object({\n type: z.enum(['primary', 'warning', 'normal']),\n label: z.string(),\n link: z.string(),\n target: z.enum(['_blank', '_self']).default('_self'),\n})\n\nexport const PlanSchema = ModelSchema.extend({\n title: z.string(),\n description: z.string().optional(),\n enabled: z.boolean().default(true),\n price: z.number(),\n pixPrice: z.number(),\n portalPrice: z.number().optional(),\n pixPortalPrice: z.number().optional(),\n exStudentPrice: z.number().optional(),\n pixExStudentPrice: z.number().optional(),\n exStudentOf: z.array(IdModelSchema).optional(),\n period: z.enum(['month', 'biannual', 'year']).default('month'),\n mode: z.enum(['payment', 'setup', 'subscription']),\n stripePrice: z.string(),\n stripePortalPrice: z.string(),\n})\n\nexport const JourneySchema = ModelSchema.extend({\n activitiesCounter: z.number(),\n lastNewsDate: TimestampOrNow,\n title: z.string(),\n type: z.enum(['simple', 'modular', 'free']),\n description: z.string().optional(),\n thumbnail: z.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: z.string().optional(),\n actionToUnlock: z.object({\n type: z.enum(['link', 'message']),\n content: z.string(),\n buttons: z.array(JourneyButtonSchema).optional()\n }).optional(),\n settings: z.object({\n info: z.object({\n thumbnail: z.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: z.string().optional(),\n actionToUnlock: z.object({\n type: z.enum(['link', 'message']),\n content: z.string(),\n buttons: z.array(JourneyButtonSchema).optional()\n }).optional(),\n }).optional(),\n chat: z.object({\n openingMessageDay: z.string().optional(),\n // closingMessageDay: z.string().optional(),\n // openingMessageNight: z.string().optional(),\n closingMessageNight: z.string().optional(),\n chatIsEnabled: z.boolean().default(false),\n chatURLs: z.array(z.string()).optional(),\n }).optional()\n }).optional(),\n stripeProductId: z.string().optional(),\n plans: z.array(PlanSchema).optional(),\n}).merge(PublishOnDate)\n\n\nexport const ModuleSchema = ModelSchema.extend({\n title: z.string(),\n isPrivate: z.boolean().default(true),\n rss: z.string().optional(),\n isExclusive: z.boolean().nullish().optional(),\n}).merge(PreviousSchema).merge(PublishOnDate)\n\nexport const JourneyContentTypeSchema = z.enum(['video', 'document', 'audio', 'text', 'soundcloud', 'youtube', 'form', 'live', 'file'])\n\nexport const ActivitySchema = ModelSchema.extend({\n title: z.string(),\n description: z.string().optional(),\n contentType: JourneyContentTypeSchema,\n content: z.string(),\n files: z.array(z.object({\n label: z.string().optional(),\n url: z.string()\n })).optional(),\n hideComments: z.boolean().default(false),\n showChat: z.boolean().default(false),\n reference: z.string().optional(),\n tagsStr: z.string().optional(),\n}).merge(PublishOnDate);\n\nexport const ModuleWithActivities = ModuleSchema.extend({\n activities: ActivitySchema.array()\n})\n\nexport type Module = z.infer<typeof ModuleSchema>\nexport type Journey = z.infer<typeof JourneySchema>\nexport type Plan = z.infer<typeof PlanSchema>\nexport type ModuleWithActivities = z.infer<typeof ModuleWithActivities>\nexport type Activity = z.infer<typeof ActivitySchema>\nexport type JourneyContentType = z.infer<typeof JourneyContentTypeSchema>\n"]}
|
|
@@ -1641,10 +1641,10 @@ declare const SubscriptionSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
1641
1641
|
createdAt?: Timestamp | null | undefined;
|
|
1642
1642
|
updatedAt?: Timestamp | null | undefined;
|
|
1643
1643
|
order?: number | null | undefined;
|
|
1644
|
-
email?: string | undefined;
|
|
1645
|
-
name?: string | undefined;
|
|
1646
1644
|
enabled?: boolean | undefined;
|
|
1647
1645
|
lastNewsDate?: Timestamp | null | undefined;
|
|
1646
|
+
email?: string | undefined;
|
|
1647
|
+
name?: string | undefined;
|
|
1648
1648
|
password?: string | undefined;
|
|
1649
1649
|
phone?: string | undefined;
|
|
1650
1650
|
userHash?: string | null | undefined;
|
|
@@ -1661,10 +1661,10 @@ declare const SubscriptionSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
1661
1661
|
createdAt?: unknown;
|
|
1662
1662
|
updatedAt?: unknown;
|
|
1663
1663
|
order?: number | null | undefined;
|
|
1664
|
-
email?: string | undefined;
|
|
1665
|
-
name?: string | undefined;
|
|
1666
1664
|
enabled?: boolean | undefined;
|
|
1667
1665
|
lastNewsDate?: unknown;
|
|
1666
|
+
email?: string | undefined;
|
|
1667
|
+
name?: string | undefined;
|
|
1668
1668
|
password?: string | undefined;
|
|
1669
1669
|
phone?: string | undefined;
|
|
1670
1670
|
userHash?: string | null | undefined;
|
|
@@ -1696,10 +1696,10 @@ declare const SubscriptionSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
1696
1696
|
createdAt?: Timestamp | null | undefined;
|
|
1697
1697
|
updatedAt?: Timestamp | null | undefined;
|
|
1698
1698
|
order?: number | null | undefined;
|
|
1699
|
-
email?: string | undefined;
|
|
1700
|
-
name?: string | undefined;
|
|
1701
1699
|
enabled?: boolean | undefined;
|
|
1702
1700
|
lastNewsDate?: Timestamp | null | undefined;
|
|
1701
|
+
email?: string | undefined;
|
|
1702
|
+
name?: string | undefined;
|
|
1703
1703
|
password?: string | undefined;
|
|
1704
1704
|
phone?: string | undefined;
|
|
1705
1705
|
userHash?: string | null | undefined;
|
|
@@ -2193,10 +2193,10 @@ declare const SubscriptionSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
2193
2193
|
createdAt?: unknown;
|
|
2194
2194
|
updatedAt?: unknown;
|
|
2195
2195
|
order?: number | null | undefined;
|
|
2196
|
-
email?: string | undefined;
|
|
2197
|
-
name?: string | undefined;
|
|
2198
2196
|
enabled?: boolean | undefined;
|
|
2199
2197
|
lastNewsDate?: unknown;
|
|
2198
|
+
email?: string | undefined;
|
|
2199
|
+
name?: string | undefined;
|
|
2200
2200
|
password?: string | undefined;
|
|
2201
2201
|
phone?: string | undefined;
|
|
2202
2202
|
userHash?: string | null | undefined;
|
|
@@ -1641,10 +1641,10 @@ declare const SubscriptionSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
1641
1641
|
createdAt?: Timestamp | null | undefined;
|
|
1642
1642
|
updatedAt?: Timestamp | null | undefined;
|
|
1643
1643
|
order?: number | null | undefined;
|
|
1644
|
-
email?: string | undefined;
|
|
1645
|
-
name?: string | undefined;
|
|
1646
1644
|
enabled?: boolean | undefined;
|
|
1647
1645
|
lastNewsDate?: Timestamp | null | undefined;
|
|
1646
|
+
email?: string | undefined;
|
|
1647
|
+
name?: string | undefined;
|
|
1648
1648
|
password?: string | undefined;
|
|
1649
1649
|
phone?: string | undefined;
|
|
1650
1650
|
userHash?: string | null | undefined;
|
|
@@ -1661,10 +1661,10 @@ declare const SubscriptionSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
1661
1661
|
createdAt?: unknown;
|
|
1662
1662
|
updatedAt?: unknown;
|
|
1663
1663
|
order?: number | null | undefined;
|
|
1664
|
-
email?: string | undefined;
|
|
1665
|
-
name?: string | undefined;
|
|
1666
1664
|
enabled?: boolean | undefined;
|
|
1667
1665
|
lastNewsDate?: unknown;
|
|
1666
|
+
email?: string | undefined;
|
|
1667
|
+
name?: string | undefined;
|
|
1668
1668
|
password?: string | undefined;
|
|
1669
1669
|
phone?: string | undefined;
|
|
1670
1670
|
userHash?: string | null | undefined;
|
|
@@ -1696,10 +1696,10 @@ declare const SubscriptionSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
1696
1696
|
createdAt?: Timestamp | null | undefined;
|
|
1697
1697
|
updatedAt?: Timestamp | null | undefined;
|
|
1698
1698
|
order?: number | null | undefined;
|
|
1699
|
-
email?: string | undefined;
|
|
1700
|
-
name?: string | undefined;
|
|
1701
1699
|
enabled?: boolean | undefined;
|
|
1702
1700
|
lastNewsDate?: Timestamp | null | undefined;
|
|
1701
|
+
email?: string | undefined;
|
|
1702
|
+
name?: string | undefined;
|
|
1703
1703
|
password?: string | undefined;
|
|
1704
1704
|
phone?: string | undefined;
|
|
1705
1705
|
userHash?: string | null | undefined;
|
|
@@ -2193,10 +2193,10 @@ declare const SubscriptionSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
2193
2193
|
createdAt?: unknown;
|
|
2194
2194
|
updatedAt?: unknown;
|
|
2195
2195
|
order?: number | null | undefined;
|
|
2196
|
-
email?: string | undefined;
|
|
2197
|
-
name?: string | undefined;
|
|
2198
2196
|
enabled?: boolean | undefined;
|
|
2199
2197
|
lastNewsDate?: unknown;
|
|
2198
|
+
email?: string | undefined;
|
|
2199
|
+
name?: string | undefined;
|
|
2200
2200
|
password?: string | undefined;
|
|
2201
2201
|
phone?: string | undefined;
|
|
2202
2202
|
userHash?: string | null | undefined;
|
|
@@ -31,9 +31,9 @@ declare const UserSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.exte
|
|
|
31
31
|
createdAt?: Timestamp | null | undefined;
|
|
32
32
|
updatedAt?: Timestamp | null | undefined;
|
|
33
33
|
order?: number | null | undefined;
|
|
34
|
-
name?: string | undefined;
|
|
35
34
|
enabled?: boolean | undefined;
|
|
36
35
|
lastNewsDate?: Timestamp | null | undefined;
|
|
36
|
+
name?: string | undefined;
|
|
37
37
|
password?: string | undefined;
|
|
38
38
|
phone?: string | undefined;
|
|
39
39
|
userHash?: string | null | undefined;
|
|
@@ -51,9 +51,9 @@ declare const UserSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.exte
|
|
|
51
51
|
createdAt?: unknown;
|
|
52
52
|
updatedAt?: unknown;
|
|
53
53
|
order?: number | null | undefined;
|
|
54
|
-
name?: string | undefined;
|
|
55
54
|
enabled?: boolean | undefined;
|
|
56
55
|
lastNewsDate?: unknown;
|
|
56
|
+
name?: string | undefined;
|
|
57
57
|
password?: string | undefined;
|
|
58
58
|
phone?: string | undefined;
|
|
59
59
|
userHash?: string | null | undefined;
|
|
@@ -31,9 +31,9 @@ declare const UserSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.exte
|
|
|
31
31
|
createdAt?: Timestamp | null | undefined;
|
|
32
32
|
updatedAt?: Timestamp | null | undefined;
|
|
33
33
|
order?: number | null | undefined;
|
|
34
|
-
name?: string | undefined;
|
|
35
34
|
enabled?: boolean | undefined;
|
|
36
35
|
lastNewsDate?: Timestamp | null | undefined;
|
|
36
|
+
name?: string | undefined;
|
|
37
37
|
password?: string | undefined;
|
|
38
38
|
phone?: string | undefined;
|
|
39
39
|
userHash?: string | null | undefined;
|
|
@@ -51,9 +51,9 @@ declare const UserSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.exte
|
|
|
51
51
|
createdAt?: unknown;
|
|
52
52
|
updatedAt?: unknown;
|
|
53
53
|
order?: number | null | undefined;
|
|
54
|
-
name?: string | undefined;
|
|
55
54
|
enabled?: boolean | undefined;
|
|
56
55
|
lastNewsDate?: unknown;
|
|
56
|
+
name?: string | undefined;
|
|
57
57
|
password?: string | undefined;
|
|
58
58
|
phone?: string | undefined;
|
|
59
59
|
userHash?: string | null | undefined;
|
|
@@ -113,6 +113,9 @@ var PlanSchema = ModelSchema.extend({
|
|
|
113
113
|
pixPrice: import_zod3.z.number(),
|
|
114
114
|
portalPrice: import_zod3.z.number().optional(),
|
|
115
115
|
pixPortalPrice: import_zod3.z.number().optional(),
|
|
116
|
+
exStudentPrice: import_zod3.z.number().optional(),
|
|
117
|
+
pixExStudentPrice: import_zod3.z.number().optional(),
|
|
118
|
+
exStudentOf: import_zod3.z.array(IdModelSchema).optional(),
|
|
116
119
|
period: import_zod3.z.enum([
|
|
117
120
|
"month",
|
|
118
121
|
"biannual",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/henriquewilson/Developer/Projects/gabirubi-domain/dist/test/activity.test.js","../../src/test/activity.test.ts","../../src/model.ts","../../src/model/shared.ts","../../src/model/journey.ts"],"names":["__create","Object","create","__defProp","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__getProtoOf","getPrototypeOf","__hasOwnProp","prototype","hasOwnProperty","__copyProps","to","from","except","desc","key","call","get","enumerable","__toESM","mod","isNodeMode","target","__esModule","value","import_globals","require","import_zod","import_firestore","TimestampOrNow","z","preprocess","arg","Timestamp","now","custom","nullish","optional","import_cuid","generateFirestoreId","cuid","IdModelSchema","import_zod2","union","string","number","IdModelProcess","val","ModelSchema","object","id","createdAt","updatedAt","order","coerce","PreviousSchema","extend","previous","lazy","array","EnabledSchema","enabled","boolean","PublishOnDate","publishOnDate","unpublishOnDate","published","import_zod3","default","JourneyButtonSchema","type","enum","label","link","PlanSchema","title","description","price","pixPrice","portalPrice","pixPortalPrice","period","mode","stripePrice","stripePortalPrice","JourneySchema","activitiesCounter","lastNewsDate","thumbnail","expirationDate","startDate","gridButton","tag","actionToUnlock","content","buttons","settings","info","chat","openingMessageDay","closingMessageNight","chatIsEnabled","chatURLs","stripeProductId","plans","merge","ModuleSchema","isPrivate","rss","isExclusive","JourneyContentTypeSchema","ActivitySchema","contentType","files","url","hideComments","showChat","reference","tagsStr","ModuleWithActivities","activities","describe","test","a","activity","parse","expect","toBeDefined"],"mappings":"AAAA;AACA,IAAIA,WAAWC,OAAOC,MAAM;AAC5B,IAAIC,YAAYF,OAAOG,cAAc;AACrC,IAAIC,mBAAmBJ,OAAOK,wBAAwB;AACtD,IAAIC,oBAAoBN,OAAOO,mBAAmB;AAClD,IAAIC,eAAeR,OAAOS,cAAc;AACxC,IAAIC,eAAeV,OAAOW,SAAS,CAACC,cAAc;AAClD,IAAIC,cAAc,SAACC,IAAIC,MAAMC,QAAQC;IACnC,IAAIF,QAAQ,OAAOA,SAAS,YAAY,OAAOA,SAAS,YAAY;YAC7D,kCAAA,2BAAA;;;gBAAA,IAAIG,MAAJ;gBACH,IAAI,CAACR,aAAaS,IAAI,CAACL,IAAII,QAAQA,QAAQF,QACzCd,UAAUY,IAAII,KAAK;oBAAEE,KAAK;+BAAML,IAAI,CAACG,IAAI;;oBAAEG,YAAY,CAAEJ,CAAAA,OAAOb,iBAAiBW,MAAMG,IAAG,KAAMD,KAAKI,UAAU;gBAAC;;YAFpH,QAAK,YAAWf,kBAAkBS,0BAA7B,SAAA,6BAAA,QAAA,yBAAA;;YAAA;YAAA;;;qBAAA,6BAAA;oBAAA;;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nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\n\n// src/test/activity.test.ts\nvar import_globals = require(\"@jest/globals\");\n\n// src/model.ts\nvar import_zod2 = require(\"zod\");\n\n// src/model/shared.ts\nvar import_firestore = require(\"@google-cloud/firestore\");\nvar import_zod = require(\"zod\");\nvar TimestampOrNow = import_zod.z.preprocess(\n (arg) => arg === void 0 ? import_firestore.Timestamp.now() : arg,\n import_zod.z.custom()\n).nullish().optional();\n\n// src/model.ts\nvar import_cuid = __toESM(require(\"cuid\"));\nvar generateFirestoreId = () => {\n return (0, import_cuid.default)();\n};\nvar IdModelSchema = import_zod2.z.union([import_zod2.z.string(), import_zod2.z.number()]);\nvar IdModelProcess = import_zod2.z.preprocess((val) => {\n if (val === void 0 || val === null) {\n return generateFirestoreId();\n }\n return val;\n}, IdModelSchema);\nvar ModelSchema = import_zod2.z.object({\n id: IdModelProcess,\n createdAt: TimestampOrNow,\n updatedAt: TimestampOrNow,\n order: import_zod2.z.coerce.number().nullish().optional()\n});\nvar PreviousSchema = ModelSchema.extend({\n previous: import_zod2.z.lazy(() => ModelSchema.array().optional())\n});\nvar EnabledSchema = import_zod2.z.object({\n enabled: import_zod2.z.boolean().optional()\n});\n\n// src/model/journey.ts\nvar import_zod3 = require(\"zod\");\nvar PublishOnDate = ModelSchema.extend({\n publishOnDate: TimestampOrNow,\n unpublishOnDate: TimestampOrNow,\n published: import_zod3.z.boolean().default(false)\n});\nvar JourneyButtonSchema = import_zod3.z.object({\n type: import_zod3.z.enum([\"primary\", \"warning\", \"normal\"]),\n label: import_zod3.z.string(),\n link: import_zod3.z.string(),\n target: import_zod3.z.enum([\"_blank\", \"_self\"]).default(\"_self\")\n});\nvar PlanSchema = ModelSchema.extend({\n title: import_zod3.z.string(),\n description: import_zod3.z.string().optional(),\n enabled: import_zod3.z.boolean().default(true),\n price: import_zod3.z.number(),\n pixPrice: import_zod3.z.number(),\n portalPrice: import_zod3.z.number().optional(),\n pixPortalPrice: import_zod3.z.number().optional(),\n period: import_zod3.z.enum([\"month\", \"biannual\", \"year\"]).default(\"month\"),\n mode: import_zod3.z.enum([\"payment\", \"setup\", \"subscription\"]),\n stripePrice: import_zod3.z.string(),\n stripePortalPrice: import_zod3.z.string()\n});\nvar JourneySchema = ModelSchema.extend({\n activitiesCounter: import_zod3.z.number(),\n lastNewsDate: TimestampOrNow,\n title: import_zod3.z.string(),\n type: import_zod3.z.enum([\"simple\", \"modular\", \"free\"]),\n description: import_zod3.z.string().optional(),\n thumbnail: import_zod3.z.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: import_zod3.z.string().optional(),\n actionToUnlock: import_zod3.z.object({\n type: import_zod3.z.enum([\"link\", \"message\"]),\n content: import_zod3.z.string(),\n buttons: import_zod3.z.array(JourneyButtonSchema).optional()\n }).optional(),\n settings: import_zod3.z.object({\n info: import_zod3.z.object({\n thumbnail: import_zod3.z.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: import_zod3.z.string().optional(),\n actionToUnlock: import_zod3.z.object({\n type: import_zod3.z.enum([\"link\", \"message\"]),\n content: import_zod3.z.string(),\n buttons: import_zod3.z.array(JourneyButtonSchema).optional()\n }).optional()\n }).optional(),\n chat: import_zod3.z.object({\n openingMessageDay: import_zod3.z.string().optional(),\n // closingMessageDay: z.string().optional(),\n // openingMessageNight: z.string().optional(),\n closingMessageNight: import_zod3.z.string().optional(),\n chatIsEnabled: import_zod3.z.boolean().default(false),\n chatURLs: import_zod3.z.array(import_zod3.z.string()).optional()\n }).optional()\n }).optional(),\n stripeProductId: import_zod3.z.string().optional(),\n plans: import_zod3.z.array(PlanSchema).optional()\n}).merge(PublishOnDate);\nvar ModuleSchema = ModelSchema.extend({\n title: import_zod3.z.string(),\n isPrivate: import_zod3.z.boolean().default(true),\n rss: import_zod3.z.string().optional(),\n isExclusive: import_zod3.z.boolean().nullish().optional()\n}).merge(PreviousSchema).merge(PublishOnDate);\nvar JourneyContentTypeSchema = import_zod3.z.enum([\"video\", \"document\", \"audio\", \"text\", \"soundcloud\", \"youtube\", \"form\", \"live\", \"file\"]);\nvar ActivitySchema = ModelSchema.extend({\n title: import_zod3.z.string(),\n description: import_zod3.z.string().optional(),\n contentType: JourneyContentTypeSchema,\n content: import_zod3.z.string(),\n files: import_zod3.z.array(import_zod3.z.object({\n label: import_zod3.z.string().optional(),\n url: import_zod3.z.string()\n })).optional(),\n hideComments: import_zod3.z.boolean().default(false),\n showChat: import_zod3.z.boolean().default(false),\n reference: import_zod3.z.string().optional(),\n tagsStr: import_zod3.z.string().optional()\n}).merge(PublishOnDate);\nvar ModuleWithActivities = ModuleSchema.extend({\n activities: ActivitySchema.array()\n});\n\n// src/test/activity.test.ts\n(0, import_globals.describe)(\"test activity\", () => {\n (0, import_globals.test)(\"test activity structure\", () => {\n const a = {\n title: \"\",\n contentType: \"video\",\n content: \"\"\n };\n const activity = ActivitySchema.parse(a);\n (0, import_globals.expect)(a).toBeDefined();\n (0, import_globals.expect)(activity).toBeDefined();\n });\n});\n","import {describe, expect, test} from '@jest/globals';\nimport {ActivitySchema} from \"../model/journey\";\n\ndescribe('test activity', () => {\n test('test activity structure', () => {\n\n const a = {\n title: '',\n contentType: 'video',\n content: '',\n }\n\n const activity = ActivitySchema.parse(a)\n expect(a).toBeDefined();\n expect(activity).toBeDefined();\n });\n});\n","import {z} from \"zod\";\nimport {TimestampOrNow} from \"./model/shared\";\nimport cuid from 'cuid';\n\nexport const generateFirestoreId = () => {\n return cuid();\n}\n\nexport const IdModelSchema = z.union([z.string(), z.number()])\n\nconst IdModelProcess = z.preprocess((val) => {\n if (val === undefined || val === null) {\n return generateFirestoreId();\n }\n return val;\n}, IdModelSchema);\n\nexport const ModelSchema = z.object({\n id: IdModelProcess,\n createdAt: TimestampOrNow,\n updatedAt: TimestampOrNow,\n order: z.coerce.number().nullish().optional()\n});\n\nexport const PreviousSchema = ModelSchema.extend({\n previous: z.lazy(() => ModelSchema.array().optional())\n})\n\nexport const EnabledSchema = z.object({\n enabled: z.boolean().optional()\n})\n\nexport type IdModel = z.infer<typeof IdModelSchema>;\nexport type Model = z.infer<typeof ModelSchema>;\nexport type Previous = z.infer<typeof PreviousSchema>;\nexport type Enabled = z.infer<typeof EnabledSchema>;\nexport type PartialWithId<T extends Model> = Partial<T> & {\n id: NonNullable<T['id']>\n}\n\n\n","import { Timestamp } from '@google-cloud/firestore';\nimport {z} from \"zod\";\n\nexport const TimestampOrNow = z\n .preprocess(\n (arg) => (arg === undefined ? Timestamp.now() : arg),\n z.custom<Timestamp>(),\n )\n .nullish().optional();\n","import {ModelSchema, PreviousSchema} from \"../model\";\nimport {z} from \"zod\";\nimport {TimestampOrNow} from \"./shared\";\n\nexport const PublishOnDate = ModelSchema.extend({\n publishOnDate: TimestampOrNow,\n unpublishOnDate: TimestampOrNow,\n published: z.boolean().default(false),\n})\n\nexport const JourneyButtonSchema = z.object({\n type: z.enum(['primary', 'warning', 'normal']),\n label: z.string(),\n link: z.string(),\n target: z.enum(['_blank', '_self']).default('_self'),\n})\n\nexport const PlanSchema = ModelSchema.extend({\n title: z.string(),\n description: z.string().optional(),\n enabled: z.boolean().default(true),\n price: z.number(),\n pixPrice: z.number(),\n portalPrice: z.number().optional(),\n pixPortalPrice: z.number().optional(),\n period: z.enum(['month', 'biannual', 'year']).default('month'),\n mode: z.enum(['payment', 'setup', 'subscription']),\n stripePrice: z.string(),\n stripePortalPrice: z.string(),\n})\n\nexport const JourneySchema = ModelSchema.extend({\n activitiesCounter: z.number(),\n lastNewsDate: TimestampOrNow,\n title: z.string(),\n type: z.enum(['simple', 'modular', 'free']),\n description: z.string().optional(),\n thumbnail: z.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: z.string().optional(),\n actionToUnlock: z.object({\n type: z.enum(['link', 'message']),\n content: z.string(),\n buttons: z.array(JourneyButtonSchema).optional()\n }).optional(),\n settings: z.object({\n info: z.object({\n thumbnail: z.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: z.string().optional(),\n actionToUnlock: z.object({\n type: z.enum(['link', 'message']),\n content: z.string(),\n buttons: z.array(JourneyButtonSchema).optional()\n }).optional(),\n }).optional(),\n chat: z.object({\n openingMessageDay: z.string().optional(),\n // closingMessageDay: z.string().optional(),\n // openingMessageNight: z.string().optional(),\n closingMessageNight: z.string().optional(),\n chatIsEnabled: z.boolean().default(false),\n chatURLs: z.array(z.string()).optional(),\n }).optional()\n }).optional(),\n stripeProductId: z.string().optional(),\n plans: z.array(PlanSchema).optional(),\n}).merge(PublishOnDate)\n\n\nexport const ModuleSchema = ModelSchema.extend({\n title: z.string(),\n isPrivate: z.boolean().default(true),\n rss: z.string().optional(),\n isExclusive: z.boolean().nullish().optional(),\n}).merge(PreviousSchema).merge(PublishOnDate)\n\nexport const JourneyContentTypeSchema = z.enum(['video', 'document', 'audio', 'text', 'soundcloud', 'youtube', 'form', 'live', 'file'])\n\nexport const ActivitySchema = ModelSchema.extend({\n title: z.string(),\n description: z.string().optional(),\n contentType: JourneyContentTypeSchema,\n content: z.string(),\n files: z.array(z.object({\n label: z.string().optional(),\n url: z.string()\n })).optional(),\n hideComments: z.boolean().default(false),\n showChat: z.boolean().default(false),\n reference: z.string().optional(),\n tagsStr: z.string().optional(),\n}).merge(PublishOnDate);\n\nexport const ModuleWithActivities = ModuleSchema.extend({\n activities: ActivitySchema.array()\n})\n\nexport type Module = z.infer<typeof ModuleSchema>\nexport type Journey = z.infer<typeof JourneySchema>\nexport type Plan = z.infer<typeof PlanSchema>\nexport type ModuleWithActivities = z.infer<typeof ModuleWithActivities>\nexport type Activity = z.infer<typeof ActivitySchema>\nexport type JourneyContentType = z.infer<typeof JourneyContentTypeSchema>\n"]}
|
|
1
|
+
{"version":3,"sources":["/Users/henriquewilson/Developer/Projects/gabirubi-domain/dist/test/activity.test.js","../../src/test/activity.test.ts","../../src/model.ts","../../src/model/shared.ts","../../src/model/journey.ts"],"names":["__create","Object","create","__defProp","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__getProtoOf","getPrototypeOf","__hasOwnProp","prototype","hasOwnProperty","__copyProps","to","from","except","desc","key","call","get","enumerable","__toESM","mod","isNodeMode","target","__esModule","value","import_globals","require","import_zod","import_firestore","TimestampOrNow","z","preprocess","arg","Timestamp","now","custom","nullish","optional","import_cuid","generateFirestoreId","cuid","IdModelSchema","import_zod2","union","string","number","IdModelProcess","val","ModelSchema","object","id","createdAt","updatedAt","order","coerce","PreviousSchema","extend","previous","lazy","array","EnabledSchema","enabled","boolean","PublishOnDate","publishOnDate","unpublishOnDate","published","import_zod3","default","JourneyButtonSchema","type","enum","label","link","PlanSchema","title","description","price","pixPrice","portalPrice","pixPortalPrice","exStudentPrice","pixExStudentPrice","exStudentOf","period","mode","stripePrice","stripePortalPrice","JourneySchema","activitiesCounter","lastNewsDate","thumbnail","expirationDate","startDate","gridButton","tag","actionToUnlock","content","buttons","settings","info","chat","openingMessageDay","closingMessageNight","chatIsEnabled","chatURLs","stripeProductId","plans","merge","ModuleSchema","isPrivate","rss","isExclusive","JourneyContentTypeSchema","ActivitySchema","contentType","files","url","hideComments","showChat","reference","tagsStr","ModuleWithActivities","activities","describe","test","a","activity","parse","expect","toBeDefined"],"mappings":"AAAA;AACA,IAAIA,WAAWC,OAAOC,MAAM;AAC5B,IAAIC,YAAYF,OAAOG,cAAc;AACrC,IAAIC,mBAAmBJ,OAAOK,wBAAwB;AACtD,IAAIC,oBAAoBN,OAAOO,mBAAmB;AAClD,IAAIC,eAAeR,OAAOS,cAAc;AACxC,IAAIC,eAAeV,OAAOW,SAAS,CAACC,cAAc;AAClD,IAAIC,cAAc,SAACC,IAAIC,MAAMC,QAAQC;IACnC,IAAIF,QAAQ,OAAOA,SAAS,YAAY,OAAOA,SAAS,YAAY;YAC7D,kCAAA,2BAAA;;;gBAAA,IAAIG,MAAJ;gBACH,IAAI,CAACR,aAAaS,IAAI,CAACL,IAAII,QAAQA,QAAQF,QACzCd,UAAUY,IAAII,KAAK;oBAAEE,KAAK;+BAAML,IAAI,CAACG,IAAI;;oBAAEG,YAAY,CAAEJ,CAAAA,OAAOb,iBAAiBW,MAAMG,IAAG,KAAMD,KAAKI,UAAU;gBAAC;;YAFpH,QAAK,YAAWf,kBAAkBS,0BAA7B,SAAA,6BAAA,QAAA,yBAAA;;YAAA;YAAA;;;qBAAA,6BAAA;oBAAA;;;oBAAA;0BAAA;;;;IAGP;IACA,OAAOD;AACT;AACA,IAAIQ,UAAU,SAACC,KAAKC,YAAYC;WAAYA,SAASF,OAAO,OAAOxB,SAASS,aAAae,QAAQ,CAAC,GAAGV,YACnG,sEAAsE;IACtE,iEAAiE;IACjE,sEAAsE;IACtE,qEAAqE;IACrEW,cAAc,CAACD,OAAO,CAACA,IAAIG,UAAU,GAAGxB,UAAUuB,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Q;CAAO;AAE/H,IAAM2C,iBAAiBlE,YAAYQ,MAAA,CAAO;IAC/CmB,OAAOR,YAAArC,CAAA,CAAEc,MAAA;IACTgC,aAAaT,YAAArC,CAAA,CAAEc,MAAA,GAASP,QAAA;IACxB8E,aAAaF;IACbhB,SAAS9B,YAAArC,CAAA,CAAEc,MAAA;IACXwE,OAAOjD,YAAArC,CAAA,CAAE6B,KAAA,CAAMQ,YAAArC,CAAA,CAAEmB,MAAA,CAAO;QACtBuB,OAAOL,YAAArC,CAAA,CAAEc,MAAA,GAASP,QAAA;QAClBgF,KAAKlD,YAAArC,CAAA,CAAEc,MAAA;IACT,IAAIP,QAAA;IACJiF,cAAcnD,YAAArC,CAAA,CAAEgC,OAAA,GAAUM,OAAA,CAAQ;IAClCmD,UAAUpD,YAAArC,CAAA,CAAEgC,OAAA,GAAUM,OAAA,CAAQ;IAC9BoD,WAAWrD,YAAArC,CAAA,CAAEc,MAAA,GAASP,QAAA;IACtBoF,SAAStD,YAAArC,CAAA,CAAEc,MAAA,GAASP,QAAA;AACtB,GAAGuE,KAAA,CAAM7C;AAEF,IAAM2D,uBAAuBb,aAAarD,MAAA,CAAO;IACtDmE,YAAYT,eAAevD,KAAA;AAC7B;AJuDA,4BAA4B;AAC3B,CAAA,GC5JDlC,eAAAmG,QAAA,EAAS,iBAAiB;IACxB,CAAA,GAAAnG,eAAAoG,IAAA,EAAK,2BAA2B;QAE9B,IAAMC,IAAI;YACRnD,OAAO;YACPwC,aAAa;YACblB,SAAS;QACX;QAEA,IAAM8B,WAAWb,eAAec,KAAA,CAAMF;QACtC,CAAA,GAAArG,eAAAwG,MAAA,EAAOH,GAAGI,WAAA;QACV,CAAA,GAAAzG,eAAAwG,MAAA,EAAOF,UAAUG,WAAA;IACnB;AACF","sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\n\n// src/test/activity.test.ts\nvar import_globals = require(\"@jest/globals\");\n\n// src/model.ts\nvar import_zod2 = require(\"zod\");\n\n// src/model/shared.ts\nvar import_firestore = require(\"@google-cloud/firestore\");\nvar import_zod = require(\"zod\");\nvar TimestampOrNow = import_zod.z.preprocess(\n (arg) => arg === void 0 ? import_firestore.Timestamp.now() : arg,\n import_zod.z.custom()\n).nullish().optional();\n\n// src/model.ts\nvar import_cuid = __toESM(require(\"cuid\"));\nvar generateFirestoreId = () => {\n return (0, import_cuid.default)();\n};\nvar IdModelSchema = import_zod2.z.union([import_zod2.z.string(), import_zod2.z.number()]);\nvar IdModelProcess = import_zod2.z.preprocess((val) => {\n if (val === void 0 || val === null) {\n return generateFirestoreId();\n }\n return val;\n}, IdModelSchema);\nvar ModelSchema = import_zod2.z.object({\n id: IdModelProcess,\n createdAt: TimestampOrNow,\n updatedAt: TimestampOrNow,\n order: import_zod2.z.coerce.number().nullish().optional()\n});\nvar PreviousSchema = ModelSchema.extend({\n previous: import_zod2.z.lazy(() => ModelSchema.array().optional())\n});\nvar EnabledSchema = import_zod2.z.object({\n enabled: import_zod2.z.boolean().optional()\n});\n\n// src/model/journey.ts\nvar import_zod3 = require(\"zod\");\nvar PublishOnDate = ModelSchema.extend({\n publishOnDate: TimestampOrNow,\n unpublishOnDate: TimestampOrNow,\n published: import_zod3.z.boolean().default(false)\n});\nvar JourneyButtonSchema = import_zod3.z.object({\n type: import_zod3.z.enum([\"primary\", \"warning\", \"normal\"]),\n label: import_zod3.z.string(),\n link: import_zod3.z.string(),\n target: import_zod3.z.enum([\"_blank\", \"_self\"]).default(\"_self\")\n});\nvar PlanSchema = ModelSchema.extend({\n title: import_zod3.z.string(),\n description: import_zod3.z.string().optional(),\n enabled: import_zod3.z.boolean().default(true),\n price: import_zod3.z.number(),\n pixPrice: import_zod3.z.number(),\n portalPrice: import_zod3.z.number().optional(),\n pixPortalPrice: import_zod3.z.number().optional(),\n exStudentPrice: import_zod3.z.number().optional(),\n pixExStudentPrice: import_zod3.z.number().optional(),\n exStudentOf: import_zod3.z.array(IdModelSchema).optional(),\n period: import_zod3.z.enum([\"month\", \"biannual\", \"year\"]).default(\"month\"),\n mode: import_zod3.z.enum([\"payment\", \"setup\", \"subscription\"]),\n stripePrice: import_zod3.z.string(),\n stripePortalPrice: import_zod3.z.string()\n});\nvar JourneySchema = ModelSchema.extend({\n activitiesCounter: import_zod3.z.number(),\n lastNewsDate: TimestampOrNow,\n title: import_zod3.z.string(),\n type: import_zod3.z.enum([\"simple\", \"modular\", \"free\"]),\n description: import_zod3.z.string().optional(),\n thumbnail: import_zod3.z.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: import_zod3.z.string().optional(),\n actionToUnlock: import_zod3.z.object({\n type: import_zod3.z.enum([\"link\", \"message\"]),\n content: import_zod3.z.string(),\n buttons: import_zod3.z.array(JourneyButtonSchema).optional()\n }).optional(),\n settings: import_zod3.z.object({\n info: import_zod3.z.object({\n thumbnail: import_zod3.z.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: import_zod3.z.string().optional(),\n actionToUnlock: import_zod3.z.object({\n type: import_zod3.z.enum([\"link\", \"message\"]),\n content: import_zod3.z.string(),\n buttons: import_zod3.z.array(JourneyButtonSchema).optional()\n }).optional()\n }).optional(),\n chat: import_zod3.z.object({\n openingMessageDay: import_zod3.z.string().optional(),\n // closingMessageDay: z.string().optional(),\n // openingMessageNight: z.string().optional(),\n closingMessageNight: import_zod3.z.string().optional(),\n chatIsEnabled: import_zod3.z.boolean().default(false),\n chatURLs: import_zod3.z.array(import_zod3.z.string()).optional()\n }).optional()\n }).optional(),\n stripeProductId: import_zod3.z.string().optional(),\n plans: import_zod3.z.array(PlanSchema).optional()\n}).merge(PublishOnDate);\nvar ModuleSchema = ModelSchema.extend({\n title: import_zod3.z.string(),\n isPrivate: import_zod3.z.boolean().default(true),\n rss: import_zod3.z.string().optional(),\n isExclusive: import_zod3.z.boolean().nullish().optional()\n}).merge(PreviousSchema).merge(PublishOnDate);\nvar JourneyContentTypeSchema = import_zod3.z.enum([\"video\", \"document\", \"audio\", \"text\", \"soundcloud\", \"youtube\", \"form\", \"live\", \"file\"]);\nvar ActivitySchema = ModelSchema.extend({\n title: import_zod3.z.string(),\n description: import_zod3.z.string().optional(),\n contentType: JourneyContentTypeSchema,\n content: import_zod3.z.string(),\n files: import_zod3.z.array(import_zod3.z.object({\n label: import_zod3.z.string().optional(),\n url: import_zod3.z.string()\n })).optional(),\n hideComments: import_zod3.z.boolean().default(false),\n showChat: import_zod3.z.boolean().default(false),\n reference: import_zod3.z.string().optional(),\n tagsStr: import_zod3.z.string().optional()\n}).merge(PublishOnDate);\nvar ModuleWithActivities = ModuleSchema.extend({\n activities: ActivitySchema.array()\n});\n\n// src/test/activity.test.ts\n(0, import_globals.describe)(\"test activity\", () => {\n (0, import_globals.test)(\"test activity structure\", () => {\n const a = {\n title: \"\",\n contentType: \"video\",\n content: \"\"\n };\n const activity = ActivitySchema.parse(a);\n (0, import_globals.expect)(a).toBeDefined();\n (0, import_globals.expect)(activity).toBeDefined();\n });\n});\n","import {describe, expect, test} from '@jest/globals';\nimport {ActivitySchema} from \"../model/journey\";\n\ndescribe('test activity', () => {\n test('test activity structure', () => {\n\n const a = {\n title: '',\n contentType: 'video',\n content: '',\n }\n\n const activity = ActivitySchema.parse(a)\n expect(a).toBeDefined();\n expect(activity).toBeDefined();\n });\n});\n","import {z} from \"zod\";\nimport {TimestampOrNow} from \"./model/shared\";\nimport cuid from 'cuid';\n\nexport const generateFirestoreId = () => {\n return cuid();\n}\n\nexport const IdModelSchema = z.union([z.string(), z.number()])\n\nconst IdModelProcess = z.preprocess((val) => {\n if (val === undefined || val === null) {\n return generateFirestoreId();\n }\n return val;\n}, IdModelSchema);\n\nexport const ModelSchema = z.object({\n id: IdModelProcess,\n createdAt: TimestampOrNow,\n updatedAt: TimestampOrNow,\n order: z.coerce.number().nullish().optional()\n});\n\nexport const PreviousSchema = ModelSchema.extend({\n previous: z.lazy(() => ModelSchema.array().optional())\n})\n\nexport const EnabledSchema = z.object({\n enabled: z.boolean().optional()\n})\n\nexport type IdModel = z.infer<typeof IdModelSchema>;\nexport type Model = z.infer<typeof ModelSchema>;\nexport type Previous = z.infer<typeof PreviousSchema>;\nexport type Enabled = z.infer<typeof EnabledSchema>;\nexport type PartialWithId<T extends Model> = Partial<T> & {\n id: NonNullable<T['id']>\n}\n\n\n","import { Timestamp } from '@google-cloud/firestore';\nimport {z} from \"zod\";\n\nexport const TimestampOrNow = z\n .preprocess(\n (arg) => (arg === undefined ? Timestamp.now() : arg),\n z.custom<Timestamp>(),\n )\n .nullish().optional();\n","import {IdModelSchema, ModelSchema, PreviousSchema} from \"../model\";\nimport {z} from \"zod\";\nimport {TimestampOrNow} from \"./shared\";\n\nexport const PublishOnDate = ModelSchema.extend({\n publishOnDate: TimestampOrNow,\n unpublishOnDate: TimestampOrNow,\n published: z.boolean().default(false),\n})\n\nexport const JourneyButtonSchema = z.object({\n type: z.enum(['primary', 'warning', 'normal']),\n label: z.string(),\n link: z.string(),\n target: z.enum(['_blank', '_self']).default('_self'),\n})\n\nexport const PlanSchema = ModelSchema.extend({\n title: z.string(),\n description: z.string().optional(),\n enabled: z.boolean().default(true),\n price: z.number(),\n pixPrice: z.number(),\n portalPrice: z.number().optional(),\n pixPortalPrice: z.number().optional(),\n exStudentPrice: z.number().optional(),\n pixExStudentPrice: z.number().optional(),\n exStudentOf: z.array(IdModelSchema).optional(),\n period: z.enum(['month', 'biannual', 'year']).default('month'),\n mode: z.enum(['payment', 'setup', 'subscription']),\n stripePrice: z.string(),\n stripePortalPrice: z.string(),\n})\n\nexport const JourneySchema = ModelSchema.extend({\n activitiesCounter: z.number(),\n lastNewsDate: TimestampOrNow,\n title: z.string(),\n type: z.enum(['simple', 'modular', 'free']),\n description: z.string().optional(),\n thumbnail: z.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: z.string().optional(),\n actionToUnlock: z.object({\n type: z.enum(['link', 'message']),\n content: z.string(),\n buttons: z.array(JourneyButtonSchema).optional()\n }).optional(),\n settings: z.object({\n info: z.object({\n thumbnail: z.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: z.string().optional(),\n actionToUnlock: z.object({\n type: z.enum(['link', 'message']),\n content: z.string(),\n buttons: z.array(JourneyButtonSchema).optional()\n }).optional(),\n }).optional(),\n chat: z.object({\n openingMessageDay: z.string().optional(),\n // closingMessageDay: z.string().optional(),\n // openingMessageNight: z.string().optional(),\n closingMessageNight: z.string().optional(),\n chatIsEnabled: z.boolean().default(false),\n chatURLs: z.array(z.string()).optional(),\n }).optional()\n }).optional(),\n stripeProductId: z.string().optional(),\n plans: z.array(PlanSchema).optional(),\n}).merge(PublishOnDate)\n\n\nexport const ModuleSchema = ModelSchema.extend({\n title: z.string(),\n isPrivate: z.boolean().default(true),\n rss: z.string().optional(),\n isExclusive: z.boolean().nullish().optional(),\n}).merge(PreviousSchema).merge(PublishOnDate)\n\nexport const JourneyContentTypeSchema = z.enum(['video', 'document', 'audio', 'text', 'soundcloud', 'youtube', 'form', 'live', 'file'])\n\nexport const ActivitySchema = ModelSchema.extend({\n title: z.string(),\n description: z.string().optional(),\n contentType: JourneyContentTypeSchema,\n content: z.string(),\n files: z.array(z.object({\n label: z.string().optional(),\n url: z.string()\n })).optional(),\n hideComments: z.boolean().default(false),\n showChat: z.boolean().default(false),\n reference: z.string().optional(),\n tagsStr: z.string().optional(),\n}).merge(PublishOnDate);\n\nexport const ModuleWithActivities = ModuleSchema.extend({\n activities: ActivitySchema.array()\n})\n\nexport type Module = z.infer<typeof ModuleSchema>\nexport type Journey = z.infer<typeof JourneySchema>\nexport type Plan = z.infer<typeof PlanSchema>\nexport type ModuleWithActivities = z.infer<typeof ModuleWithActivities>\nexport type Activity = z.infer<typeof ActivitySchema>\nexport type JourneyContentType = z.infer<typeof JourneyContentTypeSchema>\n"]}
|
|
@@ -65,6 +65,9 @@ var PlanSchema = ModelSchema.extend({
|
|
|
65
65
|
pixPrice: z3.number(),
|
|
66
66
|
portalPrice: z3.number().optional(),
|
|
67
67
|
pixPortalPrice: z3.number().optional(),
|
|
68
|
+
exStudentPrice: z3.number().optional(),
|
|
69
|
+
pixExStudentPrice: z3.number().optional(),
|
|
70
|
+
exStudentOf: z3.array(IdModelSchema).optional(),
|
|
68
71
|
period: z3.enum([
|
|
69
72
|
"month",
|
|
70
73
|
"biannual",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/henriquewilson/Developer/Projects/gabirubi-domain/dist/test/activity.test.mjs","../../src/test/activity.test.ts","../../src/model.ts","../../src/model/shared.ts","../../src/model/journey.ts"],"names":["describe","expect","test","z","Timestamp","TimestampOrNow","preprocess","arg","now","custom","nullish","optional","cuid","generateFirestoreId","IdModelSchema","union","string","number","IdModelProcess","val","ModelSchema","object","id","createdAt","updatedAt","order","coerce","PreviousSchema","extend","previous","lazy","array","EnabledSchema","enabled","boolean","PublishOnDate","publishOnDate","unpublishOnDate","published","default","JourneyButtonSchema","type","enum","label","link","target","PlanSchema","title","description","price","pixPrice","portalPrice","pixPortalPrice","period","mode","stripePrice","stripePortalPrice","JourneySchema","activitiesCounter","lastNewsDate","thumbnail","expirationDate","startDate","gridButton","tag","actionToUnlock","content","buttons","settings","info","chat","openingMessageDay","closingMessageNight","chatIsEnabled","chatURLs","stripeProductId","plans","merge","ModuleSchema","isPrivate","rss","isExclusive","JourneyContentTypeSchema","ActivitySchema","contentType","files","url","hideComments","showChat","reference","tagsStr","ModuleWithActivities","activities","a","activity","parse","toBeDefined"],"mappings":"AAAA,4BAA4B;ACA5B,SAAQA,QAAA,EAAUC,MAAA,EAAQC,IAAA,QAAW,gBAAA;ADGrC,eAAe;AEHf,SAAQC,KAAAA,EAAAA,QAAQ,MAAA;AFMhB,sBAAsB;AGNtB,SAASC,SAAA,QAAiB,0BAAA;AAC1B,SAAQD,CAAA,QAAQ,MAAA;AAET,IAAME,iBAAiBF,EAC3BG,UAAA,CACC,SAACC;WAASA,QAAQ,KAAA,IAAYH,UAAUI,GAAA,KAAQD;GAChDJ,EAAEM,MAAA,IAEHC,OAAA,GAAUC,QAAA;AHMb,eAAe;AEZf,OAAOC,UAAU,OAAA;AAEV,IAAMC,sBAAsB;IACjC,OAAOD;AACT;AAEO,IAAME,gBAAgBX,GAAEY,KAAA,CAAM;IAACZ,GAAEa,MAAA;IAAUb,GAAEc,MAAA;CAAS;AAE7D,IAAMC,iBAAiBf,GAAEG,UAAA,CAAW,SAACa;IACnC,IAAIA,QAAQ,KAAA,KAAaA,QAAQ,MAAM;QACrC,OAAON;IACT;IACA,OAAOM;AACT,GAAGL;AAEI,IAAMM,cAAcjB,GAAEkB,MAAA,CAAO;IAClCC,IAAIJ;IACJK,WAAWlB;IACXmB,WAAWnB;IACXoB,OAAOtB,GAAEuB,MAAA,C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AAA,CAAO;IACtDgE,YAAYT,eAAepD,KAAA;AAC7B;AJ+BA,4BAA4B;AChI5B/B,SAAS,iBAAiB;IACxBE,KAAK,2BAA2B;QAE9B,IAAM2F,IAAI;YACR9C,OAAO;YACPqC,aAAa;YACblB,SAAS;QACX;QAEA,IAAM4B,WAAWX,eAAeY,KAAA,CAAMF;QACtC5F,OAAO4F,GAAGG,WAAA;QACV/F,OAAO6F,UAAUE,WAAA;IACnB;AACF","sourcesContent":["// src/test/activity.test.ts\nimport { describe, expect, test } from \"@jest/globals\";\n\n// src/model.ts\nimport { z as z2 } from \"zod\";\n\n// src/model/shared.ts\nimport { Timestamp } from \"@google-cloud/firestore\";\nimport { z } from \"zod\";\nvar TimestampOrNow = z.preprocess(\n (arg) => arg === void 0 ? Timestamp.now() : arg,\n z.custom()\n).nullish().optional();\n\n// src/model.ts\nimport cuid from \"cuid\";\nvar generateFirestoreId = () => {\n return cuid();\n};\nvar IdModelSchema = z2.union([z2.string(), z2.number()]);\nvar IdModelProcess = z2.preprocess((val) => {\n if (val === void 0 || val === null) {\n return generateFirestoreId();\n }\n return val;\n}, IdModelSchema);\nvar ModelSchema = z2.object({\n id: IdModelProcess,\n createdAt: TimestampOrNow,\n updatedAt: TimestampOrNow,\n order: z2.coerce.number().nullish().optional()\n});\nvar PreviousSchema = ModelSchema.extend({\n previous: z2.lazy(() => ModelSchema.array().optional())\n});\nvar EnabledSchema = z2.object({\n enabled: z2.boolean().optional()\n});\n\n// src/model/journey.ts\nimport { z as z3 } from \"zod\";\nvar PublishOnDate = ModelSchema.extend({\n publishOnDate: TimestampOrNow,\n unpublishOnDate: TimestampOrNow,\n published: z3.boolean().default(false)\n});\nvar JourneyButtonSchema = z3.object({\n type: z3.enum([\"primary\", \"warning\", \"normal\"]),\n label: z3.string(),\n link: z3.string(),\n target: z3.enum([\"_blank\", \"_self\"]).default(\"_self\")\n});\nvar PlanSchema = ModelSchema.extend({\n title: z3.string(),\n description: z3.string().optional(),\n enabled: z3.boolean().default(true),\n price: z3.number(),\n pixPrice: z3.number(),\n portalPrice: z3.number().optional(),\n pixPortalPrice: z3.number().optional(),\n period: z3.enum([\"month\", \"biannual\", \"year\"]).default(\"month\"),\n mode: z3.enum([\"payment\", \"setup\", \"subscription\"]),\n stripePrice: z3.string(),\n stripePortalPrice: z3.string()\n});\nvar JourneySchema = ModelSchema.extend({\n activitiesCounter: z3.number(),\n lastNewsDate: TimestampOrNow,\n title: z3.string(),\n type: z3.enum([\"simple\", \"modular\", \"free\"]),\n description: z3.string().optional(),\n thumbnail: z3.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: z3.string().optional(),\n actionToUnlock: z3.object({\n type: z3.enum([\"link\", \"message\"]),\n content: z3.string(),\n buttons: z3.array(JourneyButtonSchema).optional()\n }).optional(),\n settings: z3.object({\n info: z3.object({\n thumbnail: z3.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: z3.string().optional(),\n actionToUnlock: z3.object({\n type: z3.enum([\"link\", \"message\"]),\n content: z3.string(),\n buttons: z3.array(JourneyButtonSchema).optional()\n }).optional()\n }).optional(),\n chat: z3.object({\n openingMessageDay: z3.string().optional(),\n // closingMessageDay: z.string().optional(),\n // openingMessageNight: z.string().optional(),\n closingMessageNight: z3.string().optional(),\n chatIsEnabled: z3.boolean().default(false),\n chatURLs: z3.array(z3.string()).optional()\n }).optional()\n }).optional(),\n stripeProductId: z3.string().optional(),\n plans: z3.array(PlanSchema).optional()\n}).merge(PublishOnDate);\nvar ModuleSchema = ModelSchema.extend({\n title: z3.string(),\n isPrivate: z3.boolean().default(true),\n rss: z3.string().optional(),\n isExclusive: z3.boolean().nullish().optional()\n}).merge(PreviousSchema).merge(PublishOnDate);\nvar JourneyContentTypeSchema = z3.enum([\"video\", \"document\", \"audio\", \"text\", \"soundcloud\", \"youtube\", \"form\", \"live\", \"file\"]);\nvar ActivitySchema = ModelSchema.extend({\n title: z3.string(),\n description: z3.string().optional(),\n contentType: JourneyContentTypeSchema,\n content: z3.string(),\n files: z3.array(z3.object({\n label: z3.string().optional(),\n url: z3.string()\n })).optional(),\n hideComments: z3.boolean().default(false),\n showChat: z3.boolean().default(false),\n reference: z3.string().optional(),\n tagsStr: z3.string().optional()\n}).merge(PublishOnDate);\nvar ModuleWithActivities = ModuleSchema.extend({\n activities: ActivitySchema.array()\n});\n\n// src/test/activity.test.ts\ndescribe(\"test activity\", () => {\n test(\"test activity structure\", () => {\n const a = {\n title: \"\",\n contentType: \"video\",\n content: \"\"\n };\n const activity = ActivitySchema.parse(a);\n expect(a).toBeDefined();\n expect(activity).toBeDefined();\n });\n});\n","import {describe, expect, test} from '@jest/globals';\nimport {ActivitySchema} from \"../model/journey\";\n\ndescribe('test activity', () => {\n test('test activity structure', () => {\n\n const a = {\n title: '',\n contentType: 'video',\n content: '',\n }\n\n const activity = ActivitySchema.parse(a)\n expect(a).toBeDefined();\n expect(activity).toBeDefined();\n });\n});\n","import {z} from \"zod\";\nimport {TimestampOrNow} from \"./model/shared\";\nimport cuid from 'cuid';\n\nexport const generateFirestoreId = () => {\n return cuid();\n}\n\nexport const IdModelSchema = z.union([z.string(), z.number()])\n\nconst IdModelProcess = z.preprocess((val) => {\n if (val === undefined || val === null) {\n return generateFirestoreId();\n }\n return val;\n}, IdModelSchema);\n\nexport const ModelSchema = z.object({\n id: IdModelProcess,\n createdAt: TimestampOrNow,\n updatedAt: TimestampOrNow,\n order: z.coerce.number().nullish().optional()\n});\n\nexport const PreviousSchema = ModelSchema.extend({\n previous: z.lazy(() => ModelSchema.array().optional())\n})\n\nexport const EnabledSchema = z.object({\n enabled: z.boolean().optional()\n})\n\nexport type IdModel = z.infer<typeof IdModelSchema>;\nexport type Model = z.infer<typeof ModelSchema>;\nexport type Previous = z.infer<typeof PreviousSchema>;\nexport type Enabled = z.infer<typeof EnabledSchema>;\nexport type PartialWithId<T extends Model> = Partial<T> & {\n id: NonNullable<T['id']>\n}\n\n\n","import { Timestamp } from '@google-cloud/firestore';\nimport {z} from \"zod\";\n\nexport const TimestampOrNow = z\n .preprocess(\n (arg) => (arg === undefined ? Timestamp.now() : arg),\n z.custom<Timestamp>(),\n )\n .nullish().optional();\n","import {ModelSchema, PreviousSchema} from \"../model\";\nimport {z} from \"zod\";\nimport {TimestampOrNow} from \"./shared\";\n\nexport const PublishOnDate = ModelSchema.extend({\n publishOnDate: TimestampOrNow,\n unpublishOnDate: TimestampOrNow,\n published: z.boolean().default(false),\n})\n\nexport const JourneyButtonSchema = z.object({\n type: z.enum(['primary', 'warning', 'normal']),\n label: z.string(),\n link: z.string(),\n target: z.enum(['_blank', '_self']).default('_self'),\n})\n\nexport const PlanSchema = ModelSchema.extend({\n title: z.string(),\n description: z.string().optional(),\n enabled: z.boolean().default(true),\n price: z.number(),\n pixPrice: z.number(),\n portalPrice: z.number().optional(),\n pixPortalPrice: z.number().optional(),\n period: z.enum(['month', 'biannual', 'year']).default('month'),\n mode: z.enum(['payment', 'setup', 'subscription']),\n stripePrice: z.string(),\n stripePortalPrice: z.string(),\n})\n\nexport const JourneySchema = ModelSchema.extend({\n activitiesCounter: z.number(),\n lastNewsDate: TimestampOrNow,\n title: z.string(),\n type: z.enum(['simple', 'modular', 'free']),\n description: z.string().optional(),\n thumbnail: z.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: z.string().optional(),\n actionToUnlock: z.object({\n type: z.enum(['link', 'message']),\n content: z.string(),\n buttons: z.array(JourneyButtonSchema).optional()\n }).optional(),\n settings: z.object({\n info: z.object({\n thumbnail: z.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: z.string().optional(),\n actionToUnlock: z.object({\n type: z.enum(['link', 'message']),\n content: z.string(),\n buttons: z.array(JourneyButtonSchema).optional()\n }).optional(),\n }).optional(),\n chat: z.object({\n openingMessageDay: z.string().optional(),\n // closingMessageDay: z.string().optional(),\n // openingMessageNight: z.string().optional(),\n closingMessageNight: z.string().optional(),\n chatIsEnabled: z.boolean().default(false),\n chatURLs: z.array(z.string()).optional(),\n }).optional()\n }).optional(),\n stripeProductId: z.string().optional(),\n plans: z.array(PlanSchema).optional(),\n}).merge(PublishOnDate)\n\n\nexport const ModuleSchema = ModelSchema.extend({\n title: z.string(),\n isPrivate: z.boolean().default(true),\n rss: z.string().optional(),\n isExclusive: z.boolean().nullish().optional(),\n}).merge(PreviousSchema).merge(PublishOnDate)\n\nexport const JourneyContentTypeSchema = z.enum(['video', 'document', 'audio', 'text', 'soundcloud', 'youtube', 'form', 'live', 'file'])\n\nexport const ActivitySchema = ModelSchema.extend({\n title: z.string(),\n description: z.string().optional(),\n contentType: JourneyContentTypeSchema,\n content: z.string(),\n files: z.array(z.object({\n label: z.string().optional(),\n url: z.string()\n })).optional(),\n hideComments: z.boolean().default(false),\n showChat: z.boolean().default(false),\n reference: z.string().optional(),\n tagsStr: z.string().optional(),\n}).merge(PublishOnDate);\n\nexport const ModuleWithActivities = ModuleSchema.extend({\n activities: ActivitySchema.array()\n})\n\nexport type Module = z.infer<typeof ModuleSchema>\nexport type Journey = z.infer<typeof JourneySchema>\nexport type Plan = z.infer<typeof PlanSchema>\nexport type ModuleWithActivities = z.infer<typeof ModuleWithActivities>\nexport type Activity = z.infer<typeof ActivitySchema>\nexport type JourneyContentType = z.infer<typeof JourneyContentTypeSchema>\n"]}
|
|
1
|
+
{"version":3,"sources":["/Users/henriquewilson/Developer/Projects/gabirubi-domain/dist/test/activity.test.mjs","../../src/test/activity.test.ts","../../src/model.ts","../../src/model/shared.ts","../../src/model/journey.ts"],"names":["describe","expect","test","z","Timestamp","TimestampOrNow","preprocess","arg","now","custom","nullish","optional","cuid","generateFirestoreId","IdModelSchema","union","string","number","IdModelProcess","val","ModelSchema","object","id","createdAt","updatedAt","order","coerce","PreviousSchema","extend","previous","lazy","array","EnabledSchema","enabled","boolean","PublishOnDate","publishOnDate","unpublishOnDate","published","default","JourneyButtonSchema","type","enum","label","link","target","PlanSchema","title","description","price","pixPrice","portalPrice","pixPortalPrice","exStudentPrice","pixExStudentPrice","exStudentOf","period","mode","stripePrice","stripePortalPrice","JourneySchema","activitiesCounter","lastNewsDate","thumbnail","expirationDate","startDate","gridButton","tag","actionToUnlock","content","buttons","settings","info","chat","openingMessageDay","closingMessageNight","chatIsEnabled","chatURLs","stripeProductId","plans","merge","ModuleSchema","isPrivate","rss","isExclusive","JourneyContentTypeSchema","ActivitySchema","contentType","files","url","hideComments","showChat","reference","tagsStr","ModuleWithActivities","activities","a","activity","parse","toBeDefined"],"mappings":"AAAA,4BAA4B;ACA5B,SAAQA,QAAA,EAAUC,MAAA,EAAQC,IAAA,QAAW,gBAAA;ADGrC,eAAe;AEHf,SAAQC,KAAAA,EAAAA,QAAQ,MAAA;AFMhB,sBAAsB;AGNtB,SAASC,SAAA,QAAiB,0BAAA;AAC1B,SAAQD,CAAA,QAAQ,MAAA;AAET,IAAME,iBAAiBF,EAC3BG,UAAA,CACC,SAACC;WAASA,QAAQ,KAAA,IAAYH,UAAUI,GAAA,KAAQD;GAChDJ,EAAEM,MAAA,IAEHC,OAAA,GAAUC,QAAA;AHMb,eAAe;AEZf,OAAOC,UAAU,OAAA;AAEV,IAAMC,sBAAsB;IACjC,OAAOD;AACT;AAEO,IAAME,gBAAgBX,GAAEY,KAAA,CAAM;IAACZ,GAAEa,MAAA;IAAUb,GAAEc,MAAA;CAAS;AAE7D,IAAMC,iBAAiBf,GAAEG,UAAA,CAAW,SAACa;IACnC,IAAIA,QAAQ,KAAA,KAAaA,QAAQ,MAAM;QACrC,OAAON;IACT;IACA,OAAOM;AACT,GAAGL;AAEI,IAAMM,cAAcjB,GAAEkB,MAAA,CAAO;IAClCC,IAAIJ;IACJK,WAAWlB;IACXmB,WAAWnB;IACXoB,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AUK,OAAA,CAAQ;IAC9BqD,WAAWzF,GAAEa,MAAA,GAASL,QAAA;IACtBkF,SAAS1F,GAAEa,MAAA,GAASL,QAAA;AACtB,GAAGqE,KAAA,CAAM7C;AAEF,IAAM2D,uBAAuBb,aAAarD,MAAA,CAAO;IACtDmE,YAAYT,eAAevD,KAAA;AAC7B;AJ+BA,4BAA4B;ACnI5B/B,SAAS,iBAAiB;IACxBE,KAAK,2BAA2B;QAE9B,IAAM8F,IAAI;YACRjD,OAAO;YACPwC,aAAa;YACblB,SAAS;QACX;QAEA,IAAM4B,WAAWX,eAAeY,KAAA,CAAMF;QACtC/F,OAAO+F,GAAGG,WAAA;QACVlG,OAAOgG,UAAUE,WAAA;IACnB;AACF","sourcesContent":["// src/test/activity.test.ts\nimport { describe, expect, test } from \"@jest/globals\";\n\n// src/model.ts\nimport { z as z2 } from \"zod\";\n\n// src/model/shared.ts\nimport { Timestamp } from \"@google-cloud/firestore\";\nimport { z } from \"zod\";\nvar TimestampOrNow = z.preprocess(\n (arg) => arg === void 0 ? Timestamp.now() : arg,\n z.custom()\n).nullish().optional();\n\n// src/model.ts\nimport cuid from \"cuid\";\nvar generateFirestoreId = () => {\n return cuid();\n};\nvar IdModelSchema = z2.union([z2.string(), z2.number()]);\nvar IdModelProcess = z2.preprocess((val) => {\n if (val === void 0 || val === null) {\n return generateFirestoreId();\n }\n return val;\n}, IdModelSchema);\nvar ModelSchema = z2.object({\n id: IdModelProcess,\n createdAt: TimestampOrNow,\n updatedAt: TimestampOrNow,\n order: z2.coerce.number().nullish().optional()\n});\nvar PreviousSchema = ModelSchema.extend({\n previous: z2.lazy(() => ModelSchema.array().optional())\n});\nvar EnabledSchema = z2.object({\n enabled: z2.boolean().optional()\n});\n\n// src/model/journey.ts\nimport { z as z3 } from \"zod\";\nvar PublishOnDate = ModelSchema.extend({\n publishOnDate: TimestampOrNow,\n unpublishOnDate: TimestampOrNow,\n published: z3.boolean().default(false)\n});\nvar JourneyButtonSchema = z3.object({\n type: z3.enum([\"primary\", \"warning\", \"normal\"]),\n label: z3.string(),\n link: z3.string(),\n target: z3.enum([\"_blank\", \"_self\"]).default(\"_self\")\n});\nvar PlanSchema = ModelSchema.extend({\n title: z3.string(),\n description: z3.string().optional(),\n enabled: z3.boolean().default(true),\n price: z3.number(),\n pixPrice: z3.number(),\n portalPrice: z3.number().optional(),\n pixPortalPrice: z3.number().optional(),\n exStudentPrice: z3.number().optional(),\n pixExStudentPrice: z3.number().optional(),\n exStudentOf: z3.array(IdModelSchema).optional(),\n period: z3.enum([\"month\", \"biannual\", \"year\"]).default(\"month\"),\n mode: z3.enum([\"payment\", \"setup\", \"subscription\"]),\n stripePrice: z3.string(),\n stripePortalPrice: z3.string()\n});\nvar JourneySchema = ModelSchema.extend({\n activitiesCounter: z3.number(),\n lastNewsDate: TimestampOrNow,\n title: z3.string(),\n type: z3.enum([\"simple\", \"modular\", \"free\"]),\n description: z3.string().optional(),\n thumbnail: z3.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: z3.string().optional(),\n actionToUnlock: z3.object({\n type: z3.enum([\"link\", \"message\"]),\n content: z3.string(),\n buttons: z3.array(JourneyButtonSchema).optional()\n }).optional(),\n settings: z3.object({\n info: z3.object({\n thumbnail: z3.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: z3.string().optional(),\n actionToUnlock: z3.object({\n type: z3.enum([\"link\", \"message\"]),\n content: z3.string(),\n buttons: z3.array(JourneyButtonSchema).optional()\n }).optional()\n }).optional(),\n chat: z3.object({\n openingMessageDay: z3.string().optional(),\n // closingMessageDay: z.string().optional(),\n // openingMessageNight: z.string().optional(),\n closingMessageNight: z3.string().optional(),\n chatIsEnabled: z3.boolean().default(false),\n chatURLs: z3.array(z3.string()).optional()\n }).optional()\n }).optional(),\n stripeProductId: z3.string().optional(),\n plans: z3.array(PlanSchema).optional()\n}).merge(PublishOnDate);\nvar ModuleSchema = ModelSchema.extend({\n title: z3.string(),\n isPrivate: z3.boolean().default(true),\n rss: z3.string().optional(),\n isExclusive: z3.boolean().nullish().optional()\n}).merge(PreviousSchema).merge(PublishOnDate);\nvar JourneyContentTypeSchema = z3.enum([\"video\", \"document\", \"audio\", \"text\", \"soundcloud\", \"youtube\", \"form\", \"live\", \"file\"]);\nvar ActivitySchema = ModelSchema.extend({\n title: z3.string(),\n description: z3.string().optional(),\n contentType: JourneyContentTypeSchema,\n content: z3.string(),\n files: z3.array(z3.object({\n label: z3.string().optional(),\n url: z3.string()\n })).optional(),\n hideComments: z3.boolean().default(false),\n showChat: z3.boolean().default(false),\n reference: z3.string().optional(),\n tagsStr: z3.string().optional()\n}).merge(PublishOnDate);\nvar ModuleWithActivities = ModuleSchema.extend({\n activities: ActivitySchema.array()\n});\n\n// src/test/activity.test.ts\ndescribe(\"test activity\", () => {\n test(\"test activity structure\", () => {\n const a = {\n title: \"\",\n contentType: \"video\",\n content: \"\"\n };\n const activity = ActivitySchema.parse(a);\n expect(a).toBeDefined();\n expect(activity).toBeDefined();\n });\n});\n","import {describe, expect, test} from '@jest/globals';\nimport {ActivitySchema} from \"../model/journey\";\n\ndescribe('test activity', () => {\n test('test activity structure', () => {\n\n const a = {\n title: '',\n contentType: 'video',\n content: '',\n }\n\n const activity = ActivitySchema.parse(a)\n expect(a).toBeDefined();\n expect(activity).toBeDefined();\n });\n});\n","import {z} from \"zod\";\nimport {TimestampOrNow} from \"./model/shared\";\nimport cuid from 'cuid';\n\nexport const generateFirestoreId = () => {\n return cuid();\n}\n\nexport const IdModelSchema = z.union([z.string(), z.number()])\n\nconst IdModelProcess = z.preprocess((val) => {\n if (val === undefined || val === null) {\n return generateFirestoreId();\n }\n return val;\n}, IdModelSchema);\n\nexport const ModelSchema = z.object({\n id: IdModelProcess,\n createdAt: TimestampOrNow,\n updatedAt: TimestampOrNow,\n order: z.coerce.number().nullish().optional()\n});\n\nexport const PreviousSchema = ModelSchema.extend({\n previous: z.lazy(() => ModelSchema.array().optional())\n})\n\nexport const EnabledSchema = z.object({\n enabled: z.boolean().optional()\n})\n\nexport type IdModel = z.infer<typeof IdModelSchema>;\nexport type Model = z.infer<typeof ModelSchema>;\nexport type Previous = z.infer<typeof PreviousSchema>;\nexport type Enabled = z.infer<typeof EnabledSchema>;\nexport type PartialWithId<T extends Model> = Partial<T> & {\n id: NonNullable<T['id']>\n}\n\n\n","import { Timestamp } from '@google-cloud/firestore';\nimport {z} from \"zod\";\n\nexport const TimestampOrNow = z\n .preprocess(\n (arg) => (arg === undefined ? Timestamp.now() : arg),\n z.custom<Timestamp>(),\n )\n .nullish().optional();\n","import {IdModelSchema, ModelSchema, PreviousSchema} from \"../model\";\nimport {z} from \"zod\";\nimport {TimestampOrNow} from \"./shared\";\n\nexport const PublishOnDate = ModelSchema.extend({\n publishOnDate: TimestampOrNow,\n unpublishOnDate: TimestampOrNow,\n published: z.boolean().default(false),\n})\n\nexport const JourneyButtonSchema = z.object({\n type: z.enum(['primary', 'warning', 'normal']),\n label: z.string(),\n link: z.string(),\n target: z.enum(['_blank', '_self']).default('_self'),\n})\n\nexport const PlanSchema = ModelSchema.extend({\n title: z.string(),\n description: z.string().optional(),\n enabled: z.boolean().default(true),\n price: z.number(),\n pixPrice: z.number(),\n portalPrice: z.number().optional(),\n pixPortalPrice: z.number().optional(),\n exStudentPrice: z.number().optional(),\n pixExStudentPrice: z.number().optional(),\n exStudentOf: z.array(IdModelSchema).optional(),\n period: z.enum(['month', 'biannual', 'year']).default('month'),\n mode: z.enum(['payment', 'setup', 'subscription']),\n stripePrice: z.string(),\n stripePortalPrice: z.string(),\n})\n\nexport const JourneySchema = ModelSchema.extend({\n activitiesCounter: z.number(),\n lastNewsDate: TimestampOrNow,\n title: z.string(),\n type: z.enum(['simple', 'modular', 'free']),\n description: z.string().optional(),\n thumbnail: z.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: z.string().optional(),\n actionToUnlock: z.object({\n type: z.enum(['link', 'message']),\n content: z.string(),\n buttons: z.array(JourneyButtonSchema).optional()\n }).optional(),\n settings: z.object({\n info: z.object({\n thumbnail: z.string().optional(),\n expirationDate: TimestampOrNow.optional(),\n startDate: TimestampOrNow.optional(),\n gridButton: JourneyButtonSchema.optional(),\n tag: z.string().optional(),\n actionToUnlock: z.object({\n type: z.enum(['link', 'message']),\n content: z.string(),\n buttons: z.array(JourneyButtonSchema).optional()\n }).optional(),\n }).optional(),\n chat: z.object({\n openingMessageDay: z.string().optional(),\n // closingMessageDay: z.string().optional(),\n // openingMessageNight: z.string().optional(),\n closingMessageNight: z.string().optional(),\n chatIsEnabled: z.boolean().default(false),\n chatURLs: z.array(z.string()).optional(),\n }).optional()\n }).optional(),\n stripeProductId: z.string().optional(),\n plans: z.array(PlanSchema).optional(),\n}).merge(PublishOnDate)\n\n\nexport const ModuleSchema = ModelSchema.extend({\n title: z.string(),\n isPrivate: z.boolean().default(true),\n rss: z.string().optional(),\n isExclusive: z.boolean().nullish().optional(),\n}).merge(PreviousSchema).merge(PublishOnDate)\n\nexport const JourneyContentTypeSchema = z.enum(['video', 'document', 'audio', 'text', 'soundcloud', 'youtube', 'form', 'live', 'file'])\n\nexport const ActivitySchema = ModelSchema.extend({\n title: z.string(),\n description: z.string().optional(),\n contentType: JourneyContentTypeSchema,\n content: z.string(),\n files: z.array(z.object({\n label: z.string().optional(),\n url: z.string()\n })).optional(),\n hideComments: z.boolean().default(false),\n showChat: z.boolean().default(false),\n reference: z.string().optional(),\n tagsStr: z.string().optional(),\n}).merge(PublishOnDate);\n\nexport const ModuleWithActivities = ModuleSchema.extend({\n activities: ActivitySchema.array()\n})\n\nexport type Module = z.infer<typeof ModuleSchema>\nexport type Journey = z.infer<typeof JourneySchema>\nexport type Plan = z.infer<typeof PlanSchema>\nexport type ModuleWithActivities = z.infer<typeof ModuleWithActivities>\nexport type Activity = z.infer<typeof ActivitySchema>\nexport type JourneyContentType = z.infer<typeof JourneyContentTypeSchema>\n"]}
|