@jsii/runtime 1.60.1 → 1.63.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.
- package/bin/jsii-runtime.js +2 -1
- package/jest.config.mjs +13 -0
- package/lib/host.js +3 -2
- package/lib/program.js +2 -1
- package/package.json +11 -11
- package/test/kernel-host.test.js +2 -2
- package/webpack/bin/jsii-runtime.js +4 -3
- package/webpack/lib/program.js +515 -328
- package/bin/jsii-runtime.d.ts.map +0 -1
- package/bin/jsii-runtime.js.map +0 -1
- package/lib/host.d.ts.map +0 -1
- package/lib/host.js.map +0 -1
- package/lib/in-out.d.ts.map +0 -1
- package/lib/in-out.js.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/program.d.ts.map +0 -1
- package/lib/program.js.map +0 -1
- package/lib/sync-stdio.d.ts.map +0 -1
- package/lib/sync-stdio.js.map +0 -1
- package/test/kernel-host.test.d.ts.map +0 -1
- package/test/kernel-host.test.js.map +0 -1
- package/test/playback.test.d.ts.map +0 -1
- package/test/playback.test.js.map +0 -1
- package/test/stress.test.d.ts.map +0 -1
- package/test/stress.test.js.map +0 -1
- package/webpack/bin/jsii-runtime.js.map +0 -1
- package/webpack/lib/program.js.map +0 -1
package/webpack/lib/program.js
CHANGED
|
@@ -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 =
|
|
2710
|
-
this.buffer =
|
|
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 (
|
|
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" && !
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
2858
|
-
dest
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
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
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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;
|
|
2920
2945
|
}
|
|
2921
|
-
const
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
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();
|
|
2953
|
+
}
|
|
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
|
-
|
|
2930
|
-
|
|
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 =
|
|
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);
|
|
@@ -7802,20 +7848,20 @@ var __webpack_modules__ = {
|
|
|
7802
7848
|
const api = __webpack_require__(2816);
|
|
7803
7849
|
exports.api = api;
|
|
7804
7850
|
},
|
|
7805
|
-
2742: (
|
|
7851
|
+
2742: (__unused_webpack_module, exports, __webpack_require__) => {
|
|
7806
7852
|
"use strict";
|
|
7807
|
-
module = __webpack_require__.nmd(module);
|
|
7808
7853
|
Object.defineProperty(exports, "__esModule", {
|
|
7809
7854
|
value: true
|
|
7810
7855
|
});
|
|
7811
7856
|
exports.Kernel = void 0;
|
|
7812
7857
|
const spec = __webpack_require__(1804);
|
|
7858
|
+
const spec_1 = __webpack_require__(1804);
|
|
7813
7859
|
const cp = __webpack_require__(2081);
|
|
7814
7860
|
const fs = __webpack_require__(9728);
|
|
7861
|
+
const module_1 = __webpack_require__(8188);
|
|
7815
7862
|
const os = __webpack_require__(2037);
|
|
7816
7863
|
const path = __webpack_require__(4822);
|
|
7817
7864
|
const tar = __webpack_require__(1189);
|
|
7818
|
-
const vm = __webpack_require__(6144);
|
|
7819
7865
|
const api = __webpack_require__(2816);
|
|
7820
7866
|
const api_1 = __webpack_require__(2816);
|
|
7821
7867
|
const objects_1 = __webpack_require__(2309);
|
|
@@ -7825,21 +7871,15 @@ var __webpack_modules__ = {
|
|
|
7825
7871
|
constructor(callbackHandler) {
|
|
7826
7872
|
this.callbackHandler = callbackHandler;
|
|
7827
7873
|
this.traceEnabled = false;
|
|
7828
|
-
this.assemblies =
|
|
7874
|
+
this.assemblies = new Map;
|
|
7829
7875
|
this.objects = new objects_1.ObjectTable(this._typeInfoForFqn.bind(this));
|
|
7830
|
-
this.cbs =
|
|
7831
|
-
this.waiting =
|
|
7832
|
-
this.promises =
|
|
7876
|
+
this.cbs = new Map;
|
|
7877
|
+
this.waiting = new Map;
|
|
7878
|
+
this.promises = new Map;
|
|
7833
7879
|
this.nextid = 2e4;
|
|
7834
|
-
const moduleLoad = __webpack_require__(8188).Module._load;
|
|
7835
|
-
const nodeRequire = p => moduleLoad(p, module, false);
|
|
7836
|
-
this.sandbox = vm.createContext({
|
|
7837
|
-
Buffer,
|
|
7838
|
-
setImmediate,
|
|
7839
|
-
require: nodeRequire
|
|
7840
|
-
});
|
|
7841
7880
|
}
|
|
7842
7881
|
load(req) {
|
|
7882
|
+
var _a, _b;
|
|
7843
7883
|
this._debug("load", req);
|
|
7844
7884
|
if ("assembly" in req) {
|
|
7845
7885
|
throw new Error('`assembly` field is deprecated for "load", use `name`, `version` and `tarball` instead');
|
|
@@ -7853,10 +7893,10 @@ var __webpack_modules__ = {
|
|
|
7853
7893
|
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
7894
|
}
|
|
7855
7895
|
this._debug("look up already-loaded assembly", pkgname);
|
|
7856
|
-
const assm = this.assemblies
|
|
7896
|
+
const assm = this.assemblies.get(pkgname);
|
|
7857
7897
|
return {
|
|
7858
7898
|
assembly: assm.metadata.name,
|
|
7859
|
-
types: Object.keys(assm.metadata.types
|
|
7899
|
+
types: Object.keys((_a = assm.metadata.types) !== null && _a !== void 0 ? _a : {}).length
|
|
7860
7900
|
};
|
|
7861
7901
|
}
|
|
7862
7902
|
fs.mkdirpSync(packageDir);
|
|
@@ -7873,20 +7913,22 @@ var __webpack_modules__ = {
|
|
|
7873
7913
|
} finally {
|
|
7874
7914
|
process.umask(originalUmask);
|
|
7875
7915
|
}
|
|
7876
|
-
|
|
7877
|
-
|
|
7878
|
-
|
|
7916
|
+
let assmSpec;
|
|
7917
|
+
try {
|
|
7918
|
+
assmSpec = (0, spec_1.loadAssemblyFromPath)(packageDir);
|
|
7919
|
+
} catch (e) {
|
|
7920
|
+
throw new Error(`Error for package tarball ${req.tarball}: ${e.message}`);
|
|
7879
7921
|
}
|
|
7880
|
-
const
|
|
7881
|
-
const closure = this._execute(`require(String.raw\`${packageDir}\`)`, packageDir);
|
|
7922
|
+
const closure = this.require(packageDir);
|
|
7882
7923
|
const assm = new Assembly(assmSpec, closure);
|
|
7883
7924
|
this._addAssembly(assm);
|
|
7884
7925
|
return {
|
|
7885
7926
|
assembly: assmSpec.name,
|
|
7886
|
-
types: Object.keys(assmSpec.types
|
|
7927
|
+
types: Object.keys((_b = assmSpec.types) !== null && _b !== void 0 ? _b : {}).length
|
|
7887
7928
|
};
|
|
7888
7929
|
}
|
|
7889
7930
|
invokeBinScript(req) {
|
|
7931
|
+
var _a;
|
|
7890
7932
|
const packageDir = this._getPackageDir(req.assembly);
|
|
7891
7933
|
if (fs.pathExistsSync(packageDir)) {
|
|
7892
7934
|
const epkg = fs.readJsonSync(path.join(packageDir, "package.json"));
|
|
@@ -7897,7 +7939,7 @@ var __webpack_modules__ = {
|
|
|
7897
7939
|
if (!epkg.bin) {
|
|
7898
7940
|
throw new Error(`Script with name ${req.script} was not defined.`);
|
|
7899
7941
|
}
|
|
7900
|
-
const result = cp.spawnSync(path.join(packageDir, scriptPath), req.args
|
|
7942
|
+
const result = cp.spawnSync(path.join(packageDir, scriptPath), (_a = req.args) !== null && _a !== void 0 ? _a : [], {
|
|
7901
7943
|
encoding: "utf-8",
|
|
7902
7944
|
env: {
|
|
7903
7945
|
...process.env,
|
|
@@ -7933,9 +7975,9 @@ var __webpack_modules__ = {
|
|
|
7933
7975
|
throw new Error(`property ${symbol} is not static`);
|
|
7934
7976
|
}
|
|
7935
7977
|
const prototype = this._findSymbol(fqn);
|
|
7936
|
-
const value = this._ensureSync(`property ${property}`, (() =>
|
|
7978
|
+
const value = this._ensureSync(`property ${property}`, (() => prototype[property]));
|
|
7937
7979
|
this._debug("value:", value);
|
|
7938
|
-
const ret = this._fromSandbox(value, ti);
|
|
7980
|
+
const ret = this._fromSandbox(value, ti, `of static property ${symbol}`);
|
|
7939
7981
|
this._debug("ret", ret);
|
|
7940
7982
|
return {
|
|
7941
7983
|
value: ret
|
|
@@ -7953,7 +7995,7 @@ var __webpack_modules__ = {
|
|
|
7953
7995
|
throw new Error(`static property ${symbol} is readonly`);
|
|
7954
7996
|
}
|
|
7955
7997
|
const prototype = this._findSymbol(fqn);
|
|
7956
|
-
this._ensureSync(`property ${property}`, (() =>
|
|
7998
|
+
this._ensureSync(`property ${property}`, (() => prototype[property] = this._toSandbox(value, ti, `assigned to static property ${symbol}`)));
|
|
7957
7999
|
return {};
|
|
7958
8000
|
}
|
|
7959
8001
|
get(req) {
|
|
@@ -7962,9 +8004,9 @@ var __webpack_modules__ = {
|
|
|
7962
8004
|
const {instance, fqn, interfaces} = this.objects.findObject(objref);
|
|
7963
8005
|
const ti = this._typeInfoForProperty(property, fqn, interfaces);
|
|
7964
8006
|
const propertyToGet = this._findPropertyTarget(instance, property);
|
|
7965
|
-
const value = this._ensureSync(`property '${objref[api_1.TOKEN_REF]}.${propertyToGet}'`, (() =>
|
|
8007
|
+
const value = this._ensureSync(`property '${objref[api_1.TOKEN_REF]}.${propertyToGet}'`, (() => instance[propertyToGet]));
|
|
7966
8008
|
this._debug("value:", value);
|
|
7967
|
-
const ret = this._fromSandbox(value, ti);
|
|
8009
|
+
const ret = this._fromSandbox(value, ti, `of property ${fqn}.${property}`);
|
|
7968
8010
|
this._debug("ret:", ret);
|
|
7969
8011
|
return {
|
|
7970
8012
|
value: ret
|
|
@@ -7979,27 +8021,30 @@ var __webpack_modules__ = {
|
|
|
7979
8021
|
throw new Error(`Cannot set value of immutable property ${req.property} to ${req.value}`);
|
|
7980
8022
|
}
|
|
7981
8023
|
const propertyToSet = this._findPropertyTarget(instance, property);
|
|
7982
|
-
this._ensureSync(`property '${objref[api_1.TOKEN_REF]}.${propertyToSet}'`, (() =>
|
|
8024
|
+
this._ensureSync(`property '${objref[api_1.TOKEN_REF]}.${propertyToSet}'`, (() => instance[propertyToSet] = this._toSandbox(value, propInfo, `assigned to property ${fqn}.${property}`)));
|
|
7983
8025
|
return {};
|
|
7984
8026
|
}
|
|
7985
8027
|
invoke(req) {
|
|
8028
|
+
var _a, _b;
|
|
7986
8029
|
const {objref, method} = req;
|
|
7987
|
-
const args = req.args
|
|
8030
|
+
const args = (_a = req.args) !== null && _a !== void 0 ? _a : [];
|
|
7988
8031
|
this._debug("invoke", objref, method, args);
|
|
7989
8032
|
const {ti, obj, fn} = this._findInvokeTarget(objref, method, args);
|
|
7990
8033
|
if (ti.async) {
|
|
7991
8034
|
throw new Error(`${method} is an async method, use "begin" instead`);
|
|
7992
8035
|
}
|
|
7993
|
-
const
|
|
7994
|
-
const
|
|
8036
|
+
const fqn = (0, objects_1.jsiiTypeFqn)(obj);
|
|
8037
|
+
const ret = this._ensureSync(`method '${objref[api_1.TOKEN_REF]}.${method}'`, (() => fn.apply(obj, this._toSandboxValues(args, `method ${fqn ? `${fqn}#` : ""}${method}`, ti.parameters))));
|
|
8038
|
+
const result = this._fromSandbox(ret, (_b = ti.returns) !== null && _b !== void 0 ? _b : "void", `returned by method ${fqn ? `${fqn}#` : ""}${method}`);
|
|
7995
8039
|
this._debug("invoke result", result);
|
|
7996
8040
|
return {
|
|
7997
8041
|
result
|
|
7998
8042
|
};
|
|
7999
8043
|
}
|
|
8000
8044
|
sinvoke(req) {
|
|
8045
|
+
var _a, _b;
|
|
8001
8046
|
const {fqn, method} = req;
|
|
8002
|
-
const args = req.args
|
|
8047
|
+
const args = (_a = req.args) !== null && _a !== void 0 ? _a : [];
|
|
8003
8048
|
this._debug("sinvoke", fqn, method, args);
|
|
8004
8049
|
const ti = this._typeInfoForMethod(method, fqn);
|
|
8005
8050
|
if (!ti.static) {
|
|
@@ -8010,15 +8055,16 @@ var __webpack_modules__ = {
|
|
|
8010
8055
|
}
|
|
8011
8056
|
const prototype = this._findSymbol(fqn);
|
|
8012
8057
|
const fn = prototype[method];
|
|
8013
|
-
const ret = this._ensureSync(`method '${fqn}.${method}'`, (() =>
|
|
8058
|
+
const ret = this._ensureSync(`method '${fqn}.${method}'`, (() => fn.apply(prototype, this._toSandboxValues(args, `static method ${fqn}.${method}`, ti.parameters))));
|
|
8014
8059
|
this._debug("method returned:", ret);
|
|
8015
8060
|
return {
|
|
8016
|
-
result: this._fromSandbox(ret, ti.returns
|
|
8061
|
+
result: this._fromSandbox(ret, (_b = ti.returns) !== null && _b !== void 0 ? _b : "void", `returned by static method ${fqn}.${method}`)
|
|
8017
8062
|
};
|
|
8018
8063
|
}
|
|
8019
8064
|
begin(req) {
|
|
8065
|
+
var _a;
|
|
8020
8066
|
const {objref, method} = req;
|
|
8021
|
-
const args = req.args
|
|
8067
|
+
const args = (_a = req.args) !== null && _a !== void 0 ? _a : [];
|
|
8022
8068
|
this._debug("begin", objref, method, args);
|
|
8023
8069
|
if (this.syncInProgress) {
|
|
8024
8070
|
throw new Error(`Cannot invoke async method '${req.objref[api_1.TOKEN_REF]}.${req.method}' while sync ${this.syncInProgress} is being processed`);
|
|
@@ -8027,24 +8073,27 @@ var __webpack_modules__ = {
|
|
|
8027
8073
|
if (!ti.async) {
|
|
8028
8074
|
throw new Error(`Method ${method} is expected to be an async method`);
|
|
8029
8075
|
}
|
|
8030
|
-
const
|
|
8076
|
+
const fqn = (0, objects_1.jsiiTypeFqn)(obj);
|
|
8077
|
+
const promise = fn.apply(obj, this._toSandboxValues(args, `async method ${fqn ? `${fqn}#` : ""}${method}`, ti.parameters));
|
|
8031
8078
|
promise.catch((_ => undefined));
|
|
8032
8079
|
const prid = this._makeprid();
|
|
8033
|
-
this.promises
|
|
8080
|
+
this.promises.set(prid, {
|
|
8034
8081
|
promise,
|
|
8035
8082
|
method: ti
|
|
8036
|
-
};
|
|
8083
|
+
});
|
|
8037
8084
|
return {
|
|
8038
8085
|
promiseid: prid
|
|
8039
8086
|
};
|
|
8040
8087
|
}
|
|
8041
8088
|
async end(req) {
|
|
8089
|
+
var _a;
|
|
8042
8090
|
const {promiseid} = req;
|
|
8043
8091
|
this._debug("end", promiseid);
|
|
8044
|
-
const
|
|
8045
|
-
if (
|
|
8092
|
+
const storedPromise = this.promises.get(promiseid);
|
|
8093
|
+
if (storedPromise == null) {
|
|
8046
8094
|
throw new Error(`Cannot find promise with ID: ${promiseid}`);
|
|
8047
8095
|
}
|
|
8096
|
+
const {promise, method} = storedPromise;
|
|
8048
8097
|
let result;
|
|
8049
8098
|
try {
|
|
8050
8099
|
result = await promise;
|
|
@@ -8054,14 +8103,14 @@ var __webpack_modules__ = {
|
|
|
8054
8103
|
throw e;
|
|
8055
8104
|
}
|
|
8056
8105
|
return {
|
|
8057
|
-
result: this._fromSandbox(result, method.returns
|
|
8106
|
+
result: this._fromSandbox(result, (_a = method.returns) !== null && _a !== void 0 ? _a : "void", `returned by async method ${method.name}`)
|
|
8058
8107
|
};
|
|
8059
8108
|
}
|
|
8060
8109
|
callbacks(_req) {
|
|
8061
8110
|
this._debug("callbacks");
|
|
8062
|
-
const ret =
|
|
8063
|
-
|
|
8064
|
-
this.
|
|
8111
|
+
const ret = Array.from(this.cbs.entries()).map((([cbid, cb]) => {
|
|
8112
|
+
this.waiting.set(cbid, cb);
|
|
8113
|
+
this.cbs.delete(cbid);
|
|
8065
8114
|
const callback = {
|
|
8066
8115
|
cbid,
|
|
8067
8116
|
cookie: cb.override.cookie,
|
|
@@ -8073,27 +8122,27 @@ var __webpack_modules__ = {
|
|
|
8073
8122
|
};
|
|
8074
8123
|
return callback;
|
|
8075
8124
|
}));
|
|
8076
|
-
this.cbs = {};
|
|
8077
8125
|
return {
|
|
8078
8126
|
callbacks: ret
|
|
8079
8127
|
};
|
|
8080
8128
|
}
|
|
8081
8129
|
complete(req) {
|
|
8130
|
+
var _a;
|
|
8082
8131
|
const {cbid, err, result} = req;
|
|
8083
8132
|
this._debug("complete", cbid, err, result);
|
|
8084
|
-
|
|
8133
|
+
const cb = this.waiting.get(cbid);
|
|
8134
|
+
if (!cb) {
|
|
8085
8135
|
throw new Error(`Callback ${cbid} not found`);
|
|
8086
8136
|
}
|
|
8087
|
-
const cb = this.waiting[cbid];
|
|
8088
8137
|
if (err) {
|
|
8089
8138
|
this._debug("completed with error:", err);
|
|
8090
8139
|
cb.fail(new Error(err));
|
|
8091
8140
|
} else {
|
|
8092
|
-
const sandoxResult = this._toSandbox(result, cb.expectedReturnType
|
|
8141
|
+
const sandoxResult = this._toSandbox(result, (_a = cb.expectedReturnType) !== null && _a !== void 0 ? _a : "void", `returned by callback ${cb.toString()}`);
|
|
8093
8142
|
this._debug("completed with result:", sandoxResult);
|
|
8094
8143
|
cb.succeed(sandoxResult);
|
|
8095
8144
|
}
|
|
8096
|
-
|
|
8145
|
+
this.waiting.delete(cbid);
|
|
8097
8146
|
return {
|
|
8098
8147
|
cbid
|
|
8099
8148
|
};
|
|
@@ -8116,8 +8165,9 @@ var __webpack_modules__ = {
|
|
|
8116
8165
|
};
|
|
8117
8166
|
}
|
|
8118
8167
|
_addAssembly(assm) {
|
|
8119
|
-
|
|
8120
|
-
|
|
8168
|
+
var _a;
|
|
8169
|
+
this.assemblies.set(assm.metadata.name, assm);
|
|
8170
|
+
for (const fqn of Object.keys((_a = assm.metadata.types) !== null && _a !== void 0 ? _a : {})) {
|
|
8121
8171
|
const typedef = assm.metadata.types[fqn];
|
|
8122
8172
|
switch (typedef.kind) {
|
|
8123
8173
|
case spec.TypeKind.Interface:
|
|
@@ -8156,6 +8206,7 @@ var __webpack_modules__ = {
|
|
|
8156
8206
|
_getPackageDir(pkgname) {
|
|
8157
8207
|
if (!this.installDir) {
|
|
8158
8208
|
this.installDir = fs.mkdtempSync(path.join(os.tmpdir(), "jsii-kernel-"));
|
|
8209
|
+
this.require = (0, module_1.createRequire)(this.installDir);
|
|
8159
8210
|
fs.mkdirpSync(path.join(this.installDir, "node_modules"));
|
|
8160
8211
|
this._debug("creating jsii-kernel modules workdir:", this.installDir);
|
|
8161
8212
|
onExit.removeSync(this.installDir);
|
|
@@ -8163,13 +8214,14 @@ var __webpack_modules__ = {
|
|
|
8163
8214
|
return path.join(this.installDir, "node_modules", pkgname);
|
|
8164
8215
|
}
|
|
8165
8216
|
_create(req) {
|
|
8217
|
+
var _a, _b;
|
|
8166
8218
|
this._debug("create", req);
|
|
8167
8219
|
const {fqn, interfaces, overrides} = req;
|
|
8168
|
-
const requestArgs = req.args
|
|
8220
|
+
const requestArgs = (_a = req.args) !== null && _a !== void 0 ? _a : [];
|
|
8169
8221
|
const ctorResult = this._findCtor(fqn, requestArgs);
|
|
8170
8222
|
const ctor = ctorResult.ctor;
|
|
8171
|
-
const obj =
|
|
8172
|
-
const objref = this.objects.registerObject(obj, fqn, req.interfaces
|
|
8223
|
+
const obj = new ctor(...this._toSandboxValues(requestArgs, `new ${fqn}`, ctorResult.parameters));
|
|
8224
|
+
const objref = this.objects.registerObject(obj, fqn, (_b = req.interfaces) !== null && _b !== void 0 ? _b : []);
|
|
8173
8225
|
if (overrides) {
|
|
8174
8226
|
this._debug("overrides", overrides);
|
|
8175
8227
|
const overrideTypeErrorMessage = 'Override can either be "method" or "property"';
|
|
@@ -8222,9 +8274,10 @@ var __webpack_modules__ = {
|
|
|
8222
8274
|
this._defineOverridenProperty(obj, objref, override, propInfo);
|
|
8223
8275
|
}
|
|
8224
8276
|
_defineOverridenProperty(obj, objref, override, propInfo) {
|
|
8277
|
+
var _a;
|
|
8225
8278
|
const propertyName = override.property;
|
|
8226
8279
|
this._debug("apply override", propertyName);
|
|
8227
|
-
const prev = getPropertyDescriptor(obj, propertyName)
|
|
8280
|
+
const prev = (_a = getPropertyDescriptor(obj, propertyName)) !== null && _a !== void 0 ? _a : {
|
|
8228
8281
|
value: obj[propertyName],
|
|
8229
8282
|
writable: true,
|
|
8230
8283
|
enumerable: true,
|
|
@@ -8249,7 +8302,7 @@ var __webpack_modules__ = {
|
|
|
8249
8302
|
}
|
|
8250
8303
|
});
|
|
8251
8304
|
this._debug("callback returned", result);
|
|
8252
|
-
return this._toSandbox(result, propInfo);
|
|
8305
|
+
return this._toSandbox(result, propInfo, `returned by callback property ${propertyName}`);
|
|
8253
8306
|
},
|
|
8254
8307
|
set: value => {
|
|
8255
8308
|
this._debug("virtual set", objref, propertyName, {
|
|
@@ -8261,7 +8314,7 @@ var __webpack_modules__ = {
|
|
|
8261
8314
|
set: {
|
|
8262
8315
|
objref,
|
|
8263
8316
|
property: propertyName,
|
|
8264
|
-
value: this._fromSandbox(value, propInfo)
|
|
8317
|
+
value: this._fromSandbox(value, propInfo, `assigned to callback property ${propertyName}`)
|
|
8265
8318
|
}
|
|
8266
8319
|
});
|
|
8267
8320
|
}
|
|
@@ -8305,6 +8358,8 @@ var __webpack_modules__ = {
|
|
|
8305
8358
|
}
|
|
8306
8359
|
_defineOverridenMethod(obj, objref, override, methodInfo) {
|
|
8307
8360
|
const methodName = override.method;
|
|
8361
|
+
const fqn = (0, objects_1.jsiiTypeFqn)(obj);
|
|
8362
|
+
const methodContext = `${methodInfo.async ? "async " : ""}method${fqn ? `${fqn}#` : methodName}`;
|
|
8308
8363
|
if (methodInfo.async) {
|
|
8309
8364
|
Object.defineProperty(obj, methodName, {
|
|
8310
8365
|
enumerable: false,
|
|
@@ -8312,18 +8367,19 @@ var __webpack_modules__ = {
|
|
|
8312
8367
|
writable: false,
|
|
8313
8368
|
value: (...methodArgs) => {
|
|
8314
8369
|
this._debug("invoke async method override", override);
|
|
8315
|
-
const args = this._toSandboxValues(methodArgs, methodInfo.parameters);
|
|
8370
|
+
const args = this._toSandboxValues(methodArgs, methodContext, methodInfo.parameters);
|
|
8316
8371
|
return new Promise(((succeed, fail) => {
|
|
8372
|
+
var _a;
|
|
8317
8373
|
const cbid = this._makecbid();
|
|
8318
8374
|
this._debug("adding callback to queue", cbid);
|
|
8319
|
-
this.cbs
|
|
8375
|
+
this.cbs.set(cbid, {
|
|
8320
8376
|
objref,
|
|
8321
8377
|
override,
|
|
8322
8378
|
args,
|
|
8323
|
-
expectedReturnType: methodInfo.returns
|
|
8379
|
+
expectedReturnType: (_a = methodInfo.returns) !== null && _a !== void 0 ? _a : "void",
|
|
8324
8380
|
succeed,
|
|
8325
8381
|
fail
|
|
8326
|
-
};
|
|
8382
|
+
});
|
|
8327
8383
|
}));
|
|
8328
8384
|
}
|
|
8329
8385
|
});
|
|
@@ -8333,6 +8389,7 @@ var __webpack_modules__ = {
|
|
|
8333
8389
|
configurable: false,
|
|
8334
8390
|
writable: false,
|
|
8335
8391
|
value: (...methodArgs) => {
|
|
8392
|
+
var _a;
|
|
8336
8393
|
this._debug("invoke sync method override", override, "args", methodArgs);
|
|
8337
8394
|
const result = this.callbackHandler({
|
|
8338
8395
|
cookie: override.cookie,
|
|
@@ -8340,11 +8397,11 @@ var __webpack_modules__ = {
|
|
|
8340
8397
|
invoke: {
|
|
8341
8398
|
objref,
|
|
8342
8399
|
method: methodName,
|
|
8343
|
-
args: this._fromSandboxValues(methodArgs, methodInfo.parameters)
|
|
8400
|
+
args: this._fromSandboxValues(methodArgs, methodContext, methodInfo.parameters)
|
|
8344
8401
|
}
|
|
8345
8402
|
});
|
|
8346
8403
|
this._debug("Result", result);
|
|
8347
|
-
return this._toSandbox(result, methodInfo.returns
|
|
8404
|
+
return this._toSandbox(result, (_a = methodInfo.returns) !== null && _a !== void 0 ? _a : "void", `returned by callback method ${methodName}`);
|
|
8348
8405
|
}
|
|
8349
8406
|
});
|
|
8350
8407
|
}
|
|
@@ -8367,7 +8424,8 @@ var __webpack_modules__ = {
|
|
|
8367
8424
|
};
|
|
8368
8425
|
}
|
|
8369
8426
|
_validateMethodArguments(method, args) {
|
|
8370
|
-
|
|
8427
|
+
var _a;
|
|
8428
|
+
const params = (_a = method === null || method === void 0 ? void 0 : method.parameters) !== null && _a !== void 0 ? _a : [];
|
|
8371
8429
|
if (args.length > params.length && !(method && method.variadic)) {
|
|
8372
8430
|
throw new Error(`Too many arguments (method accepts ${params.length} parameters, got ${args.length} arguments)`);
|
|
8373
8431
|
}
|
|
@@ -8389,7 +8447,7 @@ var __webpack_modules__ = {
|
|
|
8389
8447
|
}
|
|
8390
8448
|
}
|
|
8391
8449
|
_assemblyFor(assemblyName) {
|
|
8392
|
-
const assembly = this.assemblies
|
|
8450
|
+
const assembly = this.assemblies.get(assemblyName);
|
|
8393
8451
|
if (!assembly) {
|
|
8394
8452
|
throw new Error(`Could not find assembly: ${assemblyName}`);
|
|
8395
8453
|
}
|
|
@@ -8412,13 +8470,14 @@ var __webpack_modules__ = {
|
|
|
8412
8470
|
return curr;
|
|
8413
8471
|
}
|
|
8414
8472
|
_typeInfoForFqn(fqn) {
|
|
8473
|
+
var _a;
|
|
8415
8474
|
const components = fqn.split(".");
|
|
8416
8475
|
const moduleName = components[0];
|
|
8417
|
-
const assembly = this.assemblies
|
|
8476
|
+
const assembly = this.assemblies.get(moduleName);
|
|
8418
8477
|
if (!assembly) {
|
|
8419
8478
|
throw new Error(`Module '${moduleName}' not found`);
|
|
8420
8479
|
}
|
|
8421
|
-
const types = assembly.metadata.types
|
|
8480
|
+
const types = (_a = assembly.metadata.types) !== null && _a !== void 0 ? _a : {};
|
|
8422
8481
|
const fqnInfo = types[fqn];
|
|
8423
8482
|
if (!fqnInfo) {
|
|
8424
8483
|
throw new Error(`Type '${fqn}' not found`);
|
|
@@ -8434,18 +8493,19 @@ var __webpack_modules__ = {
|
|
|
8434
8493
|
return ti;
|
|
8435
8494
|
}
|
|
8436
8495
|
_tryTypeInfoForMethod(methodName, classFqn, interfaces = []) {
|
|
8496
|
+
var _a, _b;
|
|
8437
8497
|
for (const fqn of [ classFqn, ...interfaces ]) {
|
|
8438
8498
|
if (fqn === wire.EMPTY_OBJECT_FQN) {
|
|
8439
8499
|
continue;
|
|
8440
8500
|
}
|
|
8441
8501
|
const typeinfo = this._typeInfoForFqn(fqn);
|
|
8442
|
-
const methods = typeinfo.methods
|
|
8502
|
+
const methods = (_a = typeinfo.methods) !== null && _a !== void 0 ? _a : [];
|
|
8443
8503
|
for (const m of methods) {
|
|
8444
8504
|
if (m.name === methodName) {
|
|
8445
8505
|
return m;
|
|
8446
8506
|
}
|
|
8447
8507
|
}
|
|
8448
|
-
const bases = [ typeinfo.base, ...typeinfo.interfaces
|
|
8508
|
+
const bases = [ typeinfo.base, ...(_b = typeinfo.interfaces) !== null && _b !== void 0 ? _b : [] ];
|
|
8449
8509
|
for (const base of bases) {
|
|
8450
8510
|
if (!base) {
|
|
8451
8511
|
continue;
|
|
@@ -8459,6 +8519,7 @@ var __webpack_modules__ = {
|
|
|
8459
8519
|
return undefined;
|
|
8460
8520
|
}
|
|
8461
8521
|
_tryTypeInfoForProperty(property, classFqn, interfaces = []) {
|
|
8522
|
+
var _a;
|
|
8462
8523
|
for (const fqn of [ classFqn, ...interfaces ]) {
|
|
8463
8524
|
if (fqn === wire.EMPTY_OBJECT_FQN) {
|
|
8464
8525
|
continue;
|
|
@@ -8473,11 +8534,11 @@ var __webpack_modules__ = {
|
|
|
8473
8534
|
} else if (spec.isInterfaceType(typeInfo)) {
|
|
8474
8535
|
const interfaceTypeInfo = typeInfo;
|
|
8475
8536
|
properties = interfaceTypeInfo.properties;
|
|
8476
|
-
bases = interfaceTypeInfo.interfaces
|
|
8537
|
+
bases = (_a = interfaceTypeInfo.interfaces) !== null && _a !== void 0 ? _a : [];
|
|
8477
8538
|
} else {
|
|
8478
8539
|
throw new Error(`Type of kind ${typeInfo.kind} does not have properties`);
|
|
8479
8540
|
}
|
|
8480
|
-
for (const p of properties
|
|
8541
|
+
for (const p of properties !== null && properties !== void 0 ? properties : []) {
|
|
8481
8542
|
if (p.name === property) {
|
|
8482
8543
|
return p;
|
|
8483
8544
|
}
|
|
@@ -8499,68 +8560,38 @@ var __webpack_modules__ = {
|
|
|
8499
8560
|
}
|
|
8500
8561
|
return typeInfo;
|
|
8501
8562
|
}
|
|
8502
|
-
_toSandbox(v, expectedType) {
|
|
8503
|
-
|
|
8504
|
-
this._debug("toSandbox", v, JSON.stringify(serTypes));
|
|
8505
|
-
const host = {
|
|
8563
|
+
_toSandbox(v, expectedType, context) {
|
|
8564
|
+
return wire.process({
|
|
8506
8565
|
objects: this.objects,
|
|
8507
8566
|
debug: this._debug.bind(this),
|
|
8508
8567
|
findSymbol: this._findSymbol.bind(this),
|
|
8509
|
-
lookupType: this._typeInfoForFqn.bind(this)
|
|
8510
|
-
|
|
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(", ")}`);
|
|
8568
|
+
lookupType: this._typeInfoForFqn.bind(this)
|
|
8569
|
+
}, "deserialize", v, expectedType, context);
|
|
8524
8570
|
}
|
|
8525
|
-
_fromSandbox(v, targetType) {
|
|
8526
|
-
|
|
8527
|
-
this._debug("fromSandbox", v, JSON.stringify(serTypes));
|
|
8528
|
-
const host = {
|
|
8571
|
+
_fromSandbox(v, targetType, context) {
|
|
8572
|
+
return wire.process({
|
|
8529
8573
|
objects: this.objects,
|
|
8530
8574
|
debug: this._debug.bind(this),
|
|
8531
8575
|
findSymbol: this._findSymbol.bind(this),
|
|
8532
|
-
lookupType: this._typeInfoForFqn.bind(this)
|
|
8533
|
-
|
|
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(", ")}`);
|
|
8576
|
+
lookupType: this._typeInfoForFqn.bind(this)
|
|
8577
|
+
}, "serialize", v, targetType, context);
|
|
8547
8578
|
}
|
|
8548
|
-
_toSandboxValues(xs, parameters) {
|
|
8549
|
-
return this._boxUnboxParameters(xs, parameters, this._toSandbox.bind(this));
|
|
8579
|
+
_toSandboxValues(xs, methodContext, parameters) {
|
|
8580
|
+
return this._boxUnboxParameters(xs, methodContext, parameters, this._toSandbox.bind(this));
|
|
8550
8581
|
}
|
|
8551
|
-
_fromSandboxValues(xs, parameters) {
|
|
8552
|
-
return this._boxUnboxParameters(xs, parameters, this._fromSandbox.bind(this));
|
|
8582
|
+
_fromSandboxValues(xs, methodContext, parameters) {
|
|
8583
|
+
return this._boxUnboxParameters(xs, methodContext, parameters, this._fromSandbox.bind(this));
|
|
8553
8584
|
}
|
|
8554
|
-
_boxUnboxParameters(xs, parameters, boxUnbox) {
|
|
8555
|
-
|
|
8556
|
-
const variadic =
|
|
8557
|
-
while (variadic &&
|
|
8558
|
-
|
|
8585
|
+
_boxUnboxParameters(xs, methodContext, parameters = [], boxUnbox) {
|
|
8586
|
+
const parametersCopy = [ ...parameters ];
|
|
8587
|
+
const variadic = parametersCopy.length > 0 && !!parametersCopy[parametersCopy.length - 1].variadic;
|
|
8588
|
+
while (variadic && parametersCopy.length < xs.length) {
|
|
8589
|
+
parametersCopy.push(parametersCopy[parametersCopy.length - 1]);
|
|
8559
8590
|
}
|
|
8560
|
-
if (xs.length >
|
|
8561
|
-
throw new Error(`Argument list (${JSON.stringify(xs)}) not same size as expected argument list (length ${
|
|
8591
|
+
if (xs.length > parametersCopy.length) {
|
|
8592
|
+
throw new Error(`Argument list (${JSON.stringify(xs)}) not same size as expected argument list (length ${parametersCopy.length})`);
|
|
8562
8593
|
}
|
|
8563
|
-
return xs.map(((x, i) => boxUnbox(x,
|
|
8594
|
+
return xs.map(((x, i) => boxUnbox(x, parametersCopy[i], `passed to parameter ${parametersCopy[i].name} of ${methodContext}`)));
|
|
8564
8595
|
}
|
|
8565
8596
|
_debug(...args) {
|
|
8566
8597
|
if (this.traceEnabled) {
|
|
@@ -8588,17 +8619,6 @@ var __webpack_modules__ = {
|
|
|
8588
8619
|
_makeprid() {
|
|
8589
8620
|
return `jsii::promise::${this.nextid++}`;
|
|
8590
8621
|
}
|
|
8591
|
-
_wrapSandboxCode(fn) {
|
|
8592
|
-
return fn();
|
|
8593
|
-
}
|
|
8594
|
-
_execute(code, filename) {
|
|
8595
|
-
const script = new vm.Script(code, {
|
|
8596
|
-
filename
|
|
8597
|
-
});
|
|
8598
|
-
return script.runInContext(this.sandbox, {
|
|
8599
|
-
displayErrors: true
|
|
8600
|
-
});
|
|
8601
|
-
}
|
|
8602
8622
|
}
|
|
8603
8623
|
exports.Kernel = Kernel;
|
|
8604
8624
|
class Assembly {
|
|
@@ -8621,7 +8641,8 @@ var __webpack_modules__ = {
|
|
|
8621
8641
|
const IFACES_SYMBOL = Symbol.for("$__jsii__interfaces__$");
|
|
8622
8642
|
const JSII_SYMBOL = Symbol.for("__jsii__");
|
|
8623
8643
|
function jsiiTypeFqn(obj) {
|
|
8624
|
-
|
|
8644
|
+
var _a;
|
|
8645
|
+
return (_a = obj.constructor[JSII_SYMBOL]) === null || _a === void 0 ? void 0 : _a.fqn;
|
|
8625
8646
|
}
|
|
8626
8647
|
exports.jsiiTypeFqn = jsiiTypeFqn;
|
|
8627
8648
|
function objectReference(obj) {
|
|
@@ -8666,10 +8687,11 @@ var __webpack_modules__ = {
|
|
|
8666
8687
|
class ObjectTable {
|
|
8667
8688
|
constructor(resolveType) {
|
|
8668
8689
|
this.resolveType = resolveType;
|
|
8669
|
-
this.objects =
|
|
8690
|
+
this.objects = new Map;
|
|
8670
8691
|
this.nextid = 1e4;
|
|
8671
8692
|
}
|
|
8672
8693
|
registerObject(obj, fqn, interfaces) {
|
|
8694
|
+
var _a;
|
|
8673
8695
|
if (fqn === undefined) {
|
|
8674
8696
|
throw new Error("FQN cannot be undefined");
|
|
8675
8697
|
}
|
|
@@ -8677,23 +8699,23 @@ var __webpack_modules__ = {
|
|
|
8677
8699
|
if (existingRef) {
|
|
8678
8700
|
if (interfaces) {
|
|
8679
8701
|
const allIfaces = new Set(interfaces);
|
|
8680
|
-
for (const iface of existingRef[api.TOKEN_INTERFACES]
|
|
8702
|
+
for (const iface of (_a = existingRef[api.TOKEN_INTERFACES]) !== null && _a !== void 0 ? _a : []) {
|
|
8681
8703
|
allIfaces.add(iface);
|
|
8682
8704
|
}
|
|
8683
8705
|
if (!Object.prototype.hasOwnProperty.call(obj, IFACES_SYMBOL)) {
|
|
8684
8706
|
console.error(`[jsii/kernel] WARNING: referenced object ${existingRef[api.TOKEN_REF]} does not have the ${String(IFACES_SYMBOL)} property!`);
|
|
8685
8707
|
}
|
|
8686
|
-
this.objects
|
|
8708
|
+
this.objects.get(existingRef[api.TOKEN_REF]).interfaces = obj[IFACES_SYMBOL] = existingRef[api.TOKEN_INTERFACES] = interfaces = this.removeRedundant(Array.from(allIfaces), fqn);
|
|
8687
8709
|
}
|
|
8688
8710
|
return existingRef;
|
|
8689
8711
|
}
|
|
8690
8712
|
interfaces = this.removeRedundant(interfaces, fqn);
|
|
8691
8713
|
const objid = this.makeId(fqn);
|
|
8692
|
-
this.objects
|
|
8714
|
+
this.objects.set(objid, {
|
|
8693
8715
|
instance: obj,
|
|
8694
8716
|
fqn,
|
|
8695
8717
|
interfaces
|
|
8696
|
-
};
|
|
8718
|
+
});
|
|
8697
8719
|
tagObject(obj, objid, interfaces);
|
|
8698
8720
|
return {
|
|
8699
8721
|
[api.TOKEN_REF]: objid,
|
|
@@ -8701,11 +8723,12 @@ var __webpack_modules__ = {
|
|
|
8701
8723
|
};
|
|
8702
8724
|
}
|
|
8703
8725
|
findObject(objref) {
|
|
8726
|
+
var _a;
|
|
8704
8727
|
if (typeof objref !== "object" || !(api.TOKEN_REF in objref)) {
|
|
8705
8728
|
throw new Error(`Malformed object reference: ${JSON.stringify(objref)}`);
|
|
8706
8729
|
}
|
|
8707
8730
|
const objid = objref[api.TOKEN_REF];
|
|
8708
|
-
const obj = this.objects
|
|
8731
|
+
const obj = this.objects.get(objid);
|
|
8709
8732
|
if (!obj) {
|
|
8710
8733
|
throw new Error(`Object ${objid} not found`);
|
|
8711
8734
|
}
|
|
@@ -8713,17 +8736,18 @@ var __webpack_modules__ = {
|
|
|
8713
8736
|
if (additionalInterfaces != null && additionalInterfaces.length > 0) {
|
|
8714
8737
|
return {
|
|
8715
8738
|
...obj,
|
|
8716
|
-
interfaces: [ ...obj.interfaces
|
|
8739
|
+
interfaces: [ ...(_a = obj.interfaces) !== null && _a !== void 0 ? _a : [], ...additionalInterfaces ]
|
|
8717
8740
|
};
|
|
8718
8741
|
}
|
|
8719
8742
|
return obj;
|
|
8720
8743
|
}
|
|
8721
|
-
deleteObject(
|
|
8722
|
-
this.
|
|
8723
|
-
|
|
8744
|
+
deleteObject({[api.TOKEN_REF]: objid}) {
|
|
8745
|
+
if (!this.objects.delete(objid)) {
|
|
8746
|
+
throw new Error(`Object ${objid} not found`);
|
|
8747
|
+
}
|
|
8724
8748
|
}
|
|
8725
8749
|
get count() {
|
|
8726
|
-
return
|
|
8750
|
+
return this.objects.size;
|
|
8727
8751
|
}
|
|
8728
8752
|
makeId(fqn) {
|
|
8729
8753
|
return `${fqn}@${this.nextid++}`;
|
|
@@ -8824,11 +8848,14 @@ var __webpack_modules__ = {
|
|
|
8824
8848
|
Object.defineProperty(exports, "__esModule", {
|
|
8825
8849
|
value: true
|
|
8826
8850
|
});
|
|
8827
|
-
exports.serializationType = exports.SERIALIZERS = exports.SYMBOL_WIRE_TYPE = exports.EMPTY_OBJECT_FQN = void 0;
|
|
8851
|
+
exports.SerializationError = exports.process = exports.serializationType = exports.SERIALIZERS = exports.SYMBOL_WIRE_TYPE = exports.EMPTY_OBJECT_FQN = void 0;
|
|
8828
8852
|
const spec = __webpack_require__(1804);
|
|
8853
|
+
const assert = __webpack_require__(9491);
|
|
8854
|
+
const util_1 = __webpack_require__(3837);
|
|
8829
8855
|
const api_1 = __webpack_require__(2816);
|
|
8830
8856
|
const objects_1 = __webpack_require__(2309);
|
|
8831
8857
|
const _1 = __webpack_require__(8944);
|
|
8858
|
+
const VOID = "void";
|
|
8832
8859
|
exports.EMPTY_OBJECT_FQN = "Object";
|
|
8833
8860
|
exports.SYMBOL_WIRE_TYPE = Symbol.for("$jsii$wireType$");
|
|
8834
8861
|
exports.SERIALIZERS = {
|
|
@@ -8851,11 +8878,9 @@ var __webpack_modules__ = {
|
|
|
8851
8878
|
if (nullAndOk(value, optionalValue)) {
|
|
8852
8879
|
return undefined;
|
|
8853
8880
|
}
|
|
8854
|
-
|
|
8855
|
-
throw new Error("Encountered unexpected `void` type");
|
|
8856
|
-
}
|
|
8881
|
+
assert(optionalValue !== VOID, "Encountered unexpected void type!");
|
|
8857
8882
|
if (!isDate(value)) {
|
|
8858
|
-
throw new
|
|
8883
|
+
throw new SerializationError(`Value is not an instance of Date`, value);
|
|
8859
8884
|
}
|
|
8860
8885
|
return serializeDate(value);
|
|
8861
8886
|
},
|
|
@@ -8864,7 +8889,7 @@ var __webpack_modules__ = {
|
|
|
8864
8889
|
return undefined;
|
|
8865
8890
|
}
|
|
8866
8891
|
if (!(0, api_1.isWireDate)(value)) {
|
|
8867
|
-
throw new
|
|
8892
|
+
throw new SerializationError(`Value does not have the "${api_1.TOKEN_DATE}" key`, value);
|
|
8868
8893
|
}
|
|
8869
8894
|
return deserializeDate(value);
|
|
8870
8895
|
}
|
|
@@ -8874,15 +8899,13 @@ var __webpack_modules__ = {
|
|
|
8874
8899
|
if (nullAndOk(value, optionalValue)) {
|
|
8875
8900
|
return undefined;
|
|
8876
8901
|
}
|
|
8877
|
-
|
|
8878
|
-
throw new Error("Encountered unexpected `void` type");
|
|
8879
|
-
}
|
|
8902
|
+
assert(optionalValue !== VOID, "Encountered unexpected void type!");
|
|
8880
8903
|
const primitiveType = optionalValue.type;
|
|
8881
8904
|
if (!isScalar(value)) {
|
|
8882
|
-
throw new
|
|
8905
|
+
throw new SerializationError(`Value is not a ${spec.describeTypeReference(optionalValue.type)}`, value);
|
|
8883
8906
|
}
|
|
8884
8907
|
if (typeof value !== primitiveType.primitive) {
|
|
8885
|
-
throw new
|
|
8908
|
+
throw new SerializationError(`Value is not a ${spec.describeTypeReference(optionalValue.type)}`, value);
|
|
8886
8909
|
}
|
|
8887
8910
|
return value;
|
|
8888
8911
|
},
|
|
@@ -8890,21 +8913,22 @@ var __webpack_modules__ = {
|
|
|
8890
8913
|
if (nullAndOk(value, optionalValue)) {
|
|
8891
8914
|
return undefined;
|
|
8892
8915
|
}
|
|
8893
|
-
|
|
8894
|
-
throw new Error("Encountered unexpected `void` type");
|
|
8895
|
-
}
|
|
8916
|
+
assert(optionalValue !== VOID, "Encountered unexpected void type!");
|
|
8896
8917
|
const primitiveType = optionalValue.type;
|
|
8897
8918
|
if (!isScalar(value)) {
|
|
8898
|
-
throw new
|
|
8919
|
+
throw new SerializationError(`Value is not a ${spec.describeTypeReference(optionalValue.type)}`, value);
|
|
8899
8920
|
}
|
|
8900
8921
|
if (typeof value !== primitiveType.primitive) {
|
|
8901
|
-
throw new
|
|
8922
|
+
throw new SerializationError(`Value is not a ${spec.describeTypeReference(optionalValue.type)}`, value);
|
|
8902
8923
|
}
|
|
8903
8924
|
return value;
|
|
8904
8925
|
}
|
|
8905
8926
|
},
|
|
8906
8927
|
["Json"]: {
|
|
8907
|
-
serialize(value) {
|
|
8928
|
+
serialize(value, optionalValue) {
|
|
8929
|
+
if (nullAndOk(value, optionalValue)) {
|
|
8930
|
+
return undefined;
|
|
8931
|
+
}
|
|
8908
8932
|
return value;
|
|
8909
8933
|
},
|
|
8910
8934
|
deserialize(value, optionalValue, host) {
|
|
@@ -8931,15 +8955,15 @@ var __webpack_modules__ = {
|
|
|
8931
8955
|
return value.map(mapJsonValue);
|
|
8932
8956
|
}
|
|
8933
8957
|
return mapValues(value, mapJsonValue);
|
|
8934
|
-
function mapJsonValue(toMap) {
|
|
8958
|
+
function mapJsonValue(toMap, key) {
|
|
8935
8959
|
if (toMap == null) {
|
|
8936
8960
|
return toMap;
|
|
8937
8961
|
}
|
|
8938
|
-
return host
|
|
8962
|
+
return process(host, "deserialize", toMap, {
|
|
8939
8963
|
type: {
|
|
8940
8964
|
primitive: spec.PrimitiveType.Json
|
|
8941
8965
|
}
|
|
8942
|
-
});
|
|
8966
|
+
}, typeof key === "string" ? `key ${(0, util_1.inspect)(key)}` : `index ${key}`);
|
|
8943
8967
|
}
|
|
8944
8968
|
}
|
|
8945
8969
|
},
|
|
@@ -8948,18 +8972,16 @@ var __webpack_modules__ = {
|
|
|
8948
8972
|
if (nullAndOk(value, optionalValue)) {
|
|
8949
8973
|
return undefined;
|
|
8950
8974
|
}
|
|
8951
|
-
|
|
8952
|
-
throw new Error("Encountered unexpected `void` type");
|
|
8953
|
-
}
|
|
8975
|
+
assert(optionalValue !== VOID, "Encountered unexpected void type!");
|
|
8954
8976
|
if (typeof value !== "string" && typeof value !== "number") {
|
|
8955
|
-
throw new
|
|
8977
|
+
throw new SerializationError(`Value is not a string or number`, value);
|
|
8956
8978
|
}
|
|
8957
8979
|
host.debug("Serializing enum");
|
|
8958
8980
|
const enumType = optionalValue.type;
|
|
8959
8981
|
const enumMap = host.findSymbol(enumType.fqn);
|
|
8960
8982
|
const enumEntry = Object.entries(enumMap).find((([, v]) => v === value));
|
|
8961
8983
|
if (!enumEntry) {
|
|
8962
|
-
throw new
|
|
8984
|
+
throw new SerializationError(`Value is not present in enum ${spec.describeTypeReference(enumType)}`, value);
|
|
8963
8985
|
}
|
|
8964
8986
|
return {
|
|
8965
8987
|
[api_1.TOKEN_ENUM]: `${enumType.fqn}/${enumEntry[0]}`
|
|
@@ -8970,7 +8992,7 @@ var __webpack_modules__ = {
|
|
|
8970
8992
|
return undefined;
|
|
8971
8993
|
}
|
|
8972
8994
|
if (!(0, api_1.isWireEnum)(value)) {
|
|
8973
|
-
throw new
|
|
8995
|
+
throw new SerializationError(`Value does not have the "${api_1.TOKEN_ENUM}" key`, value);
|
|
8974
8996
|
}
|
|
8975
8997
|
return deserializeEnum(value, host.findSymbol);
|
|
8976
8998
|
}
|
|
@@ -8980,31 +9002,27 @@ var __webpack_modules__ = {
|
|
|
8980
9002
|
if (nullAndOk(value, optionalValue)) {
|
|
8981
9003
|
return undefined;
|
|
8982
9004
|
}
|
|
8983
|
-
|
|
8984
|
-
throw new Error("Encountered unexpected `void` type");
|
|
8985
|
-
}
|
|
9005
|
+
assert(optionalValue !== VOID, "Encountered unexpected void type!");
|
|
8986
9006
|
if (!Array.isArray(value)) {
|
|
8987
|
-
throw new
|
|
9007
|
+
throw new SerializationError(`Value is not an array`, value);
|
|
8988
9008
|
}
|
|
8989
9009
|
const arrayType = optionalValue.type;
|
|
8990
|
-
return value.map((x => host
|
|
9010
|
+
return value.map(((x, idx) => process(host, "serialize", x, {
|
|
8991
9011
|
type: arrayType.collection.elementtype
|
|
8992
|
-
})));
|
|
9012
|
+
}, `index ${(0, util_1.inspect)(idx)}`)));
|
|
8993
9013
|
},
|
|
8994
9014
|
deserialize(value, optionalValue, host) {
|
|
8995
9015
|
if (nullAndOk(value, optionalValue)) {
|
|
8996
9016
|
return undefined;
|
|
8997
9017
|
}
|
|
8998
|
-
|
|
8999
|
-
throw new Error("Encountered unexpected `void` type");
|
|
9000
|
-
}
|
|
9018
|
+
assert(optionalValue !== VOID, "Encountered unexpected void type!");
|
|
9001
9019
|
if (!Array.isArray(value)) {
|
|
9002
|
-
throw new
|
|
9020
|
+
throw new SerializationError(`Value is not an array`, value);
|
|
9003
9021
|
}
|
|
9004
9022
|
const arrayType = optionalValue.type;
|
|
9005
|
-
return value.map((x => host
|
|
9023
|
+
return value.map(((x, idx) => process(host, "deserialize", x, {
|
|
9006
9024
|
type: arrayType.collection.elementtype
|
|
9007
|
-
})));
|
|
9025
|
+
}, `index ${(0, util_1.inspect)(idx)}`)));
|
|
9008
9026
|
}
|
|
9009
9027
|
},
|
|
9010
9028
|
["Map"]: {
|
|
@@ -9012,32 +9030,28 @@ var __webpack_modules__ = {
|
|
|
9012
9030
|
if (nullAndOk(value, optionalValue)) {
|
|
9013
9031
|
return undefined;
|
|
9014
9032
|
}
|
|
9015
|
-
|
|
9016
|
-
throw new Error("Encountered unexpected `void` type");
|
|
9017
|
-
}
|
|
9033
|
+
assert(optionalValue !== VOID, "Encountered unexpected void type!");
|
|
9018
9034
|
const mapType = optionalValue.type;
|
|
9019
9035
|
return {
|
|
9020
|
-
[api_1.TOKEN_MAP]: mapValues(value, (v => host
|
|
9036
|
+
[api_1.TOKEN_MAP]: mapValues(value, ((v, key) => process(host, "serialize", v, {
|
|
9021
9037
|
type: mapType.collection.elementtype
|
|
9022
|
-
})))
|
|
9038
|
+
}, `key ${(0, util_1.inspect)(key)}`)))
|
|
9023
9039
|
};
|
|
9024
9040
|
},
|
|
9025
9041
|
deserialize(value, optionalValue, host) {
|
|
9026
9042
|
if (nullAndOk(value, optionalValue)) {
|
|
9027
9043
|
return undefined;
|
|
9028
9044
|
}
|
|
9029
|
-
|
|
9030
|
-
throw new Error("Encountered unexpected `void` type");
|
|
9031
|
-
}
|
|
9045
|
+
assert(optionalValue !== VOID, "Encountered unexpected void type!");
|
|
9032
9046
|
const mapType = optionalValue.type;
|
|
9033
9047
|
if (!(0, api_1.isWireMap)(value)) {
|
|
9034
|
-
return mapValues(value, (v => host
|
|
9048
|
+
return mapValues(value, ((v, key) => process(host, "deserialize", v, {
|
|
9035
9049
|
type: mapType.collection.elementtype
|
|
9036
|
-
})));
|
|
9050
|
+
}, `key ${(0, util_1.inspect)(key)}`)));
|
|
9037
9051
|
}
|
|
9038
|
-
const result = mapValues(value[api_1.TOKEN_MAP], (v => host
|
|
9052
|
+
const result = mapValues(value[api_1.TOKEN_MAP], ((v, key) => process(host, "deserialize", v, {
|
|
9039
9053
|
type: mapType.collection.elementtype
|
|
9040
|
-
})));
|
|
9054
|
+
}, `key ${(0, util_1.inspect)(key)}`)));
|
|
9041
9055
|
Object.defineProperty(result, exports.SYMBOL_WIRE_TYPE, {
|
|
9042
9056
|
configurable: false,
|
|
9043
9057
|
enumerable: false,
|
|
@@ -9052,32 +9066,31 @@ var __webpack_modules__ = {
|
|
|
9052
9066
|
if (nullAndOk(value, optionalValue)) {
|
|
9053
9067
|
return undefined;
|
|
9054
9068
|
}
|
|
9055
|
-
|
|
9056
|
-
|
|
9069
|
+
assert(optionalValue !== VOID, "Encountered unexpected void type!");
|
|
9070
|
+
if (typeof value !== "object" || value == null || value instanceof Date) {
|
|
9071
|
+
throw new SerializationError(`Value is not an object`, value);
|
|
9057
9072
|
}
|
|
9058
|
-
if (
|
|
9059
|
-
throw new
|
|
9073
|
+
if (Array.isArray(value)) {
|
|
9074
|
+
throw new SerializationError(`Value is an array`, value);
|
|
9060
9075
|
}
|
|
9061
9076
|
host.debug("Returning value type by reference");
|
|
9062
9077
|
return host.objects.registerObject(value, exports.EMPTY_OBJECT_FQN, [ optionalValue.type.fqn ]);
|
|
9063
9078
|
},
|
|
9064
9079
|
deserialize(value, optionalValue, host) {
|
|
9065
|
-
if (typeof value === "object" && Object.keys(value
|
|
9080
|
+
if (typeof value === "object" && Object.keys(value !== null && value !== void 0 ? value : {}).length === 0) {
|
|
9066
9081
|
value = undefined;
|
|
9067
9082
|
}
|
|
9068
9083
|
if (nullAndOk(value, optionalValue)) {
|
|
9069
9084
|
return undefined;
|
|
9070
9085
|
}
|
|
9071
|
-
|
|
9072
|
-
throw new Error("Encountered unexpected `void` type");
|
|
9073
|
-
}
|
|
9086
|
+
assert(optionalValue !== VOID, "Encountered unexpected void type!");
|
|
9074
9087
|
if (typeof value !== "object" || value == null) {
|
|
9075
|
-
throw new
|
|
9088
|
+
throw new SerializationError(`Value is not an object`, value);
|
|
9076
9089
|
}
|
|
9077
9090
|
const namedType = host.lookupType(optionalValue.type.fqn);
|
|
9078
9091
|
const props = propertiesOf(namedType, host.lookupType);
|
|
9079
9092
|
if (Array.isArray(value)) {
|
|
9080
|
-
throw new
|
|
9093
|
+
throw new SerializationError("Value is an array (varargs may have been incorrectly supplied)", value);
|
|
9081
9094
|
}
|
|
9082
9095
|
if ((0, api_1.isObjRef)(value)) {
|
|
9083
9096
|
host.debug("Expected value type but got reference type, accepting for now (awslabs/jsii#400)");
|
|
@@ -9086,7 +9099,7 @@ var __webpack_modules__ = {
|
|
|
9086
9099
|
if (_1.api.isWireStruct(value)) {
|
|
9087
9100
|
const {fqn, data} = value[_1.api.TOKEN_STRUCT];
|
|
9088
9101
|
if (!isAssignable(fqn, namedType, host.lookupType)) {
|
|
9089
|
-
throw new
|
|
9102
|
+
throw new SerializationError(`Wired struct has type '${fqn}', which does not match expected type`, value);
|
|
9090
9103
|
}
|
|
9091
9104
|
value = data;
|
|
9092
9105
|
}
|
|
@@ -9098,35 +9111,35 @@ var __webpack_modules__ = {
|
|
|
9098
9111
|
if (!props[key]) {
|
|
9099
9112
|
return undefined;
|
|
9100
9113
|
}
|
|
9101
|
-
return host
|
|
9114
|
+
return process(host, "deserialize", v, props[key], `key ${(0, util_1.inspect)(key)}`);
|
|
9102
9115
|
}));
|
|
9103
9116
|
}
|
|
9104
9117
|
},
|
|
9105
9118
|
["RefType"]: {
|
|
9106
9119
|
serialize(value, optionalValue, host) {
|
|
9120
|
+
var _a;
|
|
9107
9121
|
if (nullAndOk(value, optionalValue)) {
|
|
9108
9122
|
return undefined;
|
|
9109
9123
|
}
|
|
9110
|
-
|
|
9111
|
-
|
|
9124
|
+
assert(optionalValue !== VOID, "Encountered unexpected void type!");
|
|
9125
|
+
if (typeof value !== "object" || value == null || Array.isArray(value)) {
|
|
9126
|
+
throw new SerializationError(`Value is not an object`, value);
|
|
9112
9127
|
}
|
|
9113
|
-
if (
|
|
9114
|
-
throw new
|
|
9128
|
+
if (value instanceof Date) {
|
|
9129
|
+
throw new SerializationError(`Value is a Date`, value);
|
|
9115
9130
|
}
|
|
9116
9131
|
const expectedType = host.lookupType(optionalValue.type.fqn);
|
|
9117
9132
|
const interfaces = spec.isInterfaceType(expectedType) ? [ expectedType.fqn ] : undefined;
|
|
9118
|
-
const jsiiType = (0, objects_1.jsiiTypeFqn)(value)
|
|
9133
|
+
const jsiiType = (_a = (0, objects_1.jsiiTypeFqn)(value)) !== null && _a !== void 0 ? _a : spec.isClassType(expectedType) ? expectedType.fqn : exports.EMPTY_OBJECT_FQN;
|
|
9119
9134
|
return host.objects.registerObject(value, jsiiType, interfaces);
|
|
9120
9135
|
},
|
|
9121
9136
|
deserialize(value, optionalValue, host) {
|
|
9122
9137
|
if (nullAndOk(value, optionalValue)) {
|
|
9123
9138
|
return undefined;
|
|
9124
9139
|
}
|
|
9125
|
-
|
|
9126
|
-
throw new Error("Encountered unexpected `void` type");
|
|
9127
|
-
}
|
|
9140
|
+
assert(optionalValue !== VOID, "Encountered unexpected void type!");
|
|
9128
9141
|
if (!(0, api_1.isObjRef)(value)) {
|
|
9129
|
-
throw new
|
|
9142
|
+
throw new SerializationError(`Value does not have the "${api_1.TOKEN_REF}" key`, value);
|
|
9130
9143
|
}
|
|
9131
9144
|
const {instance, fqn} = host.objects.findObject(value);
|
|
9132
9145
|
const namedTypeRef = optionalValue.type;
|
|
@@ -9134,7 +9147,7 @@ var __webpack_modules__ = {
|
|
|
9134
9147
|
const namedType = host.lookupType(namedTypeRef.fqn);
|
|
9135
9148
|
const declaredType = optionalValue.type;
|
|
9136
9149
|
if (spec.isClassType(namedType) && !isAssignable(fqn, declaredType, host.lookupType)) {
|
|
9137
|
-
throw new
|
|
9150
|
+
throw new SerializationError(`Object of type '${fqn}' is not convertible to ${spec.describeTypeReference(declaredType)}`, value);
|
|
9138
9151
|
}
|
|
9139
9152
|
}
|
|
9140
9153
|
return instance;
|
|
@@ -9142,6 +9155,7 @@ var __webpack_modules__ = {
|
|
|
9142
9155
|
},
|
|
9143
9156
|
["Any"]: {
|
|
9144
9157
|
serialize(value, _type, host) {
|
|
9158
|
+
var _a;
|
|
9145
9159
|
if (value == null) {
|
|
9146
9160
|
return undefined;
|
|
9147
9161
|
}
|
|
@@ -9152,15 +9166,15 @@ var __webpack_modules__ = {
|
|
|
9152
9166
|
return value;
|
|
9153
9167
|
}
|
|
9154
9168
|
if (Array.isArray(value)) {
|
|
9155
|
-
return value.map((e => host
|
|
9169
|
+
return value.map(((e, idx) => process(host, "serialize", e, {
|
|
9156
9170
|
type: spec.CANONICAL_ANY
|
|
9157
|
-
})));
|
|
9171
|
+
}, `index ${(0, util_1.inspect)(idx)}`)));
|
|
9158
9172
|
}
|
|
9159
9173
|
if (typeof value === "function") {
|
|
9160
|
-
throw new
|
|
9174
|
+
throw new SerializationError("Functions cannot be passed across language boundaries", value);
|
|
9161
9175
|
}
|
|
9162
9176
|
if (typeof value !== "object" || value == null) {
|
|
9163
|
-
throw new
|
|
9177
|
+
throw new SerializationError(`A jsii kernel assumption was violated: value is not an object`, value);
|
|
9164
9178
|
}
|
|
9165
9179
|
if (exports.SYMBOL_WIRE_TYPE in value && value[exports.SYMBOL_WIRE_TYPE] === api_1.TOKEN_MAP) {
|
|
9166
9180
|
return exports.SERIALIZERS["Map"].serialize(value, {
|
|
@@ -9173,19 +9187,19 @@ var __webpack_modules__ = {
|
|
|
9173
9187
|
}, host);
|
|
9174
9188
|
}
|
|
9175
9189
|
if (value instanceof Set || value instanceof Map) {
|
|
9176
|
-
throw new
|
|
9190
|
+
throw new SerializationError("Set and Map instances cannot be sent across the language boundary", value);
|
|
9177
9191
|
}
|
|
9178
9192
|
const prevRef = (0, objects_1.objectReference)(value);
|
|
9179
9193
|
if (prevRef) {
|
|
9180
9194
|
return prevRef;
|
|
9181
9195
|
}
|
|
9182
|
-
const jsiiType = (0, objects_1.jsiiTypeFqn)(value)
|
|
9196
|
+
const jsiiType = (_a = (0, objects_1.jsiiTypeFqn)(value)) !== null && _a !== void 0 ? _a : isByReferenceOnly(value) ? exports.EMPTY_OBJECT_FQN : undefined;
|
|
9183
9197
|
if (jsiiType) {
|
|
9184
9198
|
return host.objects.registerObject(value, jsiiType);
|
|
9185
9199
|
}
|
|
9186
|
-
return mapValues(value, (v => host
|
|
9200
|
+
return mapValues(value, ((v, key) => process(host, "serialize", v, {
|
|
9187
9201
|
type: spec.CANONICAL_ANY
|
|
9188
|
-
})));
|
|
9202
|
+
}, `key ${(0, util_1.inspect)(key)}`)));
|
|
9189
9203
|
},
|
|
9190
9204
|
deserialize(value, _type, host) {
|
|
9191
9205
|
if (value == null) {
|
|
@@ -9201,9 +9215,9 @@ var __webpack_modules__ = {
|
|
|
9201
9215
|
}
|
|
9202
9216
|
if (Array.isArray(value)) {
|
|
9203
9217
|
host.debug("ANY is an Array");
|
|
9204
|
-
return value.map((e => host
|
|
9218
|
+
return value.map(((e, idx) => process(host, "deserialize", e, {
|
|
9205
9219
|
type: spec.CANONICAL_ANY
|
|
9206
|
-
})));
|
|
9220
|
+
}, `index ${(0, util_1.inspect)(idx)}`)));
|
|
9207
9221
|
}
|
|
9208
9222
|
if ((0, api_1.isWireEnum)(value)) {
|
|
9209
9223
|
host.debug("ANY is an Enum");
|
|
@@ -9235,9 +9249,9 @@ var __webpack_modules__ = {
|
|
|
9235
9249
|
}, host);
|
|
9236
9250
|
}
|
|
9237
9251
|
host.debug("ANY is a Map");
|
|
9238
|
-
return mapValues(value, (v => host
|
|
9252
|
+
return mapValues(value, ((v, key) => process(host, "deserialize", v, {
|
|
9239
9253
|
type: spec.CANONICAL_ANY
|
|
9240
|
-
})));
|
|
9254
|
+
}, `key ${(0, util_1.inspect)(key)}`)));
|
|
9241
9255
|
}
|
|
9242
9256
|
}
|
|
9243
9257
|
};
|
|
@@ -9253,20 +9267,18 @@ var __webpack_modules__ = {
|
|
|
9253
9267
|
const enumLocator = value[api_1.TOKEN_ENUM];
|
|
9254
9268
|
const sep = enumLocator.lastIndexOf("/");
|
|
9255
9269
|
if (sep === -1) {
|
|
9256
|
-
throw new
|
|
9270
|
+
throw new SerializationError(`Invalid enum token value ${(0, util_1.inspect)(enumLocator)}`, value);
|
|
9257
9271
|
}
|
|
9258
9272
|
const typeName = enumLocator.slice(0, sep);
|
|
9259
9273
|
const valueName = enumLocator.slice(sep + 1);
|
|
9260
9274
|
const enumValue = lookup(typeName)[valueName];
|
|
9261
9275
|
if (enumValue === undefined) {
|
|
9262
|
-
throw new
|
|
9276
|
+
throw new SerializationError(`No such enum member: ${(0, util_1.inspect)(valueName)}`, value);
|
|
9263
9277
|
}
|
|
9264
9278
|
return enumValue;
|
|
9265
9279
|
}
|
|
9266
9280
|
function serializationType(typeRef, lookup) {
|
|
9267
|
-
|
|
9268
|
-
throw new Error("Kernel error: expected type information, got 'undefined'");
|
|
9269
|
-
}
|
|
9281
|
+
assert(typeRef != null, `Kernel error: expected type information, got ${(0, util_1.inspect)(typeRef)}`);
|
|
9270
9282
|
if (typeRef === "void") {
|
|
9271
9283
|
return [ {
|
|
9272
9284
|
serializationClass: "Void",
|
|
@@ -9301,7 +9313,7 @@ var __webpack_modules__ = {
|
|
|
9301
9313
|
typeRef
|
|
9302
9314
|
} ];
|
|
9303
9315
|
}
|
|
9304
|
-
|
|
9316
|
+
assert(false, `Unknown primitive type: ${(0, util_1.inspect)(typeRef.type)}`);
|
|
9305
9317
|
}
|
|
9306
9318
|
if (spec.isCollectionTypeReference(typeRef.type)) {
|
|
9307
9319
|
return [ {
|
|
@@ -9344,7 +9356,7 @@ var __webpack_modules__ = {
|
|
|
9344
9356
|
return false;
|
|
9345
9357
|
}
|
|
9346
9358
|
if (type !== "void" && !type.optional) {
|
|
9347
|
-
throw new
|
|
9359
|
+
throw new SerializationError(`A value is required (type is non-optional)`, x);
|
|
9348
9360
|
}
|
|
9349
9361
|
return true;
|
|
9350
9362
|
}
|
|
@@ -9363,7 +9375,10 @@ var __webpack_modules__ = {
|
|
|
9363
9375
|
}
|
|
9364
9376
|
function mapValues(value, fn) {
|
|
9365
9377
|
if (typeof value !== "object" || value == null) {
|
|
9366
|
-
throw new
|
|
9378
|
+
throw new SerializationError(`Value is not an object`, value);
|
|
9379
|
+
}
|
|
9380
|
+
if (Array.isArray(value)) {
|
|
9381
|
+
throw new SerializationError(`Value is an array`, value);
|
|
9367
9382
|
}
|
|
9368
9383
|
const out = {};
|
|
9369
9384
|
for (const [k, v] of Object.entries(value)) {
|
|
@@ -9376,6 +9391,7 @@ var __webpack_modules__ = {
|
|
|
9376
9391
|
return out;
|
|
9377
9392
|
}
|
|
9378
9393
|
function propertiesOf(t, lookup) {
|
|
9394
|
+
var _a;
|
|
9379
9395
|
if (!spec.isClassOrInterfaceType(t)) {
|
|
9380
9396
|
return {};
|
|
9381
9397
|
}
|
|
@@ -9394,7 +9410,7 @@ var __webpack_modules__ = {
|
|
|
9394
9410
|
...propertiesOf(lookup(t.base), lookup)
|
|
9395
9411
|
};
|
|
9396
9412
|
}
|
|
9397
|
-
for (const prop of t.properties
|
|
9413
|
+
for (const prop of (_a = t.properties) !== null && _a !== void 0 ? _a : []) {
|
|
9398
9414
|
ret[prop.name] = prop;
|
|
9399
9415
|
}
|
|
9400
9416
|
return ret;
|
|
@@ -9420,7 +9436,8 @@ var __webpack_modules__ = {
|
|
|
9420
9436
|
function validateRequiredProps(actualProps, typeName, specProps) {
|
|
9421
9437
|
const missingRequiredProps = Object.keys(specProps).filter((name => !specProps[name].optional)).filter((name => !(name in actualProps)));
|
|
9422
9438
|
if (missingRequiredProps.length > 0) {
|
|
9423
|
-
throw new
|
|
9439
|
+
throw new SerializationError(`Missing required properties for ${typeName}: ${missingRequiredProps.map((p => (0,
|
|
9440
|
+
util_1.inspect)(p))).join(", ")}`, actualProps);
|
|
9424
9441
|
}
|
|
9425
9442
|
return actualProps;
|
|
9426
9443
|
}
|
|
@@ -9436,13 +9453,85 @@ var __webpack_modules__ = {
|
|
|
9436
9453
|
do {
|
|
9437
9454
|
for (const prop of Object.getOwnPropertyNames(curr)) {
|
|
9438
9455
|
const descr = Object.getOwnPropertyDescriptor(curr, prop);
|
|
9439
|
-
if (descr
|
|
9456
|
+
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
9457
|
return true;
|
|
9441
9458
|
}
|
|
9442
9459
|
}
|
|
9443
9460
|
} while (Object.getPrototypeOf(curr = Object.getPrototypeOf(curr)) != null);
|
|
9444
9461
|
return false;
|
|
9445
9462
|
}
|
|
9463
|
+
function process(host, serde, value, type, context) {
|
|
9464
|
+
const wireTypes = serializationType(type, host.lookupType);
|
|
9465
|
+
host.debug(serde, value, wireTypes);
|
|
9466
|
+
const errors = new Array;
|
|
9467
|
+
for (const {serializationClass, typeRef} of wireTypes) {
|
|
9468
|
+
try {
|
|
9469
|
+
return exports.SERIALIZERS[serializationClass][serde](value, typeRef, host);
|
|
9470
|
+
} catch (error) {
|
|
9471
|
+
error.context = `as ${typeRef === VOID ? VOID : spec.describeTypeReference(typeRef.type)}`;
|
|
9472
|
+
errors.push(error);
|
|
9473
|
+
}
|
|
9474
|
+
}
|
|
9475
|
+
const typeDescr = type === VOID ? type : spec.describeTypeReference(type.type);
|
|
9476
|
+
const optionalTypeDescr = type !== VOID && type.optional ? `${typeDescr} | undefined` : typeDescr;
|
|
9477
|
+
throw new SerializationError(`${titleize(context)}: Unable to ${serde} value as ${optionalTypeDescr}`, value, errors, {
|
|
9478
|
+
renderValue: true
|
|
9479
|
+
});
|
|
9480
|
+
function titleize(text) {
|
|
9481
|
+
text = text.trim();
|
|
9482
|
+
if (text === "") {
|
|
9483
|
+
return text;
|
|
9484
|
+
}
|
|
9485
|
+
const [first, ...rest] = text;
|
|
9486
|
+
return [ first.toUpperCase(), ...rest ].join("");
|
|
9487
|
+
}
|
|
9488
|
+
}
|
|
9489
|
+
exports.process = process;
|
|
9490
|
+
class SerializationError extends Error {
|
|
9491
|
+
constructor(message, value, causes = [], {renderValue = false} = {}) {
|
|
9492
|
+
super([ message, ...renderValue ? [ `${causes.length > 0 ? "├" : "╰"}── 🛑 Failing value is ${describeTypeOf(value)}`, ...value == null ? [] : (0,
|
|
9493
|
+
util_1.inspect)(value, false, 0).split("\n").map((l => `${causes.length > 0 ? "│" : " "} ${l}`)) ] : [], ...causes.length > 0 ? [ "╰── 🔍 Failure reason(s):", ...causes.map(((cause, idx) => {
|
|
9494
|
+
var _a;
|
|
9495
|
+
return ` ${idx < causes.length - 1 ? "├" : "╰"}─${causes.length > 1 ? ` [${(_a = cause.context) !== null && _a !== void 0 ? _a : (0,
|
|
9496
|
+
util_1.inspect)(idx)}]` : ""} ${cause.message.split("\n").join("\n ")}`;
|
|
9497
|
+
})) ] : [] ].join("\n"));
|
|
9498
|
+
this.value = value;
|
|
9499
|
+
this.causes = causes;
|
|
9500
|
+
this.name = "@jsii/kernel.SerializationError";
|
|
9501
|
+
}
|
|
9502
|
+
}
|
|
9503
|
+
exports.SerializationError = SerializationError;
|
|
9504
|
+
function describeTypeOf(value) {
|
|
9505
|
+
const type = typeof value;
|
|
9506
|
+
switch (type) {
|
|
9507
|
+
case "object":
|
|
9508
|
+
if (value == null) {
|
|
9509
|
+
return JSON.stringify(value);
|
|
9510
|
+
}
|
|
9511
|
+
if (Array.isArray(value)) {
|
|
9512
|
+
return "an array";
|
|
9513
|
+
}
|
|
9514
|
+
const fqn = (0, objects_1.jsiiTypeFqn)(value);
|
|
9515
|
+
if (fqn != null && fqn !== exports.EMPTY_OBJECT_FQN) {
|
|
9516
|
+
return `an instance of ${fqn}`;
|
|
9517
|
+
}
|
|
9518
|
+
const ctorName = value.constructor.name;
|
|
9519
|
+
if (ctorName != null && ctorName !== Object.name) {
|
|
9520
|
+
return `an instance of ${ctorName}`;
|
|
9521
|
+
}
|
|
9522
|
+
return `an object`;
|
|
9523
|
+
|
|
9524
|
+
case "undefined":
|
|
9525
|
+
return type;
|
|
9526
|
+
|
|
9527
|
+
case "boolean":
|
|
9528
|
+
case "function":
|
|
9529
|
+
case "number":
|
|
9530
|
+
case "string":
|
|
9531
|
+
default:
|
|
9532
|
+
return `a ${type}`;
|
|
9533
|
+
}
|
|
9534
|
+
}
|
|
9446
9535
|
},
|
|
9447
9536
|
7905: (__unused_webpack_module, exports, __webpack_require__) => {
|
|
9448
9537
|
"use strict";
|
|
@@ -9461,9 +9550,10 @@ var __webpack_modules__ = {
|
|
|
9461
9550
|
this.kernel.traceEnabled = opts.debug ? true : false;
|
|
9462
9551
|
}
|
|
9463
9552
|
run() {
|
|
9553
|
+
var _a;
|
|
9464
9554
|
const req = this.inout.read();
|
|
9465
9555
|
if (!req || "exit" in req) {
|
|
9466
|
-
this.eventEmitter.emit("exit", req
|
|
9556
|
+
this.eventEmitter.emit("exit", (_a = req === null || req === void 0 ? void 0 : req.exit) !== null && _a !== void 0 ? _a : 0);
|
|
9467
9557
|
return;
|
|
9468
9558
|
}
|
|
9469
9559
|
this.processRequest(req, (() => {
|
|
@@ -9556,7 +9646,7 @@ var __webpack_modules__ = {
|
|
|
9556
9646
|
this.inout.write(res);
|
|
9557
9647
|
}
|
|
9558
9648
|
isPromise(v) {
|
|
9559
|
-
return typeof v
|
|
9649
|
+
return typeof (v === null || v === void 0 ? void 0 : v.then) === "function";
|
|
9560
9650
|
}
|
|
9561
9651
|
findApi(apiName) {
|
|
9562
9652
|
const fn = this.kernel[apiName];
|
|
@@ -9663,13 +9753,91 @@ var __webpack_modules__ = {
|
|
|
9663
9753
|
}
|
|
9664
9754
|
exports.SyncStdio = SyncStdio;
|
|
9665
9755
|
},
|
|
9756
|
+
1228: (__unused_webpack_module, exports, __webpack_require__) => {
|
|
9757
|
+
"use strict";
|
|
9758
|
+
Object.defineProperty(exports, "__esModule", {
|
|
9759
|
+
value: true
|
|
9760
|
+
});
|
|
9761
|
+
exports.loadAssemblyFromFile = exports.loadAssemblyFromPath = exports.loadAssemblyFromBuffer = exports.writeAssembly = exports.findAssemblyFile = exports.compressedAssemblyExists = void 0;
|
|
9762
|
+
const fs = __webpack_require__(7147);
|
|
9763
|
+
const path = __webpack_require__(4822);
|
|
9764
|
+
const zlib = __webpack_require__(9796);
|
|
9765
|
+
const assembly_1 = __webpack_require__(2752);
|
|
9766
|
+
const redirect_1 = __webpack_require__(9639);
|
|
9767
|
+
const validate_assembly_1 = __webpack_require__(5907);
|
|
9768
|
+
function compressedAssemblyExists(directory) {
|
|
9769
|
+
return fs.existsSync(path.join(directory, assembly_1.SPEC_FILE_NAME_COMPRESSED));
|
|
9770
|
+
}
|
|
9771
|
+
exports.compressedAssemblyExists = compressedAssemblyExists;
|
|
9772
|
+
function findAssemblyFile(directory) {
|
|
9773
|
+
const dotJsiiFile = path.join(directory, assembly_1.SPEC_FILE_NAME);
|
|
9774
|
+
if (!fs.existsSync(dotJsiiFile)) {
|
|
9775
|
+
throw new Error(`Expected to find ${assembly_1.SPEC_FILE_NAME} file in ${directory}, but no such file found`);
|
|
9776
|
+
}
|
|
9777
|
+
return dotJsiiFile;
|
|
9778
|
+
}
|
|
9779
|
+
exports.findAssemblyFile = findAssemblyFile;
|
|
9780
|
+
function writeAssembly(directory, assembly, {compress = false} = {}) {
|
|
9781
|
+
if (compress) {
|
|
9782
|
+
fs.writeFileSync(path.join(directory, assembly_1.SPEC_FILE_NAME), JSON.stringify({
|
|
9783
|
+
schema: "jsii/file-redirect",
|
|
9784
|
+
compression: "gzip",
|
|
9785
|
+
filename: assembly_1.SPEC_FILE_NAME_COMPRESSED
|
|
9786
|
+
}), "utf-8");
|
|
9787
|
+
fs.writeFileSync(path.join(directory, assembly_1.SPEC_FILE_NAME_COMPRESSED), zlib.gzipSync(JSON.stringify(assembly)));
|
|
9788
|
+
} else {
|
|
9789
|
+
fs.writeFileSync(path.join(directory, assembly_1.SPEC_FILE_NAME), JSON.stringify(assembly, null, 2), "utf-8");
|
|
9790
|
+
}
|
|
9791
|
+
return compress;
|
|
9792
|
+
}
|
|
9793
|
+
exports.writeAssembly = writeAssembly;
|
|
9794
|
+
const failNoReadfileProvided = filename => {
|
|
9795
|
+
throw new Error(`Unable to load assembly support file ${JSON.stringify(filename)}: no readFile callback provided!`);
|
|
9796
|
+
};
|
|
9797
|
+
function loadAssemblyFromBuffer(assemblyBuffer, readFile = failNoReadfileProvided, validate = true) {
|
|
9798
|
+
let contents = JSON.parse(assemblyBuffer.toString("utf-8"));
|
|
9799
|
+
while ((0, redirect_1.isAssemblyRedirect)(contents)) {
|
|
9800
|
+
contents = followRedirect(contents, readFile);
|
|
9801
|
+
}
|
|
9802
|
+
return validate ? (0, validate_assembly_1.validateAssembly)(contents) : contents;
|
|
9803
|
+
}
|
|
9804
|
+
exports.loadAssemblyFromBuffer = loadAssemblyFromBuffer;
|
|
9805
|
+
function loadAssemblyFromPath(directory, validate = true) {
|
|
9806
|
+
const assemblyFile = findAssemblyFile(directory);
|
|
9807
|
+
return loadAssemblyFromFile(assemblyFile, validate);
|
|
9808
|
+
}
|
|
9809
|
+
exports.loadAssemblyFromPath = loadAssemblyFromPath;
|
|
9810
|
+
function loadAssemblyFromFile(pathToFile, validate = true) {
|
|
9811
|
+
const data = fs.readFileSync(pathToFile);
|
|
9812
|
+
return loadAssemblyFromBuffer(data, (filename => fs.readFileSync(path.resolve(pathToFile, "..", filename))), validate);
|
|
9813
|
+
}
|
|
9814
|
+
exports.loadAssemblyFromFile = loadAssemblyFromFile;
|
|
9815
|
+
function followRedirect(assemblyRedirect, readFile) {
|
|
9816
|
+
(0, redirect_1.validateAssemblyRedirect)(assemblyRedirect);
|
|
9817
|
+
let data = readFile(assemblyRedirect.filename);
|
|
9818
|
+
switch (assemblyRedirect.compression) {
|
|
9819
|
+
case "gzip":
|
|
9820
|
+
data = zlib.gunzipSync(data);
|
|
9821
|
+
break;
|
|
9822
|
+
|
|
9823
|
+
case undefined:
|
|
9824
|
+
break;
|
|
9825
|
+
|
|
9826
|
+
default:
|
|
9827
|
+
throw new Error(`Unsupported compression algorithm: ${JSON.stringify(assemblyRedirect.compression)}`);
|
|
9828
|
+
}
|
|
9829
|
+
const json = data.toString("utf-8");
|
|
9830
|
+
return JSON.parse(json);
|
|
9831
|
+
}
|
|
9832
|
+
},
|
|
9666
9833
|
2752: (__unused_webpack_module, exports) => {
|
|
9667
9834
|
"use strict";
|
|
9668
9835
|
Object.defineProperty(exports, "__esModule", {
|
|
9669
9836
|
value: true
|
|
9670
9837
|
});
|
|
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;
|
|
9838
|
+
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
9839
|
exports.SPEC_FILE_NAME = ".jsii";
|
|
9840
|
+
exports.SPEC_FILE_NAME_COMPRESSED = `${exports.SPEC_FILE_NAME}.gz`;
|
|
9673
9841
|
var SchemaVersion;
|
|
9674
9842
|
(function(SchemaVersion) {
|
|
9675
9843
|
SchemaVersion["LATEST"] = "jsii/0.10.0";
|
|
@@ -9796,8 +9964,10 @@ var __webpack_modules__ = {
|
|
|
9796
9964
|
value: true
|
|
9797
9965
|
});
|
|
9798
9966
|
__exportStar(__webpack_require__(2752), exports);
|
|
9967
|
+
__exportStar(__webpack_require__(1228), exports);
|
|
9799
9968
|
__exportStar(__webpack_require__(5585), exports);
|
|
9800
9969
|
__exportStar(__webpack_require__(1485), exports);
|
|
9970
|
+
__exportStar(__webpack_require__(9639), exports);
|
|
9801
9971
|
__exportStar(__webpack_require__(5907), exports);
|
|
9802
9972
|
},
|
|
9803
9973
|
1485: (__unused_webpack_module, exports) => {
|
|
@@ -9838,6 +10008,33 @@ var __webpack_modules__ = {
|
|
|
9838
10008
|
}
|
|
9839
10009
|
exports.NameTree = NameTree;
|
|
9840
10010
|
},
|
|
10011
|
+
9639: (__unused_webpack_module, exports, __webpack_require__) => {
|
|
10012
|
+
"use strict";
|
|
10013
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10014
|
+
value: true
|
|
10015
|
+
});
|
|
10016
|
+
exports.validateAssemblyRedirect = exports.isAssemblyRedirect = exports.assemblyRedirectSchema = void 0;
|
|
10017
|
+
const ajv_1 = __webpack_require__(2785);
|
|
10018
|
+
exports.assemblyRedirectSchema = __webpack_require__(6715);
|
|
10019
|
+
const SCHEMA = "jsii/file-redirect";
|
|
10020
|
+
function isAssemblyRedirect(obj) {
|
|
10021
|
+
if (typeof obj !== "object" || obj == null) {
|
|
10022
|
+
return false;
|
|
10023
|
+
}
|
|
10024
|
+
return obj.schema === SCHEMA;
|
|
10025
|
+
}
|
|
10026
|
+
exports.isAssemblyRedirect = isAssemblyRedirect;
|
|
10027
|
+
function validateAssemblyRedirect(obj) {
|
|
10028
|
+
const ajv = new ajv_1.default;
|
|
10029
|
+
const validate = ajv.compile(exports.assemblyRedirectSchema);
|
|
10030
|
+
validate(obj);
|
|
10031
|
+
if (validate.errors) {
|
|
10032
|
+
throw new Error(`Invalid assembly redirect:\n${validate.errors.map((e => ` * ${e.message}`)).join("\n").toString()}`);
|
|
10033
|
+
}
|
|
10034
|
+
return obj;
|
|
10035
|
+
}
|
|
10036
|
+
exports.validateAssemblyRedirect = validateAssemblyRedirect;
|
|
10037
|
+
},
|
|
9841
10038
|
5907: (__unused_webpack_module, exports, __webpack_require__) => {
|
|
9842
10039
|
"use strict";
|
|
9843
10040
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -15114,17 +15311,13 @@ var __webpack_modules__ = {
|
|
|
15114
15311
|
"use strict";
|
|
15115
15312
|
module.exports = require("util");
|
|
15116
15313
|
},
|
|
15117
|
-
6144: module => {
|
|
15118
|
-
"use strict";
|
|
15119
|
-
module.exports = require("vm");
|
|
15120
|
-
},
|
|
15121
15314
|
9796: module => {
|
|
15122
15315
|
"use strict";
|
|
15123
15316
|
module.exports = require("zlib");
|
|
15124
15317
|
},
|
|
15125
15318
|
4147: module => {
|
|
15126
15319
|
"use strict";
|
|
15127
|
-
module.exports = JSON.parse('{"name":"@jsii/runtime","version":"1.
|
|
15320
|
+
module.exports = JSON.parse('{"name":"@jsii/runtime","version":"1.63.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.63.0","@jsii/check-node":"1.63.0","@jsii/spec":"^1.63.0"},"devDependencies":{"@scope/jsii-calc-base":"^1.63.0","@scope/jsii-calc-lib":"^1.63.0","jsii-build-tools":"^1.63.0","jsii-calc":"^3.20.120","source-map-loader":"^4.0.0","webpack":"^5.73.0","webpack-cli":"^4.10.0"}}');
|
|
15128
15321
|
},
|
|
15129
15322
|
5277: module => {
|
|
15130
15323
|
"use strict";
|
|
@@ -15134,6 +15327,10 @@ var __webpack_modules__ = {
|
|
|
15134
15327
|
"use strict";
|
|
15135
15328
|
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
15329
|
},
|
|
15330
|
+
6715: module => {
|
|
15331
|
+
"use strict";
|
|
15332
|
+
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"}}}');
|
|
15333
|
+
},
|
|
15137
15334
|
9402: module => {
|
|
15138
15335
|
"use strict";
|
|
15139
15336
|
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"}}}');
|
|
@@ -15148,29 +15345,19 @@ function __webpack_require__(moduleId) {
|
|
|
15148
15345
|
return cachedModule.exports;
|
|
15149
15346
|
}
|
|
15150
15347
|
var module = __webpack_module_cache__[moduleId] = {
|
|
15151
|
-
id: moduleId,
|
|
15152
|
-
loaded: false,
|
|
15153
15348
|
exports: {}
|
|
15154
15349
|
};
|
|
15155
15350
|
__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
15156
|
-
module.loaded = true;
|
|
15157
15351
|
return module.exports;
|
|
15158
15352
|
}
|
|
15159
15353
|
|
|
15160
|
-
(() => {
|
|
15161
|
-
__webpack_require__.nmd = module => {
|
|
15162
|
-
module.paths = [];
|
|
15163
|
-
if (!module.children) module.children = [];
|
|
15164
|
-
return module;
|
|
15165
|
-
};
|
|
15166
|
-
})();
|
|
15167
|
-
|
|
15168
15354
|
var __webpack_exports__ = {};
|
|
15169
15355
|
|
|
15170
15356
|
(() => {
|
|
15171
15357
|
"use strict";
|
|
15172
15358
|
var exports = __webpack_exports__;
|
|
15173
15359
|
var __webpack_unused_export__;
|
|
15360
|
+
var _a;
|
|
15174
15361
|
__webpack_unused_export__ = {
|
|
15175
15362
|
value: true
|
|
15176
15363
|
};
|
|
@@ -15183,7 +15370,7 @@ var __webpack_exports__ = {};
|
|
|
15183
15370
|
const noStack = !!process.env.JSII_NOSTACK;
|
|
15184
15371
|
const debug = !!process.env.JSII_DEBUG;
|
|
15185
15372
|
const stdio = new sync_stdio_1.SyncStdio({
|
|
15186
|
-
errorFD: process.stderr.fd
|
|
15373
|
+
errorFD: (_a = process.stderr.fd) !== null && _a !== void 0 ? _a : 2,
|
|
15187
15374
|
readFD: 3,
|
|
15188
15375
|
writeFD: 3
|
|
15189
15376
|
});
|