@hunt-labs/bytekit-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.
- package/dist/allowlist.d.ts +13 -0
- package/dist/allowlist.d.ts.map +1 -0
- package/dist/allowlist.js +38 -0
- package/dist/allowlist.js.map +1 -0
- package/dist/client.d.ts +40 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +81 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/account.d.ts +33 -0
- package/dist/resources/account.d.ts.map +1 -0
- package/dist/resources/account.js +43 -0
- package/dist/resources/account.js.map +1 -0
- package/dist/resources/bulk.d.ts +21 -0
- package/dist/resources/bulk.d.ts.map +1 -0
- package/dist/resources/bulk.js +31 -0
- package/dist/resources/bulk.js.map +1 -0
- package/dist/resources/fetch.d.ts +55 -0
- package/dist/resources/fetch.d.ts.map +1 -0
- package/dist/resources/fetch.js +49 -0
- package/dist/resources/fetch.js.map +1 -0
- package/dist/resources/monitors.d.ts +28 -0
- package/dist/resources/monitors.d.ts.map +1 -0
- package/dist/resources/monitors.js +42 -0
- package/dist/resources/monitors.js.map +1 -0
- package/dist/resources/recordings.d.ts +11 -0
- package/dist/resources/recordings.d.ts.map +1 -0
- package/dist/resources/recordings.js +15 -0
- package/dist/resources/recordings.js.map +1 -0
- package/dist/resources/scrape.d.ts +69 -0
- package/dist/resources/scrape.d.ts.map +1 -0
- package/dist/resources/scrape.js +31 -0
- package/dist/resources/scrape.js.map +1 -0
- package/dist/resources/screenshots.d.ts +11 -0
- package/dist/resources/screenshots.d.ts.map +1 -0
- package/dist/resources/screenshots.js +15 -0
- package/dist/resources/screenshots.js.map +1 -0
- package/dist/resources/search.d.ts +9 -0
- package/dist/resources/search.d.ts.map +1 -0
- package/dist/resources/search.js +11 -0
- package/dist/resources/search.js.map +1 -0
- package/dist/resources/sitemap.d.ts +11 -0
- package/dist/resources/sitemap.d.ts.map +1 -0
- package/dist/resources/sitemap.js +15 -0
- package/dist/resources/sitemap.js.map +1 -0
- package/dist/types.d.ts +89 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/package.json +41 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical list of SDK methods included in the v0.1 public surface.
|
|
3
|
+
*
|
|
4
|
+
* Derived from operations annotated with `x-sdk-scope: v0.1` in
|
|
5
|
+
* docs/api/openapi.yaml. The parity test (src/parity.test.ts) enforces
|
|
6
|
+
* bidirectional coverage: every spec operation must appear here, and every
|
|
7
|
+
* entry here must appear in the spec.
|
|
8
|
+
*
|
|
9
|
+
* To add a method: annotate the operation in the spec first, then add it here.
|
|
10
|
+
*/
|
|
11
|
+
export declare const V01_METHODS: readonly ["scrape.create", "scrape.get", "screenshots.create", "screenshots.get", "bulk.create", "bulk.get", "bulk.cancel", "bulk.screenshots.list", "scrape.bulk.create", "scrape.bulk.get", "fetch.create", "fetch.get", "fetch.bulk.create", "fetch.bulk.get", "monitors.create", "monitors.list", "monitors.get", "monitors.update", "monitors.delete", "monitors.captures.list", "sitemap.create", "sitemap.get", "search.query", "account.get"];
|
|
12
|
+
export type V01Method = (typeof V01_METHODS)[number];
|
|
13
|
+
//# sourceMappingURL=allowlist.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allowlist.d.ts","sourceRoot":"","sources":["../src/allowlist.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,WAAW,ubA0Bd,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical list of SDK methods included in the v0.1 public surface.
|
|
3
|
+
*
|
|
4
|
+
* Derived from operations annotated with `x-sdk-scope: v0.1` in
|
|
5
|
+
* docs/api/openapi.yaml. The parity test (src/parity.test.ts) enforces
|
|
6
|
+
* bidirectional coverage: every spec operation must appear here, and every
|
|
7
|
+
* entry here must appear in the spec.
|
|
8
|
+
*
|
|
9
|
+
* To add a method: annotate the operation in the spec first, then add it here.
|
|
10
|
+
*/
|
|
11
|
+
export const V01_METHODS = [
|
|
12
|
+
'scrape.create',
|
|
13
|
+
'scrape.get',
|
|
14
|
+
'screenshots.create',
|
|
15
|
+
'screenshots.get',
|
|
16
|
+
// recordings.create / recordings.get removed — endpoint deactivated (issue #1762).
|
|
17
|
+
'bulk.create',
|
|
18
|
+
'bulk.get',
|
|
19
|
+
'bulk.cancel',
|
|
20
|
+
'bulk.screenshots.list',
|
|
21
|
+
'scrape.bulk.create',
|
|
22
|
+
'scrape.bulk.get',
|
|
23
|
+
'fetch.create',
|
|
24
|
+
'fetch.get',
|
|
25
|
+
'fetch.bulk.create',
|
|
26
|
+
'fetch.bulk.get',
|
|
27
|
+
'monitors.create',
|
|
28
|
+
'monitors.list',
|
|
29
|
+
'monitors.get',
|
|
30
|
+
'monitors.update',
|
|
31
|
+
'monitors.delete',
|
|
32
|
+
'monitors.captures.list',
|
|
33
|
+
'sitemap.create',
|
|
34
|
+
'sitemap.get',
|
|
35
|
+
'search.query',
|
|
36
|
+
'account.get',
|
|
37
|
+
];
|
|
38
|
+
//# sourceMappingURL=allowlist.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allowlist.js","sourceRoot":"","sources":["../src/allowlist.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,eAAe;IACf,YAAY;IACZ,oBAAoB;IACpB,iBAAiB;IACjB,mFAAmF;IACnF,aAAa;IACb,UAAU;IACV,aAAa;IACb,uBAAuB;IACvB,oBAAoB;IACpB,iBAAiB;IACjB,cAAc;IACd,WAAW;IACX,mBAAmB;IACnB,gBAAgB;IAChB,iBAAiB;IACjB,eAAe;IACf,cAAc;IACd,iBAAiB;IACjB,iBAAiB;IACjB,wBAAwB;IACxB,gBAAgB;IAChB,aAAa;IACb,cAAc;IACd,aAAa;CACL,CAAC"}
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ScrapeResource } from './resources/scrape.js';
|
|
2
|
+
import { ScreenshotsResource } from './resources/screenshots.js';
|
|
3
|
+
import { RecordingsResource } from './resources/recordings.js';
|
|
4
|
+
import { BulkResource } from './resources/bulk.js';
|
|
5
|
+
import { FetchResource } from './resources/fetch.js';
|
|
6
|
+
import { MonitorsResource } from './resources/monitors.js';
|
|
7
|
+
import { SitemapResource } from './resources/sitemap.js';
|
|
8
|
+
import { SearchResource } from './resources/search.js';
|
|
9
|
+
import { AccountResource } from './resources/account.js';
|
|
10
|
+
export interface RapidCrawlOptions {
|
|
11
|
+
apiKey: string;
|
|
12
|
+
baseUrl?: string;
|
|
13
|
+
}
|
|
14
|
+
/** Thrown when the API responds with a 4xx or 5xx status code. */
|
|
15
|
+
export declare class RapidCrawlError extends Error {
|
|
16
|
+
readonly status: number;
|
|
17
|
+
readonly code: string;
|
|
18
|
+
constructor(status: number, code: string, message: string);
|
|
19
|
+
}
|
|
20
|
+
export declare class RapidCrawl {
|
|
21
|
+
private readonly apiKey;
|
|
22
|
+
private readonly baseUrl;
|
|
23
|
+
readonly scrape: ScrapeResource;
|
|
24
|
+
readonly screenshots: ScreenshotsResource;
|
|
25
|
+
readonly recordings: RecordingsResource;
|
|
26
|
+
readonly bulk: BulkResource;
|
|
27
|
+
readonly fetch: FetchResource;
|
|
28
|
+
readonly monitors: MonitorsResource;
|
|
29
|
+
readonly sitemap: SitemapResource;
|
|
30
|
+
readonly search: SearchResource;
|
|
31
|
+
readonly account: AccountResource;
|
|
32
|
+
constructor(options: RapidCrawlOptions);
|
|
33
|
+
/**
|
|
34
|
+
* Make an authenticated JSON request to the RapidCrawl API.
|
|
35
|
+
*
|
|
36
|
+
* Throws `RapidCrawlError` on 4xx/5xx responses.
|
|
37
|
+
*/
|
|
38
|
+
request<T>(method: string, path: string, body?: unknown): Promise<T>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAIzD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,kEAAkE;AAClE,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAM1D;AAED,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IAEjC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,mBAAmB,CAAC;IAC1C,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC;IACxC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;gBAEtB,OAAO,EAAE,iBAAiB;IActC;;;;OAIG;IACG,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;CA+B3E"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { ScrapeResource } from './resources/scrape.js';
|
|
2
|
+
import { ScreenshotsResource } from './resources/screenshots.js';
|
|
3
|
+
import { RecordingsResource } from './resources/recordings.js';
|
|
4
|
+
import { BulkResource } from './resources/bulk.js';
|
|
5
|
+
import { FetchResource } from './resources/fetch.js';
|
|
6
|
+
import { MonitorsResource } from './resources/monitors.js';
|
|
7
|
+
import { SitemapResource } from './resources/sitemap.js';
|
|
8
|
+
import { SearchResource } from './resources/search.js';
|
|
9
|
+
import { AccountResource } from './resources/account.js';
|
|
10
|
+
const DEFAULT_BASE_URL = 'https://api.bytekit.com';
|
|
11
|
+
/** Thrown when the API responds with a 4xx or 5xx status code. */
|
|
12
|
+
export class RapidCrawlError extends Error {
|
|
13
|
+
status;
|
|
14
|
+
code;
|
|
15
|
+
constructor(status, code, message) {
|
|
16
|
+
super(message);
|
|
17
|
+
this.name = 'RapidCrawlError';
|
|
18
|
+
this.status = status;
|
|
19
|
+
this.code = code;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export class RapidCrawl {
|
|
23
|
+
apiKey;
|
|
24
|
+
baseUrl;
|
|
25
|
+
scrape;
|
|
26
|
+
screenshots;
|
|
27
|
+
recordings;
|
|
28
|
+
bulk;
|
|
29
|
+
fetch;
|
|
30
|
+
monitors;
|
|
31
|
+
sitemap;
|
|
32
|
+
search;
|
|
33
|
+
account;
|
|
34
|
+
constructor(options) {
|
|
35
|
+
this.apiKey = options.apiKey;
|
|
36
|
+
this.baseUrl = options.baseUrl ?? DEFAULT_BASE_URL;
|
|
37
|
+
this.scrape = new ScrapeResource(this);
|
|
38
|
+
this.screenshots = new ScreenshotsResource(this);
|
|
39
|
+
this.recordings = new RecordingsResource(this);
|
|
40
|
+
this.bulk = new BulkResource(this);
|
|
41
|
+
this.fetch = new FetchResource(this);
|
|
42
|
+
this.monitors = new MonitorsResource(this);
|
|
43
|
+
this.sitemap = new SitemapResource(this);
|
|
44
|
+
this.search = new SearchResource(this);
|
|
45
|
+
this.account = new AccountResource(this);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Make an authenticated JSON request to the RapidCrawl API.
|
|
49
|
+
*
|
|
50
|
+
* Throws `RapidCrawlError` on 4xx/5xx responses.
|
|
51
|
+
*/
|
|
52
|
+
async request(method, path, body) {
|
|
53
|
+
const url = `${this.baseUrl}${path}`;
|
|
54
|
+
const init = {
|
|
55
|
+
method,
|
|
56
|
+
headers: {
|
|
57
|
+
Authorization: `Bearer ${this.apiKey}`,
|
|
58
|
+
'Content-Type': 'application/json',
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
if (body !== undefined) {
|
|
62
|
+
init.body = JSON.stringify(body);
|
|
63
|
+
}
|
|
64
|
+
const response = await fetch(url, init);
|
|
65
|
+
if (!response.ok) {
|
|
66
|
+
let code = 'internal_error';
|
|
67
|
+
let message = response.statusText;
|
|
68
|
+
try {
|
|
69
|
+
const json = (await response.json());
|
|
70
|
+
code = json.error?.code ?? code;
|
|
71
|
+
message = json.error?.message ?? message;
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
// leave defaults
|
|
75
|
+
}
|
|
76
|
+
throw new RapidCrawlError(response.status, code, message);
|
|
77
|
+
}
|
|
78
|
+
return response.json();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,gBAAgB,GAAG,yBAAyB,CAAC;AAOnD,kEAAkE;AAClE,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAC/B,MAAM,CAAS;IACf,IAAI,CAAS;IAEtB,YAAY,MAAc,EAAE,IAAY,EAAE,OAAe;QACvD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED,MAAM,OAAO,UAAU;IACJ,MAAM,CAAS;IACf,OAAO,CAAS;IAExB,MAAM,CAAiB;IACvB,WAAW,CAAsB;IACjC,UAAU,CAAqB;IAC/B,IAAI,CAAe;IACnB,KAAK,CAAgB;IACrB,QAAQ,CAAmB;IAC3B,OAAO,CAAkB;IACzB,MAAM,CAAiB;IACvB,OAAO,CAAkB;IAElC,YAAY,OAA0B;QACpC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,gBAAgB,CAAC;QACnD,IAAI,CAAC,MAAM,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,WAAW,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;QACjD,IAAI,CAAC,UAAU,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAC/C,IAAI,CAAC,IAAI,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,CAAC,KAAK,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,QAAQ,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,OAAO,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,OAAO,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,OAAO,CAAI,MAAc,EAAE,IAAY,EAAE,IAAc;QAC3D,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,GAAG,IAAI,EAAE,CAAC;QACrC,MAAM,IAAI,GAAgB;YACxB,MAAM;YACN,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE;gBACtC,cAAc,EAAE,kBAAkB;aACnC;SACF,CAAC;QAEF,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACnC,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAExC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,IAAI,IAAI,GAAG,gBAAgB,CAAC;YAC5B,IAAI,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC;YAClC,IAAI,CAAC;gBACH,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAoD,CAAC;gBACxF,IAAI,GAAG,IAAI,CAAC,KAAK,EAAE,IAAI,IAAI,IAAI,CAAC;gBAChC,OAAO,GAAG,IAAI,CAAC,KAAK,EAAE,OAAO,IAAI,OAAO,CAAC;YAC3C,CAAC;YAAC,MAAM,CAAC;gBACP,iBAAiB;YACnB,CAAC;YACD,MAAM,IAAI,eAAe,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAC5D,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,EAAgB,CAAC;IACvC,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { RapidCrawl, RapidCrawlError } from './client.js';
|
|
2
|
+
export type { RapidCrawlOptions } from './client.js';
|
|
3
|
+
export { V01_METHODS } from './allowlist.js';
|
|
4
|
+
export type { V01Method } from './allowlist.js';
|
|
5
|
+
export type { ScrapeId, ScreenshotId, RecordingId, BulkId, MonitorId, SitemapId, ApiKeyId, SearchType, SearchDateRange, SearchOpts, SearchResult, SearchResultImage, SearchResponse, } from './types.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC1D,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,YAAY,EACV,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,MAAM,EACN,SAAS,EACT,SAAS,EACT,QAAQ,EACR,UAAU,EACV,eAAe,EACf,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,cAAc,GACf,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { RapidCrawl } from '../client.js';
|
|
2
|
+
import type { operations } from '../generated/api.js';
|
|
3
|
+
import type { ApiKeyId } from '../types.js';
|
|
4
|
+
/**
|
|
5
|
+
* 200 payload of POST /v1/account/api-keys/{id}/reveal — `{ key: string }`.
|
|
6
|
+
* Derived from the generated OpenAPI types so it stays in sync with the spec.
|
|
7
|
+
*/
|
|
8
|
+
export type RevealApiKeyResponse = operations['revealApiKey']['responses'][200]['content']['application/json'];
|
|
9
|
+
export declare class AccountResource {
|
|
10
|
+
private readonly client;
|
|
11
|
+
readonly apiKeys: ApiKeysResource;
|
|
12
|
+
constructor(client: RapidCrawl);
|
|
13
|
+
/** GET /v1/account — get the authenticated account */
|
|
14
|
+
get(): Promise<unknown>;
|
|
15
|
+
}
|
|
16
|
+
declare class ApiKeysResource {
|
|
17
|
+
private readonly client;
|
|
18
|
+
constructor(client: RapidCrawl);
|
|
19
|
+
/** POST /v1/account/api-keys — create a new API key */
|
|
20
|
+
create(opts: Record<string, unknown>): Promise<unknown>;
|
|
21
|
+
/** GET /v1/account/api-keys — list all API keys for the account */
|
|
22
|
+
list(): Promise<unknown>;
|
|
23
|
+
/** GET /v1/account/api-keys/{id} — get an API key by ID */
|
|
24
|
+
get(id: ApiKeyId): Promise<unknown>;
|
|
25
|
+
/** PATCH /v1/account/api-keys/{id} — update an API key */
|
|
26
|
+
update(id: ApiKeyId, opts: Record<string, unknown>): Promise<unknown>;
|
|
27
|
+
/** DELETE /v1/account/api-keys/{id} — revoke an API key (idempotent) */
|
|
28
|
+
revoke(id: ApiKeyId): Promise<unknown>;
|
|
29
|
+
/** POST /v1/account/api-keys/{id}/reveal — reveal the plaintext API key value */
|
|
30
|
+
reveal(id: ApiKeyId): Promise<RevealApiKeyResponse>;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/resources/account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAC9B,UAAU,CAAC,cAAc,CAAC,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC;AAE9E,qBAAa,eAAe;IAGd,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;gBAEL,MAAM,EAAE,UAAU;IAI/C,sDAAsD;IACtD,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;CAGxB;AAED,cAAM,eAAe;IACP,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C,uDAAuD;IACvD,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAIvD,mEAAmE;IACnE,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;IAIxB,2DAA2D;IAC3D,GAAG,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IAInC,0DAA0D;IAC1D,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAIrE,wEAAwE;IACxE,MAAM,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IAItC,iFAAiF;IACjF,MAAM,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAGpD"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export class AccountResource {
|
|
2
|
+
client;
|
|
3
|
+
apiKeys;
|
|
4
|
+
constructor(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
this.apiKeys = new ApiKeysResource(client);
|
|
7
|
+
}
|
|
8
|
+
/** GET /v1/account — get the authenticated account */
|
|
9
|
+
get() {
|
|
10
|
+
return this.client.request('GET', '/v1/account');
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
class ApiKeysResource {
|
|
14
|
+
client;
|
|
15
|
+
constructor(client) {
|
|
16
|
+
this.client = client;
|
|
17
|
+
}
|
|
18
|
+
/** POST /v1/account/api-keys — create a new API key */
|
|
19
|
+
create(opts) {
|
|
20
|
+
return this.client.request('POST', '/v1/account/api-keys', opts);
|
|
21
|
+
}
|
|
22
|
+
/** GET /v1/account/api-keys — list all API keys for the account */
|
|
23
|
+
list() {
|
|
24
|
+
return this.client.request('GET', '/v1/account/api-keys');
|
|
25
|
+
}
|
|
26
|
+
/** GET /v1/account/api-keys/{id} — get an API key by ID */
|
|
27
|
+
get(id) {
|
|
28
|
+
return this.client.request('GET', `/v1/account/api-keys/${id}`);
|
|
29
|
+
}
|
|
30
|
+
/** PATCH /v1/account/api-keys/{id} — update an API key */
|
|
31
|
+
update(id, opts) {
|
|
32
|
+
return this.client.request('PATCH', `/v1/account/api-keys/${id}`, opts);
|
|
33
|
+
}
|
|
34
|
+
/** DELETE /v1/account/api-keys/{id} — revoke an API key (idempotent) */
|
|
35
|
+
revoke(id) {
|
|
36
|
+
return this.client.request('DELETE', `/v1/account/api-keys/${id}`);
|
|
37
|
+
}
|
|
38
|
+
/** POST /v1/account/api-keys/{id}/reveal — reveal the plaintext API key value */
|
|
39
|
+
reveal(id) {
|
|
40
|
+
return this.client.request('POST', `/v1/account/api-keys/${id}/reveal`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=account.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/resources/account.ts"],"names":[],"mappings":"AAWA,MAAM,OAAO,eAAe;IAGG;IAFpB,OAAO,CAAkB;IAElC,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;QAC7C,IAAI,CAAC,OAAO,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;IAED,sDAAsD;IACtD,GAAG;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IACnD,CAAC;CACF;AAED,MAAM,eAAe;IACU;IAA7B,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD,uDAAuD;IACvD,MAAM,CAAC,IAA6B;QAClC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,sBAAsB,EAAE,IAAI,CAAC,CAAC;IACnE,CAAC;IAED,mEAAmE;IACnE,IAAI;QACF,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,sBAAsB,CAAC,CAAC;IAC5D,CAAC;IAED,2DAA2D;IAC3D,GAAG,CAAC,EAAY;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,wBAAwB,EAAE,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,0DAA0D;IAC1D,MAAM,CAAC,EAAY,EAAE,IAA6B;QAChD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,wBAAwB,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;IAC1E,CAAC;IAED,wEAAwE;IACxE,MAAM,CAAC,EAAY;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,wBAAwB,EAAE,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,iFAAiF;IACjF,MAAM,CAAC,EAAY;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAuB,MAAM,EAAE,wBAAwB,EAAE,SAAS,CAAC,CAAC;IAChG,CAAC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { RapidCrawl } from '../client.js';
|
|
2
|
+
import type { BulkId } from '../types.js';
|
|
3
|
+
export declare class BulkResource {
|
|
4
|
+
private readonly client;
|
|
5
|
+
readonly screenshots: BulkScreenshotsResource;
|
|
6
|
+
constructor(client: RapidCrawl);
|
|
7
|
+
/** POST /v1/bulk — create a bulk screenshots job */
|
|
8
|
+
create(opts: Record<string, unknown>): Promise<unknown>;
|
|
9
|
+
/** GET /v1/bulk/{id} — get a bulk job status */
|
|
10
|
+
get(id: BulkId): Promise<unknown>;
|
|
11
|
+
/** DELETE /v1/bulk/{id} — cancel an in-flight bulk job */
|
|
12
|
+
cancel(id: BulkId): Promise<unknown>;
|
|
13
|
+
}
|
|
14
|
+
declare class BulkScreenshotsResource {
|
|
15
|
+
private readonly client;
|
|
16
|
+
constructor(client: RapidCrawl);
|
|
17
|
+
/** GET /v1/bulk/{id}/screenshots — list screenshots in a bulk job */
|
|
18
|
+
list(id: BulkId): Promise<unknown>;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=bulk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bulk.d.ts","sourceRoot":"","sources":["../../src/resources/bulk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,qBAAa,YAAY;IAGX,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,QAAQ,CAAC,WAAW,EAAE,uBAAuB,CAAC;gBAEjB,MAAM,EAAE,UAAU;IAI/C,oDAAoD;IACpD,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAIvD,gDAAgD;IAChD,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIjC,0DAA0D;IAC1D,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAGrC;AAED,cAAM,uBAAuB;IACf,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C,qEAAqE;IACrE,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAGnC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export class BulkResource {
|
|
2
|
+
client;
|
|
3
|
+
screenshots;
|
|
4
|
+
constructor(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
this.screenshots = new BulkScreenshotsResource(client);
|
|
7
|
+
}
|
|
8
|
+
/** POST /v1/bulk — create a bulk screenshots job */
|
|
9
|
+
create(opts) {
|
|
10
|
+
return this.client.request('POST', '/v1/bulk', opts);
|
|
11
|
+
}
|
|
12
|
+
/** GET /v1/bulk/{id} — get a bulk job status */
|
|
13
|
+
get(id) {
|
|
14
|
+
return this.client.request('GET', `/v1/bulk/${id}`);
|
|
15
|
+
}
|
|
16
|
+
/** DELETE /v1/bulk/{id} — cancel an in-flight bulk job */
|
|
17
|
+
cancel(id) {
|
|
18
|
+
return this.client.request('DELETE', `/v1/bulk/${id}`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
class BulkScreenshotsResource {
|
|
22
|
+
client;
|
|
23
|
+
constructor(client) {
|
|
24
|
+
this.client = client;
|
|
25
|
+
}
|
|
26
|
+
/** GET /v1/bulk/{id}/screenshots — list screenshots in a bulk job */
|
|
27
|
+
list(id) {
|
|
28
|
+
return this.client.request('GET', `/v1/bulk/${id}/screenshots`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=bulk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bulk.js","sourceRoot":"","sources":["../../src/resources/bulk.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,YAAY;IAGM;IAFpB,WAAW,CAA0B;IAE9C,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;QAC7C,IAAI,CAAC,WAAW,GAAG,IAAI,uBAAuB,CAAC,MAAM,CAAC,CAAC;IACzD,CAAC;IAED,oDAAoD;IACpD,MAAM,CAAC,IAA6B;QAClC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;IACvD,CAAC;IAED,gDAAgD;IAChD,GAAG,CAAC,EAAU;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,0DAA0D;IAC1D,MAAM,CAAC,EAAU;QACf,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,YAAY,EAAE,EAAE,CAAC,CAAC;IACzD,CAAC;CACF;AAED,MAAM,uBAAuB;IACE;IAA7B,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD,qEAAqE;IACrE,IAAI,CAAC,EAAU;QACb,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,YAAY,EAAE,cAAc,CAAC,CAAC;IAClE,CAAC;CACF"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { RapidCrawl } from '../client.js';
|
|
2
|
+
import type { BulkId } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Options for fetch endpoints.
|
|
5
|
+
*
|
|
6
|
+
* fetch.create (POST /v1/fetch) and fetch.get (GET /v1/fetch) are NOT
|
|
7
|
+
* ID-based — they operate directly on URL content.
|
|
8
|
+
*/
|
|
9
|
+
export interface FetchOpts {
|
|
10
|
+
url: string;
|
|
11
|
+
format?: string;
|
|
12
|
+
country?: string;
|
|
13
|
+
timeout_ms?: number;
|
|
14
|
+
/**
|
|
15
|
+
* How long a freshly fetched URL may be served from cache. Matches the
|
|
16
|
+
* OpenAPI `FetchRequest.cache_ttl` schema: a duration string (`"48h"`,
|
|
17
|
+
* `"2d"`, up to `168h` / `7d`) or the integer `0` to disable caching.
|
|
18
|
+
* Defaults to `"48h"` server-side when omitted.
|
|
19
|
+
*/
|
|
20
|
+
cache_ttl?: string | 0;
|
|
21
|
+
/**
|
|
22
|
+
* User-supplied JSON payload, base64-encoded into the `X-Fetch-Custom`
|
|
23
|
+
* response header so callers can correlate the response to caller-side
|
|
24
|
+
* state. Capped at 4096 UTF-8 bytes after JSON serialization. Does NOT
|
|
25
|
+
* affect cache-key inputs.
|
|
26
|
+
*/
|
|
27
|
+
custom?: Record<string, unknown>;
|
|
28
|
+
}
|
|
29
|
+
export declare class FetchResource {
|
|
30
|
+
private readonly client;
|
|
31
|
+
readonly bulk: FetchBulkResource;
|
|
32
|
+
constructor(client: RapidCrawl);
|
|
33
|
+
/**
|
|
34
|
+
* POST /v1/fetch — fetch URL content via POST body.
|
|
35
|
+
*
|
|
36
|
+
* Returns content directly (not ID-based).
|
|
37
|
+
*/
|
|
38
|
+
create(opts: FetchOpts): Promise<unknown>;
|
|
39
|
+
/**
|
|
40
|
+
* GET /v1/fetch — fetch URL content via query params.
|
|
41
|
+
*
|
|
42
|
+
* Returns content directly (not ID-based).
|
|
43
|
+
*/
|
|
44
|
+
get(opts: FetchOpts): Promise<unknown>;
|
|
45
|
+
}
|
|
46
|
+
declare class FetchBulkResource {
|
|
47
|
+
private readonly client;
|
|
48
|
+
constructor(client: RapidCrawl);
|
|
49
|
+
/** POST /v1/fetch/bulk — create a bulk fetch job */
|
|
50
|
+
create(opts: Record<string, unknown>): Promise<unknown>;
|
|
51
|
+
/** GET /v1/fetch/bulk/{id} — get a bulk fetch job */
|
|
52
|
+
get(id: BulkId): Promise<unknown>;
|
|
53
|
+
}
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/resources/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC;IACvB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,qBAAa,aAAa;IAGZ,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;gBAEJ,MAAM,EAAE,UAAU;IAI/C;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC;IAIzC;;;;OAIG;IACH,GAAG,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC;CASvC;AAED,cAAM,iBAAiB;IACT,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C,oDAAoD;IACpD,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAIvD,qDAAqD;IACrD,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAGlC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export class FetchResource {
|
|
2
|
+
client;
|
|
3
|
+
bulk;
|
|
4
|
+
constructor(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
this.bulk = new FetchBulkResource(client);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* POST /v1/fetch — fetch URL content via POST body.
|
|
10
|
+
*
|
|
11
|
+
* Returns content directly (not ID-based).
|
|
12
|
+
*/
|
|
13
|
+
create(opts) {
|
|
14
|
+
return this.client.request('POST', '/v1/fetch', opts);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* GET /v1/fetch — fetch URL content via query params.
|
|
18
|
+
*
|
|
19
|
+
* Returns content directly (not ID-based).
|
|
20
|
+
*/
|
|
21
|
+
get(opts) {
|
|
22
|
+
const params = new URLSearchParams();
|
|
23
|
+
params.set('url', opts.url);
|
|
24
|
+
if (opts.format !== undefined)
|
|
25
|
+
params.set('format', opts.format);
|
|
26
|
+
if (opts.country !== undefined)
|
|
27
|
+
params.set('country', opts.country);
|
|
28
|
+
if (opts.timeout_ms !== undefined)
|
|
29
|
+
params.set('timeout_ms', String(opts.timeout_ms));
|
|
30
|
+
if (opts.cache_ttl !== undefined)
|
|
31
|
+
params.set('cache_ttl', String(opts.cache_ttl));
|
|
32
|
+
return this.client.request('GET', `/v1/fetch?${params.toString()}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
class FetchBulkResource {
|
|
36
|
+
client;
|
|
37
|
+
constructor(client) {
|
|
38
|
+
this.client = client;
|
|
39
|
+
}
|
|
40
|
+
/** POST /v1/fetch/bulk — create a bulk fetch job */
|
|
41
|
+
create(opts) {
|
|
42
|
+
return this.client.request('POST', '/v1/fetch/bulk', opts);
|
|
43
|
+
}
|
|
44
|
+
/** GET /v1/fetch/bulk/{id} — get a bulk fetch job */
|
|
45
|
+
get(id) {
|
|
46
|
+
return this.client.request('GET', `/v1/fetch/bulk/${id}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=fetch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../src/resources/fetch.ts"],"names":[],"mappings":"AA8BA,MAAM,OAAO,aAAa;IAGK;IAFpB,IAAI,CAAoB;IAEjC,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;QAC7C,IAAI,CAAC,IAAI,GAAG,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,IAAe;QACpB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;IACxD,CAAC;IAED;;;;OAIG;IACH,GAAG,CAAC,IAAe;QACjB,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;QACrC,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS;YAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACjE,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS;YAAE,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACpE,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS;YAAE,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;QACrF,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;YAAE,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;QAClF,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,aAAa,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IACtE,CAAC;CACF;AAED,MAAM,iBAAiB;IACQ;IAA7B,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD,oDAAoD;IACpD,MAAM,CAAC,IAA6B;QAClC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,gBAAgB,EAAE,IAAI,CAAC,CAAC;IAC7D,CAAC;IAED,qDAAqD;IACrD,GAAG,CAAC,EAAU;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;IAC5D,CAAC;CACF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { RapidCrawl } from '../client.js';
|
|
2
|
+
import type { MonitorId } from '../types.js';
|
|
3
|
+
export declare class MonitorsResource {
|
|
4
|
+
private readonly client;
|
|
5
|
+
readonly captures: MonitorCapturesResource;
|
|
6
|
+
constructor(client: RapidCrawl);
|
|
7
|
+
/**
|
|
8
|
+
* POST /v1/monitors — create a page-change monitor (screenshot or scrape capture).
|
|
9
|
+
* First-capture behavior is the same for both types: the first capture is a silent baseline (has_change=false, change_pct=null) with no change_detected webhook, whether the monitor is `scrape` or `screenshot`. From the second capture onward both types diff against the previous capture.
|
|
10
|
+
*/
|
|
11
|
+
create(opts: Record<string, unknown>): Promise<unknown>;
|
|
12
|
+
/** GET /v1/monitors — list all monitors for the account */
|
|
13
|
+
list(): Promise<unknown>;
|
|
14
|
+
/** GET /v1/monitors/{id} — get a monitor by ID */
|
|
15
|
+
get(id: MonitorId): Promise<unknown>;
|
|
16
|
+
/** PATCH /v1/monitors/{id} — update a monitor */
|
|
17
|
+
update(id: MonitorId, opts: Record<string, unknown>): Promise<unknown>;
|
|
18
|
+
/** DELETE /v1/monitors/{id} — delete a monitor */
|
|
19
|
+
delete(id: MonitorId): Promise<unknown>;
|
|
20
|
+
}
|
|
21
|
+
declare class MonitorCapturesResource {
|
|
22
|
+
private readonly client;
|
|
23
|
+
constructor(client: RapidCrawl);
|
|
24
|
+
/** GET /v1/monitors/{id}/captures — list captures for a monitor */
|
|
25
|
+
list(id: MonitorId): Promise<unknown>;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=monitors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monitors.d.ts","sourceRoot":"","sources":["../../src/resources/monitors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,qBAAa,gBAAgB;IAGf,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,QAAQ,CAAC,QAAQ,EAAE,uBAAuB,CAAC;gBAEd,MAAM,EAAE,UAAU;IAI/C;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAIvD,2DAA2D;IAC3D,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;IAIxB,kDAAkD;IAClD,GAAG,CAAC,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC;IAIpC,iDAAiD;IACjD,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAItE,kDAAkD;IAClD,MAAM,CAAC,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC;CAGxC;AAED,cAAM,uBAAuB;IACf,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C,mEAAmE;IACnE,IAAI,CAAC,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC;CAGtC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export class MonitorsResource {
|
|
2
|
+
client;
|
|
3
|
+
captures;
|
|
4
|
+
constructor(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
this.captures = new MonitorCapturesResource(client);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* POST /v1/monitors — create a page-change monitor (screenshot or scrape capture).
|
|
10
|
+
* First-capture behavior is the same for both types: the first capture is a silent baseline (has_change=false, change_pct=null) with no change_detected webhook, whether the monitor is `scrape` or `screenshot`. From the second capture onward both types diff against the previous capture.
|
|
11
|
+
*/
|
|
12
|
+
create(opts) {
|
|
13
|
+
return this.client.request('POST', '/v1/monitors', opts);
|
|
14
|
+
}
|
|
15
|
+
/** GET /v1/monitors — list all monitors for the account */
|
|
16
|
+
list() {
|
|
17
|
+
return this.client.request('GET', '/v1/monitors');
|
|
18
|
+
}
|
|
19
|
+
/** GET /v1/monitors/{id} — get a monitor by ID */
|
|
20
|
+
get(id) {
|
|
21
|
+
return this.client.request('GET', `/v1/monitors/${id}`);
|
|
22
|
+
}
|
|
23
|
+
/** PATCH /v1/monitors/{id} — update a monitor */
|
|
24
|
+
update(id, opts) {
|
|
25
|
+
return this.client.request('PATCH', `/v1/monitors/${id}`, opts);
|
|
26
|
+
}
|
|
27
|
+
/** DELETE /v1/monitors/{id} — delete a monitor */
|
|
28
|
+
delete(id) {
|
|
29
|
+
return this.client.request('DELETE', `/v1/monitors/${id}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
class MonitorCapturesResource {
|
|
33
|
+
client;
|
|
34
|
+
constructor(client) {
|
|
35
|
+
this.client = client;
|
|
36
|
+
}
|
|
37
|
+
/** GET /v1/monitors/{id}/captures — list captures for a monitor */
|
|
38
|
+
list(id) {
|
|
39
|
+
return this.client.request('GET', `/v1/monitors/${id}/captures`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=monitors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monitors.js","sourceRoot":"","sources":["../../src/resources/monitors.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,gBAAgB;IAGE;IAFpB,QAAQ,CAA0B;IAE3C,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;QAC7C,IAAI,CAAC,QAAQ,GAAG,IAAI,uBAAuB,CAAC,MAAM,CAAC,CAAC;IACtD,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,IAA6B;QAClC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;IAC3D,CAAC;IAED,2DAA2D;IAC3D,IAAI;QACF,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;IACpD,CAAC;IAED,kDAAkD;IAClD,GAAG,CAAC,EAAa;QACf,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED,iDAAiD;IACjD,MAAM,CAAC,EAAa,EAAE,IAA6B;QACjD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,gBAAgB,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;IAClE,CAAC;IAED,kDAAkD;IAClD,MAAM,CAAC,EAAa;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;IAC7D,CAAC;CACF;AAED,MAAM,uBAAuB;IACE;IAA7B,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD,mEAAmE;IACnE,IAAI,CAAC,EAAa;QAChB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,gBAAgB,EAAE,WAAW,CAAC,CAAC;IACnE,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RapidCrawl } from '../client.js';
|
|
2
|
+
import type { RecordingId } from '../types.js';
|
|
3
|
+
export declare class RecordingsResource {
|
|
4
|
+
private readonly client;
|
|
5
|
+
constructor(client: RapidCrawl);
|
|
6
|
+
/** POST /v1/recordings — start a recording */
|
|
7
|
+
create(opts: Record<string, unknown>): Promise<unknown>;
|
|
8
|
+
/** GET /v1/recordings/{id} — poll a recording by ID */
|
|
9
|
+
get(id: RecordingId): Promise<unknown>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=recordings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recordings.d.ts","sourceRoot":"","sources":["../../src/resources/recordings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,qBAAa,kBAAkB;IACjB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C,8CAA8C;IAC9C,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAIvD,uDAAuD;IACvD,GAAG,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;CAGvC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export class RecordingsResource {
|
|
2
|
+
client;
|
|
3
|
+
constructor(client) {
|
|
4
|
+
this.client = client;
|
|
5
|
+
}
|
|
6
|
+
/** POST /v1/recordings — start a recording */
|
|
7
|
+
create(opts) {
|
|
8
|
+
return this.client.request('POST', '/v1/recordings', opts);
|
|
9
|
+
}
|
|
10
|
+
/** GET /v1/recordings/{id} — poll a recording by ID */
|
|
11
|
+
get(id) {
|
|
12
|
+
return this.client.request('GET', `/v1/recordings/${id}`);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=recordings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recordings.js","sourceRoot":"","sources":["../../src/resources/recordings.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,kBAAkB;IACA;IAA7B,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD,8CAA8C;IAC9C,MAAM,CAAC,IAA6B;QAClC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,gBAAgB,EAAE,IAAI,CAAC,CAAC;IAC7D,CAAC;IAED,uDAAuD;IACvD,GAAG,CAAC,EAAe;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;IAC5D,CAAC;CACF"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { RapidCrawl } from '../client.js';
|
|
2
|
+
import type { ScrapeId, BulkId } from '../types.js';
|
|
3
|
+
/** Markdown processing mode for the pipeline. */
|
|
4
|
+
export type MarkdownMode = 'article' | 'raw' | 'llm';
|
|
5
|
+
/** Link rendering style in the markdown output. */
|
|
6
|
+
export type MarkdownLinks = 'inline' | 'references' | 'none';
|
|
7
|
+
/** Options for POST /v1/scrape. */
|
|
8
|
+
export interface ScrapeOpts {
|
|
9
|
+
url: string;
|
|
10
|
+
formats?: Array<'raw_html' | 'html' | 'markdown' | 'links' | 'images'>;
|
|
11
|
+
country?: string;
|
|
12
|
+
cookies?: Array<Record<string, unknown>>;
|
|
13
|
+
headers?: Record<string, string>;
|
|
14
|
+
delay_ms?: number;
|
|
15
|
+
timeout_ms?: number;
|
|
16
|
+
async?: boolean;
|
|
17
|
+
webhook_url?: string;
|
|
18
|
+
events?: Array<'queued' | 'completed' | 'failed'>;
|
|
19
|
+
/** Markdown processing mode. article=article extraction (default), raw=minimal cleanup, llm=compact LLM-optimised output. */
|
|
20
|
+
markdown_mode?: MarkdownMode;
|
|
21
|
+
/** BM25 query string for relevance-ranked content filtering. Omit or leave empty to disable. */
|
|
22
|
+
markdown_query?: string;
|
|
23
|
+
/** Link rendering style in the markdown output. */
|
|
24
|
+
markdown_links?: MarkdownLinks;
|
|
25
|
+
/** Collapse excessive whitespace for a more compact output. */
|
|
26
|
+
markdown_compact?: boolean;
|
|
27
|
+
/** Filter low-signal images from the markdown output. */
|
|
28
|
+
markdown_filter_images?: boolean;
|
|
29
|
+
/** When true, `formats.links` and `formats.images` return `ScrapeScoredLink[]` / `ScrapeScoredImage[]` (rich objects) instead of `string[]`, and a top-level `tables` array is included. Only effective when `markdown` is in `formats`. */
|
|
30
|
+
markdown_include_media?: boolean;
|
|
31
|
+
/** When true, the response includes markdown-pipeline and tag-filter warnings. `artifact_unavailable` may appear independently when a requested persisted format cannot be rehydrated. */
|
|
32
|
+
markdown_include_warnings?: boolean;
|
|
33
|
+
/** When true, the response includes a top-level `stats` object with `ScrapeStats` (chars, tokens, blocks). Only effective when `markdown` is in `formats`. */
|
|
34
|
+
markdown_include_stats?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* How long a freshly fetched URL may be served from cache. `'0'`/`0` skips the
|
|
37
|
+
* cache read (the result is still written), `'Nh'`/`'Nd'` set a TTL (capped at
|
|
38
|
+
* 168h / 7d). Default `'48h'`. Honoured on both the synchronous and asynchronous
|
|
39
|
+
* paths; the async success envelope reports the outcome via the `cache` field.
|
|
40
|
+
*/
|
|
41
|
+
cache_ttl?: string | 0;
|
|
42
|
+
/**
|
|
43
|
+
* User-supplied JSON payload, echoed back on the success envelope so callers
|
|
44
|
+
* can correlate the response to caller-side state (job IDs, batch metadata).
|
|
45
|
+
* Capped at 4096 UTF-8 bytes after JSON serialization. Does NOT affect
|
|
46
|
+
* cache-key inputs — two requests differing only in `custom` share the same
|
|
47
|
+
* cache slot.
|
|
48
|
+
*/
|
|
49
|
+
custom?: Record<string, unknown>;
|
|
50
|
+
}
|
|
51
|
+
export declare class ScrapeResource {
|
|
52
|
+
private readonly client;
|
|
53
|
+
readonly bulk: ScrapeBulkResource;
|
|
54
|
+
constructor(client: RapidCrawl);
|
|
55
|
+
/** POST /v1/scrape — create a scrape job */
|
|
56
|
+
create(opts: ScrapeOpts): Promise<unknown>;
|
|
57
|
+
/** GET /v1/scrape/{id} — poll a scrape by ID */
|
|
58
|
+
get(id: ScrapeId): Promise<unknown>;
|
|
59
|
+
}
|
|
60
|
+
declare class ScrapeBulkResource {
|
|
61
|
+
private readonly client;
|
|
62
|
+
constructor(client: RapidCrawl);
|
|
63
|
+
/** POST /v1/scrape/bulk — create a bulk scrape job */
|
|
64
|
+
create(opts: Record<string, unknown>): Promise<unknown>;
|
|
65
|
+
/** GET /v1/scrape/bulk/{id} — get a bulk scrape job */
|
|
66
|
+
get(id: BulkId): Promise<unknown>;
|
|
67
|
+
}
|
|
68
|
+
export {};
|
|
69
|
+
//# sourceMappingURL=scrape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scrape.d.ts","sourceRoot":"","sources":["../../src/resources/scrape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEpD,iDAAiD;AACjD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,KAAK,GAAG,KAAK,CAAC;AAErD,mDAAmD;AACnD,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAC;AAE7D,mCAAmC;AACnC,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,KAAK,CAAC,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC,CAAC;IACvE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,WAAW,GAAG,QAAQ,CAAC,CAAC;IAClD,6HAA6H;IAC7H,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,gGAAgG;IAChG,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mDAAmD;IACnD,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B,+DAA+D;IAC/D,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,yDAAyD;IACzD,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,4OAA4O;IAC5O,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,0LAA0L;IAC1L,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,8JAA8J;IAC9J,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC;IACvB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,qBAAa,cAAc;IAGb,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;gBAEL,MAAM,EAAE,UAAU;IAI/C,4CAA4C;IAC5C,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC;IAI1C,gDAAgD;IAChD,GAAG,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;CAGpC;AAED,cAAM,kBAAkB;IACV,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C,sDAAsD;IACtD,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAIvD,uDAAuD;IACvD,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAGlC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export class ScrapeResource {
|
|
2
|
+
client;
|
|
3
|
+
bulk;
|
|
4
|
+
constructor(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
this.bulk = new ScrapeBulkResource(client);
|
|
7
|
+
}
|
|
8
|
+
/** POST /v1/scrape — create a scrape job */
|
|
9
|
+
create(opts) {
|
|
10
|
+
return this.client.request('POST', '/v1/scrape', opts);
|
|
11
|
+
}
|
|
12
|
+
/** GET /v1/scrape/{id} — poll a scrape by ID */
|
|
13
|
+
get(id) {
|
|
14
|
+
return this.client.request('GET', `/v1/scrape/${id}`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
class ScrapeBulkResource {
|
|
18
|
+
client;
|
|
19
|
+
constructor(client) {
|
|
20
|
+
this.client = client;
|
|
21
|
+
}
|
|
22
|
+
/** POST /v1/scrape/bulk — create a bulk scrape job */
|
|
23
|
+
create(opts) {
|
|
24
|
+
return this.client.request('POST', '/v1/scrape/bulk', opts);
|
|
25
|
+
}
|
|
26
|
+
/** GET /v1/scrape/bulk/{id} — get a bulk scrape job */
|
|
27
|
+
get(id) {
|
|
28
|
+
return this.client.request('GET', `/v1/scrape/bulk/${id}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=scrape.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scrape.js","sourceRoot":"","sources":["../../src/resources/scrape.ts"],"names":[],"mappings":"AAsDA,MAAM,OAAO,cAAc;IAGI;IAFpB,IAAI,CAAqB;IAElC,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;QAC7C,IAAI,CAAC,IAAI,GAAG,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;IAED,4CAA4C;IAC5C,MAAM,CAAC,IAAgB;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;IACzD,CAAC;IAED,gDAAgD;IAChD,GAAG,CAAC,EAAY;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,CAAC,CAAC;IACxD,CAAC;CACF;AAED,MAAM,kBAAkB;IACO;IAA7B,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD,sDAAsD;IACtD,MAAM,CAAC,IAA6B;QAClC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,iBAAiB,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;IAED,uDAAuD;IACvD,GAAG,CAAC,EAAU;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,mBAAmB,EAAE,EAAE,CAAC,CAAC;IAC7D,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RapidCrawl } from '../client.js';
|
|
2
|
+
import type { ScreenshotId } from '../types.js';
|
|
3
|
+
export declare class ScreenshotsResource {
|
|
4
|
+
private readonly client;
|
|
5
|
+
constructor(client: RapidCrawl);
|
|
6
|
+
/** POST /v1/screenshots — capture a screenshot */
|
|
7
|
+
create(opts: Record<string, unknown>): Promise<unknown>;
|
|
8
|
+
/** GET /v1/screenshots/{id} — poll a screenshot by ID */
|
|
9
|
+
get(id: ScreenshotId): Promise<unknown>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=screenshots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenshots.d.ts","sourceRoot":"","sources":["../../src/resources/screenshots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,qBAAa,mBAAmB;IAClB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C,kDAAkD;IAClD,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAIvD,yDAAyD;IACzD,GAAG,CAAC,EAAE,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC;CAGxC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export class ScreenshotsResource {
|
|
2
|
+
client;
|
|
3
|
+
constructor(client) {
|
|
4
|
+
this.client = client;
|
|
5
|
+
}
|
|
6
|
+
/** POST /v1/screenshots — capture a screenshot */
|
|
7
|
+
create(opts) {
|
|
8
|
+
return this.client.request('POST', '/v1/screenshots', opts);
|
|
9
|
+
}
|
|
10
|
+
/** GET /v1/screenshots/{id} — poll a screenshot by ID */
|
|
11
|
+
get(id) {
|
|
12
|
+
return this.client.request('GET', `/v1/screenshots/${id}`);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=screenshots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenshots.js","sourceRoot":"","sources":["../../src/resources/screenshots.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,mBAAmB;IACD;IAA7B,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD,kDAAkD;IAClD,MAAM,CAAC,IAA6B;QAClC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,iBAAiB,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;IAED,yDAAyD;IACzD,GAAG,CAAC,EAAgB;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,mBAAmB,EAAE,EAAE,CAAC,CAAC;IAC7D,CAAC;CACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RapidCrawl } from '../client.js';
|
|
2
|
+
import type { SearchOpts, SearchResponse } from '../types.js';
|
|
3
|
+
export declare class SearchResource {
|
|
4
|
+
private readonly client;
|
|
5
|
+
constructor(client: RapidCrawl);
|
|
6
|
+
/** POST /v1/search — run a web search and return ranked organic results. */
|
|
7
|
+
query(opts: SearchOpts): Promise<SearchResponse>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/resources/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE9D,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C,4EAA4E;IAC5E,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC;CAGjD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export class SearchResource {
|
|
2
|
+
client;
|
|
3
|
+
constructor(client) {
|
|
4
|
+
this.client = client;
|
|
5
|
+
}
|
|
6
|
+
/** POST /v1/search — run a web search and return ranked organic results. */
|
|
7
|
+
query(opts) {
|
|
8
|
+
return this.client.request('POST', '/v1/search', opts);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/resources/search.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,cAAc;IACI;IAA7B,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD,4EAA4E;IAC5E,KAAK,CAAC,IAAgB;QACpB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAiB,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;IACzE,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RapidCrawl } from '../client.js';
|
|
2
|
+
import type { SitemapId } from '../types.js';
|
|
3
|
+
export declare class SitemapResource {
|
|
4
|
+
private readonly client;
|
|
5
|
+
constructor(client: RapidCrawl);
|
|
6
|
+
/** POST /v1/sitemap — start a sitemap crawl */
|
|
7
|
+
create(opts: Record<string, unknown>): Promise<unknown>;
|
|
8
|
+
/** GET /v1/sitemap/{id} — get a sitemap job by ID */
|
|
9
|
+
get(id: SitemapId): Promise<unknown>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=sitemap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sitemap.d.ts","sourceRoot":"","sources":["../../src/resources/sitemap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C,+CAA+C;IAC/C,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAIvD,qDAAqD;IACrD,GAAG,CAAC,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC;CAGrC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export class SitemapResource {
|
|
2
|
+
client;
|
|
3
|
+
constructor(client) {
|
|
4
|
+
this.client = client;
|
|
5
|
+
}
|
|
6
|
+
/** POST /v1/sitemap — start a sitemap crawl */
|
|
7
|
+
create(opts) {
|
|
8
|
+
return this.client.request('POST', '/v1/sitemap', opts);
|
|
9
|
+
}
|
|
10
|
+
/** GET /v1/sitemap/{id} — get a sitemap job by ID */
|
|
11
|
+
get(id) {
|
|
12
|
+
return this.client.request('GET', `/v1/sitemap/${id}`);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=sitemap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sitemap.js","sourceRoot":"","sources":["../../src/resources/sitemap.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,eAAe;IACG;IAA7B,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD,+CAA+C;IAC/C,MAAM,CAAC,IAA6B;QAClC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,CAAC,CAAC;IAC1D,CAAC;IAED,qDAAqD;IACrD,GAAG,CAAC,EAAa;QACf,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE,CAAC,CAAC;IACzD,CAAC;CACF"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prefixed-ID branded types for all RapidCrawl resource identifiers.
|
|
3
|
+
*
|
|
4
|
+
* These mirror the `ss_`, `rec_`, `bulk_`, etc. prefixes used at the API
|
|
5
|
+
* boundary (internal rows use raw UUIDs).
|
|
6
|
+
*/
|
|
7
|
+
export type ScrapeId = `sc_${string}`;
|
|
8
|
+
export type ScreenshotId = `ss_${string}`;
|
|
9
|
+
export type RecordingId = `rec_${string}`;
|
|
10
|
+
export type BulkId = `bulk_${string}`;
|
|
11
|
+
export type MonitorId = `mon_${string}`;
|
|
12
|
+
export type SitemapId = `sm_${string}`;
|
|
13
|
+
export type ApiKeyId = `ak_${string}`;
|
|
14
|
+
/** Which search index to query. `web` (default), `news`, or `images`. */
|
|
15
|
+
export type SearchType = 'web' | 'news' | 'images';
|
|
16
|
+
/** Recency window for search results (maps to the upstream time filter). */
|
|
17
|
+
export type SearchDateRange = 'any' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
|
18
|
+
/** Options for POST /v1/search. */
|
|
19
|
+
export interface SearchOpts {
|
|
20
|
+
/** The search query. */
|
|
21
|
+
query: string;
|
|
22
|
+
/**
|
|
23
|
+
* Which search index to query. `web` (default) returns ranked organic
|
|
24
|
+
* results; `news` returns news articles (populating `source`/`image`);
|
|
25
|
+
* `images` returns image results (populating `source`/`domain` and a fuller
|
|
26
|
+
* `image` object). Omit for the default web search.
|
|
27
|
+
*/
|
|
28
|
+
type?: SearchType;
|
|
29
|
+
/** Maximum number of organic results to return (1–100, default 10). */
|
|
30
|
+
limit?: number;
|
|
31
|
+
/** Two-letter country code to localize results (e.g. `us`, `de`). */
|
|
32
|
+
country?: string;
|
|
33
|
+
/** Two-letter ISO-639-1 language code for results (e.g. `en`, `fr`). */
|
|
34
|
+
language?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Restrict results to a recency window: `any` (default, no filter), `hour`,
|
|
37
|
+
* `day`, `week`, `month`, or `year`. Applies to every `type`.
|
|
38
|
+
*/
|
|
39
|
+
date_range?: SearchDateRange;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Image attached to a search result. For `news` results this is the thumbnail
|
|
43
|
+
* (only `url`); for `images` results it is the full image, additionally
|
|
44
|
+
* carrying its dimensions and a thumbnail URL + dimensions. Each field past
|
|
45
|
+
* `url` is present only when the provider reports it.
|
|
46
|
+
*/
|
|
47
|
+
export interface SearchResultImage {
|
|
48
|
+
/** URL of the image (thumbnail for `news`, full image for `images`). */
|
|
49
|
+
url: string;
|
|
50
|
+
/** Source image width in pixels (`images` only). */
|
|
51
|
+
width?: number;
|
|
52
|
+
/** Source image height in pixels (`images` only). */
|
|
53
|
+
height?: number;
|
|
54
|
+
/** URL of the thumbnail image (`images` only). */
|
|
55
|
+
thumbnail_url?: string;
|
|
56
|
+
/** Thumbnail width in pixels (`images` only). */
|
|
57
|
+
thumbnail_width?: number;
|
|
58
|
+
/** Thumbnail height in pixels (`images` only). */
|
|
59
|
+
thumbnail_height?: number;
|
|
60
|
+
}
|
|
61
|
+
/** A single ranked organic search result. */
|
|
62
|
+
export interface SearchResult {
|
|
63
|
+
/** 1-based rank of the result. */
|
|
64
|
+
position: number;
|
|
65
|
+
title: string;
|
|
66
|
+
url: string;
|
|
67
|
+
/** Short text excerpt for the result. Omitted for `images` results. */
|
|
68
|
+
snippet: string;
|
|
69
|
+
/** Published date when the provider reports one, else `null`. */
|
|
70
|
+
date: string | null;
|
|
71
|
+
/** Publisher / source name. Present for `news` and `images` results. */
|
|
72
|
+
source?: string;
|
|
73
|
+
/** Hosting-page domain of the result. Present only for `images` results. */
|
|
74
|
+
domain?: string;
|
|
75
|
+
/** Image attached to the result (present for `news` and `images` results). */
|
|
76
|
+
image?: SearchResultImage;
|
|
77
|
+
}
|
|
78
|
+
/** Response from POST /v1/search. */
|
|
79
|
+
export interface SearchResponse {
|
|
80
|
+
/** Stable search identifier (prefixed `sr_`). */
|
|
81
|
+
id: string;
|
|
82
|
+
query: string;
|
|
83
|
+
results: SearchResult[];
|
|
84
|
+
/** Related query suggestions; empty when none are returned. */
|
|
85
|
+
related_searches: string[];
|
|
86
|
+
/** Credits consumed by this search call. */
|
|
87
|
+
credits_used: number;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,QAAQ,GAAG,MAAM,MAAM,EAAE,CAAC;AACtC,MAAM,MAAM,YAAY,GAAG,MAAM,MAAM,EAAE,CAAC;AAC1C,MAAM,MAAM,WAAW,GAAG,OAAO,MAAM,EAAE,CAAC;AAC1C,MAAM,MAAM,MAAM,GAAG,QAAQ,MAAM,EAAE,CAAC;AACtC,MAAM,MAAM,SAAS,GAAG,OAAO,MAAM,EAAE,CAAC;AACxC,MAAM,MAAM,SAAS,GAAG,MAAM,MAAM,EAAE,CAAC;AACvC,MAAM,MAAM,QAAQ,GAAG,MAAM,MAAM,EAAE,CAAC;AAEtC,yEAAyE;AACzE,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEnD,4EAA4E;AAC5E,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjF,mCAAmC;AACnC,MAAM,WAAW,UAAU;IACzB,wBAAwB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,eAAe,CAAC;CAC9B;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,wEAAwE;IACxE,GAAG,EAAE,MAAM,CAAC;IACZ,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kDAAkD;IAClD,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,6CAA6C;AAC7C,MAAM,WAAW,YAAY;IAC3B,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8EAA8E;IAC9E,KAAK,CAAC,EAAE,iBAAiB,CAAC;CAC3B;AAED,qCAAqC;AACrC,MAAM,WAAW,cAAc;IAC7B,iDAAiD;IACjD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,+DAA+D;IAC/D,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAC;CACtB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hunt-labs/bytekit-sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Official TypeScript SDK for the ByteKit API",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/Hunt-Labs-Inc/ByteKit.git",
|
|
12
|
+
"directory": "packages/sdk-typescript"
|
|
13
|
+
},
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"import": "./dist/index.js",
|
|
19
|
+
"types": "./dist/index.d.ts"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"openapi-typescript": "7.13.0",
|
|
27
|
+
"tsx": "*",
|
|
28
|
+
"typedoc": "^0.28.19",
|
|
29
|
+
"typedoc-plugin-markdown": "^4.11.0",
|
|
30
|
+
"typescript": "^5.4.5",
|
|
31
|
+
"vitest": "^1.6.0"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsc",
|
|
35
|
+
"gen:types": "openapi-typescript ../../docs/api/openapi.yaml -o src/generated/api.d.ts",
|
|
36
|
+
"gen:types-check": "pnpm gen:types && git diff --exit-code src/generated/api.d.ts",
|
|
37
|
+
"generate:docs": "tsx scripts/generate-docs.ts",
|
|
38
|
+
"typecheck": "tsc --noEmit",
|
|
39
|
+
"test": "vitest run"
|
|
40
|
+
}
|
|
41
|
+
}
|