@v-office/website-sdk 2.29.0 → 2.30.1
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 +48 -62
- package/dist/{client-B8cF8Ra1.mjs → client-CKVwzIQ4.mjs} +101 -13
- package/dist/index.d.mts +10 -3
- package/dist/index.mjs +1 -1
- package/dist/instructions/CHANGELOG.md +2 -0
- package/dist/instructions/MIGRATION.md +2 -0
- package/dist/instructions/availability.md +22 -2
- package/dist/instructions/creation.md +3 -3
- package/dist/instructions/custom-attributes.md +2 -2
- package/dist/instructions/filter.md +2 -2
- package/dist/instructions/search.md +14 -8
- package/dist/instructions/versions/2.30.0/CHANGELOG.md +40 -0
- package/dist/instructions/versions/2.30.0/MIGRATION.md +30 -0
- package/dist/instructions/versions/2.30.1/CHANGELOG.md +10 -0
- package/dist/instructions/versions/2.30.1/MIGRATION.md +9 -0
- package/dist/{rentals-DvYUm25t.mjs → rentals-cmqp5dTw.mjs} +1 -1
- package/dist/{search-BkrzAC9w.mjs → search-DPsBki_9.mjs} +1 -1
- package/instructions/CHANGELOG.md +2 -0
- package/instructions/MIGRATION.md +2 -0
- package/instructions/availability.md +22 -2
- package/instructions/creation.md +3 -3
- package/instructions/custom-attributes.md +2 -2
- package/instructions/filter.md +2 -2
- package/instructions/search.md +14 -8
- package/instructions/versions/2.30.0/CHANGELOG.md +40 -0
- package/instructions/versions/2.30.0/MIGRATION.md +30 -0
- package/instructions/versions/2.30.0/release.json +3 -0
- package/instructions/versions/2.30.1/CHANGELOG.md +10 -0
- package/instructions/versions/2.30.1/MIGRATION.md +9 -0
- package/instructions/versions/2.30.1/release.json +3 -0
- package/package.json +3 -3
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $t as V9_HUB_OBJECT_GROUP_SCOPE_FILTER_KEY, Jt as defineV9PropertyHighlightSourcesFromUnknown, Kt as defineWebsiteSDKOptions, Qt as V9_HUB_OBJECT_GROUP_FILTER_KEY, Xt as V9_HUB_FACILITY_SCOPE_FILTER_KEY, Zt as V9_HUB_FACILITY_SEARCH_FILTER_KEY, en as V9_HUB_OFFERS_FILTER_KEY, f as makeV9GraphQLClient, h as makeV0OpenApiClientFetchLive, i as toV9SdkOwnedHubFilterKeys, n as checkV9HubFilters, nn as V9_HUB_RENTAL_IDS_FILTER_KEY, p as V0OpenApiClient, r as toV9RequiredHubFilterKeys, rn as V9_SDK_OWNED_HUB_FILTER_KEYS, t as createWebsiteSDK, tn as V9_HUB_OFFER_FILTER_KEY } from "./client-
|
|
2
|
+
import { $t as V9_HUB_OBJECT_GROUP_SCOPE_FILTER_KEY, Jt as defineV9PropertyHighlightSourcesFromUnknown, Kt as defineWebsiteSDKOptions, Qt as V9_HUB_OBJECT_GROUP_FILTER_KEY, Xt as V9_HUB_FACILITY_SCOPE_FILTER_KEY, Zt as V9_HUB_FACILITY_SEARCH_FILTER_KEY, en as V9_HUB_OFFERS_FILTER_KEY, f as makeV9GraphQLClient, h as makeV0OpenApiClientFetchLive, i as toV9SdkOwnedHubFilterKeys, n as checkV9HubFilters, nn as V9_HUB_RENTAL_IDS_FILTER_KEY, p as V0OpenApiClient, r as toV9RequiredHubFilterKeys, rn as V9_SDK_OWNED_HUB_FILTER_KEYS, t as createWebsiteSDK, tn as V9_HUB_OFFER_FILTER_KEY } from "./client-CKVwzIQ4.mjs";
|
|
3
3
|
import { _ as parseVofficeRatingData, i as hubFiltersQuery, l as rentalsAllWithoutFeedbacksQuery } from "./operations-CfjJjdrw.mjs";
|
|
4
4
|
import { SearchSearchSortSchema, defineCustomAttributesFromUnknown } from "@v-office/sdk-core";
|
|
5
5
|
import { ByteSize, Console, Effect, FileSystem, Layer, Option, Path, Schema, Stdio, Terminal } from "effect";
|
|
@@ -17,7 +17,7 @@ var CLICheckFailed = class extends Error {
|
|
|
17
17
|
const toCLIError = (message, cause) => cause instanceof Error ? new CLICheckFailed(`${message}: ${cause.message}`, { cause }) : new CLICheckFailed(message, { cause });
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region package.json
|
|
20
|
-
var version = "2.
|
|
20
|
+
var version = "2.30.1";
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region src/cli/output.ts
|
|
23
23
|
const toJson = (value) => Effect.try({
|
|
@@ -482,35 +482,35 @@ const inputFilter = ({ name, queryKey }) => ({
|
|
|
482
482
|
});
|
|
483
483
|
const HUB_FILTER_REQUESTS = {
|
|
484
484
|
[V9_HUB_FACILITY_SCOPE_FILTER_KEY]: {
|
|
485
|
-
purpose: "
|
|
485
|
+
purpose: "Begrenzt die Suche auf die Unterkünfte der Ferienanlage dieser Website. Für Besucher unsichtbar.",
|
|
486
486
|
entry: inputFilter({
|
|
487
487
|
name: "Ferienanlage (Scope)",
|
|
488
488
|
queryKey: "VofficeUnit.voffice_facility_id"
|
|
489
489
|
})
|
|
490
490
|
},
|
|
491
491
|
[V9_HUB_OBJECT_GROUP_SCOPE_FILTER_KEY]: {
|
|
492
|
-
purpose: "
|
|
492
|
+
purpose: "Begrenzt die Suche auf die Unterkünfte der Objektgruppe dieser Website. Für Besucher unsichtbar.",
|
|
493
493
|
entry: inputFilter({
|
|
494
494
|
name: "Objektgruppe (Scope)",
|
|
495
495
|
queryKey: "VofficeGroup.voffice_group_id"
|
|
496
496
|
})
|
|
497
497
|
},
|
|
498
498
|
[V9_HUB_RENTAL_IDS_FILTER_KEY]: {
|
|
499
|
-
purpose: "
|
|
499
|
+
purpose: "Findet Unterkünfte anhand ihrer vOffice-ID, z. B. für die Merkliste. Für Besucher unsichtbar.",
|
|
500
500
|
entry: inputFilter({
|
|
501
501
|
name: "vOffice ID",
|
|
502
502
|
queryKey: "VofficeUnit.voffice_id"
|
|
503
503
|
})
|
|
504
504
|
},
|
|
505
505
|
[V9_HUB_OBJECT_GROUP_FILTER_KEY]: {
|
|
506
|
-
purpose: "Filter nach Objektgruppe in der Suche der Website.
|
|
506
|
+
purpose: "Filter nach Objektgruppe in der Suche der Website.",
|
|
507
507
|
entry: inputFilter({
|
|
508
508
|
name: "Objektgruppe",
|
|
509
509
|
queryKey: "VofficeGroup.voffice_group_id"
|
|
510
510
|
})
|
|
511
511
|
},
|
|
512
512
|
[V9_HUB_FACILITY_SEARCH_FILTER_KEY]: {
|
|
513
|
-
purpose: "Filter nach Ferienanlage in der Suche der Website. Die
|
|
513
|
+
purpose: "Filter nach Ferienanlage in der Suche der Website. Die Auswahl der Ferienanlagen erzeugt der be-on! Hub selbst.",
|
|
514
514
|
entry: {
|
|
515
515
|
name: "Ferienanlage",
|
|
516
516
|
type: "SpecialFilter\\FacilityFilter",
|
|
@@ -520,7 +520,7 @@ const HUB_FILTER_REQUESTS = {
|
|
|
520
520
|
}
|
|
521
521
|
},
|
|
522
522
|
[V9_HUB_OFFERS_FILTER_KEY]: {
|
|
523
|
-
purpose: "
|
|
523
|
+
purpose: "Zeigt nur Unterkünfte mit einem Angebot.",
|
|
524
524
|
entry: {
|
|
525
525
|
name: "Angebote",
|
|
526
526
|
type: "SpecialFilter\\OffersFilter",
|
|
@@ -529,7 +529,7 @@ const HUB_FILTER_REQUESTS = {
|
|
|
529
529
|
}
|
|
530
530
|
},
|
|
531
531
|
[V9_HUB_OFFER_FILTER_KEY]: {
|
|
532
|
-
purpose: "
|
|
532
|
+
purpose: "Zeigt nur Unterkünfte mit einem bestimmten Angebot.",
|
|
533
533
|
entry: inputFilter({
|
|
534
534
|
name: "Angebot",
|
|
535
535
|
queryKey: "VofficeOffer.voffice_offer_id"
|
|
@@ -568,65 +568,43 @@ const renderMissingHubFilters = (missing) => {
|
|
|
568
568
|
const custom = missing.filter((key) => !requestable.includes(key));
|
|
569
569
|
return [
|
|
570
570
|
`Missing Hub filters: ${missing.join(", ")}.`,
|
|
571
|
-
...requestable.length === 0 ? [] : [`Run \`website-sdk hub-filters request${flags.map((flag) => ` ${flag}`).join("")}
|
|
572
|
-
...custom.length === 0 ? [] : [`
|
|
571
|
+
...requestable.length === 0 ? [] : [`Run \`website-sdk hub-filters request${flags.map((flag) => ` ${flag}`).join("")}\`; the user adds the entries in the be-on! Hub with the file it writes.`],
|
|
572
|
+
...custom.length === 0 ? [] : [`hub-filters request cannot write entries for ${custom.join(", ")}; a developer adds them in the be-on! Hub.`]
|
|
573
573
|
].join(" ");
|
|
574
574
|
};
|
|
575
|
-
const toMember = ({ key, entry }) => JSON.stringify({ [key]: entry }, null, 2).split("\n").slice(1, -1).map((line) => line.slice(2)).join("\n");
|
|
576
575
|
const json = (value) => JSON.stringify(value, null, 2);
|
|
577
|
-
const
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
return [
|
|
584
|
-
`### \`${key}\``,
|
|
585
|
-
"",
|
|
586
|
-
`Wofür: ${purpose}`,
|
|
587
|
-
"",
|
|
588
|
-
`Status: ${status}`,
|
|
589
|
-
"",
|
|
590
|
-
"```json",
|
|
591
|
-
toMember({
|
|
592
|
-
key,
|
|
593
|
-
entry
|
|
594
|
-
}),
|
|
595
|
-
"```"
|
|
596
|
-
].join("\n");
|
|
576
|
+
const existingHubFilterKeys = ({ keys, hubFilters }) => keys.filter((key) => hubFilters.some((filter) => filter.key === key));
|
|
577
|
+
const code = (keys) => keys.map((key) => `\`${key}\``).join(", ");
|
|
578
|
+
const renderHubFilterRequest = ({ beOnKey, keys, hubFilters }) => {
|
|
579
|
+
const existing = existingHubFilterKeys({
|
|
580
|
+
keys,
|
|
581
|
+
hubFilters
|
|
597
582
|
});
|
|
598
583
|
return [
|
|
599
|
-
"#
|
|
584
|
+
"# Filter im be-on! Hub eintragen",
|
|
600
585
|
"",
|
|
601
586
|
`be-on Key: \`${beOnKey}\``,
|
|
602
587
|
"",
|
|
603
|
-
|
|
604
|
-
"",
|
|
605
|
-
"Das Website-SDK braucht die folgenden Filter an diesem be-on Key. Ohne sie filtert die Suche nicht oder der Build der Website bricht ab.",
|
|
606
|
-
"",
|
|
607
|
-
"## Filter",
|
|
608
|
-
"",
|
|
609
|
-
sections.join("\n\n"),
|
|
610
|
-
"",
|
|
611
|
-
"## Vorgehen",
|
|
612
|
-
"",
|
|
613
|
-
"1. In Nova den VofficeFilter dieses be-on Keys öffnen.",
|
|
614
|
-
"2. Das bestehende JSON behalten, nichts löschen oder ersetzen.",
|
|
615
|
-
"3. Fehlende Einträge hinzufügen, unvollständige ergänzen.",
|
|
616
|
-
"4. Existiert ein Key bereits mit gleichem Namen: mit dem Eintrag oben vergleichen. Fehlt `custom_query`, ergänzen. Bedeutet der Key etwas anderes, nichts ändern und beim Website-Entwickler nachfragen.",
|
|
617
|
-
"5. Stable Filter (aus `stable-filters.json`, z. B. `pool`, `wifi`, `bedrooms`) nie kopieren, der Hub ergänzt sie selbst.",
|
|
618
|
-
"6. Speichern. Nova leert dabei den Hub-Filter-Cache.",
|
|
619
|
-
"7. Danach `website-sdk hub-filters check` ausführen.",
|
|
588
|
+
"Die Website braucht die Filter unten im be-on! Hub. Ohne sie filtert die Suche nicht oder die Website lässt sich nicht bauen.",
|
|
620
589
|
"",
|
|
621
|
-
|
|
590
|
+
...existing.length === 0 ? [] : [`> Achtung: Im be-on! Hub stehen für diesen be-on Key schon Filter (${code(existing)}). Den Code unten nicht einfügen, sondern diese Datei an einen Entwickler geben. Er führt die Einträge zusammen.`, ""],
|
|
591
|
+
"## So geht's",
|
|
622
592
|
"",
|
|
623
|
-
|
|
593
|
+
`1. Im be-on! Hub den be-on Key \`${beOnKey}\` suchen und öffnen.`,
|
|
594
|
+
"2. Unten im Bereich „vOffice-Filter“ den Filter bearbeiten. Gibt es dort noch keinen, einen neuen anlegen.",
|
|
595
|
+
"3. Das Feld „Filter“ muss leer sein. Steht dort schon etwas, nichts ändern und diese Datei an einen Entwickler geben. Er führt die Einträge zusammen.",
|
|
596
|
+
"4. Den Code unten komplett kopieren, in das leere Feld „Filter“ einfügen und speichern.",
|
|
597
|
+
"5. Danach Bescheid geben, dass die Filter eingetragen sind. Die Website prüft dann, ob alles da ist (`website-sdk hub-filters check`).",
|
|
624
598
|
"",
|
|
625
|
-
"
|
|
599
|
+
"## Code zum Einfügen",
|
|
626
600
|
"",
|
|
627
601
|
"```json",
|
|
628
602
|
json(Object.fromEntries(keys.map((key) => [key, HUB_FILTER_REQUESTS[key].entry]))),
|
|
629
603
|
"```",
|
|
604
|
+
"",
|
|
605
|
+
"## Was die Filter tun",
|
|
606
|
+
"",
|
|
607
|
+
...keys.map((key) => `- \`${key}\`: ${HUB_FILTER_REQUESTS[key].purpose}`),
|
|
630
608
|
""
|
|
631
609
|
].join("\n");
|
|
632
610
|
};
|
|
@@ -682,7 +660,7 @@ const toBackendFilterDefinitions = ({ keys, hubFilters }) => {
|
|
|
682
660
|
}
|
|
683
661
|
}] : [firstFacilityOption, ...otherFacilityOptions]
|
|
684
662
|
}));
|
|
685
|
-
notes.push(firstFacilityOption === void 0 ? `${V9_HUB_FACILITY_SEARCH_FILTER_KEY}: the Hub has no options for this key yet. Run this command again once
|
|
663
|
+
notes.push(firstFacilityOption === void 0 ? `${V9_HUB_FACILITY_SEARCH_FILTER_KEY}: the Hub has no options for this key yet. Run this command again once the Hub entry is saved.` : `${V9_HUB_FACILITY_SEARCH_FILTER_KEY}: options come from the Hub (vOffice facility IDs, not rental.property.id). The English labels are the German names; translate them.`);
|
|
686
664
|
}
|
|
687
665
|
if (keys.includes("offers")) definitions.push(definition({
|
|
688
666
|
key: V9_HUB_OFFERS_FILTER_KEY,
|
|
@@ -710,12 +688,20 @@ const renderRequestSummary = ({ file, keys, hubFilters }) => {
|
|
|
710
688
|
keys,
|
|
711
689
|
hubFilters
|
|
712
690
|
});
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
691
|
+
const existing = existingHubFilterKeys({
|
|
692
|
+
keys,
|
|
693
|
+
hubFilters
|
|
694
|
+
});
|
|
695
|
+
return [
|
|
696
|
+
`Wrote ${file}. Show the user its steps and code: they paste the code into the be-on! Hub themselves. Once they have saved it, run \`website-sdk hub-filters check\`; when it passes, delete ${file}.`,
|
|
697
|
+
...existing.length === 0 ? [] : [`The be-on! Hub already has ${existing.join(", ")} for this be-on key, so its filter field is not empty: the file asks the user to hand it to a developer instead.`],
|
|
698
|
+
...definitions.length === 0 ? [] : [
|
|
699
|
+
"",
|
|
700
|
+
"Add these to customAttributeFilterDefinitions:",
|
|
701
|
+
json(definitions),
|
|
702
|
+
...notes.length === 0 ? [] : ["", ...notes.map((note) => `- ${note}`)]
|
|
703
|
+
]
|
|
704
|
+
].join("\n");
|
|
719
705
|
};
|
|
720
706
|
//#endregion
|
|
721
707
|
//#region src/cli/commands/v9-hub-filters.ts
|
|
@@ -775,11 +761,11 @@ const request = Command.make("request", {
|
|
|
775
761
|
});
|
|
776
762
|
if (keys.length === 0) return yield* Console.log("Nothing to request: pass --object-group, --facility, --offers, --offer or --unit. No file written.");
|
|
777
763
|
const hubFilters = yield* loadHubFilters(config);
|
|
764
|
+
if (keys.every((key) => hubFilters.some((filter) => filter.key === key))) return yield* Console.log(`The be-on! Hub already has ${keys.join(", ")}. No file written; run \`website-sdk hub-filters check\`.`);
|
|
778
765
|
yield* writeTextFile({
|
|
779
766
|
path: out,
|
|
780
767
|
text: renderHubFilterRequest({
|
|
781
768
|
beOnKey: config.apiKey,
|
|
782
|
-
graphqlUrl: config.graphqlUrl,
|
|
783
769
|
keys,
|
|
784
770
|
hubFilters
|
|
785
771
|
})
|
|
@@ -789,7 +775,7 @@ const request = Command.make("request", {
|
|
|
789
775
|
keys,
|
|
790
776
|
hubFilters
|
|
791
777
|
}));
|
|
792
|
-
})).pipe(Command.withDescription("Write a Markdown
|
|
778
|
+
})).pipe(Command.withDescription("Write a Markdown file with the be-on! Hub filters this site needs and how to add them."), Command.withExamples([{
|
|
793
779
|
command: "website-sdk --backend v9 hub-filters request --object-group --offers",
|
|
794
780
|
description: "Write hub-filter-request.md for an object group and an offers filter."
|
|
795
781
|
}, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { m as customDataAttribute, t as voucherValidityQuery, v as parseVofficeUnitData } from "./operations-CfjJjdrw.mjs";
|
|
2
2
|
import { AvailabilityService, BookingBookOutput, BookingService, ContactService, CoreSDKError, DEFAULT_RENTAL_HIGHLIGHT_PRIORITIZATION, DEFAULT_RENTAL_PROPERTY_HIGHLIGHT_PRIORITIZATION, DocumentsService, EMPTY_CUSTOM_ATTRIBUTE_REGISTRY, FilterService, QuoteService, RentalService, SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS, SearchService, TranslationService, addGuestQuoteAdditionalServiceSelection, asArray, asRecord, assertNoNestedCustomAttributeFilterCompositions, assertNoReservedQueryKeys, assertUniqueCustomFilterQueryKeys, assertUniqueFilterQueryKeys, clearGuestQuoteAdditionalServiceSelections, collectQueryParameters, createCoreRuntime, daysBetweenLocalDates, expandCustomAttributeFilterCompositions, firstNumber, firstString, formatCurrency, formatLocalDate, getBookingBookGuestToken, getGuestQuoteBackendContext, getGuestQuoteInput, isDisplayableCustomAttribute, localeToLanguage, makeMinIntervalLimiter, makeTranslationLive, parseQueryParameters, refreshGuestQuoteInsurancePassthrough, removeGuestQuoteAdditionalServiceSelection, selectGuestQuoteCancellationPolicySelection, toCustomAttributeFilterLabel, toCustomAttributeFilterOutputItem, toCustomAttributeList, toInitialAvailabilityCalendarDays, toIsoDateFromPeriodQueryDate, toQueryString, toResolvedCustomAttributeCategoryTranslationKey, toStartDateSelectedCalendarDays, validateContactSubmitInput, withGuestQuoteInsurance, withGuestQuoteInsuranceRefresh } from "@v-office/sdk-core";
|
|
3
|
-
import { Context, Data, DateTime, Duration, Effect, Layer, Schema, SchemaGetter } from "effect";
|
|
3
|
+
import { Clock, Context, Data, DateTime, Duration, Effect, Layer, Schema, SchemaGetter } from "effect";
|
|
4
4
|
import { FetchHttpClient, HttpClient, HttpClientRequest } from "effect/unstable/http";
|
|
5
5
|
import { Kind, print, visit } from "graphql";
|
|
6
6
|
//#region codegen/v9/graphql-codegen/stable-filters.json
|
|
@@ -1688,11 +1688,34 @@ const toFirstCalculationDate = ({ availability, now }) => {
|
|
|
1688
1688
|
return [Object.keys(availability.caldata_beon).toSorted()[0], today].filter((date) => date != null).toSorted().at(-1);
|
|
1689
1689
|
};
|
|
1690
1690
|
//#endregion
|
|
1691
|
+
//#region src/legacy-v9/parser/availability/to-rent-night-prices.ts
|
|
1692
|
+
const toRentNightPrices = (servicePrices) => servicePrices.flatMap((row) => row.type === "RENT" && row.calculation === "NIGHT" && typeof row.price === "number" && typeof row.from_date === "string" && typeof row.till_date === "string" ? [{
|
|
1693
|
+
fromDate: row.from_date,
|
|
1694
|
+
tillDate: row.till_date,
|
|
1695
|
+
minNights: row.night_range_min ?? 1,
|
|
1696
|
+
maxNights: row.night_range_max ?? Number.POSITIVE_INFINITY,
|
|
1697
|
+
price: row.price
|
|
1698
|
+
}] : []);
|
|
1699
|
+
const toRentNightPrice = ({ rentNightPrices, night, nights }) => {
|
|
1700
|
+
let price;
|
|
1701
|
+
for (const row of rentNightPrices) {
|
|
1702
|
+
if (night < row.fromDate || night >= row.tillDate) continue;
|
|
1703
|
+
if (nights < row.minNights || nights > row.maxNights) continue;
|
|
1704
|
+
price = Math.max(price ?? row.price, row.price);
|
|
1705
|
+
}
|
|
1706
|
+
return price;
|
|
1707
|
+
};
|
|
1708
|
+
//#endregion
|
|
1691
1709
|
//#region src/legacy-v9/parser/availability/to-initial-availability-calendar-days.ts
|
|
1692
|
-
const applyV9CalendarPrices = ({ availability, calendarDays, locale, currency }) => {
|
|
1710
|
+
const applyV9CalendarPrices = ({ availability, calendarDays, locale, currency, rentNightPrices = [] }) => {
|
|
1693
1711
|
const result = { ...calendarDays };
|
|
1694
1712
|
for (const [date, day] of Object.entries(calendarDays)) {
|
|
1695
|
-
const
|
|
1713
|
+
const calendarDay = availability.caldata_beon[date];
|
|
1714
|
+
const price = calendarDay === void 0 ? void 0 : toRentNightPrice({
|
|
1715
|
+
rentNightPrices,
|
|
1716
|
+
night: date,
|
|
1717
|
+
nights: calendarDay.minStay
|
|
1718
|
+
}) ?? calendarDay.price;
|
|
1696
1719
|
if (day.isAvailableDate && typeof price === "number") result[date] = {
|
|
1697
1720
|
...day,
|
|
1698
1721
|
formattedPrice: formatCurrency(price, locale, currency ?? "EUR")
|
|
@@ -1700,11 +1723,12 @@ const applyV9CalendarPrices = ({ availability, calendarDays, locale, currency })
|
|
|
1700
1723
|
}
|
|
1701
1724
|
return result;
|
|
1702
1725
|
};
|
|
1703
|
-
const toInitialAvailabilityCalendarDays$1 = ({ availability, currency, ...input }) => toInitialAvailabilityCalendarDays(input).pipe(Effect.map((calendarDays) => applyV9CalendarPrices({
|
|
1726
|
+
const toInitialAvailabilityCalendarDays$1 = ({ availability, currency, rentNightPrices, ...input }) => toInitialAvailabilityCalendarDays(input).pipe(Effect.map((calendarDays) => applyV9CalendarPrices({
|
|
1704
1727
|
availability,
|
|
1705
1728
|
calendarDays,
|
|
1706
1729
|
locale: input.input.locale,
|
|
1707
|
-
...currency === void 0 ? {} : { currency }
|
|
1730
|
+
...currency === void 0 ? {} : { currency },
|
|
1731
|
+
...rentNightPrices === void 0 ? {} : { rentNightPrices }
|
|
1708
1732
|
})));
|
|
1709
1733
|
//#endregion
|
|
1710
1734
|
//#region src/legacy-v9/parser/availability/to-occupancy-limits.ts
|
|
@@ -1742,6 +1766,29 @@ const toOccupancyLimits = ({ unit }) => {
|
|
|
1742
1766
|
};
|
|
1743
1767
|
};
|
|
1744
1768
|
//#endregion
|
|
1769
|
+
//#region src/legacy-v9/parser/availability/to-start-date-selected-calendar-days.ts
|
|
1770
|
+
const toNightBefore = (date) => DateTime.formatIsoDateUtc(DateTime.subtract(DateTime.makeUnsafe(date), { days: 1 }));
|
|
1771
|
+
const applyV9EndDatePrices = ({ availability, calendarDays, selectedStartDate, locale, currency, rentNightPrices = [] }) => {
|
|
1772
|
+
const result = {};
|
|
1773
|
+
for (const [date, day] of Object.entries(calendarDays)) {
|
|
1774
|
+
const endDate = date;
|
|
1775
|
+
const lastNight = toNightBefore(date);
|
|
1776
|
+
const price = day.canBeEndDate ? toRentNightPrice({
|
|
1777
|
+
rentNightPrices,
|
|
1778
|
+
night: lastNight,
|
|
1779
|
+
nights: daysBetweenLocalDates({
|
|
1780
|
+
start: selectedStartDate,
|
|
1781
|
+
end: endDate
|
|
1782
|
+
})
|
|
1783
|
+
}) ?? availability.caldata_beon[lastNight]?.price : void 0;
|
|
1784
|
+
result[endDate] = {
|
|
1785
|
+
...day,
|
|
1786
|
+
formattedPrice: typeof price === "number" ? formatCurrency(price, locale, currency ?? "EUR") : null
|
|
1787
|
+
};
|
|
1788
|
+
}
|
|
1789
|
+
return result;
|
|
1790
|
+
};
|
|
1791
|
+
//#endregion
|
|
1745
1792
|
//#region translations/v9/de-DE/core.json
|
|
1746
1793
|
var core_default$1 = {
|
|
1747
1794
|
"Rental.rentalType.option.HOUSE": "Haus",
|
|
@@ -3281,6 +3328,7 @@ const toVofficeUnitId$2 = (input) => {
|
|
|
3281
3328
|
message: `Expected rentalId to be a vOffice unit ID, received "${input.rentalId}".`
|
|
3282
3329
|
}));
|
|
3283
3330
|
};
|
|
3331
|
+
const RENT_NIGHT_PRICES_TTL_MILLIS = 3e5;
|
|
3284
3332
|
const makeV9AvailabilityApi = ({ config, options }) => {
|
|
3285
3333
|
const translations = makeV9TranslationService(options.translationOverrides);
|
|
3286
3334
|
const openApiClientLive = makeV1OpenApiClientFetchLive({
|
|
@@ -3288,6 +3336,7 @@ const makeV9AvailabilityApi = ({ config, options }) => {
|
|
|
3288
3336
|
...config.v1ApiBaseUrl === void 0 ? {} : { baseUrl: config.v1ApiBaseUrl }
|
|
3289
3337
|
});
|
|
3290
3338
|
const unitDetailsByUnitId = /* @__PURE__ */ new Map();
|
|
3339
|
+
const rentNightPricesByUnitId = /* @__PURE__ */ new Map();
|
|
3291
3340
|
const loadAvailability = (input) => Effect.gen(function* () {
|
|
3292
3341
|
const client = yield* V1OpenApiClient;
|
|
3293
3342
|
const unitId = yield* toVofficeUnitId$2(input);
|
|
@@ -3318,10 +3367,35 @@ const makeV9AvailabilityApi = ({ config, options }) => {
|
|
|
3318
3367
|
unitDetailsByUnitId.set(unitId, details);
|
|
3319
3368
|
return details;
|
|
3320
3369
|
}).pipe(Effect.provide(openApiClientLive));
|
|
3370
|
+
const loadRentNightPrices = (input) => Effect.gen(function* () {
|
|
3371
|
+
const client = yield* V1OpenApiClient;
|
|
3372
|
+
const unitId = yield* toVofficeUnitId$2(input);
|
|
3373
|
+
const now = yield* Clock.currentTimeMillis;
|
|
3374
|
+
const cached = rentNightPricesByUnitId.get(unitId);
|
|
3375
|
+
if (cached !== void 0 && now - cached.loadedAt < RENT_NIGHT_PRICES_TTL_MILLIS) return cached.rentNightPrices;
|
|
3376
|
+
const result = yield* client.execute("listUnitServicePrices", {
|
|
3377
|
+
path: { voffice_unit: unitId },
|
|
3378
|
+
query: { language: localeToLanguage(input.locale) }
|
|
3379
|
+
}).pipe(Effect.match({
|
|
3380
|
+
onFailure: () => void 0,
|
|
3381
|
+
onSuccess: (result) => result
|
|
3382
|
+
}));
|
|
3383
|
+
if (result === void 0) return void 0;
|
|
3384
|
+
const rentNightPrices = toRentNightPrices(result.data);
|
|
3385
|
+
rentNightPricesByUnitId.set(unitId, {
|
|
3386
|
+
rentNightPrices,
|
|
3387
|
+
loadedAt: now
|
|
3388
|
+
});
|
|
3389
|
+
return rentNightPrices;
|
|
3390
|
+
}).pipe(Effect.provide(openApiClientLive));
|
|
3321
3391
|
return {
|
|
3322
3392
|
getInitialAvailability: (input) => Effect.runPromise(Effect.gen(function* () {
|
|
3323
3393
|
const now = yield* DateTime.now;
|
|
3324
|
-
const [availability, unitDetails] = yield* Effect.all([
|
|
3394
|
+
const [availability, unitDetails, rentNightPrices] = yield* Effect.all([
|
|
3395
|
+
loadAvailability(input),
|
|
3396
|
+
loadUnitDetails(input),
|
|
3397
|
+
loadRentNightPrices(input)
|
|
3398
|
+
], { concurrency: "unbounded" });
|
|
3325
3399
|
const currency = unitDetails?.currency;
|
|
3326
3400
|
const firstCalculationDate = toFirstCalculationDate({
|
|
3327
3401
|
availability,
|
|
@@ -3335,24 +3409,38 @@ const makeV9AvailabilityApi = ({ config, options }) => {
|
|
|
3335
3409
|
firstCalculationDate,
|
|
3336
3410
|
availabilityRestrictionsByDate,
|
|
3337
3411
|
translations,
|
|
3338
|
-
...currency === void 0 ? {} : { currency }
|
|
3412
|
+
...currency === void 0 ? {} : { currency },
|
|
3413
|
+
...rentNightPrices === void 0 ? {} : { rentNightPrices }
|
|
3339
3414
|
}),
|
|
3340
3415
|
...unitDetails?.occupancyLimits ?? NO_OCCUPANCY_LIMITS
|
|
3341
3416
|
};
|
|
3342
3417
|
})),
|
|
3343
3418
|
getStartDateSelectedAvailability: (input) => Effect.runPromise(Effect.gen(function* () {
|
|
3344
3419
|
const now = yield* DateTime.now;
|
|
3345
|
-
const availability = yield*
|
|
3420
|
+
const [availability, unitDetails, rentNightPrices] = yield* Effect.all([
|
|
3421
|
+
loadAvailability(input),
|
|
3422
|
+
loadUnitDetails(input),
|
|
3423
|
+
loadRentNightPrices(input)
|
|
3424
|
+
], { concurrency: "unbounded" });
|
|
3425
|
+
const currency = unitDetails?.currency;
|
|
3346
3426
|
const firstCalculationDate = toFirstCalculationDate({
|
|
3347
3427
|
availability,
|
|
3348
3428
|
now
|
|
3349
3429
|
});
|
|
3350
3430
|
const availabilityRestrictionsByDate = toAvailabilityRestrictionsByDate({ availability });
|
|
3351
|
-
|
|
3431
|
+
const calendarDays = yield* toStartDateSelectedCalendarDays({
|
|
3352
3432
|
input,
|
|
3353
3433
|
firstCalculationDate,
|
|
3354
3434
|
availabilityRestrictionsByDate,
|
|
3355
3435
|
translations
|
|
3436
|
+
});
|
|
3437
|
+
return { calendarDays: applyV9EndDatePrices({
|
|
3438
|
+
availability,
|
|
3439
|
+
calendarDays,
|
|
3440
|
+
selectedStartDate: input.selectedStartDate,
|
|
3441
|
+
locale: input.locale,
|
|
3442
|
+
...currency === void 0 ? {} : { currency },
|
|
3443
|
+
...rentNightPrices === void 0 ? {} : { rentNightPrices }
|
|
3356
3444
|
}) };
|
|
3357
3445
|
}))
|
|
3358
3446
|
};
|
|
@@ -5896,7 +5984,7 @@ const applyV9RentalIdsToSearchQueryInput = ({ input, rentalIdsIn, rentalIdsSearc
|
|
|
5896
5984
|
if (!rentalIdsSearch) return yield* Effect.fail(new CoreSDKError({
|
|
5897
5985
|
source: "v9",
|
|
5898
5986
|
operation: "v9.search",
|
|
5899
|
-
message: `rentalIdsIn needs rentalIdsSearch: true in the v9 config and a "${V9_HUB_RENTAL_IDS_FILTER_KEY}" filter in the be-on! Hub. Run \`website-sdk hub-filters request --unit\` and
|
|
5987
|
+
message: `rentalIdsIn needs rentalIdsSearch: true in the v9 config and a "${V9_HUB_RENTAL_IDS_FILTER_KEY}" filter in the be-on! Hub. Run \`website-sdk hub-filters request --unit\` and add its entry in the be-on! Hub.`
|
|
5900
5988
|
}));
|
|
5901
5989
|
if (Array.isArray(rentalIdsIn) && rentalIdsIn.length === 0) return input;
|
|
5902
5990
|
const rentalIds = toV9RentalIds(rentalIdsIn);
|
|
@@ -5981,7 +6069,7 @@ const parseV9SearchCursor = (cursor) => Effect.gen(function* () {
|
|
|
5981
6069
|
return page;
|
|
5982
6070
|
});
|
|
5983
6071
|
const loadV9SearchRuntime = Effect.tryPromise({
|
|
5984
|
-
try: () => import("./search-
|
|
6072
|
+
try: () => import("./search-DPsBki_9.mjs"),
|
|
5985
6073
|
catch: (cause) => new CoreSDKError({
|
|
5986
6074
|
source: "v9",
|
|
5987
6075
|
operation: "v9.search.runtime",
|
|
@@ -6730,7 +6818,7 @@ const orderRentalsById = ({ rentalIds, rentals, missing }) => {
|
|
|
6730
6818
|
});
|
|
6731
6819
|
};
|
|
6732
6820
|
const loadV9RentalsRuntime = Effect.tryPromise({
|
|
6733
|
-
try: () => import("./rentals-
|
|
6821
|
+
try: () => import("./rentals-cmqp5dTw.mjs"),
|
|
6734
6822
|
catch: (cause) => new CoreSDKError({
|
|
6735
6823
|
source: "v9",
|
|
6736
6824
|
operation: "v9.rentals.runtime",
|
|
@@ -6864,7 +6952,7 @@ const makeV9RentalsApi = ({ config, options }) => {
|
|
|
6864
6952
|
if (missingHubFilterKeys.length > 0) return yield* Effect.fail(new CoreSDKError({
|
|
6865
6953
|
source: "v9",
|
|
6866
6954
|
operation: "v9.rentals.hub-filters",
|
|
6867
|
-
message: "The be-on! Hub lacks filters for this API key: " + missingHubFilterKeys.map((key) => `"${key}" (${HUB_FILTER_PURPOSES[key]})`).join(", ") + ". Run `website-sdk hub-filters request` and
|
|
6955
|
+
message: "The be-on! Hub lacks filters for this API key: " + missingHubFilterKeys.map((key) => `"${key}" (${HUB_FILTER_PURPOSES[key]})`).join(", ") + ". Run `website-sdk hub-filters request` and add its entries in the be-on! Hub."
|
|
6868
6956
|
}));
|
|
6869
6957
|
});
|
|
6870
6958
|
const [checkHubFiltersOnce, invalidateHubFiltersCheck] = Effect.runSync(Effect.cachedInvalidateWithTTL(checkHubFilters, Duration.infinity));
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AdditionalServiceLimitExceeded, 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, 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, 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, V9OnlyCustomAttributeInput, 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, 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, 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, V9OnlyCustomAttributeInput, 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";
|
|
@@ -99,6 +99,12 @@ type V9InitialAvailabilityOutput = AvailabilityGetInitialAvailabilityOutput$1 &
|
|
|
99
99
|
readonly childrenAllowed: boolean | null;
|
|
100
100
|
readonly maxPets: number | null;
|
|
101
101
|
};
|
|
102
|
+
type V9EndDateOption = AvailabilityEndDateOption & {
|
|
103
|
+
readonly formattedPrice: string | null;
|
|
104
|
+
};
|
|
105
|
+
type V9StartDateSelectedAvailabilityOutput = {
|
|
106
|
+
readonly calendarDays: Record<LocalDateString, V9EndDateOption>;
|
|
107
|
+
};
|
|
102
108
|
//#endregion
|
|
103
109
|
//#region src/legacy-v9/rental-ids.d.ts
|
|
104
110
|
type V9RentalsGetRentalsByIdsInput = {
|
|
@@ -207,8 +213,9 @@ type WebsiteSDKV10AllRentalsAtOnceLive = Omit<WebsiteSDKSharedLive, "search"> &
|
|
|
207
213
|
readonly search: (input: SearchAllRentalsAtOnceInput$1) => Promise<SearchSearchOutput$1>;
|
|
208
214
|
};
|
|
209
215
|
};
|
|
210
|
-
type WebsiteSDKV9LiveAvailability =
|
|
216
|
+
type WebsiteSDKV9LiveAvailability = {
|
|
211
217
|
readonly getInitialAvailability: (input: AvailabilityGetInitialAvailabilityInput$1) => Promise<V9InitialAvailabilityOutput>;
|
|
218
|
+
readonly getStartDateSelectedAvailability: (input: AvailabilityGetStartDateSelectedAvailabilityInput$1) => Promise<V9StartDateSelectedAvailabilityOutput>;
|
|
212
219
|
};
|
|
213
220
|
type WebsiteSDKV9LiveVoucher = {
|
|
214
221
|
readonly validate: (input: V9VoucherValidateInput) => Promise<V9VoucherValidateOutput>;
|
|
@@ -7660,4 +7667,4 @@ export type RentalRentalsOutput = RentalGetRentalsOutput$1[number];
|
|
|
7660
7667
|
export type RentalSearchInput = SearchSearchInput$1;
|
|
7661
7668
|
export type RentalSearchOutput = SearchSearchOutput$1;
|
|
7662
7669
|
//#endregion
|
|
7663
|
-
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 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 V9InitialAvailabilityOutput, type V9OnlyCustomAttributeInput, type V9PropertyHighlightDataAttribute, type V9PropertyHighlightSourceInput, type V9PropertyHighlightSourceRegistry, type V9PropertyHighlightSourcesInput, type V9RentalsGetRentalsByIdsInput, type V9ReviewCriterion, type V9ReviewCriterionDataAttribute, type V9ReviewsOptions, type V9SearchAllRentalsAtOnceInput, type V9SearchPagesInput, type V9SearchSearchInput, type V9SearchSearchOutput, type V9SearchSearchOutputItem, type V9SearchSearchSort, 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 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, defineWebsiteSDKOptions as defineCMSSDKOptions, defineCustomAttributes, defineCustomAttributesFromUnknown, fetchCustomAttributeCatalog, parseCustomAttributeCatalog, validateContactSubmitInput };
|
|
7670
|
+
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 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 V9EndDateOption, type V9InitialAvailabilityOutput, type V9OnlyCustomAttributeInput, type V9PropertyHighlightDataAttribute, type V9PropertyHighlightSourceInput, type V9PropertyHighlightSourceRegistry, type V9PropertyHighlightSourcesInput, type V9RentalsGetRentalsByIdsInput, type V9ReviewCriterion, type V9ReviewCriterionDataAttribute, type V9ReviewsOptions, type V9SearchAllRentalsAtOnceInput, type V9SearchPagesInput, type V9SearchSearchInput, type V9SearchSearchOutput, type V9SearchSearchOutputItem, type V9SearchSearchSort, type V9StartDateSelectedAvailabilityOutput, 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 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, defineWebsiteSDKOptions as defineCMSSDKOptions, defineCustomAttributes, defineCustomAttributesFromUnknown, fetchCustomAttributeCatalog, parseCustomAttributeCatalog, validateContactSubmitInput };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as RawObjectResponseSchema, A as DocumentStatusUpdateRequestSchema, At as getBankTransferDetailsEffect, B as ErgoPolicyNumberRequestSchema, Bt as selectCancellationPolicyEffect, C as CalendarResponseSchema, Ct as VideoResponseSchema, D as DocumentResourceResponseSchema, Dt as bookInsuranceEffect, E as DocumentCollectionResponseSchema, Et as bookEffect, F as ErgoBookRequestSchema, Ft as getTermsAndPrivacyPolicyEffect, G as OnOfficeUnitSchema, Gt as submitPaymentOptionEffect, H as ErgoTripAndCustomerRequestSchema, Ht as selectInsurancePaymentEffect, I as ErgoCommonFieldsSchema, It as mapSearchEffect, J as QuoteLineSchema, Jt as defineV9PropertyHighlightSourcesFromUnknown, K as PaymentScheduleItemSchema, Kt as defineWebsiteSDKOptions, L as ErgoCreatePreContractRequestSchema, Lt as quoteEffect, M as DocumentTypeSchema, Mt as getInitialAvailabilityEffect, N as ErgoAddressSchema, Nt as getRentalsEffect, O as DocumentResourceSchema, Ot as clearAdditionalServicesEffect, P as ErgoBankSchema, Pt as getStartDateSelectedAvailabilityEffect, Q as QuoteServiceSchema, R as ErgoPersonSchema, Rt as removeAdditionalServiceEffect, S as CalendarDaySchema, St as V1_OPERATIONS, T as CustomerUnitSummarySchema, Tt as addAdditionalServiceEffect, U as FacilityListResponseSchema, Ut as submitContactEffect, V as ErgoReadPreContractRequestSchema, Vt as selectInsuranceEffect, W as OnOfficeUnitCollectionResponseSchema, Wt as submitPaymentOption, X as QuotePricesResponseSchema, Y as QuotePricesPayloadSchema, Z as QuoteSchema, _ as V1OpenApiClient, _t as UnitListResponseSchema, at as ServiceImageSchema, b as makeV1OpenApiClientLive, bt as UnitServicePriceSchema, ct as SetupDataSchema, dt as TileSchema, et as RawVofficeObjectSchema, ft as TileTagSchema, g as makeV0OpenApiClientLive, gt as UnitListItemSchema, h as makeV0OpenApiClientFetchLive, ht as UnitIdsResponseSchema, it as ServiceBeonDataSchema, j as DocumentSummarySchema, jt as getFiltersEffect, k as DocumentStatusSchema, kt as createInsurancePreContractEffect, lt as SetupResponseSchema, m as V0OpenApiClientError, mt as TravelInsuranceBookingStoreRequestSchema, nt as RoomImageSchema, ot as ServiceLimitSchema, p as V0OpenApiClient, pt as TravelInsuranceBookingSchema, q as PaymentScheduleSchema, qt as defineV9PropertyHighlightSources, rt as SearchPropertiesResponseSchema, st as ServiceListResponseSchema, t as createWebsiteSDK, tt as RegionListResponseSchema, ut as TileCollectionResponseSchema, v as V1OpenApiClientError, vt as UnitOfferSchema, w as CurrentMemberResponseSchema, wt as decodeV1OperationResponse, x as ApiEnvelopeBaseSchema, xt as V1_BASE_URL, y as makeV1OpenApiClientFetchLive, yt as UnitResponseSchema, z as ErgoPlanSearchRequestSchema, zt as searchEffect } from "./client-
|
|
1
|
+
import { $ as RawObjectResponseSchema, A as DocumentStatusUpdateRequestSchema, At as getBankTransferDetailsEffect, B as ErgoPolicyNumberRequestSchema, Bt as selectCancellationPolicyEffect, C as CalendarResponseSchema, Ct as VideoResponseSchema, D as DocumentResourceResponseSchema, Dt as bookInsuranceEffect, E as DocumentCollectionResponseSchema, Et as bookEffect, F as ErgoBookRequestSchema, Ft as getTermsAndPrivacyPolicyEffect, G as OnOfficeUnitSchema, Gt as submitPaymentOptionEffect, H as ErgoTripAndCustomerRequestSchema, Ht as selectInsurancePaymentEffect, I as ErgoCommonFieldsSchema, It as mapSearchEffect, J as QuoteLineSchema, Jt as defineV9PropertyHighlightSourcesFromUnknown, K as PaymentScheduleItemSchema, Kt as defineWebsiteSDKOptions, L as ErgoCreatePreContractRequestSchema, Lt as quoteEffect, M as DocumentTypeSchema, Mt as getInitialAvailabilityEffect, N as ErgoAddressSchema, Nt as getRentalsEffect, O as DocumentResourceSchema, Ot as clearAdditionalServicesEffect, P as ErgoBankSchema, Pt as getStartDateSelectedAvailabilityEffect, Q as QuoteServiceSchema, R as ErgoPersonSchema, Rt as removeAdditionalServiceEffect, S as CalendarDaySchema, St as V1_OPERATIONS, T as CustomerUnitSummarySchema, Tt as addAdditionalServiceEffect, U as FacilityListResponseSchema, Ut as submitContactEffect, V as ErgoReadPreContractRequestSchema, Vt as selectInsuranceEffect, W as OnOfficeUnitCollectionResponseSchema, Wt as submitPaymentOption, X as QuotePricesResponseSchema, Y as QuotePricesPayloadSchema, Z as QuoteSchema, _ as V1OpenApiClient, _t as UnitListResponseSchema, at as ServiceImageSchema, b as makeV1OpenApiClientLive, bt as UnitServicePriceSchema, ct as SetupDataSchema, dt as TileSchema, et as RawVofficeObjectSchema, ft as TileTagSchema, g as makeV0OpenApiClientLive, gt as UnitListItemSchema, h as makeV0OpenApiClientFetchLive, ht as UnitIdsResponseSchema, it as ServiceBeonDataSchema, j as DocumentSummarySchema, jt as getFiltersEffect, k as DocumentStatusSchema, kt as createInsurancePreContractEffect, lt as SetupResponseSchema, m as V0OpenApiClientError, mt as TravelInsuranceBookingStoreRequestSchema, nt as RoomImageSchema, ot as ServiceLimitSchema, p as V0OpenApiClient, pt as TravelInsuranceBookingSchema, q as PaymentScheduleSchema, qt as defineV9PropertyHighlightSources, rt as SearchPropertiesResponseSchema, st as ServiceListResponseSchema, t as createWebsiteSDK, tt as RegionListResponseSchema, ut as TileCollectionResponseSchema, v as V1OpenApiClientError, vt as UnitOfferSchema, w as CurrentMemberResponseSchema, wt as decodeV1OperationResponse, x as ApiEnvelopeBaseSchema, xt as V1_BASE_URL, y as makeV1OpenApiClientFetchLive, yt as UnitResponseSchema, z as ErgoPlanSearchRequestSchema, zt as searchEffect } from "./client-CKVwzIQ4.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,8 @@
|
|
|
4
4
|
|
|
5
5
|
Release notes of `@v-office/website-sdk`, newest first. Each version has its own directory.
|
|
6
6
|
|
|
7
|
+
- `versions/2.30.1/CHANGELOG.md`: release notes for 2.30.1
|
|
8
|
+
- `versions/2.30.0/CHANGELOG.md`: release notes for 2.30.0
|
|
7
9
|
- `versions/2.29.0/CHANGELOG.md`: release notes for 2.29.0
|
|
8
10
|
- `versions/2.28.1/CHANGELOG.md`: release notes for 2.28.1
|
|
9
11
|
- `versions/2.28.0/CHANGELOG.md`: release notes for 2.28.0
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
Migration guides of `@v-office/website-sdk`, newest first. Apply them in order when skipping versions.
|
|
6
6
|
|
|
7
|
+
- `versions/2.30.1/MIGRATION.md`: Migration: 2.30.0 to 2.30.1
|
|
8
|
+
- `versions/2.30.0/MIGRATION.md`: Migration: 2.29.0 to 2.30.0
|
|
7
9
|
- `versions/2.29.0/MIGRATION.md`: Migration: 2.28.1 to 2.29.0
|
|
8
10
|
- `versions/2.28.1/MIGRATION.md`: Migration: 2.28.0 to 2.28.1
|
|
9
11
|
- `versions/2.28.0/MIGRATION.md`: Migration: 2.27.0 to 2.28.0
|
|
@@ -107,9 +107,9 @@ From 2.18.0, available dates that cannot be used as a start date also expose a
|
|
|
107
107
|
price when the source supplies one. The same rule applies to v10 initial
|
|
108
108
|
availability. `formattedPrice` remains `null` when the date is unavailable or
|
|
109
109
|
the source supplies no numeric price.
|
|
110
|
-
|
|
110
|
+
v10 start-date-selected availability does not include calendar prices.
|
|
111
111
|
|
|
112
|
-
When no successful unit lookup is cached, a v9
|
|
112
|
+
When no successful unit lookup is cached, a v9 availability request loads
|
|
113
113
|
the calendar and a unit record. Successful unit responses are cached by unit ID
|
|
114
114
|
for the lifetime of the SDK instance, including responses without a currency.
|
|
115
115
|
Failed unit requests are not cached and are retried on the next call. A missing
|
|
@@ -122,6 +122,26 @@ No new configuration is required. The currency lookup uses the existing
|
|
|
122
122
|
See `versions/2.18.0/CHANGELOG.md` and
|
|
123
123
|
`versions/2.18.0/MIGRATION.md`.
|
|
124
124
|
|
|
125
|
+
### Legacy v9 Prices by Length of Stay
|
|
126
|
+
|
|
127
|
+
From 2.30.0, v9 calendar prices follow the rental's rates by number of nights.
|
|
128
|
+
Each night is priced by its own season, as the quote does.
|
|
129
|
+
|
|
130
|
+
- `getInitialAvailability` prices each day at the rate for the minimum stay
|
|
131
|
+
that applies from that day.
|
|
132
|
+
- `getStartDateSelectedAvailability` returns `formattedPrice` on every day
|
|
133
|
+
(`V9StartDateSelectedAvailabilityOutput`). On a day that can be the end date
|
|
134
|
+
it is the price of the last night of a stay from the selected start date to
|
|
135
|
+
that day, at the rate for that number of nights. On all other days it is
|
|
136
|
+
`null`.
|
|
137
|
+
|
|
138
|
+
When the rental's price list cannot be loaded or has no rate for a day, both
|
|
139
|
+
calls use the calendar price described above. The price list is cached per
|
|
140
|
+
rental for five minutes for the lifetime of the SDK instance.
|
|
141
|
+
|
|
142
|
+
See `versions/2.30.0/CHANGELOG.md` and
|
|
143
|
+
`versions/2.30.0/MIGRATION.md`.
|
|
144
|
+
|
|
125
145
|
### Legacy v9 Occupancy Limits
|
|
126
146
|
|
|
127
147
|
From 2.28.0, v9 initial availability reads its occupancy limits from the same
|
|
@@ -212,8 +212,8 @@ const options = defineWebsiteSDKOptions({
|
|
|
212
212
|
- Search, `searchPages` and `mapSearch` apply the scope through the Hub filter
|
|
213
213
|
`facility_scope` or `objectGroup_scope`, with and without a period. The static
|
|
214
214
|
`getRentals` fails the build until the be-on! Hub has that entry, and names the
|
|
215
|
-
missing key. Run `website-sdk hub-filters request
|
|
216
|
-
|
|
215
|
+
missing key. Run `website-sdk hub-filters request`; the user adds the entries in
|
|
216
|
+
the be-on! Hub, see [v9: Hub Filters](search.md#v9-hub-filters).
|
|
217
217
|
- `getRentals` fails the build for a facility scope next to
|
|
218
218
|
`facilityObjectGroupRelationAttributeId`: the listings would use the facilities
|
|
219
219
|
derived from object groups, the search the facility stored on each rental. If the
|
|
@@ -287,7 +287,7 @@ Supported sources:
|
|
|
287
287
|
active backend, and no generated leaf is committed unless all leaves are valid.
|
|
288
288
|
Nested compositions are rejected while recursive expansion is unsupported.
|
|
289
289
|
|
|
290
|
-
For a new v9 `backendFilter` key,
|
|
290
|
+
For a new v9 `backendFilter` key, the Hub filter must exist first; see
|
|
291
291
|
[v9: Hub Filters](search.md#v9-hub-filters). The keys `voffice_id`, `facility_scope` and
|
|
292
292
|
`objectGroup_scope` belong to the SDK: a v9 `backendFilter` cannot use them.
|
|
293
293
|
|
|
@@ -390,8 +390,8 @@ These are **not** custom attributes and stay in `customAttributeFilterDefinition
|
|
|
390
390
|
backend with its configured value.
|
|
391
391
|
|
|
392
392
|
Compositions may reference stable v9 built-ins directly; `backendFilter` is only for
|
|
393
|
-
additional v9 keys. SDK configuration does not create those keys in Hub:
|
|
394
|
-
|
|
393
|
+
additional v9 keys. SDK configuration does not create those keys in Hub: they are added
|
|
394
|
+
there first; see [v9: Hub Filters](search.md#v9-hub-filters).
|
|
395
395
|
|
|
396
396
|
```ts
|
|
397
397
|
const options = defineWebsiteSDKOptions({
|
|
@@ -120,8 +120,8 @@ when it has a public filter and the selected backend can execute it. v9 has no
|
|
|
120
120
|
custom-attribute search path, so v9 never advertises one; see `custom-attributes.md`.
|
|
121
121
|
|
|
122
122
|
Backend filters and compositions come from `customAttributeFilterDefinitions`.
|
|
123
|
-
SDK configuration cannot create a Hub filter: for another v9 key,
|
|
124
|
-
|
|
123
|
+
SDK configuration cannot create a Hub filter: for another v9 key, the entry is added
|
|
124
|
+
to the be-on! Hub first, then you configure that key as a `backendFilter`. Without
|
|
125
125
|
the Hub entry, the filter does nothing. See [v9: Hub Filters](search.md#v9-hub-filters)
|
|
126
126
|
for the fixed keys (object group, facility, special offers) and for
|
|
127
127
|
`website-sdk hub-filters request`.
|
|
@@ -181,7 +181,7 @@ Boolean filters can be provided as presence-only flags when supported:
|
|
|
181
181
|
Legacy v9 searches through the be-on! Hub. The built-in filters listed in `filter.md`
|
|
182
182
|
work without setup. Every other filter, such as an object group or a special offer,
|
|
183
183
|
needs an entry in the Hub for the site's be-on key (`apiKey`). The SDK cannot create
|
|
184
|
-
that entry;
|
|
184
|
+
that entry; the user adds it in the be-on! Hub. Until it exists, the filter silently does
|
|
185
185
|
nothing:
|
|
186
186
|
|
|
187
187
|
- A key the Hub does not know, alone and without `start`/`end` or guests, returns no
|
|
@@ -212,8 +212,8 @@ reserved.
|
|
|
212
212
|
#### Requesting Hub Filters
|
|
213
213
|
|
|
214
214
|
When a user asks for one of these filters, run the CLI. It reads the Hub filters of the
|
|
215
|
-
be-on key, writes a Markdown file
|
|
216
|
-
`backendFilter` definitions:
|
|
215
|
+
be-on key, writes a Markdown file with the code to paste into the be-on! Hub and the
|
|
216
|
+
steps to do it, and prints the matching `backendFilter` definitions:
|
|
217
217
|
|
|
218
218
|
```sh
|
|
219
219
|
website-sdk --backend v9 --config ./website-sdk-config.json hub-filters request --object-group --offers
|
|
@@ -225,10 +225,14 @@ and `--out <file>` (default `hub-filter-request.md`). A rental scope and
|
|
|
225
225
|
`rentalIdsSearch: true` add their keys to the request. The CLI reads the rental scope
|
|
226
226
|
from `--options` and the two settings from `--config` or, with environment
|
|
227
227
|
configuration, from `HUB_RENTAL_SCOPE_PROPERTY_KIND` and `HUB_RENTAL_IDS_SEARCH`.
|
|
228
|
-
Without a flag and without such a setting,
|
|
228
|
+
Without a flag and without such a setting, or when the Hub already has every
|
|
229
|
+
requested key, it writes no file.
|
|
229
230
|
|
|
230
|
-
|
|
231
|
-
|
|
231
|
+
Show the user the steps and the code from the file; they paste the code into the
|
|
232
|
+
be-on! Hub themselves. The code is the complete content of the be-on key's filter
|
|
233
|
+
field and assumes the field is empty. If the field already holds entries, the user
|
|
234
|
+
hands the file to a developer, who merges them. Do not write Hub entries by hand.
|
|
235
|
+
Once the user has saved the entries, check them:
|
|
232
236
|
|
|
233
237
|
```sh
|
|
234
238
|
website-sdk --backend v9 --config ./website-sdk-config.json --options ./website-sdk-options.json hub-filters check
|
|
@@ -237,8 +241,10 @@ website-sdk --backend v9 --config ./website-sdk-config.json --options ./website-
|
|
|
237
241
|
`hub-filters check` compares every configured `backendFilter` key, the scope key and
|
|
238
242
|
`voffice_id` (when `rentalIdsSearch` is on) with the Hub. It exits non-zero and names
|
|
239
243
|
the missing keys, with the `hub-filters request` flags for the fixed ones. A custom
|
|
240
|
-
key outside the fixed ones has no request flag
|
|
241
|
-
|
|
244
|
+
key outside the fixed ones has no request flag: the SDK does not know which rental
|
|
245
|
+
field it compares, so a developer adds its entry by hand. The check sees only that a
|
|
246
|
+
key exists, not whether its entry is complete. When it passes, delete the request
|
|
247
|
+
file.
|
|
242
248
|
|
|
243
249
|
#### A Filter By Object Group
|
|
244
250
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Changelog: 2.30.0
|
|
2
|
+
|
|
3
|
+
On v9, calendar prices now follow the rental's prices by length of stay. Many v9 rentals
|
|
4
|
+
charge less per night for longer stays, for example one price for 1 to 2 nights and a lower
|
|
5
|
+
one from 3 nights. Until now the calendar always showed the highest of these prices, even
|
|
6
|
+
on days where the minimum stay rules the short stays out.
|
|
7
|
+
|
|
8
|
+
## Added
|
|
9
|
+
|
|
10
|
+
- v9 `sdk.live.availability.getStartDateSelectedAvailability` returns `formattedPrice` on
|
|
11
|
+
every day. On a day that can be the end date it is the price of the last night of a stay
|
|
12
|
+
from the selected start date to that day, at the rate for that number of nights. On all
|
|
13
|
+
other days it is `null`.
|
|
14
|
+
- Types `V9StartDateSelectedAvailabilityOutput` and `V9EndDateOption`, the v9 output of
|
|
15
|
+
`getStartDateSelectedAvailability` and one of its days.
|
|
16
|
+
|
|
17
|
+
## Changed
|
|
18
|
+
|
|
19
|
+
- v9 `getInitialAvailability` prices each day at the rate for the minimum stay that applies
|
|
20
|
+
from that day. A rental with a minimum stay of 3 nights shows its 3-night rate instead of
|
|
21
|
+
its 1-night rate.
|
|
22
|
+
|
|
23
|
+
Each night is priced by its own season, as the quote does. When the rental's price list
|
|
24
|
+
cannot be loaded, or has no rate for a day, both calls fall back to the price they returned
|
|
25
|
+
before. v10 availability is unchanged and has no `formattedPrice` on end dates.
|
|
26
|
+
|
|
27
|
+
## Hub filters on v9
|
|
28
|
+
|
|
29
|
+
The user now adds the be-on! Hub filters a site needs. `hub-filters request` no longer
|
|
30
|
+
writes a request to forward to a be-on! developer.
|
|
31
|
+
|
|
32
|
+
- `website-sdk hub-filters request` writes a file with the complete code for the be-on
|
|
33
|
+
key's filter field in the be-on! Hub and the steps to paste it. The code assumes an
|
|
34
|
+
empty field. If the field already holds entries, or the Hub already has one of the
|
|
35
|
+
requested keys, the file tells the user to hand it to a developer.
|
|
36
|
+
- When the Hub already has every requested key, `hub-filters request` writes no file and
|
|
37
|
+
points to `hub-filters check`.
|
|
38
|
+
- The errors for a missing Hub filter in `getRentals`, in a search with `rentalIdsIn` and
|
|
39
|
+
in `hub-filters check` point to `hub-filters request` instead of a be-on! developer. A
|
|
40
|
+
custom `backendFilter` key outside the fixed ones still needs a developer for its entry.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Migration: 2.29.0 to 2.30.0
|
|
2
|
+
|
|
3
|
+
## 1. Upgrade
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pnpm add @v-office/website-sdk@2.30.0
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
No changes are required. On a v9 site, the per-day prices from `getInitialAvailability` can
|
|
10
|
+
be lower than before, because they now use the rate for the day's minimum stay.
|
|
11
|
+
|
|
12
|
+
A `hub-filter-request.md` from an earlier `hub-filters request` was meant for a be-on!
|
|
13
|
+
developer. Once `hub-filters check` passes, delete it. To add missing Hub filters, run
|
|
14
|
+
`hub-filters request` again and give the user the new file.
|
|
15
|
+
|
|
16
|
+
## 2. Optional: show the price of the stay while the guest picks an end date
|
|
17
|
+
|
|
18
|
+
A date picker that shows a price under each day can switch to the prices of
|
|
19
|
+
`getStartDateSelectedAvailability` once a start date is selected. Only v9 returns them, so
|
|
20
|
+
read them inside a check on the backend:
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
if (sdk.backend === "v9") {
|
|
24
|
+
const { calendarDays } = await sdk.live.availability.getStartDateSelectedAvailability(input);
|
|
25
|
+
// calendarDays[date].formattedPrice: per-night price when the guest leaves on that date,
|
|
26
|
+
// null when the date cannot be the end date
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Render `formattedPrice` as it is.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Changelog: 2.30.1
|
|
2
|
+
|
|
3
|
+
v10 rental reviews are filtered by rental on the backend, so loading rentals no longer pages
|
|
4
|
+
through the public feedback of the whole account.
|
|
5
|
+
|
|
6
|
+
## Changed
|
|
7
|
+
|
|
8
|
+
- v10 `sdk.static.rentals.getRentals` requests only the public feedback of the rentals it
|
|
9
|
+
returns. Builds of sites on large accounts get faster; the reviews returned
|
|
10
|
+
are the same as before.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Yt as V9_FACILITY_ATTRIBUTE_KEYS } from "./client-
|
|
1
|
+
import { Yt as V9_FACILITY_ATTRIBUTE_KEYS } from "./client-CKVwzIQ4.mjs";
|
|
2
2
|
import { a as rentalFacilitiesForObjectGroupRelationQuery, c as rentalsAllFeedbacksQuery, d as VofficeUnitDataPropertyCategoryLabelKeys, f as VofficeUnitDataPropertyCategoryValues, g as parseVofficeFeedbackData, h as parseVofficeFacilityData, i as hubFiltersQuery, l as rentalsAllWithoutFeedbacksQuery, o as rentalIdsQuery, p as VofficeUnitDataPropertyMetadata, s as rentalsAllByFacilityObjectGroupsWithoutFeedbacksQuery, u as VofficeUnitDataFieldSchemas, v as parseVofficeUnitData } from "./operations-CfjJjdrw.mjs";
|
|
3
3
|
import { a as toFacilityImages, c as toLocalizedString, i as toLocation, o as toImages, r as renderVofficePropertyAttribute, s as toAddress, t as toRentalHighlights } from "./to-rental-highlights-D7oepO6s.mjs";
|
|
4
4
|
import { CoreSDKError, makeTranslate, renderResolvedCustomAttribute, toCustomAttributeList, toResolvedCustomAttributeCategoryTranslationKey } 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-
|
|
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-CKVwzIQ4.mjs";
|
|
2
2
|
import { n as mapSearchQuery, r as searchQuery, v as parseVofficeUnitData } from "./operations-CfjJjdrw.mjs";
|
|
3
3
|
import { i as toLocation, n as toV9RentalHighlightKey, o as toImages, s as toAddress, t as toRentalHighlights } from "./to-rental-highlights-D7oepO6s.mjs";
|
|
4
4
|
import { CoreSDKError, STABLE_SEARCH_INPUTS, daysBetweenLocalDates, expandCustomAttributeFilterCompositions, parseChildrenAges, parseOccupancyCount, resolveExpandedCompositions, toFormattedSearchPrice, toIsoDateFromPeriodQueryDate, toStableSearchInputBackendQueryKeys, toStableSearchInputParameterValues, toStableSearchInputQueryKeys, toUnusedFilterKeys } from "@v-office/sdk-core";
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
Release notes of `@v-office/website-sdk`, newest first. Each version has its own directory.
|
|
6
6
|
|
|
7
|
+
- `versions/2.30.1/CHANGELOG.md`: release notes for 2.30.1
|
|
8
|
+
- `versions/2.30.0/CHANGELOG.md`: release notes for 2.30.0
|
|
7
9
|
- `versions/2.29.0/CHANGELOG.md`: release notes for 2.29.0
|
|
8
10
|
- `versions/2.28.1/CHANGELOG.md`: release notes for 2.28.1
|
|
9
11
|
- `versions/2.28.0/CHANGELOG.md`: release notes for 2.28.0
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
Migration guides of `@v-office/website-sdk`, newest first. Apply them in order when skipping versions.
|
|
6
6
|
|
|
7
|
+
- `versions/2.30.1/MIGRATION.md`: Migration: 2.30.0 to 2.30.1
|
|
8
|
+
- `versions/2.30.0/MIGRATION.md`: Migration: 2.29.0 to 2.30.0
|
|
7
9
|
- `versions/2.29.0/MIGRATION.md`: Migration: 2.28.1 to 2.29.0
|
|
8
10
|
- `versions/2.28.1/MIGRATION.md`: Migration: 2.28.0 to 2.28.1
|
|
9
11
|
- `versions/2.28.0/MIGRATION.md`: Migration: 2.27.0 to 2.28.0
|
|
@@ -107,9 +107,9 @@ From 2.18.0, available dates that cannot be used as a start date also expose a
|
|
|
107
107
|
price when the source supplies one. The same rule applies to v10 initial
|
|
108
108
|
availability. `formattedPrice` remains `null` when the date is unavailable or
|
|
109
109
|
the source supplies no numeric price.
|
|
110
|
-
|
|
110
|
+
v10 start-date-selected availability does not include calendar prices.
|
|
111
111
|
|
|
112
|
-
When no successful unit lookup is cached, a v9
|
|
112
|
+
When no successful unit lookup is cached, a v9 availability request loads
|
|
113
113
|
the calendar and a unit record. Successful unit responses are cached by unit ID
|
|
114
114
|
for the lifetime of the SDK instance, including responses without a currency.
|
|
115
115
|
Failed unit requests are not cached and are retried on the next call. A missing
|
|
@@ -122,6 +122,26 @@ No new configuration is required. The currency lookup uses the existing
|
|
|
122
122
|
See `versions/2.18.0/CHANGELOG.md` and
|
|
123
123
|
`versions/2.18.0/MIGRATION.md`.
|
|
124
124
|
|
|
125
|
+
### Legacy v9 Prices by Length of Stay
|
|
126
|
+
|
|
127
|
+
From 2.30.0, v9 calendar prices follow the rental's rates by number of nights.
|
|
128
|
+
Each night is priced by its own season, as the quote does.
|
|
129
|
+
|
|
130
|
+
- `getInitialAvailability` prices each day at the rate for the minimum stay
|
|
131
|
+
that applies from that day.
|
|
132
|
+
- `getStartDateSelectedAvailability` returns `formattedPrice` on every day
|
|
133
|
+
(`V9StartDateSelectedAvailabilityOutput`). On a day that can be the end date
|
|
134
|
+
it is the price of the last night of a stay from the selected start date to
|
|
135
|
+
that day, at the rate for that number of nights. On all other days it is
|
|
136
|
+
`null`.
|
|
137
|
+
|
|
138
|
+
When the rental's price list cannot be loaded or has no rate for a day, both
|
|
139
|
+
calls use the calendar price described above. The price list is cached per
|
|
140
|
+
rental for five minutes for the lifetime of the SDK instance.
|
|
141
|
+
|
|
142
|
+
See `versions/2.30.0/CHANGELOG.md` and
|
|
143
|
+
`versions/2.30.0/MIGRATION.md`.
|
|
144
|
+
|
|
125
145
|
### Legacy v9 Occupancy Limits
|
|
126
146
|
|
|
127
147
|
From 2.28.0, v9 initial availability reads its occupancy limits from the same
|
package/instructions/creation.md
CHANGED
|
@@ -212,8 +212,8 @@ const options = defineWebsiteSDKOptions({
|
|
|
212
212
|
- Search, `searchPages` and `mapSearch` apply the scope through the Hub filter
|
|
213
213
|
`facility_scope` or `objectGroup_scope`, with and without a period. The static
|
|
214
214
|
`getRentals` fails the build until the be-on! Hub has that entry, and names the
|
|
215
|
-
missing key. Run `website-sdk hub-filters request
|
|
216
|
-
|
|
215
|
+
missing key. Run `website-sdk hub-filters request`; the user adds the entries in
|
|
216
|
+
the be-on! Hub, see [v9: Hub Filters](search.md#v9-hub-filters).
|
|
217
217
|
- `getRentals` fails the build for a facility scope next to
|
|
218
218
|
`facilityObjectGroupRelationAttributeId`: the listings would use the facilities
|
|
219
219
|
derived from object groups, the search the facility stored on each rental. If the
|
|
@@ -287,7 +287,7 @@ Supported sources:
|
|
|
287
287
|
active backend, and no generated leaf is committed unless all leaves are valid.
|
|
288
288
|
Nested compositions are rejected while recursive expansion is unsupported.
|
|
289
289
|
|
|
290
|
-
For a new v9 `backendFilter` key,
|
|
290
|
+
For a new v9 `backendFilter` key, the Hub filter must exist first; see
|
|
291
291
|
[v9: Hub Filters](search.md#v9-hub-filters). The keys `voffice_id`, `facility_scope` and
|
|
292
292
|
`objectGroup_scope` belong to the SDK: a v9 `backendFilter` cannot use them.
|
|
293
293
|
|
|
@@ -390,8 +390,8 @@ These are **not** custom attributes and stay in `customAttributeFilterDefinition
|
|
|
390
390
|
backend with its configured value.
|
|
391
391
|
|
|
392
392
|
Compositions may reference stable v9 built-ins directly; `backendFilter` is only for
|
|
393
|
-
additional v9 keys. SDK configuration does not create those keys in Hub:
|
|
394
|
-
|
|
393
|
+
additional v9 keys. SDK configuration does not create those keys in Hub: they are added
|
|
394
|
+
there first; see [v9: Hub Filters](search.md#v9-hub-filters).
|
|
395
395
|
|
|
396
396
|
```ts
|
|
397
397
|
const options = defineWebsiteSDKOptions({
|
package/instructions/filter.md
CHANGED
|
@@ -120,8 +120,8 @@ when it has a public filter and the selected backend can execute it. v9 has no
|
|
|
120
120
|
custom-attribute search path, so v9 never advertises one; see `custom-attributes.md`.
|
|
121
121
|
|
|
122
122
|
Backend filters and compositions come from `customAttributeFilterDefinitions`.
|
|
123
|
-
SDK configuration cannot create a Hub filter: for another v9 key,
|
|
124
|
-
|
|
123
|
+
SDK configuration cannot create a Hub filter: for another v9 key, the entry is added
|
|
124
|
+
to the be-on! Hub first, then you configure that key as a `backendFilter`. Without
|
|
125
125
|
the Hub entry, the filter does nothing. See [v9: Hub Filters](search.md#v9-hub-filters)
|
|
126
126
|
for the fixed keys (object group, facility, special offers) and for
|
|
127
127
|
`website-sdk hub-filters request`.
|
package/instructions/search.md
CHANGED
|
@@ -181,7 +181,7 @@ Boolean filters can be provided as presence-only flags when supported:
|
|
|
181
181
|
Legacy v9 searches through the be-on! Hub. The built-in filters listed in `filter.md`
|
|
182
182
|
work without setup. Every other filter, such as an object group or a special offer,
|
|
183
183
|
needs an entry in the Hub for the site's be-on key (`apiKey`). The SDK cannot create
|
|
184
|
-
that entry;
|
|
184
|
+
that entry; the user adds it in the be-on! Hub. Until it exists, the filter silently does
|
|
185
185
|
nothing:
|
|
186
186
|
|
|
187
187
|
- A key the Hub does not know, alone and without `start`/`end` or guests, returns no
|
|
@@ -212,8 +212,8 @@ reserved.
|
|
|
212
212
|
#### Requesting Hub Filters
|
|
213
213
|
|
|
214
214
|
When a user asks for one of these filters, run the CLI. It reads the Hub filters of the
|
|
215
|
-
be-on key, writes a Markdown file
|
|
216
|
-
`backendFilter` definitions:
|
|
215
|
+
be-on key, writes a Markdown file with the code to paste into the be-on! Hub and the
|
|
216
|
+
steps to do it, and prints the matching `backendFilter` definitions:
|
|
217
217
|
|
|
218
218
|
```sh
|
|
219
219
|
website-sdk --backend v9 --config ./website-sdk-config.json hub-filters request --object-group --offers
|
|
@@ -225,10 +225,14 @@ and `--out <file>` (default `hub-filter-request.md`). A rental scope and
|
|
|
225
225
|
`rentalIdsSearch: true` add their keys to the request. The CLI reads the rental scope
|
|
226
226
|
from `--options` and the two settings from `--config` or, with environment
|
|
227
227
|
configuration, from `HUB_RENTAL_SCOPE_PROPERTY_KIND` and `HUB_RENTAL_IDS_SEARCH`.
|
|
228
|
-
Without a flag and without such a setting,
|
|
228
|
+
Without a flag and without such a setting, or when the Hub already has every
|
|
229
|
+
requested key, it writes no file.
|
|
229
230
|
|
|
230
|
-
|
|
231
|
-
|
|
231
|
+
Show the user the steps and the code from the file; they paste the code into the
|
|
232
|
+
be-on! Hub themselves. The code is the complete content of the be-on key's filter
|
|
233
|
+
field and assumes the field is empty. If the field already holds entries, the user
|
|
234
|
+
hands the file to a developer, who merges them. Do not write Hub entries by hand.
|
|
235
|
+
Once the user has saved the entries, check them:
|
|
232
236
|
|
|
233
237
|
```sh
|
|
234
238
|
website-sdk --backend v9 --config ./website-sdk-config.json --options ./website-sdk-options.json hub-filters check
|
|
@@ -237,8 +241,10 @@ website-sdk --backend v9 --config ./website-sdk-config.json --options ./website-
|
|
|
237
241
|
`hub-filters check` compares every configured `backendFilter` key, the scope key and
|
|
238
242
|
`voffice_id` (when `rentalIdsSearch` is on) with the Hub. It exits non-zero and names
|
|
239
243
|
the missing keys, with the `hub-filters request` flags for the fixed ones. A custom
|
|
240
|
-
key outside the fixed ones has no request flag
|
|
241
|
-
|
|
244
|
+
key outside the fixed ones has no request flag: the SDK does not know which rental
|
|
245
|
+
field it compares, so a developer adds its entry by hand. The check sees only that a
|
|
246
|
+
key exists, not whether its entry is complete. When it passes, delete the request
|
|
247
|
+
file.
|
|
242
248
|
|
|
243
249
|
#### A Filter By Object Group
|
|
244
250
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Changelog: 2.30.0
|
|
2
|
+
|
|
3
|
+
On v9, calendar prices now follow the rental's prices by length of stay. Many v9 rentals
|
|
4
|
+
charge less per night for longer stays, for example one price for 1 to 2 nights and a lower
|
|
5
|
+
one from 3 nights. Until now the calendar always showed the highest of these prices, even
|
|
6
|
+
on days where the minimum stay rules the short stays out.
|
|
7
|
+
|
|
8
|
+
## Added
|
|
9
|
+
|
|
10
|
+
- v9 `sdk.live.availability.getStartDateSelectedAvailability` returns `formattedPrice` on
|
|
11
|
+
every day. On a day that can be the end date it is the price of the last night of a stay
|
|
12
|
+
from the selected start date to that day, at the rate for that number of nights. On all
|
|
13
|
+
other days it is `null`.
|
|
14
|
+
- Types `V9StartDateSelectedAvailabilityOutput` and `V9EndDateOption`, the v9 output of
|
|
15
|
+
`getStartDateSelectedAvailability` and one of its days.
|
|
16
|
+
|
|
17
|
+
## Changed
|
|
18
|
+
|
|
19
|
+
- v9 `getInitialAvailability` prices each day at the rate for the minimum stay that applies
|
|
20
|
+
from that day. A rental with a minimum stay of 3 nights shows its 3-night rate instead of
|
|
21
|
+
its 1-night rate.
|
|
22
|
+
|
|
23
|
+
Each night is priced by its own season, as the quote does. When the rental's price list
|
|
24
|
+
cannot be loaded, or has no rate for a day, both calls fall back to the price they returned
|
|
25
|
+
before. v10 availability is unchanged and has no `formattedPrice` on end dates.
|
|
26
|
+
|
|
27
|
+
## Hub filters on v9
|
|
28
|
+
|
|
29
|
+
The user now adds the be-on! Hub filters a site needs. `hub-filters request` no longer
|
|
30
|
+
writes a request to forward to a be-on! developer.
|
|
31
|
+
|
|
32
|
+
- `website-sdk hub-filters request` writes a file with the complete code for the be-on
|
|
33
|
+
key's filter field in the be-on! Hub and the steps to paste it. The code assumes an
|
|
34
|
+
empty field. If the field already holds entries, or the Hub already has one of the
|
|
35
|
+
requested keys, the file tells the user to hand it to a developer.
|
|
36
|
+
- When the Hub already has every requested key, `hub-filters request` writes no file and
|
|
37
|
+
points to `hub-filters check`.
|
|
38
|
+
- The errors for a missing Hub filter in `getRentals`, in a search with `rentalIdsIn` and
|
|
39
|
+
in `hub-filters check` point to `hub-filters request` instead of a be-on! developer. A
|
|
40
|
+
custom `backendFilter` key outside the fixed ones still needs a developer for its entry.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Migration: 2.29.0 to 2.30.0
|
|
2
|
+
|
|
3
|
+
## 1. Upgrade
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pnpm add @v-office/website-sdk@2.30.0
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
No changes are required. On a v9 site, the per-day prices from `getInitialAvailability` can
|
|
10
|
+
be lower than before, because they now use the rate for the day's minimum stay.
|
|
11
|
+
|
|
12
|
+
A `hub-filter-request.md` from an earlier `hub-filters request` was meant for a be-on!
|
|
13
|
+
developer. Once `hub-filters check` passes, delete it. To add missing Hub filters, run
|
|
14
|
+
`hub-filters request` again and give the user the new file.
|
|
15
|
+
|
|
16
|
+
## 2. Optional: show the price of the stay while the guest picks an end date
|
|
17
|
+
|
|
18
|
+
A date picker that shows a price under each day can switch to the prices of
|
|
19
|
+
`getStartDateSelectedAvailability` once a start date is selected. Only v9 returns them, so
|
|
20
|
+
read them inside a check on the backend:
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
if (sdk.backend === "v9") {
|
|
24
|
+
const { calendarDays } = await sdk.live.availability.getStartDateSelectedAvailability(input);
|
|
25
|
+
// calendarDays[date].formattedPrice: per-night price when the guest leaves on that date,
|
|
26
|
+
// null when the date cannot be the end date
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Render `formattedPrice` as it is.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Changelog: 2.30.1
|
|
2
|
+
|
|
3
|
+
v10 rental reviews are filtered by rental on the backend, so loading rentals no longer pages
|
|
4
|
+
through the public feedback of the whole account.
|
|
5
|
+
|
|
6
|
+
## Changed
|
|
7
|
+
|
|
8
|
+
- v10 `sdk.static.rentals.getRentals` requests only the public feedback of the rentals it
|
|
9
|
+
returns. Builds of sites on large accounts get faster; the reviews returned
|
|
10
|
+
are the same as before.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-office/website-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.30.1",
|
|
4
4
|
"description": "Website-facing SDK facade backed by @v-office/sdk-core",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"bin": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@graphql-typed-document-node/core": "3.2.0",
|
|
46
|
-
"@v-office/sdk-core": "1.24.
|
|
46
|
+
"@v-office/sdk-core": "1.24.2",
|
|
47
47
|
"effect": "4.0.0-rc.115",
|
|
48
48
|
"graphql": "17.0.2",
|
|
49
49
|
"yaml": "^2.9.0"
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"test:v9:properties": "node --test codegen/v9/heuristic-generation/generate/property.test.ts src/legacy-v9/property-highlight-sources.test.ts src/legacy-v9/parser/rentals/render-property-attribute.test.ts src/legacy-v9/parser/rentals/to-property.test.ts src/legacy-v9/parser/rentals/to-rooms.test.ts",
|
|
89
89
|
"test:v9:rentals": "node --test src/legacy-v9/static/associate-rentals-with-facilities-by-object-groups.test.ts src/legacy-v9/parser/rentals/to-reviews.test.ts",
|
|
90
90
|
"test:v9:graphql": "node --test src/legacy-v9/graphql/client.test.ts",
|
|
91
|
-
"test:v9:availability": "node --test src/legacy-v9/parser/availability/to-availability-restrictions-by-date.test.ts src/legacy-v9/parser/availability/to-initial-availability-calendar-days.test.ts src/legacy-v9/parser/availability/to-occupancy-limits.test.ts",
|
|
91
|
+
"test:v9:availability": "node --test src/legacy-v9/parser/availability/to-availability-restrictions-by-date.test.ts src/legacy-v9/parser/availability/to-initial-availability-calendar-days.test.ts src/legacy-v9/parser/availability/to-occupancy-limits.test.ts src/legacy-v9/parser/availability/to-rent-night-prices.test.ts src/legacy-v9/parser/availability/to-start-date-selected-calendar-days.test.ts",
|
|
92
92
|
"test:v9:search": "node --test src/legacy-v9/parser/search/resolve-exact-match.test.ts src/legacy-v9/rental-scope.test.ts",
|
|
93
93
|
"test:v9:booking": "node --test src/legacy-v9/parser/booking/output/to-payment-schedules.test.ts",
|
|
94
94
|
"playground:custom-attributes": "pnpm run build && node --env-file=.env playground/custom-attributes.ts"
|