@v-office/website-sdk 2.37.1 → 3.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/dist/cli.mjs +3 -3
- package/dist/{client-D53W9Uas.mjs → client-k4Gjwp60.mjs} +735 -235
- package/dist/index.d.mts +97 -4
- package/dist/index.mjs +1 -1
- package/dist/instructions/CHANGELOG.md +2 -0
- package/dist/instructions/MIGRATION.md +2 -0
- package/dist/instructions/booking.md +1 -1
- package/dist/instructions/quote.md +23 -19
- package/dist/instructions/rentals.md +65 -4
- package/dist/instructions/search.md +2 -1
- package/dist/instructions/versions/2.38.0/CHANGELOG.md +123 -0
- package/dist/instructions/versions/2.38.0/MIGRATION.md +37 -0
- package/dist/instructions/versions/3.0.0/CHANGELOG.md +62 -0
- package/dist/instructions/versions/3.0.0/MIGRATION.md +69 -0
- package/dist/{operations-C1VMQYN2.mjs → operations-DMqLD3e2.mjs} +333 -1
- package/dist/{rentals-BxkYXAVn.mjs → rentals-BIL52z4o.mjs} +10 -14
- package/dist/{search-pFLiI6QI.mjs → search-Buua-PAS.mjs} +8 -4
- package/dist/{to-rental-highlights-BdxQPpBU.mjs → to-rental-highlights-BE6TdXYa.mjs} +23 -5
- package/dist/translations/shared/de-DE/insurance.json +1 -0
- package/dist/translations/shared/de-DE/reviews.json +5 -4
- package/dist/translations/shared/en-US/insurance.json +1 -0
- package/dist/translations/shared/en-US/reviews.json +5 -4
- package/dist/translations/v10/de-DE/core.json +17 -4
- package/dist/translations/v10/en-US/core.json +53 -40
- package/dist/translations/v9/de-DE/core.json +7 -7
- package/dist/translations/v9/de-DE/filter.json +4 -0
- package/dist/translations/v9/de-DE/rental-attributes.json +2 -2
- package/dist/translations/v9/en-US/core.json +7 -7
- package/dist/translations/v9/en-US/filter.json +4 -0
- package/dist/translations/v9/en-US/rental-attributes.json +2 -2
- package/instructions/CHANGELOG.md +2 -0
- package/instructions/MIGRATION.md +2 -0
- package/instructions/booking.md +1 -1
- package/instructions/quote.md +23 -19
- package/instructions/rentals.md +65 -4
- package/instructions/search.md +2 -1
- package/instructions/versions/2.38.0/CHANGELOG.md +123 -0
- package/instructions/versions/2.38.0/MIGRATION.md +37 -0
- package/instructions/versions/2.38.0/release.json +3 -0
- package/instructions/versions/3.0.0/CHANGELOG.md +62 -0
- package/instructions/versions/3.0.0/MIGRATION.md +69 -0
- package/instructions/versions/3.0.0/release.json +3 -0
- package/package.json +5 -4
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Migration: 2.37.1 to 2.38.0
|
|
2
|
+
|
|
3
|
+
No changes required.
|
|
4
|
+
|
|
5
|
+
## 1. Upgrade
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pnpm add @v-office/website-sdk@2.38.0
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 2. Optional: read counts from `capacity`
|
|
12
|
+
|
|
13
|
+
A site that reads guests, bedrooms, bathrooms, rooms or the living area out of `highlights` or
|
|
14
|
+
`roomSummary` ("4 Maximale Personenzahl", "88 m²") can read `rental.capacity` and
|
|
15
|
+
`item.capacity` instead. Treat a missing field as "not stated" and print nothing for it.
|
|
16
|
+
`@v-office/website-headless` 1.4.0 reads `capacity` for its counts.
|
|
17
|
+
|
|
18
|
+
## 3. Check texts you parse, compare or override
|
|
19
|
+
|
|
20
|
+
- A site that reads counts out of `highlights` or `roomSummary` by their wording breaks: the
|
|
21
|
+
guest count now reads "4 Gäste" / "4 guests". Read `capacity` instead, or upgrade
|
|
22
|
+
`@v-office/website-headless` to 1.4.0 in the same commit (it reads both).
|
|
23
|
+
- A site that compares v10 `property.propertyType` with `APARTMENT_COMPLEX` or another enum
|
|
24
|
+
value breaks: the field now holds the translated label, as on v9.
|
|
25
|
+
- German rental pages show the new rating words: a rating that read "Sehr gut" now reads
|
|
26
|
+
"Hervorragend", "Gut" reads "Sehr gut", and so on. A site that wants the old words sets them
|
|
27
|
+
with `translationOverrides` (`reviews.summary.classification.<band>`).
|
|
28
|
+
- An override of `RoomSummary.<field>.label` (v10) or `RentalAttributes.beds.label` (v9) no
|
|
29
|
+
longer changes a count line; override the `.count.one` and `.count.other` keys in the
|
|
30
|
+
CHANGELOG instead.
|
|
31
|
+
|
|
32
|
+
## 4. English pages show German texts where no English exists
|
|
33
|
+
|
|
34
|
+
v10 rentals without an English text now return the German text (before: no text), and both
|
|
35
|
+
backends list such fields in `descriptionFallbacks`. A site that hides a section without an
|
|
36
|
+
English text can check `descriptionFallbacks` instead and decide per field: show the German text
|
|
37
|
+
marked as German (`lang="de"`), or hide it.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Changelog: 3.0.0
|
|
2
|
+
|
|
3
|
+
This release reworks ERGO travel cancellation insurance on v9. The pre-contract is now created
|
|
4
|
+
after the stay booking and takes the policy holder from that booking, travelers are written to the
|
|
5
|
+
vOffice booking, and issued policies can be read and revoked. v10 does not change, and URV
|
|
6
|
+
insurance is booked as before; only the `createInsurancePreContract` call changes on every v9 site.
|
|
7
|
+
|
|
8
|
+
## Added
|
|
9
|
+
|
|
10
|
+
- `live.insurance.readPolicy({ policyNumber })` returns an ERGO policy: `status` (`active` or
|
|
11
|
+
`revoked`), `revokedAt`, `documentUrl`, `label`, `travelPeriod` and `insuredPersons`.
|
|
12
|
+
- `live.insurance.revokePolicy({ policyNumber, booking })` revokes an ERGO policy. When ERGO
|
|
13
|
+
refuses, the call rejects with ERGO's reason and nothing is removed from the booking. There is
|
|
14
|
+
no revocation deadline in the SDK; ERGO decides.
|
|
15
|
+
- Both methods reject on v9 accounts that do not use ERGO insurance.
|
|
16
|
+
- `V9QuoteCreateInsurancePreContractInput`, `V9InsuranceReadPolicyInput`,
|
|
17
|
+
`V9InsuranceRevokePolicyInput` and `V9InsurancePolicy` are exported.
|
|
18
|
+
|
|
19
|
+
## Changed
|
|
20
|
+
|
|
21
|
+
- **Breaking (v9):** `live.quote.createInsurancePreContract` takes `{ quote, booking }`, where
|
|
22
|
+
`booking` is the result of `live.booking.book`. The `customerInformation` input is gone. The
|
|
23
|
+
policy holder, address, email and mobile number come from the booking's customer. The destination
|
|
24
|
+
country is always Germany.
|
|
25
|
+
- `createInsurancePreContract` writes the selected travelers to the vOffice booking when the
|
|
26
|
+
booking has no guests yet. A failure there does not stop the insurance.
|
|
27
|
+
- Calling `createInsurancePreContract` again for the same booking and plan returns the existing
|
|
28
|
+
pre-contract with its documents instead of creating a second one. `bookInsurance` returns the
|
|
29
|
+
policy number of an insurance that is already booked instead of booking twice. A stored policy
|
|
30
|
+
only counts when ERGO still reports it as active; a revoked one is ignored, and when ERGO cannot
|
|
31
|
+
be asked the call rejects instead of booking blindly. A booking that already has an active policy for another plan rejects a plan change
|
|
32
|
+
(in `createInsurancePreContract` and `bookInsurance`); revoke that policy first.
|
|
33
|
+
- `createInsurancePreContract` returns all of ERGO's pre-contract documents (product information
|
|
34
|
+
sheet, insurance terms, data processing notice, e-commerce customer information) in
|
|
35
|
+
`preContract.documents`, with labels in the quote's locale. It rejects when ERGO's documents
|
|
36
|
+
cannot be read, because they are the § 7 VVG information the guest has to see.
|
|
37
|
+
- The booked policy document of `bookInsurance` and the SEPA debit option of the quote carry labels
|
|
38
|
+
in the quote's locale (they used to be English).
|
|
39
|
+
- `readPolicy` and `revokePolicy` list the insured travelers of ERGO's answer; a revoke answer
|
|
40
|
+
without travelers returns an empty list.
|
|
41
|
+
- The pre-contract needs the booking customer's birthdate and mobile number, and a customer
|
|
42
|
+
country that ERGO covers (DE, AT, BE, DK, FR, IT, LU, NL, PL, CZ). Otherwise the call rejects with
|
|
43
|
+
a message that names what is missing.
|
|
44
|
+
- `selectInsurance` rejects ERGO selections in which a traveler has no `birthday`.
|
|
45
|
+
- ERGO plans: one card per product, the one without excess preferred; when that leaves a single
|
|
46
|
+
card, the variant with excess is offered as a second card. Cards are ordered without excess
|
|
47
|
+
first, then by premium.
|
|
48
|
+
- More than nine travelers get no ERGO plans, only the no-insurance option.
|
|
49
|
+
- When the Hub settings or the plan search of ERGO or URV fail, the quote reports insurance as not
|
|
50
|
+
offered instead of failing.
|
|
51
|
+
- ERGO refusals now reject with ERGO's own error text.
|
|
52
|
+
- If saving the booked policy in the Hub fails after ERGO accepted the booking,
|
|
53
|
+
`bookInsurance` still returns `booked` with the policy number.
|
|
54
|
+
- Salutations are sent to ERGO as `H` (Herr, Mr., Mr) or `D` (Frau, Mrs., Ms.), and as empty for
|
|
55
|
+
everything else, such as Divers or Keine Angabe. They used to be sent as `F` or as raw text.
|
|
56
|
+
|
|
57
|
+
## Fixed
|
|
58
|
+
|
|
59
|
+
- A v9 booking with a selected ERGO plan lists the SEPA debit option in
|
|
60
|
+
`insurancePaymentOptions` before the pre-contract exists; it used to omit it.
|
|
61
|
+
|
|
62
|
+
- ERGO policy holders were taken from the first traveler instead of the booking customer.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Migration: 2.38.0 to 3.0.0
|
|
2
|
+
|
|
3
|
+
Every v9 caller of `createInsurancePreContract` has to update the call, because it now takes
|
|
4
|
+
`{ quote, booking }` (see section 2). On accounts that use URV insurance you can drop the call
|
|
5
|
+
instead: it always returns `not_required` there. Only the URV booking behavior stays the same: URV
|
|
6
|
+
is booked inside `live.booking.book`, and `bookInsurance` resolves as not required. v10 does not
|
|
7
|
+
change.
|
|
8
|
+
|
|
9
|
+
## 1. Upgrade
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
pnpm add @v-office/website-sdk@3.0.0
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## 2. Book the stay first on v9 with ERGO
|
|
16
|
+
|
|
17
|
+
The pre-contract needs the booking, so `live.booking.book` now comes before it. Replace
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
quote = await sdk.live.quote.createInsurancePreContract({ quote, customerInformation });
|
|
21
|
+
const booking = await sdk.live.booking.book({ quote, contact, relativeRedirectUrl });
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
with
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
const booking = await sdk.live.booking.book({ quote, contact, relativeRedirectUrl });
|
|
28
|
+
quote = await sdk.live.quote.createInsurancePreContract({ quote, booking });
|
|
29
|
+
quote = await sdk.live.quote.selectInsurancePayment({ quote, paymentInformation });
|
|
30
|
+
const insurance = await sdk.live.quote.bookInsurance({ quote, booking });
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The booking result already lists the SEPA debit option in `booking.insurancePaymentOptions` when an
|
|
34
|
+
ERGO plan is selected, so offer it from there.
|
|
35
|
+
|
|
36
|
+
Pass the live `booking` object that `book` returned; do not serialize it. Show the pre-contract
|
|
37
|
+
documents (`quote.insurance.preContract.documents`) to the guest before `bookInsurance`.
|
|
38
|
+
|
|
39
|
+
`createInsurancePreContract` no longer asks for `customerInformation`. The booking's customer is
|
|
40
|
+
the policy holder, so the booking form has to collect what ERGO needs:
|
|
41
|
+
|
|
42
|
+
- `contact.birthdate` and a phone number in `contact.contactDetails.phone`, which is sent as the
|
|
43
|
+
mobile number. Without them the call rejects.
|
|
44
|
+
- A country in `contact.address.countryCode` that ERGO covers: DE, AT, BE, DK, FR, IT, LU, NL, PL
|
|
45
|
+
or CZ.
|
|
46
|
+
|
|
47
|
+
Every traveler in `selectInsurance` needs a `birthday`. Offer ERGO only for up to nine travelers;
|
|
48
|
+
with more, the quote contains only the no-insurance option.
|
|
49
|
+
|
|
50
|
+
If the guest returns after a failed attempt, call `createInsurancePreContract` again. It reuses the
|
|
51
|
+
existing pre-contract instead of creating another one.
|
|
52
|
+
|
|
53
|
+
## 3. Read and revoke policies
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
const policy = await sdk.live.insurance.readPolicy({ policyNumber });
|
|
57
|
+
const revoked = await sdk.live.insurance.revokePolicy({ policyNumber, booking });
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
`revokePolicy` rejects with ERGO's reason when ERGO refuses, for example after the revocation
|
|
61
|
+
period. Both methods reject on accounts that do not use ERGO insurance, so call them only after
|
|
62
|
+
`bookInsurance` returned `booked`.
|
|
63
|
+
|
|
64
|
+
## What stays the same
|
|
65
|
+
|
|
66
|
+
- v10: nothing changes.
|
|
67
|
+
- v9 with URV insurance: booking behavior does not change; only the `createInsurancePreContract`
|
|
68
|
+
call has to change or go.
|
|
69
|
+
- `selectInsurance`, `selectInsurancePayment` and `bookInsurance` keep their inputs and outputs.
|
|
@@ -6799,6 +6799,311 @@ const documents = {
|
|
|
6799
6799
|
}
|
|
6800
6800
|
}]
|
|
6801
6801
|
},
|
|
6802
|
+
"\n query CoreSDK_RentalTexts(\n $language: String\n $voffice_ids: [Int!]\n $textAttributes: [String!]! = []\n ) {\n all(language: $language, voffice_ids: $voffice_ids) {\n voffice_id\n data(attributes: $textAttributes)\n voffice_facility {\n id\n data(attributes: $textAttributes)\n }\n }\n }\n": {
|
|
6803
|
+
kind: "Document",
|
|
6804
|
+
definitions: [{
|
|
6805
|
+
kind: "OperationDefinition",
|
|
6806
|
+
operation: "query",
|
|
6807
|
+
name: {
|
|
6808
|
+
kind: "Name",
|
|
6809
|
+
value: "CoreSDK_RentalTexts"
|
|
6810
|
+
},
|
|
6811
|
+
variableDefinitions: [
|
|
6812
|
+
{
|
|
6813
|
+
kind: "VariableDefinition",
|
|
6814
|
+
variable: {
|
|
6815
|
+
kind: "Variable",
|
|
6816
|
+
name: {
|
|
6817
|
+
kind: "Name",
|
|
6818
|
+
value: "language"
|
|
6819
|
+
}
|
|
6820
|
+
},
|
|
6821
|
+
type: {
|
|
6822
|
+
kind: "NamedType",
|
|
6823
|
+
name: {
|
|
6824
|
+
kind: "Name",
|
|
6825
|
+
value: "String"
|
|
6826
|
+
}
|
|
6827
|
+
}
|
|
6828
|
+
},
|
|
6829
|
+
{
|
|
6830
|
+
kind: "VariableDefinition",
|
|
6831
|
+
variable: {
|
|
6832
|
+
kind: "Variable",
|
|
6833
|
+
name: {
|
|
6834
|
+
kind: "Name",
|
|
6835
|
+
value: "voffice_ids"
|
|
6836
|
+
}
|
|
6837
|
+
},
|
|
6838
|
+
type: {
|
|
6839
|
+
kind: "ListType",
|
|
6840
|
+
type: {
|
|
6841
|
+
kind: "NonNullType",
|
|
6842
|
+
type: {
|
|
6843
|
+
kind: "NamedType",
|
|
6844
|
+
name: {
|
|
6845
|
+
kind: "Name",
|
|
6846
|
+
value: "Int"
|
|
6847
|
+
}
|
|
6848
|
+
}
|
|
6849
|
+
}
|
|
6850
|
+
}
|
|
6851
|
+
},
|
|
6852
|
+
{
|
|
6853
|
+
kind: "VariableDefinition",
|
|
6854
|
+
variable: {
|
|
6855
|
+
kind: "Variable",
|
|
6856
|
+
name: {
|
|
6857
|
+
kind: "Name",
|
|
6858
|
+
value: "textAttributes"
|
|
6859
|
+
}
|
|
6860
|
+
},
|
|
6861
|
+
type: {
|
|
6862
|
+
kind: "NonNullType",
|
|
6863
|
+
type: {
|
|
6864
|
+
kind: "ListType",
|
|
6865
|
+
type: {
|
|
6866
|
+
kind: "NonNullType",
|
|
6867
|
+
type: {
|
|
6868
|
+
kind: "NamedType",
|
|
6869
|
+
name: {
|
|
6870
|
+
kind: "Name",
|
|
6871
|
+
value: "String"
|
|
6872
|
+
}
|
|
6873
|
+
}
|
|
6874
|
+
}
|
|
6875
|
+
}
|
|
6876
|
+
},
|
|
6877
|
+
defaultValue: {
|
|
6878
|
+
kind: "ListValue",
|
|
6879
|
+
values: []
|
|
6880
|
+
}
|
|
6881
|
+
}
|
|
6882
|
+
],
|
|
6883
|
+
selectionSet: {
|
|
6884
|
+
kind: "SelectionSet",
|
|
6885
|
+
selections: [{
|
|
6886
|
+
kind: "Field",
|
|
6887
|
+
name: {
|
|
6888
|
+
kind: "Name",
|
|
6889
|
+
value: "all"
|
|
6890
|
+
},
|
|
6891
|
+
arguments: [{
|
|
6892
|
+
kind: "Argument",
|
|
6893
|
+
name: {
|
|
6894
|
+
kind: "Name",
|
|
6895
|
+
value: "language"
|
|
6896
|
+
},
|
|
6897
|
+
value: {
|
|
6898
|
+
kind: "Variable",
|
|
6899
|
+
name: {
|
|
6900
|
+
kind: "Name",
|
|
6901
|
+
value: "language"
|
|
6902
|
+
}
|
|
6903
|
+
}
|
|
6904
|
+
}, {
|
|
6905
|
+
kind: "Argument",
|
|
6906
|
+
name: {
|
|
6907
|
+
kind: "Name",
|
|
6908
|
+
value: "voffice_ids"
|
|
6909
|
+
},
|
|
6910
|
+
value: {
|
|
6911
|
+
kind: "Variable",
|
|
6912
|
+
name: {
|
|
6913
|
+
kind: "Name",
|
|
6914
|
+
value: "voffice_ids"
|
|
6915
|
+
}
|
|
6916
|
+
}
|
|
6917
|
+
}],
|
|
6918
|
+
selectionSet: {
|
|
6919
|
+
kind: "SelectionSet",
|
|
6920
|
+
selections: [
|
|
6921
|
+
{
|
|
6922
|
+
kind: "Field",
|
|
6923
|
+
name: {
|
|
6924
|
+
kind: "Name",
|
|
6925
|
+
value: "voffice_id"
|
|
6926
|
+
}
|
|
6927
|
+
},
|
|
6928
|
+
{
|
|
6929
|
+
kind: "Field",
|
|
6930
|
+
name: {
|
|
6931
|
+
kind: "Name",
|
|
6932
|
+
value: "data"
|
|
6933
|
+
},
|
|
6934
|
+
arguments: [{
|
|
6935
|
+
kind: "Argument",
|
|
6936
|
+
name: {
|
|
6937
|
+
kind: "Name",
|
|
6938
|
+
value: "attributes"
|
|
6939
|
+
},
|
|
6940
|
+
value: {
|
|
6941
|
+
kind: "Variable",
|
|
6942
|
+
name: {
|
|
6943
|
+
kind: "Name",
|
|
6944
|
+
value: "textAttributes"
|
|
6945
|
+
}
|
|
6946
|
+
}
|
|
6947
|
+
}]
|
|
6948
|
+
},
|
|
6949
|
+
{
|
|
6950
|
+
kind: "Field",
|
|
6951
|
+
name: {
|
|
6952
|
+
kind: "Name",
|
|
6953
|
+
value: "voffice_facility"
|
|
6954
|
+
},
|
|
6955
|
+
selectionSet: {
|
|
6956
|
+
kind: "SelectionSet",
|
|
6957
|
+
selections: [{
|
|
6958
|
+
kind: "Field",
|
|
6959
|
+
name: {
|
|
6960
|
+
kind: "Name",
|
|
6961
|
+
value: "id"
|
|
6962
|
+
}
|
|
6963
|
+
}, {
|
|
6964
|
+
kind: "Field",
|
|
6965
|
+
name: {
|
|
6966
|
+
kind: "Name",
|
|
6967
|
+
value: "data"
|
|
6968
|
+
},
|
|
6969
|
+
arguments: [{
|
|
6970
|
+
kind: "Argument",
|
|
6971
|
+
name: {
|
|
6972
|
+
kind: "Name",
|
|
6973
|
+
value: "attributes"
|
|
6974
|
+
},
|
|
6975
|
+
value: {
|
|
6976
|
+
kind: "Variable",
|
|
6977
|
+
name: {
|
|
6978
|
+
kind: "Name",
|
|
6979
|
+
value: "textAttributes"
|
|
6980
|
+
}
|
|
6981
|
+
}
|
|
6982
|
+
}]
|
|
6983
|
+
}]
|
|
6984
|
+
}
|
|
6985
|
+
}
|
|
6986
|
+
]
|
|
6987
|
+
}
|
|
6988
|
+
}]
|
|
6989
|
+
}
|
|
6990
|
+
}]
|
|
6991
|
+
},
|
|
6992
|
+
"\n query CoreSDK_FacilityTexts($language: String, $textAttributes: [String!]! = []) {\n facilities: voffice_facilities(language: $language) {\n id\n data(attributes: $textAttributes)\n }\n }\n": {
|
|
6993
|
+
kind: "Document",
|
|
6994
|
+
definitions: [{
|
|
6995
|
+
kind: "OperationDefinition",
|
|
6996
|
+
operation: "query",
|
|
6997
|
+
name: {
|
|
6998
|
+
kind: "Name",
|
|
6999
|
+
value: "CoreSDK_FacilityTexts"
|
|
7000
|
+
},
|
|
7001
|
+
variableDefinitions: [{
|
|
7002
|
+
kind: "VariableDefinition",
|
|
7003
|
+
variable: {
|
|
7004
|
+
kind: "Variable",
|
|
7005
|
+
name: {
|
|
7006
|
+
kind: "Name",
|
|
7007
|
+
value: "language"
|
|
7008
|
+
}
|
|
7009
|
+
},
|
|
7010
|
+
type: {
|
|
7011
|
+
kind: "NamedType",
|
|
7012
|
+
name: {
|
|
7013
|
+
kind: "Name",
|
|
7014
|
+
value: "String"
|
|
7015
|
+
}
|
|
7016
|
+
}
|
|
7017
|
+
}, {
|
|
7018
|
+
kind: "VariableDefinition",
|
|
7019
|
+
variable: {
|
|
7020
|
+
kind: "Variable",
|
|
7021
|
+
name: {
|
|
7022
|
+
kind: "Name",
|
|
7023
|
+
value: "textAttributes"
|
|
7024
|
+
}
|
|
7025
|
+
},
|
|
7026
|
+
type: {
|
|
7027
|
+
kind: "NonNullType",
|
|
7028
|
+
type: {
|
|
7029
|
+
kind: "ListType",
|
|
7030
|
+
type: {
|
|
7031
|
+
kind: "NonNullType",
|
|
7032
|
+
type: {
|
|
7033
|
+
kind: "NamedType",
|
|
7034
|
+
name: {
|
|
7035
|
+
kind: "Name",
|
|
7036
|
+
value: "String"
|
|
7037
|
+
}
|
|
7038
|
+
}
|
|
7039
|
+
}
|
|
7040
|
+
}
|
|
7041
|
+
},
|
|
7042
|
+
defaultValue: {
|
|
7043
|
+
kind: "ListValue",
|
|
7044
|
+
values: []
|
|
7045
|
+
}
|
|
7046
|
+
}],
|
|
7047
|
+
selectionSet: {
|
|
7048
|
+
kind: "SelectionSet",
|
|
7049
|
+
selections: [{
|
|
7050
|
+
kind: "Field",
|
|
7051
|
+
alias: {
|
|
7052
|
+
kind: "Name",
|
|
7053
|
+
value: "facilities"
|
|
7054
|
+
},
|
|
7055
|
+
name: {
|
|
7056
|
+
kind: "Name",
|
|
7057
|
+
value: "voffice_facilities"
|
|
7058
|
+
},
|
|
7059
|
+
arguments: [{
|
|
7060
|
+
kind: "Argument",
|
|
7061
|
+
name: {
|
|
7062
|
+
kind: "Name",
|
|
7063
|
+
value: "language"
|
|
7064
|
+
},
|
|
7065
|
+
value: {
|
|
7066
|
+
kind: "Variable",
|
|
7067
|
+
name: {
|
|
7068
|
+
kind: "Name",
|
|
7069
|
+
value: "language"
|
|
7070
|
+
}
|
|
7071
|
+
}
|
|
7072
|
+
}],
|
|
7073
|
+
selectionSet: {
|
|
7074
|
+
kind: "SelectionSet",
|
|
7075
|
+
selections: [{
|
|
7076
|
+
kind: "Field",
|
|
7077
|
+
name: {
|
|
7078
|
+
kind: "Name",
|
|
7079
|
+
value: "id"
|
|
7080
|
+
}
|
|
7081
|
+
}, {
|
|
7082
|
+
kind: "Field",
|
|
7083
|
+
name: {
|
|
7084
|
+
kind: "Name",
|
|
7085
|
+
value: "data"
|
|
7086
|
+
},
|
|
7087
|
+
arguments: [{
|
|
7088
|
+
kind: "Argument",
|
|
7089
|
+
name: {
|
|
7090
|
+
kind: "Name",
|
|
7091
|
+
value: "attributes"
|
|
7092
|
+
},
|
|
7093
|
+
value: {
|
|
7094
|
+
kind: "Variable",
|
|
7095
|
+
name: {
|
|
7096
|
+
kind: "Name",
|
|
7097
|
+
value: "textAttributes"
|
|
7098
|
+
}
|
|
7099
|
+
}
|
|
7100
|
+
}]
|
|
7101
|
+
}]
|
|
7102
|
+
}
|
|
7103
|
+
}]
|
|
7104
|
+
}
|
|
7105
|
+
}]
|
|
7106
|
+
},
|
|
6802
7107
|
"\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 total\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 foundExactMatch\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 matchingPeriods {\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": {
|
|
6803
7108
|
kind: "Document",
|
|
6804
7109
|
definitions: [{
|
|
@@ -8059,6 +8364,33 @@ graphql(`
|
|
|
8059
8364
|
}
|
|
8060
8365
|
}
|
|
8061
8366
|
`);
|
|
8367
|
+
/** Only the texts of rentals and their facility, in one language: what the description
|
|
8368
|
+
* fallback marker compares against, and nothing else. */
|
|
8369
|
+
const rentalTextsQuery = graphql(`
|
|
8370
|
+
query CoreSDK_RentalTexts(
|
|
8371
|
+
$language: String
|
|
8372
|
+
$voffice_ids: [Int!]
|
|
8373
|
+
$textAttributes: [String!]! = []
|
|
8374
|
+
) {
|
|
8375
|
+
all(language: $language, voffice_ids: $voffice_ids) {
|
|
8376
|
+
voffice_id
|
|
8377
|
+
data(attributes: $textAttributes)
|
|
8378
|
+
voffice_facility {
|
|
8379
|
+
id
|
|
8380
|
+
data(attributes: $textAttributes)
|
|
8381
|
+
}
|
|
8382
|
+
}
|
|
8383
|
+
}
|
|
8384
|
+
`);
|
|
8385
|
+
/** Only the texts of every facility, in one language, for object-group facility relations. */
|
|
8386
|
+
const facilityTextsQuery = graphql(`
|
|
8387
|
+
query CoreSDK_FacilityTexts($language: String, $textAttributes: [String!]! = []) {
|
|
8388
|
+
facilities: voffice_facilities(language: $language) {
|
|
8389
|
+
id
|
|
8390
|
+
data(attributes: $textAttributes)
|
|
8391
|
+
}
|
|
8392
|
+
}
|
|
8393
|
+
`);
|
|
8062
8394
|
//#endregion
|
|
8063
8395
|
//#region codegen/v9/graphql-codegen/operations/search.ts
|
|
8064
8396
|
const searchQuery = graphql(`
|
|
@@ -8178,4 +8510,4 @@ const voucherValidityQuery = graphql(`
|
|
|
8178
8510
|
}
|
|
8179
8511
|
`);
|
|
8180
8512
|
//#endregion
|
|
8181
|
-
export {
|
|
8513
|
+
export { parseVofficeRatingData as C, parseVofficeFeedbackData as S, VofficeUnitDataPropertyCategoryValues as _, hubFiltersQuery as a, parseJsonData as b, rentalIdsQuery as c, rentalsAllByFacilityObjectGroupsWithoutFeedbacksQuery as d, rentalsAllFeedbacksQuery as f, VofficeUnitDataPropertyCategoryLabelKeys as g, VofficeUnitDataFieldSchemas as h, facilityTextsQuery as i, rentalRegionsQuery as l, RegionSchema as m, mapSearchQuery as n, hubRentalDataQuery as o, rentalsAllWithoutFeedbacksQuery as p, searchQuery as r, rentalFacilitiesForObjectGroupRelationQuery as s, voucherValidityQuery as t, rentalTextsQuery as u, VofficeUnitDataPropertyMetadata as v, parseVofficeUnitData as w, parseVofficeFacilityData as x, customDataAttribute as y };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Qt as V9_FACILITY_ATTRIBUTE_KEYS } from "./client-
|
|
2
|
-
import { S as
|
|
3
|
-
import { a as toFacilityImages, c as
|
|
4
|
-
import { CoreSDKError, makeTranslate, renderResolvedCustomAttribute, toCustomAttributeList, toResolvedCustomAttributeCategoryTranslationKey } from "@v-office/sdk-core";
|
|
1
|
+
import { Qt as V9_FACILITY_ATTRIBUTE_KEYS } from "./client-k4Gjwp60.mjs";
|
|
2
|
+
import { S as parseVofficeFeedbackData, _ as VofficeUnitDataPropertyCategoryValues, a as hubFiltersQuery, c as rentalIdsQuery, d as rentalsAllByFacilityObjectGroupsWithoutFeedbacksQuery, f as rentalsAllFeedbacksQuery, g as VofficeUnitDataPropertyCategoryLabelKeys, h as VofficeUnitDataFieldSchemas, i as facilityTextsQuery, p as rentalsAllWithoutFeedbacksQuery, s as rentalFacilitiesForObjectGroupRelationQuery, u as rentalTextsQuery, v as VofficeUnitDataPropertyMetadata, w as parseVofficeUnitData, x as parseVofficeFacilityData } from "./operations-DMqLD3e2.mjs";
|
|
3
|
+
import { a as toFacilityImages, c as toCapacity, i as toLocation, l as toAddress, o as toImages, r as renderVofficePropertyAttribute, t as toRentalHighlights, u as toLocalizedString } from "./to-rental-highlights-BE6TdXYa.mjs";
|
|
4
|
+
import { CoreSDKError, makeTranslate, renderResolvedCustomAttribute, toCustomAttributeList, toResolvedCustomAttributeCategoryTranslationKey, toReviewClassification } from "@v-office/sdk-core";
|
|
5
5
|
import { Effect } from "effect";
|
|
6
6
|
//#region src/legacy-v9/parser/rentals/to-description.ts
|
|
7
7
|
const toDescription = (data, locale) => {
|
|
@@ -270,13 +270,6 @@ const toRentalVicinity = ({ locale, translations, attributes }) => Effect.gen(fu
|
|
|
270
270
|
});
|
|
271
271
|
//#endregion
|
|
272
272
|
//#region src/legacy-v9/parser/rentals/to-reviews.ts
|
|
273
|
-
const toClassification = (rating) => {
|
|
274
|
-
if (rating >= 4.5) return "excellent";
|
|
275
|
-
if (rating >= 4) return "very-good";
|
|
276
|
-
if (rating >= 3) return "good";
|
|
277
|
-
if (rating >= 2) return "fair";
|
|
278
|
-
return "poor";
|
|
279
|
-
};
|
|
280
273
|
const roundRatingUp = (rating) => Math.ceil(Number(rating.toFixed(6)) * 10) / 10;
|
|
281
274
|
const renderTemplate = (template, values) => Object.entries(values).reduce((result, [key, value]) => result.replaceAll(`{${key}}`, value), template);
|
|
282
275
|
const toTravelDate = (locale, value) => {
|
|
@@ -368,8 +361,9 @@ const toReviews = ({ locale, translations, rental, options }) => Effect.gen(func
|
|
|
368
361
|
if (ratings.length === 0) return { items };
|
|
369
362
|
const summaryRating = roundRatingUp(ratings.reduce((ratingSum, rating) => ratingSum + rating, 0) / ratings.length);
|
|
370
363
|
const summaryRatingTemplate = yield* translations.translate(locale, "reviews.summary.rating");
|
|
371
|
-
const
|
|
372
|
-
const
|
|
364
|
+
const pluralCountTemplate = yield* translations.translate(locale, "reviews.summary.count");
|
|
365
|
+
const summaryCountTemplate = ratings.length === 1 ? yield* translations.translate(locale, "reviews.summary.count.one", pluralCountTemplate) : pluralCountTemplate;
|
|
366
|
+
const classification = toReviewClassification(summaryRating);
|
|
373
367
|
const categories = toCategories({
|
|
374
368
|
items: parsedItems,
|
|
375
369
|
criteria: options.criteria,
|
|
@@ -487,6 +481,8 @@ const toRentalRentalsOutput = ({ rental, locale, translations, imageProxyBaseUrl
|
|
|
487
481
|
if (translatedRentalType != null) item.rentalType = translatedRentalType;
|
|
488
482
|
if (location != null) item.location = location;
|
|
489
483
|
if (Object.keys(address).length > 0) item.address = address;
|
|
484
|
+
const capacity = toCapacity(data);
|
|
485
|
+
if (capacity != null) item.capacity = capacity;
|
|
490
486
|
if (Object.keys(description).length > 0) item.description = description;
|
|
491
487
|
if (images.length > 0) item.images = images;
|
|
492
488
|
if (attributes != null) item.attributes = attributes;
|
|
@@ -584,4 +580,4 @@ const associateRentalsWithFacilitiesByObjectGroups = ({ attributeId, facilities,
|
|
|
584
580
|
//#region src/legacy-v9/runtime/rentals.ts
|
|
585
581
|
const defaultRentalDataAttributes = Object.keys(VofficeUnitDataFieldSchemas);
|
|
586
582
|
//#endregion
|
|
587
|
-
export { associateRentalsWithFacilitiesByObjectGroups, defaultRentalDataAttributes, hubFiltersQuery, rentalFacilitiesForObjectGroupRelationQuery, rentalIdsQuery, rentalsAllByFacilityObjectGroupsWithoutFeedbacksQuery, rentalsAllFeedbacksQuery, rentalsAllWithoutFeedbacksQuery, toRentalRentalsOutput };
|
|
583
|
+
export { associateRentalsWithFacilitiesByObjectGroups, defaultRentalDataAttributes, facilityTextsQuery, hubFiltersQuery, parseVofficeFacilityData, parseVofficeUnitData, rentalFacilitiesForObjectGroupRelationQuery, rentalIdsQuery, rentalTextsQuery, rentalsAllByFacilityObjectGroupsWithoutFeedbacksQuery, rentalsAllFeedbacksQuery, rentalsAllWithoutFeedbacksQuery, toRentalRentalsOutput };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as makeV9CustomAttributeFilterCapabilities, c as parseQueryParameters, d as toVoucherCode, l as toQueryString, o as toBasicQueryInputs, s as collectQueryParameters, u as applyVofficeFilterDerivedBasicQueryInputs } from "./client-
|
|
2
|
-
import {
|
|
3
|
-
import { i as toLocation, n as toV9RentalHighlightKey, o as toImages, s as
|
|
1
|
+
import { a as makeV9CustomAttributeFilterCapabilities, c as parseQueryParameters, d as toVoucherCode, l as toQueryString, o as toBasicQueryInputs, s as collectQueryParameters, u as applyVofficeFilterDerivedBasicQueryInputs } from "./client-k4Gjwp60.mjs";
|
|
2
|
+
import { n as mapSearchQuery, r as searchQuery, w as parseVofficeUnitData } from "./operations-DMqLD3e2.mjs";
|
|
3
|
+
import { c as toCapacity, i as toLocation, l as toAddress, n as toV9RentalHighlightKey, o as toImages, s as CAPACITY_DATA_ATTRIBUTES, t as toRentalHighlights } from "./to-rental-highlights-BE6TdXYa.mjs";
|
|
4
4
|
import { CoreSDKError, STABLE_SEARCH_INPUTS, daysBetweenLocalDates, expandCustomAttributeFilterCompositions, parseChildrenAges, parseOccupancyCount, resolveExpandedCompositions, toFormattedSearchPrice, toIsoDateFromPeriodQueryDate, toStableSearchInputBackendQueryKeys, toStableSearchInputParameterValues, toStableSearchInputQueryKeys, toUnusedFilterKeys } from "@v-office/sdk-core";
|
|
5
5
|
import { Effect } from "effect";
|
|
6
6
|
//#region src/legacy-v9/parser/search/input/search-input-error.ts
|
|
@@ -293,6 +293,8 @@ const toSearchOutputItem = ({ locale, imageProxyBaseUrl, rentalHighlightPrioriti
|
|
|
293
293
|
};
|
|
294
294
|
const address = toAddress(data, locale);
|
|
295
295
|
if (Object.keys(address).length > 0) item.address = address;
|
|
296
|
+
const capacity = toCapacity(data);
|
|
297
|
+
if (capacity != null) item.capacity = capacity;
|
|
296
298
|
const images = toImages(imageProxyBaseUrl, rental, locale, data);
|
|
297
299
|
if (images.length > 0) item.images = images;
|
|
298
300
|
const highlights = yield* toRentalHighlights({
|
|
@@ -326,7 +328,8 @@ const toSearchPeriods = ({ locale, periods }) => Effect.succeed((periods ?? []).
|
|
|
326
328
|
//#region src/legacy-v9/runtime/search.ts
|
|
327
329
|
/**
|
|
328
330
|
* The rental data `toSearchOutputItem` reads: name, address with the region name,
|
|
329
|
-
* images, and the v9 attribute behind each configured
|
|
331
|
+
* images, the counts behind `capacity`, and the v9 attribute behind each configured
|
|
332
|
+
* highlight key. Requesting
|
|
330
333
|
* every known attribute instead more than doubles the response for the same output.
|
|
331
334
|
*/
|
|
332
335
|
const toSearchDataAttributes = (rentalHighlightPrioritization) => [.../* @__PURE__ */ new Set([
|
|
@@ -334,6 +337,7 @@ const toSearchDataAttributes = (rentalHighlightPrioritization) => [.../* @__PURE
|
|
|
334
337
|
"address",
|
|
335
338
|
"regionName",
|
|
336
339
|
"images",
|
|
340
|
+
...CAPACITY_DATA_ATTRIBUTES,
|
|
337
341
|
...rentalHighlightPrioritization.flatMap((key) => toV9RentalHighlightKey(key) ?? [])
|
|
338
342
|
])];
|
|
339
343
|
const mapSearchDataAttributes = ["loc"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { localeToLanguage, makeTranslate, renderLabeledAttributeValue, renderResolvedCustomAttribute, toCountry } from "@v-office/sdk-core";
|
|
1
|
+
import { v as VofficeUnitDataPropertyMetadata } from "./operations-DMqLD3e2.mjs";
|
|
2
|
+
import { localeToLanguage, makeTranslate, renderLabeledAttributeValue, renderResolvedCustomAttribute, toCountLabelKey, toCountry, toRentalCapacity } from "@v-office/sdk-core";
|
|
3
3
|
import { Effect } from "effect";
|
|
4
4
|
//#region src/legacy-v9/parser/rentals/to-localized-string.ts
|
|
5
5
|
const isNonEmptyString$1 = (value) => typeof value === "string" && value.length > 0;
|
|
@@ -37,6 +37,25 @@ const toAddress = (data, locale) => {
|
|
|
37
37
|
return address;
|
|
38
38
|
};
|
|
39
39
|
//#endregion
|
|
40
|
+
//#region src/legacy-v9/parser/rentals/to-capacity.ts
|
|
41
|
+
/** The unit data `toCapacity` reads; search requests them next to its highlight attributes. */
|
|
42
|
+
const CAPACITY_DATA_ATTRIBUTES = [
|
|
43
|
+
"beds",
|
|
44
|
+
"bedrooms",
|
|
45
|
+
"bathrooms",
|
|
46
|
+
"rooms",
|
|
47
|
+
"squareMeters"
|
|
48
|
+
];
|
|
49
|
+
/** `capacity` from the unit data. v9 counts sleeping places (`beds`) and states no adults. */
|
|
50
|
+
const toCapacity = (data) => toRentalCapacity({
|
|
51
|
+
maxGuests: data.known.beds,
|
|
52
|
+
maxAdults: void 0,
|
|
53
|
+
bedrooms: data.known.bedrooms,
|
|
54
|
+
bathrooms: data.known.bathrooms,
|
|
55
|
+
rooms: data.known.rooms,
|
|
56
|
+
livingAreaSqm: data.known.squareMeters
|
|
57
|
+
});
|
|
58
|
+
//#endregion
|
|
40
59
|
//#region src/legacy-v9/parser/rentals/to-image.ts
|
|
41
60
|
const IMAGE_ASPECT_RATIO = 3 / 2;
|
|
42
61
|
const IMAGE_SRCSET_WIDTHS = [
|
|
@@ -289,7 +308,6 @@ const toLocation = (location) => {
|
|
|
289
308
|
};
|
|
290
309
|
//#endregion
|
|
291
310
|
//#region src/legacy-v9/parser/rentals/render-property-attribute.ts
|
|
292
|
-
const countLabelKey = (labelKey, value) => `${labelKey.slice(0, -6)}.count.${value === 1 ? "one" : "other"}`;
|
|
293
311
|
const renderVofficePropertyAttribute = ({ key, metadata, locale, translate, value }) => Effect.gen(function* () {
|
|
294
312
|
if (metadata.sourceType === "OPT") {
|
|
295
313
|
if (typeof value !== "number" || !Number.isInteger(value)) return void 0;
|
|
@@ -303,7 +321,7 @@ const renderVofficePropertyAttribute = ({ key, metadata, locale, translate, valu
|
|
|
303
321
|
if (value === 0) return void 0;
|
|
304
322
|
if (key.endsWith("distance")) return `${label}: ${value}m`;
|
|
305
323
|
if (key === "squareMeters") return `${value} m²`;
|
|
306
|
-
return `${value} ${yield* translate(
|
|
324
|
+
return `${value} ${yield* translate(toCountLabelKey(metadata.labelKey, value), label)}`;
|
|
307
325
|
}
|
|
308
326
|
return renderLabeledAttributeValue({
|
|
309
327
|
key,
|
|
@@ -701,4 +719,4 @@ const toRentalHighlights = ({ locale, translations, highlightPrioritization, cus
|
|
|
701
719
|
return highlights;
|
|
702
720
|
});
|
|
703
721
|
//#endregion
|
|
704
|
-
export { toFacilityImages as a,
|
|
722
|
+
export { toFacilityImages as a, toCapacity as c, toLocation as i, toAddress as l, toV9RentalHighlightKey as n, toImages as o, renderVofficePropertyAttribute as r, CAPACITY_DATA_ATTRIBUTES as s, toRentalHighlights as t, toLocalizedString as u };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
+
"insurance.notOffered.label": "Keine Versicherung",
|
|
2
3
|
"insurance.none.label": "Ich verzichte auf den angebotenen Reiseschutz",
|
|
3
4
|
"insurance.none.description": "Im Fall einer Stornierung nach der kostenlosen Stornofrist trage ich das Risiko und die anfallenden Kosten selbst.",
|
|
4
5
|
"insurance.ergo.resources.inf.label": "Produktbeschreibung",
|