protobufjs 8.0.3-experimental → 8.0.3
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/LICENSE +39 -39
- package/README.md +727 -727
- package/dist/light/protobuf.js +7724 -7352
- 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 +2606 -2546
- 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 +9588 -9131
- package/dist/protobuf.js.map +1 -1
- package/dist/protobuf.min.js +3 -3
- package/dist/protobuf.min.js.map +1 -1
- package/ext/debug/README.md +4 -4
- package/ext/debug/index.js +71 -71
- package/ext/descriptor/README.md +72 -72
- package/ext/descriptor/index.d.ts +195 -191
- package/ext/descriptor/index.js +1181 -1052
- package/ext/descriptor/test.js +54 -54
- package/google/LICENSE +27 -27
- package/google/README.md +1 -1
- package/google/api/annotations.json +82 -82
- package/google/api/annotations.proto +10 -10
- package/google/api/http.json +85 -85
- package/google/api/http.proto +30 -30
- package/google/protobuf/api.json +117 -117
- package/google/protobuf/api.proto +33 -33
- package/google/protobuf/descriptor.json +1381 -738
- package/google/protobuf/descriptor.proto +535 -286
- package/google/protobuf/source_context.json +19 -19
- package/google/protobuf/source_context.proto +7 -7
- package/google/protobuf/type.json +201 -201
- package/google/protobuf/type.proto +89 -89
- package/index.d.ts +2817 -2792
- package/index.js +4 -4
- package/light.d.ts +2 -2
- package/light.js +3 -3
- package/minimal.d.ts +2 -2
- package/minimal.js +4 -4
- package/package.json +96 -112
- package/scripts/postinstall.js +32 -32
- package/src/common.js +399 -399
- package/src/converter.js +310 -301
- package/src/decoder.js +135 -127
- package/src/encoder.js +100 -100
- package/src/enum.js +226 -241
- package/src/field.js +453 -432
- package/src/index-light.js +104 -104
- package/src/index-minimal.js +36 -36
- package/src/index.js +12 -12
- package/src/mapfield.js +126 -126
- package/src/message.js +139 -139
- package/src/method.js +160 -160
- package/src/namespace.js +550 -434
- package/src/object.js +385 -330
- package/src/oneof.js +222 -222
- package/src/parse.js +1024 -944
- package/src/reader.js +426 -416
- package/src/reader_buffer.js +51 -51
- package/src/root.js +404 -384
- package/src/roots.js +17 -17
- package/src/rpc/service.js +142 -142
- package/src/rpc.js +36 -36
- package/src/service.js +193 -168
- package/src/tokenize.js +421 -416
- package/src/type.js +625 -590
- package/src/types.js +196 -196
- package/src/typescript.jsdoc +15 -15
- package/src/util/aspromise.d.ts +13 -0
- package/src/util/aspromise.js +52 -0
- package/src/util/base64.d.ts +32 -0
- package/src/util/base64.js +139 -0
- package/src/util/codegen.d.ts +31 -0
- package/src/util/codegen.js +113 -0
- package/src/util/eventemitter.d.ts +45 -0
- package/src/util/eventemitter.js +84 -0
- package/src/util/fetch.d.ts +56 -0
- package/src/util/fetch.js +114 -0
- package/src/util/float.d.ts +83 -0
- package/src/util/float.js +335 -0
- package/src/util/inquire.d.ts +9 -0
- package/src/util/inquire.js +37 -0
- package/src/util/longbits.js +200 -200
- package/src/util/minimal.js +461 -438
- package/src/util/path.d.ts +22 -0
- package/src/util/path.js +72 -0
- package/src/util/patterns.js +8 -0
- package/src/util/pool.d.ts +32 -0
- package/src/util/pool.js +48 -0
- package/src/util/utf8.d.ts +24 -0
- package/src/util/utf8.js +104 -0
- package/src/util.js +215 -213
- package/src/verifier.js +180 -177
- package/src/wrappers.js +103 -102
- package/src/writer.js +465 -465
- package/src/writer_buffer.js +85 -85
- package/tsconfig.json +8 -8
package/src/common.js
CHANGED
|
@@ -1,399 +1,399 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
module.exports = common;
|
|
3
|
-
|
|
4
|
-
var commonRe = /\/|\./;
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Provides common type definitions.
|
|
8
|
-
* Can also be used to provide additional google types or your own custom types.
|
|
9
|
-
* @param {string} name Short name as in `google/protobuf/[name].proto` or full file name
|
|
10
|
-
* @param {Object.<string,*>} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition
|
|
11
|
-
* @returns {undefined}
|
|
12
|
-
* @property {INamespace} google/protobuf/any.proto Any
|
|
13
|
-
* @property {INamespace} google/protobuf/duration.proto Duration
|
|
14
|
-
* @property {INamespace} google/protobuf/empty.proto Empty
|
|
15
|
-
* @property {INamespace} google/protobuf/field_mask.proto FieldMask
|
|
16
|
-
* @property {INamespace} google/protobuf/struct.proto Struct, Value, NullValue and ListValue
|
|
17
|
-
* @property {INamespace} google/protobuf/timestamp.proto Timestamp
|
|
18
|
-
* @property {INamespace} google/protobuf/wrappers.proto Wrappers
|
|
19
|
-
* @example
|
|
20
|
-
* // manually provides descriptor.proto (assumes google/protobuf/ namespace and .proto extension)
|
|
21
|
-
* protobuf.common("descriptor", descriptorJson);
|
|
22
|
-
*
|
|
23
|
-
* // manually provides a custom definition (uses my.foo namespace)
|
|
24
|
-
* protobuf.common("my/foo/bar.proto", myFooBarJson);
|
|
25
|
-
*/
|
|
26
|
-
function common(name, json) {
|
|
27
|
-
if (!commonRe.test(name)) {
|
|
28
|
-
name = "google/protobuf/" + name + ".proto";
|
|
29
|
-
json = { nested: { google: { nested: { protobuf: { nested: json } } } } };
|
|
30
|
-
}
|
|
31
|
-
common[name] = json;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// Not provided because of limited use (feel free to discuss or to provide yourself):
|
|
35
|
-
//
|
|
36
|
-
// google/protobuf/descriptor.proto
|
|
37
|
-
// google/protobuf/source_context.proto
|
|
38
|
-
// google/protobuf/type.proto
|
|
39
|
-
//
|
|
40
|
-
// Stripped and pre-parsed versions of these non-bundled files are instead available as part of
|
|
41
|
-
// the repository or package within the google/protobuf directory.
|
|
42
|
-
|
|
43
|
-
common("any", {
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Properties of a google.protobuf.Any message.
|
|
47
|
-
* @interface IAny
|
|
48
|
-
* @type {Object}
|
|
49
|
-
* @property {string} [typeUrl]
|
|
50
|
-
* @property {Uint8Array} [bytes]
|
|
51
|
-
* @memberof common
|
|
52
|
-
*/
|
|
53
|
-
Any: {
|
|
54
|
-
fields: {
|
|
55
|
-
type_url: {
|
|
56
|
-
type: "string",
|
|
57
|
-
id: 1
|
|
58
|
-
},
|
|
59
|
-
value: {
|
|
60
|
-
type: "bytes",
|
|
61
|
-
id: 2
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
var timeType;
|
|
68
|
-
|
|
69
|
-
common("duration", {
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Properties of a google.protobuf.Duration message.
|
|
73
|
-
* @interface IDuration
|
|
74
|
-
* @type {Object}
|
|
75
|
-
* @property {number|Long} [seconds]
|
|
76
|
-
* @property {number} [nanos]
|
|
77
|
-
* @memberof common
|
|
78
|
-
*/
|
|
79
|
-
Duration: timeType = {
|
|
80
|
-
fields: {
|
|
81
|
-
seconds: {
|
|
82
|
-
type: "int64",
|
|
83
|
-
id: 1
|
|
84
|
-
},
|
|
85
|
-
nanos: {
|
|
86
|
-
type: "int32",
|
|
87
|
-
id: 2
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
common("timestamp", {
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Properties of a google.protobuf.Timestamp message.
|
|
97
|
-
* @interface ITimestamp
|
|
98
|
-
* @type {Object}
|
|
99
|
-
* @property {number|Long} [seconds]
|
|
100
|
-
* @property {number} [nanos]
|
|
101
|
-
* @memberof common
|
|
102
|
-
*/
|
|
103
|
-
Timestamp: timeType
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
common("empty", {
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Properties of a google.protobuf.Empty message.
|
|
110
|
-
* @interface IEmpty
|
|
111
|
-
* @memberof common
|
|
112
|
-
*/
|
|
113
|
-
Empty: {
|
|
114
|
-
fields: {}
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
common("struct", {
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Properties of a google.protobuf.Struct message.
|
|
122
|
-
* @interface IStruct
|
|
123
|
-
* @type {Object}
|
|
124
|
-
* @property {Object.<string,IValue>} [fields]
|
|
125
|
-
* @memberof common
|
|
126
|
-
*/
|
|
127
|
-
Struct: {
|
|
128
|
-
fields: {
|
|
129
|
-
fields: {
|
|
130
|
-
keyType: "string",
|
|
131
|
-
type: "Value",
|
|
132
|
-
id: 1
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Properties of a google.protobuf.Value message.
|
|
139
|
-
* @interface IValue
|
|
140
|
-
* @type {Object}
|
|
141
|
-
* @property {string} [kind]
|
|
142
|
-
* @property {0} [nullValue]
|
|
143
|
-
* @property {number} [numberValue]
|
|
144
|
-
* @property {string} [stringValue]
|
|
145
|
-
* @property {boolean} [boolValue]
|
|
146
|
-
* @property {IStruct} [structValue]
|
|
147
|
-
* @property {IListValue} [listValue]
|
|
148
|
-
* @memberof common
|
|
149
|
-
*/
|
|
150
|
-
Value: {
|
|
151
|
-
oneofs: {
|
|
152
|
-
kind: {
|
|
153
|
-
oneof: [
|
|
154
|
-
"nullValue",
|
|
155
|
-
"numberValue",
|
|
156
|
-
"stringValue",
|
|
157
|
-
"boolValue",
|
|
158
|
-
"structValue",
|
|
159
|
-
"listValue"
|
|
160
|
-
]
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
fields: {
|
|
164
|
-
nullValue: {
|
|
165
|
-
type: "NullValue",
|
|
166
|
-
id: 1
|
|
167
|
-
},
|
|
168
|
-
numberValue: {
|
|
169
|
-
type: "double",
|
|
170
|
-
id: 2
|
|
171
|
-
},
|
|
172
|
-
stringValue: {
|
|
173
|
-
type: "string",
|
|
174
|
-
id: 3
|
|
175
|
-
},
|
|
176
|
-
boolValue: {
|
|
177
|
-
type: "bool",
|
|
178
|
-
id: 4
|
|
179
|
-
},
|
|
180
|
-
structValue: {
|
|
181
|
-
type: "Struct",
|
|
182
|
-
id: 5
|
|
183
|
-
},
|
|
184
|
-
listValue: {
|
|
185
|
-
type: "ListValue",
|
|
186
|
-
id: 6
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
|
|
191
|
-
NullValue: {
|
|
192
|
-
values: {
|
|
193
|
-
NULL_VALUE: 0
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* Properties of a google.protobuf.ListValue message.
|
|
199
|
-
* @interface IListValue
|
|
200
|
-
* @type {Object}
|
|
201
|
-
* @property {Array.<IValue>} [values]
|
|
202
|
-
* @memberof common
|
|
203
|
-
*/
|
|
204
|
-
ListValue: {
|
|
205
|
-
fields: {
|
|
206
|
-
values: {
|
|
207
|
-
rule: "repeated",
|
|
208
|
-
type: "Value",
|
|
209
|
-
id: 1
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
common("wrappers", {
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Properties of a google.protobuf.DoubleValue message.
|
|
219
|
-
* @interface IDoubleValue
|
|
220
|
-
* @type {Object}
|
|
221
|
-
* @property {number} [value]
|
|
222
|
-
* @memberof common
|
|
223
|
-
*/
|
|
224
|
-
DoubleValue: {
|
|
225
|
-
fields: {
|
|
226
|
-
value: {
|
|
227
|
-
type: "double",
|
|
228
|
-
id: 1
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
},
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* Properties of a google.protobuf.FloatValue message.
|
|
235
|
-
* @interface IFloatValue
|
|
236
|
-
* @type {Object}
|
|
237
|
-
* @property {number} [value]
|
|
238
|
-
* @memberof common
|
|
239
|
-
*/
|
|
240
|
-
FloatValue: {
|
|
241
|
-
fields: {
|
|
242
|
-
value: {
|
|
243
|
-
type: "float",
|
|
244
|
-
id: 1
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
},
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* Properties of a google.protobuf.Int64Value message.
|
|
251
|
-
* @interface IInt64Value
|
|
252
|
-
* @type {Object}
|
|
253
|
-
* @property {number|Long} [value]
|
|
254
|
-
* @memberof common
|
|
255
|
-
*/
|
|
256
|
-
Int64Value: {
|
|
257
|
-
fields: {
|
|
258
|
-
value: {
|
|
259
|
-
type: "int64",
|
|
260
|
-
id: 1
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
},
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
* Properties of a google.protobuf.UInt64Value message.
|
|
267
|
-
* @interface IUInt64Value
|
|
268
|
-
* @type {Object}
|
|
269
|
-
* @property {number|Long} [value]
|
|
270
|
-
* @memberof common
|
|
271
|
-
*/
|
|
272
|
-
UInt64Value: {
|
|
273
|
-
fields: {
|
|
274
|
-
value: {
|
|
275
|
-
type: "uint64",
|
|
276
|
-
id: 1
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
},
|
|
280
|
-
|
|
281
|
-
/**
|
|
282
|
-
* Properties of a google.protobuf.Int32Value message.
|
|
283
|
-
* @interface IInt32Value
|
|
284
|
-
* @type {Object}
|
|
285
|
-
* @property {number} [value]
|
|
286
|
-
* @memberof common
|
|
287
|
-
*/
|
|
288
|
-
Int32Value: {
|
|
289
|
-
fields: {
|
|
290
|
-
value: {
|
|
291
|
-
type: "int32",
|
|
292
|
-
id: 1
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
},
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* Properties of a google.protobuf.UInt32Value message.
|
|
299
|
-
* @interface IUInt32Value
|
|
300
|
-
* @type {Object}
|
|
301
|
-
* @property {number} [value]
|
|
302
|
-
* @memberof common
|
|
303
|
-
*/
|
|
304
|
-
UInt32Value: {
|
|
305
|
-
fields: {
|
|
306
|
-
value: {
|
|
307
|
-
type: "uint32",
|
|
308
|
-
id: 1
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
},
|
|
312
|
-
|
|
313
|
-
/**
|
|
314
|
-
* Properties of a google.protobuf.BoolValue message.
|
|
315
|
-
* @interface IBoolValue
|
|
316
|
-
* @type {Object}
|
|
317
|
-
* @property {boolean} [value]
|
|
318
|
-
* @memberof common
|
|
319
|
-
*/
|
|
320
|
-
BoolValue: {
|
|
321
|
-
fields: {
|
|
322
|
-
value: {
|
|
323
|
-
type: "bool",
|
|
324
|
-
id: 1
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
},
|
|
328
|
-
|
|
329
|
-
/**
|
|
330
|
-
* Properties of a google.protobuf.StringValue message.
|
|
331
|
-
* @interface IStringValue
|
|
332
|
-
* @type {Object}
|
|
333
|
-
* @property {string} [value]
|
|
334
|
-
* @memberof common
|
|
335
|
-
*/
|
|
336
|
-
StringValue: {
|
|
337
|
-
fields: {
|
|
338
|
-
value: {
|
|
339
|
-
type: "string",
|
|
340
|
-
id: 1
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
},
|
|
344
|
-
|
|
345
|
-
/**
|
|
346
|
-
* Properties of a google.protobuf.BytesValue message.
|
|
347
|
-
* @interface IBytesValue
|
|
348
|
-
* @type {Object}
|
|
349
|
-
* @property {Uint8Array} [value]
|
|
350
|
-
* @memberof common
|
|
351
|
-
*/
|
|
352
|
-
BytesValue: {
|
|
353
|
-
fields: {
|
|
354
|
-
value: {
|
|
355
|
-
type: "bytes",
|
|
356
|
-
id: 1
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
});
|
|
361
|
-
|
|
362
|
-
common("field_mask", {
|
|
363
|
-
|
|
364
|
-
/**
|
|
365
|
-
* Properties of a google.protobuf.FieldMask message.
|
|
366
|
-
* @interface IDoubleValue
|
|
367
|
-
* @type {Object}
|
|
368
|
-
* @property {number} [value]
|
|
369
|
-
* @memberof common
|
|
370
|
-
*/
|
|
371
|
-
FieldMask: {
|
|
372
|
-
fields: {
|
|
373
|
-
paths: {
|
|
374
|
-
rule: "repeated",
|
|
375
|
-
type: "string",
|
|
376
|
-
id: 1
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
});
|
|
381
|
-
|
|
382
|
-
/**
|
|
383
|
-
* Gets the root definition of the specified common proto file.
|
|
384
|
-
*
|
|
385
|
-
* Bundled definitions are:
|
|
386
|
-
* - google/protobuf/any.proto
|
|
387
|
-
* - google/protobuf/duration.proto
|
|
388
|
-
* - google/protobuf/empty.proto
|
|
389
|
-
* - google/protobuf/field_mask.proto
|
|
390
|
-
* - google/protobuf/struct.proto
|
|
391
|
-
* - google/protobuf/timestamp.proto
|
|
392
|
-
* - google/protobuf/wrappers.proto
|
|
393
|
-
*
|
|
394
|
-
* @param {string} file Proto file name
|
|
395
|
-
* @returns {INamespace|null} Root definition or `null` if not defined
|
|
396
|
-
*/
|
|
397
|
-
common.get = function get(file) {
|
|
398
|
-
return common[file] || null;
|
|
399
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
module.exports = common;
|
|
3
|
+
|
|
4
|
+
var commonRe = /\/|\./;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Provides common type definitions.
|
|
8
|
+
* Can also be used to provide additional google types or your own custom types.
|
|
9
|
+
* @param {string} name Short name as in `google/protobuf/[name].proto` or full file name
|
|
10
|
+
* @param {Object.<string,*>} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition
|
|
11
|
+
* @returns {undefined}
|
|
12
|
+
* @property {INamespace} google/protobuf/any.proto Any
|
|
13
|
+
* @property {INamespace} google/protobuf/duration.proto Duration
|
|
14
|
+
* @property {INamespace} google/protobuf/empty.proto Empty
|
|
15
|
+
* @property {INamespace} google/protobuf/field_mask.proto FieldMask
|
|
16
|
+
* @property {INamespace} google/protobuf/struct.proto Struct, Value, NullValue and ListValue
|
|
17
|
+
* @property {INamespace} google/protobuf/timestamp.proto Timestamp
|
|
18
|
+
* @property {INamespace} google/protobuf/wrappers.proto Wrappers
|
|
19
|
+
* @example
|
|
20
|
+
* // manually provides descriptor.proto (assumes google/protobuf/ namespace and .proto extension)
|
|
21
|
+
* protobuf.common("descriptor", descriptorJson);
|
|
22
|
+
*
|
|
23
|
+
* // manually provides a custom definition (uses my.foo namespace)
|
|
24
|
+
* protobuf.common("my/foo/bar.proto", myFooBarJson);
|
|
25
|
+
*/
|
|
26
|
+
function common(name, json) {
|
|
27
|
+
if (!commonRe.test(name)) {
|
|
28
|
+
name = "google/protobuf/" + name + ".proto";
|
|
29
|
+
json = { nested: { google: { nested: { protobuf: { nested: json } } } } };
|
|
30
|
+
}
|
|
31
|
+
common[name] = json;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Not provided because of limited use (feel free to discuss or to provide yourself):
|
|
35
|
+
//
|
|
36
|
+
// google/protobuf/descriptor.proto
|
|
37
|
+
// google/protobuf/source_context.proto
|
|
38
|
+
// google/protobuf/type.proto
|
|
39
|
+
//
|
|
40
|
+
// Stripped and pre-parsed versions of these non-bundled files are instead available as part of
|
|
41
|
+
// the repository or package within the google/protobuf directory.
|
|
42
|
+
|
|
43
|
+
common("any", {
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Properties of a google.protobuf.Any message.
|
|
47
|
+
* @interface IAny
|
|
48
|
+
* @type {Object}
|
|
49
|
+
* @property {string} [typeUrl]
|
|
50
|
+
* @property {Uint8Array} [bytes]
|
|
51
|
+
* @memberof common
|
|
52
|
+
*/
|
|
53
|
+
Any: {
|
|
54
|
+
fields: {
|
|
55
|
+
type_url: {
|
|
56
|
+
type: "string",
|
|
57
|
+
id: 1
|
|
58
|
+
},
|
|
59
|
+
value: {
|
|
60
|
+
type: "bytes",
|
|
61
|
+
id: 2
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
var timeType;
|
|
68
|
+
|
|
69
|
+
common("duration", {
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Properties of a google.protobuf.Duration message.
|
|
73
|
+
* @interface IDuration
|
|
74
|
+
* @type {Object}
|
|
75
|
+
* @property {number|Long} [seconds]
|
|
76
|
+
* @property {number} [nanos]
|
|
77
|
+
* @memberof common
|
|
78
|
+
*/
|
|
79
|
+
Duration: timeType = {
|
|
80
|
+
fields: {
|
|
81
|
+
seconds: {
|
|
82
|
+
type: "int64",
|
|
83
|
+
id: 1
|
|
84
|
+
},
|
|
85
|
+
nanos: {
|
|
86
|
+
type: "int32",
|
|
87
|
+
id: 2
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
common("timestamp", {
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Properties of a google.protobuf.Timestamp message.
|
|
97
|
+
* @interface ITimestamp
|
|
98
|
+
* @type {Object}
|
|
99
|
+
* @property {number|Long} [seconds]
|
|
100
|
+
* @property {number} [nanos]
|
|
101
|
+
* @memberof common
|
|
102
|
+
*/
|
|
103
|
+
Timestamp: timeType
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
common("empty", {
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Properties of a google.protobuf.Empty message.
|
|
110
|
+
* @interface IEmpty
|
|
111
|
+
* @memberof common
|
|
112
|
+
*/
|
|
113
|
+
Empty: {
|
|
114
|
+
fields: {}
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
common("struct", {
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Properties of a google.protobuf.Struct message.
|
|
122
|
+
* @interface IStruct
|
|
123
|
+
* @type {Object}
|
|
124
|
+
* @property {Object.<string,IValue>} [fields]
|
|
125
|
+
* @memberof common
|
|
126
|
+
*/
|
|
127
|
+
Struct: {
|
|
128
|
+
fields: {
|
|
129
|
+
fields: {
|
|
130
|
+
keyType: "string",
|
|
131
|
+
type: "Value",
|
|
132
|
+
id: 1
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Properties of a google.protobuf.Value message.
|
|
139
|
+
* @interface IValue
|
|
140
|
+
* @type {Object}
|
|
141
|
+
* @property {string} [kind]
|
|
142
|
+
* @property {0} [nullValue]
|
|
143
|
+
* @property {number} [numberValue]
|
|
144
|
+
* @property {string} [stringValue]
|
|
145
|
+
* @property {boolean} [boolValue]
|
|
146
|
+
* @property {IStruct} [structValue]
|
|
147
|
+
* @property {IListValue} [listValue]
|
|
148
|
+
* @memberof common
|
|
149
|
+
*/
|
|
150
|
+
Value: {
|
|
151
|
+
oneofs: {
|
|
152
|
+
kind: {
|
|
153
|
+
oneof: [
|
|
154
|
+
"nullValue",
|
|
155
|
+
"numberValue",
|
|
156
|
+
"stringValue",
|
|
157
|
+
"boolValue",
|
|
158
|
+
"structValue",
|
|
159
|
+
"listValue"
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
fields: {
|
|
164
|
+
nullValue: {
|
|
165
|
+
type: "NullValue",
|
|
166
|
+
id: 1
|
|
167
|
+
},
|
|
168
|
+
numberValue: {
|
|
169
|
+
type: "double",
|
|
170
|
+
id: 2
|
|
171
|
+
},
|
|
172
|
+
stringValue: {
|
|
173
|
+
type: "string",
|
|
174
|
+
id: 3
|
|
175
|
+
},
|
|
176
|
+
boolValue: {
|
|
177
|
+
type: "bool",
|
|
178
|
+
id: 4
|
|
179
|
+
},
|
|
180
|
+
structValue: {
|
|
181
|
+
type: "Struct",
|
|
182
|
+
id: 5
|
|
183
|
+
},
|
|
184
|
+
listValue: {
|
|
185
|
+
type: "ListValue",
|
|
186
|
+
id: 6
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
|
|
191
|
+
NullValue: {
|
|
192
|
+
values: {
|
|
193
|
+
NULL_VALUE: 0
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Properties of a google.protobuf.ListValue message.
|
|
199
|
+
* @interface IListValue
|
|
200
|
+
* @type {Object}
|
|
201
|
+
* @property {Array.<IValue>} [values]
|
|
202
|
+
* @memberof common
|
|
203
|
+
*/
|
|
204
|
+
ListValue: {
|
|
205
|
+
fields: {
|
|
206
|
+
values: {
|
|
207
|
+
rule: "repeated",
|
|
208
|
+
type: "Value",
|
|
209
|
+
id: 1
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
common("wrappers", {
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Properties of a google.protobuf.DoubleValue message.
|
|
219
|
+
* @interface IDoubleValue
|
|
220
|
+
* @type {Object}
|
|
221
|
+
* @property {number} [value]
|
|
222
|
+
* @memberof common
|
|
223
|
+
*/
|
|
224
|
+
DoubleValue: {
|
|
225
|
+
fields: {
|
|
226
|
+
value: {
|
|
227
|
+
type: "double",
|
|
228
|
+
id: 1
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Properties of a google.protobuf.FloatValue message.
|
|
235
|
+
* @interface IFloatValue
|
|
236
|
+
* @type {Object}
|
|
237
|
+
* @property {number} [value]
|
|
238
|
+
* @memberof common
|
|
239
|
+
*/
|
|
240
|
+
FloatValue: {
|
|
241
|
+
fields: {
|
|
242
|
+
value: {
|
|
243
|
+
type: "float",
|
|
244
|
+
id: 1
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Properties of a google.protobuf.Int64Value message.
|
|
251
|
+
* @interface IInt64Value
|
|
252
|
+
* @type {Object}
|
|
253
|
+
* @property {number|Long} [value]
|
|
254
|
+
* @memberof common
|
|
255
|
+
*/
|
|
256
|
+
Int64Value: {
|
|
257
|
+
fields: {
|
|
258
|
+
value: {
|
|
259
|
+
type: "int64",
|
|
260
|
+
id: 1
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Properties of a google.protobuf.UInt64Value message.
|
|
267
|
+
* @interface IUInt64Value
|
|
268
|
+
* @type {Object}
|
|
269
|
+
* @property {number|Long} [value]
|
|
270
|
+
* @memberof common
|
|
271
|
+
*/
|
|
272
|
+
UInt64Value: {
|
|
273
|
+
fields: {
|
|
274
|
+
value: {
|
|
275
|
+
type: "uint64",
|
|
276
|
+
id: 1
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Properties of a google.protobuf.Int32Value message.
|
|
283
|
+
* @interface IInt32Value
|
|
284
|
+
* @type {Object}
|
|
285
|
+
* @property {number} [value]
|
|
286
|
+
* @memberof common
|
|
287
|
+
*/
|
|
288
|
+
Int32Value: {
|
|
289
|
+
fields: {
|
|
290
|
+
value: {
|
|
291
|
+
type: "int32",
|
|
292
|
+
id: 1
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Properties of a google.protobuf.UInt32Value message.
|
|
299
|
+
* @interface IUInt32Value
|
|
300
|
+
* @type {Object}
|
|
301
|
+
* @property {number} [value]
|
|
302
|
+
* @memberof common
|
|
303
|
+
*/
|
|
304
|
+
UInt32Value: {
|
|
305
|
+
fields: {
|
|
306
|
+
value: {
|
|
307
|
+
type: "uint32",
|
|
308
|
+
id: 1
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Properties of a google.protobuf.BoolValue message.
|
|
315
|
+
* @interface IBoolValue
|
|
316
|
+
* @type {Object}
|
|
317
|
+
* @property {boolean} [value]
|
|
318
|
+
* @memberof common
|
|
319
|
+
*/
|
|
320
|
+
BoolValue: {
|
|
321
|
+
fields: {
|
|
322
|
+
value: {
|
|
323
|
+
type: "bool",
|
|
324
|
+
id: 1
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Properties of a google.protobuf.StringValue message.
|
|
331
|
+
* @interface IStringValue
|
|
332
|
+
* @type {Object}
|
|
333
|
+
* @property {string} [value]
|
|
334
|
+
* @memberof common
|
|
335
|
+
*/
|
|
336
|
+
StringValue: {
|
|
337
|
+
fields: {
|
|
338
|
+
value: {
|
|
339
|
+
type: "string",
|
|
340
|
+
id: 1
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Properties of a google.protobuf.BytesValue message.
|
|
347
|
+
* @interface IBytesValue
|
|
348
|
+
* @type {Object}
|
|
349
|
+
* @property {Uint8Array} [value]
|
|
350
|
+
* @memberof common
|
|
351
|
+
*/
|
|
352
|
+
BytesValue: {
|
|
353
|
+
fields: {
|
|
354
|
+
value: {
|
|
355
|
+
type: "bytes",
|
|
356
|
+
id: 1
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
|
|
362
|
+
common("field_mask", {
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Properties of a google.protobuf.FieldMask message.
|
|
366
|
+
* @interface IDoubleValue
|
|
367
|
+
* @type {Object}
|
|
368
|
+
* @property {number} [value]
|
|
369
|
+
* @memberof common
|
|
370
|
+
*/
|
|
371
|
+
FieldMask: {
|
|
372
|
+
fields: {
|
|
373
|
+
paths: {
|
|
374
|
+
rule: "repeated",
|
|
375
|
+
type: "string",
|
|
376
|
+
id: 1
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Gets the root definition of the specified common proto file.
|
|
384
|
+
*
|
|
385
|
+
* Bundled definitions are:
|
|
386
|
+
* - google/protobuf/any.proto
|
|
387
|
+
* - google/protobuf/duration.proto
|
|
388
|
+
* - google/protobuf/empty.proto
|
|
389
|
+
* - google/protobuf/field_mask.proto
|
|
390
|
+
* - google/protobuf/struct.proto
|
|
391
|
+
* - google/protobuf/timestamp.proto
|
|
392
|
+
* - google/protobuf/wrappers.proto
|
|
393
|
+
*
|
|
394
|
+
* @param {string} file Proto file name
|
|
395
|
+
* @returns {INamespace|null} Root definition or `null` if not defined
|
|
396
|
+
*/
|
|
397
|
+
common.get = function get(file) {
|
|
398
|
+
return common[file] || null;
|
|
399
|
+
};
|