@voyantjs/notifications 0.19.0 → 0.21.0
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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +74 -0
- package/dist/providers/voyant-cloud-email.d.ts.map +1 -1
- package/dist/providers/voyant-cloud-email.js +46 -3
- package/dist/routes.d.ts +86 -17
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +14 -0
- package/dist/schema.d.ts +6 -6
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +3 -0
- package/dist/service-booking-documents.d.ts +2 -2
- package/dist/service-deliveries.d.ts +34 -5
- package/dist/service-deliveries.d.ts.map +1 -1
- package/dist/service-deliveries.js +119 -0
- package/dist/service-reminders.d.ts +34 -2
- package/dist/service-reminders.d.ts.map +1 -1
- package/dist/service-reminders.js +283 -23
- package/dist/service-shared.d.ts +1 -13
- package/dist/service-shared.d.ts.map +1 -1
- package/dist/service-shared.js +45 -5
- package/dist/service-templates.d.ts +10 -10
- package/dist/service.d.ts +4 -3
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +2 -1
- package/dist/validation.d.ts +37 -7
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +7 -1
- package/package.json +8 -8
package/dist/service-shared.js
CHANGED
|
@@ -188,6 +188,10 @@ function enrichPaymentSession(value) {
|
|
|
188
188
|
: typeof session.paymentMethod === "string"
|
|
189
189
|
? session.paymentMethod
|
|
190
190
|
: null,
|
|
191
|
+
isPaid: session.status === "paid" ||
|
|
192
|
+
session.status === "completed" ||
|
|
193
|
+
session.status === "succeeded" ||
|
|
194
|
+
Boolean(session.completedAt),
|
|
191
195
|
};
|
|
192
196
|
}
|
|
193
197
|
function enrichPaymentSchedule(value) {
|
|
@@ -246,14 +250,21 @@ export function normalizeNotificationTemplateData(data) {
|
|
|
246
250
|
const invoice = enrichInvoice(data.invoice);
|
|
247
251
|
const paymentSession = enrichPaymentSession(data.paymentSession);
|
|
248
252
|
const paymentSchedule = enrichPaymentSchedule(data.paymentSchedule);
|
|
253
|
+
const suppliedPayment = data.payment && typeof data.payment === "object" && !Array.isArray(data.payment)
|
|
254
|
+
? data.payment
|
|
255
|
+
: null;
|
|
249
256
|
const documents = Array.isArray(data.documents)
|
|
250
257
|
? data.documents.map((document) => enrichDocument(document))
|
|
251
258
|
: [];
|
|
252
259
|
const items = Array.isArray(data.items) ? data.items.map((item) => enrichBookingItem(item)) : [];
|
|
253
|
-
const
|
|
260
|
+
const derivedPayment = paymentSchedule && typeof paymentSchedule === "object"
|
|
254
261
|
? {
|
|
255
262
|
amount: paymentSchedule.amountDue ?? null,
|
|
256
|
-
currency: paymentSchedule.currency ??
|
|
263
|
+
currency: paymentSchedule.currency ??
|
|
264
|
+
invoice?.currency ??
|
|
265
|
+
paymentSession?.currency ??
|
|
266
|
+
booking?.currency ??
|
|
267
|
+
null,
|
|
257
268
|
dueDate: paymentSchedule.dueDate ?? null,
|
|
258
269
|
daysLeft: paymentSchedule.daysLeft ?? null,
|
|
259
270
|
reference: booking?.reference ??
|
|
@@ -264,8 +275,13 @@ export function normalizeNotificationTemplateData(data) {
|
|
|
264
275
|
null,
|
|
265
276
|
link: paymentSession?.paymentUrl ?? null,
|
|
266
277
|
payMode: paymentSchedule.type ?? null,
|
|
267
|
-
paidAmount: invoice?.paidAmount ??
|
|
268
|
-
|
|
278
|
+
paidAmount: invoice?.paidAmount ??
|
|
279
|
+
(paymentSession?.isPaid
|
|
280
|
+
? paymentSession.amount
|
|
281
|
+
: null),
|
|
282
|
+
balanceDue: invoice?.balanceDueAmount ??
|
|
283
|
+
paymentSchedule.amountDue ??
|
|
284
|
+
null,
|
|
269
285
|
isPaidInFull: invoice?.balanceDueAmount === 0,
|
|
270
286
|
}
|
|
271
287
|
: paymentSession && typeof paymentSession === "object"
|
|
@@ -283,7 +299,31 @@ export function normalizeNotificationTemplateData(data) {
|
|
|
283
299
|
isPaidInFull: invoice?.balanceDueAmount ===
|
|
284
300
|
0,
|
|
285
301
|
}
|
|
286
|
-
:
|
|
302
|
+
: invoice && typeof invoice === "object"
|
|
303
|
+
? {
|
|
304
|
+
amount: invoice.balanceDueAmount ?? null,
|
|
305
|
+
currency: invoice.currency ?? null,
|
|
306
|
+
dueDate: invoice.dueDate ?? null,
|
|
307
|
+
daysLeft: null,
|
|
308
|
+
reference: booking?.reference ??
|
|
309
|
+
invoice.number ??
|
|
310
|
+
null,
|
|
311
|
+
method: paymentSession?.method ??
|
|
312
|
+
paymentSession?.provider ??
|
|
313
|
+
null,
|
|
314
|
+
link: paymentSession?.paymentUrl ?? null,
|
|
315
|
+
payMode: null,
|
|
316
|
+
paidAmount: invoice.paidAmount ?? null,
|
|
317
|
+
balanceDue: invoice.balanceDueAmount ?? null,
|
|
318
|
+
isPaidInFull: invoice.balanceDueAmount === 0,
|
|
319
|
+
}
|
|
320
|
+
: null;
|
|
321
|
+
const payment = derivedPayment
|
|
322
|
+
? {
|
|
323
|
+
...derivedPayment,
|
|
324
|
+
...suppliedPayment,
|
|
325
|
+
}
|
|
326
|
+
: suppliedPayment;
|
|
287
327
|
const product = items.length > 0 && items[0] && typeof items[0] === "object"
|
|
288
328
|
? {
|
|
289
329
|
title: items[0].title ??
|
|
@@ -91,7 +91,7 @@ export declare function listReminderRules(db: PostgresJsDatabase, query: Notific
|
|
|
91
91
|
slug: string;
|
|
92
92
|
name: string;
|
|
93
93
|
status: "active" | "draft" | "archived";
|
|
94
|
-
targetType: "invoice" | "booking_payment_schedule";
|
|
94
|
+
targetType: "booking_confirmed" | "invoice" | "booking_payment_schedule" | "payment_complete" | "booking_cancelled_non_payment";
|
|
95
95
|
channel: "email" | "sms";
|
|
96
96
|
provider: string | null;
|
|
97
97
|
templateId: string | null;
|
|
@@ -111,7 +111,7 @@ export declare function getReminderRuleById(db: PostgresJsDatabase, id: string):
|
|
|
111
111
|
slug: string;
|
|
112
112
|
name: string;
|
|
113
113
|
status: "active" | "draft" | "archived";
|
|
114
|
-
targetType: "invoice" | "booking_payment_schedule";
|
|
114
|
+
targetType: "booking_confirmed" | "invoice" | "booking_payment_schedule" | "payment_complete" | "booking_cancelled_non_payment";
|
|
115
115
|
channel: "email" | "sms";
|
|
116
116
|
provider: string | null;
|
|
117
117
|
templateId: string | null;
|
|
@@ -132,7 +132,7 @@ export declare function createReminderRule(db: PostgresJsDatabase, data: CreateN
|
|
|
132
132
|
status: "active" | "draft" | "archived";
|
|
133
133
|
provider: string | null;
|
|
134
134
|
channel: "email" | "sms";
|
|
135
|
-
targetType: "invoice" | "booking_payment_schedule";
|
|
135
|
+
targetType: "booking_confirmed" | "invoice" | "booking_payment_schedule" | "payment_complete" | "booking_cancelled_non_payment";
|
|
136
136
|
templateId: string | null;
|
|
137
137
|
isSystem: boolean;
|
|
138
138
|
templateSlug: string | null;
|
|
@@ -143,7 +143,7 @@ export declare function updateReminderRule(db: PostgresJsDatabase, id: string, d
|
|
|
143
143
|
slug: string;
|
|
144
144
|
name: string;
|
|
145
145
|
status: "active" | "draft" | "archived";
|
|
146
|
-
targetType: "invoice" | "booking_payment_schedule";
|
|
146
|
+
targetType: "booking_confirmed" | "invoice" | "booking_payment_schedule" | "payment_complete" | "booking_cancelled_non_payment";
|
|
147
147
|
channel: "email" | "sms";
|
|
148
148
|
provider: string | null;
|
|
149
149
|
templateId: string | null;
|
|
@@ -158,7 +158,7 @@ export declare function listReminderRuns(db: PostgresJsDatabase, query: Notifica
|
|
|
158
158
|
data: {
|
|
159
159
|
id: string;
|
|
160
160
|
reminderRuleId: string;
|
|
161
|
-
targetType: "invoice" | "booking_payment_schedule";
|
|
161
|
+
targetType: "booking_confirmed" | "invoice" | "booking_payment_schedule" | "payment_complete" | "booking_cancelled_non_payment";
|
|
162
162
|
targetId: string;
|
|
163
163
|
dedupeKey: string;
|
|
164
164
|
status: "failed" | "sent" | "processing" | "skipped" | "queued";
|
|
@@ -183,7 +183,7 @@ export declare function listReminderRuns(db: PostgresJsDatabase, query: Notifica
|
|
|
183
183
|
slug: string;
|
|
184
184
|
name: string;
|
|
185
185
|
status: "active" | "draft" | "archived";
|
|
186
|
-
targetType: "invoice" | "booking_payment_schedule";
|
|
186
|
+
targetType: "booking_confirmed" | "invoice" | "booking_payment_schedule" | "payment_complete" | "booking_cancelled_non_payment";
|
|
187
187
|
channel: "email" | "sms";
|
|
188
188
|
provider: string | null;
|
|
189
189
|
templateId: string | null;
|
|
@@ -192,7 +192,7 @@ export declare function listReminderRuns(db: PostgresJsDatabase, query: Notifica
|
|
|
192
192
|
};
|
|
193
193
|
delivery: {
|
|
194
194
|
id: string;
|
|
195
|
-
status: "pending" | "
|
|
195
|
+
status: "pending" | "failed" | "cancelled" | "sent";
|
|
196
196
|
channel: "email" | "sms";
|
|
197
197
|
provider: string;
|
|
198
198
|
toAddress: string;
|
|
@@ -209,7 +209,7 @@ export declare function listReminderRuns(db: PostgresJsDatabase, query: Notifica
|
|
|
209
209
|
export declare function getReminderRunById(db: PostgresJsDatabase, id: string): Promise<{
|
|
210
210
|
id: string;
|
|
211
211
|
reminderRuleId: string;
|
|
212
|
-
targetType: "invoice" | "booking_payment_schedule";
|
|
212
|
+
targetType: "booking_confirmed" | "invoice" | "booking_payment_schedule" | "payment_complete" | "booking_cancelled_non_payment";
|
|
213
213
|
targetId: string;
|
|
214
214
|
dedupeKey: string;
|
|
215
215
|
status: "failed" | "sent" | "processing" | "skipped" | "queued";
|
|
@@ -234,7 +234,7 @@ export declare function getReminderRunById(db: PostgresJsDatabase, id: string):
|
|
|
234
234
|
slug: string;
|
|
235
235
|
name: string;
|
|
236
236
|
status: "active" | "draft" | "archived";
|
|
237
|
-
targetType: "invoice" | "booking_payment_schedule";
|
|
237
|
+
targetType: "booking_confirmed" | "invoice" | "booking_payment_schedule" | "payment_complete" | "booking_cancelled_non_payment";
|
|
238
238
|
channel: "email" | "sms";
|
|
239
239
|
provider: string | null;
|
|
240
240
|
templateId: string | null;
|
|
@@ -243,7 +243,7 @@ export declare function getReminderRunById(db: PostgresJsDatabase, id: string):
|
|
|
243
243
|
};
|
|
244
244
|
delivery: {
|
|
245
245
|
id: string;
|
|
246
|
-
status: "pending" | "
|
|
246
|
+
status: "pending" | "failed" | "cancelled" | "sent";
|
|
247
247
|
channel: "email" | "sms";
|
|
248
248
|
provider: string;
|
|
249
249
|
toAddress: string;
|
package/dist/service.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { createDefaultBookingDocumentAttachment } from "./service-booking-docume
|
|
|
2
2
|
export type { NotificationService } from "./service-shared.js";
|
|
3
3
|
export { createNotificationService, NotificationError, previewNotificationTemplate, renderNotificationTemplate, summarizeNotificationAttachments, } from "./service-shared.js";
|
|
4
4
|
import { createDefaultBookingDocumentAttachment } from "./service-booking-documents.js";
|
|
5
|
-
import { getDeliveryById, listDeliveries, sendInvoiceNotification, sendNotification, sendPaymentSessionNotification } from "./service-deliveries.js";
|
|
5
|
+
import { getDeliveryById, listDeliveries, resendDelivery, sendInvoiceNotification, sendNotification, sendPaymentSessionNotification } from "./service-deliveries.js";
|
|
6
6
|
import { runDueReminders } from "./service-reminders.js";
|
|
7
7
|
import { previewNotificationTemplate } from "./service-shared.js";
|
|
8
8
|
import { createReminderRule, createTemplate, getReminderRuleById, getReminderRunById, getTemplateById, getTemplateBySlug, listReminderRules, listReminderRuns, listTemplates, updateReminderRule, updateTemplate } from "./service-templates.js";
|
|
@@ -15,6 +15,7 @@ export declare const notificationsService: {
|
|
|
15
15
|
previewNotificationTemplate: typeof previewNotificationTemplate;
|
|
16
16
|
listDeliveries: typeof listDeliveries;
|
|
17
17
|
getDeliveryById: typeof getDeliveryById;
|
|
18
|
+
resendDelivery: typeof resendDelivery;
|
|
18
19
|
sendNotification: typeof sendNotification;
|
|
19
20
|
listReminderRules: typeof listReminderRules;
|
|
20
21
|
getReminderRuleById: typeof getReminderRuleById;
|
|
@@ -116,7 +117,7 @@ export declare const notificationsService: {
|
|
|
116
117
|
channel: "email" | "sms";
|
|
117
118
|
provider: string;
|
|
118
119
|
providerMessageId: string | null;
|
|
119
|
-
status: "pending" | "
|
|
120
|
+
status: "pending" | "failed" | "cancelled" | "sent";
|
|
120
121
|
toAddress: string;
|
|
121
122
|
fromAddress: string | null;
|
|
122
123
|
subject: string | null;
|
|
@@ -231,7 +232,7 @@ export declare const notificationsService: {
|
|
|
231
232
|
channel: "email" | "sms";
|
|
232
233
|
provider: string;
|
|
233
234
|
providerMessageId: string | null;
|
|
234
|
-
status: "pending" | "
|
|
235
|
+
status: "pending" | "failed" | "cancelled" | "sent";
|
|
235
236
|
toAddress: string;
|
|
236
237
|
fromAddress: string | null;
|
|
237
238
|
subject: string | null;
|
package/dist/service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sCAAsC,EAAE,MAAM,gCAAgC,CAAA;AACvF,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,2BAA2B,EAC3B,0BAA0B,EAC1B,gCAAgC,GACjC,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAEL,sCAAsC,EACvC,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,gBAAgB,EAChB,8BAA8B,EAC/B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAA;AACjE,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,cAAc,EACf,MAAM,wBAAwB,CAAA;AAE/B,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sCAAsC,EAAE,MAAM,gCAAgC,CAAA;AACvF,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,2BAA2B,EAC3B,0BAA0B,EAC1B,gCAAgC,GACjC,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAEL,sCAAsC,EACvC,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,eAAe,EACf,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,gBAAgB,EAChB,8BAA8B,EAC/B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAA;AACjE,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,cAAc,EACf,MAAM,wBAAwB,CAAA;AAE/B,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0BmkV,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CADpmV,CAAA"}
|
package/dist/service.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { createDefaultBookingDocumentAttachment } from "./service-booking-documents.js";
|
|
2
2
|
export { createNotificationService, NotificationError, previewNotificationTemplate, renderNotificationTemplate, summarizeNotificationAttachments, } from "./service-shared.js";
|
|
3
3
|
import { bookingDocumentNotificationsService, createDefaultBookingDocumentAttachment, } from "./service-booking-documents.js";
|
|
4
|
-
import { getDeliveryById, listDeliveries, sendInvoiceNotification, sendNotification, sendPaymentSessionNotification, } from "./service-deliveries.js";
|
|
4
|
+
import { getDeliveryById, listDeliveries, resendDelivery, sendInvoiceNotification, sendNotification, sendPaymentSessionNotification, } from "./service-deliveries.js";
|
|
5
5
|
import { runDueReminders } from "./service-reminders.js";
|
|
6
6
|
import { previewNotificationTemplate } from "./service-shared.js";
|
|
7
7
|
import { createReminderRule, createTemplate, getReminderRuleById, getReminderRunById, getTemplateById, getTemplateBySlug, listReminderRules, listReminderRuns, listTemplates, updateReminderRule, updateTemplate, } from "./service-templates.js";
|
|
@@ -14,6 +14,7 @@ export const notificationsService = {
|
|
|
14
14
|
previewNotificationTemplate,
|
|
15
15
|
listDeliveries,
|
|
16
16
|
getDeliveryById,
|
|
17
|
+
resendDelivery,
|
|
17
18
|
sendNotification,
|
|
18
19
|
listReminderRules,
|
|
19
20
|
getReminderRuleById,
|
package/dist/validation.d.ts
CHANGED
|
@@ -10,8 +10,8 @@ export declare const notificationTemplateStatusSchema: z.ZodEnum<{
|
|
|
10
10
|
}>;
|
|
11
11
|
export declare const notificationDeliveryStatusSchema: z.ZodEnum<{
|
|
12
12
|
pending: "pending";
|
|
13
|
-
cancelled: "cancelled";
|
|
14
13
|
failed: "failed";
|
|
14
|
+
cancelled: "cancelled";
|
|
15
15
|
sent: "sent";
|
|
16
16
|
}>;
|
|
17
17
|
export declare const notificationTargetTypeSchema: z.ZodEnum<{
|
|
@@ -30,8 +30,11 @@ export declare const notificationReminderStatusSchema: z.ZodEnum<{
|
|
|
30
30
|
archived: "archived";
|
|
31
31
|
}>;
|
|
32
32
|
export declare const notificationReminderTargetTypeSchema: z.ZodEnum<{
|
|
33
|
+
booking_confirmed: "booking_confirmed";
|
|
33
34
|
invoice: "invoice";
|
|
34
35
|
booking_payment_schedule: "booking_payment_schedule";
|
|
36
|
+
payment_complete: "payment_complete";
|
|
37
|
+
booking_cancelled_non_payment: "booking_cancelled_non_payment";
|
|
35
38
|
}>;
|
|
36
39
|
export declare const notificationReminderRunStatusSchema: z.ZodEnum<{
|
|
37
40
|
failed: "failed";
|
|
@@ -125,8 +128,8 @@ export declare const notificationDeliveryListQuerySchema: z.ZodObject<{
|
|
|
125
128
|
provider: z.ZodOptional<z.ZodString>;
|
|
126
129
|
status: z.ZodOptional<z.ZodEnum<{
|
|
127
130
|
pending: "pending";
|
|
128
|
-
cancelled: "cancelled";
|
|
129
131
|
failed: "failed";
|
|
132
|
+
cancelled: "cancelled";
|
|
130
133
|
sent: "sent";
|
|
131
134
|
}>>;
|
|
132
135
|
templateSlug: z.ZodOptional<z.ZodString>;
|
|
@@ -156,8 +159,11 @@ export declare const insertNotificationReminderRuleSchema: z.ZodObject<{
|
|
|
156
159
|
archived: "archived";
|
|
157
160
|
}>>;
|
|
158
161
|
targetType: z.ZodEnum<{
|
|
162
|
+
booking_confirmed: "booking_confirmed";
|
|
159
163
|
invoice: "invoice";
|
|
160
164
|
booking_payment_schedule: "booking_payment_schedule";
|
|
165
|
+
payment_complete: "payment_complete";
|
|
166
|
+
booking_cancelled_non_payment: "booking_cancelled_non_payment";
|
|
161
167
|
}>;
|
|
162
168
|
channel: z.ZodEnum<{
|
|
163
169
|
email: "email";
|
|
@@ -179,8 +185,11 @@ export declare const updateNotificationReminderRuleSchema: z.ZodObject<{
|
|
|
179
185
|
archived: "archived";
|
|
180
186
|
}>>>;
|
|
181
187
|
targetType: z.ZodOptional<z.ZodEnum<{
|
|
188
|
+
booking_confirmed: "booking_confirmed";
|
|
182
189
|
invoice: "invoice";
|
|
183
190
|
booking_payment_schedule: "booking_payment_schedule";
|
|
191
|
+
payment_complete: "payment_complete";
|
|
192
|
+
booking_cancelled_non_payment: "booking_cancelled_non_payment";
|
|
184
193
|
}>>;
|
|
185
194
|
channel: z.ZodOptional<z.ZodEnum<{
|
|
186
195
|
email: "email";
|
|
@@ -202,8 +211,11 @@ export declare const notificationReminderRuleListQuerySchema: z.ZodObject<{
|
|
|
202
211
|
archived: "archived";
|
|
203
212
|
}>>;
|
|
204
213
|
targetType: z.ZodOptional<z.ZodEnum<{
|
|
214
|
+
booking_confirmed: "booking_confirmed";
|
|
205
215
|
invoice: "invoice";
|
|
206
216
|
booking_payment_schedule: "booking_payment_schedule";
|
|
217
|
+
payment_complete: "payment_complete";
|
|
218
|
+
booking_cancelled_non_payment: "booking_cancelled_non_payment";
|
|
207
219
|
}>>;
|
|
208
220
|
channel: z.ZodOptional<z.ZodEnum<{
|
|
209
221
|
email: "email";
|
|
@@ -216,8 +228,11 @@ export declare const notificationReminderRunListQuerySchema: z.ZodObject<{
|
|
|
216
228
|
offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
217
229
|
reminderRuleId: z.ZodOptional<z.ZodString>;
|
|
218
230
|
targetType: z.ZodOptional<z.ZodEnum<{
|
|
231
|
+
booking_confirmed: "booking_confirmed";
|
|
219
232
|
invoice: "invoice";
|
|
220
233
|
booking_payment_schedule: "booking_payment_schedule";
|
|
234
|
+
payment_complete: "payment_complete";
|
|
235
|
+
booking_cancelled_non_payment: "booking_cancelled_non_payment";
|
|
221
236
|
}>>;
|
|
222
237
|
targetId: z.ZodOptional<z.ZodString>;
|
|
223
238
|
scheduleId: z.ZodOptional<z.ZodString>;
|
|
@@ -246,8 +261,11 @@ export declare const notificationReminderRunRuleSummarySchema: z.ZodObject<{
|
|
|
246
261
|
archived: "archived";
|
|
247
262
|
}>;
|
|
248
263
|
targetType: z.ZodEnum<{
|
|
264
|
+
booking_confirmed: "booking_confirmed";
|
|
249
265
|
invoice: "invoice";
|
|
250
266
|
booking_payment_schedule: "booking_payment_schedule";
|
|
267
|
+
payment_complete: "payment_complete";
|
|
268
|
+
booking_cancelled_non_payment: "booking_cancelled_non_payment";
|
|
251
269
|
}>;
|
|
252
270
|
channel: z.ZodEnum<{
|
|
253
271
|
email: "email";
|
|
@@ -262,8 +280,8 @@ export declare const notificationReminderRunDeliverySummarySchema: z.ZodObject<{
|
|
|
262
280
|
id: z.ZodString;
|
|
263
281
|
status: z.ZodEnum<{
|
|
264
282
|
pending: "pending";
|
|
265
|
-
cancelled: "cancelled";
|
|
266
283
|
failed: "failed";
|
|
284
|
+
cancelled: "cancelled";
|
|
267
285
|
sent: "sent";
|
|
268
286
|
}>;
|
|
269
287
|
channel: z.ZodEnum<{
|
|
@@ -290,8 +308,11 @@ export declare const notificationReminderRunRecordSchema: z.ZodObject<{
|
|
|
290
308
|
id: z.ZodString;
|
|
291
309
|
reminderRuleId: z.ZodString;
|
|
292
310
|
targetType: z.ZodEnum<{
|
|
311
|
+
booking_confirmed: "booking_confirmed";
|
|
293
312
|
invoice: "invoice";
|
|
294
313
|
booking_payment_schedule: "booking_payment_schedule";
|
|
314
|
+
payment_complete: "payment_complete";
|
|
315
|
+
booking_cancelled_non_payment: "booking_cancelled_non_payment";
|
|
295
316
|
}>;
|
|
296
317
|
targetId: z.ZodString;
|
|
297
318
|
dedupeKey: z.ZodString;
|
|
@@ -328,8 +349,11 @@ export declare const notificationReminderRunRecordSchema: z.ZodObject<{
|
|
|
328
349
|
archived: "archived";
|
|
329
350
|
}>;
|
|
330
351
|
targetType: z.ZodEnum<{
|
|
352
|
+
booking_confirmed: "booking_confirmed";
|
|
331
353
|
invoice: "invoice";
|
|
332
354
|
booking_payment_schedule: "booking_payment_schedule";
|
|
355
|
+
payment_complete: "payment_complete";
|
|
356
|
+
booking_cancelled_non_payment: "booking_cancelled_non_payment";
|
|
333
357
|
}>;
|
|
334
358
|
channel: z.ZodEnum<{
|
|
335
359
|
email: "email";
|
|
@@ -344,8 +368,8 @@ export declare const notificationReminderRunRecordSchema: z.ZodObject<{
|
|
|
344
368
|
id: z.ZodString;
|
|
345
369
|
status: z.ZodEnum<{
|
|
346
370
|
pending: "pending";
|
|
347
|
-
cancelled: "cancelled";
|
|
348
371
|
failed: "failed";
|
|
372
|
+
cancelled: "cancelled";
|
|
349
373
|
sent: "sent";
|
|
350
374
|
}>;
|
|
351
375
|
channel: z.ZodEnum<{
|
|
@@ -365,8 +389,11 @@ export declare const notificationReminderRunListResponseSchema: z.ZodObject<{
|
|
|
365
389
|
id: z.ZodString;
|
|
366
390
|
reminderRuleId: z.ZodString;
|
|
367
391
|
targetType: z.ZodEnum<{
|
|
392
|
+
booking_confirmed: "booking_confirmed";
|
|
368
393
|
invoice: "invoice";
|
|
369
394
|
booking_payment_schedule: "booking_payment_schedule";
|
|
395
|
+
payment_complete: "payment_complete";
|
|
396
|
+
booking_cancelled_non_payment: "booking_cancelled_non_payment";
|
|
370
397
|
}>;
|
|
371
398
|
targetId: z.ZodString;
|
|
372
399
|
dedupeKey: z.ZodString;
|
|
@@ -403,8 +430,11 @@ export declare const notificationReminderRunListResponseSchema: z.ZodObject<{
|
|
|
403
430
|
archived: "archived";
|
|
404
431
|
}>;
|
|
405
432
|
targetType: z.ZodEnum<{
|
|
433
|
+
booking_confirmed: "booking_confirmed";
|
|
406
434
|
invoice: "invoice";
|
|
407
435
|
booking_payment_schedule: "booking_payment_schedule";
|
|
436
|
+
payment_complete: "payment_complete";
|
|
437
|
+
booking_cancelled_non_payment: "booking_cancelled_non_payment";
|
|
408
438
|
}>;
|
|
409
439
|
channel: z.ZodEnum<{
|
|
410
440
|
email: "email";
|
|
@@ -419,8 +449,8 @@ export declare const notificationReminderRunListResponseSchema: z.ZodObject<{
|
|
|
419
449
|
id: z.ZodString;
|
|
420
450
|
status: z.ZodEnum<{
|
|
421
451
|
pending: "pending";
|
|
422
|
-
cancelled: "cancelled";
|
|
423
452
|
failed: "failed";
|
|
453
|
+
cancelled: "cancelled";
|
|
424
454
|
sent: "sent";
|
|
425
455
|
}>;
|
|
426
456
|
channel: z.ZodEnum<{
|
|
@@ -674,8 +704,8 @@ export declare const sendBookingDocumentsNotificationResultSchema: z.ZodObject<{
|
|
|
674
704
|
provider: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
675
705
|
status: z.ZodEnum<{
|
|
676
706
|
pending: "pending";
|
|
677
|
-
cancelled: "cancelled";
|
|
678
707
|
failed: "failed";
|
|
708
|
+
cancelled: "cancelled";
|
|
679
709
|
sent: "sent";
|
|
680
710
|
}>;
|
|
681
711
|
}, z.core.$strip>;
|
|
@@ -741,8 +771,8 @@ export declare const confirmAndDispatchBookingResultSchema: z.ZodObject<{
|
|
|
741
771
|
provider: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
742
772
|
status: z.ZodEnum<{
|
|
743
773
|
pending: "pending";
|
|
744
|
-
cancelled: "cancelled";
|
|
745
774
|
failed: "failed";
|
|
775
|
+
cancelled: "cancelled";
|
|
746
776
|
sent: "sent";
|
|
747
777
|
}>;
|
|
748
778
|
}, z.core.$strip>>;
|
package/dist/validation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,yBAAyB;;;EAA2B,CAAA;AACjE,eAAO,MAAM,gCAAgC;;;;EAA0C,CAAA;AACvF,eAAO,MAAM,gCAAgC;;;;;EAAqD,CAAA;AAClG,eAAO,MAAM,4BAA4B;;;;;;;;;EASvC,CAAA;AACF,eAAO,MAAM,gCAAgC;;;;EAA0C,CAAA;AACvF,eAAO,MAAM,oCAAoC
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,yBAAyB;;;EAA2B,CAAA;AACjE,eAAO,MAAM,gCAAgC;;;;EAA0C,CAAA;AACvF,eAAO,MAAM,gCAAgC;;;;;EAAqD,CAAA;AAClG,eAAO,MAAM,4BAA4B;;;;;;;;;EASvC,CAAA;AACF,eAAO,MAAM,gCAAgC;;;;EAA0C,CAAA;AACvF,eAAO,MAAM,oCAAoC;;;;;;EAM/C,CAAA;AACF,eAAO,MAAM,mCAAmC;;;;;;EAM9C,CAAA;AACF,eAAO,MAAM,8BAA8B;;;;EAA8C,CAAA;AACzF,eAAO,MAAM,gCAAgC;;;EAA+B,CAAA;AAC5E,eAAO,MAAM,4BAA4B;;;;;;;;;;iBAYrC,CAAA;AAqBJ,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;iBAAiC,CAAA;AAC9E,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;iBAA2C,CAAA;AAExF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;iBAK9C,CAAA;AAEF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAY9C,CAAA;AAgBF,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;iBAMhD,CAAA;AAED,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;iBAI7C,CAAA;AAEJ,eAAO,MAAM,uCAAuC;;;;;;;;;;;;;;;;;;;;iBAKlD,CAAA;AAEF,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAajD,CAAA;AAEF,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;iBAWnD,CAAA;AAEF,eAAO,MAAM,4CAA4C;;;;;;;;;;;;;;;;;;iBAUvD,CAAA;AAEF,eAAO,MAAM,kCAAkC;;;;;;;;iBAQ7C,CAAA;AAEF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiB9C,CAAA;AAEF,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKpD,CAAA;AAEF,eAAO,MAAM,qBAAqB;;iBAEhC,CAAA;AAkBF,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMhD,CAAA;AAED,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMzC,CAAA;AAED,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6BhC,CAAA;AAEH,eAAO,MAAM,iCAAiC;;;;;;;;;;;iBAY1C,CAAA;AAEJ,eAAO,MAAM,uCAAuC;;;;;;;;;;iBAOlD,CAAA;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmB1C,CAAA;AAEF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGtC,CAAA;AAEF,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;iBAajD,CAAA;AAEF,eAAO,MAAM,4CAA4C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAOvD,CAAA;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;iBAE1C,CAAA;AAEF,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwBhD,CAAA"}
|
package/dist/validation.js
CHANGED
|
@@ -13,7 +13,13 @@ export const notificationTargetTypeSchema = z.enum([
|
|
|
13
13
|
"other",
|
|
14
14
|
]);
|
|
15
15
|
export const notificationReminderStatusSchema = z.enum(["draft", "active", "archived"]);
|
|
16
|
-
export const notificationReminderTargetTypeSchema = z.enum([
|
|
16
|
+
export const notificationReminderTargetTypeSchema = z.enum([
|
|
17
|
+
"booking_confirmed",
|
|
18
|
+
"booking_payment_schedule",
|
|
19
|
+
"payment_complete",
|
|
20
|
+
"booking_cancelled_non_payment",
|
|
21
|
+
"invoice",
|
|
22
|
+
]);
|
|
17
23
|
export const notificationReminderRunStatusSchema = z.enum([
|
|
18
24
|
"queued",
|
|
19
25
|
"processing",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/notifications",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -56,17 +56,17 @@
|
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@voyantjs/cloud-sdk": "^0.6.
|
|
59
|
+
"@voyantjs/cloud-sdk": "^0.6.2",
|
|
60
60
|
"drizzle-orm": "^0.45.2",
|
|
61
61
|
"hono": "^4.12.10",
|
|
62
62
|
"liquidjs": "^10.24.0",
|
|
63
63
|
"zod": "^4.3.6",
|
|
64
|
-
"@voyantjs/bookings": "0.
|
|
65
|
-
"@voyantjs/core": "0.
|
|
66
|
-
"@voyantjs/db": "0.
|
|
67
|
-
"@voyantjs/finance": "0.
|
|
68
|
-
"@voyantjs/hono": "0.
|
|
69
|
-
"@voyantjs/legal": "0.
|
|
64
|
+
"@voyantjs/bookings": "0.21.0",
|
|
65
|
+
"@voyantjs/core": "0.21.0",
|
|
66
|
+
"@voyantjs/db": "0.21.0",
|
|
67
|
+
"@voyantjs/finance": "0.21.0",
|
|
68
|
+
"@voyantjs/hono": "0.21.0",
|
|
69
|
+
"@voyantjs/legal": "0.21.0"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"typescript": "^6.0.2",
|