@bufbuild/protobuf 1.0.0 → 1.1.1
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/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 +4 -5
- 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 +1 -1
- 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 +5 -5
- package/dist/cjs/private/util.js +1 -1
- package/dist/cjs/proto-base64.js +1 -3
- 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 +4 -5
- 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 +1 -1
- 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 +5 -5
- package/dist/esm/private/util.js +1 -1
- package/dist/esm/proto-base64.js +1 -3
- 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/proto-delimited.d.ts +54 -0
- package/dist/types/service-type.d.ts +0 -2
- package/package.json +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { proto3 } from "../../proto3.js";
|
|
1
2
|
import type { PartialMessage, PlainMessage } from "../../message.js";
|
|
2
3
|
import { Message } from "../../message.js";
|
|
3
4
|
import { SourceContext } from "./source_context_pb.js";
|
|
@@ -67,7 +68,7 @@ export declare class Type extends Message<Type> {
|
|
|
67
68
|
*/
|
|
68
69
|
syntax: Syntax;
|
|
69
70
|
constructor(data?: PartialMessage<Type>);
|
|
70
|
-
static readonly runtime:
|
|
71
|
+
static readonly runtime: typeof proto3;
|
|
71
72
|
static readonly typeName = "google.protobuf.Type";
|
|
72
73
|
static readonly fields: FieldList;
|
|
73
74
|
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Type;
|
|
@@ -144,7 +145,7 @@ export declare class Field extends Message<Field> {
|
|
|
144
145
|
*/
|
|
145
146
|
defaultValue: string;
|
|
146
147
|
constructor(data?: PartialMessage<Field>);
|
|
147
|
-
static readonly runtime:
|
|
148
|
+
static readonly runtime: typeof proto3;
|
|
148
149
|
static readonly typeName = "google.protobuf.Field";
|
|
149
150
|
static readonly fields: FieldList;
|
|
150
151
|
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Field;
|
|
@@ -341,7 +342,7 @@ export declare class Enum extends Message<Enum> {
|
|
|
341
342
|
*/
|
|
342
343
|
syntax: Syntax;
|
|
343
344
|
constructor(data?: PartialMessage<Enum>);
|
|
344
|
-
static readonly runtime:
|
|
345
|
+
static readonly runtime: typeof proto3;
|
|
345
346
|
static readonly typeName = "google.protobuf.Enum";
|
|
346
347
|
static readonly fields: FieldList;
|
|
347
348
|
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Enum;
|
|
@@ -374,7 +375,7 @@ export declare class EnumValue extends Message<EnumValue> {
|
|
|
374
375
|
*/
|
|
375
376
|
options: Option[];
|
|
376
377
|
constructor(data?: PartialMessage<EnumValue>);
|
|
377
|
-
static readonly runtime:
|
|
378
|
+
static readonly runtime: typeof proto3;
|
|
378
379
|
static readonly typeName = "google.protobuf.EnumValue";
|
|
379
380
|
static readonly fields: FieldList;
|
|
380
381
|
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): EnumValue;
|
|
@@ -408,7 +409,7 @@ export declare class Option extends Message<Option> {
|
|
|
408
409
|
*/
|
|
409
410
|
value?: Any;
|
|
410
411
|
constructor(data?: PartialMessage<Option>);
|
|
411
|
-
static readonly runtime:
|
|
412
|
+
static readonly runtime: typeof proto3;
|
|
412
413
|
static readonly typeName = "google.protobuf.Option";
|
|
413
414
|
static readonly fields: FieldList;
|
|
414
415
|
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Option;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PartialMessage, PlainMessage } from "../../message.js";
|
|
2
2
|
import { Message } from "../../message.js";
|
|
3
|
+
import { proto3 } from "../../proto3.js";
|
|
3
4
|
import type { JsonReadOptions, JsonValue, JsonWriteOptions } from "../../json-format.js";
|
|
4
5
|
import type { FieldList } from "../../field-list.js";
|
|
5
6
|
import type { BinaryReadOptions } from "../../binary-format.js";
|
|
@@ -20,7 +21,7 @@ export declare class DoubleValue extends Message<DoubleValue> {
|
|
|
20
21
|
constructor(data?: PartialMessage<DoubleValue>);
|
|
21
22
|
toJson(options?: Partial<JsonWriteOptions>): JsonValue;
|
|
22
23
|
fromJson(json: JsonValue, options?: Partial<JsonReadOptions>): this;
|
|
23
|
-
static readonly runtime:
|
|
24
|
+
static readonly runtime: typeof proto3;
|
|
24
25
|
static readonly typeName = "google.protobuf.DoubleValue";
|
|
25
26
|
static readonly fields: FieldList;
|
|
26
27
|
static readonly fieldWrapper: {
|
|
@@ -49,7 +50,7 @@ export declare class FloatValue extends Message<FloatValue> {
|
|
|
49
50
|
constructor(data?: PartialMessage<FloatValue>);
|
|
50
51
|
toJson(options?: Partial<JsonWriteOptions>): JsonValue;
|
|
51
52
|
fromJson(json: JsonValue, options?: Partial<JsonReadOptions>): this;
|
|
52
|
-
static readonly runtime:
|
|
53
|
+
static readonly runtime: typeof proto3;
|
|
53
54
|
static readonly typeName = "google.protobuf.FloatValue";
|
|
54
55
|
static readonly fields: FieldList;
|
|
55
56
|
static readonly fieldWrapper: {
|
|
@@ -78,7 +79,7 @@ export declare class Int64Value extends Message<Int64Value> {
|
|
|
78
79
|
constructor(data?: PartialMessage<Int64Value>);
|
|
79
80
|
toJson(options?: Partial<JsonWriteOptions>): JsonValue;
|
|
80
81
|
fromJson(json: JsonValue, options?: Partial<JsonReadOptions>): this;
|
|
81
|
-
static readonly runtime:
|
|
82
|
+
static readonly runtime: typeof proto3;
|
|
82
83
|
static readonly typeName = "google.protobuf.Int64Value";
|
|
83
84
|
static readonly fields: FieldList;
|
|
84
85
|
static readonly fieldWrapper: {
|
|
@@ -107,7 +108,7 @@ export declare class UInt64Value extends Message<UInt64Value> {
|
|
|
107
108
|
constructor(data?: PartialMessage<UInt64Value>);
|
|
108
109
|
toJson(options?: Partial<JsonWriteOptions>): JsonValue;
|
|
109
110
|
fromJson(json: JsonValue, options?: Partial<JsonReadOptions>): this;
|
|
110
|
-
static readonly runtime:
|
|
111
|
+
static readonly runtime: typeof proto3;
|
|
111
112
|
static readonly typeName = "google.protobuf.UInt64Value";
|
|
112
113
|
static readonly fields: FieldList;
|
|
113
114
|
static readonly fieldWrapper: {
|
|
@@ -136,7 +137,7 @@ export declare class Int32Value extends Message<Int32Value> {
|
|
|
136
137
|
constructor(data?: PartialMessage<Int32Value>);
|
|
137
138
|
toJson(options?: Partial<JsonWriteOptions>): JsonValue;
|
|
138
139
|
fromJson(json: JsonValue, options?: Partial<JsonReadOptions>): this;
|
|
139
|
-
static readonly runtime:
|
|
140
|
+
static readonly runtime: typeof proto3;
|
|
140
141
|
static readonly typeName = "google.protobuf.Int32Value";
|
|
141
142
|
static readonly fields: FieldList;
|
|
142
143
|
static readonly fieldWrapper: {
|
|
@@ -165,7 +166,7 @@ export declare class UInt32Value extends Message<UInt32Value> {
|
|
|
165
166
|
constructor(data?: PartialMessage<UInt32Value>);
|
|
166
167
|
toJson(options?: Partial<JsonWriteOptions>): JsonValue;
|
|
167
168
|
fromJson(json: JsonValue, options?: Partial<JsonReadOptions>): this;
|
|
168
|
-
static readonly runtime:
|
|
169
|
+
static readonly runtime: typeof proto3;
|
|
169
170
|
static readonly typeName = "google.protobuf.UInt32Value";
|
|
170
171
|
static readonly fields: FieldList;
|
|
171
172
|
static readonly fieldWrapper: {
|
|
@@ -194,7 +195,7 @@ export declare class BoolValue extends Message<BoolValue> {
|
|
|
194
195
|
constructor(data?: PartialMessage<BoolValue>);
|
|
195
196
|
toJson(options?: Partial<JsonWriteOptions>): JsonValue;
|
|
196
197
|
fromJson(json: JsonValue, options?: Partial<JsonReadOptions>): this;
|
|
197
|
-
static readonly runtime:
|
|
198
|
+
static readonly runtime: typeof proto3;
|
|
198
199
|
static readonly typeName = "google.protobuf.BoolValue";
|
|
199
200
|
static readonly fields: FieldList;
|
|
200
201
|
static readonly fieldWrapper: {
|
|
@@ -223,7 +224,7 @@ export declare class StringValue extends Message<StringValue> {
|
|
|
223
224
|
constructor(data?: PartialMessage<StringValue>);
|
|
224
225
|
toJson(options?: Partial<JsonWriteOptions>): JsonValue;
|
|
225
226
|
fromJson(json: JsonValue, options?: Partial<JsonReadOptions>): this;
|
|
226
|
-
static readonly runtime:
|
|
227
|
+
static readonly runtime: typeof proto3;
|
|
227
228
|
static readonly typeName = "google.protobuf.StringValue";
|
|
228
229
|
static readonly fields: FieldList;
|
|
229
230
|
static readonly fieldWrapper: {
|
|
@@ -252,7 +253,7 @@ export declare class BytesValue extends Message<BytesValue> {
|
|
|
252
253
|
constructor(data?: PartialMessage<BytesValue>);
|
|
253
254
|
toJson(options?: Partial<JsonWriteOptions>): JsonValue;
|
|
254
255
|
fromJson(json: JsonValue, options?: Partial<JsonReadOptions>): this;
|
|
255
|
-
static readonly runtime:
|
|
256
|
+
static readonly runtime: typeof proto3;
|
|
256
257
|
static readonly typeName = "google.protobuf.BytesValue";
|
|
257
258
|
static readonly fields: FieldList;
|
|
258
259
|
static readonly fieldWrapper: {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { proto3 } from "./proto3.js";
|
|
|
2
2
|
export { proto2 } from "./proto2.js";
|
|
3
3
|
export { protoInt64 } from "./proto-int64.js";
|
|
4
4
|
export { protoBase64 } from "./proto-base64.js";
|
|
5
|
+
export { protoDelimited } from "./proto-delimited.js";
|
|
5
6
|
export { codegenInfo } from "./codegen-info.js";
|
|
6
7
|
export { Message, AnyMessage, PartialMessage, PlainMessage, } from "./message.js";
|
|
7
8
|
export type { FieldInfo } from "./field.js";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { BinaryReadOptions, BinaryWriteOptions } from "./binary-format.js";
|
|
2
|
+
import type { Message } from "./message.js";
|
|
3
|
+
import type { MessageType } from "./message-type.js";
|
|
4
|
+
/**
|
|
5
|
+
* protoDelimited provides functions to serialize and parse size-delimited
|
|
6
|
+
* messages.
|
|
7
|
+
*
|
|
8
|
+
* A size-delimited message is a varint size in bytes, followed by exactly
|
|
9
|
+
* that many bytes of a message serialized with the binary format.
|
|
10
|
+
*
|
|
11
|
+
* This size-delimited format is compatible with other implementations.
|
|
12
|
+
* For details, see https://github.com/protocolbuffers/protobuf/issues/10229
|
|
13
|
+
*/
|
|
14
|
+
export declare const protoDelimited: {
|
|
15
|
+
/**
|
|
16
|
+
* Serialize a message, prefixing it with its size.
|
|
17
|
+
*/
|
|
18
|
+
enc(message: Message, options?: BinaryWriteOptions): Uint8Array;
|
|
19
|
+
/**
|
|
20
|
+
* Parse a size-delimited message, ignoring extra bytes.
|
|
21
|
+
*/
|
|
22
|
+
dec<T extends Message<T>>(type: MessageType<T>, bytes: Uint8Array, options?: BinaryReadOptions): T;
|
|
23
|
+
/**
|
|
24
|
+
* Parse a stream of size-delimited messages.
|
|
25
|
+
*/
|
|
26
|
+
decStream<T_1 extends Message<T_1>>(type: MessageType<T_1>, iterable: AsyncIterable<Uint8Array>): AsyncGenerator<T_1, void, unknown>;
|
|
27
|
+
/**
|
|
28
|
+
* Decodes the size from the given size-delimited message, which may be
|
|
29
|
+
* incomplete.
|
|
30
|
+
*
|
|
31
|
+
* Returns an object with the following properties:
|
|
32
|
+
* - size: The size of the delimited message in bytes
|
|
33
|
+
* - offset: The offset in the given byte array where the message starts
|
|
34
|
+
* - eof: true
|
|
35
|
+
*
|
|
36
|
+
* If the size-delimited data does not include all bytes of the varint size,
|
|
37
|
+
* the following object is returned:
|
|
38
|
+
* - size: null
|
|
39
|
+
* - offset: null
|
|
40
|
+
* - eof: false
|
|
41
|
+
*
|
|
42
|
+
* This function can be used to implement parsing of size-delimited messages
|
|
43
|
+
* from a stream.
|
|
44
|
+
*/
|
|
45
|
+
peekSize(data: Uint8Array): {
|
|
46
|
+
readonly eof: false;
|
|
47
|
+
readonly size: number;
|
|
48
|
+
readonly offset: number;
|
|
49
|
+
} | {
|
|
50
|
+
readonly eof: true;
|
|
51
|
+
readonly size: null;
|
|
52
|
+
readonly offset: null;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
@@ -21,8 +21,6 @@ export interface ServiceType {
|
|
|
21
21
|
* call. All methods provide the following properties:
|
|
22
22
|
*
|
|
23
23
|
* - "name": The original name of the protobuf rpc.
|
|
24
|
-
* - "localName": A variation of the name that follows the lowerCamelCase
|
|
25
|
-
* naming convention in ECMAScript.
|
|
26
24
|
* - "I": The input message type.
|
|
27
25
|
* - "O": The output message type.
|
|
28
26
|
* - "kind": The method type.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bufbuild/protobuf",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"license": "(Apache-2.0 AND BSD-3-Clause)",
|
|
5
5
|
"description": "A complete implementation of Protocol Buffers in TypeScript, suitable for web browsers and Node.js.",
|
|
6
6
|
"repository": {
|
|
@@ -24,6 +24,6 @@
|
|
|
24
24
|
"types": "./dist/types/index.d.ts"
|
|
25
25
|
},
|
|
26
26
|
"files": [
|
|
27
|
-
"dist
|
|
27
|
+
"dist/**"
|
|
28
28
|
]
|
|
29
29
|
}
|