@bufbuild/protobuf 2.10.2 → 2.12.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.
- package/dist/cjs/clone.js +1 -1
- package/dist/cjs/codegenv1/enum.js +1 -1
- package/dist/cjs/codegenv1/extension.js +1 -1
- package/dist/cjs/codegenv1/file.js +1 -1
- package/dist/cjs/codegenv1/index.js +1 -1
- package/dist/cjs/codegenv1/message.js +1 -1
- package/dist/cjs/codegenv1/service.js +1 -1
- package/dist/cjs/codegenv1/symbols.js +1 -1
- package/dist/cjs/codegenv1/types.js +1 -1
- package/dist/cjs/codegenv2/boot.js +1 -1
- package/dist/cjs/codegenv2/embed.js +1 -1
- package/dist/cjs/codegenv2/enum.js +1 -1
- package/dist/cjs/codegenv2/extension.js +1 -1
- package/dist/cjs/codegenv2/file.js +1 -1
- package/dist/cjs/codegenv2/index.js +1 -1
- package/dist/cjs/codegenv2/message.js +1 -1
- package/dist/cjs/codegenv2/restore-json-names.js +1 -1
- package/dist/cjs/codegenv2/scalar.js +1 -1
- package/dist/cjs/codegenv2/service.js +1 -1
- package/dist/cjs/codegenv2/symbols.js +1 -1
- package/dist/cjs/codegenv2/types.js +1 -1
- package/dist/cjs/create.js +1 -1
- package/dist/cjs/descriptors.d.ts +12 -5
- package/dist/cjs/descriptors.js +1 -1
- package/dist/cjs/equals.js +1 -1
- package/dist/cjs/extensions.js +1 -1
- package/dist/cjs/fields.js +1 -1
- package/dist/cjs/from-binary.js +8 -8
- package/dist/cjs/from-json.d.ts +1 -1
- package/dist/cjs/from-json.js +81 -89
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/is-message.js +1 -1
- package/dist/cjs/json-value.js +1 -1
- package/dist/cjs/merge.js +1 -1
- package/dist/cjs/proto-int64.js +1 -1
- package/dist/cjs/reflect/error.js +1 -1
- package/dist/cjs/reflect/guard.js +1 -1
- package/dist/cjs/reflect/index.js +1 -1
- package/dist/cjs/reflect/names.d.ts +11 -0
- package/dist/cjs/reflect/names.js +15 -1
- package/dist/cjs/reflect/nested-types.js +1 -1
- package/dist/cjs/reflect/path.d.ts +1 -1
- package/dist/cjs/reflect/path.js +1 -1
- package/dist/cjs/reflect/reflect-check.js +1 -1
- package/dist/cjs/reflect/reflect-types.js +1 -1
- package/dist/cjs/reflect/reflect.js +1 -1
- package/dist/cjs/reflect/scalar.js +1 -1
- package/dist/cjs/reflect/unsafe.js +1 -1
- package/dist/cjs/registry.js +25 -2
- package/dist/cjs/to-binary.js +1 -1
- package/dist/cjs/to-json.d.ts +1 -1
- package/dist/cjs/to-json.js +12 -15
- package/dist/cjs/types.d.ts +1 -1
- package/dist/cjs/types.js +1 -1
- package/dist/cjs/wire/base64-encoding.js +1 -1
- package/dist/cjs/wire/binary-encoding.d.ts +9 -7
- package/dist/cjs/wire/binary-encoding.js +19 -9
- package/dist/cjs/wire/index.js +1 -1
- package/dist/cjs/wire/size-delimited.js +1 -1
- package/dist/cjs/wire/text-encoding.d.ts +4 -2
- package/dist/cjs/wire/text-encoding.js +9 -2
- package/dist/cjs/wire/text-format.js +1 -1
- package/dist/cjs/wkt/any.js +1 -1
- package/dist/cjs/wkt/duration.js +1 -1
- package/dist/cjs/wkt/gen/google/protobuf/any_pb.js +1 -1
- package/dist/cjs/wkt/gen/google/protobuf/api_pb.d.ts +1 -1
- package/dist/cjs/wkt/gen/google/protobuf/api_pb.js +1 -1
- package/dist/cjs/wkt/gen/google/protobuf/compiler/plugin_pb.d.ts +2 -2
- package/dist/cjs/wkt/gen/google/protobuf/compiler/plugin_pb.js +1 -1
- package/dist/cjs/wkt/gen/google/protobuf/cpp_features_pb.js +1 -1
- package/dist/cjs/wkt/gen/google/protobuf/descriptor_pb.d.ts +37 -23
- package/dist/cjs/wkt/gen/google/protobuf/descriptor_pb.js +2 -2
- package/dist/cjs/wkt/gen/google/protobuf/duration_pb.js +1 -1
- package/dist/cjs/wkt/gen/google/protobuf/empty_pb.js +1 -1
- package/dist/cjs/wkt/gen/google/protobuf/field_mask_pb.d.ts +32 -36
- package/dist/cjs/wkt/gen/google/protobuf/field_mask_pb.js +1 -1
- package/dist/cjs/wkt/gen/google/protobuf/go_features_pb.d.ts +65 -0
- package/dist/cjs/wkt/gen/google/protobuf/go_features_pb.js +39 -3
- package/dist/cjs/wkt/gen/google/protobuf/java_features_pb.js +1 -1
- package/dist/cjs/wkt/gen/google/protobuf/source_context_pb.js +1 -1
- package/dist/cjs/wkt/gen/google/protobuf/struct_pb.js +1 -1
- package/dist/cjs/wkt/gen/google/protobuf/timestamp_pb.d.ts +5 -5
- package/dist/cjs/wkt/gen/google/protobuf/timestamp_pb.js +1 -1
- package/dist/cjs/wkt/gen/google/protobuf/type_pb.d.ts +3 -3
- package/dist/cjs/wkt/gen/google/protobuf/type_pb.js +1 -1
- package/dist/cjs/wkt/gen/google/protobuf/wrappers_pb.js +1 -1
- package/dist/cjs/wkt/index.js +1 -1
- package/dist/cjs/wkt/timestamp.js +1 -1
- package/dist/cjs/wkt/wrappers.d.ts +10 -0
- package/dist/cjs/wkt/wrappers.js +25 -1
- package/dist/esm/clone.js +1 -1
- package/dist/esm/codegenv1/enum.js +1 -1
- package/dist/esm/codegenv1/extension.js +1 -1
- package/dist/esm/codegenv1/file.js +1 -1
- package/dist/esm/codegenv1/index.js +1 -1
- package/dist/esm/codegenv1/message.js +1 -1
- package/dist/esm/codegenv1/service.js +1 -1
- package/dist/esm/codegenv1/symbols.js +1 -1
- package/dist/esm/codegenv1/types.js +1 -1
- package/dist/esm/codegenv2/boot.js +1 -1
- package/dist/esm/codegenv2/embed.js +1 -1
- package/dist/esm/codegenv2/enum.js +1 -1
- package/dist/esm/codegenv2/extension.js +1 -1
- package/dist/esm/codegenv2/file.js +1 -1
- package/dist/esm/codegenv2/index.js +1 -1
- package/dist/esm/codegenv2/message.js +1 -1
- package/dist/esm/codegenv2/restore-json-names.js +1 -1
- package/dist/esm/codegenv2/scalar.js +1 -1
- package/dist/esm/codegenv2/service.js +1 -1
- package/dist/esm/codegenv2/symbols.js +1 -1
- package/dist/esm/codegenv2/types.js +1 -1
- package/dist/esm/create.js +1 -1
- package/dist/esm/descriptors.d.ts +12 -5
- package/dist/esm/descriptors.js +1 -1
- package/dist/esm/equals.js +1 -1
- package/dist/esm/extensions.js +1 -1
- package/dist/esm/fields.js +1 -1
- package/dist/esm/from-binary.js +8 -8
- package/dist/esm/from-json.d.ts +1 -1
- package/dist/esm/from-json.js +82 -90
- package/dist/esm/index.js +1 -1
- package/dist/esm/is-message.js +1 -1
- package/dist/esm/json-value.js +1 -1
- package/dist/esm/merge.js +1 -1
- package/dist/esm/proto-int64.js +1 -1
- package/dist/esm/reflect/error.js +1 -1
- package/dist/esm/reflect/guard.js +1 -1
- package/dist/esm/reflect/index.js +1 -1
- package/dist/esm/reflect/names.d.ts +11 -0
- package/dist/esm/reflect/names.js +14 -1
- package/dist/esm/reflect/nested-types.js +1 -1
- package/dist/esm/reflect/path.d.ts +1 -1
- package/dist/esm/reflect/path.js +1 -1
- package/dist/esm/reflect/reflect-check.js +1 -1
- package/dist/esm/reflect/reflect-types.js +1 -1
- package/dist/esm/reflect/reflect.js +1 -1
- package/dist/esm/reflect/scalar.js +1 -1
- package/dist/esm/reflect/unsafe.js +1 -1
- package/dist/esm/registry.js +25 -2
- package/dist/esm/to-binary.js +1 -1
- package/dist/esm/to-json.d.ts +1 -1
- package/dist/esm/to-json.js +14 -17
- package/dist/esm/types.d.ts +1 -1
- package/dist/esm/types.js +1 -1
- package/dist/esm/wire/base64-encoding.js +1 -1
- package/dist/esm/wire/binary-encoding.d.ts +9 -7
- package/dist/esm/wire/binary-encoding.js +19 -9
- package/dist/esm/wire/index.js +1 -1
- package/dist/esm/wire/size-delimited.js +1 -1
- package/dist/esm/wire/text-encoding.d.ts +4 -2
- package/dist/esm/wire/text-encoding.js +9 -2
- package/dist/esm/wire/text-format.js +1 -1
- package/dist/esm/wkt/any.js +1 -1
- package/dist/esm/wkt/duration.js +1 -1
- package/dist/esm/wkt/gen/google/protobuf/any_pb.js +1 -1
- package/dist/esm/wkt/gen/google/protobuf/api_pb.d.ts +1 -1
- package/dist/esm/wkt/gen/google/protobuf/api_pb.js +1 -1
- package/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.d.ts +2 -2
- package/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.js +1 -1
- package/dist/esm/wkt/gen/google/protobuf/cpp_features_pb.js +1 -1
- package/dist/esm/wkt/gen/google/protobuf/descriptor_pb.d.ts +37 -23
- package/dist/esm/wkt/gen/google/protobuf/descriptor_pb.js +2 -2
- package/dist/esm/wkt/gen/google/protobuf/duration_pb.js +1 -1
- package/dist/esm/wkt/gen/google/protobuf/empty_pb.js +1 -1
- package/dist/esm/wkt/gen/google/protobuf/field_mask_pb.d.ts +32 -36
- package/dist/esm/wkt/gen/google/protobuf/field_mask_pb.js +1 -1
- package/dist/esm/wkt/gen/google/protobuf/go_features_pb.d.ts +65 -0
- package/dist/esm/wkt/gen/google/protobuf/go_features_pb.js +38 -2
- package/dist/esm/wkt/gen/google/protobuf/java_features_pb.js +1 -1
- package/dist/esm/wkt/gen/google/protobuf/source_context_pb.js +1 -1
- package/dist/esm/wkt/gen/google/protobuf/struct_pb.js +1 -1
- package/dist/esm/wkt/gen/google/protobuf/timestamp_pb.d.ts +5 -5
- package/dist/esm/wkt/gen/google/protobuf/timestamp_pb.js +1 -1
- package/dist/esm/wkt/gen/google/protobuf/type_pb.d.ts +3 -3
- package/dist/esm/wkt/gen/google/protobuf/type_pb.js +1 -1
- package/dist/esm/wkt/gen/google/protobuf/wrappers_pb.js +1 -1
- package/dist/esm/wkt/index.js +1 -1
- package/dist/esm/wkt/timestamp.js +1 -1
- package/dist/esm/wkt/wrappers.d.ts +10 -0
- package/dist/esm/wkt/wrappers.js +24 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright 2021-
|
|
2
|
+
// Copyright 2021-2026 Buf Technologies, Inc.
|
|
3
3
|
//
|
|
4
4
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
// you may not use this file except in compliance with the License.
|
|
@@ -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.go = exports.GoFeatures_StripEnumPrefixSchema = exports.GoFeatures_StripEnumPrefix = exports.GoFeatures_APILevelSchema = exports.GoFeatures_APILevel = exports.GoFeaturesSchema = exports.file_google_protobuf_go_features = void 0;
|
|
16
|
+
exports.go = exports.GoFeatures_StripEnumPrefixSchema = exports.GoFeatures_StripEnumPrefix = exports.GoFeatures_APILevelSchema = exports.GoFeatures_APILevel = exports.GoFeatures_OptimizeModeFeature_OptimizeModeSchema = exports.GoFeatures_OptimizeModeFeature_OptimizeMode = exports.GoFeatures_OptimizeModeFeatureSchema = exports.GoFeaturesSchema = exports.file_google_protobuf_go_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,12 +22,48 @@ const extension_js_1 = require("../../../../codegenv2/extension.js");
|
|
|
22
22
|
/**
|
|
23
23
|
* Describes the file google/protobuf/go_features.proto.
|
|
24
24
|
*/
|
|
25
|
-
exports.file_google_protobuf_go_features = (0, file_js_1.fileDesc)("
|
|
25
|
+
exports.file_google_protobuf_go_features = (0, file_js_1.fileDesc)("CiFnb29nbGUvcHJvdG9idWYvZ29fZmVhdHVyZXMucHJvdG8SAnBiItEGCgpHb0ZlYXR1cmVzEqUBChpsZWdhY3lfdW5tYXJzaGFsX2pzb25fZW51bRgBIAEoCEKAAYgBAZgBBpgBAaIBCRIEdHJ1ZRiEB6IBChIFZmFsc2UY5weyAVsI6AcQ6AcaU1RoZSBsZWdhY3kgVW5tYXJzaGFsSlNPTiBBUEkgaXMgZGVwcmVjYXRlZCBhbmQgd2lsbCBiZSByZW1vdmVkIGluIGEgZnV0dXJlIGVkaXRpb24uEmoKCWFwaV9sZXZlbBgCIAEoDjIXLnBiLkdvRmVhdHVyZXMuQVBJTGV2ZWxCPogBAZgBA5gBAaIBGhIVQVBJX0xFVkVMX1VOU1BFQ0lGSUVEGIQHogEPEgpBUElfT1BBUVVFGOkHsgEDCOgHEmsKEXN0cmlwX2VudW1fcHJlZml4GAMgASgOMh4ucGIuR29GZWF0dXJlcy5TdHJpcEVudW1QcmVmaXhCMIgBAZgBBpgBB5gBAaIBGxIWU1RSSVBfRU5VTV9QUkVGSVhfS0VFUBiEB7IBAwjpBxJ4Cg1vcHRpbWl6ZV9tb2RlGAQgASgOMi8ucGIuR29GZWF0dXJlcy5PcHRpbWl6ZU1vZGVGZWF0dXJlLk9wdGltaXplTW9kZUIwiAEBmAEDmAEBogEeEhlPUFRJTUlaRV9NT0RFX1VOU1BFQ0lGSUVEGIQHsgEDCOkHGl4KE09wdGltaXplTW9kZUZlYXR1cmUiRwoMT3B0aW1pemVNb2RlEh0KGU9QVElNSVpFX01PREVfVU5TUEVDSUZJRUQQABIJCgVTUEVFRBABEg0KCUNPREVfU0laRRACIlMKCEFQSUxldmVsEhkKFUFQSV9MRVZFTF9VTlNQRUNJRklFRBAAEgwKCEFQSV9PUEVOEAESDgoKQVBJX0hZQlJJRBACEg4KCkFQSV9PUEFRVUUQAyKSAQoPU3RyaXBFbnVtUHJlZml4EiEKHVNUUklQX0VOVU1fUFJFRklYX1VOU1BFQ0lGSUVEEAASGgoWU1RSSVBfRU5VTV9QUkVGSVhfS0VFUBABEiMKH1NUUklQX0VOVU1fUFJFRklYX0dFTkVSQVRFX0JPVEgQAhIbChdTVFJJUF9FTlVNX1BSRUZJWF9TVFJJUBADOjwKAmdvEhsuZ29vZ2xlLnByb3RvYnVmLkZlYXR1cmVTZXQY6gcgASgLMg4ucGIuR29GZWF0dXJlc1ICZ29CL1otZ29vZ2xlLmdvbGFuZy5vcmcvcHJvdG9idWYvdHlwZXMvZ29mZWF0dXJlc3Bi", [descriptor_pb_js_1.file_google_protobuf_descriptor]);
|
|
26
26
|
/**
|
|
27
27
|
* Describes the message pb.GoFeatures.
|
|
28
28
|
* Use `create(GoFeaturesSchema)` to create a new message.
|
|
29
29
|
*/
|
|
30
30
|
exports.GoFeaturesSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_go_features, 0);
|
|
31
|
+
/**
|
|
32
|
+
* Describes the message pb.GoFeatures.OptimizeModeFeature.
|
|
33
|
+
* Use `create(GoFeatures_OptimizeModeFeatureSchema)` to create a new message.
|
|
34
|
+
*/
|
|
35
|
+
exports.GoFeatures_OptimizeModeFeatureSchema = (0, message_js_1.messageDesc)(exports.file_google_protobuf_go_features, 0, 0);
|
|
36
|
+
/**
|
|
37
|
+
* The name of this enum matches OptimizeMode in descriptor.proto.
|
|
38
|
+
*
|
|
39
|
+
* @generated from enum pb.GoFeatures.OptimizeModeFeature.OptimizeMode
|
|
40
|
+
*/
|
|
41
|
+
var GoFeatures_OptimizeModeFeature_OptimizeMode;
|
|
42
|
+
(function (GoFeatures_OptimizeModeFeature_OptimizeMode) {
|
|
43
|
+
/**
|
|
44
|
+
* OPTIMIZE_MODE_UNSPECIFIED results in falling back to the default
|
|
45
|
+
* (optimize for code size), but needs to be a separate value to distinguish
|
|
46
|
+
* between an explicitly set optimize mode or a missing optimize mode.
|
|
47
|
+
*
|
|
48
|
+
* @generated from enum value: OPTIMIZE_MODE_UNSPECIFIED = 0;
|
|
49
|
+
*/
|
|
50
|
+
GoFeatures_OptimizeModeFeature_OptimizeMode[GoFeatures_OptimizeModeFeature_OptimizeMode["OPTIMIZE_MODE_UNSPECIFIED"] = 0] = "OPTIMIZE_MODE_UNSPECIFIED";
|
|
51
|
+
/**
|
|
52
|
+
* @generated from enum value: SPEED = 1;
|
|
53
|
+
*/
|
|
54
|
+
GoFeatures_OptimizeModeFeature_OptimizeMode[GoFeatures_OptimizeModeFeature_OptimizeMode["SPEED"] = 1] = "SPEED";
|
|
55
|
+
/**
|
|
56
|
+
* There is no enum entry for LITE_RUNTIME (descriptor.proto),
|
|
57
|
+
* because Go Protobuf does not have the concept of a lite runtime.
|
|
58
|
+
*
|
|
59
|
+
* @generated from enum value: CODE_SIZE = 2;
|
|
60
|
+
*/
|
|
61
|
+
GoFeatures_OptimizeModeFeature_OptimizeMode[GoFeatures_OptimizeModeFeature_OptimizeMode["CODE_SIZE"] = 2] = "CODE_SIZE";
|
|
62
|
+
})(GoFeatures_OptimizeModeFeature_OptimizeMode || (exports.GoFeatures_OptimizeModeFeature_OptimizeMode = GoFeatures_OptimizeModeFeature_OptimizeMode = {}));
|
|
63
|
+
/**
|
|
64
|
+
* Describes the enum pb.GoFeatures.OptimizeModeFeature.OptimizeMode.
|
|
65
|
+
*/
|
|
66
|
+
exports.GoFeatures_OptimizeModeFeature_OptimizeModeSchema = (0, enum_js_1.enumDesc)(exports.file_google_protobuf_go_features, 0, 0, 0);
|
|
31
67
|
/**
|
|
32
68
|
* @generated from enum pb.GoFeatures.APILevel
|
|
33
69
|
*/
|
|
@@ -77,8 +77,8 @@ export declare const file_google_protobuf_timestamp: GenFile;
|
|
|
77
77
|
* {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
|
78
78
|
* seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
|
79
79
|
* are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
|
80
|
-
* is required. A
|
|
81
|
-
* "Z") when printing the Timestamp type and a
|
|
80
|
+
* is required. A ProtoJSON serializer should always use UTC (as indicated by
|
|
81
|
+
* "Z") when printing the Timestamp type and a ProtoJSON parser should be
|
|
82
82
|
* able to accept both UTC and other timezones (as indicated by an offset).
|
|
83
83
|
*
|
|
84
84
|
* For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
|
@@ -101,7 +101,7 @@ export declare const file_google_protobuf_timestamp: GenFile;
|
|
|
101
101
|
export type Timestamp = Message<"google.protobuf.Timestamp"> & {
|
|
102
102
|
/**
|
|
103
103
|
* Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must
|
|
104
|
-
* be between -
|
|
104
|
+
* be between -62135596800 and 253402300799 inclusive (which corresponds to
|
|
105
105
|
* 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z).
|
|
106
106
|
*
|
|
107
107
|
* @generated from field: int64 seconds = 1;
|
|
@@ -191,8 +191,8 @@ export type Timestamp = Message<"google.protobuf.Timestamp"> & {
|
|
|
191
191
|
* {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
|
192
192
|
* seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
|
193
193
|
* are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
|
194
|
-
* is required. A
|
|
195
|
-
* "Z") when printing the Timestamp type and a
|
|
194
|
+
* is required. A ProtoJSON serializer should always use UTC (as indicated by
|
|
195
|
+
* "Z") when printing the Timestamp type and a ProtoJSON parser should be
|
|
196
196
|
* able to accept both UTC and other timezones (as indicated by an offset).
|
|
197
197
|
*
|
|
198
198
|
* For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
|
@@ -46,7 +46,7 @@ export type Type = Message<"google.protobuf.Type"> & {
|
|
|
46
46
|
*
|
|
47
47
|
* @generated from field: google.protobuf.SourceContext source_context = 5;
|
|
48
48
|
*/
|
|
49
|
-
sourceContext?: SourceContext;
|
|
49
|
+
sourceContext?: SourceContext | undefined;
|
|
50
50
|
/**
|
|
51
51
|
* The source syntax.
|
|
52
52
|
*
|
|
@@ -482,7 +482,7 @@ export type Enum = Message<"google.protobuf.Enum"> & {
|
|
|
482
482
|
*
|
|
483
483
|
* @generated from field: google.protobuf.SourceContext source_context = 4;
|
|
484
484
|
*/
|
|
485
|
-
sourceContext?: SourceContext;
|
|
485
|
+
sourceContext?: SourceContext | undefined;
|
|
486
486
|
/**
|
|
487
487
|
* The source syntax.
|
|
488
488
|
*
|
|
@@ -646,7 +646,7 @@ export type Option = Message<"google.protobuf.Option"> & {
|
|
|
646
646
|
*
|
|
647
647
|
* @generated from field: google.protobuf.Any value = 2;
|
|
648
648
|
*/
|
|
649
|
-
value?: Any;
|
|
649
|
+
value?: Any | undefined;
|
|
650
650
|
};
|
|
651
651
|
/**
|
|
652
652
|
* A protocol buffer option, which can be attached to a message, field,
|
package/dist/cjs/wkt/index.js
CHANGED
|
@@ -13,3 +13,13 @@ export type WktWrapperDesc = DescMessage & {
|
|
|
13
13
|
];
|
|
14
14
|
};
|
|
15
15
|
export declare function isWrapperDesc(messageDesc: DescMessage): messageDesc is WktWrapperDesc;
|
|
16
|
+
/**
|
|
17
|
+
* Returns true if the descriptor is a well-known type with a custom JSON
|
|
18
|
+
* representation per the protobuf JSON spec. Examples: Timestamp as an
|
|
19
|
+
* RFC 3339 string, Duration as "5s", wrappers as the unwrapped scalar.
|
|
20
|
+
*
|
|
21
|
+
* When packed inside `google.protobuf.Any`, these messages are serialized
|
|
22
|
+
* as `{"@type": ..., "value": <custom form>}`; all other messages embed
|
|
23
|
+
* their fields directly.
|
|
24
|
+
*/
|
|
25
|
+
export declare function hasCustomJsonRepresentation(desc: DescMessage): boolean;
|
package/dist/cjs/wkt/wrappers.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright 2021-
|
|
2
|
+
// Copyright 2021-2026 Buf Technologies, Inc.
|
|
3
3
|
//
|
|
4
4
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
// you may not use this file except in compliance with the License.
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.isWrapper = isWrapper;
|
|
17
17
|
exports.isWrapperDesc = isWrapperDesc;
|
|
18
|
+
exports.hasCustomJsonRepresentation = hasCustomJsonRepresentation;
|
|
18
19
|
function isWrapper(arg) {
|
|
19
20
|
return isWrapperTypeName(arg.$typeName);
|
|
20
21
|
}
|
|
@@ -26,6 +27,29 @@ function isWrapperDesc(messageDesc) {
|
|
|
26
27
|
f.name == "value" &&
|
|
27
28
|
f.number == 1);
|
|
28
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Returns true if the descriptor is a well-known type with a custom JSON
|
|
32
|
+
* representation per the protobuf JSON spec. Examples: Timestamp as an
|
|
33
|
+
* RFC 3339 string, Duration as "5s", wrappers as the unwrapped scalar.
|
|
34
|
+
*
|
|
35
|
+
* When packed inside `google.protobuf.Any`, these messages are serialized
|
|
36
|
+
* as `{"@type": ..., "value": <custom form>}`; all other messages embed
|
|
37
|
+
* their fields directly.
|
|
38
|
+
*/
|
|
39
|
+
function hasCustomJsonRepresentation(desc) {
|
|
40
|
+
switch (desc.typeName) {
|
|
41
|
+
case "google.protobuf.Any":
|
|
42
|
+
case "google.protobuf.Timestamp":
|
|
43
|
+
case "google.protobuf.Duration":
|
|
44
|
+
case "google.protobuf.FieldMask":
|
|
45
|
+
case "google.protobuf.Struct":
|
|
46
|
+
case "google.protobuf.Value":
|
|
47
|
+
case "google.protobuf.ListValue":
|
|
48
|
+
return true;
|
|
49
|
+
default:
|
|
50
|
+
return isWrapperDesc(desc);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
29
53
|
function isWrapperTypeName(name) {
|
|
30
54
|
return (name.startsWith("google.protobuf.") &&
|
|
31
55
|
[
|
package/dist/esm/clone.js
CHANGED
package/dist/esm/create.js
CHANGED
|
@@ -114,7 +114,7 @@ export interface DescEnum {
|
|
|
114
114
|
* A prefix shared by all enum values.
|
|
115
115
|
* For example, `my_enum_` for `enum MyEnum {MY_ENUM_A=0; MY_ENUM_B=1;}`
|
|
116
116
|
*/
|
|
117
|
-
readonly sharedPrefix?: string;
|
|
117
|
+
readonly sharedPrefix?: string | undefined;
|
|
118
118
|
/**
|
|
119
119
|
* Marked as deprecated in the protobuf source.
|
|
120
120
|
*/
|
|
@@ -192,8 +192,8 @@ export interface DescMessage {
|
|
|
192
192
|
*/
|
|
193
193
|
readonly oneofs: DescOneof[];
|
|
194
194
|
/**
|
|
195
|
-
*
|
|
196
|
-
* protobuf source.
|
|
195
|
+
* Standalone fields and oneof groups for this message, ordered by
|
|
196
|
+
* their appearance in the protobuf source.
|
|
197
197
|
*/
|
|
198
198
|
readonly members: (DescField | DescOneof)[];
|
|
199
199
|
/**
|
|
@@ -283,6 +283,13 @@ interface descFieldAndExtensionShared {
|
|
|
283
283
|
* See https://protobuf.dev/programming-guides/field_presence/
|
|
284
284
|
*/
|
|
285
285
|
readonly presence: SupportedFieldPresence;
|
|
286
|
+
/**
|
|
287
|
+
* Whether to reject invalid UTF-8 when reading this field from the binary
|
|
288
|
+
* wire format. Reflects the resolved `utf8_validation` feature: true for
|
|
289
|
+
* VERIFY (proto3 and editions 2023+ default), false for NONE (proto2
|
|
290
|
+
* default).
|
|
291
|
+
*/
|
|
292
|
+
readonly utf8Validation: boolean;
|
|
286
293
|
/**
|
|
287
294
|
* The compiler-generated descriptor.
|
|
288
295
|
*/
|
|
@@ -620,8 +627,8 @@ export interface DescMethod {
|
|
|
620
627
|
*/
|
|
621
628
|
export interface DescComments {
|
|
622
629
|
readonly leadingDetached: readonly string[];
|
|
623
|
-
readonly leading?: string;
|
|
624
|
-
readonly trailing?: string;
|
|
630
|
+
readonly leading?: string | undefined;
|
|
631
|
+
readonly trailing?: string | undefined;
|
|
625
632
|
readonly sourcePath: readonly number[];
|
|
626
633
|
}
|
|
627
634
|
export {};
|
package/dist/esm/descriptors.js
CHANGED
package/dist/esm/equals.js
CHANGED
package/dist/esm/extensions.js
CHANGED
package/dist/esm/fields.js
CHANGED
package/dist/esm/from-binary.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright 2021-
|
|
1
|
+
// Copyright 2021-2026 Buf Technologies, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -89,7 +89,7 @@ export function readField(message, reader, field, wireType, options) {
|
|
|
89
89
|
var _a;
|
|
90
90
|
switch (field.fieldKind) {
|
|
91
91
|
case "scalar":
|
|
92
|
-
message.set(field, readScalar(reader, field.scalar));
|
|
92
|
+
message.set(field, readScalar(reader, field.scalar, field.utf8Validation));
|
|
93
93
|
break;
|
|
94
94
|
case "enum":
|
|
95
95
|
const val = readScalar(reader, ScalarType.INT32);
|
|
@@ -139,12 +139,12 @@ function readMapEntry(reader, map, options) {
|
|
|
139
139
|
const [fieldNo] = reader.tag();
|
|
140
140
|
switch (fieldNo) {
|
|
141
141
|
case 1:
|
|
142
|
-
key = readScalar(reader, field.mapKey);
|
|
142
|
+
key = readScalar(reader, field.mapKey, field.utf8Validation);
|
|
143
143
|
break;
|
|
144
144
|
case 2:
|
|
145
145
|
switch (field.mapKind) {
|
|
146
146
|
case "scalar":
|
|
147
|
-
val = readScalar(reader, field.scalar);
|
|
147
|
+
val = readScalar(reader, field.scalar, field.utf8Validation);
|
|
148
148
|
break;
|
|
149
149
|
case "enum":
|
|
150
150
|
val = reader.int32();
|
|
@@ -186,12 +186,12 @@ function readListField(reader, wireType, list, options) {
|
|
|
186
186
|
scalarType != ScalarType.STRING &&
|
|
187
187
|
scalarType != ScalarType.BYTES;
|
|
188
188
|
if (!packed) {
|
|
189
|
-
list.add(readScalar(reader, scalarType));
|
|
189
|
+
list.add(readScalar(reader, scalarType, field.utf8Validation));
|
|
190
190
|
return;
|
|
191
191
|
}
|
|
192
192
|
const e = reader.uint32() + reader.pos;
|
|
193
193
|
while (reader.pos < e) {
|
|
194
|
-
list.add(readScalar(reader, scalarType));
|
|
194
|
+
list.add(readScalar(reader, scalarType, field.utf8Validation));
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
function readMessageField(reader, options, field, mergeMessage) {
|
|
@@ -200,10 +200,10 @@ function readMessageField(reader, options, field, mergeMessage) {
|
|
|
200
200
|
readMessage(message, reader, options, delimited, delimited ? field.number : reader.uint32());
|
|
201
201
|
return message;
|
|
202
202
|
}
|
|
203
|
-
function readScalar(reader, type) {
|
|
203
|
+
function readScalar(reader, type, validateUtf8 = false) {
|
|
204
204
|
switch (type) {
|
|
205
205
|
case ScalarType.STRING:
|
|
206
|
-
return reader.string();
|
|
206
|
+
return reader.string(validateUtf8);
|
|
207
207
|
case ScalarType.BOOL:
|
|
208
208
|
return reader.bool();
|
|
209
209
|
case ScalarType.DOUBLE:
|
package/dist/esm/from-json.d.ts
CHANGED