@tdxvolt/volt-client-grpc 0.18.3 → 0.18.4
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/lib/index.cjs +3214 -186
- package/package.json +5 -2
- package/scripts/generate-proto-assets.js +71 -0
- package/src/constants.js +2 -1
- package/src/grpc-call.js +7 -3
- package/src/proto-package-definition.js +183 -0
- package/src/proto-utils.js +41 -111
- package/src/volt-client-internal.js +5 -30
- package/src/volt-client.js +0 -57
- package/src/volt-proto-literals.js +2985 -0
- package/protobuf/README.md +0 -4
- package/protobuf/tdx/volt_api/data/v1/sqlite.proto +0 -43
- package/protobuf/tdx/volt_api/data/v1/sqlite_database_api.proto +0 -153
- package/protobuf/tdx/volt_api/data/v1/sqlite_server_api.proto +0 -50
- package/protobuf/tdx/volt_api/relay/v1/proxy_api.proto +0 -9
- package/protobuf/tdx/volt_api/relay/v1/relay_api.proto +0 -78
- package/protobuf/tdx/volt_api/sync/v1/sync.proto +0 -57
- package/protobuf/tdx/volt_api/volt/v1/discovery_api.proto +0 -35
- package/protobuf/tdx/volt_api/volt/v1/file.proto +0 -17
- package/protobuf/tdx/volt_api/volt/v1/file_api.proto +0 -165
- package/protobuf/tdx/volt_api/volt/v1/remote.proto +0 -93
- package/protobuf/tdx/volt_api/volt/v1/spark_api.proto +0 -121
- package/protobuf/tdx/volt_api/volt/v1/ssi.proto +0 -66
- package/protobuf/tdx/volt_api/volt/v1/ssi_api.proto +0 -214
- package/protobuf/tdx/volt_api/volt/v1/status.proto +0 -15
- package/protobuf/tdx/volt_api/volt/v1/terminal_api.proto +0 -42
- package/protobuf/tdx/volt_api/volt/v1/volt.proto +0 -666
- package/protobuf/tdx/volt_api/volt/v1/volt_api.proto +0 -1082
- package/protobuf/tdx/volt_api/volt/v1/wire_api.proto +0 -56
package/protobuf/README.md
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package tdx.volt_api.data.v1;
|
|
4
|
-
|
|
5
|
-
// Just reflect SQLite types for now.
|
|
6
|
-
enum DataType {
|
|
7
|
-
DATA_TYPE_UNKNOWN = 0;
|
|
8
|
-
DATA_TYPE_TEXT = 1;
|
|
9
|
-
DATA_TYPE_INTEGER = 2;
|
|
10
|
-
DATA_TYPE_REAL = 3;
|
|
11
|
-
DATA_TYPE_BLOB = 4;
|
|
12
|
-
DATA_TYPE_NULL = 5;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
message Column {
|
|
16
|
-
string name = 1;
|
|
17
|
-
string description = 2;
|
|
18
|
-
DataType type = 3;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
message Schema {
|
|
22
|
-
string name = 1;
|
|
23
|
-
string description = 2;
|
|
24
|
-
repeated Column column = 3;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
message Variant {
|
|
28
|
-
oneof data {
|
|
29
|
-
string text = 1;
|
|
30
|
-
int64 integer = 2;
|
|
31
|
-
double real = 3;
|
|
32
|
-
bytes blob = 4;
|
|
33
|
-
bool null = 5;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
message RowHeader {
|
|
38
|
-
repeated Column column = 1;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
message VariantRow {
|
|
42
|
-
repeated Variant column = 1;
|
|
43
|
-
}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package tdx.volt_api.data.v1;
|
|
4
|
-
|
|
5
|
-
import "tdx/volt_api/volt/v1/status.proto";
|
|
6
|
-
import "tdx/volt_api/data/v1/sqlite.proto";
|
|
7
|
-
import "tdx/volt_api/volt/v1/volt.proto";
|
|
8
|
-
|
|
9
|
-
// The Sqlite Database API exposes functions that enable clients to manipulate data in a given Volt database.
|
|
10
|
-
// Use the Sqlite Server API to create the database resource.
|
|
11
|
-
service SqliteDatabaseAPI {
|
|
12
|
-
// Execute multiple SQL statements in a single transaction via a single RPC.
|
|
13
|
-
rpc BulkUpdate(SqlBulkUpdateRequest) returns (SqlBulkUpdateResponse);
|
|
14
|
-
|
|
15
|
-
// Execute a single SQL statement. Any valid SQL is accepted. In order to execute non-SELECT statements, the caller must have the "write" permission.
|
|
16
|
-
rpc Execute(stream SqlExecuteRequest) returns (stream SqlExecuteResponse);
|
|
17
|
-
|
|
18
|
-
// Import CSV data into a table.
|
|
19
|
-
// The import handler will inspect the incoming CSV data, infer the columns and data types required, and create and populate the SQL table.
|
|
20
|
-
// The CSV must contain a header row containing the column names and at least one row of data so that the types can be inferred.
|
|
21
|
-
// The importer assumes all data in any given CSV file relates to a single table.
|
|
22
|
-
// The data can either be streamed in chunks or retrieved from an existing resource.
|
|
23
|
-
// If the data is streamed in chunks, the client must call the Close() method on the stream to indicate that it has finished.
|
|
24
|
-
rpc ImportCSV(stream SqlImportCSVRequest) returns (stream SqlImportCSVResponse);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
message SqlBulkUpdateRequest {
|
|
28
|
-
// The id of the database to update.
|
|
29
|
-
string database_id = 1;
|
|
30
|
-
|
|
31
|
-
// The SQL statements to execute. The statements will be executed within a transaction and will be committed if all statements succeed.
|
|
32
|
-
// Bear in mind the maximum size limit of a single message is 64MB, and around 1MB seems to be optimal in terms of performance.
|
|
33
|
-
repeated string statement = 2;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
message SqlBulkUpdateResponse {
|
|
37
|
-
// Details of any error that occurred on the call.
|
|
38
|
-
tdx.volt_api.volt.v1.Status status = 1;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
message SqlExecuteStart {
|
|
42
|
-
// The id of the database to execute on.
|
|
43
|
-
string database_id = 1;
|
|
44
|
-
|
|
45
|
-
// Set to start a transaction. If not set, each statement will be executed in its own transaction.
|
|
46
|
-
bool transaction = 2;
|
|
47
|
-
|
|
48
|
-
// The SQL statement to execute.
|
|
49
|
-
string statement = 3;
|
|
50
|
-
|
|
51
|
-
// This can be used to limit the number of rows returned by `SELECT` statements to avoid overloading a client. It is similar to using 'LIMIT/OFFSET' clauses on the 'SELECT' statement, but this method is easier to manage and the entire result set will be prepared on the Volt, and the client can then page through it by sending successive messages.
|
|
52
|
-
uint32 page_size = 4;
|
|
53
|
-
|
|
54
|
-
// Set to indicate that the query will be cancelled if the client disconnects.
|
|
55
|
-
// This is useful for long running queries, where it might be desirable for the client to be able to cancel the request before all the data is received. However this requires a worker thread to be allocated to the query until it completes, which may affect performance and limit the number of concurrent queries that can be executed due to file handle limitations.
|
|
56
|
-
// Only applicable to `SELECT` statements, ignored otherwise.
|
|
57
|
-
bool can_cancel = 5;
|
|
58
|
-
|
|
59
|
-
//The values to set for each parameter defined in a database view.
|
|
60
|
-
//This field is only relevant to 'query' databases, i.e. those with kind `tdx:sqlite-view`.
|
|
61
|
-
//The values in the map should be keyed by parameter name.
|
|
62
|
-
// A query may have no parameters defined, in which case leave this field empty.
|
|
63
|
-
map<string, tdx.volt_api.volt.v1.AttributeValue> parameter = 6;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// Intentionally empty.
|
|
67
|
-
message SqlExecuteNext {
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Ends the call.
|
|
71
|
-
message SqlExecuteEnd {
|
|
72
|
-
// Set to commit the transaction. If not set, the transaction will be rolled back.
|
|
73
|
-
bool commit_transaction = 1;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
message SqlExecuteRequest {
|
|
77
|
-
oneof payload {
|
|
78
|
-
// Initialise the request with the database id and whether to execute within a transaction.
|
|
79
|
-
// Also includes the SQL statement to execute.
|
|
80
|
-
SqlExecuteStart start = 2;
|
|
81
|
-
|
|
82
|
-
// To retrieve subsequent pages, send a `next` request.
|
|
83
|
-
SqlExecuteNext next = 3;
|
|
84
|
-
|
|
85
|
-
// To end the call, send an `end` request. Only really necessary for transaction-based calls, otherwise clients can just close the stream.
|
|
86
|
-
SqlExecuteEnd end = 4;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// One of the following fields will be present in any given message.
|
|
91
|
-
message SqlExecuteResponse {
|
|
92
|
-
oneof payload {
|
|
93
|
-
// A status will be sent on error.
|
|
94
|
-
tdx.volt_api.volt.v1.Status status = 1;
|
|
95
|
-
|
|
96
|
-
// The initial response for SELECT statements will be a header containing the column names and types.
|
|
97
|
-
RowHeader header = 2;
|
|
98
|
-
|
|
99
|
-
// Each row in the result set will be sent as a VariantRow.
|
|
100
|
-
VariantRow row = 3;
|
|
101
|
-
|
|
102
|
-
// NYI - For INSERT/UPDATE statements the number of affected rows will be sent.
|
|
103
|
-
uint32 affected_rows = 4;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
message SqlImportCSVConfiguration {
|
|
108
|
-
// The target database resource id, which must already exist, and the authenticated account must have write access to the resource.
|
|
109
|
-
string database_id = 1;
|
|
110
|
-
|
|
111
|
-
// The target table name.
|
|
112
|
-
string table_name = 2;
|
|
113
|
-
|
|
114
|
-
// Not yet implemented - flag indicating that data is to be inserted into an existing table.
|
|
115
|
-
bool create_table = 3;
|
|
116
|
-
|
|
117
|
-
// Optional - when not sending the data via this RPC, this should contain the id of a resource that contains the CSV data. If set, the authenticated account must have read access to the resource.
|
|
118
|
-
string source_resource_id = 4;
|
|
119
|
-
|
|
120
|
-
// Optional - the interval to receive progress updates, in number of rows. E.g. set to 1000 to receive progress updates every 1000 rows. Set to 0 to disable progress updates.
|
|
121
|
-
uint32 progress_interval = 5;
|
|
122
|
-
|
|
123
|
-
// The number of rows scanned to infer the schema. Set to 0 to scan the entire file.
|
|
124
|
-
uint32 schema_scan_limit = 6;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// Each message must contain one and only one of the following fields.
|
|
128
|
-
message SqlImportCSVRequest {
|
|
129
|
-
oneof payload {
|
|
130
|
-
// The initial request must contain the configuration parameters for the import.
|
|
131
|
-
SqlImportCSVConfiguration configuration = 1;
|
|
132
|
-
|
|
133
|
-
// Set to indicate that the upload is complete.
|
|
134
|
-
bool upload_complete = 2;
|
|
135
|
-
|
|
136
|
-
// Subsequent requests may contain the data to be imported, unless importing from an existing resource that contains the CSV data. It is recommended that the block size is less than 1MB.
|
|
137
|
-
bytes block = 3;
|
|
138
|
-
|
|
139
|
-
// Set to abort the import.
|
|
140
|
-
bool abort = 4;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
message SqlImportCSVResponse {
|
|
145
|
-
// The status will contain any error info.
|
|
146
|
-
tdx.volt_api.volt.v1.Status status = 1;
|
|
147
|
-
|
|
148
|
-
// The number of rows processed - this will be sent after every `progress_interval` rows.
|
|
149
|
-
int64 row_count = 2;
|
|
150
|
-
|
|
151
|
-
// The total number of rows to be imported.
|
|
152
|
-
int64 total_rows = 3;
|
|
153
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package tdx.volt_api.data.v1;
|
|
4
|
-
|
|
5
|
-
import "tdx/volt_api/volt/v1/status.proto";
|
|
6
|
-
import "tdx/volt_api/volt/v1/volt.proto";
|
|
7
|
-
|
|
8
|
-
// The Sqlite Server API provides database management functions.
|
|
9
|
-
// Use the VoltAPI DeleteResource function to delete a database.
|
|
10
|
-
service SqliteServerAPI {
|
|
11
|
-
// Create a new database resource.
|
|
12
|
-
rpc CreateDatabase(CreateDatabaseRequest) returns (CreateDatabaseResponse);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
message CreateDatabaseRequest {
|
|
16
|
-
// The name of the database to create.
|
|
17
|
-
string name = 1;
|
|
18
|
-
|
|
19
|
-
// Optional - the id of the folder resource in which to create the database. If omitted, the callers home folder is used.
|
|
20
|
-
string create_in_parent_id = 2;
|
|
21
|
-
|
|
22
|
-
// Set to encrypt the database. The encryption key will be generated by the server, the internal Volt server uses the root volt key.
|
|
23
|
-
bool encrypted = 3;
|
|
24
|
-
|
|
25
|
-
// Set to audit all SELECT database operations.
|
|
26
|
-
bool read_audit = 4;
|
|
27
|
-
|
|
28
|
-
// Set to audit all INSERT, UPDATE, and DELETE database operations.
|
|
29
|
-
bool write_audit = 5;
|
|
30
|
-
|
|
31
|
-
// The discovery mode of the underlying Volt resource.
|
|
32
|
-
tdx.volt_api.volt.v1.DiscoveryMode discoverable = 6;
|
|
33
|
-
|
|
34
|
-
// Alias(es) that can be used to refer to the database rather than the id.
|
|
35
|
-
// Each alias must be unique to the Volt, this is enforced by the API.
|
|
36
|
-
// No format restrictions are currently applied to alias, but this may change in future, for the time being it makes sense to stick to alphanumeric characters and '_' or '-'.
|
|
37
|
-
repeated string alias = 7;
|
|
38
|
-
|
|
39
|
-
// Optional description of the database.
|
|
40
|
-
string description = 8;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
message CreateDatabaseResponse {
|
|
44
|
-
// Any error message will be returned here.
|
|
45
|
-
tdx.volt_api.volt.v1.Status status = 1;
|
|
46
|
-
|
|
47
|
-
// The new database resource on success.
|
|
48
|
-
tdx.volt_api.volt.v1.Resource resource = 2;
|
|
49
|
-
}
|
|
50
|
-
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package tdx.volt_api.relay.v1;
|
|
4
|
-
|
|
5
|
-
import "tdx/volt_api/volt/v1/status.proto";
|
|
6
|
-
import "tdx/volt_api/volt/v1/remote.proto";
|
|
7
|
-
import "tdx/volt_api/volt/v1/volt.proto";
|
|
8
|
-
|
|
9
|
-
service RelayAPI {
|
|
10
|
-
// Retrieve the list of Volts available on the Relay Volt.
|
|
11
|
-
rpc GetVoltEndpoint(GetVoltEndpointRequest) returns (GetVoltEndpointResponse);
|
|
12
|
-
|
|
13
|
-
// This is the actual tunnel stream.
|
|
14
|
-
// Note although this API semantically describes the tunnel stream, it isn't actually implemented anywhere. It is used by client libraries to easily serialise tunnel payloads.
|
|
15
|
-
rpc Tunnel(stream tdx.volt_api.volt.v1.RemoteRequest) returns (stream tdx.volt_api.volt.v1.RemoteResponse);
|
|
16
|
-
|
|
17
|
-
// This is the tunnel stream for cloud-based tunnels.
|
|
18
|
-
rpc CloudTunnel(stream TunnelRequest) returns (stream TunnelResponse);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
message GetVoltEndpointRequest {
|
|
22
|
-
// Optional - if omitted a list of all volts known to the authenticated
|
|
23
|
-
// account will be returned.
|
|
24
|
-
oneof filter {
|
|
25
|
-
// Filter on the owning identity.
|
|
26
|
-
string owner_id = 2;
|
|
27
|
-
// Filter on volt id.
|
|
28
|
-
string volt_id = 1;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
message GetVoltEndpointResponse {
|
|
33
|
-
tdx.volt_api.volt.v1.Status status = 1;
|
|
34
|
-
repeated tdx.volt_api.volt.v1.VoltEndpoint endpoint = 2;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
message TunnelStart {
|
|
38
|
-
uint32 preferred_port = 1;
|
|
39
|
-
string address = 2;
|
|
40
|
-
string public_key = 3;
|
|
41
|
-
string fingerprint = 4;
|
|
42
|
-
string ca_pem = 5;
|
|
43
|
-
string volt_version = 6;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
message TunnelServiceControl {
|
|
47
|
-
string resource_id = 1;
|
|
48
|
-
string service_name = 2;
|
|
49
|
-
tdx.volt_api.volt.v1.ServiceDescription service_description = 3;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
message TunnelControl {
|
|
53
|
-
oneof msg {
|
|
54
|
-
TunnelStart start = 2;
|
|
55
|
-
TunnelServiceControl add_service = 3;
|
|
56
|
-
TunnelServiceControl remove_service = 4;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
message TunnelRequest {
|
|
61
|
-
oneof payload {
|
|
62
|
-
tdx.volt_api.volt.v1.RemotePing ping = 1;
|
|
63
|
-
TunnelControl control = 2;
|
|
64
|
-
tdx.volt_api.volt.v1.MethodPayload method_payload = 3;
|
|
65
|
-
tdx.volt_api.volt.v1.MethodEnd method_end = 4;
|
|
66
|
-
tdx.volt_api.volt.v1.HttpResponse http_response = 5;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
message TunnelResponse {
|
|
71
|
-
oneof payload {
|
|
72
|
-
tdx.volt_api.volt.v1.RemotePing ping = 1;
|
|
73
|
-
tdx.volt_api.volt.v1.MethodInvoke method_invoke = 2;
|
|
74
|
-
tdx.volt_api.volt.v1.MethodPayload method_payload = 3;
|
|
75
|
-
tdx.volt_api.volt.v1.MethodEnd method_end = 4;
|
|
76
|
-
tdx.volt_api.volt.v1.HttpRequest http_request = 5;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package tdx.volt_api.sync.v1;
|
|
4
|
-
|
|
5
|
-
// Wraps arbitrary protobuf messages, with an index into the `ProtobufSyncConfigurationHeader` to indicate the specific message type this message wraps.
|
|
6
|
-
message ProtobufSyncWrapper {
|
|
7
|
-
oneof header_lookup {
|
|
8
|
-
// The index number of the header for this message type in the Volt logger configuration file.
|
|
9
|
-
uint32 header_index = 1;
|
|
10
|
-
|
|
11
|
-
// The name of the header for this message type, will be used to lookup against the `id` field in `ProtobufSyncConfiguration`.
|
|
12
|
-
// This will incur an overhead in terms of the packet size, but might be preferrable if volume is low or managing the header index is difficult.
|
|
13
|
-
string header_id = 2;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// The message payload, in serialised protobuf binary format.
|
|
17
|
-
// n.b. the serialisation should **not** be length-prefixed.
|
|
18
|
-
bytes payload = 3;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// Describes a single message type.
|
|
22
|
-
// A set of one or more of these messages is specified in `ProtobufSyncConfigurationHeader`.
|
|
23
|
-
message ProtobufSyncConfiguration {
|
|
24
|
-
// Optional id to associate with this configuration.
|
|
25
|
-
// This can be used in the `header_id` field of `ProtobufSyncWrapper` above to reference the configuration.
|
|
26
|
-
// If omitted the numerical index of the configuration in `ProtobufSyncConfigurationHeader` will be used instead.
|
|
27
|
-
string id = 1;
|
|
28
|
-
|
|
29
|
-
// The actual protobuf definition text.
|
|
30
|
-
// Copy and paste the source protobuf definition from the `.proto` file.
|
|
31
|
-
// Only simple protobuf structures are currently supported, e.g. no imports from other packages etc.
|
|
32
|
-
string message_proto = 2;
|
|
33
|
-
|
|
34
|
-
// The name of the message within `message_proto` above that represents the data to be sync'd, e.g. `TCPDumpPacket`.
|
|
35
|
-
string message_name = 3;
|
|
36
|
-
|
|
37
|
-
// The name of the table within the target database into which the message data for this type should be written.
|
|
38
|
-
string table_name = 4;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// This message is written at the beginning of every file to be ingested using the `protoDbSync` utility.
|
|
42
|
-
// It contains a `header` entry for each message type that may appear in the file.
|
|
43
|
-
// If the `volt logger` command is used, it will create this header automatically based on the configuration it's given.
|
|
44
|
-
message ProtobufSyncConfigurationHeader {
|
|
45
|
-
// This should ideally be a persistent UUID, at minimum it must be unique within the set of types of file any given instance of `protoDbSync` is processing in a given folder.
|
|
46
|
-
// It is used to match up orphaned or split packets that might occur when receiving data from a wire, for example, if a log file is rotated midway through a packet arriving on the wire.
|
|
47
|
-
// This id should persist for the life time of the set of data it describes, i.e. if a wire publication is stopped and restarted at some later point, the same id should be used if possible.
|
|
48
|
-
string id = 1;
|
|
49
|
-
|
|
50
|
-
// The set of possible configurations that can appear in any given protobuf sync data file.
|
|
51
|
-
// A serialised instance of this message must appear at the top of each data file.
|
|
52
|
-
// Each subsequent serialised message in the data file must be an instance of `ProtobufSyncWrapper`, and the `header_lookup` field refers to an entry in this list.
|
|
53
|
-
repeated ProtobufSyncConfiguration configuration = 2;
|
|
54
|
-
|
|
55
|
-
// Optional maximum size of the serialised messages, this doesn't need to be exact and the default is 64K if omitted.
|
|
56
|
-
int32 maximum_message_size = 3;
|
|
57
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package tdx.volt_api.volt.v1;
|
|
4
|
-
|
|
5
|
-
import "tdx/volt_api/volt/v1/status.proto";
|
|
6
|
-
import "tdx/volt_api/volt/v1/volt.proto";
|
|
7
|
-
|
|
8
|
-
// The public Volt discovery service.
|
|
9
|
-
// This is exposed by the Volt battery over an INSECURE grpc channel.
|
|
10
|
-
// This insecurity is ameliorated by the fact that discovered Volts return signatures of their challenge code and owner credential.
|
|
11
|
-
// Note that only Volts that have explicitly set 'discoverable' in the Volt settings will be discovered.
|
|
12
|
-
service DiscoveryAPI {
|
|
13
|
-
rpc Discover(DiscoverRequest) returns (DiscoverResponse) {};
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
message DiscoverRequest {
|
|
17
|
-
// Set to require that only Volts that expose a Relay be included in the response.
|
|
18
|
-
bool require_relay = 1;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
message SignedEndpoint {
|
|
22
|
-
// The discovered Volt endpoint information.
|
|
23
|
-
tdx.volt_api.volt.v1.VoltEndpoint endpoint = 1;
|
|
24
|
-
|
|
25
|
-
// The discovered Volt's challenge code, signed by the Volt private key and base64 encoded.
|
|
26
|
-
// If a client knows the Volt challenge code by some out-of-band means, it can use the Volt public key (contained in the endpoint information above) to determine that the discovered Volt also knows the same challenge code.
|
|
27
|
-
string challenge_signature = 2;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
message DiscoverResponse {
|
|
31
|
-
tdx.volt_api.volt.v1.Status status = 1;
|
|
32
|
-
|
|
33
|
-
// A list of endpoints that match the request criteria.
|
|
34
|
-
repeated SignedEndpoint endpoint = 2;
|
|
35
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package tdx.volt_api.volt.v1;
|
|
4
|
-
|
|
5
|
-
message File {
|
|
6
|
-
string file_path = 1;
|
|
7
|
-
string absolute_path = 2;
|
|
8
|
-
string file_name = 3;
|
|
9
|
-
string extension = 4;
|
|
10
|
-
uint64 size = 5;
|
|
11
|
-
string media_type = 6;
|
|
12
|
-
bool is_directory = 7;
|
|
13
|
-
uint64 modified = 8;
|
|
14
|
-
|
|
15
|
-
string resource_id = 100;
|
|
16
|
-
string owner_resource_id = 101;
|
|
17
|
-
}
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package tdx.volt_api.volt.v1;
|
|
4
|
-
|
|
5
|
-
import "tdx/volt_api/volt/v1/status.proto";
|
|
6
|
-
import "tdx/volt_api/volt/v1/file.proto";
|
|
7
|
-
|
|
8
|
-
// The File API exposes basic file management functions.
|
|
9
|
-
service FileAPI {
|
|
10
|
-
|
|
11
|
-
// Download from file resource.
|
|
12
|
-
rpc DownloadFile(DownloadFileRequest) returns (stream DownloadFileResponse);
|
|
13
|
-
|
|
14
|
-
// Get file resource metadata.
|
|
15
|
-
rpc GetFile(GetFileRequest) returns (GetFileResponse);
|
|
16
|
-
|
|
17
|
-
// Get the content of a file.
|
|
18
|
-
// Note this rpc will fail if the size of the file content is greater than 64MB, in which case use DownloadFile instead.
|
|
19
|
-
rpc GetFileContent(GetFileContentRequest) returns (GetFileContentResponse);
|
|
20
|
-
|
|
21
|
-
// Get the file resource metadata of all descendants of a given file resource.
|
|
22
|
-
rpc GetFileDescendants(GetFileDescendantsRequest) returns (GetFileDescendantsResponse);
|
|
23
|
-
|
|
24
|
-
// Set the content of a file.
|
|
25
|
-
// Note this rpc will fail if the size of the file content is greater than 64MB, in which case use UploadFile instead.
|
|
26
|
-
rpc SetFileContent(SetFileContentRequest) returns (SetFileContentResponse);
|
|
27
|
-
|
|
28
|
-
// Upload data to a file resource.
|
|
29
|
-
rpc UploadFile(stream UploadFileRequest) returns (stream UploadFileResponse);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
message DownloadFileRequest {
|
|
33
|
-
// The id of the resource to download.
|
|
34
|
-
string resource_id = 1;
|
|
35
|
-
|
|
36
|
-
// This is required for linked folders, and represents the relative path to the source file from the base folder.
|
|
37
|
-
string file_path = 2;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// The response stream will contain one or more of the following messages.
|
|
41
|
-
// Each response message will contain one of the following fields.
|
|
42
|
-
message DownloadFileResponse {
|
|
43
|
-
oneof payload {
|
|
44
|
-
// A chunk of file data.
|
|
45
|
-
bytes block = 1;
|
|
46
|
-
|
|
47
|
-
// A status will be sent when the file is completely downloaded, or if an error occurs.
|
|
48
|
-
tdx.volt_api.volt.v1.Status status = 2;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
message GetFileRequest {
|
|
53
|
-
// The resource id of the base folder.
|
|
54
|
-
string resource_id = 1;
|
|
55
|
-
|
|
56
|
-
// Optional - the path to the file, relative to the base folder. Required for linked folders.
|
|
57
|
-
string file_path = 2;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
message GetFileResponse {
|
|
61
|
-
// Details of any error that occurred on the call.
|
|
62
|
-
tdx.volt_api.volt.v1.Status status = 1;
|
|
63
|
-
|
|
64
|
-
// The file metadata.
|
|
65
|
-
File file = 2;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
message GetFileContentRequest {
|
|
69
|
-
// The resource id of the base folder.
|
|
70
|
-
string resource_id = 1;
|
|
71
|
-
|
|
72
|
-
// Optional - the path to the file, relative to the base folder. Required for linked folders.
|
|
73
|
-
string file_path = 2;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
message GetFileContentResponse {
|
|
77
|
-
// Details of any error that occurred on the call.
|
|
78
|
-
tdx.volt_api.volt.v1.Status status = 1;
|
|
79
|
-
|
|
80
|
-
// The file content.
|
|
81
|
-
bytes content = 2;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
message GetFileDescendantsRequest {
|
|
85
|
-
// The resource id of the base folder.
|
|
86
|
-
string resource_id = 1;
|
|
87
|
-
|
|
88
|
-
// For linked files, this is the relative path to the 'parent' file from the base folder.
|
|
89
|
-
string file_path = 2;
|
|
90
|
-
|
|
91
|
-
// Optional - only match descendants of the given kind.
|
|
92
|
-
string extension = 3;
|
|
93
|
-
|
|
94
|
-
// Optional - can be used to determine if a resource is a descendant.
|
|
95
|
-
string descendant_id = 5;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
message GetFileDescendantsResponse {
|
|
99
|
-
// Details of any error that occurred on the call.
|
|
100
|
-
tdx.volt_api.volt.v1.Status status = 1;
|
|
101
|
-
|
|
102
|
-
// The list of descendants.
|
|
103
|
-
repeated File descendant = 2;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
message SetFileContentRequest {
|
|
107
|
-
// The resource id of the base folder.
|
|
108
|
-
string resource_id = 1;
|
|
109
|
-
|
|
110
|
-
// Optional - the path to the file, relative to the base folder. Required for linked folders.
|
|
111
|
-
string file_path = 2;
|
|
112
|
-
|
|
113
|
-
// Optional store name to use.
|
|
114
|
-
// If specified, this will be used to extract the extension to set as a resource 'kind', e.g. tdx:ext:json.
|
|
115
|
-
// If not specified, the extension will be taken from the name of the target resource.
|
|
116
|
-
string store_name = 3;
|
|
117
|
-
|
|
118
|
-
bytes content = 4;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
message SetFileContentResponse {
|
|
122
|
-
// Details of any error that occurred on the call.
|
|
123
|
-
tdx.volt_api.volt.v1.Status status = 1;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
message UploadFileStart {
|
|
127
|
-
// The resource to upload to, required.
|
|
128
|
-
string resource_id = 1;
|
|
129
|
-
|
|
130
|
-
// Optional store name to use.
|
|
131
|
-
// If specified, this will be used to extract the extension to set as a resource 'kind', e.g. tdx:ext:json.
|
|
132
|
-
// If not specified, the extension will be taken from the name of the target resource.
|
|
133
|
-
string store_name = 2;
|
|
134
|
-
|
|
135
|
-
// Optionally set streaming mode.
|
|
136
|
-
// When in streaming mode, data is written directly to the resource.
|
|
137
|
-
// Otherwise, data is written to a temporary file and then copied over once the upload completes successfully.
|
|
138
|
-
bool streaming_mode = 3;
|
|
139
|
-
|
|
140
|
-
// Optional, truncates the file prior to beginning the upload. This is only really relevant if 'streaming_mode' is set.
|
|
141
|
-
bool truncate = 4;
|
|
142
|
-
|
|
143
|
-
// Optional, buffer will flush after each write.
|
|
144
|
-
bool eager_flush = 5;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// One of the following fields must be present.
|
|
148
|
-
message UploadFileRequest {
|
|
149
|
-
oneof payload {
|
|
150
|
-
// Describes the file upload, should only be sent as first message.
|
|
151
|
-
UploadFileStart start = 1;
|
|
152
|
-
|
|
153
|
-
// The next block of data.
|
|
154
|
-
bytes block = 2;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
message UploadFileResponse {
|
|
159
|
-
// Details of any error that occurred on the call.
|
|
160
|
-
tdx.volt_api.volt.v1.Status status = 1;
|
|
161
|
-
|
|
162
|
-
// Reserved for internal use.
|
|
163
|
-
bool back_off = 2;
|
|
164
|
-
}
|
|
165
|
-
|