@v-office/website-sdk 2.38.0 → 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/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { AdditionalServiceLimitExceeded, AvailabilityEndDateOption, AvailabilityGetInitialAvailabilityInput, AvailabilityGetInitialAvailabilityInput as AvailabilityGetInitialAvailabilityInput$1, AvailabilityGetInitialAvailabilityOutput, AvailabilityGetInitialAvailabilityOutput as AvailabilityGetInitialAvailabilityOutput$1, AvailabilityGetStartDateSelectedAvailabilityInput, AvailabilityGetStartDateSelectedAvailabilityInput as AvailabilityGetStartDateSelectedAvailabilityInput$1, AvailabilityGetStartDateSelectedAvailabilityOutput, AvailabilityGetStartDateSelectedAvailabilityOutput as AvailabilityGetStartDateSelectedAvailabilityOutput$1, AvailabilityService, BackendKind, BookingBankTransferDetails, BookingBankTransferDetails as BookingBankTransferDetails$1, BookingBookInput, BookingBookInput as BookingBookInput$1, BookingBookOutput, BookingBookOutput as BookingBookOutput$1, BookingPayment, BookingPaymentAlternative, BookingPaymentOption, BookingPaymentScheduleItem, BookingPaymentScheduleKind, BookingPaymentScheduleLine, BookingService, ContactService, ContactSubmitInput, ContactSubmitInput as ContactSubmitInput$1, ContactSubmitOutput, ContactSubmitOutput as ContactSubmitOutput$1, ContactSubmitValidationIssue, ContactSubmitValidationIssueCode, CoreSDKError, CoreSDKError as CMSError, CoreSDKError as CoreSDKError$1, CustomAttributeCatalog, CustomAttributeCatalogDefinitionInput, CustomAttributeCatalogInput, CustomAttributeCatalogSchema, CustomAttributeCategoryKey, CustomAttributeFilterCategoryKey, CustomAttributeFilterDefinition, CustomAttributeFilterDefinition as CustomAttributeFilterDefinition$1, CustomAttributeFilterExpression, CustomAttributeFilterLabel, CustomAttributeFilterNumericBounds, CustomAttributeFilterOption, CustomAttributeOverridesInput, CustomAttributeRegistry, CustomAttributeRegistrySnapshot, CustomAttributeRegistrySnapshot as CustomAttributeRegistrySnapshot$1, CustomAttributeSelection, DocumentsGetTermsAndPrivacyPolicyInput, DocumentsGetTermsAndPrivacyPolicyInput as DocumentsGetTermsAndPrivacyPolicyInput$1, DocumentsGetTermsAndPrivacyPolicyOutput, DocumentsGetTermsAndPrivacyPolicyOutput as DocumentsGetTermsAndPrivacyPolicyOutput$1, DocumentsService, FilterGetFiltersInput, FilterGetFiltersInput as FilterGetFiltersInput$1, FilterGetFiltersOutput, FilterGetFiltersOutput as FilterGetFiltersOutput$1, FilterService, GuestQuote, GuestQuoteInput, GuestQuoteInsurance, GuestQuoteResult, GuestQuoteSchema, GuestQuoteSelectionResult, GuestQuoteVoucher, InsuranceBookingOutput, InsuranceCustomerInformationInput, InsurancePaymentInformationInput, InsurancePaymentOptionOutput, InsurancePreContractOutput, InvalidAdditionalServiceQuantity, LocalDateString, Locale, Locale as Locale$1, LocaleSchema, QuoteAddAdditionalServiceInput, QuoteAddAdditionalServiceOutput, QuoteBookInsuranceInput, QuoteBookInsuranceOutput, QuoteClearAdditionalServicesInput, QuoteClearAdditionalServicesOutput, QuoteCreateInsurancePreContractInput, QuoteCreateInsurancePreContractOutput, QuoteQuoteInput, QuoteQuoteInput as QuoteQuoteInput$1, QuoteQuoteOutput, QuoteQuoteOutput as QuoteQuoteOutput$1, QuoteRemoveAdditionalServiceInput, QuoteRemoveAdditionalServiceOutput, QuoteSelectCancellationPolicyInput, QuoteSelectCancellationPolicyOutput, QuoteSelectInsuranceInput, QuoteSelectInsuranceOutput, QuoteSelectInsurancePaymentInput, QuoteSelectInsurancePaymentOutput, QuoteService as QuoteService$1, RegionsGetRegionsInput, RegionsGetRegionsInput as RegionsGetRegionsInput$1, RegionsService, RentalCapacity, RentalGetRentalsInput, RentalGetRentalsInput as RentalGetRentalsInput$1, RentalGetRentalsOutput, RentalGetRentalsOutput as RentalGetRentalsOutput$1, RentalHighlightPrioritizationKey, RentalHighlightPrioritizationKey as RentalHighlightPrioritizationKey$1, RentalPropertyHighlightPrioritizationKey, RentalPropertyHighlightPrioritizationKey as RentalPropertyHighlightPrioritizationKey$1, RentalScope, RentalService, ResolvedCustomAttribute, SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS, SearchAllRentalsAtOnceInput, SearchAllRentalsAtOnceInput as SearchAllRentalsAtOnceInput$1, SearchMapSearchInput, SearchMapSearchInput as SearchMapSearchInput$1, SearchMapSearchInputSchema, SearchMapSearchOutput, SearchMapSearchOutput as SearchMapSearchOutput$1, SearchMapSearchOutputItem, SearchMapSearchOutputSchema, SearchSearchAlternative, SearchSearchFieldOrderBy, SearchSearchFieldOrderBySchema, SearchSearchFieldSort, SearchSearchFieldSort as SearchSearchFieldSort$1, SearchSearchFieldSortSchema, SearchSearchInput, SearchSearchInput as SearchSearchInput$1, SearchSearchInputSchema, SearchSearchOutput, SearchSearchOutput as SearchSearchOutput$1, SearchSearchOutputItem, SearchSearchOutputSchema, SearchSearchPriceSort, SearchSearchPriceSortSchema, SearchSearchRandomSort, SearchSearchRandomSortSchema, SearchSearchRatingSort, SearchSearchRatingSortSchema, SearchSearchSort, SearchSearchSort as SearchSearchSort$1, SearchSearchSortSchema, SearchService, SearchSortDirection, SearchSortDirectionSchema, SelectableInsuranceOptionOutput, SelectedInsuranceInformationInput, SubmittableBookingPaymentOption, SubmittableBookingPaymentOption as SubmittableBookingPaymentOption$1, TranslationOverrides, TranslationOverrides as TranslationOverrides$1, UnknownAdditionalService, V10CoreConfig, V10RateBudget, V9OnlyCustomAttributeInput, WebsiteRegion, WebsiteRegions, WebsiteRegions as WebsiteRegions$1, defineCustomAttributes, defineCustomAttributesFromUnknown, fetchCustomAttributeCatalog, parseCustomAttributeCatalog, validateContactSubmitInput } from "@v-office/sdk-core";
1
+ import { AdditionalServiceLimitExceeded, AvailabilityEndDateOption, AvailabilityGetInitialAvailabilityInput, AvailabilityGetInitialAvailabilityInput as AvailabilityGetInitialAvailabilityInput$1, AvailabilityGetInitialAvailabilityOutput, AvailabilityGetInitialAvailabilityOutput as AvailabilityGetInitialAvailabilityOutput$1, AvailabilityGetStartDateSelectedAvailabilityInput, AvailabilityGetStartDateSelectedAvailabilityInput as AvailabilityGetStartDateSelectedAvailabilityInput$1, AvailabilityGetStartDateSelectedAvailabilityOutput, AvailabilityGetStartDateSelectedAvailabilityOutput as AvailabilityGetStartDateSelectedAvailabilityOutput$1, AvailabilityService, BackendKind, BookingBankTransferDetails, BookingBankTransferDetails as BookingBankTransferDetails$1, BookingBookInput, BookingBookInput as BookingBookInput$1, BookingBookOutput, BookingBookOutput as BookingBookOutput$1, BookingPayment, BookingPaymentAlternative, BookingPaymentOption, BookingPaymentScheduleItem, BookingPaymentScheduleKind, BookingPaymentScheduleLine, BookingService, ContactService, ContactSubmitInput, ContactSubmitInput as ContactSubmitInput$1, ContactSubmitOutput, ContactSubmitOutput as ContactSubmitOutput$1, ContactSubmitValidationIssue, ContactSubmitValidationIssueCode, CoreSDKError, CoreSDKError as CMSError, CoreSDKError as CoreSDKError$1, CustomAttributeCatalog, CustomAttributeCatalogDefinitionInput, CustomAttributeCatalogInput, CustomAttributeCatalogSchema, CustomAttributeCategoryKey, CustomAttributeFilterCategoryKey, CustomAttributeFilterDefinition, CustomAttributeFilterDefinition as CustomAttributeFilterDefinition$1, CustomAttributeFilterExpression, CustomAttributeFilterLabel, CustomAttributeFilterNumericBounds, CustomAttributeFilterOption, CustomAttributeOverridesInput, CustomAttributeRegistry, CustomAttributeRegistrySnapshot, CustomAttributeRegistrySnapshot as CustomAttributeRegistrySnapshot$1, CustomAttributeSelection, DocumentsGetTermsAndPrivacyPolicyInput, DocumentsGetTermsAndPrivacyPolicyInput as DocumentsGetTermsAndPrivacyPolicyInput$1, DocumentsGetTermsAndPrivacyPolicyOutput, DocumentsGetTermsAndPrivacyPolicyOutput as DocumentsGetTermsAndPrivacyPolicyOutput$1, DocumentsService, FilterGetFiltersInput, FilterGetFiltersInput as FilterGetFiltersInput$1, FilterGetFiltersOutput, FilterGetFiltersOutput as FilterGetFiltersOutput$1, FilterService, GuestQuote, GuestQuote as GuestQuote$1, GuestQuoteInput, GuestQuoteInsurance, GuestQuoteResult, GuestQuoteSchema, GuestQuoteSelectionResult, GuestQuoteVoucher, InsuranceBookingOutput, InsuranceCustomerInformationInput, InsurancePaymentInformationInput, InsurancePaymentOptionOutput, InsurancePreContractOutput, InvalidAdditionalServiceQuantity, LocalDateString, Locale, Locale as Locale$1, LocaleSchema, QuoteAddAdditionalServiceInput, QuoteAddAdditionalServiceOutput, QuoteBookInsuranceInput, QuoteBookInsuranceOutput, QuoteClearAdditionalServicesInput, QuoteClearAdditionalServicesOutput, QuoteCreateInsurancePreContractInput, QuoteCreateInsurancePreContractOutput, QuoteQuoteInput, QuoteQuoteInput as QuoteQuoteInput$1, QuoteQuoteOutput, QuoteQuoteOutput as QuoteQuoteOutput$1, QuoteRemoveAdditionalServiceInput, QuoteRemoveAdditionalServiceOutput, QuoteSelectCancellationPolicyInput, QuoteSelectCancellationPolicyOutput, QuoteSelectInsuranceInput, QuoteSelectInsuranceOutput, QuoteSelectInsurancePaymentInput, QuoteSelectInsurancePaymentOutput, QuoteService as QuoteService$1, RegionsGetRegionsInput, RegionsGetRegionsInput as RegionsGetRegionsInput$1, RegionsService, RentalCapacity, RentalGetRentalsInput, RentalGetRentalsInput as RentalGetRentalsInput$1, RentalGetRentalsOutput, RentalGetRentalsOutput as RentalGetRentalsOutput$1, RentalHighlightPrioritizationKey, RentalHighlightPrioritizationKey as RentalHighlightPrioritizationKey$1, RentalPropertyHighlightPrioritizationKey, RentalPropertyHighlightPrioritizationKey as RentalPropertyHighlightPrioritizationKey$1, RentalScope, RentalService, ResolvedCustomAttribute, SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS, SearchAllRentalsAtOnceInput, SearchAllRentalsAtOnceInput as SearchAllRentalsAtOnceInput$1, SearchMapSearchInput, SearchMapSearchInput as SearchMapSearchInput$1, SearchMapSearchInputSchema, SearchMapSearchOutput, SearchMapSearchOutput as SearchMapSearchOutput$1, SearchMapSearchOutputItem, SearchMapSearchOutputSchema, SearchSearchAlternative, SearchSearchFieldOrderBy, SearchSearchFieldOrderBySchema, SearchSearchFieldSort, SearchSearchFieldSort as SearchSearchFieldSort$1, SearchSearchFieldSortSchema, SearchSearchInput, SearchSearchInput as SearchSearchInput$1, SearchSearchInputSchema, SearchSearchOutput, SearchSearchOutput as SearchSearchOutput$1, SearchSearchOutputItem, SearchSearchOutputSchema, SearchSearchPriceSort, SearchSearchPriceSortSchema, SearchSearchRandomSort, SearchSearchRandomSortSchema, SearchSearchRatingSort, SearchSearchRatingSortSchema, SearchSearchSort, SearchSearchSort as SearchSearchSort$1, SearchSearchSortSchema, SearchService, SearchSortDirection, SearchSortDirectionSchema, SelectableInsuranceOptionOutput, SelectedInsuranceInformationInput, SubmittableBookingPaymentOption, SubmittableBookingPaymentOption as SubmittableBookingPaymentOption$1, TranslationOverrides, TranslationOverrides as TranslationOverrides$1, UnknownAdditionalService, V10CoreConfig, V10RateBudget, V9OnlyCustomAttributeInput, WebsiteRegion, WebsiteRegions, WebsiteRegions as WebsiteRegions$1, defineCustomAttributes, defineCustomAttributesFromUnknown, fetchCustomAttributeCatalog, parseCustomAttributeCatalog, validateContactSubmitInput } from "@v-office/sdk-core";
2
2
  import { Context, Effect, Layer, Schema } from "effect";
3
3
  import { HttpClient } from "effect/unstable/http";
4
4
  import "@graphql-typed-document-node/core";
@@ -130,6 +130,35 @@ type V9AvailabilityGetBlockedRangesOutput = {
130
130
  readonly rentals: ReadonlyArray<V9RentalBlockedRanges>;
131
131
  };
132
132
  //#endregion
133
+ //#region src/legacy-v9/insurance-input.d.ts
134
+ type V9QuoteCreateInsurancePreContractInput = {
135
+ readonly quote: GuestQuote$1;
136
+ readonly booking: BookingBookOutput$1;
137
+ };
138
+ type V9InsuranceReadPolicyInput = {
139
+ readonly policyNumber: string;
140
+ };
141
+ type V9InsuranceRevokePolicyInput = {
142
+ readonly policyNumber: string;
143
+ readonly booking: BookingBookOutput$1;
144
+ };
145
+ type V9InsurancePolicy = {
146
+ readonly policyNumber: string;
147
+ readonly status: "active" | "revoked";
148
+ readonly revokedAt?: string;
149
+ readonly documentUrl?: string;
150
+ readonly label: string;
151
+ readonly travelPeriod?: {
152
+ readonly start: string;
153
+ readonly end: string;
154
+ };
155
+ readonly insuredPersons: ReadonlyArray<{
156
+ readonly forename: string;
157
+ readonly surname: string;
158
+ readonly birthday?: string;
159
+ }>;
160
+ };
161
+ //#endregion
133
162
  //#region src/legacy-v9/rental-ids.d.ts
134
163
  type V9RentalsGetRentalsByIdsInput = {
135
164
  readonly locale: Locale$1;
@@ -276,10 +305,28 @@ type WebsiteSDKV9LiveVoucher = {
276
305
  type WebsiteSDKV9LiveRentals = {
277
306
  readonly getRentalsByIds: (input: V9RentalsGetRentalsByIdsInput) => Promise<RentalGetRentalsOutput$1>;
278
307
  };
279
- type WebsiteSDKV9Live = Omit<WebsiteSDKSharedLive, "search" | "availability"> & {
308
+ type WebsiteSDKV9LiveQuote = Omit<WebsiteSDKSharedLive["quote"], "createInsurancePreContract"> & {
309
+ /**
310
+ * Creates ERGO's pre-contract after the stay booking. Pass the quote and the result of
311
+ * `live.booking.book`; the policy holder is that booking's customer.
312
+ */
313
+ readonly createInsurancePreContract: (input: V9QuoteCreateInsurancePreContractInput) => Promise<QuoteCreateInsurancePreContractOutput>;
314
+ };
315
+ type WebsiteSDKV9LiveInsurance = {
316
+ /** Reads an ERGO policy. Rejects when the account does not use ERGO insurance. */
317
+ readonly readPolicy: (input: V9InsuranceReadPolicyInput) => Promise<V9InsurancePolicy>;
318
+ /**
319
+ * Revokes an ERGO policy and, once ERGO has accepted, removes it from the booking. Rejects with
320
+ * ERGO's reason when it refuses, or when the account does not use ERGO insurance.
321
+ */
322
+ readonly revokePolicy: (input: V9InsuranceRevokePolicyInput) => Promise<V9InsurancePolicy>;
323
+ };
324
+ type WebsiteSDKV9Live = Omit<WebsiteSDKSharedLive, "search" | "availability" | "quote"> & {
280
325
  readonly availability: WebsiteSDKV9LiveAvailability;
281
326
  readonly voucher: WebsiteSDKV9LiveVoucher;
282
327
  readonly rentals: WebsiteSDKV9LiveRentals;
328
+ readonly quote: WebsiteSDKV9LiveQuote;
329
+ readonly insurance: WebsiteSDKV9LiveInsurance;
283
330
  readonly search: {
284
331
  readonly search: (input: V9SearchSearchInput) => Promise<V9SearchSearchOutput>;
285
332
  readonly mapSearch: WebsiteSDKSharedLive["search"]["mapSearch"];
@@ -287,10 +334,12 @@ type WebsiteSDKV9Live = Omit<WebsiteSDKSharedLive, "search" | "availability"> &
287
334
  };
288
335
  };
289
336
  /** `live` of a v9 SDK created with `searchAllRentalsAtOnce: true`. */
290
- type WebsiteSDKV9AllRentalsAtOnceLive = Omit<WebsiteSDKSharedLive, "search" | "availability"> & {
337
+ type WebsiteSDKV9AllRentalsAtOnceLive = Omit<WebsiteSDKSharedLive, "search" | "availability" | "quote"> & {
291
338
  readonly availability: WebsiteSDKV9LiveAvailability;
292
339
  readonly voucher: WebsiteSDKV9LiveVoucher;
293
340
  readonly rentals: WebsiteSDKV9LiveRentals;
341
+ readonly quote: WebsiteSDKV9LiveQuote;
342
+ readonly insurance: WebsiteSDKV9LiveInsurance;
294
343
  readonly search: {
295
344
  /** Every result with its price in one call; at most `SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS`. */
296
345
  readonly search: (input: V9SearchAllRentalsAtOnceInput) => Promise<V9SearchSearchOutput>;
@@ -7855,4 +7904,4 @@ export type RentalRentalsOutput = RentalGetRentalsOutput$1[number];
7855
7904
  export type RentalSearchInput = SearchSearchInput$1;
7856
7905
  export type RentalSearchOutput = SearchSearchOutput$1;
7857
7906
  //#endregion
7858
- export { AdditionalServiceLimitExceeded, type AvailabilityGetInitialAvailabilityInput, type AvailabilityGetInitialAvailabilityOutput, type AvailabilityGetStartDateSelectedAvailabilityInput, type AvailabilityGetStartDateSelectedAvailabilityOutput, type BackendKind, type BookingBankTransferDetails, type BookingBookInput, type BookingBookOutput, type BookingPayment, type BookingPaymentAlternative, type BookingPaymentOption, type BookingPaymentScheduleItem, type BookingPaymentScheduleKind, type BookingPaymentScheduleLine, CMSError, type ContactSubmitInput, type ContactSubmitOutput, type ContactSubmitValidationIssue, type ContactSubmitValidationIssueCode, CoreSDKError, type CustomAttributeCatalog, type CustomAttributeCatalogDefinitionInput, type CustomAttributeCatalogInput, CustomAttributeCatalogSchema, type CustomAttributeCategoryKey, type CustomAttributeFilterCategoryKey, type CustomAttributeFilterDefinition, type CustomAttributeFilterExpression, type CustomAttributeFilterLabel, type CustomAttributeFilterNumericBounds, type CustomAttributeFilterOption, type CustomAttributeOverridesInput, type CustomAttributeRegistry, type CustomAttributeRegistrySnapshot, type CustomAttributeSelection, type CustomDataAttribute, type DataAttribute, type DocumentsGetTermsAndPrivacyPolicyInput, type DocumentsGetTermsAndPrivacyPolicyOutput, type FilterGetFiltersInput, type FilterGetFiltersOutput, type GeoLocation, type GuestQuote, type GuestQuoteInput, type GuestQuoteInsurance, type GuestQuoteResult, GuestQuoteSchema, type GuestQuoteSelectionResult, type GuestQuoteVoucher, type ImageData, type InsuranceBookingOutput, type InsuranceCustomerInformationInput, type InsurancePaymentInformationInput, type InsurancePaymentOptionOutput, type InsurancePreContractOutput, InvalidAdditionalServiceQuantity, type KnownVofficeFacilityData, type KnownVofficeFacilityDataAttribute, type KnownVofficeFeedbackData, type KnownVofficeFeedbackDataAttribute, type KnownVofficeImageData, type KnownVofficeImageDataAttribute, type KnownVofficeOfferData, type KnownVofficeOfferDataAttribute, type KnownVofficePriceData, type KnownVofficePriceDataAttribute, type KnownVofficeRatingData, type KnownVofficeRatingDataAttribute, type KnownVofficeServiceData, type KnownVofficeServiceDataAttribute, type KnownVofficeTotalRatingData, type KnownVofficeTotalRatingDataAttribute, type KnownVofficeUnitData, type KnownVofficeUnitDataAttribute, type Locale, LocaleSchema, type ParsedJsonData, type ParsedVofficeFacilityData, type ParsedVofficeFeedbackData, type ParsedVofficeImageData, type ParsedVofficeOfferData, type ParsedVofficePriceData, type ParsedVofficeRatingData, type ParsedVofficeServiceData, type ParsedVofficeTotalRatingData, type ParsedVofficeUnitData, type QuoteQuoteInput, type QuoteQuoteOutput, type RegionsGetRegionsInput, type RentalCapacity, type RentalGetRentalsInput, type RentalGetRentalsOutput, type RentalHighlightPrioritizationKey, type RentalPropertyHighlightPrioritizationKey, type ResolvedCustomAttribute, type ResolvedV9PropertyHighlightSource, SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS, type SearchAllRentalsAtOnceInput, type SearchMapSearchInput, SearchMapSearchInputSchema, type SearchMapSearchOutput, type SearchMapSearchOutputItem, SearchMapSearchOutputSchema, type SearchSearchFieldOrderBy, SearchSearchFieldOrderBySchema, type SearchSearchFieldSort, SearchSearchFieldSortSchema, type SearchSearchInput, SearchSearchInputSchema, type SearchSearchOutput, SearchSearchOutputSchema, type SearchSearchPriceSort, SearchSearchPriceSortSchema, type SearchSearchRandomSort, SearchSearchRandomSortSchema, type SearchSearchRatingSort, SearchSearchRatingSortSchema, type SearchSearchSort, SearchSearchSortSchema, type SearchSortDirection, SearchSortDirectionSchema, type SelectableInsuranceOptionOutput, type SelectedInsuranceInformationInput, type SubmittableBookingPaymentOption, type TranslationOverrides, UnknownAdditionalService, type V0OpenApiClientOptions, type V0OpenApiOperationId, type V0OpenApiOperationRequest, type V0OpenApiOperationResponse, type V1OpenApiClientOptions, type components as V1OpenApiComponents, type V1OpenApiOperationId, type V1OpenApiOperationRequest, type V1OpenApiOperationResponse, type operations as V1OpenApiOperations, type paths as V1OpenApiPaths, type V9AvailabilityGetBlockedRangesInput, type V9AvailabilityGetBlockedRangesOutput, type V9BlockedRange, type V9EndDateOption, type V9InitialAvailabilityOutput, type V9OnlyCustomAttributeInput, type V9PropertyHighlightDataAttribute, type V9PropertyHighlightSourceInput, type V9PropertyHighlightSourceRegistry, type V9PropertyHighlightSourcesInput, type V9RentalBlockedRanges, type V9RentalsGetRentalsByIdsInput, type V9ReviewCriterion, type V9ReviewCriterionDataAttribute, type V9ReviewsOptions, type V9SearchAllRentalsAtOnceInput, type V9SearchPagesInput, type V9SearchSearchInput, type V9SearchSearchOutput, type V9SearchSearchOutputItem, type V9SearchSearchSort, type V9StartDateSelectedAvailabilityOutput, type V9Video, type V9VideosGetVideosInput, type V9VoucherValidateInput, type V9VoucherValidateOutput, type V9VoucherValidityReason, type VofficeFacilityDataAttribute, type VofficeFacilityDataAttributes, type VofficeFeedbackDataAttribute, type VofficeFeedbackDataAttributes, type VofficeImageDataAttribute, type VofficeImageDataAttributes, type VofficeOfferDataAttribute, type VofficeOfferDataAttributes, type VofficePriceDataAttribute, type VofficePriceDataAttributes, type VofficeRatingDataAttribute, type VofficeRatingDataAttributes, type VofficeServiceDataAttribute, type VofficeServiceDataAttributes, type VofficeTotalRatingDataAttribute, type VofficeTotalRatingDataAttributes, type VofficeUnitDataAttribute, type VofficeUnitDataAttributes, type WebsiteRegion, type WebsiteRegions, type WebsiteSDK, type WebsiteSDKAllRentalsAtOnce, type WebsiteSDKConfig, type WebsiteSDKOptions, type WebsiteSDKSharedLive, type WebsiteSDKSharedStatic, type WebsiteSDKV10, type WebsiteSDKV10AllRentalsAtOnce, type WebsiteSDKV10AllRentalsAtOnceLive, type WebsiteSDKV10Live, type WebsiteSDKV10Static, type WebsiteSDKV9, type WebsiteSDKV9AllRentalsAtOnce, type WebsiteSDKV9AllRentalsAtOnceLive, type WebsiteSDKV9Live, type WebsiteSDKV9Static, defineWebsiteSDKOptions as defineCMSSDKOptions, defineCustomAttributes, defineCustomAttributesFromUnknown, fetchCustomAttributeCatalog, parseCustomAttributeCatalog, validateContactSubmitInput };
7907
+ export { AdditionalServiceLimitExceeded, type AvailabilityGetInitialAvailabilityInput, type AvailabilityGetInitialAvailabilityOutput, type AvailabilityGetStartDateSelectedAvailabilityInput, type AvailabilityGetStartDateSelectedAvailabilityOutput, type BackendKind, type BookingBankTransferDetails, type BookingBookInput, type BookingBookOutput, type BookingPayment, type BookingPaymentAlternative, type BookingPaymentOption, type BookingPaymentScheduleItem, type BookingPaymentScheduleKind, type BookingPaymentScheduleLine, CMSError, type ContactSubmitInput, type ContactSubmitOutput, type ContactSubmitValidationIssue, type ContactSubmitValidationIssueCode, CoreSDKError, type CustomAttributeCatalog, type CustomAttributeCatalogDefinitionInput, type CustomAttributeCatalogInput, CustomAttributeCatalogSchema, type CustomAttributeCategoryKey, type CustomAttributeFilterCategoryKey, type CustomAttributeFilterDefinition, type CustomAttributeFilterExpression, type CustomAttributeFilterLabel, type CustomAttributeFilterNumericBounds, type CustomAttributeFilterOption, type CustomAttributeOverridesInput, type CustomAttributeRegistry, type CustomAttributeRegistrySnapshot, type CustomAttributeSelection, type CustomDataAttribute, type DataAttribute, type DocumentsGetTermsAndPrivacyPolicyInput, type DocumentsGetTermsAndPrivacyPolicyOutput, type FilterGetFiltersInput, type FilterGetFiltersOutput, type GeoLocation, type GuestQuote, type GuestQuoteInput, type GuestQuoteInsurance, type GuestQuoteResult, GuestQuoteSchema, type GuestQuoteSelectionResult, type GuestQuoteVoucher, type ImageData, type InsuranceBookingOutput, type InsuranceCustomerInformationInput, type InsurancePaymentInformationInput, type InsurancePaymentOptionOutput, type InsurancePreContractOutput, InvalidAdditionalServiceQuantity, type KnownVofficeFacilityData, type KnownVofficeFacilityDataAttribute, type KnownVofficeFeedbackData, type KnownVofficeFeedbackDataAttribute, type KnownVofficeImageData, type KnownVofficeImageDataAttribute, type KnownVofficeOfferData, type KnownVofficeOfferDataAttribute, type KnownVofficePriceData, type KnownVofficePriceDataAttribute, type KnownVofficeRatingData, type KnownVofficeRatingDataAttribute, type KnownVofficeServiceData, type KnownVofficeServiceDataAttribute, type KnownVofficeTotalRatingData, type KnownVofficeTotalRatingDataAttribute, type KnownVofficeUnitData, type KnownVofficeUnitDataAttribute, type Locale, LocaleSchema, type ParsedJsonData, type ParsedVofficeFacilityData, type ParsedVofficeFeedbackData, type ParsedVofficeImageData, type ParsedVofficeOfferData, type ParsedVofficePriceData, type ParsedVofficeRatingData, type ParsedVofficeServiceData, type ParsedVofficeTotalRatingData, type ParsedVofficeUnitData, type QuoteQuoteInput, type QuoteQuoteOutput, type RegionsGetRegionsInput, type RentalCapacity, type RentalGetRentalsInput, type RentalGetRentalsOutput, type RentalHighlightPrioritizationKey, type RentalPropertyHighlightPrioritizationKey, type ResolvedCustomAttribute, type ResolvedV9PropertyHighlightSource, SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS, type SearchAllRentalsAtOnceInput, type SearchMapSearchInput, SearchMapSearchInputSchema, type SearchMapSearchOutput, type SearchMapSearchOutputItem, SearchMapSearchOutputSchema, type SearchSearchFieldOrderBy, SearchSearchFieldOrderBySchema, type SearchSearchFieldSort, SearchSearchFieldSortSchema, type SearchSearchInput, SearchSearchInputSchema, type SearchSearchOutput, SearchSearchOutputSchema, type SearchSearchPriceSort, SearchSearchPriceSortSchema, type SearchSearchRandomSort, SearchSearchRandomSortSchema, type SearchSearchRatingSort, SearchSearchRatingSortSchema, type SearchSearchSort, SearchSearchSortSchema, type SearchSortDirection, SearchSortDirectionSchema, type SelectableInsuranceOptionOutput, type SelectedInsuranceInformationInput, type SubmittableBookingPaymentOption, type TranslationOverrides, UnknownAdditionalService, type V0OpenApiClientOptions, type V0OpenApiOperationId, type V0OpenApiOperationRequest, type V0OpenApiOperationResponse, type V1OpenApiClientOptions, type components as V1OpenApiComponents, type V1OpenApiOperationId, type V1OpenApiOperationRequest, type V1OpenApiOperationResponse, type operations as V1OpenApiOperations, type paths as V1OpenApiPaths, type V9AvailabilityGetBlockedRangesInput, type V9AvailabilityGetBlockedRangesOutput, type V9BlockedRange, type V9EndDateOption, type V9InitialAvailabilityOutput, type V9InsurancePolicy, type V9InsuranceReadPolicyInput, type V9InsuranceRevokePolicyInput, type V9OnlyCustomAttributeInput, type V9PropertyHighlightDataAttribute, type V9PropertyHighlightSourceInput, type V9PropertyHighlightSourceRegistry, type V9PropertyHighlightSourcesInput, type V9QuoteCreateInsurancePreContractInput, type V9RentalBlockedRanges, type V9RentalsGetRentalsByIdsInput, type V9ReviewCriterion, type V9ReviewCriterionDataAttribute, type V9ReviewsOptions, type V9SearchAllRentalsAtOnceInput, type V9SearchPagesInput, type V9SearchSearchInput, type V9SearchSearchOutput, type V9SearchSearchOutputItem, type V9SearchSearchSort, type V9StartDateSelectedAvailabilityOutput, type V9Video, type V9VideosGetVideosInput, type V9VoucherValidateInput, type V9VoucherValidateOutput, type V9VoucherValidityReason, type VofficeFacilityDataAttribute, type VofficeFacilityDataAttributes, type VofficeFeedbackDataAttribute, type VofficeFeedbackDataAttributes, type VofficeImageDataAttribute, type VofficeImageDataAttributes, type VofficeOfferDataAttribute, type VofficeOfferDataAttributes, type VofficePriceDataAttribute, type VofficePriceDataAttributes, type VofficeRatingDataAttribute, type VofficeRatingDataAttributes, type VofficeServiceDataAttribute, type VofficeServiceDataAttributes, type VofficeTotalRatingDataAttribute, type VofficeTotalRatingDataAttributes, type VofficeUnitDataAttribute, type VofficeUnitDataAttributes, type WebsiteRegion, type WebsiteRegions, type WebsiteSDK, type WebsiteSDKAllRentalsAtOnce, type WebsiteSDKConfig, type WebsiteSDKOptions, type WebsiteSDKSharedLive, type WebsiteSDKSharedStatic, type WebsiteSDKV10, type WebsiteSDKV10AllRentalsAtOnce, type WebsiteSDKV10AllRentalsAtOnceLive, type WebsiteSDKV10Live, type WebsiteSDKV10Static, type WebsiteSDKV9, type WebsiteSDKV9AllRentalsAtOnce, type WebsiteSDKV9AllRentalsAtOnceLive, type WebsiteSDKV9Live, type WebsiteSDKV9Static, defineWebsiteSDKOptions as defineCMSSDKOptions, defineCustomAttributes, defineCustomAttributesFromUnknown, fetchCustomAttributeCatalog, parseCustomAttributeCatalog, validateContactSubmitInput };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as QuoteSchema, A as DocumentResourceSchema, At as bookInsuranceEffect, B as ErgoPersonSchema, Bt as quoteEffect, C as ApiEnvelopeBaseSchema, Ct as V1_BASE_URL, D as CustomerUnitSummarySchema, Dt as decodeV1OperationResponse, E as CurrentMemberResponseSchema, Et as VideoResponseSchema, F as ErgoAddressSchema, Ft as getInitialAvailabilityEffect, G as FacilityListResponseSchema, Gt as selectInsurancePaymentEffect, H as ErgoPolicyNumberRequestSchema, Ht as searchEffect, I as ErgoBankSchema, It as getRentalsEffect, J as PaymentScheduleItemSchema, Jt as submitPaymentOptionEffect, K as OnOfficeUnitCollectionResponseSchema, Kt as submitContactEffect, L as ErgoBookRequestSchema, Lt as getStartDateSelectedAvailabilityEffect, M as DocumentStatusUpdateRequestSchema, Mt as createInsurancePreContractEffect, N as DocumentSummarySchema, Nt as getBankTransferDetailsEffect, O as DocumentCollectionResponseSchema, Ot as addAdditionalServiceEffect, P as DocumentTypeSchema, Pt as getFiltersEffect, Q as QuotePricesResponseSchema, R as ErgoCommonFieldsSchema, Rt as getTermsAndPrivacyPolicyEffect, S as makeV1OpenApiClientLive, St as UnitServicePriceSchema, T as CalendarResponseSchema, Tt as VideoListResponseSchema, U as ErgoReadPreContractRequestSchema, Ut as selectCancellationPolicyEffect, V as ErgoPlanSearchRequestSchema, Vt as removeAdditionalServiceEffect, W as ErgoTripAndCustomerRequestSchema, Wt as selectInsuranceEffect, X as QuoteLineSchema, Xt as defineV9PropertyHighlightSources, Y as PaymentScheduleSchema, Yt as defineWebsiteSDKOptions, Z as QuotePricesPayloadSchema, Zt as defineV9PropertyHighlightSourcesFromUnknown, _t as UnitIdsResponseSchema, at as SearchPropertiesResponseSchema, b as V1OpenApiClientError, bt as UnitOfferSchema, ct as ServiceLimitSchema, dt as SetupResponseSchema, et as QuoteServiceSchema, ft as TileCollectionResponseSchema, g as makeV0OpenApiClientLive, gt as TravelInsuranceBookingStoreRequestSchema, h as makeV0OpenApiClientFetchLive, ht as TravelInsuranceBookingSchema, it as RoomImageSchema, j as DocumentStatusSchema, jt as clearAdditionalServicesEffect, k as DocumentResourceResponseSchema, kt as bookEffect, lt as ServiceListResponseSchema, m as V0OpenApiClientError, mt as TileTagSchema, nt as RawVofficeObjectSchema, ot as ServiceBeonDataSchema, p as V0OpenApiClient, pt as TileSchema, q as OnOfficeUnitSchema, qt as submitPaymentOption, rt as RegionListResponseSchema, st as ServiceImageSchema, t as createWebsiteSDK, tt as RawObjectResponseSchema, ut as SetupDataSchema, vt as UnitListItemSchema, w as CalendarDaySchema, wt as V1_OPERATIONS, x as makeV1OpenApiClientFetchLive, xt as UnitResponseSchema, y as V1OpenApiClient, yt as UnitListResponseSchema, z as ErgoCreatePreContractRequestSchema, zt as mapSearchEffect } from "./client-CE4V_ybW.mjs";
1
+ import { $ as QuoteSchema, A as DocumentResourceSchema, At as bookInsuranceEffect, B as ErgoPersonSchema, Bt as quoteEffect, C as ApiEnvelopeBaseSchema, Ct as V1_BASE_URL, D as CustomerUnitSummarySchema, Dt as decodeV1OperationResponse, E as CurrentMemberResponseSchema, Et as VideoResponseSchema, F as ErgoAddressSchema, Ft as getInitialAvailabilityEffect, G as FacilityListResponseSchema, Gt as selectInsurancePaymentEffect, H as ErgoPolicyNumberRequestSchema, Ht as searchEffect, I as ErgoBankSchema, It as getRentalsEffect, J as PaymentScheduleItemSchema, Jt as submitPaymentOptionEffect, K as OnOfficeUnitCollectionResponseSchema, Kt as submitContactEffect, L as ErgoBookRequestSchema, Lt as getStartDateSelectedAvailabilityEffect, M as DocumentStatusUpdateRequestSchema, Mt as createInsurancePreContractEffect, N as DocumentSummarySchema, Nt as getBankTransferDetailsEffect, O as DocumentCollectionResponseSchema, Ot as addAdditionalServiceEffect, P as DocumentTypeSchema, Pt as getFiltersEffect, Q as QuotePricesResponseSchema, R as ErgoCommonFieldsSchema, Rt as getTermsAndPrivacyPolicyEffect, S as makeV1OpenApiClientLive, St as UnitServicePriceSchema, T as CalendarResponseSchema, Tt as VideoListResponseSchema, U as ErgoReadPreContractRequestSchema, Ut as selectCancellationPolicyEffect, V as ErgoPlanSearchRequestSchema, Vt as removeAdditionalServiceEffect, W as ErgoTripAndCustomerRequestSchema, Wt as selectInsuranceEffect, X as QuoteLineSchema, Xt as defineV9PropertyHighlightSources, Y as PaymentScheduleSchema, Yt as defineWebsiteSDKOptions, Z as QuotePricesPayloadSchema, Zt as defineV9PropertyHighlightSourcesFromUnknown, _t as UnitIdsResponseSchema, at as SearchPropertiesResponseSchema, b as V1OpenApiClientError, bt as UnitOfferSchema, ct as ServiceLimitSchema, dt as SetupResponseSchema, et as QuoteServiceSchema, ft as TileCollectionResponseSchema, g as makeV0OpenApiClientLive, gt as TravelInsuranceBookingStoreRequestSchema, h as makeV0OpenApiClientFetchLive, ht as TravelInsuranceBookingSchema, it as RoomImageSchema, j as DocumentStatusSchema, jt as clearAdditionalServicesEffect, k as DocumentResourceResponseSchema, kt as bookEffect, lt as ServiceListResponseSchema, m as V0OpenApiClientError, mt as TileTagSchema, nt as RawVofficeObjectSchema, ot as ServiceBeonDataSchema, p as V0OpenApiClient, pt as TileSchema, q as OnOfficeUnitSchema, qt as submitPaymentOption, rt as RegionListResponseSchema, st as ServiceImageSchema, t as createWebsiteSDK, tt as RawObjectResponseSchema, ut as SetupDataSchema, vt as UnitListItemSchema, w as CalendarDaySchema, wt as V1_OPERATIONS, x as makeV1OpenApiClientFetchLive, xt as UnitResponseSchema, y as V1OpenApiClient, yt as UnitListResponseSchema, z as ErgoCreatePreContractRequestSchema, zt as mapSearchEffect } from "./client-k4Gjwp60.mjs";
2
2
  import { AdditionalServiceLimitExceeded, CoreSDKError, CoreSDKError as CMSError, CustomAttributeCatalogSchema, GuestQuoteSchema, InvalidAdditionalServiceQuantity, LocaleSchema, SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS, SearchMapSearchInputSchema, SearchMapSearchOutputSchema, SearchSearchFieldOrderBySchema, SearchSearchFieldSortSchema, SearchSearchInputSchema, SearchSearchOutputSchema, SearchSearchPriceSortSchema, SearchSearchRandomSortSchema, SearchSearchRatingSortSchema, SearchSearchSortSchema, SearchSortDirectionSchema, UnknownAdditionalService, defineCustomAttributes, defineCustomAttributesFromUnknown, fetchCustomAttributeCatalog, parseCustomAttributeCatalog, validateContactSubmitInput } from "@v-office/sdk-core";
3
3
  //#region codegen/v9/heuristic-generation/public-api.ts
4
4
  const customDataAttribute = (name) => name;
@@ -4,6 +4,7 @@
4
4
 
5
5
  Release notes of `@v-office/website-sdk`, newest first. Each version has its own directory.
6
6
 
7
+ - `versions/3.0.0/CHANGELOG.md`: release notes for 3.0.0
7
8
  - `versions/2.38.0/CHANGELOG.md`: release notes for 2.38.0
8
9
  - `versions/2.37.1/CHANGELOG.md`: release notes for 2.37.1
9
10
  - `versions/2.37.0/CHANGELOG.md`: release notes for 2.37.0
@@ -4,6 +4,7 @@
4
4
 
5
5
  Migration guides of `@v-office/website-sdk`, newest first. Apply them in order when skipping versions.
6
6
 
7
+ - `versions/3.0.0/MIGRATION.md`: Migration: 2.38.0 to 3.0.0
7
8
  - `versions/2.38.0/MIGRATION.md`: Migration: 2.37.1 to 2.38.0
8
9
  - `versions/2.37.1/MIGRATION.md`: Migration: 2.37.0 to 2.37.1
9
10
  - `versions/2.37.0/MIGRATION.md`: Migration: 2.36.2 to 2.37.0
@@ -139,7 +139,7 @@ included in its amount. It contains the formatted deposit and, when nonzero, the
139
139
  amount excluding the deposit. Without a stated deposit there are no `lines`;
140
140
  never derive a deposit from `amount` and a percentage.
141
141
 
142
- An optional `insurancePaymentOptions` array is returned only when post-booking insurance payment is available.
142
+ An optional `insurancePaymentOptions` array is returned only when post-booking insurance payment is available. On v9 with an ERGO plan selected it holds the SEPA debit option, even though the pre-contract does not exist yet: create it with `createInsurancePreContract({ quote, booking })` after `book`, then `selectInsurancePayment` and `bookInsurance`.
143
143
 
144
144
  Sites upgrading from 2.12.0 must replace the former `paymentSchedules` output. See
145
145
  `versions/2.13.0/MIGRATION.md`.
@@ -422,27 +422,17 @@ quote = await sdk.live.quote.selectInsurance({
422
422
  });
423
423
  ```
424
424
 
425
- For insurance products that require a pre-contract, provide customer information:
425
+ On v9 with ERGO insurance the pre-contract needs the stay booking, so create it after `live.booking.book`. The policy holder is the booking's customer, whose birthdate, mobile number (`contactDetails.phone`) and a covered country (DE, AT, BE, DK, FR, IT, LU, NL, PL, CZ) the booking form has to collect. Every traveler needs a `birthday`, and ERGO is not offered for more than nine travelers:
426
426
 
427
427
  ```ts
428
- quote = await sdk.live.quote.createInsurancePreContract({
429
- quote,
430
- customerInformation: {
431
- destinationCountryCode: "DE",
432
- address: {
433
- street: "Main Street",
434
- housenumber: "1",
435
- postalcode: "12345",
436
- city: "Berlin",
437
- countryCode: "DE",
438
- },
439
- email: "jane@example.com",
440
- mobile: "+49123456789",
441
- },
442
- });
428
+ const booking = await sdk.live.booking.book({ quote, contact, relativeRedirectUrl });
429
+
430
+ quote = await sdk.live.quote.createInsurancePreContract({ quote, booking });
443
431
  ```
444
432
 
445
- Select an insurance payment method before booking insurance:
433
+ Calling it again for the same booking and plan returns the existing pre-contract. Show `quote.insurance.preContract.documents` to the guest before booking the insurance.
434
+
435
+ The booking result lists the SEPA debit option in `insurancePaymentOptions` as soon as an ERGO plan is selected. Select that payment method after the pre-contract and before booking insurance:
446
436
 
447
437
  ```ts
448
438
  quote = await sdk.live.quote.selectInsurancePayment({
@@ -454,7 +444,7 @@ quote = await sdk.live.quote.selectInsurancePayment({
454
444
  });
455
445
  ```
456
446
 
457
- After the rental booking is created, complete insurance booking with the opaque booking result. Keep the live result object; its private backend credentials are intentionally not serialized:
447
+ Complete insurance booking with the opaque booking result. Keep the live result object; its private backend credentials are intentionally not serialized:
458
448
 
459
449
  ```ts
460
450
  const insuranceBooking = await sdk.live.quote.bookInsurance({
@@ -466,7 +456,14 @@ const insuranceBooking = await sdk.live.quote.bookInsurance({
466
456
  This is a breaking change in 2.13.0. The former public `guestToken` input is no
467
457
  longer used; see `versions/2.13.0/MIGRATION.md`.
468
458
 
469
- `v9` supports real insurance option refresh, pre-contract, payment selection, and booking. `v10` currently returns a no-insurance placeholder and insurance actions resolve as not required.
459
+ `v9` supports real insurance option refresh, pre-contract, payment selection, and booking. With ERGO, issued policies can be read and revoked (rejects on other accounts); revoking rejects with ERGO's reason when ERGO refuses:
460
+
461
+ ```ts
462
+ const policy = await sdk.live.insurance.readPolicy({ policyNumber });
463
+ const revoked = await sdk.live.insurance.revokePolicy({ policyNumber, booking });
464
+ ```
465
+
466
+ When the Hub settings or the plan search of ERGO or URV fail, the quote shows insurance as not offered instead of failing. `v10` currently returns a no-insurance placeholder and insurance actions resolve as not required.
470
467
 
471
468
  ## Configuration
472
469
 
@@ -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.
@@ -1,4 +1,4 @@
1
- import { Qt as V9_FACILITY_ATTRIBUTE_KEYS } from "./client-CE4V_ybW.mjs";
1
+ import { Qt as V9_FACILITY_ATTRIBUTE_KEYS } from "./client-k4Gjwp60.mjs";
2
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
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
4
  import { CoreSDKError, makeTranslate, renderResolvedCustomAttribute, toCustomAttributeList, toResolvedCustomAttributeCategoryTranslationKey, toReviewClassification } from "@v-office/sdk-core";
@@ -1,4 +1,4 @@
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-CE4V_ybW.mjs";
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
2
  import { n as mapSearchQuery, r as searchQuery, w as parseVofficeUnitData } from "./operations-DMqLD3e2.mjs";
3
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";
@@ -9,5 +9,11 @@
9
9
  "voucher.validate.reason.unknown": "Dieser Gutscheincode ist unbekannt.",
10
10
  "voucher.validate.reason.stay_too_short": "Der Aufenthalt ist für diesen Gutscheincode zu kurz.",
11
11
  "voucher.validate.reason.outside_booking_window": "Der gewählte Anreisetag liegt außerhalb des Buchungszeitraums dieses Gutscheincodes.",
12
- "voucher.validate.reason.rate_limited": "Zu viele Versuche. Bitte versuchen Sie es später erneut."
12
+ "voucher.validate.reason.rate_limited": "Zu viele Versuche. Bitte versuchen Sie es später erneut.",
13
+ "insurance.ergo.preContract.documents.PID.label": "Produktinformationsblatt",
14
+ "insurance.ergo.preContract.documents.TCP.label": "Versicherungsbedingungen",
15
+ "insurance.ergo.preContract.documents.PRP.label": "Merkblatt zur Datenverarbeitung",
16
+ "insurance.ergo.preContract.documents.ECI.label": "Kundeninformation elektronischer Geschäftsverkehr",
17
+ "insurance.ergo.preContract.documents.other.label": "Dokument",
18
+ "insurance.ergo.policy.document.label": "Versicherungsschein"
13
19
  }
@@ -9,5 +9,11 @@
9
9
  "voucher.validate.reason.unknown": "This voucher code is unknown.",
10
10
  "voucher.validate.reason.stay_too_short": "The stay is too short for this voucher code.",
11
11
  "voucher.validate.reason.outside_booking_window": "The selected arrival date is outside this voucher code's booking window.",
12
- "voucher.validate.reason.rate_limited": "Too many attempts. Please try again later."
12
+ "voucher.validate.reason.rate_limited": "Too many attempts. Please try again later.",
13
+ "insurance.ergo.preContract.documents.PID.label": "Product information sheet",
14
+ "insurance.ergo.preContract.documents.TCP.label": "Insurance terms",
15
+ "insurance.ergo.preContract.documents.PRP.label": "Data processing notice",
16
+ "insurance.ergo.preContract.documents.ECI.label": "E-commerce customer information",
17
+ "insurance.ergo.preContract.documents.other.label": "Document",
18
+ "insurance.ergo.policy.document.label": "Insurance policy"
13
19
  }
@@ -4,6 +4,7 @@
4
4
 
5
5
  Release notes of `@v-office/website-sdk`, newest first. Each version has its own directory.
6
6
 
7
+ - `versions/3.0.0/CHANGELOG.md`: release notes for 3.0.0
7
8
  - `versions/2.38.0/CHANGELOG.md`: release notes for 2.38.0
8
9
  - `versions/2.37.1/CHANGELOG.md`: release notes for 2.37.1
9
10
  - `versions/2.37.0/CHANGELOG.md`: release notes for 2.37.0
@@ -4,6 +4,7 @@
4
4
 
5
5
  Migration guides of `@v-office/website-sdk`, newest first. Apply them in order when skipping versions.
6
6
 
7
+ - `versions/3.0.0/MIGRATION.md`: Migration: 2.38.0 to 3.0.0
7
8
  - `versions/2.38.0/MIGRATION.md`: Migration: 2.37.1 to 2.38.0
8
9
  - `versions/2.37.1/MIGRATION.md`: Migration: 2.37.0 to 2.37.1
9
10
  - `versions/2.37.0/MIGRATION.md`: Migration: 2.36.2 to 2.37.0
@@ -139,7 +139,7 @@ included in its amount. It contains the formatted deposit and, when nonzero, the
139
139
  amount excluding the deposit. Without a stated deposit there are no `lines`;
140
140
  never derive a deposit from `amount` and a percentage.
141
141
 
142
- An optional `insurancePaymentOptions` array is returned only when post-booking insurance payment is available.
142
+ An optional `insurancePaymentOptions` array is returned only when post-booking insurance payment is available. On v9 with an ERGO plan selected it holds the SEPA debit option, even though the pre-contract does not exist yet: create it with `createInsurancePreContract({ quote, booking })` after `book`, then `selectInsurancePayment` and `bookInsurance`.
143
143
 
144
144
  Sites upgrading from 2.12.0 must replace the former `paymentSchedules` output. See
145
145
  `versions/2.13.0/MIGRATION.md`.
@@ -422,27 +422,17 @@ quote = await sdk.live.quote.selectInsurance({
422
422
  });
423
423
  ```
424
424
 
425
- For insurance products that require a pre-contract, provide customer information:
425
+ On v9 with ERGO insurance the pre-contract needs the stay booking, so create it after `live.booking.book`. The policy holder is the booking's customer, whose birthdate, mobile number (`contactDetails.phone`) and a covered country (DE, AT, BE, DK, FR, IT, LU, NL, PL, CZ) the booking form has to collect. Every traveler needs a `birthday`, and ERGO is not offered for more than nine travelers:
426
426
 
427
427
  ```ts
428
- quote = await sdk.live.quote.createInsurancePreContract({
429
- quote,
430
- customerInformation: {
431
- destinationCountryCode: "DE",
432
- address: {
433
- street: "Main Street",
434
- housenumber: "1",
435
- postalcode: "12345",
436
- city: "Berlin",
437
- countryCode: "DE",
438
- },
439
- email: "jane@example.com",
440
- mobile: "+49123456789",
441
- },
442
- });
428
+ const booking = await sdk.live.booking.book({ quote, contact, relativeRedirectUrl });
429
+
430
+ quote = await sdk.live.quote.createInsurancePreContract({ quote, booking });
443
431
  ```
444
432
 
445
- Select an insurance payment method before booking insurance:
433
+ Calling it again for the same booking and plan returns the existing pre-contract. Show `quote.insurance.preContract.documents` to the guest before booking the insurance.
434
+
435
+ The booking result lists the SEPA debit option in `insurancePaymentOptions` as soon as an ERGO plan is selected. Select that payment method after the pre-contract and before booking insurance:
446
436
 
447
437
  ```ts
448
438
  quote = await sdk.live.quote.selectInsurancePayment({
@@ -454,7 +444,7 @@ quote = await sdk.live.quote.selectInsurancePayment({
454
444
  });
455
445
  ```
456
446
 
457
- After the rental booking is created, complete insurance booking with the opaque booking result. Keep the live result object; its private backend credentials are intentionally not serialized:
447
+ Complete insurance booking with the opaque booking result. Keep the live result object; its private backend credentials are intentionally not serialized:
458
448
 
459
449
  ```ts
460
450
  const insuranceBooking = await sdk.live.quote.bookInsurance({
@@ -466,7 +456,14 @@ const insuranceBooking = await sdk.live.quote.bookInsurance({
466
456
  This is a breaking change in 2.13.0. The former public `guestToken` input is no
467
457
  longer used; see `versions/2.13.0/MIGRATION.md`.
468
458
 
469
- `v9` supports real insurance option refresh, pre-contract, payment selection, and booking. `v10` currently returns a no-insurance placeholder and insurance actions resolve as not required.
459
+ `v9` supports real insurance option refresh, pre-contract, payment selection, and booking. With ERGO, issued policies can be read and revoked (rejects on other accounts); revoking rejects with ERGO's reason when ERGO refuses:
460
+
461
+ ```ts
462
+ const policy = await sdk.live.insurance.readPolicy({ policyNumber });
463
+ const revoked = await sdk.live.insurance.revokePolicy({ policyNumber, booking });
464
+ ```
465
+
466
+ When the Hub settings or the plan search of ERGO or URV fail, the quote shows insurance as not offered instead of failing. `v10` currently returns a no-insurance placeholder and insurance actions resolve as not required.
470
467
 
471
468
  ## Configuration
472
469
 
@@ -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.