@v-office/website-sdk 1.2.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +91 -232
  2. package/dist/cli.mjs +102 -83
  3. package/dist/client-BSUd3vuc.mjs +5111 -0
  4. package/dist/index.d.mts +2463 -11751
  5. package/dist/index.mjs +16 -4
  6. package/dist/instructions/CHANGELOG.md +9 -0
  7. package/dist/instructions/MIGRATION.md +9 -0
  8. package/dist/instructions/README.md +62 -0
  9. package/dist/instructions/availability.md +157 -0
  10. package/dist/instructions/booking.md +165 -0
  11. package/dist/instructions/contact.md +92 -0
  12. package/dist/instructions/creation.md +223 -0
  13. package/dist/instructions/filter.md +156 -0
  14. package/dist/instructions/quote.md +318 -0
  15. package/dist/instructions/rentals.md +152 -0
  16. package/dist/instructions/search.md +233 -0
  17. package/dist/instructions/versions/2.0.0/CHANGELOG.md +69 -0
  18. package/dist/instructions/versions/2.0.0/MIGRATION.md +223 -0
  19. package/dist/{quote-DQGps4dy.mjs → quote-1uEIO44v.mjs} +15 -16
  20. package/dist/{rentals-plxPVx83.mjs → rentals-Quwc78o2.mjs} +22 -16
  21. package/dist/{search-BuR5apFw.mjs → search-GRQeXDvo.mjs} +40 -23
  22. package/dist/to-rental-highlights-FNZBR4aD.mjs +5905 -0
  23. package/instructions/CHANGELOG.md +9 -0
  24. package/instructions/MIGRATION.md +9 -0
  25. package/instructions/README.md +62 -0
  26. package/instructions/availability.md +157 -0
  27. package/instructions/booking.md +165 -0
  28. package/instructions/contact.md +92 -0
  29. package/instructions/creation.md +223 -0
  30. package/instructions/filter.md +156 -0
  31. package/instructions/quote.md +318 -0
  32. package/instructions/rentals.md +152 -0
  33. package/instructions/search.md +233 -0
  34. package/instructions/versions/2.0.0/CHANGELOG.md +69 -0
  35. package/instructions/versions/2.0.0/MIGRATION.md +223 -0
  36. package/package.json +41 -56
  37. package/dist/client-DeEUMMOh.mjs +0 -33237
  38. package/dist/custom-attribute-D5Kb1YHA.mjs +0 -54
  39. package/dist/errors-2cuUGSvi.mjs +0 -5
  40. package/dist/operations-B4IgNB3E.mjs +0 -12618
  41. package/dist/operations-DcU1qt7g.mjs +0 -1158
  42. package/dist/quote-BVx3TAHE.mjs +0 -513
  43. package/dist/quote-CRjV_lf-.mjs +0 -609
  44. package/dist/rentals-H3RYtMqT.mjs +0 -323
  45. package/dist/search-filter-metadata-DZP0-Udc.mjs +0 -4294
  46. package/dist/to-rental-highlights-CAATPqan.mjs +0 -524
@@ -1,7 +1,6 @@
1
- import "./client-DeEUMMOh.mjs";
2
- import { d as formatCurrency, g as toNightCount, n as addGuestQuoteAdditionalServiceSelection, t as GuestQuote } from "./quote-CRjV_lf-.mjs";
1
+ import { GuestQuote, addGuestQuoteAdditionalServiceSelection, formatCurrency, toNightCount } from "@v-office/sdk-core";
3
2
  import { DateTime, Effect } from "effect";
4
- //#region src/adapters/v9/parser/quote/to-additional-service-calculation.ts
3
+ //#region src/legacy-v9/parser/quote/to-additional-service-calculation.ts
5
4
  const toAdditionalServiceCalculation = (line) => {
6
5
  switch (line.calculation) {
7
6
  case "NIGHT": return "PER_NIGHT";
@@ -12,7 +11,7 @@ const toAdditionalServiceCalculation = (line) => {
12
11
  }
13
12
  };
14
13
  //#endregion
15
- //#region src/adapters/v9/parser/quote/to-charge.ts
14
+ //#region src/legacy-v9/parser/quote/to-charge.ts
16
15
  const toCharge = ({ serviceLine, chargeAmount, currency, locale, translations }) => Effect.gen(function* () {
17
16
  switch (serviceLine.calculation) {
18
17
  case "NIGHT": return `${formatCurrency(chargeAmount, locale, currency)}${yield* translations.translate(locale, "quote.additionalService.night")}`;
@@ -21,26 +20,26 @@ const toCharge = ({ serviceLine, chargeAmount, currency, locale, translations })
21
20
  }
22
21
  });
23
22
  //#endregion
24
- //#region src/adapters/v9/parser/quote/to-charge-amount.ts
23
+ //#region src/legacy-v9/parser/quote/to-charge-amount.ts
25
24
  const toChargeAmount = ({ input, serviceLine }) => {
26
25
  const amount = serviceLine.amount ?? 1;
27
26
  if (amount <= 0 || serviceLine.total == null) return void 0;
28
27
  switch (serviceLine.calculation) {
29
- case "NIGHT": return serviceLine.total / toNightCount(input) / amount;
30
- case "DAY": return serviceLine.total / toNightCount(input) / amount;
28
+ case "NIGHT": return serviceLine.total / toNightCount(input.period) / amount;
29
+ case "DAY": return serviceLine.total / toNightCount(input.period) / amount;
31
30
  case "USAGE": return serviceLine.total / amount;
32
31
  default: return serviceLine.total / amount;
33
32
  }
34
33
  };
35
34
  //#endregion
36
- //#region src/adapters/v9/parser/quote/to-service-line-label.ts
35
+ //#region src/legacy-v9/parser/quote/to-service-line-label.ts
37
36
  const toServiceLineLabel = ({ serviceLine, locale, translations }) => Effect.gen(function* () {
38
37
  if (serviceLine.service?.name != null && serviceLine.service.name.trim().length > 0) return serviceLine.service.name;
39
38
  if (serviceLine.service?.type != null && serviceLine.service.type.trim().length > 0) return yield* translations.translate(locale, `Service.type.${serviceLine.service.type}`);
40
39
  return yield* translations.translate(locale, "Service.type.OTHER");
41
40
  });
42
41
  //#endregion
43
- //#region src/adapters/v9/parser/quote/utils.ts
42
+ //#region src/legacy-v9/parser/quote/utils.ts
44
43
  const hasEnoughLeadTime = ({ bookingStart, leadTimeDays, today }) => {
45
44
  if (leadTimeDays == null) return true;
46
45
  const start = DateTime.removeTime(DateTime.makeUnsafe(bookingStart));
@@ -51,7 +50,7 @@ const getLineServiceId = (line) => line.service?.id == null ? void 0 : String(li
51
50
  const isTaxLine = (line) => line.service?.type === "VTAX" || line.service?.type === "TAXES";
52
51
  const getTotal = (line) => line.total ?? 0;
53
52
  //#endregion
54
- //#region src/adapters/v9/parser/quote/to-additional-services.ts
53
+ //#region src/legacy-v9/parser/quote/to-additional-services.ts
55
54
  const toDescription = (line) => {
56
55
  if (Array.isArray(line.beon_data)) return void 0;
57
56
  return line.beon_data?.description;
@@ -120,7 +119,7 @@ const toAdditionalServices = ({ input, guestQuoteResult, locale, translations })
120
119
  return additionalServices;
121
120
  });
122
121
  //#endregion
123
- //#region src/adapters/v9/parser/quote/to-backend-context.ts
122
+ //#region src/legacy-v9/parser/quote/to-backend-context.ts
124
123
  const toSelectionQuantity = (selections, serviceId) => selections.find((selection) => selection.id === serviceId)?.quantity ?? 0;
125
124
  const toSelectedTotal = (line, amount) => {
126
125
  if (line.price == null) return void 0;
@@ -164,7 +163,7 @@ const updateV9QuoteBackendContext = (context, selections) => {
164
163
  };
165
164
  };
166
165
  //#endregion
167
- //#region src/adapters/v9/parser/quote/to-sections-included.ts
166
+ //#region src/legacy-v9/parser/quote/to-sections-included.ts
168
167
  const isIncludedSubItem = (line) => line.service?.type === "RENT" || line.service?.summary === "SHOW";
169
168
  const toSectionsIncluded = ({ input: _input, guestQuoteResult, locale, translations }) => Effect.gen(function* () {
170
169
  const subItems = [];
@@ -193,7 +192,7 @@ const toSectionsIncluded = ({ input: _input, guestQuoteResult, locale, translati
193
192
  };
194
193
  });
195
194
  //#endregion
196
- //#region src/adapters/v9/parser/quote/to-sections-other.ts
195
+ //#region src/legacy-v9/parser/quote/to-sections-other.ts
197
196
  const isOther = (line) => line.service?.type !== "RENT" && !isTaxLine(line) && line.service?.summary !== "ADD_NO_SHOW";
198
197
  const toSectionsOther = ({ input: _input, guestQuoteResult, locale, translations }) => Effect.gen(function* () {
199
198
  const lines = [];
@@ -212,7 +211,7 @@ const toSectionsOther = ({ input: _input, guestQuoteResult, locale, translations
212
211
  return lines;
213
212
  });
214
213
  //#endregion
215
- //#region src/adapters/v9/parser/quote/to-sections-tax.ts
214
+ //#region src/legacy-v9/parser/quote/to-sections-tax.ts
216
215
  const toSectionsTax = ({ input: _input, guestQuoteResult, locale, translations }) => Effect.gen(function* () {
217
216
  let total = 0;
218
217
  for (const line of guestQuoteResult?.mandatory ?? []) if (isTaxLine(line)) total += getTotal(line);
@@ -222,7 +221,7 @@ const toSectionsTax = ({ input: _input, guestQuoteResult, locale, translations }
222
221
  } };
223
222
  });
224
223
  //#endregion
225
- //#region src/adapters/v9/parser/quote/to-sections.ts
224
+ //#region src/legacy-v9/parser/quote/to-sections.ts
226
225
  const hasSectionLineContent = (line) => line.item.appliedCharge !== 0 || (line.subItems?.length ?? 0) > 0;
227
226
  const toSections = ({ input, guestQuoteResult, locale, translations }) => Effect.gen(function* () {
228
227
  const sections = [];
@@ -250,7 +249,7 @@ const toSections = ({ input, guestQuoteResult, locale, translations }) => Effect
250
249
  return sections;
251
250
  });
252
251
  //#endregion
253
- //#region src/adapters/v9/parser/quote/to-guest-quote.ts
252
+ //#region src/legacy-v9/parser/quote/to-guest-quote.ts
254
253
  const toBaseTotal = (guestQuoteResult) => {
255
254
  const paymentScheduleTotal = guestQuoteResult?.paymentSchedule?.total?.amount;
256
255
  if (paymentScheduleTotal != null) return paymentScheduleTotal;
@@ -1,10 +1,7 @@
1
- import { F as parseVofficeFacilityData, I as parseVofficeFeedbackData, L as parseVofficeUnitData, M as VofficeUnitDataPropertyCategoryLabelKeys, N as VofficeUnitDataPropertyCategoryValues, P as VofficeUnitDataPropertyMetadata } from "./client-DeEUMMOh.mjs";
2
- import "./errors-2cuUGSvi.mjs";
3
- import { b as localeToLanguage, y as makeTranslate } from "./quote-CRjV_lf-.mjs";
4
- import { i as renderLabeledAttributeValue, t as renderCustomAttributeHighlight } from "./custom-attribute-D5Kb1YHA.mjs";
5
- import { i as toLocalizedString, n as toImages, r as toAddress, t as toRentalHighlights } from "./to-rental-highlights-CAATPqan.mjs";
1
+ import { c as VofficeUnitDataFieldSchemas, d as VofficeUnitDataPropertyMetadata, f as parseVofficeFacilityData, i as toLocalizedString, l as VofficeUnitDataPropertyCategoryLabelKeys, m as parseVofficeUnitData, n as toImages, o as rentalsAllFeedbacksQuery, p as parseVofficeFeedbackData, r as toAddress, s as rentalsAllWithoutFeedbacksQuery, t as toRentalHighlights, u as VofficeUnitDataPropertyCategoryValues } from "./to-rental-highlights-FNZBR4aD.mjs";
2
+ import { makeTranslate, renderCustomAttributeHighlight, renderLabeledAttributeValue } from "@v-office/sdk-core";
6
3
  import { Effect } from "effect";
7
- //#region src/adapters/v9/parser/rentals/to-description.ts
4
+ //#region src/legacy-v9/parser/rentals/to-description.ts
8
5
  const toDescription = (data, locale) => {
9
6
  const description = {};
10
7
  const intro = toLocalizedString(data.known.intro, locale);
@@ -26,7 +23,7 @@ const toDescription = (data, locale) => {
26
23
  return description;
27
24
  };
28
25
  //#endregion
29
- //#region src/adapters/v9/parser/rentals/to-location.ts
26
+ //#region src/legacy-v9/parser/rentals/to-location.ts
30
27
  const toLocation = (location) => {
31
28
  if (location == null) return void 0;
32
29
  const [longitude, latitude] = location.coordinates;
@@ -36,7 +33,7 @@ const toLocation = (location) => {
36
33
  };
37
34
  };
38
35
  //#endregion
39
- //#region src/adapters/v9/parser/rentals/to-property.ts
36
+ //#region src/legacy-v9/parser/rentals/to-property.ts
40
37
  const toProperty = (facility, locale) => {
41
38
  const data = parseVofficeFacilityData(facility.data);
42
39
  const name = toLocalizedString(data.known.name, locale);
@@ -49,7 +46,7 @@ const toProperty = (facility, locale) => {
49
46
  return property;
50
47
  };
51
48
  //#endregion
52
- //#region src/adapters/v9/parser/rentals/to-rental-attributes.ts
49
+ //#region src/legacy-v9/parser/rentals/to-rental-attributes.ts
53
50
  const GENERAL_CATEGORY$1 = {
54
51
  key: "GENERAL",
55
52
  labelKey: VofficeUnitDataPropertyCategoryLabelKeys.GENERAL
@@ -62,6 +59,7 @@ const PROPERTY_METADATA_ENTRIES = Object.entries(VofficeUnitDataPropertyMetadata
62
59
  })).filter(({ metadata }) => metadata.category.key !== "LOCATION").sort((left, right) => {
63
60
  return (CATEGORY_ORDER.get(left.metadata.category.key) ?? Number.MAX_SAFE_INTEGER) - (CATEGORY_ORDER.get(right.metadata.category.key) ?? Number.MAX_SAFE_INTEGER) || left.index - right.index;
64
61
  });
62
+ const canRenderLabeledAttributeValue$1 = (value) => value !== false && value !== 0 && value !== "false" && value !== "0" && value != null && value !== "";
65
63
  const toRentalAttributes = ({ locale, translations, attributes, customAttributeFilterDefinitions }) => Effect.gen(function* () {
66
64
  const result = [];
67
65
  const categoriesByKey = /* @__PURE__ */ new Map();
@@ -90,11 +88,13 @@ const toRentalAttributes = ({ locale, translations, attributes, customAttributeF
90
88
  return subCategory;
91
89
  });
92
90
  for (const { key, metadata } of PROPERTY_METADATA_ENTRIES) {
91
+ const value = knownAttributes[key];
92
+ if (!canRenderLabeledAttributeValue$1(value)) continue;
93
93
  const attribute = renderLabeledAttributeValue({
94
94
  key,
95
95
  label: yield* translate(metadata.labelKey, key),
96
96
  locale,
97
- value: knownAttributes[key]
97
+ value
98
98
  });
99
99
  if (attribute == null) continue;
100
100
  const categoryMetadata = metadata.category ?? GENERAL_CATEGORY$1;
@@ -133,10 +133,10 @@ const toRentalAttributes = ({ locale, translations, attributes, customAttributeF
133
133
  return result;
134
134
  });
135
135
  //#endregion
136
- //#region src/adapters/v9/parser/rentals/to-rental-type.ts
136
+ //#region src/legacy-v9/parser/rentals/to-rental-type.ts
137
137
  const toRentalType = ({ translations, locale, rentalType }) => makeTranslate(translations, locale)(`Rental.rentalType.option.${rentalType}`, rentalType);
138
138
  //#endregion
139
- //#region src/adapters/v9/parser/rentals/to-rental-vicinity.ts
139
+ //#region src/legacy-v9/parser/rentals/to-rental-vicinity.ts
140
140
  const GENERAL_CATEGORY = {
141
141
  key: "GENERAL",
142
142
  labelKey: VofficeUnitDataPropertyCategoryLabelKeys.GENERAL
@@ -146,16 +146,19 @@ const LOCATION_METADATA_ENTRIES = Object.entries(VofficeUnitDataPropertyMetadata
146
146
  metadata,
147
147
  index
148
148
  })).filter(({ metadata }) => metadata.category.key === "LOCATION").sort((left, right) => left.index - right.index);
149
+ const canRenderLabeledAttributeValue = (value) => value !== false && value !== 0 && value !== "false" && value !== "0" && value != null && value !== "";
149
150
  const toRentalVicinity = ({ locale, translations, attributes }) => Effect.gen(function* () {
150
151
  const items = [];
151
152
  const knownAttributes = attributes.known;
152
153
  const translate = makeTranslate(translations, locale);
153
154
  for (const { key, metadata } of LOCATION_METADATA_ENTRIES) {
155
+ const value = knownAttributes[key];
156
+ if (!canRenderLabeledAttributeValue(value)) continue;
154
157
  const item = renderLabeledAttributeValue({
155
158
  key,
156
159
  label: yield* translate(metadata.labelKey, key),
157
160
  locale,
158
- value: knownAttributes[key]
161
+ value
159
162
  });
160
163
  if (item != null) items.push(item);
161
164
  }
@@ -166,7 +169,7 @@ const toRentalVicinity = ({ locale, translations, attributes }) => Effect.gen(fu
166
169
  }];
167
170
  });
168
171
  //#endregion
169
- //#region src/adapters/v9/parser/rentals/to-reviews.ts
172
+ //#region src/legacy-v9/parser/rentals/to-reviews.ts
170
173
  const toClassification = (rating) => {
171
174
  if (rating >= 4.5) return "excellent";
172
175
  if (rating >= 4) return "very-good";
@@ -224,7 +227,7 @@ const toReviews = ({ locale, translations, rental }) => Effect.gen(function* ()
224
227
  };
225
228
  });
226
229
  //#endregion
227
- //#region src/adapters/v9/parser/rentals/to-rental-list-item.ts
230
+ //#region src/legacy-v9/parser/rentals/to-rental-list-item.ts
228
231
  const toRentalRentalsOutput = ({ rental, locale, translations, imageProxyBaseUrl, rentalHighlightPrioritization, customAttributeFilterDefinitions }) => Effect.gen(function* () {
229
232
  const data = parseVofficeUnitData(rental.data);
230
233
  const rawRentalType = data.known.type?.trim();
@@ -278,4 +281,7 @@ const toRentalRentalsOutput = ({ rental, locale, translations, imageProxyBaseUrl
278
281
  return item;
279
282
  });
280
283
  //#endregion
281
- export { localeToLanguage, toRentalRentalsOutput };
284
+ //#region src/legacy-v9/runtime/rentals.ts
285
+ const defaultRentalDataAttributes = Object.keys(VofficeUnitDataFieldSchemas);
286
+ //#endregion
287
+ export { defaultRentalDataAttributes, rentalsAllFeedbacksQuery, rentalsAllWithoutFeedbacksQuery, toRentalRentalsOutput };
@@ -1,9 +1,8 @@
1
- import { $t as toStableSearchInputParameterValues, A as toUnusedFilterKeys, C as parseChildrenAges, D as parseQueryParameters, E as collectQueryParameters, L as parseVofficeUnitData, O as expandCustomAttributeFilterCompositions, Qt as toStableSearchInputBackendQueryKeys, T as toQueryString, Xt as STABLE_SEARCH_INPUTS, en as toStableSearchInputQueryKeys, j as stable_filters_default, k as toCustomAttributeFilterLabel, w as parseOccupancyCount } from "./client-DeEUMMOh.mjs";
2
- import { t as CMSError } from "./errors-2cuUGSvi.mjs";
3
- import { C as daysBetweenLocalDates, _ as toFormattedSearchPrice, x as toIsoDateFromPeriodQueryDate } from "./quote-CRjV_lf-.mjs";
4
- import { n as toImages, r as toAddress, t as toRentalHighlights } from "./to-rental-highlights-CAATPqan.mjs";
1
+ import { n as stable_filters_default } from "./client-BSUd3vuc.mjs";
2
+ import { a as searchQuery, c as VofficeUnitDataFieldSchemas, m as parseVofficeUnitData, n as toImages, r as toAddress, t as toRentalHighlights } from "./to-rental-highlights-FNZBR4aD.mjs";
3
+ import { CoreSDKError, STABLE_SEARCH_INPUTS, collectQueryParameters, daysBetweenLocalDates, expandCustomAttributeFilterCompositions, parseChildrenAges, parseOccupancyCount, parseQueryParameters, toCustomAttributeFilterLabel, toFormattedSearchPrice, toIsoDateFromPeriodQueryDate, toQueryString, toStableSearchInputBackendQueryKeys, toStableSearchInputParameterValues, toStableSearchInputQueryKeys, toUnusedFilterKeys } from "@v-office/sdk-core";
5
4
  import { Effect } from "effect";
6
- //#region src/adapters/v9/parser/search/input/filter/apply-voffice-filter-derived-basic-query-inputs.ts
5
+ //#region src/legacy-v9/parser/search/input/filter/apply-voffice-filter-derived-basic-query-inputs.ts
7
6
  const hasBasicQueryInput = ({ basicQueryInputs, key }) => basicQueryInputs.some((input) => input.key === key);
8
7
  const derivedBooleanFilters = [{
9
8
  key: "pets",
@@ -32,10 +31,10 @@ const applyVofficeFilterDerivedBasicQueryInputs = ({ appliedFilters, basicQueryI
32
31
  };
33
32
  });
34
33
  //#endregion
35
- //#region src/adapters/v9/parser/search/input/filter/filter-query-keys.ts
34
+ //#region src/legacy-v9/parser/search/input/filter/filter-query-keys.ts
36
35
  const FILTER_QUERY_KEYS = new Set(Object.keys(stable_filters_default));
37
36
  //#endregion
38
- //#region src/adapters/v9/parser/search/input/filter/to-basic-query-inputs.ts
37
+ //#region src/legacy-v9/parser/search/input/filter/to-basic-query-inputs.ts
39
38
  const isEnabledBooleanFilter = (value) => {
40
39
  const normalizedValue = value.toLowerCase();
41
40
  return normalizedValue === "" || normalizedValue === "true" || normalizedValue === "1";
@@ -129,10 +128,10 @@ const toBasicQueryInputs = ({ query, customAttributeFilterDefinitions, locale, t
129
128
  };
130
129
  };
131
130
  //#endregion
132
- //#region src/adapters/v9/parser/search/input/occupancy/occupancy-query-keys.ts
131
+ //#region src/legacy-v9/parser/search/input/occupancy/occupancy-query-keys.ts
133
132
  const OCCUPANCY_QUERY_KEYS = toStableSearchInputQueryKeys(STABLE_SEARCH_INPUTS.occupancy);
134
133
  //#endregion
135
- //#region src/adapters/v9/parser/search/input/occupancy/collect-occupancy-query-parameters.ts
134
+ //#region src/legacy-v9/parser/search/input/occupancy/collect-occupancy-query-parameters.ts
136
135
  const hasOccupancyInput = (query) => parseQueryParameters(query).some(([key]) => OCCUPANCY_QUERY_KEYS.has(key));
137
136
  const collectOccupancyQueryParameters = ({ query }) => {
138
137
  const { matchingParameters, remainingParameters } = collectQueryParameters({
@@ -145,7 +144,7 @@ const collectOccupancyQueryParameters = ({ query }) => {
145
144
  };
146
145
  };
147
146
  //#endregion
148
- //#region src/adapters/v9/parser/search/input/occupancy/to-occupancy-input.ts
147
+ //#region src/legacy-v9/parser/search/input/occupancy/to-occupancy-input.ts
149
148
  const parseStableOccupancyCount = ({ key, occupancyParameters }) => Effect.gen(function* () {
150
149
  const values = toStableSearchInputParameterValues({
151
150
  key,
@@ -185,20 +184,20 @@ const toOccupancyInput = ({ query }) => Effect.gen(function* () {
185
184
  };
186
185
  });
187
186
  //#endregion
188
- //#region src/adapters/v9/parser/search/input/search-input-error.ts
189
- const failInvalidV9SearchInput = (message) => Effect.fail(new CMSError({
190
- backend: "v9",
191
- operation: "search",
187
+ //#region src/legacy-v9/parser/search/input/search-input-error.ts
188
+ const failInvalidV9SearchInput = (message) => Effect.fail(new CoreSDKError({
189
+ source: "v10",
190
+ operation: "v9.search",
192
191
  message
193
192
  }));
194
193
  //#endregion
195
- //#region src/adapters/v9/parser/search/input/period/period-query-keys.ts
194
+ //#region src/legacy-v9/parser/search/input/period/period-query-keys.ts
196
195
  const PERIOD_QUERY_KEYS = toStableSearchInputBackendQueryKeys({
197
196
  backend: "v9",
198
197
  group: STABLE_SEARCH_INPUTS.period
199
198
  });
200
199
  //#endregion
201
- //#region src/adapters/v9/parser/search/input/period/collect-period-query-parameters.ts
200
+ //#region src/legacy-v9/parser/search/input/period/collect-period-query-parameters.ts
202
201
  const hasPeriodInput = (query) => parseQueryParameters(query).some(([key]) => PERIOD_QUERY_KEYS.has(key));
203
202
  const collectPeriodQueryParameters = ({ query }) => {
204
203
  const { matchingParameters, remainingParameters } = collectQueryParameters({
@@ -211,7 +210,7 @@ const collectPeriodQueryParameters = ({ query }) => {
211
210
  };
212
211
  };
213
212
  //#endregion
214
- //#region src/adapters/v9/parser/search/input/period/to-period-input.ts
213
+ //#region src/legacy-v9/parser/search/input/period/to-period-input.ts
215
214
  const parseScalarParameter = ({ key, values }) => {
216
215
  if (values.length > 1) return failInvalidV9SearchInput(`Expected at most one "${key}" query parameter.`);
217
216
  return Effect.succeed(values[0]);
@@ -284,7 +283,7 @@ const toPeriodInput = ({ query }) => Effect.gen(function* () {
284
283
  };
285
284
  });
286
285
  //#endregion
287
- //#region src/adapters/v9/parser/search/input/to-query-input.ts
286
+ //#region src/legacy-v9/parser/search/input/to-query-input.ts
288
287
  const toQueryInput = ({ query, customAttributeFilterDefinitions, locale, translations }) => Effect.gen(function* () {
289
288
  const compositionResult = expandCustomAttributeFilterCompositions({
290
289
  customAttributeFilterDefinitions,
@@ -325,18 +324,18 @@ const toQueryInput = ({ query, customAttributeFilterDefinitions, locale, transla
325
324
  };
326
325
  });
327
326
  //#endregion
328
- //#region src/adapters/v9/parser/search/output/to-formatted-price.ts
329
- const DEFAULT_V9_SEARCH_CURRENCY = "EUR";
327
+ //#region src/legacy-v9/parser/search/output/to-formatted-price.ts
328
+ const DEFAULT_V9_SEARCH_CURRENCY$1 = "EUR";
330
329
  const toFormattedPrice = ({ locale, calc }) => {
331
330
  if (calc?.total == null) return Effect.succeed(null);
332
331
  return Effect.succeed(toFormattedSearchPrice({
333
332
  amount: calc.total,
334
- currency: DEFAULT_V9_SEARCH_CURRENCY,
333
+ currency: DEFAULT_V9_SEARCH_CURRENCY$1,
335
334
  locale
336
335
  }));
337
336
  };
338
337
  //#endregion
339
- //#region src/adapters/v9/parser/search/to-search-output-item.ts
338
+ //#region src/legacy-v9/parser/search/to-search-output-item.ts
340
339
  const toSearchOutputItem = ({ locale, imageProxyBaseUrl, rentalHighlightPrioritization, customAttributeFilterDefinitions, rental, translations, includeFormattedTotal }) => Effect.gen(function* () {
341
340
  const data = parseVofficeUnitData(rental.data);
342
341
  const item = {
@@ -364,4 +363,22 @@ const toSearchOutputItem = ({ locale, imageProxyBaseUrl, rentalHighlightPrioriti
364
363
  return item;
365
364
  });
366
365
  //#endregion
367
- export { toQueryInput, toSearchOutputItem };
366
+ //#region src/legacy-v9/parser/search/output/to-alternative-periods.ts
367
+ const DEFAULT_V9_SEARCH_CURRENCY = "EUR";
368
+ const toAlternativePeriods = ({ locale, alternatives }) => Effect.succeed((alternatives ?? []).flatMap((alternative) => {
369
+ if (alternative.fromdate == null || alternative.tilldate == null) return [];
370
+ return [{
371
+ start: alternative.fromdate,
372
+ end: alternative.tilldate,
373
+ ...alternative.calc?.total == null ? {} : { formattedTotal: toFormattedSearchPrice({
374
+ amount: alternative.calc.total,
375
+ currency: DEFAULT_V9_SEARCH_CURRENCY,
376
+ locale
377
+ }) }
378
+ }];
379
+ }));
380
+ //#endregion
381
+ //#region src/legacy-v9/runtime/search.ts
382
+ const defaultSearchDataAttributes = Object.keys(VofficeUnitDataFieldSchemas);
383
+ //#endregion
384
+ export { defaultSearchDataAttributes, searchQuery, toAlternativePeriods, toQueryInput, toSearchOutputItem };