@bufbuild/protobuf 2.2.5 → 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.
Files changed (88) hide show
  1. package/dist/cjs/clone.js +4 -6
  2. package/dist/cjs/codegenv1/boot.js +1 -1
  3. package/dist/cjs/codegenv1/embed.js +0 -1
  4. package/dist/cjs/codegenv1/file.js +1 -1
  5. package/dist/cjs/codegenv1/symbols.js +4 -1
  6. package/dist/cjs/create.js +0 -1
  7. package/dist/cjs/equals.js +2 -1
  8. package/dist/cjs/extensions.js +1 -1
  9. package/dist/cjs/from-binary.js +5 -3
  10. package/dist/cjs/from-json.js +8 -10
  11. package/dist/cjs/proto-int64.js +4 -1
  12. package/dist/cjs/reflect/guard.js +2 -1
  13. package/dist/cjs/reflect/index.d.ts +1 -0
  14. package/dist/cjs/reflect/index.js +1 -0
  15. package/dist/cjs/reflect/names.d.ts +8 -0
  16. package/dist/cjs/reflect/names.js +28 -0
  17. package/dist/cjs/reflect/nested-types.d.ts +23 -0
  18. package/dist/cjs/reflect/nested-types.js +40 -0
  19. package/dist/cjs/reflect/path.d.ts +107 -0
  20. package/dist/cjs/reflect/path.js +376 -0
  21. package/dist/cjs/reflect/reflect-check.js +3 -3
  22. package/dist/cjs/reflect/reflect-types.d.ts +1 -1
  23. package/dist/cjs/reflect/reflect.js +9 -7
  24. package/dist/cjs/reflect/scalar.js +4 -5
  25. package/dist/cjs/reflect/unsafe.d.ts +3 -6
  26. package/dist/cjs/reflect/unsafe.js +11 -10
  27. package/dist/cjs/registry.js +24 -30
  28. package/dist/cjs/to-binary.js +1 -1
  29. package/dist/cjs/to-json.d.ts +6 -0
  30. package/dist/cjs/to-json.js +16 -18
  31. package/dist/cjs/wire/base64-encoding.js +4 -3
  32. package/dist/cjs/wire/binary-encoding.js +7 -6
  33. package/dist/cjs/wire/text-encoding.js +1 -1
  34. package/dist/cjs/wire/text-format.js +3 -4
  35. package/dist/cjs/wire/varint.js +0 -1
  36. package/dist/cjs/wkt/gen/google/protobuf/cpp_features_pb.d.ts +89 -0
  37. package/dist/cjs/wkt/gen/google/protobuf/cpp_features_pb.js +60 -0
  38. package/dist/cjs/wkt/gen/google/protobuf/go_features_pb.d.ts +122 -0
  39. package/dist/cjs/wkt/gen/google/protobuf/go_features_pb.js +90 -0
  40. package/dist/cjs/wkt/gen/google/protobuf/java_features_pb.d.ts +113 -0
  41. package/dist/cjs/wkt/gen/google/protobuf/java_features_pb.js +67 -0
  42. package/dist/cjs/wkt/index.d.ts +4 -1
  43. package/dist/cjs/wkt/index.js +4 -1
  44. package/dist/esm/clone.js +4 -6
  45. package/dist/esm/codegenv1/boot.js +1 -1
  46. package/dist/esm/codegenv1/embed.js +0 -1
  47. package/dist/esm/codegenv1/file.js +1 -1
  48. package/dist/esm/codegenv1/symbols.js +4 -1
  49. package/dist/esm/create.js +0 -2
  50. package/dist/esm/equals.js +2 -1
  51. package/dist/esm/extensions.js +1 -1
  52. package/dist/esm/from-binary.js +5 -3
  53. package/dist/esm/from-json.js +8 -10
  54. package/dist/esm/proto-int64.js +4 -1
  55. package/dist/esm/reflect/guard.js +2 -1
  56. package/dist/esm/reflect/index.d.ts +1 -0
  57. package/dist/esm/reflect/index.js +1 -0
  58. package/dist/esm/reflect/names.d.ts +8 -0
  59. package/dist/esm/reflect/names.js +27 -0
  60. package/dist/esm/reflect/nested-types.d.ts +23 -0
  61. package/dist/esm/reflect/nested-types.js +39 -0
  62. package/dist/esm/reflect/path.d.ts +107 -0
  63. package/dist/esm/reflect/path.js +369 -0
  64. package/dist/esm/reflect/reflect-check.js +3 -3
  65. package/dist/esm/reflect/reflect-types.d.ts +1 -1
  66. package/dist/esm/reflect/reflect-types.js +0 -1
  67. package/dist/esm/reflect/reflect.js +9 -7
  68. package/dist/esm/reflect/scalar.js +4 -5
  69. package/dist/esm/reflect/unsafe.d.ts +3 -6
  70. package/dist/esm/reflect/unsafe.js +11 -10
  71. package/dist/esm/registry.js +24 -30
  72. package/dist/esm/to-binary.js +1 -1
  73. package/dist/esm/to-json.d.ts +6 -0
  74. package/dist/esm/to-json.js +16 -18
  75. package/dist/esm/wire/base64-encoding.js +4 -3
  76. package/dist/esm/wire/binary-encoding.js +7 -6
  77. package/dist/esm/wire/text-encoding.js +1 -1
  78. package/dist/esm/wire/text-format.js +3 -4
  79. package/dist/esm/wire/varint.js +0 -1
  80. package/dist/esm/wkt/gen/google/protobuf/cpp_features_pb.d.ts +89 -0
  81. package/dist/esm/wkt/gen/google/protobuf/cpp_features_pb.js +57 -0
  82. package/dist/esm/wkt/gen/google/protobuf/go_features_pb.d.ts +122 -0
  83. package/dist/esm/wkt/gen/google/protobuf/go_features_pb.js +87 -0
  84. package/dist/esm/wkt/gen/google/protobuf/java_features_pb.d.ts +113 -0
  85. package/dist/esm/wkt/gen/google/protobuf/java_features_pb.js +64 -0
  86. package/dist/esm/wkt/index.d.ts +4 -1
  87. package/dist/esm/wkt/index.js +4 -1
  88. package/package.json +9 -24
@@ -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);
@@ -1,12 +1,15 @@
1
1
  export * from "./timestamp.js";
2
2
  export * from "./any.js";
3
3
  export * from "./wrappers.js";
4
- export * from "./gen/google/protobuf/api_pb.js";
5
4
  export * from "./gen/google/protobuf/any_pb.js";
5
+ export * from "./gen/google/protobuf/api_pb.js";
6
+ export * from "./gen/google/protobuf/cpp_features_pb.js";
6
7
  export * from "./gen/google/protobuf/descriptor_pb.js";
7
8
  export * from "./gen/google/protobuf/duration_pb.js";
8
9
  export * from "./gen/google/protobuf/empty_pb.js";
9
10
  export * from "./gen/google/protobuf/field_mask_pb.js";
11
+ export * from "./gen/google/protobuf/go_features_pb.js";
12
+ export * from "./gen/google/protobuf/java_features_pb.js";
10
13
  export * from "./gen/google/protobuf/source_context_pb.js";
11
14
  export * from "./gen/google/protobuf/struct_pb.js";
12
15
  export * from "./gen/google/protobuf/timestamp_pb.js";
@@ -30,12 +30,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
30
30
  __exportStar(require("./timestamp.js"), exports);
31
31
  __exportStar(require("./any.js"), exports);
32
32
  __exportStar(require("./wrappers.js"), exports);
33
- __exportStar(require("./gen/google/protobuf/api_pb.js"), exports);
34
33
  __exportStar(require("./gen/google/protobuf/any_pb.js"), exports);
34
+ __exportStar(require("./gen/google/protobuf/api_pb.js"), exports);
35
+ __exportStar(require("./gen/google/protobuf/cpp_features_pb.js"), exports);
35
36
  __exportStar(require("./gen/google/protobuf/descriptor_pb.js"), exports);
36
37
  __exportStar(require("./gen/google/protobuf/duration_pb.js"), exports);
37
38
  __exportStar(require("./gen/google/protobuf/empty_pb.js"), exports);
38
39
  __exportStar(require("./gen/google/protobuf/field_mask_pb.js"), exports);
40
+ __exportStar(require("./gen/google/protobuf/go_features_pb.js"), exports);
41
+ __exportStar(require("./gen/google/protobuf/java_features_pb.js"), exports);
39
42
  __exportStar(require("./gen/google/protobuf/source_context_pb.js"), exports);
40
43
  __exportStar(require("./gen/google/protobuf/struct_pb.js"), exports);
41
44
  __exportStar(require("./gen/google/protobuf/timestamp_pb.js"), exports);
package/dist/esm/clone.js CHANGED
@@ -27,24 +27,22 @@ function cloneReflect(i) {
27
27
  continue;
28
28
  }
29
29
  switch (f.fieldKind) {
30
- default: {
31
- o.set(f, cloneSingular(f, i.get(f)));
32
- break;
33
- }
34
30
  case "list":
35
- // eslint-disable-next-line no-case-declarations
36
31
  const list = o.get(f);
37
32
  for (const item of i.get(f)) {
38
33
  list.add(cloneSingular(f, item));
39
34
  }
40
35
  break;
41
36
  case "map":
42
- // eslint-disable-next-line no-case-declarations
43
37
  const map = o.get(f);
44
38
  for (const entry of i.get(f).entries()) {
45
39
  map.set(entry[0], cloneSingular(f, entry[1]));
46
40
  }
47
41
  break;
42
+ default: {
43
+ o.set(f, cloneSingular(f, i.get(f)));
44
+ break;
45
+ }
48
46
  }
49
47
  }
50
48
  const unknown = i.getUnknown();
@@ -25,7 +25,7 @@ export function boot(boot) {
25
25
  const root = bootFileDescriptorProto(boot);
26
26
  root.messageType.forEach(restoreJsonNames);
27
27
  const reg = createFileRegistry(root, () => undefined);
28
- // non-null assertion because we just created the registry from the file we look up
28
+ // biome-ignore lint/style/noNonNullAssertion: non-null assertion because we just created the registry from the file we look up
29
29
  return reg.getFile(root.name);
30
30
  }
31
31
  /**
@@ -230,7 +230,6 @@ function createEnumDescriptorBoot(proto) {
230
230
  * Assert that condition is truthy or throw error.
231
231
  */
232
232
  function assert(condition) {
233
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions -- we want the implicit conversion to boolean
234
233
  if (!condition) {
235
234
  throw new Error();
236
235
  }
@@ -27,6 +27,6 @@ export function fileDesc(b64, imports) {
27
27
  root.messageType.forEach(restoreJsonNames);
28
28
  root.dependency = (_a = imports === null || imports === void 0 ? void 0 : imports.map((f) => f.proto.name)) !== null && _a !== void 0 ? _a : [];
29
29
  const reg = createFileRegistry(root, (protoFileName) => imports === null || imports === void 0 ? void 0 : imports.find((f) => f.proto.name === protoFileName));
30
- // non-null assertion because we just created the registry from the file we look up
30
+ // biome-ignore lint/style/noNonNullAssertion: non-null assertion because we just created the registry from the file we look up
31
31
  return reg.getFile(root.name);
32
32
  }
@@ -22,10 +22,13 @@ export const wktPublicImportPaths = {
22
22
  "google/protobuf/compiler/plugin.proto": packageName + "/wkt",
23
23
  "google/protobuf/any.proto": packageName + "/wkt",
24
24
  "google/protobuf/api.proto": packageName + "/wkt",
25
+ "google/protobuf/cpp_features.proto": packageName + "/wkt",
25
26
  "google/protobuf/descriptor.proto": packageName + "/wkt",
26
27
  "google/protobuf/duration.proto": packageName + "/wkt",
27
28
  "google/protobuf/empty.proto": packageName + "/wkt",
28
29
  "google/protobuf/field_mask.proto": packageName + "/wkt",
30
+ "google/protobuf/go_features.proto": packageName + "/wkt",
31
+ "google/protobuf/java_features.proto": packageName + "/wkt",
29
32
  "google/protobuf/source_context.proto": packageName + "/wkt",
30
33
  "google/protobuf/struct.proto": packageName + "/wkt",
31
34
  "google/protobuf/timestamp.proto": packageName + "/wkt",
@@ -35,7 +38,7 @@ export const wktPublicImportPaths = {
35
38
  /**
36
39
  * @private
37
40
  */
38
- // prettier-ignore
41
+ // biome-ignore format: want this to read well
39
42
  export const symbols = {
40
43
  isMessage: { typeOnly: false, bootstrapWktFrom: "../../is-message.js", from: packageName },
41
44
  Message: { typeOnly: true, bootstrapWktFrom: "../../types.js", from: packageName },
@@ -14,7 +14,6 @@
14
14
  import { isMessage } from "./is-message.js";
15
15
  import { ScalarType, } from "./descriptors.js";
16
16
  import { scalarZeroValue } from "./reflect/scalar.js";
17
- import { FieldError } from "./reflect/error.js";
18
17
  import { isObject } from "./reflect/guard.js";
19
18
  import { unsafeGet, unsafeOneofCase, unsafeSet } from "./reflect/unsafe.js";
20
19
  import { isWrapperDesc } from "./wkt/wrappers.js";
@@ -62,7 +61,6 @@ function initMessage(messageDesc, message, init) {
62
61
  else {
63
62
  field = member;
64
63
  }
65
- // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check -- no need to convert enum
66
64
  switch (field.fieldKind) {
67
65
  case "message":
68
66
  value = toMessage(field, value);
@@ -162,7 +162,8 @@ function unknownEquals(a, b, registry) {
162
162
  return false;
163
163
  }
164
164
  for (let i = 0; i < unknownA.length; i++) {
165
- const a = unknownA[i], b = unknownB[i];
165
+ const a = unknownA[i];
166
+ const b = unknownB[i];
166
167
  if (a.no != b.no) {
167
168
  return false;
168
169
  }
@@ -142,7 +142,7 @@ export function createExtensionContainer(extension, value) {
142
142
  () => {
143
143
  const value = container[localName];
144
144
  if (value === undefined) {
145
- // Only message fields are undefined, rest will have a zero value.
145
+ // biome-ignore lint/style/noNonNullAssertion: Only message fields are undefined, rest will have a zero value.
146
146
  const desc = extension.message;
147
147
  if (isWrapperDesc(desc)) {
148
148
  return scalarZeroValue(desc.fields[0].scalar, desc.fields[0].longAsString);
@@ -54,7 +54,8 @@ export function mergeFromBinary(schema, target, bytes, options) {
54
54
  function readMessage(message, reader, options, delimited, lengthOrDelimitedFieldNo) {
55
55
  var _a;
56
56
  const end = delimited ? reader.len : reader.pos + lengthOrDelimitedFieldNo;
57
- let fieldNo, wireType;
57
+ let fieldNo;
58
+ let wireType;
58
59
  const unknownFields = (_a = message.getUnknown()) !== null && _a !== void 0 ? _a : [];
59
60
  while (reader.pos < end) {
60
61
  [fieldNo, wireType] = reader.tag();
@@ -73,7 +74,7 @@ function readMessage(message, reader, options, delimited, lengthOrDelimitedField
73
74
  }
74
75
  if (delimited) {
75
76
  if (wireType != WireType.EndGroup || fieldNo !== lengthOrDelimitedFieldNo) {
76
- throw new Error(`invalid end group tag`);
77
+ throw new Error("invalid end group tag");
77
78
  }
78
79
  }
79
80
  if (unknownFields.length > 0) {
@@ -105,7 +106,8 @@ export function readField(message, reader, field, wireType, options) {
105
106
  // Read a map field, expecting key field = 1, value field = 2
106
107
  function readMapEntry(reader, map, options) {
107
108
  const field = map.field();
108
- let key, val;
109
+ let key;
110
+ let val;
109
111
  const end = reader.pos + reader.uint32();
110
112
  while (reader.pos < end) {
111
113
  const [fieldNo] = reader.tag();