windmill-cli 1.526.0 → 1.527.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.
- package/esm/bootstrap/script_bootstrap.js +5 -0
- package/esm/gen/core/OpenAPI.js +1 -1
- package/esm/src/commands/script/script.js +6 -2
- package/esm/src/commands/sync/sync.js +2 -1
- package/esm/src/main.js +1 -1
- package/esm/src/types.js +1 -0
- package/esm/src/utils/metadata.js +5 -1
- package/esm/src/utils/script_common.js +3 -0
- package/esm/wasm/ruby/windmill_parser_wasm.js +103 -0
- package/esm/wasm/ruby/windmill_parser_wasm_bg.wasm +0 -0
- package/package.json +1 -1
- package/types/bootstrap/script_bootstrap.d.ts +1 -0
- package/types/bootstrap/script_bootstrap.d.ts.map +1 -1
- package/types/gen/types.gen.d.ts +1 -1
- package/types/gen/types.gen.d.ts.map +1 -1
- package/types/src/commands/script/script.d.ts.map +1 -1
- package/types/src/commands/sync/sync.d.ts.map +1 -1
- package/types/src/main.d.ts +1 -1
- package/types/src/types.d.ts.map +1 -1
- package/types/src/utils/metadata.d.ts.map +1 -1
- package/types/src/utils/script_common.d.ts +1 -1
- package/types/src/utils/script_common.d.ts.map +1 -1
- package/types/wasm/ruby/windmill_parser_wasm.d.ts +7 -0
- package/types/wasm/ruby/windmill_parser_wasm.d.ts.map +1 -0
- package/types/windmill-utils-internal/src/gen/types.gen.d.ts +1 -1
- package/types/windmill-utils-internal/src/gen/types.gen.d.ts.map +1 -1
package/esm/gen/core/OpenAPI.js
CHANGED
|
@@ -407,7 +407,10 @@ export function filePathExtensionFromContentType(language, defaultTs) {
|
|
|
407
407
|
}
|
|
408
408
|
else if (language === "java") {
|
|
409
409
|
return ".java";
|
|
410
|
-
|
|
410
|
+
}
|
|
411
|
+
else if (language === "ruby") {
|
|
412
|
+
return ".rb";
|
|
413
|
+
// for related places search: ADD_NEW_LANG
|
|
411
414
|
}
|
|
412
415
|
else {
|
|
413
416
|
throw new Error("Invalid language: " + language);
|
|
@@ -437,7 +440,8 @@ export const exts = [
|
|
|
437
440
|
".nu",
|
|
438
441
|
".playbook.yml",
|
|
439
442
|
".java",
|
|
440
|
-
|
|
443
|
+
".rb"
|
|
444
|
+
// for related places search: ADD_NEW_LANG
|
|
441
445
|
];
|
|
442
446
|
export function removeExtensionToPath(path) {
|
|
443
447
|
for (const ext of exts) {
|
|
@@ -577,7 +577,8 @@ export async function elementsToMap(els, ignore, json, skips) {
|
|
|
577
577
|
"yml",
|
|
578
578
|
"nu",
|
|
579
579
|
"java",
|
|
580
|
-
|
|
580
|
+
"rb",
|
|
581
|
+
// for related places search: ADD_NEW_LANG
|
|
581
582
|
].includes(path.split(".").pop() ?? "") &&
|
|
582
583
|
!isFileResource(path))
|
|
583
584
|
continue;
|
package/esm/src/main.js
CHANGED
|
@@ -38,7 +38,7 @@ export { flow, app, script, workspace, resource, resourceType, user, variable, h
|
|
|
38
38
|
// console.error(JSON.stringify(event.error, null, 4));
|
|
39
39
|
// }
|
|
40
40
|
// });
|
|
41
|
-
export const VERSION = "1.
|
|
41
|
+
export const VERSION = "1.527.1";
|
|
42
42
|
const command = new Command()
|
|
43
43
|
.name("wmill")
|
|
44
44
|
.action(() => log.info(`Welcome to Windmill CLI ${VERSION}. Use -h for help.`))
|
package/esm/src/types.js
CHANGED
|
@@ -173,6 +173,7 @@ export function getTypeStrFromPath(p) {
|
|
|
173
173
|
parsed.ext == ".cs" ||
|
|
174
174
|
parsed.ext == ".nu" ||
|
|
175
175
|
parsed.ext == ".java" ||
|
|
176
|
+
parsed.ext == ".rb" ||
|
|
176
177
|
// for related places search: ADD_NEW_LANG
|
|
177
178
|
(parsed.ext == ".yml" && parsed.name.split(".").pop() == "playbook")) {
|
|
178
179
|
return "script";
|
|
@@ -433,7 +433,11 @@ export async function inferSchema(language, content, currentSchema, path) {
|
|
|
433
433
|
else if (language === "java") {
|
|
434
434
|
const { parse_java } = await import("../../wasm/java/windmill_parser_wasm.js");
|
|
435
435
|
inferedSchema = JSON.parse(parse_java(content));
|
|
436
|
-
|
|
436
|
+
}
|
|
437
|
+
else if (language === "ruby") {
|
|
438
|
+
const { parse_ruby } = await import("../../wasm/ruby/windmill_parser_wasm.js");
|
|
439
|
+
inferedSchema = JSON.parse(parse_ruby(content));
|
|
440
|
+
// for related places search: ADD_NEW_LANG
|
|
437
441
|
}
|
|
438
442
|
else {
|
|
439
443
|
throw new Error("Invalid language: " + language);
|
|
@@ -70,6 +70,9 @@ export function inferContentTypeFromFilePath(contentPath, defaultTs) {
|
|
|
70
70
|
}
|
|
71
71
|
else if (contentPath.endsWith(".java")) {
|
|
72
72
|
return "java";
|
|
73
|
+
}
|
|
74
|
+
else if (contentPath.endsWith(".rb")) {
|
|
75
|
+
return "ruby";
|
|
73
76
|
// for related places search: ADD_NEW_LANG
|
|
74
77
|
}
|
|
75
78
|
else {
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import * as dntShim from "../../_dnt.shims.js";
|
|
2
|
+
let WASM_VECTOR_LEN = 0;
|
|
3
|
+
let cachedUint8ArrayMemory0 = null;
|
|
4
|
+
function getUint8ArrayMemory0() {
|
|
5
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
6
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
7
|
+
}
|
|
8
|
+
return cachedUint8ArrayMemory0;
|
|
9
|
+
}
|
|
10
|
+
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available'); } });
|
|
11
|
+
const encodeString = function (arg, view) {
|
|
12
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
13
|
+
};
|
|
14
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
15
|
+
if (realloc === undefined) {
|
|
16
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
17
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
18
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
19
|
+
WASM_VECTOR_LEN = buf.length;
|
|
20
|
+
return ptr;
|
|
21
|
+
}
|
|
22
|
+
let len = arg.length;
|
|
23
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
24
|
+
const mem = getUint8ArrayMemory0();
|
|
25
|
+
let offset = 0;
|
|
26
|
+
for (; offset < len; offset++) {
|
|
27
|
+
const code = arg.charCodeAt(offset);
|
|
28
|
+
if (code > 0x7F)
|
|
29
|
+
break;
|
|
30
|
+
mem[ptr + offset] = code;
|
|
31
|
+
}
|
|
32
|
+
if (offset !== len) {
|
|
33
|
+
if (offset !== 0) {
|
|
34
|
+
arg = arg.slice(offset);
|
|
35
|
+
}
|
|
36
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
37
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
38
|
+
const ret = encodeString(arg, view);
|
|
39
|
+
offset += ret.written;
|
|
40
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
41
|
+
}
|
|
42
|
+
WASM_VECTOR_LEN = offset;
|
|
43
|
+
return ptr;
|
|
44
|
+
}
|
|
45
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available'); } });
|
|
46
|
+
if (typeof TextDecoder !== 'undefined') {
|
|
47
|
+
cachedTextDecoder.decode();
|
|
48
|
+
}
|
|
49
|
+
;
|
|
50
|
+
function getStringFromWasm0(ptr, len) {
|
|
51
|
+
ptr = ptr >>> 0;
|
|
52
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* @param {string} code
|
|
56
|
+
* @returns {string}
|
|
57
|
+
*/
|
|
58
|
+
export function parse_ruby(code) {
|
|
59
|
+
let deferred2_0;
|
|
60
|
+
let deferred2_1;
|
|
61
|
+
try {
|
|
62
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
63
|
+
const len0 = WASM_VECTOR_LEN;
|
|
64
|
+
const ret = wasm.parse_ruby(ptr0, len0);
|
|
65
|
+
deferred2_0 = ret[0];
|
|
66
|
+
deferred2_1 = ret[1];
|
|
67
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
68
|
+
}
|
|
69
|
+
finally {
|
|
70
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
const imports = {
|
|
74
|
+
__wbindgen_placeholder__: {
|
|
75
|
+
__wbindgen_init_externref_table: function () {
|
|
76
|
+
const table = wasm.__wbindgen_export_0;
|
|
77
|
+
const offset = table.grow(4);
|
|
78
|
+
table.set(0, undefined);
|
|
79
|
+
table.set(offset + 0, undefined);
|
|
80
|
+
table.set(offset + 1, null);
|
|
81
|
+
table.set(offset + 2, true);
|
|
82
|
+
table.set(offset + 3, false);
|
|
83
|
+
;
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
const wasm_url = new URL('windmill_parser_wasm_bg.wasm', import.meta.url);
|
|
88
|
+
let wasmCode = '';
|
|
89
|
+
switch (wasm_url.protocol) {
|
|
90
|
+
case 'file:':
|
|
91
|
+
wasmCode = await dntShim.Deno.readFile(wasm_url);
|
|
92
|
+
break;
|
|
93
|
+
case 'https:':
|
|
94
|
+
case 'http:':
|
|
95
|
+
wasmCode = await (await fetch(wasm_url)).arrayBuffer();
|
|
96
|
+
break;
|
|
97
|
+
default:
|
|
98
|
+
throw new Error(`Unsupported protocol: ${wasm_url.protocol}`);
|
|
99
|
+
}
|
|
100
|
+
const wasmInstance = (await WebAssembly.instantiate(wasmCode, imports)).instance;
|
|
101
|
+
const wasm = wasmInstance.exports;
|
|
102
|
+
export const __wasm = wasm;
|
|
103
|
+
wasm.__wbindgen_start();
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"script_bootstrap.d.ts","sourceRoot":"","sources":["../../src/bootstrap/script_bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE;YAAE,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAAA;SAAE,CAAC;QAC/C,QAAQ,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;CACH;AAED,wBAAgB,qBAAqB,IAAI,cAAc,CAatD;AAED,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"script_bootstrap.d.ts","sourceRoot":"","sources":["../../src/bootstrap/script_bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE;YAAE,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAAA;SAAE,CAAC;QAC/C,QAAQ,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;CACH;AAED,wBAAgB,qBAAqB,IAAI,cAAc,CAatD;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;CAwG/B,CAAC"}
|
package/types/gen/types.gen.d.ts
CHANGED
|
@@ -672,7 +672,7 @@ export type MainArgSignature = {
|
|
|
672
672
|
has_preprocessor: (boolean) | null;
|
|
673
673
|
};
|
|
674
674
|
export type type3 = 'Valid' | 'Invalid';
|
|
675
|
-
export type ScriptLang = 'python3' | 'deno' | 'go' | 'bash' | 'powershell' | 'postgresql' | 'mysql' | 'bigquery' | 'snowflake' | 'mssql' | 'oracledb' | 'graphql' | 'nativets' | 'bun' | 'php' | 'rust' | 'ansible' | 'csharp' | 'nu' | 'java' | 'duckdb';
|
|
675
|
+
export type ScriptLang = 'python3' | 'deno' | 'go' | 'bash' | 'powershell' | 'postgresql' | 'mysql' | 'bigquery' | 'snowflake' | 'mssql' | 'oracledb' | 'graphql' | 'nativets' | 'bun' | 'php' | 'rust' | 'ansible' | 'csharp' | 'nu' | 'java' | 'ruby' | 'duckdb';
|
|
676
676
|
export type Preview = {
|
|
677
677
|
content?: string;
|
|
678
678
|
path?: string;
|