@v-office/website-sdk 2.31.1 → 2.33.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 +12 -2
- package/dist/{client-RLKoee2Y.mjs → client-BSyJzzk0.mjs} +58 -4
- package/dist/index.d.mts +114 -3
- package/dist/index.mjs +2 -2
- package/dist/instructions/CHANGELOG.md +2 -0
- package/dist/instructions/MIGRATION.md +2 -0
- package/dist/instructions/README.md +1 -0
- package/dist/instructions/rentals.md +12 -9
- package/dist/instructions/versions/2.32.0/CHANGELOG.md +27 -0
- package/dist/instructions/versions/2.32.0/MIGRATION.md +48 -0
- package/dist/instructions/versions/2.33.0/CHANGELOG.md +21 -0
- package/dist/instructions/versions/2.33.0/MIGRATION.md +25 -0
- package/dist/instructions/videos.md +168 -0
- package/dist/{rentals-DEJNTkpJ.mjs → rentals-Be1Zs2DQ.mjs} +2 -2
- package/dist/{search-yXF_xFrg.mjs → search-Dv5e8hNc.mjs} +2 -2
- package/dist/{to-rental-highlights-CIz0CxcP.mjs → to-rental-highlights-Dbnm6Y4_.mjs} +98 -22
- package/instructions/CHANGELOG.md +2 -0
- package/instructions/MIGRATION.md +2 -0
- package/instructions/README.md +1 -0
- package/instructions/rentals.md +12 -9
- package/instructions/versions/2.32.0/CHANGELOG.md +27 -0
- package/instructions/versions/2.32.0/MIGRATION.md +48 -0
- package/instructions/versions/2.32.0/release.json +3 -0
- package/instructions/versions/2.33.0/CHANGELOG.md +21 -0
- package/instructions/versions/2.33.0/MIGRATION.md +25 -0
- package/instructions/versions/2.33.0/release.json +3 -0
- package/instructions/videos.md +168 -0
- package/package.json +3 -2
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# Videos
|
|
2
|
+
|
|
3
|
+
Videos are available on v9 only. Check `sdk.backend === "v9"` before using them. v10 has no
|
|
4
|
+
`sdk.static.videos`.
|
|
5
|
+
|
|
6
|
+
## Service
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
if (sdk.backend === "v9") {
|
|
10
|
+
const all = await sdk.static.videos.getVideos();
|
|
11
|
+
const hero = await sdk.static.videos.getVideos({ placement: "frontpage" });
|
|
12
|
+
const ofRental = await sdk.static.videos.getVideos({ placement: "object", rentalId: "12345" });
|
|
13
|
+
}
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The SDK loads the list once per instance. Filters run locally and combine with AND; without
|
|
17
|
+
input every video is returned.
|
|
18
|
+
|
|
19
|
+
## Input
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
type V9VideosGetVideosInput = {
|
|
23
|
+
placement?: string;
|
|
24
|
+
rentalId?: string;
|
|
25
|
+
};
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Output
|
|
29
|
+
|
|
30
|
+
Returns `Promise<ReadonlyArray<V9Video>>`, ordered by upload (oldest first).
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
type V9Video = {
|
|
34
|
+
id: string;
|
|
35
|
+
placement: string;
|
|
36
|
+
rentalIds: ReadonlyArray<string>;
|
|
37
|
+
hlsUrl: string;
|
|
38
|
+
posterUrl: string | null;
|
|
39
|
+
durationSeconds: number;
|
|
40
|
+
fileName: string;
|
|
41
|
+
};
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Sample item:
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"id": "17",
|
|
49
|
+
"placement": "object",
|
|
50
|
+
"rentalIds": ["12345"],
|
|
51
|
+
"hlsUrl": "https://stream.example/abc/manifest/video.m3u8",
|
|
52
|
+
"posterUrl": "https://stream.example/abc/thumbnails/thumbnail.jpg",
|
|
53
|
+
"durationSeconds": 67.2,
|
|
54
|
+
"fileName": "haus-seeblick-final.mp4"
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
- `placement` says where the agency wants the video. `frontpage` is the home page video
|
|
59
|
+
(at most one per agency). `object` videos belong to the rentals in `rentalIds`; one rental
|
|
60
|
+
can have several videos. Any other value is a free slug for a page of the agency's choosing,
|
|
61
|
+
for example a landing page. The agency picks the placement in the be-on! agency portal.
|
|
62
|
+
- `rentalIds` match `rental.id` of the rentals.
|
|
63
|
+
- `fileName` is the name of the uploaded file. Never show it to visitors. Label a video from
|
|
64
|
+
the rental name or the page it sits on.
|
|
65
|
+
- `posterUrl` is `null` when no still image exists.
|
|
66
|
+
|
|
67
|
+
## Behaviour
|
|
68
|
+
|
|
69
|
+
- Call it at build time. A video the agency adds or deletes shows up after the next site
|
|
70
|
+
build.
|
|
71
|
+
- A failing call rejects, which fails the build. The previous build stays live.
|
|
72
|
+
- An empty list is normal. Render nothing, not an empty player.
|
|
73
|
+
|
|
74
|
+
## Playback
|
|
75
|
+
|
|
76
|
+
`hlsUrl` is an HLS stream. Install `hls.js` as an exactly pinned dependency of the site. Safari
|
|
77
|
+
and iOS play HLS natively; other browsers need `hls.js`. Try native playback first, then load
|
|
78
|
+
`hls.js` on demand.
|
|
79
|
+
|
|
80
|
+
This snippet is temporary: a playback helper in `@v-office/website-headless` will replace it.
|
|
81
|
+
|
|
82
|
+
### Rental video
|
|
83
|
+
|
|
84
|
+
```astro
|
|
85
|
+
---
|
|
86
|
+
const [video] = await sdk.static.videos.getVideos({ placement: "object", rentalId: rental.id });
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
{
|
|
90
|
+
video && (
|
|
91
|
+
<video
|
|
92
|
+
data-hls={video.hlsUrl}
|
|
93
|
+
controls
|
|
94
|
+
poster={video.posterUrl ?? undefined}
|
|
95
|
+
preload="none"
|
|
96
|
+
playsinline
|
|
97
|
+
aria-label={`Video: ${rental.nameOrLabel}`}
|
|
98
|
+
/>
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
<script>
|
|
103
|
+
const attach = async (video: HTMLVideoElement, src: string) => {
|
|
104
|
+
if (video.canPlayType("application/vnd.apple.mpegurl")) {
|
|
105
|
+
video.src = src;
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const { default: Hls } = await import("hls.js");
|
|
109
|
+
if (!Hls.isSupported()) return;
|
|
110
|
+
const hls = new Hls();
|
|
111
|
+
hls.loadSource(src);
|
|
112
|
+
hls.attachMedia(video);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
document
|
|
116
|
+
.querySelectorAll<HTMLVideoElement>("video[data-hls]")
|
|
117
|
+
.forEach((video) => attach(video, video.dataset.hls!));
|
|
118
|
+
</script>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Hero video
|
|
122
|
+
|
|
123
|
+
The home page video plays silently in the background, so it is muted, loops and carries no
|
|
124
|
+
native controls. Moving content that starts on its own needs a way to stop it, so the hero
|
|
125
|
+
gets a pause button and does not start for visitors who ask for reduced motion.
|
|
126
|
+
|
|
127
|
+
```astro
|
|
128
|
+
---
|
|
129
|
+
const [hero] = await sdk.static.videos.getVideos({ placement: "frontpage" });
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
{
|
|
133
|
+
hero && (
|
|
134
|
+
<div class="hero-video">
|
|
135
|
+
<video
|
|
136
|
+
data-hls={hero.hlsUrl}
|
|
137
|
+
data-hero
|
|
138
|
+
muted
|
|
139
|
+
loop
|
|
140
|
+
playsinline
|
|
141
|
+
poster={hero.posterUrl ?? undefined}
|
|
142
|
+
aria-hidden="true"
|
|
143
|
+
/>
|
|
144
|
+
<button type="button" data-hero-toggle>Pause video</button>
|
|
145
|
+
</div>
|
|
146
|
+
)
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
<script>
|
|
150
|
+
const video = document.querySelector<HTMLVideoElement>("video[data-hero]");
|
|
151
|
+
const toggle = document.querySelector<HTMLButtonElement>("button[data-hero-toggle]");
|
|
152
|
+
if (video && toggle) {
|
|
153
|
+
const sync = () => (toggle.textContent = video.paused ? "Play video" : "Pause video");
|
|
154
|
+
video.addEventListener("play", sync);
|
|
155
|
+
video.addEventListener("pause", sync);
|
|
156
|
+
toggle.addEventListener("click", () => (video.paused ? video.play() : video.pause()));
|
|
157
|
+
// hls.js attaches the source later; autoplay starts the video once it can play.
|
|
158
|
+
video.autoplay = !matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
159
|
+
if (video.autoplay && video.readyState >= HTMLMediaElement.HAVE_FUTURE_DATA) {
|
|
160
|
+
video.play().catch(sync);
|
|
161
|
+
}
|
|
162
|
+
sync();
|
|
163
|
+
}
|
|
164
|
+
</script>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Use the `<script>` from the rental video as well. It attaches every `video[data-hls]` on the
|
|
168
|
+
page.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Qt as V9_FACILITY_ATTRIBUTE_KEYS } from "./client-BSyJzzk0.mjs";
|
|
2
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-
|
|
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";
|
|
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-
|
|
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
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-
|
|
3
|
+
import { i as toLocation, n as toV9RentalHighlightKey, o as toImages, s as toAddress, t as toRentalHighlights } from "./to-rental-highlights-Dbnm6Y4_.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
|
|
@@ -50,32 +50,103 @@ const IMAGE_SRCSET_WIDTHS = [
|
|
|
50
50
|
];
|
|
51
51
|
const IMAGE_DEFAULT_WIDTH = 960;
|
|
52
52
|
const VOFFICE_DYNAMIC_IMAGE_BASE_URL = "https://dyn.v-office.com/image";
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
const VOFFICE_DYNAMIC_IMAGE_XL = {
|
|
54
|
+
name: "xl",
|
|
55
|
+
width: 1440,
|
|
56
|
+
height: 1440,
|
|
57
|
+
crop: false
|
|
58
|
+
};
|
|
59
|
+
const VOFFICE_DYNAMIC_IMAGE_XXL = {
|
|
60
|
+
name: "xxl",
|
|
61
|
+
width: 2400,
|
|
62
|
+
height: 2400,
|
|
63
|
+
crop: false
|
|
64
|
+
};
|
|
65
|
+
const VOFFICE_DYNAMIC_PHOTO_SIZES = [
|
|
66
|
+
{
|
|
67
|
+
name: "tnfx",
|
|
68
|
+
width: 141,
|
|
69
|
+
height: 94,
|
|
70
|
+
crop: true
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "tnxfx",
|
|
74
|
+
width: 225,
|
|
75
|
+
height: 150,
|
|
76
|
+
crop: true
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "sfx",
|
|
80
|
+
width: 450,
|
|
81
|
+
height: 300,
|
|
82
|
+
crop: true
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: "mx",
|
|
86
|
+
width: 600,
|
|
87
|
+
height: 400,
|
|
88
|
+
crop: true
|
|
89
|
+
},
|
|
90
|
+
VOFFICE_DYNAMIC_IMAGE_XL,
|
|
91
|
+
VOFFICE_DYNAMIC_IMAGE_XXL
|
|
92
|
+
];
|
|
93
|
+
const VOFFICE_DYNAMIC_FLOORPLAN_SIZES = [
|
|
94
|
+
{
|
|
95
|
+
name: "tn",
|
|
96
|
+
width: 141,
|
|
97
|
+
height: 94,
|
|
98
|
+
crop: false
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: "tnx",
|
|
102
|
+
width: 225,
|
|
103
|
+
height: 150,
|
|
104
|
+
crop: false
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: "s",
|
|
108
|
+
width: 450,
|
|
109
|
+
height: 300,
|
|
110
|
+
crop: false
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: "m",
|
|
114
|
+
width: 600,
|
|
115
|
+
height: 400,
|
|
116
|
+
crop: false
|
|
117
|
+
},
|
|
118
|
+
VOFFICE_DYNAMIC_IMAGE_XL,
|
|
119
|
+
VOFFICE_DYNAMIC_IMAGE_XXL
|
|
60
120
|
];
|
|
61
|
-
const
|
|
121
|
+
const FLOORPLAN_TAG = "floorplan";
|
|
62
122
|
const buildImageUrl = (imageProxyBaseUrl, path, width) => {
|
|
63
123
|
const base = imageProxyBaseUrl.replace(/\/$/, "");
|
|
64
124
|
const normalizedPath = path.replace(/^\/+/, "");
|
|
65
|
-
return `${base}/_/rs:fill:${width}:${Math.round(width / IMAGE_ASPECT_RATIO)}:0/plain/${normalizedPath}`;
|
|
125
|
+
return `${base}/_/rs:fill:${width}:${Math.round(width / IMAGE_ASPECT_RATIO)}:0/plain/${normalizedPath}@webp`;
|
|
66
126
|
};
|
|
67
127
|
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}.
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
128
|
+
const buildVofficeDynamicImageUrl = (imageId, size) => `${VOFFICE_DYNAMIC_IMAGE_BASE_URL}/${size.name}/${imageId}.webp`;
|
|
129
|
+
const toRenderedWidth = (size, dataImage) => {
|
|
130
|
+
const width = dataImage?.width;
|
|
131
|
+
const height = dataImage?.height;
|
|
132
|
+
if (size.crop || width == null || height == null || width <= 0 || height <= 0) return size.width;
|
|
133
|
+
return Math.round(width * Math.min(1, size.width / width, size.height / height));
|
|
134
|
+
};
|
|
135
|
+
const buildVofficeDynamicImageSrcset = (imageId, dataImage) => {
|
|
136
|
+
const sizes = dataImage?.tag === FLOORPLAN_TAG ? VOFFICE_DYNAMIC_FLOORPLAN_SIZES : VOFFICE_DYNAMIC_PHOTO_SIZES;
|
|
137
|
+
let previousWidth = 0;
|
|
138
|
+
return sizes.flatMap((size) => {
|
|
139
|
+
const width = toRenderedWidth(size, dataImage);
|
|
140
|
+
if (width <= previousWidth) return [];
|
|
141
|
+
previousWidth = width;
|
|
76
142
|
return [`${buildVofficeDynamicImageUrl(imageId, size)} ${width}w`];
|
|
77
143
|
}).join(", ");
|
|
78
144
|
};
|
|
145
|
+
const toPathImageId = (path) => {
|
|
146
|
+
const fileId = path?.match(/(?:^|\/)(\d+)(?:\.[a-z]+)?$/i)?.[1];
|
|
147
|
+
return fileId != null ? Number(fileId) : void 0;
|
|
148
|
+
};
|
|
149
|
+
const getVofficeDynamicImageId = (entry) => entry.dataImage?.id ?? toPathImageId(entry.image?.path ?? void 0);
|
|
79
150
|
const isNonEmptyString = (value) => typeof value === "string" && value.length > 0;
|
|
80
151
|
const toDataImageId = (dataImage) => dataImage?.id?.toString();
|
|
81
152
|
const getImagePath = (entry) => entry.image?.path ?? entry.normalizedPath;
|
|
@@ -113,7 +184,11 @@ const entriesSharePathOrName = (left, right) => {
|
|
|
113
184
|
const rightName = right.dataImage != null ? getDataImageFileName(right.dataImage) : getFileName(right.image?.path ?? void 0);
|
|
114
185
|
return leftPath != null && rightPath != null && leftPath === rightPath || pathMatchesName(leftPath, rightName) || pathMatchesName(rightPath, leftName);
|
|
115
186
|
};
|
|
116
|
-
const
|
|
187
|
+
const entriesShareVofficeDynamicImageId = (left, right) => {
|
|
188
|
+
const leftId = getVofficeDynamicImageId(left);
|
|
189
|
+
return leftId != null && leftId === getVofficeDynamicImageId(right);
|
|
190
|
+
};
|
|
191
|
+
const entriesMatch = (left, right) => entriesShareId(left, right) || entriesShareVofficeDynamicImageId(left, right) || entriesSharePathOrName(left, right);
|
|
117
192
|
const mergeEntry = (existing, next) => {
|
|
118
193
|
const image = existing.image ?? next.image;
|
|
119
194
|
const dataImage = existing.dataImage ?? next.dataImage;
|
|
@@ -162,8 +237,9 @@ const getImageEntries = (rental, data) => {
|
|
|
162
237
|
};
|
|
163
238
|
const toImage = (imageProxyBaseUrl, entry, locale) => {
|
|
164
239
|
const path = getImagePath(entry);
|
|
165
|
-
const
|
|
166
|
-
const
|
|
240
|
+
const imageId = getVofficeDynamicImageId(entry);
|
|
241
|
+
const src = imageId != null ? buildVofficeDynamicImageUrl(imageId, VOFFICE_DYNAMIC_IMAGE_XL) : path != null ? buildImageUrl(imageProxyBaseUrl, path, IMAGE_DEFAULT_WIDTH) : "";
|
|
242
|
+
const srcset = imageId != null ? buildVofficeDynamicImageSrcset(imageId, entry.dataImage) : path != null ? buildSrcset(imageProxyBaseUrl, path) : "";
|
|
167
243
|
const title = toLocalizedString(entry.dataImage?.titles, locale) ?? entry.image?.title;
|
|
168
244
|
const alt = title ?? entry.image?.description ?? "";
|
|
169
245
|
const metadata = { source: entry.source };
|
|
@@ -187,8 +263,8 @@ const toFacilityImages = (images, locale) => images.flatMap((image) => {
|
|
|
187
263
|
const title = toLocalizedString(image.titles, locale);
|
|
188
264
|
const item = {
|
|
189
265
|
idOrPath: image.id.toString(),
|
|
190
|
-
src: buildVofficeDynamicImageUrl(image.id,
|
|
191
|
-
srcset: buildVofficeDynamicImageSrcset(image.id, image
|
|
266
|
+
src: buildVofficeDynamicImageUrl(image.id, VOFFICE_DYNAMIC_IMAGE_XL),
|
|
267
|
+
srcset: buildVofficeDynamicImageSrcset(image.id, image),
|
|
192
268
|
metadata: {
|
|
193
269
|
source: "voffice_facility_data_images",
|
|
194
270
|
dataImage: image
|
|
@@ -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.33.0/CHANGELOG.md`: release notes for 2.33.0
|
|
8
|
+
- `versions/2.32.0/CHANGELOG.md`: release notes for 2.32.0
|
|
7
9
|
- `versions/2.31.1/CHANGELOG.md`: release notes for 2.31.1
|
|
8
10
|
- `versions/2.31.0/CHANGELOG.md`: release notes for 2.31.0
|
|
9
11
|
- `versions/2.30.2/CHANGELOG.md`: release notes for 2.30.2
|
|
@@ -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.33.0/MIGRATION.md`: Migration: 2.32.0 to 2.33.0
|
|
8
|
+
- `versions/2.32.0/MIGRATION.md`: Migration: 2.31.1 to 2.32.0
|
|
7
9
|
- `versions/2.31.1/MIGRATION.md`: Migration: 2.31.0 to 2.31.1
|
|
8
10
|
- `versions/2.31.0/MIGRATION.md`: Migration: 2.30.2 to 2.31.0
|
|
9
11
|
- `versions/2.30.2/MIGRATION.md`: Migration: 2.30.1 to 2.30.2
|
package/instructions/README.md
CHANGED
|
@@ -9,6 +9,7 @@ Use this directory as the consumer-facing reference for the package:
|
|
|
9
9
|
- `creation.md`: SDK construction, config, options, and CLI config files.
|
|
10
10
|
- `rentals.md`: `sdk.static.rentals.getRentals` and, on v9, `sdk.live.rentals.getRentalsByIds`.
|
|
11
11
|
- `filter.md`: `sdk.static.filter.getFilters`.
|
|
12
|
+
- `videos.md`: v9 only. `sdk.static.videos.getVideos`, placements, and HLS playback.
|
|
12
13
|
- `custom-attributes.md`: custom attribute catalog, configuration, per-backend behaviour, and the v9-to-v10 move.
|
|
13
14
|
- `search.md`: `sdk.live.search.search`, vouchers, and, on v9, `sdk.live.search.searchPages`, Hub filters, and `sdk.live.voucher.validate`.
|
|
14
15
|
- `availability.md`: date-picker availability flows.
|
package/instructions/rentals.md
CHANGED
|
@@ -89,10 +89,10 @@ Sample item:
|
|
|
89
89
|
|
|
90
90
|
Optional fields include `scope`, `address`, `property`, `rooms`, `roomSummary`, `vicinity`, and `reviews`.
|
|
91
91
|
|
|
92
|
-
### Legacy v9
|
|
92
|
+
### Legacy v9 Images
|
|
93
93
|
|
|
94
|
-
|
|
95
|
-
`property.images`:
|
|
94
|
+
v9 rental `images` and facility `property.images` come from vOffice's image service
|
|
95
|
+
as WebP. Static rentals return facility images in `property.images`:
|
|
96
96
|
|
|
97
97
|
```json
|
|
98
98
|
{
|
|
@@ -102,8 +102,8 @@ From 2.15.0, v9 static rentals request facility image metadata and return it in
|
|
|
102
102
|
"images": [
|
|
103
103
|
{
|
|
104
104
|
"idOrPath": "28458352",
|
|
105
|
-
"src": "https://dyn.v-office.com/image/xl/28458352.
|
|
106
|
-
"srcset": "https://dyn.v-office.com/image/
|
|
105
|
+
"src": "https://dyn.v-office.com/image/xl/28458352.webp",
|
|
106
|
+
"srcset": "https://dyn.v-office.com/image/tnfx/28458352.webp 141w, https://dyn.v-office.com/image/tnxfx/28458352.webp 225w, https://dyn.v-office.com/image/sfx/28458352.webp 450w, https://dyn.v-office.com/image/mx/28458352.webp 600w, https://dyn.v-office.com/image/xl/28458352.webp 1440w, https://dyn.v-office.com/image/xxl/28458352.webp 2400w",
|
|
107
107
|
"alt": "Hauptansicht",
|
|
108
108
|
"title": "Hauptansicht",
|
|
109
109
|
"category": "buildingMain"
|
|
@@ -113,9 +113,12 @@ From 2.15.0, v9 static rentals request facility image metadata and return it in
|
|
|
113
113
|
}
|
|
114
114
|
```
|
|
115
115
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
Consumers must allow `https://dyn.v-office.com` as an image origin. The sizes up to
|
|
117
|
+
600w are cropped to 3:2; `xl` and `xxl` show the whole photo, so render photos in a
|
|
118
|
+
box with a fixed `aspect-ratio` and `object-fit: cover`. Floor plans are never
|
|
119
|
+
cropped. A width in `srcset` is the delivered width when the rental data knows the
|
|
120
|
+
photo's size. Room images uploaded in the be-on! Hub are not vOffice photos; they
|
|
121
|
+
come from the configured `imageProxyBaseUrl` as WebP, so keep that host allowed too.
|
|
119
122
|
|
|
120
123
|
The SDK supplies width-descriptor `srcset`; the UI remains responsible for an
|
|
121
124
|
HTML `sizes` attribute that matches its layout. `property.images` is omitted
|
|
@@ -123,7 +126,7 @@ when the facility has no usable image IDs. Because the service returns one item
|
|
|
123
126
|
per rental, rentals in the same facility contain the same nested property image
|
|
124
127
|
list.
|
|
125
128
|
|
|
126
|
-
See `versions/2.15.0
|
|
129
|
+
See `versions/2.15.0/` and `versions/2.32.0/` (`CHANGELOG.md`, `MIGRATION.md`).
|
|
127
130
|
|
|
128
131
|
### Legacy v9 Facility Details
|
|
129
132
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Changelog: 2.32.0
|
|
2
|
+
|
|
3
|
+
v9 rental photos now come from vOffice's own image service `dyn.v-office.com` as WebP
|
|
4
|
+
instead of the be-on! image proxy as JPEG. The files are smaller, and each photo is listed
|
|
5
|
+
once with its title.
|
|
6
|
+
|
|
7
|
+
## Changed
|
|
8
|
+
|
|
9
|
+
- v9 rental `images` and facility `property.images` use
|
|
10
|
+
`https://dyn.v-office.com/image/<size>/<image-id>.webp` for `src` and `srcset`.
|
|
11
|
+
- `srcset` lists vOffice's named sizes: `tnfx` (141w), `tnxfx` (225w), `sfx` (450w) and
|
|
12
|
+
`mx` (600w) are cropped to 3:2 around the center, as before. `xl` (up to 1440 px) and
|
|
13
|
+
`xxl` (up to 2400 px) show the whole photo: vOffice has no cropped size above 600 px.
|
|
14
|
+
Render photos in a box with `object-fit: cover` to keep the 3:2 look at every size.
|
|
15
|
+
- A width in `srcset` is the width vOffice really delivers when the rental data knows the
|
|
16
|
+
photo's size. A photo smaller than a size stops the list at its own width.
|
|
17
|
+
- Floor plans (`category: "floorplan"`) are never cropped: their small sizes are `tn`,
|
|
18
|
+
`tnx`, `s` and `m` instead of the cropped ones.
|
|
19
|
+
- `src` is the `xl` size.
|
|
20
|
+
- Room images uploaded in the be-on! Hub are not vOffice photos and stay on the image
|
|
21
|
+
proxy (`IMAGE_PROXY_BASE_URL`), now as WebP (`…@webp`).
|
|
22
|
+
|
|
23
|
+
## Fixed
|
|
24
|
+
|
|
25
|
+
- A v9 rental no longer lists each photo twice. vOffice's image data and the Hub's photo
|
|
26
|
+
list are matched by their image id, so photos now also carry their title as `alt` and
|
|
27
|
+
`title` and their `category`.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Migration: 2.31.1 to 2.32.0
|
|
2
|
+
|
|
3
|
+
Only v9 sites are affected. The shape of `images` does not change, only the URLs in `src`
|
|
4
|
+
and `srcset`. Every v9 site must allow the new image host (step 2), should check its photo
|
|
5
|
+
boxes (step 3) and must check its own code for the image proxy (step 4).
|
|
6
|
+
|
|
7
|
+
## 1. Upgrade
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
pnpm add @v-office/website-sdk@2.32.0
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## 2. Allow `dyn.v-office.com` for photos
|
|
14
|
+
|
|
15
|
+
v9 photos load from `https://dyn.v-office.com`. Allow the host wherever the site lists
|
|
16
|
+
image hosts, for example a Content-Security-Policy:
|
|
17
|
+
|
|
18
|
+
```http
|
|
19
|
+
Content-Security-Policy: img-src 'self' https://dyn.v-office.com https://imgproxy.voffice.be-on.io
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
or Astro's `image.domains` / `image.remotePatterns`. A site that already shows facility
|
|
23
|
+
images from 2.15.0 on allows it.
|
|
24
|
+
|
|
25
|
+
## 3. Check the photo boxes
|
|
26
|
+
|
|
27
|
+
Up to 600 px every photo is cropped to 3:2. Above that the photo comes uncropped, so a
|
|
28
|
+
portrait or panorama photo has its own aspect ratio. Give each photo a box with a fixed
|
|
29
|
+
`aspect-ratio` and `object-fit: cover`, or the photo changes its shape between mobile and
|
|
30
|
+
desktop.
|
|
31
|
+
|
|
32
|
+
## 4. Switch the site's own image proxy code to the SDK
|
|
33
|
+
|
|
34
|
+
Rental and facility photos no longer come from the image proxy. Search the site for
|
|
35
|
+
`imgproxy`, `IMAGE_PROXY_BASE_URL`, `rs:fill` and `@webp` and check each hit:
|
|
36
|
+
|
|
37
|
+
- Code that loads any other image through the proxy stays as it is. Only rental and
|
|
38
|
+
facility photos moved to `dyn.v-office.com`.
|
|
39
|
+
- Code that builds proxy URLs for rental photos itself (for example from `idOrPath`)
|
|
40
|
+
must use the SDK's `src` and `srcset` instead.
|
|
41
|
+
- Code that turned proxy URLs into WebP (appending `@webp`) or replaced `.jpg` with
|
|
42
|
+
`.webp` on `dyn.v-office.com` URLs can be removed. The SDK delivers WebP.
|
|
43
|
+
- Code that rewrote the proxy's `rs:fill` segment to show a floor plan uncropped can be
|
|
44
|
+
removed. Floor plans come uncropped.
|
|
45
|
+
- A preconnect or preload for the proxy host is not needed for photos any more.
|
|
46
|
+
|
|
47
|
+
Keep `IMAGE_PROXY_BASE_URL` and keep the proxy host allowed: room images uploaded in the
|
|
48
|
+
be-on! Hub are not vOffice photos and still come from the proxy, as WebP.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Changelog: 2.33.0
|
|
2
|
+
|
|
3
|
+
v9 sites can now list the videos an agency uploaded in the be-on! agency portal and play
|
|
4
|
+
them, for example a home page video or a video on a rental page.
|
|
5
|
+
|
|
6
|
+
## Added
|
|
7
|
+
|
|
8
|
+
- `sdk.static.videos.getVideos` on v9 returns the agency's videos, ordered by upload. Each
|
|
9
|
+
video has an `id`, a `placement`, the `rentalIds` it belongs to, an HLS stream URL
|
|
10
|
+
`hlsUrl`, an optional `posterUrl`, `durationSeconds` and the upload's `fileName`.
|
|
11
|
+
- Optional filters `placement` (`frontpage`, `object` or a free slug) and `rentalId`. They
|
|
12
|
+
combine; without them every video is returned.
|
|
13
|
+
- The SDK loads the list once per instance. A failing call rejects, so a build that needs
|
|
14
|
+
videos fails and the previous build stays live.
|
|
15
|
+
- The types `V9Video`, `V9VideosGetVideosInput` and `WebsiteSDKV9Static` are exported.
|
|
16
|
+
- The CLI has a `videos` command for v9 with `--placement` and `--rental-id`.
|
|
17
|
+
- `videos.md` describes the data and shows how to play the HLS stream with `hls.js`.
|
|
18
|
+
|
|
19
|
+
## Changed
|
|
20
|
+
|
|
21
|
+
- Nothing for existing code. v10 is unchanged and has no videos.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Migration: 2.32.0 to 2.33.0
|
|
2
|
+
|
|
3
|
+
No changes required. Existing v9 and v10 code keeps working, and v10 is unchanged. Follow
|
|
4
|
+
steps 2 and 3 only to show videos on a v9 site.
|
|
5
|
+
|
|
6
|
+
## 1. Upgrade
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
pnpm add @v-office/website-sdk@2.33.0
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## 2. Load the videos (v9 only)
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
if (sdk.backend === "v9") {
|
|
16
|
+
const videos = await sdk.static.videos.getVideos({ placement: "object", rentalId: rental.id });
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
An empty list is normal. Do not show `fileName` to visitors. See `videos.md` for placements and
|
|
21
|
+
the data shape.
|
|
22
|
+
|
|
23
|
+
## 3. Play the stream
|
|
24
|
+
|
|
25
|
+
Add `hls.js` as an exactly pinned dependency and attach `hlsUrl` as described in `videos.md`.
|