blue-js-sdk 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +446 -0
- package/LICENSE +21 -0
- package/README.md +75 -0
- package/ai-path/ADMIN-ELEVATION.md +116 -0
- package/ai-path/AI-MANIFESTO.md +185 -0
- package/ai-path/BREAKING.md +74 -0
- package/ai-path/CHECKLIST.md +619 -0
- package/ai-path/CONNECTION-STEPS.md +724 -0
- package/ai-path/DECISION-TREE.md +378 -0
- package/ai-path/DEPENDENCIES.md +459 -0
- package/ai-path/E2E-FLOW.md +1555 -0
- package/ai-path/FAILURES.md +403 -0
- package/ai-path/GUIDE.md +1217 -0
- package/ai-path/README.md +558 -0
- package/ai-path/SPLIT-TUNNEL.md +266 -0
- package/ai-path/cli.js +535 -0
- package/ai-path/connect.js +884 -0
- package/ai-path/discover.js +178 -0
- package/ai-path/environment.js +266 -0
- package/ai-path/errors.js +86 -0
- package/ai-path/examples/autonomous-agent.mjs +220 -0
- package/ai-path/examples/multi-region.mjs +174 -0
- package/ai-path/examples/one-shot.mjs +31 -0
- package/ai-path/index.js +60 -0
- package/ai-path/pricing.js +136 -0
- package/ai-path/recommend.js +413 -0
- package/ai-path/run-admin.vbs +25 -0
- package/ai-path/setup.js +291 -0
- package/ai-path/wallet.js +137 -0
- package/app-helpers.js +363 -0
- package/app-settings.js +95 -0
- package/app-types.js +267 -0
- package/audit.js +847 -0
- package/batch.js +293 -0
- package/bin/setup.js +376 -0
- package/chain/authz.js +109 -0
- package/chain/broadcast.js +472 -0
- package/chain/client.js +160 -0
- package/chain/fee-grants.js +305 -0
- package/chain/index.js +891 -0
- package/chain/lcd.js +313 -0
- package/chain/queries.js +547 -0
- package/chain/rpc.js +408 -0
- package/chain/wallet.js +141 -0
- package/cli/config.js +143 -0
- package/cli/index.js +463 -0
- package/cli/output.js +182 -0
- package/cli.js +491 -0
- package/client/index.js +251 -0
- package/client.js +271 -0
- package/config/index.js +255 -0
- package/connection/connect.js +849 -0
- package/connection/disconnect.js +180 -0
- package/connection/discovery.js +321 -0
- package/connection/index.js +76 -0
- package/connection/proxy.js +148 -0
- package/connection/resilience.js +428 -0
- package/connection/security.js +232 -0
- package/connection/state.js +369 -0
- package/connection/tunnel.js +691 -0
- package/consumer.js +132 -0
- package/cosmjs-setup.js +1884 -0
- package/defaults.js +366 -0
- package/disk-cache.js +107 -0
- package/dist/client.d.ts +108 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +400 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/errors/index.js +112 -0
- package/errors.js +218 -0
- package/examples/README.md +64 -0
- package/examples/connect-direct.mjs +106 -0
- package/examples/connect-plan.mjs +125 -0
- package/examples/error-handling.mjs +109 -0
- package/examples/query-nodes.mjs +94 -0
- package/examples/wallet-basics.mjs +61 -0
- package/generated/amino/amino.ts +9 -0
- package/generated/cosmos/base/v1beta1/coin.ts +365 -0
- package/generated/cosmos_proto/cosmos.ts +323 -0
- package/generated/gogoproto/gogo.ts +9 -0
- package/generated/google/protobuf/descriptor.ts +7601 -0
- package/generated/google/protobuf/duration.ts +208 -0
- package/generated/google/protobuf/timestamp.ts +238 -0
- package/generated/sentinel/lease/v1/events.ts +924 -0
- package/generated/sentinel/lease/v1/lease.ts +292 -0
- package/generated/sentinel/lease/v1/msg.ts +949 -0
- package/generated/sentinel/lease/v1/params.ts +164 -0
- package/generated/sentinel/node/v3/events.ts +881 -0
- package/generated/sentinel/node/v3/msg.ts +1002 -0
- package/generated/sentinel/node/v3/node.ts +263 -0
- package/generated/sentinel/node/v3/params.ts +183 -0
- package/generated/sentinel/plan/v3/events.ts +675 -0
- package/generated/sentinel/plan/v3/msg.ts +1191 -0
- package/generated/sentinel/plan/v3/plan.ts +283 -0
- package/generated/sentinel/provider/v2/events.ts +171 -0
- package/generated/sentinel/provider/v2/msg.ts +480 -0
- package/generated/sentinel/provider/v2/params.ts +131 -0
- package/generated/sentinel/provider/v2/provider.ts +246 -0
- package/generated/sentinel/session/v3/events.ts +480 -0
- package/generated/sentinel/session/v3/msg.ts +616 -0
- package/generated/sentinel/session/v3/params.ts +260 -0
- package/generated/sentinel/session/v3/proof.ts +180 -0
- package/generated/sentinel/session/v3/session.ts +384 -0
- package/generated/sentinel/subscription/v3/events.ts +1181 -0
- package/generated/sentinel/subscription/v3/msg.ts +1305 -0
- package/generated/sentinel/subscription/v3/params.ts +167 -0
- package/generated/sentinel/subscription/v3/subscription.ts +315 -0
- package/generated/sentinel/types/v1/bandwidth.ts +124 -0
- package/generated/sentinel/types/v1/price.ts +149 -0
- package/generated/sentinel/types/v1/renewal.ts +87 -0
- package/generated/sentinel/types/v1/status.ts +54 -0
- package/generated/typeRegistry.ts +27 -0
- package/index.js +486 -0
- package/node-connect.js +3015 -0
- package/operator.js +134 -0
- package/package.json +113 -0
- package/plan-operations.js +199 -0
- package/preflight.js +352 -0
- package/pricing/index.js +262 -0
- package/proto/amino/amino.proto +84 -0
- package/proto/cosmos/base/v1beta1/coin.proto +61 -0
- package/proto/cosmos_proto/cosmos.proto +112 -0
- package/proto/gogoproto/gogo.proto +145 -0
- package/proto/google/api/annotations.proto +31 -0
- package/proto/google/api/http.proto +370 -0
- package/proto/google/protobuf/any.proto +106 -0
- package/proto/google/protobuf/duration.proto +115 -0
- package/proto/google/protobuf/timestamp.proto +145 -0
- package/proto/sentinel/lease/v1/events.proto +52 -0
- package/proto/sentinel/lease/v1/genesis.proto +15 -0
- package/proto/sentinel/lease/v1/lease.proto +25 -0
- package/proto/sentinel/lease/v1/msg.proto +62 -0
- package/proto/sentinel/lease/v1/params.proto +17 -0
- package/proto/sentinel/node/v3/events.proto +50 -0
- package/proto/sentinel/node/v3/genesis.proto +15 -0
- package/proto/sentinel/node/v3/msg.proto +63 -0
- package/proto/sentinel/node/v3/node.proto +27 -0
- package/proto/sentinel/node/v3/params.proto +21 -0
- package/proto/sentinel/node/v3/querier.proto +63 -0
- package/proto/sentinel/plan/v3/events.proto +41 -0
- package/proto/sentinel/plan/v3/genesis.proto +21 -0
- package/proto/sentinel/plan/v3/msg.proto +83 -0
- package/proto/sentinel/plan/v3/plan.proto +32 -0
- package/proto/sentinel/plan/v3/querier.proto +53 -0
- package/proto/sentinel/provider/v2/events.proto +16 -0
- package/proto/sentinel/provider/v2/genesis.proto +15 -0
- package/proto/sentinel/provider/v2/msg.proto +35 -0
- package/proto/sentinel/provider/v2/params.proto +17 -0
- package/proto/sentinel/provider/v2/provider.proto +24 -0
- package/proto/sentinel/provider/v3/genesis.proto +15 -0
- package/proto/sentinel/provider/v3/params.proto +13 -0
- package/proto/sentinel/session/v3/events.proto +30 -0
- package/proto/sentinel/session/v3/genesis.proto +15 -0
- package/proto/sentinel/session/v3/msg.proto +50 -0
- package/proto/sentinel/session/v3/params.proto +25 -0
- package/proto/sentinel/session/v3/proof.proto +25 -0
- package/proto/sentinel/session/v3/querier.proto +100 -0
- package/proto/sentinel/session/v3/session.proto +50 -0
- package/proto/sentinel/subscription/v2/allocation.proto +21 -0
- package/proto/sentinel/subscription/v2/payout.proto +22 -0
- package/proto/sentinel/subscription/v3/events.proto +65 -0
- package/proto/sentinel/subscription/v3/genesis.proto +17 -0
- package/proto/sentinel/subscription/v3/msg.proto +83 -0
- package/proto/sentinel/subscription/v3/params.proto +21 -0
- package/proto/sentinel/subscription/v3/subscription.proto +33 -0
- package/proto/sentinel/types/v1/bandwidth.proto +19 -0
- package/proto/sentinel/types/v1/price.proto +21 -0
- package/proto/sentinel/types/v1/renewal.proto +21 -0
- package/proto/sentinel/types/v1/status.proto +16 -0
- package/protocol/encoding.js +341 -0
- package/protocol/events.js +361 -0
- package/protocol/handshake.js +297 -0
- package/protocol/index.js +15 -0
- package/protocol/messages.js +346 -0
- package/protocol/plans.js +199 -0
- package/protocol/v2ray.js +268 -0
- package/protocol/v3.js +723 -0
- package/protocol/wireguard.js +125 -0
- package/security/index.js +132 -0
- package/session-manager.js +329 -0
- package/session-tracker.js +80 -0
- package/setup.js +376 -0
- package/speedtest/index.js +528 -0
- package/speedtest.js +567 -0
- package/src/client.ts +502 -0
- package/src/index.ts +20 -0
- package/state/index.js +347 -0
- package/state.js +516 -0
- package/test-all-chain-ops.js +493 -0
- package/test-all-logic.js +199 -0
- package/test-all-msg-types.js +292 -0
- package/test-every-connection.js +208 -0
- package/test-feegrant-connect.js +98 -0
- package/test-logic.js +148 -0
- package/test-mainnet.js +176 -0
- package/test-plan-lifecycle.js +335 -0
- package/tls-trust.js +132 -0
- package/tsconfig.build.json +20 -0
- package/tsconfig.json +34 -0
- package/types/chain.d.ts +746 -0
- package/types/connection.d.ts +425 -0
- package/types/errors.d.ts +174 -0
- package/types/index.d.ts +1380 -0
- package/types/nodes.d.ts +187 -0
- package/types/pricing.d.ts +156 -0
- package/types/protocol.d.ts +332 -0
- package/types/session.d.ts +236 -0
- package/types/settings.d.ts +192 -0
- package/v3protocol.js +1053 -0
- package/wallet/index.js +153 -0
- package/wireguard.js +307 -0
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
// Copyright 2026 Google LLC
|
|
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
|
+
syntax = "proto3";
|
|
16
|
+
|
|
17
|
+
package google.api;
|
|
18
|
+
|
|
19
|
+
option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
|
|
20
|
+
option java_multiple_files = true;
|
|
21
|
+
option java_outer_classname = "HttpProto";
|
|
22
|
+
option java_package = "com.google.api";
|
|
23
|
+
option objc_class_prefix = "GAPI";
|
|
24
|
+
|
|
25
|
+
// Defines the HTTP configuration for an API service. It contains a list of
|
|
26
|
+
// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
|
|
27
|
+
// to one or more HTTP REST API methods.
|
|
28
|
+
message Http {
|
|
29
|
+
// A list of HTTP configuration rules that apply to individual API methods.
|
|
30
|
+
//
|
|
31
|
+
// **NOTE:** All service configuration rules follow "last one wins" order.
|
|
32
|
+
repeated HttpRule rules = 1;
|
|
33
|
+
|
|
34
|
+
// When set to true, URL path parameters will be fully URI-decoded except in
|
|
35
|
+
// cases of single segment matches in reserved expansion, where "%2F" will be
|
|
36
|
+
// left encoded.
|
|
37
|
+
//
|
|
38
|
+
// The default behavior is to not decode RFC 6570 reserved characters in multi
|
|
39
|
+
// segment matches.
|
|
40
|
+
bool fully_decode_reserved_expansion = 2;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// gRPC Transcoding
|
|
44
|
+
//
|
|
45
|
+
// gRPC Transcoding is a feature for mapping between a gRPC method and one or
|
|
46
|
+
// more HTTP REST endpoints. It allows developers to build a single API service
|
|
47
|
+
// that supports both gRPC APIs and REST APIs. Many systems, including [Google
|
|
48
|
+
// APIs](https://github.com/googleapis/googleapis),
|
|
49
|
+
// [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC
|
|
50
|
+
// Gateway](https://github.com/grpc-ecosystem/grpc-gateway),
|
|
51
|
+
// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature
|
|
52
|
+
// and use it for large scale production services.
|
|
53
|
+
//
|
|
54
|
+
// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies
|
|
55
|
+
// how different portions of the gRPC request message are mapped to the URL
|
|
56
|
+
// path, URL query parameters, and HTTP request body. It also controls how the
|
|
57
|
+
// gRPC response message is mapped to the HTTP response body. `HttpRule` is
|
|
58
|
+
// typically specified as an `google.api.http` annotation on the gRPC method.
|
|
59
|
+
//
|
|
60
|
+
// Each mapping specifies a URL path template and an HTTP method. The path
|
|
61
|
+
// template may refer to one or more fields in the gRPC request message, as long
|
|
62
|
+
// as each field is a non-repeated field with a primitive (non-message) type.
|
|
63
|
+
// The path template controls how fields of the request message are mapped to
|
|
64
|
+
// the URL path.
|
|
65
|
+
//
|
|
66
|
+
// Example:
|
|
67
|
+
//
|
|
68
|
+
// service Messaging {
|
|
69
|
+
// rpc GetMessage(GetMessageRequest) returns (Message) {
|
|
70
|
+
// option (google.api.http) = {
|
|
71
|
+
// get: "/v1/{name=messages/*}"
|
|
72
|
+
// };
|
|
73
|
+
// }
|
|
74
|
+
// }
|
|
75
|
+
// message GetMessageRequest {
|
|
76
|
+
// string name = 1; // Mapped to URL path.
|
|
77
|
+
// }
|
|
78
|
+
// message Message {
|
|
79
|
+
// string text = 1; // The resource content.
|
|
80
|
+
// }
|
|
81
|
+
//
|
|
82
|
+
// This enables an HTTP REST to gRPC mapping as below:
|
|
83
|
+
//
|
|
84
|
+
// - HTTP: `GET /v1/messages/123456`
|
|
85
|
+
// - gRPC: `GetMessage(name: "messages/123456")`
|
|
86
|
+
//
|
|
87
|
+
// Any fields in the request message which are not bound by the path template
|
|
88
|
+
// automatically become HTTP query parameters if there is no HTTP request body.
|
|
89
|
+
// For example:
|
|
90
|
+
//
|
|
91
|
+
// service Messaging {
|
|
92
|
+
// rpc GetMessage(GetMessageRequest) returns (Message) {
|
|
93
|
+
// option (google.api.http) = {
|
|
94
|
+
// get:"/v1/messages/{message_id}"
|
|
95
|
+
// };
|
|
96
|
+
// }
|
|
97
|
+
// }
|
|
98
|
+
// message GetMessageRequest {
|
|
99
|
+
// message SubMessage {
|
|
100
|
+
// string subfield = 1;
|
|
101
|
+
// }
|
|
102
|
+
// string message_id = 1; // Mapped to URL path.
|
|
103
|
+
// int64 revision = 2; // Mapped to URL query parameter `revision`.
|
|
104
|
+
// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`.
|
|
105
|
+
// }
|
|
106
|
+
//
|
|
107
|
+
// This enables a HTTP JSON to RPC mapping as below:
|
|
108
|
+
//
|
|
109
|
+
// - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo`
|
|
110
|
+
// - gRPC: `GetMessage(message_id: "123456" revision: 2 sub:
|
|
111
|
+
// SubMessage(subfield: "foo"))`
|
|
112
|
+
//
|
|
113
|
+
// Note that fields which are mapped to URL query parameters must have a
|
|
114
|
+
// primitive type or a repeated primitive type or a non-repeated message type.
|
|
115
|
+
// In the case of a repeated type, the parameter can be repeated in the URL
|
|
116
|
+
// as `...?param=A¶m=B`. In the case of a message type, each field of the
|
|
117
|
+
// message is mapped to a separate parameter, such as
|
|
118
|
+
// `...?foo.a=A&foo.b=B&foo.c=C`.
|
|
119
|
+
//
|
|
120
|
+
// For HTTP methods that allow a request body, the `body` field
|
|
121
|
+
// specifies the mapping. Consider a REST update method on the
|
|
122
|
+
// message resource collection:
|
|
123
|
+
//
|
|
124
|
+
// service Messaging {
|
|
125
|
+
// rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
|
|
126
|
+
// option (google.api.http) = {
|
|
127
|
+
// patch: "/v1/messages/{message_id}"
|
|
128
|
+
// body: "message"
|
|
129
|
+
// };
|
|
130
|
+
// }
|
|
131
|
+
// }
|
|
132
|
+
// message UpdateMessageRequest {
|
|
133
|
+
// string message_id = 1; // mapped to the URL
|
|
134
|
+
// Message message = 2; // mapped to the body
|
|
135
|
+
// }
|
|
136
|
+
//
|
|
137
|
+
// The following HTTP JSON to RPC mapping is enabled, where the
|
|
138
|
+
// representation of the JSON in the request body is determined by
|
|
139
|
+
// protos JSON encoding:
|
|
140
|
+
//
|
|
141
|
+
// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
|
|
142
|
+
// - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
|
|
143
|
+
//
|
|
144
|
+
// The special name `*` can be used in the body mapping to define that
|
|
145
|
+
// every field not bound by the path template should be mapped to the
|
|
146
|
+
// request body. This enables the following alternative definition of
|
|
147
|
+
// the update method:
|
|
148
|
+
//
|
|
149
|
+
// service Messaging {
|
|
150
|
+
// rpc UpdateMessage(Message) returns (Message) {
|
|
151
|
+
// option (google.api.http) = {
|
|
152
|
+
// patch: "/v1/messages/{message_id}"
|
|
153
|
+
// body: "*"
|
|
154
|
+
// };
|
|
155
|
+
// }
|
|
156
|
+
// }
|
|
157
|
+
// message Message {
|
|
158
|
+
// string message_id = 1;
|
|
159
|
+
// string text = 2;
|
|
160
|
+
// }
|
|
161
|
+
//
|
|
162
|
+
//
|
|
163
|
+
// The following HTTP JSON to RPC mapping is enabled:
|
|
164
|
+
//
|
|
165
|
+
// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
|
|
166
|
+
// - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")`
|
|
167
|
+
//
|
|
168
|
+
// Note that when using `*` in the body mapping, it is not possible to
|
|
169
|
+
// have HTTP parameters, as all fields not bound by the path end in
|
|
170
|
+
// the body. This makes this option more rarely used in practice when
|
|
171
|
+
// defining REST APIs. The common usage of `*` is in custom methods
|
|
172
|
+
// which don't use the URL at all for transferring data.
|
|
173
|
+
//
|
|
174
|
+
// It is possible to define multiple HTTP methods for one RPC by using
|
|
175
|
+
// the `additional_bindings` option. Example:
|
|
176
|
+
//
|
|
177
|
+
// service Messaging {
|
|
178
|
+
// rpc GetMessage(GetMessageRequest) returns (Message) {
|
|
179
|
+
// option (google.api.http) = {
|
|
180
|
+
// get: "/v1/messages/{message_id}"
|
|
181
|
+
// additional_bindings {
|
|
182
|
+
// get: "/v1/users/{user_id}/messages/{message_id}"
|
|
183
|
+
// }
|
|
184
|
+
// };
|
|
185
|
+
// }
|
|
186
|
+
// }
|
|
187
|
+
// message GetMessageRequest {
|
|
188
|
+
// string message_id = 1;
|
|
189
|
+
// string user_id = 2;
|
|
190
|
+
// }
|
|
191
|
+
//
|
|
192
|
+
// This enables the following two alternative HTTP JSON to RPC mappings:
|
|
193
|
+
//
|
|
194
|
+
// - HTTP: `GET /v1/messages/123456`
|
|
195
|
+
// - gRPC: `GetMessage(message_id: "123456")`
|
|
196
|
+
//
|
|
197
|
+
// - HTTP: `GET /v1/users/me/messages/123456`
|
|
198
|
+
// - gRPC: `GetMessage(user_id: "me" message_id: "123456")`
|
|
199
|
+
//
|
|
200
|
+
// Rules for HTTP mapping
|
|
201
|
+
//
|
|
202
|
+
// 1. Leaf request fields (recursive expansion nested messages in the request
|
|
203
|
+
// message) are classified into three categories:
|
|
204
|
+
// - Fields referred by the path template. They are passed via the URL path.
|
|
205
|
+
// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They
|
|
206
|
+
// are passed via the HTTP
|
|
207
|
+
// request body.
|
|
208
|
+
// - All other fields are passed via the URL query parameters, and the
|
|
209
|
+
// parameter name is the field path in the request message. A repeated
|
|
210
|
+
// field can be represented as multiple query parameters under the same
|
|
211
|
+
// name.
|
|
212
|
+
// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL
|
|
213
|
+
// query parameter, all fields
|
|
214
|
+
// are passed via URL path and HTTP request body.
|
|
215
|
+
// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP
|
|
216
|
+
// request body, all
|
|
217
|
+
// fields are passed via URL path and URL query parameters.
|
|
218
|
+
//
|
|
219
|
+
// Path template syntax
|
|
220
|
+
//
|
|
221
|
+
// Template = "/" Segments [ Verb ] ;
|
|
222
|
+
// Segments = Segment { "/" Segment } ;
|
|
223
|
+
// Segment = "*" | "**" | LITERAL | Variable ;
|
|
224
|
+
// Variable = "{" FieldPath [ "=" Segments ] "}" ;
|
|
225
|
+
// FieldPath = IDENT { "." IDENT } ;
|
|
226
|
+
// Verb = ":" LITERAL ;
|
|
227
|
+
//
|
|
228
|
+
// The syntax `*` matches a single URL path segment. The syntax `**` matches
|
|
229
|
+
// zero or more URL path segments, which must be the last part of the URL path
|
|
230
|
+
// except the `Verb`.
|
|
231
|
+
//
|
|
232
|
+
// The syntax `Variable` matches part of the URL path as specified by its
|
|
233
|
+
// template. A variable template must not contain other variables. If a variable
|
|
234
|
+
// matches a single path segment, its template may be omitted, e.g. `{var}`
|
|
235
|
+
// is equivalent to `{var=*}`.
|
|
236
|
+
//
|
|
237
|
+
// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL`
|
|
238
|
+
// contains any reserved character, such characters should be percent-encoded
|
|
239
|
+
// before the matching.
|
|
240
|
+
//
|
|
241
|
+
// If a variable contains exactly one path segment, such as `"{var}"` or
|
|
242
|
+
// `"{var=*}"`, when such a variable is expanded into a URL path on the client
|
|
243
|
+
// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The
|
|
244
|
+
// server side does the reverse decoding. Such variables show up in the
|
|
245
|
+
// [Discovery
|
|
246
|
+
// Document](https://developers.google.com/discovery/v1/reference/apis) as
|
|
247
|
+
// `{var}`.
|
|
248
|
+
//
|
|
249
|
+
// If a variable contains multiple path segments, such as `"{var=foo/*}"`
|
|
250
|
+
// or `"{var=**}"`, when such a variable is expanded into a URL path on the
|
|
251
|
+
// client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded.
|
|
252
|
+
// The server side does the reverse decoding, except "%2F" and "%2f" are left
|
|
253
|
+
// unchanged. Such variables show up in the
|
|
254
|
+
// [Discovery
|
|
255
|
+
// Document](https://developers.google.com/discovery/v1/reference/apis) as
|
|
256
|
+
// `{+var}`.
|
|
257
|
+
//
|
|
258
|
+
// Using gRPC API Service Configuration
|
|
259
|
+
//
|
|
260
|
+
// gRPC API Service Configuration (service config) is a configuration language
|
|
261
|
+
// for configuring a gRPC service to become a user-facing product. The
|
|
262
|
+
// service config is simply the YAML representation of the `google.api.Service`
|
|
263
|
+
// proto message.
|
|
264
|
+
//
|
|
265
|
+
// As an alternative to annotating your proto file, you can configure gRPC
|
|
266
|
+
// transcoding in your service config YAML files. You do this by specifying a
|
|
267
|
+
// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same
|
|
268
|
+
// effect as the proto annotation. This can be particularly useful if you
|
|
269
|
+
// have a proto that is reused in multiple services. Note that any transcoding
|
|
270
|
+
// specified in the service config will override any matching transcoding
|
|
271
|
+
// configuration in the proto.
|
|
272
|
+
//
|
|
273
|
+
// The following example selects a gRPC method and applies an `HttpRule` to it:
|
|
274
|
+
//
|
|
275
|
+
// http:
|
|
276
|
+
// rules:
|
|
277
|
+
// - selector: example.v1.Messaging.GetMessage
|
|
278
|
+
// get: /v1/messages/{message_id}/{sub.subfield}
|
|
279
|
+
//
|
|
280
|
+
// Special notes
|
|
281
|
+
//
|
|
282
|
+
// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
|
|
283
|
+
// proto to JSON conversion must follow the [proto3
|
|
284
|
+
// specification](https://developers.google.com/protocol-buffers/docs/proto3#json).
|
|
285
|
+
//
|
|
286
|
+
// While the single segment variable follows the semantics of
|
|
287
|
+
// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
|
|
288
|
+
// Expansion, the multi segment variable **does not** follow RFC 6570 Section
|
|
289
|
+
// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion
|
|
290
|
+
// does not expand special characters like `?` and `#`, which would lead
|
|
291
|
+
// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding
|
|
292
|
+
// for multi segment variables.
|
|
293
|
+
//
|
|
294
|
+
// The path variables **must not** refer to any repeated or mapped field,
|
|
295
|
+
// because client libraries are not capable of handling such variable expansion.
|
|
296
|
+
//
|
|
297
|
+
// The path variables **must not** capture the leading "/" character. The reason
|
|
298
|
+
// is that the most common use case "{var}" does not capture the leading "/"
|
|
299
|
+
// character. For consistency, all path variables must share the same behavior.
|
|
300
|
+
//
|
|
301
|
+
// Repeated message fields must not be mapped to URL query parameters, because
|
|
302
|
+
// no client library can support such complicated mapping.
|
|
303
|
+
//
|
|
304
|
+
// If an API needs to use a JSON array for request or response body, it can map
|
|
305
|
+
// the request or response body to a repeated field. However, some gRPC
|
|
306
|
+
// Transcoding implementations may not support this feature.
|
|
307
|
+
message HttpRule {
|
|
308
|
+
// Selects a method to which this rule applies.
|
|
309
|
+
//
|
|
310
|
+
// Refer to [selector][google.api.DocumentationRule.selector] for syntax
|
|
311
|
+
// details.
|
|
312
|
+
string selector = 1;
|
|
313
|
+
|
|
314
|
+
// Determines the URL pattern is matched by this rules. This pattern can be
|
|
315
|
+
// used with any of the {get|put|post|delete|patch} methods. A custom method
|
|
316
|
+
// can be defined using the 'custom' field.
|
|
317
|
+
oneof pattern {
|
|
318
|
+
// Maps to HTTP GET. Used for listing and getting information about
|
|
319
|
+
// resources.
|
|
320
|
+
string get = 2;
|
|
321
|
+
|
|
322
|
+
// Maps to HTTP PUT. Used for replacing a resource.
|
|
323
|
+
string put = 3;
|
|
324
|
+
|
|
325
|
+
// Maps to HTTP POST. Used for creating a resource or performing an action.
|
|
326
|
+
string post = 4;
|
|
327
|
+
|
|
328
|
+
// Maps to HTTP DELETE. Used for deleting a resource.
|
|
329
|
+
string delete = 5;
|
|
330
|
+
|
|
331
|
+
// Maps to HTTP PATCH. Used for updating a resource.
|
|
332
|
+
string patch = 6;
|
|
333
|
+
|
|
334
|
+
// The custom pattern is used for specifying an HTTP method that is not
|
|
335
|
+
// included in the `pattern` field, such as HEAD, or "*" to leave the
|
|
336
|
+
// HTTP method unspecified for this rule. The wild-card rule is useful
|
|
337
|
+
// for services that provide content to Web (HTML) clients.
|
|
338
|
+
CustomHttpPattern custom = 8;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// The name of the request field whose value is mapped to the HTTP request
|
|
342
|
+
// body, or `*` for mapping all request fields not captured by the path
|
|
343
|
+
// pattern to the HTTP body, or omitted for not having any HTTP request body.
|
|
344
|
+
//
|
|
345
|
+
// NOTE: the referred field must be present at the top-level of the request
|
|
346
|
+
// message type.
|
|
347
|
+
string body = 7;
|
|
348
|
+
|
|
349
|
+
// Optional. The name of the response field whose value is mapped to the HTTP
|
|
350
|
+
// response body. When omitted, the entire response message will be used
|
|
351
|
+
// as the HTTP response body.
|
|
352
|
+
//
|
|
353
|
+
// NOTE: The referred field must be present at the top-level of the response
|
|
354
|
+
// message type.
|
|
355
|
+
string response_body = 12;
|
|
356
|
+
|
|
357
|
+
// Additional HTTP bindings for the selector. Nested bindings must
|
|
358
|
+
// not contain an `additional_bindings` field themselves (that is,
|
|
359
|
+
// the nesting may only be one level deep).
|
|
360
|
+
repeated HttpRule additional_bindings = 11;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
// A custom pattern is used for defining custom HTTP verb.
|
|
364
|
+
message CustomHttpPattern {
|
|
365
|
+
// The name of this custom HTTP verb.
|
|
366
|
+
string kind = 1;
|
|
367
|
+
|
|
368
|
+
// The path matched by this custom verb.
|
|
369
|
+
string path = 2;
|
|
370
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
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
|
+
|
|
31
|
+
syntax = "proto3";
|
|
32
|
+
|
|
33
|
+
package google.protobuf;
|
|
34
|
+
|
|
35
|
+
option go_package = "google.golang.org/protobuf/types/known/anypb";
|
|
36
|
+
option java_package = "com.google.protobuf";
|
|
37
|
+
option java_outer_classname = "AnyProto";
|
|
38
|
+
option java_multiple_files = true;
|
|
39
|
+
option objc_class_prefix = "GPB";
|
|
40
|
+
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
|
41
|
+
|
|
42
|
+
// `Any` contains an arbitrary serialized protocol buffer message along with a
|
|
43
|
+
// URL that describes the type of the serialized message.
|
|
44
|
+
//
|
|
45
|
+
// In its binary encoding, an `Any` is an ordinary message; but in other wire
|
|
46
|
+
// forms like JSON, it has a special encoding. The format of the type URL is
|
|
47
|
+
// described on the `type_url` field.
|
|
48
|
+
//
|
|
49
|
+
// Protobuf APIs provide utilities to interact with `Any` values:
|
|
50
|
+
//
|
|
51
|
+
// - A 'pack' operation accepts a message and constructs a generic `Any` wrapper
|
|
52
|
+
// around it.
|
|
53
|
+
// - An 'unpack' operation reads the content of an `Any` message, either into an
|
|
54
|
+
// existing message or a new one. Unpack operations must check the type of the
|
|
55
|
+
// value they unpack against the declared `type_url`.
|
|
56
|
+
// - An 'is' operation decides whether an `Any` contains a message of the given
|
|
57
|
+
// type, i.e. whether it can 'unpack' that type.
|
|
58
|
+
//
|
|
59
|
+
// The JSON format representation of an `Any` follows one of these cases:
|
|
60
|
+
//
|
|
61
|
+
// - For types without special-cased JSON encodings, the JSON format
|
|
62
|
+
// representation of the `Any` is the same as that of the message, with an
|
|
63
|
+
// additional `@type` field which contains the type URL.
|
|
64
|
+
// - For types with special-cased JSON encodings (typically called 'well-known'
|
|
65
|
+
// types, listed in https://protobuf.dev/programming-guides/json/#any), the
|
|
66
|
+
// JSON format representation has a key `@type` which contains the type URL
|
|
67
|
+
// and a key `value` which contains the JSON-serialized value.
|
|
68
|
+
//
|
|
69
|
+
// The text format representation of an `Any` is like a message with one field
|
|
70
|
+
// whose name is the type URL in brackets. For example, an `Any` containing a
|
|
71
|
+
// `foo.Bar` message may be written `[type.googleapis.com/foo.Bar] { a: 2 }`.
|
|
72
|
+
message Any {
|
|
73
|
+
// Identifies the type of the serialized Protobuf message with a URI reference
|
|
74
|
+
// consisting of a prefix ending in a slash and the fully-qualified type name.
|
|
75
|
+
//
|
|
76
|
+
// Example: type.googleapis.com/google.protobuf.StringValue
|
|
77
|
+
//
|
|
78
|
+
// This string must contain at least one `/` character, and the content after
|
|
79
|
+
// the last `/` must be the fully-qualified name of the type in canonical
|
|
80
|
+
// form, without a leading dot. Do not write a scheme on these URI references
|
|
81
|
+
// so that clients do not attempt to contact them.
|
|
82
|
+
//
|
|
83
|
+
// The prefix is arbitrary and Protobuf implementations are expected to
|
|
84
|
+
// simply strip off everything up to and including the last `/` to identify
|
|
85
|
+
// the type. `type.googleapis.com/` is a common default prefix that some
|
|
86
|
+
// legacy implementations require. This prefix does not indicate the origin of
|
|
87
|
+
// the type, and URIs containing it are not expected to respond to any
|
|
88
|
+
// requests.
|
|
89
|
+
//
|
|
90
|
+
// All type URL strings must be legal URI references with the additional
|
|
91
|
+
// restriction (for the text format) that the content of the reference
|
|
92
|
+
// must consist only of alphanumeric characters, percent-encoded escapes, and
|
|
93
|
+
// characters in the following set (not including the outer backticks):
|
|
94
|
+
// `/-.~_!$&()*+,;=`. Despite our allowing percent encodings, implementations
|
|
95
|
+
// should not unescape them to prevent confusion with existing parsers. For
|
|
96
|
+
// example, `type.googleapis.com%2FFoo` should be rejected.
|
|
97
|
+
//
|
|
98
|
+
// In the original design of `Any`, the possibility of launching a type
|
|
99
|
+
// resolution service at these type URLs was considered but Protobuf never
|
|
100
|
+
// implemented one and considers contacting these URLs to be problematic and
|
|
101
|
+
// a potential security issue. Do not attempt to contact type URLs.
|
|
102
|
+
string type_url = 1;
|
|
103
|
+
|
|
104
|
+
// Holds a Protobuf serialization of the type described by type_url.
|
|
105
|
+
bytes value = 2;
|
|
106
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
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
|
+
|
|
31
|
+
syntax = "proto3";
|
|
32
|
+
|
|
33
|
+
package google.protobuf;
|
|
34
|
+
|
|
35
|
+
option cc_enable_arenas = true;
|
|
36
|
+
option go_package = "google.golang.org/protobuf/types/known/durationpb";
|
|
37
|
+
option java_package = "com.google.protobuf";
|
|
38
|
+
option java_outer_classname = "DurationProto";
|
|
39
|
+
option java_multiple_files = true;
|
|
40
|
+
option objc_class_prefix = "GPB";
|
|
41
|
+
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
|
42
|
+
|
|
43
|
+
// A Duration represents a signed, fixed-length span of time represented
|
|
44
|
+
// as a count of seconds and fractions of seconds at nanosecond
|
|
45
|
+
// resolution. It is independent of any calendar and concepts like "day"
|
|
46
|
+
// or "month". It is related to Timestamp in that the difference between
|
|
47
|
+
// two Timestamp values is a Duration and it can be added or subtracted
|
|
48
|
+
// from a Timestamp. Range is approximately +-10,000 years.
|
|
49
|
+
//
|
|
50
|
+
// # Examples
|
|
51
|
+
//
|
|
52
|
+
// Example 1: Compute Duration from two Timestamps in pseudo code.
|
|
53
|
+
//
|
|
54
|
+
// Timestamp start = ...;
|
|
55
|
+
// Timestamp end = ...;
|
|
56
|
+
// Duration duration = ...;
|
|
57
|
+
//
|
|
58
|
+
// duration.seconds = end.seconds - start.seconds;
|
|
59
|
+
// duration.nanos = end.nanos - start.nanos;
|
|
60
|
+
//
|
|
61
|
+
// if (duration.seconds < 0 && duration.nanos > 0) {
|
|
62
|
+
// duration.seconds += 1;
|
|
63
|
+
// duration.nanos -= 1000000000;
|
|
64
|
+
// } else if (duration.seconds > 0 && duration.nanos < 0) {
|
|
65
|
+
// duration.seconds -= 1;
|
|
66
|
+
// duration.nanos += 1000000000;
|
|
67
|
+
// }
|
|
68
|
+
//
|
|
69
|
+
// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
|
|
70
|
+
//
|
|
71
|
+
// Timestamp start = ...;
|
|
72
|
+
// Duration duration = ...;
|
|
73
|
+
// Timestamp end = ...;
|
|
74
|
+
//
|
|
75
|
+
// end.seconds = start.seconds + duration.seconds;
|
|
76
|
+
// end.nanos = start.nanos + duration.nanos;
|
|
77
|
+
//
|
|
78
|
+
// if (end.nanos < 0) {
|
|
79
|
+
// end.seconds -= 1;
|
|
80
|
+
// end.nanos += 1000000000;
|
|
81
|
+
// } else if (end.nanos >= 1000000000) {
|
|
82
|
+
// end.seconds += 1;
|
|
83
|
+
// end.nanos -= 1000000000;
|
|
84
|
+
// }
|
|
85
|
+
//
|
|
86
|
+
// Example 3: Compute Duration from datetime.timedelta in Python.
|
|
87
|
+
//
|
|
88
|
+
// td = datetime.timedelta(days=3, minutes=10)
|
|
89
|
+
// duration = Duration()
|
|
90
|
+
// duration.FromTimedelta(td)
|
|
91
|
+
//
|
|
92
|
+
// # JSON Mapping
|
|
93
|
+
//
|
|
94
|
+
// In JSON format, the Duration type is encoded as a string rather than an
|
|
95
|
+
// object, where the string ends in the suffix "s" (indicating seconds) and
|
|
96
|
+
// is preceded by the number of seconds, with nanoseconds expressed as
|
|
97
|
+
// fractional seconds. For example, 3 seconds with 0 nanoseconds should be
|
|
98
|
+
// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
|
|
99
|
+
// be expressed in JSON format as "3.000000001s", and 3 seconds and 1
|
|
100
|
+
// microsecond should be expressed in JSON format as "3.000001s".
|
|
101
|
+
//
|
|
102
|
+
message Duration {
|
|
103
|
+
// Signed seconds of the span of time. Must be from -315,576,000,000
|
|
104
|
+
// to +315,576,000,000 inclusive. Note: these bounds are computed from:
|
|
105
|
+
// 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
|
|
106
|
+
int64 seconds = 1;
|
|
107
|
+
|
|
108
|
+
// Signed fractions of a second at nanosecond resolution of the span
|
|
109
|
+
// of time. Durations less than one second are represented with a 0
|
|
110
|
+
// `seconds` field and a positive or negative `nanos` field. For durations
|
|
111
|
+
// of one second or more, a non-zero value for the `nanos` field must be
|
|
112
|
+
// of the same sign as the `seconds` field. Must be from -999,999,999
|
|
113
|
+
// to +999,999,999 inclusive.
|
|
114
|
+
int32 nanos = 2;
|
|
115
|
+
}
|