@tdxvolt/volt-client-grpc 0.19.8 → 0.19.10
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 +35 -2
- package/package.json +2 -2
- package/src/volt-connection.js +2 -2
- package/src/volt-proto-literals.js +33 -0
package/lib/index.cjs
CHANGED
|
@@ -1709,6 +1709,9 @@ message SyncDocumentStart {
|
|
|
1709
1709
|
|
|
1710
1710
|
// Set to true to only receive updates from other clients.
|
|
1711
1711
|
bool read_only = 4;
|
|
1712
|
+
|
|
1713
|
+
// Set to true to downgrade to read-only access if the client does not have write access.
|
|
1714
|
+
bool read_only_fallback = 5;
|
|
1712
1715
|
}
|
|
1713
1716
|
|
|
1714
1717
|
message SyncDocumentUpdate {
|
|
@@ -1742,6 +1745,9 @@ message SyncDocumentResponse {
|
|
|
1742
1745
|
|
|
1743
1746
|
// The sync state of the Volt (remote) document
|
|
1744
1747
|
SyncState sync_state = 4;
|
|
1748
|
+
|
|
1749
|
+
// Set to true if the client is in read-only mode. Only present in the initial response.
|
|
1750
|
+
bool is_read_only = 5;
|
|
1745
1751
|
}
|
|
1746
1752
|
|
|
1747
1753
|
message GetDocumentJSONRequest {
|
|
@@ -1765,38 +1771,56 @@ package tdx.volt_api.volt.v1;
|
|
|
1765
1771
|
import "tdx/volt_api/volt/v1/status.proto";
|
|
1766
1772
|
|
|
1767
1773
|
service TerminalAPI {
|
|
1774
|
+
// Bidirectional streaming RPC for real-time terminal control and data exchange.
|
|
1768
1775
|
rpc CommandStream(stream CommandStreamRequest) returns (stream CommandStreamResponse);
|
|
1769
1776
|
}
|
|
1770
1777
|
|
|
1771
1778
|
message TerminalSize {
|
|
1779
|
+
// The number of rows in the terminal.
|
|
1772
1780
|
int32 rows = 1;
|
|
1781
|
+
// The number of columns in the terminal.
|
|
1773
1782
|
int32 cols = 2;
|
|
1774
1783
|
}
|
|
1775
1784
|
|
|
1776
1785
|
message Control {
|
|
1786
|
+
// Optional command to execute on the terminal. If omitted, the default command is \`bash\` on linux and \`zsh\` on macos.
|
|
1777
1787
|
string command = 1;
|
|
1788
|
+
// Optional arguments to pass to the command.
|
|
1778
1789
|
repeated string arg = 2;
|
|
1790
|
+
// Not currently used.
|
|
1779
1791
|
string stop = 3;
|
|
1792
|
+
// Not currently used.
|
|
1780
1793
|
string pause = 4;
|
|
1794
|
+
// Not currently used.
|
|
1781
1795
|
string resume = 5;
|
|
1796
|
+
// Not currently used.
|
|
1782
1797
|
string reset = 6;
|
|
1798
|
+
// Optional terminal size to set.
|
|
1783
1799
|
TerminalSize terminal_size = 7;
|
|
1800
|
+
// If non-zero, a \`kill\` signal will be sent with this value to the running process.
|
|
1784
1801
|
int32 interrupt = 8;
|
|
1785
1802
|
}
|
|
1786
1803
|
|
|
1787
1804
|
message Input {
|
|
1805
|
+
// The data to send to the terminal.
|
|
1788
1806
|
bytes data = 1;
|
|
1789
1807
|
}
|
|
1790
1808
|
|
|
1809
|
+
// The request message must contain either a control message or an input message.
|
|
1791
1810
|
message CommandStreamRequest {
|
|
1792
1811
|
oneof payload {
|
|
1812
|
+
// Control messages can be used to configure and control the terminal.
|
|
1793
1813
|
Control control = 1;
|
|
1814
|
+
// Input messages are used to send data to the terminal.
|
|
1794
1815
|
Input input = 2;
|
|
1795
1816
|
}
|
|
1796
1817
|
}
|
|
1797
1818
|
|
|
1819
|
+
// The response message contains either a status message or stream of bytes.
|
|
1798
1820
|
message CommandStreamResponse {
|
|
1821
|
+
// Details of any error that occurred on the call.
|
|
1799
1822
|
tdx.volt_api.volt.v1.Status status = 1;
|
|
1823
|
+
// Bytes received from the terminal.
|
|
1800
1824
|
bytes data = 2;
|
|
1801
1825
|
}
|
|
1802
1826
|
|
|
@@ -2745,6 +2769,9 @@ message ConnectHello {
|
|
|
2745
2769
|
// Set to receive notification of resource events.
|
|
2746
2770
|
bool subscribe_resource_events = 4;
|
|
2747
2771
|
|
|
2772
|
+
// Optionally specify which resource events to subscribe to. Only valid if \`subscribe_resource_events\` is set. If omitted or empty, all resource events will be subscribed to.
|
|
2773
|
+
repeated ConnectResourceEvent resource_event_list = 17;
|
|
2774
|
+
|
|
2748
2775
|
// Set this if you are connecting to a relay, i.e. the Volt you are sending to this message is a relay.
|
|
2749
2776
|
// This indicates that you are happy to receive method invocations from clients of the Relay.
|
|
2750
2777
|
// This will usually be set to the \`id\` of your Volt, but in theory any client could receive remote invocation requests in this way.
|
|
@@ -2937,6 +2964,9 @@ message CopyResourceResponse {
|
|
|
2937
2964
|
message DeleteAccessRequest {
|
|
2938
2965
|
// The id of the access rule to delete.
|
|
2939
2966
|
string id = 1;
|
|
2967
|
+
|
|
2968
|
+
// Set to indicate all access rules for the resource should be deleted. The \`id\` field is ignored if this is set.
|
|
2969
|
+
string resource_id = 2;
|
|
2940
2970
|
}
|
|
2941
2971
|
|
|
2942
2972
|
message DeleteAccessResponse {
|
|
@@ -3373,6 +3403,9 @@ message ResourceAttributeQuery {
|
|
|
3373
3403
|
message SaveAccessRequest {
|
|
3374
3404
|
// Omit \`id\` if creating new access.
|
|
3375
3405
|
Access access = 1;
|
|
3406
|
+
|
|
3407
|
+
// Add multiple access rules in one request. The \`access\` field is ignored if this is non-empty.
|
|
3408
|
+
repeated Access access_list = 2;
|
|
3376
3409
|
}
|
|
3377
3410
|
|
|
3378
3411
|
message SaveAccessResponse {
|
|
@@ -4606,7 +4639,7 @@ function _doConnect(connectHello) {
|
|
|
4606
4639
|
this.call.on("data", (response) => {
|
|
4607
4640
|
switch (response.payload) {
|
|
4608
4641
|
case "ping": {
|
|
4609
|
-
log$3("
|
|
4642
|
+
log$3("received ping [%s]", this._voltClient.config.client_name);
|
|
4610
4643
|
|
|
4611
4644
|
// Received ping response from server => clear timeout.
|
|
4612
4645
|
if (this._pingTimeoutTimer) {
|
|
@@ -4678,7 +4711,7 @@ function _startPingTimer() {
|
|
|
4678
4711
|
// Send next ping to server.
|
|
4679
4712
|
const request = { ping: { timestamp: Date.now() } };
|
|
4680
4713
|
|
|
4681
|
-
log$3("
|
|
4714
|
+
log$3("sending ping [%s]", this._voltClient.config.client_name);
|
|
4682
4715
|
this.call.write(request);
|
|
4683
4716
|
|
|
4684
4717
|
this._pingTimer = 0;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.19.
|
|
6
|
+
"version": "0.19.10",
|
|
7
7
|
"description": "tdx Volt library for nodejs clients",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"exports": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"author": "toby.ealden@gmail.com",
|
|
34
34
|
"license": "ISC",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@tdxvolt/volt-client-web": "^0.19.
|
|
36
|
+
"@tdxvolt/volt-client-web": "^0.19.9",
|
|
37
37
|
"debug": "^4.1.1",
|
|
38
38
|
"ip": "^1.1.5",
|
|
39
39
|
"jsonwebtoken": "^8.5.1",
|
package/src/volt-connection.js
CHANGED
|
@@ -69,7 +69,7 @@ function _doConnect(connectHello) {
|
|
|
69
69
|
this.call.on("data", (response) => {
|
|
70
70
|
switch (response.payload) {
|
|
71
71
|
case "ping": {
|
|
72
|
-
log("
|
|
72
|
+
log("received ping [%s]", this._voltClient.config.client_name);
|
|
73
73
|
|
|
74
74
|
// Received ping response from server => clear timeout.
|
|
75
75
|
if (this._pingTimeoutTimer) {
|
|
@@ -141,7 +141,7 @@ function _startPingTimer() {
|
|
|
141
141
|
// Send next ping to server.
|
|
142
142
|
const request = { ping: { timestamp: Date.now() } };
|
|
143
143
|
|
|
144
|
-
log("
|
|
144
|
+
log("sending ping [%s]", this._voltClient.config.client_name);
|
|
145
145
|
this.call.write(request);
|
|
146
146
|
|
|
147
147
|
this._pingTimer = 0;
|
|
@@ -1164,6 +1164,9 @@ message SyncDocumentStart {
|
|
|
1164
1164
|
|
|
1165
1165
|
// Set to true to only receive updates from other clients.
|
|
1166
1166
|
bool read_only = 4;
|
|
1167
|
+
|
|
1168
|
+
// Set to true to downgrade to read-only access if the client does not have write access.
|
|
1169
|
+
bool read_only_fallback = 5;
|
|
1167
1170
|
}
|
|
1168
1171
|
|
|
1169
1172
|
message SyncDocumentUpdate {
|
|
@@ -1197,6 +1200,9 @@ message SyncDocumentResponse {
|
|
|
1197
1200
|
|
|
1198
1201
|
// The sync state of the Volt (remote) document
|
|
1199
1202
|
SyncState sync_state = 4;
|
|
1203
|
+
|
|
1204
|
+
// Set to true if the client is in read-only mode. Only present in the initial response.
|
|
1205
|
+
bool is_read_only = 5;
|
|
1200
1206
|
}
|
|
1201
1207
|
|
|
1202
1208
|
message GetDocumentJSONRequest {
|
|
@@ -1220,38 +1226,56 @@ package tdx.volt_api.volt.v1;
|
|
|
1220
1226
|
import "tdx/volt_api/volt/v1/status.proto";
|
|
1221
1227
|
|
|
1222
1228
|
service TerminalAPI {
|
|
1229
|
+
// Bidirectional streaming RPC for real-time terminal control and data exchange.
|
|
1223
1230
|
rpc CommandStream(stream CommandStreamRequest) returns (stream CommandStreamResponse);
|
|
1224
1231
|
}
|
|
1225
1232
|
|
|
1226
1233
|
message TerminalSize {
|
|
1234
|
+
// The number of rows in the terminal.
|
|
1227
1235
|
int32 rows = 1;
|
|
1236
|
+
// The number of columns in the terminal.
|
|
1228
1237
|
int32 cols = 2;
|
|
1229
1238
|
}
|
|
1230
1239
|
|
|
1231
1240
|
message Control {
|
|
1241
|
+
// Optional command to execute on the terminal. If omitted, the default command is \`bash\` on linux and \`zsh\` on macos.
|
|
1232
1242
|
string command = 1;
|
|
1243
|
+
// Optional arguments to pass to the command.
|
|
1233
1244
|
repeated string arg = 2;
|
|
1245
|
+
// Not currently used.
|
|
1234
1246
|
string stop = 3;
|
|
1247
|
+
// Not currently used.
|
|
1235
1248
|
string pause = 4;
|
|
1249
|
+
// Not currently used.
|
|
1236
1250
|
string resume = 5;
|
|
1251
|
+
// Not currently used.
|
|
1237
1252
|
string reset = 6;
|
|
1253
|
+
// Optional terminal size to set.
|
|
1238
1254
|
TerminalSize terminal_size = 7;
|
|
1255
|
+
// If non-zero, a \`kill\` signal will be sent with this value to the running process.
|
|
1239
1256
|
int32 interrupt = 8;
|
|
1240
1257
|
}
|
|
1241
1258
|
|
|
1242
1259
|
message Input {
|
|
1260
|
+
// The data to send to the terminal.
|
|
1243
1261
|
bytes data = 1;
|
|
1244
1262
|
}
|
|
1245
1263
|
|
|
1264
|
+
// The request message must contain either a control message or an input message.
|
|
1246
1265
|
message CommandStreamRequest {
|
|
1247
1266
|
oneof payload {
|
|
1267
|
+
// Control messages can be used to configure and control the terminal.
|
|
1248
1268
|
Control control = 1;
|
|
1269
|
+
// Input messages are used to send data to the terminal.
|
|
1249
1270
|
Input input = 2;
|
|
1250
1271
|
}
|
|
1251
1272
|
}
|
|
1252
1273
|
|
|
1274
|
+
// The response message contains either a status message or stream of bytes.
|
|
1253
1275
|
message CommandStreamResponse {
|
|
1276
|
+
// Details of any error that occurred on the call.
|
|
1254
1277
|
tdx.volt_api.volt.v1.Status status = 1;
|
|
1278
|
+
// Bytes received from the terminal.
|
|
1255
1279
|
bytes data = 2;
|
|
1256
1280
|
}
|
|
1257
1281
|
|
|
@@ -2200,6 +2224,9 @@ message ConnectHello {
|
|
|
2200
2224
|
// Set to receive notification of resource events.
|
|
2201
2225
|
bool subscribe_resource_events = 4;
|
|
2202
2226
|
|
|
2227
|
+
// Optionally specify which resource events to subscribe to. Only valid if \`subscribe_resource_events\` is set. If omitted or empty, all resource events will be subscribed to.
|
|
2228
|
+
repeated ConnectResourceEvent resource_event_list = 17;
|
|
2229
|
+
|
|
2203
2230
|
// Set this if you are connecting to a relay, i.e. the Volt you are sending to this message is a relay.
|
|
2204
2231
|
// This indicates that you are happy to receive method invocations from clients of the Relay.
|
|
2205
2232
|
// This will usually be set to the \`id\` of your Volt, but in theory any client could receive remote invocation requests in this way.
|
|
@@ -2392,6 +2419,9 @@ message CopyResourceResponse {
|
|
|
2392
2419
|
message DeleteAccessRequest {
|
|
2393
2420
|
// The id of the access rule to delete.
|
|
2394
2421
|
string id = 1;
|
|
2422
|
+
|
|
2423
|
+
// Set to indicate all access rules for the resource should be deleted. The \`id\` field is ignored if this is set.
|
|
2424
|
+
string resource_id = 2;
|
|
2395
2425
|
}
|
|
2396
2426
|
|
|
2397
2427
|
message DeleteAccessResponse {
|
|
@@ -2828,6 +2858,9 @@ message ResourceAttributeQuery {
|
|
|
2828
2858
|
message SaveAccessRequest {
|
|
2829
2859
|
// Omit \`id\` if creating new access.
|
|
2830
2860
|
Access access = 1;
|
|
2861
|
+
|
|
2862
|
+
// Add multiple access rules in one request. The \`access\` field is ignored if this is non-empty.
|
|
2863
|
+
repeated Access access_list = 2;
|
|
2831
2864
|
}
|
|
2832
2865
|
|
|
2833
2866
|
message SaveAccessResponse {
|