@nimble-way/nimble-js 0.12.0 → 0.13.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/CHANGELOG.md +40 -0
- package/client.d.mts +7 -1
- package/client.d.mts.map +1 -1
- package/client.d.ts +7 -1
- package/client.d.ts.map +1 -1
- package/client.js +17 -1
- package/client.js.map +1 -1
- package/client.mjs +17 -1
- package/client.mjs.map +1 -1
- package/internal/types.d.mts +6 -6
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +6 -6
- package/internal/types.d.ts.map +1 -1
- package/internal/utils/env.js +2 -2
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs +2 -2
- package/internal/utils/env.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agent.d.mts +121 -10
- package/resources/agent.d.mts.map +1 -1
- package/resources/agent.d.ts +121 -10
- package/resources/agent.d.ts.map +1 -1
- package/resources/agent.js +51 -0
- package/resources/agent.js.map +1 -1
- package/resources/agent.mjs +51 -0
- package/resources/agent.mjs.map +1 -1
- package/resources/crawl.d.mts +32 -2
- package/resources/crawl.d.mts.map +1 -1
- package/resources/crawl.d.ts +32 -2
- package/resources/crawl.d.ts.map +1 -1
- package/resources/crawl.js +24 -0
- package/resources/crawl.js.map +1 -1
- package/resources/crawl.mjs +24 -0
- package/resources/crawl.mjs.map +1 -1
- package/resources/top-level.d.mts +36 -8
- package/resources/top-level.d.mts.map +1 -1
- package/resources/top-level.d.ts +36 -8
- package/resources/top-level.d.ts.map +1 -1
- package/src/client.ts +24 -0
- package/src/internal/types.ts +6 -8
- package/src/internal/utils/env.ts +2 -2
- package/src/resources/agent.ts +159 -11
- package/src/resources/crawl.ts +33 -2
- package/src/resources/top-level.ts +41 -8
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/internal/types.ts
CHANGED
|
@@ -40,7 +40,6 @@ type OverloadedParameters<T> =
|
|
|
40
40
|
: T extends (...args: infer A) => unknown ? A
|
|
41
41
|
: never;
|
|
42
42
|
|
|
43
|
-
/* eslint-disable */
|
|
44
43
|
/**
|
|
45
44
|
* These imports attempt to get types from a parent package's dependencies.
|
|
46
45
|
* Unresolved bare specifiers can trigger [automatic type acquisition][1] in some projects, which
|
|
@@ -63,19 +62,18 @@ type OverloadedParameters<T> =
|
|
|
63
62
|
*
|
|
64
63
|
* [1]: https://www.typescriptlang.org/tsconfig/#typeAcquisition
|
|
65
64
|
*/
|
|
66
|
-
/** @ts-ignore For users with \@types/node */
|
|
65
|
+
/** @ts-ignore For users with \@types/node */ /* prettier-ignore */
|
|
67
66
|
type UndiciTypesRequestInit = NotAny<import('../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/undici-types/index.d.ts').RequestInit>;
|
|
68
|
-
/** @ts-ignore For users with undici */
|
|
67
|
+
/** @ts-ignore For users with undici */ /* prettier-ignore */
|
|
69
68
|
type UndiciRequestInit = NotAny<import('../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/undici/index.d.ts').RequestInit>;
|
|
70
|
-
/** @ts-ignore For users with \@types/bun */
|
|
69
|
+
/** @ts-ignore For users with \@types/bun */ /* prettier-ignore */
|
|
71
70
|
type BunRequestInit = globalThis.FetchRequestInit;
|
|
72
|
-
/** @ts-ignore For users with node-fetch@2 */
|
|
71
|
+
/** @ts-ignore For users with node-fetch@2 */ /* prettier-ignore */
|
|
73
72
|
type NodeFetch2RequestInit = NotAny<import('../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit>;
|
|
74
|
-
/** @ts-ignore For users with node-fetch@3, doesn't need file extension because types are at ./@types/index.d.ts */
|
|
73
|
+
/** @ts-ignore For users with node-fetch@3, doesn't need file extension because types are at ./@types/index.d.ts */ /* prettier-ignore */
|
|
75
74
|
type NodeFetch3RequestInit = NotAny<import('../node_modules/node-fetch').RequestInit> | NotAny<import('../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/node-fetch').RequestInit>;
|
|
76
|
-
/** @ts-ignore For users who use Deno */
|
|
75
|
+
/** @ts-ignore For users who use Deno */ /* prettier-ignore */
|
|
77
76
|
type FetchRequestInit = NonNullable<OverloadedParameters<typeof fetch>[1]>;
|
|
78
|
-
/* eslint-enable */
|
|
79
77
|
|
|
80
78
|
type RequestInits =
|
|
81
79
|
| NotAny<UndiciTypesRequestInit>
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export const readEnv = (env: string): string | undefined => {
|
|
11
11
|
if (typeof (globalThis as any).process !== 'undefined') {
|
|
12
|
-
return (globalThis as any).process.env?.[env]?.trim()
|
|
12
|
+
return (globalThis as any).process.env?.[env]?.trim() || undefined;
|
|
13
13
|
}
|
|
14
14
|
if (typeof (globalThis as any).Deno !== 'undefined') {
|
|
15
|
-
return (globalThis as any).Deno.env?.get?.(env)?.trim();
|
|
15
|
+
return (globalThis as any).Deno.env?.get?.(env)?.trim() || undefined;
|
|
16
16
|
}
|
|
17
17
|
return undefined;
|
|
18
18
|
};
|
package/src/resources/agent.ts
CHANGED
|
@@ -8,6 +8,11 @@ import { path } from '../internal/utils/path';
|
|
|
8
8
|
export class Agent extends APIResource {
|
|
9
9
|
/**
|
|
10
10
|
* List Agent Templates
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const agents = await client.agent.list();
|
|
15
|
+
* ```
|
|
11
16
|
*/
|
|
12
17
|
list(
|
|
13
18
|
query: AgentListParams | null | undefined = {},
|
|
@@ -18,6 +23,14 @@ export class Agent extends APIResource {
|
|
|
18
23
|
|
|
19
24
|
/**
|
|
20
25
|
* Create Agent Generation
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const response = await client.agent.generate({
|
|
30
|
+
* prompt: 'prompt',
|
|
31
|
+
* url: 'url',
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
21
34
|
*/
|
|
22
35
|
generate(body: AgentGenerateParams, options?: RequestOptions): APIPromise<AgentGenerateResponse> {
|
|
23
36
|
return this._client.post('/v1/agents/generations', { body, ...options });
|
|
@@ -25,6 +38,11 @@ export class Agent extends APIResource {
|
|
|
25
38
|
|
|
26
39
|
/**
|
|
27
40
|
* Get Agent Template
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const agent = await client.agent.get('template_name');
|
|
45
|
+
* ```
|
|
28
46
|
*/
|
|
29
47
|
get(templateName: string, options?: RequestOptions): APIPromise<AgentGetResponse> {
|
|
30
48
|
return this._client.get(path`/v1/agents/${templateName}`, options);
|
|
@@ -32,6 +50,13 @@ export class Agent extends APIResource {
|
|
|
32
50
|
|
|
33
51
|
/**
|
|
34
52
|
* Get Agent Generation
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const response = await client.agent.getGeneration(
|
|
57
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
58
|
+
* );
|
|
59
|
+
* ```
|
|
35
60
|
*/
|
|
36
61
|
getGeneration(generationID: string, options?: RequestOptions): APIPromise<AgentGetGenerationResponse> {
|
|
37
62
|
return this._client.get(path`/v1/agents/generations/${generationID}`, options);
|
|
@@ -39,6 +64,8 @@ export class Agent extends APIResource {
|
|
|
39
64
|
|
|
40
65
|
/**
|
|
41
66
|
* Publish Agent Version
|
|
67
|
+
*
|
|
68
|
+
* @deprecated
|
|
42
69
|
*/
|
|
43
70
|
publish(
|
|
44
71
|
agentName: string,
|
|
@@ -50,6 +77,14 @@ export class Agent extends APIResource {
|
|
|
50
77
|
|
|
51
78
|
/**
|
|
52
79
|
* Execute WSA Realtime Endpoint
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```ts
|
|
83
|
+
* const response = await client.agent.run({
|
|
84
|
+
* agent: 'agent',
|
|
85
|
+
* params: { foo: 'bar' },
|
|
86
|
+
* });
|
|
87
|
+
* ```
|
|
53
88
|
*/
|
|
54
89
|
run(body: AgentRunParams, options?: RequestOptions): APIPromise<AgentRunResponse> {
|
|
55
90
|
return this._client.post('/v1/agents/run', { body, ...options });
|
|
@@ -57,6 +92,14 @@ export class Agent extends APIResource {
|
|
|
57
92
|
|
|
58
93
|
/**
|
|
59
94
|
* Execute WSA Async Endpoint
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```ts
|
|
98
|
+
* const response = await client.agent.runAsync({
|
|
99
|
+
* agent: 'agent',
|
|
100
|
+
* params: { foo: 'bar' },
|
|
101
|
+
* });
|
|
102
|
+
* ```
|
|
60
103
|
*/
|
|
61
104
|
runAsync(body: AgentRunAsyncParams, options?: RequestOptions): APIPromise<AgentRunAsyncResponse> {
|
|
62
105
|
return this._client.post('/v1/agents/async', { body, ...options });
|
|
@@ -64,6 +107,14 @@ export class Agent extends APIResource {
|
|
|
64
107
|
|
|
65
108
|
/**
|
|
66
109
|
* Execute WSA Batch Endpoint
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```ts
|
|
113
|
+
* const response = await client.agent.runBatch({
|
|
114
|
+
* inputs: [{}],
|
|
115
|
+
* shared_inputs: { agent: 'agent' },
|
|
116
|
+
* });
|
|
117
|
+
* ```
|
|
67
118
|
*/
|
|
68
119
|
runBatch(body: AgentRunBatchParams, options?: RequestOptions): APIPromise<AgentRunBatchResponse> {
|
|
69
120
|
return this._client.post('/v1/agents/batch', { body, ...options });
|
|
@@ -105,7 +156,7 @@ export interface AgentGenerateResponse {
|
|
|
105
156
|
|
|
106
157
|
error?: string | null;
|
|
107
158
|
|
|
108
|
-
generated_version?:
|
|
159
|
+
generated_version?: AgentGenerateResponse.GeneratedVersion | null;
|
|
109
160
|
|
|
110
161
|
generated_version_id?: string | null;
|
|
111
162
|
|
|
@@ -116,6 +167,46 @@ export interface AgentGenerateResponse {
|
|
|
116
167
|
summary?: string | null;
|
|
117
168
|
}
|
|
118
169
|
|
|
170
|
+
export namespace AgentGenerateResponse {
|
|
171
|
+
export interface GeneratedVersion {
|
|
172
|
+
id: string;
|
|
173
|
+
|
|
174
|
+
agent_name: string;
|
|
175
|
+
|
|
176
|
+
created_at: string;
|
|
177
|
+
|
|
178
|
+
input_schema: unknown;
|
|
179
|
+
|
|
180
|
+
metadata: GeneratedVersion.Metadata;
|
|
181
|
+
|
|
182
|
+
output_schema: unknown;
|
|
183
|
+
|
|
184
|
+
steps: Array<unknown>;
|
|
185
|
+
|
|
186
|
+
version_number: number;
|
|
187
|
+
|
|
188
|
+
output_sample_data?: unknown;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export namespace GeneratedVersion {
|
|
192
|
+
export interface Metadata {
|
|
193
|
+
data_source?: string | null;
|
|
194
|
+
|
|
195
|
+
description?: string | null;
|
|
196
|
+
|
|
197
|
+
display_name?: string | null;
|
|
198
|
+
|
|
199
|
+
domain?: string | null;
|
|
200
|
+
|
|
201
|
+
entity_type?: string | null;
|
|
202
|
+
|
|
203
|
+
tags?: Array<string>;
|
|
204
|
+
|
|
205
|
+
vertical?: string | null;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
119
210
|
export interface AgentGetResponse {
|
|
120
211
|
display_name: string;
|
|
121
212
|
|
|
@@ -148,14 +239,16 @@ export namespace AgentGetResponse {
|
|
|
148
239
|
}
|
|
149
240
|
|
|
150
241
|
export interface InputProperty {
|
|
151
|
-
default?: string | null;
|
|
242
|
+
default?: string | boolean | number | null;
|
|
152
243
|
|
|
153
244
|
description?: string | null;
|
|
154
245
|
|
|
155
|
-
examples?: Array<
|
|
246
|
+
examples?: Array<unknown> | null;
|
|
156
247
|
|
|
157
248
|
is_localization_param?: boolean;
|
|
158
249
|
|
|
250
|
+
is_pagination_param?: boolean;
|
|
251
|
+
|
|
159
252
|
name?: string;
|
|
160
253
|
|
|
161
254
|
required?: boolean;
|
|
@@ -179,7 +272,7 @@ export interface AgentGetGenerationResponse {
|
|
|
179
272
|
|
|
180
273
|
error?: string | null;
|
|
181
274
|
|
|
182
|
-
generated_version?:
|
|
275
|
+
generated_version?: AgentGetGenerationResponse.GeneratedVersion | null;
|
|
183
276
|
|
|
184
277
|
generated_version_id?: string | null;
|
|
185
278
|
|
|
@@ -190,6 +283,46 @@ export interface AgentGetGenerationResponse {
|
|
|
190
283
|
summary?: string | null;
|
|
191
284
|
}
|
|
192
285
|
|
|
286
|
+
export namespace AgentGetGenerationResponse {
|
|
287
|
+
export interface GeneratedVersion {
|
|
288
|
+
id: string;
|
|
289
|
+
|
|
290
|
+
agent_name: string;
|
|
291
|
+
|
|
292
|
+
created_at: string;
|
|
293
|
+
|
|
294
|
+
input_schema: unknown;
|
|
295
|
+
|
|
296
|
+
metadata: GeneratedVersion.Metadata;
|
|
297
|
+
|
|
298
|
+
output_schema: unknown;
|
|
299
|
+
|
|
300
|
+
steps: Array<unknown>;
|
|
301
|
+
|
|
302
|
+
version_number: number;
|
|
303
|
+
|
|
304
|
+
output_sample_data?: unknown;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
export namespace GeneratedVersion {
|
|
308
|
+
export interface Metadata {
|
|
309
|
+
data_source?: string | null;
|
|
310
|
+
|
|
311
|
+
description?: string | null;
|
|
312
|
+
|
|
313
|
+
display_name?: string | null;
|
|
314
|
+
|
|
315
|
+
domain?: string | null;
|
|
316
|
+
|
|
317
|
+
entity_type?: string | null;
|
|
318
|
+
|
|
319
|
+
tags?: Array<string>;
|
|
320
|
+
|
|
321
|
+
vertical?: string | null;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
193
326
|
export interface AgentPublishResponse {
|
|
194
327
|
agent_name: string;
|
|
195
328
|
|
|
@@ -267,6 +400,11 @@ export namespace AgentRunResponse {
|
|
|
267
400
|
*/
|
|
268
401
|
html?: string;
|
|
269
402
|
|
|
403
|
+
/**
|
|
404
|
+
* List of all unique URLs found on the page.
|
|
405
|
+
*/
|
|
406
|
+
links?: Array<string>;
|
|
407
|
+
|
|
270
408
|
/**
|
|
271
409
|
* The Markdown version of the HTML content.
|
|
272
410
|
*/
|
|
@@ -689,19 +827,29 @@ export type AgentGenerateParams =
|
|
|
689
827
|
|
|
690
828
|
export declare namespace AgentGenerateParams {
|
|
691
829
|
export interface CreateAgentGenerationRequest {
|
|
692
|
-
agent_name: string;
|
|
693
|
-
|
|
694
830
|
prompt: string;
|
|
695
831
|
|
|
696
832
|
url: string;
|
|
697
833
|
|
|
834
|
+
agent_name?: string | null;
|
|
835
|
+
|
|
698
836
|
input_schema?: unknown;
|
|
699
837
|
|
|
700
|
-
metadata?:
|
|
838
|
+
metadata?: CreateAgentGenerationRequest.Metadata | null;
|
|
701
839
|
|
|
702
840
|
output_schema?: unknown;
|
|
703
841
|
}
|
|
704
842
|
|
|
843
|
+
export namespace CreateAgentGenerationRequest {
|
|
844
|
+
export interface Metadata {
|
|
845
|
+
description?: string | null;
|
|
846
|
+
|
|
847
|
+
display_name?: string | null;
|
|
848
|
+
|
|
849
|
+
tags?: Array<string>;
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
|
|
705
853
|
export interface CreateAgentRefinementRequest {
|
|
706
854
|
from_agent: string;
|
|
707
855
|
|
|
@@ -721,7 +869,7 @@ export interface AgentRunParams {
|
|
|
721
869
|
/**
|
|
722
870
|
* Response formats to include. All disabled by default.
|
|
723
871
|
*/
|
|
724
|
-
formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers'>;
|
|
872
|
+
formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers' | 'links'>;
|
|
725
873
|
|
|
726
874
|
localization?: boolean;
|
|
727
875
|
}
|
|
@@ -739,7 +887,7 @@ export interface AgentRunAsyncParams {
|
|
|
739
887
|
/**
|
|
740
888
|
* Response formats to include. All disabled by default.
|
|
741
889
|
*/
|
|
742
|
-
formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers'>;
|
|
890
|
+
formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers' | 'links'>;
|
|
743
891
|
|
|
744
892
|
localization?: boolean;
|
|
745
893
|
|
|
@@ -775,7 +923,7 @@ export namespace AgentRunBatchParams {
|
|
|
775
923
|
/**
|
|
776
924
|
* Response formats to include. All disabled by default.
|
|
777
925
|
*/
|
|
778
|
-
formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers'>;
|
|
926
|
+
formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers' | 'links'>;
|
|
779
927
|
|
|
780
928
|
localization?: boolean;
|
|
781
929
|
|
|
@@ -788,7 +936,7 @@ export namespace AgentRunBatchParams {
|
|
|
788
936
|
/**
|
|
789
937
|
* Response formats to include. All disabled by default.
|
|
790
938
|
*/
|
|
791
|
-
formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers'>;
|
|
939
|
+
formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers' | 'links'>;
|
|
792
940
|
|
|
793
941
|
localization?: boolean;
|
|
794
942
|
|
package/src/resources/crawl.ts
CHANGED
|
@@ -9,6 +9,11 @@ import { path } from '../internal/utils/path';
|
|
|
9
9
|
export class Crawl extends APIResource {
|
|
10
10
|
/**
|
|
11
11
|
* Crawl by Filter
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const crawls = await client.crawl.list();
|
|
16
|
+
* ```
|
|
12
17
|
*/
|
|
13
18
|
list(
|
|
14
19
|
query: CrawlListParams | null | undefined = {},
|
|
@@ -19,6 +24,11 @@ export class Crawl extends APIResource {
|
|
|
19
24
|
|
|
20
25
|
/**
|
|
21
26
|
* Create crawl task
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const response = await client.crawl.run({ url: 'url' });
|
|
31
|
+
* ```
|
|
22
32
|
*/
|
|
23
33
|
run(body: CrawlRunParams, options?: RequestOptions): APIPromise<CrawlRunResponse> {
|
|
24
34
|
return this._client.post('/v1/crawl', { body, ...options });
|
|
@@ -26,6 +36,13 @@ export class Crawl extends APIResource {
|
|
|
26
36
|
|
|
27
37
|
/**
|
|
28
38
|
* Get crawl data
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const response = await client.crawl.status(
|
|
43
|
+
* '123e4567-e89b-12d3-a456-426614174000',
|
|
44
|
+
* );
|
|
45
|
+
* ```
|
|
29
46
|
*/
|
|
30
47
|
status(id: string, options?: RequestOptions): APIPromise<CrawlStatusResponse> {
|
|
31
48
|
return this._client.get(path`/v1/crawl/${id}`, options);
|
|
@@ -33,6 +50,13 @@ export class Crawl extends APIResource {
|
|
|
33
50
|
|
|
34
51
|
/**
|
|
35
52
|
* Cancel Crawl
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const response = await client.crawl.terminate(
|
|
57
|
+
* '123e4567-e89b-12d3-a456-426614174000',
|
|
58
|
+
* );
|
|
59
|
+
* ```
|
|
36
60
|
*/
|
|
37
61
|
terminate(id: string, options?: RequestOptions): APIPromise<CrawlTerminateResponse> {
|
|
38
62
|
return this._client.delete(path`/v1/crawl/${id}`, options);
|
|
@@ -708,7 +732,7 @@ export namespace CrawlRunParams {
|
|
|
708
732
|
/**
|
|
709
733
|
* Browser driver to use
|
|
710
734
|
*/
|
|
711
|
-
driver?: 'vx6' | 'vx8' | 'vx8-pro' | 'vx10' | 'vx10-pro' | 'vx12' | 'vx12-pro';
|
|
735
|
+
driver?: 'vx6' | 'vx8' | 'vx8-pro' | 'vx10' | 'vx10-pro' | 'vx12' | 'vx12-pro' | 'media-vx6';
|
|
712
736
|
|
|
713
737
|
/**
|
|
714
738
|
* Expected HTTP status codes for successful requests
|
|
@@ -718,7 +742,7 @@ export namespace CrawlRunParams {
|
|
|
718
742
|
/**
|
|
719
743
|
* List of acceptable response formats in order of preference
|
|
720
744
|
*/
|
|
721
|
-
formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers'>;
|
|
745
|
+
formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers' | 'links'>;
|
|
722
746
|
|
|
723
747
|
/**
|
|
724
748
|
* Custom HTTP headers to include in the request
|
|
@@ -1273,6 +1297,13 @@ export namespace CrawlRunParams {
|
|
|
1273
1297
|
| 'zu-ZA'
|
|
1274
1298
|
| 'auto';
|
|
1275
1299
|
|
|
1300
|
+
/**
|
|
1301
|
+
* Selects which markdown conversion strategy to use. "full_page" converts the
|
|
1302
|
+
* entire HTML page. "main_content" uses Mozilla Readability to extract the main
|
|
1303
|
+
* article content before converting.
|
|
1304
|
+
*/
|
|
1305
|
+
markdown_backend?: 'full_page' | 'main_content';
|
|
1306
|
+
|
|
1276
1307
|
/**
|
|
1277
1308
|
* HTTP method for the request
|
|
1278
1309
|
*/
|
|
@@ -73,6 +73,11 @@ export namespace ExtractResponse {
|
|
|
73
73
|
*/
|
|
74
74
|
html?: string;
|
|
75
75
|
|
|
76
|
+
/**
|
|
77
|
+
* List of all unique URLs found on the page.
|
|
78
|
+
*/
|
|
79
|
+
links?: Array<string>;
|
|
80
|
+
|
|
76
81
|
/**
|
|
77
82
|
* The Markdown version of the HTML content.
|
|
78
83
|
*/
|
|
@@ -981,7 +986,7 @@ export interface ExtractParams {
|
|
|
981
986
|
/**
|
|
982
987
|
* Browser driver to use
|
|
983
988
|
*/
|
|
984
|
-
driver?: 'vx6' | 'vx8' | 'vx8-pro' | 'vx10' | 'vx10-pro' | 'vx12' | 'vx12-pro';
|
|
989
|
+
driver?: 'vx6' | 'vx8' | 'vx8-pro' | 'vx10' | 'vx10-pro' | 'vx12' | 'vx12-pro' | 'media-vx6';
|
|
985
990
|
|
|
986
991
|
/**
|
|
987
992
|
* Expected HTTP status codes for successful requests
|
|
@@ -991,7 +996,7 @@ export interface ExtractParams {
|
|
|
991
996
|
/**
|
|
992
997
|
* List of acceptable response formats in order of preference
|
|
993
998
|
*/
|
|
994
|
-
formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers'>;
|
|
999
|
+
formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers' | 'links'>;
|
|
995
1000
|
|
|
996
1001
|
/**
|
|
997
1002
|
* Custom HTTP headers to include in the request
|
|
@@ -1546,6 +1551,13 @@ export interface ExtractParams {
|
|
|
1546
1551
|
| 'zu-ZA'
|
|
1547
1552
|
| 'auto';
|
|
1548
1553
|
|
|
1554
|
+
/**
|
|
1555
|
+
* Selects which markdown conversion strategy to use. "full_page" converts the
|
|
1556
|
+
* entire HTML page. "main_content" uses Mozilla Readability to extract the main
|
|
1557
|
+
* article content before converting.
|
|
1558
|
+
*/
|
|
1559
|
+
markdown_backend?: 'full_page' | 'main_content';
|
|
1560
|
+
|
|
1549
1561
|
/**
|
|
1550
1562
|
* HTTP method for the request
|
|
1551
1563
|
*/
|
|
@@ -2062,7 +2074,7 @@ export interface ExtractAsyncParams {
|
|
|
2062
2074
|
/**
|
|
2063
2075
|
* Browser driver to use
|
|
2064
2076
|
*/
|
|
2065
|
-
driver?: 'vx6' | 'vx8' | 'vx8-pro' | 'vx10' | 'vx10-pro' | 'vx12' | 'vx12-pro';
|
|
2077
|
+
driver?: 'vx6' | 'vx8' | 'vx8-pro' | 'vx10' | 'vx10-pro' | 'vx12' | 'vx12-pro' | 'media-vx6';
|
|
2066
2078
|
|
|
2067
2079
|
/**
|
|
2068
2080
|
* Expected HTTP status codes for successful requests
|
|
@@ -2072,7 +2084,7 @@ export interface ExtractAsyncParams {
|
|
|
2072
2084
|
/**
|
|
2073
2085
|
* List of acceptable response formats in order of preference
|
|
2074
2086
|
*/
|
|
2075
|
-
formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers'>;
|
|
2087
|
+
formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers' | 'links'>;
|
|
2076
2088
|
|
|
2077
2089
|
/**
|
|
2078
2090
|
* Custom HTTP headers to include in the request
|
|
@@ -2627,6 +2639,13 @@ export interface ExtractAsyncParams {
|
|
|
2627
2639
|
| 'zu-ZA'
|
|
2628
2640
|
| 'auto';
|
|
2629
2641
|
|
|
2642
|
+
/**
|
|
2643
|
+
* Selects which markdown conversion strategy to use. "full_page" converts the
|
|
2644
|
+
* entire HTML page. "main_content" uses Mozilla Readability to extract the main
|
|
2645
|
+
* article content before converting.
|
|
2646
|
+
*/
|
|
2647
|
+
markdown_backend?: 'full_page' | 'main_content';
|
|
2648
|
+
|
|
2630
2649
|
/**
|
|
2631
2650
|
* HTTP method for the request
|
|
2632
2651
|
*/
|
|
@@ -3173,7 +3192,7 @@ export namespace ExtractBatchParams {
|
|
|
3173
3192
|
/**
|
|
3174
3193
|
* Browser driver to use
|
|
3175
3194
|
*/
|
|
3176
|
-
driver?: 'vx6' | 'vx8' | 'vx8-pro' | 'vx10' | 'vx10-pro' | 'vx12' | 'vx12-pro';
|
|
3195
|
+
driver?: 'vx6' | 'vx8' | 'vx8-pro' | 'vx10' | 'vx10-pro' | 'vx12' | 'vx12-pro' | 'media-vx6';
|
|
3177
3196
|
|
|
3178
3197
|
/**
|
|
3179
3198
|
* Expected HTTP status codes for successful requests
|
|
@@ -3183,7 +3202,7 @@ export namespace ExtractBatchParams {
|
|
|
3183
3202
|
/**
|
|
3184
3203
|
* List of acceptable response formats in order of preference
|
|
3185
3204
|
*/
|
|
3186
|
-
formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers'>;
|
|
3205
|
+
formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers' | 'links'>;
|
|
3187
3206
|
|
|
3188
3207
|
/**
|
|
3189
3208
|
* Custom HTTP headers to include in the request
|
|
@@ -3738,6 +3757,13 @@ export namespace ExtractBatchParams {
|
|
|
3738
3757
|
| 'zu-ZA'
|
|
3739
3758
|
| 'auto';
|
|
3740
3759
|
|
|
3760
|
+
/**
|
|
3761
|
+
* Selects which markdown conversion strategy to use. "full_page" converts the
|
|
3762
|
+
* entire HTML page. "main_content" uses Mozilla Readability to extract the main
|
|
3763
|
+
* article content before converting.
|
|
3764
|
+
*/
|
|
3765
|
+
markdown_backend?: 'full_page' | 'main_content';
|
|
3766
|
+
|
|
3741
3767
|
/**
|
|
3742
3768
|
* HTTP method for the request
|
|
3743
3769
|
*/
|
|
@@ -4278,7 +4304,7 @@ export namespace ExtractBatchParams {
|
|
|
4278
4304
|
/**
|
|
4279
4305
|
* Browser driver to use
|
|
4280
4306
|
*/
|
|
4281
|
-
driver?: 'vx6' | 'vx8' | 'vx8-pro' | 'vx10' | 'vx10-pro' | 'vx12' | 'vx12-pro';
|
|
4307
|
+
driver?: 'vx6' | 'vx8' | 'vx8-pro' | 'vx10' | 'vx10-pro' | 'vx12' | 'vx12-pro' | 'media-vx6';
|
|
4282
4308
|
|
|
4283
4309
|
/**
|
|
4284
4310
|
* Expected HTTP status codes for successful requests
|
|
@@ -4288,7 +4314,7 @@ export namespace ExtractBatchParams {
|
|
|
4288
4314
|
/**
|
|
4289
4315
|
* List of acceptable response formats in order of preference
|
|
4290
4316
|
*/
|
|
4291
|
-
formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers'>;
|
|
4317
|
+
formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers' | 'links'>;
|
|
4292
4318
|
|
|
4293
4319
|
/**
|
|
4294
4320
|
* Custom HTTP headers to include in the request
|
|
@@ -4843,6 +4869,13 @@ export namespace ExtractBatchParams {
|
|
|
4843
4869
|
| 'zu-ZA'
|
|
4844
4870
|
| 'auto';
|
|
4845
4871
|
|
|
4872
|
+
/**
|
|
4873
|
+
* Selects which markdown conversion strategy to use. "full_page" converts the
|
|
4874
|
+
* entire HTML page. "main_content" uses Mozilla Readability to extract the main
|
|
4875
|
+
* article content before converting.
|
|
4876
|
+
*/
|
|
4877
|
+
markdown_backend?: 'full_page' | 'main_content';
|
|
4878
|
+
|
|
4846
4879
|
/**
|
|
4847
4880
|
* HTTP method for the request
|
|
4848
4881
|
*/
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.13.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.13.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.13.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.13.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|