@kite-sa/sdk 0.9.14 → 0.9.16

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,16 @@
2
2
 
3
3
  Formerly `@darak-app/sdk`, which is deprecated. Versions before 0.5.0 were published under that name.
4
4
 
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
+
7
+ ## 0.9.16
8
+
9
+ - `projects.absorption` returns `average_since_launch` (Sakani's booked units per unit type ÷ months since sales began, an average over the whole life of the sales, never an observed month, with `launch_basis`, the observed change in the booked count and `flags`) and `neighborhood_deeds` (home sale deeds registered in the project's neighbourhood by month over the last 24 full months). `projects.models` returns `totals.average_since_launch`. `sell_through.launch_basis` can be `"sales_start_date"`.
10
+
11
+ ## 0.9.15
12
+
13
+ - Webhook project events `project.withdrawn_from_sale` (a project's units taken off sale with few of them booked: not a sell-out) and `project.returned_to_sale` (a withdrawn project with units on sale again), typed (`WebhookProjectWithdrawnFromSaleEvent`, `WebhookProjectReturnedToSaleEvent`) and accepted by `parseWebhookEvent`.
14
+
5
15
  ## 0.9.14
6
16
 
7
17
  - Documentation only: regenerated from the API spec, in which Eastern Province's and Qassim's towns (Dammam, Khobar, Jubail, Buraidah, Unaizah…) are cities of their own from 2026-11-28. No type changed.
@@ -1447,6 +1447,36 @@ export declare function createEndpoints(request: Request): {
1447
1447
  usable_months: number;
1448
1448
  units_gone_per_month: number | null;
1449
1449
  months_of_stock: number | null;
1450
+ average_since_launch: {
1451
+ source: string | null;
1452
+ as_of: string | null;
1453
+ launch_date: string | null;
1454
+ launch_basis: unknown;
1455
+ months_since_launch: number | null;
1456
+ first_unit_listed: string | null;
1457
+ units_booked: unknown;
1458
+ units_available: unknown;
1459
+ units_released: unknown;
1460
+ units_in_project: unknown;
1461
+ units_booked_per_month: number | null;
1462
+ units_booked_per_month_since_first_unit: number | null;
1463
+ by_unit_type: {
1464
+ unit_type: string;
1465
+ units_booked: number;
1466
+ units_available: number;
1467
+ units_booked_per_month: number | null;
1468
+ observed_units_booked_change: unknown;
1469
+ }[];
1470
+ observed: {
1471
+ from: string | null;
1472
+ to: string | null;
1473
+ days: unknown;
1474
+ units_booked_change: unknown;
1475
+ units_booked_per_month: number | null;
1476
+ };
1477
+ reliability: string;
1478
+ flags: string[];
1479
+ };
1450
1480
  months: {
1451
1481
  month: string;
1452
1482
  window_start: string | null;
@@ -1483,6 +1513,7 @@ export declare function createEndpoints(request: Request): {
1483
1513
  units_gone_per_month_since_launch: number | null;
1484
1514
  reliability: string;
1485
1515
  };
1516
+ neighborhood_deeds: unknown;
1486
1517
  };
1487
1518
  }>;
1488
1519
  /**
@@ -1675,6 +1706,36 @@ export declare function createEndpoints(request: Request): {
1675
1706
  source: string | null;
1676
1707
  as_of: string | null;
1677
1708
  };
1709
+ average_since_launch: {
1710
+ source: string | null;
1711
+ as_of: string | null;
1712
+ launch_date: string | null;
1713
+ launch_basis: unknown;
1714
+ months_since_launch: number | null;
1715
+ first_unit_listed: string | null;
1716
+ units_booked: unknown;
1717
+ units_available: unknown;
1718
+ units_released: unknown;
1719
+ units_in_project: unknown;
1720
+ units_booked_per_month: number | null;
1721
+ units_booked_per_month_since_first_unit: number | null;
1722
+ by_unit_type: {
1723
+ unit_type: string;
1724
+ units_booked: number;
1725
+ units_available: number;
1726
+ units_booked_per_month: number | null;
1727
+ observed_units_booked_change: unknown;
1728
+ }[];
1729
+ observed: {
1730
+ from: string | null;
1731
+ to: string | null;
1732
+ days: unknown;
1733
+ units_booked_change: unknown;
1734
+ units_booked_per_month: number | null;
1735
+ };
1736
+ reliability: string;
1737
+ flags: string[];
1738
+ };
1678
1739
  left_market: {
1679
1740
  units_booked: number;
1680
1741
  units_unconfirmed: number;
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.14";
52
+ export declare const VERSION = "0.9.16";
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.14";
27
+ export const VERSION = "0.9.16";
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;
@@ -2060,6 +2060,36 @@ export declare function projectsAbsorption(id: number, params?: {
2060
2060
  usable_months: number;
2061
2061
  units_gone_per_month: number | null;
2062
2062
  months_of_stock: number | null;
2063
+ average_since_launch: {
2064
+ source: string | null;
2065
+ as_of: string | null;
2066
+ launch_date: string | null;
2067
+ launch_basis: unknown;
2068
+ months_since_launch: number | null;
2069
+ first_unit_listed: string | null;
2070
+ units_booked: unknown;
2071
+ units_available: unknown;
2072
+ units_released: unknown;
2073
+ units_in_project: unknown;
2074
+ units_booked_per_month: number | null;
2075
+ units_booked_per_month_since_first_unit: number | null;
2076
+ by_unit_type: {
2077
+ unit_type: string;
2078
+ units_booked: number;
2079
+ units_available: number;
2080
+ units_booked_per_month: number | null;
2081
+ observed_units_booked_change: unknown;
2082
+ }[];
2083
+ observed: {
2084
+ from: string | null;
2085
+ to: string | null;
2086
+ days: unknown;
2087
+ units_booked_change: unknown;
2088
+ units_booked_per_month: number | null;
2089
+ };
2090
+ reliability: string;
2091
+ flags: string[];
2092
+ };
2063
2093
  months: {
2064
2094
  month: string;
2065
2095
  window_start: string | null;
@@ -2096,6 +2126,7 @@ export declare function projectsAbsorption(id: number, params?: {
2096
2126
  units_gone_per_month_since_launch: number | null;
2097
2127
  reliability: string;
2098
2128
  };
2129
+ neighborhood_deeds: unknown;
2099
2130
  };
2100
2131
  }>;
2101
2132
  /**
@@ -2213,6 +2244,36 @@ export declare function projectsModels(id: number, params?: {
2213
2244
  source: string | null;
2214
2245
  as_of: string | null;
2215
2246
  };
2247
+ average_since_launch: {
2248
+ source: string | null;
2249
+ as_of: string | null;
2250
+ launch_date: string | null;
2251
+ launch_basis: unknown;
2252
+ months_since_launch: number | null;
2253
+ first_unit_listed: string | null;
2254
+ units_booked: unknown;
2255
+ units_available: unknown;
2256
+ units_released: unknown;
2257
+ units_in_project: unknown;
2258
+ units_booked_per_month: number | null;
2259
+ units_booked_per_month_since_first_unit: number | null;
2260
+ by_unit_type: {
2261
+ unit_type: string;
2262
+ units_booked: number;
2263
+ units_available: number;
2264
+ units_booked_per_month: number | null;
2265
+ observed_units_booked_change: unknown;
2266
+ }[];
2267
+ observed: {
2268
+ from: string | null;
2269
+ to: string | null;
2270
+ days: unknown;
2271
+ units_booked_change: unknown;
2272
+ units_booked_per_month: number | null;
2273
+ };
2274
+ reliability: string;
2275
+ flags: string[];
2276
+ };
2216
2277
  left_market: {
2217
2278
  units_booked: number;
2218
2279
  units_unconfirmed: number;
@@ -546,6 +546,31 @@ export interface WebhookProjectPriceData {
546
546
  previous_starting_price_sar: number;
547
547
  change_pct: number;
548
548
  }
549
+ export interface WebhookProjectReturnedData {
550
+ project_id: number;
551
+ name_ar: string | null;
552
+ name_en: string | null;
553
+ developer: string | null;
554
+ city: string | null;
555
+ town: {
556
+ slug: string;
557
+ name_en: string;
558
+ name_ar: string;
559
+ } | null;
560
+ neighborhood_en: string | null;
561
+ neighborhood_ar: string | null;
562
+ occurred_on: string;
563
+ source: string;
564
+ url: string | null;
565
+ available_units: number;
566
+ }
567
+ export interface WebhookProjectReturnedToSaleEvent {
568
+ id: string;
569
+ type: "project.returned_to_sale";
570
+ created: string;
571
+ data: WebhookProjectReturnedData;
572
+ test?: true;
573
+ }
549
574
  export interface WebhookProjectSoldOutData {
550
575
  project_id: number;
551
576
  name_ar: string | null;
@@ -598,6 +623,32 @@ export interface WebhookProjectStatusData {
598
623
  status: "available" | "coming_soon" | "not_started" | "under_construction" | "completed" | "sold_out";
599
624
  previous_status: "available" | "coming_soon" | "not_started" | "under_construction" | "completed" | "sold_out";
600
625
  }
626
+ export interface WebhookProjectWithdrawnData {
627
+ project_id: number;
628
+ name_ar: string | null;
629
+ name_en: string | null;
630
+ developer: string | null;
631
+ city: string | null;
632
+ town: {
633
+ slug: string;
634
+ name_en: string;
635
+ name_ar: string;
636
+ } | null;
637
+ neighborhood_en: string | null;
638
+ neighborhood_ar: string | null;
639
+ occurred_on: string;
640
+ source: string;
641
+ url: string | null;
642
+ previous_available_units: number | null;
643
+ booked_change: number | null;
644
+ }
645
+ export interface WebhookProjectWithdrawnFromSaleEvent {
646
+ id: string;
647
+ type: "project.withdrawn_from_sale";
648
+ created: string;
649
+ data: WebhookProjectWithdrawnData;
650
+ test?: true;
651
+ }
601
652
  export interface WebhookUpdatedListingData {
602
653
  listing_id: number;
603
654
  city: string | null;
@@ -1,10 +1,10 @@
1
- import type { WebhookListingCreatedEvent, WebhookListingDelistedEvent, WebhookListingPriceChangedEvent, WebhookListingRelistedEvent, WebhookListingUpdatedEvent, WebhookProjectCreatedEvent, WebhookProjectHandoverChangedEvent, WebhookProjectLicenceIssuedEvent, WebhookProjectPriceChangedEvent, WebhookProjectSoldOutEvent, WebhookProjectStatusChangedEvent } from "./openapi-zod/models.js";
2
- export type { WebhookListingCreatedEvent, WebhookListingData, WebhookListingDelistedEvent, WebhookListingPriceChangedEvent, WebhookListingRelistedEvent, WebhookListingUpdatedEvent, WebhookPriceChangedListingData, WebhookProjectCreatedEvent, WebhookProjectData, WebhookProjectHandoverChangedEvent, WebhookProjectHandoverData, WebhookProjectLicenceData, WebhookProjectLicenceIssuedEvent, WebhookProjectPriceChangedEvent, WebhookProjectPriceData, WebhookProjectSoldOutData, WebhookProjectSoldOutEvent, WebhookProjectStatusChangedEvent, WebhookProjectStatusData, WebhookUpdatedListingData, } from "./openapi-zod/models.js";
1
+ import type { WebhookListingCreatedEvent, WebhookListingDelistedEvent, WebhookListingPriceChangedEvent, WebhookListingRelistedEvent, WebhookListingUpdatedEvent, WebhookProjectCreatedEvent, WebhookProjectHandoverChangedEvent, WebhookProjectLicenceIssuedEvent, WebhookProjectPriceChangedEvent, WebhookProjectReturnedToSaleEvent, WebhookProjectSoldOutEvent, WebhookProjectStatusChangedEvent, WebhookProjectWithdrawnFromSaleEvent } from "./openapi-zod/models.js";
2
+ export type { WebhookListingCreatedEvent, WebhookListingData, WebhookListingDelistedEvent, WebhookListingPriceChangedEvent, WebhookListingRelistedEvent, WebhookListingUpdatedEvent, WebhookPriceChangedListingData, WebhookProjectCreatedEvent, WebhookProjectData, WebhookProjectHandoverChangedEvent, WebhookProjectHandoverData, WebhookProjectLicenceData, WebhookProjectLicenceIssuedEvent, WebhookProjectPriceChangedEvent, WebhookProjectPriceData, WebhookProjectReturnedData, WebhookProjectReturnedToSaleEvent, WebhookProjectSoldOutData, WebhookProjectSoldOutEvent, WebhookProjectStatusChangedEvent, WebhookProjectStatusData, WebhookProjectWithdrawnData, WebhookProjectWithdrawnFromSaleEvent, WebhookUpdatedListingData, } from "./openapi-zod/models.js";
3
3
  /** Any event Kite delivers, discriminated on `type`. */
4
- export type WebhookEvent = WebhookListingCreatedEvent | WebhookListingPriceChangedEvent | WebhookListingUpdatedEvent | WebhookListingDelistedEvent | WebhookListingRelistedEvent | WebhookProjectCreatedEvent | WebhookProjectLicenceIssuedEvent | WebhookProjectStatusChangedEvent | WebhookProjectPriceChangedEvent | WebhookProjectSoldOutEvent | WebhookProjectHandoverChangedEvent;
4
+ export type WebhookEvent = WebhookListingCreatedEvent | WebhookListingPriceChangedEvent | WebhookListingUpdatedEvent | WebhookListingDelistedEvent | WebhookListingRelistedEvent | WebhookProjectCreatedEvent | WebhookProjectLicenceIssuedEvent | WebhookProjectStatusChangedEvent | WebhookProjectPriceChangedEvent | WebhookProjectSoldOutEvent | WebhookProjectHandoverChangedEvent | WebhookProjectWithdrawnFromSaleEvent | WebhookProjectReturnedToSaleEvent;
5
5
  export type WebhookEventType = WebhookEvent["type"];
6
6
  /** Every event type this version of the SDK knows. */
7
- export declare const WEBHOOK_EVENT_TYPES: readonly ["listing.created", "listing.price_changed", "listing.updated", "listing.delisted", "listing.relisted", "project.created", "project.licence_issued", "project.status_changed", "project.price_changed", "project.sold_out", "project.handover_changed"];
7
+ export declare const WEBHOOK_EVENT_TYPES: readonly ["listing.created", "listing.price_changed", "listing.updated", "listing.delisted", "listing.relisted", "project.created", "project.licence_issued", "project.status_changed", "project.price_changed", "project.sold_out", "project.handover_changed", "project.withdrawn_from_sale", "project.returned_to_sale"];
8
8
  /**
9
9
  * Header Kite signs each webhook delivery with. Deliveries also carry the
10
10
  * deprecated `Darak-Signature` with the same value; either verifies.
package/dist/webhooks.js CHANGED
@@ -12,6 +12,8 @@ export const WEBHOOK_EVENT_TYPES = [
12
12
  "project.price_changed",
13
13
  "project.sold_out",
14
14
  "project.handover_changed",
15
+ "project.withdrawn_from_sale",
16
+ "project.returned_to_sale",
15
17
  ];
16
18
  /**
17
19
  * Header Kite signs each webhook delivery with. Deliveries also carry the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kite-sa/sdk",
3
- "version": "0.9.14",
3
+ "version": "0.9.16",
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",