@bufbuild/protobuf 1.3.1 → 1.3.3
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/google/protobuf/struct_pb.js +1 -1
- package/dist/cjs/google/protobuf/type_pb.js +1 -1
- package/dist/esm/binary-encoding.d.ts +421 -0
- package/dist/esm/binary-format.d.ts +87 -0
- package/dist/esm/codegen-info.d.ts +23 -0
- package/dist/esm/create-descriptor-set.d.ts +16 -0
- package/dist/esm/create-registry-from-desc.d.ts +15 -0
- package/dist/esm/create-registry.d.ts +8 -0
- package/dist/esm/descriptor-set.d.ts +606 -0
- package/dist/esm/enum.d.ts +35 -0
- package/dist/esm/field-list.d.ts +27 -0
- package/dist/esm/field.d.ts +255 -0
- package/dist/esm/google/protobuf/any_pb.d.ts +156 -0
- package/dist/esm/google/protobuf/api_pb.d.ts +256 -0
- package/dist/esm/google/protobuf/compiler/plugin_pb.d.ts +236 -0
- package/dist/esm/google/protobuf/descriptor_pb.d.ts +1851 -0
- package/dist/esm/google/protobuf/duration_pb.d.ts +100 -0
- package/dist/esm/google/protobuf/empty_pb.d.ts +28 -0
- package/dist/esm/google/protobuf/field_mask_pb.d.ts +227 -0
- package/dist/esm/google/protobuf/source_context_pb.d.ts +29 -0
- package/dist/esm/google/protobuf/struct_pb.d.ts +158 -0
- package/dist/esm/google/protobuf/struct_pb.js +1 -1
- package/dist/esm/google/protobuf/timestamp_pb.d.ts +132 -0
- package/dist/esm/google/protobuf/type_pb.d.ts +437 -0
- package/dist/esm/google/protobuf/type_pb.js +1 -1
- package/dist/esm/google/protobuf/wrappers_pb.d.ts +267 -0
- package/dist/esm/google/varint.d.ts +70 -0
- package/dist/esm/index.d.ts +38 -0
- package/dist/esm/json-format.d.ts +110 -0
- package/dist/esm/message-type.d.ts +51 -0
- package/dist/esm/message.d.ts +130 -0
- package/dist/esm/private/assert.d.ts +16 -0
- package/dist/esm/private/binary-format-common.d.ts +13 -0
- package/dist/esm/private/binary-format-proto2.d.ts +2 -0
- package/dist/esm/private/binary-format-proto3.d.ts +2 -0
- package/dist/esm/private/enum.d.ts +27 -0
- package/dist/esm/private/field-list.d.ts +18 -0
- package/dist/esm/private/field-wrapper.d.ts +25 -0
- package/dist/esm/private/field.d.ts +15 -0
- package/dist/esm/private/json-format-common.d.ts +9 -0
- package/dist/esm/private/json-format-proto2.d.ts +2 -0
- package/dist/esm/private/json-format-proto3.d.ts +2 -0
- package/dist/esm/private/message-type.d.ts +18 -0
- package/dist/esm/private/names.d.ts +43 -0
- package/dist/esm/private/options-map.d.ts +7 -0
- package/dist/esm/private/proto-runtime.d.ts +47 -0
- package/dist/esm/private/reify-wkt.d.ts +100 -0
- package/dist/esm/private/scalars.d.ts +27 -0
- package/dist/esm/private/util-common.d.ts +2 -0
- package/dist/esm/private/util.d.ts +38 -0
- package/dist/esm/proto-base64.d.ts +18 -0
- package/dist/esm/proto-delimited.d.ts +54 -0
- package/dist/esm/proto-double.d.ts +5 -0
- package/dist/esm/proto-int64.d.ts +95 -0
- package/dist/esm/proto2.d.ts +4 -0
- package/dist/esm/proto3.d.ts +4 -0
- package/dist/esm/service-type.d.ts +96 -0
- package/dist/esm/to-plain-message.d.ts +9 -0
- package/dist/esm/type-registry.d.ts +30 -0
- package/dist/proxy/index.d.ts +1 -0
- package/dist/proxy/index.js +1 -0
- package/package.json +14 -11
- /package/dist/{types → cjs}/binary-encoding.d.ts +0 -0
- /package/dist/{types → cjs}/binary-format.d.ts +0 -0
- /package/dist/{types → cjs}/codegen-info.d.ts +0 -0
- /package/dist/{types → cjs}/create-descriptor-set.d.ts +0 -0
- /package/dist/{types → cjs}/create-registry-from-desc.d.ts +0 -0
- /package/dist/{types → cjs}/create-registry.d.ts +0 -0
- /package/dist/{types → cjs}/descriptor-set.d.ts +0 -0
- /package/dist/{types → cjs}/enum.d.ts +0 -0
- /package/dist/{types → cjs}/field-list.d.ts +0 -0
- /package/dist/{types → cjs}/field.d.ts +0 -0
- /package/dist/{types → cjs}/google/protobuf/any_pb.d.ts +0 -0
- /package/dist/{types → cjs}/google/protobuf/api_pb.d.ts +0 -0
- /package/dist/{types → cjs}/google/protobuf/compiler/plugin_pb.d.ts +0 -0
- /package/dist/{types → cjs}/google/protobuf/descriptor_pb.d.ts +0 -0
- /package/dist/{types → cjs}/google/protobuf/duration_pb.d.ts +0 -0
- /package/dist/{types → cjs}/google/protobuf/empty_pb.d.ts +0 -0
- /package/dist/{types → cjs}/google/protobuf/field_mask_pb.d.ts +0 -0
- /package/dist/{types → cjs}/google/protobuf/source_context_pb.d.ts +0 -0
- /package/dist/{types → cjs}/google/protobuf/struct_pb.d.ts +0 -0
- /package/dist/{types → cjs}/google/protobuf/timestamp_pb.d.ts +0 -0
- /package/dist/{types → cjs}/google/protobuf/type_pb.d.ts +0 -0
- /package/dist/{types → cjs}/google/protobuf/wrappers_pb.d.ts +0 -0
- /package/dist/{types → cjs}/google/varint.d.ts +0 -0
- /package/dist/{types → cjs}/index.d.ts +0 -0
- /package/dist/{types → cjs}/json-format.d.ts +0 -0
- /package/dist/{types → cjs}/message-type.d.ts +0 -0
- /package/dist/{types → cjs}/message.d.ts +0 -0
- /package/dist/{types → cjs}/private/assert.d.ts +0 -0
- /package/dist/{types → cjs}/private/binary-format-common.d.ts +0 -0
- /package/dist/{types → cjs}/private/binary-format-proto2.d.ts +0 -0
- /package/dist/{types → cjs}/private/binary-format-proto3.d.ts +0 -0
- /package/dist/{types → cjs}/private/enum.d.ts +0 -0
- /package/dist/{types → cjs}/private/field-list.d.ts +0 -0
- /package/dist/{types → cjs}/private/field-wrapper.d.ts +0 -0
- /package/dist/{types → cjs}/private/field.d.ts +0 -0
- /package/dist/{types → cjs}/private/json-format-common.d.ts +0 -0
- /package/dist/{types → cjs}/private/json-format-proto2.d.ts +0 -0
- /package/dist/{types → cjs}/private/json-format-proto3.d.ts +0 -0
- /package/dist/{types → cjs}/private/message-type.d.ts +0 -0
- /package/dist/{types → cjs}/private/names.d.ts +0 -0
- /package/dist/{types → cjs}/private/options-map.d.ts +0 -0
- /package/dist/{types → cjs}/private/proto-runtime.d.ts +0 -0
- /package/dist/{types → cjs}/private/reify-wkt.d.ts +0 -0
- /package/dist/{types → cjs}/private/scalars.d.ts +0 -0
- /package/dist/{types → cjs}/private/util-common.d.ts +0 -0
- /package/dist/{types → cjs}/private/util.d.ts +0 -0
- /package/dist/{types → cjs}/proto-base64.d.ts +0 -0
- /package/dist/{types → cjs}/proto-delimited.d.ts +0 -0
- /package/dist/{types → cjs}/proto-double.d.ts +0 -0
- /package/dist/{types → cjs}/proto-int64.d.ts +0 -0
- /package/dist/{types → cjs}/proto2.d.ts +0 -0
- /package/dist/{types → cjs}/proto3.d.ts +0 -0
- /package/dist/{types → cjs}/service-type.d.ts +0 -0
- /package/dist/{types → cjs}/to-plain-message.d.ts +0 -0
- /package/dist/{types → cjs}/type-registry.d.ts +0 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { AnyMessage, Message } from "./message.js";
|
|
2
|
+
import type { MessageType } from "./message-type.js";
|
|
3
|
+
/**
|
|
4
|
+
* ServiceType represents a protobuf services. It provides metadata for
|
|
5
|
+
* reflection-based operations.
|
|
6
|
+
*/
|
|
7
|
+
export interface ServiceType {
|
|
8
|
+
/**
|
|
9
|
+
* The fully qualified name of the service.
|
|
10
|
+
*/
|
|
11
|
+
readonly typeName: string;
|
|
12
|
+
/**
|
|
13
|
+
* A map of local name (safe to use in ECMAScript) to method.
|
|
14
|
+
*/
|
|
15
|
+
readonly methods: {
|
|
16
|
+
[localName: string]: MethodInfo;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* MethodInfo represents a method of a protobuf service, a remote procedure
|
|
21
|
+
* call. All methods provide the following properties:
|
|
22
|
+
*
|
|
23
|
+
* - "name": The original name of the protobuf rpc.
|
|
24
|
+
* - "I": The input message type.
|
|
25
|
+
* - "O": The output message type.
|
|
26
|
+
* - "kind": The method type.
|
|
27
|
+
* - "idempotency": User-provided indication whether the method will cause
|
|
28
|
+
* the same effect every time it is called.
|
|
29
|
+
*/
|
|
30
|
+
export type MethodInfo<I extends Message<I> = AnyMessage, O extends Message<O> = AnyMessage> = MethodInfoUnary<I, O> | MethodInfoServerStreaming<I, O> | MethodInfoClientStreaming<I, O> | MethodInfoBiDiStreaming<I, O>;
|
|
31
|
+
/**
|
|
32
|
+
* A unary method: rpc (Input) returns (Output)
|
|
33
|
+
*/
|
|
34
|
+
export interface MethodInfoUnary<I extends Message<I>, O extends Message<O>> extends miShared<I, O> {
|
|
35
|
+
readonly kind: MethodKind.Unary;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A server streaming method: rpc (Input) returns (stream Output)
|
|
39
|
+
*/
|
|
40
|
+
export interface MethodInfoServerStreaming<I extends Message<I>, O extends Message<O>> extends miShared<I, O> {
|
|
41
|
+
readonly kind: MethodKind.ServerStreaming;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A client streaming method: rpc (stream Input) returns (Output)
|
|
45
|
+
*/
|
|
46
|
+
export interface MethodInfoClientStreaming<I extends Message<I>, O extends Message<O>> extends miShared<I, O> {
|
|
47
|
+
readonly kind: MethodKind.ClientStreaming;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* A method that streams bi-directionally: rpc (stream Input) returns (stream Output)
|
|
51
|
+
*/
|
|
52
|
+
export interface MethodInfoBiDiStreaming<I extends Message<I>, O extends Message<O>> extends miShared<I, O> {
|
|
53
|
+
readonly kind: MethodKind.BiDiStreaming;
|
|
54
|
+
}
|
|
55
|
+
interface miShared<I extends Message<I> = AnyMessage, O extends Message<O> = AnyMessage> {
|
|
56
|
+
readonly name: string;
|
|
57
|
+
readonly I: MessageType<I>;
|
|
58
|
+
readonly O: MessageType<O>;
|
|
59
|
+
readonly idempotency?: MethodIdempotency;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* MethodKind represents the four method types that can be declared in
|
|
63
|
+
* protobuf with the `stream` keyword:
|
|
64
|
+
*
|
|
65
|
+
* 1. Unary: rpc (Input) returns (Output)
|
|
66
|
+
* 2. ServerStreaming: rpc (Input) returns (stream Output)
|
|
67
|
+
* 3. ClientStreaming: rpc (stream Input) returns (Output)
|
|
68
|
+
* 4. BiDiStreaming: rpc (stream Input) returns (stream Output)
|
|
69
|
+
*/
|
|
70
|
+
export declare enum MethodKind {
|
|
71
|
+
Unary = 0,
|
|
72
|
+
ServerStreaming = 1,
|
|
73
|
+
ClientStreaming = 2,
|
|
74
|
+
BiDiStreaming = 3
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Is this method side-effect-free (or safe in HTTP parlance), or just
|
|
78
|
+
* idempotent, or neither? HTTP based RPC implementation may choose GET verb
|
|
79
|
+
* for safe methods, and PUT verb for idempotent methods instead of the
|
|
80
|
+
* default POST.
|
|
81
|
+
*
|
|
82
|
+
* This enum matches the protobuf enum google.protobuf.MethodOptions.IdempotencyLevel,
|
|
83
|
+
* defined in the well-known type google/protobuf/descriptor.proto, but
|
|
84
|
+
* drops UNKNOWN.
|
|
85
|
+
*/
|
|
86
|
+
export declare enum MethodIdempotency {
|
|
87
|
+
/**
|
|
88
|
+
* Idempotent, no side effects.
|
|
89
|
+
*/
|
|
90
|
+
NoSideEffects = 1,
|
|
91
|
+
/**
|
|
92
|
+
* Idempotent, but may have side effects.
|
|
93
|
+
*/
|
|
94
|
+
Idempotent = 2
|
|
95
|
+
}
|
|
96
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Message } from "./message.js";
|
|
2
|
+
import type { PlainMessage } from "./message.js";
|
|
3
|
+
/**
|
|
4
|
+
* toPlainMessage returns a new object by striping
|
|
5
|
+
* all methods from a message, leaving only fields and
|
|
6
|
+
* oneof groups. It is recursive, meaning it applies this
|
|
7
|
+
* same logic to all nested message fields as well.
|
|
8
|
+
*/
|
|
9
|
+
export declare function toPlainMessage<T extends Message<T>>(message: T): PlainMessage<T>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { MessageType } from "./message-type.js";
|
|
2
|
+
import type { EnumType } from "./enum.js";
|
|
3
|
+
import type { ServiceType } from "./service-type.js";
|
|
4
|
+
/**
|
|
5
|
+
* IMessageTypeRegistry provides look-up for message types.
|
|
6
|
+
*/
|
|
7
|
+
export interface IMessageTypeRegistry {
|
|
8
|
+
/**
|
|
9
|
+
* Find a message type by its protobuf type name.
|
|
10
|
+
*/
|
|
11
|
+
findMessage(typeName: string): MessageType | undefined;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* IEnumTypeRegistry provides look-up for enum types.
|
|
15
|
+
*/
|
|
16
|
+
export interface IEnumTypeRegistry {
|
|
17
|
+
/**
|
|
18
|
+
* Find an enum type by its protobuf type name.
|
|
19
|
+
*/
|
|
20
|
+
findEnum(typeName: string): EnumType | undefined;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* IServiceTypeRegistry provides look-up for service types.
|
|
24
|
+
*/
|
|
25
|
+
export interface IServiceTypeRegistry {
|
|
26
|
+
/**
|
|
27
|
+
* Find a service type by its protobuf type name.
|
|
28
|
+
*/
|
|
29
|
+
findService(typeName: string): ServiceType | undefined;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../cjs/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../cjs/index.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bufbuild/protobuf",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
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": {
|
|
@@ -8,20 +8,23 @@
|
|
|
8
8
|
"url": "https://github.com/bufbuild/protobuf-es.git",
|
|
9
9
|
"directory": "packages/protobuf"
|
|
10
10
|
},
|
|
11
|
-
"sideEffects": false,
|
|
12
11
|
"scripts": {
|
|
13
|
-
"clean": "rm -rf ./dist
|
|
14
|
-
"build": "npm run build:cjs && npm run build:esm
|
|
15
|
-
"build:cjs": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module commonjs --outDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
|
|
16
|
-
"build:esm
|
|
12
|
+
"clean": "rm -rf ./dist/*",
|
|
13
|
+
"build": "npm run build:cjs && npm run build:esm && npm run build:proxy",
|
|
14
|
+
"build:cjs": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module commonjs --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
|
|
15
|
+
"build:esm": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module ES2015 --verbatimModuleSyntax --outDir ./dist/esm --declaration --declarationDir ./dist/esm",
|
|
16
|
+
"build:proxy": "node ../../scripts/gen-esm-proxy.mjs .",
|
|
17
|
+
"attw": "attw --pack"
|
|
17
18
|
},
|
|
18
|
-
"main": "./dist/cjs/index.js",
|
|
19
19
|
"type": "module",
|
|
20
|
-
"
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"main": "./dist/cjs/index.js",
|
|
21
22
|
"exports": {
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
".": {
|
|
24
|
+
"module": "./dist/esm/index.js",
|
|
25
|
+
"require": "./dist/cjs/index.js",
|
|
26
|
+
"import": "./dist/proxy/index.js"
|
|
27
|
+
}
|
|
25
28
|
},
|
|
26
29
|
"files": [
|
|
27
30
|
"dist/**"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|