@voyantjs/customer-portal 0.3.0 → 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 CHANGED
@@ -5,8 +5,8 @@ export { customerPortalRoutes } from "./routes.js";
5
5
  export type { PublicCustomerPortalRoutes } from "./routes-public.js";
6
6
  export { publicCustomerPortalRoutes } from "./routes-public.js";
7
7
  export { publicCustomerPortalService } from "./service-public.js";
8
- export type { BootstrapCustomerPortalInput, BootstrapCustomerPortalResult, CreateCustomerPortalCompanionInput, CustomerPortalBookingDetail, CustomerPortalBookingDocument, CustomerPortalBookingSummary, CustomerPortalBootstrapCandidate, CustomerPortalCompanion, CustomerPortalContactExistsQuery, CustomerPortalContactExistsResult, CustomerPortalProfile, UpdateCustomerPortalCompanionInput, UpdateCustomerPortalProfileInput, } from "./validation-public.js";
9
- export { bootstrapCustomerPortalResultSchema, bootstrapCustomerPortalSchema, createCustomerPortalCompanionSchema, customerPortalBookingDetailSchema, customerPortalBookingDocumentSchema, customerPortalBookingSummarySchema, customerPortalBootstrapCandidateSchema, customerPortalCompanionSchema, customerPortalContactExistsQuerySchema, customerPortalContactExistsResultSchema, customerPortalProfileSchema, updateCustomerPortalCompanionSchema, updateCustomerPortalProfileSchema, } from "./validation-public.js";
8
+ export type { BootstrapCustomerPortalInput, BootstrapCustomerPortalResult, CreateCustomerPortalCompanionInput, CustomerPortalAddress, CustomerPortalBookingBillingContact, CustomerPortalBookingDetail, CustomerPortalBookingDocument, CustomerPortalBookingFinancialDocument, CustomerPortalBookingFinancials, CustomerPortalBookingPayment, CustomerPortalBookingSummary, CustomerPortalBootstrapCandidate, CustomerPortalCompanion, CustomerPortalContactExistsQuery, CustomerPortalContactExistsResult, CustomerPortalPhoneContactExistsQuery, CustomerPortalPhoneContactExistsResult, CustomerPortalProfile, ImportCustomerPortalBookingParticipantsInput, ImportCustomerPortalBookingParticipantsResult, UpdateCustomerPortalAddressInput, UpdateCustomerPortalCompanionInput, UpdateCustomerPortalProfileInput, } from "./validation-public.js";
9
+ export { bootstrapCustomerPortalResultSchema, bootstrapCustomerPortalSchema, createCustomerPortalCompanionSchema, customerPortalAddressSchema, customerPortalBookingBillingContactSchema, customerPortalBookingDetailSchema, customerPortalBookingDocumentSchema, customerPortalBookingFinancialDocumentSchema, customerPortalBookingFinancialsSchema, customerPortalBookingPaymentSchema, customerPortalBookingSummarySchema, customerPortalBootstrapCandidateSchema, customerPortalCompanionSchema, customerPortalContactExistsQuerySchema, customerPortalContactExistsResultSchema, customerPortalPhoneContactExistsQuerySchema, customerPortalPhoneContactExistsResultSchema, customerPortalProfileSchema, importCustomerPortalBookingParticipantsResultSchema, importCustomerPortalBookingParticipantsSchema, updateCustomerPortalAddressSchema, updateCustomerPortalCompanionSchema, updateCustomerPortalProfileSchema, } from "./validation-public.js";
10
10
  export declare const customerPortalModule: Module;
11
11
  export declare const customerPortalHonoModule: HonoModule;
12
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAKvD,YAAY,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAClD,YAAY,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAA;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAA;AACjE,YAAY,EACV,4BAA4B,EAC5B,6BAA6B,EAC7B,kCAAkC,EAClC,2BAA2B,EAC3B,6BAA6B,EAC7B,4BAA4B,EAC5B,gCAAgC,EAChC,uBAAuB,EACvB,gCAAgC,EAChC,i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,EACL,mCAAmC,EACnC,6BAA6B,EAC7B,mCAAmC,EACnC,2BAA2B,EAC3B,yCAAyC,EACzC,iCAAiC,EACjC,mCAAmC,EACnC,4CAA4C,EAC5C,qCAAqC,EACrC,kCAAkC,EAClC,kCAAkC,EAClC,sCAAsC,EACtC,6BAA6B,EAC7B,sCAAsC,EACtC,uCAAuC,EACvC,2CAA2C,EAC3C,4CAA4C,EAC5C,2BAA2B,EAC3B,mDAAmD,EACnD,6CAA6C,EAC7C,iCAAiC,EACjC,mCAAmC,EACnC,iCAAiC,GAClC,MAAM,wBAAwB,CAAA;AAE/B,eAAO,MAAM,oBAAoB,EAAE,MAElC,CAAA;AAED,eAAO,MAAM,wBAAwB,EAAE,UAItC,CAAA"}
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { publicCustomerPortalRoutes } from "./routes-public.js";
3
3
  export { customerPortalRoutes } from "./routes.js";
4
4
  export { publicCustomerPortalRoutes } from "./routes-public.js";
5
5
  export { publicCustomerPortalService } from "./service-public.js";
6
- export { bootstrapCustomerPortalResultSchema, bootstrapCustomerPortalSchema, createCustomerPortalCompanionSchema, customerPortalBookingDetailSchema, customerPortalBookingDocumentSchema, customerPortalBookingSummarySchema, customerPortalBootstrapCandidateSchema, customerPortalCompanionSchema, customerPortalContactExistsQuerySchema, customerPortalContactExistsResultSchema, customerPortalProfileSchema, updateCustomerPortalCompanionSchema, updateCustomerPortalProfileSchema, } from "./validation-public.js";
6
+ export { bootstrapCustomerPortalResultSchema, bootstrapCustomerPortalSchema, createCustomerPortalCompanionSchema, customerPortalAddressSchema, customerPortalBookingBillingContactSchema, customerPortalBookingDetailSchema, customerPortalBookingDocumentSchema, customerPortalBookingFinancialDocumentSchema, customerPortalBookingFinancialsSchema, customerPortalBookingPaymentSchema, customerPortalBookingSummarySchema, customerPortalBootstrapCandidateSchema, customerPortalCompanionSchema, customerPortalContactExistsQuerySchema, customerPortalContactExistsResultSchema, customerPortalPhoneContactExistsQuerySchema, customerPortalPhoneContactExistsResultSchema, customerPortalProfileSchema, importCustomerPortalBookingParticipantsResultSchema, importCustomerPortalBookingParticipantsSchema, updateCustomerPortalAddressSchema, updateCustomerPortalCompanionSchema, updateCustomerPortalProfileSchema, } from "./validation-public.js";
7
7
  export const customerPortalModule = {
8
8
  name: "customer-portal",
9
9
  };
@@ -1,5 +1,6 @@
1
1
  import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
2
2
  type Env = {
3
+ Bindings: Record<string, unknown>;
3
4
  Variables: {
4
5
  db: PostgresJsDatabase;
5
6
  userId?: string;
@@ -22,13 +23,33 @@ export declare const publicCustomerPortalRoutes: import("hono/hono-base").HonoBa
22
23
  email: string;
23
24
  emailVerified: boolean;
24
25
  firstName: string | null;
26
+ middleName: string | null;
25
27
  lastName: string | null;
26
28
  avatarUrl: string | null;
27
29
  locale: string;
28
30
  timezone: string | null;
29
31
  seatingPreference: "aisle" | "window" | "middle" | "no_preference" | null;
32
+ dateOfBirth: string | null;
33
+ address: {
34
+ country: string | null;
35
+ state: string | null;
36
+ city: string | null;
37
+ postalCode: string | null;
38
+ addressLine1: string | null;
39
+ addressLine2: string | null;
40
+ } | null;
41
+ documents: {
42
+ type: "visa" | "other" | "passport" | "drivers_license" | "id_card";
43
+ number: string;
44
+ issuingAuthority: string | null;
45
+ issuingCountry: string;
46
+ nationality: string | null;
47
+ expiryDate: string;
48
+ issueDate: string | null;
49
+ }[];
30
50
  marketingConsent: boolean;
31
51
  marketingConsentAt: string | null;
52
+ marketingConsentSource: string | null;
32
53
  notificationDefaults: {
33
54
  [x: string]: import("hono/utils/types").JSONValue;
34
55
  } | null;
@@ -47,6 +68,18 @@ export declare const publicCustomerPortalRoutes: import("hono/hono-base").HonoBa
47
68
  address: string | null;
48
69
  city: string | null;
49
70
  country: string | null;
71
+ billingAddress: {
72
+ id: string;
73
+ label: "other" | "service" | "primary" | "billing" | "shipping" | "mailing" | "meeting" | "legal";
74
+ fullText: string | null;
75
+ line1: string | null;
76
+ line2: string | null;
77
+ city: string | null;
78
+ region: string | null;
79
+ postalCode: string | null;
80
+ country: string | null;
81
+ isPrimary: boolean;
82
+ } | null;
50
83
  relation: string | null;
51
84
  status: string;
52
85
  } | null;
@@ -94,13 +127,33 @@ export declare const publicCustomerPortalRoutes: import("hono/hono-base").HonoBa
94
127
  email: string;
95
128
  emailVerified: boolean;
96
129
  firstName: string | null;
130
+ middleName: string | null;
97
131
  lastName: string | null;
98
132
  avatarUrl: string | null;
99
133
  locale: string;
100
134
  timezone: string | null;
101
135
  seatingPreference: "aisle" | "window" | "middle" | "no_preference" | null;
136
+ dateOfBirth: string | null;
137
+ address: {
138
+ country: string | null;
139
+ state: string | null;
140
+ city: string | null;
141
+ postalCode: string | null;
142
+ addressLine1: string | null;
143
+ addressLine2: string | null;
144
+ } | null;
145
+ documents: {
146
+ type: "visa" | "other" | "passport" | "drivers_license" | "id_card";
147
+ number: string;
148
+ issuingAuthority: string | null;
149
+ issuingCountry: string;
150
+ nationality: string | null;
151
+ expiryDate: string;
152
+ issueDate: string | null;
153
+ }[];
102
154
  marketingConsent: boolean;
103
155
  marketingConsentAt: string | null;
156
+ marketingConsentSource: string | null;
104
157
  notificationDefaults: {
105
158
  [x: string]: import("hono/utils/types").JSONValue;
106
159
  } | null;
@@ -119,6 +172,18 @@ export declare const publicCustomerPortalRoutes: import("hono/hono-base").HonoBa
119
172
  address: string | null;
120
173
  city: string | null;
121
174
  country: string | null;
175
+ billingAddress: {
176
+ id: string;
177
+ label: "other" | "service" | "primary" | "billing" | "shipping" | "mailing" | "meeting" | "legal";
178
+ fullText: string | null;
179
+ line1: string | null;
180
+ line2: string | null;
181
+ city: string | null;
182
+ region: string | null;
183
+ postalCode: string | null;
184
+ country: string | null;
185
+ isPrimary: boolean;
186
+ } | null;
122
187
  relation: string | null;
123
188
  status: string;
124
189
  } | null;
@@ -161,13 +226,33 @@ export declare const publicCustomerPortalRoutes: import("hono/hono-base").HonoBa
161
226
  email: string;
162
227
  emailVerified: boolean;
163
228
  firstName: string | null;
229
+ middleName: string | null;
164
230
  lastName: string | null;
165
231
  avatarUrl: string | null;
166
232
  locale: string;
167
233
  timezone: string | null;
168
234
  seatingPreference: "aisle" | "window" | "middle" | "no_preference" | null;
235
+ dateOfBirth: string | null;
236
+ address: {
237
+ country: string | null;
238
+ state: string | null;
239
+ city: string | null;
240
+ postalCode: string | null;
241
+ addressLine1: string | null;
242
+ addressLine2: string | null;
243
+ } | null;
244
+ documents: {
245
+ type: "visa" | "other" | "passport" | "drivers_license" | "id_card";
246
+ number: string;
247
+ issuingAuthority: string | null;
248
+ issuingCountry: string;
249
+ nationality: string | null;
250
+ expiryDate: string;
251
+ issueDate: string | null;
252
+ }[];
169
253
  marketingConsent: boolean;
170
254
  marketingConsentAt: string | null;
255
+ marketingConsentSource: string | null;
171
256
  notificationDefaults: {
172
257
  [x: string]: import("hono/utils/types").JSONValue;
173
258
  } | null;
@@ -186,6 +271,18 @@ export declare const publicCustomerPortalRoutes: import("hono/hono-base").HonoBa
186
271
  address: string | null;
187
272
  city: string | null;
188
273
  country: string | null;
274
+ billingAddress: {
275
+ id: string;
276
+ label: "other" | "service" | "primary" | "billing" | "shipping" | "mailing" | "meeting" | "legal";
277
+ fullText: string | null;
278
+ line1: string | null;
279
+ line2: string | null;
280
+ city: string | null;
281
+ region: string | null;
282
+ postalCode: string | null;
283
+ country: string | null;
284
+ isPrimary: boolean;
285
+ } | null;
189
286
  relation: string | null;
190
287
  status: string;
191
288
  } | null;
@@ -202,6 +299,18 @@ export declare const publicCustomerPortalRoutes: import("hono/hono-base").HonoBa
202
299
  address: string | null;
203
300
  city: string | null;
204
301
  country: string | null;
302
+ billingAddress: {
303
+ id: string;
304
+ label: "other" | "service" | "primary" | "billing" | "shipping" | "mailing" | "meeting" | "legal";
305
+ fullText: string | null;
306
+ line1: string | null;
307
+ line2: string | null;
308
+ city: string | null;
309
+ region: string | null;
310
+ postalCode: string | null;
311
+ country: string | null;
312
+ isPrimary: boolean;
313
+ } | null;
205
314
  relation: string | null;
206
315
  status: string;
207
316
  linkable: boolean;
@@ -234,6 +343,31 @@ export declare const publicCustomerPortalRoutes: import("hono/hono-base").HonoBa
234
343
  phone: string | null;
235
344
  isPrimary: boolean;
236
345
  notes: string | null;
346
+ typeKey: string | null;
347
+ person: {
348
+ firstName: string | null;
349
+ middleName: string | null;
350
+ lastName: string | null;
351
+ dateOfBirth: string | null;
352
+ addresses: {
353
+ type: string | null;
354
+ country: string | null;
355
+ state: string | null;
356
+ city: string | null;
357
+ postalCode: string | null;
358
+ addressLine1: string | null;
359
+ addressLine2: string | null;
360
+ isDefault: boolean;
361
+ }[];
362
+ documents: {
363
+ type: "visa" | "other" | "passport" | "drivers_license" | "id_card";
364
+ number: string | null;
365
+ issuingAuthority: string | null;
366
+ country: string | null;
367
+ issueDate: string | null;
368
+ expiryDate: string | null;
369
+ }[];
370
+ };
237
371
  metadata: {
238
372
  [x: string]: import("hono/utils/types").JSONValue;
239
373
  } | null;
@@ -271,6 +405,31 @@ export declare const publicCustomerPortalRoutes: import("hono/hono-base").HonoBa
271
405
  phone: string | null;
272
406
  isPrimary: boolean;
273
407
  notes: string | null;
408
+ typeKey: string | null;
409
+ person: {
410
+ firstName: string | null;
411
+ middleName: string | null;
412
+ lastName: string | null;
413
+ dateOfBirth: string | null;
414
+ addresses: {
415
+ type: string | null;
416
+ country: string | null;
417
+ state: string | null;
418
+ city: string | null;
419
+ postalCode: string | null;
420
+ addressLine1: string | null;
421
+ addressLine2: string | null;
422
+ isDefault: boolean;
423
+ }[];
424
+ documents: {
425
+ type: "visa" | "other" | "passport" | "drivers_license" | "id_card";
426
+ number: string | null;
427
+ issuingAuthority: string | null;
428
+ country: string | null;
429
+ issueDate: string | null;
430
+ expiryDate: string | null;
431
+ }[];
432
+ };
274
433
  metadata: {
275
434
  [x: string]: import("hono/utils/types").JSONValue;
276
435
  } | null;
@@ -280,6 +439,71 @@ export declare const publicCustomerPortalRoutes: import("hono/hono-base").HonoBa
280
439
  status: 201;
281
440
  };
282
441
  };
442
+ } & {
443
+ "/companions/import-booking-participants": {
444
+ $post: {
445
+ input: {};
446
+ output: {
447
+ error: string;
448
+ };
449
+ outputFormat: "json";
450
+ status: 401;
451
+ } | {
452
+ input: {};
453
+ output: {
454
+ error: string;
455
+ };
456
+ outputFormat: "json";
457
+ status: 409;
458
+ } | {
459
+ input: {};
460
+ output: {
461
+ data: {
462
+ created: {
463
+ id: string;
464
+ role: string;
465
+ name: string;
466
+ title: string | null;
467
+ email: string | null;
468
+ phone: string | null;
469
+ isPrimary: boolean;
470
+ notes: string | null;
471
+ typeKey: string | null;
472
+ person: {
473
+ firstName: string | null;
474
+ middleName: string | null;
475
+ lastName: string | null;
476
+ dateOfBirth: string | null;
477
+ addresses: {
478
+ type: string | null;
479
+ country: string | null;
480
+ state: string | null;
481
+ city: string | null;
482
+ postalCode: string | null;
483
+ addressLine1: string | null;
484
+ addressLine2: string | null;
485
+ isDefault: boolean;
486
+ }[];
487
+ documents: {
488
+ type: "visa" | "other" | "passport" | "drivers_license" | "id_card";
489
+ number: string | null;
490
+ issuingAuthority: string | null;
491
+ country: string | null;
492
+ issueDate: string | null;
493
+ expiryDate: string | null;
494
+ }[];
495
+ };
496
+ metadata: {
497
+ [x: string]: import("hono/utils/types").JSONValue;
498
+ } | null;
499
+ }[];
500
+ skippedCount: number;
501
+ };
502
+ };
503
+ outputFormat: "json";
504
+ status: import("hono/utils/http-status").ContentfulStatusCode;
505
+ };
506
+ };
283
507
  } & {
284
508
  "/companions/:companionId": {
285
509
  $patch: {
@@ -331,6 +555,31 @@ export declare const publicCustomerPortalRoutes: import("hono/hono-base").HonoBa
331
555
  phone: string | null;
332
556
  isPrimary: boolean;
333
557
  notes: string | null;
558
+ typeKey: string | null;
559
+ person: {
560
+ firstName: string | null;
561
+ middleName: string | null;
562
+ lastName: string | null;
563
+ dateOfBirth: string | null;
564
+ addresses: {
565
+ type: string | null;
566
+ country: string | null;
567
+ state: string | null;
568
+ city: string | null;
569
+ postalCode: string | null;
570
+ addressLine1: string | null;
571
+ addressLine2: string | null;
572
+ isDefault: boolean;
573
+ }[];
574
+ documents: {
575
+ type: "visa" | "other" | "passport" | "drivers_license" | "id_card";
576
+ number: string | null;
577
+ issuingAuthority: string | null;
578
+ country: string | null;
579
+ issueDate: string | null;
580
+ expiryDate: string | null;
581
+ }[];
582
+ };
334
583
  metadata: {
335
584
  [x: string]: import("hono/utils/types").JSONValue;
336
585
  } | null;
@@ -413,6 +662,8 @@ export declare const publicCustomerPortalRoutes: import("hono/hono-base").HonoBa
413
662
  status: "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
414
663
  sellCurrency: string;
415
664
  sellAmountCents: number | null;
665
+ productTitle: string | null;
666
+ paymentStatus: "partially_paid" | "paid" | "overdue" | "unpaid";
416
667
  startDate: string | null;
417
668
  endDate: string | null;
418
669
  pax: number | null;
@@ -497,13 +748,58 @@ export declare const publicCustomerPortalRoutes: import("hono/hono-base").HonoBa
497
748
  isPrimary: boolean;
498
749
  }[];
499
750
  }[];
751
+ billingContact: {
752
+ email: string | null;
753
+ phone: string | null;
754
+ firstName: string | null;
755
+ lastName: string | null;
756
+ country: string | null;
757
+ state: string | null;
758
+ city: string | null;
759
+ address1: string | null;
760
+ postal: string | null;
761
+ } | null;
500
762
  documents: {
501
763
  id: string;
764
+ source: "legal" | "finance" | "booking_document";
502
765
  participantId: string | null;
503
- type: "visa" | "insurance" | "health" | "passport_copy" | "other";
766
+ type: "visa" | "insurance" | "health" | "passport_copy" | "other" | "invoice" | "proforma" | "credit_note" | "contract";
504
767
  fileName: string;
505
768
  fileUrl: string;
769
+ mimeType: string | null;
770
+ reference: string | null;
506
771
  }[];
772
+ financials: {
773
+ documents: {
774
+ invoiceId: string;
775
+ invoiceNumber: string;
776
+ invoiceType: "invoice" | "proforma" | "credit_note";
777
+ invoiceStatus: "draft" | "void" | "sent" | "partially_paid" | "paid" | "overdue";
778
+ currency: string;
779
+ totalCents: number;
780
+ paidCents: number;
781
+ balanceDueCents: number;
782
+ issueDate: string;
783
+ dueDate: string;
784
+ documentStatus: "pending" | "failed" | "ready" | "stale" | "missing";
785
+ format: "pdf" | "json" | "html" | "xml" | null;
786
+ generatedAt: string | null;
787
+ downloadUrl: string | null;
788
+ }[];
789
+ payments: {
790
+ id: string;
791
+ invoiceId: string;
792
+ invoiceNumber: string;
793
+ invoiceType: "invoice" | "proforma" | "credit_note";
794
+ status: "completed" | "pending" | "failed" | "refunded";
795
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
796
+ amountCents: number;
797
+ currency: string;
798
+ paymentDate: string;
799
+ referenceNumber: string | null;
800
+ notes: string | null;
801
+ }[];
802
+ };
507
803
  fulfillments: {
508
804
  id: string;
509
805
  bookingItemId: string | null;
@@ -552,17 +848,67 @@ export declare const publicCustomerPortalRoutes: import("hono/hono-base").HonoBa
552
848
  output: {
553
849
  data: {
554
850
  id: string;
851
+ source: "legal" | "finance" | "booking_document";
555
852
  participantId: string | null;
556
- type: "visa" | "insurance" | "health" | "passport_copy" | "other";
853
+ type: "visa" | "insurance" | "health" | "passport_copy" | "other" | "invoice" | "proforma" | "credit_note" | "contract";
557
854
  fileName: string;
558
855
  fileUrl: string;
856
+ mimeType: string | null;
857
+ reference: string | null;
559
858
  }[];
560
859
  };
561
860
  outputFormat: "json";
562
861
  status: import("hono/utils/http-status").ContentfulStatusCode;
563
862
  };
564
863
  };
565
- }, "/", "/bookings/:bookingId/documents">;
864
+ } & {
865
+ "/bookings/:bookingId/billing-contact": {
866
+ $get: {
867
+ input: {
868
+ param: {
869
+ bookingId: string;
870
+ };
871
+ };
872
+ output: {
873
+ error: string;
874
+ };
875
+ outputFormat: "json";
876
+ status: 401;
877
+ } | {
878
+ input: {
879
+ param: {
880
+ bookingId: string;
881
+ };
882
+ };
883
+ output: {
884
+ error: string;
885
+ };
886
+ outputFormat: "json";
887
+ status: 404;
888
+ } | {
889
+ input: {
890
+ param: {
891
+ bookingId: string;
892
+ };
893
+ };
894
+ output: {
895
+ data: {
896
+ email: string | null;
897
+ phone: string | null;
898
+ firstName: string | null;
899
+ lastName: string | null;
900
+ country: string | null;
901
+ state: string | null;
902
+ city: string | null;
903
+ address1: string | null;
904
+ postal: string | null;
905
+ };
906
+ };
907
+ outputFormat: "json";
908
+ status: import("hono/utils/http-status").ContentfulStatusCode;
909
+ };
910
+ };
911
+ }, "/", "/bookings/:bookingId/billing-contact">;
566
912
  export type PublicCustomerPortalRoutes = typeof publicCustomerPortalRoutes;
567
913
  export {};
568
914
  //# sourceMappingURL=routes-public.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"routes-public.d.ts","sourceRoot":"","sources":["../src/routes-public.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAWjE,KAAK,GAAG,GAAG;IACT,SAAS,EAAE;QACT,EAAE,EAAE,kBAAkB,CAAA;QACtB,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA;AAwBD,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CA8MnC,CAAA;AAEJ,MAAM,MAAM,0BAA0B,GAAG,OAAO,0BAA0B,CAAA"}
@@ -1,6 +1,22 @@
1
+ import { createKmsProviderFromEnv } from "@voyantjs/utils";
1
2
  import { Hono } from "hono";
2
3
  import { publicCustomerPortalService } from "./service-public.js";
3
- import { bootstrapCustomerPortalSchema, createCustomerPortalCompanionSchema, updateCustomerPortalCompanionSchema, updateCustomerPortalProfileSchema, } from "./validation-public.js";
4
+ import { bootstrapCustomerPortalSchema, createCustomerPortalCompanionSchema, importCustomerPortalBookingParticipantsSchema, updateCustomerPortalCompanionSchema, updateCustomerPortalProfileSchema, } from "./validation-public.js";
5
+ function getRuntimeEnv(c) {
6
+ const processEnv = globalThis.process?.env ?? {};
7
+ return {
8
+ ...processEnv,
9
+ ...(c.env ?? {}),
10
+ };
11
+ }
12
+ function resolveOptionalKms(c) {
13
+ try {
14
+ return createKmsProviderFromEnv(getRuntimeEnv(c));
15
+ }
16
+ catch {
17
+ return null;
18
+ }
19
+ }
4
20
  function unauthorized(c) {
5
21
  return c.json({ error: "Unauthorized" }, 401);
6
22
  }
@@ -19,7 +35,9 @@ export const publicCustomerPortalRoutes = new Hono()
19
35
  if (!userId) {
20
36
  return unauthorized(c);
21
37
  }
22
- const profile = await publicCustomerPortalService.getProfile(c.get("db"), userId);
38
+ const profile = await publicCustomerPortalService.getProfileWithOptions(c.get("db"), userId, {
39
+ kms: resolveOptionalKms(c),
40
+ });
23
41
  return profile ? c.json({ data: profile }) : notFound(c, "Customer profile not found");
24
42
  })
25
43
  .patch("/me", async (c) => {
@@ -27,7 +45,9 @@ export const publicCustomerPortalRoutes = new Hono()
27
45
  if (!userId) {
28
46
  return unauthorized(c);
29
47
  }
30
- const result = await publicCustomerPortalService.updateProfile(c.get("db"), userId, updateCustomerPortalProfileSchema.parse(await c.req.json()));
48
+ const result = await publicCustomerPortalService.updateProfileWithOptions(c.get("db"), userId, updateCustomerPortalProfileSchema.parse(await c.req.json()), {
49
+ kms: resolveOptionalKms(c),
50
+ });
31
51
  if (hasErrorResult(result)) {
32
52
  if (result.error === "not_found") {
33
53
  return notFound(c, "Customer profile not found");
@@ -73,6 +93,17 @@ export const publicCustomerPortalRoutes = new Hono()
73
93
  return c.json({ error: "Customer record is not linked to this account" }, 409);
74
94
  }
75
95
  return c.json({ data: companion }, 201);
96
+ })
97
+ .post("/companions/import-booking-participants", async (c) => {
98
+ const userId = c.get("userId");
99
+ if (!userId) {
100
+ return unauthorized(c);
101
+ }
102
+ const result = await publicCustomerPortalService.importBookingParticipantsAsCompanions(c.get("db"), userId, importCustomerPortalBookingParticipantsSchema.parse(await c.req.json()));
103
+ if (!result) {
104
+ return c.json({ error: "Customer record is not linked to this account" }, 409);
105
+ }
106
+ return c.json({ data: result });
76
107
  })
77
108
  .patch("/companions/:companionId", async (c) => {
78
109
  const userId = c.get("userId");
@@ -125,4 +156,12 @@ export const publicCustomerPortalRoutes = new Hono()
125
156
  }
126
157
  const documents = await publicCustomerPortalService.listBookingDocuments(c.get("db"), userId, c.req.param("bookingId"));
127
158
  return documents ? c.json({ data: documents }) : notFound(c, "Booking not found");
159
+ })
160
+ .get("/bookings/:bookingId/billing-contact", async (c) => {
161
+ const userId = c.get("userId");
162
+ if (!userId) {
163
+ return unauthorized(c);
164
+ }
165
+ const billingContact = await publicCustomerPortalService.getBookingBillingContact(c.get("db"), userId, c.req.param("bookingId"));
166
+ return billingContact ? c.json({ data: billingContact }) : notFound(c, "Booking not found");
128
167
  });
package/dist/routes.d.ts CHANGED
@@ -20,7 +20,22 @@ export declare const customerPortalRoutes: import("hono/hono-base").HonoBase<Env
20
20
  status: import("hono/utils/http-status").ContentfulStatusCode;
21
21
  };
22
22
  };
23
- }, "/", "/contact-exists">;
23
+ } & {
24
+ "/contact-exists/phone": {
25
+ $get: {
26
+ input: {};
27
+ output: {
28
+ data: {
29
+ phone: string;
30
+ customerRecordExists: boolean;
31
+ linkedCustomerRecordExists: boolean;
32
+ };
33
+ };
34
+ outputFormat: "json";
35
+ status: import("hono/utils/http-status").ContentfulStatusCode;
36
+ };
37
+ };
38
+ }, "/", "/contact-exists/phone">;
24
39
  export type CustomerPortalRoutes = typeof customerPortalRoutes;
25
40
  export {};
26
41
  //# sourceMappingURL=routes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAMjE,KAAK,GAAG,GAAG;IACT,SAAS,EAAE;QACT,EAAE,EAAE,kBAAkB,CAAA;KACvB,CAAA;CACF,CAAA;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;0BAQ/B,CAAA;AAEF,MAAM,MAAM,oBAAoB,GAAG,OAAO,oBAAoB,CAAA"}
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AASjE,KAAK,GAAG,GAAG;IACT,SAAS,EAAE;QACT,EAAE,EAAE,kBAAkB,CAAA;KACvB,CAAA;CACF,CAAA;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAmB7B,CAAA;AAEJ,MAAM,MAAM,oBAAoB,GAAG,OAAO,oBAAoB,CAAA"}
package/dist/routes.js CHANGED
@@ -1,9 +1,16 @@
1
1
  import { Hono } from "hono";
2
2
  import { publicCustomerPortalService } from "./service-public.js";
3
- import { customerPortalContactExistsQuerySchema } from "./validation-public.js";
4
- export const customerPortalRoutes = new Hono().get("/contact-exists", async (c) => {
3
+ import { customerPortalContactExistsQuerySchema, customerPortalPhoneContactExistsQuerySchema, } from "./validation-public.js";
4
+ export const customerPortalRoutes = new Hono()
5
+ .get("/contact-exists", async (c) => {
5
6
  const query = customerPortalContactExistsQuerySchema.parse(Object.fromEntries(new URL(c.req.url).searchParams));
6
7
  return c.json({
7
8
  data: await publicCustomerPortalService.contactExists(c.get("db"), query.email),
8
9
  });
10
+ })
11
+ .get("/contact-exists/phone", async (c) => {
12
+ const query = customerPortalPhoneContactExistsQuerySchema.parse(Object.fromEntries(new URL(c.req.url).searchParams));
13
+ return c.json({
14
+ data: await publicCustomerPortalService.phoneContactExists(c.get("db"), query.phone),
15
+ });
9
16
  });