@nimble-way/nimble-js 0.19.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 (255) hide show
  1. package/CHANGELOG.md +20 -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/agents/agents.d.mts +811 -0
  13. package/resources/agents/agents.d.mts.map +1 -0
  14. package/resources/agents/agents.d.ts +811 -0
  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 +413 -128
  29. package/resources/agents/runs.d.mts.map +1 -0
  30. package/resources/{task-agent → agents}/runs.d.ts +413 -128
  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/agents/templates.d.mts +258 -0
  37. package/resources/agents/templates.d.mts.map +1 -0
  38. package/resources/agents/templates.d.ts +258 -0
  39. package/resources/agents/templates.d.ts.map +1 -0
  40. package/resources/{task-agent → agents}/templates.js +5 -4
  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/{agent.d.ts → extract/templates/templates.d.mts} +475 -263
  91. package/resources/extract/templates/templates.d.mts.map +1 -0
  92. package/resources/{agent.d.mts → extract/templates/templates.d.ts} +475 -263
  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 +34 -90
  139. package/resources/jobs/jobs.d.mts.map +1 -1
  140. package/resources/jobs/jobs.d.ts +34 -90
  141. package/resources/jobs/jobs.d.ts.map +1 -1
  142. package/resources/jobs/jobs.js +10 -16
  143. package/resources/jobs/jobs.js.map +1 -1
  144. package/resources/jobs/jobs.mjs +11 -17
  145. package/resources/jobs/jobs.mjs.map +1 -1
  146. package/resources/jobs/runs/artifacts.d.mts +7 -17
  147. package/resources/jobs/runs/artifacts.d.mts.map +1 -1
  148. package/resources/jobs/runs/artifacts.d.ts +7 -17
  149. package/resources/jobs/runs/artifacts.d.ts.map +1 -1
  150. package/resources/jobs/runs/artifacts.js +8 -8
  151. package/resources/jobs/runs/artifacts.mjs +8 -8
  152. package/resources/jobs/runs/index.d.mts +1 -1
  153. package/resources/jobs/runs/index.d.mts.map +1 -1
  154. package/resources/jobs/runs/index.d.ts +1 -1
  155. package/resources/jobs/runs/index.d.ts.map +1 -1
  156. package/resources/jobs/runs/index.js.map +1 -1
  157. package/resources/jobs/runs/index.mjs.map +1 -1
  158. package/resources/jobs/runs/runs.d.mts +59 -21
  159. package/resources/jobs/runs/runs.d.mts.map +1 -1
  160. package/resources/jobs/runs/runs.d.ts +59 -21
  161. package/resources/jobs/runs/runs.d.ts.map +1 -1
  162. package/resources/jobs/runs/runs.js +12 -6
  163. package/resources/jobs/runs/runs.js.map +1 -1
  164. package/resources/jobs/runs/runs.mjs +12 -6
  165. package/resources/jobs/runs/runs.mjs.map +1 -1
  166. package/resources/media.js +2 -2
  167. package/resources/media.mjs +2 -2
  168. package/resources/serp.js +3 -3
  169. package/resources/serp.mjs +3 -3
  170. package/resources/tasks.js +3 -3
  171. package/resources/tasks.mjs +3 -3
  172. package/resources/top-level.d.mts +1 -1208
  173. package/resources/top-level.d.mts.map +1 -1
  174. package/resources/top-level.d.ts +1 -1208
  175. package/resources/top-level.d.ts.map +1 -1
  176. package/src/client.ts +41 -123
  177. package/src/resources/agents/agents.ts +1039 -0
  178. package/src/resources/agents/index.ts +30 -0
  179. package/src/resources/{task-agent → agents}/runs.ts +450 -154
  180. package/src/resources/agents/templates.ts +324 -0
  181. package/src/resources/{task-agent.ts → agents.ts} +1 -1
  182. package/src/resources/batches.ts +3 -3
  183. package/src/resources/crawl.ts +4 -4
  184. package/src/resources/domain-knowledge.ts +1 -1
  185. package/src/resources/extract/extract.ts +5182 -0
  186. package/src/resources/extract/index.ts +25 -0
  187. package/src/resources/extract/templates/generations.ts +435 -0
  188. package/src/resources/extract/templates/index.ts +29 -0
  189. package/src/resources/extract/templates/templates.ts +1176 -0
  190. package/src/resources/extract/templates/versions.ts +284 -0
  191. package/src/resources/extract/templates.ts +3 -0
  192. package/src/resources/extract.ts +3 -0
  193. package/src/resources/fast-serp.ts +1 -1
  194. package/src/resources/index.ts +16 -36
  195. package/src/resources/jobs/index.ts +1 -1
  196. package/src/resources/jobs/jobs.ts +49 -112
  197. package/src/resources/jobs/runs/artifacts.ts +11 -21
  198. package/src/resources/jobs/runs/index.ts +1 -0
  199. package/src/resources/jobs/runs/runs.ts +74 -24
  200. package/src/resources/media.ts +2 -2
  201. package/src/resources/serp.ts +3 -3
  202. package/src/resources/tasks.ts +3 -3
  203. package/src/resources/top-level.ts +88 -5192
  204. package/src/version.ts +1 -1
  205. package/version.d.mts +1 -1
  206. package/version.d.mts.map +1 -1
  207. package/version.d.ts +1 -1
  208. package/version.d.ts.map +1 -1
  209. package/version.js +1 -1
  210. package/version.js.map +1 -1
  211. package/version.mjs +1 -1
  212. package/version.mjs.map +1 -1
  213. package/resources/agent.d.mts.map +0 -1
  214. package/resources/agent.d.ts.map +0 -1
  215. package/resources/agent.js +0 -101
  216. package/resources/agent.js.map +0 -1
  217. package/resources/agent.mjs +0 -97
  218. package/resources/agent.mjs.map +0 -1
  219. package/resources/task-agent/index.d.mts +0 -4
  220. package/resources/task-agent/index.d.mts.map +0 -1
  221. package/resources/task-agent/index.d.ts +0 -4
  222. package/resources/task-agent/index.d.ts.map +0 -1
  223. package/resources/task-agent/index.js.map +0 -1
  224. package/resources/task-agent/index.mjs.map +0 -1
  225. package/resources/task-agent/runs.d.mts.map +0 -1
  226. package/resources/task-agent/runs.d.ts.map +0 -1
  227. package/resources/task-agent/runs.js +0 -65
  228. package/resources/task-agent/runs.js.map +0 -1
  229. package/resources/task-agent/runs.mjs +0 -61
  230. package/resources/task-agent/runs.mjs.map +0 -1
  231. package/resources/task-agent/task-agent.d.mts +0 -481
  232. package/resources/task-agent/task-agent.d.mts.map +0 -1
  233. package/resources/task-agent/task-agent.d.ts +0 -481
  234. package/resources/task-agent/task-agent.d.ts.map +0 -1
  235. package/resources/task-agent/task-agent.js +0 -68
  236. package/resources/task-agent/task-agent.js.map +0 -1
  237. package/resources/task-agent/task-agent.mjs +0 -63
  238. package/resources/task-agent/task-agent.mjs.map +0 -1
  239. package/resources/task-agent/templates.d.mts +0 -107
  240. package/resources/task-agent/templates.d.mts.map +0 -1
  241. package/resources/task-agent/templates.d.ts +0 -107
  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 -18
  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 -952
  253. package/src/resources/task-agent/index.ts +0 -32
  254. package/src/resources/task-agent/task-agent.ts +0 -746
  255. package/src/resources/task-agent/templates.ts +0 -172
@@ -7,46 +7,46 @@ import { path } from '../../../internal/utils/path';
7
7
 
8
8
  export class Artifacts extends APIResource {
9
9
  /**
10
- * List Run Artifacts
10
+ * List Run Artifacts Public V2
11
11
  */
12
12
  list(runID: string, options?: RequestOptions): APIPromise<ArtifactListResponse> {
13
- return this._client.get(path`/v1/jobs/runs/${runID}/artifacts`, options);
13
+ return this._client.get(path`/v2/jobs/runs/${runID}/artifacts`, options);
14
14
  }
15
15
 
16
16
  /**
17
- * Get Run Artifact Download URL
17
+ * Get Run Artifact Download Url Public V2
18
18
  */
19
19
  downloadURL(
20
- artifactID: string,
20
+ artifactID: number,
21
21
  params: ArtifactDownloadURLParams,
22
22
  options?: RequestOptions,
23
23
  ): APIPromise<ArtifactDownloadURLResponse> {
24
24
  const { run_id } = params;
25
- return this._client.get(path`/v1/jobs/runs/${run_id}/artifacts/${artifactID}/download-url`, options);
25
+ return this._client.get(path`/v2/jobs/runs/${run_id}/artifacts/${artifactID}/download-url`, options);
26
26
  }
27
27
 
28
28
  /**
29
- * Get Run Artifact
29
+ * Get Run Artifact Public V2
30
30
  */
31
31
  get(
32
- artifactID: string,
32
+ artifactID: number,
33
33
  params: ArtifactGetParams,
34
34
  options?: RequestOptions,
35
35
  ): APIPromise<ArtifactGetResponse> {
36
36
  const { run_id } = params;
37
- return this._client.get(path`/v1/jobs/runs/${run_id}/artifacts/${artifactID}`, options);
37
+ return this._client.get(path`/v2/jobs/runs/${run_id}/artifacts/${artifactID}`, options);
38
38
  }
39
39
 
40
40
  /**
41
- * Preview Run Artifact
41
+ * Preview Run Artifact Public V2
42
42
  */
43
43
  preview(
44
- artifactID: string,
44
+ artifactID: number,
45
45
  params: ArtifactPreviewParams,
46
46
  options?: RequestOptions,
47
47
  ): APIPromise<ArtifactPreviewResponse> {
48
48
  const { run_id } = params;
49
- return this._client.get(path`/v1/jobs/runs/${run_id}/artifacts/${artifactID}/preview`, options);
49
+ return this._client.get(path`/v2/jobs/runs/${run_id}/artifacts/${artifactID}/preview`, options);
50
50
  }
51
51
  }
52
52
 
@@ -63,11 +63,6 @@ export interface ArtifactListResponse {
63
63
  export namespace ArtifactListResponse {
64
64
  /**
65
65
  * A file produced by a run.
66
- *
67
- * Intentional subset of the bakery Artifact: `data_format` and `s3_path` are
68
- * hidden from SDK consumers — internal storage details, not part of the public
69
- * contract. Use the download-url endpoint to fetch the file. Bakery emits `id` as
70
- * an int (crawlit native); the SDK contract is a string.
71
66
  */
72
67
  export interface Item {
73
68
  /**
@@ -109,11 +104,6 @@ export interface ArtifactDownloadURLResponse {
109
104
 
110
105
  /**
111
106
  * A file produced by a run.
112
- *
113
- * Intentional subset of the bakery Artifact: `data_format` and `s3_path` are
114
- * hidden from SDK consumers — internal storage details, not part of the public
115
- * contract. Use the download-url endpoint to fetch the file. Bakery emits `id` as
116
- * an int (crawlit native); the SDK contract is a string.
117
107
  */
118
108
  export interface ArtifactGetResponse {
119
109
  /**
@@ -12,6 +12,7 @@ export {
12
12
  } from './artifacts';
13
13
  export {
14
14
  Runs,
15
+ type RunCreateResponse,
15
16
  type RunListResponse,
16
17
  type RunCancelResponse,
17
18
  type RunGetResponse,
@@ -20,52 +20,106 @@ export class Runs extends APIResource {
20
20
  artifacts: ArtifactsAPI.Artifacts = new ArtifactsAPI.Artifacts(this._client);
21
21
 
22
22
  /**
23
- * List Runs for Job
23
+ * Trigger Job Run Public V2
24
+ */
25
+ create(jobID: string, options?: RequestOptions): APIPromise<RunCreateResponse> {
26
+ return this._client.post(path`/v2/jobs/${jobID}/runs`, options);
27
+ }
28
+
29
+ /**
30
+ * List Job Runs Public V2
24
31
  */
25
32
  list(
26
33
  jobID: string,
27
34
  query: RunListParams | null | undefined = {},
28
35
  options?: RequestOptions,
29
36
  ): APIPromise<RunListResponse> {
30
- return this._client.get(path`/v1/jobs/${jobID}/runs`, { query, ...options });
37
+ return this._client.get(path`/v2/jobs/${jobID}/runs`, { query, ...options });
31
38
  }
32
39
 
33
40
  /**
34
- * Cancel Run
41
+ * Cancel Run Public V2
35
42
  */
36
43
  cancel(runID: string, options?: RequestOptions): APIPromise<RunCancelResponse> {
37
- return this._client.post(path`/v1/jobs/runs/${runID}/cancel`, options);
44
+ return this._client.post(path`/v2/jobs/runs/${runID}/cancel`, options);
38
45
  }
39
46
 
40
47
  /**
41
- * Get Run
48
+ * Get Run Public V2
42
49
  */
43
50
  get(runID: string, options?: RequestOptions): APIPromise<RunGetResponse> {
44
- return this._client.get(path`/v1/jobs/runs/${runID}`, options);
51
+ return this._client.get(path`/v2/jobs/runs/${runID}`, options);
45
52
  }
46
53
  }
47
54
 
48
55
  /**
49
- * A page of job runs.
56
+ * A single execution of a job.
50
57
  */
58
+ export interface RunCreateResponse {
59
+ /**
60
+ * Unique run identifier (run\_<n>).
61
+ */
62
+ id: string;
63
+
64
+ /**
65
+ * When the run was created.
66
+ */
67
+ created_at: string;
68
+
69
+ /**
70
+ * Identifier of the job this run belongs to.
71
+ */
72
+ job_id: string;
73
+
74
+ /**
75
+ * Current run status.
76
+ */
77
+ status: 'PENDING' | 'RUNNING' | 'SUCCESS' | 'FAILED' | 'CANCELLED' | 'TIMEOUT' | 'WARNING';
78
+
79
+ /**
80
+ * What triggered the run: 'schedule' or 'manual'.
81
+ */
82
+ triggered_by: 'schedule' | 'manual';
83
+
84
+ /**
85
+ * When the run finished.
86
+ */
87
+ finished_at?: string | null;
88
+
89
+ /**
90
+ * Number of input records processed.
91
+ */
92
+ input_count?: number | null;
93
+
94
+ /**
95
+ * Number of result records produced.
96
+ */
97
+ result_count?: number | null;
98
+
99
+ /**
100
+ * When the run started executing.
101
+ */
102
+ started_at?: string | null;
103
+ }
104
+
51
105
  export interface RunListResponse {
52
106
  /**
53
- * Runs on this page.
107
+ * Items returned in this page.
54
108
  */
55
109
  items: Array<RunListResponse.Item>;
56
110
 
57
111
  /**
58
- * Current page number.
112
+ * Maximum number of items returned.
59
113
  */
60
- page: number;
114
+ limit: number;
61
115
 
62
116
  /**
63
- * Number of items per page.
117
+ * Number of items skipped before this page.
64
118
  */
65
- per_page: number;
119
+ offset: number;
66
120
 
67
121
  /**
68
- * Total number of runs matching the query.
122
+ * Total number of items matching the query.
69
123
  */
70
124
  total: number;
71
125
  }
@@ -208,14 +262,14 @@ export namespace RunGetResponse {
208
262
  name: string;
209
263
 
210
264
  /**
211
- * Name of the agent this job runs.
265
+ * Human-friendly job name shown in the UI.
212
266
  */
213
- agent_name?: string | null;
267
+ display_name?: string | null;
214
268
 
215
269
  /**
216
- * Human-friendly job name shown in the UI.
270
+ * Name of the extract template this job runs.
217
271
  */
218
- display_name?: string | null;
272
+ extract_template_name?: string | null;
219
273
 
220
274
  /**
221
275
  * Cron-based schedule controlling when a job runs automatically.
@@ -283,20 +337,16 @@ export namespace RunGetResponse {
283
337
  }
284
338
 
285
339
  export interface RunListParams {
286
- page?: number;
340
+ limit?: number;
287
341
 
288
- per_page?: number;
289
-
290
- /**
291
- * Filter by status
292
- */
293
- status?: string | null;
342
+ offset?: number;
294
343
  }
295
344
 
296
345
  Runs.Artifacts = Artifacts;
297
346
 
298
347
  export declare namespace Runs {
299
348
  export {
349
+ type RunCreateResponse as RunCreateResponse,
300
350
  type RunListResponse as RunListResponse,
301
351
  type RunCancelResponse as RunCancelResponse,
302
352
  type RunGetResponse as RunGetResponse,
@@ -16,7 +16,7 @@ export class Media extends APIResource {
16
16
  * ```
17
17
  */
18
18
  run(body: MediaRunParams, options?: RequestOptions): APIPromise<MediaRunResponse> {
19
- return this._client.post('/v1/media', { body, ...options });
19
+ return this._client.post('/v2/media', { body, ...options });
20
20
  }
21
21
 
22
22
  /**
@@ -30,7 +30,7 @@ export class Media extends APIResource {
30
30
  * ```
31
31
  */
32
32
  runAsync(body: MediaRunAsyncParams, options?: RequestOptions): APIPromise<MediaRunAsyncResponse> {
33
- return this._client.post('/v1/media/async', { body, ...options });
33
+ return this._client.post('/v2/media/async', { body, ...options });
34
34
  }
35
35
  }
36
36
 
@@ -16,7 +16,7 @@ export class Serp extends APIResource {
16
16
  * ```
17
17
  */
18
18
  run(body: SerpRunParams, options?: RequestOptions): APIPromise<SerpRunResponse> {
19
- return this._client.post('/v1/serp', { body, ...options });
19
+ return this._client.post('/v2/serp', { body, ...options });
20
20
  }
21
21
 
22
22
  /**
@@ -30,7 +30,7 @@ export class Serp extends APIResource {
30
30
  * ```
31
31
  */
32
32
  runAsync(body: SerpRunAsyncParams, options?: RequestOptions): APIPromise<SerpRunAsyncResponse> {
33
- return this._client.post('/v1/serp/async', { body, ...options });
33
+ return this._client.post('/v2/serp/async', { body, ...options });
34
34
  }
35
35
 
36
36
  /**
@@ -44,7 +44,7 @@ export class Serp extends APIResource {
44
44
  * ```
45
45
  */
46
46
  runBatch(body: SerpRunBatchParams, options?: RequestOptions): APIPromise<SerpRunBatchResponse> {
47
- return this._client.post('/v1/serp/batch', { body, ...options });
47
+ return this._client.post('/v2/serp/batch', { body, ...options });
48
48
  }
49
49
  }
50
50
 
@@ -13,21 +13,21 @@ export class Tasks extends APIResource {
13
13
  query: TaskListParams | null | undefined = {},
14
14
  options?: RequestOptions,
15
15
  ): APIPromise<TaskListResponse> {
16
- return this._client.get('/v1/tasks', { query, ...options });
16
+ return this._client.get('/v2/tasks', { query, ...options });
17
17
  }
18
18
 
19
19
  /**
20
20
  * Retrieve the details of a specific task by its ID.
21
21
  */
22
22
  get(taskID: string, options?: RequestOptions): APIPromise<TaskGetResponse> {
23
- return this._client.get(path`/v1/tasks/${taskID}`, options);
23
+ return this._client.get(path`/v2/tasks/${taskID}`, options);
24
24
  }
25
25
 
26
26
  /**
27
27
  * Retrieve the results of a completed task.
28
28
  */
29
29
  results(taskID: string, options?: RequestOptions): APIPromise<TaskResultsResponse> {
30
- return this._client.get(path`/v1/tasks/${taskID}/results`, options);
30
+ return this._client.get(path`/v2/tasks/${taskID}/results`, options);
31
31
  }
32
32
  }
33
33