@kite-sa/sdk 0.9.3 → 0.9.4
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 +5 -0
- package/dist/generated.d.ts +53 -0
- package/dist/generated.js +7 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/openapi-zod/client.d.ts +58 -0
- package/dist/openapi-zod/client.js +17 -0
- package/dist/openapi.d.ts +12 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Formerly `@darak-app/sdk`, which is deprecated. Versions before 0.5.0 were published under that name.
|
|
4
4
|
|
|
5
|
+
## 0.9.4
|
|
6
|
+
|
|
7
|
+
- `projects.models(id)` lists a project's unit models: type, bedrooms, size, units in total and available, and the full and beneficiary price ranges of the available units (`GET /projects/{id}/models`).
|
|
8
|
+
- Absorption (`projects.absorption`, `market.absorption`) now measures Sakani projects; descriptions updated, no shape change.
|
|
9
|
+
|
|
5
10
|
## 0.9.3
|
|
6
11
|
|
|
7
12
|
- `projects.availability` takes `source` and returns `coverage.source` and `coverage.sources`: a project published by several sources is read from the one that counts available units, and any other can be asked for.
|
package/dist/generated.d.ts
CHANGED
|
@@ -1604,6 +1604,59 @@ export declare function createEndpoints(request: Request): {
|
|
|
1604
1604
|
};
|
|
1605
1605
|
};
|
|
1606
1606
|
}>;
|
|
1607
|
+
/**
|
|
1608
|
+
* List a project's unit models. The designs a project sells, one entry per
|
|
1609
|
+
* model: its type, bedrooms, size, how many units there are and how many are
|
|
1610
|
+
* still available, and the price range of the available ones, both the full
|
|
1611
|
+
* price and the price for a buyer eligible for housing support.
|
|
1612
|
+
*/
|
|
1613
|
+
readonly models: (id: string | number, params?: QueryOf<"projects.models">) => Promise<{
|
|
1614
|
+
data: {
|
|
1615
|
+
project_id: number;
|
|
1616
|
+
source: string | null;
|
|
1617
|
+
as_of: unknown;
|
|
1618
|
+
totals: {
|
|
1619
|
+
models: number;
|
|
1620
|
+
models_on_offer: number;
|
|
1621
|
+
units: unknown;
|
|
1622
|
+
units_available: unknown;
|
|
1623
|
+
};
|
|
1624
|
+
models: {
|
|
1625
|
+
id: number;
|
|
1626
|
+
name: string | null;
|
|
1627
|
+
unit_type: unknown;
|
|
1628
|
+
bedrooms: {
|
|
1629
|
+
min: unknown;
|
|
1630
|
+
max: unknown;
|
|
1631
|
+
};
|
|
1632
|
+
bathrooms: {
|
|
1633
|
+
min: unknown;
|
|
1634
|
+
max: unknown;
|
|
1635
|
+
};
|
|
1636
|
+
size_sqm: {
|
|
1637
|
+
min: number | null;
|
|
1638
|
+
max: number | null;
|
|
1639
|
+
basis: unknown;
|
|
1640
|
+
};
|
|
1641
|
+
price_sar: {
|
|
1642
|
+
min: unknown;
|
|
1643
|
+
max: unknown;
|
|
1644
|
+
};
|
|
1645
|
+
beneficiary_price_sar: {
|
|
1646
|
+
min: unknown;
|
|
1647
|
+
max: unknown;
|
|
1648
|
+
};
|
|
1649
|
+
units: {
|
|
1650
|
+
total: unknown;
|
|
1651
|
+
available: unknown;
|
|
1652
|
+
};
|
|
1653
|
+
on_offer: boolean;
|
|
1654
|
+
developer_model: unknown;
|
|
1655
|
+
first_seen_at: unknown;
|
|
1656
|
+
last_seen_at: unknown;
|
|
1657
|
+
}[];
|
|
1658
|
+
};
|
|
1659
|
+
}>;
|
|
1607
1660
|
/**
|
|
1608
1661
|
* Search projects. Off-plan and newly built residential and commercial projects
|
|
1609
1662
|
* from Saudi developers and portals, one entry per project (copies from several
|
package/dist/generated.js
CHANGED
|
@@ -358,6 +358,13 @@ export function createEndpoints(request) {
|
|
|
358
358
|
* financing banks and a summary of the units listed on Kite.
|
|
359
359
|
*/
|
|
360
360
|
get: (id) => request("GET", `/projects/${encodeURIComponent(String(id))}`),
|
|
361
|
+
/**
|
|
362
|
+
* List a project's unit models. The designs a project sells, one entry per
|
|
363
|
+
* model: its type, bedrooms, size, how many units there are and how many are
|
|
364
|
+
* still available, and the price range of the available ones, both the full
|
|
365
|
+
* price and the price for a buyer eligible for housing support.
|
|
366
|
+
*/
|
|
367
|
+
models: (id, params) => request("GET", `/projects/${encodeURIComponent(String(id))}/models`, { query: (params ?? {}) }),
|
|
361
368
|
/**
|
|
362
369
|
* Search projects. Off-plan and newly built residential and commercial projects
|
|
363
370
|
* from Saudi developers and portals, one entry per project (copies from several
|
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.9.
|
|
52
|
+
export declare const VERSION = "0.9.4";
|
|
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.9.
|
|
27
|
+
export const VERSION = "0.9.4";
|
|
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;
|
|
@@ -2092,6 +2092,64 @@ export declare function marketAbsorption(params?: {
|
|
|
2092
2092
|
}[];
|
|
2093
2093
|
};
|
|
2094
2094
|
}>;
|
|
2095
|
+
/**
|
|
2096
|
+
* @throws {ApiError<400, Error>}
|
|
2097
|
+
* @throws {ApiError<401, Error>}
|
|
2098
|
+
* @throws {ApiError<403, Error>}
|
|
2099
|
+
* @throws {ApiError<404, Error>}
|
|
2100
|
+
* @throws {ApiError<429, Error>}
|
|
2101
|
+
* @throws {ApiError<500, Error>}
|
|
2102
|
+
*/
|
|
2103
|
+
export declare function projectsModels(id: number, params?: {
|
|
2104
|
+
unitType?: "apartment" | "villa" | "townhouse";
|
|
2105
|
+
onOffer?: "true" | "false";
|
|
2106
|
+
}, config?: Partial<ClientConfig>): Promise<{
|
|
2107
|
+
data: {
|
|
2108
|
+
project_id: number;
|
|
2109
|
+
source: string | null;
|
|
2110
|
+
as_of: unknown;
|
|
2111
|
+
totals: {
|
|
2112
|
+
models: number;
|
|
2113
|
+
models_on_offer: number;
|
|
2114
|
+
units: unknown;
|
|
2115
|
+
units_available: unknown;
|
|
2116
|
+
};
|
|
2117
|
+
models: {
|
|
2118
|
+
id: number;
|
|
2119
|
+
name: string | null;
|
|
2120
|
+
unit_type: unknown;
|
|
2121
|
+
bedrooms: {
|
|
2122
|
+
min: unknown;
|
|
2123
|
+
max: unknown;
|
|
2124
|
+
};
|
|
2125
|
+
bathrooms: {
|
|
2126
|
+
min: unknown;
|
|
2127
|
+
max: unknown;
|
|
2128
|
+
};
|
|
2129
|
+
size_sqm: {
|
|
2130
|
+
min: number | null;
|
|
2131
|
+
max: number | null;
|
|
2132
|
+
basis: unknown;
|
|
2133
|
+
};
|
|
2134
|
+
price_sar: {
|
|
2135
|
+
min: unknown;
|
|
2136
|
+
max: unknown;
|
|
2137
|
+
};
|
|
2138
|
+
beneficiary_price_sar: {
|
|
2139
|
+
min: unknown;
|
|
2140
|
+
max: unknown;
|
|
2141
|
+
};
|
|
2142
|
+
units: {
|
|
2143
|
+
total: unknown;
|
|
2144
|
+
available: unknown;
|
|
2145
|
+
};
|
|
2146
|
+
on_offer: boolean;
|
|
2147
|
+
developer_model: unknown;
|
|
2148
|
+
first_seen_at: unknown;
|
|
2149
|
+
last_seen_at: unknown;
|
|
2150
|
+
}[];
|
|
2151
|
+
};
|
|
2152
|
+
}>;
|
|
2095
2153
|
/**
|
|
2096
2154
|
* @throws {ApiError<400, Error>}
|
|
2097
2155
|
* @throws {ApiError<401, Error>}
|
|
@@ -1461,6 +1461,23 @@ export async function marketAbsorption(params, config) {
|
|
|
1461
1461
|
const res = await _request("GET", "/market/absorption", { searchParams }, config);
|
|
1462
1462
|
return res.json();
|
|
1463
1463
|
}
|
|
1464
|
+
/**
|
|
1465
|
+
* @throws {ApiError<400, Error>}
|
|
1466
|
+
* @throws {ApiError<401, Error>}
|
|
1467
|
+
* @throws {ApiError<403, Error>}
|
|
1468
|
+
* @throws {ApiError<404, Error>}
|
|
1469
|
+
* @throws {ApiError<429, Error>}
|
|
1470
|
+
* @throws {ApiError<500, Error>}
|
|
1471
|
+
*/
|
|
1472
|
+
export async function projectsModels(id, params, config) {
|
|
1473
|
+
const searchParams = new URLSearchParams();
|
|
1474
|
+
if (params?.unitType != null)
|
|
1475
|
+
searchParams.set("unit_type", String(params.unitType));
|
|
1476
|
+
if (params?.onOffer != null)
|
|
1477
|
+
searchParams.set("on_offer", String(params.onOffer));
|
|
1478
|
+
const res = await _request("GET", `/projects/${encodeURIComponent(id)}/models`, { searchParams }, config);
|
|
1479
|
+
return res.json();
|
|
1480
|
+
}
|
|
1464
1481
|
/**
|
|
1465
1482
|
* @throws {ApiError<400, Error>}
|
|
1466
1483
|
* @throws {ApiError<401, Error>}
|
package/dist/openapi.d.ts
CHANGED
|
@@ -524,6 +524,18 @@ export interface operations {
|
|
|
524
524
|
};
|
|
525
525
|
};
|
|
526
526
|
};
|
|
527
|
+
"projects.models": {
|
|
528
|
+
parameters: {
|
|
529
|
+
query?: Pick<SnakeKeys<NonNullable<Parameters<typeof import("./openapi-zod/client.js").projectsModels>[1]>>, "unit_type" | "on_offer">;
|
|
530
|
+
};
|
|
531
|
+
responses: {
|
|
532
|
+
200: {
|
|
533
|
+
content: {
|
|
534
|
+
"application/json": Awaited<ReturnType<typeof import("./openapi-zod/client.js").projectsModels>>;
|
|
535
|
+
};
|
|
536
|
+
};
|
|
537
|
+
};
|
|
538
|
+
};
|
|
527
539
|
"exports.create": {
|
|
528
540
|
parameters: {
|
|
529
541
|
header?: Pick<HeaderKeys<NonNullable<Parameters<typeof import("./openapi-zod/client.js").exportsCreate>[1]>>, "Idempotency-Key">;
|