@v-office/website-sdk 2.22.0 → 2.24.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 +2 -2
- package/dist/{client-BtZ30vTP.mjs → client-DC4LG3CP.mjs} +223 -31
- package/dist/index.d.mts +79 -5
- package/dist/index.mjs +3 -3
- package/dist/instructions/CHANGELOG.md +2 -0
- package/dist/instructions/MIGRATION.md +2 -0
- package/dist/instructions/creation.md +6 -0
- package/dist/instructions/search.md +85 -1
- package/dist/instructions/versions/2.23.0/CHANGELOG.md +62 -0
- package/dist/instructions/versions/2.23.0/MIGRATION.md +33 -0
- package/dist/instructions/versions/2.24.0/CHANGELOG.md +19 -0
- package/dist/instructions/versions/2.24.0/MIGRATION.md +17 -0
- package/dist/{rentals-DfNu7s7w.mjs → rentals-eqFhtCdT.mjs} +2 -12
- package/dist/{search-CZ1TRGAB.mjs → search-CKL-8T8q.mjs} +17 -5
- package/dist/{to-rental-highlights-CN-wpRh3.mjs → to-rental-highlights-C1NF2uuE.mjs} +343 -14
- package/instructions/CHANGELOG.md +2 -0
- package/instructions/MIGRATION.md +2 -0
- package/instructions/creation.md +6 -0
- package/instructions/search.md +85 -1
- package/instructions/versions/2.23.0/CHANGELOG.md +62 -0
- package/instructions/versions/2.23.0/MIGRATION.md +33 -0
- package/instructions/versions/2.23.0/release.json +3 -0
- package/instructions/versions/2.24.0/CHANGELOG.md +19 -0
- package/instructions/versions/2.24.0/MIGRATION.md +17 -0
- package/instructions/versions/2.24.0/release.json +3 -0
- package/package.json +7 -3
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as ServiceBeonDataSchema, A as ErgoBookRequestSchema, At as getTermsAndPrivacyPolicyEffect, B as OnOfficeUnitSchema, Bt as
|
|
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";
|
|
1
|
+
import { $ as ServiceBeonDataSchema, A as ErgoBookRequestSchema, At as getTermsAndPrivacyPolicyEffect, B as OnOfficeUnitSchema, Bt as submitPaymentOptionEffect, C as DocumentResourceSchema, Ct as clearAdditionalServicesEffect, D as DocumentTypeSchema, Dt as getInitialAvailabilityEffect, E as DocumentSummarySchema, Et as getFiltersEffect, F as ErgoPolicyNumberRequestSchema, Ft as selectCancellationPolicyEffect, G as QuotePricesResponseSchema, H as PaymentScheduleSchema, Ht as defineV9PropertyHighlightSources, I as ErgoReadPreContractRequestSchema, It as selectInsuranceEffect, J as RawObjectResponseSchema, K as QuoteSchema, L as ErgoTripAndCustomerRequestSchema, Lt as selectInsurancePaymentEffect, M as ErgoCreatePreContractRequestSchema, Mt as quoteEffect, N as ErgoPersonSchema, Nt as removeAdditionalServiceEffect, O as ErgoAddressSchema, Ot as getRentalsEffect, P as ErgoPlanSearchRequestSchema, Pt as searchEffect, Q as SearchPropertiesResponseSchema, R as FacilityListResponseSchema, Rt as submitContactEffect, S as DocumentResourceResponseSchema, St as bookInsuranceEffect, T as DocumentStatusUpdateRequestSchema, Tt as getBankTransferDetailsEffect, U as QuoteLineSchema, Ut as defineV9PropertyHighlightSourcesFromUnknown, V as PaymentScheduleItemSchema, Vt as defineWebsiteSDKOptions, 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 mapSearchEffect, k as ErgoBankSchema, kt as getStartDateSelectedAvailabilityEffect, 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 submitPaymentOption } from "./client-DC4LG3CP.mjs";
|
|
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;
|
|
5
5
|
const defineDataAttributes = () => (attributes) => attributes;
|
|
@@ -13,4 +13,4 @@ const defineVofficeOfferDataAttributes = defineDataAttributes();
|
|
|
13
13
|
const defineVofficeRatingDataAttributes = defineDataAttributes();
|
|
14
14
|
const defineVofficeTotalRatingDataAttributes = defineDataAttributes();
|
|
15
15
|
//#endregion
|
|
16
|
-
export { AdditionalServiceLimitExceeded, ApiEnvelopeBaseSchema, CMSError, CalendarDaySchema, CalendarResponseSchema, CoreSDKError, CurrentMemberResponseSchema, CustomAttributeCatalogSchema, CustomerUnitSummarySchema, DocumentCollectionResponseSchema, DocumentResourceResponseSchema, DocumentResourceSchema, DocumentStatusSchema, DocumentStatusUpdateRequestSchema, DocumentSummarySchema, DocumentTypeSchema, ErgoAddressSchema, ErgoBankSchema, ErgoBookRequestSchema, ErgoCommonFieldsSchema, ErgoCreatePreContractRequestSchema, ErgoPersonSchema, ErgoPlanSearchRequestSchema, ErgoPolicyNumberRequestSchema, ErgoReadPreContractRequestSchema, ErgoTripAndCustomerRequestSchema, FacilityListResponseSchema, GuestQuoteSchema, InvalidAdditionalServiceQuantity, LocaleSchema, OnOfficeUnitCollectionResponseSchema, OnOfficeUnitSchema, PaymentScheduleItemSchema, PaymentScheduleSchema, QuoteLineSchema, QuotePricesPayloadSchema, QuotePricesResponseSchema, QuoteSchema, QuoteServiceSchema, RawObjectResponseSchema, RawVofficeObjectSchema, RegionListResponseSchema, RoomImageSchema, SearchPropertiesResponseSchema, SearchSearchFieldOrderBySchema, SearchSearchFieldSortSchema, SearchSearchInputSchema, SearchSearchOutputSchema, SearchSearchPriceSortSchema, SearchSearchRandomSortSchema, SearchSearchRatingSortSchema, SearchSearchSortSchema, SearchSortDirectionSchema, ServiceBeonDataSchema, ServiceImageSchema, ServiceLimitSchema, ServiceListResponseSchema, SetupDataSchema, SetupResponseSchema, TileCollectionResponseSchema, TileSchema, TileTagSchema, TravelInsuranceBookingSchema, TravelInsuranceBookingStoreRequestSchema, UnitIdsResponseSchema, UnitListItemSchema, UnitListResponseSchema, UnitOfferSchema, UnitResponseSchema, UnitServicePriceSchema, UnknownAdditionalService, V0OpenApiClient, V0OpenApiClientError, V1OpenApiClient, V1OpenApiClientError, V1_BASE_URL, V1_OPERATIONS, VideoResponseSchema, addAdditionalServiceEffect, bookEffect, bookInsuranceEffect, clearAdditionalServicesEffect, createInsurancePreContractEffect, createWebsiteSDK, customDataAttribute, decodeV1OperationResponse, defineWebsiteSDKOptions as defineCMSSDKOptions, defineWebsiteSDKOptions, defineCustomAttributes, defineCustomAttributesFromUnknown, defineDataAttributes, defineV9PropertyHighlightSources, defineV9PropertyHighlightSourcesFromUnknown, defineVofficeFacilityDataAttributes, defineVofficeFeedbackDataAttributes, defineVofficeImageDataAttributes, defineVofficeOfferDataAttributes, defineVofficePriceDataAttributes, defineVofficeRatingDataAttributes, defineVofficeServiceDataAttributes, defineVofficeTotalRatingDataAttributes, defineVofficeUnitDataAttributes, fetchCustomAttributeCatalog, getBankTransferDetailsEffect, getFiltersEffect, getInitialAvailabilityEffect, getRentalsEffect, getStartDateSelectedAvailabilityEffect, getTermsAndPrivacyPolicyEffect, makeV0OpenApiClientFetchLive, makeV0OpenApiClientLive, makeV1OpenApiClientFetchLive, makeV1OpenApiClientLive, parseCustomAttributeCatalog, quoteEffect, removeAdditionalServiceEffect, searchEffect, selectCancellationPolicyEffect, selectInsuranceEffect, selectInsurancePaymentEffect, submitContactEffect, submitPaymentOption, submitPaymentOptionEffect, validateContactSubmitInput };
|
|
16
|
+
export { AdditionalServiceLimitExceeded, ApiEnvelopeBaseSchema, CMSError, CalendarDaySchema, CalendarResponseSchema, CoreSDKError, CurrentMemberResponseSchema, CustomAttributeCatalogSchema, CustomerUnitSummarySchema, DocumentCollectionResponseSchema, DocumentResourceResponseSchema, DocumentResourceSchema, DocumentStatusSchema, DocumentStatusUpdateRequestSchema, DocumentSummarySchema, DocumentTypeSchema, ErgoAddressSchema, ErgoBankSchema, ErgoBookRequestSchema, ErgoCommonFieldsSchema, ErgoCreatePreContractRequestSchema, ErgoPersonSchema, ErgoPlanSearchRequestSchema, ErgoPolicyNumberRequestSchema, ErgoReadPreContractRequestSchema, ErgoTripAndCustomerRequestSchema, FacilityListResponseSchema, GuestQuoteSchema, InvalidAdditionalServiceQuantity, LocaleSchema, OnOfficeUnitCollectionResponseSchema, OnOfficeUnitSchema, PaymentScheduleItemSchema, PaymentScheduleSchema, QuoteLineSchema, QuotePricesPayloadSchema, QuotePricesResponseSchema, QuoteSchema, QuoteServiceSchema, RawObjectResponseSchema, RawVofficeObjectSchema, RegionListResponseSchema, RoomImageSchema, SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS, SearchMapSearchInputSchema, SearchMapSearchOutputSchema, SearchPropertiesResponseSchema, SearchSearchFieldOrderBySchema, SearchSearchFieldSortSchema, SearchSearchInputSchema, SearchSearchOutputSchema, SearchSearchPriceSortSchema, SearchSearchRandomSortSchema, SearchSearchRatingSortSchema, SearchSearchSortSchema, SearchSortDirectionSchema, ServiceBeonDataSchema, ServiceImageSchema, ServiceLimitSchema, ServiceListResponseSchema, SetupDataSchema, SetupResponseSchema, TileCollectionResponseSchema, TileSchema, TileTagSchema, TravelInsuranceBookingSchema, TravelInsuranceBookingStoreRequestSchema, UnitIdsResponseSchema, UnitListItemSchema, UnitListResponseSchema, UnitOfferSchema, UnitResponseSchema, UnitServicePriceSchema, UnknownAdditionalService, V0OpenApiClient, V0OpenApiClientError, V1OpenApiClient, V1OpenApiClientError, V1_BASE_URL, V1_OPERATIONS, VideoResponseSchema, addAdditionalServiceEffect, bookEffect, bookInsuranceEffect, clearAdditionalServicesEffect, createInsurancePreContractEffect, createWebsiteSDK, customDataAttribute, decodeV1OperationResponse, defineWebsiteSDKOptions as defineCMSSDKOptions, defineWebsiteSDKOptions, defineCustomAttributes, defineCustomAttributesFromUnknown, defineDataAttributes, defineV9PropertyHighlightSources, defineV9PropertyHighlightSourcesFromUnknown, defineVofficeFacilityDataAttributes, defineVofficeFeedbackDataAttributes, defineVofficeImageDataAttributes, defineVofficeOfferDataAttributes, defineVofficePriceDataAttributes, defineVofficeRatingDataAttributes, defineVofficeServiceDataAttributes, defineVofficeTotalRatingDataAttributes, defineVofficeUnitDataAttributes, fetchCustomAttributeCatalog, getBankTransferDetailsEffect, getFiltersEffect, getInitialAvailabilityEffect, getRentalsEffect, getStartDateSelectedAvailabilityEffect, getTermsAndPrivacyPolicyEffect, makeV0OpenApiClientFetchLive, makeV0OpenApiClientLive, makeV1OpenApiClientFetchLive, makeV1OpenApiClientLive, mapSearchEffect, parseCustomAttributeCatalog, quoteEffect, removeAdditionalServiceEffect, searchEffect, selectCancellationPolicyEffect, selectInsuranceEffect, selectInsurancePaymentEffect, submitContactEffect, submitPaymentOption, submitPaymentOptionEffect, validateContactSubmitInput };
|
|
@@ -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.24.0/CHANGELOG.md`: release notes for 2.24.0
|
|
8
|
+
- `versions/2.23.0/CHANGELOG.md`: release notes for 2.23.0
|
|
7
9
|
- `versions/2.22.0/CHANGELOG.md`: release notes for 2.22.0
|
|
8
10
|
- `versions/2.21.0/CHANGELOG.md`: release notes for 2.21.0
|
|
9
11
|
- `versions/2.20.4/CHANGELOG.md`: release notes for 2.20.4
|
|
@@ -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.24.0/MIGRATION.md`: Migration: 2.23.0 to 2.24.0
|
|
8
|
+
- `versions/2.23.0/MIGRATION.md`: Migration: 2.22.0 to 2.23.0
|
|
7
9
|
- `versions/2.22.0/MIGRATION.md`: Migration: 2.21.0 to 2.22.0
|
|
8
10
|
- `versions/2.21.0/MIGRATION.md`: Migration: 2.20.4 to 2.21.0
|
|
9
11
|
- `versions/2.20.4/MIGRATION.md`: Migration: 2.20.3 to 2.20.4
|
|
@@ -110,9 +110,14 @@ type WebsiteSDKOptions = {
|
|
|
110
110
|
rentalPropertyHighlightPrioritization?: readonly RentalPropertyHighlightPrioritizationKey[];
|
|
111
111
|
rentalScope?: RentalScope;
|
|
112
112
|
shouldAddProposedAdditionalServiceAmount?: boolean;
|
|
113
|
+
searchAllRentalsAtOnce?: boolean;
|
|
113
114
|
};
|
|
114
115
|
```
|
|
115
116
|
|
|
117
|
+
`searchAllRentalsAtOnce` selects how a site searches, on v9 and v10 alike: every
|
|
118
|
+
result with prices in one call (portfolios of up to 100 rentals), or paged results
|
|
119
|
+
plus `mapSearch`. See `search.md`.
|
|
120
|
+
|
|
116
121
|
`rentalHighlightPrioritization` and `rentalPropertyHighlightPrioritization` select
|
|
117
122
|
which facts become highlights and set their order. They are ordered allowlists, not
|
|
118
123
|
sorts over every available fact. A key that is not listed is not emitted even when
|
|
@@ -135,6 +140,7 @@ Unset options are normalized by the SDK:
|
|
|
135
140
|
- `rentalPropertyHighlightPrioritization` defaults to the SDK default property highlight selection.
|
|
136
141
|
- `rentalScope` defaults to `{}`.
|
|
137
142
|
- `shouldAddProposedAdditionalServiceAmount` defaults to `false`.
|
|
143
|
+
- `searchAllRentalsAtOnce` defaults to `false`.
|
|
138
144
|
- `translationOverrides` is omitted unless provided.
|
|
139
145
|
|
|
140
146
|
### v9 Property Highlight Sources
|
|
@@ -403,6 +403,9 @@ fixed-period search without a window, the dates are the requested ones and
|
|
|
403
403
|
}
|
|
404
404
|
```
|
|
405
405
|
|
|
406
|
+
`pageInfo.totalCount` is the number of rentals the backend matched for the search
|
|
407
|
+
over all pages.
|
|
408
|
+
|
|
406
409
|
`appliedFilters` reports what the backend actually applied, and is what a "remove
|
|
407
410
|
this filter" chip should be built from. `label` is localized presentation and can
|
|
408
411
|
repeat, so it cannot identify a filter; `key` plus `value` can. `value` is the
|
|
@@ -424,6 +427,84 @@ the expanded leaf entries. A UI may collapse those leaves under the composition
|
|
|
424
427
|
display, but should keep the returned keys and canonical values when removing direct
|
|
425
428
|
filters.
|
|
426
429
|
|
|
430
|
+
## All Rentals At Once Or Map Search
|
|
431
|
+
|
|
432
|
+
A search that prices many results is slow the first time the backend sees it, and
|
|
433
|
+
a list next to a map should not wait for every price. An SDK therefore works in one
|
|
434
|
+
of two modes, chosen with the `searchAllRentalsAtOnce` option (default `false`).
|
|
435
|
+
Both modes behave the same on v9 and v10, so a site keeps its code when it moves
|
|
436
|
+
from one backend to the other.
|
|
437
|
+
|
|
438
|
+
### `searchAllRentalsAtOnce: true`
|
|
439
|
+
|
|
440
|
+
For portfolios of up to `SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS` (100) rentals.
|
|
441
|
+
`sdk.live.search.search` returns every result with its price in one call, so a list
|
|
442
|
+
and a map can show all results with prices at the same time:
|
|
443
|
+
|
|
444
|
+
```ts
|
|
445
|
+
const sdk = createWebsiteSDK({ config, options: { searchAllRentalsAtOnce: true } });
|
|
446
|
+
const output = await sdk.live.search.search({ locale: "de-DE", query: "adults=2" });
|
|
447
|
+
// output.pageInfo: { hasNextPage: false, totalCount }
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
- The input has no `cursor` and no `limit`; passing either rejects the call with a
|
|
451
|
+
`CoreSDKError` whose `operation` is `search.allRentalsAtOnce`.
|
|
452
|
+
- When the search matches more than 100 rentals, the call rejects with the same
|
|
453
|
+
`operation`. Use the default mode for such a portfolio.
|
|
454
|
+
- `mapSearch` is not available: with `searchAllRentalsAtOnce: true` written in the
|
|
455
|
+
code, the returned `WebsiteSDKV9AllRentalsAtOnce`, `WebsiteSDKV10AllRentalsAtOnce`
|
|
456
|
+
or `WebsiteSDKAllRentalsAtOnce` type has no `mapSearch` and no `cursor`/`limit`;
|
|
457
|
+
when the value is only known at runtime, `mapSearch` rejects with the `operation`
|
|
458
|
+
`search.mapSearch`.
|
|
459
|
+
- The call counts as one request for the search rate limit.
|
|
460
|
+
|
|
461
|
+
### `searchAllRentalsAtOnce: false` (default)
|
|
462
|
+
|
|
463
|
+
`sdk.live.search.search` is paged as before. `sdk.live.search.mapSearch` returns
|
|
464
|
+
every rental the search matches, with its location and without prices:
|
|
465
|
+
|
|
466
|
+
```ts
|
|
467
|
+
const map = await sdk.live.search.mapSearch({ locale: "de-DE", query: "adults=2" });
|
|
468
|
+
// map: { items: { id, location? }[], totalCount, appliedFilters, unusedFilterKeys }
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
`mapSearch` takes the same `query` as `search`, so map and list use the same
|
|
472
|
+
filters. Because it arrives before any result is priced, its `totalCount` can also
|
|
473
|
+
decide how to load the list: at most `SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS`
|
|
474
|
+
matches can be loaded in one `search` call with that `limit` and shown with prices on
|
|
475
|
+
the map (matched by `id`); more matches are paged, with a map without prices.
|
|
476
|
+
|
|
477
|
+
```ts
|
|
478
|
+
const map = await sdk.live.search.mapSearch({ locale, query });
|
|
479
|
+
if (map.totalCount <= SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS) {
|
|
480
|
+
const all = await sdk.live.search.search({
|
|
481
|
+
locale,
|
|
482
|
+
query,
|
|
483
|
+
limit: SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS,
|
|
484
|
+
});
|
|
485
|
+
} else {
|
|
486
|
+
const page = await sdk.live.search.search({ locale, query, limit: 24, cursor });
|
|
487
|
+
}
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
In this mode a `search` call is one backend request, whatever its `limit`.
|
|
491
|
+
|
|
492
|
+
### How each backend does it
|
|
493
|
+
|
|
494
|
+
- v9 prices the rentals of one request one after another, but separate requests in
|
|
495
|
+
parallel. `searchAllRentalsAtOnce` counts the matches without prices first, then
|
|
496
|
+
fetches the priced results as backend pages of ten, at most eight at a time, and
|
|
497
|
+
merges them in backend order; an oversized search is refused before any price is
|
|
498
|
+
requested. When a booking between the requests moves rentals across page
|
|
499
|
+
boundaries, the pages disagree with the count; the SDK then asks for all results in
|
|
500
|
+
one request, a consistent snapshot, instead of returning a set with a gap. `mapSearch` selects no prices and loads up to 1,000 matches per request,
|
|
501
|
+
as many requests as the matches need.
|
|
502
|
+
- v10 answers the whole result set in one request. `searchAllRentalsAtOnce` asks for
|
|
503
|
+
101 results and refuses the search when the response total is above 100.
|
|
504
|
+
`mapSearch` is one request without prices that returns only the location, for up
|
|
505
|
+
to 1,000 matches: the backend's result window, so `items` holds at most 1,000
|
|
506
|
+
rentals while `totalCount` can be higher.
|
|
507
|
+
|
|
427
508
|
## Backend Behavior
|
|
428
509
|
|
|
429
510
|
### v10
|
|
@@ -482,6 +563,9 @@ shape:
|
|
|
482
563
|
length, not the stay itself. The backend returns the bookable stays inside the
|
|
483
564
|
window, earliest first; the SDK keeps that order.
|
|
484
565
|
- v9 never executes a custom-attribute search filter.
|
|
566
|
+
- A search requests only the rental data the search output reads: `name`,
|
|
567
|
+
`address`, `regionName`, `images`, the attribute behind each configured rental
|
|
568
|
+
highlight, the configured custom attributes and `rentalDataAttributes`.
|
|
485
569
|
|
|
486
570
|
The field is omitted when v9 returns no final total or when its original total is
|
|
487
571
|
not greater than the final total. v9 exposes at most one aggregated applied entry,
|
|
@@ -493,7 +577,7 @@ Use flat `WebsiteSDKConfig` files and optional `WebsiteSDKOptions`.
|
|
|
493
577
|
|
|
494
578
|
For v10, config requires `searchEndpoint` (the full REST search URL) as of 2.5.0. See `creation.md` for `searchEndpoint` and the `customAttributes` option.
|
|
495
579
|
|
|
496
|
-
Custom filter definitions can extend accepted search query keys. Search requests are rate-limited to one backend request per second with a queue size of five.
|
|
580
|
+
Custom filter definitions can extend accepted search query keys. Search requests are rate-limited to one backend request per second with a queue size of five. A `searchAllRentalsAtOnce` search and a `mapSearch` each count as one request, including every backend request they make.
|
|
497
581
|
|
|
498
582
|
## CLI Usage
|
|
499
583
|
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Changelog: 2.23.0
|
|
2
|
+
|
|
3
|
+
A search that the backend has not answered before is slow: the v9 backend prices
|
|
4
|
+
the rentals of one request one after another, about 40–75 ms per rental, and caches
|
|
5
|
+
only whole searches. A site that shows every result with its price on a map had to
|
|
6
|
+
request all of them in one call, which took 3–9 s for a portfolio of about 70
|
|
7
|
+
rentals on v9. Separate requests are priced in parallel, and a search that selects
|
|
8
|
+
no prices costs almost nothing. This release uses both, with the same API on v9 and
|
|
9
|
+
v10 so a site keeps its code when it switches backend: small portfolios get every
|
|
10
|
+
priced result in one call, large portfolios get a map search next to a paged list.
|
|
11
|
+
|
|
12
|
+
Measured against a v9 hub with 74 rentals, first request for a date range: 71
|
|
13
|
+
results in 8.6 s with one request, 2.1 s with `searchAllRentalsAtOnce`. A search
|
|
14
|
+
with few results gains nothing and costs the count request: 18 results in 1.4 s
|
|
15
|
+
before, 1.7 s now.
|
|
16
|
+
|
|
17
|
+
## Added
|
|
18
|
+
|
|
19
|
+
- The `searchAllRentalsAtOnce` option (default `false`), on v9 and v10. With
|
|
20
|
+
`true`, `sdk.live.search.search` returns every result with its price in one call
|
|
21
|
+
and takes no `cursor` or `limit`. A search that matches more than
|
|
22
|
+
`SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS` (100) rentals, or a passed `cursor` or
|
|
23
|
+
`limit`, rejects with the `CoreSDKError` operation `search.allRentalsAtOnce`. The
|
|
24
|
+
whole call counts as one request for the search rate limit.
|
|
25
|
+
- v9: counts the matches without prices, then fetches the priced results as
|
|
26
|
+
parallel backend pages of ten, at most eight at a time. An oversized search is
|
|
27
|
+
refused before any price is requested. When a booking between the requests
|
|
28
|
+
shifts rentals across page boundaries, it asks for all results in one request
|
|
29
|
+
instead.
|
|
30
|
+
- v10: one request for 101 results; refused when the response total is above 100.
|
|
31
|
+
- `sdk.live.search.mapSearch({ locale, query })` in the default mode, on v9 and
|
|
32
|
+
v10: every rental the search matches, with `id` and `location`, plus
|
|
33
|
+
`totalCount`, `appliedFilters` and `unusedFilterKeys`, without prices. It
|
|
34
|
+
rejects with the operation `search.mapSearch` when the SDK was created with
|
|
35
|
+
`searchAllRentalsAtOnce: true`. v9 loads up to 1,000 matches per backend request;
|
|
36
|
+
v10 answers up to 1,000 matches, its result window.
|
|
37
|
+
- `pageInfo.totalCount` on every search output: the number of rentals the backend
|
|
38
|
+
matched over all pages.
|
|
39
|
+
- The types `WebsiteSDKAllRentalsAtOnce`, `WebsiteSDKV9AllRentalsAtOnce`,
|
|
40
|
+
`WebsiteSDKV10AllRentalsAtOnce` with their `...Live` types and
|
|
41
|
+
`V9SearchAllRentalsAtOnceInput`, and from `@v-office/sdk-core` 1.24.0
|
|
42
|
+
`SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS`, `SearchMapSearchInput`,
|
|
43
|
+
`SearchMapSearchOutput`, `SearchMapSearchOutputItem`,
|
|
44
|
+
`SearchAllRentalsAtOnceInput` and the matching schemas. `createWebsiteSDK`
|
|
45
|
+
returns an `...AllRentalsAtOnce` type when `searchAllRentalsAtOnce: true` is
|
|
46
|
+
written in the options; it has no `mapSearch` and no `cursor`/`limit`.
|
|
47
|
+
|
|
48
|
+
## Changed
|
|
49
|
+
|
|
50
|
+
- `v9`: a search requests only the rental data the search output reads (`name`,
|
|
51
|
+
`address`, `regionName`, `images`, the attribute behind each configured rental
|
|
52
|
+
highlight, configured custom attributes and `rentalDataAttributes`) instead of
|
|
53
|
+
every known attribute: 56 instead of 450 attributes with the default highlights,
|
|
54
|
+
and a response of 52 KB instead of 164 KB gzipped (624 KB instead of 1,471 KB
|
|
55
|
+
uncompressed) for 71 rentals. The output is unchanged.
|
|
56
|
+
- Requires `@v-office/sdk-core` 1.24.0.
|
|
57
|
+
|
|
58
|
+
## Unchanged
|
|
59
|
+
|
|
60
|
+
- A paged search in the default mode, on v9 and v10: same request per call, same
|
|
61
|
+
items, alternatives and prices; `pageInfo` gains `totalCount`. On v9 verified
|
|
62
|
+
against the hub with 2.22.0 side by side.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Migration: 2.22.0 to 2.23.0
|
|
2
|
+
|
|
3
|
+
## 1. Upgrade
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pnpm add @v-office/website-sdk@2.23.0
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
No changes are required. The default mode searches as before, and the search
|
|
10
|
+
output only gains `pageInfo.totalCount`.
|
|
11
|
+
|
|
12
|
+
## 2. Show every result with its price on list and map (up to 100 rentals)
|
|
13
|
+
|
|
14
|
+
Create the SDK with `searchAllRentalsAtOnce: true` and drop the pagination loop:
|
|
15
|
+
one `search` call returns every result with `pageInfo.hasNextPage: false`. Remove
|
|
16
|
+
`cursor` and `limit` from the input; the call rejects them. The same code works on
|
|
17
|
+
v9 and v10.
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
const sdk = createWebsiteSDK({ config, options: { searchAllRentalsAtOnce: true } });
|
|
21
|
+
const { items, alternatives, pageInfo } = await sdk.live.search.search({ locale, query });
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## 3. Map for a larger portfolio (default mode)
|
|
25
|
+
|
|
26
|
+
Load the map with `mapSearch` and page the list with `search`. Use `totalCount`
|
|
27
|
+
from `mapSearch` to load a search with few matches in one call and show its prices
|
|
28
|
+
on the map; see `search.md`, "All Rentals At Once Or Map Search".
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
const map = await sdk.live.search.mapSearch({ locale, query });
|
|
32
|
+
// map.items: { id, location? }[] for every match; map.totalCount
|
|
33
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Changelog: 2.24.0
|
|
2
|
+
|
|
3
|
+
The platform needs to know which PMS a site runs on: v9 websites are rebuilt by the v9 PMS,
|
|
4
|
+
v10 websites by the v10 PMS. A site's own code decides the backend, and that code differs from
|
|
5
|
+
site to site, so the platform reads the one place where the decision is final: the config
|
|
6
|
+
`createWebsiteSDK` is constructed with. This release records it for the build's site manifest
|
|
7
|
+
(`@v-office/site-manifest` 0.1.0).
|
|
8
|
+
|
|
9
|
+
## Added
|
|
10
|
+
|
|
11
|
+
- `createWebsiteSDK` records the backend (`"v9"` or `"v10"`) of every SDK it constructs, once
|
|
12
|
+
the config was accepted, in a set under `globalThis[Symbol.for("@v-office/website-sdk/backends")]`.
|
|
13
|
+
`@v-office/site-manifest` reads it when the build is done and writes it to
|
|
14
|
+
`dist/site-manifest.json` as `backends`. A config the SDK refuses records nothing.
|
|
15
|
+
|
|
16
|
+
## Changed
|
|
17
|
+
|
|
18
|
+
- Nothing else. The record has no effect on what the SDK does, needs no import and is safe in
|
|
19
|
+
a browser bundle.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Migration: 2.23.0 to 2.24.0
|
|
2
|
+
|
|
3
|
+
## 1. Upgrade
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pnpm add @v-office/website-sdk@2.24.0
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
No changes are required.
|
|
10
|
+
|
|
11
|
+
## 2. Let the site manifest report the backend
|
|
12
|
+
|
|
13
|
+
The backend reaches the site manifest when the build also uses `@v-office/site-manifest` 0.1.0
|
|
14
|
+
or later (`siteManifest()` from `@v-office/site-manifest/astro` in `astro.config`). Nothing has
|
|
15
|
+
to be configured: the manifest reports the backend of every SDK the build constructs, in the
|
|
16
|
+
content loaders or while prerendering pages. An SDK that the site creates only in the browser
|
|
17
|
+
is not part of the build and is not reported.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Wt as V9_FACILITY_ATTRIBUTE_KEYS } from "./client-DC4LG3CP.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
|
|
3
|
+
import { a as toFacilityImages, c as toLocalizedString, d as rentalFacilitiesForObjectGroupRelationQuery, f as rentalIdsQuery, h as rentalsAllWithoutFeedbacksQuery, i as toLocation, m as rentalsAllFeedbacksQuery, o as toImages, p as rentalsAllByFacilityObjectGroupsWithoutFeedbacksQuery, r as renderVofficePropertyAttribute, s as toAddress, t as toRentalHighlights } from "./to-rental-highlights-C1NF2uuE.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
|
|
@@ -25,16 +25,6 @@ const toDescription = (data, locale) => {
|
|
|
25
25
|
return description;
|
|
26
26
|
};
|
|
27
27
|
//#endregion
|
|
28
|
-
//#region src/legacy-v9/parser/rentals/to-location.ts
|
|
29
|
-
const toLocation = (location) => {
|
|
30
|
-
if (location == null) return void 0;
|
|
31
|
-
const [longitude, latitude] = location.coordinates;
|
|
32
|
-
return {
|
|
33
|
-
latitude,
|
|
34
|
-
longitude
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
//#endregion
|
|
38
28
|
//#region src/legacy-v9/parser/rentals/to-property-attributes.ts
|
|
39
29
|
const toPropertyAttributes = ({ attributes, locale, translations }) => Effect.gen(function* () {
|
|
40
30
|
const items = [];
|
|
@@ -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-
|
|
2
|
-
import { c as parseVofficeUnitData
|
|
3
|
-
import {
|
|
1
|
+
import { a as parseQueryParameters, i as collectQueryParameters, n as makeV9CustomAttributeFilterCapabilities, o as toQueryString, r as toBasicQueryInputs, s as applyVofficeFilterDerivedBasicQueryInputs } from "./client-DC4LG3CP.mjs";
|
|
2
|
+
import { c as parseVofficeUnitData } from "./v9-data-BnYxa2Ek.mjs";
|
|
3
|
+
import { i as toLocation, l as mapSearchQuery, n as toV9RentalHighlightKey, o as toImages, s as toAddress, t as toRentalHighlights, u as searchQuery } from "./to-rental-highlights-C1NF2uuE.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
|
|
@@ -322,6 +322,18 @@ const toSearchPeriods = ({ locale, periods }) => Effect.succeed((periods ?? []).
|
|
|
322
322
|
}));
|
|
323
323
|
//#endregion
|
|
324
324
|
//#region src/legacy-v9/runtime/search.ts
|
|
325
|
-
|
|
325
|
+
/**
|
|
326
|
+
* The rental data `toSearchOutputItem` reads: name, address with the region name,
|
|
327
|
+
* images, and the v9 attribute behind each configured highlight key. Requesting
|
|
328
|
+
* every known attribute instead more than doubles the response for the same output.
|
|
329
|
+
*/
|
|
330
|
+
const toSearchDataAttributes = (rentalHighlightPrioritization) => [.../* @__PURE__ */ new Set([
|
|
331
|
+
"name",
|
|
332
|
+
"address",
|
|
333
|
+
"regionName",
|
|
334
|
+
"images",
|
|
335
|
+
...rentalHighlightPrioritization.flatMap((key) => toV9RentalHighlightKey(key) ?? [])
|
|
336
|
+
])];
|
|
337
|
+
const mapSearchDataAttributes = ["loc"];
|
|
326
338
|
//#endregion
|
|
327
|
-
export {
|
|
339
|
+
export { mapSearchDataAttributes, mapSearchQuery, parseVofficeUnitData, resolveExactMatch, searchQuery, toLocation, toQueryInput, toSearchDataAttributes, toSearchOutputItem, toSearchPeriods };
|