@garagem-ai/site-sdk 0.4.2 → 0.4.3
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 +5 -0
- package/dist/index.d.mts +128 -3
- package/dist/index.d.ts +128 -3
- package/dist/index.js +424 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +411 -3
- package/dist/index.mjs.map +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/package.json +1 -1
- package/src/client.ts +51 -0
- package/src/fetchers.ts +2 -1
- package/src/index.ts +32 -0
- package/src/leads.ts +341 -0
- package/src/react/styles/search-chrome-css.generated.ts +1 -1
- package/src/schedule.ts +226 -0
- package/src/studio-contract.ts +32 -2
package/README.md
CHANGED
|
@@ -64,6 +64,11 @@ raw escape hatch when you need full control.
|
|
|
64
64
|
| `getCmsCollection({ siteId, slug })` | One CMS collection schema |
|
|
65
65
|
| `getCmsEntries({ siteId, collection, limit?, offset? })` | Published CMS entries only |
|
|
66
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, `visitDate` + `visitTime`) |
|
|
70
|
+
| `submitContactLead({ siteId, listingId, … })` | POST a contact lead (no date/time) |
|
|
71
|
+
| `slotsForDate` / `expandVisitSchedule` | Pure schedule helpers (`America/Sao_Paulo`, default Mon–Fri 06:00–22:00) |
|
|
67
72
|
| `resolvePublicSiteId({ host?, fallback? })` | Preview uses `fallback` (`GARAGEM_SITE_ID`); live hosts resolve via `getSite({ domain })` |
|
|
68
73
|
|
|
69
74
|
### Advanced layer (when the friendly one isn't enough)
|
package/dist/index.d.mts
CHANGED
|
@@ -147,6 +147,114 @@ declare function getCmsEntries(options: GetCmsEntriesOptions): Promise<CmsEntrie
|
|
|
147
147
|
/** Fetch one published CMS entry by slug. */
|
|
148
148
|
declare function getCmsEntry(options: GetCmsEntryOptions): Promise<CmsEntry>;
|
|
149
149
|
|
|
150
|
+
/**
|
|
151
|
+
* Visit-lead schedule: hours in, slots out. Pure — no fetch, no React.
|
|
152
|
+
* Calendar dates are civil dates in `timeZone` (America/Sao_Paulo), never
|
|
153
|
+
* UTC midnight from `new Date("YYYY-MM-DD")`.
|
|
154
|
+
*/
|
|
155
|
+
declare const VISIT_TIME_ZONE: "America/Sao_Paulo";
|
|
156
|
+
type HHmm = string;
|
|
157
|
+
type VisitHours = {
|
|
158
|
+
start: HHmm;
|
|
159
|
+
end: HHmm;
|
|
160
|
+
};
|
|
161
|
+
type VisitScheduleConfig = {
|
|
162
|
+
timeZone: typeof VISIT_TIME_ZONE;
|
|
163
|
+
saturday: boolean;
|
|
164
|
+
sunday: boolean;
|
|
165
|
+
weekday: VisitHours;
|
|
166
|
+
weekend: VisitHours | null;
|
|
167
|
+
minHoursAhead: number;
|
|
168
|
+
};
|
|
169
|
+
type VisitSchedule = VisitScheduleConfig & {
|
|
170
|
+
disabledDays: number[];
|
|
171
|
+
weekdayTimeSlots: HHmm[];
|
|
172
|
+
weekendTimeSlots: HHmm[];
|
|
173
|
+
timeSlots: HHmm[];
|
|
174
|
+
};
|
|
175
|
+
declare function expandVisitTimeSlots(hours: VisitHours): HHmm[];
|
|
176
|
+
declare function expandVisitSchedule(config: VisitScheduleConfig): VisitSchedule;
|
|
177
|
+
declare const STUDIO_DEFAULT_VISIT_SCHEDULE: VisitSchedule;
|
|
178
|
+
declare function slotsForDate(schedule: VisitSchedule, date: Date | string, now?: Date): HHmm[];
|
|
179
|
+
declare function isVisitSlotAllowed(schedule: VisitSchedule, visitDate: string, visitTime: HHmm, now?: Date): boolean;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Headless visit / contact leads. Schema via GET /leads/ui; POST always
|
|
183
|
+
* goes to the webhook (`source: "site-sdk"`). v0 draws the dialog.
|
|
184
|
+
*/
|
|
185
|
+
|
|
186
|
+
type LeadFieldId = "name" | "email" | "phone" | "message";
|
|
187
|
+
type LeadField = {
|
|
188
|
+
id: LeadFieldId;
|
|
189
|
+
required: boolean;
|
|
190
|
+
};
|
|
191
|
+
type LeadUi = {
|
|
192
|
+
defaultVariant: "visit";
|
|
193
|
+
timeZone: "America/Sao_Paulo";
|
|
194
|
+
variants: {
|
|
195
|
+
visit: {
|
|
196
|
+
ctaLabel: string;
|
|
197
|
+
requireDateTime: true;
|
|
198
|
+
schedule: VisitSchedule;
|
|
199
|
+
fields: LeadField[];
|
|
200
|
+
};
|
|
201
|
+
contact: {
|
|
202
|
+
ctaLabel: string;
|
|
203
|
+
requireDateTime: false;
|
|
204
|
+
whatsappPhone: string | null;
|
|
205
|
+
fields: LeadField[];
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
type GetLeadUiOptions = {
|
|
210
|
+
siteId: string;
|
|
211
|
+
baseUrl?: string;
|
|
212
|
+
fetch?: FetchLike;
|
|
213
|
+
next?: RequestNextOptions;
|
|
214
|
+
};
|
|
215
|
+
type LeadContact = {
|
|
216
|
+
name: string;
|
|
217
|
+
email?: string;
|
|
218
|
+
phone?: string;
|
|
219
|
+
message?: string;
|
|
220
|
+
};
|
|
221
|
+
type LeadSubmitBase = LeadContact & {
|
|
222
|
+
siteId: string;
|
|
223
|
+
baseUrl?: string;
|
|
224
|
+
fetch?: FetchLike;
|
|
225
|
+
listingId: string;
|
|
226
|
+
visitorId?: string;
|
|
227
|
+
brokerRef?: string;
|
|
228
|
+
referrer?: string;
|
|
229
|
+
};
|
|
230
|
+
type VisitLeadInput = LeadSubmitBase & {
|
|
231
|
+
visitDate: string;
|
|
232
|
+
visitTime: HHmm;
|
|
233
|
+
schedule?: VisitSchedule;
|
|
234
|
+
};
|
|
235
|
+
type ContactLeadInput = LeadSubmitBase;
|
|
236
|
+
type LeadSubmitResult = {
|
|
237
|
+
ok: true;
|
|
238
|
+
status: 202;
|
|
239
|
+
id: string;
|
|
240
|
+
};
|
|
241
|
+
type LeadSubmitErrorCode = "invalid_listing_id" | "invalid_contact" | "invalid_slot" | "rate_limited" | "not_found" | "http" | "network";
|
|
242
|
+
declare class LeadSubmitError extends Error {
|
|
243
|
+
readonly code: LeadSubmitErrorCode;
|
|
244
|
+
readonly status?: number;
|
|
245
|
+
readonly retryAfterSeconds?: number;
|
|
246
|
+
constructor(message: string, info: {
|
|
247
|
+
code: LeadSubmitErrorCode;
|
|
248
|
+
status?: number;
|
|
249
|
+
retryAfterSeconds?: number;
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
/** Fallback when GET /leads/ui fails — same default the API publishes. */
|
|
253
|
+
declare function studioDefaultLeadUi(): LeadUi;
|
|
254
|
+
declare function getLeadUi(options: GetLeadUiOptions): Promise<LeadUi>;
|
|
255
|
+
declare function submitVisitLead(input: VisitLeadInput): Promise<LeadSubmitResult>;
|
|
256
|
+
declare function submitContactLead(input: ContactLeadInput): Promise<LeadSubmitResult>;
|
|
257
|
+
|
|
150
258
|
/** Public listing URLs. Prefer `listing.path` from the API; fallback is `/imoveis/id-{listingCode}`. */
|
|
151
259
|
declare function listingLookupKey(raw: string): string;
|
|
152
260
|
declare function listingPublicPath(listing: {
|
|
@@ -248,10 +356,10 @@ declare const STUDIO_SDK_CONTRACT: {
|
|
|
248
356
|
/**
|
|
249
357
|
* Exact pin for generated Studio sites. Must be ≥ `selfInjectSince` so
|
|
250
358
|
* prompts that skip the layout chrome tag match the tarball v0 installs.
|
|
251
|
-
* This PR’s changeset publishes that tarball as 0.4.
|
|
359
|
+
* This PR’s changeset publishes that tarball as 0.4.3 — do not generate
|
|
252
360
|
* against this floor until Version Packages is on npm.
|
|
253
361
|
*/
|
|
254
|
-
readonly minNpmVersion: "0.4.
|
|
362
|
+
readonly minNpmVersion: "0.4.3";
|
|
255
363
|
/** First release where ListingCard and ResultsSkeleton inject the sheet. */
|
|
256
364
|
readonly selfInjectSince: "0.4.2";
|
|
257
365
|
readonly chromeStrategy: "self-inject";
|
|
@@ -268,13 +376,17 @@ declare const STUDIO_SDK_CONTRACT: {
|
|
|
268
376
|
readonly SearchChromeStyles: "0.4.1";
|
|
269
377
|
};
|
|
270
378
|
readonly forbiddenImports: readonly ["@garagem-ai/site-sdk/react/search.css"];
|
|
379
|
+
readonly leadStrategy: "visit-default";
|
|
380
|
+
readonly leadExports: readonly ["getLeadUi", "submitVisitLead", "submitContactLead", "slotsForDate", "expandVisitSchedule", "expandVisitTimeSlots", "isVisitSlotAllowed", "STUDIO_DEFAULT_VISIT_SCHEDULE"];
|
|
271
381
|
};
|
|
272
382
|
type StudioSdkContract = typeof STUDIO_SDK_CONTRACT;
|
|
383
|
+
declare function hasShowcaseLeadsPostUrl(text: string): boolean;
|
|
273
384
|
declare function coerceNpmVersion(raw: unknown): string | null;
|
|
274
385
|
declare function compareSemver(a: string, b: string): number;
|
|
275
386
|
declare function parseReactSdkNamedImports(source: string): string[];
|
|
276
387
|
declare function unavailableReactImports(source: string, pin: string): string[];
|
|
277
388
|
declare function studioSdkPinInstruction(): string;
|
|
389
|
+
declare function studioLeadInstruction(): string;
|
|
278
390
|
declare function studioChromeInstruction(): string;
|
|
279
391
|
/**
|
|
280
392
|
* Tokens that must not appear in Studio codegen (prompts, recipes, repair).
|
|
@@ -366,6 +478,19 @@ interface GaragemClient {
|
|
|
366
478
|
siteId?: string;
|
|
367
479
|
next?: RequestNextOptions;
|
|
368
480
|
}): Promise<CmsEntry>;
|
|
481
|
+
/** Visit/contact dialog schema (slots, labels). */
|
|
482
|
+
getLeadUi(args?: {
|
|
483
|
+
siteId?: string;
|
|
484
|
+
next?: RequestNextOptions;
|
|
485
|
+
}): Promise<LeadUi>;
|
|
486
|
+
/** POST a visit lead (`leadType: "visit"`). */
|
|
487
|
+
submitVisitLead(args: Omit<VisitLeadInput, "siteId" | "baseUrl" | "fetch"> & {
|
|
488
|
+
siteId?: string;
|
|
489
|
+
}): Promise<LeadSubmitResult>;
|
|
490
|
+
/** POST a contact lead (`leadType: "contact"`). */
|
|
491
|
+
submitContactLead(args: Omit<ContactLeadInput, "siteId" | "baseUrl" | "fetch"> & {
|
|
492
|
+
siteId?: string;
|
|
493
|
+
}): Promise<LeadSubmitResult>;
|
|
369
494
|
}
|
|
370
495
|
/**
|
|
371
496
|
* Bind base URL, fetch and site to a single client object. Useful when
|
|
@@ -377,4 +502,4 @@ interface GaragemClient {
|
|
|
377
502
|
*/
|
|
378
503
|
declare function createGaragemClient(options?: CreateGaragemClientOptions): GaragemClient;
|
|
379
504
|
|
|
380
|
-
export { AppliedSearchChange, AppliedSearchQuery, CmsCollection, CmsEntriesResult, CmsEntry, type CreateGaragemClientOptions, type FetchLike, type GaragemClient, GaragemSdkError, type GetCmsCollectionOptions, type GetCmsCollectionsOptions, type GetCmsEntriesOptions, type GetCmsEntryOptions, type GetListingOptions, type GetListingsOptions, type GetSearchUiOptions, type GetSimilarListingsOptions, type GetSiteOptions, ListingDetail, ListingFilters, ListingsResult, type LocationFilterInput, QueryListingsFilters, type QueryListingsOptions, QueryListingsParams, QueryListingsResult, RequestNextOptions, type ResolvePublicSiteIdOptions, SEARCH_CSS_RECIPE, SEARCH_CSS_VARS, STUDIO_SDK_CONTRACT, STUDIO_SDK_PACKAGE, type SearchListingsOptions, SearchListingsParams, SearchListingsResult, SearchPathFilters, SearchUi, SearchUiDictionary, SimilarListingsResult, Site, type StudioSdkContract, coerceNpmVersion, compareSemver, composeSearchPublicHref, composeSearchPublicPath, createGaragemClient, formatAreaM2, formatGroupedInteger, formatListingPrice, getCmsCollection, getCmsCollections, getCmsEntries, getCmsEntry, getListing, getListings, getSearchUi, getSimilarListings, getSite, isStudioPreviewHost, listingBusinessLabel, listingLookupKey, listingPublicPath, mergeAppliedSearchQueryIntoSearch, parseAppliedSearchQuery, parseGroupedInteger, parseReactSdkNamedImports, parseSearchPublicPath, pathFiltersToQueryFilters, pathLocationToFilterInput, queryListings, reduceAppliedSearchQuery, resolvePublicSiteId, searchListings, serializeAppliedSearchQuery, studioChromeInstruction, studioCodegenContractViolations, studioSdkPinInstruction, unavailableReactImports };
|
|
505
|
+
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, 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, parseAppliedSearchQuery, parseGroupedInteger, parseReactSdkNamedImports, parseSearchPublicPath, pathFiltersToQueryFilters, pathLocationToFilterInput, queryListings, reduceAppliedSearchQuery, resolvePublicSiteId, searchListings, serializeAppliedSearchQuery, slotsForDate, studioChromeInstruction, studioCodegenContractViolations, studioDefaultLeadUi, studioLeadInstruction, studioSdkPinInstruction, submitContactLead, submitVisitLead, unavailableReactImports };
|
package/dist/index.d.ts
CHANGED
|
@@ -147,6 +147,114 @@ declare function getCmsEntries(options: GetCmsEntriesOptions): Promise<CmsEntrie
|
|
|
147
147
|
/** Fetch one published CMS entry by slug. */
|
|
148
148
|
declare function getCmsEntry(options: GetCmsEntryOptions): Promise<CmsEntry>;
|
|
149
149
|
|
|
150
|
+
/**
|
|
151
|
+
* Visit-lead schedule: hours in, slots out. Pure — no fetch, no React.
|
|
152
|
+
* Calendar dates are civil dates in `timeZone` (America/Sao_Paulo), never
|
|
153
|
+
* UTC midnight from `new Date("YYYY-MM-DD")`.
|
|
154
|
+
*/
|
|
155
|
+
declare const VISIT_TIME_ZONE: "America/Sao_Paulo";
|
|
156
|
+
type HHmm = string;
|
|
157
|
+
type VisitHours = {
|
|
158
|
+
start: HHmm;
|
|
159
|
+
end: HHmm;
|
|
160
|
+
};
|
|
161
|
+
type VisitScheduleConfig = {
|
|
162
|
+
timeZone: typeof VISIT_TIME_ZONE;
|
|
163
|
+
saturday: boolean;
|
|
164
|
+
sunday: boolean;
|
|
165
|
+
weekday: VisitHours;
|
|
166
|
+
weekend: VisitHours | null;
|
|
167
|
+
minHoursAhead: number;
|
|
168
|
+
};
|
|
169
|
+
type VisitSchedule = VisitScheduleConfig & {
|
|
170
|
+
disabledDays: number[];
|
|
171
|
+
weekdayTimeSlots: HHmm[];
|
|
172
|
+
weekendTimeSlots: HHmm[];
|
|
173
|
+
timeSlots: HHmm[];
|
|
174
|
+
};
|
|
175
|
+
declare function expandVisitTimeSlots(hours: VisitHours): HHmm[];
|
|
176
|
+
declare function expandVisitSchedule(config: VisitScheduleConfig): VisitSchedule;
|
|
177
|
+
declare const STUDIO_DEFAULT_VISIT_SCHEDULE: VisitSchedule;
|
|
178
|
+
declare function slotsForDate(schedule: VisitSchedule, date: Date | string, now?: Date): HHmm[];
|
|
179
|
+
declare function isVisitSlotAllowed(schedule: VisitSchedule, visitDate: string, visitTime: HHmm, now?: Date): boolean;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Headless visit / contact leads. Schema via GET /leads/ui; POST always
|
|
183
|
+
* goes to the webhook (`source: "site-sdk"`). v0 draws the dialog.
|
|
184
|
+
*/
|
|
185
|
+
|
|
186
|
+
type LeadFieldId = "name" | "email" | "phone" | "message";
|
|
187
|
+
type LeadField = {
|
|
188
|
+
id: LeadFieldId;
|
|
189
|
+
required: boolean;
|
|
190
|
+
};
|
|
191
|
+
type LeadUi = {
|
|
192
|
+
defaultVariant: "visit";
|
|
193
|
+
timeZone: "America/Sao_Paulo";
|
|
194
|
+
variants: {
|
|
195
|
+
visit: {
|
|
196
|
+
ctaLabel: string;
|
|
197
|
+
requireDateTime: true;
|
|
198
|
+
schedule: VisitSchedule;
|
|
199
|
+
fields: LeadField[];
|
|
200
|
+
};
|
|
201
|
+
contact: {
|
|
202
|
+
ctaLabel: string;
|
|
203
|
+
requireDateTime: false;
|
|
204
|
+
whatsappPhone: string | null;
|
|
205
|
+
fields: LeadField[];
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
type GetLeadUiOptions = {
|
|
210
|
+
siteId: string;
|
|
211
|
+
baseUrl?: string;
|
|
212
|
+
fetch?: FetchLike;
|
|
213
|
+
next?: RequestNextOptions;
|
|
214
|
+
};
|
|
215
|
+
type LeadContact = {
|
|
216
|
+
name: string;
|
|
217
|
+
email?: string;
|
|
218
|
+
phone?: string;
|
|
219
|
+
message?: string;
|
|
220
|
+
};
|
|
221
|
+
type LeadSubmitBase = LeadContact & {
|
|
222
|
+
siteId: string;
|
|
223
|
+
baseUrl?: string;
|
|
224
|
+
fetch?: FetchLike;
|
|
225
|
+
listingId: string;
|
|
226
|
+
visitorId?: string;
|
|
227
|
+
brokerRef?: string;
|
|
228
|
+
referrer?: string;
|
|
229
|
+
};
|
|
230
|
+
type VisitLeadInput = LeadSubmitBase & {
|
|
231
|
+
visitDate: string;
|
|
232
|
+
visitTime: HHmm;
|
|
233
|
+
schedule?: VisitSchedule;
|
|
234
|
+
};
|
|
235
|
+
type ContactLeadInput = LeadSubmitBase;
|
|
236
|
+
type LeadSubmitResult = {
|
|
237
|
+
ok: true;
|
|
238
|
+
status: 202;
|
|
239
|
+
id: string;
|
|
240
|
+
};
|
|
241
|
+
type LeadSubmitErrorCode = "invalid_listing_id" | "invalid_contact" | "invalid_slot" | "rate_limited" | "not_found" | "http" | "network";
|
|
242
|
+
declare class LeadSubmitError extends Error {
|
|
243
|
+
readonly code: LeadSubmitErrorCode;
|
|
244
|
+
readonly status?: number;
|
|
245
|
+
readonly retryAfterSeconds?: number;
|
|
246
|
+
constructor(message: string, info: {
|
|
247
|
+
code: LeadSubmitErrorCode;
|
|
248
|
+
status?: number;
|
|
249
|
+
retryAfterSeconds?: number;
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
/** Fallback when GET /leads/ui fails — same default the API publishes. */
|
|
253
|
+
declare function studioDefaultLeadUi(): LeadUi;
|
|
254
|
+
declare function getLeadUi(options: GetLeadUiOptions): Promise<LeadUi>;
|
|
255
|
+
declare function submitVisitLead(input: VisitLeadInput): Promise<LeadSubmitResult>;
|
|
256
|
+
declare function submitContactLead(input: ContactLeadInput): Promise<LeadSubmitResult>;
|
|
257
|
+
|
|
150
258
|
/** Public listing URLs. Prefer `listing.path` from the API; fallback is `/imoveis/id-{listingCode}`. */
|
|
151
259
|
declare function listingLookupKey(raw: string): string;
|
|
152
260
|
declare function listingPublicPath(listing: {
|
|
@@ -248,10 +356,10 @@ declare const STUDIO_SDK_CONTRACT: {
|
|
|
248
356
|
/**
|
|
249
357
|
* Exact pin for generated Studio sites. Must be ≥ `selfInjectSince` so
|
|
250
358
|
* prompts that skip the layout chrome tag match the tarball v0 installs.
|
|
251
|
-
* This PR’s changeset publishes that tarball as 0.4.
|
|
359
|
+
* This PR’s changeset publishes that tarball as 0.4.3 — do not generate
|
|
252
360
|
* against this floor until Version Packages is on npm.
|
|
253
361
|
*/
|
|
254
|
-
readonly minNpmVersion: "0.4.
|
|
362
|
+
readonly minNpmVersion: "0.4.3";
|
|
255
363
|
/** First release where ListingCard and ResultsSkeleton inject the sheet. */
|
|
256
364
|
readonly selfInjectSince: "0.4.2";
|
|
257
365
|
readonly chromeStrategy: "self-inject";
|
|
@@ -268,13 +376,17 @@ declare const STUDIO_SDK_CONTRACT: {
|
|
|
268
376
|
readonly SearchChromeStyles: "0.4.1";
|
|
269
377
|
};
|
|
270
378
|
readonly forbiddenImports: readonly ["@garagem-ai/site-sdk/react/search.css"];
|
|
379
|
+
readonly leadStrategy: "visit-default";
|
|
380
|
+
readonly leadExports: readonly ["getLeadUi", "submitVisitLead", "submitContactLead", "slotsForDate", "expandVisitSchedule", "expandVisitTimeSlots", "isVisitSlotAllowed", "STUDIO_DEFAULT_VISIT_SCHEDULE"];
|
|
271
381
|
};
|
|
272
382
|
type StudioSdkContract = typeof STUDIO_SDK_CONTRACT;
|
|
383
|
+
declare function hasShowcaseLeadsPostUrl(text: string): boolean;
|
|
273
384
|
declare function coerceNpmVersion(raw: unknown): string | null;
|
|
274
385
|
declare function compareSemver(a: string, b: string): number;
|
|
275
386
|
declare function parseReactSdkNamedImports(source: string): string[];
|
|
276
387
|
declare function unavailableReactImports(source: string, pin: string): string[];
|
|
277
388
|
declare function studioSdkPinInstruction(): string;
|
|
389
|
+
declare function studioLeadInstruction(): string;
|
|
278
390
|
declare function studioChromeInstruction(): string;
|
|
279
391
|
/**
|
|
280
392
|
* Tokens that must not appear in Studio codegen (prompts, recipes, repair).
|
|
@@ -366,6 +478,19 @@ interface GaragemClient {
|
|
|
366
478
|
siteId?: string;
|
|
367
479
|
next?: RequestNextOptions;
|
|
368
480
|
}): Promise<CmsEntry>;
|
|
481
|
+
/** Visit/contact dialog schema (slots, labels). */
|
|
482
|
+
getLeadUi(args?: {
|
|
483
|
+
siteId?: string;
|
|
484
|
+
next?: RequestNextOptions;
|
|
485
|
+
}): Promise<LeadUi>;
|
|
486
|
+
/** POST a visit lead (`leadType: "visit"`). */
|
|
487
|
+
submitVisitLead(args: Omit<VisitLeadInput, "siteId" | "baseUrl" | "fetch"> & {
|
|
488
|
+
siteId?: string;
|
|
489
|
+
}): Promise<LeadSubmitResult>;
|
|
490
|
+
/** POST a contact lead (`leadType: "contact"`). */
|
|
491
|
+
submitContactLead(args: Omit<ContactLeadInput, "siteId" | "baseUrl" | "fetch"> & {
|
|
492
|
+
siteId?: string;
|
|
493
|
+
}): Promise<LeadSubmitResult>;
|
|
369
494
|
}
|
|
370
495
|
/**
|
|
371
496
|
* Bind base URL, fetch and site to a single client object. Useful when
|
|
@@ -377,4 +502,4 @@ interface GaragemClient {
|
|
|
377
502
|
*/
|
|
378
503
|
declare function createGaragemClient(options?: CreateGaragemClientOptions): GaragemClient;
|
|
379
504
|
|
|
380
|
-
export { AppliedSearchChange, AppliedSearchQuery, CmsCollection, CmsEntriesResult, CmsEntry, type CreateGaragemClientOptions, type FetchLike, type GaragemClient, GaragemSdkError, type GetCmsCollectionOptions, type GetCmsCollectionsOptions, type GetCmsEntriesOptions, type GetCmsEntryOptions, type GetListingOptions, type GetListingsOptions, type GetSearchUiOptions, type GetSimilarListingsOptions, type GetSiteOptions, ListingDetail, ListingFilters, ListingsResult, type LocationFilterInput, QueryListingsFilters, type QueryListingsOptions, QueryListingsParams, QueryListingsResult, RequestNextOptions, type ResolvePublicSiteIdOptions, SEARCH_CSS_RECIPE, SEARCH_CSS_VARS, STUDIO_SDK_CONTRACT, STUDIO_SDK_PACKAGE, type SearchListingsOptions, SearchListingsParams, SearchListingsResult, SearchPathFilters, SearchUi, SearchUiDictionary, SimilarListingsResult, Site, type StudioSdkContract, coerceNpmVersion, compareSemver, composeSearchPublicHref, composeSearchPublicPath, createGaragemClient, formatAreaM2, formatGroupedInteger, formatListingPrice, getCmsCollection, getCmsCollections, getCmsEntries, getCmsEntry, getListing, getListings, getSearchUi, getSimilarListings, getSite, isStudioPreviewHost, listingBusinessLabel, listingLookupKey, listingPublicPath, mergeAppliedSearchQueryIntoSearch, parseAppliedSearchQuery, parseGroupedInteger, parseReactSdkNamedImports, parseSearchPublicPath, pathFiltersToQueryFilters, pathLocationToFilterInput, queryListings, reduceAppliedSearchQuery, resolvePublicSiteId, searchListings, serializeAppliedSearchQuery, studioChromeInstruction, studioCodegenContractViolations, studioSdkPinInstruction, unavailableReactImports };
|
|
505
|
+
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, 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, parseAppliedSearchQuery, parseGroupedInteger, parseReactSdkNamedImports, parseSearchPublicPath, pathFiltersToQueryFilters, pathLocationToFilterInput, queryListings, reduceAppliedSearchQuery, resolvePublicSiteId, searchListings, serializeAppliedSearchQuery, slotsForDate, studioChromeInstruction, studioCodegenContractViolations, studioDefaultLeadUi, studioLeadInstruction, studioSdkPinInstruction, submitContactLead, submitVisitLead, unavailableReactImports };
|