@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,402 +0,0 @@
1
- import { P as VofficeUnitDataPropertyMetadata } from "./client-DYP0Y59i.mjs";
2
- import "./errors-2cuUGSvi.mjs";
3
- import { b as localeToLanguage, v as toCountry, y as makeTranslate } from "./quote-CRjV_lf-.mjs";
4
- import { i as renderLabeledAttributeValue, t as renderCustomAttributeHighlight } from "./custom-attribute-D5Kb1YHA.mjs";
5
- import { Effect } from "effect";
6
- //#region src/adapters/v9/parser/rentals/to-localized-string.ts
7
- const isNonEmptyString = (value) => typeof value === "string" && value.length > 0;
8
- const isRecord = (value) => typeof value === "object" && value !== null;
9
- const toLocalizedString = (value, locale) => {
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
- //#endregion
24
- //#region src/adapters/v9/parser/rentals/to-address.ts
25
- const toProvince = (data, locale) => {
26
- return toLocalizedString(data.known.regionName, locale);
27
- };
28
- const toAddress = (data, locale) => {
29
- const source = data.known.address;
30
- const address = {};
31
- if (source == null) return address;
32
- if (source.street != null) address.street = [source.street, source.housenumber].filter((part) => part != null && part.length > 0).join(" ");
33
- if (source.postalcode != null) address.postalcode = source.postalcode;
34
- if (source.city != null) address.city = source.city;
35
- if (source.country != null) address.country = toCountry(source.country, locale);
36
- const province = toProvince(data, locale);
37
- if (province != null) address.province = province;
38
- return address;
39
- };
40
- //#endregion
41
- //#region scripts/v9/heuristic-generation/rental-highlight-key-map.ts
42
- const V9_RENTAL_HIGHLIGHT_KEYS = new Set(Object.keys(VofficeUnitDataPropertyMetadata));
43
- const V9_RENTAL_HIGHLIGHT_KEY_LOOKUP = {
44
- ac: "ac",
45
- acCoverage: "acCoverage",
46
- accessToPrivateBeach: "privateBeach",
47
- accessibleByLift: "lift",
48
- adaptedBath: "handicappedAccessible",
49
- adventure: "adventure",
50
- airportdistance: "airportdistance",
51
- alarmClock: "alarmClock",
52
- alarmSystem: "alarmSystem",
53
- allergic: "allergic",
54
- archery: "archery",
55
- awayFromItAll: "away_from_it_all",
56
- babygate: "babygate",
57
- balcony: "balcony",
58
- balloonTrips: "balloon_trips",
59
- basketball: "basketball",
60
- bathroomEmergencyPullCord: "handicappedAccessible",
61
- bbq: "bbq",
62
- bbqArea: "bbqArea",
63
- bbqType: "bbqType",
64
- beach: "beach",
65
- beachChair: "beachChair",
66
- beachChairAtBeach: "beachChairAtBeach",
67
- beachaccess: "loc_beach",
68
- beachdistance: "beachdistance",
69
- beachfront: "beachfront",
70
- beachtype: "beachtype",
71
- beachview: "beachview",
72
- beachvolleyball: "beachvolleyball",
73
- beamer: "beamer",
74
- bicycles: "bicycles",
75
- billiards: "billiards",
76
- birdWatching: "birdWatching",
77
- bathrooms: "bathrooms",
78
- bedrooms: "bedrooms",
79
- blinds: "blinds",
80
- bluray: "bluray",
81
- boatBerth: "boatBerth",
82
- boatRental: "boat_rental",
83
- boatTrip: "boat_trip",
84
- boccie: "boccie",
85
- bodySoap: "toiletries",
86
- bookDvdMusicLibraryForChildren: "books",
87
- books: "books",
88
- botanicalGarden: "botanicalGarden",
89
- bowling: "bowling",
90
- budget: "budget",
91
- bungeeJumping: "bungee_jumping",
92
- canoeing: "canoeing",
93
- carNecessity: "carNecessity",
94
- carbonMonoxideDetector: "carbonMonoxideDetector",
95
- carport: "carport",
96
- carriageRides: "carriage_rides",
97
- cd: "cd",
98
- cds: "cds",
99
- childSafetySocketCovers: "socketSafetyCovers",
100
- childrenWelcome: "childrenWelcome",
101
- church: "church",
102
- cinema: "cinema",
103
- citydistance: "citydistance",
104
- climbing: "climbing",
105
- closedPlot: "closedPlot",
106
- closedTerrace: "closedTerrace",
107
- coffeemaker: "coffeemaker",
108
- conditioner: "toiletries",
109
- cookingUtensils: "cookingUtensils",
110
- cosmeticTreatments: "cosmetic_treatments",
111
- countrysideView: "countrysideView",
112
- countrysideViewType: "countrysideViewType",
113
- coveredTerrace: "coveredTerrace",
114
- crossCountrySkiing: "cross-country_skiing",
115
- culture: "culture",
116
- cycling: "cycling",
117
- danceCourses: "dance_courses",
118
- daySpa: "day_spa",
119
- deepseaFisching: "deepseaFisching",
120
- detached: "detached",
121
- diningSeating: "diningSeating",
122
- dishcloth: "dishcloth",
123
- dishes: "dishes",
124
- dishwasher: "dishwasher",
125
- disco: "disco",
126
- diving: "diving",
127
- dryer: "dryer",
128
- dutyfree: "dutyfree",
129
- dvd: "dvd",
130
- dvds: "dvds",
131
- eggboiler: "eggboiler",
132
- electricKettle: "electricKettle",
133
- elevation: "elevation",
134
- entireUnitWheelchairAccessible: "wheelchairFriendly",
135
- espressomachine: "espressomachine",
136
- espressomachineType: "espressomachineType",
137
- fan: "fan",
138
- family: "family",
139
- farmHolidays: "farm_holidays",
140
- ferrydistance: "ferrydistance",
141
- festivals: "festivals",
142
- fireAlarms: "firealarm",
143
- fireExtinguisher: "fireExtinguisher",
144
- fireplace: "fireplace",
145
- fireside: "fireside",
146
- firesideType: "firesideType",
147
- firstAidKit: "firstAidKit",
148
- fishguttingPlace: "fishguttingPlace",
149
- fitnessTraining: "fitness-training",
150
- floor: "floor",
151
- floorCount: "floorCount",
152
- flyscreen: "flyscreen",
153
- football: "football",
154
- freezer: "freezer",
155
- freezerType: "freezerType",
156
- fridge: "fridge",
157
- fullLengthMirror: "fullLengthMirror",
158
- gambling: "gambling",
159
- games: "games",
160
- garage: "garage",
161
- garden: "garden",
162
- gardenShed: "gardenShed",
163
- gardenView: "gardenView",
164
- golf: "golf",
165
- golfdistance: "golfdistance",
166
- guestwc: "guestwc",
167
- gym: "fitnessroom",
168
- gymnastics: "gymnastics",
169
- hammock: "hammock",
170
- handcart: "handcart",
171
- handicappedAccessible: "handicappedAccessible",
172
- heating: "heating",
173
- heatingSystem: "heatingSystem",
174
- helicopterTours: "helicopter_tours",
175
- hifi: "hifi",
176
- hiking: "hiking",
177
- historic: "historic",
178
- holidayComplex: "holiday_complex",
179
- homecinema: "homecinema",
180
- horsebackRiding: "horseback_riding",
181
- iceSkating: "iceSkating",
182
- individualAirConditioning: "ac",
183
- indoorGrill: "indoorGrill",
184
- indoorPool: "indoorPool",
185
- infraredCabin: "infraredCabin",
186
- internet: "internet",
187
- internetSpeed: "internetSpeed",
188
- iron: "iron",
189
- ironingBoard: "ironingBoard",
190
- jetSkiing: "jetSkiing",
191
- jogging: "jogging",
192
- kayaking: "kayaking",
193
- kitchen: "kitchen",
194
- kitchenDescription: "kitchenDescription",
195
- kitchenType: "kitchenType",
196
- kitchenmachine: "kitchenmachine",
197
- lakedistance: "lakedistance",
198
- lakeview: "lakeview",
199
- lakeviewType: "lakeviewType",
200
- landingStage: "landingStage",
201
- laundryRack: "laundryRack",
202
- library: "library",
203
- lift: "lift",
204
- locAtm: "loc_atm",
205
- locBay: "loc_bay",
206
- locBeach: "loc_beach",
207
- locCity: "loc_city",
208
- locDowntown: "loc_downtown",
209
- locForest: "loc_forest",
210
- locGroceries: "loc_groceries",
211
- locHospital: "loc_hospital",
212
- locLake: "loc_lake",
213
- locMedicalServices: "loc_medical_services",
214
- locMountain: "loc_mountain",
215
- locOcean: "loc_ocean",
216
- locRiver: "loc_river",
217
- locRural: "loc_rural",
218
- locVillage: "loc_village",
219
- locWaterfalls: "loc_waterfalls",
220
- loungeSeating: "loungeSeating",
221
- livingrooms: "living_room",
222
- lowBathroomSink: "handicappedAccessible",
223
- luxury: "luxury",
224
- marquee: "marquee",
225
- massages: "massages",
226
- maxAdults: "beds",
227
- maxPersons: "beds",
228
- microwave: "microwave",
229
- minigolf: "minigolf",
230
- minibar: "minibar",
231
- minpersons: "minpersons",
232
- mixer: "mixer",
233
- mountainbiking: "mountainbiking",
234
- mountainview: "mountainview",
235
- mountainviewType: "mountainviewType",
236
- museums: "museums",
237
- nordicWalking: "nordic-walking",
238
- nonsmoking: "nonsmoking",
239
- nudeBeach: "nudeBeach",
240
- outdoorDiningArea: "gardenFurniture",
241
- outdoorFurniture: "gardenFurniture",
242
- outdoorKitchen: "outdoorKitchen",
243
- outdoorPool: "pool",
244
- outdoorPoolDetails: "pool",
245
- outdoorShower: "outdoorShower",
246
- oven: "oven",
247
- ovenConnection: "ovenConnection",
248
- paragliding: "paragliding",
249
- parasailing: "parasailing",
250
- parasol: "parasol",
251
- parkingCount: "parkingCount",
252
- pavilion: "pavilion",
253
- penthouse: "penthouse",
254
- pilates: "pilates",
255
- playground: "playground",
256
- playgroundActivity: "playgroundActivity",
257
- plotSize: "plotSize",
258
- pond: "pond",
259
- pool4kids: "pool4kids",
260
- pooltable: "pooltable",
261
- poolView: "poolView",
262
- privateOpenAirBath: "outdoorShower",
263
- privateparking: "privateparking",
264
- publictransportdistance: "publictransportdistance",
265
- qiGong: "qi_gong",
266
- raclette: "raclette",
267
- radio: "radio",
268
- rafting: "rafting",
269
- restaurantdistance: "restaurantdistance",
270
- restaurants: "restaurants",
271
- riverView: "riverView",
272
- rollInShower: "handicappedAccessible",
273
- romantic: "romantic",
274
- rooms: "rooms",
275
- rowing: "rowing",
276
- ruins: "ruins",
277
- safe: "safe",
278
- sailing: "sailing",
279
- sandbox: "sandbox",
280
- sandwichToaster: "sandwichToaster",
281
- sauna: "sauna",
282
- seadistance: "seadistance",
283
- seaview: "seaview",
284
- seaviewType: "seaviewType",
285
- shampoo: "toiletries",
286
- shoeCabinet: "shoeCabinet",
287
- shopping: "shopping",
288
- shoppingdistance: "shoppingdistance",
289
- showerChair: "handicappedAccessible",
290
- sightSeeing: "sight_seeing",
291
- skiBootWarmer: "skiBootWarmer",
292
- skidistance: "skidistance",
293
- skialpine: "skialpine",
294
- sledding: "sledding",
295
- slide: "slide",
296
- smokeDetector: "smokeDetector",
297
- snorkeling: "snorkeling",
298
- snowboarding: "snowboarding",
299
- solarium: "solarium",
300
- spa: "wellness",
301
- spices: "spices",
302
- spelunking: "spelunking",
303
- sportsActivities: "sports_activities",
304
- squash: "squash",
305
- stars: "stars",
306
- steambath: "steambath",
307
- stove: "stove",
308
- stoveType: "stoveType",
309
- sunbathingArea: "sunbathingArea",
310
- sunlounger: "sunlounger",
311
- surfing: "surfing",
312
- swimming: "swimming",
313
- swing: "swing",
314
- synagogues: "synagogues",
315
- tableTennis: "table_tennis",
316
- tableTennisTable: "tableTennisTable",
317
- tennis: "tennis",
318
- tennisCourt: "tennisCourt",
319
- terrace: "terrace",
320
- theater: "theater",
321
- themeParks: "themeParks",
322
- toaster: "toaster",
323
- toiletPaper: "toiletries",
324
- toiletWithGrabRails: "handicappedAccessible",
325
- toothbrush: "toiletries",
326
- touristAttractions: "tourist_attractions",
327
- toys: "toys",
328
- trainstationdistance: "trainstationdistance",
329
- trampoline: "trampoline",
330
- trashCans: "trashcan",
331
- trashcan: "trashcan",
332
- trekking: "trekking",
333
- tv: "tv",
334
- tvConnection: "tvConnection",
335
- tvCount: "tvCount",
336
- tvInternationalChannels: "tvInternationalChannels",
337
- tvSize: "tvSize",
338
- upperFloorReachableByLift: "lift",
339
- vacuum: "vacuum",
340
- valleyView: "valleyView",
341
- valleyViewType: "valleyViewType",
342
- vod: "vod",
343
- walking: "walking",
344
- warmwater: "warmwater",
345
- washer: "washer",
346
- waterParks: "waterParks",
347
- waterSki: "water_ski",
348
- waterSport: "water_sport",
349
- wellness: "wellness",
350
- wellnessActivity: "wellnessActivity",
351
- whaleWatching: "whale_watching",
352
- wheelchairFriendly: "wheelchairFriendly",
353
- whirlpool: "whirlpool",
354
- wifi: "wifi",
355
- windScreen: "windScreen",
356
- windSurfing: "windSurfing",
357
- yearOfConstruction: "yearOfConstruction",
358
- yearOfLastRenovation: "yearOfLastRenovation",
359
- yoga: "yoga",
360
- youthgroups: "youthgroups",
361
- zoo: "zoo"
362
- };
363
- const toV9RentalHighlightKey = (key) => {
364
- const mappedKey = V9_RENTAL_HIGHLIGHT_KEY_LOOKUP[key] ?? key;
365
- return V9_RENTAL_HIGHLIGHT_KEYS.has(mappedKey) ? mappedKey : void 0;
366
- };
367
- //#endregion
368
- //#region src/adapters/v9/parser/rentals/to-rental-highlights.ts
369
- const toRentalHighlights = ({ locale, translations, highlightPrioritization, customAttributeFilterDefinitions, attributes }) => Effect.gen(function* () {
370
- const highlights = [];
371
- const seenKeys = /* @__PURE__ */ new Set();
372
- const knownAttributes = attributes.known;
373
- const translate = makeTranslate(translations, locale);
374
- for (const highlightKey of highlightPrioritization) {
375
- const v9Key = toV9RentalHighlightKey(highlightKey);
376
- if (v9Key == null) {
377
- if (seenKeys.has(highlightKey)) continue;
378
- seenKeys.add(highlightKey);
379
- const highlight = renderCustomAttributeHighlight({
380
- definitions: customAttributeFilterDefinitions,
381
- key: highlightKey,
382
- locale,
383
- value: knownAttributes[highlightKey] ?? attributes.unknown[highlightKey]
384
- });
385
- if (highlight != null) highlights.push(highlight);
386
- continue;
387
- }
388
- if (seenKeys.has(v9Key)) continue;
389
- seenKeys.add(v9Key);
390
- const metadata = VofficeUnitDataPropertyMetadata[v9Key];
391
- const highlight = renderLabeledAttributeValue({
392
- key: v9Key,
393
- label: yield* translate(metadata.labelKey, v9Key),
394
- locale,
395
- value: knownAttributes[v9Key]
396
- });
397
- if (highlight != null) highlights.push(highlight);
398
- }
399
- return highlights;
400
- });
401
- //#endregion
402
- export { toAddress as n, toLocalizedString as r, toRentalHighlights as t };