phirepass-channel 0.1.293 → 0.1.295
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 +1 -1
- package/phirepass-channel.d.ts +18 -4
- package/phirepass-channel.js +45 -15
- package/phirepass-channel_bg.wasm +0 -0
package/package.json
CHANGED
package/phirepass-channel.d.ts
CHANGED
|
@@ -20,6 +20,11 @@ export class Channel {
|
|
|
20
20
|
on_protocol_message_type(frame_type: string, cb?: Function | null): void;
|
|
21
21
|
open_sftp_tunnel(node_id: string, service_id: string, username?: string | null, password?: string | null, msg_id?: number | null): void;
|
|
22
22
|
open_ssh_tunnel(node_id: string, service_id: string, username?: string | null, password?: string | null, msg_id?: number | null): void;
|
|
23
|
+
/**
|
|
24
|
+
* VNC takes no credentials: the RFB password challenge is answered by the
|
|
25
|
+
* browser's VNC client inside the tunnel itself.
|
|
26
|
+
*/
|
|
27
|
+
open_vnc_tunnel(node_id: string, service_id: string, msg_id?: number | null): void;
|
|
23
28
|
send_sftp_delete(node_id: string, sid: number, path: string, filename: string, msg_id?: number | null): void;
|
|
24
29
|
/**
|
|
25
30
|
* Send a pipelining ACK to the agent: acknowledges all chunks with index ≤ ack_up_to
|
|
@@ -34,6 +39,12 @@ export class Channel {
|
|
|
34
39
|
send_sftp_upload_start(node_id: string, sid: number, filename: string, remote_path: string, total_chunks: number, total_size: bigint, msg_id?: number | null): void;
|
|
35
40
|
send_ssh_terminal_resize(node_id: string, sid: number, cols: number, rows: number, px_width: number, px_height: number): void;
|
|
36
41
|
send_ssh_tunnel_data(node_id: string, sid: number, data: string): void;
|
|
42
|
+
/**
|
|
43
|
+
* Takes bytes rather than a string (unlike [`Channel::send_ssh_tunnel_data`]):
|
|
44
|
+
* RFB client messages are binary and would not survive a UTF-8 round trip.
|
|
45
|
+
* `Vec<u8>` arrives from JS as a `Uint8Array` with no re-encoding.
|
|
46
|
+
*/
|
|
47
|
+
send_vnc_tunnel_data(node_id: string, sid: number, data: Uint8Array): void;
|
|
37
48
|
start_heartbeat(interval_as_millis: number): void;
|
|
38
49
|
stop_heartbeat(): void;
|
|
39
50
|
update_service(node_id: string, service_id: string, kind: string, name: string | null | undefined, host: string, port: number, username?: string | null, password?: string | null, visibility?: string | null, scheme?: string | null, msg_id?: number | null): void;
|
|
@@ -50,6 +61,7 @@ export enum ErrorType {
|
|
|
50
61
|
export enum Protocol {
|
|
51
62
|
SSH = 0,
|
|
52
63
|
SFTP = 1,
|
|
64
|
+
VNC = 2,
|
|
53
65
|
}
|
|
54
66
|
|
|
55
67
|
export function version(): string;
|
|
@@ -75,6 +87,7 @@ export interface InitOutput {
|
|
|
75
87
|
readonly channel_on_protocol_message_type: (a: number, b: number, c: number, d: number) => void;
|
|
76
88
|
readonly channel_open_sftp_tunnel: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
77
89
|
readonly channel_open_ssh_tunnel: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
90
|
+
readonly channel_open_vnc_tunnel: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
78
91
|
readonly channel_send_sftp_delete: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
79
92
|
readonly channel_send_sftp_download_ack: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
80
93
|
readonly channel_send_sftp_download_chunk: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
@@ -84,14 +97,15 @@ export interface InitOutput {
|
|
|
84
97
|
readonly channel_send_sftp_upload_start: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: bigint, k: number) => void;
|
|
85
98
|
readonly channel_send_ssh_terminal_resize: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
86
99
|
readonly channel_send_ssh_tunnel_data: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
100
|
+
readonly channel_send_vnc_tunnel_data: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
87
101
|
readonly channel_start_heartbeat: (a: number, b: number) => void;
|
|
88
102
|
readonly channel_stop_heartbeat: (a: number) => void;
|
|
89
103
|
readonly channel_update_service: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number) => void;
|
|
90
104
|
readonly version: (a: number) => void;
|
|
91
|
-
readonly
|
|
92
|
-
readonly
|
|
93
|
-
readonly
|
|
94
|
-
readonly
|
|
105
|
+
readonly __wasm_bindgen_func_elem_59: (a: number, b: number, c: number) => void;
|
|
106
|
+
readonly __wasm_bindgen_func_elem_59_1: (a: number, b: number, c: number) => void;
|
|
107
|
+
readonly __wasm_bindgen_func_elem_59_2: (a: number, b: number, c: number) => void;
|
|
108
|
+
readonly __wasm_bindgen_func_elem_63: (a: number, b: number) => void;
|
|
95
109
|
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
96
110
|
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
97
111
|
readonly __wbindgen_export3: (a: number) => void;
|
package/phirepass-channel.js
CHANGED
|
@@ -178,6 +178,20 @@ export class Channel {
|
|
|
178
178
|
var len3 = WASM_VECTOR_LEN;
|
|
179
179
|
wasm.channel_open_ssh_tunnel(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
180
180
|
}
|
|
181
|
+
/**
|
|
182
|
+
* VNC takes no credentials: the RFB password challenge is answered by the
|
|
183
|
+
* browser's VNC client inside the tunnel itself.
|
|
184
|
+
* @param {string} node_id
|
|
185
|
+
* @param {string} service_id
|
|
186
|
+
* @param {number | null} [msg_id]
|
|
187
|
+
*/
|
|
188
|
+
open_vnc_tunnel(node_id, service_id, msg_id) {
|
|
189
|
+
const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
190
|
+
const len0 = WASM_VECTOR_LEN;
|
|
191
|
+
const ptr1 = passStringToWasm0(service_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
192
|
+
const len1 = WASM_VECTOR_LEN;
|
|
193
|
+
wasm.channel_open_vnc_tunnel(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
194
|
+
}
|
|
181
195
|
/**
|
|
182
196
|
* @param {string} node_id
|
|
183
197
|
* @param {number} sid
|
|
@@ -308,6 +322,21 @@ export class Channel {
|
|
|
308
322
|
const len1 = WASM_VECTOR_LEN;
|
|
309
323
|
wasm.channel_send_ssh_tunnel_data(this.__wbg_ptr, ptr0, len0, sid, ptr1, len1);
|
|
310
324
|
}
|
|
325
|
+
/**
|
|
326
|
+
* Takes bytes rather than a string (unlike [`Channel::send_ssh_tunnel_data`]):
|
|
327
|
+
* RFB client messages are binary and would not survive a UTF-8 round trip.
|
|
328
|
+
* `Vec<u8>` arrives from JS as a `Uint8Array` with no re-encoding.
|
|
329
|
+
* @param {string} node_id
|
|
330
|
+
* @param {number} sid
|
|
331
|
+
* @param {Uint8Array} data
|
|
332
|
+
*/
|
|
333
|
+
send_vnc_tunnel_data(node_id, sid, data) {
|
|
334
|
+
const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
335
|
+
const len0 = WASM_VECTOR_LEN;
|
|
336
|
+
const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_export);
|
|
337
|
+
const len1 = WASM_VECTOR_LEN;
|
|
338
|
+
wasm.channel_send_vnc_tunnel_data(this.__wbg_ptr, ptr0, len0, sid, ptr1, len1);
|
|
339
|
+
}
|
|
311
340
|
/**
|
|
312
341
|
* @param {number} interval_as_millis
|
|
313
342
|
*/
|
|
@@ -366,11 +395,12 @@ export const ErrorType = Object.freeze({
|
|
|
366
395
|
});
|
|
367
396
|
|
|
368
397
|
/**
|
|
369
|
-
* @enum {0 | 1}
|
|
398
|
+
* @enum {0 | 1 | 2}
|
|
370
399
|
*/
|
|
371
400
|
export const Protocol = Object.freeze({
|
|
372
401
|
SSH: 0, "0": "SSH",
|
|
373
402
|
SFTP: 1, "1": "SFTP",
|
|
403
|
+
VNC: 2, "2": "VNC",
|
|
374
404
|
});
|
|
375
405
|
|
|
376
406
|
/**
|
|
@@ -461,7 +491,7 @@ function __wbg_get_imports() {
|
|
|
461
491
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
462
492
|
return addHeapObject(ret);
|
|
463
493
|
}, arguments); },
|
|
464
|
-
|
|
494
|
+
__wbg_info_126a81f879b26b73: function(arg0, arg1) {
|
|
465
495
|
console.info(getStringFromWasm0(arg0, arg1));
|
|
466
496
|
},
|
|
467
497
|
__wbg_instanceof_ArrayBuffer_4480b9e0068a8adb: function(arg0) {
|
|
@@ -533,27 +563,27 @@ function __wbg_get_imports() {
|
|
|
533
563
|
__wbg_set_onopen_4f65470ae522a61a: function(arg0, arg1) {
|
|
534
564
|
getObject(arg0).onopen = getObject(arg1);
|
|
535
565
|
},
|
|
536
|
-
|
|
566
|
+
__wbg_warn_a34cc328d5dc529a: function(arg0, arg1) {
|
|
537
567
|
console.warn(getStringFromWasm0(arg0, arg1));
|
|
538
568
|
},
|
|
539
569
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
540
570
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 1, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
541
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
571
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_59);
|
|
542
572
|
return addHeapObject(ret);
|
|
543
573
|
},
|
|
544
574
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
545
575
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 1, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
546
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
576
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_59_1);
|
|
547
577
|
return addHeapObject(ret);
|
|
548
578
|
},
|
|
549
579
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
550
580
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 1, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
551
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
581
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_59_2);
|
|
552
582
|
return addHeapObject(ret);
|
|
553
583
|
},
|
|
554
584
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
555
585
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 5, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
556
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
586
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_63);
|
|
557
587
|
return addHeapObject(ret);
|
|
558
588
|
},
|
|
559
589
|
__wbindgen_cast_0000000000000005: function(arg0) {
|
|
@@ -590,20 +620,20 @@ function __wbg_get_imports() {
|
|
|
590
620
|
};
|
|
591
621
|
}
|
|
592
622
|
|
|
593
|
-
function
|
|
594
|
-
wasm.
|
|
623
|
+
function __wasm_bindgen_func_elem_63(arg0, arg1) {
|
|
624
|
+
wasm.__wasm_bindgen_func_elem_63(arg0, arg1);
|
|
595
625
|
}
|
|
596
626
|
|
|
597
|
-
function
|
|
598
|
-
wasm.
|
|
627
|
+
function __wasm_bindgen_func_elem_59(arg0, arg1, arg2) {
|
|
628
|
+
wasm.__wasm_bindgen_func_elem_59(arg0, arg1, addHeapObject(arg2));
|
|
599
629
|
}
|
|
600
630
|
|
|
601
|
-
function
|
|
602
|
-
wasm.
|
|
631
|
+
function __wasm_bindgen_func_elem_59_1(arg0, arg1, arg2) {
|
|
632
|
+
wasm.__wasm_bindgen_func_elem_59_1(arg0, arg1, addHeapObject(arg2));
|
|
603
633
|
}
|
|
604
634
|
|
|
605
|
-
function
|
|
606
|
-
wasm.
|
|
635
|
+
function __wasm_bindgen_func_elem_59_2(arg0, arg1, arg2) {
|
|
636
|
+
wasm.__wasm_bindgen_func_elem_59_2(arg0, arg1, addHeapObject(arg2));
|
|
607
637
|
}
|
|
608
638
|
|
|
609
639
|
|
|
Binary file
|