@v-office/website-sdk 2.3.0 → 2.3.2

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 CHANGED
@@ -15,7 +15,7 @@ var CLICheckFailed = class extends Error {
15
15
  const toCLIError = (message, cause) => cause instanceof Error ? new CLICheckFailed(`${message}: ${cause.message}`, { cause }) : new CLICheckFailed(message, { cause });
16
16
  //#endregion
17
17
  //#region package.json
18
- var version = "2.3.0";
18
+ var version = "2.3.2";
19
19
  //#endregion
20
20
  //#region src/cli/output.ts
21
21
  const toJson = (value) => Effect.try({
@@ -4,6 +4,7 @@ This file is the versioned changelog index for the website SDK instructions.
4
4
 
5
5
  ## Versions
6
6
 
7
+ - `versions/2.3.0/CHANGELOG.md`: `@v-office/website-sdk` 2.3.0 release notes.
7
8
  - `versions/2.1.0/CHANGELOG.md`: `@v-office/website-sdk` 2.1.0 release notes.
8
9
  - `versions/2.0.0/CHANGELOG.md`: `@v-office/website-sdk` 2.0.0 release notes.
9
10
 
@@ -0,0 +1,52 @@
1
+ # Changelog: 2.3.0
2
+
3
+ Release date: 2026-07-13
4
+
5
+ This release improves validation, search, rentals, quote handling, booking reliability, and CLI behavior across the v9 and v10 website SDK backends.
6
+
7
+ ## Added
8
+
9
+ - Added v10 rental reviews to the existing optional `RentalGetRentalsOutput` `reviews` shape, including review items, aggregate ratings, classifications, and category ratings.
10
+ - Added v9 quote support for forwarding `occupancy.childrenAges` to the backend.
11
+ - Added explicit `UnavailableAdditionalService` and `UnavailableCancellationPolicy` quote selection outcomes.
12
+ - Added runtime validation for quote dates, period ordering, destination country codes, and other `QuoteQuoteInput` fields.
13
+
14
+ ## Changed
15
+
16
+ - `@v-office/sdk-core` was upgraded to 1.4.0.
17
+ - v9 `rentalScope.propertyId` is now validated when `createWebsiteSDK` is called and must be an integer vOffice property ID when provided.
18
+ - Contact validation now requires `address.countryCode`, validates it as a two-letter uppercase country code, and limits email addresses to 255 characters.
19
+ - v9 search accepts `pets` and `petsCount` as Boolean-style flags or non-negative integers; positive values for both remain invalid.
20
+ - `childrenAges` determines the v9 search child count when `children` is absent and is reported in `unusedFilterKeys` because v9 search cannot apply the ages themselves.
21
+ - Quote selection now keeps an available cancellation policy selected by default and prevents newly selecting unavailable services or policies.
22
+ - The CLI now validates config-file values, rejects blank required environment variables, reports concise expected failures, derives `--version` from the package version, and disposes its SDK after each command.
23
+ - The CLI booking command now quotes and books with the same SDK instance.
24
+ - Package publishing is configured for restricted access.
25
+
26
+ ## Fixed
27
+
28
+ - Fixed v9 and v10 availability calculation dates so they do not start before today.
29
+ - Fixed v9 rental images when rentals only contain room images or heuristic image metadata.
30
+ - Fixed v9 quote section classification so included and other lines are mutually exclusive and `ADD_NO_SHOW` lines remain included.
31
+ - Fixed v9 quote throttling so the rate limiter is shared by calls made through one SDK instance.
32
+ - Fixed v9 travel-insurance language parameters to use backend language codes.
33
+ - Fixed v9 OpenAPI response handling for JSON content types with parameters and bounded large HTML/text error bodies.
34
+ - Fixed v10 search pagination to request enough backend rows, report `hasNextPage` correctly, and reject pagination beyond 1,000 results.
35
+ - Fixed v10 integer filters so partially numeric values such as `2abc` are not accepted, and allowed `pets=false` and `pets=0`.
36
+ - Fixed fallback filter categories so missing categories use the localized `OTHER` label.
37
+ - Fixed v10 multi-rate resolution, no-multi-rate cancellation policies, unavailable option handling, and quote section grouping.
38
+ - Fixed v10 booking so invalid backend booking responses fail instead of returning an empty booking number.
39
+ - Fixed contact email validation for valid local parts and repeated-dot rejection.
40
+ - Fixed currency formatting for currencies whose standard fraction digits are not two.
41
+ - Fixed payment form submission to preserve the native form receiver and fail explicitly when form submission or an option kind is unsupported.
42
+ - Added a 30-second timeout and clearer HTTP failure details for GraphQL requests.
43
+
44
+ ## Migration Impact
45
+
46
+ - No SDK construction or flat config-shape migration is required from 2.1.0.
47
+ - Validate v9 `rentalScope.propertyId` values before creating the SDK.
48
+ - Ensure contact forms always submit `address.countryCode` and surface the updated validation issues.
49
+ - Ensure quote inputs contain real `YYYY-MM-DD` dates, an end date after the start date, and uppercase destination country codes.
50
+ - Add quote selection handling for `UnavailableAdditionalService` and `UnavailableCancellationPolicy`.
51
+ - Treat rental `reviews` as optional and render them when present.
52
+ - Review CLI config files for missing or blank required values.
@@ -0,0 +1,135 @@
1
+ # Migration: 2.1.0 to 2.3.0
2
+
3
+ This guide covers upgrading `@v-office/website-sdk` from 2.1.0 to 2.3.0.
4
+
5
+ 2.3.0 keeps `createWebsiteSDK({ config, options })`, the flat `WebsiteSDKConfig`, and separate `WebsiteSDKOptions`. Most changes are validation and reliability improvements.
6
+
7
+ ## What To Review
8
+
9
+ ### v9 Rental Scope
10
+
11
+ For v9, `options.rentalScope.propertyId` must be an integer vOffice property ID when provided:
12
+
13
+ ```ts
14
+ const sdk = createWebsiteSDK({
15
+ config,
16
+ options: defineWebsiteSDKOptions({
17
+ rentalScope: {
18
+ propertyId: "123",
19
+ },
20
+ }),
21
+ });
22
+ ```
23
+
24
+ Blank or non-numeric values now cause SDK creation to fail with a `CoreSDKError` using `operation: "v9.config"`. Previously, invalid values could silently disable the scope.
25
+
26
+ Migration: validate stored property IDs before passing them to `createWebsiteSDK`. Omit `propertyId` when no v9 property scope is required.
27
+
28
+ ### Contact
29
+
30
+ `address.countryCode` is now required by contact validation. It must be a two-letter uppercase country code such as `DE`. Email addresses are limited to 255 characters.
31
+
32
+ Migration: ensure every contact form supplies `address.countryCode` and continues to display field-level issues from `CoreSDKError.cause.issues`.
33
+
34
+ ### Quote Input
35
+
36
+ Quote inputs now receive stricter runtime validation:
37
+
38
+ - `period.start` and `period.end` must be real calendar dates in `YYYY-MM-DD` format.
39
+ - `period.end` must be after `period.start`.
40
+ - `destinationCountryCode`, when provided, must be a two-letter uppercase country code.
41
+ - Occupancy counts must be non-negative integers.
42
+
43
+ v9 quotes now forward optional child ages:
44
+
45
+ ```ts
46
+ const result = await sdk.live.quote.quote({
47
+ locale: "de-DE",
48
+ rentalId: "123",
49
+ period: {
50
+ start: "2026-08-01",
51
+ end: "2026-08-08",
52
+ },
53
+ occupancy: {
54
+ adults: 2,
55
+ children: 2,
56
+ childrenAges: [4, 8],
57
+ babies: 0,
58
+ pets: 0,
59
+ },
60
+ destinationCountryCode: "DE",
61
+ });
62
+ ```
63
+
64
+ Migration: validate user-entered dates and country codes before requesting a quote.
65
+
66
+ ### Quote Selection
67
+
68
+ Unavailable additional services and cancellation policies can no longer be newly selected. Selection results can now contain:
69
+
70
+ - `UnavailableAdditionalService`
71
+ - `UnavailableCancellationPolicy`
72
+
73
+ Migration: handle these outcomes alongside the existing quote selection errors and disable options whose `available` field is `false`. Existing unavailable selections may remain on a quote, but their quantity cannot be increased.
74
+
75
+ When the backend does not configure multi-rates, v10 cancellation policies are now retained instead of making an otherwise valid quote unavailable. Multi-rate matching and default policy selection are also more deterministic.
76
+
77
+ ### Search
78
+
79
+ v9 search now accepts these pet forms:
80
+
81
+ ```text
82
+ pets
83
+ pets=true
84
+ pets=false
85
+ pets=2
86
+ petsCount=2
87
+ ```
88
+
89
+ Use either a positive `pets` value or a positive `petsCount` value, not both. Duplicate or invalid values fail validation.
90
+
91
+ For v9, `childrenAges` can determine the child count when `children` is absent, but the ages themselves cannot be sent to the search backend. The result therefore includes `"childrenAges"` in `unusedFilterKeys`.
92
+
93
+ v10 search now enforces a maximum pagination range of 1,000 results and reports `hasNextPage` using the complete requested range. Integer filters no longer accept partially numeric strings, and `pets=false` / `pets=0` are valid ways to disable the mapped pets filter.
94
+
95
+ ### Rentals and Availability
96
+
97
+ v10 `sdk.static.rentals.getRentals` can now populate the existing optional `reviews` property:
98
+
99
+ ```ts
100
+ for (const rental of await sdk.static.rentals.getRentals({ locale: "de-DE" })) {
101
+ if (rental.reviews !== undefined) {
102
+ console.log(rental.reviews.summary, rental.reviews.items);
103
+ }
104
+ }
105
+ ```
106
+
107
+ Keep review rendering optional because rentals without public feedback omit the field.
108
+
109
+ v9 rental output now preserves room images and heuristic image metadata even when `voffice_images` is empty. Availability output for both backends now clamps its first calculation date to today when backend data starts in the past.
110
+
111
+ ### CLI
112
+
113
+ CLI config files are now decoded and validated before SDK creation. Required URLs, keys, and tokens must be non-blank strings, and v9 `rentalDataAttributes` entries must also be non-blank strings. Required environment variables containing only whitespace are treated as missing.
114
+
115
+ Expected CLI failures now print concise messages. SDK creation and operations are wrapped consistently, SDK instances are disposed after commands, and `website-sdk --version` follows the installed package version.
116
+
117
+ Migration: run the CLI once with each config file used in deployment and fix any newly reported validation errors.
118
+
119
+ ### Payment Submission
120
+
121
+ `form_post` payment options now fail explicitly if the browser does not provide native form submission. Unknown runtime payment option kinds also fail with `CoreSDKError` instead of being ignored.
122
+
123
+ No API change is required. Keep payment submission error handling in place and only call it in a browser environment.
124
+
125
+ ## Recommended Steps
126
+
127
+ 1. Upgrade to `@v-office/website-sdk` 2.3.0.
128
+ 2. Validate v9 `rentalScope.propertyId` values.
129
+ 3. Require an uppercase `address.countryCode` in contact forms.
130
+ 4. Validate quote dates, period ordering, occupancy counts, and destination country codes.
131
+ 5. Handle unavailable quote selection outcomes and disable unavailable options.
132
+ 6. Render optional v10 rental reviews where desired.
133
+ 7. Review search handling for pet flags, `childrenAges`, strict integer filters, and the 1,000-result pagination limit.
134
+ 8. Validate CLI config files and environment variables.
135
+ 9. Run focused smoke tests for rentals, search, availability, quote selection, booking, contact, and payment submission.
@@ -4,6 +4,7 @@ This file is the versioned changelog index for the website SDK instructions.
4
4
 
5
5
  ## Versions
6
6
 
7
+ - `versions/2.3.0/CHANGELOG.md`: `@v-office/website-sdk` 2.3.0 release notes.
7
8
  - `versions/2.1.0/CHANGELOG.md`: `@v-office/website-sdk` 2.1.0 release notes.
8
9
  - `versions/2.0.0/CHANGELOG.md`: `@v-office/website-sdk` 2.0.0 release notes.
9
10
 
@@ -0,0 +1,52 @@
1
+ # Changelog: 2.3.0
2
+
3
+ Release date: 2026-07-13
4
+
5
+ This release improves validation, search, rentals, quote handling, booking reliability, and CLI behavior across the v9 and v10 website SDK backends.
6
+
7
+ ## Added
8
+
9
+ - Added v10 rental reviews to the existing optional `RentalGetRentalsOutput` `reviews` shape, including review items, aggregate ratings, classifications, and category ratings.
10
+ - Added v9 quote support for forwarding `occupancy.childrenAges` to the backend.
11
+ - Added explicit `UnavailableAdditionalService` and `UnavailableCancellationPolicy` quote selection outcomes.
12
+ - Added runtime validation for quote dates, period ordering, destination country codes, and other `QuoteQuoteInput` fields.
13
+
14
+ ## Changed
15
+
16
+ - `@v-office/sdk-core` was upgraded to 1.4.0.
17
+ - v9 `rentalScope.propertyId` is now validated when `createWebsiteSDK` is called and must be an integer vOffice property ID when provided.
18
+ - Contact validation now requires `address.countryCode`, validates it as a two-letter uppercase country code, and limits email addresses to 255 characters.
19
+ - v9 search accepts `pets` and `petsCount` as Boolean-style flags or non-negative integers; positive values for both remain invalid.
20
+ - `childrenAges` determines the v9 search child count when `children` is absent and is reported in `unusedFilterKeys` because v9 search cannot apply the ages themselves.
21
+ - Quote selection now keeps an available cancellation policy selected by default and prevents newly selecting unavailable services or policies.
22
+ - The CLI now validates config-file values, rejects blank required environment variables, reports concise expected failures, derives `--version` from the package version, and disposes its SDK after each command.
23
+ - The CLI booking command now quotes and books with the same SDK instance.
24
+ - Package publishing is configured for restricted access.
25
+
26
+ ## Fixed
27
+
28
+ - Fixed v9 and v10 availability calculation dates so they do not start before today.
29
+ - Fixed v9 rental images when rentals only contain room images or heuristic image metadata.
30
+ - Fixed v9 quote section classification so included and other lines are mutually exclusive and `ADD_NO_SHOW` lines remain included.
31
+ - Fixed v9 quote throttling so the rate limiter is shared by calls made through one SDK instance.
32
+ - Fixed v9 travel-insurance language parameters to use backend language codes.
33
+ - Fixed v9 OpenAPI response handling for JSON content types with parameters and bounded large HTML/text error bodies.
34
+ - Fixed v10 search pagination to request enough backend rows, report `hasNextPage` correctly, and reject pagination beyond 1,000 results.
35
+ - Fixed v10 integer filters so partially numeric values such as `2abc` are not accepted, and allowed `pets=false` and `pets=0`.
36
+ - Fixed fallback filter categories so missing categories use the localized `OTHER` label.
37
+ - Fixed v10 multi-rate resolution, no-multi-rate cancellation policies, unavailable option handling, and quote section grouping.
38
+ - Fixed v10 booking so invalid backend booking responses fail instead of returning an empty booking number.
39
+ - Fixed contact email validation for valid local parts and repeated-dot rejection.
40
+ - Fixed currency formatting for currencies whose standard fraction digits are not two.
41
+ - Fixed payment form submission to preserve the native form receiver and fail explicitly when form submission or an option kind is unsupported.
42
+ - Added a 30-second timeout and clearer HTTP failure details for GraphQL requests.
43
+
44
+ ## Migration Impact
45
+
46
+ - No SDK construction or flat config-shape migration is required from 2.1.0.
47
+ - Validate v9 `rentalScope.propertyId` values before creating the SDK.
48
+ - Ensure contact forms always submit `address.countryCode` and surface the updated validation issues.
49
+ - Ensure quote inputs contain real `YYYY-MM-DD` dates, an end date after the start date, and uppercase destination country codes.
50
+ - Add quote selection handling for `UnavailableAdditionalService` and `UnavailableCancellationPolicy`.
51
+ - Treat rental `reviews` as optional and render them when present.
52
+ - Review CLI config files for missing or blank required values.
@@ -0,0 +1,135 @@
1
+ # Migration: 2.1.0 to 2.3.0
2
+
3
+ This guide covers upgrading `@v-office/website-sdk` from 2.1.0 to 2.3.0.
4
+
5
+ 2.3.0 keeps `createWebsiteSDK({ config, options })`, the flat `WebsiteSDKConfig`, and separate `WebsiteSDKOptions`. Most changes are validation and reliability improvements.
6
+
7
+ ## What To Review
8
+
9
+ ### v9 Rental Scope
10
+
11
+ For v9, `options.rentalScope.propertyId` must be an integer vOffice property ID when provided:
12
+
13
+ ```ts
14
+ const sdk = createWebsiteSDK({
15
+ config,
16
+ options: defineWebsiteSDKOptions({
17
+ rentalScope: {
18
+ propertyId: "123",
19
+ },
20
+ }),
21
+ });
22
+ ```
23
+
24
+ Blank or non-numeric values now cause SDK creation to fail with a `CoreSDKError` using `operation: "v9.config"`. Previously, invalid values could silently disable the scope.
25
+
26
+ Migration: validate stored property IDs before passing them to `createWebsiteSDK`. Omit `propertyId` when no v9 property scope is required.
27
+
28
+ ### Contact
29
+
30
+ `address.countryCode` is now required by contact validation. It must be a two-letter uppercase country code such as `DE`. Email addresses are limited to 255 characters.
31
+
32
+ Migration: ensure every contact form supplies `address.countryCode` and continues to display field-level issues from `CoreSDKError.cause.issues`.
33
+
34
+ ### Quote Input
35
+
36
+ Quote inputs now receive stricter runtime validation:
37
+
38
+ - `period.start` and `period.end` must be real calendar dates in `YYYY-MM-DD` format.
39
+ - `period.end` must be after `period.start`.
40
+ - `destinationCountryCode`, when provided, must be a two-letter uppercase country code.
41
+ - Occupancy counts must be non-negative integers.
42
+
43
+ v9 quotes now forward optional child ages:
44
+
45
+ ```ts
46
+ const result = await sdk.live.quote.quote({
47
+ locale: "de-DE",
48
+ rentalId: "123",
49
+ period: {
50
+ start: "2026-08-01",
51
+ end: "2026-08-08",
52
+ },
53
+ occupancy: {
54
+ adults: 2,
55
+ children: 2,
56
+ childrenAges: [4, 8],
57
+ babies: 0,
58
+ pets: 0,
59
+ },
60
+ destinationCountryCode: "DE",
61
+ });
62
+ ```
63
+
64
+ Migration: validate user-entered dates and country codes before requesting a quote.
65
+
66
+ ### Quote Selection
67
+
68
+ Unavailable additional services and cancellation policies can no longer be newly selected. Selection results can now contain:
69
+
70
+ - `UnavailableAdditionalService`
71
+ - `UnavailableCancellationPolicy`
72
+
73
+ Migration: handle these outcomes alongside the existing quote selection errors and disable options whose `available` field is `false`. Existing unavailable selections may remain on a quote, but their quantity cannot be increased.
74
+
75
+ When the backend does not configure multi-rates, v10 cancellation policies are now retained instead of making an otherwise valid quote unavailable. Multi-rate matching and default policy selection are also more deterministic.
76
+
77
+ ### Search
78
+
79
+ v9 search now accepts these pet forms:
80
+
81
+ ```text
82
+ pets
83
+ pets=true
84
+ pets=false
85
+ pets=2
86
+ petsCount=2
87
+ ```
88
+
89
+ Use either a positive `pets` value or a positive `petsCount` value, not both. Duplicate or invalid values fail validation.
90
+
91
+ For v9, `childrenAges` can determine the child count when `children` is absent, but the ages themselves cannot be sent to the search backend. The result therefore includes `"childrenAges"` in `unusedFilterKeys`.
92
+
93
+ v10 search now enforces a maximum pagination range of 1,000 results and reports `hasNextPage` using the complete requested range. Integer filters no longer accept partially numeric strings, and `pets=false` / `pets=0` are valid ways to disable the mapped pets filter.
94
+
95
+ ### Rentals and Availability
96
+
97
+ v10 `sdk.static.rentals.getRentals` can now populate the existing optional `reviews` property:
98
+
99
+ ```ts
100
+ for (const rental of await sdk.static.rentals.getRentals({ locale: "de-DE" })) {
101
+ if (rental.reviews !== undefined) {
102
+ console.log(rental.reviews.summary, rental.reviews.items);
103
+ }
104
+ }
105
+ ```
106
+
107
+ Keep review rendering optional because rentals without public feedback omit the field.
108
+
109
+ v9 rental output now preserves room images and heuristic image metadata even when `voffice_images` is empty. Availability output for both backends now clamps its first calculation date to today when backend data starts in the past.
110
+
111
+ ### CLI
112
+
113
+ CLI config files are now decoded and validated before SDK creation. Required URLs, keys, and tokens must be non-blank strings, and v9 `rentalDataAttributes` entries must also be non-blank strings. Required environment variables containing only whitespace are treated as missing.
114
+
115
+ Expected CLI failures now print concise messages. SDK creation and operations are wrapped consistently, SDK instances are disposed after commands, and `website-sdk --version` follows the installed package version.
116
+
117
+ Migration: run the CLI once with each config file used in deployment and fix any newly reported validation errors.
118
+
119
+ ### Payment Submission
120
+
121
+ `form_post` payment options now fail explicitly if the browser does not provide native form submission. Unknown runtime payment option kinds also fail with `CoreSDKError` instead of being ignored.
122
+
123
+ No API change is required. Keep payment submission error handling in place and only call it in a browser environment.
124
+
125
+ ## Recommended Steps
126
+
127
+ 1. Upgrade to `@v-office/website-sdk` 2.3.0.
128
+ 2. Validate v9 `rentalScope.propertyId` values.
129
+ 3. Require an uppercase `address.countryCode` in contact forms.
130
+ 4. Validate quote dates, period ordering, occupancy counts, and destination country codes.
131
+ 5. Handle unavailable quote selection outcomes and disable unavailable options.
132
+ 6. Render optional v10 rental reviews where desired.
133
+ 7. Review search handling for pet flags, `childrenAges`, strict integer filters, and the 1,000-result pagination limit.
134
+ 8. Validate CLI config files and environment variables.
135
+ 9. Run focused smoke tests for rentals, search, availability, quote selection, booking, contact, and payment submission.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v-office/website-sdk",
3
- "version": "2.3.0",
3
+ "version": "2.3.2",
4
4
  "description": "Website-facing SDK facade backed by @v-office/sdk-core",
5
5
  "bin": {
6
6
  "website-sdk": "./dist/cli.mjs"
@@ -37,11 +37,11 @@
37
37
  "./package.json": "./package.json"
38
38
  },
39
39
  "publishConfig": {
40
- "access": "restricted"
40
+ "access": "public"
41
41
  },
42
42
  "dependencies": {
43
43
  "@graphql-typed-document-node/core": "3.2.0",
44
- "@v-office/sdk-core": "^1.4.0",
44
+ "@v-office/sdk-core": "^1.4.1",
45
45
  "effect": "4.0.0-beta.85",
46
46
  "graphql": "16.14.2",
47
47
  "yaml": "^2.9.0"