protobufjs 7.5.7 → 7.5.9
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/light/protobuf.js +221 -163
- package/dist/light/protobuf.js.map +1 -1
- package/dist/light/protobuf.min.js +3 -3
- package/dist/light/protobuf.min.js.map +1 -1
- package/dist/minimal/protobuf.js +14 -5
- package/dist/minimal/protobuf.js.map +1 -1
- package/dist/minimal/protobuf.min.js +3 -3
- package/dist/minimal/protobuf.min.js.map +1 -1
- package/dist/protobuf.js +276 -213
- package/dist/protobuf.js.map +1 -1
- package/dist/protobuf.min.js +3 -3
- package/dist/protobuf.min.js.map +1 -1
- package/index.d.ts +18 -5
- package/package.json +6 -3
- package/src/namespace.js +8 -4
- package/src/parse.js +35 -30
- package/src/root.js +4 -2
- package/src/service.js +4 -2
- package/src/type.js +4 -2
- package/src/util/fs.js +11 -0
- package/src/util/minimal.js +10 -2
- package/src/util.js +15 -1
package/dist/protobuf.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* protobuf.js v7.5.
|
|
3
|
-
* compiled
|
|
2
|
+
* protobuf.js v7.5.9 (c) 2016, daniel wirtz
|
|
3
|
+
* compiled sun, 17 may 2026 16:51:59 utc
|
|
4
4
|
* licensed under the bsd-3-clause license
|
|
5
5
|
* see: https://github.com/dcodeio/protobuf.js for details
|
|
6
6
|
*/
|
|
@@ -429,9 +429,7 @@ EventEmitter.prototype.emit = function emit(evt) {
|
|
|
429
429
|
module.exports = fetch;
|
|
430
430
|
|
|
431
431
|
var asPromise = require(1),
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
var fs = inquire("fs");
|
|
432
|
+
fs = require(6);
|
|
435
433
|
|
|
436
434
|
/**
|
|
437
435
|
* Node-style callback as used by {@link util.fetch}.
|
|
@@ -444,8 +442,7 @@ var fs = inquire("fs");
|
|
|
444
442
|
|
|
445
443
|
/**
|
|
446
444
|
* Options as used by {@link util.fetch}.
|
|
447
|
-
* @
|
|
448
|
-
* @type {Object}
|
|
445
|
+
* @interface IFetchOptions
|
|
449
446
|
* @property {boolean} [binary=false] Whether expecting a binary response
|
|
450
447
|
* @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest
|
|
451
448
|
*/
|
|
@@ -454,7 +451,7 @@ var fs = inquire("fs");
|
|
|
454
451
|
* Fetches the contents of a file.
|
|
455
452
|
* @memberof util
|
|
456
453
|
* @param {string} filename File path or url
|
|
457
|
-
* @param {
|
|
454
|
+
* @param {IFetchOptions} options Fetch options
|
|
458
455
|
* @param {FetchCallback} callback Callback function
|
|
459
456
|
* @returns {undefined}
|
|
460
457
|
*/
|
|
@@ -497,7 +494,7 @@ function fetch(filename, options, callback) {
|
|
|
497
494
|
* @name util.fetch
|
|
498
495
|
* @function
|
|
499
496
|
* @param {string} path File path or url
|
|
500
|
-
* @param {
|
|
497
|
+
* @param {IFetchOptions} [options] Fetch options
|
|
501
498
|
* @returns {Promise<string|Uint8Array>} Promise
|
|
502
499
|
* @variation 3
|
|
503
500
|
*/
|
|
@@ -541,7 +538,20 @@ fetch.xhr = function fetch_xhr(filename, options, callback) {
|
|
|
541
538
|
xhr.send();
|
|
542
539
|
};
|
|
543
540
|
|
|
544
|
-
},{"1":1,"
|
|
541
|
+
},{"1":1,"6":6}],6:[function(require,module,exports){
|
|
542
|
+
"use strict";
|
|
543
|
+
|
|
544
|
+
var fs = null;
|
|
545
|
+
try {
|
|
546
|
+
fs = require(12);
|
|
547
|
+
if (!fs || !fs.readFile || !fs.readFileSync)
|
|
548
|
+
fs = null;
|
|
549
|
+
} catch (e) {
|
|
550
|
+
// `fs` is unavailable in browsers and browser-like bundles.
|
|
551
|
+
}
|
|
552
|
+
module.exports = fs;
|
|
553
|
+
|
|
554
|
+
},{"12":12}],7:[function(require,module,exports){
|
|
545
555
|
"use strict";
|
|
546
556
|
|
|
547
557
|
module.exports = factory(factory);
|
|
@@ -878,7 +888,7 @@ function readUintBE(buf, pos) {
|
|
|
878
888
|
| buf[pos + 3]) >>> 0;
|
|
879
889
|
}
|
|
880
890
|
|
|
881
|
-
},{}],
|
|
891
|
+
},{}],8:[function(require,module,exports){
|
|
882
892
|
"use strict";
|
|
883
893
|
module.exports = inquire;
|
|
884
894
|
|
|
@@ -887,6 +897,7 @@ module.exports = inquire;
|
|
|
887
897
|
* @memberof util
|
|
888
898
|
* @param {string} moduleName Module to require
|
|
889
899
|
* @returns {?Object} Required module if available and not empty, otherwise `null`
|
|
900
|
+
* @deprecated Legacy optional require helper. Will be removed in a future release.
|
|
890
901
|
*/
|
|
891
902
|
function inquire(moduleName) {
|
|
892
903
|
try {
|
|
@@ -917,7 +928,7 @@ var r = require.__self;
|
|
|
917
928
|
delete Function.prototype.__self;
|
|
918
929
|
*/
|
|
919
930
|
|
|
920
|
-
},{}],
|
|
931
|
+
},{}],9:[function(require,module,exports){
|
|
921
932
|
"use strict";
|
|
922
933
|
|
|
923
934
|
/**
|
|
@@ -984,7 +995,7 @@ path.resolve = function resolve(originPath, includePath, alreadyNormalized) {
|
|
|
984
995
|
return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath;
|
|
985
996
|
};
|
|
986
997
|
|
|
987
|
-
},{}],
|
|
998
|
+
},{}],10:[function(require,module,exports){
|
|
988
999
|
"use strict";
|
|
989
1000
|
module.exports = pool;
|
|
990
1001
|
|
|
@@ -1034,7 +1045,7 @@ function pool(alloc, slice, size) {
|
|
|
1034
1045
|
};
|
|
1035
1046
|
}
|
|
1036
1047
|
|
|
1037
|
-
},{}],
|
|
1048
|
+
},{}],11:[function(require,module,exports){
|
|
1038
1049
|
"use strict";
|
|
1039
1050
|
|
|
1040
1051
|
/**
|
|
@@ -1140,7 +1151,9 @@ utf8.write = function utf8_write(string, buffer, offset) {
|
|
|
1140
1151
|
return offset - start;
|
|
1141
1152
|
};
|
|
1142
1153
|
|
|
1143
|
-
},{}],
|
|
1154
|
+
},{}],12:[function(require,module,exports){
|
|
1155
|
+
|
|
1156
|
+
},{}],13:[function(require,module,exports){
|
|
1144
1157
|
"use strict";
|
|
1145
1158
|
module.exports = common;
|
|
1146
1159
|
|
|
@@ -1541,7 +1554,7 @@ common.get = function get(file) {
|
|
|
1541
1554
|
return common[file] || null;
|
|
1542
1555
|
};
|
|
1543
1556
|
|
|
1544
|
-
},{}],
|
|
1557
|
+
},{}],14:[function(require,module,exports){
|
|
1545
1558
|
"use strict";
|
|
1546
1559
|
/**
|
|
1547
1560
|
* Runtime message from/to plain object converters.
|
|
@@ -1549,8 +1562,8 @@ common.get = function get(file) {
|
|
|
1549
1562
|
*/
|
|
1550
1563
|
var converter = exports;
|
|
1551
1564
|
|
|
1552
|
-
var Enum = require(
|
|
1553
|
-
util = require(
|
|
1565
|
+
var Enum = require(17),
|
|
1566
|
+
util = require(39);
|
|
1554
1567
|
|
|
1555
1568
|
/**
|
|
1556
1569
|
* Generates a partial value fromObject conveter.
|
|
@@ -1853,13 +1866,13 @@ converter.toObject = function toObject(mtype) {
|
|
|
1853
1866
|
/* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */
|
|
1854
1867
|
};
|
|
1855
1868
|
|
|
1856
|
-
},{"
|
|
1869
|
+
},{"17":17,"39":39}],15:[function(require,module,exports){
|
|
1857
1870
|
"use strict";
|
|
1858
1871
|
module.exports = decoder;
|
|
1859
1872
|
|
|
1860
|
-
var Enum = require(
|
|
1861
|
-
types = require(
|
|
1862
|
-
util = require(
|
|
1873
|
+
var Enum = require(17),
|
|
1874
|
+
types = require(38),
|
|
1875
|
+
util = require(39);
|
|
1863
1876
|
|
|
1864
1877
|
function missing(field) {
|
|
1865
1878
|
return "missing required '" + field.name + "'";
|
|
@@ -1990,13 +2003,13 @@ function decoder(mtype) {
|
|
|
1990
2003
|
/* eslint-enable no-unexpected-multiline */
|
|
1991
2004
|
}
|
|
1992
2005
|
|
|
1993
|
-
},{"
|
|
2006
|
+
},{"17":17,"38":38,"39":39}],16:[function(require,module,exports){
|
|
1994
2007
|
"use strict";
|
|
1995
2008
|
module.exports = encoder;
|
|
1996
2009
|
|
|
1997
|
-
var Enum = require(
|
|
1998
|
-
types = require(
|
|
1999
|
-
util = require(
|
|
2010
|
+
var Enum = require(17),
|
|
2011
|
+
types = require(38),
|
|
2012
|
+
util = require(39);
|
|
2000
2013
|
|
|
2001
2014
|
/**
|
|
2002
2015
|
* Generates a partial message type encoder.
|
|
@@ -2092,16 +2105,16 @@ function encoder(mtype) {
|
|
|
2092
2105
|
/* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */
|
|
2093
2106
|
}
|
|
2094
2107
|
|
|
2095
|
-
},{"
|
|
2108
|
+
},{"17":17,"38":38,"39":39}],17:[function(require,module,exports){
|
|
2096
2109
|
"use strict";
|
|
2097
2110
|
module.exports = Enum;
|
|
2098
2111
|
|
|
2099
2112
|
// extends ReflectionObject
|
|
2100
|
-
var ReflectionObject = require(
|
|
2113
|
+
var ReflectionObject = require(26);
|
|
2101
2114
|
((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = "Enum";
|
|
2102
2115
|
|
|
2103
|
-
var Namespace = require(
|
|
2104
|
-
util = require(
|
|
2116
|
+
var Namespace = require(25),
|
|
2117
|
+
util = require(39);
|
|
2105
2118
|
|
|
2106
2119
|
/**
|
|
2107
2120
|
* Constructs a new enum instance.
|
|
@@ -2320,17 +2333,17 @@ Enum.prototype.isReservedName = function isReservedName(name) {
|
|
|
2320
2333
|
return Namespace.isReservedName(this.reserved, name);
|
|
2321
2334
|
};
|
|
2322
2335
|
|
|
2323
|
-
},{"
|
|
2336
|
+
},{"25":25,"26":26,"39":39}],18:[function(require,module,exports){
|
|
2324
2337
|
"use strict";
|
|
2325
2338
|
module.exports = Field;
|
|
2326
2339
|
|
|
2327
2340
|
// extends ReflectionObject
|
|
2328
|
-
var ReflectionObject = require(
|
|
2341
|
+
var ReflectionObject = require(26);
|
|
2329
2342
|
((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = "Field";
|
|
2330
2343
|
|
|
2331
|
-
var Enum = require(
|
|
2332
|
-
types = require(
|
|
2333
|
-
util = require(
|
|
2344
|
+
var Enum = require(17),
|
|
2345
|
+
types = require(38),
|
|
2346
|
+
util = require(39);
|
|
2334
2347
|
|
|
2335
2348
|
var Type; // cyclic
|
|
2336
2349
|
|
|
@@ -2775,9 +2788,9 @@ Field._configure = function configure(Type_) {
|
|
|
2775
2788
|
Type = Type_;
|
|
2776
2789
|
};
|
|
2777
2790
|
|
|
2778
|
-
},{"
|
|
2791
|
+
},{"17":17,"26":26,"38":38,"39":39}],19:[function(require,module,exports){
|
|
2779
2792
|
"use strict";
|
|
2780
|
-
var protobuf = module.exports = require(
|
|
2793
|
+
var protobuf = module.exports = require(20);
|
|
2781
2794
|
|
|
2782
2795
|
protobuf.build = "light";
|
|
2783
2796
|
|
|
@@ -2850,30 +2863,30 @@ function loadSync(filename, root) {
|
|
|
2850
2863
|
protobuf.loadSync = loadSync;
|
|
2851
2864
|
|
|
2852
2865
|
// Serialization
|
|
2853
|
-
protobuf.encoder = require(
|
|
2854
|
-
protobuf.decoder = require(
|
|
2855
|
-
protobuf.verifier = require(
|
|
2856
|
-
protobuf.converter = require(
|
|
2866
|
+
protobuf.encoder = require(16);
|
|
2867
|
+
protobuf.decoder = require(15);
|
|
2868
|
+
protobuf.verifier = require(44);
|
|
2869
|
+
protobuf.converter = require(14);
|
|
2857
2870
|
|
|
2858
2871
|
// Reflection
|
|
2859
|
-
protobuf.ReflectionObject = require(
|
|
2860
|
-
protobuf.Namespace = require(
|
|
2861
|
-
protobuf.Root = require(
|
|
2862
|
-
protobuf.Enum = require(
|
|
2863
|
-
protobuf.Type = require(
|
|
2864
|
-
protobuf.Field = require(
|
|
2865
|
-
protobuf.OneOf = require(
|
|
2866
|
-
protobuf.MapField = require(
|
|
2867
|
-
protobuf.Service = require(
|
|
2868
|
-
protobuf.Method = require(
|
|
2872
|
+
protobuf.ReflectionObject = require(26);
|
|
2873
|
+
protobuf.Namespace = require(25);
|
|
2874
|
+
protobuf.Root = require(31);
|
|
2875
|
+
protobuf.Enum = require(17);
|
|
2876
|
+
protobuf.Type = require(37);
|
|
2877
|
+
protobuf.Field = require(18);
|
|
2878
|
+
protobuf.OneOf = require(27);
|
|
2879
|
+
protobuf.MapField = require(22);
|
|
2880
|
+
protobuf.Service = require(35);
|
|
2881
|
+
protobuf.Method = require(24);
|
|
2869
2882
|
|
|
2870
2883
|
// Runtime
|
|
2871
|
-
protobuf.Message = require(
|
|
2872
|
-
protobuf.wrappers = require(
|
|
2884
|
+
protobuf.Message = require(23);
|
|
2885
|
+
protobuf.wrappers = require(45);
|
|
2873
2886
|
|
|
2874
2887
|
// Utility
|
|
2875
|
-
protobuf.types = require(
|
|
2876
|
-
protobuf.util = require(
|
|
2888
|
+
protobuf.types = require(38);
|
|
2889
|
+
protobuf.util = require(39);
|
|
2877
2890
|
|
|
2878
2891
|
// Set up possibly cyclic reflection dependencies
|
|
2879
2892
|
protobuf.ReflectionObject._configure(protobuf.Root);
|
|
@@ -2881,7 +2894,7 @@ protobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum);
|
|
|
2881
2894
|
protobuf.Root._configure(protobuf.Type);
|
|
2882
2895
|
protobuf.Field._configure(protobuf.Type);
|
|
2883
2896
|
|
|
2884
|
-
},{"
|
|
2897
|
+
},{"14":14,"15":15,"16":16,"17":17,"18":18,"20":20,"22":22,"23":23,"24":24,"25":25,"26":26,"27":27,"31":31,"35":35,"37":37,"38":38,"39":39,"44":44,"45":45}],20:[function(require,module,exports){
|
|
2885
2898
|
"use strict";
|
|
2886
2899
|
var protobuf = exports;
|
|
2887
2900
|
|
|
@@ -2894,15 +2907,15 @@ var protobuf = exports;
|
|
|
2894
2907
|
protobuf.build = "minimal";
|
|
2895
2908
|
|
|
2896
2909
|
// Serialization
|
|
2897
|
-
protobuf.Writer = require(
|
|
2898
|
-
protobuf.BufferWriter = require(
|
|
2899
|
-
protobuf.Reader = require(
|
|
2900
|
-
protobuf.BufferReader = require(
|
|
2910
|
+
protobuf.Writer = require(46);
|
|
2911
|
+
protobuf.BufferWriter = require(47);
|
|
2912
|
+
protobuf.Reader = require(29);
|
|
2913
|
+
protobuf.BufferReader = require(30);
|
|
2901
2914
|
|
|
2902
2915
|
// Utility
|
|
2903
|
-
protobuf.util = require(
|
|
2904
|
-
protobuf.rpc = require(
|
|
2905
|
-
protobuf.roots = require(
|
|
2916
|
+
protobuf.util = require(42);
|
|
2917
|
+
protobuf.rpc = require(33);
|
|
2918
|
+
protobuf.roots = require(32);
|
|
2906
2919
|
protobuf.configure = configure;
|
|
2907
2920
|
|
|
2908
2921
|
/* istanbul ignore next */
|
|
@@ -2919,30 +2932,30 @@ function configure() {
|
|
|
2919
2932
|
// Set up buffer utility according to the environment
|
|
2920
2933
|
configure();
|
|
2921
2934
|
|
|
2922
|
-
},{"
|
|
2935
|
+
},{"29":29,"30":30,"32":32,"33":33,"42":42,"46":46,"47":47}],21:[function(require,module,exports){
|
|
2923
2936
|
"use strict";
|
|
2924
|
-
var protobuf = module.exports = require(
|
|
2937
|
+
var protobuf = module.exports = require(19);
|
|
2925
2938
|
|
|
2926
2939
|
protobuf.build = "full";
|
|
2927
2940
|
|
|
2928
2941
|
// Parser
|
|
2929
|
-
protobuf.tokenize = require(
|
|
2930
|
-
protobuf.parse = require(
|
|
2931
|
-
protobuf.common = require(
|
|
2942
|
+
protobuf.tokenize = require(36);
|
|
2943
|
+
protobuf.parse = require(28);
|
|
2944
|
+
protobuf.common = require(13);
|
|
2932
2945
|
|
|
2933
2946
|
// Configure parser
|
|
2934
2947
|
protobuf.Root._configure(protobuf.Type, protobuf.parse, protobuf.common);
|
|
2935
2948
|
|
|
2936
|
-
},{"
|
|
2949
|
+
},{"13":13,"19":19,"28":28,"36":36}],22:[function(require,module,exports){
|
|
2937
2950
|
"use strict";
|
|
2938
2951
|
module.exports = MapField;
|
|
2939
2952
|
|
|
2940
2953
|
// extends Field
|
|
2941
|
-
var Field = require(
|
|
2954
|
+
var Field = require(18);
|
|
2942
2955
|
((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = "MapField";
|
|
2943
2956
|
|
|
2944
|
-
var types = require(
|
|
2945
|
-
util = require(
|
|
2957
|
+
var types = require(38),
|
|
2958
|
+
util = require(39);
|
|
2946
2959
|
|
|
2947
2960
|
/**
|
|
2948
2961
|
* Constructs a new map field instance.
|
|
@@ -3061,11 +3074,11 @@ MapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) {
|
|
|
3061
3074
|
};
|
|
3062
3075
|
};
|
|
3063
3076
|
|
|
3064
|
-
},{"
|
|
3077
|
+
},{"18":18,"38":38,"39":39}],23:[function(require,module,exports){
|
|
3065
3078
|
"use strict";
|
|
3066
3079
|
module.exports = Message;
|
|
3067
3080
|
|
|
3068
|
-
var util = require(
|
|
3081
|
+
var util = require(42);
|
|
3069
3082
|
|
|
3070
3083
|
/**
|
|
3071
3084
|
* Constructs a new message instance.
|
|
@@ -3206,15 +3219,15 @@ Message.prototype.toJSON = function toJSON() {
|
|
|
3206
3219
|
|
|
3207
3220
|
/*eslint-enable valid-jsdoc*/
|
|
3208
3221
|
|
|
3209
|
-
},{"
|
|
3222
|
+
},{"42":42}],24:[function(require,module,exports){
|
|
3210
3223
|
"use strict";
|
|
3211
3224
|
module.exports = Method;
|
|
3212
3225
|
|
|
3213
3226
|
// extends ReflectionObject
|
|
3214
|
-
var ReflectionObject = require(
|
|
3227
|
+
var ReflectionObject = require(26);
|
|
3215
3228
|
((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = "Method";
|
|
3216
3229
|
|
|
3217
|
-
var util = require(
|
|
3230
|
+
var util = require(39);
|
|
3218
3231
|
|
|
3219
3232
|
/**
|
|
3220
3233
|
* Constructs a new service method instance.
|
|
@@ -3368,17 +3381,17 @@ Method.prototype.resolve = function resolve() {
|
|
|
3368
3381
|
return ReflectionObject.prototype.resolve.call(this);
|
|
3369
3382
|
};
|
|
3370
3383
|
|
|
3371
|
-
},{"
|
|
3384
|
+
},{"26":26,"39":39}],25:[function(require,module,exports){
|
|
3372
3385
|
"use strict";
|
|
3373
3386
|
module.exports = Namespace;
|
|
3374
3387
|
|
|
3375
3388
|
// extends ReflectionObject
|
|
3376
|
-
var ReflectionObject = require(
|
|
3389
|
+
var ReflectionObject = require(26);
|
|
3377
3390
|
((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = "Namespace";
|
|
3378
3391
|
|
|
3379
|
-
var Field = require(
|
|
3380
|
-
util = require(
|
|
3381
|
-
OneOf = require(
|
|
3392
|
+
var Field = require(18),
|
|
3393
|
+
util = require(39),
|
|
3394
|
+
OneOf = require(27);
|
|
3382
3395
|
|
|
3383
3396
|
var Type, // cyclic
|
|
3384
3397
|
Service,
|
|
@@ -3400,11 +3413,13 @@ var Type, // cyclic
|
|
|
3400
3413
|
* @function
|
|
3401
3414
|
* @param {string} name Namespace name
|
|
3402
3415
|
* @param {Object.<string,*>} json JSON object
|
|
3416
|
+
* @param {number} [depth] Current nesting depth, defaults to `0`
|
|
3403
3417
|
* @returns {Namespace} Created namespace
|
|
3404
3418
|
* @throws {TypeError} If arguments are invalid
|
|
3405
3419
|
*/
|
|
3406
|
-
Namespace.fromJSON = function fromJSON(name, json) {
|
|
3407
|
-
|
|
3420
|
+
Namespace.fromJSON = function fromJSON(name, json, depth) {
|
|
3421
|
+
depth = util.checkDepth(depth);
|
|
3422
|
+
return new Namespace(name, json.options).addJSON(json.nested, depth);
|
|
3408
3423
|
};
|
|
3409
3424
|
|
|
3410
3425
|
/**
|
|
@@ -3562,9 +3577,11 @@ Namespace.prototype.toJSON = function toJSON(toJSONOptions) {
|
|
|
3562
3577
|
/**
|
|
3563
3578
|
* Adds nested objects to this namespace from nested object descriptors.
|
|
3564
3579
|
* @param {Object.<string,AnyNestedObject>} nestedJson Any nested object descriptors
|
|
3580
|
+
* @param {number} [depth] Current nesting depth, defaults to `0`
|
|
3565
3581
|
* @returns {Namespace} `this`
|
|
3566
3582
|
*/
|
|
3567
|
-
Namespace.prototype.addJSON = function addJSON(nestedJson) {
|
|
3583
|
+
Namespace.prototype.addJSON = function addJSON(nestedJson, depth) {
|
|
3584
|
+
depth = util.checkDepth(depth);
|
|
3568
3585
|
var ns = this;
|
|
3569
3586
|
/* istanbul ignore else */
|
|
3570
3587
|
if (nestedJson) {
|
|
@@ -3579,7 +3596,7 @@ Namespace.prototype.addJSON = function addJSON(nestedJson) {
|
|
|
3579
3596
|
? Service.fromJSON
|
|
3580
3597
|
: nested.id !== undefined
|
|
3581
3598
|
? Field.fromJSON
|
|
3582
|
-
: Namespace.fromJSON )(names[i], nested)
|
|
3599
|
+
: Namespace.fromJSON )(names[i], nested, depth + 1)
|
|
3583
3600
|
);
|
|
3584
3601
|
}
|
|
3585
3602
|
}
|
|
@@ -3922,14 +3939,14 @@ Namespace._configure = function(Type_, Service_, Enum_) {
|
|
|
3922
3939
|
Enum = Enum_;
|
|
3923
3940
|
};
|
|
3924
3941
|
|
|
3925
|
-
},{"
|
|
3942
|
+
},{"18":18,"26":26,"27":27,"39":39}],26:[function(require,module,exports){
|
|
3926
3943
|
"use strict";
|
|
3927
3944
|
module.exports = ReflectionObject;
|
|
3928
3945
|
|
|
3929
3946
|
ReflectionObject.className = "ReflectionObject";
|
|
3930
3947
|
|
|
3931
|
-
const OneOf = require(
|
|
3932
|
-
var util = require(
|
|
3948
|
+
const OneOf = require(27);
|
|
3949
|
+
var util = require(39);
|
|
3933
3950
|
|
|
3934
3951
|
var Root; // cyclic
|
|
3935
3952
|
|
|
@@ -4306,16 +4323,16 @@ ReflectionObject._configure = function(Root_) {
|
|
|
4306
4323
|
Root = Root_;
|
|
4307
4324
|
};
|
|
4308
4325
|
|
|
4309
|
-
},{"
|
|
4326
|
+
},{"27":27,"39":39}],27:[function(require,module,exports){
|
|
4310
4327
|
"use strict";
|
|
4311
4328
|
module.exports = OneOf;
|
|
4312
4329
|
|
|
4313
4330
|
// extends ReflectionObject
|
|
4314
|
-
var ReflectionObject = require(
|
|
4331
|
+
var ReflectionObject = require(26);
|
|
4315
4332
|
((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = "OneOf";
|
|
4316
4333
|
|
|
4317
|
-
var Field = require(
|
|
4318
|
-
util = require(
|
|
4334
|
+
var Field = require(18),
|
|
4335
|
+
util = require(39);
|
|
4319
4336
|
|
|
4320
4337
|
/**
|
|
4321
4338
|
* Constructs a new oneof instance.
|
|
@@ -4530,25 +4547,25 @@ OneOf.d = function decorateOneOf() {
|
|
|
4530
4547
|
};
|
|
4531
4548
|
};
|
|
4532
4549
|
|
|
4533
|
-
},{"
|
|
4550
|
+
},{"18":18,"26":26,"39":39}],28:[function(require,module,exports){
|
|
4534
4551
|
"use strict";
|
|
4535
4552
|
module.exports = parse;
|
|
4536
4553
|
|
|
4537
4554
|
parse.filename = null;
|
|
4538
4555
|
parse.defaults = { keepCase: false };
|
|
4539
4556
|
|
|
4540
|
-
var tokenize = require(
|
|
4541
|
-
Root = require(
|
|
4542
|
-
Type = require(
|
|
4543
|
-
Field = require(
|
|
4544
|
-
MapField = require(
|
|
4545
|
-
OneOf = require(
|
|
4546
|
-
Enum = require(
|
|
4547
|
-
Service = require(
|
|
4548
|
-
Method = require(
|
|
4549
|
-
ReflectionObject = require(
|
|
4550
|
-
types = require(
|
|
4551
|
-
util = require(
|
|
4557
|
+
var tokenize = require(36),
|
|
4558
|
+
Root = require(31),
|
|
4559
|
+
Type = require(37),
|
|
4560
|
+
Field = require(18),
|
|
4561
|
+
MapField = require(22),
|
|
4562
|
+
OneOf = require(27),
|
|
4563
|
+
Enum = require(17),
|
|
4564
|
+
Service = require(35),
|
|
4565
|
+
Method = require(24),
|
|
4566
|
+
ReflectionObject = require(26),
|
|
4567
|
+
types = require(38),
|
|
4568
|
+
util = require(39);
|
|
4552
4569
|
|
|
4553
4570
|
var base10Re = /^[1-9][0-9]*$/,
|
|
4554
4571
|
base10NegRe = /^-?[1-9][0-9]*$/,
|
|
@@ -4834,7 +4851,8 @@ function parse(source, root, options) {
|
|
|
4834
4851
|
}
|
|
4835
4852
|
|
|
4836
4853
|
|
|
4837
|
-
function parseCommon(parent, token) {
|
|
4854
|
+
function parseCommon(parent, token, depth) {
|
|
4855
|
+
depth = util.checkDepth(depth);
|
|
4838
4856
|
switch (token) {
|
|
4839
4857
|
|
|
4840
4858
|
case "option":
|
|
@@ -4843,7 +4861,7 @@ function parse(source, root, options) {
|
|
|
4843
4861
|
return true;
|
|
4844
4862
|
|
|
4845
4863
|
case "message":
|
|
4846
|
-
parseType(parent, token);
|
|
4864
|
+
parseType(parent, token, depth + 1);
|
|
4847
4865
|
return true;
|
|
4848
4866
|
|
|
4849
4867
|
case "enum":
|
|
@@ -4851,11 +4869,11 @@ function parse(source, root, options) {
|
|
|
4851
4869
|
return true;
|
|
4852
4870
|
|
|
4853
4871
|
case "service":
|
|
4854
|
-
parseService(parent, token);
|
|
4872
|
+
parseService(parent, token, depth + 1);
|
|
4855
4873
|
return true;
|
|
4856
4874
|
|
|
4857
4875
|
case "extend":
|
|
4858
|
-
parseExtension(parent, token);
|
|
4876
|
+
parseExtension(parent, token, depth);
|
|
4859
4877
|
return true;
|
|
4860
4878
|
}
|
|
4861
4879
|
return false;
|
|
@@ -4883,7 +4901,8 @@ function parse(source, root, options) {
|
|
|
4883
4901
|
}
|
|
4884
4902
|
}
|
|
4885
4903
|
|
|
4886
|
-
function parseType(parent, token) {
|
|
4904
|
+
function parseType(parent, token, depth) {
|
|
4905
|
+
depth = util.checkDepth(depth);
|
|
4887
4906
|
|
|
4888
4907
|
/* istanbul ignore if */
|
|
4889
4908
|
if (!nameRe.test(token = next()))
|
|
@@ -4891,7 +4910,7 @@ function parse(source, root, options) {
|
|
|
4891
4910
|
|
|
4892
4911
|
var type = new Type(token);
|
|
4893
4912
|
ifBlock(type, function parseType_block(token) {
|
|
4894
|
-
if (parseCommon(type, token))
|
|
4913
|
+
if (parseCommon(type, token, depth))
|
|
4895
4914
|
return;
|
|
4896
4915
|
|
|
4897
4916
|
switch (token) {
|
|
@@ -4905,22 +4924,22 @@ function parse(source, root, options) {
|
|
|
4905
4924
|
throw illegal(token);
|
|
4906
4925
|
/* eslint-disable no-fallthrough */
|
|
4907
4926
|
case "repeated":
|
|
4908
|
-
parseField(type, token);
|
|
4927
|
+
parseField(type, token, undefined, depth + 1);
|
|
4909
4928
|
break;
|
|
4910
4929
|
|
|
4911
4930
|
case "optional":
|
|
4912
4931
|
/* istanbul ignore if */
|
|
4913
4932
|
if (edition === "proto3") {
|
|
4914
|
-
parseField(type, "proto3_optional");
|
|
4933
|
+
parseField(type, "proto3_optional", undefined, depth + 1);
|
|
4915
4934
|
} else if (edition !== "proto2") {
|
|
4916
4935
|
throw illegal(token);
|
|
4917
4936
|
} else {
|
|
4918
|
-
parseField(type, "optional");
|
|
4937
|
+
parseField(type, "optional", undefined, depth + 1);
|
|
4919
4938
|
}
|
|
4920
4939
|
break;
|
|
4921
4940
|
|
|
4922
4941
|
case "oneof":
|
|
4923
|
-
parseOneOf(type, token);
|
|
4942
|
+
parseOneOf(type, token, depth + 1);
|
|
4924
4943
|
break;
|
|
4925
4944
|
|
|
4926
4945
|
case "extensions":
|
|
@@ -4938,7 +4957,7 @@ function parse(source, root, options) {
|
|
|
4938
4957
|
}
|
|
4939
4958
|
|
|
4940
4959
|
push(token);
|
|
4941
|
-
parseField(type, "optional");
|
|
4960
|
+
parseField(type, "optional", undefined, depth + 1);
|
|
4942
4961
|
break;
|
|
4943
4962
|
}
|
|
4944
4963
|
});
|
|
@@ -4948,10 +4967,10 @@ function parse(source, root, options) {
|
|
|
4948
4967
|
}
|
|
4949
4968
|
}
|
|
4950
4969
|
|
|
4951
|
-
function parseField(parent, rule, extend) {
|
|
4970
|
+
function parseField(parent, rule, extend, depth) {
|
|
4952
4971
|
var type = next();
|
|
4953
4972
|
if (type === "group") {
|
|
4954
|
-
parseGroup(parent, rule);
|
|
4973
|
+
parseGroup(parent, rule, depth);
|
|
4955
4974
|
return;
|
|
4956
4975
|
}
|
|
4957
4976
|
// Type names can consume multiple tokens, in multiple variants:
|
|
@@ -5008,7 +5027,8 @@ function parse(source, root, options) {
|
|
|
5008
5027
|
}
|
|
5009
5028
|
}
|
|
5010
5029
|
|
|
5011
|
-
function parseGroup(parent, rule) {
|
|
5030
|
+
function parseGroup(parent, rule, depth) {
|
|
5031
|
+
depth = util.checkDepth(depth);
|
|
5012
5032
|
if (edition >= 2023) {
|
|
5013
5033
|
throw illegal("group");
|
|
5014
5034
|
}
|
|
@@ -5036,20 +5056,20 @@ function parse(source, root, options) {
|
|
|
5036
5056
|
break;
|
|
5037
5057
|
case "required":
|
|
5038
5058
|
case "repeated":
|
|
5039
|
-
parseField(type, token);
|
|
5059
|
+
parseField(type, token, undefined, depth + 1);
|
|
5040
5060
|
break;
|
|
5041
5061
|
|
|
5042
5062
|
case "optional":
|
|
5043
5063
|
/* istanbul ignore if */
|
|
5044
5064
|
if (edition === "proto3") {
|
|
5045
|
-
parseField(type, "proto3_optional");
|
|
5065
|
+
parseField(type, "proto3_optional", undefined, depth + 1);
|
|
5046
5066
|
} else {
|
|
5047
|
-
parseField(type, "optional");
|
|
5067
|
+
parseField(type, "optional", undefined, depth + 1);
|
|
5048
5068
|
}
|
|
5049
5069
|
break;
|
|
5050
5070
|
|
|
5051
5071
|
case "message":
|
|
5052
|
-
parseType(type, token);
|
|
5072
|
+
parseType(type, token, depth + 1);
|
|
5053
5073
|
break;
|
|
5054
5074
|
|
|
5055
5075
|
case "enum":
|
|
@@ -5108,7 +5128,7 @@ function parse(source, root, options) {
|
|
|
5108
5128
|
parent.add(field);
|
|
5109
5129
|
}
|
|
5110
5130
|
|
|
5111
|
-
function parseOneOf(parent, token) {
|
|
5131
|
+
function parseOneOf(parent, token, depth) {
|
|
5112
5132
|
|
|
5113
5133
|
/* istanbul ignore if */
|
|
5114
5134
|
if (!nameRe.test(token = next()))
|
|
@@ -5121,7 +5141,7 @@ function parse(source, root, options) {
|
|
|
5121
5141
|
skip(";");
|
|
5122
5142
|
} else {
|
|
5123
5143
|
push(token);
|
|
5124
|
-
parseField(oneof, "optional");
|
|
5144
|
+
parseField(oneof, "optional", undefined, depth);
|
|
5125
5145
|
}
|
|
5126
5146
|
});
|
|
5127
5147
|
parent.add(oneof);
|
|
@@ -5226,7 +5246,8 @@ function parse(source, root, options) {
|
|
|
5226
5246
|
setParsedOption(parent, option, optionValue, propName);
|
|
5227
5247
|
}
|
|
5228
5248
|
|
|
5229
|
-
function parseOptionValue(parent, name) {
|
|
5249
|
+
function parseOptionValue(parent, name, depth) {
|
|
5250
|
+
depth = util.checkDepth(depth);
|
|
5230
5251
|
// { a: "foo" b { c: "bar" } }
|
|
5231
5252
|
if (skip("{", true)) {
|
|
5232
5253
|
var objectResult = {};
|
|
@@ -5249,7 +5270,7 @@ function parse(source, root, options) {
|
|
|
5249
5270
|
// option (my_option) = {
|
|
5250
5271
|
// repeated_value: [ "foo", "bar" ]
|
|
5251
5272
|
// };
|
|
5252
|
-
value = parseOptionValue(parent, name + "." + token);
|
|
5273
|
+
value = parseOptionValue(parent, name + "." + token, depth + 1);
|
|
5253
5274
|
} else if (peek() === "[") {
|
|
5254
5275
|
value = [];
|
|
5255
5276
|
var lastValue;
|
|
@@ -5314,7 +5335,8 @@ function parse(source, root, options) {
|
|
|
5314
5335
|
return parent;
|
|
5315
5336
|
}
|
|
5316
5337
|
|
|
5317
|
-
function parseService(parent, token) {
|
|
5338
|
+
function parseService(parent, token, depth) {
|
|
5339
|
+
depth = util.checkDepth(depth);
|
|
5318
5340
|
|
|
5319
5341
|
/* istanbul ignore if */
|
|
5320
5342
|
if (!nameRe.test(token = next()))
|
|
@@ -5322,7 +5344,7 @@ function parse(source, root, options) {
|
|
|
5322
5344
|
|
|
5323
5345
|
var service = new Service(token);
|
|
5324
5346
|
ifBlock(service, function parseService_block(token) {
|
|
5325
|
-
if (parseCommon(service, token)) {
|
|
5347
|
+
if (parseCommon(service, token, depth)) {
|
|
5326
5348
|
return;
|
|
5327
5349
|
}
|
|
5328
5350
|
|
|
@@ -5388,7 +5410,7 @@ function parse(source, root, options) {
|
|
|
5388
5410
|
parent.add(method);
|
|
5389
5411
|
}
|
|
5390
5412
|
|
|
5391
|
-
function parseExtension(parent, token) {
|
|
5413
|
+
function parseExtension(parent, token, depth) {
|
|
5392
5414
|
|
|
5393
5415
|
/* istanbul ignore if */
|
|
5394
5416
|
if (!typeRefRe.test(token = next()))
|
|
@@ -5400,15 +5422,15 @@ function parse(source, root, options) {
|
|
|
5400
5422
|
|
|
5401
5423
|
case "required":
|
|
5402
5424
|
case "repeated":
|
|
5403
|
-
parseField(parent, token, reference);
|
|
5425
|
+
parseField(parent, token, reference, depth + 1);
|
|
5404
5426
|
break;
|
|
5405
5427
|
|
|
5406
5428
|
case "optional":
|
|
5407
5429
|
/* istanbul ignore if */
|
|
5408
5430
|
if (edition === "proto3") {
|
|
5409
|
-
parseField(parent, "proto3_optional", reference);
|
|
5431
|
+
parseField(parent, "proto3_optional", reference, depth + 1);
|
|
5410
5432
|
} else {
|
|
5411
|
-
parseField(parent, "optional", reference);
|
|
5433
|
+
parseField(parent, "optional", reference, depth + 1);
|
|
5412
5434
|
}
|
|
5413
5435
|
break;
|
|
5414
5436
|
|
|
@@ -5417,7 +5439,7 @@ function parse(source, root, options) {
|
|
|
5417
5439
|
if (edition === "proto2" || !typeRefRe.test(token))
|
|
5418
5440
|
throw illegal(token);
|
|
5419
5441
|
push(token);
|
|
5420
|
-
parseField(parent, "optional", reference);
|
|
5442
|
+
parseField(parent, "optional", reference, depth + 1);
|
|
5421
5443
|
break;
|
|
5422
5444
|
}
|
|
5423
5445
|
});
|
|
@@ -5469,7 +5491,7 @@ function parse(source, root, options) {
|
|
|
5469
5491
|
default:
|
|
5470
5492
|
|
|
5471
5493
|
/* istanbul ignore else */
|
|
5472
|
-
if (parseCommon(ptr, token)) {
|
|
5494
|
+
if (parseCommon(ptr, token, 0)) {
|
|
5473
5495
|
head = false;
|
|
5474
5496
|
continue;
|
|
5475
5497
|
}
|
|
@@ -5502,11 +5524,11 @@ function parse(source, root, options) {
|
|
|
5502
5524
|
* @variation 2
|
|
5503
5525
|
*/
|
|
5504
5526
|
|
|
5505
|
-
},{"
|
|
5527
|
+
},{"17":17,"18":18,"22":22,"24":24,"26":26,"27":27,"31":31,"35":35,"36":36,"37":37,"38":38,"39":39}],29:[function(require,module,exports){
|
|
5506
5528
|
"use strict";
|
|
5507
5529
|
module.exports = Reader;
|
|
5508
5530
|
|
|
5509
|
-
var util = require(
|
|
5531
|
+
var util = require(42);
|
|
5510
5532
|
|
|
5511
5533
|
var BufferReader; // cyclic
|
|
5512
5534
|
|
|
@@ -5930,15 +5952,15 @@ Reader._configure = function(BufferReader_) {
|
|
|
5930
5952
|
});
|
|
5931
5953
|
};
|
|
5932
5954
|
|
|
5933
|
-
},{"
|
|
5955
|
+
},{"42":42}],30:[function(require,module,exports){
|
|
5934
5956
|
"use strict";
|
|
5935
5957
|
module.exports = BufferReader;
|
|
5936
5958
|
|
|
5937
5959
|
// extends Reader
|
|
5938
|
-
var Reader = require(
|
|
5960
|
+
var Reader = require(29);
|
|
5939
5961
|
(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;
|
|
5940
5962
|
|
|
5941
|
-
var util = require(
|
|
5963
|
+
var util = require(42);
|
|
5942
5964
|
|
|
5943
5965
|
/**
|
|
5944
5966
|
* Constructs a new buffer reader instance.
|
|
@@ -5983,18 +6005,18 @@ BufferReader.prototype.string = function read_string_buffer() {
|
|
|
5983
6005
|
|
|
5984
6006
|
BufferReader._configure();
|
|
5985
6007
|
|
|
5986
|
-
},{"
|
|
6008
|
+
},{"29":29,"42":42}],31:[function(require,module,exports){
|
|
5987
6009
|
"use strict";
|
|
5988
6010
|
module.exports = Root;
|
|
5989
6011
|
|
|
5990
6012
|
// extends Namespace
|
|
5991
|
-
var Namespace = require(
|
|
6013
|
+
var Namespace = require(25);
|
|
5992
6014
|
((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = "Root";
|
|
5993
6015
|
|
|
5994
|
-
var Field = require(
|
|
5995
|
-
Enum = require(
|
|
5996
|
-
OneOf = require(
|
|
5997
|
-
util = require(
|
|
6016
|
+
var Field = require(18),
|
|
6017
|
+
Enum = require(17),
|
|
6018
|
+
OneOf = require(27),
|
|
6019
|
+
util = require(39);
|
|
5998
6020
|
|
|
5999
6021
|
var Type, // cyclic
|
|
6000
6022
|
parse, // might be excluded
|
|
@@ -6041,14 +6063,16 @@ function Root(options) {
|
|
|
6041
6063
|
* Loads a namespace descriptor into a root namespace.
|
|
6042
6064
|
* @param {INamespace} json Namespace descriptor
|
|
6043
6065
|
* @param {Root} [root] Root namespace, defaults to create a new one if omitted
|
|
6066
|
+
* @param {number} [depth] Current nesting depth, defaults to `0`
|
|
6044
6067
|
* @returns {Root} Root namespace
|
|
6045
6068
|
*/
|
|
6046
|
-
Root.fromJSON = function fromJSON(json, root) {
|
|
6069
|
+
Root.fromJSON = function fromJSON(json, root, depth) {
|
|
6070
|
+
depth = util.checkDepth(depth);
|
|
6047
6071
|
if (!root)
|
|
6048
6072
|
root = new Root();
|
|
6049
6073
|
if (json.options)
|
|
6050
6074
|
root.setOptions(json.options);
|
|
6051
|
-
return root.addJSON(json.nested).resolveAll();
|
|
6075
|
+
return root.addJSON(json.nested, depth).resolveAll();
|
|
6052
6076
|
};
|
|
6053
6077
|
|
|
6054
6078
|
/**
|
|
@@ -6389,7 +6413,7 @@ Root._configure = function(Type_, parse_, common_) {
|
|
|
6389
6413
|
common = common_;
|
|
6390
6414
|
};
|
|
6391
6415
|
|
|
6392
|
-
},{"
|
|
6416
|
+
},{"17":17,"18":18,"25":25,"27":27,"39":39}],32:[function(require,module,exports){
|
|
6393
6417
|
"use strict";
|
|
6394
6418
|
module.exports = {};
|
|
6395
6419
|
|
|
@@ -6409,7 +6433,7 @@ module.exports = {};
|
|
|
6409
6433
|
* var root = protobuf.roots["myroot"];
|
|
6410
6434
|
*/
|
|
6411
6435
|
|
|
6412
|
-
},{}],
|
|
6436
|
+
},{}],33:[function(require,module,exports){
|
|
6413
6437
|
"use strict";
|
|
6414
6438
|
|
|
6415
6439
|
/**
|
|
@@ -6445,13 +6469,13 @@ var rpc = exports;
|
|
|
6445
6469
|
* @returns {undefined}
|
|
6446
6470
|
*/
|
|
6447
6471
|
|
|
6448
|
-
rpc.Service = require(
|
|
6472
|
+
rpc.Service = require(34);
|
|
6449
6473
|
|
|
6450
|
-
},{"
|
|
6474
|
+
},{"34":34}],34:[function(require,module,exports){
|
|
6451
6475
|
"use strict";
|
|
6452
6476
|
module.exports = Service;
|
|
6453
6477
|
|
|
6454
|
-
var util = require(
|
|
6478
|
+
var util = require(42);
|
|
6455
6479
|
|
|
6456
6480
|
// Extends EventEmitter
|
|
6457
6481
|
(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;
|
|
@@ -6591,17 +6615,17 @@ Service.prototype.end = function end(endedByRPC) {
|
|
|
6591
6615
|
return this;
|
|
6592
6616
|
};
|
|
6593
6617
|
|
|
6594
|
-
},{"
|
|
6618
|
+
},{"42":42}],35:[function(require,module,exports){
|
|
6595
6619
|
"use strict";
|
|
6596
6620
|
module.exports = Service;
|
|
6597
6621
|
|
|
6598
6622
|
// extends Namespace
|
|
6599
|
-
var Namespace = require(
|
|
6623
|
+
var Namespace = require(25);
|
|
6600
6624
|
((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = "Service";
|
|
6601
6625
|
|
|
6602
|
-
var Method = require(
|
|
6603
|
-
util = require(
|
|
6604
|
-
rpc = require(
|
|
6626
|
+
var Method = require(24),
|
|
6627
|
+
util = require(39),
|
|
6628
|
+
rpc = require(33);
|
|
6605
6629
|
|
|
6606
6630
|
var reservedRe = util.patterns.reservedRe;
|
|
6607
6631
|
|
|
@@ -6642,17 +6666,19 @@ function Service(name, options) {
|
|
|
6642
6666
|
* Constructs a service from a service descriptor.
|
|
6643
6667
|
* @param {string} name Service name
|
|
6644
6668
|
* @param {IService} json Service descriptor
|
|
6669
|
+
* @param {number} [depth] Current nesting depth, defaults to `0`
|
|
6645
6670
|
* @returns {Service} Created service
|
|
6646
6671
|
* @throws {TypeError} If arguments are invalid
|
|
6647
6672
|
*/
|
|
6648
|
-
Service.fromJSON = function fromJSON(name, json) {
|
|
6673
|
+
Service.fromJSON = function fromJSON(name, json, depth) {
|
|
6674
|
+
depth = util.checkDepth(depth);
|
|
6649
6675
|
var service = new Service(name, json.options);
|
|
6650
6676
|
/* istanbul ignore else */
|
|
6651
6677
|
if (json.methods)
|
|
6652
6678
|
for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i)
|
|
6653
6679
|
service.add(Method.fromJSON(names[i], json.methods[names[i]]));
|
|
6654
6680
|
if (json.nested)
|
|
6655
|
-
service.addJSON(json.nested);
|
|
6681
|
+
service.addJSON(json.nested, depth);
|
|
6656
6682
|
if (json.edition)
|
|
6657
6683
|
service._edition = json.edition;
|
|
6658
6684
|
service.comment = json.comment;
|
|
@@ -6786,7 +6812,7 @@ Service.prototype.create = function create(rpcImpl, requestDelimited, responseDe
|
|
|
6786
6812
|
return rpcService;
|
|
6787
6813
|
};
|
|
6788
6814
|
|
|
6789
|
-
},{"
|
|
6815
|
+
},{"24":24,"25":25,"33":33,"39":39}],36:[function(require,module,exports){
|
|
6790
6816
|
"use strict";
|
|
6791
6817
|
module.exports = tokenize;
|
|
6792
6818
|
|
|
@@ -7204,28 +7230,28 @@ function tokenize(source, alternateCommentMode) {
|
|
|
7204
7230
|
/* eslint-enable callback-return */
|
|
7205
7231
|
}
|
|
7206
7232
|
|
|
7207
|
-
},{}],
|
|
7233
|
+
},{}],37:[function(require,module,exports){
|
|
7208
7234
|
"use strict";
|
|
7209
7235
|
module.exports = Type;
|
|
7210
7236
|
|
|
7211
7237
|
// extends Namespace
|
|
7212
|
-
var Namespace = require(
|
|
7238
|
+
var Namespace = require(25);
|
|
7213
7239
|
((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = "Type";
|
|
7214
7240
|
|
|
7215
|
-
var Enum = require(
|
|
7216
|
-
OneOf = require(
|
|
7217
|
-
Field = require(
|
|
7218
|
-
MapField = require(
|
|
7219
|
-
Service = require(
|
|
7220
|
-
Message = require(
|
|
7221
|
-
Reader = require(
|
|
7222
|
-
Writer = require(
|
|
7223
|
-
util = require(
|
|
7224
|
-
encoder = require(
|
|
7225
|
-
decoder = require(
|
|
7226
|
-
verifier = require(
|
|
7227
|
-
converter = require(
|
|
7228
|
-
wrappers = require(
|
|
7241
|
+
var Enum = require(17),
|
|
7242
|
+
OneOf = require(27),
|
|
7243
|
+
Field = require(18),
|
|
7244
|
+
MapField = require(22),
|
|
7245
|
+
Service = require(35),
|
|
7246
|
+
Message = require(23),
|
|
7247
|
+
Reader = require(29),
|
|
7248
|
+
Writer = require(46),
|
|
7249
|
+
util = require(39),
|
|
7250
|
+
encoder = require(16),
|
|
7251
|
+
decoder = require(15),
|
|
7252
|
+
verifier = require(44),
|
|
7253
|
+
converter = require(14),
|
|
7254
|
+
wrappers = require(45);
|
|
7229
7255
|
|
|
7230
7256
|
/**
|
|
7231
7257
|
* Constructs a new reflected message type instance.
|
|
@@ -7440,9 +7466,11 @@ function clearCache(type) {
|
|
|
7440
7466
|
* Creates a message type from a message type descriptor.
|
|
7441
7467
|
* @param {string} name Message name
|
|
7442
7468
|
* @param {IType} json Message type descriptor
|
|
7469
|
+
* @param {number} [depth] Current nesting depth, defaults to `0`
|
|
7443
7470
|
* @returns {Type} Created message type
|
|
7444
7471
|
*/
|
|
7445
|
-
Type.fromJSON = function fromJSON(name, json) {
|
|
7472
|
+
Type.fromJSON = function fromJSON(name, json, depth) {
|
|
7473
|
+
depth = util.checkDepth(depth);
|
|
7446
7474
|
var type = new Type(name, json.options);
|
|
7447
7475
|
type.extensions = json.extensions;
|
|
7448
7476
|
type.reserved = json.reserved;
|
|
@@ -7469,7 +7497,7 @@ Type.fromJSON = function fromJSON(name, json) {
|
|
|
7469
7497
|
? Enum.fromJSON
|
|
7470
7498
|
: nested.methods !== undefined
|
|
7471
7499
|
? Service.fromJSON
|
|
7472
|
-
: Namespace.fromJSON )(names[i], nested)
|
|
7500
|
+
: Namespace.fromJSON )(names[i], nested, depth + 1)
|
|
7473
7501
|
);
|
|
7474
7502
|
}
|
|
7475
7503
|
if (json.extensions && json.extensions.length)
|
|
@@ -7831,7 +7859,7 @@ Type.d = function decorateType(typeName) {
|
|
|
7831
7859
|
};
|
|
7832
7860
|
};
|
|
7833
7861
|
|
|
7834
|
-
},{"
|
|
7862
|
+
},{"14":14,"15":15,"16":16,"17":17,"18":18,"22":22,"23":23,"25":25,"27":27,"29":29,"35":35,"39":39,"44":44,"45":45,"46":46}],38:[function(require,module,exports){
|
|
7835
7863
|
"use strict";
|
|
7836
7864
|
|
|
7837
7865
|
/**
|
|
@@ -7840,7 +7868,7 @@ Type.d = function decorateType(typeName) {
|
|
|
7840
7868
|
*/
|
|
7841
7869
|
var types = exports;
|
|
7842
7870
|
|
|
7843
|
-
var util = require(
|
|
7871
|
+
var util = require(39);
|
|
7844
7872
|
|
|
7845
7873
|
var s = [
|
|
7846
7874
|
"double", // 0
|
|
@@ -8029,24 +8057,24 @@ types.packed = bake([
|
|
|
8029
8057
|
/* bool */ 0
|
|
8030
8058
|
]);
|
|
8031
8059
|
|
|
8032
|
-
},{"
|
|
8060
|
+
},{"39":39}],39:[function(require,module,exports){
|
|
8033
8061
|
"use strict";
|
|
8034
8062
|
|
|
8035
8063
|
/**
|
|
8036
8064
|
* Various utility functions.
|
|
8037
8065
|
* @namespace
|
|
8038
8066
|
*/
|
|
8039
|
-
var util = module.exports = require(
|
|
8067
|
+
var util = module.exports = require(42);
|
|
8040
8068
|
|
|
8041
|
-
var roots = require(
|
|
8069
|
+
var roots = require(32);
|
|
8042
8070
|
|
|
8043
8071
|
var Type, // cyclic
|
|
8044
8072
|
Enum;
|
|
8045
8073
|
|
|
8046
8074
|
util.codegen = require(3);
|
|
8047
8075
|
util.fetch = require(5);
|
|
8048
|
-
util.path = require(
|
|
8049
|
-
util.patterns = require(
|
|
8076
|
+
util.path = require(9);
|
|
8077
|
+
util.patterns = require(43);
|
|
8050
8078
|
|
|
8051
8079
|
var reservedRe = util.patterns.reservedRe,
|
|
8052
8080
|
unsafePropertyRe = util.patterns.unsafePropertyRe;
|
|
@@ -8055,7 +8083,21 @@ var reservedRe = util.patterns.reservedRe,
|
|
|
8055
8083
|
* Node's fs module if available.
|
|
8056
8084
|
* @type {Object.<string,*>}
|
|
8057
8085
|
*/
|
|
8058
|
-
util.fs =
|
|
8086
|
+
util.fs = require(40);
|
|
8087
|
+
|
|
8088
|
+
/**
|
|
8089
|
+
* Checks a recursion depth.
|
|
8090
|
+
* @param {number|undefined} depth Depth of recursion
|
|
8091
|
+
* @returns {number} Depth of recursion
|
|
8092
|
+
* @throws {Error} If depth exceeds util.recursionLimit
|
|
8093
|
+
*/
|
|
8094
|
+
util.checkDepth = function checkDepth(depth) {
|
|
8095
|
+
if (depth === undefined)
|
|
8096
|
+
depth = 0;
|
|
8097
|
+
if (depth > util.recursionLimit)
|
|
8098
|
+
throw Error("max depth exceeded");
|
|
8099
|
+
return depth;
|
|
8100
|
+
};
|
|
8059
8101
|
|
|
8060
8102
|
/**
|
|
8061
8103
|
* Converts an object's values to an array.
|
|
@@ -8165,7 +8207,7 @@ util.decorateType = function decorateType(ctor, typeName) {
|
|
|
8165
8207
|
|
|
8166
8208
|
/* istanbul ignore next */
|
|
8167
8209
|
if (!Type)
|
|
8168
|
-
Type = require(
|
|
8210
|
+
Type = require(37);
|
|
8169
8211
|
|
|
8170
8212
|
var type = new Type(typeName || ctor.name);
|
|
8171
8213
|
util.decorateRoot.add(type);
|
|
@@ -8190,7 +8232,7 @@ util.decorateEnum = function decorateEnum(object) {
|
|
|
8190
8232
|
|
|
8191
8233
|
/* istanbul ignore next */
|
|
8192
8234
|
if (!Enum)
|
|
8193
|
-
Enum = require(
|
|
8235
|
+
Enum = require(17);
|
|
8194
8236
|
|
|
8195
8237
|
var enm = new Enum("Enum" + decorateEnumIndex++, object);
|
|
8196
8238
|
util.decorateRoot.add(enm);
|
|
@@ -8242,15 +8284,28 @@ util.setProperty = function setProperty(dst, path, value, ifNotSet) {
|
|
|
8242
8284
|
*/
|
|
8243
8285
|
Object.defineProperty(util, "decorateRoot", {
|
|
8244
8286
|
get: function() {
|
|
8245
|
-
return roots["decorated"] || (roots["decorated"] = new (require(
|
|
8287
|
+
return roots["decorated"] || (roots["decorated"] = new (require(31))());
|
|
8246
8288
|
}
|
|
8247
8289
|
});
|
|
8248
8290
|
|
|
8249
|
-
},{"
|
|
8291
|
+
},{"17":17,"3":3,"31":31,"32":32,"37":37,"40":40,"42":42,"43":43,"5":5,"9":9}],40:[function(require,module,exports){
|
|
8292
|
+
"use strict";
|
|
8293
|
+
|
|
8294
|
+
var fs = null;
|
|
8295
|
+
try {
|
|
8296
|
+
fs = require(12);
|
|
8297
|
+
if (!fs || !fs.readFile || !fs.readFileSync)
|
|
8298
|
+
fs = null;
|
|
8299
|
+
} catch (e) {
|
|
8300
|
+
// `fs` is unavailable in browsers and browser-like bundles.
|
|
8301
|
+
}
|
|
8302
|
+
module.exports = fs;
|
|
8303
|
+
|
|
8304
|
+
},{"12":12}],41:[function(require,module,exports){
|
|
8250
8305
|
"use strict";
|
|
8251
8306
|
module.exports = LongBits;
|
|
8252
8307
|
|
|
8253
|
-
var util = require(
|
|
8308
|
+
var util = require(42);
|
|
8254
8309
|
|
|
8255
8310
|
/**
|
|
8256
8311
|
* Constructs new long bits.
|
|
@@ -8448,7 +8503,7 @@ LongBits.prototype.length = function length() {
|
|
|
8448
8503
|
: part2 < 128 ? 9 : 10;
|
|
8449
8504
|
};
|
|
8450
8505
|
|
|
8451
|
-
},{"
|
|
8506
|
+
},{"42":42}],42:[function(require,module,exports){
|
|
8452
8507
|
"use strict";
|
|
8453
8508
|
var util = exports;
|
|
8454
8509
|
|
|
@@ -8462,19 +8517,19 @@ util.base64 = require(2);
|
|
|
8462
8517
|
util.EventEmitter = require(4);
|
|
8463
8518
|
|
|
8464
8519
|
// float handling accross browsers
|
|
8465
|
-
util.float = require(
|
|
8520
|
+
util.float = require(7);
|
|
8466
8521
|
|
|
8467
8522
|
// requires modules optionally and hides the call from bundlers
|
|
8468
|
-
util.inquire = require(
|
|
8523
|
+
util.inquire = require(8);
|
|
8469
8524
|
|
|
8470
8525
|
// converts to / from utf8 encoded strings
|
|
8471
|
-
util.utf8 = require(
|
|
8526
|
+
util.utf8 = require(11);
|
|
8472
8527
|
|
|
8473
8528
|
// provides a node-like buffer pool in the browser
|
|
8474
|
-
util.pool = require(
|
|
8529
|
+
util.pool = require(10);
|
|
8475
8530
|
|
|
8476
8531
|
// utility to work with the low and high bits of a 64 bit value
|
|
8477
|
-
util.LongBits = require(
|
|
8532
|
+
util.LongBits = require(41);
|
|
8478
8533
|
|
|
8479
8534
|
/**
|
|
8480
8535
|
* Whether running within node or not.
|
|
@@ -8576,7 +8631,7 @@ util.isSet = function isSet(obj, prop) {
|
|
|
8576
8631
|
*/
|
|
8577
8632
|
util.Buffer = (function() {
|
|
8578
8633
|
try {
|
|
8579
|
-
var Buffer = util.
|
|
8634
|
+
var Buffer = util.global.Buffer;
|
|
8580
8635
|
// refuse to use non-node buffers if not explicitly assigned (perf reasons):
|
|
8581
8636
|
return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;
|
|
8582
8637
|
} catch (e) {
|
|
@@ -8630,7 +8685,15 @@ util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore n
|
|
|
8630
8685
|
*/
|
|
8631
8686
|
util.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long
|
|
8632
8687
|
|| /* istanbul ignore next */ util.global.Long
|
|
8633
|
-
||
|
|
8688
|
+
|| (function() {
|
|
8689
|
+
try {
|
|
8690
|
+
var Long = require("long");
|
|
8691
|
+
return Long && Long.isLong ? Long : null;
|
|
8692
|
+
} catch (e) {
|
|
8693
|
+
/* istanbul ignore next */
|
|
8694
|
+
return null;
|
|
8695
|
+
}
|
|
8696
|
+
})();
|
|
8634
8697
|
|
|
8635
8698
|
/**
|
|
8636
8699
|
* Regular expression used to verify 2 bit (`bool`) map keys.
|
|
@@ -8911,7 +8974,7 @@ util._configure = function() {
|
|
|
8911
8974
|
};
|
|
8912
8975
|
};
|
|
8913
8976
|
|
|
8914
|
-
},{"1":1,"10":10,"
|
|
8977
|
+
},{"1":1,"10":10,"11":11,"2":2,"4":4,"41":41,"7":7,"8":8,"long":"long"}],43:[function(require,module,exports){
|
|
8915
8978
|
"use strict";
|
|
8916
8979
|
|
|
8917
8980
|
var patterns = exports;
|
|
@@ -8921,12 +8984,12 @@ patterns.typeRefRe = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]
|
|
|
8921
8984
|
patterns.reservedRe = /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/;
|
|
8922
8985
|
patterns.unsafePropertyRe = /^(?:__proto__|prototype|constructor)$/;
|
|
8923
8986
|
|
|
8924
|
-
},{}],
|
|
8987
|
+
},{}],44:[function(require,module,exports){
|
|
8925
8988
|
"use strict";
|
|
8926
8989
|
module.exports = verifier;
|
|
8927
8990
|
|
|
8928
|
-
var Enum = require(
|
|
8929
|
-
util = require(
|
|
8991
|
+
var Enum = require(17),
|
|
8992
|
+
util = require(39);
|
|
8930
8993
|
|
|
8931
8994
|
function invalid(field, expected) {
|
|
8932
8995
|
return field.name + ": " + expected + (field.repeated && expected !== "array" ? "[]" : field.map && expected !== "object" ? "{k:"+field.keyType+"}" : "") + " expected";
|
|
@@ -9103,7 +9166,7 @@ function verifier(mtype) {
|
|
|
9103
9166
|
/* eslint-enable no-unexpected-multiline */
|
|
9104
9167
|
}
|
|
9105
9168
|
|
|
9106
|
-
},{"
|
|
9169
|
+
},{"17":17,"39":39}],45:[function(require,module,exports){
|
|
9107
9170
|
"use strict";
|
|
9108
9171
|
|
|
9109
9172
|
/**
|
|
@@ -9113,7 +9176,7 @@ function verifier(mtype) {
|
|
|
9113
9176
|
*/
|
|
9114
9177
|
var wrappers = exports;
|
|
9115
9178
|
|
|
9116
|
-
var Message = require(
|
|
9179
|
+
var Message = require(23);
|
|
9117
9180
|
|
|
9118
9181
|
/**
|
|
9119
9182
|
* From object converter part of an {@link IWrapper}.
|
|
@@ -9208,11 +9271,11 @@ wrappers[".google.protobuf.Any"] = {
|
|
|
9208
9271
|
}
|
|
9209
9272
|
};
|
|
9210
9273
|
|
|
9211
|
-
},{"
|
|
9274
|
+
},{"23":23}],46:[function(require,module,exports){
|
|
9212
9275
|
"use strict";
|
|
9213
9276
|
module.exports = Writer;
|
|
9214
9277
|
|
|
9215
|
-
var util = require(
|
|
9278
|
+
var util = require(42);
|
|
9216
9279
|
|
|
9217
9280
|
var BufferWriter; // cyclic
|
|
9218
9281
|
|
|
@@ -9675,15 +9738,15 @@ Writer._configure = function(BufferWriter_) {
|
|
|
9675
9738
|
BufferWriter._configure();
|
|
9676
9739
|
};
|
|
9677
9740
|
|
|
9678
|
-
},{"
|
|
9741
|
+
},{"42":42}],47:[function(require,module,exports){
|
|
9679
9742
|
"use strict";
|
|
9680
9743
|
module.exports = BufferWriter;
|
|
9681
9744
|
|
|
9682
9745
|
// extends Writer
|
|
9683
|
-
var Writer = require(
|
|
9746
|
+
var Writer = require(46);
|
|
9684
9747
|
(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;
|
|
9685
9748
|
|
|
9686
|
-
var util = require(
|
|
9749
|
+
var util = require(42);
|
|
9687
9750
|
|
|
9688
9751
|
/**
|
|
9689
9752
|
* Constructs a new buffer writer instance.
|
|
@@ -9762,7 +9825,7 @@ BufferWriter.prototype.string = function write_string_buffer(value) {
|
|
|
9762
9825
|
|
|
9763
9826
|
BufferWriter._configure();
|
|
9764
9827
|
|
|
9765
|
-
},{"
|
|
9828
|
+
},{"42":42,"46":46}]},{},[21])
|
|
9766
9829
|
|
|
9767
9830
|
})();
|
|
9768
9831
|
//# sourceMappingURL=protobuf.js.map
|