@kite-sa/sdk 0.11.1 → 0.12.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 CHANGED
@@ -4,6 +4,14 @@ Formerly `@darak-app/sdk`, which is deprecated. Versions before 0.5.0 were publi
4
4
 
5
5
  Releases after 0.9.15 are written as change notes and added to this file when the package is published; in the source repository they can still be notes under `changes/`.
6
6
 
7
+ ## 0.12.0
8
+
9
+ - Neighborhoods (`reference.neighborhoods`) carry `official_district_id` and `official_districts`, the official MOMAH districts each maps to; listings, projects, project units, registered deals, registered rents and the neighborhood market rows carry `official_district_id` next to `neighborhood_id`.
10
+
11
+ ## 0.11.2
12
+
13
+ - Docs: the `max_age` filter on the listing, listing-count and advertiser calls is checked against building permits in every city, not only Riyadh; an age of 11 means more than 10 years.
14
+
7
15
  ## 0.11.1
8
16
 
9
17
  - `projects.search` takes `parent_project_id` (only the phases of that project) and returns `phase` (`parent_project_id` and `key`, the phase letter) on each project; `projects.get` returns `phase` and `phases` (a parent's phases, `project_id` and `key`, by letter).
@@ -49,6 +49,7 @@ export declare function createEndpoints(request: Request): {
49
49
  max_price_sar: number;
50
50
  top_neighborhoods: {
51
51
  neighborhood_id: number;
52
+ official_district_id: import("./openapi-zod/models.js").OfficialDistrictId;
52
53
  name_ar: string;
53
54
  name_en: string;
54
55
  listings: number;
@@ -209,6 +210,7 @@ export declare function createEndpoints(request: Request): {
209
210
  price_source: string;
210
211
  neighborhoods: {
211
212
  neighborhood_id: number;
213
+ official_district_id: import("./openapi-zod/models.js").OfficialDistrictId;
212
214
  name_en: string;
213
215
  name_ar: string;
214
216
  town: import("./openapi-zod/models.js").NeighborhoodTown;
@@ -276,6 +278,7 @@ export declare function createEndpoints(request: Request): {
276
278
  rent_sample_size: number;
277
279
  sale_sample_size: number;
278
280
  neighborhood_id: number;
281
+ official_district_id: import("./openapi-zod/models.js").OfficialDistrictId;
279
282
  name_en: string | null;
280
283
  name_ar: string | null;
281
284
  town: import("./openapi-zod/models.js").NeighborhoodTown;
@@ -309,6 +312,7 @@ export declare function createEndpoints(request: Request): {
309
312
  basis: string;
310
313
  series: {
311
314
  neighborhood_id: unknown;
315
+ official_district_id: import("./openapi-zod/models.js").OfficialDistrictId;
312
316
  name_en: string | null;
313
317
  name_ar: string | null;
314
318
  town: import("./openapi-zod/models.js").NeighborhoodTown;
@@ -441,6 +445,7 @@ export declare function createEndpoints(request: Request): {
441
445
  groups: {
442
446
  city: string | null;
443
447
  neighborhood_id: unknown;
448
+ official_district_id: import("./openapi-zod/models.js").OfficialDistrictId;
444
449
  neighborhood_name_ar: string | null;
445
450
  neighborhood_name_en: string | null;
446
451
  developer: string | null;
@@ -662,6 +667,7 @@ export declare function createEndpoints(request: Request): {
662
667
  }[];
663
668
  neighborhoods: {
664
669
  neighborhood_id: number;
670
+ official_district_id: import("./openapi-zod/models.js").OfficialDistrictId;
665
671
  name_ar: string;
666
672
  name_en: string;
667
673
  town: import("./openapi-zod/models.js").NeighborhoodTown;
@@ -789,6 +795,7 @@ export declare function createEndpoints(request: Request): {
789
795
  min_sample_size: number;
790
796
  neighborhoods: {
791
797
  neighborhood_id: number;
798
+ official_district_id: import("./openapi-zod/models.js").OfficialDistrictId;
792
799
  name_ar: string;
793
800
  name_en: string;
794
801
  town: import("./openapi-zod/models.js").NeighborhoodTown;
@@ -890,6 +897,7 @@ export declare function createEndpoints(request: Request): {
890
897
  }[];
891
898
  top_neighborhoods: {
892
899
  neighborhood_id: number;
900
+ official_district_id: import("./openapi-zod/models.js").OfficialDistrictId;
893
901
  name_ar: string;
894
902
  name_en: string;
895
903
  town: import("./openapi-zod/models.js").NeighborhoodTown;
@@ -1106,6 +1114,7 @@ export declare function createEndpoints(request: Request): {
1106
1114
  min_sample_size: number;
1107
1115
  cells: {
1108
1116
  neighborhood_id: unknown;
1117
+ official_district_id: import("./openapi-zod/models.js").OfficialDistrictId;
1109
1118
  neighborhood_name_ar: string;
1110
1119
  neighborhood_name_en: string | null;
1111
1120
  town_ar: string;
@@ -1593,6 +1602,7 @@ export declare function createEndpoints(request: Request): {
1593
1602
  city: string | null;
1594
1603
  city_name_en: string | null;
1595
1604
  neighborhood_id: unknown;
1605
+ official_district_id: import("./openapi-zod/models.js").OfficialDistrictId;
1596
1606
  neighborhood_name_ar: string | null;
1597
1607
  neighborhood_name_en: string | null;
1598
1608
  lat: number | null;
@@ -1828,6 +1838,7 @@ export declare function createEndpoints(request: Request): {
1828
1838
  city: string | null;
1829
1839
  city_name_en: string | null;
1830
1840
  neighborhood_id: unknown;
1841
+ official_district_id: import("./openapi-zod/models.js").OfficialDistrictId;
1831
1842
  neighborhood_name_ar: string | null;
1832
1843
  neighborhood_name_en: string | null;
1833
1844
  lat: number | null;
@@ -1901,6 +1912,7 @@ export declare function createEndpoints(request: Request): {
1901
1912
  city: string | null;
1902
1913
  city_name_en: string | null;
1903
1914
  neighborhood_id: unknown;
1915
+ official_district_id: import("./openapi-zod/models.js").OfficialDistrictId;
1904
1916
  neighborhood_name_ar: string | null;
1905
1917
  neighborhood_name_en: string | null;
1906
1918
  lat: number | null;
@@ -1948,6 +1960,7 @@ export declare function createEndpoints(request: Request): {
1948
1960
  city: string | null;
1949
1961
  city_name_en: string | null;
1950
1962
  neighborhood_id: unknown;
1963
+ official_district_id: import("./openapi-zod/models.js").OfficialDistrictId;
1951
1964
  neighborhood_name_ar: string | null;
1952
1965
  neighborhood_name_en: string | null;
1953
1966
  lat: number | null;
@@ -2094,7 +2107,11 @@ export declare function createEndpoints(request: Request): {
2094
2107
  max_result_depth: number;
2095
2108
  };
2096
2109
  }>;
2097
- /** List neighborhoods. Active neighborhoods in a city. */
2110
+ /**
2111
+ * List neighborhoods. Active neighborhoods in a city, with the official MOMAH
2112
+ * district(s) each maps to (`official_districts`), for joining Kite data to data
2113
+ * keyed by official districts.
2114
+ */
2098
2115
  readonly neighborhoods: (city: string | number) => Promise<{
2099
2116
  data: {
2100
2117
  id: number;
@@ -2104,6 +2121,8 @@ export declare function createEndpoints(request: Request): {
2104
2121
  direction_id: unknown;
2105
2122
  town: import("./openapi-zod/models.js").NeighborhoodTown;
2106
2123
  center: unknown;
2124
+ official_district_id: import("./openapi-zod/models.js").OfficialDistrictId;
2125
+ official_districts: import("./openapi-zod/models.js").OfficialDistrict[];
2107
2126
  }[];
2108
2127
  }>;
2109
2128
  /** List towns. The towns a city is made of, for the `town` filter. */
package/dist/generated.js CHANGED
@@ -415,7 +415,11 @@ export function createEndpoints(request) {
415
415
  * reach.
416
416
  */
417
417
  limits: () => request("GET", "/limits"),
418
- /** List neighborhoods. Active neighborhoods in a city. */
418
+ /**
419
+ * List neighborhoods. Active neighborhoods in a city, with the official MOMAH
420
+ * district(s) each maps to (`official_districts`), for joining Kite data to data
421
+ * keyed by official districts.
422
+ */
419
423
  neighborhoods: (city) => request("GET", `/cities/${encodeURIComponent(String(city))}/neighborhoods`),
420
424
  /** List towns. The towns a city is made of, for the `town` filter. */
421
425
  towns: (city) => request("GET", `/cities/${encodeURIComponent(String(city))}/towns`),
package/dist/index.d.ts CHANGED
@@ -49,7 +49,7 @@ export interface KiteOptions {
49
49
  }
50
50
  type Query = Record<string, string | number | boolean | readonly (string | number)[] | undefined>;
51
51
  /** Kept in step with package.json by src/index.test.ts. */
52
- export declare const VERSION = "0.11.1";
52
+ export declare const VERSION = "0.12.0";
53
53
  /** Arrays go comma-separated, as the API expects; unset values are dropped. */
54
54
  export declare function toSearchParams(query?: Query): string;
55
55
  /**
package/dist/index.js CHANGED
@@ -24,7 +24,7 @@ export class KiteError extends Error {
24
24
  }
25
25
  }
26
26
  /** Kept in step with package.json by src/index.test.ts. */
27
- export const VERSION = "0.11.1";
27
+ export const VERSION = "0.12.0";
28
28
  const USER_AGENT = `kite-sa-js/${VERSION}`;
29
29
  /** Longest Retry-After worth waiting for; anything longer (a monthly quota) throws. */
30
30
  const MAX_RETRY_WAIT_S = 60;
@@ -1,4 +1,4 @@
1
- import type { CoverageFlag, Export, ExportRequest, Listing, NeighborhoodTown, Pagination, Transaction, TransactionAttribution, TransactionCoverage, TransactionCoverageFlag } from "./models.js";
1
+ import type { CoverageFlag, Export, ExportRequest, Listing, NeighborhoodTown, OfficialDistrict, OfficialDistrictId, Pagination, Transaction, TransactionAttribution, TransactionCoverage, TransactionCoverageFlag } from "./models.js";
2
2
  import { type ClientConfig } from "./client-config.js";
3
3
  export declare class ApiError<Status extends number = number, Body = unknown> extends Error {
4
4
  readonly status: Status;
@@ -36,6 +36,8 @@ export declare function referenceNeighborhoods(city: string, config?: Partial<Cl
36
36
  direction_id: unknown;
37
37
  town: NeighborhoodTown;
38
38
  center: unknown;
39
+ official_district_id: OfficialDistrictId;
40
+ official_districts: OfficialDistrict[];
39
41
  }[];
40
42
  }>;
41
43
  /**
@@ -410,6 +412,7 @@ export declare function marketSummary(params: {
410
412
  }[];
411
413
  top_neighborhoods: {
412
414
  neighborhood_id: number;
415
+ official_district_id: OfficialDistrictId;
413
416
  name_ar: string;
414
417
  name_en: string;
415
418
  town: NeighborhoodTown;
@@ -669,6 +672,7 @@ export declare function marketNeighborhoods(params: {
669
672
  min_sample_size: number;
670
673
  neighborhoods: {
671
674
  neighborhood_id: number;
675
+ official_district_id: OfficialDistrictId;
672
676
  name_ar: string;
673
677
  name_en: string;
674
678
  town: NeighborhoodTown;
@@ -744,6 +748,7 @@ export declare function marketCommercialRents(params: {
744
748
  }[];
745
749
  neighborhoods: {
746
750
  neighborhood_id: number;
751
+ official_district_id: OfficialDistrictId;
747
752
  name_ar: string;
748
753
  name_en: string;
749
754
  town: NeighborhoodTown;
@@ -944,6 +949,7 @@ export declare function officialRegisteredRents(params: {
944
949
  min_sample_size: number;
945
950
  cells: {
946
951
  neighborhood_id: unknown;
952
+ official_district_id: OfficialDistrictId;
947
953
  neighborhood_name_ar: string;
948
954
  neighborhood_name_en: string | null;
949
955
  town_ar: string;
@@ -1242,6 +1248,7 @@ export declare function analyticsRentalYield(params: {
1242
1248
  rent_sample_size: number;
1243
1249
  sale_sample_size: number;
1244
1250
  neighborhood_id: number;
1251
+ official_district_id: OfficialDistrictId;
1245
1252
  name_en: string | null;
1246
1253
  name_ar: string | null;
1247
1254
  town: NeighborhoodTown;
@@ -1285,6 +1292,7 @@ export declare function analyticsTrends(params: {
1285
1292
  basis: string;
1286
1293
  series: {
1287
1294
  neighborhood_id: unknown;
1295
+ official_district_id: OfficialDistrictId;
1288
1296
  name_en: string | null;
1289
1297
  name_ar: string | null;
1290
1298
  town: NeighborhoodTown;
@@ -1339,6 +1347,7 @@ export declare function analyticsNeighborhoodsCompare(params: {
1339
1347
  price_source: string;
1340
1348
  neighborhoods: {
1341
1349
  neighborhood_id: number;
1350
+ official_district_id: OfficialDistrictId;
1342
1351
  name_en: string;
1343
1352
  name_ar: string;
1344
1353
  town: NeighborhoodTown;
@@ -1451,6 +1460,7 @@ export declare function analyticsAdvertisers(params: {
1451
1460
  max_price_sar: number;
1452
1461
  top_neighborhoods: {
1453
1462
  neighborhood_id: number;
1463
+ official_district_id: OfficialDistrictId;
1454
1464
  name_ar: string;
1455
1465
  name_en: string;
1456
1466
  listings: number;
@@ -1705,6 +1715,7 @@ export declare function projectsSearch(params?: {
1705
1715
  city: string | null;
1706
1716
  city_name_en: string | null;
1707
1717
  neighborhood_id: unknown;
1718
+ official_district_id: OfficialDistrictId;
1708
1719
  neighborhood_name_ar: string | null;
1709
1720
  neighborhood_name_en: string | null;
1710
1721
  lat: number | null;
@@ -1771,6 +1782,7 @@ export declare function projectsGet(id: number, config?: Partial<ClientConfig>):
1771
1782
  city: string | null;
1772
1783
  city_name_en: string | null;
1773
1784
  neighborhood_id: unknown;
1785
+ official_district_id: OfficialDistrictId;
1774
1786
  neighborhood_name_ar: string | null;
1775
1787
  neighborhood_name_en: string | null;
1776
1788
  lat: number | null;
@@ -1920,6 +1932,7 @@ export declare function projectsUnits(id: number, params?: {
1920
1932
  city: string | null;
1921
1933
  city_name_en: string | null;
1922
1934
  neighborhood_id: unknown;
1935
+ official_district_id: OfficialDistrictId;
1923
1936
  neighborhood_name_ar: string | null;
1924
1937
  neighborhood_name_en: string | null;
1925
1938
  lat: number | null;
@@ -2048,6 +2061,7 @@ export declare function projectsUnitsSearch(params?: {
2048
2061
  city: string | null;
2049
2062
  city_name_en: string | null;
2050
2063
  neighborhood_id: unknown;
2064
+ official_district_id: OfficialDistrictId;
2051
2065
  neighborhood_name_ar: string | null;
2052
2066
  neighborhood_name_en: string | null;
2053
2067
  lat: number | null;
@@ -2221,6 +2235,7 @@ export declare function marketAbsorption(params?: {
2221
2235
  groups: {
2222
2236
  city: string | null;
2223
2237
  neighborhood_id: unknown;
2238
+ official_district_id: OfficialDistrictId;
2224
2239
  neighborhood_name_ar: string | null;
2225
2240
  neighborhood_name_en: string | null;
2226
2241
  developer: string | null;
@@ -137,6 +137,7 @@ export interface Listing {
137
137
  city: string | null;
138
138
  city_name_en: string | null;
139
139
  neighborhood_id: number | null;
140
+ official_district_id: OfficialDistrictId;
140
141
  neighborhood_name_ar: string | null;
141
142
  neighborhood_name_en: string | null;
142
143
  lat: number | null;
@@ -253,6 +254,17 @@ export type NeighborhoodTown = {
253
254
  name_en: string;
254
255
  name_ar: string;
255
256
  } | null;
257
+ export interface OfficialDistrict {
258
+ id: string;
259
+ relation: "match" | "within";
260
+ name_ar: string | null;
261
+ name_en: string | null;
262
+ municipality_id: string | null;
263
+ municipality_name_ar: string | null;
264
+ municipality_name_en: string | null;
265
+ amana_id: string | null;
266
+ }
267
+ export type OfficialDistrictId = string | null;
256
268
  export interface Pagination {
257
269
  limit: number;
258
270
  next_cursor: string | null;
@@ -358,6 +370,7 @@ export interface TransactionExportFilters {
358
370
  }
359
371
  export interface TransactionNeighborhood {
360
372
  id: number;
373
+ official_district_id: OfficialDistrictId;
361
374
  name_ar: string;
362
375
  name_en: string;
363
376
  town: NeighborhoodTown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kite-sa/sdk",
3
- "version": "0.11.1",
3
+ "version": "0.12.0",
4
4
  "description": "Official JavaScript/TypeScript client for the Kite API: Saudi real-estate listings and market data.",
5
5
  "license": "MIT",
6
6
  "type": "module",