@v-office/website-sdk 1.2.1 → 2.1.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 +93 -232
- package/dist/cli.mjs +105 -84
- package/dist/client-xkXV7Nf-.mjs +5127 -0
- package/dist/index.d.mts +1444 -11259
- package/dist/index.mjs +16 -4
- package/dist/instructions/CHANGELOG.md +10 -0
- package/dist/instructions/MIGRATION.md +10 -0
- package/dist/instructions/README.md +64 -0
- package/dist/instructions/availability.md +157 -0
- package/dist/instructions/booking.md +165 -0
- package/dist/instructions/contact.md +110 -0
- package/dist/instructions/creation.md +223 -0
- package/dist/instructions/document-structured-json.md +100 -0
- package/dist/instructions/filter.md +158 -0
- package/dist/instructions/quote.md +342 -0
- package/dist/instructions/rentals.md +152 -0
- package/dist/instructions/search.md +238 -0
- package/dist/instructions/versions/2.0.0/CHANGELOG.md +69 -0
- package/dist/instructions/versions/2.0.0/MIGRATION.md +223 -0
- package/dist/instructions/versions/2.1.0/CHANGELOG.md +32 -0
- package/dist/instructions/versions/2.1.0/MIGRATION.md +89 -0
- package/dist/{quote-DQGps4dy.mjs → quote--25SMlYS.mjs} +41 -19
- package/dist/{rentals-plxPVx83.mjs → rentals-DCKUaLnB.mjs} +22 -16
- package/dist/{search-BuR5apFw.mjs → search-8iCC0Nel.mjs} +40 -23
- package/dist/to-rental-highlights-CZYJeR1D.mjs +5905 -0
- package/dist/translations/shared/de-DE/contact.json +19 -0
- package/dist/translations/shared/de-DE/quote.json +5 -1
- package/dist/translations/shared/en-US/contact.json +19 -0
- package/dist/translations/shared/en-US/quote.json +5 -1
- package/dist/translations/v10/de-DE/mapped-search-filters.json +3 -0
- package/dist/translations/v10/en-US/mapped-search-filters.json +3 -0
- package/instructions/CHANGELOG.md +10 -0
- package/instructions/MIGRATION.md +10 -0
- package/instructions/README.md +64 -0
- package/instructions/availability.md +157 -0
- package/instructions/booking.md +165 -0
- package/instructions/contact.md +110 -0
- package/instructions/creation.md +223 -0
- package/instructions/document-structured-json.md +100 -0
- package/instructions/filter.md +158 -0
- package/instructions/quote.md +342 -0
- package/instructions/rentals.md +152 -0
- package/instructions/search.md +238 -0
- package/instructions/versions/2.0.0/CHANGELOG.md +69 -0
- package/instructions/versions/2.0.0/MIGRATION.md +223 -0
- package/instructions/versions/2.1.0/CHANGELOG.md +32 -0
- package/instructions/versions/2.1.0/MIGRATION.md +89 -0
- package/package.json +42 -56
- package/dist/client-DeEUMMOh.mjs +0 -33237
- package/dist/custom-attribute-D5Kb1YHA.mjs +0 -54
- package/dist/errors-2cuUGSvi.mjs +0 -5
- package/dist/operations-B4IgNB3E.mjs +0 -12618
- package/dist/operations-DcU1qt7g.mjs +0 -1158
- package/dist/quote-BVx3TAHE.mjs +0 -513
- package/dist/quote-CRjV_lf-.mjs +0 -609
- package/dist/rentals-H3RYtMqT.mjs +0 -323
- package/dist/search-filter-metadata-DZP0-Udc.mjs +0 -4294
- package/dist/to-rental-highlights-CAATPqan.mjs +0 -524
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
# Search
|
|
2
|
+
|
|
3
|
+
## Service
|
|
4
|
+
|
|
5
|
+
Use the live search API to search rentals with a URL query-string style input:
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
const result = await sdk.live.search.search({
|
|
9
|
+
locale: "de-DE",
|
|
10
|
+
query: "start=01-07-2026&end=08-07-2026&adults=2&wifi=true",
|
|
11
|
+
});
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The service is implemented for both `v9` and `v10` backends and returns normalized rental result items. Filtering by `rentalIdsIn` is currently implemented for `v10` only.
|
|
15
|
+
|
|
16
|
+
## Input
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
type RentalSearchInput = {
|
|
20
|
+
locale: "de-DE" | "en-US";
|
|
21
|
+
query: string;
|
|
22
|
+
rentalIdsIn?: readonly string[];
|
|
23
|
+
voucher?: string;
|
|
24
|
+
limit?: number;
|
|
25
|
+
cursor?: string;
|
|
26
|
+
};
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Sample:
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"locale": "de-DE",
|
|
34
|
+
"query": "start=01-07-2026&end=08-07-2026&adults=2&children=1&wifi=true",
|
|
35
|
+
"rentalIdsIn": ["123", "456"],
|
|
36
|
+
"voucher": "SUMMER26",
|
|
37
|
+
"limit": 20
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Common stable query keys:
|
|
42
|
+
|
|
43
|
+
- Period: `start`, `end`, `from`, `till`, `minNights`, `maxNights`; date values support `DD-MM-YYYY` and `YYYY-MM-DD`; `v10` also supports `month`, `dates`, `nights`, and `weekend`.
|
|
44
|
+
- Occupancy: `adults`, `children`, `childrenAges`, `babies`, `pets`, `petsCount`.
|
|
45
|
+
- Filters: use `searchParameterQueryKey` values from `sdk.static.filter.getFilters(...)`.
|
|
46
|
+
|
|
47
|
+
## Query Structure
|
|
48
|
+
|
|
49
|
+
The `query` field is a URL query-string style value without a leading `?`.
|
|
50
|
+
|
|
51
|
+
Use `&` to combine period, occupancy, and filter parameters:
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
"start=20-06-2026&end=27-06-2026&adults=2&wifi";
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Period Queries
|
|
58
|
+
|
|
59
|
+
Use one supported period structure per query.
|
|
60
|
+
|
|
61
|
+
Exact period search:
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
"start=20-06-2026&end=27-06-2026";
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Flexible search by month:
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
"month=06-2026&nights=7";
|
|
71
|
+
"month=06-2026&month=07-2026&nights=7";
|
|
72
|
+
"month=06-2026&weekend";
|
|
73
|
+
"month=06-2026&month=07-2026&weekend";
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Flexible search by exact date tuples:
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
"dates=20-06-2026,22-06-2026&nights=2";
|
|
80
|
+
"dates=20-06-2026,22-06-2026&dates=04-07-2026,11-07-2026&nights=2";
|
|
81
|
+
"dates=20-06-2026,22-06-2026&weekend";
|
|
82
|
+
"dates=20-06-2026,22-06-2026&dates=04-07-2026,11-07-2026&weekend";
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Occupancy And Filters
|
|
86
|
+
|
|
87
|
+
Append occupancy and filter parameters with `&`:
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
"start=20-06-2026&end=27-06-2026&adults=2";
|
|
91
|
+
"start=20-06-2026&end=27-06-2026&adults=2&childrenAges=5%2C13&babies=1&pets=1";
|
|
92
|
+
"start=20-06-2026&end=27-06-2026&adults=2&wifi";
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Boolean filters can be provided as presence-only flags when supported:
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
"wifi";
|
|
99
|
+
"wifi&bbq=true";
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Invalid Combinations
|
|
103
|
+
|
|
104
|
+
Do not mix exact period search with flexible period options:
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
"start=20-06-2026&end=27-06-2026&nights=7";
|
|
108
|
+
"start=20-06-2026&end=27-06-2026&weekend";
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Do not mix `month` and `dates` in the same flexible query:
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
"month=06-2026&dates=20-06-2026,22-06-2026&nights=2";
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Flexible queries require either `nights` or `weekend`, but not both:
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
"month=06-2026";
|
|
121
|
+
"dates=20-06-2026,22-06-2026";
|
|
122
|
+
"month=06-2026&nights=7&weekend";
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Dates should use `DD-MM-YYYY`; months should use `MM-YYYY`.
|
|
126
|
+
|
|
127
|
+
Use `rentalIdsIn` to restrict results to specific rental IDs. This option is currently supported by `v10` only.
|
|
128
|
+
Use `voucher` to price v10 search results with a voucher code. This option is currently supported by `v10` only.
|
|
129
|
+
For v10, `pets` is a mapped BooleanFilter exposed by `getFilters` and maps to one pet; use `petsCount` for an exact count and do not send both keys in one query.
|
|
130
|
+
|
|
131
|
+
`limit` defaults to `20`. Treat `cursor` as opaque and pass back `pageInfo.nextCursor` unchanged.
|
|
132
|
+
|
|
133
|
+
## Output
|
|
134
|
+
|
|
135
|
+
Returns `Promise<RentalSearchOutput>`.
|
|
136
|
+
|
|
137
|
+
Sample:
|
|
138
|
+
|
|
139
|
+
```json
|
|
140
|
+
{
|
|
141
|
+
"items": [
|
|
142
|
+
{
|
|
143
|
+
"id": "123",
|
|
144
|
+
"nameOrLabel": "Apartment Meerblick",
|
|
145
|
+
"timeZone": "Europe/Berlin",
|
|
146
|
+
"rentalType": "Apartment",
|
|
147
|
+
"location": {
|
|
148
|
+
"latitude": 54.123,
|
|
149
|
+
"longitude": 8.456
|
|
150
|
+
},
|
|
151
|
+
"images": [
|
|
152
|
+
{
|
|
153
|
+
"idOrPath": "image-1",
|
|
154
|
+
"src": "https://images.example.com/image-1.jpg",
|
|
155
|
+
"srcset": "https://images.example.com/image-1.jpg 1x",
|
|
156
|
+
"alt": "Apartment Meerblick"
|
|
157
|
+
}
|
|
158
|
+
],
|
|
159
|
+
"highlights": ["2 bedrooms", "WiFi", "Parking"],
|
|
160
|
+
"formattedTotal": "1.234,00 €"
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
"alternatives": [
|
|
164
|
+
{
|
|
165
|
+
"item": {
|
|
166
|
+
"id": "456",
|
|
167
|
+
"nameOrLabel": "Apartment Düne",
|
|
168
|
+
"timeZone": "Europe/Berlin"
|
|
169
|
+
},
|
|
170
|
+
"alternativePeriods": [
|
|
171
|
+
{
|
|
172
|
+
"start": "2026-07-10",
|
|
173
|
+
"end": "2026-07-17",
|
|
174
|
+
"formattedTotal": "1.456,00 €"
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
"appliedFilters": [
|
|
180
|
+
{
|
|
181
|
+
"key": "wifi",
|
|
182
|
+
"label": "WiFi"
|
|
183
|
+
}
|
|
184
|
+
],
|
|
185
|
+
"unusedFilterKeys": [],
|
|
186
|
+
"pageInfo": {
|
|
187
|
+
"hasNextPage": true,
|
|
188
|
+
"nextCursor": "20"
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Search items share the rental base fields and may include `scope`, `address`, `property`, `highlights`, and `formattedTotal`. Exact-period results are returned in `items`; alternative-period suggestions are returned in root-level `alternatives`.
|
|
194
|
+
|
|
195
|
+
## Configuration
|
|
196
|
+
|
|
197
|
+
Use flat `WebsiteSDKConfig` files and optional `WebsiteSDKOptions`.
|
|
198
|
+
|
|
199
|
+
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.
|
|
200
|
+
|
|
201
|
+
## CLI Usage
|
|
202
|
+
|
|
203
|
+
Run a search with environment-based config:
|
|
204
|
+
|
|
205
|
+
```sh
|
|
206
|
+
website-sdk --backend v10 search --locale de-DE --query "start=01-07-2026&end=08-07-2026&adults=2"
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Paginate with `--limit` and `--cursor`:
|
|
210
|
+
|
|
211
|
+
```sh
|
|
212
|
+
website-sdk --backend v10 search --locale de-DE --query "adults=2" --limit 10
|
|
213
|
+
website-sdk --backend v10 search --locale de-DE --query "adults=2" --limit 10 --cursor "10"
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Restrict results to specific rental IDs or price with a voucher code (`v10` only):
|
|
217
|
+
|
|
218
|
+
```sh
|
|
219
|
+
website-sdk --backend v10 search --locale de-DE --query "adults=2" --rental-ids-in "123,456"
|
|
220
|
+
website-sdk --backend v10 search --locale de-DE --query "adults=2" --voucher SUMMER26
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Use files instead of environment variables:
|
|
224
|
+
|
|
225
|
+
```sh
|
|
226
|
+
website-sdk --backend v10 --config ./website-sdk-config.json --options ./website-sdk-options.json search --locale de-DE --query "adults=2"
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Output defaults to JSON. Use `--output pretty` for inspected terminal output:
|
|
230
|
+
|
|
231
|
+
```sh
|
|
232
|
+
website-sdk --backend v10 search --locale de-DE --query "adults=2" --output pretty
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Environment variables:
|
|
236
|
+
|
|
237
|
+
- `v9`: `HUB_GRAPHQL_URL`, `HUB_V1_API_BASE_URL`, optional `HUB_V0_API_BASE_URL`, `HUB_API_KEY`, `IMAGE_PROXY_BASE_URL`.
|
|
238
|
+
- `v10`: `VOFFICE_API_ENDPOINT`, `VOFFICE_LOCAL_DEV_ACCESS_TOKEN`, `VOFFICE_IMAGE_BASE_URL`.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Changelog: 2.0.0
|
|
2
|
+
|
|
3
|
+
Release date: 2026-06-24
|
|
4
|
+
|
|
5
|
+
This release moves the website SDK to the `@v-office/website-sdk` 2.0.0 facade backed by `@v-office/sdk-core`.
|
|
6
|
+
|
|
7
|
+
## From
|
|
8
|
+
|
|
9
|
+
- Legacy CMS-style website SDK API.
|
|
10
|
+
- Main construction API: `createCMSSDKFromParsedConfig(config)`.
|
|
11
|
+
- Nested backend config shape: `{ backend, v9: {...}, options }` or `{ backend, v10: {...}, options }`.
|
|
12
|
+
|
|
13
|
+
## To
|
|
14
|
+
|
|
15
|
+
- `@v-office/website-sdk` 2.0.0.
|
|
16
|
+
- Main construction API: `createWebsiteSDK({ config, options })`.
|
|
17
|
+
- Flat backend config shape: `WebsiteSDKConfig`.
|
|
18
|
+
- Separate options shape: `WebsiteSDKOptions`.
|
|
19
|
+
|
|
20
|
+
## Breaking Changes
|
|
21
|
+
|
|
22
|
+
- Replaced `createCMSSDKFromParsedConfig(config)` with `createWebsiteSDK({ config, options })`.
|
|
23
|
+
- Changed SDK config from nested `ParsedCMSConfig` objects to flat `WebsiteSDKConfig` objects.
|
|
24
|
+
- Moved SDK options out of config objects and into the separate `options` argument.
|
|
25
|
+
- Renamed the primary public SDK type from `CMSSDK` to `WebsiteSDK`.
|
|
26
|
+
- Renamed the primary public options type from `CMSOptions` to `WebsiteSDKOptions`.
|
|
27
|
+
- Renamed the primary config type from `ParsedCMSConfig` to `WebsiteSDKConfig`.
|
|
28
|
+
- Changed the SDK error model from the legacy `CMSError` shape with `backend` to the core SDK error shape with `source`.
|
|
29
|
+
- Changed CLI config files to use the same flat `WebsiteSDKConfig` shape.
|
|
30
|
+
- Removed legacy stable-search helper exports from the root package API.
|
|
31
|
+
- Removed legacy CMS construction and config type exports from the root package API.
|
|
32
|
+
|
|
33
|
+
## Added
|
|
34
|
+
|
|
35
|
+
- Added the `createWebsiteSDK` facade backed by `@v-office/sdk-core`.
|
|
36
|
+
- Added `defineWebsiteSDKOptions`.
|
|
37
|
+
- Added `WebsiteSDK`, `WebsiteSDKConfig`, and `WebsiteSDKOptions` public types.
|
|
38
|
+
- Added top-level Effect helper exports for SDK operations.
|
|
39
|
+
- Added top-level `submitPaymentOption` and `submitPaymentOptionEffect` exports.
|
|
40
|
+
- Added public schemas from `@v-office/sdk-core`, including `GuestQuoteSchema`, `LocaleSchema`, `SearchSearchInputSchema`, and `SearchSearchOutputSchema`.
|
|
41
|
+
- Added `rentalPropertyHighlightPrioritization` to `WebsiteSDKOptions`.
|
|
42
|
+
- Added adapted instruction docs under `instructions/`.
|
|
43
|
+
- Added version-specific release and migration docs under `instructions/versions/2.0.0/`.
|
|
44
|
+
- Added an explicit package `types` entry for `./dist/index.d.mts`.
|
|
45
|
+
|
|
46
|
+
## Preserved
|
|
47
|
+
|
|
48
|
+
- Preserved the main SDK method tree:
|
|
49
|
+
- `sdk.static.rentals.getRentals`
|
|
50
|
+
- `sdk.static.filter.getFilters`
|
|
51
|
+
- `sdk.live.search.search`
|
|
52
|
+
- `sdk.live.availability.getInitialAvailability`
|
|
53
|
+
- `sdk.live.availability.getStartDateSelectedAvailability`
|
|
54
|
+
- `sdk.live.quote.*`
|
|
55
|
+
- `sdk.live.booking.book`
|
|
56
|
+
- `sdk.live.booking.submitPaymentOption`
|
|
57
|
+
- `sdk.live.contact.submit`
|
|
58
|
+
- `sdk.dispose`
|
|
59
|
+
- Preserved `defineCMSSDKOptions` as an alias for `defineWebsiteSDKOptions`.
|
|
60
|
+
- Preserved common legacy domain type aliases such as `BookingInput`, `BookingOutput`, `ContactInput`, `RentalRentalsInput`, `RentalRentalsOutput`, `RentalSearchInput`, and `RentalSearchOutput`.
|
|
61
|
+
- Preserved v9 OpenAPI client exports.
|
|
62
|
+
- Preserved v9 heuristic and v1 public API exports.
|
|
63
|
+
- Preserved CLI environment variable names.
|
|
64
|
+
|
|
65
|
+
## Release Notes
|
|
66
|
+
|
|
67
|
+
- This is a major release for consumers migrating from the legacy website SDK API.
|
|
68
|
+
- `@v-office/sdk-core` is now a runtime dependency. Ensure it is published or otherwise resolvable before publishing this package to a public registry.
|
|
69
|
+
- The package remains ESM-only.
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
# Migration: Legacy 1.x API to 2.0.0
|
|
2
|
+
|
|
3
|
+
This guide covers the consumer-facing migration from the legacy CMS-style website SDK API to `@v-office/website-sdk` 2.0.0.
|
|
4
|
+
|
|
5
|
+
## Source Version
|
|
6
|
+
|
|
7
|
+
Legacy 1.x-style API:
|
|
8
|
+
|
|
9
|
+
- `createCMSSDKFromParsedConfig`
|
|
10
|
+
- `CMSSDK`
|
|
11
|
+
- `CMSOptions`
|
|
12
|
+
- `ParsedCMSConfig`
|
|
13
|
+
- Nested `v9` / `v10` backend config objects
|
|
14
|
+
|
|
15
|
+
## Target Version
|
|
16
|
+
|
|
17
|
+
`@v-office/website-sdk` 2.0.0:
|
|
18
|
+
|
|
19
|
+
- `createWebsiteSDK`
|
|
20
|
+
- `WebsiteSDK`
|
|
21
|
+
- `WebsiteSDKOptions`
|
|
22
|
+
- `WebsiteSDKConfig`
|
|
23
|
+
- Flat backend config object plus separate options
|
|
24
|
+
|
|
25
|
+
## Package Import
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import { createWebsiteSDK, defineWebsiteSDKOptions } from "@v-office/website-sdk";
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The new package still exports `defineCMSSDKOptions` as an alias for `defineWebsiteSDKOptions`, but new code should use the Website naming.
|
|
32
|
+
|
|
33
|
+
## SDK Creation
|
|
34
|
+
|
|
35
|
+
Before:
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
import { createCMSSDKFromParsedConfig, defineCMSSDKOptions } from "@v-office/website-sdk";
|
|
39
|
+
|
|
40
|
+
const sdk = createCMSSDKFromParsedConfig({
|
|
41
|
+
backend: "v10",
|
|
42
|
+
v10: {
|
|
43
|
+
apiEndpoint: "https://api.example.com/graphql",
|
|
44
|
+
accessToken: "...",
|
|
45
|
+
imageBaseUrl: "https://images.example.com",
|
|
46
|
+
},
|
|
47
|
+
options: defineCMSSDKOptions({
|
|
48
|
+
rentalScope: {
|
|
49
|
+
propertyId: "property-1",
|
|
50
|
+
},
|
|
51
|
+
}),
|
|
52
|
+
});
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
After:
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
import { createWebsiteSDK, defineWebsiteSDKOptions } from "@v-office/website-sdk";
|
|
59
|
+
|
|
60
|
+
const sdk = createWebsiteSDK({
|
|
61
|
+
config: {
|
|
62
|
+
backend: "v10",
|
|
63
|
+
apiEndpoint: "https://api.example.com/graphql",
|
|
64
|
+
accessToken: "...",
|
|
65
|
+
imageBaseUrl: "https://images.example.com",
|
|
66
|
+
},
|
|
67
|
+
options: defineWebsiteSDKOptions({
|
|
68
|
+
rentalScope: {
|
|
69
|
+
propertyId: "property-1",
|
|
70
|
+
},
|
|
71
|
+
}),
|
|
72
|
+
});
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Config Shape
|
|
76
|
+
|
|
77
|
+
Before:
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
{
|
|
81
|
+
backend: "v9",
|
|
82
|
+
v9: {
|
|
83
|
+
graphqlUrl: "...",
|
|
84
|
+
v1ApiBaseUrl: "...",
|
|
85
|
+
apiKey: "...",
|
|
86
|
+
imageProxyBaseUrl: "..."
|
|
87
|
+
},
|
|
88
|
+
options: {...}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
After:
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
createWebsiteSDK({
|
|
96
|
+
config: {
|
|
97
|
+
backend: "v9",
|
|
98
|
+
graphqlUrl: "...",
|
|
99
|
+
v1ApiBaseUrl: "...",
|
|
100
|
+
apiKey: "...",
|
|
101
|
+
imageProxyBaseUrl: "..."
|
|
102
|
+
},
|
|
103
|
+
options: {...}
|
|
104
|
+
});
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
For v10, `backend: "v10"` is optional in TypeScript, but config files should include it when they are also used by the CLI.
|
|
108
|
+
|
|
109
|
+
## Type Name Changes
|
|
110
|
+
|
|
111
|
+
| Legacy | 2.0.0 |
|
|
112
|
+
| ------------------------------ | ------------------------- |
|
|
113
|
+
| `CMSSDK` | `WebsiteSDK` |
|
|
114
|
+
| `CMSOptions` | `WebsiteSDKOptions` |
|
|
115
|
+
| `ParsedCMSConfig` | `WebsiteSDKConfig` |
|
|
116
|
+
| `createCMSSDKFromParsedConfig` | `createWebsiteSDK` |
|
|
117
|
+
| `defineCMSSDKOptions` | `defineWebsiteSDKOptions` |
|
|
118
|
+
|
|
119
|
+
Several legacy domain aliases remain exported, including `BookingInput`, `BookingOutput`, `ContactInput`, `RentalRentalsInput`, `RentalRentalsOutput`, `RentalSearchInput`, and `RentalSearchOutput`.
|
|
120
|
+
|
|
121
|
+
## Error Handling
|
|
122
|
+
|
|
123
|
+
Legacy errors exposed `CMSError` with a `backend` field:
|
|
124
|
+
|
|
125
|
+
```ts
|
|
126
|
+
if (error instanceof CMSError && error.backend === "v9") {
|
|
127
|
+
// legacy handling
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
2.0.0 aliases `CMSError` to `CoreSDKError` from `@v-office/sdk-core`. The error shape uses `source` instead of `backend`:
|
|
132
|
+
|
|
133
|
+
```ts
|
|
134
|
+
if (error instanceof CoreSDKError) {
|
|
135
|
+
console.error(error.source, error.operation, error.message);
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Audit any code that checks:
|
|
140
|
+
|
|
141
|
+
- `error._tag`
|
|
142
|
+
- `error.backend`
|
|
143
|
+
- `error instanceof CMSError`
|
|
144
|
+
- serialized SDK error payloads
|
|
145
|
+
|
|
146
|
+
## CLI Migration
|
|
147
|
+
|
|
148
|
+
Before:
|
|
149
|
+
|
|
150
|
+
```json
|
|
151
|
+
{
|
|
152
|
+
"backend": "v10",
|
|
153
|
+
"v10": {
|
|
154
|
+
"apiEndpoint": "https://api.example.com/graphql",
|
|
155
|
+
"accessToken": "...",
|
|
156
|
+
"imageBaseUrl": "https://images.example.com"
|
|
157
|
+
},
|
|
158
|
+
"options": {
|
|
159
|
+
"rentalScope": {
|
|
160
|
+
"propertyId": "property-1"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
After:
|
|
167
|
+
|
|
168
|
+
```json
|
|
169
|
+
{
|
|
170
|
+
"backend": "v10",
|
|
171
|
+
"apiEndpoint": "https://api.example.com/graphql",
|
|
172
|
+
"accessToken": "...",
|
|
173
|
+
"imageBaseUrl": "https://images.example.com"
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Move options into a separate file:
|
|
178
|
+
|
|
179
|
+
```json
|
|
180
|
+
{
|
|
181
|
+
"rentalScope": {
|
|
182
|
+
"propertyId": "property-1"
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Then run:
|
|
188
|
+
|
|
189
|
+
```sh
|
|
190
|
+
website-sdk --backend v10 --config ./website-sdk-config.json --options ./website-sdk-options.json rentals --locale de-DE
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Environment variable names are unchanged.
|
|
194
|
+
|
|
195
|
+
## Removed or Changed Exports
|
|
196
|
+
|
|
197
|
+
The following legacy exports are not part of the 2.0.0 root API:
|
|
198
|
+
|
|
199
|
+
- `createCMSSDKFromParsedConfig`
|
|
200
|
+
- `CMSSDK`
|
|
201
|
+
- `CMSOptions`
|
|
202
|
+
- `ParsedCMSConfig`
|
|
203
|
+
- `V9CMSConfig`
|
|
204
|
+
- `V10CMSConfig`
|
|
205
|
+
- `defineStableSearchInputGroup`
|
|
206
|
+
- `toStableSearchInputParameterValues`
|
|
207
|
+
- `toStableSearchInputQueryKeys`
|
|
208
|
+
- `StableSearchInputGroup`
|
|
209
|
+
- `GuestQuoteSelectionError`
|
|
210
|
+
- v0 public schema helpers such as `V0OpenApiComponents`
|
|
211
|
+
|
|
212
|
+
If a consuming app depends on any of these, migrate to the new names or keep a small local compatibility wrapper during the app migration.
|
|
213
|
+
|
|
214
|
+
## Recommended Migration Steps
|
|
215
|
+
|
|
216
|
+
1. Update imports to `@v-office/website-sdk`.
|
|
217
|
+
2. Replace `createCMSSDKFromParsedConfig` calls with `createWebsiteSDK`.
|
|
218
|
+
3. Convert nested backend config objects to flat `WebsiteSDKConfig` objects.
|
|
219
|
+
4. Move embedded config `options` to the `options` argument.
|
|
220
|
+
5. Rename explicit `CMS*` types to `Website*` types.
|
|
221
|
+
6. Audit error handling.
|
|
222
|
+
7. Update CLI config files and scripts.
|
|
223
|
+
8. Run the consuming app's typecheck and a focused smoke test for rentals, search, quote, booking, and contact flows.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Changelog: 2.1.0
|
|
2
|
+
|
|
3
|
+
Release date: 2026-07-08
|
|
4
|
+
|
|
5
|
+
This release extends the 2.0.0 website SDK facade without changing the flat config shape or main SDK construction API.
|
|
6
|
+
|
|
7
|
+
## Added
|
|
8
|
+
|
|
9
|
+
- Added v10 legal document access through `sdk.static.documents.getTermsAndPrivacyPolicy({ locale })` and `getTermsAndPrivacyPolicyEffect`.
|
|
10
|
+
- Added `document-structured-json.md` instructions for legal document output and structured document rendering.
|
|
11
|
+
- Added v10 contact submission through `messengeremail_newContactRequest`, with shared validation for v9 and v10 contact requests.
|
|
12
|
+
- Added `validateContactSubmitInput`, `ContactSubmitValidationIssue`, and `ContactSubmitValidationIssueCode` exports.
|
|
13
|
+
- Added v10 search voucher pricing via `SearchSearchInput.voucher` and CLI `--voucher`.
|
|
14
|
+
- Added `quote.voucher` metadata for quoted voucher status.
|
|
15
|
+
- Added v10 mapped `pets` search filter, exposed by `static.filter.getFilters` as a localized BooleanFilter.
|
|
16
|
+
- Added backend-specific website SDK facade types such as `WebsiteSDKV9`, `WebsiteSDKV10`, `WebsiteSDKV10Static`, and `WebsiteSDKV10Live`.
|
|
17
|
+
|
|
18
|
+
## Changed
|
|
19
|
+
|
|
20
|
+
- v10 quote multi-rate handling now marks unavailable additional services and cancellation policies with `available: false` and `unavailableReason`.
|
|
21
|
+
- Quote selection errors can now include `UnavailableQuoteCombination` when a selected add-on/policy combination cannot be priced.
|
|
22
|
+
- Booking card sections now use a stable display order so included lines, selected add-ons, taxes, modifiers, and fallback sections render predictably.
|
|
23
|
+
- Contact validation now rejects blank required fields, invalid email addresses, invalid country codes, and overly long values before backend submission.
|
|
24
|
+
- v9 contact submission now uses the same core contact input and validation path as v10.
|
|
25
|
+
|
|
26
|
+
## Migration Impact
|
|
27
|
+
|
|
28
|
+
- No config migration is required from 2.0.0.
|
|
29
|
+
- Existing search calls continue to work; use `voucher` only for v10 voucher pricing and use either `pets` or `petsCount`, not both.
|
|
30
|
+
- Existing quote rendering should tolerate the new optional `voucher`, `available`, and `unavailableReason` fields.
|
|
31
|
+
- Existing quote selection error handling should add a fallback for `UnavailableQuoteCombination`.
|
|
32
|
+
- Existing contact forms should surface `CoreSDKError` validation issues from `error.cause.issues`.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Migration: 2.0.0 to 2.1.0
|
|
2
|
+
|
|
3
|
+
This guide covers upgrading `@v-office/website-sdk` from 2.0.0 to 2.1.0.
|
|
4
|
+
|
|
5
|
+
2.1.0 is a minor release. Keep using `createWebsiteSDK({ config, options })`, the flat `WebsiteSDKConfig`, and separate `WebsiteSDKOptions`.
|
|
6
|
+
|
|
7
|
+
## What To Review
|
|
8
|
+
|
|
9
|
+
### Documents
|
|
10
|
+
|
|
11
|
+
v10 SDK instances now expose:
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
const documents = await sdk.static.documents.getTermsAndPrivacyPolicy({ locale: "de-DE" });
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The output may contain `terms` and/or `privacyPolicy`, each with `{ subject, data }`. `data` is the published document revision data as a string. If your app renders this data, see `../../document-structured-json.md`.
|
|
18
|
+
|
|
19
|
+
This API is v10-only. Code that handles both backends should narrow by `sdk.backend === "v10"` before calling `sdk.static.documents`.
|
|
20
|
+
|
|
21
|
+
### Contact
|
|
22
|
+
|
|
23
|
+
Contact requests are validated before submission on both v9 and v10. Validation failures reject with `CoreSDKError` using `operation: "contact.submit.validation"` and field details in `error.cause.issues`.
|
|
24
|
+
|
|
25
|
+
Required fields are `title`, `surname`, `email`, `subject`, and `message`. Validation also checks email format, two-letter uppercase country codes, and maximum field lengths.
|
|
26
|
+
|
|
27
|
+
Migration: update contact forms to display field-level validation issues instead of treating every contact error as a backend failure.
|
|
28
|
+
|
|
29
|
+
### Search
|
|
30
|
+
|
|
31
|
+
`SearchSearchInput` now accepts `voucher?: string` for v10 pricing:
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
await sdk.live.search.search({
|
|
35
|
+
locale: "de-DE",
|
|
36
|
+
query: "adults=2",
|
|
37
|
+
voucher: "SUMMER26",
|
|
38
|
+
});
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The CLI equivalent is `--voucher SUMMER26`.
|
|
42
|
+
|
|
43
|
+
v10 filters now expose a mapped BooleanFilter with `searchParameterQueryKey: "pets"` and localized labels (`Dogs welcome` / `Hunde willkommen`). It maps to one pet in occupancy. Use either `pets` or `petsCount`, not both.
|
|
44
|
+
|
|
45
|
+
### Quote
|
|
46
|
+
|
|
47
|
+
Available quotes can include:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
quote.voucher; // { code, status, message? }
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`status` is `"applied"`, `"not_applied"`, or `"unknown"`. v10 can detect applied voucher modifiers; v9 uses `"unknown"` for available voucher quotes.
|
|
54
|
+
|
|
55
|
+
Additional services and cancellation policies may now include:
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
{
|
|
59
|
+
available: false,
|
|
60
|
+
unavailableReason: "..."
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Migration: disable unavailable options in the UI and keep handling unknown optional fields gracefully.
|
|
65
|
+
|
|
66
|
+
Quote selection errors can now include `UnavailableQuoteCombination` when a selected add-on/cancellation-policy combination cannot be priced. Add a generic message for unsupported combinations.
|
|
67
|
+
|
|
68
|
+
### Public Types
|
|
69
|
+
|
|
70
|
+
The root package now exports backend-specific facade types:
|
|
71
|
+
|
|
72
|
+
- `WebsiteSDKV9`
|
|
73
|
+
- `WebsiteSDKV10`
|
|
74
|
+
- `WebsiteSDKSharedStatic`
|
|
75
|
+
- `WebsiteSDKSharedLive`
|
|
76
|
+
- `WebsiteSDKV10Static`
|
|
77
|
+
- `WebsiteSDKV10Live`
|
|
78
|
+
|
|
79
|
+
Use these only when you need backend-specific narrowing. Existing `WebsiteSDK` imports remain valid.
|
|
80
|
+
|
|
81
|
+
## Recommended Steps
|
|
82
|
+
|
|
83
|
+
1. Upgrade to `@v-office/website-sdk` 2.1.0.
|
|
84
|
+
2. Update contact form error handling for `error.cause.issues`.
|
|
85
|
+
3. If you render quotes, support optional `quote.voucher`, `available`, and `unavailableReason`.
|
|
86
|
+
4. Add handling for `UnavailableQuoteCombination` in quote selection failures.
|
|
87
|
+
5. If you use v10 search filters, render the new `pets` BooleanFilter and avoid combining it with `petsCount`.
|
|
88
|
+
6. Use `sdk.static.documents.getTermsAndPrivacyPolicy` for v10 terms/privacy output where needed.
|
|
89
|
+
7. Run a focused smoke test for search, quote selection, booking, contact submission, and v10 documents.
|