protobufjs 8.2.1 → 8.3.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/README.md +60 -23
- package/dist/light/protobuf.js +21 -13
- 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 +2 -2
- package/dist/minimal/protobuf.min.js +2 -2
- package/dist/protobuf.js +21 -13
- package/dist/protobuf.js.map +1 -1
- package/dist/protobuf.min.js +3 -3
- package/dist/protobuf.min.js.map +1 -1
- package/ext/descriptor.d.ts +11 -234
- package/ext/descriptor.generated.d.ts +409 -0
- package/ext/descriptor.js +89 -64
- package/ext/textformat.d.ts +2 -7
- package/ext/textformat.generated.d.ts +11 -0
- package/ext/textformat.js +11 -3
- package/index.d.ts +301 -267
- package/package.json +4 -4
- package/src/enum.js +8 -3
- package/src/field.js +2 -0
- package/src/message.js +3 -6
- package/src/method.js +1 -1
- package/src/object.js +0 -1
- package/src/oneof.js +1 -0
- package/src/service.js +2 -0
- package/src/type.js +2 -0
- package/src/typescript.js +19 -0
- package/tsconfig.json +2 -4
- package/src/typescript.jsdoc +0 -15
package/dist/minimal/protobuf.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* protobuf.js v8.
|
|
3
|
-
* compiled wed, 13 may 2026
|
|
2
|
+
* protobuf.js v8.3.0 (c) 2016, daniel wirtz
|
|
3
|
+
* compiled wed, 13 may 2026 21:15:34 utc
|
|
4
4
|
* licensed under the bsd-3-clause license
|
|
5
5
|
* see: https://github.com/dcodeio/protobuf.js for details
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* protobuf.js v8.
|
|
3
|
-
* compiled wed, 13 may 2026
|
|
2
|
+
* protobuf.js v8.3.0 (c) 2016, daniel wirtz
|
|
3
|
+
* compiled wed, 13 may 2026 21:15:34 utc
|
|
4
4
|
* licensed under the bsd-3-clause license
|
|
5
5
|
* see: https://github.com/dcodeio/protobuf.js for details
|
|
6
6
|
*/
|
package/dist/protobuf.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* protobuf.js v8.
|
|
3
|
-
* compiled wed, 13 may 2026
|
|
2
|
+
* protobuf.js v8.3.0 (c) 2016, daniel wirtz
|
|
3
|
+
* compiled wed, 13 may 2026 21:15:34 utc
|
|
4
4
|
* licensed under the bsd-3-clause license
|
|
5
5
|
* see: https://github.com/dcodeio/protobuf.js for details
|
|
6
6
|
*/
|
|
@@ -1115,7 +1115,7 @@ var Namespace = require(14),
|
|
|
1115
1115
|
* @param {Object.<string,number>} [values] Enum values as an object, by name
|
|
1116
1116
|
* @param {Object.<string,*>} [options] Declared options
|
|
1117
1117
|
* @param {string} [comment] The comment for this enum
|
|
1118
|
-
* @param {Object.<string,string>} [comments] The value comments for this enum
|
|
1118
|
+
* @param {Object.<string,string|null>} [comments] The value comments for this enum
|
|
1119
1119
|
* @param {Object.<string,Object<string,*>>|undefined} [valuesOptions] The value options for this enum
|
|
1120
1120
|
*/
|
|
1121
1121
|
function Enum(name, values, options, comment, comments, valuesOptions) {
|
|
@@ -1144,7 +1144,7 @@ function Enum(name, values, options, comment, comments, valuesOptions) {
|
|
|
1144
1144
|
|
|
1145
1145
|
/**
|
|
1146
1146
|
* Value comment texts, if any.
|
|
1147
|
-
* @type {Object.<string,string>}
|
|
1147
|
+
* @type {Object.<string,string|null>}
|
|
1148
1148
|
*/
|
|
1149
1149
|
this.comments = comments || {};
|
|
1150
1150
|
|
|
@@ -1194,8 +1194,13 @@ Enum.prototype._resolveFeatures = function _resolveFeatures(edition) {
|
|
|
1194
1194
|
/**
|
|
1195
1195
|
* Enum descriptor.
|
|
1196
1196
|
* @interface IEnum
|
|
1197
|
+
* @property {string} [edition] Edition
|
|
1197
1198
|
* @property {Object.<string,number>} values Enum values
|
|
1198
1199
|
* @property {Object.<string,*>} [options] Enum options
|
|
1200
|
+
* @property {Object.<string,Object.<string,*>>} [valuesOptions] Enum value options
|
|
1201
|
+
* @property {Array.<number[]|string>} [reserved] Reserved ranges
|
|
1202
|
+
* @property {string|null} [comment] Enum comment
|
|
1203
|
+
* @property {Object.<string,string|null>} [comments] Value comments
|
|
1199
1204
|
*/
|
|
1200
1205
|
|
|
1201
1206
|
/**
|
|
@@ -1206,7 +1211,7 @@ Enum.prototype._resolveFeatures = function _resolveFeatures(edition) {
|
|
|
1206
1211
|
* @throws {TypeError} If arguments are invalid
|
|
1207
1212
|
*/
|
|
1208
1213
|
Enum.fromJSON = function fromJSON(name, json) {
|
|
1209
|
-
var enm = new Enum(name, json.values, json.options, json.comment, json.comments);
|
|
1214
|
+
var enm = new Enum(name, json.values, json.options, json.comment, json.comments, json.valuesOptions);
|
|
1210
1215
|
enm.reserved = json.reserved;
|
|
1211
1216
|
if (json.edition)
|
|
1212
1217
|
enm._edition = json.edition;
|
|
@@ -1585,10 +1590,12 @@ Field.prototype.setOption = function setOption(name, value, ifNotSet) {
|
|
|
1585
1590
|
/**
|
|
1586
1591
|
* Field descriptor.
|
|
1587
1592
|
* @interface IField
|
|
1593
|
+
* @property {string} [edition] Edition
|
|
1588
1594
|
* @property {string} [rule="optional"] Field rule
|
|
1589
1595
|
* @property {string} type Field type
|
|
1590
1596
|
* @property {number} id Field id
|
|
1591
1597
|
* @property {Object.<string,*>} [options] Field options
|
|
1598
|
+
* @property {string|null} [comment] Field comment
|
|
1592
1599
|
*/
|
|
1593
1600
|
|
|
1594
1601
|
/**
|
|
@@ -2085,12 +2092,9 @@ var util = require(38);
|
|
|
2085
2092
|
function Message(properties) {
|
|
2086
2093
|
// not used internally
|
|
2087
2094
|
if (properties)
|
|
2088
|
-
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
continue;
|
|
2092
|
-
this[key] = properties[key];
|
|
2093
|
-
}
|
|
2095
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
2096
|
+
if (properties[keys[i]] != null && keys[i] !== "__proto__")
|
|
2097
|
+
this[keys[i]] = properties[keys[i]];
|
|
2094
2098
|
}
|
|
2095
2099
|
|
|
2096
2100
|
/**
|
|
@@ -2324,7 +2328,7 @@ function Method(name, type, requestType, responseType, requestStream, responseSt
|
|
|
2324
2328
|
* @property {boolean} [requestStream=false] Whether requests are streamed
|
|
2325
2329
|
* @property {boolean} [responseStream=false] Whether responses are streamed
|
|
2326
2330
|
* @property {Object.<string,*>} [options] Method options
|
|
2327
|
-
* @property {string} comment Method
|
|
2331
|
+
* @property {string|null} [comment] Method comment
|
|
2328
2332
|
* @property {Array.<Object.<string,*>>} [parsedOptions] Method options properly parsed into objects
|
|
2329
2333
|
*/
|
|
2330
2334
|
|
|
@@ -3085,7 +3089,6 @@ Object.defineProperties(ReflectionObject.prototype, {
|
|
|
3085
3089
|
/**
|
|
3086
3090
|
* Converts this reflection object to its descriptor representation.
|
|
3087
3091
|
* @returns {Object.<string,*>} Descriptor
|
|
3088
|
-
* @abstract
|
|
3089
3092
|
*/
|
|
3090
3093
|
ReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() {
|
|
3091
3094
|
throw Error(); // not implemented, shouldn't happen
|
|
@@ -3382,6 +3385,7 @@ function OneOf(name, fieldNames, options, comment) {
|
|
|
3382
3385
|
* @interface IOneOf
|
|
3383
3386
|
* @property {Array.<string>} oneof Oneof field names
|
|
3384
3387
|
* @property {Object.<string,*>} [options] Oneof options
|
|
3388
|
+
* @property {string|null} [comment] Oneof comment
|
|
3385
3389
|
*/
|
|
3386
3390
|
|
|
3387
3391
|
/**
|
|
@@ -5869,7 +5873,9 @@ function Service(name, options) {
|
|
|
5869
5873
|
* Service descriptor.
|
|
5870
5874
|
* @interface IService
|
|
5871
5875
|
* @extends INamespace
|
|
5876
|
+
* @property {string} [edition] Edition
|
|
5872
5877
|
* @property {Object.<string,IMethod>} methods Method descriptors
|
|
5878
|
+
* @property {string|null} [comment] Service comment
|
|
5873
5879
|
*/
|
|
5874
5880
|
|
|
5875
5881
|
/**
|
|
@@ -6677,11 +6683,13 @@ function clearCache(type) {
|
|
|
6677
6683
|
* Message type descriptor.
|
|
6678
6684
|
* @interface IType
|
|
6679
6685
|
* @extends INamespace
|
|
6686
|
+
* @property {string} [edition] Edition
|
|
6680
6687
|
* @property {Object.<string,IOneOf>} [oneofs] Oneof descriptors
|
|
6681
6688
|
* @property {Object.<string,IField>} fields Field descriptors
|
|
6682
6689
|
* @property {number[][]} [extensions] Extension ranges
|
|
6683
6690
|
* @property {Array.<number[]|string>} [reserved] Reserved ranges
|
|
6684
6691
|
* @property {boolean} [group=false] Whether a legacy group or not
|
|
6692
|
+
* @property {string|null} [comment] Message type comment
|
|
6685
6693
|
*/
|
|
6686
6694
|
|
|
6687
6695
|
/**
|