@v-office/website-sdk 2.31.1 → 2.32.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 +2 -2
- package/dist/{client-RLKoee2Y.mjs → client-mC56Qyoy.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/instructions/CHANGELOG.md +1 -0
- package/dist/instructions/MIGRATION.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/{rentals-DEJNTkpJ.mjs → rentals-Ov8pd9qV.mjs} +2 -2
- package/dist/{search-yXF_xFrg.mjs → search-BQgxTBHd.mjs} +2 -2
- package/dist/{to-rental-highlights-CIz0CxcP.mjs → to-rental-highlights-Dbnm6Y4_.mjs} +98 -22
- package/instructions/CHANGELOG.md +1 -0
- package/instructions/MIGRATION.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/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $t as V9_HUB_FACILITY_SEARCH_FILTER_KEY, Jt as defineWebsiteSDKOptions, Qt as V9_HUB_FACILITY_SCOPE_FILTER_KEY, Xt as defineV9PropertyHighlightSourcesFromUnknown, _ as rental_attributes_default$1, an as V9_HUB_RENTAL_IDS_FILTER_KEY, cn as stable_filters_default, en as V9_HUB_OBJECT_GROUP_FILTER_KEY, f as makeV9GraphQLClient, h as makeV0OpenApiClientFetchLive, i as toV9SdkOwnedHubFilterKeys, in as V9_HUB_REGION_FILTER_KEY, n as checkV9HubFilters, nn as V9_HUB_OFFERS_FILTER_KEY, on as V9_HUB_UNIT_TYPE_FILTER_KEY, p as V0OpenApiClient, r as toV9RequiredHubFilterKeys, rn as V9_HUB_OFFER_FILTER_KEY, sn as V9_SDK_OWNED_HUB_FILTER_KEYS, t as createWebsiteSDK, tn as V9_HUB_OBJECT_GROUP_SCOPE_FILTER_KEY, v as rental_attributes_default } from "./client-
|
|
2
|
+
import { $t as V9_HUB_FACILITY_SEARCH_FILTER_KEY, Jt as defineWebsiteSDKOptions, Qt as V9_HUB_FACILITY_SCOPE_FILTER_KEY, Xt as defineV9PropertyHighlightSourcesFromUnknown, _ as rental_attributes_default$1, an as V9_HUB_RENTAL_IDS_FILTER_KEY, cn as stable_filters_default, en as V9_HUB_OBJECT_GROUP_FILTER_KEY, f as makeV9GraphQLClient, h as makeV0OpenApiClientFetchLive, i as toV9SdkOwnedHubFilterKeys, in as V9_HUB_REGION_FILTER_KEY, n as checkV9HubFilters, nn as V9_HUB_OFFERS_FILTER_KEY, on as V9_HUB_UNIT_TYPE_FILTER_KEY, p as V0OpenApiClient, r as toV9RequiredHubFilterKeys, rn as V9_HUB_OFFER_FILTER_KEY, sn as V9_SDK_OWNED_HUB_FILTER_KEYS, t as createWebsiteSDK, tn as V9_HUB_OBJECT_GROUP_SCOPE_FILTER_KEY, v as rental_attributes_default } from "./client-mC56Qyoy.mjs";
|
|
3
3
|
import { a as hubRentalDataQuery, g as parseJsonData, i as hubFiltersQuery, m as VofficeUnitDataPropertyMetadata, u as rentalsAllWithoutFeedbacksQuery, y as parseVofficeRatingData } from "./operations-CUWcmNGK.mjs";
|
|
4
4
|
import { STABLE_SEARCH_INPUTS, SearchSearchSortSchema, defineCustomAttributesFromUnknown, toStableSearchInputQueryKeys } from "@v-office/sdk-core";
|
|
5
5
|
import { ByteSize, Console, Effect, FileSystem, Layer, Option, Path, Schema, Stdio, Terminal } from "effect";
|
|
@@ -17,7 +17,7 @@ var CLICheckFailed = class extends Error {
|
|
|
17
17
|
const toCLIError = (message, cause) => cause instanceof Error ? new CLICheckFailed(`${message}: ${cause.message}`, { cause }) : new CLICheckFailed(message, { cause });
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region package.json
|
|
20
|
-
var version = "2.
|
|
20
|
+
var version = "2.32.0";
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region src/cli/output.ts
|
|
23
23
|
const toJson = (value) => Effect.try({
|
|
@@ -6071,7 +6071,7 @@ const parseV9SearchCursor = (cursor) => Effect.gen(function* () {
|
|
|
6071
6071
|
return page;
|
|
6072
6072
|
});
|
|
6073
6073
|
const loadV9SearchRuntime = Effect.tryPromise({
|
|
6074
|
-
try: () => import("./search-
|
|
6074
|
+
try: () => import("./search-BQgxTBHd.mjs"),
|
|
6075
6075
|
catch: (cause) => new CoreSDKError({
|
|
6076
6076
|
source: "v9",
|
|
6077
6077
|
operation: "v9.search.runtime",
|
|
@@ -6820,7 +6820,7 @@ const orderRentalsById = ({ rentalIds, rentals, missing }) => {
|
|
|
6820
6820
|
});
|
|
6821
6821
|
};
|
|
6822
6822
|
const loadV9RentalsRuntime = Effect.tryPromise({
|
|
6823
|
-
try: () => import("./rentals-
|
|
6823
|
+
try: () => import("./rentals-Ov8pd9qV.mjs"),
|
|
6824
6824
|
catch: (cause) => new CoreSDKError({
|
|
6825
6825
|
source: "v9",
|
|
6826
6826
|
operation: "v9.rentals.runtime",
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as QuoteSchema, A as DocumentResourceSchema, At as clearAdditionalServicesEffect, B as ErgoPersonSchema, Bt as removeAdditionalServiceEffect, C as ApiEnvelopeBaseSchema, Ct as V1_BASE_URL, D as CustomerUnitSummarySchema, Dt as addAdditionalServiceEffect, E as CurrentMemberResponseSchema, Et as decodeV1OperationResponse, F as ErgoAddressSchema, Ft as getRentalsEffect, G as FacilityListResponseSchema, Gt as submitContactEffect, H as ErgoPolicyNumberRequestSchema, Ht as selectCancellationPolicyEffect, I as ErgoBankSchema, It as getStartDateSelectedAvailabilityEffect, J as PaymentScheduleItemSchema, Jt as defineWebsiteSDKOptions, K as OnOfficeUnitCollectionResponseSchema, Kt as submitPaymentOption, L as ErgoBookRequestSchema, Lt as getTermsAndPrivacyPolicyEffect, M as DocumentStatusUpdateRequestSchema, Mt as getBankTransferDetailsEffect, N as DocumentSummarySchema, Nt as getFiltersEffect, O as DocumentCollectionResponseSchema, Ot as bookEffect, P as DocumentTypeSchema, Pt as getInitialAvailabilityEffect, Q as QuotePricesResponseSchema, R as ErgoCommonFieldsSchema, Rt as mapSearchEffect, S as makeV1OpenApiClientLive, St as UnitServicePriceSchema, T as CalendarResponseSchema, Tt as VideoResponseSchema, U as ErgoReadPreContractRequestSchema, Ut as selectInsuranceEffect, V as ErgoPlanSearchRequestSchema, Vt as searchEffect, W as ErgoTripAndCustomerRequestSchema, Wt as selectInsurancePaymentEffect, X as QuoteLineSchema, Xt as defineV9PropertyHighlightSourcesFromUnknown, Y as PaymentScheduleSchema, Yt as defineV9PropertyHighlightSources, Z as QuotePricesPayloadSchema, _t as UnitIdsResponseSchema, at as SearchPropertiesResponseSchema, b as V1OpenApiClientError, bt as UnitOfferSchema, ct as ServiceLimitSchema, dt as SetupResponseSchema, et as QuoteServiceSchema, ft as TileCollectionResponseSchema, g as makeV0OpenApiClientLive, gt as TravelInsuranceBookingStoreRequestSchema, h as makeV0OpenApiClientFetchLive, ht as TravelInsuranceBookingSchema, it as RoomImageSchema, j as DocumentStatusSchema, jt as createInsurancePreContractEffect, k as DocumentResourceResponseSchema, kt as bookInsuranceEffect, lt as ServiceListResponseSchema, m as V0OpenApiClientError, mt as TileTagSchema, nt as RawVofficeObjectSchema, ot as ServiceBeonDataSchema, p as V0OpenApiClient, pt as TileSchema, q as OnOfficeUnitSchema, qt as submitPaymentOptionEffect, rt as RegionListResponseSchema, st as ServiceImageSchema, t as createWebsiteSDK, tt as RawObjectResponseSchema, ut as SetupDataSchema, vt as UnitListItemSchema, w as CalendarDaySchema, wt as V1_OPERATIONS, x as makeV1OpenApiClientFetchLive, xt as UnitResponseSchema, y as V1OpenApiClient, yt as UnitListResponseSchema, z as ErgoCreatePreContractRequestSchema, zt as quoteEffect } from "./client-
|
|
1
|
+
import { $ as QuoteSchema, A as DocumentResourceSchema, At as clearAdditionalServicesEffect, B as ErgoPersonSchema, Bt as removeAdditionalServiceEffect, C as ApiEnvelopeBaseSchema, Ct as V1_BASE_URL, D as CustomerUnitSummarySchema, Dt as addAdditionalServiceEffect, E as CurrentMemberResponseSchema, Et as decodeV1OperationResponse, F as ErgoAddressSchema, Ft as getRentalsEffect, G as FacilityListResponseSchema, Gt as submitContactEffect, H as ErgoPolicyNumberRequestSchema, Ht as selectCancellationPolicyEffect, I as ErgoBankSchema, It as getStartDateSelectedAvailabilityEffect, J as PaymentScheduleItemSchema, Jt as defineWebsiteSDKOptions, K as OnOfficeUnitCollectionResponseSchema, Kt as submitPaymentOption, L as ErgoBookRequestSchema, Lt as getTermsAndPrivacyPolicyEffect, M as DocumentStatusUpdateRequestSchema, Mt as getBankTransferDetailsEffect, N as DocumentSummarySchema, Nt as getFiltersEffect, O as DocumentCollectionResponseSchema, Ot as bookEffect, P as DocumentTypeSchema, Pt as getInitialAvailabilityEffect, Q as QuotePricesResponseSchema, R as ErgoCommonFieldsSchema, Rt as mapSearchEffect, S as makeV1OpenApiClientLive, St as UnitServicePriceSchema, T as CalendarResponseSchema, Tt as VideoResponseSchema, U as ErgoReadPreContractRequestSchema, Ut as selectInsuranceEffect, V as ErgoPlanSearchRequestSchema, Vt as searchEffect, W as ErgoTripAndCustomerRequestSchema, Wt as selectInsurancePaymentEffect, X as QuoteLineSchema, Xt as defineV9PropertyHighlightSourcesFromUnknown, Y as PaymentScheduleSchema, Yt as defineV9PropertyHighlightSources, Z as QuotePricesPayloadSchema, _t as UnitIdsResponseSchema, at as SearchPropertiesResponseSchema, b as V1OpenApiClientError, bt as UnitOfferSchema, ct as ServiceLimitSchema, dt as SetupResponseSchema, et as QuoteServiceSchema, ft as TileCollectionResponseSchema, g as makeV0OpenApiClientLive, gt as TravelInsuranceBookingStoreRequestSchema, h as makeV0OpenApiClientFetchLive, ht as TravelInsuranceBookingSchema, it as RoomImageSchema, j as DocumentStatusSchema, jt as createInsurancePreContractEffect, k as DocumentResourceResponseSchema, kt as bookInsuranceEffect, lt as ServiceListResponseSchema, m as V0OpenApiClientError, mt as TileTagSchema, nt as RawVofficeObjectSchema, ot as ServiceBeonDataSchema, p as V0OpenApiClient, pt as TileSchema, q as OnOfficeUnitSchema, qt as submitPaymentOptionEffect, rt as RegionListResponseSchema, st as ServiceImageSchema, t as createWebsiteSDK, tt as RawObjectResponseSchema, ut as SetupDataSchema, vt as UnitListItemSchema, w as CalendarDaySchema, wt as V1_OPERATIONS, x as makeV1OpenApiClientFetchLive, xt as UnitResponseSchema, y as V1OpenApiClient, yt as UnitListResponseSchema, z as ErgoCreatePreContractRequestSchema, zt as quoteEffect } from "./client-mC56Qyoy.mjs";
|
|
2
2
|
import { AdditionalServiceLimitExceeded, CoreSDKError, CoreSDKError as CMSError, CustomAttributeCatalogSchema, GuestQuoteSchema, InvalidAdditionalServiceQuantity, LocaleSchema, SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS, SearchMapSearchInputSchema, SearchMapSearchOutputSchema, SearchSearchFieldOrderBySchema, SearchSearchFieldSortSchema, SearchSearchInputSchema, SearchSearchOutputSchema, SearchSearchPriceSortSchema, SearchSearchRandomSortSchema, SearchSearchRatingSortSchema, SearchSearchSortSchema, SearchSortDirectionSchema, UnknownAdditionalService, defineCustomAttributes, defineCustomAttributesFromUnknown, fetchCustomAttributeCatalog, parseCustomAttributeCatalog, validateContactSubmitInput } from "@v-office/sdk-core";
|
|
3
3
|
//#region codegen/v9/heuristic-generation/public-api.ts
|
|
4
4
|
const customDataAttribute = (name) => name;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Release notes of `@v-office/website-sdk`, newest first. Each version has its own directory.
|
|
6
6
|
|
|
7
|
+
- `versions/2.32.0/CHANGELOG.md`: release notes for 2.32.0
|
|
7
8
|
- `versions/2.31.1/CHANGELOG.md`: release notes for 2.31.1
|
|
8
9
|
- `versions/2.31.0/CHANGELOG.md`: release notes for 2.31.0
|
|
9
10
|
- `versions/2.30.2/CHANGELOG.md`: release notes for 2.30.2
|
|
@@ -4,6 +4,7 @@
|
|
|
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.32.0/MIGRATION.md`: Migration: 2.31.1 to 2.32.0
|
|
7
8
|
- `versions/2.31.1/MIGRATION.md`: Migration: 2.31.0 to 2.31.1
|
|
8
9
|
- `versions/2.31.0/MIGRATION.md`: Migration: 2.30.2 to 2.31.0
|
|
9
10
|
- `versions/2.30.2/MIGRATION.md`: Migration: 2.30.1 to 2.30.2
|
|
@@ -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.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Zt as V9_FACILITY_ATTRIBUTE_KEYS } from "./client-
|
|
1
|
+
import { Zt as V9_FACILITY_ATTRIBUTE_KEYS } from "./client-mC56Qyoy.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-mC56Qyoy.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,7 @@
|
|
|
4
4
|
|
|
5
5
|
Release notes of `@v-office/website-sdk`, newest first. Each version has its own directory.
|
|
6
6
|
|
|
7
|
+
- `versions/2.32.0/CHANGELOG.md`: release notes for 2.32.0
|
|
7
8
|
- `versions/2.31.1/CHANGELOG.md`: release notes for 2.31.1
|
|
8
9
|
- `versions/2.31.0/CHANGELOG.md`: release notes for 2.31.0
|
|
9
10
|
- `versions/2.30.2/CHANGELOG.md`: release notes for 2.30.2
|
|
@@ -4,6 +4,7 @@
|
|
|
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.32.0/MIGRATION.md`: Migration: 2.31.1 to 2.32.0
|
|
7
8
|
- `versions/2.31.1/MIGRATION.md`: Migration: 2.31.0 to 2.31.1
|
|
8
9
|
- `versions/2.31.0/MIGRATION.md`: Migration: 2.30.2 to 2.31.0
|
|
9
10
|
- `versions/2.30.2/MIGRATION.md`: Migration: 2.30.1 to 2.30.2
|
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.
|