@jsii/runtime 1.61.0 → 1.62.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.
@@ -2674,7 +2674,6 @@ var __webpack_modules__ = {
2674
2674
  };
2675
2675
  const EE = __webpack_require__(2361);
2676
2676
  const Stream = __webpack_require__(2781);
2677
- const Yallist = __webpack_require__(1455);
2678
2677
  const SD = __webpack_require__(1576).StringDecoder;
2679
2678
  const EOF = Symbol("EOF");
2680
2679
  const MAYBE_EMIT_END = Symbol("maybeEmitEnd");
@@ -2695,22 +2694,40 @@ var __webpack_modules__ = {
2695
2694
  const BUFFERSHIFT = Symbol("bufferShift");
2696
2695
  const OBJECTMODE = Symbol("objectMode");
2697
2696
  const DESTROYED = Symbol("destroyed");
2697
+ const EMITDATA = Symbol("emitData");
2698
+ const EMITEND = Symbol("emitEnd");
2699
+ const EMITEND2 = Symbol("emitEnd2");
2700
+ const ASYNC = Symbol("async");
2701
+ const defer = fn => Promise.resolve().then(fn);
2698
2702
  const doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== "1";
2699
2703
  const ASYNCITERATOR = doIter && Symbol.asyncIterator || Symbol("asyncIterator not implemented");
2700
2704
  const ITERATOR = doIter && Symbol.iterator || Symbol("iterator not implemented");
2701
2705
  const isEndish = ev => ev === "end" || ev === "finish" || ev === "prefinish";
2702
2706
  const isArrayBuffer = b => b instanceof ArrayBuffer || typeof b === "object" && b.constructor && b.constructor.name === "ArrayBuffer" && b.byteLength >= 0;
2703
2707
  const isArrayBufferView = b => !Buffer.isBuffer(b) && ArrayBuffer.isView(b);
2708
+ class Pipe {
2709
+ constructor(src, dest, opts) {
2710
+ this.dest = dest;
2711
+ this.opts = opts;
2712
+ this.ondrain = () => src[RESUME]();
2713
+ dest.on("drain", this.ondrain);
2714
+ }
2715
+ end() {
2716
+ if (this.opts.end) this.dest.end();
2717
+ this.dest.removeListener("drain", this.ondrain);
2718
+ }
2719
+ }
2704
2720
  module.exports = class Minipass extends Stream {
2705
2721
  constructor(options) {
2706
2722
  super();
2707
2723
  this[FLOWING] = false;
2708
2724
  this[PAUSED] = false;
2709
- this.pipes = new Yallist;
2710
- this.buffer = new Yallist;
2725
+ this.pipes = [];
2726
+ this.buffer = [];
2711
2727
  this[OBJECTMODE] = options && options.objectMode || false;
2712
2728
  if (this[OBJECTMODE]) this[ENCODING] = null; else this[ENCODING] = options && options.encoding || null;
2713
2729
  if (this[ENCODING] === "buffer") this[ENCODING] = null;
2730
+ this[ASYNC] = options && !!options.async || false;
2714
2731
  this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null;
2715
2732
  this[EOF] = false;
2716
2733
  this[EMITTED_END] = false;
@@ -2746,6 +2763,12 @@ var __webpack_modules__ = {
2746
2763
  set objectMode(om) {
2747
2764
  this[OBJECTMODE] = this[OBJECTMODE] || !!om;
2748
2765
  }
2766
+ get ["async"]() {
2767
+ return this[ASYNC];
2768
+ }
2769
+ set ["async"](a) {
2770
+ this[ASYNC] = this[ASYNC] || !!a;
2771
+ }
2749
2772
  write(chunk, encoding, cb) {
2750
2773
  if (this[EOF]) throw new Error("write after end");
2751
2774
  if (this[DESTROYED]) {
@@ -2756,42 +2779,49 @@ var __webpack_modules__ = {
2756
2779
  }
2757
2780
  if (typeof encoding === "function") cb = encoding, encoding = "utf8";
2758
2781
  if (!encoding) encoding = "utf8";
2782
+ const fn = this[ASYNC] ? defer : f => f();
2759
2783
  if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) {
2760
2784
  if (isArrayBufferView(chunk)) chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength); else if (isArrayBuffer(chunk)) chunk = Buffer.from(chunk); else if (typeof chunk !== "string") this.objectMode = true;
2761
2785
  }
2762
- if (!this.objectMode && !chunk.length) {
2786
+ if (this[OBJECTMODE]) {
2787
+ if (this.flowing && this[BUFFERLENGTH] !== 0) this[FLUSH](true);
2788
+ if (this.flowing) this.emit("data", chunk); else this[BUFFERPUSH](chunk);
2789
+ if (this[BUFFERLENGTH] !== 0) this.emit("readable");
2790
+ if (cb) fn(cb);
2791
+ return this.flowing;
2792
+ }
2793
+ if (!chunk.length) {
2763
2794
  if (this[BUFFERLENGTH] !== 0) this.emit("readable");
2764
- if (cb) cb();
2795
+ if (cb) fn(cb);
2765
2796
  return this.flowing;
2766
2797
  }
2767
- if (typeof chunk === "string" && !this[OBJECTMODE] && !(encoding === this[ENCODING] && !this[DECODER].lastNeed)) {
2798
+ if (typeof chunk === "string" && !(encoding === this[ENCODING] && !this[DECODER].lastNeed)) {
2768
2799
  chunk = Buffer.from(chunk, encoding);
2769
2800
  }
2770
2801
  if (Buffer.isBuffer(chunk) && this[ENCODING]) chunk = this[DECODER].write(chunk);
2771
- if (this.flowing) {
2772
- if (this[BUFFERLENGTH] !== 0) this[FLUSH](true);
2773
- this.flowing ? this.emit("data", chunk) : this[BUFFERPUSH](chunk);
2774
- } else this[BUFFERPUSH](chunk);
2802
+ if (this.flowing && this[BUFFERLENGTH] !== 0) this[FLUSH](true);
2803
+ if (this.flowing) this.emit("data", chunk); else this[BUFFERPUSH](chunk);
2775
2804
  if (this[BUFFERLENGTH] !== 0) this.emit("readable");
2776
- if (cb) cb();
2805
+ if (cb) fn(cb);
2777
2806
  return this.flowing;
2778
2807
  }
2779
2808
  read(n) {
2780
2809
  if (this[DESTROYED]) return null;
2781
- try {
2782
- if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH]) return null;
2783
- if (this[OBJECTMODE]) n = null;
2784
- if (this.buffer.length > 1 && !this[OBJECTMODE]) {
2785
- if (this.encoding) this.buffer = new Yallist([ Array.from(this.buffer).join("") ]); else this.buffer = new Yallist([ Buffer.concat(Array.from(this.buffer), this[BUFFERLENGTH]) ]);
2786
- }
2787
- return this[READ](n || null, this.buffer.head.value);
2788
- } finally {
2810
+ if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH]) {
2789
2811
  this[MAYBE_EMIT_END]();
2812
+ return null;
2813
+ }
2814
+ if (this[OBJECTMODE]) n = null;
2815
+ if (this.buffer.length > 1 && !this[OBJECTMODE]) {
2816
+ if (this.encoding) this.buffer = [ this.buffer.join("") ]; else this.buffer = [ Buffer.concat(this.buffer, this[BUFFERLENGTH]) ];
2790
2817
  }
2818
+ const ret = this[READ](n || null, this.buffer[0]);
2819
+ this[MAYBE_EMIT_END]();
2820
+ return ret;
2791
2821
  }
2792
2822
  [READ](n, chunk) {
2793
2823
  if (n === chunk.length || n === null) this[BUFFERSHIFT](); else {
2794
- this.buffer.head.value = chunk.slice(n);
2824
+ this.buffer[0] = chunk.slice(n);
2795
2825
  chunk = chunk.slice(0, n);
2796
2826
  this[BUFFERLENGTH] -= n;
2797
2827
  }
@@ -2834,11 +2864,11 @@ var __webpack_modules__ = {
2834
2864
  }
2835
2865
  [BUFFERPUSH](chunk) {
2836
2866
  if (this[OBJECTMODE]) this[BUFFERLENGTH] += 1; else this[BUFFERLENGTH] += chunk.length;
2837
- return this.buffer.push(chunk);
2867
+ this.buffer.push(chunk);
2838
2868
  }
2839
2869
  [BUFFERSHIFT]() {
2840
2870
  if (this.buffer.length) {
2841
- if (this[OBJECTMODE]) this[BUFFERLENGTH] -= 1; else this[BUFFERLENGTH] -= this.buffer.head.value.length;
2871
+ if (this[OBJECTMODE]) this[BUFFERLENGTH] -= 1; else this[BUFFERLENGTH] -= this.buffer[0].length;
2842
2872
  }
2843
2873
  return this.buffer.shift();
2844
2874
  }
@@ -2854,31 +2884,26 @@ var __webpack_modules__ = {
2854
2884
  const ended = this[EMITTED_END];
2855
2885
  opts = opts || {};
2856
2886
  if (dest === proc.stdout || dest === proc.stderr) opts.end = false; else opts.end = opts.end !== false;
2857
- const p = {
2858
- dest,
2859
- opts,
2860
- ondrain: _ => this[RESUME]()
2861
- };
2862
- this.pipes.push(p);
2863
- dest.on("drain", p.ondrain);
2864
- this[RESUME]();
2865
- if (ended && p.opts.end) p.dest.end();
2887
+ if (ended) {
2888
+ if (opts.end) dest.end();
2889
+ } else {
2890
+ this.pipes.push(new Pipe(this, dest, opts));
2891
+ if (this[ASYNC]) defer((() => this[RESUME]())); else this[RESUME]();
2892
+ }
2866
2893
  return dest;
2867
2894
  }
2868
2895
  addListener(ev, fn) {
2869
2896
  return this.on(ev, fn);
2870
2897
  }
2871
2898
  on(ev, fn) {
2872
- try {
2873
- return super.on(ev, fn);
2874
- } finally {
2875
- if (ev === "data" && !this.pipes.length && !this.flowing) this[RESUME](); else if (isEndish(ev) && this[EMITTED_END]) {
2876
- super.emit(ev);
2877
- this.removeAllListeners(ev);
2878
- } else if (ev === "error" && this[EMITTED_ERROR]) {
2879
- fn.call(this, this[EMITTED_ERROR]);
2880
- }
2899
+ const ret = super.on(ev, fn);
2900
+ if (ev === "data" && !this.pipes.length && !this.flowing) this[RESUME](); else if (ev === "readable" && this[BUFFERLENGTH] !== 0) super.emit("readable"); else if (isEndish(ev) && this[EMITTED_END]) {
2901
+ super.emit(ev);
2902
+ this.removeAllListeners(ev);
2903
+ } else if (ev === "error" && this[EMITTED_ERROR]) {
2904
+ if (this[ASYNC]) defer((() => fn.call(this, this[EMITTED_ERROR]))); else fn.call(this, this[EMITTED_ERROR]);
2881
2905
  }
2906
+ return ret;
2882
2907
  }
2883
2908
  get emittedEnd() {
2884
2909
  return this[EMITTED_END];
@@ -2893,44 +2918,65 @@ var __webpack_modules__ = {
2893
2918
  this[EMITTING_END] = false;
2894
2919
  }
2895
2920
  }
2896
- emit(ev, data) {
2921
+ emit(ev, data, ...extra) {
2897
2922
  if (ev !== "error" && ev !== "close" && ev !== DESTROYED && this[DESTROYED]) return; else if (ev === "data") {
2898
- if (!data) return;
2899
- if (this.pipes.length) this.pipes.forEach((p => p.dest.write(data) === false && this.pause()));
2923
+ return !data ? false : this[ASYNC] ? defer((() => this[EMITDATA](data))) : this[EMITDATA](data);
2900
2924
  } else if (ev === "end") {
2901
- if (this[EMITTED_END] === true) return;
2902
- this[EMITTED_END] = true;
2903
- this.readable = false;
2904
- if (this[DECODER]) {
2905
- data = this[DECODER].end();
2906
- if (data) {
2907
- this.pipes.forEach((p => p.dest.write(data)));
2908
- super.emit("data", data);
2909
- }
2910
- }
2911
- this.pipes.forEach((p => {
2912
- p.dest.removeListener("drain", p.ondrain);
2913
- if (p.opts.end) p.dest.end();
2914
- }));
2925
+ return this[EMITEND]();
2915
2926
  } else if (ev === "close") {
2916
2927
  this[CLOSED] = true;
2917
2928
  if (!this[EMITTED_END] && !this[DESTROYED]) return;
2929
+ const ret = super.emit("close");
2930
+ this.removeAllListeners("close");
2931
+ return ret;
2918
2932
  } else if (ev === "error") {
2919
2933
  this[EMITTED_ERROR] = data;
2934
+ const ret = super.emit("error", data);
2935
+ this[MAYBE_EMIT_END]();
2936
+ return ret;
2937
+ } else if (ev === "resume") {
2938
+ const ret = super.emit("resume");
2939
+ this[MAYBE_EMIT_END]();
2940
+ return ret;
2941
+ } else if (ev === "finish" || ev === "prefinish") {
2942
+ const ret = super.emit(ev);
2943
+ this.removeAllListeners(ev);
2944
+ return ret;
2945
+ }
2946
+ const ret = super.emit(ev, data, ...extra);
2947
+ this[MAYBE_EMIT_END]();
2948
+ return ret;
2949
+ }
2950
+ [EMITDATA](data) {
2951
+ for (const p of this.pipes) {
2952
+ if (p.dest.write(data) === false) this.pause();
2920
2953
  }
2921
- const args = new Array(arguments.length);
2922
- args[0] = ev;
2923
- args[1] = data;
2924
- if (arguments.length > 2) {
2925
- for (let i = 2; i < arguments.length; i++) {
2926
- args[i] = arguments[i];
2954
+ const ret = super.emit("data", data);
2955
+ this[MAYBE_EMIT_END]();
2956
+ return ret;
2957
+ }
2958
+ [EMITEND]() {
2959
+ if (this[EMITTED_END]) return;
2960
+ this[EMITTED_END] = true;
2961
+ this.readable = false;
2962
+ if (this[ASYNC]) defer((() => this[EMITEND2]())); else this[EMITEND2]();
2963
+ }
2964
+ [EMITEND2]() {
2965
+ if (this[DECODER]) {
2966
+ const data = this[DECODER].end();
2967
+ if (data) {
2968
+ for (const p of this.pipes) {
2969
+ p.dest.write(data);
2970
+ }
2971
+ super.emit("data", data);
2927
2972
  }
2928
2973
  }
2929
- try {
2930
- return super.emit.apply(this, args);
2931
- } finally {
2932
- if (!isEndish(ev)) this[MAYBE_EMIT_END](); else this.removeAllListeners(ev);
2974
+ for (const p of this.pipes) {
2975
+ p.end();
2933
2976
  }
2977
+ const ret = super.emit("end");
2978
+ this.removeAllListeners("end");
2979
+ return ret;
2934
2980
  }
2935
2981
  collect() {
2936
2982
  const buf = [];
@@ -3018,7 +3064,7 @@ var __webpack_modules__ = {
3018
3064
  return this;
3019
3065
  }
3020
3066
  this[DESTROYED] = true;
3021
- this.buffer = new Yallist;
3067
+ this.buffer.length = 0;
3022
3068
  this[BUFFERLENGTH] = 0;
3023
3069
  if (typeof this.close === "function" && !this[CLOSED]) this.close();
3024
3070
  if (er) this.emit("error", er); else this.emit(DESTROYED);
@@ -7810,6 +7856,7 @@ var __webpack_modules__ = {
7810
7856
  });
7811
7857
  exports.Kernel = void 0;
7812
7858
  const spec = __webpack_require__(1804);
7859
+ const spec_1 = __webpack_require__(1804);
7813
7860
  const cp = __webpack_require__(2081);
7814
7861
  const fs = __webpack_require__(9728);
7815
7862
  const os = __webpack_require__(2037);
@@ -7825,11 +7872,11 @@ var __webpack_modules__ = {
7825
7872
  constructor(callbackHandler) {
7826
7873
  this.callbackHandler = callbackHandler;
7827
7874
  this.traceEnabled = false;
7828
- this.assemblies = {};
7875
+ this.assemblies = new Map;
7829
7876
  this.objects = new objects_1.ObjectTable(this._typeInfoForFqn.bind(this));
7830
- this.cbs = {};
7831
- this.waiting = {};
7832
- this.promises = {};
7877
+ this.cbs = new Map;
7878
+ this.waiting = new Map;
7879
+ this.promises = new Map;
7833
7880
  this.nextid = 2e4;
7834
7881
  const moduleLoad = __webpack_require__(8188).Module._load;
7835
7882
  const nodeRequire = p => moduleLoad(p, module, false);
@@ -7840,6 +7887,7 @@ var __webpack_modules__ = {
7840
7887
  });
7841
7888
  }
7842
7889
  load(req) {
7890
+ var _a, _b;
7843
7891
  this._debug("load", req);
7844
7892
  if ("assembly" in req) {
7845
7893
  throw new Error('`assembly` field is deprecated for "load", use `name`, `version` and `tarball` instead');
@@ -7853,10 +7901,10 @@ var __webpack_modules__ = {
7853
7901
  throw new Error(`Multiple versions ${pkgver} and ${epkg.version} of the ` + `package '${pkgname}' cannot be loaded together since this is unsupported by ` + "some runtime environments");
7854
7902
  }
7855
7903
  this._debug("look up already-loaded assembly", pkgname);
7856
- const assm = this.assemblies[pkgname];
7904
+ const assm = this.assemblies.get(pkgname);
7857
7905
  return {
7858
7906
  assembly: assm.metadata.name,
7859
- types: Object.keys(assm.metadata.types ?? {}).length
7907
+ types: Object.keys((_a = assm.metadata.types) !== null && _a !== void 0 ? _a : {}).length
7860
7908
  };
7861
7909
  }
7862
7910
  fs.mkdirpSync(packageDir);
@@ -7873,20 +7921,22 @@ var __webpack_modules__ = {
7873
7921
  } finally {
7874
7922
  process.umask(originalUmask);
7875
7923
  }
7876
- const jsiiMetadataFile = path.join(packageDir, spec.SPEC_FILE_NAME);
7877
- if (!fs.pathExistsSync(jsiiMetadataFile)) {
7878
- throw new Error(`Package tarball ${req.tarball} must have a file named ${spec.SPEC_FILE_NAME} at the root`);
7924
+ let assmSpec;
7925
+ try {
7926
+ assmSpec = (0, spec_1.loadAssemblyFromPath)(packageDir);
7927
+ } catch (e) {
7928
+ throw new Error(`Error for package tarball ${req.tarball}: ${e.message}`);
7879
7929
  }
7880
- const assmSpec = fs.readJsonSync(jsiiMetadataFile);
7881
7930
  const closure = this._execute(`require(String.raw\`${packageDir}\`)`, packageDir);
7882
7931
  const assm = new Assembly(assmSpec, closure);
7883
7932
  this._addAssembly(assm);
7884
7933
  return {
7885
7934
  assembly: assmSpec.name,
7886
- types: Object.keys(assmSpec.types ?? {}).length
7935
+ types: Object.keys((_b = assmSpec.types) !== null && _b !== void 0 ? _b : {}).length
7887
7936
  };
7888
7937
  }
7889
7938
  invokeBinScript(req) {
7939
+ var _a;
7890
7940
  const packageDir = this._getPackageDir(req.assembly);
7891
7941
  if (fs.pathExistsSync(packageDir)) {
7892
7942
  const epkg = fs.readJsonSync(path.join(packageDir, "package.json"));
@@ -7897,7 +7947,7 @@ var __webpack_modules__ = {
7897
7947
  if (!epkg.bin) {
7898
7948
  throw new Error(`Script with name ${req.script} was not defined.`);
7899
7949
  }
7900
- const result = cp.spawnSync(path.join(packageDir, scriptPath), req.args ?? [], {
7950
+ const result = cp.spawnSync(path.join(packageDir, scriptPath), (_a = req.args) !== null && _a !== void 0 ? _a : [], {
7901
7951
  encoding: "utf-8",
7902
7952
  env: {
7903
7953
  ...process.env,
@@ -7935,7 +7985,7 @@ var __webpack_modules__ = {
7935
7985
  const prototype = this._findSymbol(fqn);
7936
7986
  const value = this._ensureSync(`property ${property}`, (() => this._wrapSandboxCode((() => prototype[property]))));
7937
7987
  this._debug("value:", value);
7938
- const ret = this._fromSandbox(value, ti);
7988
+ const ret = this._fromSandbox(value, ti, `of static property ${symbol}`);
7939
7989
  this._debug("ret", ret);
7940
7990
  return {
7941
7991
  value: ret
@@ -7953,7 +8003,7 @@ var __webpack_modules__ = {
7953
8003
  throw new Error(`static property ${symbol} is readonly`);
7954
8004
  }
7955
8005
  const prototype = this._findSymbol(fqn);
7956
- this._ensureSync(`property ${property}`, (() => this._wrapSandboxCode((() => prototype[property] = this._toSandbox(value, ti)))));
8006
+ this._ensureSync(`property ${property}`, (() => this._wrapSandboxCode((() => prototype[property] = this._toSandbox(value, ti, `assigned to static property ${symbol}`)))));
7957
8007
  return {};
7958
8008
  }
7959
8009
  get(req) {
@@ -7964,7 +8014,7 @@ var __webpack_modules__ = {
7964
8014
  const propertyToGet = this._findPropertyTarget(instance, property);
7965
8015
  const value = this._ensureSync(`property '${objref[api_1.TOKEN_REF]}.${propertyToGet}'`, (() => this._wrapSandboxCode((() => instance[propertyToGet]))));
7966
8016
  this._debug("value:", value);
7967
- const ret = this._fromSandbox(value, ti);
8017
+ const ret = this._fromSandbox(value, ti, `of property ${fqn}.${property}`);
7968
8018
  this._debug("ret:", ret);
7969
8019
  return {
7970
8020
  value: ret
@@ -7979,27 +8029,30 @@ var __webpack_modules__ = {
7979
8029
  throw new Error(`Cannot set value of immutable property ${req.property} to ${req.value}`);
7980
8030
  }
7981
8031
  const propertyToSet = this._findPropertyTarget(instance, property);
7982
- this._ensureSync(`property '${objref[api_1.TOKEN_REF]}.${propertyToSet}'`, (() => this._wrapSandboxCode((() => instance[propertyToSet] = this._toSandbox(value, propInfo)))));
8032
+ this._ensureSync(`property '${objref[api_1.TOKEN_REF]}.${propertyToSet}'`, (() => this._wrapSandboxCode((() => instance[propertyToSet] = this._toSandbox(value, propInfo, `assigned to property ${fqn}.${property}`)))));
7983
8033
  return {};
7984
8034
  }
7985
8035
  invoke(req) {
8036
+ var _a, _b;
7986
8037
  const {objref, method} = req;
7987
- const args = req.args ?? [];
8038
+ const args = (_a = req.args) !== null && _a !== void 0 ? _a : [];
7988
8039
  this._debug("invoke", objref, method, args);
7989
8040
  const {ti, obj, fn} = this._findInvokeTarget(objref, method, args);
7990
8041
  if (ti.async) {
7991
8042
  throw new Error(`${method} is an async method, use "begin" instead`);
7992
8043
  }
7993
- const ret = this._ensureSync(`method '${objref[api_1.TOKEN_REF]}.${method}'`, (() => this._wrapSandboxCode((() => fn.apply(obj, this._toSandboxValues(args, ti.parameters))))));
7994
- const result = this._fromSandbox(ret, ti.returns ?? "void");
8044
+ const fqn = (0, objects_1.jsiiTypeFqn)(obj);
8045
+ const ret = this._ensureSync(`method '${objref[api_1.TOKEN_REF]}.${method}'`, (() => this._wrapSandboxCode((() => fn.apply(obj, this._toSandboxValues(args, `method ${fqn ? `${fqn}#` : ""}${method}`, ti.parameters))))));
8046
+ const result = this._fromSandbox(ret, (_b = ti.returns) !== null && _b !== void 0 ? _b : "void", `returned by method ${fqn ? `${fqn}#` : ""}${method}`);
7995
8047
  this._debug("invoke result", result);
7996
8048
  return {
7997
8049
  result
7998
8050
  };
7999
8051
  }
8000
8052
  sinvoke(req) {
8053
+ var _a, _b;
8001
8054
  const {fqn, method} = req;
8002
- const args = req.args ?? [];
8055
+ const args = (_a = req.args) !== null && _a !== void 0 ? _a : [];
8003
8056
  this._debug("sinvoke", fqn, method, args);
8004
8057
  const ti = this._typeInfoForMethod(method, fqn);
8005
8058
  if (!ti.static) {
@@ -8010,15 +8063,16 @@ var __webpack_modules__ = {
8010
8063
  }
8011
8064
  const prototype = this._findSymbol(fqn);
8012
8065
  const fn = prototype[method];
8013
- const ret = this._ensureSync(`method '${fqn}.${method}'`, (() => this._wrapSandboxCode((() => fn.apply(prototype, this._toSandboxValues(args, ti.parameters))))));
8066
+ const ret = this._ensureSync(`method '${fqn}.${method}'`, (() => this._wrapSandboxCode((() => fn.apply(prototype, this._toSandboxValues(args, `static method ${fqn}.${method}`, ti.parameters))))));
8014
8067
  this._debug("method returned:", ret);
8015
8068
  return {
8016
- result: this._fromSandbox(ret, ti.returns ?? "void")
8069
+ result: this._fromSandbox(ret, (_b = ti.returns) !== null && _b !== void 0 ? _b : "void", `returned by static method ${fqn}.${method}`)
8017
8070
  };
8018
8071
  }
8019
8072
  begin(req) {
8073
+ var _a;
8020
8074
  const {objref, method} = req;
8021
- const args = req.args ?? [];
8075
+ const args = (_a = req.args) !== null && _a !== void 0 ? _a : [];
8022
8076
  this._debug("begin", objref, method, args);
8023
8077
  if (this.syncInProgress) {
8024
8078
  throw new Error(`Cannot invoke async method '${req.objref[api_1.TOKEN_REF]}.${req.method}' while sync ${this.syncInProgress} is being processed`);
@@ -8027,24 +8081,27 @@ var __webpack_modules__ = {
8027
8081
  if (!ti.async) {
8028
8082
  throw new Error(`Method ${method} is expected to be an async method`);
8029
8083
  }
8030
- const promise = this._wrapSandboxCode((() => fn.apply(obj, this._toSandboxValues(args, ti.parameters))));
8084
+ const fqn = (0, objects_1.jsiiTypeFqn)(obj);
8085
+ const promise = this._wrapSandboxCode((() => fn.apply(obj, this._toSandboxValues(args, `async method ${fqn ? `${fqn}#` : ""}${method}`, ti.parameters))));
8031
8086
  promise.catch((_ => undefined));
8032
8087
  const prid = this._makeprid();
8033
- this.promises[prid] = {
8088
+ this.promises.set(prid, {
8034
8089
  promise,
8035
8090
  method: ti
8036
- };
8091
+ });
8037
8092
  return {
8038
8093
  promiseid: prid
8039
8094
  };
8040
8095
  }
8041
8096
  async end(req) {
8097
+ var _a;
8042
8098
  const {promiseid} = req;
8043
8099
  this._debug("end", promiseid);
8044
- const {promise, method} = this.promises[promiseid];
8045
- if (promise == null) {
8100
+ const storedPromise = this.promises.get(promiseid);
8101
+ if (storedPromise == null) {
8046
8102
  throw new Error(`Cannot find promise with ID: ${promiseid}`);
8047
8103
  }
8104
+ const {promise, method} = storedPromise;
8048
8105
  let result;
8049
8106
  try {
8050
8107
  result = await promise;
@@ -8054,14 +8111,14 @@ var __webpack_modules__ = {
8054
8111
  throw e;
8055
8112
  }
8056
8113
  return {
8057
- result: this._fromSandbox(result, method.returns ?? "void")
8114
+ result: this._fromSandbox(result, (_a = method.returns) !== null && _a !== void 0 ? _a : "void", `returned by async method ${method.name}`)
8058
8115
  };
8059
8116
  }
8060
8117
  callbacks(_req) {
8061
8118
  this._debug("callbacks");
8062
- const ret = Object.keys(this.cbs).map((cbid => {
8063
- const cb = this.cbs[cbid];
8064
- this.waiting[cbid] = cb;
8119
+ const ret = Array.from(this.cbs.entries()).map((([cbid, cb]) => {
8120
+ this.waiting.set(cbid, cb);
8121
+ this.cbs.delete(cbid);
8065
8122
  const callback = {
8066
8123
  cbid,
8067
8124
  cookie: cb.override.cookie,
@@ -8073,27 +8130,27 @@ var __webpack_modules__ = {
8073
8130
  };
8074
8131
  return callback;
8075
8132
  }));
8076
- this.cbs = {};
8077
8133
  return {
8078
8134
  callbacks: ret
8079
8135
  };
8080
8136
  }
8081
8137
  complete(req) {
8138
+ var _a;
8082
8139
  const {cbid, err, result} = req;
8083
8140
  this._debug("complete", cbid, err, result);
8084
- if (!(cbid in this.waiting)) {
8141
+ const cb = this.waiting.get(cbid);
8142
+ if (!cb) {
8085
8143
  throw new Error(`Callback ${cbid} not found`);
8086
8144
  }
8087
- const cb = this.waiting[cbid];
8088
8145
  if (err) {
8089
8146
  this._debug("completed with error:", err);
8090
8147
  cb.fail(new Error(err));
8091
8148
  } else {
8092
- const sandoxResult = this._toSandbox(result, cb.expectedReturnType ?? "void");
8149
+ const sandoxResult = this._toSandbox(result, (_a = cb.expectedReturnType) !== null && _a !== void 0 ? _a : "void", `returned by callback ${cb.toString()}`);
8093
8150
  this._debug("completed with result:", sandoxResult);
8094
8151
  cb.succeed(sandoxResult);
8095
8152
  }
8096
- delete this.waiting[cbid];
8153
+ this.waiting.delete(cbid);
8097
8154
  return {
8098
8155
  cbid
8099
8156
  };
@@ -8116,8 +8173,9 @@ var __webpack_modules__ = {
8116
8173
  };
8117
8174
  }
8118
8175
  _addAssembly(assm) {
8119
- this.assemblies[assm.metadata.name] = assm;
8120
- for (const fqn of Object.keys(assm.metadata.types ?? {})) {
8176
+ var _a;
8177
+ this.assemblies.set(assm.metadata.name, assm);
8178
+ for (const fqn of Object.keys((_a = assm.metadata.types) !== null && _a !== void 0 ? _a : {})) {
8121
8179
  const typedef = assm.metadata.types[fqn];
8122
8180
  switch (typedef.kind) {
8123
8181
  case spec.TypeKind.Interface:
@@ -8163,13 +8221,14 @@ var __webpack_modules__ = {
8163
8221
  return path.join(this.installDir, "node_modules", pkgname);
8164
8222
  }
8165
8223
  _create(req) {
8224
+ var _a, _b;
8166
8225
  this._debug("create", req);
8167
8226
  const {fqn, interfaces, overrides} = req;
8168
- const requestArgs = req.args ?? [];
8227
+ const requestArgs = (_a = req.args) !== null && _a !== void 0 ? _a : [];
8169
8228
  const ctorResult = this._findCtor(fqn, requestArgs);
8170
8229
  const ctor = ctorResult.ctor;
8171
- const obj = this._wrapSandboxCode((() => new ctor(...this._toSandboxValues(requestArgs, ctorResult.parameters))));
8172
- const objref = this.objects.registerObject(obj, fqn, req.interfaces ?? []);
8230
+ const obj = this._wrapSandboxCode((() => new ctor(...this._toSandboxValues(requestArgs, `new ${fqn}`, ctorResult.parameters))));
8231
+ const objref = this.objects.registerObject(obj, fqn, (_b = req.interfaces) !== null && _b !== void 0 ? _b : []);
8173
8232
  if (overrides) {
8174
8233
  this._debug("overrides", overrides);
8175
8234
  const overrideTypeErrorMessage = 'Override can either be "method" or "property"';
@@ -8222,9 +8281,10 @@ var __webpack_modules__ = {
8222
8281
  this._defineOverridenProperty(obj, objref, override, propInfo);
8223
8282
  }
8224
8283
  _defineOverridenProperty(obj, objref, override, propInfo) {
8284
+ var _a;
8225
8285
  const propertyName = override.property;
8226
8286
  this._debug("apply override", propertyName);
8227
- const prev = getPropertyDescriptor(obj, propertyName) ?? {
8287
+ const prev = (_a = getPropertyDescriptor(obj, propertyName)) !== null && _a !== void 0 ? _a : {
8228
8288
  value: obj[propertyName],
8229
8289
  writable: true,
8230
8290
  enumerable: true,
@@ -8249,7 +8309,7 @@ var __webpack_modules__ = {
8249
8309
  }
8250
8310
  });
8251
8311
  this._debug("callback returned", result);
8252
- return this._toSandbox(result, propInfo);
8312
+ return this._toSandbox(result, propInfo, `returned by callback property ${propertyName}`);
8253
8313
  },
8254
8314
  set: value => {
8255
8315
  this._debug("virtual set", objref, propertyName, {
@@ -8261,7 +8321,7 @@ var __webpack_modules__ = {
8261
8321
  set: {
8262
8322
  objref,
8263
8323
  property: propertyName,
8264
- value: this._fromSandbox(value, propInfo)
8324
+ value: this._fromSandbox(value, propInfo, `assigned to callback property ${propertyName}`)
8265
8325
  }
8266
8326
  });
8267
8327
  }
@@ -8305,6 +8365,8 @@ var __webpack_modules__ = {
8305
8365
  }
8306
8366
  _defineOverridenMethod(obj, objref, override, methodInfo) {
8307
8367
  const methodName = override.method;
8368
+ const fqn = (0, objects_1.jsiiTypeFqn)(obj);
8369
+ const methodContext = `${methodInfo.async ? "async " : ""}method${fqn ? `${fqn}#` : methodName}`;
8308
8370
  if (methodInfo.async) {
8309
8371
  Object.defineProperty(obj, methodName, {
8310
8372
  enumerable: false,
@@ -8312,18 +8374,19 @@ var __webpack_modules__ = {
8312
8374
  writable: false,
8313
8375
  value: (...methodArgs) => {
8314
8376
  this._debug("invoke async method override", override);
8315
- const args = this._toSandboxValues(methodArgs, methodInfo.parameters);
8377
+ const args = this._toSandboxValues(methodArgs, methodContext, methodInfo.parameters);
8316
8378
  return new Promise(((succeed, fail) => {
8379
+ var _a;
8317
8380
  const cbid = this._makecbid();
8318
8381
  this._debug("adding callback to queue", cbid);
8319
- this.cbs[cbid] = {
8382
+ this.cbs.set(cbid, {
8320
8383
  objref,
8321
8384
  override,
8322
8385
  args,
8323
- expectedReturnType: methodInfo.returns ?? "void",
8386
+ expectedReturnType: (_a = methodInfo.returns) !== null && _a !== void 0 ? _a : "void",
8324
8387
  succeed,
8325
8388
  fail
8326
- };
8389
+ });
8327
8390
  }));
8328
8391
  }
8329
8392
  });
@@ -8333,6 +8396,7 @@ var __webpack_modules__ = {
8333
8396
  configurable: false,
8334
8397
  writable: false,
8335
8398
  value: (...methodArgs) => {
8399
+ var _a;
8336
8400
  this._debug("invoke sync method override", override, "args", methodArgs);
8337
8401
  const result = this.callbackHandler({
8338
8402
  cookie: override.cookie,
@@ -8340,11 +8404,11 @@ var __webpack_modules__ = {
8340
8404
  invoke: {
8341
8405
  objref,
8342
8406
  method: methodName,
8343
- args: this._fromSandboxValues(methodArgs, methodInfo.parameters)
8407
+ args: this._fromSandboxValues(methodArgs, methodContext, methodInfo.parameters)
8344
8408
  }
8345
8409
  });
8346
8410
  this._debug("Result", result);
8347
- return this._toSandbox(result, methodInfo.returns ?? "void");
8411
+ return this._toSandbox(result, (_a = methodInfo.returns) !== null && _a !== void 0 ? _a : "void", `returned by callback method ${methodName}`);
8348
8412
  }
8349
8413
  });
8350
8414
  }
@@ -8367,7 +8431,8 @@ var __webpack_modules__ = {
8367
8431
  };
8368
8432
  }
8369
8433
  _validateMethodArguments(method, args) {
8370
- const params = method?.parameters ?? [];
8434
+ var _a;
8435
+ const params = (_a = method === null || method === void 0 ? void 0 : method.parameters) !== null && _a !== void 0 ? _a : [];
8371
8436
  if (args.length > params.length && !(method && method.variadic)) {
8372
8437
  throw new Error(`Too many arguments (method accepts ${params.length} parameters, got ${args.length} arguments)`);
8373
8438
  }
@@ -8389,7 +8454,7 @@ var __webpack_modules__ = {
8389
8454
  }
8390
8455
  }
8391
8456
  _assemblyFor(assemblyName) {
8392
- const assembly = this.assemblies[assemblyName];
8457
+ const assembly = this.assemblies.get(assemblyName);
8393
8458
  if (!assembly) {
8394
8459
  throw new Error(`Could not find assembly: ${assemblyName}`);
8395
8460
  }
@@ -8412,13 +8477,14 @@ var __webpack_modules__ = {
8412
8477
  return curr;
8413
8478
  }
8414
8479
  _typeInfoForFqn(fqn) {
8480
+ var _a;
8415
8481
  const components = fqn.split(".");
8416
8482
  const moduleName = components[0];
8417
- const assembly = this.assemblies[moduleName];
8483
+ const assembly = this.assemblies.get(moduleName);
8418
8484
  if (!assembly) {
8419
8485
  throw new Error(`Module '${moduleName}' not found`);
8420
8486
  }
8421
- const types = assembly.metadata.types ?? {};
8487
+ const types = (_a = assembly.metadata.types) !== null && _a !== void 0 ? _a : {};
8422
8488
  const fqnInfo = types[fqn];
8423
8489
  if (!fqnInfo) {
8424
8490
  throw new Error(`Type '${fqn}' not found`);
@@ -8434,18 +8500,19 @@ var __webpack_modules__ = {
8434
8500
  return ti;
8435
8501
  }
8436
8502
  _tryTypeInfoForMethod(methodName, classFqn, interfaces = []) {
8503
+ var _a, _b;
8437
8504
  for (const fqn of [ classFqn, ...interfaces ]) {
8438
8505
  if (fqn === wire.EMPTY_OBJECT_FQN) {
8439
8506
  continue;
8440
8507
  }
8441
8508
  const typeinfo = this._typeInfoForFqn(fqn);
8442
- const methods = typeinfo.methods ?? [];
8509
+ const methods = (_a = typeinfo.methods) !== null && _a !== void 0 ? _a : [];
8443
8510
  for (const m of methods) {
8444
8511
  if (m.name === methodName) {
8445
8512
  return m;
8446
8513
  }
8447
8514
  }
8448
- const bases = [ typeinfo.base, ...typeinfo.interfaces ?? [] ];
8515
+ const bases = [ typeinfo.base, ...(_b = typeinfo.interfaces) !== null && _b !== void 0 ? _b : [] ];
8449
8516
  for (const base of bases) {
8450
8517
  if (!base) {
8451
8518
  continue;
@@ -8459,6 +8526,7 @@ var __webpack_modules__ = {
8459
8526
  return undefined;
8460
8527
  }
8461
8528
  _tryTypeInfoForProperty(property, classFqn, interfaces = []) {
8529
+ var _a;
8462
8530
  for (const fqn of [ classFqn, ...interfaces ]) {
8463
8531
  if (fqn === wire.EMPTY_OBJECT_FQN) {
8464
8532
  continue;
@@ -8473,11 +8541,11 @@ var __webpack_modules__ = {
8473
8541
  } else if (spec.isInterfaceType(typeInfo)) {
8474
8542
  const interfaceTypeInfo = typeInfo;
8475
8543
  properties = interfaceTypeInfo.properties;
8476
- bases = interfaceTypeInfo.interfaces ?? [];
8544
+ bases = (_a = interfaceTypeInfo.interfaces) !== null && _a !== void 0 ? _a : [];
8477
8545
  } else {
8478
8546
  throw new Error(`Type of kind ${typeInfo.kind} does not have properties`);
8479
8547
  }
8480
- for (const p of properties ?? []) {
8548
+ for (const p of properties !== null && properties !== void 0 ? properties : []) {
8481
8549
  if (p.name === property) {
8482
8550
  return p;
8483
8551
  }
@@ -8499,68 +8567,38 @@ var __webpack_modules__ = {
8499
8567
  }
8500
8568
  return typeInfo;
8501
8569
  }
8502
- _toSandbox(v, expectedType) {
8503
- const serTypes = wire.serializationType(expectedType, this._typeInfoForFqn.bind(this));
8504
- this._debug("toSandbox", v, JSON.stringify(serTypes));
8505
- const host = {
8570
+ _toSandbox(v, expectedType, context) {
8571
+ return wire.process({
8506
8572
  objects: this.objects,
8507
8573
  debug: this._debug.bind(this),
8508
8574
  findSymbol: this._findSymbol.bind(this),
8509
- lookupType: this._typeInfoForFqn.bind(this),
8510
- recurse: this._toSandbox.bind(this)
8511
- };
8512
- const errors = new Array;
8513
- for (const {serializationClass, typeRef} of serTypes) {
8514
- try {
8515
- return wire.SERIALIZERS[serializationClass].deserialize(v, typeRef, host);
8516
- } catch (e) {
8517
- if (serTypes.length === 1) {
8518
- throw e;
8519
- }
8520
- errors.push(e.message);
8521
- }
8522
- }
8523
- throw new Error(`Value did not match any type in union: ${errors.join(", ")}`);
8575
+ lookupType: this._typeInfoForFqn.bind(this)
8576
+ }, "deserialize", v, expectedType, context);
8524
8577
  }
8525
- _fromSandbox(v, targetType) {
8526
- const serTypes = wire.serializationType(targetType, this._typeInfoForFqn.bind(this));
8527
- this._debug("fromSandbox", v, JSON.stringify(serTypes));
8528
- const host = {
8578
+ _fromSandbox(v, targetType, context) {
8579
+ return wire.process({
8529
8580
  objects: this.objects,
8530
8581
  debug: this._debug.bind(this),
8531
8582
  findSymbol: this._findSymbol.bind(this),
8532
- lookupType: this._typeInfoForFqn.bind(this),
8533
- recurse: this._fromSandbox.bind(this)
8534
- };
8535
- const errors = new Array;
8536
- for (const {serializationClass, typeRef} of serTypes) {
8537
- try {
8538
- return wire.SERIALIZERS[serializationClass].serialize(v, typeRef, host);
8539
- } catch (e) {
8540
- if (serTypes.length === 1) {
8541
- throw e;
8542
- }
8543
- errors.push(e.message);
8544
- }
8545
- }
8546
- throw new Error(`Value did not match any type in union: ${errors.join(", ")}`);
8583
+ lookupType: this._typeInfoForFqn.bind(this)
8584
+ }, "serialize", v, targetType, context);
8547
8585
  }
8548
- _toSandboxValues(xs, parameters) {
8549
- return this._boxUnboxParameters(xs, parameters, this._toSandbox.bind(this));
8586
+ _toSandboxValues(xs, methodContext, parameters) {
8587
+ return this._boxUnboxParameters(xs, methodContext, parameters, this._toSandbox.bind(this));
8550
8588
  }
8551
- _fromSandboxValues(xs, parameters) {
8552
- return this._boxUnboxParameters(xs, parameters, this._fromSandbox.bind(this));
8589
+ _fromSandboxValues(xs, methodContext, parameters) {
8590
+ return this._boxUnboxParameters(xs, methodContext, parameters, this._fromSandbox.bind(this));
8553
8591
  }
8554
- _boxUnboxParameters(xs, parameters, boxUnbox) {
8555
- parameters = [ ...parameters ?? [] ];
8556
- const variadic = parameters.length > 0 && !!parameters[parameters.length - 1].variadic;
8557
- while (variadic && parameters.length < xs.length) {
8558
- parameters.push(parameters[parameters.length - 1]);
8592
+ _boxUnboxParameters(xs, methodContext, parameters = [], boxUnbox) {
8593
+ const parametersCopy = [ ...parameters ];
8594
+ const variadic = parametersCopy.length > 0 && !!parametersCopy[parametersCopy.length - 1].variadic;
8595
+ while (variadic && parametersCopy.length < xs.length) {
8596
+ parametersCopy.push(parametersCopy[parametersCopy.length - 1]);
8559
8597
  }
8560
- if (xs.length > parameters.length) {
8561
- throw new Error(`Argument list (${JSON.stringify(xs)}) not same size as expected argument list (length ${parameters.length})`);
8598
+ if (xs.length > parametersCopy.length) {
8599
+ throw new Error(`Argument list (${JSON.stringify(xs)}) not same size as expected argument list (length ${parametersCopy.length})`);
8562
8600
  }
8563
- return xs.map(((x, i) => boxUnbox(x, parameters[i])));
8601
+ return xs.map(((x, i) => boxUnbox(x, parametersCopy[i], `passed to parameter ${parametersCopy[i].name} of ${methodContext}`)));
8564
8602
  }
8565
8603
  _debug(...args) {
8566
8604
  if (this.traceEnabled) {
@@ -8621,7 +8659,8 @@ var __webpack_modules__ = {
8621
8659
  const IFACES_SYMBOL = Symbol.for("$__jsii__interfaces__$");
8622
8660
  const JSII_SYMBOL = Symbol.for("__jsii__");
8623
8661
  function jsiiTypeFqn(obj) {
8624
- return obj.constructor[JSII_SYMBOL]?.fqn;
8662
+ var _a;
8663
+ return (_a = obj.constructor[JSII_SYMBOL]) === null || _a === void 0 ? void 0 : _a.fqn;
8625
8664
  }
8626
8665
  exports.jsiiTypeFqn = jsiiTypeFqn;
8627
8666
  function objectReference(obj) {
@@ -8666,10 +8705,11 @@ var __webpack_modules__ = {
8666
8705
  class ObjectTable {
8667
8706
  constructor(resolveType) {
8668
8707
  this.resolveType = resolveType;
8669
- this.objects = {};
8708
+ this.objects = new Map;
8670
8709
  this.nextid = 1e4;
8671
8710
  }
8672
8711
  registerObject(obj, fqn, interfaces) {
8712
+ var _a;
8673
8713
  if (fqn === undefined) {
8674
8714
  throw new Error("FQN cannot be undefined");
8675
8715
  }
@@ -8677,23 +8717,23 @@ var __webpack_modules__ = {
8677
8717
  if (existingRef) {
8678
8718
  if (interfaces) {
8679
8719
  const allIfaces = new Set(interfaces);
8680
- for (const iface of existingRef[api.TOKEN_INTERFACES] ?? []) {
8720
+ for (const iface of (_a = existingRef[api.TOKEN_INTERFACES]) !== null && _a !== void 0 ? _a : []) {
8681
8721
  allIfaces.add(iface);
8682
8722
  }
8683
8723
  if (!Object.prototype.hasOwnProperty.call(obj, IFACES_SYMBOL)) {
8684
8724
  console.error(`[jsii/kernel] WARNING: referenced object ${existingRef[api.TOKEN_REF]} does not have the ${String(IFACES_SYMBOL)} property!`);
8685
8725
  }
8686
- this.objects[existingRef[api.TOKEN_REF]].interfaces = obj[IFACES_SYMBOL] = existingRef[api.TOKEN_INTERFACES] = interfaces = this.removeRedundant(Array.from(allIfaces), fqn);
8726
+ this.objects.get(existingRef[api.TOKEN_REF]).interfaces = obj[IFACES_SYMBOL] = existingRef[api.TOKEN_INTERFACES] = interfaces = this.removeRedundant(Array.from(allIfaces), fqn);
8687
8727
  }
8688
8728
  return existingRef;
8689
8729
  }
8690
8730
  interfaces = this.removeRedundant(interfaces, fqn);
8691
8731
  const objid = this.makeId(fqn);
8692
- this.objects[objid] = {
8732
+ this.objects.set(objid, {
8693
8733
  instance: obj,
8694
8734
  fqn,
8695
8735
  interfaces
8696
- };
8736
+ });
8697
8737
  tagObject(obj, objid, interfaces);
8698
8738
  return {
8699
8739
  [api.TOKEN_REF]: objid,
@@ -8701,11 +8741,12 @@ var __webpack_modules__ = {
8701
8741
  };
8702
8742
  }
8703
8743
  findObject(objref) {
8744
+ var _a;
8704
8745
  if (typeof objref !== "object" || !(api.TOKEN_REF in objref)) {
8705
8746
  throw new Error(`Malformed object reference: ${JSON.stringify(objref)}`);
8706
8747
  }
8707
8748
  const objid = objref[api.TOKEN_REF];
8708
- const obj = this.objects[objid];
8749
+ const obj = this.objects.get(objid);
8709
8750
  if (!obj) {
8710
8751
  throw new Error(`Object ${objid} not found`);
8711
8752
  }
@@ -8713,17 +8754,18 @@ var __webpack_modules__ = {
8713
8754
  if (additionalInterfaces != null && additionalInterfaces.length > 0) {
8714
8755
  return {
8715
8756
  ...obj,
8716
- interfaces: [ ...obj.interfaces ?? [], ...additionalInterfaces ]
8757
+ interfaces: [ ...(_a = obj.interfaces) !== null && _a !== void 0 ? _a : [], ...additionalInterfaces ]
8717
8758
  };
8718
8759
  }
8719
8760
  return obj;
8720
8761
  }
8721
- deleteObject(objref) {
8722
- this.findObject(objref);
8723
- delete this.objects[objref[api.TOKEN_REF]];
8762
+ deleteObject({[api.TOKEN_REF]: objid}) {
8763
+ if (!this.objects.delete(objid)) {
8764
+ throw new Error(`Object ${objid} not found`);
8765
+ }
8724
8766
  }
8725
8767
  get count() {
8726
- return Object.keys(this.objects).length;
8768
+ return this.objects.size;
8727
8769
  }
8728
8770
  makeId(fqn) {
8729
8771
  return `${fqn}@${this.nextid++}`;
@@ -8824,11 +8866,14 @@ var __webpack_modules__ = {
8824
8866
  Object.defineProperty(exports, "__esModule", {
8825
8867
  value: true
8826
8868
  });
8827
- exports.serializationType = exports.SERIALIZERS = exports.SYMBOL_WIRE_TYPE = exports.EMPTY_OBJECT_FQN = void 0;
8869
+ exports.SerializationError = exports.process = exports.serializationType = exports.SERIALIZERS = exports.SYMBOL_WIRE_TYPE = exports.EMPTY_OBJECT_FQN = void 0;
8828
8870
  const spec = __webpack_require__(1804);
8871
+ const assert = __webpack_require__(9491);
8872
+ const util_1 = __webpack_require__(3837);
8829
8873
  const api_1 = __webpack_require__(2816);
8830
8874
  const objects_1 = __webpack_require__(2309);
8831
8875
  const _1 = __webpack_require__(8944);
8876
+ const VOID = "void";
8832
8877
  exports.EMPTY_OBJECT_FQN = "Object";
8833
8878
  exports.SYMBOL_WIRE_TYPE = Symbol.for("$jsii$wireType$");
8834
8879
  exports.SERIALIZERS = {
@@ -8851,11 +8896,9 @@ var __webpack_modules__ = {
8851
8896
  if (nullAndOk(value, optionalValue)) {
8852
8897
  return undefined;
8853
8898
  }
8854
- if (optionalValue === "void") {
8855
- throw new Error("Encountered unexpected `void` type");
8856
- }
8899
+ assert(optionalValue !== VOID, "Encountered unexpected void type!");
8857
8900
  if (!isDate(value)) {
8858
- throw new Error(`Expected Date, got ${JSON.stringify(value)}`);
8901
+ throw new SerializationError(`Value is not an instance of Date`, value);
8859
8902
  }
8860
8903
  return serializeDate(value);
8861
8904
  },
@@ -8864,7 +8907,7 @@ var __webpack_modules__ = {
8864
8907
  return undefined;
8865
8908
  }
8866
8909
  if (!(0, api_1.isWireDate)(value)) {
8867
- throw new Error(`Expected Date, got ${JSON.stringify(value)}`);
8910
+ throw new SerializationError(`Value does not have the "${api_1.TOKEN_DATE}" key`, value);
8868
8911
  }
8869
8912
  return deserializeDate(value);
8870
8913
  }
@@ -8874,15 +8917,13 @@ var __webpack_modules__ = {
8874
8917
  if (nullAndOk(value, optionalValue)) {
8875
8918
  return undefined;
8876
8919
  }
8877
- if (optionalValue === "void") {
8878
- throw new Error("Encountered unexpected `void` type");
8879
- }
8920
+ assert(optionalValue !== VOID, "Encountered unexpected void type!");
8880
8921
  const primitiveType = optionalValue.type;
8881
8922
  if (!isScalar(value)) {
8882
- throw new Error(`Expected ${spec.describeTypeReference(optionalValue.type)}, got ${JSON.stringify(value)}`);
8923
+ throw new SerializationError(`Value is not a ${spec.describeTypeReference(optionalValue.type)}`, value);
8883
8924
  }
8884
8925
  if (typeof value !== primitiveType.primitive) {
8885
- throw new Error(`Expected a ${spec.describeTypeReference(optionalValue.type)}, got ${JSON.stringify(value)} (${typeof value})`);
8926
+ throw new SerializationError(`Value is not a ${spec.describeTypeReference(optionalValue.type)}`, value);
8886
8927
  }
8887
8928
  return value;
8888
8929
  },
@@ -8890,21 +8931,22 @@ var __webpack_modules__ = {
8890
8931
  if (nullAndOk(value, optionalValue)) {
8891
8932
  return undefined;
8892
8933
  }
8893
- if (optionalValue === "void") {
8894
- throw new Error("Encountered unexpected `void` type");
8895
- }
8934
+ assert(optionalValue !== VOID, "Encountered unexpected void type!");
8896
8935
  const primitiveType = optionalValue.type;
8897
8936
  if (!isScalar(value)) {
8898
- throw new Error(`Expected a ${spec.describeTypeReference(optionalValue.type)}, got ${JSON.stringify(value)}`);
8937
+ throw new SerializationError(`Value is not a ${spec.describeTypeReference(optionalValue.type)}`, value);
8899
8938
  }
8900
8939
  if (typeof value !== primitiveType.primitive) {
8901
- throw new Error(`Expected a ${spec.describeTypeReference(optionalValue.type)}, got ${JSON.stringify(value)} (${typeof value})`);
8940
+ throw new SerializationError(`Value is not a ${spec.describeTypeReference(optionalValue.type)}`, value);
8902
8941
  }
8903
8942
  return value;
8904
8943
  }
8905
8944
  },
8906
8945
  ["Json"]: {
8907
- serialize(value) {
8946
+ serialize(value, optionalValue) {
8947
+ if (nullAndOk(value, optionalValue)) {
8948
+ return undefined;
8949
+ }
8908
8950
  return value;
8909
8951
  },
8910
8952
  deserialize(value, optionalValue, host) {
@@ -8931,15 +8973,15 @@ var __webpack_modules__ = {
8931
8973
  return value.map(mapJsonValue);
8932
8974
  }
8933
8975
  return mapValues(value, mapJsonValue);
8934
- function mapJsonValue(toMap) {
8976
+ function mapJsonValue(toMap, key) {
8935
8977
  if (toMap == null) {
8936
8978
  return toMap;
8937
8979
  }
8938
- return host.recurse(toMap, {
8980
+ return process(host, "deserialize", toMap, {
8939
8981
  type: {
8940
8982
  primitive: spec.PrimitiveType.Json
8941
8983
  }
8942
- });
8984
+ }, typeof key === "string" ? `key ${(0, util_1.inspect)(key)}` : `index ${key}`);
8943
8985
  }
8944
8986
  }
8945
8987
  },
@@ -8948,18 +8990,16 @@ var __webpack_modules__ = {
8948
8990
  if (nullAndOk(value, optionalValue)) {
8949
8991
  return undefined;
8950
8992
  }
8951
- if (optionalValue === "void") {
8952
- throw new Error("Encountered unexpected `void` type");
8953
- }
8993
+ assert(optionalValue !== VOID, "Encountered unexpected void type!");
8954
8994
  if (typeof value !== "string" && typeof value !== "number") {
8955
- throw new Error(`Expected enum value, got ${JSON.stringify(value)}`);
8995
+ throw new SerializationError(`Value is not a string or number`, value);
8956
8996
  }
8957
8997
  host.debug("Serializing enum");
8958
8998
  const enumType = optionalValue.type;
8959
8999
  const enumMap = host.findSymbol(enumType.fqn);
8960
9000
  const enumEntry = Object.entries(enumMap).find((([, v]) => v === value));
8961
9001
  if (!enumEntry) {
8962
- throw new Error(`No entry in ${enumType.fqn} has value ${value}`);
9002
+ throw new SerializationError(`Value is not present in enum ${spec.describeTypeReference(enumType)}`, value);
8963
9003
  }
8964
9004
  return {
8965
9005
  [api_1.TOKEN_ENUM]: `${enumType.fqn}/${enumEntry[0]}`
@@ -8970,7 +9010,7 @@ var __webpack_modules__ = {
8970
9010
  return undefined;
8971
9011
  }
8972
9012
  if (!(0, api_1.isWireEnum)(value)) {
8973
- throw new Error(`Expected enum value, got ${JSON.stringify(value)}`);
9013
+ throw new SerializationError(`Value does not have the "${api_1.TOKEN_ENUM}" key`, value);
8974
9014
  }
8975
9015
  return deserializeEnum(value, host.findSymbol);
8976
9016
  }
@@ -8980,31 +9020,27 @@ var __webpack_modules__ = {
8980
9020
  if (nullAndOk(value, optionalValue)) {
8981
9021
  return undefined;
8982
9022
  }
8983
- if (optionalValue === "void") {
8984
- throw new Error("Encountered unexpected `void` type");
8985
- }
9023
+ assert(optionalValue !== VOID, "Encountered unexpected void type!");
8986
9024
  if (!Array.isArray(value)) {
8987
- throw new Error(`Expected array type, got ${JSON.stringify(value)}`);
9025
+ throw new SerializationError(`Value is not an array`, value);
8988
9026
  }
8989
9027
  const arrayType = optionalValue.type;
8990
- return value.map((x => host.recurse(x, {
9028
+ return value.map(((x, idx) => process(host, "serialize", x, {
8991
9029
  type: arrayType.collection.elementtype
8992
- })));
9030
+ }, `index ${(0, util_1.inspect)(idx)}`)));
8993
9031
  },
8994
9032
  deserialize(value, optionalValue, host) {
8995
9033
  if (nullAndOk(value, optionalValue)) {
8996
9034
  return undefined;
8997
9035
  }
8998
- if (optionalValue === "void") {
8999
- throw new Error("Encountered unexpected `void` type");
9000
- }
9036
+ assert(optionalValue !== VOID, "Encountered unexpected void type!");
9001
9037
  if (!Array.isArray(value)) {
9002
- throw new Error(`Expected array type, got ${JSON.stringify(value)}`);
9038
+ throw new SerializationError(`Value is not an array`, value);
9003
9039
  }
9004
9040
  const arrayType = optionalValue.type;
9005
- return value.map((x => host.recurse(x, {
9041
+ return value.map(((x, idx) => process(host, "deserialize", x, {
9006
9042
  type: arrayType.collection.elementtype
9007
- })));
9043
+ }, `index ${(0, util_1.inspect)(idx)}`)));
9008
9044
  }
9009
9045
  },
9010
9046
  ["Map"]: {
@@ -9012,32 +9048,28 @@ var __webpack_modules__ = {
9012
9048
  if (nullAndOk(value, optionalValue)) {
9013
9049
  return undefined;
9014
9050
  }
9015
- if (optionalValue === "void") {
9016
- throw new Error("Encountered unexpected `void` type");
9017
- }
9051
+ assert(optionalValue !== VOID, "Encountered unexpected void type!");
9018
9052
  const mapType = optionalValue.type;
9019
9053
  return {
9020
- [api_1.TOKEN_MAP]: mapValues(value, (v => host.recurse(v, {
9054
+ [api_1.TOKEN_MAP]: mapValues(value, ((v, key) => process(host, "serialize", v, {
9021
9055
  type: mapType.collection.elementtype
9022
- })))
9056
+ }, `key ${(0, util_1.inspect)(key)}`)))
9023
9057
  };
9024
9058
  },
9025
9059
  deserialize(value, optionalValue, host) {
9026
9060
  if (nullAndOk(value, optionalValue)) {
9027
9061
  return undefined;
9028
9062
  }
9029
- if (optionalValue === "void") {
9030
- throw new Error("Encountered unexpected `void` type");
9031
- }
9063
+ assert(optionalValue !== VOID, "Encountered unexpected void type!");
9032
9064
  const mapType = optionalValue.type;
9033
9065
  if (!(0, api_1.isWireMap)(value)) {
9034
- return mapValues(value, (v => host.recurse(v, {
9066
+ return mapValues(value, ((v, key) => process(host, "deserialize", v, {
9035
9067
  type: mapType.collection.elementtype
9036
- })));
9068
+ }, `key ${(0, util_1.inspect)(key)}`)));
9037
9069
  }
9038
- const result = mapValues(value[api_1.TOKEN_MAP], (v => host.recurse(v, {
9070
+ const result = mapValues(value[api_1.TOKEN_MAP], ((v, key) => process(host, "deserialize", v, {
9039
9071
  type: mapType.collection.elementtype
9040
- })));
9072
+ }, `key ${(0, util_1.inspect)(key)}`)));
9041
9073
  Object.defineProperty(result, exports.SYMBOL_WIRE_TYPE, {
9042
9074
  configurable: false,
9043
9075
  enumerable: false,
@@ -9052,32 +9084,31 @@ var __webpack_modules__ = {
9052
9084
  if (nullAndOk(value, optionalValue)) {
9053
9085
  return undefined;
9054
9086
  }
9055
- if (optionalValue === "void") {
9056
- throw new Error("Encountered unexpected `void` type");
9087
+ assert(optionalValue !== VOID, "Encountered unexpected void type!");
9088
+ if (typeof value !== "object" || value == null || value instanceof Date) {
9089
+ throw new SerializationError(`Value is not an object`, value);
9057
9090
  }
9058
- if (typeof value !== "object" || value == null) {
9059
- throw new Error(`Expected object, got ${JSON.stringify(value)}`);
9091
+ if (Array.isArray(value)) {
9092
+ throw new SerializationError(`Value is an array`, value);
9060
9093
  }
9061
9094
  host.debug("Returning value type by reference");
9062
9095
  return host.objects.registerObject(value, exports.EMPTY_OBJECT_FQN, [ optionalValue.type.fqn ]);
9063
9096
  },
9064
9097
  deserialize(value, optionalValue, host) {
9065
- if (typeof value === "object" && Object.keys(value ?? {}).length === 0) {
9098
+ if (typeof value === "object" && Object.keys(value !== null && value !== void 0 ? value : {}).length === 0) {
9066
9099
  value = undefined;
9067
9100
  }
9068
9101
  if (nullAndOk(value, optionalValue)) {
9069
9102
  return undefined;
9070
9103
  }
9071
- if (optionalValue === "void") {
9072
- throw new Error("Encountered unexpected `void` type");
9073
- }
9104
+ assert(optionalValue !== VOID, "Encountered unexpected void type!");
9074
9105
  if (typeof value !== "object" || value == null) {
9075
- throw new Error(`Expected object reference, got ${JSON.stringify(value)}`);
9106
+ throw new SerializationError(`Value is not an object`, value);
9076
9107
  }
9077
9108
  const namedType = host.lookupType(optionalValue.type.fqn);
9078
9109
  const props = propertiesOf(namedType, host.lookupType);
9079
9110
  if (Array.isArray(value)) {
9080
- throw new Error(`Got an array where a ${namedType.fqn} was expected. Did you mean to pass a variable number of arguments?`);
9111
+ throw new SerializationError("Value is an array (varargs may have been incorrectly supplied)", value);
9081
9112
  }
9082
9113
  if ((0, api_1.isObjRef)(value)) {
9083
9114
  host.debug("Expected value type but got reference type, accepting for now (awslabs/jsii#400)");
@@ -9086,7 +9117,7 @@ var __webpack_modules__ = {
9086
9117
  if (_1.api.isWireStruct(value)) {
9087
9118
  const {fqn, data} = value[_1.api.TOKEN_STRUCT];
9088
9119
  if (!isAssignable(fqn, namedType, host.lookupType)) {
9089
- throw new Error(`Wire struct type '${fqn}' does not match expected '${namedType.fqn}'`);
9120
+ throw new SerializationError(`Wired struct has type '${fqn}', which does not match expected type`, value);
9090
9121
  }
9091
9122
  value = data;
9092
9123
  }
@@ -9098,35 +9129,35 @@ var __webpack_modules__ = {
9098
9129
  if (!props[key]) {
9099
9130
  return undefined;
9100
9131
  }
9101
- return host.recurse(v, props[key]);
9132
+ return process(host, "deserialize", v, props[key], `key ${(0, util_1.inspect)(key)}`);
9102
9133
  }));
9103
9134
  }
9104
9135
  },
9105
9136
  ["RefType"]: {
9106
9137
  serialize(value, optionalValue, host) {
9138
+ var _a;
9107
9139
  if (nullAndOk(value, optionalValue)) {
9108
9140
  return undefined;
9109
9141
  }
9110
- if (optionalValue === "void") {
9111
- throw new Error("Encountered unexpected `void` type");
9142
+ assert(optionalValue !== VOID, "Encountered unexpected void type!");
9143
+ if (typeof value !== "object" || value == null || Array.isArray(value)) {
9144
+ throw new SerializationError(`Value is not an object`, value);
9112
9145
  }
9113
- if (typeof value !== "object" || value == null) {
9114
- throw new Error(`Expected object reference, got ${JSON.stringify(value)}`);
9146
+ if (value instanceof Date) {
9147
+ throw new SerializationError(`Value is a Date`, value);
9115
9148
  }
9116
9149
  const expectedType = host.lookupType(optionalValue.type.fqn);
9117
9150
  const interfaces = spec.isInterfaceType(expectedType) ? [ expectedType.fqn ] : undefined;
9118
- const jsiiType = (0, objects_1.jsiiTypeFqn)(value) ?? (spec.isClassType(expectedType) ? expectedType.fqn : exports.EMPTY_OBJECT_FQN);
9151
+ const jsiiType = (_a = (0, objects_1.jsiiTypeFqn)(value)) !== null && _a !== void 0 ? _a : spec.isClassType(expectedType) ? expectedType.fqn : exports.EMPTY_OBJECT_FQN;
9119
9152
  return host.objects.registerObject(value, jsiiType, interfaces);
9120
9153
  },
9121
9154
  deserialize(value, optionalValue, host) {
9122
9155
  if (nullAndOk(value, optionalValue)) {
9123
9156
  return undefined;
9124
9157
  }
9125
- if (optionalValue === "void") {
9126
- throw new Error("Encountered unexpected `void` type");
9127
- }
9158
+ assert(optionalValue !== VOID, "Encountered unexpected void type!");
9128
9159
  if (!(0, api_1.isObjRef)(value)) {
9129
- throw new Error(`Expected object reference, got ${JSON.stringify(value)}`);
9160
+ throw new SerializationError(`Value does not have the "${api_1.TOKEN_REF}" key`, value);
9130
9161
  }
9131
9162
  const {instance, fqn} = host.objects.findObject(value);
9132
9163
  const namedTypeRef = optionalValue.type;
@@ -9134,7 +9165,7 @@ var __webpack_modules__ = {
9134
9165
  const namedType = host.lookupType(namedTypeRef.fqn);
9135
9166
  const declaredType = optionalValue.type;
9136
9167
  if (spec.isClassType(namedType) && !isAssignable(fqn, declaredType, host.lookupType)) {
9137
- throw new Error(`Object of type ${fqn} is not convertible to ${declaredType.fqn}`);
9168
+ throw new SerializationError(`Object of type '${fqn}' is not convertible to ${spec.describeTypeReference(declaredType)}`, value);
9138
9169
  }
9139
9170
  }
9140
9171
  return instance;
@@ -9142,6 +9173,7 @@ var __webpack_modules__ = {
9142
9173
  },
9143
9174
  ["Any"]: {
9144
9175
  serialize(value, _type, host) {
9176
+ var _a;
9145
9177
  if (value == null) {
9146
9178
  return undefined;
9147
9179
  }
@@ -9152,15 +9184,15 @@ var __webpack_modules__ = {
9152
9184
  return value;
9153
9185
  }
9154
9186
  if (Array.isArray(value)) {
9155
- return value.map((e => host.recurse(e, {
9187
+ return value.map(((e, idx) => process(host, "serialize", e, {
9156
9188
  type: spec.CANONICAL_ANY
9157
- })));
9189
+ }, `index ${(0, util_1.inspect)(idx)}`)));
9158
9190
  }
9159
9191
  if (typeof value === "function") {
9160
- throw new Error("JSII Kernel is unable to serialize `function`. An instance with methods might have been returned by an `any` method?");
9192
+ throw new SerializationError("Functions cannot be passed across language boundaries", value);
9161
9193
  }
9162
9194
  if (typeof value !== "object" || value == null) {
9163
- throw new Error(`JSII kernel assumption violated, ${JSON.stringify(value)} is not an object`);
9195
+ throw new SerializationError(`A jsii kernel assumption was violated: value is not an object`, value);
9164
9196
  }
9165
9197
  if (exports.SYMBOL_WIRE_TYPE in value && value[exports.SYMBOL_WIRE_TYPE] === api_1.TOKEN_MAP) {
9166
9198
  return exports.SERIALIZERS["Map"].serialize(value, {
@@ -9173,19 +9205,19 @@ var __webpack_modules__ = {
9173
9205
  }, host);
9174
9206
  }
9175
9207
  if (value instanceof Set || value instanceof Map) {
9176
- throw new Error("Can't return objects of type Set or Map");
9208
+ throw new SerializationError("Set and Map instances cannot be sent across the language boundary", value);
9177
9209
  }
9178
9210
  const prevRef = (0, objects_1.objectReference)(value);
9179
9211
  if (prevRef) {
9180
9212
  return prevRef;
9181
9213
  }
9182
- const jsiiType = (0, objects_1.jsiiTypeFqn)(value) ?? (isByReferenceOnly(value) ? exports.EMPTY_OBJECT_FQN : undefined);
9214
+ const jsiiType = (_a = (0, objects_1.jsiiTypeFqn)(value)) !== null && _a !== void 0 ? _a : isByReferenceOnly(value) ? exports.EMPTY_OBJECT_FQN : undefined;
9183
9215
  if (jsiiType) {
9184
9216
  return host.objects.registerObject(value, jsiiType);
9185
9217
  }
9186
- return mapValues(value, (v => host.recurse(v, {
9218
+ return mapValues(value, ((v, key) => process(host, "serialize", v, {
9187
9219
  type: spec.CANONICAL_ANY
9188
- })));
9220
+ }, `key ${(0, util_1.inspect)(key)}`)));
9189
9221
  },
9190
9222
  deserialize(value, _type, host) {
9191
9223
  if (value == null) {
@@ -9201,9 +9233,9 @@ var __webpack_modules__ = {
9201
9233
  }
9202
9234
  if (Array.isArray(value)) {
9203
9235
  host.debug("ANY is an Array");
9204
- return value.map((e => host.recurse(e, {
9236
+ return value.map(((e, idx) => process(host, "deserialize", e, {
9205
9237
  type: spec.CANONICAL_ANY
9206
- })));
9238
+ }, `index ${(0, util_1.inspect)(idx)}`)));
9207
9239
  }
9208
9240
  if ((0, api_1.isWireEnum)(value)) {
9209
9241
  host.debug("ANY is an Enum");
@@ -9235,9 +9267,9 @@ var __webpack_modules__ = {
9235
9267
  }, host);
9236
9268
  }
9237
9269
  host.debug("ANY is a Map");
9238
- return mapValues(value, (v => host.recurse(v, {
9270
+ return mapValues(value, ((v, key) => process(host, "deserialize", v, {
9239
9271
  type: spec.CANONICAL_ANY
9240
- })));
9272
+ }, `key ${(0, util_1.inspect)(key)}`)));
9241
9273
  }
9242
9274
  }
9243
9275
  };
@@ -9253,20 +9285,18 @@ var __webpack_modules__ = {
9253
9285
  const enumLocator = value[api_1.TOKEN_ENUM];
9254
9286
  const sep = enumLocator.lastIndexOf("/");
9255
9287
  if (sep === -1) {
9256
- throw new Error(`Malformed enum value: ${JSON.stringify(value)}`);
9288
+ throw new SerializationError(`Invalid enum token value ${(0, util_1.inspect)(enumLocator)}`, value);
9257
9289
  }
9258
9290
  const typeName = enumLocator.slice(0, sep);
9259
9291
  const valueName = enumLocator.slice(sep + 1);
9260
9292
  const enumValue = lookup(typeName)[valueName];
9261
9293
  if (enumValue === undefined) {
9262
- throw new Error(`No enum member named ${valueName} in ${typeName}`);
9294
+ throw new SerializationError(`No such enum member: ${(0, util_1.inspect)(valueName)}`, value);
9263
9295
  }
9264
9296
  return enumValue;
9265
9297
  }
9266
9298
  function serializationType(typeRef, lookup) {
9267
- if (typeRef == null) {
9268
- throw new Error("Kernel error: expected type information, got 'undefined'");
9269
- }
9299
+ assert(typeRef != null, `Kernel error: expected type information, got ${(0, util_1.inspect)(typeRef)}`);
9270
9300
  if (typeRef === "void") {
9271
9301
  return [ {
9272
9302
  serializationClass: "Void",
@@ -9301,7 +9331,7 @@ var __webpack_modules__ = {
9301
9331
  typeRef
9302
9332
  } ];
9303
9333
  }
9304
- throw new Error("Unknown primitive type");
9334
+ assert(false, `Unknown primitive type: ${(0, util_1.inspect)(typeRef.type)}`);
9305
9335
  }
9306
9336
  if (spec.isCollectionTypeReference(typeRef.type)) {
9307
9337
  return [ {
@@ -9344,7 +9374,7 @@ var __webpack_modules__ = {
9344
9374
  return false;
9345
9375
  }
9346
9376
  if (type !== "void" && !type.optional) {
9347
- throw new Error(`Got 'undefined' for non-optional instance of ${JSON.stringify(type)}`);
9377
+ throw new SerializationError(`A value is required (type is non-optional)`, x);
9348
9378
  }
9349
9379
  return true;
9350
9380
  }
@@ -9363,7 +9393,10 @@ var __webpack_modules__ = {
9363
9393
  }
9364
9394
  function mapValues(value, fn) {
9365
9395
  if (typeof value !== "object" || value == null) {
9366
- throw new Error(`Expected object type, got ${JSON.stringify(value)}`);
9396
+ throw new SerializationError(`Value is not an object`, value);
9397
+ }
9398
+ if (Array.isArray(value)) {
9399
+ throw new SerializationError(`Value is an array`, value);
9367
9400
  }
9368
9401
  const out = {};
9369
9402
  for (const [k, v] of Object.entries(value)) {
@@ -9376,6 +9409,7 @@ var __webpack_modules__ = {
9376
9409
  return out;
9377
9410
  }
9378
9411
  function propertiesOf(t, lookup) {
9412
+ var _a;
9379
9413
  if (!spec.isClassOrInterfaceType(t)) {
9380
9414
  return {};
9381
9415
  }
@@ -9394,7 +9428,7 @@ var __webpack_modules__ = {
9394
9428
  ...propertiesOf(lookup(t.base), lookup)
9395
9429
  };
9396
9430
  }
9397
- for (const prop of t.properties ?? []) {
9431
+ for (const prop of (_a = t.properties) !== null && _a !== void 0 ? _a : []) {
9398
9432
  ret[prop.name] = prop;
9399
9433
  }
9400
9434
  return ret;
@@ -9420,7 +9454,8 @@ var __webpack_modules__ = {
9420
9454
  function validateRequiredProps(actualProps, typeName, specProps) {
9421
9455
  const missingRequiredProps = Object.keys(specProps).filter((name => !specProps[name].optional)).filter((name => !(name in actualProps)));
9422
9456
  if (missingRequiredProps.length > 0) {
9423
- throw new Error(`Missing required properties for ${typeName}: ${missingRequiredProps.join(", ")}`);
9457
+ throw new SerializationError(`Missing required properties for ${typeName}: ${missingRequiredProps.map((p => (0,
9458
+ util_1.inspect)(p))).join(", ")}`, actualProps);
9424
9459
  }
9425
9460
  return actualProps;
9426
9461
  }
@@ -9436,13 +9471,85 @@ var __webpack_modules__ = {
9436
9471
  do {
9437
9472
  for (const prop of Object.getOwnPropertyNames(curr)) {
9438
9473
  const descr = Object.getOwnPropertyDescriptor(curr, prop);
9439
- if (descr?.get != null || descr?.set != null || typeof descr?.value === "function") {
9474
+ if ((descr === null || descr === void 0 ? void 0 : descr.get) != null || (descr === null || descr === void 0 ? void 0 : descr.set) != null || typeof (descr === null || descr === void 0 ? void 0 : descr.value) === "function") {
9440
9475
  return true;
9441
9476
  }
9442
9477
  }
9443
9478
  } while (Object.getPrototypeOf(curr = Object.getPrototypeOf(curr)) != null);
9444
9479
  return false;
9445
9480
  }
9481
+ function process(host, serde, value, type, context) {
9482
+ const wireTypes = serializationType(type, host.lookupType);
9483
+ host.debug(serde, value, wireTypes);
9484
+ const errors = new Array;
9485
+ for (const {serializationClass, typeRef} of wireTypes) {
9486
+ try {
9487
+ return exports.SERIALIZERS[serializationClass][serde](value, typeRef, host);
9488
+ } catch (error) {
9489
+ error.context = `as ${typeRef === VOID ? VOID : spec.describeTypeReference(typeRef.type)}`;
9490
+ errors.push(error);
9491
+ }
9492
+ }
9493
+ const typeDescr = type === VOID ? type : spec.describeTypeReference(type.type);
9494
+ const optionalTypeDescr = type !== VOID && type.optional ? `${typeDescr} | undefined` : typeDescr;
9495
+ throw new SerializationError(`${titleize(context)}: Unable to ${serde} value as ${optionalTypeDescr}`, value, errors, {
9496
+ renderValue: true
9497
+ });
9498
+ function titleize(text) {
9499
+ text = text.trim();
9500
+ if (text === "") {
9501
+ return text;
9502
+ }
9503
+ const [first, ...rest] = text;
9504
+ return [ first.toUpperCase(), ...rest ].join("");
9505
+ }
9506
+ }
9507
+ exports.process = process;
9508
+ class SerializationError extends Error {
9509
+ constructor(message, value, causes = [], {renderValue = false} = {}) {
9510
+ super([ message, ...renderValue ? [ `${causes.length > 0 ? "├" : "╰"}── 🛑 Failing value is ${describeTypeOf(value)}`, ...value == null ? [] : (0,
9511
+ util_1.inspect)(value, false, 0).split("\n").map((l => `${causes.length > 0 ? "│" : " "} ${l}`)) ] : [], ...causes.length > 0 ? [ "╰── 🔍 Failure reason(s):", ...causes.map(((cause, idx) => {
9512
+ var _a;
9513
+ return ` ${idx < causes.length - 1 ? "├" : "╰"}─${causes.length > 1 ? ` [${(_a = cause.context) !== null && _a !== void 0 ? _a : (0,
9514
+ util_1.inspect)(idx)}]` : ""} ${cause.message.split("\n").join("\n ")}`;
9515
+ })) ] : [] ].join("\n"));
9516
+ this.value = value;
9517
+ this.causes = causes;
9518
+ this.name = "@jsii/kernel.SerializationError";
9519
+ }
9520
+ }
9521
+ exports.SerializationError = SerializationError;
9522
+ function describeTypeOf(value) {
9523
+ const type = typeof value;
9524
+ switch (type) {
9525
+ case "object":
9526
+ if (value == null) {
9527
+ return JSON.stringify(value);
9528
+ }
9529
+ if (Array.isArray(value)) {
9530
+ return "an array";
9531
+ }
9532
+ const fqn = (0, objects_1.jsiiTypeFqn)(value);
9533
+ if (fqn != null && fqn !== exports.EMPTY_OBJECT_FQN) {
9534
+ return `an instance of ${fqn}`;
9535
+ }
9536
+ const ctorName = value.constructor.name;
9537
+ if (ctorName != null && ctorName !== Object.name) {
9538
+ return `an instance of ${ctorName}`;
9539
+ }
9540
+ return `an object`;
9541
+
9542
+ case "undefined":
9543
+ return type;
9544
+
9545
+ case "boolean":
9546
+ case "function":
9547
+ case "number":
9548
+ case "string":
9549
+ default:
9550
+ return `a ${type}`;
9551
+ }
9552
+ }
9446
9553
  },
9447
9554
  7905: (__unused_webpack_module, exports, __webpack_require__) => {
9448
9555
  "use strict";
@@ -9461,9 +9568,10 @@ var __webpack_modules__ = {
9461
9568
  this.kernel.traceEnabled = opts.debug ? true : false;
9462
9569
  }
9463
9570
  run() {
9571
+ var _a;
9464
9572
  const req = this.inout.read();
9465
9573
  if (!req || "exit" in req) {
9466
- this.eventEmitter.emit("exit", req?.exit ?? 0);
9574
+ this.eventEmitter.emit("exit", (_a = req === null || req === void 0 ? void 0 : req.exit) !== null && _a !== void 0 ? _a : 0);
9467
9575
  return;
9468
9576
  }
9469
9577
  this.processRequest(req, (() => {
@@ -9556,7 +9664,7 @@ var __webpack_modules__ = {
9556
9664
  this.inout.write(res);
9557
9665
  }
9558
9666
  isPromise(v) {
9559
- return typeof v?.then === "function";
9667
+ return typeof (v === null || v === void 0 ? void 0 : v.then) === "function";
9560
9668
  }
9561
9669
  findApi(apiName) {
9562
9670
  const fn = this.kernel[apiName];
@@ -9663,13 +9771,87 @@ var __webpack_modules__ = {
9663
9771
  }
9664
9772
  exports.SyncStdio = SyncStdio;
9665
9773
  },
9774
+ 1228: (__unused_webpack_module, exports, __webpack_require__) => {
9775
+ "use strict";
9776
+ Object.defineProperty(exports, "__esModule", {
9777
+ value: true
9778
+ });
9779
+ exports.loadAssemblyFromFile = exports.loadAssemblyFromPath = exports.loadAssemblyFromBuffer = exports.writeAssembly = exports.findAssemblyFile = void 0;
9780
+ const fs = __webpack_require__(7147);
9781
+ const path = __webpack_require__(4822);
9782
+ const zlib = __webpack_require__(9796);
9783
+ const assembly_1 = __webpack_require__(2752);
9784
+ const redirect_1 = __webpack_require__(9639);
9785
+ const validate_assembly_1 = __webpack_require__(5907);
9786
+ function findAssemblyFile(directory) {
9787
+ const dotJsiiFile = path.join(directory, assembly_1.SPEC_FILE_NAME);
9788
+ if (!fs.existsSync(dotJsiiFile)) {
9789
+ throw new Error(`Expected to find ${assembly_1.SPEC_FILE_NAME} file in ${directory}, but no such file found`);
9790
+ }
9791
+ return dotJsiiFile;
9792
+ }
9793
+ exports.findAssemblyFile = findAssemblyFile;
9794
+ function writeAssembly(directory, assembly, {compress = false} = {}) {
9795
+ if (compress) {
9796
+ fs.writeFileSync(path.join(directory, assembly_1.SPEC_FILE_NAME), JSON.stringify({
9797
+ schema: "jsii/file-redirect",
9798
+ compression: "gzip",
9799
+ filename: assembly_1.SPEC_FILE_NAME_COMPRESSED
9800
+ }), "utf-8");
9801
+ fs.writeFileSync(path.join(directory, assembly_1.SPEC_FILE_NAME_COMPRESSED), zlib.gzipSync(JSON.stringify(assembly)));
9802
+ } else {
9803
+ fs.writeFileSync(path.join(directory, assembly_1.SPEC_FILE_NAME), JSON.stringify(assembly, null, 2), "utf-8");
9804
+ }
9805
+ return compress;
9806
+ }
9807
+ exports.writeAssembly = writeAssembly;
9808
+ const failNoReadfileProvided = filename => {
9809
+ throw new Error(`Unable to load assembly support file ${JSON.stringify(filename)}: no readFile callback provided!`);
9810
+ };
9811
+ function loadAssemblyFromBuffer(assemblyBuffer, readFile = failNoReadfileProvided, validate = true) {
9812
+ let contents = JSON.parse(assemblyBuffer.toString("utf-8"));
9813
+ while ((0, redirect_1.isAssemblyRedirect)(contents)) {
9814
+ contents = followRedirect(contents, readFile);
9815
+ }
9816
+ return validate ? (0, validate_assembly_1.validateAssembly)(contents) : contents;
9817
+ }
9818
+ exports.loadAssemblyFromBuffer = loadAssemblyFromBuffer;
9819
+ function loadAssemblyFromPath(directory, validate = true) {
9820
+ const assemblyFile = findAssemblyFile(directory);
9821
+ return loadAssemblyFromFile(assemblyFile, validate);
9822
+ }
9823
+ exports.loadAssemblyFromPath = loadAssemblyFromPath;
9824
+ function loadAssemblyFromFile(pathToFile, validate = true) {
9825
+ const data = fs.readFileSync(pathToFile);
9826
+ return loadAssemblyFromBuffer(data, (filename => fs.readFileSync(path.resolve(pathToFile, "..", filename))), validate);
9827
+ }
9828
+ exports.loadAssemblyFromFile = loadAssemblyFromFile;
9829
+ function followRedirect(assemblyRedirect, readFile) {
9830
+ (0, redirect_1.validateAssemblyRedirect)(assemblyRedirect);
9831
+ let data = readFile(assemblyRedirect.filename);
9832
+ switch (assemblyRedirect.compression) {
9833
+ case "gzip":
9834
+ data = zlib.gunzipSync(data);
9835
+ break;
9836
+
9837
+ case undefined:
9838
+ break;
9839
+
9840
+ default:
9841
+ throw new Error(`Unsupported compression algorithm: ${JSON.stringify(assemblyRedirect.compression)}`);
9842
+ }
9843
+ const json = data.toString("utf-8");
9844
+ return JSON.parse(json);
9845
+ }
9846
+ },
9666
9847
  2752: (__unused_webpack_module, exports) => {
9667
9848
  "use strict";
9668
9849
  Object.defineProperty(exports, "__esModule", {
9669
9850
  value: true
9670
9851
  });
9671
- exports.isDeprecated = exports.describeTypeReference = exports.isClassOrInterfaceType = exports.isEnumType = exports.isInterfaceType = exports.isClassType = exports.TypeKind = exports.isMethod = exports.isUnionTypeReference = exports.isCollectionTypeReference = exports.isPrimitiveTypeReference = exports.isNamedTypeReference = exports.CANONICAL_ANY = exports.PrimitiveType = exports.CollectionKind = exports.Stability = exports.SchemaVersion = exports.SPEC_FILE_NAME = void 0;
9852
+ exports.isDeprecated = exports.describeTypeReference = exports.isClassOrInterfaceType = exports.isEnumType = exports.isInterfaceType = exports.isClassType = exports.TypeKind = exports.isMethod = exports.isUnionTypeReference = exports.isCollectionTypeReference = exports.isPrimitiveTypeReference = exports.isNamedTypeReference = exports.CANONICAL_ANY = exports.PrimitiveType = exports.CollectionKind = exports.Stability = exports.SchemaVersion = exports.SPEC_FILE_NAME_COMPRESSED = exports.SPEC_FILE_NAME = void 0;
9672
9853
  exports.SPEC_FILE_NAME = ".jsii";
9854
+ exports.SPEC_FILE_NAME_COMPRESSED = `${exports.SPEC_FILE_NAME}.gz`;
9673
9855
  var SchemaVersion;
9674
9856
  (function(SchemaVersion) {
9675
9857
  SchemaVersion["LATEST"] = "jsii/0.10.0";
@@ -9796,8 +9978,10 @@ var __webpack_modules__ = {
9796
9978
  value: true
9797
9979
  });
9798
9980
  __exportStar(__webpack_require__(2752), exports);
9981
+ __exportStar(__webpack_require__(1228), exports);
9799
9982
  __exportStar(__webpack_require__(5585), exports);
9800
9983
  __exportStar(__webpack_require__(1485), exports);
9984
+ __exportStar(__webpack_require__(9639), exports);
9801
9985
  __exportStar(__webpack_require__(5907), exports);
9802
9986
  },
9803
9987
  1485: (__unused_webpack_module, exports) => {
@@ -9838,6 +10022,33 @@ var __webpack_modules__ = {
9838
10022
  }
9839
10023
  exports.NameTree = NameTree;
9840
10024
  },
10025
+ 9639: (__unused_webpack_module, exports, __webpack_require__) => {
10026
+ "use strict";
10027
+ Object.defineProperty(exports, "__esModule", {
10028
+ value: true
10029
+ });
10030
+ exports.validateAssemblyRedirect = exports.isAssemblyRedirect = exports.assemblyRedirectSchema = void 0;
10031
+ const ajv_1 = __webpack_require__(2785);
10032
+ exports.assemblyRedirectSchema = __webpack_require__(6715);
10033
+ const SCHEMA = "jsii/file-redirect";
10034
+ function isAssemblyRedirect(obj) {
10035
+ if (typeof obj !== "object" || obj == null) {
10036
+ return false;
10037
+ }
10038
+ return obj.schema === SCHEMA;
10039
+ }
10040
+ exports.isAssemblyRedirect = isAssemblyRedirect;
10041
+ function validateAssemblyRedirect(obj) {
10042
+ const ajv = new ajv_1.default;
10043
+ const validate = ajv.compile(exports.assemblyRedirectSchema);
10044
+ validate(obj);
10045
+ if (validate.errors) {
10046
+ throw new Error(`Invalid assembly redirect:\n${validate.errors.map((e => ` * ${e.message}`)).join("\n").toString()}`);
10047
+ }
10048
+ return obj;
10049
+ }
10050
+ exports.validateAssemblyRedirect = validateAssemblyRedirect;
10051
+ },
9841
10052
  5907: (__unused_webpack_module, exports, __webpack_require__) => {
9842
10053
  "use strict";
9843
10054
  Object.defineProperty(exports, "__esModule", {
@@ -15124,7 +15335,7 @@ var __webpack_modules__ = {
15124
15335
  },
15125
15336
  4147: module => {
15126
15337
  "use strict";
15127
- module.exports = JSON.parse('{"name":"@jsii/runtime","version":"1.61.0","description":"jsii runtime kernel process","license":"Apache-2.0","author":{"name":"Amazon Web Services","url":"https://aws.amazon.com"},"homepage":"https://github.com/aws/jsii","bugs":{"url":"https://github.com/aws/jsii/issues"},"repository":{"type":"git","url":"https://github.com/aws/jsii.git","directory":"packages/@jsii/runtime"},"engines":{"node":">= 14.6.0"},"main":"lib/index.js","types":"lib/index.d.ts","bin":{"jsii-runtime":"bin/jsii-runtime"},"scripts":{"build":"tsc --build && chmod +x bin/jsii-runtime && npx webpack-cli && npm run lint","watch":"tsc --build -w","lint":"eslint . --ext .js,.ts --ignore-path=.gitignore --ignore-pattern=webpack.config.js","lint:fix":"yarn lint --fix","test":"jest","test:update":"jest -u","package":"package-js"},"dependencies":{"@jsii/kernel":"^1.61.0","@jsii/check-node":"1.61.0","@jsii/spec":"^1.61.0"},"devDependencies":{"@scope/jsii-calc-base":"^1.61.0","@scope/jsii-calc-lib":"^1.61.0","jsii-build-tools":"^1.61.0","jsii-calc":"^3.20.120","source-map-loader":"^4.0.0","webpack":"^5.73.0","webpack-cli":"^4.10.0"}}');
15338
+ module.exports = JSON.parse('{"name":"@jsii/runtime","version":"1.62.0","description":"jsii runtime kernel process","license":"Apache-2.0","author":{"name":"Amazon Web Services","url":"https://aws.amazon.com"},"homepage":"https://github.com/aws/jsii","bugs":{"url":"https://github.com/aws/jsii/issues"},"repository":{"type":"git","url":"https://github.com/aws/jsii.git","directory":"packages/@jsii/runtime"},"engines":{"node":">= 14.6.0"},"main":"lib/index.js","types":"lib/index.d.ts","bin":{"jsii-runtime":"bin/jsii-runtime"},"scripts":{"build":"tsc --build && chmod +x bin/jsii-runtime && npx webpack-cli && npm run lint","watch":"tsc --build -w","lint":"eslint . --ext .js,.ts --ignore-path=.gitignore --ignore-pattern=webpack.config.js","lint:fix":"yarn lint --fix","test":"jest","test:update":"jest -u","package":"package-js"},"dependencies":{"@jsii/kernel":"^1.62.0","@jsii/check-node":"1.62.0","@jsii/spec":"^1.62.0"},"devDependencies":{"@scope/jsii-calc-base":"^1.62.0","@scope/jsii-calc-lib":"^1.62.0","jsii-build-tools":"^1.62.0","jsii-calc":"^3.20.120","source-map-loader":"^4.0.0","webpack":"^5.73.0","webpack-cli":"^4.10.0"}}');
15128
15339
  },
15129
15340
  5277: module => {
15130
15341
  "use strict";
@@ -15134,6 +15345,10 @@ var __webpack_modules__ = {
15134
15345
  "use strict";
15135
15346
  module.exports = JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}');
15136
15347
  },
15348
+ 6715: module => {
15349
+ "use strict";
15350
+ module.exports = JSON.parse('{"$ref":"#/definitions/AssemblyRedirect","$schema":"http://json-schema.org/draft-07/schema#","definitions":{"AssemblyRedirect":{"properties":{"compression":{"description":"The compression applied to the target file, if any.","enum":["gzip"],"type":"string"},"filename":{"description":"The name of the file the assembly is redirected to.","type":"string"},"schema":{"enum":["jsii/file-redirect"],"type":"string"}},"required":["filename","schema"],"type":"object"}}}');
15351
+ },
15137
15352
  9402: module => {
15138
15353
  "use strict";
15139
15354
  module.exports = JSON.parse('{"$ref":"#/definitions/Assembly","$schema":"http://json-schema.org/draft-07/schema#","definitions":{"Assembly":{"description":"A JSII assembly specification.","properties":{"author":{"$ref":"#/definitions/Person","description":"The main author of this package."},"bin":{"additionalProperties":{"type":"string"},"default":"none","description":"List of bin-scripts","type":"object"},"bundled":{"additionalProperties":{"type":"string"},"default":"none","description":"List if bundled dependencies (these are not expected to be jsii\\nassemblies).","type":"object"},"contributors":{"default":"none","description":"Additional contributors to this package.","items":{"$ref":"#/definitions/Person"},"type":"array"},"dependencies":{"additionalProperties":{"type":"string"},"default":"none","description":"Direct dependencies on other assemblies (with semver), the key is the JSII\\nassembly name, and the value is a SemVer expression.","type":"object"},"dependencyClosure":{"additionalProperties":{"$ref":"#/definitions/DependencyConfiguration"},"default":"none","description":"Target configuration for all the assemblies that are direct or transitive\\ndependencies of this assembly. This is needed to generate correct native\\ntype names for any transitively inherited member, in certain languages.","type":"object"},"description":{"description":"Description of the assembly, maps to \\"description\\" from package.json\\nThis is required since some package managers (like Maven) require it.","type":"string"},"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"fingerprint":{"description":"A fingerprint that can be used to determine if the specification has\\nchanged.","minLength":1,"type":"string"},"homepage":{"description":"The url to the project homepage. Maps to \\"homepage\\" from package.json.","type":"string"},"jsiiVersion":{"description":"The version of the jsii compiler that was used to produce this Assembly.","minLength":1,"type":"string"},"keywords":{"description":"Keywords that help discover or identify this packages with respects to it\'s\\nintended usage, audience, etc... Where possible, this will be rendered in\\nthe corresponding metadata section of idiomatic package manifests, for\\nexample NuGet package tags.","items":{"type":"string"},"type":"array"},"license":{"description":"The SPDX name of the license this assembly is distributed on.","type":"string"},"metadata":{"additionalProperties":{},"default":"none","description":"Arbitrary key-value pairs of metadata, which the maintainer chose to\\ndocument with the assembly. These entries do not carry normative\\nsemantics and their interpretation is up to the assembly maintainer.","type":"object"},"name":{"description":"The name of the assembly","minLength":1,"type":"string"},"readme":{"$ref":"#/definitions/ReadMe","default":"none","description":"The readme document for this module (if any)."},"repository":{"description":"The module repository, maps to \\"repository\\" from package.json\\nThis is required since some package managers (like Maven) require it.","properties":{"directory":{"default":"the root of the repository","description":"If the package is not in the root directory (for example, when part\\nof a monorepo), you should specify the directory in which it lives.","type":"string"},"type":{"description":"The type of the repository (``git``, ``svn``, ...)","type":"string"},"url":{"description":"The URL of the repository.","type":"string"}},"required":["type","url"],"type":"object"},"schema":{"description":"The version of the spec schema","enum":["jsii/0.10.0"],"type":"string"},"submodules":{"additionalProperties":{"allOf":[{"$ref":"#/definitions/ReadMeContainer"},{"$ref":"#/definitions/SourceLocatable"},{"$ref":"#/definitions/Targetable"},{"$ref":"#/definitions/TypeScriptLocatable"}],"description":"A submodule\\n\\nThe difference between a top-level module (the assembly) and a submodule is\\nthat the submodule is annotated with its location in the repository."},"default":"none","description":"Submodules declared in this assembly.","type":"object"},"targets":{"$ref":"#/definitions/AssemblyTargets","default":"none","description":"A map of target name to configuration, which is used when generating\\npackages for various languages."},"types":{"additionalProperties":{"anyOf":[{"allOf":[{"$ref":"#/definitions/TypeBase"},{"$ref":"#/definitions/ClassType"}]},{"allOf":[{"$ref":"#/definitions/TypeBase"},{"$ref":"#/definitions/EnumType"}]},{"allOf":[{"$ref":"#/definitions/TypeBase"},{"$ref":"#/definitions/InterfaceType"}]}],"description":"Represents a type definition (not a type reference)."},"default":"none","description":"All types in the assembly, keyed by their fully-qualified-name","type":"object"},"version":{"description":"The version of the assembly","minLength":1,"type":"string"}},"required":["author","description","fingerprint","homepage","jsiiVersion","license","name","repository","schema","version"],"type":"object"},"AssemblyTargets":{"additionalProperties":{"additionalProperties":{},"type":"object"},"description":"Configurable targets for an asembly.","type":"object"},"Callable":{"description":"An Initializer or a Method.","properties":{"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"locationInModule":{"$ref":"#/definitions/SourceLocation","default":"none","description":"Where in the module this definition was found\\n\\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\\nfile combining compiled code and its manifest, whereas this is referring\\nto the location of the source in the module the assembly was built from."},"overrides":{"default":"this member is not overriding anything","description":"The FQN of the parent type (class or interface) that this entity\\noverrides or implements. If undefined, then this entity is the first in\\nit\'s hierarchy to declare this entity.","type":"string"},"parameters":{"default":"none","description":"The parameters of the Initializer or Method.","items":{"$ref":"#/definitions/Parameter"},"type":"array"},"protected":{"default":false,"description":"Indicates if this Initializer or Method is protected (otherwise it is\\npublic, since private members are not modeled).","type":"boolean"},"variadic":{"default":false,"description":"Indicates whether this Initializer or Method is variadic or not. When\\n``true``, the last element of ``#parameters`` will also be flagged\\n``#variadic``.","type":"boolean"}},"type":"object"},"ClassType":{"description":"Represents classes.","properties":{"abstract":{"default":false,"description":"Indicates if this class is an abstract class.","type":"boolean"},"assembly":{"description":"The name of the assembly the type belongs to.","minLength":1,"type":"string"},"base":{"default":"no base class","description":"The FQN of the base class of this class, if it has one.","type":"string"},"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"fqn":{"description":"The fully qualified name of the type (``<assembly>.<namespace>.<name>``)","minLength":3,"type":"string"},"initializer":{"$ref":"#/definitions/Callable","default":"no initializer","description":"Initializer (constructor) method."},"interfaces":{"default":"none","description":"The FQNs of the interfaces this class implements, if any.","items":{"type":"string"},"type":"array","uniqueItems":true},"kind":{"description":"The kind of the type.","enum":["class"],"type":"string"},"locationInModule":{"$ref":"#/definitions/SourceLocation","default":"none","description":"Where in the module this definition was found\\n\\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\\nfile combining compiled code and its manifest, whereas this is referring\\nto the location of the source in the module the assembly was built from."},"methods":{"default":"none","description":"List of methods.","items":{"$ref":"#/definitions/Method"},"type":"array"},"name":{"description":"The simple name of the type (MyClass).","minLength":1,"type":"string"},"namespace":{"default":"none","description":"The namespace of the type (`foo.bar.baz`).\\n\\nWhen undefined, the type is located at the root of the assembly (its\\n`fqn` would be like `<assembly>.<name>`).\\n\\nFor types inside other types or inside submodules, the `<namespace>` corresponds to\\nthe namespace-qualified name of the container (can contain multiple segments like:\\n`<ns1>.<ns2>.<ns3>`).\\n\\nIn all cases:\\n\\n <fqn> = <assembly>[.<namespace>].<name>","type":"string"},"properties":{"default":"none","description":"List of properties.","items":{"$ref":"#/definitions/Property"},"type":"array"},"symbolId":{"description":"Unique string representation of the corresponding Typescript symbol\\n\\nUsed to map from TypeScript code back into the assembly.","type":"string"}},"required":["assembly","fqn","kind","name"],"type":"object"},"CollectionKind":{"description":"Kinds of collections.","enum":["array","map"],"type":"string"},"CollectionTypeReference":{"description":"Reference to a collection type.","properties":{"collection":{"properties":{"elementtype":{"$ref":"#/definitions/TypeReference","description":"The type of an element (map keys are always strings)."},"kind":{"$ref":"#/definitions/CollectionKind","description":"The kind of collection."}},"required":["elementtype","kind"],"type":"object"}},"required":["collection"],"type":"object"},"DependencyConfiguration":{"properties":{"submodules":{"additionalProperties":{"$ref":"#/definitions/Targetable"},"type":"object"},"targets":{"$ref":"#/definitions/AssemblyTargets","default":"none","description":"A map of target name to configuration, which is used when generating\\npackages for various languages."}},"type":"object"},"Docs":{"description":"Key value pairs of documentation nodes.\\nBased on TSDoc.","properties":{"custom":{"additionalProperties":{"type":"string"},"default":"none","description":"Custom tags that are not any of the default ones","type":"object"},"default":{"default":"none","description":"Description of the default","type":"string"},"deprecated":{"default":"none","description":"If present, this block indicates that an API item is no longer supported\\nand may be removed in a future release. The `@deprecated` tag must be\\nfollowed by a sentence describing the recommended alternative.\\nDeprecation recursively applies to members of a container. For example,\\nif a class is deprecated, then so are all of its members.","type":"string"},"example":{"default":"none","description":"Example showing the usage of this API item\\n\\nStarts off in running text mode, may switch to code using fenced code\\nblocks.","type":"string"},"remarks":{"default":"none","description":"Detailed information about an API item.\\n\\nEither the explicitly tagged `@remarks` section, otherwise everything\\npast the first paragraph if there is no `@remarks` tag.","type":"string"},"returns":{"default":"none","description":"The `@returns` block for this doc comment, or undefined if there is not\\none.","type":"string"},"see":{"default":"none","description":"A `@see` link with more information","type":"string"},"stability":{"description":"Whether the API item is beta/experimental quality","enum":["deprecated","experimental","external","stable"],"type":"string"},"subclassable":{"default":false,"description":"Whether this class or interface was intended to be subclassed/implemented\\nby library users.\\n\\nClasses intended for subclassing, and interfaces intended to be\\nimplemented by consumers, are held to stricter standards of API\\ncompatibility.","type":"boolean"},"summary":{"default":"none","description":"Summary documentation for an API item.\\n\\nThe first part of the documentation before hitting a `@remarks` tags, or\\nthe first line of the doc comment block if there is no `@remarks` tag.","type":"string"}},"type":"object"},"EnumMember":{"description":"Represents a member of an enum.","properties":{"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"name":{"description":"The name/symbol of the member.","type":"string"}},"required":["name"],"type":"object"},"EnumType":{"description":"Represents an enum type.","properties":{"assembly":{"description":"The name of the assembly the type belongs to.","minLength":1,"type":"string"},"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"fqn":{"description":"The fully qualified name of the type (``<assembly>.<namespace>.<name>``)","minLength":3,"type":"string"},"kind":{"description":"The kind of the type.","enum":["enum"],"type":"string"},"locationInModule":{"$ref":"#/definitions/SourceLocation","default":"none","description":"Where in the module this definition was found\\n\\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\\nfile combining compiled code and its manifest, whereas this is referring\\nto the location of the source in the module the assembly was built from."},"members":{"description":"Members of the enum.","items":{"$ref":"#/definitions/EnumMember"},"type":"array"},"name":{"description":"The simple name of the type (MyClass).","minLength":1,"type":"string"},"namespace":{"default":"none","description":"The namespace of the type (`foo.bar.baz`).\\n\\nWhen undefined, the type is located at the root of the assembly (its\\n`fqn` would be like `<assembly>.<name>`).\\n\\nFor types inside other types or inside submodules, the `<namespace>` corresponds to\\nthe namespace-qualified name of the container (can contain multiple segments like:\\n`<ns1>.<ns2>.<ns3>`).\\n\\nIn all cases:\\n\\n <fqn> = <assembly>[.<namespace>].<name>","type":"string"},"symbolId":{"description":"Unique string representation of the corresponding Typescript symbol\\n\\nUsed to map from TypeScript code back into the assembly.","type":"string"}},"required":["assembly","fqn","kind","members","name"],"type":"object"},"InterfaceType":{"properties":{"assembly":{"description":"The name of the assembly the type belongs to.","minLength":1,"type":"string"},"datatype":{"default":false,"description":"True if this interface only contains properties. Different backends might\\nhave idiomatic ways to allow defining concrete instances such interfaces.\\nFor example, in Java, the generator will produce a PoJo and a builder\\nwhich will allow users to create a concrete object with data which\\nadheres to this interface.","type":"boolean"},"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"fqn":{"description":"The fully qualified name of the type (``<assembly>.<namespace>.<name>``)","minLength":3,"type":"string"},"interfaces":{"default":"none","description":"The FQNs of the interfaces this interface extends, if any.","items":{"type":"string"},"type":"array","uniqueItems":true},"kind":{"description":"The kind of the type.","enum":["interface"],"type":"string"},"locationInModule":{"$ref":"#/definitions/SourceLocation","default":"none","description":"Where in the module this definition was found\\n\\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\\nfile combining compiled code and its manifest, whereas this is referring\\nto the location of the source in the module the assembly was built from."},"methods":{"default":"none","description":"List of methods.","items":{"$ref":"#/definitions/Method"},"type":"array"},"name":{"description":"The simple name of the type (MyClass).","minLength":1,"type":"string"},"namespace":{"default":"none","description":"The namespace of the type (`foo.bar.baz`).\\n\\nWhen undefined, the type is located at the root of the assembly (its\\n`fqn` would be like `<assembly>.<name>`).\\n\\nFor types inside other types or inside submodules, the `<namespace>` corresponds to\\nthe namespace-qualified name of the container (can contain multiple segments like:\\n`<ns1>.<ns2>.<ns3>`).\\n\\nIn all cases:\\n\\n <fqn> = <assembly>[.<namespace>].<name>","type":"string"},"properties":{"default":"none","description":"List of properties.","items":{"$ref":"#/definitions/Property"},"type":"array"},"symbolId":{"description":"Unique string representation of the corresponding Typescript symbol\\n\\nUsed to map from TypeScript code back into the assembly.","type":"string"}},"required":["assembly","fqn","kind","name"],"type":"object"},"Method":{"description":"A method with a name (i.e: not an initializer).","properties":{"abstract":{"default":false,"description":"Is this method an abstract method (this means the class will also be an abstract class)","type":"boolean"},"async":{"default":false,"description":"Indicates if this is an asynchronous method (it will return a promise).","type":"boolean"},"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"locationInModule":{"$ref":"#/definitions/SourceLocation","default":"none","description":"Where in the module this definition was found\\n\\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\\nfile combining compiled code and its manifest, whereas this is referring\\nto the location of the source in the module the assembly was built from."},"name":{"description":"The name of the method. Undefined if this method is a initializer.","type":"string"},"overrides":{"default":"this member is not overriding anything","description":"The FQN of the parent type (class or interface) that this entity\\noverrides or implements. If undefined, then this entity is the first in\\nit\'s hierarchy to declare this entity.","type":"string"},"parameters":{"default":"none","description":"The parameters of the Initializer or Method.","items":{"$ref":"#/definitions/Parameter"},"type":"array"},"protected":{"default":false,"description":"Indicates if this Initializer or Method is protected (otherwise it is\\npublic, since private members are not modeled).","type":"boolean"},"returns":{"$ref":"#/definitions/OptionalValue","default":"void","description":"The return type of the method (`undefined` if `void`)"},"static":{"default":false,"description":"Indicates if this is a static method.","type":"boolean"},"variadic":{"default":false,"description":"Indicates whether this Initializer or Method is variadic or not. When\\n``true``, the last element of ``#parameters`` will also be flagged\\n``#variadic``.","type":"boolean"}},"required":["name"],"type":"object"},"NamedTypeReference":{"description":"Reference to a named type, defined by this assembly or one of its\\ndependencies.","properties":{"fqn":{"description":"The fully-qualified-name of the type (can be located in the\\n``spec.types[fqn]``` of the assembly that defines the type).","type":"string"}},"required":["fqn"],"type":"object"},"OptionalValue":{"description":"A value that can possibly be optional.","properties":{"optional":{"default":false,"description":"Determines whether the value is, indeed, optional.","type":"boolean"},"type":{"$ref":"#/definitions/TypeReference","description":"The declared type of the value, when it\'s present."}},"required":["type"],"type":"object"},"Parameter":{"description":"Represents a method parameter.","properties":{"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"name":{"description":"The name of the parameter.","minLength":1,"type":"string"},"optional":{"default":false,"description":"Determines whether the value is, indeed, optional.","type":"boolean"},"type":{"$ref":"#/definitions/TypeReference","description":"The declared type of the value, when it\'s present."},"variadic":{"default":false,"description":"Whether this is the last parameter of a variadic method. In such cases,\\nthe `#type` attribute is the type of each individual item of the variadic\\narguments list (as opposed to some array type, as for example TypeScript\\nwould model it).","type":"boolean"}},"required":["name","type"],"type":"object"},"Person":{"description":"Metadata about people or organizations associated with the project that\\nresulted in the Assembly. Some of this metadata is required in order to\\npublish to certain package repositories (for example, Maven Central), but is\\nnot normalized, and the meaning of fields (role, for example), is up to each\\nproject maintainer.","properties":{"email":{"default":"none","description":"The email of the person","type":"string"},"name":{"description":"The name of the person","type":"string"},"organization":{"default":false,"description":"If true, this person is, in fact, an organization","type":"boolean"},"roles":{"description":"A list of roles this person has in the project, for example `maintainer`,\\n`contributor`, `owner`, ...","items":{"type":"string"},"type":"array"},"url":{"default":"none","description":"The URL for the person","type":"string"}},"required":["name","roles"],"type":"object"},"PrimitiveType":{"description":"Kinds of primitive types.","enum":["any","boolean","date","json","number","string"],"type":"string"},"PrimitiveTypeReference":{"description":"Reference to a primitive type.","properties":{"primitive":{"$ref":"#/definitions/PrimitiveType","description":"If this is a reference to a primitive type, this will include the\\nprimitive type kind."}},"required":["primitive"],"type":"object"},"Property":{"description":"A class property.","properties":{"abstract":{"default":false,"description":"Indicates if this property is abstract","type":"boolean"},"const":{"default":false,"description":"A hint that indicates that this static, immutable property is initialized\\nduring startup. This allows emitting \\"const\\" idioms in different target\\nlanguages. Implies `static` and `immutable`.","type":"boolean"},"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"immutable":{"default":false,"description":"Indicates if this property only has a getter (immutable).","type":"boolean"},"locationInModule":{"$ref":"#/definitions/SourceLocation","default":"none","description":"Where in the module this definition was found\\n\\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\\nfile combining compiled code and its manifest, whereas this is referring\\nto the location of the source in the module the assembly was built from."},"name":{"description":"The name of the property.","minLength":1,"type":"string"},"optional":{"default":false,"description":"Determines whether the value is, indeed, optional.","type":"boolean"},"overrides":{"default":"this member is not overriding anything","description":"The FQN of the parent type (class or interface) that this entity\\noverrides or implements. If undefined, then this entity is the first in\\nit\'s hierarchy to declare this entity.","type":"string"},"protected":{"default":false,"description":"Indicates if this property is protected (otherwise it is public)","type":"boolean"},"static":{"default":false,"description":"Indicates if this is a static property.","type":"boolean"},"type":{"$ref":"#/definitions/TypeReference","description":"The declared type of the value, when it\'s present."}},"required":["name","type"],"type":"object"},"ReadMe":{"description":"README information","properties":{"markdown":{"type":"string"}},"required":["markdown"],"type":"object"},"ReadMeContainer":{"description":"Elements that can contain a `readme` property.","properties":{"readme":{"$ref":"#/definitions/ReadMe","default":"none","description":"The readme document for this module (if any)."}},"type":"object"},"SourceLocatable":{"description":"Indicates that an entity has a source location","properties":{"locationInModule":{"$ref":"#/definitions/SourceLocation","default":"none","description":"Where in the module this definition was found\\n\\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\\nfile combining compiled code and its manifest, whereas this is referring\\nto the location of the source in the module the assembly was built from."}},"type":"object"},"SourceLocation":{"description":"Where in the module source the definition for this API item was found","properties":{"filename":{"description":"Relative filename","type":"string"},"line":{"description":"1-based line number in the indicated file","type":"number"}},"required":["filename","line"],"type":"object"},"Targetable":{"description":"A targetable module-like thing\\n\\nHas targets and a readme. Used for Assemblies and Submodules.","properties":{"targets":{"$ref":"#/definitions/AssemblyTargets","default":"none","description":"A map of target name to configuration, which is used when generating\\npackages for various languages."}},"type":"object"},"TypeBase":{"description":"Common attributes of a type definition.","properties":{"assembly":{"description":"The name of the assembly the type belongs to.","minLength":1,"type":"string"},"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"fqn":{"description":"The fully qualified name of the type (``<assembly>.<namespace>.<name>``)","minLength":3,"type":"string"},"kind":{"$ref":"#/definitions/TypeKind","description":"The kind of the type."},"locationInModule":{"$ref":"#/definitions/SourceLocation","default":"none","description":"Where in the module this definition was found\\n\\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\\nfile combining compiled code and its manifest, whereas this is referring\\nto the location of the source in the module the assembly was built from."},"name":{"description":"The simple name of the type (MyClass).","minLength":1,"type":"string"},"namespace":{"default":"none","description":"The namespace of the type (`foo.bar.baz`).\\n\\nWhen undefined, the type is located at the root of the assembly (its\\n`fqn` would be like `<assembly>.<name>`).\\n\\nFor types inside other types or inside submodules, the `<namespace>` corresponds to\\nthe namespace-qualified name of the container (can contain multiple segments like:\\n`<ns1>.<ns2>.<ns3>`).\\n\\nIn all cases:\\n\\n <fqn> = <assembly>[.<namespace>].<name>","type":"string"},"symbolId":{"description":"Unique string representation of the corresponding Typescript symbol\\n\\nUsed to map from TypeScript code back into the assembly.","type":"string"}},"required":["assembly","fqn","kind","name"],"type":"object"},"TypeKind":{"description":"Kinds of types.","enum":["class","enum","interface"],"type":"string"},"TypeReference":{"anyOf":[{"$ref":"#/definitions/NamedTypeReference"},{"$ref":"#/definitions/PrimitiveTypeReference"},{"$ref":"#/definitions/CollectionTypeReference"},{"$ref":"#/definitions/UnionTypeReference"}],"description":"A reference to a type (primitive, collection or fqn)."},"TypeScriptLocatable":{"description":"Indicates that a jsii entity\'s origin can be traced to TypeScript code\\n\\nThis is interface is not the same as `SourceLocatable`. SourceLocatable\\nidentifies lines in source files in a source repository (in a `.ts` file,\\nwith respect to a git root).\\n\\nOn the other hand, `TypeScriptLocatable` identifies a symbol name inside a\\npotentially distributed TypeScript file (in either a `.d.ts` or `.ts`\\nfile, with respect to the package root).","properties":{"symbolId":{"description":"Unique string representation of the corresponding Typescript symbol\\n\\nUsed to map from TypeScript code back into the assembly.","type":"string"}},"type":"object"},"UnionTypeReference":{"description":"Reference to a union type.","properties":{"union":{"description":"Indicates that this is a union type, which means it can be one of a set\\nof types.","properties":{"types":{"description":"All the possible types (including the primary type).","items":{"$ref":"#/definitions/TypeReference"},"minItems":2,"type":"array"}},"required":["types"],"type":"object"}},"required":["union"],"type":"object"}}}');
@@ -15171,6 +15386,7 @@ var __webpack_exports__ = {};
15171
15386
  "use strict";
15172
15387
  var exports = __webpack_exports__;
15173
15388
  var __webpack_unused_export__;
15389
+ var _a;
15174
15390
  __webpack_unused_export__ = {
15175
15391
  value: true
15176
15392
  };
@@ -15183,7 +15399,7 @@ var __webpack_exports__ = {};
15183
15399
  const noStack = !!process.env.JSII_NOSTACK;
15184
15400
  const debug = !!process.env.JSII_DEBUG;
15185
15401
  const stdio = new sync_stdio_1.SyncStdio({
15186
- errorFD: process.stderr.fd ?? 2,
15402
+ errorFD: (_a = process.stderr.fd) !== null && _a !== void 0 ? _a : 2,
15187
15403
  readFD: 3,
15188
15404
  writeFD: 3
15189
15405
  });