windmill-parser-wasm-ts 1.538.0 → 1.589.3

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/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "collaborators": [
5
5
  "Ruben Fiszel <ruben@windmill.dev>"
6
6
  ],
7
- "version": "1.538.0",
7
+ "version": "1.589.3",
8
8
  "files": [
9
9
  "windmill_parser_wasm_bg.wasm",
10
10
  "windmill_parser_wasm.js",
@@ -1,7 +1,7 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export function parse_deno(code: string, main_override?: string | null): string;
4
3
  export function parse_outputs(code: string): string;
4
+ export function parse_deno(code: string, main_override?: string | null): string;
5
5
  export function parse_ts_imports(code: string): string;
6
6
  export function parse_assets_ts(code: string): string;
7
7
 
@@ -9,10 +9,10 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
9
9
 
10
10
  export interface InitOutput {
11
11
  readonly memory: WebAssembly.Memory;
12
+ readonly parse_assets_ts: (a: number, b: number) => [number, number];
12
13
  readonly parse_deno: (a: number, b: number, c: number, d: number) => [number, number];
13
14
  readonly parse_outputs: (a: number, b: number) => [number, number];
14
15
  readonly parse_ts_imports: (a: number, b: number) => [number, number];
15
- readonly parse_assets_ts: (a: number, b: number) => [number, number];
16
16
  readonly __wbindgen_exn_store: (a: number) => void;
17
17
  readonly __externref_table_alloc: () => number;
18
18
  readonly __wbindgen_export_2: WebAssembly.Table;
@@ -1,5 +1,35 @@
1
1
  let wasm;
2
2
 
3
+ let cachedUint8ArrayMemory0 = null;
4
+
5
+ function getUint8ArrayMemory0() {
6
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
7
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
8
+ }
9
+ return cachedUint8ArrayMemory0;
10
+ }
11
+
12
+ let cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
13
+
14
+ if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
15
+
16
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
17
+ let numBytesDecoded = 0;
18
+ function decodeText(ptr, len) {
19
+ numBytesDecoded += len;
20
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
21
+ cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
22
+ cachedTextDecoder.decode();
23
+ numBytesDecoded = len;
24
+ }
25
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
26
+ }
27
+
28
+ function getStringFromWasm0(ptr, len) {
29
+ ptr = ptr >>> 0;
30
+ return decodeText(ptr, len);
31
+ }
32
+
3
33
  function addToExternrefTable0(obj) {
4
34
  const idx = wasm.__externref_table_alloc();
5
35
  wasm.__wbindgen_export_2.set(idx, obj);
@@ -15,22 +45,9 @@ function handleError(f, args) {
15
45
  }
16
46
  }
17
47
 
18
- const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
19
-
20
- if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
21
-
22
- let cachedUint8ArrayMemory0 = null;
23
-
24
- function getUint8ArrayMemory0() {
25
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
26
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
27
- }
28
- return cachedUint8ArrayMemory0;
29
- }
30
-
31
- function getStringFromWasm0(ptr, len) {
48
+ function getArrayU8FromWasm0(ptr, len) {
32
49
  ptr = ptr >>> 0;
33
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
50
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
34
51
  }
35
52
 
36
53
  function isLikeNone(x) {
@@ -168,42 +185,42 @@ function passStringToWasm0(arg, malloc, realloc) {
168
185
  }
169
186
  /**
170
187
  * @param {string} code
171
- * @param {string | null} [main_override]
172
188
  * @returns {string}
173
189
  */
174
- export function parse_deno(code, main_override) {
175
- let deferred3_0;
176
- let deferred3_1;
190
+ export function parse_outputs(code) {
191
+ let deferred2_0;
192
+ let deferred2_1;
177
193
  try {
178
194
  const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
179
195
  const len0 = WASM_VECTOR_LEN;
180
- var ptr1 = isLikeNone(main_override) ? 0 : passStringToWasm0(main_override, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
181
- var len1 = WASM_VECTOR_LEN;
182
- const ret = wasm.parse_deno(ptr0, len0, ptr1, len1);
183
- deferred3_0 = ret[0];
184
- deferred3_1 = ret[1];
196
+ const ret = wasm.parse_outputs(ptr0, len0);
197
+ deferred2_0 = ret[0];
198
+ deferred2_1 = ret[1];
185
199
  return getStringFromWasm0(ret[0], ret[1]);
186
200
  } finally {
187
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
201
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
188
202
  }
189
203
  }
190
204
 
191
205
  /**
192
206
  * @param {string} code
207
+ * @param {string | null} [main_override]
193
208
  * @returns {string}
194
209
  */
195
- export function parse_outputs(code) {
196
- let deferred2_0;
197
- let deferred2_1;
210
+ export function parse_deno(code, main_override) {
211
+ let deferred3_0;
212
+ let deferred3_1;
198
213
  try {
199
214
  const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
200
215
  const len0 = WASM_VECTOR_LEN;
201
- const ret = wasm.parse_outputs(ptr0, len0);
202
- deferred2_0 = ret[0];
203
- deferred2_1 = ret[1];
216
+ var ptr1 = isLikeNone(main_override) ? 0 : passStringToWasm0(main_override, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
217
+ var len1 = WASM_VECTOR_LEN;
218
+ const ret = wasm.parse_deno(ptr0, len0, ptr1, len1);
219
+ deferred3_0 = ret[0];
220
+ deferred3_1 = ret[1];
204
221
  return getStringFromWasm0(ret[0], ret[1]);
205
222
  } finally {
206
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
223
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
207
224
  }
208
225
  }
209
226
 
@@ -245,6 +262,8 @@ export function parse_assets_ts(code) {
245
262
  }
246
263
  }
247
264
 
265
+ const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
266
+
248
267
  async function __wbg_load(module, imports) {
249
268
  if (typeof Response === 'function' && module instanceof Response) {
250
269
  if (typeof WebAssembly.instantiateStreaming === 'function') {
@@ -252,7 +271,9 @@ async function __wbg_load(module, imports) {
252
271
  return await WebAssembly.instantiateStreaming(module, imports);
253
272
 
254
273
  } catch (e) {
255
- if (module.headers.get('Content-Type') != 'application/wasm') {
274
+ const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
275
+
276
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
256
277
  console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
257
278
 
258
279
  } else {
@@ -279,35 +300,35 @@ async function __wbg_load(module, imports) {
279
300
  function __wbg_get_imports() {
280
301
  const imports = {};
281
302
  imports.wbg = {};
282
- imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
283
- const ret = arg0.buffer;
303
+ imports.wbg.__wbg_Error_1f3748b298f99708 = function(arg0, arg1) {
304
+ const ret = Error(getStringFromWasm0(arg0, arg1));
284
305
  return ret;
285
306
  };
286
- imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
307
+ imports.wbg.__wbg_call_2f8d426a20a307fe = function() { return handleError(function (arg0, arg1) {
287
308
  const ret = arg0.call(arg1);
288
309
  return ret;
289
310
  }, arguments) };
290
- imports.wbg.__wbg_done_769e5ede4b31c67b = function(arg0) {
311
+ imports.wbg.__wbg_done_4a7743b6f942c9f3 = function(arg0) {
291
312
  const ret = arg0.done;
292
313
  return ret;
293
314
  };
294
- imports.wbg.__wbg_entries_3265d4158b33e5dc = function(arg0) {
315
+ imports.wbg.__wbg_entries_17f7acbc2d691c0d = function(arg0) {
295
316
  const ret = Object.entries(arg0);
296
317
  return ret;
297
318
  };
298
- imports.wbg.__wbg_eval_d0dfcbbfaeff4b3c = function(arg0, arg1) {
319
+ imports.wbg.__wbg_eval_bfe54912a0c0c52a = function(arg0, arg1) {
299
320
  const ret = eval(getStringFromWasm0(arg0, arg1));
300
321
  return ret;
301
322
  };
302
- imports.wbg.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
323
+ imports.wbg.__wbg_get_27b4bcbec57323ca = function() { return handleError(function (arg0, arg1) {
303
324
  const ret = Reflect.get(arg0, arg1);
304
325
  return ret;
305
326
  }, arguments) };
306
- imports.wbg.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
327
+ imports.wbg.__wbg_get_59c6316d15f9f1d0 = function(arg0, arg1) {
307
328
  const ret = arg0[arg1 >>> 0];
308
329
  return ret;
309
330
  };
310
- imports.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
331
+ imports.wbg.__wbg_instanceof_ArrayBuffer_59339a3a6f0c10ea = function(arg0) {
311
332
  let result;
312
333
  try {
313
334
  result = arg0 instanceof ArrayBuffer;
@@ -317,7 +338,7 @@ function __wbg_get_imports() {
317
338
  const ret = result;
318
339
  return ret;
319
340
  };
320
- imports.wbg.__wbg_instanceof_Map_f3469ce2244d2430 = function(arg0) {
341
+ imports.wbg.__wbg_instanceof_Map_dd89a82d76d1b25f = function(arg0) {
321
342
  let result;
322
343
  try {
323
344
  result = arg0 instanceof Map;
@@ -327,7 +348,7 @@ function __wbg_get_imports() {
327
348
  const ret = result;
328
349
  return ret;
329
350
  };
330
- imports.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
351
+ imports.wbg.__wbg_instanceof_Uint8Array_91f3c5adee7e6672 = function(arg0) {
331
352
  let result;
332
353
  try {
333
354
  result = arg0 instanceof Uint8Array;
@@ -337,121 +358,95 @@ function __wbg_get_imports() {
337
358
  const ret = result;
338
359
  return ret;
339
360
  };
340
- imports.wbg.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
361
+ imports.wbg.__wbg_isArray_bc2498eba6fcb71f = function(arg0) {
341
362
  const ret = Array.isArray(arg0);
342
363
  return ret;
343
364
  };
344
- imports.wbg.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
365
+ imports.wbg.__wbg_isSafeInteger_6091d6e3ee1b65fd = function(arg0) {
345
366
  const ret = Number.isSafeInteger(arg0);
346
367
  return ret;
347
368
  };
348
- imports.wbg.__wbg_iterator_9a24c88df860dc65 = function() {
369
+ imports.wbg.__wbg_iterator_96378c3c9a17347c = function() {
349
370
  const ret = Symbol.iterator;
350
371
  return ret;
351
372
  };
352
- imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) {
373
+ imports.wbg.__wbg_length_246fa1f85a0dea5b = function(arg0) {
353
374
  const ret = arg0.length;
354
375
  return ret;
355
376
  };
356
- imports.wbg.__wbg_length_e2d2a49132c1b256 = function(arg0) {
377
+ imports.wbg.__wbg_length_904c0910ed998bf3 = function(arg0) {
357
378
  const ret = arg0.length;
358
379
  return ret;
359
380
  };
360
- imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
381
+ imports.wbg.__wbg_new_9190433fb67ed635 = function(arg0) {
361
382
  const ret = new Uint8Array(arg0);
362
383
  return ret;
363
384
  };
364
- imports.wbg.__wbg_next_25feadfc0913fea9 = function(arg0) {
365
- const ret = arg0.next;
366
- return ret;
367
- };
368
- imports.wbg.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
385
+ imports.wbg.__wbg_next_2e6b37020ac5fe58 = function() { return handleError(function (arg0) {
369
386
  const ret = arg0.next();
370
387
  return ret;
371
388
  }, arguments) };
372
- imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
373
- arg0.set(arg1, arg2 >>> 0);
374
- };
375
- imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
376
- const ret = arg0.value;
389
+ imports.wbg.__wbg_next_3de8f2669431a3ff = function(arg0) {
390
+ const ret = arg0.next;
377
391
  return ret;
378
392
  };
379
- imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
380
- const ret = arg0;
381
- return ret;
393
+ imports.wbg.__wbg_prototypesetcall_c5f74efd31aea86b = function(arg0, arg1, arg2) {
394
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
382
395
  };
383
- imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
384
- const ret = BigInt.asUintN(64, arg0);
396
+ imports.wbg.__wbg_value_09d0b4eaab48b91d = function(arg0) {
397
+ const ret = arg0.value;
385
398
  return ret;
386
399
  };
387
- imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
400
+ imports.wbg.__wbg_wbindgenbigintgetasi64_7637cb1a7fb9a81e = function(arg0, arg1) {
388
401
  const v = arg1;
389
402
  const ret = typeof(v) === 'bigint' ? v : undefined;
390
403
  getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
391
404
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
392
405
  };
393
- imports.wbg.__wbindgen_boolean_get = function(arg0) {
406
+ imports.wbg.__wbg_wbindgenbooleanget_59f830b1a70d2530 = function(arg0) {
394
407
  const v = arg0;
395
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
396
- return ret;
408
+ const ret = typeof(v) === 'boolean' ? v : undefined;
409
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
397
410
  };
398
- imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
411
+ imports.wbg.__wbg_wbindgendebugstring_bb652b1bc2061b6d = function(arg0, arg1) {
399
412
  const ret = debugString(arg1);
400
413
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
401
414
  const len1 = WASM_VECTOR_LEN;
402
415
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
403
416
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
404
417
  };
405
- imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
406
- const ret = new Error(getStringFromWasm0(arg0, arg1));
407
- return ret;
408
- };
409
- imports.wbg.__wbindgen_in = function(arg0, arg1) {
418
+ imports.wbg.__wbg_wbindgenin_192b210aa1c401e9 = function(arg0, arg1) {
410
419
  const ret = arg0 in arg1;
411
420
  return ret;
412
421
  };
413
- imports.wbg.__wbindgen_init_externref_table = function() {
414
- const table = wasm.__wbindgen_export_2;
415
- const offset = table.grow(4);
416
- table.set(0, undefined);
417
- table.set(offset + 0, undefined);
418
- table.set(offset + 1, null);
419
- table.set(offset + 2, true);
420
- table.set(offset + 3, false);
421
- ;
422
- };
423
- imports.wbg.__wbindgen_is_bigint = function(arg0) {
422
+ imports.wbg.__wbg_wbindgenisbigint_7d76a1ca6454e439 = function(arg0) {
424
423
  const ret = typeof(arg0) === 'bigint';
425
424
  return ret;
426
425
  };
427
- imports.wbg.__wbindgen_is_function = function(arg0) {
426
+ imports.wbg.__wbg_wbindgenisfunction_ea72b9d66a0e1705 = function(arg0) {
428
427
  const ret = typeof(arg0) === 'function';
429
428
  return ret;
430
429
  };
431
- imports.wbg.__wbindgen_is_object = function(arg0) {
430
+ imports.wbg.__wbg_wbindgenisobject_dfe064a121d87553 = function(arg0) {
432
431
  const val = arg0;
433
432
  const ret = typeof(val) === 'object' && val !== null;
434
433
  return ret;
435
434
  };
436
- imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
435
+ imports.wbg.__wbg_wbindgenjsvaleq_f27272c0a890df7f = function(arg0, arg1) {
437
436
  const ret = arg0 === arg1;
438
437
  return ret;
439
438
  };
440
- imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
439
+ imports.wbg.__wbg_wbindgenjsvallooseeq_9dd7bb4b95ac195c = function(arg0, arg1) {
441
440
  const ret = arg0 == arg1;
442
441
  return ret;
443
442
  };
444
- imports.wbg.__wbindgen_memory = function() {
445
- const ret = wasm.memory;
446
- return ret;
447
- };
448
- imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
443
+ imports.wbg.__wbg_wbindgennumberget_d855f947247a3fbc = function(arg0, arg1) {
449
444
  const obj = arg1;
450
445
  const ret = typeof(obj) === 'number' ? obj : undefined;
451
446
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
452
447
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
453
448
  };
454
- imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
449
+ imports.wbg.__wbg_wbindgenstringget_43fe05afe34b0cb1 = function(arg0, arg1) {
455
450
  const obj = arg1;
456
451
  const ret = typeof(obj) === 'string' ? obj : undefined;
457
452
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -459,9 +454,29 @@ function __wbg_get_imports() {
459
454
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
460
455
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
461
456
  };
462
- imports.wbg.__wbindgen_throw = function(arg0, arg1) {
457
+ imports.wbg.__wbg_wbindgenthrow_4c11a24fca429ccf = function(arg0, arg1) {
463
458
  throw new Error(getStringFromWasm0(arg0, arg1));
464
459
  };
460
+ imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
461
+ // Cast intrinsic for `U64 -> Externref`.
462
+ const ret = BigInt.asUintN(64, arg0);
463
+ return ret;
464
+ };
465
+ imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
466
+ // Cast intrinsic for `I64 -> Externref`.
467
+ const ret = arg0;
468
+ return ret;
469
+ };
470
+ imports.wbg.__wbindgen_init_externref_table = function() {
471
+ const table = wasm.__wbindgen_export_2;
472
+ const offset = table.grow(4);
473
+ table.set(0, undefined);
474
+ table.set(offset + 0, undefined);
475
+ table.set(offset + 1, null);
476
+ table.set(offset + 2, true);
477
+ table.set(offset + 3, false);
478
+ ;
479
+ };
465
480
 
466
481
  return imports;
467
482
  }
Binary file