@dealcrawl/sdk 2.1.0 → 2.1.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.
Files changed (84) hide show
  1. package/dist/index.d.mts +2335 -0
  2. package/dist/index.d.ts +2314 -37
  3. package/dist/index.js +2280 -64
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +2260 -0
  6. package/dist/index.mjs.map +1 -0
  7. package/package.json +13 -5
  8. package/dist/client.d.ts +0 -285
  9. package/dist/client.d.ts.map +0 -1
  10. package/dist/client.js +0 -336
  11. package/dist/client.js.map +0 -1
  12. package/dist/error.d.ts +0 -55
  13. package/dist/error.d.ts.map +0 -1
  14. package/dist/error.js +0 -128
  15. package/dist/error.js.map +0 -1
  16. package/dist/index.d.ts.map +0 -1
  17. package/dist/resources/account.d.ts +0 -143
  18. package/dist/resources/account.d.ts.map +0 -1
  19. package/dist/resources/account.js +0 -186
  20. package/dist/resources/account.js.map +0 -1
  21. package/dist/resources/crawl.d.ts +0 -101
  22. package/dist/resources/crawl.d.ts.map +0 -1
  23. package/dist/resources/crawl.js +0 -234
  24. package/dist/resources/crawl.js.map +0 -1
  25. package/dist/resources/data.d.ts +0 -157
  26. package/dist/resources/data.d.ts.map +0 -1
  27. package/dist/resources/data.js +0 -245
  28. package/dist/resources/data.js.map +0 -1
  29. package/dist/resources/dork.d.ts +0 -104
  30. package/dist/resources/dork.d.ts.map +0 -1
  31. package/dist/resources/dork.js +0 -163
  32. package/dist/resources/dork.js.map +0 -1
  33. package/dist/resources/extract.d.ts +0 -105
  34. package/dist/resources/extract.d.ts.map +0 -1
  35. package/dist/resources/extract.js +0 -246
  36. package/dist/resources/extract.js.map +0 -1
  37. package/dist/resources/index.d.ts +0 -14
  38. package/dist/resources/index.d.ts.map +0 -1
  39. package/dist/resources/index.js +0 -14
  40. package/dist/resources/index.js.map +0 -1
  41. package/dist/resources/keys.d.ts +0 -124
  42. package/dist/resources/keys.d.ts.map +0 -1
  43. package/dist/resources/keys.js +0 -168
  44. package/dist/resources/keys.js.map +0 -1
  45. package/dist/resources/scrape.d.ts +0 -53
  46. package/dist/resources/scrape.d.ts.map +0 -1
  47. package/dist/resources/scrape.js +0 -85
  48. package/dist/resources/scrape.js.map +0 -1
  49. package/dist/resources/status.d.ts +0 -100
  50. package/dist/resources/status.d.ts.map +0 -1
  51. package/dist/resources/status.js +0 -133
  52. package/dist/resources/status.js.map +0 -1
  53. package/dist/resources/webhooks.d.ts +0 -126
  54. package/dist/resources/webhooks.d.ts.map +0 -1
  55. package/dist/resources/webhooks.js +0 -167
  56. package/dist/resources/webhooks.js.map +0 -1
  57. package/dist/types/config.d.ts +0 -45
  58. package/dist/types/config.d.ts.map +0 -1
  59. package/dist/types/config.js +0 -10
  60. package/dist/types/config.js.map +0 -1
  61. package/dist/types/index.d.ts +0 -8
  62. package/dist/types/index.d.ts.map +0 -1
  63. package/dist/types/index.js +0 -8
  64. package/dist/types/index.js.map +0 -1
  65. package/dist/types/options.d.ts +0 -328
  66. package/dist/types/options.d.ts.map +0 -1
  67. package/dist/types/options.js +0 -6
  68. package/dist/types/options.js.map +0 -1
  69. package/dist/types/responses.d.ts +0 -422
  70. package/dist/types/responses.d.ts.map +0 -1
  71. package/dist/types/responses.js +0 -6
  72. package/dist/types/responses.js.map +0 -1
  73. package/dist/types/shared.d.ts +0 -234
  74. package/dist/types/shared.d.ts.map +0 -1
  75. package/dist/types/shared.js +0 -37
  76. package/dist/types/shared.js.map +0 -1
  77. package/dist/utils/polling.d.ts +0 -57
  78. package/dist/utils/polling.d.ts.map +0 -1
  79. package/dist/utils/polling.js +0 -110
  80. package/dist/utils/polling.js.map +0 -1
  81. package/dist/utils/request.d.ts +0 -47
  82. package/dist/utils/request.d.ts.map +0 -1
  83. package/dist/utils/request.js +0 -192
  84. package/dist/utils/request.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src/resources/data.ts"],"names":[],"mapp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AM,EAChB,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,GAC3C,OAAO,CAAC,iBAAiB,CAAC;IAO7B;;;;;;;OAOG;IACG,gBAAgB,CACpB,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAC,GACzC,OAAO,CAAC,iBAAiB,CAAC;IAQ7B;;;;;;;;;;;OAWG;IACG,UAAU,CACd,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC;IAe7B;;;;;;;;;;;;;;;OAeG;IACG,WAAW,CACf,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC;IAmB7B;;;;;;;;;OASG;IACG,QAAQ,IAAI,OAAO,CAAC,mBAAmB,CAAC;CAI/C"}
@@ -1,245 +0,0 @@
1
- /**
2
- * Data Resource
3
- * Handles data retrieval, listing, and export operations
4
- */
5
- import { get } from "../utils/request";
6
- /**
7
- * Data resource class
8
- * Provides methods for accessing job and deal data
9
- */
10
- export class DataResource {
11
- ctx;
12
- constructor(ctx) {
13
- this.ctx = ctx;
14
- }
15
- // ============================================
16
- // JOBS
17
- // ============================================
18
- /**
19
- * List all jobs
20
- *
21
- * @example
22
- * ```ts
23
- * const jobs = await client.data.listJobs({
24
- * status: "completed",
25
- * type: "crawl",
26
- * page: 1,
27
- * limit: 20
28
- * });
29
- * console.log(jobs.data);
30
- * console.log(jobs.pagination.total);
31
- * ```
32
- */
33
- async listJobs(options = {}) {
34
- const result = await get(this.ctx, "/v1/data/jobs", {
35
- page: options.page,
36
- limit: options.limit,
37
- status: options.status,
38
- type: options.type,
39
- sortBy: options.sortBy,
40
- sortOrder: options.sortOrder,
41
- fromDate: options.fromDate,
42
- toDate: options.toDate,
43
- });
44
- return result.data;
45
- }
46
- /**
47
- * Get jobs by status
48
- * Convenience method for filtering by status
49
- *
50
- * @example
51
- * ```ts
52
- * const activeJobs = await client.data.getJobsByStatus("active");
53
- * ```
54
- */
55
- async getJobsByStatus(status, options) {
56
- return this.listJobs({ status, ...options });
57
- }
58
- /**
59
- * Get jobs by type
60
- * Convenience method for filtering by type
61
- *
62
- * @example
63
- * ```ts
64
- * const crawlJobs = await client.data.getJobsByType("crawl");
65
- * ```
66
- */
67
- async getJobsByType(type, options) {
68
- return this.listJobs({ type, ...options });
69
- }
70
- /**
71
- * Get recent jobs
72
- * Convenience method for getting latest jobs
73
- *
74
- * @example
75
- * ```ts
76
- * const recentJobs = await client.data.getRecentJobs(10);
77
- * ```
78
- */
79
- async getRecentJobs(limit = 10) {
80
- return this.listJobs({
81
- limit,
82
- sortBy: "created_at",
83
- sortOrder: "desc",
84
- });
85
- }
86
- // ============================================
87
- // DEALS
88
- // ============================================
89
- /**
90
- * List all deals
91
- *
92
- * @example
93
- * ```ts
94
- * const deals = await client.data.listDeals({
95
- * minScore: 70,
96
- * category: "electronics",
97
- * sortBy: "deal_score",
98
- * sortOrder: "desc"
99
- * });
100
- * ```
101
- */
102
- async listDeals(options = {}) {
103
- const result = await get(this.ctx, "/v1/data/deals", {
104
- page: options.page,
105
- limit: options.limit,
106
- minScore: options.minScore,
107
- maxPrice: options.maxPrice,
108
- category: options.category,
109
- merchant: options.merchant,
110
- synced: options.synced?.toString(),
111
- sortBy: options.sortBy,
112
- sortOrder: options.sortOrder,
113
- });
114
- return result.data;
115
- }
116
- /**
117
- * Get a single deal by ID
118
- *
119
- * @example
120
- * ```ts
121
- * const deal = await client.data.getDeal("deal_abc123");
122
- * console.log(deal.product.name);
123
- * console.log(deal.pricing.discountPercent);
124
- * ```
125
- */
126
- async getDeal(dealId) {
127
- if (!dealId || !dealId.trim()) {
128
- throw new Error("dealId is required and cannot be empty");
129
- }
130
- const result = await get(this.ctx, `/v1/data/deals/${dealId}`);
131
- return result.data;
132
- }
133
- /**
134
- * Get top deals by score
135
- * Convenience method for finding best deals
136
- *
137
- * @example
138
- * ```ts
139
- * const topDeals = await client.data.getTopDeals(20, 80);
140
- * ```
141
- */
142
- async getTopDeals(limit = 20, minScore = 70) {
143
- return this.listDeals({
144
- limit,
145
- minScore,
146
- sortBy: "deal_score",
147
- sortOrder: "desc",
148
- });
149
- }
150
- /**
151
- * Get deals by category
152
- * Convenience method for filtering by category
153
- *
154
- * @example
155
- * ```ts
156
- * const electronicsDeals = await client.data.getDealsByCategory("electronics");
157
- * ```
158
- */
159
- async getDealsByCategory(category, options) {
160
- if (!category || !category.trim()) {
161
- throw new Error("category is required and cannot be empty");
162
- }
163
- return this.listDeals({ category, ...options });
164
- }
165
- /**
166
- * Get unsynced deals (not yet sent to DealUp)
167
- *
168
- * @example
169
- * ```ts
170
- * const unsyncedDeals = await client.data.getUnsyncedDeals();
171
- * ```
172
- */
173
- async getUnsyncedDeals(options) {
174
- return this.listDeals({ synced: false, ...options });
175
- }
176
- // ============================================
177
- // EXPORT
178
- // ============================================
179
- /**
180
- * Export jobs data
181
- *
182
- * @example
183
- * ```ts
184
- * // Export as JSON
185
- * const jsonData = await client.data.exportJobs({ format: "json" });
186
- *
187
- * // Export as CSV
188
- * const csvData = await client.data.exportJobs({ format: "csv" });
189
- * ```
190
- */
191
- async exportJobs(options = {}) {
192
- const result = await get(this.ctx, "/v1/data/export/jobs", {
193
- format: options.format || "json",
194
- status: options.status,
195
- type: options.type,
196
- fromDate: options.fromDate,
197
- toDate: options.toDate,
198
- });
199
- return result.data;
200
- }
201
- /**
202
- * Export deals data
203
- *
204
- * @example
205
- * ```ts
206
- * // Export as JSON
207
- * const jsonData = await client.data.exportDeals({ format: "json" });
208
- *
209
- * // Export as CSV with filters
210
- * const csvData = await client.data.exportDeals({
211
- * format: "csv",
212
- * minScore: 70,
213
- * category: "software"
214
- * });
215
- * ```
216
- */
217
- async exportDeals(options = {}) {
218
- const result = await get(this.ctx, "/v1/data/export/deals", {
219
- format: options.format || "json",
220
- minScore: options.minScore,
221
- maxPrice: options.maxPrice,
222
- category: options.category,
223
- includeRawSignals: options.includeRawSignals,
224
- });
225
- return result.data;
226
- }
227
- // ============================================
228
- // STATS
229
- // ============================================
230
- /**
231
- * Get client statistics
232
- *
233
- * @example
234
- * ```ts
235
- * const stats = await client.data.getStats();
236
- * console.log(stats.totals.deals);
237
- * console.log(stats.performance.avgDealScore);
238
- * ```
239
- */
240
- async getStats() {
241
- const result = await get(this.ctx, "/v1/data/stats");
242
- return result.data;
243
- }
244
- }
245
- //# sourceMappingURL=data.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data.js","sourceRoot":"","sources":["../../src/resources/data.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAeH,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAEvC;;;GAGG;AACH,MAAM,OAAO,YAAY;IACH;IAApB,YAAoB,GAAmB;QAAnB,QAAG,GAAH,GAAG,CAAgB;IAAG,CAAC;IAE3C,+CAA+C;IAC/C,OAAO;IACP,+CAA+C;IAE/C;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,QAAQ,CAAC,UAA2B,EAAE;QAC1C,MAAM,MAAM,GAAG,MAAM,GAAG,CAAmB,IAAI,CAAC,GAAG,EAAE,eAAe,EAAE;YACpE,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,MAAM,EAAE,OAAO,CAAC,MAAM;SACvB,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,eAAe,CACnB,MAAiC,EACjC,OAAyC;QAEzC,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE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B,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,WAAW,CACf,UAA8B,EAAE;QAEhC,MAAM,MAAM,GAAG,MAAM,GAAG,CACtB,IAAI,CAAC,GAAG,EACR,uBAAuB,EACvB;YACE,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,MAAM;YAChC,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;SAC7C,CACF,CAAC;QACF,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,+CAA+C;IAC/C,QAAQ;IACR,+CAA+C;IAE/C;;;;;;;;;OASG;IACH,KAAK,CAAC,QAAQ;QACZ,MAAM,MAAM,GAAG,MAAM,GAAG,CAAsB,IAAI,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;QAC1E,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB,CAAC;CACF"}
@@ -1,104 +0,0 @@
1
- /**
2
- * Dork Resource
3
- * Handles Google Dork search operations
4
- */
5
- import type { RequestContext } from "../types/config";
6
- import type { DorkOptions } from "../types/options";
7
- import type { DorkJobResponse } from "../types/responses";
8
- /**
9
- * Dork resource class
10
- * Provides methods for Google Dork searches
11
- */
12
- export declare class DorkResource {
13
- private ctx;
14
- constructor(ctx: RequestContext);
15
- /**
16
- * Create a new dork search job
17
- *
18
- * @example
19
- * ```ts
20
- * const job = await client.dork.create({
21
- * query: "discount coupon",
22
- * site: "amazon.com",
23
- * maxResults: 20
24
- * });
25
- * console.log(job.jobId);
26
- * ```
27
- */
28
- create(options: DorkOptions): Promise<DorkJobResponse>;
29
- /**
30
- * Search for deals on a specific site
31
- * Convenience method for finding discount pages
32
- *
33
- * @example
34
- * ```ts
35
- * const job = await client.dork.findDeals("amazon.com", {
36
- * maxResults: 50
37
- * });
38
- * ```
39
- */
40
- findDeals(site: string, options?: Omit<DorkOptions, "query" | "site">): Promise<DorkJobResponse>;
41
- /**
42
- * Search for product pages on a site
43
- * Looks for common product URL patterns
44
- *
45
- * @example
46
- * ```ts
47
- * const job = await client.dork.findProducts("shop.example.com", {
48
- * maxResults: 100
49
- * });
50
- * ```
51
- */
52
- findProducts(site: string, options?: Omit<DorkOptions, "query" | "site" | "inUrl">): Promise<DorkJobResponse>;
53
- /**
54
- * Search for PDFs on a site
55
- * Useful for finding manuals, guides, datasheets
56
- *
57
- * @example
58
- * ```ts
59
- * const job = await client.dork.findPDFs("docs.example.com", "user guide");
60
- * ```
61
- */
62
- findPDFs(site: string, query?: string, options?: Omit<DorkOptions, "query" | "site" | "fileType">): Promise<DorkJobResponse>;
63
- /**
64
- * Search with custom title filter
65
- * Find pages with specific terms in title
66
- *
67
- * @example
68
- * ```ts
69
- * const job = await client.dork.inTitle("Black Friday", {
70
- * site: "bestbuy.com",
71
- * maxResults: 30
72
- * });
73
- * ```
74
- */
75
- inTitle(titleQuery: string, options?: Omit<DorkOptions, "inTitle">): Promise<DorkJobResponse>;
76
- /**
77
- * Search with custom URL filter
78
- * Find pages with specific terms in URL
79
- *
80
- * @example
81
- * ```ts
82
- * const job = await client.dork.inUrl("clearance", {
83
- * site: "walmart.com"
84
- * });
85
- * ```
86
- */
87
- inUrl(urlQuery: string, options?: Omit<DorkOptions, "inUrl">): Promise<DorkJobResponse>;
88
- /**
89
- * Build a raw Google dork query string
90
- * Useful for preview or debugging
91
- *
92
- * @example
93
- * ```ts
94
- * const query = client.dork.buildQuery({
95
- * query: "laptop deals",
96
- * site: "amazon.com",
97
- * inTitle: "discount"
98
- * });
99
- * // Returns: "laptop deals site:amazon.com intitle:discount"
100
- * ```
101
- */
102
- buildQuery(options: DorkOptions): string;
103
- }
104
- //# sourceMappingURL=dork.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dork.d.ts","sourceRoot":"","sources":["../../src/resources/dork.ts"],"names":[],"mappings":"AA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AAC,OAAO,EAAE,WAAW,GAAG,MAAM;CAuBzC"}
@@ -1,163 +0,0 @@
1
- /**
2
- * Dork Resource
3
- * Handles Google Dork search operations
4
- */
5
- import { post } from "../utils/request";
6
- /**
7
- * Dork resource class
8
- * Provides methods for Google Dork searches
9
- */
10
- export class DorkResource {
11
- ctx;
12
- constructor(ctx) {
13
- this.ctx = ctx;
14
- }
15
- /**
16
- * Create a new dork search job
17
- *
18
- * @example
19
- * ```ts
20
- * const job = await client.dork.create({
21
- * query: "discount coupon",
22
- * site: "amazon.com",
23
- * maxResults: 20
24
- * });
25
- * console.log(job.jobId);
26
- * ```
27
- */
28
- async create(options) {
29
- const body = {
30
- query: this.buildQuery(options),
31
- maxResults: options.maxResults,
32
- region: options.region,
33
- };
34
- const result = await post(this.ctx, "/v1/dork", body);
35
- return result.data;
36
- }
37
- /**
38
- * Search for deals on a specific site
39
- * Convenience method for finding discount pages
40
- *
41
- * @example
42
- * ```ts
43
- * const job = await client.dork.findDeals("amazon.com", {
44
- * maxResults: 50
45
- * });
46
- * ```
47
- */
48
- async findDeals(site, options) {
49
- return this.create({
50
- query: "discount OR coupon OR sale OR promo OR deal",
51
- site,
52
- ...options,
53
- });
54
- }
55
- /**
56
- * Search for product pages on a site
57
- * Looks for common product URL patterns
58
- *
59
- * @example
60
- * ```ts
61
- * const job = await client.dork.findProducts("shop.example.com", {
62
- * maxResults: 100
63
- * });
64
- * ```
65
- */
66
- async findProducts(site, options) {
67
- return this.create({
68
- query: "product OR item OR buy",
69
- site,
70
- inUrl: "product",
71
- ...options,
72
- });
73
- }
74
- /**
75
- * Search for PDFs on a site
76
- * Useful for finding manuals, guides, datasheets
77
- *
78
- * @example
79
- * ```ts
80
- * const job = await client.dork.findPDFs("docs.example.com", "user guide");
81
- * ```
82
- */
83
- async findPDFs(site, query, options) {
84
- return this.create({
85
- query: query || "*",
86
- site,
87
- fileType: "pdf",
88
- ...options,
89
- });
90
- }
91
- /**
92
- * Search with custom title filter
93
- * Find pages with specific terms in title
94
- *
95
- * @example
96
- * ```ts
97
- * const job = await client.dork.inTitle("Black Friday", {
98
- * site: "bestbuy.com",
99
- * maxResults: 30
100
- * });
101
- * ```
102
- */
103
- async inTitle(titleQuery, options) {
104
- return this.create({
105
- query: options?.query || titleQuery,
106
- inTitle: titleQuery,
107
- ...options,
108
- });
109
- }
110
- /**
111
- * Search with custom URL filter
112
- * Find pages with specific terms in URL
113
- *
114
- * @example
115
- * ```ts
116
- * const job = await client.dork.inUrl("clearance", {
117
- * site: "walmart.com"
118
- * });
119
- * ```
120
- */
121
- async inUrl(urlQuery, options) {
122
- return this.create({
123
- query: options?.query || urlQuery,
124
- inUrl: urlQuery,
125
- ...options,
126
- });
127
- }
128
- /**
129
- * Build a raw Google dork query string
130
- * Useful for preview or debugging
131
- *
132
- * @example
133
- * ```ts
134
- * const query = client.dork.buildQuery({
135
- * query: "laptop deals",
136
- * site: "amazon.com",
137
- * inTitle: "discount"
138
- * });
139
- * // Returns: "laptop deals site:amazon.com intitle:discount"
140
- * ```
141
- */
142
- buildQuery(options) {
143
- const parts = [];
144
- // Only add query if it's a non-empty string
145
- if (typeof options.query === 'string' && options.query.trim() !== '') {
146
- parts.push(options.query);
147
- }
148
- if (options.site) {
149
- parts.push(`site:${options.site}`);
150
- }
151
- if (options.fileType) {
152
- parts.push(`filetype:${options.fileType}`);
153
- }
154
- if (options.inUrl) {
155
- parts.push(`inurl:${options.inUrl}`);
156
- }
157
- if (options.inTitle) {
158
- parts.push(`intitle:${options.inTitle}`);
159
- }
160
- return parts.join(" ");
161
- }
162
- }
163
- //# sourceMappingURL=dork.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dork.js","sourceRoot":"","sources":["../../src/resources/dork.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC;;;GAGG;AACH,MAAM,OAAO,YAAY;IACH;IAApB,YAAoB,GAAmB;QAAnB,QAAG,GAAH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,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,KAAK,CACT,QAAgB,EAChB,OAAoC;QAEpC,OAAO,IAAI,CAAC,MAAM,CAAC;YACjB,KAAK,EAAE,OAAO,EAAE,KAAK,IAAI,QAAQ;YACjC,KAAK,EAAE,QAAQ;YACf,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,UAAU,CAAC,OAAoB;QAC7B,MAAM,KAAK,GAAa,EAAE,CAAC;QAE3B,4CAA4C;QAC5C,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACrE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;QAED,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,KAAK,CAAC,IAAI,CAAC,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QACrC,CAAC;QACD,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;YACrB,KAAK,CAAC,IAAI,CAAC,YAAY,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC7C,CAAC;QACD,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;YAClB,KAAK,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;QACvC,CAAC;QACD,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YACpB,KAAK,CAAC,IAAI,CAAC,WAAW,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;QAC3C,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;CACF"}
@@ -1,105 +0,0 @@
1
- /**
2
- * Extract Resource
3
- * Handles LLM-based structured data extraction
4
- */
5
- import type { RequestContext } from "../types/config";
6
- import type { ExtractOptions } from "../types/options";
7
- import type { ExtractJobResponse } from "../types/responses";
8
- /**
9
- * Extract resource class
10
- * Provides methods for structured data extraction using LLMs
11
- */
12
- export declare class ExtractResource {
13
- private ctx;
14
- constructor(ctx: RequestContext);
15
- /**
16
- * Create a new extraction job
17
- * Either schema or prompt must be provided
18
- *
19
- * @example
20
- * ```ts
21
- * // Schema-based extraction
22
- * const job = await client.extract.create({
23
- * url: "https://example.com/product",
24
- * schema: {
25
- * type: "object",
26
- * properties: {
27
- * name: { type: "string" },
28
- * price: { type: "number" },
29
- * features: { type: "array", items: { type: "string" } }
30
- * }
31
- * }
32
- * });
33
- *
34
- * // Prompt-based extraction
35
- * const job = await client.extract.create({
36
- * url: "https://example.com/article",
37
- * prompt: "Extract the main points and author name"
38
- * });
39
- * ```
40
- */
41
- create(options: ExtractOptions): Promise<ExtractJobResponse>;
42
- /**
43
- * Extract data using a JSON Schema
44
- * Convenience method for schema-based extraction
45
- *
46
- * @example
47
- * ```ts
48
- * const job = await client.extract.withSchema(
49
- * "https://example.com/product",
50
- * {
51
- * type: "object",
52
- * properties: {
53
- * name: { type: "string" },
54
- * price: { type: "number" }
55
- * }
56
- * }
57
- * );
58
- * ```
59
- */
60
- withSchema(url: string, schema: Record<string, unknown>, options?: Omit<ExtractOptions, "url" | "schema" | "prompt">): Promise<ExtractJobResponse>;
61
- /**
62
- * Extract data using a natural language prompt
63
- * Convenience method for prompt-based extraction
64
- *
65
- * @example
66
- * ```ts
67
- * const job = await client.extract.withPrompt(
68
- * "https://example.com/article",
69
- * "Extract the article title, author, publication date, and a brief summary"
70
- * );
71
- * ```
72
- */
73
- withPrompt(url: string, prompt: string, options?: Omit<ExtractOptions, "url" | "schema" | "prompt">): Promise<ExtractJobResponse>;
74
- /**
75
- * Extract product information from a page
76
- * Pre-built schema for common e-commerce use case
77
- *
78
- * @example
79
- * ```ts
80
- * const job = await client.extract.product("https://shop.example.com/item");
81
- * ```
82
- */
83
- product(url: string, options?: Omit<ExtractOptions, "url" | "schema" | "prompt">): Promise<ExtractJobResponse>;
84
- /**
85
- * Extract article/blog post information
86
- * Pre-built schema for content extraction
87
- *
88
- * @example
89
- * ```ts
90
- * const job = await client.extract.article("https://blog.example.com/post");
91
- * ```
92
- */
93
- article(url: string, options?: Omit<ExtractOptions, "url" | "schema" | "prompt">): Promise<ExtractJobResponse>;
94
- /**
95
- * Extract contact information from a page
96
- * Pre-built schema for contact page scraping
97
- *
98
- * @example
99
- * ```ts
100
- * const job = await client.extract.contact("https://example.com/contact");
101
- * ```
102
- */
103
- contact(url: string, options?: Omit<ExtractOptions, "url" | "schema" | "prompt">): Promise<ExtractJobResponse>;
104
- }
105
- //# sourceMappingURL=extract.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../src/resources/extract.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAgB,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAG7D;;;GAGG;AACH,qBAAa,eAAe;IACd,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,cAAc;IAEvC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACG,MAAM,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA2BlE;;;;;;;;;;;;;;;;;OAiBG;IACG,UAAU,CACd,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC,GAC1D,OAAO,CAAC,kBAAkB,CAAC;IAQ9B;;;;;;;;;;;OAWG;IACG,UAAU,CACd,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,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