@v-office/website-sdk 2.36.1 → 2.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
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-D44b3iET.mjs";
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-D53W9Uas.mjs";
3
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";
@@ -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.36.1";
20
+ var version = "2.37.0";
21
21
  //#endregion
22
22
  //#region src/cli/output.ts
23
23
  const toJson = (value) => Effect.try({
@@ -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$1 = ["de-DE", "en-US"];
265
+ const LOCALES = ["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$1.join(", ")}`);
289
+ if (!isRecord(label)) issues.push(`${path}.label: expected a label for ${LOCALES.join(", ")}`);
290
290
  else {
291
- const missing = LOCALES$1.filter((locale) => typeof label[locale] !== "string" || label[locale].trim() === "");
291
+ const missing = LOCALES.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;
@@ -6177,7 +6177,7 @@ const parseV9SearchCursor = (cursor) => Effect.gen(function* () {
6177
6177
  return page;
6178
6178
  });
6179
6179
  const loadV9SearchRuntime = Effect.tryPromise({
6180
- try: () => import("./search-ByfrSxM6.mjs"),
6180
+ try: () => import("./search-pFLiI6QI.mjs"),
6181
6181
  catch: (cause) => new CoreSDKError({
6182
6182
  source: "v9",
6183
6183
  operation: "v9.search.runtime",
@@ -6852,38 +6852,16 @@ const makeV9FilterApi = ({ options }) => {
6852
6852
  };
6853
6853
  //#endregion
6854
6854
  //#region src/legacy-v9/static/regions.ts
6855
- const LOCALES = ["de-DE", "en-US"];
6856
- /** The name in the locale, else the other language. */
6855
+ /** The region's one name, German; the English one only stands in for a missing German one. */
6857
6856
  const toName = (region) => {
6858
6857
  const names = region.name ?? {};
6859
- const de = names.de?.trim() || names.en?.trim();
6860
- const en = names.en?.trim() || de;
6861
- return de && en ? {
6862
- "de-DE": de,
6863
- "en-US": en
6858
+ const name = names.de?.trim() || names.en?.trim();
6859
+ return name ? {
6860
+ "de-DE": name,
6861
+ "en-US": name
6864
6862
  } : void 0;
6865
6863
  };
6866
- const toDescription = (region) => {
6867
- const texts = region.description ?? region.descriptions ?? {};
6868
- const description = {};
6869
- for (const locale of LOCALES) {
6870
- const text = texts[localeToLanguage(locale)]?.trim();
6871
- if (text) description[locale] = text;
6872
- }
6873
- return description;
6874
- };
6875
6864
  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";
6876
- /** Slugs unique among `names`' siblings: a repeat gets "-2", "-3" … in order. */
6877
- const uniqueSlugs = (names) => {
6878
- const taken = /* @__PURE__ */ new Set();
6879
- return names.map((name) => {
6880
- const base = toSlug(name);
6881
- let slug = base;
6882
- for (let n = 2; taken.has(slug); n++) slug = `${base}-${n}`;
6883
- taken.add(slug);
6884
- return slug;
6885
- });
6886
- };
6887
6865
  /** Maps the vOffice regions and the rentals' regions; throws on a region without a name. */
6888
6866
  const toV9WebsiteRegions = ({ regions, rentalRegions }) => {
6889
6867
  const ids = new Set(regions.map((region) => region._id));
@@ -6900,28 +6878,20 @@ const toV9WebsiteRegions = ({ regions, rentalRegions }) => {
6900
6878
  for (const { rentalId, regionId } of rentalRegions) if (ids.has(regionId)) ownRentalIds.set(regionId, [...ownRentalIds.get(regionId) ?? [], rentalId]);
6901
6879
  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);
6902
6880
  const hasRentals = (id) => (ownRentalIds.get(id)?.length ?? 0) > 0 || childrenOf(id).some(({ region }) => hasRentals(region._id));
6903
- const visit = (parent) => {
6904
- const siblings = childrenOf(parent);
6905
- const de = uniqueSlugs(siblings.map(({ name }) => name["de-DE"]));
6906
- const en = uniqueSlugs(siblings.map(({ name }) => name["en-US"]));
6907
- return siblings.flatMap(({ region, name }, index) => {
6908
- if (!hasRentals(region._id)) return [];
6909
- return [{
6910
- id: String(region._id),
6911
- parentId: parent === null ? null : String(parent),
6912
- name,
6913
- slug: {
6914
- "de-DE": de[index] ?? "",
6915
- "en-US": en[index] ?? ""
6916
- },
6917
- description: toDescription(region),
6918
- ownRentalIds: ownRentalIds.get(region._id) ?? []
6919
- }, ...visit(region._id)];
6920
- });
6921
- };
6881
+ const keys = new Map(named.map(({ region, name }) => [region._id, `${toSlug(name["de-DE"])}-${region._id}`]));
6882
+ const keyOf = (id) => keys.get(id) ?? String(id);
6883
+ const visit = (parent) => childrenOf(parent).flatMap(({ region, name }) => {
6884
+ if (!hasRentals(region._id)) return [];
6885
+ return [{
6886
+ id: keyOf(region._id),
6887
+ parentId: parent === null ? null : keyOf(parent),
6888
+ name,
6889
+ ownRentalIds: ownRentalIds.get(region._id) ?? []
6890
+ }, ...visit(region._id)];
6891
+ });
6922
6892
  const inputs = visit(null);
6923
6893
  const reached = new Set(inputs.map(({ id }) => id));
6924
- const unreachedRentalRegion = [...ownRentalIds.keys()].find((id) => !reached.has(String(id)));
6894
+ const unreachedRentalRegion = [...ownRentalIds.keys()].find((id) => !reached.has(keyOf(id)));
6925
6895
  if (unreachedRentalRegion !== void 0) throw new Error(`vOffice region ${unreachedRentalRegion} with rentals is not reachable from a root.`);
6926
6896
  return buildWebsiteRegions({
6927
6897
  isWebsiteOverride: false,
@@ -6935,10 +6905,7 @@ const makeV9RegionsApi = ({ config }) => {
6935
6905
  ...config.v0ApiBaseUrl === void 0 ? {} : { baseUrl: config.v0ApiBaseUrl }
6936
6906
  });
6937
6907
  const loadRegions = Effect.gen(function* () {
6938
- const result = yield* (yield* V0OpenApiClient).execute("proxyVofficeAction", { query: {
6939
- actionName: "getRegions",
6940
- description: true
6941
- } });
6908
+ const result = yield* (yield* V0OpenApiClient).execute("proxyVofficeAction", { query: { actionName: "getRegions" } });
6942
6909
  const response = yield* Schema.decodeUnknownEffect(RegionsResponseSchema)(result.raw);
6943
6910
  if (response.ok === false || response.regions === void 0) return yield* Effect.fail(new CoreSDKError({
6944
6911
  source: "v9",
@@ -7040,7 +7007,7 @@ const orderRentalsById = ({ rentalIds, rentals, missing }) => {
7040
7007
  });
7041
7008
  };
7042
7009
  const loadV9RentalsRuntime = Effect.tryPromise({
7043
- try: () => import("./rentals-TAEGMfgF.mjs"),
7010
+ try: () => import("./rentals-BxkYXAVn.mjs"),
7044
7011
  catch: (cause) => new CoreSDKError({
7045
7012
  source: "v9",
7046
7013
  operation: "v9.rentals.runtime",
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-D44b3iET.mjs";
1
+ import { $ as QuoteSchema, A as DocumentResourceSchema, At as bookInsuranceEffect, B as ErgoPersonSchema, Bt as quoteEffect, C as ApiEnvelopeBaseSchema, Ct as V1_BASE_URL, D as CustomerUnitSummarySchema, Dt as decodeV1OperationResponse, E as CurrentMemberResponseSchema, Et as VideoResponseSchema, F as ErgoAddressSchema, Ft as getInitialAvailabilityEffect, G as FacilityListResponseSchema, Gt as selectInsurancePaymentEffect, H as ErgoPolicyNumberRequestSchema, Ht as searchEffect, I as ErgoBankSchema, It as getRentalsEffect, J as PaymentScheduleItemSchema, Jt as submitPaymentOptionEffect, K as OnOfficeUnitCollectionResponseSchema, Kt as submitContactEffect, L as ErgoBookRequestSchema, Lt as getStartDateSelectedAvailabilityEffect, M as DocumentStatusUpdateRequestSchema, Mt as createInsurancePreContractEffect, N as DocumentSummarySchema, Nt as getBankTransferDetailsEffect, O as DocumentCollectionResponseSchema, Ot as addAdditionalServiceEffect, P as DocumentTypeSchema, Pt as getFiltersEffect, Q as QuotePricesResponseSchema, R as ErgoCommonFieldsSchema, Rt as getTermsAndPrivacyPolicyEffect, S as makeV1OpenApiClientLive, St as UnitServicePriceSchema, T as CalendarResponseSchema, Tt as VideoListResponseSchema, U as ErgoReadPreContractRequestSchema, Ut as selectCancellationPolicyEffect, V as ErgoPlanSearchRequestSchema, Vt as removeAdditionalServiceEffect, W as ErgoTripAndCustomerRequestSchema, Wt as selectInsuranceEffect, X as QuoteLineSchema, Xt as defineV9PropertyHighlightSources, Y as PaymentScheduleSchema, Yt as defineWebsiteSDKOptions, Z as QuotePricesPayloadSchema, Zt as defineV9PropertyHighlightSourcesFromUnknown, _t as UnitIdsResponseSchema, at as SearchPropertiesResponseSchema, b as V1OpenApiClientError, bt as UnitOfferSchema, ct as ServiceLimitSchema, dt as SetupResponseSchema, et as QuoteServiceSchema, ft as TileCollectionResponseSchema, g as makeV0OpenApiClientLive, gt as TravelInsuranceBookingStoreRequestSchema, h as makeV0OpenApiClientFetchLive, ht as TravelInsuranceBookingSchema, it as RoomImageSchema, j as DocumentStatusSchema, jt as clearAdditionalServicesEffect, k as DocumentResourceResponseSchema, kt as bookEffect, lt as ServiceListResponseSchema, m as V0OpenApiClientError, mt as TileTagSchema, nt as RawVofficeObjectSchema, ot as ServiceBeonDataSchema, p as V0OpenApiClient, pt as TileSchema, q as OnOfficeUnitSchema, qt as submitPaymentOption, rt as RegionListResponseSchema, st as ServiceImageSchema, t as createWebsiteSDK, tt as RawObjectResponseSchema, ut as SetupDataSchema, vt as UnitListItemSchema, w as CalendarDaySchema, wt as V1_OPERATIONS, x as makeV1OpenApiClientFetchLive, xt as UnitResponseSchema, y as V1OpenApiClient, yt as UnitListResponseSchema, z as ErgoCreatePreContractRequestSchema, zt as mapSearchEffect } from "./client-D53W9Uas.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.37.0/CHANGELOG.md`: release notes for 2.37.0
8
+ - `versions/2.36.2/CHANGELOG.md`: release notes for 2.36.2
7
9
  - `versions/2.36.1/CHANGELOG.md`: release notes for 2.36.1
8
10
  - `versions/2.36.0/CHANGELOG.md`: release notes for 2.36.0
9
11
  - `versions/2.35.0/CHANGELOG.md`: release notes for 2.35.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.37.0/MIGRATION.md`: Migration: 2.36.2 to 2.37.0
8
+ - `versions/2.36.2/MIGRATION.md`: Migration: 2.36.1 to 2.36.2
7
9
  - `versions/2.36.1/MIGRATION.md`: Migration: 2.36.0 to 2.36.1
8
10
  - `versions/2.36.0/MIGRATION.md`: Migration: 2.35.0 to 2.36.0
9
11
  - `versions/2.35.0/MIGRATION.md`: Migration: 2.34.0 to 2.35.0
@@ -8,8 +8,8 @@ region pages and the search's region field are the same code on v10 and v9.
8
8
  | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
9
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
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 |
11
+ | Names | one, in German | one, in German; English when vOffice has no German |
12
+ | Region ids | created once by the websites service from the German name; never change | German name and vOffice id; change on a rename |
13
13
  | Order | the editors' order | siblings by German name |
14
14
  | Regions returned | every region in the tree | only regions holding a rental of the be-on key |
15
15
 
@@ -46,13 +46,10 @@ type WebsiteRegions = {
46
46
  };
47
47
 
48
48
  type WebsiteRegion = {
49
- id: string;
49
+ id: string; // "dornum": the region's URL and `?region=` value
50
50
  parentId: string | null; // null: top level
51
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 };
52
+ name: { "de-DE": string; "en-US": string }; // the one German name, in every locale
56
53
  ownRentalIds: readonly string[];
57
54
  rentalIds: readonly string[];
58
55
  };
@@ -60,11 +57,16 @@ type WebsiteRegion = {
60
57
 
61
58
  - `regions` is depth first: every region comes before its subregions. Render it top to
62
59
  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.
60
+ - `id` is readable (`dornum`, `neustadt-2`), unique in the tree and the same in every
61
+ language. It is the region's identity on the site: its page URL and its search value.
62
+ - v10: the websites service creates it once from the German name. Renaming or moving the
63
+ region, and giving the website its own tree, keep it; editors cannot change it. Only
64
+ deleting the region ends it.
65
+ - v9: vOffice's German name and its vOffice id, for example `usedom-12`. Renaming the
66
+ region in vOffice changes it; no other region's change does.
67
+ - A region has one name, the German one. `name` holds it under every locale, so
68
+ `name[locale]` works on English pages too. Regions have no description: write a region
69
+ page's text in the site.
68
70
  - `ownRentalIds` are the rentals in the region itself. `rentalIds` adds every subregion's
69
71
  rentals, each rental once. A region page lists `rentalIds`: "Nordsee" shows Dornum's
70
72
  and Dornumersiel's rentals too.
@@ -73,8 +75,9 @@ type WebsiteRegion = {
73
75
 
74
76
  ## Region Pages And Rental URLs
75
77
 
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
+ Build one page per region from its `id`, for example `/regionen/dornum`, with the name, the
79
+ site's own text for the region, and the rentals of `rentalIds`. Keep the URL flat: a URL that nests the
80
+ ancestors' ids changes whenever an editor moves the region.
78
81
 
79
82
  A rental keeps the one URL it already has. Never nest a rental's URL under a region: a
80
83
  rental in several regions would get several URLs. Region pages link to the rental's own
@@ -110,8 +113,8 @@ Pass `options` as they are as the `regions` prop of `SearchBar` from
110
113
  rentals is not offered, and `rentalIds` keeps a region whose rentals are all outside the
111
114
  site's `rentalScope` out of the field and its counts.
112
115
 
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
116
+ The value of a region is its `id` (`?region=nordsee`). A rental counts for a region and for
117
+ every region above it, so `?region=nordsee` also finds the rentals in Dornum. To word a
115
118
  `?region=` chip with the region's name instead of its id, curate a hidden `region` facet
116
119
  with the same options:
117
120
 
@@ -0,0 +1,16 @@
1
+ # Changelog: 2.36.2
2
+
3
+ A fix release: `sdk.static.regions.getRegions` works on v10 again.
4
+
5
+ ## Fixed
6
+
7
+ - v10: `sdk.static.regions.getRegions` rejected for every website since 2.35.0 with
8
+ `Cannot query field "position" on type "websites_WebsiteRegionRental"`
9
+ (`GRAPHQL_VALIDATION_FAILED`). The websites service no longer has a rental's position in a
10
+ region, and the SDK asked for it. The SDK now asks only for what it reads, so a site build
11
+ that reads regions no longer stops. The result is the same as before: `ownRentalIds`,
12
+ `rentalIds`, `depth` and every other field are unchanged.
13
+
14
+ ## Changed
15
+
16
+ - Nothing for existing code. v9 was not affected.
@@ -0,0 +1,10 @@
1
+ # Migration: 2.36.1 to 2.36.2
2
+
3
+ No changes required. A v10 site that reads `sdk.static.regions.getRegions` needs this version for
4
+ its build to pass.
5
+
6
+ ## 1. Upgrade
7
+
8
+ ```sh
9
+ pnpm add @v-office/website-sdk@2.36.2
10
+ ```
@@ -0,0 +1,26 @@
1
+ # Changelog: 2.37.0
2
+
3
+ A region's `id` is now a readable key that editors cannot change, so region page URLs and
4
+ `?region=` values stay the same when regions are renamed or moved. A region is just a
5
+ name now: one German name, no description.
6
+
7
+ ## Changed
8
+
9
+ - `sdk.static.regions.getRegions`: a region's `id` and `parentId` are the region's key, for
10
+ example `dornum` or `neustadt-2`, instead of the backend's id. A key is unique in the
11
+ tree and the same in every language.
12
+ - v10: the websites service creates it once from the German name. Renaming or moving the
13
+ region, and giving the website its own tree, keep it; editors cannot change it. Only
14
+ deleting the region ends it. This needs the websites service with region keys; on an
15
+ environment without it, the read rejects.
16
+ - v9: vOffice's German name and its vOffice id, for example `usedom-12`. Renaming the
17
+ region in vOffice changes it; no other region's change does.
18
+ - `WebsiteRegion.name` holds the region's one name, the German one, under every locale
19
+ (`name["en-US"]` is the German name too). On v9 an English name only stands in when vOffice
20
+ has no German one.
21
+
22
+ ## Removed
23
+
24
+ - `WebsiteRegion.slug` and `WebsiteRegion.path`. Use `id`: one flat URL per region
25
+ (`/regionen/dornum`) and `?region=dornum`.
26
+ - `WebsiteRegion.description`. Write a region page's text in the site.
@@ -0,0 +1,23 @@
1
+ # Migration: 2.36.2 to 2.37.0
2
+
3
+ Only sites that read `sdk.static.regions.getRegions` need to change anything.
4
+
5
+ ## 1. Upgrade
6
+
7
+ ```sh
8
+ pnpm add @v-office/website-sdk@2.37.0
9
+ ```
10
+
11
+ ## 2. Build region URLs from `id`
12
+
13
+ 1. Replace every use of a region's `path` or `slug` with its `id`. A region page lives at
14
+ one flat URL, for example `/regionen/${region.id}`. Do not nest the ancestors' ids into
15
+ it: moving a region would change the URL.
16
+ 2. Region values in the search (`regionOptions`, `regionsByRental`, `?region=`) need no code
17
+ change: they already use `id`. Their values change from the backend's ids to keys, so a
18
+ link that carries an old `?region=` value, or an old region page URL, no longer
19
+ matches. Update such links in the site's own pages.
20
+ 3. Replace every use of a region's `description` with text the site writes for the region
21
+ page. `name` is the German name in every locale: an English page shows it too.
22
+
23
+ See `regions.md`.
@@ -1,4 +1,4 @@
1
- import { Qt as V9_FACILITY_ATTRIBUTE_KEYS } from "./client-D44b3iET.mjs";
1
+ import { Qt as V9_FACILITY_ATTRIBUTE_KEYS } from "./client-D53W9Uas.mjs";
2
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
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";
@@ -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-D44b3iET.mjs";
1
+ import { a as makeV9CustomAttributeFilterCapabilities, c as parseQueryParameters, d as toVoucherCode, l as toQueryString, o as toBasicQueryInputs, s as collectQueryParameters, u as applyVofficeFilterDerivedBasicQueryInputs } from "./client-D53W9Uas.mjs";
2
2
  import { S as parseVofficeUnitData, n as mapSearchQuery, r as searchQuery } from "./operations-C1VMQYN2.mjs";
3
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";
@@ -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.37.0/CHANGELOG.md`: release notes for 2.37.0
8
+ - `versions/2.36.2/CHANGELOG.md`: release notes for 2.36.2
7
9
  - `versions/2.36.1/CHANGELOG.md`: release notes for 2.36.1
8
10
  - `versions/2.36.0/CHANGELOG.md`: release notes for 2.36.0
9
11
  - `versions/2.35.0/CHANGELOG.md`: release notes for 2.35.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.37.0/MIGRATION.md`: Migration: 2.36.2 to 2.37.0
8
+ - `versions/2.36.2/MIGRATION.md`: Migration: 2.36.1 to 2.36.2
7
9
  - `versions/2.36.1/MIGRATION.md`: Migration: 2.36.0 to 2.36.1
8
10
  - `versions/2.36.0/MIGRATION.md`: Migration: 2.35.0 to 2.36.0
9
11
  - `versions/2.35.0/MIGRATION.md`: Migration: 2.34.0 to 2.35.0
@@ -8,8 +8,8 @@ region pages and the search's region field are the same code on v10 and v9.
8
8
  | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
9
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
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 |
11
+ | Names | one, in German | one, in German; English when vOffice has no German |
12
+ | Region ids | created once by the websites service from the German name; never change | German name and vOffice id; change on a rename |
13
13
  | Order | the editors' order | siblings by German name |
14
14
  | Regions returned | every region in the tree | only regions holding a rental of the be-on key |
15
15
 
@@ -46,13 +46,10 @@ type WebsiteRegions = {
46
46
  };
47
47
 
48
48
  type WebsiteRegion = {
49
- id: string;
49
+ id: string; // "dornum": the region's URL and `?region=` value
50
50
  parentId: string | null; // null: top level
51
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 };
52
+ name: { "de-DE": string; "en-US": string }; // the one German name, in every locale
56
53
  ownRentalIds: readonly string[];
57
54
  rentalIds: readonly string[];
58
55
  };
@@ -60,11 +57,16 @@ type WebsiteRegion = {
60
57
 
61
58
  - `regions` is depth first: every region comes before its subregions. Render it top to
62
59
  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.
60
+ - `id` is readable (`dornum`, `neustadt-2`), unique in the tree and the same in every
61
+ language. It is the region's identity on the site: its page URL and its search value.
62
+ - v10: the websites service creates it once from the German name. Renaming or moving the
63
+ region, and giving the website its own tree, keep it; editors cannot change it. Only
64
+ deleting the region ends it.
65
+ - v9: vOffice's German name and its vOffice id, for example `usedom-12`. Renaming the
66
+ region in vOffice changes it; no other region's change does.
67
+ - A region has one name, the German one. `name` holds it under every locale, so
68
+ `name[locale]` works on English pages too. Regions have no description: write a region
69
+ page's text in the site.
68
70
  - `ownRentalIds` are the rentals in the region itself. `rentalIds` adds every subregion's
69
71
  rentals, each rental once. A region page lists `rentalIds`: "Nordsee" shows Dornum's
70
72
  and Dornumersiel's rentals too.
@@ -73,8 +75,9 @@ type WebsiteRegion = {
73
75
 
74
76
  ## Region Pages And Rental URLs
75
77
 
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
+ Build one page per region from its `id`, for example `/regionen/dornum`, with the name, the
79
+ site's own text for the region, and the rentals of `rentalIds`. Keep the URL flat: a URL that nests the
80
+ ancestors' ids changes whenever an editor moves the region.
78
81
 
79
82
  A rental keeps the one URL it already has. Never nest a rental's URL under a region: a
80
83
  rental in several regions would get several URLs. Region pages link to the rental's own
@@ -110,8 +113,8 @@ Pass `options` as they are as the `regions` prop of `SearchBar` from
110
113
  rentals is not offered, and `rentalIds` keeps a region whose rentals are all outside the
111
114
  site's `rentalScope` out of the field and its counts.
112
115
 
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
116
+ The value of a region is its `id` (`?region=nordsee`). A rental counts for a region and for
117
+ every region above it, so `?region=nordsee` also finds the rentals in Dornum. To word a
115
118
  `?region=` chip with the region's name instead of its id, curate a hidden `region` facet
116
119
  with the same options:
117
120
 
@@ -0,0 +1,16 @@
1
+ # Changelog: 2.36.2
2
+
3
+ A fix release: `sdk.static.regions.getRegions` works on v10 again.
4
+
5
+ ## Fixed
6
+
7
+ - v10: `sdk.static.regions.getRegions` rejected for every website since 2.35.0 with
8
+ `Cannot query field "position" on type "websites_WebsiteRegionRental"`
9
+ (`GRAPHQL_VALIDATION_FAILED`). The websites service no longer has a rental's position in a
10
+ region, and the SDK asked for it. The SDK now asks only for what it reads, so a site build
11
+ that reads regions no longer stops. The result is the same as before: `ownRentalIds`,
12
+ `rentalIds`, `depth` and every other field are unchanged.
13
+
14
+ ## Changed
15
+
16
+ - Nothing for existing code. v9 was not affected.
@@ -0,0 +1,10 @@
1
+ # Migration: 2.36.1 to 2.36.2
2
+
3
+ No changes required. A v10 site that reads `sdk.static.regions.getRegions` needs this version for
4
+ its build to pass.
5
+
6
+ ## 1. Upgrade
7
+
8
+ ```sh
9
+ pnpm add @v-office/website-sdk@2.36.2
10
+ ```
@@ -0,0 +1,3 @@
1
+ {
2
+ "componentsAffectedByHeadlessChange": []
3
+ }
@@ -0,0 +1,26 @@
1
+ # Changelog: 2.37.0
2
+
3
+ A region's `id` is now a readable key that editors cannot change, so region page URLs and
4
+ `?region=` values stay the same when regions are renamed or moved. A region is just a
5
+ name now: one German name, no description.
6
+
7
+ ## Changed
8
+
9
+ - `sdk.static.regions.getRegions`: a region's `id` and `parentId` are the region's key, for
10
+ example `dornum` or `neustadt-2`, instead of the backend's id. A key is unique in the
11
+ tree and the same in every language.
12
+ - v10: the websites service creates it once from the German name. Renaming or moving the
13
+ region, and giving the website its own tree, keep it; editors cannot change it. Only
14
+ deleting the region ends it. This needs the websites service with region keys; on an
15
+ environment without it, the read rejects.
16
+ - v9: vOffice's German name and its vOffice id, for example `usedom-12`. Renaming the
17
+ region in vOffice changes it; no other region's change does.
18
+ - `WebsiteRegion.name` holds the region's one name, the German one, under every locale
19
+ (`name["en-US"]` is the German name too). On v9 an English name only stands in when vOffice
20
+ has no German one.
21
+
22
+ ## Removed
23
+
24
+ - `WebsiteRegion.slug` and `WebsiteRegion.path`. Use `id`: one flat URL per region
25
+ (`/regionen/dornum`) and `?region=dornum`.
26
+ - `WebsiteRegion.description`. Write a region page's text in the site.
@@ -0,0 +1,23 @@
1
+ # Migration: 2.36.2 to 2.37.0
2
+
3
+ Only sites that read `sdk.static.regions.getRegions` need to change anything.
4
+
5
+ ## 1. Upgrade
6
+
7
+ ```sh
8
+ pnpm add @v-office/website-sdk@2.37.0
9
+ ```
10
+
11
+ ## 2. Build region URLs from `id`
12
+
13
+ 1. Replace every use of a region's `path` or `slug` with its `id`. A region page lives at
14
+ one flat URL, for example `/regionen/${region.id}`. Do not nest the ancestors' ids into
15
+ it: moving a region would change the URL.
16
+ 2. Region values in the search (`regionOptions`, `regionsByRental`, `?region=`) need no code
17
+ change: they already use `id`. Their values change from the backend's ids to keys, so a
18
+ link that carries an old `?region=` value, or an old region page URL, no longer
19
+ matches. Update such links in the site's own pages.
20
+ 3. Replace every use of a region's `description` with text the site writes for the region
21
+ page. `name` is the German name in every locale: an English page shows it too.
22
+
23
+ See `regions.md`.
@@ -0,0 +1,3 @@
1
+ {
2
+ "componentsAffectedByHeadlessChange": []
3
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v-office/website-sdk",
3
- "version": "2.36.1",
3
+ "version": "2.37.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.27.0",
51
+ "@v-office/sdk-core": "1.28.0",
52
52
  "effect": "4.0.0-rc.115",
53
53
  "graphql": "17.0.2",
54
54
  "yaml": "^2.9.0"