@tdxvolt/volt-client-grpc 0.16.0-beta.10 → 0.16.0-beta.13

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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.16.0-beta.10",
6
+ "version": "0.16.0-beta.13",
7
7
  "description": "tdx Volt library for nodejs clients",
8
8
  "type": "module",
9
9
  "exports": {
@@ -37,15 +37,13 @@
37
37
  "license": "ISC",
38
38
  "dependencies": {
39
39
  "@grpc/proto-loader": "^0.6.4",
40
+ "@tdxvolt/volt-client-web": "^0.16.0-beta.11",
40
41
  "bent": "^7.3.12",
41
- "bs58": "^4.0.1",
42
42
  "builtin-modules": "^3.3.0",
43
43
  "debug": "^4.1.1",
44
44
  "ip": "^1.1.5",
45
45
  "jsonwebtoken": "^8.5.1",
46
46
  "lodash": "^4.17.15",
47
- "minimist": "^1.2.0",
48
- "node-forge": "^1.3.1",
49
47
  "uuid": "^8.1.0"
50
48
  }
51
49
  }
@@ -38,23 +38,53 @@ message SqlBulkUpdateResponse {
38
38
  tdx.volt_api.volt.v1.Status status = 1;
39
39
  }
40
40
 
41
- // The initial request should include the `database_id` and `statement` fields and an optional `page_size` for SELECT statements.
42
- // To retrieve subsequent pages, send another request with just the `page_size` field set.
43
- message SqlExecuteRequest {
44
- // The id of the database to execute the statement on, only necessary on the first request message.
41
+ message SqlExecuteStart {
42
+ // The id of the database to execute on.
45
43
  string database_id = 1;
46
44
 
47
- // The SQL statement to execute, only necessary on the first request message.
48
- string statement = 2;
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;
49
50
 
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.
51
- uint32 page_size = 3;
52
+ uint32 page_size = 4;
52
53
 
53
- // The values to set for each parameter defined in a database query.
54
- // This field is only relevant to 'query' databases, i.e. those with kind `tdx:sqlite-query`.
55
- // The values in the map should be keyed by parameter name.
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.
56
62
  // A query may have no parameters defined, in which case leave this field empty.
57
- map<string, tdx.volt_api.volt.v1.AttributeValue> parameter = 4;
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
+ }
58
88
  }
59
89
 
60
90
  // One of the following fields will be present in any given message.
@@ -89,6 +119,9 @@ message SqlImportCSVConfiguration {
89
119
 
90
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.
91
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;
92
125
  }
93
126
 
94
127
  // Each message must contain one and only one of the following fields.
@@ -97,11 +130,14 @@ message SqlImportCSVRequest {
97
130
  // The initial request must contain the configuration parameters for the import.
98
131
  SqlImportCSVConfiguration configuration = 1;
99
132
 
133
+ // Set to indicate that the upload is complete.
134
+ bool upload_complete = 2;
135
+
100
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.
101
- bytes block = 2;
137
+ bytes block = 3;
102
138
 
103
139
  // Set to abort the import.
104
- bool abort = 3;
140
+ bool abort = 4;
105
141
  }
106
142
  }
107
143
 
@@ -35,6 +35,9 @@ message CreateDatabaseRequest {
35
35
  // Each alias must be unique to the Volt, this is enforced by the API.
36
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
37
  repeated string alias = 7;
38
+
39
+ // Optional description of the database.
40
+ string description = 8;
38
41
  }
39
42
 
40
43
  message CreateDatabaseResponse {
@@ -25,10 +25,6 @@ message SignedEndpoint {
25
25
  // The discovered Volt's challenge code, signed by the Volt private key and base64 encoded.
26
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
27
  string challenge_signature = 2;
28
-
29
- // The discovered Volt's owner credential, signed by the Volt private key and base64 encoded.
30
- // A client can use this to discover all Volts owned by a specific user.
31
- string owner_credential_signature = 4;
32
28
  }
33
29
 
34
30
  message DiscoverResponse {
@@ -4,37 +4,63 @@ package tdx.volt_api.volt.v1;
4
4
 
5
5
  message DIDRegistryUpdate {
6
6
  // The id of the update.
7
- // This is populated and maintained by the Volt.
7
+ // Reserved for internal use.
8
8
  uint64 id = 1;
9
9
 
10
10
  // The id of the identity.
11
11
  string did = 2;
12
12
 
13
- // The type of update.
13
+ // The type of update, either "add", "update" or "delete".
14
14
  string operation = 3;
15
15
 
16
16
  // The DID document contained in the update.
17
17
  string document = 4;
18
18
 
19
- // The signature extracted from the DID document.
20
- string signature = 5;
19
+ // The hash of DID document.
20
+ // This is for internal use in comparisons.
21
+ string hash = 5;
21
22
 
22
23
  // The signature of the update.
23
24
  string update_signature = 6;
24
25
 
26
+ // The timestamp of this update.
25
27
  uint64 timestamp = 7;
26
28
 
27
29
  // The vector clocks for this DID.
28
30
  // The vector clocks are a map of the peer ID to the id of the last update received for this DID.
29
31
  map<string, uint64> vector_clock = 8;
30
32
 
33
+ // The id of the Volt that first created this DID.
31
34
  string origin_volt = 9;
32
35
 
36
+ // Optional description of this document, this is not part of the DID document or signature.
33
37
  string description = 10;
34
38
  }
35
39
 
36
40
  message VerifiablePresentation {
37
- string credential = 1;
41
+ // The credential JSON.
42
+ string credential_json = 1;
43
+
44
+ // A signature of the credential JSON. The signature should usually be that of the credential subject.
38
45
  string signature = 2;
39
46
  }
40
47
 
48
+ message VerifiableCredential {
49
+ // The credential id. Leave empty when creating a new credential.
50
+ string id = 1;
51
+
52
+ // The credential status, either "pending", "verified", or "revoked".
53
+ string status = 2;
54
+
55
+ // The credential types.
56
+ repeated string type = 3;
57
+
58
+ // The DID of the issuer.
59
+ string issuer_id = 4;
60
+
61
+ // The JSON of the credential subject.
62
+ string subject_json = 5;
63
+
64
+ // The full JSON of the credential.
65
+ string json = 6;
66
+ }
@@ -6,37 +6,51 @@ import "tdx/volt_api/volt/v1/ssi.proto";
6
6
  import "tdx/volt_api/volt/v1/status.proto";
7
7
 
8
8
  service SsiAPI {
9
+ // Delete a DID document or all DID documents originating from a given Volt.
10
+ // Requires 'volt:delete-did' API privilege.
9
11
  rpc DeleteDID(DeleteDIDRequest) returns (DeleteDIDResponse);
10
- rpc GetDIDDocument(GetDIDDocumentRequest) returns (GetDIDDocumentResponse);
12
+
13
+ // Get all updates to the DID registry since the specified timestamp.
14
+ // Internal use only.
11
15
  rpc GetDIDRegistryUpdates(GetDIDRegistryUpdatesRequest) returns (GetDIDRegistryUpdatesResponse);
16
+
17
+ rpc ImportCredential(ImportCredentialRequest) returns (ImportCredentialResponse);
18
+
19
+ // Parse a verifiable credential from a URL or a verifiable presentation.
12
20
  rpc ParseCredential(ParseCredentialRequest) returns (ParseCredentialResponse);
21
+
22
+ // Resolve a DID to a DID document.
13
23
  rpc ResolveDID(ResolveDIDRequest) returns (ResolveDIDResponse);
24
+
25
+ // Register a DID document.
26
+ // This is currently reserved for use by the DID registry when synchronising with other registries.
27
+ // To register a new DID document, use the VoltAPI Authenticate method.
14
28
  rpc RegisterDIDDocument(RegisterDIDDocumentRequest) returns (RegisterDIDDocumentResponse);
15
- }
16
29
 
17
- message DeleteDIDRequest {
18
- // The id of the identity to delete.
19
- string did = 1;
20
- }
30
+ // Save a verifiable credential.
31
+ rpc SaveCredential(SaveCredentialRequest) returns (SaveCredentialResponse);
21
32
 
22
- message DeleteDIDResponse {
23
- // Details of any error that occurred on the call.
24
- tdx.volt_api.volt.v1.Status status = 1;
33
+ // Search the DID registry.
34
+ rpc SearchDIDRegistry(SearchDIDRegistryRequest) returns (SearchDIDRegistryResponse);
25
35
  }
26
36
 
27
- message GetDIDDocumentRequest {
28
- // The id of the identity to retrieve.
29
- string did = 1;
37
+ message DeleteDIDRequest {
38
+ // Specify an individual DID as the target of the delete operation, or a Volt to delete all DIDs owned by that Volt.
39
+ oneof target {
40
+ // The id of the identity to delete.
41
+ string did = 1;
42
+
43
+ // Force delete of all DIDs owned by the specified Volt.
44
+ string origin_volt = 2;
45
+ }
30
46
 
31
- // If set, the search is restricted to the local registry only, otherwise all configured registries are searched.
32
- bool local_only = 2;
47
+ // Optional passphrase of the DID controller key. Required if the key is encrypted.
48
+ string key_passphrase = 3;
33
49
  }
34
50
 
35
- message GetDIDDocumentResponse {
51
+ message DeleteDIDResponse {
36
52
  // Details of any error that occurred on the call.
37
53
  tdx.volt_api.volt.v1.Status status = 1;
38
-
39
- DIDRegistryUpdate did_document = 2;
40
54
  }
41
55
 
42
56
  message GetDIDRegistryUpdatesRequest {
@@ -49,6 +63,7 @@ message GetDIDRegistryUpdatesRequest {
49
63
  // The maximum number of updates to return, defaults to 1000.
50
64
  uint32 max_updates = 2;
51
65
 
66
+ // Filter by origin volt.
52
67
  string origin_volt = 3;
53
68
  }
54
69
 
@@ -60,6 +75,52 @@ message GetDIDRegistryUpdatesResponse {
60
75
  repeated DIDRegistryUpdate update = 2;
61
76
  }
62
77
 
78
+ message ImportCredentialRequest {
79
+ // Optional id of existing credential to import into. If not specified, a new credential will be created.
80
+ string id = 1;
81
+
82
+ // The JSON representation of the credential.
83
+ string json = 2;
84
+
85
+ // Optional id of the folder resource to save the credential in. This is ignored if the id field is specified.
86
+ string create_in_parent_id = 3;
87
+
88
+ // Optional description of the credential.
89
+ string description = 4;
90
+ }
91
+
92
+ message ImportCredentialResponse {
93
+ // Details of any error that occurred on the call.
94
+ tdx.volt_api.volt.v1.Status status = 1;
95
+
96
+ // The id assigned to the credential.
97
+ string id = 2;
98
+ }
99
+
100
+ message ParseCredentialRequest {
101
+ // Details of the credential to parse.
102
+ oneof credential {
103
+ // A presentation of the verifiable credential.
104
+ // The presentation doesn't need to be signed, but if it is, the signature will be verified using the public key provided in the request.
105
+ VerifiablePresentation verifiable_presentation = 1;
106
+
107
+ // A URL to a verifiable credential.
108
+ // Not yet implemented.
109
+ string url = 2;
110
+ }
111
+
112
+ // Optional public key to use to verify the presentation signature.
113
+ string presentation_public_key = 3;
114
+ }
115
+
116
+ message ParseCredentialResponse {
117
+ // Details of any error that occurred on the call.
118
+ tdx.volt_api.volt.v1.Status status = 1;
119
+
120
+ // The parsed credential details.
121
+ VerifiableCredential verifiable_credential = 2;
122
+ }
123
+
63
124
  message ResolveDIDRequest {
64
125
  // The DID to resolve.
65
126
  string did = 1;
@@ -69,6 +130,7 @@ message ResolveDIDRequest {
69
130
  }
70
131
 
71
132
  message ResolveDIDResponse {
133
+ // Details of any error that occurred on the call.
72
134
  tdx.volt_api.volt.v1.Status status = 1;
73
135
 
74
136
  // The JSON representation of the DID document.
@@ -79,6 +141,9 @@ message ResolveDIDResponse {
79
141
 
80
142
  // The DID of the Volt that saved this version of the DID document.
81
143
  string origin_volt = 4;
144
+
145
+ // Optional description associated with the DID document.
146
+ string description = 5;
82
147
  }
83
148
 
84
149
  message RegisterDIDDocumentRequest {
@@ -99,28 +164,51 @@ message RegisterDIDDocumentResponse {
99
164
  DIDRegistryUpdate did_document = 2;
100
165
  }
101
166
 
167
+ message SaveCredentialRequest {
168
+ // A human-readable description of the credential.
169
+ string description = 1;
170
+
171
+ // Details of the credential to save.
172
+ VerifiableCredential verifiable_credential = 2;
102
173
 
103
- // Empty ATM - a VC is issued for the authenticated identity.
104
- message TrustVerifiableCredentialRequest {
174
+ // Optional id of the folder resource to save the credential in.
175
+ string create_in_parent_id = 3;
105
176
  }
106
177
 
107
- message TrustVerifiableCredentialResponse {
178
+ message SaveCredentialResponse {
179
+ // Details of any error that occurred on the call.
108
180
  tdx.volt_api.volt.v1.Status status = 1;
109
- string verifiable_credential_json = 2;
181
+
182
+ // The id assigned to the credential.
183
+ string id = 2;
184
+
185
+ // The JSON representation of the credential.
186
+ string json = 3;
110
187
  }
111
188
 
112
- message ParseCredentialRequest {
113
- oneof credential {
114
- VerifiablePresentation verifiable_presentation = 1;
115
- string url = 2;
189
+ message SearchDIDRegistryRequest {
190
+ oneof filter {
191
+ // Filter by DID itself. This is a prefix match, so searching for 'did:volt:123' will match 'did:volt:1234'. You can also exclude the 'did:volt:' prefix.
192
+ string did_filter = 1;
193
+
194
+ // Filter by the (optional) description attached to the DID document. This will match any DID document whose description contains the specified string, for example 'John' will match 'John Smith', 'Elton John' and 'Jasper Johns-Frederick'.
195
+ string description_filter = 2;
196
+
197
+ // Filter by the origin Volt. This will match any DID document whose origin Volt matches exactly the given DID.
198
+ string origin_filter = 3;
116
199
  }
117
- string public_key = 3;
200
+
201
+ // The page number to retrieve, defaults to 1.
202
+ uint32 page_number = 4;
203
+
204
+ // The number of results per page, defaults to 100.
205
+ uint32 page_size = 5;
118
206
  }
119
207
 
120
- message ParseCredentialResponse {
208
+ message SearchDIDRegistryResponse {
209
+ // Details of any error that occurred on the call.
121
210
  tdx.volt_api.volt.v1.Status status = 1;
122
- string id = 2;
123
- string issuer_id = 3;
124
- string subject_id = 4;
125
- string claim_json = 5;
211
+
212
+ // The DID documents that matched the search criteria.
213
+ repeated DIDRegistryUpdate did_document = 2;
126
214
  }
@@ -0,0 +1,42 @@
1
+ syntax = "proto3";
2
+
3
+ package tdx.volt_api.volt.v1;
4
+
5
+ import "tdx/volt_api/volt/v1/status.proto";
6
+
7
+ service TerminalAPI {
8
+ rpc CommandStream(stream CommandStreamRequest) returns (stream CommandStreamResponse);
9
+ }
10
+
11
+ message TerminalSize {
12
+ int32 rows = 1;
13
+ int32 cols = 2;
14
+ }
15
+
16
+ message Control {
17
+ string command = 1;
18
+ repeated string arg = 2;
19
+ string stop = 3;
20
+ string pause = 4;
21
+ string resume = 5;
22
+ string reset = 6;
23
+ TerminalSize terminal_size = 7;
24
+ int32 interrupt = 8;
25
+ }
26
+
27
+ message Input {
28
+ bytes data = 1;
29
+ }
30
+
31
+ message CommandStreamRequest {
32
+ oneof payload {
33
+ Control control = 1;
34
+ Input input = 2;
35
+ }
36
+ }
37
+
38
+ message CommandStreamResponse {
39
+ tdx.volt_api.volt.v1.Status status = 1;
40
+ bytes data = 2;
41
+ }
42
+