windmill-cli 1.478.1 → 1.479.2
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 +13 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.8/_common16.js +45 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.8/_common32.js +175 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.8/_common64.js +98 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.8/_common_detach.js +13 -0
- package/esm/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/base32.js +39 -21
- package/esm/deps/jsr.io/@std/encoding/1.0.8/base64.js +82 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.8/base64url.js +72 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.8/hex.js +87 -0
- package/esm/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/mod.js +1 -0
- package/esm/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/eol.js +1 -0
- package/esm/deps/jsr.io/@std/log/0.224.14/rotating_file_handler.js +1 -1
- package/esm/deps.js +2 -2
- package/esm/gen/core/OpenAPI.js +1 -1
- package/esm/gen/services.gen.js +146 -20
- package/esm/hub.js +11 -7
- package/esm/instance.js +8 -0
- package/esm/main.js +1 -1
- package/esm/metadata.js +29 -4
- package/esm/script.js +15 -0
- package/esm/script_common.js +8 -0
- package/esm/settings.js +3 -11
- package/esm/sync.js +19 -1
- package/esm/types.js +3 -0
- package/esm/wasm/csharp/windmill_parser_wasm.js +103 -0
- package/esm/wasm/csharp/windmill_parser_wasm_bg.wasm +0 -0
- package/esm/wasm/go/windmill_parser_wasm.js +103 -0
- package/esm/wasm/go/windmill_parser_wasm_bg.wasm +0 -0
- package/esm/wasm/java/windmill_parser_wasm.js +103 -0
- package/esm/wasm/java/windmill_parser_wasm_bg.wasm +0 -0
- package/esm/wasm/nu/windmill_parser_wasm.js +103 -0
- package/esm/wasm/nu/windmill_parser_wasm_bg.wasm +0 -0
- package/esm/wasm/php/windmill_parser_wasm.js +103 -0
- package/esm/wasm/php/windmill_parser_wasm_bg.wasm +0 -0
- package/esm/wasm/python/windmill_parser_wasm.js +109 -0
- package/esm/wasm/python/windmill_parser_wasm_bg.wasm +0 -0
- package/esm/wasm/regex/windmill_parser_wasm.js +270 -0
- package/esm/wasm/regex/windmill_parser_wasm_bg.wasm +0 -0
- package/esm/wasm/rust/windmill_parser_wasm.js +103 -0
- package/esm/wasm/rust/windmill_parser_wasm_bg.wasm +0 -0
- package/esm/wasm/ts/windmill_parser_wasm.js +419 -0
- package/esm/wasm/ts/windmill_parser_wasm_bg.wasm +0 -0
- package/esm/wasm/yaml/windmill_parser_wasm.js +103 -0
- package/esm/wasm/yaml/windmill_parser_wasm_bg.wasm +0 -0
- package/package.json +1 -1
- package/types/bootstrap/script_bootstrap.d.ts +2 -0
- package/types/bootstrap/script_bootstrap.d.ts.map +1 -1
- package/types/conf.d.ts +1 -0
- package/types/conf.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/encoding/1.0.8/_common16.d.ts +21 -0
- package/types/deps/jsr.io/@std/encoding/1.0.8/_common16.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/encoding/1.0.8/_common32.d.ts +21 -0
- package/types/deps/jsr.io/@std/encoding/1.0.8/_common32.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/encoding/1.0.8/_common64.d.ts +21 -0
- package/types/deps/jsr.io/@std/encoding/1.0.8/_common64.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/encoding/1.0.8/_common_detach.d.ts +4 -0
- package/types/deps/jsr.io/@std/encoding/1.0.8/_common_detach.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/_types.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/_validate_binary_like.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/ascii85.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/base32.d.ts +15 -15
- package/types/deps/jsr.io/@std/encoding/1.0.8/base32.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/base58.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/encoding/1.0.8/base64.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/encoding/1.0.8/base64url.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/encoding/1.0.8/hex.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/encoding/1.0.8/mod.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/varint.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/_create_walk_entry.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/_get_file_info_type.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/_is_same_path.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/_is_subdir.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/_to_path_string.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/copy.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/empty_dir.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/ensure_dir.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/ensure_file.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/ensure_link.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/ensure_symlink.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/eol.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/exists.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/expand_glob.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/mod.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/move.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/walk.d.ts.map +1 -1
- package/types/deps.d.ts +2 -2
- package/types/gen/services.gen.d.ts +75 -11
- package/types/gen/services.gen.d.ts.map +1 -1
- package/types/gen/types.gen.d.ts +102 -35
- package/types/gen/types.gen.d.ts.map +1 -1
- package/types/hub.d.ts.map +1 -1
- package/types/instance.d.ts +1 -0
- package/types/instance.d.ts.map +1 -1
- package/types/main.d.ts +1 -1
- package/types/metadata.d.ts +2 -2
- package/types/metadata.d.ts.map +1 -1
- package/types/script.d.ts +2 -0
- package/types/script.d.ts.map +1 -1
- package/types/script_common.d.ts +1 -1
- package/types/script_common.d.ts.map +1 -1
- package/types/settings.d.ts +2 -4
- package/types/settings.d.ts.map +1 -1
- package/types/sync.d.ts +2 -0
- package/types/sync.d.ts.map +1 -1
- package/types/types.d.ts.map +1 -1
- package/types/wasm/csharp/windmill_parser_wasm.d.ts +7 -0
- package/types/wasm/csharp/windmill_parser_wasm.d.ts.map +1 -0
- package/types/wasm/go/windmill_parser_wasm.d.ts +7 -0
- package/types/wasm/go/windmill_parser_wasm.d.ts.map +1 -0
- package/types/wasm/java/windmill_parser_wasm.d.ts +7 -0
- package/types/wasm/java/windmill_parser_wasm.d.ts.map +1 -0
- package/types/wasm/nu/windmill_parser_wasm.d.ts +7 -0
- package/types/wasm/nu/windmill_parser_wasm.d.ts.map +1 -0
- package/types/wasm/php/windmill_parser_wasm.d.ts +7 -0
- package/types/wasm/php/windmill_parser_wasm.d.ts.map +1 -0
- package/types/wasm/python/windmill_parser_wasm.d.ts +8 -0
- package/types/wasm/python/windmill_parser_wasm.d.ts.map +1 -0
- package/types/wasm/regex/windmill_parser_wasm.d.ts +52 -0
- package/types/wasm/regex/windmill_parser_wasm.d.ts.map +1 -0
- package/types/wasm/rust/windmill_parser_wasm.d.ts +7 -0
- package/types/wasm/rust/windmill_parser_wasm.d.ts.map +1 -0
- package/types/wasm/ts/windmill_parser_wasm.d.ts +19 -0
- package/types/wasm/ts/windmill_parser_wasm.d.ts.map +1 -0
- package/types/wasm/yaml/windmill_parser_wasm.d.ts +7 -0
- package/types/wasm/yaml/windmill_parser_wasm.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.7/_base32_common.js +0 -183
- package/esm/deps/jsr.io/@std/encoding/1.0.7/base64.js +0 -163
- package/esm/deps/jsr.io/@std/encoding/1.0.7/base64url.js +0 -81
- package/esm/deps/jsr.io/@std/encoding/1.0.7/hex.js +0 -109
- package/esm/wasm/windmill_parser_wasm.generated.js +0 -1135
- package/esm/wasm/windmill_parser_wasm_bg.wasm +0 -0
- package/types/deps/jsr.io/@std/encoding/1.0.7/_base32_common.d.ts +0 -18
- package/types/deps/jsr.io/@std/encoding/1.0.7/_base32_common.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/encoding/1.0.7/base32.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/encoding/1.0.7/base64.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/encoding/1.0.7/base64url.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/encoding/1.0.7/hex.d.ts.map +0 -1
- package/types/deps/jsr.io/@std/encoding/1.0.7/mod.d.ts.map +0 -1
- package/types/wasm/windmill_parser_wasm.generated.d.ts +0 -146
- package/types/wasm/windmill_parser_wasm.generated.d.ts.map +0 -1
- /package/esm/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/_types.js +0 -0
- /package/esm/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/_validate_binary_like.js +0 -0
- /package/esm/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/ascii85.js +0 -0
- /package/esm/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/base58.js +0 -0
- /package/esm/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/varint.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/_create_walk_entry.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/_get_file_info_type.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/_is_same_path.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/_is_subdir.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/_to_path_string.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/copy.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/empty_dir.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/ensure_dir.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/ensure_file.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/ensure_link.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/ensure_symlink.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/exists.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/expand_glob.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/mod.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/move.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/walk.js +0 -0
- /package/types/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/_types.d.ts +0 -0
- /package/types/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/_validate_binary_like.d.ts +0 -0
- /package/types/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/ascii85.d.ts +0 -0
- /package/types/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/base58.d.ts +0 -0
- /package/types/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/base64.d.ts +0 -0
- /package/types/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/base64url.d.ts +0 -0
- /package/types/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/hex.d.ts +0 -0
- /package/types/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/mod.d.ts +0 -0
- /package/types/deps/jsr.io/@std/encoding/{1.0.7 → 1.0.8}/varint.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/_create_walk_entry.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/_get_file_info_type.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/_is_same_path.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/_is_subdir.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/_to_path_string.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/copy.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/empty_dir.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/ensure_dir.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/ensure_file.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/ensure_link.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/ensure_symlink.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/eol.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/exists.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/expand_glob.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/mod.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/move.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.14 → 1.0.15}/walk.d.ts +0 -0
|
@@ -1,1135 +0,0 @@
|
|
|
1
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
-
};
|
|
7
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
-
};
|
|
12
|
-
var _WasmBuildLoader_instances, _WasmBuildLoader_options, _WasmBuildLoader_lastLoadPromise, _WasmBuildLoader_instantiated, _WasmBuildLoader_instantiate;
|
|
13
|
-
// @generated file from wasmbuild -- do not edit
|
|
14
|
-
import * as dntShim from "../_dnt.shims.js";
|
|
15
|
-
// @ts-nocheck: generated
|
|
16
|
-
// deno-lint-ignore-file
|
|
17
|
-
// deno-fmt-ignore-file
|
|
18
|
-
// source-hash: f0b1d0be016a3874b6824c3458a87cf04fc171fd
|
|
19
|
-
let wasm;
|
|
20
|
-
const heap = new Array(128).fill(undefined);
|
|
21
|
-
heap.push(undefined, null, true, false);
|
|
22
|
-
function getObject(idx) {
|
|
23
|
-
return heap[idx];
|
|
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
|
-
}
|
|
37
|
-
function addHeapObject(obj) {
|
|
38
|
-
if (heap_next === heap.length)
|
|
39
|
-
heap.push(heap.length + 1);
|
|
40
|
-
const idx = heap_next;
|
|
41
|
-
heap_next = heap[idx];
|
|
42
|
-
heap[idx] = obj;
|
|
43
|
-
return idx;
|
|
44
|
-
}
|
|
45
|
-
const cachedTextDecoder = typeof TextDecoder !== "undefined"
|
|
46
|
-
? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true })
|
|
47
|
-
: {
|
|
48
|
-
decode: () => {
|
|
49
|
-
throw Error("TextDecoder not available");
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
if (typeof TextDecoder !== "undefined")
|
|
53
|
-
cachedTextDecoder.decode();
|
|
54
|
-
let cachedUint8Memory0 = null;
|
|
55
|
-
function getUint8Memory0() {
|
|
56
|
-
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
57
|
-
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
58
|
-
}
|
|
59
|
-
return cachedUint8Memory0;
|
|
60
|
-
}
|
|
61
|
-
function getStringFromWasm0(ptr, len) {
|
|
62
|
-
ptr = ptr >>> 0;
|
|
63
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
64
|
-
}
|
|
65
|
-
function isLikeNone(x) {
|
|
66
|
-
return x === undefined || x === null;
|
|
67
|
-
}
|
|
68
|
-
let cachedFloat64Memory0 = null;
|
|
69
|
-
function getFloat64Memory0() {
|
|
70
|
-
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
71
|
-
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
72
|
-
}
|
|
73
|
-
return cachedFloat64Memory0;
|
|
74
|
-
}
|
|
75
|
-
let cachedInt32Memory0 = null;
|
|
76
|
-
function getInt32Memory0() {
|
|
77
|
-
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
78
|
-
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
79
|
-
}
|
|
80
|
-
return cachedInt32Memory0;
|
|
81
|
-
}
|
|
82
|
-
let WASM_VECTOR_LEN = 0;
|
|
83
|
-
const cachedTextEncoder = typeof TextEncoder !== "undefined"
|
|
84
|
-
? new TextEncoder("utf-8")
|
|
85
|
-
: {
|
|
86
|
-
encode: () => {
|
|
87
|
-
throw Error("TextEncoder not available");
|
|
88
|
-
},
|
|
89
|
-
};
|
|
90
|
-
const encodeString = function (arg, view) {
|
|
91
|
-
return cachedTextEncoder.encodeInto(arg, view);
|
|
92
|
-
};
|
|
93
|
-
function passStringToWasm0(arg, malloc, realloc) {
|
|
94
|
-
if (realloc === undefined) {
|
|
95
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
96
|
-
const ptr = malloc(buf.length, 1) >>> 0;
|
|
97
|
-
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
98
|
-
WASM_VECTOR_LEN = buf.length;
|
|
99
|
-
return ptr;
|
|
100
|
-
}
|
|
101
|
-
let len = arg.length;
|
|
102
|
-
let ptr = malloc(len, 1) >>> 0;
|
|
103
|
-
const mem = getUint8Memory0();
|
|
104
|
-
let offset = 0;
|
|
105
|
-
for (; offset < len; offset++) {
|
|
106
|
-
const code = arg.charCodeAt(offset);
|
|
107
|
-
if (code > 0x7F)
|
|
108
|
-
break;
|
|
109
|
-
mem[ptr + offset] = code;
|
|
110
|
-
}
|
|
111
|
-
if (offset !== len) {
|
|
112
|
-
if (offset !== 0) {
|
|
113
|
-
arg = arg.slice(offset);
|
|
114
|
-
}
|
|
115
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
116
|
-
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
117
|
-
const ret = encodeString(arg, view);
|
|
118
|
-
offset += ret.written;
|
|
119
|
-
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
120
|
-
}
|
|
121
|
-
WASM_VECTOR_LEN = offset;
|
|
122
|
-
return ptr;
|
|
123
|
-
}
|
|
124
|
-
let cachedBigInt64Memory0 = null;
|
|
125
|
-
function getBigInt64Memory0() {
|
|
126
|
-
if (cachedBigInt64Memory0 === null || cachedBigInt64Memory0.byteLength === 0) {
|
|
127
|
-
cachedBigInt64Memory0 = new BigInt64Array(wasm.memory.buffer);
|
|
128
|
-
}
|
|
129
|
-
return cachedBigInt64Memory0;
|
|
130
|
-
}
|
|
131
|
-
function debugString(val) {
|
|
132
|
-
// primitive types
|
|
133
|
-
const type = typeof val;
|
|
134
|
-
if (type == "number" || type == "boolean" || val == null) {
|
|
135
|
-
return `${val}`;
|
|
136
|
-
}
|
|
137
|
-
if (type == "string") {
|
|
138
|
-
return `"${val}"`;
|
|
139
|
-
}
|
|
140
|
-
if (type == "symbol") {
|
|
141
|
-
const description = val.description;
|
|
142
|
-
if (description == null) {
|
|
143
|
-
return "Symbol";
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
return `Symbol(${description})`;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
if (type == "function") {
|
|
150
|
-
const name = val.name;
|
|
151
|
-
if (typeof name == "string" && name.length > 0) {
|
|
152
|
-
return `Function(${name})`;
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
155
|
-
return "Function";
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
// objects
|
|
159
|
-
if (Array.isArray(val)) {
|
|
160
|
-
const length = val.length;
|
|
161
|
-
let debug = "[";
|
|
162
|
-
if (length > 0) {
|
|
163
|
-
debug += debugString(val[0]);
|
|
164
|
-
}
|
|
165
|
-
for (let i = 1; i < length; i++) {
|
|
166
|
-
debug += ", " + debugString(val[i]);
|
|
167
|
-
}
|
|
168
|
-
debug += "]";
|
|
169
|
-
return debug;
|
|
170
|
-
}
|
|
171
|
-
// Test for built-in
|
|
172
|
-
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
173
|
-
let className;
|
|
174
|
-
if (builtInMatches.length > 1) {
|
|
175
|
-
className = builtInMatches[1];
|
|
176
|
-
}
|
|
177
|
-
else {
|
|
178
|
-
// Failed to match the standard '[object ClassName]'
|
|
179
|
-
return toString.call(val);
|
|
180
|
-
}
|
|
181
|
-
if (className == "Object") {
|
|
182
|
-
// we're a user defined class or Object
|
|
183
|
-
// JSON.stringify avoids problems with cycles, and is generally much
|
|
184
|
-
// easier than looping through ownProperties of `val`.
|
|
185
|
-
try {
|
|
186
|
-
return "Object(" + JSON.stringify(val) + ")";
|
|
187
|
-
}
|
|
188
|
-
catch (_) {
|
|
189
|
-
return "Object";
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
// errors
|
|
193
|
-
if (val instanceof Error) {
|
|
194
|
-
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
195
|
-
}
|
|
196
|
-
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
197
|
-
return className;
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* @param {string} code
|
|
201
|
-
* @param {string | undefined} [main_override]
|
|
202
|
-
* @returns {string}
|
|
203
|
-
*/
|
|
204
|
-
export function parse_deno(code, main_override) {
|
|
205
|
-
let deferred3_0;
|
|
206
|
-
let deferred3_1;
|
|
207
|
-
try {
|
|
208
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
209
|
-
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
210
|
-
const len0 = WASM_VECTOR_LEN;
|
|
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);
|
|
216
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
217
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
218
|
-
deferred3_0 = r0;
|
|
219
|
-
deferred3_1 = r1;
|
|
220
|
-
return getStringFromWasm0(r0, r1);
|
|
221
|
-
}
|
|
222
|
-
finally {
|
|
223
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
224
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* @param {string} code
|
|
229
|
-
* @returns {string}
|
|
230
|
-
*/
|
|
231
|
-
export function parse_outputs(code) {
|
|
232
|
-
let deferred2_0;
|
|
233
|
-
let deferred2_1;
|
|
234
|
-
try {
|
|
235
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
236
|
-
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
237
|
-
const len0 = WASM_VECTOR_LEN;
|
|
238
|
-
wasm.parse_outputs(retptr, ptr0, len0);
|
|
239
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
240
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
241
|
-
deferred2_0 = r0;
|
|
242
|
-
deferred2_1 = r1;
|
|
243
|
-
return getStringFromWasm0(r0, r1);
|
|
244
|
-
}
|
|
245
|
-
finally {
|
|
246
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
247
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* @param {string} code
|
|
252
|
-
* @returns {string}
|
|
253
|
-
*/
|
|
254
|
-
export function parse_ts_imports(code) {
|
|
255
|
-
let deferred2_0;
|
|
256
|
-
let deferred2_1;
|
|
257
|
-
try {
|
|
258
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
259
|
-
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
260
|
-
const len0 = WASM_VECTOR_LEN;
|
|
261
|
-
wasm.parse_ts_imports(retptr, ptr0, len0);
|
|
262
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
263
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
264
|
-
deferred2_0 = r0;
|
|
265
|
-
deferred2_1 = r1;
|
|
266
|
-
return getStringFromWasm0(r0, r1);
|
|
267
|
-
}
|
|
268
|
-
finally {
|
|
269
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
270
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* @param {string} code
|
|
275
|
-
* @returns {string}
|
|
276
|
-
*/
|
|
277
|
-
export function parse_bash(code) {
|
|
278
|
-
let deferred2_0;
|
|
279
|
-
let deferred2_1;
|
|
280
|
-
try {
|
|
281
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
282
|
-
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
283
|
-
const len0 = WASM_VECTOR_LEN;
|
|
284
|
-
wasm.parse_bash(retptr, ptr0, len0);
|
|
285
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
286
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
287
|
-
deferred2_0 = r0;
|
|
288
|
-
deferred2_1 = r1;
|
|
289
|
-
return getStringFromWasm0(r0, r1);
|
|
290
|
-
}
|
|
291
|
-
finally {
|
|
292
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
293
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* @param {string} code
|
|
298
|
-
* @returns {string}
|
|
299
|
-
*/
|
|
300
|
-
export function parse_powershell(code) {
|
|
301
|
-
let deferred2_0;
|
|
302
|
-
let deferred2_1;
|
|
303
|
-
try {
|
|
304
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
305
|
-
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
306
|
-
const len0 = WASM_VECTOR_LEN;
|
|
307
|
-
wasm.parse_powershell(retptr, ptr0, len0);
|
|
308
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
309
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
310
|
-
deferred2_0 = r0;
|
|
311
|
-
deferred2_1 = r1;
|
|
312
|
-
return getStringFromWasm0(r0, r1);
|
|
313
|
-
}
|
|
314
|
-
finally {
|
|
315
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
316
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
/**
|
|
320
|
-
* @param {string} code
|
|
321
|
-
* @returns {string}
|
|
322
|
-
*/
|
|
323
|
-
export function parse_go(code) {
|
|
324
|
-
let deferred2_0;
|
|
325
|
-
let deferred2_1;
|
|
326
|
-
try {
|
|
327
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
328
|
-
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
329
|
-
const len0 = WASM_VECTOR_LEN;
|
|
330
|
-
wasm.parse_go(retptr, ptr0, len0);
|
|
331
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
332
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
333
|
-
deferred2_0 = r0;
|
|
334
|
-
deferred2_1 = r1;
|
|
335
|
-
return getStringFromWasm0(r0, r1);
|
|
336
|
-
}
|
|
337
|
-
finally {
|
|
338
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
339
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
/**
|
|
343
|
-
* @param {string} code
|
|
344
|
-
* @param {string | undefined} [main_override]
|
|
345
|
-
* @returns {string}
|
|
346
|
-
*/
|
|
347
|
-
export function parse_python(code, main_override) {
|
|
348
|
-
let deferred3_0;
|
|
349
|
-
let deferred3_1;
|
|
350
|
-
try {
|
|
351
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
352
|
-
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
353
|
-
const len0 = WASM_VECTOR_LEN;
|
|
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);
|
|
359
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
360
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
361
|
-
deferred3_0 = r0;
|
|
362
|
-
deferred3_1 = r1;
|
|
363
|
-
return getStringFromWasm0(r0, r1);
|
|
364
|
-
}
|
|
365
|
-
finally {
|
|
366
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
367
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
/**
|
|
371
|
-
* @param {string} code
|
|
372
|
-
* @returns {string}
|
|
373
|
-
*/
|
|
374
|
-
export function parse_sql(code) {
|
|
375
|
-
let deferred2_0;
|
|
376
|
-
let deferred2_1;
|
|
377
|
-
try {
|
|
378
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
379
|
-
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
380
|
-
const len0 = WASM_VECTOR_LEN;
|
|
381
|
-
wasm.parse_sql(retptr, ptr0, len0);
|
|
382
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
383
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
384
|
-
deferred2_0 = r0;
|
|
385
|
-
deferred2_1 = r1;
|
|
386
|
-
return getStringFromWasm0(r0, r1);
|
|
387
|
-
}
|
|
388
|
-
finally {
|
|
389
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
390
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
/**
|
|
394
|
-
* @param {string} code
|
|
395
|
-
* @returns {string}
|
|
396
|
-
*/
|
|
397
|
-
export function parse_mysql(code) {
|
|
398
|
-
let deferred2_0;
|
|
399
|
-
let deferred2_1;
|
|
400
|
-
try {
|
|
401
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
402
|
-
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
403
|
-
const len0 = WASM_VECTOR_LEN;
|
|
404
|
-
wasm.parse_mysql(retptr, ptr0, len0);
|
|
405
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
406
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
407
|
-
deferred2_0 = r0;
|
|
408
|
-
deferred2_1 = r1;
|
|
409
|
-
return getStringFromWasm0(r0, r1);
|
|
410
|
-
}
|
|
411
|
-
finally {
|
|
412
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
413
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
/**
|
|
417
|
-
* @param {string} code
|
|
418
|
-
* @returns {string}
|
|
419
|
-
*/
|
|
420
|
-
export function parse_oracledb(code) {
|
|
421
|
-
let deferred2_0;
|
|
422
|
-
let deferred2_1;
|
|
423
|
-
try {
|
|
424
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
425
|
-
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
426
|
-
const len0 = WASM_VECTOR_LEN;
|
|
427
|
-
wasm.parse_oracledb(retptr, ptr0, len0);
|
|
428
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
429
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
430
|
-
deferred2_0 = r0;
|
|
431
|
-
deferred2_1 = r1;
|
|
432
|
-
return getStringFromWasm0(r0, r1);
|
|
433
|
-
}
|
|
434
|
-
finally {
|
|
435
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
436
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
/**
|
|
440
|
-
* @param {string} code
|
|
441
|
-
* @returns {string}
|
|
442
|
-
*/
|
|
443
|
-
export function parse_bigquery(code) {
|
|
444
|
-
let deferred2_0;
|
|
445
|
-
let deferred2_1;
|
|
446
|
-
try {
|
|
447
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
448
|
-
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
449
|
-
const len0 = WASM_VECTOR_LEN;
|
|
450
|
-
wasm.parse_bigquery(retptr, ptr0, len0);
|
|
451
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
452
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
453
|
-
deferred2_0 = r0;
|
|
454
|
-
deferred2_1 = r1;
|
|
455
|
-
return getStringFromWasm0(r0, r1);
|
|
456
|
-
}
|
|
457
|
-
finally {
|
|
458
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
459
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
/**
|
|
463
|
-
* @param {string} code
|
|
464
|
-
* @returns {string}
|
|
465
|
-
*/
|
|
466
|
-
export function parse_snowflake(code) {
|
|
467
|
-
let deferred2_0;
|
|
468
|
-
let deferred2_1;
|
|
469
|
-
try {
|
|
470
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
471
|
-
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
472
|
-
const len0 = WASM_VECTOR_LEN;
|
|
473
|
-
wasm.parse_snowflake(retptr, ptr0, len0);
|
|
474
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
475
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
476
|
-
deferred2_0 = r0;
|
|
477
|
-
deferred2_1 = r1;
|
|
478
|
-
return getStringFromWasm0(r0, r1);
|
|
479
|
-
}
|
|
480
|
-
finally {
|
|
481
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
482
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
/**
|
|
486
|
-
* @param {string} code
|
|
487
|
-
* @returns {string}
|
|
488
|
-
*/
|
|
489
|
-
export function parse_mssql(code) {
|
|
490
|
-
let deferred2_0;
|
|
491
|
-
let deferred2_1;
|
|
492
|
-
try {
|
|
493
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
494
|
-
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
495
|
-
const len0 = WASM_VECTOR_LEN;
|
|
496
|
-
wasm.parse_mssql(retptr, ptr0, len0);
|
|
497
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
498
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
499
|
-
deferred2_0 = r0;
|
|
500
|
-
deferred2_1 = r1;
|
|
501
|
-
return getStringFromWasm0(r0, r1);
|
|
502
|
-
}
|
|
503
|
-
finally {
|
|
504
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
505
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
/**
|
|
509
|
-
* @param {string} code
|
|
510
|
-
* @returns {string | undefined}
|
|
511
|
-
*/
|
|
512
|
-
export function parse_db_resource(code) {
|
|
513
|
-
try {
|
|
514
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
515
|
-
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
516
|
-
const len0 = WASM_VECTOR_LEN;
|
|
517
|
-
wasm.parse_db_resource(retptr, ptr0, len0);
|
|
518
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
519
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
520
|
-
let v2;
|
|
521
|
-
if (r0 !== 0) {
|
|
522
|
-
v2 = getStringFromWasm0(r0, r1).slice();
|
|
523
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
524
|
-
}
|
|
525
|
-
return v2;
|
|
526
|
-
}
|
|
527
|
-
finally {
|
|
528
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
/**
|
|
532
|
-
* @param {string} code
|
|
533
|
-
* @returns {string}
|
|
534
|
-
*/
|
|
535
|
-
export function parse_graphql(code) {
|
|
536
|
-
let deferred2_0;
|
|
537
|
-
let deferred2_1;
|
|
538
|
-
try {
|
|
539
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
540
|
-
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
541
|
-
const len0 = WASM_VECTOR_LEN;
|
|
542
|
-
wasm.parse_graphql(retptr, ptr0, len0);
|
|
543
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
544
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
545
|
-
deferred2_0 = r0;
|
|
546
|
-
deferred2_1 = r1;
|
|
547
|
-
return getStringFromWasm0(r0, r1);
|
|
548
|
-
}
|
|
549
|
-
finally {
|
|
550
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
551
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
/**
|
|
555
|
-
* @param {string} code
|
|
556
|
-
* @returns {string}
|
|
557
|
-
*/
|
|
558
|
-
export function parse_php(code) {
|
|
559
|
-
let deferred2_0;
|
|
560
|
-
let deferred2_1;
|
|
561
|
-
try {
|
|
562
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
563
|
-
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
564
|
-
const len0 = WASM_VECTOR_LEN;
|
|
565
|
-
wasm.parse_php(retptr, ptr0, len0);
|
|
566
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
567
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
568
|
-
deferred2_0 = r0;
|
|
569
|
-
deferred2_1 = r1;
|
|
570
|
-
return getStringFromWasm0(r0, r1);
|
|
571
|
-
}
|
|
572
|
-
finally {
|
|
573
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
574
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
/**
|
|
578
|
-
* @param {string} code
|
|
579
|
-
* @returns {string}
|
|
580
|
-
*/
|
|
581
|
-
export function parse_rust(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_rust(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
|
-
}
|
|
600
|
-
/**
|
|
601
|
-
* @param {string} code
|
|
602
|
-
* @returns {string}
|
|
603
|
-
*/
|
|
604
|
-
export function parse_ansible(code) {
|
|
605
|
-
let deferred2_0;
|
|
606
|
-
let deferred2_1;
|
|
607
|
-
try {
|
|
608
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
609
|
-
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
610
|
-
const len0 = WASM_VECTOR_LEN;
|
|
611
|
-
wasm.parse_ansible(retptr, ptr0, len0);
|
|
612
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
613
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
614
|
-
deferred2_0 = r0;
|
|
615
|
-
deferred2_1 = r1;
|
|
616
|
-
return getStringFromWasm0(r0, r1);
|
|
617
|
-
}
|
|
618
|
-
finally {
|
|
619
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
620
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
/**
|
|
624
|
-
* @param {string} code
|
|
625
|
-
* @returns {string}
|
|
626
|
-
*/
|
|
627
|
-
export function parse_csharp(code) {
|
|
628
|
-
let deferred2_0;
|
|
629
|
-
let deferred2_1;
|
|
630
|
-
try {
|
|
631
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
632
|
-
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
633
|
-
const len0 = WASM_VECTOR_LEN;
|
|
634
|
-
wasm.parse_csharp(retptr, ptr0, len0);
|
|
635
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
636
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
637
|
-
deferred2_0 = r0;
|
|
638
|
-
deferred2_1 = r1;
|
|
639
|
-
return getStringFromWasm0(r0, r1);
|
|
640
|
-
}
|
|
641
|
-
finally {
|
|
642
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
643
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
function handleError(f, args) {
|
|
647
|
-
try {
|
|
648
|
-
return f.apply(this, args);
|
|
649
|
-
}
|
|
650
|
-
catch (e) {
|
|
651
|
-
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
const imports = {
|
|
655
|
-
__wbindgen_placeholder__: {
|
|
656
|
-
__wbg_get_bd8e338fbd5f5cc8: function (arg0, arg1) {
|
|
657
|
-
const ret = getObject(arg0)[arg1 >>> 0];
|
|
658
|
-
return addHeapObject(ret);
|
|
659
|
-
},
|
|
660
|
-
__wbg_length_cd7af8117672b8b8: function (arg0) {
|
|
661
|
-
const ret = getObject(arg0).length;
|
|
662
|
-
return ret;
|
|
663
|
-
},
|
|
664
|
-
__wbindgen_is_object: function (arg0) {
|
|
665
|
-
const val = getObject(arg0);
|
|
666
|
-
const ret = typeof val === "object" && val !== null;
|
|
667
|
-
return ret;
|
|
668
|
-
},
|
|
669
|
-
__wbg_next_40fc327bfc8770e6: function (arg0) {
|
|
670
|
-
const ret = getObject(arg0).next;
|
|
671
|
-
return addHeapObject(ret);
|
|
672
|
-
},
|
|
673
|
-
__wbindgen_is_function: function (arg0) {
|
|
674
|
-
const ret = typeof (getObject(arg0)) === "function";
|
|
675
|
-
return ret;
|
|
676
|
-
},
|
|
677
|
-
__wbindgen_object_drop_ref: function (arg0) {
|
|
678
|
-
takeObject(arg0);
|
|
679
|
-
},
|
|
680
|
-
__wbg_next_196c84450b364254: function () {
|
|
681
|
-
return handleError(function (arg0) {
|
|
682
|
-
const ret = getObject(arg0).next();
|
|
683
|
-
return addHeapObject(ret);
|
|
684
|
-
}, arguments);
|
|
685
|
-
},
|
|
686
|
-
__wbg_done_298b57d23c0fc80c: function (arg0) {
|
|
687
|
-
const ret = getObject(arg0).done;
|
|
688
|
-
return ret;
|
|
689
|
-
},
|
|
690
|
-
__wbg_value_d93c65011f51a456: function (arg0) {
|
|
691
|
-
const ret = getObject(arg0).value;
|
|
692
|
-
return addHeapObject(ret);
|
|
693
|
-
},
|
|
694
|
-
__wbg_iterator_2cee6dadfd956dfa: function () {
|
|
695
|
-
const ret = Symbol.iterator;
|
|
696
|
-
return addHeapObject(ret);
|
|
697
|
-
},
|
|
698
|
-
__wbg_get_e3c254076557e348: function () {
|
|
699
|
-
return handleError(function (arg0, arg1) {
|
|
700
|
-
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
701
|
-
return addHeapObject(ret);
|
|
702
|
-
}, arguments);
|
|
703
|
-
},
|
|
704
|
-
__wbg_call_27c0f87801dedf93: function () {
|
|
705
|
-
return handleError(function (arg0, arg1) {
|
|
706
|
-
const ret = getObject(arg0).call(getObject(arg1));
|
|
707
|
-
return addHeapObject(ret);
|
|
708
|
-
}, arguments);
|
|
709
|
-
},
|
|
710
|
-
__wbg_isArray_2ab64d95e09ea0ae: function (arg0) {
|
|
711
|
-
const ret = Array.isArray(getObject(arg0));
|
|
712
|
-
return ret;
|
|
713
|
-
},
|
|
714
|
-
__wbg_instanceof_ArrayBuffer_836825be07d4c9d2: function (arg0) {
|
|
715
|
-
let result;
|
|
716
|
-
try {
|
|
717
|
-
result = getObject(arg0) instanceof ArrayBuffer;
|
|
718
|
-
}
|
|
719
|
-
catch (_) {
|
|
720
|
-
result = false;
|
|
721
|
-
}
|
|
722
|
-
const ret = result;
|
|
723
|
-
return ret;
|
|
724
|
-
},
|
|
725
|
-
__wbg_instanceof_Map_87917e0a7aaf4012: function (arg0) {
|
|
726
|
-
let result;
|
|
727
|
-
try {
|
|
728
|
-
result = getObject(arg0) instanceof Map;
|
|
729
|
-
}
|
|
730
|
-
catch (_) {
|
|
731
|
-
result = false;
|
|
732
|
-
}
|
|
733
|
-
const ret = result;
|
|
734
|
-
return ret;
|
|
735
|
-
},
|
|
736
|
-
__wbg_isSafeInteger_f7b04ef02296c4d2: function (arg0) {
|
|
737
|
-
const ret = Number.isSafeInteger(getObject(arg0));
|
|
738
|
-
return ret;
|
|
739
|
-
},
|
|
740
|
-
__wbg_entries_95cc2c823b285a09: function (arg0) {
|
|
741
|
-
const ret = Object.entries(getObject(arg0));
|
|
742
|
-
return addHeapObject(ret);
|
|
743
|
-
},
|
|
744
|
-
__wbindgen_memory: function () {
|
|
745
|
-
const ret = wasm.memory;
|
|
746
|
-
return addHeapObject(ret);
|
|
747
|
-
},
|
|
748
|
-
__wbg_buffer_12d079cc21e14bdb: function (arg0) {
|
|
749
|
-
const ret = getObject(arg0).buffer;
|
|
750
|
-
return addHeapObject(ret);
|
|
751
|
-
},
|
|
752
|
-
__wbg_new_63b92bc8671ed464: function (arg0) {
|
|
753
|
-
const ret = new Uint8Array(getObject(arg0));
|
|
754
|
-
return addHeapObject(ret);
|
|
755
|
-
},
|
|
756
|
-
__wbg_set_a47bac70306a19a7: function (arg0, arg1, arg2) {
|
|
757
|
-
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
758
|
-
},
|
|
759
|
-
__wbg_length_c20a40f15020d68a: function (arg0) {
|
|
760
|
-
const ret = getObject(arg0).length;
|
|
761
|
-
return ret;
|
|
762
|
-
},
|
|
763
|
-
__wbg_instanceof_Uint8Array_2b3bbecd033d19f6: function (arg0) {
|
|
764
|
-
let result;
|
|
765
|
-
try {
|
|
766
|
-
result = getObject(arg0) instanceof Uint8Array;
|
|
767
|
-
}
|
|
768
|
-
catch (_) {
|
|
769
|
-
result = false;
|
|
770
|
-
}
|
|
771
|
-
const ret = result;
|
|
772
|
-
return ret;
|
|
773
|
-
},
|
|
774
|
-
__wbindgen_error_new: function (arg0, arg1) {
|
|
775
|
-
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
776
|
-
return addHeapObject(ret);
|
|
777
|
-
},
|
|
778
|
-
__wbindgen_jsval_loose_eq: function (arg0, arg1) {
|
|
779
|
-
const ret = getObject(arg0) == getObject(arg1);
|
|
780
|
-
return ret;
|
|
781
|
-
},
|
|
782
|
-
__wbindgen_boolean_get: function (arg0) {
|
|
783
|
-
const v = getObject(arg0);
|
|
784
|
-
const ret = typeof v === "boolean" ? (v ? 1 : 0) : 2;
|
|
785
|
-
return ret;
|
|
786
|
-
},
|
|
787
|
-
__wbindgen_number_get: function (arg0, arg1) {
|
|
788
|
-
const obj = getObject(arg1);
|
|
789
|
-
const ret = typeof obj === "number" ? obj : undefined;
|
|
790
|
-
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
791
|
-
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
792
|
-
},
|
|
793
|
-
__wbindgen_string_get: function (arg0, arg1) {
|
|
794
|
-
const obj = getObject(arg1);
|
|
795
|
-
const ret = typeof obj === "string" ? obj : undefined;
|
|
796
|
-
var ptr1 = isLikeNone(ret)
|
|
797
|
-
? 0
|
|
798
|
-
: passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
799
|
-
var len1 = WASM_VECTOR_LEN;
|
|
800
|
-
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
801
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
802
|
-
},
|
|
803
|
-
__wbindgen_bigint_get_as_i64: function (arg0, arg1) {
|
|
804
|
-
const v = getObject(arg1);
|
|
805
|
-
const ret = typeof v === "bigint" ? v : undefined;
|
|
806
|
-
getBigInt64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? BigInt(0) : ret;
|
|
807
|
-
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
808
|
-
},
|
|
809
|
-
__wbindgen_debug_string: function (arg0, arg1) {
|
|
810
|
-
const ret = debugString(getObject(arg1));
|
|
811
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
812
|
-
const len1 = WASM_VECTOR_LEN;
|
|
813
|
-
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
814
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
815
|
-
},
|
|
816
|
-
__wbindgen_throw: function (arg0, arg1) {
|
|
817
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
818
|
-
},
|
|
819
|
-
__wbindgen_is_bigint: function (arg0) {
|
|
820
|
-
const ret = typeof (getObject(arg0)) === "bigint";
|
|
821
|
-
return ret;
|
|
822
|
-
},
|
|
823
|
-
__wbindgen_in: function (arg0, arg1) {
|
|
824
|
-
const ret = getObject(arg0) in getObject(arg1);
|
|
825
|
-
return ret;
|
|
826
|
-
},
|
|
827
|
-
__wbindgen_bigint_from_i64: function (arg0) {
|
|
828
|
-
const ret = arg0;
|
|
829
|
-
return addHeapObject(ret);
|
|
830
|
-
},
|
|
831
|
-
__wbindgen_jsval_eq: function (arg0, arg1) {
|
|
832
|
-
const ret = getObject(arg0) === getObject(arg1);
|
|
833
|
-
return ret;
|
|
834
|
-
},
|
|
835
|
-
__wbindgen_bigint_from_u64: function (arg0) {
|
|
836
|
-
const ret = BigInt.asUintN(64, arg0);
|
|
837
|
-
return addHeapObject(ret);
|
|
838
|
-
},
|
|
839
|
-
__wbg_eval_73a4cb0af5990ab1: function (arg0, arg1) {
|
|
840
|
-
const ret = eval(getStringFromWasm0(arg0, arg1));
|
|
841
|
-
return addHeapObject(ret);
|
|
842
|
-
},
|
|
843
|
-
},
|
|
844
|
-
};
|
|
845
|
-
class WasmBuildLoader {
|
|
846
|
-
constructor(options) {
|
|
847
|
-
_WasmBuildLoader_instances.add(this);
|
|
848
|
-
_WasmBuildLoader_options.set(this, void 0);
|
|
849
|
-
_WasmBuildLoader_lastLoadPromise.set(this, void 0);
|
|
850
|
-
_WasmBuildLoader_instantiated.set(this, void 0);
|
|
851
|
-
__classPrivateFieldSet(this, _WasmBuildLoader_options, options, "f");
|
|
852
|
-
}
|
|
853
|
-
get instance() {
|
|
854
|
-
return __classPrivateFieldGet(this, _WasmBuildLoader_instantiated, "f")?.instance;
|
|
855
|
-
}
|
|
856
|
-
get module() {
|
|
857
|
-
return __classPrivateFieldGet(this, _WasmBuildLoader_instantiated, "f")?.module;
|
|
858
|
-
}
|
|
859
|
-
load(url, decompress) {
|
|
860
|
-
if (__classPrivateFieldGet(this, _WasmBuildLoader_instantiated, "f")) {
|
|
861
|
-
return Promise.resolve(__classPrivateFieldGet(this, _WasmBuildLoader_instantiated, "f"));
|
|
862
|
-
}
|
|
863
|
-
else if (__classPrivateFieldGet(this, _WasmBuildLoader_lastLoadPromise, "f") == null) {
|
|
864
|
-
__classPrivateFieldSet(this, _WasmBuildLoader_lastLoadPromise, (async () => {
|
|
865
|
-
try {
|
|
866
|
-
__classPrivateFieldSet(this, _WasmBuildLoader_instantiated, await __classPrivateFieldGet(this, _WasmBuildLoader_instances, "m", _WasmBuildLoader_instantiate).call(this, url, decompress), "f");
|
|
867
|
-
return __classPrivateFieldGet(this, _WasmBuildLoader_instantiated, "f");
|
|
868
|
-
}
|
|
869
|
-
finally {
|
|
870
|
-
__classPrivateFieldSet(this, _WasmBuildLoader_lastLoadPromise, undefined, "f");
|
|
871
|
-
}
|
|
872
|
-
})(), "f");
|
|
873
|
-
}
|
|
874
|
-
return __classPrivateFieldGet(this, _WasmBuildLoader_lastLoadPromise, "f");
|
|
875
|
-
}
|
|
876
|
-
}
|
|
877
|
-
_WasmBuildLoader_options = new WeakMap(), _WasmBuildLoader_lastLoadPromise = new WeakMap(), _WasmBuildLoader_instantiated = new WeakMap(), _WasmBuildLoader_instances = new WeakSet(), _WasmBuildLoader_instantiate = async function _WasmBuildLoader_instantiate(url, decompress) {
|
|
878
|
-
const imports = __classPrivateFieldGet(this, _WasmBuildLoader_options, "f").imports;
|
|
879
|
-
if (__classPrivateFieldGet(this, _WasmBuildLoader_options, "f").cache != null && url.protocol !== "file:") {
|
|
880
|
-
try {
|
|
881
|
-
const result = await __classPrivateFieldGet(this, _WasmBuildLoader_options, "f").cache(url, decompress ?? ((bytes) => bytes));
|
|
882
|
-
if (result instanceof URL) {
|
|
883
|
-
url = result;
|
|
884
|
-
decompress = undefined; // already decompressed
|
|
885
|
-
}
|
|
886
|
-
else if (result != null) {
|
|
887
|
-
return WebAssembly.instantiate(result, imports);
|
|
888
|
-
}
|
|
889
|
-
}
|
|
890
|
-
catch {
|
|
891
|
-
// ignore if caching ever fails (ex. when on deploy)
|
|
892
|
-
}
|
|
893
|
-
}
|
|
894
|
-
const isFile = url.protocol === "file:";
|
|
895
|
-
// make file urls work in Node via dnt
|
|
896
|
-
const isNode = globalThis.process?.versions?.node != null;
|
|
897
|
-
if (isFile && typeof dntShim.Deno !== "object") {
|
|
898
|
-
throw new Error("Loading local files are not supported in this environment");
|
|
899
|
-
}
|
|
900
|
-
if (isNode && isFile) {
|
|
901
|
-
// the deno global will be shimmed by dnt
|
|
902
|
-
const wasmCode = await dntShim.Deno.readFile(url);
|
|
903
|
-
return WebAssembly.instantiate(decompress ? decompress(wasmCode) : wasmCode, imports);
|
|
904
|
-
}
|
|
905
|
-
switch (url.protocol) {
|
|
906
|
-
case "file:":
|
|
907
|
-
case "https:":
|
|
908
|
-
case "http:": {
|
|
909
|
-
const wasmResponse = await fetchWithRetries(url);
|
|
910
|
-
if (decompress) {
|
|
911
|
-
const wasmCode = new Uint8Array(await wasmResponse.arrayBuffer());
|
|
912
|
-
return WebAssembly.instantiate(decompress(wasmCode), imports);
|
|
913
|
-
}
|
|
914
|
-
if (isFile ||
|
|
915
|
-
wasmResponse.headers.get("content-type")?.toLowerCase()
|
|
916
|
-
.startsWith("application/wasm")) {
|
|
917
|
-
return WebAssembly.instantiateStreaming(wasmResponse, imports);
|
|
918
|
-
}
|
|
919
|
-
else {
|
|
920
|
-
return WebAssembly.instantiate(await wasmResponse.arrayBuffer(), imports);
|
|
921
|
-
}
|
|
922
|
-
}
|
|
923
|
-
default:
|
|
924
|
-
throw new Error(`Unsupported protocol: ${url.protocol}`);
|
|
925
|
-
}
|
|
926
|
-
};
|
|
927
|
-
const isNodeOrDeno = typeof dntShim.Deno === "object" ||
|
|
928
|
-
(typeof process !== "undefined" && process.versions != null &&
|
|
929
|
-
process.versions.node != null);
|
|
930
|
-
const loader = new WasmBuildLoader({
|
|
931
|
-
imports,
|
|
932
|
-
cache: isNodeOrDeno ? cacheToLocalDir : undefined,
|
|
933
|
-
});
|
|
934
|
-
export async function instantiate(opts) {
|
|
935
|
-
return (await instantiateWithInstance(opts)).exports;
|
|
936
|
-
}
|
|
937
|
-
export async function instantiateWithInstance(opts) {
|
|
938
|
-
const { instance } = await loader.load(opts?.url ?? new URL("windmill_parser_wasm_bg.wasm", import.meta.url), opts?.decompress);
|
|
939
|
-
wasm = wasm ?? instance.exports;
|
|
940
|
-
cachedInt32Memory0 = cachedInt32Memory0 ?? new Int32Array(wasm.memory.buffer);
|
|
941
|
-
cachedUint8Memory0 = cachedUint8Memory0 ?? new Uint8Array(wasm.memory.buffer);
|
|
942
|
-
return {
|
|
943
|
-
instance,
|
|
944
|
-
exports: getWasmInstanceExports(),
|
|
945
|
-
};
|
|
946
|
-
}
|
|
947
|
-
function getWasmInstanceExports() {
|
|
948
|
-
return {
|
|
949
|
-
parse_deno,
|
|
950
|
-
parse_outputs,
|
|
951
|
-
parse_ts_imports,
|
|
952
|
-
parse_bash,
|
|
953
|
-
parse_powershell,
|
|
954
|
-
parse_go,
|
|
955
|
-
parse_python,
|
|
956
|
-
parse_sql,
|
|
957
|
-
parse_mysql,
|
|
958
|
-
parse_oracledb,
|
|
959
|
-
parse_bigquery,
|
|
960
|
-
parse_snowflake,
|
|
961
|
-
parse_mssql,
|
|
962
|
-
parse_db_resource,
|
|
963
|
-
parse_graphql,
|
|
964
|
-
parse_php,
|
|
965
|
-
parse_rust,
|
|
966
|
-
parse_ansible,
|
|
967
|
-
parse_csharp,
|
|
968
|
-
};
|
|
969
|
-
}
|
|
970
|
-
export function isInstantiated() {
|
|
971
|
-
return loader.instance != null;
|
|
972
|
-
}
|
|
973
|
-
export async function cacheToLocalDir(url, decompress) {
|
|
974
|
-
const localPath = await getUrlLocalPath(url);
|
|
975
|
-
if (localPath == null) {
|
|
976
|
-
return undefined;
|
|
977
|
-
}
|
|
978
|
-
if (!await exists(localPath)) {
|
|
979
|
-
const fileBytes = decompress(new Uint8Array(await getUrlBytes(url)));
|
|
980
|
-
try {
|
|
981
|
-
await dntShim.Deno.writeFile(localPath, fileBytes);
|
|
982
|
-
}
|
|
983
|
-
catch {
|
|
984
|
-
// ignore and return the wasm bytes
|
|
985
|
-
return fileBytes;
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
return toFileUrl(localPath);
|
|
989
|
-
}
|
|
990
|
-
async function getUrlLocalPath(url) {
|
|
991
|
-
try {
|
|
992
|
-
const dataDirPath = await getInitializedLocalDataDirPath();
|
|
993
|
-
const hash = await getUrlHash(url);
|
|
994
|
-
return `${dataDirPath}/${hash}.wasm`;
|
|
995
|
-
}
|
|
996
|
-
catch {
|
|
997
|
-
return undefined;
|
|
998
|
-
}
|
|
999
|
-
}
|
|
1000
|
-
async function getInitializedLocalDataDirPath() {
|
|
1001
|
-
const dataDir = localDataDir();
|
|
1002
|
-
if (dataDir == null) {
|
|
1003
|
-
throw new Error(`Could not find local data directory.`);
|
|
1004
|
-
}
|
|
1005
|
-
const dirPath = `${dataDir}/deno-wasmbuild`;
|
|
1006
|
-
await ensureDir(dirPath);
|
|
1007
|
-
return dirPath;
|
|
1008
|
-
}
|
|
1009
|
-
async function exists(filePath) {
|
|
1010
|
-
try {
|
|
1011
|
-
await dntShim.Deno.lstat(filePath);
|
|
1012
|
-
return true;
|
|
1013
|
-
}
|
|
1014
|
-
catch (error) {
|
|
1015
|
-
if (error instanceof dntShim.Deno.errors.NotFound) {
|
|
1016
|
-
return false;
|
|
1017
|
-
}
|
|
1018
|
-
throw error;
|
|
1019
|
-
}
|
|
1020
|
-
}
|
|
1021
|
-
async function ensureDir(dir) {
|
|
1022
|
-
try {
|
|
1023
|
-
const fileInfo = await dntShim.Deno.lstat(dir);
|
|
1024
|
-
if (!fileInfo.isDirectory) {
|
|
1025
|
-
throw new Error(`Path was not a directory '${dir}'`);
|
|
1026
|
-
}
|
|
1027
|
-
}
|
|
1028
|
-
catch (err) {
|
|
1029
|
-
if (err instanceof dntShim.Deno.errors.NotFound) {
|
|
1030
|
-
// if dir not exists. then create it.
|
|
1031
|
-
await dntShim.Deno.mkdir(dir, { recursive: true });
|
|
1032
|
-
return;
|
|
1033
|
-
}
|
|
1034
|
-
throw err;
|
|
1035
|
-
}
|
|
1036
|
-
}
|
|
1037
|
-
async function getUrlHash(url) {
|
|
1038
|
-
// Taken from MDN: https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest
|
|
1039
|
-
const hashBuffer = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(url.href));
|
|
1040
|
-
// convert buffer to byte array
|
|
1041
|
-
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
1042
|
-
// convert bytes to hex string
|
|
1043
|
-
const hashHex = hashArray
|
|
1044
|
-
.map((b) => b.toString(16).padStart(2, "0"))
|
|
1045
|
-
.join("");
|
|
1046
|
-
return hashHex;
|
|
1047
|
-
}
|
|
1048
|
-
async function getUrlBytes(url) {
|
|
1049
|
-
const response = await fetchWithRetries(url);
|
|
1050
|
-
return await response.arrayBuffer();
|
|
1051
|
-
}
|
|
1052
|
-
// the below is extracted from deno_std/path
|
|
1053
|
-
const WHITESPACE_ENCODINGS = {
|
|
1054
|
-
"\u0009": "%09",
|
|
1055
|
-
"\u000A": "%0A",
|
|
1056
|
-
"\u000B": "%0B",
|
|
1057
|
-
"\u000C": "%0C",
|
|
1058
|
-
"\u000D": "%0D",
|
|
1059
|
-
"\u0020": "%20",
|
|
1060
|
-
};
|
|
1061
|
-
function encodeWhitespace(string) {
|
|
1062
|
-
return string.replaceAll(/[\s]/g, (c) => {
|
|
1063
|
-
return WHITESPACE_ENCODINGS[c] ?? c;
|
|
1064
|
-
});
|
|
1065
|
-
}
|
|
1066
|
-
function toFileUrl(path) {
|
|
1067
|
-
return dntShim.Deno.build.os === "windows"
|
|
1068
|
-
? windowsToFileUrl(path)
|
|
1069
|
-
: posixToFileUrl(path);
|
|
1070
|
-
}
|
|
1071
|
-
function posixToFileUrl(path) {
|
|
1072
|
-
const url = new URL("file:///");
|
|
1073
|
-
url.pathname = encodeWhitespace(path.replace(/%/g, "%25").replace(/\\/g, "%5C"));
|
|
1074
|
-
return url;
|
|
1075
|
-
}
|
|
1076
|
-
function windowsToFileUrl(path) {
|
|
1077
|
-
const [, hostname, pathname] = path.match(/^(?:[/\\]{2}([^/\\]+)(?=[/\\](?:[^/\\]|$)))?(.*)/);
|
|
1078
|
-
const url = new URL("file:///");
|
|
1079
|
-
url.pathname = encodeWhitespace(pathname.replace(/%/g, "%25"));
|
|
1080
|
-
if (hostname != null && hostname != "localhost") {
|
|
1081
|
-
url.hostname = hostname;
|
|
1082
|
-
if (!url.hostname) {
|
|
1083
|
-
throw new TypeError("Invalid hostname.");
|
|
1084
|
-
}
|
|
1085
|
-
}
|
|
1086
|
-
return url;
|
|
1087
|
-
}
|
|
1088
|
-
export async function fetchWithRetries(url, maxRetries = 5) {
|
|
1089
|
-
let sleepMs = 250;
|
|
1090
|
-
let iterationCount = 0;
|
|
1091
|
-
while (true) {
|
|
1092
|
-
iterationCount++;
|
|
1093
|
-
try {
|
|
1094
|
-
const res = await fetch(url);
|
|
1095
|
-
if (res.ok || iterationCount > maxRetries) {
|
|
1096
|
-
return res;
|
|
1097
|
-
}
|
|
1098
|
-
}
|
|
1099
|
-
catch (err) {
|
|
1100
|
-
if (iterationCount > maxRetries) {
|
|
1101
|
-
throw err;
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
console.warn(`Failed fetching. Retrying in ${sleepMs}ms...`);
|
|
1105
|
-
await new Promise((resolve) => setTimeout(resolve, sleepMs));
|
|
1106
|
-
sleepMs = Math.min(sleepMs * 2, 10000);
|
|
1107
|
-
}
|
|
1108
|
-
}
|
|
1109
|
-
// MIT License - Copyright (c) justjavac.
|
|
1110
|
-
// https://github.com/justjavac/deno_dirs/blob/e8c001bbef558f08fd486d444af391729b0b8068/data_local_dir/mod.ts
|
|
1111
|
-
function localDataDir() {
|
|
1112
|
-
switch (dntShim.Deno.build.os) {
|
|
1113
|
-
case "linux": {
|
|
1114
|
-
const xdg = dntShim.Deno.env.get("XDG_DATA_HOME");
|
|
1115
|
-
if (xdg) {
|
|
1116
|
-
return xdg;
|
|
1117
|
-
}
|
|
1118
|
-
const home = dntShim.Deno.env.get("HOME");
|
|
1119
|
-
if (home) {
|
|
1120
|
-
return `${home}/.local/share`;
|
|
1121
|
-
}
|
|
1122
|
-
break;
|
|
1123
|
-
}
|
|
1124
|
-
case "darwin": {
|
|
1125
|
-
const home = dntShim.Deno.env.get("HOME");
|
|
1126
|
-
if (home) {
|
|
1127
|
-
return `${home}/Library/Application Support`;
|
|
1128
|
-
}
|
|
1129
|
-
break;
|
|
1130
|
-
}
|
|
1131
|
-
case "windows":
|
|
1132
|
-
return dntShim.Deno.env.get("LOCALAPPDATA") ?? undefined;
|
|
1133
|
-
}
|
|
1134
|
-
return undefined;
|
|
1135
|
-
}
|