@bufbuild/protobuf 1.9.0 → 2.0.0-alpha.2
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.d.ts +6 -0
- package/dist/cjs/clone.js +77 -0
- package/dist/cjs/codegenv1/boot.d.ts +63 -0
- package/dist/cjs/codegenv1/boot.js +102 -0
- package/dist/cjs/codegenv1/embed.d.ts +43 -0
- package/dist/cjs/codegenv1/embed.js +238 -0
- package/dist/cjs/codegenv1/enum.d.ts +17 -0
- package/dist/cjs/codegenv1/enum.js +41 -0
- package/dist/cjs/codegenv1/extension.d.ts +9 -0
- package/dist/cjs/codegenv1/extension.js +29 -0
- package/dist/cjs/codegenv1/file.d.ts +7 -0
- package/dist/cjs/codegenv1/file.js +38 -0
- package/dist/cjs/codegenv1/index.d.ts +9 -0
- package/dist/cjs/codegenv1/index.js +38 -0
- package/dist/cjs/codegenv1/message.d.ts +9 -0
- package/dist/cjs/codegenv1/message.js +25 -0
- package/dist/cjs/codegenv1/restore-json-names.d.ts +5 -0
- package/dist/cjs/codegenv1/restore-json-names.js +30 -0
- package/dist/cjs/codegenv1/service.d.ts +8 -0
- package/dist/cjs/codegenv1/service.js +28 -0
- package/dist/cjs/codegenv1/symbols.d.ts +125 -0
- package/dist/cjs/codegenv1/symbols.js +67 -0
- package/dist/cjs/codegenv1/types.d.ts +72 -0
- package/dist/cjs/codegenv1/types.js +21 -0
- package/dist/cjs/create.d.ts +9 -0
- package/dist/cjs/create.js +231 -0
- package/dist/{esm/descriptor-set.d.ts → cjs/desc-types.d.ts} +162 -243
- package/dist/cjs/equals.d.ts +9 -0
- package/dist/cjs/equals.js +133 -0
- package/dist/cjs/extensions.d.ts +59 -0
- package/dist/cjs/extensions.js +169 -0
- package/dist/cjs/fields.d.ts +23 -0
- package/dist/cjs/fields.js +46 -0
- package/dist/cjs/from-binary.d.ts +34 -0
- package/dist/cjs/from-binary.js +211 -0
- package/dist/cjs/from-json.d.ts +48 -0
- package/dist/cjs/from-json.js +610 -0
- package/dist/cjs/index.d.ts +16 -42
- package/dist/cjs/index.js +23 -55
- package/dist/cjs/is-message.d.ts +5 -20
- package/dist/cjs/is-message.js +11 -29
- package/dist/cjs/json-value.d.ts +16 -0
- package/dist/cjs/proto-int64.js +2 -2
- package/dist/cjs/reflect/error.d.ts +9 -0
- package/dist/cjs/reflect/error.js +36 -0
- package/dist/cjs/reflect/guard.d.ts +20 -0
- package/dist/cjs/reflect/guard.js +78 -0
- package/dist/cjs/reflect/index.d.ts +8 -0
- package/dist/cjs/reflect/index.js +41 -0
- package/dist/cjs/reflect/names.d.ts +11 -0
- package/dist/cjs/reflect/names.js +74 -0
- package/dist/cjs/reflect/nested-types.d.ts +12 -0
- package/dist/cjs/reflect/nested-types.js +71 -0
- package/dist/cjs/reflect/reflect-check.d.ts +10 -0
- package/dist/cjs/reflect/reflect-check.js +150 -0
- package/dist/cjs/reflect/reflect-types.d.ts +284 -0
- package/dist/cjs/{extension.js → reflect/reflect-types.js} +1 -0
- package/dist/cjs/reflect/reflect.d.ts +32 -0
- package/dist/cjs/reflect/reflect.js +434 -0
- package/dist/cjs/reflect/registry.d.ts +82 -0
- package/dist/cjs/reflect/registry.js +879 -0
- package/dist/{esm → cjs/reflect}/scalar.d.ts +21 -1
- package/dist/cjs/reflect/scalar.js +298 -0
- package/dist/cjs/reflect/unsafe.d.ts +58 -0
- package/dist/cjs/reflect/unsafe.js +166 -0
- package/dist/cjs/to-binary.d.ts +24 -0
- package/dist/cjs/to-binary.js +192 -0
- package/dist/cjs/to-json.d.ts +50 -0
- package/dist/cjs/to-json.js +364 -0
- package/dist/cjs/types.d.ts +68 -0
- package/dist/cjs/wire/base64-encoding.d.ts +23 -0
- package/dist/cjs/wire/base64-encoding.js +156 -0
- package/dist/cjs/wire/binary-encoding.d.ts +244 -0
- package/dist/cjs/{binary-encoding.js → wire/binary-encoding.js} +27 -20
- package/dist/cjs/wire/index.d.ts +5 -0
- package/dist/cjs/wire/index.js +34 -0
- package/dist/cjs/wire/size-delimited.d.ts +51 -0
- package/dist/cjs/wire/size-delimited.js +154 -0
- package/dist/cjs/wire/text-encoding.d.ts +26 -0
- package/dist/cjs/wire/text-encoding.js +55 -0
- package/dist/cjs/wire/text-format.d.ts +14 -0
- package/dist/cjs/{private → wire}/text-format.js +12 -2
- package/dist/{esm/google → cjs/wire}/varint.d.ts +2 -2
- package/dist/cjs/{google → wire}/varint.js +11 -10
- package/dist/cjs/wkt/any.d.ts +38 -0
- package/dist/cjs/wkt/any.js +76 -0
- package/dist/{esm → cjs/wkt/gen}/google/protobuf/any_pb.d.ts +13 -27
- package/dist/cjs/wkt/gen/google/protobuf/any_pb.js +27 -0
- package/dist/cjs/{google → wkt/gen/google}/protobuf/api_pb.d.ts +29 -38
- package/dist/cjs/wkt/gen/google/protobuf/api_pb.js +39 -0
- package/dist/cjs/{google → wkt/gen/google}/protobuf/compiler/plugin_pb.d.ts +67 -75
- package/dist/cjs/wkt/gen/google/protobuf/compiler/plugin_pb.js +68 -0
- package/dist/cjs/{google → wkt/gen/google}/protobuf/descriptor_pb.d.ts +564 -527
- package/dist/cjs/wkt/gen/google/protobuf/descriptor_pb.js +794 -0
- package/dist/cjs/{google → wkt/gen/google}/protobuf/duration_pb.d.ts +13 -18
- package/dist/cjs/wkt/gen/google/protobuf/duration_pb.js +27 -0
- package/dist/cjs/wkt/gen/google/protobuf/empty_pb.d.ts +24 -0
- package/dist/cjs/wkt/gen/google/protobuf/empty_pb.js +27 -0
- package/dist/{esm → cjs/wkt/gen}/google/protobuf/field_mask_pb.d.ts +13 -18
- package/dist/cjs/wkt/gen/google/protobuf/field_mask_pb.js +27 -0
- package/dist/cjs/wkt/gen/google/protobuf/source_context_pb.d.ts +26 -0
- package/dist/cjs/wkt/gen/google/protobuf/source_context_pb.js +27 -0
- package/dist/{esm → cjs/wkt/gen}/google/protobuf/struct_pb.d.ts +44 -55
- package/dist/cjs/wkt/gen/google/protobuf/struct_pb.js +59 -0
- package/dist/cjs/{google → wkt/gen/google}/protobuf/timestamp_pb.d.ts +13 -21
- package/dist/cjs/wkt/gen/google/protobuf/timestamp_pb.js +27 -0
- package/dist/{esm → cjs/wkt/gen}/google/protobuf/type_pb.d.ts +77 -80
- package/dist/cjs/wkt/gen/google/protobuf/type_pb.js +242 -0
- package/dist/cjs/wkt/gen/google/protobuf/wrappers_pb.d.ts +186 -0
- package/dist/cjs/wkt/gen/google/protobuf/wrappers_pb.js +67 -0
- package/dist/cjs/wkt/index.d.ts +15 -0
- package/dist/cjs/wkt/index.js +44 -0
- package/dist/cjs/wkt/timestamp.d.ts +21 -0
- package/dist/cjs/wkt/timestamp.js +58 -0
- package/dist/cjs/wkt/wrappers.d.ts +15 -0
- package/dist/cjs/wkt/wrappers.js +43 -0
- package/dist/esm/clone.d.ts +6 -0
- package/dist/esm/clone.js +73 -0
- package/dist/esm/codegenv1/boot.d.ts +63 -0
- package/dist/esm/codegenv1/boot.js +97 -0
- package/dist/esm/codegenv1/embed.d.ts +43 -0
- package/dist/esm/codegenv1/embed.js +232 -0
- package/dist/esm/codegenv1/enum.d.ts +17 -0
- package/dist/esm/codegenv1/enum.js +36 -0
- package/dist/esm/codegenv1/extension.d.ts +9 -0
- package/dist/esm/codegenv1/extension.js +25 -0
- package/dist/esm/codegenv1/file.d.ts +7 -0
- package/dist/esm/codegenv1/file.js +34 -0
- package/dist/esm/codegenv1/index.d.ts +9 -0
- package/dist/esm/codegenv1/index.js +22 -0
- package/dist/esm/codegenv1/message.d.ts +9 -0
- package/dist/esm/codegenv1/message.js +21 -0
- package/dist/esm/codegenv1/restore-json-names.d.ts +5 -0
- package/dist/esm/codegenv1/restore-json-names.js +26 -0
- package/dist/esm/codegenv1/service.d.ts +8 -0
- package/dist/esm/codegenv1/service.js +24 -0
- package/dist/esm/codegenv1/symbols.d.ts +125 -0
- package/dist/esm/codegenv1/symbols.js +64 -0
- package/dist/esm/codegenv1/types.d.ts +72 -0
- package/dist/esm/{field-list.js → codegenv1/types.js} +6 -0
- package/dist/esm/create.d.ts +9 -0
- package/dist/esm/create.js +228 -0
- package/dist/{cjs/descriptor-set.d.ts → esm/desc-types.d.ts} +162 -243
- package/dist/esm/equals.d.ts +9 -0
- package/dist/esm/equals.js +129 -0
- package/dist/esm/extensions.d.ts +59 -0
- package/dist/esm/extensions.js +159 -0
- package/dist/esm/fields.d.ts +23 -0
- package/dist/esm/fields.js +41 -0
- package/dist/esm/from-binary.d.ts +34 -0
- package/dist/esm/from-binary.js +205 -0
- package/dist/esm/from-json.d.ts +48 -0
- package/dist/esm/from-json.js +603 -0
- package/dist/esm/index.d.ts +16 -42
- package/dist/esm/index.js +13 -30
- package/dist/esm/is-message.d.ts +5 -20
- package/dist/esm/is-message.js +11 -29
- package/dist/esm/json-value.d.ts +16 -0
- package/dist/esm/proto-int64.js +2 -2
- package/dist/esm/reflect/error.d.ts +9 -0
- package/dist/esm/reflect/error.js +31 -0
- package/dist/esm/reflect/guard.d.ts +20 -0
- package/dist/esm/reflect/guard.js +70 -0
- package/dist/esm/reflect/index.d.ts +8 -0
- package/dist/esm/reflect/index.js +21 -0
- package/dist/esm/reflect/names.d.ts +11 -0
- package/dist/esm/reflect/names.js +69 -0
- package/dist/esm/reflect/nested-types.d.ts +12 -0
- package/dist/esm/reflect/nested-types.js +66 -0
- package/dist/esm/reflect/reflect-check.d.ts +10 -0
- package/dist/esm/reflect/reflect-check.js +143 -0
- package/dist/esm/reflect/reflect-types.d.ts +284 -0
- package/dist/esm/reflect/reflect-types.js +15 -0
- package/dist/esm/reflect/reflect.d.ts +32 -0
- package/dist/esm/reflect/reflect.js +428 -0
- package/dist/esm/reflect/registry.d.ts +82 -0
- package/dist/esm/reflect/registry.js +874 -0
- package/dist/{cjs → esm/reflect}/scalar.d.ts +21 -1
- package/dist/esm/reflect/scalar.js +289 -0
- package/dist/esm/reflect/unsafe.d.ts +58 -0
- package/dist/esm/reflect/unsafe.js +155 -0
- package/dist/esm/to-binary.d.ts +24 -0
- package/dist/esm/to-binary.js +187 -0
- package/dist/esm/to-json.d.ts +50 -0
- package/dist/esm/to-json.js +359 -0
- package/dist/esm/types.d.ts +68 -0
- package/dist/esm/wire/base64-encoding.d.ts +23 -0
- package/dist/esm/wire/base64-encoding.js +151 -0
- package/dist/esm/wire/binary-encoding.d.ts +244 -0
- package/dist/esm/{binary-encoding.js → wire/binary-encoding.js} +27 -20
- package/dist/esm/wire/index.d.ts +5 -0
- package/dist/esm/wire/index.js +18 -0
- package/dist/esm/wire/size-delimited.d.ts +51 -0
- package/dist/esm/wire/size-delimited.js +148 -0
- package/dist/esm/wire/text-encoding.d.ts +26 -0
- package/dist/esm/wire/text-encoding.js +50 -0
- package/dist/esm/wire/text-format.d.ts +14 -0
- package/dist/esm/{private → wire}/text-format.js +12 -2
- package/dist/{cjs/google → esm/wire}/varint.d.ts +2 -2
- package/dist/esm/{google → wire}/varint.js +11 -10
- package/dist/esm/wkt/any.d.ts +38 -0
- package/dist/esm/wkt/any.js +69 -0
- package/dist/{cjs → esm/wkt/gen}/google/protobuf/any_pb.d.ts +13 -27
- package/dist/esm/wkt/gen/google/protobuf/any_pb.js +24 -0
- package/dist/esm/{google → wkt/gen/google}/protobuf/api_pb.d.ts +29 -38
- package/dist/esm/wkt/gen/google/protobuf/api_pb.js +36 -0
- package/dist/esm/{google → wkt/gen/google}/protobuf/compiler/plugin_pb.d.ts +67 -75
- package/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.js +65 -0
- package/dist/esm/{google → wkt/gen/google}/protobuf/descriptor_pb.d.ts +564 -527
- package/dist/esm/wkt/gen/google/protobuf/descriptor_pb.js +790 -0
- package/dist/esm/{google → wkt/gen/google}/protobuf/duration_pb.d.ts +13 -18
- package/dist/esm/wkt/gen/google/protobuf/duration_pb.js +24 -0
- package/dist/esm/wkt/gen/google/protobuf/empty_pb.d.ts +24 -0
- package/dist/esm/wkt/gen/google/protobuf/empty_pb.js +24 -0
- package/dist/{cjs → esm/wkt/gen}/google/protobuf/field_mask_pb.d.ts +13 -18
- package/dist/esm/wkt/gen/google/protobuf/field_mask_pb.js +24 -0
- package/dist/esm/wkt/gen/google/protobuf/source_context_pb.d.ts +26 -0
- package/dist/esm/wkt/gen/google/protobuf/source_context_pb.js +24 -0
- package/dist/{cjs → esm/wkt/gen}/google/protobuf/struct_pb.d.ts +44 -55
- package/dist/esm/wkt/gen/google/protobuf/struct_pb.js +56 -0
- package/dist/esm/{google → wkt/gen/google}/protobuf/timestamp_pb.d.ts +13 -21
- package/dist/esm/wkt/gen/google/protobuf/timestamp_pb.js +24 -0
- package/dist/{cjs → esm/wkt/gen}/google/protobuf/type_pb.d.ts +77 -80
- package/dist/esm/wkt/gen/google/protobuf/type_pb.js +239 -0
- package/dist/esm/wkt/gen/google/protobuf/wrappers_pb.d.ts +186 -0
- package/dist/esm/wkt/gen/google/protobuf/wrappers_pb.js +64 -0
- package/dist/esm/wkt/index.d.ts +15 -0
- package/dist/esm/wkt/index.js +28 -0
- package/dist/esm/wkt/timestamp.d.ts +21 -0
- package/dist/esm/wkt/timestamp.js +50 -0
- package/dist/esm/wkt/wrappers.d.ts +15 -0
- package/dist/esm/wkt/wrappers.js +38 -0
- package/package.json +37 -5
- package/dist/cjs/binary-encoding.d.ts +0 -420
- package/dist/cjs/binary-format.d.ts +0 -113
- package/dist/cjs/codegen-info.d.ts +0 -33
- package/dist/cjs/codegen-info.js +0 -69
- package/dist/cjs/create-descriptor-set.d.ts +0 -36
- package/dist/cjs/create-descriptor-set.js +0 -910
- package/dist/cjs/create-registry-from-desc.d.ts +0 -15
- package/dist/cjs/create-registry-from-desc.js +0 -264
- package/dist/cjs/create-registry.d.ts +0 -9
- package/dist/cjs/create-registry.js +0 -94
- package/dist/cjs/enum.d.ts +0 -35
- package/dist/cjs/extension-accessor.d.ts +0 -35
- package/dist/cjs/extension-accessor.js +0 -114
- package/dist/cjs/extension.d.ts +0 -24
- package/dist/cjs/field-list.d.ts +0 -27
- package/dist/cjs/field-list.js +0 -15
- package/dist/cjs/field.d.ts +0 -314
- package/dist/cjs/field.js +0 -15
- package/dist/cjs/google/protobuf/any_pb.js +0 -273
- package/dist/cjs/google/protobuf/api_pb.js +0 -316
- package/dist/cjs/google/protobuf/compiler/plugin_pb.js +0 -219
- package/dist/cjs/google/protobuf/descriptor_pb.js +0 -2034
- package/dist/cjs/google/protobuf/duration_pb.js +0 -169
- package/dist/cjs/google/protobuf/empty_pb.d.ts +0 -28
- package/dist/cjs/google/protobuf/empty_pb.js +0 -52
- package/dist/cjs/google/protobuf/field_mask_pb.js +0 -311
- package/dist/cjs/google/protobuf/source_context_pb.d.ts +0 -29
- package/dist/cjs/google/protobuf/source_context_pb.js +0 -55
- package/dist/cjs/google/protobuf/struct_pb.js +0 -240
- package/dist/cjs/google/protobuf/timestamp_pb.js +0 -213
- package/dist/cjs/google/protobuf/type_pb.js +0 -562
- package/dist/cjs/google/protobuf/wrappers_pb.d.ts +0 -267
- package/dist/cjs/google/protobuf/wrappers_pb.js +0 -569
- package/dist/cjs/json-format.d.ts +0 -111
- package/dist/cjs/json-format.js +0 -15
- package/dist/cjs/message-type.d.ts +0 -51
- package/dist/cjs/message-type.js +0 -15
- package/dist/cjs/message.d.ts +0 -131
- package/dist/cjs/message.js +0 -129
- package/dist/cjs/private/binary-format.d.ts +0 -7
- package/dist/cjs/private/binary-format.js +0 -430
- package/dist/cjs/private/enum.d.ts +0 -27
- package/dist/cjs/private/enum.js +0 -94
- package/dist/cjs/private/extensions.d.ts +0 -34
- package/dist/cjs/private/extensions.js +0 -86
- package/dist/cjs/private/feature-set.d.ts +0 -19
- package/dist/cjs/private/feature-set.js +0 -106
- package/dist/cjs/private/field-list.d.ts +0 -18
- package/dist/cjs/private/field-list.js +0 -76
- package/dist/cjs/private/field-normalize.d.ts +0 -9
- package/dist/cjs/private/field-normalize.js +0 -69
- package/dist/cjs/private/field-wrapper.d.ts +0 -25
- package/dist/cjs/private/field-wrapper.js +0 -57
- package/dist/cjs/private/field.d.ts +0 -16
- package/dist/cjs/private/field.js +0 -45
- package/dist/cjs/private/json-format.d.ts +0 -2
- package/dist/cjs/private/json-format.js +0 -626
- package/dist/cjs/private/message-type.d.ts +0 -18
- package/dist/cjs/private/message-type.js +0 -50
- package/dist/cjs/private/names.d.ts +0 -43
- package/dist/cjs/private/names.js +0 -278
- package/dist/cjs/private/options-map.d.ts +0 -7
- package/dist/cjs/private/options-map.js +0 -15
- package/dist/cjs/private/proto-runtime.d.ts +0 -53
- package/dist/cjs/private/proto-runtime.js +0 -41
- package/dist/cjs/private/reflect.d.ts +0 -9
- package/dist/cjs/private/reflect.js +0 -79
- package/dist/cjs/private/reify-wkt.d.ts +0 -102
- package/dist/cjs/private/reify-wkt.js +0 -172
- package/dist/cjs/private/scalars.d.ts +0 -18
- package/dist/cjs/private/scalars.js +0 -105
- package/dist/cjs/private/text-format.d.ts +0 -4
- package/dist/cjs/private/util-common.d.ts +0 -2
- package/dist/cjs/private/util-common.js +0 -237
- package/dist/cjs/private/util.d.ts +0 -38
- package/dist/cjs/private/util.js +0 -15
- package/dist/cjs/proto-base64.d.ts +0 -18
- package/dist/cjs/proto-base64.js +0 -128
- package/dist/cjs/proto-delimited.d.ts +0 -54
- package/dist/cjs/proto-delimited.js +0 -155
- package/dist/cjs/proto-double.d.ts +0 -5
- package/dist/cjs/proto-double.js +0 -29
- package/dist/cjs/proto2.d.ts +0 -4
- package/dist/cjs/proto2.js +0 -53
- package/dist/cjs/proto3.d.ts +0 -4
- package/dist/cjs/proto3.js +0 -56
- package/dist/cjs/scalar.js +0 -81
- package/dist/cjs/service-type.d.ts +0 -96
- package/dist/cjs/service-type.js +0 -53
- package/dist/cjs/to-plain-message.d.ts +0 -12
- package/dist/cjs/to-plain-message.js +0 -72
- package/dist/cjs/type-registry.d.ts +0 -57
- package/dist/cjs/type-registry.js +0 -15
- package/dist/esm/binary-encoding.d.ts +0 -420
- package/dist/esm/binary-format.d.ts +0 -113
- package/dist/esm/codegen-info.d.ts +0 -33
- package/dist/esm/codegen-info.js +0 -67
- package/dist/esm/create-descriptor-set.d.ts +0 -36
- package/dist/esm/create-descriptor-set.js +0 -906
- package/dist/esm/create-registry-from-desc.d.ts +0 -15
- package/dist/esm/create-registry-from-desc.js +0 -261
- package/dist/esm/create-registry.d.ts +0 -9
- package/dist/esm/create-registry.js +0 -90
- package/dist/esm/descriptor-set.js +0 -14
- package/dist/esm/enum.d.ts +0 -35
- package/dist/esm/extension-accessor.d.ts +0 -35
- package/dist/esm/extension-accessor.js +0 -107
- package/dist/esm/extension.d.ts +0 -24
- package/dist/esm/field-list.d.ts +0 -27
- package/dist/esm/field.d.ts +0 -314
- package/dist/esm/field.js +0 -14
- package/dist/esm/google/protobuf/any_pb.js +0 -269
- package/dist/esm/google/protobuf/api_pb.js +0 -310
- package/dist/esm/google/protobuf/compiler/plugin_pb.js +0 -212
- package/dist/esm/google/protobuf/descriptor_pb.js +0 -1999
- package/dist/esm/google/protobuf/duration_pb.js +0 -165
- package/dist/esm/google/protobuf/empty_pb.d.ts +0 -28
- package/dist/esm/google/protobuf/empty_pb.js +0 -48
- package/dist/esm/google/protobuf/field_mask_pb.js +0 -307
- package/dist/esm/google/protobuf/source_context_pb.d.ts +0 -29
- package/dist/esm/google/protobuf/source_context_pb.js +0 -51
- package/dist/esm/google/protobuf/struct_pb.js +0 -234
- package/dist/esm/google/protobuf/timestamp_pb.js +0 -209
- package/dist/esm/google/protobuf/type_pb.js +0 -554
- package/dist/esm/google/protobuf/wrappers_pb.d.ts +0 -267
- package/dist/esm/google/protobuf/wrappers_pb.js +0 -557
- package/dist/esm/json-format.d.ts +0 -111
- package/dist/esm/json-format.js +0 -14
- package/dist/esm/message-type.d.ts +0 -51
- package/dist/esm/message-type.js +0 -14
- package/dist/esm/message.d.ts +0 -131
- package/dist/esm/message.js +0 -125
- package/dist/esm/private/binary-format.d.ts +0 -7
- package/dist/esm/private/binary-format.js +0 -426
- package/dist/esm/private/enum.d.ts +0 -27
- package/dist/esm/private/enum.js +0 -87
- package/dist/esm/private/extensions.d.ts +0 -34
- package/dist/esm/private/extensions.js +0 -81
- package/dist/esm/private/feature-set.d.ts +0 -19
- package/dist/esm/private/feature-set.js +0 -102
- package/dist/esm/private/field-list.d.ts +0 -18
- package/dist/esm/private/field-list.js +0 -72
- package/dist/esm/private/field-normalize.d.ts +0 -9
- package/dist/esm/private/field-normalize.js +0 -65
- package/dist/esm/private/field-wrapper.d.ts +0 -25
- package/dist/esm/private/field-wrapper.js +0 -53
- package/dist/esm/private/field.d.ts +0 -16
- package/dist/esm/private/field.js +0 -41
- package/dist/esm/private/json-format.d.ts +0 -2
- package/dist/esm/private/json-format.js +0 -623
- package/dist/esm/private/message-type.d.ts +0 -18
- package/dist/esm/private/message-type.js +0 -46
- package/dist/esm/private/names.d.ts +0 -43
- package/dist/esm/private/names.js +0 -269
- package/dist/esm/private/options-map.d.ts +0 -7
- package/dist/esm/private/options-map.js +0 -14
- package/dist/esm/private/proto-runtime.d.ts +0 -53
- package/dist/esm/private/proto-runtime.js +0 -37
- package/dist/esm/private/reflect.d.ts +0 -9
- package/dist/esm/private/reflect.js +0 -74
- package/dist/esm/private/reify-wkt.d.ts +0 -102
- package/dist/esm/private/reify-wkt.js +0 -168
- package/dist/esm/private/scalars.d.ts +0 -18
- package/dist/esm/private/scalars.js +0 -99
- package/dist/esm/private/text-format.d.ts +0 -4
- package/dist/esm/private/util-common.d.ts +0 -2
- package/dist/esm/private/util-common.js +0 -234
- package/dist/esm/private/util.d.ts +0 -38
- package/dist/esm/private/util.js +0 -14
- package/dist/esm/proto-base64.d.ts +0 -18
- package/dist/esm/proto-base64.js +0 -125
- package/dist/esm/proto-delimited.d.ts +0 -54
- package/dist/esm/proto-delimited.js +0 -152
- package/dist/esm/proto-double.d.ts +0 -5
- package/dist/esm/proto-double.js +0 -26
- package/dist/esm/proto2.d.ts +0 -4
- package/dist/esm/proto2.js +0 -50
- package/dist/esm/proto3.d.ts +0 -4
- package/dist/esm/proto3.js +0 -53
- package/dist/esm/scalar.js +0 -78
- package/dist/esm/service-type.d.ts +0 -96
- package/dist/esm/service-type.js +0 -50
- package/dist/esm/to-plain-message.d.ts +0 -12
- package/dist/esm/to-plain-message.js +0 -70
- package/dist/esm/type-registry.d.ts +0 -57
- package/dist/esm/type-registry.js +0 -14
- /package/dist/cjs/{binary-format.js → desc-types.js} +0 -0
- /package/dist/cjs/{descriptor-set.js → json-value.js} +0 -0
- /package/dist/cjs/{private → reflect}/assert.d.ts +0 -0
- /package/dist/cjs/{private → reflect}/assert.js +0 -0
- /package/dist/cjs/{enum.js → types.js} +0 -0
- /package/dist/esm/{binary-format.js → desc-types.js} +0 -0
- /package/dist/esm/{enum.js → json-value.js} +0 -0
- /package/dist/esm/{private → reflect}/assert.d.ts +0 -0
- /package/dist/esm/{private → reflect}/assert.js +0 -0
- /package/dist/esm/{extension.js → types.js} +0 -0
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { FieldList } from "./field-list.js";
|
|
2
|
-
import type { ProtoRuntime } from "./private/proto-runtime.js";
|
|
3
|
-
import type { JsonReadOptions, JsonValue } from "./json-format.js";
|
|
4
|
-
import type { BinaryReadOptions } from "./binary-format.js";
|
|
5
|
-
import type { AnyMessage, Message, PartialMessage, PlainMessage } from "./message.js";
|
|
6
|
-
import type { FieldWrapper } from "./private/field-wrapper.js";
|
|
7
|
-
/**
|
|
8
|
-
* MessageType represents a protobuf message. It provides:
|
|
9
|
-
* - a constructor that produces an instance of the message
|
|
10
|
-
* - metadata for reflection-based operations
|
|
11
|
-
* - common functionality like serialization
|
|
12
|
-
*/
|
|
13
|
-
export interface MessageType<T extends Message<T> = AnyMessage> {
|
|
14
|
-
/**
|
|
15
|
-
* Create a new instance of this type.
|
|
16
|
-
*/
|
|
17
|
-
new (data?: PartialMessage<T>): T;
|
|
18
|
-
/**
|
|
19
|
-
* The fully qualified name of the message.
|
|
20
|
-
*/
|
|
21
|
-
readonly typeName: string;
|
|
22
|
-
/**
|
|
23
|
-
* Field metadata.
|
|
24
|
-
*/
|
|
25
|
-
readonly fields: FieldList;
|
|
26
|
-
/**
|
|
27
|
-
* Provides serialization and other functionality.
|
|
28
|
-
*/
|
|
29
|
-
readonly runtime: ProtoRuntime;
|
|
30
|
-
/**
|
|
31
|
-
* When used as a field, unwrap this message to a simple value.
|
|
32
|
-
*/
|
|
33
|
-
readonly fieldWrapper?: FieldWrapper<T>;
|
|
34
|
-
/**
|
|
35
|
-
* Parse serialized binary data.
|
|
36
|
-
*/
|
|
37
|
-
fromBinary(data: Uint8Array, options?: Partial<BinaryReadOptions>): T;
|
|
38
|
-
/**
|
|
39
|
-
* Parse a JSON object.
|
|
40
|
-
*/
|
|
41
|
-
fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): T;
|
|
42
|
-
/**
|
|
43
|
-
* Parse a JSON string.
|
|
44
|
-
*/
|
|
45
|
-
fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): T;
|
|
46
|
-
/**
|
|
47
|
-
* Returns true if the given arguments have equal field values, recursively.
|
|
48
|
-
* Will also return true if both messages are `undefined` or `null`.
|
|
49
|
-
*/
|
|
50
|
-
equals(a: T | PlainMessage<T> | undefined | null, b: T | PlainMessage<T> | undefined | null): boolean;
|
|
51
|
-
}
|
package/dist/esm/message-type.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// Copyright 2021-2024 Buf Technologies, Inc.
|
|
2
|
-
//
|
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
// you may not use this file except in compliance with the License.
|
|
5
|
-
// You may obtain a copy of the License at
|
|
6
|
-
//
|
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
//
|
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
// See the License for the specific language governing permissions and
|
|
13
|
-
// limitations under the License.
|
|
14
|
-
export {};
|
package/dist/esm/message.d.ts
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import type { BinaryReadOptions, BinaryWriteOptions } from "./binary-format.js";
|
|
2
|
-
import type { JsonReadOptions, JsonValue, JsonWriteOptions, JsonWriteStringOptions } from "./json-format.js";
|
|
3
|
-
import type { MessageType } from "./message-type.js";
|
|
4
|
-
/**
|
|
5
|
-
* AnyMessage is an interface implemented by all messages. If you need to
|
|
6
|
-
* handle messages of unknown type, this interface provides a convenient
|
|
7
|
-
* index signature to access fields with message["fieldname"].
|
|
8
|
-
*/
|
|
9
|
-
export interface AnyMessage extends Message<AnyMessage> {
|
|
10
|
-
[k: string]: any;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Message is the base class of every message, generated, or created at
|
|
14
|
-
* runtime.
|
|
15
|
-
*
|
|
16
|
-
* It is _not_ safe to extend this class. If you want to create a message at
|
|
17
|
-
* run time, use proto3.makeMessageType().
|
|
18
|
-
*/
|
|
19
|
-
export declare class Message<T extends Message<T> = AnyMessage> {
|
|
20
|
-
/**
|
|
21
|
-
* Compare with a message of the same type.
|
|
22
|
-
* Note that this function disregards extensions and unknown fields.
|
|
23
|
-
*/
|
|
24
|
-
equals(other: T | PlainMessage<T> | undefined | null): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Create a deep copy.
|
|
27
|
-
*/
|
|
28
|
-
clone(): T;
|
|
29
|
-
/**
|
|
30
|
-
* Parse from binary data, merging fields.
|
|
31
|
-
*
|
|
32
|
-
* Repeated fields are appended. Map entries are added, overwriting
|
|
33
|
-
* existing keys.
|
|
34
|
-
*
|
|
35
|
-
* If a message field is already present, it will be merged with the
|
|
36
|
-
* new data.
|
|
37
|
-
*/
|
|
38
|
-
fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): this;
|
|
39
|
-
/**
|
|
40
|
-
* Parse a message from a JSON value.
|
|
41
|
-
*/
|
|
42
|
-
fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): this;
|
|
43
|
-
/**
|
|
44
|
-
* Parse a message from a JSON string.
|
|
45
|
-
*/
|
|
46
|
-
fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): this;
|
|
47
|
-
/**
|
|
48
|
-
* Serialize the message to binary data.
|
|
49
|
-
*/
|
|
50
|
-
toBinary(options?: Partial<BinaryWriteOptions>): Uint8Array;
|
|
51
|
-
/**
|
|
52
|
-
* Serialize the message to a JSON value, a JavaScript value that can be
|
|
53
|
-
* passed to JSON.stringify().
|
|
54
|
-
*/
|
|
55
|
-
toJson(options?: Partial<JsonWriteOptions>): JsonValue;
|
|
56
|
-
/**
|
|
57
|
-
* Serialize the message to a JSON string.
|
|
58
|
-
*/
|
|
59
|
-
toJsonString(options?: Partial<JsonWriteStringOptions>): string;
|
|
60
|
-
/**
|
|
61
|
-
* Override for serialization behavior. This will be invoked when calling
|
|
62
|
-
* JSON.stringify on this message (i.e. JSON.stringify(msg)).
|
|
63
|
-
*
|
|
64
|
-
* Note that this will not serialize google.protobuf.Any with a packed
|
|
65
|
-
* message because the protobuf JSON format specifies that it needs to be
|
|
66
|
-
* unpacked, and this is only possible with a type registry to look up the
|
|
67
|
-
* message type. As a result, attempting to serialize a message with this
|
|
68
|
-
* type will throw an Error.
|
|
69
|
-
*
|
|
70
|
-
* This method is protected because you should not need to invoke it
|
|
71
|
-
* directly -- instead use JSON.stringify or toJsonString for
|
|
72
|
-
* stringified JSON. Alternatively, if actual JSON is desired, you should
|
|
73
|
-
* use toJson.
|
|
74
|
-
*/
|
|
75
|
-
protected toJSON(): JsonValue;
|
|
76
|
-
/**
|
|
77
|
-
* Retrieve the MessageType of this message - a singleton that represents
|
|
78
|
-
* the protobuf message declaration and provides metadata for reflection-
|
|
79
|
-
* based operations.
|
|
80
|
-
*/
|
|
81
|
-
getType(): MessageType<T>;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* PlainMessage<T> strips all methods from a message, leaving only fields
|
|
85
|
-
* and oneof groups. It is recursive, meaning it applies this same logic to all
|
|
86
|
-
* nested message fields as well.
|
|
87
|
-
*/
|
|
88
|
-
export type PlainMessage<T extends Message<T>> = {
|
|
89
|
-
[P in keyof T as T[P] extends Function ? never : P]: PlainField<T[P]>;
|
|
90
|
-
};
|
|
91
|
-
type PlainField<F> = F extends (Date | Uint8Array | bigint | boolean | string | number) ? F : F extends Array<infer U> ? Array<PlainField<U>> : F extends ReadonlyArray<infer U> ? ReadonlyArray<PlainField<U>> : F extends Message<infer U> ? PlainMessage<U> : F extends OneofSelectedMessage<infer C, infer V> ? {
|
|
92
|
-
case: C;
|
|
93
|
-
value: PlainField<V>;
|
|
94
|
-
} : F extends {
|
|
95
|
-
case: string | undefined;
|
|
96
|
-
value?: unknown;
|
|
97
|
-
} ? F : F extends {
|
|
98
|
-
[key: string | number]: Message<infer U>;
|
|
99
|
-
} ? {
|
|
100
|
-
[key: string | number]: PlainField<U>;
|
|
101
|
-
} : F;
|
|
102
|
-
/**
|
|
103
|
-
* PartialMessage<T> constructs a type from a message. The resulting type
|
|
104
|
-
* only contains the protobuf field members of the message, and all of them
|
|
105
|
-
* are optional.
|
|
106
|
-
*
|
|
107
|
-
* Note that the optionality of the fields is the only difference between
|
|
108
|
-
* PartialMessage and PlainMessage.
|
|
109
|
-
*
|
|
110
|
-
* PartialMessage is similar to the built-in type Partial<T>, but recursive,
|
|
111
|
-
* and respects `oneof` groups.
|
|
112
|
-
*/
|
|
113
|
-
export type PartialMessage<T extends Message<T>> = {
|
|
114
|
-
[P in keyof T as T[P] extends Function ? never : P]?: PartialField<T[P]>;
|
|
115
|
-
};
|
|
116
|
-
type PartialField<F> = F extends (Date | Uint8Array | bigint | boolean | string | number) ? F : F extends Array<infer U> ? Array<PartialField<U>> : F extends ReadonlyArray<infer U> ? ReadonlyArray<PartialField<U>> : F extends Message<infer U> ? PartialMessage<U> : F extends OneofSelectedMessage<infer C, infer V> ? {
|
|
117
|
-
case: C;
|
|
118
|
-
value: PartialMessage<V>;
|
|
119
|
-
} : F extends {
|
|
120
|
-
case: string | undefined;
|
|
121
|
-
value?: unknown;
|
|
122
|
-
} ? F : F extends {
|
|
123
|
-
[key: string | number]: Message<infer U>;
|
|
124
|
-
} ? {
|
|
125
|
-
[key: string | number]: PartialMessage<U>;
|
|
126
|
-
} : F;
|
|
127
|
-
type OneofSelectedMessage<K extends string, M extends Message<M>> = {
|
|
128
|
-
case: K;
|
|
129
|
-
value: M;
|
|
130
|
-
};
|
|
131
|
-
export {};
|
package/dist/esm/message.js
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
// Copyright 2021-2024 Buf Technologies, Inc.
|
|
2
|
-
//
|
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
// you may not use this file except in compliance with the License.
|
|
5
|
-
// You may obtain a copy of the License at
|
|
6
|
-
//
|
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
//
|
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
// See the License for the specific language governing permissions and
|
|
13
|
-
// limitations under the License.
|
|
14
|
-
/**
|
|
15
|
-
* Message is the base class of every message, generated, or created at
|
|
16
|
-
* runtime.
|
|
17
|
-
*
|
|
18
|
-
* It is _not_ safe to extend this class. If you want to create a message at
|
|
19
|
-
* run time, use proto3.makeMessageType().
|
|
20
|
-
*/
|
|
21
|
-
export class Message {
|
|
22
|
-
/**
|
|
23
|
-
* Compare with a message of the same type.
|
|
24
|
-
* Note that this function disregards extensions and unknown fields.
|
|
25
|
-
*/
|
|
26
|
-
equals(other) {
|
|
27
|
-
return this.getType().runtime.util.equals(this.getType(), this, other);
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Create a deep copy.
|
|
31
|
-
*/
|
|
32
|
-
clone() {
|
|
33
|
-
return this.getType().runtime.util.clone(this);
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Parse from binary data, merging fields.
|
|
37
|
-
*
|
|
38
|
-
* Repeated fields are appended. Map entries are added, overwriting
|
|
39
|
-
* existing keys.
|
|
40
|
-
*
|
|
41
|
-
* If a message field is already present, it will be merged with the
|
|
42
|
-
* new data.
|
|
43
|
-
*/
|
|
44
|
-
fromBinary(bytes, options) {
|
|
45
|
-
const type = this.getType(), format = type.runtime.bin, opt = format.makeReadOptions(options);
|
|
46
|
-
format.readMessage(this, opt.readerFactory(bytes), bytes.byteLength, opt);
|
|
47
|
-
return this;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Parse a message from a JSON value.
|
|
51
|
-
*/
|
|
52
|
-
fromJson(jsonValue, options) {
|
|
53
|
-
const type = this.getType(), format = type.runtime.json, opt = format.makeReadOptions(options);
|
|
54
|
-
format.readMessage(type, jsonValue, opt, this);
|
|
55
|
-
return this;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Parse a message from a JSON string.
|
|
59
|
-
*/
|
|
60
|
-
fromJsonString(jsonString, options) {
|
|
61
|
-
let json;
|
|
62
|
-
try {
|
|
63
|
-
json = JSON.parse(jsonString);
|
|
64
|
-
}
|
|
65
|
-
catch (e) {
|
|
66
|
-
throw new Error(`cannot decode ${this.getType().typeName} from JSON: ${e instanceof Error ? e.message : String(e)}`);
|
|
67
|
-
}
|
|
68
|
-
return this.fromJson(json, options);
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Serialize the message to binary data.
|
|
72
|
-
*/
|
|
73
|
-
toBinary(options) {
|
|
74
|
-
const type = this.getType(), bin = type.runtime.bin, opt = bin.makeWriteOptions(options), writer = opt.writerFactory();
|
|
75
|
-
bin.writeMessage(this, writer, opt);
|
|
76
|
-
return writer.finish();
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Serialize the message to a JSON value, a JavaScript value that can be
|
|
80
|
-
* passed to JSON.stringify().
|
|
81
|
-
*/
|
|
82
|
-
toJson(options) {
|
|
83
|
-
const type = this.getType(), json = type.runtime.json, opt = json.makeWriteOptions(options);
|
|
84
|
-
return json.writeMessage(this, opt);
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Serialize the message to a JSON string.
|
|
88
|
-
*/
|
|
89
|
-
toJsonString(options) {
|
|
90
|
-
var _a;
|
|
91
|
-
const value = this.toJson(options);
|
|
92
|
-
return JSON.stringify(value, null, (_a = options === null || options === void 0 ? void 0 : options.prettySpaces) !== null && _a !== void 0 ? _a : 0);
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Override for serialization behavior. This will be invoked when calling
|
|
96
|
-
* JSON.stringify on this message (i.e. JSON.stringify(msg)).
|
|
97
|
-
*
|
|
98
|
-
* Note that this will not serialize google.protobuf.Any with a packed
|
|
99
|
-
* message because the protobuf JSON format specifies that it needs to be
|
|
100
|
-
* unpacked, and this is only possible with a type registry to look up the
|
|
101
|
-
* message type. As a result, attempting to serialize a message with this
|
|
102
|
-
* type will throw an Error.
|
|
103
|
-
*
|
|
104
|
-
* This method is protected because you should not need to invoke it
|
|
105
|
-
* directly -- instead use JSON.stringify or toJsonString for
|
|
106
|
-
* stringified JSON. Alternatively, if actual JSON is desired, you should
|
|
107
|
-
* use toJson.
|
|
108
|
-
*/
|
|
109
|
-
toJSON() {
|
|
110
|
-
return this.toJson({
|
|
111
|
-
emitDefaultValues: true,
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Retrieve the MessageType of this message - a singleton that represents
|
|
116
|
-
* the protobuf message declaration and provides metadata for reflection-
|
|
117
|
-
* based operations.
|
|
118
|
-
*/
|
|
119
|
-
getType() {
|
|
120
|
-
// Any class that extends Message _must_ provide a complete static
|
|
121
|
-
// implementation of MessageType.
|
|
122
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-return
|
|
123
|
-
return Object.getPrototypeOf(this).constructor;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { IBinaryWriter } from "../binary-encoding.js";
|
|
2
|
-
import type { BinaryFormat, BinaryWriteOptions } from "../binary-format.js";
|
|
3
|
-
import type { FieldInfo } from "../field.js";
|
|
4
|
-
export declare function makeBinaryFormat(): BinaryFormat;
|
|
5
|
-
export declare function writeMapEntry(writer: IBinaryWriter, options: BinaryWriteOptions, field: FieldInfo & {
|
|
6
|
-
kind: "map";
|
|
7
|
-
}, key: string, value: any): void;
|