@v-office/website-sdk 2.34.0 → 2.36.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/README.md +3 -3
- package/dist/cli.mjs +12 -4
- package/dist/{client-C1McSXf1.mjs → client-D44b3iET.mjs} +247 -42
- package/dist/index.d.mts +27 -2
- package/dist/index.mjs +1 -1
- package/dist/instructions/CHANGELOG.md +2 -0
- package/dist/instructions/MIGRATION.md +2 -0
- package/dist/instructions/README.md +2 -1
- package/dist/instructions/availability.md +52 -0
- package/dist/instructions/creation.md +3 -3
- package/dist/instructions/custom-attributes.md +11 -8
- package/dist/instructions/regions.md +123 -0
- package/dist/instructions/search.md +3 -0
- package/dist/instructions/versions/2.35.0/CHANGELOG.md +28 -0
- package/dist/instructions/versions/2.35.0/MIGRATION.md +39 -0
- package/dist/instructions/versions/2.36.0/CHANGELOG.md +17 -0
- package/dist/instructions/versions/2.36.0/MIGRATION.md +9 -0
- package/dist/{operations-CUWcmNGK.mjs → operations-C1VMQYN2.mjs} +62 -1
- package/dist/{rentals-yMGMrIHJ.mjs → rentals-TAEGMfgF.mjs} +3 -3
- package/dist/{search-DiEV8NhE.mjs → search-ByfrSxM6.mjs} +3 -3
- package/dist/{to-rental-highlights-Dbnm6Y4_.mjs → to-rental-highlights-BdxQPpBU.mjs} +1 -1
- package/instructions/CHANGELOG.md +2 -0
- package/instructions/MIGRATION.md +2 -0
- package/instructions/README.md +2 -1
- package/instructions/availability.md +52 -0
- package/instructions/creation.md +3 -3
- package/instructions/custom-attributes.md +11 -8
- package/instructions/regions.md +123 -0
- package/instructions/search.md +3 -0
- package/instructions/versions/2.35.0/CHANGELOG.md +28 -0
- package/instructions/versions/2.35.0/MIGRATION.md +39 -0
- package/instructions/versions/2.35.0/release.json +3 -0
- package/instructions/versions/2.36.0/CHANGELOG.md +17 -0
- package/instructions/versions/2.36.0/MIGRATION.md +9 -0
- package/instructions/versions/2.36.0/release.json +3 -0
- package/package.json +3 -3
|
@@ -167,6 +167,52 @@ Treat `null` as no limit.
|
|
|
167
167
|
See `versions/2.28.0/CHANGELOG.md` and
|
|
168
168
|
`versions/2.28.0/MIGRATION.md`.
|
|
169
169
|
|
|
170
|
+
### Legacy v9 Blocked Ranges
|
|
171
|
+
|
|
172
|
+
From 2.36.0, v9 returns the ranges in which several rentals cannot be booked freely:
|
|
173
|
+
bookings, owner blocks, closures and on-request days. Use it for a timeline that shows
|
|
174
|
+
every rental of a holiday complex. v10 has no `getBlockedRanges`; check
|
|
175
|
+
`sdk.backend === "v9"` first.
|
|
176
|
+
|
|
177
|
+
```ts
|
|
178
|
+
if (sdk.backend === "v9") {
|
|
179
|
+
const { rentals } = await sdk.live.availability.getBlockedRanges({
|
|
180
|
+
rentalIds: ["212402", "212350"],
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
```json
|
|
186
|
+
{
|
|
187
|
+
"rentals": [
|
|
188
|
+
{
|
|
189
|
+
"rentalId": "212402",
|
|
190
|
+
"availableFrom": "2026-10-15",
|
|
191
|
+
"ranges": [{ "start": "2026-11-08", "end": "2026-11-21", "status": "unavailable" }]
|
|
192
|
+
},
|
|
193
|
+
{ "rentalId": "212350", "availableFrom": "2026-10-15", "ranges": [] }
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
- `start` is the arrival day, `end` the departure day. The night before `end` is the last
|
|
199
|
+
blocked night, so the next stay can start on `end`.
|
|
200
|
+
- `end` is `null` when the range runs to the end of the known data. Draw it to the edge of
|
|
201
|
+
the view.
|
|
202
|
+
- `status` is `unavailable` for bookings, owner blocks and closures, which vOffice does not
|
|
203
|
+
tell apart, and `on_request` for days that can only be requested. Back-to-back bookings
|
|
204
|
+
appear as one range.
|
|
205
|
+
- Every day from `availableFrom` that no range covers is free. Days before
|
|
206
|
+
`availableFrom` are unknown. For most rentals `availableFrom` is today; an older date
|
|
207
|
+
means vOffice has not refreshed that rental's data since.
|
|
208
|
+
- Rentals come back in the order of `rentalIds`. Unknown or invalid IDs are left out, so
|
|
209
|
+
show "no data" for a rental that is missing instead of drawing it free.
|
|
210
|
+
|
|
211
|
+
Call it in the browser when the timeline opens. Every call reads vOffice's availability
|
|
212
|
+
export page by page, and vOffice bills each page. The browser caches each page for 60
|
|
213
|
+
seconds, so opening the timeline again within a minute costs nothing. Do not call it at
|
|
214
|
+
build time: the data is out of date by the next booking.
|
|
215
|
+
|
|
170
216
|
## Configuration
|
|
171
217
|
|
|
172
218
|
Use flat `WebsiteSDKConfig` files.
|
|
@@ -211,6 +257,12 @@ Fetch availability after selecting a start date:
|
|
|
211
257
|
website-sdk --backend v9 availability start-date-selected --rental-id 123 --selected-start-date 2026-07-08 --calculate-from-date 2026-07-01 --calculate-through-date 2026-08-01
|
|
212
258
|
```
|
|
213
259
|
|
|
260
|
+
Fetch the booked stays of v9 rentals:
|
|
261
|
+
|
|
262
|
+
```sh
|
|
263
|
+
website-sdk --backend v9 availability blocked-ranges --rental-ids 212402,212350
|
|
264
|
+
```
|
|
265
|
+
|
|
214
266
|
Use files instead of environment variables:
|
|
215
267
|
|
|
216
268
|
```sh
|
|
@@ -244,11 +244,11 @@ Custom attributes are configured through `customAttributes`, built by
|
|
|
244
244
|
const customAttributes = defineCustomAttributes({
|
|
245
245
|
catalog,
|
|
246
246
|
select: {
|
|
247
|
-
|
|
248
|
-
label: { "de-DE": "
|
|
247
|
+
beach: {
|
|
248
|
+
label: { "de-DE": "Strand", "en-US": "Beach" },
|
|
249
249
|
filter: true,
|
|
250
250
|
optionLabels: {
|
|
251
|
-
|
|
251
|
+
sand: { "de-DE": "Sandstrand", "en-US": "Sandy beach" },
|
|
252
252
|
},
|
|
253
253
|
},
|
|
254
254
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Custom Attributes
|
|
2
2
|
|
|
3
|
-
Custom attributes are workspace-specific rental metadata: a sauna flag, a
|
|
3
|
+
Custom attributes are workspace-specific rental metadata: a sauna flag, a beach type, an
|
|
4
4
|
occupancy score, a marketing text. This document covers how to configure them, how
|
|
5
5
|
they behave on each backend, and what changes when a site moves from `v9` to `v10`.
|
|
6
6
|
|
|
@@ -11,6 +11,9 @@ They serve three separate concerns, and each is configured independently:
|
|
|
11
11
|
- **Backend identity**: the workspace-specific v10 definition ID or v9 rental-data
|
|
12
12
|
field the SDK must talk to.
|
|
13
13
|
|
|
14
|
+
Regions are not custom attributes. Read the website's region tree with
|
|
15
|
+
`sdk.static.regions.getRegions` (see `regions.md`), not a "Region" attribute.
|
|
16
|
+
|
|
14
17
|
## Two Halves: Catalog and Policy
|
|
15
18
|
|
|
16
19
|
Configuration is a join of two things that have different owners.
|
|
@@ -30,12 +33,12 @@ const customAttributes = defineCustomAttributes({
|
|
|
30
33
|
catalog,
|
|
31
34
|
select: {
|
|
32
35
|
sauna: { label: { "de-DE": "Sauna", "en-US": "Sauna" } },
|
|
33
|
-
|
|
34
|
-
label: { "de-DE": "
|
|
36
|
+
beach: {
|
|
37
|
+
label: { "de-DE": "Strand", "en-US": "Beach" },
|
|
35
38
|
filter: true,
|
|
36
39
|
optionLabels: {
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
sand: { "de-DE": "Sandstrand", "en-US": "Sandy beach" },
|
|
41
|
+
grass: { "de-DE": "Grünstrand", "en-US": "Grass beach" },
|
|
39
42
|
},
|
|
40
43
|
},
|
|
41
44
|
},
|
|
@@ -51,7 +54,7 @@ site means the build fails. Every problem is reported in one pass:
|
|
|
51
54
|
Invalid custom attribute configuration (3 problems):
|
|
52
55
|
- sauna.label: missing a label for de-DE; the catalog supplies none, so it must be authored
|
|
53
56
|
- amenityTags: backend type MULTI_SELECT has no canonical SDK value type yet, so it cannot be selected
|
|
54
|
-
-
|
|
57
|
+
- beach.optionLabels: a filterable option attribute needs a label for every option; missing grass, pebble
|
|
55
58
|
```
|
|
56
59
|
|
|
57
60
|
## The Catalog
|
|
@@ -268,7 +271,7 @@ When a value cannot be read as the declared type — an `int` of `"1.5"` or an o
|
|
|
268
271
|
value the catalog does not declare — the attribute is omitted rather than rendering
|
|
269
272
|
something misleading. A false boolean and an absent value are also omitted.
|
|
270
273
|
|
|
271
|
-
Scalar filters take **one** value. Given `?
|
|
274
|
+
Scalar filters take **one** value. Given `?beach=sand,grass`, the first valid value
|
|
272
275
|
is applied, but the key also remains in `unusedFilterKeys` because the extra token was
|
|
273
276
|
not applied. Combining scalar values would depend on backend semantics that are not
|
|
274
277
|
specified, and an AND of two option values can only return nothing.
|
|
@@ -286,7 +289,7 @@ const options = defineWebsiteSDKOptions({
|
|
|
286
289
|
customAttributes,
|
|
287
290
|
rentalHighlightPrioritization: [
|
|
288
291
|
"bedrooms",
|
|
289
|
-
customAttributes.keys.
|
|
292
|
+
customAttributes.keys.beach, // checked for a literal typed registry
|
|
290
293
|
"bathrooms",
|
|
291
294
|
],
|
|
292
295
|
});
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Regions
|
|
2
|
+
|
|
3
|
+
Regions group a site's rentals into a tree, for example Nordsee → Dornum → Dornumersiel.
|
|
4
|
+
`sdk.static.regions.getRegions` returns the tree in the same shape on both backends, so
|
|
5
|
+
region pages and the search's region field are the same code on v10 and v9.
|
|
6
|
+
|
|
7
|
+
| | v10 | v9 |
|
|
8
|
+
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
|
|
9
|
+
| Source | the websites service: editors arrange regions in the CMS (Websites → "Regionen"), and a website can have its own tree instead of the workspace's default | vOffice's region hierarchy, through the be-on! Hub |
|
|
10
|
+
| Regions per rental | several | one; it also counts for every region above it |
|
|
11
|
+
| Names | German and English | German; English when vOffice has it |
|
|
12
|
+
| Slugs | set by editors | generated from the names |
|
|
13
|
+
| Order | the editors' order | siblings by German name |
|
|
14
|
+
| Regions returned | every region in the tree | only regions holding a rental of the be-on key |
|
|
15
|
+
|
|
16
|
+
Regions are not a custom attribute. Do not read a "Region" custom attribute, and do not
|
|
17
|
+
select one in `defineCustomAttributes`: the tree replaces both.
|
|
18
|
+
|
|
19
|
+
## Reading The Tree
|
|
20
|
+
|
|
21
|
+
Read the tree once per build, at build time:
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
const regions = await sdk.static.regions.getRegions({
|
|
25
|
+
aiStudioWebsiteId: Number(process.env.WEB_ID),
|
|
26
|
+
});
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`WEB_ID` is the AI Studio website id. The builder and the editor's dev server set it. v9
|
|
30
|
+
ignores it: vOffice keeps one region tree per customer.
|
|
31
|
+
|
|
32
|
+
Every call reads the whole tree, and neither backend caches it, so call it once and pass
|
|
33
|
+
the result on. Never call it per component, per page in the browser, or per request. A
|
|
34
|
+
failed read rejects, so the build stops instead of publishing a site without its regions.
|
|
35
|
+
A v10 website the service has no tree for returns an empty tree.
|
|
36
|
+
|
|
37
|
+
On v10, every change editors make to regions or region assignments queues a new build of
|
|
38
|
+
the website. A site never has to poll.
|
|
39
|
+
|
|
40
|
+
## The Result
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
type WebsiteRegions = {
|
|
44
|
+
isWebsiteOverride: boolean; // v10: true for the website's own tree; always false on v9
|
|
45
|
+
regions: readonly WebsiteRegion[];
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
type WebsiteRegion = {
|
|
49
|
+
id: string;
|
|
50
|
+
parentId: string | null; // null: top level
|
|
51
|
+
depth: number; // 0: top level
|
|
52
|
+
name: { "de-DE": string; "en-US": string };
|
|
53
|
+
slug: { "de-DE": string; "en-US": string };
|
|
54
|
+
path: { "de-DE": string; "en-US": string }; // "nordsee/dornum"
|
|
55
|
+
description: { "de-DE"?: string; "en-US"?: string };
|
|
56
|
+
ownRentalIds: readonly string[];
|
|
57
|
+
rentalIds: readonly string[];
|
|
58
|
+
};
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
- `regions` is depth first: every region comes before its subregions. Render it top to
|
|
62
|
+
bottom, or rebuild the tree from `parentId`.
|
|
63
|
+
- `name` and `slug` always hold both languages. When only one exists, the other language
|
|
64
|
+
uses it. `description` holds only the languages a description exists in.
|
|
65
|
+
- A slug is unique among its siblings, not across the tree. `path` joins the slugs of the
|
|
66
|
+
region's ancestors and its own with `/`, and is unique: use it as the URL path. On v9,
|
|
67
|
+
renaming a region in vOffice changes its slug and so its page URL.
|
|
68
|
+
- `ownRentalIds` are the rentals in the region itself. `rentalIds` adds every subregion's
|
|
69
|
+
rentals, each rental once. A region page lists `rentalIds`: "Nordsee" shows Dornum's
|
|
70
|
+
and Dornumersiel's rentals too.
|
|
71
|
+
- The ids are rental ids as `getRentals` returns them. Neither backend applies the SDK's
|
|
72
|
+
`rentalScope`: list only the rentals the site has.
|
|
73
|
+
|
|
74
|
+
## Region Pages And Rental URLs
|
|
75
|
+
|
|
76
|
+
Build one page per region from `path`, for example `/regionen/nordsee/dornum`, with the
|
|
77
|
+
name, the description and the rentals of `rentalIds`.
|
|
78
|
+
|
|
79
|
+
A rental keeps the one URL it already has. Never nest a rental's URL under a region: a
|
|
80
|
+
rental in several regions would get several URLs. Region pages link to the rental's own
|
|
81
|
+
page.
|
|
82
|
+
|
|
83
|
+
## Search
|
|
84
|
+
|
|
85
|
+
The search bar's region field and the `?region=` scope work in the browser, on facts the
|
|
86
|
+
build attaches to each rental. `@v-office/website-headless` turns the tree into both:
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
import {
|
|
90
|
+
cardSource,
|
|
91
|
+
rentalFactsMap,
|
|
92
|
+
regionOptions,
|
|
93
|
+
regionsByRental,
|
|
94
|
+
} from "@v-office/website-headless";
|
|
95
|
+
|
|
96
|
+
const options = regionOptions(regions, {
|
|
97
|
+
locale: "de-DE",
|
|
98
|
+
rentalIds: rentals.map((rental) => rental.id),
|
|
99
|
+
});
|
|
100
|
+
const regionsOf = regionsByRental(regions); // rental id → region ids
|
|
101
|
+
|
|
102
|
+
const sources = rentals.map((rental) =>
|
|
103
|
+
cardSource(rental, { rentalHref, regions: regionsOf[rental.id] ?? [] }),
|
|
104
|
+
);
|
|
105
|
+
const facts = rentalFactsMap(sources); // the search results' `facts`
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Pass `options` as they are as the `regions` prop of `SearchBar` from
|
|
109
|
+
`@v-office/website-components`; `createSearchForm` takes their `value`s. A region without
|
|
110
|
+
rentals is not offered, and `rentalIds` keeps a region whose rentals are all outside the
|
|
111
|
+
site's `rentalScope` out of the field and its counts.
|
|
112
|
+
|
|
113
|
+
The value of a region is its `id` (`?region=<id>`). A rental counts for a region and for
|
|
114
|
+
every region above it, so `?region=<id of Nordsee>` also finds the rentals in Dornum. To word a
|
|
115
|
+
`?region=` chip with the region's name instead of its id, curate a hidden `region` facet
|
|
116
|
+
with the same options:
|
|
117
|
+
|
|
118
|
+
```ts
|
|
119
|
+
{ kind: "facet", key: "region", label: "Region", options, hidden: true }
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
On v9 this replaces the Hub `region` filter (`search.md`, "A Filter By Region") for the
|
|
123
|
+
region field: it needs no Hub entry. A site that already uses the Hub filter keeps working.
|
|
@@ -296,6 +296,9 @@ Hub knows. The English labels are the German names; translate them.
|
|
|
296
296
|
|
|
297
297
|
#### A Filter By Region
|
|
298
298
|
|
|
299
|
+
For a region field in the search, prefer the region tree (`regions.md`): it works on v10
|
|
300
|
+
and v9 and needs no Hub entry.
|
|
301
|
+
|
|
299
302
|
`region` keeps rentals in one vOffice region and in its subregions: the region "Sylt"
|
|
300
303
|
also finds the rentals in "Westerland" and "Kampen". The be-on! Hub builds the list of
|
|
301
304
|
regions from the rentals of the be-on key.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Changelog: 2.35.0
|
|
2
|
+
|
|
3
|
+
Websites can read their region tree, in one shape on v10 and v9, instead of a "Region"
|
|
4
|
+
custom attribute or the Hub `region` filter. Region pages and the search's region field
|
|
5
|
+
become the same code on both backends.
|
|
6
|
+
|
|
7
|
+
## Added
|
|
8
|
+
|
|
9
|
+
- `sdk.static.regions.getRegions({ aiStudioWebsiteId })`, a build-time read of the
|
|
10
|
+
website's region tree. Pass `Number(process.env.WEB_ID)`, which the builder and the
|
|
11
|
+
editor set.
|
|
12
|
+
- v10: the tree editors maintain in the CMS (Websites → "Regionen"); a website can have
|
|
13
|
+
its own tree. A rental can sit in several regions.
|
|
14
|
+
- v9: vOffice's region hierarchy through the be-on! Hub, with only the regions that hold
|
|
15
|
+
a rental of the be-on key. Slugs are generated from the names; siblings sort by German
|
|
16
|
+
name. `aiStudioWebsiteId` is ignored.
|
|
17
|
+
- Each region has German and English `name`, `slug` and `path` (`nordsee/dornum`, unique,
|
|
18
|
+
for region page URLs), an optional `description`, its `ownRentalIds`, and `rentalIds`,
|
|
19
|
+
which adds every subregion's rentals.
|
|
20
|
+
- The types `RegionsGetRegionsInput`, `WebsiteRegions` and `WebsiteRegion`.
|
|
21
|
+
- `regions.md` covers the data, region pages and the search's region field.
|
|
22
|
+
|
|
23
|
+
## Changed
|
|
24
|
+
|
|
25
|
+
- The custom attribute examples use a beach type instead of a region: a region is never
|
|
26
|
+
a custom attribute.
|
|
27
|
+
- The Hub `region` filter keeps working on v9; `search.md` points to the region tree for a
|
|
28
|
+
search's region field.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Migration: 2.34.0 to 2.35.0
|
|
2
|
+
|
|
3
|
+
No changes required. Follow step 2 only to take a site's regions from the region tree.
|
|
4
|
+
|
|
5
|
+
## 1. Upgrade
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pnpm add @v-office/website-sdk@2.35.0
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
For step 2.3, also upgrade the headless package, which brings `regionOptions` and
|
|
12
|
+
`regionsByRental`:
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
pnpm add @v-office/website-headless@1.2.0
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 2. Take the regions from the region tree
|
|
19
|
+
|
|
20
|
+
1. Read the tree once per build:
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
const regions = await sdk.static.regions.getRegions({
|
|
24
|
+
aiStudioWebsiteId: Number(process.env.WEB_ID),
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
2. v10: remove the code that reads the "Region" custom attribute values, and remove the
|
|
29
|
+
attribute from `defineCustomAttributes` if it was selected there. v9: a region field
|
|
30
|
+
fed by the Hub `region` filter can move to the tree; the Hub entry can stay.
|
|
31
|
+
3. Build the search bar's regions and each rental's region facts from the tree with
|
|
32
|
+
`regionOptions` and `regionsByRental` from `@v-office/website-headless` 1.2.0. Region
|
|
33
|
+
values become region ids, so links that carry an old `?region=<name>` no longer narrow
|
|
34
|
+
the search: update them.
|
|
35
|
+
4. Region pages take their URL from `path` and list `rentalIds`. A rental keeps its own
|
|
36
|
+
URL.
|
|
37
|
+
|
|
38
|
+
An empty tree is normal on v10 until editors create regions in the CMS: the region field
|
|
39
|
+
then hides itself. See `regions.md`.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Changelog: 2.36.0
|
|
2
|
+
|
|
3
|
+
v9 websites can show when the rentals of a holiday complex are booked, for every rental in
|
|
4
|
+
one call instead of one availability calendar per rental.
|
|
5
|
+
|
|
6
|
+
## Added
|
|
7
|
+
|
|
8
|
+
- `sdk.live.availability.getBlockedRanges({ rentalIds })` on v9: the ranges in which
|
|
9
|
+
several rentals cannot be booked freely. Each range has a `start` (arrival day), an
|
|
10
|
+
`end` (departure day, or `null` when it runs to the end of the known data) and a
|
|
11
|
+
`status` (`unavailable` for bookings, owner blocks and closures, `on_request` for days
|
|
12
|
+
that can only be requested). Days between ranges are free.
|
|
13
|
+
- Each rental carries `availableFrom`, the first day the data covers.
|
|
14
|
+
- The types `V9AvailabilityGetBlockedRangesInput`, `V9AvailabilityGetBlockedRangesOutput`,
|
|
15
|
+
`V9RentalBlockedRanges` and `V9BlockedRange`.
|
|
16
|
+
- `website-sdk --backend v9 availability blocked-ranges --rental-ids 212402,212350`.
|
|
17
|
+
- `availability.md` covers it in "Legacy v9 Blocked Ranges".
|
|
@@ -5084,6 +5084,58 @@ const documents = {
|
|
|
5084
5084
|
}
|
|
5085
5085
|
}]
|
|
5086
5086
|
},
|
|
5087
|
+
"\n query CoreSDK_RentalRegions {\n all {\n voffice_id\n data(attributes: [\"region\"])\n }\n }\n": {
|
|
5088
|
+
kind: "Document",
|
|
5089
|
+
definitions: [{
|
|
5090
|
+
kind: "OperationDefinition",
|
|
5091
|
+
operation: "query",
|
|
5092
|
+
name: {
|
|
5093
|
+
kind: "Name",
|
|
5094
|
+
value: "CoreSDK_RentalRegions"
|
|
5095
|
+
},
|
|
5096
|
+
selectionSet: {
|
|
5097
|
+
kind: "SelectionSet",
|
|
5098
|
+
selections: [{
|
|
5099
|
+
kind: "Field",
|
|
5100
|
+
name: {
|
|
5101
|
+
kind: "Name",
|
|
5102
|
+
value: "all"
|
|
5103
|
+
},
|
|
5104
|
+
selectionSet: {
|
|
5105
|
+
kind: "SelectionSet",
|
|
5106
|
+
selections: [{
|
|
5107
|
+
kind: "Field",
|
|
5108
|
+
name: {
|
|
5109
|
+
kind: "Name",
|
|
5110
|
+
value: "voffice_id"
|
|
5111
|
+
}
|
|
5112
|
+
}, {
|
|
5113
|
+
kind: "Field",
|
|
5114
|
+
name: {
|
|
5115
|
+
kind: "Name",
|
|
5116
|
+
value: "data"
|
|
5117
|
+
},
|
|
5118
|
+
arguments: [{
|
|
5119
|
+
kind: "Argument",
|
|
5120
|
+
name: {
|
|
5121
|
+
kind: "Name",
|
|
5122
|
+
value: "attributes"
|
|
5123
|
+
},
|
|
5124
|
+
value: {
|
|
5125
|
+
kind: "ListValue",
|
|
5126
|
+
values: [{
|
|
5127
|
+
kind: "StringValue",
|
|
5128
|
+
value: "region",
|
|
5129
|
+
block: false
|
|
5130
|
+
}]
|
|
5131
|
+
}
|
|
5132
|
+
}]
|
|
5133
|
+
}]
|
|
5134
|
+
}
|
|
5135
|
+
}]
|
|
5136
|
+
}
|
|
5137
|
+
}]
|
|
5138
|
+
},
|
|
5087
5139
|
"\n query CoreSDK_RentalIds {\n all {\n voffice_id\n }\n }\n": {
|
|
5088
5140
|
kind: "Document",
|
|
5089
5141
|
definitions: [{
|
|
@@ -7826,6 +7878,15 @@ const hubRentalDataQuery = graphql(`
|
|
|
7826
7878
|
}
|
|
7827
7879
|
}
|
|
7828
7880
|
`);
|
|
7881
|
+
/** Every rental of the be-on key with its vOffice region (`{ id, idx }`). */
|
|
7882
|
+
const rentalRegionsQuery = graphql(`
|
|
7883
|
+
query CoreSDK_RentalRegions {
|
|
7884
|
+
all {
|
|
7885
|
+
voffice_id
|
|
7886
|
+
data(attributes: ["region"])
|
|
7887
|
+
}
|
|
7888
|
+
}
|
|
7889
|
+
`);
|
|
7829
7890
|
const rentalIdsQuery = graphql(`
|
|
7830
7891
|
query CoreSDK_RentalIds {
|
|
7831
7892
|
all {
|
|
@@ -8117,4 +8178,4 @@ const voucherValidityQuery = graphql(`
|
|
|
8117
8178
|
}
|
|
8118
8179
|
`);
|
|
8119
8180
|
//#endregion
|
|
8120
|
-
export {
|
|
8181
|
+
export { parseVofficeUnitData as S, customDataAttribute as _, hubRentalDataQuery as a, parseVofficeFeedbackData as b, rentalRegionsQuery as c, rentalsAllWithoutFeedbacksQuery as d, RegionSchema as f, VofficeUnitDataPropertyMetadata as g, VofficeUnitDataPropertyCategoryValues as h, hubFiltersQuery as i, rentalsAllByFacilityObjectGroupsWithoutFeedbacksQuery as l, VofficeUnitDataPropertyCategoryLabelKeys as m, mapSearchQuery as n, rentalFacilitiesForObjectGroupRelationQuery as o, VofficeUnitDataFieldSchemas as p, searchQuery as r, rentalIdsQuery as s, voucherValidityQuery as t, rentalsAllFeedbacksQuery as u, parseJsonData as v, parseVofficeRatingData as x, parseVofficeFacilityData as y };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Qt as V9_FACILITY_ATTRIBUTE_KEYS } from "./client-
|
|
2
|
-
import {
|
|
3
|
-
import { a as toFacilityImages, c as toLocalizedString, i as toLocation, o as toImages, r as renderVofficePropertyAttribute, s as toAddress, t as toRentalHighlights } from "./to-rental-highlights-
|
|
1
|
+
import { Qt as V9_FACILITY_ATTRIBUTE_KEYS } from "./client-D44b3iET.mjs";
|
|
2
|
+
import { S as parseVofficeUnitData, b as parseVofficeFeedbackData, d as rentalsAllWithoutFeedbacksQuery, g as VofficeUnitDataPropertyMetadata, h as VofficeUnitDataPropertyCategoryValues, i as hubFiltersQuery, l as rentalsAllByFacilityObjectGroupsWithoutFeedbacksQuery, m as VofficeUnitDataPropertyCategoryLabelKeys, o as rentalFacilitiesForObjectGroupRelationQuery, p as VofficeUnitDataFieldSchemas, s as rentalIdsQuery, u as rentalsAllFeedbacksQuery, y as parseVofficeFacilityData } from "./operations-C1VMQYN2.mjs";
|
|
3
|
+
import { a as toFacilityImages, c as toLocalizedString, i as toLocation, o as toImages, r as renderVofficePropertyAttribute, s as toAddress, t as toRentalHighlights } from "./to-rental-highlights-BdxQPpBU.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 makeV9CustomAttributeFilterCapabilities, c as parseQueryParameters, d as toVoucherCode, l as toQueryString, o as toBasicQueryInputs, s as collectQueryParameters, u as applyVofficeFilterDerivedBasicQueryInputs } from "./client-
|
|
2
|
-
import {
|
|
3
|
-
import { i as toLocation, n as toV9RentalHighlightKey, o as toImages, s as toAddress, t as toRentalHighlights } from "./to-rental-highlights-
|
|
1
|
+
import { a as makeV9CustomAttributeFilterCapabilities, c as parseQueryParameters, d as toVoucherCode, l as toQueryString, o as toBasicQueryInputs, s as collectQueryParameters, u as applyVofficeFilterDerivedBasicQueryInputs } from "./client-D44b3iET.mjs";
|
|
2
|
+
import { S as parseVofficeUnitData, n as mapSearchQuery, r as searchQuery } from "./operations-C1VMQYN2.mjs";
|
|
3
|
+
import { i as toLocation, n as toV9RentalHighlightKey, o as toImages, s as toAddress, t as toRentalHighlights } from "./to-rental-highlights-BdxQPpBU.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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as VofficeUnitDataPropertyMetadata } from "./operations-C1VMQYN2.mjs";
|
|
2
2
|
import { localeToLanguage, makeTranslate, renderLabeledAttributeValue, renderResolvedCustomAttribute, toCountry } from "@v-office/sdk-core";
|
|
3
3
|
import { Effect } from "effect";
|
|
4
4
|
//#region src/legacy-v9/parser/rentals/to-localized-string.ts
|
|
@@ -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.36.0/CHANGELOG.md`: release notes for 2.36.0
|
|
8
|
+
- `versions/2.35.0/CHANGELOG.md`: release notes for 2.35.0
|
|
7
9
|
- `versions/2.34.0/CHANGELOG.md`: release notes for 2.34.0
|
|
8
10
|
- `versions/2.33.0/CHANGELOG.md`: release notes for 2.33.0
|
|
9
11
|
- `versions/2.32.0/CHANGELOG.md`: release notes for 2.32.0
|
|
@@ -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.36.0/MIGRATION.md`: Migration: 2.35.0 to 2.36.0
|
|
8
|
+
- `versions/2.35.0/MIGRATION.md`: Migration: 2.34.0 to 2.35.0
|
|
7
9
|
- `versions/2.34.0/MIGRATION.md`: Migration: 2.33.0 to 2.34.0
|
|
8
10
|
- `versions/2.33.0/MIGRATION.md`: Migration: 2.32.0 to 2.33.0
|
|
9
11
|
- `versions/2.32.0/MIGRATION.md`: Migration: 2.31.1 to 2.32.0
|
package/instructions/README.md
CHANGED
|
@@ -11,8 +11,9 @@ Use this directory as the consumer-facing reference for the package:
|
|
|
11
11
|
- `filter.md`: `sdk.static.filter.getFilters`.
|
|
12
12
|
- `videos.md`: v9 only. `sdk.static.videos.getVideos`, placements, and HLS playback.
|
|
13
13
|
- `custom-attributes.md`: custom attribute catalog, configuration, per-backend behaviour, and the v9-to-v10 move.
|
|
14
|
+
- `regions.md`: `sdk.static.regions.getRegions`, the website's region tree, region pages, and the search's region field.
|
|
14
15
|
- `search.md`: `sdk.live.search.search`, vouchers, and, on v9, `sdk.live.search.searchPages`, Hub filters, and `sdk.live.voucher.validate`.
|
|
15
|
-
- `availability.md`: date-picker availability flows.
|
|
16
|
+
- `availability.md`: date-picker availability flows and, on v9, `sdk.live.availability.getBlockedRanges` for availability timelines.
|
|
16
17
|
- `quote.md`: quote booking-card modifiers, additional services, cancellation policy, and insurance flows.
|
|
17
18
|
- `booking.md`: booking, payment option submission, and
|
|
18
19
|
`sdk.static.payment.getBankTransferDetails` (read-only bank details).
|
|
@@ -167,6 +167,52 @@ Treat `null` as no limit.
|
|
|
167
167
|
See `versions/2.28.0/CHANGELOG.md` and
|
|
168
168
|
`versions/2.28.0/MIGRATION.md`.
|
|
169
169
|
|
|
170
|
+
### Legacy v9 Blocked Ranges
|
|
171
|
+
|
|
172
|
+
From 2.36.0, v9 returns the ranges in which several rentals cannot be booked freely:
|
|
173
|
+
bookings, owner blocks, closures and on-request days. Use it for a timeline that shows
|
|
174
|
+
every rental of a holiday complex. v10 has no `getBlockedRanges`; check
|
|
175
|
+
`sdk.backend === "v9"` first.
|
|
176
|
+
|
|
177
|
+
```ts
|
|
178
|
+
if (sdk.backend === "v9") {
|
|
179
|
+
const { rentals } = await sdk.live.availability.getBlockedRanges({
|
|
180
|
+
rentalIds: ["212402", "212350"],
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
```json
|
|
186
|
+
{
|
|
187
|
+
"rentals": [
|
|
188
|
+
{
|
|
189
|
+
"rentalId": "212402",
|
|
190
|
+
"availableFrom": "2026-10-15",
|
|
191
|
+
"ranges": [{ "start": "2026-11-08", "end": "2026-11-21", "status": "unavailable" }]
|
|
192
|
+
},
|
|
193
|
+
{ "rentalId": "212350", "availableFrom": "2026-10-15", "ranges": [] }
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
- `start` is the arrival day, `end` the departure day. The night before `end` is the last
|
|
199
|
+
blocked night, so the next stay can start on `end`.
|
|
200
|
+
- `end` is `null` when the range runs to the end of the known data. Draw it to the edge of
|
|
201
|
+
the view.
|
|
202
|
+
- `status` is `unavailable` for bookings, owner blocks and closures, which vOffice does not
|
|
203
|
+
tell apart, and `on_request` for days that can only be requested. Back-to-back bookings
|
|
204
|
+
appear as one range.
|
|
205
|
+
- Every day from `availableFrom` that no range covers is free. Days before
|
|
206
|
+
`availableFrom` are unknown. For most rentals `availableFrom` is today; an older date
|
|
207
|
+
means vOffice has not refreshed that rental's data since.
|
|
208
|
+
- Rentals come back in the order of `rentalIds`. Unknown or invalid IDs are left out, so
|
|
209
|
+
show "no data" for a rental that is missing instead of drawing it free.
|
|
210
|
+
|
|
211
|
+
Call it in the browser when the timeline opens. Every call reads vOffice's availability
|
|
212
|
+
export page by page, and vOffice bills each page. The browser caches each page for 60
|
|
213
|
+
seconds, so opening the timeline again within a minute costs nothing. Do not call it at
|
|
214
|
+
build time: the data is out of date by the next booking.
|
|
215
|
+
|
|
170
216
|
## Configuration
|
|
171
217
|
|
|
172
218
|
Use flat `WebsiteSDKConfig` files.
|
|
@@ -211,6 +257,12 @@ Fetch availability after selecting a start date:
|
|
|
211
257
|
website-sdk --backend v9 availability start-date-selected --rental-id 123 --selected-start-date 2026-07-08 --calculate-from-date 2026-07-01 --calculate-through-date 2026-08-01
|
|
212
258
|
```
|
|
213
259
|
|
|
260
|
+
Fetch the booked stays of v9 rentals:
|
|
261
|
+
|
|
262
|
+
```sh
|
|
263
|
+
website-sdk --backend v9 availability blocked-ranges --rental-ids 212402,212350
|
|
264
|
+
```
|
|
265
|
+
|
|
214
266
|
Use files instead of environment variables:
|
|
215
267
|
|
|
216
268
|
```sh
|
package/instructions/creation.md
CHANGED
|
@@ -244,11 +244,11 @@ Custom attributes are configured through `customAttributes`, built by
|
|
|
244
244
|
const customAttributes = defineCustomAttributes({
|
|
245
245
|
catalog,
|
|
246
246
|
select: {
|
|
247
|
-
|
|
248
|
-
label: { "de-DE": "
|
|
247
|
+
beach: {
|
|
248
|
+
label: { "de-DE": "Strand", "en-US": "Beach" },
|
|
249
249
|
filter: true,
|
|
250
250
|
optionLabels: {
|
|
251
|
-
|
|
251
|
+
sand: { "de-DE": "Sandstrand", "en-US": "Sandy beach" },
|
|
252
252
|
},
|
|
253
253
|
},
|
|
254
254
|
},
|