@nimble-way/nimble-js 0.17.0 → 0.19.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 (86) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/package.json +1 -1
  3. package/resources/agent.d.mts +17 -13
  4. package/resources/agent.d.mts.map +1 -1
  5. package/resources/agent.d.ts +17 -13
  6. package/resources/agent.d.ts.map +1 -1
  7. package/resources/batches.d.mts +11 -7
  8. package/resources/batches.d.mts.map +1 -1
  9. package/resources/batches.d.ts +11 -7
  10. package/resources/batches.d.ts.map +1 -1
  11. package/resources/crawl.d.mts +11 -1
  12. package/resources/crawl.d.mts.map +1 -1
  13. package/resources/crawl.d.ts +11 -1
  14. package/resources/crawl.d.ts.map +1 -1
  15. package/resources/jobs/jobs.d.mts +447 -0
  16. package/resources/jobs/jobs.d.mts.map +1 -1
  17. package/resources/jobs/jobs.d.ts +447 -0
  18. package/resources/jobs/jobs.d.ts.map +1 -1
  19. package/resources/jobs/jobs.js.map +1 -1
  20. package/resources/jobs/jobs.mjs.map +1 -1
  21. package/resources/jobs/runs/artifacts.d.mts +67 -0
  22. package/resources/jobs/runs/artifacts.d.mts.map +1 -1
  23. package/resources/jobs/runs/artifacts.d.ts +67 -0
  24. package/resources/jobs/runs/artifacts.d.ts.map +1 -1
  25. package/resources/jobs/runs/runs.d.mts +139 -0
  26. package/resources/jobs/runs/runs.d.mts.map +1 -1
  27. package/resources/jobs/runs/runs.d.ts +139 -0
  28. package/resources/jobs/runs/runs.d.ts.map +1 -1
  29. package/resources/jobs/runs/runs.js.map +1 -1
  30. package/resources/jobs/runs/runs.mjs.map +1 -1
  31. package/resources/media.d.mts +11 -7
  32. package/resources/media.d.mts.map +1 -1
  33. package/resources/media.d.ts +11 -7
  34. package/resources/media.d.ts.map +1 -1
  35. package/resources/serp.d.mts +22 -14
  36. package/resources/serp.d.mts.map +1 -1
  37. package/resources/serp.d.ts +22 -14
  38. package/resources/serp.d.ts.map +1 -1
  39. package/resources/task-agent/runs.d.mts +332 -69
  40. package/resources/task-agent/runs.d.mts.map +1 -1
  41. package/resources/task-agent/runs.d.ts +332 -69
  42. package/resources/task-agent/runs.d.ts.map +1 -1
  43. package/resources/task-agent/runs.js +21 -6
  44. package/resources/task-agent/runs.js.map +1 -1
  45. package/resources/task-agent/runs.mjs +21 -6
  46. package/resources/task-agent/runs.mjs.map +1 -1
  47. package/resources/task-agent/task-agent.d.mts +131 -33
  48. package/resources/task-agent/task-agent.d.mts.map +1 -1
  49. package/resources/task-agent/task-agent.d.ts +131 -33
  50. package/resources/task-agent/task-agent.d.ts.map +1 -1
  51. package/resources/task-agent/task-agent.js +12 -14
  52. package/resources/task-agent/task-agent.js.map +1 -1
  53. package/resources/task-agent/task-agent.mjs +12 -14
  54. package/resources/task-agent/task-agent.mjs.map +1 -1
  55. package/resources/task-agent/templates.d.mts +15 -6
  56. package/resources/task-agent/templates.d.mts.map +1 -1
  57. package/resources/task-agent/templates.d.ts +15 -6
  58. package/resources/task-agent/templates.d.ts.map +1 -1
  59. package/resources/task-agent/templates.js +2 -2
  60. package/resources/task-agent/templates.mjs +2 -2
  61. package/resources/tasks.d.mts +22 -14
  62. package/resources/tasks.d.mts.map +1 -1
  63. package/resources/tasks.d.ts +22 -14
  64. package/resources/tasks.d.ts.map +1 -1
  65. package/resources/top-level.d.mts +77 -20
  66. package/resources/top-level.d.mts.map +1 -1
  67. package/resources/top-level.d.ts +77 -20
  68. package/resources/top-level.d.ts.map +1 -1
  69. package/src/resources/agent.ts +20 -15
  70. package/src/resources/batches.ts +12 -7
  71. package/src/resources/crawl.ts +21 -1
  72. package/src/resources/jobs/jobs.ts +447 -0
  73. package/src/resources/jobs/runs/artifacts.ts +67 -0
  74. package/src/resources/jobs/runs/runs.ts +139 -0
  75. package/src/resources/media.ts +12 -7
  76. package/src/resources/serp.ts +24 -14
  77. package/src/resources/task-agent/runs.ts +370 -78
  78. package/src/resources/task-agent/task-agent.ts +141 -47
  79. package/src/resources/task-agent/templates.ts +16 -7
  80. package/src/resources/tasks.ts +24 -14
  81. package/src/resources/top-level.ts +118 -20
  82. package/src/version.ts +1 -1
  83. package/version.d.mts +1 -1
  84. package/version.d.ts +1 -1
  85. package/version.js +1 -1
  86. package/version.mjs +1 -1
@@ -50,43 +50,110 @@ export class Artifacts extends APIResource {
50
50
  }
51
51
  }
52
52
 
53
+ /**
54
+ * Artifacts produced by a run.
55
+ */
53
56
  export interface ArtifactListResponse {
57
+ /**
58
+ * Artifacts produced by the run.
59
+ */
54
60
  items: Array<ArtifactListResponse.Item>;
55
61
  }
56
62
 
57
63
  export namespace ArtifactListResponse {
64
+ /**
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
+ */
58
72
  export interface Item {
73
+ /**
74
+ * Artifact identifier.
75
+ */
59
76
  id: string;
60
77
 
78
+ /**
79
+ * When the artifact was created.
80
+ */
61
81
  created_at: string;
62
82
 
83
+ /**
84
+ * Human-readable artifact description.
85
+ */
63
86
  description: string;
64
87
 
88
+ /**
89
+ * Artifact type.
90
+ */
65
91
  type: string;
66
92
  }
67
93
  }
68
94
 
95
+ /**
96
+ * A pre-signed URL for downloading an artifact.
97
+ */
69
98
  export interface ArtifactDownloadURLResponse {
99
+ /**
100
+ * When the download URL expires.
101
+ */
70
102
  expires_at: string;
71
103
 
104
+ /**
105
+ * Pre-signed URL to download the artifact.
106
+ */
72
107
  url: string;
73
108
  }
74
109
 
110
+ /**
111
+ * 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
+ */
75
118
  export interface ArtifactGetResponse {
119
+ /**
120
+ * Artifact identifier.
121
+ */
76
122
  id: string;
77
123
 
124
+ /**
125
+ * When the artifact was created.
126
+ */
78
127
  created_at: string;
79
128
 
129
+ /**
130
+ * Human-readable artifact description.
131
+ */
80
132
  description: string;
81
133
 
134
+ /**
135
+ * Artifact type.
136
+ */
82
137
  type: string;
83
138
  }
84
139
 
140
+ /**
141
+ * A tabular preview of an artifact's contents.
142
+ */
85
143
  export interface ArtifactPreviewResponse {
144
+ /**
145
+ * Column names in the preview.
146
+ */
86
147
  columns: Array<string>;
87
148
 
149
+ /**
150
+ * Total number of rows in the artifact.
151
+ */
88
152
  row_count: number;
89
153
 
154
+ /**
155
+ * Sample rows from the artifact.
156
+ */
90
157
  rows: Array<{ [key: string]: unknown }>;
91
158
  }
92
159
 
@@ -45,100 +45,239 @@ export class Runs extends APIResource {
45
45
  }
46
46
  }
47
47
 
48
+ /**
49
+ * A page of job runs.
50
+ */
48
51
  export interface RunListResponse {
52
+ /**
53
+ * Runs on this page.
54
+ */
49
55
  items: Array<RunListResponse.Item>;
50
56
 
57
+ /**
58
+ * Current page number.
59
+ */
51
60
  page: number;
52
61
 
62
+ /**
63
+ * Number of items per page.
64
+ */
53
65
  per_page: number;
54
66
 
67
+ /**
68
+ * Total number of runs matching the query.
69
+ */
55
70
  total: number;
56
71
  }
57
72
 
58
73
  export namespace RunListResponse {
74
+ /**
75
+ * A single execution of a job.
76
+ */
59
77
  export interface Item {
78
+ /**
79
+ * Unique run identifier (run\_<n>).
80
+ */
60
81
  id: string;
61
82
 
83
+ /**
84
+ * When the run was created.
85
+ */
62
86
  created_at: string;
63
87
 
88
+ /**
89
+ * Identifier of the job this run belongs to.
90
+ */
64
91
  job_id: string;
65
92
 
93
+ /**
94
+ * Current run status.
95
+ */
66
96
  status: 'PENDING' | 'RUNNING' | 'SUCCESS' | 'FAILED' | 'CANCELLED' | 'TIMEOUT' | 'WARNING';
67
97
 
98
+ /**
99
+ * What triggered the run: 'schedule' or 'manual'.
100
+ */
68
101
  triggered_by: 'schedule' | 'manual';
69
102
 
103
+ /**
104
+ * When the run finished.
105
+ */
70
106
  finished_at?: string | null;
71
107
 
108
+ /**
109
+ * Number of input records processed.
110
+ */
72
111
  input_count?: number | null;
73
112
 
113
+ /**
114
+ * Number of result records produced.
115
+ */
74
116
  result_count?: number | null;
75
117
 
118
+ /**
119
+ * When the run started executing.
120
+ */
76
121
  started_at?: string | null;
77
122
  }
78
123
  }
79
124
 
125
+ /**
126
+ * Result of cancelling a run.
127
+ */
80
128
  export interface RunCancelResponse {
129
+ /**
130
+ * Identifier of the cancelled run.
131
+ */
81
132
  id: string;
82
133
 
134
+ /**
135
+ * Run status after cancellation.
136
+ */
83
137
  status: 'PENDING' | 'RUNNING' | 'SUCCESS' | 'FAILED' | 'CANCELLED' | 'TIMEOUT' | 'WARNING';
84
138
  }
85
139
 
140
+ /**
141
+ * Full detail for a single run.
142
+ */
86
143
  export interface RunGetResponse {
144
+ /**
145
+ * Unique run identifier (run\_<n>).
146
+ */
87
147
  id: string;
88
148
 
149
+ /**
150
+ * When the run was created.
151
+ */
89
152
  created_at: string;
90
153
 
154
+ /**
155
+ * Context of the job this run belongs to.
156
+ */
91
157
  job: RunGetResponse.Job;
92
158
 
159
+ /**
160
+ * Current run status.
161
+ */
93
162
  status: 'PENDING' | 'RUNNING' | 'SUCCESS' | 'FAILED' | 'CANCELLED' | 'TIMEOUT' | 'WARNING';
94
163
 
164
+ /**
165
+ * What triggered the run: 'schedule' or 'manual'.
166
+ */
95
167
  triggered_by: 'schedule' | 'manual';
96
168
 
169
+ /**
170
+ * Error details for a failed run.
171
+ */
97
172
  error?: RunGetResponse.Error | null;
98
173
 
174
+ /**
175
+ * When the run finished.
176
+ */
99
177
  finished_at?: string | null;
100
178
 
179
+ /**
180
+ * Sample of the run's input records.
181
+ */
101
182
  inputs_sample?: Array<unknown> | null;
102
183
 
184
+ /**
185
+ * When the run started executing.
186
+ */
103
187
  started_at?: string | null;
104
188
 
189
+ /**
190
+ * Aggregate metrics for a run.
191
+ */
105
192
  summary?: RunGetResponse.Summary | null;
106
193
  }
107
194
 
108
195
  export namespace RunGetResponse {
196
+ /**
197
+ * Context of the job this run belongs to.
198
+ */
109
199
  export interface Job {
200
+ /**
201
+ * Unique job identifier (job\_<n>).
202
+ */
110
203
  id: string;
111
204
 
205
+ /**
206
+ * Internal job name.
207
+ */
112
208
  name: string;
113
209
 
210
+ /**
211
+ * Name of the agent this job runs.
212
+ */
114
213
  agent_name?: string | null;
115
214
 
215
+ /**
216
+ * Human-friendly job name shown in the UI.
217
+ */
116
218
  display_name?: string | null;
117
219
 
220
+ /**
221
+ * Cron-based schedule controlling when a job runs automatically.
222
+ */
118
223
  schedule?: Job.Schedule | null;
119
224
  }
120
225
 
121
226
  export namespace Job {
227
+ /**
228
+ * Cron-based schedule controlling when a job runs automatically.
229
+ */
122
230
  export interface Schedule {
231
+ /**
232
+ * Cron expression defining when the job runs.
233
+ */
123
234
  cron: string;
124
235
 
236
+ /**
237
+ * Whether the schedule is currently active.
238
+ */
125
239
  enabled: boolean;
126
240
  }
127
241
  }
128
242
 
243
+ /**
244
+ * Error details for a failed run.
245
+ */
129
246
  export interface Error {
247
+ /**
248
+ * Sample of individual error records from the run.
249
+ */
130
250
  errors_sample?: Array<{ [key: string]: unknown }> | null;
131
251
 
252
+ /**
253
+ * Human-readable error message.
254
+ */
132
255
  message?: string | null;
133
256
 
257
+ /**
258
+ * Pipeline step where the error occurred.
259
+ */
134
260
  step?: string | null;
135
261
  }
136
262
 
263
+ /**
264
+ * Aggregate metrics for a run.
265
+ */
137
266
  export interface Summary {
267
+ /**
268
+ * Number of input records processed.
269
+ */
138
270
  input_count?: number | null;
139
271
 
272
+ /**
273
+ * Fraction of inputs that produced a result (result_count / input_count), from 0.0
274
+ * to 1.0.
275
+ */
140
276
  match_rate?: number | null;
141
277
 
278
+ /**
279
+ * Number of result records produced.
280
+ */
142
281
  result_count?: number | null;
143
282
  }
144
283
  }
@@ -440,7 +440,7 @@ export namespace MediaRunAsyncResponse {
440
440
  /**
441
441
  * Current state of the task.
442
442
  */
443
- state: 'pending' | 'success' | 'error';
443
+ state: 'pending' | 'queued' | 'in_progress' | 'success' | 'error';
444
444
 
445
445
  /**
446
446
  * URL for checking the task status.
@@ -452,27 +452,27 @@ export namespace MediaRunAsyncResponse {
452
452
  */
453
453
  account_name?: string;
454
454
 
455
- api_type?: 'web' | 'serp' | 'ecommerce' | 'social' | 'media' | 'agent' | 'extract' | 'fast-serp';
455
+ api_type?: 'web' | 'serp' | 'ecommerce' | 'social' | 'media' | 'agent' | 'extract' | 'fast-serp' | 'labs';
456
456
 
457
457
  /**
458
458
  * Batch ID if this task is part of a batch.
459
459
  */
460
- batch_id?: string;
460
+ batch_id?: string | null;
461
461
 
462
462
  /**
463
463
  * URL for downloading the task results.
464
464
  */
465
- download_url?: string;
465
+ download_url?: string | null;
466
466
 
467
467
  /**
468
468
  * Error message if the task failed.
469
469
  */
470
- error?: string;
470
+ error?: string | null;
471
471
 
472
472
  /**
473
473
  * Classification of the error type.
474
474
  */
475
- error_type?: string;
475
+ error_type?: string | null;
476
476
 
477
477
  /**
478
478
  * Timestamp when the task was last modified.
@@ -482,7 +482,12 @@ export namespace MediaRunAsyncResponse {
482
482
  /**
483
483
  * Storage location of the output data.
484
484
  */
485
- output_url?: string;
485
+ output_url?: string | null;
486
+
487
+ /**
488
+ * Queue name the task was submitted to.
489
+ */
490
+ queue?: string;
486
491
 
487
492
  /**
488
493
  * HTTP status code from the task execution.
@@ -454,7 +454,7 @@ export namespace SerpRunAsyncResponse {
454
454
  /**
455
455
  * Current state of the task.
456
456
  */
457
- state: 'pending' | 'success' | 'error';
457
+ state: 'pending' | 'queued' | 'in_progress' | 'success' | 'error';
458
458
 
459
459
  /**
460
460
  * URL for checking the task status.
@@ -466,27 +466,27 @@ export namespace SerpRunAsyncResponse {
466
466
  */
467
467
  account_name?: string;
468
468
 
469
- api_type?: 'web' | 'serp' | 'ecommerce' | 'social' | 'media' | 'agent' | 'extract' | 'fast-serp';
469
+ api_type?: 'web' | 'serp' | 'ecommerce' | 'social' | 'media' | 'agent' | 'extract' | 'fast-serp' | 'labs';
470
470
 
471
471
  /**
472
472
  * Batch ID if this task is part of a batch.
473
473
  */
474
- batch_id?: string;
474
+ batch_id?: string | null;
475
475
 
476
476
  /**
477
477
  * URL for downloading the task results.
478
478
  */
479
- download_url?: string;
479
+ download_url?: string | null;
480
480
 
481
481
  /**
482
482
  * Error message if the task failed.
483
483
  */
484
- error?: string;
484
+ error?: string | null;
485
485
 
486
486
  /**
487
487
  * Classification of the error type.
488
488
  */
489
- error_type?: string;
489
+ error_type?: string | null;
490
490
 
491
491
  /**
492
492
  * Timestamp when the task was last modified.
@@ -496,7 +496,12 @@ export namespace SerpRunAsyncResponse {
496
496
  /**
497
497
  * Storage location of the output data.
498
498
  */
499
- output_url?: string;
499
+ output_url?: string | null;
500
+
501
+ /**
502
+ * Queue name the task was submitted to.
503
+ */
504
+ queue?: string;
500
505
 
501
506
  /**
502
507
  * HTTP status code from the task execution.
@@ -547,7 +552,7 @@ export namespace SerpRunBatchResponse {
547
552
  /**
548
553
  * Current state of the task.
549
554
  */
550
- state: 'pending' | 'success' | 'error';
555
+ state: 'pending' | 'queued' | 'in_progress' | 'success' | 'error';
551
556
 
552
557
  /**
553
558
  * URL for checking the task status.
@@ -559,27 +564,27 @@ export namespace SerpRunBatchResponse {
559
564
  */
560
565
  account_name?: string;
561
566
 
562
- api_type?: 'web' | 'serp' | 'ecommerce' | 'social' | 'media' | 'agent' | 'extract' | 'fast-serp';
567
+ api_type?: 'web' | 'serp' | 'ecommerce' | 'social' | 'media' | 'agent' | 'extract' | 'fast-serp' | 'labs';
563
568
 
564
569
  /**
565
570
  * Batch ID if this task is part of a batch.
566
571
  */
567
- batch_id?: string;
572
+ batch_id?: string | null;
568
573
 
569
574
  /**
570
575
  * URL for downloading the task results.
571
576
  */
572
- download_url?: string;
577
+ download_url?: string | null;
573
578
 
574
579
  /**
575
580
  * Error message if the task failed.
576
581
  */
577
- error?: string;
582
+ error?: string | null;
578
583
 
579
584
  /**
580
585
  * Classification of the error type.
581
586
  */
582
- error_type?: string;
587
+ error_type?: string | null;
583
588
 
584
589
  /**
585
590
  * Timestamp when the task was last modified.
@@ -589,7 +594,12 @@ export namespace SerpRunBatchResponse {
589
594
  /**
590
595
  * Storage location of the output data.
591
596
  */
592
- output_url?: string;
597
+ output_url?: string | null;
598
+
599
+ /**
600
+ * Queue name the task was submitted to.
601
+ */
602
+ queue?: string;
593
603
 
594
604
  /**
595
605
  * HTTP status code from the task execution.