@bufbuild/protobuf 2.6.0 → 2.6.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.
@@ -22,6 +22,13 @@ export type JavaFeatures = Message<"pb.JavaFeatures"> & {
22
22
  * @generated from field: optional pb.JavaFeatures.Utf8Validation utf8_validation = 2;
23
23
  */
24
24
  utf8Validation: JavaFeatures_Utf8Validation;
25
+ /**
26
+ * Allows creation of large Java enums, extending beyond the standard
27
+ * constant limits imposed by the Java language.
28
+ *
29
+ * @generated from field: optional bool large_enum = 3;
30
+ */
31
+ largeEnum: boolean;
25
32
  /**
26
33
  * Whether to use the old default outer class name scheme, or the new feature
27
34
  * which adds a "Proto" suffix to the outer class name.
@@ -33,6 +40,13 @@ export type JavaFeatures = Message<"pb.JavaFeatures"> & {
33
40
  * @generated from field: optional bool use_old_outer_classname_default = 4;
34
41
  */
35
42
  useOldOuterClassnameDefault: boolean;
43
+ /**
44
+ * Whether to nest the generated class in the generated file class. This is
45
+ * only applicable to *top-level* messages, enums, and services.
46
+ *
47
+ * @generated from field: optional pb.JavaFeatures.NestInFileClassFeature.NestInFileClass nest_in_file_class = 5;
48
+ */
49
+ nestInFileClass: JavaFeatures_NestInFileClassFeature_NestInFileClass;
36
50
  };
37
51
  /**
38
52
  * @generated from message pb.JavaFeatures
@@ -51,6 +65,13 @@ export type JavaFeaturesJson = {
51
65
  * @generated from field: optional pb.JavaFeatures.Utf8Validation utf8_validation = 2;
52
66
  */
53
67
  utf8Validation?: JavaFeatures_Utf8ValidationJson;
68
+ /**
69
+ * Allows creation of large Java enums, extending beyond the standard
70
+ * constant limits imposed by the Java language.
71
+ *
72
+ * @generated from field: optional bool large_enum = 3;
73
+ */
74
+ largeEnum?: boolean;
54
75
  /**
55
76
  * Whether to use the old default outer class name scheme, or the new feature
56
77
  * which adds a "Proto" suffix to the outer class name.
@@ -62,6 +83,13 @@ export type JavaFeaturesJson = {
62
83
  * @generated from field: optional bool use_old_outer_classname_default = 4;
63
84
  */
64
85
  useOldOuterClassnameDefault?: boolean;
86
+ /**
87
+ * Whether to nest the generated class in the generated file class. This is
88
+ * only applicable to *top-level* messages, enums, and services.
89
+ *
90
+ * @generated from field: optional pb.JavaFeatures.NestInFileClassFeature.NestInFileClass nest_in_file_class = 5;
91
+ */
92
+ nestInFileClass?: JavaFeatures_NestInFileClassFeature_NestInFileClassJson;
65
93
  };
66
94
  /**
67
95
  * Describes the message pb.JavaFeatures.
@@ -71,8 +99,60 @@ export declare const JavaFeaturesSchema: GenMessage<JavaFeatures, {
71
99
  jsonType: JavaFeaturesJson;
72
100
  }>;
73
101
  /**
74
- * The UTF8 validation strategy to use. See go/editions-utf8-validation for
75
- * more information on this feature.
102
+ * @generated from message pb.JavaFeatures.NestInFileClassFeature
103
+ */
104
+ export type JavaFeatures_NestInFileClassFeature = Message<"pb.JavaFeatures.NestInFileClassFeature"> & {};
105
+ /**
106
+ * @generated from message pb.JavaFeatures.NestInFileClassFeature
107
+ */
108
+ export type JavaFeatures_NestInFileClassFeatureJson = {};
109
+ /**
110
+ * Describes the message pb.JavaFeatures.NestInFileClassFeature.
111
+ * Use `create(JavaFeatures_NestInFileClassFeatureSchema)` to create a new message.
112
+ */
113
+ export declare const JavaFeatures_NestInFileClassFeatureSchema: GenMessage<JavaFeatures_NestInFileClassFeature, {
114
+ jsonType: JavaFeatures_NestInFileClassFeatureJson;
115
+ }>;
116
+ /**
117
+ * @generated from enum pb.JavaFeatures.NestInFileClassFeature.NestInFileClass
118
+ */
119
+ export declare enum JavaFeatures_NestInFileClassFeature_NestInFileClass {
120
+ /**
121
+ * Invalid default, which should never be used.
122
+ *
123
+ * @generated from enum value: NEST_IN_FILE_CLASS_UNKNOWN = 0;
124
+ */
125
+ NEST_IN_FILE_CLASS_UNKNOWN = 0,
126
+ /**
127
+ * Do not nest the generated class in the file class.
128
+ *
129
+ * @generated from enum value: NO = 1;
130
+ */
131
+ NO = 1,
132
+ /**
133
+ * Nest the generated class in the file class.
134
+ *
135
+ * @generated from enum value: YES = 2;
136
+ */
137
+ YES = 2,
138
+ /**
139
+ * Fall back to the `java_multiple_files` option. Users won't be able to
140
+ * set this option.
141
+ *
142
+ * @generated from enum value: LEGACY = 3;
143
+ */
144
+ LEGACY = 3
145
+ }
146
+ /**
147
+ * @generated from enum pb.JavaFeatures.NestInFileClassFeature.NestInFileClass
148
+ */
149
+ export type JavaFeatures_NestInFileClassFeature_NestInFileClassJson = "NEST_IN_FILE_CLASS_UNKNOWN" | "NO" | "YES" | "LEGACY";
150
+ /**
151
+ * Describes the enum pb.JavaFeatures.NestInFileClassFeature.NestInFileClass.
152
+ */
153
+ export declare const JavaFeatures_NestInFileClassFeature_NestInFileClassSchema: GenEnum<JavaFeatures_NestInFileClassFeature_NestInFileClass, JavaFeatures_NestInFileClassFeature_NestInFileClassJson>;
154
+ /**
155
+ * The UTF8 validation strategy to use.
76
156
  *
77
157
  * @generated from enum pb.JavaFeatures.Utf8Validation
78
158
  */
@@ -99,8 +179,7 @@ export declare enum JavaFeatures_Utf8Validation {
99
179
  VERIFY = 2
100
180
  }
101
181
  /**
102
- * The UTF8 validation strategy to use. See go/editions-utf8-validation for
103
- * more information on this feature.
182
+ * The UTF8 validation strategy to use.
104
183
  *
105
184
  * @generated from enum pb.JavaFeatures.Utf8Validation
106
185
  */
@@ -13,7 +13,7 @@
13
13
  // See the License for the specific language governing permissions and
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.java = exports.JavaFeatures_Utf8ValidationSchema = exports.JavaFeatures_Utf8Validation = exports.JavaFeaturesSchema = exports.file_google_protobuf_java_features = void 0;
16
+ exports.java = exports.JavaFeatures_Utf8ValidationSchema = exports.JavaFeatures_Utf8Validation = exports.JavaFeatures_NestInFileClassFeature_NestInFileClassSchema = exports.JavaFeatures_NestInFileClassFeature_NestInFileClass = exports.JavaFeatures_NestInFileClassFeatureSchema = exports.JavaFeaturesSchema = exports.file_google_protobuf_java_features = void 0;
17
17
  const file_js_1 = require("../../../../codegenv2/file.js");
18
18
  const descriptor_pb_js_1 = require("./descriptor_pb.js");
19
19
  const message_js_1 = require("../../../../codegenv2/message.js");
@@ -22,15 +22,54 @@ const extension_js_1 = require("../../../../codegenv2/extension.js");
22
22
  /**
23
23
  * Describes the file google/protobuf/java_features.proto.
24
24
  */
25
- exports.file_google_protobuf_java_features = (0, file_js_1.fileDesc)("CiNnb29nbGUvcHJvdG9idWYvamF2YV9mZWF0dXJlcy5wcm90bxICcGIizAUKDEphdmFGZWF0dXJlcxL+AQoSbGVnYWN5X2Nsb3NlZF9lbnVtGAEgASgIQuEBiAEBmAEEmAEBogEJEgR0cnVlGIQHogEKEgVmYWxzZRjnB7IBuwEI6AcQ6AcasgFUaGUgbGVnYWN5IGNsb3NlZCBlbnVtIGJlaGF2aW9yIGluIEphdmEgaXMgZGVwcmVjYXRlZCBhbmQgaXMgc2NoZWR1bGVkIHRvIGJlIHJlbW92ZWQgaW4gZWRpdGlvbiAyMDI1LiAgU2VlIGh0dHA6Ly9wcm90b2J1Zi5kZXYvcHJvZ3JhbW1pbmctZ3VpZGVzL2VudW0vI2phdmEgZm9yIG1vcmUgaW5mb3JtYXRpb24uEp8CCg91dGY4X3ZhbGlkYXRpb24YAiABKA4yHy5wYi5KYXZhRmVhdHVyZXMuVXRmOFZhbGlkYXRpb25C5AGIAQGYAQSYAQGiAQwSB0RFRkFVTFQYhAeyAcgBCOgHEOkHGr8BVGhlIEphdmEtc3BlY2lmaWMgdXRmOCB2YWxpZGF0aW9uIGZlYXR1cmUgaXMgZGVwcmVjYXRlZCBhbmQgaXMgc2NoZWR1bGVkIHRvIGJlIHJlbW92ZWQgaW4gZWRpdGlvbiAyMDI1LiAgVXRmOCB2YWxpZGF0aW9uIGJlaGF2aW9yIHNob3VsZCB1c2UgdGhlIGdsb2JhbCBjcm9zcy1sYW5ndWFnZSB1dGY4X3ZhbGlkYXRpb24gZmVhdHVyZS4SUQofdXNlX29sZF9vdXRlcl9jbGFzc25hbWVfZGVmYXVsdBgEIAEoCEIoiAEBmAEBogEJEgR0cnVlGIQHogEKEgVmYWxzZRjpB7IBBgjpByDpByJGCg5VdGY4VmFsaWRhdGlvbhIbChdVVEY4X1ZBTElEQVRJT05fVU5LTk9XThAAEgsKB0RFRkFVTFQQARIKCgZWRVJJRlkQAjpCCgRqYXZhEhsuZ29vZ2xlLnByb3RvYnVmLkZlYXR1cmVTZXQY6QcgASgLMhAucGIuSmF2YUZlYXR1cmVzUgRqYXZhQigKE2NvbS5nb29nbGUucHJvdG9idWZCEUphdmFGZWF0dXJlc1Byb3Rv", [descriptor_pb_js_1.file_google_protobuf_descriptor]);
25
+ exports.file_google_protobuf_java_features = (0, file_js_1.fileDesc)("CiNnb29nbGUvcHJvdG9idWYvamF2YV9mZWF0dXJlcy5wcm90bxICcGIi/QcKDEphdmFGZWF0dXJlcxL+AQoSbGVnYWN5X2Nsb3NlZF9lbnVtGAEgASgIQuEBiAEBmAEEmAEBogEJEgR0cnVlGIQHogEKEgVmYWxzZRjnB7IBuwEI6AcQ6AcasgFUaGUgbGVnYWN5IGNsb3NlZCBlbnVtIGJlaGF2aW9yIGluIEphdmEgaXMgZGVwcmVjYXRlZCBhbmQgaXMgc2NoZWR1bGVkIHRvIGJlIHJlbW92ZWQgaW4gZWRpdGlvbiAyMDI1LiAgU2VlIGh0dHA6Ly9wcm90b2J1Zi5kZXYvcHJvZ3JhbW1pbmctZ3VpZGVzL2VudW0vI2phdmEgZm9yIG1vcmUgaW5mb3JtYXRpb24uEp8CCg91dGY4X3ZhbGlkYXRpb24YAiABKA4yHy5wYi5KYXZhRmVhdHVyZXMuVXRmOFZhbGlkYXRpb25C5AGIAQGYAQSYAQGiAQwSB0RFRkFVTFQYhAeyAcgBCOgHEOkHGr8BVGhlIEphdmEtc3BlY2lmaWMgdXRmOCB2YWxpZGF0aW9uIGZlYXR1cmUgaXMgZGVwcmVjYXRlZCBhbmQgaXMgc2NoZWR1bGVkIHRvIGJlIHJlbW92ZWQgaW4gZWRpdGlvbiAyMDI1LiAgVXRmOCB2YWxpZGF0aW9uIGJlaGF2aW9yIHNob3VsZCB1c2UgdGhlIGdsb2JhbCBjcm9zcy1sYW5ndWFnZSB1dGY4X3ZhbGlkYXRpb24gZmVhdHVyZS4SMAoKbGFyZ2VfZW51bRgDIAEoCEIciAEBmAEGmAEBogEKEgVmYWxzZRiEB7IBAwjpBxJRCh91c2Vfb2xkX291dGVyX2NsYXNzbmFtZV9kZWZhdWx0GAQgASgIQiiIAQGYAQGiAQkSBHRydWUYhAeiAQoSBWZhbHNlGOkHsgEGCOkHIOkHEn8KEm5lc3RfaW5fZmlsZV9jbGFzcxgFIAEoDjI3LnBiLkphdmFGZWF0dXJlcy5OZXN0SW5GaWxlQ2xhc3NGZWF0dXJlLk5lc3RJbkZpbGVDbGFzc0IqiAECmAEDmAEGmAEIogELEgZMRUdBQ1kYhAeiAQcSAk5PGOkHsgEDCOkHGnwKFk5lc3RJbkZpbGVDbGFzc0ZlYXR1cmUiWAoPTmVzdEluRmlsZUNsYXNzEh4KGk5FU1RfSU5fRklMRV9DTEFTU19VTktOT1dOEAASBgoCTk8QARIHCgNZRVMQAhIUCgZMRUdBQ1kQAxoIIgYI6Qcg6QdKCAgBEICAgIACIkYKDlV0ZjhWYWxpZGF0aW9uEhsKF1VURjhfVkFMSURBVElPTl9VTktOT1dOEAASCwoHREVGQVVMVBABEgoKBlZFUklGWRACOkIKBGphdmESGy5nb29nbGUucHJvdG9idWYuRmVhdHVyZVNldBjpByABKAsyEC5wYi5KYXZhRmVhdHVyZXNSBGphdmFCKAoTY29tLmdvb2dsZS5wcm90b2J1ZkIRSmF2YUZlYXR1cmVzUHJvdG8", [descriptor_pb_js_1.file_google_protobuf_descriptor]);
26
26
  /**
27
27
  * Describes the message pb.JavaFeatures.
28
28
  * Use `create(JavaFeaturesSchema)` to create a new message.
29
29
  */
30
30
  exports.JavaFeaturesSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_java_features, 0);
31
31
  /**
32
- * The UTF8 validation strategy to use. See go/editions-utf8-validation for
33
- * more information on this feature.
32
+ * Describes the message pb.JavaFeatures.NestInFileClassFeature.
33
+ * Use `create(JavaFeatures_NestInFileClassFeatureSchema)` to create a new message.
34
+ */
35
+ exports.JavaFeatures_NestInFileClassFeatureSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_java_features, 0, 0);
36
+ /**
37
+ * @generated from enum pb.JavaFeatures.NestInFileClassFeature.NestInFileClass
38
+ */
39
+ var JavaFeatures_NestInFileClassFeature_NestInFileClass;
40
+ (function (JavaFeatures_NestInFileClassFeature_NestInFileClass) {
41
+ /**
42
+ * Invalid default, which should never be used.
43
+ *
44
+ * @generated from enum value: NEST_IN_FILE_CLASS_UNKNOWN = 0;
45
+ */
46
+ JavaFeatures_NestInFileClassFeature_NestInFileClass[JavaFeatures_NestInFileClassFeature_NestInFileClass["NEST_IN_FILE_CLASS_UNKNOWN"] = 0] = "NEST_IN_FILE_CLASS_UNKNOWN";
47
+ /**
48
+ * Do not nest the generated class in the file class.
49
+ *
50
+ * @generated from enum value: NO = 1;
51
+ */
52
+ JavaFeatures_NestInFileClassFeature_NestInFileClass[JavaFeatures_NestInFileClassFeature_NestInFileClass["NO"] = 1] = "NO";
53
+ /**
54
+ * Nest the generated class in the file class.
55
+ *
56
+ * @generated from enum value: YES = 2;
57
+ */
58
+ JavaFeatures_NestInFileClassFeature_NestInFileClass[JavaFeatures_NestInFileClassFeature_NestInFileClass["YES"] = 2] = "YES";
59
+ /**
60
+ * Fall back to the `java_multiple_files` option. Users won't be able to
61
+ * set this option.
62
+ *
63
+ * @generated from enum value: LEGACY = 3;
64
+ */
65
+ JavaFeatures_NestInFileClassFeature_NestInFileClass[JavaFeatures_NestInFileClassFeature_NestInFileClass["LEGACY"] = 3] = "LEGACY";
66
+ })(JavaFeatures_NestInFileClassFeature_NestInFileClass || (exports.JavaFeatures_NestInFileClassFeature_NestInFileClass = JavaFeatures_NestInFileClassFeature_NestInFileClass = {}));
67
+ /**
68
+ * Describes the enum pb.JavaFeatures.NestInFileClassFeature.NestInFileClass.
69
+ */
70
+ exports.JavaFeatures_NestInFileClassFeature_NestInFileClassSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_java_features, 0, 0, 0);
71
+ /**
72
+ * The UTF8 validation strategy to use.
34
73
  *
35
74
  * @generated from enum pb.JavaFeatures.Utf8Validation
36
75
  */
@@ -40,11 +40,14 @@ export function bootFileDescriptorProto(init) {
40
40
  syntax: "",
41
41
  edition: 0,
42
42
  });
43
- return Object.assign(proto, Object.assign(Object.assign({ $typeName: "google.protobuf.FileDescriptorProto", dependency: [], publicDependency: [], weakDependency: [], service: [], extension: [] }, init), { messageType: init.messageType.map(bootDescriptorProto), enumType: init.enumType.map(bootEnumDescriptorProto) }));
43
+ return Object.assign(proto, Object.assign(Object.assign({ $typeName: "google.protobuf.FileDescriptorProto", dependency: [], publicDependency: [], weakDependency: [], optionDependency: [], service: [], extension: [] }, init), { messageType: init.messageType.map(bootDescriptorProto), enumType: init.enumType.map(bootEnumDescriptorProto) }));
44
44
  }
45
45
  function bootDescriptorProto(init) {
46
46
  var _a, _b, _c, _d, _e, _f, _g, _h;
47
- return {
47
+ const proto = Object.create({
48
+ visibility: 0,
49
+ });
50
+ return Object.assign(proto, {
48
51
  $typeName: "google.protobuf.DescriptorProto",
49
52
  name: init.name,
50
53
  field: (_b = (_a = init.field) === null || _a === void 0 ? void 0 : _a.map(bootFieldDescriptorProto)) !== null && _b !== void 0 ? _b : [],
@@ -55,7 +58,7 @@ function bootDescriptorProto(init) {
55
58
  oneofDecl: [],
56
59
  reservedRange: [],
57
60
  reservedName: [],
58
- };
61
+ });
59
62
  }
60
63
  function bootFieldDescriptorProto(init) {
61
64
  const proto = Object.create({
@@ -85,11 +88,14 @@ function bootFieldOptions(init) {
85
88
  return Object.assign(proto, Object.assign(Object.assign({ $typeName: "google.protobuf.FieldOptions" }, init), { targets: (_a = init.targets) !== null && _a !== void 0 ? _a : [], editionDefaults: (_c = (_b = init.editionDefaults) === null || _b === void 0 ? void 0 : _b.map((e) => (Object.assign({ $typeName: "google.protobuf.FieldOptions.EditionDefault" }, e)))) !== null && _c !== void 0 ? _c : [], uninterpretedOption: [] }));
86
89
  }
87
90
  function bootEnumDescriptorProto(init) {
88
- return {
91
+ const proto = Object.create({
92
+ visibility: 0,
93
+ });
94
+ return Object.assign(proto, {
89
95
  $typeName: "google.protobuf.EnumDescriptorProto",
90
96
  name: init.name,
91
97
  reservedName: [],
92
98
  reservedRange: [],
93
99
  value: init.value.map((e) => (Object.assign({ $typeName: "google.protobuf.EnumValueDescriptorProto" }, e))),
94
- };
100
+ });
95
101
  }
@@ -1,5 +1,5 @@
1
1
  import type { DescEnum, DescExtension, DescMessage, DescService } from "../descriptors.js";
2
- import type { FileDescriptorProto } from "../wkt/gen/google/protobuf/descriptor_pb.js";
2
+ import { type FileDescriptorProto } from "../wkt/gen/google/protobuf/descriptor_pb.js";
3
3
  import type { FileDescriptorProtoBoot } from "./boot.js";
4
4
  type EmbedUnknown = {
5
5
  bootable: false;
@@ -16,7 +16,7 @@ import { isFieldSet, clearField } from "../fields.js";
16
16
  import { base64Encode } from "../wire/base64-encoding.js";
17
17
  import { toBinary } from "../to-binary.js";
18
18
  import { clone } from "../clone.js";
19
- import { Edition, FieldDescriptorProtoSchema, FieldOptionsSchema, FileDescriptorProtoSchema, } from "../wkt/gen/google/protobuf/descriptor_pb.js";
19
+ import { Edition, FieldDescriptorProtoSchema, FieldOptionsSchema, FileDescriptorProtoSchema, DescriptorProtoSchema, EnumDescriptorProtoSchema, } from "../wkt/gen/google/protobuf/descriptor_pb.js";
20
20
  /**
21
21
  * Create necessary information to embed a file descriptor in
22
22
  * generated code.
@@ -117,6 +117,7 @@ export function createFileDescriptorProtoBoot(proto) {
117
117
  assert(!proto.dependency.length);
118
118
  assert(!proto.publicDependency.length);
119
119
  assert(!proto.weakDependency.length);
120
+ assert(!proto.optionDependency.length);
120
121
  assert(!proto.service.length);
121
122
  assert(!proto.extension.length);
122
123
  assert(proto.sourceCodeInfo === undefined);
@@ -134,6 +135,7 @@ function createDescriptorBoot(proto) {
134
135
  assert(proto.extension.length == 0);
135
136
  assert(!proto.oneofDecl.length);
136
137
  assert(!proto.options);
138
+ assert(!isFieldSet(proto, DescriptorProtoSchema.field.visibility));
137
139
  const b = {
138
140
  name: proto.name,
139
141
  };
@@ -215,6 +217,7 @@ function createFieldOptionsBoot(proto) {
215
217
  }
216
218
  function createEnumDescriptorBoot(proto) {
217
219
  assert(!proto.options);
220
+ assert(!isFieldSet(proto, EnumDescriptorProtoSchema.field.visibility));
218
221
  return {
219
222
  name: proto.name,
220
223
  value: proto.value.map((v) => {
@@ -14,7 +14,7 @@
14
14
  import { ScalarType } from "./descriptors.js";
15
15
  import { scalarZeroValue } from "./reflect/scalar.js";
16
16
  import { reflect } from "./reflect/reflect.js";
17
- import { BinaryReader, WireType } from "./wire/binary-encoding.js";
17
+ import { BinaryReader, BinaryWriter, WireType, } from "./wire/binary-encoding.js";
18
18
  // Default options for parsing binary data.
19
19
  const readDefaults = {
20
20
  readUnknownFields: true,
@@ -85,12 +85,28 @@ function readMessage(message, reader, options, delimited, lengthOrDelimitedField
85
85
  * @private
86
86
  */
87
87
  export function readField(message, reader, field, wireType, options) {
88
+ var _a;
88
89
  switch (field.fieldKind) {
89
90
  case "scalar":
90
91
  message.set(field, readScalar(reader, field.scalar));
91
92
  break;
92
93
  case "enum":
93
- message.set(field, readScalar(reader, ScalarType.INT32));
94
+ const val = readScalar(reader, ScalarType.INT32);
95
+ if (field.enum.open) {
96
+ message.set(field, val);
97
+ }
98
+ else {
99
+ const ok = field.enum.values.some((v) => v.number === val);
100
+ if (ok) {
101
+ message.set(field, val);
102
+ }
103
+ else if (options.readUnknownFields) {
104
+ const data = new BinaryWriter().int32(val).finish();
105
+ const unknownFields = (_a = message.getUnknown()) !== null && _a !== void 0 ? _a : [];
106
+ unknownFields.push({ no: field.number, wireType, data });
107
+ message.setUnknown(unknownFields);
108
+ }
109
+ }
94
110
  break;
95
111
  case "message":
96
112
  message.set(field, readMessageField(reader, options, field, message.get(field)));
@@ -223,7 +223,7 @@ const DELIMITED = 2;
223
223
  const OPEN = 1;
224
224
  // biome-ignore format: want this to read well
225
225
  // bootstrap-inject defaults: EDITION_PROTO2 to EDITION_2023: export const minimumEdition: SupportedEdition = $minimumEdition, maximumEdition: SupportedEdition = $maximumEdition;
226
- // generated from protoc v30.0
226
+ // generated from protoc v31.1
227
227
  export const minimumEdition = 998, maximumEdition = 1000;
228
228
  const featureDefaults = {
229
229
  // EDITION_PROTO2
@@ -235,6 +235,7 @@ const featureDefaults = {
235
235
  messageEncoding: 1, // LENGTH_PREFIXED,
236
236
  jsonFormat: 2, // LEGACY_BEST_EFFORT,
237
237
  enforceNamingStyle: 2, // STYLE_LEGACY,
238
+ defaultSymbolVisibility: 1, // EXPORT_ALL,
238
239
  },
239
240
  // EDITION_PROTO3
240
241
  999: {
@@ -245,6 +246,7 @@ const featureDefaults = {
245
246
  messageEncoding: 1, // LENGTH_PREFIXED,
246
247
  jsonFormat: 1, // ALLOW,
247
248
  enforceNamingStyle: 2, // STYLE_LEGACY,
249
+ defaultSymbolVisibility: 1, // EXPORT_ALL,
248
250
  },
249
251
  // EDITION_2023
250
252
  1000: {
@@ -255,6 +257,7 @@ const featureDefaults = {
255
257
  messageEncoding: 1, // LENGTH_PREFIXED,
256
258
  jsonFormat: 1, // ALLOW,
257
259
  enforceNamingStyle: 2, // STYLE_LEGACY,
260
+ defaultSymbolVisibility: 1, // EXPORT_ALL,
258
261
  },
259
262
  };
260
263
  /**
@@ -72,6 +72,13 @@ export type FileDescriptorProto = Message<"google.protobuf.FileDescriptorProto">
72
72
  * @generated from field: repeated int32 weak_dependency = 11;
73
73
  */
74
74
  weakDependency: number[];
75
+ /**
76
+ * Names of files imported by this file purely for the purpose of providing
77
+ * option extensions. These are excluded from the dependency list above.
78
+ *
79
+ * @generated from field: repeated string option_dependency = 15;
80
+ */
81
+ optionDependency: string[];
75
82
  /**
76
83
  * All top-level definitions in this file.
77
84
  *
@@ -162,6 +169,13 @@ export type FileDescriptorProtoJson = {
162
169
  * @generated from field: repeated int32 weak_dependency = 11;
163
170
  */
164
171
  weakDependency?: number[];
172
+ /**
173
+ * Names of files imported by this file purely for the purpose of providing
174
+ * option extensions. These are excluded from the dependency list above.
175
+ *
176
+ * @generated from field: repeated string option_dependency = 15;
177
+ */
178
+ optionDependency?: string[];
165
179
  /**
166
180
  * All top-level definitions in this file.
167
181
  *
@@ -271,6 +285,12 @@ export type DescriptorProto = Message<"google.protobuf.DescriptorProto"> & {
271
285
  * @generated from field: repeated string reserved_name = 10;
272
286
  */
273
287
  reservedName: string[];
288
+ /**
289
+ * Support for `export` and `local` keywords on enums.
290
+ *
291
+ * @generated from field: optional google.protobuf.SymbolVisibility visibility = 11;
292
+ */
293
+ visibility: SymbolVisibility;
274
294
  };
275
295
  /**
276
296
  * Describes a message type.
@@ -321,6 +341,12 @@ export type DescriptorProtoJson = {
321
341
  * @generated from field: repeated string reserved_name = 10;
322
342
  */
323
343
  reservedName?: string[];
344
+ /**
345
+ * Support for `export` and `local` keywords on enums.
346
+ *
347
+ * @generated from field: optional google.protobuf.SymbolVisibility visibility = 11;
348
+ */
349
+ visibility?: SymbolVisibilityJson;
324
350
  };
325
351
  /**
326
352
  * Describes the message google.protobuf.DescriptorProto.
@@ -1028,6 +1054,12 @@ export type EnumDescriptorProto = Message<"google.protobuf.EnumDescriptorProto">
1028
1054
  * @generated from field: repeated string reserved_name = 5;
1029
1055
  */
1030
1056
  reservedName: string[];
1057
+ /**
1058
+ * Support for `export` and `local` keywords on enums.
1059
+ *
1060
+ * @generated from field: optional google.protobuf.SymbolVisibility visibility = 6;
1061
+ */
1062
+ visibility: SymbolVisibility;
1031
1063
  };
1032
1064
  /**
1033
1065
  * Describes an enum type.
@@ -1062,6 +1094,12 @@ export type EnumDescriptorProtoJson = {
1062
1094
  * @generated from field: repeated string reserved_name = 5;
1063
1095
  */
1064
1096
  reservedName?: string[];
1097
+ /**
1098
+ * Support for `export` and `local` keywords on enums.
1099
+ *
1100
+ * @generated from field: optional google.protobuf.SymbolVisibility visibility = 6;
1101
+ */
1102
+ visibility?: SymbolVisibilityJson;
1065
1103
  };
1066
1104
  /**
1067
1105
  * Describes the message google.protobuf.EnumDescriptorProto.
@@ -3052,6 +3090,10 @@ export type FeatureSet = Message<"google.protobuf.FeatureSet"> & {
3052
3090
  * @generated from field: optional google.protobuf.FeatureSet.EnforceNamingStyle enforce_naming_style = 7;
3053
3091
  */
3054
3092
  enforceNamingStyle: FeatureSet_EnforceNamingStyle;
3093
+ /**
3094
+ * @generated from field: optional google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8;
3095
+ */
3096
+ defaultSymbolVisibility: FeatureSet_VisibilityFeature_DefaultSymbolVisibility;
3055
3097
  };
3056
3098
  /**
3057
3099
  * TODO Enums in C++ gencode (and potentially other languages) are
@@ -3092,6 +3134,10 @@ export type FeatureSetJson = {
3092
3134
  * @generated from field: optional google.protobuf.FeatureSet.EnforceNamingStyle enforce_naming_style = 7;
3093
3135
  */
3094
3136
  enforceNamingStyle?: FeatureSet_EnforceNamingStyleJson;
3137
+ /**
3138
+ * @generated from field: optional google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8;
3139
+ */
3140
+ defaultSymbolVisibility?: FeatureSet_VisibilityFeature_DefaultSymbolVisibilityJson;
3095
3141
  };
3096
3142
  /**
3097
3143
  * Describes the message google.protobuf.FeatureSet.
@@ -3100,6 +3146,64 @@ export type FeatureSetJson = {
3100
3146
  export declare const FeatureSetSchema: GenMessage<FeatureSet, {
3101
3147
  jsonType: FeatureSetJson;
3102
3148
  }>;
3149
+ /**
3150
+ * @generated from message google.protobuf.FeatureSet.VisibilityFeature
3151
+ */
3152
+ export type FeatureSet_VisibilityFeature = Message<"google.protobuf.FeatureSet.VisibilityFeature"> & {};
3153
+ /**
3154
+ * @generated from message google.protobuf.FeatureSet.VisibilityFeature
3155
+ */
3156
+ export type FeatureSet_VisibilityFeatureJson = {};
3157
+ /**
3158
+ * Describes the message google.protobuf.FeatureSet.VisibilityFeature.
3159
+ * Use `create(FeatureSet_VisibilityFeatureSchema)` to create a new message.
3160
+ */
3161
+ export declare const FeatureSet_VisibilityFeatureSchema: GenMessage<FeatureSet_VisibilityFeature, {
3162
+ jsonType: FeatureSet_VisibilityFeatureJson;
3163
+ }>;
3164
+ /**
3165
+ * @generated from enum google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility
3166
+ */
3167
+ export declare enum FeatureSet_VisibilityFeature_DefaultSymbolVisibility {
3168
+ /**
3169
+ * @generated from enum value: DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;
3170
+ */
3171
+ DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0,
3172
+ /**
3173
+ * Default pre-EDITION_2024, all UNSET visibility are export.
3174
+ *
3175
+ * @generated from enum value: EXPORT_ALL = 1;
3176
+ */
3177
+ EXPORT_ALL = 1,
3178
+ /**
3179
+ * All top-level symbols default to export, nested default to local.
3180
+ *
3181
+ * @generated from enum value: EXPORT_TOP_LEVEL = 2;
3182
+ */
3183
+ EXPORT_TOP_LEVEL = 2,
3184
+ /**
3185
+ * All symbols default to local.
3186
+ *
3187
+ * @generated from enum value: LOCAL_ALL = 3;
3188
+ */
3189
+ LOCAL_ALL = 3,
3190
+ /**
3191
+ * All symbols local by default. Nested types cannot be exported.
3192
+ * With special case caveat for message { enum {} reserved 1 to max; }
3193
+ * This is the recommended setting for new protos.
3194
+ *
3195
+ * @generated from enum value: STRICT = 4;
3196
+ */
3197
+ STRICT = 4
3198
+ }
3199
+ /**
3200
+ * @generated from enum google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility
3201
+ */
3202
+ export type FeatureSet_VisibilityFeature_DefaultSymbolVisibilityJson = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" | "EXPORT_ALL" | "EXPORT_TOP_LEVEL" | "LOCAL_ALL" | "STRICT";
3203
+ /**
3204
+ * Describes the enum google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility.
3205
+ */
3206
+ export declare const FeatureSet_VisibilityFeature_DefaultSymbolVisibilitySchema: GenEnum<FeatureSet_VisibilityFeature_DefaultSymbolVisibility, FeatureSet_VisibilityFeature_DefaultSymbolVisibilityJson>;
3103
3207
  /**
3104
3208
  * @generated from enum google.protobuf.FeatureSet.FieldPresence
3105
3209
  */
@@ -3976,3 +4080,40 @@ export type EditionJson = "EDITION_UNKNOWN" | "EDITION_LEGACY" | "EDITION_PROTO2
3976
4080
  * Describes the enum google.protobuf.Edition.
3977
4081
  */
3978
4082
  export declare const EditionSchema: GenEnum<Edition, EditionJson>;
4083
+ /**
4084
+ * Describes the 'visibility' of a symbol with respect to the proto import
4085
+ * system. Symbols can only be imported when the visibility rules do not prevent
4086
+ * it (ex: local symbols cannot be imported). Visibility modifiers can only set
4087
+ * on `message` and `enum` as they are the only types available to be referenced
4088
+ * from other files.
4089
+ *
4090
+ * @generated from enum google.protobuf.SymbolVisibility
4091
+ */
4092
+ export declare enum SymbolVisibility {
4093
+ /**
4094
+ * @generated from enum value: VISIBILITY_UNSET = 0;
4095
+ */
4096
+ VISIBILITY_UNSET = 0,
4097
+ /**
4098
+ * @generated from enum value: VISIBILITY_LOCAL = 1;
4099
+ */
4100
+ VISIBILITY_LOCAL = 1,
4101
+ /**
4102
+ * @generated from enum value: VISIBILITY_EXPORT = 2;
4103
+ */
4104
+ VISIBILITY_EXPORT = 2
4105
+ }
4106
+ /**
4107
+ * Describes the 'visibility' of a symbol with respect to the proto import
4108
+ * system. Symbols can only be imported when the visibility rules do not prevent
4109
+ * it (ex: local symbols cannot be imported). Visibility modifiers can only set
4110
+ * on `message` and `enum` as they are the only types available to be referenced
4111
+ * from other files.
4112
+ *
4113
+ * @generated from enum google.protobuf.SymbolVisibility
4114
+ */
4115
+ export type SymbolVisibilityJson = "VISIBILITY_UNSET" | "VISIBILITY_LOCAL" | "VISIBILITY_EXPORT";
4116
+ /**
4117
+ * Describes the enum google.protobuf.SymbolVisibility.
4118
+ */
4119
+ export declare const SymbolVisibilitySchema: GenEnum<SymbolVisibility, SymbolVisibilityJson>;