@v-office/website-sdk 2.27.0 → 2.28.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/dist/cli.mjs +2 -2
- package/dist/{client-DB3QXXOo.mjs → client-EtS0Qm3i.mjs} +59 -17
- package/dist/index.d.mts +14 -3
- package/dist/index.mjs +1 -1
- package/dist/instructions/CHANGELOG.md +2 -0
- package/dist/instructions/MIGRATION.md +2 -0
- package/dist/instructions/availability.md +25 -0
- package/dist/instructions/versions/2.28.0/CHANGELOG.md +27 -0
- package/dist/instructions/versions/2.28.0/MIGRATION.md +28 -0
- package/dist/instructions/versions/2.28.1/CHANGELOG.md +16 -0
- package/dist/instructions/versions/2.28.1/MIGRATION.md +11 -0
- package/dist/{rentals-DG0ofi7C.mjs → rentals-B4g91vwW.mjs} +1 -1
- package/dist/{search-CZSFERmD.mjs → search-B-lvOmXL.mjs} +1 -1
- package/instructions/CHANGELOG.md +2 -0
- package/instructions/MIGRATION.md +2 -0
- package/instructions/availability.md +25 -0
- package/instructions/versions/2.28.0/CHANGELOG.md +27 -0
- package/instructions/versions/2.28.0/MIGRATION.md +28 -0
- package/instructions/versions/2.28.0/release.json +3 -0
- package/instructions/versions/2.28.1/CHANGELOG.md +16 -0
- package/instructions/versions/2.28.1/MIGRATION.md +11 -0
- package/instructions/versions/2.28.1/release.json +3 -0
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { Ht as defineWebsiteSDKOptions, Wt as defineV9PropertyHighlightSourcesFromUnknown, c as makeV9GraphQLClient, d as makeV0OpenApiClientFetchLive, l as V0OpenApiClient, t as createWebsiteSDK } from "./client-
|
|
2
|
+
import { Ht as defineWebsiteSDKOptions, Wt as defineV9PropertyHighlightSourcesFromUnknown, c as makeV9GraphQLClient, d as makeV0OpenApiClientFetchLive, l as V0OpenApiClient, t as createWebsiteSDK } from "./client-EtS0Qm3i.mjs";
|
|
3
3
|
import { c as parseVofficeRatingData } from "./v9-data-C3SWtDGs.mjs";
|
|
4
4
|
import { s as rentalsAllWithoutFeedbacksQuery } from "./operations-DwURbo0b.mjs";
|
|
5
5
|
import { SearchSearchSortSchema, defineCustomAttributesFromUnknown } from "@v-office/sdk-core";
|
|
@@ -18,7 +18,7 @@ var CLICheckFailed = class extends Error {
|
|
|
18
18
|
const toCLIError = (message, cause) => cause instanceof Error ? new CLICheckFailed(`${message}: ${cause.message}`, { cause }) : new CLICheckFailed(message, { cause });
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region package.json
|
|
21
|
-
var version = "2.
|
|
21
|
+
var version = "2.28.1";
|
|
22
22
|
//#endregion
|
|
23
23
|
//#region src/cli/output.ts
|
|
24
24
|
const toJson = (value) => Effect.try({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as customDataAttribute } from "./v9-data-C3SWtDGs.mjs";
|
|
1
|
+
import { a as customDataAttribute, l as parseVofficeUnitData } 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";
|
|
@@ -1636,10 +1636,14 @@ const toChangeOverAtDay = (changeOver) => {
|
|
|
1636
1636
|
//#region src/legacy-v9/parser/availability/to-availability-restrictions-by-date.ts
|
|
1637
1637
|
const toAvailabilityRestrictionsByDate = ({ availability }) => {
|
|
1638
1638
|
const availabilityRestrictionsByDate = {};
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1639
|
+
const lastCheckOutDate = availability.max_date;
|
|
1640
|
+
for (const [date, day] of Object.entries(availability.caldata_beon)) {
|
|
1641
|
+
const isPricedNight = lastCheckOutDate === null || date < lastCheckOutDate;
|
|
1642
|
+
availabilityRestrictionsByDate[date] = {
|
|
1643
|
+
minStay: day.class === "unavailable" || !isPricedNight ? 0 : day.minStay,
|
|
1644
|
+
changeOver: toChangeOverAtDay(day.changeOver)
|
|
1645
|
+
};
|
|
1646
|
+
}
|
|
1643
1647
|
return availabilityRestrictionsByDate;
|
|
1644
1648
|
};
|
|
1645
1649
|
//#endregion
|
|
@@ -1668,6 +1672,41 @@ const toInitialAvailabilityCalendarDays$1 = ({ availability, currency, ...input
|
|
|
1668
1672
|
...currency === void 0 ? {} : { currency }
|
|
1669
1673
|
})));
|
|
1670
1674
|
//#endregion
|
|
1675
|
+
//#region src/legacy-v9/parser/availability/to-occupancy-limits.ts
|
|
1676
|
+
const NO_OCCUPANCY_LIMITS = {
|
|
1677
|
+
minPersons: null,
|
|
1678
|
+
maxPersons: null,
|
|
1679
|
+
maxAdults: null,
|
|
1680
|
+
childrenAllowed: null,
|
|
1681
|
+
maxPets: null
|
|
1682
|
+
};
|
|
1683
|
+
const MAX_PETS_BY_RESTRICTION = {
|
|
1684
|
+
0: 1,
|
|
1685
|
+
1: 2,
|
|
1686
|
+
2: 3,
|
|
1687
|
+
3: 0,
|
|
1688
|
+
4: 4
|
|
1689
|
+
};
|
|
1690
|
+
const toPositiveCount = (value) => value !== void 0 && Number.isInteger(value) && value > 0 ? value : null;
|
|
1691
|
+
const toMaxPets = (unit) => {
|
|
1692
|
+
const { pets, petsRestrictions } = unit.known;
|
|
1693
|
+
if (pets === void 0) return null;
|
|
1694
|
+
if (pets === 0) return 0;
|
|
1695
|
+
if (petsRestrictions === void 0) return null;
|
|
1696
|
+
return MAX_PETS_BY_RESTRICTION[petsRestrictions] ?? null;
|
|
1697
|
+
};
|
|
1698
|
+
const toOccupancyLimits = ({ unit }) => {
|
|
1699
|
+
const maxPersons = toPositiveCount(unit.known.beds);
|
|
1700
|
+
const { childrenWelcome } = unit.known;
|
|
1701
|
+
return {
|
|
1702
|
+
minPersons: toPositiveCount(unit.known.minpersons),
|
|
1703
|
+
maxPersons,
|
|
1704
|
+
maxAdults: maxPersons === null ? null : Math.max(maxPersons - (toPositiveCount(unit.known.beds4kids) ?? 0), 0),
|
|
1705
|
+
childrenAllowed: childrenWelcome === void 0 ? null : childrenWelcome !== 0,
|
|
1706
|
+
maxPets: toMaxPets(unit)
|
|
1707
|
+
};
|
|
1708
|
+
};
|
|
1709
|
+
//#endregion
|
|
1671
1710
|
//#region translations/v9/de-DE/core.json
|
|
1672
1711
|
var core_default$1 = {
|
|
1673
1712
|
"Rental.rentalType.option.HOUSE": "Haus",
|
|
@@ -3199,7 +3238,7 @@ const makeV9AvailabilityApi = ({ config, options }) => {
|
|
|
3199
3238
|
apiKey: config.apiKey,
|
|
3200
3239
|
...config.v1ApiBaseUrl === void 0 ? {} : { baseUrl: config.v1ApiBaseUrl }
|
|
3201
3240
|
});
|
|
3202
|
-
const
|
|
3241
|
+
const unitDetailsByUnitId = /* @__PURE__ */ new Map();
|
|
3203
3242
|
const loadAvailability = (input) => Effect.gen(function* () {
|
|
3204
3243
|
const client = yield* V1OpenApiClient;
|
|
3205
3244
|
const unitId = yield* toVofficeUnitId$2(input);
|
|
@@ -3213,23 +3252,28 @@ const makeV9AvailabilityApi = ({ config, options }) => {
|
|
|
3213
3252
|
cause
|
|
3214
3253
|
})))).data;
|
|
3215
3254
|
}).pipe(Effect.provide(openApiClientLive));
|
|
3216
|
-
const
|
|
3255
|
+
const loadUnitDetails = (input) => Effect.gen(function* () {
|
|
3217
3256
|
const client = yield* V1OpenApiClient;
|
|
3218
3257
|
const unitId = yield* toVofficeUnitId$2(input);
|
|
3219
|
-
|
|
3258
|
+
const cached = unitDetailsByUnitId.get(unitId);
|
|
3259
|
+
if (cached !== void 0) return cached;
|
|
3220
3260
|
const result = yield* client.execute("getUnit", { path: { voffice_unit: unitId } }).pipe(Effect.match({
|
|
3221
3261
|
onFailure: () => void 0,
|
|
3222
3262
|
onSuccess: (result) => result
|
|
3223
3263
|
}));
|
|
3224
3264
|
if (result === void 0) return void 0;
|
|
3225
|
-
const
|
|
3226
|
-
|
|
3227
|
-
|
|
3265
|
+
const details = {
|
|
3266
|
+
currency: firstString(result.data.data.currency),
|
|
3267
|
+
occupancyLimits: toOccupancyLimits({ unit: parseVofficeUnitData(result.data.data) })
|
|
3268
|
+
};
|
|
3269
|
+
unitDetailsByUnitId.set(unitId, details);
|
|
3270
|
+
return details;
|
|
3228
3271
|
}).pipe(Effect.provide(openApiClientLive));
|
|
3229
3272
|
return {
|
|
3230
3273
|
getInitialAvailability: (input) => Effect.runPromise(Effect.gen(function* () {
|
|
3231
3274
|
const now = yield* DateTime.now;
|
|
3232
|
-
const [availability,
|
|
3275
|
+
const [availability, unitDetails] = yield* Effect.all([loadAvailability(input), loadUnitDetails(input)]);
|
|
3276
|
+
const currency = unitDetails?.currency;
|
|
3233
3277
|
const firstCalculationDate = toFirstCalculationDate({
|
|
3234
3278
|
availability,
|
|
3235
3279
|
now
|
|
@@ -3244,9 +3288,7 @@ const makeV9AvailabilityApi = ({ config, options }) => {
|
|
|
3244
3288
|
translations,
|
|
3245
3289
|
...currency === void 0 ? {} : { currency }
|
|
3246
3290
|
}),
|
|
3247
|
-
|
|
3248
|
-
maxPersons: null,
|
|
3249
|
-
maxAdults: null
|
|
3291
|
+
...unitDetails?.occupancyLimits ?? NO_OCCUPANCY_LIMITS
|
|
3250
3292
|
};
|
|
3251
3293
|
})),
|
|
3252
3294
|
getStartDateSelectedAvailability: (input) => Effect.runPromise(Effect.gen(function* () {
|
|
@@ -5857,7 +5899,7 @@ const parseV9SearchCursor = (cursor) => Effect.gen(function* () {
|
|
|
5857
5899
|
return page;
|
|
5858
5900
|
});
|
|
5859
5901
|
const loadV9SearchRuntime = Effect.tryPromise({
|
|
5860
|
-
try: () => import("./search-
|
|
5902
|
+
try: () => import("./search-B-lvOmXL.mjs"),
|
|
5861
5903
|
catch: (cause) => new CoreSDKError({
|
|
5862
5904
|
source: "v9",
|
|
5863
5905
|
operation: "v9.search.runtime",
|
|
@@ -6504,7 +6546,7 @@ const orderRentalsById = ({ rentalIds, rentals }) => {
|
|
|
6504
6546
|
});
|
|
6505
6547
|
};
|
|
6506
6548
|
const loadV9RentalsRuntime = Effect.tryPromise({
|
|
6507
|
-
try: () => import("./rentals-
|
|
6549
|
+
try: () => import("./rentals-B4g91vwW.mjs"),
|
|
6508
6550
|
catch: (cause) => new CoreSDKError({
|
|
6509
6551
|
source: "v9",
|
|
6510
6552
|
operation: "v9.rentals.runtime",
|
package/dist/index.d.mts
CHANGED
|
@@ -90,6 +90,12 @@ type WebsiteSDKOptions = {
|
|
|
90
90
|
};
|
|
91
91
|
export declare const defineWebsiteSDKOptions: <Options extends WebsiteSDKOptions>(options: Options) => Options;
|
|
92
92
|
//#endregion
|
|
93
|
+
//#region src/legacy-v9/availability-output.d.ts
|
|
94
|
+
type V9InitialAvailabilityOutput = AvailabilityGetInitialAvailabilityOutput$1 & {
|
|
95
|
+
readonly childrenAllowed: boolean | null;
|
|
96
|
+
readonly maxPets: number | null;
|
|
97
|
+
};
|
|
98
|
+
//#endregion
|
|
93
99
|
//#region src/legacy-v9/search-input.d.ts
|
|
94
100
|
type V9SearchSearchSort = Exclude<SearchSearchSort$1, SearchSearchFieldSort$1>;
|
|
95
101
|
type V9SearchSearchInput = Omit<SearchSearchInput$1, "rentalIdsIn" | "voucher" | "sort"> & {
|
|
@@ -179,7 +185,11 @@ type WebsiteSDKV10AllRentalsAtOnceLive = Omit<WebsiteSDKSharedLive, "search"> &
|
|
|
179
185
|
readonly search: (input: SearchAllRentalsAtOnceInput$1) => Promise<SearchSearchOutput$1>;
|
|
180
186
|
};
|
|
181
187
|
};
|
|
182
|
-
type
|
|
188
|
+
type WebsiteSDKV9LiveAvailability = Omit<WebsiteSDKSharedLive["availability"], "getInitialAvailability"> & {
|
|
189
|
+
readonly getInitialAvailability: (input: AvailabilityGetInitialAvailabilityInput$1) => Promise<V9InitialAvailabilityOutput>;
|
|
190
|
+
};
|
|
191
|
+
type WebsiteSDKV9Live = Omit<WebsiteSDKSharedLive, "search" | "availability"> & {
|
|
192
|
+
readonly availability: WebsiteSDKV9LiveAvailability;
|
|
183
193
|
readonly search: {
|
|
184
194
|
readonly search: (input: V9SearchSearchInput) => Promise<V9SearchSearchOutput>;
|
|
185
195
|
readonly mapSearch: WebsiteSDKSharedLive["search"]["mapSearch"];
|
|
@@ -187,7 +197,8 @@ type WebsiteSDKV9Live = Omit<WebsiteSDKSharedLive, "search"> & {
|
|
|
187
197
|
};
|
|
188
198
|
};
|
|
189
199
|
/** `live` of a v9 SDK created with `searchAllRentalsAtOnce: true`. */
|
|
190
|
-
type WebsiteSDKV9AllRentalsAtOnceLive = Omit<WebsiteSDKSharedLive, "search"> & {
|
|
200
|
+
type WebsiteSDKV9AllRentalsAtOnceLive = Omit<WebsiteSDKSharedLive, "search" | "availability"> & {
|
|
201
|
+
readonly availability: WebsiteSDKV9LiveAvailability;
|
|
191
202
|
readonly search: {
|
|
192
203
|
/** Every result with its price in one call; at most `SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS`. */
|
|
193
204
|
readonly search: (input: V9SearchAllRentalsAtOnceInput) => Promise<V9SearchSearchOutput>;
|
|
@@ -7617,4 +7628,4 @@ export type RentalRentalsOutput = RentalGetRentalsOutput$1[number];
|
|
|
7617
7628
|
export type RentalSearchInput = SearchSearchInput$1;
|
|
7618
7629
|
export type RentalSearchOutput = SearchSearchOutput$1;
|
|
7619
7630
|
//#endregion
|
|
7620
|
-
export { AdditionalServiceLimitExceeded, type AvailabilityGetInitialAvailabilityInput, type AvailabilityGetInitialAvailabilityOutput, type AvailabilityGetStartDateSelectedAvailabilityInput, type AvailabilityGetStartDateSelectedAvailabilityOutput, type BackendKind, type BookingBankTransferDetails, type BookingBookInput, type BookingBookOutput, type BookingPayment, type BookingPaymentAlternative, type BookingPaymentOption, type BookingPaymentScheduleItem, type BookingPaymentScheduleKind, type BookingPaymentScheduleLine, CMSError, type ContactSubmitInput, type ContactSubmitOutput, type ContactSubmitValidationIssue, type ContactSubmitValidationIssueCode, CoreSDKError, type CustomAttributeCatalog, type CustomAttributeCatalogDefinitionInput, type CustomAttributeCatalogInput, CustomAttributeCatalogSchema, type CustomAttributeCategoryKey, type CustomAttributeFilterCategoryKey, type CustomAttributeFilterDefinition, type CustomAttributeFilterExpression, type CustomAttributeFilterLabel, type CustomAttributeFilterNumericBounds, type CustomAttributeFilterOption, type CustomAttributeOverridesInput, type CustomAttributeRegistry, type CustomAttributeRegistrySnapshot, type CustomAttributeSelection, type CustomDataAttribute, type DataAttribute, type DocumentsGetTermsAndPrivacyPolicyInput, type DocumentsGetTermsAndPrivacyPolicyOutput, type FilterGetFiltersInput, type FilterGetFiltersOutput, type GeoLocation, type GuestQuote, type GuestQuoteInput, type GuestQuoteInsurance, type GuestQuoteResult, GuestQuoteSchema, type GuestQuoteSelectionResult, type GuestQuoteVoucher, type ImageData, type InsuranceBookingOutput, type InsuranceCustomerInformationInput, type InsurancePaymentInformationInput, type InsurancePaymentOptionOutput, type InsurancePreContractOutput, InvalidAdditionalServiceQuantity, type KnownVofficeFacilityData, type KnownVofficeFacilityDataAttribute, type KnownVofficeFeedbackData, type KnownVofficeFeedbackDataAttribute, type KnownVofficeImageData, type KnownVofficeImageDataAttribute, type KnownVofficeOfferData, type KnownVofficeOfferDataAttribute, type KnownVofficePriceData, type KnownVofficePriceDataAttribute, type KnownVofficeRatingData, type KnownVofficeRatingDataAttribute, type KnownVofficeServiceData, type KnownVofficeServiceDataAttribute, type KnownVofficeTotalRatingData, type KnownVofficeTotalRatingDataAttribute, type KnownVofficeUnitData, type KnownVofficeUnitDataAttribute, type Locale, LocaleSchema, type ParsedJsonData, type ParsedVofficeFacilityData, type ParsedVofficeFeedbackData, type ParsedVofficeImageData, type ParsedVofficeOfferData, type ParsedVofficePriceData, type ParsedVofficeRatingData, type ParsedVofficeServiceData, type ParsedVofficeTotalRatingData, type ParsedVofficeUnitData, type QuoteQuoteInput, type QuoteQuoteOutput, type RentalGetRentalsInput, type RentalGetRentalsOutput, type RentalHighlightPrioritizationKey, type RentalPropertyHighlightPrioritizationKey, type ResolvedCustomAttribute, type ResolvedV9PropertyHighlightSource, SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS, type SearchAllRentalsAtOnceInput, type SearchMapSearchInput, SearchMapSearchInputSchema, type SearchMapSearchOutput, type SearchMapSearchOutputItem, SearchMapSearchOutputSchema, type SearchSearchFieldOrderBy, SearchSearchFieldOrderBySchema, type SearchSearchFieldSort, SearchSearchFieldSortSchema, type SearchSearchInput, SearchSearchInputSchema, type SearchSearchOutput, SearchSearchOutputSchema, type SearchSearchPriceSort, SearchSearchPriceSortSchema, type SearchSearchRandomSort, SearchSearchRandomSortSchema, type SearchSearchRatingSort, SearchSearchRatingSortSchema, type SearchSearchSort, SearchSearchSortSchema, type SearchSortDirection, SearchSortDirectionSchema, type SelectableInsuranceOptionOutput, type SelectedInsuranceInformationInput, type SubmittableBookingPaymentOption, type TranslationOverrides, UnknownAdditionalService, type V0OpenApiClientOptions, type V0OpenApiOperationId, type V0OpenApiOperationRequest, type V0OpenApiOperationResponse, type V1OpenApiClientOptions, type components as V1OpenApiComponents, type V1OpenApiOperationId, type V1OpenApiOperationRequest, type V1OpenApiOperationResponse, type operations as V1OpenApiOperations, type paths as V1OpenApiPaths, type V9OnlyCustomAttributeInput, type V9PropertyHighlightDataAttribute, type V9PropertyHighlightSourceInput, type V9PropertyHighlightSourceRegistry, type V9PropertyHighlightSourcesInput, type V9ReviewCriterion, type V9ReviewCriterionDataAttribute, type V9ReviewsOptions, type V9SearchAllRentalsAtOnceInput, type V9SearchPagesInput, type V9SearchSearchInput, type V9SearchSearchOutput, type V9SearchSearchOutputItem, type V9SearchSearchSort, type VofficeFacilityDataAttribute, type VofficeFacilityDataAttributes, type VofficeFeedbackDataAttribute, type VofficeFeedbackDataAttributes, type VofficeImageDataAttribute, type VofficeImageDataAttributes, type VofficeOfferDataAttribute, type VofficeOfferDataAttributes, type VofficePriceDataAttribute, type VofficePriceDataAttributes, type VofficeRatingDataAttribute, type VofficeRatingDataAttributes, type VofficeServiceDataAttribute, type VofficeServiceDataAttributes, type VofficeTotalRatingDataAttribute, type VofficeTotalRatingDataAttributes, type VofficeUnitDataAttribute, type VofficeUnitDataAttributes, type WebsiteSDK, type WebsiteSDKAllRentalsAtOnce, type WebsiteSDKConfig, type WebsiteSDKOptions, type WebsiteSDKSharedLive, type WebsiteSDKSharedStatic, type WebsiteSDKV10, type WebsiteSDKV10AllRentalsAtOnce, type WebsiteSDKV10AllRentalsAtOnceLive, type WebsiteSDKV10Live, type WebsiteSDKV10Static, type WebsiteSDKV9, type WebsiteSDKV9AllRentalsAtOnce, type WebsiteSDKV9AllRentalsAtOnceLive, type WebsiteSDKV9Live, defineWebsiteSDKOptions as defineCMSSDKOptions, defineCustomAttributes, defineCustomAttributesFromUnknown, fetchCustomAttributeCatalog, parseCustomAttributeCatalog, validateContactSubmitInput };
|
|
7631
|
+
export { AdditionalServiceLimitExceeded, type AvailabilityGetInitialAvailabilityInput, type AvailabilityGetInitialAvailabilityOutput, type AvailabilityGetStartDateSelectedAvailabilityInput, type AvailabilityGetStartDateSelectedAvailabilityOutput, type BackendKind, type BookingBankTransferDetails, type BookingBookInput, type BookingBookOutput, type BookingPayment, type BookingPaymentAlternative, type BookingPaymentOption, type BookingPaymentScheduleItem, type BookingPaymentScheduleKind, type BookingPaymentScheduleLine, CMSError, type ContactSubmitInput, type ContactSubmitOutput, type ContactSubmitValidationIssue, type ContactSubmitValidationIssueCode, CoreSDKError, type CustomAttributeCatalog, type CustomAttributeCatalogDefinitionInput, type CustomAttributeCatalogInput, CustomAttributeCatalogSchema, type CustomAttributeCategoryKey, type CustomAttributeFilterCategoryKey, type CustomAttributeFilterDefinition, type CustomAttributeFilterExpression, type CustomAttributeFilterLabel, type CustomAttributeFilterNumericBounds, type CustomAttributeFilterOption, type CustomAttributeOverridesInput, type CustomAttributeRegistry, type CustomAttributeRegistrySnapshot, type CustomAttributeSelection, type CustomDataAttribute, type DataAttribute, type DocumentsGetTermsAndPrivacyPolicyInput, type DocumentsGetTermsAndPrivacyPolicyOutput, type FilterGetFiltersInput, type FilterGetFiltersOutput, type GeoLocation, type GuestQuote, type GuestQuoteInput, type GuestQuoteInsurance, type GuestQuoteResult, GuestQuoteSchema, type GuestQuoteSelectionResult, type GuestQuoteVoucher, type ImageData, type InsuranceBookingOutput, type InsuranceCustomerInformationInput, type InsurancePaymentInformationInput, type InsurancePaymentOptionOutput, type InsurancePreContractOutput, InvalidAdditionalServiceQuantity, type KnownVofficeFacilityData, type KnownVofficeFacilityDataAttribute, type KnownVofficeFeedbackData, type KnownVofficeFeedbackDataAttribute, type KnownVofficeImageData, type KnownVofficeImageDataAttribute, type KnownVofficeOfferData, type KnownVofficeOfferDataAttribute, type KnownVofficePriceData, type KnownVofficePriceDataAttribute, type KnownVofficeRatingData, type KnownVofficeRatingDataAttribute, type KnownVofficeServiceData, type KnownVofficeServiceDataAttribute, type KnownVofficeTotalRatingData, type KnownVofficeTotalRatingDataAttribute, type KnownVofficeUnitData, type KnownVofficeUnitDataAttribute, type Locale, LocaleSchema, type ParsedJsonData, type ParsedVofficeFacilityData, type ParsedVofficeFeedbackData, type ParsedVofficeImageData, type ParsedVofficeOfferData, type ParsedVofficePriceData, type ParsedVofficeRatingData, type ParsedVofficeServiceData, type ParsedVofficeTotalRatingData, type ParsedVofficeUnitData, type QuoteQuoteInput, type QuoteQuoteOutput, type RentalGetRentalsInput, type RentalGetRentalsOutput, type RentalHighlightPrioritizationKey, type RentalPropertyHighlightPrioritizationKey, type ResolvedCustomAttribute, type ResolvedV9PropertyHighlightSource, SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS, type SearchAllRentalsAtOnceInput, type SearchMapSearchInput, SearchMapSearchInputSchema, type SearchMapSearchOutput, type SearchMapSearchOutputItem, SearchMapSearchOutputSchema, type SearchSearchFieldOrderBy, SearchSearchFieldOrderBySchema, type SearchSearchFieldSort, SearchSearchFieldSortSchema, type SearchSearchInput, SearchSearchInputSchema, type SearchSearchOutput, SearchSearchOutputSchema, type SearchSearchPriceSort, SearchSearchPriceSortSchema, type SearchSearchRandomSort, SearchSearchRandomSortSchema, type SearchSearchRatingSort, SearchSearchRatingSortSchema, type SearchSearchSort, SearchSearchSortSchema, type SearchSortDirection, SearchSortDirectionSchema, type SelectableInsuranceOptionOutput, type SelectedInsuranceInformationInput, type SubmittableBookingPaymentOption, type TranslationOverrides, UnknownAdditionalService, type V0OpenApiClientOptions, type V0OpenApiOperationId, type V0OpenApiOperationRequest, type V0OpenApiOperationResponse, type V1OpenApiClientOptions, type components as V1OpenApiComponents, type V1OpenApiOperationId, type V1OpenApiOperationRequest, type V1OpenApiOperationResponse, type operations as V1OpenApiOperations, type paths as V1OpenApiPaths, type V9InitialAvailabilityOutput, type V9OnlyCustomAttributeInput, type V9PropertyHighlightDataAttribute, type V9PropertyHighlightSourceInput, type V9PropertyHighlightSourceRegistry, type V9PropertyHighlightSourcesInput, type V9ReviewCriterion, type V9ReviewCriterionDataAttribute, type V9ReviewsOptions, type V9SearchAllRentalsAtOnceInput, type V9SearchPagesInput, type V9SearchSearchInput, type V9SearchSearchOutput, type V9SearchSearchOutputItem, type V9SearchSearchSort, type VofficeFacilityDataAttribute, type VofficeFacilityDataAttributes, type VofficeFeedbackDataAttribute, type VofficeFeedbackDataAttributes, type VofficeImageDataAttribute, type VofficeImageDataAttributes, type VofficeOfferDataAttribute, type VofficeOfferDataAttributes, type VofficePriceDataAttribute, type VofficePriceDataAttributes, type VofficeRatingDataAttribute, type VofficeRatingDataAttributes, type VofficeServiceDataAttribute, type VofficeServiceDataAttributes, type VofficeTotalRatingDataAttribute, type VofficeTotalRatingDataAttributes, type VofficeUnitDataAttribute, type VofficeUnitDataAttributes, type WebsiteSDK, type WebsiteSDKAllRentalsAtOnce, type WebsiteSDKConfig, type WebsiteSDKOptions, type WebsiteSDKSharedLive, type WebsiteSDKSharedStatic, type WebsiteSDKV10, type WebsiteSDKV10AllRentalsAtOnce, type WebsiteSDKV10AllRentalsAtOnceLive, type WebsiteSDKV10Live, type WebsiteSDKV10Static, type WebsiteSDKV9, type WebsiteSDKV9AllRentalsAtOnce, type WebsiteSDKV9AllRentalsAtOnceLive, type WebsiteSDKV9Live, defineWebsiteSDKOptions as defineCMSSDKOptions, defineCustomAttributes, defineCustomAttributesFromUnknown, fetchCustomAttributeCatalog, parseCustomAttributeCatalog, validateContactSubmitInput };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as SearchPropertiesResponseSchema, A as ErgoBankSchema, At as getStartDateSelectedAvailabilityEffect, B as OnOfficeUnitCollectionResponseSchema, Bt as submitPaymentOption, C as DocumentResourceResponseSchema, Ct as bookInsuranceEffect, D as DocumentSummarySchema, Dt as getFiltersEffect, E as DocumentStatusUpdateRequestSchema, Et as getBankTransferDetailsEffect, F as ErgoPlanSearchRequestSchema, Ft as searchEffect, G as QuotePricesPayloadSchema, H as PaymentScheduleItemSchema, Ht as defineWebsiteSDKOptions, I as ErgoPolicyNumberRequestSchema, It as selectCancellationPolicyEffect, J as QuoteServiceSchema, K as QuotePricesResponseSchema, L as ErgoReadPreContractRequestSchema, Lt as selectInsuranceEffect, M as ErgoCommonFieldsSchema, Mt as mapSearchEffect, N as ErgoCreatePreContractRequestSchema, Nt as quoteEffect, O as DocumentTypeSchema, Ot as getInitialAvailabilityEffect, P as ErgoPersonSchema, Pt as removeAdditionalServiceEffect, Q as RoomImageSchema, R as ErgoTripAndCustomerRequestSchema, Rt as selectInsurancePaymentEffect, S as DocumentCollectionResponseSchema, St as bookEffect, T as DocumentStatusSchema, Tt as createInsurancePreContractEffect, U as PaymentScheduleSchema, Ut as defineV9PropertyHighlightSources, V as OnOfficeUnitSchema, Vt as submitPaymentOptionEffect, W as QuoteLineSchema, Wt as defineV9PropertyHighlightSourcesFromUnknown, X as RawVofficeObjectSchema, Y as RawObjectResponseSchema, Z as RegionListResponseSchema, _ as ApiEnvelopeBaseSchema, _t as V1_BASE_URL, at as SetupResponseSchema, b as CurrentMemberResponseSchema, bt as decodeV1OperationResponse, ct as TileTagSchema, d as makeV0OpenApiClientFetchLive, dt as UnitIdsResponseSchema, et as ServiceBeonDataSchema, f as makeV0OpenApiClientLive, ft as UnitListItemSchema, g as makeV1OpenApiClientLive, gt as UnitServicePriceSchema, h as makeV1OpenApiClientFetchLive, ht as UnitResponseSchema, it as SetupDataSchema, j as ErgoBookRequestSchema, jt as getTermsAndPrivacyPolicyEffect, k as ErgoAddressSchema, kt as getRentalsEffect, l as V0OpenApiClient, lt as TravelInsuranceBookingSchema, m as V1OpenApiClientError, mt as UnitOfferSchema, nt as ServiceLimitSchema, ot as TileCollectionResponseSchema, p as V1OpenApiClient, pt as UnitListResponseSchema, q as QuoteSchema, rt as ServiceListResponseSchema, st as TileSchema, t as createWebsiteSDK, tt as ServiceImageSchema, u as V0OpenApiClientError, ut as TravelInsuranceBookingStoreRequestSchema, v as CalendarDaySchema, vt as V1_OPERATIONS, w as DocumentResourceSchema, wt as clearAdditionalServicesEffect, x as CustomerUnitSummarySchema, xt as addAdditionalServiceEffect, y as CalendarResponseSchema, yt as VideoResponseSchema, z as FacilityListResponseSchema, zt as submitContactEffect } from "./client-
|
|
1
|
+
import { $ as SearchPropertiesResponseSchema, A as ErgoBankSchema, At as getStartDateSelectedAvailabilityEffect, B as OnOfficeUnitCollectionResponseSchema, Bt as submitPaymentOption, C as DocumentResourceResponseSchema, Ct as bookInsuranceEffect, D as DocumentSummarySchema, Dt as getFiltersEffect, E as DocumentStatusUpdateRequestSchema, Et as getBankTransferDetailsEffect, F as ErgoPlanSearchRequestSchema, Ft as searchEffect, G as QuotePricesPayloadSchema, H as PaymentScheduleItemSchema, Ht as defineWebsiteSDKOptions, I as ErgoPolicyNumberRequestSchema, It as selectCancellationPolicyEffect, J as QuoteServiceSchema, K as QuotePricesResponseSchema, L as ErgoReadPreContractRequestSchema, Lt as selectInsuranceEffect, M as ErgoCommonFieldsSchema, Mt as mapSearchEffect, N as ErgoCreatePreContractRequestSchema, Nt as quoteEffect, O as DocumentTypeSchema, Ot as getInitialAvailabilityEffect, P as ErgoPersonSchema, Pt as removeAdditionalServiceEffect, Q as RoomImageSchema, R as ErgoTripAndCustomerRequestSchema, Rt as selectInsurancePaymentEffect, S as DocumentCollectionResponseSchema, St as bookEffect, T as DocumentStatusSchema, Tt as createInsurancePreContractEffect, U as PaymentScheduleSchema, Ut as defineV9PropertyHighlightSources, V as OnOfficeUnitSchema, Vt as submitPaymentOptionEffect, W as QuoteLineSchema, Wt as defineV9PropertyHighlightSourcesFromUnknown, X as RawVofficeObjectSchema, Y as RawObjectResponseSchema, Z as RegionListResponseSchema, _ as ApiEnvelopeBaseSchema, _t as V1_BASE_URL, at as SetupResponseSchema, b as CurrentMemberResponseSchema, bt as decodeV1OperationResponse, ct as TileTagSchema, d as makeV0OpenApiClientFetchLive, dt as UnitIdsResponseSchema, et as ServiceBeonDataSchema, f as makeV0OpenApiClientLive, ft as UnitListItemSchema, g as makeV1OpenApiClientLive, gt as UnitServicePriceSchema, h as makeV1OpenApiClientFetchLive, ht as UnitResponseSchema, it as SetupDataSchema, j as ErgoBookRequestSchema, jt as getTermsAndPrivacyPolicyEffect, k as ErgoAddressSchema, kt as getRentalsEffect, l as V0OpenApiClient, lt as TravelInsuranceBookingSchema, m as V1OpenApiClientError, mt as UnitOfferSchema, nt as ServiceLimitSchema, ot as TileCollectionResponseSchema, p as V1OpenApiClient, pt as UnitListResponseSchema, q as QuoteSchema, rt as ServiceListResponseSchema, st as TileSchema, t as createWebsiteSDK, tt as ServiceImageSchema, u as V0OpenApiClientError, ut as TravelInsuranceBookingStoreRequestSchema, v as CalendarDaySchema, vt as V1_OPERATIONS, w as DocumentResourceSchema, wt as clearAdditionalServicesEffect, x as CustomerUnitSummarySchema, xt as addAdditionalServiceEffect, y as CalendarResponseSchema, yt as VideoResponseSchema, z as FacilityListResponseSchema, zt as submitContactEffect } from "./client-EtS0Qm3i.mjs";
|
|
2
2
|
import { AdditionalServiceLimitExceeded, CoreSDKError, CoreSDKError as CMSError, CustomAttributeCatalogSchema, GuestQuoteSchema, InvalidAdditionalServiceQuantity, LocaleSchema, SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS, SearchMapSearchInputSchema, SearchMapSearchOutputSchema, SearchSearchFieldOrderBySchema, SearchSearchFieldSortSchema, SearchSearchInputSchema, SearchSearchOutputSchema, SearchSearchPriceSortSchema, SearchSearchRandomSortSchema, SearchSearchRatingSortSchema, SearchSearchSortSchema, SearchSortDirectionSchema, UnknownAdditionalService, defineCustomAttributes, defineCustomAttributesFromUnknown, fetchCustomAttributeCatalog, parseCustomAttributeCatalog, validateContactSubmitInput } from "@v-office/sdk-core";
|
|
3
3
|
//#region codegen/v9/heuristic-generation/public-api.ts
|
|
4
4
|
const customDataAttribute = (name) => name;
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
Release notes of `@v-office/website-sdk`, newest first. Each version has its own directory.
|
|
6
6
|
|
|
7
|
+
- `versions/2.28.1/CHANGELOG.md`: release notes for 2.28.1
|
|
8
|
+
- `versions/2.28.0/CHANGELOG.md`: release notes for 2.28.0
|
|
7
9
|
- `versions/2.27.0/CHANGELOG.md`: release notes for 2.27.0
|
|
8
10
|
- `versions/2.26.0/CHANGELOG.md`: release notes for 2.26.0
|
|
9
11
|
- `versions/2.25.0/CHANGELOG.md`: release notes for 2.25.0
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
Migration guides of `@v-office/website-sdk`, newest first. Apply them in order when skipping versions.
|
|
6
6
|
|
|
7
|
+
- `versions/2.28.1/MIGRATION.md`: Migration: 2.28.0 to 2.28.1
|
|
8
|
+
- `versions/2.28.0/MIGRATION.md`: Migration: 2.27.0 to 2.28.0
|
|
7
9
|
- `versions/2.27.0/MIGRATION.md`: Migration: 2.26.0 to 2.27.0
|
|
8
10
|
- `versions/2.26.0/MIGRATION.md`: Migration: 2.25.0 to 2.26.0
|
|
9
11
|
- `versions/2.25.0/MIGRATION.md`: Migration: 2.24.1 to 2.25.0
|
|
@@ -122,6 +122,31 @@ No new configuration is required. The currency lookup uses the existing
|
|
|
122
122
|
See `versions/2.18.0/CHANGELOG.md` and
|
|
123
123
|
`versions/2.18.0/MIGRATION.md`.
|
|
124
124
|
|
|
125
|
+
### Legacy v9 Occupancy Limits
|
|
126
|
+
|
|
127
|
+
From 2.28.0, v9 initial availability reads its occupancy limits from the same
|
|
128
|
+
unit record as the currency. They are the limits the v9 quote enforces:
|
|
129
|
+
|
|
130
|
+
- `maxPersons` is the number of sleeping places. Adults and children count
|
|
131
|
+
toward it, babies do not.
|
|
132
|
+
- `maxAdults` is `maxPersons` minus the sleeping places reserved for children.
|
|
133
|
+
- `minPersons` is the unit's minimum occupancy. Adults and children count
|
|
134
|
+
toward it, babies do not.
|
|
135
|
+
|
|
136
|
+
The v9 output (`V9InitialAvailabilityOutput`) has two more fields that v10 does
|
|
137
|
+
not return. Narrow on `sdk.backend === "v9"` to read them:
|
|
138
|
+
|
|
139
|
+
- `childrenAllowed` is `false` when the unit takes no children. The quote then
|
|
140
|
+
refuses babies too, so offer neither.
|
|
141
|
+
- `maxPets` is the most pets the quote accepts. `0` means the unit allows no
|
|
142
|
+
pets or takes them only on request.
|
|
143
|
+
|
|
144
|
+
A value is `null` when the unit does not state it or the unit request fails.
|
|
145
|
+
Treat `null` as no limit.
|
|
146
|
+
|
|
147
|
+
See `versions/2.28.0/CHANGELOG.md` and
|
|
148
|
+
`versions/2.28.0/MIGRATION.md`.
|
|
149
|
+
|
|
125
150
|
## Configuration
|
|
126
151
|
|
|
127
152
|
Use flat `WebsiteSDKConfig` files.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Changelog: 2.28.0
|
|
2
|
+
|
|
3
|
+
On v9, `getInitialAvailability` now states the occupancy rules the v9 quote enforces. Until
|
|
4
|
+
now `minPersons`, `maxPersons` and `maxAdults` were always `null` on v9, so a guest selector
|
|
5
|
+
had no limit and only the quote refused a party that did not fit the rental.
|
|
6
|
+
|
|
7
|
+
## Added
|
|
8
|
+
|
|
9
|
+
- v9 `sdk.live.availability.getInitialAvailability` returns two more fields:
|
|
10
|
+
- `childrenAllowed` is `false` when the rental takes no children. The quote then refuses
|
|
11
|
+
babies too.
|
|
12
|
+
- `maxPets` is the most pets the quote accepts: 1 to 4 for a rental with such a
|
|
13
|
+
restriction, `0` when the rental allows no pets or takes them only on request, `null`
|
|
14
|
+
when it sets no upper limit.
|
|
15
|
+
- Type `V9InitialAvailabilityOutput`, the v9 output of `getInitialAvailability`.
|
|
16
|
+
|
|
17
|
+
## Fixed
|
|
18
|
+
|
|
19
|
+
- v9 `getInitialAvailability` fills `minPersons`, `maxPersons` and `maxAdults` from the
|
|
20
|
+
rental. `maxPersons` is the number of sleeping places; adults and children count toward
|
|
21
|
+
it, babies do not. `maxAdults` leaves out the sleeping places reserved for children.
|
|
22
|
+
`minPersons` is the rental's minimum occupancy, again without babies.
|
|
23
|
+
|
|
24
|
+
All five values come from the rental record the availability already loads for the calendar
|
|
25
|
+
currency, so there is no additional request. A value the rental does not state stays `null`,
|
|
26
|
+
and so do all five when the rental record cannot be loaded; `null` means no limit. v10
|
|
27
|
+
availability is unchanged and has no `childrenAllowed` or `maxPets`.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Migration: 2.27.0 to 2.28.0
|
|
2
|
+
|
|
3
|
+
## 1. Upgrade
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pnpm add @v-office/website-sdk@2.28.0
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
No changes are required. On a v9 site, `minPersons`, `maxPersons` and `maxAdults` from
|
|
10
|
+
`getInitialAvailability` now carry numbers where they were `null`. A guest selector that
|
|
11
|
+
already caps at these values, such as the one in `@v-office/website-components`, caps v9
|
|
12
|
+
rentals from now on.
|
|
13
|
+
|
|
14
|
+
## 2. Optional: offer only what the v9 quote accepts
|
|
15
|
+
|
|
16
|
+
A site with its own guest selector can read `childrenAllowed` and `maxPets`. v10 does not
|
|
17
|
+
return them, so call the availability inside a check on the backend:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
if (sdk.backend === "v9") {
|
|
21
|
+
const { childrenAllowed, maxPets } = await sdk.live.availability.getInitialAvailability(input);
|
|
22
|
+
// childrenAllowed === false: offer neither children nor babies
|
|
23
|
+
// maxPets: the highest pet count to offer; 0 hides pets, null means no limit
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Keep a selection the guest arrived with visible until they remove it, for example children
|
|
28
|
+
handed over from the search, so a party the quote refuses can still be corrected.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Changelog: 2.28.1
|
|
2
|
+
|
|
3
|
+
On v9, the availability calendar now ends where the rental's prices end. Until now a guest
|
|
4
|
+
could pick dates after the last priced night; the calendar showed no price for them and the
|
|
5
|
+
quote then failed.
|
|
6
|
+
|
|
7
|
+
## Fixed
|
|
8
|
+
|
|
9
|
+
- v9 `sdk.live.availability.getInitialAvailability` no longer offers a check-in whose stay
|
|
10
|
+
runs past the last priced night. Days after the last priced night are unavailable and carry
|
|
11
|
+
no price.
|
|
12
|
+
- v9 `sdk.live.availability.getStartDateSelectedAvailability` offers the day after the last
|
|
13
|
+
priced night as the latest check-out and no day after it.
|
|
14
|
+
|
|
15
|
+
A rental whose prices have no end date keeps its calendar as before. v10 availability is
|
|
16
|
+
unchanged.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Migration: 2.28.0 to 2.28.1
|
|
2
|
+
|
|
3
|
+
## 1. Upgrade
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pnpm add @v-office/website-sdk@2.28.1
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
No changes are required. On a v9 site, days after the rental's last priced night come back
|
|
10
|
+
as unavailable from both availability calls, so a calendar built on them stops offering
|
|
11
|
+
those dates without any change.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Gt as V9_FACILITY_ATTRIBUTE_KEYS } from "./client-
|
|
1
|
+
import { Gt as V9_FACILITY_ATTRIBUTE_KEYS } from "./client-EtS0Qm3i.mjs";
|
|
2
2
|
import { i as VofficeUnitDataPropertyMetadata, l as parseVofficeUnitData, n as VofficeUnitDataPropertyCategoryLabelKeys, o as parseVofficeFacilityData, r as VofficeUnitDataPropertyCategoryValues, s as parseVofficeFeedbackData, t as VofficeUnitDataFieldSchemas } from "./v9-data-C3SWtDGs.mjs";
|
|
3
3
|
import { a as rentalsAllByFacilityObjectGroupsWithoutFeedbacksQuery, i as rentalIdsQuery, o as rentalsAllFeedbacksQuery, r as rentalFacilitiesForObjectGroupRelationQuery, s as rentalsAllWithoutFeedbacksQuery } from "./operations-DwURbo0b.mjs";
|
|
4
4
|
import { a as toFacilityImages, c as toLocalizedString, i as toLocation, o as toImages, r as renderVofficePropertyAttribute, s as toAddress, t as toRentalHighlights } from "./to-rental-highlights-BL5m3Uen.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as parseQueryParameters, i as collectQueryParameters, n as makeV9CustomAttributeFilterCapabilities, o as toQueryString, r as toBasicQueryInputs, s as applyVofficeFilterDerivedBasicQueryInputs } from "./client-
|
|
1
|
+
import { a as parseQueryParameters, i as collectQueryParameters, n as makeV9CustomAttributeFilterCapabilities, o as toQueryString, r as toBasicQueryInputs, s as applyVofficeFilterDerivedBasicQueryInputs } from "./client-EtS0Qm3i.mjs";
|
|
2
2
|
import { l as parseVofficeUnitData } from "./v9-data-C3SWtDGs.mjs";
|
|
3
3
|
import { n as searchQuery, t as mapSearchQuery } from "./operations-DwURbo0b.mjs";
|
|
4
4
|
import { i as toLocation, n as toV9RentalHighlightKey, o as toImages, s as toAddress, t as toRentalHighlights } from "./to-rental-highlights-BL5m3Uen.mjs";
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
Release notes of `@v-office/website-sdk`, newest first. Each version has its own directory.
|
|
6
6
|
|
|
7
|
+
- `versions/2.28.1/CHANGELOG.md`: release notes for 2.28.1
|
|
8
|
+
- `versions/2.28.0/CHANGELOG.md`: release notes for 2.28.0
|
|
7
9
|
- `versions/2.27.0/CHANGELOG.md`: release notes for 2.27.0
|
|
8
10
|
- `versions/2.26.0/CHANGELOG.md`: release notes for 2.26.0
|
|
9
11
|
- `versions/2.25.0/CHANGELOG.md`: release notes for 2.25.0
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
Migration guides of `@v-office/website-sdk`, newest first. Apply them in order when skipping versions.
|
|
6
6
|
|
|
7
|
+
- `versions/2.28.1/MIGRATION.md`: Migration: 2.28.0 to 2.28.1
|
|
8
|
+
- `versions/2.28.0/MIGRATION.md`: Migration: 2.27.0 to 2.28.0
|
|
7
9
|
- `versions/2.27.0/MIGRATION.md`: Migration: 2.26.0 to 2.27.0
|
|
8
10
|
- `versions/2.26.0/MIGRATION.md`: Migration: 2.25.0 to 2.26.0
|
|
9
11
|
- `versions/2.25.0/MIGRATION.md`: Migration: 2.24.1 to 2.25.0
|
|
@@ -122,6 +122,31 @@ No new configuration is required. The currency lookup uses the existing
|
|
|
122
122
|
See `versions/2.18.0/CHANGELOG.md` and
|
|
123
123
|
`versions/2.18.0/MIGRATION.md`.
|
|
124
124
|
|
|
125
|
+
### Legacy v9 Occupancy Limits
|
|
126
|
+
|
|
127
|
+
From 2.28.0, v9 initial availability reads its occupancy limits from the same
|
|
128
|
+
unit record as the currency. They are the limits the v9 quote enforces:
|
|
129
|
+
|
|
130
|
+
- `maxPersons` is the number of sleeping places. Adults and children count
|
|
131
|
+
toward it, babies do not.
|
|
132
|
+
- `maxAdults` is `maxPersons` minus the sleeping places reserved for children.
|
|
133
|
+
- `minPersons` is the unit's minimum occupancy. Adults and children count
|
|
134
|
+
toward it, babies do not.
|
|
135
|
+
|
|
136
|
+
The v9 output (`V9InitialAvailabilityOutput`) has two more fields that v10 does
|
|
137
|
+
not return. Narrow on `sdk.backend === "v9"` to read them:
|
|
138
|
+
|
|
139
|
+
- `childrenAllowed` is `false` when the unit takes no children. The quote then
|
|
140
|
+
refuses babies too, so offer neither.
|
|
141
|
+
- `maxPets` is the most pets the quote accepts. `0` means the unit allows no
|
|
142
|
+
pets or takes them only on request.
|
|
143
|
+
|
|
144
|
+
A value is `null` when the unit does not state it or the unit request fails.
|
|
145
|
+
Treat `null` as no limit.
|
|
146
|
+
|
|
147
|
+
See `versions/2.28.0/CHANGELOG.md` and
|
|
148
|
+
`versions/2.28.0/MIGRATION.md`.
|
|
149
|
+
|
|
125
150
|
## Configuration
|
|
126
151
|
|
|
127
152
|
Use flat `WebsiteSDKConfig` files.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Changelog: 2.28.0
|
|
2
|
+
|
|
3
|
+
On v9, `getInitialAvailability` now states the occupancy rules the v9 quote enforces. Until
|
|
4
|
+
now `minPersons`, `maxPersons` and `maxAdults` were always `null` on v9, so a guest selector
|
|
5
|
+
had no limit and only the quote refused a party that did not fit the rental.
|
|
6
|
+
|
|
7
|
+
## Added
|
|
8
|
+
|
|
9
|
+
- v9 `sdk.live.availability.getInitialAvailability` returns two more fields:
|
|
10
|
+
- `childrenAllowed` is `false` when the rental takes no children. The quote then refuses
|
|
11
|
+
babies too.
|
|
12
|
+
- `maxPets` is the most pets the quote accepts: 1 to 4 for a rental with such a
|
|
13
|
+
restriction, `0` when the rental allows no pets or takes them only on request, `null`
|
|
14
|
+
when it sets no upper limit.
|
|
15
|
+
- Type `V9InitialAvailabilityOutput`, the v9 output of `getInitialAvailability`.
|
|
16
|
+
|
|
17
|
+
## Fixed
|
|
18
|
+
|
|
19
|
+
- v9 `getInitialAvailability` fills `minPersons`, `maxPersons` and `maxAdults` from the
|
|
20
|
+
rental. `maxPersons` is the number of sleeping places; adults and children count toward
|
|
21
|
+
it, babies do not. `maxAdults` leaves out the sleeping places reserved for children.
|
|
22
|
+
`minPersons` is the rental's minimum occupancy, again without babies.
|
|
23
|
+
|
|
24
|
+
All five values come from the rental record the availability already loads for the calendar
|
|
25
|
+
currency, so there is no additional request. A value the rental does not state stays `null`,
|
|
26
|
+
and so do all five when the rental record cannot be loaded; `null` means no limit. v10
|
|
27
|
+
availability is unchanged and has no `childrenAllowed` or `maxPets`.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Migration: 2.27.0 to 2.28.0
|
|
2
|
+
|
|
3
|
+
## 1. Upgrade
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pnpm add @v-office/website-sdk@2.28.0
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
No changes are required. On a v9 site, `minPersons`, `maxPersons` and `maxAdults` from
|
|
10
|
+
`getInitialAvailability` now carry numbers where they were `null`. A guest selector that
|
|
11
|
+
already caps at these values, such as the one in `@v-office/website-components`, caps v9
|
|
12
|
+
rentals from now on.
|
|
13
|
+
|
|
14
|
+
## 2. Optional: offer only what the v9 quote accepts
|
|
15
|
+
|
|
16
|
+
A site with its own guest selector can read `childrenAllowed` and `maxPets`. v10 does not
|
|
17
|
+
return them, so call the availability inside a check on the backend:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
if (sdk.backend === "v9") {
|
|
21
|
+
const { childrenAllowed, maxPets } = await sdk.live.availability.getInitialAvailability(input);
|
|
22
|
+
// childrenAllowed === false: offer neither children nor babies
|
|
23
|
+
// maxPets: the highest pet count to offer; 0 hides pets, null means no limit
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Keep a selection the guest arrived with visible until they remove it, for example children
|
|
28
|
+
handed over from the search, so a party the quote refuses can still be corrected.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Changelog: 2.28.1
|
|
2
|
+
|
|
3
|
+
On v9, the availability calendar now ends where the rental's prices end. Until now a guest
|
|
4
|
+
could pick dates after the last priced night; the calendar showed no price for them and the
|
|
5
|
+
quote then failed.
|
|
6
|
+
|
|
7
|
+
## Fixed
|
|
8
|
+
|
|
9
|
+
- v9 `sdk.live.availability.getInitialAvailability` no longer offers a check-in whose stay
|
|
10
|
+
runs past the last priced night. Days after the last priced night are unavailable and carry
|
|
11
|
+
no price.
|
|
12
|
+
- v9 `sdk.live.availability.getStartDateSelectedAvailability` offers the day after the last
|
|
13
|
+
priced night as the latest check-out and no day after it.
|
|
14
|
+
|
|
15
|
+
A rental whose prices have no end date keeps its calendar as before. v10 availability is
|
|
16
|
+
unchanged.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Migration: 2.28.0 to 2.28.1
|
|
2
|
+
|
|
3
|
+
## 1. Upgrade
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pnpm add @v-office/website-sdk@2.28.1
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
No changes are required. On a v9 site, days after the rental's last priced night come back
|
|
10
|
+
as unavailable from both availability calls, so a calendar built on them stops offering
|
|
11
|
+
those dates without any change.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-office/website-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.28.1",
|
|
4
4
|
"description": "Website-facing SDK facade backed by @v-office/sdk-core",
|
|
5
5
|
"bin": {
|
|
6
6
|
"website-sdk": "./dist/cli.mjs"
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"test:v9:properties": "node --test codegen/v9/heuristic-generation/generate/property.test.ts src/legacy-v9/property-highlight-sources.test.ts src/legacy-v9/parser/rentals/render-property-attribute.test.ts src/legacy-v9/parser/rentals/to-property.test.ts src/legacy-v9/parser/rentals/to-rooms.test.ts",
|
|
87
87
|
"test:v9:rentals": "node --test src/legacy-v9/static/associate-rentals-with-facilities-by-object-groups.test.ts src/legacy-v9/parser/rentals/to-reviews.test.ts",
|
|
88
88
|
"test:v9:graphql": "node --test src/legacy-v9/graphql/client.test.ts",
|
|
89
|
-
"test:v9:availability": "node --test src/legacy-v9/parser/availability/to-initial-availability-calendar-days.test.ts",
|
|
89
|
+
"test:v9:availability": "node --test src/legacy-v9/parser/availability/to-availability-restrictions-by-date.test.ts src/legacy-v9/parser/availability/to-initial-availability-calendar-days.test.ts src/legacy-v9/parser/availability/to-occupancy-limits.test.ts",
|
|
90
90
|
"test:v9:search": "node --test src/legacy-v9/parser/search/resolve-exact-match.test.ts",
|
|
91
91
|
"test:v9:booking": "node --test src/legacy-v9/parser/booking/output/to-payment-schedules.test.ts",
|
|
92
92
|
"playground:custom-attributes": "pnpm run build && node --env-file=.env playground/custom-attributes.ts"
|