@v-office/website-sdk 2.28.1 → 2.29.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 +8 -0
- package/dist/cli.mjs +420 -12
- package/dist/{client-EtS0Qm3i.mjs → client-B8cF8Ra1.mjs} +285 -45
- package/dist/index.d.mts +36 -4
- package/dist/index.mjs +1 -1
- package/dist/instructions/CHANGELOG.md +1 -0
- package/dist/instructions/MIGRATION.md +1 -0
- package/dist/instructions/README.md +3 -2
- package/dist/instructions/creation.md +35 -4
- package/dist/instructions/custom-attributes.md +2 -2
- package/dist/instructions/filter.md +5 -3
- package/dist/instructions/quote.md +1 -1
- package/dist/instructions/rentals.md +36 -0
- package/dist/instructions/search.md +214 -6
- package/dist/instructions/versions/2.29.0/CHANGELOG.md +62 -0
- package/dist/instructions/versions/2.29.0/MIGRATION.md +97 -0
- package/dist/{v9-data-C3SWtDGs.mjs → operations-CfjJjdrw.mjs} +3122 -1
- package/dist/{rentals-B4g91vwW.mjs → rentals-DvYUm25t.mjs} +4 -5
- package/dist/{search-B-lvOmXL.mjs → search-BkrzAC9w.mjs} +6 -5
- package/dist/{to-rental-highlights-BL5m3Uen.mjs → to-rental-highlights-D7oepO6s.mjs} +1 -1
- package/dist/translations/v9/de-DE/core.json +8 -1
- package/dist/translations/v9/en-US/core.json +8 -1
- package/instructions/CHANGELOG.md +1 -0
- package/instructions/MIGRATION.md +1 -0
- package/instructions/README.md +3 -2
- package/instructions/creation.md +35 -4
- package/instructions/custom-attributes.md +2 -2
- package/instructions/filter.md +5 -3
- package/instructions/quote.md +1 -1
- package/instructions/rentals.md +36 -0
- package/instructions/search.md +214 -6
- package/instructions/versions/2.29.0/CHANGELOG.md +62 -0
- package/instructions/versions/2.29.0/MIGRATION.md +97 -0
- package/instructions/versions/2.29.0/release.json +3 -0
- package/package.json +5 -3
- package/dist/operations-DwURbo0b.mjs +0 -2850
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Migration: 2.28.1 to 2.29.0
|
|
2
|
+
|
|
3
|
+
## 1. Upgrade
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pnpm add @v-office/website-sdk@2.29.0
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
v10 sites need no changes. A v9 site without a rental scope needs none either, unless it hits
|
|
10
|
+
step 3. A v9 site with a rental scope must do step 2 before its next build.
|
|
11
|
+
|
|
12
|
+
## 2. v9 with a rental scope: add the Hub entry
|
|
13
|
+
|
|
14
|
+
The search now sends the scope to the be-on! Hub as a filter, so the Hub needs an entry for it:
|
|
15
|
+
`facility_scope` for a facility scope, `objectGroup_scope` for an object group scope. Until the
|
|
16
|
+
entry exists, `getRentals` fails the build and names the missing key. The check protects the
|
|
17
|
+
site: without the entry, the search would not respect the scope.
|
|
18
|
+
|
|
19
|
+
1. Put the `rentalScope` into an options file. If you set `rentalScopePropertyKind`, pass
|
|
20
|
+
it to the CLI too: in a `--config` file, or as `HUB_RENTAL_SCOPE_PROPERTY_KIND` next to the
|
|
21
|
+
other `HUB_*` variables.
|
|
22
|
+
2. Write the request:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
website-sdk --backend v9 --config ./website-sdk-config.json --options ./website-sdk-options.json hub-filters request
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
3. Hand the written `hub-filter-request.md` to a be-on! developer.
|
|
29
|
+
4. After they saved the entries, confirm them. The command exits non-zero while one is missing:
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
website-sdk --backend v9 --config ./website-sdk-config.json --options ./website-sdk-options.json hub-filters check
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
A site with a facility scope that also sets `facilityObjectGroupRelationAttributeId` fails the
|
|
36
|
+
build: its listings would use the facilities derived from object groups, its search the facility
|
|
37
|
+
stored on each rental. If the facilities are maintained on the rentals in vOffice, remove
|
|
38
|
+
`facilityObjectGroupRelationAttributeId`. Otherwise set `rentalScopePropertyKind: "objectGroup"`,
|
|
39
|
+
put the object group ID into `rentalScope.propertyId`, and request `objectGroup_scope` instead of
|
|
40
|
+
`facility_scope`.
|
|
41
|
+
|
|
42
|
+
## 3. Check your configuration
|
|
43
|
+
|
|
44
|
+
The SDK now refuses to start in two cases that 2.28.1 accepted:
|
|
45
|
+
|
|
46
|
+
- `rentalScope.propertyId` must be a positive decimal integer up to 2147483647, such as
|
|
47
|
+
`"20748"`. Values like `"1e2"`, `"0x10"`, `"-5"`, `"0"` or `"7.0"` used to be read as numbers;
|
|
48
|
+
write the plain ID instead.
|
|
49
|
+
- A `backendFilter` in `customAttributeFilterDefinitions` cannot use the key `voffice_id`,
|
|
50
|
+
`facility_scope` or `objectGroup_scope`. If the definition is yours, rename it. A renamed
|
|
51
|
+
key needs its own Hub entry to filter anything.
|
|
52
|
+
|
|
53
|
+
## 4. Optional: filters by object group, facility or special offer
|
|
54
|
+
|
|
55
|
+
Ask for the Hub entries, then add the printed definitions to `customAttributeFilterDefinitions`:
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
website-sdk --backend v9 --config ./website-sdk-config.json hub-filters request --object-group --offers
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Without a Hub entry a filter does nothing: alone and without a period it returns no rentals,
|
|
62
|
+
with a period it returns every available rental, and next to another filter it is ignored. See
|
|
63
|
+
`search.md`, "v9: Hub Filters", for the keys and their values.
|
|
64
|
+
|
|
65
|
+
## 5. Optional: a favourites page
|
|
66
|
+
|
|
67
|
+
Load the saved rentals directly. No Hub entry is needed:
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
if (sdk.backend === "v9") {
|
|
71
|
+
const rentalIds: string[] = JSON.parse(localStorage.getItem("favoredRentalIDs") ?? "[]");
|
|
72
|
+
const rentals = await sdk.live.rentals.getRentalsByIds({ locale: "de-DE", rentalIds });
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
To also combine favourites with the search filters, set `rentalIdsSearch: true` in the v9 config,
|
|
77
|
+
request the entry with `hub-filters request --unit`, and pass `rentalIdsIn` to the search. Do not
|
|
78
|
+
search with an empty favourites list: an empty `rentalIdsIn` returns all results. The site AI
|
|
79
|
+
should offer this to the user once and ask whether they want it. See `search.md`.
|
|
80
|
+
|
|
81
|
+
## 6. Optional: vouchers
|
|
82
|
+
|
|
83
|
+
`voucher` now prices a v9 search. To tell a visitor whether a code is usable before the quote:
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
if (sdk.backend === "v9") {
|
|
87
|
+
const { valid, label } = await sdk.live.voucher.validate({
|
|
88
|
+
locale: "de-DE",
|
|
89
|
+
code: "SUMMER26",
|
|
90
|
+
start: "01-08-2026",
|
|
91
|
+
end: "08-08-2026",
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Check when the visitor submits the code. The Hub limits checks to 10 per minute and 60 per hour;
|
|
97
|
+
on `rate_limited`, show the label and do not retry right away.
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-office/website-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.29.0",
|
|
4
4
|
"description": "Website-facing SDK facade backed by @v-office/sdk-core",
|
|
5
|
+
"license": "UNLICENSED",
|
|
5
6
|
"bin": {
|
|
6
7
|
"website-sdk": "./dist/cli.mjs"
|
|
7
8
|
},
|
|
@@ -81,13 +82,14 @@
|
|
|
81
82
|
"fmt": "oxfmt",
|
|
82
83
|
"fmt:check": "oxfmt --check",
|
|
83
84
|
"check": "pnpm run typecheck && pnpm run lint && pnpm run fmt:check",
|
|
84
|
-
"test": "pnpm run test:v9:openapi && pnpm run test:v9:properties && pnpm run test:v9:rentals && pnpm run test:v9:graphql && pnpm run test:v9:availability && pnpm run test:v9:search && pnpm run test:v9:booking && pnpm run build && node --test test/*.test.mjs",
|
|
85
|
+
"test": "pnpm run test:cli && pnpm run test:v9:openapi && pnpm run test:v9:properties && pnpm run test:v9:rentals && pnpm run test:v9:graphql && pnpm run test:v9:availability && pnpm run test:v9:search && pnpm run test:v9:booking && pnpm run build && node --test test/*.test.mjs",
|
|
86
|
+
"test:cli": "node --test src/cli/v9-hub-filters.test.ts",
|
|
85
87
|
"test:v9:openapi": "node --test codegen/v9/php-record.test.ts src/legacy-v9/openapi/setup-response.test.ts src/legacy-v9/openapi/quote-response.test.ts",
|
|
86
88
|
"test:v9:properties": "node --test codegen/v9/heuristic-generation/generate/property.test.ts src/legacy-v9/property-highlight-sources.test.ts src/legacy-v9/parser/rentals/render-property-attribute.test.ts src/legacy-v9/parser/rentals/to-property.test.ts src/legacy-v9/parser/rentals/to-rooms.test.ts",
|
|
87
89
|
"test:v9:rentals": "node --test src/legacy-v9/static/associate-rentals-with-facilities-by-object-groups.test.ts src/legacy-v9/parser/rentals/to-reviews.test.ts",
|
|
88
90
|
"test:v9:graphql": "node --test src/legacy-v9/graphql/client.test.ts",
|
|
89
91
|
"test:v9:availability": "node --test src/legacy-v9/parser/availability/to-availability-restrictions-by-date.test.ts src/legacy-v9/parser/availability/to-initial-availability-calendar-days.test.ts src/legacy-v9/parser/availability/to-occupancy-limits.test.ts",
|
|
90
|
-
"test:v9:search": "node --test src/legacy-v9/parser/search/resolve-exact-match.test.ts",
|
|
92
|
+
"test:v9:search": "node --test src/legacy-v9/parser/search/resolve-exact-match.test.ts src/legacy-v9/rental-scope.test.ts",
|
|
91
93
|
"test:v9:booking": "node --test src/legacy-v9/parser/booking/output/to-payment-schedules.test.ts",
|
|
92
94
|
"playground:custom-attributes": "pnpm run build && node --env-file=.env playground/custom-attributes.ts"
|
|
93
95
|
}
|