@aptre/protobuf-es-lite 0.5.1 → 0.5.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/README.md +1 -22
- package/dist/google/index.d.ts +9 -0
- package/dist/google/index.js +9 -0
- package/dist/google/protobuf/any.pb.d.ts +148 -0
- package/dist/google/protobuf/any.pb.js +120 -0
- package/dist/google/protobuf/api.pb.d.ts +232 -0
- package/dist/google/protobuf/api.pb.js +88 -0
- package/dist/google/protobuf/duration.pb.d.ts +93 -0
- package/dist/google/protobuf/duration.pb.js +89 -0
- package/dist/google/protobuf/empty.pb.d.ts +17 -0
- package/dist/google/protobuf/empty.pb.js +37 -0
- package/dist/google/protobuf/source_context.pb.d.ts +18 -0
- package/dist/google/protobuf/source_context.pb.js +39 -0
- package/dist/google/protobuf/struct.pb.d.ts +141 -0
- package/dist/google/protobuf/struct.pb.js +228 -0
- package/dist/google/protobuf/timestamp.pb.d.ts +125 -0
- package/dist/google/protobuf/timestamp.pb.js +137 -0
- package/dist/google/protobuf/type.pb.d.ts +401 -0
- package/dist/google/protobuf/type.pb.js +347 -0
- package/dist/google/protobuf/wrappers.pb.d.ts +201 -0
- package/dist/google/protobuf/wrappers.pb.js +365 -0
- package/dist/message.d.ts +1 -1
- package/dist/message.js +2 -0
- package/package.json +5 -5
- package/tsconfig.json +11 -1
package/README.md
CHANGED
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@aptre/protobuf-es-lite)
|
|
4
4
|
[](https://www.npmjs.com/package/@aptre/protobuf-es-lite)
|
|
5
|
-
[![DeepWiki
|
|
6
|
-
|
|
7
|
-
[DeepWiki Widget]: https://img.shields.io/badge/DeepWiki-aperturerobotics%2Fprotobuf--es--lite-blue.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAyCAYAAAAnWDnqAAAAAXNSR0IArs4c6QAAA05JREFUaEPtmUtyEzEQhtWTQyQLHNak2AB7ZnyXZMEjXMGeK/AIi+QuHrMnbChYY7MIh8g01fJoopFb0uhhEqqcbWTp06/uv1saEDv4O3n3dV60RfP947Mm9/SQc0ICFQgzfc4CYZoTPAswgSJCCUJUnAAoRHOAUOcATwbmVLWdGoH//PB8mnKqScAhsD0kYP3j/Yt5LPQe2KvcXmGvRHcDnpxfL2zOYJ1mFwrryWTz0advv1Ut4CJgf5uhDuDj5eUcAUoahrdY/56ebRWeraTjMt/00Sh3UDtjgHtQNHwcRGOC98BJEAEymycmYcWwOprTgcB6VZ5JK5TAJ+fXGLBm3FDAmn6oPPjR4rKCAoJCal2eAiQp2x0vxTPB3ALO2CRkwmDy5WohzBDwSEFKRwPbknEggCPB/imwrycgxX2NzoMCHhPkDwqYMr9tRcP5qNrMZHkVnOjRMWwLCcr8ohBVb1OMjxLwGCvjTikrsBOiA6fNyCrm8V1rP93iVPpwaE+gO0SsWmPiXB+jikdf6SizrT5qKasx5j8ABbHpFTx+vFXp9EnYQmLx02h1QTTrl6eDqxLnGjporxl3NL3agEvXdT0WmEost648sQOYAeJS9Q7bfUVoMGnjo4AZdUMQku50McDcMWcBPvr0SzbTAFDfvJqwLzgxwATnCgnp4wDl6Aa+Ax283gghmj+vj7feE2KBBRMW3FzOpLOADl0Isb5587h/U4gGvkt5v60Z1VLG8BhYjbzRwyQZemwAd6cCR5/XFWLYZRIMpX39AR0tjaGGiGzLVyhse5C9RKC6ai42ppWPKiBagOvaYk8lO7DajerabOZP46Lby5wKjw1HCRx7p9sVMOWGzb/vA1hwiWc6jm3MvQDTogQkiqIhJV0nBQBTU+3okKCFDy9WwferkHjtxib7t3xIUQtHxnIwtx4mpg26/HfwVNVDb4oI9RHmx5WGelRVlrtiw43zboCLaxv46AZeB3IlTkwouebTr1y2NjSpHz68WNFjHvupy3q8TFn3Hos2IAk4Ju5dCo8B3wP7VPr/FGaKiG+T+v+TQqIrOqMTL1VdWV1DdmcbO8KXBz6esmYWYKPwDL5b5FA1a0hwapHiom0r/cKaoqr+27/XcrS5UwSMbQAAAABJRU5ErkJggg==
|
|
8
|
-
[DeepWiki]: https://deepwiki.com/aperturerobotics/protobuf-es-lite
|
|
5
|
+
[](https://deepwiki.com/aperturerobotics/protobuf-es-lite)
|
|
9
6
|
|
|
10
7
|
protobuf-es-lite is a TypeScript and JavaScript protobuf implementation.
|
|
11
8
|
|
|
@@ -194,24 +191,6 @@ annotation shadows an underlying problem, for example an unresolvable import. To
|
|
|
194
191
|
remove the annotation and to enable type checks, set the plugin option
|
|
195
192
|
`ts_nocheck=false`.
|
|
196
193
|
|
|
197
|
-
## Developing on MacOS
|
|
198
|
-
|
|
199
|
-
On MacOS, some homebrew packages are required for `yarn gen`:
|
|
200
|
-
|
|
201
|
-
```
|
|
202
|
-
brew install bash make coreutils gnu-sed findutils protobuf
|
|
203
|
-
brew link --overwrite protobuf
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
Add to your .bashrc or .zshrc:
|
|
207
|
-
|
|
208
|
-
```
|
|
209
|
-
export PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH"
|
|
210
|
-
export PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH"
|
|
211
|
-
export PATH="/opt/homebrew/opt/findutils/libexec/gnubin:$PATH"
|
|
212
|
-
export PATH="/opt/homebrew/opt/make/libexec/gnubin:$PATH"
|
|
213
|
-
```
|
|
214
|
-
|
|
215
194
|
## Support
|
|
216
195
|
|
|
217
196
|
Please open a [GitHub issue] with any questions / issues.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { Type, Field, Field_Kind, Field_Cardinality, Enum, EnumValue, Option, Syntax, } from "./protobuf/type.pb.js";
|
|
2
|
+
export { Timestamp } from "./protobuf/timestamp.pb.js";
|
|
3
|
+
export { Duration } from "./protobuf/duration.pb.js";
|
|
4
|
+
export { Any } from "./protobuf/any.pb.js";
|
|
5
|
+
export { Empty } from "./protobuf/empty.pb.js";
|
|
6
|
+
export { DoubleValue, FloatValue, Int64Value, UInt64Value, Int32Value, UInt32Value, BoolValue, StringValue, BytesValue, } from "./protobuf/wrappers.pb.js";
|
|
7
|
+
export { Value, NullValue, ListValue, Struct } from "./protobuf/struct.pb.js";
|
|
8
|
+
export { Api, Method, Mixin } from "./protobuf/api.pb.js";
|
|
9
|
+
export { SourceContext } from "./protobuf/source_context.pb.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { Type, Field, Field_Kind, Field_Cardinality, Enum, EnumValue, Option, Syntax, } from "./protobuf/type.pb.js";
|
|
2
|
+
export { Timestamp } from "./protobuf/timestamp.pb.js";
|
|
3
|
+
export { Duration } from "./protobuf/duration.pb.js";
|
|
4
|
+
export { Any } from "./protobuf/any.pb.js";
|
|
5
|
+
export { Empty } from "./protobuf/empty.pb.js";
|
|
6
|
+
export { DoubleValue, FloatValue, Int64Value, UInt64Value, Int32Value, UInt32Value, BoolValue, StringValue, BytesValue, } from "./protobuf/wrappers.pb.js";
|
|
7
|
+
export { Value, NullValue, ListValue, Struct } from "./protobuf/struct.pb.js";
|
|
8
|
+
export { Api, Method, Mixin } from "./protobuf/api.pb.js";
|
|
9
|
+
export { SourceContext } from "./protobuf/source_context.pb.js";
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import type { IMessageTypeRegistry, JsonReadOptions, JsonValue, JsonWriteOptions, MessageType } from "../../index.js";
|
|
2
|
+
import { Message } from "../../index.js";
|
|
3
|
+
export declare const protobufPackage = "google.protobuf";
|
|
4
|
+
/**
|
|
5
|
+
* `Any` contains an arbitrary serialized protocol buffer message along with a
|
|
6
|
+
* URL that describes the type of the serialized message.
|
|
7
|
+
*
|
|
8
|
+
* Protobuf library provides support to pack/unpack Any values in the form
|
|
9
|
+
* of utility functions or additional generated methods of the Any type.
|
|
10
|
+
*
|
|
11
|
+
* Example 1: Pack and unpack a message in C++.
|
|
12
|
+
*
|
|
13
|
+
* Foo foo = ...;
|
|
14
|
+
* Any any;
|
|
15
|
+
* any.PackFrom(foo);
|
|
16
|
+
* ...
|
|
17
|
+
* if (any.UnpackTo(&foo)) {
|
|
18
|
+
* ...
|
|
19
|
+
* }
|
|
20
|
+
*
|
|
21
|
+
* Example 2: Pack and unpack a message in Java.
|
|
22
|
+
*
|
|
23
|
+
* Foo foo = ...;
|
|
24
|
+
* Any any = Any.pack(foo);
|
|
25
|
+
* ...
|
|
26
|
+
* if (any.is(Foo.class)) {
|
|
27
|
+
* foo = any.unpack(Foo.class);
|
|
28
|
+
* }
|
|
29
|
+
* // or ...
|
|
30
|
+
* if (any.isSameTypeAs(Foo.getDefaultInstance())) {
|
|
31
|
+
* foo = any.unpack(Foo.getDefaultInstance());
|
|
32
|
+
* }
|
|
33
|
+
*
|
|
34
|
+
* Example 3: Pack and unpack a message in Python.
|
|
35
|
+
*
|
|
36
|
+
* foo = Foo(...)
|
|
37
|
+
* any = Any()
|
|
38
|
+
* any.Pack(foo)
|
|
39
|
+
* ...
|
|
40
|
+
* if any.Is(Foo.DESCRIPTOR):
|
|
41
|
+
* any.Unpack(foo)
|
|
42
|
+
* ...
|
|
43
|
+
*
|
|
44
|
+
* Example 4: Pack and unpack a message in Go
|
|
45
|
+
*
|
|
46
|
+
* foo := &pb.Foo{...}
|
|
47
|
+
* any, err := anypb.New(foo)
|
|
48
|
+
* if err != nil {
|
|
49
|
+
* ...
|
|
50
|
+
* }
|
|
51
|
+
* ...
|
|
52
|
+
* foo := &pb.Foo{}
|
|
53
|
+
* if err := any.UnmarshalTo(foo); err != nil {
|
|
54
|
+
* ...
|
|
55
|
+
* }
|
|
56
|
+
*
|
|
57
|
+
* The pack methods provided by protobuf library will by default use
|
|
58
|
+
* 'type.googleapis.com/full.type.name' as the type URL and the unpack
|
|
59
|
+
* methods only use the fully qualified type name after the last '/'
|
|
60
|
+
* in the type URL, for example "foo.bar.com/x/y.z" will yield type
|
|
61
|
+
* name "y.z".
|
|
62
|
+
*
|
|
63
|
+
* JSON
|
|
64
|
+
* ====
|
|
65
|
+
* The JSON representation of an `Any` value uses the regular
|
|
66
|
+
* representation of the deserialized, embedded message, with an
|
|
67
|
+
* additional field `@type` which contains the type URL. Example:
|
|
68
|
+
*
|
|
69
|
+
* package google.profile;
|
|
70
|
+
* message Person {
|
|
71
|
+
* string first_name = 1;
|
|
72
|
+
* string last_name = 2;
|
|
73
|
+
* }
|
|
74
|
+
*
|
|
75
|
+
* {
|
|
76
|
+
* "@type": "type.googleapis.com/google.profile.Person",
|
|
77
|
+
* "firstName": <string>,
|
|
78
|
+
* "lastName": <string>
|
|
79
|
+
* }
|
|
80
|
+
*
|
|
81
|
+
* If the embedded message type is well-known and has a custom JSON
|
|
82
|
+
* representation, that representation will be embedded adding a field
|
|
83
|
+
* `value` which holds the custom JSON in addition to the `@type`
|
|
84
|
+
* field. Example (for message [google.protobuf.Duration][]):
|
|
85
|
+
*
|
|
86
|
+
* {
|
|
87
|
+
* "@type": "type.googleapis.com/google.protobuf.Duration",
|
|
88
|
+
* "value": "1.212s"
|
|
89
|
+
* }
|
|
90
|
+
*
|
|
91
|
+
*
|
|
92
|
+
* @generated from message google.protobuf.Any
|
|
93
|
+
*/
|
|
94
|
+
export interface Any {
|
|
95
|
+
/**
|
|
96
|
+
* A URL/resource name that uniquely identifies the type of the serialized
|
|
97
|
+
* protocol buffer message. This string must contain at least
|
|
98
|
+
* one "/" character. The last segment of the URL's path must represent
|
|
99
|
+
* the fully qualified name of the type (as in
|
|
100
|
+
* `path/google.protobuf.Duration`). The name should be in a canonical form
|
|
101
|
+
* (e.g., leading "." is not accepted).
|
|
102
|
+
*
|
|
103
|
+
* In practice, teams usually precompile into the binary all types that they
|
|
104
|
+
* expect it to use in the context of Any. However, for URLs which use the
|
|
105
|
+
* scheme `http`, `https`, or no scheme, one can optionally set up a type
|
|
106
|
+
* server that maps type URLs to message definitions as follows:
|
|
107
|
+
*
|
|
108
|
+
* * If no scheme is provided, `https` is assumed.
|
|
109
|
+
* * An HTTP GET on the URL must yield a [google.protobuf.Type][]
|
|
110
|
+
* value in binary format, or produce an error.
|
|
111
|
+
* * Applications are allowed to cache lookup results based on the
|
|
112
|
+
* URL, or have them precompiled into a binary to avoid any
|
|
113
|
+
* lookup. Therefore, binary compatibility needs to be preserved
|
|
114
|
+
* on changes to types. (Use versioned type names to manage
|
|
115
|
+
* breaking changes.)
|
|
116
|
+
*
|
|
117
|
+
* Note: this functionality is not currently available in the official
|
|
118
|
+
* protobuf release, and it is not used for type URLs beginning with
|
|
119
|
+
* type.googleapis.com. As of May 2023, there are no widely used type server
|
|
120
|
+
* implementations and no plans to implement one.
|
|
121
|
+
*
|
|
122
|
+
* Schemes other than `http`, `https` (or the empty scheme) might be
|
|
123
|
+
* used with implementation specific semantics.
|
|
124
|
+
*
|
|
125
|
+
*
|
|
126
|
+
* @generated from field: string type_url = 1;
|
|
127
|
+
*/
|
|
128
|
+
typeUrl?: string;
|
|
129
|
+
/**
|
|
130
|
+
* Must be a valid serialized protocol buffer of the above specified type.
|
|
131
|
+
*
|
|
132
|
+
* @generated from field: bytes value = 2;
|
|
133
|
+
*/
|
|
134
|
+
value?: Uint8Array;
|
|
135
|
+
}
|
|
136
|
+
declare const Any_Wkt: {
|
|
137
|
+
toJson(msg: Any, options?: Partial<JsonWriteOptions>): JsonValue;
|
|
138
|
+
fromJson(json: JsonValue, options?: Partial<JsonReadOptions>): Any;
|
|
139
|
+
packFrom<T extends Message<T>>(out: Any, message: Message<T>, messageType: MessageType<T>): void;
|
|
140
|
+
unpackTo<T extends Message<T>>(msg: Any, target: Message<T>, targetMessageType: MessageType<T>): boolean;
|
|
141
|
+
unpack<T extends Message<T>>(msg: Any, registry: IMessageTypeRegistry): {
|
|
142
|
+
message: Message<T>;
|
|
143
|
+
messageType: MessageType<T>;
|
|
144
|
+
} | undefined;
|
|
145
|
+
is(msg: Any, msgType: MessageType | string): boolean;
|
|
146
|
+
};
|
|
147
|
+
export declare const Any: MessageType<Any> & typeof Any_Wkt;
|
|
148
|
+
export {};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// Protocol Buffers - Google's data interchange format
|
|
2
|
+
// Copyright 2008 Google Inc. All rights reserved.
|
|
3
|
+
// https://developers.google.com/protocol-buffers/
|
|
4
|
+
//
|
|
5
|
+
// Redistribution and use in source and binary forms, with or without
|
|
6
|
+
// modification, are permitted provided that the following conditions are
|
|
7
|
+
// met:
|
|
8
|
+
//
|
|
9
|
+
// * Redistributions of source code must retain the above copyright
|
|
10
|
+
// notice, this list of conditions and the following disclaimer.
|
|
11
|
+
// * Redistributions in binary form must reproduce the above
|
|
12
|
+
// copyright notice, this list of conditions and the following disclaimer
|
|
13
|
+
// in the documentation and/or other materials provided with the
|
|
14
|
+
// distribution.
|
|
15
|
+
// * Neither the name of Google Inc. nor the names of its
|
|
16
|
+
// contributors may be used to endorse or promote products derived from
|
|
17
|
+
// this software without specific prior written permission.
|
|
18
|
+
//
|
|
19
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
20
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
21
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
22
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
23
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
24
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
25
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
26
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
27
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
28
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
30
|
+
import { applyPartialMessage, createMessageType, ScalarType, } from "../../index.js";
|
|
31
|
+
export const protobufPackage = "google.protobuf";
|
|
32
|
+
// Any_Wkt contains the well-known-type overrides for Any.
|
|
33
|
+
const Any_Wkt = {
|
|
34
|
+
toJson(msg, options) {
|
|
35
|
+
const typeName = msg?.typeUrl;
|
|
36
|
+
if (!typeName) {
|
|
37
|
+
return {};
|
|
38
|
+
}
|
|
39
|
+
const messageType = options?.typeRegistry?.findMessage(typeName);
|
|
40
|
+
if (!messageType) {
|
|
41
|
+
throw new Error(`cannot encode message google.protobuf.Any to JSON: "${typeName}" is not in the type registry`);
|
|
42
|
+
}
|
|
43
|
+
const message = messageType.fromBinary(msg.value);
|
|
44
|
+
let json = messageType.toJson(message, options);
|
|
45
|
+
if (typeName.startsWith("google.protobuf.") ||
|
|
46
|
+
json === null ||
|
|
47
|
+
Array.isArray(json) ||
|
|
48
|
+
typeof json !== "object") {
|
|
49
|
+
json = { value: json };
|
|
50
|
+
}
|
|
51
|
+
json["@type"] = typeName;
|
|
52
|
+
return json;
|
|
53
|
+
},
|
|
54
|
+
fromJson(json, options) {
|
|
55
|
+
if (json === null || Array.isArray(json) || typeof json != "object") {
|
|
56
|
+
throw new Error(`cannot decode message google.protobuf.Any from JSON: expected object but got ${json === null ? "null"
|
|
57
|
+
: Array.isArray(json) ? "array"
|
|
58
|
+
: typeof json}`);
|
|
59
|
+
}
|
|
60
|
+
if (Object.keys(json).length == 0) {
|
|
61
|
+
return {};
|
|
62
|
+
}
|
|
63
|
+
const typeUrl = json["@type"];
|
|
64
|
+
if (typeof typeUrl != "string" || typeUrl == "") {
|
|
65
|
+
throw new Error(`cannot decode message google.protobuf.Any from JSON: "@type" is empty`);
|
|
66
|
+
}
|
|
67
|
+
const typeName = typeUrl, messageType = options?.typeRegistry?.findMessage(typeName);
|
|
68
|
+
if (!messageType) {
|
|
69
|
+
throw new Error(`cannot decode message google.protobuf.Any from JSON: ${typeUrl} is not in the type registry`);
|
|
70
|
+
}
|
|
71
|
+
let message;
|
|
72
|
+
if (typeName.startsWith("google.protobuf.") &&
|
|
73
|
+
Object.prototype.hasOwnProperty.call(json, "value")) {
|
|
74
|
+
message = messageType.fromJson(json["value"], options);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
const copy = Object.assign({}, json);
|
|
78
|
+
delete copy["@type"];
|
|
79
|
+
message = messageType.fromJson(copy, options);
|
|
80
|
+
}
|
|
81
|
+
const out = {};
|
|
82
|
+
Any.packFrom(out, message, messageType);
|
|
83
|
+
return out;
|
|
84
|
+
},
|
|
85
|
+
packFrom(out, message, messageType) {
|
|
86
|
+
out.value = messageType.toBinary(message);
|
|
87
|
+
out.typeUrl = messageType.typeName;
|
|
88
|
+
},
|
|
89
|
+
unpackTo(msg, target, targetMessageType) {
|
|
90
|
+
if (!Any.is(msg, targetMessageType)) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
const partial = targetMessageType.fromBinary(msg.value);
|
|
94
|
+
applyPartialMessage(partial, target, targetMessageType.fields);
|
|
95
|
+
return true;
|
|
96
|
+
},
|
|
97
|
+
unpack(msg, registry) {
|
|
98
|
+
const typeUrl = msg.typeUrl;
|
|
99
|
+
const messageType = !!typeUrl && registry.findMessage(typeUrl);
|
|
100
|
+
return messageType ?
|
|
101
|
+
{ message: messageType.fromBinary(msg.value), messageType }
|
|
102
|
+
: undefined;
|
|
103
|
+
},
|
|
104
|
+
is(msg, msgType) {
|
|
105
|
+
const name = msg.typeUrl;
|
|
106
|
+
return (!!name &&
|
|
107
|
+
(typeof msgType === "string" ?
|
|
108
|
+
name === msgType
|
|
109
|
+
: name === msgType.typeName));
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
// Any contains the message type declaration for Any.
|
|
113
|
+
export const Any = createMessageType({
|
|
114
|
+
typeName: "google.protobuf.Any",
|
|
115
|
+
fields: [
|
|
116
|
+
{ no: 1, name: "type_url", kind: "scalar", T: ScalarType.STRING },
|
|
117
|
+
{ no: 2, name: "value", kind: "scalar", T: ScalarType.BYTES },
|
|
118
|
+
],
|
|
119
|
+
packedByDefault: true,
|
|
120
|
+
}, Any_Wkt);
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import type { Syntax } from "./type.pb.js";
|
|
2
|
+
import { Option } from "./type.pb.js";
|
|
3
|
+
import type { MessageType } from "../../index.js";
|
|
4
|
+
import { SourceContext } from "./source_context.pb.js";
|
|
5
|
+
export declare const protobufPackage = "google.protobuf";
|
|
6
|
+
/**
|
|
7
|
+
* Method represents a method of an API interface.
|
|
8
|
+
*
|
|
9
|
+
* @generated from message google.protobuf.Method
|
|
10
|
+
*/
|
|
11
|
+
export interface Method {
|
|
12
|
+
/**
|
|
13
|
+
* The simple name of this method.
|
|
14
|
+
*
|
|
15
|
+
* @generated from field: string name = 1;
|
|
16
|
+
*/
|
|
17
|
+
name?: string;
|
|
18
|
+
/**
|
|
19
|
+
* A URL of the input message type.
|
|
20
|
+
*
|
|
21
|
+
* @generated from field: string request_type_url = 2;
|
|
22
|
+
*/
|
|
23
|
+
requestTypeUrl?: string;
|
|
24
|
+
/**
|
|
25
|
+
* If true, the request is streamed.
|
|
26
|
+
*
|
|
27
|
+
* @generated from field: bool request_streaming = 3;
|
|
28
|
+
*/
|
|
29
|
+
requestStreaming?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The URL of the output message type.
|
|
32
|
+
*
|
|
33
|
+
* @generated from field: string response_type_url = 4;
|
|
34
|
+
*/
|
|
35
|
+
responseTypeUrl?: string;
|
|
36
|
+
/**
|
|
37
|
+
* If true, the response is streamed.
|
|
38
|
+
*
|
|
39
|
+
* @generated from field: bool response_streaming = 5;
|
|
40
|
+
*/
|
|
41
|
+
responseStreaming?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Any metadata attached to the method.
|
|
44
|
+
*
|
|
45
|
+
* @generated from field: repeated google.protobuf.Option options = 6;
|
|
46
|
+
*/
|
|
47
|
+
options?: Option[];
|
|
48
|
+
/**
|
|
49
|
+
* The source syntax of this method.
|
|
50
|
+
*
|
|
51
|
+
* @generated from field: google.protobuf.Syntax syntax = 7;
|
|
52
|
+
*/
|
|
53
|
+
syntax?: Syntax;
|
|
54
|
+
}
|
|
55
|
+
export declare const Method: MessageType<Method>;
|
|
56
|
+
/**
|
|
57
|
+
* Declares an API Interface to be included in this interface. The including
|
|
58
|
+
* interface must redeclare all the methods from the included interface, but
|
|
59
|
+
* documentation and options are inherited as follows:
|
|
60
|
+
*
|
|
61
|
+
* - If after comment and whitespace stripping, the documentation
|
|
62
|
+
* string of the redeclared method is empty, it will be inherited
|
|
63
|
+
* from the original method.
|
|
64
|
+
*
|
|
65
|
+
* - Each annotation belonging to the service config (http,
|
|
66
|
+
* visibility) which is not set in the redeclared method will be
|
|
67
|
+
* inherited.
|
|
68
|
+
*
|
|
69
|
+
* - If an http annotation is inherited, the path pattern will be
|
|
70
|
+
* modified as follows. Any version prefix will be replaced by the
|
|
71
|
+
* version of the including interface plus the [root][] path if
|
|
72
|
+
* specified.
|
|
73
|
+
*
|
|
74
|
+
* Example of a simple mixin:
|
|
75
|
+
*
|
|
76
|
+
* package google.acl.v1;
|
|
77
|
+
* service AccessControl {
|
|
78
|
+
* // Get the underlying ACL object.
|
|
79
|
+
* rpc GetAcl(GetAclRequest) returns (Acl) {
|
|
80
|
+
* option (google.api.http).get = "/v1/{resource=**}:getAcl";
|
|
81
|
+
* }
|
|
82
|
+
* }
|
|
83
|
+
*
|
|
84
|
+
* package google.storage.v2;
|
|
85
|
+
* service Storage {
|
|
86
|
+
* rpc GetAcl(GetAclRequest) returns (Acl);
|
|
87
|
+
*
|
|
88
|
+
* // Get a data record.
|
|
89
|
+
* rpc GetData(GetDataRequest) returns (Data) {
|
|
90
|
+
* option (google.api.http).get = "/v2/{resource=**}";
|
|
91
|
+
* }
|
|
92
|
+
* }
|
|
93
|
+
*
|
|
94
|
+
* Example of a mixin configuration:
|
|
95
|
+
*
|
|
96
|
+
* apis:
|
|
97
|
+
* - name: google.storage.v2.Storage
|
|
98
|
+
* mixins:
|
|
99
|
+
* - name: google.acl.v1.AccessControl
|
|
100
|
+
*
|
|
101
|
+
* The mixin construct implies that all methods in `AccessControl` are
|
|
102
|
+
* also declared with same name and request/response types in
|
|
103
|
+
* `Storage`. A documentation generator or annotation processor will
|
|
104
|
+
* see the effective `Storage.GetAcl` method after inherting
|
|
105
|
+
* documentation and annotations as follows:
|
|
106
|
+
*
|
|
107
|
+
* service Storage {
|
|
108
|
+
* // Get the underlying ACL object.
|
|
109
|
+
* rpc GetAcl(GetAclRequest) returns (Acl) {
|
|
110
|
+
* option (google.api.http).get = "/v2/{resource=**}:getAcl";
|
|
111
|
+
* }
|
|
112
|
+
* ...
|
|
113
|
+
* }
|
|
114
|
+
*
|
|
115
|
+
* Note how the version in the path pattern changed from `v1` to `v2`.
|
|
116
|
+
*
|
|
117
|
+
* If the `root` field in the mixin is specified, it should be a
|
|
118
|
+
* relative path under which inherited HTTP paths are placed. Example:
|
|
119
|
+
*
|
|
120
|
+
* apis:
|
|
121
|
+
* - name: google.storage.v2.Storage
|
|
122
|
+
* mixins:
|
|
123
|
+
* - name: google.acl.v1.AccessControl
|
|
124
|
+
* root: acls
|
|
125
|
+
*
|
|
126
|
+
* This implies the following inherited HTTP annotation:
|
|
127
|
+
*
|
|
128
|
+
* service Storage {
|
|
129
|
+
* // Get the underlying ACL object.
|
|
130
|
+
* rpc GetAcl(GetAclRequest) returns (Acl) {
|
|
131
|
+
* option (google.api.http).get = "/v2/acls/{resource=**}:getAcl";
|
|
132
|
+
* }
|
|
133
|
+
* ...
|
|
134
|
+
* }
|
|
135
|
+
*
|
|
136
|
+
* @generated from message google.protobuf.Mixin
|
|
137
|
+
*/
|
|
138
|
+
export interface Mixin {
|
|
139
|
+
/**
|
|
140
|
+
* The fully qualified name of the interface which is included.
|
|
141
|
+
*
|
|
142
|
+
* @generated from field: string name = 1;
|
|
143
|
+
*/
|
|
144
|
+
name?: string;
|
|
145
|
+
/**
|
|
146
|
+
* If non-empty specifies a path under which inherited HTTP paths
|
|
147
|
+
* are rooted.
|
|
148
|
+
*
|
|
149
|
+
* @generated from field: string root = 2;
|
|
150
|
+
*/
|
|
151
|
+
root?: string;
|
|
152
|
+
}
|
|
153
|
+
export declare const Mixin: MessageType<Mixin>;
|
|
154
|
+
/**
|
|
155
|
+
* Api is a light-weight descriptor for an API Interface.
|
|
156
|
+
*
|
|
157
|
+
* Interfaces are also described as "protocol buffer services" in some contexts,
|
|
158
|
+
* such as by the "service" keyword in a .proto file, but they are different
|
|
159
|
+
* from API Services, which represent a concrete implementation of an interface
|
|
160
|
+
* as opposed to simply a description of methods and bindings. They are also
|
|
161
|
+
* sometimes simply referred to as "APIs" in other contexts, such as the name of
|
|
162
|
+
* this message itself. See https://cloud.google.com/apis/design/glossary for
|
|
163
|
+
* detailed terminology.
|
|
164
|
+
*
|
|
165
|
+
* @generated from message google.protobuf.Api
|
|
166
|
+
*/
|
|
167
|
+
export interface Api {
|
|
168
|
+
/**
|
|
169
|
+
* The fully qualified name of this interface, including package name
|
|
170
|
+
* followed by the interface's simple name.
|
|
171
|
+
*
|
|
172
|
+
* @generated from field: string name = 1;
|
|
173
|
+
*/
|
|
174
|
+
name?: string;
|
|
175
|
+
/**
|
|
176
|
+
* The methods of this interface, in unspecified order.
|
|
177
|
+
*
|
|
178
|
+
* @generated from field: repeated google.protobuf.Method methods = 2;
|
|
179
|
+
*/
|
|
180
|
+
methods?: Method[];
|
|
181
|
+
/**
|
|
182
|
+
* Any metadata attached to the interface.
|
|
183
|
+
*
|
|
184
|
+
* @generated from field: repeated google.protobuf.Option options = 3;
|
|
185
|
+
*/
|
|
186
|
+
options?: Option[];
|
|
187
|
+
/**
|
|
188
|
+
* A version string for this interface. If specified, must have the form
|
|
189
|
+
* `major-version.minor-version`, as in `1.10`. If the minor version is
|
|
190
|
+
* omitted, it defaults to zero. If the entire version field is empty, the
|
|
191
|
+
* major version is derived from the package name, as outlined below. If the
|
|
192
|
+
* field is not empty, the version in the package name will be verified to be
|
|
193
|
+
* consistent with what is provided here.
|
|
194
|
+
*
|
|
195
|
+
* The versioning schema uses [semantic
|
|
196
|
+
* versioning](http://semver.org) where the major version number
|
|
197
|
+
* indicates a breaking change and the minor version an additive,
|
|
198
|
+
* non-breaking change. Both version numbers are signals to users
|
|
199
|
+
* what to expect from different versions, and should be carefully
|
|
200
|
+
* chosen based on the product plan.
|
|
201
|
+
*
|
|
202
|
+
* The major version is also reflected in the package name of the
|
|
203
|
+
* interface, which must end in `v<major-version>`, as in
|
|
204
|
+
* `google.feature.v1`. For major versions 0 and 1, the suffix can
|
|
205
|
+
* be omitted. Zero major versions must only be used for
|
|
206
|
+
* experimental, non-GA interfaces.
|
|
207
|
+
*
|
|
208
|
+
*
|
|
209
|
+
* @generated from field: string version = 4;
|
|
210
|
+
*/
|
|
211
|
+
version?: string;
|
|
212
|
+
/**
|
|
213
|
+
* Source context for the protocol buffer service represented by this
|
|
214
|
+
* message.
|
|
215
|
+
*
|
|
216
|
+
* @generated from field: google.protobuf.SourceContext source_context = 5;
|
|
217
|
+
*/
|
|
218
|
+
sourceContext?: SourceContext;
|
|
219
|
+
/**
|
|
220
|
+
* Included interfaces. See [Mixin][].
|
|
221
|
+
*
|
|
222
|
+
* @generated from field: repeated google.protobuf.Mixin mixins = 6;
|
|
223
|
+
*/
|
|
224
|
+
mixins?: Mixin[];
|
|
225
|
+
/**
|
|
226
|
+
* The source syntax of the service.
|
|
227
|
+
*
|
|
228
|
+
* @generated from field: google.protobuf.Syntax syntax = 7;
|
|
229
|
+
*/
|
|
230
|
+
syntax?: Syntax;
|
|
231
|
+
}
|
|
232
|
+
export declare const Api: MessageType<Api>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// Protocol Buffers - Google's data interchange format
|
|
2
|
+
// Copyright 2008 Google Inc. All rights reserved.
|
|
3
|
+
// https://developers.google.com/protocol-buffers/
|
|
4
|
+
//
|
|
5
|
+
// Redistribution and use in source and binary forms, with or without
|
|
6
|
+
// modification, are permitted provided that the following conditions are
|
|
7
|
+
// met:
|
|
8
|
+
//
|
|
9
|
+
// * Redistributions of source code must retain the above copyright
|
|
10
|
+
// notice, this list of conditions and the following disclaimer.
|
|
11
|
+
// * Redistributions in binary form must reproduce the above
|
|
12
|
+
// copyright notice, this list of conditions and the following disclaimer
|
|
13
|
+
// in the documentation and/or other materials provided with the
|
|
14
|
+
// distribution.
|
|
15
|
+
// * Neither the name of Google Inc. nor the names of its
|
|
16
|
+
// contributors may be used to endorse or promote products derived from
|
|
17
|
+
// this software without specific prior written permission.
|
|
18
|
+
//
|
|
19
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
20
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
21
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
22
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
23
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
24
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
25
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
26
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
27
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
28
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
30
|
+
import { Option, Syntax_Enum } from "./type.pb.js";
|
|
31
|
+
import { createMessageType, ScalarType } from "../../index.js";
|
|
32
|
+
import { SourceContext } from "./source_context.pb.js";
|
|
33
|
+
export const protobufPackage = "google.protobuf";
|
|
34
|
+
// Method contains the message type declaration for Method.
|
|
35
|
+
export const Method = createMessageType({
|
|
36
|
+
typeName: "google.protobuf.Method",
|
|
37
|
+
fields: [
|
|
38
|
+
{ no: 1, name: "name", kind: "scalar", T: ScalarType.STRING },
|
|
39
|
+
{ no: 2, name: "request_type_url", kind: "scalar", T: ScalarType.STRING },
|
|
40
|
+
{ no: 3, name: "request_streaming", kind: "scalar", T: ScalarType.BOOL },
|
|
41
|
+
{ no: 4, name: "response_type_url", kind: "scalar", T: ScalarType.STRING },
|
|
42
|
+
{ no: 5, name: "response_streaming", kind: "scalar", T: ScalarType.BOOL },
|
|
43
|
+
{
|
|
44
|
+
no: 6,
|
|
45
|
+
name: "options",
|
|
46
|
+
kind: "message",
|
|
47
|
+
T: () => Option,
|
|
48
|
+
repeated: true,
|
|
49
|
+
},
|
|
50
|
+
{ no: 7, name: "syntax", kind: "enum", T: Syntax_Enum },
|
|
51
|
+
],
|
|
52
|
+
packedByDefault: true,
|
|
53
|
+
});
|
|
54
|
+
// Mixin contains the message type declaration for Mixin.
|
|
55
|
+
export const Mixin = createMessageType({
|
|
56
|
+
typeName: "google.protobuf.Mixin",
|
|
57
|
+
fields: [
|
|
58
|
+
{ no: 1, name: "name", kind: "scalar", T: ScalarType.STRING },
|
|
59
|
+
{ no: 2, name: "root", kind: "scalar", T: ScalarType.STRING },
|
|
60
|
+
],
|
|
61
|
+
packedByDefault: true,
|
|
62
|
+
});
|
|
63
|
+
// Api contains the message type declaration for Api.
|
|
64
|
+
export const Api = createMessageType({
|
|
65
|
+
typeName: "google.protobuf.Api",
|
|
66
|
+
fields: [
|
|
67
|
+
{ no: 1, name: "name", kind: "scalar", T: ScalarType.STRING },
|
|
68
|
+
{
|
|
69
|
+
no: 2,
|
|
70
|
+
name: "methods",
|
|
71
|
+
kind: "message",
|
|
72
|
+
T: () => Method,
|
|
73
|
+
repeated: true,
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
no: 3,
|
|
77
|
+
name: "options",
|
|
78
|
+
kind: "message",
|
|
79
|
+
T: () => Option,
|
|
80
|
+
repeated: true,
|
|
81
|
+
},
|
|
82
|
+
{ no: 4, name: "version", kind: "scalar", T: ScalarType.STRING },
|
|
83
|
+
{ no: 5, name: "source_context", kind: "message", T: () => SourceContext },
|
|
84
|
+
{ no: 6, name: "mixins", kind: "message", T: () => Mixin, repeated: true },
|
|
85
|
+
{ no: 7, name: "syntax", kind: "enum", T: Syntax_Enum },
|
|
86
|
+
],
|
|
87
|
+
packedByDefault: true,
|
|
88
|
+
});
|