@kite-sa/sdk 0.9.2 → 0.9.3

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
@@ -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.3
6
+
7
+ - `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.
8
+ - A project's `price` has `source`, the copy of the project the prices came from. `price` and `advertised_unit_count` are filled from another copy of the same project when the served one publishes none.
9
+
5
10
  ## 0.9.2
6
11
 
7
12
  - `parseWebhookEvent(header, body, secret)` from `@kite-sa/sdk/webhooks` verifies a delivery and returns its event typed by `type`; it throws `WebhookError` on a bad signature, a non-event body or an unknown type. `WebhookEvent`, `WebhookEventType`, `WEBHOOK_EVENT_TYPES` and the per-type event interfaces (`WebhookListingCreatedEvent`, …) are generated from the API's OpenAPI `webhooks` schemas. The README has a minimal receiver.
@@ -1456,9 +1456,16 @@ export declare function createEndpoints(request: Request): {
1456
1456
  to: string;
1457
1457
  unit_type: string | null;
1458
1458
  coverage: {
1459
+ source: string | null;
1459
1460
  first_snapshot: string | null;
1460
1461
  last_snapshot: string | null;
1461
1462
  snapshots: number;
1463
+ sources: {
1464
+ source: string;
1465
+ first_snapshot: string | null;
1466
+ last_snapshot: string | null;
1467
+ snapshots: number;
1468
+ }[];
1462
1469
  };
1463
1470
  points: {
1464
1471
  date: string;
@@ -1518,6 +1525,7 @@ export declare function createEndpoints(request: Request): {
1518
1525
  starting_sar: unknown;
1519
1526
  from_sar: unknown;
1520
1527
  to_sar: unknown;
1528
+ source: string | null;
1521
1529
  };
1522
1530
  area_sqm: {
1523
1531
  min: number | null;
@@ -1625,6 +1633,7 @@ export declare function createEndpoints(request: Request): {
1625
1633
  starting_sar: unknown;
1626
1634
  from_sar: unknown;
1627
1635
  to_sar: unknown;
1636
+ source: string | null;
1628
1637
  };
1629
1638
  area_sqm: {
1630
1639
  min: number | null;
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.2";
52
+ export declare const VERSION = "0.9.3";
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.2";
27
+ export const VERSION = "0.9.3";
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;
@@ -1622,6 +1622,7 @@ export declare function projectsSearch(params?: {
1622
1622
  starting_sar: unknown;
1623
1623
  from_sar: unknown;
1624
1624
  to_sar: unknown;
1625
+ source: string | null;
1625
1626
  };
1626
1627
  area_sqm: {
1627
1628
  min: number | null;
@@ -1679,6 +1680,7 @@ export declare function projectsGet(id: number, config?: Partial<ClientConfig>):
1679
1680
  starting_sar: unknown;
1680
1681
  from_sar: unknown;
1681
1682
  to_sar: unknown;
1683
+ source: string | null;
1682
1684
  };
1683
1685
  area_sqm: {
1684
1686
  min: number | null;
@@ -1835,6 +1837,7 @@ export declare function projectsAvailability(id: number, params?: {
1835
1837
  from?: string;
1836
1838
  to?: string;
1837
1839
  unitType?: string;
1840
+ source?: string;
1838
1841
  }, config?: Partial<ClientConfig>): Promise<{
1839
1842
  data: {
1840
1843
  project_id: number;
@@ -1843,9 +1846,16 @@ export declare function projectsAvailability(id: number, params?: {
1843
1846
  to: string;
1844
1847
  unit_type: string | null;
1845
1848
  coverage: {
1849
+ source: string | null;
1846
1850
  first_snapshot: string | null;
1847
1851
  last_snapshot: string | null;
1848
1852
  snapshots: number;
1853
+ sources: {
1854
+ source: string;
1855
+ first_snapshot: string | null;
1856
+ last_snapshot: string | null;
1857
+ snapshots: number;
1858
+ }[];
1849
1859
  };
1850
1860
  points: {
1851
1861
  date: string;
@@ -1319,6 +1319,8 @@ export async function projectsAvailability(id, params, config) {
1319
1319
  searchParams.set("to", String(params.to));
1320
1320
  if (params?.unitType != null)
1321
1321
  searchParams.set("unit_type", String(params.unitType));
1322
+ if (params?.source != null)
1323
+ searchParams.set("source", String(params.source));
1322
1324
  const res = await _request("GET", `/projects/${encodeURIComponent(id)}/availability`, { searchParams }, config);
1323
1325
  return res.json();
1324
1326
  }
package/dist/openapi.d.ts CHANGED
@@ -466,7 +466,7 @@ export interface operations {
466
466
  };
467
467
  "projects.availability": {
468
468
  parameters: {
469
- query?: Pick<SnakeKeys<NonNullable<Parameters<typeof import("./openapi-zod/client.js").projectsAvailability>[1]>>, "interval" | "from" | "to" | "unit_type">;
469
+ query?: Pick<SnakeKeys<NonNullable<Parameters<typeof import("./openapi-zod/client.js").projectsAvailability>[1]>>, "interval" | "from" | "to" | "unit_type" | "source">;
470
470
  };
471
471
  responses: {
472
472
  200: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kite-sa/sdk",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
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",