@kite-sa/sdk 0.9.13 → 0.9.15
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 +9 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/openapi-zod/models.d.ts +51 -0
- package/dist/webhooks.d.ts +4 -4
- package/dist/webhooks.js +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
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.15
|
|
6
|
+
|
|
7
|
+
- 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`.
|
|
8
|
+
|
|
9
|
+
## 0.9.14
|
|
10
|
+
|
|
11
|
+
- 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.
|
|
12
|
+
- Correction to 0.9.13: `city: "eastern_province"` and `city: "qassim"` (deprecated) read the whole administrative region, the same as `region`. For Eastern Province that includes Al Ahsa, Hafar Al Batin and Al Qaysumah, which they did not include before.
|
|
13
|
+
|
|
5
14
|
## 0.9.13
|
|
6
15
|
|
|
7
16
|
- `region` on `listings.search`, `listings.count`, `analytics.advertisers` and the market statistics that read listings (`market.summary`, `market.priceDistribution`, `market.areaDistribution`, `market.supply`, `market.vacancy`, `market.neighborhoods`): one of the 13 administrative regions (`"eastern_province"`, `"riyadh_region"`…), in place of `city`. `city` is optional on those calls; pass one of the two. The market responses' `filters` carry `region`, and `filters.city` is `string | null` (null for a region).
|
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.15";
|
|
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.15";
|
|
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;
|
|
@@ -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;
|
package/dist/webhooks.d.ts
CHANGED
|
@@ -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
|