@bufbuild/protobuf 1.2.0 → 1.2.1
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/cjs/google/protobuf/any_pb.js +4 -4
- package/dist/cjs/google/protobuf/api_pb.js +4 -4
- package/dist/cjs/google/protobuf/compiler/plugin_pb.js +4 -4
- package/dist/cjs/google/protobuf/descriptor_pb.js +106 -28
- package/dist/cjs/google/protobuf/duration_pb.js +1 -1
- package/dist/cjs/google/protobuf/empty_pb.js +1 -1
- package/dist/cjs/google/protobuf/field_mask_pb.js +2 -2
- package/dist/cjs/google/protobuf/source_context_pb.js +1 -1
- package/dist/cjs/google/protobuf/struct_pb.js +5 -5
- package/dist/cjs/google/protobuf/timestamp_pb.js +2 -2
- package/dist/cjs/google/protobuf/type_pb.js +27 -6
- package/dist/cjs/google/protobuf/wrappers_pb.js +9 -9
- package/dist/cjs/index.js +0 -3
- package/dist/cjs/private/binary-format-common.js +44 -6
- package/dist/cjs/proto-base64.js +2 -10
- package/dist/esm/create-descriptor-set.js +1 -1
- package/dist/esm/google/protobuf/any_pb.js +5 -4
- package/dist/esm/google/protobuf/api_pb.js +7 -4
- package/dist/esm/google/protobuf/compiler/plugin_pb.js +8 -4
- package/dist/esm/google/protobuf/descriptor_pb.js +132 -27
- package/dist/esm/google/protobuf/duration_pb.js +2 -1
- package/dist/esm/google/protobuf/empty_pb.js +2 -1
- package/dist/esm/google/protobuf/field_mask_pb.js +3 -2
- package/dist/esm/google/protobuf/source_context_pb.js +2 -1
- package/dist/esm/google/protobuf/struct_pb.js +8 -5
- package/dist/esm/google/protobuf/timestamp_pb.js +3 -2
- package/dist/esm/google/protobuf/type_pb.js +32 -6
- package/dist/esm/google/protobuf/wrappers_pb.js +18 -9
- package/dist/esm/index.js +1 -4
- package/dist/esm/private/binary-format-common.js +45 -7
- package/dist/esm/private/message-type.js +1 -1
- package/dist/esm/private/util-common.js +1 -1
- package/dist/esm/proto-base64.js +2 -10
- package/dist/types/google/protobuf/any_pb.d.ts +3 -3
- package/dist/types/google/protobuf/api_pb.d.ts +1 -1
- package/dist/types/google/protobuf/descriptor_pb.d.ts +107 -3
- package/dist/types/google/protobuf/struct_pb.d.ts +1 -1
- package/dist/types/google/protobuf/timestamp_pb.d.ts +1 -1
- package/dist/types/google/protobuf/type_pb.d.ts +19 -1
- package/dist/types/index.d.ts +5 -4
- package/dist/types/private/binary-format-common.d.ts +3 -2
- package/dist/types/private/json-format-common.d.ts +2 -1
- package/dist/types/private/message-type.d.ts +2 -1
- package/dist/types/private/scalars.d.ts +2 -1
- package/dist/types/proto-base64.d.ts +1 -9
- package/package.json +2 -2
|
@@ -102,13 +102,13 @@ import { proto3 } from "../../proto3.js";
|
|
|
102
102
|
* [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
|
103
103
|
* the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
|
104
104
|
* the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
|
105
|
-
* http://
|
|
105
|
+
* http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
|
|
106
106
|
* ) to obtain a formatter capable of generating timestamps in this format.
|
|
107
107
|
*
|
|
108
108
|
*
|
|
109
109
|
* @generated from message google.protobuf.Timestamp
|
|
110
110
|
*/
|
|
111
|
-
|
|
111
|
+
class Timestamp extends Message {
|
|
112
112
|
constructor(data) {
|
|
113
113
|
super();
|
|
114
114
|
/**
|
|
@@ -207,3 +207,4 @@ Timestamp.fields = proto3.util.newFieldList(() => [
|
|
|
207
207
|
{ no: 1, name: "seconds", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
|
|
208
208
|
{ no: 2, name: "nanos", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
|
|
209
209
|
]);
|
|
210
|
+
export { Timestamp };
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
|
-
// @generated by protoc-gen-es v1.2.
|
|
14
|
+
// @generated by protoc-gen-es v1.2.1 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
|
|
15
15
|
// @generated from file google/protobuf/type.proto (package google.protobuf, syntax proto3)
|
|
16
16
|
/* eslint-disable */
|
|
17
17
|
import { proto3 } from "../../proto3.js";
|
|
@@ -37,18 +37,25 @@ export var Syntax;
|
|
|
37
37
|
* @generated from enum value: SYNTAX_PROTO3 = 1;
|
|
38
38
|
*/
|
|
39
39
|
Syntax[Syntax["PROTO3"] = 1] = "PROTO3";
|
|
40
|
+
/**
|
|
41
|
+
* Syntax `editions`.
|
|
42
|
+
*
|
|
43
|
+
* @generated from enum value: SYNTAX_EDITIONS = 2;
|
|
44
|
+
*/
|
|
45
|
+
Syntax[Syntax["EDITIONS"] = 2] = "EDITIONS";
|
|
40
46
|
})(Syntax || (Syntax = {}));
|
|
41
47
|
// Retrieve enum metadata with: proto3.getEnumType(Syntax)
|
|
42
48
|
proto3.util.setEnumType(Syntax, "google.protobuf.Syntax", [
|
|
43
49
|
{ no: 0, name: "SYNTAX_PROTO2" },
|
|
44
50
|
{ no: 1, name: "SYNTAX_PROTO3" },
|
|
51
|
+
{ no: 2, name: "SYNTAX_EDITIONS" },
|
|
45
52
|
]);
|
|
46
53
|
/**
|
|
47
54
|
* A protocol buffer message type.
|
|
48
55
|
*
|
|
49
56
|
* @generated from message google.protobuf.Type
|
|
50
57
|
*/
|
|
51
|
-
|
|
58
|
+
class Type extends Message {
|
|
52
59
|
constructor(data) {
|
|
53
60
|
super();
|
|
54
61
|
/**
|
|
@@ -81,6 +88,12 @@ export class Type extends Message {
|
|
|
81
88
|
* @generated from field: google.protobuf.Syntax syntax = 6;
|
|
82
89
|
*/
|
|
83
90
|
this.syntax = Syntax.PROTO2;
|
|
91
|
+
/**
|
|
92
|
+
* The source edition string, only valid when syntax is SYNTAX_EDITIONS.
|
|
93
|
+
*
|
|
94
|
+
* @generated from field: string edition = 7;
|
|
95
|
+
*/
|
|
96
|
+
this.edition = "";
|
|
84
97
|
proto3.util.initPartial(data, this);
|
|
85
98
|
}
|
|
86
99
|
static fromBinary(bytes, options) {
|
|
@@ -105,13 +118,15 @@ Type.fields = proto3.util.newFieldList(() => [
|
|
|
105
118
|
{ no: 4, name: "options", kind: "message", T: Option, repeated: true },
|
|
106
119
|
{ no: 5, name: "source_context", kind: "message", T: SourceContext },
|
|
107
120
|
{ no: 6, name: "syntax", kind: "enum", T: proto3.getEnumType(Syntax) },
|
|
121
|
+
{ no: 7, name: "edition", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
108
122
|
]);
|
|
123
|
+
export { Type };
|
|
109
124
|
/**
|
|
110
125
|
* A single field of a message type.
|
|
111
126
|
*
|
|
112
127
|
* @generated from message google.protobuf.Field
|
|
113
128
|
*/
|
|
114
|
-
|
|
129
|
+
class Field extends Message {
|
|
115
130
|
constructor(data) {
|
|
116
131
|
super();
|
|
117
132
|
/**
|
|
@@ -205,6 +220,7 @@ Field.fields = proto3.util.newFieldList(() => [
|
|
|
205
220
|
{ no: 10, name: "json_name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
206
221
|
{ no: 11, name: "default_value", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
207
222
|
]);
|
|
223
|
+
export { Field };
|
|
208
224
|
/**
|
|
209
225
|
* Basic field types.
|
|
210
226
|
*
|
|
@@ -393,7 +409,7 @@ proto3.util.setEnumType(Field_Cardinality, "google.protobuf.Field.Cardinality",
|
|
|
393
409
|
*
|
|
394
410
|
* @generated from message google.protobuf.Enum
|
|
395
411
|
*/
|
|
396
|
-
|
|
412
|
+
class Enum extends Message {
|
|
397
413
|
constructor(data) {
|
|
398
414
|
super();
|
|
399
415
|
/**
|
|
@@ -420,6 +436,12 @@ export class Enum extends Message {
|
|
|
420
436
|
* @generated from field: google.protobuf.Syntax syntax = 5;
|
|
421
437
|
*/
|
|
422
438
|
this.syntax = Syntax.PROTO2;
|
|
439
|
+
/**
|
|
440
|
+
* The source edition string, only valid when syntax is SYNTAX_EDITIONS.
|
|
441
|
+
*
|
|
442
|
+
* @generated from field: string edition = 6;
|
|
443
|
+
*/
|
|
444
|
+
this.edition = "";
|
|
423
445
|
proto3.util.initPartial(data, this);
|
|
424
446
|
}
|
|
425
447
|
static fromBinary(bytes, options) {
|
|
@@ -443,13 +465,15 @@ Enum.fields = proto3.util.newFieldList(() => [
|
|
|
443
465
|
{ no: 3, name: "options", kind: "message", T: Option, repeated: true },
|
|
444
466
|
{ no: 4, name: "source_context", kind: "message", T: SourceContext },
|
|
445
467
|
{ no: 5, name: "syntax", kind: "enum", T: proto3.getEnumType(Syntax) },
|
|
468
|
+
{ no: 6, name: "edition", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
446
469
|
]);
|
|
470
|
+
export { Enum };
|
|
447
471
|
/**
|
|
448
472
|
* Enum value definition.
|
|
449
473
|
*
|
|
450
474
|
* @generated from message google.protobuf.EnumValue
|
|
451
475
|
*/
|
|
452
|
-
|
|
476
|
+
class EnumValue extends Message {
|
|
453
477
|
constructor(data) {
|
|
454
478
|
super();
|
|
455
479
|
/**
|
|
@@ -492,13 +516,14 @@ EnumValue.fields = proto3.util.newFieldList(() => [
|
|
|
492
516
|
{ no: 2, name: "number", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
|
|
493
517
|
{ no: 3, name: "options", kind: "message", T: Option, repeated: true },
|
|
494
518
|
]);
|
|
519
|
+
export { EnumValue };
|
|
495
520
|
/**
|
|
496
521
|
* A protocol buffer option, which can be attached to a message, field,
|
|
497
522
|
* enumeration, etc.
|
|
498
523
|
*
|
|
499
524
|
* @generated from message google.protobuf.Option
|
|
500
525
|
*/
|
|
501
|
-
|
|
526
|
+
class Option extends Message {
|
|
502
527
|
constructor(data) {
|
|
503
528
|
super();
|
|
504
529
|
/**
|
|
@@ -531,3 +556,4 @@ Option.fields = proto3.util.newFieldList(() => [
|
|
|
531
556
|
{ no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
532
557
|
{ no: 2, name: "value", kind: "message", T: Any },
|
|
533
558
|
]);
|
|
559
|
+
export { Option };
|
|
@@ -22,7 +22,7 @@ import { protoInt64 } from "../../proto-int64.js";
|
|
|
22
22
|
*
|
|
23
23
|
* @generated from message google.protobuf.DoubleValue
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
class DoubleValue extends Message {
|
|
26
26
|
constructor(data) {
|
|
27
27
|
super();
|
|
28
28
|
/**
|
|
@@ -75,6 +75,7 @@ DoubleValue.fieldWrapper = {
|
|
|
75
75
|
return value.value;
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
|
+
export { DoubleValue };
|
|
78
79
|
/**
|
|
79
80
|
* Wrapper message for `float`.
|
|
80
81
|
*
|
|
@@ -82,7 +83,7 @@ DoubleValue.fieldWrapper = {
|
|
|
82
83
|
*
|
|
83
84
|
* @generated from message google.protobuf.FloatValue
|
|
84
85
|
*/
|
|
85
|
-
|
|
86
|
+
class FloatValue extends Message {
|
|
86
87
|
constructor(data) {
|
|
87
88
|
super();
|
|
88
89
|
/**
|
|
@@ -135,6 +136,7 @@ FloatValue.fieldWrapper = {
|
|
|
135
136
|
return value.value;
|
|
136
137
|
}
|
|
137
138
|
};
|
|
139
|
+
export { FloatValue };
|
|
138
140
|
/**
|
|
139
141
|
* Wrapper message for `int64`.
|
|
140
142
|
*
|
|
@@ -142,7 +144,7 @@ FloatValue.fieldWrapper = {
|
|
|
142
144
|
*
|
|
143
145
|
* @generated from message google.protobuf.Int64Value
|
|
144
146
|
*/
|
|
145
|
-
|
|
147
|
+
class Int64Value extends Message {
|
|
146
148
|
constructor(data) {
|
|
147
149
|
super();
|
|
148
150
|
/**
|
|
@@ -195,6 +197,7 @@ Int64Value.fieldWrapper = {
|
|
|
195
197
|
return value.value;
|
|
196
198
|
}
|
|
197
199
|
};
|
|
200
|
+
export { Int64Value };
|
|
198
201
|
/**
|
|
199
202
|
* Wrapper message for `uint64`.
|
|
200
203
|
*
|
|
@@ -202,7 +205,7 @@ Int64Value.fieldWrapper = {
|
|
|
202
205
|
*
|
|
203
206
|
* @generated from message google.protobuf.UInt64Value
|
|
204
207
|
*/
|
|
205
|
-
|
|
208
|
+
class UInt64Value extends Message {
|
|
206
209
|
constructor(data) {
|
|
207
210
|
super();
|
|
208
211
|
/**
|
|
@@ -255,6 +258,7 @@ UInt64Value.fieldWrapper = {
|
|
|
255
258
|
return value.value;
|
|
256
259
|
}
|
|
257
260
|
};
|
|
261
|
+
export { UInt64Value };
|
|
258
262
|
/**
|
|
259
263
|
* Wrapper message for `int32`.
|
|
260
264
|
*
|
|
@@ -262,7 +266,7 @@ UInt64Value.fieldWrapper = {
|
|
|
262
266
|
*
|
|
263
267
|
* @generated from message google.protobuf.Int32Value
|
|
264
268
|
*/
|
|
265
|
-
|
|
269
|
+
class Int32Value extends Message {
|
|
266
270
|
constructor(data) {
|
|
267
271
|
super();
|
|
268
272
|
/**
|
|
@@ -315,6 +319,7 @@ Int32Value.fieldWrapper = {
|
|
|
315
319
|
return value.value;
|
|
316
320
|
}
|
|
317
321
|
};
|
|
322
|
+
export { Int32Value };
|
|
318
323
|
/**
|
|
319
324
|
* Wrapper message for `uint32`.
|
|
320
325
|
*
|
|
@@ -322,7 +327,7 @@ Int32Value.fieldWrapper = {
|
|
|
322
327
|
*
|
|
323
328
|
* @generated from message google.protobuf.UInt32Value
|
|
324
329
|
*/
|
|
325
|
-
|
|
330
|
+
class UInt32Value extends Message {
|
|
326
331
|
constructor(data) {
|
|
327
332
|
super();
|
|
328
333
|
/**
|
|
@@ -375,6 +380,7 @@ UInt32Value.fieldWrapper = {
|
|
|
375
380
|
return value.value;
|
|
376
381
|
}
|
|
377
382
|
};
|
|
383
|
+
export { UInt32Value };
|
|
378
384
|
/**
|
|
379
385
|
* Wrapper message for `bool`.
|
|
380
386
|
*
|
|
@@ -382,7 +388,7 @@ UInt32Value.fieldWrapper = {
|
|
|
382
388
|
*
|
|
383
389
|
* @generated from message google.protobuf.BoolValue
|
|
384
390
|
*/
|
|
385
|
-
|
|
391
|
+
class BoolValue extends Message {
|
|
386
392
|
constructor(data) {
|
|
387
393
|
super();
|
|
388
394
|
/**
|
|
@@ -435,6 +441,7 @@ BoolValue.fieldWrapper = {
|
|
|
435
441
|
return value.value;
|
|
436
442
|
}
|
|
437
443
|
};
|
|
444
|
+
export { BoolValue };
|
|
438
445
|
/**
|
|
439
446
|
* Wrapper message for `string`.
|
|
440
447
|
*
|
|
@@ -442,7 +449,7 @@ BoolValue.fieldWrapper = {
|
|
|
442
449
|
*
|
|
443
450
|
* @generated from message google.protobuf.StringValue
|
|
444
451
|
*/
|
|
445
|
-
|
|
452
|
+
class StringValue extends Message {
|
|
446
453
|
constructor(data) {
|
|
447
454
|
super();
|
|
448
455
|
/**
|
|
@@ -495,6 +502,7 @@ StringValue.fieldWrapper = {
|
|
|
495
502
|
return value.value;
|
|
496
503
|
}
|
|
497
504
|
};
|
|
505
|
+
export { StringValue };
|
|
498
506
|
/**
|
|
499
507
|
* Wrapper message for `bytes`.
|
|
500
508
|
*
|
|
@@ -502,7 +510,7 @@ StringValue.fieldWrapper = {
|
|
|
502
510
|
*
|
|
503
511
|
* @generated from message google.protobuf.BytesValue
|
|
504
512
|
*/
|
|
505
|
-
|
|
513
|
+
class BytesValue extends Message {
|
|
506
514
|
constructor(data) {
|
|
507
515
|
super();
|
|
508
516
|
/**
|
|
@@ -555,3 +563,4 @@ BytesValue.fieldWrapper = {
|
|
|
555
563
|
return value.value;
|
|
556
564
|
}
|
|
557
565
|
};
|
|
566
|
+
export { BytesValue };
|
package/dist/esm/index.js
CHANGED
|
@@ -17,14 +17,11 @@ export { protoInt64 } from "./proto-int64.js";
|
|
|
17
17
|
export { protoBase64 } from "./proto-base64.js";
|
|
18
18
|
export { protoDelimited } from "./proto-delimited.js";
|
|
19
19
|
export { codegenInfo } from "./codegen-info.js";
|
|
20
|
-
export { Message
|
|
20
|
+
export { Message } from "./message.js";
|
|
21
21
|
export { ScalarType } from "./field.js";
|
|
22
22
|
export { MethodKind, MethodIdempotency } from "./service-type.js";
|
|
23
23
|
export { WireType, BinaryWriter, BinaryReader } from "./binary-encoding.js";
|
|
24
|
-
export {} from "./json-format.js";
|
|
25
|
-
export {} from "./descriptor-set.js";
|
|
26
24
|
export { createDescriptorSet } from "./create-descriptor-set.js";
|
|
27
|
-
export {} from "./type-registry.js";
|
|
28
25
|
export { createRegistry } from "./create-registry.js";
|
|
29
26
|
export { createRegistryFromDescriptors } from "./create-registry-from-desc.js";
|
|
30
27
|
// ideally, we would export these types with sub-path exports:
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
|
-
import { BinaryReader, BinaryWriter, WireType
|
|
14
|
+
import { BinaryReader, BinaryWriter, WireType } from "../binary-encoding.js";
|
|
15
15
|
import { Message } from "../message.js";
|
|
16
16
|
import { ScalarType } from "../field.js";
|
|
17
17
|
import { wrapField } from "./field-wrapper.js";
|
|
@@ -109,14 +109,14 @@ export function makeBinaryFormatCommon() {
|
|
|
109
109
|
const messageType = field.T;
|
|
110
110
|
if (repeated) {
|
|
111
111
|
// safe to assume presence of array, oneof cannot contain repeated values
|
|
112
|
-
target[localName].push(
|
|
112
|
+
target[localName].push(readMessageField(reader, new messageType(), options));
|
|
113
113
|
}
|
|
114
114
|
else {
|
|
115
115
|
if (target[localName] instanceof Message) {
|
|
116
|
-
target[localName]
|
|
116
|
+
readMessageField(reader, target[localName], options);
|
|
117
117
|
}
|
|
118
118
|
else {
|
|
119
|
-
target[localName] =
|
|
119
|
+
target[localName] = readMessageField(reader, new messageType(), options);
|
|
120
120
|
if (messageType.fieldWrapper &&
|
|
121
121
|
!field.oneof &&
|
|
122
122
|
!field.repeated) {
|
|
@@ -135,6 +135,13 @@ export function makeBinaryFormatCommon() {
|
|
|
135
135
|
},
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
|
+
// Read a message, avoiding MessageType.fromBinary() to re-use the
|
|
139
|
+
// BinaryReadOptions and the IBinaryReader.
|
|
140
|
+
function readMessageField(reader, message, options) {
|
|
141
|
+
const format = message.getType().runtime.bin;
|
|
142
|
+
format.readMessage(message, reader, reader.uint32(), options);
|
|
143
|
+
return message;
|
|
144
|
+
}
|
|
138
145
|
// Read a map field, expecting key field = 1, value field = 2
|
|
139
146
|
function readMapEntry(field, reader, options) {
|
|
140
147
|
const length = reader.uint32(), end = reader.pos + length;
|
|
@@ -154,7 +161,7 @@ function readMapEntry(field, reader, options) {
|
|
|
154
161
|
val = reader.int32();
|
|
155
162
|
break;
|
|
156
163
|
case "message":
|
|
157
|
-
val = field.V.T
|
|
164
|
+
val = readMessageField(reader, new field.V.T(), options);
|
|
158
165
|
break;
|
|
159
166
|
}
|
|
160
167
|
break;
|
|
@@ -185,9 +192,40 @@ function readMapEntry(field, reader, options) {
|
|
|
185
192
|
}
|
|
186
193
|
return [key, val];
|
|
187
194
|
}
|
|
195
|
+
// Does not use scalarTypeInfo() for better performance.
|
|
188
196
|
function readScalar(reader, type) {
|
|
189
|
-
|
|
190
|
-
|
|
197
|
+
switch (type) {
|
|
198
|
+
case ScalarType.STRING:
|
|
199
|
+
return reader.string();
|
|
200
|
+
case ScalarType.BOOL:
|
|
201
|
+
return reader.bool();
|
|
202
|
+
case ScalarType.DOUBLE:
|
|
203
|
+
return reader.double();
|
|
204
|
+
case ScalarType.FLOAT:
|
|
205
|
+
return reader.float();
|
|
206
|
+
case ScalarType.INT32:
|
|
207
|
+
return reader.int32();
|
|
208
|
+
case ScalarType.INT64:
|
|
209
|
+
return reader.int64();
|
|
210
|
+
case ScalarType.UINT64:
|
|
211
|
+
return reader.uint64();
|
|
212
|
+
case ScalarType.FIXED64:
|
|
213
|
+
return reader.fixed64();
|
|
214
|
+
case ScalarType.BYTES:
|
|
215
|
+
return reader.bytes();
|
|
216
|
+
case ScalarType.FIXED32:
|
|
217
|
+
return reader.fixed32();
|
|
218
|
+
case ScalarType.SFIXED32:
|
|
219
|
+
return reader.sfixed32();
|
|
220
|
+
case ScalarType.SFIXED64:
|
|
221
|
+
return reader.sfixed64();
|
|
222
|
+
case ScalarType.SINT64:
|
|
223
|
+
return reader.sint64();
|
|
224
|
+
case ScalarType.UINT32:
|
|
225
|
+
return reader.uint32();
|
|
226
|
+
case ScalarType.SINT32:
|
|
227
|
+
return reader.sint32();
|
|
228
|
+
}
|
|
191
229
|
}
|
|
192
230
|
export function writeMapEntry(writer, options, field, key, value) {
|
|
193
231
|
writer.tag(field.no, WireType.LengthDelimited);
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
|
-
import { Message
|
|
14
|
+
import { Message } from "../message.js";
|
|
15
15
|
/**
|
|
16
16
|
* Create a new message type using the given runtime.
|
|
17
17
|
*/
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
import { setEnumType } from "./enum.js";
|
|
15
|
-
import { Message
|
|
15
|
+
import { Message } from "../message.js";
|
|
16
16
|
import { ScalarType } from "../field.js";
|
|
17
17
|
import { scalarEquals } from "./scalars.js";
|
|
18
18
|
/* eslint-disable @typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-return,@typescript-eslint/no-unsafe-argument,no-case-declarations */
|
package/dist/esm/proto-base64.js
CHANGED
|
@@ -87,15 +87,7 @@ export const protoBase64 = {
|
|
|
87
87
|
return bytes.subarray(0, bytePos);
|
|
88
88
|
},
|
|
89
89
|
/**
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* - ignores white-space, including line breaks and tabs
|
|
93
|
-
* - allows inner padding (can decode concatenated base64 strings)
|
|
94
|
-
* - does not require padding
|
|
95
|
-
* - understands base64url encoding:
|
|
96
|
-
* "-" instead of "+",
|
|
97
|
-
* "_" instead of "/",
|
|
98
|
-
* no padding
|
|
90
|
+
* Encode a byte array to a base64 string.
|
|
99
91
|
*/
|
|
100
92
|
enc(bytes) {
|
|
101
93
|
let base64 = "", groupPos = 0, // position in base64 group
|
|
@@ -121,7 +113,7 @@ export const protoBase64 = {
|
|
|
121
113
|
break;
|
|
122
114
|
}
|
|
123
115
|
}
|
|
124
|
-
// padding
|
|
116
|
+
// add output padding
|
|
125
117
|
if (groupPos) {
|
|
126
118
|
base64 += encTable[p];
|
|
127
119
|
base64 += "=";
|
|
@@ -36,7 +36,7 @@ import type { BinaryReadOptions } from "../../binary-format.js";
|
|
|
36
36
|
* foo = any.unpack(Foo.getDefaultInstance());
|
|
37
37
|
* }
|
|
38
38
|
*
|
|
39
|
-
*
|
|
39
|
+
* Example 3: Pack and unpack a message in Python.
|
|
40
40
|
*
|
|
41
41
|
* foo = Foo(...)
|
|
42
42
|
* any = Any()
|
|
@@ -46,7 +46,7 @@ import type { BinaryReadOptions } from "../../binary-format.js";
|
|
|
46
46
|
* any.Unpack(foo)
|
|
47
47
|
* ...
|
|
48
48
|
*
|
|
49
|
-
*
|
|
49
|
+
* Example 4: Pack and unpack a message in Go
|
|
50
50
|
*
|
|
51
51
|
* foo := &pb.Foo{...}
|
|
52
52
|
* any, err := anypb.New(foo)
|
|
@@ -66,7 +66,7 @@ import type { BinaryReadOptions } from "../../binary-format.js";
|
|
|
66
66
|
* name "y.z".
|
|
67
67
|
*
|
|
68
68
|
* JSON
|
|
69
|
-
*
|
|
69
|
+
* ====
|
|
70
70
|
* The JSON representation of an `Any` value uses the regular
|
|
71
71
|
* representation of the deserialized, embedded message, with an
|
|
72
72
|
* additional field `@type` which contains the type URL. Example:
|
|
@@ -197,7 +197,7 @@ export declare class Method extends Message<Method> {
|
|
|
197
197
|
* The mixin construct implies that all methods in `AccessControl` are
|
|
198
198
|
* also declared with same name and request/response types in
|
|
199
199
|
* `Storage`. A documentation generator or annotation processor will
|
|
200
|
-
* see the effective `Storage.GetAcl` method after
|
|
200
|
+
* see the effective `Storage.GetAcl` method after inherting
|
|
201
201
|
* documentation and annotations as follows:
|
|
202
202
|
*
|
|
203
203
|
* service Storage {
|
|
@@ -242,6 +242,23 @@ export declare class ExtensionRangeOptions extends Message<ExtensionRangeOptions
|
|
|
242
242
|
* @generated from field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999;
|
|
243
243
|
*/
|
|
244
244
|
uninterpretedOption: UninterpretedOption[];
|
|
245
|
+
/**
|
|
246
|
+
* go/protobuf-stripping-extension-declarations
|
|
247
|
+
* Like Metadata, but we use a repeated field to hold all extension
|
|
248
|
+
* declarations. This should avoid the size increases of transforming a large
|
|
249
|
+
* extension range into small ranges in generated binaries.
|
|
250
|
+
*
|
|
251
|
+
* @generated from field: repeated google.protobuf.ExtensionRangeOptions.Declaration declaration = 2;
|
|
252
|
+
*/
|
|
253
|
+
declaration: ExtensionRangeOptions_Declaration[];
|
|
254
|
+
/**
|
|
255
|
+
* The verification state of the range.
|
|
256
|
+
* TODO(b/278783756): flip the default to DECLARATION once all empty ranges
|
|
257
|
+
* are marked as UNVERIFIED.
|
|
258
|
+
*
|
|
259
|
+
* @generated from field: optional google.protobuf.ExtensionRangeOptions.VerificationState verification = 3 [default = UNVERIFIED];
|
|
260
|
+
*/
|
|
261
|
+
verification?: ExtensionRangeOptions_VerificationState;
|
|
245
262
|
constructor(data?: PartialMessage<ExtensionRangeOptions>);
|
|
246
263
|
static readonly runtime: typeof proto2;
|
|
247
264
|
static readonly typeName = "google.protobuf.ExtensionRangeOptions";
|
|
@@ -251,6 +268,79 @@ export declare class ExtensionRangeOptions extends Message<ExtensionRangeOptions
|
|
|
251
268
|
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ExtensionRangeOptions;
|
|
252
269
|
static equals(a: ExtensionRangeOptions | PlainMessage<ExtensionRangeOptions> | undefined, b: ExtensionRangeOptions | PlainMessage<ExtensionRangeOptions> | undefined): boolean;
|
|
253
270
|
}
|
|
271
|
+
/**
|
|
272
|
+
* The verification state of the extension range.
|
|
273
|
+
*
|
|
274
|
+
* @generated from enum google.protobuf.ExtensionRangeOptions.VerificationState
|
|
275
|
+
*/
|
|
276
|
+
export declare enum ExtensionRangeOptions_VerificationState {
|
|
277
|
+
/**
|
|
278
|
+
* All the extensions of the range must be declared.
|
|
279
|
+
*
|
|
280
|
+
* @generated from enum value: DECLARATION = 0;
|
|
281
|
+
*/
|
|
282
|
+
DECLARATION = 0,
|
|
283
|
+
/**
|
|
284
|
+
* @generated from enum value: UNVERIFIED = 1;
|
|
285
|
+
*/
|
|
286
|
+
UNVERIFIED = 1
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* @generated from message google.protobuf.ExtensionRangeOptions.Declaration
|
|
290
|
+
*/
|
|
291
|
+
export declare class ExtensionRangeOptions_Declaration extends Message<ExtensionRangeOptions_Declaration> {
|
|
292
|
+
/**
|
|
293
|
+
* The extension number declared within the extension range.
|
|
294
|
+
*
|
|
295
|
+
* @generated from field: optional int32 number = 1;
|
|
296
|
+
*/
|
|
297
|
+
number?: number;
|
|
298
|
+
/**
|
|
299
|
+
* The fully-qualified name of the extension field. There must be a leading
|
|
300
|
+
* dot in front of the full name.
|
|
301
|
+
*
|
|
302
|
+
* @generated from field: optional string full_name = 2;
|
|
303
|
+
*/
|
|
304
|
+
fullName?: string;
|
|
305
|
+
/**
|
|
306
|
+
* The fully-qualified type name of the extension field. Unlike
|
|
307
|
+
* Metadata.type, Declaration.type must have a leading dot for messages
|
|
308
|
+
* and enums.
|
|
309
|
+
*
|
|
310
|
+
* @generated from field: optional string type = 3;
|
|
311
|
+
*/
|
|
312
|
+
type?: string;
|
|
313
|
+
/**
|
|
314
|
+
* Deprecated. Please use "repeated".
|
|
315
|
+
*
|
|
316
|
+
* @generated from field: optional bool is_repeated = 4 [deprecated = true];
|
|
317
|
+
* @deprecated
|
|
318
|
+
*/
|
|
319
|
+
isRepeated?: boolean;
|
|
320
|
+
/**
|
|
321
|
+
* If true, indicates that the number is reserved in the extension range,
|
|
322
|
+
* and any extension field with the number will fail to compile. Set this
|
|
323
|
+
* when a declared extension field is deleted.
|
|
324
|
+
*
|
|
325
|
+
* @generated from field: optional bool reserved = 5;
|
|
326
|
+
*/
|
|
327
|
+
reserved?: boolean;
|
|
328
|
+
/**
|
|
329
|
+
* If true, indicates that the extension must be defined as repeated.
|
|
330
|
+
* Otherwise the extension must be defined as optional.
|
|
331
|
+
*
|
|
332
|
+
* @generated from field: optional bool repeated = 6;
|
|
333
|
+
*/
|
|
334
|
+
repeated?: boolean;
|
|
335
|
+
constructor(data?: PartialMessage<ExtensionRangeOptions_Declaration>);
|
|
336
|
+
static readonly runtime: typeof proto2;
|
|
337
|
+
static readonly typeName = "google.protobuf.ExtensionRangeOptions.Declaration";
|
|
338
|
+
static readonly fields: FieldList;
|
|
339
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ExtensionRangeOptions_Declaration;
|
|
340
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ExtensionRangeOptions_Declaration;
|
|
341
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ExtensionRangeOptions_Declaration;
|
|
342
|
+
static equals(a: ExtensionRangeOptions_Declaration | PlainMessage<ExtensionRangeOptions_Declaration> | undefined, b: ExtensionRangeOptions_Declaration | PlainMessage<ExtensionRangeOptions_Declaration> | undefined): boolean;
|
|
343
|
+
}
|
|
254
344
|
/**
|
|
255
345
|
* Describes a field within a message.
|
|
256
346
|
*
|
|
@@ -985,8 +1075,10 @@ export declare class FieldOptions extends Message<FieldOptions> {
|
|
|
985
1075
|
/**
|
|
986
1076
|
* The ctype option instructs the C++ code generator to use a different
|
|
987
1077
|
* representation of the field than it normally would. See the specific
|
|
988
|
-
* options below. This option is
|
|
989
|
-
*
|
|
1078
|
+
* options below. This option is only implemented to support use of
|
|
1079
|
+
* [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of
|
|
1080
|
+
* type "bytes" in the open source release -- sorry, we'll try to include
|
|
1081
|
+
* other types in a future version!
|
|
990
1082
|
*
|
|
991
1083
|
* @generated from field: optional google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];
|
|
992
1084
|
*/
|
|
@@ -1087,9 +1179,14 @@ export declare class FieldOptions extends Message<FieldOptions> {
|
|
|
1087
1179
|
*/
|
|
1088
1180
|
retention?: FieldOptions_OptionRetention;
|
|
1089
1181
|
/**
|
|
1090
|
-
* @generated from field: optional google.protobuf.FieldOptions.OptionTargetType target = 18;
|
|
1182
|
+
* @generated from field: optional google.protobuf.FieldOptions.OptionTargetType target = 18 [deprecated = true];
|
|
1183
|
+
* @deprecated
|
|
1091
1184
|
*/
|
|
1092
1185
|
target?: FieldOptions_OptionTargetType;
|
|
1186
|
+
/**
|
|
1187
|
+
* @generated from field: repeated google.protobuf.FieldOptions.OptionTargetType targets = 19;
|
|
1188
|
+
*/
|
|
1189
|
+
targets: FieldOptions_OptionTargetType[];
|
|
1093
1190
|
/**
|
|
1094
1191
|
* The parser stores options it doesn't recognize here. See above.
|
|
1095
1192
|
*
|
|
@@ -1116,6 +1213,13 @@ export declare enum FieldOptions_CType {
|
|
|
1116
1213
|
*/
|
|
1117
1214
|
STRING = 0,
|
|
1118
1215
|
/**
|
|
1216
|
+
* The option [ctype=CORD] may be applied to a non-repeated field of type
|
|
1217
|
+
* "bytes". It indicates that in C++, the data should be stored in a Cord
|
|
1218
|
+
* instead of a string. For very large strings, this may reduce memory
|
|
1219
|
+
* fragmentation. It may also allow better performance when parsing from a
|
|
1220
|
+
* Cord, or when parsing with aliasing enabled, as the parsed Cord may then
|
|
1221
|
+
* alias the original buffer.
|
|
1222
|
+
*
|
|
1119
1223
|
* @generated from enum value: CORD = 1;
|
|
1120
1224
|
*/
|
|
1121
1225
|
CORD = 1,
|
|
@@ -8,7 +8,7 @@ import type { BinaryReadOptions } from "../../binary-format.js";
|
|
|
8
8
|
* `NullValue` is a singleton enumeration to represent the null value for the
|
|
9
9
|
* `Value` type union.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
11
|
+
* The JSON representation for `NullValue` is JSON `null`.
|
|
12
12
|
*
|
|
13
13
|
* @generated from enum google.protobuf.NullValue
|
|
14
14
|
*/
|
|
@@ -92,7 +92,7 @@ import type { BinaryReadOptions } from "../../binary-format.js";
|
|
|
92
92
|
* [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
|
93
93
|
* the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
|
94
94
|
* the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
|
95
|
-
* http://
|
|
95
|
+
* http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
|
|
96
96
|
* ) to obtain a formatter capable of generating timestamps in this format.
|
|
97
97
|
*
|
|
98
98
|
*
|