phirepass-widgets 0.0.117 → 0.0.118

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 (88) hide show
  1. package/README.md +1 -12
  2. package/dist/cjs/{index-DehquNXP.js → index-C3v5xmUo.js} +2 -74
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/phirepass-rdp.cjs.entry.js +5 -16
  5. package/dist/cjs/phirepass-sftp-client.cjs.entry.js +1470 -0
  6. package/dist/cjs/phirepass-terminal.cjs.entry.js +4 -4
  7. package/dist/cjs/phirepass-widgets.cjs.js +2 -2
  8. package/dist/cjs/{protocol-BjOgJZ9-.js → protocol-DCBMfc2u.js} +21 -277
  9. package/dist/collection/collection-manifest.json +0 -2
  10. package/dist/collection/common/channel.js +1 -21
  11. package/dist/collection/components/phirepass-rdp/phirepass-rdp.js +13 -36
  12. package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.css +0 -122
  13. package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.js +31 -181
  14. package/dist/collection/components/phirepass-terminal/phirepass-terminal.js +2 -2
  15. package/dist/collection/phirepass-channel_bg.wasm +0 -0
  16. package/dist/components/index.js +1 -1
  17. package/dist/components/p-CsYQJXY2.js +1 -0
  18. package/dist/components/phirepass-rdp.js +1 -1
  19. package/dist/components/phirepass-sftp-client.js +1 -1
  20. package/dist/components/phirepass-terminal.js +5 -5
  21. package/dist/esm/{index-BinptKL7.js → index-BVOulYtW.js} +2 -74
  22. package/dist/esm/loader.js +3 -3
  23. package/dist/esm/phirepass-rdp.entry.js +5 -16
  24. package/dist/esm/phirepass-sftp-client.entry.js +1468 -0
  25. package/dist/esm/phirepass-terminal.entry.js +4 -4
  26. package/dist/esm/phirepass-widgets.js +3 -3
  27. package/dist/esm/{protocol-BekUePpu.js → protocol-CsYQJXY2.js} +20 -276
  28. package/dist/phirepass-widgets/{p-9e6f9220.entry.js → p-7ea2fdbc.entry.js} +5 -5
  29. package/dist/phirepass-widgets/p-BVOulYtW.js +3 -0
  30. package/dist/phirepass-widgets/p-CsYQJXY2.js +1 -0
  31. package/dist/phirepass-widgets/p-c1c616ca.entry.js +1 -0
  32. package/dist/phirepass-widgets/p-f1bc04a8.entry.js +1 -0
  33. package/dist/phirepass-widgets/phirepass-channel_bg.wasm +0 -0
  34. package/dist/phirepass-widgets/phirepass-widgets.esm.js +1 -1
  35. package/dist/types/common/channel.d.ts +0 -30
  36. package/dist/types/components/phirepass-rdp/phirepass-rdp.d.ts +0 -10
  37. package/dist/types/components/phirepass-sftp-client/phirepass-sftp-client.d.ts +0 -30
  38. package/dist/types/components.d.ts +34 -434
  39. package/package.json +4 -18
  40. package/dist/cjs/phirepass-downloader_3.cjs.entry.js +0 -3823
  41. package/dist/collection/common/fetch.js +0 -44
  42. package/dist/collection/components/phirepass-downloader/form.js +0 -69
  43. package/dist/collection/components/phirepass-downloader/format.js +0 -105
  44. package/dist/collection/components/phirepass-downloader/jobs.js +0 -393
  45. package/dist/collection/components/phirepass-downloader/phirepass-downloader.css +0 -1109
  46. package/dist/collection/components/phirepass-downloader/phirepass-downloader.js +0 -1466
  47. package/dist/collection/components/phirepass-downloader/source.js +0 -120
  48. package/dist/collection/components/phirepass-downloader/views/dialogs.js +0 -34
  49. package/dist/collection/components/phirepass-downloader/views/fetch-form.js +0 -65
  50. package/dist/collection/components/phirepass-downloader/views/icons.js +0 -34
  51. package/dist/collection/components/phirepass-downloader/views/job-row.js +0 -91
  52. package/dist/collection/components/phirepass-downloader/views/notices.js +0 -15
  53. package/dist/collection/components/phirepass-downloader/views/states.js +0 -19
  54. package/dist/collection/components/phirepass-media-player/phirepass-media-player.css +0 -225
  55. package/dist/collection/components/phirepass-media-player/phirepass-media-player.js +0 -549
  56. package/dist/collection/components/phirepass-media-player/player.js +0 -118
  57. package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.fetch.js +0 -35
  58. package/dist/collection/testing/fixtures.js +0 -219
  59. package/dist/collection/testing/mock-channel.js +0 -410
  60. package/dist/components/p-B4kFfbHE.js +0 -1
  61. package/dist/components/p-BekUePpu.js +0 -1
  62. package/dist/components/p-DIf-Ru26.js +0 -1
  63. package/dist/components/phirepass-downloader.d.ts +0 -11
  64. package/dist/components/phirepass-downloader.js +0 -1
  65. package/dist/components/phirepass-media-player.d.ts +0 -11
  66. package/dist/components/phirepass-media-player.js +0 -1
  67. package/dist/esm/phirepass-downloader_3.entry.js +0 -3819
  68. package/dist/phirepass-widgets/p-6a192c8d.entry.js +0 -1
  69. package/dist/phirepass-widgets/p-BekUePpu.js +0 -1
  70. package/dist/phirepass-widgets/p-BinptKL7.js +0 -3
  71. package/dist/phirepass-widgets/p-fe1ce8da.entry.js +0 -1
  72. package/dist/types/common/fetch.d.ts +0 -167
  73. package/dist/types/components/phirepass-downloader/form.d.ts +0 -54
  74. package/dist/types/components/phirepass-downloader/format.d.ts +0 -17
  75. package/dist/types/components/phirepass-downloader/jobs.d.ts +0 -123
  76. package/dist/types/components/phirepass-downloader/phirepass-downloader.d.ts +0 -238
  77. package/dist/types/components/phirepass-downloader/source.d.ts +0 -61
  78. package/dist/types/components/phirepass-downloader/views/dialogs.d.ts +0 -52
  79. package/dist/types/components/phirepass-downloader/views/fetch-form.d.ts +0 -31
  80. package/dist/types/components/phirepass-downloader/views/icons.d.ts +0 -5
  81. package/dist/types/components/phirepass-downloader/views/job-row.d.ts +0 -21
  82. package/dist/types/components/phirepass-downloader/views/notices.d.ts +0 -18
  83. package/dist/types/components/phirepass-downloader/views/states.d.ts +0 -38
  84. package/dist/types/components/phirepass-media-player/phirepass-media-player.d.ts +0 -82
  85. package/dist/types/components/phirepass-media-player/player.d.ts +0 -53
  86. package/dist/types/components/phirepass-sftp-client/phirepass-sftp-client.fetch.d.ts +0 -40
  87. package/dist/types/testing/fixtures.d.ts +0 -25
  88. package/dist/types/testing/mock-channel.d.ts +0 -132
@@ -5,171 +5,20 @@
5
5
  * It contains typing information for all components that exist in this project.
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
- import { ChannelFactory, DownloadChannelFactory, DownloadChannelLike } from "./common/channel";
9
- import { ConnectionState, ProtocolMessage } from "./common/protocol";
10
- import { LinkMinter, PositionStore, RemotePlaybackLike } from "./components/phirepass-media-player/player";
11
- export { ChannelFactory, DownloadChannelFactory, DownloadChannelLike } from "./common/channel";
12
- export { ConnectionState, ProtocolMessage } from "./common/protocol";
13
- export { LinkMinter, PositionStore, RemotePlaybackLike } from "./components/phirepass-media-player/player";
8
+ import { ConnectionState } from "./common/protocol";
9
+ import { ChannelFactory } from "./common/channel";
10
+ export { ConnectionState } from "./common/protocol";
11
+ export { ChannelFactory } from "./common/channel";
14
12
  export namespace Components {
15
13
  /**
16
- * Remote Fetch: paste a link or a magnet, or drop a `.torrent`, and the node
17
- * downloads it into its own download folder.
18
- * Two forms, one component. **Embedded** in the SFTP browser (`compact`), it
19
- * shares the host's channel, which forwards it the `Download*` frames through
20
- * `receive()`, and saves into the folder on screen when the node can map it.
21
- * **Standalone**, it builds its own channel, signs in with `token`, and saves
22
- * into the download folder or a sub-folder of it. Either way it never asks for
23
- * a login: the node writes its own files.
24
- * The widget only sends events and shows progress. Downloads run on the node
25
- * and carry on after the tab closes.
14
+ * Remote desktop over RDP.
15
+ * Unlike the terminal and SFTP widgets this one does not pipe protocol bytes
16
+ * through the phirepass channel. The channel is used only to authorise the
17
+ * session; the actual RDP stream runs on a second WebSocket opened by IronRDP's
18
+ * own client, because that client speaks RDCleanPath and can set neither
19
+ * headers nor a subprotocol on the socket it opens. See `RDP.md` in
20
+ * `phirepass-rs` for why the session is split across two sockets.
26
21
  */
27
- interface PhirepassDownloader {
28
- /**
29
- * @default false
30
- */
31
- "allowInsecure": boolean;
32
- /**
33
- * The folder on screen in the host. Downloads land here when it lies inside the download folder.
34
- */
35
- "browsingPath"?: string;
36
- /**
37
- * The SFTP/SSH service the host is browsing, so the node can map `browsingPath`.
38
- */
39
- "browsingService"?: string;
40
- /**
41
- * Whether the viewer may configure this node, which only changes advice text (B9).
42
- * @default false
43
- */
44
- "canConfigure": boolean;
45
- /**
46
- * A channel to share instead of opening one: the SFTP client passes its own. The host must forward `Download*` frames (and `Error`s whose `msg_id` is at or above `DOWNLOADER_MSG_ID_BASE`) to `receive()`, and set `connected` once the channel is authenticated.
47
- */
48
- "channel"?: DownloadChannelLike;
49
- /**
50
- * Builds the channel in place of a WebSocket, for demos and tests (see `ChannelFactory`).
51
- */
52
- "channelFactory"?: DownloadChannelFactory;
53
- /**
54
- * The drawer layout used inside the SFTP browser.
55
- * @default false
56
- */
57
- "compact": boolean;
58
- /**
59
- * With an injected `channel`: whether it is authenticated and usable.
60
- * @default false
61
- */
62
- "connected": boolean;
63
- /**
64
- * Deletes a download (an unfinished one always loses its part file).
65
- */
66
- "deleteDownload": (downloadId: string, deleteFile?: boolean) => Promise<void>;
67
- /**
68
- * @default 30_000
69
- */
70
- "heartbeatInterval": number;
71
- /**
72
- * Open the built-in player on Play, unless a `phirepassPlay` listener calls `preventDefault()`.
73
- * @default true
74
- */
75
- "inlinePlayer": boolean;
76
- /**
77
- * The running download whose part file this is, so the SFTP client can offer K3 instead of a plain delete.
78
- */
79
- "jobForPath": (path: string) => Promise<{ download_id: string; name: string; } | null>;
80
- "nodeId": string;
81
- /**
82
- * What to call the node in sentences; the id is a uuid nobody reads.
83
- */
84
- "nodeLabel"?: string;
85
- /**
86
- * Opens the Fetch dialog (and the drawer behind it). `path` updates the folder on screen.
87
- */
88
- "openFetch": (path?: string) => Promise<void>;
89
- /**
90
- * Hands this widget a frame from a shared channel: `Download*` frames, and `Error`s answering one of its `msg_id`s. Anything else is ignored.
91
- */
92
- "receive": (msg: ProtocolMessage | { data: { web: unknown; }; }) => Promise<void>;
93
- /**
94
- * @default 'phirepass.com'
95
- */
96
- "serverHost": string;
97
- "serverId"?: string;
98
- /**
99
- * @default 443
100
- */
101
- "serverPort": number;
102
- /**
103
- * C: download the contents of a `.torrent` already on the node, into the folder it sits in.
104
- */
105
- "startTorrentPath": (path: string, inOrder?: boolean) => Promise<boolean>;
106
- /**
107
- * Base URL for `/api/web/stream/…`. Defaults to the server the channel talks to.
108
- */
109
- "streamBase"?: string;
110
- /**
111
- * Opens or closes the drawer (embedded).
112
- */
113
- "toggleDrawer": (open?: boolean) => Promise<void>;
114
- /**
115
- * Session token, for the standalone form. Not needed when `channel` is given.
116
- */
117
- "token"?: string;
118
- /**
119
- * The path of a `.torrent` on the node relative to the download folder, or null when it lies outside it (then C's menu item is not offered).
120
- */
121
- "torrentPathFor": (path: string) => Promise<string | null>;
122
- }
123
- /**
124
- * Plays a file from the node with the browser's own `<video>` or `<audio>`.
125
- * It knows nothing of channels or WASM: `src` is a stream URL the server turns
126
- * into stream events towards the agent, and the browser's range requests do
127
- * the rest. A download that is still arriving plays as far as `ready` bytes;
128
- * past that the element waits, and so does the player, saying why.
129
- */
130
- interface PhirepassMediaPlayer {
131
- /**
132
- * Shown while casting, when the host knows the device's name.
133
- */
134
- "castDevice"?: string;
135
- /**
136
- * Closes the player, saving where it stopped. The download is not affected.
137
- */
138
- "close": () => Promise<void>;
139
- /**
140
- * Makes the link a TV or VLC opens (T2.9). Defaults to POSTing `src`.
141
- */
142
- "linkMinter"?: LinkMinter;
143
- /**
144
- * Overrides the mime the extension implies.
145
- */
146
- "mime"?: string;
147
- "name": string;
148
- /**
149
- * Key for the stored position: `dl:<download_id>:<file>` or `node:<node_id>:<path>`.
150
- */
151
- "positionKey"?: string;
152
- /**
153
- * “Continue watching”. Without one, positions stay in this browser.
154
- */
155
- "positionStore"?: PositionStore;
156
- /**
157
- * Bytes ready from the start of the file, while it is still downloading.
158
- */
159
- "ready"?: number;
160
- /**
161
- * Stands in for `video.remote`, for demos and tests (like `channelFactory`).
162
- */
163
- "remotePlayback"?: RemotePlaybackLike;
164
- /**
165
- * The stream URL: `/api/web/stream/{node}/{download}/{file}` or a listing token URL.
166
- */
167
- "src": string;
168
- /**
169
- * The status line above the picture, from the job: “Downloading · 23.4%”, “On the node”.
170
- */
171
- "status"?: string;
172
- }
173
22
  interface PhirepassRdp {
174
23
  /**
175
24
  * @default false
@@ -180,10 +29,6 @@ export namespace Components {
180
29
  * @default true
181
30
  */
182
31
  "captureKeyboard": boolean;
183
- /**
184
- * Supplies the channel instead of a WebSocket to the server — for demos, screenshots and tests, as on the terminal and SFTP client. A property only; read once, when the widget connects.
185
- */
186
- "channelFactory"?: (endpoint: string, nodeId: string, serverId?: string) => RdpChannelLike;
187
32
  /**
188
33
  * Share the clipboard with the remote host in both directions. On is the client's own default and needs nothing from us, so this exists to turn it **off**: a deployment that treats copy-out as exfiltration can take the clipboard away without giving up the session. Clipboard access additionally needs a secure context — over plain HTTP the browser refuses it whatever this says, and the client's warning is logged.
189
34
  * @default true
@@ -321,14 +166,6 @@ export namespace Components {
321
166
  "token": string;
322
167
  }
323
168
  }
324
- export interface PhirepassDownloaderCustomEvent<T> extends CustomEvent<T> {
325
- detail: T;
326
- target: HTMLPhirepassDownloaderElement;
327
- }
328
- export interface PhirepassMediaPlayerCustomEvent<T> extends CustomEvent<T> {
329
- detail: T;
330
- target: HTMLPhirepassMediaPlayerElement;
331
- }
332
169
  export interface PhirepassRdpCustomEvent<T> extends CustomEvent<T> {
333
170
  detail: T;
334
171
  target: HTMLPhirepassRdpElement;
@@ -342,67 +179,18 @@ export interface PhirepassTerminalCustomEvent<T> extends CustomEvent<T> {
342
179
  target: HTMLPhirepassTerminalElement;
343
180
  }
344
181
  declare global {
345
- interface HTMLPhirepassDownloaderElementEventMap {
346
- "phirepassFetchCompleted": { download_id: string; dest_root: string; sub_dir: string | null; name: string };
347
- "phirepassPlay": { src: string; name: string; downloadId: string };
348
- "phirepassActiveCount": { n: number };
349
- "phirepassShowInFolder": { path: string; name: string };
350
- "phirepassOpenNodeSettings": { nodeId: string };
351
- "phirepassSignIn": void;
352
- }
353
- /**
354
- * Remote Fetch: paste a link or a magnet, or drop a `.torrent`, and the node
355
- * downloads it into its own download folder.
356
- * Two forms, one component. **Embedded** in the SFTP browser (`compact`), it
357
- * shares the host's channel, which forwards it the `Download*` frames through
358
- * `receive()`, and saves into the folder on screen when the node can map it.
359
- * **Standalone**, it builds its own channel, signs in with `token`, and saves
360
- * into the download folder or a sub-folder of it. Either way it never asks for
361
- * a login: the node writes its own files.
362
- * The widget only sends events and shows progress. Downloads run on the node
363
- * and carry on after the tab closes.
364
- */
365
- interface HTMLPhirepassDownloaderElement extends Components.PhirepassDownloader, HTMLStencilElement {
366
- addEventListener<K extends keyof HTMLPhirepassDownloaderElementEventMap>(type: K, listener: (this: HTMLPhirepassDownloaderElement, ev: PhirepassDownloaderCustomEvent<HTMLPhirepassDownloaderElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
367
- addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
368
- addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
369
- addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
370
- removeEventListener<K extends keyof HTMLPhirepassDownloaderElementEventMap>(type: K, listener: (this: HTMLPhirepassDownloaderElement, ev: PhirepassDownloaderCustomEvent<HTMLPhirepassDownloaderElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
371
- removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
372
- removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
373
- removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
374
- }
375
- var HTMLPhirepassDownloaderElement: {
376
- prototype: HTMLPhirepassDownloaderElement;
377
- new (): HTMLPhirepassDownloaderElement;
378
- };
379
- interface HTMLPhirepassMediaPlayerElementEventMap {
380
- "phirepassPlayerClose": void;
381
- }
382
- /**
383
- * Plays a file from the node with the browser's own `<video>` or `<audio>`.
384
- * It knows nothing of channels or WASM: `src` is a stream URL the server turns
385
- * into stream events towards the agent, and the browser's range requests do
386
- * the rest. A download that is still arriving plays as far as `ready` bytes;
387
- * past that the element waits, and so does the player, saying why.
388
- */
389
- interface HTMLPhirepassMediaPlayerElement extends Components.PhirepassMediaPlayer, HTMLStencilElement {
390
- addEventListener<K extends keyof HTMLPhirepassMediaPlayerElementEventMap>(type: K, listener: (this: HTMLPhirepassMediaPlayerElement, ev: PhirepassMediaPlayerCustomEvent<HTMLPhirepassMediaPlayerElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
391
- addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
392
- addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
393
- addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
394
- removeEventListener<K extends keyof HTMLPhirepassMediaPlayerElementEventMap>(type: K, listener: (this: HTMLPhirepassMediaPlayerElement, ev: PhirepassMediaPlayerCustomEvent<HTMLPhirepassMediaPlayerElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
395
- removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
396
- removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
397
- removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
398
- }
399
- var HTMLPhirepassMediaPlayerElement: {
400
- prototype: HTMLPhirepassMediaPlayerElement;
401
- new (): HTMLPhirepassMediaPlayerElement;
402
- };
403
182
  interface HTMLPhirepassRdpElementEventMap {
404
183
  "connectionStateChanged": [ConnectionState, unknown?];
405
184
  }
185
+ /**
186
+ * Remote desktop over RDP.
187
+ * Unlike the terminal and SFTP widgets this one does not pipe protocol bytes
188
+ * through the phirepass channel. The channel is used only to authorise the
189
+ * session; the actual RDP stream runs on a second WebSocket opened by IronRDP's
190
+ * own client, because that client speaks RDCleanPath and can set neither
191
+ * headers nor a subprotocol on the socket it opens. See `RDP.md` in
192
+ * `phirepass-rs` for why the session is split across two sockets.
193
+ */
406
194
  interface HTMLPhirepassRdpElement extends Components.PhirepassRdp, HTMLStencilElement {
407
195
  addEventListener<K extends keyof HTMLPhirepassRdpElementEventMap>(type: K, listener: (this: HTMLPhirepassRdpElement, ev: PhirepassRdpCustomEvent<HTMLPhirepassRdpElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
408
196
  addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
@@ -453,8 +241,6 @@ declare global {
453
241
  new (): HTMLPhirepassTerminalElement;
454
242
  };
455
243
  interface HTMLElementTagNameMap {
456
- "phirepass-downloader": HTMLPhirepassDownloaderElement;
457
- "phirepass-media-player": HTMLPhirepassMediaPlayerElement;
458
244
  "phirepass-rdp": HTMLPhirepassRdpElement;
459
245
  "phirepass-sftp-client": HTMLPhirepassSftpClientElement;
460
246
  "phirepass-terminal": HTMLPhirepassTerminalElement;
@@ -464,156 +250,14 @@ declare namespace LocalJSX {
464
250
  type OneOf<K extends string, PropT, AttrT = PropT> = { [P in K]: PropT } & { [P in `attr:${K}`]?: never } | { [P in `attr:${K}`]: AttrT } & { [P in K]?: never };
465
251
 
466
252
  /**
467
- * Remote Fetch: paste a link or a magnet, or drop a `.torrent`, and the node
468
- * downloads it into its own download folder.
469
- * Two forms, one component. **Embedded** in the SFTP browser (`compact`), it
470
- * shares the host's channel, which forwards it the `Download*` frames through
471
- * `receive()`, and saves into the folder on screen when the node can map it.
472
- * **Standalone**, it builds its own channel, signs in with `token`, and saves
473
- * into the download folder or a sub-folder of it. Either way it never asks for
474
- * a login: the node writes its own files.
475
- * The widget only sends events and shows progress. Downloads run on the node
476
- * and carry on after the tab closes.
477
- */
478
- interface PhirepassDownloader {
479
- /**
480
- * @default false
481
- */
482
- "allowInsecure"?: boolean;
483
- /**
484
- * The folder on screen in the host. Downloads land here when it lies inside the download folder.
485
- */
486
- "browsingPath"?: string;
487
- /**
488
- * The SFTP/SSH service the host is browsing, so the node can map `browsingPath`.
489
- */
490
- "browsingService"?: string;
491
- /**
492
- * Whether the viewer may configure this node, which only changes advice text (B9).
493
- * @default false
494
- */
495
- "canConfigure"?: boolean;
496
- /**
497
- * A channel to share instead of opening one: the SFTP client passes its own. The host must forward `Download*` frames (and `Error`s whose `msg_id` is at or above `DOWNLOADER_MSG_ID_BASE`) to `receive()`, and set `connected` once the channel is authenticated.
498
- */
499
- "channel"?: DownloadChannelLike;
500
- /**
501
- * Builds the channel in place of a WebSocket, for demos and tests (see `ChannelFactory`).
502
- */
503
- "channelFactory"?: DownloadChannelFactory;
504
- /**
505
- * The drawer layout used inside the SFTP browser.
506
- * @default false
507
- */
508
- "compact"?: boolean;
509
- /**
510
- * With an injected `channel`: whether it is authenticated and usable.
511
- * @default false
512
- */
513
- "connected"?: boolean;
514
- /**
515
- * @default 30_000
516
- */
517
- "heartbeatInterval"?: number;
518
- /**
519
- * Open the built-in player on Play, unless a `phirepassPlay` listener calls `preventDefault()`.
520
- * @default true
521
- */
522
- "inlinePlayer"?: boolean;
523
- "nodeId": string;
524
- /**
525
- * What to call the node in sentences; the id is a uuid nobody reads.
526
- */
527
- "nodeLabel"?: string;
528
- /**
529
- * How many downloads are running, for a badge.
530
- */
531
- "onPhirepassActiveCount"?: (event: PhirepassDownloaderCustomEvent<{ n: number }>) => void;
532
- /**
533
- * A finished download, once per job. The SFTP client refreshes when it lands in the open folder.
534
- */
535
- "onPhirepassFetchCompleted"?: (event: PhirepassDownloaderCustomEvent<{ download_id: string; dest_root: string; sub_dir: string | null; name: string }>) => void;
536
- /**
537
- * “Open node settings” (B9, no folder).
538
- */
539
- "onPhirepassOpenNodeSettings"?: (event: PhirepassDownloaderCustomEvent<{ nodeId: string }>) => void;
540
- /**
541
- * Play was pressed. Cancelable: prevent it to open your own player instead.
542
- */
543
- "onPhirepassPlay"?: (event: PhirepassDownloaderCustomEvent<{ src: string; name: string; downloadId: string }>) => void;
544
- /**
545
- * “Show in folder” on a finished row.
546
- */
547
- "onPhirepassShowInFolder"?: (event: PhirepassDownloaderCustomEvent<{ path: string; name: string }>) => void;
548
- /**
549
- * “Sign in” (X3).
550
- */
551
- "onPhirepassSignIn"?: (event: PhirepassDownloaderCustomEvent<void>) => void;
552
- /**
553
- * @default 'phirepass.com'
554
- */
555
- "serverHost"?: string;
556
- "serverId"?: string;
557
- /**
558
- * @default 443
559
- */
560
- "serverPort"?: number;
561
- /**
562
- * Base URL for `/api/web/stream/…`. Defaults to the server the channel talks to.
563
- */
564
- "streamBase"?: string;
565
- /**
566
- * Session token, for the standalone form. Not needed when `channel` is given.
567
- */
568
- "token"?: string;
569
- }
570
- /**
571
- * Plays a file from the node with the browser's own `<video>` or `<audio>`.
572
- * It knows nothing of channels or WASM: `src` is a stream URL the server turns
573
- * into stream events towards the agent, and the browser's range requests do
574
- * the rest. A download that is still arriving plays as far as `ready` bytes;
575
- * past that the element waits, and so does the player, saying why.
253
+ * Remote desktop over RDP.
254
+ * Unlike the terminal and SFTP widgets this one does not pipe protocol bytes
255
+ * through the phirepass channel. The channel is used only to authorise the
256
+ * session; the actual RDP stream runs on a second WebSocket opened by IronRDP's
257
+ * own client, because that client speaks RDCleanPath and can set neither
258
+ * headers nor a subprotocol on the socket it opens. See `RDP.md` in
259
+ * `phirepass-rs` for why the session is split across two sockets.
576
260
  */
577
- interface PhirepassMediaPlayer {
578
- /**
579
- * Shown while casting, when the host knows the device's name.
580
- */
581
- "castDevice"?: string;
582
- /**
583
- * Makes the link a TV or VLC opens (T2.9). Defaults to POSTing `src`.
584
- */
585
- "linkMinter"?: LinkMinter;
586
- /**
587
- * Overrides the mime the extension implies.
588
- */
589
- "mime"?: string;
590
- "name": string;
591
- "onPhirepassPlayerClose"?: (event: PhirepassMediaPlayerCustomEvent<void>) => void;
592
- /**
593
- * Key for the stored position: `dl:<download_id>:<file>` or `node:<node_id>:<path>`.
594
- */
595
- "positionKey"?: string;
596
- /**
597
- * “Continue watching”. Without one, positions stay in this browser.
598
- */
599
- "positionStore"?: PositionStore;
600
- /**
601
- * Bytes ready from the start of the file, while it is still downloading.
602
- */
603
- "ready"?: number;
604
- /**
605
- * Stands in for `video.remote`, for demos and tests (like `channelFactory`).
606
- */
607
- "remotePlayback"?: RemotePlaybackLike;
608
- /**
609
- * The stream URL: `/api/web/stream/{node}/{download}/{file}` or a listing token URL.
610
- */
611
- "src": string;
612
- /**
613
- * The status line above the picture, from the job: “Downloading · 23.4%”, “On the node”.
614
- */
615
- "status"?: string;
616
- }
617
261
  interface PhirepassRdp {
618
262
  /**
619
263
  * @default false
@@ -624,10 +268,6 @@ declare namespace LocalJSX {
624
268
  * @default true
625
269
  */
626
270
  "captureKeyboard"?: boolean;
627
- /**
628
- * Supplies the channel instead of a WebSocket to the server — for demos, screenshots and tests, as on the terminal and SFTP client. A property only; read once, when the widget connects.
629
- */
630
- "channelFactory"?: (endpoint: string, nodeId: string, serverId?: string) => RdpChannelLike;
631
271
  /**
632
272
  * Share the clipboard with the remote host in both directions. On is the client's own default and needs nothing from us, so this exists to turn it **off**: a deployment that treats copy-out as exfiltration can take the clipboard away without giving up the session. Clipboard access additionally needs a secure context — over plain HTTP the browser refuses it whatever this says, and the client's warning is logged.
633
273
  * @default true
@@ -747,32 +387,6 @@ declare namespace LocalJSX {
747
387
  "token": string;
748
388
  }
749
389
 
750
- interface PhirepassDownloaderAttributes {
751
- "nodeId": string;
752
- "nodeLabel": string;
753
- "token": string;
754
- "connected": boolean;
755
- "browsingService": string;
756
- "browsingPath": string;
757
- "compact": boolean;
758
- "streamBase": string;
759
- "canConfigure": boolean;
760
- "inlinePlayer": boolean;
761
- "serverHost": string;
762
- "serverPort": number;
763
- "serverId": string;
764
- "allowInsecure": boolean;
765
- "heartbeatInterval": number;
766
- }
767
- interface PhirepassMediaPlayerAttributes {
768
- "src": string;
769
- "name": string;
770
- "mime": string;
771
- "status": string;
772
- "ready": number;
773
- "positionKey": string;
774
- "castDevice": string;
775
- }
776
390
  interface PhirepassRdpAttributes {
777
391
  "serverHost": string;
778
392
  "serverPort": number;
@@ -816,8 +430,6 @@ declare namespace LocalJSX {
816
430
  }
817
431
 
818
432
  interface IntrinsicElements {
819
- "phirepass-downloader": Omit<PhirepassDownloader, keyof PhirepassDownloaderAttributes> & { [K in keyof PhirepassDownloader & keyof PhirepassDownloaderAttributes]?: PhirepassDownloader[K] } & { [K in keyof PhirepassDownloader & keyof PhirepassDownloaderAttributes as `attr:${K}`]?: PhirepassDownloaderAttributes[K] } & { [K in keyof PhirepassDownloader & keyof PhirepassDownloaderAttributes as `prop:${K}`]?: PhirepassDownloader[K] } & OneOf<"nodeId", PhirepassDownloader["nodeId"], PhirepassDownloaderAttributes["nodeId"]>;
820
- "phirepass-media-player": Omit<PhirepassMediaPlayer, keyof PhirepassMediaPlayerAttributes> & { [K in keyof PhirepassMediaPlayer & keyof PhirepassMediaPlayerAttributes]?: PhirepassMediaPlayer[K] } & { [K in keyof PhirepassMediaPlayer & keyof PhirepassMediaPlayerAttributes as `attr:${K}`]?: PhirepassMediaPlayerAttributes[K] } & { [K in keyof PhirepassMediaPlayer & keyof PhirepassMediaPlayerAttributes as `prop:${K}`]?: PhirepassMediaPlayer[K] } & OneOf<"src", PhirepassMediaPlayer["src"], PhirepassMediaPlayerAttributes["src"]> & OneOf<"name", PhirepassMediaPlayer["name"], PhirepassMediaPlayerAttributes["name"]>;
821
433
  "phirepass-rdp": Omit<PhirepassRdp, keyof PhirepassRdpAttributes> & { [K in keyof PhirepassRdp & keyof PhirepassRdpAttributes]?: PhirepassRdp[K] } & { [K in keyof PhirepassRdp & keyof PhirepassRdpAttributes as `attr:${K}`]?: PhirepassRdpAttributes[K] } & { [K in keyof PhirepassRdp & keyof PhirepassRdpAttributes as `prop:${K}`]?: PhirepassRdp[K] } & OneOf<"nodeId", PhirepassRdp["nodeId"], PhirepassRdpAttributes["nodeId"]> & OneOf<"serviceId", PhirepassRdp["serviceId"], PhirepassRdpAttributes["serviceId"]> & OneOf<"token", PhirepassRdp["token"], PhirepassRdpAttributes["token"]>;
822
434
  "phirepass-sftp-client": Omit<PhirepassSftpClient, keyof PhirepassSftpClientAttributes> & { [K in keyof PhirepassSftpClient & keyof PhirepassSftpClientAttributes]?: PhirepassSftpClient[K] } & { [K in keyof PhirepassSftpClient & keyof PhirepassSftpClientAttributes as `attr:${K}`]?: PhirepassSftpClientAttributes[K] } & { [K in keyof PhirepassSftpClient & keyof PhirepassSftpClientAttributes as `prop:${K}`]?: PhirepassSftpClient[K] } & OneOf<"nodeId", PhirepassSftpClient["nodeId"], PhirepassSftpClientAttributes["nodeId"]> & OneOf<"serviceId", PhirepassSftpClient["serviceId"], PhirepassSftpClientAttributes["serviceId"]> & OneOf<"token", PhirepassSftpClient["token"], PhirepassSftpClientAttributes["token"]>;
823
435
  "phirepass-terminal": Omit<PhirepassTerminal, keyof PhirepassTerminalAttributes> & { [K in keyof PhirepassTerminal & keyof PhirepassTerminalAttributes]?: PhirepassTerminal[K] } & { [K in keyof PhirepassTerminal & keyof PhirepassTerminalAttributes as `attr:${K}`]?: PhirepassTerminalAttributes[K] } & { [K in keyof PhirepassTerminal & keyof PhirepassTerminalAttributes as `prop:${K}`]?: PhirepassTerminal[K] } & OneOf<"nodeId", PhirepassTerminal["nodeId"], PhirepassTerminalAttributes["nodeId"]> & OneOf<"serviceId", PhirepassTerminal["serviceId"], PhirepassTerminalAttributes["serviceId"]> & OneOf<"token", PhirepassTerminal["token"], PhirepassTerminalAttributes["token"]>;
@@ -828,26 +440,14 @@ declare module "@stencil/core" {
828
440
  export namespace JSX {
829
441
  interface IntrinsicElements {
830
442
  /**
831
- * Remote Fetch: paste a link or a magnet, or drop a `.torrent`, and the node
832
- * downloads it into its own download folder.
833
- * Two forms, one component. **Embedded** in the SFTP browser (`compact`), it
834
- * shares the host's channel, which forwards it the `Download*` frames through
835
- * `receive()`, and saves into the folder on screen when the node can map it.
836
- * **Standalone**, it builds its own channel, signs in with `token`, and saves
837
- * into the download folder or a sub-folder of it. Either way it never asks for
838
- * a login: the node writes its own files.
839
- * The widget only sends events and shows progress. Downloads run on the node
840
- * and carry on after the tab closes.
841
- */
842
- "phirepass-downloader": LocalJSX.IntrinsicElements["phirepass-downloader"] & JSXBase.HTMLAttributes<HTMLPhirepassDownloaderElement>;
843
- /**
844
- * Plays a file from the node with the browser's own `<video>` or `<audio>`.
845
- * It knows nothing of channels or WASM: `src` is a stream URL the server turns
846
- * into stream events towards the agent, and the browser's range requests do
847
- * the rest. A download that is still arriving plays as far as `ready` bytes;
848
- * past that the element waits, and so does the player, saying why.
443
+ * Remote desktop over RDP.
444
+ * Unlike the terminal and SFTP widgets this one does not pipe protocol bytes
445
+ * through the phirepass channel. The channel is used only to authorise the
446
+ * session; the actual RDP stream runs on a second WebSocket opened by IronRDP's
447
+ * own client, because that client speaks RDCleanPath and can set neither
448
+ * headers nor a subprotocol on the socket it opens. See `RDP.md` in
449
+ * `phirepass-rs` for why the session is split across two sockets.
849
450
  */
850
- "phirepass-media-player": LocalJSX.IntrinsicElements["phirepass-media-player"] & JSXBase.HTMLAttributes<HTMLPhirepassMediaPlayerElement>;
851
451
  "phirepass-rdp": LocalJSX.IntrinsicElements["phirepass-rdp"] & JSXBase.HTMLAttributes<HTMLPhirepassRdpElement>;
852
452
  "phirepass-sftp-client": LocalJSX.IntrinsicElements["phirepass-sftp-client"] & JSXBase.HTMLAttributes<HTMLPhirepassSftpClientElement>;
853
453
  "phirepass-terminal": LocalJSX.IntrinsicElements["phirepass-terminal"] & JSXBase.HTMLAttributes<HTMLPhirepassTerminalElement>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phirepass-widgets",
3
- "version": "0.0.117",
3
+ "version": "0.0.118",
4
4
  "description": "Phirepass widgets for the web application",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -37,28 +37,14 @@
37
37
  "build": "stencil build",
38
38
  "build:prod": "stencil build --prod",
39
39
  "start": "stencil build --dev --watch --serve",
40
- "test": "vitest run --config vitest.config.mts --project spec",
41
- "test.watch": "vitest --config vitest.config.mts --project spec",
42
- "test:storybook": "stencil build && vitest run --config vitest.config.mts --project storybook",
43
- "test:all": "bun run test && bun run test:storybook",
44
- "storybook": "stencil build && storybook dev -p 6006",
45
- "build-storybook": "stencil build && storybook build",
40
+ "test": "vitest run --config vitest.config.mts",
41
+ "test.watch": "vitest --config vitest.config.mts",
46
42
  "generate": "stencil generate"
47
43
  },
48
44
  "devDependencies": {
49
45
  "@stencil/core": "^4.45.5",
50
46
  "@stencil/vitest": "^1.16.2",
51
- "@storybook/addon-a11y": "^10.6.8",
52
- "@storybook/addon-docs": "^10.6.8",
53
- "@storybook/addon-vitest": "^10.6.8",
54
- "@storybook/web-components-vite": "^10.6.8",
55
47
  "@types/node": "^26.6.6",
56
- "@vitest/browser": "^5.1.1",
57
- "@vitest/browser-playwright": "^5.1.1",
58
- "lit": "^3.3.3",
59
- "playwright": "^1.65.1",
60
- "storybook": "^10.6.8",
61
- "vite": "^8.3.8",
62
48
  "vitest": "^5.1.1"
63
49
  },
64
50
  "license": "AGPL-3.0-or-later",
@@ -72,6 +58,6 @@
72
58
  "@xterm/addon-web-links": "^0.12.0",
73
59
  "@xterm/addon-webgl": "^0.19.0",
74
60
  "@xterm/xterm": "^6.0.0",
75
- "phirepass-channel": "^0.1.358"
61
+ "phirepass-channel": "0.1.356"
76
62
  }
77
63
  }