@bufbuild/protobuf 0.5.0 → 1.1.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/README.md +2 -2
- package/dist/cjs/binary-encoding.js +1 -1
- package/dist/cjs/binary-format.js +1 -1
- package/dist/cjs/codegen-info.js +1 -1
- package/dist/cjs/create-descriptor-set.js +1 -1
- package/dist/cjs/create-registry-from-desc.js +1 -1
- package/dist/cjs/create-registry.js +1 -1
- package/dist/cjs/descriptor-set.js +1 -1
- package/dist/cjs/enum.js +1 -1
- package/dist/cjs/field-list.js +1 -1
- package/dist/cjs/field.js +1 -1
- package/dist/cjs/google/protobuf/any_pb.js +5 -2
- package/dist/cjs/google/protobuf/api_pb.js +1 -2
- package/dist/cjs/google/protobuf/compiler/plugin_pb.js +1 -1
- package/dist/cjs/google/protobuf/descriptor_pb.js +134 -2
- package/dist/cjs/google/protobuf/duration_pb.js +5 -3
- package/dist/cjs/google/protobuf/empty_pb.js +1 -1
- package/dist/cjs/google/protobuf/field_mask_pb.js +1 -1
- package/dist/cjs/google/protobuf/source_context_pb.js +1 -1
- package/dist/cjs/google/protobuf/struct_pb.js +8 -3
- package/dist/cjs/google/protobuf/timestamp_pb.js +1 -4
- package/dist/cjs/google/protobuf/type_pb.js +2 -2
- package/dist/cjs/google/protobuf/wrappers_pb.js +1 -1
- package/dist/cjs/index.js +4 -2
- package/dist/cjs/json-format.js +1 -1
- package/dist/cjs/message-type.js +1 -1
- package/dist/cjs/message.js +5 -3
- package/dist/cjs/private/assert.js +1 -1
- package/dist/cjs/private/binary-format-common.js +1 -1
- package/dist/cjs/private/binary-format-proto2.js +1 -1
- package/dist/cjs/private/binary-format-proto3.js +1 -1
- package/dist/cjs/private/enum.js +1 -1
- package/dist/cjs/private/field-list.js +1 -1
- package/dist/cjs/private/field-wrapper.js +1 -1
- package/dist/cjs/private/field.js +1 -1
- package/dist/cjs/private/json-format-common.js +1 -1
- package/dist/cjs/private/json-format-proto2.js +1 -1
- package/dist/cjs/private/json-format-proto3.js +1 -1
- package/dist/cjs/private/message-type.js +1 -1
- package/dist/cjs/private/names.js +1 -1
- package/dist/cjs/private/options-map.js +1 -1
- package/dist/cjs/private/proto-runtime.js +1 -1
- package/dist/cjs/private/reify-wkt.js +1 -1
- package/dist/cjs/private/scalars.js +1 -1
- package/dist/cjs/private/util-common.js +1 -1
- package/dist/cjs/private/util.js +1 -1
- package/dist/cjs/proto-base64.js +1 -1
- package/dist/cjs/proto-delimited.js +160 -0
- package/dist/cjs/proto-int64.js +1 -1
- package/dist/cjs/proto2.js +1 -1
- package/dist/cjs/proto3.js +1 -1
- package/dist/cjs/service-type.js +1 -1
- package/dist/cjs/type-registry.js +1 -1
- package/dist/esm/binary-encoding.js +1 -1
- package/dist/esm/binary-format.js +1 -1
- package/dist/esm/codegen-info.js +1 -1
- package/dist/esm/create-descriptor-set.js +1 -1
- package/dist/esm/create-registry-from-desc.js +1 -1
- package/dist/esm/create-registry.js +1 -1
- package/dist/esm/descriptor-set.js +1 -1
- package/dist/esm/enum.js +1 -1
- package/dist/esm/field-list.js +1 -1
- package/dist/esm/field.js +1 -1
- package/dist/esm/google/protobuf/any_pb.js +5 -2
- package/dist/esm/google/protobuf/api_pb.js +1 -2
- package/dist/esm/google/protobuf/compiler/plugin_pb.js +1 -1
- package/dist/esm/google/protobuf/descriptor_pb.js +133 -1
- package/dist/esm/google/protobuf/duration_pb.js +5 -3
- package/dist/esm/google/protobuf/empty_pb.js +1 -1
- package/dist/esm/google/protobuf/field_mask_pb.js +1 -1
- package/dist/esm/google/protobuf/source_context_pb.js +1 -1
- package/dist/esm/google/protobuf/struct_pb.js +8 -3
- package/dist/esm/google/protobuf/timestamp_pb.js +1 -4
- package/dist/esm/google/protobuf/type_pb.js +2 -2
- package/dist/esm/google/protobuf/wrappers_pb.js +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/json-format.js +1 -1
- package/dist/esm/message-type.js +1 -1
- package/dist/esm/message.js +5 -3
- package/dist/esm/private/assert.js +1 -1
- package/dist/esm/private/binary-format-common.js +1 -1
- package/dist/esm/private/binary-format-proto2.js +1 -1
- package/dist/esm/private/binary-format-proto3.js +1 -1
- package/dist/esm/private/enum.js +1 -1
- package/dist/esm/private/field-list.js +1 -1
- package/dist/esm/private/field-wrapper.js +1 -1
- package/dist/esm/private/field.js +1 -1
- package/dist/esm/private/json-format-common.js +1 -1
- package/dist/esm/private/json-format-proto2.js +1 -1
- package/dist/esm/private/json-format-proto3.js +1 -1
- package/dist/esm/private/message-type.js +1 -1
- package/dist/esm/private/names.js +1 -1
- package/dist/esm/private/options-map.js +1 -1
- package/dist/esm/private/proto-runtime.js +1 -1
- package/dist/esm/private/reify-wkt.js +1 -1
- package/dist/esm/private/scalars.js +1 -1
- package/dist/esm/private/util-common.js +1 -1
- package/dist/esm/private/util.js +1 -1
- package/dist/esm/proto-base64.js +1 -1
- package/dist/esm/proto-delimited.js +157 -0
- package/dist/esm/proto-int64.js +1 -1
- package/dist/esm/proto2.js +1 -1
- package/dist/esm/proto3.js +1 -1
- package/dist/esm/service-type.js +1 -1
- package/dist/esm/type-registry.js +1 -1
- package/dist/types/google/protobuf/any_pb.d.ts +6 -2
- package/dist/types/google/protobuf/api_pb.d.ts +4 -4
- package/dist/types/google/protobuf/compiler/plugin_pb.d.ts +5 -4
- package/dist/types/google/protobuf/descriptor_pb.d.ts +188 -39
- package/dist/types/google/protobuf/duration_pb.d.ts +2 -2
- package/dist/types/google/protobuf/empty_pb.d.ts +2 -1
- package/dist/types/google/protobuf/field_mask_pb.d.ts +2 -1
- package/dist/types/google/protobuf/source_context_pb.d.ts +2 -1
- package/dist/types/google/protobuf/struct_pb.d.ts +4 -3
- package/dist/types/google/protobuf/timestamp_pb.d.ts +2 -4
- package/dist/types/google/protobuf/type_pb.d.ts +6 -5
- package/dist/types/google/protobuf/wrappers_pb.d.ts +10 -9
- package/dist/types/index.d.ts +1 -0
- package/dist/types/message.d.ts +4 -2
- package/dist/types/proto-delimited.d.ts +54 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,11 +15,11 @@ Some additional features that set it apart from the others:
|
|
|
15
15
|
- ECMAScript module support
|
|
16
16
|
- First-class TypeScript support
|
|
17
17
|
- Generation of idiomatic JavaScript and TypeScript code.
|
|
18
|
-
- Generation of [much smaller bundles](packages/protobuf-bench)
|
|
18
|
+
- Generation of [much smaller bundles](https://github.com/bufbuild/protobuf-es/blob/main/packages/protobuf-bench)
|
|
19
19
|
- Implementation of all proto3 features, including the [canonical JSON format](https://developers.google.com/protocol-buffers/docs/proto3#json).
|
|
20
20
|
- Implementation of all proto2 features, except for extensions and the text format.
|
|
21
21
|
- Usage of standard JavaScript APIs instead of the [Closure Library](http://googlecode.blogspot.com/2009/11/introducing-closure-tools.html)
|
|
22
|
-
- Compatibility is covered by the protocol buffers [conformance tests](packages/protobuf-conformance).
|
|
22
|
+
- Compatibility is covered by the protocol buffers [conformance tests](https://github.com/bufbuild/protobuf-es/blob/main/packages/protobuf-conformance).
|
|
23
23
|
- Descriptor and reflection support
|
|
24
24
|
|
|
25
25
|
## Installation
|
package/dist/cjs/codegen-info.js
CHANGED
package/dist/cjs/enum.js
CHANGED
package/dist/cjs/field-list.js
CHANGED
package/dist/cjs/field.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright 2021-
|
|
2
|
+
// Copyright 2021-2023 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.
|
|
@@ -41,6 +41,10 @@ const proto3_js_1 = require("../../proto3.js");
|
|
|
41
41
|
* if (any.is(Foo.class)) {
|
|
42
42
|
* foo = any.unpack(Foo.class);
|
|
43
43
|
* }
|
|
44
|
+
* // or ...
|
|
45
|
+
* if (any.isSameTypeAs(Foo.getDefaultInstance())) {
|
|
46
|
+
* foo = any.unpack(Foo.getDefaultInstance());
|
|
47
|
+
* }
|
|
44
48
|
*
|
|
45
49
|
* Example 3: Pack and unpack a message in Python.
|
|
46
50
|
*
|
|
@@ -71,7 +75,6 @@ const proto3_js_1 = require("../../proto3.js");
|
|
|
71
75
|
* in the type URL, for example "foo.bar.com/x/y.z" will yield type
|
|
72
76
|
* name "y.z".
|
|
73
77
|
*
|
|
74
|
-
*
|
|
75
78
|
* JSON
|
|
76
79
|
*
|
|
77
80
|
* The JSON representation of an `Any` value uses the regular
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright 2021-
|
|
2
|
+
// Copyright 2021-2023 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.
|
|
@@ -75,7 +75,6 @@ class Api extends message_js_1.Message {
|
|
|
75
75
|
* experimental, non-GA interfaces.
|
|
76
76
|
*
|
|
77
77
|
*
|
|
78
|
-
*
|
|
79
78
|
* @generated from field: string version = 4;
|
|
80
79
|
*/
|
|
81
80
|
this.version = "";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright 2021-
|
|
2
|
+
// Copyright 2021-2023 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.GeneratedCodeInfo_Annotation = exports.GeneratedCodeInfo = exports.SourceCodeInfo_Location = exports.SourceCodeInfo = exports.UninterpretedOption_NamePart = exports.UninterpretedOption = exports.MethodOptions_IdempotencyLevel = exports.MethodOptions = exports.ServiceOptions = exports.EnumValueOptions = exports.EnumOptions = exports.OneofOptions = exports.FieldOptions_JSType = exports.FieldOptions_CType = exports.FieldOptions = exports.MessageOptions = exports.FileOptions_OptimizeMode = exports.FileOptions = exports.MethodDescriptorProto = exports.ServiceDescriptorProto = exports.EnumValueDescriptorProto = exports.EnumDescriptorProto_EnumReservedRange = exports.EnumDescriptorProto = exports.OneofDescriptorProto = exports.FieldDescriptorProto_Label = exports.FieldDescriptorProto_Type = exports.FieldDescriptorProto = exports.ExtensionRangeOptions = exports.DescriptorProto_ReservedRange = exports.DescriptorProto_ExtensionRange = exports.DescriptorProto = exports.FileDescriptorProto = exports.FileDescriptorSet = void 0;
|
|
16
|
+
exports.GeneratedCodeInfo_Annotation_Semantic = exports.GeneratedCodeInfo_Annotation = exports.GeneratedCodeInfo = exports.SourceCodeInfo_Location = exports.SourceCodeInfo = exports.UninterpretedOption_NamePart = exports.UninterpretedOption = exports.MethodOptions_IdempotencyLevel = exports.MethodOptions = exports.ServiceOptions = exports.EnumValueOptions = exports.EnumOptions = exports.OneofOptions = exports.FieldOptions_OptionTargetType = exports.FieldOptions_OptionRetention = exports.FieldOptions_JSType = exports.FieldOptions_CType = exports.FieldOptions = exports.MessageOptions = exports.FileOptions_OptimizeMode = exports.FileOptions = exports.MethodDescriptorProto = exports.ServiceDescriptorProto = exports.EnumValueDescriptorProto = exports.EnumDescriptorProto_EnumReservedRange = exports.EnumDescriptorProto = exports.OneofDescriptorProto = exports.FieldDescriptorProto_Label = exports.FieldDescriptorProto_Type = exports.FieldDescriptorProto = exports.ExtensionRangeOptions = exports.DescriptorProto_ReservedRange = exports.DescriptorProto_ExtensionRange = exports.DescriptorProto = exports.FileDescriptorProto = exports.FileDescriptorSet = void 0;
|
|
17
17
|
const message_js_1 = require("../../message.js");
|
|
18
18
|
const proto2_js_1 = require("../../proto2.js");
|
|
19
19
|
/**
|
|
@@ -126,6 +126,7 @@ FileDescriptorProto.fields = proto2_js_1.proto2.util.newFieldList(() => [
|
|
|
126
126
|
{ no: 8, name: "options", kind: "message", T: FileOptions, opt: true },
|
|
127
127
|
{ no: 9, name: "source_code_info", kind: "message", T: SourceCodeInfo, opt: true },
|
|
128
128
|
{ no: 12, name: "syntax", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
129
|
+
{ no: 13, name: "edition", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
129
130
|
]);
|
|
130
131
|
/**
|
|
131
132
|
* Describes a message type.
|
|
@@ -820,6 +821,7 @@ MessageOptions.fields = proto2_js_1.proto2.util.newFieldList(() => [
|
|
|
820
821
|
{ no: 2, name: "no_standard_descriptor_accessor", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false },
|
|
821
822
|
{ no: 3, name: "deprecated", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false },
|
|
822
823
|
{ no: 7, name: "map_entry", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
|
|
824
|
+
{ no: 11, name: "deprecated_legacy_json_field_conflicts", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
|
|
823
825
|
{ no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true },
|
|
824
826
|
]);
|
|
825
827
|
/**
|
|
@@ -860,6 +862,9 @@ FieldOptions.fields = proto2_js_1.proto2.util.newFieldList(() => [
|
|
|
860
862
|
{ no: 15, name: "unverified_lazy", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false },
|
|
861
863
|
{ no: 3, name: "deprecated", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false },
|
|
862
864
|
{ no: 10, name: "weak", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false },
|
|
865
|
+
{ no: 16, name: "debug_redact", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false },
|
|
866
|
+
{ no: 17, name: "retention", kind: "enum", T: proto2_js_1.proto2.getEnumType(FieldOptions_OptionRetention), opt: true },
|
|
867
|
+
{ no: 18, name: "target", kind: "enum", T: proto2_js_1.proto2.getEnumType(FieldOptions_OptionTargetType), opt: true },
|
|
863
868
|
{ no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true },
|
|
864
869
|
]);
|
|
865
870
|
/**
|
|
@@ -918,6 +923,98 @@ proto2_js_1.proto2.util.setEnumType(FieldOptions_JSType, "google.protobuf.FieldO
|
|
|
918
923
|
{ no: 1, name: "JS_STRING" },
|
|
919
924
|
{ no: 2, name: "JS_NUMBER" },
|
|
920
925
|
]);
|
|
926
|
+
/**
|
|
927
|
+
* If set to RETENTION_SOURCE, the option will be omitted from the binary.
|
|
928
|
+
* Note: as of January 2023, support for this is in progress and does not yet
|
|
929
|
+
* have an effect (b/264593489).
|
|
930
|
+
*
|
|
931
|
+
* @generated from enum google.protobuf.FieldOptions.OptionRetention
|
|
932
|
+
*/
|
|
933
|
+
var FieldOptions_OptionRetention;
|
|
934
|
+
(function (FieldOptions_OptionRetention) {
|
|
935
|
+
/**
|
|
936
|
+
* @generated from enum value: RETENTION_UNKNOWN = 0;
|
|
937
|
+
*/
|
|
938
|
+
FieldOptions_OptionRetention[FieldOptions_OptionRetention["RETENTION_UNKNOWN"] = 0] = "RETENTION_UNKNOWN";
|
|
939
|
+
/**
|
|
940
|
+
* @generated from enum value: RETENTION_RUNTIME = 1;
|
|
941
|
+
*/
|
|
942
|
+
FieldOptions_OptionRetention[FieldOptions_OptionRetention["RETENTION_RUNTIME"] = 1] = "RETENTION_RUNTIME";
|
|
943
|
+
/**
|
|
944
|
+
* @generated from enum value: RETENTION_SOURCE = 2;
|
|
945
|
+
*/
|
|
946
|
+
FieldOptions_OptionRetention[FieldOptions_OptionRetention["RETENTION_SOURCE"] = 2] = "RETENTION_SOURCE";
|
|
947
|
+
})(FieldOptions_OptionRetention = exports.FieldOptions_OptionRetention || (exports.FieldOptions_OptionRetention = {}));
|
|
948
|
+
// Retrieve enum metadata with: proto2.getEnumType(FieldOptions_OptionRetention)
|
|
949
|
+
proto2_js_1.proto2.util.setEnumType(FieldOptions_OptionRetention, "google.protobuf.FieldOptions.OptionRetention", [
|
|
950
|
+
{ no: 0, name: "RETENTION_UNKNOWN" },
|
|
951
|
+
{ no: 1, name: "RETENTION_RUNTIME" },
|
|
952
|
+
{ no: 2, name: "RETENTION_SOURCE" },
|
|
953
|
+
]);
|
|
954
|
+
/**
|
|
955
|
+
* This indicates the types of entities that the field may apply to when used
|
|
956
|
+
* as an option. If it is unset, then the field may be freely used as an
|
|
957
|
+
* option on any kind of entity. Note: as of January 2023, support for this is
|
|
958
|
+
* in progress and does not yet have an effect (b/264593489).
|
|
959
|
+
*
|
|
960
|
+
* @generated from enum google.protobuf.FieldOptions.OptionTargetType
|
|
961
|
+
*/
|
|
962
|
+
var FieldOptions_OptionTargetType;
|
|
963
|
+
(function (FieldOptions_OptionTargetType) {
|
|
964
|
+
/**
|
|
965
|
+
* @generated from enum value: TARGET_TYPE_UNKNOWN = 0;
|
|
966
|
+
*/
|
|
967
|
+
FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_UNKNOWN"] = 0] = "TARGET_TYPE_UNKNOWN";
|
|
968
|
+
/**
|
|
969
|
+
* @generated from enum value: TARGET_TYPE_FILE = 1;
|
|
970
|
+
*/
|
|
971
|
+
FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_FILE"] = 1] = "TARGET_TYPE_FILE";
|
|
972
|
+
/**
|
|
973
|
+
* @generated from enum value: TARGET_TYPE_EXTENSION_RANGE = 2;
|
|
974
|
+
*/
|
|
975
|
+
FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_EXTENSION_RANGE"] = 2] = "TARGET_TYPE_EXTENSION_RANGE";
|
|
976
|
+
/**
|
|
977
|
+
* @generated from enum value: TARGET_TYPE_MESSAGE = 3;
|
|
978
|
+
*/
|
|
979
|
+
FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_MESSAGE"] = 3] = "TARGET_TYPE_MESSAGE";
|
|
980
|
+
/**
|
|
981
|
+
* @generated from enum value: TARGET_TYPE_FIELD = 4;
|
|
982
|
+
*/
|
|
983
|
+
FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_FIELD"] = 4] = "TARGET_TYPE_FIELD";
|
|
984
|
+
/**
|
|
985
|
+
* @generated from enum value: TARGET_TYPE_ONEOF = 5;
|
|
986
|
+
*/
|
|
987
|
+
FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_ONEOF"] = 5] = "TARGET_TYPE_ONEOF";
|
|
988
|
+
/**
|
|
989
|
+
* @generated from enum value: TARGET_TYPE_ENUM = 6;
|
|
990
|
+
*/
|
|
991
|
+
FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_ENUM"] = 6] = "TARGET_TYPE_ENUM";
|
|
992
|
+
/**
|
|
993
|
+
* @generated from enum value: TARGET_TYPE_ENUM_ENTRY = 7;
|
|
994
|
+
*/
|
|
995
|
+
FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_ENUM_ENTRY"] = 7] = "TARGET_TYPE_ENUM_ENTRY";
|
|
996
|
+
/**
|
|
997
|
+
* @generated from enum value: TARGET_TYPE_SERVICE = 8;
|
|
998
|
+
*/
|
|
999
|
+
FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_SERVICE"] = 8] = "TARGET_TYPE_SERVICE";
|
|
1000
|
+
/**
|
|
1001
|
+
* @generated from enum value: TARGET_TYPE_METHOD = 9;
|
|
1002
|
+
*/
|
|
1003
|
+
FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_METHOD"] = 9] = "TARGET_TYPE_METHOD";
|
|
1004
|
+
})(FieldOptions_OptionTargetType = exports.FieldOptions_OptionTargetType || (exports.FieldOptions_OptionTargetType = {}));
|
|
1005
|
+
// Retrieve enum metadata with: proto2.getEnumType(FieldOptions_OptionTargetType)
|
|
1006
|
+
proto2_js_1.proto2.util.setEnumType(FieldOptions_OptionTargetType, "google.protobuf.FieldOptions.OptionTargetType", [
|
|
1007
|
+
{ no: 0, name: "TARGET_TYPE_UNKNOWN" },
|
|
1008
|
+
{ no: 1, name: "TARGET_TYPE_FILE" },
|
|
1009
|
+
{ no: 2, name: "TARGET_TYPE_EXTENSION_RANGE" },
|
|
1010
|
+
{ no: 3, name: "TARGET_TYPE_MESSAGE" },
|
|
1011
|
+
{ no: 4, name: "TARGET_TYPE_FIELD" },
|
|
1012
|
+
{ no: 5, name: "TARGET_TYPE_ONEOF" },
|
|
1013
|
+
{ no: 6, name: "TARGET_TYPE_ENUM" },
|
|
1014
|
+
{ no: 7, name: "TARGET_TYPE_ENUM_ENTRY" },
|
|
1015
|
+
{ no: 8, name: "TARGET_TYPE_SERVICE" },
|
|
1016
|
+
{ no: 9, name: "TARGET_TYPE_METHOD" },
|
|
1017
|
+
]);
|
|
921
1018
|
/**
|
|
922
1019
|
* @generated from message google.protobuf.OneofOptions
|
|
923
1020
|
*/
|
|
@@ -984,6 +1081,7 @@ EnumOptions.typeName = "google.protobuf.EnumOptions";
|
|
|
984
1081
|
EnumOptions.fields = proto2_js_1.proto2.util.newFieldList(() => [
|
|
985
1082
|
{ no: 2, name: "allow_alias", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
|
|
986
1083
|
{ no: 3, name: "deprecated", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true, default: false },
|
|
1084
|
+
{ no: 6, name: "deprecated_legacy_json_field_conflicts", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
|
|
987
1085
|
{ no: 999, name: "uninterpreted_option", kind: "message", T: UninterpretedOption, repeated: true },
|
|
988
1086
|
]);
|
|
989
1087
|
/**
|
|
@@ -1424,4 +1522,38 @@ GeneratedCodeInfo_Annotation.fields = proto2_js_1.proto2.util.newFieldList(() =>
|
|
|
1424
1522
|
{ no: 2, name: "source_file", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
1425
1523
|
{ no: 3, name: "begin", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
|
|
1426
1524
|
{ no: 4, name: "end", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
|
|
1525
|
+
{ no: 5, name: "semantic", kind: "enum", T: proto2_js_1.proto2.getEnumType(GeneratedCodeInfo_Annotation_Semantic), opt: true },
|
|
1526
|
+
]);
|
|
1527
|
+
/**
|
|
1528
|
+
* Represents the identified object's effect on the element in the original
|
|
1529
|
+
* .proto file.
|
|
1530
|
+
*
|
|
1531
|
+
* @generated from enum google.protobuf.GeneratedCodeInfo.Annotation.Semantic
|
|
1532
|
+
*/
|
|
1533
|
+
var GeneratedCodeInfo_Annotation_Semantic;
|
|
1534
|
+
(function (GeneratedCodeInfo_Annotation_Semantic) {
|
|
1535
|
+
/**
|
|
1536
|
+
* There is no effect or the effect is indescribable.
|
|
1537
|
+
*
|
|
1538
|
+
* @generated from enum value: NONE = 0;
|
|
1539
|
+
*/
|
|
1540
|
+
GeneratedCodeInfo_Annotation_Semantic[GeneratedCodeInfo_Annotation_Semantic["NONE"] = 0] = "NONE";
|
|
1541
|
+
/**
|
|
1542
|
+
* The element is set or otherwise mutated.
|
|
1543
|
+
*
|
|
1544
|
+
* @generated from enum value: SET = 1;
|
|
1545
|
+
*/
|
|
1546
|
+
GeneratedCodeInfo_Annotation_Semantic[GeneratedCodeInfo_Annotation_Semantic["SET"] = 1] = "SET";
|
|
1547
|
+
/**
|
|
1548
|
+
* An alias to the element is returned.
|
|
1549
|
+
*
|
|
1550
|
+
* @generated from enum value: ALIAS = 2;
|
|
1551
|
+
*/
|
|
1552
|
+
GeneratedCodeInfo_Annotation_Semantic[GeneratedCodeInfo_Annotation_Semantic["ALIAS"] = 2] = "ALIAS";
|
|
1553
|
+
})(GeneratedCodeInfo_Annotation_Semantic = exports.GeneratedCodeInfo_Annotation_Semantic || (exports.GeneratedCodeInfo_Annotation_Semantic = {}));
|
|
1554
|
+
// Retrieve enum metadata with: proto2.getEnumType(GeneratedCodeInfo_Annotation_Semantic)
|
|
1555
|
+
proto2_js_1.proto2.util.setEnumType(GeneratedCodeInfo_Annotation_Semantic, "google.protobuf.GeneratedCodeInfo.Annotation.Semantic", [
|
|
1556
|
+
{ no: 0, name: "NONE" },
|
|
1557
|
+
{ no: 1, name: "SET" },
|
|
1558
|
+
{ no: 2, name: "ALIAS" },
|
|
1427
1559
|
]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright 2021-
|
|
2
|
+
// Copyright 2021-2023 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.
|
|
@@ -78,7 +78,6 @@ const proto3_js_1 = require("../../proto3.js");
|
|
|
78
78
|
* microsecond should be expressed in JSON format as "3.000001s".
|
|
79
79
|
*
|
|
80
80
|
*
|
|
81
|
-
*
|
|
82
81
|
* @generated from message google.protobuf.Duration
|
|
83
82
|
*/
|
|
84
83
|
class Duration extends message_js_1.Message {
|
|
@@ -121,7 +120,7 @@ class Duration extends message_js_1.Message {
|
|
|
121
120
|
if (typeof match[2] == "string") {
|
|
122
121
|
const nanosStr = match[2] + "0".repeat(9 - match[2].length);
|
|
123
122
|
this.nanos = parseInt(nanosStr);
|
|
124
|
-
if (longSeconds <
|
|
123
|
+
if (longSeconds < 0 || Object.is(longSeconds, -0)) {
|
|
125
124
|
this.nanos = -this.nanos;
|
|
126
125
|
}
|
|
127
126
|
}
|
|
@@ -142,6 +141,9 @@ class Duration extends message_js_1.Message {
|
|
|
142
141
|
nanosStr = nanosStr.substring(0, 6);
|
|
143
142
|
}
|
|
144
143
|
text += "." + nanosStr;
|
|
144
|
+
if (this.nanos < 0 && this.seconds === proto_int64_js_1.protoInt64.zero) {
|
|
145
|
+
text = "-" + text;
|
|
146
|
+
}
|
|
145
147
|
}
|
|
146
148
|
return text + "s";
|
|
147
149
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright 2021-
|
|
2
|
+
// Copyright 2021-2023 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.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.ListValue = exports.Value = exports.Struct = exports.NullValue = void 0;
|
|
17
|
-
// @generated by protoc-gen-es
|
|
17
|
+
// @generated by protoc-gen-es v1.1.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
|
|
18
18
|
// @generated from file google/protobuf/struct.proto (package google.protobuf, syntax proto3)
|
|
19
19
|
/* eslint-disable */
|
|
20
20
|
const proto3_js_1 = require("../../proto3.js");
|
|
@@ -123,8 +123,13 @@ class Value extends message_js_1.Message {
|
|
|
123
123
|
switch (this.kind.case) {
|
|
124
124
|
case "nullValue":
|
|
125
125
|
return null;
|
|
126
|
-
case "boolValue":
|
|
127
126
|
case "numberValue":
|
|
127
|
+
if (!Number.isFinite(this.kind.value)) {
|
|
128
|
+
throw new Error("google.protobuf.Value cannot be NaN or Infinity");
|
|
129
|
+
}
|
|
130
|
+
return this.kind.value;
|
|
131
|
+
case "boolValue":
|
|
132
|
+
return this.kind.value;
|
|
128
133
|
case "stringValue":
|
|
129
134
|
return this.kind.value;
|
|
130
135
|
case "structValue":
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright 2021-
|
|
2
|
+
// Copyright 2021-2023 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.
|
|
@@ -68,7 +68,6 @@ const proto3_js_1 = require("../../proto3.js");
|
|
|
68
68
|
* Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
|
69
69
|
* .setNanos((int) ((millis % 1000) * 1000000)).build();
|
|
70
70
|
*
|
|
71
|
-
*
|
|
72
71
|
* Example 5: Compute Timestamp from Java `Instant.now()`.
|
|
73
72
|
*
|
|
74
73
|
* Instant now = Instant.now();
|
|
@@ -77,7 +76,6 @@ const proto3_js_1 = require("../../proto3.js");
|
|
|
77
76
|
* Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
|
78
77
|
* .setNanos(now.getNano()).build();
|
|
79
78
|
*
|
|
80
|
-
*
|
|
81
79
|
* Example 6: Compute Timestamp from current time in Python.
|
|
82
80
|
*
|
|
83
81
|
* timestamp = Timestamp()
|
|
@@ -111,7 +109,6 @@ const proto3_js_1 = require("../../proto3.js");
|
|
|
111
109
|
* ) to obtain a formatter capable of generating timestamps in this format.
|
|
112
110
|
*
|
|
113
111
|
*
|
|
114
|
-
*
|
|
115
112
|
* @generated from message google.protobuf.Timestamp
|
|
116
113
|
*/
|
|
117
114
|
class Timestamp extends message_js_1.Message {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright 2021-
|
|
2
|
+
// Copyright 2021-2023 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.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.Option = exports.EnumValue = exports.Enum = exports.Field_Cardinality = exports.Field_Kind = exports.Field = exports.Type = exports.Syntax = void 0;
|
|
17
|
-
// @generated by protoc-gen-es
|
|
17
|
+
// @generated by protoc-gen-es v1.1.0 with parameter "bootstrap_wkt=true,ts_nocheck=false,target=ts"
|
|
18
18
|
// @generated from file google/protobuf/type.proto (package google.protobuf, syntax proto3)
|
|
19
19
|
/* eslint-disable */
|
|
20
20
|
const proto3_js_1 = require("../../proto3.js");
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright 2021-
|
|
2
|
+
// Copyright 2021-2023 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.
|
|
@@ -27,7 +27,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
27
27
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
28
28
|
};
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.createRegistryFromDescriptors = exports.createRegistry = exports.createDescriptorSet = exports.BinaryReader = exports.BinaryWriter = exports.WireType = exports.MethodIdempotency = exports.MethodKind = exports.ScalarType = exports.Message = exports.codegenInfo = exports.protoBase64 = exports.protoInt64 = exports.proto2 = exports.proto3 = void 0;
|
|
30
|
+
exports.createRegistryFromDescriptors = exports.createRegistry = exports.createDescriptorSet = exports.BinaryReader = exports.BinaryWriter = exports.WireType = exports.MethodIdempotency = exports.MethodKind = exports.ScalarType = exports.Message = exports.codegenInfo = exports.protoDelimited = exports.protoBase64 = exports.protoInt64 = exports.proto2 = exports.proto3 = void 0;
|
|
31
31
|
var proto3_js_1 = require("./proto3.js");
|
|
32
32
|
Object.defineProperty(exports, "proto3", { enumerable: true, get: function () { return proto3_js_1.proto3; } });
|
|
33
33
|
var proto2_js_1 = require("./proto2.js");
|
|
@@ -36,6 +36,8 @@ var proto_int64_js_1 = require("./proto-int64.js");
|
|
|
36
36
|
Object.defineProperty(exports, "protoInt64", { enumerable: true, get: function () { return proto_int64_js_1.protoInt64; } });
|
|
37
37
|
var proto_base64_js_1 = require("./proto-base64.js");
|
|
38
38
|
Object.defineProperty(exports, "protoBase64", { enumerable: true, get: function () { return proto_base64_js_1.protoBase64; } });
|
|
39
|
+
var proto_delimited_js_1 = require("./proto-delimited.js");
|
|
40
|
+
Object.defineProperty(exports, "protoDelimited", { enumerable: true, get: function () { return proto_delimited_js_1.protoDelimited; } });
|
|
39
41
|
var codegen_info_js_1 = require("./codegen-info.js");
|
|
40
42
|
Object.defineProperty(exports, "codegenInfo", { enumerable: true, get: function () { return codegen_info_js_1.codegenInfo; } });
|
|
41
43
|
var message_js_1 = require("./message.js");
|
package/dist/cjs/json-format.js
CHANGED
package/dist/cjs/message-type.js
CHANGED
package/dist/cjs/message.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright 2021-
|
|
2
|
+
// Copyright 2021-2023 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.
|
|
@@ -103,8 +103,10 @@ class Message {
|
|
|
103
103
|
* message type. As a result, attempting to serialize a message with this
|
|
104
104
|
* type will throw an Error.
|
|
105
105
|
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
106
|
+
* This method is protected because you should not need to invoke it
|
|
107
|
+
* directly -- instead use JSON.stringify or toJsonString for
|
|
108
|
+
* stringified JSON. Alternatively, if actual JSON is desired, you should
|
|
109
|
+
* use toJson.
|
|
108
110
|
*/
|
|
109
111
|
toJSON() {
|
|
110
112
|
return this.toJson({
|
package/dist/cjs/private/enum.js
CHANGED