@nimble-way/nimble-js 0.20.0 → 1.0.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.
Files changed (252) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +10 -10
  3. package/client.d.mts +10 -39
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +10 -39
  6. package/client.d.ts.map +1 -1
  7. package/client.js +8 -43
  8. package/client.js.map +1 -1
  9. package/client.mjs +8 -43
  10. package/client.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/{task-agent/task-agent.d.mts → agents/agents.d.mts} +51 -213
  13. package/resources/agents/agents.d.mts.map +1 -0
  14. package/resources/{task-agent/task-agent.d.ts → agents/agents.d.ts} +51 -213
  15. package/resources/agents/agents.d.ts.map +1 -0
  16. package/resources/agents/agents.js +67 -0
  17. package/resources/agents/agents.js.map +1 -0
  18. package/resources/agents/agents.mjs +62 -0
  19. package/resources/agents/agents.mjs.map +1 -0
  20. package/resources/agents/index.d.mts +4 -0
  21. package/resources/agents/index.d.mts.map +1 -0
  22. package/resources/agents/index.d.ts +4 -0
  23. package/resources/agents/index.d.ts.map +1 -0
  24. package/resources/{task-agent → agents}/index.js +3 -3
  25. package/resources/agents/index.js.map +1 -0
  26. package/resources/{task-agent → agents}/index.mjs +1 -1
  27. package/resources/agents/index.mjs.map +1 -0
  28. package/resources/{task-agent → agents}/runs.d.mts +192 -43
  29. package/resources/agents/runs.d.mts.map +1 -0
  30. package/resources/{task-agent → agents}/runs.d.ts +192 -43
  31. package/resources/agents/runs.d.ts.map +1 -0
  32. package/resources/agents/runs.js +63 -0
  33. package/resources/agents/runs.js.map +1 -0
  34. package/resources/agents/runs.mjs +59 -0
  35. package/resources/agents/runs.mjs.map +1 -0
  36. package/resources/{task-agent → agents}/templates.d.mts +3 -6
  37. package/resources/agents/templates.d.mts.map +1 -0
  38. package/resources/{task-agent → agents}/templates.d.ts +3 -6
  39. package/resources/agents/templates.d.ts.map +1 -0
  40. package/resources/{task-agent → agents}/templates.js +5 -8
  41. package/resources/agents/templates.js.map +1 -0
  42. package/resources/agents/templates.mjs +19 -0
  43. package/resources/agents/templates.mjs.map +1 -0
  44. package/resources/agents.d.mts +2 -0
  45. package/resources/agents.d.mts.map +1 -0
  46. package/resources/agents.d.ts +2 -0
  47. package/resources/agents.d.ts.map +1 -0
  48. package/resources/{task-agent.js → agents.js} +2 -2
  49. package/resources/agents.js.map +1 -0
  50. package/resources/{task-agent.mjs → agents.mjs} +2 -2
  51. package/resources/agents.mjs.map +1 -0
  52. package/resources/batches.js +3 -3
  53. package/resources/batches.mjs +3 -3
  54. package/resources/crawl.js +4 -4
  55. package/resources/crawl.mjs +4 -4
  56. package/resources/domain-knowledge.js +1 -1
  57. package/resources/domain-knowledge.mjs +1 -1
  58. package/resources/extract/extract.d.mts +1243 -0
  59. package/resources/extract/extract.d.mts.map +1 -0
  60. package/resources/extract/extract.d.ts +1243 -0
  61. package/resources/extract/extract.d.ts.map +1 -0
  62. package/resources/extract/extract.js +52 -0
  63. package/resources/extract/extract.js.map +1 -0
  64. package/resources/extract/extract.mjs +47 -0
  65. package/resources/extract/extract.mjs.map +1 -0
  66. package/resources/extract/index.d.mts +3 -0
  67. package/resources/extract/index.d.mts.map +1 -0
  68. package/resources/extract/index.d.ts +3 -0
  69. package/resources/extract/index.d.ts.map +1 -0
  70. package/resources/extract/index.js +9 -0
  71. package/resources/extract/index.js.map +1 -0
  72. package/resources/extract/index.mjs +4 -0
  73. package/resources/extract/index.mjs.map +1 -0
  74. package/resources/extract/templates/generations.d.mts +364 -0
  75. package/resources/extract/templates/generations.d.mts.map +1 -0
  76. package/resources/extract/templates/generations.d.ts +364 -0
  77. package/resources/extract/templates/generations.d.ts.map +1 -0
  78. package/resources/extract/templates/generations.js +39 -0
  79. package/resources/extract/templates/generations.js.map +1 -0
  80. package/resources/extract/templates/generations.mjs +35 -0
  81. package/resources/extract/templates/generations.mjs.map +1 -0
  82. package/resources/extract/templates/index.d.mts +4 -0
  83. package/resources/extract/templates/index.d.mts.map +1 -0
  84. package/resources/extract/templates/index.d.ts +4 -0
  85. package/resources/extract/templates/index.d.ts.map +1 -0
  86. package/resources/extract/templates/index.js +11 -0
  87. package/resources/extract/templates/index.js.map +1 -0
  88. package/resources/extract/templates/index.mjs +5 -0
  89. package/resources/extract/templates/index.mjs.map +1 -0
  90. package/resources/extract/templates/templates.d.mts +870 -0
  91. package/resources/extract/templates/templates.d.mts.map +1 -0
  92. package/resources/extract/templates/templates.d.ts +870 -0
  93. package/resources/extract/templates/templates.d.ts.map +1 -0
  94. package/resources/extract/templates/templates.js +120 -0
  95. package/resources/extract/templates/templates.js.map +1 -0
  96. package/resources/extract/templates/templates.mjs +115 -0
  97. package/resources/extract/templates/templates.mjs.map +1 -0
  98. package/resources/extract/templates/versions.d.mts +226 -0
  99. package/resources/extract/templates/versions.d.mts.map +1 -0
  100. package/resources/extract/templates/versions.d.ts +226 -0
  101. package/resources/extract/templates/versions.d.ts.map +1 -0
  102. package/resources/extract/templates/versions.js +42 -0
  103. package/resources/extract/templates/versions.js.map +1 -0
  104. package/resources/extract/templates/versions.mjs +38 -0
  105. package/resources/extract/templates/versions.mjs.map +1 -0
  106. package/resources/extract/templates.d.mts +2 -0
  107. package/resources/extract/templates.d.mts.map +1 -0
  108. package/resources/extract/templates.d.ts +2 -0
  109. package/resources/extract/templates.d.ts.map +1 -0
  110. package/resources/extract/templates.js +6 -0
  111. package/resources/extract/templates.js.map +1 -0
  112. package/resources/extract/templates.mjs +3 -0
  113. package/resources/extract/templates.mjs.map +1 -0
  114. package/resources/extract.d.mts +2 -0
  115. package/resources/extract.d.mts.map +1 -0
  116. package/resources/extract.d.ts +2 -0
  117. package/resources/extract.d.ts.map +1 -0
  118. package/resources/extract.js +6 -0
  119. package/resources/extract.js.map +1 -0
  120. package/resources/extract.mjs +3 -0
  121. package/resources/extract.mjs.map +1 -0
  122. package/resources/fast-serp.js +1 -1
  123. package/resources/fast-serp.mjs +1 -1
  124. package/resources/index.d.mts +4 -4
  125. package/resources/index.d.mts.map +1 -1
  126. package/resources/index.d.ts +4 -4
  127. package/resources/index.d.ts.map +1 -1
  128. package/resources/index.js +5 -5
  129. package/resources/index.js.map +1 -1
  130. package/resources/index.mjs +2 -2
  131. package/resources/index.mjs.map +1 -1
  132. package/resources/jobs/index.d.mts +2 -2
  133. package/resources/jobs/index.d.mts.map +1 -1
  134. package/resources/jobs/index.d.ts +2 -2
  135. package/resources/jobs/index.d.ts.map +1 -1
  136. package/resources/jobs/index.js.map +1 -1
  137. package/resources/jobs/index.mjs.map +1 -1
  138. package/resources/jobs/jobs.d.mts +35 -103
  139. package/resources/jobs/jobs.d.mts.map +1 -1
  140. package/resources/jobs/jobs.d.ts +35 -103
  141. package/resources/jobs/jobs.d.ts.map +1 -1
  142. package/resources/jobs/jobs.js +10 -28
  143. package/resources/jobs/jobs.js.map +1 -1
  144. package/resources/jobs/jobs.mjs +11 -29
  145. package/resources/jobs/jobs.mjs.map +1 -1
  146. package/resources/jobs/runs/artifacts.d.mts +4 -12
  147. package/resources/jobs/runs/artifacts.d.mts.map +1 -1
  148. package/resources/jobs/runs/artifacts.d.ts +4 -12
  149. package/resources/jobs/runs/artifacts.d.ts.map +1 -1
  150. package/resources/jobs/runs/artifacts.js +8 -16
  151. package/resources/jobs/runs/artifacts.js.map +1 -1
  152. package/resources/jobs/runs/artifacts.mjs +8 -16
  153. package/resources/jobs/runs/artifacts.mjs.map +1 -1
  154. package/resources/jobs/runs/index.d.mts +1 -1
  155. package/resources/jobs/runs/index.d.mts.map +1 -1
  156. package/resources/jobs/runs/index.d.ts +1 -1
  157. package/resources/jobs/runs/index.d.ts.map +1 -1
  158. package/resources/jobs/runs/index.js.map +1 -1
  159. package/resources/jobs/runs/index.mjs.map +1 -1
  160. package/resources/jobs/runs/runs.d.mts +60 -28
  161. package/resources/jobs/runs/runs.d.mts.map +1 -1
  162. package/resources/jobs/runs/runs.d.ts +60 -28
  163. package/resources/jobs/runs/runs.d.ts.map +1 -1
  164. package/resources/jobs/runs/runs.js +12 -12
  165. package/resources/jobs/runs/runs.js.map +1 -1
  166. package/resources/jobs/runs/runs.mjs +12 -12
  167. package/resources/jobs/runs/runs.mjs.map +1 -1
  168. package/resources/media.js +2 -2
  169. package/resources/media.mjs +2 -2
  170. package/resources/serp.js +3 -3
  171. package/resources/serp.mjs +3 -3
  172. package/resources/tasks.js +3 -3
  173. package/resources/tasks.mjs +3 -3
  174. package/resources/top-level.d.mts +1 -1202
  175. package/resources/top-level.d.mts.map +1 -1
  176. package/resources/top-level.d.ts +1 -1202
  177. package/resources/top-level.d.ts.map +1 -1
  178. package/src/client.ts +41 -123
  179. package/src/resources/{task-agent/task-agent.ts → agents/agents.ts} +71 -258
  180. package/src/resources/{task-agent → agents}/index.ts +14 -14
  181. package/src/resources/{task-agent → agents}/runs.ts +228 -54
  182. package/src/resources/{task-agent → agents}/templates.ts +5 -8
  183. package/src/resources/{task-agent.ts → agents.ts} +1 -1
  184. package/src/resources/batches.ts +3 -3
  185. package/src/resources/crawl.ts +4 -4
  186. package/src/resources/domain-knowledge.ts +1 -1
  187. package/src/resources/extract/extract.ts +5182 -0
  188. package/src/resources/extract/index.ts +25 -0
  189. package/src/resources/extract/templates/generations.ts +435 -0
  190. package/src/resources/extract/templates/index.ts +29 -0
  191. package/src/resources/extract/templates/templates.ts +1176 -0
  192. package/src/resources/extract/templates/versions.ts +284 -0
  193. package/src/resources/extract/templates.ts +3 -0
  194. package/src/resources/extract.ts +3 -0
  195. package/src/resources/fast-serp.ts +1 -1
  196. package/src/resources/index.ts +16 -36
  197. package/src/resources/jobs/index.ts +1 -1
  198. package/src/resources/jobs/jobs.ts +50 -125
  199. package/src/resources/jobs/runs/artifacts.ts +8 -16
  200. package/src/resources/jobs/runs/index.ts +1 -0
  201. package/src/resources/jobs/runs/runs.ts +75 -31
  202. package/src/resources/media.ts +2 -2
  203. package/src/resources/serp.ts +3 -3
  204. package/src/resources/tasks.ts +3 -3
  205. package/src/resources/top-level.ts +72 -5171
  206. package/src/version.ts +1 -1
  207. package/version.d.mts +1 -1
  208. package/version.d.mts.map +1 -1
  209. package/version.d.ts +1 -1
  210. package/version.d.ts.map +1 -1
  211. package/version.js +1 -1
  212. package/version.js.map +1 -1
  213. package/version.mjs +1 -1
  214. package/version.mjs.map +1 -1
  215. package/resources/agent.d.mts +0 -641
  216. package/resources/agent.d.mts.map +0 -1
  217. package/resources/agent.d.ts +0 -641
  218. package/resources/agent.d.ts.map +0 -1
  219. package/resources/agent.js +0 -84
  220. package/resources/agent.js.map +0 -1
  221. package/resources/agent.mjs +0 -80
  222. package/resources/agent.mjs.map +0 -1
  223. package/resources/task-agent/index.d.mts +0 -4
  224. package/resources/task-agent/index.d.mts.map +0 -1
  225. package/resources/task-agent/index.d.ts +0 -4
  226. package/resources/task-agent/index.d.ts.map +0 -1
  227. package/resources/task-agent/index.js.map +0 -1
  228. package/resources/task-agent/index.mjs.map +0 -1
  229. package/resources/task-agent/runs.d.mts.map +0 -1
  230. package/resources/task-agent/runs.d.ts.map +0 -1
  231. package/resources/task-agent/runs.js +0 -63
  232. package/resources/task-agent/runs.js.map +0 -1
  233. package/resources/task-agent/runs.mjs +0 -59
  234. package/resources/task-agent/runs.mjs.map +0 -1
  235. package/resources/task-agent/task-agent.d.mts.map +0 -1
  236. package/resources/task-agent/task-agent.d.ts.map +0 -1
  237. package/resources/task-agent/task-agent.js +0 -80
  238. package/resources/task-agent/task-agent.js.map +0 -1
  239. package/resources/task-agent/task-agent.mjs +0 -75
  240. package/resources/task-agent/task-agent.mjs.map +0 -1
  241. package/resources/task-agent/templates.d.mts.map +0 -1
  242. package/resources/task-agent/templates.d.ts.map +0 -1
  243. package/resources/task-agent/templates.js.map +0 -1
  244. package/resources/task-agent/templates.mjs +0 -22
  245. package/resources/task-agent/templates.mjs.map +0 -1
  246. package/resources/task-agent.d.mts +0 -2
  247. package/resources/task-agent.d.mts.map +0 -1
  248. package/resources/task-agent.d.ts +0 -2
  249. package/resources/task-agent.d.ts.map +0 -1
  250. package/resources/task-agent.js.map +0 -1
  251. package/resources/task-agent.mjs.map +0 -1
  252. package/src/resources/agent.ts +0 -935
@@ -0,0 +1,870 @@
1
+ import { APIResource } from "../../../core/resource.mjs";
2
+ import * as GenerationsAPI from "./generations.mjs";
3
+ import { GenerationCreateParams, GenerationCreateResponse, GenerationGetResponse, Generations } from "./generations.mjs";
4
+ import * as VersionsAPI from "./versions.mjs";
5
+ import { VersionGetParams, VersionGetResponse, VersionListParams, VersionListResponse, Versions } from "./versions.mjs";
6
+ import { APIPromise } from "../../../core/api-promise.mjs";
7
+ import { RequestOptions } from "../../../internal/request-options.mjs";
8
+ export declare class Templates extends APIResource {
9
+ generations: GenerationsAPI.Generations;
10
+ versions: VersionsAPI.Versions;
11
+ /**
12
+ * Patch Extract Template Public V2
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const template = await client.extract.templates.update(
17
+ * 'extract_template_name',
18
+ * { body: [{ op: 'add', path: 'path' }] },
19
+ * );
20
+ * ```
21
+ */
22
+ update(extractTemplateName: string, params: TemplateUpdateParams, options?: RequestOptions): APIPromise<TemplateUpdateResponse>;
23
+ /**
24
+ * List Extract Templates Public V2
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * const templates = await client.extract.templates.list();
29
+ * ```
30
+ */
31
+ list(query?: TemplateListParams | null | undefined, options?: RequestOptions): APIPromise<TemplateListResponse>;
32
+ /**
33
+ * Delete Extract Template Public V2
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * await client.extract.templates.delete(
38
+ * 'extract_template_name',
39
+ * );
40
+ * ```
41
+ */
42
+ delete(extractTemplateName: string, options?: RequestOptions): APIPromise<void>;
43
+ /**
44
+ * Execute Extraction Template Async Endpoint
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * const response = await client.extract.templates.async({
49
+ * params: { foo: 'bar' },
50
+ * template: 'template',
51
+ * });
52
+ * ```
53
+ */
54
+ async(body: TemplateAsyncParams, options?: RequestOptions): APIPromise<TemplateAsyncResponse>;
55
+ /**
56
+ * Execute Extraction Template Batch Endpoint
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * const response = await client.extract.templates.batch({
61
+ * inputs: [{}],
62
+ * shared_inputs: { template: 'template' },
63
+ * });
64
+ * ```
65
+ */
66
+ batch(body: TemplateBatchParams, options?: RequestOptions): APIPromise<TemplateBatchResponse>;
67
+ /**
68
+ * Get Extract Template Public V2
69
+ *
70
+ * @example
71
+ * ```ts
72
+ * const template = await client.extract.templates.get(
73
+ * 'extract_template_name',
74
+ * );
75
+ * ```
76
+ */
77
+ get(extractTemplateName: string, options?: RequestOptions): APIPromise<TemplateGetResponse>;
78
+ /**
79
+ * Execute Extraction Template Realtime Endpoint
80
+ *
81
+ * @example
82
+ * ```ts
83
+ * const response = await client.extract.templates.run({
84
+ * params: { foo: 'bar' },
85
+ * template: 'template',
86
+ * });
87
+ * ```
88
+ */
89
+ run(body: TemplateRunParams, options?: RequestOptions): APIPromise<TemplateRunResponse>;
90
+ }
91
+ export interface TemplateUpdateResponse {
92
+ /**
93
+ * Unique extract template identifier.
94
+ */
95
+ id: string;
96
+ /**
97
+ * When the extract template was created.
98
+ */
99
+ created_at: string;
100
+ /**
101
+ * Stable extract template name.
102
+ */
103
+ name: string;
104
+ /**
105
+ * When the extract template was last updated.
106
+ */
107
+ updated_at: string;
108
+ /**
109
+ * Published version details, when available.
110
+ */
111
+ published_version?: TemplateUpdateResponse.PublishedVersion | null;
112
+ /**
113
+ * Identifier of the published version.
114
+ */
115
+ published_version_id?: string | null;
116
+ }
117
+ export declare namespace TemplateUpdateResponse {
118
+ /**
119
+ * Published version details, when available.
120
+ */
121
+ interface PublishedVersion {
122
+ /**
123
+ * Unique extract template version identifier.
124
+ */
125
+ id: string;
126
+ /**
127
+ * When the version was created.
128
+ */
129
+ created_at: string;
130
+ /**
131
+ * JSON schema describing accepted input parameters.
132
+ */
133
+ input_schema: {
134
+ [key: string]: unknown;
135
+ };
136
+ /**
137
+ * Metadata associated with this version.
138
+ */
139
+ metadata: PublishedVersion.Metadata;
140
+ /**
141
+ * Extract template name this version belongs to.
142
+ */
143
+ name: string;
144
+ /**
145
+ * JSON schema describing extracted output.
146
+ */
147
+ output_schema: {
148
+ [key: string]: unknown;
149
+ };
150
+ /**
151
+ * Monotonic version number for the extract template.
152
+ */
153
+ version_number: number;
154
+ /**
155
+ * Sample input and output pairs for the version.
156
+ */
157
+ samples?: Array<PublishedVersion.Sample> | null;
158
+ }
159
+ namespace PublishedVersion {
160
+ /**
161
+ * Metadata associated with this version.
162
+ */
163
+ interface Metadata {
164
+ /**
165
+ * Data source associated with the version.
166
+ */
167
+ data_source?: string | null;
168
+ /**
169
+ * Version description shown to users.
170
+ */
171
+ description?: string | null;
172
+ /**
173
+ * Human-friendly version display name.
174
+ */
175
+ display_name?: string | null;
176
+ /**
177
+ * Domain associated with the version.
178
+ */
179
+ domain?: string | null;
180
+ /**
181
+ * Entity type produced by the version.
182
+ */
183
+ entity_type?: string | null;
184
+ /**
185
+ * Tags associated with the version.
186
+ */
187
+ tags?: Array<string>;
188
+ /**
189
+ * Business vertical associated with the version.
190
+ */
191
+ vertical?: string | null;
192
+ }
193
+ interface Sample {
194
+ /**
195
+ * Sample input parameters for the version.
196
+ */
197
+ input?: unknown;
198
+ /**
199
+ * Sample output produced by the version.
200
+ */
201
+ output?: unknown;
202
+ }
203
+ }
204
+ }
205
+ export interface TemplateListResponse {
206
+ /**
207
+ * Items returned in this page.
208
+ */
209
+ items: Array<TemplateListResponse.Item>;
210
+ /**
211
+ * Maximum number of items returned.
212
+ */
213
+ limit: number;
214
+ /**
215
+ * Number of items skipped before this page.
216
+ */
217
+ offset: number;
218
+ /**
219
+ * Total number of items matching the query.
220
+ */
221
+ total: number;
222
+ }
223
+ export declare namespace TemplateListResponse {
224
+ interface Item {
225
+ /**
226
+ * Unique extract template identifier.
227
+ */
228
+ id: string;
229
+ /**
230
+ * When the extract template was created.
231
+ */
232
+ created_at: string;
233
+ /**
234
+ * Stable extract template name.
235
+ */
236
+ name: string;
237
+ /**
238
+ * When the extract template was last updated.
239
+ */
240
+ updated_at: string;
241
+ /**
242
+ * Published version details, when available.
243
+ */
244
+ published_version?: Item.PublishedVersion | null;
245
+ /**
246
+ * Identifier of the published version.
247
+ */
248
+ published_version_id?: string | null;
249
+ }
250
+ namespace Item {
251
+ /**
252
+ * Published version details, when available.
253
+ */
254
+ interface PublishedVersion {
255
+ /**
256
+ * Unique extract template version identifier.
257
+ */
258
+ id: string;
259
+ /**
260
+ * When the version was created.
261
+ */
262
+ created_at: string;
263
+ /**
264
+ * JSON schema describing accepted input parameters.
265
+ */
266
+ input_schema: {
267
+ [key: string]: unknown;
268
+ };
269
+ /**
270
+ * Metadata associated with this version.
271
+ */
272
+ metadata: PublishedVersion.Metadata;
273
+ /**
274
+ * Extract template name this version belongs to.
275
+ */
276
+ name: string;
277
+ /**
278
+ * JSON schema describing extracted output.
279
+ */
280
+ output_schema: {
281
+ [key: string]: unknown;
282
+ };
283
+ /**
284
+ * Monotonic version number for the extract template.
285
+ */
286
+ version_number: number;
287
+ /**
288
+ * Sample input and output pairs for the version.
289
+ */
290
+ samples?: Array<PublishedVersion.Sample> | null;
291
+ }
292
+ namespace PublishedVersion {
293
+ /**
294
+ * Metadata associated with this version.
295
+ */
296
+ interface Metadata {
297
+ /**
298
+ * Data source associated with the version.
299
+ */
300
+ data_source?: string | null;
301
+ /**
302
+ * Version description shown to users.
303
+ */
304
+ description?: string | null;
305
+ /**
306
+ * Human-friendly version display name.
307
+ */
308
+ display_name?: string | null;
309
+ /**
310
+ * Domain associated with the version.
311
+ */
312
+ domain?: string | null;
313
+ /**
314
+ * Entity type produced by the version.
315
+ */
316
+ entity_type?: string | null;
317
+ /**
318
+ * Tags associated with the version.
319
+ */
320
+ tags?: Array<string>;
321
+ /**
322
+ * Business vertical associated with the version.
323
+ */
324
+ vertical?: string | null;
325
+ }
326
+ interface Sample {
327
+ /**
328
+ * Sample input parameters for the version.
329
+ */
330
+ input?: unknown;
331
+ /**
332
+ * Sample output produced by the version.
333
+ */
334
+ output?: unknown;
335
+ }
336
+ }
337
+ }
338
+ }
339
+ export interface TemplateAsyncResponse {
340
+ status: 'success';
341
+ task: {
342
+ [key: string]: unknown;
343
+ };
344
+ }
345
+ /**
346
+ * Response when a batch of extract tasks is created successfully.
347
+ */
348
+ export interface TemplateBatchResponse {
349
+ /**
350
+ * Unique identifier for the batch.
351
+ */
352
+ batch_id: string;
353
+ /**
354
+ * Number of tasks in the batch.
355
+ */
356
+ batch_size: number;
357
+ /**
358
+ * List of created tasks.
359
+ */
360
+ tasks: Array<TemplateBatchResponse.Task>;
361
+ }
362
+ export declare namespace TemplateBatchResponse {
363
+ interface Task {
364
+ /**
365
+ * Unique task identifier.
366
+ */
367
+ id: string;
368
+ _query: unknown;
369
+ /**
370
+ * Timestamp when the task was created.
371
+ */
372
+ created_at: string;
373
+ /**
374
+ * Original input data for the task.
375
+ */
376
+ input: unknown;
377
+ /**
378
+ * Current state of the task.
379
+ */
380
+ state: 'pending' | 'queued' | 'in_progress' | 'success' | 'error';
381
+ /**
382
+ * URL for checking the task status.
383
+ */
384
+ status_url: string;
385
+ /**
386
+ * Account name that owns the task.
387
+ */
388
+ account_name?: string;
389
+ api_type?: 'web' | 'serp' | 'ecommerce' | 'social' | 'media' | 'agent' | 'extract' | 'fast-serp' | 'labs';
390
+ /**
391
+ * Batch ID if this task is part of a batch.
392
+ */
393
+ batch_id?: string | null;
394
+ /**
395
+ * URL for downloading the task results.
396
+ */
397
+ download_url?: string | null;
398
+ /**
399
+ * Error message if the task failed.
400
+ */
401
+ error?: string | null;
402
+ /**
403
+ * Classification of the error type.
404
+ */
405
+ error_type?: string | null;
406
+ /**
407
+ * Timestamp when the task was last modified.
408
+ */
409
+ modified_at?: string;
410
+ /**
411
+ * Storage location of the output data.
412
+ */
413
+ output_url?: string | null;
414
+ /**
415
+ * Queue name the task was submitted to.
416
+ */
417
+ queue?: string;
418
+ /**
419
+ * HTTP status code from the task execution.
420
+ */
421
+ status_code?: number;
422
+ }
423
+ }
424
+ export interface TemplateGetResponse {
425
+ /**
426
+ * Unique extract template identifier.
427
+ */
428
+ id: string;
429
+ /**
430
+ * When the extract template was created.
431
+ */
432
+ created_at: string;
433
+ /**
434
+ * Stable extract template name.
435
+ */
436
+ name: string;
437
+ /**
438
+ * When the extract template was last updated.
439
+ */
440
+ updated_at: string;
441
+ /**
442
+ * Published version details, when available.
443
+ */
444
+ published_version?: TemplateGetResponse.PublishedVersion | null;
445
+ /**
446
+ * Identifier of the published version.
447
+ */
448
+ published_version_id?: string | null;
449
+ }
450
+ export declare namespace TemplateGetResponse {
451
+ /**
452
+ * Published version details, when available.
453
+ */
454
+ interface PublishedVersion {
455
+ /**
456
+ * Unique extract template version identifier.
457
+ */
458
+ id: string;
459
+ /**
460
+ * When the version was created.
461
+ */
462
+ created_at: string;
463
+ /**
464
+ * JSON schema describing accepted input parameters.
465
+ */
466
+ input_schema: {
467
+ [key: string]: unknown;
468
+ };
469
+ /**
470
+ * Metadata associated with this version.
471
+ */
472
+ metadata: PublishedVersion.Metadata;
473
+ /**
474
+ * Extract template name this version belongs to.
475
+ */
476
+ name: string;
477
+ /**
478
+ * JSON schema describing extracted output.
479
+ */
480
+ output_schema: {
481
+ [key: string]: unknown;
482
+ };
483
+ /**
484
+ * Monotonic version number for the extract template.
485
+ */
486
+ version_number: number;
487
+ /**
488
+ * Sample input and output pairs for the version.
489
+ */
490
+ samples?: Array<PublishedVersion.Sample> | null;
491
+ }
492
+ namespace PublishedVersion {
493
+ /**
494
+ * Metadata associated with this version.
495
+ */
496
+ interface Metadata {
497
+ /**
498
+ * Data source associated with the version.
499
+ */
500
+ data_source?: string | null;
501
+ /**
502
+ * Version description shown to users.
503
+ */
504
+ description?: string | null;
505
+ /**
506
+ * Human-friendly version display name.
507
+ */
508
+ display_name?: string | null;
509
+ /**
510
+ * Domain associated with the version.
511
+ */
512
+ domain?: string | null;
513
+ /**
514
+ * Entity type produced by the version.
515
+ */
516
+ entity_type?: string | null;
517
+ /**
518
+ * Tags associated with the version.
519
+ */
520
+ tags?: Array<string>;
521
+ /**
522
+ * Business vertical associated with the version.
523
+ */
524
+ vertical?: string | null;
525
+ }
526
+ interface Sample {
527
+ /**
528
+ * Sample input parameters for the version.
529
+ */
530
+ input?: unknown;
531
+ /**
532
+ * Sample output produced by the version.
533
+ */
534
+ output?: unknown;
535
+ }
536
+ }
537
+ }
538
+ export interface TemplateRunResponse {
539
+ data: TemplateRunResponse.Data;
540
+ metadata: TemplateRunResponse.Metadata;
541
+ /**
542
+ * The status of the task.
543
+ */
544
+ status: 'success' | 'skipped' | 'fatal' | 'error' | 'postponed' | 'ignored' | 'rejected' | 'blocked';
545
+ /**
546
+ * Unique identifier for the task.
547
+ */
548
+ task_id: string;
549
+ /**
550
+ * The final URL.
551
+ */
552
+ url: string;
553
+ debug?: TemplateRunResponse.Debug;
554
+ /**
555
+ * Pagination information if applicable.
556
+ */
557
+ pagination?: TemplateRunResponse.NextPageParams | Array<TemplateRunResponse.UnionMember1>;
558
+ /**
559
+ * The HTTP status code of the task.
560
+ */
561
+ status_code?: number;
562
+ /**
563
+ * List of warnings generated during the task.
564
+ */
565
+ warnings?: Array<string>;
566
+ }
567
+ export declare namespace TemplateRunResponse {
568
+ interface Data {
569
+ /**
570
+ * Browser actions execution results. Present only when browser_actions were
571
+ * specified in the request.
572
+ */
573
+ browser_actions?: Data.BrowserActions;
574
+ /**
575
+ * The cookies collected from browser actions during the task.
576
+ */
577
+ cookies?: Array<unknown>;
578
+ /**
579
+ * The evaluation results from browser actions during the task.
580
+ */
581
+ eval?: Array<unknown>;
582
+ /**
583
+ * The http requests from browser actions made during the task.
584
+ */
585
+ fetch?: Array<unknown>;
586
+ /**
587
+ * The headers received during the task.
588
+ */
589
+ headers?: {
590
+ [key: string]: string;
591
+ };
592
+ /**
593
+ * The HTML content of the page.
594
+ */
595
+ html?: string;
596
+ /**
597
+ * List of all unique URLs found on the page.
598
+ */
599
+ links?: Array<string>;
600
+ /**
601
+ * The Markdown version of the HTML content.
602
+ */
603
+ markdown?: string;
604
+ /**
605
+ * The network capture data collected during the task.
606
+ */
607
+ network_capture?: Array<Data.NetworkCapture>;
608
+ /**
609
+ * Individual HTML content of each pagination page, before merging.
610
+ */
611
+ pages_html?: Array<string>;
612
+ /**
613
+ * The parsing results extracted from the HTML & network content.
614
+ */
615
+ parsing?: Data.ParsingSuccessResult | Data.ParsingErrorResult | {
616
+ [key: string]: unknown;
617
+ };
618
+ /**
619
+ * The list of redirects that occurred during the task.
620
+ */
621
+ redirects?: Array<Data.Redirect>;
622
+ /**
623
+ * Screenshots taken during the task, from browser actions, or the screenshot
624
+ * format.
625
+ */
626
+ screenshots?: Array<unknown>;
627
+ }
628
+ namespace Data {
629
+ /**
630
+ * Browser actions execution results. Present only when browser_actions were
631
+ * specified in the request.
632
+ */
633
+ interface BrowserActions {
634
+ results: Array<BrowserActions.Result>;
635
+ success: boolean;
636
+ total_duration: number;
637
+ }
638
+ namespace BrowserActions {
639
+ interface Result {
640
+ duration: number;
641
+ name: 'goto' | 'wait' | 'wait_for_element' | 'wait_for_navigation' | 'click' | 'fill' | 'press' | 'scroll' | 'auto_scroll' | 'screenshot' | 'get_cookies' | 'eval' | 'fetch';
642
+ status: 'no-run' | 'in-progress' | 'done' | 'error' | 'skipped';
643
+ error?: string;
644
+ result?: unknown;
645
+ }
646
+ }
647
+ interface NetworkCapture {
648
+ filter: NetworkCapture.Filter;
649
+ results: Array<NetworkCapture.Result>;
650
+ errorMessage?: string;
651
+ }
652
+ namespace NetworkCapture {
653
+ interface Filter {
654
+ validation: boolean;
655
+ wait_for_requests_count: number;
656
+ method?: 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH';
657
+ /**
658
+ * Resource type for network capture filtering
659
+ */
660
+ resource_type?: 'document' | 'stylesheet' | 'image' | 'media' | 'font' | 'script' | 'texttrack' | 'xhr' | 'fetch' | 'prefetch' | 'eventsource' | 'websocket' | 'manifest' | 'signedexchange' | 'ping' | 'cspviolationreport' | 'preflight' | 'other' | 'fedcm' | Array<'document' | 'stylesheet' | 'image' | 'media' | 'font' | 'script' | 'texttrack' | 'xhr' | 'fetch' | 'prefetch' | 'eventsource' | 'websocket' | 'manifest' | 'signedexchange' | 'ping' | 'cspviolationreport' | 'preflight' | 'other' | 'fedcm'>;
661
+ status_code?: number | Array<number>;
662
+ url?: Filter.URL;
663
+ wait_for_requests_count_timeout?: number;
664
+ }
665
+ namespace Filter {
666
+ interface URL {
667
+ type: 'exact' | 'contains';
668
+ value: string;
669
+ }
670
+ }
671
+ interface Result {
672
+ request: Result.Request;
673
+ response: Result.Response;
674
+ }
675
+ namespace Result {
676
+ interface Request {
677
+ headers: {
678
+ [key: string]: string;
679
+ };
680
+ method: string;
681
+ /**
682
+ * Resource type for network capture filtering
683
+ */
684
+ resource_type: 'document' | 'stylesheet' | 'image' | 'media' | 'font' | 'script' | 'texttrack' | 'xhr' | 'fetch' | 'prefetch' | 'eventsource' | 'websocket' | 'manifest' | 'signedexchange' | 'ping' | 'cspviolationreport' | 'preflight' | 'other' | 'fedcm';
685
+ url: string;
686
+ body?: string;
687
+ }
688
+ interface Response {
689
+ body: string;
690
+ headers: {
691
+ [key: string]: string;
692
+ };
693
+ serialization: 'none' | 'base64';
694
+ status: number;
695
+ status_text: string;
696
+ }
697
+ }
698
+ }
699
+ interface ParsingSuccessResult {
700
+ entities: {
701
+ [key: string]: unknown;
702
+ };
703
+ status: 'success';
704
+ }
705
+ interface ParsingErrorResult {
706
+ error: string;
707
+ status: 'error';
708
+ }
709
+ interface Redirect {
710
+ status_code: number;
711
+ url: string;
712
+ }
713
+ }
714
+ interface Metadata {
715
+ /**
716
+ * The name of the agent used for the query.
717
+ */
718
+ agent?: string;
719
+ /**
720
+ * The driver used for the task.
721
+ */
722
+ driver?: string;
723
+ /**
724
+ * The localization identifier for the query.
725
+ */
726
+ localization_id?: string;
727
+ /**
728
+ * The duration in milliseconds of the query processing.
729
+ */
730
+ query_duration?: number;
731
+ /**
732
+ * The time when the query was received.
733
+ */
734
+ query_time?: string;
735
+ /**
736
+ * Additional response parameters.
737
+ */
738
+ response_parameters?: unknown;
739
+ /**
740
+ * A tag associated with the query.
741
+ */
742
+ tag?: string;
743
+ }
744
+ interface Debug {
745
+ /**
746
+ * Performance metrics collected during the task.
747
+ */
748
+ performance_metrics?: {
749
+ [key: string]: number;
750
+ };
751
+ /**
752
+ * Total bytes used by the proxy during the task.
753
+ */
754
+ proxy_total_bytes_usage?: number;
755
+ /**
756
+ * The transformed output after applying any transformations.
757
+ */
758
+ transformed_output?: unknown;
759
+ /**
760
+ * The userbrowser instance using during the task.
761
+ */
762
+ userbrowser?: unknown;
763
+ }
764
+ interface NextPageParams {
765
+ next_page_params: {
766
+ [key: string]: unknown;
767
+ };
768
+ }
769
+ interface UnionMember1 {
770
+ next_page_params: {
771
+ [key: string]: unknown;
772
+ };
773
+ }
774
+ }
775
+ export interface TemplateUpdateParams {
776
+ /**
777
+ * A JSON Patch document per RFC 6902 — a JSON array of patch operations.
778
+ */
779
+ body: Array<TemplateUpdateParams.Body>;
780
+ }
781
+ export declare namespace TemplateUpdateParams {
782
+ /**
783
+ * A single JSON Patch operation per RFC 6902.
784
+ */
785
+ interface Body {
786
+ op: 'add' | 'remove' | 'replace' | 'move' | 'copy' | 'test';
787
+ path: string;
788
+ from?: string | null;
789
+ value?: unknown;
790
+ }
791
+ }
792
+ export interface TemplateListParams {
793
+ limit?: number;
794
+ offset?: number;
795
+ }
796
+ export interface TemplateAsyncParams {
797
+ params: {
798
+ [key: string]: unknown;
799
+ };
800
+ template: string;
801
+ /**
802
+ * URL to call back when async operation completes
803
+ */
804
+ callback_url?: string;
805
+ /**
806
+ * Response formats to include. All disabled by default.
807
+ */
808
+ formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers' | 'links'>;
809
+ localization?: boolean;
810
+ /**
811
+ * Whether to compress stored data
812
+ */
813
+ storage_compress?: boolean;
814
+ /**
815
+ * Custom name for the stored object
816
+ */
817
+ storage_object_name?: string;
818
+ /**
819
+ * Type of storage to use for results
820
+ */
821
+ storage_type?: string;
822
+ /**
823
+ * URL for storage location
824
+ */
825
+ storage_url?: string;
826
+ }
827
+ export interface TemplateBatchParams {
828
+ inputs: Array<TemplateBatchParams.Input>;
829
+ shared_inputs: TemplateBatchParams.SharedInputs;
830
+ }
831
+ export declare namespace TemplateBatchParams {
832
+ interface Input {
833
+ /**
834
+ * Response formats to include. All disabled by default.
835
+ */
836
+ formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers' | 'links'>;
837
+ localization?: boolean;
838
+ params?: {
839
+ [key: string]: unknown;
840
+ };
841
+ }
842
+ interface SharedInputs {
843
+ template: string;
844
+ /**
845
+ * Response formats to include. All disabled by default.
846
+ */
847
+ formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers' | 'links'>;
848
+ localization?: boolean;
849
+ params?: {
850
+ [key: string]: unknown;
851
+ };
852
+ }
853
+ }
854
+ export interface TemplateRunParams {
855
+ params: {
856
+ [key: string]: unknown;
857
+ };
858
+ template: string;
859
+ /**
860
+ * Response formats to include. All disabled by default.
861
+ */
862
+ formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers' | 'links'>;
863
+ localization?: boolean;
864
+ }
865
+ export declare namespace Templates {
866
+ export { type TemplateUpdateResponse as TemplateUpdateResponse, type TemplateListResponse as TemplateListResponse, type TemplateAsyncResponse as TemplateAsyncResponse, type TemplateBatchResponse as TemplateBatchResponse, type TemplateGetResponse as TemplateGetResponse, type TemplateRunResponse as TemplateRunResponse, type TemplateUpdateParams as TemplateUpdateParams, type TemplateListParams as TemplateListParams, type TemplateAsyncParams as TemplateAsyncParams, type TemplateBatchParams as TemplateBatchParams, type TemplateRunParams as TemplateRunParams, };
867
+ export { Generations as Generations, type GenerationCreateResponse as GenerationCreateResponse, type GenerationGetResponse as GenerationGetResponse, type GenerationCreateParams as GenerationCreateParams, };
868
+ export { Versions as Versions, type VersionListResponse as VersionListResponse, type VersionGetResponse as VersionGetResponse, type VersionListParams as VersionListParams, type VersionGetParams as VersionGetParams, };
869
+ }
870
+ //# sourceMappingURL=templates.d.mts.map