@v-office/website-sdk 1.2.0 → 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.
- package/README.md +91 -232
- package/dist/cli.mjs +102 -83
- package/dist/client-BSUd3vuc.mjs +5111 -0
- package/dist/index.d.mts +2463 -11751
- package/dist/index.mjs +16 -4
- package/dist/instructions/CHANGELOG.md +9 -0
- package/dist/instructions/MIGRATION.md +9 -0
- package/dist/instructions/README.md +62 -0
- package/dist/instructions/availability.md +157 -0
- package/dist/instructions/booking.md +165 -0
- package/dist/instructions/contact.md +92 -0
- package/dist/instructions/creation.md +223 -0
- package/dist/instructions/filter.md +156 -0
- package/dist/instructions/quote.md +318 -0
- package/dist/instructions/rentals.md +152 -0
- package/dist/instructions/search.md +233 -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/{quote-Bo-gBDkQ.mjs → quote-1uEIO44v.mjs} +15 -16
- package/dist/{rentals-Ba6ZO6bX.mjs → rentals-Quwc78o2.mjs} +22 -138
- package/dist/{search-BofxXqF0.mjs → search-GRQeXDvo.mjs} +43 -24
- package/dist/to-rental-highlights-FNZBR4aD.mjs +5905 -0
- package/instructions/CHANGELOG.md +9 -0
- package/instructions/MIGRATION.md +9 -0
- package/instructions/README.md +62 -0
- package/instructions/availability.md +157 -0
- package/instructions/booking.md +165 -0
- package/instructions/contact.md +92 -0
- package/instructions/creation.md +223 -0
- package/instructions/filter.md +156 -0
- package/instructions/quote.md +318 -0
- package/instructions/rentals.md +152 -0
- package/instructions/search.md +233 -0
- package/instructions/versions/2.0.0/CHANGELOG.md +69 -0
- package/instructions/versions/2.0.0/MIGRATION.md +223 -0
- package/package.json +41 -56
- package/dist/client-DYP0Y59i.mjs +0 -33236
- 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-Bxhb0jmN.mjs +0 -1085
- package/dist/quote-BKcAIFuH.mjs +0 -513
- package/dist/quote-CRjV_lf-.mjs +0 -609
- package/dist/rentals-DBTPlC6X.mjs +0 -323
- package/dist/search-filter-metadata-DZP0-Udc.mjs +0 -4294
- package/dist/to-rental-highlights-BShYK50C.mjs +0 -402
|
@@ -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`.
|