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.
Files changed (91) hide show
  1. package/README.md +33 -0
  2. package/dist/cjs/{index-B8w6l0VL.js → index-BCgmMoIq.js} +103 -32
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/phirepass-downloader_3.cjs.entry.js +3717 -0
  5. package/dist/cjs/phirepass-rdp.cjs.entry.js +18 -6
  6. package/dist/cjs/phirepass-terminal.cjs.entry.js +6 -5
  7. package/dist/cjs/phirepass-widgets.cjs.js +3 -3
  8. package/dist/cjs/protocol-CYh109n2.js +1472 -0
  9. package/dist/collection/collection-manifest.json +3 -1
  10. package/dist/collection/common/channel.js +21 -1
  11. package/dist/collection/common/fetch.js +44 -0
  12. package/dist/collection/components/phirepass-downloader/form.js +69 -0
  13. package/dist/collection/components/phirepass-downloader/format.js +105 -0
  14. package/dist/collection/components/phirepass-downloader/jobs.js +373 -0
  15. package/dist/collection/components/phirepass-downloader/phirepass-downloader.css +1109 -0
  16. package/dist/collection/components/phirepass-downloader/phirepass-downloader.js +1455 -0
  17. package/dist/collection/components/phirepass-downloader/source.js +120 -0
  18. package/dist/collection/components/phirepass-downloader/views/dialogs.js +34 -0
  19. package/dist/collection/components/phirepass-downloader/views/fetch-form.js +65 -0
  20. package/dist/collection/components/phirepass-downloader/views/icons.js +33 -0
  21. package/dist/collection/components/phirepass-downloader/views/job-row.js +91 -0
  22. package/dist/collection/components/phirepass-downloader/views/notices.js +15 -0
  23. package/dist/collection/components/phirepass-downloader/views/states.js +19 -0
  24. package/dist/collection/components/phirepass-media-player/phirepass-media-player.css +216 -0
  25. package/dist/collection/components/phirepass-media-player/phirepass-media-player.js +473 -0
  26. package/dist/collection/components/phirepass-media-player/player.js +94 -0
  27. package/dist/collection/components/phirepass-rdp/phirepass-rdp.js +36 -13
  28. package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.css +122 -0
  29. package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.fetch.js +35 -0
  30. package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.js +181 -31
  31. package/dist/collection/components/phirepass-terminal/phirepass-terminal.js +2 -2
  32. package/dist/collection/phirepass-channel_bg.wasm +0 -0
  33. package/dist/collection/testing/fixtures.js +219 -0
  34. package/dist/collection/testing/mock-channel.js +410 -0
  35. package/dist/components/index.js +1 -1
  36. package/dist/components/p-BtMWUitf.js +1 -0
  37. package/dist/components/p-C4cmk3bS.js +1 -0
  38. package/dist/components/p-CKnb-oeB.js +1 -0
  39. package/dist/components/phirepass-downloader.d.ts +11 -0
  40. package/dist/components/phirepass-downloader.js +1 -0
  41. package/dist/components/phirepass-media-player.d.ts +11 -0
  42. package/dist/components/phirepass-media-player.js +1 -0
  43. package/dist/components/phirepass-rdp.js +1 -1
  44. package/dist/components/phirepass-sftp-client.js +1 -1
  45. package/dist/components/phirepass-terminal.js +2 -2
  46. package/dist/esm/{index-DGq2b7rM.js → index-Dd9o0CbU.js} +103 -32
  47. package/dist/esm/loader.js +3 -3
  48. package/dist/esm/phirepass-downloader_3.entry.js +3713 -0
  49. package/dist/esm/phirepass-rdp.entry.js +18 -6
  50. package/dist/esm/phirepass-terminal.entry.js +6 -5
  51. package/dist/esm/phirepass-widgets.js +4 -4
  52. package/dist/esm/protocol-BtMWUitf.js +1467 -0
  53. package/dist/phirepass-widgets/p-97d84225.entry.js +1 -0
  54. package/dist/phirepass-widgets/p-BtMWUitf.js +1 -0
  55. package/dist/phirepass-widgets/p-Dd9o0CbU.js +3 -0
  56. package/dist/phirepass-widgets/p-a4a5e5f5.entry.js +1 -0
  57. package/dist/phirepass-widgets/{p-1fef5b5f.entry.js → p-a5ce104d.entry.js} +2 -2
  58. package/dist/phirepass-widgets/phirepass-channel_bg.wasm +0 -0
  59. package/dist/phirepass-widgets/phirepass-widgets.esm.js +1 -1
  60. package/dist/types/common/channel.d.ts +30 -0
  61. package/dist/types/common/fetch.d.ts +167 -0
  62. package/dist/types/components/phirepass-downloader/form.d.ts +54 -0
  63. package/dist/types/components/phirepass-downloader/format.d.ts +17 -0
  64. package/dist/types/components/phirepass-downloader/jobs.d.ts +116 -0
  65. package/dist/types/components/phirepass-downloader/phirepass-downloader.d.ts +231 -0
  66. package/dist/types/components/phirepass-downloader/source.d.ts +61 -0
  67. package/dist/types/components/phirepass-downloader/views/dialogs.d.ts +52 -0
  68. package/dist/types/components/phirepass-downloader/views/fetch-form.d.ts +31 -0
  69. package/dist/types/components/phirepass-downloader/views/icons.d.ts +5 -0
  70. package/dist/types/components/phirepass-downloader/views/job-row.d.ts +21 -0
  71. package/dist/types/components/phirepass-downloader/views/notices.d.ts +18 -0
  72. package/dist/types/components/phirepass-downloader/views/states.d.ts +38 -0
  73. package/dist/types/components/phirepass-media-player/phirepass-media-player.d.ts +67 -0
  74. package/dist/types/components/phirepass-media-player/player.d.ts +43 -0
  75. package/dist/types/components/phirepass-rdp/phirepass-rdp.d.ts +10 -0
  76. package/dist/types/components/phirepass-sftp-client/phirepass-sftp-client.d.ts +30 -0
  77. package/dist/types/components/phirepass-sftp-client/phirepass-sftp-client.fetch.d.ts +40 -0
  78. package/dist/types/components.d.ts +426 -34
  79. package/dist/types/stencil-public-runtime.d.ts +1 -1
  80. package/dist/types/testing/fixtures.d.ts +25 -0
  81. package/dist/types/testing/mock-channel.d.ts +132 -0
  82. package/package.json +26 -12
  83. package/dist/cjs/phirepass-sftp-client.cjs.entry.js +0 -1469
  84. package/dist/cjs/protocol-COvteaUJ.js +0 -1044
  85. package/dist/components/p-Dur4cBX7.js +0 -1
  86. package/dist/esm/phirepass-sftp-client.entry.js +0 -1467
  87. package/dist/esm/protocol-Dur4cBX7.js +0 -1039
  88. package/dist/phirepass-widgets/p-8eb3ec24.entry.js +0 -1
  89. package/dist/phirepass-widgets/p-9a1f9b9f.entry.js +0 -1
  90. package/dist/phirepass-widgets/p-DGq2b7rM.js +0 -3
  91. package/dist/phirepass-widgets/p-Dur4cBX7.js +0 -1
@@ -1,1044 +0,0 @@
1
- 'use strict';
2
-
3
- var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
4
- /* @ts-self-types="./phirepass-channel.d.ts" */
5
-
6
- class Channel {
7
- __destroy_into_raw() {
8
- const ptr = this.__wbg_ptr;
9
- this.__wbg_ptr = 0;
10
- ChannelFinalization.unregister(this);
11
- return ptr;
12
- }
13
- free() {
14
- const ptr = this.__destroy_into_raw();
15
- wasm.__wbg_channel_free(ptr, 0);
16
- }
17
- /**
18
- * @param {string} token
19
- * @param {string} node_id
20
- * @param {number | null} [msg_id]
21
- */
22
- authenticate(token, node_id, msg_id) {
23
- const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
24
- const len0 = WASM_VECTOR_LEN;
25
- const ptr1 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
26
- const len1 = WASM_VECTOR_LEN;
27
- wasm.channel_authenticate(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
28
- }
29
- connect() {
30
- wasm.channel_connect(this.__wbg_ptr);
31
- }
32
- /**
33
- * @param {string} node_id
34
- * @param {string} kind
35
- * @param {string | null | undefined} name
36
- * @param {string} host
37
- * @param {number} port
38
- * @param {string | null} [username]
39
- * @param {string | null} [password]
40
- * @param {string | null} [scheme]
41
- * @param {number | null} [msg_id]
42
- */
43
- create_service(node_id, kind, name, host, port, username, password, scheme, msg_id) {
44
- const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
45
- const len0 = WASM_VECTOR_LEN;
46
- const ptr1 = passStringToWasm0(kind, wasm.__wbindgen_export, wasm.__wbindgen_export2);
47
- const len1 = WASM_VECTOR_LEN;
48
- var ptr2 = isLikeNone(name) ? 0 : passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
49
- var len2 = WASM_VECTOR_LEN;
50
- const ptr3 = passStringToWasm0(host, wasm.__wbindgen_export, wasm.__wbindgen_export2);
51
- const len3 = WASM_VECTOR_LEN;
52
- var ptr4 = isLikeNone(username) ? 0 : passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
53
- var len4 = WASM_VECTOR_LEN;
54
- var ptr5 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
55
- var len5 = WASM_VECTOR_LEN;
56
- var ptr6 = isLikeNone(scheme) ? 0 : passStringToWasm0(scheme, wasm.__wbindgen_export, wasm.__wbindgen_export2);
57
- var len6 = WASM_VECTOR_LEN;
58
- wasm.channel_create_service(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, port, ptr4, len4, ptr5, len5, ptr6, len6, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
59
- }
60
- /**
61
- * @param {string} node_id
62
- * @param {string} id
63
- * @param {number | null} [msg_id]
64
- */
65
- delete_service(node_id, id, msg_id) {
66
- const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
67
- const len0 = WASM_VECTOR_LEN;
68
- const ptr1 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
69
- const len1 = WASM_VECTOR_LEN;
70
- wasm.channel_delete_service(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
71
- }
72
- disconnect() {
73
- wasm.channel_disconnect(this.__wbg_ptr);
74
- }
75
- /**
76
- * @returns {boolean}
77
- */
78
- is_connected() {
79
- const ret = wasm.channel_is_connected(this.__wbg_ptr);
80
- return ret !== 0;
81
- }
82
- /**
83
- * @returns {boolean}
84
- */
85
- is_disconnected() {
86
- const ret = wasm.channel_is_disconnected(this.__wbg_ptr);
87
- return ret !== 0;
88
- }
89
- /**
90
- * @param {string} endpoint
91
- * @param {string} node_id
92
- * @param {string | null} [server_id]
93
- */
94
- constructor(endpoint, node_id, server_id) {
95
- const ptr0 = passStringToWasm0(endpoint, wasm.__wbindgen_export, wasm.__wbindgen_export2);
96
- const len0 = WASM_VECTOR_LEN;
97
- const ptr1 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
98
- const len1 = WASM_VECTOR_LEN;
99
- var ptr2 = isLikeNone(server_id) ? 0 : passStringToWasm0(server_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
100
- var len2 = WASM_VECTOR_LEN;
101
- const ret = wasm.channel_new(ptr0, len0, ptr1, len1, ptr2, len2);
102
- this.__wbg_ptr = ret;
103
- ChannelFinalization.register(this, this.__wbg_ptr, this);
104
- return this;
105
- }
106
- /**
107
- * @param {Function | null} [cb]
108
- */
109
- on_connection_close(cb) {
110
- wasm.channel_on_connection_close(this.__wbg_ptr, isLikeNone(cb) ? 0 : addHeapObject(cb));
111
- }
112
- /**
113
- * @param {Function | null} [cb]
114
- */
115
- on_connection_error(cb) {
116
- wasm.channel_on_connection_error(this.__wbg_ptr, isLikeNone(cb) ? 0 : addHeapObject(cb));
117
- }
118
- /**
119
- * @param {Function | null} [cb]
120
- */
121
- on_connection_message(cb) {
122
- wasm.channel_on_connection_message(this.__wbg_ptr, isLikeNone(cb) ? 0 : addHeapObject(cb));
123
- }
124
- /**
125
- * @param {Function | null} [cb]
126
- */
127
- on_connection_open(cb) {
128
- wasm.channel_on_connection_open(this.__wbg_ptr, isLikeNone(cb) ? 0 : addHeapObject(cb));
129
- }
130
- /**
131
- * @param {Function | null} [cb]
132
- */
133
- on_protocol_message(cb) {
134
- wasm.channel_on_protocol_message(this.__wbg_ptr, isLikeNone(cb) ? 0 : addHeapObject(cb));
135
- }
136
- /**
137
- * @param {string} frame_type
138
- * @param {Function | null} [cb]
139
- */
140
- on_protocol_message_type(frame_type, cb) {
141
- const ptr0 = passStringToWasm0(frame_type, wasm.__wbindgen_export, wasm.__wbindgen_export2);
142
- const len0 = WASM_VECTOR_LEN;
143
- wasm.channel_on_protocol_message_type(this.__wbg_ptr, ptr0, len0, isLikeNone(cb) ? 0 : addHeapObject(cb));
144
- }
145
- /**
146
- * Requests an RDP tunnel. Credentials are validated by the agent but are
147
- * not used to log in: CredSSP runs in the browser's own RDP client, inside
148
- * the tunnel.
149
- *
150
- * Unlike the other protocols this does **not** yield a `TunnelOpened`.
151
- * The answer is an `RDPAuthorized` frame carrying a `sid` and a single-use
152
- * `ticket`; the RDP client then opens its own socket at
153
- * `/api/web/rdp/{node_id}` and presents that ticket in its RDCleanPath
154
- * request. No tunnel data for an RDP session ever crosses *this* channel.
155
- * @param {string} node_id
156
- * @param {string} service_id
157
- * @param {string | null} [username]
158
- * @param {string | null} [password]
159
- * @param {number | null} [msg_id]
160
- */
161
- open_rdp_tunnel(node_id, service_id, username, password, msg_id) {
162
- const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
163
- const len0 = WASM_VECTOR_LEN;
164
- const ptr1 = passStringToWasm0(service_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
165
- const len1 = WASM_VECTOR_LEN;
166
- var ptr2 = isLikeNone(username) ? 0 : passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
167
- var len2 = WASM_VECTOR_LEN;
168
- var ptr3 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
169
- var len3 = WASM_VECTOR_LEN;
170
- wasm.channel_open_rdp_tunnel(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
171
- }
172
- /**
173
- * @param {string} node_id
174
- * @param {string} service_id
175
- * @param {string | null} [username]
176
- * @param {string | null} [password]
177
- * @param {number | null} [msg_id]
178
- */
179
- open_sftp_tunnel(node_id, service_id, username, password, msg_id) {
180
- const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
181
- const len0 = WASM_VECTOR_LEN;
182
- const ptr1 = passStringToWasm0(service_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
183
- const len1 = WASM_VECTOR_LEN;
184
- var ptr2 = isLikeNone(username) ? 0 : passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
185
- var len2 = WASM_VECTOR_LEN;
186
- var ptr3 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
187
- var len3 = WASM_VECTOR_LEN;
188
- wasm.channel_open_sftp_tunnel(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
189
- }
190
- /**
191
- * @param {string} node_id
192
- * @param {string} service_id
193
- * @param {string | null} [username]
194
- * @param {string | null} [password]
195
- * @param {number | null} [msg_id]
196
- */
197
- open_ssh_tunnel(node_id, service_id, username, password, msg_id) {
198
- const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
199
- const len0 = WASM_VECTOR_LEN;
200
- const ptr1 = passStringToWasm0(service_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
201
- const len1 = WASM_VECTOR_LEN;
202
- var ptr2 = isLikeNone(username) ? 0 : passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
203
- var len2 = WASM_VECTOR_LEN;
204
- var ptr3 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
205
- var len3 = WASM_VECTOR_LEN;
206
- 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);
207
- }
208
- /**
209
- * Set permission bits. The agent masks these to `0o7777`.
210
- * @param {string} node_id
211
- * @param {number} sid
212
- * @param {string} path
213
- * @param {number} permissions
214
- * @param {number | null} [msg_id]
215
- */
216
- send_sftp_chmod(node_id, sid, path, permissions, msg_id) {
217
- const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
218
- const len0 = WASM_VECTOR_LEN;
219
- const ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
220
- const len1 = WASM_VECTOR_LEN;
221
- wasm.channel_send_sftp_chmod(this.__wbg_ptr, ptr0, len0, sid, ptr1, len1, permissions, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
222
- }
223
- /**
224
- * @param {string} node_id
225
- * @param {number} sid
226
- * @param {string} path
227
- * @param {string} filename
228
- * @param {number | null} [msg_id]
229
- */
230
- send_sftp_delete(node_id, sid, path, filename, msg_id) {
231
- const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
232
- const len0 = WASM_VECTOR_LEN;
233
- const ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
234
- const len1 = WASM_VECTOR_LEN;
235
- const ptr2 = passStringToWasm0(filename, wasm.__wbindgen_export, wasm.__wbindgen_export2);
236
- const len2 = WASM_VECTOR_LEN;
237
- wasm.channel_send_sftp_delete(this.__wbg_ptr, ptr0, len0, sid, ptr1, len1, ptr2, len2, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
238
- }
239
- /**
240
- * Send a pipelining ACK to the agent: acknowledges all chunks with index ≤ ack_up_to
241
- * so the agent's sliding window advances, and it can push the next batch.
242
- * Call this after processing each received SFTPDownloadChunk (or every N chunks).
243
- * @param {string} node_id
244
- * @param {number} sid
245
- * @param {number} download_id
246
- * @param {number} ack_up_to
247
- */
248
- send_sftp_download_ack(node_id, sid, download_id, ack_up_to) {
249
- const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
250
- const len0 = WASM_VECTOR_LEN;
251
- wasm.channel_send_sftp_download_ack(this.__wbg_ptr, ptr0, len0, sid, download_id, ack_up_to);
252
- }
253
- /**
254
- * @param {string} node_id
255
- * @param {number} sid
256
- * @param {number} download_id
257
- * @param {number} chunk_index
258
- * @param {number | null} [msg_id]
259
- */
260
- send_sftp_download_chunk(node_id, sid, download_id, chunk_index, msg_id) {
261
- const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
262
- const len0 = WASM_VECTOR_LEN;
263
- wasm.channel_send_sftp_download_chunk(this.__wbg_ptr, ptr0, len0, sid, download_id, chunk_index, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
264
- }
265
- /**
266
- * @param {string} node_id
267
- * @param {number} sid
268
- * @param {string} path
269
- * @param {string} filename
270
- * @param {number | null} [msg_id]
271
- */
272
- send_sftp_download_start(node_id, sid, path, filename, msg_id) {
273
- const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
274
- const len0 = WASM_VECTOR_LEN;
275
- const ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
276
- const len1 = WASM_VECTOR_LEN;
277
- const ptr2 = passStringToWasm0(filename, wasm.__wbindgen_export, wasm.__wbindgen_export2);
278
- const len2 = WASM_VECTOR_LEN;
279
- wasm.channel_send_sftp_download_start(this.__wbg_ptr, ptr0, len0, sid, ptr1, len1, ptr2, len2, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
280
- }
281
- /**
282
- * @param {string} node_id
283
- * @param {number} sid
284
- * @param {string} path
285
- * @param {number | null} [msg_id]
286
- */
287
- send_sftp_list_data(node_id, sid, path, msg_id) {
288
- const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
289
- const len0 = WASM_VECTOR_LEN;
290
- const ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
291
- const len1 = WASM_VECTOR_LEN;
292
- wasm.channel_send_sftp_list_data(this.__wbg_ptr, ptr0, len0, sid, ptr1, len1, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
293
- }
294
- /**
295
- * Create one directory. Parents must exist already, as with `mkdir`.
296
- * @param {string} node_id
297
- * @param {number} sid
298
- * @param {string} path
299
- * @param {number | null} [msg_id]
300
- */
301
- send_sftp_mkdir(node_id, sid, path, msg_id) {
302
- const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
303
- const len0 = WASM_VECTOR_LEN;
304
- const ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
305
- const len1 = WASM_VECTOR_LEN;
306
- wasm.channel_send_sftp_mkdir(this.__wbg_ptr, ptr0, len0, sid, ptr1, len1, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
307
- }
308
- /**
309
- * Read a whole file for the in-page editor. Answered with an
310
- * `SFTPOpResult` carrying `FileContents`, or an `Error` if the file is
311
- * above the agent's editor size limit.
312
- * @param {string} node_id
313
- * @param {number} sid
314
- * @param {string} path
315
- * @param {number | null} [msg_id]
316
- */
317
- send_sftp_read_file(node_id, sid, path, msg_id) {
318
- const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
319
- const len0 = WASM_VECTOR_LEN;
320
- const ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
321
- const len1 = WASM_VECTOR_LEN;
322
- wasm.channel_send_sftp_read_file(this.__wbg_ptr, ptr0, len0, sid, ptr1, len1, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
323
- }
324
- /**
325
- * Remove a file, a symlink, or a directory. Without `recursive` the remote
326
- * refuses a directory that still has anything in it.
327
- * @param {string} node_id
328
- * @param {number} sid
329
- * @param {string} path
330
- * @param {boolean} recursive
331
- * @param {number | null} [msg_id]
332
- */
333
- send_sftp_remove(node_id, sid, path, recursive, msg_id) {
334
- const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
335
- const len0 = WASM_VECTOR_LEN;
336
- const ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
337
- const len1 = WASM_VECTOR_LEN;
338
- wasm.channel_send_sftp_remove(this.__wbg_ptr, ptr0, len0, sid, ptr1, len1, recursive, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
339
- }
340
- /**
341
- * Rename or move. `to` is a full path, so one call covers both.
342
- * @param {string} node_id
343
- * @param {number} sid
344
- * @param {string} from
345
- * @param {string} to
346
- * @param {number | null} [msg_id]
347
- */
348
- send_sftp_rename(node_id, sid, from, to, msg_id) {
349
- const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
350
- const len0 = WASM_VECTOR_LEN;
351
- const ptr1 = passStringToWasm0(from, wasm.__wbindgen_export, wasm.__wbindgen_export2);
352
- const len1 = WASM_VECTOR_LEN;
353
- const ptr2 = passStringToWasm0(to, wasm.__wbindgen_export, wasm.__wbindgen_export2);
354
- const len2 = WASM_VECTOR_LEN;
355
- wasm.channel_send_sftp_rename(this.__wbg_ptr, ptr0, len0, sid, ptr1, len1, ptr2, len2, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
356
- }
357
- /**
358
- * @param {string} node_id
359
- * @param {number} sid
360
- * @param {number} upload_id
361
- * @param {number} chunk_index
362
- * @param {number} chunk_size
363
- * @param {Uint8Array} data
364
- * @param {number | null} [msg_id]
365
- */
366
- send_sftp_upload_chunk(node_id, sid, upload_id, chunk_index, chunk_size, data, msg_id) {
367
- const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
368
- const len0 = WASM_VECTOR_LEN;
369
- const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_export);
370
- const len1 = WASM_VECTOR_LEN;
371
- wasm.channel_send_sftp_upload_chunk(this.__wbg_ptr, ptr0, len0, sid, upload_id, chunk_index, chunk_size, ptr1, len1, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
372
- }
373
- /**
374
- * @param {string} node_id
375
- * @param {number} sid
376
- * @param {string} filename
377
- * @param {string} remote_path
378
- * @param {number} total_chunks
379
- * @param {bigint} total_size
380
- * @param {number | null} [msg_id]
381
- */
382
- send_sftp_upload_start(node_id, sid, filename, remote_path, total_chunks, total_size, msg_id) {
383
- const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
384
- const len0 = WASM_VECTOR_LEN;
385
- const ptr1 = passStringToWasm0(filename, wasm.__wbindgen_export, wasm.__wbindgen_export2);
386
- const len1 = WASM_VECTOR_LEN;
387
- const ptr2 = passStringToWasm0(remote_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
388
- const len2 = WASM_VECTOR_LEN;
389
- wasm.channel_send_sftp_upload_start(this.__wbg_ptr, ptr0, len0, sid, ptr1, len1, ptr2, len2, total_chunks, total_size, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
390
- }
391
- /**
392
- * Write a whole file back, truncating whatever was there.
393
- * @param {string} node_id
394
- * @param {number} sid
395
- * @param {string} path
396
- * @param {Uint8Array} contents
397
- * @param {number | null} [msg_id]
398
- */
399
- send_sftp_write_file(node_id, sid, path, contents, msg_id) {
400
- const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
401
- const len0 = WASM_VECTOR_LEN;
402
- const ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
403
- const len1 = WASM_VECTOR_LEN;
404
- const ptr2 = passArray8ToWasm0(contents, wasm.__wbindgen_export);
405
- const len2 = WASM_VECTOR_LEN;
406
- wasm.channel_send_sftp_write_file(this.__wbg_ptr, ptr0, len0, sid, ptr1, len1, ptr2, len2, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
407
- }
408
- /**
409
- * @param {string} node_id
410
- * @param {number} sid
411
- * @param {number} cols
412
- * @param {number} rows
413
- * @param {number} px_width
414
- * @param {number} px_height
415
- */
416
- send_ssh_terminal_resize(node_id, sid, cols, rows, px_width, px_height) {
417
- const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
418
- const len0 = WASM_VECTOR_LEN;
419
- wasm.channel_send_ssh_terminal_resize(this.__wbg_ptr, ptr0, len0, sid, cols, rows, px_width, px_height);
420
- }
421
- /**
422
- * @param {string} node_id
423
- * @param {number} sid
424
- * @param {string} data
425
- */
426
- send_ssh_tunnel_data(node_id, sid, data) {
427
- const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
428
- const len0 = WASM_VECTOR_LEN;
429
- const ptr1 = passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
430
- const len1 = WASM_VECTOR_LEN;
431
- wasm.channel_send_ssh_tunnel_data(this.__wbg_ptr, ptr0, len0, sid, ptr1, len1);
432
- }
433
- /**
434
- * @param {number} interval_as_millis
435
- */
436
- start_heartbeat(interval_as_millis) {
437
- wasm.channel_start_heartbeat(this.__wbg_ptr, interval_as_millis);
438
- }
439
- stop_heartbeat() {
440
- wasm.channel_stop_heartbeat(this.__wbg_ptr);
441
- }
442
- /**
443
- * @param {string} node_id
444
- * @param {string} service_id
445
- * @param {string} kind
446
- * @param {string | null | undefined} name
447
- * @param {string} host
448
- * @param {number} port
449
- * @param {string | null} [username]
450
- * @param {string | null} [password]
451
- * @param {string | null} [scheme]
452
- * @param {number | null} [msg_id]
453
- */
454
- update_service(node_id, service_id, kind, name, host, port, username, password, scheme, msg_id) {
455
- const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
456
- const len0 = WASM_VECTOR_LEN;
457
- const ptr1 = passStringToWasm0(service_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
458
- const len1 = WASM_VECTOR_LEN;
459
- const ptr2 = passStringToWasm0(kind, wasm.__wbindgen_export, wasm.__wbindgen_export2);
460
- const len2 = WASM_VECTOR_LEN;
461
- var ptr3 = isLikeNone(name) ? 0 : passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
462
- var len3 = WASM_VECTOR_LEN;
463
- const ptr4 = passStringToWasm0(host, wasm.__wbindgen_export, wasm.__wbindgen_export2);
464
- const len4 = WASM_VECTOR_LEN;
465
- var ptr5 = isLikeNone(username) ? 0 : passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
466
- var len5 = WASM_VECTOR_LEN;
467
- var ptr6 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
468
- var len6 = WASM_VECTOR_LEN;
469
- var ptr7 = isLikeNone(scheme) ? 0 : passStringToWasm0(scheme, wasm.__wbindgen_export, wasm.__wbindgen_export2);
470
- var len7 = WASM_VECTOR_LEN;
471
- wasm.channel_update_service(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, port, ptr5, len5, ptr6, len6, ptr7, len7, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
472
- }
473
- }
474
- if (Symbol.dispose) Channel.prototype[Symbol.dispose] = Channel.prototype.free;
475
-
476
- /**
477
- * @enum {0 | 10 | 100 | 110 | 120}
478
- */
479
- const ErrorType = Object.freeze({
480
- Generic: 0, "0": "Generic",
481
- Authentication: 10, "10": "Authentication",
482
- RequiresUsername: 100, "100": "RequiresUsername",
483
- RequiresPassword: 110, "110": "RequiresPassword",
484
- RequiresUsernamePassword: 120, "120": "RequiresUsernamePassword",
485
- });
486
- function __wbg_get_imports() {
487
- const import0 = {
488
- __proto__: null,
489
- __wbg_Error_30c8987f7c2ed4e2: function(arg0, arg1) {
490
- const ret = Error(getStringFromWasm0(arg0, arg1));
491
- return addHeapObject(ret);
492
- },
493
- __wbg_String_8564e559799eccda: function(arg0, arg1) {
494
- const ret = String(getObject(arg1));
495
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
496
- const len1 = WASM_VECTOR_LEN;
497
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
498
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
499
- },
500
- __wbg___wbindgen_debug_string_4687d8d8c2017d52: function(arg0, arg1) {
501
- const ret = debugString(getObject(arg1));
502
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
503
- const len1 = WASM_VECTOR_LEN;
504
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
505
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
506
- },
507
- __wbg___wbindgen_string_get_0380ccaa2f57f0d9: function(arg0, arg1) {
508
- const obj = getObject(arg1);
509
- const ret = typeof(obj) === 'string' ? obj : undefined;
510
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
511
- var len1 = WASM_VECTOR_LEN;
512
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
513
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
514
- },
515
- __wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
516
- throw new Error(getStringFromWasm0(arg0, arg1));
517
- },
518
- __wbg__wbg_cb_unref_dcc1a90847f04c41: function(arg0) {
519
- getObject(arg0)._wbg_cb_unref();
520
- },
521
- __wbg_call_1875a20c43a36133: function() { return handleError(function (arg0, arg1, arg2, arg3) {
522
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
523
- return addHeapObject(ret);
524
- }, arguments); },
525
- __wbg_call_187d372bd5fdd4aa: function() { return handleError(function (arg0, arg1, arg2) {
526
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
527
- return addHeapObject(ret);
528
- }, arguments); },
529
- __wbg_call_6137034ef55c9d0f: function() { return handleError(function (arg0, arg1) {
530
- const ret = getObject(arg0).call(getObject(arg1));
531
- return addHeapObject(ret);
532
- }, arguments); },
533
- __wbg_clearInterval_26ba580547547579: function(arg0) {
534
- const ret = clearInterval(takeObject(arg0));
535
- return addHeapObject(ret);
536
- },
537
- __wbg_close_d3ed56b5763be5ae: function() { return handleError(function (arg0) {
538
- getObject(arg0).close();
539
- }, arguments); },
540
- __wbg_data_522f7abc70721269: function(arg0) {
541
- const ret = getObject(arg0).data;
542
- return addHeapObject(ret);
543
- },
544
- __wbg_from_296ca31f8d0f1c52: function(arg0) {
545
- const ret = Array.from(getObject(arg0));
546
- return addHeapObject(ret);
547
- },
548
- __wbg_getRandomValues_a608c4436c19407a: function() { return handleError(function (arg0, arg1) {
549
- globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
550
- }, arguments); },
551
- __wbg_get_31af05bd4842a84f: function() { return handleError(function (arg0, arg1) {
552
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
553
- return addHeapObject(ret);
554
- }, arguments); },
555
- __wbg_info_930469ca0112784b: function(arg0, arg1) {
556
- console.info(getStringFromWasm0(arg0, arg1));
557
- },
558
- __wbg_instanceof_ArrayBuffer_a99f175873e5d9b8: function(arg0) {
559
- let result;
560
- try {
561
- result = getObject(arg0) instanceof ArrayBuffer;
562
- } catch (_) {
563
- result = false;
564
- }
565
- const ret = result;
566
- return ret;
567
- },
568
- __wbg_length_7f3c00c40364105e: function(arg0) {
569
- const ret = getObject(arg0).length;
570
- return ret;
571
- },
572
- __wbg_new_1dbf7428bba60a42: function(arg0) {
573
- const ret = new Uint8Array(getObject(arg0));
574
- return addHeapObject(ret);
575
- },
576
- __wbg_new_617a8cdb8bb1130e: function() {
577
- const ret = new Object();
578
- return addHeapObject(ret);
579
- },
580
- __wbg_new_ee2291f50781bf1d: function() {
581
- const ret = new Array();
582
- return addHeapObject(ret);
583
- },
584
- __wbg_new_with_str_sequence_f79e461d58fdeacc: function() { return handleError(function (arg0, arg1, arg2) {
585
- const ret = new WebSocket(getStringFromWasm0(arg0, arg1), getObject(arg2));
586
- return addHeapObject(ret);
587
- }, arguments); },
588
- __wbg_prototypesetcall_bc27214492979395: function(arg0, arg1, arg2) {
589
- Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
590
- },
591
- __wbg_push_2baf45db356cf468: function(arg0, arg1) {
592
- const ret = getObject(arg0).push(getObject(arg1));
593
- return ret;
594
- },
595
- __wbg_readyState_d8514376867e415b: function(arg0) {
596
- const ret = getObject(arg0).readyState;
597
- return ret;
598
- },
599
- __wbg_send_c1dad0ec2e52defb: function() { return handleError(function (arg0, arg1, arg2) {
600
- getObject(arg0).send(getArrayU8FromWasm0(arg1, arg2));
601
- }, arguments); },
602
- __wbg_setInterval_cbf1c35c6a692d37: function() { return handleError(function (arg0, arg1) {
603
- const ret = setInterval(getObject(arg0), arg1);
604
- return addHeapObject(ret);
605
- }, arguments); },
606
- __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
607
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
608
- },
609
- __wbg_set_bea140a88be9b277: function(arg0, arg1, arg2) {
610
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
611
- },
612
- __wbg_set_binaryType_21835bf0df8f70aa: function(arg0, arg1) {
613
- getObject(arg0).binaryType = __wbindgen_enum_BinaryType[arg1];
614
- },
615
- __wbg_set_onclose_a84370531f3d2948: function(arg0, arg1) {
616
- getObject(arg0).onclose = getObject(arg1);
617
- },
618
- __wbg_set_onerror_94ee307653399172: function(arg0, arg1) {
619
- getObject(arg0).onerror = getObject(arg1);
620
- },
621
- __wbg_set_onmessage_cb6f77d2d8e0402a: function(arg0, arg1) {
622
- getObject(arg0).onmessage = getObject(arg1);
623
- },
624
- __wbg_set_onopen_c914147e8a2db4b0: function(arg0, arg1) {
625
- getObject(arg0).onopen = getObject(arg1);
626
- },
627
- __wbg_warn_018ad7405d6ad231: function(arg0, arg1) {
628
- console.warn(getStringFromWasm0(arg0, arg1));
629
- },
630
- __wbindgen_generic_0000000000000001: function(arg0, arg1) {
631
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 1, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
632
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_60);
633
- return addHeapObject(ret);
634
- },
635
- __wbindgen_generic_0000000000000002: function(arg0, arg1) {
636
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 1, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
637
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_60_37);
638
- return addHeapObject(ret);
639
- },
640
- __wbindgen_generic_0000000000000003: function(arg0, arg1) {
641
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 1, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
642
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_60_38);
643
- return addHeapObject(ret);
644
- },
645
- __wbindgen_generic_0000000000000004: function(arg0, arg1) {
646
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 5, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
647
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_64);
648
- return addHeapObject(ret);
649
- },
650
- __wbindgen_generic_0000000000000005: function(arg0) {
651
- // Cast intrinsic for `F64 -> Externref`.
652
- const ret = arg0;
653
- return addHeapObject(ret);
654
- },
655
- __wbindgen_generic_0000000000000006: function(arg0, arg1) {
656
- // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
657
- const ret = getArrayU8FromWasm0(arg0, arg1);
658
- return addHeapObject(ret);
659
- },
660
- __wbindgen_generic_0000000000000007: function(arg0, arg1) {
661
- // Cast intrinsic for `Ref(String) -> Externref`.
662
- const ret = getStringFromWasm0(arg0, arg1);
663
- return addHeapObject(ret);
664
- },
665
- __wbindgen_generic_0000000000000008: function(arg0) {
666
- // Cast intrinsic for `U64 -> Externref`.
667
- const ret = BigInt.asUintN(64, arg0);
668
- return addHeapObject(ret);
669
- },
670
- __wbindgen_object_clone_ref: function(arg0) {
671
- const ret = getObject(arg0);
672
- return addHeapObject(ret);
673
- },
674
- __wbindgen_object_drop_ref: function(arg0) {
675
- takeObject(arg0);
676
- },
677
- };
678
- return {
679
- __proto__: null,
680
- "./phirepass-channel_bg.js": import0,
681
- };
682
- }
683
-
684
- function __wasm_bindgen_func_elem_64(arg0, arg1) {
685
- wasm.__wasm_bindgen_func_elem_64(arg0, arg1);
686
- }
687
-
688
- function __wasm_bindgen_func_elem_60(arg0, arg1, arg2) {
689
- wasm.__wasm_bindgen_func_elem_60(arg0, arg1, addHeapObject(arg2));
690
- }
691
-
692
- function __wasm_bindgen_func_elem_60_37(arg0, arg1, arg2) {
693
- wasm.__wasm_bindgen_func_elem_60_37(arg0, arg1, addHeapObject(arg2));
694
- }
695
-
696
- function __wasm_bindgen_func_elem_60_38(arg0, arg1, arg2) {
697
- wasm.__wasm_bindgen_func_elem_60_38(arg0, arg1, addHeapObject(arg2));
698
- }
699
-
700
-
701
- const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
702
- const ChannelFinalization = (typeof FinalizationRegistry === 'undefined')
703
- ? { register: () => {}, unregister: () => {} }
704
- : new FinalizationRegistry(ptr => wasm.__wbg_channel_free(ptr, 1));
705
-
706
- function addHeapObject(obj) {
707
- if (heap_next === heap.length) heap.push(heap.length + 1);
708
- const idx = heap_next;
709
- heap_next = heap[idx];
710
-
711
- heap[idx] = obj;
712
- return idx;
713
- }
714
-
715
- const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
716
- ? { register: () => {}, unregister: () => {} }
717
- : new FinalizationRegistry(state => wasm.__wbindgen_export4(state.a, state.b));
718
-
719
- function debugString(val) {
720
- // primitive types
721
- const type = typeof val;
722
- if (type == 'number' || type == 'boolean' || val == null) {
723
- return `${val}`;
724
- }
725
- if (type == 'string') {
726
- return `"${val}"`;
727
- }
728
- if (type == 'symbol') {
729
- const description = val.description;
730
- if (description == null) {
731
- return 'Symbol';
732
- } else {
733
- return `Symbol(${description})`;
734
- }
735
- }
736
- if (type == 'function') {
737
- const name = val.name;
738
- if (typeof name == 'string' && name.length > 0) {
739
- return `Function(${name})`;
740
- } else {
741
- return 'Function';
742
- }
743
- }
744
- // objects
745
- if (Array.isArray(val)) {
746
- const length = val.length;
747
- let debug = '[';
748
- if (length > 0) {
749
- debug += debugString(val[0]);
750
- }
751
- for(let i = 1; i < length; i++) {
752
- debug += ', ' + debugString(val[i]);
753
- }
754
- debug += ']';
755
- return debug;
756
- }
757
- // Test for built-in
758
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
759
- let className;
760
- if (builtInMatches && builtInMatches.length > 1) {
761
- className = builtInMatches[1];
762
- } else {
763
- // Failed to match the standard '[object ClassName]'
764
- return toString.call(val);
765
- }
766
- if (className == 'Object') {
767
- // we're a user defined class or Object
768
- // JSON.stringify avoids problems with cycles, and is generally much
769
- // easier than looping through ownProperties of `val`.
770
- try {
771
- return 'Object(' + JSON.stringify(val) + ')';
772
- } catch (_) {
773
- return 'Object';
774
- }
775
- }
776
- // errors
777
- if (val instanceof Error) {
778
- return `${val.name}: ${val.message}\n${val.stack}`;
779
- }
780
- // TODO we could test for more things here, like `Set`s and `Map`s.
781
- return className;
782
- }
783
-
784
- function dropObject(idx) {
785
- if (idx < 1028) return;
786
- heap[idx] = heap_next;
787
- heap_next = idx;
788
- }
789
-
790
- function getArrayU8FromWasm0(ptr, len) {
791
- ptr = ptr >>> 0;
792
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
793
- }
794
-
795
- let cachedDataViewMemory0 = null;
796
- function getDataViewMemory0() {
797
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
798
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
799
- }
800
- return cachedDataViewMemory0;
801
- }
802
-
803
- function getStringFromWasm0(ptr, len) {
804
- return decodeText(ptr >>> 0, len);
805
- }
806
-
807
- let cachedUint8ArrayMemory0 = null;
808
- function getUint8ArrayMemory0() {
809
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
810
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
811
- }
812
- return cachedUint8ArrayMemory0;
813
- }
814
-
815
- function getObject(idx) { return heap[idx]; }
816
-
817
- function handleError(f, args) {
818
- try {
819
- return f.apply(this, args);
820
- } catch (e) {
821
- wasm.__wbindgen_export3(addHeapObject(e));
822
- }
823
- }
824
-
825
- let heap = new Array(1024).fill(undefined);
826
- heap.push(undefined, null, true, false);
827
-
828
- let heap_next = heap.length;
829
-
830
- function isLikeNone(x) {
831
- return x === undefined || x === null;
832
- }
833
-
834
- function makeMutClosure(arg0, arg1, f) {
835
- const state = { a: arg0, b: arg1, cnt: 1 };
836
- const real = (...args) => {
837
-
838
- // First up with a closure we increment the internal reference
839
- // count. This ensures that the Rust closure environment won't
840
- // be deallocated while we're invoking it.
841
- state.cnt++;
842
- const a = state.a;
843
- state.a = 0;
844
- try {
845
- return f(a, state.b, ...args);
846
- } finally {
847
- state.a = a;
848
- real._wbg_cb_unref();
849
- }
850
- };
851
- real._wbg_cb_unref = () => {
852
- if (--state.cnt === 0) {
853
- wasm.__wbindgen_export4(state.a, state.b);
854
- state.a = 0;
855
- CLOSURE_DTORS.unregister(state);
856
- }
857
- };
858
- CLOSURE_DTORS.register(real, state, state);
859
- return real;
860
- }
861
-
862
- function passArray8ToWasm0(arg, malloc) {
863
- const ptr = malloc(arg.length * 1, 1) >>> 0;
864
- getUint8ArrayMemory0().set(arg, ptr / 1);
865
- WASM_VECTOR_LEN = arg.length;
866
- return ptr;
867
- }
868
-
869
- function passStringToWasm0(arg, malloc, realloc) {
870
- if (realloc === undefined) {
871
- const buf = cachedTextEncoder.encode(arg);
872
- const ptr = malloc(buf.length, 1) >>> 0;
873
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
874
- WASM_VECTOR_LEN = buf.length;
875
- return ptr;
876
- }
877
-
878
- let len = arg.length;
879
- let ptr = malloc(len, 1) >>> 0;
880
-
881
- const mem = getUint8ArrayMemory0();
882
-
883
- let offset = 0;
884
-
885
- for (; offset < len; offset++) {
886
- const code = arg.charCodeAt(offset);
887
- if (code > 0x7F) break;
888
- mem[ptr + offset] = code;
889
- }
890
- if (offset !== len) {
891
- if (offset !== 0) {
892
- arg = arg.slice(offset);
893
- }
894
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
895
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
896
- const ret = cachedTextEncoder.encodeInto(arg, view);
897
-
898
- offset += ret.written;
899
- ptr = realloc(ptr, len, offset, 1) >>> 0;
900
- }
901
-
902
- WASM_VECTOR_LEN = offset;
903
- return ptr;
904
- }
905
-
906
- function takeObject(idx) {
907
- const ret = getObject(idx);
908
- dropObject(idx);
909
- return ret;
910
- }
911
-
912
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
913
- cachedTextDecoder.decode();
914
- const MAX_SAFARI_DECODE_BYTES = 2146435072;
915
- let numBytesDecoded = 0;
916
- function decodeText(ptr, len) {
917
- numBytesDecoded += len;
918
- if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
919
- cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
920
- cachedTextDecoder.decode();
921
- numBytesDecoded = len;
922
- }
923
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
924
- }
925
-
926
- const cachedTextEncoder = new TextEncoder();
927
-
928
- if (!('encodeInto' in cachedTextEncoder)) {
929
- cachedTextEncoder.encodeInto = function (arg, view) {
930
- const buf = cachedTextEncoder.encode(arg);
931
- view.set(buf);
932
- return {
933
- read: arg.length,
934
- written: buf.length
935
- };
936
- };
937
- }
938
-
939
- let WASM_VECTOR_LEN = 0;
940
-
941
- let wasm;
942
- function __wbg_finalize_init(instance, module) {
943
- wasm = instance.exports;
944
- cachedDataViewMemory0 = null;
945
- cachedUint8ArrayMemory0 = null;
946
- return wasm;
947
- }
948
-
949
- async function __wbg_load(module, imports) {
950
- if (typeof Response === 'function' && module instanceof Response) {
951
- if (!module.ok) {
952
- throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
953
- }
954
-
955
- if (typeof WebAssembly.instantiateStreaming === 'function') {
956
- try {
957
- return await WebAssembly.instantiateStreaming(module, imports);
958
- } catch (e) {
959
- const validResponse = expectedResponseType(module.type);
960
-
961
- if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
962
- 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);
963
-
964
- } else { throw e; }
965
- }
966
- }
967
-
968
- const bytes = await module.arrayBuffer();
969
- return await WebAssembly.instantiate(bytes, imports);
970
- } else {
971
- const instance = await WebAssembly.instantiate(module, imports);
972
-
973
- if (instance instanceof WebAssembly.Instance) {
974
- return { instance, module };
975
- } else {
976
- return instance;
977
- }
978
- }
979
-
980
- function expectedResponseType(type) {
981
- switch (type) {
982
- case 'basic': case 'cors': case 'default': return true;
983
- }
984
- return false;
985
- }
986
- }
987
-
988
- async function __wbg_init(module_or_path) {
989
- if (wasm !== undefined) return wasm;
990
-
991
-
992
- if (module_or_path !== undefined) {
993
- if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
994
- ({module_or_path} = module_or_path);
995
- } else {
996
- console.warn('using deprecated parameters for the initialization function; pass a single object instead');
997
- }
998
- }
999
-
1000
- if (module_or_path === undefined) {
1001
- module_or_path = new URL('phirepass-channel_bg.wasm', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('protocol-COvteaUJ.js', document.baseURI).href)));
1002
- }
1003
- const imports = __wbg_get_imports();
1004
-
1005
- if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1006
- module_or_path = fetch(module_or_path);
1007
- }
1008
-
1009
- const { instance} = await __wbg_load(await module_or_path, imports);
1010
-
1011
- return __wbg_finalize_init(instance);
1012
- }
1013
-
1014
- exports.ProtocolMessageType = void 0;
1015
- (function (ProtocolMessageType) {
1016
- ProtocolMessageType["Error"] = "Error";
1017
- ProtocolMessageType["AuthSuccess"] = "AuthSuccess";
1018
- ProtocolMessageType["TunnelOpened"] = "TunnelOpened";
1019
- ProtocolMessageType["TunnelClosed"] = "TunnelClosed";
1020
- ProtocolMessageType["TunnelData"] = "TunnelData";
1021
- ProtocolMessageType["RDPAuthorized"] = "RDPAuthorized";
1022
- ProtocolMessageType["SFTPListItems"] = "SFTPListItems";
1023
- ProtocolMessageType["SFTPDownloadStartResponse"] = "SFTPDownloadStartResponse";
1024
- ProtocolMessageType["SFTPDownloadChunk"] = "SFTPDownloadChunk";
1025
- ProtocolMessageType["SFTPUploadStartResponse"] = "SFTPUploadStartResponse";
1026
- ProtocolMessageType["SFTPUploadChunkAck"] = "SFTPUploadChunkAck";
1027
- ProtocolMessageType["SFTPOpResult"] = "SFTPOpResult";
1028
- })(exports.ProtocolMessageType || (exports.ProtocolMessageType = {}));
1029
- exports.InputMode = void 0;
1030
- (function (InputMode) {
1031
- InputMode[InputMode["Username"] = 0] = "Username";
1032
- InputMode[InputMode["Password"] = 1] = "Password";
1033
- InputMode[InputMode["Default"] = 2] = "Default";
1034
- })(exports.InputMode || (exports.InputMode = {}));
1035
- exports.ConnectionState = void 0;
1036
- (function (ConnectionState) {
1037
- ConnectionState["Disconnected"] = "disconnected";
1038
- ConnectionState["Connected"] = "connected";
1039
- ConnectionState["Error"] = "error";
1040
- })(exports.ConnectionState || (exports.ConnectionState = {}));
1041
-
1042
- exports.Channel = Channel;
1043
- exports.ErrorType = ErrorType;
1044
- exports.__wbg_init = __wbg_init;