@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.
@@ -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 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": {
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 total\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",
@@ -1875,19 +1875,29 @@ const documents = {
1875
1875
  },
1876
1876
  selectionSet: {
1877
1877
  kind: "SelectionSet",
1878
- selections: [{
1879
- kind: "Field",
1880
- name: {
1881
- kind: "Name",
1882
- value: "hasMorePages"
1883
- }
1884
- }, {
1885
- kind: "Field",
1886
- name: {
1887
- kind: "Name",
1888
- value: "currentPage"
1878
+ selections: [
1879
+ {
1880
+ kind: "Field",
1881
+ name: {
1882
+ kind: "Name",
1883
+ value: "hasMorePages"
1884
+ }
1885
+ },
1886
+ {
1887
+ kind: "Field",
1888
+ name: {
1889
+ kind: "Name",
1890
+ value: "currentPage"
1891
+ }
1892
+ },
1893
+ {
1894
+ kind: "Field",
1895
+ name: {
1896
+ kind: "Name",
1897
+ value: "total"
1898
+ }
1889
1899
  }
1890
- }]
1900
+ ]
1891
1901
  }
1892
1902
  }, {
1893
1903
  kind: "Field",
@@ -2274,6 +2284,287 @@ const documents = {
2274
2284
  }]
2275
2285
  }
2276
2286
  }]
2287
+ },
2288
+ "\n query CoreSDK_MapSearch(\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 total\n }\n data {\n voffice_id\n data(attributes: $dataAttributes)\n }\n }\n }\n": {
2289
+ kind: "Document",
2290
+ definitions: [{
2291
+ kind: "OperationDefinition",
2292
+ operation: "query",
2293
+ name: {
2294
+ kind: "Name",
2295
+ value: "CoreSDK_MapSearch"
2296
+ },
2297
+ variableDefinitions: [
2298
+ {
2299
+ kind: "VariableDefinition",
2300
+ variable: {
2301
+ kind: "Variable",
2302
+ name: {
2303
+ kind: "Name",
2304
+ value: "first"
2305
+ }
2306
+ },
2307
+ type: {
2308
+ kind: "NonNullType",
2309
+ type: {
2310
+ kind: "NamedType",
2311
+ name: {
2312
+ kind: "Name",
2313
+ value: "Int"
2314
+ }
2315
+ }
2316
+ }
2317
+ },
2318
+ {
2319
+ kind: "VariableDefinition",
2320
+ variable: {
2321
+ kind: "Variable",
2322
+ name: {
2323
+ kind: "Name",
2324
+ value: "page"
2325
+ }
2326
+ },
2327
+ type: {
2328
+ kind: "NamedType",
2329
+ name: {
2330
+ kind: "Name",
2331
+ value: "Int"
2332
+ }
2333
+ }
2334
+ },
2335
+ {
2336
+ kind: "VariableDefinition",
2337
+ variable: {
2338
+ kind: "Variable",
2339
+ name: {
2340
+ kind: "Name",
2341
+ value: "language"
2342
+ }
2343
+ },
2344
+ type: {
2345
+ kind: "NamedType",
2346
+ name: {
2347
+ kind: "Name",
2348
+ value: "String"
2349
+ }
2350
+ }
2351
+ },
2352
+ {
2353
+ kind: "VariableDefinition",
2354
+ variable: {
2355
+ kind: "Variable",
2356
+ name: {
2357
+ kind: "Name",
2358
+ value: "vofficeData"
2359
+ }
2360
+ },
2361
+ type: {
2362
+ kind: "NamedType",
2363
+ name: {
2364
+ kind: "Name",
2365
+ value: "VofficeData"
2366
+ }
2367
+ }
2368
+ },
2369
+ {
2370
+ kind: "VariableDefinition",
2371
+ variable: {
2372
+ kind: "Variable",
2373
+ name: {
2374
+ kind: "Name",
2375
+ value: "basicQueryInputs"
2376
+ }
2377
+ },
2378
+ type: {
2379
+ kind: "ListType",
2380
+ type: {
2381
+ kind: "NonNullType",
2382
+ type: {
2383
+ kind: "NamedType",
2384
+ name: {
2385
+ kind: "Name",
2386
+ value: "BasicQueryInput"
2387
+ }
2388
+ }
2389
+ }
2390
+ }
2391
+ },
2392
+ {
2393
+ kind: "VariableDefinition",
2394
+ variable: {
2395
+ kind: "Variable",
2396
+ name: {
2397
+ kind: "Name",
2398
+ value: "dataAttributes"
2399
+ }
2400
+ },
2401
+ type: {
2402
+ kind: "NonNullType",
2403
+ type: {
2404
+ kind: "ListType",
2405
+ type: {
2406
+ kind: "NonNullType",
2407
+ type: {
2408
+ kind: "NamedType",
2409
+ name: {
2410
+ kind: "Name",
2411
+ value: "String"
2412
+ }
2413
+ }
2414
+ }
2415
+ }
2416
+ },
2417
+ defaultValue: {
2418
+ kind: "ListValue",
2419
+ values: []
2420
+ }
2421
+ }
2422
+ ],
2423
+ selectionSet: {
2424
+ kind: "SelectionSet",
2425
+ selections: [{
2426
+ kind: "Field",
2427
+ name: {
2428
+ kind: "Name",
2429
+ value: "search"
2430
+ },
2431
+ arguments: [
2432
+ {
2433
+ kind: "Argument",
2434
+ name: {
2435
+ kind: "Name",
2436
+ value: "first"
2437
+ },
2438
+ value: {
2439
+ kind: "Variable",
2440
+ name: {
2441
+ kind: "Name",
2442
+ value: "first"
2443
+ }
2444
+ }
2445
+ },
2446
+ {
2447
+ kind: "Argument",
2448
+ name: {
2449
+ kind: "Name",
2450
+ value: "page"
2451
+ },
2452
+ value: {
2453
+ kind: "Variable",
2454
+ name: {
2455
+ kind: "Name",
2456
+ value: "page"
2457
+ }
2458
+ }
2459
+ },
2460
+ {
2461
+ kind: "Argument",
2462
+ name: {
2463
+ kind: "Name",
2464
+ value: "language"
2465
+ },
2466
+ value: {
2467
+ kind: "Variable",
2468
+ name: {
2469
+ kind: "Name",
2470
+ value: "language"
2471
+ }
2472
+ }
2473
+ },
2474
+ {
2475
+ kind: "Argument",
2476
+ name: {
2477
+ kind: "Name",
2478
+ value: "voffice"
2479
+ },
2480
+ value: {
2481
+ kind: "Variable",
2482
+ name: {
2483
+ kind: "Name",
2484
+ value: "vofficeData"
2485
+ }
2486
+ }
2487
+ },
2488
+ {
2489
+ kind: "Argument",
2490
+ name: {
2491
+ kind: "Name",
2492
+ value: "data"
2493
+ },
2494
+ value: {
2495
+ kind: "Variable",
2496
+ name: {
2497
+ kind: "Name",
2498
+ value: "basicQueryInputs"
2499
+ }
2500
+ }
2501
+ }
2502
+ ],
2503
+ selectionSet: {
2504
+ kind: "SelectionSet",
2505
+ selections: [{
2506
+ kind: "Field",
2507
+ name: {
2508
+ kind: "Name",
2509
+ value: "paginatorInfo"
2510
+ },
2511
+ selectionSet: {
2512
+ kind: "SelectionSet",
2513
+ selections: [{
2514
+ kind: "Field",
2515
+ name: {
2516
+ kind: "Name",
2517
+ value: "hasMorePages"
2518
+ }
2519
+ }, {
2520
+ kind: "Field",
2521
+ name: {
2522
+ kind: "Name",
2523
+ value: "total"
2524
+ }
2525
+ }]
2526
+ }
2527
+ }, {
2528
+ kind: "Field",
2529
+ name: {
2530
+ kind: "Name",
2531
+ value: "data"
2532
+ },
2533
+ selectionSet: {
2534
+ kind: "SelectionSet",
2535
+ selections: [{
2536
+ kind: "Field",
2537
+ name: {
2538
+ kind: "Name",
2539
+ value: "voffice_id"
2540
+ }
2541
+ }, {
2542
+ kind: "Field",
2543
+ name: {
2544
+ kind: "Name",
2545
+ value: "data"
2546
+ },
2547
+ arguments: [{
2548
+ kind: "Argument",
2549
+ name: {
2550
+ kind: "Name",
2551
+ value: "attributes"
2552
+ },
2553
+ value: {
2554
+ kind: "Variable",
2555
+ name: {
2556
+ kind: "Name",
2557
+ value: "dataAttributes"
2558
+ }
2559
+ }
2560
+ }]
2561
+ }]
2562
+ }
2563
+ }]
2564
+ }
2565
+ }]
2566
+ }
2567
+ }]
2277
2568
  }
2278
2569
  };
2279
2570
  function graphql(source) {
@@ -2471,6 +2762,7 @@ const searchQuery = graphql(`
2471
2762
  paginatorInfo {
2472
2763
  hasMorePages
2473
2764
  currentPage
2765
+ total
2474
2766
  }
2475
2767
  data {
2476
2768
  voffice_id
@@ -2530,6 +2822,33 @@ const searchQuery = graphql(`
2530
2822
  }
2531
2823
  }
2532
2824
  `);
2825
+ const mapSearchQuery = graphql(`
2826
+ query CoreSDK_MapSearch(
2827
+ $first: Int!
2828
+ $page: Int
2829
+ $language: String
2830
+ $vofficeData: VofficeData
2831
+ $basicQueryInputs: [BasicQueryInput!]
2832
+ $dataAttributes: [String!]! = []
2833
+ ) {
2834
+ search(
2835
+ first: $first
2836
+ page: $page
2837
+ language: $language
2838
+ voffice: $vofficeData
2839
+ data: $basicQueryInputs
2840
+ ) {
2841
+ paginatorInfo {
2842
+ hasMorePages
2843
+ total
2844
+ }
2845
+ data {
2846
+ voffice_id
2847
+ data(attributes: $dataAttributes)
2848
+ }
2849
+ }
2850
+ }
2851
+ `);
2533
2852
  //#endregion
2534
2853
  //#region src/legacy-v9/parser/rentals/to-localized-string.ts
2535
2854
  const isNonEmptyString$1 = (value) => typeof value === "string" && value.length > 0;
@@ -2730,6 +3049,16 @@ const toFacilityImages = (images, locale) => images.flatMap((image) => {
2730
3049
  return [item];
2731
3050
  });
2732
3051
  //#endregion
3052
+ //#region src/legacy-v9/parser/rentals/to-location.ts
3053
+ const toLocation = (location) => {
3054
+ if (location == null) return void 0;
3055
+ const [longitude, latitude] = location.coordinates;
3056
+ return {
3057
+ latitude,
3058
+ longitude
3059
+ };
3060
+ };
3061
+ //#endregion
2733
3062
  //#region src/legacy-v9/parser/rentals/render-property-attribute.ts
2734
3063
  const countLabelKey = (labelKey, value) => `${labelKey.slice(0, -6)}.count.${value === 1 ? "one" : "other"}`;
2735
3064
  const renderVofficePropertyAttribute = ({ key, metadata, locale, translate, value }) => Effect.gen(function* () {
@@ -3143,4 +3472,4 @@ const toRentalHighlights = ({ locale, translations, highlightPrioritization, cus
3143
3472
  return highlights;
3144
3473
  });
3145
3474
  //#endregion
3146
- export { toAddress as a, rentalFacilitiesForObjectGroupRelationQuery as c, rentalsAllFeedbacksQuery as d, rentalsAllWithoutFeedbacksQuery as f, toImages as i, rentalIdsQuery as l, renderVofficePropertyAttribute as n, toLocalizedString as o, toFacilityImages as r, searchQuery as s, toRentalHighlights as t, rentalsAllByFacilityObjectGroupsWithoutFeedbacksQuery as u };
3475
+ export { toFacilityImages as a, toLocalizedString as c, rentalFacilitiesForObjectGroupRelationQuery as d, rentalIdsQuery as f, rentalsAllWithoutFeedbacksQuery as h, toLocation as i, mapSearchQuery as l, rentalsAllFeedbacksQuery as m, toV9RentalHighlightKey as n, toImages as o, rentalsAllByFacilityObjectGroupsWithoutFeedbacksQuery as p, renderVofficePropertyAttribute as r, toAddress as s, toRentalHighlights as t, searchQuery as u };
@@ -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,3 @@
1
+ {
2
+ "componentsAffectedByHeadlessChange": []
3
+ }
@@ -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.