@garagem-ai/site-sdk 0.1.1 → 0.2.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/src/types.ts CHANGED
@@ -21,6 +21,8 @@ export interface ListingPropertySummary {
21
21
  parkingSpaces: number;
22
22
  totalArea: number;
23
23
  usableArea: number;
24
+ /** Monthly condo fee in BRL when the listing has one. */
25
+ condoFee?: number;
24
26
  }
25
27
 
26
28
  /** Address breakdown returned with every listing. */
@@ -61,7 +63,16 @@ export interface ListingMedia {
61
63
  * promotional flows) don't get masked as "sob consulta".
62
64
  */
63
65
  export interface Listing {
66
+ /** Internal UUID — POST lead with this. Never put it in the URL. */
64
67
  id: string;
68
+ /** Public identity for display (`#ABC`) and lookup. `null` if the row has no code. */
69
+ listingCode: string | null;
70
+ /**
71
+ * Canonical public href from the Sites API (`/imoveis/.../id-{listingCode}`).
72
+ * Prefer `listingPublicPath(listing)` so a missing `path` (CDN deploy
73
+ * window) still falls back to `/imoveis/id-{listingCode}`.
74
+ */
75
+ path: string;
65
76
  title: string;
66
77
  description: string;
67
78
  businessType: ListingBusinessType;
@@ -181,6 +192,75 @@ export interface Site {
181
192
  tenantId: string;
182
193
  }
183
194
 
195
+ /** Wrapped response from `getSimilarListings`. */
196
+ export interface SimilarListingsResult {
197
+ listings: Listing[];
198
+ total: number;
199
+ }
200
+
201
+ /** CMS field type mirrored from the public CMS worker. */
202
+ export type CmsFieldType =
203
+ | "text"
204
+ | "richText"
205
+ | "image"
206
+ | "date"
207
+ | "select"
208
+ | "number"
209
+ | "url"
210
+ | "entry-reference";
211
+
212
+ export interface CmsFieldDefinition {
213
+ id: string;
214
+ label: string;
215
+ type: CmsFieldType;
216
+ required?: boolean;
217
+ placeholder?: string;
218
+ options?: string[];
219
+ targetCollection?: string;
220
+ displayField?: string;
221
+ inheritFields?: string[];
222
+ inheritLevelField?: boolean;
223
+ }
224
+
225
+ /** CMS collection schema. Returned by `getCmsCollections` / `getCmsCollection`. */
226
+ export interface CmsCollection {
227
+ id: string;
228
+ name: string;
229
+ slug: string;
230
+ templatePageId: string | null;
231
+ fields: CmsFieldDefinition[];
232
+ createdAt: string;
233
+ updatedAt: string;
234
+ }
235
+
236
+ export type CmsEntryStatus = "draft" | "ready" | "published";
237
+
238
+ export interface CmsSeoData {
239
+ title?: string;
240
+ description?: string;
241
+ ogImage?: string;
242
+ }
243
+
244
+ /** Published CMS entry. Returned by `getCmsEntries` / `getCmsEntry`. */
245
+ export interface CmsEntry {
246
+ id: string;
247
+ collectionId: string;
248
+ slug: string;
249
+ status: CmsEntryStatus;
250
+ fields: Record<string, unknown>;
251
+ seo: CmsSeoData | null;
252
+ publishedAt: string | null;
253
+ createdAt: string;
254
+ updatedAt: string;
255
+ }
256
+
257
+ export interface CmsEntriesResult {
258
+ entries: CmsEntry[];
259
+ total: number;
260
+ limit: number;
261
+ offset: number;
262
+ }
263
+
184
264
  /**
185
265
  * App Router caching hints passed straight through to the underlying
186
266
  * `fetch` call. See https://nextjs.org/docs/app/api-reference/functions/fetch.