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,43 @@
|
|
|
1
|
+
/** A stored playback position. `at` is when it was saved (unix ms). */
|
|
2
|
+
export type StoredPosition = {
|
|
3
|
+
secs: number;
|
|
4
|
+
duration: number;
|
|
5
|
+
at: number;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Where “Continue watching” keeps positions. The dashboard implements it with
|
|
9
|
+
* `/api/playback`; with none given the player falls back to `localStorage`.
|
|
10
|
+
*/
|
|
11
|
+
export type PositionStore = {
|
|
12
|
+
get(key: string): Promise<StoredPosition | null>;
|
|
13
|
+
set(key: string, secs: number, duration: number): Promise<void>;
|
|
14
|
+
clear?(key: string): Promise<void>;
|
|
15
|
+
};
|
|
16
|
+
export declare function extOf(name: string): string;
|
|
17
|
+
/** Mime from the extension, as the agent's stream server decides it. */
|
|
18
|
+
export declare function mimeFor(name: string): string;
|
|
19
|
+
export declare function isAudio(name: string, mime?: string): boolean;
|
|
20
|
+
export declare function isPlayableName(name: string): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Whether a Cast receiver can play this. The Default Media Receiver plays MP4
|
|
23
|
+
* (H.264/AAC), WebM and common audio, mostly not MKV or MOV.
|
|
24
|
+
*/
|
|
25
|
+
export declare function castBlocker(name: string, mime?: string): string | null;
|
|
26
|
+
/** Nothing is saved in the first 30 seconds. */
|
|
27
|
+
export declare const SAVE_AFTER_SECS = 30;
|
|
28
|
+
export declare const SAVE_EVERY_MS = 10000;
|
|
29
|
+
/** Past 95%, or within the last two minutes, the file counts as watched and the position is cleared. */
|
|
30
|
+
export declare function isWatched(secs: number, duration: number): boolean;
|
|
31
|
+
export type PositionAction = 'skip' | 'save' | 'clear';
|
|
32
|
+
export declare function positionAction(secs: number, duration: number): PositionAction;
|
|
33
|
+
/** The fallback store, per browser. Every access is guarded: storage can be missing or refuse. */
|
|
34
|
+
export declare const localPositionStore: PositionStore;
|
|
35
|
+
/** The subset of `RemotePlayback` the player uses; a property seam for demos and tests. */
|
|
36
|
+
export type RemotePlaybackLike = {
|
|
37
|
+
state: 'disconnected' | 'connecting' | 'connected';
|
|
38
|
+
watchAvailability(cb: (available: boolean) => void): Promise<number>;
|
|
39
|
+
cancelWatchAvailability(id?: number): Promise<void>;
|
|
40
|
+
prompt(): Promise<void>;
|
|
41
|
+
addEventListener(type: 'connect' | 'connecting' | 'disconnect', cb: () => void): void;
|
|
42
|
+
removeEventListener(type: 'connect' | 'connecting' | 'disconnect', cb: () => void): void;
|
|
43
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
import { Channel as PhirepassChannel } from 'phirepass-channel';
|
|
2
3
|
import { ConnectionState } from '../../common/protocol';
|
|
3
4
|
/**
|
|
4
5
|
* Remote desktop over RDP.
|
|
@@ -10,6 +11,8 @@ import { ConnectionState } from '../../common/protocol';
|
|
|
10
11
|
* headers nor a subprotocol on the socket it opens. See `RDP.md` in
|
|
11
12
|
* `phirepass-rs` for why the session is split across two sockets.
|
|
12
13
|
*/
|
|
14
|
+
/** What the RDP widget calls on its channel. */
|
|
15
|
+
type RdpChannelLike = Pick<PhirepassChannel, 'connect' | 'disconnect' | 'is_connected' | 'authenticate' | 'start_heartbeat' | 'stop_heartbeat' | 'on_connection_open' | 'on_connection_close' | 'on_connection_error' | 'on_connection_message' | 'on_protocol_message' | 'open_rdp_tunnel'>;
|
|
13
16
|
export declare class PhirepassRdp {
|
|
14
17
|
private channel;
|
|
15
18
|
private containerEl?;
|
|
@@ -90,6 +93,12 @@ export declare class PhirepassRdp {
|
|
|
90
93
|
clipboard: boolean;
|
|
91
94
|
onNodeIdChange(newValue?: string, _oldValue?: string): void;
|
|
92
95
|
serverId?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Supplies the channel instead of a WebSocket to the server — for demos,
|
|
98
|
+
* screenshots and tests, as on the terminal and SFTP client. A property
|
|
99
|
+
* only; read once, when the widget connects.
|
|
100
|
+
*/
|
|
101
|
+
channelFactory?: (endpoint: string, nodeId: string, serverId?: string) => RdpChannelLike;
|
|
93
102
|
onServerIdChange(_newValue?: string, _oldValue?: string): void;
|
|
94
103
|
connectionStateChanged: EventEmitter<[ConnectionState, unknown?]>;
|
|
95
104
|
private create_web_socket_endpoint;
|
|
@@ -199,3 +208,4 @@ export declare class PhirepassRdp {
|
|
|
199
208
|
private submit_credentials;
|
|
200
209
|
render(): any;
|
|
201
210
|
}
|
|
211
|
+
export {};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
2
|
import type { ChannelFactory } from '../../common/channel';
|
|
3
|
+
import { TorrentMenu } from './phirepass-sftp-client.fetch';
|
|
3
4
|
import { ConnectionState, SFTPListItem } from '../../common/protocol';
|
|
4
5
|
/** Which single-text-field dialog is open, if any. */
|
|
5
6
|
type PromptKind = 'mkdir' | 'rename';
|
|
6
7
|
type SortKey = 'name' | 'size' | 'modified';
|
|
7
8
|
export declare class PhirepassSftpClient {
|
|
9
|
+
el_host: HTMLElement;
|
|
8
10
|
private channel;
|
|
9
11
|
private domReady;
|
|
10
12
|
private runtimeReady;
|
|
@@ -102,6 +104,33 @@ export declare class PhirepassSftpClient {
|
|
|
102
104
|
filter: string;
|
|
103
105
|
sort_key: SortKey;
|
|
104
106
|
sort_asc: boolean;
|
|
107
|
+
/** True once the channel is authenticated: the downloader shares it from then on. */
|
|
108
|
+
channel_ready: boolean;
|
|
109
|
+
/** Running downloads, for the Fetch button's badge. */
|
|
110
|
+
fetch_count: number;
|
|
111
|
+
/** Files a download just finished into the open folder, highlighted as new. */
|
|
112
|
+
fresh_names: Array<string>;
|
|
113
|
+
/** K3: a part file whose download a delete would end. */
|
|
114
|
+
part_delete: {
|
|
115
|
+
download_id: string;
|
|
116
|
+
name: string;
|
|
117
|
+
busy: boolean;
|
|
118
|
+
} | null;
|
|
119
|
+
torrent_menu: TorrentMenu | null;
|
|
120
|
+
/** A listing file open in the player (not a download). */
|
|
121
|
+
listing_player: {
|
|
122
|
+
src: string;
|
|
123
|
+
name: string;
|
|
124
|
+
key: string;
|
|
125
|
+
} | null;
|
|
126
|
+
private downloaderEl?;
|
|
127
|
+
private fetch_enabled;
|
|
128
|
+
private stream_base;
|
|
129
|
+
private on_fetch_completed;
|
|
130
|
+
private on_show_in_folder;
|
|
131
|
+
private on_row_context_menu;
|
|
132
|
+
private play_listing_file;
|
|
133
|
+
private listing_can_play;
|
|
105
134
|
private toggle_max;
|
|
106
135
|
connectedCallback(): Promise<void>;
|
|
107
136
|
componentDidLoad(): void;
|
|
@@ -161,6 +190,7 @@ export declare class PhirepassSftpClient {
|
|
|
161
190
|
private disconnect_session;
|
|
162
191
|
private on_file_row_action;
|
|
163
192
|
private on_file_delete_action;
|
|
193
|
+
private open_delete_prompt;
|
|
164
194
|
private cancel_delete;
|
|
165
195
|
private confirm_delete;
|
|
166
196
|
private open_mkdir;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The SFTP browser's side of Remote Fetch, kept out of the component so it
|
|
3
|
+
* stays a host and nothing more: the downloads themselves are the
|
|
4
|
+
* `<phirepass-downloader>`'s, and nothing here goes over SFTP.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PART_SUFFIX = ".phirepass-part";
|
|
7
|
+
export declare function isPartFile(name: string): boolean;
|
|
8
|
+
export declare function isPlayableFile(name: string): boolean;
|
|
9
|
+
/** Whether a finished download's folder is the one on screen. */
|
|
10
|
+
export declare function sameFolder(a: string, b: string): boolean;
|
|
11
|
+
export declare function folderOfCompleted(detail: {
|
|
12
|
+
dest_root: string;
|
|
13
|
+
sub_dir: string | null;
|
|
14
|
+
}): string;
|
|
15
|
+
export declare const FetchButton: ({ count, onClick }: {
|
|
16
|
+
count: number;
|
|
17
|
+
onClick: () => void;
|
|
18
|
+
}) => any;
|
|
19
|
+
/** K3: replaces the plain delete prompt for a part file that belongs to a running download. */
|
|
20
|
+
export declare const PartDeleteDialog: ({ name, busy, onCancel, onConfirm }: {
|
|
21
|
+
name: string;
|
|
22
|
+
busy: boolean;
|
|
23
|
+
onCancel: () => void;
|
|
24
|
+
onConfirm: () => void;
|
|
25
|
+
}) => any;
|
|
26
|
+
export type TorrentMenu = {
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
path: string;
|
|
30
|
+
name: string;
|
|
31
|
+
};
|
|
32
|
+
/** C: right-click a `.torrent` that lies inside the node's download folder. */
|
|
33
|
+
export declare const TorrentContextMenu: ({ menu, onFetch, onDownload, onRename, onDelete, onClose, }: {
|
|
34
|
+
menu: TorrentMenu;
|
|
35
|
+
onFetch: () => void;
|
|
36
|
+
onDownload: () => void;
|
|
37
|
+
onRename: () => void;
|
|
38
|
+
onDelete: () => void;
|
|
39
|
+
onClose: () => void;
|
|
40
|
+
}) => any;
|