mindwire 0.1.23 → 0.1.25
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/dist/cli.js +23 -3
- package/dist/cli.js.map +1 -1
- package/dist/computer.d.ts +16 -0
- package/dist/index.cjs +12 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/computer.d.ts
CHANGED
|
@@ -53,6 +53,15 @@ export interface ComputerInfo {
|
|
|
53
53
|
apiAddress: string;
|
|
54
54
|
sshPort: number;
|
|
55
55
|
websocketPort: number;
|
|
56
|
+
portForwardingVersion?: number;
|
|
57
|
+
}
|
|
58
|
+
export interface ComputerForwardRequest {
|
|
59
|
+
id: string;
|
|
60
|
+
deviceId: string;
|
|
61
|
+
port: number;
|
|
62
|
+
}
|
|
63
|
+
export interface ComputerForward extends ComputerForwardRequest {
|
|
64
|
+
expiresAt: string;
|
|
56
65
|
}
|
|
57
66
|
/** Available only in computer mode. All calls use the existing authenticated transport. */
|
|
58
67
|
export declare class ComputerApi {
|
|
@@ -75,6 +84,13 @@ export declare class ComputerApi {
|
|
|
75
84
|
revoke(id: string): Promise<{
|
|
76
85
|
ok: boolean;
|
|
77
86
|
}>;
|
|
87
|
+
forwards(): Promise<ComputerForward[]>;
|
|
88
|
+
/** Authorize a loopback port for this paired device. Renew the same ID every 30s;
|
|
89
|
+
* grants expire after two minutes. Carry traffic using SSH direct-tcpip. */
|
|
90
|
+
forward(request: ComputerForwardRequest): Promise<ComputerForward>;
|
|
91
|
+
closeForward(id: string): Promise<{
|
|
92
|
+
ok: boolean;
|
|
93
|
+
}>;
|
|
78
94
|
}
|
|
79
95
|
/** A URI carries an invitation, not permanent credentials. Never log it to shared service logs. */
|
|
80
96
|
export declare function computerPairingURI(invitation: ComputerInvitation): string;
|
package/dist/index.cjs
CHANGED
|
@@ -924,6 +924,17 @@ var ComputerApi = class {
|
|
|
924
924
|
revoke(id) {
|
|
925
925
|
return this.client.http.request("DELETE", `/computer/devices/${encodeURIComponent(id)}`);
|
|
926
926
|
}
|
|
927
|
+
forwards() {
|
|
928
|
+
return this.client.http.request("GET", "/computer/forwards");
|
|
929
|
+
}
|
|
930
|
+
/** Authorize a loopback port for this paired device. Renew the same ID every 30s;
|
|
931
|
+
* grants expire after two minutes. Carry traffic using SSH direct-tcpip. */
|
|
932
|
+
forward(request) {
|
|
933
|
+
return this.client.http.request("POST", "/computer/forwards", { body: request });
|
|
934
|
+
}
|
|
935
|
+
closeForward(id) {
|
|
936
|
+
return this.client.http.request("DELETE", `/computer/forwards/${encodeURIComponent(id)}`);
|
|
937
|
+
}
|
|
927
938
|
};
|
|
928
939
|
function computerPairingURI(invitation) {
|
|
929
940
|
const bytes = new TextEncoder().encode(JSON.stringify(invitation));
|
|
@@ -940,7 +951,7 @@ init_errors();
|
|
|
940
951
|
init_errors();
|
|
941
952
|
|
|
942
953
|
// src/version.ts
|
|
943
|
-
var SDK_VERSION = "0.1.
|
|
954
|
+
var SDK_VERSION = "0.1.25" ;
|
|
944
955
|
|
|
945
956
|
// src/daemon-binary.ts
|
|
946
957
|
function supported(platform, arch) {
|