phirepass-widgets 0.0.112 → 0.0.114
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/README.md +33 -0
- package/dist/cjs/{index-B8w6l0VL.js → index-BCgmMoIq.js} +103 -32
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/phirepass-downloader_3.cjs.entry.js +3717 -0
- package/dist/cjs/phirepass-rdp.cjs.entry.js +18 -6
- package/dist/cjs/phirepass-terminal.cjs.entry.js +6 -5
- package/dist/cjs/phirepass-widgets.cjs.js +3 -3
- package/dist/cjs/protocol-CYh109n2.js +1472 -0
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/common/channel.js +21 -1
- package/dist/collection/common/fetch.js +44 -0
- package/dist/collection/components/phirepass-downloader/form.js +69 -0
- package/dist/collection/components/phirepass-downloader/format.js +105 -0
- package/dist/collection/components/phirepass-downloader/jobs.js +373 -0
- package/dist/collection/components/phirepass-downloader/phirepass-downloader.css +1109 -0
- package/dist/collection/components/phirepass-downloader/phirepass-downloader.js +1455 -0
- package/dist/collection/components/phirepass-downloader/source.js +120 -0
- package/dist/collection/components/phirepass-downloader/views/dialogs.js +34 -0
- package/dist/collection/components/phirepass-downloader/views/fetch-form.js +65 -0
- package/dist/collection/components/phirepass-downloader/views/icons.js +33 -0
- package/dist/collection/components/phirepass-downloader/views/job-row.js +91 -0
- package/dist/collection/components/phirepass-downloader/views/notices.js +15 -0
- package/dist/collection/components/phirepass-downloader/views/states.js +19 -0
- package/dist/collection/components/phirepass-media-player/phirepass-media-player.css +216 -0
- package/dist/collection/components/phirepass-media-player/phirepass-media-player.js +473 -0
- package/dist/collection/components/phirepass-media-player/player.js +94 -0
- package/dist/collection/components/phirepass-rdp/phirepass-rdp.js +36 -13
- package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.css +122 -0
- package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.fetch.js +35 -0
- package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.js +181 -31
- package/dist/collection/components/phirepass-terminal/phirepass-terminal.js +2 -2
- package/dist/collection/phirepass-channel_bg.wasm +0 -0
- package/dist/collection/testing/fixtures.js +219 -0
- package/dist/collection/testing/mock-channel.js +410 -0
- package/dist/components/index.js +1 -1
- package/dist/components/p-BtMWUitf.js +1 -0
- package/dist/components/p-C4cmk3bS.js +1 -0
- package/dist/components/p-CKnb-oeB.js +1 -0
- package/dist/components/phirepass-downloader.d.ts +11 -0
- package/dist/components/phirepass-downloader.js +1 -0
- package/dist/components/phirepass-media-player.d.ts +11 -0
- package/dist/components/phirepass-media-player.js +1 -0
- package/dist/components/phirepass-rdp.js +1 -1
- package/dist/components/phirepass-sftp-client.js +1 -1
- package/dist/components/phirepass-terminal.js +2 -2
- package/dist/esm/{index-DGq2b7rM.js → index-Dd9o0CbU.js} +103 -32
- package/dist/esm/loader.js +3 -3
- package/dist/esm/phirepass-downloader_3.entry.js +3713 -0
- package/dist/esm/phirepass-rdp.entry.js +18 -6
- package/dist/esm/phirepass-terminal.entry.js +6 -5
- package/dist/esm/phirepass-widgets.js +4 -4
- package/dist/esm/protocol-BtMWUitf.js +1467 -0
- package/dist/phirepass-widgets/p-97d84225.entry.js +1 -0
- package/dist/phirepass-widgets/p-BtMWUitf.js +1 -0
- package/dist/phirepass-widgets/p-Dd9o0CbU.js +3 -0
- package/dist/phirepass-widgets/p-a4a5e5f5.entry.js +1 -0
- package/dist/phirepass-widgets/{p-1fef5b5f.entry.js → p-a5ce104d.entry.js} +2 -2
- package/dist/phirepass-widgets/phirepass-channel_bg.wasm +0 -0
- package/dist/phirepass-widgets/phirepass-widgets.esm.js +1 -1
- package/dist/types/common/channel.d.ts +30 -0
- package/dist/types/common/fetch.d.ts +167 -0
- package/dist/types/components/phirepass-downloader/form.d.ts +54 -0
- package/dist/types/components/phirepass-downloader/format.d.ts +17 -0
- package/dist/types/components/phirepass-downloader/jobs.d.ts +116 -0
- package/dist/types/components/phirepass-downloader/phirepass-downloader.d.ts +231 -0
- package/dist/types/components/phirepass-downloader/source.d.ts +61 -0
- package/dist/types/components/phirepass-downloader/views/dialogs.d.ts +52 -0
- package/dist/types/components/phirepass-downloader/views/fetch-form.d.ts +31 -0
- package/dist/types/components/phirepass-downloader/views/icons.d.ts +5 -0
- package/dist/types/components/phirepass-downloader/views/job-row.d.ts +21 -0
- package/dist/types/components/phirepass-downloader/views/notices.d.ts +18 -0
- package/dist/types/components/phirepass-downloader/views/states.d.ts +38 -0
- package/dist/types/components/phirepass-media-player/phirepass-media-player.d.ts +67 -0
- package/dist/types/components/phirepass-media-player/player.d.ts +43 -0
- package/dist/types/components/phirepass-rdp/phirepass-rdp.d.ts +10 -0
- package/dist/types/components/phirepass-sftp-client/phirepass-sftp-client.d.ts +30 -0
- package/dist/types/components/phirepass-sftp-client/phirepass-sftp-client.fetch.d.ts +40 -0
- package/dist/types/components.d.ts +426 -34
- package/dist/types/stencil-public-runtime.d.ts +1 -1
- package/dist/types/testing/fixtures.d.ts +25 -0
- package/dist/types/testing/mock-channel.d.ts +132 -0
- package/package.json +26 -12
- package/dist/cjs/phirepass-sftp-client.cjs.entry.js +0 -1469
- package/dist/cjs/protocol-COvteaUJ.js +0 -1044
- package/dist/components/p-Dur4cBX7.js +0 -1
- package/dist/esm/phirepass-sftp-client.entry.js +0 -1467
- package/dist/esm/protocol-Dur4cBX7.js +0 -1039
- package/dist/phirepass-widgets/p-8eb3ec24.entry.js +0 -1
- package/dist/phirepass-widgets/p-9a1f9b9f.entry.js +0 -1
- package/dist/phirepass-widgets/p-DGq2b7rM.js +0 -3
- package/dist/phirepass-widgets/p-Dur4cBX7.js +0 -1
|
@@ -0,0 +1,1467 @@
|
|
|
1
|
+
/* @ts-self-types="./phirepass-channel.d.ts" */
|
|
2
|
+
|
|
3
|
+
class Channel {
|
|
4
|
+
__destroy_into_raw() {
|
|
5
|
+
const ptr = this.__wbg_ptr;
|
|
6
|
+
this.__wbg_ptr = 0;
|
|
7
|
+
ChannelFinalization.unregister(this);
|
|
8
|
+
return ptr;
|
|
9
|
+
}
|
|
10
|
+
free() {
|
|
11
|
+
const ptr = this.__destroy_into_raw();
|
|
12
|
+
wasm.__wbg_channel_free(ptr, 0);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @param {string} token
|
|
16
|
+
* @param {string} node_id
|
|
17
|
+
* @param {number | null} [msg_id]
|
|
18
|
+
*/
|
|
19
|
+
authenticate(token, node_id, msg_id) {
|
|
20
|
+
const val3 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
21
|
+
let ptr0, len0, ptr1, len1;
|
|
22
|
+
try {
|
|
23
|
+
ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
24
|
+
len0 = WASM_VECTOR_LEN;
|
|
25
|
+
ptr1 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
26
|
+
len1 = WASM_VECTOR_LEN;
|
|
27
|
+
} catch (e) {
|
|
28
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
29
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
30
|
+
throw e;
|
|
31
|
+
}
|
|
32
|
+
wasm.channel_authenticate(this.__wbg_ptr, ptr0, len0, ptr1, len1, val3);
|
|
33
|
+
}
|
|
34
|
+
connect() {
|
|
35
|
+
wasm.channel_connect(this.__wbg_ptr);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @param {string} node_id
|
|
39
|
+
* @param {string} kind
|
|
40
|
+
* @param {string | null | undefined} name
|
|
41
|
+
* @param {string} host
|
|
42
|
+
* @param {number} port
|
|
43
|
+
* @param {string | null} [username]
|
|
44
|
+
* @param {string | null} [password]
|
|
45
|
+
* @param {string | null} [scheme]
|
|
46
|
+
* @param {number | null} [msg_id]
|
|
47
|
+
*/
|
|
48
|
+
create_service(node_id, kind, name, host, port, username, password, scheme, msg_id) {
|
|
49
|
+
const val8 = +port;
|
|
50
|
+
const val9 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
51
|
+
let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6;
|
|
52
|
+
try {
|
|
53
|
+
ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
54
|
+
len0 = WASM_VECTOR_LEN;
|
|
55
|
+
ptr1 = passStringToWasm0(kind, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
56
|
+
len1 = WASM_VECTOR_LEN;
|
|
57
|
+
ptr2 = isLikeNone(name) ? 0 : passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
58
|
+
len2 = WASM_VECTOR_LEN;
|
|
59
|
+
ptr3 = passStringToWasm0(host, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
60
|
+
len3 = WASM_VECTOR_LEN;
|
|
61
|
+
ptr4 = isLikeNone(username) ? 0 : passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
62
|
+
len4 = WASM_VECTOR_LEN;
|
|
63
|
+
ptr5 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
64
|
+
len5 = WASM_VECTOR_LEN;
|
|
65
|
+
ptr6 = isLikeNone(scheme) ? 0 : passStringToWasm0(scheme, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
66
|
+
len6 = WASM_VECTOR_LEN;
|
|
67
|
+
} catch (e) {
|
|
68
|
+
if (ptr6) { wasm.__wbindgen_export3(ptr6, len6 * 1, 1); }
|
|
69
|
+
if (ptr5) { wasm.__wbindgen_export3(ptr5, len5 * 1, 1); }
|
|
70
|
+
if (ptr4) { wasm.__wbindgen_export3(ptr4, len4 * 1, 1); }
|
|
71
|
+
if (ptr3) { wasm.__wbindgen_export3(ptr3, len3 * 1, 1); }
|
|
72
|
+
if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
|
|
73
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
74
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
75
|
+
throw e;
|
|
76
|
+
}
|
|
77
|
+
wasm.channel_create_service(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, val8, ptr4, len4, ptr5, len5, ptr6, len6, val9);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* @param {string} node_id
|
|
81
|
+
* @param {string} id
|
|
82
|
+
* @param {number | null} [msg_id]
|
|
83
|
+
*/
|
|
84
|
+
delete_service(node_id, id, msg_id) {
|
|
85
|
+
const val3 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
86
|
+
let ptr0, len0, ptr1, len1;
|
|
87
|
+
try {
|
|
88
|
+
ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
89
|
+
len0 = WASM_VECTOR_LEN;
|
|
90
|
+
ptr1 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
91
|
+
len1 = WASM_VECTOR_LEN;
|
|
92
|
+
} catch (e) {
|
|
93
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
94
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
95
|
+
throw e;
|
|
96
|
+
}
|
|
97
|
+
wasm.channel_delete_service(this.__wbg_ptr, ptr0, len0, ptr1, len1, val3);
|
|
98
|
+
}
|
|
99
|
+
disconnect() {
|
|
100
|
+
wasm.channel_disconnect(this.__wbg_ptr);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* @returns {boolean}
|
|
104
|
+
*/
|
|
105
|
+
is_connected() {
|
|
106
|
+
const ret = wasm.channel_is_connected(this.__wbg_ptr);
|
|
107
|
+
return ret !== 0;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* @returns {boolean}
|
|
111
|
+
*/
|
|
112
|
+
is_disconnected() {
|
|
113
|
+
const ret = wasm.channel_is_disconnected(this.__wbg_ptr);
|
|
114
|
+
return ret !== 0;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* @param {string} endpoint
|
|
118
|
+
* @param {string} node_id
|
|
119
|
+
* @param {string | null} [server_id]
|
|
120
|
+
*/
|
|
121
|
+
constructor(endpoint, node_id, server_id) {
|
|
122
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
123
|
+
try {
|
|
124
|
+
ptr0 = passStringToWasm0(endpoint, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
125
|
+
len0 = WASM_VECTOR_LEN;
|
|
126
|
+
ptr1 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
127
|
+
len1 = WASM_VECTOR_LEN;
|
|
128
|
+
ptr2 = isLikeNone(server_id) ? 0 : passStringToWasm0(server_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
129
|
+
len2 = WASM_VECTOR_LEN;
|
|
130
|
+
} catch (e) {
|
|
131
|
+
if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
|
|
132
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
133
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
134
|
+
throw e;
|
|
135
|
+
}
|
|
136
|
+
const ret = wasm.channel_new(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
137
|
+
this.__wbg_ptr = ret;
|
|
138
|
+
ChannelFinalization.register(this, this.__wbg_ptr, this);
|
|
139
|
+
return this;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* @param {Function | null} [cb]
|
|
143
|
+
*/
|
|
144
|
+
on_connection_close(cb) {
|
|
145
|
+
wasm.channel_on_connection_close(this.__wbg_ptr, isLikeNone(cb) ? 0 : addToExternrefTable0(cb));
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* @param {Function | null} [cb]
|
|
149
|
+
*/
|
|
150
|
+
on_connection_error(cb) {
|
|
151
|
+
wasm.channel_on_connection_error(this.__wbg_ptr, isLikeNone(cb) ? 0 : addToExternrefTable0(cb));
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* @param {Function | null} [cb]
|
|
155
|
+
*/
|
|
156
|
+
on_connection_message(cb) {
|
|
157
|
+
wasm.channel_on_connection_message(this.__wbg_ptr, isLikeNone(cb) ? 0 : addToExternrefTable0(cb));
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* @param {Function | null} [cb]
|
|
161
|
+
*/
|
|
162
|
+
on_connection_open(cb) {
|
|
163
|
+
wasm.channel_on_connection_open(this.__wbg_ptr, isLikeNone(cb) ? 0 : addToExternrefTable0(cb));
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* @param {Function | null} [cb]
|
|
167
|
+
*/
|
|
168
|
+
on_protocol_message(cb) {
|
|
169
|
+
wasm.channel_on_protocol_message(this.__wbg_ptr, isLikeNone(cb) ? 0 : addToExternrefTable0(cb));
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* @param {string} frame_type
|
|
173
|
+
* @param {Function | null} [cb]
|
|
174
|
+
*/
|
|
175
|
+
on_protocol_message_type(frame_type, cb) {
|
|
176
|
+
const ptr0 = passStringToWasm0(frame_type, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
177
|
+
const len0 = WASM_VECTOR_LEN;
|
|
178
|
+
wasm.channel_on_protocol_message_type(this.__wbg_ptr, ptr0, len0, isLikeNone(cb) ? 0 : addToExternrefTable0(cb));
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Requests an RDP tunnel. Credentials are validated by the agent but are
|
|
182
|
+
* not used to log in: CredSSP runs in the browser's own RDP client, inside
|
|
183
|
+
* the tunnel.
|
|
184
|
+
*
|
|
185
|
+
* Unlike the other protocols this does **not** yield a `TunnelOpened`.
|
|
186
|
+
* The answer is an `RDPAuthorized` frame carrying a `sid` and a single-use
|
|
187
|
+
* `ticket`; the RDP client then opens its own socket at
|
|
188
|
+
* `/api/web/rdp/{node_id}` and presents that ticket in its RDCleanPath
|
|
189
|
+
* request. No tunnel data for an RDP session ever crosses *this* channel.
|
|
190
|
+
* @param {string} node_id
|
|
191
|
+
* @param {string} service_id
|
|
192
|
+
* @param {string | null} [username]
|
|
193
|
+
* @param {string | null} [password]
|
|
194
|
+
* @param {number | null} [msg_id]
|
|
195
|
+
*/
|
|
196
|
+
open_rdp_tunnel(node_id, service_id, username, password, msg_id) {
|
|
197
|
+
const val5 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
198
|
+
let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
|
|
199
|
+
try {
|
|
200
|
+
ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
201
|
+
len0 = WASM_VECTOR_LEN;
|
|
202
|
+
ptr1 = passStringToWasm0(service_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
203
|
+
len1 = WASM_VECTOR_LEN;
|
|
204
|
+
ptr2 = isLikeNone(username) ? 0 : passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
205
|
+
len2 = WASM_VECTOR_LEN;
|
|
206
|
+
ptr3 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
207
|
+
len3 = WASM_VECTOR_LEN;
|
|
208
|
+
} catch (e) {
|
|
209
|
+
if (ptr3) { wasm.__wbindgen_export3(ptr3, len3 * 1, 1); }
|
|
210
|
+
if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
|
|
211
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
212
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
213
|
+
throw e;
|
|
214
|
+
}
|
|
215
|
+
wasm.channel_open_rdp_tunnel(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, val5);
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* @param {string} node_id
|
|
219
|
+
* @param {string} service_id
|
|
220
|
+
* @param {string | null} [username]
|
|
221
|
+
* @param {string | null} [password]
|
|
222
|
+
* @param {number | null} [msg_id]
|
|
223
|
+
*/
|
|
224
|
+
open_sftp_tunnel(node_id, service_id, username, password, msg_id) {
|
|
225
|
+
const val5 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
226
|
+
let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
|
|
227
|
+
try {
|
|
228
|
+
ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
229
|
+
len0 = WASM_VECTOR_LEN;
|
|
230
|
+
ptr1 = passStringToWasm0(service_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
231
|
+
len1 = WASM_VECTOR_LEN;
|
|
232
|
+
ptr2 = isLikeNone(username) ? 0 : passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
233
|
+
len2 = WASM_VECTOR_LEN;
|
|
234
|
+
ptr3 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
235
|
+
len3 = WASM_VECTOR_LEN;
|
|
236
|
+
} catch (e) {
|
|
237
|
+
if (ptr3) { wasm.__wbindgen_export3(ptr3, len3 * 1, 1); }
|
|
238
|
+
if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
|
|
239
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
240
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
241
|
+
throw e;
|
|
242
|
+
}
|
|
243
|
+
wasm.channel_open_sftp_tunnel(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, val5);
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* @param {string} node_id
|
|
247
|
+
* @param {string} service_id
|
|
248
|
+
* @param {string | null} [username]
|
|
249
|
+
* @param {string | null} [password]
|
|
250
|
+
* @param {number | null} [msg_id]
|
|
251
|
+
*/
|
|
252
|
+
open_ssh_tunnel(node_id, service_id, username, password, msg_id) {
|
|
253
|
+
const val5 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
254
|
+
let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
|
|
255
|
+
try {
|
|
256
|
+
ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
257
|
+
len0 = WASM_VECTOR_LEN;
|
|
258
|
+
ptr1 = passStringToWasm0(service_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
259
|
+
len1 = WASM_VECTOR_LEN;
|
|
260
|
+
ptr2 = isLikeNone(username) ? 0 : passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
261
|
+
len2 = WASM_VECTOR_LEN;
|
|
262
|
+
ptr3 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
263
|
+
len3 = WASM_VECTOR_LEN;
|
|
264
|
+
} catch (e) {
|
|
265
|
+
if (ptr3) { wasm.__wbindgen_export3(ptr3, len3 * 1, 1); }
|
|
266
|
+
if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
|
|
267
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
268
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
269
|
+
throw e;
|
|
270
|
+
}
|
|
271
|
+
wasm.channel_open_ssh_tunnel(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, val5);
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* @param {string} download_id
|
|
275
|
+
* @param {boolean} delete_file
|
|
276
|
+
* @param {number | null} [msg_id]
|
|
277
|
+
*/
|
|
278
|
+
send_download_delete(download_id, delete_file, msg_id) {
|
|
279
|
+
const val2 = +delete_file;
|
|
280
|
+
const val3 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
281
|
+
const ptr0 = passStringToWasm0(download_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
282
|
+
const len0 = WASM_VECTOR_LEN;
|
|
283
|
+
wasm.channel_send_download_delete(this.__wbg_ptr, ptr0, len0, val2, val3);
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* @param {string} download_id
|
|
287
|
+
* @param {boolean} ignore_window
|
|
288
|
+
* @param {number | null} [msg_id]
|
|
289
|
+
*/
|
|
290
|
+
send_download_resume(download_id, ignore_window, msg_id) {
|
|
291
|
+
const val2 = +ignore_window;
|
|
292
|
+
const val3 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
293
|
+
const ptr0 = passStringToWasm0(download_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
294
|
+
const len0 = WASM_VECTOR_LEN;
|
|
295
|
+
wasm.channel_send_download_resume(this.__wbg_ptr, ptr0, len0, val2, val3);
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* @param {string} download_id
|
|
299
|
+
* @param {boolean} in_order
|
|
300
|
+
* @param {number | null} [msg_id]
|
|
301
|
+
*/
|
|
302
|
+
send_download_set_order(download_id, in_order, msg_id) {
|
|
303
|
+
const val2 = +in_order;
|
|
304
|
+
const val3 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
305
|
+
const ptr0 = passStringToWasm0(download_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
306
|
+
const len0 = WASM_VECTOR_LEN;
|
|
307
|
+
wasm.channel_send_download_set_order(this.__wbg_ptr, ptr0, len0, val2, val3);
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* @param {string} node_id
|
|
311
|
+
* @param {number | null} [msg_id]
|
|
312
|
+
*/
|
|
313
|
+
send_download_settings_get(node_id, msg_id) {
|
|
314
|
+
const val2 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
315
|
+
const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
316
|
+
const len0 = WASM_VECTOR_LEN;
|
|
317
|
+
wasm.channel_send_download_settings_get(this.__wbg_ptr, ptr0, len0, val2);
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* @param {string} node_id
|
|
321
|
+
* @param {any} settings
|
|
322
|
+
* @param {number | null} [msg_id]
|
|
323
|
+
*/
|
|
324
|
+
send_download_settings_save(node_id, settings, msg_id) {
|
|
325
|
+
const val2 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
326
|
+
const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
327
|
+
const len0 = WASM_VECTOR_LEN;
|
|
328
|
+
wasm.channel_send_download_settings_save(this.__wbg_ptr, ptr0, len0, settings, val2);
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* @param {string} node_id
|
|
332
|
+
* @param {any} source
|
|
333
|
+
* @param {string | null | undefined} sub_dir
|
|
334
|
+
* @param {any} browsing
|
|
335
|
+
* @param {boolean | null | undefined} in_order
|
|
336
|
+
* @param {any} options
|
|
337
|
+
* @param {number | null} [msg_id]
|
|
338
|
+
*/
|
|
339
|
+
send_download_start(node_id, source, sub_dir, browsing, in_order, options, msg_id) {
|
|
340
|
+
const val3 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
341
|
+
let ptr0, len0, ptr1, len1;
|
|
342
|
+
try {
|
|
343
|
+
ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
344
|
+
len0 = WASM_VECTOR_LEN;
|
|
345
|
+
ptr1 = isLikeNone(sub_dir) ? 0 : passStringToWasm0(sub_dir, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
346
|
+
len1 = WASM_VECTOR_LEN;
|
|
347
|
+
} catch (e) {
|
|
348
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
349
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
350
|
+
throw e;
|
|
351
|
+
}
|
|
352
|
+
wasm.channel_send_download_start(this.__wbg_ptr, ptr0, len0, source, ptr1, len1, browsing, isLikeNone(in_order) ? 0xFFFFFF : in_order ? 1 : 0, options, val3);
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* @param {string} download_id
|
|
356
|
+
* @param {boolean} discard
|
|
357
|
+
* @param {number | null} [msg_id]
|
|
358
|
+
*/
|
|
359
|
+
send_download_stop(download_id, discard, msg_id) {
|
|
360
|
+
const val2 = +discard;
|
|
361
|
+
const val3 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
362
|
+
const ptr0 = passStringToWasm0(download_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
363
|
+
const len0 = WASM_VECTOR_LEN;
|
|
364
|
+
wasm.channel_send_download_stop(this.__wbg_ptr, ptr0, len0, val2, val3);
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* `{ Node: "<uuid>" }` or `"All"`.
|
|
368
|
+
* @param {any} scope
|
|
369
|
+
*/
|
|
370
|
+
send_download_subscribe(scope) {
|
|
371
|
+
wasm.channel_send_download_subscribe(this.__wbg_ptr, scope);
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* @param {string} node_id
|
|
375
|
+
* @param {any} browsing
|
|
376
|
+
* @param {number | null} [msg_id]
|
|
377
|
+
*/
|
|
378
|
+
send_download_where(node_id, browsing, msg_id) {
|
|
379
|
+
const val2 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
380
|
+
const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
381
|
+
const len0 = WASM_VECTOR_LEN;
|
|
382
|
+
wasm.channel_send_download_where(this.__wbg_ptr, ptr0, len0, browsing, val2);
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Set permission bits. The agent masks these to `0o7777`.
|
|
386
|
+
* @param {string} node_id
|
|
387
|
+
* @param {number} sid
|
|
388
|
+
* @param {string} path
|
|
389
|
+
* @param {number} permissions
|
|
390
|
+
* @param {number | null} [msg_id]
|
|
391
|
+
*/
|
|
392
|
+
send_sftp_chmod(node_id, sid, path, permissions, msg_id) {
|
|
393
|
+
const val3 = +sid;
|
|
394
|
+
const val4 = +permissions;
|
|
395
|
+
const val5 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
396
|
+
let ptr0, len0, ptr1, len1;
|
|
397
|
+
try {
|
|
398
|
+
ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
399
|
+
len0 = WASM_VECTOR_LEN;
|
|
400
|
+
ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
401
|
+
len1 = WASM_VECTOR_LEN;
|
|
402
|
+
} catch (e) {
|
|
403
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
404
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
405
|
+
throw e;
|
|
406
|
+
}
|
|
407
|
+
wasm.channel_send_sftp_chmod(this.__wbg_ptr, ptr0, len0, val3, ptr1, len1, val4, val5);
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* @param {string} node_id
|
|
411
|
+
* @param {number} sid
|
|
412
|
+
* @param {string} path
|
|
413
|
+
* @param {string} filename
|
|
414
|
+
* @param {number | null} [msg_id]
|
|
415
|
+
*/
|
|
416
|
+
send_sftp_delete(node_id, sid, path, filename, msg_id) {
|
|
417
|
+
const val4 = +sid;
|
|
418
|
+
const val5 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
419
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
420
|
+
try {
|
|
421
|
+
ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
422
|
+
len0 = WASM_VECTOR_LEN;
|
|
423
|
+
ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
424
|
+
len1 = WASM_VECTOR_LEN;
|
|
425
|
+
ptr2 = passStringToWasm0(filename, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
426
|
+
len2 = WASM_VECTOR_LEN;
|
|
427
|
+
} catch (e) {
|
|
428
|
+
if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
|
|
429
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
430
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
431
|
+
throw e;
|
|
432
|
+
}
|
|
433
|
+
wasm.channel_send_sftp_delete(this.__wbg_ptr, ptr0, len0, val4, ptr1, len1, ptr2, len2, val5);
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Send a pipelining ACK to the agent: acknowledges all chunks with index ≤ ack_up_to
|
|
437
|
+
* so the agent's sliding window advances, and it can push the next batch.
|
|
438
|
+
* Call this after processing each received SFTPDownloadChunk (or every N chunks).
|
|
439
|
+
* @param {string} node_id
|
|
440
|
+
* @param {number} sid
|
|
441
|
+
* @param {number} download_id
|
|
442
|
+
* @param {number} ack_up_to
|
|
443
|
+
*/
|
|
444
|
+
send_sftp_download_ack(node_id, sid, download_id, ack_up_to) {
|
|
445
|
+
const val2 = +sid;
|
|
446
|
+
const val3 = +download_id;
|
|
447
|
+
const val4 = +ack_up_to;
|
|
448
|
+
const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
449
|
+
const len0 = WASM_VECTOR_LEN;
|
|
450
|
+
wasm.channel_send_sftp_download_ack(this.__wbg_ptr, ptr0, len0, val2, val3, val4);
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* @param {string} node_id
|
|
454
|
+
* @param {number} sid
|
|
455
|
+
* @param {number} download_id
|
|
456
|
+
* @param {number} chunk_index
|
|
457
|
+
* @param {number | null} [msg_id]
|
|
458
|
+
*/
|
|
459
|
+
send_sftp_download_chunk(node_id, sid, download_id, chunk_index, msg_id) {
|
|
460
|
+
const val2 = +sid;
|
|
461
|
+
const val3 = +download_id;
|
|
462
|
+
const val4 = +chunk_index;
|
|
463
|
+
const val5 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
464
|
+
const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
465
|
+
const len0 = WASM_VECTOR_LEN;
|
|
466
|
+
wasm.channel_send_sftp_download_chunk(this.__wbg_ptr, ptr0, len0, val2, val3, val4, val5);
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* @param {string} node_id
|
|
470
|
+
* @param {number} sid
|
|
471
|
+
* @param {string} path
|
|
472
|
+
* @param {string} filename
|
|
473
|
+
* @param {number | null} [msg_id]
|
|
474
|
+
*/
|
|
475
|
+
send_sftp_download_start(node_id, sid, path, filename, msg_id) {
|
|
476
|
+
const val4 = +sid;
|
|
477
|
+
const val5 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
478
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
479
|
+
try {
|
|
480
|
+
ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
481
|
+
len0 = WASM_VECTOR_LEN;
|
|
482
|
+
ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
483
|
+
len1 = WASM_VECTOR_LEN;
|
|
484
|
+
ptr2 = passStringToWasm0(filename, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
485
|
+
len2 = WASM_VECTOR_LEN;
|
|
486
|
+
} catch (e) {
|
|
487
|
+
if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
|
|
488
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
489
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
490
|
+
throw e;
|
|
491
|
+
}
|
|
492
|
+
wasm.channel_send_sftp_download_start(this.__wbg_ptr, ptr0, len0, val4, ptr1, len1, ptr2, len2, val5);
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* @param {string} node_id
|
|
496
|
+
* @param {number} sid
|
|
497
|
+
* @param {string} path
|
|
498
|
+
* @param {number | null} [msg_id]
|
|
499
|
+
*/
|
|
500
|
+
send_sftp_list_data(node_id, sid, path, msg_id) {
|
|
501
|
+
const val3 = +sid;
|
|
502
|
+
const val4 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
503
|
+
let ptr0, len0, ptr1, len1;
|
|
504
|
+
try {
|
|
505
|
+
ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
506
|
+
len0 = WASM_VECTOR_LEN;
|
|
507
|
+
ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
508
|
+
len1 = WASM_VECTOR_LEN;
|
|
509
|
+
} catch (e) {
|
|
510
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
511
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
512
|
+
throw e;
|
|
513
|
+
}
|
|
514
|
+
wasm.channel_send_sftp_list_data(this.__wbg_ptr, ptr0, len0, val3, ptr1, len1, val4);
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Create one directory. Parents must exist already, as with `mkdir`.
|
|
518
|
+
* @param {string} node_id
|
|
519
|
+
* @param {number} sid
|
|
520
|
+
* @param {string} path
|
|
521
|
+
* @param {number | null} [msg_id]
|
|
522
|
+
*/
|
|
523
|
+
send_sftp_mkdir(node_id, sid, path, msg_id) {
|
|
524
|
+
const val3 = +sid;
|
|
525
|
+
const val4 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
526
|
+
let ptr0, len0, ptr1, len1;
|
|
527
|
+
try {
|
|
528
|
+
ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
529
|
+
len0 = WASM_VECTOR_LEN;
|
|
530
|
+
ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
531
|
+
len1 = WASM_VECTOR_LEN;
|
|
532
|
+
} catch (e) {
|
|
533
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
534
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
535
|
+
throw e;
|
|
536
|
+
}
|
|
537
|
+
wasm.channel_send_sftp_mkdir(this.__wbg_ptr, ptr0, len0, val3, ptr1, len1, val4);
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* Read a whole file for the in-page editor. Answered with an
|
|
541
|
+
* `SFTPOpResult` carrying `FileContents`, or an `Error` if the file is
|
|
542
|
+
* above the agent's editor size limit.
|
|
543
|
+
* @param {string} node_id
|
|
544
|
+
* @param {number} sid
|
|
545
|
+
* @param {string} path
|
|
546
|
+
* @param {number | null} [msg_id]
|
|
547
|
+
*/
|
|
548
|
+
send_sftp_read_file(node_id, sid, path, msg_id) {
|
|
549
|
+
const val3 = +sid;
|
|
550
|
+
const val4 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
551
|
+
let ptr0, len0, ptr1, len1;
|
|
552
|
+
try {
|
|
553
|
+
ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
554
|
+
len0 = WASM_VECTOR_LEN;
|
|
555
|
+
ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
556
|
+
len1 = WASM_VECTOR_LEN;
|
|
557
|
+
} catch (e) {
|
|
558
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
559
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
560
|
+
throw e;
|
|
561
|
+
}
|
|
562
|
+
wasm.channel_send_sftp_read_file(this.__wbg_ptr, ptr0, len0, val3, ptr1, len1, val4);
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* Remove a file, a symlink, or a directory. Without `recursive` the remote
|
|
566
|
+
* refuses a directory that still has anything in it.
|
|
567
|
+
* @param {string} node_id
|
|
568
|
+
* @param {number} sid
|
|
569
|
+
* @param {string} path
|
|
570
|
+
* @param {boolean} recursive
|
|
571
|
+
* @param {number | null} [msg_id]
|
|
572
|
+
*/
|
|
573
|
+
send_sftp_remove(node_id, sid, path, recursive, msg_id) {
|
|
574
|
+
const val3 = +sid;
|
|
575
|
+
const val4 = +recursive;
|
|
576
|
+
const val5 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
577
|
+
let ptr0, len0, ptr1, len1;
|
|
578
|
+
try {
|
|
579
|
+
ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
580
|
+
len0 = WASM_VECTOR_LEN;
|
|
581
|
+
ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
582
|
+
len1 = WASM_VECTOR_LEN;
|
|
583
|
+
} catch (e) {
|
|
584
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
585
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
586
|
+
throw e;
|
|
587
|
+
}
|
|
588
|
+
wasm.channel_send_sftp_remove(this.__wbg_ptr, ptr0, len0, val3, ptr1, len1, val4, val5);
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* Rename or move. `to` is a full path, so one call covers both.
|
|
592
|
+
* @param {string} node_id
|
|
593
|
+
* @param {number} sid
|
|
594
|
+
* @param {string} from
|
|
595
|
+
* @param {string} to
|
|
596
|
+
* @param {number | null} [msg_id]
|
|
597
|
+
*/
|
|
598
|
+
send_sftp_rename(node_id, sid, from, to, msg_id) {
|
|
599
|
+
const val4 = +sid;
|
|
600
|
+
const val5 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
601
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
602
|
+
try {
|
|
603
|
+
ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
604
|
+
len0 = WASM_VECTOR_LEN;
|
|
605
|
+
ptr1 = passStringToWasm0(from, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
606
|
+
len1 = WASM_VECTOR_LEN;
|
|
607
|
+
ptr2 = passStringToWasm0(to, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
608
|
+
len2 = WASM_VECTOR_LEN;
|
|
609
|
+
} catch (e) {
|
|
610
|
+
if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
|
|
611
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
612
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
613
|
+
throw e;
|
|
614
|
+
}
|
|
615
|
+
wasm.channel_send_sftp_rename(this.__wbg_ptr, ptr0, len0, val4, ptr1, len1, ptr2, len2, val5);
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* @param {string} node_id
|
|
619
|
+
* @param {number} sid
|
|
620
|
+
* @param {number} upload_id
|
|
621
|
+
* @param {number} chunk_index
|
|
622
|
+
* @param {number} chunk_size
|
|
623
|
+
* @param {Uint8Array | number[]} data
|
|
624
|
+
* @param {number | null} [msg_id]
|
|
625
|
+
*/
|
|
626
|
+
send_sftp_upload_chunk(node_id, sid, upload_id, chunk_index, chunk_size, data, msg_id) {
|
|
627
|
+
const val3 = +sid;
|
|
628
|
+
const val4 = +upload_id;
|
|
629
|
+
const val5 = +chunk_index;
|
|
630
|
+
const val6 = +chunk_size;
|
|
631
|
+
const val7 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
632
|
+
let ptr0, len0, ptr1, len1;
|
|
633
|
+
try {
|
|
634
|
+
ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
635
|
+
len0 = WASM_VECTOR_LEN;
|
|
636
|
+
ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_export);
|
|
637
|
+
len1 = WASM_VECTOR_LEN;
|
|
638
|
+
} catch (e) {
|
|
639
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
640
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
641
|
+
throw e;
|
|
642
|
+
}
|
|
643
|
+
wasm.channel_send_sftp_upload_chunk(this.__wbg_ptr, ptr0, len0, val3, val4, val5, val6, ptr1, len1, val7);
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* @param {string} node_id
|
|
647
|
+
* @param {number} sid
|
|
648
|
+
* @param {string} filename
|
|
649
|
+
* @param {string} remote_path
|
|
650
|
+
* @param {number} total_chunks
|
|
651
|
+
* @param {bigint} total_size
|
|
652
|
+
* @param {number | null} [msg_id]
|
|
653
|
+
*/
|
|
654
|
+
send_sftp_upload_start(node_id, sid, filename, remote_path, total_chunks, total_size, msg_id) {
|
|
655
|
+
const val4 = +sid;
|
|
656
|
+
const val5 = +total_chunks;
|
|
657
|
+
const val6 = BigInt.asIntN(64, total_size);
|
|
658
|
+
const val7 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
659
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
660
|
+
try {
|
|
661
|
+
ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
662
|
+
len0 = WASM_VECTOR_LEN;
|
|
663
|
+
ptr1 = passStringToWasm0(filename, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
664
|
+
len1 = WASM_VECTOR_LEN;
|
|
665
|
+
ptr2 = passStringToWasm0(remote_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
666
|
+
len2 = WASM_VECTOR_LEN;
|
|
667
|
+
} catch (e) {
|
|
668
|
+
if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
|
|
669
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
670
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
671
|
+
throw e;
|
|
672
|
+
}
|
|
673
|
+
wasm.channel_send_sftp_upload_start(this.__wbg_ptr, ptr0, len0, val4, ptr1, len1, ptr2, len2, val5, val6, val7);
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* Write a whole file back, truncating whatever was there.
|
|
677
|
+
* @param {string} node_id
|
|
678
|
+
* @param {number} sid
|
|
679
|
+
* @param {string} path
|
|
680
|
+
* @param {Uint8Array | number[]} contents
|
|
681
|
+
* @param {number | null} [msg_id]
|
|
682
|
+
*/
|
|
683
|
+
send_sftp_write_file(node_id, sid, path, contents, msg_id) {
|
|
684
|
+
const val4 = +sid;
|
|
685
|
+
const val5 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
686
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
687
|
+
try {
|
|
688
|
+
ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
689
|
+
len0 = WASM_VECTOR_LEN;
|
|
690
|
+
ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
691
|
+
len1 = WASM_VECTOR_LEN;
|
|
692
|
+
ptr2 = passArray8ToWasm0(contents, wasm.__wbindgen_export);
|
|
693
|
+
len2 = WASM_VECTOR_LEN;
|
|
694
|
+
} catch (e) {
|
|
695
|
+
if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
|
|
696
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
697
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
698
|
+
throw e;
|
|
699
|
+
}
|
|
700
|
+
wasm.channel_send_sftp_write_file(this.__wbg_ptr, ptr0, len0, val4, ptr1, len1, ptr2, len2, val5);
|
|
701
|
+
}
|
|
702
|
+
/**
|
|
703
|
+
* @param {string} node_id
|
|
704
|
+
* @param {number} sid
|
|
705
|
+
* @param {number} cols
|
|
706
|
+
* @param {number} rows
|
|
707
|
+
* @param {number} px_width
|
|
708
|
+
* @param {number} px_height
|
|
709
|
+
*/
|
|
710
|
+
send_ssh_terminal_resize(node_id, sid, cols, rows, px_width, px_height) {
|
|
711
|
+
const val2 = +sid;
|
|
712
|
+
const val3 = +cols;
|
|
713
|
+
const val4 = +rows;
|
|
714
|
+
const val5 = +px_width;
|
|
715
|
+
const val6 = +px_height;
|
|
716
|
+
const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
717
|
+
const len0 = WASM_VECTOR_LEN;
|
|
718
|
+
wasm.channel_send_ssh_terminal_resize(this.__wbg_ptr, ptr0, len0, val2, val3, val4, val5, val6);
|
|
719
|
+
}
|
|
720
|
+
/**
|
|
721
|
+
* @param {string} node_id
|
|
722
|
+
* @param {number} sid
|
|
723
|
+
* @param {string} data
|
|
724
|
+
*/
|
|
725
|
+
send_ssh_tunnel_data(node_id, sid, data) {
|
|
726
|
+
const val3 = +sid;
|
|
727
|
+
let ptr0, len0, ptr1, len1;
|
|
728
|
+
try {
|
|
729
|
+
ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
730
|
+
len0 = WASM_VECTOR_LEN;
|
|
731
|
+
ptr1 = passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
732
|
+
len1 = WASM_VECTOR_LEN;
|
|
733
|
+
} catch (e) {
|
|
734
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
735
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
736
|
+
throw e;
|
|
737
|
+
}
|
|
738
|
+
wasm.channel_send_ssh_tunnel_data(this.__wbg_ptr, ptr0, len0, val3, ptr1, len1);
|
|
739
|
+
}
|
|
740
|
+
/**
|
|
741
|
+
* @param {number} interval_as_millis
|
|
742
|
+
*/
|
|
743
|
+
start_heartbeat(interval_as_millis) {
|
|
744
|
+
wasm.channel_start_heartbeat(this.__wbg_ptr, interval_as_millis);
|
|
745
|
+
}
|
|
746
|
+
stop_heartbeat() {
|
|
747
|
+
wasm.channel_stop_heartbeat(this.__wbg_ptr);
|
|
748
|
+
}
|
|
749
|
+
/**
|
|
750
|
+
* @param {string} node_id
|
|
751
|
+
* @param {string} service_id
|
|
752
|
+
* @param {string} kind
|
|
753
|
+
* @param {string | null | undefined} name
|
|
754
|
+
* @param {string} host
|
|
755
|
+
* @param {number} port
|
|
756
|
+
* @param {string | null} [username]
|
|
757
|
+
* @param {string | null} [password]
|
|
758
|
+
* @param {string | null} [scheme]
|
|
759
|
+
* @param {number | null} [msg_id]
|
|
760
|
+
*/
|
|
761
|
+
update_service(node_id, service_id, kind, name, host, port, username, password, scheme, msg_id) {
|
|
762
|
+
const val9 = +port;
|
|
763
|
+
const val10 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
|
|
764
|
+
let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6, ptr7, len7;
|
|
765
|
+
try {
|
|
766
|
+
ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
767
|
+
len0 = WASM_VECTOR_LEN;
|
|
768
|
+
ptr1 = passStringToWasm0(service_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
769
|
+
len1 = WASM_VECTOR_LEN;
|
|
770
|
+
ptr2 = passStringToWasm0(kind, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
771
|
+
len2 = WASM_VECTOR_LEN;
|
|
772
|
+
ptr3 = isLikeNone(name) ? 0 : passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
773
|
+
len3 = WASM_VECTOR_LEN;
|
|
774
|
+
ptr4 = passStringToWasm0(host, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
775
|
+
len4 = WASM_VECTOR_LEN;
|
|
776
|
+
ptr5 = isLikeNone(username) ? 0 : passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
777
|
+
len5 = WASM_VECTOR_LEN;
|
|
778
|
+
ptr6 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
779
|
+
len6 = WASM_VECTOR_LEN;
|
|
780
|
+
ptr7 = isLikeNone(scheme) ? 0 : passStringToWasm0(scheme, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
781
|
+
len7 = WASM_VECTOR_LEN;
|
|
782
|
+
} catch (e) {
|
|
783
|
+
if (ptr7) { wasm.__wbindgen_export3(ptr7, len7 * 1, 1); }
|
|
784
|
+
if (ptr6) { wasm.__wbindgen_export3(ptr6, len6 * 1, 1); }
|
|
785
|
+
if (ptr5) { wasm.__wbindgen_export3(ptr5, len5 * 1, 1); }
|
|
786
|
+
if (ptr4) { wasm.__wbindgen_export3(ptr4, len4 * 1, 1); }
|
|
787
|
+
if (ptr3) { wasm.__wbindgen_export3(ptr3, len3 * 1, 1); }
|
|
788
|
+
if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
|
|
789
|
+
if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
|
|
790
|
+
if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
|
|
791
|
+
throw e;
|
|
792
|
+
}
|
|
793
|
+
wasm.channel_update_service(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, val9, ptr5, len5, ptr6, len6, ptr7, len7, val10);
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
if (Symbol.dispose) Channel.prototype[Symbol.dispose] = Channel.prototype.free;
|
|
797
|
+
|
|
798
|
+
/**
|
|
799
|
+
* @enum {0 | 10 | 100 | 110 | 120}
|
|
800
|
+
*/
|
|
801
|
+
const ErrorType = Object.freeze({
|
|
802
|
+
Generic: 0, "0": "Generic",
|
|
803
|
+
Authentication: 10, "10": "Authentication",
|
|
804
|
+
RequiresUsername: 100, "100": "RequiresUsername",
|
|
805
|
+
RequiresPassword: 110, "110": "RequiresPassword",
|
|
806
|
+
RequiresUsernamePassword: 120, "120": "RequiresUsernamePassword",
|
|
807
|
+
});
|
|
808
|
+
function __wbg_get_imports() {
|
|
809
|
+
const import0 = {
|
|
810
|
+
__proto__: null,
|
|
811
|
+
__wbg_Error_208446807d0d1e30: function(arg0, arg1) {
|
|
812
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
813
|
+
return ret;
|
|
814
|
+
},
|
|
815
|
+
__wbg_Number_ff192a72a0dcdf6d: function(arg0) {
|
|
816
|
+
const ret = Number(arg0);
|
|
817
|
+
return ret;
|
|
818
|
+
},
|
|
819
|
+
__wbg_String_8564e559799eccda: function(arg0, arg1) {
|
|
820
|
+
const ret = String(arg1);
|
|
821
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
822
|
+
const len1 = WASM_VECTOR_LEN;
|
|
823
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
824
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
825
|
+
},
|
|
826
|
+
__wbg___wbindgen_bigint_get_as_i64_11da4b52cd0aedef: function(arg0, arg1) {
|
|
827
|
+
const v = arg1;
|
|
828
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
829
|
+
getDataViewMemory0().setBigInt64((arg0 >>> 0) + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
830
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, !isLikeNone(ret), true);
|
|
831
|
+
},
|
|
832
|
+
__wbg___wbindgen_boolean_get_4f1baf9a00be3c74: function(arg0) {
|
|
833
|
+
const v = arg0;
|
|
834
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
835
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
836
|
+
},
|
|
837
|
+
__wbg___wbindgen_debug_string_f249a2a76caa9a55: function(arg0, arg1) {
|
|
838
|
+
const ret = debugString(arg1);
|
|
839
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
840
|
+
const len1 = WASM_VECTOR_LEN;
|
|
841
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
842
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
843
|
+
},
|
|
844
|
+
__wbg___wbindgen_in_3f58a9d3b3a7eed2: function(arg0, arg1) {
|
|
845
|
+
const ret = arg0 in arg1;
|
|
846
|
+
return ret;
|
|
847
|
+
},
|
|
848
|
+
__wbg___wbindgen_is_bigint_5fa10641e039d3ef: function(arg0) {
|
|
849
|
+
const ret = typeof(arg0) === 'bigint';
|
|
850
|
+
return ret;
|
|
851
|
+
},
|
|
852
|
+
__wbg___wbindgen_is_function_741ff2bb612836f5: function(arg0) {
|
|
853
|
+
const ret = typeof(arg0) === 'function';
|
|
854
|
+
return ret;
|
|
855
|
+
},
|
|
856
|
+
__wbg___wbindgen_is_null_c22311b1cc228e3a: function(arg0) {
|
|
857
|
+
const ret = arg0 === null;
|
|
858
|
+
return ret;
|
|
859
|
+
},
|
|
860
|
+
__wbg___wbindgen_is_object_8b968c3ab8e96595: function(arg0) {
|
|
861
|
+
const val = arg0;
|
|
862
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
863
|
+
return ret;
|
|
864
|
+
},
|
|
865
|
+
__wbg___wbindgen_is_string_fc456fee5d3317de: function(arg0) {
|
|
866
|
+
const ret = typeof(arg0) === 'string';
|
|
867
|
+
return ret;
|
|
868
|
+
},
|
|
869
|
+
__wbg___wbindgen_is_undefined_be5b34249ff1fc15: function(arg0) {
|
|
870
|
+
const ret = arg0 === undefined;
|
|
871
|
+
return ret;
|
|
872
|
+
},
|
|
873
|
+
__wbg___wbindgen_jsval_eq_38d7bfbe4cc84039: function(arg0, arg1) {
|
|
874
|
+
const ret = arg0 === arg1;
|
|
875
|
+
return ret;
|
|
876
|
+
},
|
|
877
|
+
__wbg___wbindgen_jsval_loose_eq_b2f214e2e4b30e36: function(arg0, arg1) {
|
|
878
|
+
const ret = arg0 == arg1;
|
|
879
|
+
return ret;
|
|
880
|
+
},
|
|
881
|
+
__wbg___wbindgen_number_get_934b640d0889af78: function(arg0, arg1) {
|
|
882
|
+
const obj = arg1;
|
|
883
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
884
|
+
getDataViewMemory0().setFloat64((arg0 >>> 0) + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
885
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, !isLikeNone(ret), true);
|
|
886
|
+
},
|
|
887
|
+
__wbg___wbindgen_string_get_7ce8eee7fd327545: function(arg0, arg1) {
|
|
888
|
+
const obj = arg1;
|
|
889
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
890
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
891
|
+
var len1 = WASM_VECTOR_LEN;
|
|
892
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
|
|
893
|
+
getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
|
|
894
|
+
},
|
|
895
|
+
__wbg___wbindgen_throw_4c88d8bf264fd984: function(arg0, arg1) {
|
|
896
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
897
|
+
},
|
|
898
|
+
__wbg__wbg_cb_unref_09736879a3f67559: function(arg0) {
|
|
899
|
+
arg0._wbg_cb_unref();
|
|
900
|
+
},
|
|
901
|
+
__wbg_call_40b008ba32f73991: function() { return handleError(function (arg0, arg1) {
|
|
902
|
+
const ret = arg0.call(arg1);
|
|
903
|
+
return ret;
|
|
904
|
+
}, arguments); },
|
|
905
|
+
__wbg_call_a410eb4b59ed5965: function() { return handleError(function (arg0, arg1, arg2) {
|
|
906
|
+
const ret = arg0.call(arg1, arg2);
|
|
907
|
+
return ret;
|
|
908
|
+
}, arguments); },
|
|
909
|
+
__wbg_call_fc92fee6137d452d: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
910
|
+
const ret = arg0.call(arg1, arg2, arg3);
|
|
911
|
+
return ret;
|
|
912
|
+
}, arguments); },
|
|
913
|
+
__wbg_clearInterval_2ed00e80b9bdc143: function(arg0) {
|
|
914
|
+
const ret = clearInterval(arg0);
|
|
915
|
+
return ret;
|
|
916
|
+
},
|
|
917
|
+
__wbg_close_5ee9c5fe4e8754a4: function() { return handleError(function (arg0) {
|
|
918
|
+
arg0.close();
|
|
919
|
+
}, arguments); },
|
|
920
|
+
__wbg_data_c7e5e8500f1bca2f: function(arg0) {
|
|
921
|
+
const ret = arg0.data;
|
|
922
|
+
return ret;
|
|
923
|
+
},
|
|
924
|
+
__wbg_done_57e08d0be6e30c02: function(arg0) {
|
|
925
|
+
const ret = arg0.done;
|
|
926
|
+
return ret;
|
|
927
|
+
},
|
|
928
|
+
__wbg_entries_7bb1459bd9b5c2b9: function(arg0) {
|
|
929
|
+
const ret = Object.entries(arg0);
|
|
930
|
+
return ret;
|
|
931
|
+
},
|
|
932
|
+
__wbg_from_eac91875c8a5ffa4: function(arg0) {
|
|
933
|
+
const ret = Array.from(arg0);
|
|
934
|
+
return ret;
|
|
935
|
+
},
|
|
936
|
+
__wbg_getRandomValues_5d8c030b527203a6: function() { return handleError(function (arg0, arg1) {
|
|
937
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
938
|
+
}, arguments); },
|
|
939
|
+
__wbg_get_2080c49015e35254: function() { return handleError(function (arg0, arg1) {
|
|
940
|
+
const ret = Reflect.get(arg0, arg1);
|
|
941
|
+
return ret;
|
|
942
|
+
}, arguments); },
|
|
943
|
+
__wbg_get_635eea311fa1a291: function() { return handleError(function (arg0, arg1) {
|
|
944
|
+
const ret = Reflect.get(arg0, arg1);
|
|
945
|
+
return ret;
|
|
946
|
+
}, arguments); },
|
|
947
|
+
__wbg_get_d7176cfb76d71114: function(arg0, arg1) {
|
|
948
|
+
const ret = arg0[arg1 >>> 0];
|
|
949
|
+
return ret;
|
|
950
|
+
},
|
|
951
|
+
__wbg_get_unchecked_e6325ad374eff861: function(arg0, arg1) {
|
|
952
|
+
const ret = arg0[arg1 >>> 0];
|
|
953
|
+
return ret;
|
|
954
|
+
},
|
|
955
|
+
__wbg_get_with_ref_key_fc601247060b7204: function(arg0, arg1) {
|
|
956
|
+
const ret = arg0[arg1];
|
|
957
|
+
return ret;
|
|
958
|
+
},
|
|
959
|
+
__wbg_info_b0bac022aae81d46: function(arg0, arg1) {
|
|
960
|
+
console.info(getStringFromWasm0(arg0, arg1));
|
|
961
|
+
},
|
|
962
|
+
__wbg_instanceof_ArrayBuffer_12cdaa4161423e6b: function(arg0) {
|
|
963
|
+
let result;
|
|
964
|
+
try {
|
|
965
|
+
result = arg0 instanceof ArrayBuffer;
|
|
966
|
+
} catch (_) {
|
|
967
|
+
result = false;
|
|
968
|
+
}
|
|
969
|
+
const ret = result;
|
|
970
|
+
return ret;
|
|
971
|
+
},
|
|
972
|
+
__wbg_instanceof_Uint8Array_d7aeb0dcb3108fea: function(arg0) {
|
|
973
|
+
let result;
|
|
974
|
+
try {
|
|
975
|
+
result = arg0 instanceof Uint8Array;
|
|
976
|
+
} catch (_) {
|
|
977
|
+
result = false;
|
|
978
|
+
}
|
|
979
|
+
const ret = result;
|
|
980
|
+
return ret;
|
|
981
|
+
},
|
|
982
|
+
__wbg_isArray_bcf1376d0d732d08: function(arg0) {
|
|
983
|
+
const ret = Array.isArray(arg0);
|
|
984
|
+
return ret;
|
|
985
|
+
},
|
|
986
|
+
__wbg_isSafeInteger_1a35ba4d31e71d38: function(arg0) {
|
|
987
|
+
const ret = Number.isSafeInteger(arg0);
|
|
988
|
+
return ret;
|
|
989
|
+
},
|
|
990
|
+
__wbg_iterator_e4c5e8f68ada7b58: function() {
|
|
991
|
+
const ret = Symbol.iterator;
|
|
992
|
+
return ret;
|
|
993
|
+
},
|
|
994
|
+
__wbg_length_186163212ffe79c3: function(arg0) {
|
|
995
|
+
const ret = arg0.length;
|
|
996
|
+
return ret;
|
|
997
|
+
},
|
|
998
|
+
__wbg_length_b03a0fabb109b1e9: function(arg0) {
|
|
999
|
+
const ret = arg0.length;
|
|
1000
|
+
return ret;
|
|
1001
|
+
},
|
|
1002
|
+
__wbg_new_13de428334042d26: function(arg0) {
|
|
1003
|
+
const ret = new Uint8Array(arg0);
|
|
1004
|
+
return ret;
|
|
1005
|
+
},
|
|
1006
|
+
__wbg_new_37eb45aaf5eeb820: function() {
|
|
1007
|
+
const ret = new Array();
|
|
1008
|
+
return ret;
|
|
1009
|
+
},
|
|
1010
|
+
__wbg_new_cd4348290afae586: function() {
|
|
1011
|
+
const ret = new Object();
|
|
1012
|
+
return ret;
|
|
1013
|
+
},
|
|
1014
|
+
__wbg_new_with_str_sequence_75b26d88172889d0: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1015
|
+
const ret = new WebSocket(getStringFromWasm0(arg0, arg1), arg2);
|
|
1016
|
+
return ret;
|
|
1017
|
+
}, arguments); },
|
|
1018
|
+
__wbg_next_178c1651c11432b3: function(arg0) {
|
|
1019
|
+
const ret = arg0.next;
|
|
1020
|
+
return ret;
|
|
1021
|
+
},
|
|
1022
|
+
__wbg_next_af5ac6a08bb0a717: function() { return handleError(function (arg0) {
|
|
1023
|
+
const ret = arg0.next();
|
|
1024
|
+
return ret;
|
|
1025
|
+
}, arguments); },
|
|
1026
|
+
__wbg_prototypesetcall_13162965d1fe7aa3: function(arg0, arg1, arg2) {
|
|
1027
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
1028
|
+
},
|
|
1029
|
+
__wbg_push_c9f4893fc209f768: function(arg0, arg1) {
|
|
1030
|
+
const ret = arg0.push(arg1);
|
|
1031
|
+
return ret;
|
|
1032
|
+
},
|
|
1033
|
+
__wbg_readyState_039bc047141a5f6d: function(arg0) {
|
|
1034
|
+
const ret = arg0.readyState;
|
|
1035
|
+
return ret;
|
|
1036
|
+
},
|
|
1037
|
+
__wbg_send_d83d0891cf698779: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1038
|
+
arg0.send(getArrayU8FromWasm0(arg1, arg2));
|
|
1039
|
+
}, arguments); },
|
|
1040
|
+
__wbg_setInterval_ef738bbfe8cc0974: function() { return handleError(function (arg0, arg1) {
|
|
1041
|
+
const ret = setInterval(arg0, arg1);
|
|
1042
|
+
return ret;
|
|
1043
|
+
}, arguments); },
|
|
1044
|
+
__wbg_set_binaryType_d5b4dafd0f127fb2: function(arg0, arg1) {
|
|
1045
|
+
arg0.binaryType = __wbindgen_enum_BinaryType[arg1];
|
|
1046
|
+
},
|
|
1047
|
+
__wbg_set_d2d33b52458e984a: function(arg0, arg1, arg2) {
|
|
1048
|
+
arg0[arg1 >>> 0] = arg2;
|
|
1049
|
+
},
|
|
1050
|
+
__wbg_set_e4b9a833d288759a: function(arg0, arg1, arg2) {
|
|
1051
|
+
arg0[arg1] = arg2;
|
|
1052
|
+
},
|
|
1053
|
+
__wbg_set_onclose_078935cf8d0fb024: function(arg0, arg1) {
|
|
1054
|
+
arg0.onclose = arg1;
|
|
1055
|
+
},
|
|
1056
|
+
__wbg_set_onerror_f7f089f7f059501c: function(arg0, arg1) {
|
|
1057
|
+
arg0.onerror = arg1;
|
|
1058
|
+
},
|
|
1059
|
+
__wbg_set_onmessage_26abc49cfa5f9ffc: function(arg0, arg1) {
|
|
1060
|
+
arg0.onmessage = arg1;
|
|
1061
|
+
},
|
|
1062
|
+
__wbg_set_onopen_757be120cc7b1ea6: function(arg0, arg1) {
|
|
1063
|
+
arg0.onopen = arg1;
|
|
1064
|
+
},
|
|
1065
|
+
__wbg_value_e0f328965e184931: function(arg0) {
|
|
1066
|
+
const ret = arg0.value;
|
|
1067
|
+
return ret;
|
|
1068
|
+
},
|
|
1069
|
+
__wbg_warn_95c497419b251cd5: function(arg0, arg1) {
|
|
1070
|
+
console.warn(getStringFromWasm0(arg0, arg1));
|
|
1071
|
+
},
|
|
1072
|
+
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
1073
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 3, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1074
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_96);
|
|
1075
|
+
return ret;
|
|
1076
|
+
},
|
|
1077
|
+
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
1078
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 3, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1079
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_96_46);
|
|
1080
|
+
return ret;
|
|
1081
|
+
},
|
|
1082
|
+
__wbindgen_generic_0000000000000003: function(arg0, arg1) {
|
|
1083
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 3, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1084
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_96_47);
|
|
1085
|
+
return ret;
|
|
1086
|
+
},
|
|
1087
|
+
__wbindgen_generic_0000000000000004: function(arg0, arg1) {
|
|
1088
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 7, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1089
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_100);
|
|
1090
|
+
return ret;
|
|
1091
|
+
},
|
|
1092
|
+
__wbindgen_generic_0000000000000005: function(arg0) {
|
|
1093
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
1094
|
+
const ret = arg0;
|
|
1095
|
+
return ret;
|
|
1096
|
+
},
|
|
1097
|
+
__wbindgen_generic_0000000000000006: function(arg0, arg1) {
|
|
1098
|
+
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
1099
|
+
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
1100
|
+
return ret;
|
|
1101
|
+
},
|
|
1102
|
+
__wbindgen_generic_0000000000000007: function(arg0, arg1) {
|
|
1103
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
1104
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1105
|
+
return ret;
|
|
1106
|
+
},
|
|
1107
|
+
__wbindgen_generic_0000000000000008: function(arg0) {
|
|
1108
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
1109
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
1110
|
+
return ret;
|
|
1111
|
+
},
|
|
1112
|
+
__wbindgen_init_externref_table: function() {
|
|
1113
|
+
const table = wasm.__wbindgen_externrefs;
|
|
1114
|
+
table.set(0, undefined);
|
|
1115
|
+
table.set(1024, undefined);
|
|
1116
|
+
table.set(1025, null);
|
|
1117
|
+
table.set(1026, true);
|
|
1118
|
+
table.set(1027, false);
|
|
1119
|
+
},
|
|
1120
|
+
};
|
|
1121
|
+
return {
|
|
1122
|
+
__proto__: null,
|
|
1123
|
+
"./phirepass-channel_bg.js": import0,
|
|
1124
|
+
};
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
function __wasm_bindgen_func_elem_100(arg0, arg1) {
|
|
1128
|
+
wasm.__wasm_bindgen_func_elem_100(arg0, arg1);
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
function __wasm_bindgen_func_elem_96(arg0, arg1, arg2) {
|
|
1132
|
+
wasm.__wasm_bindgen_func_elem_96(arg0, arg1, arg2);
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
function __wasm_bindgen_func_elem_96_46(arg0, arg1, arg2) {
|
|
1136
|
+
wasm.__wasm_bindgen_func_elem_96_46(arg0, arg1, arg2);
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
function __wasm_bindgen_func_elem_96_47(arg0, arg1, arg2) {
|
|
1140
|
+
wasm.__wasm_bindgen_func_elem_96_47(arg0, arg1, arg2);
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
|
|
1144
|
+
const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
|
|
1145
|
+
const ChannelFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1146
|
+
? { register: () => {}, unregister: () => {} }
|
|
1147
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_channel_free(ptr, 1));
|
|
1148
|
+
|
|
1149
|
+
function addToExternrefTable0(obj) {
|
|
1150
|
+
const idx = wasm.__wbindgen_export5();
|
|
1151
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
1152
|
+
return idx;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
1156
|
+
? { register: () => {}, unregister: () => {} }
|
|
1157
|
+
: new FinalizationRegistry(state => wasm.__wbindgen_export6(state.a, state.b));
|
|
1158
|
+
|
|
1159
|
+
function debugString(val) {
|
|
1160
|
+
switch (typeof val) {
|
|
1161
|
+
// primitive types
|
|
1162
|
+
case 'number':
|
|
1163
|
+
case 'boolean':
|
|
1164
|
+
case 'undefined':
|
|
1165
|
+
return `${val}`;
|
|
1166
|
+
case 'string':
|
|
1167
|
+
return JSON.stringify(val);
|
|
1168
|
+
case 'bigint':
|
|
1169
|
+
return `${val}n`;
|
|
1170
|
+
case 'symbol':
|
|
1171
|
+
return val.description !== undefined
|
|
1172
|
+
? `Symbol(${val.description})`
|
|
1173
|
+
: 'Symbol';
|
|
1174
|
+
case 'function':
|
|
1175
|
+
return typeof val.name === 'string' && val.name !== ''
|
|
1176
|
+
? `Function(${val.name})`
|
|
1177
|
+
: 'Function';
|
|
1178
|
+
case 'object': {
|
|
1179
|
+
if (val === null) {
|
|
1180
|
+
return 'null';
|
|
1181
|
+
}
|
|
1182
|
+
// objects
|
|
1183
|
+
if (Array.isArray(val)) {
|
|
1184
|
+
return '[' + Array.from(val, debugString).join(', ') + ']';
|
|
1185
|
+
}
|
|
1186
|
+
// errors
|
|
1187
|
+
if (val instanceof Error) {
|
|
1188
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
const toStringOutput = toString.call(val);
|
|
1192
|
+
// Test for built-in
|
|
1193
|
+
const className = /\[object ([^\]]+)\]/.exec(toStringOutput)?.[1];
|
|
1194
|
+
|
|
1195
|
+
// Failed to match the standard '[object ClassName]'
|
|
1196
|
+
if (className === undefined) {
|
|
1197
|
+
return toStringOutput;
|
|
1198
|
+
}
|
|
1199
|
+
if (className === 'Object') {
|
|
1200
|
+
// we're a user defined class or Object
|
|
1201
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
1202
|
+
// easier than looping through ownProperties of `val`.
|
|
1203
|
+
try {
|
|
1204
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
1205
|
+
} catch (_) {
|
|
1206
|
+
return 'Object';
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
1210
|
+
return className;
|
|
1211
|
+
}
|
|
1212
|
+
// Per MDN: 'This list of values is exhaustive.'
|
|
1213
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof#description
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
1218
|
+
ptr = ptr >>> 0;
|
|
1219
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
let cachedDataViewMemory0 = null;
|
|
1223
|
+
function getDataViewMemory0() {
|
|
1224
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
1225
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
1226
|
+
}
|
|
1227
|
+
return cachedDataViewMemory0;
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
function getStringFromWasm0(ptr, len) {
|
|
1231
|
+
ptr = ptr >>> 0;
|
|
1232
|
+
return decodeText(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
let cachedUint8ArrayMemory0 = null;
|
|
1236
|
+
function getUint8ArrayMemory0() {
|
|
1237
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
1238
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
1239
|
+
}
|
|
1240
|
+
return cachedUint8ArrayMemory0;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
function handleError(f, args) {
|
|
1244
|
+
try {
|
|
1245
|
+
return f.apply(this, args);
|
|
1246
|
+
} catch (e) {
|
|
1247
|
+
const idx = addToExternrefTable0(e);
|
|
1248
|
+
wasm.__wbindgen_export4(idx);
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
function isLikeNone(x) {
|
|
1253
|
+
return x === undefined || x === null;
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
function makeMutClosure(arg0, arg1, f) {
|
|
1257
|
+
const state = { a: arg0, b: arg1, cnt: 1 };
|
|
1258
|
+
const real = (...args) => {
|
|
1259
|
+
|
|
1260
|
+
// First up with a closure we increment the internal reference
|
|
1261
|
+
// count. This ensures that the Rust closure environment won't
|
|
1262
|
+
// be deallocated while we're invoking it.
|
|
1263
|
+
state.cnt++;
|
|
1264
|
+
const a = state.a;
|
|
1265
|
+
state.a = 0;
|
|
1266
|
+
try {
|
|
1267
|
+
return f(a, state.b, ...args);
|
|
1268
|
+
} finally {
|
|
1269
|
+
state.a = a;
|
|
1270
|
+
real._wbg_cb_unref();
|
|
1271
|
+
}
|
|
1272
|
+
};
|
|
1273
|
+
real._wbg_cb_unref = () => {
|
|
1274
|
+
if (--state.cnt === 0) {
|
|
1275
|
+
wasm.__wbindgen_export6(state.a, state.b);
|
|
1276
|
+
state.a = 0;
|
|
1277
|
+
CLOSURE_DTORS.unregister(state);
|
|
1278
|
+
}
|
|
1279
|
+
};
|
|
1280
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
1281
|
+
return real;
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
1285
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
1286
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
1287
|
+
WASM_VECTOR_LEN = arg.length;
|
|
1288
|
+
return ptr;
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
1292
|
+
if (realloc === undefined) {
|
|
1293
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1294
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
1295
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
1296
|
+
WASM_VECTOR_LEN = buf.length;
|
|
1297
|
+
return ptr;
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
let len = arg.length;
|
|
1301
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
1302
|
+
|
|
1303
|
+
const mem = getUint8ArrayMemory0();
|
|
1304
|
+
|
|
1305
|
+
let offset = 0;
|
|
1306
|
+
|
|
1307
|
+
for (; offset < len; offset++) {
|
|
1308
|
+
const code = arg.charCodeAt(offset);
|
|
1309
|
+
if (code > 0x7F) break;
|
|
1310
|
+
mem[ptr + offset] = code;
|
|
1311
|
+
}
|
|
1312
|
+
if (offset !== len) {
|
|
1313
|
+
if (offset !== 0) {
|
|
1314
|
+
arg = arg.slice(offset);
|
|
1315
|
+
}
|
|
1316
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
1317
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
1318
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
1319
|
+
|
|
1320
|
+
offset += ret.written;
|
|
1321
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
WASM_VECTOR_LEN = offset;
|
|
1325
|
+
return ptr;
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
|
|
1329
|
+
cachedTextDecoder.decode();
|
|
1330
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
1331
|
+
let numBytesDecoded = 0;
|
|
1332
|
+
function decodeText(bytes) {
|
|
1333
|
+
numBytesDecoded += bytes.length;
|
|
1334
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
1335
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
|
|
1336
|
+
cachedTextDecoder.decode();
|
|
1337
|
+
numBytesDecoded = bytes.length;
|
|
1338
|
+
}
|
|
1339
|
+
return cachedTextDecoder.decode(bytes);
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
const cachedTextEncoder = new TextEncoder();
|
|
1343
|
+
|
|
1344
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
1345
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
1346
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1347
|
+
view.set(buf);
|
|
1348
|
+
return {
|
|
1349
|
+
read: arg.length,
|
|
1350
|
+
written: buf.length
|
|
1351
|
+
};
|
|
1352
|
+
};
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
let WASM_VECTOR_LEN = 0;
|
|
1356
|
+
|
|
1357
|
+
let wasm;
|
|
1358
|
+
function __wbg_finalize_init(instance, module) {
|
|
1359
|
+
wasm = instance.exports;
|
|
1360
|
+
cachedDataViewMemory0 = null;
|
|
1361
|
+
cachedUint8ArrayMemory0 = null;
|
|
1362
|
+
wasm.__wbindgen_start();
|
|
1363
|
+
return wasm;
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
async function __wbg_load(module, imports) {
|
|
1367
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
1368
|
+
if (!module.ok) {
|
|
1369
|
+
throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
1373
|
+
try {
|
|
1374
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
1375
|
+
} catch (e) {
|
|
1376
|
+
const validResponse = expectedResponseType(module.type);
|
|
1377
|
+
|
|
1378
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
1379
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
1380
|
+
|
|
1381
|
+
} else { throw e; }
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
const bytes = await module.arrayBuffer();
|
|
1386
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
1387
|
+
} else {
|
|
1388
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
1389
|
+
|
|
1390
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
1391
|
+
return { instance, module };
|
|
1392
|
+
} else {
|
|
1393
|
+
return instance;
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
function expectedResponseType(type) {
|
|
1398
|
+
switch (type) {
|
|
1399
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
1400
|
+
}
|
|
1401
|
+
return false;
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
let __wbg_init_promise;
|
|
1406
|
+
async function __wbg_init(module_or_path) {
|
|
1407
|
+
if (wasm !== undefined) return wasm;
|
|
1408
|
+
if (__wbg_init_promise === undefined) {
|
|
1409
|
+
__wbg_init_promise = __wbg_init_once(module_or_path);
|
|
1410
|
+
__wbg_init_promise.catch(() => { __wbg_init_promise = undefined; });
|
|
1411
|
+
}
|
|
1412
|
+
return __wbg_init_promise;
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
async function __wbg_init_once(module_or_path) {
|
|
1416
|
+
|
|
1417
|
+
if (module_or_path !== undefined) {
|
|
1418
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
1419
|
+
({module_or_path} = module_or_path);
|
|
1420
|
+
} else {
|
|
1421
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead');
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
if (module_or_path === undefined) {
|
|
1426
|
+
module_or_path = new URL('phirepass-channel_bg.wasm', import.meta.url);
|
|
1427
|
+
}
|
|
1428
|
+
const imports = __wbg_get_imports();
|
|
1429
|
+
|
|
1430
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
1431
|
+
module_or_path = fetch(module_or_path);
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
const { instance} = await __wbg_load(await module_or_path, imports);
|
|
1435
|
+
|
|
1436
|
+
return __wbg_finalize_init(instance);
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
var ProtocolMessageType;
|
|
1440
|
+
(function (ProtocolMessageType) {
|
|
1441
|
+
ProtocolMessageType["Error"] = "Error";
|
|
1442
|
+
ProtocolMessageType["AuthSuccess"] = "AuthSuccess";
|
|
1443
|
+
ProtocolMessageType["TunnelOpened"] = "TunnelOpened";
|
|
1444
|
+
ProtocolMessageType["TunnelClosed"] = "TunnelClosed";
|
|
1445
|
+
ProtocolMessageType["TunnelData"] = "TunnelData";
|
|
1446
|
+
ProtocolMessageType["RDPAuthorized"] = "RDPAuthorized";
|
|
1447
|
+
ProtocolMessageType["SFTPListItems"] = "SFTPListItems";
|
|
1448
|
+
ProtocolMessageType["SFTPDownloadStartResponse"] = "SFTPDownloadStartResponse";
|
|
1449
|
+
ProtocolMessageType["SFTPDownloadChunk"] = "SFTPDownloadChunk";
|
|
1450
|
+
ProtocolMessageType["SFTPUploadStartResponse"] = "SFTPUploadStartResponse";
|
|
1451
|
+
ProtocolMessageType["SFTPUploadChunkAck"] = "SFTPUploadChunkAck";
|
|
1452
|
+
ProtocolMessageType["SFTPOpResult"] = "SFTPOpResult";
|
|
1453
|
+
})(ProtocolMessageType || (ProtocolMessageType = {}));
|
|
1454
|
+
var InputMode;
|
|
1455
|
+
(function (InputMode) {
|
|
1456
|
+
InputMode[InputMode["Username"] = 0] = "Username";
|
|
1457
|
+
InputMode[InputMode["Password"] = 1] = "Password";
|
|
1458
|
+
InputMode[InputMode["Default"] = 2] = "Default";
|
|
1459
|
+
})(InputMode || (InputMode = {}));
|
|
1460
|
+
var ConnectionState;
|
|
1461
|
+
(function (ConnectionState) {
|
|
1462
|
+
ConnectionState["Disconnected"] = "disconnected";
|
|
1463
|
+
ConnectionState["Connected"] = "connected";
|
|
1464
|
+
ConnectionState["Error"] = "error";
|
|
1465
|
+
})(ConnectionState || (ConnectionState = {}));
|
|
1466
|
+
|
|
1467
|
+
export { Channel as C, ErrorType as E, InputMode as I, ProtocolMessageType as P, __wbg_init as _, ConnectionState as a };
|