@v-office/website-sdk 2.34.0 → 2.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/cli.mjs +3 -3
- package/dist/{client-C1McSXf1.mjs → client-BC5ukCcN.mjs} +129 -8
- package/dist/index.d.mts +10 -2
- package/dist/index.mjs +1 -1
- package/dist/instructions/CHANGELOG.md +1 -0
- package/dist/instructions/MIGRATION.md +1 -0
- package/dist/instructions/README.md +1 -0
- package/dist/instructions/creation.md +3 -3
- package/dist/instructions/custom-attributes.md +11 -8
- package/dist/instructions/regions.md +123 -0
- package/dist/instructions/search.md +3 -0
- package/dist/instructions/versions/2.35.0/CHANGELOG.md +28 -0
- package/dist/instructions/versions/2.35.0/MIGRATION.md +39 -0
- package/dist/{operations-CUWcmNGK.mjs → operations-C1VMQYN2.mjs} +62 -1
- package/dist/{rentals-yMGMrIHJ.mjs → rentals-tKaYW-Zz.mjs} +3 -3
- package/dist/{search-DiEV8NhE.mjs → search-DibGd1I6.mjs} +3 -3
- package/dist/{to-rental-highlights-Dbnm6Y4_.mjs → to-rental-highlights-BdxQPpBU.mjs} +1 -1
- package/instructions/CHANGELOG.md +1 -0
- package/instructions/MIGRATION.md +1 -0
- package/instructions/README.md +1 -0
- package/instructions/creation.md +3 -3
- package/instructions/custom-attributes.md +11 -8
- package/instructions/regions.md +123 -0
- package/instructions/search.md +3 -0
- package/instructions/versions/2.35.0/CHANGELOG.md +28 -0
- package/instructions/versions/2.35.0/MIGRATION.md +39 -0
- package/instructions/versions/2.35.0/release.json +3 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -182,11 +182,11 @@ import { defineCustomAttributes } from "@v-office/website-sdk";
|
|
|
182
182
|
const customAttributes = defineCustomAttributes({
|
|
183
183
|
catalog,
|
|
184
184
|
select: {
|
|
185
|
-
|
|
186
|
-
label: { "de-DE": "
|
|
185
|
+
beach: {
|
|
186
|
+
label: { "de-DE": "Strand", "en-US": "Beach" },
|
|
187
187
|
filter: true,
|
|
188
188
|
optionLabels: {
|
|
189
|
-
|
|
189
|
+
sand: { "de-DE": "Sandstrand", "en-US": "Sandy beach" },
|
|
190
190
|
},
|
|
191
191
|
},
|
|
192
192
|
},
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $t as V9_HUB_FACILITY_SCOPE_FILTER_KEY, Yt as defineWebsiteSDKOptions, Zt as defineV9PropertyHighlightSourcesFromUnknown, _ as rental_attributes_default$1, an as V9_HUB_REGION_FILTER_KEY, cn as V9_SDK_OWNED_HUB_FILTER_KEYS, en as V9_HUB_FACILITY_SEARCH_FILTER_KEY, f as makeV9GraphQLClient, h as makeV0OpenApiClientFetchLive, i as toV9SdkOwnedHubFilterKeys, in as V9_HUB_OFFER_FILTER_KEY, ln as stable_filters_default, n as checkV9HubFilters, nn as V9_HUB_OBJECT_GROUP_SCOPE_FILTER_KEY, on as V9_HUB_RENTAL_IDS_FILTER_KEY, p as V0OpenApiClient, r as toV9RequiredHubFilterKeys, rn as V9_HUB_OFFERS_FILTER_KEY, sn as V9_HUB_UNIT_TYPE_FILTER_KEY, t as createWebsiteSDK, tn as V9_HUB_OBJECT_GROUP_FILTER_KEY, v as rental_attributes_default } from "./client-
|
|
3
|
-
import { a as hubRentalDataQuery,
|
|
2
|
+
import { $t as V9_HUB_FACILITY_SCOPE_FILTER_KEY, Yt as defineWebsiteSDKOptions, Zt as defineV9PropertyHighlightSourcesFromUnknown, _ as rental_attributes_default$1, an as V9_HUB_REGION_FILTER_KEY, cn as V9_SDK_OWNED_HUB_FILTER_KEYS, en as V9_HUB_FACILITY_SEARCH_FILTER_KEY, f as makeV9GraphQLClient, h as makeV0OpenApiClientFetchLive, i as toV9SdkOwnedHubFilterKeys, in as V9_HUB_OFFER_FILTER_KEY, ln as stable_filters_default, n as checkV9HubFilters, nn as V9_HUB_OBJECT_GROUP_SCOPE_FILTER_KEY, on as V9_HUB_RENTAL_IDS_FILTER_KEY, p as V0OpenApiClient, r as toV9RequiredHubFilterKeys, rn as V9_HUB_OFFERS_FILTER_KEY, sn as V9_HUB_UNIT_TYPE_FILTER_KEY, t as createWebsiteSDK, tn as V9_HUB_OBJECT_GROUP_FILTER_KEY, v as rental_attributes_default } from "./client-BC5ukCcN.mjs";
|
|
3
|
+
import { a as hubRentalDataQuery, d as rentalsAllWithoutFeedbacksQuery, g as VofficeUnitDataPropertyMetadata, i as hubFiltersQuery, v as parseJsonData, x as parseVofficeRatingData } from "./operations-C1VMQYN2.mjs";
|
|
4
4
|
import { STABLE_SEARCH_INPUTS, SearchSearchSortSchema, defineCustomAttributesFromUnknown, toStableSearchInputQueryKeys } from "@v-office/sdk-core";
|
|
5
5
|
import { ByteSize, Console, Effect, FileSystem, Layer, Option, Path, Schema, Stdio, Terminal } from "effect";
|
|
6
6
|
import { Command, Flag } from "effect/unstable/cli";
|
|
@@ -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.35.0";
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region src/cli/output.ts
|
|
23
23
|
const toJson = (value) => Effect.try({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
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, normalizeV10RateBudget, parseQueryParameters, refreshGuestQuoteInsurancePassthrough, removeGuestQuoteAdditionalServiceSelection, selectGuestQuoteCancellationPolicySelection, toCustomAttributeFilterLabel, toCustomAttributeFilterOutputItem, toCustomAttributeList, toInitialAvailabilityCalendarDays, toIsoDateFromPeriodQueryDate, toQueryString, toResolvedCustomAttributeCategoryTranslationKey, toStartDateSelectedCalendarDays, validateContactSubmitInput, withGuestQuoteInsurance, withGuestQuoteInsuranceRefresh } from "@v-office/sdk-core";
|
|
1
|
+
import { S as parseVofficeUnitData, _ as customDataAttribute, c as rentalRegionsQuery, f as RegionSchema$1, t as voucherValidityQuery, v as parseJsonData } from "./operations-C1VMQYN2.mjs";
|
|
2
|
+
import { AvailabilityService, BookingBookOutput, BookingService, ContactService, CoreSDKError, DEFAULT_RENTAL_HIGHLIGHT_PRIORITIZATION, DEFAULT_RENTAL_PROPERTY_HIGHLIGHT_PRIORITIZATION, DocumentsService, EMPTY_CUSTOM_ATTRIBUTE_REGISTRY, FilterService, QuoteService, RegionsService, RentalService, SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS, SearchService, TranslationService, addGuestQuoteAdditionalServiceSelection, asArray, asRecord, assertNoNestedCustomAttributeFilterCompositions, assertNoReservedQueryKeys, assertUniqueCustomFilterQueryKeys, assertUniqueFilterQueryKeys, buildWebsiteRegions, clearGuestQuoteAdditionalServiceSelections, collectQueryParameters, createCoreRuntime, daysBetweenLocalDates, expandCustomAttributeFilterCompositions, firstNumber, firstString, formatCurrency, formatLocalDate, getBookingBookGuestToken, getGuestQuoteBackendContext, getGuestQuoteInput, isDisplayableCustomAttribute, localeToLanguage, makeMinIntervalLimiter, makeTranslationLive, normalizeV10RateBudget, parseQueryParameters, refreshGuestQuoteInsurancePassthrough, removeGuestQuoteAdditionalServiceSelection, selectGuestQuoteCancellationPolicySelection, toCustomAttributeFilterLabel, toCustomAttributeFilterOutputItem, toCustomAttributeList, toInitialAvailabilityCalendarDays, toIsoDateFromPeriodQueryDate, toQueryString, toResolvedCustomAttributeCategoryTranslationKey, toStartDateSelectedCalendarDays, validateContactSubmitInput, withGuestQuoteInsurance, withGuestQuoteInsuranceRefresh } from "@v-office/sdk-core";
|
|
3
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";
|
|
@@ -262,7 +262,7 @@ const selectV9PropertyHighlightSources = ({ highlightPrioritization, registry })
|
|
|
262
262
|
};
|
|
263
263
|
//#endregion
|
|
264
264
|
//#region src/legacy-v9/review-options.ts
|
|
265
|
-
const LOCALES = ["de-DE", "en-US"];
|
|
265
|
+
const LOCALES$1 = ["de-DE", "en-US"];
|
|
266
266
|
const BOOLEAN_OPTION_KEYS = [
|
|
267
267
|
"showAuthorCity",
|
|
268
268
|
"includeItemsWithoutText",
|
|
@@ -286,9 +286,9 @@ const criterionIssues = (criterion, index, seen) => {
|
|
|
286
286
|
else seen.add(v9);
|
|
287
287
|
if (criterion.type !== "stars" && criterion.type !== "text") issues.push(`${path}.type: expected "stars" or "text"`);
|
|
288
288
|
const label = criterion.label;
|
|
289
|
-
if (!isRecord(label)) issues.push(`${path}.label: expected a label for ${LOCALES.join(", ")}`);
|
|
289
|
+
if (!isRecord(label)) issues.push(`${path}.label: expected a label for ${LOCALES$1.join(", ")}`);
|
|
290
290
|
else {
|
|
291
|
-
const missing = LOCALES.filter((locale) => typeof label[locale] !== "string" || label[locale].trim() === "");
|
|
291
|
+
const missing = LOCALES$1.filter((locale) => typeof label[locale] !== "string" || label[locale].trim() === "");
|
|
292
292
|
if (missing.length > 0) issues.push(`${path}.label: missing a label for ${missing.join(", ")}`);
|
|
293
293
|
}
|
|
294
294
|
return issues;
|
|
@@ -627,6 +627,9 @@ const getFiltersEffect = (input) => Effect.gen(function* () {
|
|
|
627
627
|
const getTermsAndPrivacyPolicyEffect = (input) => Effect.gen(function* () {
|
|
628
628
|
return yield* (yield* DocumentsService).getTermsAndPrivacyPolicy(input);
|
|
629
629
|
});
|
|
630
|
+
const getRegionsEffect = (input) => Effect.gen(function* () {
|
|
631
|
+
return yield* (yield* RegionsService).getRegions(input);
|
|
632
|
+
});
|
|
630
633
|
const getBankTransferDetailsEffect = () => Effect.gen(function* () {
|
|
631
634
|
const service = yield* BookingService;
|
|
632
635
|
if (service.getBankTransferDetails === void 0) return yield* Effect.fail(new CoreSDKError({
|
|
@@ -6092,7 +6095,7 @@ const parseV9SearchCursor = (cursor) => Effect.gen(function* () {
|
|
|
6092
6095
|
return page;
|
|
6093
6096
|
});
|
|
6094
6097
|
const loadV9SearchRuntime = Effect.tryPromise({
|
|
6095
|
-
try: () => import("./search-
|
|
6098
|
+
try: () => import("./search-DibGd1I6.mjs"),
|
|
6096
6099
|
catch: (cause) => new CoreSDKError({
|
|
6097
6100
|
source: "v9",
|
|
6098
6101
|
operation: "v9.search.runtime",
|
|
@@ -6766,6 +6769,121 @@ const makeV9FilterApi = ({ options }) => {
|
|
|
6766
6769
|
})) };
|
|
6767
6770
|
};
|
|
6768
6771
|
//#endregion
|
|
6772
|
+
//#region src/legacy-v9/static/regions.ts
|
|
6773
|
+
const LOCALES = ["de-DE", "en-US"];
|
|
6774
|
+
/** The name in the locale, else the other language. */
|
|
6775
|
+
const toName = (region) => {
|
|
6776
|
+
const names = region.name ?? {};
|
|
6777
|
+
const de = names.de?.trim() || names.en?.trim();
|
|
6778
|
+
const en = names.en?.trim() || de;
|
|
6779
|
+
return de && en ? {
|
|
6780
|
+
"de-DE": de,
|
|
6781
|
+
"en-US": en
|
|
6782
|
+
} : void 0;
|
|
6783
|
+
};
|
|
6784
|
+
const toDescription = (region) => {
|
|
6785
|
+
const texts = region.description ?? region.descriptions ?? {};
|
|
6786
|
+
const description = {};
|
|
6787
|
+
for (const locale of LOCALES) {
|
|
6788
|
+
const text = texts[localeToLanguage(locale)]?.trim();
|
|
6789
|
+
if (text) description[locale] = text;
|
|
6790
|
+
}
|
|
6791
|
+
return description;
|
|
6792
|
+
};
|
|
6793
|
+
const toSlug = (name) => name.toLowerCase().replace(/ä/g, "ae").replace(/ö/g, "oe").replace(/ü/g, "ue").replace(/ß/g, "ss").normalize("NFKD").replace(/[̀-ͯ]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "region";
|
|
6794
|
+
/** Slugs unique among `names`' siblings: a repeat gets "-2", "-3" … in order. */
|
|
6795
|
+
const uniqueSlugs = (names) => {
|
|
6796
|
+
const taken = /* @__PURE__ */ new Set();
|
|
6797
|
+
return names.map((name) => {
|
|
6798
|
+
const base = toSlug(name);
|
|
6799
|
+
let slug = base;
|
|
6800
|
+
for (let n = 2; taken.has(slug); n++) slug = `${base}-${n}`;
|
|
6801
|
+
taken.add(slug);
|
|
6802
|
+
return slug;
|
|
6803
|
+
});
|
|
6804
|
+
};
|
|
6805
|
+
/** Maps the vOffice regions and the rentals' regions; throws on a region without a name. */
|
|
6806
|
+
const toV9WebsiteRegions = ({ regions, rentalRegions }) => {
|
|
6807
|
+
const ids = new Set(regions.map((region) => region._id));
|
|
6808
|
+
const parentOf = (region) => region.parent !== void 0 && ids.has(region.parent) ? region.parent : null;
|
|
6809
|
+
const named = regions.map((region) => {
|
|
6810
|
+
const name = toName(region);
|
|
6811
|
+
if (name === void 0) throw new Error(`vOffice region ${region._id} has no name.`);
|
|
6812
|
+
return {
|
|
6813
|
+
region,
|
|
6814
|
+
name
|
|
6815
|
+
};
|
|
6816
|
+
});
|
|
6817
|
+
const ownRentalIds = /* @__PURE__ */ new Map();
|
|
6818
|
+
for (const { rentalId, regionId } of rentalRegions) if (ids.has(regionId)) ownRentalIds.set(regionId, [...ownRentalIds.get(regionId) ?? [], rentalId]);
|
|
6819
|
+
const childrenOf = (parent) => named.filter(({ region }) => parentOf(region) === parent).sort((left, right) => left.name["de-DE"].localeCompare(right.name["de-DE"], "de") || left.region._id - right.region._id);
|
|
6820
|
+
const hasRentals = (id) => (ownRentalIds.get(id)?.length ?? 0) > 0 || childrenOf(id).some(({ region }) => hasRentals(region._id));
|
|
6821
|
+
const visit = (parent) => {
|
|
6822
|
+
const siblings = childrenOf(parent);
|
|
6823
|
+
const de = uniqueSlugs(siblings.map(({ name }) => name["de-DE"]));
|
|
6824
|
+
const en = uniqueSlugs(siblings.map(({ name }) => name["en-US"]));
|
|
6825
|
+
return siblings.flatMap(({ region, name }, index) => {
|
|
6826
|
+
if (!hasRentals(region._id)) return [];
|
|
6827
|
+
return [{
|
|
6828
|
+
id: String(region._id),
|
|
6829
|
+
parentId: parent === null ? null : String(parent),
|
|
6830
|
+
name,
|
|
6831
|
+
slug: {
|
|
6832
|
+
"de-DE": de[index] ?? "",
|
|
6833
|
+
"en-US": en[index] ?? ""
|
|
6834
|
+
},
|
|
6835
|
+
description: toDescription(region),
|
|
6836
|
+
ownRentalIds: ownRentalIds.get(region._id) ?? []
|
|
6837
|
+
}, ...visit(region._id)];
|
|
6838
|
+
});
|
|
6839
|
+
};
|
|
6840
|
+
const inputs = visit(null);
|
|
6841
|
+
const reached = new Set(inputs.map(({ id }) => id));
|
|
6842
|
+
const unreachedRentalRegion = [...ownRentalIds.keys()].find((id) => !reached.has(String(id)));
|
|
6843
|
+
if (unreachedRentalRegion !== void 0) throw new Error(`vOffice region ${unreachedRentalRegion} with rentals is not reachable from a root.`);
|
|
6844
|
+
return buildWebsiteRegions({
|
|
6845
|
+
isWebsiteOverride: false,
|
|
6846
|
+
regions: inputs
|
|
6847
|
+
});
|
|
6848
|
+
};
|
|
6849
|
+
const makeV9RegionsApi = ({ config }) => {
|
|
6850
|
+
const graphql = makeV9GraphQLClient(config);
|
|
6851
|
+
const openApiClientLive = makeV0OpenApiClientFetchLive({
|
|
6852
|
+
apiKey: config.apiKey,
|
|
6853
|
+
...config.v0ApiBaseUrl === void 0 ? {} : { baseUrl: config.v0ApiBaseUrl }
|
|
6854
|
+
});
|
|
6855
|
+
const loadRegions = Effect.gen(function* () {
|
|
6856
|
+
const result = yield* (yield* V0OpenApiClient).execute("proxyVofficeAction", { query: {
|
|
6857
|
+
actionName: "getRegions",
|
|
6858
|
+
description: true
|
|
6859
|
+
} });
|
|
6860
|
+
const response = yield* Schema.decodeUnknownEffect(RegionsResponseSchema)(result.raw);
|
|
6861
|
+
if (response.ok === false || response.regions === void 0) return yield* Effect.fail(new CoreSDKError({
|
|
6862
|
+
source: "v9",
|
|
6863
|
+
operation: "v9.regions.getRegions",
|
|
6864
|
+
message: "vOffice rejected getRegions.",
|
|
6865
|
+
cause: result.raw
|
|
6866
|
+
}));
|
|
6867
|
+
return response.regions.filter((region) => typeof region._id === "number");
|
|
6868
|
+
}).pipe(Effect.provide(openApiClientLive));
|
|
6869
|
+
const loadRentalRegions = graphql.execute(rentalRegionsQuery, {}).pipe(Effect.map((data) => data.all.flatMap((rental) => {
|
|
6870
|
+
const region = parseJsonData({ region: RegionSchema$1 }, rental.data).known.region;
|
|
6871
|
+
return region === void 0 ? [] : [{
|
|
6872
|
+
rentalId: String(rental.voffice_id),
|
|
6873
|
+
regionId: region.id
|
|
6874
|
+
}];
|
|
6875
|
+
})));
|
|
6876
|
+
return { getRegions: () => Effect.runPromise(Effect.all([loadRegions, loadRentalRegions], { concurrency: 2 }).pipe(Effect.flatMap(([regions, rentalRegions]) => Effect.try(() => toV9WebsiteRegions({
|
|
6877
|
+
regions,
|
|
6878
|
+
rentalRegions
|
|
6879
|
+
}))), Effect.mapError((cause) => new CoreSDKError({
|
|
6880
|
+
source: "v9",
|
|
6881
|
+
operation: "v9.regions.getRegions",
|
|
6882
|
+
message: "Failed to load the v9 region tree.",
|
|
6883
|
+
cause
|
|
6884
|
+
})))) };
|
|
6885
|
+
};
|
|
6886
|
+
//#endregion
|
|
6769
6887
|
//#region src/legacy-v9/hub-filter-requirements.ts
|
|
6770
6888
|
const toV9SdkOwnedHubFilterKeys = ({ config, rentalScope }) => {
|
|
6771
6889
|
const scopeKey = toV9RentalScopeHubFilterKey({
|
|
@@ -6840,7 +6958,7 @@ const orderRentalsById = ({ rentalIds, rentals, missing }) => {
|
|
|
6840
6958
|
});
|
|
6841
6959
|
};
|
|
6842
6960
|
const loadV9RentalsRuntime = Effect.tryPromise({
|
|
6843
|
-
try: () => import("./rentals-
|
|
6961
|
+
try: () => import("./rentals-tKaYW-Zz.mjs"),
|
|
6844
6962
|
catch: (cause) => new CoreSDKError({
|
|
6845
6963
|
source: "v9",
|
|
6846
6964
|
operation: "v9.rentals.runtime",
|
|
@@ -7071,6 +7189,7 @@ function createWebsiteSDK({ config, options }) {
|
|
|
7071
7189
|
config,
|
|
7072
7190
|
options: v9Options
|
|
7073
7191
|
});
|
|
7192
|
+
const regions = makeV9RegionsApi({ config });
|
|
7074
7193
|
const videos = makeV9VideosApi({ config });
|
|
7075
7194
|
recordConstructedBackend("v9");
|
|
7076
7195
|
recordConstructedSdk(config, options);
|
|
@@ -7079,6 +7198,7 @@ function createWebsiteSDK({ config, options }) {
|
|
|
7079
7198
|
static: {
|
|
7080
7199
|
rentals: { getRentals: rentals.getRentals },
|
|
7081
7200
|
filter: { getFilters: filter.getFilters },
|
|
7201
|
+
regions: { getRegions: () => regions.getRegions() },
|
|
7082
7202
|
videos: { getVideos: videos.getVideos }
|
|
7083
7203
|
},
|
|
7084
7204
|
live: {
|
|
@@ -7126,7 +7246,8 @@ function createWebsiteSDK({ config, options }) {
|
|
|
7126
7246
|
rentals: { getRentals: (input) => runtime.runPromise(getRentalsEffect(input)) },
|
|
7127
7247
|
filter: { getFilters: (input) => runtime.runPromise(getFiltersEffect(input)) },
|
|
7128
7248
|
documents: { getTermsAndPrivacyPolicy: (input) => runtime.runPromise(getTermsAndPrivacyPolicyEffect(input)) },
|
|
7129
|
-
payment: { getBankTransferDetails: () => runtime.runPromise(getBankTransferDetailsEffect()) }
|
|
7249
|
+
payment: { getBankTransferDetails: () => runtime.runPromise(getBankTransferDetailsEffect()) },
|
|
7250
|
+
regions: { getRegions: (input) => runtime.runPromise(getRegionsEffect(input)) }
|
|
7130
7251
|
},
|
|
7131
7252
|
live: {
|
|
7132
7253
|
contact: { submit: (input) => runtime.runPromise(submitContactEffect(input)) },
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AdditionalServiceLimitExceeded, AvailabilityEndDateOption, AvailabilityGetInitialAvailabilityInput, AvailabilityGetInitialAvailabilityInput as AvailabilityGetInitialAvailabilityInput$1, AvailabilityGetInitialAvailabilityOutput, AvailabilityGetInitialAvailabilityOutput as AvailabilityGetInitialAvailabilityOutput$1, AvailabilityGetStartDateSelectedAvailabilityInput, AvailabilityGetStartDateSelectedAvailabilityInput as AvailabilityGetStartDateSelectedAvailabilityInput$1, AvailabilityGetStartDateSelectedAvailabilityOutput, AvailabilityGetStartDateSelectedAvailabilityOutput as AvailabilityGetStartDateSelectedAvailabilityOutput$1, AvailabilityService, BackendKind, BookingBankTransferDetails, BookingBankTransferDetails as BookingBankTransferDetails$1, BookingBookInput, BookingBookInput as BookingBookInput$1, BookingBookOutput, BookingBookOutput as BookingBookOutput$1, BookingPayment, BookingPaymentAlternative, BookingPaymentOption, BookingPaymentScheduleItem, BookingPaymentScheduleKind, BookingPaymentScheduleLine, BookingService, ContactService, ContactSubmitInput, ContactSubmitInput as ContactSubmitInput$1, ContactSubmitOutput, ContactSubmitOutput as ContactSubmitOutput$1, ContactSubmitValidationIssue, ContactSubmitValidationIssueCode, CoreSDKError, CoreSDKError as CMSError, CoreSDKError as CoreSDKError$1, CustomAttributeCatalog, CustomAttributeCatalogDefinitionInput, CustomAttributeCatalogInput, CustomAttributeCatalogSchema, CustomAttributeCategoryKey, CustomAttributeFilterCategoryKey, CustomAttributeFilterDefinition, CustomAttributeFilterDefinition as CustomAttributeFilterDefinition$1, CustomAttributeFilterExpression, CustomAttributeFilterLabel, CustomAttributeFilterNumericBounds, CustomAttributeFilterOption, CustomAttributeOverridesInput, CustomAttributeRegistry, CustomAttributeRegistrySnapshot, CustomAttributeRegistrySnapshot as CustomAttributeRegistrySnapshot$1, CustomAttributeSelection, DocumentsGetTermsAndPrivacyPolicyInput, DocumentsGetTermsAndPrivacyPolicyInput as DocumentsGetTermsAndPrivacyPolicyInput$1, DocumentsGetTermsAndPrivacyPolicyOutput, DocumentsGetTermsAndPrivacyPolicyOutput as DocumentsGetTermsAndPrivacyPolicyOutput$1, DocumentsService, FilterGetFiltersInput, FilterGetFiltersInput as FilterGetFiltersInput$1, FilterGetFiltersOutput, FilterGetFiltersOutput as FilterGetFiltersOutput$1, FilterService, GuestQuote, GuestQuoteInput, GuestQuoteInsurance, GuestQuoteResult, GuestQuoteSchema, GuestQuoteSelectionResult, GuestQuoteVoucher, InsuranceBookingOutput, InsuranceCustomerInformationInput, InsurancePaymentInformationInput, InsurancePaymentOptionOutput, InsurancePreContractOutput, InvalidAdditionalServiceQuantity, LocalDateString, Locale, Locale as Locale$1, LocaleSchema, QuoteAddAdditionalServiceInput, QuoteAddAdditionalServiceOutput, QuoteBookInsuranceInput, QuoteBookInsuranceOutput, QuoteClearAdditionalServicesInput, QuoteClearAdditionalServicesOutput, QuoteCreateInsurancePreContractInput, QuoteCreateInsurancePreContractOutput, QuoteQuoteInput, QuoteQuoteInput as QuoteQuoteInput$1, QuoteQuoteOutput, QuoteQuoteOutput as QuoteQuoteOutput$1, QuoteRemoveAdditionalServiceInput, QuoteRemoveAdditionalServiceOutput, QuoteSelectCancellationPolicyInput, QuoteSelectCancellationPolicyOutput, QuoteSelectInsuranceInput, QuoteSelectInsuranceOutput, QuoteSelectInsurancePaymentInput, QuoteSelectInsurancePaymentOutput, QuoteService as QuoteService$1, RentalGetRentalsInput, RentalGetRentalsInput as RentalGetRentalsInput$1, RentalGetRentalsOutput, RentalGetRentalsOutput as RentalGetRentalsOutput$1, RentalHighlightPrioritizationKey, RentalHighlightPrioritizationKey as RentalHighlightPrioritizationKey$1, RentalPropertyHighlightPrioritizationKey, RentalPropertyHighlightPrioritizationKey as RentalPropertyHighlightPrioritizationKey$1, RentalScope, RentalService, ResolvedCustomAttribute, SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS, SearchAllRentalsAtOnceInput, SearchAllRentalsAtOnceInput as SearchAllRentalsAtOnceInput$1, SearchMapSearchInput, SearchMapSearchInput as SearchMapSearchInput$1, SearchMapSearchInputSchema, SearchMapSearchOutput, SearchMapSearchOutput as SearchMapSearchOutput$1, SearchMapSearchOutputItem, SearchMapSearchOutputSchema, SearchSearchAlternative, SearchSearchFieldOrderBy, SearchSearchFieldOrderBySchema, SearchSearchFieldSort, SearchSearchFieldSort as SearchSearchFieldSort$1, SearchSearchFieldSortSchema, SearchSearchInput, SearchSearchInput as SearchSearchInput$1, SearchSearchInputSchema, SearchSearchOutput, SearchSearchOutput as SearchSearchOutput$1, SearchSearchOutputItem, SearchSearchOutputSchema, SearchSearchPriceSort, SearchSearchPriceSortSchema, SearchSearchRandomSort, SearchSearchRandomSortSchema, SearchSearchRatingSort, SearchSearchRatingSortSchema, SearchSearchSort, SearchSearchSort as SearchSearchSort$1, SearchSearchSortSchema, SearchService, SearchSortDirection, SearchSortDirectionSchema, SelectableInsuranceOptionOutput, SelectedInsuranceInformationInput, SubmittableBookingPaymentOption, SubmittableBookingPaymentOption as SubmittableBookingPaymentOption$1, TranslationOverrides, TranslationOverrides as TranslationOverrides$1, UnknownAdditionalService, V10CoreConfig, V10RateBudget, V9OnlyCustomAttributeInput, 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, RegionsGetRegionsInput, RegionsGetRegionsInput as RegionsGetRegionsInput$1, RegionsService, RentalGetRentalsInput, RentalGetRentalsInput as RentalGetRentalsInput$1, RentalGetRentalsOutput, RentalGetRentalsOutput as RentalGetRentalsOutput$1, RentalHighlightPrioritizationKey, RentalHighlightPrioritizationKey as RentalHighlightPrioritizationKey$1, RentalPropertyHighlightPrioritizationKey, RentalPropertyHighlightPrioritizationKey as RentalPropertyHighlightPrioritizationKey$1, RentalScope, RentalService, ResolvedCustomAttribute, SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS, SearchAllRentalsAtOnceInput, SearchAllRentalsAtOnceInput as SearchAllRentalsAtOnceInput$1, SearchMapSearchInput, SearchMapSearchInput as SearchMapSearchInput$1, SearchMapSearchInputSchema, SearchMapSearchOutput, SearchMapSearchOutput as SearchMapSearchOutput$1, SearchMapSearchOutputItem, SearchMapSearchOutputSchema, SearchSearchAlternative, SearchSearchFieldOrderBy, SearchSearchFieldOrderBySchema, SearchSearchFieldSort, SearchSearchFieldSort as SearchSearchFieldSort$1, SearchSearchFieldSortSchema, SearchSearchInput, SearchSearchInput as SearchSearchInput$1, SearchSearchInputSchema, SearchSearchOutput, SearchSearchOutput as SearchSearchOutput$1, SearchSearchOutputItem, SearchSearchOutputSchema, SearchSearchPriceSort, SearchSearchPriceSortSchema, SearchSearchRandomSort, SearchSearchRandomSortSchema, SearchSearchRatingSort, SearchSearchRatingSortSchema, SearchSearchSort, SearchSearchSort as SearchSearchSort$1, SearchSearchSortSchema, SearchService, SearchSortDirection, SearchSortDirectionSchema, SelectableInsuranceOptionOutput, SelectedInsuranceInformationInput, SubmittableBookingPaymentOption, SubmittableBookingPaymentOption as SubmittableBookingPaymentOption$1, TranslationOverrides, TranslationOverrides as TranslationOverrides$1, UnknownAdditionalService, V10CoreConfig, V10RateBudget, V9OnlyCustomAttributeInput, WebsiteRegion, WebsiteRegions, WebsiteRegions as WebsiteRegions$1, defineCustomAttributes, defineCustomAttributesFromUnknown, fetchCustomAttributeCatalog, parseCustomAttributeCatalog, validateContactSubmitInput } from "@v-office/sdk-core";
|
|
2
2
|
import { Context, Effect, Layer, Schema } from "effect";
|
|
3
3
|
import { HttpClient } from "effect/unstable/http";
|
|
4
4
|
import "@graphql-typed-document-node/core";
|
|
@@ -180,6 +180,14 @@ type WebsiteSDKSharedStatic = {
|
|
|
180
180
|
readonly filter: {
|
|
181
181
|
readonly getFilters: (input: FilterGetFiltersInput$1) => Promise<FilterGetFiltersOutput$1>;
|
|
182
182
|
};
|
|
183
|
+
readonly regions: {
|
|
184
|
+
/**
|
|
185
|
+
* The website's region tree. v10: the websites service's tree, the website's own or else
|
|
186
|
+
* the workspace's default. v9: vOffice's region hierarchy, which ignores
|
|
187
|
+
* `aiStudioWebsiteId`. Read it once per build: neither backend caches it.
|
|
188
|
+
*/
|
|
189
|
+
readonly getRegions: (input: RegionsGetRegionsInput$1) => Promise<WebsiteRegions$1>;
|
|
190
|
+
};
|
|
183
191
|
};
|
|
184
192
|
type WebsiteSDKV10Static = WebsiteSDKSharedStatic & {
|
|
185
193
|
readonly documents: {
|
|
@@ -7786,4 +7794,4 @@ export type RentalRentalsOutput = RentalGetRentalsOutput$1[number];
|
|
|
7786
7794
|
export type RentalSearchInput = SearchSearchInput$1;
|
|
7787
7795
|
export type RentalSearchOutput = SearchSearchOutput$1;
|
|
7788
7796
|
//#endregion
|
|
7789
|
-
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 V9Video, type V9VideosGetVideosInput, type V9VoucherValidateInput, type V9VoucherValidateOutput, type V9VoucherValidityReason, type VofficeFacilityDataAttribute, type VofficeFacilityDataAttributes, type VofficeFeedbackDataAttribute, type VofficeFeedbackDataAttributes, type VofficeImageDataAttribute, type VofficeImageDataAttributes, type VofficeOfferDataAttribute, type VofficeOfferDataAttributes, type VofficePriceDataAttribute, type VofficePriceDataAttributes, type VofficeRatingDataAttribute, type VofficeRatingDataAttributes, type VofficeServiceDataAttribute, type VofficeServiceDataAttributes, type VofficeTotalRatingDataAttribute, type VofficeTotalRatingDataAttributes, type VofficeUnitDataAttribute, type VofficeUnitDataAttributes, type WebsiteSDK, type WebsiteSDKAllRentalsAtOnce, type WebsiteSDKConfig, type WebsiteSDKOptions, type WebsiteSDKSharedLive, type WebsiteSDKSharedStatic, type WebsiteSDKV10, type WebsiteSDKV10AllRentalsAtOnce, type WebsiteSDKV10AllRentalsAtOnceLive, type WebsiteSDKV10Live, type WebsiteSDKV10Static, type WebsiteSDKV9, type WebsiteSDKV9AllRentalsAtOnce, type WebsiteSDKV9AllRentalsAtOnceLive, type WebsiteSDKV9Live, type WebsiteSDKV9Static, defineWebsiteSDKOptions as defineCMSSDKOptions, defineCustomAttributes, defineCustomAttributesFromUnknown, fetchCustomAttributeCatalog, parseCustomAttributeCatalog, validateContactSubmitInput };
|
|
7797
|
+
export { AdditionalServiceLimitExceeded, type AvailabilityGetInitialAvailabilityInput, type AvailabilityGetInitialAvailabilityOutput, type AvailabilityGetStartDateSelectedAvailabilityInput, type AvailabilityGetStartDateSelectedAvailabilityOutput, type BackendKind, type BookingBankTransferDetails, type BookingBookInput, type BookingBookOutput, type BookingPayment, type BookingPaymentAlternative, type BookingPaymentOption, type BookingPaymentScheduleItem, type BookingPaymentScheduleKind, type BookingPaymentScheduleLine, CMSError, type ContactSubmitInput, type ContactSubmitOutput, type ContactSubmitValidationIssue, type ContactSubmitValidationIssueCode, CoreSDKError, type CustomAttributeCatalog, type CustomAttributeCatalogDefinitionInput, type CustomAttributeCatalogInput, CustomAttributeCatalogSchema, type CustomAttributeCategoryKey, type CustomAttributeFilterCategoryKey, type CustomAttributeFilterDefinition, type CustomAttributeFilterExpression, type CustomAttributeFilterLabel, type CustomAttributeFilterNumericBounds, type CustomAttributeFilterOption, type CustomAttributeOverridesInput, type CustomAttributeRegistry, type CustomAttributeRegistrySnapshot, type CustomAttributeSelection, type CustomDataAttribute, type DataAttribute, type DocumentsGetTermsAndPrivacyPolicyInput, type DocumentsGetTermsAndPrivacyPolicyOutput, type FilterGetFiltersInput, type FilterGetFiltersOutput, type GeoLocation, type GuestQuote, type GuestQuoteInput, type GuestQuoteInsurance, type GuestQuoteResult, GuestQuoteSchema, type GuestQuoteSelectionResult, type GuestQuoteVoucher, type ImageData, type InsuranceBookingOutput, type InsuranceCustomerInformationInput, type InsurancePaymentInformationInput, type InsurancePaymentOptionOutput, type InsurancePreContractOutput, InvalidAdditionalServiceQuantity, type KnownVofficeFacilityData, type KnownVofficeFacilityDataAttribute, type KnownVofficeFeedbackData, type KnownVofficeFeedbackDataAttribute, type KnownVofficeImageData, type KnownVofficeImageDataAttribute, type KnownVofficeOfferData, type KnownVofficeOfferDataAttribute, type KnownVofficePriceData, type KnownVofficePriceDataAttribute, type KnownVofficeRatingData, type KnownVofficeRatingDataAttribute, type KnownVofficeServiceData, type KnownVofficeServiceDataAttribute, type KnownVofficeTotalRatingData, type KnownVofficeTotalRatingDataAttribute, type KnownVofficeUnitData, type KnownVofficeUnitDataAttribute, type Locale, LocaleSchema, type ParsedJsonData, type ParsedVofficeFacilityData, type ParsedVofficeFeedbackData, type ParsedVofficeImageData, type ParsedVofficeOfferData, type ParsedVofficePriceData, type ParsedVofficeRatingData, type ParsedVofficeServiceData, type ParsedVofficeTotalRatingData, type ParsedVofficeUnitData, type QuoteQuoteInput, type QuoteQuoteOutput, type RegionsGetRegionsInput, type 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 V9Video, type V9VideosGetVideosInput, type V9VoucherValidateInput, type V9VoucherValidateOutput, type V9VoucherValidityReason, type VofficeFacilityDataAttribute, type VofficeFacilityDataAttributes, type VofficeFeedbackDataAttribute, type VofficeFeedbackDataAttributes, type VofficeImageDataAttribute, type VofficeImageDataAttributes, type VofficeOfferDataAttribute, type VofficeOfferDataAttributes, type VofficePriceDataAttribute, type VofficePriceDataAttributes, type VofficeRatingDataAttribute, type VofficeRatingDataAttributes, type VofficeServiceDataAttribute, type VofficeServiceDataAttributes, type VofficeTotalRatingDataAttribute, type VofficeTotalRatingDataAttributes, type VofficeUnitDataAttribute, type VofficeUnitDataAttributes, type WebsiteRegion, type WebsiteRegions, type WebsiteSDK, type WebsiteSDKAllRentalsAtOnce, type WebsiteSDKConfig, type WebsiteSDKOptions, type WebsiteSDKSharedLive, type WebsiteSDKSharedStatic, type WebsiteSDKV10, type WebsiteSDKV10AllRentalsAtOnce, type WebsiteSDKV10AllRentalsAtOnceLive, type WebsiteSDKV10Live, type WebsiteSDKV10Static, type WebsiteSDKV9, type WebsiteSDKV9AllRentalsAtOnce, type WebsiteSDKV9AllRentalsAtOnceLive, type WebsiteSDKV9Live, type WebsiteSDKV9Static, defineWebsiteSDKOptions as defineCMSSDKOptions, defineCustomAttributes, defineCustomAttributesFromUnknown, fetchCustomAttributeCatalog, parseCustomAttributeCatalog, validateContactSubmitInput };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as QuoteSchema, A as DocumentResourceSchema, At as bookInsuranceEffect, B as ErgoPersonSchema, Bt as quoteEffect, C as ApiEnvelopeBaseSchema, Ct as V1_BASE_URL, D as CustomerUnitSummarySchema, Dt as decodeV1OperationResponse, E as CurrentMemberResponseSchema, Et as VideoResponseSchema, F as ErgoAddressSchema, Ft as getInitialAvailabilityEffect, G as FacilityListResponseSchema, Gt as selectInsurancePaymentEffect, H as ErgoPolicyNumberRequestSchema, Ht as searchEffect, I as ErgoBankSchema, It as getRentalsEffect, J as PaymentScheduleItemSchema, Jt as submitPaymentOptionEffect, K as OnOfficeUnitCollectionResponseSchema, Kt as submitContactEffect, L as ErgoBookRequestSchema, Lt as getStartDateSelectedAvailabilityEffect, M as DocumentStatusUpdateRequestSchema, Mt as createInsurancePreContractEffect, N as DocumentSummarySchema, Nt as getBankTransferDetailsEffect, O as DocumentCollectionResponseSchema, Ot as addAdditionalServiceEffect, P as DocumentTypeSchema, Pt as getFiltersEffect, Q as QuotePricesResponseSchema, R as ErgoCommonFieldsSchema, Rt as getTermsAndPrivacyPolicyEffect, S as makeV1OpenApiClientLive, St as UnitServicePriceSchema, T as CalendarResponseSchema, Tt as VideoListResponseSchema, U as ErgoReadPreContractRequestSchema, Ut as selectCancellationPolicyEffect, V as ErgoPlanSearchRequestSchema, Vt as removeAdditionalServiceEffect, W as ErgoTripAndCustomerRequestSchema, Wt as selectInsuranceEffect, X as QuoteLineSchema, Xt as defineV9PropertyHighlightSources, Y as PaymentScheduleSchema, Yt as defineWebsiteSDKOptions, Z as QuotePricesPayloadSchema, Zt as defineV9PropertyHighlightSourcesFromUnknown, _t as UnitIdsResponseSchema, at as SearchPropertiesResponseSchema, b as V1OpenApiClientError, bt as UnitOfferSchema, ct as ServiceLimitSchema, dt as SetupResponseSchema, et as QuoteServiceSchema, ft as TileCollectionResponseSchema, g as makeV0OpenApiClientLive, gt as TravelInsuranceBookingStoreRequestSchema, h as makeV0OpenApiClientFetchLive, ht as TravelInsuranceBookingSchema, it as RoomImageSchema, j as DocumentStatusSchema, jt as clearAdditionalServicesEffect, k as DocumentResourceResponseSchema, kt as bookEffect, lt as ServiceListResponseSchema, m as V0OpenApiClientError, mt as TileTagSchema, nt as RawVofficeObjectSchema, ot as ServiceBeonDataSchema, p as V0OpenApiClient, pt as TileSchema, q as OnOfficeUnitSchema, qt as submitPaymentOption, rt as RegionListResponseSchema, st as ServiceImageSchema, t as createWebsiteSDK, tt as RawObjectResponseSchema, ut as SetupDataSchema, vt as UnitListItemSchema, w as CalendarDaySchema, wt as V1_OPERATIONS, x as makeV1OpenApiClientFetchLive, xt as UnitResponseSchema, y as V1OpenApiClient, yt as UnitListResponseSchema, z as ErgoCreatePreContractRequestSchema, zt as mapSearchEffect } from "./client-
|
|
1
|
+
import { $ as QuoteSchema, A as DocumentResourceSchema, At as bookInsuranceEffect, B as ErgoPersonSchema, Bt as quoteEffect, C as ApiEnvelopeBaseSchema, Ct as V1_BASE_URL, D as CustomerUnitSummarySchema, Dt as decodeV1OperationResponse, E as CurrentMemberResponseSchema, Et as VideoResponseSchema, F as ErgoAddressSchema, Ft as getInitialAvailabilityEffect, G as FacilityListResponseSchema, Gt as selectInsurancePaymentEffect, H as ErgoPolicyNumberRequestSchema, Ht as searchEffect, I as ErgoBankSchema, It as getRentalsEffect, J as PaymentScheduleItemSchema, Jt as submitPaymentOptionEffect, K as OnOfficeUnitCollectionResponseSchema, Kt as submitContactEffect, L as ErgoBookRequestSchema, Lt as getStartDateSelectedAvailabilityEffect, M as DocumentStatusUpdateRequestSchema, Mt as createInsurancePreContractEffect, N as DocumentSummarySchema, Nt as getBankTransferDetailsEffect, O as DocumentCollectionResponseSchema, Ot as addAdditionalServiceEffect, P as DocumentTypeSchema, Pt as getFiltersEffect, Q as QuotePricesResponseSchema, R as ErgoCommonFieldsSchema, Rt as getTermsAndPrivacyPolicyEffect, S as makeV1OpenApiClientLive, St as UnitServicePriceSchema, T as CalendarResponseSchema, Tt as VideoListResponseSchema, U as ErgoReadPreContractRequestSchema, Ut as selectCancellationPolicyEffect, V as ErgoPlanSearchRequestSchema, Vt as removeAdditionalServiceEffect, W as ErgoTripAndCustomerRequestSchema, Wt as selectInsuranceEffect, X as QuoteLineSchema, Xt as defineV9PropertyHighlightSources, Y as PaymentScheduleSchema, Yt as defineWebsiteSDKOptions, Z as QuotePricesPayloadSchema, Zt as defineV9PropertyHighlightSourcesFromUnknown, _t as UnitIdsResponseSchema, at as SearchPropertiesResponseSchema, b as V1OpenApiClientError, bt as UnitOfferSchema, ct as ServiceLimitSchema, dt as SetupResponseSchema, et as QuoteServiceSchema, ft as TileCollectionResponseSchema, g as makeV0OpenApiClientLive, gt as TravelInsuranceBookingStoreRequestSchema, h as makeV0OpenApiClientFetchLive, ht as TravelInsuranceBookingSchema, it as RoomImageSchema, j as DocumentStatusSchema, jt as clearAdditionalServicesEffect, k as DocumentResourceResponseSchema, kt as bookEffect, lt as ServiceListResponseSchema, m as V0OpenApiClientError, mt as TileTagSchema, nt as RawVofficeObjectSchema, ot as ServiceBeonDataSchema, p as V0OpenApiClient, pt as TileSchema, q as OnOfficeUnitSchema, qt as submitPaymentOption, rt as RegionListResponseSchema, st as ServiceImageSchema, t as createWebsiteSDK, tt as RawObjectResponseSchema, ut as SetupDataSchema, vt as UnitListItemSchema, w as CalendarDaySchema, wt as V1_OPERATIONS, x as makeV1OpenApiClientFetchLive, xt as UnitResponseSchema, y as V1OpenApiClient, yt as UnitListResponseSchema, z as ErgoCreatePreContractRequestSchema, zt as mapSearchEffect } from "./client-BC5ukCcN.mjs";
|
|
2
2
|
import { AdditionalServiceLimitExceeded, CoreSDKError, CoreSDKError as CMSError, CustomAttributeCatalogSchema, GuestQuoteSchema, InvalidAdditionalServiceQuantity, LocaleSchema, SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS, SearchMapSearchInputSchema, SearchMapSearchOutputSchema, SearchSearchFieldOrderBySchema, SearchSearchFieldSortSchema, SearchSearchInputSchema, SearchSearchOutputSchema, SearchSearchPriceSortSchema, SearchSearchRandomSortSchema, SearchSearchRatingSortSchema, SearchSearchSortSchema, SearchSortDirectionSchema, UnknownAdditionalService, defineCustomAttributes, defineCustomAttributesFromUnknown, fetchCustomAttributeCatalog, parseCustomAttributeCatalog, validateContactSubmitInput } from "@v-office/sdk-core";
|
|
3
3
|
//#region codegen/v9/heuristic-generation/public-api.ts
|
|
4
4
|
const customDataAttribute = (name) => name;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Release notes of `@v-office/website-sdk`, newest first. Each version has its own directory.
|
|
6
6
|
|
|
7
|
+
- `versions/2.35.0/CHANGELOG.md`: release notes for 2.35.0
|
|
7
8
|
- `versions/2.34.0/CHANGELOG.md`: release notes for 2.34.0
|
|
8
9
|
- `versions/2.33.0/CHANGELOG.md`: release notes for 2.33.0
|
|
9
10
|
- `versions/2.32.0/CHANGELOG.md`: release notes for 2.32.0
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Migration guides of `@v-office/website-sdk`, newest first. Apply them in order when skipping versions.
|
|
6
6
|
|
|
7
|
+
- `versions/2.35.0/MIGRATION.md`: Migration: 2.34.0 to 2.35.0
|
|
7
8
|
- `versions/2.34.0/MIGRATION.md`: Migration: 2.33.0 to 2.34.0
|
|
8
9
|
- `versions/2.33.0/MIGRATION.md`: Migration: 2.32.0 to 2.33.0
|
|
9
10
|
- `versions/2.32.0/MIGRATION.md`: Migration: 2.31.1 to 2.32.0
|
|
@@ -11,6 +11,7 @@ Use this directory as the consumer-facing reference for the package:
|
|
|
11
11
|
- `filter.md`: `sdk.static.filter.getFilters`.
|
|
12
12
|
- `videos.md`: v9 only. `sdk.static.videos.getVideos`, placements, and HLS playback.
|
|
13
13
|
- `custom-attributes.md`: custom attribute catalog, configuration, per-backend behaviour, and the v9-to-v10 move.
|
|
14
|
+
- `regions.md`: `sdk.static.regions.getRegions`, the website's region tree, region pages, and the search's region field.
|
|
14
15
|
- `search.md`: `sdk.live.search.search`, vouchers, and, on v9, `sdk.live.search.searchPages`, Hub filters, and `sdk.live.voucher.validate`.
|
|
15
16
|
- `availability.md`: date-picker availability flows.
|
|
16
17
|
- `quote.md`: quote booking-card modifiers, additional services, cancellation policy, and insurance flows.
|
|
@@ -244,11 +244,11 @@ Custom attributes are configured through `customAttributes`, built by
|
|
|
244
244
|
const customAttributes = defineCustomAttributes({
|
|
245
245
|
catalog,
|
|
246
246
|
select: {
|
|
247
|
-
|
|
248
|
-
label: { "de-DE": "
|
|
247
|
+
beach: {
|
|
248
|
+
label: { "de-DE": "Strand", "en-US": "Beach" },
|
|
249
249
|
filter: true,
|
|
250
250
|
optionLabels: {
|
|
251
|
-
|
|
251
|
+
sand: { "de-DE": "Sandstrand", "en-US": "Sandy beach" },
|
|
252
252
|
},
|
|
253
253
|
},
|
|
254
254
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Custom Attributes
|
|
2
2
|
|
|
3
|
-
Custom attributes are workspace-specific rental metadata: a sauna flag, a
|
|
3
|
+
Custom attributes are workspace-specific rental metadata: a sauna flag, a beach type, an
|
|
4
4
|
occupancy score, a marketing text. This document covers how to configure them, how
|
|
5
5
|
they behave on each backend, and what changes when a site moves from `v9` to `v10`.
|
|
6
6
|
|
|
@@ -11,6 +11,9 @@ They serve three separate concerns, and each is configured independently:
|
|
|
11
11
|
- **Backend identity**: the workspace-specific v10 definition ID or v9 rental-data
|
|
12
12
|
field the SDK must talk to.
|
|
13
13
|
|
|
14
|
+
Regions are not custom attributes. Read the website's region tree with
|
|
15
|
+
`sdk.static.regions.getRegions` (see `regions.md`), not a "Region" attribute.
|
|
16
|
+
|
|
14
17
|
## Two Halves: Catalog and Policy
|
|
15
18
|
|
|
16
19
|
Configuration is a join of two things that have different owners.
|
|
@@ -30,12 +33,12 @@ const customAttributes = defineCustomAttributes({
|
|
|
30
33
|
catalog,
|
|
31
34
|
select: {
|
|
32
35
|
sauna: { label: { "de-DE": "Sauna", "en-US": "Sauna" } },
|
|
33
|
-
|
|
34
|
-
label: { "de-DE": "
|
|
36
|
+
beach: {
|
|
37
|
+
label: { "de-DE": "Strand", "en-US": "Beach" },
|
|
35
38
|
filter: true,
|
|
36
39
|
optionLabels: {
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
sand: { "de-DE": "Sandstrand", "en-US": "Sandy beach" },
|
|
41
|
+
grass: { "de-DE": "Grünstrand", "en-US": "Grass beach" },
|
|
39
42
|
},
|
|
40
43
|
},
|
|
41
44
|
},
|
|
@@ -51,7 +54,7 @@ site means the build fails. Every problem is reported in one pass:
|
|
|
51
54
|
Invalid custom attribute configuration (3 problems):
|
|
52
55
|
- sauna.label: missing a label for de-DE; the catalog supplies none, so it must be authored
|
|
53
56
|
- amenityTags: backend type MULTI_SELECT has no canonical SDK value type yet, so it cannot be selected
|
|
54
|
-
-
|
|
57
|
+
- beach.optionLabels: a filterable option attribute needs a label for every option; missing grass, pebble
|
|
55
58
|
```
|
|
56
59
|
|
|
57
60
|
## The Catalog
|
|
@@ -268,7 +271,7 @@ When a value cannot be read as the declared type — an `int` of `"1.5"` or an o
|
|
|
268
271
|
value the catalog does not declare — the attribute is omitted rather than rendering
|
|
269
272
|
something misleading. A false boolean and an absent value are also omitted.
|
|
270
273
|
|
|
271
|
-
Scalar filters take **one** value. Given `?
|
|
274
|
+
Scalar filters take **one** value. Given `?beach=sand,grass`, the first valid value
|
|
272
275
|
is applied, but the key also remains in `unusedFilterKeys` because the extra token was
|
|
273
276
|
not applied. Combining scalar values would depend on backend semantics that are not
|
|
274
277
|
specified, and an AND of two option values can only return nothing.
|
|
@@ -286,7 +289,7 @@ const options = defineWebsiteSDKOptions({
|
|
|
286
289
|
customAttributes,
|
|
287
290
|
rentalHighlightPrioritization: [
|
|
288
291
|
"bedrooms",
|
|
289
|
-
customAttributes.keys.
|
|
292
|
+
customAttributes.keys.beach, // checked for a literal typed registry
|
|
290
293
|
"bathrooms",
|
|
291
294
|
],
|
|
292
295
|
});
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Regions
|
|
2
|
+
|
|
3
|
+
Regions group a site's rentals into a tree, for example Nordsee → Dornum → Dornumersiel.
|
|
4
|
+
`sdk.static.regions.getRegions` returns the tree in the same shape on both backends, so
|
|
5
|
+
region pages and the search's region field are the same code on v10 and v9.
|
|
6
|
+
|
|
7
|
+
| | v10 | v9 |
|
|
8
|
+
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
|
|
9
|
+
| Source | the websites service: editors arrange regions in the CMS (Websites → "Regionen"), and a website can have its own tree instead of the workspace's default | vOffice's region hierarchy, through the be-on! Hub |
|
|
10
|
+
| Regions per rental | several | one; it also counts for every region above it |
|
|
11
|
+
| Names | German and English | German; English when vOffice has it |
|
|
12
|
+
| Slugs | set by editors | generated from the names |
|
|
13
|
+
| Order | the editors' order | siblings by German name |
|
|
14
|
+
| Regions returned | every region in the tree | only regions holding a rental of the be-on key |
|
|
15
|
+
|
|
16
|
+
Regions are not a custom attribute. Do not read a "Region" custom attribute, and do not
|
|
17
|
+
select one in `defineCustomAttributes`: the tree replaces both.
|
|
18
|
+
|
|
19
|
+
## Reading The Tree
|
|
20
|
+
|
|
21
|
+
Read the tree once per build, at build time:
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
const regions = await sdk.static.regions.getRegions({
|
|
25
|
+
aiStudioWebsiteId: Number(process.env.WEB_ID),
|
|
26
|
+
});
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`WEB_ID` is the AI Studio website id. The builder and the editor's dev server set it. v9
|
|
30
|
+
ignores it: vOffice keeps one region tree per customer.
|
|
31
|
+
|
|
32
|
+
Every call reads the whole tree, and neither backend caches it, so call it once and pass
|
|
33
|
+
the result on. Never call it per component, per page in the browser, or per request. A
|
|
34
|
+
failed read rejects, so the build stops instead of publishing a site without its regions.
|
|
35
|
+
A v10 website the service has no tree for returns an empty tree.
|
|
36
|
+
|
|
37
|
+
On v10, every change editors make to regions or region assignments queues a new build of
|
|
38
|
+
the website. A site never has to poll.
|
|
39
|
+
|
|
40
|
+
## The Result
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
type WebsiteRegions = {
|
|
44
|
+
isWebsiteOverride: boolean; // v10: true for the website's own tree; always false on v9
|
|
45
|
+
regions: readonly WebsiteRegion[];
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
type WebsiteRegion = {
|
|
49
|
+
id: string;
|
|
50
|
+
parentId: string | null; // null: top level
|
|
51
|
+
depth: number; // 0: top level
|
|
52
|
+
name: { "de-DE": string; "en-US": string };
|
|
53
|
+
slug: { "de-DE": string; "en-US": string };
|
|
54
|
+
path: { "de-DE": string; "en-US": string }; // "nordsee/dornum"
|
|
55
|
+
description: { "de-DE"?: string; "en-US"?: string };
|
|
56
|
+
ownRentalIds: readonly string[];
|
|
57
|
+
rentalIds: readonly string[];
|
|
58
|
+
};
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
- `regions` is depth first: every region comes before its subregions. Render it top to
|
|
62
|
+
bottom, or rebuild the tree from `parentId`.
|
|
63
|
+
- `name` and `slug` always hold both languages. When only one exists, the other language
|
|
64
|
+
uses it. `description` holds only the languages a description exists in.
|
|
65
|
+
- A slug is unique among its siblings, not across the tree. `path` joins the slugs of the
|
|
66
|
+
region's ancestors and its own with `/`, and is unique: use it as the URL path. On v9,
|
|
67
|
+
renaming a region in vOffice changes its slug and so its page URL.
|
|
68
|
+
- `ownRentalIds` are the rentals in the region itself. `rentalIds` adds every subregion's
|
|
69
|
+
rentals, each rental once. A region page lists `rentalIds`: "Nordsee" shows Dornum's
|
|
70
|
+
and Dornumersiel's rentals too.
|
|
71
|
+
- The ids are rental ids as `getRentals` returns them. Neither backend applies the SDK's
|
|
72
|
+
`rentalScope`: list only the rentals the site has.
|
|
73
|
+
|
|
74
|
+
## Region Pages And Rental URLs
|
|
75
|
+
|
|
76
|
+
Build one page per region from `path`, for example `/regionen/nordsee/dornum`, with the
|
|
77
|
+
name, the description and the rentals of `rentalIds`.
|
|
78
|
+
|
|
79
|
+
A rental keeps the one URL it already has. Never nest a rental's URL under a region: a
|
|
80
|
+
rental in several regions would get several URLs. Region pages link to the rental's own
|
|
81
|
+
page.
|
|
82
|
+
|
|
83
|
+
## Search
|
|
84
|
+
|
|
85
|
+
The search bar's region field and the `?region=` scope work in the browser, on facts the
|
|
86
|
+
build attaches to each rental. `@v-office/website-headless` turns the tree into both:
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
import {
|
|
90
|
+
cardSource,
|
|
91
|
+
rentalFactsMap,
|
|
92
|
+
regionOptions,
|
|
93
|
+
regionsByRental,
|
|
94
|
+
} from "@v-office/website-headless";
|
|
95
|
+
|
|
96
|
+
const options = regionOptions(regions, {
|
|
97
|
+
locale: "de-DE",
|
|
98
|
+
rentalIds: rentals.map((rental) => rental.id),
|
|
99
|
+
});
|
|
100
|
+
const regionsOf = regionsByRental(regions); // rental id → region ids
|
|
101
|
+
|
|
102
|
+
const sources = rentals.map((rental) =>
|
|
103
|
+
cardSource(rental, { rentalHref, regions: regionsOf[rental.id] ?? [] }),
|
|
104
|
+
);
|
|
105
|
+
const facts = rentalFactsMap(sources); // the search results' `facts`
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Pass `options` as they are as the `regions` prop of `SearchBar` from
|
|
109
|
+
`@v-office/website-components`; `createSearchForm` takes their `value`s. A region without
|
|
110
|
+
rentals is not offered, and `rentalIds` keeps a region whose rentals are all outside the
|
|
111
|
+
site's `rentalScope` out of the field and its counts.
|
|
112
|
+
|
|
113
|
+
The value of a region is its `id` (`?region=<id>`). A rental counts for a region and for
|
|
114
|
+
every region above it, so `?region=<id of Nordsee>` also finds the rentals in Dornum. To word a
|
|
115
|
+
`?region=` chip with the region's name instead of its id, curate a hidden `region` facet
|
|
116
|
+
with the same options:
|
|
117
|
+
|
|
118
|
+
```ts
|
|
119
|
+
{ kind: "facet", key: "region", label: "Region", options, hidden: true }
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
On v9 this replaces the Hub `region` filter (`search.md`, "A Filter By Region") for the
|
|
123
|
+
region field: it needs no Hub entry. A site that already uses the Hub filter keeps working.
|
|
@@ -296,6 +296,9 @@ Hub knows. The English labels are the German names; translate them.
|
|
|
296
296
|
|
|
297
297
|
#### A Filter By Region
|
|
298
298
|
|
|
299
|
+
For a region field in the search, prefer the region tree (`regions.md`): it works on v10
|
|
300
|
+
and v9 and needs no Hub entry.
|
|
301
|
+
|
|
299
302
|
`region` keeps rentals in one vOffice region and in its subregions: the region "Sylt"
|
|
300
303
|
also finds the rentals in "Westerland" and "Kampen". The be-on! Hub builds the list of
|
|
301
304
|
regions from the rentals of the be-on key.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Changelog: 2.35.0
|
|
2
|
+
|
|
3
|
+
Websites can read their region tree, in one shape on v10 and v9, instead of a "Region"
|
|
4
|
+
custom attribute or the Hub `region` filter. Region pages and the search's region field
|
|
5
|
+
become the same code on both backends.
|
|
6
|
+
|
|
7
|
+
## Added
|
|
8
|
+
|
|
9
|
+
- `sdk.static.regions.getRegions({ aiStudioWebsiteId })`, a build-time read of the
|
|
10
|
+
website's region tree. Pass `Number(process.env.WEB_ID)`, which the builder and the
|
|
11
|
+
editor set.
|
|
12
|
+
- v10: the tree editors maintain in the CMS (Websites → "Regionen"); a website can have
|
|
13
|
+
its own tree. A rental can sit in several regions.
|
|
14
|
+
- v9: vOffice's region hierarchy through the be-on! Hub, with only the regions that hold
|
|
15
|
+
a rental of the be-on key. Slugs are generated from the names; siblings sort by German
|
|
16
|
+
name. `aiStudioWebsiteId` is ignored.
|
|
17
|
+
- Each region has German and English `name`, `slug` and `path` (`nordsee/dornum`, unique,
|
|
18
|
+
for region page URLs), an optional `description`, its `ownRentalIds`, and `rentalIds`,
|
|
19
|
+
which adds every subregion's rentals.
|
|
20
|
+
- The types `RegionsGetRegionsInput`, `WebsiteRegions` and `WebsiteRegion`.
|
|
21
|
+
- `regions.md` covers the data, region pages and the search's region field.
|
|
22
|
+
|
|
23
|
+
## Changed
|
|
24
|
+
|
|
25
|
+
- The custom attribute examples use a beach type instead of a region: a region is never
|
|
26
|
+
a custom attribute.
|
|
27
|
+
- The Hub `region` filter keeps working on v9; `search.md` points to the region tree for a
|
|
28
|
+
search's region field.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Migration: 2.34.0 to 2.35.0
|
|
2
|
+
|
|
3
|
+
No changes required. Follow step 2 only to take a site's regions from the region tree.
|
|
4
|
+
|
|
5
|
+
## 1. Upgrade
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pnpm add @v-office/website-sdk@2.35.0
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
For step 2.3, also upgrade the headless package, which brings `regionOptions` and
|
|
12
|
+
`regionsByRental`:
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
pnpm add @v-office/website-headless@1.2.0
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 2. Take the regions from the region tree
|
|
19
|
+
|
|
20
|
+
1. Read the tree once per build:
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
const regions = await sdk.static.regions.getRegions({
|
|
24
|
+
aiStudioWebsiteId: Number(process.env.WEB_ID),
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
2. v10: remove the code that reads the "Region" custom attribute values, and remove the
|
|
29
|
+
attribute from `defineCustomAttributes` if it was selected there. v9: a region field
|
|
30
|
+
fed by the Hub `region` filter can move to the tree; the Hub entry can stay.
|
|
31
|
+
3. Build the search bar's regions and each rental's region facts from the tree with
|
|
32
|
+
`regionOptions` and `regionsByRental` from `@v-office/website-headless` 1.2.0. Region
|
|
33
|
+
values become region ids, so links that carry an old `?region=<name>` no longer narrow
|
|
34
|
+
the search: update them.
|
|
35
|
+
4. Region pages take their URL from `path` and list `rentalIds`. A rental keeps its own
|
|
36
|
+
URL.
|
|
37
|
+
|
|
38
|
+
An empty tree is normal on v10 until editors create regions in the CMS: the region field
|
|
39
|
+
then hides itself. See `regions.md`.
|
|
@@ -5084,6 +5084,58 @@ const documents = {
|
|
|
5084
5084
|
}
|
|
5085
5085
|
}]
|
|
5086
5086
|
},
|
|
5087
|
+
"\n query CoreSDK_RentalRegions {\n all {\n voffice_id\n data(attributes: [\"region\"])\n }\n }\n": {
|
|
5088
|
+
kind: "Document",
|
|
5089
|
+
definitions: [{
|
|
5090
|
+
kind: "OperationDefinition",
|
|
5091
|
+
operation: "query",
|
|
5092
|
+
name: {
|
|
5093
|
+
kind: "Name",
|
|
5094
|
+
value: "CoreSDK_RentalRegions"
|
|
5095
|
+
},
|
|
5096
|
+
selectionSet: {
|
|
5097
|
+
kind: "SelectionSet",
|
|
5098
|
+
selections: [{
|
|
5099
|
+
kind: "Field",
|
|
5100
|
+
name: {
|
|
5101
|
+
kind: "Name",
|
|
5102
|
+
value: "all"
|
|
5103
|
+
},
|
|
5104
|
+
selectionSet: {
|
|
5105
|
+
kind: "SelectionSet",
|
|
5106
|
+
selections: [{
|
|
5107
|
+
kind: "Field",
|
|
5108
|
+
name: {
|
|
5109
|
+
kind: "Name",
|
|
5110
|
+
value: "voffice_id"
|
|
5111
|
+
}
|
|
5112
|
+
}, {
|
|
5113
|
+
kind: "Field",
|
|
5114
|
+
name: {
|
|
5115
|
+
kind: "Name",
|
|
5116
|
+
value: "data"
|
|
5117
|
+
},
|
|
5118
|
+
arguments: [{
|
|
5119
|
+
kind: "Argument",
|
|
5120
|
+
name: {
|
|
5121
|
+
kind: "Name",
|
|
5122
|
+
value: "attributes"
|
|
5123
|
+
},
|
|
5124
|
+
value: {
|
|
5125
|
+
kind: "ListValue",
|
|
5126
|
+
values: [{
|
|
5127
|
+
kind: "StringValue",
|
|
5128
|
+
value: "region",
|
|
5129
|
+
block: false
|
|
5130
|
+
}]
|
|
5131
|
+
}
|
|
5132
|
+
}]
|
|
5133
|
+
}]
|
|
5134
|
+
}
|
|
5135
|
+
}]
|
|
5136
|
+
}
|
|
5137
|
+
}]
|
|
5138
|
+
},
|
|
5087
5139
|
"\n query CoreSDK_RentalIds {\n all {\n voffice_id\n }\n }\n": {
|
|
5088
5140
|
kind: "Document",
|
|
5089
5141
|
definitions: [{
|
|
@@ -7826,6 +7878,15 @@ const hubRentalDataQuery = graphql(`
|
|
|
7826
7878
|
}
|
|
7827
7879
|
}
|
|
7828
7880
|
`);
|
|
7881
|
+
/** Every rental of the be-on key with its vOffice region (`{ id, idx }`). */
|
|
7882
|
+
const rentalRegionsQuery = graphql(`
|
|
7883
|
+
query CoreSDK_RentalRegions {
|
|
7884
|
+
all {
|
|
7885
|
+
voffice_id
|
|
7886
|
+
data(attributes: ["region"])
|
|
7887
|
+
}
|
|
7888
|
+
}
|
|
7889
|
+
`);
|
|
7829
7890
|
const rentalIdsQuery = graphql(`
|
|
7830
7891
|
query CoreSDK_RentalIds {
|
|
7831
7892
|
all {
|
|
@@ -8117,4 +8178,4 @@ const voucherValidityQuery = graphql(`
|
|
|
8117
8178
|
}
|
|
8118
8179
|
`);
|
|
8119
8180
|
//#endregion
|
|
8120
|
-
export {
|
|
8181
|
+
export { parseVofficeUnitData as S, customDataAttribute as _, hubRentalDataQuery as a, parseVofficeFeedbackData as b, rentalRegionsQuery as c, rentalsAllWithoutFeedbacksQuery as d, RegionSchema as f, VofficeUnitDataPropertyMetadata as g, VofficeUnitDataPropertyCategoryValues as h, hubFiltersQuery as i, rentalsAllByFacilityObjectGroupsWithoutFeedbacksQuery as l, VofficeUnitDataPropertyCategoryLabelKeys as m, mapSearchQuery as n, rentalFacilitiesForObjectGroupRelationQuery as o, VofficeUnitDataFieldSchemas as p, searchQuery as r, rentalIdsQuery as s, voucherValidityQuery as t, rentalsAllFeedbacksQuery as u, parseJsonData as v, parseVofficeRatingData as x, parseVofficeFacilityData as y };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Qt as V9_FACILITY_ATTRIBUTE_KEYS } from "./client-
|
|
2
|
-
import {
|
|
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-
|
|
1
|
+
import { Qt as V9_FACILITY_ATTRIBUTE_KEYS } from "./client-BC5ukCcN.mjs";
|
|
2
|
+
import { S as parseVofficeUnitData, b as parseVofficeFeedbackData, d as rentalsAllWithoutFeedbacksQuery, g as VofficeUnitDataPropertyMetadata, h as VofficeUnitDataPropertyCategoryValues, i as hubFiltersQuery, l as rentalsAllByFacilityObjectGroupsWithoutFeedbacksQuery, m as VofficeUnitDataPropertyCategoryLabelKeys, o as rentalFacilitiesForObjectGroupRelationQuery, p as VofficeUnitDataFieldSchemas, s as rentalIdsQuery, u as rentalsAllFeedbacksQuery, y as parseVofficeFacilityData } from "./operations-C1VMQYN2.mjs";
|
|
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-BdxQPpBU.mjs";
|
|
4
4
|
import { CoreSDKError, makeTranslate, renderResolvedCustomAttribute, toCustomAttributeList, toResolvedCustomAttributeCategoryTranslationKey } from "@v-office/sdk-core";
|
|
5
5
|
import { Effect } from "effect";
|
|
6
6
|
//#region src/legacy-v9/parser/rentals/to-description.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as makeV9CustomAttributeFilterCapabilities, c as parseQueryParameters, d as toVoucherCode, l as toQueryString, o as toBasicQueryInputs, s as collectQueryParameters, u as applyVofficeFilterDerivedBasicQueryInputs } from "./client-
|
|
2
|
-
import {
|
|
3
|
-
import { i as toLocation, n as toV9RentalHighlightKey, o as toImages, s as toAddress, t as toRentalHighlights } from "./to-rental-highlights-
|
|
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-BC5ukCcN.mjs";
|
|
2
|
+
import { S as parseVofficeUnitData, n as mapSearchQuery, r as searchQuery } from "./operations-C1VMQYN2.mjs";
|
|
3
|
+
import { i as toLocation, n as toV9RentalHighlightKey, o as toImages, s as toAddress, t as toRentalHighlights } from "./to-rental-highlights-BdxQPpBU.mjs";
|
|
4
4
|
import { CoreSDKError, STABLE_SEARCH_INPUTS, daysBetweenLocalDates, expandCustomAttributeFilterCompositions, parseChildrenAges, parseOccupancyCount, resolveExpandedCompositions, toFormattedSearchPrice, toIsoDateFromPeriodQueryDate, toStableSearchInputBackendQueryKeys, toStableSearchInputParameterValues, toStableSearchInputQueryKeys, toUnusedFilterKeys } from "@v-office/sdk-core";
|
|
5
5
|
import { Effect } from "effect";
|
|
6
6
|
//#region src/legacy-v9/parser/search/input/search-input-error.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as VofficeUnitDataPropertyMetadata } from "./operations-C1VMQYN2.mjs";
|
|
2
2
|
import { localeToLanguage, makeTranslate, renderLabeledAttributeValue, renderResolvedCustomAttribute, toCountry } from "@v-office/sdk-core";
|
|
3
3
|
import { Effect } from "effect";
|
|
4
4
|
//#region src/legacy-v9/parser/rentals/to-localized-string.ts
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Release notes of `@v-office/website-sdk`, newest first. Each version has its own directory.
|
|
6
6
|
|
|
7
|
+
- `versions/2.35.0/CHANGELOG.md`: release notes for 2.35.0
|
|
7
8
|
- `versions/2.34.0/CHANGELOG.md`: release notes for 2.34.0
|
|
8
9
|
- `versions/2.33.0/CHANGELOG.md`: release notes for 2.33.0
|
|
9
10
|
- `versions/2.32.0/CHANGELOG.md`: release notes for 2.32.0
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Migration guides of `@v-office/website-sdk`, newest first. Apply them in order when skipping versions.
|
|
6
6
|
|
|
7
|
+
- `versions/2.35.0/MIGRATION.md`: Migration: 2.34.0 to 2.35.0
|
|
7
8
|
- `versions/2.34.0/MIGRATION.md`: Migration: 2.33.0 to 2.34.0
|
|
8
9
|
- `versions/2.33.0/MIGRATION.md`: Migration: 2.32.0 to 2.33.0
|
|
9
10
|
- `versions/2.32.0/MIGRATION.md`: Migration: 2.31.1 to 2.32.0
|
package/instructions/README.md
CHANGED
|
@@ -11,6 +11,7 @@ Use this directory as the consumer-facing reference for the package:
|
|
|
11
11
|
- `filter.md`: `sdk.static.filter.getFilters`.
|
|
12
12
|
- `videos.md`: v9 only. `sdk.static.videos.getVideos`, placements, and HLS playback.
|
|
13
13
|
- `custom-attributes.md`: custom attribute catalog, configuration, per-backend behaviour, and the v9-to-v10 move.
|
|
14
|
+
- `regions.md`: `sdk.static.regions.getRegions`, the website's region tree, region pages, and the search's region field.
|
|
14
15
|
- `search.md`: `sdk.live.search.search`, vouchers, and, on v9, `sdk.live.search.searchPages`, Hub filters, and `sdk.live.voucher.validate`.
|
|
15
16
|
- `availability.md`: date-picker availability flows.
|
|
16
17
|
- `quote.md`: quote booking-card modifiers, additional services, cancellation policy, and insurance flows.
|
package/instructions/creation.md
CHANGED
|
@@ -244,11 +244,11 @@ Custom attributes are configured through `customAttributes`, built by
|
|
|
244
244
|
const customAttributes = defineCustomAttributes({
|
|
245
245
|
catalog,
|
|
246
246
|
select: {
|
|
247
|
-
|
|
248
|
-
label: { "de-DE": "
|
|
247
|
+
beach: {
|
|
248
|
+
label: { "de-DE": "Strand", "en-US": "Beach" },
|
|
249
249
|
filter: true,
|
|
250
250
|
optionLabels: {
|
|
251
|
-
|
|
251
|
+
sand: { "de-DE": "Sandstrand", "en-US": "Sandy beach" },
|
|
252
252
|
},
|
|
253
253
|
},
|
|
254
254
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Custom Attributes
|
|
2
2
|
|
|
3
|
-
Custom attributes are workspace-specific rental metadata: a sauna flag, a
|
|
3
|
+
Custom attributes are workspace-specific rental metadata: a sauna flag, a beach type, an
|
|
4
4
|
occupancy score, a marketing text. This document covers how to configure them, how
|
|
5
5
|
they behave on each backend, and what changes when a site moves from `v9` to `v10`.
|
|
6
6
|
|
|
@@ -11,6 +11,9 @@ They serve three separate concerns, and each is configured independently:
|
|
|
11
11
|
- **Backend identity**: the workspace-specific v10 definition ID or v9 rental-data
|
|
12
12
|
field the SDK must talk to.
|
|
13
13
|
|
|
14
|
+
Regions are not custom attributes. Read the website's region tree with
|
|
15
|
+
`sdk.static.regions.getRegions` (see `regions.md`), not a "Region" attribute.
|
|
16
|
+
|
|
14
17
|
## Two Halves: Catalog and Policy
|
|
15
18
|
|
|
16
19
|
Configuration is a join of two things that have different owners.
|
|
@@ -30,12 +33,12 @@ const customAttributes = defineCustomAttributes({
|
|
|
30
33
|
catalog,
|
|
31
34
|
select: {
|
|
32
35
|
sauna: { label: { "de-DE": "Sauna", "en-US": "Sauna" } },
|
|
33
|
-
|
|
34
|
-
label: { "de-DE": "
|
|
36
|
+
beach: {
|
|
37
|
+
label: { "de-DE": "Strand", "en-US": "Beach" },
|
|
35
38
|
filter: true,
|
|
36
39
|
optionLabels: {
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
sand: { "de-DE": "Sandstrand", "en-US": "Sandy beach" },
|
|
41
|
+
grass: { "de-DE": "Grünstrand", "en-US": "Grass beach" },
|
|
39
42
|
},
|
|
40
43
|
},
|
|
41
44
|
},
|
|
@@ -51,7 +54,7 @@ site means the build fails. Every problem is reported in one pass:
|
|
|
51
54
|
Invalid custom attribute configuration (3 problems):
|
|
52
55
|
- sauna.label: missing a label for de-DE; the catalog supplies none, so it must be authored
|
|
53
56
|
- amenityTags: backend type MULTI_SELECT has no canonical SDK value type yet, so it cannot be selected
|
|
54
|
-
-
|
|
57
|
+
- beach.optionLabels: a filterable option attribute needs a label for every option; missing grass, pebble
|
|
55
58
|
```
|
|
56
59
|
|
|
57
60
|
## The Catalog
|
|
@@ -268,7 +271,7 @@ When a value cannot be read as the declared type — an `int` of `"1.5"` or an o
|
|
|
268
271
|
value the catalog does not declare — the attribute is omitted rather than rendering
|
|
269
272
|
something misleading. A false boolean and an absent value are also omitted.
|
|
270
273
|
|
|
271
|
-
Scalar filters take **one** value. Given `?
|
|
274
|
+
Scalar filters take **one** value. Given `?beach=sand,grass`, the first valid value
|
|
272
275
|
is applied, but the key also remains in `unusedFilterKeys` because the extra token was
|
|
273
276
|
not applied. Combining scalar values would depend on backend semantics that are not
|
|
274
277
|
specified, and an AND of two option values can only return nothing.
|
|
@@ -286,7 +289,7 @@ const options = defineWebsiteSDKOptions({
|
|
|
286
289
|
customAttributes,
|
|
287
290
|
rentalHighlightPrioritization: [
|
|
288
291
|
"bedrooms",
|
|
289
|
-
customAttributes.keys.
|
|
292
|
+
customAttributes.keys.beach, // checked for a literal typed registry
|
|
290
293
|
"bathrooms",
|
|
291
294
|
],
|
|
292
295
|
});
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Regions
|
|
2
|
+
|
|
3
|
+
Regions group a site's rentals into a tree, for example Nordsee → Dornum → Dornumersiel.
|
|
4
|
+
`sdk.static.regions.getRegions` returns the tree in the same shape on both backends, so
|
|
5
|
+
region pages and the search's region field are the same code on v10 and v9.
|
|
6
|
+
|
|
7
|
+
| | v10 | v9 |
|
|
8
|
+
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
|
|
9
|
+
| Source | the websites service: editors arrange regions in the CMS (Websites → "Regionen"), and a website can have its own tree instead of the workspace's default | vOffice's region hierarchy, through the be-on! Hub |
|
|
10
|
+
| Regions per rental | several | one; it also counts for every region above it |
|
|
11
|
+
| Names | German and English | German; English when vOffice has it |
|
|
12
|
+
| Slugs | set by editors | generated from the names |
|
|
13
|
+
| Order | the editors' order | siblings by German name |
|
|
14
|
+
| Regions returned | every region in the tree | only regions holding a rental of the be-on key |
|
|
15
|
+
|
|
16
|
+
Regions are not a custom attribute. Do not read a "Region" custom attribute, and do not
|
|
17
|
+
select one in `defineCustomAttributes`: the tree replaces both.
|
|
18
|
+
|
|
19
|
+
## Reading The Tree
|
|
20
|
+
|
|
21
|
+
Read the tree once per build, at build time:
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
const regions = await sdk.static.regions.getRegions({
|
|
25
|
+
aiStudioWebsiteId: Number(process.env.WEB_ID),
|
|
26
|
+
});
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`WEB_ID` is the AI Studio website id. The builder and the editor's dev server set it. v9
|
|
30
|
+
ignores it: vOffice keeps one region tree per customer.
|
|
31
|
+
|
|
32
|
+
Every call reads the whole tree, and neither backend caches it, so call it once and pass
|
|
33
|
+
the result on. Never call it per component, per page in the browser, or per request. A
|
|
34
|
+
failed read rejects, so the build stops instead of publishing a site without its regions.
|
|
35
|
+
A v10 website the service has no tree for returns an empty tree.
|
|
36
|
+
|
|
37
|
+
On v10, every change editors make to regions or region assignments queues a new build of
|
|
38
|
+
the website. A site never has to poll.
|
|
39
|
+
|
|
40
|
+
## The Result
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
type WebsiteRegions = {
|
|
44
|
+
isWebsiteOverride: boolean; // v10: true for the website's own tree; always false on v9
|
|
45
|
+
regions: readonly WebsiteRegion[];
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
type WebsiteRegion = {
|
|
49
|
+
id: string;
|
|
50
|
+
parentId: string | null; // null: top level
|
|
51
|
+
depth: number; // 0: top level
|
|
52
|
+
name: { "de-DE": string; "en-US": string };
|
|
53
|
+
slug: { "de-DE": string; "en-US": string };
|
|
54
|
+
path: { "de-DE": string; "en-US": string }; // "nordsee/dornum"
|
|
55
|
+
description: { "de-DE"?: string; "en-US"?: string };
|
|
56
|
+
ownRentalIds: readonly string[];
|
|
57
|
+
rentalIds: readonly string[];
|
|
58
|
+
};
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
- `regions` is depth first: every region comes before its subregions. Render it top to
|
|
62
|
+
bottom, or rebuild the tree from `parentId`.
|
|
63
|
+
- `name` and `slug` always hold both languages. When only one exists, the other language
|
|
64
|
+
uses it. `description` holds only the languages a description exists in.
|
|
65
|
+
- A slug is unique among its siblings, not across the tree. `path` joins the slugs of the
|
|
66
|
+
region's ancestors and its own with `/`, and is unique: use it as the URL path. On v9,
|
|
67
|
+
renaming a region in vOffice changes its slug and so its page URL.
|
|
68
|
+
- `ownRentalIds` are the rentals in the region itself. `rentalIds` adds every subregion's
|
|
69
|
+
rentals, each rental once. A region page lists `rentalIds`: "Nordsee" shows Dornum's
|
|
70
|
+
and Dornumersiel's rentals too.
|
|
71
|
+
- The ids are rental ids as `getRentals` returns them. Neither backend applies the SDK's
|
|
72
|
+
`rentalScope`: list only the rentals the site has.
|
|
73
|
+
|
|
74
|
+
## Region Pages And Rental URLs
|
|
75
|
+
|
|
76
|
+
Build one page per region from `path`, for example `/regionen/nordsee/dornum`, with the
|
|
77
|
+
name, the description and the rentals of `rentalIds`.
|
|
78
|
+
|
|
79
|
+
A rental keeps the one URL it already has. Never nest a rental's URL under a region: a
|
|
80
|
+
rental in several regions would get several URLs. Region pages link to the rental's own
|
|
81
|
+
page.
|
|
82
|
+
|
|
83
|
+
## Search
|
|
84
|
+
|
|
85
|
+
The search bar's region field and the `?region=` scope work in the browser, on facts the
|
|
86
|
+
build attaches to each rental. `@v-office/website-headless` turns the tree into both:
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
import {
|
|
90
|
+
cardSource,
|
|
91
|
+
rentalFactsMap,
|
|
92
|
+
regionOptions,
|
|
93
|
+
regionsByRental,
|
|
94
|
+
} from "@v-office/website-headless";
|
|
95
|
+
|
|
96
|
+
const options = regionOptions(regions, {
|
|
97
|
+
locale: "de-DE",
|
|
98
|
+
rentalIds: rentals.map((rental) => rental.id),
|
|
99
|
+
});
|
|
100
|
+
const regionsOf = regionsByRental(regions); // rental id → region ids
|
|
101
|
+
|
|
102
|
+
const sources = rentals.map((rental) =>
|
|
103
|
+
cardSource(rental, { rentalHref, regions: regionsOf[rental.id] ?? [] }),
|
|
104
|
+
);
|
|
105
|
+
const facts = rentalFactsMap(sources); // the search results' `facts`
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Pass `options` as they are as the `regions` prop of `SearchBar` from
|
|
109
|
+
`@v-office/website-components`; `createSearchForm` takes their `value`s. A region without
|
|
110
|
+
rentals is not offered, and `rentalIds` keeps a region whose rentals are all outside the
|
|
111
|
+
site's `rentalScope` out of the field and its counts.
|
|
112
|
+
|
|
113
|
+
The value of a region is its `id` (`?region=<id>`). A rental counts for a region and for
|
|
114
|
+
every region above it, so `?region=<id of Nordsee>` also finds the rentals in Dornum. To word a
|
|
115
|
+
`?region=` chip with the region's name instead of its id, curate a hidden `region` facet
|
|
116
|
+
with the same options:
|
|
117
|
+
|
|
118
|
+
```ts
|
|
119
|
+
{ kind: "facet", key: "region", label: "Region", options, hidden: true }
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
On v9 this replaces the Hub `region` filter (`search.md`, "A Filter By Region") for the
|
|
123
|
+
region field: it needs no Hub entry. A site that already uses the Hub filter keeps working.
|
package/instructions/search.md
CHANGED
|
@@ -296,6 +296,9 @@ Hub knows. The English labels are the German names; translate them.
|
|
|
296
296
|
|
|
297
297
|
#### A Filter By Region
|
|
298
298
|
|
|
299
|
+
For a region field in the search, prefer the region tree (`regions.md`): it works on v10
|
|
300
|
+
and v9 and needs no Hub entry.
|
|
301
|
+
|
|
299
302
|
`region` keeps rentals in one vOffice region and in its subregions: the region "Sylt"
|
|
300
303
|
also finds the rentals in "Westerland" and "Kampen". The be-on! Hub builds the list of
|
|
301
304
|
regions from the rentals of the be-on key.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Changelog: 2.35.0
|
|
2
|
+
|
|
3
|
+
Websites can read their region tree, in one shape on v10 and v9, instead of a "Region"
|
|
4
|
+
custom attribute or the Hub `region` filter. Region pages and the search's region field
|
|
5
|
+
become the same code on both backends.
|
|
6
|
+
|
|
7
|
+
## Added
|
|
8
|
+
|
|
9
|
+
- `sdk.static.regions.getRegions({ aiStudioWebsiteId })`, a build-time read of the
|
|
10
|
+
website's region tree. Pass `Number(process.env.WEB_ID)`, which the builder and the
|
|
11
|
+
editor set.
|
|
12
|
+
- v10: the tree editors maintain in the CMS (Websites → "Regionen"); a website can have
|
|
13
|
+
its own tree. A rental can sit in several regions.
|
|
14
|
+
- v9: vOffice's region hierarchy through the be-on! Hub, with only the regions that hold
|
|
15
|
+
a rental of the be-on key. Slugs are generated from the names; siblings sort by German
|
|
16
|
+
name. `aiStudioWebsiteId` is ignored.
|
|
17
|
+
- Each region has German and English `name`, `slug` and `path` (`nordsee/dornum`, unique,
|
|
18
|
+
for region page URLs), an optional `description`, its `ownRentalIds`, and `rentalIds`,
|
|
19
|
+
which adds every subregion's rentals.
|
|
20
|
+
- The types `RegionsGetRegionsInput`, `WebsiteRegions` and `WebsiteRegion`.
|
|
21
|
+
- `regions.md` covers the data, region pages and the search's region field.
|
|
22
|
+
|
|
23
|
+
## Changed
|
|
24
|
+
|
|
25
|
+
- The custom attribute examples use a beach type instead of a region: a region is never
|
|
26
|
+
a custom attribute.
|
|
27
|
+
- The Hub `region` filter keeps working on v9; `search.md` points to the region tree for a
|
|
28
|
+
search's region field.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Migration: 2.34.0 to 2.35.0
|
|
2
|
+
|
|
3
|
+
No changes required. Follow step 2 only to take a site's regions from the region tree.
|
|
4
|
+
|
|
5
|
+
## 1. Upgrade
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pnpm add @v-office/website-sdk@2.35.0
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
For step 2.3, also upgrade the headless package, which brings `regionOptions` and
|
|
12
|
+
`regionsByRental`:
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
pnpm add @v-office/website-headless@1.2.0
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 2. Take the regions from the region tree
|
|
19
|
+
|
|
20
|
+
1. Read the tree once per build:
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
const regions = await sdk.static.regions.getRegions({
|
|
24
|
+
aiStudioWebsiteId: Number(process.env.WEB_ID),
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
2. v10: remove the code that reads the "Region" custom attribute values, and remove the
|
|
29
|
+
attribute from `defineCustomAttributes` if it was selected there. v9: a region field
|
|
30
|
+
fed by the Hub `region` filter can move to the tree; the Hub entry can stay.
|
|
31
|
+
3. Build the search bar's regions and each rental's region facts from the tree with
|
|
32
|
+
`regionOptions` and `regionsByRental` from `@v-office/website-headless` 1.2.0. Region
|
|
33
|
+
values become region ids, so links that carry an old `?region=<name>` no longer narrow
|
|
34
|
+
the search: update them.
|
|
35
|
+
4. Region pages take their URL from `path` and list `rentalIds`. A rental keeps its own
|
|
36
|
+
URL.
|
|
37
|
+
|
|
38
|
+
An empty tree is normal on v10 until editors create regions in the CMS: the region field
|
|
39
|
+
then hides itself. See `regions.md`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-office/website-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.35.0",
|
|
4
4
|
"description": "Website-facing SDK facade backed by @v-office/sdk-core",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@graphql-typed-document-node/core": "3.2.0",
|
|
51
|
-
"@v-office/sdk-core": "1.
|
|
51
|
+
"@v-office/sdk-core": "1.27.0",
|
|
52
52
|
"effect": "4.0.0-rc.115",
|
|
53
53
|
"graphql": "17.0.2",
|
|
54
54
|
"yaml": "^2.9.0"
|