@deallony/shared 1.2.80 → 1.2.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/constants/events/EventBirthday.d.ts +2 -0
- package/dist/cjs/constants/events/EventBirthday.js +12 -0
- package/dist/cjs/constants/events/EventCustomization.d.ts +21 -0
- package/dist/cjs/constants/events/EventCustomization.js +23 -2
- package/dist/cjs/constants/events/EventDressCode.d.ts +65 -0
- package/dist/cjs/constants/events/EventDressCode.js +56 -0
- package/dist/cjs/constants/events/EventGuests.d.ts +3 -0
- package/dist/cjs/constants/events/EventGuests.js +6 -0
- package/dist/cjs/constants/events/EventHost.d.ts +79 -0
- package/dist/cjs/constants/events/EventHost.js +155 -0
- package/dist/cjs/constants/events/EventOccasion.d.ts +63 -0
- package/dist/cjs/constants/events/EventOccasion.js +242 -0
- package/dist/cjs/constants/events/EventPreview.d.ts +3 -0
- package/dist/cjs/constants/events/EventPreview.js +9 -1
- package/dist/cjs/constants/events/EventTemplate.d.ts +518 -10
- package/dist/cjs/constants/events/EventTemplate.js +81 -11
- package/dist/cjs/constants/events/EventTextPolicy.d.ts +7 -0
- package/dist/cjs/constants/events/EventTextPolicy.js +66 -0
- package/dist/cjs/constants/events/EventType.d.ts +273 -8
- package/dist/cjs/constants/events/EventType.js +38 -2
- package/dist/cjs/constants/events/EventVisibility.d.ts +19 -0
- package/dist/cjs/constants/events/EventVisibility.js +18 -0
- package/dist/cjs/constants/events/EventWedding.js +3 -0
- package/dist/cjs/constants/events/EventWeddingReligion.d.ts +72 -0
- package/dist/cjs/constants/events/EventWeddingReligion.js +126 -0
- package/dist/cjs/constants/events/index.d.ts +8 -0
- package/dist/cjs/constants/events/index.js +8 -0
- package/dist/cjs/constants/routes/app.d.ts +49 -0
- package/dist/cjs/constants/routes/app.js +16 -0
- package/dist/cjs/dto/events/EventBirthday.dto.d.ts +3 -0
- package/dist/cjs/dto/events/EventBirthday.dto.js +2 -0
- package/dist/cjs/dto/events/EventHost.dto.d.ts +7 -0
- package/dist/cjs/dto/events/EventHost.dto.js +2 -0
- package/dist/cjs/dto/events/EventOccasion.dto.d.ts +3 -0
- package/dist/cjs/dto/events/EventOccasion.dto.js +2 -0
- package/dist/cjs/dto/events/index.d.ts +3 -0
- package/dist/cjs/dto/events/index.js +3 -0
- package/dist/cjs/schema/communication/ai-conversation.schema.d.ts +55 -3
- package/dist/cjs/schema/communication/ai-conversation.schema.js +28 -3
- package/dist/cjs/schema/communication/offer.schema.d.ts +3 -3
- package/dist/cjs/schema/communication/support-ticket.schema.d.ts +136 -0
- package/dist/cjs/schema/communication/support-ticket.schema.js +47 -2
- package/dist/cjs/schema/events/Event.schema.d.ts +326 -0
- package/dist/cjs/schema/events/Event.schema.js +55 -1
- package/dist/cjs/schema/events/EventBirthday.schema.d.ts +19 -0
- package/dist/cjs/schema/events/EventBirthday.schema.js +17 -0
- package/dist/cjs/schema/events/EventHost.schema.d.ts +36 -0
- package/dist/cjs/schema/events/EventHost.schema.js +44 -0
- package/dist/cjs/schema/events/EventOccasion.schema.d.ts +22 -0
- package/dist/cjs/schema/events/EventOccasion.schema.js +31 -0
- package/dist/cjs/schema/events/EventRsvp.schema.d.ts +4 -0
- package/dist/cjs/schema/events/EventRsvp.schema.js +1 -0
- package/dist/cjs/schema/events/EventTimeline.schema.d.ts +5 -0
- package/dist/cjs/schema/events/EventTimeline.schema.js +14 -1
- package/dist/cjs/schema/events/EventWedding.schema.d.ts +32 -0
- package/dist/cjs/schema/events/EventWedding.schema.js +11 -0
- package/dist/cjs/schema/events/index.d.ts +3 -0
- package/dist/cjs/schema/events/index.js +3 -0
- package/dist/cjs/types/communication/Notification.d.ts +21 -2
- package/dist/cjs/types/communication/Notification.js +17 -0
- package/dist/cjs/types/events/Event.d.ts +38 -1
- package/dist/cjs/types/events/EventBirthday.d.ts +17 -0
- package/dist/cjs/types/events/EventBirthday.js +2 -0
- package/dist/cjs/types/events/EventCustomization.d.ts +4 -0
- package/dist/cjs/types/events/EventDressCode.d.ts +13 -0
- package/dist/cjs/types/events/EventDressCode.js +2 -0
- package/dist/cjs/types/events/EventHost.d.ts +29 -0
- package/dist/cjs/types/events/EventHost.js +2 -0
- package/dist/cjs/types/events/EventOccasion.d.ts +24 -0
- package/dist/cjs/types/events/EventOccasion.js +2 -0
- package/dist/cjs/types/events/EventRsvp.d.ts +2 -0
- package/dist/cjs/types/events/EventTimeline.d.ts +2 -0
- package/dist/cjs/types/events/EventWedding.d.ts +7 -0
- package/dist/cjs/types/events/index.d.ts +4 -0
- package/dist/cjs/types/events/index.js +4 -0
- package/dist/cjs/types/index.d.ts +4 -0
- package/dist/cjs/types/index.js +6 -2
- package/dist/cjs/types/user/SavedSearch.d.ts +38 -0
- package/dist/cjs/types/user/SavedSearch.js +11 -0
- package/dist/esm/constants/events/EventBirthday.js +9 -0
- package/dist/esm/constants/events/EventCustomization.js +21 -1
- package/dist/esm/constants/events/EventDressCode.js +49 -0
- package/dist/esm/constants/events/EventGuests.js +3 -0
- package/dist/esm/constants/events/EventHost.js +147 -0
- package/dist/esm/constants/events/EventOccasion.js +235 -0
- package/dist/esm/constants/events/EventPreview.js +7 -0
- package/dist/esm/constants/events/EventTemplate.js +78 -10
- package/dist/esm/constants/events/EventTextPolicy.js +61 -0
- package/dist/esm/constants/events/EventType.js +34 -1
- package/dist/esm/constants/events/EventVisibility.js +15 -0
- package/dist/esm/constants/events/EventWedding.js +3 -0
- package/dist/esm/constants/events/EventWeddingReligion.js +118 -0
- package/dist/esm/constants/events/index.js +8 -0
- package/dist/esm/constants/routes/app.js +16 -0
- package/dist/esm/dto/events/EventBirthday.dto.js +1 -0
- package/dist/esm/dto/events/EventHost.dto.js +1 -0
- package/dist/esm/dto/events/EventOccasion.dto.js +1 -0
- package/dist/esm/dto/events/index.js +3 -0
- package/dist/esm/schema/communication/ai-conversation.schema.js +27 -2
- package/dist/esm/schema/communication/support-ticket.schema.js +46 -1
- package/dist/esm/schema/events/Event.schema.js +55 -1
- package/dist/esm/schema/events/EventBirthday.schema.js +14 -0
- package/dist/esm/schema/events/EventHost.schema.js +41 -0
- package/dist/esm/schema/events/EventOccasion.schema.js +28 -0
- package/dist/esm/schema/events/EventRsvp.schema.js +1 -0
- package/dist/esm/schema/events/EventTimeline.schema.js +14 -1
- package/dist/esm/schema/events/EventWedding.schema.js +11 -0
- package/dist/esm/schema/events/index.js +3 -0
- package/dist/esm/types/communication/Notification.js +17 -0
- package/dist/esm/types/events/EventBirthday.js +1 -0
- package/dist/esm/types/events/EventDressCode.js +1 -0
- package/dist/esm/types/events/EventHost.js +1 -0
- package/dist/esm/types/events/EventOccasion.js +1 -0
- package/dist/esm/types/events/index.js +4 -0
- package/dist/esm/types/index.js +4 -0
- package/dist/esm/types/user/SavedSearch.js +8 -0
- package/package.json +1 -1
|
@@ -17,9 +17,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./Event"), exports);
|
|
18
18
|
__exportStar(require("./EventType"), exports);
|
|
19
19
|
__exportStar(require("./EventWedding"), exports);
|
|
20
|
+
__exportStar(require("./EventBirthday"), exports);
|
|
21
|
+
__exportStar(require("./EventOccasion"), exports);
|
|
20
22
|
__exportStar(require("./EventTemplate"), exports);
|
|
21
23
|
__exportStar(require("./EventTimeline"), exports);
|
|
22
24
|
__exportStar(require("./EventInvitationScanType"), exports);
|
|
23
25
|
__exportStar(require("./EventPricing"), exports);
|
|
24
26
|
__exportStar(require("./EventPreview"), exports);
|
|
25
27
|
__exportStar(require("./EventCustomization"), exports);
|
|
28
|
+
__exportStar(require("./EventVisibility"), exports);
|
|
29
|
+
__exportStar(require("./EventWeddingReligion"), exports);
|
|
30
|
+
__exportStar(require("./EventTextPolicy"), exports);
|
|
31
|
+
__exportStar(require("./EventDressCode"), exports);
|
|
32
|
+
__exportStar(require("./EventHost"), exports);
|
|
33
|
+
__exportStar(require("./EventGuests"), exports);
|
|
@@ -15,6 +15,19 @@ export declare const APP_ROUTES: {
|
|
|
15
15
|
pathname: string;
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
|
+
readonly savedSearches: {
|
|
19
|
+
/** The user's saved ad searches ("بحثي المحفوظ") */
|
|
20
|
+
readonly list: () => {
|
|
21
|
+
pathname: string;
|
|
22
|
+
};
|
|
23
|
+
/** Opens a saved search's results with its new ads marked, and marks them seen */
|
|
24
|
+
readonly open: (id: number | string) => {
|
|
25
|
+
pathname: string;
|
|
26
|
+
params: {
|
|
27
|
+
id: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
18
31
|
readonly favorites: {
|
|
19
32
|
readonly compare: (ad_ids: (number | string)[]) => {
|
|
20
33
|
pathname: string;
|
|
@@ -412,6 +425,17 @@ export declare const APP_ROUTES: {
|
|
|
412
425
|
id: string | number;
|
|
413
426
|
};
|
|
414
427
|
};
|
|
428
|
+
/** Every ad published under the company, for its members */
|
|
429
|
+
readonly ads: (id: number | string) => {
|
|
430
|
+
pathname: string;
|
|
431
|
+
params: {
|
|
432
|
+
id: string | number;
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
/** This week's most active companies (opened from the home strip) */
|
|
436
|
+
readonly ranking: () => {
|
|
437
|
+
pathname: string;
|
|
438
|
+
};
|
|
415
439
|
};
|
|
416
440
|
readonly venue: {
|
|
417
441
|
readonly new: (companyId: number | string) => {
|
|
@@ -447,12 +471,30 @@ export declare const APP_ROUTES: {
|
|
|
447
471
|
venue_id?: undefined;
|
|
448
472
|
};
|
|
449
473
|
};
|
|
474
|
+
/** A new personal event of one type (wedding, birthday), chosen on the start page */
|
|
475
|
+
readonly newOfType: (eventType: string) => {
|
|
476
|
+
pathname: string;
|
|
477
|
+
params: {
|
|
478
|
+
personal: string;
|
|
479
|
+
event_type: string;
|
|
480
|
+
};
|
|
481
|
+
};
|
|
450
482
|
readonly start: () => {
|
|
451
483
|
pathname: string;
|
|
452
484
|
};
|
|
453
485
|
readonly mine: () => {
|
|
454
486
|
pathname: string;
|
|
455
487
|
};
|
|
488
|
+
/** Upcoming public events (optionally of one venue) */
|
|
489
|
+
readonly upcoming: (venueId?: number | string) => {
|
|
490
|
+
pathname: string;
|
|
491
|
+
params: {
|
|
492
|
+
venue_id: string | number;
|
|
493
|
+
};
|
|
494
|
+
} | {
|
|
495
|
+
pathname: string;
|
|
496
|
+
params?: undefined;
|
|
497
|
+
};
|
|
456
498
|
readonly publish: (id: number | string) => {
|
|
457
499
|
pathname: string;
|
|
458
500
|
params: {
|
|
@@ -471,6 +513,13 @@ export declare const APP_ROUTES: {
|
|
|
471
513
|
id: string | number;
|
|
472
514
|
};
|
|
473
515
|
};
|
|
516
|
+
/** People of the event (owner, organisers, guest managers) */
|
|
517
|
+
readonly hosts: (id: number | string) => {
|
|
518
|
+
pathname: string;
|
|
519
|
+
params: {
|
|
520
|
+
id: string | number;
|
|
521
|
+
};
|
|
522
|
+
};
|
|
474
523
|
};
|
|
475
524
|
};
|
|
476
525
|
export type SharedAppRoutes = typeof APP_ROUTES;
|
|
@@ -10,6 +10,12 @@ exports.APP_ROUTES = {
|
|
|
10
10
|
list: () => ({ pathname: "/notifications" }),
|
|
11
11
|
settings: () => ({ pathname: "/notifications/settings" }),
|
|
12
12
|
},
|
|
13
|
+
savedSearches: {
|
|
14
|
+
/** The user's saved ad searches ("بحثي المحفوظ") */
|
|
15
|
+
list: () => ({ pathname: "/saved-searches" }),
|
|
16
|
+
/** Opens a saved search's results with its new ads marked, and marks them seen */
|
|
17
|
+
open: (id) => ({ pathname: "/saved-searches/[id]", params: { id: String(id) } }),
|
|
18
|
+
},
|
|
13
19
|
favorites: {
|
|
14
20
|
compare: (ad_ids) => ({
|
|
15
21
|
pathname: "/favorites/compare",
|
|
@@ -184,6 +190,10 @@ exports.APP_ROUTES = {
|
|
|
184
190
|
details: (id) => ({ pathname: "/company/details/[id]", params: { id } }),
|
|
185
191
|
/** Public profile with the company's ads */
|
|
186
192
|
profile: (id) => ({ pathname: "/company/profile/[id]", params: { id } }),
|
|
193
|
+
/** Every ad published under the company, for its members */
|
|
194
|
+
ads: (id) => ({ pathname: "/company/ads/[id]", params: { id } }),
|
|
195
|
+
/** This week's most active companies (opened from the home strip) */
|
|
196
|
+
ranking: () => ({ pathname: "/company/ranking" }),
|
|
187
197
|
},
|
|
188
198
|
venue: {
|
|
189
199
|
new: (companyId) => ({ pathname: "/venue/new", params: { company_id: companyId } }),
|
|
@@ -192,10 +202,16 @@ exports.APP_ROUTES = {
|
|
|
192
202
|
},
|
|
193
203
|
event: {
|
|
194
204
|
new: (venueId) => venueId ? { pathname: "/event/new", params: { venue_id: venueId } } : { pathname: "/event/new", params: { personal: "1" } },
|
|
205
|
+
/** A new personal event of one type (wedding, birthday), chosen on the start page */
|
|
206
|
+
newOfType: (eventType) => ({ pathname: "/event/new", params: { personal: "1", event_type: eventType } }),
|
|
195
207
|
start: () => ({ pathname: "/event/start" }),
|
|
196
208
|
mine: () => ({ pathname: "/event/mine" }),
|
|
209
|
+
/** Upcoming public events (optionally of one venue) */
|
|
210
|
+
upcoming: (venueId) => venueId ? { pathname: "/event/upcoming", params: { venue_id: venueId } } : { pathname: "/event/upcoming" },
|
|
197
211
|
publish: (id) => ({ pathname: "/event/publish/[id]", params: { id } }),
|
|
198
212
|
edit: (id) => ({ pathname: "/event/new", params: { id } }),
|
|
199
213
|
details: (id) => ({ pathname: "/event/details/[id]", params: { id } }),
|
|
214
|
+
/** People of the event (owner, organisers, guest managers) */
|
|
215
|
+
hosts: (id) => ({ pathname: "/event/hosts/[id]", params: { id } }),
|
|
200
216
|
},
|
|
201
217
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { addEventHostSchema, eventHostIdSchema, eventHostsListSchema, eventPersonInputSchema, updateEventHostSchema } from '../../schema/events/EventHost.schema';
|
|
3
|
+
export type EventPersonInputDto = z.infer<typeof eventPersonInputSchema>;
|
|
4
|
+
export type AddEventHostDto = z.infer<typeof addEventHostSchema>;
|
|
5
|
+
export type UpdateEventHostDto = z.infer<typeof updateEventHostSchema>;
|
|
6
|
+
export type EventHostIdDto = z.infer<typeof eventHostIdSchema>;
|
|
7
|
+
export type EventHostsListDto = z.infer<typeof eventHostsListSchema>;
|
|
@@ -2,4 +2,7 @@ export * from './Event.dto';
|
|
|
2
2
|
export * from './EventRsvp.dto';
|
|
3
3
|
export * from './EventTimeline.dto';
|
|
4
4
|
export * from './EventWedding.dto';
|
|
5
|
+
export * from './EventBirthday.dto';
|
|
6
|
+
export * from './EventOccasion.dto';
|
|
5
7
|
export * from './EventVenue.dto';
|
|
8
|
+
export * from './EventHost.dto';
|
|
@@ -18,4 +18,7 @@ __exportStar(require("./Event.dto"), exports);
|
|
|
18
18
|
__exportStar(require("./EventRsvp.dto"), exports);
|
|
19
19
|
__exportStar(require("./EventTimeline.dto"), exports);
|
|
20
20
|
__exportStar(require("./EventWedding.dto"), exports);
|
|
21
|
+
__exportStar(require("./EventBirthday.dto"), exports);
|
|
22
|
+
__exportStar(require("./EventOccasion.dto"), exports);
|
|
21
23
|
__exportStar(require("./EventVenue.dto"), exports);
|
|
24
|
+
__exportStar(require("./EventHost.dto"), exports);
|
|
@@ -59,6 +59,7 @@ export declare const PotentialUserConversationEventSchema: z.ZodObject<{
|
|
|
59
59
|
export declare const AiConversationStatusSchema: z.ZodEnum<{
|
|
60
60
|
starting: "starting";
|
|
61
61
|
awaiting_approval: "awaiting_approval";
|
|
62
|
+
scheduled: "scheduled";
|
|
62
63
|
waiting_for_reply: "waiting_for_reply";
|
|
63
64
|
chatting: "chatting";
|
|
64
65
|
interested: "interested";
|
|
@@ -81,6 +82,7 @@ export declare const AiConversationListSchema: z.ZodObject<{
|
|
|
81
82
|
statuses: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
82
83
|
starting: "starting";
|
|
83
84
|
awaiting_approval: "awaiting_approval";
|
|
85
|
+
scheduled: "scheduled";
|
|
84
86
|
waiting_for_reply: "waiting_for_reply";
|
|
85
87
|
chatting: "chatting";
|
|
86
88
|
interested: "interested";
|
|
@@ -102,6 +104,16 @@ export type MarketingSubjectType = z.infer<typeof MarketingSubjectTypeSchema>;
|
|
|
102
104
|
export type AiConversationStatus = z.infer<typeof AiConversationStatusSchema>;
|
|
103
105
|
export type AiConversationPurpose = z.infer<typeof AiConversationPurposeSchema>;
|
|
104
106
|
export type AiConversationList = z.infer<typeof AiConversationListSchema>;
|
|
107
|
+
/** What a customer sent besides plain text: a voice note (transcribed when possible) or another file */
|
|
108
|
+
export type AiMessageMediaType = 'voice' | 'audio' | 'image' | 'video' | 'sticker' | 'document' | 'location' | 'contact';
|
|
109
|
+
/** done: content is the transcript; failed / too_long: not transcribed; none: not audio */
|
|
110
|
+
export type AiMessageTranscription = 'done' | 'failed' | 'too_long' | 'none';
|
|
111
|
+
export type AiMessageMedia = {
|
|
112
|
+
type: AiMessageMediaType;
|
|
113
|
+
/** Length of a voice note or audio file */
|
|
114
|
+
seconds?: number | null;
|
|
115
|
+
transcription: AiMessageTranscription;
|
|
116
|
+
};
|
|
105
117
|
export type AiConversationListItem = {
|
|
106
118
|
id: number;
|
|
107
119
|
potential_user_id: number | null;
|
|
@@ -119,9 +131,15 @@ export type AiConversationListItem = {
|
|
|
119
131
|
direction: 'inbound' | 'outbound';
|
|
120
132
|
sender: 'user' | 'ai' | 'human';
|
|
121
133
|
created_at: string;
|
|
134
|
+
/** Set when the customer sent a voice note or another file instead of text */
|
|
135
|
+
media?: AiMessageMedia | null;
|
|
122
136
|
} | null;
|
|
123
137
|
/** AI drafts of this conversation waiting for an admin */
|
|
124
138
|
pending_draft_count?: number;
|
|
139
|
+
/** The customer wrote outside the sending hours: the AI answers at this time */
|
|
140
|
+
reply_after?: string | null;
|
|
141
|
+
/** The opening waits for the sending hours: it goes out at this time */
|
|
142
|
+
send_after?: string | null;
|
|
125
143
|
/** Filled in by the marketplace from the potential user record. */
|
|
126
144
|
potential_user?: {
|
|
127
145
|
id: number;
|
|
@@ -150,12 +168,14 @@ export declare const AiApprovalSettingsSchema: z.ZodObject<{
|
|
|
150
168
|
enabled: z.ZodBoolean;
|
|
151
169
|
}, z.core.$strip>;
|
|
152
170
|
/**
|
|
153
|
-
* pending: waiting for an admin.
|
|
171
|
+
* pending: waiting for an admin. scheduled: ready, goes out when the sending hours open (send_after).
|
|
172
|
+
* sent: approved and sent. rejected: thrown away by an admin.
|
|
154
173
|
* outdated: the customer wrote again, so a newer draft replaced it. failed: approved but WhatsApp refused it.
|
|
155
174
|
*/
|
|
156
175
|
export declare const AiDraftStatusSchema: z.ZodEnum<{
|
|
157
|
-
failed: "failed";
|
|
158
176
|
pending: "pending";
|
|
177
|
+
scheduled: "scheduled";
|
|
178
|
+
failed: "failed";
|
|
159
179
|
sent: "sent";
|
|
160
180
|
rejected: "rejected";
|
|
161
181
|
outdated: "outdated";
|
|
@@ -170,8 +190,9 @@ export declare const AiDraftListSchema: z.ZodObject<{
|
|
|
170
190
|
page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
171
191
|
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
172
192
|
statuses: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
173
|
-
failed: "failed";
|
|
174
193
|
pending: "pending";
|
|
194
|
+
scheduled: "scheduled";
|
|
195
|
+
failed: "failed";
|
|
175
196
|
sent: "sent";
|
|
176
197
|
rejected: "rejected";
|
|
177
198
|
outdated: "outdated";
|
|
@@ -186,6 +207,10 @@ export declare const AiDraftDecisionSchema: z.ZodObject<{
|
|
|
186
207
|
}>;
|
|
187
208
|
replies: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
188
209
|
}, z.core.$strip>;
|
|
210
|
+
/** Sends a scheduled draft right away, ignoring the sending hours */
|
|
211
|
+
export declare const AiDraftSendNowSchema: z.ZodObject<{
|
|
212
|
+
draft_id: z.ZodCoercedNumber<unknown>;
|
|
213
|
+
}, z.core.$strip>;
|
|
189
214
|
export declare const AiDraftApproveAllSchema: z.ZodObject<{
|
|
190
215
|
draft_ids: z.ZodOptional<z.ZodArray<z.ZodCoercedNumber<unknown>>>;
|
|
191
216
|
}, z.core.$strip>;
|
|
@@ -195,6 +220,7 @@ export type AiDraftKind = z.infer<typeof AiDraftKindSchema>;
|
|
|
195
220
|
export type AiDraftList = z.infer<typeof AiDraftListSchema>;
|
|
196
221
|
export type AiDraftDecision = z.infer<typeof AiDraftDecisionSchema>;
|
|
197
222
|
export type AiDraftApproveAll = z.infer<typeof AiDraftApproveAllSchema>;
|
|
223
|
+
export type AiDraftSendNow = z.infer<typeof AiDraftSendNowSchema>;
|
|
198
224
|
export type AiDraftItem = {
|
|
199
225
|
id: number;
|
|
200
226
|
conversation_id: number;
|
|
@@ -214,6 +240,8 @@ export type AiDraftItem = {
|
|
|
214
240
|
error: string | null;
|
|
215
241
|
created_at: string;
|
|
216
242
|
decided_at: string | null;
|
|
243
|
+
/** When a scheduled draft goes out (the next opening of the sending hours) */
|
|
244
|
+
send_after?: string | null;
|
|
217
245
|
conversation: {
|
|
218
246
|
id: number;
|
|
219
247
|
potential_user_id: number | null;
|
|
@@ -227,6 +255,7 @@ export type AiDraftItem = {
|
|
|
227
255
|
sender: 'user' | 'ai' | 'human';
|
|
228
256
|
content: string;
|
|
229
257
|
created_at: string;
|
|
258
|
+
media?: AiMessageMedia | null;
|
|
230
259
|
}>;
|
|
231
260
|
};
|
|
232
261
|
/** Filled in by the marketplace from the potential user record. */
|
|
@@ -243,3 +272,26 @@ export type AiDraftListResult = {
|
|
|
243
272
|
total_pages: number;
|
|
244
273
|
pending_count: number;
|
|
245
274
|
};
|
|
275
|
+
/**
|
|
276
|
+
* One setting for all AI marketing conversations. Times are on each customer's own clock,
|
|
277
|
+
* picked from the phone code (+963 Syria, +971 UAE); other numbers use default_timezone.
|
|
278
|
+
* end before start means the hours cross midnight (for example 20:00 to 02:00).
|
|
279
|
+
*/
|
|
280
|
+
export declare const AiSendWindowSettingsSchema: z.ZodObject<{
|
|
281
|
+
enabled: z.ZodBoolean;
|
|
282
|
+
start: z.ZodString;
|
|
283
|
+
end: z.ZodString;
|
|
284
|
+
default_timezone: z.ZodString;
|
|
285
|
+
}, z.core.$strip>;
|
|
286
|
+
export type AiSendWindowSettings = z.infer<typeof AiSendWindowSettingsSchema>;
|
|
287
|
+
/** The setting plus whether the hours are open now, per time zone the customers are in */
|
|
288
|
+
export type AiSendWindowStatus = AiSendWindowSettings & {
|
|
289
|
+
/** True when the hours are open in at least one customer time zone (or the setting is off) */
|
|
290
|
+
open_now: boolean;
|
|
291
|
+
zones: Array<{
|
|
292
|
+
timezone: string;
|
|
293
|
+
label: string;
|
|
294
|
+
open_now: boolean;
|
|
295
|
+
next_open_at: string | null;
|
|
296
|
+
}>;
|
|
297
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AiDraftApproveAllSchema = exports.AiDraftDecisionSchema = exports.AiDraftListSchema = exports.AiDraftKindSchema = exports.AiDraftStatusSchema = exports.AiApprovalSettingsSchema = exports.AiConversationListSchema = exports.AI_CONVERSATION_ACTIVE_STATUSES = exports.AiConversationPurposeSchema = exports.AiConversationStatusSchema = exports.PotentialUserConversationEventSchema = exports.ConversationEventTypeSchema = exports.StartAiConversationSchema = exports.ConversationLanguageSchema = exports.MarketingSubjectTypeSchema = void 0;
|
|
3
|
+
exports.AiSendWindowSettingsSchema = exports.AiDraftApproveAllSchema = exports.AiDraftSendNowSchema = exports.AiDraftDecisionSchema = exports.AiDraftListSchema = exports.AiDraftKindSchema = exports.AiDraftStatusSchema = exports.AiApprovalSettingsSchema = exports.AiConversationListSchema = exports.AI_CONVERSATION_ACTIVE_STATUSES = exports.AiConversationPurposeSchema = exports.AiConversationStatusSchema = exports.PotentialUserConversationEventSchema = exports.ConversationEventTypeSchema = exports.StartAiConversationSchema = exports.ConversationLanguageSchema = exports.MarketingSubjectTypeSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.MarketingSubjectTypeSchema = zod_1.z.enum([
|
|
6
6
|
'motors',
|
|
@@ -43,6 +43,8 @@ exports.AiConversationStatusSchema = zod_1.z.enum([
|
|
|
43
43
|
'starting',
|
|
44
44
|
/** The opening is written and waits for an admin to approve it */
|
|
45
45
|
'awaiting_approval',
|
|
46
|
+
/** Waits for the sending hours to open: the opening, an approved draft or the AI's reply goes out then */
|
|
47
|
+
'scheduled',
|
|
46
48
|
'waiting_for_reply',
|
|
47
49
|
'chatting',
|
|
48
50
|
'interested',
|
|
@@ -58,6 +60,7 @@ exports.AiConversationPurposeSchema = zod_1.z.enum(['marketing', 'support']);
|
|
|
58
60
|
exports.AI_CONVERSATION_ACTIVE_STATUSES = [
|
|
59
61
|
'starting',
|
|
60
62
|
'awaiting_approval',
|
|
63
|
+
'scheduled',
|
|
61
64
|
'waiting_for_reply',
|
|
62
65
|
'chatting',
|
|
63
66
|
'interested',
|
|
@@ -77,10 +80,11 @@ exports.AiApprovalSettingsSchema = zod_1.z.object({
|
|
|
77
80
|
enabled: zod_1.z.boolean(),
|
|
78
81
|
});
|
|
79
82
|
/**
|
|
80
|
-
* pending: waiting for an admin.
|
|
83
|
+
* pending: waiting for an admin. scheduled: ready, goes out when the sending hours open (send_after).
|
|
84
|
+
* sent: approved and sent. rejected: thrown away by an admin.
|
|
81
85
|
* outdated: the customer wrote again, so a newer draft replaced it. failed: approved but WhatsApp refused it.
|
|
82
86
|
*/
|
|
83
|
-
exports.AiDraftStatusSchema = zod_1.z.enum(['pending', 'sent', 'rejected', 'outdated', 'failed']);
|
|
87
|
+
exports.AiDraftStatusSchema = zod_1.z.enum(['pending', 'scheduled', 'sent', 'rejected', 'outdated', 'failed']);
|
|
84
88
|
/** opening: first messages of a new chat. reply: answer to the customer. opt_out: goodbye after a stop request */
|
|
85
89
|
exports.AiDraftKindSchema = zod_1.z.enum(['opening', 'reply', 'opt_out']);
|
|
86
90
|
exports.AiDraftListSchema = zod_1.z.object({
|
|
@@ -95,7 +99,28 @@ exports.AiDraftDecisionSchema = zod_1.z.object({
|
|
|
95
99
|
/** Edited messages to send instead of the AI's; only with approve */
|
|
96
100
|
replies: zod_1.z.array(zod_1.z.string().trim().min(1).max(4000)).min(1).max(4).optional(),
|
|
97
101
|
});
|
|
102
|
+
/** Sends a scheduled draft right away, ignoring the sending hours */
|
|
103
|
+
exports.AiDraftSendNowSchema = zod_1.z.object({
|
|
104
|
+
draft_id: zod_1.z.coerce.number().int().positive(),
|
|
105
|
+
});
|
|
98
106
|
exports.AiDraftApproveAllSchema = zod_1.z.object({
|
|
99
107
|
/** Approve only these drafts; all pending drafts when left out */
|
|
100
108
|
draft_ids: zod_1.z.array(zod_1.z.coerce.number().int().positive()).max(100).optional(),
|
|
101
109
|
});
|
|
110
|
+
/* ---------- Sending hours: AI marketing messages go out only between start and end ---------- */
|
|
111
|
+
const ClockTimeSchema = zod_1.z
|
|
112
|
+
.string()
|
|
113
|
+
.trim()
|
|
114
|
+
.regex(/^([01]\d|2[0-3]):[0-5]\d$/, 'Use HH:MM, 24-hour clock');
|
|
115
|
+
/**
|
|
116
|
+
* One setting for all AI marketing conversations. Times are on each customer's own clock,
|
|
117
|
+
* picked from the phone code (+963 Syria, +971 UAE); other numbers use default_timezone.
|
|
118
|
+
* end before start means the hours cross midnight (for example 20:00 to 02:00).
|
|
119
|
+
*/
|
|
120
|
+
exports.AiSendWindowSettingsSchema = zod_1.z.object({
|
|
121
|
+
enabled: zod_1.z.boolean(),
|
|
122
|
+
start: ClockTimeSchema,
|
|
123
|
+
end: ClockTimeSchema,
|
|
124
|
+
/** IANA time zone, for example Asia/Damascus */
|
|
125
|
+
default_timezone: zod_1.z.string().trim().min(1).max(60),
|
|
126
|
+
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const offerStatusSchema: z.ZodEnum<{
|
|
3
3
|
pending: "pending";
|
|
4
|
+
declined: "declined";
|
|
4
5
|
accepted: "accepted";
|
|
5
6
|
countered: "countered";
|
|
6
|
-
declined: "declined";
|
|
7
7
|
}>;
|
|
8
8
|
/** PRICE_OFFER payload. Replies (accept, counter, decline) point at the offer they answer. */
|
|
9
9
|
export declare const priceOfferPayloadSchema: z.ZodObject<{
|
|
@@ -17,9 +17,9 @@ export declare const priceOfferPayloadSchema: z.ZodObject<{
|
|
|
17
17
|
}, z.core.$strip>;
|
|
18
18
|
status: z.ZodOptional<z.ZodEnum<{
|
|
19
19
|
pending: "pending";
|
|
20
|
+
declined: "declined";
|
|
20
21
|
accepted: "accepted";
|
|
21
22
|
countered: "countered";
|
|
22
|
-
declined: "declined";
|
|
23
23
|
}>>;
|
|
24
24
|
reply_to_message_id: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
25
25
|
note: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -36,9 +36,9 @@ export declare const rentOfferPayloadSchema: z.ZodObject<{
|
|
|
36
36
|
}, z.core.$strip>;
|
|
37
37
|
status: z.ZodOptional<z.ZodEnum<{
|
|
38
38
|
pending: "pending";
|
|
39
|
+
declined: "declined";
|
|
39
40
|
accepted: "accepted";
|
|
40
41
|
countered: "countered";
|
|
41
|
-
declined: "declined";
|
|
42
42
|
}>>;
|
|
43
43
|
reply_to_message_id: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
44
44
|
note: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -17,10 +17,20 @@ export declare const SupportTicketPrioritySchema: z.ZodEnum<{
|
|
|
17
17
|
export declare const SupportTicketCategorySchema: z.ZodEnum<{
|
|
18
18
|
payment: "payment";
|
|
19
19
|
other: "other";
|
|
20
|
+
event: "event";
|
|
20
21
|
technical_issue: "technical_issue";
|
|
21
22
|
account: "account";
|
|
22
23
|
advertisement: "advertisement";
|
|
23
24
|
complaint: "complaint";
|
|
25
|
+
kyc: "kyc";
|
|
26
|
+
login: "login";
|
|
27
|
+
}>;
|
|
28
|
+
export declare const SupportTicketSourceSchema: z.ZodEnum<{
|
|
29
|
+
admin: "admin";
|
|
30
|
+
ai: "ai";
|
|
31
|
+
app: "app";
|
|
32
|
+
guest: "guest";
|
|
33
|
+
report: "report";
|
|
24
34
|
}>;
|
|
25
35
|
export declare const SupportTicketCreateSchema: z.ZodObject<{
|
|
26
36
|
title: z.ZodString;
|
|
@@ -28,10 +38,13 @@ export declare const SupportTicketCreateSchema: z.ZodObject<{
|
|
|
28
38
|
category: z.ZodDefault<z.ZodEnum<{
|
|
29
39
|
payment: "payment";
|
|
30
40
|
other: "other";
|
|
41
|
+
event: "event";
|
|
31
42
|
technical_issue: "technical_issue";
|
|
32
43
|
account: "account";
|
|
33
44
|
advertisement: "advertisement";
|
|
34
45
|
complaint: "complaint";
|
|
46
|
+
kyc: "kyc";
|
|
47
|
+
login: "login";
|
|
35
48
|
}>>;
|
|
36
49
|
priority: z.ZodDefault<z.ZodEnum<{
|
|
37
50
|
low: "low";
|
|
@@ -52,10 +65,13 @@ export declare const SupportTicketAiCreateSchema: z.ZodObject<{
|
|
|
52
65
|
category: z.ZodDefault<z.ZodEnum<{
|
|
53
66
|
payment: "payment";
|
|
54
67
|
other: "other";
|
|
68
|
+
event: "event";
|
|
55
69
|
technical_issue: "technical_issue";
|
|
56
70
|
account: "account";
|
|
57
71
|
advertisement: "advertisement";
|
|
58
72
|
complaint: "complaint";
|
|
73
|
+
kyc: "kyc";
|
|
74
|
+
login: "login";
|
|
59
75
|
}>>;
|
|
60
76
|
priority: z.ZodDefault<z.ZodEnum<{
|
|
61
77
|
low: "low";
|
|
@@ -94,6 +110,14 @@ export declare const SupportTicketListSchema: z.ZodObject<{
|
|
|
94
110
|
urgent: "urgent";
|
|
95
111
|
}>>;
|
|
96
112
|
search: z.ZodOptional<z.ZodString>;
|
|
113
|
+
source: z.ZodOptional<z.ZodEnum<{
|
|
114
|
+
admin: "admin";
|
|
115
|
+
ai: "ai";
|
|
116
|
+
app: "app";
|
|
117
|
+
guest: "guest";
|
|
118
|
+
report: "report";
|
|
119
|
+
}>>;
|
|
120
|
+
screen: z.ZodOptional<z.ZodString>;
|
|
97
121
|
}, z.core.$strip>;
|
|
98
122
|
export declare const SupportTicketStatusUpdateSchema: z.ZodObject<{
|
|
99
123
|
id: z.ZodNumber;
|
|
@@ -117,3 +141,115 @@ export declare const SupportTicketReplySchema: z.ZodObject<{
|
|
|
117
141
|
}, z.core.$strip>;
|
|
118
142
|
export type SupportTicketCreate = z.infer<typeof SupportTicketCreateSchema>;
|
|
119
143
|
export type SupportTicketAiCreate = z.infer<typeof SupportTicketAiCreateSchema>;
|
|
144
|
+
export declare const SupportReportScreenSchema: z.ZodEnum<{
|
|
145
|
+
"auth.login": "auth.login";
|
|
146
|
+
kyc: "kyc";
|
|
147
|
+
"event.new": "event.new";
|
|
148
|
+
"ad.new": "ad.new";
|
|
149
|
+
}>;
|
|
150
|
+
export declare const SupportReportReasonSchema: z.ZodEnum<{
|
|
151
|
+
other: "other";
|
|
152
|
+
error_message: "error_message";
|
|
153
|
+
blocked: "blocked";
|
|
154
|
+
slow: "slow";
|
|
155
|
+
}>;
|
|
156
|
+
export declare const SupportReportAttachmentSchema: z.ZodObject<{
|
|
157
|
+
url: z.ZodString;
|
|
158
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
159
|
+
mimetype: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
160
|
+
width: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
161
|
+
height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
162
|
+
}, z.core.$strip>;
|
|
163
|
+
export declare const SupportReportRequestLogSchema: z.ZodObject<{
|
|
164
|
+
at: z.ZodString;
|
|
165
|
+
method: z.ZodString;
|
|
166
|
+
path: z.ZodString;
|
|
167
|
+
status: z.ZodNullable<z.ZodNumber>;
|
|
168
|
+
ms: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
169
|
+
message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
170
|
+
}, z.core.$strip>;
|
|
171
|
+
export declare const SupportReportErrorLogSchema: z.ZodObject<{
|
|
172
|
+
at: z.ZodString;
|
|
173
|
+
source: z.ZodString;
|
|
174
|
+
message: z.ZodString;
|
|
175
|
+
}, z.core.$strip>;
|
|
176
|
+
export declare const SupportReportContextSchema: z.ZodObject<{
|
|
177
|
+
screen: z.ZodOptional<z.ZodObject<{
|
|
178
|
+
route: z.ZodString;
|
|
179
|
+
step: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
180
|
+
ids: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>>>;
|
|
181
|
+
error_fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
182
|
+
}, z.core.$strip>>;
|
|
183
|
+
device: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
184
|
+
app: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
185
|
+
requests: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
186
|
+
at: z.ZodString;
|
|
187
|
+
method: z.ZodString;
|
|
188
|
+
path: z.ZodString;
|
|
189
|
+
status: z.ZodNullable<z.ZodNumber>;
|
|
190
|
+
ms: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
191
|
+
message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
192
|
+
}, z.core.$strip>>>;
|
|
193
|
+
errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
194
|
+
at: z.ZodString;
|
|
195
|
+
source: z.ZodString;
|
|
196
|
+
message: z.ZodString;
|
|
197
|
+
}, z.core.$strip>>>;
|
|
198
|
+
}, z.core.$loose>;
|
|
199
|
+
export declare const SupportReportCreateSchema: z.ZodObject<{
|
|
200
|
+
description: z.ZodString;
|
|
201
|
+
screen: z.ZodEnum<{
|
|
202
|
+
"auth.login": "auth.login";
|
|
203
|
+
kyc: "kyc";
|
|
204
|
+
"event.new": "event.new";
|
|
205
|
+
"ad.new": "ad.new";
|
|
206
|
+
}>;
|
|
207
|
+
reason: z.ZodDefault<z.ZodEnum<{
|
|
208
|
+
other: "other";
|
|
209
|
+
error_message: "error_message";
|
|
210
|
+
blocked: "blocked";
|
|
211
|
+
slow: "slow";
|
|
212
|
+
}>>;
|
|
213
|
+
phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
214
|
+
device_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
215
|
+
platform: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
216
|
+
app_version: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
217
|
+
ad_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
218
|
+
context: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
219
|
+
screen: z.ZodOptional<z.ZodObject<{
|
|
220
|
+
route: z.ZodString;
|
|
221
|
+
step: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
222
|
+
ids: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>>>;
|
|
223
|
+
error_fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
224
|
+
}, z.core.$strip>>;
|
|
225
|
+
device: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
226
|
+
app: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
227
|
+
requests: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
228
|
+
at: z.ZodString;
|
|
229
|
+
method: z.ZodString;
|
|
230
|
+
path: z.ZodString;
|
|
231
|
+
status: z.ZodNullable<z.ZodNumber>;
|
|
232
|
+
ms: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
233
|
+
message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
234
|
+
}, z.core.$strip>>>;
|
|
235
|
+
errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
236
|
+
at: z.ZodString;
|
|
237
|
+
source: z.ZodString;
|
|
238
|
+
message: z.ZodString;
|
|
239
|
+
}, z.core.$strip>>>;
|
|
240
|
+
}, z.core.$loose>>>;
|
|
241
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
242
|
+
url: z.ZodString;
|
|
243
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
244
|
+
mimetype: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
245
|
+
width: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
246
|
+
height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
247
|
+
}, z.core.$strip>>>;
|
|
248
|
+
}, z.core.$strip>;
|
|
249
|
+
export type SupportReportScreen = z.infer<typeof SupportReportScreenSchema>;
|
|
250
|
+
export type SupportReportReason = z.infer<typeof SupportReportReasonSchema>;
|
|
251
|
+
export type SupportReportAttachment = z.infer<typeof SupportReportAttachmentSchema>;
|
|
252
|
+
export type SupportReportRequestLog = z.infer<typeof SupportReportRequestLogSchema>;
|
|
253
|
+
export type SupportReportErrorLog = z.infer<typeof SupportReportErrorLogSchema>;
|
|
254
|
+
export type SupportReportContext = z.infer<typeof SupportReportContextSchema>;
|
|
255
|
+
export type SupportReportCreate = z.infer<typeof SupportReportCreateSchema>;
|