@voyantjs/notifications 0.6.8 → 0.7.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/service.js CHANGED
@@ -1,8 +1,9 @@
1
1
  export { createDefaultBookingDocumentAttachment } from "./service-booking-documents.js";
2
- export { createNotificationService, NotificationError, renderNotificationTemplate, summarizeNotificationAttachments, } from "./service-shared.js";
2
+ export { createNotificationService, NotificationError, previewNotificationTemplate, renderNotificationTemplate, summarizeNotificationAttachments, } from "./service-shared.js";
3
3
  import { bookingDocumentNotificationsService, createDefaultBookingDocumentAttachment, } from "./service-booking-documents.js";
4
4
  import { getDeliveryById, listDeliveries, sendInvoiceNotification, sendNotification, sendPaymentSessionNotification, } from "./service-deliveries.js";
5
5
  import { runDueReminders } from "./service-reminders.js";
6
+ import { previewNotificationTemplate } from "./service-shared.js";
6
7
  import { createReminderRule, createTemplate, getReminderRuleById, getReminderRunById, getTemplateById, getTemplateBySlug, listReminderRules, listReminderRuns, listTemplates, updateReminderRule, updateTemplate, } from "./service-templates.js";
7
8
  export const notificationsService = {
8
9
  listTemplates,
@@ -10,6 +11,7 @@ export const notificationsService = {
10
11
  getTemplateBySlug,
11
12
  createTemplate,
12
13
  updateTemplate,
14
+ previewNotificationTemplate,
13
15
  listDeliveries,
14
16
  getDeliveryById,
15
17
  sendNotification,
@@ -24,5 +26,6 @@ export const notificationsService = {
24
26
  sendInvoiceNotification,
25
27
  listBookingDocumentBundle: bookingDocumentNotificationsService.listBookingDocumentBundle,
26
28
  sendBookingDocumentsNotification: bookingDocumentNotificationsService.sendBookingDocumentsNotification,
29
+ confirmAndDispatchBooking: bookingDocumentNotificationsService.confirmAndDispatchBooking,
27
30
  createDefaultBookingDocumentAttachment,
28
31
  };
@@ -4,6 +4,6 @@ export declare function deliverQueuedNotificationReminder(db: PostgresJsDatabase
4
4
  reminderRunId: string;
5
5
  }, options?: NotificationTaskRuntimeOptions): Promise<{
6
6
  reminderRunId: string;
7
- status: "failed" | "sent" | "processing" | "queued" | "skipped" | null;
7
+ status: "failed" | "sent" | "processing" | "skipped" | "queued" | null;
8
8
  }>;
9
9
  //# sourceMappingURL=deliver-reminder.d.ts.map
@@ -0,0 +1,23 @@
1
+ export type NotificationTemplateVariableType = "string" | "number" | "currency" | "date" | "datetime" | "boolean" | "email" | "phone" | "url" | "array";
2
+ export interface NotificationTemplateVariableDefinition {
3
+ key: string;
4
+ label: string;
5
+ example: string;
6
+ type: NotificationTemplateVariableType;
7
+ description?: string;
8
+ }
9
+ export interface NotificationTemplateVariableCategory {
10
+ id: string;
11
+ label: string;
12
+ description?: string;
13
+ variables: NotificationTemplateVariableDefinition[];
14
+ }
15
+ export interface NotificationLiquidSnippet {
16
+ id: string;
17
+ label: string;
18
+ description: string;
19
+ code: string;
20
+ }
21
+ export declare const notificationTemplateVariableCatalog: NotificationTemplateVariableCategory[];
22
+ export declare const notificationLiquidSnippets: NotificationLiquidSnippet[];
23
+ //# sourceMappingURL=template-authoring.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-authoring.d.ts","sourceRoot":"","sources":["../src/template-authoring.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gCAAgC,GACxC,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,MAAM,GACN,UAAU,GACV,SAAS,GACT,OAAO,GACP,OAAO,GACP,KAAK,GACL,OAAO,CAAA;AAEX,MAAM,WAAW,sCAAsC;IACrD,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,gCAAgC,CAAA;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,oCAAoC;IACnD,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,sCAAsC,EAAE,CAAA;CACpD;AAED,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;CACb;AAED,eAAO,MAAM,mCAAmC,EAAE,oCAAoC,EA4UrF,CAAA;AAED,eAAO,MAAM,0BAA0B,EAAE,yBAAyB,EAuDjE,CAAA"}
@@ -0,0 +1,386 @@
1
+ export const notificationTemplateVariableCatalog = [
2
+ {
3
+ id: "traveler",
4
+ label: "Traveler",
5
+ description: "Primary traveler/recipient context commonly available in booking, invoice, and reminder notifications.",
6
+ variables: [
7
+ { key: "traveler.firstName", label: "First name", example: "Arthur", type: "string" },
8
+ { key: "traveler.lastName", label: "Last name", example: "Silva", type: "string" },
9
+ { key: "traveler.fullName", label: "Full name", example: "Arthur Silva", type: "string" },
10
+ { key: "traveler.name", label: "Display name", example: "Arthur Silva", type: "string" },
11
+ { key: "traveler.email", label: "Email", example: "arthur@example.com", type: "email" },
12
+ { key: "traveler.phone", label: "Phone", example: "+40 721 111 222", type: "phone" },
13
+ {
14
+ key: "traveler.participantType",
15
+ label: "Traveler type",
16
+ example: "traveler",
17
+ type: "string",
18
+ },
19
+ { key: "traveler.role", label: "Role", example: "traveler", type: "string" },
20
+ { key: "traveler.isPrimary", label: "Is primary", example: "true", type: "boolean" },
21
+ ],
22
+ },
23
+ {
24
+ id: "billingPerson",
25
+ label: "Billing person",
26
+ description: "Alias of the primary traveler for friendlier template naming.",
27
+ variables: [
28
+ { key: "billingPerson.firstName", label: "First name", example: "Arthur", type: "string" },
29
+ { key: "billingPerson.lastName", label: "Last name", example: "Silva", type: "string" },
30
+ {
31
+ key: "billingPerson.fullName",
32
+ label: "Full name",
33
+ example: "Arthur Silva",
34
+ type: "string",
35
+ },
36
+ { key: "billingPerson.email", label: "Email", example: "arthur@example.com", type: "email" },
37
+ { key: "billingPerson.phone", label: "Phone", example: "+40 721 111 222", type: "phone" },
38
+ ],
39
+ },
40
+ {
41
+ id: "travelers",
42
+ label: "Travelers (loop)",
43
+ description: "All booking travelers. Use in `{% for traveler in travelers %}` loops.",
44
+ variables: [
45
+ {
46
+ key: "travelers",
47
+ label: "Travelers array",
48
+ example: '[{ firstName: "Arthur" }]',
49
+ type: "array",
50
+ },
51
+ {
52
+ key: "travelers[0].firstName",
53
+ label: "First traveler first name",
54
+ example: "Arthur",
55
+ type: "string",
56
+ },
57
+ {
58
+ key: "travelers[0].lastName",
59
+ label: "First traveler last name",
60
+ example: "Silva",
61
+ type: "string",
62
+ },
63
+ {
64
+ key: "travelers[0].fullName",
65
+ label: "First traveler full name",
66
+ example: "Arthur Silva",
67
+ type: "string",
68
+ },
69
+ {
70
+ key: "travelers[0].email",
71
+ label: "First traveler email",
72
+ example: "arthur@example.com",
73
+ type: "email",
74
+ },
75
+ {
76
+ key: "travelers[0].participantType",
77
+ label: "First traveler type",
78
+ example: "traveler",
79
+ type: "string",
80
+ },
81
+ {
82
+ key: "travelers[0].isPrimary",
83
+ label: "First traveler is primary",
84
+ example: "true",
85
+ type: "boolean",
86
+ },
87
+ ],
88
+ },
89
+ {
90
+ id: "booking",
91
+ label: "Booking",
92
+ description: "Available for booking, invoice, payment-session, reminder, and document notifications.",
93
+ variables: [
94
+ { key: "booking.id", label: "Booking ID", example: "book_01abcxyz", type: "string" },
95
+ {
96
+ key: "booking.bookingNumber",
97
+ label: "Booking number",
98
+ example: "BKG-2026-00125",
99
+ type: "string",
100
+ },
101
+ { key: "booking.reference", label: "Reference", example: "BKG-2026-00125", type: "string" },
102
+ { key: "booking.code", label: "Code", example: "BKG-2026-00125", type: "string" },
103
+ { key: "booking.status", label: "Status", example: "confirmed", type: "string" },
104
+ { key: "booking.startDate", label: "Start date", example: "2026-06-15", type: "date" },
105
+ { key: "booking.endDate", label: "End date", example: "2026-06-22", type: "date" },
106
+ {
107
+ key: "booking.dateRange",
108
+ label: "Date range",
109
+ example: "2026-06-15 - 2026-06-22",
110
+ type: "string",
111
+ },
112
+ {
113
+ key: "booking.sellAmountCents",
114
+ label: "Total amount (cents)",
115
+ example: "249900",
116
+ type: "number",
117
+ },
118
+ { key: "booking.total", label: "Total amount", example: "2499", type: "currency" },
119
+ { key: "booking.totalAmount", label: "Total amount", example: "2499", type: "currency" },
120
+ { key: "booking.totalPrice", label: "Total price", example: "2499", type: "currency" },
121
+ { key: "booking.currency", label: "Currency", example: "EUR", type: "string" },
122
+ ],
123
+ },
124
+ {
125
+ id: "invoice",
126
+ label: "Invoice",
127
+ description: "Available in invoice notifications and invoice reminder flows.",
128
+ variables: [
129
+ { key: "invoice.id", label: "Invoice ID", example: "inv_01abcxyz", type: "string" },
130
+ {
131
+ key: "invoice.invoiceNumber",
132
+ label: "Invoice number",
133
+ example: "INV-2026-0042",
134
+ type: "string",
135
+ },
136
+ {
137
+ key: "invoice.number",
138
+ label: "Invoice number alias",
139
+ example: "INV-2026-0042",
140
+ type: "string",
141
+ },
142
+ { key: "invoice.invoiceType", label: "Invoice type", example: "customer", type: "string" },
143
+ { key: "invoice.type", label: "Invoice type alias", example: "customer", type: "string" },
144
+ { key: "invoice.status", label: "Invoice status", example: "issued", type: "string" },
145
+ { key: "invoice.issueDate", label: "Issue date", example: "2026-04-20", type: "date" },
146
+ { key: "invoice.dueDate", label: "Due date", example: "2026-05-01", type: "date" },
147
+ { key: "invoice.subtotalAmount", label: "Subtotal", example: "1299", type: "currency" },
148
+ { key: "invoice.taxAmount", label: "Tax", example: "200", type: "currency" },
149
+ { key: "invoice.totalAmount", label: "Total amount", example: "1499", type: "currency" },
150
+ { key: "invoice.paidAmount", label: "Paid amount", example: "500", type: "currency" },
151
+ { key: "invoice.balanceDueAmount", label: "Balance due", example: "999", type: "currency" },
152
+ { key: "invoice.currency", label: "Currency", example: "EUR", type: "string" },
153
+ ],
154
+ },
155
+ {
156
+ id: "payment",
157
+ label: "Payment",
158
+ description: "Normalized reminder/payment object. Best option for generic payment templates.",
159
+ variables: [
160
+ { key: "payment.amount", label: "Amount", example: "500", type: "currency" },
161
+ { key: "payment.currency", label: "Currency", example: "EUR", type: "string" },
162
+ { key: "payment.dueDate", label: "Due date", example: "2026-05-01", type: "date" },
163
+ { key: "payment.daysLeft", label: "Days left", example: "3", type: "number" },
164
+ { key: "payment.reference", label: "Reference", example: "INV-2026-0042", type: "string" },
165
+ { key: "payment.method", label: "Method", example: "card", type: "string" },
166
+ {
167
+ key: "payment.link",
168
+ label: "Payment link",
169
+ example: "https://pay.example.com/session/123",
170
+ type: "url",
171
+ },
172
+ { key: "payment.payMode", label: "Pay mode", example: "deposit", type: "string" },
173
+ { key: "payment.paidAmount", label: "Paid amount", example: "500", type: "currency" },
174
+ { key: "payment.balanceDue", label: "Balance due", example: "999", type: "currency" },
175
+ { key: "payment.isPaidInFull", label: "Is paid in full", example: "false", type: "boolean" },
176
+ ],
177
+ },
178
+ {
179
+ id: "paymentSession",
180
+ label: "Payment session",
181
+ description: "Available in payment-session notifications and invoice flows with active payment links.",
182
+ variables: [
183
+ { key: "paymentSession.id", label: "Session ID", example: "ps_01abcxyz", type: "string" },
184
+ { key: "paymentSession.status", label: "Status", example: "pending", type: "string" },
185
+ { key: "paymentSession.provider", label: "Provider", example: "stripe", type: "string" },
186
+ { key: "paymentSession.currency", label: "Currency", example: "EUR", type: "string" },
187
+ { key: "paymentSession.amount", label: "Amount", example: "500", type: "currency" },
188
+ {
189
+ key: "paymentSession.paymentMethod",
190
+ label: "Payment method",
191
+ example: "card",
192
+ type: "string",
193
+ },
194
+ { key: "paymentSession.method", label: "Method alias", example: "card", type: "string" },
195
+ {
196
+ key: "paymentSession.paymentUrl",
197
+ label: "Payment URL",
198
+ example: "https://pay.example.com/session/123",
199
+ type: "url",
200
+ },
201
+ {
202
+ key: "paymentSession.redirectUrl",
203
+ label: "Redirect URL",
204
+ example: "https://pay.example.com/session/123",
205
+ type: "url",
206
+ },
207
+ {
208
+ key: "paymentSession.returnUrl",
209
+ label: "Return URL",
210
+ example: "https://app.example.com/return",
211
+ type: "url",
212
+ },
213
+ {
214
+ key: "paymentSession.cancelUrl",
215
+ label: "Cancel URL",
216
+ example: "https://app.example.com/cancel",
217
+ type: "url",
218
+ },
219
+ {
220
+ key: "paymentSession.expiresAt",
221
+ label: "Expires at",
222
+ example: "2026-05-01T23:59:59Z",
223
+ type: "datetime",
224
+ },
225
+ {
226
+ key: "paymentSession.externalReference",
227
+ label: "External reference",
228
+ example: "PAY-2026-00456",
229
+ type: "string",
230
+ },
231
+ {
232
+ key: "paymentSession.reference",
233
+ label: "Reference alias",
234
+ example: "PAY-2026-00456",
235
+ type: "string",
236
+ },
237
+ ],
238
+ },
239
+ {
240
+ id: "paymentSchedule",
241
+ label: "Payment schedule",
242
+ description: "Available in booking payment reminders.",
243
+ variables: [
244
+ { key: "paymentSchedule.id", label: "Schedule ID", example: "bps_01abcxyz", type: "string" },
245
+ { key: "paymentSchedule.dueDate", label: "Due date", example: "2026-05-01", type: "date" },
246
+ { key: "paymentSchedule.amountDue", label: "Amount due", example: "500", type: "currency" },
247
+ { key: "paymentSchedule.currency", label: "Currency", example: "EUR", type: "string" },
248
+ { key: "paymentSchedule.type", label: "Schedule type", example: "deposit", type: "string" },
249
+ {
250
+ key: "paymentSchedule.scheduleType",
251
+ label: "Schedule type raw",
252
+ example: "deposit",
253
+ type: "string",
254
+ },
255
+ { key: "paymentSchedule.status", label: "Status", example: "pending", type: "string" },
256
+ { key: "paymentSchedule.daysLeft", label: "Days left", example: "3", type: "number" },
257
+ ],
258
+ },
259
+ {
260
+ id: "items",
261
+ label: "Items (loop)",
262
+ description: "Booking items. Use in `{% for item in items %}` loops.",
263
+ variables: [
264
+ { key: "items", label: "Items array", example: '[{ title: "Double Room" }]', type: "array" },
265
+ { key: "items[0].title", label: "First item title", example: "Double Room", type: "string" },
266
+ {
267
+ key: "items[0].description",
268
+ label: "First item description",
269
+ example: "Double Room",
270
+ type: "string",
271
+ },
272
+ { key: "items[0].quantity", label: "First item quantity", example: "1", type: "number" },
273
+ { key: "items[0].currency", label: "First item currency", example: "EUR", type: "string" },
274
+ {
275
+ key: "items[0].unitPrice",
276
+ label: "First item unit price",
277
+ example: "650",
278
+ type: "currency",
279
+ },
280
+ { key: "items[0].total", label: "First item total", example: "650", type: "currency" },
281
+ {
282
+ key: "items[0].serviceDate",
283
+ label: "First item service date",
284
+ example: "2026-06-15",
285
+ type: "date",
286
+ },
287
+ { key: "items[0].itemType", label: "First item type", example: "unit", type: "string" },
288
+ ],
289
+ },
290
+ {
291
+ id: "product",
292
+ label: "Product",
293
+ description: "Convenience alias to the first booking item title when available.",
294
+ variables: [
295
+ { key: "product.title", label: "Title", example: "Circuit Maroc 7 zile", type: "string" },
296
+ ],
297
+ },
298
+ {
299
+ id: "documents",
300
+ label: "Documents",
301
+ description: "Available in booking document bundle notifications.",
302
+ variables: [
303
+ {
304
+ key: "documents",
305
+ label: "Documents array",
306
+ example: '[{ name: "Invoice" }]',
307
+ type: "array",
308
+ },
309
+ {
310
+ key: "documents[0].name",
311
+ label: "First document name",
312
+ example: "Invoice 42",
313
+ type: "string",
314
+ },
315
+ {
316
+ key: "documents[0].type",
317
+ label: "First document type",
318
+ example: "invoice",
319
+ type: "string",
320
+ },
321
+ {
322
+ key: "documents[0].key",
323
+ label: "First document key",
324
+ example: "invoice_pdf",
325
+ type: "string",
326
+ },
327
+ { key: "documentsCount", label: "Document count", example: "2", type: "number" },
328
+ ],
329
+ },
330
+ ];
331
+ export const notificationLiquidSnippets = [
332
+ {
333
+ id: "output-default",
334
+ label: "Output with default",
335
+ description: "Render a value and fall back if it is missing.",
336
+ code: '{{ traveler.firstName | default: "traveler" }}',
337
+ },
338
+ {
339
+ id: "currency",
340
+ label: "Currency formatting",
341
+ description: "Format a number as currency.",
342
+ code: "{{ booking.total | currency: booking.currency }}",
343
+ },
344
+ {
345
+ id: "date",
346
+ label: "Date formatting",
347
+ description: "Format a date-like value for display.",
348
+ code: "{{ paymentSchedule.dueDate | date_format }}",
349
+ },
350
+ {
351
+ id: "if-booking",
352
+ label: "Conditional booking section",
353
+ description: "Render a section only when booking data exists.",
354
+ code: "{% if booking.reference %}\nBooking reference: {{ booking.reference }}\n{% endif %}",
355
+ },
356
+ {
357
+ id: "if-balance-due",
358
+ label: "Conditional balance due",
359
+ description: "Show a payment CTA only when there is an outstanding balance.",
360
+ code: "{% if invoice.balanceDueAmount > 0 %}\nBalance due: {{ invoice.balanceDueAmount | currency: invoice.currency }}\n{% endif %}",
361
+ },
362
+ {
363
+ id: "for-travelers",
364
+ label: "Loop over travelers",
365
+ description: "Iterate through all travelers on the booking.",
366
+ code: "{% for traveler in travelers %}\n- {{ traveler.fullName | default: traveler.firstName }}\n{% endfor %}",
367
+ },
368
+ {
369
+ id: "for-items",
370
+ label: "Loop over items",
371
+ description: "Render a compact booking line-item summary.",
372
+ code: "{% for item in items %}\n- {{ item.title }} × {{ item.quantity }} — {{ item.total | currency: item.currency }}\n{% endfor %}",
373
+ },
374
+ {
375
+ id: "for-documents",
376
+ label: "Loop over documents",
377
+ description: "Iterate through the attached documents list.",
378
+ code: "{% for document in documents %}\n- {{ document.name }}\n{% endfor %}",
379
+ },
380
+ {
381
+ id: "payment-link",
382
+ label: "Payment link CTA",
383
+ description: "Link to the latest active payment session when one exists.",
384
+ code: "{% if payment.link %}\nPay now: {{ payment.link }}\n{% endif %}",
385
+ },
386
+ ];
@@ -37,8 +37,8 @@ export declare const notificationReminderRunStatusSchema: z.ZodEnum<{
37
37
  failed: "failed";
38
38
  sent: "sent";
39
39
  processing: "processing";
40
- queued: "queued";
41
40
  skipped: "skipped";
41
+ queued: "queued";
42
42
  }>;
43
43
  export declare const notificationDocumentTypeSchema: z.ZodEnum<{
44
44
  invoice: "invoice";
@@ -232,8 +232,8 @@ export declare const notificationReminderRunListQuerySchema: z.ZodObject<{
232
232
  failed: "failed";
233
233
  sent: "sent";
234
234
  processing: "processing";
235
- queued: "queued";
236
235
  skipped: "skipped";
236
+ queued: "queued";
237
237
  }>>;
238
238
  }, z.core.$strip>;
239
239
  export declare const notificationReminderRunRuleSummarySchema: z.ZodObject<{
@@ -299,8 +299,8 @@ export declare const notificationReminderRunRecordSchema: z.ZodObject<{
299
299
  failed: "failed";
300
300
  sent: "sent";
301
301
  processing: "processing";
302
- queued: "queued";
303
302
  skipped: "skipped";
303
+ queued: "queued";
304
304
  }>;
305
305
  recipient: z.ZodNullable<z.ZodString>;
306
306
  scheduledFor: z.ZodString;
@@ -374,8 +374,8 @@ export declare const notificationReminderRunListResponseSchema: z.ZodObject<{
374
374
  failed: "failed";
375
375
  sent: "sent";
376
376
  processing: "processing";
377
- queued: "queued";
378
377
  skipped: "skipped";
378
+ queued: "queued";
379
379
  }>;
380
380
  recipient: z.ZodNullable<z.ZodString>;
381
381
  scheduledFor: z.ZodString;
@@ -542,6 +542,29 @@ export declare const sendNotificationSchema: z.ZodObject<{
542
542
  metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
543
543
  scheduledFor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
544
544
  }, z.core.$strip>;
545
+ export declare const previewNotificationTemplateSchema: z.ZodObject<{
546
+ channel: z.ZodEnum<{
547
+ email: "email";
548
+ sms: "sms";
549
+ }>;
550
+ provider: z.ZodNullable<z.ZodOptional<z.ZodString>>;
551
+ subjectTemplate: z.ZodNullable<z.ZodOptional<z.ZodString>>;
552
+ htmlTemplate: z.ZodNullable<z.ZodOptional<z.ZodString>>;
553
+ textTemplate: z.ZodNullable<z.ZodOptional<z.ZodString>>;
554
+ fromAddress: z.ZodNullable<z.ZodOptional<z.ZodString>>;
555
+ data: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
556
+ }, z.core.$strip>;
557
+ export declare const previewNotificationTemplateResultSchema: z.ZodObject<{
558
+ channel: z.ZodEnum<{
559
+ email: "email";
560
+ sms: "sms";
561
+ }>;
562
+ provider: z.ZodNullable<z.ZodString>;
563
+ fromAddress: z.ZodNullable<z.ZodString>;
564
+ subject: z.ZodNullable<z.ZodString>;
565
+ html: z.ZodNullable<z.ZodString>;
566
+ text: z.ZodNullable<z.ZodString>;
567
+ }, z.core.$strip>;
545
568
  export declare const bookingDocumentBundleItemSchema: z.ZodObject<{
546
569
  key: z.ZodString;
547
570
  source: z.ZodEnum<{
@@ -656,4 +679,79 @@ export declare const sendBookingDocumentsNotificationResultSchema: z.ZodObject<{
656
679
  sent: "sent";
657
680
  }>;
658
681
  }, z.core.$strip>;
682
+ /**
683
+ * Confirm-and-dispatch — single orchestrated request that lists the booking's
684
+ * document bundle and (optionally) sends it to the client in one round-trip.
685
+ *
686
+ * `sendNotification: false` turns the call into a preview: the bundle comes
687
+ * back but no delivery is attempted. Templates use the preview to render the
688
+ * "here's what's ready" checkbox list before the operator confirms.
689
+ */
690
+ export declare const confirmAndDispatchBookingSchema: z.ZodObject<{
691
+ templateId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
692
+ templateSlug: z.ZodNullable<z.ZodOptional<z.ZodString>>;
693
+ provider: z.ZodNullable<z.ZodOptional<z.ZodString>>;
694
+ to: z.ZodNullable<z.ZodOptional<z.ZodString>>;
695
+ from: z.ZodNullable<z.ZodOptional<z.ZodString>>;
696
+ subject: z.ZodNullable<z.ZodOptional<z.ZodString>>;
697
+ html: z.ZodNullable<z.ZodOptional<z.ZodString>>;
698
+ text: z.ZodNullable<z.ZodOptional<z.ZodString>>;
699
+ data: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
700
+ metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
701
+ scheduledFor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
702
+ documentTypes: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodEnum<{
703
+ invoice: "invoice";
704
+ proforma: "proforma";
705
+ contract: "contract";
706
+ }>>>>;
707
+ sendNotification: z.ZodDefault<z.ZodBoolean>;
708
+ }, z.core.$strip>;
709
+ export declare const confirmAndDispatchBookingResultSchema: z.ZodObject<{
710
+ bookingId: z.ZodString;
711
+ documents: z.ZodArray<z.ZodObject<{
712
+ key: z.ZodString;
713
+ source: z.ZodEnum<{
714
+ finance: "finance";
715
+ legal: "legal";
716
+ }>;
717
+ documentType: z.ZodEnum<{
718
+ invoice: "invoice";
719
+ proforma: "proforma";
720
+ contract: "contract";
721
+ }>;
722
+ bookingId: z.ZodString;
723
+ contractId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
724
+ invoiceId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
725
+ attachmentId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
726
+ renditionId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
727
+ contractStatus: z.ZodNullable<z.ZodOptional<z.ZodString>>;
728
+ invoiceStatus: z.ZodNullable<z.ZodOptional<z.ZodString>>;
729
+ name: z.ZodString;
730
+ format: z.ZodNullable<z.ZodOptional<z.ZodString>>;
731
+ mimeType: z.ZodNullable<z.ZodOptional<z.ZodString>>;
732
+ storageKey: z.ZodNullable<z.ZodOptional<z.ZodString>>;
733
+ downloadUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
734
+ language: z.ZodNullable<z.ZodOptional<z.ZodString>>;
735
+ metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
736
+ createdAt: z.ZodString;
737
+ }, z.core.$strip>>;
738
+ notification: z.ZodNullable<z.ZodObject<{
739
+ recipient: z.ZodString;
740
+ deliveryId: z.ZodString;
741
+ provider: z.ZodNullable<z.ZodOptional<z.ZodString>>;
742
+ status: z.ZodEnum<{
743
+ pending: "pending";
744
+ cancelled: "cancelled";
745
+ failed: "failed";
746
+ sent: "sent";
747
+ }>;
748
+ }, z.core.$strip>>;
749
+ skipReason: z.ZodNullable<z.ZodEnum<{
750
+ preview_only: "preview_only";
751
+ no_documents: "no_documents";
752
+ no_recipient: "no_recipient";
753
+ no_attachments: "no_attachments";
754
+ send_failed: "send_failed";
755
+ }>>;
756
+ }, z.core.$strip>;
659
757
  //# sourceMappingURL=validation.d.ts.map
@@ -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;;;EAAkD,CAAA;AACnG,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,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