@v-office/website-sdk 3.2.1 → 3.4.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.
Files changed (29) hide show
  1. package/dist/cli.mjs +3 -3
  2. package/dist/{client-F2V6hCg6.mjs → client-BEL6ow0i.mjs} +122 -119
  3. package/dist/index.d.mts +214 -166
  4. package/dist/index.mjs +2 -2
  5. package/dist/instructions/CHANGELOG.md +2 -0
  6. package/dist/instructions/MIGRATION.md +2 -0
  7. package/dist/instructions/quote.md +2 -2
  8. package/dist/instructions/rentals.md +82 -1
  9. package/dist/instructions/search.md +2 -1
  10. package/dist/instructions/versions/3.3.0/CHANGELOG.md +22 -0
  11. package/dist/instructions/versions/3.3.0/MIGRATION.md +22 -0
  12. package/dist/instructions/versions/3.4.0/CHANGELOG.md +39 -0
  13. package/dist/instructions/versions/3.4.0/MIGRATION.md +44 -0
  14. package/dist/{operations-Bc3WxjV8.mjs → operations-DY2e_2Hd.mjs} +235 -13
  15. package/dist/{rentals-DfDeL0Qk.mjs → rentals-DVMCyGI9.mjs} +65 -4
  16. package/dist/{search-_gISebZ1.mjs → search-6EvRB-i0.mjs} +3 -3
  17. package/dist/{to-rental-highlights-9AbqVIso.mjs → to-rental-highlights-DptWc7-q.mjs} +1 -1
  18. package/instructions/CHANGELOG.md +2 -0
  19. package/instructions/MIGRATION.md +2 -0
  20. package/instructions/quote.md +2 -2
  21. package/instructions/rentals.md +82 -1
  22. package/instructions/search.md +2 -1
  23. package/instructions/versions/3.3.0/CHANGELOG.md +22 -0
  24. package/instructions/versions/3.3.0/MIGRATION.md +22 -0
  25. package/instructions/versions/3.3.0/release.json +3 -0
  26. package/instructions/versions/3.4.0/CHANGELOG.md +39 -0
  27. package/instructions/versions/3.4.0/MIGRATION.md +44 -0
  28. package/instructions/versions/3.4.0/release.json +3 -0
  29. package/package.json +3 -3
@@ -0,0 +1,22 @@
1
+ # Migration: 3.2.1 to 3.3.0
2
+
3
+ No changes required.
4
+
5
+ ## 1. Upgrade
6
+
7
+ ```sh
8
+ pnpm add @v-office/website-sdk@3.3.0
9
+ ```
10
+
11
+ ## 2. Optional: drop the Matterport filter on v9
12
+
13
+ A v9 site that removes the item "Matterport ID: …" or the fact with the key `matterport` from
14
+ its amenity list can drop that filter: `attributes` no longer contains either. Nothing else in
15
+ `attributes` changes.
16
+
17
+ ## 3. Optional: show the 3D tour
18
+
19
+ Read the tour from `links` (`type === "THREE_D"`) and show it as described in `rentals.md`,
20
+ "Links and 3D tours": a "3D-Rundgang" button on the rental page that opens a modal with the
21
+ Matterport iframe. When a rental has no tour, the agency maintains it in the PMS: on v10 as a
22
+ link of type "3D-Tour", on v9 as the unit's feature "Matterport ID".
@@ -0,0 +1,3 @@
1
+ {
2
+ "componentsAffectedByHeadlessChange": []
3
+ }
@@ -0,0 +1,39 @@
1
+ # Changelog: 3.4.0
2
+
3
+ ERGO insurance on v9 works again. The be-on! Hub now gives ERGO policies only to a guest who
4
+ proves the booking, and it refused every ERGO call of 3.3.0 and earlier, from the pre-contract
5
+ on. The SDK now sends the booking's guest token, reservation number and booking ID with every
6
+ ERGO call. A v9 site can also show a rental's special offers without a period: an "Angebot"
7
+ badge on the rental page, an offers overview or a campaign page.
8
+
9
+ ## Added
10
+
11
+ - v9: `offers` on every item of `sdk.static.rentals.getRentals` and
12
+ `sdk.live.rentals.getRentalsByIds`, `[]` when the rental has none. Each offer has `id` (the
13
+ vOffice offer ID, the value the `offer` search filter takes), `name`, `discount` (`percent`,
14
+ `amount` or `stayPay`), and when vOffice states them `minNights`, `arrivalWithinDays`,
15
+ `validFrom` and `validUntil`. Offers that vOffice does not show to websites and offers redeemed
16
+ with a voucher code are left out.
17
+ - Types `V9RentalOffer`, `V9RentalOfferDiscount`, `V9RentalGetRentalsOutput` and
18
+ `V9RentalGetRentalsOutputItem`.
19
+ - `rentals.md` ("Legacy v9 Special Offers"): the offer fields, the empty case, and what a page
20
+ must not conclude from them.
21
+
22
+ ## Changed
23
+
24
+ - `live.insurance.readPolicy` takes the booking: `readPolicy({ policyNumber, booking })`, the same
25
+ input as `revokePolicy`. It returns the booking's active policy and rejects when the booking has
26
+ no active policy or holds a different one. A revoked policy can no longer be read.
27
+ - `revokePolicy` checks that the booking's active policy has the given number before it asks ERGO
28
+ to revoke it. When it has another number or there is none, it rejects and nothing is revoked.
29
+ - ERGO errors from the Hub (booking not confirmed, no active policy, a policy already active,
30
+ vOffice unreachable) reject with the Hub's message.
31
+ - v9: `KnownVofficeOfferData` (`VofficeOfferDataFieldSchemas`) declares the fields the be-on! Hub
32
+ returns: `name`, `description`, `type`, `discountType`, `value`, `minStay`, `timeSpan`,
33
+ `voucherCode`, `fromdate`, `tilldate` and `visible4interfaces`. `discount` is gone; the Hub
34
+ never returned it. `description` is nullable.
35
+
36
+ ## Fixed
37
+
38
+ - v9 ERGO: `createInsurancePreContract`, `bookInsurance`, `readPolicy` and `revokePolicy` were
39
+ refused by the Hub (HTTP 422).
@@ -0,0 +1,44 @@
1
+ # Migration: 3.3.0 to 3.4.0
2
+
3
+ Only a v9 site that calls `live.insurance.readPolicy` has to change. Everything else works without
4
+ changes.
5
+
6
+ ## 1. Upgrade
7
+
8
+ ```sh
9
+ pnpm add @v-office/website-sdk@3.4.0
10
+ ```
11
+
12
+ ## 2. Pass the booking to `readPolicy`
13
+
14
+ ```ts
15
+ // Before
16
+ const policy = await sdk.live.insurance.readPolicy({ policyNumber });
17
+
18
+ // After
19
+ const policy = await sdk.live.insurance.readPolicy({ policyNumber, booking });
20
+ ```
21
+
22
+ `booking` is the result of `live.booking.book`, as for `revokePolicy`. `readPolicy` now returns
23
+ only the booking's active policy; after `revokePolicy` it rejects instead of returning the revoked
24
+ policy, so keep the policy that `revokePolicy` returned when the page needs to show it.
25
+
26
+ ## 3. Optional: show special offers on v9
27
+
28
+ Read a rental's `offers` and show them as described in `rentals.md`, "Legacy v9 Special Offers".
29
+ Hide the offer UI when `offers` is empty, which is the normal case.
30
+
31
+ A site that queried the be-on! Hub directly for offers (GraphQL `voffice_offers` or v1
32
+ `/Units/{id}/offers`) can switch to `offers`. The SDK already leaves out offers with a voucher
33
+ code, so the page cannot leak one.
34
+
35
+ ## 4. Only if you used `defineVofficeOfferDataAttributes`
36
+
37
+ The known attribute `discount` is gone. Use `discountType` and `value`, or read `offers`.
38
+
39
+ ## What stays the same
40
+
41
+ - v10: nothing changes.
42
+ - v9 with URV insurance: nothing changes.
43
+ - `createInsurancePreContract`, `selectInsurancePayment`, `bookInsurance` and `revokePolicy` keep
44
+ their inputs and outputs.
@@ -0,0 +1,3 @@
1
+ {
2
+ "componentsAffectedByHeadlessChange": []
3
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v-office/website-sdk",
3
- "version": "3.2.1",
3
+ "version": "3.4.0",
4
4
  "description": "Website-facing SDK facade backed by @v-office/sdk-core",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@graphql-typed-document-node/core": "3.2.0",
51
- "@v-office/sdk-core": "1.31.1",
51
+ "@v-office/sdk-core": "1.32.0",
52
52
  "effect": "4.0.0-rc.115",
53
53
  "graphql": "17.0.2",
54
54
  "yaml": "^2.9.0"
@@ -91,7 +91,7 @@
91
91
  "test:cli": "node --test src/cli/v9-hub-filters.test.ts",
92
92
  "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",
93
93
  "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 src/legacy-v9/parser/rentals/to-capacity.test.ts",
94
- "test:v9:rentals": "node --test src/legacy-v9/static/description-fallbacks.test.ts src/legacy-v9/static/associate-rentals-with-facilities-by-object-groups.test.ts src/legacy-v9/parser/rentals/to-reviews.test.ts src/legacy-v9/parser/rentals/to-image.test.ts",
94
+ "test:v9:rentals": "node --test src/legacy-v9/static/description-fallbacks.test.ts src/legacy-v9/static/associate-rentals-with-facilities-by-object-groups.test.ts src/legacy-v9/parser/rentals/to-reviews.test.ts src/legacy-v9/parser/rentals/to-image.test.ts src/legacy-v9/parser/rentals/to-links.test.ts src/legacy-v9/parser/rentals/to-rental-offers.test.ts",
95
95
  "test:v9:graphql": "node --test src/legacy-v9/graphql/client.test.ts",
96
96
  "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 src/legacy-v9/parser/availability/to-rent-night-prices.test.ts src/legacy-v9/parser/availability/to-start-date-selected-calendar-days.test.ts src/legacy-v9/parser/blocked-ranges/collect-v9-blocked-ranges.test.ts src/legacy-v9/parser/blocked-ranges/to-rental-blocked-ranges.test.ts",
97
97
  "test:v9:search": "node --test src/legacy-v9/parser/search/resolve-exact-match.test.ts src/legacy-v9/rental-scope.test.ts",