@bufbuild/protobuf 1.2.1 → 1.3.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.
Files changed (48) hide show
  1. package/dist/cjs/binary-encoding.js +1 -1
  2. package/dist/cjs/codegen-info.js +1 -0
  3. package/dist/cjs/field.js +1 -1
  4. package/dist/cjs/google/protobuf/any_pb.js +1 -1
  5. package/dist/cjs/google/protobuf/api_pb.js +3 -3
  6. package/dist/cjs/google/protobuf/compiler/plugin_pb.js +5 -5
  7. package/dist/cjs/google/protobuf/descriptor_pb.js +38 -38
  8. package/dist/cjs/google/protobuf/duration_pb.js +1 -1
  9. package/dist/cjs/google/protobuf/empty_pb.js +1 -1
  10. package/dist/cjs/google/protobuf/field_mask_pb.js +1 -1
  11. package/dist/cjs/google/protobuf/source_context_pb.js +1 -1
  12. package/dist/cjs/google/protobuf/struct_pb.js +5 -5
  13. package/dist/cjs/google/protobuf/timestamp_pb.js +1 -1
  14. package/dist/cjs/google/protobuf/type_pb.js +9 -9
  15. package/dist/cjs/google/protobuf/wrappers_pb.js +9 -9
  16. package/dist/cjs/index.js +5 -1
  17. package/dist/cjs/private/json-format-common.js +2 -1
  18. package/dist/cjs/private/util-common.js +37 -8
  19. package/dist/cjs/proto-delimited.js +14 -19
  20. package/dist/cjs/proto-double.js +29 -0
  21. package/dist/cjs/proto-int64.js +1 -1
  22. package/dist/cjs/service-type.js +2 -2
  23. package/dist/cjs/to-plain-message.js +67 -0
  24. package/dist/esm/codegen-info.js +1 -0
  25. package/dist/esm/google/protobuf/any_pb.js +1 -2
  26. package/dist/esm/google/protobuf/api_pb.js +3 -6
  27. package/dist/esm/google/protobuf/compiler/plugin_pb.js +4 -8
  28. package/dist/esm/google/protobuf/descriptor_pb.js +28 -56
  29. package/dist/esm/google/protobuf/duration_pb.js +1 -2
  30. package/dist/esm/google/protobuf/empty_pb.js +1 -2
  31. package/dist/esm/google/protobuf/field_mask_pb.js +1 -2
  32. package/dist/esm/google/protobuf/source_context_pb.js +1 -2
  33. package/dist/esm/google/protobuf/struct_pb.js +4 -7
  34. package/dist/esm/google/protobuf/timestamp_pb.js +1 -2
  35. package/dist/esm/google/protobuf/type_pb.js +6 -11
  36. package/dist/esm/google/protobuf/wrappers_pb.js +9 -18
  37. package/dist/esm/index.js +2 -0
  38. package/dist/esm/private/json-format-common.js +2 -1
  39. package/dist/esm/private/util-common.js +37 -8
  40. package/dist/esm/proto-delimited.js +14 -19
  41. package/dist/esm/proto-double.js +26 -0
  42. package/dist/esm/proto-int64.js +1 -1
  43. package/dist/esm/to-plain-message.js +63 -0
  44. package/dist/types/codegen-info.d.ts +1 -1
  45. package/dist/types/index.d.ts +2 -0
  46. package/dist/types/proto-double.d.ts +5 -0
  47. package/dist/types/to-plain-message.d.ts +9 -0
  48. package/package.json +1 -1
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ // Copyright 2021-2023 Buf Technologies, Inc.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.toPlainMessage = void 0;
17
+ /* 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 */
18
+ const message_js_1 = require("./message.js");
19
+ /**
20
+ * toPlainMessage returns a new object by striping
21
+ * all methods from a message, leaving only fields and
22
+ * oneof groups. It is recursive, meaning it applies this
23
+ * same logic to all nested message fields as well.
24
+ */
25
+ function toPlainMessage(message) {
26
+ const type = message.getType();
27
+ const target = {};
28
+ for (const member of type.fields.byMember()) {
29
+ const source = message[member.localName];
30
+ let copy;
31
+ if (member.repeated) {
32
+ copy = source.map((e) => toPlainValue(e));
33
+ }
34
+ else if (member.kind == "map") {
35
+ copy = {};
36
+ for (const [key, v] of Object.entries(source)) {
37
+ copy[key] = toPlainValue(v);
38
+ }
39
+ }
40
+ else if (member.kind == "oneof") {
41
+ const f = member.findField(source.case);
42
+ copy = f
43
+ ? { case: source.case, value: toPlainValue(source.value) }
44
+ : { case: undefined };
45
+ }
46
+ else {
47
+ copy = toPlainValue(source);
48
+ }
49
+ target[member.localName] = copy;
50
+ }
51
+ return target;
52
+ }
53
+ exports.toPlainMessage = toPlainMessage;
54
+ function toPlainValue(value) {
55
+ if (value === undefined) {
56
+ return value;
57
+ }
58
+ if (value instanceof message_js_1.Message) {
59
+ return toPlainMessage(value);
60
+ }
61
+ if (value instanceof Uint8Array) {
62
+ const c = new Uint8Array(value.byteLength);
63
+ c.set(value);
64
+ return c;
65
+ }
66
+ return value;
67
+ }
@@ -39,6 +39,7 @@ export const codegenInfo = {
39
39
  JsonWriteOptions: { typeOnly: true, privateImportPath: "./json-format.js", publicImportPath: packageName },
40
40
  JsonValue: { typeOnly: true, privateImportPath: "./json-format.js", publicImportPath: packageName },
41
41
  JsonObject: { typeOnly: true, privateImportPath: "./json-format.js", publicImportPath: packageName },
42
+ protoDouble: { typeOnly: false, privateImportPath: "./proto-double.js", publicImportPath: packageName },
42
43
  protoInt64: { typeOnly: false, privateImportPath: "./proto-int64.js", publicImportPath: packageName },
43
44
  ScalarType: { typeOnly: false, privateImportPath: "./field.js", publicImportPath: packageName },
44
45
  MethodKind: { typeOnly: false, privateImportPath: "./service-type.js", publicImportPath: packageName },
@@ -103,7 +103,7 @@ import { proto3 } from "../../proto3.js";
103
103
  *
104
104
  * @generated from message google.protobuf.Any
105
105
  */
106
- class Any extends Message {
106
+ export class Any extends Message {
107
107
  constructor(data) {
108
108
  super();
109
109
  /**
@@ -266,4 +266,3 @@ Any.fields = proto3.util.newFieldList(() => [
266
266
  { no: 1, name: "type_url", kind: "scalar", T: 9 /* ScalarType.STRING */ },
267
267
  { no: 2, name: "value", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
268
268
  ]);
269
- export { Any };
@@ -28,7 +28,7 @@ import { proto3 } from "../../proto3.js";
28
28
  *
29
29
  * @generated from message google.protobuf.Api
30
30
  */
31
- class Api extends Message {
31
+ export class Api extends Message {
32
32
  constructor(data) {
33
33
  super();
34
34
  /**
@@ -113,13 +113,12 @@ Api.fields = proto3.util.newFieldList(() => [
113
113
  { no: 6, name: "mixins", kind: "message", T: Mixin, repeated: true },
114
114
  { no: 7, name: "syntax", kind: "enum", T: proto3.getEnumType(Syntax) },
115
115
  ]);
116
- export { Api };
117
116
  /**
118
117
  * Method represents a method of an API interface.
119
118
  *
120
119
  * @generated from message google.protobuf.Method
121
120
  */
122
- class Method extends Message {
121
+ export class Method extends Message {
123
122
  constructor(data) {
124
123
  super();
125
124
  /**
@@ -190,7 +189,6 @@ Method.fields = proto3.util.newFieldList(() => [
190
189
  { no: 6, name: "options", kind: "message", T: Option, repeated: true },
191
190
  { no: 7, name: "syntax", kind: "enum", T: proto3.getEnumType(Syntax) },
192
191
  ]);
193
- export { Method };
194
192
  /**
195
193
  * Declares an API Interface to be included in this interface. The including
196
194
  * interface must redeclare all the methods from the included interface, but
@@ -273,7 +271,7 @@ export { Method };
273
271
  *
274
272
  * @generated from message google.protobuf.Mixin
275
273
  */
276
- class Mixin extends Message {
274
+ export class Mixin extends Message {
277
275
  constructor(data) {
278
276
  super();
279
277
  /**
@@ -310,4 +308,3 @@ Mixin.fields = proto3.util.newFieldList(() => [
310
308
  { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
311
309
  { no: 2, name: "root", kind: "scalar", T: 9 /* ScalarType.STRING */ },
312
310
  ]);
313
- export { Mixin };
@@ -19,7 +19,7 @@ import { FileDescriptorProto, GeneratedCodeInfo } from "../descriptor_pb.js";
19
19
  *
20
20
  * @generated from message google.protobuf.compiler.Version
21
21
  */
22
- class Version extends Message {
22
+ export class Version extends Message {
23
23
  constructor(data) {
24
24
  super();
25
25
  proto2.util.initPartial(data, this);
@@ -45,13 +45,12 @@ Version.fields = proto2.util.newFieldList(() => [
45
45
  { no: 3, name: "patch", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
46
46
  { no: 4, name: "suffix", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
47
47
  ]);
48
- export { Version };
49
48
  /**
50
49
  * An encoded CodeGeneratorRequest is written to the plugin's stdin.
51
50
  *
52
51
  * @generated from message google.protobuf.compiler.CodeGeneratorRequest
53
52
  */
54
- class CodeGeneratorRequest extends Message {
53
+ export class CodeGeneratorRequest extends Message {
55
54
  constructor(data) {
56
55
  super();
57
56
  /**
@@ -104,13 +103,12 @@ CodeGeneratorRequest.fields = proto2.util.newFieldList(() => [
104
103
  { no: 15, name: "proto_file", kind: "message", T: FileDescriptorProto, repeated: true },
105
104
  { no: 3, name: "compiler_version", kind: "message", T: Version, opt: true },
106
105
  ]);
107
- export { CodeGeneratorRequest };
108
106
  /**
109
107
  * The plugin writes an encoded CodeGeneratorResponse to stdout.
110
108
  *
111
109
  * @generated from message google.protobuf.compiler.CodeGeneratorResponse
112
110
  */
113
- class CodeGeneratorResponse extends Message {
111
+ export class CodeGeneratorResponse extends Message {
114
112
  constructor(data) {
115
113
  super();
116
114
  /**
@@ -139,7 +137,6 @@ CodeGeneratorResponse.fields = proto2.util.newFieldList(() => [
139
137
  { no: 2, name: "supported_features", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true },
140
138
  { no: 15, name: "file", kind: "message", T: CodeGeneratorResponse_File, repeated: true },
141
139
  ]);
142
- export { CodeGeneratorResponse };
143
140
  /**
144
141
  * Sync with code_generator.h.
145
142
  *
@@ -166,7 +163,7 @@ proto2.util.setEnumType(CodeGeneratorResponse_Feature, "google.protobuf.compiler
166
163
  *
167
164
  * @generated from message google.protobuf.compiler.CodeGeneratorResponse.File
168
165
  */
169
- class CodeGeneratorResponse_File extends Message {
166
+ export class CodeGeneratorResponse_File extends Message {
170
167
  constructor(data) {
171
168
  super();
172
169
  proto2.util.initPartial(data, this);
@@ -192,4 +189,3 @@ CodeGeneratorResponse_File.fields = proto2.util.newFieldList(() => [
192
189
  { no: 15, name: "content", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
193
190
  { no: 16, name: "generated_code_info", kind: "message", T: GeneratedCodeInfo, opt: true },
194
191
  ]);
195
- export { CodeGeneratorResponse_File };
@@ -19,7 +19,7 @@ import { proto2 } from "../../proto2.js";
19
19
  *
20
20
  * @generated from message google.protobuf.FileDescriptorSet
21
21
  */
22
- class FileDescriptorSet extends Message {
22
+ export class FileDescriptorSet extends Message {
23
23
  constructor(data) {
24
24
  super();
25
25
  /**
@@ -46,13 +46,12 @@ FileDescriptorSet.typeName = "google.protobuf.FileDescriptorSet";
46
46
  FileDescriptorSet.fields = proto2.util.newFieldList(() => [
47
47
  { no: 1, name: "file", kind: "message", T: FileDescriptorProto, repeated: true },
48
48
  ]);
49
- export { FileDescriptorSet };
50
49
  /**
51
50
  * Describes a complete .proto file.
52
51
  *
53
52
  * @generated from message google.protobuf.FileDescriptorProto
54
53
  */
55
- class FileDescriptorProto extends Message {
54
+ export class FileDescriptorProto extends Message {
56
55
  constructor(data) {
57
56
  super();
58
57
  /**
@@ -124,13 +123,12 @@ FileDescriptorProto.fields = proto2.util.newFieldList(() => [
124
123
  { no: 12, name: "syntax", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
125
124
  { no: 13, name: "edition", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
126
125
  ]);
127
- export { FileDescriptorProto };
128
126
  /**
129
127
  * Describes a message type.
130
128
  *
131
129
  * @generated from message google.protobuf.DescriptorProto
132
130
  */
133
- class DescriptorProto extends Message {
131
+ export class DescriptorProto extends Message {
134
132
  constructor(data) {
135
133
  super();
136
134
  /**
@@ -197,11 +195,10 @@ DescriptorProto.fields = proto2.util.newFieldList(() => [
197
195
  { no: 9, name: "reserved_range", kind: "message", T: DescriptorProto_ReservedRange, repeated: true },
198
196
  { no: 10, name: "reserved_name", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
199
197
  ]);
200
- export { DescriptorProto };
201
198
  /**
202
199
  * @generated from message google.protobuf.DescriptorProto.ExtensionRange
203
200
  */
204
- class DescriptorProto_ExtensionRange extends Message {
201
+ export class DescriptorProto_ExtensionRange extends Message {
205
202
  constructor(data) {
206
203
  super();
207
204
  proto2.util.initPartial(data, this);
@@ -226,7 +223,6 @@ DescriptorProto_ExtensionRange.fields = proto2.util.newFieldList(() => [
226
223
  { no: 2, name: "end", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
227
224
  { no: 3, name: "options", kind: "message", T: ExtensionRangeOptions, opt: true },
228
225
  ]);
229
- export { DescriptorProto_ExtensionRange };
230
226
  /**
231
227
  * Range of reserved tag numbers. Reserved tag numbers may not be used by
232
228
  * fields or extension ranges in the same message. Reserved ranges may
@@ -234,7 +230,7 @@ export { DescriptorProto_ExtensionRange };
234
230
  *
235
231
  * @generated from message google.protobuf.DescriptorProto.ReservedRange
236
232
  */
237
- class DescriptorProto_ReservedRange extends Message {
233
+ export class DescriptorProto_ReservedRange extends Message {
238
234
  constructor(data) {
239
235
  super();
240
236
  proto2.util.initPartial(data, this);
@@ -258,11 +254,10 @@ DescriptorProto_ReservedRange.fields = proto2.util.newFieldList(() => [
258
254
  { no: 1, name: "start", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
259
255
  { no: 2, name: "end", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
260
256
  ]);
261
- export { DescriptorProto_ReservedRange };
262
257
  /**
263
258
  * @generated from message google.protobuf.ExtensionRangeOptions
264
259
  */
265
- class ExtensionRangeOptions extends Message {
260
+ export class ExtensionRangeOptions extends Message {
266
261
  constructor(data) {
267
262
  super();
268
263
  /**
@@ -302,7 +297,6 @@ ExtensionRangeOptions.fields = proto2.util.newFieldList(() => [
302
297
  { no: 2, name: "declaration", kind: "message", T: ExtensionRangeOptions_Declaration, repeated: true },
303
298
  { no: 3, name: "verification", kind: "enum", T: proto2.getEnumType(ExtensionRangeOptions_VerificationState), opt: true, default: ExtensionRangeOptions_VerificationState.UNVERIFIED },
304
299
  ]);
305
- export { ExtensionRangeOptions };
306
300
  /**
307
301
  * The verification state of the extension range.
308
302
  *
@@ -329,7 +323,7 @@ proto2.util.setEnumType(ExtensionRangeOptions_VerificationState, "google.protobu
329
323
  /**
330
324
  * @generated from message google.protobuf.ExtensionRangeOptions.Declaration
331
325
  */
332
- class ExtensionRangeOptions_Declaration extends Message {
326
+ export class ExtensionRangeOptions_Declaration extends Message {
333
327
  constructor(data) {
334
328
  super();
335
329
  proto2.util.initPartial(data, this);
@@ -357,13 +351,12 @@ ExtensionRangeOptions_Declaration.fields = proto2.util.newFieldList(() => [
357
351
  { no: 5, name: "reserved", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
358
352
  { no: 6, name: "repeated", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
359
353
  ]);
360
- export { ExtensionRangeOptions_Declaration };
361
354
  /**
362
355
  * Describes a field within a message.
363
356
  *
364
357
  * @generated from message google.protobuf.FieldDescriptorProto
365
358
  */
366
- class FieldDescriptorProto extends Message {
359
+ export class FieldDescriptorProto extends Message {
367
360
  constructor(data) {
368
361
  super();
369
362
  proto2.util.initPartial(data, this);
@@ -396,7 +389,6 @@ FieldDescriptorProto.fields = proto2.util.newFieldList(() => [
396
389
  { no: 8, name: "options", kind: "message", T: FieldOptions, opt: true },
397
390
  { no: 17, name: "proto3_optional", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
398
391
  ]);
399
- export { FieldDescriptorProto };
400
392
  /**
401
393
  * @generated from enum google.protobuf.FieldDescriptorProto.Type
402
394
  */
@@ -549,7 +541,7 @@ proto2.util.setEnumType(FieldDescriptorProto_Label, "google.protobuf.FieldDescri
549
541
  *
550
542
  * @generated from message google.protobuf.OneofDescriptorProto
551
543
  */
552
- class OneofDescriptorProto extends Message {
544
+ export class OneofDescriptorProto extends Message {
553
545
  constructor(data) {
554
546
  super();
555
547
  proto2.util.initPartial(data, this);
@@ -573,13 +565,12 @@ OneofDescriptorProto.fields = proto2.util.newFieldList(() => [
573
565
  { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
574
566
  { no: 2, name: "options", kind: "message", T: OneofOptions, opt: true },
575
567
  ]);
576
- export { OneofDescriptorProto };
577
568
  /**
578
569
  * Describes an enum type.
579
570
  *
580
571
  * @generated from message google.protobuf.EnumDescriptorProto
581
572
  */
582
- class EnumDescriptorProto extends Message {
573
+ export class EnumDescriptorProto extends Message {
583
574
  constructor(data) {
584
575
  super();
585
576
  /**
@@ -625,7 +616,6 @@ EnumDescriptorProto.fields = proto2.util.newFieldList(() => [
625
616
  { no: 4, name: "reserved_range", kind: "message", T: EnumDescriptorProto_EnumReservedRange, repeated: true },
626
617
  { no: 5, name: "reserved_name", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
627
618
  ]);
628
- export { EnumDescriptorProto };
629
619
  /**
630
620
  * Range of reserved numeric values. Reserved values may not be used by
631
621
  * entries in the same enum. Reserved ranges may not overlap.
@@ -636,7 +626,7 @@ export { EnumDescriptorProto };
636
626
  *
637
627
  * @generated from message google.protobuf.EnumDescriptorProto.EnumReservedRange
638
628
  */
639
- class EnumDescriptorProto_EnumReservedRange extends Message {
629
+ export class EnumDescriptorProto_EnumReservedRange extends Message {
640
630
  constructor(data) {
641
631
  super();
642
632
  proto2.util.initPartial(data, this);
@@ -660,13 +650,12 @@ EnumDescriptorProto_EnumReservedRange.fields = proto2.util.newFieldList(() => [
660
650
  { no: 1, name: "start", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
661
651
  { no: 2, name: "end", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
662
652
  ]);
663
- export { EnumDescriptorProto_EnumReservedRange };
664
653
  /**
665
654
  * Describes a value within an enum.
666
655
  *
667
656
  * @generated from message google.protobuf.EnumValueDescriptorProto
668
657
  */
669
- class EnumValueDescriptorProto extends Message {
658
+ export class EnumValueDescriptorProto extends Message {
670
659
  constructor(data) {
671
660
  super();
672
661
  proto2.util.initPartial(data, this);
@@ -691,13 +680,12 @@ EnumValueDescriptorProto.fields = proto2.util.newFieldList(() => [
691
680
  { no: 2, name: "number", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
692
681
  { no: 3, name: "options", kind: "message", T: EnumValueOptions, opt: true },
693
682
  ]);
694
- export { EnumValueDescriptorProto };
695
683
  /**
696
684
  * Describes a service.
697
685
  *
698
686
  * @generated from message google.protobuf.ServiceDescriptorProto
699
687
  */
700
- class ServiceDescriptorProto extends Message {
688
+ export class ServiceDescriptorProto extends Message {
701
689
  constructor(data) {
702
690
  super();
703
691
  /**
@@ -726,13 +714,12 @@ ServiceDescriptorProto.fields = proto2.util.newFieldList(() => [
726
714
  { no: 2, name: "method", kind: "message", T: MethodDescriptorProto, repeated: true },
727
715
  { no: 3, name: "options", kind: "message", T: ServiceOptions, opt: true },
728
716
  ]);
729
- export { ServiceDescriptorProto };
730
717
  /**
731
718
  * Describes a method of a service.
732
719
  *
733
720
  * @generated from message google.protobuf.MethodDescriptorProto
734
721
  */
735
- class MethodDescriptorProto extends Message {
722
+ export class MethodDescriptorProto extends Message {
736
723
  constructor(data) {
737
724
  super();
738
725
  proto2.util.initPartial(data, this);
@@ -760,11 +747,10 @@ MethodDescriptorProto.fields = proto2.util.newFieldList(() => [
760
747
  { no: 5, name: "client_streaming", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false },
761
748
  { no: 6, name: "server_streaming", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false },
762
749
  ]);
763
- export { MethodDescriptorProto };
764
750
  /**
765
751
  * @generated from message google.protobuf.FileOptions
766
752
  */
767
- class FileOptions extends Message {
753
+ export class FileOptions extends Message {
768
754
  constructor(data) {
769
755
  super();
770
756
  /**
@@ -814,7 +800,6 @@ FileOptions.fields = proto2.util.newFieldList(() => [
814
800
  { no: 45, name: "ruby_package", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
815
801
  { no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true },
816
802
  ]);
817
- export { FileOptions };
818
803
  /**
819
804
  * Generated classes can be optimized for speed or code size.
820
805
  *
@@ -852,7 +837,7 @@ proto2.util.setEnumType(FileOptions_OptimizeMode, "google.protobuf.FileOptions.O
852
837
  /**
853
838
  * @generated from message google.protobuf.MessageOptions
854
839
  */
855
- class MessageOptions extends Message {
840
+ export class MessageOptions extends Message {
856
841
  constructor(data) {
857
842
  super();
858
843
  /**
@@ -886,11 +871,10 @@ MessageOptions.fields = proto2.util.newFieldList(() => [
886
871
  { no: 11, name: "deprecated_legacy_json_field_conflicts", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
887
872
  { no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true },
888
873
  ]);
889
- export { MessageOptions };
890
874
  /**
891
875
  * @generated from message google.protobuf.FieldOptions
892
876
  */
893
- class FieldOptions extends Message {
877
+ export class FieldOptions extends Message {
894
878
  constructor(data) {
895
879
  super();
896
880
  /**
@@ -934,7 +918,6 @@ FieldOptions.fields = proto2.util.newFieldList(() => [
934
918
  { no: 19, name: "targets", kind: "enum", T: proto2.getEnumType(FieldOptions_OptionTargetType), repeated: true },
935
919
  { no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true },
936
920
  ]);
937
- export { FieldOptions };
938
921
  /**
939
922
  * @generated from enum google.protobuf.FieldOptions.CType
940
923
  */
@@ -1093,7 +1076,7 @@ proto2.util.setEnumType(FieldOptions_OptionTargetType, "google.protobuf.FieldOpt
1093
1076
  /**
1094
1077
  * @generated from message google.protobuf.OneofOptions
1095
1078
  */
1096
- class OneofOptions extends Message {
1079
+ export class OneofOptions extends Message {
1097
1080
  constructor(data) {
1098
1081
  super();
1099
1082
  /**
@@ -1122,11 +1105,10 @@ OneofOptions.typeName = "google.protobuf.OneofOptions";
1122
1105
  OneofOptions.fields = proto2.util.newFieldList(() => [
1123
1106
  { no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true },
1124
1107
  ]);
1125
- export { OneofOptions };
1126
1108
  /**
1127
1109
  * @generated from message google.protobuf.EnumOptions
1128
1110
  */
1129
- class EnumOptions extends Message {
1111
+ export class EnumOptions extends Message {
1130
1112
  constructor(data) {
1131
1113
  super();
1132
1114
  /**
@@ -1158,11 +1140,10 @@ EnumOptions.fields = proto2.util.newFieldList(() => [
1158
1140
  { no: 6, name: "deprecated_legacy_json_field_conflicts", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
1159
1141
  { no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true },
1160
1142
  ]);
1161
- export { EnumOptions };
1162
1143
  /**
1163
1144
  * @generated from message google.protobuf.EnumValueOptions
1164
1145
  */
1165
- class EnumValueOptions extends Message {
1146
+ export class EnumValueOptions extends Message {
1166
1147
  constructor(data) {
1167
1148
  super();
1168
1149
  /**
@@ -1192,11 +1173,10 @@ EnumValueOptions.fields = proto2.util.newFieldList(() => [
1192
1173
  { no: 1, name: "deprecated", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false },
1193
1174
  { no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true },
1194
1175
  ]);
1195
- export { EnumValueOptions };
1196
1176
  /**
1197
1177
  * @generated from message google.protobuf.ServiceOptions
1198
1178
  */
1199
- class ServiceOptions extends Message {
1179
+ export class ServiceOptions extends Message {
1200
1180
  constructor(data) {
1201
1181
  super();
1202
1182
  /**
@@ -1226,11 +1206,10 @@ ServiceOptions.fields = proto2.util.newFieldList(() => [
1226
1206
  { no: 33, name: "deprecated", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false },
1227
1207
  { no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true },
1228
1208
  ]);
1229
- export { ServiceOptions };
1230
1209
  /**
1231
1210
  * @generated from message google.protobuf.MethodOptions
1232
1211
  */
1233
- class MethodOptions extends Message {
1212
+ export class MethodOptions extends Message {
1234
1213
  constructor(data) {
1235
1214
  super();
1236
1215
  /**
@@ -1261,7 +1240,6 @@ MethodOptions.fields = proto2.util.newFieldList(() => [
1261
1240
  { no: 34, name: "idempotency_level", kind: "enum", T: proto2.getEnumType(MethodOptions_IdempotencyLevel), opt: true, default: MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN },
1262
1241
  { no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true },
1263
1242
  ]);
1264
- export { MethodOptions };
1265
1243
  /**
1266
1244
  * Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
1267
1245
  * or neither? HTTP based RPC implementation may choose GET verb for safe
@@ -1304,7 +1282,7 @@ proto2.util.setEnumType(MethodOptions_IdempotencyLevel, "google.protobuf.MethodO
1304
1282
  *
1305
1283
  * @generated from message google.protobuf.UninterpretedOption
1306
1284
  */
1307
- class UninterpretedOption extends Message {
1285
+ export class UninterpretedOption extends Message {
1308
1286
  constructor(data) {
1309
1287
  super();
1310
1288
  /**
@@ -1337,7 +1315,6 @@ UninterpretedOption.fields = proto2.util.newFieldList(() => [
1337
1315
  { no: 7, name: "string_value", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true },
1338
1316
  { no: 8, name: "aggregate_value", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
1339
1317
  ]);
1340
- export { UninterpretedOption };
1341
1318
  /**
1342
1319
  * The name of the uninterpreted option. Each string represents a segment in
1343
1320
  * a dot-separated name. is_extension is true iff a segment represents an
@@ -1347,7 +1324,7 @@ export { UninterpretedOption };
1347
1324
  *
1348
1325
  * @generated from message google.protobuf.UninterpretedOption.NamePart
1349
1326
  */
1350
- class UninterpretedOption_NamePart extends Message {
1327
+ export class UninterpretedOption_NamePart extends Message {
1351
1328
  constructor(data) {
1352
1329
  super();
1353
1330
  proto2.util.initPartial(data, this);
@@ -1371,14 +1348,13 @@ UninterpretedOption_NamePart.fields = proto2.util.newFieldList(() => [
1371
1348
  { no: 1, name: "name_part", kind: "scalar", T: 9 /* ScalarType.STRING */ },
1372
1349
  { no: 2, name: "is_extension", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
1373
1350
  ]);
1374
- export { UninterpretedOption_NamePart };
1375
1351
  /**
1376
1352
  * Encapsulates information about the original source file from which a
1377
1353
  * FileDescriptorProto was generated.
1378
1354
  *
1379
1355
  * @generated from message google.protobuf.SourceCodeInfo
1380
1356
  */
1381
- class SourceCodeInfo extends Message {
1357
+ export class SourceCodeInfo extends Message {
1382
1358
  constructor(data) {
1383
1359
  super();
1384
1360
  /**
@@ -1449,11 +1425,10 @@ SourceCodeInfo.typeName = "google.protobuf.SourceCodeInfo";
1449
1425
  SourceCodeInfo.fields = proto2.util.newFieldList(() => [
1450
1426
  { no: 1, name: "location", kind: "message", T: SourceCodeInfo_Location, repeated: true },
1451
1427
  ]);
1452
- export { SourceCodeInfo };
1453
1428
  /**
1454
1429
  * @generated from message google.protobuf.SourceCodeInfo.Location
1455
1430
  */
1456
- class SourceCodeInfo_Location extends Message {
1431
+ export class SourceCodeInfo_Location extends Message {
1457
1432
  constructor(data) {
1458
1433
  super();
1459
1434
  /**
@@ -1522,7 +1497,6 @@ SourceCodeInfo_Location.fields = proto2.util.newFieldList(() => [
1522
1497
  { no: 4, name: "trailing_comments", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
1523
1498
  { no: 6, name: "leading_detached_comments", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
1524
1499
  ]);
1525
- export { SourceCodeInfo_Location };
1526
1500
  /**
1527
1501
  * Describes the relationship between generated code and its original source
1528
1502
  * file. A GeneratedCodeInfo message is associated with only one generated
@@ -1530,7 +1504,7 @@ export { SourceCodeInfo_Location };
1530
1504
  *
1531
1505
  * @generated from message google.protobuf.GeneratedCodeInfo
1532
1506
  */
1533
- class GeneratedCodeInfo extends Message {
1507
+ export class GeneratedCodeInfo extends Message {
1534
1508
  constructor(data) {
1535
1509
  super();
1536
1510
  /**
@@ -1560,11 +1534,10 @@ GeneratedCodeInfo.typeName = "google.protobuf.GeneratedCodeInfo";
1560
1534
  GeneratedCodeInfo.fields = proto2.util.newFieldList(() => [
1561
1535
  { no: 1, name: "annotation", kind: "message", T: GeneratedCodeInfo_Annotation, repeated: true },
1562
1536
  ]);
1563
- export { GeneratedCodeInfo };
1564
1537
  /**
1565
1538
  * @generated from message google.protobuf.GeneratedCodeInfo.Annotation
1566
1539
  */
1567
- class GeneratedCodeInfo_Annotation extends Message {
1540
+ export class GeneratedCodeInfo_Annotation extends Message {
1568
1541
  constructor(data) {
1569
1542
  super();
1570
1543
  /**
@@ -1598,7 +1571,6 @@ GeneratedCodeInfo_Annotation.fields = proto2.util.newFieldList(() => [
1598
1571
  { no: 4, name: "end", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
1599
1572
  { no: 5, name: "semantic", kind: "enum", T: proto2.getEnumType(GeneratedCodeInfo_Annotation_Semantic), opt: true },
1600
1573
  ]);
1601
- export { GeneratedCodeInfo_Annotation };
1602
1574
  /**
1603
1575
  * Represents the identified object's effect on the element in the original
1604
1576
  * .proto file.
@@ -77,7 +77,7 @@ import { proto3 } from "../../proto3.js";
77
77
  *
78
78
  * @generated from message google.protobuf.Duration
79
79
  */
80
- class Duration extends Message {
80
+ export class Duration extends Message {
81
81
  constructor(data) {
82
82
  super();
83
83
  /**
@@ -163,4 +163,3 @@ Duration.fields = proto3.util.newFieldList(() => [
163
163
  { no: 1, name: "seconds", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
164
164
  { no: 2, name: "nanos", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
165
165
  ]);
166
- export { Duration };
@@ -25,7 +25,7 @@ import { proto3 } from "../../proto3.js";
25
25
  *
26
26
  * @generated from message google.protobuf.Empty
27
27
  */
28
- class Empty extends Message {
28
+ export class Empty extends Message {
29
29
  constructor(data) {
30
30
  super();
31
31
  proto3.util.initPartial(data, this);
@@ -46,4 +46,3 @@ class Empty extends Message {
46
46
  Empty.runtime = proto3;
47
47
  Empty.typeName = "google.protobuf.Empty";
48
48
  Empty.fields = proto3.util.newFieldList(() => []);
49
- export { Empty };
@@ -216,7 +216,7 @@ import { proto3 } from "../../proto3.js";
216
216
  *
217
217
  * @generated from message google.protobuf.FieldMask
218
218
  */
219
- class FieldMask extends Message {
219
+ export class FieldMask extends Message {
220
220
  constructor(data) {
221
221
  super();
222
222
  /**
@@ -305,4 +305,3 @@ FieldMask.typeName = "google.protobuf.FieldMask";
305
305
  FieldMask.fields = proto3.util.newFieldList(() => [
306
306
  { no: 1, name: "paths", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
307
307
  ]);
308
- export { FieldMask };
@@ -19,7 +19,7 @@ import { proto3 } from "../../proto3.js";
19
19
  *
20
20
  * @generated from message google.protobuf.SourceContext
21
21
  */
22
- class SourceContext extends Message {
22
+ export class SourceContext extends Message {
23
23
  constructor(data) {
24
24
  super();
25
25
  /**
@@ -49,4 +49,3 @@ SourceContext.typeName = "google.protobuf.SourceContext";
49
49
  SourceContext.fields = proto3.util.newFieldList(() => [
50
50
  { no: 1, name: "file_name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
51
51
  ]);
52
- export { SourceContext };