@getpara/server-sdk 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
Binary file
@@ -0,0 +1,4 @@
1
+ {
2
+ "type": "module",
3
+ "sideEffects": false
4
+ }
@@ -8,8 +8,29 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
8
8
  var __commonJS = (cb, mod) => function __require2() {
9
9
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
10
  };
11
+ var __async = (__this, __arguments, generator) => {
12
+ return new Promise((resolve, reject) => {
13
+ var fulfilled = (value) => {
14
+ try {
15
+ step(generator.next(value));
16
+ } catch (e) {
17
+ reject(e);
18
+ }
19
+ };
20
+ var rejected = (value) => {
21
+ try {
22
+ step(generator.throw(value));
23
+ } catch (e) {
24
+ reject(e);
25
+ }
26
+ };
27
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
28
+ step((generator = generator.apply(__this, __arguments)).next());
29
+ });
30
+ };
11
31
 
12
32
  export {
13
33
  __require,
14
- __commonJS
34
+ __commonJS,
35
+ __async
15
36
  };
@@ -1,7 +1,8 @@
1
1
  import {
2
+ __async,
2
3
  __commonJS,
3
4
  __require
4
- } from "./chunk-MCKGQKYU.js";
5
+ } from "./chunk-ILICZWQV.js";
5
6
 
6
7
  // src/wasm/wasm_exec.js
7
8
  var require_wasm_exec = __commonJS({
@@ -483,71 +484,73 @@ var require_wasm_exec = __commonJS({
483
484
  }
484
485
  };
485
486
  }
486
- async run(instance) {
487
- if (!(instance instanceof WebAssembly.Instance)) {
488
- throw new Error("Go.run: WebAssembly.Instance expected");
489
- }
490
- this._inst = instance;
491
- this.mem = new DataView(this._inst.exports.mem.buffer);
492
- this._values = [
493
- // JS values that Go currently has references to, indexed by reference id
494
- NaN,
495
- 0,
496
- null,
497
- true,
498
- false,
499
- globalThis,
500
- this
501
- ];
502
- this._goRefCounts = new Array(this._values.length).fill(Infinity);
503
- this._ids = /* @__PURE__ */ new Map([
504
- // mapping from JS values to reference ids
505
- [0, 1],
506
- [null, 2],
507
- [true, 3],
508
- [false, 4],
509
- [globalThis, 5],
510
- [this, 6]
511
- ]);
512
- this._idPool = [];
513
- this.exited = false;
514
- let offset = 4096;
515
- const strPtr = (str) => {
516
- const ptr = offset;
517
- const bytes = encoder.encode(str + "\0");
518
- new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);
519
- offset += bytes.length;
520
- if (offset % 8 !== 0) {
521
- offset += 8 - offset % 8;
487
+ run(instance) {
488
+ return __async(this, null, function* () {
489
+ if (!(instance instanceof WebAssembly.Instance)) {
490
+ throw new Error("Go.run: WebAssembly.Instance expected");
522
491
  }
523
- return ptr;
524
- };
525
- const argc = this.argv.length;
526
- const argvPtrs = [];
527
- this.argv.forEach((arg) => {
528
- argvPtrs.push(strPtr(arg));
529
- });
530
- argvPtrs.push(0);
531
- const keys = Object.keys(this.env).sort();
532
- keys.forEach((key) => {
533
- argvPtrs.push(strPtr(`${key}=${this.env[key]}`));
534
- });
535
- argvPtrs.push(0);
536
- const argv = offset;
537
- argvPtrs.forEach((ptr) => {
538
- this.mem.setUint32(offset, ptr, true);
539
- this.mem.setUint32(offset + 4, 0, true);
540
- offset += 8;
492
+ this._inst = instance;
493
+ this.mem = new DataView(this._inst.exports.mem.buffer);
494
+ this._values = [
495
+ // JS values that Go currently has references to, indexed by reference id
496
+ NaN,
497
+ 0,
498
+ null,
499
+ true,
500
+ false,
501
+ globalThis,
502
+ this
503
+ ];
504
+ this._goRefCounts = new Array(this._values.length).fill(Infinity);
505
+ this._ids = /* @__PURE__ */ new Map([
506
+ // mapping from JS values to reference ids
507
+ [0, 1],
508
+ [null, 2],
509
+ [true, 3],
510
+ [false, 4],
511
+ [globalThis, 5],
512
+ [this, 6]
513
+ ]);
514
+ this._idPool = [];
515
+ this.exited = false;
516
+ let offset = 4096;
517
+ const strPtr = (str) => {
518
+ const ptr = offset;
519
+ const bytes = encoder.encode(str + "\0");
520
+ new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);
521
+ offset += bytes.length;
522
+ if (offset % 8 !== 0) {
523
+ offset += 8 - offset % 8;
524
+ }
525
+ return ptr;
526
+ };
527
+ const argc = this.argv.length;
528
+ const argvPtrs = [];
529
+ this.argv.forEach((arg) => {
530
+ argvPtrs.push(strPtr(arg));
531
+ });
532
+ argvPtrs.push(0);
533
+ const keys = Object.keys(this.env).sort();
534
+ keys.forEach((key) => {
535
+ argvPtrs.push(strPtr(`${key}=${this.env[key]}`));
536
+ });
537
+ argvPtrs.push(0);
538
+ const argv = offset;
539
+ argvPtrs.forEach((ptr) => {
540
+ this.mem.setUint32(offset, ptr, true);
541
+ this.mem.setUint32(offset + 4, 0, true);
542
+ offset += 8;
543
+ });
544
+ const wasmMinDataAddr = 4096 + 8192;
545
+ if (offset >= wasmMinDataAddr) {
546
+ throw new Error("total length of command line and environment variables exceeds limit");
547
+ }
548
+ this._inst.exports.run(argc, argv);
549
+ if (this.exited) {
550
+ this._resolveExitPromise();
551
+ }
552
+ yield this._exitPromise;
541
553
  });
542
- const wasmMinDataAddr = 4096 + 8192;
543
- if (offset >= wasmMinDataAddr) {
544
- throw new Error("total length of command line and environment variables exceeds limit");
545
- }
546
- this._inst.exports.run(argc, argv);
547
- if (this.exited) {
548
- this._resolveExitPromise();
549
- }
550
- await this._exitPromise;
551
554
  }
552
555
  _resume() {
553
556
  if (this.exited) {