@v-office/website-sdk 2.19.0 → 2.20.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 { Vt as defineV9PropertyHighlightSourcesFromUnknown, t as createWebsiteSDK, zt as defineWebsiteSDKOptions } from "./client-BnA0oXd_.mjs";
2
+ import { Vt as defineV9PropertyHighlightSourcesFromUnknown, t as createWebsiteSDK, zt as defineWebsiteSDKOptions } from "./client-ssUMkYeM.mjs";
3
3
  import { SearchSearchSortSchema, defineCustomAttributesFromUnknown } from "@v-office/sdk-core";
4
4
  import { ByteSize, Console, Effect, FileSystem, Layer, Option, Path, Schema, Stdio, Terminal } from "effect";
5
5
  import { Command, Flag } from "effect/unstable/cli";
@@ -16,7 +16,7 @@ var CLICheckFailed = class extends Error {
16
16
  const toCLIError = (message, cause) => cause instanceof Error ? new CLICheckFailed(`${message}: ${cause.message}`, { cause }) : new CLICheckFailed(message, { cause });
17
17
  //#endregion
18
18
  //#region package.json
19
- var version = "2.19.0";
19
+ var version = "2.20.0";
20
20
  //#endregion
21
21
  //#region src/cli/output.ts
22
22
  const toJson = (value) => Effect.try({
@@ -5623,7 +5623,7 @@ const parseV9SearchCursor = (cursor) => Effect.gen(function* () {
5623
5623
  return page;
5624
5624
  });
5625
5625
  const loadV9SearchRuntime = Effect.tryPromise({
5626
- try: () => import("./search-CR1UjnmR.mjs"),
5626
+ try: () => import("./search-BCQzRzvO.mjs"),
5627
5627
  catch: (cause) => new CoreSDKError({
5628
5628
  source: "v10",
5629
5629
  operation: "v9.search.runtime",
@@ -5645,7 +5645,7 @@ const makeV9SearchApi = ({ config, options }) => {
5645
5645
  })
5646
5646
  }));
5647
5647
  return { search: (input) => Effect.runPromise(limitSearch(Effect.gen(function* () {
5648
- const { defaultSearchDataAttributes, searchQuery, toAlternativePeriods, toQueryInput, toSearchOutputItem } = yield* loadV9SearchRuntime;
5648
+ const { defaultSearchDataAttributes, resolveExactMatch, searchQuery, toAlternativePeriods, toQueryInput, toSearchOutputItem } = yield* loadV9SearchRuntime;
5649
5649
  const dataAttributes = [
5650
5650
  ...defaultSearchDataAttributes,
5651
5651
  ...config.rentalDataAttributes ?? [],
@@ -5674,24 +5674,27 @@ const makeV9SearchApi = ({ config, options }) => {
5674
5674
  ...scopedQueryInput
5675
5675
  });
5676
5676
  const entries = yield* Effect.all(data.search.data.map((rental) => Effect.gen(function* () {
5677
- const alternatives = rental.additional_voffice_data?.alternatives;
5678
- const isExactPeriodMatch = alternatives === null;
5677
+ const { isExactMatch, exactMatchCalc, periods } = resolveExactMatch(rental.additional_voffice_data);
5679
5678
  const item = yield* toSearchOutputItem({
5680
5679
  locale: input.locale,
5681
5680
  imageProxyBaseUrl: config.imageProxyBaseUrl,
5682
5681
  rentalHighlightPrioritization: [...options.rentalHighlightPrioritization],
5683
5682
  customAttributes: options.customAttributes,
5684
5683
  rental,
5685
- includeFormattedTotal: isExactPeriodMatch,
5684
+ exactMatchCalc,
5686
5685
  translations
5687
5686
  });
5688
- if (isExactPeriodMatch || alternatives === void 0) return {
5687
+ if (isExactMatch) return {
5688
+ type: "item",
5689
+ item
5690
+ };
5691
+ if (periods.length === 0) return {
5689
5692
  type: "item",
5690
5693
  item
5691
5694
  };
5692
5695
  const alternativePeriods = yield* toAlternativePeriods({
5693
5696
  locale: input.locale,
5694
- alternatives
5697
+ alternatives: periods
5695
5698
  });
5696
5699
  if (alternativePeriods.length === 0) return {
5697
5700
  type: "item",
@@ -6018,7 +6021,7 @@ const orderRentalsById = ({ rentalIds, rentals }) => {
6018
6021
  });
6019
6022
  };
6020
6023
  const loadV9RentalsRuntime = Effect.tryPromise({
6021
- try: () => import("./rentals-GfJVIv7i.mjs"),
6024
+ try: () => import("./rentals-BxAIq-V4.mjs"),
6022
6025
  catch: (cause) => new CoreSDKError({
6023
6026
  source: "v10",
6024
6027
  operation: "v9.rentals.runtime",
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as ServiceBeonDataSchema, A as ErgoBookRequestSchema, At as quoteEffect, B as OnOfficeUnitSchema, Bt as defineV9PropertyHighlightSources, C as DocumentResourceSchema, Ct as clearAdditionalServicesEffect, D as DocumentTypeSchema, Dt as getRentalsEffect, E as DocumentSummarySchema, Et as getInitialAvailabilityEffect, F as ErgoPolicyNumberRequestSchema, Ft as selectInsurancePaymentEffect, G as QuotePricesResponseSchema, H as PaymentScheduleSchema, I as ErgoReadPreContractRequestSchema, It as submitContactEffect, J as RawObjectResponseSchema, K as QuoteSchema, L as ErgoTripAndCustomerRequestSchema, Lt as submitPaymentOption, M as ErgoCreatePreContractRequestSchema, Mt as searchEffect, N as ErgoPersonSchema, Nt as selectCancellationPolicyEffect, O as ErgoAddressSchema, Ot as getStartDateSelectedAvailabilityEffect, P as ErgoPlanSearchRequestSchema, Pt as selectInsuranceEffect, Q as SearchPropertiesResponseSchema, R as FacilityListResponseSchema, Rt as submitPaymentOptionEffect, S as DocumentResourceResponseSchema, St as bookInsuranceEffect, T as DocumentStatusUpdateRequestSchema, Tt as getFiltersEffect, U as QuoteLineSchema, V as PaymentScheduleItemSchema, Vt as defineV9PropertyHighlightSourcesFromUnknown, W as QuotePricesPayloadSchema, X as RegionListResponseSchema, Y as RawVofficeObjectSchema, Z as RoomImageSchema, _ as CalendarDaySchema, _t as V1_OPERATIONS, at as TileCollectionResponseSchema, b as CustomerUnitSummarySchema, bt as addAdditionalServiceEffect, c as V0OpenApiClient, ct as TravelInsuranceBookingSchema, d as makeV0OpenApiClientLive, dt as UnitListItemSchema, et as ServiceImageSchema, f as V1OpenApiClient, ft as UnitListResponseSchema, g as ApiEnvelopeBaseSchema, gt as V1_BASE_URL, h as makeV1OpenApiClientLive, ht as UnitServicePriceSchema, it as SetupResponseSchema, j as ErgoCommonFieldsSchema, jt as removeAdditionalServiceEffect, k as ErgoBankSchema, kt as getTermsAndPrivacyPolicyEffect, l as V0OpenApiClientError, lt as TravelInsuranceBookingStoreRequestSchema, m as makeV1OpenApiClientFetchLive, mt as UnitResponseSchema, nt as ServiceListResponseSchema, ot as TileSchema, p as V1OpenApiClientError, pt as UnitOfferSchema, q as QuoteServiceSchema, rt as SetupDataSchema, st as TileTagSchema, t as createWebsiteSDK, tt as ServiceLimitSchema, u as makeV0OpenApiClientFetchLive, ut as UnitIdsResponseSchema, v as CalendarResponseSchema, vt as VideoResponseSchema, w as DocumentStatusSchema, wt as createInsurancePreContractEffect, x as DocumentCollectionResponseSchema, xt as bookEffect, y as CurrentMemberResponseSchema, yt as decodeV1OperationResponse, z as OnOfficeUnitCollectionResponseSchema, zt as defineWebsiteSDKOptions } from "./client-BnA0oXd_.mjs";
1
+ import { $ as ServiceBeonDataSchema, A as ErgoBookRequestSchema, At as quoteEffect, B as OnOfficeUnitSchema, Bt as defineV9PropertyHighlightSources, C as DocumentResourceSchema, Ct as clearAdditionalServicesEffect, D as DocumentTypeSchema, Dt as getRentalsEffect, E as DocumentSummarySchema, Et as getInitialAvailabilityEffect, F as ErgoPolicyNumberRequestSchema, Ft as selectInsurancePaymentEffect, G as QuotePricesResponseSchema, H as PaymentScheduleSchema, I as ErgoReadPreContractRequestSchema, It as submitContactEffect, J as RawObjectResponseSchema, K as QuoteSchema, L as ErgoTripAndCustomerRequestSchema, Lt as submitPaymentOption, M as ErgoCreatePreContractRequestSchema, Mt as searchEffect, N as ErgoPersonSchema, Nt as selectCancellationPolicyEffect, O as ErgoAddressSchema, Ot as getStartDateSelectedAvailabilityEffect, P as ErgoPlanSearchRequestSchema, Pt as selectInsuranceEffect, Q as SearchPropertiesResponseSchema, R as FacilityListResponseSchema, Rt as submitPaymentOptionEffect, S as DocumentResourceResponseSchema, St as bookInsuranceEffect, T as DocumentStatusUpdateRequestSchema, Tt as getFiltersEffect, U as QuoteLineSchema, V as PaymentScheduleItemSchema, Vt as defineV9PropertyHighlightSourcesFromUnknown, W as QuotePricesPayloadSchema, X as RegionListResponseSchema, Y as RawVofficeObjectSchema, Z as RoomImageSchema, _ as CalendarDaySchema, _t as V1_OPERATIONS, at as TileCollectionResponseSchema, b as CustomerUnitSummarySchema, bt as addAdditionalServiceEffect, c as V0OpenApiClient, ct as TravelInsuranceBookingSchema, d as makeV0OpenApiClientLive, dt as UnitListItemSchema, et as ServiceImageSchema, f as V1OpenApiClient, ft as UnitListResponseSchema, g as ApiEnvelopeBaseSchema, gt as V1_BASE_URL, h as makeV1OpenApiClientLive, ht as UnitServicePriceSchema, it as SetupResponseSchema, j as ErgoCommonFieldsSchema, jt as removeAdditionalServiceEffect, k as ErgoBankSchema, kt as getTermsAndPrivacyPolicyEffect, l as V0OpenApiClientError, lt as TravelInsuranceBookingStoreRequestSchema, m as makeV1OpenApiClientFetchLive, mt as UnitResponseSchema, nt as ServiceListResponseSchema, ot as TileSchema, p as V1OpenApiClientError, pt as UnitOfferSchema, q as QuoteServiceSchema, rt as SetupDataSchema, st as TileTagSchema, t as createWebsiteSDK, tt as ServiceLimitSchema, u as makeV0OpenApiClientFetchLive, ut as UnitIdsResponseSchema, v as CalendarResponseSchema, vt as VideoResponseSchema, w as DocumentStatusSchema, wt as createInsurancePreContractEffect, x as DocumentCollectionResponseSchema, xt as bookEffect, y as CurrentMemberResponseSchema, yt as decodeV1OperationResponse, z as OnOfficeUnitCollectionResponseSchema, zt as defineWebsiteSDKOptions } from "./client-ssUMkYeM.mjs";
2
2
  import { AdditionalServiceLimitExceeded, CoreSDKError, CoreSDKError as CMSError, CustomAttributeCatalogSchema, GuestQuoteSchema, InvalidAdditionalServiceQuantity, LocaleSchema, 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,7 @@
4
4
 
5
5
  Release notes of `@v-office/website-sdk`, newest first. Each version has its own directory.
6
6
 
7
+ - `versions/2.20.0/CHANGELOG.md`: release notes for 2.20.0
7
8
  - `versions/2.19.0/CHANGELOG.md`: release notes for 2.19.0
8
9
  - `versions/2.18.2/CHANGELOG.md`: release notes for 2.18.2
9
10
  - `versions/2.18.1/CHANGELOG.md`: release notes for 2.18.1
@@ -4,6 +4,7 @@
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.20.0/MIGRATION.md`: Migration: 2.19.0 to 2.20.0
7
8
  - `versions/2.19.0/MIGRATION.md`: Migration: 2.18.2 to 2.19.0
8
9
  - `versions/2.18.2/MIGRATION.md`: Migration: 2.18.1 to 2.18.2
9
10
  - `versions/2.18.1/MIGRATION.md`: Migration: 2.18.0 to 2.18.1
@@ -0,0 +1,19 @@
1
+ # Changelog: 2.20.0
2
+
3
+ Fixes a case in legacy-v9 search where a rental that exactly matched the
4
+ guest's search dates could be returned without its price.
5
+
6
+ ## Fixed
7
+
8
+ - A search result that exactly matches the requested dates now reliably shows
9
+ its formatted price. Previously, whether the price appeared depended on an
10
+ internal detail of the vOffice response that did not always align with an
11
+ exact match, so some exact matches were shown with no price at all.
12
+ - A rental is no longer shown as an "alternative dates" result when it was in
13
+ fact an exact match for the requested dates.
14
+
15
+ ## Unchanged
16
+
17
+ - The public `getSearch` input and output types.
18
+ - How alternative date periods are resolved and rendered when a rental does
19
+ not exactly match the requested dates.
@@ -0,0 +1,15 @@
1
+ # Migration: 2.19.0 to 2.20.0
2
+
3
+ No changes required. The `getSearch` signature and output type are unchanged.
4
+
5
+ Complete search snapshots can change: a query that previously rendered as an
6
+ alternative-period result (because `alternatives` was non-null) now renders
7
+ as an exact match with its formatted price when the Hub reports
8
+ `foundExactMatch: true`. Render the returned item as-is; no client-side
9
+ branching is required.
10
+
11
+ ## 1. Upgrade
12
+
13
+ ```sh
14
+ pnpm add @v-office/website-sdk@2.20.0
15
+ ```
@@ -1,6 +1,6 @@
1
- import { Ht as V9_FACILITY_ATTRIBUTE_KEYS } from "./client-BnA0oXd_.mjs";
1
+ import { Ht as V9_FACILITY_ATTRIBUTE_KEYS } from "./client-ssUMkYeM.mjs";
2
2
  import { c as parseVofficeUnitData, i as VofficeUnitDataPropertyMetadata, n as VofficeUnitDataPropertyCategoryLabelKeys, o as parseVofficeFacilityData, r as VofficeUnitDataPropertyCategoryValues, s as parseVofficeFeedbackData, t as VofficeUnitDataFieldSchemas } from "./v9-data-BnYxa2Ek.mjs";
3
- import { a as toAddress, c as rentalFacilitiesForObjectGroupRelationQuery, d as rentalsAllFeedbacksQuery, f as rentalsAllWithoutFeedbacksQuery, i as toImages, l as rentalIdsQuery, n as renderVofficePropertyAttribute, o as toLocalizedString, r as toFacilityImages, t as toRentalHighlights, u as rentalsAllByFacilityObjectGroupsWithoutFeedbacksQuery } from "./to-rental-highlights-CJvDxSLw.mjs";
3
+ import { a as toAddress, c as rentalFacilitiesForObjectGroupRelationQuery, d as rentalsAllFeedbacksQuery, f as rentalsAllWithoutFeedbacksQuery, i as toImages, l as rentalIdsQuery, n as renderVofficePropertyAttribute, o as toLocalizedString, r as toFacilityImages, t as toRentalHighlights, u as rentalsAllByFacilityObjectGroupsWithoutFeedbacksQuery } from "./to-rental-highlights-CN-wpRh3.mjs";
4
4
  import { CoreSDKError, makeTranslate, renderResolvedCustomAttribute, toCustomAttributeList, toResolvedCustomAttributeCategoryTranslationKey } from "@v-office/sdk-core";
5
5
  import { Effect } from "effect";
6
6
  //#region src/legacy-v9/parser/rentals/to-description.ts
@@ -1,6 +1,6 @@
1
- import { a as parseQueryParameters, i as collectQueryParameters, n as makeV9CustomAttributeFilterCapabilities, o as toQueryString, r as toBasicQueryInputs, s as applyVofficeFilterDerivedBasicQueryInputs } from "./client-BnA0oXd_.mjs";
1
+ import { a as parseQueryParameters, i as collectQueryParameters, n as makeV9CustomAttributeFilterCapabilities, o as toQueryString, r as toBasicQueryInputs, s as applyVofficeFilterDerivedBasicQueryInputs } from "./client-ssUMkYeM.mjs";
2
2
  import { c as parseVofficeUnitData, t as VofficeUnitDataFieldSchemas } from "./v9-data-BnYxa2Ek.mjs";
3
- import { a as toAddress, i as toImages, s as searchQuery, t as toRentalHighlights } from "./to-rental-highlights-CJvDxSLw.mjs";
3
+ import { a as toAddress, i as toImages, s as searchQuery, t as toRentalHighlights } from "./to-rental-highlights-CN-wpRh3.mjs";
4
4
  import { CoreSDKError, STABLE_SEARCH_INPUTS, daysBetweenLocalDates, expandCustomAttributeFilterCompositions, parseChildrenAges, parseOccupancyCount, resolveExpandedCompositions, toFormattedSearchPrice, toIsoDateFromPeriodQueryDate, toStableSearchInputBackendQueryKeys, toStableSearchInputParameterValues, toStableSearchInputQueryKeys, toUnusedFilterKeys } from "@v-office/sdk-core";
5
5
  import { Effect } from "effect";
6
6
  //#region src/legacy-v9/parser/search/input/search-input-error.ts
@@ -223,6 +223,7 @@ const toQueryInput = ({ query, sort, customAttributeFilterDefinitions, locale, t
223
223
  vofficeData: {
224
224
  filter: Object.keys(filter).length > 0 ? filter : void 0,
225
225
  alternatives: true,
226
+ splitAlternatives: true,
226
227
  sorting: toVofficeSorting(sort)
227
228
  },
228
229
  basicQueryInputs: basicQueryInputs.length > 0 ? basicQueryInputs : null
@@ -231,6 +232,16 @@ const toQueryInput = ({ query, sort, customAttributeFilterDefinitions, locale, t
231
232
  };
232
233
  });
233
234
  //#endregion
235
+ //#region src/legacy-v9/parser/search/resolve-exact-match.ts
236
+ const resolveExactMatch = (additionalData) => {
237
+ const isExactMatch = additionalData?.foundExactMatch === true;
238
+ return {
239
+ isExactMatch,
240
+ exactMatchCalc: isExactMatch ? additionalData?.calc ?? additionalData?.matchingPeriods?.[0]?.calc : void 0,
241
+ periods: isExactMatch ? [] : additionalData?.alternatives ?? []
242
+ };
243
+ };
244
+ //#endregion
234
245
  //#region src/legacy-v9/parser/search/output/to-search-price-fields.ts
235
246
  const DEFAULT_V9_SEARCH_CURRENCY = "EUR";
236
247
  const toSearchPriceFields = ({ locale, calc }) => {
@@ -263,7 +274,7 @@ const toSearchPriceFields = ({ locale, calc }) => {
263
274
  };
264
275
  //#endregion
265
276
  //#region src/legacy-v9/parser/search/to-search-output-item.ts
266
- const toSearchOutputItem = ({ locale, imageProxyBaseUrl, rentalHighlightPrioritization, customAttributes, rental, translations, includeFormattedTotal }) => Effect.gen(function* () {
277
+ const toSearchOutputItem = ({ locale, imageProxyBaseUrl, rentalHighlightPrioritization, customAttributes, rental, translations, exactMatchCalc }) => Effect.gen(function* () {
267
278
  const data = parseVofficeUnitData(rental.data);
268
279
  const item = {
269
280
  id: rental.voffice_id.toString(),
@@ -282,9 +293,9 @@ const toSearchOutputItem = ({ locale, imageProxyBaseUrl, rentalHighlightPrioriti
282
293
  attributes: data
283
294
  });
284
295
  if (highlights != null) item.highlights = highlights;
285
- if (includeFormattedTotal) Object.assign(item, toSearchPriceFields({
296
+ if (exactMatchCalc != null) Object.assign(item, toSearchPriceFields({
286
297
  locale,
287
- calc: rental.additional_voffice_data?.calc
298
+ calc: exactMatchCalc
288
299
  }));
289
300
  return item;
290
301
  });
@@ -305,4 +316,4 @@ const toAlternativePeriods = ({ locale, alternatives }) => Effect.succeed((alter
305
316
  //#region src/legacy-v9/runtime/search.ts
306
317
  const defaultSearchDataAttributes = Object.keys(VofficeUnitDataFieldSchemas);
307
318
  //#endregion
308
- export { defaultSearchDataAttributes, searchQuery, toAlternativePeriods, toQueryInput, toSearchOutputItem };
319
+ export { defaultSearchDataAttributes, resolveExactMatch, searchQuery, toAlternativePeriods, toQueryInput, toSearchOutputItem };
@@ -1650,7 +1650,7 @@ const documents = {
1650
1650
  }
1651
1651
  }]
1652
1652
  },
1653
- "\n query CoreSDK_Search(\n $first: Int!\n $page: Int\n $language: String\n $vofficeData: VofficeData\n $basicQueryInputs: [BasicQueryInput!]\n $dataAttributes: [String!]! = []\n ) {\n search(\n first: $first\n page: $page\n language: $language\n voffice: $vofficeData\n data: $basicQueryInputs\n ) {\n paginatorInfo {\n hasMorePages\n currentPage\n }\n data {\n voffice_id\n voffice_images {\n id\n path\n title\n description\n }\n voffice_room_images {\n id\n path\n name\n title\n description\n }\n additional_voffice_data {\n alternatives {\n fromdate\n tilldate\n calc {\n total\n rent\n summary\n oTotal\n oRent\n oSummary\n discountName\n }\n }\n calc {\n total\n rent\n summary\n oTotal\n oRent\n oSummary\n discountName\n }\n }\n data(attributes: $dataAttributes)\n }\n }\n }\n": {
1653
+ "\n query CoreSDK_Search(\n $first: Int!\n $page: Int\n $language: String\n $vofficeData: VofficeData\n $basicQueryInputs: [BasicQueryInput!]\n $dataAttributes: [String!]! = []\n ) {\n search(\n first: $first\n page: $page\n language: $language\n voffice: $vofficeData\n data: $basicQueryInputs\n ) {\n paginatorInfo {\n hasMorePages\n currentPage\n }\n data {\n voffice_id\n voffice_images {\n id\n path\n title\n description\n }\n voffice_room_images {\n id\n path\n name\n title\n description\n }\n additional_voffice_data {\n foundExactMatch\n alternatives {\n fromdate\n tilldate\n calc {\n total\n rent\n summary\n oTotal\n oRent\n oSummary\n discountName\n }\n }\n matchingPeriods {\n fromdate\n tilldate\n calc {\n total\n rent\n summary\n oTotal\n oRent\n oSummary\n discountName\n }\n }\n calc {\n total\n rent\n summary\n oTotal\n oRent\n oSummary\n discountName\n }\n }\n data(attributes: $dataAttributes)\n }\n }\n }\n": {
1654
1654
  kind: "Document",
1655
1655
  definitions: [{
1656
1656
  kind: "OperationDefinition",
@@ -2000,153 +2000,250 @@ const documents = {
2000
2000
  },
2001
2001
  selectionSet: {
2002
2002
  kind: "SelectionSet",
2003
- selections: [{
2004
- kind: "Field",
2005
- name: {
2006
- kind: "Name",
2007
- value: "alternatives"
2003
+ selections: [
2004
+ {
2005
+ kind: "Field",
2006
+ name: {
2007
+ kind: "Name",
2008
+ value: "foundExactMatch"
2009
+ }
2008
2010
  },
2009
- selectionSet: {
2010
- kind: "SelectionSet",
2011
- selections: [
2012
- {
2013
- kind: "Field",
2014
- name: {
2015
- kind: "Name",
2016
- value: "fromdate"
2017
- }
2018
- },
2019
- {
2020
- kind: "Field",
2021
- name: {
2022
- kind: "Name",
2023
- value: "tilldate"
2024
- }
2025
- },
2026
- {
2027
- kind: "Field",
2028
- name: {
2029
- kind: "Name",
2030
- value: "calc"
2011
+ {
2012
+ kind: "Field",
2013
+ name: {
2014
+ kind: "Name",
2015
+ value: "alternatives"
2016
+ },
2017
+ selectionSet: {
2018
+ kind: "SelectionSet",
2019
+ selections: [
2020
+ {
2021
+ kind: "Field",
2022
+ name: {
2023
+ kind: "Name",
2024
+ value: "fromdate"
2025
+ }
2031
2026
  },
2032
- selectionSet: {
2033
- kind: "SelectionSet",
2034
- selections: [
2035
- {
2036
- kind: "Field",
2037
- name: {
2038
- kind: "Name",
2039
- value: "total"
2040
- }
2041
- },
2042
- {
2043
- kind: "Field",
2044
- name: {
2045
- kind: "Name",
2046
- value: "rent"
2047
- }
2048
- },
2049
- {
2050
- kind: "Field",
2051
- name: {
2052
- kind: "Name",
2053
- value: "summary"
2054
- }
2055
- },
2056
- {
2057
- kind: "Field",
2058
- name: {
2059
- kind: "Name",
2060
- value: "oTotal"
2061
- }
2062
- },
2063
- {
2064
- kind: "Field",
2065
- name: {
2066
- kind: "Name",
2067
- value: "oRent"
2068
- }
2069
- },
2070
- {
2071
- kind: "Field",
2072
- name: {
2073
- kind: "Name",
2074
- value: "oSummary"
2075
- }
2076
- },
2077
- {
2078
- kind: "Field",
2079
- name: {
2080
- kind: "Name",
2081
- value: "discountName"
2027
+ {
2028
+ kind: "Field",
2029
+ name: {
2030
+ kind: "Name",
2031
+ value: "tilldate"
2032
+ }
2033
+ },
2034
+ {
2035
+ kind: "Field",
2036
+ name: {
2037
+ kind: "Name",
2038
+ value: "calc"
2039
+ },
2040
+ selectionSet: {
2041
+ kind: "SelectionSet",
2042
+ selections: [
2043
+ {
2044
+ kind: "Field",
2045
+ name: {
2046
+ kind: "Name",
2047
+ value: "total"
2048
+ }
2049
+ },
2050
+ {
2051
+ kind: "Field",
2052
+ name: {
2053
+ kind: "Name",
2054
+ value: "rent"
2055
+ }
2056
+ },
2057
+ {
2058
+ kind: "Field",
2059
+ name: {
2060
+ kind: "Name",
2061
+ value: "summary"
2062
+ }
2063
+ },
2064
+ {
2065
+ kind: "Field",
2066
+ name: {
2067
+ kind: "Name",
2068
+ value: "oTotal"
2069
+ }
2070
+ },
2071
+ {
2072
+ kind: "Field",
2073
+ name: {
2074
+ kind: "Name",
2075
+ value: "oRent"
2076
+ }
2077
+ },
2078
+ {
2079
+ kind: "Field",
2080
+ name: {
2081
+ kind: "Name",
2082
+ value: "oSummary"
2083
+ }
2084
+ },
2085
+ {
2086
+ kind: "Field",
2087
+ name: {
2088
+ kind: "Name",
2089
+ value: "discountName"
2090
+ }
2082
2091
  }
2083
- }
2084
- ]
2092
+ ]
2093
+ }
2085
2094
  }
2086
- }
2087
- ]
2088
- }
2089
- }, {
2090
- kind: "Field",
2091
- name: {
2092
- kind: "Name",
2093
- value: "calc"
2095
+ ]
2096
+ }
2094
2097
  },
2095
- selectionSet: {
2096
- kind: "SelectionSet",
2097
- selections: [
2098
- {
2099
- kind: "Field",
2100
- name: {
2101
- kind: "Name",
2102
- value: "total"
2103
- }
2104
- },
2105
- {
2106
- kind: "Field",
2107
- name: {
2108
- kind: "Name",
2109
- value: "rent"
2110
- }
2111
- },
2112
- {
2113
- kind: "Field",
2114
- name: {
2115
- kind: "Name",
2116
- value: "summary"
2117
- }
2118
- },
2119
- {
2120
- kind: "Field",
2121
- name: {
2122
- kind: "Name",
2123
- value: "oTotal"
2124
- }
2125
- },
2126
- {
2127
- kind: "Field",
2128
- name: {
2129
- kind: "Name",
2130
- value: "oRent"
2131
- }
2132
- },
2133
- {
2134
- kind: "Field",
2135
- name: {
2136
- kind: "Name",
2137
- value: "oSummary"
2098
+ {
2099
+ kind: "Field",
2100
+ name: {
2101
+ kind: "Name",
2102
+ value: "matchingPeriods"
2103
+ },
2104
+ selectionSet: {
2105
+ kind: "SelectionSet",
2106
+ selections: [
2107
+ {
2108
+ kind: "Field",
2109
+ name: {
2110
+ kind: "Name",
2111
+ value: "fromdate"
2112
+ }
2113
+ },
2114
+ {
2115
+ kind: "Field",
2116
+ name: {
2117
+ kind: "Name",
2118
+ value: "tilldate"
2119
+ }
2120
+ },
2121
+ {
2122
+ kind: "Field",
2123
+ name: {
2124
+ kind: "Name",
2125
+ value: "calc"
2126
+ },
2127
+ selectionSet: {
2128
+ kind: "SelectionSet",
2129
+ selections: [
2130
+ {
2131
+ kind: "Field",
2132
+ name: {
2133
+ kind: "Name",
2134
+ value: "total"
2135
+ }
2136
+ },
2137
+ {
2138
+ kind: "Field",
2139
+ name: {
2140
+ kind: "Name",
2141
+ value: "rent"
2142
+ }
2143
+ },
2144
+ {
2145
+ kind: "Field",
2146
+ name: {
2147
+ kind: "Name",
2148
+ value: "summary"
2149
+ }
2150
+ },
2151
+ {
2152
+ kind: "Field",
2153
+ name: {
2154
+ kind: "Name",
2155
+ value: "oTotal"
2156
+ }
2157
+ },
2158
+ {
2159
+ kind: "Field",
2160
+ name: {
2161
+ kind: "Name",
2162
+ value: "oRent"
2163
+ }
2164
+ },
2165
+ {
2166
+ kind: "Field",
2167
+ name: {
2168
+ kind: "Name",
2169
+ value: "oSummary"
2170
+ }
2171
+ },
2172
+ {
2173
+ kind: "Field",
2174
+ name: {
2175
+ kind: "Name",
2176
+ value: "discountName"
2177
+ }
2178
+ }
2179
+ ]
2180
+ }
2138
2181
  }
2139
- },
2140
- {
2141
- kind: "Field",
2142
- name: {
2143
- kind: "Name",
2144
- value: "discountName"
2182
+ ]
2183
+ }
2184
+ },
2185
+ {
2186
+ kind: "Field",
2187
+ name: {
2188
+ kind: "Name",
2189
+ value: "calc"
2190
+ },
2191
+ selectionSet: {
2192
+ kind: "SelectionSet",
2193
+ selections: [
2194
+ {
2195
+ kind: "Field",
2196
+ name: {
2197
+ kind: "Name",
2198
+ value: "total"
2199
+ }
2200
+ },
2201
+ {
2202
+ kind: "Field",
2203
+ name: {
2204
+ kind: "Name",
2205
+ value: "rent"
2206
+ }
2207
+ },
2208
+ {
2209
+ kind: "Field",
2210
+ name: {
2211
+ kind: "Name",
2212
+ value: "summary"
2213
+ }
2214
+ },
2215
+ {
2216
+ kind: "Field",
2217
+ name: {
2218
+ kind: "Name",
2219
+ value: "oTotal"
2220
+ }
2221
+ },
2222
+ {
2223
+ kind: "Field",
2224
+ name: {
2225
+ kind: "Name",
2226
+ value: "oRent"
2227
+ }
2228
+ },
2229
+ {
2230
+ kind: "Field",
2231
+ name: {
2232
+ kind: "Name",
2233
+ value: "oSummary"
2234
+ }
2235
+ },
2236
+ {
2237
+ kind: "Field",
2238
+ name: {
2239
+ kind: "Name",
2240
+ value: "discountName"
2241
+ }
2145
2242
  }
2146
- }
2147
- ]
2243
+ ]
2244
+ }
2148
2245
  }
2149
- }]
2246
+ ]
2150
2247
  }
2151
2248
  },
2152
2249
  {
@@ -2391,6 +2488,7 @@ const searchQuery = graphql(`
2391
2488
  description
2392
2489
  }
2393
2490
  additional_voffice_data {
2491
+ foundExactMatch
2394
2492
  alternatives {
2395
2493
  fromdate
2396
2494
  tilldate
@@ -2404,6 +2502,19 @@ const searchQuery = graphql(`
2404
2502
  discountName
2405
2503
  }
2406
2504
  }
2505
+ matchingPeriods {
2506
+ fromdate
2507
+ tilldate
2508
+ calc {
2509
+ total
2510
+ rent
2511
+ summary
2512
+ oTotal
2513
+ oRent
2514
+ oSummary
2515
+ discountName
2516
+ }
2517
+ }
2407
2518
  calc {
2408
2519
  total
2409
2520
  rent
@@ -4,6 +4,7 @@
4
4
 
5
5
  Release notes of `@v-office/website-sdk`, newest first. Each version has its own directory.
6
6
 
7
+ - `versions/2.20.0/CHANGELOG.md`: release notes for 2.20.0
7
8
  - `versions/2.19.0/CHANGELOG.md`: release notes for 2.19.0
8
9
  - `versions/2.18.2/CHANGELOG.md`: release notes for 2.18.2
9
10
  - `versions/2.18.1/CHANGELOG.md`: release notes for 2.18.1
@@ -4,6 +4,7 @@
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.20.0/MIGRATION.md`: Migration: 2.19.0 to 2.20.0
7
8
  - `versions/2.19.0/MIGRATION.md`: Migration: 2.18.2 to 2.19.0
8
9
  - `versions/2.18.2/MIGRATION.md`: Migration: 2.18.1 to 2.18.2
9
10
  - `versions/2.18.1/MIGRATION.md`: Migration: 2.18.0 to 2.18.1
@@ -0,0 +1,19 @@
1
+ # Changelog: 2.20.0
2
+
3
+ Fixes a case in legacy-v9 search where a rental that exactly matched the
4
+ guest's search dates could be returned without its price.
5
+
6
+ ## Fixed
7
+
8
+ - A search result that exactly matches the requested dates now reliably shows
9
+ its formatted price. Previously, whether the price appeared depended on an
10
+ internal detail of the vOffice response that did not always align with an
11
+ exact match, so some exact matches were shown with no price at all.
12
+ - A rental is no longer shown as an "alternative dates" result when it was in
13
+ fact an exact match for the requested dates.
14
+
15
+ ## Unchanged
16
+
17
+ - The public `getSearch` input and output types.
18
+ - How alternative date periods are resolved and rendered when a rental does
19
+ not exactly match the requested dates.
@@ -0,0 +1,15 @@
1
+ # Migration: 2.19.0 to 2.20.0
2
+
3
+ No changes required. The `getSearch` signature and output type are unchanged.
4
+
5
+ Complete search snapshots can change: a query that previously rendered as an
6
+ alternative-period result (because `alternatives` was non-null) now renders
7
+ as an exact match with its formatted price when the Hub reports
8
+ `foundExactMatch: true`. Render the returned item as-is; no client-side
9
+ branching is required.
10
+
11
+ ## 1. Upgrade
12
+
13
+ ```sh
14
+ pnpm add @v-office/website-sdk@2.20.0
15
+ ```
@@ -0,0 +1,3 @@
1
+ {
2
+ "componentsAffectedByHeadlessChange": ["searchResults"]
3
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v-office/website-sdk",
3
- "version": "2.19.0",
3
+ "version": "2.20.0",
4
4
  "description": "Website-facing SDK facade backed by @v-office/sdk-core",
5
5
  "bin": {
6
6
  "website-sdk": "./dist/cli.mjs"
@@ -77,10 +77,11 @@
77
77
  "fmt": "oxfmt",
78
78
  "fmt:check": "oxfmt --check",
79
79
  "check": "pnpm run typecheck && pnpm run lint && pnpm run fmt:check",
80
- "test": "pnpm run test:v9:properties && pnpm run test:v9:rentals && pnpm run test:v9:availability && pnpm run build && node --test test/*.test.mjs",
80
+ "test": "pnpm run test:v9:properties && pnpm run test:v9:rentals && pnpm run test:v9:availability && pnpm run test:v9:search && pnpm run build && node --test test/*.test.mjs",
81
81
  "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",
82
82
  "test:v9:rentals": "node --test src/legacy-v9/static/associate-rentals-with-facilities-by-object-groups.test.ts",
83
83
  "test:v9:availability": "node --test src/legacy-v9/parser/availability/to-initial-availability-calendar-days.test.ts",
84
+ "test:v9:search": "node --test src/legacy-v9/parser/search/resolve-exact-match.test.ts",
84
85
  "playground:custom-attributes": "pnpm run build && node --env-file=.env playground/custom-attributes.ts"
85
86
  }
86
87
  }