@v-office/website-sdk 2.33.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.
Files changed (42) hide show
  1. package/README.md +20 -9
  2. package/dist/cli.mjs +3 -3
  3. package/dist/{client-BSyJzzk0.mjs → client-BC5ukCcN.mjs} +143 -17
  4. package/dist/index.d.mts +18 -2
  5. package/dist/index.mjs +1 -1
  6. package/dist/instructions/CHANGELOG.md +2 -0
  7. package/dist/instructions/MIGRATION.md +2 -0
  8. package/dist/instructions/README.md +1 -0
  9. package/dist/instructions/availability.md +1 -1
  10. package/dist/instructions/booking.md +1 -1
  11. package/dist/instructions/contact.md +1 -1
  12. package/dist/instructions/creation.md +14 -3
  13. package/dist/instructions/custom-attributes.md +11 -8
  14. package/dist/instructions/quote.md +1 -1
  15. package/dist/instructions/regions.md +123 -0
  16. package/dist/instructions/search.md +5 -2
  17. package/dist/instructions/versions/2.34.0/CHANGELOG.md +18 -0
  18. package/dist/instructions/versions/2.34.0/MIGRATION.md +9 -0
  19. package/dist/instructions/versions/2.35.0/CHANGELOG.md +28 -0
  20. package/dist/instructions/versions/2.35.0/MIGRATION.md +39 -0
  21. package/dist/{operations-CUWcmNGK.mjs → operations-C1VMQYN2.mjs} +62 -1
  22. package/dist/{rentals-Be1Zs2DQ.mjs → rentals-tKaYW-Zz.mjs} +3 -3
  23. package/dist/{search-Dv5e8hNc.mjs → search-DibGd1I6.mjs} +3 -3
  24. package/dist/{to-rental-highlights-Dbnm6Y4_.mjs → to-rental-highlights-BdxQPpBU.mjs} +1 -1
  25. package/instructions/CHANGELOG.md +2 -0
  26. package/instructions/MIGRATION.md +2 -0
  27. package/instructions/README.md +1 -0
  28. package/instructions/availability.md +1 -1
  29. package/instructions/booking.md +1 -1
  30. package/instructions/contact.md +1 -1
  31. package/instructions/creation.md +14 -3
  32. package/instructions/custom-attributes.md +11 -8
  33. package/instructions/quote.md +1 -1
  34. package/instructions/regions.md +123 -0
  35. package/instructions/search.md +5 -2
  36. package/instructions/versions/2.34.0/CHANGELOG.md +18 -0
  37. package/instructions/versions/2.34.0/MIGRATION.md +9 -0
  38. package/instructions/versions/2.34.0/release.json +3 -0
  39. package/instructions/versions/2.35.0/CHANGELOG.md +28 -0
  40. package/instructions/versions/2.35.0/MIGRATION.md +39 -0
  41. package/instructions/versions/2.35.0/release.json +3 -0
  42. package/package.json +7 -2
@@ -1,6 +1,6 @@
1
1
  # Custom Attributes
2
2
 
3
- Custom attributes are workspace-specific rental metadata: a sauna flag, a region, an
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
- region: {
34
- label: { "de-DE": "Region", "en-US": "Region" },
36
+ beach: {
37
+ label: { "de-DE": "Strand", "en-US": "Beach" },
35
38
  filter: true,
36
39
  optionLabels: {
37
- north: { "de-DE": "Norden", "en-US": "North" },
38
- south: { "de-DE": "Süden", "en-US": "South" },
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
- - region.optionLabels: a filterable option attribute needs a label for every option; missing south, east, west
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 `?region=north,south`, the first valid value
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.region, // checked for a literal typed registry
292
+ customAttributes.keys.beach, // checked for a literal typed registry
290
293
  "bathrooms",
291
294
  ],
292
295
  });
@@ -449,7 +449,7 @@ longer used; see `versions/2.13.0/MIGRATION.md`.
449
449
 
450
450
  ## Configuration
451
451
 
452
- Quote requests are rate-limited to one backend request per second with a queue size of five. `v9` supports insurance option refresh and insurance actions; `v10` currently returns a no-insurance placeholder and insurance actions resolve as not required.
452
+ By default, quote requests start at most once a second, with at most five running or waiting at once; `rateBudget` changes both (see `creation.md`). `v9` supports insurance option refresh and insurance actions; `v10` currently returns a no-insurance placeholder and insurance actions resolve as not required.
453
453
 
454
454
  `shouldAddProposedAdditionalServiceAmount` defaults to `false`. When `true`, proposed optional service quantities greater than zero are automatically selected on quote creation. `proposedQuantity` is returned whenever the backend provides a line amount (including `0`), regardless of this setting.
455
455
 
@@ -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.
@@ -501,7 +504,7 @@ for await (const page of sdk.live.search.searchPages({ locale: "de-DE", query })
501
504
  `if (sdk.backend === "v9")`.
502
505
  - The input is the `search` input without `cursor` and `limit`; the SDK pages itself.
503
506
  - Every page is one `search` call and counts as one request for the rate limit, so
504
- the SDK starts at most one page per second.
507
+ the SDK starts at most one page per second by default (`rateBudget`, see `creation.md`).
505
508
  - A rental appears on one page only, even when a booking moves it between two pages.
506
509
  - Each page carries its own `pageInfo`; `pageInfo.totalCount` is the total over all
507
510
  pages.
@@ -922,7 +925,7 @@ Use flat `WebsiteSDKConfig` files and optional `WebsiteSDKOptions`.
922
925
 
923
926
  For v10, config requires `searchEndpoint` (the full REST search URL) as of 2.5.0. See `creation.md` for `searchEndpoint` and the `customAttributes` option.
924
927
 
925
- Custom filter definitions can extend accepted search query keys. Search requests are rate-limited to one backend request per second with a queue size of five. A `searchAllRentalsAtOnce` search and a `mapSearch` each count as one request, including every backend request they make.
928
+ Custom filter definitions can extend accepted search query keys. By default, search requests start at most once a second, with at most five running or waiting at once; `rateBudget` changes both (see `creation.md`). A `searchAllRentalsAtOnce` search and a `mapSearch` each count as one request, including every backend request they make.
926
929
 
927
930
  ## CLI Usage
928
931
 
@@ -0,0 +1,18 @@
1
+ # Changelog: 2.34.0
2
+
3
+ A server that serves many visitors through one SDK can widen the SDK's PMS request budget.
4
+ Websites keep the default and change nothing.
5
+
6
+ ## Added
7
+
8
+ - The `rateBudget` option (`{ interval, maxQueueSize }`): how often the SDK may start a PMS
9
+ request of one kind, and how many of that kind may be running or waiting at once. It applies on v9 and v10 alike, to search, quote,
10
+ booking and contact, and on v10 also to availability and feedback. The default is unchanged:
11
+ one start a second, five at once. AI Studio's website chat, which shares one SDK per website
12
+ among all its visitors, widens it.
13
+ - An invalid `rateBudget` (a queue below 1, an interval that is not a positive duration) fails SDK
14
+ creation with an error that names it.
15
+
16
+ ## Changed
17
+
18
+ - Nothing for existing code. Without `rateBudget`, every limit is what it was.
@@ -0,0 +1,9 @@
1
+ # Migration: 2.33.0 to 2.34.0
2
+
3
+ No changes required. A website keeps the default budget and does not set `rateBudget`.
4
+
5
+ ## 1. Upgrade
6
+
7
+ ```sh
8
+ pnpm add @v-office/website-sdk@2.34.0
9
+ ```
@@ -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 { parseVofficeFacilityData as _, hubRentalDataQuery as a, parseVofficeUnitData as b, rentalsAllByFacilityObjectGroupsWithoutFeedbacksQuery as c, VofficeUnitDataFieldSchemas as d, VofficeUnitDataPropertyCategoryLabelKeys as f, parseJsonData as g, customDataAttribute as h, hubFiltersQuery as i, rentalsAllFeedbacksQuery as l, VofficeUnitDataPropertyMetadata as m, mapSearchQuery as n, rentalFacilitiesForObjectGroupRelationQuery as o, VofficeUnitDataPropertyCategoryValues as p, searchQuery as r, rentalIdsQuery as s, voucherValidityQuery as t, rentalsAllWithoutFeedbacksQuery as u, parseVofficeFeedbackData as v, parseVofficeRatingData as y };
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-BSyJzzk0.mjs";
2
- import { _ as parseVofficeFacilityData, b as parseVofficeUnitData, c as rentalsAllByFacilityObjectGroupsWithoutFeedbacksQuery, d as VofficeUnitDataFieldSchemas, f as VofficeUnitDataPropertyCategoryLabelKeys, i as hubFiltersQuery, l as rentalsAllFeedbacksQuery, m as VofficeUnitDataPropertyMetadata, o as rentalFacilitiesForObjectGroupRelationQuery, p as VofficeUnitDataPropertyCategoryValues, s as rentalIdsQuery, u as rentalsAllWithoutFeedbacksQuery, v as parseVofficeFeedbackData } from "./operations-CUWcmNGK.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-Dbnm6Y4_.mjs";
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-BSyJzzk0.mjs";
2
- import { b as parseVofficeUnitData, n as mapSearchQuery, r as searchQuery } from "./operations-CUWcmNGK.mjs";
3
- import { i as toLocation, n as toV9RentalHighlightKey, o as toImages, s as toAddress, t as toRentalHighlights } from "./to-rental-highlights-Dbnm6Y4_.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-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 { m as VofficeUnitDataPropertyMetadata } from "./operations-CUWcmNGK.mjs";
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,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.35.0/CHANGELOG.md`: release notes for 2.35.0
8
+ - `versions/2.34.0/CHANGELOG.md`: release notes for 2.34.0
7
9
  - `versions/2.33.0/CHANGELOG.md`: release notes for 2.33.0
8
10
  - `versions/2.32.0/CHANGELOG.md`: release notes for 2.32.0
9
11
  - `versions/2.31.1/CHANGELOG.md`: release notes for 2.31.1
@@ -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.35.0/MIGRATION.md`: Migration: 2.34.0 to 2.35.0
8
+ - `versions/2.34.0/MIGRATION.md`: Migration: 2.33.0 to 2.34.0
7
9
  - `versions/2.33.0/MIGRATION.md`: Migration: 2.32.0 to 2.33.0
8
10
  - `versions/2.32.0/MIGRATION.md`: Migration: 2.31.1 to 2.32.0
9
11
  - `versions/2.31.1/MIGRATION.md`: Migration: 2.31.0 to 2.31.1
@@ -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.
@@ -195,7 +195,7 @@ Use flat `WebsiteSDKConfig` files.
195
195
  }
196
196
  ```
197
197
 
198
- Availability uses localized tooltips from the translation service. `v10` availability queries are rate-limited to one backend request per second, queued up to five requests, and cached per rental for 30 seconds.
198
+ Availability uses localized tooltips from the translation service. By default, `v10` availability queries start at most once a second, with at most five running or waiting at once; `rateBudget` changes both (see `creation.md`). They are cached per rental for 30 seconds.
199
199
 
200
200
  ## CLI Usage
201
201
 
@@ -221,7 +221,7 @@ A successful return means the provider sent the browser back, not that the payme
221
221
 
222
222
  ## Configuration
223
223
 
224
- Booking requests are rate-limited to one backend request per second with a queue size of five. `v9` books through the v0 `book` action and initializes Stripe only for currently payable choices when the property has Stripe enabled. `v10` books through GraphQL, preserves all remaining payment steps for display, and initializes Adyen for the next payable online step and the full-outstanding alternative.
224
+ By default, booking requests start at most once a second, with at most five running or waiting at once; `rateBudget` changes both (see `creation.md`). `v9` books through the v0 `book` action and initializes Stripe only for currently payable choices when the property has Stripe enabled. `v10` books through GraphQL, preserves all remaining payment steps for display, and initializes Adyen for the next payable online step and the full-outstanding alternative.
225
225
 
226
226
  ## CLI Usage
227
227
 
@@ -86,7 +86,7 @@ Contact input is validated before submitting to either backend. Validation failu
86
86
 
87
87
  ## Configuration
88
88
 
89
- Contact requests are rate-limited to one request per second with a queue size of five.
89
+ By default, contact requests start at most once a second, with at most five running or waiting at once; `rateBudget` changes both (see `creation.md`).
90
90
 
91
91
  ## CLI Usage
92
92
 
@@ -123,6 +123,7 @@ type WebsiteSDKOptions = {
123
123
  rentalScope?: RentalScope;
124
124
  shouldAddProposedAdditionalServiceAmount?: boolean;
125
125
  searchAllRentalsAtOnce?: boolean;
126
+ rateBudget?: { interval?: Duration.Input; maxQueueSize?: number };
126
127
  };
127
128
  ```
128
129
 
@@ -130,6 +131,15 @@ type WebsiteSDKOptions = {
130
131
  guest's city, and which incomplete v9 feedbacks become review items. v10 does not use it, but an invalid value fails SDK creation on
131
132
  both backends. See "Legacy v9 Reviews" in `rentals.md`.
132
133
 
134
+ `rateBudget` sets how often the SDK may start a PMS request of one kind (search, quote,
135
+ booking, contact, and on v10 availability and feedback) and how many of that kind may be
136
+ running or waiting at once (`maxQueueSize`, the running one included), on v9 and v10 alike. The
137
+ next request past that fails right away. The default, one start a second and five at once, is
138
+ what one visitor's browser needs: **a website keeps it and sets nothing.** Only a server that
139
+ serves many visitors through one SDK widens it, for example
140
+ `{ interval: "250 millis", maxQueueSize: 25 }`. `maxQueueSize` must be at least 1 and `interval`
141
+ a positive duration, or SDK creation fails.
142
+
133
143
  `searchAllRentalsAtOnce` selects how a site searches, on v9 and v10 alike: every
134
144
  result with prices in one call (portfolios of up to 100 rentals), or paged results
135
145
  plus `mapSearch`. See `search.md`.
@@ -157,6 +167,7 @@ Unset options are normalized by the SDK:
157
167
  - `rentalScope` defaults to `{}`.
158
168
  - `shouldAddProposedAdditionalServiceAmount` defaults to `false`.
159
169
  - `searchAllRentalsAtOnce` defaults to `false`.
170
+ - `rateBudget` defaults to `{ interval: "1 second", maxQueueSize: 5 }`.
160
171
  - `translationOverrides` is omitted unless provided.
161
172
 
162
173
  ### v9 Property Highlight Sources
@@ -233,11 +244,11 @@ Custom attributes are configured through `customAttributes`, built by
233
244
  const customAttributes = defineCustomAttributes({
234
245
  catalog,
235
246
  select: {
236
- region: {
237
- label: { "de-DE": "Region", "en-US": "Region" },
247
+ beach: {
248
+ label: { "de-DE": "Strand", "en-US": "Beach" },
238
249
  filter: true,
239
250
  optionLabels: {
240
- north: { "de-DE": "Nord", "en-US": "North" },
251
+ sand: { "de-DE": "Sandstrand", "en-US": "Sandy beach" },
241
252
  },
242
253
  },
243
254
  },
@@ -1,6 +1,6 @@
1
1
  # Custom Attributes
2
2
 
3
- Custom attributes are workspace-specific rental metadata: a sauna flag, a region, an
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
- region: {
34
- label: { "de-DE": "Region", "en-US": "Region" },
36
+ beach: {
37
+ label: { "de-DE": "Strand", "en-US": "Beach" },
35
38
  filter: true,
36
39
  optionLabels: {
37
- north: { "de-DE": "Norden", "en-US": "North" },
38
- south: { "de-DE": "Süden", "en-US": "South" },
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
- - region.optionLabels: a filterable option attribute needs a label for every option; missing south, east, west
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 `?region=north,south`, the first valid value
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.region, // checked for a literal typed registry
292
+ customAttributes.keys.beach, // checked for a literal typed registry
290
293
  "bathrooms",
291
294
  ],
292
295
  });
@@ -449,7 +449,7 @@ longer used; see `versions/2.13.0/MIGRATION.md`.
449
449
 
450
450
  ## Configuration
451
451
 
452
- Quote requests are rate-limited to one backend request per second with a queue size of five. `v9` supports insurance option refresh and insurance actions; `v10` currently returns a no-insurance placeholder and insurance actions resolve as not required.
452
+ By default, quote requests start at most once a second, with at most five running or waiting at once; `rateBudget` changes both (see `creation.md`). `v9` supports insurance option refresh and insurance actions; `v10` currently returns a no-insurance placeholder and insurance actions resolve as not required.
453
453
 
454
454
  `shouldAddProposedAdditionalServiceAmount` defaults to `false`. When `true`, proposed optional service quantities greater than zero are automatically selected on quote creation. `proposedQuantity` is returned whenever the backend provides a line amount (including `0`), regardless of this setting.
455
455