htag-sdk 0.3.1 → 0.4.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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/errors.ts","../src/http.ts","../src/address/client.ts","../src/property/client.ts","../src/markets/trends.ts","../src/markets/client.ts","../src/intent-hub/client.ts","../src/client.ts"],"sourcesContent":["// ---------------------------------------------------------------------------\n// @htag/sdk — Official TypeScript SDK for HtAG Location Intelligence APIs\n// ---------------------------------------------------------------------------\n\n// Main client\nexport { HtAgApiClient } from './client.js';\n\n// Configuration types\nexport type {\n HtAgClientOptions,\n ResolvedConfig,\n BaseResponse,\n RequestOptions,\n LevelEnum,\n PropertyTypeEnum,\n} from './types.js';\n\n// Error classes\nexport {\n HtAgError,\n AuthenticationError,\n RateLimitError,\n ValidationError,\n ServerError,\n} from './errors.js';\n\n// Address domain\nexport { AddressClient } from './address/index.js';\nexport type {\n AddressRecord,\n AddressSearchResult,\n AddressSearchParams,\n AddressSearchResponse,\n AddressInsightsParams,\n AddressInsightsResponse,\n BatchStandardiseParams,\n BatchStandardiseResponse,\n StandardisedAddress,\n} from './address/index.js';\n\n// Property domain\nexport { PropertyClient } from './property/index.js';\nexport type {\n SoldPropertyRecord,\n SoldSearchParams,\n SoldPropertiesResponse,\n} from './property/index.js';\n\n// Markets domain\nexport { MarketsClient, TrendsClient } from './markets/index.js';\nexport type {\n MarketSnapshot,\n PriceHistoryOut,\n RentHistoryOut,\n YieldHistoryOut,\n FSDMonthlyOut,\n FSDQuarterlyOut,\n FSDYearlyOut,\n EssentialsOut,\n GRCOut,\n DemandProfileOut,\n LogicNode,\n AdvancedSearchBody,\n SnapshotsParams,\n MarketQueryParams,\n TrendsParams,\n SnapshotsResponse,\n MarketQueryResponse,\n PriceResponse,\n RentResponse,\n YieldResponse,\n SupplyDemandResponse,\n SearchIndexResponse,\n HoldPeriodResponse,\n PerformanceResponse,\n GrowthRatesResponse,\n DemandProfileResponse,\n} from './markets/index.js';\n\n// Intent Hub domain\nexport { IntentHubClient } from './intent-hub/index.js';\nexport type {\n SourceType,\n IntegrationType,\n IntegrationStatus,\n Sentiment,\n Urgency,\n SubmitEventParams,\n ClassifiedEvent,\n QueryEventsParams,\n PaginatedEvents,\n CreateIntegrationParams,\n UpdateIntegrationParams,\n Integration,\n TestResult,\n CreateSubscriptionParams,\n UpdateSubscriptionParams,\n Subscription,\n EventCategory,\n EventType,\n TagInfo,\n} from './intent-hub/index.js';\n","/**\n * Base error class for all HtAG SDK errors.\n */\nexport class HtAgError extends Error {\n /** HTTP status code, if available. */\n readonly status: number | undefined;\n\n /** Raw response body, if available. */\n readonly body: unknown;\n\n /** The request URL that caused the error. */\n readonly url: string | undefined;\n\n constructor(\n message: string,\n options?: {\n status?: number;\n body?: unknown;\n url?: string;\n cause?: unknown;\n },\n ) {\n super(message, { cause: options?.cause });\n this.name = 'HtAgError';\n this.status = options?.status;\n this.body = options?.body;\n this.url = options?.url;\n }\n}\n\n/**\n * Thrown when the server returns 401 or 403.\n */\nexport class AuthenticationError extends HtAgError {\n constructor(options: { status: number; body: unknown; url: string }) {\n super(\n `Authentication failed (HTTP ${options.status}). Check your API key.`,\n options,\n );\n this.name = 'AuthenticationError';\n }\n}\n\n/**\n * Thrown when the server returns 429 after exhausting all retries.\n */\nexport class RateLimitError extends HtAgError {\n constructor(options: { body: unknown; url: string }) {\n super('Rate limit exceeded. Please retry after a short delay.', {\n status: 429,\n ...options,\n });\n this.name = 'RateLimitError';\n }\n}\n\n/**\n * Thrown when the server returns 400 or 422.\n */\nexport class ValidationError extends HtAgError {\n constructor(options: { status: number; body: unknown; url: string }) {\n const detail = extractDetail(options.body);\n super(\n detail\n ? `Validation error (HTTP ${options.status}): ${detail}`\n : `Validation error (HTTP ${options.status})`,\n options,\n );\n this.name = 'ValidationError';\n }\n}\n\n/**\n * Thrown when the server returns a 5xx status after exhausting all retries.\n */\nexport class ServerError extends HtAgError {\n constructor(options: { status: number; body: unknown; url: string }) {\n super(`Server error (HTTP ${options.status})`, options);\n this.name = 'ServerError';\n }\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction extractDetail(body: unknown): string | undefined {\n if (body && typeof body === 'object' && 'detail' in body) {\n const detail = (body as Record<string, unknown>).detail;\n if (typeof detail === 'string') return detail;\n if (Array.isArray(detail)) {\n return detail\n .map((d) => {\n if (typeof d === 'string') return d;\n if (d && typeof d === 'object' && 'msg' in d) return String(d.msg);\n return JSON.stringify(d);\n })\n .join('; ');\n }\n return JSON.stringify(detail);\n }\n return undefined;\n}\n","import type { ResolvedConfig, RequestOptions } from './types.js';\nimport {\n HtAgError,\n AuthenticationError,\n RateLimitError,\n ValidationError,\n ServerError,\n} from './errors.js';\n\n// ---------------------------------------------------------------------------\n// camelCase -> snake_case conversion\n// ---------------------------------------------------------------------------\n\n/**\n * Convert a camelCase string to snake_case.\n *\n * Handles sequences of uppercase letters correctly:\n * - \"areaId\" -> \"area_id\"\n * - \"periodEndMin\" -> \"period_end_min\"\n * - \"IRSD\" -> \"irsd\" (all-caps treated as one token)\n */\nfunction toSnakeCase(str: string): string {\n return str\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')\n .replace(/([a-z0-9])([A-Z])/g, '$1_$2')\n .toLowerCase();\n}\n\n// ---------------------------------------------------------------------------\n// Query-string builder\n// ---------------------------------------------------------------------------\n\n/**\n * Build a URL query string from a params object, converting camelCase keys\n * to snake_case. Arrays are joined with commas. `undefined` and `null` values\n * are omitted.\n */\nexport function buildQueryString(\n params: Record<string, unknown>,\n): string {\n const parts: string[] = [];\n\n for (const [key, value] of Object.entries(params)) {\n // Skip internal SDK options that are not API params.\n if (key === 'signal') continue;\n if (value === undefined || value === null) continue;\n\n const snakeKey = toSnakeCase(key);\n\n if (Array.isArray(value)) {\n if (value.length > 0) {\n parts.push(\n `${encodeURIComponent(snakeKey)}=${encodeURIComponent(value.join(','))}`,\n );\n }\n } else {\n parts.push(\n `${encodeURIComponent(snakeKey)}=${encodeURIComponent(String(value))}`,\n );\n }\n }\n\n return parts.length > 0 ? `?${parts.join('&')}` : '';\n}\n\n// ---------------------------------------------------------------------------\n// Retryable HTTP client\n// ---------------------------------------------------------------------------\n\nfunction isRetryable(status: number): boolean {\n return status === 429 || status >= 500;\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\n/**\n * Parse the body of a response. Returns the parsed JSON on success or a string\n * representation when parsing fails.\n */\nasync function parseBody(response: Response): Promise<unknown> {\n const contentType = response.headers.get('content-type') ?? '';\n if (contentType.includes('application/json')) {\n try {\n return await response.json();\n } catch {\n return await response.text();\n }\n }\n return await response.text();\n}\n\n/**\n * Throw the appropriate typed error for the given HTTP status.\n */\nfunction throwForStatus(\n status: number,\n body: unknown,\n url: string,\n): never {\n if (status === 401 || status === 403) {\n throw new AuthenticationError({ status, body, url });\n }\n if (status === 429) {\n throw new RateLimitError({ body, url });\n }\n if (status === 400 || status === 422) {\n throw new ValidationError({ status, body, url });\n }\n if (status >= 500) {\n throw new ServerError({ status, body, url });\n }\n throw new HtAgError(`HTTP ${status}`, { status, body, url });\n}\n\n/**\n * Internal HTTP transport used by all domain clients.\n */\nexport class HttpClient {\n constructor(private readonly config: ResolvedConfig) {}\n\n /**\n * Execute a GET request against the public API base.\n */\n async get<T>(path: string, options?: RequestOptions): Promise<T> {\n return this.request<T>('GET', this.config.publicBaseUrl + path, undefined, options);\n }\n\n /**\n * Execute a POST request against the public API base.\n */\n async post<T>(\n path: string,\n body: unknown,\n options?: RequestOptions,\n ): Promise<T> {\n return this.request<T>('POST', this.config.publicBaseUrl + path, body, options);\n }\n\n /**\n * Execute a PATCH request against the public API base.\n */\n async patch<T>(\n path: string,\n body: unknown,\n options?: RequestOptions,\n ): Promise<T> {\n return this.request<T>('PATCH', this.config.publicBaseUrl + path, body, options);\n }\n\n /**\n * Execute a DELETE request against the public API base.\n */\n async delete<T>(path: string, options?: RequestOptions): Promise<T> {\n return this.request<T>('DELETE', this.config.publicBaseUrl + path, undefined, options);\n }\n\n /**\n * Execute a GET request against the internal API base.\n */\n async internalGet<T>(path: string, options?: RequestOptions): Promise<T> {\n return this.request<T>('GET', this.config.internalBaseUrl + path, undefined, options);\n }\n\n /**\n * Execute a POST request against the internal API base.\n */\n async internalPost<T>(\n path: string,\n body: unknown,\n options?: RequestOptions,\n ): Promise<T> {\n return this.request<T>('POST', this.config.internalBaseUrl + path, body, options);\n }\n\n /**\n * Execute a GET request against the Intent Hub API base.\n */\n async intentHubGet<T>(path: string, options?: RequestOptions): Promise<T> {\n return this.request<T>('GET', this.config.intentHubBaseUrl + path, undefined, options);\n }\n\n /**\n * Execute a POST request against the Intent Hub API base.\n */\n async intentHubPost<T>(\n path: string,\n body: unknown,\n options?: RequestOptions,\n ): Promise<T> {\n return this.request<T>('POST', this.config.intentHubBaseUrl + path, body, options);\n }\n\n /**\n * Execute a PATCH request against the Intent Hub API base.\n */\n async intentHubPatch<T>(\n path: string,\n body: unknown,\n options?: RequestOptions,\n ): Promise<T> {\n return this.request<T>('PATCH', this.config.intentHubBaseUrl + path, body, options);\n }\n\n /**\n * Execute a DELETE request against the Intent Hub API base.\n */\n async intentHubDelete<T>(path: string, options?: RequestOptions): Promise<T> {\n return this.request<T>('DELETE', this.config.intentHubBaseUrl + path, undefined, options);\n }\n\n // -----------------------------------------------------------------------\n // Core request implementation with retries and exponential backoff\n // -----------------------------------------------------------------------\n\n private async request<T>(\n method: string,\n url: string,\n body: unknown,\n options?: RequestOptions,\n ): Promise<T> {\n const headers: Record<string, string> = {\n 'x-api-key': this.config.apiKey,\n 'accept': 'application/json',\n };\n\n if (body !== undefined) {\n headers['content-type'] = 'application/json';\n }\n\n let lastError: Error | undefined;\n\n for (let attempt = 0; attempt <= this.config.maxRetries; attempt++) {\n // If this is a retry, wait with exponential backoff + jitter.\n if (attempt > 0) {\n const base = this.config.retryBaseDelay * Math.pow(2, attempt - 1);\n const jitter = Math.random() * base * 0.5;\n await sleep(base + jitter);\n }\n\n // Build an AbortController that combines the user signal with a timeout.\n const controller = new AbortController();\n let timeoutId: ReturnType<typeof setTimeout> | undefined;\n\n const cleanup = () => {\n if (timeoutId !== undefined) clearTimeout(timeoutId);\n };\n\n // Wire up caller's abort signal.\n if (options?.signal) {\n if (options.signal.aborted) {\n throw new HtAgError('Request aborted', {\n url,\n cause: options.signal.reason,\n });\n }\n options.signal.addEventListener('abort', () => controller.abort(options.signal!.reason), {\n once: true,\n });\n }\n\n timeoutId = setTimeout(\n () => controller.abort(new Error('Request timed out')),\n this.config.timeout,\n );\n\n try {\n const response = await fetch(url, {\n method,\n headers,\n body: body !== undefined ? JSON.stringify(body) : undefined,\n signal: controller.signal,\n });\n\n cleanup();\n\n if (response.ok) {\n // 204 No Content — nothing to parse.\n if (response.status === 204) {\n return undefined as T;\n }\n return (await parseBody(response)) as T;\n }\n\n const responseBody = await parseBody(response);\n\n // Retry on retryable statuses, unless we've exhausted retries.\n if (isRetryable(response.status) && attempt < this.config.maxRetries) {\n lastError = new HtAgError(`HTTP ${response.status}`, {\n status: response.status,\n body: responseBody,\n url,\n });\n continue;\n }\n\n // Non-retryable or exhausted retries — throw typed error.\n throwForStatus(response.status, responseBody, url);\n } catch (err) {\n cleanup();\n\n // Re-throw our own typed errors.\n if (err instanceof HtAgError) {\n throw err;\n }\n\n // Handle abort / timeout.\n if (err instanceof DOMException && err.name === 'AbortError') {\n if (options?.signal?.aborted) {\n throw new HtAgError('Request aborted', { url, cause: err });\n }\n throw new HtAgError('Request timed out', { url, cause: err });\n }\n\n // Network / fetch errors — retry if we have attempts left.\n if (attempt < this.config.maxRetries) {\n lastError = err instanceof Error ? err : new Error(String(err));\n continue;\n }\n\n throw new HtAgError(\n `Network error: ${err instanceof Error ? err.message : String(err)}`,\n { url, cause: err },\n );\n }\n }\n\n // Should not reach here, but just in case.\n throw lastError ?? new HtAgError('Request failed after retries', { url });\n }\n}\n","import type { HttpClient } from '../http.js';\nimport { buildQueryString } from '../http.js';\nimport type {\n AddressSearchParams,\n AddressSearchResponse,\n AddressInsightsParams,\n AddressInsightsResponse,\n BatchStandardiseParams,\n BatchStandardiseResponse,\n} from './types.js';\n\n/**\n * Client for the Address API domain.\n *\n * ```ts\n * const results = await client.address.search({ q: '100 George St Sydney' });\n * ```\n */\nexport class AddressClient {\n /** @internal */\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Search for addresses matching a free-text query.\n *\n * `GET /v1/address/search`\n */\n async search(params: AddressSearchParams): Promise<AddressSearchResponse> {\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.get<AddressSearchResponse>(`/v1/address/search${qs}`, { signal });\n }\n\n /**\n * Retrieve detailed insights for one or more addresses.\n *\n * `GET /v1/address/insights`\n */\n async insights(params: AddressInsightsParams): Promise<AddressInsightsResponse> {\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.get<AddressInsightsResponse>(`/v1/address/insights${qs}`, { signal });\n }\n\n /**\n * Standardise a batch of raw address strings into structured records.\n *\n * `POST /v1/address/standardise`\n */\n async standardise(params: BatchStandardiseParams): Promise<BatchStandardiseResponse> {\n const { signal, addresses } = params;\n return this.http.post<BatchStandardiseResponse>(\n '/v1/address/standardise',\n { addresses },\n { signal },\n );\n }\n}\n","import type { HttpClient } from '../http.js';\nimport { buildQueryString } from '../http.js';\nimport type {\n SoldSearchParams,\n SoldPropertiesResponse,\n} from './types.js';\n\n/**\n * Client for the Property API domain.\n *\n * ```ts\n * const sold = await client.property.soldSearch({ address: '100 George St Sydney', radius: 2000 });\n * ```\n */\nexport class PropertyClient {\n /** @internal */\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Search for recently sold properties near a location.\n *\n * `GET /v1/property/sold/search`\n */\n async soldSearch(params: SoldSearchParams): Promise<SoldPropertiesResponse> {\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.get<SoldPropertiesResponse>(`/v1/property/sold/search${qs}`, { signal });\n }\n}\n","import type { HttpClient } from '../http.js';\nimport { buildQueryString } from '../http.js';\nimport type {\n TrendsParams,\n PriceResponse,\n RentResponse,\n YieldResponse,\n SupplyDemandResponse,\n SearchIndexResponse,\n HoldPeriodResponse,\n PerformanceResponse,\n GrowthRatesResponse,\n DemandProfileResponse,\n} from './types.js';\n\n/**\n * Client for the Markets Trends API domain.\n *\n * Each method queries a specific time-series metric:\n *\n * ```ts\n * const prices = await client.markets.trends.price({\n * level: 'suburb',\n * areaId: ['SAL10001'],\n * propertyType: ['house'],\n * });\n * ```\n */\nexport class TrendsClient {\n /** @internal */\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Price history trends.\n *\n * `GET /internal-api/v1/markets/trends/price`\n */\n async price(params: TrendsParams): Promise<PriceResponse> {\n return this.trend<PriceResponse>('price', params);\n }\n\n /**\n * Rent history trends.\n *\n * `GET /internal-api/v1/markets/trends/rent`\n */\n async rent(params: TrendsParams): Promise<RentResponse> {\n return this.trend<RentResponse>('rent', params);\n }\n\n /**\n * Yield history trends.\n *\n * `GET /internal-api/v1/markets/trends/yield`\n */\n async yieldHistory(params: TrendsParams): Promise<YieldResponse> {\n return this.trend<YieldResponse>('yield', params);\n }\n\n /**\n * Supply and demand (monthly frequency).\n *\n * `GET /internal-api/v1/markets/trends/supply-demand`\n */\n async supplyDemand(params: TrendsParams): Promise<SupplyDemandResponse> {\n return this.trend<SupplyDemandResponse>('supply-demand', params);\n }\n\n /**\n * Search interest index (quarterly frequency).\n *\n * `GET /internal-api/v1/markets/trends/search-index`\n */\n async searchIndex(params: TrendsParams): Promise<SearchIndexResponse> {\n return this.trend<SearchIndexResponse>('search-index', params);\n }\n\n /**\n * Hold period (yearly frequency).\n *\n * `GET /internal-api/v1/markets/trends/hold-period`\n */\n async holdPeriod(params: TrendsParams): Promise<HoldPeriodResponse> {\n return this.trend<HoldPeriodResponse>('hold-period', params);\n }\n\n /**\n * Performance essentials.\n *\n * `GET /internal-api/v1/markets/trends/performance`\n */\n async performance(params: TrendsParams): Promise<PerformanceResponse> {\n return this.trend<PerformanceResponse>('performance', params);\n }\n\n /**\n * Growth rate cycle.\n *\n * `GET /internal-api/v1/markets/trends/growth-rates`\n */\n async growthRates(params: TrendsParams): Promise<GrowthRatesResponse> {\n return this.trend<GrowthRatesResponse>('growth-rates', params);\n }\n\n /**\n * Demand profile breakdown.\n *\n * `GET /internal-api/v1/markets/trends/demand-profile`\n */\n async demandProfile(params: TrendsParams): Promise<DemandProfileResponse> {\n return this.trend<DemandProfileResponse>('demand-profile', params);\n }\n\n // -----------------------------------------------------------------------\n // Shared implementation\n // -----------------------------------------------------------------------\n\n private async trend<T>(metric: string, params: TrendsParams): Promise<T> {\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.internalGet<T>(\n `/internal-api/v1/markets/trends/${metric}${qs}`,\n { signal },\n );\n }\n}\n","import type { HttpClient } from '../http.js';\nimport { buildQueryString } from '../http.js';\nimport { TrendsClient } from './trends.js';\nimport type {\n SnapshotsParams,\n SnapshotsResponse,\n AdvancedSearchBody,\n MarketQueryResponse,\n} from './types.js';\nimport type { RequestOptions } from '../types.js';\n\n/**\n * Client for the Markets API domain.\n *\n * ```ts\n * const snapshots = await client.markets.snapshots({\n * level: 'suburb',\n * propertyType: ['house'],\n * });\n *\n * const prices = await client.markets.trends.price({\n * level: 'suburb',\n * areaId: ['SAL10001'],\n * });\n * ```\n */\nexport class MarketsClient {\n /** Sub-client for time-series trend endpoints. */\n readonly trends: TrendsClient;\n\n /** @internal */\n constructor(private readonly http: HttpClient) {\n this.trends = new TrendsClient(http);\n }\n\n /**\n * Retrieve market snapshot data with optional filters.\n *\n * `GET /internal-api/v1/markets/snapshots`\n */\n async snapshots(params: SnapshotsParams): Promise<SnapshotsResponse> {\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.internalGet<SnapshotsResponse>(\n `/internal-api/v1/markets/snapshots${qs}`,\n { signal },\n );\n }\n\n /**\n * Advanced market query with logical filter expressions.\n *\n * `POST /internal-api/v1/markets/query`\n */\n async query(\n body: AdvancedSearchBody,\n options?: RequestOptions,\n ): Promise<MarketQueryResponse> {\n return this.http.internalPost<MarketQueryResponse>(\n '/internal-api/v1/markets/query',\n body,\n options,\n );\n }\n}\n","import type { HttpClient } from '../http.js';\nimport { buildQueryString } from '../http.js';\nimport type { RequestOptions } from '../types.js';\nimport type {\n SubmitEventParams,\n ClassifiedEvent,\n QueryEventsParams,\n PaginatedEvents,\n CreateIntegrationParams,\n Integration,\n UpdateIntegrationParams,\n TestResult,\n CreateSubscriptionParams,\n Subscription,\n UpdateSubscriptionParams,\n EventCategory,\n EventType,\n TagInfo,\n} from './types.js';\n\n/**\n * Client for the Intent Hub API domain.\n *\n * ```ts\n * const event = await client.intentHub.submitEvent({\n * sourceType: 'AGENT',\n * sourceId: 'my-agent',\n * textContent: 'User wants to refinance their mortgage',\n * });\n * ```\n */\nexport class IntentHubClient {\n /** @internal */\n constructor(private readonly http: HttpClient) {}\n\n // -------------------------------------------------------------------------\n // Events\n // -------------------------------------------------------------------------\n\n /**\n * Submit a raw event for classification.\n *\n * `POST /intent-hub/v1/events`\n */\n async submitEvent(params: SubmitEventParams): Promise<ClassifiedEvent> {\n const { signal, ...rest } = params;\n return this.http.intentHubPost<ClassifiedEvent>(\n '/events',\n {\n source_type: rest.sourceType,\n source_id: rest.sourceId,\n text_content: rest.textContent,\n payload: rest.payload,\n user_id: rest.userId,\n session_id: rest.sessionId,\n suggested_category: rest.suggestedCategory,\n suggested_intent: rest.suggestedIntent,\n idempotency_key: rest.idempotencyKey,\n event_type: rest.eventType,\n },\n { signal },\n );\n }\n\n /**\n * Retrieve a single classified event by ID.\n *\n * `GET /intent-hub/v1/events/:eventId`\n */\n async getEvent(eventId: string, options?: RequestOptions): Promise<ClassifiedEvent> {\n return this.http.intentHubGet<ClassifiedEvent>(\n `/events/${encodeURIComponent(eventId)}`,\n options,\n );\n }\n\n /**\n * Query classified events with optional filters.\n *\n * `GET /intent-hub/v1/events`\n */\n async queryEvents(params?: QueryEventsParams): Promise<PaginatedEvents> {\n if (!params) {\n return this.http.intentHubGet<PaginatedEvents>('/events');\n }\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.intentHubGet<PaginatedEvents>(`/events${qs}`, { signal });\n }\n\n // -------------------------------------------------------------------------\n // Integrations\n // -------------------------------------------------------------------------\n\n /**\n * Create a new integration endpoint.\n *\n * `POST /intent-hub/v1/integrations`\n */\n async createIntegration(params: CreateIntegrationParams): Promise<Integration> {\n const { signal, ...rest } = params;\n return this.http.intentHubPost<Integration>(\n '/integrations',\n {\n name: rest.name,\n type: rest.type,\n url: rest.url,\n secret: rest.secret,\n headers: rest.headers,\n config: rest.config,\n },\n { signal },\n );\n }\n\n /**\n * List all integrations for the current organisation.\n *\n * `GET /intent-hub/v1/integrations`\n */\n async listIntegrations(options?: RequestOptions): Promise<Integration[]> {\n return this.http.intentHubGet<Integration[]>('/integrations', options);\n }\n\n /**\n * Retrieve a single integration by ID.\n *\n * `GET /intent-hub/v1/integrations/:id`\n */\n async getIntegration(id: string, options?: RequestOptions): Promise<Integration> {\n return this.http.intentHubGet<Integration>(\n `/integrations/${encodeURIComponent(id)}`,\n options,\n );\n }\n\n /**\n * Update an existing integration.\n *\n * `PATCH /intent-hub/v1/integrations/:id`\n */\n async updateIntegration(\n id: string,\n params: UpdateIntegrationParams,\n ): Promise<Integration> {\n const { signal, ...rest } = params;\n return this.http.intentHubPatch<Integration>(\n `/integrations/${encodeURIComponent(id)}`,\n {\n name: rest.name,\n url: rest.url,\n secret: rest.secret,\n status: rest.status,\n },\n { signal },\n );\n }\n\n /**\n * Delete an integration by ID.\n *\n * `DELETE /intent-hub/v1/integrations/:id`\n */\n async deleteIntegration(id: string, options?: RequestOptions): Promise<void> {\n return this.http.intentHubDelete<void>(\n `/integrations/${encodeURIComponent(id)}`,\n options,\n );\n }\n\n /**\n * Send a test event to an integration endpoint.\n *\n * `POST /intent-hub/v1/integrations/:id/test`\n */\n async testIntegration(id: string, options?: RequestOptions): Promise<TestResult> {\n return this.http.intentHubPost<TestResult>(\n `/integrations/${encodeURIComponent(id)}/test`,\n {},\n options,\n );\n }\n\n // -------------------------------------------------------------------------\n // Subscriptions\n // -------------------------------------------------------------------------\n\n /**\n * Create a new subscription linking event patterns to an integration.\n *\n * `POST /intent-hub/v1/subscriptions`\n */\n async createSubscription(params: CreateSubscriptionParams): Promise<Subscription> {\n const { signal, ...rest } = params;\n return this.http.intentHubPost<Subscription>(\n '/subscriptions',\n {\n integration_id: rest.integrationId,\n event_type_slug: rest.eventTypeSlug,\n tag: rest.tag,\n intent_pattern: rest.intentPattern,\n filters: rest.filters,\n },\n { signal },\n );\n }\n\n /**\n * List all subscriptions for the current organisation.\n *\n * `GET /intent-hub/v1/subscriptions`\n */\n async listSubscriptions(options?: RequestOptions): Promise<Subscription[]> {\n return this.http.intentHubGet<Subscription[]>('/subscriptions', options);\n }\n\n /**\n * Retrieve a single subscription by ID.\n *\n * `GET /intent-hub/v1/subscriptions/:id`\n */\n async getSubscription(id: string, options?: RequestOptions): Promise<Subscription> {\n return this.http.intentHubGet<Subscription>(\n `/subscriptions/${encodeURIComponent(id)}`,\n options,\n );\n }\n\n /**\n * Update an existing subscription.\n *\n * `PATCH /intent-hub/v1/subscriptions/:id`\n */\n async updateSubscription(\n id: string,\n params: UpdateSubscriptionParams,\n ): Promise<Subscription> {\n const { signal, ...rest } = params;\n return this.http.intentHubPatch<Subscription>(\n `/subscriptions/${encodeURIComponent(id)}`,\n {\n event_type_slug: rest.eventTypeSlug,\n tag: rest.tag,\n intent_pattern: rest.intentPattern,\n integration_id: rest.integrationId,\n is_active: rest.isActive,\n },\n { signal },\n );\n }\n\n /**\n * Delete a subscription by ID.\n *\n * `DELETE /intent-hub/v1/subscriptions/:id`\n */\n async deleteSubscription(id: string, options?: RequestOptions): Promise<void> {\n return this.http.intentHubDelete<void>(\n `/subscriptions/${encodeURIComponent(id)}`,\n options,\n );\n }\n\n // -------------------------------------------------------------------------\n // Catalog\n // -------------------------------------------------------------------------\n\n /**\n * List all event categories in the taxonomy.\n *\n * `GET /intent-hub/v1/catalog/categories`\n */\n async listCategories(options?: RequestOptions): Promise<EventCategory[]> {\n return this.http.intentHubGet<EventCategory[]>('/catalog/categories', options);\n }\n\n /**\n * List event types, optionally filtered by category.\n *\n * `GET /intent-hub/v1/catalog/event-types`\n */\n async listEventTypes(\n params?: { category?: string } & RequestOptions,\n ): Promise<EventType[]> {\n if (!params) {\n return this.http.intentHubGet<EventType[]>('/catalog/event-types');\n }\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.intentHubGet<EventType[]>(`/catalog/event-types${qs}`, { signal });\n }\n\n /**\n * List all tags with their usage counts.\n *\n * `GET /intent-hub/v1/catalog/tags`\n */\n async listTags(options?: RequestOptions): Promise<TagInfo[]> {\n return this.http.intentHubGet<TagInfo[]>('/catalog/tags', options);\n }\n}\n","import type { HtAgClientOptions, ResolvedConfig } from './types.js';\nimport { HttpClient } from './http.js';\nimport { AddressClient } from './address/client.js';\nimport { PropertyClient } from './property/client.js';\nimport { MarketsClient } from './markets/client.js';\nimport { IntentHubClient } from './intent-hub/client.js';\n\n// ---------------------------------------------------------------------------\n// Defaults\n// ---------------------------------------------------------------------------\n\nconst DEFAULT_MAX_RETRIES = 3;\nconst DEFAULT_RETRY_BASE_DELAY = 500; // ms\nconst DEFAULT_TIMEOUT = 30_000; // 30 seconds\n\n/**\n * Build the environment-derived base URLs.\n *\n * - `prod` -> `https://api.prod.htagai.com`\n * - `dev` -> `https://api.dev.htagai.com`\n */\nfunction resolveBaseUrls(options: HtAgClientOptions): {\n publicBaseUrl: string;\n internalBaseUrl: string;\n intentHubBaseUrl: string;\n} {\n if (options.baseUrl) {\n // Strip trailing slashes for consistency.\n const base = options.baseUrl.replace(/\\/+$/, '');\n return { publicBaseUrl: base, internalBaseUrl: base, intentHubBaseUrl: base };\n }\n\n const env = options.environment ?? 'prod';\n const base = `https://api.${env}.htagai.com`;\n return {\n publicBaseUrl: base,\n internalBaseUrl: base,\n intentHubBaseUrl: `${base}/intent-hub/v1`,\n };\n}\n\n// ---------------------------------------------------------------------------\n// HtAgApiClient\n// ---------------------------------------------------------------------------\n\n/**\n * Top-level client for the HtAG Location Intelligence APIs.\n *\n * ```ts\n * import { HtAgApiClient } from '@htag/sdk';\n *\n * const client = new HtAgApiClient({\n * apiKey: process.env.HTAG_API_KEY!,\n * environment: 'prod',\n * });\n *\n * const results = await client.address.search({ q: '100 George St Sydney' });\n * ```\n */\nexport class HtAgApiClient {\n /** Address search, insights and standardisation. */\n readonly address: AddressClient;\n\n /** Sold property search. */\n readonly property: PropertyClient;\n\n /** Market snapshots, advanced queries and time-series trends. */\n readonly markets: MarketsClient;\n\n /** Intent Hub: event classification, integrations and subscriptions. */\n readonly intentHub: IntentHubClient;\n\n constructor(options: HtAgClientOptions) {\n if (!options.apiKey) {\n throw new Error(\n 'HtAgApiClient requires an apiKey. Pass it in the constructor options.',\n );\n }\n\n const { publicBaseUrl, internalBaseUrl, intentHubBaseUrl } = resolveBaseUrls(options);\n\n const config: ResolvedConfig = {\n apiKey: options.apiKey,\n publicBaseUrl,\n internalBaseUrl,\n intentHubBaseUrl,\n maxRetries: options.maxRetries ?? DEFAULT_MAX_RETRIES,\n retryBaseDelay: options.retryBaseDelay ?? DEFAULT_RETRY_BASE_DELAY,\n timeout: options.timeout ?? DEFAULT_TIMEOUT,\n };\n\n const http = new HttpClient(config);\n\n this.address = new AddressClient(http);\n this.property = new PropertyClient(http);\n this.markets = new MarketsClient(http);\n this.intentHub = new IntentHubClient(http);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAM,YAAN,cAAwB,MAAM;AAAA;AAAA,EAE1B;AAAA;AAAA,EAGA;AAAA;AAAA,EAGA;AAAA,EAET,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,aAAwB,iBAAiB,OAAO;AAAA,EACnE;AACF;;;ACjSA,IAAM,sBAAsB;AAC5B,IAAM,2BAA2B;AACjC,IAAM,kBAAkB;AAQxB,SAAS,gBAAgB,SAIvB;AACA,MAAI,QAAQ,SAAS;AAEnB,UAAMA,QAAO,QAAQ,QAAQ,QAAQ,QAAQ,EAAE;AAC/C,WAAO,EAAE,eAAeA,OAAM,iBAAiBA,OAAM,kBAAkBA,MAAK;AAAA,EAC9E;AAEA,QAAM,MAAM,QAAQ,eAAe;AACnC,QAAM,OAAO,eAAe,GAAG;AAC/B,SAAO;AAAA,IACL,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,kBAAkB,GAAG,IAAI;AAAA,EAC3B;AACF;AAoBO,IAAM,gBAAN,MAAoB;AAAA;AAAA,EAEhB;AAAA;AAAA,EAGA;AAAA;AAAA,EAGA;AAAA;AAAA,EAGA;AAAA,EAET,YAAY,SAA4B;AACtC,QAAI,CAAC,QAAQ,QAAQ;AACnB,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAEA,UAAM,EAAE,eAAe,iBAAiB,iBAAiB,IAAI,gBAAgB,OAAO;AAEpF,UAAM,SAAyB;AAAA,MAC7B,QAAQ,QAAQ;AAAA,MAChB;AAAA,MACA;AAAA,MACA;AAAA,MACA,YAAY,QAAQ,cAAc;AAAA,MAClC,gBAAgB,QAAQ,kBAAkB;AAAA,MAC1C,SAAS,QAAQ,WAAW;AAAA,IAC9B;AAEA,UAAM,OAAO,IAAI,WAAW,MAAM;AAElC,SAAK,UAAU,IAAI,cAAc,IAAI;AACrC,SAAK,WAAW,IAAI,eAAe,IAAI;AACvC,SAAK,UAAU,IAAI,cAAc,IAAI;AACrC,SAAK,YAAY,IAAI,gBAAgB,IAAI;AAAA,EAC3C;AACF;","names":["base"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/errors.ts","../src/http.ts","../src/address/client.ts","../src/property/client.ts","../src/markets/trends.ts","../src/markets/client.ts","../src/intent-hub/client.ts","../src/client.ts"],"sourcesContent":["// ---------------------------------------------------------------------------\n// @htag/sdk — Official TypeScript SDK for HtAG Location Intelligence APIs\n// ---------------------------------------------------------------------------\n\n// Main client\nexport { HtAgApiClient } from './client.js';\n\n// Configuration types\nexport type {\n HtAgClientOptions,\n ResolvedConfig,\n BaseResponse,\n RequestOptions,\n LevelEnum,\n PropertyTypeEnum,\n} from './types.js';\n\n// Error classes\nexport {\n HtAgError,\n AuthenticationError,\n RateLimitError,\n ValidationError,\n ServerError,\n} from './errors.js';\n\n// Address domain\nexport { AddressClient } from './address/index.js';\nexport type {\n AddressRecord,\n AddressSearchResult,\n AddressSearchParams,\n AddressSearchResponse,\n AddressInsightsParams,\n AddressInsightsResponse,\n BatchStandardiseParams,\n BatchStandardiseResponse,\n StandardisedAddress,\n} from './address/index.js';\n\n// Property domain\nexport { PropertyClient } from './property/index.js';\nexport type {\n SoldPropertyRecord,\n SoldSearchParams,\n SoldPropertiesResponse,\n} from './property/index.js';\n\n// Markets domain\nexport { MarketsClient, TrendsClient } from './markets/index.js';\nexport type {\n MarketSnapshot,\n PriceHistoryOut,\n RentHistoryOut,\n YieldHistoryOut,\n FSDMonthlyOut,\n FSDQuarterlyOut,\n FSDYearlyOut,\n EssentialsOut,\n GRCOut,\n DemandProfileOut,\n LogicNode,\n AdvancedSearchBody,\n SnapshotsParams,\n MarketQueryParams,\n TrendsParams,\n TrendsWithBedroomsParams,\n SnapshotsResponse,\n MarketQueryResponse,\n PriceResponse,\n RentResponse,\n YieldResponse,\n SupplyDemandResponse,\n SearchIndexResponse,\n HoldPeriodResponse,\n PerformanceResponse,\n GrowthRatesResponse,\n DemandProfileResponse,\n} from './markets/index.js';\n\n// Intent Hub domain\nexport { IntentHubClient } from './intent-hub/index.js';\nexport type {\n SourceType,\n IntegrationType,\n IntegrationStatus,\n Sentiment,\n Urgency,\n SubmitEventParams,\n ClassifiedEvent,\n QueryEventsParams,\n PaginatedEvents,\n CreateIntegrationParams,\n UpdateIntegrationParams,\n Integration,\n TestResult,\n CreateSubscriptionParams,\n UpdateSubscriptionParams,\n Subscription,\n EventCategory,\n EventType,\n TagInfo,\n} from './intent-hub/index.js';\n","/**\n * Base error class for all HtAG SDK errors.\n */\nexport class HtAgError extends Error {\n /** HTTP status code, if available. */\n readonly status: number | undefined;\n\n /** Raw response body, if available. */\n readonly body: unknown;\n\n /** The request URL that caused the error. */\n readonly url: string | undefined;\n\n constructor(\n message: string,\n options?: {\n status?: number;\n body?: unknown;\n url?: string;\n cause?: unknown;\n },\n ) {\n super(message, { cause: options?.cause });\n this.name = 'HtAgError';\n this.status = options?.status;\n this.body = options?.body;\n this.url = options?.url;\n }\n}\n\n/**\n * Thrown when the server returns 401 or 403.\n */\nexport class AuthenticationError extends HtAgError {\n constructor(options: { status: number; body: unknown; url: string }) {\n super(\n `Authentication failed (HTTP ${options.status}). Check your API key.`,\n options,\n );\n this.name = 'AuthenticationError';\n }\n}\n\n/**\n * Thrown when the server returns 429 after exhausting all retries.\n */\nexport class RateLimitError extends HtAgError {\n constructor(options: { body: unknown; url: string }) {\n super('Rate limit exceeded. Please retry after a short delay.', {\n status: 429,\n ...options,\n });\n this.name = 'RateLimitError';\n }\n}\n\n/**\n * Thrown when the server returns 400 or 422.\n */\nexport class ValidationError extends HtAgError {\n constructor(options: { status: number; body: unknown; url: string }) {\n const detail = extractDetail(options.body);\n super(\n detail\n ? `Validation error (HTTP ${options.status}): ${detail}`\n : `Validation error (HTTP ${options.status})`,\n options,\n );\n this.name = 'ValidationError';\n }\n}\n\n/**\n * Thrown when the server returns a 5xx status after exhausting all retries.\n */\nexport class ServerError extends HtAgError {\n constructor(options: { status: number; body: unknown; url: string }) {\n super(`Server error (HTTP ${options.status})`, options);\n this.name = 'ServerError';\n }\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction extractDetail(body: unknown): string | undefined {\n if (body && typeof body === 'object' && 'detail' in body) {\n const detail = (body as Record<string, unknown>).detail;\n if (typeof detail === 'string') return detail;\n if (Array.isArray(detail)) {\n return detail\n .map((d) => {\n if (typeof d === 'string') return d;\n if (d && typeof d === 'object' && 'msg' in d) return String(d.msg);\n return JSON.stringify(d);\n })\n .join('; ');\n }\n return JSON.stringify(detail);\n }\n return undefined;\n}\n","import type { ResolvedConfig, RequestOptions } from './types.js';\nimport {\n HtAgError,\n AuthenticationError,\n RateLimitError,\n ValidationError,\n ServerError,\n} from './errors.js';\n\n// ---------------------------------------------------------------------------\n// camelCase -> snake_case conversion\n// ---------------------------------------------------------------------------\n\n/**\n * Convert a camelCase string to snake_case.\n *\n * Handles sequences of uppercase letters correctly:\n * - \"areaId\" -> \"area_id\"\n * - \"periodEndMin\" -> \"period_end_min\"\n * - \"IRSD\" -> \"irsd\" (all-caps treated as one token)\n */\nfunction toSnakeCase(str: string): string {\n return str\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')\n .replace(/([a-z0-9])([A-Z])/g, '$1_$2')\n .toLowerCase();\n}\n\n// ---------------------------------------------------------------------------\n// Query-string builder\n// ---------------------------------------------------------------------------\n\n/**\n * Build a URL query string from a params object, converting camelCase keys\n * to snake_case. Arrays are joined with commas. `undefined` and `null` values\n * are omitted.\n */\nexport function buildQueryString(\n params: Record<string, unknown>,\n): string {\n const parts: string[] = [];\n\n for (const [key, value] of Object.entries(params)) {\n // Skip internal SDK options that are not API params.\n if (key === 'signal') continue;\n if (value === undefined || value === null) continue;\n\n const snakeKey = toSnakeCase(key);\n\n if (Array.isArray(value)) {\n if (value.length > 0) {\n parts.push(\n `${encodeURIComponent(snakeKey)}=${encodeURIComponent(value.join(','))}`,\n );\n }\n } else {\n parts.push(\n `${encodeURIComponent(snakeKey)}=${encodeURIComponent(String(value))}`,\n );\n }\n }\n\n return parts.length > 0 ? `?${parts.join('&')}` : '';\n}\n\n// ---------------------------------------------------------------------------\n// Retryable HTTP client\n// ---------------------------------------------------------------------------\n\nfunction isRetryable(status: number): boolean {\n return status === 429 || status >= 500;\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\n/**\n * Parse the body of a response. Returns the parsed JSON on success or a string\n * representation when parsing fails.\n */\nasync function parseBody(response: Response): Promise<unknown> {\n const contentType = response.headers.get('content-type') ?? '';\n if (contentType.includes('application/json')) {\n try {\n return await response.json();\n } catch {\n return await response.text();\n }\n }\n return await response.text();\n}\n\n/**\n * Throw the appropriate typed error for the given HTTP status.\n */\nfunction throwForStatus(\n status: number,\n body: unknown,\n url: string,\n): never {\n if (status === 401 || status === 403) {\n throw new AuthenticationError({ status, body, url });\n }\n if (status === 429) {\n throw new RateLimitError({ body, url });\n }\n if (status === 400 || status === 422) {\n throw new ValidationError({ status, body, url });\n }\n if (status >= 500) {\n throw new ServerError({ status, body, url });\n }\n throw new HtAgError(`HTTP ${status}`, { status, body, url });\n}\n\n/**\n * Internal HTTP transport used by all domain clients.\n */\nexport class HttpClient {\n constructor(private readonly config: ResolvedConfig) {}\n\n /**\n * Execute a GET request against the public API base.\n */\n async get<T>(path: string, options?: RequestOptions): Promise<T> {\n return this.request<T>('GET', this.config.publicBaseUrl + path, undefined, options);\n }\n\n /**\n * Execute a POST request against the public API base.\n */\n async post<T>(\n path: string,\n body: unknown,\n options?: RequestOptions,\n ): Promise<T> {\n return this.request<T>('POST', this.config.publicBaseUrl + path, body, options);\n }\n\n /**\n * Execute a PATCH request against the public API base.\n */\n async patch<T>(\n path: string,\n body: unknown,\n options?: RequestOptions,\n ): Promise<T> {\n return this.request<T>('PATCH', this.config.publicBaseUrl + path, body, options);\n }\n\n /**\n * Execute a DELETE request against the public API base.\n */\n async delete<T>(path: string, options?: RequestOptions): Promise<T> {\n return this.request<T>('DELETE', this.config.publicBaseUrl + path, undefined, options);\n }\n\n /**\n * Execute a GET request against the internal API base.\n */\n async internalGet<T>(path: string, options?: RequestOptions): Promise<T> {\n return this.request<T>('GET', this.config.internalBaseUrl + path, undefined, options);\n }\n\n /**\n * Execute a POST request against the internal API base.\n */\n async internalPost<T>(\n path: string,\n body: unknown,\n options?: RequestOptions,\n ): Promise<T> {\n return this.request<T>('POST', this.config.internalBaseUrl + path, body, options);\n }\n\n /**\n * Execute a GET request against the Intent Hub API base.\n */\n async intentHubGet<T>(path: string, options?: RequestOptions): Promise<T> {\n return this.request<T>('GET', this.config.intentHubBaseUrl + path, undefined, options);\n }\n\n /**\n * Execute a POST request against the Intent Hub API base.\n */\n async intentHubPost<T>(\n path: string,\n body: unknown,\n options?: RequestOptions,\n ): Promise<T> {\n return this.request<T>('POST', this.config.intentHubBaseUrl + path, body, options);\n }\n\n /**\n * Execute a PATCH request against the Intent Hub API base.\n */\n async intentHubPatch<T>(\n path: string,\n body: unknown,\n options?: RequestOptions,\n ): Promise<T> {\n return this.request<T>('PATCH', this.config.intentHubBaseUrl + path, body, options);\n }\n\n /**\n * Execute a DELETE request against the Intent Hub API base.\n */\n async intentHubDelete<T>(path: string, options?: RequestOptions): Promise<T> {\n return this.request<T>('DELETE', this.config.intentHubBaseUrl + path, undefined, options);\n }\n\n // -----------------------------------------------------------------------\n // Core request implementation with retries and exponential backoff\n // -----------------------------------------------------------------------\n\n private async request<T>(\n method: string,\n url: string,\n body: unknown,\n options?: RequestOptions,\n ): Promise<T> {\n const headers: Record<string, string> = {\n 'x-api-key': this.config.apiKey,\n 'accept': 'application/json',\n };\n\n if (body !== undefined) {\n headers['content-type'] = 'application/json';\n }\n\n let lastError: Error | undefined;\n\n for (let attempt = 0; attempt <= this.config.maxRetries; attempt++) {\n // If this is a retry, wait with exponential backoff + jitter.\n if (attempt > 0) {\n const base = this.config.retryBaseDelay * Math.pow(2, attempt - 1);\n const jitter = Math.random() * base * 0.5;\n await sleep(base + jitter);\n }\n\n // Build an AbortController that combines the user signal with a timeout.\n const controller = new AbortController();\n let timeoutId: ReturnType<typeof setTimeout> | undefined;\n\n const cleanup = () => {\n if (timeoutId !== undefined) clearTimeout(timeoutId);\n };\n\n // Wire up caller's abort signal.\n if (options?.signal) {\n if (options.signal.aborted) {\n throw new HtAgError('Request aborted', {\n url,\n cause: options.signal.reason,\n });\n }\n options.signal.addEventListener('abort', () => controller.abort(options.signal!.reason), {\n once: true,\n });\n }\n\n timeoutId = setTimeout(\n () => controller.abort(new Error('Request timed out')),\n this.config.timeout,\n );\n\n try {\n const response = await fetch(url, {\n method,\n headers,\n body: body !== undefined ? JSON.stringify(body) : undefined,\n signal: controller.signal,\n });\n\n cleanup();\n\n if (response.ok) {\n // 204 No Content — nothing to parse.\n if (response.status === 204) {\n return undefined as T;\n }\n return (await parseBody(response)) as T;\n }\n\n const responseBody = await parseBody(response);\n\n // Retry on retryable statuses, unless we've exhausted retries.\n if (isRetryable(response.status) && attempt < this.config.maxRetries) {\n lastError = new HtAgError(`HTTP ${response.status}`, {\n status: response.status,\n body: responseBody,\n url,\n });\n continue;\n }\n\n // Non-retryable or exhausted retries — throw typed error.\n throwForStatus(response.status, responseBody, url);\n } catch (err) {\n cleanup();\n\n // Re-throw our own typed errors.\n if (err instanceof HtAgError) {\n throw err;\n }\n\n // Handle abort / timeout.\n if (err instanceof DOMException && err.name === 'AbortError') {\n if (options?.signal?.aborted) {\n throw new HtAgError('Request aborted', { url, cause: err });\n }\n throw new HtAgError('Request timed out', { url, cause: err });\n }\n\n // Network / fetch errors — retry if we have attempts left.\n if (attempt < this.config.maxRetries) {\n lastError = err instanceof Error ? err : new Error(String(err));\n continue;\n }\n\n throw new HtAgError(\n `Network error: ${err instanceof Error ? err.message : String(err)}`,\n { url, cause: err },\n );\n }\n }\n\n // Should not reach here, but just in case.\n throw lastError ?? new HtAgError('Request failed after retries', { url });\n }\n}\n","import type { HttpClient } from '../http.js';\nimport { buildQueryString } from '../http.js';\nimport type {\n AddressSearchParams,\n AddressSearchResponse,\n AddressInsightsParams,\n AddressInsightsResponse,\n BatchStandardiseParams,\n BatchStandardiseResponse,\n} from './types.js';\n\n/**\n * Client for the Address API domain.\n *\n * ```ts\n * const results = await client.address.search({ q: '100 George St Sydney' });\n * ```\n */\nexport class AddressClient {\n /** @internal */\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Search for addresses matching a free-text query.\n *\n * `GET /v1/address/search`\n */\n async search(params: AddressSearchParams): Promise<AddressSearchResponse> {\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.get<AddressSearchResponse>(`/v1/address/search${qs}`, { signal });\n }\n\n /**\n * Retrieve detailed insights for one or more addresses.\n *\n * `GET /v1/address/insights`\n */\n async insights(params: AddressInsightsParams): Promise<AddressInsightsResponse> {\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.get<AddressInsightsResponse>(`/v1/address/insights${qs}`, { signal });\n }\n\n /**\n * Standardise a batch of raw address strings into structured records.\n *\n * `POST /v1/address/standardise`\n */\n async standardise(params: BatchStandardiseParams): Promise<BatchStandardiseResponse> {\n const { signal, addresses } = params;\n return this.http.post<BatchStandardiseResponse>(\n '/v1/address/standardise',\n { addresses },\n { signal },\n );\n }\n}\n","import type { HttpClient } from '../http.js';\nimport { buildQueryString } from '../http.js';\nimport type {\n SoldSearchParams,\n SoldPropertiesResponse,\n} from './types.js';\n\n/**\n * Client for the Property API domain.\n *\n * ```ts\n * const sold = await client.property.soldSearch({ address: '100 George St Sydney', radius: 2000 });\n * ```\n */\nexport class PropertyClient {\n /** @internal */\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Search for recently sold properties near a location.\n *\n * `GET /v1/property/sold/search`\n */\n async soldSearch(params: SoldSearchParams): Promise<SoldPropertiesResponse> {\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.get<SoldPropertiesResponse>(`/v1/property/sold/search${qs}`, { signal });\n }\n}\n","import type { HttpClient } from '../http.js';\nimport { buildQueryString } from '../http.js';\nimport type {\n TrendsParams,\n TrendsWithBedroomsParams,\n PriceResponse,\n RentResponse,\n YieldResponse,\n SupplyDemandResponse,\n SearchIndexResponse,\n HoldPeriodResponse,\n PerformanceResponse,\n GrowthRatesResponse,\n DemandProfileResponse,\n} from './types.js';\n\n/**\n * Client for the Markets Trends API domain.\n *\n * Each method queries a specific time-series metric:\n *\n * ```ts\n * const prices = await client.markets.trends.price({\n * level: 'suburb',\n * areaId: ['SAL10001'],\n * propertyType: ['house'],\n * });\n * ```\n */\nexport class TrendsClient {\n /** @internal */\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Price history trends.\n *\n * `GET /internal-api/v1/markets/trends/price`\n */\n async price(params: TrendsWithBedroomsParams): Promise<PriceResponse> {\n return this.trend<PriceResponse>('price', params);\n }\n\n /**\n * Rent history trends.\n *\n * `GET /internal-api/v1/markets/trends/rent`\n */\n async rent(params: TrendsWithBedroomsParams): Promise<RentResponse> {\n return this.trend<RentResponse>('rent', params);\n }\n\n /**\n * Yield history trends.\n *\n * `GET /internal-api/v1/markets/trends/yield`\n */\n async yieldHistory(params: TrendsWithBedroomsParams): Promise<YieldResponse> {\n return this.trend<YieldResponse>('yield', params);\n }\n\n /**\n * Supply and demand (monthly frequency).\n *\n * `GET /internal-api/v1/markets/trends/supply-demand`\n */\n async supplyDemand(params: TrendsParams): Promise<SupplyDemandResponse> {\n return this.trend<SupplyDemandResponse>('supply-demand', params);\n }\n\n /**\n * Search interest index (quarterly frequency).\n *\n * `GET /internal-api/v1/markets/trends/search-index`\n */\n async searchIndex(params: TrendsParams): Promise<SearchIndexResponse> {\n return this.trend<SearchIndexResponse>('search-index', params);\n }\n\n /**\n * Hold period (yearly frequency).\n *\n * `GET /internal-api/v1/markets/trends/hold-period`\n */\n async holdPeriod(params: TrendsParams): Promise<HoldPeriodResponse> {\n return this.trend<HoldPeriodResponse>('hold-period', params);\n }\n\n /**\n * Performance essentials.\n *\n * `GET /internal-api/v1/markets/trends/performance`\n */\n async performance(params: TrendsWithBedroomsParams): Promise<PerformanceResponse> {\n return this.trend<PerformanceResponse>('performance', params);\n }\n\n /**\n * Growth rate cycle.\n *\n * `GET /internal-api/v1/markets/trends/growth-rates`\n */\n async growthRates(params: TrendsParams): Promise<GrowthRatesResponse> {\n return this.trend<GrowthRatesResponse>('growth-rates', params);\n }\n\n /**\n * Demand profile breakdown.\n *\n * `GET /internal-api/v1/markets/trends/demand-profile`\n */\n async demandProfile(params: TrendsWithBedroomsParams): Promise<DemandProfileResponse> {\n return this.trend<DemandProfileResponse>('demand-profile', params);\n }\n\n // -----------------------------------------------------------------------\n // Shared implementation\n // -----------------------------------------------------------------------\n\n private async trend<T>(metric: string, params: TrendsParams | TrendsWithBedroomsParams): Promise<T> {\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.internalGet<T>(\n `/internal-api/v1/markets/trends/${metric}${qs}`,\n { signal },\n );\n }\n}\n","import type { HttpClient } from '../http.js';\nimport { buildQueryString } from '../http.js';\nimport { TrendsClient } from './trends.js';\nimport type {\n SnapshotsParams,\n SnapshotsResponse,\n AdvancedSearchBody,\n MarketQueryResponse,\n} from './types.js';\nimport type { RequestOptions } from '../types.js';\n\n/**\n * Client for the Markets API domain.\n *\n * ```ts\n * const snapshots = await client.markets.snapshots({\n * level: 'suburb',\n * propertyType: ['house'],\n * });\n *\n * const prices = await client.markets.trends.price({\n * level: 'suburb',\n * areaId: ['SAL10001'],\n * });\n * ```\n */\nexport class MarketsClient {\n /** Sub-client for time-series trend endpoints. */\n readonly trends: TrendsClient;\n\n /** @internal */\n constructor(private readonly http: HttpClient) {\n this.trends = new TrendsClient(http);\n }\n\n /**\n * Retrieve market snapshot data with optional filters.\n *\n * `GET /internal-api/v1/markets/snapshots`\n */\n async snapshots(params: SnapshotsParams): Promise<SnapshotsResponse> {\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.internalGet<SnapshotsResponse>(\n `/internal-api/v1/markets/snapshots${qs}`,\n { signal },\n );\n }\n\n /**\n * Advanced market query with logical filter expressions.\n *\n * `POST /internal-api/v1/markets/query`\n */\n async query(\n body: AdvancedSearchBody,\n options?: RequestOptions,\n ): Promise<MarketQueryResponse> {\n return this.http.internalPost<MarketQueryResponse>(\n '/internal-api/v1/markets/query',\n body,\n options,\n );\n }\n}\n","import type { HttpClient } from '../http.js';\nimport { buildQueryString } from '../http.js';\nimport type { RequestOptions } from '../types.js';\nimport type {\n SubmitEventParams,\n ClassifiedEvent,\n QueryEventsParams,\n PaginatedEvents,\n CreateIntegrationParams,\n Integration,\n UpdateIntegrationParams,\n TestResult,\n CreateSubscriptionParams,\n Subscription,\n UpdateSubscriptionParams,\n EventCategory,\n EventType,\n TagInfo,\n} from './types.js';\n\n/**\n * Client for the Intent Hub API domain.\n *\n * ```ts\n * const event = await client.intentHub.submitEvent({\n * sourceType: 'AGENT',\n * sourceId: 'my-agent',\n * textContent: 'User wants to refinance their mortgage',\n * });\n * ```\n */\nexport class IntentHubClient {\n /** @internal */\n constructor(private readonly http: HttpClient) {}\n\n // -------------------------------------------------------------------------\n // Events\n // -------------------------------------------------------------------------\n\n /**\n * Submit a raw event for classification.\n *\n * `POST /intent-hub/v1/events`\n */\n async submitEvent(params: SubmitEventParams): Promise<ClassifiedEvent> {\n const { signal, ...rest } = params;\n return this.http.intentHubPost<ClassifiedEvent>(\n '/events',\n {\n source_type: rest.sourceType,\n source_id: rest.sourceId,\n text_content: rest.textContent,\n payload: rest.payload,\n user_id: rest.userId,\n session_id: rest.sessionId,\n suggested_category: rest.suggestedCategory,\n suggested_intent: rest.suggestedIntent,\n idempotency_key: rest.idempotencyKey,\n event_type: rest.eventType,\n },\n { signal },\n );\n }\n\n /**\n * Retrieve a single classified event by ID.\n *\n * `GET /intent-hub/v1/events/:eventId`\n */\n async getEvent(eventId: string, options?: RequestOptions): Promise<ClassifiedEvent> {\n return this.http.intentHubGet<ClassifiedEvent>(\n `/events/${encodeURIComponent(eventId)}`,\n options,\n );\n }\n\n /**\n * Query classified events with optional filters.\n *\n * `GET /intent-hub/v1/events`\n */\n async queryEvents(params?: QueryEventsParams): Promise<PaginatedEvents> {\n if (!params) {\n return this.http.intentHubGet<PaginatedEvents>('/events');\n }\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.intentHubGet<PaginatedEvents>(`/events${qs}`, { signal });\n }\n\n // -------------------------------------------------------------------------\n // Integrations\n // -------------------------------------------------------------------------\n\n /**\n * Create a new integration endpoint.\n *\n * `POST /intent-hub/v1/integrations`\n */\n async createIntegration(params: CreateIntegrationParams): Promise<Integration> {\n const { signal, ...rest } = params;\n return this.http.intentHubPost<Integration>(\n '/integrations',\n {\n name: rest.name,\n type: rest.type,\n url: rest.url,\n secret: rest.secret,\n headers: rest.headers,\n config: rest.config,\n },\n { signal },\n );\n }\n\n /**\n * List all integrations for the current organisation.\n *\n * `GET /intent-hub/v1/integrations`\n */\n async listIntegrations(options?: RequestOptions): Promise<Integration[]> {\n return this.http.intentHubGet<Integration[]>('/integrations', options);\n }\n\n /**\n * Retrieve a single integration by ID.\n *\n * `GET /intent-hub/v1/integrations/:id`\n */\n async getIntegration(id: string, options?: RequestOptions): Promise<Integration> {\n return this.http.intentHubGet<Integration>(\n `/integrations/${encodeURIComponent(id)}`,\n options,\n );\n }\n\n /**\n * Update an existing integration.\n *\n * `PATCH /intent-hub/v1/integrations/:id`\n */\n async updateIntegration(\n id: string,\n params: UpdateIntegrationParams,\n ): Promise<Integration> {\n const { signal, ...rest } = params;\n return this.http.intentHubPatch<Integration>(\n `/integrations/${encodeURIComponent(id)}`,\n {\n name: rest.name,\n url: rest.url,\n secret: rest.secret,\n status: rest.status,\n },\n { signal },\n );\n }\n\n /**\n * Delete an integration by ID.\n *\n * `DELETE /intent-hub/v1/integrations/:id`\n */\n async deleteIntegration(id: string, options?: RequestOptions): Promise<void> {\n return this.http.intentHubDelete<void>(\n `/integrations/${encodeURIComponent(id)}`,\n options,\n );\n }\n\n /**\n * Send a test event to an integration endpoint.\n *\n * `POST /intent-hub/v1/integrations/:id/test`\n */\n async testIntegration(id: string, options?: RequestOptions): Promise<TestResult> {\n return this.http.intentHubPost<TestResult>(\n `/integrations/${encodeURIComponent(id)}/test`,\n {},\n options,\n );\n }\n\n // -------------------------------------------------------------------------\n // Subscriptions\n // -------------------------------------------------------------------------\n\n /**\n * Create a new subscription linking event patterns to an integration.\n *\n * `POST /intent-hub/v1/subscriptions`\n */\n async createSubscription(params: CreateSubscriptionParams): Promise<Subscription> {\n const { signal, ...rest } = params;\n return this.http.intentHubPost<Subscription>(\n '/subscriptions',\n {\n integration_id: rest.integrationId,\n event_type_slug: rest.eventTypeSlug,\n tag: rest.tag,\n intent_pattern: rest.intentPattern,\n filters: rest.filters,\n },\n { signal },\n );\n }\n\n /**\n * List all subscriptions for the current organisation.\n *\n * `GET /intent-hub/v1/subscriptions`\n */\n async listSubscriptions(options?: RequestOptions): Promise<Subscription[]> {\n return this.http.intentHubGet<Subscription[]>('/subscriptions', options);\n }\n\n /**\n * Retrieve a single subscription by ID.\n *\n * `GET /intent-hub/v1/subscriptions/:id`\n */\n async getSubscription(id: string, options?: RequestOptions): Promise<Subscription> {\n return this.http.intentHubGet<Subscription>(\n `/subscriptions/${encodeURIComponent(id)}`,\n options,\n );\n }\n\n /**\n * Update an existing subscription.\n *\n * `PATCH /intent-hub/v1/subscriptions/:id`\n */\n async updateSubscription(\n id: string,\n params: UpdateSubscriptionParams,\n ): Promise<Subscription> {\n const { signal, ...rest } = params;\n return this.http.intentHubPatch<Subscription>(\n `/subscriptions/${encodeURIComponent(id)}`,\n {\n event_type_slug: rest.eventTypeSlug,\n tag: rest.tag,\n intent_pattern: rest.intentPattern,\n integration_id: rest.integrationId,\n is_active: rest.isActive,\n },\n { signal },\n );\n }\n\n /**\n * Delete a subscription by ID.\n *\n * `DELETE /intent-hub/v1/subscriptions/:id`\n */\n async deleteSubscription(id: string, options?: RequestOptions): Promise<void> {\n return this.http.intentHubDelete<void>(\n `/subscriptions/${encodeURIComponent(id)}`,\n options,\n );\n }\n\n // -------------------------------------------------------------------------\n // Catalog\n // -------------------------------------------------------------------------\n\n /**\n * List all event categories in the taxonomy.\n *\n * `GET /intent-hub/v1/catalog/categories`\n */\n async listCategories(options?: RequestOptions): Promise<EventCategory[]> {\n return this.http.intentHubGet<EventCategory[]>('/catalog/categories', options);\n }\n\n /**\n * List event types, optionally filtered by category.\n *\n * `GET /intent-hub/v1/catalog/event-types`\n */\n async listEventTypes(\n params?: { category?: string } & RequestOptions,\n ): Promise<EventType[]> {\n if (!params) {\n return this.http.intentHubGet<EventType[]>('/catalog/event-types');\n }\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.intentHubGet<EventType[]>(`/catalog/event-types${qs}`, { signal });\n }\n\n /**\n * List all tags with their usage counts.\n *\n * `GET /intent-hub/v1/catalog/tags`\n */\n async listTags(options?: RequestOptions): Promise<TagInfo[]> {\n return this.http.intentHubGet<TagInfo[]>('/catalog/tags', options);\n }\n}\n","import type { HtAgClientOptions, ResolvedConfig } from './types.js';\nimport { HttpClient } from './http.js';\nimport { AddressClient } from './address/client.js';\nimport { PropertyClient } from './property/client.js';\nimport { MarketsClient } from './markets/client.js';\nimport { IntentHubClient } from './intent-hub/client.js';\n\n// ---------------------------------------------------------------------------\n// Defaults\n// ---------------------------------------------------------------------------\n\nconst DEFAULT_MAX_RETRIES = 3;\nconst DEFAULT_RETRY_BASE_DELAY = 500; // ms\nconst DEFAULT_TIMEOUT = 30_000; // 30 seconds\n\n/**\n * Build the environment-derived base URLs.\n *\n * - `prod` -> `https://api.prod.htagai.com`\n * - `dev` -> `https://api.dev.htagai.com`\n */\nfunction resolveBaseUrls(options: HtAgClientOptions): {\n publicBaseUrl: string;\n internalBaseUrl: string;\n intentHubBaseUrl: string;\n} {\n if (options.baseUrl) {\n // Strip trailing slashes for consistency.\n const base = options.baseUrl.replace(/\\/+$/, '');\n return { publicBaseUrl: base, internalBaseUrl: base, intentHubBaseUrl: base };\n }\n\n const env = options.environment ?? 'prod';\n const base = `https://api.${env}.htagai.com`;\n return {\n publicBaseUrl: base,\n internalBaseUrl: base,\n intentHubBaseUrl: `${base}/intent-hub/v1`,\n };\n}\n\n// ---------------------------------------------------------------------------\n// HtAgApiClient\n// ---------------------------------------------------------------------------\n\n/**\n * Top-level client for the HtAG Location Intelligence APIs.\n *\n * ```ts\n * import { HtAgApiClient } from '@htag/sdk';\n *\n * const client = new HtAgApiClient({\n * apiKey: process.env.HTAG_API_KEY!,\n * environment: 'prod',\n * });\n *\n * const results = await client.address.search({ q: '100 George St Sydney' });\n * ```\n */\nexport class HtAgApiClient {\n /** Address search, insights and standardisation. */\n readonly address: AddressClient;\n\n /** Sold property search. */\n readonly property: PropertyClient;\n\n /** Market snapshots, advanced queries and time-series trends. */\n readonly markets: MarketsClient;\n\n /** Intent Hub: event classification, integrations and subscriptions. */\n readonly intentHub: IntentHubClient;\n\n constructor(options: HtAgClientOptions) {\n if (!options.apiKey) {\n throw new Error(\n 'HtAgApiClient requires an apiKey. Pass it in the constructor options.',\n );\n }\n\n const { publicBaseUrl, internalBaseUrl, intentHubBaseUrl } = resolveBaseUrls(options);\n\n const config: ResolvedConfig = {\n apiKey: options.apiKey,\n publicBaseUrl,\n internalBaseUrl,\n intentHubBaseUrl,\n maxRetries: options.maxRetries ?? DEFAULT_MAX_RETRIES,\n retryBaseDelay: options.retryBaseDelay ?? DEFAULT_RETRY_BASE_DELAY,\n timeout: options.timeout ?? DEFAULT_TIMEOUT,\n };\n\n const http = new HttpClient(config);\n\n this.address = new AddressClient(http);\n this.property = new PropertyClient(http);\n this.markets = new MarketsClient(http);\n this.intentHub = new IntentHubClient(http);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAM,YAAN,cAAwB,MAAM;AAAA;AAAA,EAE1B;AAAA;AAAA,EAGA;AAAA;AAAA,EAGA;AAAA,EAET,YACE,SACA,SAMA;AACA,UAAM,SAAS,EAAE,OAAO,SAAS,MAAM,CAAC;AACxC,SAAK,OAAO;AACZ,SAAK,SAAS,SAAS;AACvB,SAAK,OAAO,SAAS;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AIvB;AACA,MAAI,QAAQ,SAAS;AAEnB,UAAMA,QAAO,QAAQ,QAAQ,QAAQ,QAAQ,EAAE;AAC/C,WAAO,EAAE,eAAeA,OAAM,iBAAiBA,OAAM,kBAAkBA,MAAK;AAAA,EAC9E;AAEA,QAAM,MAAM,QAAQ,eAAe;AACnC,QAAM,OAAO,eAAe,GAAG;AAC/B,SAAO;AAAA,IACL,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,kBAAkB,GAAG,IAAI;AAAA,EAC3B;AACF;AAoBO,IAAM,gBAAN,MAAoB;AAAA;AAAA,EAEhB;AAAA;AAAA,EAGA;AAAA;AAAA,EAGA;AAAA;AAAA,EAGA;AAAA,EAET,YAAY,SAA4B;AACtC,QAAI,CAAC,QAAQ,QAAQ;AACnB,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAEA,UAAM,EAAE,eAAe,iBAAiB,iBAAiB,IAAI,gBAAgB,OAAO;AAEpF,UAAM,SAAyB;AAAA,MAC7B,QAAQ,QAAQ;AAAA,MAChB;AAAA,MACA;AAAA,MACA;AAAA,MACA,YAAY,QAAQ,cAAc;AAAA,MAClC,gBAAgB,QAAQ,kBAAkB;AAAA,MAC1C,SAAS,QAAQ,WAAW;AAAA,IAC9B;AAEA,UAAM,OAAO,IAAI,WAAW,MAAM;AAElC,SAAK,UAAU,IAAI,cAAc,IAAI;AACrC,SAAK,WAAW,IAAI,eAAe,IAAI;AACvC,SAAK,UAAU,IAAI,cAAc,IAAI;AACrC,SAAK,YAAY,IAAI,gBAAgB,IAAI;AAAA,EAC3C;AACF;","names":["base"]}
package/dist/index.d.cts CHANGED
@@ -493,7 +493,6 @@ interface SnapshotsParams extends RequestOptions {
493
493
  typicalPriceMin?: number;
494
494
  typicalPriceMax?: number;
495
495
  confidence?: string;
496
- bedrooms?: string | string[];
497
496
  limit?: number;
498
497
  offset?: number;
499
498
  }
@@ -506,10 +505,12 @@ interface TrendsParams extends RequestOptions {
506
505
  propertyType?: PropertyTypeEnum[];
507
506
  periodEndMin?: string;
508
507
  periodEndMax?: string;
509
- bedrooms?: string | string[];
510
508
  limit?: number;
511
509
  offset?: number;
512
510
  }
511
+ interface TrendsWithBedroomsParams extends TrendsParams {
512
+ bedrooms?: string | string[];
513
+ }
513
514
 
514
515
  type SnapshotsResponse = BaseResponse<MarketSnapshot>;
515
516
  type MarketQueryResponse = BaseResponse<MarketSnapshot>;
@@ -545,19 +546,19 @@ declare class TrendsClient {
545
546
  *
546
547
  * `GET /internal-api/v1/markets/trends/price`
547
548
  */
548
- price(params: TrendsParams): Promise<PriceResponse>;
549
+ price(params: TrendsWithBedroomsParams): Promise<PriceResponse>;
549
550
  /**
550
551
  * Rent history trends.
551
552
  *
552
553
  * `GET /internal-api/v1/markets/trends/rent`
553
554
  */
554
- rent(params: TrendsParams): Promise<RentResponse>;
555
+ rent(params: TrendsWithBedroomsParams): Promise<RentResponse>;
555
556
  /**
556
557
  * Yield history trends.
557
558
  *
558
559
  * `GET /internal-api/v1/markets/trends/yield`
559
560
  */
560
- yieldHistory(params: TrendsParams): Promise<YieldResponse>;
561
+ yieldHistory(params: TrendsWithBedroomsParams): Promise<YieldResponse>;
561
562
  /**
562
563
  * Supply and demand (monthly frequency).
563
564
  *
@@ -581,7 +582,7 @@ declare class TrendsClient {
581
582
  *
582
583
  * `GET /internal-api/v1/markets/trends/performance`
583
584
  */
584
- performance(params: TrendsParams): Promise<PerformanceResponse>;
585
+ performance(params: TrendsWithBedroomsParams): Promise<PerformanceResponse>;
585
586
  /**
586
587
  * Growth rate cycle.
587
588
  *
@@ -593,7 +594,7 @@ declare class TrendsClient {
593
594
  *
594
595
  * `GET /internal-api/v1/markets/trends/demand-profile`
595
596
  */
596
- demandProfile(params: TrendsParams): Promise<DemandProfileResponse>;
597
+ demandProfile(params: TrendsWithBedroomsParams): Promise<DemandProfileResponse>;
597
598
  private trend;
598
599
  }
599
600
 
@@ -962,4 +963,4 @@ declare class ServerError extends HtAgError {
962
963
  });
963
964
  }
964
965
 
965
- export { AddressClient, type AddressInsightsParams, type AddressInsightsResponse, type AddressRecord, type AddressSearchParams, type AddressSearchResponse, type AddressSearchResult, type AdvancedSearchBody, AuthenticationError, type BaseResponse, type BatchStandardiseParams, type BatchStandardiseResponse, type ClassifiedEvent, type CreateIntegrationParams, type CreateSubscriptionParams, type DemandProfileOut, type DemandProfileResponse, type EssentialsOut, type EventCategory, type EventType, type FSDMonthlyOut, type FSDQuarterlyOut, type FSDYearlyOut, type GRCOut, type GrowthRatesResponse, type HoldPeriodResponse, HtAgApiClient, type HtAgClientOptions, HtAgError, type Integration, type IntegrationStatus, type IntegrationType, IntentHubClient, type LevelEnum, type LogicNode, type MarketQueryParams, type MarketQueryResponse, type MarketSnapshot, MarketsClient, type PaginatedEvents, type PerformanceResponse, type PriceHistoryOut, type PriceResponse, PropertyClient, type PropertyTypeEnum, type QueryEventsParams, RateLimitError, type RentHistoryOut, type RentResponse, type RequestOptions, type ResolvedConfig, type SearchIndexResponse, type Sentiment, ServerError, type SnapshotsParams, type SnapshotsResponse, type SoldPropertiesResponse, type SoldPropertyRecord, type SoldSearchParams, type SourceType, type StandardisedAddress, type SubmitEventParams, type Subscription, type SupplyDemandResponse, type TagInfo, type TestResult, TrendsClient, type TrendsParams, type UpdateIntegrationParams, type UpdateSubscriptionParams, type Urgency, ValidationError, type YieldHistoryOut, type YieldResponse };
966
+ export { AddressClient, type AddressInsightsParams, type AddressInsightsResponse, type AddressRecord, type AddressSearchParams, type AddressSearchResponse, type AddressSearchResult, type AdvancedSearchBody, AuthenticationError, type BaseResponse, type BatchStandardiseParams, type BatchStandardiseResponse, type ClassifiedEvent, type CreateIntegrationParams, type CreateSubscriptionParams, type DemandProfileOut, type DemandProfileResponse, type EssentialsOut, type EventCategory, type EventType, type FSDMonthlyOut, type FSDQuarterlyOut, type FSDYearlyOut, type GRCOut, type GrowthRatesResponse, type HoldPeriodResponse, HtAgApiClient, type HtAgClientOptions, HtAgError, type Integration, type IntegrationStatus, type IntegrationType, IntentHubClient, type LevelEnum, type LogicNode, type MarketQueryParams, type MarketQueryResponse, type MarketSnapshot, MarketsClient, type PaginatedEvents, type PerformanceResponse, type PriceHistoryOut, type PriceResponse, PropertyClient, type PropertyTypeEnum, type QueryEventsParams, RateLimitError, type RentHistoryOut, type RentResponse, type RequestOptions, type ResolvedConfig, type SearchIndexResponse, type Sentiment, ServerError, type SnapshotsParams, type SnapshotsResponse, type SoldPropertiesResponse, type SoldPropertyRecord, type SoldSearchParams, type SourceType, type StandardisedAddress, type SubmitEventParams, type Subscription, type SupplyDemandResponse, type TagInfo, type TestResult, TrendsClient, type TrendsParams, type TrendsWithBedroomsParams, type UpdateIntegrationParams, type UpdateSubscriptionParams, type Urgency, ValidationError, type YieldHistoryOut, type YieldResponse };
package/dist/index.d.ts CHANGED
@@ -493,7 +493,6 @@ interface SnapshotsParams extends RequestOptions {
493
493
  typicalPriceMin?: number;
494
494
  typicalPriceMax?: number;
495
495
  confidence?: string;
496
- bedrooms?: string | string[];
497
496
  limit?: number;
498
497
  offset?: number;
499
498
  }
@@ -506,10 +505,12 @@ interface TrendsParams extends RequestOptions {
506
505
  propertyType?: PropertyTypeEnum[];
507
506
  periodEndMin?: string;
508
507
  periodEndMax?: string;
509
- bedrooms?: string | string[];
510
508
  limit?: number;
511
509
  offset?: number;
512
510
  }
511
+ interface TrendsWithBedroomsParams extends TrendsParams {
512
+ bedrooms?: string | string[];
513
+ }
513
514
 
514
515
  type SnapshotsResponse = BaseResponse<MarketSnapshot>;
515
516
  type MarketQueryResponse = BaseResponse<MarketSnapshot>;
@@ -545,19 +546,19 @@ declare class TrendsClient {
545
546
  *
546
547
  * `GET /internal-api/v1/markets/trends/price`
547
548
  */
548
- price(params: TrendsParams): Promise<PriceResponse>;
549
+ price(params: TrendsWithBedroomsParams): Promise<PriceResponse>;
549
550
  /**
550
551
  * Rent history trends.
551
552
  *
552
553
  * `GET /internal-api/v1/markets/trends/rent`
553
554
  */
554
- rent(params: TrendsParams): Promise<RentResponse>;
555
+ rent(params: TrendsWithBedroomsParams): Promise<RentResponse>;
555
556
  /**
556
557
  * Yield history trends.
557
558
  *
558
559
  * `GET /internal-api/v1/markets/trends/yield`
559
560
  */
560
- yieldHistory(params: TrendsParams): Promise<YieldResponse>;
561
+ yieldHistory(params: TrendsWithBedroomsParams): Promise<YieldResponse>;
561
562
  /**
562
563
  * Supply and demand (monthly frequency).
563
564
  *
@@ -581,7 +582,7 @@ declare class TrendsClient {
581
582
  *
582
583
  * `GET /internal-api/v1/markets/trends/performance`
583
584
  */
584
- performance(params: TrendsParams): Promise<PerformanceResponse>;
585
+ performance(params: TrendsWithBedroomsParams): Promise<PerformanceResponse>;
585
586
  /**
586
587
  * Growth rate cycle.
587
588
  *
@@ -593,7 +594,7 @@ declare class TrendsClient {
593
594
  *
594
595
  * `GET /internal-api/v1/markets/trends/demand-profile`
595
596
  */
596
- demandProfile(params: TrendsParams): Promise<DemandProfileResponse>;
597
+ demandProfile(params: TrendsWithBedroomsParams): Promise<DemandProfileResponse>;
597
598
  private trend;
598
599
  }
599
600
 
@@ -962,4 +963,4 @@ declare class ServerError extends HtAgError {
962
963
  });
963
964
  }
964
965
 
965
- export { AddressClient, type AddressInsightsParams, type AddressInsightsResponse, type AddressRecord, type AddressSearchParams, type AddressSearchResponse, type AddressSearchResult, type AdvancedSearchBody, AuthenticationError, type BaseResponse, type BatchStandardiseParams, type BatchStandardiseResponse, type ClassifiedEvent, type CreateIntegrationParams, type CreateSubscriptionParams, type DemandProfileOut, type DemandProfileResponse, type EssentialsOut, type EventCategory, type EventType, type FSDMonthlyOut, type FSDQuarterlyOut, type FSDYearlyOut, type GRCOut, type GrowthRatesResponse, type HoldPeriodResponse, HtAgApiClient, type HtAgClientOptions, HtAgError, type Integration, type IntegrationStatus, type IntegrationType, IntentHubClient, type LevelEnum, type LogicNode, type MarketQueryParams, type MarketQueryResponse, type MarketSnapshot, MarketsClient, type PaginatedEvents, type PerformanceResponse, type PriceHistoryOut, type PriceResponse, PropertyClient, type PropertyTypeEnum, type QueryEventsParams, RateLimitError, type RentHistoryOut, type RentResponse, type RequestOptions, type ResolvedConfig, type SearchIndexResponse, type Sentiment, ServerError, type SnapshotsParams, type SnapshotsResponse, type SoldPropertiesResponse, type SoldPropertyRecord, type SoldSearchParams, type SourceType, type StandardisedAddress, type SubmitEventParams, type Subscription, type SupplyDemandResponse, type TagInfo, type TestResult, TrendsClient, type TrendsParams, type UpdateIntegrationParams, type UpdateSubscriptionParams, type Urgency, ValidationError, type YieldHistoryOut, type YieldResponse };
966
+ export { AddressClient, type AddressInsightsParams, type AddressInsightsResponse, type AddressRecord, type AddressSearchParams, type AddressSearchResponse, type AddressSearchResult, type AdvancedSearchBody, AuthenticationError, type BaseResponse, type BatchStandardiseParams, type BatchStandardiseResponse, type ClassifiedEvent, type CreateIntegrationParams, type CreateSubscriptionParams, type DemandProfileOut, type DemandProfileResponse, type EssentialsOut, type EventCategory, type EventType, type FSDMonthlyOut, type FSDQuarterlyOut, type FSDYearlyOut, type GRCOut, type GrowthRatesResponse, type HoldPeriodResponse, HtAgApiClient, type HtAgClientOptions, HtAgError, type Integration, type IntegrationStatus, type IntegrationType, IntentHubClient, type LevelEnum, type LogicNode, type MarketQueryParams, type MarketQueryResponse, type MarketSnapshot, MarketsClient, type PaginatedEvents, type PerformanceResponse, type PriceHistoryOut, type PriceResponse, PropertyClient, type PropertyTypeEnum, type QueryEventsParams, RateLimitError, type RentHistoryOut, type RentResponse, type RequestOptions, type ResolvedConfig, type SearchIndexResponse, type Sentiment, ServerError, type SnapshotsParams, type SnapshotsResponse, type SoldPropertiesResponse, type SoldPropertyRecord, type SoldSearchParams, type SourceType, type StandardisedAddress, type SubmitEventParams, type Subscription, type SupplyDemandResponse, type TagInfo, type TestResult, TrendsClient, type TrendsParams, type TrendsWithBedroomsParams, type UpdateIntegrationParams, type UpdateSubscriptionParams, type Urgency, ValidationError, type YieldHistoryOut, type YieldResponse };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/errors.ts","../src/http.ts","../src/address/client.ts","../src/property/client.ts","../src/markets/trends.ts","../src/markets/client.ts","../src/intent-hub/client.ts","../src/client.ts"],"sourcesContent":["/**\n * Base error class for all HtAG SDK errors.\n */\nexport class HtAgError extends Error {\n /** HTTP status code, if available. */\n readonly status: number | undefined;\n\n /** Raw response body, if available. */\n readonly body: unknown;\n\n /** The request URL that caused the error. */\n readonly url: string | undefined;\n\n constructor(\n message: string,\n options?: {\n status?: number;\n body?: unknown;\n url?: string;\n cause?: unknown;\n },\n ) {\n super(message, { cause: options?.cause });\n this.name = 'HtAgError';\n this.status = options?.status;\n this.body = options?.body;\n this.url = options?.url;\n }\n}\n\n/**\n * Thrown when the server returns 401 or 403.\n */\nexport class AuthenticationError extends HtAgError {\n constructor(options: { status: number; body: unknown; url: string }) {\n super(\n `Authentication failed (HTTP ${options.status}). Check your API key.`,\n options,\n );\n this.name = 'AuthenticationError';\n }\n}\n\n/**\n * Thrown when the server returns 429 after exhausting all retries.\n */\nexport class RateLimitError extends HtAgError {\n constructor(options: { body: unknown; url: string }) {\n super('Rate limit exceeded. Please retry after a short delay.', {\n status: 429,\n ...options,\n });\n this.name = 'RateLimitError';\n }\n}\n\n/**\n * Thrown when the server returns 400 or 422.\n */\nexport class ValidationError extends HtAgError {\n constructor(options: { status: number; body: unknown; url: string }) {\n const detail = extractDetail(options.body);\n super(\n detail\n ? `Validation error (HTTP ${options.status}): ${detail}`\n : `Validation error (HTTP ${options.status})`,\n options,\n );\n this.name = 'ValidationError';\n }\n}\n\n/**\n * Thrown when the server returns a 5xx status after exhausting all retries.\n */\nexport class ServerError extends HtAgError {\n constructor(options: { status: number; body: unknown; url: string }) {\n super(`Server error (HTTP ${options.status})`, options);\n this.name = 'ServerError';\n }\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction extractDetail(body: unknown): string | undefined {\n if (body && typeof body === 'object' && 'detail' in body) {\n const detail = (body as Record<string, unknown>).detail;\n if (typeof detail === 'string') return detail;\n if (Array.isArray(detail)) {\n return detail\n .map((d) => {\n if (typeof d === 'string') return d;\n if (d && typeof d === 'object' && 'msg' in d) return String(d.msg);\n return JSON.stringify(d);\n })\n .join('; ');\n }\n return JSON.stringify(detail);\n }\n return undefined;\n}\n","import type { ResolvedConfig, RequestOptions } from './types.js';\nimport {\n HtAgError,\n AuthenticationError,\n RateLimitError,\n ValidationError,\n ServerError,\n} from './errors.js';\n\n// ---------------------------------------------------------------------------\n// camelCase -> snake_case conversion\n// ---------------------------------------------------------------------------\n\n/**\n * Convert a camelCase string to snake_case.\n *\n * Handles sequences of uppercase letters correctly:\n * - \"areaId\" -> \"area_id\"\n * - \"periodEndMin\" -> \"period_end_min\"\n * - \"IRSD\" -> \"irsd\" (all-caps treated as one token)\n */\nfunction toSnakeCase(str: string): string {\n return str\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')\n .replace(/([a-z0-9])([A-Z])/g, '$1_$2')\n .toLowerCase();\n}\n\n// ---------------------------------------------------------------------------\n// Query-string builder\n// ---------------------------------------------------------------------------\n\n/**\n * Build a URL query string from a params object, converting camelCase keys\n * to snake_case. Arrays are joined with commas. `undefined` and `null` values\n * are omitted.\n */\nexport function buildQueryString(\n params: Record<string, unknown>,\n): string {\n const parts: string[] = [];\n\n for (const [key, value] of Object.entries(params)) {\n // Skip internal SDK options that are not API params.\n if (key === 'signal') continue;\n if (value === undefined || value === null) continue;\n\n const snakeKey = toSnakeCase(key);\n\n if (Array.isArray(value)) {\n if (value.length > 0) {\n parts.push(\n `${encodeURIComponent(snakeKey)}=${encodeURIComponent(value.join(','))}`,\n );\n }\n } else {\n parts.push(\n `${encodeURIComponent(snakeKey)}=${encodeURIComponent(String(value))}`,\n );\n }\n }\n\n return parts.length > 0 ? `?${parts.join('&')}` : '';\n}\n\n// ---------------------------------------------------------------------------\n// Retryable HTTP client\n// ---------------------------------------------------------------------------\n\nfunction isRetryable(status: number): boolean {\n return status === 429 || status >= 500;\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\n/**\n * Parse the body of a response. Returns the parsed JSON on success or a string\n * representation when parsing fails.\n */\nasync function parseBody(response: Response): Promise<unknown> {\n const contentType = response.headers.get('content-type') ?? '';\n if (contentType.includes('application/json')) {\n try {\n return await response.json();\n } catch {\n return await response.text();\n }\n }\n return await response.text();\n}\n\n/**\n * Throw the appropriate typed error for the given HTTP status.\n */\nfunction throwForStatus(\n status: number,\n body: unknown,\n url: string,\n): never {\n if (status === 401 || status === 403) {\n throw new AuthenticationError({ status, body, url });\n }\n if (status === 429) {\n throw new RateLimitError({ body, url });\n }\n if (status === 400 || status === 422) {\n throw new ValidationError({ status, body, url });\n }\n if (status >= 500) {\n throw new ServerError({ status, body, url });\n }\n throw new HtAgError(`HTTP ${status}`, { status, body, url });\n}\n\n/**\n * Internal HTTP transport used by all domain clients.\n */\nexport class HttpClient {\n constructor(private readonly config: ResolvedConfig) {}\n\n /**\n * Execute a GET request against the public API base.\n */\n async get<T>(path: string, options?: RequestOptions): Promise<T> {\n return this.request<T>('GET', this.config.publicBaseUrl + path, undefined, options);\n }\n\n /**\n * Execute a POST request against the public API base.\n */\n async post<T>(\n path: string,\n body: unknown,\n options?: RequestOptions,\n ): Promise<T> {\n return this.request<T>('POST', this.config.publicBaseUrl + path, body, options);\n }\n\n /**\n * Execute a PATCH request against the public API base.\n */\n async patch<T>(\n path: string,\n body: unknown,\n options?: RequestOptions,\n ): Promise<T> {\n return this.request<T>('PATCH', this.config.publicBaseUrl + path, body, options);\n }\n\n /**\n * Execute a DELETE request against the public API base.\n */\n async delete<T>(path: string, options?: RequestOptions): Promise<T> {\n return this.request<T>('DELETE', this.config.publicBaseUrl + path, undefined, options);\n }\n\n /**\n * Execute a GET request against the internal API base.\n */\n async internalGet<T>(path: string, options?: RequestOptions): Promise<T> {\n return this.request<T>('GET', this.config.internalBaseUrl + path, undefined, options);\n }\n\n /**\n * Execute a POST request against the internal API base.\n */\n async internalPost<T>(\n path: string,\n body: unknown,\n options?: RequestOptions,\n ): Promise<T> {\n return this.request<T>('POST', this.config.internalBaseUrl + path, body, options);\n }\n\n /**\n * Execute a GET request against the Intent Hub API base.\n */\n async intentHubGet<T>(path: string, options?: RequestOptions): Promise<T> {\n return this.request<T>('GET', this.config.intentHubBaseUrl + path, undefined, options);\n }\n\n /**\n * Execute a POST request against the Intent Hub API base.\n */\n async intentHubPost<T>(\n path: string,\n body: unknown,\n options?: RequestOptions,\n ): Promise<T> {\n return this.request<T>('POST', this.config.intentHubBaseUrl + path, body, options);\n }\n\n /**\n * Execute a PATCH request against the Intent Hub API base.\n */\n async intentHubPatch<T>(\n path: string,\n body: unknown,\n options?: RequestOptions,\n ): Promise<T> {\n return this.request<T>('PATCH', this.config.intentHubBaseUrl + path, body, options);\n }\n\n /**\n * Execute a DELETE request against the Intent Hub API base.\n */\n async intentHubDelete<T>(path: string, options?: RequestOptions): Promise<T> {\n return this.request<T>('DELETE', this.config.intentHubBaseUrl + path, undefined, options);\n }\n\n // -----------------------------------------------------------------------\n // Core request implementation with retries and exponential backoff\n // -----------------------------------------------------------------------\n\n private async request<T>(\n method: string,\n url: string,\n body: unknown,\n options?: RequestOptions,\n ): Promise<T> {\n const headers: Record<string, string> = {\n 'x-api-key': this.config.apiKey,\n 'accept': 'application/json',\n };\n\n if (body !== undefined) {\n headers['content-type'] = 'application/json';\n }\n\n let lastError: Error | undefined;\n\n for (let attempt = 0; attempt <= this.config.maxRetries; attempt++) {\n // If this is a retry, wait with exponential backoff + jitter.\n if (attempt > 0) {\n const base = this.config.retryBaseDelay * Math.pow(2, attempt - 1);\n const jitter = Math.random() * base * 0.5;\n await sleep(base + jitter);\n }\n\n // Build an AbortController that combines the user signal with a timeout.\n const controller = new AbortController();\n let timeoutId: ReturnType<typeof setTimeout> | undefined;\n\n const cleanup = () => {\n if (timeoutId !== undefined) clearTimeout(timeoutId);\n };\n\n // Wire up caller's abort signal.\n if (options?.signal) {\n if (options.signal.aborted) {\n throw new HtAgError('Request aborted', {\n url,\n cause: options.signal.reason,\n });\n }\n options.signal.addEventListener('abort', () => controller.abort(options.signal!.reason), {\n once: true,\n });\n }\n\n timeoutId = setTimeout(\n () => controller.abort(new Error('Request timed out')),\n this.config.timeout,\n );\n\n try {\n const response = await fetch(url, {\n method,\n headers,\n body: body !== undefined ? JSON.stringify(body) : undefined,\n signal: controller.signal,\n });\n\n cleanup();\n\n if (response.ok) {\n // 204 No Content — nothing to parse.\n if (response.status === 204) {\n return undefined as T;\n }\n return (await parseBody(response)) as T;\n }\n\n const responseBody = await parseBody(response);\n\n // Retry on retryable statuses, unless we've exhausted retries.\n if (isRetryable(response.status) && attempt < this.config.maxRetries) {\n lastError = new HtAgError(`HTTP ${response.status}`, {\n status: response.status,\n body: responseBody,\n url,\n });\n continue;\n }\n\n // Non-retryable or exhausted retries — throw typed error.\n throwForStatus(response.status, responseBody, url);\n } catch (err) {\n cleanup();\n\n // Re-throw our own typed errors.\n if (err instanceof HtAgError) {\n throw err;\n }\n\n // Handle abort / timeout.\n if (err instanceof DOMException && err.name === 'AbortError') {\n if (options?.signal?.aborted) {\n throw new HtAgError('Request aborted', { url, cause: err });\n }\n throw new HtAgError('Request timed out', { url, cause: err });\n }\n\n // Network / fetch errors — retry if we have attempts left.\n if (attempt < this.config.maxRetries) {\n lastError = err instanceof Error ? err : new Error(String(err));\n continue;\n }\n\n throw new HtAgError(\n `Network error: ${err instanceof Error ? err.message : String(err)}`,\n { url, cause: err },\n );\n }\n }\n\n // Should not reach here, but just in case.\n throw lastError ?? new HtAgError('Request failed after retries', { url });\n }\n}\n","import type { HttpClient } from '../http.js';\nimport { buildQueryString } from '../http.js';\nimport type {\n AddressSearchParams,\n AddressSearchResponse,\n AddressInsightsParams,\n AddressInsightsResponse,\n BatchStandardiseParams,\n BatchStandardiseResponse,\n} from './types.js';\n\n/**\n * Client for the Address API domain.\n *\n * ```ts\n * const results = await client.address.search({ q: '100 George St Sydney' });\n * ```\n */\nexport class AddressClient {\n /** @internal */\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Search for addresses matching a free-text query.\n *\n * `GET /v1/address/search`\n */\n async search(params: AddressSearchParams): Promise<AddressSearchResponse> {\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.get<AddressSearchResponse>(`/v1/address/search${qs}`, { signal });\n }\n\n /**\n * Retrieve detailed insights for one or more addresses.\n *\n * `GET /v1/address/insights`\n */\n async insights(params: AddressInsightsParams): Promise<AddressInsightsResponse> {\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.get<AddressInsightsResponse>(`/v1/address/insights${qs}`, { signal });\n }\n\n /**\n * Standardise a batch of raw address strings into structured records.\n *\n * `POST /v1/address/standardise`\n */\n async standardise(params: BatchStandardiseParams): Promise<BatchStandardiseResponse> {\n const { signal, addresses } = params;\n return this.http.post<BatchStandardiseResponse>(\n '/v1/address/standardise',\n { addresses },\n { signal },\n );\n }\n}\n","import type { HttpClient } from '../http.js';\nimport { buildQueryString } from '../http.js';\nimport type {\n SoldSearchParams,\n SoldPropertiesResponse,\n} from './types.js';\n\n/**\n * Client for the Property API domain.\n *\n * ```ts\n * const sold = await client.property.soldSearch({ address: '100 George St Sydney', radius: 2000 });\n * ```\n */\nexport class PropertyClient {\n /** @internal */\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Search for recently sold properties near a location.\n *\n * `GET /v1/property/sold/search`\n */\n async soldSearch(params: SoldSearchParams): Promise<SoldPropertiesResponse> {\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.get<SoldPropertiesResponse>(`/v1/property/sold/search${qs}`, { signal });\n }\n}\n","import type { HttpClient } from '../http.js';\nimport { buildQueryString } from '../http.js';\nimport type {\n TrendsParams,\n PriceResponse,\n RentResponse,\n YieldResponse,\n SupplyDemandResponse,\n SearchIndexResponse,\n HoldPeriodResponse,\n PerformanceResponse,\n GrowthRatesResponse,\n DemandProfileResponse,\n} from './types.js';\n\n/**\n * Client for the Markets Trends API domain.\n *\n * Each method queries a specific time-series metric:\n *\n * ```ts\n * const prices = await client.markets.trends.price({\n * level: 'suburb',\n * areaId: ['SAL10001'],\n * propertyType: ['house'],\n * });\n * ```\n */\nexport class TrendsClient {\n /** @internal */\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Price history trends.\n *\n * `GET /internal-api/v1/markets/trends/price`\n */\n async price(params: TrendsParams): Promise<PriceResponse> {\n return this.trend<PriceResponse>('price', params);\n }\n\n /**\n * Rent history trends.\n *\n * `GET /internal-api/v1/markets/trends/rent`\n */\n async rent(params: TrendsParams): Promise<RentResponse> {\n return this.trend<RentResponse>('rent', params);\n }\n\n /**\n * Yield history trends.\n *\n * `GET /internal-api/v1/markets/trends/yield`\n */\n async yieldHistory(params: TrendsParams): Promise<YieldResponse> {\n return this.trend<YieldResponse>('yield', params);\n }\n\n /**\n * Supply and demand (monthly frequency).\n *\n * `GET /internal-api/v1/markets/trends/supply-demand`\n */\n async supplyDemand(params: TrendsParams): Promise<SupplyDemandResponse> {\n return this.trend<SupplyDemandResponse>('supply-demand', params);\n }\n\n /**\n * Search interest index (quarterly frequency).\n *\n * `GET /internal-api/v1/markets/trends/search-index`\n */\n async searchIndex(params: TrendsParams): Promise<SearchIndexResponse> {\n return this.trend<SearchIndexResponse>('search-index', params);\n }\n\n /**\n * Hold period (yearly frequency).\n *\n * `GET /internal-api/v1/markets/trends/hold-period`\n */\n async holdPeriod(params: TrendsParams): Promise<HoldPeriodResponse> {\n return this.trend<HoldPeriodResponse>('hold-period', params);\n }\n\n /**\n * Performance essentials.\n *\n * `GET /internal-api/v1/markets/trends/performance`\n */\n async performance(params: TrendsParams): Promise<PerformanceResponse> {\n return this.trend<PerformanceResponse>('performance', params);\n }\n\n /**\n * Growth rate cycle.\n *\n * `GET /internal-api/v1/markets/trends/growth-rates`\n */\n async growthRates(params: TrendsParams): Promise<GrowthRatesResponse> {\n return this.trend<GrowthRatesResponse>('growth-rates', params);\n }\n\n /**\n * Demand profile breakdown.\n *\n * `GET /internal-api/v1/markets/trends/demand-profile`\n */\n async demandProfile(params: TrendsParams): Promise<DemandProfileResponse> {\n return this.trend<DemandProfileResponse>('demand-profile', params);\n }\n\n // -----------------------------------------------------------------------\n // Shared implementation\n // -----------------------------------------------------------------------\n\n private async trend<T>(metric: string, params: TrendsParams): Promise<T> {\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.internalGet<T>(\n `/internal-api/v1/markets/trends/${metric}${qs}`,\n { signal },\n );\n }\n}\n","import type { HttpClient } from '../http.js';\nimport { buildQueryString } from '../http.js';\nimport { TrendsClient } from './trends.js';\nimport type {\n SnapshotsParams,\n SnapshotsResponse,\n AdvancedSearchBody,\n MarketQueryResponse,\n} from './types.js';\nimport type { RequestOptions } from '../types.js';\n\n/**\n * Client for the Markets API domain.\n *\n * ```ts\n * const snapshots = await client.markets.snapshots({\n * level: 'suburb',\n * propertyType: ['house'],\n * });\n *\n * const prices = await client.markets.trends.price({\n * level: 'suburb',\n * areaId: ['SAL10001'],\n * });\n * ```\n */\nexport class MarketsClient {\n /** Sub-client for time-series trend endpoints. */\n readonly trends: TrendsClient;\n\n /** @internal */\n constructor(private readonly http: HttpClient) {\n this.trends = new TrendsClient(http);\n }\n\n /**\n * Retrieve market snapshot data with optional filters.\n *\n * `GET /internal-api/v1/markets/snapshots`\n */\n async snapshots(params: SnapshotsParams): Promise<SnapshotsResponse> {\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.internalGet<SnapshotsResponse>(\n `/internal-api/v1/markets/snapshots${qs}`,\n { signal },\n );\n }\n\n /**\n * Advanced market query with logical filter expressions.\n *\n * `POST /internal-api/v1/markets/query`\n */\n async query(\n body: AdvancedSearchBody,\n options?: RequestOptions,\n ): Promise<MarketQueryResponse> {\n return this.http.internalPost<MarketQueryResponse>(\n '/internal-api/v1/markets/query',\n body,\n options,\n );\n }\n}\n","import type { HttpClient } from '../http.js';\nimport { buildQueryString } from '../http.js';\nimport type { RequestOptions } from '../types.js';\nimport type {\n SubmitEventParams,\n ClassifiedEvent,\n QueryEventsParams,\n PaginatedEvents,\n CreateIntegrationParams,\n Integration,\n UpdateIntegrationParams,\n TestResult,\n CreateSubscriptionParams,\n Subscription,\n UpdateSubscriptionParams,\n EventCategory,\n EventType,\n TagInfo,\n} from './types.js';\n\n/**\n * Client for the Intent Hub API domain.\n *\n * ```ts\n * const event = await client.intentHub.submitEvent({\n * sourceType: 'AGENT',\n * sourceId: 'my-agent',\n * textContent: 'User wants to refinance their mortgage',\n * });\n * ```\n */\nexport class IntentHubClient {\n /** @internal */\n constructor(private readonly http: HttpClient) {}\n\n // -------------------------------------------------------------------------\n // Events\n // -------------------------------------------------------------------------\n\n /**\n * Submit a raw event for classification.\n *\n * `POST /intent-hub/v1/events`\n */\n async submitEvent(params: SubmitEventParams): Promise<ClassifiedEvent> {\n const { signal, ...rest } = params;\n return this.http.intentHubPost<ClassifiedEvent>(\n '/events',\n {\n source_type: rest.sourceType,\n source_id: rest.sourceId,\n text_content: rest.textContent,\n payload: rest.payload,\n user_id: rest.userId,\n session_id: rest.sessionId,\n suggested_category: rest.suggestedCategory,\n suggested_intent: rest.suggestedIntent,\n idempotency_key: rest.idempotencyKey,\n event_type: rest.eventType,\n },\n { signal },\n );\n }\n\n /**\n * Retrieve a single classified event by ID.\n *\n * `GET /intent-hub/v1/events/:eventId`\n */\n async getEvent(eventId: string, options?: RequestOptions): Promise<ClassifiedEvent> {\n return this.http.intentHubGet<ClassifiedEvent>(\n `/events/${encodeURIComponent(eventId)}`,\n options,\n );\n }\n\n /**\n * Query classified events with optional filters.\n *\n * `GET /intent-hub/v1/events`\n */\n async queryEvents(params?: QueryEventsParams): Promise<PaginatedEvents> {\n if (!params) {\n return this.http.intentHubGet<PaginatedEvents>('/events');\n }\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.intentHubGet<PaginatedEvents>(`/events${qs}`, { signal });\n }\n\n // -------------------------------------------------------------------------\n // Integrations\n // -------------------------------------------------------------------------\n\n /**\n * Create a new integration endpoint.\n *\n * `POST /intent-hub/v1/integrations`\n */\n async createIntegration(params: CreateIntegrationParams): Promise<Integration> {\n const { signal, ...rest } = params;\n return this.http.intentHubPost<Integration>(\n '/integrations',\n {\n name: rest.name,\n type: rest.type,\n url: rest.url,\n secret: rest.secret,\n headers: rest.headers,\n config: rest.config,\n },\n { signal },\n );\n }\n\n /**\n * List all integrations for the current organisation.\n *\n * `GET /intent-hub/v1/integrations`\n */\n async listIntegrations(options?: RequestOptions): Promise<Integration[]> {\n return this.http.intentHubGet<Integration[]>('/integrations', options);\n }\n\n /**\n * Retrieve a single integration by ID.\n *\n * `GET /intent-hub/v1/integrations/:id`\n */\n async getIntegration(id: string, options?: RequestOptions): Promise<Integration> {\n return this.http.intentHubGet<Integration>(\n `/integrations/${encodeURIComponent(id)}`,\n options,\n );\n }\n\n /**\n * Update an existing integration.\n *\n * `PATCH /intent-hub/v1/integrations/:id`\n */\n async updateIntegration(\n id: string,\n params: UpdateIntegrationParams,\n ): Promise<Integration> {\n const { signal, ...rest } = params;\n return this.http.intentHubPatch<Integration>(\n `/integrations/${encodeURIComponent(id)}`,\n {\n name: rest.name,\n url: rest.url,\n secret: rest.secret,\n status: rest.status,\n },\n { signal },\n );\n }\n\n /**\n * Delete an integration by ID.\n *\n * `DELETE /intent-hub/v1/integrations/:id`\n */\n async deleteIntegration(id: string, options?: RequestOptions): Promise<void> {\n return this.http.intentHubDelete<void>(\n `/integrations/${encodeURIComponent(id)}`,\n options,\n );\n }\n\n /**\n * Send a test event to an integration endpoint.\n *\n * `POST /intent-hub/v1/integrations/:id/test`\n */\n async testIntegration(id: string, options?: RequestOptions): Promise<TestResult> {\n return this.http.intentHubPost<TestResult>(\n `/integrations/${encodeURIComponent(id)}/test`,\n {},\n options,\n );\n }\n\n // -------------------------------------------------------------------------\n // Subscriptions\n // -------------------------------------------------------------------------\n\n /**\n * Create a new subscription linking event patterns to an integration.\n *\n * `POST /intent-hub/v1/subscriptions`\n */\n async createSubscription(params: CreateSubscriptionParams): Promise<Subscription> {\n const { signal, ...rest } = params;\n return this.http.intentHubPost<Subscription>(\n '/subscriptions',\n {\n integration_id: rest.integrationId,\n event_type_slug: rest.eventTypeSlug,\n tag: rest.tag,\n intent_pattern: rest.intentPattern,\n filters: rest.filters,\n },\n { signal },\n );\n }\n\n /**\n * List all subscriptions for the current organisation.\n *\n * `GET /intent-hub/v1/subscriptions`\n */\n async listSubscriptions(options?: RequestOptions): Promise<Subscription[]> {\n return this.http.intentHubGet<Subscription[]>('/subscriptions', options);\n }\n\n /**\n * Retrieve a single subscription by ID.\n *\n * `GET /intent-hub/v1/subscriptions/:id`\n */\n async getSubscription(id: string, options?: RequestOptions): Promise<Subscription> {\n return this.http.intentHubGet<Subscription>(\n `/subscriptions/${encodeURIComponent(id)}`,\n options,\n );\n }\n\n /**\n * Update an existing subscription.\n *\n * `PATCH /intent-hub/v1/subscriptions/:id`\n */\n async updateSubscription(\n id: string,\n params: UpdateSubscriptionParams,\n ): Promise<Subscription> {\n const { signal, ...rest } = params;\n return this.http.intentHubPatch<Subscription>(\n `/subscriptions/${encodeURIComponent(id)}`,\n {\n event_type_slug: rest.eventTypeSlug,\n tag: rest.tag,\n intent_pattern: rest.intentPattern,\n integration_id: rest.integrationId,\n is_active: rest.isActive,\n },\n { signal },\n );\n }\n\n /**\n * Delete a subscription by ID.\n *\n * `DELETE /intent-hub/v1/subscriptions/:id`\n */\n async deleteSubscription(id: string, options?: RequestOptions): Promise<void> {\n return this.http.intentHubDelete<void>(\n `/subscriptions/${encodeURIComponent(id)}`,\n options,\n );\n }\n\n // -------------------------------------------------------------------------\n // Catalog\n // -------------------------------------------------------------------------\n\n /**\n * List all event categories in the taxonomy.\n *\n * `GET /intent-hub/v1/catalog/categories`\n */\n async listCategories(options?: RequestOptions): Promise<EventCategory[]> {\n return this.http.intentHubGet<EventCategory[]>('/catalog/categories', options);\n }\n\n /**\n * List event types, optionally filtered by category.\n *\n * `GET /intent-hub/v1/catalog/event-types`\n */\n async listEventTypes(\n params?: { category?: string } & RequestOptions,\n ): Promise<EventType[]> {\n if (!params) {\n return this.http.intentHubGet<EventType[]>('/catalog/event-types');\n }\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.intentHubGet<EventType[]>(`/catalog/event-types${qs}`, { signal });\n }\n\n /**\n * List all tags with their usage counts.\n *\n * `GET /intent-hub/v1/catalog/tags`\n */\n async listTags(options?: RequestOptions): Promise<TagInfo[]> {\n return this.http.intentHubGet<TagInfo[]>('/catalog/tags', options);\n }\n}\n","import type { HtAgClientOptions, ResolvedConfig } from './types.js';\nimport { HttpClient } from './http.js';\nimport { AddressClient } from './address/client.js';\nimport { PropertyClient } from './property/client.js';\nimport { MarketsClient } from './markets/client.js';\nimport { IntentHubClient } from './intent-hub/client.js';\n\n// ---------------------------------------------------------------------------\n// Defaults\n// ---------------------------------------------------------------------------\n\nconst DEFAULT_MAX_RETRIES = 3;\nconst DEFAULT_RETRY_BASE_DELAY = 500; // ms\nconst DEFAULT_TIMEOUT = 30_000; // 30 seconds\n\n/**\n * Build the environment-derived base URLs.\n *\n * - `prod` -> `https://api.prod.htagai.com`\n * - `dev` -> `https://api.dev.htagai.com`\n */\nfunction resolveBaseUrls(options: HtAgClientOptions): {\n publicBaseUrl: string;\n internalBaseUrl: string;\n intentHubBaseUrl: string;\n} {\n if (options.baseUrl) {\n // Strip trailing slashes for consistency.\n const base = options.baseUrl.replace(/\\/+$/, '');\n return { publicBaseUrl: base, internalBaseUrl: base, intentHubBaseUrl: base };\n }\n\n const env = options.environment ?? 'prod';\n const base = `https://api.${env}.htagai.com`;\n return {\n publicBaseUrl: base,\n internalBaseUrl: base,\n intentHubBaseUrl: `${base}/intent-hub/v1`,\n };\n}\n\n// ---------------------------------------------------------------------------\n// HtAgApiClient\n// ---------------------------------------------------------------------------\n\n/**\n * Top-level client for the HtAG Location Intelligence APIs.\n *\n * ```ts\n * import { HtAgApiClient } from '@htag/sdk';\n *\n * const client = new HtAgApiClient({\n * apiKey: process.env.HTAG_API_KEY!,\n * environment: 'prod',\n * });\n *\n * const results = await client.address.search({ q: '100 George St Sydney' });\n * ```\n */\nexport class HtAgApiClient {\n /** Address search, insights and standardisation. */\n readonly address: AddressClient;\n\n /** Sold property search. */\n readonly property: PropertyClient;\n\n /** Market snapshots, advanced queries and time-series trends. */\n readonly markets: MarketsClient;\n\n /** Intent Hub: event classification, integrations and subscriptions. */\n readonly intentHub: IntentHubClient;\n\n constructor(options: HtAgClientOptions) {\n if (!options.apiKey) {\n throw new Error(\n 'HtAgApiClient requires an apiKey. Pass it in the constructor options.',\n );\n }\n\n const { publicBaseUrl, internalBaseUrl, intentHubBaseUrl } = resolveBaseUrls(options);\n\n const config: ResolvedConfig = {\n apiKey: options.apiKey,\n publicBaseUrl,\n internalBaseUrl,\n intentHubBaseUrl,\n maxRetries: options.maxRetries ?? DEFAULT_MAX_RETRIES,\n retryBaseDelay: options.retryBaseDelay ?? DEFAULT_RETRY_BASE_DELAY,\n timeout: options.timeout ?? DEFAULT_TIMEOUT,\n };\n\n const http = new HttpClient(config);\n\n this.address = new AddressClient(http);\n this.property = new PropertyClient(http);\n this.markets = new MarketsClient(http);\n this.intentHub = new IntentHubClient(http);\n }\n}\n"],"mappings":";AAGO,IAAM,YAAN,cAAwB,MAAM;AAAA;AAAA,EAE1B;AAAA;AAAA,EAGA;AAAA;AAAA,EAGA;AAAA,EAET,YACE,SACA,SAMA;AACA,UAAM,SAAS,EAAE,OAAO,SAAS,MAAM,CAAC;AACxC,SAAK,OAAO;AACZ,SAAK,SAAS,SAAS;AACvB,SAAK,OAAO,SAAS;AACrB,SAAK,MAAM,SAAS;AAAA,EACtB;AACF;AAKO,IAAM,sBAAN,cAAkC,UAAU;AAAA,EACjD,YAAY,SAAyD;AACnE;AAAA,MACE,+BAA+B,QAAQ,MAAM;AAAA,MAC7C;AAAA,IACF;AACA,SAA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AAM,MAAM,QAAQ,eAAe;AACnC,QAAM,OAAO,eAAe,GAAG;AAC/B,SAAO;AAAA,IACL,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,kBAAkB,GAAG,IAAI;AAAA,EAC3B;AACF;AAoBO,IAAM,gBAAN,MAAoB;AAAA;AAAA,EAEhB;AAAA;AAAA,EAGA;AAAA;AAAA,EAGA;AAAA;AAAA,EAGA;AAAA,EAET,YAAY,SAA4B;AACtC,QAAI,CAAC,QAAQ,QAAQ;AACnB,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAEA,UAAM,EAAE,eAAe,iBAAiB,iBAAiB,IAAI,gBAAgB,OAAO;AAEpF,UAAM,SAAyB;AAAA,MAC7B,QAAQ,QAAQ;AAAA,MAChB;AAAA,MACA;AAAA,MACA;AAAA,MACA,YAAY,QAAQ,cAAc;AAAA,MAClC,gBAAgB,QAAQ,kBAAkB;AAAA,MAC1C,SAAS,QAAQ,WAAW;AAAA,IAC9B;AAEA,UAAM,OAAO,IAAI,WAAW,MAAM;AAElC,SAAK,UAAU,IAAI,cAAc,IAAI;AACrC,SAAK,WAAW,IAAI,eAAe,IAAI;AACvC,SAAK,UAAU,IAAI,cAAc,IAAI;AACrC,SAAK,YAAY,IAAI,gBAAgB,IAAI;AAAA,EAC3C;AACF;","names":["base"]}
1
+ {"version":3,"sources":["../src/errors.ts","../src/http.ts","../src/address/client.ts","../src/property/client.ts","../src/markets/trends.ts","../src/markets/client.ts","../src/intent-hub/client.ts","../src/client.ts"],"sourcesContent":["/**\n * Base error class for all HtAG SDK errors.\n */\nexport class HtAgError extends Error {\n /** HTTP status code, if available. */\n readonly status: number | undefined;\n\n /** Raw response body, if available. */\n readonly body: unknown;\n\n /** The request URL that caused the error. */\n readonly url: string | undefined;\n\n constructor(\n message: string,\n options?: {\n status?: number;\n body?: unknown;\n url?: string;\n cause?: unknown;\n },\n ) {\n super(message, { cause: options?.cause });\n this.name = 'HtAgError';\n this.status = options?.status;\n this.body = options?.body;\n this.url = options?.url;\n }\n}\n\n/**\n * Thrown when the server returns 401 or 403.\n */\nexport class AuthenticationError extends HtAgError {\n constructor(options: { status: number; body: unknown; url: string }) {\n super(\n `Authentication failed (HTTP ${options.status}). Check your API key.`,\n options,\n );\n this.name = 'AuthenticationError';\n }\n}\n\n/**\n * Thrown when the server returns 429 after exhausting all retries.\n */\nexport class RateLimitError extends HtAgError {\n constructor(options: { body: unknown; url: string }) {\n super('Rate limit exceeded. Please retry after a short delay.', {\n status: 429,\n ...options,\n });\n this.name = 'RateLimitError';\n }\n}\n\n/**\n * Thrown when the server returns 400 or 422.\n */\nexport class ValidationError extends HtAgError {\n constructor(options: { status: number; body: unknown; url: string }) {\n const detail = extractDetail(options.body);\n super(\n detail\n ? `Validation error (HTTP ${options.status}): ${detail}`\n : `Validation error (HTTP ${options.status})`,\n options,\n );\n this.name = 'ValidationError';\n }\n}\n\n/**\n * Thrown when the server returns a 5xx status after exhausting all retries.\n */\nexport class ServerError extends HtAgError {\n constructor(options: { status: number; body: unknown; url: string }) {\n super(`Server error (HTTP ${options.status})`, options);\n this.name = 'ServerError';\n }\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction extractDetail(body: unknown): string | undefined {\n if (body && typeof body === 'object' && 'detail' in body) {\n const detail = (body as Record<string, unknown>).detail;\n if (typeof detail === 'string') return detail;\n if (Array.isArray(detail)) {\n return detail\n .map((d) => {\n if (typeof d === 'string') return d;\n if (d && typeof d === 'object' && 'msg' in d) return String(d.msg);\n return JSON.stringify(d);\n })\n .join('; ');\n }\n return JSON.stringify(detail);\n }\n return undefined;\n}\n","import type { ResolvedConfig, RequestOptions } from './types.js';\nimport {\n HtAgError,\n AuthenticationError,\n RateLimitError,\n ValidationError,\n ServerError,\n} from './errors.js';\n\n// ---------------------------------------------------------------------------\n// camelCase -> snake_case conversion\n// ---------------------------------------------------------------------------\n\n/**\n * Convert a camelCase string to snake_case.\n *\n * Handles sequences of uppercase letters correctly:\n * - \"areaId\" -> \"area_id\"\n * - \"periodEndMin\" -> \"period_end_min\"\n * - \"IRSD\" -> \"irsd\" (all-caps treated as one token)\n */\nfunction toSnakeCase(str: string): string {\n return str\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')\n .replace(/([a-z0-9])([A-Z])/g, '$1_$2')\n .toLowerCase();\n}\n\n// ---------------------------------------------------------------------------\n// Query-string builder\n// ---------------------------------------------------------------------------\n\n/**\n * Build a URL query string from a params object, converting camelCase keys\n * to snake_case. Arrays are joined with commas. `undefined` and `null` values\n * are omitted.\n */\nexport function buildQueryString(\n params: Record<string, unknown>,\n): string {\n const parts: string[] = [];\n\n for (const [key, value] of Object.entries(params)) {\n // Skip internal SDK options that are not API params.\n if (key === 'signal') continue;\n if (value === undefined || value === null) continue;\n\n const snakeKey = toSnakeCase(key);\n\n if (Array.isArray(value)) {\n if (value.length > 0) {\n parts.push(\n `${encodeURIComponent(snakeKey)}=${encodeURIComponent(value.join(','))}`,\n );\n }\n } else {\n parts.push(\n `${encodeURIComponent(snakeKey)}=${encodeURIComponent(String(value))}`,\n );\n }\n }\n\n return parts.length > 0 ? `?${parts.join('&')}` : '';\n}\n\n// ---------------------------------------------------------------------------\n// Retryable HTTP client\n// ---------------------------------------------------------------------------\n\nfunction isRetryable(status: number): boolean {\n return status === 429 || status >= 500;\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\n/**\n * Parse the body of a response. Returns the parsed JSON on success or a string\n * representation when parsing fails.\n */\nasync function parseBody(response: Response): Promise<unknown> {\n const contentType = response.headers.get('content-type') ?? '';\n if (contentType.includes('application/json')) {\n try {\n return await response.json();\n } catch {\n return await response.text();\n }\n }\n return await response.text();\n}\n\n/**\n * Throw the appropriate typed error for the given HTTP status.\n */\nfunction throwForStatus(\n status: number,\n body: unknown,\n url: string,\n): never {\n if (status === 401 || status === 403) {\n throw new AuthenticationError({ status, body, url });\n }\n if (status === 429) {\n throw new RateLimitError({ body, url });\n }\n if (status === 400 || status === 422) {\n throw new ValidationError({ status, body, url });\n }\n if (status >= 500) {\n throw new ServerError({ status, body, url });\n }\n throw new HtAgError(`HTTP ${status}`, { status, body, url });\n}\n\n/**\n * Internal HTTP transport used by all domain clients.\n */\nexport class HttpClient {\n constructor(private readonly config: ResolvedConfig) {}\n\n /**\n * Execute a GET request against the public API base.\n */\n async get<T>(path: string, options?: RequestOptions): Promise<T> {\n return this.request<T>('GET', this.config.publicBaseUrl + path, undefined, options);\n }\n\n /**\n * Execute a POST request against the public API base.\n */\n async post<T>(\n path: string,\n body: unknown,\n options?: RequestOptions,\n ): Promise<T> {\n return this.request<T>('POST', this.config.publicBaseUrl + path, body, options);\n }\n\n /**\n * Execute a PATCH request against the public API base.\n */\n async patch<T>(\n path: string,\n body: unknown,\n options?: RequestOptions,\n ): Promise<T> {\n return this.request<T>('PATCH', this.config.publicBaseUrl + path, body, options);\n }\n\n /**\n * Execute a DELETE request against the public API base.\n */\n async delete<T>(path: string, options?: RequestOptions): Promise<T> {\n return this.request<T>('DELETE', this.config.publicBaseUrl + path, undefined, options);\n }\n\n /**\n * Execute a GET request against the internal API base.\n */\n async internalGet<T>(path: string, options?: RequestOptions): Promise<T> {\n return this.request<T>('GET', this.config.internalBaseUrl + path, undefined, options);\n }\n\n /**\n * Execute a POST request against the internal API base.\n */\n async internalPost<T>(\n path: string,\n body: unknown,\n options?: RequestOptions,\n ): Promise<T> {\n return this.request<T>('POST', this.config.internalBaseUrl + path, body, options);\n }\n\n /**\n * Execute a GET request against the Intent Hub API base.\n */\n async intentHubGet<T>(path: string, options?: RequestOptions): Promise<T> {\n return this.request<T>('GET', this.config.intentHubBaseUrl + path, undefined, options);\n }\n\n /**\n * Execute a POST request against the Intent Hub API base.\n */\n async intentHubPost<T>(\n path: string,\n body: unknown,\n options?: RequestOptions,\n ): Promise<T> {\n return this.request<T>('POST', this.config.intentHubBaseUrl + path, body, options);\n }\n\n /**\n * Execute a PATCH request against the Intent Hub API base.\n */\n async intentHubPatch<T>(\n path: string,\n body: unknown,\n options?: RequestOptions,\n ): Promise<T> {\n return this.request<T>('PATCH', this.config.intentHubBaseUrl + path, body, options);\n }\n\n /**\n * Execute a DELETE request against the Intent Hub API base.\n */\n async intentHubDelete<T>(path: string, options?: RequestOptions): Promise<T> {\n return this.request<T>('DELETE', this.config.intentHubBaseUrl + path, undefined, options);\n }\n\n // -----------------------------------------------------------------------\n // Core request implementation with retries and exponential backoff\n // -----------------------------------------------------------------------\n\n private async request<T>(\n method: string,\n url: string,\n body: unknown,\n options?: RequestOptions,\n ): Promise<T> {\n const headers: Record<string, string> = {\n 'x-api-key': this.config.apiKey,\n 'accept': 'application/json',\n };\n\n if (body !== undefined) {\n headers['content-type'] = 'application/json';\n }\n\n let lastError: Error | undefined;\n\n for (let attempt = 0; attempt <= this.config.maxRetries; attempt++) {\n // If this is a retry, wait with exponential backoff + jitter.\n if (attempt > 0) {\n const base = this.config.retryBaseDelay * Math.pow(2, attempt - 1);\n const jitter = Math.random() * base * 0.5;\n await sleep(base + jitter);\n }\n\n // Build an AbortController that combines the user signal with a timeout.\n const controller = new AbortController();\n let timeoutId: ReturnType<typeof setTimeout> | undefined;\n\n const cleanup = () => {\n if (timeoutId !== undefined) clearTimeout(timeoutId);\n };\n\n // Wire up caller's abort signal.\n if (options?.signal) {\n if (options.signal.aborted) {\n throw new HtAgError('Request aborted', {\n url,\n cause: options.signal.reason,\n });\n }\n options.signal.addEventListener('abort', () => controller.abort(options.signal!.reason), {\n once: true,\n });\n }\n\n timeoutId = setTimeout(\n () => controller.abort(new Error('Request timed out')),\n this.config.timeout,\n );\n\n try {\n const response = await fetch(url, {\n method,\n headers,\n body: body !== undefined ? JSON.stringify(body) : undefined,\n signal: controller.signal,\n });\n\n cleanup();\n\n if (response.ok) {\n // 204 No Content — nothing to parse.\n if (response.status === 204) {\n return undefined as T;\n }\n return (await parseBody(response)) as T;\n }\n\n const responseBody = await parseBody(response);\n\n // Retry on retryable statuses, unless we've exhausted retries.\n if (isRetryable(response.status) && attempt < this.config.maxRetries) {\n lastError = new HtAgError(`HTTP ${response.status}`, {\n status: response.status,\n body: responseBody,\n url,\n });\n continue;\n }\n\n // Non-retryable or exhausted retries — throw typed error.\n throwForStatus(response.status, responseBody, url);\n } catch (err) {\n cleanup();\n\n // Re-throw our own typed errors.\n if (err instanceof HtAgError) {\n throw err;\n }\n\n // Handle abort / timeout.\n if (err instanceof DOMException && err.name === 'AbortError') {\n if (options?.signal?.aborted) {\n throw new HtAgError('Request aborted', { url, cause: err });\n }\n throw new HtAgError('Request timed out', { url, cause: err });\n }\n\n // Network / fetch errors — retry if we have attempts left.\n if (attempt < this.config.maxRetries) {\n lastError = err instanceof Error ? err : new Error(String(err));\n continue;\n }\n\n throw new HtAgError(\n `Network error: ${err instanceof Error ? err.message : String(err)}`,\n { url, cause: err },\n );\n }\n }\n\n // Should not reach here, but just in case.\n throw lastError ?? new HtAgError('Request failed after retries', { url });\n }\n}\n","import type { HttpClient } from '../http.js';\nimport { buildQueryString } from '../http.js';\nimport type {\n AddressSearchParams,\n AddressSearchResponse,\n AddressInsightsParams,\n AddressInsightsResponse,\n BatchStandardiseParams,\n BatchStandardiseResponse,\n} from './types.js';\n\n/**\n * Client for the Address API domain.\n *\n * ```ts\n * const results = await client.address.search({ q: '100 George St Sydney' });\n * ```\n */\nexport class AddressClient {\n /** @internal */\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Search for addresses matching a free-text query.\n *\n * `GET /v1/address/search`\n */\n async search(params: AddressSearchParams): Promise<AddressSearchResponse> {\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.get<AddressSearchResponse>(`/v1/address/search${qs}`, { signal });\n }\n\n /**\n * Retrieve detailed insights for one or more addresses.\n *\n * `GET /v1/address/insights`\n */\n async insights(params: AddressInsightsParams): Promise<AddressInsightsResponse> {\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.get<AddressInsightsResponse>(`/v1/address/insights${qs}`, { signal });\n }\n\n /**\n * Standardise a batch of raw address strings into structured records.\n *\n * `POST /v1/address/standardise`\n */\n async standardise(params: BatchStandardiseParams): Promise<BatchStandardiseResponse> {\n const { signal, addresses } = params;\n return this.http.post<BatchStandardiseResponse>(\n '/v1/address/standardise',\n { addresses },\n { signal },\n );\n }\n}\n","import type { HttpClient } from '../http.js';\nimport { buildQueryString } from '../http.js';\nimport type {\n SoldSearchParams,\n SoldPropertiesResponse,\n} from './types.js';\n\n/**\n * Client for the Property API domain.\n *\n * ```ts\n * const sold = await client.property.soldSearch({ address: '100 George St Sydney', radius: 2000 });\n * ```\n */\nexport class PropertyClient {\n /** @internal */\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Search for recently sold properties near a location.\n *\n * `GET /v1/property/sold/search`\n */\n async soldSearch(params: SoldSearchParams): Promise<SoldPropertiesResponse> {\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.get<SoldPropertiesResponse>(`/v1/property/sold/search${qs}`, { signal });\n }\n}\n","import type { HttpClient } from '../http.js';\nimport { buildQueryString } from '../http.js';\nimport type {\n TrendsParams,\n TrendsWithBedroomsParams,\n PriceResponse,\n RentResponse,\n YieldResponse,\n SupplyDemandResponse,\n SearchIndexResponse,\n HoldPeriodResponse,\n PerformanceResponse,\n GrowthRatesResponse,\n DemandProfileResponse,\n} from './types.js';\n\n/**\n * Client for the Markets Trends API domain.\n *\n * Each method queries a specific time-series metric:\n *\n * ```ts\n * const prices = await client.markets.trends.price({\n * level: 'suburb',\n * areaId: ['SAL10001'],\n * propertyType: ['house'],\n * });\n * ```\n */\nexport class TrendsClient {\n /** @internal */\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Price history trends.\n *\n * `GET /internal-api/v1/markets/trends/price`\n */\n async price(params: TrendsWithBedroomsParams): Promise<PriceResponse> {\n return this.trend<PriceResponse>('price', params);\n }\n\n /**\n * Rent history trends.\n *\n * `GET /internal-api/v1/markets/trends/rent`\n */\n async rent(params: TrendsWithBedroomsParams): Promise<RentResponse> {\n return this.trend<RentResponse>('rent', params);\n }\n\n /**\n * Yield history trends.\n *\n * `GET /internal-api/v1/markets/trends/yield`\n */\n async yieldHistory(params: TrendsWithBedroomsParams): Promise<YieldResponse> {\n return this.trend<YieldResponse>('yield', params);\n }\n\n /**\n * Supply and demand (monthly frequency).\n *\n * `GET /internal-api/v1/markets/trends/supply-demand`\n */\n async supplyDemand(params: TrendsParams): Promise<SupplyDemandResponse> {\n return this.trend<SupplyDemandResponse>('supply-demand', params);\n }\n\n /**\n * Search interest index (quarterly frequency).\n *\n * `GET /internal-api/v1/markets/trends/search-index`\n */\n async searchIndex(params: TrendsParams): Promise<SearchIndexResponse> {\n return this.trend<SearchIndexResponse>('search-index', params);\n }\n\n /**\n * Hold period (yearly frequency).\n *\n * `GET /internal-api/v1/markets/trends/hold-period`\n */\n async holdPeriod(params: TrendsParams): Promise<HoldPeriodResponse> {\n return this.trend<HoldPeriodResponse>('hold-period', params);\n }\n\n /**\n * Performance essentials.\n *\n * `GET /internal-api/v1/markets/trends/performance`\n */\n async performance(params: TrendsWithBedroomsParams): Promise<PerformanceResponse> {\n return this.trend<PerformanceResponse>('performance', params);\n }\n\n /**\n * Growth rate cycle.\n *\n * `GET /internal-api/v1/markets/trends/growth-rates`\n */\n async growthRates(params: TrendsParams): Promise<GrowthRatesResponse> {\n return this.trend<GrowthRatesResponse>('growth-rates', params);\n }\n\n /**\n * Demand profile breakdown.\n *\n * `GET /internal-api/v1/markets/trends/demand-profile`\n */\n async demandProfile(params: TrendsWithBedroomsParams): Promise<DemandProfileResponse> {\n return this.trend<DemandProfileResponse>('demand-profile', params);\n }\n\n // -----------------------------------------------------------------------\n // Shared implementation\n // -----------------------------------------------------------------------\n\n private async trend<T>(metric: string, params: TrendsParams | TrendsWithBedroomsParams): Promise<T> {\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.internalGet<T>(\n `/internal-api/v1/markets/trends/${metric}${qs}`,\n { signal },\n );\n }\n}\n","import type { HttpClient } from '../http.js';\nimport { buildQueryString } from '../http.js';\nimport { TrendsClient } from './trends.js';\nimport type {\n SnapshotsParams,\n SnapshotsResponse,\n AdvancedSearchBody,\n MarketQueryResponse,\n} from './types.js';\nimport type { RequestOptions } from '../types.js';\n\n/**\n * Client for the Markets API domain.\n *\n * ```ts\n * const snapshots = await client.markets.snapshots({\n * level: 'suburb',\n * propertyType: ['house'],\n * });\n *\n * const prices = await client.markets.trends.price({\n * level: 'suburb',\n * areaId: ['SAL10001'],\n * });\n * ```\n */\nexport class MarketsClient {\n /** Sub-client for time-series trend endpoints. */\n readonly trends: TrendsClient;\n\n /** @internal */\n constructor(private readonly http: HttpClient) {\n this.trends = new TrendsClient(http);\n }\n\n /**\n * Retrieve market snapshot data with optional filters.\n *\n * `GET /internal-api/v1/markets/snapshots`\n */\n async snapshots(params: SnapshotsParams): Promise<SnapshotsResponse> {\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.internalGet<SnapshotsResponse>(\n `/internal-api/v1/markets/snapshots${qs}`,\n { signal },\n );\n }\n\n /**\n * Advanced market query with logical filter expressions.\n *\n * `POST /internal-api/v1/markets/query`\n */\n async query(\n body: AdvancedSearchBody,\n options?: RequestOptions,\n ): Promise<MarketQueryResponse> {\n return this.http.internalPost<MarketQueryResponse>(\n '/internal-api/v1/markets/query',\n body,\n options,\n );\n }\n}\n","import type { HttpClient } from '../http.js';\nimport { buildQueryString } from '../http.js';\nimport type { RequestOptions } from '../types.js';\nimport type {\n SubmitEventParams,\n ClassifiedEvent,\n QueryEventsParams,\n PaginatedEvents,\n CreateIntegrationParams,\n Integration,\n UpdateIntegrationParams,\n TestResult,\n CreateSubscriptionParams,\n Subscription,\n UpdateSubscriptionParams,\n EventCategory,\n EventType,\n TagInfo,\n} from './types.js';\n\n/**\n * Client for the Intent Hub API domain.\n *\n * ```ts\n * const event = await client.intentHub.submitEvent({\n * sourceType: 'AGENT',\n * sourceId: 'my-agent',\n * textContent: 'User wants to refinance their mortgage',\n * });\n * ```\n */\nexport class IntentHubClient {\n /** @internal */\n constructor(private readonly http: HttpClient) {}\n\n // -------------------------------------------------------------------------\n // Events\n // -------------------------------------------------------------------------\n\n /**\n * Submit a raw event for classification.\n *\n * `POST /intent-hub/v1/events`\n */\n async submitEvent(params: SubmitEventParams): Promise<ClassifiedEvent> {\n const { signal, ...rest } = params;\n return this.http.intentHubPost<ClassifiedEvent>(\n '/events',\n {\n source_type: rest.sourceType,\n source_id: rest.sourceId,\n text_content: rest.textContent,\n payload: rest.payload,\n user_id: rest.userId,\n session_id: rest.sessionId,\n suggested_category: rest.suggestedCategory,\n suggested_intent: rest.suggestedIntent,\n idempotency_key: rest.idempotencyKey,\n event_type: rest.eventType,\n },\n { signal },\n );\n }\n\n /**\n * Retrieve a single classified event by ID.\n *\n * `GET /intent-hub/v1/events/:eventId`\n */\n async getEvent(eventId: string, options?: RequestOptions): Promise<ClassifiedEvent> {\n return this.http.intentHubGet<ClassifiedEvent>(\n `/events/${encodeURIComponent(eventId)}`,\n options,\n );\n }\n\n /**\n * Query classified events with optional filters.\n *\n * `GET /intent-hub/v1/events`\n */\n async queryEvents(params?: QueryEventsParams): Promise<PaginatedEvents> {\n if (!params) {\n return this.http.intentHubGet<PaginatedEvents>('/events');\n }\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.intentHubGet<PaginatedEvents>(`/events${qs}`, { signal });\n }\n\n // -------------------------------------------------------------------------\n // Integrations\n // -------------------------------------------------------------------------\n\n /**\n * Create a new integration endpoint.\n *\n * `POST /intent-hub/v1/integrations`\n */\n async createIntegration(params: CreateIntegrationParams): Promise<Integration> {\n const { signal, ...rest } = params;\n return this.http.intentHubPost<Integration>(\n '/integrations',\n {\n name: rest.name,\n type: rest.type,\n url: rest.url,\n secret: rest.secret,\n headers: rest.headers,\n config: rest.config,\n },\n { signal },\n );\n }\n\n /**\n * List all integrations for the current organisation.\n *\n * `GET /intent-hub/v1/integrations`\n */\n async listIntegrations(options?: RequestOptions): Promise<Integration[]> {\n return this.http.intentHubGet<Integration[]>('/integrations', options);\n }\n\n /**\n * Retrieve a single integration by ID.\n *\n * `GET /intent-hub/v1/integrations/:id`\n */\n async getIntegration(id: string, options?: RequestOptions): Promise<Integration> {\n return this.http.intentHubGet<Integration>(\n `/integrations/${encodeURIComponent(id)}`,\n options,\n );\n }\n\n /**\n * Update an existing integration.\n *\n * `PATCH /intent-hub/v1/integrations/:id`\n */\n async updateIntegration(\n id: string,\n params: UpdateIntegrationParams,\n ): Promise<Integration> {\n const { signal, ...rest } = params;\n return this.http.intentHubPatch<Integration>(\n `/integrations/${encodeURIComponent(id)}`,\n {\n name: rest.name,\n url: rest.url,\n secret: rest.secret,\n status: rest.status,\n },\n { signal },\n );\n }\n\n /**\n * Delete an integration by ID.\n *\n * `DELETE /intent-hub/v1/integrations/:id`\n */\n async deleteIntegration(id: string, options?: RequestOptions): Promise<void> {\n return this.http.intentHubDelete<void>(\n `/integrations/${encodeURIComponent(id)}`,\n options,\n );\n }\n\n /**\n * Send a test event to an integration endpoint.\n *\n * `POST /intent-hub/v1/integrations/:id/test`\n */\n async testIntegration(id: string, options?: RequestOptions): Promise<TestResult> {\n return this.http.intentHubPost<TestResult>(\n `/integrations/${encodeURIComponent(id)}/test`,\n {},\n options,\n );\n }\n\n // -------------------------------------------------------------------------\n // Subscriptions\n // -------------------------------------------------------------------------\n\n /**\n * Create a new subscription linking event patterns to an integration.\n *\n * `POST /intent-hub/v1/subscriptions`\n */\n async createSubscription(params: CreateSubscriptionParams): Promise<Subscription> {\n const { signal, ...rest } = params;\n return this.http.intentHubPost<Subscription>(\n '/subscriptions',\n {\n integration_id: rest.integrationId,\n event_type_slug: rest.eventTypeSlug,\n tag: rest.tag,\n intent_pattern: rest.intentPattern,\n filters: rest.filters,\n },\n { signal },\n );\n }\n\n /**\n * List all subscriptions for the current organisation.\n *\n * `GET /intent-hub/v1/subscriptions`\n */\n async listSubscriptions(options?: RequestOptions): Promise<Subscription[]> {\n return this.http.intentHubGet<Subscription[]>('/subscriptions', options);\n }\n\n /**\n * Retrieve a single subscription by ID.\n *\n * `GET /intent-hub/v1/subscriptions/:id`\n */\n async getSubscription(id: string, options?: RequestOptions): Promise<Subscription> {\n return this.http.intentHubGet<Subscription>(\n `/subscriptions/${encodeURIComponent(id)}`,\n options,\n );\n }\n\n /**\n * Update an existing subscription.\n *\n * `PATCH /intent-hub/v1/subscriptions/:id`\n */\n async updateSubscription(\n id: string,\n params: UpdateSubscriptionParams,\n ): Promise<Subscription> {\n const { signal, ...rest } = params;\n return this.http.intentHubPatch<Subscription>(\n `/subscriptions/${encodeURIComponent(id)}`,\n {\n event_type_slug: rest.eventTypeSlug,\n tag: rest.tag,\n intent_pattern: rest.intentPattern,\n integration_id: rest.integrationId,\n is_active: rest.isActive,\n },\n { signal },\n );\n }\n\n /**\n * Delete a subscription by ID.\n *\n * `DELETE /intent-hub/v1/subscriptions/:id`\n */\n async deleteSubscription(id: string, options?: RequestOptions): Promise<void> {\n return this.http.intentHubDelete<void>(\n `/subscriptions/${encodeURIComponent(id)}`,\n options,\n );\n }\n\n // -------------------------------------------------------------------------\n // Catalog\n // -------------------------------------------------------------------------\n\n /**\n * List all event categories in the taxonomy.\n *\n * `GET /intent-hub/v1/catalog/categories`\n */\n async listCategories(options?: RequestOptions): Promise<EventCategory[]> {\n return this.http.intentHubGet<EventCategory[]>('/catalog/categories', options);\n }\n\n /**\n * List event types, optionally filtered by category.\n *\n * `GET /intent-hub/v1/catalog/event-types`\n */\n async listEventTypes(\n params?: { category?: string } & RequestOptions,\n ): Promise<EventType[]> {\n if (!params) {\n return this.http.intentHubGet<EventType[]>('/catalog/event-types');\n }\n const { signal, ...query } = params;\n const qs = buildQueryString(query);\n return this.http.intentHubGet<EventType[]>(`/catalog/event-types${qs}`, { signal });\n }\n\n /**\n * List all tags with their usage counts.\n *\n * `GET /intent-hub/v1/catalog/tags`\n */\n async listTags(options?: RequestOptions): Promise<TagInfo[]> {\n return this.http.intentHubGet<TagInfo[]>('/catalog/tags', options);\n }\n}\n","import type { HtAgClientOptions, ResolvedConfig } from './types.js';\nimport { HttpClient } from './http.js';\nimport { AddressClient } from './address/client.js';\nimport { PropertyClient } from './property/client.js';\nimport { MarketsClient } from './markets/client.js';\nimport { IntentHubClient } from './intent-hub/client.js';\n\n// ---------------------------------------------------------------------------\n// Defaults\n// ---------------------------------------------------------------------------\n\nconst DEFAULT_MAX_RETRIES = 3;\nconst DEFAULT_RETRY_BASE_DELAY = 500; // ms\nconst DEFAULT_TIMEOUT = 30_000; // 30 seconds\n\n/**\n * Build the environment-derived base URLs.\n *\n * - `prod` -> `https://api.prod.htagai.com`\n * - `dev` -> `https://api.dev.htagai.com`\n */\nfunction resolveBaseUrls(options: HtAgClientOptions): {\n publicBaseUrl: string;\n internalBaseUrl: string;\n intentHubBaseUrl: string;\n} {\n if (options.baseUrl) {\n // Strip trailing slashes for consistency.\n const base = options.baseUrl.replace(/\\/+$/, '');\n return { publicBaseUrl: base, internalBaseUrl: base, intentHubBaseUrl: base };\n }\n\n const env = options.environment ?? 'prod';\n const base = `https://api.${env}.htagai.com`;\n return {\n publicBaseUrl: base,\n internalBaseUrl: base,\n intentHubBaseUrl: `${base}/intent-hub/v1`,\n };\n}\n\n// ---------------------------------------------------------------------------\n// HtAgApiClient\n// ---------------------------------------------------------------------------\n\n/**\n * Top-level client for the HtAG Location Intelligence APIs.\n *\n * ```ts\n * import { HtAgApiClient } from '@htag/sdk';\n *\n * const client = new HtAgApiClient({\n * apiKey: process.env.HTAG_API_KEY!,\n * environment: 'prod',\n * });\n *\n * const results = await client.address.search({ q: '100 George St Sydney' });\n * ```\n */\nexport class HtAgApiClient {\n /** Address search, insights and standardisation. */\n readonly address: AddressClient;\n\n /** Sold property search. */\n readonly property: PropertyClient;\n\n /** Market snapshots, advanced queries and time-series trends. */\n readonly markets: MarketsClient;\n\n /** Intent Hub: event classification, integrations and subscriptions. */\n readonly intentHub: IntentHubClient;\n\n constructor(options: HtAgClientOptions) {\n if (!options.apiKey) {\n throw new Error(\n 'HtAgApiClient requires an apiKey. Pass it in the constructor options.',\n );\n }\n\n const { publicBaseUrl, internalBaseUrl, intentHubBaseUrl } = resolveBaseUrls(options);\n\n const config: ResolvedConfig = {\n apiKey: options.apiKey,\n publicBaseUrl,\n internalBaseUrl,\n intentHubBaseUrl,\n maxRetries: options.maxRetries ?? DEFAULT_MAX_RETRIES,\n retryBaseDelay: options.retryBaseDelay ?? DEFAULT_RETRY_BASE_DELAY,\n timeout: options.timeout ?? DEFAULT_TIMEOUT,\n };\n\n const http = new HttpClient(config);\n\n this.address = new AddressClient(http);\n this.property = new PropertyClient(http);\n this.markets = new MarketsClient(http);\n this.intentHub = new IntentHubClient(http);\n }\n}\n"],"mappings":";AAGO,IAAM,YAAN,cAAwB,MAAM;AAAA;AAAA,EAE1B;AAAA;AAAA,EAGA;AAAA;AAAA,EAGA;AAAA,EAET,YACE,SACA,SAMA;AACA,UAAM,SAAS,EAAE,OAAO,SAAS,MAAM,CAAC;AACxC,SAAK,OAAO;AACZ,SAAK,SAAS,SAAS;AACvB,SAAK,OAAO,SAAS;AACrB,SAAK,MAAM,SAAS;AAAA,EACtB;AACF;AAKO,IAAM,sBAAN,cAAkC,UAAU;AAAA,EACjD,YAAY,SAAyD;AACnE;AAAA,MACE,+BAA+B,QAAQ,MAAM;AAAA,MAC7C;AAAA,IACF;AACA,SAAK,OAAO;AAAA,EACd;AACF;AAKO,IAAM,iBAAN,cAA6B,UAAU;AAAA,EAC5C,YAAY,SAAyC;AACnD,UAAM,0DAA0D;AAAA,MAC9D,QAAQ;AAAA,MACR,GAAG;AAAA,IACL,CAAC;AACD,SAAK,OAAO;AAAA,EACd;AACF;AAKO,IAAM,kBAAN,cAA8B,UAAU;AAAA,EAC7C,YAAY,SAAyD;AACnE,UAAM,SAAS,cAAc,QAAQ,IAAI;AACzC;AAAA,MACE,SACI,0BAA0B,QAAQ,MAAM,MAAM,MA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R;AAAA,MACF;AAAA,IACF;AAEA,UAAM,EAAE,eAAe,iBAAiB,iBAAiB,IAAI,gBAAgB,OAAO;AAEpF,UAAM,SAAyB;AAAA,MAC7B,QAAQ,QAAQ;AAAA,MAChB;AAAA,MACA;AAAA,MACA;AAAA,MACA,YAAY,QAAQ,cAAc;AAAA,MAClC,gBAAgB,QAAQ,kBAAkB;AAAA,MAC1C,SAAS,QAAQ,WAAW;AAAA,IAC9B;AAEA,UAAM,OAAO,IAAI,WAAW,MAAM;AAElC,SAAK,UAAU,IAAI,cAAc,IAAI;AACrC,SAAK,WAAW,IAAI,eAAe,IAAI;AACvC,SAAK,UAAU,IAAI,cAAc,IAAI;AACrC,SAAK,YAAY,IAAI,gBAAgB,IAAI;AAAA,EAC3C;AACF;","names":["base"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "htag-sdk",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "Official TypeScript SDK for HtAG Location Intelligence APIs — address search, property data, and market analytics for Australia",
5
5
  "license": "MIT",
6
6
  "author": {