windmill-client 0.1.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 (100) hide show
  1. package/build.sh +7 -0
  2. package/package.json +7 -0
  3. package/src/core/ApiError.ts +24 -0
  4. package/src/core/ApiRequestOptions.ts +16 -0
  5. package/src/core/ApiResult.ts +10 -0
  6. package/src/core/CancelablePromise.ts +128 -0
  7. package/src/core/OpenAPI.ts +31 -0
  8. package/src/core/request.ts +308 -0
  9. package/src/index.ts +100 -0
  10. package/src/models/AppWithLastVersion.ts +31 -0
  11. package/src/models/AppWithLastVersionWDraft.ts +11 -0
  12. package/src/models/AuditLog.ts +42 -0
  13. package/src/models/BranchAll.ts +16 -0
  14. package/src/models/BranchOne.ts +16 -0
  15. package/src/models/CompletedJob.ts +68 -0
  16. package/src/models/ContextualVariable.ts +10 -0
  17. package/src/models/CreateInput.ts +9 -0
  18. package/src/models/CreateResource.ts +11 -0
  19. package/src/models/CreateVariable.ts +13 -0
  20. package/src/models/CreateWorkspace.ts +10 -0
  21. package/src/models/EditResource.ts +10 -0
  22. package/src/models/EditResourceType.ts +9 -0
  23. package/src/models/EditSchedule.ts +12 -0
  24. package/src/models/EditVariable.ts +11 -0
  25. package/src/models/EditWorkspaceUser.ts +10 -0
  26. package/src/models/Flow.ts +9 -0
  27. package/src/models/FlowMetadata.ts +16 -0
  28. package/src/models/FlowModule.ts +24 -0
  29. package/src/models/FlowModuleValue.ts +14 -0
  30. package/src/models/FlowPreview.ts +13 -0
  31. package/src/models/FlowStatus.ts +18 -0
  32. package/src/models/FlowStatusModule.ts +43 -0
  33. package/src/models/FlowValue.ts +12 -0
  34. package/src/models/Folder.ts +10 -0
  35. package/src/models/ForloopFlow.ts +15 -0
  36. package/src/models/GlobalUserInfo.ts +23 -0
  37. package/src/models/Group.ts +11 -0
  38. package/src/models/Identity.ts +9 -0
  39. package/src/models/Input.ts +13 -0
  40. package/src/models/InputTransform.ts +9 -0
  41. package/src/models/JavascriptTransform.ts +9 -0
  42. package/src/models/Job.ts +21 -0
  43. package/src/models/ListableApp.ts +27 -0
  44. package/src/models/ListableResource.ts +19 -0
  45. package/src/models/ListableVariable.ts +19 -0
  46. package/src/models/Login.ts +9 -0
  47. package/src/models/MainArgSignature.ts +42 -0
  48. package/src/models/NewSchedule.ts +16 -0
  49. package/src/models/NewScript.ts +39 -0
  50. package/src/models/NewScriptWithDraft.ts +11 -0
  51. package/src/models/NewToken.ts +9 -0
  52. package/src/models/NewTokenImpersonate.ts +10 -0
  53. package/src/models/NewUser.ts +10 -0
  54. package/src/models/OpenFlow.ts +13 -0
  55. package/src/models/OpenFlowWPath.ts +10 -0
  56. package/src/models/PathFlow.ts +12 -0
  57. package/src/models/PathScript.ts +13 -0
  58. package/src/models/Policy.ts +22 -0
  59. package/src/models/Preview.ts +26 -0
  60. package/src/models/QueuedJob.ts +66 -0
  61. package/src/models/RawScript.ts +28 -0
  62. package/src/models/Resource.ts +14 -0
  63. package/src/models/ResourceType.ts +11 -0
  64. package/src/models/Retry.ts +16 -0
  65. package/src/models/RunnableType.ts +9 -0
  66. package/src/models/Schedule.ts +21 -0
  67. package/src/models/Script.ts +53 -0
  68. package/src/models/ScriptArgs.ts +5 -0
  69. package/src/models/SlackToken.ts +13 -0
  70. package/src/models/StaticTransform.ts +9 -0
  71. package/src/models/TokenResponse.ts +11 -0
  72. package/src/models/TruncatedToken.ts +12 -0
  73. package/src/models/UpdateInput.ts +10 -0
  74. package/src/models/Usage.ts +8 -0
  75. package/src/models/User.ts +20 -0
  76. package/src/models/UserWorkspaceList.ts +13 -0
  77. package/src/models/WorkerPing.ts +13 -0
  78. package/src/models/Workspace.ts +11 -0
  79. package/src/models/WorkspaceInvite.ts +11 -0
  80. package/src/services/AdminService.ts +90 -0
  81. package/src/services/AppService.ts +383 -0
  82. package/src/services/AuditService.ts +103 -0
  83. package/src/services/CaptureService.ts +79 -0
  84. package/src/services/DraftService.ts +37 -0
  85. package/src/services/FavoriteService.ts +62 -0
  86. package/src/services/FlowService.ts +368 -0
  87. package/src/services/FolderService.ts +269 -0
  88. package/src/services/GranularAclService.ts +104 -0
  89. package/src/services/GroupService.ts +238 -0
  90. package/src/services/InputService.ts +175 -0
  91. package/src/services/JobService.ts +1247 -0
  92. package/src/services/OauthService.ts +197 -0
  93. package/src/services/ResourceService.ts +395 -0
  94. package/src/services/ScheduleService.ts +223 -0
  95. package/src/services/ScriptService.ts +601 -0
  96. package/src/services/SettingsService.ts +34 -0
  97. package/src/services/UserService.ts +574 -0
  98. package/src/services/VariableService.ts +194 -0
  99. package/src/services/WorkerService.ts +52 -0
  100. package/src/services/WorkspaceService.ts +446 -0
@@ -0,0 +1,1247 @@
1
+ /* istanbul ignore file */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ import type { CompletedJob } from '../models/CompletedJob';
5
+ import type { FlowPreview } from '../models/FlowPreview';
6
+ import type { Job } from '../models/Job';
7
+ import type { Preview } from '../models/Preview';
8
+ import type { QueuedJob } from '../models/QueuedJob';
9
+ import type { ScriptArgs } from '../models/ScriptArgs';
10
+
11
+ import type { CancelablePromise } from '../core/CancelablePromise';
12
+ import { OpenAPI } from '../core/OpenAPI';
13
+ import { request as __request } from '../core/request';
14
+
15
+ export class JobService {
16
+
17
+ /**
18
+ * run script by path
19
+ * @returns string job created
20
+ * @throws ApiError
21
+ */
22
+ public static runScriptByPath({
23
+ workspace,
24
+ path,
25
+ requestBody,
26
+ scheduledFor,
27
+ scheduledInSecs,
28
+ parentJob,
29
+ invisibleToOwner,
30
+ }: {
31
+ workspace: string,
32
+ path: string,
33
+ /**
34
+ * script args
35
+ */
36
+ requestBody: ScriptArgs,
37
+ /**
38
+ * when to schedule this job (leave empty for immediate run)
39
+ */
40
+ scheduledFor?: string,
41
+ /**
42
+ * schedule the script to execute in the number of seconds starting now
43
+ */
44
+ scheduledInSecs?: number,
45
+ /**
46
+ * The parent job that is at the origin and responsible for the execution of this script if any
47
+ */
48
+ parentJob?: string,
49
+ /**
50
+ * make the run invisible to the the script owner (default false)
51
+ */
52
+ invisibleToOwner?: boolean,
53
+ }): CancelablePromise<string> {
54
+ return __request(OpenAPI, {
55
+ method: 'POST',
56
+ url: '/w/{workspace}/jobs/run/p/{path}',
57
+ path: {
58
+ 'workspace': workspace,
59
+ 'path': path,
60
+ },
61
+ query: {
62
+ 'scheduled_for': scheduledFor,
63
+ 'scheduled_in_secs': scheduledInSecs,
64
+ 'parent_job': parentJob,
65
+ 'invisible_to_owner': invisibleToOwner,
66
+ },
67
+ body: requestBody,
68
+ mediaType: 'application/json',
69
+ });
70
+ }
71
+
72
+ /**
73
+ * run script by path
74
+ * @returns any job result
75
+ * @throws ApiError
76
+ */
77
+ public static runWaitResultScriptByPath({
78
+ workspace,
79
+ path,
80
+ requestBody,
81
+ parentJob,
82
+ includeHeader,
83
+ queueLimit,
84
+ }: {
85
+ workspace: string,
86
+ path: string,
87
+ /**
88
+ * script args
89
+ */
90
+ requestBody: ScriptArgs,
91
+ /**
92
+ * The parent job that is at the origin and responsible for the execution of this script if any
93
+ */
94
+ parentJob?: string,
95
+ /**
96
+ * List of headers's keys (separated with ',') whove value are added to the args
97
+ * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key
98
+ *
99
+ */
100
+ includeHeader?: string,
101
+ /**
102
+ * The maximum size of the queue for which the request would get rejected if that job would push it above that limit
103
+ *
104
+ */
105
+ queueLimit?: string,
106
+ }): CancelablePromise<any> {
107
+ return __request(OpenAPI, {
108
+ method: 'POST',
109
+ url: '/w/{workspace}/jobs/run_wait_result/p/{path}',
110
+ path: {
111
+ 'workspace': workspace,
112
+ 'path': path,
113
+ },
114
+ query: {
115
+ 'parent_job': parentJob,
116
+ 'include_header': includeHeader,
117
+ 'queue_limit': queueLimit,
118
+ },
119
+ body: requestBody,
120
+ mediaType: 'application/json',
121
+ });
122
+ }
123
+
124
+ /**
125
+ * run script by path with get
126
+ * @returns any job result
127
+ * @throws ApiError
128
+ */
129
+ public static runWaitResultScriptByPathGet({
130
+ workspace,
131
+ path,
132
+ parentJob,
133
+ includeHeader,
134
+ queueLimit,
135
+ payload,
136
+ }: {
137
+ workspace: string,
138
+ path: string,
139
+ /**
140
+ * The parent job that is at the origin and responsible for the execution of this script if any
141
+ */
142
+ parentJob?: string,
143
+ /**
144
+ * List of headers's keys (separated with ',') whove value are added to the args
145
+ * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key
146
+ *
147
+ */
148
+ includeHeader?: string,
149
+ /**
150
+ * The maximum size of the queue for which the request would get rejected if that job would push it above that limit
151
+ *
152
+ */
153
+ queueLimit?: string,
154
+ /**
155
+ * The base64 encoded payload that has been encoded as a JSON. e.g how to encode such payload encodeURIComponent
156
+ * `encodeURIComponent(btoa(JSON.stringify({a: 2})))`
157
+ *
158
+ */
159
+ payload?: string,
160
+ }): CancelablePromise<any> {
161
+ return __request(OpenAPI, {
162
+ method: 'GET',
163
+ url: '/w/{workspace}/jobs/run_wait_result/p/{path}',
164
+ path: {
165
+ 'workspace': workspace,
166
+ 'path': path,
167
+ },
168
+ query: {
169
+ 'parent_job': parentJob,
170
+ 'include_header': includeHeader,
171
+ 'queue_limit': queueLimit,
172
+ 'payload': payload,
173
+ },
174
+ });
175
+ }
176
+
177
+ /**
178
+ * run flow by path and wait until completion
179
+ * @returns any job result
180
+ * @throws ApiError
181
+ */
182
+ public static runWaitResultFlowByPath({
183
+ workspace,
184
+ path,
185
+ requestBody,
186
+ includeHeader,
187
+ queueLimit,
188
+ }: {
189
+ workspace: string,
190
+ path: string,
191
+ /**
192
+ * script args
193
+ */
194
+ requestBody: ScriptArgs,
195
+ /**
196
+ * List of headers's keys (separated with ',') whove value are added to the args
197
+ * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key
198
+ *
199
+ */
200
+ includeHeader?: string,
201
+ /**
202
+ * The maximum size of the queue for which the request would get rejected if that job would push it above that limit
203
+ *
204
+ */
205
+ queueLimit?: string,
206
+ }): CancelablePromise<any> {
207
+ return __request(OpenAPI, {
208
+ method: 'POST',
209
+ url: '/w/{workspace}/jobs/run_wait_result/f/{path}',
210
+ path: {
211
+ 'workspace': workspace,
212
+ 'path': path,
213
+ },
214
+ query: {
215
+ 'include_header': includeHeader,
216
+ 'queue_limit': queueLimit,
217
+ },
218
+ body: requestBody,
219
+ mediaType: 'application/json',
220
+ });
221
+ }
222
+
223
+ /**
224
+ * get job result by id
225
+ * @returns any job result
226
+ * @throws ApiError
227
+ */
228
+ public static resultById({
229
+ workspace,
230
+ flowJobId,
231
+ nodeId,
232
+ }: {
233
+ workspace: string,
234
+ flowJobId: string,
235
+ nodeId: string,
236
+ }): CancelablePromise<any> {
237
+ return __request(OpenAPI, {
238
+ method: 'GET',
239
+ url: '/w/{workspace}/jobs/result_by_id/{flow_job_id}/{node_id}',
240
+ path: {
241
+ 'workspace': workspace,
242
+ 'flow_job_id': flowJobId,
243
+ 'node_id': nodeId,
244
+ },
245
+ });
246
+ }
247
+
248
+ /**
249
+ * run flow by path
250
+ * @returns string job created
251
+ * @throws ApiError
252
+ */
253
+ public static runFlowByPath({
254
+ workspace,
255
+ path,
256
+ requestBody,
257
+ scheduledFor,
258
+ scheduledInSecs,
259
+ parentJob,
260
+ includeHeader,
261
+ invisibleToOwner,
262
+ }: {
263
+ workspace: string,
264
+ path: string,
265
+ /**
266
+ * flow args
267
+ */
268
+ requestBody: ScriptArgs,
269
+ /**
270
+ * when to schedule this job (leave empty for immediate run)
271
+ */
272
+ scheduledFor?: string,
273
+ /**
274
+ * schedule the script to execute in the number of seconds starting now
275
+ */
276
+ scheduledInSecs?: number,
277
+ /**
278
+ * The parent job that is at the origin and responsible for the execution of this script if any
279
+ */
280
+ parentJob?: string,
281
+ /**
282
+ * List of headers's keys (separated with ',') whove value are added to the args
283
+ * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key
284
+ *
285
+ */
286
+ includeHeader?: string,
287
+ /**
288
+ * make the run invisible to the the flow owner (default false)
289
+ */
290
+ invisibleToOwner?: boolean,
291
+ }): CancelablePromise<string> {
292
+ return __request(OpenAPI, {
293
+ method: 'POST',
294
+ url: '/w/{workspace}/jobs/run/f/{path}',
295
+ path: {
296
+ 'workspace': workspace,
297
+ 'path': path,
298
+ },
299
+ query: {
300
+ 'scheduled_for': scheduledFor,
301
+ 'scheduled_in_secs': scheduledInSecs,
302
+ 'parent_job': parentJob,
303
+ 'include_header': includeHeader,
304
+ 'invisible_to_owner': invisibleToOwner,
305
+ },
306
+ body: requestBody,
307
+ mediaType: 'application/json',
308
+ });
309
+ }
310
+
311
+ /**
312
+ * run script by hash
313
+ * @returns string job created
314
+ * @throws ApiError
315
+ */
316
+ public static runScriptByHash({
317
+ workspace,
318
+ hash,
319
+ requestBody,
320
+ scheduledFor,
321
+ scheduledInSecs,
322
+ parentJob,
323
+ includeHeader,
324
+ invisibleToOwner,
325
+ }: {
326
+ workspace: string,
327
+ hash: string,
328
+ /**
329
+ * Partially filled args
330
+ */
331
+ requestBody: any,
332
+ /**
333
+ * when to schedule this job (leave empty for immediate run)
334
+ */
335
+ scheduledFor?: string,
336
+ /**
337
+ * schedule the script to execute in the number of seconds starting now
338
+ */
339
+ scheduledInSecs?: number,
340
+ /**
341
+ * The parent job that is at the origin and responsible for the execution of this script if any
342
+ */
343
+ parentJob?: string,
344
+ /**
345
+ * List of headers's keys (separated with ',') whove value are added to the args
346
+ * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key
347
+ *
348
+ */
349
+ includeHeader?: string,
350
+ /**
351
+ * make the run invisible to the the script owner (default false)
352
+ */
353
+ invisibleToOwner?: boolean,
354
+ }): CancelablePromise<string> {
355
+ return __request(OpenAPI, {
356
+ method: 'POST',
357
+ url: '/w/{workspace}/jobs/run/h/{hash}',
358
+ path: {
359
+ 'workspace': workspace,
360
+ 'hash': hash,
361
+ },
362
+ query: {
363
+ 'scheduled_for': scheduledFor,
364
+ 'scheduled_in_secs': scheduledInSecs,
365
+ 'parent_job': parentJob,
366
+ 'include_header': includeHeader,
367
+ 'invisible_to_owner': invisibleToOwner,
368
+ },
369
+ body: requestBody,
370
+ mediaType: 'application/json',
371
+ });
372
+ }
373
+
374
+ /**
375
+ * run script preview
376
+ * @returns string job created
377
+ * @throws ApiError
378
+ */
379
+ public static runScriptPreview({
380
+ workspace,
381
+ requestBody,
382
+ includeHeader,
383
+ invisibleToOwner,
384
+ }: {
385
+ workspace: string,
386
+ /**
387
+ * preview
388
+ */
389
+ requestBody: Preview,
390
+ /**
391
+ * List of headers's keys (separated with ',') whove value are added to the args
392
+ * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key
393
+ *
394
+ */
395
+ includeHeader?: string,
396
+ /**
397
+ * make the run invisible to the the script owner (default false)
398
+ */
399
+ invisibleToOwner?: boolean,
400
+ }): CancelablePromise<string> {
401
+ return __request(OpenAPI, {
402
+ method: 'POST',
403
+ url: '/w/{workspace}/jobs/run/preview',
404
+ path: {
405
+ 'workspace': workspace,
406
+ },
407
+ query: {
408
+ 'include_header': includeHeader,
409
+ 'invisible_to_owner': invisibleToOwner,
410
+ },
411
+ body: requestBody,
412
+ mediaType: 'application/json',
413
+ });
414
+ }
415
+
416
+ /**
417
+ * run flow preview
418
+ * @returns string job created
419
+ * @throws ApiError
420
+ */
421
+ public static runFlowPreview({
422
+ workspace,
423
+ requestBody,
424
+ includeHeader,
425
+ invisibleToOwner,
426
+ }: {
427
+ workspace: string,
428
+ /**
429
+ * preview
430
+ */
431
+ requestBody: FlowPreview,
432
+ /**
433
+ * List of headers's keys (separated with ',') whove value are added to the args
434
+ * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key
435
+ *
436
+ */
437
+ includeHeader?: string,
438
+ /**
439
+ * make the run invisible to the the script owner (default false)
440
+ */
441
+ invisibleToOwner?: boolean,
442
+ }): CancelablePromise<string> {
443
+ return __request(OpenAPI, {
444
+ method: 'POST',
445
+ url: '/w/{workspace}/jobs/run/preview_flow',
446
+ path: {
447
+ 'workspace': workspace,
448
+ },
449
+ query: {
450
+ 'include_header': includeHeader,
451
+ 'invisible_to_owner': invisibleToOwner,
452
+ },
453
+ body: requestBody,
454
+ mediaType: 'application/json',
455
+ });
456
+ }
457
+
458
+ /**
459
+ * list all available queued jobs
460
+ * @returns QueuedJob All available queued jobs
461
+ * @throws ApiError
462
+ */
463
+ public static listQueue({
464
+ workspace,
465
+ orderDesc,
466
+ createdBy,
467
+ parentJob,
468
+ scriptPathExact,
469
+ scriptPathStart,
470
+ scriptHash,
471
+ startedBefore,
472
+ startedAfter,
473
+ success,
474
+ jobKinds,
475
+ suspended,
476
+ running,
477
+ args,
478
+ result,
479
+ tag,
480
+ }: {
481
+ workspace: string,
482
+ /**
483
+ * order by desc order (default true)
484
+ */
485
+ orderDesc?: boolean,
486
+ /**
487
+ * mask to filter exact matching user creator
488
+ */
489
+ createdBy?: string,
490
+ /**
491
+ * The parent job that is at the origin and responsible for the execution of this script if any
492
+ */
493
+ parentJob?: string,
494
+ /**
495
+ * mask to filter exact matching path
496
+ */
497
+ scriptPathExact?: string,
498
+ /**
499
+ * mask to filter matching starting path
500
+ */
501
+ scriptPathStart?: string,
502
+ /**
503
+ * mask to filter exact matching path
504
+ */
505
+ scriptHash?: string,
506
+ /**
507
+ * filter on created before (inclusive) timestamp
508
+ */
509
+ startedBefore?: string,
510
+ /**
511
+ * filter on created after (exclusive) timestamp
512
+ */
513
+ startedAfter?: string,
514
+ /**
515
+ * filter on successful jobs
516
+ */
517
+ success?: boolean,
518
+ /**
519
+ * filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by,
520
+ */
521
+ jobKinds?: string,
522
+ /**
523
+ * filter on suspended jobs
524
+ */
525
+ suspended?: boolean,
526
+ /**
527
+ * filter on running jobs
528
+ */
529
+ running?: boolean,
530
+ /**
531
+ * filter on jobs containing those args as a json subset (@> in postgres)
532
+ */
533
+ args?: string,
534
+ /**
535
+ * filter on jobs containing those result as a json subset (@> in postgres)
536
+ */
537
+ result?: string,
538
+ /**
539
+ * filter on jobs with a given tag/worker group
540
+ */
541
+ tag?: string,
542
+ }): CancelablePromise<Array<QueuedJob>> {
543
+ return __request(OpenAPI, {
544
+ method: 'GET',
545
+ url: '/w/{workspace}/jobs/queue/list',
546
+ path: {
547
+ 'workspace': workspace,
548
+ },
549
+ query: {
550
+ 'order_desc': orderDesc,
551
+ 'created_by': createdBy,
552
+ 'parent_job': parentJob,
553
+ 'script_path_exact': scriptPathExact,
554
+ 'script_path_start': scriptPathStart,
555
+ 'script_hash': scriptHash,
556
+ 'started_before': startedBefore,
557
+ 'started_after': startedAfter,
558
+ 'success': success,
559
+ 'job_kinds': jobKinds,
560
+ 'suspended': suspended,
561
+ 'running': running,
562
+ 'args': args,
563
+ 'result': result,
564
+ 'tag': tag,
565
+ },
566
+ });
567
+ }
568
+
569
+ /**
570
+ * list all available completed jobs
571
+ * @returns CompletedJob All available completed jobs
572
+ * @throws ApiError
573
+ */
574
+ public static listCompletedJobs({
575
+ workspace,
576
+ orderDesc,
577
+ createdBy,
578
+ parentJob,
579
+ scriptPathExact,
580
+ scriptPathStart,
581
+ scriptHash,
582
+ startedBefore,
583
+ startedAfter,
584
+ success,
585
+ jobKinds,
586
+ args,
587
+ result,
588
+ tag,
589
+ isSkipped,
590
+ isFlowStep,
591
+ }: {
592
+ workspace: string,
593
+ /**
594
+ * order by desc order (default true)
595
+ */
596
+ orderDesc?: boolean,
597
+ /**
598
+ * mask to filter exact matching user creator
599
+ */
600
+ createdBy?: string,
601
+ /**
602
+ * The parent job that is at the origin and responsible for the execution of this script if any
603
+ */
604
+ parentJob?: string,
605
+ /**
606
+ * mask to filter exact matching path
607
+ */
608
+ scriptPathExact?: string,
609
+ /**
610
+ * mask to filter matching starting path
611
+ */
612
+ scriptPathStart?: string,
613
+ /**
614
+ * mask to filter exact matching path
615
+ */
616
+ scriptHash?: string,
617
+ /**
618
+ * filter on created before (inclusive) timestamp
619
+ */
620
+ startedBefore?: string,
621
+ /**
622
+ * filter on created after (exclusive) timestamp
623
+ */
624
+ startedAfter?: string,
625
+ /**
626
+ * filter on successful jobs
627
+ */
628
+ success?: boolean,
629
+ /**
630
+ * filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by,
631
+ */
632
+ jobKinds?: string,
633
+ /**
634
+ * filter on jobs containing those args as a json subset (@> in postgres)
635
+ */
636
+ args?: string,
637
+ /**
638
+ * filter on jobs containing those result as a json subset (@> in postgres)
639
+ */
640
+ result?: string,
641
+ /**
642
+ * filter on jobs with a given tag/worker group
643
+ */
644
+ tag?: string,
645
+ /**
646
+ * is the job skipped
647
+ */
648
+ isSkipped?: boolean,
649
+ /**
650
+ * is the job a flow step
651
+ */
652
+ isFlowStep?: boolean,
653
+ }): CancelablePromise<Array<CompletedJob>> {
654
+ return __request(OpenAPI, {
655
+ method: 'GET',
656
+ url: '/w/{workspace}/jobs/completed/list',
657
+ path: {
658
+ 'workspace': workspace,
659
+ },
660
+ query: {
661
+ 'order_desc': orderDesc,
662
+ 'created_by': createdBy,
663
+ 'parent_job': parentJob,
664
+ 'script_path_exact': scriptPathExact,
665
+ 'script_path_start': scriptPathStart,
666
+ 'script_hash': scriptHash,
667
+ 'started_before': startedBefore,
668
+ 'started_after': startedAfter,
669
+ 'success': success,
670
+ 'job_kinds': jobKinds,
671
+ 'args': args,
672
+ 'result': result,
673
+ 'tag': tag,
674
+ 'is_skipped': isSkipped,
675
+ 'is_flow_step': isFlowStep,
676
+ },
677
+ });
678
+ }
679
+
680
+ /**
681
+ * list all available jobs
682
+ * @returns Job All jobs
683
+ * @throws ApiError
684
+ */
685
+ public static listJobs({
686
+ workspace,
687
+ createdBy,
688
+ parentJob,
689
+ scriptPathExact,
690
+ scriptPathStart,
691
+ scriptHash,
692
+ startedBefore,
693
+ startedAfter,
694
+ jobKinds,
695
+ args,
696
+ tag,
697
+ result,
698
+ isSkipped,
699
+ isFlowStep,
700
+ success,
701
+ }: {
702
+ workspace: string,
703
+ /**
704
+ * mask to filter exact matching user creator
705
+ */
706
+ createdBy?: string,
707
+ /**
708
+ * The parent job that is at the origin and responsible for the execution of this script if any
709
+ */
710
+ parentJob?: string,
711
+ /**
712
+ * mask to filter exact matching path
713
+ */
714
+ scriptPathExact?: string,
715
+ /**
716
+ * mask to filter matching starting path
717
+ */
718
+ scriptPathStart?: string,
719
+ /**
720
+ * mask to filter exact matching path
721
+ */
722
+ scriptHash?: string,
723
+ /**
724
+ * filter on created before (inclusive) timestamp
725
+ */
726
+ startedBefore?: string,
727
+ /**
728
+ * filter on created after (exclusive) timestamp
729
+ */
730
+ startedAfter?: string,
731
+ /**
732
+ * filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by,
733
+ */
734
+ jobKinds?: string,
735
+ /**
736
+ * filter on jobs containing those args as a json subset (@> in postgres)
737
+ */
738
+ args?: string,
739
+ /**
740
+ * filter on jobs with a given tag/worker group
741
+ */
742
+ tag?: string,
743
+ /**
744
+ * filter on jobs containing those result as a json subset (@> in postgres)
745
+ */
746
+ result?: string,
747
+ /**
748
+ * is the job skipped
749
+ */
750
+ isSkipped?: boolean,
751
+ /**
752
+ * is the job a flow step
753
+ */
754
+ isFlowStep?: boolean,
755
+ /**
756
+ * filter on successful jobs
757
+ */
758
+ success?: boolean,
759
+ }): CancelablePromise<Array<Job>> {
760
+ return __request(OpenAPI, {
761
+ method: 'GET',
762
+ url: '/w/{workspace}/jobs/list',
763
+ path: {
764
+ 'workspace': workspace,
765
+ },
766
+ query: {
767
+ 'created_by': createdBy,
768
+ 'parent_job': parentJob,
769
+ 'script_path_exact': scriptPathExact,
770
+ 'script_path_start': scriptPathStart,
771
+ 'script_hash': scriptHash,
772
+ 'started_before': startedBefore,
773
+ 'started_after': startedAfter,
774
+ 'job_kinds': jobKinds,
775
+ 'args': args,
776
+ 'tag': tag,
777
+ 'result': result,
778
+ 'is_skipped': isSkipped,
779
+ 'is_flow_step': isFlowStep,
780
+ 'success': success,
781
+ },
782
+ });
783
+ }
784
+
785
+ /**
786
+ * get job
787
+ * @returns Job job details
788
+ * @throws ApiError
789
+ */
790
+ public static getJob({
791
+ workspace,
792
+ id,
793
+ }: {
794
+ workspace: string,
795
+ id: string,
796
+ }): CancelablePromise<Job> {
797
+ return __request(OpenAPI, {
798
+ method: 'GET',
799
+ url: '/w/{workspace}/jobs_u/get/{id}',
800
+ path: {
801
+ 'workspace': workspace,
802
+ 'id': id,
803
+ },
804
+ });
805
+ }
806
+
807
+ /**
808
+ * get job updates
809
+ * @returns any job details
810
+ * @throws ApiError
811
+ */
812
+ public static getJobUpdates({
813
+ workspace,
814
+ id,
815
+ running,
816
+ logOffset,
817
+ }: {
818
+ workspace: string,
819
+ id: string,
820
+ running?: boolean,
821
+ logOffset?: number,
822
+ }): CancelablePromise<{
823
+ running?: boolean;
824
+ completed?: boolean;
825
+ new_logs?: string;
826
+ mem_peak?: number;
827
+ }> {
828
+ return __request(OpenAPI, {
829
+ method: 'GET',
830
+ url: '/w/{workspace}/jobs_u/getupdate/{id}',
831
+ path: {
832
+ 'workspace': workspace,
833
+ 'id': id,
834
+ },
835
+ query: {
836
+ 'running': running,
837
+ 'log_offset': logOffset,
838
+ },
839
+ });
840
+ }
841
+
842
+ /**
843
+ * get completed job
844
+ * @returns CompletedJob job details
845
+ * @throws ApiError
846
+ */
847
+ public static getCompletedJob({
848
+ workspace,
849
+ id,
850
+ }: {
851
+ workspace: string,
852
+ id: string,
853
+ }): CancelablePromise<CompletedJob> {
854
+ return __request(OpenAPI, {
855
+ method: 'GET',
856
+ url: '/w/{workspace}/jobs/completed/get/{id}',
857
+ path: {
858
+ 'workspace': workspace,
859
+ 'id': id,
860
+ },
861
+ });
862
+ }
863
+
864
+ /**
865
+ * get completed job result
866
+ * @returns any result
867
+ * @throws ApiError
868
+ */
869
+ public static getCompletedJobResult({
870
+ workspace,
871
+ id,
872
+ }: {
873
+ workspace: string,
874
+ id: string,
875
+ }): CancelablePromise<any> {
876
+ return __request(OpenAPI, {
877
+ method: 'GET',
878
+ url: '/w/{workspace}/jobs/completed/get_result/{id}',
879
+ path: {
880
+ 'workspace': workspace,
881
+ 'id': id,
882
+ },
883
+ });
884
+ }
885
+
886
+ /**
887
+ * delete completed job (erase content but keep run id)
888
+ * @returns CompletedJob job details
889
+ * @throws ApiError
890
+ */
891
+ public static deleteCompletedJob({
892
+ workspace,
893
+ id,
894
+ }: {
895
+ workspace: string,
896
+ id: string,
897
+ }): CancelablePromise<CompletedJob> {
898
+ return __request(OpenAPI, {
899
+ method: 'POST',
900
+ url: '/w/{workspace}/jobs/completed/delete/{id}',
901
+ path: {
902
+ 'workspace': workspace,
903
+ 'id': id,
904
+ },
905
+ });
906
+ }
907
+
908
+ /**
909
+ * cancel queued job
910
+ * @returns string job canceled
911
+ * @throws ApiError
912
+ */
913
+ public static cancelQueuedJob({
914
+ workspace,
915
+ id,
916
+ requestBody,
917
+ }: {
918
+ workspace: string,
919
+ id: string,
920
+ /**
921
+ * reason
922
+ */
923
+ requestBody: {
924
+ reason?: string;
925
+ },
926
+ }): CancelablePromise<string> {
927
+ return __request(OpenAPI, {
928
+ method: 'POST',
929
+ url: '/w/{workspace}/jobs_u/queue/cancel/{id}',
930
+ path: {
931
+ 'workspace': workspace,
932
+ 'id': id,
933
+ },
934
+ body: requestBody,
935
+ mediaType: 'application/json',
936
+ });
937
+ }
938
+
939
+ /**
940
+ * force cancel queued job
941
+ * @returns string job canceled
942
+ * @throws ApiError
943
+ */
944
+ public static forceCancelQueuedJob({
945
+ workspace,
946
+ id,
947
+ requestBody,
948
+ }: {
949
+ workspace: string,
950
+ id: string,
951
+ /**
952
+ * reason
953
+ */
954
+ requestBody: {
955
+ reason?: string;
956
+ },
957
+ }): CancelablePromise<string> {
958
+ return __request(OpenAPI, {
959
+ method: 'POST',
960
+ url: '/w/{workspace}/jobs_u/queue/force_cancel/{id}',
961
+ path: {
962
+ 'workspace': workspace,
963
+ 'id': id,
964
+ },
965
+ body: requestBody,
966
+ mediaType: 'application/json',
967
+ });
968
+ }
969
+
970
+ /**
971
+ * create an HMac signature given a job id and a resume id
972
+ * @returns string job signature
973
+ * @throws ApiError
974
+ */
975
+ public static createJobSignature({
976
+ workspace,
977
+ id,
978
+ resumeId,
979
+ approver,
980
+ }: {
981
+ workspace: string,
982
+ id: string,
983
+ resumeId: number,
984
+ approver?: string,
985
+ }): CancelablePromise<string> {
986
+ return __request(OpenAPI, {
987
+ method: 'GET',
988
+ url: '/w/{workspace}/jobs/job_signature/{id}/{resume_id}',
989
+ path: {
990
+ 'workspace': workspace,
991
+ 'id': id,
992
+ 'resume_id': resumeId,
993
+ },
994
+ query: {
995
+ 'approver': approver,
996
+ },
997
+ });
998
+ }
999
+
1000
+ /**
1001
+ * get resume urls given a job_id, resume_id and a nonce to resume a flow
1002
+ * @returns any url endpoints
1003
+ * @throws ApiError
1004
+ */
1005
+ public static getResumeUrls({
1006
+ workspace,
1007
+ id,
1008
+ resumeId,
1009
+ approver,
1010
+ }: {
1011
+ workspace: string,
1012
+ id: string,
1013
+ resumeId: number,
1014
+ approver?: string,
1015
+ }): CancelablePromise<{
1016
+ approvalPage: string;
1017
+ resume: string;
1018
+ cancel: string;
1019
+ }> {
1020
+ return __request(OpenAPI, {
1021
+ method: 'GET',
1022
+ url: '/w/{workspace}/jobs/resume_urls/{id}/{resume_id}',
1023
+ path: {
1024
+ 'workspace': workspace,
1025
+ 'id': id,
1026
+ 'resume_id': resumeId,
1027
+ },
1028
+ query: {
1029
+ 'approver': approver,
1030
+ },
1031
+ });
1032
+ }
1033
+
1034
+ /**
1035
+ * resume a job for a suspended flow
1036
+ * @returns string job resumed
1037
+ * @throws ApiError
1038
+ */
1039
+ public static resumeSuspendedJobGet({
1040
+ workspace,
1041
+ id,
1042
+ resumeId,
1043
+ signature,
1044
+ payload,
1045
+ approver,
1046
+ }: {
1047
+ workspace: string,
1048
+ id: string,
1049
+ resumeId: number,
1050
+ signature: string,
1051
+ /**
1052
+ * The base64 encoded payload that has been encoded as a JSON. e.g how to encode such payload encodeURIComponent
1053
+ * `encodeURIComponent(btoa(JSON.stringify({a: 2})))`
1054
+ *
1055
+ */
1056
+ payload?: string,
1057
+ approver?: string,
1058
+ }): CancelablePromise<string> {
1059
+ return __request(OpenAPI, {
1060
+ method: 'GET',
1061
+ url: '/w/{workspace}/jobs_u/resume/{id}/{resume_id}/{signature}',
1062
+ path: {
1063
+ 'workspace': workspace,
1064
+ 'id': id,
1065
+ 'resume_id': resumeId,
1066
+ 'signature': signature,
1067
+ },
1068
+ query: {
1069
+ 'payload': payload,
1070
+ 'approver': approver,
1071
+ },
1072
+ });
1073
+ }
1074
+
1075
+ /**
1076
+ * resume a job for a suspended flow
1077
+ * @returns string job resumed
1078
+ * @throws ApiError
1079
+ */
1080
+ public static resumeSuspendedJobPost({
1081
+ workspace,
1082
+ id,
1083
+ resumeId,
1084
+ signature,
1085
+ requestBody,
1086
+ approver,
1087
+ }: {
1088
+ workspace: string,
1089
+ id: string,
1090
+ resumeId: number,
1091
+ signature: string,
1092
+ requestBody: any,
1093
+ approver?: string,
1094
+ }): CancelablePromise<string> {
1095
+ return __request(OpenAPI, {
1096
+ method: 'POST',
1097
+ url: '/w/{workspace}/jobs_u/resume/{id}/{resume_id}/{signature}',
1098
+ path: {
1099
+ 'workspace': workspace,
1100
+ 'id': id,
1101
+ 'resume_id': resumeId,
1102
+ 'signature': signature,
1103
+ },
1104
+ query: {
1105
+ 'approver': approver,
1106
+ },
1107
+ body: requestBody,
1108
+ mediaType: 'application/json',
1109
+ });
1110
+ }
1111
+
1112
+ /**
1113
+ * resume a job for a suspended flow as an owner
1114
+ * @returns string job resumed
1115
+ * @throws ApiError
1116
+ */
1117
+ public static resumeSuspendedFlowAsOwner({
1118
+ workspace,
1119
+ id,
1120
+ requestBody,
1121
+ }: {
1122
+ workspace: string,
1123
+ id: string,
1124
+ requestBody: any,
1125
+ }): CancelablePromise<string> {
1126
+ return __request(OpenAPI, {
1127
+ method: 'POST',
1128
+ url: '/w/{workspace}/jobs/flow/resume/{id}',
1129
+ path: {
1130
+ 'workspace': workspace,
1131
+ 'id': id,
1132
+ },
1133
+ body: requestBody,
1134
+ mediaType: 'application/json',
1135
+ });
1136
+ }
1137
+
1138
+ /**
1139
+ * cancel a job for a suspended flow
1140
+ * @returns string job resumed
1141
+ * @throws ApiError
1142
+ */
1143
+ public static cancelSuspendedJobGet({
1144
+ workspace,
1145
+ id,
1146
+ resumeId,
1147
+ signature,
1148
+ approver,
1149
+ }: {
1150
+ workspace: string,
1151
+ id: string,
1152
+ resumeId: number,
1153
+ signature: string,
1154
+ approver?: string,
1155
+ }): CancelablePromise<string> {
1156
+ return __request(OpenAPI, {
1157
+ method: 'GET',
1158
+ url: '/w/{workspace}/jobs_u/cancel/{id}/{resume_id}/{signature}',
1159
+ path: {
1160
+ 'workspace': workspace,
1161
+ 'id': id,
1162
+ 'resume_id': resumeId,
1163
+ 'signature': signature,
1164
+ },
1165
+ query: {
1166
+ 'approver': approver,
1167
+ },
1168
+ });
1169
+ }
1170
+
1171
+ /**
1172
+ * cancel a job for a suspended flow
1173
+ * @returns string job resumed
1174
+ * @throws ApiError
1175
+ */
1176
+ public static cancelSuspendedJobPost({
1177
+ workspace,
1178
+ id,
1179
+ resumeId,
1180
+ signature,
1181
+ requestBody,
1182
+ approver,
1183
+ }: {
1184
+ workspace: string,
1185
+ id: string,
1186
+ resumeId: number,
1187
+ signature: string,
1188
+ requestBody: any,
1189
+ approver?: string,
1190
+ }): CancelablePromise<string> {
1191
+ return __request(OpenAPI, {
1192
+ method: 'POST',
1193
+ url: '/w/{workspace}/jobs_u/cancel/{id}/{resume_id}/{signature}',
1194
+ path: {
1195
+ 'workspace': workspace,
1196
+ 'id': id,
1197
+ 'resume_id': resumeId,
1198
+ 'signature': signature,
1199
+ },
1200
+ query: {
1201
+ 'approver': approver,
1202
+ },
1203
+ body: requestBody,
1204
+ mediaType: 'application/json',
1205
+ });
1206
+ }
1207
+
1208
+ /**
1209
+ * get parent flow job of suspended job
1210
+ * @returns any parent flow details
1211
+ * @throws ApiError
1212
+ */
1213
+ public static getSuspendedJobFlow({
1214
+ workspace,
1215
+ id,
1216
+ resumeId,
1217
+ signature,
1218
+ approver,
1219
+ }: {
1220
+ workspace: string,
1221
+ id: string,
1222
+ resumeId: number,
1223
+ signature: string,
1224
+ approver?: string,
1225
+ }): CancelablePromise<{
1226
+ job: Job;
1227
+ approvers: Array<{
1228
+ resume_id: number;
1229
+ approver: string;
1230
+ }>;
1231
+ }> {
1232
+ return __request(OpenAPI, {
1233
+ method: 'GET',
1234
+ url: '/w/{workspace}/jobs_u/get_flow/{id}/{resume_id}/{signature}',
1235
+ path: {
1236
+ 'workspace': workspace,
1237
+ 'id': id,
1238
+ 'resume_id': resumeId,
1239
+ 'signature': signature,
1240
+ },
1241
+ query: {
1242
+ 'approver': approver,
1243
+ },
1244
+ });
1245
+ }
1246
+
1247
+ }