@dealcrawl/sdk 2.11.0 → 2.11.1
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/README.md +23 -0
- package/dist/index.d.mts +32 -27
- package/dist/index.d.ts +32 -27
- package/dist/index.js +40 -46
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -46
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,6 +6,29 @@ Official TypeScript SDK for the DealCrawl web scraping and crawling API.
|
|
|
6
6
|
[](https://www.typescriptlang.org/)
|
|
7
7
|
[](https://opensource.org/licenses/MIT)
|
|
8
8
|
|
|
9
|
+
## What's New in v2.11.1 (January 2026) 🐛
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
- **DataResource**: Fixed syntax error in `getDealsByCategory()` method (unclosed docstring + duplicate line)
|
|
14
|
+
- **SDK-API Alignment**: Verified 87% endpoint coverage with detailed alignment report
|
|
15
|
+
|
|
16
|
+
### Known Gaps
|
|
17
|
+
|
|
18
|
+
The following API endpoints do not have SDK methods yet (see [API-SDK Alignment Report](../../docs/API-SDK-ALIGNMENT-REPORT.md)):
|
|
19
|
+
|
|
20
|
+
- `GET /v1/status/:jobId/errors` - Get job errors
|
|
21
|
+
- `GET /v1/data/jobs/:jobId` - Get full job details
|
|
22
|
+
- `GET /v1/data/jobs/:jobId/result` - Get job result
|
|
23
|
+
- `GET /v1/data/jobs/:jobId/export` - Export job in multiple formats
|
|
24
|
+
- `POST /v1/webhooks/:id/rotate` - Rotate webhook secret
|
|
25
|
+
- `GET /v1/webhooks/:id/secret-status` - Get webhook secret status
|
|
26
|
+
- `POST /v1/webhooks/verify` - Verify webhook signature
|
|
27
|
+
|
|
28
|
+
These methods will be added in a future release.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
9
32
|
## What's New in v2.11.0 (January 2026) 🎉
|
|
10
33
|
|
|
11
34
|
### Breaking Changes ⚠️
|
package/dist/index.d.mts
CHANGED
|
@@ -792,10 +792,17 @@ interface CreateWebhookResponse {
|
|
|
792
792
|
minDealScore: number;
|
|
793
793
|
active: boolean;
|
|
794
794
|
}
|
|
795
|
-
/** List webhooks response */
|
|
795
|
+
/** List webhooks response (standardized list format) */
|
|
796
796
|
interface ListWebhooksResponse {
|
|
797
|
-
|
|
798
|
-
|
|
797
|
+
data: WebhookItem[];
|
|
798
|
+
pagination: {
|
|
799
|
+
page: number;
|
|
800
|
+
limit: number;
|
|
801
|
+
total: number;
|
|
802
|
+
totalPages: number;
|
|
803
|
+
hasMore: boolean;
|
|
804
|
+
};
|
|
805
|
+
meta?: Record<string, unknown>;
|
|
799
806
|
}
|
|
800
807
|
/** Update webhook response */
|
|
801
808
|
interface UpdateWebhookResponse {
|
|
@@ -1415,7 +1422,7 @@ interface PriceRange {
|
|
|
1415
1422
|
interface CrawlOptions {
|
|
1416
1423
|
/** Starting URL for the crawl (required) */
|
|
1417
1424
|
url: string;
|
|
1418
|
-
/**
|
|
1425
|
+
/** @deprecated Use 'url' instead. Kept for backward compatibility. */
|
|
1419
1426
|
startUrl?: string;
|
|
1420
1427
|
/** Prompt to guide the crawl (optional) */
|
|
1421
1428
|
prompt?: string;
|
|
@@ -1535,8 +1542,6 @@ interface DorkOptions {
|
|
|
1535
1542
|
inTitle?: string;
|
|
1536
1543
|
/** Maximum results to return (default: 10, max: 100) */
|
|
1537
1544
|
maxResults?: number;
|
|
1538
|
-
/** Region code (2 letter ISO code) */
|
|
1539
|
-
region?: string;
|
|
1540
1545
|
}
|
|
1541
1546
|
/** Options for getting job deals */
|
|
1542
1547
|
interface GetDealsOptions {
|
|
@@ -1612,19 +1617,25 @@ interface ExportDealsOptions {
|
|
|
1612
1617
|
format?: ExportFormat;
|
|
1613
1618
|
/** Minimum deal score */
|
|
1614
1619
|
minScore?: number;
|
|
1615
|
-
/** Maximum price */
|
|
1616
|
-
maxPrice?: number;
|
|
1617
1620
|
/** Filter by category */
|
|
1618
1621
|
category?: string;
|
|
1619
|
-
/**
|
|
1620
|
-
|
|
1622
|
+
/** Filter by sync status to DealUp */
|
|
1623
|
+
synced?: boolean;
|
|
1624
|
+
/** Filter from date (ISO string) */
|
|
1625
|
+
fromDate?: string;
|
|
1626
|
+
/** Filter to date (ISO string) */
|
|
1627
|
+
toDate?: string;
|
|
1628
|
+
/** Maximum number of deals to export (default: 500, max: 1000) */
|
|
1629
|
+
limit?: number;
|
|
1621
1630
|
}
|
|
1622
1631
|
/** Webhook event types */
|
|
1623
1632
|
type WebhookEvent = "deal.found" | "deal.synced" | "crawl.completed" | "crawl.failed";
|
|
1624
1633
|
/** Options for creating a webhook */
|
|
1625
1634
|
interface CreateWebhookOptions {
|
|
1626
|
-
/** Event
|
|
1627
|
-
|
|
1635
|
+
/** Event types to subscribe to (array) */
|
|
1636
|
+
events?: WebhookEvent[];
|
|
1637
|
+
/** @deprecated Use 'events' array instead */
|
|
1638
|
+
event?: WebhookEvent;
|
|
1628
1639
|
/** URL to receive webhook notifications */
|
|
1629
1640
|
url: string;
|
|
1630
1641
|
/** Secret for signature verification */
|
|
@@ -2315,9 +2326,9 @@ declare class AuthResource {
|
|
|
2315
2326
|
* and how many are currently active.
|
|
2316
2327
|
*
|
|
2317
2328
|
* Tier limits:
|
|
2318
|
-
* - Free:
|
|
2319
|
-
* - Pro:
|
|
2320
|
-
* - Enterprise:
|
|
2329
|
+
* - Free: 10 concurrent connections
|
|
2330
|
+
* - Pro: 50 concurrent connections
|
|
2331
|
+
* - Enterprise: 200 concurrent connections
|
|
2321
2332
|
*
|
|
2322
2333
|
* @example
|
|
2323
2334
|
* ```ts
|
|
@@ -2676,17 +2687,9 @@ declare class DataResource {
|
|
|
2676
2687
|
* @example
|
|
2677
2688
|
* ```ts
|
|
2678
2689
|
* const electronicsDeals = await client.data.getDealsByCategory("electronics");
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
): Promise<ListDealsResponse> {
|
|
2683
|
-
if (!category || !category.trim()) {
|
|
2684
|
-
throw new Error("category is required and cannot be empty");
|
|
2685
|
-
}
|
|
2686
|
-
return this.listDeals({ category, ...options });
|
|
2687
|
-
} return this.listDeals({ category, ...options });
|
|
2688
|
-
}
|
|
2689
|
-
|
|
2690
|
+
* ```
|
|
2691
|
+
*/
|
|
2692
|
+
getDealsByCategory(category: string, options?: Omit<ListDealsOptions, "category">): Promise<ListDealsResponse>;
|
|
2690
2693
|
/**
|
|
2691
2694
|
* Get unsynced deals (not yet sent to DealUp)
|
|
2692
2695
|
*
|
|
@@ -3221,7 +3224,9 @@ declare class KeysResource {
|
|
|
3221
3224
|
*/
|
|
3222
3225
|
revokeAll(): Promise<{
|
|
3223
3226
|
success: boolean;
|
|
3224
|
-
|
|
3227
|
+
revokedCount: number;
|
|
3228
|
+
message: string;
|
|
3229
|
+
warning: string;
|
|
3225
3230
|
}>;
|
|
3226
3231
|
/**
|
|
3227
3232
|
* Get active keys only
|
package/dist/index.d.ts
CHANGED
|
@@ -792,10 +792,17 @@ interface CreateWebhookResponse {
|
|
|
792
792
|
minDealScore: number;
|
|
793
793
|
active: boolean;
|
|
794
794
|
}
|
|
795
|
-
/** List webhooks response */
|
|
795
|
+
/** List webhooks response (standardized list format) */
|
|
796
796
|
interface ListWebhooksResponse {
|
|
797
|
-
|
|
798
|
-
|
|
797
|
+
data: WebhookItem[];
|
|
798
|
+
pagination: {
|
|
799
|
+
page: number;
|
|
800
|
+
limit: number;
|
|
801
|
+
total: number;
|
|
802
|
+
totalPages: number;
|
|
803
|
+
hasMore: boolean;
|
|
804
|
+
};
|
|
805
|
+
meta?: Record<string, unknown>;
|
|
799
806
|
}
|
|
800
807
|
/** Update webhook response */
|
|
801
808
|
interface UpdateWebhookResponse {
|
|
@@ -1415,7 +1422,7 @@ interface PriceRange {
|
|
|
1415
1422
|
interface CrawlOptions {
|
|
1416
1423
|
/** Starting URL for the crawl (required) */
|
|
1417
1424
|
url: string;
|
|
1418
|
-
/**
|
|
1425
|
+
/** @deprecated Use 'url' instead. Kept for backward compatibility. */
|
|
1419
1426
|
startUrl?: string;
|
|
1420
1427
|
/** Prompt to guide the crawl (optional) */
|
|
1421
1428
|
prompt?: string;
|
|
@@ -1535,8 +1542,6 @@ interface DorkOptions {
|
|
|
1535
1542
|
inTitle?: string;
|
|
1536
1543
|
/** Maximum results to return (default: 10, max: 100) */
|
|
1537
1544
|
maxResults?: number;
|
|
1538
|
-
/** Region code (2 letter ISO code) */
|
|
1539
|
-
region?: string;
|
|
1540
1545
|
}
|
|
1541
1546
|
/** Options for getting job deals */
|
|
1542
1547
|
interface GetDealsOptions {
|
|
@@ -1612,19 +1617,25 @@ interface ExportDealsOptions {
|
|
|
1612
1617
|
format?: ExportFormat;
|
|
1613
1618
|
/** Minimum deal score */
|
|
1614
1619
|
minScore?: number;
|
|
1615
|
-
/** Maximum price */
|
|
1616
|
-
maxPrice?: number;
|
|
1617
1620
|
/** Filter by category */
|
|
1618
1621
|
category?: string;
|
|
1619
|
-
/**
|
|
1620
|
-
|
|
1622
|
+
/** Filter by sync status to DealUp */
|
|
1623
|
+
synced?: boolean;
|
|
1624
|
+
/** Filter from date (ISO string) */
|
|
1625
|
+
fromDate?: string;
|
|
1626
|
+
/** Filter to date (ISO string) */
|
|
1627
|
+
toDate?: string;
|
|
1628
|
+
/** Maximum number of deals to export (default: 500, max: 1000) */
|
|
1629
|
+
limit?: number;
|
|
1621
1630
|
}
|
|
1622
1631
|
/** Webhook event types */
|
|
1623
1632
|
type WebhookEvent = "deal.found" | "deal.synced" | "crawl.completed" | "crawl.failed";
|
|
1624
1633
|
/** Options for creating a webhook */
|
|
1625
1634
|
interface CreateWebhookOptions {
|
|
1626
|
-
/** Event
|
|
1627
|
-
|
|
1635
|
+
/** Event types to subscribe to (array) */
|
|
1636
|
+
events?: WebhookEvent[];
|
|
1637
|
+
/** @deprecated Use 'events' array instead */
|
|
1638
|
+
event?: WebhookEvent;
|
|
1628
1639
|
/** URL to receive webhook notifications */
|
|
1629
1640
|
url: string;
|
|
1630
1641
|
/** Secret for signature verification */
|
|
@@ -2315,9 +2326,9 @@ declare class AuthResource {
|
|
|
2315
2326
|
* and how many are currently active.
|
|
2316
2327
|
*
|
|
2317
2328
|
* Tier limits:
|
|
2318
|
-
* - Free:
|
|
2319
|
-
* - Pro:
|
|
2320
|
-
* - Enterprise:
|
|
2329
|
+
* - Free: 10 concurrent connections
|
|
2330
|
+
* - Pro: 50 concurrent connections
|
|
2331
|
+
* - Enterprise: 200 concurrent connections
|
|
2321
2332
|
*
|
|
2322
2333
|
* @example
|
|
2323
2334
|
* ```ts
|
|
@@ -2676,17 +2687,9 @@ declare class DataResource {
|
|
|
2676
2687
|
* @example
|
|
2677
2688
|
* ```ts
|
|
2678
2689
|
* const electronicsDeals = await client.data.getDealsByCategory("electronics");
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
): Promise<ListDealsResponse> {
|
|
2683
|
-
if (!category || !category.trim()) {
|
|
2684
|
-
throw new Error("category is required and cannot be empty");
|
|
2685
|
-
}
|
|
2686
|
-
return this.listDeals({ category, ...options });
|
|
2687
|
-
} return this.listDeals({ category, ...options });
|
|
2688
|
-
}
|
|
2689
|
-
|
|
2690
|
+
* ```
|
|
2691
|
+
*/
|
|
2692
|
+
getDealsByCategory(category: string, options?: Omit<ListDealsOptions, "category">): Promise<ListDealsResponse>;
|
|
2690
2693
|
/**
|
|
2691
2694
|
* Get unsynced deals (not yet sent to DealUp)
|
|
2692
2695
|
*
|
|
@@ -3221,7 +3224,9 @@ declare class KeysResource {
|
|
|
3221
3224
|
*/
|
|
3222
3225
|
revokeAll(): Promise<{
|
|
3223
3226
|
success: boolean;
|
|
3224
|
-
|
|
3227
|
+
revokedCount: number;
|
|
3228
|
+
message: string;
|
|
3229
|
+
warning: string;
|
|
3225
3230
|
}>;
|
|
3226
3231
|
/**
|
|
3227
3232
|
* Get active keys only
|
package/dist/index.js
CHANGED
|
@@ -1173,9 +1173,9 @@ var AuthResource = class {
|
|
|
1173
1173
|
* and how many are currently active.
|
|
1174
1174
|
*
|
|
1175
1175
|
* Tier limits:
|
|
1176
|
-
* - Free:
|
|
1177
|
-
* - Pro:
|
|
1178
|
-
* - Enterprise:
|
|
1176
|
+
* - Free: 10 concurrent connections
|
|
1177
|
+
* - Pro: 50 concurrent connections
|
|
1178
|
+
* - Enterprise: 200 concurrent connections
|
|
1179
1179
|
*
|
|
1180
1180
|
* @example
|
|
1181
1181
|
* ```ts
|
|
@@ -1533,12 +1533,10 @@ var CrawlResource = class {
|
|
|
1533
1533
|
* ```
|
|
1534
1534
|
*/
|
|
1535
1535
|
async analyze(url) {
|
|
1536
|
-
const result = await
|
|
1536
|
+
const result = await post(
|
|
1537
1537
|
this.ctx,
|
|
1538
1538
|
"/v1/crawl/analyze",
|
|
1539
|
-
{
|
|
1540
|
-
url
|
|
1541
|
-
}
|
|
1539
|
+
{ url }
|
|
1542
1540
|
);
|
|
1543
1541
|
return result.data;
|
|
1544
1542
|
}
|
|
@@ -1704,31 +1702,28 @@ var DataResource = class {
|
|
|
1704
1702
|
});
|
|
1705
1703
|
}
|
|
1706
1704
|
/**
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
)
|
|
1717
|
-
|
|
1718
|
-
throw new Error("category is required and cannot be empty");
|
|
1719
|
-
}
|
|
1720
|
-
return this.listDeals({ category, ...options });
|
|
1721
|
-
} return this.listDeals({ category, ...options });
|
|
1705
|
+
* Get deals by category
|
|
1706
|
+
* Convenience method for filtering by category
|
|
1707
|
+
*
|
|
1708
|
+
* @example
|
|
1709
|
+
* ```ts
|
|
1710
|
+
* const electronicsDeals = await client.data.getDealsByCategory("electronics");
|
|
1711
|
+
* ```
|
|
1712
|
+
*/
|
|
1713
|
+
async getDealsByCategory(category, options) {
|
|
1714
|
+
if (!category || !category.trim()) {
|
|
1715
|
+
throw new Error("category is required and cannot be empty");
|
|
1722
1716
|
}
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1717
|
+
return this.listDeals({ category, ...options });
|
|
1718
|
+
}
|
|
1719
|
+
/**
|
|
1720
|
+
* Get unsynced deals (not yet sent to DealUp)
|
|
1721
|
+
*
|
|
1722
|
+
* @example
|
|
1723
|
+
* ```ts
|
|
1724
|
+
* const unsyncedDeals = await client.data.getUnsyncedDeals();
|
|
1725
|
+
* ```
|
|
1726
|
+
*/
|
|
1732
1727
|
async getUnsyncedDeals(options) {
|
|
1733
1728
|
return this.listDeals({ synced: false, ...options });
|
|
1734
1729
|
}
|
|
@@ -1784,9 +1779,11 @@ var DataResource = class {
|
|
|
1784
1779
|
{
|
|
1785
1780
|
format: options.format || "json",
|
|
1786
1781
|
minScore: options.minScore,
|
|
1787
|
-
maxPrice: options.maxPrice,
|
|
1788
1782
|
category: options.category,
|
|
1789
|
-
|
|
1783
|
+
synced: options.synced?.toString(),
|
|
1784
|
+
fromDate: options.fromDate,
|
|
1785
|
+
toDate: options.toDate,
|
|
1786
|
+
limit: options.limit
|
|
1790
1787
|
}
|
|
1791
1788
|
);
|
|
1792
1789
|
return result.data;
|
|
@@ -1831,8 +1828,8 @@ var DorkResource = class {
|
|
|
1831
1828
|
async create(options) {
|
|
1832
1829
|
const body = {
|
|
1833
1830
|
query: this.buildQuery(options),
|
|
1834
|
-
|
|
1835
|
-
|
|
1831
|
+
site: options.site,
|
|
1832
|
+
maxResults: options.maxResults
|
|
1836
1833
|
};
|
|
1837
1834
|
const result = await post(this.ctx, "/v1/dork", body);
|
|
1838
1835
|
return result.data;
|
|
@@ -1947,9 +1944,6 @@ var DorkResource = class {
|
|
|
1947
1944
|
if (typeof options.query === "string" && options.query.trim() !== "") {
|
|
1948
1945
|
parts.push(options.query);
|
|
1949
1946
|
}
|
|
1950
|
-
if (options.site) {
|
|
1951
|
-
parts.push(`site:${options.site}`);
|
|
1952
|
-
}
|
|
1953
1947
|
if (options.fileType) {
|
|
1954
1948
|
parts.push(`filetype:${options.fileType}`);
|
|
1955
1949
|
}
|
|
@@ -2574,10 +2568,7 @@ var KeysResource = class {
|
|
|
2574
2568
|
* ```
|
|
2575
2569
|
*/
|
|
2576
2570
|
async revokeAll() {
|
|
2577
|
-
const result = await
|
|
2578
|
-
this.ctx,
|
|
2579
|
-
"/v1/keys/all"
|
|
2580
|
-
);
|
|
2571
|
+
const result = await post(this.ctx, "/v1/keys/revoke-all");
|
|
2581
2572
|
return result.data;
|
|
2582
2573
|
}
|
|
2583
2574
|
/**
|
|
@@ -3106,7 +3097,9 @@ var WebhooksResource = class {
|
|
|
3106
3097
|
*/
|
|
3107
3098
|
async create(options) {
|
|
3108
3099
|
const result = await post(this.ctx, "/v1/webhooks", {
|
|
3100
|
+
events: options.events ?? (options.event ? [options.event] : void 0),
|
|
3109
3101
|
event: options.event,
|
|
3102
|
+
// Legacy fallback
|
|
3110
3103
|
url: options.url,
|
|
3111
3104
|
secret: options.secret,
|
|
3112
3105
|
minDealScore: options.minDealScore,
|
|
@@ -3144,7 +3137,7 @@ var WebhooksResource = class {
|
|
|
3144
3137
|
this.ctx,
|
|
3145
3138
|
`/v1/webhooks/${webhookId}`
|
|
3146
3139
|
);
|
|
3147
|
-
return result.data;
|
|
3140
|
+
return result.data.webhook;
|
|
3148
3141
|
}
|
|
3149
3142
|
/**
|
|
3150
3143
|
* Update a webhook
|
|
@@ -3202,7 +3195,8 @@ var WebhooksResource = class {
|
|
|
3202
3195
|
async test(webhookId) {
|
|
3203
3196
|
const result = await post(
|
|
3204
3197
|
this.ctx,
|
|
3205
|
-
|
|
3198
|
+
"/v1/webhooks/test",
|
|
3199
|
+
{ webhookId }
|
|
3206
3200
|
);
|
|
3207
3201
|
return result.data;
|
|
3208
3202
|
}
|
|
@@ -3240,7 +3234,7 @@ var WebhooksResource = class {
|
|
|
3240
3234
|
*/
|
|
3241
3235
|
async getActive() {
|
|
3242
3236
|
const all = await this.list();
|
|
3243
|
-
return all.
|
|
3237
|
+
return all.data.filter((w) => w.active);
|
|
3244
3238
|
}
|
|
3245
3239
|
/**
|
|
3246
3240
|
* Get webhooks by event type
|
|
@@ -3252,7 +3246,7 @@ var WebhooksResource = class {
|
|
|
3252
3246
|
*/
|
|
3253
3247
|
async getByEvent(event) {
|
|
3254
3248
|
const all = await this.list();
|
|
3255
|
-
return all.
|
|
3249
|
+
return all.data.filter((w) => w.event === event);
|
|
3256
3250
|
}
|
|
3257
3251
|
};
|
|
3258
3252
|
|