@v-office/website-sdk 2.0.0 → 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 +33 -31
- package/dist/cli.mjs +6 -4
- package/dist/{client-BSUd3vuc.mjs → client-xkXV7Nf-.mjs} +32 -16
- package/dist/index.d.mts +613 -1140
- package/dist/index.mjs +3 -3
- package/dist/instructions/CHANGELOG.md +1 -0
- package/dist/instructions/MIGRATION.md +1 -0
- package/dist/instructions/README.md +14 -12
- package/dist/instructions/availability.md +9 -9
- package/dist/instructions/booking.md +33 -33
- package/dist/instructions/contact.md +34 -16
- package/dist/instructions/creation.md +48 -48
- package/dist/instructions/document-structured-json.md +100 -0
- package/dist/instructions/filter.md +5 -3
- package/dist/instructions/quote.md +72 -48
- package/dist/instructions/rentals.md +3 -3
- package/dist/instructions/search.md +36 -31
- package/dist/instructions/versions/2.0.0/MIGRATION.md +17 -17
- 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-1uEIO44v.mjs → quote--25SMlYS.mjs} +27 -4
- package/dist/{rentals-Quwc78o2.mjs → rentals-DCKUaLnB.mjs} +1 -1
- package/dist/{search-GRQeXDvo.mjs → search-8iCC0Nel.mjs} +2 -2
- package/dist/{to-rental-highlights-FNZBR4aD.mjs → to-rental-highlights-CZYJeR1D.mjs} +12 -12
- 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 +1 -0
- package/instructions/MIGRATION.md +1 -0
- package/instructions/README.md +14 -12
- package/instructions/availability.md +9 -9
- package/instructions/booking.md +33 -33
- package/instructions/contact.md +34 -16
- package/instructions/creation.md +48 -48
- package/instructions/document-structured-json.md +100 -0
- package/instructions/filter.md +5 -3
- package/instructions/quote.md +72 -48
- package/instructions/rentals.md +3 -3
- package/instructions/search.md +36 -31
- package/instructions/versions/2.0.0/MIGRATION.md +17 -17
- package/instructions/versions/2.1.0/CHANGELOG.md +32 -0
- package/instructions/versions/2.1.0/MIGRATION.md +89 -0
- package/package.json +4 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as VofficeUnitDataFieldSchemas, d as VofficeUnitDataPropertyMetadata, f as parseVofficeFacilityData, i as toLocalizedString, l as VofficeUnitDataPropertyCategoryLabelKeys, m as parseVofficeUnitData, n as toImages, o as rentalsAllFeedbacksQuery, p as parseVofficeFeedbackData, r as toAddress, s as rentalsAllWithoutFeedbacksQuery, t as toRentalHighlights, u as VofficeUnitDataPropertyCategoryValues } from "./to-rental-highlights-
|
|
1
|
+
import { c as VofficeUnitDataFieldSchemas, d as VofficeUnitDataPropertyMetadata, f as parseVofficeFacilityData, i as toLocalizedString, l as VofficeUnitDataPropertyCategoryLabelKeys, m as parseVofficeUnitData, n as toImages, o as rentalsAllFeedbacksQuery, p as parseVofficeFeedbackData, r as toAddress, s as rentalsAllWithoutFeedbacksQuery, t as toRentalHighlights, u as VofficeUnitDataPropertyCategoryValues } from "./to-rental-highlights-CZYJeR1D.mjs";
|
|
2
2
|
import { makeTranslate, renderCustomAttributeHighlight, renderLabeledAttributeValue } from "@v-office/sdk-core";
|
|
3
3
|
import { Effect } from "effect";
|
|
4
4
|
//#region src/legacy-v9/parser/rentals/to-description.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as stable_filters_default } from "./client-
|
|
2
|
-
import { a as searchQuery, c as VofficeUnitDataFieldSchemas, m as parseVofficeUnitData, n as toImages, r as toAddress, t as toRentalHighlights } from "./to-rental-highlights-
|
|
1
|
+
import { n as stable_filters_default } from "./client-xkXV7Nf-.mjs";
|
|
2
|
+
import { a as searchQuery, c as VofficeUnitDataFieldSchemas, m as parseVofficeUnitData, n as toImages, r as toAddress, t as toRentalHighlights } from "./to-rental-highlights-CZYJeR1D.mjs";
|
|
3
3
|
import { CoreSDKError, STABLE_SEARCH_INPUTS, collectQueryParameters, daysBetweenLocalDates, expandCustomAttributeFilterCompositions, parseChildrenAges, parseOccupancyCount, parseQueryParameters, toCustomAttributeFilterLabel, toFormattedSearchPrice, toIsoDateFromPeriodQueryDate, toQueryString, toStableSearchInputBackendQueryKeys, toStableSearchInputParameterValues, toStableSearchInputQueryKeys, toUnusedFilterKeys } from "@v-office/sdk-core";
|
|
4
4
|
import { Effect } from "effect";
|
|
5
5
|
//#region src/legacy-v9/parser/search/input/filter/apply-voffice-filter-derived-basic-query-inputs.ts
|
|
@@ -3568,14 +3568,14 @@ Schema.Number, Schema.Number, Schema.Number, Schema.Number;
|
|
|
3568
3568
|
//#endregion
|
|
3569
3569
|
//#region codegen/v9/graphql-codegen/generated/gql.ts
|
|
3570
3570
|
const documents = {
|
|
3571
|
-
"\n query
|
|
3571
|
+
"\n query CoreSDK_RentalsAllWithoutFeedbacks(\n $language: String\n $voffice_ids: [Int!]\n $rentalDataAttributes: [String!]! = []\n $rentalFacilityDataAttributes: [String!]! = []\n $rentalRatingDataAttributes: [String!]! = []\n ) {\n all(language: $language, voffice_ids: $voffice_ids) {\n id\n voffice_id\n voffice_facility_id\n name\n publish\n data(attributes: $rentalDataAttributes)\n additional_voffice_data {\n beds\n }\n voffice_facility {\n id\n voffice_id\n name\n publish\n data(attributes: $rentalFacilityDataAttributes)\n }\n voffice_images {\n id\n path\n title\n description\n }\n voffice_room_images {\n id\n path\n name\n title\n description\n }\n voffice_rating {\n id\n data(attributes: $rentalRatingDataAttributes)\n }\n }\n }\n": {
|
|
3572
3572
|
kind: "Document",
|
|
3573
3573
|
definitions: [{
|
|
3574
3574
|
kind: "OperationDefinition",
|
|
3575
3575
|
operation: "query",
|
|
3576
3576
|
name: {
|
|
3577
3577
|
kind: "Name",
|
|
3578
|
-
value: "
|
|
3578
|
+
value: "CoreSDK_RentalsAllWithoutFeedbacks"
|
|
3579
3579
|
},
|
|
3580
3580
|
variableDefinitions: [
|
|
3581
3581
|
{
|
|
@@ -4011,14 +4011,14 @@ const documents = {
|
|
|
4011
4011
|
}
|
|
4012
4012
|
}]
|
|
4013
4013
|
},
|
|
4014
|
-
"\n query
|
|
4014
|
+
"\n query CoreSDK_RentalsAllFeedbacks(\n $language: String\n $voffice_ids: [Int!]\n $rentalFeedbackDataAttributes: [String!]! = []\n ) {\n all(language: $language, voffice_ids: $voffice_ids) {\n voffice_id\n voffice_feedbacks {\n data(attributes: $rentalFeedbackDataAttributes)\n }\n }\n }\n": {
|
|
4015
4015
|
kind: "Document",
|
|
4016
4016
|
definitions: [{
|
|
4017
4017
|
kind: "OperationDefinition",
|
|
4018
4018
|
operation: "query",
|
|
4019
4019
|
name: {
|
|
4020
4020
|
kind: "Name",
|
|
4021
|
-
value: "
|
|
4021
|
+
value: "CoreSDK_RentalsAllFeedbacks"
|
|
4022
4022
|
},
|
|
4023
4023
|
variableDefinitions: [
|
|
4024
4024
|
{
|
|
@@ -4171,14 +4171,14 @@ const documents = {
|
|
|
4171
4171
|
}
|
|
4172
4172
|
}]
|
|
4173
4173
|
},
|
|
4174
|
-
"\n query
|
|
4174
|
+
"\n query CoreSDK_RentalsAll(\n $language: String\n $voffice_ids: [Int!]\n $rentalDataAttributes: [String!]! = []\n $rentalFacilityDataAttributes: [String!]! = []\n $rentalRatingDataAttributes: [String!]! = []\n $rentalFeedbackDataAttributes: [String!]! = []\n ) {\n all(language: $language, voffice_ids: $voffice_ids) {\n id\n voffice_id\n voffice_facility_id\n name\n publish\n data(attributes: $rentalDataAttributes)\n additional_voffice_data {\n beds\n }\n voffice_facility {\n id\n voffice_id\n name\n publish\n data(attributes: $rentalFacilityDataAttributes)\n }\n voffice_images {\n id\n path\n title\n description\n }\n voffice_room_images {\n id\n path\n name\n title\n description\n }\n voffice_rating {\n id\n data(attributes: $rentalRatingDataAttributes)\n }\n voffice_feedbacks {\n data(attributes: $rentalFeedbackDataAttributes)\n }\n }\n }\n": {
|
|
4175
4175
|
kind: "Document",
|
|
4176
4176
|
definitions: [{
|
|
4177
4177
|
kind: "OperationDefinition",
|
|
4178
4178
|
operation: "query",
|
|
4179
4179
|
name: {
|
|
4180
4180
|
kind: "Name",
|
|
4181
|
-
value: "
|
|
4181
|
+
value: "CoreSDK_RentalsAll"
|
|
4182
4182
|
},
|
|
4183
4183
|
variableDefinitions: [
|
|
4184
4184
|
{
|
|
@@ -4675,14 +4675,14 @@ const documents = {
|
|
|
4675
4675
|
}
|
|
4676
4676
|
}]
|
|
4677
4677
|
},
|
|
4678
|
-
"\n query
|
|
4678
|
+
"\n query CoreSDK_Search(\n $first: Int!\n $page: Int\n $language: String\n $vofficeData: VofficeData\n $basicQueryInputs: [BasicQueryInput!]\n $dataAttributes: [String!]! = []\n ) {\n search(\n first: $first\n page: $page\n language: $language\n voffice: $vofficeData\n data: $basicQueryInputs\n ) {\n paginatorInfo {\n hasMorePages\n currentPage\n }\n data {\n voffice_id\n voffice_images {\n id\n path\n title\n description\n }\n voffice_room_images {\n id\n path\n name\n title\n description\n }\n additional_voffice_data {\n alternatives {\n fromdate\n tilldate\n calc {\n total\n rent\n summary\n oTotal\n oRent\n oSummary\n discountName\n }\n }\n calc {\n total\n rent\n summary\n oTotal\n oRent\n oSummary\n discountName\n }\n }\n data(attributes: $dataAttributes)\n }\n }\n }\n": {
|
|
4679
4679
|
kind: "Document",
|
|
4680
4680
|
definitions: [{
|
|
4681
4681
|
kind: "OperationDefinition",
|
|
4682
4682
|
operation: "query",
|
|
4683
4683
|
name: {
|
|
4684
4684
|
kind: "Name",
|
|
4685
|
-
value: "
|
|
4685
|
+
value: "CoreSDK_Search"
|
|
4686
4686
|
},
|
|
4687
4687
|
variableDefinitions: [
|
|
4688
4688
|
{
|
|
@@ -5210,7 +5210,7 @@ function graphql(source) {
|
|
|
5210
5210
|
//#endregion
|
|
5211
5211
|
//#region codegen/v9/graphql-codegen/operations/rentals.ts
|
|
5212
5212
|
const rentalsAllWithoutFeedbacksQuery = graphql(`
|
|
5213
|
-
query
|
|
5213
|
+
query CoreSDK_RentalsAllWithoutFeedbacks(
|
|
5214
5214
|
$language: String
|
|
5215
5215
|
$voffice_ids: [Int!]
|
|
5216
5216
|
$rentalDataAttributes: [String!]! = []
|
|
@@ -5255,7 +5255,7 @@ const rentalsAllWithoutFeedbacksQuery = graphql(`
|
|
|
5255
5255
|
}
|
|
5256
5256
|
`);
|
|
5257
5257
|
const rentalsAllFeedbacksQuery = graphql(`
|
|
5258
|
-
query
|
|
5258
|
+
query CoreSDK_RentalsAllFeedbacks(
|
|
5259
5259
|
$language: String
|
|
5260
5260
|
$voffice_ids: [Int!]
|
|
5261
5261
|
$rentalFeedbackDataAttributes: [String!]! = []
|
|
@@ -5269,7 +5269,7 @@ const rentalsAllFeedbacksQuery = graphql(`
|
|
|
5269
5269
|
}
|
|
5270
5270
|
`);
|
|
5271
5271
|
graphql(`
|
|
5272
|
-
query
|
|
5272
|
+
query CoreSDK_RentalsAll(
|
|
5273
5273
|
$language: String
|
|
5274
5274
|
$voffice_ids: [Int!]
|
|
5275
5275
|
$rentalDataAttributes: [String!]! = []
|
|
@@ -5320,7 +5320,7 @@ graphql(`
|
|
|
5320
5320
|
//#endregion
|
|
5321
5321
|
//#region codegen/v9/graphql-codegen/operations/search.ts
|
|
5322
5322
|
const searchQuery = graphql(`
|
|
5323
|
-
query
|
|
5323
|
+
query CoreSDK_Search(
|
|
5324
5324
|
$first: Int!
|
|
5325
5325
|
$page: Int
|
|
5326
5326
|
$language: String
|
|
@@ -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
|
}
|
|
@@ -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.1.0/CHANGELOG.md`: `@v-office/website-sdk` 2.1.0 release notes.
|
|
7
8
|
- `versions/2.0.0/CHANGELOG.md`: `@v-office/website-sdk` 2.0.0 release notes.
|
|
8
9
|
|
|
9
10
|
Keep each future release in its own version directory so consumers can see which package version introduced each change.
|
|
@@ -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.1.0/MIGRATION.md`: migrate from `@v-office/website-sdk` 2.0.0 to 2.1.0.
|
|
7
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.
|
|
8
9
|
|
|
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.
|
package/instructions/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Website SDK Instructions
|
|
2
2
|
|
|
3
|
-
These instructions describe `@v-office/website-sdk` 2.
|
|
3
|
+
These instructions describe `@v-office/website-sdk` 2.1.0.
|
|
4
4
|
|
|
5
5
|
Use this directory as the consumer-facing reference for the package:
|
|
6
6
|
|
|
@@ -12,8 +12,10 @@ Use this directory as the consumer-facing reference for the package:
|
|
|
12
12
|
- `quote.md`: quote, additional services, cancellation policy, and insurance flows.
|
|
13
13
|
- `booking.md`: booking and payment option submission.
|
|
14
14
|
- `contact.md`: contact submission.
|
|
15
|
+
- `document-structured-json.md`: `sdk.static.documents.getTermsAndPrivacyPolicy` and structured document JSON rendering rules.
|
|
15
16
|
- `CHANGELOG.md`: versioned changelog index.
|
|
16
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.
|
|
17
19
|
- `versions/2.0.0/`: release-specific 2.0.0 changelog and 1.x-to-2.0.0 migration guide.
|
|
18
20
|
|
|
19
21
|
## Package
|
|
@@ -27,27 +29,27 @@ The package is ESM-only and exports the root SDK facade from `@v-office/website-
|
|
|
27
29
|
## Quick Start
|
|
28
30
|
|
|
29
31
|
```ts
|
|
30
|
-
import { createWebsiteSDK, defineWebsiteSDKOptions } from
|
|
32
|
+
import { createWebsiteSDK, defineWebsiteSDKOptions } from "@v-office/website-sdk";
|
|
31
33
|
|
|
32
34
|
const sdk = createWebsiteSDK({
|
|
33
35
|
config: {
|
|
34
|
-
backend:
|
|
35
|
-
apiEndpoint:
|
|
36
|
-
accessToken:
|
|
37
|
-
imageBaseUrl:
|
|
36
|
+
backend: "v10",
|
|
37
|
+
apiEndpoint: "https://api.example.com/graphql",
|
|
38
|
+
accessToken: "...",
|
|
39
|
+
imageBaseUrl: "https://images.example.com",
|
|
38
40
|
},
|
|
39
41
|
options: defineWebsiteSDKOptions({
|
|
40
42
|
rentalScope: {
|
|
41
|
-
propertyId:
|
|
43
|
+
propertyId: "property-1",
|
|
42
44
|
},
|
|
43
45
|
}),
|
|
44
|
-
})
|
|
46
|
+
});
|
|
45
47
|
|
|
46
48
|
try {
|
|
47
|
-
const rentals = await sdk.static.rentals.getRentals({ locale:
|
|
48
|
-
console.log(rentals)
|
|
49
|
+
const rentals = await sdk.static.rentals.getRentals({ locale: "de-DE" });
|
|
50
|
+
console.log(rentals);
|
|
49
51
|
} finally {
|
|
50
|
-
await sdk.dispose()
|
|
52
|
+
await sdk.dispose();
|
|
51
53
|
}
|
|
52
54
|
```
|
|
53
55
|
|
|
@@ -59,4 +61,4 @@ website-sdk --backend v9 filters --locale en-US
|
|
|
59
61
|
website-sdk --backend v10 search --locale de-DE --query "adults=2"
|
|
60
62
|
```
|
|
61
63
|
|
|
62
|
-
Config file examples in these docs use the 2.0.0
|
|
64
|
+
Config file examples in these docs use the flat `WebsiteSDKConfig` shape introduced in 2.0.0 and kept in 2.1.0.
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
Use the live availability API to build date-picker flows:
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
|
-
const initial = await sdk.live.availability.getInitialAvailability(input)
|
|
9
|
-
const selected = await sdk.live.availability.getStartDateSelectedAvailability(input)
|
|
8
|
+
const initial = await sdk.live.availability.getInitialAvailability(input);
|
|
9
|
+
const selected = await sdk.live.availability.getStartDateSelectedAvailability(input);
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
`getInitialAvailability` marks possible start dates. `getStartDateSelectedAvailability` marks possible end dates after a start date was selected.
|
|
@@ -17,19 +17,19 @@ Initial availability:
|
|
|
17
17
|
|
|
18
18
|
```ts
|
|
19
19
|
type InitialAvailabilityInput = {
|
|
20
|
-
locale:
|
|
21
|
-
rentalId: string
|
|
22
|
-
calculateFromDate: string
|
|
23
|
-
calculateThroughDate: string
|
|
24
|
-
}
|
|
20
|
+
locale: "de-DE" | "en-US";
|
|
21
|
+
rentalId: string;
|
|
22
|
+
calculateFromDate: string;
|
|
23
|
+
calculateThroughDate: string;
|
|
24
|
+
};
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
Start-date-selected availability:
|
|
28
28
|
|
|
29
29
|
```ts
|
|
30
30
|
type StartDateSelectedAvailabilityInput = InitialAvailabilityInput & {
|
|
31
|
-
selectedStartDate: string
|
|
32
|
-
}
|
|
31
|
+
selectedStartDate: string;
|
|
32
|
+
};
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
Sample:
|
package/instructions/booking.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
Use the live booking API to turn an available `GuestQuote` into a booking:
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
|
-
const booking = await sdk.live.booking.book(input)
|
|
8
|
+
const booking = await sdk.live.booking.book(input);
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
The `quote` must be the `GuestQuote` instance returned by `sdk.live.quote.quote(...)`, optionally updated through quote selection helpers.
|
|
@@ -14,53 +14,53 @@ The `quote` must be the `GuestQuote` instance returned by `sdk.live.quote.quote(
|
|
|
14
14
|
|
|
15
15
|
```ts
|
|
16
16
|
type BookingInput = {
|
|
17
|
-
quote: GuestQuote
|
|
17
|
+
quote: GuestQuote;
|
|
18
18
|
contact: {
|
|
19
|
-
forename: string
|
|
20
|
-
surname: string
|
|
21
|
-
title?: string
|
|
22
|
-
birthdate?: string
|
|
19
|
+
forename: string;
|
|
20
|
+
surname: string;
|
|
21
|
+
title?: string;
|
|
22
|
+
birthdate?: string;
|
|
23
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
|
-
}
|
|
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
35
|
```
|
|
36
36
|
|
|
37
37
|
Sample:
|
|
38
38
|
|
|
39
39
|
```ts
|
|
40
|
-
const quoteResult = await sdk.live.quote.quote(quoteInput)
|
|
41
|
-
if (quoteResult.status !==
|
|
40
|
+
const quoteResult = await sdk.live.quote.quote(quoteInput);
|
|
41
|
+
if (quoteResult.status !== "available") throw new Error(quoteResult.reason);
|
|
42
42
|
|
|
43
43
|
const booking = await sdk.live.booking.book({
|
|
44
44
|
quote: quoteResult.quote,
|
|
45
45
|
contact: {
|
|
46
|
-
forename:
|
|
47
|
-
surname:
|
|
48
|
-
title:
|
|
46
|
+
forename: "Jane",
|
|
47
|
+
surname: "Doe",
|
|
48
|
+
title: "Ms",
|
|
49
49
|
address: {
|
|
50
|
-
street:
|
|
51
|
-
housenumber:
|
|
52
|
-
postalcode:
|
|
53
|
-
city:
|
|
54
|
-
countryCode:
|
|
50
|
+
street: "Main Street",
|
|
51
|
+
housenumber: "1",
|
|
52
|
+
postalcode: "12345",
|
|
53
|
+
city: "Berlin",
|
|
54
|
+
countryCode: "DE",
|
|
55
55
|
},
|
|
56
56
|
contactDetails: {
|
|
57
|
-
email:
|
|
58
|
-
phone:
|
|
57
|
+
email: "jane@example.com",
|
|
58
|
+
phone: "+49123456789",
|
|
59
59
|
},
|
|
60
|
-
note:
|
|
60
|
+
note: "Please prepare a baby bed.",
|
|
61
61
|
},
|
|
62
|
-
relativeRedirectUrl:
|
|
63
|
-
})
|
|
62
|
+
relativeRedirectUrl: "/booking/payment-return",
|
|
63
|
+
});
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
`relativeRedirectUrl` is used for online payment redirects after booking creation.
|
|
@@ -123,7 +123,7 @@ Booking requests are rate-limited to one backend request per second with a queue
|
|
|
123
123
|
|
|
124
124
|
## CLI Usage
|
|
125
125
|
|
|
126
|
-
|
|
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
127
|
|
|
128
128
|
```sh
|
|
129
129
|
website-sdk --backend v10 booking book --quote-input ./quote-input.json --contact-input ./booking-contact.json --relative-redirect-url /booking/payment-return --yes
|
package/instructions/contact.md
CHANGED
|
@@ -5,29 +5,31 @@
|
|
|
5
5
|
Use the live contact API to submit a contact request:
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
|
-
await sdk.live.contact.submit(input)
|
|
8
|
+
await sdk.live.contact.submit(input);
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
`v9` submits the request through the v0 `saveMessage` action.
|
|
11
|
+
`v9` submits the request through the v0 `saveMessage` action. `v10` submits the request through the `messengeremail_newContactRequest` GraphQL operation.
|
|
12
12
|
|
|
13
13
|
## Input
|
|
14
14
|
|
|
15
15
|
```ts
|
|
16
16
|
type ContactInput = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
locale?: "de-DE" | "en-US";
|
|
18
|
+
title: string;
|
|
19
|
+
professionalTitle: string;
|
|
20
|
+
forename: string;
|
|
21
|
+
surname: string;
|
|
21
22
|
address: {
|
|
22
|
-
streetAndHousenumber: string
|
|
23
|
-
postalCode: string
|
|
24
|
-
city: string
|
|
25
|
-
countryCode: string
|
|
26
|
-
}
|
|
27
|
-
email: string
|
|
28
|
-
phone
|
|
29
|
-
|
|
30
|
-
|
|
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
|
+
};
|
|
31
33
|
```
|
|
32
34
|
|
|
33
35
|
`ContactSubmitInput` is the core SDK type name. `ContactInput` remains exported as a legacy alias.
|
|
@@ -36,6 +38,7 @@ Sample:
|
|
|
36
38
|
|
|
37
39
|
```json
|
|
38
40
|
{
|
|
41
|
+
"locale": "de-DE",
|
|
39
42
|
"title": "Ms",
|
|
40
43
|
"professionalTitle": "",
|
|
41
44
|
"forename": "Jane",
|
|
@@ -48,6 +51,7 @@ Sample:
|
|
|
48
51
|
},
|
|
49
52
|
"email": "jane@example.com",
|
|
50
53
|
"phone": "+49123456789",
|
|
54
|
+
"subject": "Question about a rental",
|
|
51
55
|
"message": "I have a question about a rental."
|
|
52
56
|
}
|
|
53
57
|
```
|
|
@@ -64,7 +68,21 @@ Successful CLI output:
|
|
|
64
68
|
}
|
|
65
69
|
```
|
|
66
70
|
|
|
67
|
-
Errors are reported as `CoreSDKError`, also exported as the compatibility alias `CMSError`. The
|
|
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
|
+
```
|
|
68
86
|
|
|
69
87
|
## Configuration
|
|
70
88
|
|