@kite-sa/sdk 0.0.0-stage → 0.6.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 +61 -0
- package/LICENSE +21 -0
- package/README.md +49 -2
- package/dist/generated.d.ts +1432 -0
- package/dist/generated.js +341 -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 +1888 -0
- package/dist/openapi-zod/client.js +1332 -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 +247 -0
- package/dist/openapi-zod/models.js +2 -0
- package/dist/openapi.d.ts +629 -0
- package/dist/openapi.js +1 -0
- package/package.json +47 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# @kite-sa/sdk
|
|
2
|
+
|
|
3
|
+
Formerly `@darak-app/sdk`, which is deprecated. Versions before 0.5.0 were published under that name.
|
|
4
|
+
|
|
5
|
+
## 0.6.0
|
|
6
|
+
|
|
7
|
+
- New methods for the endpoints added since 0.5.0:
|
|
8
|
+
`reference.coverage()` (`GET /coverage`: what the API can answer, per city and
|
|
9
|
+
property type), `analytics.belowMarket()` (`GET /market/below-market`: listings
|
|
10
|
+
priced below comparable ones) and `market.commercialRents()`
|
|
11
|
+
(`GET /market/commercial-rents`: commercial asking rent per m² by neighborhood).
|
|
12
|
+
- `analytics.deals()` (`GET /market/deals`) is deprecated in the API; use
|
|
13
|
+
`analytics.belowMarket()`.
|
|
14
|
+
- Response types follow the current spec, including `photo_features` on listings,
|
|
15
|
+
the price-basis labels and the constant-quality index in `/market/trends`.
|
|
16
|
+
- Package links point at the public docs; the issue link is `api@kite.sa`.
|
|
17
|
+
|
|
18
|
+
## 0.5.0
|
|
19
|
+
|
|
20
|
+
- **Renamed** from `@darak-app/sdk` to `@kite-sa/sdk` for the move to Kite. The client
|
|
21
|
+
class is `Kite` (was `Darak`), the error class `KiteError` (was `DarakError`), the
|
|
22
|
+
options type `KiteOptions`, and the key is read from `KITE_API_KEY` (was
|
|
23
|
+
`DARAK_API_KEY`). The default base URL is `https://api.kite.sa/v1`;
|
|
24
|
+
`https://api.darak.app/v1` keeps working, so pass it as `baseUrl` if you need it.
|
|
25
|
+
The `darak.read` scope is part of the API and unchanged. Webhook deliveries carry
|
|
26
|
+
`Kite-Signature`, `Kite-Event-Id`, … and still send the deprecated `Darak-*`
|
|
27
|
+
names with the same values. The SDK does not verify webhook signatures.
|
|
28
|
+
- Generate endpoint types with TypeScript-7-compatible `openapi-zod-ts` instead of
|
|
29
|
+
`openapi-typescript`. The SDK no longer exports the `paths` and `components`
|
|
30
|
+
type maps, and its `operations` type map has a narrower shape. Update
|
|
31
|
+
type-only consumers to use the exported `Listing`, `ListingSearchParams`,
|
|
32
|
+
`ListingCountParams`, `ListingPage`, and endpoint method types.
|
|
33
|
+
- Preserve the existing namespaced methods, snake_case query keys, comma-joined
|
|
34
|
+
arrays, authentication, retries, and `DarakError` at runtime. Organization
|
|
35
|
+
write methods now accept an optional `Idempotency-Key` header argument.
|
|
36
|
+
|
|
37
|
+
## 0.3.0
|
|
38
|
+
|
|
39
|
+
- Every endpoint in the API is now reachable. The client's namespaces are
|
|
40
|
+
generated from the OpenAPI spec, so `market`, `analytics`, `projects`,
|
|
41
|
+
`reference` and `organization` are all present and typed — previously the
|
|
42
|
+
surface was hand-written and covered 11 of 34 endpoints, which meant the
|
|
43
|
+
Growth and Pro tiers had no first-class methods at all. A test resolves every
|
|
44
|
+
`operationId` on a real client, so this cannot drift again.
|
|
45
|
+
- `cities.*` and `enums()` keep working; they are the 0.1.x names for what is
|
|
46
|
+
now `reference`.
|
|
47
|
+
- Requests send a `User-Agent` (`darak-js/<version>`) outside the browser, so
|
|
48
|
+
SDK traffic is identifiable in your request log.
|
|
49
|
+
- Ships a LICENSE, and links its repository and issue tracker from npm.
|
|
50
|
+
|
|
51
|
+
## 0.2.0
|
|
52
|
+
|
|
53
|
+
- Removed `brokerListings()`: `POST /broker-listings` was removed from the API.
|
|
54
|
+
|
|
55
|
+
## 0.1.1
|
|
56
|
+
|
|
57
|
+
- First automated release.
|
|
58
|
+
|
|
59
|
+
## 0.1.0
|
|
60
|
+
|
|
61
|
+
- Initial release.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Founderproof, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,50 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @kite-sa/sdk
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The official JavaScript and TypeScript client for the [Kite API](https://platform.kite.sa/docs): every live rental and sale listing in Saudi Arabia, deduplicated across 20+ sources.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install @kite-sa/sdk
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { Kite } from "@kite-sa/sdk";
|
|
11
|
+
|
|
12
|
+
const kite = new Kite(); // reads KITE_API_KEY
|
|
13
|
+
|
|
14
|
+
const page = await kite.listings.search({
|
|
15
|
+
city: "riyadh",
|
|
16
|
+
listing_type: "rent",
|
|
17
|
+
beds: 3,
|
|
18
|
+
limit: 25,
|
|
19
|
+
});
|
|
20
|
+
console.log(page.data[0]?.price.yearly_sar);
|
|
21
|
+
|
|
22
|
+
// Every result, fetching pages as you go (stops at your plan's paging depth).
|
|
23
|
+
for await (const listing of kite.listings.searchAll({ city: "jeddah", listing_type: "sale" })) {
|
|
24
|
+
console.log(listing.id, listing.location.neighborhood_name_en);
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Get a key at [platform.kite.sa](https://platform.kite.sa). Keys are secret: call the API from your servers, never from browsers.
|
|
29
|
+
|
|
30
|
+
## What you get
|
|
31
|
+
|
|
32
|
+
- Types for every parameter and response, generated from the API's OpenAPI spec.
|
|
33
|
+
- Retries for `429` and `5xx` (and network errors) that honor `Retry-After`. A monthly-quota `429` isn't waited out; it throws.
|
|
34
|
+
- `KiteError` with `status`, `code`, `message`, `param` and `requestId`. Branch on `code`; quote `requestId` to support.
|
|
35
|
+
|
|
36
|
+
- Namespaces generated from the API's OpenAPI spec, so they track it exactly:
|
|
37
|
+
`listings`, `market`, `analytics`, `projects`, `reference`, and `organization`
|
|
38
|
+
(admin keys). `listings.searchAll(...)` pages for you by following the cursor,
|
|
39
|
+
and `request(method, path, { query, body, headers })` reaches anything not yet wrapped.
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
const market = await kite.market.summary({ city: "riyadh", listing_type: "rent" });
|
|
43
|
+
const yields = await kite.analytics.rentalYield({ city: "jeddah", property_type: "apartment" });
|
|
44
|
+
const projects = await kite.projects.search({ city: "riyadh" });
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`cities.list / neighborhoods / directions` and `enums()` still work; they are the
|
|
48
|
+
0.1.x names for what is now `reference`.
|
|
49
|
+
|
|
50
|
+
Options: `new Kite({ apiKey, baseUrl, maxRetries: 2, timeoutMs: 30000, fetch })`. Needs Node 18+ (or any runtime with `fetch`).
|