@v-office/website-sdk 1.2.1 → 2.1.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 +93 -232
- package/dist/cli.mjs +105 -84
- package/dist/client-xkXV7Nf-.mjs +5127 -0
- package/dist/index.d.mts +1444 -11259
- package/dist/index.mjs +16 -4
- package/dist/instructions/CHANGELOG.md +10 -0
- package/dist/instructions/MIGRATION.md +10 -0
- package/dist/instructions/README.md +64 -0
- package/dist/instructions/availability.md +157 -0
- package/dist/instructions/booking.md +165 -0
- package/dist/instructions/contact.md +110 -0
- package/dist/instructions/creation.md +223 -0
- package/dist/instructions/document-structured-json.md +100 -0
- package/dist/instructions/filter.md +158 -0
- package/dist/instructions/quote.md +342 -0
- package/dist/instructions/rentals.md +152 -0
- package/dist/instructions/search.md +238 -0
- package/dist/instructions/versions/2.0.0/CHANGELOG.md +69 -0
- package/dist/instructions/versions/2.0.0/MIGRATION.md +223 -0
- package/dist/instructions/versions/2.1.0/CHANGELOG.md +32 -0
- package/dist/instructions/versions/2.1.0/MIGRATION.md +89 -0
- package/dist/{quote-DQGps4dy.mjs → quote--25SMlYS.mjs} +41 -19
- package/dist/{rentals-plxPVx83.mjs → rentals-DCKUaLnB.mjs} +22 -16
- package/dist/{search-BuR5apFw.mjs → search-8iCC0Nel.mjs} +40 -23
- package/dist/to-rental-highlights-CZYJeR1D.mjs +5905 -0
- package/dist/translations/shared/de-DE/contact.json +19 -0
- package/dist/translations/shared/de-DE/quote.json +5 -1
- package/dist/translations/shared/en-US/contact.json +19 -0
- package/dist/translations/shared/en-US/quote.json +5 -1
- package/dist/translations/v10/de-DE/mapped-search-filters.json +3 -0
- package/dist/translations/v10/en-US/mapped-search-filters.json +3 -0
- package/instructions/CHANGELOG.md +10 -0
- package/instructions/MIGRATION.md +10 -0
- package/instructions/README.md +64 -0
- package/instructions/availability.md +157 -0
- package/instructions/booking.md +165 -0
- package/instructions/contact.md +110 -0
- package/instructions/creation.md +223 -0
- package/instructions/document-structured-json.md +100 -0
- package/instructions/filter.md +158 -0
- package/instructions/quote.md +342 -0
- package/instructions/rentals.md +152 -0
- package/instructions/search.md +238 -0
- package/instructions/versions/2.0.0/CHANGELOG.md +69 -0
- package/instructions/versions/2.0.0/MIGRATION.md +223 -0
- package/instructions/versions/2.1.0/CHANGELOG.md +32 -0
- package/instructions/versions/2.1.0/MIGRATION.md +89 -0
- package/package.json +42 -56
- package/dist/client-DeEUMMOh.mjs +0 -33237
- package/dist/custom-attribute-D5Kb1YHA.mjs +0 -54
- package/dist/errors-2cuUGSvi.mjs +0 -5
- package/dist/operations-B4IgNB3E.mjs +0 -12618
- package/dist/operations-DcU1qt7g.mjs +0 -1158
- package/dist/quote-BVx3TAHE.mjs +0 -513
- package/dist/quote-CRjV_lf-.mjs +0 -609
- package/dist/rentals-H3RYtMqT.mjs +0 -323
- package/dist/search-filter-metadata-DZP0-Udc.mjs +0 -4294
- package/dist/to-rental-highlights-CAATPqan.mjs +0 -524
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contact.submit.field.title": "Anrede",
|
|
3
|
+
"contact.submit.field.professionalTitle": "Titel",
|
|
4
|
+
"contact.submit.field.forename": "Vorname",
|
|
5
|
+
"contact.submit.field.surname": "Nachname",
|
|
6
|
+
"contact.submit.field.address.streetAndHousenumber": "Straße und Hausnummer",
|
|
7
|
+
"contact.submit.field.address.postalCode": "Postleitzahl",
|
|
8
|
+
"contact.submit.field.address.city": "Ort",
|
|
9
|
+
"contact.submit.field.address.countryCode": "Land",
|
|
10
|
+
"contact.submit.field.email": "E-Mail",
|
|
11
|
+
"contact.submit.field.phone": "Telefon",
|
|
12
|
+
"contact.submit.field.subject": "Betreff",
|
|
13
|
+
"contact.submit.field.message": "Nachricht",
|
|
14
|
+
"contact.submit.validation.summary": "Bitte prüfen Sie Ihre Kontaktanfrage.",
|
|
15
|
+
"contact.submit.validation.required": "{field} ist erforderlich.",
|
|
16
|
+
"contact.submit.validation.invalid_email": "Bitte geben Sie eine gültige E-Mail-Adresse ein.",
|
|
17
|
+
"contact.submit.validation.invalid_country_code": "Bitte geben Sie ein gültiges Land an.",
|
|
18
|
+
"contact.submit.validation.tooLong": "{field} darf höchstens {maxLength} Zeichen lang sein."
|
|
19
|
+
}
|
|
@@ -4,5 +4,9 @@
|
|
|
4
4
|
"quote.sections.tax": "Steuern & Abgaben",
|
|
5
5
|
"quote.additionalService.day": " / Tag",
|
|
6
6
|
"quote.additionalService.night": " / Nacht",
|
|
7
|
-
"quote.status.unavailable.notBookable": "Nicht verfügbar"
|
|
7
|
+
"quote.status.unavailable.notBookable": "Nicht verfügbar",
|
|
8
|
+
"quote.optionCombination.unavailable": "Diese Optionskombination ist nicht verfügbar.",
|
|
9
|
+
"quote.voucher.applied": "Der Rabattcode wurde angewendet.",
|
|
10
|
+
"quote.voucher.notApplied": "Der Rabattcode konnte nicht angewendet werden.",
|
|
11
|
+
"quote.voucher.unknown": "Das Backend hat nicht bestätigt, ob der Rabattcode angewendet wurde."
|
|
8
12
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contact.submit.field.title": "Title",
|
|
3
|
+
"contact.submit.field.professionalTitle": "Professional title",
|
|
4
|
+
"contact.submit.field.forename": "First name",
|
|
5
|
+
"contact.submit.field.surname": "Last name",
|
|
6
|
+
"contact.submit.field.address.streetAndHousenumber": "Street and house number",
|
|
7
|
+
"contact.submit.field.address.postalCode": "Postal code",
|
|
8
|
+
"contact.submit.field.address.city": "City",
|
|
9
|
+
"contact.submit.field.address.countryCode": "Country",
|
|
10
|
+
"contact.submit.field.email": "Email",
|
|
11
|
+
"contact.submit.field.phone": "Phone",
|
|
12
|
+
"contact.submit.field.subject": "Subject",
|
|
13
|
+
"contact.submit.field.message": "Message",
|
|
14
|
+
"contact.submit.validation.summary": "Please check your contact request.",
|
|
15
|
+
"contact.submit.validation.required": "{field} is required.",
|
|
16
|
+
"contact.submit.validation.invalid_email": "Please enter a valid email address.",
|
|
17
|
+
"contact.submit.validation.invalid_country_code": "Please enter a valid country.",
|
|
18
|
+
"contact.submit.validation.tooLong": "{field} must be at most {maxLength} characters long."
|
|
19
|
+
}
|
|
@@ -4,5 +4,9 @@
|
|
|
4
4
|
"quote.sections.tax": "Taxes & Fees",
|
|
5
5
|
"quote.additionalService.day": " / day",
|
|
6
6
|
"quote.additionalService.night": " / night",
|
|
7
|
-
"quote.status.unavailable.notBookable": "Not available"
|
|
7
|
+
"quote.status.unavailable.notBookable": "Not available",
|
|
8
|
+
"quote.optionCombination.unavailable": "This option combination is unavailable.",
|
|
9
|
+
"quote.voucher.applied": "The voucher code was applied.",
|
|
10
|
+
"quote.voucher.notApplied": "The voucher code could not be applied.",
|
|
11
|
+
"quote.voucher.unknown": "The backend did not confirm whether the voucher code was applied."
|
|
8
12
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
This file is the versioned changelog index for the website SDK instructions.
|
|
4
|
+
|
|
5
|
+
## Versions
|
|
6
|
+
|
|
7
|
+
- `versions/2.1.0/CHANGELOG.md`: `@v-office/website-sdk` 2.1.0 release notes.
|
|
8
|
+
- `versions/2.0.0/CHANGELOG.md`: `@v-office/website-sdk` 2.0.0 release notes.
|
|
9
|
+
|
|
10
|
+
Keep each future release in its own version directory so consumers can see which package version introduced each change.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Migration
|
|
2
|
+
|
|
3
|
+
This file is the versioned migration index for the website SDK instructions.
|
|
4
|
+
|
|
5
|
+
## Available Guides
|
|
6
|
+
|
|
7
|
+
- `versions/2.1.0/MIGRATION.md`: migrate from `@v-office/website-sdk` 2.0.0 to 2.1.0.
|
|
8
|
+
- `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.
|
|
9
|
+
|
|
10
|
+
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,64 @@
|
|
|
1
|
+
# Website SDK Instructions
|
|
2
|
+
|
|
3
|
+
These instructions describe `@v-office/website-sdk` 2.1.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
|
+
- `document-structured-json.md`: `sdk.static.documents.getTermsAndPrivacyPolicy` and structured document JSON rendering rules.
|
|
16
|
+
- `CHANGELOG.md`: versioned changelog index.
|
|
17
|
+
- `MIGRATION.md`: versioned migration index.
|
|
18
|
+
- `versions/2.1.0/`: 2.1.0 release notes and 2.0.0-to-2.1.0 migration guide.
|
|
19
|
+
- `versions/2.0.0/`: release-specific 2.0.0 changelog and 1.x-to-2.0.0 migration guide.
|
|
20
|
+
|
|
21
|
+
## Package
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
pnpm add @v-office/website-sdk
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The package is ESM-only and exports the root SDK facade from `@v-office/website-sdk`.
|
|
28
|
+
|
|
29
|
+
## Quick Start
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { createWebsiteSDK, defineWebsiteSDKOptions } from "@v-office/website-sdk";
|
|
33
|
+
|
|
34
|
+
const sdk = createWebsiteSDK({
|
|
35
|
+
config: {
|
|
36
|
+
backend: "v10",
|
|
37
|
+
apiEndpoint: "https://api.example.com/graphql",
|
|
38
|
+
accessToken: "...",
|
|
39
|
+
imageBaseUrl: "https://images.example.com",
|
|
40
|
+
},
|
|
41
|
+
options: defineWebsiteSDKOptions({
|
|
42
|
+
rentalScope: {
|
|
43
|
+
propertyId: "property-1",
|
|
44
|
+
},
|
|
45
|
+
}),
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
const rentals = await sdk.static.rentals.getRentals({ locale: "de-DE" });
|
|
50
|
+
console.log(rentals);
|
|
51
|
+
} finally {
|
|
52
|
+
await sdk.dispose();
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## CLI
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
website-sdk --backend v10 rentals --locale de-DE
|
|
60
|
+
website-sdk --backend v9 filters --locale en-US
|
|
61
|
+
website-sdk --backend v10 search --locale de-DE --query "adults=2"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Config file examples in these docs use the flat `WebsiteSDKConfig` shape introduced in 2.0.0 and kept in 2.1.0.
|
|
@@ -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
|
+
The CLI includes a booking 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,110 @@
|
|
|
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. `v10` submits the request through the `messengeremail_newContactRequest` GraphQL operation.
|
|
12
|
+
|
|
13
|
+
## Input
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
type ContactInput = {
|
|
17
|
+
locale?: "de-DE" | "en-US";
|
|
18
|
+
title: string;
|
|
19
|
+
professionalTitle: string;
|
|
20
|
+
forename: string;
|
|
21
|
+
surname: string;
|
|
22
|
+
address: {
|
|
23
|
+
streetAndHousenumber: string;
|
|
24
|
+
postalCode: string;
|
|
25
|
+
city: string;
|
|
26
|
+
countryCode: string;
|
|
27
|
+
};
|
|
28
|
+
email: string;
|
|
29
|
+
phone: string;
|
|
30
|
+
subject: string;
|
|
31
|
+
message: string;
|
|
32
|
+
};
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
`ContactSubmitInput` is the core SDK type name. `ContactInput` remains exported as a legacy alias.
|
|
36
|
+
|
|
37
|
+
Sample:
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"locale": "de-DE",
|
|
42
|
+
"title": "Ms",
|
|
43
|
+
"professionalTitle": "",
|
|
44
|
+
"forename": "Jane",
|
|
45
|
+
"surname": "Doe",
|
|
46
|
+
"address": {
|
|
47
|
+
"streetAndHousenumber": "Main Street 1",
|
|
48
|
+
"postalCode": "12345",
|
|
49
|
+
"city": "Berlin",
|
|
50
|
+
"countryCode": "DE"
|
|
51
|
+
},
|
|
52
|
+
"email": "jane@example.com",
|
|
53
|
+
"phone": "+49123456789",
|
|
54
|
+
"subject": "Question about a rental",
|
|
55
|
+
"message": "I have a question about a rental."
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Output
|
|
60
|
+
|
|
61
|
+
Returns `Promise<ContactSubmitOutput>`. `ContactSubmitOutput` is currently `void`.
|
|
62
|
+
|
|
63
|
+
Successful CLI output:
|
|
64
|
+
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"ok": true
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Errors are reported as `CoreSDKError`, also exported as the compatibility alias `CMSError`. The current error shape uses `source` instead of the legacy `backend` field.
|
|
72
|
+
|
|
73
|
+
Contact input is validated before submitting to either backend. Validation failures reject with a `CoreSDKError` using `operation: "contact.submit.validation"`. The error `message` is translated with `input.locale` and defaults to German (`de-DE`) when no locale is provided. Field-level details are available on `error.cause.issues`:
|
|
74
|
+
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"issues": [
|
|
78
|
+
{
|
|
79
|
+
"path": "email",
|
|
80
|
+
"code": "invalid_email",
|
|
81
|
+
"message": "Bitte geben Sie eine gültige E-Mail-Adresse ein."
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Configuration
|
|
88
|
+
|
|
89
|
+
Contact requests are rate-limited to one request per second with a queue size of five.
|
|
90
|
+
|
|
91
|
+
## CLI Usage
|
|
92
|
+
|
|
93
|
+
Create `contact-input.json` with a `ContactSubmitInput` object, then submit with explicit confirmation:
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
website-sdk --backend v9 contact submit --input ./contact-input.json --yes
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Use files instead of environment variables:
|
|
100
|
+
|
|
101
|
+
```sh
|
|
102
|
+
website-sdk --backend v9 --config ./website-sdk-config.json contact submit --input ./contact-input.json --yes
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Without `--yes`, the command fails before submitting because contact requests send data to the configured backend.
|
|
106
|
+
|
|
107
|
+
Environment variables:
|
|
108
|
+
|
|
109
|
+
- `v9`: `HUB_GRAPHQL_URL`, `HUB_V1_API_BASE_URL`, optional `HUB_V0_API_BASE_URL`, `HUB_API_KEY`, `IMAGE_PROXY_BASE_URL`.
|
|
110
|
+
- `v10`: `VOFFICE_API_ENDPOINT`, `VOFFICE_LOCAL_DEV_ACCESS_TOKEN`, `VOFFICE_IMAGE_BASE_URL`.
|