@nimble-way/nimble-js 0.13.0 → 0.16.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 (267) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/api-promise.d.mts +1 -0
  3. package/api-promise.d.mts.map +1 -1
  4. package/api-promise.d.ts +1 -0
  5. package/api-promise.d.ts.map +1 -1
  6. package/api-promise.mjs +1 -0
  7. package/api-promise.mjs.map +1 -1
  8. package/client.d.mts +17 -2
  9. package/client.d.mts.map +1 -1
  10. package/client.d.ts +17 -2
  11. package/client.d.ts.map +1 -1
  12. package/client.js +24 -1
  13. package/client.js.map +1 -1
  14. package/client.mjs +24 -1
  15. package/client.mjs.map +1 -1
  16. package/core/api-promise.d.mts.map +1 -1
  17. package/core/api-promise.d.ts.map +1 -1
  18. package/core/api-promise.mjs.map +1 -1
  19. package/core/error.mjs.map +1 -1
  20. package/core/resource.d.mts.map +1 -1
  21. package/core/resource.d.ts.map +1 -1
  22. package/core/uploads.d.mts.map +1 -1
  23. package/core/uploads.d.ts.map +1 -1
  24. package/core/uploads.mjs.map +1 -1
  25. package/error.d.mts +1 -0
  26. package/error.d.mts.map +1 -1
  27. package/error.d.ts +1 -0
  28. package/error.d.ts.map +1 -1
  29. package/error.mjs +1 -0
  30. package/error.mjs.map +1 -1
  31. package/index.d.mts.map +1 -1
  32. package/index.d.ts.map +1 -1
  33. package/index.mjs.map +1 -1
  34. package/internal/detect-platform.mjs.map +1 -1
  35. package/internal/headers.mjs.map +1 -1
  36. package/internal/parse.d.mts.map +1 -1
  37. package/internal/parse.d.ts.map +1 -1
  38. package/internal/parse.mjs.map +1 -1
  39. package/internal/request-options.d.mts.map +1 -1
  40. package/internal/request-options.d.ts.map +1 -1
  41. package/internal/shims.d.mts +6 -0
  42. package/internal/shims.d.mts.map +1 -1
  43. package/internal/shims.d.ts +6 -0
  44. package/internal/shims.d.ts.map +1 -1
  45. package/internal/to-file.d.mts.map +1 -1
  46. package/internal/to-file.d.ts.map +1 -1
  47. package/internal/to-file.mjs.map +1 -1
  48. package/internal/tslib.js +22 -22
  49. package/internal/types.d.mts +4 -4
  50. package/internal/types.d.mts.map +1 -1
  51. package/internal/types.d.ts +4 -4
  52. package/internal/types.d.ts.map +1 -1
  53. package/internal/uploads.d.mts.map +1 -1
  54. package/internal/uploads.d.ts.map +1 -1
  55. package/internal/uploads.mjs.map +1 -1
  56. package/internal/utils/base64.mjs.map +1 -1
  57. package/internal/utils/log.d.mts.map +1 -1
  58. package/internal/utils/log.d.ts.map +1 -1
  59. package/internal/utils/log.js +2 -0
  60. package/internal/utils/log.js.map +1 -1
  61. package/internal/utils/log.mjs +2 -0
  62. package/internal/utils/log.mjs.map +1 -1
  63. package/internal/utils/path.mjs.map +1 -1
  64. package/internal/utils/query.mjs.map +1 -1
  65. package/internal/utils/values.mjs.map +1 -1
  66. package/internal/utils.d.mts.map +1 -1
  67. package/internal/utils.d.ts.map +1 -1
  68. package/internal/utils.mjs.map +1 -1
  69. package/package.json +1 -1
  70. package/resource.d.mts +1 -0
  71. package/resource.d.mts.map +1 -1
  72. package/resource.d.ts +1 -0
  73. package/resource.d.ts.map +1 -1
  74. package/resource.mjs +1 -0
  75. package/resource.mjs.map +1 -1
  76. package/resources/agent.d.mts +33 -26
  77. package/resources/agent.d.mts.map +1 -1
  78. package/resources/agent.d.ts +33 -26
  79. package/resources/agent.d.ts.map +1 -1
  80. package/resources/agent.js +0 -8
  81. package/resources/agent.js.map +1 -1
  82. package/resources/agent.mjs +0 -8
  83. package/resources/agent.mjs.map +1 -1
  84. package/resources/batches.d.mts +1 -1
  85. package/resources/batches.d.mts.map +1 -1
  86. package/resources/batches.d.ts +1 -1
  87. package/resources/batches.d.ts.map +1 -1
  88. package/resources/batches.mjs.map +1 -1
  89. package/resources/crawl.d.mts +5 -1
  90. package/resources/crawl.d.mts.map +1 -1
  91. package/resources/crawl.d.ts +5 -1
  92. package/resources/crawl.d.ts.map +1 -1
  93. package/resources/crawl.mjs.map +1 -1
  94. package/resources/domain-knowledge.d.mts +50 -0
  95. package/resources/domain-knowledge.d.mts.map +1 -0
  96. package/resources/domain-knowledge.d.ts +50 -0
  97. package/resources/domain-knowledge.d.ts.map +1 -0
  98. package/resources/domain-knowledge.js +16 -0
  99. package/resources/domain-knowledge.js.map +1 -0
  100. package/resources/domain-knowledge.mjs +12 -0
  101. package/resources/domain-knowledge.mjs.map +1 -0
  102. package/resources/index.d.mts +6 -1
  103. package/resources/index.d.mts.map +1 -1
  104. package/resources/index.d.ts +6 -1
  105. package/resources/index.d.ts.map +1 -1
  106. package/resources/index.js +11 -1
  107. package/resources/index.js.map +1 -1
  108. package/resources/index.mjs +5 -0
  109. package/resources/index.mjs.map +1 -1
  110. package/resources/jobs/index.d.mts +3 -0
  111. package/resources/jobs/index.d.mts.map +1 -0
  112. package/resources/jobs/index.d.ts +3 -0
  113. package/resources/jobs/index.d.ts.map +1 -0
  114. package/resources/jobs/index.js +9 -0
  115. package/resources/jobs/index.js.map +1 -0
  116. package/resources/jobs/index.mjs +4 -0
  117. package/resources/jobs/index.mjs.map +1 -0
  118. package/resources/jobs/jobs.d.mts +248 -0
  119. package/resources/jobs/jobs.d.mts.map +1 -0
  120. package/resources/jobs/jobs.d.ts +248 -0
  121. package/resources/jobs/jobs.d.ts.map +1 -0
  122. package/resources/jobs/jobs.js +58 -0
  123. package/resources/jobs/jobs.js.map +1 -0
  124. package/resources/jobs/jobs.mjs +53 -0
  125. package/resources/jobs/jobs.mjs.map +1 -0
  126. package/resources/jobs/runs/artifacts.d.mts +62 -0
  127. package/resources/jobs/runs/artifacts.d.mts.map +1 -0
  128. package/resources/jobs/runs/artifacts.d.ts +62 -0
  129. package/resources/jobs/runs/artifacts.d.ts.map +1 -0
  130. package/resources/jobs/runs/artifacts.js +37 -0
  131. package/resources/jobs/runs/artifacts.js.map +1 -0
  132. package/resources/jobs/runs/artifacts.mjs +33 -0
  133. package/resources/jobs/runs/artifacts.mjs.map +1 -0
  134. package/resources/jobs/runs/index.d.mts +3 -0
  135. package/resources/jobs/runs/index.d.mts.map +1 -0
  136. package/resources/jobs/runs/index.d.ts +3 -0
  137. package/resources/jobs/runs/index.d.ts.map +1 -0
  138. package/resources/jobs/runs/index.js +9 -0
  139. package/resources/jobs/runs/index.js.map +1 -0
  140. package/resources/jobs/runs/index.mjs +4 -0
  141. package/resources/jobs/runs/index.mjs.map +1 -0
  142. package/resources/jobs/runs/runs.d.mts +95 -0
  143. package/resources/jobs/runs/runs.d.mts.map +1 -0
  144. package/resources/jobs/runs/runs.d.ts +95 -0
  145. package/resources/jobs/runs/runs.d.ts.map +1 -0
  146. package/resources/jobs/runs/runs.js +36 -0
  147. package/resources/jobs/runs/runs.js.map +1 -0
  148. package/resources/jobs/runs/runs.mjs +31 -0
  149. package/resources/jobs/runs/runs.mjs.map +1 -0
  150. package/resources/jobs/runs.d.mts +2 -0
  151. package/resources/jobs/runs.d.mts.map +1 -0
  152. package/resources/jobs/runs.d.ts +2 -0
  153. package/resources/jobs/runs.d.ts.map +1 -0
  154. package/resources/jobs/runs.js +6 -0
  155. package/resources/jobs/runs.js.map +1 -0
  156. package/resources/jobs/runs.mjs +3 -0
  157. package/resources/jobs/runs.mjs.map +1 -0
  158. package/resources/jobs.d.mts +2 -0
  159. package/resources/jobs.d.mts.map +1 -0
  160. package/resources/jobs.d.ts +2 -0
  161. package/resources/jobs.d.ts.map +1 -0
  162. package/resources/jobs.js +6 -0
  163. package/resources/jobs.js.map +1 -0
  164. package/resources/jobs.mjs +3 -0
  165. package/resources/jobs.mjs.map +1 -0
  166. package/resources/media.d.mts +390 -0
  167. package/resources/media.d.mts.map +1 -0
  168. package/resources/media.d.ts +390 -0
  169. package/resources/media.d.ts.map +1 -0
  170. package/resources/media.js +35 -0
  171. package/resources/media.js.map +1 -0
  172. package/resources/media.mjs +31 -0
  173. package/resources/media.mjs.map +1 -0
  174. package/resources/serp.d.mts +714 -0
  175. package/resources/serp.d.mts.map +1 -0
  176. package/resources/serp.d.ts +714 -0
  177. package/resources/serp.d.ts.map +1 -0
  178. package/resources/serp.js +48 -0
  179. package/resources/serp.js.map +1 -0
  180. package/resources/serp.mjs +44 -0
  181. package/resources/serp.mjs.map +1 -0
  182. package/resources/task-agent/index.d.mts +4 -0
  183. package/resources/task-agent/index.d.mts.map +1 -0
  184. package/resources/task-agent/index.d.ts +4 -0
  185. package/resources/task-agent/index.d.ts.map +1 -0
  186. package/resources/task-agent/index.js +11 -0
  187. package/resources/task-agent/index.js.map +1 -0
  188. package/resources/task-agent/index.mjs +5 -0
  189. package/resources/task-agent/index.mjs.map +1 -0
  190. package/resources/task-agent/runs.d.mts +277 -0
  191. package/resources/task-agent/runs.d.mts.map +1 -0
  192. package/resources/task-agent/runs.d.ts +277 -0
  193. package/resources/task-agent/runs.d.ts.map +1 -0
  194. package/resources/task-agent/runs.js +50 -0
  195. package/resources/task-agent/runs.js.map +1 -0
  196. package/resources/task-agent/runs.mjs +46 -0
  197. package/resources/task-agent/runs.mjs.map +1 -0
  198. package/resources/task-agent/task-agent.d.mts +383 -0
  199. package/resources/task-agent/task-agent.d.mts.map +1 -0
  200. package/resources/task-agent/task-agent.d.ts +383 -0
  201. package/resources/task-agent/task-agent.d.ts.map +1 -0
  202. package/resources/task-agent/task-agent.js +70 -0
  203. package/resources/task-agent/task-agent.js.map +1 -0
  204. package/resources/task-agent/task-agent.mjs +65 -0
  205. package/resources/task-agent/task-agent.mjs.map +1 -0
  206. package/resources/task-agent/templates.d.mts +98 -0
  207. package/resources/task-agent/templates.d.mts.map +1 -0
  208. package/resources/task-agent/templates.d.ts +98 -0
  209. package/resources/task-agent/templates.d.ts.map +1 -0
  210. package/resources/task-agent/templates.js +22 -0
  211. package/resources/task-agent/templates.js.map +1 -0
  212. package/resources/task-agent/templates.mjs +18 -0
  213. package/resources/task-agent/templates.mjs.map +1 -0
  214. package/resources/task-agent.d.mts +2 -0
  215. package/resources/task-agent.d.mts.map +1 -0
  216. package/resources/task-agent.d.ts +2 -0
  217. package/resources/task-agent.d.ts.map +1 -0
  218. package/resources/task-agent.js +6 -0
  219. package/resources/task-agent.js.map +1 -0
  220. package/resources/task-agent.mjs +3 -0
  221. package/resources/task-agent.mjs.map +1 -0
  222. package/resources/tasks.d.mts +2 -2
  223. package/resources/tasks.d.mts.map +1 -1
  224. package/resources/tasks.d.ts +2 -2
  225. package/resources/tasks.d.ts.map +1 -1
  226. package/resources/tasks.mjs.map +1 -1
  227. package/resources/top-level.d.mts +32 -8
  228. package/resources/top-level.d.mts.map +1 -1
  229. package/resources/top-level.d.ts +32 -8
  230. package/resources/top-level.d.ts.map +1 -1
  231. package/resources.d.mts.map +1 -1
  232. package/resources.d.ts.map +1 -1
  233. package/resources.mjs.map +1 -1
  234. package/src/client.ts +112 -5
  235. package/src/internal/utils/log.ts +2 -0
  236. package/src/resources/agent.ts +21 -38
  237. package/src/resources/batches.ts +1 -1
  238. package/src/resources/crawl.ts +6 -1
  239. package/src/resources/domain-knowledge.ts +69 -0
  240. package/src/resources/index.ts +44 -2
  241. package/src/resources/jobs/index.ts +20 -0
  242. package/src/resources/jobs/jobs.ts +413 -0
  243. package/src/resources/jobs/runs/artifacts.ts +115 -0
  244. package/src/resources/jobs/runs/index.ts +19 -0
  245. package/src/resources/jobs/runs/runs.ts +177 -0
  246. package/src/resources/jobs/runs.ts +3 -0
  247. package/src/resources/jobs.ts +3 -0
  248. package/src/resources/media.ts +570 -0
  249. package/src/resources/serp.ts +1001 -0
  250. package/src/resources/task-agent/index.ts +32 -0
  251. package/src/resources/task-agent/runs.ts +416 -0
  252. package/src/resources/task-agent/task-agent.ts +652 -0
  253. package/src/resources/task-agent/templates.ts +163 -0
  254. package/src/resources/task-agent.ts +3 -0
  255. package/src/resources/tasks.ts +2 -2
  256. package/src/resources/top-level.ts +35 -8
  257. package/src/version.ts +1 -1
  258. package/uploads.d.mts +1 -0
  259. package/uploads.d.mts.map +1 -1
  260. package/uploads.d.ts +1 -0
  261. package/uploads.d.ts.map +1 -1
  262. package/uploads.mjs +1 -0
  263. package/uploads.mjs.map +1 -1
  264. package/version.d.mts +1 -1
  265. package/version.d.ts +1 -1
  266. package/version.js +1 -1
  267. package/version.mjs +1 -1
@@ -0,0 +1,413 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as RunsAPI from './runs/runs';
5
+ import { RunCancelResponse, RunGetResponse, RunListParams, RunListResponse, Runs } from './runs/runs';
6
+ import { APIPromise } from '../../core/api-promise';
7
+ import { buildHeaders } from '../../internal/headers';
8
+ import { RequestOptions } from '../../internal/request-options';
9
+ import { path } from '../../internal/utils/path';
10
+
11
+ export class Jobs extends APIResource {
12
+ runs: RunsAPI.Runs = new RunsAPI.Runs(this._client);
13
+
14
+ /**
15
+ * Create Job
16
+ */
17
+ create(body: JobCreateParams, options?: RequestOptions): APIPromise<JobCreateResponse> {
18
+ return this._client.post('/v1/jobs', { body, ...options });
19
+ }
20
+
21
+ /**
22
+ * Update Job
23
+ */
24
+ update(jobID: string, body: JobUpdateParams, options?: RequestOptions): APIPromise<JobUpdateResponse> {
25
+ return this._client.patch(path`/v1/jobs/${jobID}`, { body, ...options });
26
+ }
27
+
28
+ /**
29
+ * List Jobs
30
+ */
31
+ list(query: JobListParams | null | undefined = {}, options?: RequestOptions): APIPromise<JobListResponse> {
32
+ return this._client.get('/v1/jobs', { query, ...options });
33
+ }
34
+
35
+ /**
36
+ * Delete Job
37
+ */
38
+ delete(jobID: string, options?: RequestOptions): APIPromise<void> {
39
+ return this._client.delete(path`/v1/jobs/${jobID}`, {
40
+ ...options,
41
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
42
+ });
43
+ }
44
+
45
+ /**
46
+ * Get Job
47
+ */
48
+ get(jobID: string, options?: RequestOptions): APIPromise<JobGetResponse> {
49
+ return this._client.get(path`/v1/jobs/${jobID}`, options);
50
+ }
51
+
52
+ /**
53
+ * Trigger Run
54
+ */
55
+ run(jobID: string, options?: RequestOptions): APIPromise<JobRunResponse> {
56
+ return this._client.post(path`/v1/jobs/${jobID}/runs`, options);
57
+ }
58
+ }
59
+
60
+ export interface JobCreateResponse {
61
+ id: string;
62
+
63
+ name: string;
64
+
65
+ agent_name?: string | null;
66
+
67
+ created_at?: string | null;
68
+
69
+ description?: string | null;
70
+
71
+ destination?: JobCreateResponse.Destination | null;
72
+
73
+ display_name?: string | null;
74
+
75
+ inputs?: JobCreateResponse.Inputs | null;
76
+
77
+ last_run_at?: string | null;
78
+
79
+ last_run_status?: 'PENDING' | 'RUNNING' | 'SUCCESS' | 'FAILED' | 'CANCELLED' | 'TIMEOUT' | 'WARNING' | null;
80
+
81
+ schedule?: JobCreateResponse.Schedule | null;
82
+
83
+ updated_at?: string | null;
84
+ }
85
+
86
+ export namespace JobCreateResponse {
87
+ export interface Destination {
88
+ path: string;
89
+
90
+ type: 'file' | 's3';
91
+
92
+ format?: 'jsonl' | 'csv' | 'parquet';
93
+ }
94
+
95
+ export interface Inputs {
96
+ type: 's3' | 'inline' | 'file';
97
+
98
+ data?: Array<{ [key: string]: unknown }> | null;
99
+
100
+ file_path?: string | null;
101
+ }
102
+
103
+ export interface Schedule {
104
+ cron: string;
105
+
106
+ enabled: boolean;
107
+ }
108
+ }
109
+
110
+ export interface JobUpdateResponse {
111
+ id: string;
112
+
113
+ name: string;
114
+
115
+ agent_name?: string | null;
116
+
117
+ created_at?: string | null;
118
+
119
+ description?: string | null;
120
+
121
+ destination?: JobUpdateResponse.Destination | null;
122
+
123
+ display_name?: string | null;
124
+
125
+ inputs?: JobUpdateResponse.Inputs | null;
126
+
127
+ last_run_at?: string | null;
128
+
129
+ last_run_status?: 'PENDING' | 'RUNNING' | 'SUCCESS' | 'FAILED' | 'CANCELLED' | 'TIMEOUT' | 'WARNING' | null;
130
+
131
+ schedule?: JobUpdateResponse.Schedule | null;
132
+
133
+ updated_at?: string | null;
134
+ }
135
+
136
+ export namespace JobUpdateResponse {
137
+ export interface Destination {
138
+ path: string;
139
+
140
+ type: 'file' | 's3';
141
+
142
+ format?: 'jsonl' | 'csv' | 'parquet';
143
+ }
144
+
145
+ export interface Inputs {
146
+ type: 's3' | 'inline' | 'file';
147
+
148
+ data?: Array<{ [key: string]: unknown }> | null;
149
+
150
+ file_path?: string | null;
151
+ }
152
+
153
+ export interface Schedule {
154
+ cron: string;
155
+
156
+ enabled: boolean;
157
+ }
158
+ }
159
+
160
+ export interface JobListResponse {
161
+ items: Array<JobListResponse.Item>;
162
+
163
+ page: number;
164
+
165
+ per_page: number;
166
+
167
+ total: number;
168
+ }
169
+
170
+ export namespace JobListResponse {
171
+ export interface Item {
172
+ id: string;
173
+
174
+ name: string;
175
+
176
+ agent_name?: string | null;
177
+
178
+ created_at?: string | null;
179
+
180
+ description?: string | null;
181
+
182
+ destination?: Item.Destination | null;
183
+
184
+ display_name?: string | null;
185
+
186
+ inputs?: Item.Inputs | null;
187
+
188
+ last_run_at?: string | null;
189
+
190
+ last_run_status?:
191
+ | 'PENDING'
192
+ | 'RUNNING'
193
+ | 'SUCCESS'
194
+ | 'FAILED'
195
+ | 'CANCELLED'
196
+ | 'TIMEOUT'
197
+ | 'WARNING'
198
+ | null;
199
+
200
+ schedule?: Item.Schedule | null;
201
+
202
+ updated_at?: string | null;
203
+ }
204
+
205
+ export namespace Item {
206
+ export interface Destination {
207
+ path: string;
208
+
209
+ type: 'file' | 's3';
210
+
211
+ format?: 'jsonl' | 'csv' | 'parquet';
212
+ }
213
+
214
+ export interface Inputs {
215
+ type: 's3' | 'inline' | 'file';
216
+
217
+ data?: Array<{ [key: string]: unknown }> | null;
218
+
219
+ file_path?: string | null;
220
+ }
221
+
222
+ export interface Schedule {
223
+ cron: string;
224
+
225
+ enabled: boolean;
226
+ }
227
+ }
228
+ }
229
+
230
+ export interface JobGetResponse {
231
+ id: string;
232
+
233
+ name: string;
234
+
235
+ agent_name?: string | null;
236
+
237
+ created_at?: string | null;
238
+
239
+ description?: string | null;
240
+
241
+ destination?: JobGetResponse.Destination | null;
242
+
243
+ display_name?: string | null;
244
+
245
+ inputs?: JobGetResponse.Inputs | null;
246
+
247
+ last_run_at?: string | null;
248
+
249
+ last_run_status?: 'PENDING' | 'RUNNING' | 'SUCCESS' | 'FAILED' | 'CANCELLED' | 'TIMEOUT' | 'WARNING' | null;
250
+
251
+ schedule?: JobGetResponse.Schedule | null;
252
+
253
+ updated_at?: string | null;
254
+ }
255
+
256
+ export namespace JobGetResponse {
257
+ export interface Destination {
258
+ path: string;
259
+
260
+ type: 'file' | 's3';
261
+
262
+ format?: 'jsonl' | 'csv' | 'parquet';
263
+ }
264
+
265
+ export interface Inputs {
266
+ type: 's3' | 'inline' | 'file';
267
+
268
+ data?: Array<{ [key: string]: unknown }> | null;
269
+
270
+ file_path?: string | null;
271
+ }
272
+
273
+ export interface Schedule {
274
+ cron: string;
275
+
276
+ enabled: boolean;
277
+ }
278
+ }
279
+
280
+ export interface JobRunResponse {
281
+ id: string;
282
+
283
+ created_at: string;
284
+
285
+ job_id: string;
286
+
287
+ status: 'PENDING' | 'RUNNING' | 'SUCCESS' | 'FAILED' | 'CANCELLED' | 'TIMEOUT' | 'WARNING';
288
+
289
+ triggered_by: 'schedule' | 'manual';
290
+
291
+ finished_at?: string | null;
292
+
293
+ input_count?: number | null;
294
+
295
+ result_count?: number | null;
296
+
297
+ started_at?: string | null;
298
+ }
299
+
300
+ export interface JobCreateParams {
301
+ agent_name: string;
302
+
303
+ name: string;
304
+
305
+ description?: string | null;
306
+
307
+ destination?: JobCreateParams.Destination | null;
308
+
309
+ display_name?: string | null;
310
+
311
+ inputs?: JobCreateParams.Inputs | null;
312
+
313
+ schedule?: JobCreateParams.Schedule | null;
314
+ }
315
+
316
+ export namespace JobCreateParams {
317
+ export interface Destination {
318
+ path: string;
319
+
320
+ type: 'file' | 's3';
321
+
322
+ format?: 'jsonl' | 'csv' | 'parquet';
323
+ }
324
+
325
+ export interface Inputs {
326
+ type: 's3' | 'inline' | 'file';
327
+
328
+ data?: Array<{ [key: string]: unknown }> | null;
329
+
330
+ file_path?: string | null;
331
+ }
332
+
333
+ export interface Schedule {
334
+ cron: string;
335
+
336
+ enabled: boolean;
337
+ }
338
+ }
339
+
340
+ export interface JobUpdateParams {
341
+ description?: string | null;
342
+
343
+ destination?: JobUpdateParams.Destination | null;
344
+
345
+ display_name?: string | null;
346
+
347
+ inputs?: JobUpdateParams.Inputs | null;
348
+
349
+ schedule?: JobUpdateParams.Schedule | null;
350
+ }
351
+
352
+ export namespace JobUpdateParams {
353
+ export interface Destination {
354
+ path: string;
355
+
356
+ type: 'file' | 's3';
357
+
358
+ format?: 'jsonl' | 'csv' | 'parquet';
359
+ }
360
+
361
+ export interface Inputs {
362
+ type: 's3' | 'inline' | 'file';
363
+
364
+ data?: Array<{ [key: string]: unknown }> | null;
365
+
366
+ file_path?: string | null;
367
+ }
368
+
369
+ export interface Schedule {
370
+ cron: string;
371
+
372
+ enabled: boolean;
373
+ }
374
+ }
375
+
376
+ export interface JobListParams {
377
+ /**
378
+ * Filter by agent name
379
+ */
380
+ agent_name?: string | null;
381
+
382
+ page?: number;
383
+
384
+ per_page?: number;
385
+
386
+ /**
387
+ * Search by name or display name
388
+ */
389
+ q?: string | null;
390
+ }
391
+
392
+ Jobs.Runs = Runs;
393
+
394
+ export declare namespace Jobs {
395
+ export {
396
+ type JobCreateResponse as JobCreateResponse,
397
+ type JobUpdateResponse as JobUpdateResponse,
398
+ type JobListResponse as JobListResponse,
399
+ type JobGetResponse as JobGetResponse,
400
+ type JobRunResponse as JobRunResponse,
401
+ type JobCreateParams as JobCreateParams,
402
+ type JobUpdateParams as JobUpdateParams,
403
+ type JobListParams as JobListParams,
404
+ };
405
+
406
+ export {
407
+ Runs as Runs,
408
+ type RunListResponse as RunListResponse,
409
+ type RunCancelResponse as RunCancelResponse,
410
+ type RunGetResponse as RunGetResponse,
411
+ type RunListParams as RunListParams,
412
+ };
413
+ }
@@ -0,0 +1,115 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../core/resource';
4
+ import { APIPromise } from '../../../core/api-promise';
5
+ import { RequestOptions } from '../../../internal/request-options';
6
+ import { path } from '../../../internal/utils/path';
7
+
8
+ export class Artifacts extends APIResource {
9
+ /**
10
+ * List Run Artifacts
11
+ */
12
+ list(runID: string, options?: RequestOptions): APIPromise<ArtifactListResponse> {
13
+ return this._client.get(path`/v1/jobs/runs/${runID}/artifacts`, options);
14
+ }
15
+
16
+ /**
17
+ * Get Run Artifact Download URL
18
+ */
19
+ downloadURL(
20
+ artifactID: string,
21
+ params: ArtifactDownloadURLParams,
22
+ options?: RequestOptions,
23
+ ): APIPromise<ArtifactDownloadURLResponse> {
24
+ const { run_id } = params;
25
+ return this._client.get(path`/v1/jobs/runs/${run_id}/artifacts/${artifactID}/download-url`, options);
26
+ }
27
+
28
+ /**
29
+ * Get Run Artifact
30
+ */
31
+ get(
32
+ artifactID: string,
33
+ params: ArtifactGetParams,
34
+ options?: RequestOptions,
35
+ ): APIPromise<ArtifactGetResponse> {
36
+ const { run_id } = params;
37
+ return this._client.get(path`/v1/jobs/runs/${run_id}/artifacts/${artifactID}`, options);
38
+ }
39
+
40
+ /**
41
+ * Preview Run Artifact
42
+ */
43
+ preview(
44
+ artifactID: string,
45
+ params: ArtifactPreviewParams,
46
+ options?: RequestOptions,
47
+ ): APIPromise<ArtifactPreviewResponse> {
48
+ const { run_id } = params;
49
+ return this._client.get(path`/v1/jobs/runs/${run_id}/artifacts/${artifactID}/preview`, options);
50
+ }
51
+ }
52
+
53
+ export interface ArtifactListResponse {
54
+ items: Array<ArtifactListResponse.Item>;
55
+ }
56
+
57
+ export namespace ArtifactListResponse {
58
+ export interface Item {
59
+ id: string;
60
+
61
+ created_at: string;
62
+
63
+ description: string;
64
+
65
+ type: string;
66
+ }
67
+ }
68
+
69
+ export interface ArtifactDownloadURLResponse {
70
+ expires_at: string;
71
+
72
+ url: string;
73
+ }
74
+
75
+ export interface ArtifactGetResponse {
76
+ id: string;
77
+
78
+ created_at: string;
79
+
80
+ description: string;
81
+
82
+ type: string;
83
+ }
84
+
85
+ export interface ArtifactPreviewResponse {
86
+ columns: Array<string>;
87
+
88
+ row_count: number;
89
+
90
+ rows: Array<{ [key: string]: unknown }>;
91
+ }
92
+
93
+ export interface ArtifactDownloadURLParams {
94
+ run_id: string;
95
+ }
96
+
97
+ export interface ArtifactGetParams {
98
+ run_id: string;
99
+ }
100
+
101
+ export interface ArtifactPreviewParams {
102
+ run_id: string;
103
+ }
104
+
105
+ export declare namespace Artifacts {
106
+ export {
107
+ type ArtifactListResponse as ArtifactListResponse,
108
+ type ArtifactDownloadURLResponse as ArtifactDownloadURLResponse,
109
+ type ArtifactGetResponse as ArtifactGetResponse,
110
+ type ArtifactPreviewResponse as ArtifactPreviewResponse,
111
+ type ArtifactDownloadURLParams as ArtifactDownloadURLParams,
112
+ type ArtifactGetParams as ArtifactGetParams,
113
+ type ArtifactPreviewParams as ArtifactPreviewParams,
114
+ };
115
+ }
@@ -0,0 +1,19 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export {
4
+ Artifacts,
5
+ type ArtifactListResponse,
6
+ type ArtifactDownloadURLResponse,
7
+ type ArtifactGetResponse,
8
+ type ArtifactPreviewResponse,
9
+ type ArtifactDownloadURLParams,
10
+ type ArtifactGetParams,
11
+ type ArtifactPreviewParams,
12
+ } from './artifacts';
13
+ export {
14
+ Runs,
15
+ type RunListResponse,
16
+ type RunCancelResponse,
17
+ type RunGetResponse,
18
+ type RunListParams,
19
+ } from './runs';
@@ -0,0 +1,177 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../core/resource';
4
+ import * as ArtifactsAPI from './artifacts';
5
+ import {
6
+ ArtifactDownloadURLParams,
7
+ ArtifactDownloadURLResponse,
8
+ ArtifactGetParams,
9
+ ArtifactGetResponse,
10
+ ArtifactListResponse,
11
+ ArtifactPreviewParams,
12
+ ArtifactPreviewResponse,
13
+ Artifacts,
14
+ } from './artifacts';
15
+ import { APIPromise } from '../../../core/api-promise';
16
+ import { RequestOptions } from '../../../internal/request-options';
17
+ import { path } from '../../../internal/utils/path';
18
+
19
+ export class Runs extends APIResource {
20
+ artifacts: ArtifactsAPI.Artifacts = new ArtifactsAPI.Artifacts(this._client);
21
+
22
+ /**
23
+ * List Runs for Job
24
+ */
25
+ list(
26
+ jobID: string,
27
+ query: RunListParams | null | undefined = {},
28
+ options?: RequestOptions,
29
+ ): APIPromise<RunListResponse> {
30
+ return this._client.get(path`/v1/jobs/${jobID}/runs`, { query, ...options });
31
+ }
32
+
33
+ /**
34
+ * Cancel Run
35
+ */
36
+ cancel(runID: string, options?: RequestOptions): APIPromise<RunCancelResponse> {
37
+ return this._client.post(path`/v1/jobs/runs/${runID}/cancel`, options);
38
+ }
39
+
40
+ /**
41
+ * Get Run
42
+ */
43
+ get(runID: string, options?: RequestOptions): APIPromise<RunGetResponse> {
44
+ return this._client.get(path`/v1/jobs/runs/${runID}`, options);
45
+ }
46
+ }
47
+
48
+ export interface RunListResponse {
49
+ items: Array<RunListResponse.Item>;
50
+
51
+ page: number;
52
+
53
+ per_page: number;
54
+
55
+ total: number;
56
+ }
57
+
58
+ export namespace RunListResponse {
59
+ export interface Item {
60
+ id: string;
61
+
62
+ created_at: string;
63
+
64
+ job_id: string;
65
+
66
+ status: 'PENDING' | 'RUNNING' | 'SUCCESS' | 'FAILED' | 'CANCELLED' | 'TIMEOUT' | 'WARNING';
67
+
68
+ triggered_by: 'schedule' | 'manual';
69
+
70
+ finished_at?: string | null;
71
+
72
+ input_count?: number | null;
73
+
74
+ result_count?: number | null;
75
+
76
+ started_at?: string | null;
77
+ }
78
+ }
79
+
80
+ export interface RunCancelResponse {
81
+ id: string;
82
+
83
+ status: 'PENDING' | 'RUNNING' | 'SUCCESS' | 'FAILED' | 'CANCELLED' | 'TIMEOUT' | 'WARNING';
84
+ }
85
+
86
+ export interface RunGetResponse {
87
+ id: string;
88
+
89
+ created_at: string;
90
+
91
+ job: RunGetResponse.Job;
92
+
93
+ status: 'PENDING' | 'RUNNING' | 'SUCCESS' | 'FAILED' | 'CANCELLED' | 'TIMEOUT' | 'WARNING';
94
+
95
+ triggered_by: 'schedule' | 'manual';
96
+
97
+ error?: RunGetResponse.Error | null;
98
+
99
+ finished_at?: string | null;
100
+
101
+ inputs_sample?: Array<unknown> | null;
102
+
103
+ started_at?: string | null;
104
+
105
+ summary?: RunGetResponse.Summary | null;
106
+ }
107
+
108
+ export namespace RunGetResponse {
109
+ export interface Job {
110
+ id: string;
111
+
112
+ name: string;
113
+
114
+ agent_name?: string | null;
115
+
116
+ display_name?: string | null;
117
+
118
+ schedule?: Job.Schedule | null;
119
+ }
120
+
121
+ export namespace Job {
122
+ export interface Schedule {
123
+ cron: string;
124
+
125
+ enabled: boolean;
126
+ }
127
+ }
128
+
129
+ export interface Error {
130
+ errors_sample?: Array<{ [key: string]: unknown }> | null;
131
+
132
+ message?: string | null;
133
+
134
+ step?: string | null;
135
+ }
136
+
137
+ export interface Summary {
138
+ input_count?: number | null;
139
+
140
+ match_rate?: number | null;
141
+
142
+ result_count?: number | null;
143
+ }
144
+ }
145
+
146
+ export interface RunListParams {
147
+ page?: number;
148
+
149
+ per_page?: number;
150
+
151
+ /**
152
+ * Filter by status
153
+ */
154
+ status?: string | null;
155
+ }
156
+
157
+ Runs.Artifacts = Artifacts;
158
+
159
+ export declare namespace Runs {
160
+ export {
161
+ type RunListResponse as RunListResponse,
162
+ type RunCancelResponse as RunCancelResponse,
163
+ type RunGetResponse as RunGetResponse,
164
+ type RunListParams as RunListParams,
165
+ };
166
+
167
+ export {
168
+ Artifacts as Artifacts,
169
+ type ArtifactListResponse as ArtifactListResponse,
170
+ type ArtifactDownloadURLResponse as ArtifactDownloadURLResponse,
171
+ type ArtifactGetResponse as ArtifactGetResponse,
172
+ type ArtifactPreviewResponse as ArtifactPreviewResponse,
173
+ type ArtifactDownloadURLParams as ArtifactDownloadURLParams,
174
+ type ArtifactGetParams as ArtifactGetParams,
175
+ type ArtifactPreviewParams as ArtifactPreviewParams,
176
+ };
177
+ }
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './runs/index';