@v-office/website-sdk 2.26.0 → 2.28.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 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--T_tQSjV.mjs";
2
+ import { Ht as defineWebsiteSDKOptions, Wt as defineV9PropertyHighlightSourcesFromUnknown, c as makeV9GraphQLClient, d as makeV0OpenApiClientFetchLive, l as V0OpenApiClient, t as createWebsiteSDK } from "./client-DCXrq6T9.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.26.0";
21
+ var version = "2.28.0";
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";
@@ -352,13 +352,80 @@ const defineWebsiteSDKOptions = (options) => options;
352
352
  *
353
353
  * A registered symbol on `globalThis`, not module state: a build loads the SDK more than once
354
354
  * (the content loaders and the prerendered pages run separately bundled copies), and every copy
355
- * must land in the one record. No imports, so it is as safe in a browser bundle as in Node.
355
+ * must land in the one record. No runtime imports, so it is as safe in a browser bundle as in Node.
356
356
  */
357
357
  const CONSTRUCTED_BACKENDS_KEY = Symbol.for("@v-office/website-sdk/backends");
358
358
  const recordConstructedBackend = (backend) => {
359
359
  const record = globalThis;
360
360
  (record[CONSTRUCTED_BACKENDS_KEY] ??= /* @__PURE__ */ new Set()).add(backend);
361
361
  };
362
+ /**
363
+ * Every distinct config and options this process has constructed a website SDK with, as JSON of
364
+ * the top-level fields `createWebsiteSDK` reads (their values as passed), recorded like the backends and read by
365
+ * `@v-office/site-manifest` (`websiteSdks`). The platform learns from it the public token and the
366
+ * options the site really uses, whatever its own code looks like. A set of JSON strings: a build
367
+ * constructs the SDK once per content loader and page, and identical constructions are one entry,
368
+ * whatever the order of their keys (two entries would read as two different SDKs); the JSON is
369
+ * what the SDK was told at that moment. Created when the SDK is loaded, so an empty set is a build
370
+ * that loaded it and constructed none, and no set at all is a build without this SDK (or one too
371
+ * old to keep the record). A construction that is not JSON adds `UNRECORDABLE_SDK` instead: the
372
+ * record then no longer names every SDK the build constructed, and the manifest leaves it out
373
+ * rather than report part of it.
374
+ */
375
+ const CONSTRUCTED_SDKS_KEY = Symbol.for("@v-office/website-sdk/sdks");
376
+ globalThis[CONSTRUCTED_SDKS_KEY] ??= /* @__PURE__ */ new Set();
377
+ /** Not JSON of an object, so it can stand for no construction; site-manifest reads the same text. */
378
+ const UNRECORDABLE_SDK = "unrecordable";
379
+ /** The top-level fields `createWebsiteSDK` reads, the only ones recorded: a property it ignores (a
380
+ * spread settings object, the build's environment) never reaches the manifest or the platform.
381
+ * Their values are recorded as passed: they are what the SDK received, and projecting each
382
+ * option's nested shape here would repeat the SDK's types at runtime. Checked against those
383
+ * types, so a new field does not compile until it is listed here. */
384
+ const V10_CONFIG_FIELDS = {
385
+ backend: true,
386
+ apiEndpoint: true,
387
+ searchEndpoint: true,
388
+ accessToken: true,
389
+ imageBaseUrl: true
390
+ };
391
+ const V9_CONFIG_FIELDS = {
392
+ backend: true,
393
+ graphqlUrl: true,
394
+ apiKey: true,
395
+ imageProxyBaseUrl: true,
396
+ v0ApiBaseUrl: true,
397
+ v1ApiBaseUrl: true,
398
+ rentalDataAttributes: true,
399
+ facilityObjectGroupRelationAttributeId: true
400
+ };
401
+ const OPTION_FIELDS = {
402
+ translationOverrides: true,
403
+ customAttributes: true,
404
+ v9PropertyHighlightSources: true,
405
+ v9Reviews: true,
406
+ customAttributeFilterDefinitions: true,
407
+ rentalHighlightPrioritization: true,
408
+ rentalPropertyHighlightPrioritization: true,
409
+ rentalScope: true,
410
+ shouldAddProposedAdditionalServiceAmount: true,
411
+ searchAllRentalsAtOnce: true
412
+ };
413
+ const declared = (value, fields) => Object.fromEntries(Object.entries(value).filter(([key]) => Object.hasOwn(fields, key)));
414
+ /** Writes each object's keys sorted; arrays keep their order, which can mean something. */
415
+ const sortedKeys = (_key, value) => value !== null && typeof value === "object" && !Array.isArray(value) ? Object.fromEntries(Object.entries(value).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0)) : value;
416
+ const recordConstructedSdk = (config, options) => {
417
+ let json;
418
+ try {
419
+ json = JSON.stringify({
420
+ config: declared(config, config.backend === "v9" ? V9_CONFIG_FIELDS : V10_CONFIG_FIELDS),
421
+ options: declared(options ?? {}, OPTION_FIELDS)
422
+ }, sortedKeys);
423
+ } catch {
424
+ json = UNRECORDABLE_SDK;
425
+ }
426
+ const record = globalThis;
427
+ (record[CONSTRUCTED_SDKS_KEY] ??= /* @__PURE__ */ new Set()).add(json);
428
+ };
362
429
  //#endregion
363
430
  //#region src/payment/browser.ts
364
431
  const getBrowser = () => Effect.gen(function* () {
@@ -1601,6 +1668,41 @@ const toInitialAvailabilityCalendarDays$1 = ({ availability, currency, ...input
1601
1668
  ...currency === void 0 ? {} : { currency }
1602
1669
  })));
1603
1670
  //#endregion
1671
+ //#region src/legacy-v9/parser/availability/to-occupancy-limits.ts
1672
+ const NO_OCCUPANCY_LIMITS = {
1673
+ minPersons: null,
1674
+ maxPersons: null,
1675
+ maxAdults: null,
1676
+ childrenAllowed: null,
1677
+ maxPets: null
1678
+ };
1679
+ const MAX_PETS_BY_RESTRICTION = {
1680
+ 0: 1,
1681
+ 1: 2,
1682
+ 2: 3,
1683
+ 3: 0,
1684
+ 4: 4
1685
+ };
1686
+ const toPositiveCount = (value) => value !== void 0 && Number.isInteger(value) && value > 0 ? value : null;
1687
+ const toMaxPets = (unit) => {
1688
+ const { pets, petsRestrictions } = unit.known;
1689
+ if (pets === void 0) return null;
1690
+ if (pets === 0) return 0;
1691
+ if (petsRestrictions === void 0) return null;
1692
+ return MAX_PETS_BY_RESTRICTION[petsRestrictions] ?? null;
1693
+ };
1694
+ const toOccupancyLimits = ({ unit }) => {
1695
+ const maxPersons = toPositiveCount(unit.known.beds);
1696
+ const { childrenWelcome } = unit.known;
1697
+ return {
1698
+ minPersons: toPositiveCount(unit.known.minpersons),
1699
+ maxPersons,
1700
+ maxAdults: maxPersons === null ? null : Math.max(maxPersons - (toPositiveCount(unit.known.beds4kids) ?? 0), 0),
1701
+ childrenAllowed: childrenWelcome === void 0 ? null : childrenWelcome !== 0,
1702
+ maxPets: toMaxPets(unit)
1703
+ };
1704
+ };
1705
+ //#endregion
1604
1706
  //#region translations/v9/de-DE/core.json
1605
1707
  var core_default$1 = {
1606
1708
  "Rental.rentalType.option.HOUSE": "Haus",
@@ -3132,7 +3234,7 @@ const makeV9AvailabilityApi = ({ config, options }) => {
3132
3234
  apiKey: config.apiKey,
3133
3235
  ...config.v1ApiBaseUrl === void 0 ? {} : { baseUrl: config.v1ApiBaseUrl }
3134
3236
  });
3135
- const bookingCurrencyByUnitId = /* @__PURE__ */ new Map();
3237
+ const unitDetailsByUnitId = /* @__PURE__ */ new Map();
3136
3238
  const loadAvailability = (input) => Effect.gen(function* () {
3137
3239
  const client = yield* V1OpenApiClient;
3138
3240
  const unitId = yield* toVofficeUnitId$2(input);
@@ -3146,23 +3248,28 @@ const makeV9AvailabilityApi = ({ config, options }) => {
3146
3248
  cause
3147
3249
  })))).data;
3148
3250
  }).pipe(Effect.provide(openApiClientLive));
3149
- const loadBookingCurrency = (input) => Effect.gen(function* () {
3251
+ const loadUnitDetails = (input) => Effect.gen(function* () {
3150
3252
  const client = yield* V1OpenApiClient;
3151
3253
  const unitId = yield* toVofficeUnitId$2(input);
3152
- if (bookingCurrencyByUnitId.has(unitId)) return bookingCurrencyByUnitId.get(unitId);
3254
+ const cached = unitDetailsByUnitId.get(unitId);
3255
+ if (cached !== void 0) return cached;
3153
3256
  const result = yield* client.execute("getUnit", { path: { voffice_unit: unitId } }).pipe(Effect.match({
3154
3257
  onFailure: () => void 0,
3155
3258
  onSuccess: (result) => result
3156
3259
  }));
3157
3260
  if (result === void 0) return void 0;
3158
- const currency = firstString(result.data.data.currency);
3159
- bookingCurrencyByUnitId.set(unitId, currency);
3160
- return currency;
3261
+ const details = {
3262
+ currency: firstString(result.data.data.currency),
3263
+ occupancyLimits: toOccupancyLimits({ unit: parseVofficeUnitData(result.data.data) })
3264
+ };
3265
+ unitDetailsByUnitId.set(unitId, details);
3266
+ return details;
3161
3267
  }).pipe(Effect.provide(openApiClientLive));
3162
3268
  return {
3163
3269
  getInitialAvailability: (input) => Effect.runPromise(Effect.gen(function* () {
3164
3270
  const now = yield* DateTime.now;
3165
- const [availability, currency] = yield* Effect.all([loadAvailability(input), loadBookingCurrency(input)]);
3271
+ const [availability, unitDetails] = yield* Effect.all([loadAvailability(input), loadUnitDetails(input)]);
3272
+ const currency = unitDetails?.currency;
3166
3273
  const firstCalculationDate = toFirstCalculationDate({
3167
3274
  availability,
3168
3275
  now
@@ -3177,9 +3284,7 @@ const makeV9AvailabilityApi = ({ config, options }) => {
3177
3284
  translations,
3178
3285
  ...currency === void 0 ? {} : { currency }
3179
3286
  }),
3180
- minPersons: null,
3181
- maxPersons: null,
3182
- maxAdults: null
3287
+ ...unitDetails?.occupancyLimits ?? NO_OCCUPANCY_LIMITS
3183
3288
  };
3184
3289
  })),
3185
3290
  getStartDateSelectedAvailability: (input) => Effect.runPromise(Effect.gen(function* () {
@@ -5790,7 +5895,7 @@ const parseV9SearchCursor = (cursor) => Effect.gen(function* () {
5790
5895
  return page;
5791
5896
  });
5792
5897
  const loadV9SearchRuntime = Effect.tryPromise({
5793
- try: () => import("./search-DtBtzIGf.mjs"),
5898
+ try: () => import("./search-BHnJI-nl.mjs"),
5794
5899
  catch: (cause) => new CoreSDKError({
5795
5900
  source: "v9",
5796
5901
  operation: "v9.search.runtime",
@@ -6437,7 +6542,7 @@ const orderRentalsById = ({ rentalIds, rentals }) => {
6437
6542
  });
6438
6543
  };
6439
6544
  const loadV9RentalsRuntime = Effect.tryPromise({
6440
- try: () => import("./rentals-D4wmqjzL.mjs"),
6545
+ try: () => import("./rentals-BocKluYN.mjs"),
6441
6546
  catch: (cause) => new CoreSDKError({
6442
6547
  source: "v9",
6443
6548
  operation: "v9.rentals.runtime",
@@ -6581,6 +6686,7 @@ function createWebsiteSDK({ config, options }) {
6581
6686
  options: v9Options
6582
6687
  });
6583
6688
  recordConstructedBackend("v9");
6689
+ recordConstructedSdk(config, options);
6584
6690
  return {
6585
6691
  backend: "v9",
6586
6692
  static: {
@@ -6658,6 +6764,7 @@ function createWebsiteSDK({ config, options }) {
6658
6764
  dispose: () => runtime.dispose()
6659
6765
  };
6660
6766
  recordConstructedBackend("v10");
6767
+ recordConstructedSdk(config, options);
6661
6768
  return sdk;
6662
6769
  }
6663
6770
  //#endregion
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 WebsiteSDKV9Live = Omit<WebsiteSDKSharedLive, "search"> & {
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--T_tQSjV.mjs";
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-DCXrq6T9.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.0/CHANGELOG.md`: release notes for 2.28.0
8
+ - `versions/2.27.0/CHANGELOG.md`: release notes for 2.27.0
7
9
  - `versions/2.26.0/CHANGELOG.md`: release notes for 2.26.0
8
10
  - `versions/2.25.0/CHANGELOG.md`: release notes for 2.25.0
9
11
  - `versions/2.24.1/CHANGELOG.md`: release notes for 2.24.1
@@ -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.0/MIGRATION.md`: Migration: 2.27.0 to 2.28.0
8
+ - `versions/2.27.0/MIGRATION.md`: Migration: 2.26.0 to 2.27.0
7
9
  - `versions/2.26.0/MIGRATION.md`: Migration: 2.25.0 to 2.26.0
8
10
  - `versions/2.25.0/MIGRATION.md`: Migration: 2.24.1 to 2.25.0
9
11
  - `versions/2.24.1/MIGRATION.md`: Migration: 2.24.0 to 2.24.1
@@ -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,26 @@
1
+ # Changelog: 2.27.0
2
+
3
+ The platform needs the token and the options a website really uses its SDK with, to keep the
4
+ website's public token current and to use the SDK on the site's behalf the same way. Like the
5
+ backend since 2.24.0, it reads them from the one place where they are final: what
6
+ `createWebsiteSDK` was constructed with. This release records them for the build's site manifest
7
+ (`@v-office/site-manifest` 0.2.0).
8
+
9
+ ## Added
10
+
11
+ - `createWebsiteSDK` records the `config` and `options` of every SDK it constructs, once the
12
+ config was accepted, as JSON in a set under
13
+ `globalThis[Symbol.for("@v-office/website-sdk/sdks")]`. Only the top-level config and
14
+ option fields the SDK reads are recorded, their values as passed: a property it ignores (a
15
+ spread settings object, environment variables) is left out and never reaches the manifest. Identical constructions are one entry,
16
+ whatever the order of their keys: the JSON lists each object's keys sorted, arrays as given.
17
+ The set exists as soon as the SDK is loaded, so an empty set means none was constructed.
18
+ `@v-office/site-manifest` writes it to `dist/site-manifest.json` as `websiteSdks`. A config the
19
+ SDK refuses records nothing. A construction whose fields are not JSON (a cycle or a BigInt in a
20
+ field the SDK reads) does not fail the SDK and records `"unrecordable"`
21
+ instead, so the manifest does not report the others as if they were all.
22
+
23
+ ## Changed
24
+
25
+ - Nothing else. The record has no effect on what the SDK does, needs no import and is safe in a
26
+ browser bundle. It holds the public token the config already carries into the bundle.
@@ -0,0 +1,10 @@
1
+ # Migration: 2.26.0 to 2.27.0
2
+
3
+ ## 1. Upgrade
4
+
5
+ ```sh
6
+ pnpm add @v-office/website-sdk@2.27.0
7
+ ```
8
+
9
+ No changes are required. To have the token and options reported, the site also needs
10
+ `@v-office/site-manifest` 0.2.0 or later.
@@ -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.
@@ -1,4 +1,4 @@
1
- import { Gt as V9_FACILITY_ATTRIBUTE_KEYS } from "./client--T_tQSjV.mjs";
1
+ import { Gt as V9_FACILITY_ATTRIBUTE_KEYS } from "./client-DCXrq6T9.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--T_tQSjV.mjs";
1
+ import { a as parseQueryParameters, i as collectQueryParameters, n as makeV9CustomAttributeFilterCapabilities, o as toQueryString, r as toBasicQueryInputs, s as applyVofficeFilterDerivedBasicQueryInputs } from "./client-DCXrq6T9.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.0/CHANGELOG.md`: release notes for 2.28.0
8
+ - `versions/2.27.0/CHANGELOG.md`: release notes for 2.27.0
7
9
  - `versions/2.26.0/CHANGELOG.md`: release notes for 2.26.0
8
10
  - `versions/2.25.0/CHANGELOG.md`: release notes for 2.25.0
9
11
  - `versions/2.24.1/CHANGELOG.md`: release notes for 2.24.1
@@ -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.0/MIGRATION.md`: Migration: 2.27.0 to 2.28.0
8
+ - `versions/2.27.0/MIGRATION.md`: Migration: 2.26.0 to 2.27.0
7
9
  - `versions/2.26.0/MIGRATION.md`: Migration: 2.25.0 to 2.26.0
8
10
  - `versions/2.25.0/MIGRATION.md`: Migration: 2.24.1 to 2.25.0
9
11
  - `versions/2.24.1/MIGRATION.md`: Migration: 2.24.0 to 2.24.1
@@ -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,26 @@
1
+ # Changelog: 2.27.0
2
+
3
+ The platform needs the token and the options a website really uses its SDK with, to keep the
4
+ website's public token current and to use the SDK on the site's behalf the same way. Like the
5
+ backend since 2.24.0, it reads them from the one place where they are final: what
6
+ `createWebsiteSDK` was constructed with. This release records them for the build's site manifest
7
+ (`@v-office/site-manifest` 0.2.0).
8
+
9
+ ## Added
10
+
11
+ - `createWebsiteSDK` records the `config` and `options` of every SDK it constructs, once the
12
+ config was accepted, as JSON in a set under
13
+ `globalThis[Symbol.for("@v-office/website-sdk/sdks")]`. Only the top-level config and
14
+ option fields the SDK reads are recorded, their values as passed: a property it ignores (a
15
+ spread settings object, environment variables) is left out and never reaches the manifest. Identical constructions are one entry,
16
+ whatever the order of their keys: the JSON lists each object's keys sorted, arrays as given.
17
+ The set exists as soon as the SDK is loaded, so an empty set means none was constructed.
18
+ `@v-office/site-manifest` writes it to `dist/site-manifest.json` as `websiteSdks`. A config the
19
+ SDK refuses records nothing. A construction whose fields are not JSON (a cycle or a BigInt in a
20
+ field the SDK reads) does not fail the SDK and records `"unrecordable"`
21
+ instead, so the manifest does not report the others as if they were all.
22
+
23
+ ## Changed
24
+
25
+ - Nothing else. The record has no effect on what the SDK does, needs no import and is safe in a
26
+ browser bundle. It holds the public token the config already carries into the bundle.
@@ -0,0 +1,10 @@
1
+ # Migration: 2.26.0 to 2.27.0
2
+
3
+ ## 1. Upgrade
4
+
5
+ ```sh
6
+ pnpm add @v-office/website-sdk@2.27.0
7
+ ```
8
+
9
+ No changes are required. To have the token and options reported, the site also needs
10
+ `@v-office/site-manifest` 0.2.0 or later.
@@ -0,0 +1,3 @@
1
+ {
2
+ "componentsAffectedByHeadlessChange": []
3
+ }
@@ -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,3 @@
1
+ {
2
+ "componentsAffectedByHeadlessChange": ["quote", "booking"]
3
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v-office/website-sdk",
3
- "version": "2.26.0",
3
+ "version": "2.28.0",
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-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"