@scrapa/sdk 0.1.0

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.
@@ -0,0 +1,420 @@
1
+ /** Arguments for `scrape()`. */
2
+ export interface ScrapeParams {
3
+ /** The page to read. An http(s) URL — private and loopback hosts are refused. */
4
+ url: string;
5
+ /** How to read it. "fetch" is a plain HTTP request; "browser" renders the page in a real
6
+ * Chromium; "auto" fetches first and escalates to the browser when the body turns out to be a
7
+ * JavaScript shell, billing whichever engine answered. */
8
+ engine?: "auto" | "fetch" | "browser";
9
+ /** Whether to try again a different way when the first attempt is blocked. `false` stops after
10
+ * one try — the site's refusal is your answer, and it costs nothing. It is how you bound a
11
+ * call: with `auto`, trying again is what charges the browser price instead of the fetch one. */
12
+ escalate?: boolean;
13
+ /** How many extra tries to give a page the site blocks, each from a different address. 0 (the
14
+ * default) takes the site's first no as the answer. A blocked page costs nothing, so a try
15
+ * that is blocked again is free — but it takes as long as the first one did, so the call can
16
+ * run that many times longer. */
17
+ retry?: number;
18
+ /** What to hand back. "screenshot" and "pdf" come back as base64 and need the browser engine;
19
+ * asking for both costs no more than one. */
20
+ formats?: ("markdown" | "html" | "text" | "links" | "screenshot" | "pdf")[];
21
+ /** What the page should answer with. Set `"json"` when you are reading an API: anything else
22
+ * that comes back — a maintenance notice, a "checking your browser" page, a login form — is
23
+ * then not your answer. It costs nothing, and we try again from another address instead of
24
+ * handing you a page you cannot parse. Without it, whatever the page returns is your answer. */
25
+ expect?: "json";
26
+ /** Where the request leaves from. Defaults to the managed residential pool. */
27
+ proxy?: {
28
+ /** Which exit to leave through. "residential" is the managed pool, metered by the megabyte;
29
+ * "custom" is your own proxy — free on every plan, bytes never billed. */
30
+ pool?: "residential" | "custom";
31
+ /** Your own proxy, `http(s)://[user:pass@]host:port`. Required for pool "custom", refused
32
+ * for the managed one. */
33
+ server?: string;
34
+ /** Where the call should look like it comes from, ISO 3166-1 alpha-2 (`us`, `br`); `us`
35
+ * unless you say. On the managed pool it also picks the exit; the browser's clock and
36
+ * languages follow it on every pool. */
37
+ country?: string;
38
+ };
39
+ /** How to render it. Only the browser engine reads these — with `auto` they apply if the page
40
+ * turns out to need one. */
41
+ browser?: {
42
+ /** When the page counts as loaded. "load" (the default) waits for images and stylesheets;
43
+ * "domcontentloaded" is the fastest and stops at the HTML; "networkidle" waits until the
44
+ * page stops asking for things. Every page gets a short settle after this whichever you
45
+ * pick. */
46
+ waitUntil?: "load" | "domcontentloaded" | "networkidle";
47
+ /** Wait until this CSS selector is on the page — the dependable way to read something a
48
+ * script draws. If it never shows up the call comes back as a timeout at no charge, rather
49
+ * than the half-built page. */
50
+ waitForSelector?: string;
51
+ /** Wait this many milliseconds after the page settles, for the scripts no selector
52
+ * describes. It comes out of `timeoutMs`, never on top of it. */
53
+ waitMs?: number;
54
+ /** The window size the page is rendered in, 1280×800 unless you say. Set it when a site
55
+ * serves a different layout by width. */
56
+ viewport?: {
57
+ width: number;
58
+ height: number;
59
+ };
60
+ /** Screenshot the whole scrollable page instead of just the window. A long page makes a
61
+ * large answer — the image comes back as base64 inside the response. */
62
+ fullPage?: boolean;
63
+ };
64
+ /** Extra request headers to send to the page — an authorization token, a cookie, a custom user
65
+ * agent. The connection's own headers cannot be set. */
66
+ headers?: Record<string, string>;
67
+ /** How long to give the page before giving up, in milliseconds. A page that never arrives is a
68
+ * free outcome. */
69
+ timeoutMs?: number;
70
+ }
71
+ /** Arguments for `quote()`. */
72
+ export interface QuoteScrapeParams {
73
+ /** The page to read. An http(s) URL — private and loopback hosts are refused. */
74
+ url: string;
75
+ /** How to read it. "fetch" is a plain HTTP request; "browser" renders the page in a real
76
+ * Chromium; "auto" fetches first and escalates to the browser when the body turns out to be a
77
+ * JavaScript shell, billing whichever engine answered. */
78
+ engine?: "auto" | "fetch" | "browser";
79
+ /** Whether to try again a different way when the first attempt is blocked. `false` stops after
80
+ * one try — the site's refusal is your answer, and it costs nothing. It is how you bound a
81
+ * call: with `auto`, trying again is what charges the browser price instead of the fetch one. */
82
+ escalate?: boolean;
83
+ /** How many extra tries to give a page the site blocks, each from a different address. 0 (the
84
+ * default) takes the site's first no as the answer. A blocked page costs nothing, so a try
85
+ * that is blocked again is free — but it takes as long as the first one did, so the call can
86
+ * run that many times longer. */
87
+ retry?: number;
88
+ /** What to hand back. "screenshot" and "pdf" come back as base64 and need the browser engine;
89
+ * asking for both costs no more than one. */
90
+ formats?: ("markdown" | "html" | "text" | "links" | "screenshot" | "pdf")[];
91
+ /** What the page should answer with. Set `"json"` when you are reading an API: anything else
92
+ * that comes back — a maintenance notice, a "checking your browser" page, a login form — is
93
+ * then not your answer. It costs nothing, and we try again from another address instead of
94
+ * handing you a page you cannot parse. Without it, whatever the page returns is your answer. */
95
+ expect?: "json";
96
+ /** Where the request leaves from. Defaults to the managed residential pool. */
97
+ proxy?: {
98
+ /** Which exit to leave through. "residential" is the managed pool, metered by the megabyte;
99
+ * "custom" is your own proxy — free on every plan, bytes never billed. */
100
+ pool?: "residential" | "custom";
101
+ /** Your own proxy, `http(s)://[user:pass@]host:port`. Required for pool "custom", refused
102
+ * for the managed one. */
103
+ server?: string;
104
+ /** Where the call should look like it comes from, ISO 3166-1 alpha-2 (`us`, `br`); `us`
105
+ * unless you say. On the managed pool it also picks the exit; the browser's clock and
106
+ * languages follow it on every pool. */
107
+ country?: string;
108
+ };
109
+ /** How to render it. Only the browser engine reads these — with `auto` they apply if the page
110
+ * turns out to need one. */
111
+ browser?: {
112
+ /** When the page counts as loaded. "load" (the default) waits for images and stylesheets;
113
+ * "domcontentloaded" is the fastest and stops at the HTML; "networkidle" waits until the
114
+ * page stops asking for things. Every page gets a short settle after this whichever you
115
+ * pick. */
116
+ waitUntil?: "load" | "domcontentloaded" | "networkidle";
117
+ /** Wait until this CSS selector is on the page — the dependable way to read something a
118
+ * script draws. If it never shows up the call comes back as a timeout at no charge, rather
119
+ * than the half-built page. */
120
+ waitForSelector?: string;
121
+ /** Wait this many milliseconds after the page settles, for the scripts no selector
122
+ * describes. It comes out of `timeoutMs`, never on top of it. */
123
+ waitMs?: number;
124
+ /** The window size the page is rendered in, 1280×800 unless you say. Set it when a site
125
+ * serves a different layout by width. */
126
+ viewport?: {
127
+ width: number;
128
+ height: number;
129
+ };
130
+ /** Screenshot the whole scrollable page instead of just the window. A long page makes a
131
+ * large answer — the image comes back as base64 inside the response. */
132
+ fullPage?: boolean;
133
+ };
134
+ /** Extra request headers to send to the page — an authorization token, a cookie, a custom user
135
+ * agent. The connection's own headers cannot be set. */
136
+ headers?: Record<string, string>;
137
+ /** How long to give the page before giving up, in milliseconds. A page that never arrives is a
138
+ * free outcome. */
139
+ timeoutMs?: number;
140
+ }
141
+ /** Arguments for `search()`. */
142
+ export interface SearchParams {
143
+ /** What to search for, in plain words — the same thing you would type. */
144
+ query: string;
145
+ /** How many results to hand back at most, 1–20. Billed per 10, so asking for more than 10 costs
146
+ * a second row. Fewer can come back than you asked for — an index has what it has, and
147
+ * `includeDomains` filters what it returns. */
148
+ limit?: number;
149
+ /** What kind of results. "general" is the web; "news" is dated journalism, and the only topic
150
+ * that reliably carries `publishedAt`. */
151
+ topic?: "general" | "news";
152
+ /** Only pages from the last day, week, month or year. Absent is any time. */
153
+ timeRange?: "day" | "week" | "month" | "year";
154
+ /** Only results on these hosts, bare (`linkedin.com`) — subdomains included. Asked of the
155
+ * search front AND enforced on the answer, so what comes back is on your list whatever the
156
+ * front did with it. */
157
+ includeDomains?: string[];
158
+ /** Also write a short paragraph answering the query from the results, in the query's language.
159
+ * Costs one extra credit; leave it off when your own model reads the snippets. */
160
+ answer?: boolean;
161
+ /** Where the search leaves from. `country` picks the exit AND the market the front answers for
162
+ * — `br` gets Brazilian results in Portuguese. */
163
+ proxy?: {
164
+ /** Which exit to leave through. "residential" is the managed pool, metered by the megabyte;
165
+ * "custom" is your own proxy — free on every plan, bytes never billed. */
166
+ pool?: "residential" | "custom";
167
+ /** Your own proxy, `http(s)://[user:pass@]host:port`. Required for pool "custom", refused
168
+ * for the managed one. */
169
+ server?: string;
170
+ /** Where the call should look like it comes from, ISO 3166-1 alpha-2 (`us`, `br`); `us`
171
+ * unless you say. On the managed pool it also picks the exit; the browser's clock and
172
+ * languages follow it on every pool. */
173
+ country?: string;
174
+ };
175
+ }
176
+ /** Arguments for `batches.create()`. */
177
+ export interface CreateBatchParams {
178
+ /** How to read it. "fetch" is a plain HTTP request; "browser" renders the page in a real
179
+ * Chromium; "auto" fetches first and escalates to the browser when the body turns out to be a
180
+ * JavaScript shell, billing whichever engine answered. */
181
+ engine?: "auto" | "fetch" | "browser";
182
+ /** Whether to try again a different way when the first attempt is blocked. `false` stops after
183
+ * one try — the site's refusal is your answer, and it costs nothing. It is how you bound a
184
+ * call: with `auto`, trying again is what charges the browser price instead of the fetch one. */
185
+ escalate?: boolean;
186
+ /** How many extra tries to give a page the site blocks, each from a different address. 0 (the
187
+ * default) takes the site's first no as the answer. A blocked page costs nothing, so a try
188
+ * that is blocked again is free — but it takes as long as the first one did, so the call can
189
+ * run that many times longer. */
190
+ retry?: number;
191
+ /** What to hand back. "screenshot" and "pdf" come back as base64 and need the browser engine;
192
+ * asking for both costs no more than one. */
193
+ formats?: ("markdown" | "html" | "text" | "links" | "screenshot" | "pdf")[];
194
+ /** What the page should answer with. Set `"json"` when you are reading an API: anything else
195
+ * that comes back — a maintenance notice, a "checking your browser" page, a login form — is
196
+ * then not your answer. It costs nothing, and we try again from another address instead of
197
+ * handing you a page you cannot parse. Without it, whatever the page returns is your answer. */
198
+ expect?: "json";
199
+ /** Where the request leaves from. Defaults to the managed residential pool. */
200
+ proxy?: {
201
+ /** Which exit to leave through. "residential" is the managed pool, metered by the megabyte;
202
+ * "custom" is your own proxy — free on every plan, bytes never billed. */
203
+ pool?: "residential" | "custom";
204
+ /** Your own proxy, `http(s)://[user:pass@]host:port`. Required for pool "custom", refused
205
+ * for the managed one. */
206
+ server?: string;
207
+ /** Where the call should look like it comes from, ISO 3166-1 alpha-2 (`us`, `br`); `us`
208
+ * unless you say. On the managed pool it also picks the exit; the browser's clock and
209
+ * languages follow it on every pool. */
210
+ country?: string;
211
+ };
212
+ /** How to render it. Only the browser engine reads these — with `auto` they apply if the page
213
+ * turns out to need one. */
214
+ browser?: {
215
+ /** When the page counts as loaded. "load" (the default) waits for images and stylesheets;
216
+ * "domcontentloaded" is the fastest and stops at the HTML; "networkidle" waits until the
217
+ * page stops asking for things. Every page gets a short settle after this whichever you
218
+ * pick. */
219
+ waitUntil?: "load" | "domcontentloaded" | "networkidle";
220
+ /** Wait until this CSS selector is on the page — the dependable way to read something a
221
+ * script draws. If it never shows up the call comes back as a timeout at no charge, rather
222
+ * than the half-built page. */
223
+ waitForSelector?: string;
224
+ /** Wait this many milliseconds after the page settles, for the scripts no selector
225
+ * describes. It comes out of `timeoutMs`, never on top of it. */
226
+ waitMs?: number;
227
+ /** The window size the page is rendered in, 1280×800 unless you say. Set it when a site
228
+ * serves a different layout by width. */
229
+ viewport?: {
230
+ width: number;
231
+ height: number;
232
+ };
233
+ /** Screenshot the whole scrollable page instead of just the window. A long page makes a
234
+ * large answer — the image comes back as base64 inside the response. */
235
+ fullPage?: boolean;
236
+ };
237
+ /** Extra request headers to send to the page — an authorization token, a cookie, a custom user
238
+ * agent. The connection's own headers cannot be set. */
239
+ headers?: Record<string, string>;
240
+ /** How long to give the page before giving up, in milliseconds. A page that never arrives is a
241
+ * free outcome. */
242
+ timeoutMs?: number;
243
+ /** The pages to read, in the order you want them back. How many one batch may carry depends on
244
+ * your plan. Duplicates are kept: position, not URL, is what lines results up against what you
245
+ * submitted. */
246
+ urls: string[];
247
+ /** Call this URL instead of making you poll. The signing secret is returned once, when the
248
+ * batch is created. */
249
+ webhook?: {
250
+ /** Where to POST when something happens. An https URL you control; private and loopback
251
+ * hosts are refused, the same as any other URL we fetch. */
252
+ url: string;
253
+ /** What to call about. "batch.completed" fires once, when every URL has a verdict.
254
+ * "batch.item.completed" fires per URL — one request from us per item, which is what makes
255
+ * a long batch usable before it ends, so ask for it deliberately. */
256
+ events?: ("batch.completed" | "batch.item.completed")[];
257
+ };
258
+ }
259
+ /** Arguments for `batches.quote()`. */
260
+ export interface QuoteBatchParams {
261
+ /** How to read it. "fetch" is a plain HTTP request; "browser" renders the page in a real
262
+ * Chromium; "auto" fetches first and escalates to the browser when the body turns out to be a
263
+ * JavaScript shell, billing whichever engine answered. */
264
+ engine?: "auto" | "fetch" | "browser";
265
+ /** Whether to try again a different way when the first attempt is blocked. `false` stops after
266
+ * one try — the site's refusal is your answer, and it costs nothing. It is how you bound a
267
+ * call: with `auto`, trying again is what charges the browser price instead of the fetch one. */
268
+ escalate?: boolean;
269
+ /** How many extra tries to give a page the site blocks, each from a different address. 0 (the
270
+ * default) takes the site's first no as the answer. A blocked page costs nothing, so a try
271
+ * that is blocked again is free — but it takes as long as the first one did, so the call can
272
+ * run that many times longer. */
273
+ retry?: number;
274
+ /** What to hand back. "screenshot" and "pdf" come back as base64 and need the browser engine;
275
+ * asking for both costs no more than one. */
276
+ formats?: ("markdown" | "html" | "text" | "links" | "screenshot" | "pdf")[];
277
+ /** What the page should answer with. Set `"json"` when you are reading an API: anything else
278
+ * that comes back — a maintenance notice, a "checking your browser" page, a login form — is
279
+ * then not your answer. It costs nothing, and we try again from another address instead of
280
+ * handing you a page you cannot parse. Without it, whatever the page returns is your answer. */
281
+ expect?: "json";
282
+ /** Where the request leaves from. Defaults to the managed residential pool. */
283
+ proxy?: {
284
+ /** Which exit to leave through. "residential" is the managed pool, metered by the megabyte;
285
+ * "custom" is your own proxy — free on every plan, bytes never billed. */
286
+ pool?: "residential" | "custom";
287
+ /** Your own proxy, `http(s)://[user:pass@]host:port`. Required for pool "custom", refused
288
+ * for the managed one. */
289
+ server?: string;
290
+ /** Where the call should look like it comes from, ISO 3166-1 alpha-2 (`us`, `br`); `us`
291
+ * unless you say. On the managed pool it also picks the exit; the browser's clock and
292
+ * languages follow it on every pool. */
293
+ country?: string;
294
+ };
295
+ /** How to render it. Only the browser engine reads these — with `auto` they apply if the page
296
+ * turns out to need one. */
297
+ browser?: {
298
+ /** When the page counts as loaded. "load" (the default) waits for images and stylesheets;
299
+ * "domcontentloaded" is the fastest and stops at the HTML; "networkidle" waits until the
300
+ * page stops asking for things. Every page gets a short settle after this whichever you
301
+ * pick. */
302
+ waitUntil?: "load" | "domcontentloaded" | "networkidle";
303
+ /** Wait until this CSS selector is on the page — the dependable way to read something a
304
+ * script draws. If it never shows up the call comes back as a timeout at no charge, rather
305
+ * than the half-built page. */
306
+ waitForSelector?: string;
307
+ /** Wait this many milliseconds after the page settles, for the scripts no selector
308
+ * describes. It comes out of `timeoutMs`, never on top of it. */
309
+ waitMs?: number;
310
+ /** The window size the page is rendered in, 1280×800 unless you say. Set it when a site
311
+ * serves a different layout by width. */
312
+ viewport?: {
313
+ width: number;
314
+ height: number;
315
+ };
316
+ /** Screenshot the whole scrollable page instead of just the window. A long page makes a
317
+ * large answer — the image comes back as base64 inside the response. */
318
+ fullPage?: boolean;
319
+ };
320
+ /** Extra request headers to send to the page — an authorization token, a cookie, a custom user
321
+ * agent. The connection's own headers cannot be set. */
322
+ headers?: Record<string, string>;
323
+ /** How long to give the page before giving up, in milliseconds. A page that never arrives is a
324
+ * free outcome. */
325
+ timeoutMs?: number;
326
+ /** The pages to read, in the order you want them back. How many one batch may carry depends on
327
+ * your plan. Duplicates are kept: position, not URL, is what lines results up against what you
328
+ * submitted. */
329
+ urls: string[];
330
+ /** Call this URL instead of making you poll. The signing secret is returned once, when the
331
+ * batch is created. */
332
+ webhook?: {
333
+ /** Where to POST when something happens. An https URL you control; private and loopback
334
+ * hosts are refused, the same as any other URL we fetch. */
335
+ url: string;
336
+ /** What to call about. "batch.completed" fires once, when every URL has a verdict.
337
+ * "batch.item.completed" fires per URL — one request from us per item, which is what makes
338
+ * a long batch usable before it ends, so ask for it deliberately. */
339
+ events?: ("batch.completed" | "batch.item.completed")[];
340
+ };
341
+ }
342
+ /** Arguments for `batches.list()`. */
343
+ export interface ListBatchesParams {
344
+ /** How many to return, newest first. Up to 100; 20 by default. */
345
+ limit?: number;
346
+ }
347
+ /** Arguments for `batches.get()`. */
348
+ export interface GetBatchParams {
349
+ /** The batch's id, as create returned it. */
350
+ id: string;
351
+ /** Also return the results themselves, in the order you submitted them. Off by default: most
352
+ * polls only want to know whether the batch has finished. */
353
+ items?: boolean;
354
+ /** Start the results at this position. Up to 200 come back at a time, so read the next page
355
+ * with `from` plus however many you just got, and stop when you reach `total`. */
356
+ from?: number;
357
+ }
358
+ /** Arguments for `batches.cancel()`. */
359
+ export interface CancelBatchParams {
360
+ /** The batch's id, as create returned it. */
361
+ id: string;
362
+ }
363
+ /** Arguments for `sessions.create()`. */
364
+ export interface CreateSessionParams {
365
+ /** How long to hold the browser, in minutes. Credits for the whole window are reserved when the
366
+ * session starts and the unused minutes are handed back when it closes, so asking for longer
367
+ * than you need costs nothing extra. Defaults to 10; your plan sets the ceiling. */
368
+ timeoutMin?: number;
369
+ /** Where the session leaves from, fixed for its whole life. Defaults to the managed residential
370
+ * pool. */
371
+ proxy?: {
372
+ /** Which exit to leave through. "residential" is the managed pool, metered by the megabyte;
373
+ * "custom" is your own proxy — free on every plan, bytes never billed. */
374
+ pool?: "residential" | "custom";
375
+ /** Your own proxy, `http(s)://[user:pass@]host:port`. Required for pool "custom", refused
376
+ * for the managed one. */
377
+ server?: string;
378
+ /** Where the call should look like it comes from, ISO 3166-1 alpha-2 (`us`, `br`); `us`
379
+ * unless you say. On the managed pool it also picks the exit; the browser's clock and
380
+ * languages follow it on every pool. */
381
+ country?: string;
382
+ };
383
+ }
384
+ /** Arguments for `sessions.quote()`. */
385
+ export interface QuoteSessionParams {
386
+ /** How long to hold the browser, in minutes. Credits for the whole window are reserved when the
387
+ * session starts and the unused minutes are handed back when it closes, so asking for longer
388
+ * than you need costs nothing extra. Defaults to 10; your plan sets the ceiling. */
389
+ timeoutMin?: number;
390
+ /** Where the session leaves from, fixed for its whole life. Defaults to the managed residential
391
+ * pool. */
392
+ proxy?: {
393
+ /** Which exit to leave through. "residential" is the managed pool, metered by the megabyte;
394
+ * "custom" is your own proxy — free on every plan, bytes never billed. */
395
+ pool?: "residential" | "custom";
396
+ /** Your own proxy, `http(s)://[user:pass@]host:port`. Required for pool "custom", refused
397
+ * for the managed one. */
398
+ server?: string;
399
+ /** Where the call should look like it comes from, ISO 3166-1 alpha-2 (`us`, `br`); `us`
400
+ * unless you say. On the managed pool it also picks the exit; the browser's clock and
401
+ * languages follow it on every pool. */
402
+ country?: string;
403
+ };
404
+ }
405
+ /** Arguments for `sessions.list()`. */
406
+ export interface ListSessionsParams {
407
+ /** How many to return, newest first. Up to 100; 20 by default. */
408
+ limit?: number;
409
+ }
410
+ /** Arguments for `sessions.get()`. */
411
+ export interface GetSessionParams {
412
+ /** The session's id, as create returned it. */
413
+ id: string;
414
+ }
415
+ /** Arguments for `sessions.close()`. */
416
+ export interface CloseSessionParams {
417
+ /** The session's id, as create returned it. */
418
+ id: string;
419
+ }
420
+ //# sourceMappingURL=params.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../../src/generated/params.ts"],"names":[],"mappings":"AAMA,gCAAgC;AAChC,MAAM,WAAW,YAAY;IACzB,iFAAiF;IACjF,GAAG,EAAE,MAAM,CAAC;IACZ;;+DAE2D;IAC3D,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;IACtC;;sGAEkG;IAClG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;sCAGkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;kDAC8C;IAC9C,OAAO,CAAC,EAAE,CAAC,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,GAAG,KAAK,CAAC,EAAE,CAAC;IAC5E;;;qGAGiG;IACjG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,KAAK,CAAC,EAAE;QACJ;mFAC2E;QAC3E,IAA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M,CAAC,EAAE,MAAM,CAAC;QAChB;;iDAEyC;QACzC,OAAO,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACL;AAED,uCAAuC;AACvC,MAAM,WAAW,kBAAkB;IAC/B,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,sCAAsC;AACtC,MAAM,WAAW,gBAAgB;IAC7B,+CAA+C;IAC/C,EAAE,EAAE,MAAM,CAAC;CACd;AAED,wCAAwC;AACxC,MAAM,WAAW,kBAAkB;IAC/B,+CAA+C;IAC/C,EAAE,EAAE,MAAM,CAAC;CACd"}
@@ -0,0 +1,7 @@
1
+ // GENERATED FILE — do not edit. Run `bun run sdk:gen`.
2
+ // Source: apps/api/src/operations/*.ts (zod input schemas)
3
+ //
4
+ // What each call takes. These are the same schemas the API validates with, so a
5
+ // value TypeScript accepts here is a value the server accepts too.
6
+ export {};
7
+ //# sourceMappingURL=params.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"params.js","sourceRoot":"","sources":["../../src/generated/params.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,2DAA2D;AAC3D,EAAE;AACF,gFAAgF;AAChF,mEAAmE"}
@@ -0,0 +1,8 @@
1
+ export { Scrapa } from "./client.ts";
2
+ export type { RequestOptions, RequestSpec, ScrapaOptions } from "./client.ts";
3
+ export { ScrapaError } from "./errors.ts";
4
+ export type { ClientErrorCode, ScrapaErrorInit } from "./errors.ts";
5
+ export { DEFAULT_BASE_URL, SDK_VERSION } from "./generated/operations.ts";
6
+ export * from "./generated/contract.ts";
7
+ export type * from "./generated/params.ts";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE1E,cAAc,yBAAyB,CAAC;AACxC,mBAAmB,uBAAuB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ // The published surface of `@scrapa/sdk`.
2
+ export { Scrapa } from "./client.js";
3
+ export { ScrapaError } from "./errors.js";
4
+ export { DEFAULT_BASE_URL, SDK_VERSION } from "./generated/operations.js";
5
+ // Every DTO, error code and header the API speaks.
6
+ export * from "./generated/contract.js";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC1E,mDAAmD;AACnD,cAAc,yBAAyB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@scrapa/sdk",
3
+ "version": "0.1.0",
4
+ "description": "Official TypeScript client for scrapa.app — scrape any web page as markdown, HTML, text, links, a screenshot or a PDF, search the web, and drive a real browser over CDP.",
5
+ "license": "MIT",
6
+ "homepage": "https://scrapa.app",
7
+ "keywords": [
8
+ "scraping",
9
+ "scraper",
10
+ "web-scraping",
11
+ "markdown",
12
+ "browser",
13
+ "headless-chrome",
14
+ "screenshot",
15
+ "proxy",
16
+ "search",
17
+ "serp",
18
+ "playwright",
19
+ "puppeteer",
20
+ "cdp",
21
+ "sdk"
22
+ ],
23
+ "type": "module",
24
+ "exports": {
25
+ ".": {
26
+ "types": "./dist/index.d.ts",
27
+ "default": "./dist/index.js"
28
+ }
29
+ },
30
+ "files": [
31
+ "dist",
32
+ "src",
33
+ "!src/__tests__"
34
+ ],
35
+ "sideEffects": false,
36
+ "publishConfig": {
37
+ "access": "public"
38
+ },
39
+ "engines": {
40
+ "node": ">=20"
41
+ },
42
+ "scripts": {
43
+ "build": "tsc -p tsconfig.build.json",
44
+ "prepack": "bun run build",
45
+ "release": "bun run typecheck && bun run test && bun publish",
46
+ "typecheck": "tsc --noEmit",
47
+ "lint": "eslint .",
48
+ "test": "vitest --run"
49
+ },
50
+ "devDependencies": {
51
+ "@types/node": "catalog:",
52
+ "typescript": "catalog:",
53
+ "vitest": "catalog:"
54
+ }
55
+ }