@v-office/website-sdk 2.24.0 → 2.25.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 +89 -2
- package/dist/{client-DC4LG3CP.mjs → client-0Lgv-Gb_.mjs} +83 -18
- package/dist/index.d.mts +17 -5
- package/dist/index.mjs +1 -1
- package/dist/instructions/CHANGELOG.md +2 -0
- package/dist/instructions/MIGRATION.md +2 -0
- package/dist/instructions/creation.md +5 -0
- package/dist/instructions/rentals.md +75 -0
- package/dist/instructions/search.md +1 -2
- package/dist/instructions/versions/2.24.1/CHANGELOG.md +17 -0
- package/dist/instructions/versions/2.24.1/MIGRATION.md +9 -0
- package/dist/instructions/versions/2.25.0/CHANGELOG.md +41 -0
- package/dist/instructions/versions/2.25.0/MIGRATION.md +64 -0
- package/dist/{to-rental-highlights-C1NF2uuE.mjs → operations-DwURbo0b.mjs} +1 -626
- package/dist/{rentals-eqFhtCdT.mjs → rentals-Dn0-kGWD.mjs} +96 -33
- package/dist/{search-CKL-8T8q.mjs → search-BLTTQAsG.mjs} +4 -3
- package/dist/to-rental-highlights-BL5m3Uen.mjs +626 -0
- package/dist/translations/v9/de-DE/core.json +3 -1
- package/dist/translations/v9/en-US/core.json +3 -1
- package/dist/{v9-data-BnYxa2Ek.mjs → v9-data-C3SWtDGs.mjs} +7 -5
- package/instructions/CHANGELOG.md +2 -0
- package/instructions/MIGRATION.md +2 -0
- package/instructions/creation.md +5 -0
- package/instructions/rentals.md +75 -0
- package/instructions/search.md +1 -2
- package/instructions/versions/2.24.1/CHANGELOG.md +17 -0
- package/instructions/versions/2.24.1/MIGRATION.md +9 -0
- package/instructions/versions/2.24.1/release.json +3 -0
- package/instructions/versions/2.25.0/CHANGELOG.md +41 -0
- package/instructions/versions/2.25.0/MIGRATION.md +64 -0
- package/instructions/versions/2.25.0/release.json +3 -0
- package/package.json +3 -3
|
@@ -0,0 +1,626 @@
|
|
|
1
|
+
import { i as VofficeUnitDataPropertyMetadata } from "./v9-data-C3SWtDGs.mjs";
|
|
2
|
+
import { localeToLanguage, makeTranslate, renderLabeledAttributeValue, renderResolvedCustomAttribute, toCountry } from "@v-office/sdk-core";
|
|
3
|
+
import { Effect } from "effect";
|
|
4
|
+
//#region src/legacy-v9/parser/rentals/to-localized-string.ts
|
|
5
|
+
const isNonEmptyString$1 = (value) => typeof value === "string" && value.length > 0;
|
|
6
|
+
const isRecord = (value) => typeof value === "object" && value !== null;
|
|
7
|
+
const toLocalizedString = (value, locale) => {
|
|
8
|
+
if (isNonEmptyString$1(value)) return value;
|
|
9
|
+
if (!isRecord(value)) return void 0;
|
|
10
|
+
const preferredKeys = [
|
|
11
|
+
locale,
|
|
12
|
+
localeToLanguage(locale),
|
|
13
|
+
"en"
|
|
14
|
+
];
|
|
15
|
+
for (const key of preferredKeys) {
|
|
16
|
+
const localizedValue = value[key];
|
|
17
|
+
if (isNonEmptyString$1(localizedValue)) return localizedValue;
|
|
18
|
+
}
|
|
19
|
+
return Object.values(value).find(isNonEmptyString$1);
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/legacy-v9/parser/rentals/to-address.ts
|
|
23
|
+
const toProvince = (data, locale) => {
|
|
24
|
+
return toLocalizedString(data.known.regionName, locale);
|
|
25
|
+
};
|
|
26
|
+
const toAddress = (data, locale) => {
|
|
27
|
+
const source = data.known.address;
|
|
28
|
+
const address = {};
|
|
29
|
+
if (source == null) return address;
|
|
30
|
+
if (source.street != null) address.street = [source.street, source.housenumber].filter((part) => part != null && part.length > 0).join(" ");
|
|
31
|
+
if (source.appendix != null) address.appendix = source.appendix;
|
|
32
|
+
if (source.postalcode != null) address.postalcode = source.postalcode;
|
|
33
|
+
if (source.city != null) address.city = source.city;
|
|
34
|
+
if (source.country != null) address.country = toCountry(source.country, locale);
|
|
35
|
+
const province = toProvince(data, locale);
|
|
36
|
+
if (province != null) address.province = province;
|
|
37
|
+
return address;
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/legacy-v9/parser/rentals/to-image.ts
|
|
41
|
+
const IMAGE_ASPECT_RATIO = 3 / 2;
|
|
42
|
+
const IMAGE_SRCSET_WIDTHS = [
|
|
43
|
+
320,
|
|
44
|
+
480,
|
|
45
|
+
640,
|
|
46
|
+
960,
|
|
47
|
+
1280,
|
|
48
|
+
1920,
|
|
49
|
+
2560
|
|
50
|
+
];
|
|
51
|
+
const IMAGE_DEFAULT_WIDTH = 960;
|
|
52
|
+
const VOFFICE_DYNAMIC_IMAGE_BASE_URL = "https://dyn.v-office.com/image";
|
|
53
|
+
const VOFFICE_DYNAMIC_IMAGE_SIZES = [
|
|
54
|
+
["tn", 141],
|
|
55
|
+
["tnx", 225],
|
|
56
|
+
["s", 450],
|
|
57
|
+
["m", 600],
|
|
58
|
+
["xl", 1440],
|
|
59
|
+
["xxl", 2400]
|
|
60
|
+
];
|
|
61
|
+
const VOFFICE_DYNAMIC_IMAGE_DEFAULT_SIZE = "xl";
|
|
62
|
+
const buildImageUrl = (imageProxyBaseUrl, path, width) => {
|
|
63
|
+
const base = imageProxyBaseUrl.replace(/\/$/, "");
|
|
64
|
+
const normalizedPath = path.replace(/^\/+/, "");
|
|
65
|
+
return `${base}/_/rs:fill:${width}:${Math.round(width / IMAGE_ASPECT_RATIO)}:0/plain/${normalizedPath}`;
|
|
66
|
+
};
|
|
67
|
+
const buildSrcset = (imageProxyBaseUrl, path) => IMAGE_SRCSET_WIDTHS.map((width) => `${buildImageUrl(imageProxyBaseUrl, path, width)} ${width}w`).join(", ");
|
|
68
|
+
const buildVofficeDynamicImageUrl = (imageId, size) => `${VOFFICE_DYNAMIC_IMAGE_BASE_URL}/${size}/${imageId}.jpg`;
|
|
69
|
+
const buildVofficeDynamicImageSrcset = (imageId, originalImageWidth) => {
|
|
70
|
+
const originalWidth = originalImageWidth != null && originalImageWidth > 0 ? originalImageWidth : void 0;
|
|
71
|
+
const seenWidths = /* @__PURE__ */ new Set();
|
|
72
|
+
return VOFFICE_DYNAMIC_IMAGE_SIZES.flatMap(([size, maximumWidth]) => {
|
|
73
|
+
const width = originalWidth == null ? maximumWidth : Math.min(maximumWidth, originalWidth);
|
|
74
|
+
if (seenWidths.has(width)) return [];
|
|
75
|
+
seenWidths.add(width);
|
|
76
|
+
return [`${buildVofficeDynamicImageUrl(imageId, size)} ${width}w`];
|
|
77
|
+
}).join(", ");
|
|
78
|
+
};
|
|
79
|
+
const isNonEmptyString = (value) => typeof value === "string" && value.length > 0;
|
|
80
|
+
const toDataImageId = (dataImage) => dataImage?.id?.toString();
|
|
81
|
+
const getImagePath = (entry) => entry.image?.path ?? entry.normalizedPath;
|
|
82
|
+
const getFileName = (path) => path?.split("/").at(-1);
|
|
83
|
+
const getDirectoryName = (path) => {
|
|
84
|
+
const lastSlashIndex = path.lastIndexOf("/");
|
|
85
|
+
return lastSlashIndex === -1 ? void 0 : path.slice(0, lastSlashIndex);
|
|
86
|
+
};
|
|
87
|
+
const stripDataImageFilePrefix = (fileName) => fileName.replace(/^mf(?=\d)/i, "");
|
|
88
|
+
const getDataImageFileName = (dataImage) => {
|
|
89
|
+
const name = dataImage.name != null ? stripDataImageFilePrefix(dataImage.name) : void 0;
|
|
90
|
+
if (name != null) return name;
|
|
91
|
+
return dataImage.id != null ? `${dataImage.id}.jpg` : void 0;
|
|
92
|
+
};
|
|
93
|
+
const normalizeDataImagePath = (dataImage, referenceImages) => {
|
|
94
|
+
const fileName = getDataImageFileName(dataImage);
|
|
95
|
+
if (fileName == null) return void 0;
|
|
96
|
+
const matchingPath = referenceImages.find((image) => getFileName(image.path ?? void 0) === fileName)?.path;
|
|
97
|
+
if (matchingPath != null) return matchingPath;
|
|
98
|
+
const directoryName = referenceImages.map((image) => image.path != null ? getDirectoryName(image.path) : void 0).find((path) => path != null);
|
|
99
|
+
return directoryName != null ? `${directoryName}/${fileName}` : fileName;
|
|
100
|
+
};
|
|
101
|
+
const pathMatchesName = (path, name) => path != null && name != null && (path === name || path.endsWith(`/${name}`));
|
|
102
|
+
const entriesShareId = (left, right) => {
|
|
103
|
+
const leftIds = [left.image?.id, toDataImageId(left.dataImage)].filter(isNonEmptyString);
|
|
104
|
+
const rightIds = [right.image?.id, toDataImageId(right.dataImage)].filter(isNonEmptyString);
|
|
105
|
+
return leftIds.some((leftId) => rightIds.includes(leftId));
|
|
106
|
+
};
|
|
107
|
+
const entriesSharePathOrName = (left, right) => {
|
|
108
|
+
const leftPath = getImagePath(left);
|
|
109
|
+
const rightPath = getImagePath(right);
|
|
110
|
+
const leftName = left.dataImage != null ? getDataImageFileName(left.dataImage) : getFileName(left.image?.path ?? void 0);
|
|
111
|
+
const rightName = right.dataImage != null ? getDataImageFileName(right.dataImage) : getFileName(right.image?.path ?? void 0);
|
|
112
|
+
return leftPath != null && rightPath != null && leftPath === rightPath || pathMatchesName(leftPath, rightName) || pathMatchesName(rightPath, leftName);
|
|
113
|
+
};
|
|
114
|
+
const entriesMatch = (left, right) => entriesShareId(left, right) || entriesSharePathOrName(left, right);
|
|
115
|
+
const mergeEntry = (existing, next) => {
|
|
116
|
+
const image = existing.image ?? next.image;
|
|
117
|
+
const dataImage = existing.dataImage ?? next.dataImage;
|
|
118
|
+
const normalizedPath = existing.normalizedPath ?? next.normalizedPath;
|
|
119
|
+
const entry = { source: existing.source };
|
|
120
|
+
if (image != null) entry.image = image;
|
|
121
|
+
if (dataImage != null) entry.dataImage = dataImage;
|
|
122
|
+
if (normalizedPath != null) entry.normalizedPath = normalizedPath;
|
|
123
|
+
return entry;
|
|
124
|
+
};
|
|
125
|
+
const mergeImageEntries = (entries) => {
|
|
126
|
+
const merged = [];
|
|
127
|
+
for (const entry of entries) {
|
|
128
|
+
const index = merged.findIndex((existing) => entriesMatch(existing, entry));
|
|
129
|
+
if (index === -1) {
|
|
130
|
+
merged.push(entry);
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
merged[index] = mergeEntry(merged[index], entry);
|
|
134
|
+
}
|
|
135
|
+
return merged;
|
|
136
|
+
};
|
|
137
|
+
const getImageEntries = (rental, data) => {
|
|
138
|
+
const vofficeImages = rental.voffice_images ?? [];
|
|
139
|
+
const vofficeRoomImages = rental.voffice_room_images ?? [];
|
|
140
|
+
const referenceImages = [...vofficeImages, ...vofficeRoomImages];
|
|
141
|
+
return [
|
|
142
|
+
...vofficeImages.map((image) => ({
|
|
143
|
+
source: "voffice_images",
|
|
144
|
+
image
|
|
145
|
+
})),
|
|
146
|
+
...vofficeRoomImages.map((image) => ({
|
|
147
|
+
source: "voffice_room_images",
|
|
148
|
+
image
|
|
149
|
+
})),
|
|
150
|
+
...(data.known.images ?? []).flatMap((dataImage) => {
|
|
151
|
+
const normalizedPath = normalizeDataImagePath(dataImage, referenceImages);
|
|
152
|
+
if (normalizedPath == null) return [];
|
|
153
|
+
return [{
|
|
154
|
+
source: "data_images",
|
|
155
|
+
dataImage,
|
|
156
|
+
normalizedPath
|
|
157
|
+
}];
|
|
158
|
+
})
|
|
159
|
+
];
|
|
160
|
+
};
|
|
161
|
+
const toImage = (imageProxyBaseUrl, entry, locale) => {
|
|
162
|
+
const path = getImagePath(entry);
|
|
163
|
+
const src = path != null ? buildImageUrl(imageProxyBaseUrl, path, IMAGE_DEFAULT_WIDTH) : "";
|
|
164
|
+
const srcset = path != null ? buildSrcset(imageProxyBaseUrl, path) : "";
|
|
165
|
+
const title = toLocalizedString(entry.dataImage?.titles, locale) ?? entry.image?.title;
|
|
166
|
+
const alt = title ?? entry.image?.description ?? "";
|
|
167
|
+
const metadata = { source: entry.source };
|
|
168
|
+
if (entry.dataImage != null) metadata.dataImage = entry.dataImage;
|
|
169
|
+
const image = {
|
|
170
|
+
idOrPath: path ?? toDataImageId(entry.dataImage) ?? entry.dataImage?.name ?? "",
|
|
171
|
+
src,
|
|
172
|
+
srcset,
|
|
173
|
+
alt,
|
|
174
|
+
metadata
|
|
175
|
+
};
|
|
176
|
+
if (title != null) image.title = title;
|
|
177
|
+
if (entry.dataImage?.tag != null) image.category = entry.dataImage.tag;
|
|
178
|
+
return image;
|
|
179
|
+
};
|
|
180
|
+
const toImages = (imageProxyBaseUrl, rental, locale, data) => {
|
|
181
|
+
return mergeImageEntries(getImageEntries(rental, data)).map((entry) => toImage(imageProxyBaseUrl, entry, locale));
|
|
182
|
+
};
|
|
183
|
+
const toFacilityImages = (images, locale) => images.flatMap((image) => {
|
|
184
|
+
if (image.id == null) return [];
|
|
185
|
+
const title = toLocalizedString(image.titles, locale);
|
|
186
|
+
const item = {
|
|
187
|
+
idOrPath: image.id.toString(),
|
|
188
|
+
src: buildVofficeDynamicImageUrl(image.id, VOFFICE_DYNAMIC_IMAGE_DEFAULT_SIZE),
|
|
189
|
+
srcset: buildVofficeDynamicImageSrcset(image.id, image.width),
|
|
190
|
+
metadata: {
|
|
191
|
+
source: "voffice_facility_data_images",
|
|
192
|
+
dataImage: image
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
if (title != null) {
|
|
196
|
+
item.alt = title;
|
|
197
|
+
item.title = title;
|
|
198
|
+
}
|
|
199
|
+
if (image.tag != null) item.category = image.tag;
|
|
200
|
+
return [item];
|
|
201
|
+
});
|
|
202
|
+
//#endregion
|
|
203
|
+
//#region src/legacy-v9/parser/rentals/to-location.ts
|
|
204
|
+
const toLocation = (location) => {
|
|
205
|
+
if (location == null) return void 0;
|
|
206
|
+
const [longitude, latitude] = location.coordinates;
|
|
207
|
+
return {
|
|
208
|
+
latitude,
|
|
209
|
+
longitude
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
//#endregion
|
|
213
|
+
//#region src/legacy-v9/parser/rentals/render-property-attribute.ts
|
|
214
|
+
const countLabelKey = (labelKey, value) => `${labelKey.slice(0, -6)}.count.${value === 1 ? "one" : "other"}`;
|
|
215
|
+
const renderVofficePropertyAttribute = ({ key, metadata, locale, translate, value }) => Effect.gen(function* () {
|
|
216
|
+
if (metadata.sourceType === "OPT") {
|
|
217
|
+
if (typeof value !== "number" || !Number.isInteger(value)) return void 0;
|
|
218
|
+
const option = metadata.options?.find((candidate) => candidate.value === value);
|
|
219
|
+
if (option === void 0) return void 0;
|
|
220
|
+
return `${yield* translate(metadata.labelKey, key)}: ${yield* translate(option.labelKey, option.sourceLabel)}`;
|
|
221
|
+
}
|
|
222
|
+
if (value === false || value === 0 || value === "false" || value === "0" || value == null || value === "") return;
|
|
223
|
+
const label = yield* translate(metadata.labelKey, key);
|
|
224
|
+
if (metadata.sourceType === "INT" && typeof value === "number") {
|
|
225
|
+
if (value === 0) return void 0;
|
|
226
|
+
if (key.endsWith("distance")) return `${label}: ${value}m`;
|
|
227
|
+
if (key === "squareMeters") return `${value} m²`;
|
|
228
|
+
return `${value} ${yield* translate(countLabelKey(metadata.labelKey, value), label)}`;
|
|
229
|
+
}
|
|
230
|
+
return renderLabeledAttributeValue({
|
|
231
|
+
key,
|
|
232
|
+
label,
|
|
233
|
+
locale,
|
|
234
|
+
value
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
//#endregion
|
|
238
|
+
//#region codegen/v9/heuristic-generation/rental-highlight-key-map.ts
|
|
239
|
+
const V9_RENTAL_HIGHLIGHT_KEYS = new Set(Object.keys(VofficeUnitDataPropertyMetadata));
|
|
240
|
+
const V9_RENTAL_HIGHLIGHT_KEY_LOOKUP = {
|
|
241
|
+
ac: "ac",
|
|
242
|
+
acCoverage: "acCoverage",
|
|
243
|
+
accessToPrivateBeach: "privateBeach",
|
|
244
|
+
accessibleByLift: "lift",
|
|
245
|
+
adaptedBath: "handicappedAccessible",
|
|
246
|
+
adventure: "adventure",
|
|
247
|
+
airportdistance: "airportdistance",
|
|
248
|
+
alarmClock: "alarmClock",
|
|
249
|
+
alarmSystem: "alarmSystem",
|
|
250
|
+
allergic: "allergic",
|
|
251
|
+
archery: "archery",
|
|
252
|
+
awayFromItAll: "away_from_it_all",
|
|
253
|
+
babygate: "babygate",
|
|
254
|
+
balcony: "balcony",
|
|
255
|
+
balloonTrips: "balloon_trips",
|
|
256
|
+
basketball: "basketball",
|
|
257
|
+
bathroomEmergencyPullCord: "handicappedAccessible",
|
|
258
|
+
bbq: "bbq",
|
|
259
|
+
bbqArea: "bbqArea",
|
|
260
|
+
bbqType: "bbqType",
|
|
261
|
+
beach: "beach",
|
|
262
|
+
beachChair: "beachChair",
|
|
263
|
+
beachChairAtBeach: "beachChairAtBeach",
|
|
264
|
+
beachaccess: "loc_beach",
|
|
265
|
+
beachdistance: "beachdistance",
|
|
266
|
+
beachfront: "beachfront",
|
|
267
|
+
beachtype: "beachtype",
|
|
268
|
+
beachview: "beachview",
|
|
269
|
+
beachvolleyball: "beachvolleyball",
|
|
270
|
+
beamer: "beamer",
|
|
271
|
+
bicycles: "bicycles",
|
|
272
|
+
billiards: "billiards",
|
|
273
|
+
birdWatching: "birdWatching",
|
|
274
|
+
bathrooms: "bathrooms",
|
|
275
|
+
bedrooms: "bedrooms",
|
|
276
|
+
blinds: "blinds",
|
|
277
|
+
bluray: "bluray",
|
|
278
|
+
boatBerth: "boatBerth",
|
|
279
|
+
boatRental: "boat_rental",
|
|
280
|
+
boatTrip: "boat_trip",
|
|
281
|
+
boccie: "boccie",
|
|
282
|
+
bodySoap: "toiletries",
|
|
283
|
+
bookDvdMusicLibraryForChildren: "books",
|
|
284
|
+
books: "books",
|
|
285
|
+
botanicalGarden: "botanicalGarden",
|
|
286
|
+
bowling: "bowling",
|
|
287
|
+
budget: "budget",
|
|
288
|
+
bungeeJumping: "bungee_jumping",
|
|
289
|
+
canoeing: "canoeing",
|
|
290
|
+
carNecessity: "carNecessity",
|
|
291
|
+
carbonMonoxideDetector: "carbonMonoxideDetector",
|
|
292
|
+
carport: "carport",
|
|
293
|
+
carriageRides: "carriage_rides",
|
|
294
|
+
cd: "cd",
|
|
295
|
+
cds: "cds",
|
|
296
|
+
childSafetySocketCovers: "socketSafetyCovers",
|
|
297
|
+
childrenWelcome: "childrenWelcome",
|
|
298
|
+
church: "church",
|
|
299
|
+
cinema: "cinema",
|
|
300
|
+
citydistance: "citydistance",
|
|
301
|
+
climbing: "climbing",
|
|
302
|
+
closedPlot: "closedPlot",
|
|
303
|
+
closedTerrace: "closedTerrace",
|
|
304
|
+
coffeemaker: "coffeemaker",
|
|
305
|
+
conditioner: "toiletries",
|
|
306
|
+
cookingUtensils: "cookingUtensils",
|
|
307
|
+
cosmeticTreatments: "cosmetic_treatments",
|
|
308
|
+
countrysideView: "countrysideView",
|
|
309
|
+
countrysideViewType: "countrysideViewType",
|
|
310
|
+
coveredTerrace: "coveredTerrace",
|
|
311
|
+
crossCountrySkiing: "cross-country_skiing",
|
|
312
|
+
culture: "culture",
|
|
313
|
+
cycling: "cycling",
|
|
314
|
+
danceCourses: "dance_courses",
|
|
315
|
+
daySpa: "day_spa",
|
|
316
|
+
deepseaFisching: "deepseaFisching",
|
|
317
|
+
detached: "detached",
|
|
318
|
+
diningSeating: "diningSeating",
|
|
319
|
+
dishcloth: "dishcloth",
|
|
320
|
+
dishes: "dishes",
|
|
321
|
+
dishwasher: "dishwasher",
|
|
322
|
+
disco: "disco",
|
|
323
|
+
diving: "diving",
|
|
324
|
+
dryer: "dryer",
|
|
325
|
+
dutyfree: "dutyfree",
|
|
326
|
+
dvd: "dvd",
|
|
327
|
+
dvds: "dvds",
|
|
328
|
+
eggboiler: "eggboiler",
|
|
329
|
+
electricKettle: "electricKettle",
|
|
330
|
+
elevation: "elevation",
|
|
331
|
+
entireUnitWheelchairAccessible: "wheelchairFriendly",
|
|
332
|
+
espressomachine: "espressomachine",
|
|
333
|
+
espressomachineType: "espressomachineType",
|
|
334
|
+
fan: "fan",
|
|
335
|
+
family: "family",
|
|
336
|
+
farmHolidays: "farm_holidays",
|
|
337
|
+
ferrydistance: "ferrydistance",
|
|
338
|
+
festivals: "festivals",
|
|
339
|
+
fireAlarms: "firealarm",
|
|
340
|
+
fireExtinguisher: "fireExtinguisher",
|
|
341
|
+
fireplace: "fireplace",
|
|
342
|
+
fireside: "fireside",
|
|
343
|
+
firesideType: "firesideType",
|
|
344
|
+
firstAidKit: "firstAidKit",
|
|
345
|
+
fishguttingPlace: "fishguttingPlace",
|
|
346
|
+
fitnessTraining: "fitness-training",
|
|
347
|
+
floor: "floor",
|
|
348
|
+
floorCount: "floorCount",
|
|
349
|
+
flyscreen: "flyscreen",
|
|
350
|
+
football: "football",
|
|
351
|
+
freezer: "freezer",
|
|
352
|
+
freezerType: "freezerType",
|
|
353
|
+
fridge: "fridge",
|
|
354
|
+
fullLengthMirror: "fullLengthMirror",
|
|
355
|
+
gambling: "gambling",
|
|
356
|
+
games: "games",
|
|
357
|
+
garage: "garage",
|
|
358
|
+
garden: "garden",
|
|
359
|
+
gardenShed: "gardenShed",
|
|
360
|
+
gardenView: "gardenView",
|
|
361
|
+
golf: "golf",
|
|
362
|
+
golfdistance: "golfdistance",
|
|
363
|
+
guestwc: "guestwc",
|
|
364
|
+
gym: "fitnessroom",
|
|
365
|
+
gymnastics: "gymnastics",
|
|
366
|
+
hammock: "hammock",
|
|
367
|
+
handcart: "handcart",
|
|
368
|
+
handicappedAccessible: "handicappedAccessible",
|
|
369
|
+
heating: "heating",
|
|
370
|
+
heatingSystem: "heatingSystem",
|
|
371
|
+
helicopterTours: "helicopter_tours",
|
|
372
|
+
hifi: "hifi",
|
|
373
|
+
hiking: "hiking",
|
|
374
|
+
historic: "historic",
|
|
375
|
+
holidayComplex: "holiday_complex",
|
|
376
|
+
homecinema: "homecinema",
|
|
377
|
+
horsebackRiding: "horseback_riding",
|
|
378
|
+
iceSkating: "iceSkating",
|
|
379
|
+
individualAirConditioning: "ac",
|
|
380
|
+
indoorGrill: "indoorGrill",
|
|
381
|
+
indoorPool: "indoorPool",
|
|
382
|
+
infraredCabin: "infraredCabin",
|
|
383
|
+
internet: "internet",
|
|
384
|
+
internetSpeed: "internetSpeed",
|
|
385
|
+
iron: "iron",
|
|
386
|
+
ironingBoard: "ironingBoard",
|
|
387
|
+
jetSkiing: "jetSkiing",
|
|
388
|
+
jogging: "jogging",
|
|
389
|
+
kayaking: "kayaking",
|
|
390
|
+
kitchen: "kitchen",
|
|
391
|
+
kitchenDescription: "kitchenDescription",
|
|
392
|
+
kitchenType: "kitchenType",
|
|
393
|
+
kitchenmachine: "kitchenmachine",
|
|
394
|
+
lakedistance: "lakedistance",
|
|
395
|
+
lakeview: "lakeview",
|
|
396
|
+
lakeviewType: "lakeviewType",
|
|
397
|
+
landingStage: "landingStage",
|
|
398
|
+
laundryRack: "laundryRack",
|
|
399
|
+
library: "library",
|
|
400
|
+
lift: "lift",
|
|
401
|
+
locAtm: "loc_atm",
|
|
402
|
+
locBay: "loc_bay",
|
|
403
|
+
locBeach: "loc_beach",
|
|
404
|
+
locCity: "loc_city",
|
|
405
|
+
locDowntown: "loc_downtown",
|
|
406
|
+
locForest: "loc_forest",
|
|
407
|
+
locGroceries: "loc_groceries",
|
|
408
|
+
locHospital: "loc_hospital",
|
|
409
|
+
locLake: "loc_lake",
|
|
410
|
+
locMedicalServices: "loc_medical_services",
|
|
411
|
+
locMountain: "loc_mountain",
|
|
412
|
+
locOcean: "loc_ocean",
|
|
413
|
+
locRiver: "loc_river",
|
|
414
|
+
locRural: "loc_rural",
|
|
415
|
+
locVillage: "loc_village",
|
|
416
|
+
locWaterfalls: "loc_waterfalls",
|
|
417
|
+
loungeSeating: "loungeSeating",
|
|
418
|
+
livingrooms: "living_room",
|
|
419
|
+
lowBathroomSink: "handicappedAccessible",
|
|
420
|
+
luxury: "luxury",
|
|
421
|
+
marquee: "marquee",
|
|
422
|
+
massages: "massages",
|
|
423
|
+
maxAdults: "beds",
|
|
424
|
+
maxPersons: "beds",
|
|
425
|
+
microwave: "microwave",
|
|
426
|
+
minigolf: "minigolf",
|
|
427
|
+
minibar: "minibar",
|
|
428
|
+
minpersons: "minpersons",
|
|
429
|
+
mixer: "mixer",
|
|
430
|
+
mountainbiking: "mountainbiking",
|
|
431
|
+
mountainview: "mountainview",
|
|
432
|
+
mountainviewType: "mountainviewType",
|
|
433
|
+
museums: "museums",
|
|
434
|
+
nordicWalking: "nordic-walking",
|
|
435
|
+
nonsmoking: "nonsmoking",
|
|
436
|
+
nudeBeach: "nudeBeach",
|
|
437
|
+
outdoorDiningArea: "gardenFurniture",
|
|
438
|
+
outdoorFurniture: "gardenFurniture",
|
|
439
|
+
outdoorKitchen: "outdoorKitchen",
|
|
440
|
+
outdoorPool: "pool",
|
|
441
|
+
outdoorPoolDetails: "pool",
|
|
442
|
+
outdoorShower: "outdoorShower",
|
|
443
|
+
oven: "oven",
|
|
444
|
+
ovenConnection: "ovenConnection",
|
|
445
|
+
paragliding: "paragliding",
|
|
446
|
+
parasailing: "parasailing",
|
|
447
|
+
parasol: "parasol",
|
|
448
|
+
parkingCount: "parkingCount",
|
|
449
|
+
pavilion: "pavilion",
|
|
450
|
+
penthouse: "penthouse",
|
|
451
|
+
pilates: "pilates",
|
|
452
|
+
playground: "playground",
|
|
453
|
+
playgroundActivity: "playgroundActivity",
|
|
454
|
+
plotSize: "plotSize",
|
|
455
|
+
pond: "pond",
|
|
456
|
+
pool4kids: "pool4kids",
|
|
457
|
+
pooltable: "pooltable",
|
|
458
|
+
poolView: "poolView",
|
|
459
|
+
privateOpenAirBath: "outdoorShower",
|
|
460
|
+
privateparking: "privateparking",
|
|
461
|
+
publictransportdistance: "publictransportdistance",
|
|
462
|
+
qiGong: "qi_gong",
|
|
463
|
+
raclette: "raclette",
|
|
464
|
+
radio: "radio",
|
|
465
|
+
rafting: "rafting",
|
|
466
|
+
restaurantdistance: "restaurantdistance",
|
|
467
|
+
restaurants: "restaurants",
|
|
468
|
+
riverView: "riverView",
|
|
469
|
+
rollInShower: "handicappedAccessible",
|
|
470
|
+
romantic: "romantic",
|
|
471
|
+
rooms: "rooms",
|
|
472
|
+
rowing: "rowing",
|
|
473
|
+
ruins: "ruins",
|
|
474
|
+
safe: "safe",
|
|
475
|
+
sailing: "sailing",
|
|
476
|
+
sandbox: "sandbox",
|
|
477
|
+
sandwichToaster: "sandwichToaster",
|
|
478
|
+
sauna: "sauna",
|
|
479
|
+
seadistance: "seadistance",
|
|
480
|
+
seaview: "seaview",
|
|
481
|
+
seaviewType: "seaviewType",
|
|
482
|
+
shampoo: "toiletries",
|
|
483
|
+
shoeCabinet: "shoeCabinet",
|
|
484
|
+
shopping: "shopping",
|
|
485
|
+
shoppingdistance: "shoppingdistance",
|
|
486
|
+
showerChair: "handicappedAccessible",
|
|
487
|
+
sightSeeing: "sight_seeing",
|
|
488
|
+
skiBootWarmer: "skiBootWarmer",
|
|
489
|
+
skidistance: "skidistance",
|
|
490
|
+
skialpine: "skialpine",
|
|
491
|
+
sledding: "sledding",
|
|
492
|
+
slide: "slide",
|
|
493
|
+
smokeDetector: "smokeDetector",
|
|
494
|
+
snorkeling: "snorkeling",
|
|
495
|
+
snowboarding: "snowboarding",
|
|
496
|
+
solarium: "solarium",
|
|
497
|
+
spa: "wellness",
|
|
498
|
+
spices: "spices",
|
|
499
|
+
spelunking: "spelunking",
|
|
500
|
+
sportsActivities: "sports_activities",
|
|
501
|
+
squash: "squash",
|
|
502
|
+
stars: "stars",
|
|
503
|
+
steambath: "steambath",
|
|
504
|
+
stove: "stove",
|
|
505
|
+
stoveType: "stoveType",
|
|
506
|
+
sunbathingArea: "sunbathingArea",
|
|
507
|
+
sunlounger: "sunlounger",
|
|
508
|
+
surfing: "surfing",
|
|
509
|
+
swimming: "swimming",
|
|
510
|
+
swing: "swing",
|
|
511
|
+
synagogues: "synagogues",
|
|
512
|
+
tableTennis: "table_tennis",
|
|
513
|
+
tableTennisTable: "tableTennisTable",
|
|
514
|
+
tennis: "tennis",
|
|
515
|
+
tennisCourt: "tennisCourt",
|
|
516
|
+
terrace: "terrace",
|
|
517
|
+
theater: "theater",
|
|
518
|
+
themeParks: "themeParks",
|
|
519
|
+
toaster: "toaster",
|
|
520
|
+
toiletPaper: "toiletries",
|
|
521
|
+
toiletWithGrabRails: "handicappedAccessible",
|
|
522
|
+
toothbrush: "toiletries",
|
|
523
|
+
touristAttractions: "tourist_attractions",
|
|
524
|
+
toys: "toys",
|
|
525
|
+
trainstationdistance: "trainstationdistance",
|
|
526
|
+
trampoline: "trampoline",
|
|
527
|
+
trashCans: "trashcan",
|
|
528
|
+
trashcan: "trashcan",
|
|
529
|
+
trekking: "trekking",
|
|
530
|
+
tv: "tv",
|
|
531
|
+
tvConnection: "tvConnection",
|
|
532
|
+
tvCount: "tvCount",
|
|
533
|
+
tvInternationalChannels: "tvInternationalChannels",
|
|
534
|
+
tvSize: "tvSize",
|
|
535
|
+
upperFloorReachableByLift: "lift",
|
|
536
|
+
vacuum: "vacuum",
|
|
537
|
+
valleyView: "valleyView",
|
|
538
|
+
valleyViewType: "valleyViewType",
|
|
539
|
+
vod: "vod",
|
|
540
|
+
walking: "walking",
|
|
541
|
+
warmwater: "warmwater",
|
|
542
|
+
washer: "washer",
|
|
543
|
+
waterParks: "waterParks",
|
|
544
|
+
waterSki: "water_ski",
|
|
545
|
+
waterSport: "water_sport",
|
|
546
|
+
wellness: "wellness",
|
|
547
|
+
wellnessActivity: "wellnessActivity",
|
|
548
|
+
whaleWatching: "whale_watching",
|
|
549
|
+
wheelchairFriendly: "wheelchairFriendly",
|
|
550
|
+
whirlpool: "whirlpool",
|
|
551
|
+
wifi: "wifi",
|
|
552
|
+
windScreen: "windScreen",
|
|
553
|
+
windSurfing: "windSurfing",
|
|
554
|
+
yearOfConstruction: "yearOfConstruction",
|
|
555
|
+
yearOfLastRenovation: "yearOfLastRenovation",
|
|
556
|
+
yoga: "yoga",
|
|
557
|
+
youthgroups: "youthgroups",
|
|
558
|
+
zoo: "zoo"
|
|
559
|
+
};
|
|
560
|
+
const toV9RentalHighlightKey = (key) => {
|
|
561
|
+
const mappedKey = V9_RENTAL_HIGHLIGHT_KEY_LOOKUP[key] ?? key;
|
|
562
|
+
return V9_RENTAL_HIGHLIGHT_KEYS.has(mappedKey) ? mappedKey : void 0;
|
|
563
|
+
};
|
|
564
|
+
//#endregion
|
|
565
|
+
//#region src/legacy-v9/parser/rentals/to-rental-highlights.ts
|
|
566
|
+
const RENTAL_VIEW_HIGHLIGHT_KEYS = /* @__PURE__ */ new Set([
|
|
567
|
+
"beachview",
|
|
568
|
+
"cityView",
|
|
569
|
+
"countrysideView",
|
|
570
|
+
"gardenView",
|
|
571
|
+
"innerCourtView",
|
|
572
|
+
"lakeview",
|
|
573
|
+
"mountainview",
|
|
574
|
+
"poolView",
|
|
575
|
+
"quietStreetView",
|
|
576
|
+
"riverView",
|
|
577
|
+
"seaview",
|
|
578
|
+
"valleyView"
|
|
579
|
+
]);
|
|
580
|
+
const toRentalHighlights = ({ locale, translations, highlightPrioritization, customAttributes, attributes }) => Effect.gen(function* () {
|
|
581
|
+
const highlights = [];
|
|
582
|
+
const seenKeys = /* @__PURE__ */ new Set();
|
|
583
|
+
const knownAttributes = attributes.known;
|
|
584
|
+
const translate = makeTranslate(translations, locale);
|
|
585
|
+
let hasViewHighlight = false;
|
|
586
|
+
for (const highlightKey of highlightPrioritization) {
|
|
587
|
+
const isViewHighlight = RENTAL_VIEW_HIGHLIGHT_KEYS.has(highlightKey);
|
|
588
|
+
if (isViewHighlight && hasViewHighlight) continue;
|
|
589
|
+
const v9Key = toV9RentalHighlightKey(highlightKey);
|
|
590
|
+
if (v9Key == null) {
|
|
591
|
+
if (seenKeys.has(highlightKey)) continue;
|
|
592
|
+
seenKeys.add(highlightKey);
|
|
593
|
+
const attribute = customAttributes.byKey[highlightKey];
|
|
594
|
+
if (attribute === void 0) continue;
|
|
595
|
+
const binding = attribute.v9;
|
|
596
|
+
const value = binding === void 0 ? void 0 : knownAttributes[binding] ?? attributes.unknown[binding];
|
|
597
|
+
const highlight = renderResolvedCustomAttribute({
|
|
598
|
+
attribute,
|
|
599
|
+
locale,
|
|
600
|
+
value
|
|
601
|
+
});
|
|
602
|
+
if (highlight != null) {
|
|
603
|
+
highlights.push(highlight);
|
|
604
|
+
if (isViewHighlight) hasViewHighlight = true;
|
|
605
|
+
}
|
|
606
|
+
continue;
|
|
607
|
+
}
|
|
608
|
+
if (seenKeys.has(v9Key)) continue;
|
|
609
|
+
seenKeys.add(v9Key);
|
|
610
|
+
const metadata = VofficeUnitDataPropertyMetadata[v9Key];
|
|
611
|
+
const highlight = yield* renderVofficePropertyAttribute({
|
|
612
|
+
key: v9Key,
|
|
613
|
+
metadata,
|
|
614
|
+
locale,
|
|
615
|
+
translate,
|
|
616
|
+
value: knownAttributes[v9Key]
|
|
617
|
+
});
|
|
618
|
+
if (highlight != null) {
|
|
619
|
+
highlights.push(highlight);
|
|
620
|
+
if (isViewHighlight) hasViewHighlight = true;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
return highlights;
|
|
624
|
+
});
|
|
625
|
+
//#endregion
|
|
626
|
+
export { toFacilityImages as a, toLocalizedString as c, toLocation as i, toV9RentalHighlightKey as n, toImages as o, renderVofficePropertyAttribute as r, toAddress as s, toRentalHighlights as t };
|
|
@@ -6,5 +6,7 @@
|
|
|
6
6
|
"Property.propertyType.option.FARM": "Bauernhof",
|
|
7
7
|
"Property.propertyType.option.HOLIDAY_HOME_COMPLEX": "Ferienpark",
|
|
8
8
|
"Property.propertyType.option.HOSTEL": "Hostel",
|
|
9
|
-
"Property.propertyType.option.HOTEL": "Hotel"
|
|
9
|
+
"Property.propertyType.option.HOTEL": "Hotel",
|
|
10
|
+
"reviews.item.guest": "Gast",
|
|
11
|
+
"reviews.item.authorWithCity": "{author} aus {city}"
|
|
10
12
|
}
|
|
@@ -6,5 +6,7 @@
|
|
|
6
6
|
"Property.propertyType.option.FARM": "Farm",
|
|
7
7
|
"Property.propertyType.option.HOLIDAY_HOME_COMPLEX": "Holiday Home Complex",
|
|
8
8
|
"Property.propertyType.option.HOSTEL": "Hostel",
|
|
9
|
-
"Property.propertyType.option.HOTEL": "Hotel"
|
|
9
|
+
"Property.propertyType.option.HOTEL": "Hotel",
|
|
10
|
+
"reviews.item.guest": "Guest",
|
|
11
|
+
"reviews.item.authorWithCity": "{author} from {city}"
|
|
10
12
|
}
|
|
@@ -4895,14 +4895,16 @@ const VofficeFeedbackDataFieldSchemas = {
|
|
|
4895
4895
|
surname: Schema.NullOr(Schema.String),
|
|
4896
4896
|
city: Schema.NullOr(Schema.String),
|
|
4897
4897
|
text: Schema.NullOr(Schema.String),
|
|
4898
|
-
fb_1429: Schema.Number,
|
|
4899
|
-
fb_4905: Schema.Number,
|
|
4900
|
-
fb_4906: Schema.Number,
|
|
4901
4898
|
avgRating: Schema.Number
|
|
4902
4899
|
};
|
|
4903
4900
|
const parseVofficeFeedbackData = (input) => parseJsonData(VofficeFeedbackDataFieldSchemas, input);
|
|
4904
4901
|
Schema.String, Schema.String, Schema.Number;
|
|
4905
|
-
|
|
4902
|
+
/** Known structure of VofficeRating.data attributes. */
|
|
4903
|
+
const VofficeRatingDataFieldSchemas = {
|
|
4904
|
+
fb_avg: Schema.Number,
|
|
4905
|
+
fb_count: Schema.Number
|
|
4906
|
+
};
|
|
4907
|
+
const parseVofficeRatingData = (input) => parseJsonData(VofficeRatingDataFieldSchemas, input);
|
|
4906
4908
|
Schema.Number, Schema.Number, Schema.Number, Schema.Number;
|
|
4907
4909
|
//#endregion
|
|
4908
|
-
export { customDataAttribute as a,
|
|
4910
|
+
export { customDataAttribute as a, parseVofficeRatingData as c, VofficeUnitDataPropertyMetadata as i, parseVofficeUnitData as l, VofficeUnitDataPropertyCategoryLabelKeys as n, parseVofficeFacilityData as o, VofficeUnitDataPropertyCategoryValues as r, parseVofficeFeedbackData as s, VofficeUnitDataFieldSchemas as t };
|
|
@@ -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.25.0/CHANGELOG.md`: release notes for 2.25.0
|
|
8
|
+
- `versions/2.24.1/CHANGELOG.md`: release notes for 2.24.1
|
|
7
9
|
- `versions/2.24.0/CHANGELOG.md`: release notes for 2.24.0
|
|
8
10
|
- `versions/2.23.0/CHANGELOG.md`: release notes for 2.23.0
|
|
9
11
|
- `versions/2.22.0/CHANGELOG.md`: release notes for 2.22.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.25.0/MIGRATION.md`: Migration: 2.24.1 to 2.25.0
|
|
8
|
+
- `versions/2.24.1/MIGRATION.md`: Migration: 2.24.0 to 2.24.1
|
|
7
9
|
- `versions/2.24.0/MIGRATION.md`: Migration: 2.23.0 to 2.24.0
|
|
8
10
|
- `versions/2.23.0/MIGRATION.md`: Migration: 2.22.0 to 2.23.0
|
|
9
11
|
- `versions/2.22.0/MIGRATION.md`: Migration: 2.21.0 to 2.22.0
|