@bufbuild/protobuf 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,10 +25,13 @@ exports.wktPublicImportPaths = {
25
25
  "google/protobuf/compiler/plugin.proto": exports.packageName + "/wkt",
26
26
  "google/protobuf/any.proto": exports.packageName + "/wkt",
27
27
  "google/protobuf/api.proto": exports.packageName + "/wkt",
28
+ "google/protobuf/cpp_features.proto": exports.packageName + "/wkt",
28
29
  "google/protobuf/descriptor.proto": exports.packageName + "/wkt",
29
30
  "google/protobuf/duration.proto": exports.packageName + "/wkt",
30
31
  "google/protobuf/empty.proto": exports.packageName + "/wkt",
31
32
  "google/protobuf/field_mask.proto": exports.packageName + "/wkt",
33
+ "google/protobuf/go_features.proto": exports.packageName + "/wkt",
34
+ "google/protobuf/java_features.proto": exports.packageName + "/wkt",
32
35
  "google/protobuf/source_context.proto": exports.packageName + "/wkt",
33
36
  "google/protobuf/struct.proto": exports.packageName + "/wkt",
34
37
  "google/protobuf/timestamp.proto": exports.packageName + "/wkt",
@@ -4,6 +4,29 @@ import type { AnyDesc, DescEnum, DescExtension, DescFile, DescMessage, DescServi
4
4
  * and enumerations, extensions and messages nested in messages.
5
5
  */
6
6
  export declare function nestedTypes(desc: DescFile | DescMessage): Iterable<DescMessage | DescEnum | DescExtension | DescService>;
7
+ /**
8
+ * Iterate over types referenced by fields of the given message.
9
+ *
10
+ * For example:
11
+ *
12
+ * ```proto
13
+ * syntax="proto3";
14
+ *
15
+ * message Example {
16
+ * Msg singular = 1;
17
+ * repeated Level list = 2;
18
+ * }
19
+ *
20
+ * message Msg {}
21
+ *
22
+ * enum Level {
23
+ * LEVEL_UNSPECIFIED = 0;
24
+ * }
25
+ * ```
26
+ *
27
+ * The message Example references the message Msg, and the enum Level.
28
+ */
29
+ export declare function usedTypes(descMessage: DescMessage): Iterable<DescMessage | DescEnum>;
7
30
  /**
8
31
  * Returns the ancestors of a given Protobuf element, up to the file.
9
32
  */
@@ -14,6 +14,7 @@
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.nestedTypes = nestedTypes;
17
+ exports.usedTypes = usedTypes;
17
18
  exports.parentTypes = parentTypes;
18
19
  /**
19
20
  * Iterate over all types - enumerations, extensions, services, messages -
@@ -40,6 +41,45 @@ function* nestedTypes(desc) {
40
41
  break;
41
42
  }
42
43
  }
44
+ /**
45
+ * Iterate over types referenced by fields of the given message.
46
+ *
47
+ * For example:
48
+ *
49
+ * ```proto
50
+ * syntax="proto3";
51
+ *
52
+ * message Example {
53
+ * Msg singular = 1;
54
+ * repeated Level list = 2;
55
+ * }
56
+ *
57
+ * message Msg {}
58
+ *
59
+ * enum Level {
60
+ * LEVEL_UNSPECIFIED = 0;
61
+ * }
62
+ * ```
63
+ *
64
+ * The message Example references the message Msg, and the enum Level.
65
+ */
66
+ function usedTypes(descMessage) {
67
+ return usedTypesInternal(descMessage, new Set());
68
+ }
69
+ function* usedTypesInternal(descMessage, seen) {
70
+ var _a, _b;
71
+ for (const field of descMessage.fields) {
72
+ const ref = (_b = (_a = field.enum) !== null && _a !== void 0 ? _a : field.message) !== null && _b !== void 0 ? _b : undefined;
73
+ if (!ref || seen.has(ref.typeName)) {
74
+ continue;
75
+ }
76
+ seen.add(ref.typeName);
77
+ yield ref;
78
+ if (ref.kind == "message") {
79
+ yield* usedTypesInternal(ref, seen);
80
+ }
81
+ }
82
+ }
43
83
  /**
44
84
  * Returns the ancestors of a given Protobuf element, up to the file.
45
85
  */
@@ -403,7 +403,7 @@ function addEnum(proto, file, parent, reg) {
403
403
  (desc.value[p.number] = {
404
404
  kind: "enum_value",
405
405
  proto: p,
406
- deprecated: (_d = (_c = proto.options) === null || _c === void 0 ? void 0 : _c.deprecated) !== null && _d !== void 0 ? _d : false,
406
+ deprecated: (_d = (_c = p.options) === null || _c === void 0 ? void 0 : _c.deprecated) !== null && _d !== void 0 ? _d : false,
407
407
  parent: desc,
408
408
  name,
409
409
  localName: (0, names_js_1.safeObjectProperty)(sharedPrefix == undefined
@@ -797,15 +797,17 @@ function getFieldPresence(proto, oneof, isExtension, parent) {
797
797
  // oneof is always explicit
798
798
  return EXPLICIT;
799
799
  }
800
- if (proto.type == TYPE_MESSAGE) {
801
- // singular message field cannot be implicit
802
- return EXPLICIT;
803
- }
804
800
  if (isExtension) {
805
801
  // extensions always track presence
806
802
  return EXPLICIT;
807
803
  }
808
- return resolveFeature("fieldPresence", { proto, parent });
804
+ const resolved = resolveFeature("fieldPresence", { proto, parent });
805
+ if (resolved == IMPLICIT &&
806
+ (proto.type == TYPE_MESSAGE || proto.type == TYPE_GROUP)) {
807
+ // singular message field cannot be implicit
808
+ return EXPLICIT;
809
+ }
810
+ return resolved;
809
811
  }
810
812
  /**
811
813
  * Pack this repeated field?
@@ -0,0 +1,89 @@
1
+ import type { GenEnum, GenExtension, GenFile, GenMessage } from "../../../../codegenv1/types.js";
2
+ import type { FeatureSet } from "./descriptor_pb.js";
3
+ import type { Message } from "../../../../types.js";
4
+ /**
5
+ * Describes the file google/protobuf/cpp_features.proto.
6
+ */
7
+ export declare const file_google_protobuf_cpp_features: GenFile;
8
+ /**
9
+ * @generated from message pb.CppFeatures
10
+ */
11
+ export type CppFeatures = Message<"pb.CppFeatures"> & {
12
+ /**
13
+ * Whether or not to treat an enum field as closed. This option is only
14
+ * applicable to enum fields, and will be removed in the future. It is
15
+ * consistent with the legacy behavior of using proto3 enum types for proto2
16
+ * fields.
17
+ *
18
+ * @generated from field: optional bool legacy_closed_enum = 1;
19
+ */
20
+ legacyClosedEnum: boolean;
21
+ /**
22
+ * @generated from field: optional pb.CppFeatures.StringType string_type = 2;
23
+ */
24
+ stringType: CppFeatures_StringType;
25
+ /**
26
+ * @generated from field: optional bool enum_name_uses_string_view = 3;
27
+ */
28
+ enumNameUsesStringView: boolean;
29
+ };
30
+ /**
31
+ * @generated from message pb.CppFeatures
32
+ */
33
+ export type CppFeaturesJson = {
34
+ /**
35
+ * Whether or not to treat an enum field as closed. This option is only
36
+ * applicable to enum fields, and will be removed in the future. It is
37
+ * consistent with the legacy behavior of using proto3 enum types for proto2
38
+ * fields.
39
+ *
40
+ * @generated from field: optional bool legacy_closed_enum = 1;
41
+ */
42
+ legacyClosedEnum?: boolean;
43
+ /**
44
+ * @generated from field: optional pb.CppFeatures.StringType string_type = 2;
45
+ */
46
+ stringType?: CppFeatures_StringTypeJson;
47
+ /**
48
+ * @generated from field: optional bool enum_name_uses_string_view = 3;
49
+ */
50
+ enumNameUsesStringView?: boolean;
51
+ };
52
+ /**
53
+ * Describes the message pb.CppFeatures.
54
+ * Use `create(CppFeaturesSchema)` to create a new message.
55
+ */
56
+ export declare const CppFeaturesSchema: GenMessage<CppFeatures, CppFeaturesJson>;
57
+ /**
58
+ * @generated from enum pb.CppFeatures.StringType
59
+ */
60
+ export declare enum CppFeatures_StringType {
61
+ /**
62
+ * @generated from enum value: STRING_TYPE_UNKNOWN = 0;
63
+ */
64
+ STRING_TYPE_UNKNOWN = 0,
65
+ /**
66
+ * @generated from enum value: VIEW = 1;
67
+ */
68
+ VIEW = 1,
69
+ /**
70
+ * @generated from enum value: CORD = 2;
71
+ */
72
+ CORD = 2,
73
+ /**
74
+ * @generated from enum value: STRING = 3;
75
+ */
76
+ STRING = 3
77
+ }
78
+ /**
79
+ * @generated from enum pb.CppFeatures.StringType
80
+ */
81
+ export type CppFeatures_StringTypeJson = "STRING_TYPE_UNKNOWN" | "VIEW" | "CORD" | "STRING";
82
+ /**
83
+ * Describes the enum pb.CppFeatures.StringType.
84
+ */
85
+ export declare const CppFeatures_StringTypeSchema: GenEnum<CppFeatures_StringType, CppFeatures_StringTypeJson>;
86
+ /**
87
+ * @generated from extension: optional pb.CppFeatures cpp = 1000;
88
+ */
89
+ export declare const cpp: GenExtension<FeatureSet, CppFeatures>;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ // Copyright 2021-2025 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.cpp = exports.CppFeatures_StringTypeSchema = exports.CppFeatures_StringType = exports.CppFeaturesSchema = exports.file_google_protobuf_cpp_features = void 0;
17
+ const file_js_1 = require("../../../../codegenv1/file.js");
18
+ const descriptor_pb_js_1 = require("./descriptor_pb.js");
19
+ const message_js_1 = require("../../../../codegenv1/message.js");
20
+ const enum_js_1 = require("../../../../codegenv1/enum.js");
21
+ const extension_js_1 = require("../../../../codegenv1/extension.js");
22
+ /**
23
+ * Describes the file google/protobuf/cpp_features.proto.
24
+ */
25
+ exports.file_google_protobuf_cpp_features = (0, file_js_1.fileDesc)("CiJnb29nbGUvcHJvdG9idWYvY3BwX2ZlYXR1cmVzLnByb3RvEgJwYiL8AwoLQ3BwRmVhdHVyZXMS+wEKEmxlZ2FjeV9jbG9zZWRfZW51bRgBIAEoCELeAYgBAZgBBJgBAaIBCRIEdHJ1ZRiEB6IBChIFZmFsc2UY5weyAbgBCOgHEOgHGq8BVGhlIGxlZ2FjeSBjbG9zZWQgZW51bSBiZWhhdmlvciBpbiBDKysgaXMgZGVwcmVjYXRlZCBhbmQgaXMgc2NoZWR1bGVkIHRvIGJlIHJlbW92ZWQgaW4gZWRpdGlvbiAyMDI1LiAgU2VlIGh0dHA6Ly9wcm90b2J1Zi5kZXYvcHJvZ3JhbW1pbmctZ3VpZGVzL2VudW0vI2NwcCBmb3IgbW9yZSBpbmZvcm1hdGlvbhJaCgtzdHJpbmdfdHlwZRgCIAEoDjIaLnBiLkNwcEZlYXR1cmVzLlN0cmluZ1R5cGVCKYgBAZgBBJgBAaIBCxIGU1RSSU5HGIQHogEJEgRWSUVXGOkHsgEDCOgHEkwKGmVudW1fbmFtZV91c2VzX3N0cmluZ192aWV3GAMgASgIQiiIAQKYAQaYAQGiAQoSBWZhbHNlGIQHogEJEgR0cnVlGOkHsgEDCOkHIkUKClN0cmluZ1R5cGUSFwoTU1RSSU5HX1RZUEVfVU5LTk9XThAAEggKBFZJRVcQARIICgRDT1JEEAISCgoGU1RSSU5HEAM6PwoDY3BwEhsuZ29vZ2xlLnByb3RvYnVmLkZlYXR1cmVTZXQY6AcgASgLMg8ucGIuQ3BwRmVhdHVyZXNSA2NwcA", [descriptor_pb_js_1.file_google_protobuf_descriptor]);
26
+ /**
27
+ * Describes the message pb.CppFeatures.
28
+ * Use `create(CppFeaturesSchema)` to create a new message.
29
+ */
30
+ exports.CppFeaturesSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_cpp_features, 0);
31
+ /**
32
+ * @generated from enum pb.CppFeatures.StringType
33
+ */
34
+ var CppFeatures_StringType;
35
+ (function (CppFeatures_StringType) {
36
+ /**
37
+ * @generated from enum value: STRING_TYPE_UNKNOWN = 0;
38
+ */
39
+ CppFeatures_StringType[CppFeatures_StringType["STRING_TYPE_UNKNOWN"] = 0] = "STRING_TYPE_UNKNOWN";
40
+ /**
41
+ * @generated from enum value: VIEW = 1;
42
+ */
43
+ CppFeatures_StringType[CppFeatures_StringType["VIEW"] = 1] = "VIEW";
44
+ /**
45
+ * @generated from enum value: CORD = 2;
46
+ */
47
+ CppFeatures_StringType[CppFeatures_StringType["CORD"] = 2] = "CORD";
48
+ /**
49
+ * @generated from enum value: STRING = 3;
50
+ */
51
+ CppFeatures_StringType[CppFeatures_StringType["STRING"] = 3] = "STRING";
52
+ })(CppFeatures_StringType || (exports.CppFeatures_StringType = CppFeatures_StringType = {}));
53
+ /**
54
+ * Describes the enum pb.CppFeatures.StringType.
55
+ */
56
+ exports.CppFeatures_StringTypeSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_cpp_features, 0, 0);
57
+ /**
58
+ * @generated from extension: optional pb.CppFeatures cpp = 1000;
59
+ */
60
+ exports.cpp = (0, extension_js_1.extDesc)(exports.file_google_protobuf_cpp_features, 0);
@@ -0,0 +1,122 @@
1
+ import type { GenEnum, GenExtension, GenFile, GenMessage } from "../../../../codegenv1/types.js";
2
+ import type { FeatureSet } from "./descriptor_pb.js";
3
+ import type { Message } from "../../../../types.js";
4
+ /**
5
+ * Describes the file google/protobuf/go_features.proto.
6
+ */
7
+ export declare const file_google_protobuf_go_features: GenFile;
8
+ /**
9
+ * @generated from message pb.GoFeatures
10
+ */
11
+ export type GoFeatures = Message<"pb.GoFeatures"> & {
12
+ /**
13
+ * Whether or not to generate the deprecated UnmarshalJSON method for enums.
14
+ * Can only be true for proto using the Open Struct api.
15
+ *
16
+ * @generated from field: optional bool legacy_unmarshal_json_enum = 1;
17
+ */
18
+ legacyUnmarshalJsonEnum: boolean;
19
+ /**
20
+ * One of OPEN, HYBRID or OPAQUE.
21
+ *
22
+ * @generated from field: optional pb.GoFeatures.APILevel api_level = 2;
23
+ */
24
+ apiLevel: GoFeatures_APILevel;
25
+ /**
26
+ * @generated from field: optional pb.GoFeatures.StripEnumPrefix strip_enum_prefix = 3;
27
+ */
28
+ stripEnumPrefix: GoFeatures_StripEnumPrefix;
29
+ };
30
+ /**
31
+ * @generated from message pb.GoFeatures
32
+ */
33
+ export type GoFeaturesJson = {
34
+ /**
35
+ * Whether or not to generate the deprecated UnmarshalJSON method for enums.
36
+ * Can only be true for proto using the Open Struct api.
37
+ *
38
+ * @generated from field: optional bool legacy_unmarshal_json_enum = 1;
39
+ */
40
+ legacyUnmarshalJsonEnum?: boolean;
41
+ /**
42
+ * One of OPEN, HYBRID or OPAQUE.
43
+ *
44
+ * @generated from field: optional pb.GoFeatures.APILevel api_level = 2;
45
+ */
46
+ apiLevel?: GoFeatures_APILevelJson;
47
+ /**
48
+ * @generated from field: optional pb.GoFeatures.StripEnumPrefix strip_enum_prefix = 3;
49
+ */
50
+ stripEnumPrefix?: GoFeatures_StripEnumPrefixJson;
51
+ };
52
+ /**
53
+ * Describes the message pb.GoFeatures.
54
+ * Use `create(GoFeaturesSchema)` to create a new message.
55
+ */
56
+ export declare const GoFeaturesSchema: GenMessage<GoFeatures, GoFeaturesJson>;
57
+ /**
58
+ * @generated from enum pb.GoFeatures.APILevel
59
+ */
60
+ export declare enum GoFeatures_APILevel {
61
+ /**
62
+ * API_LEVEL_UNSPECIFIED results in selecting the OPEN API,
63
+ * but needs to be a separate value to distinguish between
64
+ * an explicitly set api level or a missing api level.
65
+ *
66
+ * @generated from enum value: API_LEVEL_UNSPECIFIED = 0;
67
+ */
68
+ API_LEVEL_UNSPECIFIED = 0,
69
+ /**
70
+ * @generated from enum value: API_OPEN = 1;
71
+ */
72
+ API_OPEN = 1,
73
+ /**
74
+ * @generated from enum value: API_HYBRID = 2;
75
+ */
76
+ API_HYBRID = 2,
77
+ /**
78
+ * @generated from enum value: API_OPAQUE = 3;
79
+ */
80
+ API_OPAQUE = 3
81
+ }
82
+ /**
83
+ * @generated from enum pb.GoFeatures.APILevel
84
+ */
85
+ export type GoFeatures_APILevelJson = "API_LEVEL_UNSPECIFIED" | "API_OPEN" | "API_HYBRID" | "API_OPAQUE";
86
+ /**
87
+ * Describes the enum pb.GoFeatures.APILevel.
88
+ */
89
+ export declare const GoFeatures_APILevelSchema: GenEnum<GoFeatures_APILevel, GoFeatures_APILevelJson>;
90
+ /**
91
+ * @generated from enum pb.GoFeatures.StripEnumPrefix
92
+ */
93
+ export declare enum GoFeatures_StripEnumPrefix {
94
+ /**
95
+ * @generated from enum value: STRIP_ENUM_PREFIX_UNSPECIFIED = 0;
96
+ */
97
+ UNSPECIFIED = 0,
98
+ /**
99
+ * @generated from enum value: STRIP_ENUM_PREFIX_KEEP = 1;
100
+ */
101
+ KEEP = 1,
102
+ /**
103
+ * @generated from enum value: STRIP_ENUM_PREFIX_GENERATE_BOTH = 2;
104
+ */
105
+ GENERATE_BOTH = 2,
106
+ /**
107
+ * @generated from enum value: STRIP_ENUM_PREFIX_STRIP = 3;
108
+ */
109
+ STRIP = 3
110
+ }
111
+ /**
112
+ * @generated from enum pb.GoFeatures.StripEnumPrefix
113
+ */
114
+ export type GoFeatures_StripEnumPrefixJson = "STRIP_ENUM_PREFIX_UNSPECIFIED" | "STRIP_ENUM_PREFIX_KEEP" | "STRIP_ENUM_PREFIX_GENERATE_BOTH" | "STRIP_ENUM_PREFIX_STRIP";
115
+ /**
116
+ * Describes the enum pb.GoFeatures.StripEnumPrefix.
117
+ */
118
+ export declare const GoFeatures_StripEnumPrefixSchema: GenEnum<GoFeatures_StripEnumPrefix, GoFeatures_StripEnumPrefixJson>;
119
+ /**
120
+ * @generated from extension: optional pb.GoFeatures go = 1002;
121
+ */
122
+ export declare const go: GenExtension<FeatureSet, GoFeatures>;
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ // Copyright 2021-2025 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.go = exports.GoFeatures_StripEnumPrefixSchema = exports.GoFeatures_StripEnumPrefix = exports.GoFeatures_APILevelSchema = exports.GoFeatures_APILevel = exports.GoFeaturesSchema = exports.file_google_protobuf_go_features = void 0;
17
+ const file_js_1 = require("../../../../codegenv1/file.js");
18
+ const descriptor_pb_js_1 = require("./descriptor_pb.js");
19
+ const message_js_1 = require("../../../../codegenv1/message.js");
20
+ const enum_js_1 = require("../../../../codegenv1/enum.js");
21
+ const extension_js_1 = require("../../../../codegenv1/extension.js");
22
+ /**
23
+ * Describes the file google/protobuf/go_features.proto.
24
+ */
25
+ exports.file_google_protobuf_go_features = (0, file_js_1.fileDesc)("CiFnb29nbGUvcHJvdG9idWYvZ29fZmVhdHVyZXMucHJvdG8SAnBiIvcECgpHb0ZlYXR1cmVzEqUBChpsZWdhY3lfdW5tYXJzaGFsX2pzb25fZW51bRgBIAEoCEKAAYgBAZgBBpgBAaIBCRIEdHJ1ZRiEB6IBChIFZmFsc2UY5weyAVsI6AcQ6AcaU1RoZSBsZWdhY3kgVW5tYXJzaGFsSlNPTiBBUEkgaXMgZGVwcmVjYXRlZCBhbmQgd2lsbCBiZSByZW1vdmVkIGluIGEgZnV0dXJlIGVkaXRpb24uEmoKCWFwaV9sZXZlbBgCIAEoDjIXLnBiLkdvRmVhdHVyZXMuQVBJTGV2ZWxCPogBAZgBA5gBAaIBGhIVQVBJX0xFVkVMX1VOU1BFQ0lGSUVEGIQHogEPEgpBUElfT1BBUVVFGOkHsgEDCOgHEmsKEXN0cmlwX2VudW1fcHJlZml4GAMgASgOMh4ucGIuR29GZWF0dXJlcy5TdHJpcEVudW1QcmVmaXhCMIgBAZgBBpgBB5gBAaIBGxIWU1RSSVBfRU5VTV9QUkVGSVhfS0VFUBiEB7IBAwjpByJTCghBUElMZXZlbBIZChVBUElfTEVWRUxfVU5TUEVDSUZJRUQQABIMCghBUElfT1BFThABEg4KCkFQSV9IWUJSSUQQAhIOCgpBUElfT1BBUVVFEAMikgEKD1N0cmlwRW51bVByZWZpeBIhCh1TVFJJUF9FTlVNX1BSRUZJWF9VTlNQRUNJRklFRBAAEhoKFlNUUklQX0VOVU1fUFJFRklYX0tFRVAQARIjCh9TVFJJUF9FTlVNX1BSRUZJWF9HRU5FUkFURV9CT1RIEAISGwoXU1RSSVBfRU5VTV9QUkVGSVhfU1RSSVAQAzo8CgJnbxIbLmdvb2dsZS5wcm90b2J1Zi5GZWF0dXJlU2V0GOoHIAEoCzIOLnBiLkdvRmVhdHVyZXNSAmdvQi9aLWdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2dvZmVhdHVyZXNwYg", [descriptor_pb_js_1.file_google_protobuf_descriptor]);
26
+ /**
27
+ * Describes the message pb.GoFeatures.
28
+ * Use `create(GoFeaturesSchema)` to create a new message.
29
+ */
30
+ exports.GoFeaturesSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_go_features, 0);
31
+ /**
32
+ * @generated from enum pb.GoFeatures.APILevel
33
+ */
34
+ var GoFeatures_APILevel;
35
+ (function (GoFeatures_APILevel) {
36
+ /**
37
+ * API_LEVEL_UNSPECIFIED results in selecting the OPEN API,
38
+ * but needs to be a separate value to distinguish between
39
+ * an explicitly set api level or a missing api level.
40
+ *
41
+ * @generated from enum value: API_LEVEL_UNSPECIFIED = 0;
42
+ */
43
+ GoFeatures_APILevel[GoFeatures_APILevel["API_LEVEL_UNSPECIFIED"] = 0] = "API_LEVEL_UNSPECIFIED";
44
+ /**
45
+ * @generated from enum value: API_OPEN = 1;
46
+ */
47
+ GoFeatures_APILevel[GoFeatures_APILevel["API_OPEN"] = 1] = "API_OPEN";
48
+ /**
49
+ * @generated from enum value: API_HYBRID = 2;
50
+ */
51
+ GoFeatures_APILevel[GoFeatures_APILevel["API_HYBRID"] = 2] = "API_HYBRID";
52
+ /**
53
+ * @generated from enum value: API_OPAQUE = 3;
54
+ */
55
+ GoFeatures_APILevel[GoFeatures_APILevel["API_OPAQUE"] = 3] = "API_OPAQUE";
56
+ })(GoFeatures_APILevel || (exports.GoFeatures_APILevel = GoFeatures_APILevel = {}));
57
+ /**
58
+ * Describes the enum pb.GoFeatures.APILevel.
59
+ */
60
+ exports.GoFeatures_APILevelSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_go_features, 0, 0);
61
+ /**
62
+ * @generated from enum pb.GoFeatures.StripEnumPrefix
63
+ */
64
+ var GoFeatures_StripEnumPrefix;
65
+ (function (GoFeatures_StripEnumPrefix) {
66
+ /**
67
+ * @generated from enum value: STRIP_ENUM_PREFIX_UNSPECIFIED = 0;
68
+ */
69
+ GoFeatures_StripEnumPrefix[GoFeatures_StripEnumPrefix["UNSPECIFIED"] = 0] = "UNSPECIFIED";
70
+ /**
71
+ * @generated from enum value: STRIP_ENUM_PREFIX_KEEP = 1;
72
+ */
73
+ GoFeatures_StripEnumPrefix[GoFeatures_StripEnumPrefix["KEEP"] = 1] = "KEEP";
74
+ /**
75
+ * @generated from enum value: STRIP_ENUM_PREFIX_GENERATE_BOTH = 2;
76
+ */
77
+ GoFeatures_StripEnumPrefix[GoFeatures_StripEnumPrefix["GENERATE_BOTH"] = 2] = "GENERATE_BOTH";
78
+ /**
79
+ * @generated from enum value: STRIP_ENUM_PREFIX_STRIP = 3;
80
+ */
81
+ GoFeatures_StripEnumPrefix[GoFeatures_StripEnumPrefix["STRIP"] = 3] = "STRIP";
82
+ })(GoFeatures_StripEnumPrefix || (exports.GoFeatures_StripEnumPrefix = GoFeatures_StripEnumPrefix = {}));
83
+ /**
84
+ * Describes the enum pb.GoFeatures.StripEnumPrefix.
85
+ */
86
+ exports.GoFeatures_StripEnumPrefixSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_go_features, 0, 1);
87
+ /**
88
+ * @generated from extension: optional pb.GoFeatures go = 1002;
89
+ */
90
+ exports.go = (0, extension_js_1.extDesc)(exports.file_google_protobuf_go_features, 0);
@@ -0,0 +1,113 @@
1
+ import type { GenEnum, GenExtension, GenFile, GenMessage } from "../../../../codegenv1/types.js";
2
+ import type { FeatureSet } from "./descriptor_pb.js";
3
+ import type { Message } from "../../../../types.js";
4
+ /**
5
+ * Describes the file google/protobuf/java_features.proto.
6
+ */
7
+ export declare const file_google_protobuf_java_features: GenFile;
8
+ /**
9
+ * @generated from message pb.JavaFeatures
10
+ */
11
+ export type JavaFeatures = Message<"pb.JavaFeatures"> & {
12
+ /**
13
+ * Whether or not to treat an enum field as closed. This option is only
14
+ * applicable to enum fields, and will be removed in the future. It is
15
+ * consistent with the legacy behavior of using proto3 enum types for proto2
16
+ * fields.
17
+ *
18
+ * @generated from field: optional bool legacy_closed_enum = 1;
19
+ */
20
+ legacyClosedEnum: boolean;
21
+ /**
22
+ * @generated from field: optional pb.JavaFeatures.Utf8Validation utf8_validation = 2;
23
+ */
24
+ utf8Validation: JavaFeatures_Utf8Validation;
25
+ /**
26
+ * Whether to use the old default outer class name scheme, or the new feature
27
+ * which adds a "Proto" suffix to the outer class name.
28
+ *
29
+ * Users will not be able to set this option, because we removed it in the
30
+ * same edition that it was introduced. But we use it to determine which
31
+ * naming scheme to use for outer class name defaults.
32
+ *
33
+ * @generated from field: optional bool use_old_outer_classname_default = 4;
34
+ */
35
+ useOldOuterClassnameDefault: boolean;
36
+ };
37
+ /**
38
+ * @generated from message pb.JavaFeatures
39
+ */
40
+ export type JavaFeaturesJson = {
41
+ /**
42
+ * Whether or not to treat an enum field as closed. This option is only
43
+ * applicable to enum fields, and will be removed in the future. It is
44
+ * consistent with the legacy behavior of using proto3 enum types for proto2
45
+ * fields.
46
+ *
47
+ * @generated from field: optional bool legacy_closed_enum = 1;
48
+ */
49
+ legacyClosedEnum?: boolean;
50
+ /**
51
+ * @generated from field: optional pb.JavaFeatures.Utf8Validation utf8_validation = 2;
52
+ */
53
+ utf8Validation?: JavaFeatures_Utf8ValidationJson;
54
+ /**
55
+ * Whether to use the old default outer class name scheme, or the new feature
56
+ * which adds a "Proto" suffix to the outer class name.
57
+ *
58
+ * Users will not be able to set this option, because we removed it in the
59
+ * same edition that it was introduced. But we use it to determine which
60
+ * naming scheme to use for outer class name defaults.
61
+ *
62
+ * @generated from field: optional bool use_old_outer_classname_default = 4;
63
+ */
64
+ useOldOuterClassnameDefault?: boolean;
65
+ };
66
+ /**
67
+ * Describes the message pb.JavaFeatures.
68
+ * Use `create(JavaFeaturesSchema)` to create a new message.
69
+ */
70
+ export declare const JavaFeaturesSchema: GenMessage<JavaFeatures, JavaFeaturesJson>;
71
+ /**
72
+ * The UTF8 validation strategy to use. See go/editions-utf8-validation for
73
+ * more information on this feature.
74
+ *
75
+ * @generated from enum pb.JavaFeatures.Utf8Validation
76
+ */
77
+ export declare enum JavaFeatures_Utf8Validation {
78
+ /**
79
+ * Invalid default, which should never be used.
80
+ *
81
+ * @generated from enum value: UTF8_VALIDATION_UNKNOWN = 0;
82
+ */
83
+ UTF8_VALIDATION_UNKNOWN = 0,
84
+ /**
85
+ * Respect the UTF8 validation behavior specified by the global
86
+ * utf8_validation feature.
87
+ *
88
+ * @generated from enum value: DEFAULT = 1;
89
+ */
90
+ DEFAULT = 1,
91
+ /**
92
+ * Verifies UTF8 validity overriding the global utf8_validation
93
+ * feature. This represents the legacy java_string_check_utf8 option.
94
+ *
95
+ * @generated from enum value: VERIFY = 2;
96
+ */
97
+ VERIFY = 2
98
+ }
99
+ /**
100
+ * The UTF8 validation strategy to use. See go/editions-utf8-validation for
101
+ * more information on this feature.
102
+ *
103
+ * @generated from enum pb.JavaFeatures.Utf8Validation
104
+ */
105
+ export type JavaFeatures_Utf8ValidationJson = "UTF8_VALIDATION_UNKNOWN" | "DEFAULT" | "VERIFY";
106
+ /**
107
+ * Describes the enum pb.JavaFeatures.Utf8Validation.
108
+ */
109
+ export declare const JavaFeatures_Utf8ValidationSchema: GenEnum<JavaFeatures_Utf8Validation, JavaFeatures_Utf8ValidationJson>;
110
+ /**
111
+ * @generated from extension: optional pb.JavaFeatures java = 1001;
112
+ */
113
+ export declare const java: GenExtension<FeatureSet, JavaFeatures>;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ // Copyright 2021-2025 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.java = exports.JavaFeatures_Utf8ValidationSchema = exports.JavaFeatures_Utf8Validation = exports.JavaFeaturesSchema = exports.file_google_protobuf_java_features = void 0;
17
+ const file_js_1 = require("../../../../codegenv1/file.js");
18
+ const descriptor_pb_js_1 = require("./descriptor_pb.js");
19
+ const message_js_1 = require("../../../../codegenv1/message.js");
20
+ const enum_js_1 = require("../../../../codegenv1/enum.js");
21
+ const extension_js_1 = require("../../../../codegenv1/extension.js");
22
+ /**
23
+ * Describes the file google/protobuf/java_features.proto.
24
+ */
25
+ exports.file_google_protobuf_java_features = (0, file_js_1.fileDesc)("CiNnb29nbGUvcHJvdG9idWYvamF2YV9mZWF0dXJlcy5wcm90bxICcGIizAUKDEphdmFGZWF0dXJlcxL+AQoSbGVnYWN5X2Nsb3NlZF9lbnVtGAEgASgIQuEBiAEBmAEEmAEBogEJEgR0cnVlGIQHogEKEgVmYWxzZRjnB7IBuwEI6AcQ6AcasgFUaGUgbGVnYWN5IGNsb3NlZCBlbnVtIGJlaGF2aW9yIGluIEphdmEgaXMgZGVwcmVjYXRlZCBhbmQgaXMgc2NoZWR1bGVkIHRvIGJlIHJlbW92ZWQgaW4gZWRpdGlvbiAyMDI1LiAgU2VlIGh0dHA6Ly9wcm90b2J1Zi5kZXYvcHJvZ3JhbW1pbmctZ3VpZGVzL2VudW0vI2phdmEgZm9yIG1vcmUgaW5mb3JtYXRpb24uEp8CCg91dGY4X3ZhbGlkYXRpb24YAiABKA4yHy5wYi5KYXZhRmVhdHVyZXMuVXRmOFZhbGlkYXRpb25C5AGIAQGYAQSYAQGiAQwSB0RFRkFVTFQYhAeyAcgBCOgHEOkHGr8BVGhlIEphdmEtc3BlY2lmaWMgdXRmOCB2YWxpZGF0aW9uIGZlYXR1cmUgaXMgZGVwcmVjYXRlZCBhbmQgaXMgc2NoZWR1bGVkIHRvIGJlIHJlbW92ZWQgaW4gZWRpdGlvbiAyMDI1LiAgVXRmOCB2YWxpZGF0aW9uIGJlaGF2aW9yIHNob3VsZCB1c2UgdGhlIGdsb2JhbCBjcm9zcy1sYW5ndWFnZSB1dGY4X3ZhbGlkYXRpb24gZmVhdHVyZS4SUQofdXNlX29sZF9vdXRlcl9jbGFzc25hbWVfZGVmYXVsdBgEIAEoCEIoiAEBmAEBogEJEgR0cnVlGIQHogEKEgVmYWxzZRjpB7IBBgjpByDpByJGCg5VdGY4VmFsaWRhdGlvbhIbChdVVEY4X1ZBTElEQVRJT05fVU5LTk9XThAAEgsKB0RFRkFVTFQQARIKCgZWRVJJRlkQAjpCCgRqYXZhEhsuZ29vZ2xlLnByb3RvYnVmLkZlYXR1cmVTZXQY6QcgASgLMhAucGIuSmF2YUZlYXR1cmVzUgRqYXZhQigKE2NvbS5nb29nbGUucHJvdG9idWZCEUphdmFGZWF0dXJlc1Byb3Rv", [descriptor_pb_js_1.file_google_protobuf_descriptor]);
26
+ /**
27
+ * Describes the message pb.JavaFeatures.
28
+ * Use `create(JavaFeaturesSchema)` to create a new message.
29
+ */
30
+ exports.JavaFeaturesSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_java_features, 0);
31
+ /**
32
+ * The UTF8 validation strategy to use. See go/editions-utf8-validation for
33
+ * more information on this feature.
34
+ *
35
+ * @generated from enum pb.JavaFeatures.Utf8Validation
36
+ */
37
+ var JavaFeatures_Utf8Validation;
38
+ (function (JavaFeatures_Utf8Validation) {
39
+ /**
40
+ * Invalid default, which should never be used.
41
+ *
42
+ * @generated from enum value: UTF8_VALIDATION_UNKNOWN = 0;
43
+ */
44
+ JavaFeatures_Utf8Validation[JavaFeatures_Utf8Validation["UTF8_VALIDATION_UNKNOWN"] = 0] = "UTF8_VALIDATION_UNKNOWN";
45
+ /**
46
+ * Respect the UTF8 validation behavior specified by the global
47
+ * utf8_validation feature.
48
+ *
49
+ * @generated from enum value: DEFAULT = 1;
50
+ */
51
+ JavaFeatures_Utf8Validation[JavaFeatures_Utf8Validation["DEFAULT"] = 1] = "DEFAULT";
52
+ /**
53
+ * Verifies UTF8 validity overriding the global utf8_validation
54
+ * feature. This represents the legacy java_string_check_utf8 option.
55
+ *
56
+ * @generated from enum value: VERIFY = 2;
57
+ */
58
+ JavaFeatures_Utf8Validation[JavaFeatures_Utf8Validation["VERIFY"] = 2] = "VERIFY";
59
+ })(JavaFeatures_Utf8Validation || (exports.JavaFeatures_Utf8Validation = JavaFeatures_Utf8Validation = {}));
60
+ /**
61
+ * Describes the enum pb.JavaFeatures.Utf8Validation.
62
+ */
63
+ exports.JavaFeatures_Utf8ValidationSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_java_features, 0, 0);
64
+ /**
65
+ * @generated from extension: optional pb.JavaFeatures java = 1001;
66
+ */
67
+ exports.java = (0, extension_js_1.extDesc)(exports.file_google_protobuf_java_features, 0);