@v-office/website-sdk 2.9.0 → 2.10.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 +2 -2
- package/dist/{client-CYK_5Vk7.mjs → client-DYAHnU5F.mjs} +2 -2
- 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/booking.md +5 -1
- package/dist/instructions/versions/2.10.0/CHANGELOG.md +26 -0
- package/dist/instructions/versions/2.10.0/MIGRATION.md +63 -0
- package/dist/{search-CO9ID9op.mjs → search-QlZrI7ue.mjs} +1 -1
- package/instructions/CHANGELOG.md +1 -0
- package/instructions/MIGRATION.md +1 -0
- package/instructions/README.md +3 -2
- package/instructions/booking.md +5 -1
- package/instructions/versions/2.10.0/CHANGELOG.md +26 -0
- package/instructions/versions/2.10.0/MIGRATION.md +63 -0
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as createWebsiteSDK, zt as defineWebsiteSDKOptions } from "./client-
|
|
2
|
+
import { t as createWebsiteSDK, zt as defineWebsiteSDKOptions } from "./client-DYAHnU5F.mjs";
|
|
3
3
|
import { SearchSearchSortSchema, defineCustomAttributesFromUnknown } from "@v-office/sdk-core";
|
|
4
4
|
import { Console, Effect, FileSystem, Layer, Option, Path, Schema, Stdio, Terminal } from "effect";
|
|
5
5
|
import { Command, Flag } from "effect/unstable/cli";
|
|
@@ -16,7 +16,7 @@ var CLICheckFailed = class extends Error {
|
|
|
16
16
|
const toCLIError = (message, cause) => cause instanceof Error ? new CLICheckFailed(`${message}: ${cause.message}`, { cause }) : new CLICheckFailed(message, { cause });
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region package.json
|
|
19
|
-
var version = "2.
|
|
19
|
+
var version = "2.10.0";
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region src/cli/output.ts
|
|
22
22
|
const toJson = (value) => Effect.try({
|
|
@@ -3770,7 +3770,7 @@ const toBookingInput = ({ input }) => Effect.gen(function* () {
|
|
|
3770
3770
|
message: "Expected a v9 quote for v9 booking."
|
|
3771
3771
|
}));
|
|
3772
3772
|
return {
|
|
3773
|
-
action: "booking",
|
|
3773
|
+
action: input.kind === "OPTION" ? "option" : "booking",
|
|
3774
3774
|
reservation: { customer: {
|
|
3775
3775
|
...input.contact.title === void 0 ? {} : { title: input.contact.title },
|
|
3776
3776
|
forename: input.contact.forename,
|
|
@@ -4952,7 +4952,7 @@ const parseV9SearchCursor = (cursor) => Effect.gen(function* () {
|
|
|
4952
4952
|
return page;
|
|
4953
4953
|
});
|
|
4954
4954
|
const loadV9SearchRuntime = Effect.tryPromise({
|
|
4955
|
-
try: () => import("./search-
|
|
4955
|
+
try: () => import("./search-QlZrI7ue.mjs"),
|
|
4956
4956
|
catch: (cause) => new CoreSDKError({
|
|
4957
4957
|
source: "v10",
|
|
4958
4958
|
operation: "v9.search.runtime",
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as ServiceBeonDataSchema, A as ErgoBookRequestSchema, At as quoteEffect, B as OnOfficeUnitSchema, C as DocumentResourceSchema, Ct as clearAdditionalServicesEffect, D as DocumentTypeSchema, Dt as getRentalsEffect, E as DocumentSummarySchema, Et as getInitialAvailabilityEffect, F as ErgoPolicyNumberRequestSchema, Ft as selectInsurancePaymentEffect, G as QuotePricesResponseSchema, H as PaymentScheduleSchema, I as ErgoReadPreContractRequestSchema, It as submitContactEffect, J as RawObjectResponseSchema, K as QuoteSchema, L as ErgoTripAndCustomerRequestSchema, Lt as submitPaymentOption, M as ErgoCreatePreContractRequestSchema, Mt as searchEffect, N as ErgoPersonSchema, Nt as selectCancellationPolicyEffect, O as ErgoAddressSchema, Ot as getStartDateSelectedAvailabilityEffect, P as ErgoPlanSearchRequestSchema, Pt as selectInsuranceEffect, Q as SearchPropertiesResponseSchema, R as FacilityListResponseSchema, Rt as submitPaymentOptionEffect, S as DocumentResourceResponseSchema, St as bookInsuranceEffect, T as DocumentStatusUpdateRequestSchema, Tt as getFiltersEffect, U as QuoteLineSchema, V as PaymentScheduleItemSchema, W as QuotePricesPayloadSchema, X as RegionListResponseSchema, Y as RawVofficeObjectSchema, Z as RoomImageSchema, _ as CalendarDaySchema, _t as V1_OPERATIONS, at as TileCollectionResponseSchema, b as CustomerUnitSummarySchema, bt as addAdditionalServiceEffect, c as V0OpenApiClient, ct as TravelInsuranceBookingSchema, d as makeV0OpenApiClientLive, dt as UnitListItemSchema, et as ServiceImageSchema, f as V1OpenApiClient, ft as UnitListResponseSchema, g as ApiEnvelopeBaseSchema, gt as V1_BASE_URL, h as makeV1OpenApiClientLive, ht as UnitServicePriceSchema, it as SetupResponseSchema, j as ErgoCommonFieldsSchema, jt as removeAdditionalServiceEffect, k as ErgoBankSchema, kt as getTermsAndPrivacyPolicyEffect, l as V0OpenApiClientError, lt as TravelInsuranceBookingStoreRequestSchema, m as makeV1OpenApiClientFetchLive, mt as UnitResponseSchema, nt as ServiceListResponseSchema, ot as TileSchema, p as V1OpenApiClientError, pt as UnitOfferSchema, q as QuoteServiceSchema, rt as SetupDataSchema, st as TileTagSchema, t as createWebsiteSDK, tt as ServiceLimitSchema, u as makeV0OpenApiClientFetchLive, ut as UnitIdsResponseSchema, v as CalendarResponseSchema, vt as VideoResponseSchema, w as DocumentStatusSchema, wt as createInsurancePreContractEffect, x as DocumentCollectionResponseSchema, xt as bookEffect, y as CurrentMemberResponseSchema, yt as decodeV1OperationResponse, z as OnOfficeUnitCollectionResponseSchema, zt as defineWebsiteSDKOptions } from "./client-
|
|
1
|
+
import { $ as ServiceBeonDataSchema, A as ErgoBookRequestSchema, At as quoteEffect, B as OnOfficeUnitSchema, C as DocumentResourceSchema, Ct as clearAdditionalServicesEffect, D as DocumentTypeSchema, Dt as getRentalsEffect, E as DocumentSummarySchema, Et as getInitialAvailabilityEffect, F as ErgoPolicyNumberRequestSchema, Ft as selectInsurancePaymentEffect, G as QuotePricesResponseSchema, H as PaymentScheduleSchema, I as ErgoReadPreContractRequestSchema, It as submitContactEffect, J as RawObjectResponseSchema, K as QuoteSchema, L as ErgoTripAndCustomerRequestSchema, Lt as submitPaymentOption, M as ErgoCreatePreContractRequestSchema, Mt as searchEffect, N as ErgoPersonSchema, Nt as selectCancellationPolicyEffect, O as ErgoAddressSchema, Ot as getStartDateSelectedAvailabilityEffect, P as ErgoPlanSearchRequestSchema, Pt as selectInsuranceEffect, Q as SearchPropertiesResponseSchema, R as FacilityListResponseSchema, Rt as submitPaymentOptionEffect, S as DocumentResourceResponseSchema, St as bookInsuranceEffect, T as DocumentStatusUpdateRequestSchema, Tt as getFiltersEffect, U as QuoteLineSchema, V as PaymentScheduleItemSchema, W as QuotePricesPayloadSchema, X as RegionListResponseSchema, Y as RawVofficeObjectSchema, Z as RoomImageSchema, _ as CalendarDaySchema, _t as V1_OPERATIONS, at as TileCollectionResponseSchema, b as CustomerUnitSummarySchema, bt as addAdditionalServiceEffect, c as V0OpenApiClient, ct as TravelInsuranceBookingSchema, d as makeV0OpenApiClientLive, dt as UnitListItemSchema, et as ServiceImageSchema, f as V1OpenApiClient, ft as UnitListResponseSchema, g as ApiEnvelopeBaseSchema, gt as V1_BASE_URL, h as makeV1OpenApiClientLive, ht as UnitServicePriceSchema, it as SetupResponseSchema, j as ErgoCommonFieldsSchema, jt as removeAdditionalServiceEffect, k as ErgoBankSchema, kt as getTermsAndPrivacyPolicyEffect, l as V0OpenApiClientError, lt as TravelInsuranceBookingStoreRequestSchema, m as makeV1OpenApiClientFetchLive, mt as UnitResponseSchema, nt as ServiceListResponseSchema, ot as TileSchema, p as V1OpenApiClientError, pt as UnitOfferSchema, q as QuoteServiceSchema, rt as SetupDataSchema, st as TileTagSchema, t as createWebsiteSDK, tt as ServiceLimitSchema, u as makeV0OpenApiClientFetchLive, ut as UnitIdsResponseSchema, v as CalendarResponseSchema, vt as VideoResponseSchema, w as DocumentStatusSchema, wt as createInsurancePreContractEffect, x as DocumentCollectionResponseSchema, xt as bookEffect, y as CurrentMemberResponseSchema, yt as decodeV1OperationResponse, z as OnOfficeUnitCollectionResponseSchema, zt as defineWebsiteSDKOptions } from "./client-DYAHnU5F.mjs";
|
|
2
2
|
import { AdditionalServiceLimitExceeded, CoreSDKError, CoreSDKError as CMSError, CustomAttributeCatalogSchema, GuestQuoteSchema, InvalidAdditionalServiceQuantity, LocaleSchema, SearchSearchFieldOrderBySchema, SearchSearchFieldSortSchema, SearchSearchInputSchema, SearchSearchOutputSchema, SearchSearchPriceSortSchema, SearchSearchRandomSortSchema, SearchSearchRatingSortSchema, SearchSearchSortSchema, SearchSortDirectionSchema, UnknownAdditionalService, defineCustomAttributes, defineCustomAttributesFromUnknown, fetchCustomAttributeCatalog, parseCustomAttributeCatalog, validateContactSubmitInput } from "@v-office/sdk-core";
|
|
3
3
|
//#region codegen/v9/heuristic-generation/public-api.ts
|
|
4
4
|
const customDataAttribute = (name) => name;
|
|
@@ -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.10.0/CHANGELOG.md`: `@v-office/website-sdk` 2.10.0 release notes.
|
|
7
8
|
- `versions/2.9.0/CHANGELOG.md`: `@v-office/website-sdk` 2.9.0 release notes.
|
|
8
9
|
- `versions/2.8.0/CHANGELOG.md`: `@v-office/website-sdk` 2.8.0 release notes.
|
|
9
10
|
- `versions/2.7.0/CHANGELOG.md`: `@v-office/website-sdk` 2.7.0 release notes.
|
|
@@ -4,6 +4,7 @@ This file is the versioned migration index for the website SDK instructions.
|
|
|
4
4
|
|
|
5
5
|
## Available Guides
|
|
6
6
|
|
|
7
|
+
- `versions/2.10.0/MIGRATION.md`: migrate from `@v-office/website-sdk` 2.9.0 to 2.10.0.
|
|
7
8
|
- `versions/2.9.0/MIGRATION.md`: migrate from `@v-office/website-sdk` 2.8.0 to 2.9.0.
|
|
8
9
|
- `versions/2.8.0/MIGRATION.md`: migrate from `@v-office/website-sdk` 2.7.0 to 2.8.0.
|
|
9
10
|
- `versions/2.7.0/MIGRATION.md`: migrate from `@v-office/website-sdk` 2.5.x to 2.7.0.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Website SDK Instructions
|
|
2
2
|
|
|
3
3
|
These instructions describe the current source targeted for
|
|
4
|
-
`@v-office/website-sdk` 2.
|
|
4
|
+
`@v-office/website-sdk` 2.10.0. Package versions remain unchanged until the release
|
|
5
5
|
workflow performs the coordinated core and website bumps.
|
|
6
6
|
|
|
7
7
|
Use this directory as the consumer-facing reference for the package:
|
|
@@ -18,6 +18,7 @@ Use this directory as the consumer-facing reference for the package:
|
|
|
18
18
|
- `document-structured-json.md`: `sdk.static.documents.getTermsAndPrivacyPolicy` and structured document JSON rendering rules.
|
|
19
19
|
- `CHANGELOG.md`: versioned changelog index.
|
|
20
20
|
- `MIGRATION.md`: versioned migration index.
|
|
21
|
+
- `versions/2.10.0/`: 2.10.0 option-booking release notes and 2.9.0-to-2.10.0 migration guide.
|
|
21
22
|
- `versions/2.9.0/`: 2.9.0 highlight-selection release notes and 2.8.0-to-2.9.0 migration guide.
|
|
22
23
|
- `versions/2.8.0/`: 2.8.0 custom-attribute release notes and 2.7.0-to-2.8.0 migration guide.
|
|
23
24
|
- `versions/2.7.0/`: 2.7.0 release notes and 2.5.x-to-2.7.0 migration guide.
|
|
@@ -75,4 +76,4 @@ website-sdk --backend v10 search --locale de-DE --query "adults=2"
|
|
|
75
76
|
website-sdk --backend v10 search --locale de-DE --query "adults=2" --sort '{"by":"field","orderBy":{"label":"ASC"}}'
|
|
76
77
|
```
|
|
77
78
|
|
|
78
|
-
Config file examples in these docs use the flat `WebsiteSDKConfig` shape introduced in 2.0.0 and kept in 2.
|
|
79
|
+
Config file examples in these docs use the flat `WebsiteSDKConfig` shape introduced in 2.0.0 and kept in 2.10.0. v10 config additionally requires `searchEndpoint` as of 2.5.0.
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## Service
|
|
4
4
|
|
|
5
|
-
Use the live booking API to turn an available `GuestQuote` into a
|
|
5
|
+
Use the live booking API to turn an available `GuestQuote` into a confirmed or
|
|
6
|
+
option booking:
|
|
6
7
|
|
|
7
8
|
```ts
|
|
8
9
|
const booking = await sdk.live.booking.book(input);
|
|
@@ -31,6 +32,7 @@ type BookingInput = {
|
|
|
31
32
|
note?: string;
|
|
32
33
|
};
|
|
33
34
|
relativeRedirectUrl: string;
|
|
35
|
+
kind?: "CONFIRMED" | "OPTION";
|
|
34
36
|
};
|
|
35
37
|
```
|
|
36
38
|
|
|
@@ -63,6 +65,8 @@ const booking = await sdk.live.booking.book({
|
|
|
63
65
|
});
|
|
64
66
|
```
|
|
65
67
|
|
|
68
|
+
`kind: "OPTION"` creates an option booking on v10 and legacy v9. Omitting `kind`,
|
|
69
|
+
or passing `"CONFIRMED"`, retains the existing confirmed-booking behavior.
|
|
66
70
|
`relativeRedirectUrl` is used for online payment redirects after booking creation.
|
|
67
71
|
|
|
68
72
|
## Output
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Changelog: 2.10.0
|
|
2
|
+
|
|
3
|
+
This release adds option bookings to the shared booking input and supports them
|
|
4
|
+
consistently through the v10 and legacy v9 backends.
|
|
5
|
+
|
|
6
|
+
## Added
|
|
7
|
+
|
|
8
|
+
- `BookingInput.kind` accepts `"CONFIRMED"` or `"OPTION"`.
|
|
9
|
+
- Passing `kind: "OPTION"` creates an option booking through
|
|
10
|
+
`sdk.live.booking.book(...)`.
|
|
11
|
+
|
|
12
|
+
## Changed
|
|
13
|
+
|
|
14
|
+
- v10 maps `"OPTION"` to the GraphQL booking status `OPTION`.
|
|
15
|
+
- Legacy v9 maps `"OPTION"` to the v0 booking action `option`.
|
|
16
|
+
- Omitting `kind`, or passing `"CONFIRMED"`, retains the existing confirmed-booking
|
|
17
|
+
behavior on both backends.
|
|
18
|
+
|
|
19
|
+
## Migration Impact
|
|
20
|
+
|
|
21
|
+
- Existing booking calls require no changes because `kind` is optional.
|
|
22
|
+
- The booking service name, remaining input fields, and `BookingOutput` are
|
|
23
|
+
unchanged.
|
|
24
|
+
- `relativeRedirectUrl` remains required for both booking kinds.
|
|
25
|
+
- Sites that want to create option bookings can opt in by passing
|
|
26
|
+
`kind: "OPTION"`. See `versions/2.10.0/MIGRATION.md`.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Migration: 2.9.0 to 2.10.0
|
|
2
|
+
|
|
3
|
+
2.10.0 adds an optional booking kind. Existing calls continue to create confirmed
|
|
4
|
+
bookings and require no migration.
|
|
5
|
+
|
|
6
|
+
## 1. Choose the Booking Kind
|
|
7
|
+
|
|
8
|
+
`BookingInput` now includes:
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
kind?: "CONFIRMED" | "OPTION";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The values behave as follows:
|
|
15
|
+
|
|
16
|
+
- Omit `kind`, or pass `"CONFIRMED"`, to create a confirmed booking.
|
|
17
|
+
- Pass `"OPTION"` to create an option booking.
|
|
18
|
+
|
|
19
|
+
The SDK maps these values to the native backend representation:
|
|
20
|
+
|
|
21
|
+
- v10 uses booking status `CONFIRMED` or `OPTION`.
|
|
22
|
+
- Legacy v9 uses booking action `booking` or `option`.
|
|
23
|
+
|
|
24
|
+
## 2. Create an Option Booking
|
|
25
|
+
|
|
26
|
+
Use the existing booking service and set `kind` to `"OPTION"`:
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
const optionBooking = await sdk.live.booking.book({
|
|
30
|
+
quote,
|
|
31
|
+
contact,
|
|
32
|
+
relativeRedirectUrl: "/booking/payment-return",
|
|
33
|
+
kind: "OPTION",
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
No separate option-booking method is required. The returned value remains a
|
|
38
|
+
`BookingOutput`.
|
|
39
|
+
|
|
40
|
+
## 3. Keep Existing Confirmed Bookings Unchanged
|
|
41
|
+
|
|
42
|
+
Existing calls remain valid:
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
const booking = await sdk.live.booking.book({
|
|
46
|
+
quote,
|
|
47
|
+
contact,
|
|
48
|
+
relativeRedirectUrl: "/booking/payment-return",
|
|
49
|
+
});
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Passing `kind: "CONFIRMED"` is equivalent to omitting the field. Other input
|
|
53
|
+
requirements, including `relativeRedirectUrl`, are unchanged.
|
|
54
|
+
|
|
55
|
+
## Recommended Verification
|
|
56
|
+
|
|
57
|
+
1. Create a booking without `kind` and confirm it remains confirmed.
|
|
58
|
+
2. Create a booking with `kind: "OPTION"` and confirm the backend records it as an
|
|
59
|
+
option.
|
|
60
|
+
3. Repeat both checks against v10 and legacy v9 when the site supports both
|
|
61
|
+
backends.
|
|
62
|
+
4. Verify existing booking-result and payment handling still accepts the unchanged
|
|
63
|
+
`BookingOutput`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as parseQueryParameters, i as collectQueryParameters, n as makeV9CustomAttributeFilterCapabilities, o as toQueryString, r as toBasicQueryInputs, s as applyVofficeFilterDerivedBasicQueryInputs } from "./client-
|
|
1
|
+
import { a as parseQueryParameters, i as collectQueryParameters, n as makeV9CustomAttributeFilterCapabilities, o as toQueryString, r as toBasicQueryInputs, s as applyVofficeFilterDerivedBasicQueryInputs } from "./client-DYAHnU5F.mjs";
|
|
2
2
|
import { a as searchQuery, c as VofficeUnitDataFieldSchemas, m as parseVofficeUnitData, n as toImages, r as toAddress, t as toRentalHighlights } from "./to-rental-highlights-B6a_fi0j.mjs";
|
|
3
3
|
import { CoreSDKError, STABLE_SEARCH_INPUTS, daysBetweenLocalDates, expandCustomAttributeFilterCompositions, parseChildrenAges, parseOccupancyCount, resolveExpandedCompositions, toFormattedSearchPrice, toIsoDateFromPeriodQueryDate, toStableSearchInputBackendQueryKeys, toStableSearchInputParameterValues, toStableSearchInputQueryKeys, toUnusedFilterKeys } from "@v-office/sdk-core";
|
|
4
4
|
import { Effect } from "effect";
|
|
@@ -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.10.0/CHANGELOG.md`: `@v-office/website-sdk` 2.10.0 release notes.
|
|
7
8
|
- `versions/2.9.0/CHANGELOG.md`: `@v-office/website-sdk` 2.9.0 release notes.
|
|
8
9
|
- `versions/2.8.0/CHANGELOG.md`: `@v-office/website-sdk` 2.8.0 release notes.
|
|
9
10
|
- `versions/2.7.0/CHANGELOG.md`: `@v-office/website-sdk` 2.7.0 release notes.
|
|
@@ -4,6 +4,7 @@ This file is the versioned migration index for the website SDK instructions.
|
|
|
4
4
|
|
|
5
5
|
## Available Guides
|
|
6
6
|
|
|
7
|
+
- `versions/2.10.0/MIGRATION.md`: migrate from `@v-office/website-sdk` 2.9.0 to 2.10.0.
|
|
7
8
|
- `versions/2.9.0/MIGRATION.md`: migrate from `@v-office/website-sdk` 2.8.0 to 2.9.0.
|
|
8
9
|
- `versions/2.8.0/MIGRATION.md`: migrate from `@v-office/website-sdk` 2.7.0 to 2.8.0.
|
|
9
10
|
- `versions/2.7.0/MIGRATION.md`: migrate from `@v-office/website-sdk` 2.5.x to 2.7.0.
|
package/instructions/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Website SDK Instructions
|
|
2
2
|
|
|
3
3
|
These instructions describe the current source targeted for
|
|
4
|
-
`@v-office/website-sdk` 2.
|
|
4
|
+
`@v-office/website-sdk` 2.10.0. Package versions remain unchanged until the release
|
|
5
5
|
workflow performs the coordinated core and website bumps.
|
|
6
6
|
|
|
7
7
|
Use this directory as the consumer-facing reference for the package:
|
|
@@ -18,6 +18,7 @@ Use this directory as the consumer-facing reference for the package:
|
|
|
18
18
|
- `document-structured-json.md`: `sdk.static.documents.getTermsAndPrivacyPolicy` and structured document JSON rendering rules.
|
|
19
19
|
- `CHANGELOG.md`: versioned changelog index.
|
|
20
20
|
- `MIGRATION.md`: versioned migration index.
|
|
21
|
+
- `versions/2.10.0/`: 2.10.0 option-booking release notes and 2.9.0-to-2.10.0 migration guide.
|
|
21
22
|
- `versions/2.9.0/`: 2.9.0 highlight-selection release notes and 2.8.0-to-2.9.0 migration guide.
|
|
22
23
|
- `versions/2.8.0/`: 2.8.0 custom-attribute release notes and 2.7.0-to-2.8.0 migration guide.
|
|
23
24
|
- `versions/2.7.0/`: 2.7.0 release notes and 2.5.x-to-2.7.0 migration guide.
|
|
@@ -75,4 +76,4 @@ website-sdk --backend v10 search --locale de-DE --query "adults=2"
|
|
|
75
76
|
website-sdk --backend v10 search --locale de-DE --query "adults=2" --sort '{"by":"field","orderBy":{"label":"ASC"}}'
|
|
76
77
|
```
|
|
77
78
|
|
|
78
|
-
Config file examples in these docs use the flat `WebsiteSDKConfig` shape introduced in 2.0.0 and kept in 2.
|
|
79
|
+
Config file examples in these docs use the flat `WebsiteSDKConfig` shape introduced in 2.0.0 and kept in 2.10.0. v10 config additionally requires `searchEndpoint` as of 2.5.0.
|
package/instructions/booking.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## Service
|
|
4
4
|
|
|
5
|
-
Use the live booking API to turn an available `GuestQuote` into a
|
|
5
|
+
Use the live booking API to turn an available `GuestQuote` into a confirmed or
|
|
6
|
+
option booking:
|
|
6
7
|
|
|
7
8
|
```ts
|
|
8
9
|
const booking = await sdk.live.booking.book(input);
|
|
@@ -31,6 +32,7 @@ type BookingInput = {
|
|
|
31
32
|
note?: string;
|
|
32
33
|
};
|
|
33
34
|
relativeRedirectUrl: string;
|
|
35
|
+
kind?: "CONFIRMED" | "OPTION";
|
|
34
36
|
};
|
|
35
37
|
```
|
|
36
38
|
|
|
@@ -63,6 +65,8 @@ const booking = await sdk.live.booking.book({
|
|
|
63
65
|
});
|
|
64
66
|
```
|
|
65
67
|
|
|
68
|
+
`kind: "OPTION"` creates an option booking on v10 and legacy v9. Omitting `kind`,
|
|
69
|
+
or passing `"CONFIRMED"`, retains the existing confirmed-booking behavior.
|
|
66
70
|
`relativeRedirectUrl` is used for online payment redirects after booking creation.
|
|
67
71
|
|
|
68
72
|
## Output
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Changelog: 2.10.0
|
|
2
|
+
|
|
3
|
+
This release adds option bookings to the shared booking input and supports them
|
|
4
|
+
consistently through the v10 and legacy v9 backends.
|
|
5
|
+
|
|
6
|
+
## Added
|
|
7
|
+
|
|
8
|
+
- `BookingInput.kind` accepts `"CONFIRMED"` or `"OPTION"`.
|
|
9
|
+
- Passing `kind: "OPTION"` creates an option booking through
|
|
10
|
+
`sdk.live.booking.book(...)`.
|
|
11
|
+
|
|
12
|
+
## Changed
|
|
13
|
+
|
|
14
|
+
- v10 maps `"OPTION"` to the GraphQL booking status `OPTION`.
|
|
15
|
+
- Legacy v9 maps `"OPTION"` to the v0 booking action `option`.
|
|
16
|
+
- Omitting `kind`, or passing `"CONFIRMED"`, retains the existing confirmed-booking
|
|
17
|
+
behavior on both backends.
|
|
18
|
+
|
|
19
|
+
## Migration Impact
|
|
20
|
+
|
|
21
|
+
- Existing booking calls require no changes because `kind` is optional.
|
|
22
|
+
- The booking service name, remaining input fields, and `BookingOutput` are
|
|
23
|
+
unchanged.
|
|
24
|
+
- `relativeRedirectUrl` remains required for both booking kinds.
|
|
25
|
+
- Sites that want to create option bookings can opt in by passing
|
|
26
|
+
`kind: "OPTION"`. See `versions/2.10.0/MIGRATION.md`.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Migration: 2.9.0 to 2.10.0
|
|
2
|
+
|
|
3
|
+
2.10.0 adds an optional booking kind. Existing calls continue to create confirmed
|
|
4
|
+
bookings and require no migration.
|
|
5
|
+
|
|
6
|
+
## 1. Choose the Booking Kind
|
|
7
|
+
|
|
8
|
+
`BookingInput` now includes:
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
kind?: "CONFIRMED" | "OPTION";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The values behave as follows:
|
|
15
|
+
|
|
16
|
+
- Omit `kind`, or pass `"CONFIRMED"`, to create a confirmed booking.
|
|
17
|
+
- Pass `"OPTION"` to create an option booking.
|
|
18
|
+
|
|
19
|
+
The SDK maps these values to the native backend representation:
|
|
20
|
+
|
|
21
|
+
- v10 uses booking status `CONFIRMED` or `OPTION`.
|
|
22
|
+
- Legacy v9 uses booking action `booking` or `option`.
|
|
23
|
+
|
|
24
|
+
## 2. Create an Option Booking
|
|
25
|
+
|
|
26
|
+
Use the existing booking service and set `kind` to `"OPTION"`:
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
const optionBooking = await sdk.live.booking.book({
|
|
30
|
+
quote,
|
|
31
|
+
contact,
|
|
32
|
+
relativeRedirectUrl: "/booking/payment-return",
|
|
33
|
+
kind: "OPTION",
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
No separate option-booking method is required. The returned value remains a
|
|
38
|
+
`BookingOutput`.
|
|
39
|
+
|
|
40
|
+
## 3. Keep Existing Confirmed Bookings Unchanged
|
|
41
|
+
|
|
42
|
+
Existing calls remain valid:
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
const booking = await sdk.live.booking.book({
|
|
46
|
+
quote,
|
|
47
|
+
contact,
|
|
48
|
+
relativeRedirectUrl: "/booking/payment-return",
|
|
49
|
+
});
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Passing `kind: "CONFIRMED"` is equivalent to omitting the field. Other input
|
|
53
|
+
requirements, including `relativeRedirectUrl`, are unchanged.
|
|
54
|
+
|
|
55
|
+
## Recommended Verification
|
|
56
|
+
|
|
57
|
+
1. Create a booking without `kind` and confirm it remains confirmed.
|
|
58
|
+
2. Create a booking with `kind: "OPTION"` and confirm the backend records it as an
|
|
59
|
+
option.
|
|
60
|
+
3. Repeat both checks against v10 and legacy v9 when the site supports both
|
|
61
|
+
backends.
|
|
62
|
+
4. Verify existing booking-result and payment handling still accepts the unchanged
|
|
63
|
+
`BookingOutput`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-office/website-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.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.10.0",
|
|
45
45
|
"effect": "4.0.0-beta.85",
|
|
46
46
|
"graphql": "16.14.2",
|
|
47
47
|
"yaml": "^2.9.0"
|