@coasys/ad4m-connect 0.13.0-test-6 → 0.13.0-test-8
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/dist/PostMessageFetch.d.ts +12 -0
- package/dist/PostMessageWebSocket.d.ts +30 -0
- package/dist/core.js +1257 -739
- package/dist/core.js.map +4 -4
- package/dist/index.js +1256 -757
- package/dist/index.js.map +4 -4
- package/dist/utils.js +1 -1
- package/dist/web.js +3116 -512
- package/dist/web.js.map +3 -3
- package/package.json +17 -17
- package/dist/components/icons/CheckCircleIcon.d.ts +0 -1
- package/dist/components/icons/TickIcon.d.ts +0 -1
- package/dist/components/shared/Ad4mLogo.d.ts +0 -1
- package/dist/components/shared/AppLogo.d.ts +0 -1
- package/dist/components/shared/Header.d.ts +0 -1
- package/dist/components/shared/Logo.d.ts +0 -1
- package/dist/components/states/ErrorState.d.ts +0 -6
- package/dist/components/views/ConnectionOverview.d.ts +0 -22
- package/dist/components/views/Hosting.d.ts +0 -22
- package/dist/components/views/MultiUserAuth.d.ts +0 -26
- package/dist/components/views/RemoteConnection.d.ts +0 -19
- package/dist/components/views/RequestCapability.d.ts +0 -16
- package/dist/components/views/ScanQRCode.d.ts +0 -14
- package/dist/components/views/Settings.d.ts +0 -19
- package/dist/components/views/Start.d.ts +0 -19
- package/dist/components/views/old/Hosting.d.ts +0 -22
- package/dist/components/views/old/MultiUserAuth.d.ts +0 -26
- package/dist/components/views/old/RemoteConnection.d.ts +0 -19
- package/dist/components/views/old/RequestCapability.d.ts +0 -16
- package/dist/components/views/old/ScanQRCode.d.ts +0 -14
- package/dist/components/views/old/Settings.d.ts +0 -19
- package/dist/components/views/old/Start.d.ts +0 -19
- package/dist/old/components/InvalidToken.d.ts +0 -0
- package/dist/old/components/VerifyCode.d.ts +0 -0
- package/dist/old/core.d.ts +0 -0
- package/dist/old/electron.d.ts +0 -0
- package/dist/old/state/ConnectState.d.ts +0 -0
- package/dist/old/state/index.d.ts +0 -0
- package/dist/old/utils.d.ts +0 -0
- package/dist/old/views/Hosting.d.ts +0 -0
- package/dist/old/views/MultiUserAuth.d.ts +0 -0
- package/dist/old/views/RemoteConnection.d.ts +0 -0
- package/dist/old/views/RequestCapability.d.ts +0 -0
- package/dist/old/views/ScanQRCode.d.ts +0 -0
- package/dist/old/views/Settings.d.ts +0 -0
- package/dist/old/views/Start.d.ts +0 -0
- package/dist/old/web.d.ts +0 -0
- package/dist/state/ConnectState.d.ts +0 -101
- package/dist/state/index.d.ts +0 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Proxies an HTTP fetch request through window.parent via postMessage.
|
|
3
|
+
*
|
|
4
|
+
* Used in embedded proxy mode where the iframe cannot reach the AD4M executor
|
|
5
|
+
* directly (e.g. when hosted on a different origin inside WE). The parent
|
|
6
|
+
* receives the AD4M_PROXY_HTTP_REQUEST message, performs the real fetch, and
|
|
7
|
+
* replies with AD4M_PROXY_HTTP_RESPONSE / AD4M_PROXY_HTTP_ERROR.
|
|
8
|
+
*
|
|
9
|
+
* The request URL may use the placeholder origin 'http://proxy' — the parent
|
|
10
|
+
* replaces it with the real executor base URL before fetching.
|
|
11
|
+
*/
|
|
12
|
+
export declare function makePostMessageFetch(targetOrigin: string): typeof fetch;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A WebSocket-compatible class that proxies all communication through
|
|
3
|
+
* window.parent via postMessage instead of opening a real WebSocket.
|
|
4
|
+
*
|
|
5
|
+
* Used in embedded mode when the host/parent application sends AD4M_CONFIG
|
|
6
|
+
* with proxy: true. The host opens a real WebSocket to the AD4M daemon and
|
|
7
|
+
* forwards raw frames bidirectionally via the AD4M_PROXY_WS_* protocol.
|
|
8
|
+
*
|
|
9
|
+
* The constructor URL is intentionally ignored — the connection target is
|
|
10
|
+
* determined by the host, not the embedded app.
|
|
11
|
+
*/
|
|
12
|
+
export declare class PostMessageWebSocket {
|
|
13
|
+
static readonly CONNECTING = 0;
|
|
14
|
+
static readonly OPEN = 1;
|
|
15
|
+
static readonly CLOSING = 2;
|
|
16
|
+
static readonly CLOSED = 3;
|
|
17
|
+
readyState: number;
|
|
18
|
+
onopen: ((e: Event) => void) | null;
|
|
19
|
+
onmessage: ((e: MessageEvent) => void) | null;
|
|
20
|
+
onerror: ((e: Event) => void) | null;
|
|
21
|
+
onclose: ((e: CloseEvent) => void) | null;
|
|
22
|
+
private readonly _messageHandler;
|
|
23
|
+
private _connectTimeout;
|
|
24
|
+
private readonly _targetOrigin;
|
|
25
|
+
static readonly CONNECT_TIMEOUT_MS = 30000;
|
|
26
|
+
constructor(_url: string, targetOrigin: string);
|
|
27
|
+
private _clearConnectTimeout;
|
|
28
|
+
send(data: string): void;
|
|
29
|
+
close(code?: number, reason?: string): void;
|
|
30
|
+
}
|