@garagem-ai/site-sdk 0.4.8 → 0.4.11
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/README.md +18 -16
- package/dist/index.d.mts +131 -6
- package/dist/index.d.ts +131 -6
- package/dist/index.js +636 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +621 -4
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +1 -1
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +1 -1
- package/dist/react.mjs.map +1 -1
- package/dist/{search-engine-D4EZkNrQ.d.mts → search-engine-B83s_fVd.d.mts} +21 -2
- package/dist/{search-engine-D4EZkNrQ.d.ts → search-engine-B83s_fVd.d.ts} +21 -2
- package/package.json +1 -1
- package/src/amenity-labels.ts +400 -0
- package/src/index.ts +32 -0
- package/src/listing-detail.ts +357 -0
- package/src/react/styles/search-chrome-css.generated.ts +1 -1
- package/src/studio-contract.ts +16 -3
- package/src/types.ts +20 -1
package/README.md
CHANGED
|
@@ -54,22 +54,24 @@ raw escape hatch when you need full control.
|
|
|
54
54
|
|
|
55
55
|
### Friendly layer (recommended for most use cases)
|
|
56
56
|
|
|
57
|
-
| API | Description
|
|
58
|
-
| ------------------------------------------------------------- |
|
|
59
|
-
| `getListings({ siteId, filters?, next? })` | Paginated listings for a site, with simple `filters` (`city`, `businessType`, `propertyType`, `neighborhood`, `minPrice`, `maxPrice`, `limit`, `offset`)
|
|
60
|
-
| `getListing({ siteId, listingId, next? })` | Full detail of a single listing
|
|
61
|
-
| `getSimilarListings({ siteId, listingId, limit?, next? })` | Similar listings carousel (same card shape as `getListings`)
|
|
62
|
-
| `getSite({ siteId? \| domain?, next? })` | Public site profile (returns `null` if unknown)
|
|
63
|
-
| `getCmsCollections({ siteId })` | List CMS collections
|
|
64
|
-
| `getCmsCollection({ siteId, slug })` | One CMS collection schema
|
|
65
|
-
| `getCmsEntries({ siteId, collection, limit?, offset? })` | Published CMS entries only
|
|
66
|
-
| `getCmsEntry({ siteId, collection, slug })` | One published CMS entry
|
|
67
|
-
| `getSearchUi({ siteId, next? })` | Tenant search schema (filters, slugs)
|
|
68
|
-
| `getLeadUi({ siteId, next? })` | Visit-default lead dialog schema (weekday hours, Sat/Sun flags)
|
|
69
|
-
| `submitVisitLead({ siteId, listingId, … })` | POST a visit lead (`listing.id` UUID; civil `visitDate` or `Date`/ISO instant normalized in the schedule timezone)
|
|
70
|
-
| `submitContactLead({ siteId, listingId, … })` | POST a contact lead (no date/time)
|
|
71
|
-
| `slotsForDate` / `normalizeVisitDate` / `expandVisitSchedule` | Pure schedule helpers (`America/Sao_Paulo`, default Mon–Fri 06:00–22:00)
|
|
72
|
-
| `
|
|
57
|
+
| API | Description |
|
|
58
|
+
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
59
|
+
| `getListings({ siteId, filters?, next? })` | Paginated listings for a site, with simple `filters` (`city`, `businessType`, `propertyType`, `neighborhood`, `minPrice`, `maxPrice`, `limit`, `offset`) |
|
|
60
|
+
| `getListing({ siteId, listingId, next? })` | Full detail of a single listing |
|
|
61
|
+
| `getSimilarListings({ siteId, listingId, limit?, next? })` | Similar listings carousel (same card shape as `getListings`) |
|
|
62
|
+
| `getSite({ siteId? \| domain?, next? })` | Public site profile (returns `null` if unknown) |
|
|
63
|
+
| `getCmsCollections({ siteId })` | List CMS collections |
|
|
64
|
+
| `getCmsCollection({ siteId, slug })` | One CMS collection schema |
|
|
65
|
+
| `getCmsEntries({ siteId, collection, limit?, offset? })` | Published CMS entries only |
|
|
66
|
+
| `getCmsEntry({ siteId, collection, slug })` | One published CMS entry |
|
|
67
|
+
| `getSearchUi({ siteId, next? })` | Tenant search schema (filters, slugs) |
|
|
68
|
+
| `getLeadUi({ siteId, next? })` | Visit-default lead dialog schema (weekday hours, Sat/Sun flags) |
|
|
69
|
+
| `submitVisitLead({ siteId, listingId, … })` | POST a visit lead (`listing.id` UUID; civil `visitDate` or `Date`/ISO instant normalized in the schedule timezone) |
|
|
70
|
+
| `submitContactLead({ siteId, listingId, … })` | POST a contact lead (no date/time) |
|
|
71
|
+
| `slotsForDate` / `normalizeVisitDate` / `expandVisitSchedule` | Pure schedule helpers (`America/Sao_Paulo`, default Mon–Fri 06:00–22:00) |
|
|
72
|
+
| `listingDetailModel(listing)` | Listing-detail blocks: breadcrumb, values (price / condo / IPTU), facts (skip empty zeros), location + Maps href, description clamp, video/tour overlays. |
|
|
73
|
+
| `listingAmenityGroups(listing, dictionary?)` | Unit / building amenity labels (`Comodidades`, `Comodidades do condomínio`). Reads `propertyFeatures` + `buildingAmenities` (works when `building` is null). Tenant `getSearchUi().dictionary` first, then the SDK fallback; unlabeled ids are dropped. |
|
|
74
|
+
| `resolvePublicSiteId({ host?, fallback? })` | Preview uses `fallback` (`GARAGEM_SITE_ID`); live hosts resolve via `getSite({ domain })` |
|
|
73
75
|
|
|
74
76
|
### Advanced layer (when the friendly one isn't enough)
|
|
75
77
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RequestNextOptions, L as ListingFilters, Q as QueryListingsParams, S as SearchListingsParams, C as CmsCollection, a as CmsEntriesResult, b as CmsEntry, c as ListingDetail, d as ListingsResult, e as SearchUi, f as SimilarListingsResult, g as Site, h as QueryListingsResult, i as SearchListingsResult, j as
|
|
2
|
-
export {
|
|
1
|
+
import { R as RequestNextOptions, L as ListingFilters, Q as QueryListingsParams, S as SearchListingsParams, C as CmsCollection, a as CmsEntriesResult, b as CmsEntry, c as ListingDetail, d as ListingsResult, e as SearchUi, f as SimilarListingsResult, g as Site, h as QueryListingsResult, i as SearchListingsResult, j as ListingLocation, k as ListingMedia, l as SearchPathFilters, m as SearchUiDictionary, n as QueryListingsFilters, A as AppliedSearchQuery, o as AppliedSearchChange } from './search-engine-B83s_fVd.mjs';
|
|
2
|
+
export { p as CmsEntryStatus, q as CmsFieldDefinition, r as CmsFieldType, s as CmsSeoData, F as FORBIDDEN_SEARCH_QUERY_KEYS, t as Listing, u as ListingBusinessType, v as ListingCardModel, w as ListingPriceVisibility, x as ListingPropertySummary, y as LocationNameTables, z as QueryListingsLocation, B as SEARCH_SORT_RELEVANCE, D as SearchPathLocation, E as SearchUiFilter, G as SearchUiOption, T as TOOLBAR_PRIMARY_FILTER_IDS, H as applyPathFilter, I as buildQueryListingsParams, J as canonicalizeSearchHref, K as clearStagedPathFilters, M as countFacetChoices, N as countOptionLabel, O as displayPathLocation, P as hrefForAppliedChange, U as hrefForPathFilters, V as hrefWithExplicitPage, W as isListingDetailPath, X as listingLocationLabel, Y as paginationPages, Z as pathFilterHasOption, _ as pathFilterValue, $ as publicSearchHref, a0 as readPublicSearch, a1 as searchHrefUsesLegacyFilterQuery, a2 as searchResultsHeading, a3 as searchSortOptions, a4 as toListingCardModel, a5 as toolbarFilterIds, a6 as visibleSearchFilters } from './search-engine-B83s_fVd.mjs';
|
|
3
3
|
|
|
4
4
|
/** Custom fetch implementation. Defaults to the global `fetch`. */
|
|
5
5
|
type FetchLike = typeof fetch;
|
|
@@ -258,6 +258,48 @@ declare function getLeadUi(options: GetLeadUiOptions): Promise<LeadUi>;
|
|
|
258
258
|
declare function submitVisitLead(input: VisitLeadInput): Promise<LeadSubmitResult>;
|
|
259
259
|
declare function submitContactLead(input: ContactLeadInput): Promise<LeadSubmitResult>;
|
|
260
260
|
|
|
261
|
+
/**
|
|
262
|
+
* Portuguese labels for listing amenity ids. Tenant search-ui dictionary
|
|
263
|
+
* wins; this map is the default-catalog fallback so generated Studio pages
|
|
264
|
+
* never print camelCase keys.
|
|
265
|
+
*/
|
|
266
|
+
declare const LISTING_AMENITY_TITLES: {
|
|
267
|
+
readonly unit: "Comodidades";
|
|
268
|
+
readonly building: "Comodidades do condomínio";
|
|
269
|
+
};
|
|
270
|
+
type AmenityLabelOption = {
|
|
271
|
+
id: string;
|
|
272
|
+
label: string;
|
|
273
|
+
};
|
|
274
|
+
type AmenityLabelDictionary = {
|
|
275
|
+
propertyFeatures?: AmenityLabelOption[];
|
|
276
|
+
buildingAmenities?: AmenityLabelOption[];
|
|
277
|
+
};
|
|
278
|
+
type ListingAmenityGroupKey = keyof typeof LISTING_AMENITY_TITLES;
|
|
279
|
+
type ListingAmenityGroup = {
|
|
280
|
+
key: ListingAmenityGroupKey;
|
|
281
|
+
title: string;
|
|
282
|
+
labels: string[];
|
|
283
|
+
};
|
|
284
|
+
type ListingAmenitySource = {
|
|
285
|
+
amenities?: string[] | null;
|
|
286
|
+
propertyFeatures?: string[] | null;
|
|
287
|
+
/** Condo amenity ids, even when `building` is null (no buildingId). */
|
|
288
|
+
buildingAmenities?: string[] | null;
|
|
289
|
+
building?: {
|
|
290
|
+
amenities?: string[] | null;
|
|
291
|
+
} | null;
|
|
292
|
+
};
|
|
293
|
+
/**
|
|
294
|
+
* Default tenant ids + canonical `has*` / `is*` keys seen on public listings.
|
|
295
|
+
* Aligned with DEFAULT_PROPERTY_FEATURES and DEFAULT_BUILDING_FEATURES from
|
|
296
|
+
* Foundation's field-definitions.ts so generated Studio pages never need a
|
|
297
|
+
* dictionary for standard amenities.
|
|
298
|
+
*/
|
|
299
|
+
declare const AMENITY_FALLBACK_LABELS: Record<string, string>;
|
|
300
|
+
declare function labelAmenities(ids: readonly string[] | null | undefined, dictionary?: AmenityLabelOption[]): string[];
|
|
301
|
+
declare function listingAmenityGroups(listing: ListingAmenitySource, dictionary?: AmenityLabelDictionary): ListingAmenityGroup[];
|
|
302
|
+
|
|
261
303
|
/** Public listing URLs. Prefer `listing.path` from the API; fallback is `/imoveis/id-{listingCode}`. */
|
|
262
304
|
declare function listingLookupKey(raw: string): string;
|
|
263
305
|
declare function listingPublicPath(listing: {
|
|
@@ -266,6 +308,84 @@ declare function listingPublicPath(listing: {
|
|
|
266
308
|
id?: string | null;
|
|
267
309
|
}): string;
|
|
268
310
|
|
|
311
|
+
declare const LISTING_DESCRIPTION_CLAMP = 280;
|
|
312
|
+
type ListingFact = {
|
|
313
|
+
key: string;
|
|
314
|
+
label: string;
|
|
315
|
+
text: string;
|
|
316
|
+
};
|
|
317
|
+
type ListingValue = {
|
|
318
|
+
key: string;
|
|
319
|
+
label: string;
|
|
320
|
+
text: string;
|
|
321
|
+
};
|
|
322
|
+
type ListingBreadcrumbCrumb = {
|
|
323
|
+
label: string;
|
|
324
|
+
href: string;
|
|
325
|
+
};
|
|
326
|
+
type ListingLocationBlock = {
|
|
327
|
+
label: string;
|
|
328
|
+
mapsHref: string | null;
|
|
329
|
+
};
|
|
330
|
+
type ListingDescriptionPreview = {
|
|
331
|
+
text: string;
|
|
332
|
+
truncated: boolean;
|
|
333
|
+
toggleLabel: string | null;
|
|
334
|
+
};
|
|
335
|
+
type ListingMediaOverlay = {
|
|
336
|
+
key: "video" | "tour";
|
|
337
|
+
hash: "video" | "tour";
|
|
338
|
+
title: string;
|
|
339
|
+
href: string;
|
|
340
|
+
embedSrc: string;
|
|
341
|
+
};
|
|
342
|
+
declare function listingValues(listing: {
|
|
343
|
+
price?: number | null;
|
|
344
|
+
priceVisibility?: string | null;
|
|
345
|
+
property?: {
|
|
346
|
+
condoFee?: number | null;
|
|
347
|
+
propertyTax?: number | null;
|
|
348
|
+
} | null;
|
|
349
|
+
}): ListingValue[];
|
|
350
|
+
declare function listingFacts(listing: {
|
|
351
|
+
property?: {
|
|
352
|
+
totalArea?: number | null;
|
|
353
|
+
usableArea?: number | null;
|
|
354
|
+
bedrooms?: number | null;
|
|
355
|
+
suites?: number | null;
|
|
356
|
+
parkingSpaces?: number | null;
|
|
357
|
+
rooms?: number | null;
|
|
358
|
+
floor?: number | string | null;
|
|
359
|
+
} | null;
|
|
360
|
+
}): ListingFact[];
|
|
361
|
+
declare function listingMapsHref(location: ListingLocation | null | undefined): string | null;
|
|
362
|
+
declare function listingLocationBlock(listing: {
|
|
363
|
+
location?: ListingLocation | null;
|
|
364
|
+
} | null | undefined): ListingLocationBlock | null;
|
|
365
|
+
declare function listingBreadcrumb(listing: {
|
|
366
|
+
path?: string | null;
|
|
367
|
+
listingCode?: string | null;
|
|
368
|
+
id?: string | null;
|
|
369
|
+
}): ListingBreadcrumbCrumb[];
|
|
370
|
+
declare function listingDescriptionPreview(description: string | null | undefined, expanded?: boolean): ListingDescriptionPreview | null;
|
|
371
|
+
declare function listingMediaOverlays(listing: {
|
|
372
|
+
media?: ListingMedia[] | null;
|
|
373
|
+
}): ListingMediaOverlay[];
|
|
374
|
+
declare function listingDetailModel(listing: Pick<ListingDetail, "id" | "listingCode" | "path" | "price" | "priceVisibility" | "description"> & {
|
|
375
|
+
property?: ListingDetail["property"] | null;
|
|
376
|
+
location?: ListingLocation | null;
|
|
377
|
+
media?: ListingMedia[] | null;
|
|
378
|
+
}, options?: {
|
|
379
|
+
descriptionExpanded?: boolean;
|
|
380
|
+
}): {
|
|
381
|
+
breadcrumb: ListingBreadcrumbCrumb[];
|
|
382
|
+
values: ListingValue[];
|
|
383
|
+
facts: ListingFact[];
|
|
384
|
+
location: ListingLocationBlock | null;
|
|
385
|
+
description: ListingDescriptionPreview | null;
|
|
386
|
+
mediaOverlays: ListingMediaOverlay[];
|
|
387
|
+
};
|
|
388
|
+
|
|
269
389
|
/**
|
|
270
390
|
* Presentation helpers with no UI framework.
|
|
271
391
|
* React / React Native / Flutter adapters consume these formatters and
|
|
@@ -359,10 +479,11 @@ declare const STUDIO_SDK_CONTRACT: {
|
|
|
359
479
|
/**
|
|
360
480
|
* Exact pin for generated Studio sites. Must be ≥ `selfInjectSince` so
|
|
361
481
|
* prompts that skip the layout chrome tag match the tarball v0 installs.
|
|
362
|
-
* 0.4.
|
|
363
|
-
*
|
|
482
|
+
* 0.4.9 adds listingDetailModel (values, facts, location, breadcrumb,
|
|
483
|
+
* description clamp, video/tour), getSimilarListings, and
|
|
484
|
+
* listingAmenityGroups so listing detail never prints amenity ids.
|
|
364
485
|
*/
|
|
365
|
-
readonly minNpmVersion: "0.4.
|
|
486
|
+
readonly minNpmVersion: "0.4.9";
|
|
366
487
|
/** First release where ListingCard and ResultsSkeleton inject the sheet. */
|
|
367
488
|
readonly selfInjectSince: "0.4.2";
|
|
368
489
|
readonly chromeStrategy: "self-inject";
|
|
@@ -381,6 +502,8 @@ declare const STUDIO_SDK_CONTRACT: {
|
|
|
381
502
|
readonly forbiddenImports: readonly ["@garagem-ai/site-sdk/react/search.css"];
|
|
382
503
|
readonly leadStrategy: "visit-default";
|
|
383
504
|
readonly leadExports: readonly ["getLeadUi", "submitVisitLead", "submitContactLead", "slotsForDate", "expandVisitSchedule", "expandVisitTimeSlots", "isVisitSlotAllowed", "STUDIO_DEFAULT_VISIT_SCHEDULE"];
|
|
505
|
+
readonly listingDetailExports: readonly ["listingDetailModel", "getSimilarListings"];
|
|
506
|
+
readonly amenityExports: readonly ["listingAmenityGroups"];
|
|
384
507
|
};
|
|
385
508
|
type StudioSdkContract = typeof STUDIO_SDK_CONTRACT;
|
|
386
509
|
/**
|
|
@@ -409,6 +532,8 @@ declare function parseReactSdkNamedImports(source: string): string[];
|
|
|
409
532
|
declare function unavailableReactImports(source: string, pin: string): string[];
|
|
410
533
|
declare function studioSdkPinInstruction(): string;
|
|
411
534
|
declare function studioLeadInstruction(): string;
|
|
535
|
+
declare function studioListingDetailInstruction(): string;
|
|
536
|
+
declare function studioAmenityInstruction(): string;
|
|
412
537
|
declare function studioChromeInstruction(): string;
|
|
413
538
|
/**
|
|
414
539
|
* Tokens that must not appear in Studio codegen (prompts, recipes, repair).
|
|
@@ -524,4 +649,4 @@ interface GaragemClient {
|
|
|
524
649
|
*/
|
|
525
650
|
declare function createGaragemClient(options?: CreateGaragemClientOptions): GaragemClient;
|
|
526
651
|
|
|
527
|
-
export { AppliedSearchChange, AppliedSearchQuery, CmsCollection, CmsEntriesResult, CmsEntry, type ContactLeadInput, type CreateGaragemClientOptions, type FetchLike, type GaragemClient, GaragemSdkError, type GetCmsCollectionOptions, type GetCmsCollectionsOptions, type GetCmsEntriesOptions, type GetCmsEntryOptions, type GetLeadUiOptions, type GetListingOptions, type GetListingsOptions, type GetSearchUiOptions, type GetSimilarListingsOptions, type GetSiteOptions, type HHmm, type LeadContact, type LeadField, type LeadFieldId, LeadSubmitError, type LeadSubmitErrorCode, type LeadSubmitResult, type LeadUi, ListingDetail, ListingFilters, ListingsResult, type LocationFilterInput, QueryListingsFilters, type QueryListingsOptions, QueryListingsParams, QueryListingsResult, RequestNextOptions, type ResolvePublicSiteIdOptions, SEARCH_CSS_RECIPE, SEARCH_CSS_VARS, STUDIO_DEFAULT_VISIT_SCHEDULE, STUDIO_SDK_CONTRACT, STUDIO_SDK_PACKAGE, STUDIO_SITE_LAYOUT, type SearchListingsOptions, SearchListingsParams, SearchListingsResult, SearchPathFilters, SearchUi, SearchUiDictionary, SimilarListingsResult, Site, type StudioSdkContract, VISIT_TIME_ZONE, type VisitHours, type VisitLeadInput, type VisitSchedule, type VisitScheduleConfig, coerceNpmVersion, compareSemver, composeSearchPublicHref, composeSearchPublicPath, createGaragemClient, expandVisitSchedule, expandVisitTimeSlots, formatAreaM2, formatGroupedInteger, formatListingPrice, getCmsCollection, getCmsCollections, getCmsEntries, getCmsEntry, getLeadUi, getListing, getListings, getSearchUi, getSimilarListings, getSite, hasShowcaseLeadsPostUrl, isStudioPreviewHost, isVisitSlotAllowed, listingBusinessLabel, listingLookupKey, listingPublicPath, mergeAppliedSearchQueryIntoSearch, normalizeVisitDate, normalizeVisitTime, parseAppliedSearchQuery, parseGroupedInteger, parseReactSdkNamedImports, parseSearchPublicPath, pathFiltersToQueryFilters, pathLocationToFilterInput, queryListings, reduceAppliedSearchQuery, resolvePublicSiteId, searchListings, serializeAppliedSearchQuery, slotsForDate, studioChromeInstruction, studioCodegenContractViolations, studioDefaultLeadUi, studioLayoutInstruction, studioLeadInstruction, studioSdkPinInstruction, studioSearchLandmarkInstruction, studioSiteWidthCss, submitContactLead, submitVisitLead, unavailableReactImports };
|
|
652
|
+
export { AMENITY_FALLBACK_LABELS, type AmenityLabelDictionary, type AmenityLabelOption, AppliedSearchChange, AppliedSearchQuery, CmsCollection, CmsEntriesResult, CmsEntry, type ContactLeadInput, type CreateGaragemClientOptions, type FetchLike, type GaragemClient, GaragemSdkError, type GetCmsCollectionOptions, type GetCmsCollectionsOptions, type GetCmsEntriesOptions, type GetCmsEntryOptions, type GetLeadUiOptions, type GetListingOptions, type GetListingsOptions, type GetSearchUiOptions, type GetSimilarListingsOptions, type GetSiteOptions, type HHmm, LISTING_AMENITY_TITLES, LISTING_DESCRIPTION_CLAMP, type LeadContact, type LeadField, type LeadFieldId, LeadSubmitError, type LeadSubmitErrorCode, type LeadSubmitResult, type LeadUi, type ListingAmenityGroup, type ListingAmenityGroupKey, type ListingAmenitySource, type ListingBreadcrumbCrumb, type ListingDescriptionPreview, ListingDetail, type ListingFact, ListingFilters, ListingLocation, type ListingLocationBlock, ListingMedia, type ListingMediaOverlay, type ListingValue, ListingsResult, type LocationFilterInput, QueryListingsFilters, type QueryListingsOptions, QueryListingsParams, QueryListingsResult, RequestNextOptions, type ResolvePublicSiteIdOptions, SEARCH_CSS_RECIPE, SEARCH_CSS_VARS, STUDIO_DEFAULT_VISIT_SCHEDULE, STUDIO_SDK_CONTRACT, STUDIO_SDK_PACKAGE, STUDIO_SITE_LAYOUT, type SearchListingsOptions, SearchListingsParams, SearchListingsResult, SearchPathFilters, SearchUi, SearchUiDictionary, SimilarListingsResult, Site, type StudioSdkContract, VISIT_TIME_ZONE, type VisitHours, type VisitLeadInput, type VisitSchedule, type VisitScheduleConfig, coerceNpmVersion, compareSemver, composeSearchPublicHref, composeSearchPublicPath, createGaragemClient, expandVisitSchedule, expandVisitTimeSlots, formatAreaM2, formatGroupedInteger, formatListingPrice, getCmsCollection, getCmsCollections, getCmsEntries, getCmsEntry, getLeadUi, getListing, getListings, getSearchUi, getSimilarListings, getSite, hasShowcaseLeadsPostUrl, isStudioPreviewHost, isVisitSlotAllowed, labelAmenities, listingAmenityGroups, listingBreadcrumb, listingBusinessLabel, listingDescriptionPreview, listingDetailModel, listingFacts, listingLocationBlock, listingLookupKey, listingMapsHref, listingMediaOverlays, listingPublicPath, listingValues, mergeAppliedSearchQueryIntoSearch, normalizeVisitDate, normalizeVisitTime, parseAppliedSearchQuery, parseGroupedInteger, parseReactSdkNamedImports, parseSearchPublicPath, pathFiltersToQueryFilters, pathLocationToFilterInput, queryListings, reduceAppliedSearchQuery, resolvePublicSiteId, searchListings, serializeAppliedSearchQuery, slotsForDate, studioAmenityInstruction, studioChromeInstruction, studioCodegenContractViolations, studioDefaultLeadUi, studioLayoutInstruction, studioLeadInstruction, studioListingDetailInstruction, studioSdkPinInstruction, studioSearchLandmarkInstruction, studioSiteWidthCss, submitContactLead, submitVisitLead, unavailableReactImports };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RequestNextOptions, L as ListingFilters, Q as QueryListingsParams, S as SearchListingsParams, C as CmsCollection, a as CmsEntriesResult, b as CmsEntry, c as ListingDetail, d as ListingsResult, e as SearchUi, f as SimilarListingsResult, g as Site, h as QueryListingsResult, i as SearchListingsResult, j as
|
|
2
|
-
export {
|
|
1
|
+
import { R as RequestNextOptions, L as ListingFilters, Q as QueryListingsParams, S as SearchListingsParams, C as CmsCollection, a as CmsEntriesResult, b as CmsEntry, c as ListingDetail, d as ListingsResult, e as SearchUi, f as SimilarListingsResult, g as Site, h as QueryListingsResult, i as SearchListingsResult, j as ListingLocation, k as ListingMedia, l as SearchPathFilters, m as SearchUiDictionary, n as QueryListingsFilters, A as AppliedSearchQuery, o as AppliedSearchChange } from './search-engine-B83s_fVd.js';
|
|
2
|
+
export { p as CmsEntryStatus, q as CmsFieldDefinition, r as CmsFieldType, s as CmsSeoData, F as FORBIDDEN_SEARCH_QUERY_KEYS, t as Listing, u as ListingBusinessType, v as ListingCardModel, w as ListingPriceVisibility, x as ListingPropertySummary, y as LocationNameTables, z as QueryListingsLocation, B as SEARCH_SORT_RELEVANCE, D as SearchPathLocation, E as SearchUiFilter, G as SearchUiOption, T as TOOLBAR_PRIMARY_FILTER_IDS, H as applyPathFilter, I as buildQueryListingsParams, J as canonicalizeSearchHref, K as clearStagedPathFilters, M as countFacetChoices, N as countOptionLabel, O as displayPathLocation, P as hrefForAppliedChange, U as hrefForPathFilters, V as hrefWithExplicitPage, W as isListingDetailPath, X as listingLocationLabel, Y as paginationPages, Z as pathFilterHasOption, _ as pathFilterValue, $ as publicSearchHref, a0 as readPublicSearch, a1 as searchHrefUsesLegacyFilterQuery, a2 as searchResultsHeading, a3 as searchSortOptions, a4 as toListingCardModel, a5 as toolbarFilterIds, a6 as visibleSearchFilters } from './search-engine-B83s_fVd.js';
|
|
3
3
|
|
|
4
4
|
/** Custom fetch implementation. Defaults to the global `fetch`. */
|
|
5
5
|
type FetchLike = typeof fetch;
|
|
@@ -258,6 +258,48 @@ declare function getLeadUi(options: GetLeadUiOptions): Promise<LeadUi>;
|
|
|
258
258
|
declare function submitVisitLead(input: VisitLeadInput): Promise<LeadSubmitResult>;
|
|
259
259
|
declare function submitContactLead(input: ContactLeadInput): Promise<LeadSubmitResult>;
|
|
260
260
|
|
|
261
|
+
/**
|
|
262
|
+
* Portuguese labels for listing amenity ids. Tenant search-ui dictionary
|
|
263
|
+
* wins; this map is the default-catalog fallback so generated Studio pages
|
|
264
|
+
* never print camelCase keys.
|
|
265
|
+
*/
|
|
266
|
+
declare const LISTING_AMENITY_TITLES: {
|
|
267
|
+
readonly unit: "Comodidades";
|
|
268
|
+
readonly building: "Comodidades do condomínio";
|
|
269
|
+
};
|
|
270
|
+
type AmenityLabelOption = {
|
|
271
|
+
id: string;
|
|
272
|
+
label: string;
|
|
273
|
+
};
|
|
274
|
+
type AmenityLabelDictionary = {
|
|
275
|
+
propertyFeatures?: AmenityLabelOption[];
|
|
276
|
+
buildingAmenities?: AmenityLabelOption[];
|
|
277
|
+
};
|
|
278
|
+
type ListingAmenityGroupKey = keyof typeof LISTING_AMENITY_TITLES;
|
|
279
|
+
type ListingAmenityGroup = {
|
|
280
|
+
key: ListingAmenityGroupKey;
|
|
281
|
+
title: string;
|
|
282
|
+
labels: string[];
|
|
283
|
+
};
|
|
284
|
+
type ListingAmenitySource = {
|
|
285
|
+
amenities?: string[] | null;
|
|
286
|
+
propertyFeatures?: string[] | null;
|
|
287
|
+
/** Condo amenity ids, even when `building` is null (no buildingId). */
|
|
288
|
+
buildingAmenities?: string[] | null;
|
|
289
|
+
building?: {
|
|
290
|
+
amenities?: string[] | null;
|
|
291
|
+
} | null;
|
|
292
|
+
};
|
|
293
|
+
/**
|
|
294
|
+
* Default tenant ids + canonical `has*` / `is*` keys seen on public listings.
|
|
295
|
+
* Aligned with DEFAULT_PROPERTY_FEATURES and DEFAULT_BUILDING_FEATURES from
|
|
296
|
+
* Foundation's field-definitions.ts so generated Studio pages never need a
|
|
297
|
+
* dictionary for standard amenities.
|
|
298
|
+
*/
|
|
299
|
+
declare const AMENITY_FALLBACK_LABELS: Record<string, string>;
|
|
300
|
+
declare function labelAmenities(ids: readonly string[] | null | undefined, dictionary?: AmenityLabelOption[]): string[];
|
|
301
|
+
declare function listingAmenityGroups(listing: ListingAmenitySource, dictionary?: AmenityLabelDictionary): ListingAmenityGroup[];
|
|
302
|
+
|
|
261
303
|
/** Public listing URLs. Prefer `listing.path` from the API; fallback is `/imoveis/id-{listingCode}`. */
|
|
262
304
|
declare function listingLookupKey(raw: string): string;
|
|
263
305
|
declare function listingPublicPath(listing: {
|
|
@@ -266,6 +308,84 @@ declare function listingPublicPath(listing: {
|
|
|
266
308
|
id?: string | null;
|
|
267
309
|
}): string;
|
|
268
310
|
|
|
311
|
+
declare const LISTING_DESCRIPTION_CLAMP = 280;
|
|
312
|
+
type ListingFact = {
|
|
313
|
+
key: string;
|
|
314
|
+
label: string;
|
|
315
|
+
text: string;
|
|
316
|
+
};
|
|
317
|
+
type ListingValue = {
|
|
318
|
+
key: string;
|
|
319
|
+
label: string;
|
|
320
|
+
text: string;
|
|
321
|
+
};
|
|
322
|
+
type ListingBreadcrumbCrumb = {
|
|
323
|
+
label: string;
|
|
324
|
+
href: string;
|
|
325
|
+
};
|
|
326
|
+
type ListingLocationBlock = {
|
|
327
|
+
label: string;
|
|
328
|
+
mapsHref: string | null;
|
|
329
|
+
};
|
|
330
|
+
type ListingDescriptionPreview = {
|
|
331
|
+
text: string;
|
|
332
|
+
truncated: boolean;
|
|
333
|
+
toggleLabel: string | null;
|
|
334
|
+
};
|
|
335
|
+
type ListingMediaOverlay = {
|
|
336
|
+
key: "video" | "tour";
|
|
337
|
+
hash: "video" | "tour";
|
|
338
|
+
title: string;
|
|
339
|
+
href: string;
|
|
340
|
+
embedSrc: string;
|
|
341
|
+
};
|
|
342
|
+
declare function listingValues(listing: {
|
|
343
|
+
price?: number | null;
|
|
344
|
+
priceVisibility?: string | null;
|
|
345
|
+
property?: {
|
|
346
|
+
condoFee?: number | null;
|
|
347
|
+
propertyTax?: number | null;
|
|
348
|
+
} | null;
|
|
349
|
+
}): ListingValue[];
|
|
350
|
+
declare function listingFacts(listing: {
|
|
351
|
+
property?: {
|
|
352
|
+
totalArea?: number | null;
|
|
353
|
+
usableArea?: number | null;
|
|
354
|
+
bedrooms?: number | null;
|
|
355
|
+
suites?: number | null;
|
|
356
|
+
parkingSpaces?: number | null;
|
|
357
|
+
rooms?: number | null;
|
|
358
|
+
floor?: number | string | null;
|
|
359
|
+
} | null;
|
|
360
|
+
}): ListingFact[];
|
|
361
|
+
declare function listingMapsHref(location: ListingLocation | null | undefined): string | null;
|
|
362
|
+
declare function listingLocationBlock(listing: {
|
|
363
|
+
location?: ListingLocation | null;
|
|
364
|
+
} | null | undefined): ListingLocationBlock | null;
|
|
365
|
+
declare function listingBreadcrumb(listing: {
|
|
366
|
+
path?: string | null;
|
|
367
|
+
listingCode?: string | null;
|
|
368
|
+
id?: string | null;
|
|
369
|
+
}): ListingBreadcrumbCrumb[];
|
|
370
|
+
declare function listingDescriptionPreview(description: string | null | undefined, expanded?: boolean): ListingDescriptionPreview | null;
|
|
371
|
+
declare function listingMediaOverlays(listing: {
|
|
372
|
+
media?: ListingMedia[] | null;
|
|
373
|
+
}): ListingMediaOverlay[];
|
|
374
|
+
declare function listingDetailModel(listing: Pick<ListingDetail, "id" | "listingCode" | "path" | "price" | "priceVisibility" | "description"> & {
|
|
375
|
+
property?: ListingDetail["property"] | null;
|
|
376
|
+
location?: ListingLocation | null;
|
|
377
|
+
media?: ListingMedia[] | null;
|
|
378
|
+
}, options?: {
|
|
379
|
+
descriptionExpanded?: boolean;
|
|
380
|
+
}): {
|
|
381
|
+
breadcrumb: ListingBreadcrumbCrumb[];
|
|
382
|
+
values: ListingValue[];
|
|
383
|
+
facts: ListingFact[];
|
|
384
|
+
location: ListingLocationBlock | null;
|
|
385
|
+
description: ListingDescriptionPreview | null;
|
|
386
|
+
mediaOverlays: ListingMediaOverlay[];
|
|
387
|
+
};
|
|
388
|
+
|
|
269
389
|
/**
|
|
270
390
|
* Presentation helpers with no UI framework.
|
|
271
391
|
* React / React Native / Flutter adapters consume these formatters and
|
|
@@ -359,10 +479,11 @@ declare const STUDIO_SDK_CONTRACT: {
|
|
|
359
479
|
/**
|
|
360
480
|
* Exact pin for generated Studio sites. Must be ≥ `selfInjectSince` so
|
|
361
481
|
* prompts that skip the layout chrome tag match the tarball v0 installs.
|
|
362
|
-
* 0.4.
|
|
363
|
-
*
|
|
482
|
+
* 0.4.9 adds listingDetailModel (values, facts, location, breadcrumb,
|
|
483
|
+
* description clamp, video/tour), getSimilarListings, and
|
|
484
|
+
* listingAmenityGroups so listing detail never prints amenity ids.
|
|
364
485
|
*/
|
|
365
|
-
readonly minNpmVersion: "0.4.
|
|
486
|
+
readonly minNpmVersion: "0.4.9";
|
|
366
487
|
/** First release where ListingCard and ResultsSkeleton inject the sheet. */
|
|
367
488
|
readonly selfInjectSince: "0.4.2";
|
|
368
489
|
readonly chromeStrategy: "self-inject";
|
|
@@ -381,6 +502,8 @@ declare const STUDIO_SDK_CONTRACT: {
|
|
|
381
502
|
readonly forbiddenImports: readonly ["@garagem-ai/site-sdk/react/search.css"];
|
|
382
503
|
readonly leadStrategy: "visit-default";
|
|
383
504
|
readonly leadExports: readonly ["getLeadUi", "submitVisitLead", "submitContactLead", "slotsForDate", "expandVisitSchedule", "expandVisitTimeSlots", "isVisitSlotAllowed", "STUDIO_DEFAULT_VISIT_SCHEDULE"];
|
|
505
|
+
readonly listingDetailExports: readonly ["listingDetailModel", "getSimilarListings"];
|
|
506
|
+
readonly amenityExports: readonly ["listingAmenityGroups"];
|
|
384
507
|
};
|
|
385
508
|
type StudioSdkContract = typeof STUDIO_SDK_CONTRACT;
|
|
386
509
|
/**
|
|
@@ -409,6 +532,8 @@ declare function parseReactSdkNamedImports(source: string): string[];
|
|
|
409
532
|
declare function unavailableReactImports(source: string, pin: string): string[];
|
|
410
533
|
declare function studioSdkPinInstruction(): string;
|
|
411
534
|
declare function studioLeadInstruction(): string;
|
|
535
|
+
declare function studioListingDetailInstruction(): string;
|
|
536
|
+
declare function studioAmenityInstruction(): string;
|
|
412
537
|
declare function studioChromeInstruction(): string;
|
|
413
538
|
/**
|
|
414
539
|
* Tokens that must not appear in Studio codegen (prompts, recipes, repair).
|
|
@@ -524,4 +649,4 @@ interface GaragemClient {
|
|
|
524
649
|
*/
|
|
525
650
|
declare function createGaragemClient(options?: CreateGaragemClientOptions): GaragemClient;
|
|
526
651
|
|
|
527
|
-
export { AppliedSearchChange, AppliedSearchQuery, CmsCollection, CmsEntriesResult, CmsEntry, type ContactLeadInput, type CreateGaragemClientOptions, type FetchLike, type GaragemClient, GaragemSdkError, type GetCmsCollectionOptions, type GetCmsCollectionsOptions, type GetCmsEntriesOptions, type GetCmsEntryOptions, type GetLeadUiOptions, type GetListingOptions, type GetListingsOptions, type GetSearchUiOptions, type GetSimilarListingsOptions, type GetSiteOptions, type HHmm, type LeadContact, type LeadField, type LeadFieldId, LeadSubmitError, type LeadSubmitErrorCode, type LeadSubmitResult, type LeadUi, ListingDetail, ListingFilters, ListingsResult, type LocationFilterInput, QueryListingsFilters, type QueryListingsOptions, QueryListingsParams, QueryListingsResult, RequestNextOptions, type ResolvePublicSiteIdOptions, SEARCH_CSS_RECIPE, SEARCH_CSS_VARS, STUDIO_DEFAULT_VISIT_SCHEDULE, STUDIO_SDK_CONTRACT, STUDIO_SDK_PACKAGE, STUDIO_SITE_LAYOUT, type SearchListingsOptions, SearchListingsParams, SearchListingsResult, SearchPathFilters, SearchUi, SearchUiDictionary, SimilarListingsResult, Site, type StudioSdkContract, VISIT_TIME_ZONE, type VisitHours, type VisitLeadInput, type VisitSchedule, type VisitScheduleConfig, coerceNpmVersion, compareSemver, composeSearchPublicHref, composeSearchPublicPath, createGaragemClient, expandVisitSchedule, expandVisitTimeSlots, formatAreaM2, formatGroupedInteger, formatListingPrice, getCmsCollection, getCmsCollections, getCmsEntries, getCmsEntry, getLeadUi, getListing, getListings, getSearchUi, getSimilarListings, getSite, hasShowcaseLeadsPostUrl, isStudioPreviewHost, isVisitSlotAllowed, listingBusinessLabel, listingLookupKey, listingPublicPath, mergeAppliedSearchQueryIntoSearch, normalizeVisitDate, normalizeVisitTime, parseAppliedSearchQuery, parseGroupedInteger, parseReactSdkNamedImports, parseSearchPublicPath, pathFiltersToQueryFilters, pathLocationToFilterInput, queryListings, reduceAppliedSearchQuery, resolvePublicSiteId, searchListings, serializeAppliedSearchQuery, slotsForDate, studioChromeInstruction, studioCodegenContractViolations, studioDefaultLeadUi, studioLayoutInstruction, studioLeadInstruction, studioSdkPinInstruction, studioSearchLandmarkInstruction, studioSiteWidthCss, submitContactLead, submitVisitLead, unavailableReactImports };
|
|
652
|
+
export { AMENITY_FALLBACK_LABELS, type AmenityLabelDictionary, type AmenityLabelOption, AppliedSearchChange, AppliedSearchQuery, CmsCollection, CmsEntriesResult, CmsEntry, type ContactLeadInput, type CreateGaragemClientOptions, type FetchLike, type GaragemClient, GaragemSdkError, type GetCmsCollectionOptions, type GetCmsCollectionsOptions, type GetCmsEntriesOptions, type GetCmsEntryOptions, type GetLeadUiOptions, type GetListingOptions, type GetListingsOptions, type GetSearchUiOptions, type GetSimilarListingsOptions, type GetSiteOptions, type HHmm, LISTING_AMENITY_TITLES, LISTING_DESCRIPTION_CLAMP, type LeadContact, type LeadField, type LeadFieldId, LeadSubmitError, type LeadSubmitErrorCode, type LeadSubmitResult, type LeadUi, type ListingAmenityGroup, type ListingAmenityGroupKey, type ListingAmenitySource, type ListingBreadcrumbCrumb, type ListingDescriptionPreview, ListingDetail, type ListingFact, ListingFilters, ListingLocation, type ListingLocationBlock, ListingMedia, type ListingMediaOverlay, type ListingValue, ListingsResult, type LocationFilterInput, QueryListingsFilters, type QueryListingsOptions, QueryListingsParams, QueryListingsResult, RequestNextOptions, type ResolvePublicSiteIdOptions, SEARCH_CSS_RECIPE, SEARCH_CSS_VARS, STUDIO_DEFAULT_VISIT_SCHEDULE, STUDIO_SDK_CONTRACT, STUDIO_SDK_PACKAGE, STUDIO_SITE_LAYOUT, type SearchListingsOptions, SearchListingsParams, SearchListingsResult, SearchPathFilters, SearchUi, SearchUiDictionary, SimilarListingsResult, Site, type StudioSdkContract, VISIT_TIME_ZONE, type VisitHours, type VisitLeadInput, type VisitSchedule, type VisitScheduleConfig, coerceNpmVersion, compareSemver, composeSearchPublicHref, composeSearchPublicPath, createGaragemClient, expandVisitSchedule, expandVisitTimeSlots, formatAreaM2, formatGroupedInteger, formatListingPrice, getCmsCollection, getCmsCollections, getCmsEntries, getCmsEntry, getLeadUi, getListing, getListings, getSearchUi, getSimilarListings, getSite, hasShowcaseLeadsPostUrl, isStudioPreviewHost, isVisitSlotAllowed, labelAmenities, listingAmenityGroups, listingBreadcrumb, listingBusinessLabel, listingDescriptionPreview, listingDetailModel, listingFacts, listingLocationBlock, listingLookupKey, listingMapsHref, listingMediaOverlays, listingPublicPath, listingValues, mergeAppliedSearchQueryIntoSearch, normalizeVisitDate, normalizeVisitTime, parseAppliedSearchQuery, parseGroupedInteger, parseReactSdkNamedImports, parseSearchPublicPath, pathFiltersToQueryFilters, pathLocationToFilterInput, queryListings, reduceAppliedSearchQuery, resolvePublicSiteId, searchListings, serializeAppliedSearchQuery, slotsForDate, studioAmenityInstruction, studioChromeInstruction, studioCodegenContractViolations, studioDefaultLeadUi, studioLayoutInstruction, studioLeadInstruction, studioListingDetailInstruction, studioSdkPinInstruction, studioSearchLandmarkInstruction, studioSiteWidthCss, submitContactLead, submitVisitLead, unavailableReactImports };
|