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,601 @@
1
+ /* istanbul ignore file */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ import type { MainArgSignature } from '../models/MainArgSignature';
5
+ import type { NewScript } from '../models/NewScript';
6
+ import type { NewScriptWithDraft } from '../models/NewScriptWithDraft';
7
+ import type { Script } from '../models/Script';
8
+
9
+ import type { CancelablePromise } from '../core/CancelablePromise';
10
+ import { OpenAPI } from '../core/OpenAPI';
11
+ import { request as __request } from '../core/request';
12
+
13
+ export class ScriptService {
14
+
15
+ /**
16
+ * list all available hub scripts
17
+ * @returns any hub scripts list
18
+ * @throws ApiError
19
+ */
20
+ public static listHubScripts(): CancelablePromise<{
21
+ asks?: Array<{
22
+ id: number;
23
+ ask_id: number;
24
+ summary: string;
25
+ app: string;
26
+ approved: boolean;
27
+ kind: 'script' | 'failure' | 'trigger' | 'command' | 'approval';
28
+ votes: number;
29
+ views: number;
30
+ }>;
31
+ }> {
32
+ return __request(OpenAPI, {
33
+ method: 'GET',
34
+ url: '/scripts/hub/list',
35
+ });
36
+ }
37
+
38
+ /**
39
+ * get hub script content by path
40
+ * @returns string script details
41
+ * @throws ApiError
42
+ */
43
+ public static getHubScriptContentByPath({
44
+ path,
45
+ }: {
46
+ path: string,
47
+ }): CancelablePromise<string> {
48
+ return __request(OpenAPI, {
49
+ method: 'GET',
50
+ url: '/scripts/hub/get/{path}',
51
+ path: {
52
+ 'path': path,
53
+ },
54
+ });
55
+ }
56
+
57
+ /**
58
+ * get full hub script by path
59
+ * @returns any script details
60
+ * @throws ApiError
61
+ */
62
+ public static getHubScriptByPath({
63
+ path,
64
+ }: {
65
+ path: string,
66
+ }): CancelablePromise<{
67
+ content: string;
68
+ lockfile?: string;
69
+ schema?: any;
70
+ language: 'deno' | 'python3' | 'go' | 'bash';
71
+ summary?: string;
72
+ }> {
73
+ return __request(OpenAPI, {
74
+ method: 'GET',
75
+ url: '/scripts/hub/get_full/{path}',
76
+ path: {
77
+ 'path': path,
78
+ },
79
+ });
80
+ }
81
+
82
+ /**
83
+ * list all available scripts
84
+ * @returns Script All available scripts
85
+ * @throws ApiError
86
+ */
87
+ public static listScripts({
88
+ workspace,
89
+ page,
90
+ perPage,
91
+ orderDesc,
92
+ createdBy,
93
+ pathStart,
94
+ pathExact,
95
+ firstParentHash,
96
+ lastParentHash,
97
+ parentHash,
98
+ showArchived,
99
+ isTemplate,
100
+ kind,
101
+ starredOnly,
102
+ }: {
103
+ workspace: string,
104
+ /**
105
+ * which page to return (start at 1, default 1)
106
+ */
107
+ page?: number,
108
+ /**
109
+ * number of items to return for a given page (default 30, max 100)
110
+ */
111
+ perPage?: number,
112
+ /**
113
+ * order by desc order (default true)
114
+ */
115
+ orderDesc?: boolean,
116
+ /**
117
+ * mask to filter exact matching user creator
118
+ */
119
+ createdBy?: string,
120
+ /**
121
+ * mask to filter matching starting path
122
+ */
123
+ pathStart?: string,
124
+ /**
125
+ * mask to filter exact matching path
126
+ */
127
+ pathExact?: string,
128
+ /**
129
+ * mask to filter scripts whom first direct parent has exact hash
130
+ */
131
+ firstParentHash?: string,
132
+ /**
133
+ * mask to filter scripts whom last parent in the chain has exact hash.
134
+ * Beware that each script stores only a limited number of parents. Hence
135
+ * the last parent hash for a script is not necessarily its top-most parent.
136
+ * To find the top-most parent you will have to jump from last to last hash
137
+ * until finding the parent
138
+ *
139
+ */
140
+ lastParentHash?: string,
141
+ /**
142
+ * is the hash present in the array of stored parent hashes for this script.
143
+ * The same warning applies than for last_parent_hash. A script only store a
144
+ * limited number of direct parent
145
+ *
146
+ */
147
+ parentHash?: string,
148
+ /**
149
+ * (default false)
150
+ * show also the archived files.
151
+ * when multiple archived hash share the same path, only the ones with the latest create_at
152
+ * are
153
+ * ed.
154
+ *
155
+ */
156
+ showArchived?: boolean,
157
+ /**
158
+ * (default regardless)
159
+ * if true show only the templates
160
+ * if false show only the non templates
161
+ * if not defined, show all regardless of if the script is a template
162
+ *
163
+ */
164
+ isTemplate?: boolean,
165
+ /**
166
+ * (default regardless)
167
+ * script kind
168
+ *
169
+ */
170
+ kind?: string,
171
+ /**
172
+ * (default false)
173
+ * show only the starred items
174
+ *
175
+ */
176
+ starredOnly?: boolean,
177
+ }): CancelablePromise<Array<Script>> {
178
+ return __request(OpenAPI, {
179
+ method: 'GET',
180
+ url: '/w/{workspace}/scripts/list',
181
+ path: {
182
+ 'workspace': workspace,
183
+ },
184
+ query: {
185
+ 'page': page,
186
+ 'per_page': perPage,
187
+ 'order_desc': orderDesc,
188
+ 'created_by': createdBy,
189
+ 'path_start': pathStart,
190
+ 'path_exact': pathExact,
191
+ 'first_parent_hash': firstParentHash,
192
+ 'last_parent_hash': lastParentHash,
193
+ 'parent_hash': parentHash,
194
+ 'show_archived': showArchived,
195
+ 'is_template': isTemplate,
196
+ 'kind': kind,
197
+ 'starred_only': starredOnly,
198
+ },
199
+ });
200
+ }
201
+
202
+ /**
203
+ * list all available scripts paths
204
+ * @returns string list of script paths
205
+ * @throws ApiError
206
+ */
207
+ public static listScriptPaths({
208
+ workspace,
209
+ }: {
210
+ workspace: string,
211
+ }): CancelablePromise<Array<string>> {
212
+ return __request(OpenAPI, {
213
+ method: 'GET',
214
+ url: '/w/{workspace}/scripts/list_paths',
215
+ path: {
216
+ 'workspace': workspace,
217
+ },
218
+ });
219
+ }
220
+
221
+ /**
222
+ * create script
223
+ * @returns string script created
224
+ * @throws ApiError
225
+ */
226
+ public static createScript({
227
+ workspace,
228
+ requestBody,
229
+ }: {
230
+ workspace: string,
231
+ /**
232
+ * Partially filled script
233
+ */
234
+ requestBody: NewScript,
235
+ }): CancelablePromise<string> {
236
+ return __request(OpenAPI, {
237
+ method: 'POST',
238
+ url: '/w/{workspace}/scripts/create',
239
+ path: {
240
+ 'workspace': workspace,
241
+ },
242
+ body: requestBody,
243
+ mediaType: 'application/json',
244
+ });
245
+ }
246
+
247
+ /**
248
+ * inspect python code to infer jsonschema of arguments
249
+ * @returns MainArgSignature parsed args
250
+ * @throws ApiError
251
+ */
252
+ public static pythonToJsonschema({
253
+ requestBody,
254
+ }: {
255
+ /**
256
+ * python code with the main function
257
+ */
258
+ requestBody: string,
259
+ }): CancelablePromise<MainArgSignature> {
260
+ return __request(OpenAPI, {
261
+ method: 'POST',
262
+ url: '/scripts/python/tojsonschema',
263
+ body: requestBody,
264
+ mediaType: 'application/json',
265
+ });
266
+ }
267
+
268
+ /**
269
+ * inspect deno code to infer jsonschema of arguments
270
+ * @returns MainArgSignature parsed args
271
+ * @throws ApiError
272
+ */
273
+ public static denoToJsonschema({
274
+ requestBody,
275
+ }: {
276
+ /**
277
+ * deno code with the main function
278
+ */
279
+ requestBody: string,
280
+ }): CancelablePromise<MainArgSignature> {
281
+ return __request(OpenAPI, {
282
+ method: 'POST',
283
+ url: '/scripts/deno/tojsonschema',
284
+ body: requestBody,
285
+ mediaType: 'application/json',
286
+ });
287
+ }
288
+
289
+ /**
290
+ * inspect bash code to infer jsonschema of arguments
291
+ * @returns MainArgSignature parsed args
292
+ * @throws ApiError
293
+ */
294
+ public static bashToJsonschema({
295
+ requestBody,
296
+ }: {
297
+ /**
298
+ * bash code with the main function
299
+ */
300
+ requestBody: string,
301
+ }): CancelablePromise<MainArgSignature> {
302
+ return __request(OpenAPI, {
303
+ method: 'POST',
304
+ url: '/scripts/bash/tojsonschema',
305
+ body: requestBody,
306
+ mediaType: 'application/json',
307
+ });
308
+ }
309
+
310
+ /**
311
+ * inspect go code to infer jsonschema of arguments
312
+ * @returns MainArgSignature parsed args
313
+ * @throws ApiError
314
+ */
315
+ public static goToJsonschema({
316
+ requestBody,
317
+ }: {
318
+ /**
319
+ * go code with the main function
320
+ */
321
+ requestBody: string,
322
+ }): CancelablePromise<MainArgSignature> {
323
+ return __request(OpenAPI, {
324
+ method: 'POST',
325
+ url: '/scripts/go/tojsonschema',
326
+ body: requestBody,
327
+ mediaType: 'application/json',
328
+ });
329
+ }
330
+
331
+ /**
332
+ * archive script by path
333
+ * @returns string script archived
334
+ * @throws ApiError
335
+ */
336
+ public static archiveScriptByPath({
337
+ workspace,
338
+ path,
339
+ }: {
340
+ workspace: string,
341
+ path: string,
342
+ }): CancelablePromise<string> {
343
+ return __request(OpenAPI, {
344
+ method: 'POST',
345
+ url: '/w/{workspace}/scripts/archive/p/{path}',
346
+ path: {
347
+ 'workspace': workspace,
348
+ 'path': path,
349
+ },
350
+ });
351
+ }
352
+
353
+ /**
354
+ * archive script by hash
355
+ * @returns Script script details
356
+ * @throws ApiError
357
+ */
358
+ public static archiveScriptByHash({
359
+ workspace,
360
+ hash,
361
+ }: {
362
+ workspace: string,
363
+ hash: string,
364
+ }): CancelablePromise<Script> {
365
+ return __request(OpenAPI, {
366
+ method: 'POST',
367
+ url: '/w/{workspace}/scripts/archive/h/{hash}',
368
+ path: {
369
+ 'workspace': workspace,
370
+ 'hash': hash,
371
+ },
372
+ });
373
+ }
374
+
375
+ /**
376
+ * delete script by hash (erase content but keep hash, require admin)
377
+ * @returns Script script details
378
+ * @throws ApiError
379
+ */
380
+ public static deleteScriptByHash({
381
+ workspace,
382
+ hash,
383
+ }: {
384
+ workspace: string,
385
+ hash: string,
386
+ }): CancelablePromise<Script> {
387
+ return __request(OpenAPI, {
388
+ method: 'POST',
389
+ url: '/w/{workspace}/scripts/delete/h/{hash}',
390
+ path: {
391
+ 'workspace': workspace,
392
+ 'hash': hash,
393
+ },
394
+ });
395
+ }
396
+
397
+ /**
398
+ * delete all scripts at a given path (require admin)
399
+ * @returns string script path
400
+ * @throws ApiError
401
+ */
402
+ public static deleteScriptByPath({
403
+ workspace,
404
+ path,
405
+ }: {
406
+ workspace: string,
407
+ path: string,
408
+ }): CancelablePromise<string> {
409
+ return __request(OpenAPI, {
410
+ method: 'POST',
411
+ url: '/w/{workspace}/scripts/delete/p/{path}',
412
+ path: {
413
+ 'workspace': workspace,
414
+ 'path': path,
415
+ },
416
+ });
417
+ }
418
+
419
+ /**
420
+ * get script by path
421
+ * @returns Script script details
422
+ * @throws ApiError
423
+ */
424
+ public static getScriptByPath({
425
+ workspace,
426
+ path,
427
+ }: {
428
+ workspace: string,
429
+ path: string,
430
+ }): CancelablePromise<Script> {
431
+ return __request(OpenAPI, {
432
+ method: 'GET',
433
+ url: '/w/{workspace}/scripts/get/p/{path}',
434
+ path: {
435
+ 'workspace': workspace,
436
+ 'path': path,
437
+ },
438
+ });
439
+ }
440
+
441
+ /**
442
+ * get script by path with draft
443
+ * @returns NewScriptWithDraft script details
444
+ * @throws ApiError
445
+ */
446
+ public static getScriptByPathWithDraft({
447
+ workspace,
448
+ path,
449
+ }: {
450
+ workspace: string,
451
+ path: string,
452
+ }): CancelablePromise<NewScriptWithDraft> {
453
+ return __request(OpenAPI, {
454
+ method: 'GET',
455
+ url: '/w/{workspace}/scripts/get/draft/{path}',
456
+ path: {
457
+ 'workspace': workspace,
458
+ 'path': path,
459
+ },
460
+ });
461
+ }
462
+
463
+ /**
464
+ * raw script by path
465
+ * @returns string script content
466
+ * @throws ApiError
467
+ */
468
+ public static rawScriptByPath({
469
+ workspace,
470
+ path,
471
+ }: {
472
+ workspace: string,
473
+ path: string,
474
+ }): CancelablePromise<string> {
475
+ return __request(OpenAPI, {
476
+ method: 'GET',
477
+ url: '/w/{workspace}/scripts/raw/p/{path}',
478
+ path: {
479
+ 'workspace': workspace,
480
+ 'path': path,
481
+ },
482
+ });
483
+ }
484
+
485
+ /**
486
+ * raw script by path with a token (mostly used by lsp to be used with import maps to resolve scripts)
487
+ * @returns string script content
488
+ * @throws ApiError
489
+ */
490
+ public static rawScriptByPathTokened({
491
+ workspace,
492
+ token,
493
+ path,
494
+ }: {
495
+ workspace: string,
496
+ token: string,
497
+ path: string,
498
+ }): CancelablePromise<string> {
499
+ return __request(OpenAPI, {
500
+ method: 'GET',
501
+ url: '/scripts_u/tokened_raw/{workspace}/{token}/{path}',
502
+ path: {
503
+ 'workspace': workspace,
504
+ 'token': token,
505
+ 'path': path,
506
+ },
507
+ });
508
+ }
509
+
510
+ /**
511
+ * exists script by path
512
+ * @returns boolean does it exists
513
+ * @throws ApiError
514
+ */
515
+ public static existsScriptByPath({
516
+ workspace,
517
+ path,
518
+ }: {
519
+ workspace: string,
520
+ path: string,
521
+ }): CancelablePromise<boolean> {
522
+ return __request(OpenAPI, {
523
+ method: 'GET',
524
+ url: '/w/{workspace}/scripts/exists/p/{path}',
525
+ path: {
526
+ 'workspace': workspace,
527
+ 'path': path,
528
+ },
529
+ });
530
+ }
531
+
532
+ /**
533
+ * get script by hash
534
+ * @returns Script script details
535
+ * @throws ApiError
536
+ */
537
+ public static getScriptByHash({
538
+ workspace,
539
+ hash,
540
+ }: {
541
+ workspace: string,
542
+ hash: string,
543
+ }): CancelablePromise<Script> {
544
+ return __request(OpenAPI, {
545
+ method: 'GET',
546
+ url: '/w/{workspace}/scripts/get/h/{hash}',
547
+ path: {
548
+ 'workspace': workspace,
549
+ 'hash': hash,
550
+ },
551
+ });
552
+ }
553
+
554
+ /**
555
+ * raw script by hash
556
+ * @returns string script content
557
+ * @throws ApiError
558
+ */
559
+ public static rawScriptByHash({
560
+ workspace,
561
+ path,
562
+ }: {
563
+ workspace: string,
564
+ path: string,
565
+ }): CancelablePromise<string> {
566
+ return __request(OpenAPI, {
567
+ method: 'GET',
568
+ url: '/w/{workspace}/scripts/raw/h/{path}',
569
+ path: {
570
+ 'workspace': workspace,
571
+ 'path': path,
572
+ },
573
+ });
574
+ }
575
+
576
+ /**
577
+ * get script deployment status
578
+ * @returns any script details
579
+ * @throws ApiError
580
+ */
581
+ public static getScriptDeploymentStatus({
582
+ workspace,
583
+ hash,
584
+ }: {
585
+ workspace: string,
586
+ hash: string,
587
+ }): CancelablePromise<{
588
+ lock?: string;
589
+ lock_error_logs?: string;
590
+ }> {
591
+ return __request(OpenAPI, {
592
+ method: 'GET',
593
+ url: '/w/{workspace}/scripts/deployment_status/h/{hash}',
594
+ path: {
595
+ 'workspace': workspace,
596
+ 'hash': hash,
597
+ },
598
+ });
599
+ }
600
+
601
+ }
@@ -0,0 +1,34 @@
1
+ /* istanbul ignore file */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ import type { CancelablePromise } from '../core/CancelablePromise';
5
+ import { OpenAPI } from '../core/OpenAPI';
6
+ import { request as __request } from '../core/request';
7
+
8
+ export class SettingsService {
9
+
10
+ /**
11
+ * get backend version
12
+ * @returns string git version of backend
13
+ * @throws ApiError
14
+ */
15
+ public static backendVersion(): CancelablePromise<string> {
16
+ return __request(OpenAPI, {
17
+ method: 'GET',
18
+ url: '/version',
19
+ });
20
+ }
21
+
22
+ /**
23
+ * get openapi yaml spec
24
+ * @returns string openapi yaml file content
25
+ * @throws ApiError
26
+ */
27
+ public static getOpenApiYaml(): CancelablePromise<string> {
28
+ return __request(OpenAPI, {
29
+ method: 'GET',
30
+ url: '/openapi.yaml',
31
+ });
32
+ }
33
+
34
+ }