@rpcbase/api 0.75.0 → 0.77.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/dist/index.js +141 -71
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9595,6 +9595,7 @@ function requireStreams() {
|
|
|
9595
9595
|
};
|
|
9596
9596
|
return streams;
|
|
9597
9597
|
}
|
|
9598
|
+
lib$1.exports;
|
|
9598
9599
|
var hasRequiredLib$1;
|
|
9599
9600
|
function requireLib$1() {
|
|
9600
9601
|
if (hasRequiredLib$1) return lib$1.exports;
|
|
@@ -9603,55 +9604,54 @@ function requireLib$1() {
|
|
|
9603
9604
|
var Buffer2 = requireSafer().Buffer;
|
|
9604
9605
|
var bomHandling2 = requireBomHandling();
|
|
9605
9606
|
var mergeModules = requireMergeExports();
|
|
9606
|
-
|
|
9607
|
-
|
|
9608
|
-
|
|
9609
|
-
|
|
9610
|
-
iconv.encode = function encode(str, encoding2, options) {
|
|
9607
|
+
module.exports.encodings = null;
|
|
9608
|
+
module.exports.defaultCharUnicode = "�";
|
|
9609
|
+
module.exports.defaultCharSingleByte = "?";
|
|
9610
|
+
module.exports.encode = function encode(str, encoding2, options) {
|
|
9611
9611
|
str = "" + (str || "");
|
|
9612
|
-
var encoder =
|
|
9612
|
+
var encoder = module.exports.getEncoder(encoding2, options);
|
|
9613
9613
|
var res = encoder.write(str);
|
|
9614
9614
|
var trail = encoder.end();
|
|
9615
9615
|
return trail && trail.length > 0 ? Buffer2.concat([res, trail]) : res;
|
|
9616
9616
|
};
|
|
9617
|
-
|
|
9617
|
+
module.exports.decode = function decode(buf, encoding2, options) {
|
|
9618
9618
|
if (typeof buf === "string") {
|
|
9619
|
-
if (!
|
|
9619
|
+
if (!module.exports.skipDecodeWarning) {
|
|
9620
9620
|
console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding");
|
|
9621
|
-
|
|
9621
|
+
module.exports.skipDecodeWarning = true;
|
|
9622
9622
|
}
|
|
9623
9623
|
buf = Buffer2.from("" + (buf || ""), "binary");
|
|
9624
9624
|
}
|
|
9625
|
-
var decoder =
|
|
9625
|
+
var decoder = module.exports.getDecoder(encoding2, options);
|
|
9626
9626
|
var res = decoder.write(buf);
|
|
9627
9627
|
var trail = decoder.end();
|
|
9628
9628
|
return trail ? res + trail : res;
|
|
9629
9629
|
};
|
|
9630
|
-
|
|
9630
|
+
module.exports.encodingExists = function encodingExists(enc) {
|
|
9631
9631
|
try {
|
|
9632
|
-
|
|
9632
|
+
module.exports.getCodec(enc);
|
|
9633
9633
|
return true;
|
|
9634
9634
|
} catch (e) {
|
|
9635
9635
|
return false;
|
|
9636
9636
|
}
|
|
9637
9637
|
};
|
|
9638
|
-
|
|
9639
|
-
|
|
9640
|
-
|
|
9641
|
-
|
|
9642
|
-
if (!
|
|
9638
|
+
module.exports.toEncoding = module.exports.encode;
|
|
9639
|
+
module.exports.fromEncoding = module.exports.decode;
|
|
9640
|
+
module.exports._codecDataCache = { __proto__: null };
|
|
9641
|
+
module.exports.getCodec = function getCodec(encoding2) {
|
|
9642
|
+
if (!module.exports.encodings) {
|
|
9643
9643
|
var raw = requireEncodings();
|
|
9644
|
-
|
|
9645
|
-
mergeModules(
|
|
9644
|
+
module.exports.encodings = { __proto__: null };
|
|
9645
|
+
mergeModules(module.exports.encodings, raw);
|
|
9646
9646
|
}
|
|
9647
|
-
var enc =
|
|
9647
|
+
var enc = module.exports._canonicalizeEncoding(encoding2);
|
|
9648
9648
|
var codecOptions = {};
|
|
9649
9649
|
while (true) {
|
|
9650
|
-
var codec =
|
|
9650
|
+
var codec = module.exports._codecDataCache[enc];
|
|
9651
9651
|
if (codec) {
|
|
9652
9652
|
return codec;
|
|
9653
9653
|
}
|
|
9654
|
-
var codecDef =
|
|
9654
|
+
var codecDef = module.exports.encodings[enc];
|
|
9655
9655
|
switch (typeof codecDef) {
|
|
9656
9656
|
case "string":
|
|
9657
9657
|
enc = codecDef;
|
|
@@ -9669,47 +9669,47 @@ function requireLib$1() {
|
|
|
9669
9669
|
if (!codecOptions.encodingName) {
|
|
9670
9670
|
codecOptions.encodingName = enc;
|
|
9671
9671
|
}
|
|
9672
|
-
codec = new codecDef(codecOptions,
|
|
9673
|
-
|
|
9672
|
+
codec = new codecDef(codecOptions, module.exports);
|
|
9673
|
+
module.exports._codecDataCache[codecOptions.encodingName] = codec;
|
|
9674
9674
|
return codec;
|
|
9675
9675
|
default:
|
|
9676
9676
|
throw new Error("Encoding not recognized: '" + encoding2 + "' (searched as: '" + enc + "')");
|
|
9677
9677
|
}
|
|
9678
9678
|
}
|
|
9679
9679
|
};
|
|
9680
|
-
|
|
9680
|
+
module.exports._canonicalizeEncoding = function(encoding2) {
|
|
9681
9681
|
return ("" + encoding2).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, "");
|
|
9682
9682
|
};
|
|
9683
|
-
|
|
9684
|
-
var codec =
|
|
9683
|
+
module.exports.getEncoder = function getEncoder(encoding2, options) {
|
|
9684
|
+
var codec = module.exports.getCodec(encoding2);
|
|
9685
9685
|
var encoder = new codec.encoder(options, codec);
|
|
9686
9686
|
if (codec.bomAware && options && options.addBOM) {
|
|
9687
9687
|
encoder = new bomHandling2.PrependBOM(encoder, options);
|
|
9688
9688
|
}
|
|
9689
9689
|
return encoder;
|
|
9690
9690
|
};
|
|
9691
|
-
|
|
9692
|
-
var codec =
|
|
9691
|
+
module.exports.getDecoder = function getDecoder(encoding2, options) {
|
|
9692
|
+
var codec = module.exports.getCodec(encoding2);
|
|
9693
9693
|
var decoder = new codec.decoder(options, codec);
|
|
9694
9694
|
if (codec.bomAware && !(options && options.stripBOM === false)) {
|
|
9695
9695
|
decoder = new bomHandling2.StripBOM(decoder, options);
|
|
9696
9696
|
}
|
|
9697
9697
|
return decoder;
|
|
9698
9698
|
};
|
|
9699
|
-
|
|
9700
|
-
if (
|
|
9699
|
+
module.exports.enableStreamingAPI = function enableStreamingAPI(streamModule2) {
|
|
9700
|
+
if (module.exports.supportsStreams) {
|
|
9701
9701
|
return;
|
|
9702
9702
|
}
|
|
9703
9703
|
var streams2 = requireStreams()(streamModule2);
|
|
9704
|
-
|
|
9705
|
-
|
|
9706
|
-
|
|
9707
|
-
return new
|
|
9704
|
+
module.exports.IconvLiteEncoderStream = streams2.IconvLiteEncoderStream;
|
|
9705
|
+
module.exports.IconvLiteDecoderStream = streams2.IconvLiteDecoderStream;
|
|
9706
|
+
module.exports.encodeStream = function encodeStream(encoding2, options) {
|
|
9707
|
+
return new module.exports.IconvLiteEncoderStream(module.exports.getEncoder(encoding2, options), options);
|
|
9708
9708
|
};
|
|
9709
|
-
|
|
9710
|
-
return new
|
|
9709
|
+
module.exports.decodeStream = function decodeStream(encoding2, options) {
|
|
9710
|
+
return new module.exports.IconvLiteDecoderStream(module.exports.getDecoder(encoding2, options), options);
|
|
9711
9711
|
};
|
|
9712
|
-
|
|
9712
|
+
module.exports.supportsStreams = true;
|
|
9713
9713
|
};
|
|
9714
9714
|
var streamModule;
|
|
9715
9715
|
try {
|
|
@@ -9717,9 +9717,9 @@ function requireLib$1() {
|
|
|
9717
9717
|
} catch (e) {
|
|
9718
9718
|
}
|
|
9719
9719
|
if (streamModule && streamModule.Transform) {
|
|
9720
|
-
|
|
9720
|
+
module.exports.enableStreamingAPI(streamModule);
|
|
9721
9721
|
} else {
|
|
9722
|
-
|
|
9722
|
+
module.exports.encodeStream = module.exports.decodeStream = function() {
|
|
9723
9723
|
throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.");
|
|
9724
9724
|
};
|
|
9725
9725
|
}
|
|
@@ -13325,10 +13325,7 @@ function requireJson() {
|
|
|
13325
13325
|
var index = str.indexOf(char);
|
|
13326
13326
|
var partial = "";
|
|
13327
13327
|
if (index !== -1) {
|
|
13328
|
-
partial = str.substring(0, index) + JSON_SYNTAX_CHAR;
|
|
13329
|
-
for (var i = index + 1; i < str.length; i++) {
|
|
13330
|
-
partial += JSON_SYNTAX_CHAR;
|
|
13331
|
-
}
|
|
13328
|
+
partial = str.substring(0, index) + JSON_SYNTAX_CHAR.repeat(str.length - index);
|
|
13332
13329
|
}
|
|
13333
13330
|
try {
|
|
13334
13331
|
JSON.parse(partial);
|
|
@@ -15056,8 +15053,23 @@ function requireUtils$1() {
|
|
|
15056
15053
|
if (hasRequiredUtils$1) return utils$1;
|
|
15057
15054
|
hasRequiredUtils$1 = 1;
|
|
15058
15055
|
var formats2 = /* @__PURE__ */ requireFormats();
|
|
15056
|
+
var getSideChannel = requireSideChannel();
|
|
15059
15057
|
var has = Object.prototype.hasOwnProperty;
|
|
15060
15058
|
var isArray = Array.isArray;
|
|
15059
|
+
var overflowChannel = getSideChannel();
|
|
15060
|
+
var markOverflow = function markOverflow2(obj, maxIndex) {
|
|
15061
|
+
overflowChannel.set(obj, maxIndex);
|
|
15062
|
+
return obj;
|
|
15063
|
+
};
|
|
15064
|
+
var isOverflow = function isOverflow2(obj) {
|
|
15065
|
+
return overflowChannel.has(obj);
|
|
15066
|
+
};
|
|
15067
|
+
var getMaxIndex = function getMaxIndex2(obj) {
|
|
15068
|
+
return overflowChannel.get(obj);
|
|
15069
|
+
};
|
|
15070
|
+
var setMaxIndex = function setMaxIndex2(obj, maxIndex) {
|
|
15071
|
+
overflowChannel.set(obj, maxIndex);
|
|
15072
|
+
};
|
|
15061
15073
|
var hexTable = (function() {
|
|
15062
15074
|
var array = [];
|
|
15063
15075
|
for (var i = 0; i < 256; ++i) {
|
|
@@ -15097,7 +15109,11 @@ function requireUtils$1() {
|
|
|
15097
15109
|
if (isArray(target)) {
|
|
15098
15110
|
target.push(source);
|
|
15099
15111
|
} else if (target && typeof target === "object") {
|
|
15100
|
-
if (
|
|
15112
|
+
if (isOverflow(target)) {
|
|
15113
|
+
var newIndex = getMaxIndex(target) + 1;
|
|
15114
|
+
target[newIndex] = source;
|
|
15115
|
+
setMaxIndex(target, newIndex);
|
|
15116
|
+
} else if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) {
|
|
15101
15117
|
target[source] = true;
|
|
15102
15118
|
}
|
|
15103
15119
|
} else {
|
|
@@ -15106,6 +15122,15 @@ function requireUtils$1() {
|
|
|
15106
15122
|
return target;
|
|
15107
15123
|
}
|
|
15108
15124
|
if (!target || typeof target !== "object") {
|
|
15125
|
+
if (isOverflow(source)) {
|
|
15126
|
+
var sourceKeys = Object.keys(source);
|
|
15127
|
+
var result = options && options.plainObjects ? { __proto__: null, 0: target } : { 0: target };
|
|
15128
|
+
for (var m = 0; m < sourceKeys.length; m++) {
|
|
15129
|
+
var oldKey = parseInt(sourceKeys[m], 10);
|
|
15130
|
+
result[oldKey + 1] = source[sourceKeys[m]];
|
|
15131
|
+
}
|
|
15132
|
+
return markOverflow(result, getMaxIndex(source) + 1);
|
|
15133
|
+
}
|
|
15109
15134
|
return [target].concat(source);
|
|
15110
15135
|
}
|
|
15111
15136
|
var mergeTarget = target;
|
|
@@ -15228,8 +15253,18 @@ function requireUtils$1() {
|
|
|
15228
15253
|
}
|
|
15229
15254
|
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
|
15230
15255
|
};
|
|
15231
|
-
var combine = function combine2(a, b) {
|
|
15232
|
-
|
|
15256
|
+
var combine = function combine2(a, b, arrayLimit, plainObjects) {
|
|
15257
|
+
if (isOverflow(a)) {
|
|
15258
|
+
var newIndex = getMaxIndex(a) + 1;
|
|
15259
|
+
a[newIndex] = b;
|
|
15260
|
+
setMaxIndex(a, newIndex);
|
|
15261
|
+
return a;
|
|
15262
|
+
}
|
|
15263
|
+
var result = [].concat(a, b);
|
|
15264
|
+
if (result.length > arrayLimit) {
|
|
15265
|
+
return markOverflow(arrayToObject(result, { plainObjects }), result.length - 1);
|
|
15266
|
+
}
|
|
15267
|
+
return result;
|
|
15233
15268
|
};
|
|
15234
15269
|
var maybeMap = function maybeMap2(val, fn) {
|
|
15235
15270
|
if (isArray(val)) {
|
|
@@ -15249,6 +15284,7 @@ function requireUtils$1() {
|
|
|
15249
15284
|
decode,
|
|
15250
15285
|
encode,
|
|
15251
15286
|
isBuffer,
|
|
15287
|
+
isOverflow,
|
|
15252
15288
|
isRegExp,
|
|
15253
15289
|
maybeMap,
|
|
15254
15290
|
merge
|
|
@@ -15627,16 +15663,18 @@ function requireParse() {
|
|
|
15627
15663
|
val = options.strictNullHandling ? null : "";
|
|
15628
15664
|
} else {
|
|
15629
15665
|
key = options.decoder(part.slice(0, pos), defaults.decoder, charset2, "key");
|
|
15630
|
-
|
|
15631
|
-
|
|
15632
|
-
|
|
15633
|
-
|
|
15634
|
-
|
|
15635
|
-
|
|
15636
|
-
|
|
15637
|
-
|
|
15638
|
-
|
|
15639
|
-
|
|
15666
|
+
if (key !== null) {
|
|
15667
|
+
val = utils2.maybeMap(
|
|
15668
|
+
parseArrayValue(
|
|
15669
|
+
part.slice(pos + 1),
|
|
15670
|
+
options,
|
|
15671
|
+
isArray(obj[key]) ? obj[key].length : 0
|
|
15672
|
+
),
|
|
15673
|
+
function(encodedVal) {
|
|
15674
|
+
return options.decoder(encodedVal, defaults.decoder, charset2, "value");
|
|
15675
|
+
}
|
|
15676
|
+
);
|
|
15677
|
+
}
|
|
15640
15678
|
}
|
|
15641
15679
|
if (val && options.interpretNumericEntities && charset2 === "iso-8859-1") {
|
|
15642
15680
|
val = interpretNumericEntities(String(val));
|
|
@@ -15644,11 +15682,18 @@ function requireParse() {
|
|
|
15644
15682
|
if (part.indexOf("[]=") > -1) {
|
|
15645
15683
|
val = isArray(val) ? [val] : val;
|
|
15646
15684
|
}
|
|
15647
|
-
|
|
15648
|
-
|
|
15649
|
-
|
|
15650
|
-
|
|
15651
|
-
|
|
15685
|
+
if (key !== null) {
|
|
15686
|
+
var existing = has.call(obj, key);
|
|
15687
|
+
if (existing && options.duplicates === "combine") {
|
|
15688
|
+
obj[key] = utils2.combine(
|
|
15689
|
+
obj[key],
|
|
15690
|
+
val,
|
|
15691
|
+
options.arrayLimit,
|
|
15692
|
+
options.plainObjects
|
|
15693
|
+
);
|
|
15694
|
+
} else if (!existing || options.duplicates === "last") {
|
|
15695
|
+
obj[key] = val;
|
|
15696
|
+
}
|
|
15652
15697
|
}
|
|
15653
15698
|
}
|
|
15654
15699
|
return obj;
|
|
@@ -15664,7 +15709,16 @@ function requireParse() {
|
|
|
15664
15709
|
var obj;
|
|
15665
15710
|
var root = chain[i];
|
|
15666
15711
|
if (root === "[]" && options.parseArrays) {
|
|
15667
|
-
|
|
15712
|
+
if (utils2.isOverflow(leaf)) {
|
|
15713
|
+
obj = leaf;
|
|
15714
|
+
} else {
|
|
15715
|
+
obj = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : utils2.combine(
|
|
15716
|
+
[],
|
|
15717
|
+
leaf,
|
|
15718
|
+
options.arrayLimit,
|
|
15719
|
+
options.plainObjects
|
|
15720
|
+
);
|
|
15721
|
+
}
|
|
15668
15722
|
} else {
|
|
15669
15723
|
obj = options.plainObjects ? { __proto__: null } : {};
|
|
15670
15724
|
var cleanRoot = root.charAt(0) === "[" && root.charAt(root.length - 1) === "]" ? root.slice(1, -1) : root;
|
|
@@ -15683,14 +15737,19 @@ function requireParse() {
|
|
|
15683
15737
|
}
|
|
15684
15738
|
return leaf;
|
|
15685
15739
|
};
|
|
15686
|
-
var
|
|
15687
|
-
if (!givenKey) {
|
|
15688
|
-
return;
|
|
15689
|
-
}
|
|
15740
|
+
var splitKeyIntoSegments = function splitKeyIntoSegments2(givenKey, options) {
|
|
15690
15741
|
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey;
|
|
15742
|
+
if (options.depth <= 0) {
|
|
15743
|
+
if (!options.plainObjects && has.call(Object.prototype, key)) {
|
|
15744
|
+
if (!options.allowPrototypes) {
|
|
15745
|
+
return;
|
|
15746
|
+
}
|
|
15747
|
+
}
|
|
15748
|
+
return [key];
|
|
15749
|
+
}
|
|
15691
15750
|
var brackets = /(\[[^[\]]*])/;
|
|
15692
15751
|
var child = /(\[[^[\]]*])/g;
|
|
15693
|
-
var segment =
|
|
15752
|
+
var segment = brackets.exec(key);
|
|
15694
15753
|
var parent = segment ? key.slice(0, segment.index) : key;
|
|
15695
15754
|
var keys = [];
|
|
15696
15755
|
if (parent) {
|
|
@@ -15702,9 +15761,10 @@ function requireParse() {
|
|
|
15702
15761
|
keys.push(parent);
|
|
15703
15762
|
}
|
|
15704
15763
|
var i = 0;
|
|
15705
|
-
while (
|
|
15764
|
+
while ((segment = child.exec(key)) !== null && i < options.depth) {
|
|
15706
15765
|
i += 1;
|
|
15707
|
-
|
|
15766
|
+
var segmentContent = segment[1].slice(1, -1);
|
|
15767
|
+
if (!options.plainObjects && has.call(Object.prototype, segmentContent)) {
|
|
15708
15768
|
if (!options.allowPrototypes) {
|
|
15709
15769
|
return;
|
|
15710
15770
|
}
|
|
@@ -15717,6 +15777,16 @@ function requireParse() {
|
|
|
15717
15777
|
}
|
|
15718
15778
|
keys.push("[" + key.slice(segment.index) + "]");
|
|
15719
15779
|
}
|
|
15780
|
+
return keys;
|
|
15781
|
+
};
|
|
15782
|
+
var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
|
|
15783
|
+
if (!givenKey) {
|
|
15784
|
+
return;
|
|
15785
|
+
}
|
|
15786
|
+
var keys = splitKeyIntoSegments(givenKey, options);
|
|
15787
|
+
if (!keys) {
|
|
15788
|
+
return;
|
|
15789
|
+
}
|
|
15720
15790
|
return parseObject(keys, val, options, valuesParsed);
|
|
15721
15791
|
};
|
|
15722
15792
|
var normalizeParseOptions = function normalizeParseOptions2(opts) {
|
|
@@ -15856,7 +15926,7 @@ function requireUrlencoded() {
|
|
|
15856
15926
|
type: "parameters.too.many"
|
|
15857
15927
|
});
|
|
15858
15928
|
}
|
|
15859
|
-
var arrayLimit = extended ? Math.max(100, paramCount) :
|
|
15929
|
+
var arrayLimit = extended ? Math.max(100, paramCount) : paramCount;
|
|
15860
15930
|
debug("parse " + (extended ? "extended " : "") + "urlencoding");
|
|
15861
15931
|
try {
|
|
15862
15932
|
return qs.parse(body, {
|