@kite-sa/sdk 0.0.0-stage → 0.5.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/CHANGELOG.md +47 -0
- package/LICENSE +21 -0
- package/README.md +60 -2
- package/dist/generated.d.ts +1311 -0
- package/dist/generated.js +327 -0
- package/dist/index.d.ts +111 -0
- package/dist/index.js +146 -0
- package/dist/openapi-zod/client-config.d.ts +64 -0
- package/dist/openapi-zod/client-config.js +13 -0
- package/dist/openapi-zod/client.d.ts +1728 -0
- package/dist/openapi-zod/client.js +1247 -0
- package/dist/openapi-zod/index.d.ts +3 -0
- package/dist/openapi-zod/index.js +4 -0
- package/dist/openapi-zod/models.d.ts +241 -0
- package/dist/openapi-zod/models.js +2 -0
- package/dist/openapi.d.ts +593 -0
- package/dist/openapi.js +1 -0
- package/package.json +47 -4
|
@@ -0,0 +1,1311 @@
|
|
|
1
|
+
import type { operations } from "./openapi.js";
|
|
2
|
+
type Op = keyof operations;
|
|
3
|
+
type QueryOf<K extends Op> = operations[K]["parameters"] extends {
|
|
4
|
+
query?: infer Q;
|
|
5
|
+
} ? NonNullable<Q> : never;
|
|
6
|
+
type BodyOf<K extends Op> = operations[K] extends {
|
|
7
|
+
requestBody: {
|
|
8
|
+
content: {
|
|
9
|
+
"application/json": infer B;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
} ? B : never;
|
|
13
|
+
type HeaderOf<K extends Op> = operations[K]["parameters"] extends {
|
|
14
|
+
header?: infer H;
|
|
15
|
+
} ? NonNullable<H> : never;
|
|
16
|
+
type Query = Record<string, string | number | boolean | readonly (string | number)[] | undefined>;
|
|
17
|
+
type Headers = Record<string, string | undefined>;
|
|
18
|
+
/** The low-level caller `Kite` hands to the generated namespaces. */
|
|
19
|
+
export type Request = <T>(method: string, path: string, options?: {
|
|
20
|
+
query?: Query;
|
|
21
|
+
body?: unknown;
|
|
22
|
+
headers?: Headers;
|
|
23
|
+
}) => Promise<T>;
|
|
24
|
+
/** Every endpoint in the spec, namespaced by its operationId. */
|
|
25
|
+
export declare function createEndpoints(request: Request): {
|
|
26
|
+
readonly analytics: {
|
|
27
|
+
/**
|
|
28
|
+
* Find below-market listings. Residential listings asking noticeably less than
|
|
29
|
+
* similar listings nearby, biggest gap first. Each listing is compared with
|
|
30
|
+
* Darak's published nearby asking-price comparison: the same property type and
|
|
31
|
+
* bedroom count, a similar area, within a calibrated radius and look-back
|
|
32
|
+
* (disclosed per listing in `comparison`), one observation per distinct unit,
|
|
33
|
+
* and the subject's own duplicates excluded.
|
|
34
|
+
*/
|
|
35
|
+
readonly deals: (params: QueryOf<"analytics.deals">) => Promise<{
|
|
36
|
+
data: {
|
|
37
|
+
listing: import("./openapi-zod/models.js").Listing;
|
|
38
|
+
comparison: {
|
|
39
|
+
median_price_sar: unknown;
|
|
40
|
+
p25_price_sar: unknown;
|
|
41
|
+
p75_price_sar: unknown;
|
|
42
|
+
percent_vs_median: number | null;
|
|
43
|
+
sample_size: number;
|
|
44
|
+
radius_m: unknown;
|
|
45
|
+
look_back_days: unknown;
|
|
46
|
+
price_source: string;
|
|
47
|
+
};
|
|
48
|
+
}[];
|
|
49
|
+
pagination: import("./openapi-zod/models.js").Pagination;
|
|
50
|
+
}>;
|
|
51
|
+
/**
|
|
52
|
+
* Get comparable listings. Active listings similar to this one, nearest first,
|
|
53
|
+
* with how each one differs. A comparable has the same city, listing type and
|
|
54
|
+
* property type, is within about 5 km, and has an area between 2/3 and 1.5 times
|
|
55
|
+
* this listing's (the comparison-approach caliper).
|
|
56
|
+
*/
|
|
57
|
+
readonly listingComparables: (id: string | number, params?: QueryOf<"analytics.listing_comparables">) => Promise<{
|
|
58
|
+
data: {
|
|
59
|
+
listing_id: number;
|
|
60
|
+
price_basis: string;
|
|
61
|
+
price_source: string;
|
|
62
|
+
unavailable_reason: unknown;
|
|
63
|
+
criteria: {
|
|
64
|
+
max_distance_m: number;
|
|
65
|
+
area_range_sqm: unknown;
|
|
66
|
+
same_bedrooms: boolean;
|
|
67
|
+
};
|
|
68
|
+
summary: {
|
|
69
|
+
sample_size: number;
|
|
70
|
+
median_price_sar: unknown;
|
|
71
|
+
listing_price_sar: unknown;
|
|
72
|
+
diff_from_median_pct: number | null;
|
|
73
|
+
};
|
|
74
|
+
comparables: {
|
|
75
|
+
listing: import("./openapi-zod/models.js").Listing;
|
|
76
|
+
similarity: {
|
|
77
|
+
distance_m: unknown;
|
|
78
|
+
area_diff_pct: number | null;
|
|
79
|
+
price_diff_pct: number | null;
|
|
80
|
+
};
|
|
81
|
+
}[];
|
|
82
|
+
};
|
|
83
|
+
}>;
|
|
84
|
+
/**
|
|
85
|
+
* Get a listing's market position. Where a listing's price sits in its market:
|
|
86
|
+
* percentile, quartiles and difference from the median, against like-for-like
|
|
87
|
+
* listings in its neighborhood and in its city. The cohort is listings with the
|
|
88
|
+
* same listing type, category and property type, and for residential listings
|
|
89
|
+
* the same bedroom count.
|
|
90
|
+
*/
|
|
91
|
+
readonly listingMarketPosition: (id: string | number) => Promise<{
|
|
92
|
+
data: {
|
|
93
|
+
listing_id: number;
|
|
94
|
+
price_basis: string;
|
|
95
|
+
price_source: string;
|
|
96
|
+
price_sar: unknown;
|
|
97
|
+
price_per_sqm_sar: unknown;
|
|
98
|
+
cohort: {
|
|
99
|
+
city: string;
|
|
100
|
+
listing_type: unknown;
|
|
101
|
+
listing_category: unknown;
|
|
102
|
+
property_type: string | null;
|
|
103
|
+
neighborhood_ids: unknown;
|
|
104
|
+
beds: unknown;
|
|
105
|
+
};
|
|
106
|
+
basis: unknown;
|
|
107
|
+
price_percentile: unknown;
|
|
108
|
+
diff_from_median_pct: number | null;
|
|
109
|
+
neighborhood: unknown;
|
|
110
|
+
city: unknown;
|
|
111
|
+
listing_in_sample: boolean;
|
|
112
|
+
window: {
|
|
113
|
+
updated_within_days: number;
|
|
114
|
+
from: string;
|
|
115
|
+
to: string;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
}>;
|
|
119
|
+
/**
|
|
120
|
+
* Get a listing's nearby asking-price band. The 25th percentile, median and 75th
|
|
121
|
+
* percentile of asking prices for comparable units near this listing, in SAR and
|
|
122
|
+
* per m², where this listing's price sits against them, and the cohort and
|
|
123
|
+
* stability behind the numbers.
|
|
124
|
+
*/
|
|
125
|
+
readonly listingPriceBand: (id: string | number) => Promise<{
|
|
126
|
+
data: {
|
|
127
|
+
listing_id: number;
|
|
128
|
+
status: string;
|
|
129
|
+
price_basis: string;
|
|
130
|
+
price_source: string;
|
|
131
|
+
price_sar: unknown;
|
|
132
|
+
price_per_sqm_sar: unknown;
|
|
133
|
+
band: unknown;
|
|
134
|
+
position: unknown;
|
|
135
|
+
stability: unknown;
|
|
136
|
+
cohort: unknown;
|
|
137
|
+
methodology: unknown;
|
|
138
|
+
};
|
|
139
|
+
}>;
|
|
140
|
+
/**
|
|
141
|
+
* Compare neighborhoods. Side-by-side profile of 2 to 5 neighborhoods: price
|
|
142
|
+
* quartiles, area, price per m², amenity shares, bedroom and property-type mix,
|
|
143
|
+
* and for rentals the gross yield against the same cohort's sale prices.
|
|
144
|
+
*/
|
|
145
|
+
readonly neighborhoodsCompare: (params: QueryOf<"analytics.neighborhoods_compare">) => Promise<{
|
|
146
|
+
data: {
|
|
147
|
+
filters: {
|
|
148
|
+
city: string;
|
|
149
|
+
listing_type: unknown;
|
|
150
|
+
listing_category: unknown;
|
|
151
|
+
property_type: string | null;
|
|
152
|
+
neighborhood_ids: unknown;
|
|
153
|
+
beds: unknown;
|
|
154
|
+
};
|
|
155
|
+
price_basis: string;
|
|
156
|
+
price_source: string;
|
|
157
|
+
neighborhoods: {
|
|
158
|
+
neighborhood_id: number;
|
|
159
|
+
name_en: string;
|
|
160
|
+
name_ar: string;
|
|
161
|
+
sample_size: number;
|
|
162
|
+
median_price_sar: unknown;
|
|
163
|
+
p25_price_sar: unknown;
|
|
164
|
+
p75_price_sar: unknown;
|
|
165
|
+
median_area_sqm: unknown;
|
|
166
|
+
median_price_per_sqm_sar: unknown;
|
|
167
|
+
amenity_share_pct: {
|
|
168
|
+
ac: number | null;
|
|
169
|
+
parking: number | null;
|
|
170
|
+
pool: number | null;
|
|
171
|
+
lift: number | null;
|
|
172
|
+
furnished: number | null;
|
|
173
|
+
};
|
|
174
|
+
bedrooms_mix: {
|
|
175
|
+
"0": number;
|
|
176
|
+
"1": number;
|
|
177
|
+
"2": number;
|
|
178
|
+
"3": number;
|
|
179
|
+
"4": number;
|
|
180
|
+
"5_plus": number;
|
|
181
|
+
};
|
|
182
|
+
property_type_mix: Record<string, number>;
|
|
183
|
+
median_sale_price_sar?: unknown;
|
|
184
|
+
sale_sample_size?: number;
|
|
185
|
+
gross_yield_pct?: number | null;
|
|
186
|
+
}[];
|
|
187
|
+
window: {
|
|
188
|
+
updated_within_days: number;
|
|
189
|
+
from: string;
|
|
190
|
+
to: string;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
}>;
|
|
194
|
+
/**
|
|
195
|
+
* Get gross rental yield. Gross rental yield (median yearly asking rent ÷ median
|
|
196
|
+
* asking sale price) for one property type, over the whole city (or the
|
|
197
|
+
* requested neighborhoods) and per neighborhood, highest yield first. Rent and
|
|
198
|
+
* sale medians come from the same cohort (property type, and bedrooms if given)
|
|
199
|
+
* in the same area.
|
|
200
|
+
*/
|
|
201
|
+
readonly rentalYield: (params: QueryOf<"analytics.rental_yield">) => Promise<{
|
|
202
|
+
data: {
|
|
203
|
+
filters: {
|
|
204
|
+
city: string;
|
|
205
|
+
listing_type: unknown;
|
|
206
|
+
listing_category: unknown;
|
|
207
|
+
property_type: string | null;
|
|
208
|
+
neighborhood_ids: unknown;
|
|
209
|
+
beds: unknown;
|
|
210
|
+
};
|
|
211
|
+
overall: {
|
|
212
|
+
median_yearly_rent_sar: unknown;
|
|
213
|
+
median_sale_price_sar: unknown;
|
|
214
|
+
gross_yield_pct: number | null;
|
|
215
|
+
rent_sample_size: number;
|
|
216
|
+
sale_sample_size: number;
|
|
217
|
+
};
|
|
218
|
+
neighborhoods: {
|
|
219
|
+
median_yearly_rent_sar: unknown;
|
|
220
|
+
median_sale_price_sar: unknown;
|
|
221
|
+
gross_yield_pct: number | null;
|
|
222
|
+
rent_sample_size: number;
|
|
223
|
+
sale_sample_size: number;
|
|
224
|
+
neighborhood_id: number;
|
|
225
|
+
name_en: string | null;
|
|
226
|
+
name_ar: string | null;
|
|
227
|
+
}[];
|
|
228
|
+
price_source: string;
|
|
229
|
+
window: {
|
|
230
|
+
updated_within_days: number;
|
|
231
|
+
from: string;
|
|
232
|
+
to: string;
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
}>;
|
|
236
|
+
/**
|
|
237
|
+
* Get price trends. Monthly median asking price over recent months (up to 36),
|
|
238
|
+
* for a city or for up to five neighborhoods (one series each). Computed from
|
|
239
|
+
* Darak's listing history, not from today's listings: every listing Darak has
|
|
240
|
+
* recorded, including ones since rented, sold or removed, and every price change
|
|
241
|
+
* (the price in force at each point in time, not the current one). - `on_market`
|
|
242
|
+
* (default): a listing counts in a month if it was live at any point that month
|
|
243
|
+
* (first seen before the month ended, and still active or last seen on or after
|
|
244
|
+
* the month started), at the price it had at the end of the month, or when last
|
|
245
|
+
* seen if it went off the market earlier. - `new_listings`: a listing counts in
|
|
246
|
+
* the month Darak first saw it, at its first recorded asking price. Listings are
|
|
247
|
+
* deduplicated across sources and pass the same outlier filter as the current
|
|
248
|
+
* market (fences are today's), but not the 30-day freshness window, which
|
|
249
|
+
* doesn't apply to history.
|
|
250
|
+
*/
|
|
251
|
+
readonly trends: (params: QueryOf<"analytics.trends">) => Promise<{
|
|
252
|
+
data: {
|
|
253
|
+
filters: {
|
|
254
|
+
city: string;
|
|
255
|
+
listing_type: unknown;
|
|
256
|
+
listing_category: unknown;
|
|
257
|
+
property_type: string | null;
|
|
258
|
+
neighborhood_ids: unknown;
|
|
259
|
+
beds: unknown;
|
|
260
|
+
};
|
|
261
|
+
price_basis: string;
|
|
262
|
+
price_source: string;
|
|
263
|
+
basis: string;
|
|
264
|
+
series: {
|
|
265
|
+
neighborhood_id: unknown;
|
|
266
|
+
name_en: string | null;
|
|
267
|
+
name_ar: string | null;
|
|
268
|
+
change_pct: number | null;
|
|
269
|
+
points: {
|
|
270
|
+
month: string;
|
|
271
|
+
sample_size: number;
|
|
272
|
+
median_price_sar: unknown;
|
|
273
|
+
p25_price_sar: unknown;
|
|
274
|
+
p75_price_sar: unknown;
|
|
275
|
+
partial: boolean;
|
|
276
|
+
coverage: string;
|
|
277
|
+
}[];
|
|
278
|
+
}[];
|
|
279
|
+
history: {
|
|
280
|
+
starts_on: string;
|
|
281
|
+
first_complete_month: string;
|
|
282
|
+
};
|
|
283
|
+
methodology: string;
|
|
284
|
+
};
|
|
285
|
+
}>;
|
|
286
|
+
};
|
|
287
|
+
readonly exports: {
|
|
288
|
+
/**
|
|
289
|
+
* Create an export. Starts an export of a whole dataset as files, for loading
|
|
290
|
+
* into a warehouse.
|
|
291
|
+
*/
|
|
292
|
+
readonly create: (body: BodyOf<"exports.create">, headers?: HeaderOf<"exports.create">) => Promise<{
|
|
293
|
+
data: import("./openapi-zod/models.js").Export;
|
|
294
|
+
}>;
|
|
295
|
+
/**
|
|
296
|
+
* Get an export. An export's status and, once `completed`, a signed download
|
|
297
|
+
* link for every file, valid for 60 minutes; call again for fresh links.
|
|
298
|
+
*/
|
|
299
|
+
readonly get: (exportId: string | number) => Promise<{
|
|
300
|
+
data: import("./openapi-zod/models.js").Export;
|
|
301
|
+
}>;
|
|
302
|
+
/**
|
|
303
|
+
* List exports. Your organization's exports, newest first, without download
|
|
304
|
+
* links (GET one export for those).
|
|
305
|
+
*/
|
|
306
|
+
readonly list: (params?: QueryOf<"exports.list">) => Promise<{
|
|
307
|
+
data: import("./openapi-zod/models.js").Export[];
|
|
308
|
+
}>;
|
|
309
|
+
};
|
|
310
|
+
readonly listings: {
|
|
311
|
+
/** Get listings by id. Up to 100 listings in one call, in the order requested. */
|
|
312
|
+
readonly batch: (params: QueryOf<"listings.batch">) => Promise<{
|
|
313
|
+
data: import("./openapi-zod/models.js").Listing[];
|
|
314
|
+
missing_ids: number[];
|
|
315
|
+
}>;
|
|
316
|
+
/** Count listings. How many listings match the same filters as search. */
|
|
317
|
+
readonly count: (params: QueryOf<"listings.count">) => Promise<{
|
|
318
|
+
data: {
|
|
319
|
+
total: number;
|
|
320
|
+
};
|
|
321
|
+
}>;
|
|
322
|
+
/** Get a listing. One active listing. */
|
|
323
|
+
readonly get: (id: string | number) => Promise<{
|
|
324
|
+
data: import("./openapi-zod/models.js").Listing;
|
|
325
|
+
}>;
|
|
326
|
+
/**
|
|
327
|
+
* Get a listing's price history. Every price change Darak recorded for an active
|
|
328
|
+
* listing, oldest first.
|
|
329
|
+
*/
|
|
330
|
+
readonly priceHistory: (id: string | number) => Promise<{
|
|
331
|
+
data: {
|
|
332
|
+
listing_id: number;
|
|
333
|
+
current_price_yearly_sar: unknown;
|
|
334
|
+
first_seen_at: unknown;
|
|
335
|
+
history_window_days: unknown;
|
|
336
|
+
changes: {
|
|
337
|
+
changed_at: string;
|
|
338
|
+
from_yearly_sar: number;
|
|
339
|
+
to_yearly_sar: unknown;
|
|
340
|
+
}[];
|
|
341
|
+
};
|
|
342
|
+
}>;
|
|
343
|
+
/**
|
|
344
|
+
* Search listings. Active, deduplicated listings in one city, quality-filtered
|
|
345
|
+
* like darak.app.
|
|
346
|
+
*/
|
|
347
|
+
readonly search: (params: QueryOf<"listings.search">) => Promise<{
|
|
348
|
+
data: import("./openapi-zod/models.js").Listing[];
|
|
349
|
+
pagination: import("./openapi-zod/models.js").Pagination;
|
|
350
|
+
}>;
|
|
351
|
+
};
|
|
352
|
+
readonly market: {
|
|
353
|
+
/**
|
|
354
|
+
* Area distribution. Histogram and percentiles of floor/plot area (m²) over
|
|
355
|
+
* listings in the sample that state an area (`without_area_count` did not).
|
|
356
|
+
*/
|
|
357
|
+
readonly areaDistribution: (params: QueryOf<"market.area_distribution">) => Promise<{
|
|
358
|
+
data: {
|
|
359
|
+
filters: {
|
|
360
|
+
city: string;
|
|
361
|
+
listing_type: string;
|
|
362
|
+
listing_category: unknown;
|
|
363
|
+
property_type: string | null;
|
|
364
|
+
neighborhood_ids: unknown;
|
|
365
|
+
beds: unknown;
|
|
366
|
+
};
|
|
367
|
+
sample_size: number;
|
|
368
|
+
without_area_count: number;
|
|
369
|
+
median_area_sqm: unknown;
|
|
370
|
+
mean_area_sqm: unknown;
|
|
371
|
+
percentiles_sqm: {
|
|
372
|
+
p10: unknown;
|
|
373
|
+
p25: unknown;
|
|
374
|
+
p75: unknown;
|
|
375
|
+
p90: unknown;
|
|
376
|
+
};
|
|
377
|
+
range_sqm: {
|
|
378
|
+
min: number;
|
|
379
|
+
max: number;
|
|
380
|
+
};
|
|
381
|
+
buckets: {
|
|
382
|
+
min_sqm: number;
|
|
383
|
+
max_sqm: number;
|
|
384
|
+
count: number;
|
|
385
|
+
}[];
|
|
386
|
+
above_range_count: number;
|
|
387
|
+
window: {
|
|
388
|
+
updated_within_days: number;
|
|
389
|
+
from: string;
|
|
390
|
+
to: string;
|
|
391
|
+
};
|
|
392
|
+
};
|
|
393
|
+
}>;
|
|
394
|
+
/**
|
|
395
|
+
* Land prices per m². Median registered price per m² of land plots, per quarter,
|
|
396
|
+
* for a city or for each of up to 20 neighborhoods, with quarter-on-quarter and
|
|
397
|
+
* year-on-year change.
|
|
398
|
+
*/
|
|
399
|
+
readonly landPrices: (params: QueryOf<"market.land_prices">) => Promise<{
|
|
400
|
+
data: {
|
|
401
|
+
filters: {
|
|
402
|
+
city: string;
|
|
403
|
+
neighborhood_ids: unknown;
|
|
404
|
+
land_use: string;
|
|
405
|
+
};
|
|
406
|
+
asset: string;
|
|
407
|
+
price_source: string;
|
|
408
|
+
window: {
|
|
409
|
+
quarter_from: string;
|
|
410
|
+
quarter_to: string;
|
|
411
|
+
};
|
|
412
|
+
min_sample_size: number;
|
|
413
|
+
series: {
|
|
414
|
+
neighborhood: unknown;
|
|
415
|
+
points: {
|
|
416
|
+
quarter: string;
|
|
417
|
+
period_start: string;
|
|
418
|
+
deal_count: number;
|
|
419
|
+
suppressed: boolean;
|
|
420
|
+
complete: boolean;
|
|
421
|
+
coverage_flag: import("./openapi-zod/models.js").CoverageFlag;
|
|
422
|
+
median_price_per_sqm_sar: unknown;
|
|
423
|
+
p25_price_per_sqm_sar: unknown;
|
|
424
|
+
p75_price_per_sqm_sar: unknown;
|
|
425
|
+
median_plot_area_sqm: unknown;
|
|
426
|
+
change_qoq_pct: number | null;
|
|
427
|
+
change_yoy_pct: number | null;
|
|
428
|
+
}[];
|
|
429
|
+
latest: unknown;
|
|
430
|
+
}[];
|
|
431
|
+
coverage: import("./openapi-zod/models.js").TransactionCoverage;
|
|
432
|
+
attribution: import("./openapi-zod/models.js").TransactionAttribution;
|
|
433
|
+
};
|
|
434
|
+
}>;
|
|
435
|
+
/**
|
|
436
|
+
* Prices by neighborhood. Median and quartile price per neighborhood in a city,
|
|
437
|
+
* most expensive first.
|
|
438
|
+
*/
|
|
439
|
+
readonly neighborhoods: (params: QueryOf<"market.neighborhoods">) => Promise<{
|
|
440
|
+
data: {
|
|
441
|
+
filters: {
|
|
442
|
+
city: string;
|
|
443
|
+
listing_type: string;
|
|
444
|
+
listing_category: unknown;
|
|
445
|
+
property_type: string | null;
|
|
446
|
+
neighborhood_ids: unknown;
|
|
447
|
+
beds: unknown;
|
|
448
|
+
};
|
|
449
|
+
price_basis: string;
|
|
450
|
+
price_source: string;
|
|
451
|
+
min_sample_size: number;
|
|
452
|
+
neighborhoods: {
|
|
453
|
+
neighborhood_id: number;
|
|
454
|
+
name_ar: string;
|
|
455
|
+
name_en: string;
|
|
456
|
+
center: unknown;
|
|
457
|
+
sample_size: number;
|
|
458
|
+
median_price_sar: unknown;
|
|
459
|
+
p25_price_sar: unknown;
|
|
460
|
+
p75_price_sar: unknown;
|
|
461
|
+
median_price_per_sqm_sar: unknown;
|
|
462
|
+
}[];
|
|
463
|
+
suppressed_neighborhoods: number;
|
|
464
|
+
suppressed_sample_size: number;
|
|
465
|
+
window: {
|
|
466
|
+
updated_within_days: number;
|
|
467
|
+
from: string;
|
|
468
|
+
to: string;
|
|
469
|
+
};
|
|
470
|
+
};
|
|
471
|
+
}>;
|
|
472
|
+
/** Price distribution. Histogram and percentiles of price. */
|
|
473
|
+
readonly priceDistribution: (params: QueryOf<"market.price_distribution">) => Promise<{
|
|
474
|
+
data: {
|
|
475
|
+
filters: {
|
|
476
|
+
city: string;
|
|
477
|
+
listing_type: string;
|
|
478
|
+
listing_category: unknown;
|
|
479
|
+
property_type: string | null;
|
|
480
|
+
neighborhood_ids: unknown;
|
|
481
|
+
beds: unknown;
|
|
482
|
+
};
|
|
483
|
+
price_basis: string;
|
|
484
|
+
price_source: string;
|
|
485
|
+
sample_size: number;
|
|
486
|
+
median_price_sar: unknown;
|
|
487
|
+
mean_price_sar: unknown;
|
|
488
|
+
percentiles_sar: {
|
|
489
|
+
p10: unknown;
|
|
490
|
+
p25: unknown;
|
|
491
|
+
p75: unknown;
|
|
492
|
+
p90: unknown;
|
|
493
|
+
};
|
|
494
|
+
range_sar: {
|
|
495
|
+
min: number;
|
|
496
|
+
max: number;
|
|
497
|
+
};
|
|
498
|
+
buckets: {
|
|
499
|
+
min_sar: number;
|
|
500
|
+
max_sar: number;
|
|
501
|
+
count: number;
|
|
502
|
+
}[];
|
|
503
|
+
below_range_count: number;
|
|
504
|
+
above_range_count: number;
|
|
505
|
+
window: {
|
|
506
|
+
updated_within_days: number;
|
|
507
|
+
from: string;
|
|
508
|
+
to: string;
|
|
509
|
+
};
|
|
510
|
+
};
|
|
511
|
+
}>;
|
|
512
|
+
/**
|
|
513
|
+
* Market summary. Headline numbers for a city (or neighborhoods): listing count,
|
|
514
|
+
* median and quartile price, median area and price per m², how recently listings
|
|
515
|
+
* were updated, and breakdowns by property type, top neighborhoods by volume,
|
|
516
|
+
* and source. Computed over the market sample: active, deduplicated listings
|
|
517
|
+
* updated in the last 30 days (`updated_at`), after the same outlier filter
|
|
518
|
+
* darak.app uses (per-tier price fences from the median and MAD of log price,
|
|
519
|
+
* bedroom and area sanity checks, and a floor at 30% of the neighborhood
|
|
520
|
+
* median).
|
|
521
|
+
*/
|
|
522
|
+
readonly summary: (params: QueryOf<"market.summary">) => Promise<{
|
|
523
|
+
data: {
|
|
524
|
+
filters: {
|
|
525
|
+
city: string;
|
|
526
|
+
listing_type: string;
|
|
527
|
+
listing_category: unknown;
|
|
528
|
+
property_type: string | null;
|
|
529
|
+
neighborhood_ids: unknown;
|
|
530
|
+
beds: unknown;
|
|
531
|
+
};
|
|
532
|
+
price_basis: string;
|
|
533
|
+
price_source: string;
|
|
534
|
+
sample_size: number;
|
|
535
|
+
median_price_sar: unknown;
|
|
536
|
+
p25_price_sar: unknown;
|
|
537
|
+
p75_price_sar: unknown;
|
|
538
|
+
median_area_sqm: unknown;
|
|
539
|
+
median_price_per_sqm_sar: unknown;
|
|
540
|
+
area_sample_size: number;
|
|
541
|
+
updated_last_3_days: number;
|
|
542
|
+
updated_last_7_days: number;
|
|
543
|
+
by_property_type: {
|
|
544
|
+
property_type: string;
|
|
545
|
+
sample_size: number;
|
|
546
|
+
median_price_sar: unknown;
|
|
547
|
+
}[];
|
|
548
|
+
top_neighborhoods: {
|
|
549
|
+
neighborhood_id: number;
|
|
550
|
+
name_ar: string;
|
|
551
|
+
name_en: string;
|
|
552
|
+
sample_size: number;
|
|
553
|
+
median_price_sar: unknown;
|
|
554
|
+
}[];
|
|
555
|
+
sources: {
|
|
556
|
+
source: string;
|
|
557
|
+
count: number;
|
|
558
|
+
}[];
|
|
559
|
+
window: {
|
|
560
|
+
updated_within_days: number;
|
|
561
|
+
from: string;
|
|
562
|
+
to: string;
|
|
563
|
+
};
|
|
564
|
+
};
|
|
565
|
+
}>;
|
|
566
|
+
/**
|
|
567
|
+
* New supply. How many listings came onto the market recently: listings first
|
|
568
|
+
* seen in the last 7 days vs the 7 days before, and the last 30 days vs the 30
|
|
569
|
+
* days before (rolling windows ending now).
|
|
570
|
+
*/
|
|
571
|
+
readonly supply: (params: QueryOf<"market.supply">) => Promise<{
|
|
572
|
+
data: {
|
|
573
|
+
filters: {
|
|
574
|
+
city: string;
|
|
575
|
+
listing_type: string;
|
|
576
|
+
listing_category: unknown;
|
|
577
|
+
property_type: string | null;
|
|
578
|
+
neighborhood_ids: unknown;
|
|
579
|
+
beds: unknown;
|
|
580
|
+
};
|
|
581
|
+
sample_size: number;
|
|
582
|
+
last_7_days: {
|
|
583
|
+
new_listings: number;
|
|
584
|
+
previous_new_listings: number;
|
|
585
|
+
change_pct: number | null;
|
|
586
|
+
};
|
|
587
|
+
last_30_days: {
|
|
588
|
+
new_listings: number;
|
|
589
|
+
previous_new_listings: number;
|
|
590
|
+
change_pct: number | null;
|
|
591
|
+
};
|
|
592
|
+
window: {
|
|
593
|
+
updated_within_days: number;
|
|
594
|
+
from: string;
|
|
595
|
+
to: string;
|
|
596
|
+
};
|
|
597
|
+
};
|
|
598
|
+
}>;
|
|
599
|
+
/**
|
|
600
|
+
* Registered deal statistics. Deal counts and median, 25th and 75th percentile
|
|
601
|
+
* price per m² and total price, per quarter and land-use class, for a city, a
|
|
602
|
+
* set of neighborhoods combined (`group_by=city` with `neighborhood_id`), or
|
|
603
|
+
* each neighborhood (`group_by=neighborhood`).
|
|
604
|
+
*/
|
|
605
|
+
readonly transactions: (params: QueryOf<"market.transactions">) => Promise<{
|
|
606
|
+
data: {
|
|
607
|
+
filters: {
|
|
608
|
+
city: string;
|
|
609
|
+
neighborhood_ids: unknown;
|
|
610
|
+
group_by: string;
|
|
611
|
+
land_use: unknown;
|
|
612
|
+
};
|
|
613
|
+
price_source: string;
|
|
614
|
+
window: {
|
|
615
|
+
quarter_from: string;
|
|
616
|
+
quarter_to: string;
|
|
617
|
+
};
|
|
618
|
+
min_sample_size: number;
|
|
619
|
+
cells: {
|
|
620
|
+
quarter: string;
|
|
621
|
+
period_start: string;
|
|
622
|
+
neighborhood: unknown;
|
|
623
|
+
land_use: string;
|
|
624
|
+
deal_count: number;
|
|
625
|
+
suppressed: boolean;
|
|
626
|
+
complete: boolean;
|
|
627
|
+
coverage_flag: import("./openapi-zod/models.js").CoverageFlag;
|
|
628
|
+
median_price_per_sqm_sar: unknown;
|
|
629
|
+
p25_price_per_sqm_sar: unknown;
|
|
630
|
+
p75_price_per_sqm_sar: unknown;
|
|
631
|
+
price_per_sqm_sample_size: number;
|
|
632
|
+
median_price_sar: unknown;
|
|
633
|
+
p25_price_sar: unknown;
|
|
634
|
+
p75_price_sar: unknown;
|
|
635
|
+
median_area_sqm: unknown;
|
|
636
|
+
}[];
|
|
637
|
+
coverage: import("./openapi-zod/models.js").TransactionCoverage;
|
|
638
|
+
attribution: import("./openapi-zod/models.js").TransactionAttribution;
|
|
639
|
+
};
|
|
640
|
+
}>;
|
|
641
|
+
/**
|
|
642
|
+
* Vacancy indicator. How long listings in the sample have been on the market, as
|
|
643
|
+
* a proxy for vacancy (actual occupancy isn't observed).
|
|
644
|
+
*/
|
|
645
|
+
readonly vacancy: (params: QueryOf<"market.vacancy">) => Promise<{
|
|
646
|
+
data: {
|
|
647
|
+
filters: {
|
|
648
|
+
city: string;
|
|
649
|
+
listing_type: string;
|
|
650
|
+
listing_category: unknown;
|
|
651
|
+
property_type: string | null;
|
|
652
|
+
neighborhood_ids: unknown;
|
|
653
|
+
beds: unknown;
|
|
654
|
+
};
|
|
655
|
+
sample_size: number;
|
|
656
|
+
median_days_on_market: unknown;
|
|
657
|
+
on_market_over_30_days: {
|
|
658
|
+
count: number;
|
|
659
|
+
pct: number | null;
|
|
660
|
+
};
|
|
661
|
+
on_market_over_60_days: {
|
|
662
|
+
count: number;
|
|
663
|
+
pct: number | null;
|
|
664
|
+
};
|
|
665
|
+
on_market_over_90_days: {
|
|
666
|
+
count: number;
|
|
667
|
+
pct: number | null;
|
|
668
|
+
};
|
|
669
|
+
window: {
|
|
670
|
+
updated_within_days: number;
|
|
671
|
+
from: string;
|
|
672
|
+
to: string;
|
|
673
|
+
};
|
|
674
|
+
};
|
|
675
|
+
}>;
|
|
676
|
+
};
|
|
677
|
+
readonly official: {
|
|
678
|
+
/**
|
|
679
|
+
* Darak Property Index. **Free on every plan (0 units).** Series built on Saudi
|
|
680
|
+
* open data are served under the Saudi Open Data License v2.0 with attribution:
|
|
681
|
+
* show `attribution.notice` wherever you display or pass on those figures.
|
|
682
|
+
*/
|
|
683
|
+
readonly marketIndex: (params?: QueryOf<"official.market_index">) => Promise<{
|
|
684
|
+
data: {
|
|
685
|
+
release: {
|
|
686
|
+
slug: string;
|
|
687
|
+
revision: number;
|
|
688
|
+
published_at: string;
|
|
689
|
+
methodology_version: string;
|
|
690
|
+
revision_note: string | null;
|
|
691
|
+
headline: string | null;
|
|
692
|
+
url: string;
|
|
693
|
+
methodology_url: string;
|
|
694
|
+
};
|
|
695
|
+
available_releases: string[];
|
|
696
|
+
notes: string[];
|
|
697
|
+
series: {
|
|
698
|
+
series: string;
|
|
699
|
+
label: string;
|
|
700
|
+
metric: string;
|
|
701
|
+
statistic: string;
|
|
702
|
+
kind: string;
|
|
703
|
+
unit: string;
|
|
704
|
+
price_source: string;
|
|
705
|
+
property: string;
|
|
706
|
+
source_key: string;
|
|
707
|
+
source: string;
|
|
708
|
+
geography: string;
|
|
709
|
+
city: string | null;
|
|
710
|
+
granularity: string;
|
|
711
|
+
sample_unit: string;
|
|
712
|
+
min_sample_size: number;
|
|
713
|
+
withheld_periods: string[];
|
|
714
|
+
points: {
|
|
715
|
+
period: string;
|
|
716
|
+
period_start: string;
|
|
717
|
+
value: number;
|
|
718
|
+
sample_size: number;
|
|
719
|
+
coverage_flag: import("./openapi-zod/models.js").CoverageFlag;
|
|
720
|
+
}[];
|
|
721
|
+
}[];
|
|
722
|
+
attribution: unknown;
|
|
723
|
+
};
|
|
724
|
+
}>;
|
|
725
|
+
/**
|
|
726
|
+
* Registered rents (REGA). **Free on every plan (0 units).** This is Saudi open
|
|
727
|
+
* data, served at no charge under the Saudi Open Data License v2.0 with
|
|
728
|
+
* attribution: show `attribution.notice` wherever you display or pass on the
|
|
729
|
+
* figures. Registered rents from REGA's quarterly rent index ("مؤشر الايجار",
|
|
730
|
+
* published on open.data.gov.sa): for each neighborhood and property type, the
|
|
731
|
+
* **mean** yearly rent of the residential leases registered on Ejar that
|
|
732
|
+
* quarter, the mean yearly rent per m², and the number of contracts behind them.
|
|
733
|
+
* - **These are means, not medians.** REGA publishes the mean; a few large
|
|
734
|
+
* leases pull it up, so it usually sits above a median.
|
|
735
|
+
*/
|
|
736
|
+
readonly registeredRents: (params: QueryOf<"official.registered_rents">) => Promise<{
|
|
737
|
+
data: {
|
|
738
|
+
filters: {
|
|
739
|
+
city: string;
|
|
740
|
+
neighborhood_ids: unknown;
|
|
741
|
+
property_types: string[];
|
|
742
|
+
};
|
|
743
|
+
period: {
|
|
744
|
+
label: string;
|
|
745
|
+
start: string;
|
|
746
|
+
end: string;
|
|
747
|
+
};
|
|
748
|
+
available_periods: string[];
|
|
749
|
+
price_source: string;
|
|
750
|
+
price_basis: string;
|
|
751
|
+
statistic: string;
|
|
752
|
+
min_sample_size: number;
|
|
753
|
+
cells: {
|
|
754
|
+
neighborhood_id: unknown;
|
|
755
|
+
neighborhood_name_ar: string;
|
|
756
|
+
neighborhood_name_en: string | null;
|
|
757
|
+
town_ar: string;
|
|
758
|
+
property_type: string;
|
|
759
|
+
property_type_ar: string;
|
|
760
|
+
contract_count: number;
|
|
761
|
+
mean_rent_sar: number;
|
|
762
|
+
mean_rent_per_sqm_sar: number | null;
|
|
763
|
+
source_url: string | null;
|
|
764
|
+
}[];
|
|
765
|
+
coverage: {
|
|
766
|
+
cells: number;
|
|
767
|
+
cells_served: number;
|
|
768
|
+
cells_withheld: number;
|
|
769
|
+
contracts: number;
|
|
770
|
+
contracts_withheld: number;
|
|
771
|
+
cells_served_with_neighborhood_id: number;
|
|
772
|
+
};
|
|
773
|
+
city_totals: {
|
|
774
|
+
property_type: string;
|
|
775
|
+
contract_count: number;
|
|
776
|
+
mean_rent_sar: unknown;
|
|
777
|
+
cells: number;
|
|
778
|
+
towns: number;
|
|
779
|
+
}[];
|
|
780
|
+
attribution: {
|
|
781
|
+
notice: string;
|
|
782
|
+
license: {
|
|
783
|
+
name: string;
|
|
784
|
+
url: string;
|
|
785
|
+
base_license: string;
|
|
786
|
+
base_license_url: string;
|
|
787
|
+
};
|
|
788
|
+
datasets: {
|
|
789
|
+
source: string;
|
|
790
|
+
title: string;
|
|
791
|
+
title_en: string;
|
|
792
|
+
publisher: string;
|
|
793
|
+
urls: string[];
|
|
794
|
+
}[];
|
|
795
|
+
};
|
|
796
|
+
};
|
|
797
|
+
}>;
|
|
798
|
+
};
|
|
799
|
+
readonly organization: {
|
|
800
|
+
readonly auditEvents: {
|
|
801
|
+
/** List audit events. Newest first, 50 per page. */
|
|
802
|
+
readonly list: (params?: QueryOf<"organization.audit_events.list">) => Promise<{
|
|
803
|
+
data: {
|
|
804
|
+
action: string;
|
|
805
|
+
target: string | null;
|
|
806
|
+
actor: string | null;
|
|
807
|
+
actor_key_id: string | null;
|
|
808
|
+
ip: string | null;
|
|
809
|
+
created_at: string;
|
|
810
|
+
}[];
|
|
811
|
+
pagination: {
|
|
812
|
+
next_cursor: string | null;
|
|
813
|
+
has_more: boolean;
|
|
814
|
+
};
|
|
815
|
+
}>;
|
|
816
|
+
};
|
|
817
|
+
/** Get your organization. Name, plan and limits, and this month's usage. */
|
|
818
|
+
readonly get: () => Promise<{
|
|
819
|
+
data: {
|
|
820
|
+
id: string;
|
|
821
|
+
name: string;
|
|
822
|
+
slug: string;
|
|
823
|
+
status: string;
|
|
824
|
+
plan: {
|
|
825
|
+
id: string;
|
|
826
|
+
name: string;
|
|
827
|
+
scopes: string[];
|
|
828
|
+
rate_limit_per_minute: number;
|
|
829
|
+
monthly_quota_units: unknown;
|
|
830
|
+
max_page_size: number;
|
|
831
|
+
max_active_keys: number;
|
|
832
|
+
};
|
|
833
|
+
usage: {
|
|
834
|
+
month_units: number;
|
|
835
|
+
resets_in_seconds: number;
|
|
836
|
+
};
|
|
837
|
+
};
|
|
838
|
+
}>;
|
|
839
|
+
readonly keys: {
|
|
840
|
+
/** Create a data key. Creates a `dk_live_…` key. */
|
|
841
|
+
readonly create: (body: BodyOf<"organization.keys.create">, headers?: HeaderOf<"organization.keys.create">) => Promise<{
|
|
842
|
+
data: {
|
|
843
|
+
id: string;
|
|
844
|
+
name: string;
|
|
845
|
+
key: string;
|
|
846
|
+
hint: string;
|
|
847
|
+
};
|
|
848
|
+
}>;
|
|
849
|
+
/** List data keys. Active data keys (`dk_live_…`). */
|
|
850
|
+
readonly list: () => Promise<{
|
|
851
|
+
data: {
|
|
852
|
+
id: string;
|
|
853
|
+
name: string;
|
|
854
|
+
hint: string;
|
|
855
|
+
project_id: string;
|
|
856
|
+
scopes: unknown;
|
|
857
|
+
expires_at: unknown;
|
|
858
|
+
created_at: string;
|
|
859
|
+
last_used_at: unknown;
|
|
860
|
+
}[];
|
|
861
|
+
}>;
|
|
862
|
+
/** Revoke a key. Requests with the key are rejected right away. */
|
|
863
|
+
readonly revoke: (keyId: string | number, headers?: HeaderOf<"organization.keys.revoke">) => Promise<{
|
|
864
|
+
data: {
|
|
865
|
+
id: string;
|
|
866
|
+
revoked: boolean;
|
|
867
|
+
};
|
|
868
|
+
}>;
|
|
869
|
+
};
|
|
870
|
+
readonly members: {
|
|
871
|
+
/**
|
|
872
|
+
* List members and invitations. Everyone with access to this organization and
|
|
873
|
+
* every invitation not yet accepted, with each person's role.
|
|
874
|
+
*/
|
|
875
|
+
readonly list: () => Promise<{
|
|
876
|
+
data: {
|
|
877
|
+
members: {
|
|
878
|
+
email: string;
|
|
879
|
+
name: string | null;
|
|
880
|
+
role: string;
|
|
881
|
+
joined_at: string;
|
|
882
|
+
}[];
|
|
883
|
+
invitations: {
|
|
884
|
+
email: string;
|
|
885
|
+
role: string;
|
|
886
|
+
expires_at: string;
|
|
887
|
+
}[];
|
|
888
|
+
};
|
|
889
|
+
}>;
|
|
890
|
+
};
|
|
891
|
+
readonly projects: {
|
|
892
|
+
/** List projects. The projects this organization's keys belong to. */
|
|
893
|
+
readonly list: () => Promise<{
|
|
894
|
+
data: {
|
|
895
|
+
id: string;
|
|
896
|
+
name: string;
|
|
897
|
+
monthly_unit_cap: unknown;
|
|
898
|
+
active_keys: number;
|
|
899
|
+
month_units: number;
|
|
900
|
+
created_at: string;
|
|
901
|
+
}[];
|
|
902
|
+
}>;
|
|
903
|
+
};
|
|
904
|
+
readonly requestLogs: {
|
|
905
|
+
/**
|
|
906
|
+
* List request logs. Calls this organization made, newest first, within its
|
|
907
|
+
* retention window (7, 30 or 90 days, set on the Settings page).
|
|
908
|
+
*/
|
|
909
|
+
readonly list: (params?: QueryOf<"organization.request_logs.list">) => Promise<{
|
|
910
|
+
data: {
|
|
911
|
+
request_id: string | null;
|
|
912
|
+
at: string;
|
|
913
|
+
route: string;
|
|
914
|
+
status: number;
|
|
915
|
+
units: unknown;
|
|
916
|
+
duration_ms: number;
|
|
917
|
+
key_id: string | null;
|
|
918
|
+
error: unknown;
|
|
919
|
+
params: unknown;
|
|
920
|
+
}[];
|
|
921
|
+
pagination: import("./openapi-zod/models.js").Pagination;
|
|
922
|
+
}>;
|
|
923
|
+
};
|
|
924
|
+
/**
|
|
925
|
+
* Daily usage. Requests and units per UTC day, key, endpoint and result class,
|
|
926
|
+
* for the last 7, 30 or 90 days.
|
|
927
|
+
*/
|
|
928
|
+
readonly usage: (params?: QueryOf<"organization.usage">) => Promise<{
|
|
929
|
+
data: {
|
|
930
|
+
day: string;
|
|
931
|
+
key_id: string | null;
|
|
932
|
+
endpoint: string;
|
|
933
|
+
status_class: number;
|
|
934
|
+
requests: number;
|
|
935
|
+
units: number;
|
|
936
|
+
}[];
|
|
937
|
+
}>;
|
|
938
|
+
readonly webhooks: {
|
|
939
|
+
/** Create a webhook endpoint. Subscribes an HTTPS URL to listing events. */
|
|
940
|
+
readonly create: (body: BodyOf<"organization.webhooks.create">, headers?: HeaderOf<"organization.webhooks.create">) => Promise<{
|
|
941
|
+
data: {
|
|
942
|
+
id: string;
|
|
943
|
+
url: string;
|
|
944
|
+
event_types: string[];
|
|
945
|
+
filters: Record<string, unknown>;
|
|
946
|
+
description: string | null;
|
|
947
|
+
status: string;
|
|
948
|
+
disabled_reason: string | null;
|
|
949
|
+
consecutive_failures: number;
|
|
950
|
+
created_at: string;
|
|
951
|
+
secret: string;
|
|
952
|
+
};
|
|
953
|
+
}>;
|
|
954
|
+
/**
|
|
955
|
+
* Delete a webhook endpoint. Stops delivery and removes the endpoint and its
|
|
956
|
+
* delivery history.
|
|
957
|
+
*/
|
|
958
|
+
readonly delete: (webhookId: string | number, headers?: HeaderOf<"organization.webhooks.delete">) => Promise<{
|
|
959
|
+
data: {
|
|
960
|
+
id: string;
|
|
961
|
+
deleted: boolean;
|
|
962
|
+
};
|
|
963
|
+
}>;
|
|
964
|
+
/**
|
|
965
|
+
* List deliveries. What was sent to this endpoint, newest first, with what it
|
|
966
|
+
* answered.
|
|
967
|
+
*/
|
|
968
|
+
readonly deliveries: (webhookId: string | number, params?: QueryOf<"organization.webhooks.deliveries">) => Promise<{
|
|
969
|
+
data: {
|
|
970
|
+
id: number;
|
|
971
|
+
event_id: string;
|
|
972
|
+
event_type: string;
|
|
973
|
+
status: string;
|
|
974
|
+
attempts: number;
|
|
975
|
+
response_status: unknown;
|
|
976
|
+
response_snippet: string | null;
|
|
977
|
+
next_attempt_at: unknown;
|
|
978
|
+
delivered_at: unknown;
|
|
979
|
+
created_at: string;
|
|
980
|
+
}[];
|
|
981
|
+
}>;
|
|
982
|
+
/** List webhook endpoints. Every endpoint this organization has subscribed. */
|
|
983
|
+
readonly list: () => Promise<{
|
|
984
|
+
data: {
|
|
985
|
+
id: string;
|
|
986
|
+
url: string;
|
|
987
|
+
event_types: string[];
|
|
988
|
+
filters: Record<string, unknown>;
|
|
989
|
+
description: string | null;
|
|
990
|
+
status: string;
|
|
991
|
+
disabled_reason: string | null;
|
|
992
|
+
consecutive_failures: number;
|
|
993
|
+
created_at: string;
|
|
994
|
+
}[];
|
|
995
|
+
}>;
|
|
996
|
+
/**
|
|
997
|
+
* Replay a delivery. Queues the same payload again, with its original
|
|
998
|
+
* `event_id` so a receiver that already handled it can recognise the repeat.
|
|
999
|
+
*/
|
|
1000
|
+
readonly replay: (webhookId: string | number, deliveryId: string | number, headers?: HeaderOf<"organization.webhooks.replay">) => Promise<{
|
|
1001
|
+
data: {
|
|
1002
|
+
id: number;
|
|
1003
|
+
status: string;
|
|
1004
|
+
};
|
|
1005
|
+
}>;
|
|
1006
|
+
};
|
|
1007
|
+
};
|
|
1008
|
+
readonly projects: {
|
|
1009
|
+
/**
|
|
1010
|
+
* List developers. Developers with active projects on Darak, most projects
|
|
1011
|
+
* first.
|
|
1012
|
+
*/
|
|
1013
|
+
readonly developers: (params?: QueryOf<"projects.developers">) => Promise<{
|
|
1014
|
+
data: {
|
|
1015
|
+
name: string;
|
|
1016
|
+
project_count: number;
|
|
1017
|
+
active_project_count: number;
|
|
1018
|
+
cities: string[];
|
|
1019
|
+
}[];
|
|
1020
|
+
pagination: import("./openapi-zod/models.js").Pagination;
|
|
1021
|
+
}>;
|
|
1022
|
+
/**
|
|
1023
|
+
* Get a project. One project with its description, boundary, amenities,
|
|
1024
|
+
* financing banks and a summary of the units listed on Darak.
|
|
1025
|
+
*/
|
|
1026
|
+
readonly get: (id: string | number) => Promise<{
|
|
1027
|
+
data: {
|
|
1028
|
+
id: number;
|
|
1029
|
+
url: string | null;
|
|
1030
|
+
name_ar: string | null;
|
|
1031
|
+
name_en: string | null;
|
|
1032
|
+
developer: string | null;
|
|
1033
|
+
status: unknown;
|
|
1034
|
+
project_type: unknown;
|
|
1035
|
+
listing_category: string;
|
|
1036
|
+
location: {
|
|
1037
|
+
city: string | null;
|
|
1038
|
+
city_name_en: string | null;
|
|
1039
|
+
neighborhood_id: unknown;
|
|
1040
|
+
neighborhood_name_ar: string | null;
|
|
1041
|
+
neighborhood_name_en: string | null;
|
|
1042
|
+
lat: number | null;
|
|
1043
|
+
lng: number | null;
|
|
1044
|
+
};
|
|
1045
|
+
price: {
|
|
1046
|
+
starting_sar: unknown;
|
|
1047
|
+
from_sar: unknown;
|
|
1048
|
+
to_sar: unknown;
|
|
1049
|
+
};
|
|
1050
|
+
area_sqm: {
|
|
1051
|
+
min: number | null;
|
|
1052
|
+
max: number | null;
|
|
1053
|
+
};
|
|
1054
|
+
advertised_unit_count: unknown;
|
|
1055
|
+
last_seen_at: unknown;
|
|
1056
|
+
description: string | null;
|
|
1057
|
+
description_en: string | null;
|
|
1058
|
+
address: string | null;
|
|
1059
|
+
boundary: unknown;
|
|
1060
|
+
images: string[];
|
|
1061
|
+
features: string[];
|
|
1062
|
+
supported_banks: string[];
|
|
1063
|
+
warranty: {
|
|
1064
|
+
item: string;
|
|
1065
|
+
duration: string | null;
|
|
1066
|
+
}[];
|
|
1067
|
+
links: {
|
|
1068
|
+
brochure: string | null;
|
|
1069
|
+
virtual_tour: string | null;
|
|
1070
|
+
video: string | null;
|
|
1071
|
+
};
|
|
1072
|
+
source: {
|
|
1073
|
+
name: string;
|
|
1074
|
+
url: string | null;
|
|
1075
|
+
};
|
|
1076
|
+
linked_units: {
|
|
1077
|
+
count: number;
|
|
1078
|
+
for_sale: number;
|
|
1079
|
+
for_rent: number;
|
|
1080
|
+
bedrooms_min: unknown;
|
|
1081
|
+
bedrooms_max: unknown;
|
|
1082
|
+
area_sqm_min: number | null;
|
|
1083
|
+
area_sqm_max: number | null;
|
|
1084
|
+
sale_price_sar_min: unknown;
|
|
1085
|
+
sale_price_sar_max: unknown;
|
|
1086
|
+
yearly_rent_sar_min: unknown;
|
|
1087
|
+
yearly_rent_sar_max: unknown;
|
|
1088
|
+
};
|
|
1089
|
+
};
|
|
1090
|
+
}>;
|
|
1091
|
+
/**
|
|
1092
|
+
* Search projects. Off-plan and newly built residential and commercial projects
|
|
1093
|
+
* from Saudi developers and portals, one entry per project (copies from several
|
|
1094
|
+
* sources are merged).
|
|
1095
|
+
*/
|
|
1096
|
+
readonly search: (params?: QueryOf<"projects.search">) => Promise<{
|
|
1097
|
+
data: {
|
|
1098
|
+
id: number;
|
|
1099
|
+
url: string | null;
|
|
1100
|
+
name_ar: string | null;
|
|
1101
|
+
name_en: string | null;
|
|
1102
|
+
developer: string | null;
|
|
1103
|
+
status: unknown;
|
|
1104
|
+
project_type: unknown;
|
|
1105
|
+
listing_category: string;
|
|
1106
|
+
location: {
|
|
1107
|
+
city: string | null;
|
|
1108
|
+
city_name_en: string | null;
|
|
1109
|
+
neighborhood_id: unknown;
|
|
1110
|
+
neighborhood_name_ar: string | null;
|
|
1111
|
+
neighborhood_name_en: string | null;
|
|
1112
|
+
lat: number | null;
|
|
1113
|
+
lng: number | null;
|
|
1114
|
+
};
|
|
1115
|
+
price: {
|
|
1116
|
+
starting_sar: unknown;
|
|
1117
|
+
from_sar: unknown;
|
|
1118
|
+
to_sar: unknown;
|
|
1119
|
+
};
|
|
1120
|
+
area_sqm: {
|
|
1121
|
+
min: number | null;
|
|
1122
|
+
max: number | null;
|
|
1123
|
+
};
|
|
1124
|
+
advertised_unit_count: unknown;
|
|
1125
|
+
linked_units: {
|
|
1126
|
+
count: number;
|
|
1127
|
+
bedrooms_min: unknown;
|
|
1128
|
+
bedrooms_max: unknown;
|
|
1129
|
+
};
|
|
1130
|
+
cover_image: string | null;
|
|
1131
|
+
last_seen_at: unknown;
|
|
1132
|
+
}[];
|
|
1133
|
+
pagination: import("./openapi-zod/models.js").Pagination;
|
|
1134
|
+
}>;
|
|
1135
|
+
/**
|
|
1136
|
+
* List a project's units. Active listings on Darak linked to one project: units
|
|
1137
|
+
* for sale (total price) and, for some projects, rentals (yearly rent).
|
|
1138
|
+
*/
|
|
1139
|
+
readonly units: (id: string | number, params?: QueryOf<"projects.units">) => Promise<{
|
|
1140
|
+
data: {
|
|
1141
|
+
id: number;
|
|
1142
|
+
url: string;
|
|
1143
|
+
project: {
|
|
1144
|
+
id: number;
|
|
1145
|
+
name_ar: string | null;
|
|
1146
|
+
name_en: string | null;
|
|
1147
|
+
};
|
|
1148
|
+
link: {
|
|
1149
|
+
type: string;
|
|
1150
|
+
confidence: number;
|
|
1151
|
+
};
|
|
1152
|
+
title: string | null;
|
|
1153
|
+
listing_type: string;
|
|
1154
|
+
property_type: string;
|
|
1155
|
+
sale_price_sar: unknown;
|
|
1156
|
+
yearly_rent_sar: unknown;
|
|
1157
|
+
bedrooms: unknown;
|
|
1158
|
+
bathrooms: unknown;
|
|
1159
|
+
area_sqm: number | null;
|
|
1160
|
+
floor: string | null;
|
|
1161
|
+
location: {
|
|
1162
|
+
city: string | null;
|
|
1163
|
+
city_name_en: string | null;
|
|
1164
|
+
neighborhood_id: unknown;
|
|
1165
|
+
neighborhood_name_ar: string | null;
|
|
1166
|
+
neighborhood_name_en: string | null;
|
|
1167
|
+
lat: number | null;
|
|
1168
|
+
lng: number | null;
|
|
1169
|
+
};
|
|
1170
|
+
images: string[];
|
|
1171
|
+
source: {
|
|
1172
|
+
name: string;
|
|
1173
|
+
url: string | null;
|
|
1174
|
+
};
|
|
1175
|
+
first_seen_at: unknown;
|
|
1176
|
+
last_seen_at: unknown;
|
|
1177
|
+
}[];
|
|
1178
|
+
pagination: import("./openapi-zod/models.js").Pagination;
|
|
1179
|
+
}>;
|
|
1180
|
+
/**
|
|
1181
|
+
* Search project units. Units across all projects: active listings linked to a
|
|
1182
|
+
* project, filtered by the unit (bedrooms, price, area) and by its project
|
|
1183
|
+
* (city, developer, status).
|
|
1184
|
+
*/
|
|
1185
|
+
readonly unitsSearch: (params?: QueryOf<"projects.units_search">) => Promise<{
|
|
1186
|
+
data: {
|
|
1187
|
+
id: number;
|
|
1188
|
+
url: string;
|
|
1189
|
+
project: {
|
|
1190
|
+
id: number;
|
|
1191
|
+
name_ar: string | null;
|
|
1192
|
+
name_en: string | null;
|
|
1193
|
+
};
|
|
1194
|
+
link: {
|
|
1195
|
+
type: string;
|
|
1196
|
+
confidence: number;
|
|
1197
|
+
};
|
|
1198
|
+
title: string | null;
|
|
1199
|
+
listing_type: string;
|
|
1200
|
+
property_type: string;
|
|
1201
|
+
sale_price_sar: unknown;
|
|
1202
|
+
yearly_rent_sar: unknown;
|
|
1203
|
+
bedrooms: unknown;
|
|
1204
|
+
bathrooms: unknown;
|
|
1205
|
+
area_sqm: number | null;
|
|
1206
|
+
floor: string | null;
|
|
1207
|
+
location: {
|
|
1208
|
+
city: string | null;
|
|
1209
|
+
city_name_en: string | null;
|
|
1210
|
+
neighborhood_id: unknown;
|
|
1211
|
+
neighborhood_name_ar: string | null;
|
|
1212
|
+
neighborhood_name_en: string | null;
|
|
1213
|
+
lat: number | null;
|
|
1214
|
+
lng: number | null;
|
|
1215
|
+
};
|
|
1216
|
+
images: string[];
|
|
1217
|
+
source: {
|
|
1218
|
+
name: string;
|
|
1219
|
+
url: string | null;
|
|
1220
|
+
};
|
|
1221
|
+
first_seen_at: unknown;
|
|
1222
|
+
last_seen_at: unknown;
|
|
1223
|
+
}[];
|
|
1224
|
+
pagination: import("./openapi-zod/models.js").Pagination;
|
|
1225
|
+
}>;
|
|
1226
|
+
};
|
|
1227
|
+
readonly reference: {
|
|
1228
|
+
/** List cities. Cities Darak covers. */
|
|
1229
|
+
readonly cities: () => Promise<{
|
|
1230
|
+
data: {
|
|
1231
|
+
slug: string;
|
|
1232
|
+
name_en: string;
|
|
1233
|
+
name_ar: string;
|
|
1234
|
+
}[];
|
|
1235
|
+
}>;
|
|
1236
|
+
/**
|
|
1237
|
+
* List city directions. Groupings of neighborhoods by part of the city (north,
|
|
1238
|
+
* east, …).
|
|
1239
|
+
*/
|
|
1240
|
+
readonly directions: (city: string | number) => Promise<{
|
|
1241
|
+
data: {
|
|
1242
|
+
id: number;
|
|
1243
|
+
name_en: string;
|
|
1244
|
+
name_ar: string;
|
|
1245
|
+
neighborhood_ids: number[];
|
|
1246
|
+
}[];
|
|
1247
|
+
}>;
|
|
1248
|
+
/** List enumerated values. Allowed values for enumerated fields and filters. */
|
|
1249
|
+
readonly enums: () => Promise<{
|
|
1250
|
+
data: {
|
|
1251
|
+
listing_types: string[];
|
|
1252
|
+
listing_categories: string[];
|
|
1253
|
+
property_types: {
|
|
1254
|
+
residential: string[];
|
|
1255
|
+
commercial: string[];
|
|
1256
|
+
};
|
|
1257
|
+
rent_frequencies: string[];
|
|
1258
|
+
advertiser_types: string[];
|
|
1259
|
+
amenities: string[];
|
|
1260
|
+
project_features: string[];
|
|
1261
|
+
project_banks: string[];
|
|
1262
|
+
sources: {
|
|
1263
|
+
id: string;
|
|
1264
|
+
name: string;
|
|
1265
|
+
}[];
|
|
1266
|
+
};
|
|
1267
|
+
}>;
|
|
1268
|
+
/**
|
|
1269
|
+
* Get this key's limits. The plan, rate limit, monthly quota, page size and
|
|
1270
|
+
* paging depth that apply to the key making the request, and the APIs it can
|
|
1271
|
+
* reach.
|
|
1272
|
+
*/
|
|
1273
|
+
readonly limits: () => Promise<{
|
|
1274
|
+
data: {
|
|
1275
|
+
plan: string;
|
|
1276
|
+
scopes: string[];
|
|
1277
|
+
rate_limit_per_minute: number;
|
|
1278
|
+
monthly_quota_units: unknown;
|
|
1279
|
+
max_page_size: number;
|
|
1280
|
+
max_result_depth: number;
|
|
1281
|
+
};
|
|
1282
|
+
}>;
|
|
1283
|
+
/** List neighborhoods. Active neighborhoods in a city. */
|
|
1284
|
+
readonly neighborhoods: (city: string | number) => Promise<{
|
|
1285
|
+
data: {
|
|
1286
|
+
id: number;
|
|
1287
|
+
slug: string;
|
|
1288
|
+
name_ar: string;
|
|
1289
|
+
name_en: string;
|
|
1290
|
+
direction_id: unknown;
|
|
1291
|
+
center: unknown;
|
|
1292
|
+
}[];
|
|
1293
|
+
}>;
|
|
1294
|
+
};
|
|
1295
|
+
readonly transactions: {
|
|
1296
|
+
/**
|
|
1297
|
+
* Search registered deals. Individual sale deals registered with the Ministry of
|
|
1298
|
+
* Justice, from its quarterly open data, in one city: month, neighborhood,
|
|
1299
|
+
* land-use class, area, price and price per m².
|
|
1300
|
+
*/
|
|
1301
|
+
readonly search: (params: QueryOf<"transactions.search">) => Promise<{
|
|
1302
|
+
data: import("./openapi-zod/models.js").Transaction[];
|
|
1303
|
+
pagination: import("./openapi-zod/models.js").Pagination;
|
|
1304
|
+
price_source: string;
|
|
1305
|
+
coverage: import("./openapi-zod/models.js").TransactionCoverage;
|
|
1306
|
+
attribution: import("./openapi-zod/models.js").TransactionAttribution;
|
|
1307
|
+
}>;
|
|
1308
|
+
};
|
|
1309
|
+
};
|
|
1310
|
+
export type Endpoints = ReturnType<typeof createEndpoints>;
|
|
1311
|
+
export {};
|