@v-office/website-sdk 1.2.0 → 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-Bo-gBDkQ.mjs → quote-1uEIO44v.mjs} +15 -16
  20. package/dist/{rentals-Ba6ZO6bX.mjs → rentals-Quwc78o2.mjs} +22 -138
  21. package/dist/{search-BofxXqF0.mjs → search-GRQeXDvo.mjs} +43 -24
  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-DYP0Y59i.mjs +0 -33236
  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-Bxhb0jmN.mjs +0 -1085
  42. package/dist/quote-BKcAIFuH.mjs +0 -513
  43. package/dist/quote-CRjV_lf-.mjs +0 -609
  44. package/dist/rentals-DBTPlC6X.mjs +0 -323
  45. package/dist/search-filter-metadata-DZP0-Udc.mjs +0 -4294
  46. package/dist/to-rental-highlights-BShYK50C.mjs +0 -402
@@ -1,54 +0,0 @@
1
- import { b as localeToLanguage } from "./quote-CRjV_lf-.mjs";
2
- //#region src/adapters/shared/parser/attribute-value.ts
3
- const isDistanceAttributeKey = (key) => key.endsWith("distance");
4
- const formatLabeledDistance = ({ label, value }) => `${label}: ${value}m`;
5
- const isEnabledBooleanValue = (value) => value === true || value === 1 || value === "true" || value === "1";
6
- const isDisabledBooleanValue = (value) => value === false || value === 0 || value === "false" || value === "0" || value == null;
7
- const isNonEmptyString = (value) => typeof value === "string" && value.length > 0;
8
- const isRecord = (value) => typeof value === "object" && value !== null;
9
- const toLocalizedAttributeString = ({ locale, value }) => {
10
- if (isNonEmptyString(value)) return value;
11
- if (!isRecord(value)) return void 0;
12
- const preferredKeys = [
13
- locale,
14
- localeToLanguage(locale),
15
- "en"
16
- ];
17
- for (const key of preferredKeys) {
18
- const localizedValue = value[key];
19
- if (isNonEmptyString(localizedValue)) return localizedValue;
20
- }
21
- return Object.values(value).find(isNonEmptyString);
22
- };
23
- const renderLabeledAttributeValue = ({ key, label, locale, value }) => {
24
- if (isDisabledBooleanValue(value)) return void 0;
25
- if (isEnabledBooleanValue(value)) return label;
26
- if (typeof value === "number") {
27
- if (isDistanceAttributeKey(key)) return formatLabeledDistance({
28
- label,
29
- value
30
- });
31
- if (key === "squareMeters") return `${value} m²`;
32
- return value === 1 ? label : `${value} ${label}`;
33
- }
34
- const localizedValue = toLocalizedAttributeString({
35
- locale,
36
- value
37
- });
38
- if (localizedValue != null) return `${label}: ${localizedValue}`;
39
- };
40
- //#endregion
41
- //#region src/adapters/shared/parser/custom-attribute.ts
42
- const renderCustomAttributeHighlight = ({ definitions, key, locale, value }) => {
43
- const definition = definitions.find((entry) => entry.key === key);
44
- if (definition == null) return void 0;
45
- const translatedValue = definition.type === "option" && typeof value === "string" ? definition.options.find((option) => option.value === value)?.label[locale] ?? value : value;
46
- return renderLabeledAttributeValue({
47
- key,
48
- label: definition.label[locale],
49
- locale,
50
- value: translatedValue
51
- });
52
- };
53
- //#endregion
54
- export { renderLabeledAttributeValue as i, formatLabeledDistance as n, isDistanceAttributeKey as r, renderCustomAttributeHighlight as t };
@@ -1,5 +0,0 @@
1
- import { Data } from "effect";
2
- //#region src/errors/index.ts
3
- var CMSError = class extends Data.TaggedError("CMSError") {};
4
- //#endregion
5
- export { CMSError as t };