@v-office/website-sdk 1.2.1 → 2.0.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 (46) hide show
  1. package/README.md +91 -232
  2. package/dist/cli.mjs +102 -83
  3. package/dist/client-BSUd3vuc.mjs +5111 -0
  4. package/dist/index.d.mts +2463 -11751
  5. package/dist/index.mjs +16 -4
  6. package/dist/instructions/CHANGELOG.md +9 -0
  7. package/dist/instructions/MIGRATION.md +9 -0
  8. package/dist/instructions/README.md +62 -0
  9. package/dist/instructions/availability.md +157 -0
  10. package/dist/instructions/booking.md +165 -0
  11. package/dist/instructions/contact.md +92 -0
  12. package/dist/instructions/creation.md +223 -0
  13. package/dist/instructions/filter.md +156 -0
  14. package/dist/instructions/quote.md +318 -0
  15. package/dist/instructions/rentals.md +152 -0
  16. package/dist/instructions/search.md +233 -0
  17. package/dist/instructions/versions/2.0.0/CHANGELOG.md +69 -0
  18. package/dist/instructions/versions/2.0.0/MIGRATION.md +223 -0
  19. package/dist/{quote-DQGps4dy.mjs → quote-1uEIO44v.mjs} +15 -16
  20. package/dist/{rentals-plxPVx83.mjs → rentals-Quwc78o2.mjs} +22 -16
  21. package/dist/{search-BuR5apFw.mjs → search-GRQeXDvo.mjs} +40 -23
  22. package/dist/to-rental-highlights-FNZBR4aD.mjs +5905 -0
  23. package/instructions/CHANGELOG.md +9 -0
  24. package/instructions/MIGRATION.md +9 -0
  25. package/instructions/README.md +62 -0
  26. package/instructions/availability.md +157 -0
  27. package/instructions/booking.md +165 -0
  28. package/instructions/contact.md +92 -0
  29. package/instructions/creation.md +223 -0
  30. package/instructions/filter.md +156 -0
  31. package/instructions/quote.md +318 -0
  32. package/instructions/rentals.md +152 -0
  33. package/instructions/search.md +233 -0
  34. package/instructions/versions/2.0.0/CHANGELOG.md +69 -0
  35. package/instructions/versions/2.0.0/MIGRATION.md +223 -0
  36. package/package.json +41 -56
  37. package/dist/client-DeEUMMOh.mjs +0 -33237
  38. package/dist/custom-attribute-D5Kb1YHA.mjs +0 -54
  39. package/dist/errors-2cuUGSvi.mjs +0 -5
  40. package/dist/operations-B4IgNB3E.mjs +0 -12618
  41. package/dist/operations-DcU1qt7g.mjs +0 -1158
  42. package/dist/quote-BVx3TAHE.mjs +0 -513
  43. package/dist/quote-CRjV_lf-.mjs +0 -609
  44. package/dist/rentals-H3RYtMqT.mjs +0 -323
  45. package/dist/search-filter-metadata-DZP0-Udc.mjs +0 -4294
  46. package/dist/to-rental-highlights-CAATPqan.mjs +0 -524
package/dist/index.mjs CHANGED
@@ -1,4 +1,16 @@
1
- import { $ as DocumentResourceSchema, $t as toStableSearchInputParameterValues, At as ServiceImageSchema, B as makeV0OpenApiClientFetchLive, Bt as UnitIdsResponseSchema, Ct as QuoteServiceSchema, Dt as RoomImageSchema, Et as RegionListResponseSchema, Ft as TileCollectionResponseSchema, G as makeV1OpenApiClientLive, Gt as UnitServicePriceSchema, H as V1OpenApiClient, Ht as UnitListResponseSchema, It as TileSchema, J as CalendarResponseSchema, Jt as VideoResponseSchema, K as ApiEnvelopeBaseSchema, Kt as V1_BASE_URL, Lt as TileTagSchema, Mt as ServiceListResponseSchema, Nt as SetupDataSchema, Ot as SearchPropertiesResponseSchema, Pt as SetupResponseSchema, Q as DocumentResourceResponseSchema, R as V0OpenApiClient, Rt as TravelInsuranceBookingSchema, St as QuoteSchema, Tt as RawVofficeObjectSchema, U as V1OpenApiClientError, Ut as UnitOfferSchema, V as makeV0OpenApiClientLive, Vt as UnitListItemSchema, W as makeV1OpenApiClientFetchLive, Wt as UnitResponseSchema, X as CustomerUnitSummarySchema, Y as CurrentMemberResponseSchema, Yt as decodeV1OperationResponse, Z as DocumentCollectionResponseSchema, Zt as defineStableSearchInputGroup, _t as PaymentScheduleItemSchema, a as defineVofficeFacilityDataAttributes, at as ErgoBankSchema, bt as QuotePricesPayloadSchema, c as defineVofficeOfferDataAttributes, ct as ErgoCreatePreContractRequestSchema, d as defineVofficeServiceDataAttributes, dt as ErgoPolicyNumberRequestSchema, en as toStableSearchInputQueryKeys, et as DocumentStatusSchema, f as defineVofficeTotalRatingDataAttributes, ft as ErgoReadPreContractRequestSchema, gt as OnOfficeUnitSchema, ht as OnOfficeUnitCollectionResponseSchema, i as defineDataAttributes, it as ErgoAddressSchema, jt as ServiceLimitSchema, kt as ServiceBeonDataSchema, l as defineVofficePriceDataAttributes, lt as ErgoPersonSchema, mt as FacilityListResponseSchema, n as defineCMSSDKOptions, nt as DocumentSummarySchema, o as defineVofficeFeedbackDataAttributes, ot as ErgoBookRequestSchema, p as defineVofficeUnitDataAttributes, pt as ErgoTripAndCustomerRequestSchema, q as CalendarDaySchema, qt as V1_OPERATIONS, r as customDataAttribute, rt as DocumentTypeSchema, s as defineVofficeImageDataAttributes, st as ErgoCommonFieldsSchema, t as createCMSSDKFromParsedConfig, tt as DocumentStatusUpdateRequestSchema, u as defineVofficeRatingDataAttributes, ut as ErgoPlanSearchRequestSchema, vt as PaymentScheduleSchema, wt as RawObjectResponseSchema, xt as QuotePricesResponseSchema, yt as QuoteLineSchema, z as V0OpenApiClientError, zt as TravelInsuranceBookingStoreRequestSchema } from "./client-DeEUMMOh.mjs";
2
- import { t as CMSError } from "./errors-2cuUGSvi.mjs";
3
- import { D as UnknownAdditionalService, E as InvalidAdditionalServiceQuantity, w as AdditionalServiceLimitExceeded } from "./quote-CRjV_lf-.mjs";
4
- export { AdditionalServiceLimitExceeded, ApiEnvelopeBaseSchema, CMSError, CalendarDaySchema, CalendarResponseSchema, CurrentMemberResponseSchema, CustomerUnitSummarySchema, DocumentCollectionResponseSchema, DocumentResourceResponseSchema, DocumentResourceSchema, DocumentStatusSchema, DocumentStatusUpdateRequestSchema, DocumentSummarySchema, DocumentTypeSchema, ErgoAddressSchema, ErgoBankSchema, ErgoBookRequestSchema, ErgoCommonFieldsSchema, ErgoCreatePreContractRequestSchema, ErgoPersonSchema, ErgoPlanSearchRequestSchema, ErgoPolicyNumberRequestSchema, ErgoReadPreContractRequestSchema, ErgoTripAndCustomerRequestSchema, FacilityListResponseSchema, InvalidAdditionalServiceQuantity, OnOfficeUnitCollectionResponseSchema, OnOfficeUnitSchema, PaymentScheduleItemSchema, PaymentScheduleSchema, QuoteLineSchema, QuotePricesPayloadSchema, QuotePricesResponseSchema, QuoteSchema, QuoteServiceSchema, RawObjectResponseSchema, RawVofficeObjectSchema, RegionListResponseSchema, RoomImageSchema, SearchPropertiesResponseSchema, ServiceBeonDataSchema, ServiceImageSchema, ServiceLimitSchema, ServiceListResponseSchema, SetupDataSchema, SetupResponseSchema, TileCollectionResponseSchema, TileSchema, TileTagSchema, TravelInsuranceBookingSchema, TravelInsuranceBookingStoreRequestSchema, UnitIdsResponseSchema, UnitListItemSchema, UnitListResponseSchema, UnitOfferSchema, UnitResponseSchema, UnitServicePriceSchema, UnknownAdditionalService, V0OpenApiClient, V0OpenApiClientError, V1OpenApiClient, V1OpenApiClientError, V1_BASE_URL, V1_OPERATIONS, VideoResponseSchema, createCMSSDKFromParsedConfig, customDataAttribute, decodeV1OperationResponse, defineCMSSDKOptions, defineDataAttributes, defineStableSearchInputGroup, defineVofficeFacilityDataAttributes, defineVofficeFeedbackDataAttributes, defineVofficeImageDataAttributes, defineVofficeOfferDataAttributes, defineVofficePriceDataAttributes, defineVofficeRatingDataAttributes, defineVofficeServiceDataAttributes, defineVofficeTotalRatingDataAttributes, defineVofficeUnitDataAttributes, makeV0OpenApiClientFetchLive, makeV0OpenApiClientLive, makeV1OpenApiClientFetchLive, makeV1OpenApiClientLive, toStableSearchInputParameterValues, toStableSearchInputQueryKeys };
1
+ import { $ as SetupResponseSchema, A as ErgoPolicyNumberRequestSchema, At as submitContactEffect, B as QuotePricesResponseSchema, C as ErgoAddressSchema, Ct as getStartDateSelectedAvailabilityEffect, D as ErgoCreatePreContractRequestSchema, Dt as selectCancellationPolicyEffect, E as ErgoCommonFieldsSchema, Et as searchEffect, F as OnOfficeUnitSchema, G as RegionListResponseSchema, H as QuoteServiceSchema, I as PaymentScheduleItemSchema, J as ServiceBeonDataSchema, K as RoomImageSchema, L as PaymentScheduleSchema, M as ErgoTripAndCustomerRequestSchema, Mt as submitPaymentOptionEffect, N as FacilityListResponseSchema, Nt as defineWebsiteSDKOptions, O as ErgoPersonSchema, Ot as selectInsuranceEffect, P as OnOfficeUnitCollectionResponseSchema, Q as SetupDataSchema, R as QuoteLineSchema, S as DocumentTypeSchema, St as getRentalsEffect, T as ErgoBookRequestSchema, Tt as removeAdditionalServiceEffect, U as RawObjectResponseSchema, V as QuoteSchema, W as RawVofficeObjectSchema, X as ServiceLimitSchema, Y as ServiceImageSchema, Z as ServiceListResponseSchema, _ as DocumentResourceResponseSchema, _t as bookInsuranceEffect, a as makeV0OpenApiClientFetchLive, at as UnitIdsResponseSchema, b as DocumentStatusUpdateRequestSchema, bt as getFiltersEffect, c as V1OpenApiClientError, ct as UnitOfferSchema, d as ApiEnvelopeBaseSchema, dt as V1_BASE_URL, et as TileCollectionResponseSchema, f as CalendarDaySchema, ft as V1_OPERATIONS, g as DocumentCollectionResponseSchema, gt as bookEffect, h as CustomerUnitSummarySchema, ht as addAdditionalServiceEffect, i as V0OpenApiClientError, it as TravelInsuranceBookingStoreRequestSchema, j as ErgoReadPreContractRequestSchema, jt as submitPaymentOption, k as ErgoPlanSearchRequestSchema, kt as selectInsurancePaymentEffect, l as makeV1OpenApiClientFetchLive, lt as UnitResponseSchema, m as CurrentMemberResponseSchema, mt as decodeV1OperationResponse, nt as TileTagSchema, o as makeV0OpenApiClientLive, ot as UnitListItemSchema, p as CalendarResponseSchema, pt as VideoResponseSchema, q as SearchPropertiesResponseSchema, r as V0OpenApiClient, rt as TravelInsuranceBookingSchema, s as V1OpenApiClient, st as UnitListResponseSchema, t as createWebsiteSDK, tt as TileSchema, u as makeV1OpenApiClientLive, ut as UnitServicePriceSchema, v as DocumentResourceSchema, vt as clearAdditionalServicesEffect, w as ErgoBankSchema, wt as quoteEffect, x as DocumentSummarySchema, xt as getInitialAvailabilityEffect, y as DocumentStatusSchema, yt as createInsurancePreContractEffect, z as QuotePricesPayloadSchema } from "./client-BSUd3vuc.mjs";
2
+ import { AdditionalServiceLimitExceeded, CoreSDKError, CoreSDKError as CMSError, GuestQuoteSchema, InvalidAdditionalServiceQuantity, LocaleSchema, SearchSearchInputSchema, SearchSearchOutputSchema, UnknownAdditionalService } from "@v-office/sdk-core";
3
+ //#region codegen/v9/heuristic-generation/public-api.ts
4
+ const customDataAttribute = (name) => name;
5
+ const defineDataAttributes = () => (attributes) => attributes;
6
+ const defineVofficeUnitDataAttributes = defineDataAttributes();
7
+ const defineVofficeImageDataAttributes = defineDataAttributes();
8
+ const defineVofficeFacilityDataAttributes = defineDataAttributes();
9
+ const defineVofficeServiceDataAttributes = defineDataAttributes();
10
+ const defineVofficePriceDataAttributes = defineDataAttributes();
11
+ const defineVofficeFeedbackDataAttributes = defineDataAttributes();
12
+ const defineVofficeOfferDataAttributes = defineDataAttributes();
13
+ const defineVofficeRatingDataAttributes = defineDataAttributes();
14
+ const defineVofficeTotalRatingDataAttributes = defineDataAttributes();
15
+ //#endregion
16
+ export { AdditionalServiceLimitExceeded, ApiEnvelopeBaseSchema, CMSError, CalendarDaySchema, CalendarResponseSchema, CoreSDKError, CurrentMemberResponseSchema, CustomerUnitSummarySchema, DocumentCollectionResponseSchema, DocumentResourceResponseSchema, DocumentResourceSchema, DocumentStatusSchema, DocumentStatusUpdateRequestSchema, DocumentSummarySchema, DocumentTypeSchema, ErgoAddressSchema, ErgoBankSchema, ErgoBookRequestSchema, ErgoCommonFieldsSchema, ErgoCreatePreContractRequestSchema, ErgoPersonSchema, ErgoPlanSearchRequestSchema, ErgoPolicyNumberRequestSchema, ErgoReadPreContractRequestSchema, ErgoTripAndCustomerRequestSchema, FacilityListResponseSchema, GuestQuoteSchema, InvalidAdditionalServiceQuantity, LocaleSchema, OnOfficeUnitCollectionResponseSchema, OnOfficeUnitSchema, PaymentScheduleItemSchema, PaymentScheduleSchema, QuoteLineSchema, QuotePricesPayloadSchema, QuotePricesResponseSchema, QuoteSchema, QuoteServiceSchema, RawObjectResponseSchema, RawVofficeObjectSchema, RegionListResponseSchema, RoomImageSchema, SearchPropertiesResponseSchema, SearchSearchInputSchema, SearchSearchOutputSchema, ServiceBeonDataSchema, ServiceImageSchema, ServiceLimitSchema, ServiceListResponseSchema, SetupDataSchema, SetupResponseSchema, TileCollectionResponseSchema, TileSchema, TileTagSchema, TravelInsuranceBookingSchema, TravelInsuranceBookingStoreRequestSchema, UnitIdsResponseSchema, UnitListItemSchema, UnitListResponseSchema, UnitOfferSchema, UnitResponseSchema, UnitServicePriceSchema, UnknownAdditionalService, V0OpenApiClient, V0OpenApiClientError, V1OpenApiClient, V1OpenApiClientError, V1_BASE_URL, V1_OPERATIONS, VideoResponseSchema, addAdditionalServiceEffect, bookEffect, bookInsuranceEffect, clearAdditionalServicesEffect, createInsurancePreContractEffect, createWebsiteSDK, customDataAttribute, decodeV1OperationResponse, defineWebsiteSDKOptions as defineCMSSDKOptions, defineWebsiteSDKOptions, defineDataAttributes, defineVofficeFacilityDataAttributes, defineVofficeFeedbackDataAttributes, defineVofficeImageDataAttributes, defineVofficeOfferDataAttributes, defineVofficePriceDataAttributes, defineVofficeRatingDataAttributes, defineVofficeServiceDataAttributes, defineVofficeTotalRatingDataAttributes, defineVofficeUnitDataAttributes, getFiltersEffect, getInitialAvailabilityEffect, getRentalsEffect, getStartDateSelectedAvailabilityEffect, makeV0OpenApiClientFetchLive, makeV0OpenApiClientLive, makeV1OpenApiClientFetchLive, makeV1OpenApiClientLive, quoteEffect, removeAdditionalServiceEffect, searchEffect, selectCancellationPolicyEffect, selectInsuranceEffect, selectInsurancePaymentEffect, submitContactEffect, submitPaymentOption, submitPaymentOptionEffect };
@@ -0,0 +1,9 @@
1
+ # Changelog
2
+
3
+ This file is the versioned changelog index for the website SDK instructions.
4
+
5
+ ## Versions
6
+
7
+ - `versions/2.0.0/CHANGELOG.md`: `@v-office/website-sdk` 2.0.0 release notes.
8
+
9
+ Keep each future release in its own version directory so consumers can see which package version introduced each change.
@@ -0,0 +1,9 @@
1
+ # Migration
2
+
3
+ This file is the versioned migration index for the website SDK instructions.
4
+
5
+ ## Available Guides
6
+
7
+ - `versions/2.0.0/MIGRATION.md`: migrate from the legacy 1.x CMS-style website SDK API to `@v-office/website-sdk` 2.0.0.
8
+
9
+ Keep each future migration in its own version directory so consumers can clearly see the source and target versions for every upgrade path.
@@ -0,0 +1,62 @@
1
+ # Website SDK Instructions
2
+
3
+ These instructions describe `@v-office/website-sdk` 2.0.0.
4
+
5
+ Use this directory as the consumer-facing reference for the package:
6
+
7
+ - `creation.md`: SDK construction, config, options, and CLI config files.
8
+ - `rentals.md`: `sdk.static.rentals.getRentals`.
9
+ - `filter.md`: `sdk.static.filter.getFilters`.
10
+ - `search.md`: `sdk.live.search.search`.
11
+ - `availability.md`: date-picker availability flows.
12
+ - `quote.md`: quote, additional services, cancellation policy, and insurance flows.
13
+ - `booking.md`: booking and payment option submission.
14
+ - `contact.md`: contact submission.
15
+ - `CHANGELOG.md`: versioned changelog index.
16
+ - `MIGRATION.md`: versioned migration index.
17
+ - `versions/2.0.0/`: release-specific 2.0.0 changelog and 1.x-to-2.0.0 migration guide.
18
+
19
+ ## Package
20
+
21
+ ```sh
22
+ pnpm add @v-office/website-sdk
23
+ ```
24
+
25
+ The package is ESM-only and exports the root SDK facade from `@v-office/website-sdk`.
26
+
27
+ ## Quick Start
28
+
29
+ ```ts
30
+ import { createWebsiteSDK, defineWebsiteSDKOptions } from '@v-office/website-sdk'
31
+
32
+ const sdk = createWebsiteSDK({
33
+ config: {
34
+ backend: 'v10',
35
+ apiEndpoint: 'https://api.example.com/graphql',
36
+ accessToken: '...',
37
+ imageBaseUrl: 'https://images.example.com',
38
+ },
39
+ options: defineWebsiteSDKOptions({
40
+ rentalScope: {
41
+ propertyId: 'property-1',
42
+ },
43
+ }),
44
+ })
45
+
46
+ try {
47
+ const rentals = await sdk.static.rentals.getRentals({ locale: 'de-DE' })
48
+ console.log(rentals)
49
+ } finally {
50
+ await sdk.dispose()
51
+ }
52
+ ```
53
+
54
+ ## CLI
55
+
56
+ ```sh
57
+ website-sdk --backend v10 rentals --locale de-DE
58
+ website-sdk --backend v9 filters --locale en-US
59
+ website-sdk --backend v10 search --locale de-DE --query "adults=2"
60
+ ```
61
+
62
+ Config file examples in these docs use the 2.0.0 flat `WebsiteSDKConfig` shape.
@@ -0,0 +1,157 @@
1
+ # Availability
2
+
3
+ ## Service
4
+
5
+ Use the live availability API to build date-picker flows:
6
+
7
+ ```ts
8
+ const initial = await sdk.live.availability.getInitialAvailability(input)
9
+ const selected = await sdk.live.availability.getStartDateSelectedAvailability(input)
10
+ ```
11
+
12
+ `getInitialAvailability` marks possible start dates. `getStartDateSelectedAvailability` marks possible end dates after a start date was selected.
13
+
14
+ ## Input
15
+
16
+ Initial availability:
17
+
18
+ ```ts
19
+ type InitialAvailabilityInput = {
20
+ locale: 'de-DE' | 'en-US'
21
+ rentalId: string
22
+ calculateFromDate: string
23
+ calculateThroughDate: string
24
+ }
25
+ ```
26
+
27
+ Start-date-selected availability:
28
+
29
+ ```ts
30
+ type StartDateSelectedAvailabilityInput = InitialAvailabilityInput & {
31
+ selectedStartDate: string
32
+ }
33
+ ```
34
+
35
+ Sample:
36
+
37
+ ```json
38
+ {
39
+ "locale": "de-DE",
40
+ "rentalId": "123",
41
+ "calculateFromDate": "2026-07-01",
42
+ "calculateThroughDate": "2026-08-01"
43
+ }
44
+ ```
45
+
46
+ Dates are local dates formatted as `YYYY-MM-DD`. For `v9`, `rentalId` must be a numeric vOffice unit id.
47
+
48
+ ## Output
49
+
50
+ Initial availability returns `Promise<InitialAvailabilityOutput>`.
51
+
52
+ ```json
53
+ {
54
+ "calendarDays": {
55
+ "2026-07-01": {
56
+ "canBeStartDate": true,
57
+ "isAvailableDate": true,
58
+ "status": "available",
59
+ "formattedPrice": "120.00 EUR",
60
+ "tooltip": null
61
+ },
62
+ "2026-07-02": {
63
+ "canBeStartDate": false,
64
+ "isAvailableDate": false,
65
+ "status": "check_in_not_allowed",
66
+ "formattedPrice": null,
67
+ "tooltip": "Arrival is not possible on this date."
68
+ }
69
+ },
70
+ "minPersons": null,
71
+ "maxPersons": 6,
72
+ "maxAdults": 4
73
+ }
74
+ ```
75
+
76
+ Start-date-selected availability returns `Promise<StartDateSelectedAvailabilityOutput>`.
77
+
78
+ ```json
79
+ {
80
+ "calendarDays": {
81
+ "2026-07-08": {
82
+ "canBeEndDate": false,
83
+ "canBeNewStartDate": false,
84
+ "status": "same_day",
85
+ "tooltip": null
86
+ },
87
+ "2026-07-15": {
88
+ "canBeEndDate": true,
89
+ "canBeNewStartDate": false,
90
+ "status": "available",
91
+ "tooltip": null
92
+ }
93
+ }
94
+ }
95
+ ```
96
+
97
+ Common statuses include `available`, `before_today`, `check_in_not_allowed`, `no_valid_check_out_from_start`, `after_last_bookable_date`, and `unavailable`. End-date results can also return `same_day`, `not_after_selected_start`, `minimum_stay_not_met`, `check_out_not_allowed`, and range-crossing statuses.
98
+
99
+ ## Configuration
100
+
101
+ Use flat `WebsiteSDKConfig` files.
102
+
103
+ `v9` config:
104
+
105
+ ```json
106
+ {
107
+ "backend": "v9",
108
+ "graphqlUrl": "https://example.com/graphql",
109
+ "v1ApiBaseUrl": "https://example.com/api/v1",
110
+ "apiKey": "...",
111
+ "imageProxyBaseUrl": "https://images.example.com"
112
+ }
113
+ ```
114
+
115
+ `v10` config:
116
+
117
+ ```json
118
+ {
119
+ "backend": "v10",
120
+ "apiEndpoint": "https://api.example.com/graphql",
121
+ "accessToken": "...",
122
+ "imageBaseUrl": "https://images.example.com"
123
+ }
124
+ ```
125
+
126
+ Availability uses localized tooltips from the translation service. `v10` availability queries are rate-limited to one backend request per second, queued up to five requests, and cached per rental for 30 seconds.
127
+
128
+ ## CLI Usage
129
+
130
+ Fetch initial availability:
131
+
132
+ ```sh
133
+ website-sdk --backend v10 availability initial --rental-id 123 --calculate-from-date 2026-07-01 --calculate-through-date 2026-08-01
134
+ ```
135
+
136
+ Fetch availability after selecting a start date:
137
+
138
+ ```sh
139
+ website-sdk --backend v9 availability start-date-selected --rental-id 123 --selected-start-date 2026-07-08 --calculate-from-date 2026-07-01 --calculate-through-date 2026-08-01
140
+ ```
141
+
142
+ Use files instead of environment variables:
143
+
144
+ ```sh
145
+ website-sdk --backend v10 --config ./website-sdk-config.json availability initial --rental-id 123 --calculate-from-date 2026-07-01 --calculate-through-date 2026-08-01
146
+ ```
147
+
148
+ Output defaults to JSON. Use `--output pretty` for inspected terminal output:
149
+
150
+ ```sh
151
+ website-sdk --backend v10 availability initial --rental-id 123 --calculate-from-date 2026-07-01 --calculate-through-date 2026-08-01 --output pretty
152
+ ```
153
+
154
+ Environment variables:
155
+
156
+ - `v9`: `HUB_GRAPHQL_URL`, `HUB_V1_API_BASE_URL`, optional `HUB_V0_API_BASE_URL`, `HUB_API_KEY`, `IMAGE_PROXY_BASE_URL`.
157
+ - `v10`: `VOFFICE_API_ENDPOINT`, `VOFFICE_LOCAL_DEV_ACCESS_TOKEN`, `VOFFICE_IMAGE_BASE_URL`.
@@ -0,0 +1,165 @@
1
+ # Booking
2
+
3
+ ## Service
4
+
5
+ Use the live booking API to turn an available `GuestQuote` into a booking:
6
+
7
+ ```ts
8
+ const booking = await sdk.live.booking.book(input)
9
+ ```
10
+
11
+ The `quote` must be the `GuestQuote` instance returned by `sdk.live.quote.quote(...)`, optionally updated through quote selection helpers.
12
+
13
+ ## Input
14
+
15
+ ```ts
16
+ type BookingInput = {
17
+ quote: GuestQuote
18
+ contact: {
19
+ forename: string
20
+ surname: string
21
+ title?: string
22
+ birthdate?: string
23
+ address: {
24
+ street: string
25
+ housenumber?: string
26
+ postalcode: string
27
+ city: string
28
+ countryCode: string
29
+ }
30
+ contactDetails: { email: string; phone: string } | { email: string } | { phone: string }
31
+ note?: string
32
+ }
33
+ relativeRedirectUrl: string
34
+ }
35
+ ```
36
+
37
+ Sample:
38
+
39
+ ```ts
40
+ const quoteResult = await sdk.live.quote.quote(quoteInput)
41
+ if (quoteResult.status !== 'available') throw new Error(quoteResult.reason)
42
+
43
+ const booking = await sdk.live.booking.book({
44
+ quote: quoteResult.quote,
45
+ contact: {
46
+ forename: 'Jane',
47
+ surname: 'Doe',
48
+ title: 'Ms',
49
+ address: {
50
+ street: 'Main Street',
51
+ housenumber: '1',
52
+ postalcode: '12345',
53
+ city: 'Berlin',
54
+ countryCode: 'DE',
55
+ },
56
+ contactDetails: {
57
+ email: 'jane@example.com',
58
+ phone: '+49123456789',
59
+ },
60
+ note: 'Please prepare a baby bed.',
61
+ },
62
+ relativeRedirectUrl: '/booking/payment-return',
63
+ })
64
+ ```
65
+
66
+ `relativeRedirectUrl` is used for online payment redirects after booking creation.
67
+
68
+ ## Output
69
+
70
+ Returns `Promise<BookingOutput>`.
71
+
72
+ Sample:
73
+
74
+ ```json
75
+ {
76
+ "bookingNumber": "B-2026-0001",
77
+ "guestToken": "guest-token",
78
+ "paymentSchedules": [
79
+ {
80
+ "label": "Deposit",
81
+ "dueOn": "2026-06-15",
82
+ "lines": [
83
+ {
84
+ "label": "Deposit",
85
+ "amount": "300.00 EUR"
86
+ }
87
+ ],
88
+ "total": "300.00 EUR",
89
+ "paymentOptions": [
90
+ {
91
+ "kind": "bank_transfer",
92
+ "label": "Bank transfer",
93
+ "holder": "Example GmbH",
94
+ "iban": "DE02120300000000202051",
95
+ "swiftOrBic": "BYLADEM1001",
96
+ "remittanceText": "B-2026-0001"
97
+ },
98
+ {
99
+ "kind": "redirect",
100
+ "provider": "adyen",
101
+ "label": "Credit card",
102
+ "url": "https://checkout.example.com"
103
+ }
104
+ ]
105
+ }
106
+ ],
107
+ "insurancePaymentOptions": []
108
+ }
109
+ ```
110
+
111
+ Payment option variants:
112
+
113
+ - `bank_transfer`: display-only payment details.
114
+ - `redirect`: redirect the browser to the payment URL.
115
+ - `form_post`: submit a generated HTML form, currently used for PayPal-style flows.
116
+ - `stripe_checkout`: redirect to Stripe Checkout when a `url` is present.
117
+
118
+ Use `sdk.live.booking.submitPaymentOption(option)` or the top-level `submitPaymentOption(option)` export for non-bank-transfer payment options in a browser environment.
119
+
120
+ ## Configuration
121
+
122
+ Booking requests are rate-limited to one backend request per second with a queue size of five. `v9` books through the v0 `book` action and can initialize Stripe payment data. `v10` books through GraphQL and initializes Adyen redirect payment options.
123
+
124
+ ## CLI Usage
125
+
126
+ `website-sdk` 2.0.0 includes a booking CLI command. It creates a fresh quote from a quote input file, then books that quote with a booking contact file:
127
+
128
+ ```sh
129
+ website-sdk --backend v10 booking book --quote-input ./quote-input.json --contact-input ./booking-contact.json --relative-redirect-url /booking/payment-return --yes
130
+ ```
131
+
132
+ The command requires `--yes` because it creates a booking in the configured backend.
133
+
134
+ Example `booking-contact.json`:
135
+
136
+ ```json
137
+ {
138
+ "forename": "Jane",
139
+ "surname": "Doe",
140
+ "title": "Ms",
141
+ "address": {
142
+ "street": "Main Street",
143
+ "housenumber": "1",
144
+ "postalcode": "12345",
145
+ "city": "Berlin",
146
+ "countryCode": "DE"
147
+ },
148
+ "contactDetails": {
149
+ "email": "jane@example.com",
150
+ "phone": "+49123456789"
151
+ },
152
+ "note": "Please prepare a baby bed."
153
+ }
154
+ ```
155
+
156
+ Use files instead of environment variables:
157
+
158
+ ```sh
159
+ website-sdk --backend v10 --config ./website-sdk-config.json booking book --quote-input ./quote-input.json --contact-input ./booking-contact.json --relative-redirect-url /booking/payment-return --yes
160
+ ```
161
+
162
+ Environment variables:
163
+
164
+ - `v9`: `HUB_GRAPHQL_URL`, `HUB_V1_API_BASE_URL`, optional `HUB_V0_API_BASE_URL`, `HUB_API_KEY`, `IMAGE_PROXY_BASE_URL`.
165
+ - `v10`: `VOFFICE_API_ENDPOINT`, `VOFFICE_LOCAL_DEV_ACCESS_TOKEN`, `VOFFICE_IMAGE_BASE_URL`.
@@ -0,0 +1,92 @@
1
+ # Contact
2
+
3
+ ## Service
4
+
5
+ Use the live contact API to submit a contact request:
6
+
7
+ ```ts
8
+ await sdk.live.contact.submit(input)
9
+ ```
10
+
11
+ `v9` submits the request through the v0 `saveMessage` action. The current `v10` implementation is a placeholder and resolves without sending a backend request.
12
+
13
+ ## Input
14
+
15
+ ```ts
16
+ type ContactInput = {
17
+ title: string
18
+ professionalTitle: string
19
+ forename: string
20
+ surname: string
21
+ address: {
22
+ streetAndHousenumber: string
23
+ postalCode: string
24
+ city: string
25
+ countryCode: string
26
+ }
27
+ email: string
28
+ phone?: string
29
+ message: string
30
+ }
31
+ ```
32
+
33
+ `ContactSubmitInput` is the core SDK type name. `ContactInput` remains exported as a legacy alias.
34
+
35
+ Sample:
36
+
37
+ ```json
38
+ {
39
+ "title": "Ms",
40
+ "professionalTitle": "",
41
+ "forename": "Jane",
42
+ "surname": "Doe",
43
+ "address": {
44
+ "streetAndHousenumber": "Main Street 1",
45
+ "postalCode": "12345",
46
+ "city": "Berlin",
47
+ "countryCode": "DE"
48
+ },
49
+ "email": "jane@example.com",
50
+ "phone": "+49123456789",
51
+ "message": "I have a question about a rental."
52
+ }
53
+ ```
54
+
55
+ ## Output
56
+
57
+ Returns `Promise<ContactSubmitOutput>`. `ContactSubmitOutput` is currently `void`.
58
+
59
+ Successful CLI output:
60
+
61
+ ```json
62
+ {
63
+ "ok": true
64
+ }
65
+ ```
66
+
67
+ Errors are reported as `CoreSDKError`, also exported as the compatibility alias `CMSError`. The 2.0.0 error shape uses `source` instead of the legacy `backend` field.
68
+
69
+ ## Configuration
70
+
71
+ Contact requests are rate-limited to one request per second with a queue size of five.
72
+
73
+ ## CLI Usage
74
+
75
+ Create `contact-input.json` with a `ContactSubmitInput` object, then submit with explicit confirmation:
76
+
77
+ ```sh
78
+ website-sdk --backend v9 contact submit --input ./contact-input.json --yes
79
+ ```
80
+
81
+ Use files instead of environment variables:
82
+
83
+ ```sh
84
+ website-sdk --backend v9 --config ./website-sdk-config.json contact submit --input ./contact-input.json --yes
85
+ ```
86
+
87
+ Without `--yes`, the command fails before submitting because contact requests send data to the configured backend.
88
+
89
+ Environment variables:
90
+
91
+ - `v9`: `HUB_GRAPHQL_URL`, `HUB_V1_API_BASE_URL`, optional `HUB_V0_API_BASE_URL`, `HUB_API_KEY`, `IMAGE_PROXY_BASE_URL`.
92
+ - `v10`: `VOFFICE_API_ENDPOINT`, `VOFFICE_LOCAL_DEV_ACCESS_TOKEN`, `VOFFICE_IMAGE_BASE_URL`.