@v-office/website-sdk 2.24.1 → 2.26.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/cli.mjs +89 -2
- package/dist/{client-DC4LG3CP.mjs → client--T_tQSjV.mjs} +237 -70
- package/dist/index.d.mts +22 -5
- package/dist/index.mjs +1 -1
- package/dist/instructions/CHANGELOG.md +2 -0
- package/dist/instructions/MIGRATION.md +2 -0
- package/dist/instructions/README.md +1 -1
- package/dist/instructions/creation.md +5 -0
- package/dist/instructions/rentals.md +75 -0
- package/dist/instructions/search.md +48 -3
- package/dist/instructions/versions/2.25.0/CHANGELOG.md +41 -0
- package/dist/instructions/versions/2.25.0/MIGRATION.md +64 -0
- package/dist/instructions/versions/2.26.0/CHANGELOG.md +33 -0
- package/dist/instructions/versions/2.26.0/MIGRATION.md +31 -0
- package/dist/{to-rental-highlights-C1NF2uuE.mjs → operations-DwURbo0b.mjs} +1 -626
- package/dist/{rentals-eqFhtCdT.mjs → rentals-D4wmqjzL.mjs} +96 -33
- package/dist/{search-CKL-8T8q.mjs → search-DtBtzIGf.mjs} +5 -4
- package/dist/to-rental-highlights-BL5m3Uen.mjs +626 -0
- package/dist/translations/v9/de-DE/core.json +3 -1
- package/dist/translations/v9/en-US/core.json +3 -1
- package/dist/{v9-data-BnYxa2Ek.mjs → v9-data-C3SWtDGs.mjs} +7 -5
- package/instructions/CHANGELOG.md +2 -0
- package/instructions/MIGRATION.md +2 -0
- package/instructions/README.md +1 -1
- package/instructions/creation.md +5 -0
- package/instructions/rentals.md +75 -0
- package/instructions/search.md +48 -3
- package/instructions/versions/2.25.0/CHANGELOG.md +41 -0
- package/instructions/versions/2.25.0/MIGRATION.md +64 -0
- package/instructions/versions/2.25.0/release.json +3 -0
- package/instructions/versions/2.26.0/CHANGELOG.md +33 -0
- package/instructions/versions/2.26.0/MIGRATION.md +31 -0
- package/instructions/versions/2.26.0/release.json +3 -0
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as customDataAttribute } from "./v9-data-
|
|
1
|
+
import { a as customDataAttribute } from "./v9-data-C3SWtDGs.mjs";
|
|
2
2
|
import { AvailabilityService, BookingBookOutput, BookingService, ContactService, CoreSDKError, DEFAULT_RENTAL_HIGHLIGHT_PRIORITIZATION, DEFAULT_RENTAL_PROPERTY_HIGHLIGHT_PRIORITIZATION, DocumentsService, EMPTY_CUSTOM_ATTRIBUTE_REGISTRY, FilterService, QuoteService, RentalService, SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS, SearchService, TranslationService, addGuestQuoteAdditionalServiceSelection, asArray, asRecord, assertNoNestedCustomAttributeFilterCompositions, assertNoReservedQueryKeys, assertUniqueCustomFilterQueryKeys, assertUniqueFilterQueryKeys, clearGuestQuoteAdditionalServiceSelections, collectQueryParameters, createCoreRuntime, expandCustomAttributeFilterCompositions, firstNumber, firstString, formatCurrency, formatLocalDate, getBookingBookGuestToken, getGuestQuoteBackendContext, getGuestQuoteInput, isDisplayableCustomAttribute, localeToLanguage, makeMinIntervalLimiter, makeTranslationLive, parseQueryParameters, refreshGuestQuoteInsurancePassthrough, removeGuestQuoteAdditionalServiceSelection, selectGuestQuoteCancellationPolicySelection, toCustomAttributeFilterLabel, toCustomAttributeFilterOutputItem, toCustomAttributeList, toInitialAvailabilityCalendarDays, toQueryString, toResolvedCustomAttributeCategoryTranslationKey, toStartDateSelectedCalendarDays, validateContactSubmitInput, withGuestQuoteInsurance, withGuestQuoteInsuranceRefresh } from "@v-office/sdk-core";
|
|
3
3
|
import { Context, Data, DateTime, Effect, Layer, Schema, SchemaGetter } from "effect";
|
|
4
4
|
import { FetchHttpClient, HttpClient, HttpClientRequest } from "effect/unstable/http";
|
|
@@ -176,16 +176,16 @@ const EMPTY_V9_PROPERTY_HIGHLIGHT_SOURCE_REGISTRY = {
|
|
|
176
176
|
keys: {}
|
|
177
177
|
};
|
|
178
178
|
const stableKeyPattern = /^[A-Za-z0-9_-]+$/;
|
|
179
|
-
const dataAttributePattern = /^p_[1-9]\d*$/;
|
|
179
|
+
const dataAttributePattern$1 = /^p_[1-9]\d*$/;
|
|
180
180
|
const reservedKeys = new Set(V9_FACILITY_ATTRIBUTE_KEYS);
|
|
181
|
-
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
181
|
+
const isRecord$1 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
182
182
|
const invalidSources = (issues) => new CoreSDKError({
|
|
183
183
|
source: "v9",
|
|
184
184
|
operation: "v9.property-highlight-sources",
|
|
185
185
|
message: `Invalid v9 property highlight sources:\n${issues.map((issue) => `- ${issue}`).join("\n")}`
|
|
186
186
|
});
|
|
187
187
|
const parseV9PropertyHighlightSources = (input) => {
|
|
188
|
-
if (!isRecord(input)) throw invalidSources(["expected an object keyed by stable highlight key"]);
|
|
188
|
+
if (!isRecord$1(input)) throw invalidSources(["expected an object keyed by stable highlight key"]);
|
|
189
189
|
const issues = [];
|
|
190
190
|
const sources = [];
|
|
191
191
|
const sourceByBinding = /* @__PURE__ */ new Map();
|
|
@@ -198,14 +198,14 @@ const parseV9PropertyHighlightSources = (input) => {
|
|
|
198
198
|
issues.push(`${key}: key is reserved for a built-in v9 facility highlight`);
|
|
199
199
|
continue;
|
|
200
200
|
}
|
|
201
|
-
if (!isRecord(source)) {
|
|
201
|
+
if (!isRecord$1(source)) {
|
|
202
202
|
issues.push(`${key}: expected an object`);
|
|
203
203
|
continue;
|
|
204
204
|
}
|
|
205
205
|
const excessKeys = Object.keys(source).filter((sourceKey) => sourceKey !== "v9" && sourceKey !== "type");
|
|
206
206
|
if (excessKeys.length > 0) issues.push(`${key}: unsupported field(s) ${excessKeys.join(", ")}`);
|
|
207
207
|
const v9 = source.v9;
|
|
208
|
-
if (typeof v9 !== "string" || !dataAttributePattern.test(v9)) {
|
|
208
|
+
if (typeof v9 !== "string" || !dataAttributePattern$1.test(v9)) {
|
|
209
209
|
issues.push(`${key}.v9: expected a positive-integer p_* data attribute`);
|
|
210
210
|
continue;
|
|
211
211
|
}
|
|
@@ -245,6 +245,64 @@ const selectV9PropertyHighlightSources = ({ highlightPrioritization, registry })
|
|
|
245
245
|
return selected;
|
|
246
246
|
};
|
|
247
247
|
//#endregion
|
|
248
|
+
//#region src/legacy-v9/review-options.ts
|
|
249
|
+
const LOCALES = ["de-DE", "en-US"];
|
|
250
|
+
const BOOLEAN_OPTION_KEYS = [
|
|
251
|
+
"showAuthorCity",
|
|
252
|
+
"includeItemsWithoutText",
|
|
253
|
+
"includeItemsWithoutRating"
|
|
254
|
+
];
|
|
255
|
+
const OPTION_KEYS = /* @__PURE__ */ new Set(["criteria", ...BOOLEAN_OPTION_KEYS]);
|
|
256
|
+
const CRITERION_KEYS = /* @__PURE__ */ new Set([
|
|
257
|
+
"v9",
|
|
258
|
+
"type",
|
|
259
|
+
"label"
|
|
260
|
+
]);
|
|
261
|
+
const dataAttributePattern = /^fb_[1-9]\d*$/;
|
|
262
|
+
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
263
|
+
const criterionIssues = (criterion, index, seen) => {
|
|
264
|
+
const path = `criteria[${index}]`;
|
|
265
|
+
if (!isRecord(criterion)) return [`${path}: expected an object`];
|
|
266
|
+
const issues = Object.keys(criterion).filter((key) => !CRITERION_KEYS.has(key)).map((key) => `${path}: unsupported field ${key}`);
|
|
267
|
+
const v9 = criterion.v9;
|
|
268
|
+
if (typeof v9 !== "string" || !dataAttributePattern.test(v9)) issues.push(`${path}.v9: expected a positive-integer fb_* data attribute`);
|
|
269
|
+
else if (seen.has(v9)) issues.push(`${path}.v9: ${v9} is configured more than once`);
|
|
270
|
+
else seen.add(v9);
|
|
271
|
+
if (criterion.type !== "stars" && criterion.type !== "text") issues.push(`${path}.type: expected "stars" or "text"`);
|
|
272
|
+
const label = criterion.label;
|
|
273
|
+
if (!isRecord(label)) issues.push(`${path}.label: expected a label for ${LOCALES.join(", ")}`);
|
|
274
|
+
else {
|
|
275
|
+
const missing = LOCALES.filter((locale) => typeof label[locale] !== "string" || label[locale].trim() === "");
|
|
276
|
+
if (missing.length > 0) issues.push(`${path}.label: missing a label for ${missing.join(", ")}`);
|
|
277
|
+
}
|
|
278
|
+
return issues;
|
|
279
|
+
};
|
|
280
|
+
const normalizeV9ReviewsOptions = (input = {}) => {
|
|
281
|
+
const issues = [];
|
|
282
|
+
if (!isRecord(input)) issues.push("expected an object");
|
|
283
|
+
else {
|
|
284
|
+
for (const key of Object.keys(input)) if (!OPTION_KEYS.has(key)) issues.push(`unsupported field ${key}`);
|
|
285
|
+
for (const key of BOOLEAN_OPTION_KEYS) if (input[key] !== void 0 && typeof input[key] !== "boolean") issues.push(`${key}: expected a boolean`);
|
|
286
|
+
if (input.criteria !== void 0 && !Array.isArray(input.criteria)) issues.push("criteria: expected an array");
|
|
287
|
+
else {
|
|
288
|
+
const seen = /* @__PURE__ */ new Set();
|
|
289
|
+
(input.criteria ?? []).forEach((criterion, index) => issues.push(...criterionIssues(criterion, index, seen)));
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
if (issues.length > 0) throw new CoreSDKError({
|
|
293
|
+
source: "v9",
|
|
294
|
+
operation: "v9.reviews",
|
|
295
|
+
message: `Invalid v9Reviews option:\n${issues.map((issue) => `- ${issue}`).join("\n")}`
|
|
296
|
+
});
|
|
297
|
+
const options = input;
|
|
298
|
+
return {
|
|
299
|
+
criteria: options.criteria ?? [],
|
|
300
|
+
showAuthorCity: options.showAuthorCity ?? false,
|
|
301
|
+
includeItemsWithoutText: options.includeItemsWithoutText ?? false,
|
|
302
|
+
includeItemsWithoutRating: options.includeItemsWithoutRating ?? false
|
|
303
|
+
};
|
|
304
|
+
};
|
|
305
|
+
//#endregion
|
|
248
306
|
//#region src/config.ts
|
|
249
307
|
const normalizeWebsiteSDKOptions = (options = {}) => {
|
|
250
308
|
assertNoReservedQueryKeys(options);
|
|
@@ -254,6 +312,7 @@ const normalizeWebsiteSDKOptions = (options = {}) => {
|
|
|
254
312
|
...options.translationOverrides === void 0 ? {} : { translationOverrides: options.translationOverrides },
|
|
255
313
|
customAttributes: options.customAttributes ?? EMPTY_CUSTOM_ATTRIBUTE_REGISTRY,
|
|
256
314
|
v9PropertyHighlightSources: options.v9PropertyHighlightSources ?? EMPTY_V9_PROPERTY_HIGHLIGHT_SOURCE_REGISTRY,
|
|
315
|
+
v9Reviews: normalizeV9ReviewsOptions(options.v9Reviews),
|
|
257
316
|
customAttributeFilterDefinitions: options.customAttributeFilterDefinitions ?? [],
|
|
258
317
|
rentalHighlightPrioritization: options.rentalHighlightPrioritization ?? DEFAULT_RENTAL_HIGHLIGHT_PRIORITIZATION,
|
|
259
318
|
rentalPropertyHighlightPrioritization: options.rentalPropertyHighlightPrioritization ?? DEFAULT_RENTAL_PROPERTY_HIGHLIGHT_PRIORITIZATION,
|
|
@@ -273,6 +332,7 @@ const toV9Options = (options) => {
|
|
|
273
332
|
...options.translationOverrides === void 0 ? {} : { translationOverrides: options.translationOverrides },
|
|
274
333
|
customAttributes: options.customAttributes,
|
|
275
334
|
v9PropertyHighlightSources: options.v9PropertyHighlightSources,
|
|
335
|
+
v9Reviews: options.v9Reviews,
|
|
276
336
|
customAttributeFilterDefinitions: options.customAttributeFilterDefinitions,
|
|
277
337
|
rentalHighlightPrioritization: options.rentalHighlightPrioritization,
|
|
278
338
|
rentalPropertyHighlightPrioritization: options.rentalPropertyHighlightPrioritization,
|
|
@@ -473,7 +533,7 @@ const getTermsAndPrivacyPolicyEffect = (input) => Effect.gen(function* () {
|
|
|
473
533
|
const getBankTransferDetailsEffect = () => Effect.gen(function* () {
|
|
474
534
|
const service = yield* BookingService;
|
|
475
535
|
if (service.getBankTransferDetails === void 0) return yield* Effect.fail(new CoreSDKError({
|
|
476
|
-
source: "
|
|
536
|
+
source: "core",
|
|
477
537
|
operation: "booking.getBankTransferDetails",
|
|
478
538
|
message: "BookingService.getBankTransferDetails is not provided by the core runtime."
|
|
479
539
|
}));
|
|
@@ -485,7 +545,7 @@ const searchEffect = (input) => Effect.gen(function* () {
|
|
|
485
545
|
const mapSearchEffect = (input) => Effect.gen(function* () {
|
|
486
546
|
const service = yield* SearchService;
|
|
487
547
|
if (service.mapSearch === void 0) return yield* Effect.fail(new CoreSDKError({
|
|
488
|
-
source: "
|
|
548
|
+
source: "core",
|
|
489
549
|
operation: "search.mapSearch",
|
|
490
550
|
message: "SearchService.mapSearch is not provided by the core runtime."
|
|
491
551
|
}));
|
|
@@ -1550,7 +1610,9 @@ var core_default$1 = {
|
|
|
1550
1610
|
"Property.propertyType.option.FARM": "Bauernhof",
|
|
1551
1611
|
"Property.propertyType.option.HOLIDAY_HOME_COMPLEX": "Ferienpark",
|
|
1552
1612
|
"Property.propertyType.option.HOSTEL": "Hostel",
|
|
1553
|
-
"Property.propertyType.option.HOTEL": "Hotel"
|
|
1613
|
+
"Property.propertyType.option.HOTEL": "Hotel",
|
|
1614
|
+
"reviews.item.guest": "Gast",
|
|
1615
|
+
"reviews.item.authorWithCity": "{author} aus {city}"
|
|
1554
1616
|
};
|
|
1555
1617
|
//#endregion
|
|
1556
1618
|
//#region translations/v9/de-DE/filter.json
|
|
@@ -2289,7 +2351,9 @@ var core_default = {
|
|
|
2289
2351
|
"Property.propertyType.option.FARM": "Farm",
|
|
2290
2352
|
"Property.propertyType.option.HOLIDAY_HOME_COMPLEX": "Holiday Home Complex",
|
|
2291
2353
|
"Property.propertyType.option.HOSTEL": "Hostel",
|
|
2292
|
-
"Property.propertyType.option.HOTEL": "Hotel"
|
|
2354
|
+
"Property.propertyType.option.HOTEL": "Hotel",
|
|
2355
|
+
"reviews.item.guest": "Guest",
|
|
2356
|
+
"reviews.item.authorWithCity": "{author} from {city}"
|
|
2293
2357
|
};
|
|
2294
2358
|
//#endregion
|
|
2295
2359
|
//#region translations/v9/en-US/filter.json
|
|
@@ -3057,7 +3121,7 @@ const toVofficeUnitId$2 = (input) => {
|
|
|
3057
3121
|
const unitId = Number(input.rentalId);
|
|
3058
3122
|
if (Number.isInteger(unitId)) return Effect.succeed(unitId);
|
|
3059
3123
|
return Effect.fail(new CoreSDKError({
|
|
3060
|
-
source: "
|
|
3124
|
+
source: "v9",
|
|
3061
3125
|
operation: "v9.availability",
|
|
3062
3126
|
message: `Expected rentalId to be a vOffice unit ID, received "${input.rentalId}".`
|
|
3063
3127
|
}));
|
|
@@ -3076,7 +3140,7 @@ const makeV9AvailabilityApi = ({ config, options }) => {
|
|
|
3076
3140
|
path: { voffice_unit: unitId },
|
|
3077
3141
|
query: { lang: localeToLanguage(input.locale) }
|
|
3078
3142
|
}).pipe(Effect.mapError((cause) => new CoreSDKError({
|
|
3079
|
-
source: "
|
|
3143
|
+
source: "v9",
|
|
3080
3144
|
operation: "v9.availability",
|
|
3081
3145
|
message: "Failed to load v9 availability from the v1 OpenAPI client.",
|
|
3082
3146
|
cause
|
|
@@ -4405,14 +4469,14 @@ const toV9BookingServiceLines = (quote) => {
|
|
|
4405
4469
|
const toVofficeUnitId$1 = (input) => {
|
|
4406
4470
|
const context = getGuestQuoteBackendContext(input.quote);
|
|
4407
4471
|
if (context?.backend !== "v9") return Effect.fail(new CoreSDKError({
|
|
4408
|
-
source: "
|
|
4472
|
+
source: "v9",
|
|
4409
4473
|
operation: "v9.booking",
|
|
4410
4474
|
message: "Expected a v9 quote for v9 booking."
|
|
4411
4475
|
}));
|
|
4412
4476
|
const unitId = Number(context.input.rentalId);
|
|
4413
4477
|
if (Number.isInteger(unitId)) return Effect.succeed(unitId);
|
|
4414
4478
|
return Effect.fail(new CoreSDKError({
|
|
4415
|
-
source: "
|
|
4479
|
+
source: "v9",
|
|
4416
4480
|
operation: "v9.booking",
|
|
4417
4481
|
message: `Expected rentalId to be a vOffice unit ID, received "${context.input.rentalId}".`
|
|
4418
4482
|
}));
|
|
@@ -4433,7 +4497,7 @@ const toBookingInput = ({ input }) => Effect.gen(function* () {
|
|
|
4433
4497
|
const context = getGuestQuoteBackendContext(input.quote);
|
|
4434
4498
|
const unitId = yield* toVofficeUnitId$1(input);
|
|
4435
4499
|
if (context?.backend !== "v9") return yield* Effect.fail(new CoreSDKError({
|
|
4436
|
-
source: "
|
|
4500
|
+
source: "v9",
|
|
4437
4501
|
operation: "v9.booking",
|
|
4438
4502
|
message: "Expected a v9 quote for v9 booking."
|
|
4439
4503
|
}));
|
|
@@ -4745,7 +4809,7 @@ const toStripeReturnUrls = ({ redirectUrl }) => Effect.try({
|
|
|
4745
4809
|
};
|
|
4746
4810
|
},
|
|
4747
4811
|
catch: (cause) => new CoreSDKError({
|
|
4748
|
-
source: "
|
|
4812
|
+
source: "v9",
|
|
4749
4813
|
operation: "v9.booking",
|
|
4750
4814
|
message: "v9 Stripe payment URLs require an absolute relativeRedirectUrl or a browser window origin so rootUrl, successUrlBase, and cancelUrlBase can be created.",
|
|
4751
4815
|
cause
|
|
@@ -4755,7 +4819,7 @@ const toStripePaymentInput = ({ bookResponse, input, paymentScheduleOption, stri
|
|
|
4755
4819
|
const reservationId = bookResponse.reservation?.id;
|
|
4756
4820
|
const reservationNumber = bookResponse.reservation?.nr;
|
|
4757
4821
|
if (reservationId === void 0 || reservationNumber === void 0 || stripePaymentMethod.id === void 0) return yield* Effect.fail(new CoreSDKError({
|
|
4758
|
-
source: "
|
|
4822
|
+
source: "v9",
|
|
4759
4823
|
operation: "v9.booking",
|
|
4760
4824
|
message: "vOffice booking response did not contain enough data to initialize Stripe payment."
|
|
4761
4825
|
}));
|
|
@@ -4792,20 +4856,20 @@ const book = ({ client, input, translations }) => Effect.gen(function* () {
|
|
|
4792
4856
|
data: JSON.stringify(bookingInput),
|
|
4793
4857
|
lang: language
|
|
4794
4858
|
} }).pipe(Effect.mapError((cause) => new CoreSDKError({
|
|
4795
|
-
source: "
|
|
4859
|
+
source: "v9",
|
|
4796
4860
|
operation: "v9.booking",
|
|
4797
4861
|
message: "Failed to create v9 booking through the v0 OpenAPI client.",
|
|
4798
4862
|
cause
|
|
4799
4863
|
})));
|
|
4800
4864
|
const bookResponse = result.raw;
|
|
4801
4865
|
if (bookResponse.ok === false) return yield* Effect.fail(new CoreSDKError({
|
|
4802
|
-
source: "
|
|
4866
|
+
source: "v9",
|
|
4803
4867
|
operation: "v9.booking",
|
|
4804
4868
|
message: "vOffice rejected the v9 booking request.",
|
|
4805
4869
|
cause: result.raw
|
|
4806
4870
|
}));
|
|
4807
4871
|
if (bookResponse.reservation?.id === void 0 || bookResponse.reservation.nr === void 0) return yield* Effect.fail(new CoreSDKError({
|
|
4808
|
-
source: "
|
|
4872
|
+
source: "v9",
|
|
4809
4873
|
operation: "v9.booking",
|
|
4810
4874
|
message: "vOffice booking response did not contain a reservation id and number.",
|
|
4811
4875
|
cause: result.raw
|
|
@@ -4823,7 +4887,7 @@ const book = ({ client, input, translations }) => Effect.gen(function* () {
|
|
|
4823
4887
|
if (!paymentScheduleOption.payableNow) return { paymentScheduleOption };
|
|
4824
4888
|
if (stripePaymentMethod === void 0) return { paymentScheduleOption };
|
|
4825
4889
|
if (stripePaymentKey === void 0) return yield* Effect.fail(new CoreSDKError({
|
|
4826
|
-
source: "
|
|
4890
|
+
source: "v9",
|
|
4827
4891
|
operation: "v9.booking",
|
|
4828
4892
|
message: "vOffice booking response did not contain a guest token for v9 Stripe payment initialization."
|
|
4829
4893
|
}));
|
|
@@ -4841,14 +4905,14 @@ const book = ({ client, input, translations }) => Effect.gen(function* () {
|
|
|
4841
4905
|
lang: language
|
|
4842
4906
|
}
|
|
4843
4907
|
}).pipe(Effect.mapError((cause) => new CoreSDKError({
|
|
4844
|
-
source: "
|
|
4908
|
+
source: "v9",
|
|
4845
4909
|
operation: "v9.booking",
|
|
4846
4910
|
message: "Failed to initialize v9 Stripe payment.",
|
|
4847
4911
|
cause
|
|
4848
4912
|
})));
|
|
4849
4913
|
const stripeResponse = stripeResult.raw;
|
|
4850
4914
|
if (stripeResponse.ok === false) return yield* Effect.fail(new CoreSDKError({
|
|
4851
|
-
source: "
|
|
4915
|
+
source: "v9",
|
|
4852
4916
|
operation: "v9.booking",
|
|
4853
4917
|
message: "vOffice rejected the v9 Stripe payment initialization.",
|
|
4854
4918
|
cause: stripeResult.raw
|
|
@@ -4891,7 +4955,7 @@ const makeV9BookingApi = ({ config, options }) => {
|
|
|
4891
4955
|
interval: "1 second",
|
|
4892
4956
|
maxQueueSize: 5,
|
|
4893
4957
|
onQueueFull: (maxQueueSize) => new CoreSDKError({
|
|
4894
|
-
source: "
|
|
4958
|
+
source: "v9",
|
|
4895
4959
|
operation: "v9.booking",
|
|
4896
4960
|
message: `v9 booking rate limit queue is full (${maxQueueSize} total request(s)).`
|
|
4897
4961
|
})
|
|
@@ -4963,13 +5027,13 @@ const submit = ({ client, input }) => Effect.gen(function* () {
|
|
|
4963
5027
|
data: JSON.stringify(contactInput),
|
|
4964
5028
|
lang: localeToLanguage(input.locale ?? "de-DE")
|
|
4965
5029
|
} }).pipe(Effect.mapError((cause) => new CoreSDKError({
|
|
4966
|
-
source: "
|
|
5030
|
+
source: "v9",
|
|
4967
5031
|
operation: "v9.contact",
|
|
4968
5032
|
message: "Failed to submit v9 contact request through the v0 OpenAPI client.",
|
|
4969
5033
|
cause
|
|
4970
5034
|
})));
|
|
4971
5035
|
if (result.raw.ok === false) return yield* Effect.fail(new CoreSDKError({
|
|
4972
|
-
source: "
|
|
5036
|
+
source: "v9",
|
|
4973
5037
|
operation: "v9.contact",
|
|
4974
5038
|
message: "vOffice rejected the v9 contact request.",
|
|
4975
5039
|
cause: result.raw
|
|
@@ -4984,7 +5048,7 @@ const makeV9ContactApi = ({ config, options }) => {
|
|
|
4984
5048
|
interval: "1 second",
|
|
4985
5049
|
maxQueueSize: 5,
|
|
4986
5050
|
onQueueFull: (maxQueueSize) => new CoreSDKError({
|
|
4987
|
-
source: "
|
|
5051
|
+
source: "v9",
|
|
4988
5052
|
operation: "v9.contact",
|
|
4989
5053
|
message: `v9 contact rate limit queue is full (${maxQueueSize} total request(s)).`
|
|
4990
5054
|
})
|
|
@@ -5107,13 +5171,13 @@ const selectedInsuranceOption = (quote) => {
|
|
|
5107
5171
|
//#endregion
|
|
5108
5172
|
//#region src/legacy-v9/live/quote-insurance.ts
|
|
5109
5173
|
const toInsuranceError = (message) => (cause) => new CoreSDKError({
|
|
5110
|
-
source: "
|
|
5174
|
+
source: "v9",
|
|
5111
5175
|
operation: "v9.insurance",
|
|
5112
5176
|
message,
|
|
5113
5177
|
cause
|
|
5114
5178
|
});
|
|
5115
5179
|
const failInsurance = (message) => Effect.fail(new CoreSDKError({
|
|
5116
|
-
source: "
|
|
5180
|
+
source: "v9",
|
|
5117
5181
|
operation: "v9.insurance",
|
|
5118
5182
|
message
|
|
5119
5183
|
}));
|
|
@@ -5316,7 +5380,7 @@ const createV9InsurancePreContract = ({ quote, customerInformation, v1Client })
|
|
|
5316
5380
|
const result = yield* v1Client.execute("createErgoPreContract", { body }).pipe(Effect.mapError(toInsuranceError("Failed to create ERGO pre-contract information.")));
|
|
5317
5381
|
const preContract = toInsurancePreContractOutput(result.raw);
|
|
5318
5382
|
if (preContract.kind !== "created") return yield* Effect.fail(new CoreSDKError({
|
|
5319
|
-
source: "
|
|
5383
|
+
source: "v9",
|
|
5320
5384
|
operation: "v9.insurance",
|
|
5321
5385
|
message: "ERGO pre-contract response did not contain a pre-contract ID.",
|
|
5322
5386
|
cause: result.raw
|
|
@@ -5361,7 +5425,7 @@ const bookV9Insurance = ({ quote, bookingNumber, guestToken, v1Client }) => Effe
|
|
|
5361
5425
|
const result = yield* v1Client.execute("bookErgoTravelCancellationInsurance", { body }).pipe(Effect.mapError(toInsuranceError("Failed to book ERGO insurance.")));
|
|
5362
5426
|
const bookingOutput = toInsuranceBookingOutput(result.raw);
|
|
5363
5427
|
if (bookingOutput.kind !== "booked") return yield* Effect.fail(new CoreSDKError({
|
|
5364
|
-
source: "
|
|
5428
|
+
source: "v9",
|
|
5365
5429
|
operation: "v9.insurance",
|
|
5366
5430
|
message: "ERGO insurance booking response did not contain a policy number.",
|
|
5367
5431
|
cause: result.raw
|
|
@@ -5383,7 +5447,7 @@ const loadQuoteRuntime = Effect.tryPromise({
|
|
|
5383
5447
|
return { toGuestQuote: (await import("./quote-cjFdLn0m.mjs")).toGuestQuote };
|
|
5384
5448
|
},
|
|
5385
5449
|
catch: (cause) => new CoreSDKError({
|
|
5386
|
-
source: "
|
|
5450
|
+
source: "v9",
|
|
5387
5451
|
operation: "v9.quote",
|
|
5388
5452
|
message: "Failed to load v9 quote runtime.",
|
|
5389
5453
|
cause
|
|
@@ -5393,7 +5457,7 @@ const toVofficeUnitId = (input) => {
|
|
|
5393
5457
|
const unitId = Number(input.rentalId);
|
|
5394
5458
|
if (Number.isInteger(unitId)) return Effect.succeed(unitId);
|
|
5395
5459
|
return Effect.fail(new CoreSDKError({
|
|
5396
|
-
source: "
|
|
5460
|
+
source: "v9",
|
|
5397
5461
|
operation: "v9.quote",
|
|
5398
5462
|
message: `Expected rentalId to be a vOffice unit ID, received "${input.rentalId}".`
|
|
5399
5463
|
}));
|
|
@@ -5414,7 +5478,7 @@ const quote = (client, v0Client, translations, limitQuote, input, shouldAddPropo
|
|
|
5414
5478
|
...input.voucher === void 0 ? {} : { voucherCode: input.voucher }
|
|
5415
5479
|
}
|
|
5416
5480
|
}).pipe(Effect.mapError((cause) => new CoreSDKError({
|
|
5417
|
-
source: "
|
|
5481
|
+
source: "v9",
|
|
5418
5482
|
operation: "v9.quote",
|
|
5419
5483
|
message: "Failed to load v9 quote prices from the v1 OpenAPI client.",
|
|
5420
5484
|
cause
|
|
@@ -5439,7 +5503,7 @@ const makeV9QuoteApi = ({ config, options }) => {
|
|
|
5439
5503
|
interval: "1 second",
|
|
5440
5504
|
maxQueueSize: 5,
|
|
5441
5505
|
onQueueFull: (maxQueueSize) => new CoreSDKError({
|
|
5442
|
-
source: "
|
|
5506
|
+
source: "v9",
|
|
5443
5507
|
operation: "v9.quote",
|
|
5444
5508
|
message: `v9 quote rate limit queue is full (${maxQueueSize} total request(s)).`
|
|
5445
5509
|
})
|
|
@@ -5620,20 +5684,20 @@ const makeV9GraphQLClient = (config) => ({ execute: (document, variables) => Eff
|
|
|
5620
5684
|
return body;
|
|
5621
5685
|
},
|
|
5622
5686
|
catch: (cause) => new CoreSDKError({
|
|
5623
|
-
source: "
|
|
5687
|
+
source: "v9",
|
|
5624
5688
|
operation: "v9.graphql.transport",
|
|
5625
5689
|
message: "v9 GraphQL transport request failed.",
|
|
5626
5690
|
cause
|
|
5627
5691
|
})
|
|
5628
5692
|
}).pipe(Effect.flatMap((body) => {
|
|
5629
5693
|
if (body.errors?.length) return Effect.fail(new CoreSDKError({
|
|
5630
|
-
source: "
|
|
5694
|
+
source: "v9",
|
|
5631
5695
|
operation: "v9.graphql.decode",
|
|
5632
5696
|
message: "v9 GraphQL response contained errors.",
|
|
5633
5697
|
cause: body.errors
|
|
5634
5698
|
}));
|
|
5635
5699
|
if (body.data === void 0) return Effect.fail(new CoreSDKError({
|
|
5636
|
-
source: "
|
|
5700
|
+
source: "v9",
|
|
5637
5701
|
operation: "v9.graphql.decode",
|
|
5638
5702
|
message: "v9 GraphQL response did not include data."
|
|
5639
5703
|
}));
|
|
@@ -5669,7 +5733,7 @@ const toV9PropertyScope = (scope) => {
|
|
|
5669
5733
|
const validateV9RentalScope = (scope) => {
|
|
5670
5734
|
if (toV9PropertyScope(scope).kind !== "invalid") return;
|
|
5671
5735
|
throw new CoreSDKError({
|
|
5672
|
-
source: "
|
|
5736
|
+
source: "v9",
|
|
5673
5737
|
operation: "v9.config",
|
|
5674
5738
|
message: `Expected rentalScope.propertyId to be a vOffice property ID, received "${scope.propertyId}".`
|
|
5675
5739
|
});
|
|
@@ -5706,39 +5770,41 @@ const V9_SEARCH_CURSOR_PREFIX = "page:";
|
|
|
5706
5770
|
*/
|
|
5707
5771
|
const ALL_RENTALS_PAGE_SIZE = 10;
|
|
5708
5772
|
const ALL_RENTALS_CONCURRENCY = 8;
|
|
5773
|
+
/** The hub silently leaves every rental after the 128th of a request unpriced. */
|
|
5774
|
+
const MAX_PRICED_PAGE_SIZE = 128;
|
|
5709
5775
|
/** A map search prices nothing; the hub answers 1000 matches in one request. */
|
|
5710
5776
|
const MAP_SEARCH_PAGE_SIZE = 1e3;
|
|
5711
5777
|
const toV9SearchCursor = (page) => `${V9_SEARCH_CURSOR_PREFIX}${page}`;
|
|
5712
5778
|
const parseV9SearchCursor = (cursor) => Effect.gen(function* () {
|
|
5713
5779
|
if (!cursor.startsWith(V9_SEARCH_CURSOR_PREFIX)) return yield* Effect.fail(new CoreSDKError({
|
|
5714
|
-
source: "
|
|
5780
|
+
source: "v9",
|
|
5715
5781
|
operation: "v9.search",
|
|
5716
5782
|
message: "Invalid v9 search cursor."
|
|
5717
5783
|
}));
|
|
5718
5784
|
const page = Number(cursor.slice(5));
|
|
5719
5785
|
if (!Number.isInteger(page) || page < 1) return yield* Effect.fail(new CoreSDKError({
|
|
5720
|
-
source: "
|
|
5786
|
+
source: "v9",
|
|
5721
5787
|
operation: "v9.search",
|
|
5722
5788
|
message: "Invalid v9 search cursor."
|
|
5723
5789
|
}));
|
|
5724
5790
|
return page;
|
|
5725
5791
|
});
|
|
5726
5792
|
const loadV9SearchRuntime = Effect.tryPromise({
|
|
5727
|
-
try: () => import("./search-
|
|
5793
|
+
try: () => import("./search-DtBtzIGf.mjs"),
|
|
5728
5794
|
catch: (cause) => new CoreSDKError({
|
|
5729
|
-
source: "
|
|
5795
|
+
source: "v9",
|
|
5730
5796
|
operation: "v9.search.runtime",
|
|
5731
5797
|
message: "Failed to load v9 live search runtime.",
|
|
5732
5798
|
cause
|
|
5733
5799
|
})
|
|
5734
5800
|
});
|
|
5735
5801
|
const failSearch = ({ operation, message }) => Effect.runPromise(Effect.fail(new CoreSDKError({
|
|
5736
|
-
source: "
|
|
5802
|
+
source: "v9",
|
|
5737
5803
|
operation,
|
|
5738
5804
|
message
|
|
5739
5805
|
})));
|
|
5740
5806
|
const tooManyRentals = (totalCount) => new CoreSDKError({
|
|
5741
|
-
source: "
|
|
5807
|
+
source: "v9",
|
|
5742
5808
|
operation: "search.allRentalsAtOnce",
|
|
5743
5809
|
message: `The search matches ${totalCount} rentals; searchAllRentalsAtOnce supports at most ${SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS}. Use paged search and mapSearch instead.`
|
|
5744
5810
|
});
|
|
@@ -5751,6 +5817,19 @@ const uniqueById = (entries, toId) => {
|
|
|
5751
5817
|
return true;
|
|
5752
5818
|
});
|
|
5753
5819
|
};
|
|
5820
|
+
const splitEntries = (entries) => ({
|
|
5821
|
+
items: entries.flatMap((entry) => entry.type === "item" ? [entry.item] : []),
|
|
5822
|
+
alternatives: entries.flatMap((entry) => entry.type === "alternative" ? [entry.alternative] : [])
|
|
5823
|
+
});
|
|
5824
|
+
const toUniqueResults = (entries) => {
|
|
5825
|
+
const split = splitEntries(entries);
|
|
5826
|
+
const items = uniqueById(split.items, (item) => item.id);
|
|
5827
|
+
const itemIds = new Set(items.map((item) => item.id));
|
|
5828
|
+
return {
|
|
5829
|
+
items,
|
|
5830
|
+
alternatives: uniqueById(split.alternatives, (alternative) => alternative.item.id).filter((alternative) => !itemIds.has(alternative.item.id))
|
|
5831
|
+
};
|
|
5832
|
+
};
|
|
5754
5833
|
const makeV9SearchApi = ({ config, options }) => {
|
|
5755
5834
|
const graphql = makeV9GraphQLClient(config);
|
|
5756
5835
|
const translations = makeV9TranslationService(options.translationOverrides);
|
|
@@ -5759,7 +5838,7 @@ const makeV9SearchApi = ({ config, options }) => {
|
|
|
5759
5838
|
interval: "1 second",
|
|
5760
5839
|
maxQueueSize: 5,
|
|
5761
5840
|
onQueueFull: (maxQueueSize) => new CoreSDKError({
|
|
5762
|
-
source: "
|
|
5841
|
+
source: "v9",
|
|
5763
5842
|
operation: "v9.search",
|
|
5764
5843
|
message: `v9 search rate limit queue is full (${maxQueueSize} total request(s)).`
|
|
5765
5844
|
})
|
|
@@ -5838,11 +5917,49 @@ const makeV9SearchApi = ({ config, options }) => {
|
|
|
5838
5917
|
};
|
|
5839
5918
|
})));
|
|
5840
5919
|
return {
|
|
5841
|
-
|
|
5842
|
-
|
|
5920
|
+
...splitEntries(entries),
|
|
5921
|
+
entries,
|
|
5843
5922
|
paginatorInfo: data.search.paginatorInfo
|
|
5844
5923
|
};
|
|
5845
5924
|
});
|
|
5925
|
+
const countMatches = ({ input, runtime, scopedQueryInput }) => graphql.execute(runtime.mapSearchQuery, {
|
|
5926
|
+
first: 1,
|
|
5927
|
+
page: 1,
|
|
5928
|
+
language: localeToLanguage(input.locale),
|
|
5929
|
+
...scopedQueryInput
|
|
5930
|
+
}).pipe(Effect.map((data) => data.search.paginatorInfo.total));
|
|
5931
|
+
const searchPricedWindow = ({ input, runtime, scopedQueryInput, page, limit }) => Effect.gen(function* () {
|
|
5932
|
+
const fetchWindow = Effect.gen(function* () {
|
|
5933
|
+
const totalCount = yield* countMatches({
|
|
5934
|
+
input,
|
|
5935
|
+
runtime,
|
|
5936
|
+
scopedQueryInput
|
|
5937
|
+
});
|
|
5938
|
+
const start = (page - 1) * limit;
|
|
5939
|
+
const end = Math.min(start + limit, totalCount);
|
|
5940
|
+
const firstBackendPage = Math.floor(start / MAX_PRICED_PAGE_SIZE) + 1;
|
|
5941
|
+
const lastBackendPage = Math.ceil(end / MAX_PRICED_PAGE_SIZE);
|
|
5942
|
+
const pages = yield* Effect.all(Array.from({ length: Math.max(0, lastBackendPage - firstBackendPage + 1) }, (_, index) => searchPage({
|
|
5943
|
+
input,
|
|
5944
|
+
runtime,
|
|
5945
|
+
scopedQueryInput,
|
|
5946
|
+
page: firstBackendPage + index,
|
|
5947
|
+
first: MAX_PRICED_PAGE_SIZE
|
|
5948
|
+
})), { concurrency: ALL_RENTALS_CONCURRENCY });
|
|
5949
|
+
const offset = start - (firstBackendPage - 1) * MAX_PRICED_PAGE_SIZE;
|
|
5950
|
+
const entries = pages.flatMap((backendPage) => backendPage.entries).slice(offset, offset + limit);
|
|
5951
|
+
const { items, alternatives } = toUniqueResults(entries);
|
|
5952
|
+
return {
|
|
5953
|
+
items,
|
|
5954
|
+
alternatives,
|
|
5955
|
+
hasNextPage: start + limit < totalCount,
|
|
5956
|
+
totalCount,
|
|
5957
|
+
isConsistent: pages.every((backendPage) => backendPage.paginatorInfo.total === totalCount) && items.length + alternatives.length === Math.max(0, end - start)
|
|
5958
|
+
};
|
|
5959
|
+
});
|
|
5960
|
+
const window = yield* fetchWindow;
|
|
5961
|
+
return window.isConsistent ? window : yield* fetchWindow;
|
|
5962
|
+
});
|
|
5846
5963
|
const searchOnePage = (input) => Effect.runPromise(limitSearch(Effect.gen(function* () {
|
|
5847
5964
|
const { runtime, appliedFilters, unusedFilterKeys, scopedQueryInput } = yield* toScopedQuery(input);
|
|
5848
5965
|
if (scopedQueryInput === void 0) return {
|
|
@@ -5855,12 +5972,33 @@ const makeV9SearchApi = ({ config, options }) => {
|
|
|
5855
5972
|
}
|
|
5856
5973
|
};
|
|
5857
5974
|
const page = input.cursor === void 0 ? 1 : yield* parseV9SearchCursor(input.cursor);
|
|
5975
|
+
const limit = input.limit ?? DEFAULT_SEARCH_LIMIT;
|
|
5976
|
+
if (limit > MAX_PRICED_PAGE_SIZE) {
|
|
5977
|
+
const { items, alternatives, hasNextPage, totalCount } = yield* searchPricedWindow({
|
|
5978
|
+
input,
|
|
5979
|
+
runtime,
|
|
5980
|
+
scopedQueryInput,
|
|
5981
|
+
page,
|
|
5982
|
+
limit
|
|
5983
|
+
});
|
|
5984
|
+
return {
|
|
5985
|
+
items,
|
|
5986
|
+
...alternatives.length > 0 ? { alternatives } : {},
|
|
5987
|
+
appliedFilters,
|
|
5988
|
+
unusedFilterKeys,
|
|
5989
|
+
pageInfo: {
|
|
5990
|
+
hasNextPage,
|
|
5991
|
+
...hasNextPage ? { nextCursor: toV9SearchCursor(page + 1) } : {},
|
|
5992
|
+
totalCount
|
|
5993
|
+
}
|
|
5994
|
+
};
|
|
5995
|
+
}
|
|
5858
5996
|
const { items, alternatives, paginatorInfo } = yield* searchPage({
|
|
5859
5997
|
input,
|
|
5860
5998
|
runtime,
|
|
5861
5999
|
scopedQueryInput,
|
|
5862
6000
|
page,
|
|
5863
|
-
first:
|
|
6001
|
+
first: limit
|
|
5864
6002
|
});
|
|
5865
6003
|
return {
|
|
5866
6004
|
items,
|
|
@@ -5888,12 +6026,11 @@ const makeV9SearchApi = ({ config, options }) => {
|
|
|
5888
6026
|
totalCount: 0
|
|
5889
6027
|
}
|
|
5890
6028
|
};
|
|
5891
|
-
const totalCount =
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
})).search.paginatorInfo.total;
|
|
6029
|
+
const totalCount = yield* countMatches({
|
|
6030
|
+
input,
|
|
6031
|
+
runtime,
|
|
6032
|
+
scopedQueryInput
|
|
6033
|
+
});
|
|
5897
6034
|
if (totalCount > SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS) return yield* Effect.fail(tooManyRentals(totalCount));
|
|
5898
6035
|
const pages = yield* Effect.all(Array.from({ length: Math.ceil(totalCount / ALL_RENTALS_PAGE_SIZE) }, (_, index) => searchPage({
|
|
5899
6036
|
input,
|
|
@@ -5902,9 +6039,7 @@ const makeV9SearchApi = ({ config, options }) => {
|
|
|
5902
6039
|
page: index + 1,
|
|
5903
6040
|
first: ALL_RENTALS_PAGE_SIZE
|
|
5904
6041
|
})), { concurrency: ALL_RENTALS_CONCURRENCY });
|
|
5905
|
-
const items =
|
|
5906
|
-
const itemIds = new Set(items.map((item) => item.id));
|
|
5907
|
-
const alternatives = uniqueById(pages.flatMap((page) => page.alternatives), (alternative) => alternative.item.id).filter((alternative) => !itemIds.has(alternative.item.id));
|
|
6042
|
+
const { items, alternatives } = toUniqueResults(pages.flatMap((page) => page.entries));
|
|
5908
6043
|
const toOutput = (result) => ({
|
|
5909
6044
|
items: result.items,
|
|
5910
6045
|
...result.alternatives.length > 0 ? { alternatives: result.alternatives } : {},
|
|
@@ -5973,9 +6108,39 @@ const makeV9SearchApi = ({ config, options }) => {
|
|
|
5973
6108
|
unusedFilterKeys
|
|
5974
6109
|
};
|
|
5975
6110
|
})));
|
|
6111
|
+
async function* searchPages(input) {
|
|
6112
|
+
if (options.searchAllRentalsAtOnce) return await failSearch({
|
|
6113
|
+
operation: "search.searchPages",
|
|
6114
|
+
message: "searchPages is not available with searchAllRentalsAtOnce; search already returns every result."
|
|
6115
|
+
});
|
|
6116
|
+
const { cursor: _cursor, limit: _limit, ...searchInput } = input;
|
|
6117
|
+
const seenIds = /* @__PURE__ */ new Set();
|
|
6118
|
+
let cursor;
|
|
6119
|
+
for (let pageCount = 1;; pageCount++) {
|
|
6120
|
+
const { alternatives: pageAlternatives = [], ...output } = await searchOnePage({
|
|
6121
|
+
...searchInput,
|
|
6122
|
+
limit: MAX_PRICED_PAGE_SIZE,
|
|
6123
|
+
...cursor === void 0 ? {} : { cursor }
|
|
6124
|
+
});
|
|
6125
|
+
const items = output.items.filter((item) => !seenIds.has(item.id));
|
|
6126
|
+
const alternatives = pageAlternatives.filter((alternative) => !seenIds.has(alternative.item.id));
|
|
6127
|
+
if (pageCount > 1 && items.length + alternatives.length === 0) return;
|
|
6128
|
+
for (const item of items) seenIds.add(item.id);
|
|
6129
|
+
for (const alternative of alternatives) seenIds.add(alternative.item.id);
|
|
6130
|
+
yield {
|
|
6131
|
+
...output,
|
|
6132
|
+
items,
|
|
6133
|
+
...alternatives.length > 0 ? { alternatives } : {}
|
|
6134
|
+
};
|
|
6135
|
+
const { hasNextPage, nextCursor, totalCount } = output.pageInfo;
|
|
6136
|
+
if (!hasNextPage || nextCursor === void 0 || nextCursor === cursor || pageCount >= Math.ceil(totalCount / MAX_PRICED_PAGE_SIZE)) return;
|
|
6137
|
+
cursor = nextCursor;
|
|
6138
|
+
}
|
|
6139
|
+
}
|
|
5976
6140
|
return {
|
|
5977
6141
|
search: (input) => options.searchAllRentalsAtOnce ? searchAllRentals(input) : searchOnePage(input),
|
|
5978
|
-
mapSearch
|
|
6142
|
+
mapSearch,
|
|
6143
|
+
searchPages
|
|
5979
6144
|
};
|
|
5980
6145
|
};
|
|
5981
6146
|
//#endregion
|
|
@@ -6256,12 +6421,7 @@ const DEFAULT_RENTAL_FEEDBACK_DATA_ATTRIBUTES = [
|
|
|
6256
6421
|
"lang",
|
|
6257
6422
|
"highlighted",
|
|
6258
6423
|
"forename",
|
|
6259
|
-
"surname",
|
|
6260
|
-
"city",
|
|
6261
6424
|
"text",
|
|
6262
|
-
"fb_1429",
|
|
6263
|
-
"fb_4905",
|
|
6264
|
-
"fb_4906",
|
|
6265
6425
|
"avgRating"
|
|
6266
6426
|
];
|
|
6267
6427
|
const orderRentalsById = ({ rentalIds, rentals }) => {
|
|
@@ -6277,9 +6437,9 @@ const orderRentalsById = ({ rentalIds, rentals }) => {
|
|
|
6277
6437
|
});
|
|
6278
6438
|
};
|
|
6279
6439
|
const loadV9RentalsRuntime = Effect.tryPromise({
|
|
6280
|
-
try: () => import("./rentals-
|
|
6440
|
+
try: () => import("./rentals-D4wmqjzL.mjs"),
|
|
6281
6441
|
catch: (cause) => new CoreSDKError({
|
|
6282
|
-
source: "
|
|
6442
|
+
source: "v9",
|
|
6283
6443
|
operation: "v9.rentals.runtime",
|
|
6284
6444
|
message: "Failed to load v9 rentals runtime.",
|
|
6285
6445
|
cause
|
|
@@ -6300,6 +6460,11 @@ const makeV9RentalsApi = ({ config, options }) => {
|
|
|
6300
6460
|
highlightPrioritization: options.rentalPropertyHighlightPrioritization,
|
|
6301
6461
|
registry: options.v9PropertyHighlightSources
|
|
6302
6462
|
}).map((source) => customDataAttribute(source.v9))];
|
|
6463
|
+
const rentalFeedbackDataAttributes = [
|
|
6464
|
+
...DEFAULT_RENTAL_FEEDBACK_DATA_ATTRIBUTES,
|
|
6465
|
+
...options.v9Reviews.showAuthorCity ? ["city"] : [],
|
|
6466
|
+
...options.v9Reviews.criteria.map((criterion) => customDataAttribute(criterion.v9))
|
|
6467
|
+
];
|
|
6303
6468
|
const relationAttributeId = config.facilityObjectGroupRelationAttributeId;
|
|
6304
6469
|
const rentalIds = (yield* graphql.execute(rentalIdsQuery, {})).all.map((rental) => rental.voffice_id);
|
|
6305
6470
|
if (rentalIds.length === 0) return [];
|
|
@@ -6360,7 +6525,7 @@ const makeV9RentalsApi = ({ config, options }) => {
|
|
|
6360
6525
|
const feedbacksData = yield* graphql.execute(rentalsAllFeedbacksQuery, {
|
|
6361
6526
|
language,
|
|
6362
6527
|
voffice_ids: batch.map((rental) => rental.voffice_id),
|
|
6363
|
-
rentalFeedbackDataAttributes
|
|
6528
|
+
rentalFeedbackDataAttributes
|
|
6364
6529
|
});
|
|
6365
6530
|
feedbackRentals.push(...feedbacksData.all);
|
|
6366
6531
|
}
|
|
@@ -6377,7 +6542,8 @@ const makeV9RentalsApi = ({ config, options }) => {
|
|
|
6377
6542
|
rentalHighlightPrioritization: [...options.rentalHighlightPrioritization],
|
|
6378
6543
|
rentalPropertyHighlightPrioritization: [...options.rentalPropertyHighlightPrioritization],
|
|
6379
6544
|
customAttributes: options.customAttributes,
|
|
6380
|
-
v9PropertyHighlightSources: options.v9PropertyHighlightSources
|
|
6545
|
+
v9PropertyHighlightSources: options.v9PropertyHighlightSources,
|
|
6546
|
+
reviews: options.v9Reviews
|
|
6381
6547
|
})));
|
|
6382
6548
|
})) };
|
|
6383
6549
|
};
|
|
@@ -6425,7 +6591,8 @@ function createWebsiteSDK({ config, options }) {
|
|
|
6425
6591
|
contact: { submit: contact.submit },
|
|
6426
6592
|
search: {
|
|
6427
6593
|
search: search.search,
|
|
6428
|
-
mapSearch: search.mapSearch
|
|
6594
|
+
mapSearch: search.mapSearch,
|
|
6595
|
+
searchPages: search.searchPages
|
|
6429
6596
|
},
|
|
6430
6597
|
availability: {
|
|
6431
6598
|
getInitialAvailability: availability.getInitialAvailability,
|
|
@@ -6494,4 +6661,4 @@ function createWebsiteSDK({ config, options }) {
|
|
|
6494
6661
|
return sdk;
|
|
6495
6662
|
}
|
|
6496
6663
|
//#endregion
|
|
6497
|
-
export {
|
|
6664
|
+
export { SearchPropertiesResponseSchema as $, ErgoBankSchema as A, getStartDateSelectedAvailabilityEffect as At, OnOfficeUnitCollectionResponseSchema as B, submitPaymentOption as Bt, DocumentResourceResponseSchema as C, bookInsuranceEffect as Ct, DocumentSummarySchema as D, getFiltersEffect as Dt, DocumentStatusUpdateRequestSchema as E, getBankTransferDetailsEffect as Et, ErgoPlanSearchRequestSchema as F, searchEffect as Ft, QuotePricesPayloadSchema as G, V9_FACILITY_ATTRIBUTE_KEYS as Gt, PaymentScheduleItemSchema as H, defineWebsiteSDKOptions as Ht, ErgoPolicyNumberRequestSchema as I, selectCancellationPolicyEffect as It, QuoteServiceSchema as J, QuotePricesResponseSchema$1 as K, ErgoReadPreContractRequestSchema as L, selectInsuranceEffect as Lt, ErgoCommonFieldsSchema as M, mapSearchEffect as Mt, ErgoCreatePreContractRequestSchema as N, quoteEffect as Nt, DocumentTypeSchema as O, getInitialAvailabilityEffect as Ot, ErgoPersonSchema as P, removeAdditionalServiceEffect as Pt, RoomImageSchema as Q, ErgoTripAndCustomerRequestSchema as R, selectInsurancePaymentEffect as Rt, DocumentCollectionResponseSchema as S, bookEffect as St, DocumentStatusSchema as T, createInsurancePreContractEffect as Tt, PaymentScheduleSchema$1 as U, defineV9PropertyHighlightSources as Ut, OnOfficeUnitSchema as V, submitPaymentOptionEffect as Vt, QuoteLineSchema$1 as W, defineV9PropertyHighlightSourcesFromUnknown as Wt, RawVofficeObjectSchema as X, RawObjectResponseSchema as Y, RegionListResponseSchema as Z, ApiEnvelopeBaseSchema as _, V1_BASE_URL as _t, parseQueryParameters as a, SetupResponseSchema as at, CurrentMemberResponseSchema as b, decodeV1OperationResponse as bt, makeV9GraphQLClient as c, TileTagSchema as ct, makeV0OpenApiClientFetchLive as d, UnitIdsResponseSchema as dt, ServiceBeonDataSchema as et, makeV0OpenApiClientLive as f, UnitListItemSchema as ft, makeV1OpenApiClientLive as g, UnitServicePriceSchema as gt, makeV1OpenApiClientFetchLive as h, UnitResponseSchema as ht, collectQueryParameters as i, SetupDataSchema as it, ErgoBookRequestSchema as j, getTermsAndPrivacyPolicyEffect as jt, ErgoAddressSchema as k, getRentalsEffect as kt, V0OpenApiClient as l, TravelInsuranceBookingSchema as lt, V1OpenApiClientError as m, UnitOfferSchema as mt, makeV9CustomAttributeFilterCapabilities as n, ServiceLimitSchema as nt, toQueryString as o, TileCollectionResponseSchema as ot, V1OpenApiClient as p, UnitListResponseSchema as pt, QuoteSchema as q, toBasicQueryInputs as r, ServiceListResponseSchema as rt, applyVofficeFilterDerivedBasicQueryInputs as s, TileSchema as st, createWebsiteSDK as t, ServiceImageSchema as tt, V0OpenApiClientError as u, TravelInsuranceBookingStoreRequestSchema as ut, CalendarDaySchema as v, V1_OPERATIONS as vt, DocumentResourceSchema as w, clearAdditionalServicesEffect as wt, CustomerUnitSummarySchema as x, addAdditionalServiceEffect as xt, CalendarResponseSchema$1 as y, VideoResponseSchema as yt, FacilityListResponseSchema as z, submitContactEffect as zt };
|