@garagem-ai/site-sdk 0.7.0 → 0.8.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.
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Photo intelligence types for the public Sites API.
3
+ *
4
+ * `ListingMedia` (in `./types`) carries the per-photo analysis on the listing
5
+ * detail; these shapes cover the "imóveis com fotos parecidas" endpoint and
6
+ * the headless photo helpers. Additive contract, never breaking.
7
+ */
8
+ import type { Listing, ListingMedia } from "./types";
9
+
10
+ /** The photo of a similar listing that matched the reference photo. */
11
+ export interface SimilarPhotoMatch {
12
+ /** Media id of the matched photo on the similar listing. */
13
+ id: string;
14
+ src: string;
15
+ alt: string;
16
+ /** AI caption of the matched photo, when it has one. */
17
+ caption: string | null;
18
+ /** Typesense cosine `vector_distance`; lower is closer. `null` when unknown. */
19
+ distance: number | null;
20
+ }
21
+
22
+ export interface SimilarByPhotoItem {
23
+ /** Same card shape as `getListings`. */
24
+ listing: Listing;
25
+ matchedPhoto: SimilarPhotoMatch;
26
+ }
27
+
28
+ /** Response of `getSimilarByPhoto`. */
29
+ export interface SimilarByPhotoResult {
30
+ /**
31
+ * `false` when the site's tenant has no image search, or when `mediaId`
32
+ * is not a media UUID (the `image-N` / `external-N` gallery keys). Hide
33
+ * the block instead of rendering an empty carousel.
34
+ */
35
+ available: boolean;
36
+ items: SimilarByPhotoItem[];
37
+ }
38
+
39
+ /** Gallery photos of one room type, in gallery order. */
40
+ export interface ListingPhotoGroup {
41
+ /** Normalized key (`quarto`, `sala`, `cozinha`, …; `outros` for unknown). */
42
+ key: string;
43
+ /** pt-BR label ready to render (`Quartos`, `Sala`, `Cozinha`, …). */
44
+ label: string;
45
+ photos: ListingMedia[];
46
+ }
package/src/types.ts CHANGED
@@ -54,9 +54,20 @@ export interface ListingMedia {
54
54
  type: string;
55
55
  category: string;
56
56
  src: string;
57
+ /** Caption-based alt for photos with analysis; generic `"<title> - Foto N"` otherwise. */
57
58
  alt?: string;
59
+ /** AI caption, falling back to the broker description. Photos only; absent when unanalyzed. */
58
60
  caption?: string;
59
61
  order?: number;
62
+ /**
63
+ * Room the photo shows, free text from the analysis (`sala`, `quarto`,
64
+ * `cozinha`, …). Group with `listingPhotoGroups`.
65
+ */
66
+ roomType?: string;
67
+ /** `interior` | `facade` | `building_exterior` | `amenity` | `view` | `floorplan` | `other`. */
68
+ sceneType?: string;
69
+ /** Visual highlights named for this photo. Aggregate with `listingVisualHighlights`. */
70
+ features?: string[];
60
71
  }
61
72
 
62
73
  /**