htag-sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +459 -0
- package/dist/index.cjs +510 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +691 -0
- package/dist/index.d.ts +691 -0
- package/dist/index.js +474 -0
- package/dist/index.js.map +1 -0
- package/package.json +67 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,691 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client configuration options.
|
|
3
|
+
*/
|
|
4
|
+
interface HtAgClientOptions {
|
|
5
|
+
/** API key for authentication. Sent as the `x-api-key` header. */
|
|
6
|
+
apiKey: string;
|
|
7
|
+
/** Target environment. Determines the base URL unless `baseUrl` is provided. */
|
|
8
|
+
environment?: 'dev' | 'prod';
|
|
9
|
+
/** Custom base URL. Overrides the environment-based URL when provided. */
|
|
10
|
+
baseUrl?: string;
|
|
11
|
+
/** Maximum number of retry attempts for retryable errors (429, 5xx). Defaults to 3. */
|
|
12
|
+
maxRetries?: number;
|
|
13
|
+
/** Base delay in milliseconds for exponential backoff. Defaults to 500. */
|
|
14
|
+
retryBaseDelay?: number;
|
|
15
|
+
/** Request timeout in milliseconds. Defaults to 30000 (30 seconds). */
|
|
16
|
+
timeout?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Resolved internal configuration used by the HTTP layer.
|
|
20
|
+
*/
|
|
21
|
+
interface ResolvedConfig {
|
|
22
|
+
apiKey: string;
|
|
23
|
+
publicBaseUrl: string;
|
|
24
|
+
internalBaseUrl: string;
|
|
25
|
+
maxRetries: number;
|
|
26
|
+
retryBaseDelay: number;
|
|
27
|
+
timeout: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Generic paginated response wrapper returned by the Markets API.
|
|
31
|
+
*/
|
|
32
|
+
interface BaseResponse<T> {
|
|
33
|
+
data: T[];
|
|
34
|
+
total: number;
|
|
35
|
+
limit: number;
|
|
36
|
+
offset: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Standard request options that can be passed to any SDK method.
|
|
40
|
+
*/
|
|
41
|
+
interface RequestOptions {
|
|
42
|
+
/** AbortSignal for request cancellation. */
|
|
43
|
+
signal?: AbortSignal;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Level enum for market queries.
|
|
47
|
+
*/
|
|
48
|
+
type LevelEnum = 'lga' | 'suburb';
|
|
49
|
+
/**
|
|
50
|
+
* Property type enum for market queries.
|
|
51
|
+
*/
|
|
52
|
+
type PropertyTypeEnum = 'house' | 'unit' | 'townhouse' | 'other';
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Internal HTTP transport used by all domain clients.
|
|
56
|
+
*/
|
|
57
|
+
declare class HttpClient {
|
|
58
|
+
private readonly config;
|
|
59
|
+
constructor(config: ResolvedConfig);
|
|
60
|
+
/**
|
|
61
|
+
* Execute a GET request against the public API base.
|
|
62
|
+
*/
|
|
63
|
+
get<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
64
|
+
/**
|
|
65
|
+
* Execute a POST request against the public API base.
|
|
66
|
+
*/
|
|
67
|
+
post<T>(path: string, body: unknown, options?: RequestOptions): Promise<T>;
|
|
68
|
+
/**
|
|
69
|
+
* Execute a GET request against the internal API base.
|
|
70
|
+
*/
|
|
71
|
+
internalGet<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
72
|
+
/**
|
|
73
|
+
* Execute a POST request against the internal API base.
|
|
74
|
+
*/
|
|
75
|
+
internalPost<T>(path: string, body: unknown, options?: RequestOptions): Promise<T>;
|
|
76
|
+
private request;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
interface AddressRecord {
|
|
80
|
+
address_key?: string | null;
|
|
81
|
+
gnaf_property_pid?: string | null;
|
|
82
|
+
legal_parcel_id?: string | null;
|
|
83
|
+
mb_category?: string | null;
|
|
84
|
+
suburb_loc_pid?: string | null;
|
|
85
|
+
suburb_slug?: string | null;
|
|
86
|
+
lat?: number | null;
|
|
87
|
+
lon?: number | null;
|
|
88
|
+
flood?: boolean | null;
|
|
89
|
+
bushfire?: boolean | null;
|
|
90
|
+
heritage?: boolean | null;
|
|
91
|
+
zoning?: string | null;
|
|
92
|
+
IRSD?: number | null;
|
|
93
|
+
IRSAD?: number | null;
|
|
94
|
+
IER?: number | null;
|
|
95
|
+
IEO?: number | null;
|
|
96
|
+
public_housing?: number | null;
|
|
97
|
+
private_rentals?: number | null;
|
|
98
|
+
address_label?: string | null;
|
|
99
|
+
address_site_name?: string | null;
|
|
100
|
+
building_name?: string | null;
|
|
101
|
+
flat_type?: string | null;
|
|
102
|
+
flat_number?: string | null;
|
|
103
|
+
level_type?: string | null;
|
|
104
|
+
level_number?: string | null;
|
|
105
|
+
number_first?: string | null;
|
|
106
|
+
number_last?: string | null;
|
|
107
|
+
lot_number?: string | null;
|
|
108
|
+
street_name?: string | null;
|
|
109
|
+
street_type?: string | null;
|
|
110
|
+
street_suffix?: string | null;
|
|
111
|
+
locality_name?: string | null;
|
|
112
|
+
state?: string | null;
|
|
113
|
+
postcode?: string | null;
|
|
114
|
+
}
|
|
115
|
+
interface AddressSearchResult extends AddressRecord {
|
|
116
|
+
score: number;
|
|
117
|
+
}
|
|
118
|
+
interface AddressSearchParams extends RequestOptions {
|
|
119
|
+
/** Free-text address query string. */
|
|
120
|
+
q: string;
|
|
121
|
+
/** Minimum matching score threshold (0-1). */
|
|
122
|
+
threshold?: number;
|
|
123
|
+
/** Maximum number of results to return. */
|
|
124
|
+
limit?: number;
|
|
125
|
+
}
|
|
126
|
+
interface AddressSearchResponse {
|
|
127
|
+
results: AddressSearchResult[];
|
|
128
|
+
}
|
|
129
|
+
interface AddressInsightsParams extends RequestOptions {
|
|
130
|
+
/** Free-text address to look up. */
|
|
131
|
+
address?: string;
|
|
132
|
+
/** One or more GNAF address keys. */
|
|
133
|
+
addressKeys?: string[];
|
|
134
|
+
/** Legal parcel identifier. */
|
|
135
|
+
legalParcelId?: string;
|
|
136
|
+
/** Street locality PID. */
|
|
137
|
+
streetLocPid?: string;
|
|
138
|
+
/** Mesh block category 2021. */
|
|
139
|
+
mbCategory2021?: string[];
|
|
140
|
+
}
|
|
141
|
+
interface AddressInsightsResponse {
|
|
142
|
+
results: AddressRecord[];
|
|
143
|
+
}
|
|
144
|
+
interface BatchStandardiseParams extends RequestOptions {
|
|
145
|
+
/** Array of raw address strings to standardise. */
|
|
146
|
+
addresses: string[];
|
|
147
|
+
}
|
|
148
|
+
interface StandardisedAddress {
|
|
149
|
+
input: string;
|
|
150
|
+
matched: boolean;
|
|
151
|
+
result?: AddressRecord | null;
|
|
152
|
+
}
|
|
153
|
+
interface BatchStandardiseResponse {
|
|
154
|
+
results: StandardisedAddress[];
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Client for the Address API domain.
|
|
159
|
+
*
|
|
160
|
+
* ```ts
|
|
161
|
+
* const results = await client.address.search({ q: '100 George St Sydney' });
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
declare class AddressClient {
|
|
165
|
+
private readonly http;
|
|
166
|
+
/** @internal */
|
|
167
|
+
constructor(http: HttpClient);
|
|
168
|
+
/**
|
|
169
|
+
* Search for addresses matching a free-text query.
|
|
170
|
+
*
|
|
171
|
+
* `GET /v1/address/search`
|
|
172
|
+
*/
|
|
173
|
+
search(params: AddressSearchParams): Promise<AddressSearchResponse>;
|
|
174
|
+
/**
|
|
175
|
+
* Retrieve detailed insights for one or more addresses.
|
|
176
|
+
*
|
|
177
|
+
* `GET /v1/address/insights`
|
|
178
|
+
*/
|
|
179
|
+
insights(params: AddressInsightsParams): Promise<AddressInsightsResponse>;
|
|
180
|
+
/**
|
|
181
|
+
* Standardise a batch of raw address strings into structured records.
|
|
182
|
+
*
|
|
183
|
+
* `POST /v1/address/standardise`
|
|
184
|
+
*/
|
|
185
|
+
standardise(params: BatchStandardiseParams): Promise<BatchStandardiseResponse>;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
interface SoldPropertyRecord {
|
|
189
|
+
address_key?: string | null;
|
|
190
|
+
property_type?: string | null;
|
|
191
|
+
street_address?: string | null;
|
|
192
|
+
suburb?: string | null;
|
|
193
|
+
state?: string | null;
|
|
194
|
+
postcode?: string | null;
|
|
195
|
+
lat?: number | null;
|
|
196
|
+
lon?: number | null;
|
|
197
|
+
sold_date?: string | null;
|
|
198
|
+
sold_price?: number | null;
|
|
199
|
+
bedrooms?: number | null;
|
|
200
|
+
bathrooms?: number | null;
|
|
201
|
+
car_spaces?: number | null;
|
|
202
|
+
land_area?: number | null;
|
|
203
|
+
}
|
|
204
|
+
interface SoldSearchParams extends RequestOptions {
|
|
205
|
+
/** Free-text address for the search centre. */
|
|
206
|
+
address?: string;
|
|
207
|
+
/** GNAF address key. */
|
|
208
|
+
addressKey?: string;
|
|
209
|
+
/** Latitude for geographic search. */
|
|
210
|
+
lat?: number;
|
|
211
|
+
/** Longitude for geographic search. */
|
|
212
|
+
lon?: number;
|
|
213
|
+
/** Search radius in metres. */
|
|
214
|
+
radius?: number;
|
|
215
|
+
/** Proximity label (e.g. "nearby"). */
|
|
216
|
+
proximity?: string;
|
|
217
|
+
/** Filter by property type. */
|
|
218
|
+
propertyType?: string;
|
|
219
|
+
/** Minimum sale price filter. */
|
|
220
|
+
saleValueMin?: number;
|
|
221
|
+
/** Maximum sale price filter. */
|
|
222
|
+
saleValueMax?: number;
|
|
223
|
+
/** Include sales with unknown value. */
|
|
224
|
+
includeSaleValueUnknown?: boolean;
|
|
225
|
+
/** Minimum bedrooms filter. */
|
|
226
|
+
bedroomsMin?: number;
|
|
227
|
+
/** Maximum bedrooms filter. */
|
|
228
|
+
bedroomsMax?: number;
|
|
229
|
+
/** Minimum bathrooms filter. */
|
|
230
|
+
bathroomsMin?: number;
|
|
231
|
+
/** Maximum bathrooms filter. */
|
|
232
|
+
bathroomsMax?: number;
|
|
233
|
+
/** Minimum car spaces filter. */
|
|
234
|
+
carSpacesMin?: number;
|
|
235
|
+
/** Maximum car spaces filter. */
|
|
236
|
+
carSpacesMax?: number;
|
|
237
|
+
/** Earliest sale date (YYYY-MM-DD). */
|
|
238
|
+
startDate?: string;
|
|
239
|
+
/** Latest sale date (YYYY-MM-DD). */
|
|
240
|
+
endDate?: string;
|
|
241
|
+
/** Minimum land area in sqm. */
|
|
242
|
+
landAreaMin?: number;
|
|
243
|
+
/** Maximum land area in sqm. */
|
|
244
|
+
landAreaMax?: number;
|
|
245
|
+
}
|
|
246
|
+
interface SoldPropertiesResponse {
|
|
247
|
+
results: SoldPropertyRecord[];
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Client for the Property API domain.
|
|
252
|
+
*
|
|
253
|
+
* ```ts
|
|
254
|
+
* const sold = await client.property.soldSearch({ address: '100 George St Sydney', radius: 2000 });
|
|
255
|
+
* ```
|
|
256
|
+
*/
|
|
257
|
+
declare class PropertyClient {
|
|
258
|
+
private readonly http;
|
|
259
|
+
/** @internal */
|
|
260
|
+
constructor(http: HttpClient);
|
|
261
|
+
/**
|
|
262
|
+
* Search for recently sold properties near a location.
|
|
263
|
+
*
|
|
264
|
+
* `GET /v1/property/sold/search`
|
|
265
|
+
*/
|
|
266
|
+
soldSearch(params: SoldSearchParams): Promise<SoldPropertiesResponse>;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
interface MarketSnapshot {
|
|
270
|
+
area_id?: string | null;
|
|
271
|
+
composite_key?: string | null;
|
|
272
|
+
state_name?: string | null;
|
|
273
|
+
region_reference?: string | null;
|
|
274
|
+
suburb?: string | null;
|
|
275
|
+
postcode?: string | null;
|
|
276
|
+
council_area_reference?: string | null;
|
|
277
|
+
council_area?: string | null;
|
|
278
|
+
period_end?: string | null;
|
|
279
|
+
property_type?: string | null;
|
|
280
|
+
bedrooms?: string | null;
|
|
281
|
+
typical_price?: number | null;
|
|
282
|
+
sales?: number | null;
|
|
283
|
+
annual_sales_volume?: number | null;
|
|
284
|
+
sales_ratio?: number | null;
|
|
285
|
+
clearance_rate?: number | null;
|
|
286
|
+
dom?: number | null;
|
|
287
|
+
discounting?: number | null;
|
|
288
|
+
years_to_own?: number | null;
|
|
289
|
+
som_percent?: number | null;
|
|
290
|
+
inventory?: number | null;
|
|
291
|
+
hold_period?: number | null;
|
|
292
|
+
rent?: number | null;
|
|
293
|
+
rentals?: number | null;
|
|
294
|
+
annual_rental_volume?: number | null;
|
|
295
|
+
rentals_ratio?: number | null;
|
|
296
|
+
vacancy_rate?: number | null;
|
|
297
|
+
yield_value?: number | null;
|
|
298
|
+
one_y_price_growth?: number | null;
|
|
299
|
+
three_y_price_growth?: number | null;
|
|
300
|
+
five_y_price_growth?: number | null;
|
|
301
|
+
ten_y_price_growth?: number | null;
|
|
302
|
+
one_m_rent_growth?: number | null;
|
|
303
|
+
one_q_rent_growth?: number | null;
|
|
304
|
+
six_m_rent_growth?: number | null;
|
|
305
|
+
one_y_rent_growth?: number | null;
|
|
306
|
+
three_y_rent_growth?: number | null;
|
|
307
|
+
five_y_rent_growth?: number | null;
|
|
308
|
+
ten_y_rent_growth?: number | null;
|
|
309
|
+
yield_1y_growth?: number | null;
|
|
310
|
+
yield_3y_growth?: number | null;
|
|
311
|
+
yield_5y_growth?: number | null;
|
|
312
|
+
yield_10y_growth?: number | null;
|
|
313
|
+
projected_annual_capital_growth_low?: number | null;
|
|
314
|
+
projected_annual_capital_growth_high?: number | null;
|
|
315
|
+
projected_annual_rent_increase?: number | null;
|
|
316
|
+
projected_annual_roi_low?: number | null;
|
|
317
|
+
projected_annual_roi_high?: number | null;
|
|
318
|
+
estimated_dwellings?: number | null;
|
|
319
|
+
adult_population?: number | null;
|
|
320
|
+
irsad?: number | null;
|
|
321
|
+
building_approvals_estimated?: number | null;
|
|
322
|
+
ba_ratio?: number | null;
|
|
323
|
+
school_rank?: number | null;
|
|
324
|
+
non_res_ba_per_capita_value?: number | null;
|
|
325
|
+
confidence?: string | null;
|
|
326
|
+
volatility_index?: number | null;
|
|
327
|
+
growth_rate_cycle?: number | null;
|
|
328
|
+
ro_ratio?: number | null;
|
|
329
|
+
uh_ratio?: number | null;
|
|
330
|
+
uhv_ratio?: number | null;
|
|
331
|
+
buy_si?: number | null;
|
|
332
|
+
rent_si?: number | null;
|
|
333
|
+
rcs_lower_risk?: number | null;
|
|
334
|
+
rcs_cashflow?: number | null;
|
|
335
|
+
rcs_capital_growth?: number | null;
|
|
336
|
+
rcs_overall?: number | null;
|
|
337
|
+
hapi_score?: number | null;
|
|
338
|
+
gpo_dist?: number | null;
|
|
339
|
+
ediv_ind?: number | null;
|
|
340
|
+
hrp_flood?: number | null;
|
|
341
|
+
hrp_fire?: number | null;
|
|
342
|
+
madi?: number | null;
|
|
343
|
+
gpd_3?: number | null;
|
|
344
|
+
gpd_5?: number | null;
|
|
345
|
+
gpd_10?: number | null;
|
|
346
|
+
gsp_3?: number | null;
|
|
347
|
+
gsp_5?: number | null;
|
|
348
|
+
gsp_10?: number | null;
|
|
349
|
+
min_grc?: number | null;
|
|
350
|
+
grc_price_index?: number | null;
|
|
351
|
+
lt_som_perc?: number | null;
|
|
352
|
+
lt_inventory?: number | null;
|
|
353
|
+
lt_dom?: number | null;
|
|
354
|
+
lt_vacancy_rate?: number | null;
|
|
355
|
+
lt_clearance_rate?: number | null;
|
|
356
|
+
lt_hold_period?: number | null;
|
|
357
|
+
lt_buy_si?: number | null;
|
|
358
|
+
lt_rent_si?: number | null;
|
|
359
|
+
st_som_perc?: number | null;
|
|
360
|
+
st_inventory?: number | null;
|
|
361
|
+
st_dom?: number | null;
|
|
362
|
+
st_vacancy_rate?: number | null;
|
|
363
|
+
st_clearance_rate?: number | null;
|
|
364
|
+
st_hold_period?: number | null;
|
|
365
|
+
st_buy_si?: number | null;
|
|
366
|
+
st_rent_si?: number | null;
|
|
367
|
+
area_link?: string | null;
|
|
368
|
+
}
|
|
369
|
+
interface PriceHistoryOut {
|
|
370
|
+
area_id: string;
|
|
371
|
+
period_end: string;
|
|
372
|
+
property_type: string;
|
|
373
|
+
typical_price: number | null;
|
|
374
|
+
sales: number | null;
|
|
375
|
+
typical_price_conf_low: number | null;
|
|
376
|
+
typical_price_conf_high: number | null;
|
|
377
|
+
}
|
|
378
|
+
interface RentHistoryOut {
|
|
379
|
+
area_id: string;
|
|
380
|
+
period_end: string;
|
|
381
|
+
property_type: string;
|
|
382
|
+
median_rent: number | null;
|
|
383
|
+
rentals: number | null;
|
|
384
|
+
median_rent_conf_low: number | null;
|
|
385
|
+
median_rent_conf_high: number | null;
|
|
386
|
+
}
|
|
387
|
+
interface YieldHistoryOut {
|
|
388
|
+
area_id: string;
|
|
389
|
+
period_end: string;
|
|
390
|
+
property_type: string;
|
|
391
|
+
yield: number | null;
|
|
392
|
+
}
|
|
393
|
+
interface FSDMonthlyOut {
|
|
394
|
+
area_id: string;
|
|
395
|
+
period_end: string;
|
|
396
|
+
property_type: string;
|
|
397
|
+
inventory: number | null;
|
|
398
|
+
vacancies: number | null;
|
|
399
|
+
clearance_rate: number | null;
|
|
400
|
+
}
|
|
401
|
+
interface FSDQuarterlyOut {
|
|
402
|
+
area_id: string;
|
|
403
|
+
period_end: string;
|
|
404
|
+
property_type: string;
|
|
405
|
+
buy_si: number | null;
|
|
406
|
+
rent_si: number | null;
|
|
407
|
+
}
|
|
408
|
+
interface FSDYearlyOut {
|
|
409
|
+
area_id: string;
|
|
410
|
+
period_end: string;
|
|
411
|
+
property_type: string;
|
|
412
|
+
hold_period: number | null;
|
|
413
|
+
}
|
|
414
|
+
interface EssentialsOut {
|
|
415
|
+
area_id: string;
|
|
416
|
+
period_end: string;
|
|
417
|
+
property_type: string;
|
|
418
|
+
typical_price: number | null;
|
|
419
|
+
rent: number | null;
|
|
420
|
+
sales: number | null;
|
|
421
|
+
rentals: number | null;
|
|
422
|
+
yield?: number | null;
|
|
423
|
+
}
|
|
424
|
+
interface GRCOut {
|
|
425
|
+
area_id: string;
|
|
426
|
+
period_end: string;
|
|
427
|
+
property_type: string;
|
|
428
|
+
price_chg: number | null;
|
|
429
|
+
rent_chg: number | null;
|
|
430
|
+
yield_chg: number | null;
|
|
431
|
+
}
|
|
432
|
+
interface DemandProfileOut {
|
|
433
|
+
area_id: string;
|
|
434
|
+
period_end: string;
|
|
435
|
+
dwelling_type: string;
|
|
436
|
+
bedrooms: string;
|
|
437
|
+
sales: number | null;
|
|
438
|
+
}
|
|
439
|
+
interface LogicNode {
|
|
440
|
+
field?: string | null;
|
|
441
|
+
eq?: string | number | boolean | null;
|
|
442
|
+
ne?: string | number | boolean | null;
|
|
443
|
+
gt?: number | null;
|
|
444
|
+
gte?: number | null;
|
|
445
|
+
lt?: number | null;
|
|
446
|
+
lte?: number | null;
|
|
447
|
+
in?: (string | number)[] | null;
|
|
448
|
+
nin?: (string | number)[] | null;
|
|
449
|
+
and?: LogicNode[] | null;
|
|
450
|
+
or?: LogicNode[] | null;
|
|
451
|
+
not?: LogicNode | null;
|
|
452
|
+
}
|
|
453
|
+
interface AdvancedSearchBody {
|
|
454
|
+
level: LevelEnum;
|
|
455
|
+
mode: string;
|
|
456
|
+
property_types: PropertyTypeEnum[];
|
|
457
|
+
area_ids?: string[] | null;
|
|
458
|
+
typical_price_min?: number | null;
|
|
459
|
+
typical_price_max?: number | null;
|
|
460
|
+
logic?: LogicNode | null;
|
|
461
|
+
limit?: number;
|
|
462
|
+
offset?: number;
|
|
463
|
+
}
|
|
464
|
+
interface SnapshotsParams extends RequestOptions {
|
|
465
|
+
level: LevelEnum;
|
|
466
|
+
propertyType: PropertyTypeEnum[];
|
|
467
|
+
areaId?: string[];
|
|
468
|
+
typicalPriceMin?: number;
|
|
469
|
+
typicalPriceMax?: number;
|
|
470
|
+
confidence?: string;
|
|
471
|
+
bedrooms?: string | string[];
|
|
472
|
+
limit?: number;
|
|
473
|
+
offset?: number;
|
|
474
|
+
}
|
|
475
|
+
interface MarketQueryParams extends RequestOptions {
|
|
476
|
+
body: AdvancedSearchBody;
|
|
477
|
+
}
|
|
478
|
+
interface TrendsParams extends RequestOptions {
|
|
479
|
+
level: LevelEnum;
|
|
480
|
+
areaId: string[];
|
|
481
|
+
propertyType?: PropertyTypeEnum[];
|
|
482
|
+
periodEndMin?: string;
|
|
483
|
+
periodEndMax?: string;
|
|
484
|
+
bedrooms?: string | string[];
|
|
485
|
+
limit?: number;
|
|
486
|
+
offset?: number;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
type SnapshotsResponse = BaseResponse<MarketSnapshot>;
|
|
490
|
+
type MarketQueryResponse = BaseResponse<MarketSnapshot>;
|
|
491
|
+
type PriceResponse = BaseResponse<PriceHistoryOut>;
|
|
492
|
+
type RentResponse = BaseResponse<RentHistoryOut>;
|
|
493
|
+
type YieldResponse = BaseResponse<YieldHistoryOut>;
|
|
494
|
+
type SupplyDemandResponse = BaseResponse<FSDMonthlyOut>;
|
|
495
|
+
type SearchIndexResponse = BaseResponse<FSDQuarterlyOut>;
|
|
496
|
+
type HoldPeriodResponse = BaseResponse<FSDYearlyOut>;
|
|
497
|
+
type PerformanceResponse = BaseResponse<EssentialsOut>;
|
|
498
|
+
type GrowthRatesResponse = BaseResponse<GRCOut>;
|
|
499
|
+
type DemandProfileResponse = BaseResponse<DemandProfileOut>;
|
|
500
|
+
|
|
501
|
+
/**
|
|
502
|
+
* Client for the Markets Trends API domain.
|
|
503
|
+
*
|
|
504
|
+
* Each method queries a specific time-series metric:
|
|
505
|
+
*
|
|
506
|
+
* ```ts
|
|
507
|
+
* const prices = await client.markets.trends.price({
|
|
508
|
+
* level: 'suburb',
|
|
509
|
+
* areaId: ['SAL10001'],
|
|
510
|
+
* propertyType: ['house'],
|
|
511
|
+
* });
|
|
512
|
+
* ```
|
|
513
|
+
*/
|
|
514
|
+
declare class TrendsClient {
|
|
515
|
+
private readonly http;
|
|
516
|
+
/** @internal */
|
|
517
|
+
constructor(http: HttpClient);
|
|
518
|
+
/**
|
|
519
|
+
* Price history trends.
|
|
520
|
+
*
|
|
521
|
+
* `GET /internal-api/v1/markets/trends/price`
|
|
522
|
+
*/
|
|
523
|
+
price(params: TrendsParams): Promise<PriceResponse>;
|
|
524
|
+
/**
|
|
525
|
+
* Rent history trends.
|
|
526
|
+
*
|
|
527
|
+
* `GET /internal-api/v1/markets/trends/rent`
|
|
528
|
+
*/
|
|
529
|
+
rent(params: TrendsParams): Promise<RentResponse>;
|
|
530
|
+
/**
|
|
531
|
+
* Yield history trends.
|
|
532
|
+
*
|
|
533
|
+
* `GET /internal-api/v1/markets/trends/yield`
|
|
534
|
+
*/
|
|
535
|
+
yieldHistory(params: TrendsParams): Promise<YieldResponse>;
|
|
536
|
+
/**
|
|
537
|
+
* Supply and demand (monthly frequency).
|
|
538
|
+
*
|
|
539
|
+
* `GET /internal-api/v1/markets/trends/supply-demand`
|
|
540
|
+
*/
|
|
541
|
+
supplyDemand(params: TrendsParams): Promise<SupplyDemandResponse>;
|
|
542
|
+
/**
|
|
543
|
+
* Search interest index (quarterly frequency).
|
|
544
|
+
*
|
|
545
|
+
* `GET /internal-api/v1/markets/trends/search-index`
|
|
546
|
+
*/
|
|
547
|
+
searchIndex(params: TrendsParams): Promise<SearchIndexResponse>;
|
|
548
|
+
/**
|
|
549
|
+
* Hold period (yearly frequency).
|
|
550
|
+
*
|
|
551
|
+
* `GET /internal-api/v1/markets/trends/hold-period`
|
|
552
|
+
*/
|
|
553
|
+
holdPeriod(params: TrendsParams): Promise<HoldPeriodResponse>;
|
|
554
|
+
/**
|
|
555
|
+
* Performance essentials.
|
|
556
|
+
*
|
|
557
|
+
* `GET /internal-api/v1/markets/trends/performance`
|
|
558
|
+
*/
|
|
559
|
+
performance(params: TrendsParams): Promise<PerformanceResponse>;
|
|
560
|
+
/**
|
|
561
|
+
* Growth rate cycle.
|
|
562
|
+
*
|
|
563
|
+
* `GET /internal-api/v1/markets/trends/growth-rates`
|
|
564
|
+
*/
|
|
565
|
+
growthRates(params: TrendsParams): Promise<GrowthRatesResponse>;
|
|
566
|
+
/**
|
|
567
|
+
* Demand profile breakdown.
|
|
568
|
+
*
|
|
569
|
+
* `GET /internal-api/v1/markets/trends/demand-profile`
|
|
570
|
+
*/
|
|
571
|
+
demandProfile(params: TrendsParams): Promise<DemandProfileResponse>;
|
|
572
|
+
private trend;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* Client for the Markets API domain.
|
|
577
|
+
*
|
|
578
|
+
* ```ts
|
|
579
|
+
* const snapshots = await client.markets.snapshots({
|
|
580
|
+
* level: 'suburb',
|
|
581
|
+
* propertyType: ['house'],
|
|
582
|
+
* });
|
|
583
|
+
*
|
|
584
|
+
* const prices = await client.markets.trends.price({
|
|
585
|
+
* level: 'suburb',
|
|
586
|
+
* areaId: ['SAL10001'],
|
|
587
|
+
* });
|
|
588
|
+
* ```
|
|
589
|
+
*/
|
|
590
|
+
declare class MarketsClient {
|
|
591
|
+
private readonly http;
|
|
592
|
+
/** Sub-client for time-series trend endpoints. */
|
|
593
|
+
readonly trends: TrendsClient;
|
|
594
|
+
/** @internal */
|
|
595
|
+
constructor(http: HttpClient);
|
|
596
|
+
/**
|
|
597
|
+
* Retrieve market snapshot data with optional filters.
|
|
598
|
+
*
|
|
599
|
+
* `GET /internal-api/v1/markets/snapshots`
|
|
600
|
+
*/
|
|
601
|
+
snapshots(params: SnapshotsParams): Promise<SnapshotsResponse>;
|
|
602
|
+
/**
|
|
603
|
+
* Advanced market query with logical filter expressions.
|
|
604
|
+
*
|
|
605
|
+
* `POST /internal-api/v1/markets/query`
|
|
606
|
+
*/
|
|
607
|
+
query(body: AdvancedSearchBody, options?: RequestOptions): Promise<MarketQueryResponse>;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* Top-level client for the HtAG Location Intelligence APIs.
|
|
612
|
+
*
|
|
613
|
+
* ```ts
|
|
614
|
+
* import { HtAgApiClient } from '@htag/sdk';
|
|
615
|
+
*
|
|
616
|
+
* const client = new HtAgApiClient({
|
|
617
|
+
* apiKey: process.env.HTAG_API_KEY!,
|
|
618
|
+
* environment: 'prod',
|
|
619
|
+
* });
|
|
620
|
+
*
|
|
621
|
+
* const results = await client.address.search({ q: '100 George St Sydney' });
|
|
622
|
+
* ```
|
|
623
|
+
*/
|
|
624
|
+
declare class HtAgApiClient {
|
|
625
|
+
/** Address search, insights and standardisation. */
|
|
626
|
+
readonly address: AddressClient;
|
|
627
|
+
/** Sold property search. */
|
|
628
|
+
readonly property: PropertyClient;
|
|
629
|
+
/** Market snapshots, advanced queries and time-series trends. */
|
|
630
|
+
readonly markets: MarketsClient;
|
|
631
|
+
constructor(options: HtAgClientOptions);
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* Base error class for all HtAG SDK errors.
|
|
636
|
+
*/
|
|
637
|
+
declare class HtAgError extends Error {
|
|
638
|
+
/** HTTP status code, if available. */
|
|
639
|
+
readonly status: number | undefined;
|
|
640
|
+
/** Raw response body, if available. */
|
|
641
|
+
readonly body: unknown;
|
|
642
|
+
/** The request URL that caused the error. */
|
|
643
|
+
readonly url: string | undefined;
|
|
644
|
+
constructor(message: string, options?: {
|
|
645
|
+
status?: number;
|
|
646
|
+
body?: unknown;
|
|
647
|
+
url?: string;
|
|
648
|
+
cause?: unknown;
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* Thrown when the server returns 401 or 403.
|
|
653
|
+
*/
|
|
654
|
+
declare class AuthenticationError extends HtAgError {
|
|
655
|
+
constructor(options: {
|
|
656
|
+
status: number;
|
|
657
|
+
body: unknown;
|
|
658
|
+
url: string;
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* Thrown when the server returns 429 after exhausting all retries.
|
|
663
|
+
*/
|
|
664
|
+
declare class RateLimitError extends HtAgError {
|
|
665
|
+
constructor(options: {
|
|
666
|
+
body: unknown;
|
|
667
|
+
url: string;
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* Thrown when the server returns 400 or 422.
|
|
672
|
+
*/
|
|
673
|
+
declare class ValidationError extends HtAgError {
|
|
674
|
+
constructor(options: {
|
|
675
|
+
status: number;
|
|
676
|
+
body: unknown;
|
|
677
|
+
url: string;
|
|
678
|
+
});
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* Thrown when the server returns a 5xx status after exhausting all retries.
|
|
682
|
+
*/
|
|
683
|
+
declare class ServerError extends HtAgError {
|
|
684
|
+
constructor(options: {
|
|
685
|
+
status: number;
|
|
686
|
+
body: unknown;
|
|
687
|
+
url: string;
|
|
688
|
+
});
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
export { AddressClient, type AddressInsightsParams, type AddressInsightsResponse, type AddressRecord, type AddressSearchParams, type AddressSearchResponse, type AddressSearchResult, type AdvancedSearchBody, AuthenticationError, type BaseResponse, type BatchStandardiseParams, type BatchStandardiseResponse, type DemandProfileOut, type DemandProfileResponse, type EssentialsOut, type FSDMonthlyOut, type FSDQuarterlyOut, type FSDYearlyOut, type GRCOut, type GrowthRatesResponse, type HoldPeriodResponse, HtAgApiClient, type HtAgClientOptions, HtAgError, type LevelEnum, type LogicNode, type MarketQueryParams, type MarketQueryResponse, type MarketSnapshot, MarketsClient, type PerformanceResponse, type PriceHistoryOut, type PriceResponse, PropertyClient, type PropertyTypeEnum, RateLimitError, type RentHistoryOut, type RentResponse, type RequestOptions, type ResolvedConfig, type SearchIndexResponse, ServerError, type SnapshotsParams, type SnapshotsResponse, type SoldPropertiesResponse, type SoldPropertyRecord, type SoldSearchParams, type StandardisedAddress, type SupplyDemandResponse, TrendsClient, type TrendsParams, ValidationError, type YieldHistoryOut, type YieldResponse };
|