@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
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
type ProductExtraSelectionType = "optional" | "required" | "default_selected" | "unavailable";
|
|
2
|
+
type ProductExtraPricingMode = "included" | "per_person" | "per_booking" | "quantity_based" | "on_request" | "free";
|
|
3
|
+
export declare const productExtrasRef: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
4
|
+
name: "product_extras";
|
|
5
|
+
schema: undefined;
|
|
6
|
+
columns: {
|
|
7
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
8
|
+
name: "id";
|
|
9
|
+
tableName: "product_extras";
|
|
10
|
+
dataType: "string";
|
|
11
|
+
columnType: "PgText";
|
|
12
|
+
data: string;
|
|
13
|
+
driverParam: string;
|
|
14
|
+
notNull: true;
|
|
15
|
+
hasDefault: false;
|
|
16
|
+
isPrimaryKey: true;
|
|
17
|
+
isAutoincrement: false;
|
|
18
|
+
hasRuntimeDefault: false;
|
|
19
|
+
enumValues: [string, ...string[]];
|
|
20
|
+
baseColumn: never;
|
|
21
|
+
identity: undefined;
|
|
22
|
+
generated: undefined;
|
|
23
|
+
}, {}, {}>;
|
|
24
|
+
productId: import("drizzle-orm/pg-core").PgColumn<{
|
|
25
|
+
name: "product_id";
|
|
26
|
+
tableName: "product_extras";
|
|
27
|
+
dataType: "string";
|
|
28
|
+
columnType: "PgText";
|
|
29
|
+
data: string;
|
|
30
|
+
driverParam: string;
|
|
31
|
+
notNull: true;
|
|
32
|
+
hasDefault: false;
|
|
33
|
+
isPrimaryKey: false;
|
|
34
|
+
isAutoincrement: false;
|
|
35
|
+
hasRuntimeDefault: false;
|
|
36
|
+
enumValues: [string, ...string[]];
|
|
37
|
+
baseColumn: never;
|
|
38
|
+
identity: undefined;
|
|
39
|
+
generated: undefined;
|
|
40
|
+
}, {}, {}>;
|
|
41
|
+
name: import("drizzle-orm/pg-core").PgColumn<{
|
|
42
|
+
name: "name";
|
|
43
|
+
tableName: "product_extras";
|
|
44
|
+
dataType: "string";
|
|
45
|
+
columnType: "PgText";
|
|
46
|
+
data: string;
|
|
47
|
+
driverParam: string;
|
|
48
|
+
notNull: true;
|
|
49
|
+
hasDefault: false;
|
|
50
|
+
isPrimaryKey: false;
|
|
51
|
+
isAutoincrement: false;
|
|
52
|
+
hasRuntimeDefault: false;
|
|
53
|
+
enumValues: [string, ...string[]];
|
|
54
|
+
baseColumn: never;
|
|
55
|
+
identity: undefined;
|
|
56
|
+
generated: undefined;
|
|
57
|
+
}, {}, {}>;
|
|
58
|
+
description: import("drizzle-orm/pg-core").PgColumn<{
|
|
59
|
+
name: "description";
|
|
60
|
+
tableName: "product_extras";
|
|
61
|
+
dataType: "string";
|
|
62
|
+
columnType: "PgText";
|
|
63
|
+
data: string;
|
|
64
|
+
driverParam: string;
|
|
65
|
+
notNull: false;
|
|
66
|
+
hasDefault: false;
|
|
67
|
+
isPrimaryKey: false;
|
|
68
|
+
isAutoincrement: false;
|
|
69
|
+
hasRuntimeDefault: false;
|
|
70
|
+
enumValues: [string, ...string[]];
|
|
71
|
+
baseColumn: never;
|
|
72
|
+
identity: undefined;
|
|
73
|
+
generated: undefined;
|
|
74
|
+
}, {}, {}>;
|
|
75
|
+
selectionType: import("drizzle-orm/pg-core").PgColumn<{
|
|
76
|
+
name: "selection_type";
|
|
77
|
+
tableName: "product_extras";
|
|
78
|
+
dataType: "string";
|
|
79
|
+
columnType: "PgText";
|
|
80
|
+
data: ProductExtraSelectionType;
|
|
81
|
+
driverParam: string;
|
|
82
|
+
notNull: true;
|
|
83
|
+
hasDefault: true;
|
|
84
|
+
isPrimaryKey: false;
|
|
85
|
+
isAutoincrement: false;
|
|
86
|
+
hasRuntimeDefault: false;
|
|
87
|
+
enumValues: [string, ...string[]];
|
|
88
|
+
baseColumn: never;
|
|
89
|
+
identity: undefined;
|
|
90
|
+
generated: undefined;
|
|
91
|
+
}, {}, {
|
|
92
|
+
$type: ProductExtraSelectionType;
|
|
93
|
+
}>;
|
|
94
|
+
pricingMode: import("drizzle-orm/pg-core").PgColumn<{
|
|
95
|
+
name: "pricing_mode";
|
|
96
|
+
tableName: "product_extras";
|
|
97
|
+
dataType: "string";
|
|
98
|
+
columnType: "PgText";
|
|
99
|
+
data: ProductExtraPricingMode;
|
|
100
|
+
driverParam: string;
|
|
101
|
+
notNull: true;
|
|
102
|
+
hasDefault: true;
|
|
103
|
+
isPrimaryKey: false;
|
|
104
|
+
isAutoincrement: false;
|
|
105
|
+
hasRuntimeDefault: false;
|
|
106
|
+
enumValues: [string, ...string[]];
|
|
107
|
+
baseColumn: never;
|
|
108
|
+
identity: undefined;
|
|
109
|
+
generated: undefined;
|
|
110
|
+
}, {}, {
|
|
111
|
+
$type: ProductExtraPricingMode;
|
|
112
|
+
}>;
|
|
113
|
+
pricedPerPerson: import("drizzle-orm/pg-core").PgColumn<{
|
|
114
|
+
name: "priced_per_person";
|
|
115
|
+
tableName: "product_extras";
|
|
116
|
+
dataType: "boolean";
|
|
117
|
+
columnType: "PgBoolean";
|
|
118
|
+
data: boolean;
|
|
119
|
+
driverParam: boolean;
|
|
120
|
+
notNull: true;
|
|
121
|
+
hasDefault: true;
|
|
122
|
+
isPrimaryKey: false;
|
|
123
|
+
isAutoincrement: false;
|
|
124
|
+
hasRuntimeDefault: false;
|
|
125
|
+
enumValues: undefined;
|
|
126
|
+
baseColumn: never;
|
|
127
|
+
identity: undefined;
|
|
128
|
+
generated: undefined;
|
|
129
|
+
}, {}, {}>;
|
|
130
|
+
defaultQuantity: import("drizzle-orm/pg-core").PgColumn<{
|
|
131
|
+
name: "default_quantity";
|
|
132
|
+
tableName: "product_extras";
|
|
133
|
+
dataType: "number";
|
|
134
|
+
columnType: "PgInteger";
|
|
135
|
+
data: number;
|
|
136
|
+
driverParam: string | number;
|
|
137
|
+
notNull: false;
|
|
138
|
+
hasDefault: false;
|
|
139
|
+
isPrimaryKey: false;
|
|
140
|
+
isAutoincrement: false;
|
|
141
|
+
hasRuntimeDefault: false;
|
|
142
|
+
enumValues: undefined;
|
|
143
|
+
baseColumn: never;
|
|
144
|
+
identity: undefined;
|
|
145
|
+
generated: undefined;
|
|
146
|
+
}, {}, {}>;
|
|
147
|
+
minQuantity: import("drizzle-orm/pg-core").PgColumn<{
|
|
148
|
+
name: "min_quantity";
|
|
149
|
+
tableName: "product_extras";
|
|
150
|
+
dataType: "number";
|
|
151
|
+
columnType: "PgInteger";
|
|
152
|
+
data: number;
|
|
153
|
+
driverParam: string | number;
|
|
154
|
+
notNull: false;
|
|
155
|
+
hasDefault: false;
|
|
156
|
+
isPrimaryKey: false;
|
|
157
|
+
isAutoincrement: false;
|
|
158
|
+
hasRuntimeDefault: false;
|
|
159
|
+
enumValues: undefined;
|
|
160
|
+
baseColumn: never;
|
|
161
|
+
identity: undefined;
|
|
162
|
+
generated: undefined;
|
|
163
|
+
}, {}, {}>;
|
|
164
|
+
maxQuantity: import("drizzle-orm/pg-core").PgColumn<{
|
|
165
|
+
name: "max_quantity";
|
|
166
|
+
tableName: "product_extras";
|
|
167
|
+
dataType: "number";
|
|
168
|
+
columnType: "PgInteger";
|
|
169
|
+
data: number;
|
|
170
|
+
driverParam: string | number;
|
|
171
|
+
notNull: false;
|
|
172
|
+
hasDefault: false;
|
|
173
|
+
isPrimaryKey: false;
|
|
174
|
+
isAutoincrement: false;
|
|
175
|
+
hasRuntimeDefault: false;
|
|
176
|
+
enumValues: undefined;
|
|
177
|
+
baseColumn: never;
|
|
178
|
+
identity: undefined;
|
|
179
|
+
generated: undefined;
|
|
180
|
+
}, {}, {}>;
|
|
181
|
+
active: import("drizzle-orm/pg-core").PgColumn<{
|
|
182
|
+
name: "active";
|
|
183
|
+
tableName: "product_extras";
|
|
184
|
+
dataType: "boolean";
|
|
185
|
+
columnType: "PgBoolean";
|
|
186
|
+
data: boolean;
|
|
187
|
+
driverParam: boolean;
|
|
188
|
+
notNull: true;
|
|
189
|
+
hasDefault: true;
|
|
190
|
+
isPrimaryKey: false;
|
|
191
|
+
isAutoincrement: false;
|
|
192
|
+
hasRuntimeDefault: false;
|
|
193
|
+
enumValues: undefined;
|
|
194
|
+
baseColumn: never;
|
|
195
|
+
identity: undefined;
|
|
196
|
+
generated: undefined;
|
|
197
|
+
}, {}, {}>;
|
|
198
|
+
sortOrder: import("drizzle-orm/pg-core").PgColumn<{
|
|
199
|
+
name: "sort_order";
|
|
200
|
+
tableName: "product_extras";
|
|
201
|
+
dataType: "number";
|
|
202
|
+
columnType: "PgInteger";
|
|
203
|
+
data: number;
|
|
204
|
+
driverParam: string | number;
|
|
205
|
+
notNull: true;
|
|
206
|
+
hasDefault: true;
|
|
207
|
+
isPrimaryKey: false;
|
|
208
|
+
isAutoincrement: false;
|
|
209
|
+
hasRuntimeDefault: false;
|
|
210
|
+
enumValues: undefined;
|
|
211
|
+
baseColumn: never;
|
|
212
|
+
identity: undefined;
|
|
213
|
+
generated: undefined;
|
|
214
|
+
}, {}, {}>;
|
|
215
|
+
metadata: import("drizzle-orm/pg-core").PgColumn<{
|
|
216
|
+
name: "metadata";
|
|
217
|
+
tableName: "product_extras";
|
|
218
|
+
dataType: "json";
|
|
219
|
+
columnType: "PgJsonb";
|
|
220
|
+
data: Record<string, unknown>;
|
|
221
|
+
driverParam: unknown;
|
|
222
|
+
notNull: false;
|
|
223
|
+
hasDefault: false;
|
|
224
|
+
isPrimaryKey: false;
|
|
225
|
+
isAutoincrement: false;
|
|
226
|
+
hasRuntimeDefault: false;
|
|
227
|
+
enumValues: undefined;
|
|
228
|
+
baseColumn: never;
|
|
229
|
+
identity: undefined;
|
|
230
|
+
generated: undefined;
|
|
231
|
+
}, {}, {
|
|
232
|
+
$type: Record<string, unknown>;
|
|
233
|
+
}>;
|
|
234
|
+
};
|
|
235
|
+
dialect: "pg";
|
|
236
|
+
}>;
|
|
237
|
+
export {};
|
|
238
|
+
//# sourceMappingURL=product-extra-ref.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-extra-ref.d.ts","sourceRoot":"","sources":["../src/product-extra-ref.ts"],"names":[],"mappings":"AAEA,KAAK,yBAAyB,GAAG,UAAU,GAAG,UAAU,GAAG,kBAAkB,GAAG,aAAa,CAAA;AAE7F,KAAK,uBAAuB,GACxB,UAAU,GACV,YAAY,GACZ,aAAa,GACb,gBAAgB,GAChB,YAAY,GACZ,MAAM,CAAA;AAEV,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoB3B,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { boolean, integer, jsonb, pgTable, text } from "drizzle-orm/pg-core";
|
|
2
|
+
export const productExtrasRef = pgTable("product_extras", {
|
|
3
|
+
id: text("id").primaryKey(),
|
|
4
|
+
productId: text("product_id").notNull(),
|
|
5
|
+
name: text("name").notNull(),
|
|
6
|
+
description: text("description"),
|
|
7
|
+
selectionType: text("selection_type")
|
|
8
|
+
.$type()
|
|
9
|
+
.notNull()
|
|
10
|
+
.default("optional"),
|
|
11
|
+
pricingMode: text("pricing_mode")
|
|
12
|
+
.$type()
|
|
13
|
+
.notNull()
|
|
14
|
+
.default("per_booking"),
|
|
15
|
+
pricedPerPerson: boolean("priced_per_person").notNull().default(false),
|
|
16
|
+
defaultQuantity: integer("default_quantity"),
|
|
17
|
+
minQuantity: integer("min_quantity"),
|
|
18
|
+
maxQuantity: integer("max_quantity"),
|
|
19
|
+
active: boolean("active").notNull().default(true),
|
|
20
|
+
sortOrder: integer("sort_order").notNull().default(0),
|
|
21
|
+
metadata: jsonb("metadata").$type(),
|
|
22
|
+
});
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { type StorefrontServiceOptions } from "./service.js";
|
|
2
|
+
type Env = {
|
|
3
|
+
Variables: {
|
|
4
|
+
db: unknown;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export declare function createStorefrontAdminRoutes(options?: StorefrontServiceOptions): import("hono/hono-base").HonoBase<Env, {
|
|
8
|
+
"/settings": {
|
|
9
|
+
$get: {
|
|
10
|
+
input: {};
|
|
11
|
+
output: {
|
|
12
|
+
data: {
|
|
13
|
+
branding: {
|
|
14
|
+
logoUrl: string | null;
|
|
15
|
+
faviconUrl: string | null;
|
|
16
|
+
brandMarkUrl: string | null;
|
|
17
|
+
primaryColor: string | null;
|
|
18
|
+
accentColor: string | null;
|
|
19
|
+
supportedLanguages: string[];
|
|
20
|
+
};
|
|
21
|
+
support: {
|
|
22
|
+
email: string | null;
|
|
23
|
+
phone: string | null;
|
|
24
|
+
links: {
|
|
25
|
+
label: string;
|
|
26
|
+
url: string;
|
|
27
|
+
}[];
|
|
28
|
+
};
|
|
29
|
+
legal: {
|
|
30
|
+
termsUrl: string | null;
|
|
31
|
+
privacyUrl: string | null;
|
|
32
|
+
cancellationUrl: string | null;
|
|
33
|
+
defaultContractTemplateId: string | null;
|
|
34
|
+
};
|
|
35
|
+
localization: {
|
|
36
|
+
defaultLocale: string | null;
|
|
37
|
+
currencyDisplay: "symbol" | "name" | "code";
|
|
38
|
+
};
|
|
39
|
+
forms: {
|
|
40
|
+
billing: {
|
|
41
|
+
fields: {
|
|
42
|
+
key: string;
|
|
43
|
+
label: string;
|
|
44
|
+
type: "date" | "select" | "text" | "email" | "textarea" | "country" | "tel" | "checkbox";
|
|
45
|
+
required: boolean;
|
|
46
|
+
placeholder: string | null;
|
|
47
|
+
description: string | null;
|
|
48
|
+
autocomplete: string | null;
|
|
49
|
+
options: {
|
|
50
|
+
value: string;
|
|
51
|
+
label: string;
|
|
52
|
+
}[];
|
|
53
|
+
}[];
|
|
54
|
+
};
|
|
55
|
+
travelers: {
|
|
56
|
+
fields: {
|
|
57
|
+
key: string;
|
|
58
|
+
label: string;
|
|
59
|
+
type: "date" | "select" | "text" | "email" | "textarea" | "country" | "tel" | "checkbox";
|
|
60
|
+
required: boolean;
|
|
61
|
+
placeholder: string | null;
|
|
62
|
+
description: string | null;
|
|
63
|
+
autocomplete: string | null;
|
|
64
|
+
options: {
|
|
65
|
+
value: string;
|
|
66
|
+
label: string;
|
|
67
|
+
}[];
|
|
68
|
+
}[];
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
payment: {
|
|
72
|
+
defaultMethod: "voucher" | "bank_transfer" | "cash" | "invoice" | "card" | null;
|
|
73
|
+
methods: {
|
|
74
|
+
code: "voucher" | "bank_transfer" | "cash" | "invoice" | "card";
|
|
75
|
+
label: string;
|
|
76
|
+
description: string | null;
|
|
77
|
+
enabled: boolean;
|
|
78
|
+
}[];
|
|
79
|
+
structure: "split" | "full";
|
|
80
|
+
schedule: {
|
|
81
|
+
percent: number;
|
|
82
|
+
dueInDays: number;
|
|
83
|
+
dueCondition: "after_booking" | "before_departure";
|
|
84
|
+
}[];
|
|
85
|
+
defaultSchedule: {
|
|
86
|
+
depositPercent: number | null;
|
|
87
|
+
balanceDueDaysBeforeDeparture: number | null;
|
|
88
|
+
} | null;
|
|
89
|
+
bankTransfer: {
|
|
90
|
+
dueDays: number | null;
|
|
91
|
+
account: {
|
|
92
|
+
provider: string | null;
|
|
93
|
+
currency: string | null;
|
|
94
|
+
iban: string;
|
|
95
|
+
beneficiary: string;
|
|
96
|
+
bank: string;
|
|
97
|
+
} | null;
|
|
98
|
+
accountHolder: string | null;
|
|
99
|
+
bankName: string | null;
|
|
100
|
+
iban: string | null;
|
|
101
|
+
bic: string | null;
|
|
102
|
+
paymentReference: string | null;
|
|
103
|
+
instructions: string | null;
|
|
104
|
+
} | null;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
outputFormat: "json";
|
|
109
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
} & {
|
|
113
|
+
"/settings": {
|
|
114
|
+
$patch: {
|
|
115
|
+
input: {};
|
|
116
|
+
output: {
|
|
117
|
+
data: {
|
|
118
|
+
branding: {
|
|
119
|
+
logoUrl: string | null;
|
|
120
|
+
faviconUrl: string | null;
|
|
121
|
+
brandMarkUrl: string | null;
|
|
122
|
+
primaryColor: string | null;
|
|
123
|
+
accentColor: string | null;
|
|
124
|
+
supportedLanguages: string[];
|
|
125
|
+
};
|
|
126
|
+
support: {
|
|
127
|
+
email: string | null;
|
|
128
|
+
phone: string | null;
|
|
129
|
+
links: {
|
|
130
|
+
label: string;
|
|
131
|
+
url: string;
|
|
132
|
+
}[];
|
|
133
|
+
};
|
|
134
|
+
legal: {
|
|
135
|
+
termsUrl: string | null;
|
|
136
|
+
privacyUrl: string | null;
|
|
137
|
+
cancellationUrl: string | null;
|
|
138
|
+
defaultContractTemplateId: string | null;
|
|
139
|
+
};
|
|
140
|
+
localization: {
|
|
141
|
+
defaultLocale: string | null;
|
|
142
|
+
currencyDisplay: "symbol" | "name" | "code";
|
|
143
|
+
};
|
|
144
|
+
forms: {
|
|
145
|
+
billing: {
|
|
146
|
+
fields: {
|
|
147
|
+
key: string;
|
|
148
|
+
label: string;
|
|
149
|
+
type: "date" | "select" | "text" | "email" | "textarea" | "country" | "tel" | "checkbox";
|
|
150
|
+
required: boolean;
|
|
151
|
+
placeholder: string | null;
|
|
152
|
+
description: string | null;
|
|
153
|
+
autocomplete: string | null;
|
|
154
|
+
options: {
|
|
155
|
+
value: string;
|
|
156
|
+
label: string;
|
|
157
|
+
}[];
|
|
158
|
+
}[];
|
|
159
|
+
};
|
|
160
|
+
travelers: {
|
|
161
|
+
fields: {
|
|
162
|
+
key: string;
|
|
163
|
+
label: string;
|
|
164
|
+
type: "date" | "select" | "text" | "email" | "textarea" | "country" | "tel" | "checkbox";
|
|
165
|
+
required: boolean;
|
|
166
|
+
placeholder: string | null;
|
|
167
|
+
description: string | null;
|
|
168
|
+
autocomplete: string | null;
|
|
169
|
+
options: {
|
|
170
|
+
value: string;
|
|
171
|
+
label: string;
|
|
172
|
+
}[];
|
|
173
|
+
}[];
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
payment: {
|
|
177
|
+
defaultMethod: "voucher" | "bank_transfer" | "cash" | "invoice" | "card" | null;
|
|
178
|
+
methods: {
|
|
179
|
+
code: "voucher" | "bank_transfer" | "cash" | "invoice" | "card";
|
|
180
|
+
label: string;
|
|
181
|
+
description: string | null;
|
|
182
|
+
enabled: boolean;
|
|
183
|
+
}[];
|
|
184
|
+
structure: "split" | "full";
|
|
185
|
+
schedule: {
|
|
186
|
+
percent: number;
|
|
187
|
+
dueInDays: number;
|
|
188
|
+
dueCondition: "after_booking" | "before_departure";
|
|
189
|
+
}[];
|
|
190
|
+
defaultSchedule: {
|
|
191
|
+
depositPercent: number | null;
|
|
192
|
+
balanceDueDaysBeforeDeparture: number | null;
|
|
193
|
+
} | null;
|
|
194
|
+
bankTransfer: {
|
|
195
|
+
dueDays: number | null;
|
|
196
|
+
account: {
|
|
197
|
+
provider: string | null;
|
|
198
|
+
currency: string | null;
|
|
199
|
+
iban: string;
|
|
200
|
+
beneficiary: string;
|
|
201
|
+
bank: string;
|
|
202
|
+
} | null;
|
|
203
|
+
accountHolder: string | null;
|
|
204
|
+
bankName: string | null;
|
|
205
|
+
iban: string | null;
|
|
206
|
+
bic: string | null;
|
|
207
|
+
paymentReference: string | null;
|
|
208
|
+
instructions: string | null;
|
|
209
|
+
} | null;
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
outputFormat: "json";
|
|
214
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
}, "/", "/settings">;
|
|
218
|
+
export type StorefrontAdminRoutes = ReturnType<typeof createStorefrontAdminRoutes>;
|
|
219
|
+
export {};
|
|
220
|
+
//# sourceMappingURL=routes-admin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes-admin.d.ts","sourceRoot":"","sources":["../src/routes-admin.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,wBAAwB,EAC9B,MAAM,cAAc,CAAA;AAGrB,KAAK,GAAG,GAAG;IACT,SAAS,EAAE;QACT,EAAE,EAAE,OAAO,CAAA;KACZ,CAAA;CACF,CAAA;AAUD,wBAAgB,2BAA2B,CAAC,OAAO,CAAC,EAAE,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAsB7E;AAED,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ApiHttpError, parseJsonBody } from "@voyant-travel/hono";
|
|
2
|
+
import { Hono } from "hono";
|
|
3
|
+
import { createStorefrontService, } from "./service.js";
|
|
4
|
+
import { storefrontSettingsPatchSchema } from "./validation.js";
|
|
5
|
+
function getRequestContext(c) {
|
|
6
|
+
return {
|
|
7
|
+
db: c.get("db"),
|
|
8
|
+
env: c.env,
|
|
9
|
+
context: c,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export function createStorefrontAdminRoutes(options) {
|
|
13
|
+
const storefrontService = createStorefrontService(options);
|
|
14
|
+
return new Hono()
|
|
15
|
+
.get("/settings", async (c) => {
|
|
16
|
+
return c.json({ data: await storefrontService.resolveSettings(getRequestContext(c)) });
|
|
17
|
+
})
|
|
18
|
+
.patch("/settings", async (c) => {
|
|
19
|
+
const updated = await storefrontService.updateSettings(await parseJsonBody(c, storefrontSettingsPatchSchema), getRequestContext(c));
|
|
20
|
+
if (!updated) {
|
|
21
|
+
throw new ApiHttpError("Storefront settings updates are not configured", {
|
|
22
|
+
status: 409,
|
|
23
|
+
code: "storefront_settings_update_not_configured",
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return c.json({ data: updated });
|
|
27
|
+
});
|
|
28
|
+
}
|