@_henriquewilson/gabirubi-domain 1.3.20 → 1.3.22

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.
@@ -26,9 +26,9 @@ declare const IuguChargeSchema: z.ZodObject<{
26
26
  pdf: string;
27
27
  invoice_id: string;
28
28
  LR: string;
29
- reversible?: string | null | undefined;
30
29
  brand?: string | null | undefined;
31
30
  bin?: string | null | undefined;
31
+ reversible?: string | null | undefined;
32
32
  last4?: string | null | undefined;
33
33
  issuer?: string | null | undefined;
34
34
  identification?: string | null | undefined;
@@ -42,9 +42,9 @@ declare const IuguChargeSchema: z.ZodObject<{
42
42
  pdf: string;
43
43
  invoice_id: string;
44
44
  LR: string;
45
- reversible?: string | null | undefined;
46
45
  brand?: string | null | undefined;
47
46
  bin?: string | null | undefined;
47
+ reversible?: string | null | undefined;
48
48
  last4?: string | null | undefined;
49
49
  issuer?: string | null | undefined;
50
50
  identification?: string | null | undefined;
@@ -26,9 +26,9 @@ declare const IuguChargeSchema: z.ZodObject<{
26
26
  pdf: string;
27
27
  invoice_id: string;
28
28
  LR: string;
29
- reversible?: string | null | undefined;
30
29
  brand?: string | null | undefined;
31
30
  bin?: string | null | undefined;
31
+ reversible?: string | null | undefined;
32
32
  last4?: string | null | undefined;
33
33
  issuer?: string | null | undefined;
34
34
  identification?: string | null | undefined;
@@ -42,9 +42,9 @@ declare const IuguChargeSchema: z.ZodObject<{
42
42
  pdf: string;
43
43
  invoice_id: string;
44
44
  LR: string;
45
- reversible?: string | null | undefined;
46
45
  brand?: string | null | undefined;
47
46
  bin?: string | null | undefined;
47
+ reversible?: string | null | undefined;
48
48
  last4?: string | null | undefined;
49
49
  issuer?: string | null | undefined;
50
50
  identification?: string | null | undefined;
@@ -12,9 +12,9 @@ declare const dataSchema: z.ZodObject<{
12
12
  masked_number: z.ZodString;
13
13
  }, "strip", z.ZodTypeAny, {
14
14
  brand: string;
15
- bin: string;
16
15
  holder_name: string;
17
16
  display_number: string;
17
+ bin: string;
18
18
  year: number;
19
19
  month: number;
20
20
  last_digits: string;
@@ -22,9 +22,9 @@ declare const dataSchema: z.ZodObject<{
22
22
  masked_number: string;
23
23
  }, {
24
24
  brand: string;
25
- bin: string;
26
25
  holder_name: string;
27
26
  display_number: string;
27
+ bin: string;
28
28
  year: number;
29
29
  month: number;
30
30
  last_digits: string;
@@ -47,9 +47,9 @@ declare const paymentMethodSchema: z.ZodObject<{
47
47
  masked_number: z.ZodString;
48
48
  }, "strip", z.ZodTypeAny, {
49
49
  brand: string;
50
- bin: string;
51
50
  holder_name: string;
52
51
  display_number: string;
52
+ bin: string;
53
53
  year: number;
54
54
  month: number;
55
55
  last_digits: string;
@@ -57,9 +57,9 @@ declare const paymentMethodSchema: z.ZodObject<{
57
57
  masked_number: string;
58
58
  }, {
59
59
  brand: string;
60
- bin: string;
61
60
  holder_name: string;
62
61
  display_number: string;
62
+ bin: string;
63
63
  year: number;
64
64
  month: number;
65
65
  last_digits: string;
@@ -72,9 +72,9 @@ declare const paymentMethodSchema: z.ZodObject<{
72
72
  item_type: string;
73
73
  data: {
74
74
  brand: string;
75
- bin: string;
76
75
  holder_name: string;
77
76
  display_number: string;
77
+ bin: string;
78
78
  year: number;
79
79
  month: number;
80
80
  last_digits: string;
@@ -87,9 +87,9 @@ declare const paymentMethodSchema: z.ZodObject<{
87
87
  item_type: string;
88
88
  data: {
89
89
  brand: string;
90
- bin: string;
91
90
  holder_name: string;
92
91
  display_number: string;
92
+ bin: string;
93
93
  year: number;
94
94
  month: number;
95
95
  last_digits: string;
@@ -139,9 +139,9 @@ declare const IuguClientSchema: z.ZodObject<z.objectUtil.extendShape<{
139
139
  masked_number: z.ZodString;
140
140
  }, "strip", z.ZodTypeAny, {
141
141
  brand: string;
142
- bin: string;
143
142
  holder_name: string;
144
143
  display_number: string;
144
+ bin: string;
145
145
  year: number;
146
146
  month: number;
147
147
  last_digits: string;
@@ -149,9 +149,9 @@ declare const IuguClientSchema: z.ZodObject<z.objectUtil.extendShape<{
149
149
  masked_number: string;
150
150
  }, {
151
151
  brand: string;
152
- bin: string;
153
152
  holder_name: string;
154
153
  display_number: string;
154
+ bin: string;
155
155
  year: number;
156
156
  month: number;
157
157
  last_digits: string;
@@ -164,9 +164,9 @@ declare const IuguClientSchema: z.ZodObject<z.objectUtil.extendShape<{
164
164
  item_type: string;
165
165
  data: {
166
166
  brand: string;
167
- bin: string;
168
167
  holder_name: string;
169
168
  display_number: string;
169
+ bin: string;
170
170
  year: number;
171
171
  month: number;
172
172
  last_digits: string;
@@ -179,9 +179,9 @@ declare const IuguClientSchema: z.ZodObject<z.objectUtil.extendShape<{
179
179
  item_type: string;
180
180
  data: {
181
181
  brand: string;
182
- bin: string;
183
182
  holder_name: string;
184
183
  display_number: string;
184
+ bin: string;
185
185
  year: number;
186
186
  month: number;
187
187
  last_digits: string;
@@ -216,9 +216,9 @@ declare const IuguClientSchema: z.ZodObject<z.objectUtil.extendShape<{
216
216
  item_type: string;
217
217
  data: {
218
218
  brand: string;
219
- bin: string;
220
219
  holder_name: string;
221
220
  display_number: string;
221
+ bin: string;
222
222
  year: number;
223
223
  month: number;
224
224
  last_digits: string;
@@ -253,9 +253,9 @@ declare const IuguClientSchema: z.ZodObject<z.objectUtil.extendShape<{
253
253
  item_type: string;
254
254
  data: {
255
255
  brand: string;
256
- bin: string;
257
256
  holder_name: string;
258
257
  display_number: string;
258
+ bin: string;
259
259
  year: number;
260
260
  month: number;
261
261
  last_digits: string;
@@ -12,9 +12,9 @@ declare const dataSchema: z.ZodObject<{
12
12
  masked_number: z.ZodString;
13
13
  }, "strip", z.ZodTypeAny, {
14
14
  brand: string;
15
- bin: string;
16
15
  holder_name: string;
17
16
  display_number: string;
17
+ bin: string;
18
18
  year: number;
19
19
  month: number;
20
20
  last_digits: string;
@@ -22,9 +22,9 @@ declare const dataSchema: z.ZodObject<{
22
22
  masked_number: string;
23
23
  }, {
24
24
  brand: string;
25
- bin: string;
26
25
  holder_name: string;
27
26
  display_number: string;
27
+ bin: string;
28
28
  year: number;
29
29
  month: number;
30
30
  last_digits: string;
@@ -47,9 +47,9 @@ declare const paymentMethodSchema: z.ZodObject<{
47
47
  masked_number: z.ZodString;
48
48
  }, "strip", z.ZodTypeAny, {
49
49
  brand: string;
50
- bin: string;
51
50
  holder_name: string;
52
51
  display_number: string;
52
+ bin: string;
53
53
  year: number;
54
54
  month: number;
55
55
  last_digits: string;
@@ -57,9 +57,9 @@ declare const paymentMethodSchema: z.ZodObject<{
57
57
  masked_number: string;
58
58
  }, {
59
59
  brand: string;
60
- bin: string;
61
60
  holder_name: string;
62
61
  display_number: string;
62
+ bin: string;
63
63
  year: number;
64
64
  month: number;
65
65
  last_digits: string;
@@ -72,9 +72,9 @@ declare const paymentMethodSchema: z.ZodObject<{
72
72
  item_type: string;
73
73
  data: {
74
74
  brand: string;
75
- bin: string;
76
75
  holder_name: string;
77
76
  display_number: string;
77
+ bin: string;
78
78
  year: number;
79
79
  month: number;
80
80
  last_digits: string;
@@ -87,9 +87,9 @@ declare const paymentMethodSchema: z.ZodObject<{
87
87
  item_type: string;
88
88
  data: {
89
89
  brand: string;
90
- bin: string;
91
90
  holder_name: string;
92
91
  display_number: string;
92
+ bin: string;
93
93
  year: number;
94
94
  month: number;
95
95
  last_digits: string;
@@ -139,9 +139,9 @@ declare const IuguClientSchema: z.ZodObject<z.objectUtil.extendShape<{
139
139
  masked_number: z.ZodString;
140
140
  }, "strip", z.ZodTypeAny, {
141
141
  brand: string;
142
- bin: string;
143
142
  holder_name: string;
144
143
  display_number: string;
144
+ bin: string;
145
145
  year: number;
146
146
  month: number;
147
147
  last_digits: string;
@@ -149,9 +149,9 @@ declare const IuguClientSchema: z.ZodObject<z.objectUtil.extendShape<{
149
149
  masked_number: string;
150
150
  }, {
151
151
  brand: string;
152
- bin: string;
153
152
  holder_name: string;
154
153
  display_number: string;
154
+ bin: string;
155
155
  year: number;
156
156
  month: number;
157
157
  last_digits: string;
@@ -164,9 +164,9 @@ declare const IuguClientSchema: z.ZodObject<z.objectUtil.extendShape<{
164
164
  item_type: string;
165
165
  data: {
166
166
  brand: string;
167
- bin: string;
168
167
  holder_name: string;
169
168
  display_number: string;
169
+ bin: string;
170
170
  year: number;
171
171
  month: number;
172
172
  last_digits: string;
@@ -179,9 +179,9 @@ declare const IuguClientSchema: z.ZodObject<z.objectUtil.extendShape<{
179
179
  item_type: string;
180
180
  data: {
181
181
  brand: string;
182
- bin: string;
183
182
  holder_name: string;
184
183
  display_number: string;
184
+ bin: string;
185
185
  year: number;
186
186
  month: number;
187
187
  last_digits: string;
@@ -216,9 +216,9 @@ declare const IuguClientSchema: z.ZodObject<z.objectUtil.extendShape<{
216
216
  item_type: string;
217
217
  data: {
218
218
  brand: string;
219
- bin: string;
220
219
  holder_name: string;
221
220
  display_number: string;
221
+ bin: string;
222
222
  year: number;
223
223
  month: number;
224
224
  last_digits: string;
@@ -253,9 +253,9 @@ declare const IuguClientSchema: z.ZodObject<z.objectUtil.extendShape<{
253
253
  item_type: string;
254
254
  data: {
255
255
  brand: string;
256
- bin: string;
257
256
  holder_name: string;
258
257
  display_number: string;
258
+ bin: string;
259
259
  year: number;
260
260
  month: number;
261
261
  last_digits: string;
@@ -500,7 +500,7 @@ declare const ModuleSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.ex
500
500
  isPrivate?: boolean | undefined;
501
501
  isExclusive?: boolean | null | undefined;
502
502
  }>;
503
- declare const JourneyContentTypeSchema: z.ZodEnum<["video", "file", "audio", "text", "soundcloud", "youtube", "form", "live"]>;
503
+ declare const JourneyContentTypeSchema: z.ZodEnum<["video", "document", "audio", "text", "soundcloud", "youtube", "form", "live", "file"]>;
504
504
  declare const ActivitySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
505
505
  id: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string | number, unknown>;
506
506
  createdAt: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodType<FirebaseFirestore.Timestamp, z.ZodTypeDef, FirebaseFirestore.Timestamp>, FirebaseFirestore.Timestamp, unknown>>>>;
@@ -509,7 +509,7 @@ declare const ActivitySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.
509
509
  }, {
510
510
  title: z.ZodString;
511
511
  description: z.ZodOptional<z.ZodString>;
512
- contentType: z.ZodEnum<["video", "file", "audio", "text", "soundcloud", "youtube", "form", "live"]>;
512
+ contentType: z.ZodEnum<["video", "document", "audio", "text", "soundcloud", "youtube", "form", "live", "file"]>;
513
513
  content: z.ZodString;
514
514
  files: z.ZodOptional<z.ZodArray<z.ZodObject<{
515
515
  label: z.ZodOptional<z.ZodString>;
@@ -537,7 +537,7 @@ declare const ActivitySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.
537
537
  published: boolean;
538
538
  title: string;
539
539
  content: string;
540
- contentType: "video" | "file" | "audio" | "text" | "soundcloud" | "youtube" | "form" | "live";
540
+ contentType: "video" | "document" | "audio" | "text" | "soundcloud" | "youtube" | "form" | "live" | "file";
541
541
  hideComments: boolean;
542
542
  showChat: boolean;
543
543
  createdAt?: FirebaseFirestore.Timestamp | null | undefined;
@@ -553,7 +553,7 @@ declare const ActivitySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.
553
553
  }, {
554
554
  title: string;
555
555
  content: string;
556
- contentType: "video" | "file" | "audio" | "text" | "soundcloud" | "youtube" | "form" | "live";
556
+ contentType: "video" | "document" | "audio" | "text" | "soundcloud" | "youtube" | "form" | "live" | "file";
557
557
  id?: unknown;
558
558
  createdAt?: unknown;
559
559
  updatedAt?: unknown;
@@ -620,7 +620,7 @@ declare const ModuleWithActivities: z.ZodObject<z.objectUtil.extendShape<z.objec
620
620
  }, {
621
621
  title: z.ZodString;
622
622
  description: z.ZodOptional<z.ZodString>;
623
- contentType: z.ZodEnum<["video", "file", "audio", "text", "soundcloud", "youtube", "form", "live"]>;
623
+ contentType: z.ZodEnum<["video", "document", "audio", "text", "soundcloud", "youtube", "form", "live", "file"]>;
624
624
  content: z.ZodString;
625
625
  files: z.ZodOptional<z.ZodArray<z.ZodObject<{
626
626
  label: z.ZodOptional<z.ZodString>;
@@ -648,7 +648,7 @@ declare const ModuleWithActivities: z.ZodObject<z.objectUtil.extendShape<z.objec
648
648
  published: boolean;
649
649
  title: string;
650
650
  content: string;
651
- contentType: "video" | "file" | "audio" | "text" | "soundcloud" | "youtube" | "form" | "live";
651
+ contentType: "video" | "document" | "audio" | "text" | "soundcloud" | "youtube" | "form" | "live" | "file";
652
652
  hideComments: boolean;
653
653
  showChat: boolean;
654
654
  createdAt?: FirebaseFirestore.Timestamp | null | undefined;
@@ -664,7 +664,7 @@ declare const ModuleWithActivities: z.ZodObject<z.objectUtil.extendShape<z.objec
664
664
  }, {
665
665
  title: string;
666
666
  content: string;
667
- contentType: "video" | "file" | "audio" | "text" | "soundcloud" | "youtube" | "form" | "live";
667
+ contentType: "video" | "document" | "audio" | "text" | "soundcloud" | "youtube" | "form" | "live" | "file";
668
668
  id?: unknown;
669
669
  createdAt?: unknown;
670
670
  updatedAt?: unknown;
@@ -690,7 +690,7 @@ declare const ModuleWithActivities: z.ZodObject<z.objectUtil.extendShape<z.objec
690
690
  published: boolean;
691
691
  title: string;
692
692
  content: string;
693
- contentType: "video" | "file" | "audio" | "text" | "soundcloud" | "youtube" | "form" | "live";
693
+ contentType: "video" | "document" | "audio" | "text" | "soundcloud" | "youtube" | "form" | "live" | "file";
694
694
  hideComments: boolean;
695
695
  showChat: boolean;
696
696
  createdAt?: FirebaseFirestore.Timestamp | null | undefined;
@@ -721,7 +721,7 @@ declare const ModuleWithActivities: z.ZodObject<z.objectUtil.extendShape<z.objec
721
721
  activities: {
722
722
  title: string;
723
723
  content: string;
724
- contentType: "video" | "file" | "audio" | "text" | "soundcloud" | "youtube" | "form" | "live";
724
+ contentType: "video" | "document" | "audio" | "text" | "soundcloud" | "youtube" | "form" | "live" | "file";
725
725
  id?: unknown;
726
726
  createdAt?: unknown;
727
727
  updatedAt?: unknown;
@@ -500,7 +500,7 @@ declare const ModuleSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.ex
500
500
  isPrivate?: boolean | undefined;
501
501
  isExclusive?: boolean | null | undefined;
502
502
  }>;
503
- declare const JourneyContentTypeSchema: z.ZodEnum<["video", "file", "audio", "text", "soundcloud", "youtube", "form", "live"]>;
503
+ declare const JourneyContentTypeSchema: z.ZodEnum<["video", "document", "audio", "text", "soundcloud", "youtube", "form", "live", "file"]>;
504
504
  declare const ActivitySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
505
505
  id: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string | number, unknown>;
506
506
  createdAt: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodType<FirebaseFirestore.Timestamp, z.ZodTypeDef, FirebaseFirestore.Timestamp>, FirebaseFirestore.Timestamp, unknown>>>>;
@@ -509,7 +509,7 @@ declare const ActivitySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.
509
509
  }, {
510
510
  title: z.ZodString;
511
511
  description: z.ZodOptional<z.ZodString>;
512
- contentType: z.ZodEnum<["video", "file", "audio", "text", "soundcloud", "youtube", "form", "live"]>;
512
+ contentType: z.ZodEnum<["video", "document", "audio", "text", "soundcloud", "youtube", "form", "live", "file"]>;
513
513
  content: z.ZodString;
514
514
  files: z.ZodOptional<z.ZodArray<z.ZodObject<{
515
515
  label: z.ZodOptional<z.ZodString>;
@@ -537,7 +537,7 @@ declare const ActivitySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.
537
537
  published: boolean;
538
538
  title: string;
539
539
  content: string;
540
- contentType: "video" | "file" | "audio" | "text" | "soundcloud" | "youtube" | "form" | "live";
540
+ contentType: "video" | "document" | "audio" | "text" | "soundcloud" | "youtube" | "form" | "live" | "file";
541
541
  hideComments: boolean;
542
542
  showChat: boolean;
543
543
  createdAt?: FirebaseFirestore.Timestamp | null | undefined;
@@ -553,7 +553,7 @@ declare const ActivitySchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.
553
553
  }, {
554
554
  title: string;
555
555
  content: string;
556
- contentType: "video" | "file" | "audio" | "text" | "soundcloud" | "youtube" | "form" | "live";
556
+ contentType: "video" | "document" | "audio" | "text" | "soundcloud" | "youtube" | "form" | "live" | "file";
557
557
  id?: unknown;
558
558
  createdAt?: unknown;
559
559
  updatedAt?: unknown;
@@ -620,7 +620,7 @@ declare const ModuleWithActivities: z.ZodObject<z.objectUtil.extendShape<z.objec
620
620
  }, {
621
621
  title: z.ZodString;
622
622
  description: z.ZodOptional<z.ZodString>;
623
- contentType: z.ZodEnum<["video", "file", "audio", "text", "soundcloud", "youtube", "form", "live"]>;
623
+ contentType: z.ZodEnum<["video", "document", "audio", "text", "soundcloud", "youtube", "form", "live", "file"]>;
624
624
  content: z.ZodString;
625
625
  files: z.ZodOptional<z.ZodArray<z.ZodObject<{
626
626
  label: z.ZodOptional<z.ZodString>;
@@ -648,7 +648,7 @@ declare const ModuleWithActivities: z.ZodObject<z.objectUtil.extendShape<z.objec
648
648
  published: boolean;
649
649
  title: string;
650
650
  content: string;
651
- contentType: "video" | "file" | "audio" | "text" | "soundcloud" | "youtube" | "form" | "live";
651
+ contentType: "video" | "document" | "audio" | "text" | "soundcloud" | "youtube" | "form" | "live" | "file";
652
652
  hideComments: boolean;
653
653
  showChat: boolean;
654
654
  createdAt?: FirebaseFirestore.Timestamp | null | undefined;
@@ -664,7 +664,7 @@ declare const ModuleWithActivities: z.ZodObject<z.objectUtil.extendShape<z.objec
664
664
  }, {
665
665
  title: string;
666
666
  content: string;
667
- contentType: "video" | "file" | "audio" | "text" | "soundcloud" | "youtube" | "form" | "live";
667
+ contentType: "video" | "document" | "audio" | "text" | "soundcloud" | "youtube" | "form" | "live" | "file";
668
668
  id?: unknown;
669
669
  createdAt?: unknown;
670
670
  updatedAt?: unknown;
@@ -690,7 +690,7 @@ declare const ModuleWithActivities: z.ZodObject<z.objectUtil.extendShape<z.objec
690
690
  published: boolean;
691
691
  title: string;
692
692
  content: string;
693
- contentType: "video" | "file" | "audio" | "text" | "soundcloud" | "youtube" | "form" | "live";
693
+ contentType: "video" | "document" | "audio" | "text" | "soundcloud" | "youtube" | "form" | "live" | "file";
694
694
  hideComments: boolean;
695
695
  showChat: boolean;
696
696
  createdAt?: FirebaseFirestore.Timestamp | null | undefined;
@@ -721,7 +721,7 @@ declare const ModuleWithActivities: z.ZodObject<z.objectUtil.extendShape<z.objec
721
721
  activities: {
722
722
  title: string;
723
723
  content: string;
724
- contentType: "video" | "file" | "audio" | "text" | "soundcloud" | "youtube" | "form" | "live";
724
+ contentType: "video" | "document" | "audio" | "text" | "soundcloud" | "youtube" | "form" | "live" | "file";
725
725
  id?: unknown;
726
726
  createdAt?: unknown;
727
727
  updatedAt?: unknown;
@@ -196,13 +196,14 @@ var ModuleSchema = ModelSchema.extend({
196
196
  }).merge(PreviousSchema).merge(PublishOnDate);
197
197
  var JourneyContentTypeSchema = import_zod3.z.enum([
198
198
  "video",
199
- "file",
199
+ "document",
200
200
  "audio",
201
201
  "text",
202
202
  "soundcloud",
203
203
  "youtube",
204
204
  "form",
205
- "live"
205
+ "live",
206
+ "file"
206
207
  ]);
207
208
  var ActivitySchema = ModelSchema.extend({
208
209
  title: import_zod3.z.string(),
@@ -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","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","activitiesCounter","lastNewsDate","title","description","thumbnail","expirationDate","startDate","gridButton","tag","actionToUnlock","content","buttons","settings","info","chat","openingMessageDay","closingMessageNight","chatIsEnabled","chatURLs","merge","isPrivate","isExclusive","contentType","files","url","hideComments","showChat","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;;YA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CAAA,CAAEgC,OAAA,GAAUK,OAAA,CAAQ;IAClC+B,UAAUhC,YAAApC,CAAA,CAAEgC,OAAA,GAAUK,OAAA,CAAQ;AAChC,GAAGwB,KAAA,CAAMpE;AAEF,IAAMD,uBAAuBD,aAAamC,MAAA,CAAO;IACtD2C,YAAYlF,eAAe0C,KAAA;AAC7B;ADqEA,6DAA6D;AAC7D,KAAMnC,CAAAA,OAAOC,OAAO,GAAG;IACrBR,gBAAAA;IACAC,qBAAAA;IACAC,0BAAAA;IACAC,eAAAA;IACAC,cAAAA;IACAC,sBAAAA;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 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 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}).merge(PublishOnDate);\nvar ModuleSchema = ModelSchema.extend({\n title: import_zod3.z.string(),\n isPrivate: import_zod3.z.boolean().default(true),\n isExclusive: import_zod3.z.boolean().nullish().optional()\n}).merge(PreviousSchema).merge(PublishOnDate);\nvar JourneyContentTypeSchema = import_zod3.z.enum([\"video\", \"file\", \"audio\", \"text\", \"soundcloud\", \"youtube\", \"form\", \"live\"]);\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}).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 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 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}).merge(PublishOnDate)\n\n\n\nexport const ModuleSchema = ModelSchema.extend({\n title: z.string(),\n isPrivate: z.boolean().default(true),\n isExclusive: z.boolean().nullish().optional(),\n}).merge(PreviousSchema).merge(PublishOnDate)\n\nexport const JourneyContentTypeSchema = z.enum(['video', 'file', 'audio', 'text', 'soundcloud', 'youtube', 'form', 'live'])\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}).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 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","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","activitiesCounter","lastNewsDate","title","description","thumbnail","expirationDate","startDate","gridButton","tag","actionToUnlock","content","buttons","settings","info","chat","openingMessageDay","closingMessageNight","chatIsEnabled","chatURLs","merge","isPrivate","isExclusive","contentType","files","url","hideComments","showChat","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,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AAUC,QAAA;AACrC,GAAGsD,KAAA,CAAMpC,gBAAgBoC,KAAA,CAAMpE;AAExB,IAAMJ,2BAA2B+C,YAAApC,CAAA,CAAEuC,IAAA,CAAK;IAAC;IAAS;IAAY;IAAS;IAAQ;IAAc;IAAW;IAAQ;IAAQ;CAAO;AAE/H,IAAMpD,iBAAiB+B,YAAYQ,MAAA,CAAO;IAC/CkB,OAAOR,YAAApC,CAAA,CAAEc,MAAA;IACT+B,aAAaT,YAAApC,CAAA,CAAEc,MAAA,GAASP,QAAA;IACxByD,aAAa3E;IACb+D,SAAShB,YAAApC,CAAA,CAAEc,MAAA;IACXmD,OAAO7B,YAAApC,CAAA,CAAE6B,KAAA,CAAMO,YAAApC,CAAA,CAAEmB,MAAA,CAAO;QACtBqB,OAAOJ,YAAApC,CAAA,CAAEc,MAAA,GAASP,QAAA;QAClB2D,KAAK9B,YAAApC,CAAA,CAAEc,MAAA;IACT,IAAIP,QAAA;IACJ4D,cAAc/B,YAAApC,CAAA,CAAEgC,OAAA,GAAUK,OAAA,CAAQ;IAClC+B,UAAUhC,YAAApC,CAAA,CAAEgC,OAAA,GAAUK,OAAA,CAAQ;AAChC,GAAGwB,KAAA,CAAMpE;AAEF,IAAMD,uBAAuBD,aAAamC,MAAA,CAAO;IACtD2C,YAAYlF,eAAe0C,KAAA;AAC7B;ADqEA,6DAA6D;AAC7D,KAAMnC,CAAAA,OAAOC,OAAO,GAAG;IACrBR,gBAAAA;IACAC,qBAAAA;IACAC,0BAAAA;IACAC,eAAAA;IACAC,cAAAA;IACAC,sBAAAA;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 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 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}).merge(PublishOnDate);\nvar ModuleSchema = ModelSchema.extend({\n title: import_zod3.z.string(),\n isPrivate: import_zod3.z.boolean().default(true),\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}).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 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 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}).merge(PublishOnDate)\n\n\n\nexport const ModuleSchema = ModelSchema.extend({\n title: z.string(),\n isPrivate: z.boolean().default(true),\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}).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 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"]}
@@ -111,13 +111,14 @@ var ModuleSchema = ModelSchema.extend({
111
111
  }).merge(PreviousSchema).merge(PublishOnDate);
112
112
  var JourneyContentTypeSchema = z3.enum([
113
113
  "video",
114
- "file",
114
+ "document",
115
115
  "audio",
116
116
  "text",
117
117
  "soundcloud",
118
118
  "youtube",
119
119
  "form",
120
- "live"
120
+ "live",
121
+ "file"
121
122
  ]);
122
123
  var ActivitySchema = ModelSchema.extend({
123
124
  title: z3.string(),
@@ -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","JourneySchema","activitiesCounter","lastNewsDate","title","description","thumbnail","expirationDate","startDate","gridButton","tag","actionToUnlock","content","buttons","settings","info","chat","openingMessageDay","closingMessageNight","chatIsEnabled","chatURLs","merge","ModuleSchema","isPrivate","isExclusive","JourneyContentTypeSchema","ActivitySchema","contentType","files","url","hideComments","showChat","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,iBAAi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,GAAEa,MAAA;IACTkC,aAAa/C,GAAEa,MAAA,GAASL,QAAA;IACxB6D,aAAaF;IACbb,SAAStD,GAAEa,MAAA;IACXyD,OAAOtE,GAAE4B,KAAA,CAAM5B,GAAEkB,MAAA,CAAO;QACtBsB,OAAOxC,GAAEa,MAAA,GAASL,QAAA;QAClB+D,KAAKvE,GAAEa,MAAA;IACT,IAAIL,QAAA;IACJgE,cAAcxE,GAAE+B,OAAA,GAAUK,OAAA,CAAQ;IAClCqC,UAAUzE,GAAE+B,OAAA,GAAUK,OAAA,CAAQ;AAChC,GAAG2B,KAAA,CAAM/B;AAEF,IAAM0C,uBAAuBV,aAAavC,MAAA,CAAO;IACtDkD,YAAYP,eAAexC,KAAA;AAC7B;AH2BA,SACEwC,cAAc,EACd/B,mBAAmB,EACnB8B,wBAAwB,EACxBxB,aAAa,EACbqB,YAAY,EACZU,oBAAoB,EACpB1C,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 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}).merge(PublishOnDate);\nvar ModuleSchema = ModelSchema.extend({\n title: z3.string(),\n isPrivate: z3.boolean().default(true),\n isExclusive: z3.boolean().nullish().optional()\n}).merge(PreviousSchema).merge(PublishOnDate);\nvar JourneyContentTypeSchema = z3.enum([\"video\", \"file\", \"audio\", \"text\", \"soundcloud\", \"youtube\", \"form\", \"live\"]);\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}).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 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 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}).merge(PublishOnDate)\n\n\n\nexport const ModuleSchema = ModelSchema.extend({\n title: z.string(),\n isPrivate: z.boolean().default(true),\n isExclusive: z.boolean().nullish().optional(),\n}).merge(PreviousSchema).merge(PublishOnDate)\n\nexport const JourneyContentTypeSchema = z.enum(['video', 'file', 'audio', 'text', 'soundcloud', 'youtube', 'form', 'live'])\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}).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 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","JourneySchema","activitiesCounter","lastNewsDate","title","description","thumbnail","expirationDate","startDate","gridButton","tag","actionToUnlock","content","buttons","settings","info","chat","openingMessageDay","closingMessageNight","chatIsEnabled","chatURLs","merge","ModuleSchema","isPrivate","isExclusive","JourneyContentTypeSchema","ActivitySchema","contentType","files","url","hideComments","showChat","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,iB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A,GAAUK,OAAA,CAAQ;IAC/B8B,aAAalE,GAAE+B,OAAA,GAAUxB,OAAA,GAAUC,QAAA;AACrC,GAAGuD,KAAA,CAAMvC,gBAAgBuC,KAAA,CAAM/B;AAExB,IAAMmC,2BAA2BnE,GAAEuC,IAAA,CAAK;IAAC;IAAS;IAAY;IAAS;IAAQ;IAAc;IAAW;IAAQ;IAAQ;CAAO;AAE/H,IAAM6B,iBAAiBnD,YAAYQ,MAAA,CAAO;IAC/CqB,OAAO9C,GAAEa,MAAA;IACTkC,aAAa/C,GAAEa,MAAA,GAASL,QAAA;IACxB6D,aAAaF;IACbb,SAAStD,GAAEa,MAAA;IACXyD,OAAOtE,GAAE4B,KAAA,CAAM5B,GAAEkB,MAAA,CAAO;QACtBsB,OAAOxC,GAAEa,MAAA,GAASL,QAAA;QAClB+D,KAAKvE,GAAEa,MAAA;IACT,IAAIL,QAAA;IACJgE,cAAcxE,GAAE+B,OAAA,GAAUK,OAAA,CAAQ;IAClCqC,UAAUzE,GAAE+B,OAAA,GAAUK,OAAA,CAAQ;AAChC,GAAG2B,KAAA,CAAM/B;AAEF,IAAM0C,uBAAuBV,aAAavC,MAAA,CAAO;IACtDkD,YAAYP,eAAexC,KAAA;AAC7B;AH2BA,SACEwC,cAAc,EACd/B,mBAAmB,EACnB8B,wBAAwB,EACxBxB,aAAa,EACbqB,YAAY,EACZU,oBAAoB,EACpB1C,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 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}).merge(PublishOnDate);\nvar ModuleSchema = ModelSchema.extend({\n title: z3.string(),\n isPrivate: z3.boolean().default(true),\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}).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 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 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}).merge(PublishOnDate)\n\n\n\nexport const ModuleSchema = ModelSchema.extend({\n title: z.string(),\n isPrivate: z.boolean().default(true),\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}).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 ModuleWithActivities = z.infer<typeof ModuleWithActivities>\nexport type Activity = z.infer<typeof ActivitySchema>\nexport type JourneyContentType = z.infer<typeof JourneyContentTypeSchema>\n"]}
@@ -58,10 +58,10 @@ declare const FromDetailSchema: z.ZodObject<z.objectUtil.extendShape<{
58
58
  economic_activity_code: z.ZodAny;
59
59
  }>, "strip", z.ZodTypeAny, {
60
60
  id: string | number;
61
+ document: string;
61
62
  email: string;
62
63
  name: string;
63
64
  phone: string;
64
- document: string;
65
65
  postal_code: string;
66
66
  address: string;
67
67
  location_number: string;
@@ -80,10 +80,10 @@ declare const FromDetailSchema: z.ZodObject<z.objectUtil.extendShape<{
80
80
  note?: any;
81
81
  economic_activity_code?: any;
82
82
  }, {
83
+ document: string;
83
84
  email: string;
84
85
  name: string;
85
86
  phone: string;
86
- document: string;
87
87
  postal_code: string;
88
88
  address: string;
89
89
  location_number: string;
@@ -129,10 +129,10 @@ declare const ToDetailSchema: z.ZodObject<z.objectUtil.extendShape<{
129
129
  economic_activity_code: z.ZodAny;
130
130
  }>, "strip", z.ZodTypeAny, {
131
131
  id: string | number;
132
+ document: string;
132
133
  email: string;
133
134
  name: string;
134
135
  phone: string;
135
- document: string;
136
136
  postal_code: string;
137
137
  address: string;
138
138
  location_number: string;
@@ -151,10 +151,10 @@ declare const ToDetailSchema: z.ZodObject<z.objectUtil.extendShape<{
151
151
  note?: any;
152
152
  economic_activity_code?: any;
153
153
  }, {
154
+ document: string;
154
155
  email: string;
155
156
  name: string;
156
157
  phone: string;
157
- document: string;
158
158
  postal_code: string;
159
159
  address: string;
160
160
  location_number: string;
@@ -451,10 +451,10 @@ declare const MelhorEnvioOrderSchema: z.ZodObject<z.objectUtil.extendShape<{
451
451
  economic_activity_code: z.ZodAny;
452
452
  }>, "strip", z.ZodTypeAny, {
453
453
  id: string | number;
454
+ document: string;
454
455
  email: string;
455
456
  name: string;
456
457
  phone: string;
457
- document: string;
458
458
  postal_code: string;
459
459
  address: string;
460
460
  location_number: string;
@@ -473,10 +473,10 @@ declare const MelhorEnvioOrderSchema: z.ZodObject<z.objectUtil.extendShape<{
473
473
  note?: any;
474
474
  economic_activity_code?: any;
475
475
  }, {
476
+ document: string;
476
477
  email: string;
477
478
  name: string;
478
479
  phone: string;
479
- document: string;
480
480
  postal_code: string;
481
481
  address: string;
482
482
  location_number: string;
@@ -522,10 +522,10 @@ declare const MelhorEnvioOrderSchema: z.ZodObject<z.objectUtil.extendShape<{
522
522
  economic_activity_code: z.ZodAny;
523
523
  }>, "strip", z.ZodTypeAny, {
524
524
  id: string | number;
525
+ document: string;
525
526
  email: string;
526
527
  name: string;
527
528
  phone: string;
528
- document: string;
529
529
  postal_code: string;
530
530
  address: string;
531
531
  location_number: string;
@@ -544,10 +544,10 @@ declare const MelhorEnvioOrderSchema: z.ZodObject<z.objectUtil.extendShape<{
544
544
  note?: any;
545
545
  economic_activity_code?: any;
546
546
  }, {
547
+ document: string;
547
548
  email: string;
548
549
  name: string;
549
550
  phone: string;
550
- document: string;
551
551
  postal_code: string;
552
552
  address: string;
553
553
  location_number: string;
@@ -784,10 +784,10 @@ declare const MelhorEnvioOrderSchema: z.ZodObject<z.objectUtil.extendShape<{
784
784
  is_show_correios_reverse_ppn_action: boolean;
785
785
  from: {
786
786
  id: string | number;
787
+ document: string;
787
788
  email: string;
788
789
  name: string;
789
790
  phone: string;
790
- document: string;
791
791
  postal_code: string;
792
792
  address: string;
793
793
  location_number: string;
@@ -808,10 +808,10 @@ declare const MelhorEnvioOrderSchema: z.ZodObject<z.objectUtil.extendShape<{
808
808
  };
809
809
  to: {
810
810
  id: string | number;
811
+ document: string;
811
812
  email: string;
812
813
  name: string;
813
814
  phone: string;
814
- document: string;
815
815
  postal_code: string;
816
816
  address: string;
817
817
  location_number: string;
@@ -939,10 +939,10 @@ declare const MelhorEnvioOrderSchema: z.ZodObject<z.objectUtil.extendShape<{
939
939
  is_show_eticket_action: boolean;
940
940
  is_show_correios_reverse_ppn_action: boolean;
941
941
  from: {
942
+ document: string;
942
943
  email: string;
943
944
  name: string;
944
945
  phone: string;
945
- document: string;
946
946
  postal_code: string;
947
947
  address: string;
948
948
  location_number: string;
@@ -963,10 +963,10 @@ declare const MelhorEnvioOrderSchema: z.ZodObject<z.objectUtil.extendShape<{
963
963
  economic_activity_code?: any;
964
964
  };
965
965
  to: {
966
+ document: string;
966
967
  email: string;
967
968
  name: string;
968
969
  phone: string;
969
- document: string;
970
970
  postal_code: string;
971
971
  address: string;
972
972
  location_number: string;
@@ -58,10 +58,10 @@ declare const FromDetailSchema: z.ZodObject<z.objectUtil.extendShape<{
58
58
  economic_activity_code: z.ZodAny;
59
59
  }>, "strip", z.ZodTypeAny, {
60
60
  id: string | number;
61
+ document: string;
61
62
  email: string;
62
63
  name: string;
63
64
  phone: string;
64
- document: string;
65
65
  postal_code: string;
66
66
  address: string;
67
67
  location_number: string;
@@ -80,10 +80,10 @@ declare const FromDetailSchema: z.ZodObject<z.objectUtil.extendShape<{
80
80
  note?: any;
81
81
  economic_activity_code?: any;
82
82
  }, {
83
+ document: string;
83
84
  email: string;
84
85
  name: string;
85
86
  phone: string;
86
- document: string;
87
87
  postal_code: string;
88
88
  address: string;
89
89
  location_number: string;
@@ -129,10 +129,10 @@ declare const ToDetailSchema: z.ZodObject<z.objectUtil.extendShape<{
129
129
  economic_activity_code: z.ZodAny;
130
130
  }>, "strip", z.ZodTypeAny, {
131
131
  id: string | number;
132
+ document: string;
132
133
  email: string;
133
134
  name: string;
134
135
  phone: string;
135
- document: string;
136
136
  postal_code: string;
137
137
  address: string;
138
138
  location_number: string;
@@ -151,10 +151,10 @@ declare const ToDetailSchema: z.ZodObject<z.objectUtil.extendShape<{
151
151
  note?: any;
152
152
  economic_activity_code?: any;
153
153
  }, {
154
+ document: string;
154
155
  email: string;
155
156
  name: string;
156
157
  phone: string;
157
- document: string;
158
158
  postal_code: string;
159
159
  address: string;
160
160
  location_number: string;
@@ -451,10 +451,10 @@ declare const MelhorEnvioOrderSchema: z.ZodObject<z.objectUtil.extendShape<{
451
451
  economic_activity_code: z.ZodAny;
452
452
  }>, "strip", z.ZodTypeAny, {
453
453
  id: string | number;
454
+ document: string;
454
455
  email: string;
455
456
  name: string;
456
457
  phone: string;
457
- document: string;
458
458
  postal_code: string;
459
459
  address: string;
460
460
  location_number: string;
@@ -473,10 +473,10 @@ declare const MelhorEnvioOrderSchema: z.ZodObject<z.objectUtil.extendShape<{
473
473
  note?: any;
474
474
  economic_activity_code?: any;
475
475
  }, {
476
+ document: string;
476
477
  email: string;
477
478
  name: string;
478
479
  phone: string;
479
- document: string;
480
480
  postal_code: string;
481
481
  address: string;
482
482
  location_number: string;
@@ -522,10 +522,10 @@ declare const MelhorEnvioOrderSchema: z.ZodObject<z.objectUtil.extendShape<{
522
522
  economic_activity_code: z.ZodAny;
523
523
  }>, "strip", z.ZodTypeAny, {
524
524
  id: string | number;
525
+ document: string;
525
526
  email: string;
526
527
  name: string;
527
528
  phone: string;
528
- document: string;
529
529
  postal_code: string;
530
530
  address: string;
531
531
  location_number: string;
@@ -544,10 +544,10 @@ declare const MelhorEnvioOrderSchema: z.ZodObject<z.objectUtil.extendShape<{
544
544
  note?: any;
545
545
  economic_activity_code?: any;
546
546
  }, {
547
+ document: string;
547
548
  email: string;
548
549
  name: string;
549
550
  phone: string;
550
- document: string;
551
551
  postal_code: string;
552
552
  address: string;
553
553
  location_number: string;
@@ -784,10 +784,10 @@ declare const MelhorEnvioOrderSchema: z.ZodObject<z.objectUtil.extendShape<{
784
784
  is_show_correios_reverse_ppn_action: boolean;
785
785
  from: {
786
786
  id: string | number;
787
+ document: string;
787
788
  email: string;
788
789
  name: string;
789
790
  phone: string;
790
- document: string;
791
791
  postal_code: string;
792
792
  address: string;
793
793
  location_number: string;
@@ -808,10 +808,10 @@ declare const MelhorEnvioOrderSchema: z.ZodObject<z.objectUtil.extendShape<{
808
808
  };
809
809
  to: {
810
810
  id: string | number;
811
+ document: string;
811
812
  email: string;
812
813
  name: string;
813
814
  phone: string;
814
- document: string;
815
815
  postal_code: string;
816
816
  address: string;
817
817
  location_number: string;
@@ -939,10 +939,10 @@ declare const MelhorEnvioOrderSchema: z.ZodObject<z.objectUtil.extendShape<{
939
939
  is_show_eticket_action: boolean;
940
940
  is_show_correios_reverse_ppn_action: boolean;
941
941
  from: {
942
+ document: string;
942
943
  email: string;
943
944
  name: string;
944
945
  phone: string;
945
- document: string;
946
946
  postal_code: string;
947
947
  address: string;
948
948
  location_number: string;
@@ -963,10 +963,10 @@ declare const MelhorEnvioOrderSchema: z.ZodObject<z.objectUtil.extendShape<{
963
963
  economic_activity_code?: any;
964
964
  };
965
965
  to: {
966
+ document: string;
966
967
  email: string;
967
968
  name: string;
968
969
  phone: string;
969
- document: string;
970
970
  postal_code: string;
971
971
  address: string;
972
972
  location_number: string;
@@ -161,13 +161,14 @@ var ModuleSchema = ModelSchema.extend({
161
161
  }).merge(PreviousSchema).merge(PublishOnDate);
162
162
  var JourneyContentTypeSchema = import_zod3.z.enum([
163
163
  "video",
164
- "file",
164
+ "document",
165
165
  "audio",
166
166
  "text",
167
167
  "soundcloud",
168
168
  "youtube",
169
169
  "form",
170
- "live"
170
+ "live",
171
+ "file"
171
172
  ]);
172
173
  var ActivitySchema = ModelSchema.extend({
173
174
  title: import_zod3.z.string(),
@@ -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","JourneySchema","activitiesCounter","lastNewsDate","title","description","thumbnail","expirationDate","startDate","gridButton","tag","actionToUnlock","content","buttons","settings","info","chat","openingMessageDay","closingMessageNight","chatIsEnabled","chatURLs","merge","ModuleSchema","isPrivate","isExclusive","JourneyContentTypeSchema","ActivitySchema","contentType","files","url","hideComments","showChat","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,I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C,YAAArC,CAAA,CAAEgC,OAAA,GAAUM,OAAA,CAAQ;AAChC,GAAG0B,KAAA,CAAM/B;AAEF,IAAM0C,uBAAuBV,aAAavC,MAAA,CAAO;IACtDkD,YAAYP,eAAexC,KAAA;AAC7B;AJuDA,4BAA4B;AAC3B,CAAA,GCvIDlC,eAAAkF,QAAA,EAAS,iBAAiB;IACxB,CAAA,GAAAlF,eAAAmF,IAAA,EAAK,2BAA2B;QAE9B,IAAMC,IAAI;YACRhC,OAAO;YACPuB,aAAa;YACbf,SAAS;QACX;QAEA,IAAMyB,WAAWX,eAAeY,KAAA,CAAMF;QACtC,CAAA,GAAApF,eAAAuF,MAAA,EAAOH,GAAGI,WAAA;QACV,CAAA,GAAAxF,eAAAuF,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 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}).merge(PublishOnDate);\nvar ModuleSchema = ModelSchema.extend({\n title: import_zod3.z.string(),\n isPrivate: import_zod3.z.boolean().default(true),\n isExclusive: import_zod3.z.boolean().nullish().optional()\n}).merge(PreviousSchema).merge(PublishOnDate);\nvar JourneyContentTypeSchema = import_zod3.z.enum([\"video\", \"file\", \"audio\", \"text\", \"soundcloud\", \"youtube\", \"form\", \"live\"]);\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}).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 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}).merge(PublishOnDate)\n\n\n\nexport const ModuleSchema = ModelSchema.extend({\n title: z.string(),\n isPrivate: z.boolean().default(true),\n isExclusive: z.boolean().nullish().optional(),\n}).merge(PreviousSchema).merge(PublishOnDate)\n\nexport const JourneyContentTypeSchema = z.enum(['video', 'file', 'audio', 'text', 'soundcloud', 'youtube', 'form', 'live'])\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}).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 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","JourneySchema","activitiesCounter","lastNewsDate","title","description","thumbnail","expirationDate","startDate","gridButton","tag","actionToUnlock","content","buttons","settings","info","chat","openingMessageDay","closingMessageNight","chatIsEnabled","chatURLs","merge","ModuleSchema","isPrivate","isExclusive","JourneyContentTypeSchema","ActivitySchema","contentType","files","url","hideComments","showChat","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,OAAO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D,OAAOlC,YAAArC,CAAA,CAAE6B,KAAA,CAAMQ,YAAArC,CAAA,CAAEmB,MAAA,CAAO;QACtBuB,OAAOL,YAAArC,CAAA,CAAEc,MAAA,GAASP,QAAA;QAClBiE,KAAKnC,YAAArC,CAAA,CAAEc,MAAA;IACT,IAAIP,QAAA;IACJkE,cAAcpC,YAAArC,CAAA,CAAEgC,OAAA,GAAUM,OAAA,CAAQ;IAClCoC,UAAUrC,YAAArC,CAAA,CAAEgC,OAAA,GAAUM,OAAA,CAAQ;AAChC,GAAG0B,KAAA,CAAM/B;AAEF,IAAM0C,uBAAuBV,aAAavC,MAAA,CAAO;IACtDkD,YAAYP,eAAexC,KAAA;AAC7B;AJuDA,4BAA4B;AAC3B,CAAA,GCvIDlC,eAAAkF,QAAA,EAAS,iBAAiB;IACxB,CAAA,GAAAlF,eAAAmF,IAAA,EAAK,2BAA2B;QAE9B,IAAMC,IAAI;YACRhC,OAAO;YACPuB,aAAa;YACbf,SAAS;QACX;QAEA,IAAMyB,WAAWX,eAAeY,KAAA,CAAMF;QACtC,CAAA,GAAApF,eAAAuF,MAAA,EAAOH,GAAGI,WAAA;QACV,CAAA,GAAAxF,eAAAuF,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 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}).merge(PublishOnDate);\nvar ModuleSchema = ModelSchema.extend({\n title: import_zod3.z.string(),\n isPrivate: import_zod3.z.boolean().default(true),\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}).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 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}).merge(PublishOnDate)\n\n\n\nexport const ModuleSchema = ModelSchema.extend({\n title: z.string(),\n isPrivate: z.boolean().default(true),\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}).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 ModuleWithActivities = z.infer<typeof ModuleWithActivities>\nexport type Activity = z.infer<typeof ActivitySchema>\nexport type JourneyContentType = z.infer<typeof JourneyContentTypeSchema>\n"]}
@@ -113,13 +113,14 @@ var ModuleSchema = ModelSchema.extend({
113
113
  }).merge(PreviousSchema).merge(PublishOnDate);
114
114
  var JourneyContentTypeSchema = z3.enum([
115
115
  "video",
116
- "file",
116
+ "document",
117
117
  "audio",
118
118
  "text",
119
119
  "soundcloud",
120
120
  "youtube",
121
121
  "form",
122
- "live"
122
+ "live",
123
+ "file"
123
124
  ]);
124
125
  var ActivitySchema = ModelSchema.extend({
125
126
  title: z3.string(),
@@ -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","JourneySchema","activitiesCounter","lastNewsDate","title","description","thumbnail","expirationDate","startDate","gridButton","tag","actionToUnlock","content","buttons","settings","info","chat","openingMessageDay","closingMessageNight","chatIsEnabled","chatURLs","merge","ModuleSchema","isPrivate","isExclusive","JourneyContentTypeSchema","ActivitySchema","contentType","files","url","hideComments","showChat","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,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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AAEa,MAAA,GAASL,QAAA;QAClB+D,KAAKvE,GAAEa,MAAA;IACT,IAAIL,QAAA;IACJgE,cAAcxE,GAAE+B,OAAA,GAAUK,OAAA,CAAQ;IAClCqC,UAAUzE,GAAE+B,OAAA,GAAUK,OAAA,CAAQ;AAChC,GAAG2B,KAAA,CAAM/B;AAEF,IAAM0C,uBAAuBV,aAAavC,MAAA,CAAO;IACtDkD,YAAYP,eAAexC,KAAA;AAC7B;AJ+BA,4BAA4B;AC9G5B/B,SAAS,iBAAiB;IACxBE,KAAK,2BAA2B;QAE9B,IAAM6E,IAAI;YACR9B,OAAO;YACPuB,aAAa;YACbf,SAAS;QACX;QAEA,IAAMuB,WAAWT,eAAeU,KAAA,CAAMF;QACtC9E,OAAO8E,GAAGG,WAAA;QACVjF,OAAO+E,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 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}).merge(PublishOnDate);\nvar ModuleSchema = ModelSchema.extend({\n title: z3.string(),\n isPrivate: z3.boolean().default(true),\n isExclusive: z3.boolean().nullish().optional()\n}).merge(PreviousSchema).merge(PublishOnDate);\nvar JourneyContentTypeSchema = z3.enum([\"video\", \"file\", \"audio\", \"text\", \"soundcloud\", \"youtube\", \"form\", \"live\"]);\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}).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 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}).merge(PublishOnDate)\n\n\n\nexport const ModuleSchema = ModelSchema.extend({\n title: z.string(),\n isPrivate: z.boolean().default(true),\n isExclusive: z.boolean().nullish().optional(),\n}).merge(PreviousSchema).merge(PublishOnDate)\n\nexport const JourneyContentTypeSchema = z.enum(['video', 'file', 'audio', 'text', 'soundcloud', 'youtube', 'form', 'live'])\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}).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 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","JourneySchema","activitiesCounter","lastNewsDate","title","description","thumbnail","expirationDate","startDate","gridButton","tag","actionToUnlock","content","buttons","settings","info","chat","openingMessageDay","closingMessageNight","chatIsEnabled","chatURLs","merge","ModuleSchema","isPrivate","isExclusive","JourneyContentTypeSchema","ActivitySchema","contentType","files","url","hideComments","showChat","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,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;YACR9B,OAAO;YACPuB,aAAa;YACbf,SAAS;QACX;QAEA,IAAMuB,WAAWT,eAAeU,KAAA,CAAMF;QACtC9E,OAAO8E,GAAGG,WAAA;QACVjF,OAAO+E,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 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}).merge(PublishOnDate);\nvar ModuleSchema = ModelSchema.extend({\n title: z3.string(),\n isPrivate: z3.boolean().default(true),\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}).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 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}).merge(PublishOnDate)\n\n\n\nexport const ModuleSchema = ModelSchema.extend({\n title: z.string(),\n isPrivate: z.boolean().default(true),\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}).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 ModuleWithActivities = z.infer<typeof ModuleWithActivities>\nexport type Activity = z.infer<typeof ActivitySchema>\nexport type JourneyContentType = z.infer<typeof JourneyContentTypeSchema>\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@_henriquewilson/gabirubi-domain",
3
- "version": "1.3.20",
3
+ "version": "1.3.22",
4
4
  "description": "gabirubi domain",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",