@voyant-travel/storefront 0.120.1
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/LICENSE +201 -0
- package/README.md +231 -0
- package/dist/booking-intents.d.ts +42 -0
- package/dist/booking-intents.d.ts.map +1 -0
- package/dist/booking-intents.js +83 -0
- package/dist/customer-portal/index.d.ts +16 -0
- package/dist/customer-portal/index.d.ts.map +1 -0
- package/dist/customer-portal/index.js +23 -0
- package/dist/customer-portal/route-runtime.d.ts +16 -0
- package/dist/customer-portal/route-runtime.d.ts.map +1 -0
- package/dist/customer-portal/route-runtime.js +27 -0
- package/dist/customer-portal/routes-public.d.ts +1936 -0
- package/dist/customer-portal/routes-public.d.ts.map +1 -0
- package/dist/customer-portal/routes-public.js +165 -0
- package/dist/customer-portal/routes.d.ts +43 -0
- package/dist/customer-portal/routes.d.ts.map +1 -0
- package/dist/customer-portal/routes.js +17 -0
- package/dist/customer-portal/service-public-impl.d.ts +138 -0
- package/dist/customer-portal/service-public-impl.d.ts.map +1 -0
- package/dist/customer-portal/service-public-impl.js +1808 -0
- package/dist/customer-portal/service-public.d.ts +2 -0
- package/dist/customer-portal/service-public.d.ts.map +1 -0
- package/dist/customer-portal/service-public.js +1 -0
- package/dist/customer-portal/validation-public/bookings.d.ts +551 -0
- package/dist/customer-portal/validation-public/bookings.d.ts.map +1 -0
- package/dist/customer-portal/validation-public/bookings.js +132 -0
- package/dist/customer-portal/validation-public/common.d.ts +162 -0
- package/dist/customer-portal/validation-public/common.d.ts.map +1 -0
- package/dist/customer-portal/validation-public/common.js +139 -0
- package/dist/customer-portal/validation-public/profile.d.ts +749 -0
- package/dist/customer-portal/validation-public/profile.d.ts.map +1 -0
- package/dist/customer-portal/validation-public/profile.js +308 -0
- package/dist/customer-portal/validation-public.d.ts +3 -0
- package/dist/customer-portal/validation-public.d.ts.map +1 -0
- package/dist/customer-portal/validation-public.js +2 -0
- package/dist/guest-booking-guard.d.ts +24 -0
- package/dist/guest-booking-guard.d.ts.map +1 -0
- package/dist/guest-booking-guard.js +55 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +41 -0
- package/dist/product-extra-ref.d.ts +238 -0
- package/dist/product-extra-ref.d.ts.map +1 -0
- package/dist/product-extra-ref.js +22 -0
- package/dist/routes-admin.d.ts +220 -0
- package/dist/routes-admin.d.ts.map +1 -0
- package/dist/routes-admin.js +28 -0
- package/dist/routes-public.d.ts +1475 -0
- package/dist/routes-public.d.ts.map +1 -0
- package/dist/routes-public.js +362 -0
- package/dist/service-booking-session-bootstrap.d.ts +227 -0
- package/dist/service-booking-session-bootstrap.d.ts.map +1 -0
- package/dist/service-booking-session-bootstrap.js +287 -0
- package/dist/service-boundary-resource-sql.d.ts +18 -0
- package/dist/service-boundary-resource-sql.d.ts.map +1 -0
- package/dist/service-boundary-resource-sql.js +73 -0
- package/dist/service-boundary-sql.d.ts +103 -0
- package/dist/service-boundary-sql.d.ts.map +1 -0
- package/dist/service-boundary-sql.js +307 -0
- package/dist/service-departures-core.d.ts +41 -0
- package/dist/service-departures-core.d.ts.map +1 -0
- package/dist/service-departures-core.js +92 -0
- package/dist/service-departures-extensions.d.ts +46 -0
- package/dist/service-departures-extensions.d.ts.map +1 -0
- package/dist/service-departures-extensions.js +81 -0
- package/dist/service-departures-offers.d.ts +220 -0
- package/dist/service-departures-offers.d.ts.map +1 -0
- package/dist/service-departures-offers.js +177 -0
- package/dist/service-departures-price-preview.d.ts +306 -0
- package/dist/service-departures-price-preview.d.ts.map +1 -0
- package/dist/service-departures-price-preview.js +383 -0
- package/dist/service-departures-pricing-context.d.ts +115 -0
- package/dist/service-departures-pricing-context.d.ts.map +1 -0
- package/dist/service-departures-pricing-context.js +237 -0
- package/dist/service-departures-pricing.d.ts +5 -0
- package/dist/service-departures-pricing.d.ts.map +1 -0
- package/dist/service-departures-pricing.js +4 -0
- package/dist/service-departures.d.ts +192 -0
- package/dist/service-departures.d.ts.map +1 -0
- package/dist/service-departures.js +213 -0
- package/dist/service-intake.d.ts +130 -0
- package/dist/service-intake.d.ts.map +1 -0
- package/dist/service-intake.js +274 -0
- package/dist/service-transport-eligibility.d.ts +10 -0
- package/dist/service-transport-eligibility.d.ts.map +1 -0
- package/dist/service-transport-eligibility.js +198 -0
- package/dist/service.d.ts +1062 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +332 -0
- package/dist/transport-eligibility.d.ts +4 -0
- package/dist/transport-eligibility.d.ts.map +1 -0
- package/dist/transport-eligibility.js +2 -0
- package/dist/validation/departures.d.ts +1669 -0
- package/dist/validation/departures.d.ts.map +1 -0
- package/dist/validation/departures.js +397 -0
- package/dist/validation/intake.d.ts +147 -0
- package/dist/validation/intake.d.ts.map +1 -0
- package/dist/validation/intake.js +69 -0
- package/dist/validation/offers.d.ts +340 -0
- package/dist/validation/offers.d.ts.map +1 -0
- package/dist/validation/offers.js +117 -0
- package/dist/validation-settings.d.ts +609 -0
- package/dist/validation-settings.d.ts.map +1 -0
- package/dist/validation-settings.js +235 -0
- package/dist/validation-transport-eligibility.d.ts +314 -0
- package/dist/validation-transport-eligibility.d.ts.map +1 -0
- package/dist/validation-transport-eligibility.js +97 -0
- package/dist/validation.d.ts +6 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +4 -0
- package/dist/verification/index.d.ts +12 -0
- package/dist/verification/index.d.ts.map +1 -0
- package/dist/verification/index.js +18 -0
- package/dist/verification/routes-public.d.ts +121 -0
- package/dist/verification/routes-public.d.ts.map +1 -0
- package/dist/verification/routes-public.js +125 -0
- package/dist/verification/schema.d.ts +273 -0
- package/dist/verification/schema.d.ts.map +1 -0
- package/dist/verification/schema.js +50 -0
- package/dist/verification/service.d.ts +114 -0
- package/dist/verification/service.d.ts.map +1 -0
- package/dist/verification/service.js +283 -0
- package/dist/verification/validation.d.ts +98 -0
- package/dist/verification/validation.d.ts.map +1 -0
- package/dist/verification/validation.js +54 -0
- package/package.json +148 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for describing the origin of the Work and
|
|
141
|
+
reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may accept and charge a
|
|
167
|
+
fee for, the acceptance of support, warranty, indemnity, or
|
|
168
|
+
other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 PixelMakers Studio SRL
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
# @voyant-travel/storefront
|
|
2
|
+
|
|
3
|
+
Public storefront routes and service helpers for checkout-adjacent product, departure,
|
|
4
|
+
offer, and eligibility flows.
|
|
5
|
+
|
|
6
|
+
## Composite Price Preview
|
|
7
|
+
|
|
8
|
+
`POST /departures/:departureId/price` preserves the original quote fields
|
|
9
|
+
(`basePrice`, `taxAmount`, `total`, `notes`, and `lineItems`) and now also
|
|
10
|
+
returns the context needed to render a checkout price card in one request:
|
|
11
|
+
|
|
12
|
+
- `allocation` describes the resolved public departure slot, capacity state,
|
|
13
|
+
requested traveler mix, requested units, and selected rooms.
|
|
14
|
+
- `units` and `rooms` expose customer-facing pricing rows for per-person,
|
|
15
|
+
per-unit, or room-based products.
|
|
16
|
+
- `extras` lists active product extensions with selection/applicability,
|
|
17
|
+
quantity, unit price, and price impact.
|
|
18
|
+
- `offers` lists applicable public offers, selected/applied discounts,
|
|
19
|
+
requested manual offer/code results, and conflict policy.
|
|
20
|
+
- `totals` carries base, extras, subtotal, discount, tax, final total,
|
|
21
|
+
per-person, and per-booking amounts in the selected currency.
|
|
22
|
+
|
|
23
|
+
Request bodies remain compatible with simple price preview calls:
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"pax": { "adults": 2, "children": 0, "infants": 0 },
|
|
28
|
+
"rooms": [{ "unitId": "ount_room", "occupancy": 2, "quantity": 1 }],
|
|
29
|
+
"extras": [{ "extraId": "pext_transfer", "quantity": 1 }],
|
|
30
|
+
"offers": [{ "slug": "early-booking" }],
|
|
31
|
+
"offerCode": "SPRING25",
|
|
32
|
+
"locale": "en",
|
|
33
|
+
"market": "default"
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Offer resolution is optional and host-owned. Wire the storefront module with
|
|
38
|
+
`offers` or `resolveOffers` resolvers to populate offer applicability and manual
|
|
39
|
+
offer/code impacts. Without resolvers, the route still returns allocation,
|
|
40
|
+
units, rooms, extras, and final totals with an empty `offers` block.
|
|
41
|
+
|
|
42
|
+
## Public Intake
|
|
43
|
+
|
|
44
|
+
Storefront can accept public CRM intake at the public root:
|
|
45
|
+
|
|
46
|
+
- `POST /leads`
|
|
47
|
+
- `POST /newsletter/subscribe`
|
|
48
|
+
|
|
49
|
+
When mounted through `createStorefrontHonoModule`, these become
|
|
50
|
+
`/v1/public/leads` and `/v1/public/newsletter/subscribe`.
|
|
51
|
+
|
|
52
|
+
Both routes create a CRM person and a CRM customer signal. Lead intake accepts
|
|
53
|
+
the CRM signal `kind`, `source`, product/option references, bounded payload
|
|
54
|
+
metadata, and consent metadata. Newsletter intake records a `notify` signal and
|
|
55
|
+
uses `sourceSubmissionId` for idempotency; when omitted, the email address is
|
|
56
|
+
used to derive a stable newsletter submission key.
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
import { createStorefrontHonoModule } from "@voyant-travel/storefront"
|
|
60
|
+
|
|
61
|
+
createStorefrontHonoModule({
|
|
62
|
+
intake: {
|
|
63
|
+
guard({ body, context }) {
|
|
64
|
+
// Install host-owned rate-limit, captcha, signature, or abuse checks.
|
|
65
|
+
if (!isCaptchaValid(body, context)) {
|
|
66
|
+
return { allowed: false, status: 429, error: "Captcha required" }
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
async requestNewsletterDoubleOptIn({ email, signalId }) {
|
|
70
|
+
await sendDoubleOptInEmail(email, { signalId })
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
})
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Accepted intake emits `customer.signal.created` on the app event bus with
|
|
77
|
+
`metadata.category: "domain"` and an `intake` payload describing whether the
|
|
78
|
+
signal came from `lead` or `newsletter` intake. Notification adapters can
|
|
79
|
+
subscribe to that event to send CRM email, Slack, or other operator alerts.
|
|
80
|
+
|
|
81
|
+
## Verification
|
|
82
|
+
|
|
83
|
+
Storefront owns public email and SMS verification challenges for customer-facing
|
|
84
|
+
checkout and account flows.
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
import { createStorefrontVerificationHonoModule } from "@voyant-travel/storefront/verification"
|
|
88
|
+
|
|
89
|
+
const storefrontVerification = createStorefrontVerificationHonoModule({
|
|
90
|
+
resolveProviders: (bindings) => [
|
|
91
|
+
// return notification-compatible providers for email and/or sms
|
|
92
|
+
],
|
|
93
|
+
email: {
|
|
94
|
+
subject: "Your verification code",
|
|
95
|
+
},
|
|
96
|
+
})
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Mount the returned module in the same app that exposes the public route:
|
|
100
|
+
|
|
101
|
+
```ts
|
|
102
|
+
createApp({
|
|
103
|
+
publicPaths: ["/v1/public/storefront-verification"],
|
|
104
|
+
modules: [storefrontVerification],
|
|
105
|
+
})
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
The route module serves:
|
|
109
|
+
|
|
110
|
+
- `POST /v1/public/storefront-verification/email/start`
|
|
111
|
+
- `POST /v1/public/storefront-verification/email/confirm`
|
|
112
|
+
- `POST /v1/public/storefront-verification/sms/start`
|
|
113
|
+
- `POST /v1/public/storefront-verification/sms/confirm`
|
|
114
|
+
|
|
115
|
+
The verification schema lives at
|
|
116
|
+
`@voyant-travel/storefront/verification/schema` and stores challenge rows in
|
|
117
|
+
`storefront_verification_challenges`. Apps that maintain an explicit Drizzle
|
|
118
|
+
schema array must include:
|
|
119
|
+
|
|
120
|
+
```ts
|
|
121
|
+
export default defineConfig({
|
|
122
|
+
schema: [
|
|
123
|
+
"../../packages/db/src/schema/index.ts",
|
|
124
|
+
"../../packages/storefront/src/verification/schema.ts",
|
|
125
|
+
],
|
|
126
|
+
})
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
For package-based tooling, `@voyant-travel/storefront` declares its schema as
|
|
130
|
+
`./verification/schema` with `@voyant-travel/db` as the required base schema.
|
|
131
|
+
|
|
132
|
+
## Guest Booking Lookup
|
|
133
|
+
|
|
134
|
+
Use the bookings public guest lookup endpoint before rendering booking overview
|
|
135
|
+
or payment pages for guests:
|
|
136
|
+
|
|
137
|
+
- `POST /v1/public/bookings/guest-lookup` with `bookingCode` and `email`
|
|
138
|
+
- `GET /v1/public/bookings/overview?bookingCode=...` with the issued guest
|
|
139
|
+
access cookie or `X-Voyant-Guest-Booking-Access` header
|
|
140
|
+
|
|
141
|
+
The lookup endpoint verifies the email against booking participants, issues a
|
|
142
|
+
short-lived `voyant_guest_booking` HttpOnly cookie, and returns the same scoped
|
|
143
|
+
token for non-browser clients. When `RATE_LIMIT` KV is bound, lookups are
|
|
144
|
+
throttled per client IP and booking code.
|
|
145
|
+
|
|
146
|
+
```ts
|
|
147
|
+
import { createGuestBookingGuard } from "@voyant-travel/storefront"
|
|
148
|
+
|
|
149
|
+
const guestBooking = createGuestBookingGuard()
|
|
150
|
+
|
|
151
|
+
if (!guestBooking.hasAccess(request)) {
|
|
152
|
+
return fetch(guestBooking.lookupPath, guestBooking.createLookupRequest({
|
|
153
|
+
bookingCode: form.bookingCode,
|
|
154
|
+
email: form.email,
|
|
155
|
+
}))
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return fetch(guestBooking.overviewUrl(form.bookingCode), {
|
|
159
|
+
headers: { Cookie: request.headers.get("Cookie") ?? "" },
|
|
160
|
+
})
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Transport Eligibility
|
|
164
|
+
|
|
165
|
+
Storefronts can check whether traveler document facts satisfy departure-level
|
|
166
|
+
transport rules before checkout confirmation.
|
|
167
|
+
|
|
168
|
+
```ts
|
|
169
|
+
import { createStorefrontPublicRoutes } from "@voyant-travel/storefront"
|
|
170
|
+
|
|
171
|
+
createStorefrontPublicRoutes({
|
|
172
|
+
transportEligibilityRules: [
|
|
173
|
+
{
|
|
174
|
+
id: "egypt-passport-validity",
|
|
175
|
+
label: "Egypt passport validity",
|
|
176
|
+
productId: "prod_123",
|
|
177
|
+
destinationCountries: ["EG"],
|
|
178
|
+
nationalityCountries: ["RO"],
|
|
179
|
+
requiredDocumentType: "passport",
|
|
180
|
+
minValidityDaysAfterReturn: 180,
|
|
181
|
+
visaRequired: true,
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
})
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Schemas and the standalone evaluator are exported from
|
|
188
|
+
`@voyant-travel/storefront/transport-eligibility`.
|
|
189
|
+
|
|
190
|
+
The public API is available at:
|
|
191
|
+
|
|
192
|
+
- `POST /departures/:departureId/eligibility`
|
|
193
|
+
- `POST /products/:productId/departures/:departureId/eligibility`
|
|
194
|
+
|
|
195
|
+
Request bodies contain only eligibility facts:
|
|
196
|
+
|
|
197
|
+
```json
|
|
198
|
+
{
|
|
199
|
+
"travelStartsOn": "2026-08-01",
|
|
200
|
+
"travelEndsOn": "2026-08-08",
|
|
201
|
+
"travelers": [
|
|
202
|
+
{
|
|
203
|
+
"travelerRef": "traveler_1",
|
|
204
|
+
"nationalityCountry": "RO",
|
|
205
|
+
"dateOfBirth": "1990-01-01",
|
|
206
|
+
"documents": [
|
|
207
|
+
{
|
|
208
|
+
"type": "passport",
|
|
209
|
+
"issuingCountry": "RO",
|
|
210
|
+
"expiresOn": "2027-03-01"
|
|
211
|
+
}
|
|
212
|
+
],
|
|
213
|
+
"hasVisa": true
|
|
214
|
+
}
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Responses return a top-level `eligible` flag plus traveler-specific blocking
|
|
220
|
+
issues and warnings. Supported rule dimensions are product, departure,
|
|
221
|
+
destination country, nationality country, required document type, minimum
|
|
222
|
+
validity after return, age range, visa requirement, minor consent requirement,
|
|
223
|
+
and warning/blocking severity.
|
|
224
|
+
|
|
225
|
+
Do not send or store raw passport numbers through this surface. The route and
|
|
226
|
+
schemas only model document type, issuing country, expiry date, nationality,
|
|
227
|
+
birth date, and boolean evidence such as `hasVisa`.
|
|
228
|
+
|
|
229
|
+
This first slice is API-only. Admin CRUD and operator UI for managing transport
|
|
230
|
+
rules should persist normalized rule objects and can call the same public
|
|
231
|
+
eligibility service once added.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { EventBus, EventHandler } from "@voyant-travel/core";
|
|
2
|
+
import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
|
|
3
|
+
import { type StorefrontRequestContext, type StorefrontServiceOptions } from "./service.js";
|
|
4
|
+
/**
|
|
5
|
+
* Async booking-session bootstrap over the queued write pipeline (RFC
|
|
6
|
+
* voyant#1687 Phase 3.2).
|
|
7
|
+
*
|
|
8
|
+
* Flow: the public route validates the body, stores a `write_intents`
|
|
9
|
+
* row, durably emits {@link BOOKING_BOOTSTRAP_INTENT_EVENT} (outbox),
|
|
10
|
+
* and answers 202 + a status URL. This handler — registered on the
|
|
11
|
+
* app's event bus by the deployment — executes the SAME bootstrap
|
|
12
|
+
* service the sync route uses and settles the intent. The outbox owns
|
|
13
|
+
* delivery: immediate attempt at emit time, retries with backoff on
|
|
14
|
+
* infra failure, dead-letter backstopped by the stale-intent sweep.
|
|
15
|
+
*
|
|
16
|
+
* Outcome semantics: business conclusions (capacity conflict, stale
|
|
17
|
+
* quote, departure gone) settle the intent as `failed` WITH the
|
|
18
|
+
* conflict detail and are never retried — retrying "sold out" doesn't
|
|
19
|
+
* un-sell it. Unexpected errors re-throw so the outbox redelivers
|
|
20
|
+
* (`settleWriteIntent` only transitions pending rows, so at-least-once
|
|
21
|
+
* redelivery after a success is a no-op).
|
|
22
|
+
*/
|
|
23
|
+
export declare const BOOKING_BOOTSTRAP_INTENT_KIND = "storefront.booking.bootstrap";
|
|
24
|
+
export declare const BOOKING_BOOTSTRAP_INTENT_EVENT = "storefront.booking.bootstrap.requested";
|
|
25
|
+
export interface BookingBootstrapIntentPayload {
|
|
26
|
+
input: unknown;
|
|
27
|
+
userId?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface BookingBootstrapIntentDeps {
|
|
30
|
+
/** Per-invocation db (the operator passes its capability resolver). */
|
|
31
|
+
resolveDb: () => PostgresJsDatabase;
|
|
32
|
+
/**
|
|
33
|
+
* The APP bus (e.g. `app.eventBus`) so booking events emitted by the
|
|
34
|
+
* reserve flow (booking.created, availability.slot.changed, …) reach
|
|
35
|
+
* the same subscribers as a sync bootstrap.
|
|
36
|
+
*/
|
|
37
|
+
eventBus?: EventBus;
|
|
38
|
+
env?: StorefrontRequestContext["env"];
|
|
39
|
+
serviceOptions?: StorefrontServiceOptions;
|
|
40
|
+
}
|
|
41
|
+
export declare function createBookingBootstrapIntentHandler(deps: BookingBootstrapIntentDeps): EventHandler;
|
|
42
|
+
//# sourceMappingURL=booking-intents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"booking-intents.d.ts","sourceRoot":"","sources":["../src/booking-intents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAEjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAEjE,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC9B,MAAM,cAAc,CAAA;AAGrB;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,6BAA6B,iCAAiC,CAAA;AAC3E,eAAO,MAAM,8BAA8B,2CAA2C,CAAA;AAEtF,MAAM,WAAW,6BAA6B;IAC5C,KAAK,EAAE,OAAO,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAaD,MAAM,WAAW,0BAA0B;IACzC,uEAAuE;IACvE,SAAS,EAAE,MAAM,kBAAkB,CAAA;IACnC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,GAAG,CAAC,EAAE,wBAAwB,CAAC,KAAK,CAAC,CAAA;IACrC,cAAc,CAAC,EAAE,wBAAwB,CAAA;CAC1C;AAED,wBAAgB,mCAAmC,CACjD,IAAI,EAAE,0BAA0B,GAC/B,YAAY,CAyDd"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { getWriteIntent, settleWriteIntent } from "@voyant-travel/db/write-intents";
|
|
2
|
+
import { createStorefrontService, } from "./service.js";
|
|
3
|
+
import { storefrontBookingSessionBootstrapInputSchema } from "./validation.js";
|
|
4
|
+
/**
|
|
5
|
+
* Async booking-session bootstrap over the queued write pipeline (RFC
|
|
6
|
+
* voyant#1687 Phase 3.2).
|
|
7
|
+
*
|
|
8
|
+
* Flow: the public route validates the body, stores a `write_intents`
|
|
9
|
+
* row, durably emits {@link BOOKING_BOOTSTRAP_INTENT_EVENT} (outbox),
|
|
10
|
+
* and answers 202 + a status URL. This handler — registered on the
|
|
11
|
+
* app's event bus by the deployment — executes the SAME bootstrap
|
|
12
|
+
* service the sync route uses and settles the intent. The outbox owns
|
|
13
|
+
* delivery: immediate attempt at emit time, retries with backoff on
|
|
14
|
+
* infra failure, dead-letter backstopped by the stale-intent sweep.
|
|
15
|
+
*
|
|
16
|
+
* Outcome semantics: business conclusions (capacity conflict, stale
|
|
17
|
+
* quote, departure gone) settle the intent as `failed` WITH the
|
|
18
|
+
* conflict detail and are never retried — retrying "sold out" doesn't
|
|
19
|
+
* un-sell it. Unexpected errors re-throw so the outbox redelivers
|
|
20
|
+
* (`settleWriteIntent` only transitions pending rows, so at-least-once
|
|
21
|
+
* redelivery after a success is a no-op).
|
|
22
|
+
*/
|
|
23
|
+
export const BOOKING_BOOTSTRAP_INTENT_KIND = "storefront.booking.bootstrap";
|
|
24
|
+
export const BOOKING_BOOTSTRAP_INTENT_EVENT = "storefront.booking.bootstrap.requested";
|
|
25
|
+
/** Final business outcomes → the HTTP status the sync route would return. */
|
|
26
|
+
const FINAL_CONFLICT_STATUS = {
|
|
27
|
+
departure_not_found: 404,
|
|
28
|
+
slot_not_found: 404,
|
|
29
|
+
invalid_slot: 400,
|
|
30
|
+
insufficient_capacity: 409,
|
|
31
|
+
slot_unavailable: 409,
|
|
32
|
+
pricing_unavailable: 409,
|
|
33
|
+
stale_quote: 409,
|
|
34
|
+
};
|
|
35
|
+
export function createBookingBootstrapIntentHandler(deps) {
|
|
36
|
+
const storefrontService = createStorefrontService(deps.serviceOptions);
|
|
37
|
+
return async (envelope) => {
|
|
38
|
+
const intentId = envelope.data?.intentId;
|
|
39
|
+
if (!intentId)
|
|
40
|
+
return;
|
|
41
|
+
const db = deps.resolveDb();
|
|
42
|
+
const intent = await getWriteIntent(db, intentId);
|
|
43
|
+
if (!intent || intent.kind !== BOOKING_BOOTSTRAP_INTENT_KIND || intent.status !== "pending") {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const payload = intent.payload;
|
|
47
|
+
const parsed = storefrontBookingSessionBootstrapInputSchema.safeParse(payload.input);
|
|
48
|
+
if (!parsed.success) {
|
|
49
|
+
// Should be unreachable (the route validated before enqueueing) —
|
|
50
|
+
// settle rather than retry a permanently-invalid payload.
|
|
51
|
+
await settleWriteIntent(db, intentId, {
|
|
52
|
+
status: "failed",
|
|
53
|
+
error: `invalid intent payload: ${parsed.error.message.slice(0, 500)}`,
|
|
54
|
+
});
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
// Unexpected throws propagate → the outbox retries the delivery.
|
|
58
|
+
const result = await storefrontService.bootstrapBookingSession({
|
|
59
|
+
db,
|
|
60
|
+
eventBus: deps.eventBus,
|
|
61
|
+
env: deps.env,
|
|
62
|
+
}, parsed.data, payload.userId);
|
|
63
|
+
if (result.status === "ok" && "bootstrap" in result) {
|
|
64
|
+
await settleWriteIntent(db, intentId, {
|
|
65
|
+
status: "succeeded",
|
|
66
|
+
result: { bootstrap: result.bootstrap },
|
|
67
|
+
});
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const httpStatus = FINAL_CONFLICT_STATUS[result.status] ?? 409;
|
|
71
|
+
await settleWriteIntent(db, intentId, {
|
|
72
|
+
status: "failed",
|
|
73
|
+
error: result.status,
|
|
74
|
+
result: {
|
|
75
|
+
conflict: result.status,
|
|
76
|
+
httpStatus,
|
|
77
|
+
...(result.status === "stale_quote" && "repricing" in result
|
|
78
|
+
? { repricing: result.repricing }
|
|
79
|
+
: {}),
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Module } from "@voyant-travel/core";
|
|
2
|
+
import type { HonoModule } from "@voyant-travel/hono/module";
|
|
3
|
+
import { type PublicCustomerPortalRouteOptions } from "./routes-public.js";
|
|
4
|
+
export type { CustomerPortalRoutes } from "./routes.js";
|
|
5
|
+
export { customerPortalRoutes } from "./routes.js";
|
|
6
|
+
export type { PublicCustomerPortalRoutes } from "./routes-public.js";
|
|
7
|
+
export { createPublicCustomerPortalRoutes, publicCustomerPortalRoutes } from "./routes-public.js";
|
|
8
|
+
export { publicCustomerPortalService } from "./service-public.js";
|
|
9
|
+
export type { BootstrapCustomerPortalInput, BootstrapCustomerPortalResult, CreateCustomerPortalCompanionInput, CreateCustomerPortalProfileDocumentInput, CustomerPortalAddress, CustomerPortalBookingBillingContact, CustomerPortalBookingDetail, CustomerPortalBookingDocument, CustomerPortalBookingFinancialDocument, CustomerPortalBookingFinancials, CustomerPortalBookingPayment, CustomerPortalBookingSummary, CustomerPortalBootstrapCandidate, CustomerPortalCompanion, CustomerPortalContactExistsQuery, CustomerPortalContactExistsResult, CustomerPortalPhoneContactExistsQuery, CustomerPortalPhoneContactExistsResult, CustomerPortalProfile, CustomerPortalProfileDocument, ImportCustomerPortalBookingParticipantsInput, ImportCustomerPortalBookingParticipantsResult, ImportCustomerPortalBookingTravelersInput, ImportCustomerPortalBookingTravelersResult, UpdateCustomerPortalAddressInput, UpdateCustomerPortalCompanionInput, UpdateCustomerPortalProfileDocumentInput, UpdateCustomerPortalProfileInput, } from "./validation-public.js";
|
|
10
|
+
export { bootstrapCustomerPortalResultSchema, bootstrapCustomerPortalSchema, createCustomerPortalCompanionSchema, createCustomerPortalProfileDocumentSchema, customerPortalAddressSchema, customerPortalBookingBillingContactSchema, customerPortalBookingDetailSchema, customerPortalBookingDocumentSchema, customerPortalBookingFinancialDocumentSchema, customerPortalBookingFinancialsSchema, customerPortalBookingPaymentSchema, customerPortalBookingSummarySchema, customerPortalBootstrapCandidateSchema, customerPortalCompanionSchema, customerPortalContactExistsQuerySchema, customerPortalContactExistsResultSchema, customerPortalPhoneContactExistsQuerySchema, customerPortalPhoneContactExistsResultSchema, customerPortalProfileDocumentSchema, customerPortalProfileSchema, importCustomerPortalBookingParticipantsResultSchema, importCustomerPortalBookingParticipantsSchema, importCustomerPortalBookingTravelersResultSchema, importCustomerPortalBookingTravelersSchema, updateCustomerPortalAddressSchema, updateCustomerPortalCompanionSchema, updateCustomerPortalProfileDocumentSchema, updateCustomerPortalProfileSchema, } from "./validation-public.js";
|
|
11
|
+
export declare const customerPortalModule: Module;
|
|
12
|
+
export declare function createCustomerPortalHonoModule(options?: PublicCustomerPortalRouteOptions): HonoModule;
|
|
13
|
+
export declare const customerPortalHonoModule: HonoModule;
|
|
14
|
+
export type { CustomerPortalRouteRuntime, PublicCustomerPortalRouteRuntime, PublicCustomerPortalRuntimeOptions, } from "./route-runtime.js";
|
|
15
|
+
export { buildCustomerPortalRouteRuntime, buildPublicCustomerPortalRouteRuntime, CUSTOMER_PORTAL_ROUTE_RUNTIME_CONTAINER_KEY, } from "./route-runtime.js";
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/customer-portal/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAM5D,OAAO,EAEL,KAAK,gCAAgC,EACtC,MAAM,oBAAoB,CAAA;AAE3B,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,gCAAgC,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAA;AACjG,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAA;AACjE,YAAY,EACV,4BAA4B,EAC5B,6BAA6B,EAC7B,kCAAkC,EAClC,wCAAwC,EACxC,qBAAqB,EACrB,mCAAmC,EACnC,2BAA2B,EAC3B,6BAA6B,EAC7B,sCAAsC,EACtC,+BAA+B,EAC/B,4BAA4B,EAC5B,4BAA4B,EAC5B,gCAAgC,EAChC,uBAAuB,EACvB,gCAAgC,EAChC,iCAAiC,EACjC,qCAAqC,EACrC,sCAAsC,EACtC,qBAAqB,EACrB,6BAA6B,EAC7B,4CAA4C,EAC5C,6CAA6C,EAC7C,yCAAyC,EACzC,0CAA0C,EAC1C,gCAAgC,EAChC,kCAAkC,EAClC,wCAAwC,EACxC,gCAAgC,GACjC,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACL,mCAAmC,EACnC,6BAA6B,EAC7B,mCAAmC,EACnC,yCAAyC,EACzC,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,mCAAmC,EACnC,2BAA2B,EAC3B,mDAAmD,EACnD,6CAA6C,EAC7C,gDAAgD,EAChD,0CAA0C,EAC1C,iCAAiC,EACjC,mCAAmC,EACnC,yCAAyC,EACzC,iCAAiC,GAClC,MAAM,wBAAwB,CAAA;AAE/B,eAAO,MAAM,oBAAoB,EAAE,MAElC,CAAA;AAED,wBAAgB,8BAA8B,CAC5C,OAAO,GAAE,gCAAqC,GAC7C,UAAU,CAeZ;AAED,eAAO,MAAM,wBAAwB,EAAE,UAA6C,CAAA;AAEpF,YAAY,EACV,0BAA0B,EAC1B,gCAAgC,EAChC,kCAAkC,GACnC,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,+BAA+B,EAC/B,qCAAqC,EACrC,2CAA2C,GAC5C,MAAM,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { buildPublicCustomerPortalRouteRuntime, CUSTOMER_PORTAL_ROUTE_RUNTIME_CONTAINER_KEY, } from "./route-runtime.js";
|
|
2
|
+
import { createPublicCustomerPortalRoutes, } from "./routes-public.js";
|
|
3
|
+
export { customerPortalRoutes } from "./routes.js";
|
|
4
|
+
export { createPublicCustomerPortalRoutes, publicCustomerPortalRoutes } from "./routes-public.js";
|
|
5
|
+
export { publicCustomerPortalService } from "./service-public.js";
|
|
6
|
+
export { bootstrapCustomerPortalResultSchema, bootstrapCustomerPortalSchema, createCustomerPortalCompanionSchema, createCustomerPortalProfileDocumentSchema, customerPortalAddressSchema, customerPortalBookingBillingContactSchema, customerPortalBookingDetailSchema, customerPortalBookingDocumentSchema, customerPortalBookingFinancialDocumentSchema, customerPortalBookingFinancialsSchema, customerPortalBookingPaymentSchema, customerPortalBookingSummarySchema, customerPortalBootstrapCandidateSchema, customerPortalCompanionSchema, customerPortalContactExistsQuerySchema, customerPortalContactExistsResultSchema, customerPortalPhoneContactExistsQuerySchema, customerPortalPhoneContactExistsResultSchema, customerPortalProfileDocumentSchema, customerPortalProfileSchema, importCustomerPortalBookingParticipantsResultSchema, importCustomerPortalBookingParticipantsSchema, importCustomerPortalBookingTravelersResultSchema, importCustomerPortalBookingTravelersSchema, updateCustomerPortalAddressSchema, updateCustomerPortalCompanionSchema, updateCustomerPortalProfileDocumentSchema, updateCustomerPortalProfileSchema, } from "./validation-public.js";
|
|
7
|
+
export const customerPortalModule = {
|
|
8
|
+
name: "customer-portal",
|
|
9
|
+
};
|
|
10
|
+
export function createCustomerPortalHonoModule(options = {}) {
|
|
11
|
+
const module = {
|
|
12
|
+
...customerPortalModule,
|
|
13
|
+
bootstrap: ({ bindings, container }) => {
|
|
14
|
+
container.register(CUSTOMER_PORTAL_ROUTE_RUNTIME_CONTAINER_KEY, buildPublicCustomerPortalRouteRuntime(bindings, options));
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
return {
|
|
18
|
+
module,
|
|
19
|
+
publicRoutes: createPublicCustomerPortalRoutes(options),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export const customerPortalHonoModule = createCustomerPortalHonoModule();
|
|
23
|
+
export { buildCustomerPortalRouteRuntime, buildPublicCustomerPortalRouteRuntime, CUSTOMER_PORTAL_ROUTE_RUNTIME_CONTAINER_KEY, } from "./route-runtime.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type KmsProvider } from "@voyant-travel/utils";
|
|
2
|
+
export interface CustomerPortalRouteRuntime {
|
|
3
|
+
getOptionalKmsProvider(): KmsProvider | null;
|
|
4
|
+
}
|
|
5
|
+
export interface PublicCustomerPortalRouteRuntime extends CustomerPortalRouteRuntime {
|
|
6
|
+
resolveDocumentDownloadUrl?: (storageKey: string) => Promise<string | null> | string | null;
|
|
7
|
+
}
|
|
8
|
+
export declare const CUSTOMER_PORTAL_ROUTE_RUNTIME_CONTAINER_KEY = "providers.customerPortal.public.runtime";
|
|
9
|
+
export interface PublicCustomerPortalRuntimeOptions {
|
|
10
|
+
resolveDocumentDownloadUrl?: (bindings: unknown, storageKey: string) => Promise<string | null> | string | null;
|
|
11
|
+
}
|
|
12
|
+
type RuntimeBindings = Record<string, unknown>;
|
|
13
|
+
export declare function buildPublicCustomerPortalRouteRuntime(bindings: RuntimeBindings, options?: PublicCustomerPortalRuntimeOptions): PublicCustomerPortalRouteRuntime;
|
|
14
|
+
export declare const buildCustomerPortalRouteRuntime: typeof buildPublicCustomerPortalRouteRuntime;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=route-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-runtime.d.ts","sourceRoot":"","sources":["../../src/customer-portal/route-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAEjF,MAAM,WAAW,0BAA0B;IACzC,sBAAsB,IAAI,WAAW,GAAG,IAAI,CAAA;CAC7C;AAED,MAAM,WAAW,gCAAiC,SAAQ,0BAA0B;IAClF,0BAA0B,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI,CAAA;CAC5F;AAED,eAAO,MAAM,2CAA2C,4CAA4C,CAAA;AAEpG,MAAM,WAAW,kCAAkC;IACjD,0BAA0B,CAAC,EAAE,CAC3B,QAAQ,EAAE,OAAO,EACjB,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI,CAAA;CAC5C;AAED,KAAK,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAgB9C,wBAAgB,qCAAqC,CACnD,QAAQ,EAAE,eAAe,EACzB,OAAO,GAAE,kCAAuC,GAC/C,gCAAgC,CAiBlC;AAED,eAAO,MAAM,+BAA+B,8CAAwC,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createKmsProviderFromEnv } from "@voyant-travel/utils";
|
|
2
|
+
export const CUSTOMER_PORTAL_ROUTE_RUNTIME_CONTAINER_KEY = "providers.customerPortal.public.runtime";
|
|
3
|
+
function buildRuntimeEnv(bindings) {
|
|
4
|
+
const processEnv = globalThis.process?.env ?? {};
|
|
5
|
+
return {
|
|
6
|
+
...processEnv,
|
|
7
|
+
...(bindings ?? {}),
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export function buildPublicCustomerPortalRouteRuntime(bindings, options = {}) {
|
|
11
|
+
const runtimeEnv = buildRuntimeEnv(bindings);
|
|
12
|
+
const resolveDocumentDownloadUrl = options.resolveDocumentDownloadUrl
|
|
13
|
+
? (storageKey) => options.resolveDocumentDownloadUrl?.(bindings, storageKey) ?? null
|
|
14
|
+
: undefined;
|
|
15
|
+
return {
|
|
16
|
+
getOptionalKmsProvider() {
|
|
17
|
+
try {
|
|
18
|
+
return createKmsProviderFromEnv(runtimeEnv);
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
resolveDocumentDownloadUrl,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export const buildCustomerPortalRouteRuntime = buildPublicCustomerPortalRouteRuntime;
|