@v-office/website-sdk 2.21.0 → 2.23.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-dWCukmLr.mjs → client-CGO5Pmuv.mjs} +215 -34
- package/dist/index.d.mts +88 -6
- 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 +124 -1
- package/dist/instructions/versions/2.22.0/CHANGELOG.md +30 -0
- package/dist/instructions/versions/2.22.0/MIGRATION.md +27 -0
- package/dist/instructions/versions/2.23.0/CHANGELOG.md +62 -0
- package/dist/instructions/versions/2.23.0/MIGRATION.md +33 -0
- package/dist/{rentals-CIhOx3dS.mjs → rentals-C1W7EvIC.mjs} +2 -12
- package/dist/{search-D9xq3Z-m.mjs → search-GjMxosfU.mjs} +32 -14
- 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 +124 -1
- package/instructions/versions/2.22.0/CHANGELOG.md +30 -0
- package/instructions/versions/2.22.0/MIGRATION.md +27 -0
- package/instructions/versions/2.22.0/release.json +3 -0
- 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/package.json +7 -3
|
@@ -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
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
kind: "
|
|
1888
|
-
|
|
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 {
|
|
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.23.0/CHANGELOG.md`: release notes for 2.23.0
|
|
8
|
+
- `versions/2.22.0/CHANGELOG.md`: release notes for 2.22.0
|
|
7
9
|
- `versions/2.21.0/CHANGELOG.md`: release notes for 2.21.0
|
|
8
10
|
- `versions/2.20.4/CHANGELOG.md`: release notes for 2.20.4
|
|
9
11
|
- `versions/2.20.3/CHANGELOG.md`: release notes for 2.20.3
|
|
@@ -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.23.0/MIGRATION.md`: Migration: 2.22.0 to 2.23.0
|
|
8
|
+
- `versions/2.22.0/MIGRATION.md`: Migration: 2.21.0 to 2.22.0
|
|
7
9
|
- `versions/2.21.0/MIGRATION.md`: Migration: 2.20.4 to 2.21.0
|
|
8
10
|
- `versions/2.20.4/MIGRATION.md`: Migration: 2.20.3 to 2.20.4
|
|
9
11
|
- `versions/2.20.3/MIGRATION.md`: Migration: 2.20.2 to 2.20.3
|
package/instructions/creation.md
CHANGED
|
@@ -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
|
package/instructions/search.md
CHANGED
|
@@ -374,6 +374,38 @@ requested locale; backend numeric amounts and modifier type keys are not exposed
|
|
|
374
374
|
individual modifier lines. Exact-period results are returned in `items`;
|
|
375
375
|
alternative-period suggestions are returned in root-level `alternatives`.
|
|
376
376
|
|
|
377
|
+
On legacy v9 only, an exact match may include `matchingPeriods` when the backend
|
|
378
|
+
chose the dates itself in a window search (`start`/`end` plus `minNights`/`maxNights`).
|
|
379
|
+
The field exists only on the v9 facade: `sdk.live.search.search` of a
|
|
380
|
+
`WebsiteSDKV9` returns `V9SearchSearchOutput`, whose items are
|
|
381
|
+
`V9SearchSearchOutputItem`. Narrow on `sdk.backend === "v9"` to read it. Each entry has the same shape as an `alternativePeriods` entry: `start`, `end`,
|
|
382
|
+
and the optional `formattedTotal` and `discount` for that period. Entries keep the
|
|
383
|
+
backend order. The item's own `formattedTotal` and `discount` are the price of the
|
|
384
|
+
first entry when that entry has one; otherwise they are the backend's overall price
|
|
385
|
+
for the hit. Show `matchingPeriods[0]` as the dates the card price is for, and open
|
|
386
|
+
the rental page with those dates so card and detail price agree. For a
|
|
387
|
+
fixed-period search without a window, the dates are the requested ones and
|
|
388
|
+
`matchingPeriods` is absent, never an empty array.
|
|
389
|
+
|
|
390
|
+
```json
|
|
391
|
+
{
|
|
392
|
+
"id": "214950",
|
|
393
|
+
"nameOrLabel": "Ferienhaus Seeblick",
|
|
394
|
+
"timeZone": "Europe/Berlin",
|
|
395
|
+
"formattedTotal": "1.144,10 €",
|
|
396
|
+
"matchingPeriods": [
|
|
397
|
+
{
|
|
398
|
+
"start": "2026-10-01",
|
|
399
|
+
"end": "2026-10-08",
|
|
400
|
+
"formattedTotal": "1.144,10 €"
|
|
401
|
+
}
|
|
402
|
+
]
|
|
403
|
+
}
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
`pageInfo.totalCount` is the number of rentals the backend matched for the search
|
|
407
|
+
over all pages.
|
|
408
|
+
|
|
377
409
|
`appliedFilters` reports what the backend actually applied, and is what a "remove
|
|
378
410
|
this filter" chip should be built from. `label` is localized presentation and can
|
|
379
411
|
repeat, so it cannot identify a filter; `key` plus `value` can. `value` is the
|
|
@@ -395,6 +427,84 @@ the expanded leaf entries. A UI may collapse those leaves under the composition
|
|
|
395
427
|
display, but should keep the returned keys and canonical values when removing direct
|
|
396
428
|
filters.
|
|
397
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
|
+
|
|
398
508
|
## Backend Behavior
|
|
399
509
|
|
|
400
510
|
### v10
|
|
@@ -421,6 +531,10 @@ projection:
|
|
|
421
531
|
and booking flow.
|
|
422
532
|
- Pagination uses the backend `from`/`size` window behind the same opaque `cursor`,
|
|
423
533
|
capped at 1,000 results.
|
|
534
|
+
- v10 items have no `matchingPeriods`. A v10 hit counts as exact only when its period
|
|
535
|
+
equals the requested fixed period; a hit the backend priced for other dates,
|
|
536
|
+
including every hit of a `minNights`/`maxNights` window search, is returned in
|
|
537
|
+
`alternatives` with its dates in `alternativePeriods`.
|
|
424
538
|
|
|
425
539
|
### Legacy v9
|
|
426
540
|
|
|
@@ -442,7 +556,16 @@ shape:
|
|
|
442
556
|
formatted original total.
|
|
443
557
|
- The same mapping applies to exact-period items and individual alternative
|
|
444
558
|
periods.
|
|
559
|
+
- For an exact match, every `additional_voffice_data.matchingPeriods` entry with
|
|
560
|
+
both dates becomes a `matchingPeriods` entry (`fromdate`/`tilldate` become
|
|
561
|
+
`start`/`end`, its `calc` becomes the period's price fields); entries without
|
|
562
|
+
dates are dropped. In a window search the guest enters a window and a stay
|
|
563
|
+
length, not the stay itself. The backend returns the bookable stays inside the
|
|
564
|
+
window, earliest first; the SDK keeps that order.
|
|
445
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`.
|
|
446
569
|
|
|
447
570
|
The field is omitted when v9 returns no final total or when its original total is
|
|
448
571
|
not greater than the final total. v9 exposes at most one aggregated applied entry,
|
|
@@ -454,7 +577,7 @@ Use flat `WebsiteSDKConfig` files and optional `WebsiteSDKOptions`.
|
|
|
454
577
|
|
|
455
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.
|
|
456
579
|
|
|
457
|
-
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.
|
|
458
581
|
|
|
459
582
|
## CLI Usage
|
|
460
583
|
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Changelog: 2.22.0
|
|
2
|
+
|
|
3
|
+
On a v9 hub, a search over a date window (`start`/`end` with `minNights`/`maxNights`)
|
|
4
|
+
lets the hub pick the stay itself: the earliest bookable stay in the window. Such a hit came back as an exact result with a price but without the
|
|
5
|
+
dates that price was for. A site could only link the rental page with the
|
|
6
|
+
window the guest typed, and the detail page then showed a different price than
|
|
7
|
+
the card.
|
|
8
|
+
|
|
9
|
+
## Added
|
|
10
|
+
|
|
11
|
+
- `v9`: exact search results carry `matchingPeriods` when the hub chose the
|
|
12
|
+
dates. Each entry has `start`, `end` and the optional `formattedTotal` and
|
|
13
|
+
`discount` for that period, in the hub's order. The field is absent for a
|
|
14
|
+
fixed-period search, never an empty array.
|
|
15
|
+
- Types `V9SearchSearchOutput` and `V9SearchSearchOutputItem`.
|
|
16
|
+
`sdk.live.search.search` of a `WebsiteSDKV9` now returns
|
|
17
|
+
`V9SearchSearchOutput`; narrow on `sdk.backend === "v9"` to read
|
|
18
|
+
`matchingPeriods`.
|
|
19
|
+
|
|
20
|
+
## Changed
|
|
21
|
+
|
|
22
|
+
- `v9`: the `formattedTotal` and `discount` of an exact result are the price of
|
|
23
|
+
its first `matchingPeriods` entry when that entry has a price.
|
|
24
|
+
|
|
25
|
+
## Unchanged
|
|
26
|
+
|
|
27
|
+
- Fixed-period searches on v9: same items, same prices, no new field.
|
|
28
|
+
- Alternatives and their `alternativePeriods`.
|
|
29
|
+
- The v10 backend. v10 items have no `matchingPeriods`; a v10 hit for other
|
|
30
|
+
dates than the requested ones is still returned in `alternatives`.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Migration: 2.21.0 to 2.22.0
|
|
2
|
+
|
|
3
|
+
## 1. Upgrade
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pnpm add @v-office/website-sdk@2.22.0
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
No changes are required. The v9 search result type is a superset of the
|
|
10
|
+
previous one, so existing code compiles and renders as before.
|
|
11
|
+
|
|
12
|
+
## 2. Show the dates of a window-search hit (`v9`)
|
|
13
|
+
|
|
14
|
+
A v9 site that offers a date window with a night range should show
|
|
15
|
+
`matchingPeriods[0]` on the result card as the dates the price is for, and open
|
|
16
|
+
the rental page with those dates instead of the typed window. Card and detail
|
|
17
|
+
page then show the same price.
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
if (sdk.backend === "v9") {
|
|
21
|
+
const output = await sdk.live.search.search(input);
|
|
22
|
+
for (const item of output.items) {
|
|
23
|
+
const period = item.matchingPeriods?.[0];
|
|
24
|
+
// period?.start, period?.end: dates for the card and the rental link
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
```
|