@v-office/website-sdk 2.4.2 → 2.5.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 +34 -14
- package/dist/{client-BORwUo4_.mjs → client-Cnf-pbry.mjs} +4 -2
- package/dist/index.d.mts +18 -4
- package/dist/index.mjs +3 -3
- package/dist/instructions/CHANGELOG.md +3 -0
- package/dist/instructions/MIGRATION.md +3 -0
- package/dist/instructions/README.md +7 -2
- package/dist/instructions/availability.md +2 -1
- package/dist/instructions/booking.md +1 -1
- package/dist/instructions/contact.md +1 -1
- package/dist/instructions/creation.md +44 -0
- package/dist/instructions/filter.md +2 -1
- package/dist/instructions/quote.md +1 -1
- package/dist/instructions/rentals.md +2 -1
- package/dist/instructions/search.md +115 -2
- package/dist/instructions/versions/2.4.2/CHANGELOG.md +30 -0
- package/dist/instructions/versions/2.4.2/MIGRATION.md +94 -0
- package/dist/instructions/versions/2.4.3/CHANGELOG.md +14 -0
- package/dist/instructions/versions/2.4.3/MIGRATION.md +5 -0
- package/dist/instructions/versions/2.5.0/CHANGELOG.md +43 -0
- package/dist/instructions/versions/2.5.0/MIGRATION.md +135 -0
- package/dist/{search-Ckz48lwV.mjs → search-D1_b2t11.mjs} +14 -3
- package/instructions/CHANGELOG.md +3 -0
- package/instructions/MIGRATION.md +3 -0
- package/instructions/README.md +7 -2
- package/instructions/availability.md +2 -1
- package/instructions/booking.md +1 -1
- package/instructions/contact.md +1 -1
- package/instructions/creation.md +44 -0
- package/instructions/filter.md +2 -1
- package/instructions/quote.md +1 -1
- package/instructions/rentals.md +2 -1
- package/instructions/search.md +115 -2
- package/instructions/versions/2.4.2/CHANGELOG.md +30 -0
- package/instructions/versions/2.4.2/MIGRATION.md +94 -0
- package/instructions/versions/2.4.3/CHANGELOG.md +14 -0
- package/instructions/versions/2.4.3/MIGRATION.md +5 -0
- package/instructions/versions/2.5.0/CHANGELOG.md +43 -0
- package/instructions/versions/2.5.0/MIGRATION.md +135 -0
- package/package.json +2 -2
package/instructions/creation.md
CHANGED
|
@@ -11,6 +11,7 @@ const sdk = createWebsiteSDK({
|
|
|
11
11
|
config: {
|
|
12
12
|
backend: "v10",
|
|
13
13
|
apiEndpoint: "https://api.example.com/graphql",
|
|
14
|
+
searchEndpoint: "https://search.example.com/search",
|
|
14
15
|
accessToken: "...",
|
|
15
16
|
imageBaseUrl: "https://images.example.com",
|
|
16
17
|
},
|
|
@@ -58,6 +59,7 @@ const sdk = createWebsiteSDK({
|
|
|
58
59
|
config: {
|
|
59
60
|
backend: "v10",
|
|
60
61
|
apiEndpoint: "https://api.example.com/graphql",
|
|
62
|
+
searchEndpoint: "https://search.example.com/search",
|
|
61
63
|
accessToken: "...",
|
|
62
64
|
imageBaseUrl: "https://images.example.com",
|
|
63
65
|
},
|
|
@@ -66,6 +68,8 @@ const sdk = createWebsiteSDK({
|
|
|
66
68
|
|
|
67
69
|
For v10, `backend: "v10"` is optional in TypeScript, but including it is clearer when config files are shared with the CLI.
|
|
68
70
|
|
|
71
|
+
For v10, `searchEndpoint` is required as of 2.5.0. It is the full REST search URL including the `/search` path and is a separate host from `apiEndpoint` (which still serves rentals, filters, quote, availability, booking, and contact over GraphQL). Configure it explicitly rather than deriving it from `apiEndpoint`.
|
|
72
|
+
|
|
69
73
|
## WebsiteSDKOptions
|
|
70
74
|
|
|
71
75
|
`options` is optional and is passed separately from backend config:
|
|
@@ -88,6 +92,7 @@ const options = defineWebsiteSDKOptions({
|
|
|
88
92
|
type WebsiteSDKOptions = {
|
|
89
93
|
translationOverrides?: TranslationOverrides;
|
|
90
94
|
customAttributeFilterDefinitions?: readonly CustomAttributeFilterDefinition[];
|
|
95
|
+
customAttributeDefinitionManifest?: CustomAttributeDefinitionManifest;
|
|
91
96
|
rentalHighlightPrioritization?: readonly RentalHighlightPrioritizationKey[];
|
|
92
97
|
rentalPropertyHighlightPrioritization?: readonly RentalPropertyHighlightPrioritizationKey[];
|
|
93
98
|
rentalScope?: RentalScope;
|
|
@@ -98,6 +103,7 @@ type WebsiteSDKOptions = {
|
|
|
98
103
|
Unset options are normalized by the SDK:
|
|
99
104
|
|
|
100
105
|
- `customAttributeFilterDefinitions` defaults to `[]`.
|
|
106
|
+
- `customAttributeDefinitionManifest` is omitted unless provided; an absent manifest is treated as empty.
|
|
101
107
|
- `rentalHighlightPrioritization` defaults to the SDK default rental highlight order.
|
|
102
108
|
- `rentalPropertyHighlightPrioritization` defaults to the SDK default property highlight order.
|
|
103
109
|
- `rentalScope` defaults to `{}`.
|
|
@@ -176,6 +182,43 @@ Visibility:
|
|
|
176
182
|
- `internal: true` keeps filters usable by search and compositions but hides them from `getFilters`.
|
|
177
183
|
- `searchable: false` keeps custom attributes as display metadata only.
|
|
178
184
|
|
|
185
|
+
## Custom Attribute Definition Manifest
|
|
186
|
+
|
|
187
|
+
The v10 REST search backend filters and returns custom attributes by definition ID, while SDK configuration and query strings use keys. Because definition IDs are workspace/environment specific, use `customAttributeDefinitionManifest` to give the SDK a key-to-ID and ID-to-key mapping:
|
|
188
|
+
|
|
189
|
+
```ts
|
|
190
|
+
const options = defineWebsiteSDKOptions({
|
|
191
|
+
customAttributeDefinitionManifest: {
|
|
192
|
+
byKey: {
|
|
193
|
+
region: { id: "def-1", key: "region", type: "OPTION", visibility: "PUBLIC" },
|
|
194
|
+
},
|
|
195
|
+
byId: {
|
|
196
|
+
"def-1": { id: "def-1", key: "region", type: "OPTION", visibility: "PUBLIC" },
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
});
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
```ts
|
|
203
|
+
type CustomAttributeDefinitionManifestEntry = {
|
|
204
|
+
id: string;
|
|
205
|
+
key: string;
|
|
206
|
+
type: "BOOLEAN" | "INT" | "STRING" | "OPTION";
|
|
207
|
+
visibility: "PUBLIC" | string | null;
|
|
208
|
+
options?: readonly { value: string; label?: Record<string, string> }[];
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
type CustomAttributeDefinitionManifest = {
|
|
212
|
+
byKey: Record<string, CustomAttributeDefinitionManifestEntry>;
|
|
213
|
+
byId: Record<string, CustomAttributeDefinitionManifestEntry>;
|
|
214
|
+
};
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
- Generate the manifest at build time from your definitions source, and pass a separate manifest per workspace/environment because IDs are not portable.
|
|
218
|
+
- Custom-attribute keys that have no manifest entry are left in `unusedFilterKeys` instead of being applied as filters.
|
|
219
|
+
- Only definitions with `visibility` of `PUBLIC` (or `null`) are surfaced as v10 search highlights; others are ignored.
|
|
220
|
+
- The manifest is only used by v10 search. v9 and the non-search v10 endpoints ignore it.
|
|
221
|
+
|
|
179
222
|
## Translation Overrides
|
|
180
223
|
|
|
181
224
|
Use `translationOverrides` to override SDK translation keys:
|
|
@@ -206,6 +249,7 @@ Example `website-sdk-config.v10.json`:
|
|
|
206
249
|
{
|
|
207
250
|
"backend": "v10",
|
|
208
251
|
"apiEndpoint": "https://api.example.com/graphql",
|
|
252
|
+
"searchEndpoint": "https://search.example.com/search",
|
|
209
253
|
"accessToken": "...",
|
|
210
254
|
"imageBaseUrl": "https://images.example.com"
|
|
211
255
|
}
|
package/instructions/filter.md
CHANGED
|
@@ -91,6 +91,7 @@ Filter variants:
|
|
|
91
91
|
{
|
|
92
92
|
"backend": "v10",
|
|
93
93
|
"apiEndpoint": "https://api.example.com/graphql",
|
|
94
|
+
"searchEndpoint": "https://search.example.com/search",
|
|
94
95
|
"accessToken": "...",
|
|
95
96
|
"imageBaseUrl": "https://images.example.com"
|
|
96
97
|
}
|
|
@@ -155,4 +156,4 @@ website-sdk --backend v10 filters --locale de-DE --output pretty
|
|
|
155
156
|
Environment variables:
|
|
156
157
|
|
|
157
158
|
- `v9`: `HUB_GRAPHQL_URL`, `HUB_V1_API_BASE_URL`, optional `HUB_V0_API_BASE_URL`, `HUB_API_KEY`, `IMAGE_PROXY_BASE_URL`.
|
|
158
|
-
- `v10`: `VOFFICE_API_ENDPOINT`, `VOFFICE_LOCAL_DEV_ACCESS_TOKEN`, `VOFFICE_IMAGE_BASE_URL`.
|
|
159
|
+
- `v10`: `VOFFICE_API_ENDPOINT`, `VOFFICE_SEARCH_ENDPOINT`, `VOFFICE_LOCAL_DEV_ACCESS_TOKEN`, `VOFFICE_IMAGE_BASE_URL`.
|
package/instructions/quote.md
CHANGED
|
@@ -344,4 +344,4 @@ The CLI only creates the initial quote. Additional service, cancellation policy,
|
|
|
344
344
|
Environment variables:
|
|
345
345
|
|
|
346
346
|
- `v9`: `HUB_GRAPHQL_URL`, `HUB_V1_API_BASE_URL`, optional `HUB_V0_API_BASE_URL`, `HUB_API_KEY`, `IMAGE_PROXY_BASE_URL`.
|
|
347
|
-
- `v10`: `VOFFICE_API_ENDPOINT`, `VOFFICE_LOCAL_DEV_ACCESS_TOKEN`, `VOFFICE_IMAGE_BASE_URL`.
|
|
347
|
+
- `v10`: `VOFFICE_API_ENDPOINT`, `VOFFICE_SEARCH_ENDPOINT`, `VOFFICE_LOCAL_DEV_ACCESS_TOKEN`, `VOFFICE_IMAGE_BASE_URL`.
|
package/instructions/rentals.md
CHANGED
|
@@ -137,6 +137,7 @@ For v10, public answers with the same form-response ID are combined into one rev
|
|
|
137
137
|
{
|
|
138
138
|
"backend": "v10",
|
|
139
139
|
"apiEndpoint": "https://api.example.com/graphql",
|
|
140
|
+
"searchEndpoint": "https://search.example.com/search",
|
|
140
141
|
"accessToken": "...",
|
|
141
142
|
"imageBaseUrl": "https://images.example.com"
|
|
142
143
|
}
|
|
@@ -179,4 +180,4 @@ website-sdk --backend v10 rentals --locale de-DE --output pretty
|
|
|
179
180
|
Environment variables:
|
|
180
181
|
|
|
181
182
|
- `v9`: `HUB_GRAPHQL_URL`, `HUB_V1_API_BASE_URL`, optional `HUB_V0_API_BASE_URL`, `HUB_API_KEY`, `IMAGE_PROXY_BASE_URL`.
|
|
182
|
-
- `v10`: `VOFFICE_API_ENDPOINT`, `VOFFICE_LOCAL_DEV_ACCESS_TOKEN`, `VOFFICE_IMAGE_BASE_URL`.
|
|
183
|
+
- `v10`: `VOFFICE_API_ENDPOINT`, `VOFFICE_SEARCH_ENDPOINT`, `VOFFICE_LOCAL_DEV_ACCESS_TOKEN`, `VOFFICE_IMAGE_BASE_URL`.
|
package/instructions/search.md
CHANGED
|
@@ -23,9 +23,38 @@ type RentalSearchInput = {
|
|
|
23
23
|
voucher?: string;
|
|
24
24
|
limit?: number;
|
|
25
25
|
cursor?: string;
|
|
26
|
+
sort?: SearchSearchSort;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
type SearchSearchSort =
|
|
30
|
+
| { by: "price"; direction: "ASC" | "DESC" }
|
|
31
|
+
| { by: "random" }
|
|
32
|
+
| { by: "rating" }
|
|
33
|
+
| { by: "field"; orderBy: SearchSearchFieldOrderBy };
|
|
34
|
+
|
|
35
|
+
type SearchSearchFieldOrderBy = {
|
|
36
|
+
label?: "ASC" | "DESC";
|
|
37
|
+
name?: "ASC" | "DESC";
|
|
38
|
+
roomSummary?: {
|
|
39
|
+
bathrooms?: "ASC" | "DESC";
|
|
40
|
+
bedrooms?: "ASC" | "DESC";
|
|
41
|
+
livingrooms?: "ASC" | "DESC";
|
|
42
|
+
maxAdults?: "ASC" | "DESC";
|
|
43
|
+
maxPersons?: "ASC" | "DESC";
|
|
44
|
+
rooms?: "ASC" | "DESC";
|
|
45
|
+
};
|
|
46
|
+
attributes?: {
|
|
47
|
+
squareMeters?: "ASC" | "DESC";
|
|
48
|
+
};
|
|
49
|
+
vicinity?: {
|
|
50
|
+
beachdistance?: "ASC" | "DESC";
|
|
51
|
+
citydistance?: "ASC" | "DESC";
|
|
52
|
+
};
|
|
26
53
|
};
|
|
27
54
|
```
|
|
28
55
|
|
|
56
|
+
The v9 facade narrows `sort` to price, random, or rating. The closed field-sorting contract is v10-only. The SDK also exports the corresponding `SearchSearchSortSchema`, variant schemas, types, and `V9SearchSearchSort`.
|
|
57
|
+
|
|
29
58
|
Sample:
|
|
30
59
|
|
|
31
60
|
```json
|
|
@@ -34,7 +63,11 @@ Sample:
|
|
|
34
63
|
"query": "start=01-07-2026&end=08-07-2026&adults=2&children=1&wifi=true",
|
|
35
64
|
"rentalIdsIn": ["123", "456"],
|
|
36
65
|
"voucher": "SUMMER26",
|
|
37
|
-
"limit": 20
|
|
66
|
+
"limit": 20,
|
|
67
|
+
"sort": {
|
|
68
|
+
"by": "price",
|
|
69
|
+
"direction": "ASC"
|
|
70
|
+
}
|
|
38
71
|
}
|
|
39
72
|
```
|
|
40
73
|
|
|
@@ -130,6 +163,66 @@ For v10, `pets` is a mapped BooleanFilter exposed by `getFilters` and maps to on
|
|
|
130
163
|
|
|
131
164
|
`limit` defaults to `20`. Treat `cursor` as opaque and pass back `pageInfo.nextCursor` unchanged.
|
|
132
165
|
|
|
166
|
+
## Sorting
|
|
167
|
+
|
|
168
|
+
Sorting is optional. The discriminated `sort` union allows exactly one ordering mode per request.
|
|
169
|
+
|
|
170
|
+
Price, random, and rating use the same input in v9 and v10:
|
|
171
|
+
|
|
172
|
+
```ts
|
|
173
|
+
await sdk.live.search.search({
|
|
174
|
+
locale: "de-DE",
|
|
175
|
+
query: "start=01-08-2026&end=08-08-2026&adults=2",
|
|
176
|
+
sort: { by: "price", direction: "ASC" },
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
await sdk.live.search.search({
|
|
180
|
+
locale: "de-DE",
|
|
181
|
+
query: "adults=2",
|
|
182
|
+
sort: { by: "random" },
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
await sdk.live.search.search({
|
|
186
|
+
locale: "de-DE",
|
|
187
|
+
query: "adults=2",
|
|
188
|
+
sort: { by: "rating" },
|
|
189
|
+
});
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Backend behavior:
|
|
193
|
+
|
|
194
|
+
- `price`: v9 maps to `price_asc` or `price_desc`. v10 orders priced alternatives by total and direction. v10 price sorting requires a fixed-period or flexible-date query with occupancy; the SDK rejects incomplete requests before transport.
|
|
195
|
+
- `random`: v9 requests the backend's random ordering. v10 currently keeps the default backend ordering.
|
|
196
|
+
- `rating`: v9 requests the backend's rating ordering. v10 currently keeps the default backend ordering until rating ordering is implemented.
|
|
197
|
+
- v9 may retain backend-promoted results ahead of the requested business order, and its random ordering may be deterministic.
|
|
198
|
+
- v10 price ordering follows the backend's boost-first, total-second behavior, so different boost groups are not globally ordered only by price.
|
|
199
|
+
|
|
200
|
+
v10 additionally supports a stable subset of rental-summary field ordering:
|
|
201
|
+
|
|
202
|
+
```ts
|
|
203
|
+
await sdk.live.search.search({
|
|
204
|
+
locale: "de-DE",
|
|
205
|
+
query: "adults=2",
|
|
206
|
+
sort: {
|
|
207
|
+
by: "field",
|
|
208
|
+
orderBy: {
|
|
209
|
+
label: "ASC",
|
|
210
|
+
roomSummary: {
|
|
211
|
+
bedrooms: "DESC",
|
|
212
|
+
},
|
|
213
|
+
attributes: {
|
|
214
|
+
squareMeters: "DESC",
|
|
215
|
+
},
|
|
216
|
+
vicinity: {
|
|
217
|
+
beachdistance: "ASC",
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
});
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
The supported fields are `label`, `name`, all six `roomSummary` counters, `attributes.squareMeters`, `vicinity.beachdistance`, and `vicinity.citydistance`. Unknown fields and nesting are not part of the public type and are rejected before transport by the SDK and CLI. The field variant is excluded from `V9SearchSearchSort` and rejected by the CLI when `--backend v9` is selected.
|
|
225
|
+
|
|
133
226
|
## Output
|
|
134
227
|
|
|
135
228
|
Returns `Promise<RentalSearchOutput>`.
|
|
@@ -192,10 +285,22 @@ Sample:
|
|
|
192
285
|
|
|
193
286
|
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
287
|
|
|
288
|
+
## v10 Backend
|
|
289
|
+
|
|
290
|
+
v10 search runs against the dedicated REST search backend (`POST` to the configured `searchEndpoint`). Existing calls and the output type remain compatible, while the input additionally supports optional sorting. v10 results reflect the REST projection:
|
|
291
|
+
|
|
292
|
+
- At most five images per item, and no image `category`.
|
|
293
|
+
- `property` is the minimal `{ id, nameOrLabel }` shape. Hydrate `property.location`, `property.images`, or `property.address` from `sdk.static.rentals.getRentals(...)` when a card needs them.
|
|
294
|
+
- Custom-attribute search filters and highlights require a `customAttributeDefinitionManifest`; without it, custom-attribute query keys are left in `unusedFilterKeys` and no custom-attribute highlights are added.
|
|
295
|
+
- Fixed-period and flexible searches are priced by the REST backend and require occupancy.
|
|
296
|
+
- Pagination uses the backend `from`/`size` window behind the same opaque `cursor`, capped at 1,000 results.
|
|
297
|
+
|
|
195
298
|
## Configuration
|
|
196
299
|
|
|
197
300
|
Use flat `WebsiteSDKConfig` files and optional `WebsiteSDKOptions`.
|
|
198
301
|
|
|
302
|
+
For v10, config requires `searchEndpoint` (the full REST search URL) as of 2.5.0. See `creation.md` for `searchEndpoint` and the `customAttributeDefinitionManifest` option.
|
|
303
|
+
|
|
199
304
|
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
305
|
|
|
201
306
|
## CLI Usage
|
|
@@ -220,6 +325,14 @@ website-sdk --backend v10 search --locale de-DE --query "adults=2" --rental-ids-
|
|
|
220
325
|
website-sdk --backend v10 search --locale de-DE --query "adults=2" --voucher SUMMER26
|
|
221
326
|
```
|
|
222
327
|
|
|
328
|
+
Pass sorting as schema-validated JSON:
|
|
329
|
+
|
|
330
|
+
```sh
|
|
331
|
+
website-sdk --backend v9 search --locale de-DE --query "adults=2" --sort '{"by":"random"}'
|
|
332
|
+
website-sdk --backend v10 search --locale de-DE --query "start=01-08-2026&end=08-08-2026&adults=2" --sort '{"by":"price","direction":"ASC"}'
|
|
333
|
+
website-sdk --backend v10 search --locale de-DE --query "adults=2" --sort '{"by":"field","orderBy":{"label":"ASC"}}'
|
|
334
|
+
```
|
|
335
|
+
|
|
223
336
|
Use files instead of environment variables:
|
|
224
337
|
|
|
225
338
|
```sh
|
|
@@ -235,4 +348,4 @@ website-sdk --backend v10 search --locale de-DE --query "adults=2" --output pret
|
|
|
235
348
|
Environment variables:
|
|
236
349
|
|
|
237
350
|
- `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`.
|
|
351
|
+
- `v10`: `VOFFICE_API_ENDPOINT`, `VOFFICE_SEARCH_ENDPOINT`, `VOFFICE_LOCAL_DEV_ACCESS_TOKEN`, `VOFFICE_IMAGE_BASE_URL`.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Changelog: 2.4.2
|
|
2
|
+
|
|
3
|
+
Release date: 2026-07-20
|
|
4
|
+
|
|
5
|
+
This release adds proposed additional-service quantities and combines related v10 public feedback answers into complete review items.
|
|
6
|
+
|
|
7
|
+
## Added
|
|
8
|
+
|
|
9
|
+
- Added optional `proposedQuantity` to additional services for both v9 and v10. The field is returned when the backend supplies a line amount, including `0`.
|
|
10
|
+
- Added the `shouldAddProposedAdditionalServiceAmount` website SDK option. When enabled, proposed quantities greater than zero are selected on the initial quote.
|
|
11
|
+
- Added deterministic pagination for v10 public feedback so rental reviews are not limited to the first backend result page.
|
|
12
|
+
|
|
13
|
+
## Changed
|
|
14
|
+
|
|
15
|
+
- Renamed the additional-service field `preSelectedQuantity` to `proposedQuantity`.
|
|
16
|
+
- `shouldAddProposedAdditionalServiceAmount` defaults to `false`, so proposed quantities are informational unless consumers opt in to automatic initial selection.
|
|
17
|
+
- Optional services with a backend amount of `0` can still be returned with their unit charge when the backend provides enough pricing data.
|
|
18
|
+
- v10 public feedback answers with the same form-response ID are now combined into one review item instead of being returned as independent rating-only and text-only items.
|
|
19
|
+
- A combined v10 review uses the form-response ID and creation time, averages valid `STARS` answers, and includes its non-empty `TEXT` answers.
|
|
20
|
+
- v10 review summaries now count form responses with a valid rating rather than individual rating answers.
|
|
21
|
+
|
|
22
|
+
## Migration Impact
|
|
23
|
+
|
|
24
|
+
- Replace reads of `additionalService.preSelectedQuantity` with `additionalService.proposedQuantity`.
|
|
25
|
+
- Leave `shouldAddProposedAdditionalServiceAmount` unset or `false` to preserve explicit additional-service selection.
|
|
26
|
+
- Set `shouldAddProposedAdditionalServiceAmount: true` only when the initial quote should include positive backend-proposed quantities.
|
|
27
|
+
- Do not assume each v10 review item represents one feedback answer. It now represents one form response and can contain both `rating` and `text`.
|
|
28
|
+
- Treat a v10 review item's `id` and `createdAt` as form-response metadata.
|
|
29
|
+
- Do not use `reviews.items.length` as the review-summary count.
|
|
30
|
+
- No SDK config-shape or service-call changes are required.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Migration: 2.4.1 to 2.4.2
|
|
2
|
+
|
|
3
|
+
This guide covers upgrading `@v-office/website-sdk` from 2.4.1 to 2.4.2.
|
|
4
|
+
|
|
5
|
+
2.4.2 keeps `createWebsiteSDK({ config, options })`, the flat `WebsiteSDKConfig`, and the existing quote and rental service calls. The migration affects additional-service quantities and v10 review grouping.
|
|
6
|
+
|
|
7
|
+
## Additional Services
|
|
8
|
+
|
|
9
|
+
### Renamed Quantity
|
|
10
|
+
|
|
11
|
+
The optional `preSelectedQuantity` field is now named `proposedQuantity`:
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
for (const service of quote.additionalServices) {
|
|
15
|
+
if (service.proposedQuantity !== undefined) {
|
|
16
|
+
renderProposedQuantity(service.proposedQuantity);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The value is the backend-proposed quantity, including `0`. It does not indicate that the service is selected in the quote.
|
|
22
|
+
|
|
23
|
+
Migration: replace every read of `preSelectedQuantity` with `proposedQuantity` and continue to handle the field as optional.
|
|
24
|
+
|
|
25
|
+
### Initial Selection
|
|
26
|
+
|
|
27
|
+
Proposed quantities are not selected by default. To add positive proposed quantities to the initial quote, enable the new website SDK option:
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
const sdk = createWebsiteSDK({
|
|
31
|
+
config,
|
|
32
|
+
options: defineWebsiteSDKOptions({
|
|
33
|
+
shouldAddProposedAdditionalServiceAmount: true,
|
|
34
|
+
}),
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
When this option is `true`, the SDK adds each service up to its positive `proposedQuantity` while creating the quote. Normal availability and quantity-limit checks still apply. A proposed quantity of `0` is never selected automatically.
|
|
39
|
+
|
|
40
|
+
Leave the option unset or set it to `false` when users must explicitly select every optional service.
|
|
41
|
+
|
|
42
|
+
## v10 Rental Reviews
|
|
43
|
+
|
|
44
|
+
v10 now combines public answers that have the same form-response ID. One review item can therefore contain both its averaged star rating and its text:
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
const review = {
|
|
48
|
+
id: "form-response-1",
|
|
49
|
+
author: "Ada Lovelace, visited in July 2026",
|
|
50
|
+
rating: "5",
|
|
51
|
+
createdAt: "2026-07-10T10:00:00.000Z",
|
|
52
|
+
text: "Great stay.",
|
|
53
|
+
};
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
For each v10 form response:
|
|
57
|
+
|
|
58
|
+
- `id` is the form-response ID.
|
|
59
|
+
- `createdAt` is the form-response creation time.
|
|
60
|
+
- `rating` is the average of its valid public `STARS` values.
|
|
61
|
+
- `text` contains its non-empty public `TEXT` answers.
|
|
62
|
+
- `author` remains optional when no public customer information is available.
|
|
63
|
+
- The item is omitted when the response has neither a valid rating nor non-empty text.
|
|
64
|
+
|
|
65
|
+
If a response contains multiple text answers, they are separated by blank lines and non-empty question titles identify the corresponding text. Review items remain sorted by form-response creation time, newest first.
|
|
66
|
+
|
|
67
|
+
Rendering should continue to check optional fields independently:
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
for (const rental of await sdk.static.rentals.getRentals({ locale: "de-DE" })) {
|
|
71
|
+
for (const item of rental.reviews?.items ?? []) {
|
|
72
|
+
if (item.rating !== undefined) renderReviewRating(item.rating);
|
|
73
|
+
if (item.text !== undefined) renderReviewText(item.text);
|
|
74
|
+
renderReviewAuthor(item.author ?? "Anonymous");
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (rental.reviews?.summary !== undefined) {
|
|
78
|
+
renderReviewSummary(rental.reviews.summary);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The localized `reviews.summary.count` now counts form responses that contain a valid rating. It can differ from both the number of raw answers and `reviews.items.length`. Text-only reviews can still produce `reviews.items` without a summary.
|
|
84
|
+
|
|
85
|
+
The SDK now fetches all v10 public-feedback pages. Consumers do not need to add pagination logic to `getRentals`.
|
|
86
|
+
|
|
87
|
+
## Recommended Steps
|
|
88
|
+
|
|
89
|
+
1. Upgrade to `@v-office/website-sdk` 2.4.2.
|
|
90
|
+
2. Rename `preSelectedQuantity` reads to `proposedQuantity`.
|
|
91
|
+
3. Decide whether backend-proposed quantities should be selected automatically.
|
|
92
|
+
4. Expect one v10 review item per usable form response rather than one item per answer.
|
|
93
|
+
5. Keep presence checks for review `rating`, `text`, `author`, and `summary`.
|
|
94
|
+
6. Smoke-test quotes with absent, zero, and positive proposed quantities and rentals with rating-only, text-only, and combined feedback.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Changelog: 2.4.3
|
|
2
|
+
|
|
3
|
+
Release date: 2026-07-20
|
|
4
|
+
|
|
5
|
+
This release adds the instructions that were missing from the 2.4.2 package.
|
|
6
|
+
|
|
7
|
+
## Added
|
|
8
|
+
|
|
9
|
+
- Added the missing 2.4.2 changelog and migration instructions for proposed additional-service quantities and grouped v10 reviews.
|
|
10
|
+
|
|
11
|
+
## Migration Impact
|
|
12
|
+
|
|
13
|
+
- No runtime behavior or public API changes are introduced relative to 2.4.2.
|
|
14
|
+
- Consumers upgrading from 2.4.1 or earlier should follow `versions/2.4.2/MIGRATION.md`.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Migration: 2.4.2 to 2.4.3
|
|
2
|
+
|
|
3
|
+
The 2.4.2 package was missing its release instructions. Version 2.4.3 adds those instructions without changing runtime behavior or the public API.
|
|
4
|
+
|
|
5
|
+
No migration is required from 2.4.2. If upgrading from 2.4.1 or earlier, follow `versions/2.4.2/MIGRATION.md`.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Changelog: 2.5.0
|
|
2
|
+
|
|
3
|
+
Release date: 2026-07-21
|
|
4
|
+
|
|
5
|
+
This release moves v10 rental search onto the dedicated REST search backend, adds optional cross-backend search sorting, and updates static v10 rental loading. Existing public calls and output types remain compatible.
|
|
6
|
+
|
|
7
|
+
## Added
|
|
8
|
+
|
|
9
|
+
- Added the required `searchEndpoint` field to v10 backend config for the REST search endpoint (for example `https://search.example.com/search`).
|
|
10
|
+
- Added the optional `customAttributeDefinitionManifest` SDK option that maps custom-attribute keys to backend definition IDs for v10 search.
|
|
11
|
+
- Added the `VOFFICE_SEARCH_ENDPOINT` environment variable and the `searchEndpoint` config-file field for the CLI.
|
|
12
|
+
- Added optional `SearchSearchInput.sort` support with Effect schemas and exported types for price, random, rating, and a closed v10 rental-summary field-ordering contract.
|
|
13
|
+
- Added the v9-narrowed `V9SearchSearchSort`, which supports price, random, and rating but excludes v10 field ordering.
|
|
14
|
+
- Added schema-validated CLI `search --sort '<JSON>'` support.
|
|
15
|
+
|
|
16
|
+
## Changed
|
|
17
|
+
|
|
18
|
+
- v10 `sdk.live.search.search` now calls the REST search backend instead of GraphQL. Period, flexible, occupancy, voucher, filter, and cursor behavior is unchanged.
|
|
19
|
+
- v10 search cards now return at most five images and no image `category`.
|
|
20
|
+
- v10 search-result `property` is now the minimal `{ id, nameOrLabel }` shape; per-property `location`, `images`, and `address` are no longer returned on search cards.
|
|
21
|
+
- v10 custom-attribute search filters and highlights now resolve through `customAttributeDefinitionManifest` instead of a per-search backend lookup.
|
|
22
|
+
- v10 pagination now uses the backend `from`/`size` window directly; the opaque `cursor` and 1,000-result window are unchanged.
|
|
23
|
+
- Price sorting maps to `price_asc`/`price_desc` on v9 and `totalOrderBy` on v10. v10 validates that price sorting has a fixed or flexible pricing mode and occupancy before making a REST request.
|
|
24
|
+
- Supported field sorting maps to v10 `rentalSummaryOrderBy`. The stable subset covers names, room-summary counters, square meters, and beach/city distances. v10 random and rating variants intentionally retain default ordering; v9 forwards them to its backend.
|
|
25
|
+
- v10 `sdk.static.rentals.getRentals` now loads base records from `rentals_listRental` instead of `rentals_listRentalSummary`.
|
|
26
|
+
- v10 rental images are loaded in batches from `rentals_listRentalImage`; only uploaded images are included and existing image output/order is preserved.
|
|
27
|
+
- v10 rental room summaries and room-summary highlights are derived from room types and bed occupancy data, with validation for invalid bed kinds and amounts.
|
|
28
|
+
- v10 rental and rental-image traversal now uses serial keyset pagination instead of offsets. Cursor progress is validated, while the existing public rental and image ordering remains unchanged.
|
|
29
|
+
- The REST search request types retain the `RentalSummary` filter contract independently of static rental GraphQL loading.
|
|
30
|
+
|
|
31
|
+
## Removed
|
|
32
|
+
|
|
33
|
+
- Removed the internal per-search GraphQL custom-attribute definition lookup and the temporary v10 search-result cache. Both were internal and have no public API surface.
|
|
34
|
+
- Removed the static-rental dependency on `rentals_listRentalSummary`, including its embedded rental images, room summary, and offset pagination.
|
|
35
|
+
|
|
36
|
+
## Migration Impact
|
|
37
|
+
|
|
38
|
+
- v10 config now requires `searchEndpoint`; add it wherever a v10 `WebsiteSDKConfig` is constructed, and set `VOFFICE_SEARCH_ENDPOINT` for environment/CLI usage. See `versions/2.5.0/MIGRATION.md`.
|
|
39
|
+
- To keep custom-attribute search filters and highlights working on v10, provide `customAttributeDefinitionManifest`.
|
|
40
|
+
- v10 consumers that render `property.location`, `property.images`, or `property.address` from search results must hydrate them from `sdk.static.rentals.getRentals(...)` instead.
|
|
41
|
+
- Existing consumers do not need to add sorting because `sort` is optional. See `versions/2.5.0/MIGRATION.md` before adopting backend-specific sorting.
|
|
42
|
+
- Static rental consumers require no code changes, but custom v10 access tokens must permit both `rentals_listRental` and `rentals_listRentalImage`.
|
|
43
|
+
- v9 config and options are unchanged.
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# Migration: 2.4.3 to 2.5.0
|
|
2
|
+
|
|
3
|
+
This guide covers upgrading `@v-office/website-sdk` from 2.4.3 to 2.5.0.
|
|
4
|
+
|
|
5
|
+
2.5.0 keeps `createWebsiteSDK({ config, options })`, the flat `WebsiteSDKConfig`, and existing SDK calls. v10 search now runs against the dedicated REST search backend, which requires one new config field and, for custom-attribute search, one new option. Search input also gains optional sorting, and static v10 rental loading uses the full Rental APIs internally. Existing calls and output types remain compatible.
|
|
6
|
+
|
|
7
|
+
## Required: v10 searchEndpoint
|
|
8
|
+
|
|
9
|
+
v10 config now requires `searchEndpoint`, the full REST search URL including the `/search` path:
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
const sdk = createWebsiteSDK({
|
|
13
|
+
config: {
|
|
14
|
+
backend: "v10",
|
|
15
|
+
apiEndpoint: "https://api.example.com/graphql",
|
|
16
|
+
searchEndpoint: "https://search.example.com/search",
|
|
17
|
+
accessToken: "...",
|
|
18
|
+
imageBaseUrl: "https://images.example.com",
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Provide the same value wherever v10 config is built:
|
|
24
|
+
|
|
25
|
+
- CLI config files add a `searchEndpoint` string field.
|
|
26
|
+
- Environment-based CLI usage reads `VOFFICE_SEARCH_ENDPOINT`.
|
|
27
|
+
|
|
28
|
+
`apiEndpoint` is still required: v10 rentals, filters, quote, availability, booking, and contact continue to use GraphQL. `searchEndpoint` is a separate host and should be configured explicitly rather than derived from `apiEndpoint`.
|
|
29
|
+
|
|
30
|
+
## Static Rental Loading (v10)
|
|
31
|
+
|
|
32
|
+
`sdk.static.rentals.getRentals(...)` keeps the same input, output, rental ordering, image ordering, and localization behavior. Internally, 2.5.0:
|
|
33
|
+
|
|
34
|
+
- Loads rentals from `rentals_listRental` instead of `rentals_listRentalSummary`.
|
|
35
|
+
- Batch-loads uploaded rental images from `rentals_listRentalImage`.
|
|
36
|
+
- Derives room counts and occupancy summaries from rooms and beds.
|
|
37
|
+
- Uses validated serial keyset pagination for rentals and images instead of offset pagination.
|
|
38
|
+
|
|
39
|
+
Most consumers require no changes. If your v10 access token uses a custom role or restricted operation allowlist, grant access to both `rentals_listRental` and `rentals_listRentalImage`. A token that can only call `rentals_listRentalSummary` will no longer be sufficient for `getRentals`.
|
|
40
|
+
|
|
41
|
+
## Custom Attribute Manifest
|
|
42
|
+
|
|
43
|
+
The REST search backend filters and returns custom attributes by definition ID, while SDK configuration and query strings use keys. Because definition IDs are workspace/environment specific, the SDK no longer looks them up at search time. To use searchable custom-attribute filters or to surface custom-attribute highlights on v10 search results, provide a `customAttributeDefinitionManifest` that maps keys to IDs:
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
const options = defineWebsiteSDKOptions({
|
|
47
|
+
customAttributeDefinitionManifest: {
|
|
48
|
+
byKey: {
|
|
49
|
+
region: { id: "def-1", key: "region", type: "OPTION", visibility: "PUBLIC" },
|
|
50
|
+
},
|
|
51
|
+
byId: {
|
|
52
|
+
"def-1": { id: "def-1", key: "region", type: "OPTION", visibility: "PUBLIC" },
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Generate the manifest at build time from your definitions source, and pass a separate manifest per workspace/environment because IDs are not portable. Without a manifest:
|
|
59
|
+
|
|
60
|
+
- Custom-attribute query keys are left in `unusedFilterKeys` rather than applied.
|
|
61
|
+
- Custom-attribute highlights are not added to search items.
|
|
62
|
+
- All other search behavior (period, occupancy, catalog filters, voucher, pagination) is unchanged.
|
|
63
|
+
|
|
64
|
+
Definitions with `visibility` of `PUBLIC` (or `null`) are surfaced as highlights; others are ignored.
|
|
65
|
+
|
|
66
|
+
## Optional Search Sorting
|
|
67
|
+
|
|
68
|
+
`SearchSearchInput` now accepts an optional discriminated sort:
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
type SearchSearchSort =
|
|
72
|
+
| { by: "price"; direction: "ASC" | "DESC" }
|
|
73
|
+
| { by: "random" }
|
|
74
|
+
| { by: "rating" }
|
|
75
|
+
| { by: "field"; orderBy: SearchSearchFieldOrderBy };
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Existing searches require no change. When adopting sorting:
|
|
79
|
+
|
|
80
|
+
- Price, random, and rating inputs are source-compatible between v9 and v10.
|
|
81
|
+
- v9 price sorting maps to `price_asc`/`price_desc`; random and rating are forwarded to the v9 backend.
|
|
82
|
+
- v10 price sorting maps to `totalOrderBy`. It requires a fixed-period or flexible-date pricing query with occupancy and fails validation before transport when either is missing.
|
|
83
|
+
- v10 random and rating currently select the default backend order.
|
|
84
|
+
- The closed `field` contract maps supported name, room-summary, square-meter, and distance fields to v10 `rentalSummaryOrderBy`; it is excluded from `V9SearchSearchSort`.
|
|
85
|
+
- v9 may retain promoted results before the requested order. v10 price results are ordered by backend boost first and total second.
|
|
86
|
+
|
|
87
|
+
Examples:
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
await sdk.live.search.search({
|
|
91
|
+
locale: "de-DE",
|
|
92
|
+
query: "start=01-08-2026&end=08-08-2026&adults=2",
|
|
93
|
+
sort: { by: "price", direction: "ASC" },
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
await sdk.live.search.search({
|
|
97
|
+
locale: "de-DE",
|
|
98
|
+
query: "adults=2",
|
|
99
|
+
sort: { by: "field", orderBy: { label: "ASC" } }, // v10 only
|
|
100
|
+
});
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The CLI accepts the same schema as JSON:
|
|
104
|
+
|
|
105
|
+
```sh
|
|
106
|
+
website-sdk --backend v10 search --locale de-DE --query "start=01-08-2026&end=08-08-2026&adults=2" --sort '{"by":"price","direction":"ASC"}'
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
See `../../search.md` for all variants, supported field-order examples, backend behavior, and CLI usage.
|
|
110
|
+
|
|
111
|
+
## Search Result Changes (v10)
|
|
112
|
+
|
|
113
|
+
The public output type is unchanged, but v10 search cards now reflect the REST projection:
|
|
114
|
+
|
|
115
|
+
- At most five images per item; search images no longer include `category`.
|
|
116
|
+
- `property` is the minimal `{ id, nameOrLabel }` shape. Hydrate `property.location`, `property.images`, or `property.address` from `sdk.static.rentals.getRentals(...)` when a search card needs them.
|
|
117
|
+
- Exact-period matches are returned in `items` with `formattedTotal`; nearby suggestions are returned in root-level `alternatives`, unchanged.
|
|
118
|
+
|
|
119
|
+
## Backend Behavior
|
|
120
|
+
|
|
121
|
+
- Fixed-period and flexible searches are priced by the REST backend; occupancy is required for priced searches.
|
|
122
|
+
- Pagination uses `from`/`size` with the existing opaque `cursor`; a cursor is never advertised beyond the 1,000-result window.
|
|
123
|
+
- Requests remain rate-limited to one backend request per second with a queue size of five.
|
|
124
|
+
- Existing v9 search calls remain compatible; sorting is the only added v9 search capability.
|
|
125
|
+
|
|
126
|
+
## Recommended Steps
|
|
127
|
+
|
|
128
|
+
1. Upgrade to `@v-office/website-sdk` 2.5.0.
|
|
129
|
+
2. Add `searchEndpoint` to every v10 `WebsiteSDKConfig` and set `VOFFICE_SEARCH_ENDPOINT` for environment/CLI runs.
|
|
130
|
+
3. If you use custom-attribute search filters or highlights, generate and pass `customAttributeDefinitionManifest`.
|
|
131
|
+
4. Update any search-card UI that reads `property.location`, `property.images`, or `property.address` to hydrate from rentals.
|
|
132
|
+
5. Cap rendered search images at five and stop relying on image `category` for v10 search cards.
|
|
133
|
+
6. If adopting sorting, use only shared variants for code that can run against v9, and keep field ordering in v10-narrowed code.
|
|
134
|
+
7. Confirm the v10 access token permits `rentals_listRental` and `rentals_listRentalImage`, then smoke-test `sdk.static.rentals.getRentals`.
|
|
135
|
+
8. Smoke-test unpriced, fixed-period, and flexible v10 searches, including pagination and any requested ordering.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-office/website-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"description": "Website-facing SDK facade backed by @v-office/sdk-core",
|
|
5
5
|
"bin": {
|
|
6
6
|
"website-sdk": "./dist/cli.mjs"
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@graphql-typed-document-node/core": "3.2.0",
|
|
44
|
-
"@v-office/sdk-core": "^1.
|
|
44
|
+
"@v-office/sdk-core": "^1.6.0",
|
|
45
45
|
"effect": "4.0.0-beta.85",
|
|
46
46
|
"graphql": "16.14.2",
|
|
47
47
|
"yaml": "^2.9.0"
|