hububb-saas-shared 1.0.70 → 1.0.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/schemas/thread/index.d.ts +48 -49
- package/dist/schemas/thread/index.js +10 -44
- package/package.json +1 -1
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import * as admin from "firebase-admin";
|
|
3
2
|
export declare const ChatMessageTypeSchema: z.ZodUnion<[z.ZodLiteral<"message">, z.ZodLiteral<"note">, z.ZodLiteral<"whatsapp-message">]>;
|
|
4
3
|
export declare const ChatMessageSchema: z.ZodObject<{
|
|
5
4
|
id: z.ZodString;
|
|
6
|
-
createdAt: z.ZodType<
|
|
5
|
+
createdAt: z.ZodType<import("../../helpers").Timestamp, z.ZodTypeDef, import("../../helpers").Timestamp>;
|
|
7
6
|
threadId: z.ZodString;
|
|
8
7
|
authorId: z.ZodString;
|
|
9
8
|
author: z.ZodOptional<z.ZodObject<{
|
|
@@ -57,8 +56,8 @@ export declare const ChatMessageSchema: z.ZodObject<{
|
|
|
57
56
|
}>>;
|
|
58
57
|
contentType: z.ZodString;
|
|
59
58
|
body: z.ZodString;
|
|
60
|
-
seen: z.ZodRecord<z.ZodString, z.ZodType<
|
|
61
|
-
lastSeen: z.ZodOptional<z.ZodType<
|
|
59
|
+
seen: z.ZodRecord<z.ZodString, z.ZodType<import("../../helpers").Timestamp, z.ZodTypeDef, import("../../helpers").Timestamp>>;
|
|
60
|
+
lastSeen: z.ZodOptional<z.ZodType<import("../../helpers").Timestamp, z.ZodTypeDef, import("../../helpers").Timestamp>>;
|
|
62
61
|
source: z.ZodOptional<z.ZodString>;
|
|
63
62
|
externalMessageId: z.ZodOptional<z.ZodString>;
|
|
64
63
|
attachments: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -66,11 +65,11 @@ export declare const ChatMessageSchema: z.ZodObject<{
|
|
|
66
65
|
}, "strip", z.ZodTypeAny, {
|
|
67
66
|
id: string;
|
|
68
67
|
body: string;
|
|
69
|
-
createdAt:
|
|
68
|
+
createdAt: import("../../helpers").Timestamp;
|
|
70
69
|
threadId: string;
|
|
71
|
-
contentType: string;
|
|
72
70
|
authorId: string;
|
|
73
|
-
|
|
71
|
+
contentType: string;
|
|
72
|
+
seen: Record<string, import("../../helpers").Timestamp>;
|
|
74
73
|
type?: "message" | "note" | "whatsapp-message" | undefined;
|
|
75
74
|
source?: string | undefined;
|
|
76
75
|
attachments?: string[] | undefined;
|
|
@@ -91,16 +90,16 @@ export declare const ChatMessageSchema: z.ZodObject<{
|
|
|
91
90
|
photoUrl?: string | undefined;
|
|
92
91
|
stripeCustomerId?: string | undefined;
|
|
93
92
|
} | undefined;
|
|
94
|
-
lastSeen?:
|
|
93
|
+
lastSeen?: import("../../helpers").Timestamp | undefined;
|
|
95
94
|
externalMessageId?: string | undefined;
|
|
96
95
|
}, {
|
|
97
96
|
id: string;
|
|
98
97
|
body: string;
|
|
99
|
-
createdAt:
|
|
98
|
+
createdAt: import("../../helpers").Timestamp;
|
|
100
99
|
threadId: string;
|
|
101
|
-
contentType: string;
|
|
102
100
|
authorId: string;
|
|
103
|
-
|
|
101
|
+
contentType: string;
|
|
102
|
+
seen: Record<string, import("../../helpers").Timestamp>;
|
|
104
103
|
type?: "message" | "note" | "whatsapp-message" | undefined;
|
|
105
104
|
source?: string | undefined;
|
|
106
105
|
attachments?: string[] | undefined;
|
|
@@ -121,16 +120,16 @@ export declare const ChatMessageSchema: z.ZodObject<{
|
|
|
121
120
|
photoUrl?: string | undefined;
|
|
122
121
|
stripeCustomerId?: string | undefined;
|
|
123
122
|
} | undefined;
|
|
124
|
-
lastSeen?:
|
|
123
|
+
lastSeen?: import("../../helpers").Timestamp | undefined;
|
|
125
124
|
externalMessageId?: string | undefined;
|
|
126
125
|
}>;
|
|
127
126
|
export declare const ChatThreadSchema: z.ZodObject<{
|
|
128
127
|
id: z.ZodOptional<z.ZodString>;
|
|
129
|
-
createdAt: z.ZodType<
|
|
130
|
-
updatedAt: z.ZodType<
|
|
128
|
+
createdAt: z.ZodType<import("../../helpers").Timestamp, z.ZodTypeDef, import("../../helpers").Timestamp>;
|
|
129
|
+
updatedAt: z.ZodType<import("../../helpers").Timestamp, z.ZodTypeDef, import("../../helpers").Timestamp>;
|
|
131
130
|
lastMessage: z.ZodOptional<z.ZodObject<{
|
|
132
131
|
id: z.ZodString;
|
|
133
|
-
createdAt: z.ZodType<
|
|
132
|
+
createdAt: z.ZodType<import("../../helpers").Timestamp, z.ZodTypeDef, import("../../helpers").Timestamp>;
|
|
134
133
|
threadId: z.ZodString;
|
|
135
134
|
authorId: z.ZodString;
|
|
136
135
|
author: z.ZodOptional<z.ZodObject<{
|
|
@@ -184,8 +183,8 @@ export declare const ChatThreadSchema: z.ZodObject<{
|
|
|
184
183
|
}>>;
|
|
185
184
|
contentType: z.ZodString;
|
|
186
185
|
body: z.ZodString;
|
|
187
|
-
seen: z.ZodRecord<z.ZodString, z.ZodType<
|
|
188
|
-
lastSeen: z.ZodOptional<z.ZodType<
|
|
186
|
+
seen: z.ZodRecord<z.ZodString, z.ZodType<import("../../helpers").Timestamp, z.ZodTypeDef, import("../../helpers").Timestamp>>;
|
|
187
|
+
lastSeen: z.ZodOptional<z.ZodType<import("../../helpers").Timestamp, z.ZodTypeDef, import("../../helpers").Timestamp>>;
|
|
189
188
|
source: z.ZodOptional<z.ZodString>;
|
|
190
189
|
externalMessageId: z.ZodOptional<z.ZodString>;
|
|
191
190
|
attachments: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -193,11 +192,11 @@ export declare const ChatThreadSchema: z.ZodObject<{
|
|
|
193
192
|
}, "strip", z.ZodTypeAny, {
|
|
194
193
|
id: string;
|
|
195
194
|
body: string;
|
|
196
|
-
createdAt:
|
|
195
|
+
createdAt: import("../../helpers").Timestamp;
|
|
197
196
|
threadId: string;
|
|
198
|
-
contentType: string;
|
|
199
197
|
authorId: string;
|
|
200
|
-
|
|
198
|
+
contentType: string;
|
|
199
|
+
seen: Record<string, import("../../helpers").Timestamp>;
|
|
201
200
|
type?: "message" | "note" | "whatsapp-message" | undefined;
|
|
202
201
|
source?: string | undefined;
|
|
203
202
|
attachments?: string[] | undefined;
|
|
@@ -218,16 +217,16 @@ export declare const ChatThreadSchema: z.ZodObject<{
|
|
|
218
217
|
photoUrl?: string | undefined;
|
|
219
218
|
stripeCustomerId?: string | undefined;
|
|
220
219
|
} | undefined;
|
|
221
|
-
lastSeen?:
|
|
220
|
+
lastSeen?: import("../../helpers").Timestamp | undefined;
|
|
222
221
|
externalMessageId?: string | undefined;
|
|
223
222
|
}, {
|
|
224
223
|
id: string;
|
|
225
224
|
body: string;
|
|
226
|
-
createdAt:
|
|
225
|
+
createdAt: import("../../helpers").Timestamp;
|
|
227
226
|
threadId: string;
|
|
228
|
-
contentType: string;
|
|
229
227
|
authorId: string;
|
|
230
|
-
|
|
228
|
+
contentType: string;
|
|
229
|
+
seen: Record<string, import("../../helpers").Timestamp>;
|
|
231
230
|
type?: "message" | "note" | "whatsapp-message" | undefined;
|
|
232
231
|
source?: string | undefined;
|
|
233
232
|
attachments?: string[] | undefined;
|
|
@@ -248,7 +247,7 @@ export declare const ChatThreadSchema: z.ZodObject<{
|
|
|
248
247
|
photoUrl?: string | undefined;
|
|
249
248
|
stripeCustomerId?: string | undefined;
|
|
250
249
|
} | undefined;
|
|
251
|
-
lastSeen?:
|
|
250
|
+
lastSeen?: import("../../helpers").Timestamp | undefined;
|
|
252
251
|
externalMessageId?: string | undefined;
|
|
253
252
|
}>>;
|
|
254
253
|
participantIds: z.ZodArray<z.ZodString, "many">;
|
|
@@ -306,7 +305,7 @@ export declare const ChatThreadSchema: z.ZodObject<{
|
|
|
306
305
|
externalThreadId: z.ZodOptional<z.ZodString>;
|
|
307
306
|
externalSource: z.ZodOptional<z.ZodString>;
|
|
308
307
|
title: z.ZodOptional<z.ZodString>;
|
|
309
|
-
seenBy: z.ZodRecord<z.ZodString, z.ZodType<
|
|
308
|
+
seenBy: z.ZodRecord<z.ZodString, z.ZodType<import("../../helpers").Timestamp, z.ZodTypeDef, import("../../helpers").Timestamp>>;
|
|
310
309
|
isImportant: z.ZodOptional<z.ZodBoolean>;
|
|
311
310
|
needsAttention: z.ZodArray<z.ZodString, "many">;
|
|
312
311
|
needsAttentionMap: z.ZodRecord<z.ZodString, z.ZodBoolean>;
|
|
@@ -481,13 +480,13 @@ export declare const ChatThreadSchema: z.ZodObject<{
|
|
|
481
480
|
isInquiryThread: z.ZodOptional<z.ZodBoolean>;
|
|
482
481
|
whatsappTemplateSent: z.ZodOptional<z.ZodBoolean>;
|
|
483
482
|
whatsappUserReplied: z.ZodOptional<z.ZodBoolean>;
|
|
484
|
-
lastWhatsappMessageSentAt: z.ZodOptional<z.ZodType<
|
|
483
|
+
lastWhatsappMessageSentAt: z.ZodOptional<z.ZodType<import("../../helpers").Timestamp, z.ZodTypeDef, import("../../helpers").Timestamp>>;
|
|
485
484
|
}, "strip", z.ZodTypeAny, {
|
|
486
485
|
type: "ONE_TO_ONE" | "GROUP";
|
|
487
|
-
createdAt:
|
|
488
|
-
updatedAt:
|
|
486
|
+
createdAt: import("../../helpers").Timestamp;
|
|
487
|
+
updatedAt: import("../../helpers").Timestamp;
|
|
489
488
|
participantIds: string[];
|
|
490
|
-
seenBy: Record<string,
|
|
489
|
+
seenBy: Record<string, import("../../helpers").Timestamp>;
|
|
491
490
|
needsAttention: string[];
|
|
492
491
|
needsAttentionMap: Record<string, boolean>;
|
|
493
492
|
id?: string | undefined;
|
|
@@ -497,11 +496,11 @@ export declare const ChatThreadSchema: z.ZodObject<{
|
|
|
497
496
|
lastMessage?: {
|
|
498
497
|
id: string;
|
|
499
498
|
body: string;
|
|
500
|
-
createdAt:
|
|
499
|
+
createdAt: import("../../helpers").Timestamp;
|
|
501
500
|
threadId: string;
|
|
502
|
-
contentType: string;
|
|
503
501
|
authorId: string;
|
|
504
|
-
|
|
502
|
+
contentType: string;
|
|
503
|
+
seen: Record<string, import("../../helpers").Timestamp>;
|
|
505
504
|
type?: "message" | "note" | "whatsapp-message" | undefined;
|
|
506
505
|
source?: string | undefined;
|
|
507
506
|
attachments?: string[] | undefined;
|
|
@@ -522,7 +521,7 @@ export declare const ChatThreadSchema: z.ZodObject<{
|
|
|
522
521
|
photoUrl?: string | undefined;
|
|
523
522
|
stripeCustomerId?: string | undefined;
|
|
524
523
|
} | undefined;
|
|
525
|
-
lastSeen?:
|
|
524
|
+
lastSeen?: import("../../helpers").Timestamp | undefined;
|
|
526
525
|
externalMessageId?: string | undefined;
|
|
527
526
|
} | undefined;
|
|
528
527
|
participants?: {
|
|
@@ -583,13 +582,13 @@ export declare const ChatThreadSchema: z.ZodObject<{
|
|
|
583
582
|
isInquiryThread?: boolean | undefined;
|
|
584
583
|
whatsappTemplateSent?: boolean | undefined;
|
|
585
584
|
whatsappUserReplied?: boolean | undefined;
|
|
586
|
-
lastWhatsappMessageSentAt?:
|
|
585
|
+
lastWhatsappMessageSentAt?: import("../../helpers").Timestamp | undefined;
|
|
587
586
|
}, {
|
|
588
587
|
type: "ONE_TO_ONE" | "GROUP";
|
|
589
|
-
createdAt:
|
|
590
|
-
updatedAt:
|
|
588
|
+
createdAt: import("../../helpers").Timestamp;
|
|
589
|
+
updatedAt: import("../../helpers").Timestamp;
|
|
591
590
|
participantIds: string[];
|
|
592
|
-
seenBy: Record<string,
|
|
591
|
+
seenBy: Record<string, import("../../helpers").Timestamp>;
|
|
593
592
|
needsAttention: string[];
|
|
594
593
|
needsAttentionMap: Record<string, boolean>;
|
|
595
594
|
id?: string | undefined;
|
|
@@ -599,11 +598,11 @@ export declare const ChatThreadSchema: z.ZodObject<{
|
|
|
599
598
|
lastMessage?: {
|
|
600
599
|
id: string;
|
|
601
600
|
body: string;
|
|
602
|
-
createdAt:
|
|
601
|
+
createdAt: import("../../helpers").Timestamp;
|
|
603
602
|
threadId: string;
|
|
604
|
-
contentType: string;
|
|
605
603
|
authorId: string;
|
|
606
|
-
|
|
604
|
+
contentType: string;
|
|
605
|
+
seen: Record<string, import("../../helpers").Timestamp>;
|
|
607
606
|
type?: "message" | "note" | "whatsapp-message" | undefined;
|
|
608
607
|
source?: string | undefined;
|
|
609
608
|
attachments?: string[] | undefined;
|
|
@@ -624,7 +623,7 @@ export declare const ChatThreadSchema: z.ZodObject<{
|
|
|
624
623
|
photoUrl?: string | undefined;
|
|
625
624
|
stripeCustomerId?: string | undefined;
|
|
626
625
|
} | undefined;
|
|
627
|
-
lastSeen?:
|
|
626
|
+
lastSeen?: import("../../helpers").Timestamp | undefined;
|
|
628
627
|
externalMessageId?: string | undefined;
|
|
629
628
|
} | undefined;
|
|
630
629
|
participants?: {
|
|
@@ -685,12 +684,12 @@ export declare const ChatThreadSchema: z.ZodObject<{
|
|
|
685
684
|
isInquiryThread?: boolean | undefined;
|
|
686
685
|
whatsappTemplateSent?: boolean | undefined;
|
|
687
686
|
whatsappUserReplied?: boolean | undefined;
|
|
688
|
-
lastWhatsappMessageSentAt?:
|
|
687
|
+
lastWhatsappMessageSentAt?: import("../../helpers").Timestamp | undefined;
|
|
689
688
|
}>;
|
|
690
689
|
export declare const MessageAutomationTemplateSchema: z.ZodObject<{
|
|
691
690
|
id: z.ZodOptional<z.ZodString>;
|
|
692
691
|
name: z.ZodString;
|
|
693
|
-
createdAt: z.ZodType<
|
|
692
|
+
createdAt: z.ZodType<import("../../helpers").Timestamp, z.ZodTypeDef, import("../../helpers").Timestamp>;
|
|
694
693
|
message: z.ZodString;
|
|
695
694
|
action: z.ZodUnion<[z.ZodLiteral<"booking-confirmed">, z.ZodLiteral<"check-in">, z.ZodLiteral<"check-out">]>;
|
|
696
695
|
minutesAfterBookingConfirmed: z.ZodOptional<z.ZodNumber>;
|
|
@@ -700,7 +699,7 @@ export declare const MessageAutomationTemplateSchema: z.ZodObject<{
|
|
|
700
699
|
name: string;
|
|
701
700
|
message: string;
|
|
702
701
|
action: "booking-confirmed" | "check-in" | "check-out";
|
|
703
|
-
createdAt:
|
|
702
|
+
createdAt: import("../../helpers").Timestamp;
|
|
704
703
|
id?: string | undefined;
|
|
705
704
|
minutesAfterBookingConfirmed?: number | undefined;
|
|
706
705
|
daysAfterAction?: number | undefined;
|
|
@@ -709,7 +708,7 @@ export declare const MessageAutomationTemplateSchema: z.ZodObject<{
|
|
|
709
708
|
name: string;
|
|
710
709
|
message: string;
|
|
711
710
|
action: "booking-confirmed" | "check-in" | "check-out";
|
|
712
|
-
createdAt:
|
|
711
|
+
createdAt: import("../../helpers").Timestamp;
|
|
713
712
|
id?: string | undefined;
|
|
714
713
|
minutesAfterBookingConfirmed?: number | undefined;
|
|
715
714
|
daysAfterAction?: number | undefined;
|
|
@@ -718,16 +717,16 @@ export declare const MessageAutomationTemplateSchema: z.ZodObject<{
|
|
|
718
717
|
export declare const SavedReplySchema: z.ZodObject<{
|
|
719
718
|
id: z.ZodOptional<z.ZodString>;
|
|
720
719
|
name: z.ZodString;
|
|
721
|
-
createdAt: z.ZodType<
|
|
720
|
+
createdAt: z.ZodType<import("../../helpers").Timestamp, z.ZodTypeDef, import("../../helpers").Timestamp>;
|
|
722
721
|
message: z.ZodString;
|
|
723
722
|
}, "strip", z.ZodTypeAny, {
|
|
724
723
|
name: string;
|
|
725
724
|
message: string;
|
|
726
|
-
createdAt:
|
|
725
|
+
createdAt: import("../../helpers").Timestamp;
|
|
727
726
|
id?: string | undefined;
|
|
728
727
|
}, {
|
|
729
728
|
name: string;
|
|
730
729
|
message: string;
|
|
731
|
-
createdAt:
|
|
730
|
+
createdAt: import("../../helpers").Timestamp;
|
|
732
731
|
id?: string | undefined;
|
|
733
732
|
}>;
|
|
@@ -1,46 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.SavedReplySchema = exports.MessageAutomationTemplateSchema = exports.ChatThreadSchema = exports.ChatMessageSchema = exports.ChatMessageTypeSchema = void 0;
|
|
37
4
|
const zod_1 = require("zod");
|
|
38
5
|
const user_1 = require("../user");
|
|
39
6
|
const reservation_1 = require("../reservation");
|
|
40
7
|
const property_1 = require("../property");
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
const SeenBySchema = (0, zod_1.record)((0, zod_1.string)(), zod_1.z.instanceof(admin.firestore.Timestamp));
|
|
8
|
+
const helpers_1 = require("../../helpers");
|
|
9
|
+
const SeenBySchema = (0, zod_1.record)((0, zod_1.string)(), helpers_1.firestoreTimestampSchema);
|
|
44
10
|
exports.ChatMessageTypeSchema = (0, zod_1.union)([
|
|
45
11
|
(0, zod_1.literal)("message"),
|
|
46
12
|
(0, zod_1.literal)("note"),
|
|
@@ -48,14 +14,14 @@ exports.ChatMessageTypeSchema = (0, zod_1.union)([
|
|
|
48
14
|
]);
|
|
49
15
|
exports.ChatMessageSchema = (0, zod_1.object)({
|
|
50
16
|
id: (0, zod_1.string)(),
|
|
51
|
-
createdAt:
|
|
17
|
+
createdAt: helpers_1.firestoreTimestampSchema,
|
|
52
18
|
threadId: (0, zod_1.string)(),
|
|
53
19
|
authorId: (0, zod_1.string)(),
|
|
54
20
|
author: (0, zod_1.optional)(user_1.userSchema),
|
|
55
21
|
contentType: (0, zod_1.string)(),
|
|
56
22
|
body: (0, zod_1.string)(),
|
|
57
23
|
seen: SeenBySchema,
|
|
58
|
-
lastSeen: (0, zod_1.optional)(
|
|
24
|
+
lastSeen: (0, zod_1.optional)(helpers_1.firestoreTimestampSchema),
|
|
59
25
|
source: (0, zod_1.optional)((0, zod_1.string)()),
|
|
60
26
|
externalMessageId: (0, zod_1.optional)((0, zod_1.string)()),
|
|
61
27
|
attachments: (0, zod_1.optional)((0, zod_1.array)((0, zod_1.string)())),
|
|
@@ -63,8 +29,8 @@ exports.ChatMessageSchema = (0, zod_1.object)({
|
|
|
63
29
|
});
|
|
64
30
|
exports.ChatThreadSchema = (0, zod_1.object)({
|
|
65
31
|
id: (0, zod_1.optional)((0, zod_1.string)()),
|
|
66
|
-
createdAt:
|
|
67
|
-
updatedAt:
|
|
32
|
+
createdAt: helpers_1.firestoreTimestampSchema,
|
|
33
|
+
updatedAt: helpers_1.firestoreTimestampSchema,
|
|
68
34
|
lastMessage: (0, zod_1.optional)(exports.ChatMessageSchema),
|
|
69
35
|
participantIds: (0, zod_1.array)((0, zod_1.string)()),
|
|
70
36
|
participants: (0, zod_1.optional)((0, zod_1.array)(user_1.userSchema)),
|
|
@@ -73,7 +39,7 @@ exports.ChatThreadSchema = (0, zod_1.object)({
|
|
|
73
39
|
externalThreadId: (0, zod_1.optional)((0, zod_1.string)()),
|
|
74
40
|
externalSource: (0, zod_1.optional)((0, zod_1.string)()),
|
|
75
41
|
title: (0, zod_1.optional)((0, zod_1.string)()),
|
|
76
|
-
seenBy: (0, zod_1.record)((0, zod_1.string)(),
|
|
42
|
+
seenBy: (0, zod_1.record)((0, zod_1.string)(), helpers_1.firestoreTimestampSchema),
|
|
77
43
|
isImportant: (0, zod_1.optional)((0, zod_1.boolean)()),
|
|
78
44
|
needsAttention: (0, zod_1.array)((0, zod_1.string)()),
|
|
79
45
|
needsAttentionMap: (0, zod_1.record)((0, zod_1.string)(), (0, zod_1.boolean)()),
|
|
@@ -93,12 +59,12 @@ exports.ChatThreadSchema = (0, zod_1.object)({
|
|
|
93
59
|
isInquiryThread: (0, zod_1.optional)((0, zod_1.boolean)()),
|
|
94
60
|
whatsappTemplateSent: (0, zod_1.optional)((0, zod_1.boolean)()),
|
|
95
61
|
whatsappUserReplied: (0, zod_1.optional)((0, zod_1.boolean)()),
|
|
96
|
-
lastWhatsappMessageSentAt: (0, zod_1.optional)(
|
|
62
|
+
lastWhatsappMessageSentAt: (0, zod_1.optional)(helpers_1.firestoreTimestampSchema),
|
|
97
63
|
});
|
|
98
64
|
exports.MessageAutomationTemplateSchema = (0, zod_1.object)({
|
|
99
65
|
id: (0, zod_1.optional)((0, zod_1.string)()),
|
|
100
66
|
name: (0, zod_1.string)(),
|
|
101
|
-
createdAt:
|
|
67
|
+
createdAt: helpers_1.firestoreTimestampSchema,
|
|
102
68
|
message: (0, zod_1.string)(),
|
|
103
69
|
action: (0, zod_1.union)([
|
|
104
70
|
(0, zod_1.literal)("booking-confirmed"),
|
|
@@ -112,6 +78,6 @@ exports.MessageAutomationTemplateSchema = (0, zod_1.object)({
|
|
|
112
78
|
exports.SavedReplySchema = (0, zod_1.object)({
|
|
113
79
|
id: (0, zod_1.optional)((0, zod_1.string)()),
|
|
114
80
|
name: (0, zod_1.string)(),
|
|
115
|
-
createdAt:
|
|
81
|
+
createdAt: helpers_1.firestoreTimestampSchema,
|
|
116
82
|
message: (0, zod_1.string)(),
|
|
117
83
|
});
|