windmill-cli 1.397.4 → 1.398.1

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.
@@ -32,7 +32,7 @@ export const OpenAPI = {
32
32
  PASSWORD: undefined,
33
33
  TOKEN: getEnv("WM_TOKEN"),
34
34
  USERNAME: undefined,
35
- VERSION: '1.397.4',
35
+ VERSION: '1.398.1',
36
36
  WITH_CREDENTIALS: true,
37
37
  interceptors: {
38
38
  request: new Interceptors(),
@@ -486,6 +486,21 @@ export const testSmtp = (data) => {
486
486
  mediaType: 'application/json'
487
487
  });
488
488
  };
489
+ /**
490
+ * test critical channels
491
+ * @param data The data for the request.
492
+ * @param data.requestBody test critical channel payload
493
+ * @returns string status
494
+ * @throws ApiError
495
+ */
496
+ export const testCriticalChannels = (data) => {
497
+ return __request(OpenAPI, {
498
+ method: 'POST',
499
+ url: '/settings/test_critical_channels',
500
+ body: data.requestBody,
501
+ mediaType: 'application/json'
502
+ });
503
+ };
489
504
  /**
490
505
  * test license key
491
506
  * @param data The data for the request.
@@ -2981,6 +2996,7 @@ export const getScriptDeploymentStatus = (data) => {
2981
2996
  * @param data.requestBody script args
2982
2997
  * @param data.scheduledFor when to schedule this job (leave empty for immediate run)
2983
2998
  * @param data.scheduledInSecs schedule the script to execute in the number of seconds starting now
2999
+ * @param data.skipPreprocessor skip the preprocessor
2984
3000
  * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any
2985
3001
  * @param data.tag Override the tag to use
2986
3002
  * @param data.cacheTtl Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl
@@ -3000,6 +3016,7 @@ export const runScriptByPath = (data) => {
3000
3016
  query: {
3001
3017
  scheduled_for: data.scheduledFor,
3002
3018
  scheduled_in_secs: data.scheduledInSecs,
3019
+ skip_preprocessor: data.skipPreprocessor,
3003
3020
  parent_job: data.parentJob,
3004
3021
  tag: data.tag,
3005
3022
  cache_ttl: data.cacheTtl,
@@ -3950,6 +3967,7 @@ export const executeComponent = (data) => {
3950
3967
  * @param data.requestBody flow args
3951
3968
  * @param data.scheduledFor when to schedule this job (leave empty for immediate run)
3952
3969
  * @param data.scheduledInSecs schedule the script to execute in the number of seconds starting now
3970
+ * @param data.skipPreprocessor skip the preprocessor
3953
3971
  * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any
3954
3972
  * @param data.tag Override the tag to use
3955
3973
  * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request)
@@ -3971,6 +3989,7 @@ export const runFlowByPath = (data) => {
3971
3989
  query: {
3972
3990
  scheduled_for: data.scheduledFor,
3973
3991
  scheduled_in_secs: data.scheduledInSecs,
3992
+ skip_preprocessor: data.skipPreprocessor,
3974
3993
  parent_job: data.parentJob,
3975
3994
  tag: data.tag,
3976
3995
  job_id: data.jobId,
@@ -4032,6 +4051,7 @@ export const restartFlowAtStep = (data) => {
4032
4051
  * @param data.requestBody Partially filled args
4033
4052
  * @param data.scheduledFor when to schedule this job (leave empty for immediate run)
4034
4053
  * @param data.scheduledInSecs schedule the script to execute in the number of seconds starting now
4054
+ * @param data.skipPreprocessor skip the preprocessor
4035
4055
  * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any
4036
4056
  * @param data.tag Override the tag to use
4037
4057
  * @param data.cacheTtl Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl
@@ -4054,6 +4074,7 @@ export const runScriptByHash = (data) => {
4054
4074
  query: {
4055
4075
  scheduled_for: data.scheduledFor,
4056
4076
  scheduled_in_secs: data.scheduledInSecs,
4077
+ skip_preprocessor: data.skipPreprocessor,
4057
4078
  parent_job: data.parentJob,
4058
4079
  tag: data.tag,
4059
4080
  cache_ttl: data.cacheTtl,
@@ -5229,6 +5250,163 @@ export const setDefaultErrorOrRecoveryHandler = (data) => {
5229
5250
  mediaType: 'application/json'
5230
5251
  });
5231
5252
  };
5253
+ /**
5254
+ * create http trigger
5255
+ * @param data The data for the request.
5256
+ * @param data.workspace
5257
+ * @param data.requestBody new http trigger
5258
+ * @returns string http trigger created
5259
+ * @throws ApiError
5260
+ */
5261
+ export const createHttpTrigger = (data) => {
5262
+ return __request(OpenAPI, {
5263
+ method: 'POST',
5264
+ url: '/w/{workspace}/http_triggers/create',
5265
+ path: {
5266
+ workspace: data.workspace
5267
+ },
5268
+ body: data.requestBody,
5269
+ mediaType: 'application/json'
5270
+ });
5271
+ };
5272
+ /**
5273
+ * update http trigger
5274
+ * @param data The data for the request.
5275
+ * @param data.workspace
5276
+ * @param data.path
5277
+ * @param data.requestBody updated trigger
5278
+ * @returns string http trigger updated
5279
+ * @throws ApiError
5280
+ */
5281
+ export const updateHttpTrigger = (data) => {
5282
+ return __request(OpenAPI, {
5283
+ method: 'POST',
5284
+ url: '/w/{workspace}/http_triggers/update/{path}',
5285
+ path: {
5286
+ workspace: data.workspace,
5287
+ path: data.path
5288
+ },
5289
+ body: data.requestBody,
5290
+ mediaType: 'application/json'
5291
+ });
5292
+ };
5293
+ /**
5294
+ * delete http trigger
5295
+ * @param data The data for the request.
5296
+ * @param data.workspace
5297
+ * @param data.path
5298
+ * @returns string http trigger deleted
5299
+ * @throws ApiError
5300
+ */
5301
+ export const deleteHttpTrigger = (data) => {
5302
+ return __request(OpenAPI, {
5303
+ method: 'DELETE',
5304
+ url: '/w/{workspace}/http_triggers/delete/{path}',
5305
+ path: {
5306
+ workspace: data.workspace,
5307
+ path: data.path
5308
+ }
5309
+ });
5310
+ };
5311
+ /**
5312
+ * get http trigger
5313
+ * @param data The data for the request.
5314
+ * @param data.workspace
5315
+ * @param data.path
5316
+ * @returns HttpTrigger http trigger deleted
5317
+ * @throws ApiError
5318
+ */
5319
+ export const getHttpTrigger = (data) => {
5320
+ return __request(OpenAPI, {
5321
+ method: 'GET',
5322
+ url: '/w/{workspace}/http_triggers/get/{path}',
5323
+ path: {
5324
+ workspace: data.workspace,
5325
+ path: data.path
5326
+ }
5327
+ });
5328
+ };
5329
+ /**
5330
+ * list http triggers
5331
+ * @param data The data for the request.
5332
+ * @param data.workspace
5333
+ * @param data.page which page to return (start at 1, default 1)
5334
+ * @param data.perPage number of items to return for a given page (default 30, max 100)
5335
+ * @param data.path filter by path
5336
+ * @param data.isFlow
5337
+ * @param data.pathStart
5338
+ * @returns HttpTrigger http trigger list
5339
+ * @throws ApiError
5340
+ */
5341
+ export const listHttpTriggers = (data) => {
5342
+ return __request(OpenAPI, {
5343
+ method: 'GET',
5344
+ url: '/w/{workspace}/http_triggers/list',
5345
+ path: {
5346
+ workspace: data.workspace
5347
+ },
5348
+ query: {
5349
+ page: data.page,
5350
+ per_page: data.perPage,
5351
+ path: data.path,
5352
+ is_flow: data.isFlow,
5353
+ path_start: data.pathStart
5354
+ }
5355
+ });
5356
+ };
5357
+ /**
5358
+ * does http trigger exists
5359
+ * @param data The data for the request.
5360
+ * @param data.workspace
5361
+ * @param data.path
5362
+ * @returns boolean http trigger exists
5363
+ * @throws ApiError
5364
+ */
5365
+ export const existsHttpTrigger = (data) => {
5366
+ return __request(OpenAPI, {
5367
+ method: 'GET',
5368
+ url: '/w/{workspace}/http_triggers/exists/{path}',
5369
+ path: {
5370
+ workspace: data.workspace,
5371
+ path: data.path
5372
+ }
5373
+ });
5374
+ };
5375
+ /**
5376
+ * does route exists
5377
+ * @param data The data for the request.
5378
+ * @param data.workspace
5379
+ * @param data.requestBody route exists request
5380
+ * @returns boolean route exists
5381
+ * @throws ApiError
5382
+ */
5383
+ export const existsRoute = (data) => {
5384
+ return __request(OpenAPI, {
5385
+ method: 'POST',
5386
+ url: '/w/{workspace}/http_triggers/route_exists',
5387
+ path: {
5388
+ workspace: data.workspace
5389
+ },
5390
+ body: data.requestBody,
5391
+ mediaType: 'application/json'
5392
+ });
5393
+ };
5394
+ /**
5395
+ * whether http triggers are used
5396
+ * @param data The data for the request.
5397
+ * @param data.workspace
5398
+ * @returns boolean whether http triggers are used
5399
+ * @throws ApiError
5400
+ */
5401
+ export const used = (data) => {
5402
+ return __request(OpenAPI, {
5403
+ method: 'GET',
5404
+ url: '/w/{workspace}/http_triggers/used',
5405
+ path: {
5406
+ workspace: data.workspace
5407
+ }
5408
+ });
5409
+ };
5232
5410
  /**
5233
5411
  * list instance groups
5234
5412
  * @returns InstanceGroup instance group list
package/esm/main.js CHANGED
@@ -30,7 +30,7 @@ export { flow, app, script, workspace, resource, user, variable, hub, folder, sc
30
30
  // console.error(JSON.stringify(event.error, null, 4));
31
31
  // }
32
32
  // });
33
- export const VERSION = "1.397.4";
33
+ export const VERSION = "1.398.1";
34
34
  const command = new Command()
35
35
  .name("wmill")
36
36
  .action(() => log.info(`Welcome to Windmill CLI ${VERSION}. Use -h for help.`))
package/esm/metadata.js CHANGED
@@ -171,8 +171,10 @@ export async function generateScriptMetadataInternal(scriptPath, workspace, opts
171
171
  export async function updateScriptSchema(scriptContent, language, metadataContent, path) {
172
172
  // infer schema from script content and update it inplace
173
173
  await instantiateWasm();
174
- const newSchema = inferSchema(language, scriptContent, metadataContent.schema, path);
175
- metadataContent.schema = newSchema;
174
+ const result = inferSchema(language, scriptContent, metadataContent.schema, path);
175
+ metadataContent.schema = result.schema;
176
+ metadataContent.has_preprocessor = result.has_preprocessor;
177
+ metadataContent.no_main_func = result.no_main_func;
176
178
  }
177
179
  async function updateScriptLock(workspace, scriptContent, language, remotePath, metadataContent, rawDeps) {
178
180
  if (!(language == "bun" ||
@@ -329,7 +331,11 @@ export function inferSchema(language, content, currentSchema, path) {
329
331
  }
330
332
  if (inferedSchema.type == "Invalid") {
331
333
  log.info(colors.yellow(`Script ${path} invalid, it cannot be parsed to infer schema.`));
332
- return defaultScriptMetadata().schema;
334
+ return {
335
+ schema: defaultScriptMetadata().schema,
336
+ has_preprocessor: false,
337
+ no_main_func: false,
338
+ };
333
339
  }
334
340
  currentSchema.required = [];
335
341
  const oldProperties = JSON.parse(JSON.stringify(currentSchema.properties));
@@ -348,7 +354,11 @@ export function inferSchema(language, content, currentSchema, path) {
348
354
  currentSchema.required.push(arg.name);
349
355
  }
350
356
  }
351
- return currentSchema;
357
+ return {
358
+ schema: currentSchema,
359
+ has_preprocessor: inferedSchema.has_preprocessor,
360
+ no_main_func: inferedSchema.no_main_func,
361
+ };
352
362
  }
353
363
  function sortObject(obj) {
354
364
  return Object.keys(obj)
package/esm/script.js CHANGED
@@ -171,6 +171,7 @@ export async function handleFile(path, workspace, alreadySynced, message, opts,
171
171
  restart_unless_cancelled: typed?.restart_unless_cancelled,
172
172
  visible_to_runner_only: typed?.visible_to_runner_only,
173
173
  no_main_func: typed?.no_main_func,
174
+ has_preprocessor: typed?.has_preprocessor,
174
175
  priority: typed?.priority,
175
176
  concurrency_key: typed?.concurrency_key,
176
177
  //@ts-ignore
@@ -201,6 +202,8 @@ export async function handleFile(path, workspace, alreadySynced, message, opts,
201
202
  Boolean(typed.visible_to_runner_only) ==
202
203
  Boolean(remote.visible_to_runner_only) &&
203
204
  Boolean(typed.no_main_func) == Boolean(remote.no_main_func) &&
205
+ Boolean(typed.has_preprocessor) ==
206
+ Boolean(remote.has_preprocessor) &&
204
207
  typed.priority == Boolean(remote.priority) &&
205
208
  typed.timeout == remote.timeout &&
206
209
  //@ts-ignore
@@ -15,13 +15,25 @@ import * as dntShim from "../_dnt.shims.js";
15
15
  // @ts-nocheck: generated
16
16
  // deno-lint-ignore-file
17
17
  // deno-fmt-ignore-file
18
- // source-hash: d36b5583d8f6223c130a246a8713b8621d55b990
18
+ // source-hash: 6da62ad21f79c5b8fe442f1de939e367943e2665
19
19
  let wasm;
20
20
  const heap = new Array(128).fill(undefined);
21
21
  heap.push(undefined, null, true, false);
22
22
  function getObject(idx) {
23
23
  return heap[idx];
24
24
  }
25
+ let heap_next = heap.length;
26
+ function dropObject(idx) {
27
+ if (idx < 132)
28
+ return;
29
+ heap[idx] = heap_next;
30
+ heap_next = idx;
31
+ }
32
+ function takeObject(idx) {
33
+ const ret = getObject(idx);
34
+ dropObject(idx);
35
+ return ret;
36
+ }
25
37
  let WASM_VECTOR_LEN = 0;
26
38
  let cachedUint8Memory0 = null;
27
39
  function getUint8Memory0() {
@@ -81,33 +93,6 @@ function getInt32Memory0() {
81
93
  }
82
94
  return cachedInt32Memory0;
83
95
  }
84
- let heap_next = heap.length;
85
- function dropObject(idx) {
86
- if (idx < 132)
87
- return;
88
- heap[idx] = heap_next;
89
- heap_next = idx;
90
- }
91
- function takeObject(idx) {
92
- const ret = getObject(idx);
93
- dropObject(idx);
94
- return ret;
95
- }
96
- let cachedFloat64Memory0 = null;
97
- function getFloat64Memory0() {
98
- if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
99
- cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
100
- }
101
- return cachedFloat64Memory0;
102
- }
103
- function addHeapObject(obj) {
104
- if (heap_next === heap.length)
105
- heap.push(heap.length + 1);
106
- const idx = heap_next;
107
- heap_next = heap[idx];
108
- heap[idx] = obj;
109
- return idx;
110
- }
111
96
  const cachedTextDecoder = typeof TextDecoder !== "undefined"
112
97
  ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true })
113
98
  : {
@@ -121,6 +106,21 @@ function getStringFromWasm0(ptr, len) {
121
106
  ptr = ptr >>> 0;
122
107
  return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
123
108
  }
109
+ function addHeapObject(obj) {
110
+ if (heap_next === heap.length)
111
+ heap.push(heap.length + 1);
112
+ const idx = heap_next;
113
+ heap_next = heap[idx];
114
+ heap[idx] = obj;
115
+ return idx;
116
+ }
117
+ let cachedFloat64Memory0 = null;
118
+ function getFloat64Memory0() {
119
+ if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
120
+ cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
121
+ }
122
+ return cachedFloat64Memory0;
123
+ }
124
124
  let cachedBigInt64Memory0 = null;
125
125
  function getBigInt64Memory0() {
126
126
  if (cachedBigInt64Memory0 === null || cachedBigInt64Memory0.byteLength === 0) {
@@ -198,25 +198,30 @@ function debugString(val) {
198
198
  }
199
199
  /**
200
200
  * @param {string} code
201
+ * @param {string | undefined} [main_override]
201
202
  * @returns {string}
202
203
  */
203
- export function parse_deno(code) {
204
- let deferred2_0;
205
- let deferred2_1;
204
+ export function parse_deno(code, main_override) {
205
+ let deferred3_0;
206
+ let deferred3_1;
206
207
  try {
207
208
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
208
209
  const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
209
210
  const len0 = WASM_VECTOR_LEN;
210
- wasm.parse_deno(retptr, ptr0, len0);
211
+ var ptr1 = isLikeNone(main_override)
212
+ ? 0
213
+ : passStringToWasm0(main_override, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
214
+ var len1 = WASM_VECTOR_LEN;
215
+ wasm.parse_deno(retptr, ptr0, len0, ptr1, len1);
211
216
  var r0 = getInt32Memory0()[retptr / 4 + 0];
212
217
  var r1 = getInt32Memory0()[retptr / 4 + 1];
213
- deferred2_0 = r0;
214
- deferred2_1 = r1;
218
+ deferred3_0 = r0;
219
+ deferred3_1 = r1;
215
220
  return getStringFromWasm0(r0, r1);
216
221
  }
217
222
  finally {
218
223
  wasm.__wbindgen_add_to_stack_pointer(16);
219
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
224
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
220
225
  }
221
226
  }
222
227
  /**
@@ -336,25 +341,30 @@ export function parse_go(code) {
336
341
  }
337
342
  /**
338
343
  * @param {string} code
344
+ * @param {string | undefined} [main_override]
339
345
  * @returns {string}
340
346
  */
341
- export function parse_python(code) {
342
- let deferred2_0;
343
- let deferred2_1;
347
+ export function parse_python(code, main_override) {
348
+ let deferred3_0;
349
+ let deferred3_1;
344
350
  try {
345
351
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
346
352
  const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
347
353
  const len0 = WASM_VECTOR_LEN;
348
- wasm.parse_python(retptr, ptr0, len0);
354
+ var ptr1 = isLikeNone(main_override)
355
+ ? 0
356
+ : passStringToWasm0(main_override, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
357
+ var len1 = WASM_VECTOR_LEN;
358
+ wasm.parse_python(retptr, ptr0, len0, ptr1, len1);
349
359
  var r0 = getInt32Memory0()[retptr / 4 + 0];
350
360
  var r1 = getInt32Memory0()[retptr / 4 + 1];
351
- deferred2_0 = r0;
352
- deferred2_1 = r1;
361
+ deferred3_0 = r0;
362
+ deferred3_1 = r1;
353
363
  return getStringFromWasm0(r0, r1);
354
364
  }
355
365
  finally {
356
366
  wasm.__wbindgen_add_to_stack_pointer(16);
357
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
367
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
358
368
  }
359
369
  }
360
370
  /**
@@ -564,6 +574,29 @@ export function parse_rust(code) {
564
574
  wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
565
575
  }
566
576
  }
577
+ /**
578
+ * @param {string} code
579
+ * @returns {string}
580
+ */
581
+ export function parse_ansible(code) {
582
+ let deferred2_0;
583
+ let deferred2_1;
584
+ try {
585
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
586
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
587
+ const len0 = WASM_VECTOR_LEN;
588
+ wasm.parse_ansible(retptr, ptr0, len0);
589
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
590
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
591
+ deferred2_0 = r0;
592
+ deferred2_1 = r1;
593
+ return getStringFromWasm0(r0, r1);
594
+ }
595
+ finally {
596
+ wasm.__wbindgen_add_to_stack_pointer(16);
597
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
598
+ }
599
+ }
567
600
  function handleError(f, args) {
568
601
  try {
569
602
  return f.apply(this, args);
@@ -574,6 +607,9 @@ function handleError(f, args) {
574
607
  }
575
608
  const imports = {
576
609
  __wbindgen_placeholder__: {
610
+ __wbindgen_object_drop_ref: function (arg0) {
611
+ takeObject(arg0);
612
+ },
577
613
  __wbindgen_string_get: function (arg0, arg1) {
578
614
  const obj = getObject(arg1);
579
615
  const ret = typeof obj === "string" ? obj : undefined;
@@ -584,8 +620,9 @@ const imports = {
584
620
  getInt32Memory0()[arg0 / 4 + 1] = len1;
585
621
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
586
622
  },
587
- __wbindgen_object_drop_ref: function (arg0) {
588
- takeObject(arg0);
623
+ __wbindgen_error_new: function (arg0, arg1) {
624
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
625
+ return addHeapObject(ret);
589
626
  },
590
627
  __wbindgen_boolean_get: function (arg0) {
591
628
  const v = getObject(arg0);
@@ -623,11 +660,7 @@ const imports = {
623
660
  const ret = BigInt.asUintN(64, arg0);
624
661
  return addHeapObject(ret);
625
662
  },
626
- __wbindgen_error_new: function (arg0, arg1) {
627
- const ret = new Error(getStringFromWasm0(arg0, arg1));
628
- return addHeapObject(ret);
629
- },
630
- __wbg_eval_c227cc6614cd76e5: function (arg0, arg1) {
663
+ __wbg_eval_b7405fdd08ddef3d: function (arg0, arg1) {
631
664
  const ret = eval(getStringFromWasm0(arg0, arg1));
632
665
  return addHeapObject(ret);
633
666
  },
@@ -883,6 +916,7 @@ function getWasmInstanceExports() {
883
916
  parse_graphql,
884
917
  parse_php,
885
918
  parse_rust,
919
+ parse_ansible,
886
920
  };
887
921
  }
888
922
  export function isInstantiated() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-cli",
3
- "version": "1.397.4",
3
+ "version": "1.398.1",
4
4
  "description": "CLI for Windmill",
5
5
  "repository": {
6
6
  "type": "git",