@garagem-ai/site-sdk 0.13.4 → 0.13.5

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.
@@ -864,6 +864,7 @@ declare function searchSortOptions(sorts: Array<{
864
864
  }>;
865
865
  /** Toolbar: price + bedrooms first and required when the schema has them. */
866
866
  declare const TOOLBAR_PRIMARY_FILTER_IDS: readonly ["price", "property_bedrooms"];
867
+ /** Listing detail: `…/id-<código>` at any depth, or the short CRM link `/imoveis/<código>`. */
867
868
  declare function isListingDetailPath(pathname: string): boolean;
868
869
  declare function readPublicSearch(pathname: string, search: string, dictionary?: SearchUiDictionary): {
869
870
  pathFilters: SearchPathFilters;
@@ -864,6 +864,7 @@ declare function searchSortOptions(sorts: Array<{
864
864
  }>;
865
865
  /** Toolbar: price + bedrooms first and required when the schema has them. */
866
866
  declare const TOOLBAR_PRIMARY_FILTER_IDS: readonly ["price", "property_bedrooms"];
867
+ /** Listing detail: `…/id-<código>` at any depth, or the short CRM link `/imoveis/<código>`. */
867
868
  declare function isListingDetailPath(pathname: string): boolean;
868
869
  declare function readPublicSearch(pathname: string, search: string, dictionary?: SearchUiDictionary): {
869
870
  pathFilters: SearchPathFilters;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@garagem-ai/site-sdk",
3
- "version": "0.13.4",
3
+ "version": "0.13.5",
4
4
  "private": false,
5
5
  "description": "Typed, runtime-agnostic SDK for building custom real estate sites against the Garagem platform. Drop into any Next.js (or other JS) project to fetch listings, sites and CMS data.",
6
6
  "main": "./dist/index.js",
@@ -1,3 +1,4 @@
1
+ import { isShortListingPath } from "@garagem/search-url";
1
2
  import {
2
3
  composeSearchPublicHref,
3
4
  parseAppliedSearchQuery,
@@ -77,10 +78,11 @@ function pathnameOnly(pathname: string): string {
77
78
  return String(pathname || "").split(/[?#]/)[0] || "/";
78
79
  }
79
80
 
81
+ /** Listing detail: `…/id-<código>` at any depth, or the short CRM link `/imoveis/<código>`. */
80
82
  export function isListingDetailPath(pathname: string): boolean {
81
- const parts = pathnameOnly(pathname).split("/").filter(Boolean);
82
- const last = parts[parts.length - 1] || "";
83
- return last.toLowerCase().startsWith("id-");
83
+ const path = pathnameOnly(pathname);
84
+ const last = path.split("/").filter(Boolean).pop() || "";
85
+ return last.toLowerCase().startsWith("id-") || isShortListingPath(path);
84
86
  }
85
87
 
86
88
  export function readPublicSearch(