@voyantjs/notifications 0.6.7 → 0.6.9

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.
@@ -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
+ ];
@@ -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<{
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAY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;;;;;;;;;;;;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"}
@@ -222,6 +222,27 @@ export const sendNotificationSchema = z
222
222
  .refine((value) => Boolean(value.templateId || value.templateSlug || value.subject || value.html || value.text), {
223
223
  message: "templateId, templateSlug, or direct content is required",
224
224
  });
225
+ export const previewNotificationTemplateSchema = z
226
+ .object({
227
+ channel: notificationChannelSchema,
228
+ provider: z.string().optional().nullable(),
229
+ subjectTemplate: z.string().max(2000).optional().nullable(),
230
+ htmlTemplate: z.string().optional().nullable(),
231
+ textTemplate: z.string().optional().nullable(),
232
+ fromAddress: z.string().max(500).optional().nullable(),
233
+ data: z.record(z.string(), z.unknown()).optional().nullable(),
234
+ })
235
+ .refine((value) => Boolean(value.subjectTemplate || value.htmlTemplate || value.textTemplate), {
236
+ message: "subjectTemplate, htmlTemplate, or textTemplate is required",
237
+ });
238
+ export const previewNotificationTemplateResultSchema = z.object({
239
+ channel: notificationChannelSchema,
240
+ provider: z.string().nullable(),
241
+ fromAddress: z.string().nullable(),
242
+ subject: z.string().nullable(),
243
+ html: z.string().nullable(),
244
+ text: z.string().nullable(),
245
+ });
225
246
  export const bookingDocumentBundleItemSchema = z.object({
226
247
  key: z.string().min(1),
227
248
  source: notificationDocumentSourceSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voyantjs/notifications",
3
- "version": "0.6.7",
3
+ "version": "0.6.9",
4
4
  "license": "FSL-1.1-Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -48,13 +48,14 @@
48
48
  "dependencies": {
49
49
  "drizzle-orm": "^0.45.2",
50
50
  "hono": "^4.12.10",
51
+ "liquidjs": "^10.24.0",
51
52
  "zod": "^4.3.6",
52
- "@voyantjs/bookings": "0.6.7",
53
- "@voyantjs/core": "0.6.7",
54
- "@voyantjs/db": "0.6.7",
55
- "@voyantjs/finance": "0.6.7",
56
- "@voyantjs/hono": "0.6.7",
57
- "@voyantjs/legal": "0.6.7"
53
+ "@voyantjs/bookings": "0.6.9",
54
+ "@voyantjs/core": "0.6.9",
55
+ "@voyantjs/db": "0.6.9",
56
+ "@voyantjs/finance": "0.6.9",
57
+ "@voyantjs/hono": "0.6.9",
58
+ "@voyantjs/legal": "0.6.9"
58
59
  },
59
60
  "devDependencies": {
60
61
  "typescript": "^6.0.2",