@voyantjs/customer-portal 0.3.1 → 0.4.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 +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/routes-public.d.ts +349 -3
- package/dist/routes-public.d.ts.map +1 -1
- package/dist/routes-public.js +42 -3
- package/dist/service-public.d.ts +28 -2
- package/dist/service-public.d.ts.map +1 -1
- package/dist/service-public.js +957 -74
- package/dist/validation-public.d.ts +699 -0
- package/dist/validation-public.d.ts.map +1 -1
- package/dist/validation-public.js +266 -1
- package/package.json +10 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation-public.d.ts","sourceRoot":"","sources":["../src/validation-public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"validation-public.d.ts","sourceRoot":"","sources":["../src/validation-public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AA6JvB,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;iBAWtC,CAAA;AAEF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;iBAc1C,CAAA;AAEJ,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAerC,CAAA;AAEF,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGjD,CAAA;AAEF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuCtC,CAAA;AAEF,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAS3C,CAAA;AAEF,eAAO,MAAM,iCAAiC;;;;;;;;;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AM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAC7F,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAA;AACnG,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAA"}
|
|
@@ -44,7 +44,18 @@ const bookingItemParticipantRoleSchema = z.enum([
|
|
|
44
44
|
"beneficiary",
|
|
45
45
|
"other",
|
|
46
46
|
]);
|
|
47
|
-
const bookingDocumentTypeSchema = z.enum([
|
|
47
|
+
const bookingDocumentTypeSchema = z.enum([
|
|
48
|
+
"visa",
|
|
49
|
+
"insurance",
|
|
50
|
+
"health",
|
|
51
|
+
"passport_copy",
|
|
52
|
+
"contract",
|
|
53
|
+
"invoice",
|
|
54
|
+
"proforma",
|
|
55
|
+
"credit_note",
|
|
56
|
+
"other",
|
|
57
|
+
]);
|
|
58
|
+
const bookingDocumentSourceSchema = z.enum(["booking_document", "legal", "finance"]);
|
|
48
59
|
const bookingFulfillmentTypeSchema = z.enum([
|
|
49
60
|
"voucher",
|
|
50
61
|
"ticket",
|
|
@@ -69,6 +80,97 @@ const bookingFulfillmentStatusSchema = z.enum([
|
|
|
69
80
|
"failed",
|
|
70
81
|
]);
|
|
71
82
|
const seatingPreferenceSchema = z.enum(["aisle", "window", "middle", "no_preference"]);
|
|
83
|
+
const customerPortalAddressLabelSchema = z.enum([
|
|
84
|
+
"primary",
|
|
85
|
+
"billing",
|
|
86
|
+
"shipping",
|
|
87
|
+
"mailing",
|
|
88
|
+
"meeting",
|
|
89
|
+
"service",
|
|
90
|
+
"legal",
|
|
91
|
+
"other",
|
|
92
|
+
]);
|
|
93
|
+
const customerPortalFinanceInvoiceTypeSchema = z.enum(["invoice", "proforma", "credit_note"]);
|
|
94
|
+
const customerPortalFinanceInvoiceStatusSchema = z.enum([
|
|
95
|
+
"draft",
|
|
96
|
+
"sent",
|
|
97
|
+
"partially_paid",
|
|
98
|
+
"paid",
|
|
99
|
+
"overdue",
|
|
100
|
+
"void",
|
|
101
|
+
]);
|
|
102
|
+
const customerPortalFinancePaymentStatusSchema = z.enum([
|
|
103
|
+
"pending",
|
|
104
|
+
"completed",
|
|
105
|
+
"failed",
|
|
106
|
+
"refunded",
|
|
107
|
+
]);
|
|
108
|
+
const customerPortalFinancePaymentMethodSchema = z.enum([
|
|
109
|
+
"bank_transfer",
|
|
110
|
+
"credit_card",
|
|
111
|
+
"debit_card",
|
|
112
|
+
"cash",
|
|
113
|
+
"cheque",
|
|
114
|
+
"wallet",
|
|
115
|
+
"direct_bill",
|
|
116
|
+
"voucher",
|
|
117
|
+
"other",
|
|
118
|
+
]);
|
|
119
|
+
const customerPortalBookingPaymentSummaryStatusSchema = z.enum([
|
|
120
|
+
"unpaid",
|
|
121
|
+
"partially_paid",
|
|
122
|
+
"paid",
|
|
123
|
+
"overdue",
|
|
124
|
+
]);
|
|
125
|
+
const customerPortalFinanceDocumentAvailabilitySchema = z.enum([
|
|
126
|
+
"missing",
|
|
127
|
+
"pending",
|
|
128
|
+
"ready",
|
|
129
|
+
"failed",
|
|
130
|
+
"stale",
|
|
131
|
+
]);
|
|
132
|
+
const customerPortalFinanceDocumentFormatSchema = z.enum(["html", "pdf", "xml", "json"]);
|
|
133
|
+
const customerPortalProfileDocumentTypeSchema = z.enum([
|
|
134
|
+
"passport",
|
|
135
|
+
"id_card",
|
|
136
|
+
"visa",
|
|
137
|
+
"drivers_license",
|
|
138
|
+
"other",
|
|
139
|
+
]);
|
|
140
|
+
const customerPortalCompanionDocumentTypeSchema = z.enum([
|
|
141
|
+
"passport",
|
|
142
|
+
"id_card",
|
|
143
|
+
"visa",
|
|
144
|
+
"drivers_license",
|
|
145
|
+
"other",
|
|
146
|
+
]);
|
|
147
|
+
export const customerPortalAddressSchema = z.object({
|
|
148
|
+
id: z.string(),
|
|
149
|
+
label: customerPortalAddressLabelSchema,
|
|
150
|
+
fullText: z.string().nullable(),
|
|
151
|
+
line1: z.string().nullable(),
|
|
152
|
+
line2: z.string().nullable(),
|
|
153
|
+
city: z.string().nullable(),
|
|
154
|
+
region: z.string().nullable(),
|
|
155
|
+
postalCode: z.string().nullable(),
|
|
156
|
+
country: z.string().nullable(),
|
|
157
|
+
isPrimary: z.boolean(),
|
|
158
|
+
});
|
|
159
|
+
export const updateCustomerPortalAddressSchema = z
|
|
160
|
+
.object({
|
|
161
|
+
label: customerPortalAddressLabelSchema.optional(),
|
|
162
|
+
fullText: z.string().nullable().optional(),
|
|
163
|
+
line1: z.string().nullable().optional(),
|
|
164
|
+
line2: z.string().nullable().optional(),
|
|
165
|
+
city: z.string().nullable().optional(),
|
|
166
|
+
region: z.string().nullable().optional(),
|
|
167
|
+
postalCode: z.string().nullable().optional(),
|
|
168
|
+
country: z.string().nullable().optional(),
|
|
169
|
+
isPrimary: z.boolean().optional(),
|
|
170
|
+
})
|
|
171
|
+
.refine((value) => Object.keys(value).length > 0, {
|
|
172
|
+
message: "At least one billingAddress field must be provided",
|
|
173
|
+
});
|
|
72
174
|
export const customerPortalRecordSchema = z.object({
|
|
73
175
|
id: z.string(),
|
|
74
176
|
firstName: z.string(),
|
|
@@ -81,6 +183,7 @@ export const customerPortalRecordSchema = z.object({
|
|
|
81
183
|
address: z.string().nullable(),
|
|
82
184
|
city: z.string().nullable(),
|
|
83
185
|
country: z.string().nullable(),
|
|
186
|
+
billingAddress: customerPortalAddressSchema.nullable(),
|
|
84
187
|
relation: z.string().nullable(),
|
|
85
188
|
status: z.string(),
|
|
86
189
|
});
|
|
@@ -93,13 +196,35 @@ export const customerPortalProfileSchema = z.object({
|
|
|
93
196
|
email: z.string().email(),
|
|
94
197
|
emailVerified: z.boolean(),
|
|
95
198
|
firstName: z.string().nullable(),
|
|
199
|
+
middleName: z.string().nullable(),
|
|
96
200
|
lastName: z.string().nullable(),
|
|
97
201
|
avatarUrl: z.string().nullable(),
|
|
98
202
|
locale: z.string(),
|
|
99
203
|
timezone: z.string().nullable(),
|
|
100
204
|
seatingPreference: seatingPreferenceSchema.nullable(),
|
|
205
|
+
dateOfBirth: z.string().nullable(),
|
|
206
|
+
address: z
|
|
207
|
+
.object({
|
|
208
|
+
country: z.string().nullable(),
|
|
209
|
+
state: z.string().nullable(),
|
|
210
|
+
city: z.string().nullable(),
|
|
211
|
+
postalCode: z.string().nullable(),
|
|
212
|
+
addressLine1: z.string().nullable(),
|
|
213
|
+
addressLine2: z.string().nullable(),
|
|
214
|
+
})
|
|
215
|
+
.nullable(),
|
|
216
|
+
documents: z.array(z.object({
|
|
217
|
+
type: customerPortalProfileDocumentTypeSchema,
|
|
218
|
+
number: z.string(),
|
|
219
|
+
issuingAuthority: z.string().nullable(),
|
|
220
|
+
issuingCountry: z.string(),
|
|
221
|
+
nationality: z.string().nullable(),
|
|
222
|
+
expiryDate: z.string(),
|
|
223
|
+
issueDate: z.string().nullable(),
|
|
224
|
+
})),
|
|
101
225
|
marketingConsent: z.boolean(),
|
|
102
226
|
marketingConsentAt: z.string().nullable(),
|
|
227
|
+
marketingConsentSource: z.string().nullable(),
|
|
103
228
|
notificationDefaults: z.record(z.string(), z.unknown()).nullable(),
|
|
104
229
|
uiPrefs: z.record(z.string(), z.unknown()).nullable(),
|
|
105
230
|
customerRecord: customerPortalRecordSchema.nullable(),
|
|
@@ -112,16 +237,41 @@ export const updateCustomerPortalRecordSchema = z.object({
|
|
|
112
237
|
address: z.string().nullable().optional(),
|
|
113
238
|
city: z.string().nullable().optional(),
|
|
114
239
|
country: z.string().nullable().optional(),
|
|
240
|
+
billingAddress: updateCustomerPortalAddressSchema.optional(),
|
|
115
241
|
});
|
|
116
242
|
export const updateCustomerPortalProfileSchema = z
|
|
117
243
|
.object({
|
|
118
244
|
firstName: z.string().max(200).nullable().optional(),
|
|
245
|
+
middleName: z.string().max(200).nullable().optional(),
|
|
119
246
|
lastName: z.string().max(200).nullable().optional(),
|
|
120
247
|
avatarUrl: z.string().url().nullable().optional(),
|
|
121
248
|
locale: z.string().max(10).optional(),
|
|
122
249
|
timezone: z.string().max(64).nullable().optional(),
|
|
123
250
|
seatingPreference: seatingPreferenceSchema.nullable().optional(),
|
|
251
|
+
dateOfBirth: z.string().date().nullable().optional(),
|
|
252
|
+
address: z
|
|
253
|
+
.object({
|
|
254
|
+
country: z.string().nullable().optional(),
|
|
255
|
+
state: z.string().nullable().optional(),
|
|
256
|
+
city: z.string().nullable().optional(),
|
|
257
|
+
postalCode: z.string().nullable().optional(),
|
|
258
|
+
addressLine1: z.string().nullable().optional(),
|
|
259
|
+
addressLine2: z.string().nullable().optional(),
|
|
260
|
+
})
|
|
261
|
+
.optional(),
|
|
262
|
+
documents: z
|
|
263
|
+
.array(z.object({
|
|
264
|
+
type: customerPortalProfileDocumentTypeSchema,
|
|
265
|
+
number: z.string().min(1).max(255),
|
|
266
|
+
issuingAuthority: z.string().max(255).nullable().optional(),
|
|
267
|
+
issuingCountry: z.string().min(1).max(255),
|
|
268
|
+
nationality: z.string().max(255).nullable().optional(),
|
|
269
|
+
expiryDate: z.string().date(),
|
|
270
|
+
issueDate: z.string().date().nullable().optional(),
|
|
271
|
+
}))
|
|
272
|
+
.optional(),
|
|
124
273
|
marketingConsent: z.boolean().optional(),
|
|
274
|
+
marketingConsentSource: z.string().max(255).nullable().optional(),
|
|
125
275
|
notificationDefaults: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
126
276
|
uiPrefs: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
127
277
|
customerRecord: updateCustomerPortalRecordSchema.optional(),
|
|
@@ -153,6 +303,7 @@ export const bootstrapCustomerPortalSchema = z
|
|
|
153
303
|
firstName: z.string().max(200).nullable().optional(),
|
|
154
304
|
lastName: z.string().max(200).nullable().optional(),
|
|
155
305
|
marketingConsent: z.boolean().optional(),
|
|
306
|
+
marketingConsentSource: z.string().max(255).nullable().optional(),
|
|
156
307
|
customerRecord: updateCustomerPortalRecordSchema.optional(),
|
|
157
308
|
})
|
|
158
309
|
.refine((value) => value.customerRecordId || value.createCustomerIfMissing !== false, {
|
|
@@ -177,6 +328,31 @@ export const customerPortalCompanionSchema = z.object({
|
|
|
177
328
|
phone: z.string().nullable(),
|
|
178
329
|
isPrimary: z.boolean(),
|
|
179
330
|
notes: z.string().nullable(),
|
|
331
|
+
typeKey: z.string().nullable(),
|
|
332
|
+
person: z.object({
|
|
333
|
+
firstName: z.string().nullable(),
|
|
334
|
+
middleName: z.string().nullable(),
|
|
335
|
+
lastName: z.string().nullable(),
|
|
336
|
+
dateOfBirth: z.string().nullable(),
|
|
337
|
+
addresses: z.array(z.object({
|
|
338
|
+
type: z.string().nullable(),
|
|
339
|
+
country: z.string().nullable(),
|
|
340
|
+
state: z.string().nullable(),
|
|
341
|
+
city: z.string().nullable(),
|
|
342
|
+
postalCode: z.string().nullable(),
|
|
343
|
+
addressLine1: z.string().nullable(),
|
|
344
|
+
addressLine2: z.string().nullable(),
|
|
345
|
+
isDefault: z.boolean(),
|
|
346
|
+
})),
|
|
347
|
+
documents: z.array(z.object({
|
|
348
|
+
type: customerPortalCompanionDocumentTypeSchema,
|
|
349
|
+
number: z.string().nullable(),
|
|
350
|
+
issuingAuthority: z.string().nullable(),
|
|
351
|
+
country: z.string().nullable(),
|
|
352
|
+
issueDate: z.string().nullable(),
|
|
353
|
+
expiryDate: z.string().nullable(),
|
|
354
|
+
})),
|
|
355
|
+
}),
|
|
180
356
|
metadata: z.record(z.string(), z.unknown()).nullable(),
|
|
181
357
|
});
|
|
182
358
|
export const createCustomerPortalCompanionSchema = z.object({
|
|
@@ -200,6 +376,37 @@ export const createCustomerPortalCompanionSchema = z.object({
|
|
|
200
376
|
phone: z.string().max(50).nullable().optional(),
|
|
201
377
|
isPrimary: z.boolean().default(false),
|
|
202
378
|
notes: z.string().nullable().optional(),
|
|
379
|
+
typeKey: z.string().max(100).nullable().optional(),
|
|
380
|
+
person: z
|
|
381
|
+
.object({
|
|
382
|
+
firstName: z.string().max(200).nullable().optional(),
|
|
383
|
+
middleName: z.string().max(200).nullable().optional(),
|
|
384
|
+
lastName: z.string().max(200).nullable().optional(),
|
|
385
|
+
dateOfBirth: z.string().date().nullable().optional(),
|
|
386
|
+
addresses: z
|
|
387
|
+
.array(z.object({
|
|
388
|
+
type: z.string().max(100).nullable().optional(),
|
|
389
|
+
country: z.string().max(255).nullable().optional(),
|
|
390
|
+
state: z.string().max(255).nullable().optional(),
|
|
391
|
+
city: z.string().max(255).nullable().optional(),
|
|
392
|
+
postalCode: z.string().max(50).nullable().optional(),
|
|
393
|
+
addressLine1: z.string().max(255).nullable().optional(),
|
|
394
|
+
addressLine2: z.string().max(255).nullable().optional(),
|
|
395
|
+
isDefault: z.boolean().optional(),
|
|
396
|
+
}))
|
|
397
|
+
.optional(),
|
|
398
|
+
documents: z
|
|
399
|
+
.array(z.object({
|
|
400
|
+
type: customerPortalCompanionDocumentTypeSchema,
|
|
401
|
+
number: z.string().max(255).nullable().optional(),
|
|
402
|
+
issuingAuthority: z.string().max(255).nullable().optional(),
|
|
403
|
+
country: z.string().max(255).nullable().optional(),
|
|
404
|
+
issueDate: z.string().date().nullable().optional(),
|
|
405
|
+
expiryDate: z.string().date().nullable().optional(),
|
|
406
|
+
}))
|
|
407
|
+
.optional(),
|
|
408
|
+
})
|
|
409
|
+
.optional(),
|
|
203
410
|
metadata: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
204
411
|
});
|
|
205
412
|
export const updateCustomerPortalCompanionSchema = createCustomerPortalCompanionSchema
|
|
@@ -207,12 +414,21 @@ export const updateCustomerPortalCompanionSchema = createCustomerPortalCompanion
|
|
|
207
414
|
.refine((value) => Object.keys(value).length > 0, {
|
|
208
415
|
message: "At least one field must be provided",
|
|
209
416
|
});
|
|
417
|
+
export const importCustomerPortalBookingParticipantsSchema = z.object({
|
|
418
|
+
bookingIds: z.array(z.string()).min(1).optional(),
|
|
419
|
+
});
|
|
420
|
+
export const importCustomerPortalBookingParticipantsResultSchema = z.object({
|
|
421
|
+
created: z.array(customerPortalCompanionSchema),
|
|
422
|
+
skippedCount: z.number().int().nonnegative(),
|
|
423
|
+
});
|
|
210
424
|
export const customerPortalBookingSummarySchema = z.object({
|
|
211
425
|
bookingId: z.string(),
|
|
212
426
|
bookingNumber: z.string(),
|
|
213
427
|
status: bookingStatusSchema,
|
|
214
428
|
sellCurrency: z.string(),
|
|
215
429
|
sellAmountCents: z.number().int().nullable(),
|
|
430
|
+
productTitle: z.string().nullable(),
|
|
431
|
+
paymentStatus: customerPortalBookingPaymentSummaryStatusSchema,
|
|
216
432
|
startDate: z.string().nullable(),
|
|
217
433
|
endDate: z.string().nullable(),
|
|
218
434
|
pax: z.number().int().nullable(),
|
|
@@ -250,12 +466,59 @@ export const customerPortalBookingParticipantSchema = z.object({
|
|
|
250
466
|
lastName: z.string(),
|
|
251
467
|
isPrimary: z.boolean(),
|
|
252
468
|
});
|
|
469
|
+
export const customerPortalBookingBillingContactSchema = z.object({
|
|
470
|
+
email: z.string().nullable(),
|
|
471
|
+
phone: z.string().nullable(),
|
|
472
|
+
firstName: z.string().nullable(),
|
|
473
|
+
lastName: z.string().nullable(),
|
|
474
|
+
country: z.string().nullable(),
|
|
475
|
+
state: z.string().nullable(),
|
|
476
|
+
city: z.string().nullable(),
|
|
477
|
+
address1: z.string().nullable(),
|
|
478
|
+
postal: z.string().nullable(),
|
|
479
|
+
});
|
|
253
480
|
export const customerPortalBookingDocumentSchema = z.object({
|
|
254
481
|
id: z.string(),
|
|
482
|
+
source: bookingDocumentSourceSchema,
|
|
255
483
|
participantId: z.string().nullable(),
|
|
256
484
|
type: bookingDocumentTypeSchema,
|
|
257
485
|
fileName: z.string(),
|
|
258
486
|
fileUrl: z.string(),
|
|
487
|
+
mimeType: z.string().nullable(),
|
|
488
|
+
reference: z.string().nullable(),
|
|
489
|
+
});
|
|
490
|
+
export const customerPortalBookingFinancialDocumentSchema = z.object({
|
|
491
|
+
invoiceId: z.string(),
|
|
492
|
+
invoiceNumber: z.string(),
|
|
493
|
+
invoiceType: customerPortalFinanceInvoiceTypeSchema,
|
|
494
|
+
invoiceStatus: customerPortalFinanceInvoiceStatusSchema,
|
|
495
|
+
currency: z.string(),
|
|
496
|
+
totalCents: z.number().int(),
|
|
497
|
+
paidCents: z.number().int(),
|
|
498
|
+
balanceDueCents: z.number().int(),
|
|
499
|
+
issueDate: z.string(),
|
|
500
|
+
dueDate: z.string(),
|
|
501
|
+
documentStatus: customerPortalFinanceDocumentAvailabilitySchema,
|
|
502
|
+
format: customerPortalFinanceDocumentFormatSchema.nullable(),
|
|
503
|
+
generatedAt: z.string().nullable(),
|
|
504
|
+
downloadUrl: z.string().nullable(),
|
|
505
|
+
});
|
|
506
|
+
export const customerPortalBookingPaymentSchema = z.object({
|
|
507
|
+
id: z.string(),
|
|
508
|
+
invoiceId: z.string(),
|
|
509
|
+
invoiceNumber: z.string(),
|
|
510
|
+
invoiceType: customerPortalFinanceInvoiceTypeSchema,
|
|
511
|
+
status: customerPortalFinancePaymentStatusSchema,
|
|
512
|
+
paymentMethod: customerPortalFinancePaymentMethodSchema,
|
|
513
|
+
amountCents: z.number().int(),
|
|
514
|
+
currency: z.string(),
|
|
515
|
+
paymentDate: z.string(),
|
|
516
|
+
referenceNumber: z.string().nullable(),
|
|
517
|
+
notes: z.string().nullable(),
|
|
518
|
+
});
|
|
519
|
+
export const customerPortalBookingFinancialsSchema = z.object({
|
|
520
|
+
documents: z.array(customerPortalBookingFinancialDocumentSchema),
|
|
521
|
+
payments: z.array(customerPortalBookingPaymentSchema),
|
|
259
522
|
});
|
|
260
523
|
export const customerPortalBookingFulfillmentSchema = z.object({
|
|
261
524
|
id: z.string(),
|
|
@@ -280,6 +543,8 @@ export const customerPortalBookingDetailSchema = z.object({
|
|
|
280
543
|
completedAt: z.string().nullable(),
|
|
281
544
|
participants: z.array(customerPortalBookingParticipantSchema),
|
|
282
545
|
items: z.array(customerPortalBookingItemSchema),
|
|
546
|
+
billingContact: customerPortalBookingBillingContactSchema.nullable(),
|
|
283
547
|
documents: z.array(customerPortalBookingDocumentSchema),
|
|
548
|
+
financials: customerPortalBookingFinancialsSchema,
|
|
284
549
|
fulfillments: z.array(customerPortalBookingFulfillmentSchema),
|
|
285
550
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/customer-portal",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"license": "FSL-1.1-Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,12 +30,15 @@
|
|
|
30
30
|
"drizzle-orm": "^0.45.2",
|
|
31
31
|
"hono": "^4.12.10",
|
|
32
32
|
"zod": "^4.3.6",
|
|
33
|
-
"@voyantjs/bookings": "0.
|
|
34
|
-
"@voyantjs/core": "0.
|
|
35
|
-
"@voyantjs/crm": "0.
|
|
36
|
-
"@voyantjs/db": "0.
|
|
37
|
-
"@voyantjs/
|
|
38
|
-
"@voyantjs/
|
|
33
|
+
"@voyantjs/bookings": "0.4.0",
|
|
34
|
+
"@voyantjs/core": "0.4.0",
|
|
35
|
+
"@voyantjs/crm": "0.4.0",
|
|
36
|
+
"@voyantjs/db": "0.4.0",
|
|
37
|
+
"@voyantjs/finance": "0.4.0",
|
|
38
|
+
"@voyantjs/hono": "0.4.0",
|
|
39
|
+
"@voyantjs/identity": "0.4.0",
|
|
40
|
+
"@voyantjs/legal": "0.4.0",
|
|
41
|
+
"@voyantjs/utils": "0.4.0"
|
|
39
42
|
},
|
|
40
43
|
"devDependencies": {
|
|
41
44
|
"typescript": "^6.0.2",
|