request-iframe 0.1.1 → 0.2.1
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/QUICKSTART.CN.md +4 -2
- package/QUICKSTART.md +4 -2
- package/README.CN.md +129 -33
- package/README.md +116 -15
- package/cdn/request-iframe-react.umd.js +3354 -0
- package/cdn/request-iframe-react.umd.js.map +1 -0
- package/cdn/request-iframe-react.umd.min.js +2 -0
- package/cdn/request-iframe-react.umd.min.js.map +1 -0
- package/cdn/request-iframe.umd.js +19761 -0
- package/cdn/request-iframe.umd.js.map +1 -0
- package/cdn/request-iframe.umd.min.js +4 -0
- package/cdn/request-iframe.umd.min.js.map +1 -0
- package/esm/api/client.js +29 -21
- package/esm/api/endpoint.js +229 -0
- package/esm/api/server.js +16 -8
- package/esm/constants/debug.js +17 -0
- package/esm/constants/index.js +84 -67
- package/esm/constants/log.js +11 -0
- package/esm/constants/messages.js +3 -0
- package/esm/constants/warn-once.js +15 -0
- package/esm/endpoint/facade.js +390 -0
- package/esm/endpoint/heartbeat/heartbeat.js +60 -0
- package/esm/endpoint/heartbeat/ping.js +20 -0
- package/esm/endpoint/index.js +13 -0
- package/esm/endpoint/infra/hub.js +316 -0
- package/esm/endpoint/infra/inbox.js +232 -0
- package/esm/endpoint/infra/outbox.js +408 -0
- package/esm/endpoint/stream/dispatcher.js +58 -0
- package/esm/endpoint/stream/errors.js +27 -0
- package/esm/endpoint/stream/factory.js +76 -0
- package/esm/endpoint/stream/file-auto-resolve.js +34 -0
- package/esm/endpoint/stream/file-writable.js +105 -0
- package/esm/endpoint/stream/handler.js +26 -0
- package/esm/{core → impl}/client.js +240 -317
- package/esm/{core → impl}/response.js +113 -155
- package/esm/impl/server.js +568 -0
- package/esm/index.js +13 -6
- package/esm/message/ack.js +27 -0
- package/esm/message/channel-cache.js +108 -0
- package/esm/message/channel.js +90 -4
- package/esm/message/dispatcher.js +115 -75
- package/esm/stream/error.js +22 -0
- package/esm/stream/index.js +3 -1
- package/esm/stream/readable-stream.js +45 -9
- package/esm/stream/stream-core.js +7 -2
- package/esm/stream/writable-stream.js +97 -26
- package/esm/utils/blob.js +16 -0
- package/esm/utils/cache.js +25 -76
- package/esm/utils/content-type.js +81 -0
- package/esm/utils/debug.js +156 -179
- package/esm/utils/hooks.js +130 -0
- package/esm/utils/id.js +14 -0
- package/esm/utils/iframe.js +20 -0
- package/esm/utils/index.js +11 -163
- package/esm/utils/is.js +3 -0
- package/esm/utils/logger.js +55 -0
- package/esm/utils/promise.js +3 -0
- package/esm/utils/window.js +31 -0
- package/library/api/client.d.ts.map +1 -1
- package/library/api/client.js +30 -22
- package/library/api/endpoint.d.ts +23 -0
- package/library/api/endpoint.d.ts.map +1 -0
- package/library/api/endpoint.js +235 -0
- package/library/api/server.d.ts +4 -1
- package/library/api/server.d.ts.map +1 -1
- package/library/api/server.js +16 -8
- package/library/constants/debug.d.ts +18 -0
- package/library/constants/debug.d.ts.map +1 -0
- package/library/constants/debug.js +23 -0
- package/library/constants/index.d.ts +22 -2
- package/library/constants/index.d.ts.map +1 -1
- package/library/constants/index.js +110 -67
- package/library/constants/log.d.ts +12 -0
- package/library/constants/log.d.ts.map +1 -0
- package/library/constants/log.js +17 -0
- package/library/constants/messages.d.ts +3 -0
- package/library/constants/messages.d.ts.map +1 -1
- package/library/constants/messages.js +3 -0
- package/library/constants/warn-once.d.ts +12 -0
- package/library/constants/warn-once.d.ts.map +1 -0
- package/library/constants/warn-once.js +22 -0
- package/library/endpoint/facade.d.ts +238 -0
- package/library/endpoint/facade.d.ts.map +1 -0
- package/library/endpoint/facade.js +398 -0
- package/library/endpoint/heartbeat/heartbeat.d.ts +34 -0
- package/library/endpoint/heartbeat/heartbeat.d.ts.map +1 -0
- package/library/endpoint/heartbeat/heartbeat.js +67 -0
- package/library/endpoint/heartbeat/ping.d.ts +18 -0
- package/library/endpoint/heartbeat/ping.d.ts.map +1 -0
- package/library/endpoint/heartbeat/ping.js +26 -0
- package/library/endpoint/index.d.ts +16 -0
- package/library/endpoint/index.d.ts.map +1 -0
- package/library/endpoint/index.js +114 -0
- package/library/endpoint/infra/hub.d.ts +170 -0
- package/library/endpoint/infra/hub.d.ts.map +1 -0
- package/library/endpoint/infra/hub.js +323 -0
- package/library/endpoint/infra/inbox.d.ts +73 -0
- package/library/endpoint/infra/inbox.d.ts.map +1 -0
- package/library/endpoint/infra/inbox.js +239 -0
- package/library/endpoint/infra/outbox.d.ts +149 -0
- package/library/endpoint/infra/outbox.d.ts.map +1 -0
- package/library/endpoint/infra/outbox.js +415 -0
- package/library/endpoint/stream/dispatcher.d.ts +33 -0
- package/library/endpoint/stream/dispatcher.d.ts.map +1 -0
- package/library/endpoint/stream/dispatcher.js +66 -0
- package/library/endpoint/stream/errors.d.ts +20 -0
- package/library/endpoint/stream/errors.d.ts.map +1 -0
- package/library/endpoint/stream/errors.js +32 -0
- package/library/endpoint/stream/factory.d.ts +44 -0
- package/library/endpoint/stream/factory.d.ts.map +1 -0
- package/library/endpoint/stream/factory.js +82 -0
- package/library/endpoint/stream/file-auto-resolve.d.ts +26 -0
- package/library/endpoint/stream/file-auto-resolve.d.ts.map +1 -0
- package/library/endpoint/stream/file-auto-resolve.js +41 -0
- package/library/endpoint/stream/file-writable.d.ts +33 -0
- package/library/endpoint/stream/file-writable.d.ts.map +1 -0
- package/library/endpoint/stream/file-writable.js +115 -0
- package/library/endpoint/stream/handler.d.ts +20 -0
- package/library/endpoint/stream/handler.d.ts.map +1 -0
- package/library/endpoint/stream/handler.js +32 -0
- package/library/{core → impl}/client.d.ts +16 -13
- package/library/impl/client.d.ts.map +1 -0
- package/library/{core → impl}/client.js +251 -330
- package/library/{core → impl}/request.d.ts.map +1 -1
- package/library/{core → impl}/response.d.ts +5 -10
- package/library/impl/response.d.ts.map +1 -0
- package/library/{core → impl}/response.js +113 -155
- package/library/{core → impl}/server.d.ts +22 -55
- package/library/impl/server.d.ts.map +1 -0
- package/library/impl/server.js +575 -0
- package/library/index.d.ts +13 -6
- package/library/index.d.ts.map +1 -1
- package/library/index.js +16 -16
- package/library/message/ack.d.ts +15 -0
- package/library/message/ack.d.ts.map +1 -0
- package/library/message/ack.js +33 -0
- package/library/message/channel-cache.d.ts +26 -0
- package/library/message/channel-cache.d.ts.map +1 -0
- package/library/message/channel-cache.js +115 -0
- package/library/message/channel.d.ts +53 -6
- package/library/message/channel.d.ts.map +1 -1
- package/library/message/channel.js +94 -8
- package/library/message/dispatcher.d.ts +7 -0
- package/library/message/dispatcher.d.ts.map +1 -1
- package/library/message/dispatcher.js +116 -76
- package/library/stream/error.d.ts +24 -0
- package/library/stream/error.d.ts.map +1 -0
- package/library/stream/error.js +29 -0
- package/library/stream/index.d.ts +4 -1
- package/library/stream/index.d.ts.map +1 -1
- package/library/stream/index.js +7 -4
- package/library/stream/readable-stream.d.ts.map +1 -1
- package/library/stream/readable-stream.js +46 -10
- package/library/stream/stream-core.d.ts.map +1 -1
- package/library/stream/stream-core.js +6 -1
- package/library/stream/writable-stream.d.ts.map +1 -1
- package/library/stream/writable-stream.js +99 -28
- package/library/types/index.d.ts +15 -19
- package/library/types/index.d.ts.map +1 -1
- package/library/utils/blob.d.ts +3 -0
- package/library/utils/blob.d.ts.map +1 -0
- package/library/utils/blob.js +22 -0
- package/library/utils/cache.d.ts +10 -20
- package/library/utils/cache.d.ts.map +1 -1
- package/library/utils/cache.js +25 -79
- package/library/utils/content-type.d.ts +13 -0
- package/library/utils/content-type.d.ts.map +1 -0
- package/library/utils/content-type.js +87 -0
- package/library/utils/debug.d.ts.map +1 -1
- package/library/utils/debug.js +155 -177
- package/library/utils/hooks.d.ts +30 -0
- package/library/utils/hooks.d.ts.map +1 -0
- package/library/utils/hooks.js +139 -0
- package/library/utils/id.d.ts +9 -0
- package/library/utils/id.d.ts.map +1 -0
- package/library/utils/id.js +21 -0
- package/library/utils/iframe.d.ts +5 -0
- package/library/utils/iframe.d.ts.map +1 -0
- package/library/utils/iframe.js +25 -0
- package/library/utils/index.d.ts +7 -34
- package/library/utils/index.d.ts.map +1 -1
- package/library/utils/index.js +58 -194
- package/library/utils/is.d.ts +2 -0
- package/library/utils/is.d.ts.map +1 -0
- package/library/utils/is.js +9 -0
- package/library/utils/logger.d.ts +13 -0
- package/library/utils/logger.d.ts.map +1 -0
- package/library/utils/logger.js +63 -0
- package/library/utils/promise.d.ts +2 -0
- package/library/utils/promise.d.ts.map +1 -0
- package/library/utils/promise.js +9 -0
- package/library/utils/window.d.ts +2 -0
- package/library/utils/window.d.ts.map +1 -0
- package/library/utils/window.js +38 -0
- package/package.json +49 -2
- package/react/package.json +2 -1
- package/esm/core/client-server.js +0 -294
- package/esm/core/server.js +0 -776
- package/library/core/client-server.d.ts +0 -97
- package/library/core/client-server.d.ts.map +0 -1
- package/library/core/client-server.js +0 -301
- package/library/core/client.d.ts.map +0 -1
- package/library/core/response.d.ts.map +0 -1
- package/library/core/server.d.ts.map +0 -1
- package/library/core/server.js +0 -781
- /package/esm/{core → impl}/request.js +0 -0
- /package/library/{core → impl}/request.d.ts +0 -0
- /package/library/{core → impl}/request.js +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PostMessageData } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Endpoint Stream integration layer (`src/endpoint/stream`)
|
|
4
|
+
*
|
|
5
|
+
* This directory integrates postMessage `stream_*` messages with the stream object system in `src/stream`:
|
|
6
|
+
* - Endpoint-side composition / protocol glue (e.g. stream_start timeout error payload)
|
|
7
|
+
* - Does NOT implement the stream protocol itself (protocol lives in `src/stream`)
|
|
8
|
+
*
|
|
9
|
+
* Build the ERROR payload for stream_start timeout.
|
|
10
|
+
*
|
|
11
|
+
* Used by server-side "request-body stream handshake" when the client fails to send stream_start in time.
|
|
12
|
+
*/
|
|
13
|
+
export declare function buildStreamStartTimeoutErrorPayload(params: {
|
|
14
|
+
path: string;
|
|
15
|
+
timeoutMs: number;
|
|
16
|
+
requireAck?: boolean;
|
|
17
|
+
ack?: any;
|
|
18
|
+
targetId?: string;
|
|
19
|
+
}): Partial<Omit<PostMessageData, '__requestIframe__' | 'type' | 'requestId' | 'timestamp' | 'role' | 'creatorId'>>;
|
|
20
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/endpoint/stream/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGnD;;;;;;;;;;GAUG;AACH,wBAAgB,mCAAmC,CAAC,MAAM,EAAE;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,GAAG,MAAM,GAAG,WAAW,GAAG,WAAW,GAAG,MAAM,GAAG,WAAW,CAAC,CAAC,CAalH"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.buildStreamStartTimeoutErrorPayload = buildStreamStartTimeoutErrorPayload;
|
|
7
|
+
var _constants = require("../../constants");
|
|
8
|
+
/**
|
|
9
|
+
* Endpoint Stream integration layer (`src/endpoint/stream`)
|
|
10
|
+
*
|
|
11
|
+
* This directory integrates postMessage `stream_*` messages with the stream object system in `src/stream`:
|
|
12
|
+
* - Endpoint-side composition / protocol glue (e.g. stream_start timeout error payload)
|
|
13
|
+
* - Does NOT implement the stream protocol itself (protocol lives in `src/stream`)
|
|
14
|
+
*
|
|
15
|
+
* Build the ERROR payload for stream_start timeout.
|
|
16
|
+
*
|
|
17
|
+
* Used by server-side "request-body stream handshake" when the client fails to send stream_start in time.
|
|
18
|
+
*/
|
|
19
|
+
function buildStreamStartTimeoutErrorPayload(params) {
|
|
20
|
+
return {
|
|
21
|
+
path: params.path,
|
|
22
|
+
error: {
|
|
23
|
+
message: (0, _constants.formatMessage)(_constants.Messages.STREAM_START_TIMEOUT, params.timeoutMs),
|
|
24
|
+
code: _constants.ErrorCode.STREAM_START_TIMEOUT
|
|
25
|
+
},
|
|
26
|
+
status: _constants.HttpStatus.REQUEST_TIMEOUT,
|
|
27
|
+
statusText: _constants.HttpStatusText[_constants.HttpStatus.REQUEST_TIMEOUT],
|
|
28
|
+
requireAck: params.requireAck,
|
|
29
|
+
ack: params.ack,
|
|
30
|
+
targetId: params.targetId
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { PostMessageData } from '../../types';
|
|
2
|
+
import type { StreamMessageHandler } from '../../stream';
|
|
3
|
+
import { IframeReadableStream, IframeFileReadableStream } from '../../stream';
|
|
4
|
+
/**
|
|
5
|
+
* Endpoint Stream integration layer (`src/endpoint/stream`)
|
|
6
|
+
*
|
|
7
|
+
* This directory integrates postMessage `stream_*` messages with the stream object system in `src/stream`:
|
|
8
|
+
* - Parses stream_start and creates the corresponding ReadableStream (data/file)
|
|
9
|
+
* - Does NOT implement the stream protocol itself (protocol lives in `src/stream`)
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Parsed stream_start body info.
|
|
13
|
+
*/
|
|
14
|
+
export interface StreamStartInfo {
|
|
15
|
+
streamId: string;
|
|
16
|
+
type: string;
|
|
17
|
+
mode?: any;
|
|
18
|
+
chunked: boolean;
|
|
19
|
+
metadata?: Record<string, any>;
|
|
20
|
+
autoResolve: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Parse stream_start body with defaults.
|
|
24
|
+
*/
|
|
25
|
+
export declare function parseStreamStart(body: any): StreamStartInfo | null;
|
|
26
|
+
/**
|
|
27
|
+
* Create a readable stream instance from a stream_start message/body.
|
|
28
|
+
*
|
|
29
|
+
* This is shared by:
|
|
30
|
+
* - client side: receiving response stream from server
|
|
31
|
+
* - server side: receiving request-body stream from client
|
|
32
|
+
*/
|
|
33
|
+
export declare function createReadableStreamFromStart(params: {
|
|
34
|
+
requestId: string;
|
|
35
|
+
data: PostMessageData;
|
|
36
|
+
handler: StreamMessageHandler;
|
|
37
|
+
secretKey?: string;
|
|
38
|
+
idleTimeout?: number;
|
|
39
|
+
heartbeat?: () => Promise<boolean>;
|
|
40
|
+
}): {
|
|
41
|
+
stream: IframeReadableStream<any> | IframeFileReadableStream;
|
|
42
|
+
info: StreamStartInfo;
|
|
43
|
+
} | null;
|
|
44
|
+
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/endpoint/stream/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAqB,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAG9E;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,GAAG,GAAG,eAAe,GAAG,IAAI,CAWlE;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CACpC,GAAG;IAAE,MAAM,EAAE,oBAAoB,CAAC,GAAG,CAAC,GAAG,wBAAwB,CAAC;IAAC,IAAI,EAAE,eAAe,CAAA;CAAE,GAAG,IAAI,CA+BjG"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createReadableStreamFromStart = createReadableStreamFromStart;
|
|
7
|
+
exports.parseStreamStart = parseStreamStart;
|
|
8
|
+
var _stream = require("../../stream");
|
|
9
|
+
var _constants = require("../../constants");
|
|
10
|
+
/**
|
|
11
|
+
* Endpoint Stream integration layer (`src/endpoint/stream`)
|
|
12
|
+
*
|
|
13
|
+
* This directory integrates postMessage `stream_*` messages with the stream object system in `src/stream`:
|
|
14
|
+
* - Parses stream_start and creates the corresponding ReadableStream (data/file)
|
|
15
|
+
* - Does NOT implement the stream protocol itself (protocol lives in `src/stream`)
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Parsed stream_start body info.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Parse stream_start body with defaults.
|
|
24
|
+
*/
|
|
25
|
+
function parseStreamStart(body) {
|
|
26
|
+
var _chunked, _autoResolve;
|
|
27
|
+
var b = body;
|
|
28
|
+
if (!(b !== null && b !== void 0 && b.streamId)) return null;
|
|
29
|
+
return {
|
|
30
|
+
streamId: b.streamId,
|
|
31
|
+
type: b.type || _constants.StreamType.DATA,
|
|
32
|
+
mode: b.mode,
|
|
33
|
+
chunked: (_chunked = b.chunked) !== null && _chunked !== void 0 ? _chunked : true,
|
|
34
|
+
metadata: b.metadata,
|
|
35
|
+
autoResolve: (_autoResolve = b.autoResolve) !== null && _autoResolve !== void 0 ? _autoResolve : false
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Create a readable stream instance from a stream_start message/body.
|
|
41
|
+
*
|
|
42
|
+
* This is shared by:
|
|
43
|
+
* - client side: receiving response stream from server
|
|
44
|
+
* - server side: receiving request-body stream from client
|
|
45
|
+
*/
|
|
46
|
+
function createReadableStreamFromStart(params) {
|
|
47
|
+
var _params$secretKey;
|
|
48
|
+
var info = parseStreamStart(params.data.body);
|
|
49
|
+
if (!info) return null;
|
|
50
|
+
var secretKey = (_params$secretKey = params.secretKey) !== null && _params$secretKey !== void 0 ? _params$secretKey : params.data.secretKey;
|
|
51
|
+
if (info.type === _constants.StreamType.FILE) {
|
|
52
|
+
var _info$metadata, _info$metadata2, _info$metadata3;
|
|
53
|
+
var fileStream = new _stream.IframeFileReadableStream(info.streamId, params.requestId, params.handler, {
|
|
54
|
+
chunked: info.chunked,
|
|
55
|
+
metadata: info.metadata,
|
|
56
|
+
secretKey,
|
|
57
|
+
mode: info.mode,
|
|
58
|
+
idleTimeout: params.idleTimeout,
|
|
59
|
+
heartbeat: params.heartbeat,
|
|
60
|
+
filename: (_info$metadata = info.metadata) === null || _info$metadata === void 0 ? void 0 : _info$metadata.filename,
|
|
61
|
+
mimeType: (_info$metadata2 = info.metadata) === null || _info$metadata2 === void 0 ? void 0 : _info$metadata2.mimeType,
|
|
62
|
+
size: (_info$metadata3 = info.metadata) === null || _info$metadata3 === void 0 ? void 0 : _info$metadata3.size
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
stream: fileStream,
|
|
66
|
+
info
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
var readableStream = new _stream.IframeReadableStream(info.streamId, params.requestId, params.handler, {
|
|
70
|
+
type: info.type,
|
|
71
|
+
mode: info.mode,
|
|
72
|
+
chunked: info.chunked,
|
|
73
|
+
metadata: info.metadata,
|
|
74
|
+
secretKey,
|
|
75
|
+
idleTimeout: params.idleTimeout,
|
|
76
|
+
heartbeat: params.heartbeat
|
|
77
|
+
});
|
|
78
|
+
return {
|
|
79
|
+
stream: readableStream,
|
|
80
|
+
info
|
|
81
|
+
};
|
|
82
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { StreamStartInfo } from './factory';
|
|
2
|
+
import type { IframeFileReadableStream } from '../../stream';
|
|
3
|
+
/**
|
|
4
|
+
* Endpoint Stream integration layer (`src/endpoint/stream`)
|
|
5
|
+
*
|
|
6
|
+
* This directory integrates postMessage `stream_*` messages with the stream object system in `src/stream`:
|
|
7
|
+
* - Endpoint-side file stream utilities (e.g. choose filename from header/metadata and auto-resolve)
|
|
8
|
+
* - Does NOT implement the stream protocol itself (protocol lives in `src/stream`)
|
|
9
|
+
*
|
|
10
|
+
* Parse filename from Content-Disposition header.
|
|
11
|
+
*/
|
|
12
|
+
export declare function parseFilenameFromContentDisposition(value?: string | string[]): string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Auto resolve a file readable stream to File/Blob.
|
|
15
|
+
*
|
|
16
|
+
* Filename priority:
|
|
17
|
+
* - Content-Disposition filename (if provided)
|
|
18
|
+
* - stream_start metadata filename (if provided)
|
|
19
|
+
* - stream.filename (if provided)
|
|
20
|
+
*/
|
|
21
|
+
export declare function autoResolveIframeFileReadableStream(params: {
|
|
22
|
+
fileStream: IframeFileReadableStream;
|
|
23
|
+
info?: StreamStartInfo | null;
|
|
24
|
+
headers?: Record<string, string | string[]>;
|
|
25
|
+
}): Promise<File | Blob>;
|
|
26
|
+
//# sourceMappingURL=file-auto-resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-auto-resolve.d.ts","sourceRoot":"","sources":["../../../src/endpoint/stream/file-auto-resolve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAE7D;;;;;;;;GAQG;AACH,wBAAgB,mCAAmC,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAMjG;AAED;;;;;;;GAOG;AACH,wBAAgB,mCAAmC,CAAC,MAAM,EAAE;IAC1D,UAAU,EAAE,wBAAwB,CAAC;IACrC,IAAI,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;CAC7C,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAIvB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.autoResolveIframeFileReadableStream = autoResolveIframeFileReadableStream;
|
|
7
|
+
exports.parseFilenameFromContentDisposition = parseFilenameFromContentDisposition;
|
|
8
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
9
|
+
require("core-js/modules/es.string.match.js");
|
|
10
|
+
var _constants = require("../../constants");
|
|
11
|
+
/**
|
|
12
|
+
* Endpoint Stream integration layer (`src/endpoint/stream`)
|
|
13
|
+
*
|
|
14
|
+
* This directory integrates postMessage `stream_*` messages with the stream object system in `src/stream`:
|
|
15
|
+
* - Endpoint-side file stream utilities (e.g. choose filename from header/metadata and auto-resolve)
|
|
16
|
+
* - Does NOT implement the stream protocol itself (protocol lives in `src/stream`)
|
|
17
|
+
*
|
|
18
|
+
* Parse filename from Content-Disposition header.
|
|
19
|
+
*/
|
|
20
|
+
function parseFilenameFromContentDisposition(value) {
|
|
21
|
+
if (!value) return undefined;
|
|
22
|
+
var disposition = typeof value === 'string' ? value : value[0];
|
|
23
|
+
if (!disposition) return undefined;
|
|
24
|
+
var match = disposition.match(/filename="?([^"]+)"?/i);
|
|
25
|
+
return match ? match[1] : undefined;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Auto resolve a file readable stream to File/Blob.
|
|
30
|
+
*
|
|
31
|
+
* Filename priority:
|
|
32
|
+
* - Content-Disposition filename (if provided)
|
|
33
|
+
* - stream_start metadata filename (if provided)
|
|
34
|
+
* - stream.filename (if provided)
|
|
35
|
+
*/
|
|
36
|
+
function autoResolveIframeFileReadableStream(params) {
|
|
37
|
+
var _params$headers, _params$info;
|
|
38
|
+
var headerFilename = parseFilenameFromContentDisposition((_params$headers = params.headers) === null || _params$headers === void 0 ? void 0 : _params$headers[_constants.HttpHeader.CONTENT_DISPOSITION]);
|
|
39
|
+
var fileName = headerFilename || ((_params$info = params.info) === null || _params$info === void 0 || (_params$info = _params$info.metadata) === null || _params$info === void 0 ? void 0 : _params$info.filename) || params.fileStream.filename;
|
|
40
|
+
return fileName ? params.fileStream.readAsFile(fileName) : params.fileStream.readAsBlob();
|
|
41
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { IframeFileWritableStream } from '../../stream';
|
|
2
|
+
/**
|
|
3
|
+
* Endpoint Stream integration layer (`src/endpoint/stream`)
|
|
4
|
+
*
|
|
5
|
+
* This directory integrates postMessage `stream_*` messages with the stream object system in `src/stream`:
|
|
6
|
+
* - Endpoint-side File/Blob -> IframeFileWritableStream adaptation (for sendFile / res.sendFile)
|
|
7
|
+
* - Does NOT implement the stream protocol itself (protocol lives in `src/stream`)
|
|
8
|
+
*
|
|
9
|
+
* Create an IframeFileWritableStream from content.
|
|
10
|
+
*
|
|
11
|
+
* Shared by:
|
|
12
|
+
* - client: sendFile(...) -> sendStream(...)
|
|
13
|
+
* - server response: res.sendFile(...) -> sendStream(...)
|
|
14
|
+
*/
|
|
15
|
+
export declare function createIframeFileWritableStreamFromContent(params: {
|
|
16
|
+
content: string | Blob | File;
|
|
17
|
+
fileName?: string;
|
|
18
|
+
mimeType?: string;
|
|
19
|
+
/** default: false (file is sent in one chunk) */
|
|
20
|
+
chunked?: boolean;
|
|
21
|
+
/** default: true (receiver may auto-resolve) */
|
|
22
|
+
autoResolve?: boolean;
|
|
23
|
+
/** stream filename fallback when fileName cannot be inferred */
|
|
24
|
+
defaultFileName?: string;
|
|
25
|
+
/** mimeType fallback when mimeType cannot be inferred */
|
|
26
|
+
defaultMimeType?: string;
|
|
27
|
+
}): Promise<{
|
|
28
|
+
stream: IframeFileWritableStream;
|
|
29
|
+
/** inferred filename (may be undefined if content is not File and fileName not provided) */
|
|
30
|
+
fileName?: string;
|
|
31
|
+
mimeType: string;
|
|
32
|
+
}>;
|
|
33
|
+
//# sourceMappingURL=file-writable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-writable.d.ts","sourceRoot":"","sources":["../../../src/endpoint/stream/file-writable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAG7D;;;;;;;;;;;;GAYG;AACH,wBAAsB,yCAAyC,CAAC,MAAM,EAAE;IACtE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gDAAgD;IAChD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gEAAgE;IAChE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yDAAyD;IACzD,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,OAAO,CAAC;IACV,MAAM,EAAE,wBAAwB,CAAC;IACjC,4FAA4F;IAC5F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC,CA0CD"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createIframeFileWritableStreamFromContent = createIframeFileWritableStreamFromContent;
|
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
+
require("core-js/modules/es.array.iterator.js");
|
|
10
|
+
require("core-js/modules/es.promise.js");
|
|
11
|
+
require("core-js/modules/es.weak-map.js");
|
|
12
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
13
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
14
|
+
var _blob = require("../../utils/blob");
|
|
15
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
16
|
+
/**
|
|
17
|
+
* Endpoint Stream integration layer (`src/endpoint/stream`)
|
|
18
|
+
*
|
|
19
|
+
* This directory integrates postMessage `stream_*` messages with the stream object system in `src/stream`:
|
|
20
|
+
* - Endpoint-side File/Blob -> IframeFileWritableStream adaptation (for sendFile / res.sendFile)
|
|
21
|
+
* - Does NOT implement the stream protocol itself (protocol lives in `src/stream`)
|
|
22
|
+
*
|
|
23
|
+
* Create an IframeFileWritableStream from content.
|
|
24
|
+
*
|
|
25
|
+
* Shared by:
|
|
26
|
+
* - client: sendFile(...) -> sendStream(...)
|
|
27
|
+
* - server response: res.sendFile(...) -> sendStream(...)
|
|
28
|
+
*/
|
|
29
|
+
function createIframeFileWritableStreamFromContent(_x) {
|
|
30
|
+
return _createIframeFileWritableStreamFromContent.apply(this, arguments);
|
|
31
|
+
}
|
|
32
|
+
function _createIframeFileWritableStreamFromContent() {
|
|
33
|
+
_createIframeFileWritableStreamFromContent = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(params) {
|
|
34
|
+
var _params$chunked, _params$autoResolve;
|
|
35
|
+
var _yield$import, IframeFileWritableStream, mimeType, fileName, t, fileContent, streamFileName, stream, _t;
|
|
36
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
37
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
38
|
+
case 0:
|
|
39
|
+
_context2.next = 1;
|
|
40
|
+
return Promise.resolve().then(() => _interopRequireWildcard(require('../../stream')));
|
|
41
|
+
case 1:
|
|
42
|
+
_yield$import = _context2.sent;
|
|
43
|
+
IframeFileWritableStream = _yield$import.IframeFileWritableStream;
|
|
44
|
+
mimeType = params.mimeType || params.defaultMimeType || 'application/octet-stream';
|
|
45
|
+
fileName = params.fileName;
|
|
46
|
+
try {
|
|
47
|
+
if (typeof File !== 'undefined' && params.content instanceof File) {
|
|
48
|
+
mimeType = params.content.type || mimeType;
|
|
49
|
+
fileName = fileName || params.content.name;
|
|
50
|
+
}
|
|
51
|
+
} catch (_unused) {
|
|
52
|
+
/** ignore */
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
if (!fileName && typeof Blob !== 'undefined' && params.content instanceof Blob) {
|
|
56
|
+
t = params.content.type;
|
|
57
|
+
if (t) mimeType = t;
|
|
58
|
+
}
|
|
59
|
+
} catch (_unused2) {
|
|
60
|
+
/** ignore */
|
|
61
|
+
}
|
|
62
|
+
if (!(typeof params.content === 'string')) {
|
|
63
|
+
_context2.next = 2;
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
_t = btoa(unescape(encodeURIComponent(params.content)));
|
|
67
|
+
_context2.next = 4;
|
|
68
|
+
break;
|
|
69
|
+
case 2:
|
|
70
|
+
_context2.next = 3;
|
|
71
|
+
return (0, _blob.blobToBase64)(params.content);
|
|
72
|
+
case 3:
|
|
73
|
+
_t = _context2.sent;
|
|
74
|
+
case 4:
|
|
75
|
+
fileContent = _t;
|
|
76
|
+
streamFileName = fileName || params.defaultFileName || 'file';
|
|
77
|
+
stream = new IframeFileWritableStream({
|
|
78
|
+
filename: streamFileName,
|
|
79
|
+
mimeType,
|
|
80
|
+
chunked: (_params$chunked = params.chunked) !== null && _params$chunked !== void 0 ? _params$chunked : false,
|
|
81
|
+
autoResolve: (_params$autoResolve = params.autoResolve) !== null && _params$autoResolve !== void 0 ? _params$autoResolve : true,
|
|
82
|
+
next: function () {
|
|
83
|
+
var _next = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
84
|
+
return _regenerator.default.wrap(function (_context) {
|
|
85
|
+
while (1) switch (_context.prev = _context.next) {
|
|
86
|
+
case 0:
|
|
87
|
+
return _context.abrupt("return", {
|
|
88
|
+
data: fileContent,
|
|
89
|
+
done: true
|
|
90
|
+
});
|
|
91
|
+
case 1:
|
|
92
|
+
case "end":
|
|
93
|
+
return _context.stop();
|
|
94
|
+
}
|
|
95
|
+
}, _callee);
|
|
96
|
+
}));
|
|
97
|
+
function next() {
|
|
98
|
+
return _next.apply(this, arguments);
|
|
99
|
+
}
|
|
100
|
+
return next;
|
|
101
|
+
}()
|
|
102
|
+
});
|
|
103
|
+
return _context2.abrupt("return", {
|
|
104
|
+
stream,
|
|
105
|
+
fileName,
|
|
106
|
+
mimeType
|
|
107
|
+
});
|
|
108
|
+
case 5:
|
|
109
|
+
case "end":
|
|
110
|
+
return _context2.stop();
|
|
111
|
+
}
|
|
112
|
+
}, _callee2);
|
|
113
|
+
}));
|
|
114
|
+
return _createIframeFileWritableStreamFromContent.apply(this, arguments);
|
|
115
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { StreamMessageHandler } from '../../stream';
|
|
2
|
+
import type { RequestIframeStreamDispatcher } from './dispatcher';
|
|
3
|
+
/**
|
|
4
|
+
* Endpoint Stream integration layer (`src/endpoint/stream`)
|
|
5
|
+
*
|
|
6
|
+
* This directory integrates postMessage `stream_*` messages with the stream object system in `src/stream`:
|
|
7
|
+
* - Adapts (dispatcher + postMessage) into the `StreamMessageHandler` interface used by `src/stream`
|
|
8
|
+
* - Does NOT implement the stream protocol itself (protocol lives in `src/stream`)
|
|
9
|
+
*
|
|
10
|
+
* Create a StreamMessageHandler bound to a stream dispatcher and a postMessage implementation.
|
|
11
|
+
*
|
|
12
|
+
* This is shared by:
|
|
13
|
+
* - server side: receiving request-body streams (per request targetWindow/targetOrigin)
|
|
14
|
+
* - client side: can also use it in the future to avoid implementing the interface on the client class
|
|
15
|
+
*/
|
|
16
|
+
export declare function createStreamMessageHandler(params: {
|
|
17
|
+
dispatcher: RequestIframeStreamDispatcher;
|
|
18
|
+
postMessage: (message: any) => void;
|
|
19
|
+
}): StreamMessageHandler;
|
|
20
|
+
//# sourceMappingURL=handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/endpoint/stream/handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAElE;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE;IACjD,UAAU,EAAE,6BAA6B,CAAC;IAC1C,WAAW,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;CACrC,GAAG,oBAAoB,CAYvB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createStreamMessageHandler = createStreamMessageHandler;
|
|
7
|
+
/**
|
|
8
|
+
* Endpoint Stream integration layer (`src/endpoint/stream`)
|
|
9
|
+
*
|
|
10
|
+
* This directory integrates postMessage `stream_*` messages with the stream object system in `src/stream`:
|
|
11
|
+
* - Adapts (dispatcher + postMessage) into the `StreamMessageHandler` interface used by `src/stream`
|
|
12
|
+
* - Does NOT implement the stream protocol itself (protocol lives in `src/stream`)
|
|
13
|
+
*
|
|
14
|
+
* Create a StreamMessageHandler bound to a stream dispatcher and a postMessage implementation.
|
|
15
|
+
*
|
|
16
|
+
* This is shared by:
|
|
17
|
+
* - server side: receiving request-body streams (per request targetWindow/targetOrigin)
|
|
18
|
+
* - client side: can also use it in the future to avoid implementing the interface on the client class
|
|
19
|
+
*/
|
|
20
|
+
function createStreamMessageHandler(params) {
|
|
21
|
+
return {
|
|
22
|
+
registerStreamHandler: (streamId, handler) => {
|
|
23
|
+
params.dispatcher.register(streamId, handler);
|
|
24
|
+
},
|
|
25
|
+
unregisterStreamHandler: streamId => {
|
|
26
|
+
params.dispatcher.unregister(streamId);
|
|
27
|
+
},
|
|
28
|
+
postMessage: message => {
|
|
29
|
+
params.postMessage(message);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestOptions, Response, RequestIframeClient, RequestDefaults, HeadersConfig, OriginMatcher, OriginValidator } from '../types';
|
|
2
2
|
import { RequestInterceptorManager, ResponseInterceptorManager } from '../interceptors';
|
|
3
|
-
import {
|
|
3
|
+
import { RequestIframeEndpointHub } from '../endpoint';
|
|
4
4
|
import { IframeWritableStream, StreamMessageHandler, StreamMessageData } from '../stream';
|
|
5
5
|
/**
|
|
6
6
|
* Client configuration options
|
|
@@ -10,6 +10,8 @@ export interface ClientOptions extends RequestDefaults {
|
|
|
10
10
|
headers?: HeadersConfig;
|
|
11
11
|
allowedOrigins?: OriginMatcher;
|
|
12
12
|
validateOrigin?: OriginValidator;
|
|
13
|
+
/** Whether to automatically open when creating the client. Default is true. */
|
|
14
|
+
autoOpen?: boolean;
|
|
13
15
|
}
|
|
14
16
|
/**
|
|
15
17
|
* RequestIframeClient implementation (only responsible for initiating requests, reuses server's listener)
|
|
@@ -23,7 +25,10 @@ export declare class RequestIframeClientImpl implements RequestIframeClient, Str
|
|
|
23
25
|
};
|
|
24
26
|
readonly targetWindow: Window;
|
|
25
27
|
private readonly targetOrigin;
|
|
26
|
-
private readonly
|
|
28
|
+
private readonly endpoint;
|
|
29
|
+
private readonly hub;
|
|
30
|
+
private readonly inbox;
|
|
31
|
+
private readonly outbox;
|
|
27
32
|
private readonly secretKey?;
|
|
28
33
|
private readonly originValidator?;
|
|
29
34
|
/** Default timeout configuration */
|
|
@@ -40,18 +45,14 @@ export declare class RequestIframeClientImpl implements RequestIframeClient, Str
|
|
|
40
45
|
* - Automatically parses Set-Cookie and saves when receiving response
|
|
41
46
|
*/
|
|
42
47
|
private _cookieStore;
|
|
43
|
-
|
|
44
|
-
* Stream message handler map
|
|
45
|
-
* key: streamId
|
|
46
|
-
* value: stream message handler function
|
|
47
|
-
*/
|
|
48
|
-
private readonly streamHandlers;
|
|
48
|
+
private readonly streamDispatcher;
|
|
49
49
|
/**
|
|
50
50
|
* Target server ID (remembered from responses)
|
|
51
51
|
* When a response is received, we remember the server's creatorId as the targetId for future requests
|
|
52
52
|
*/
|
|
53
53
|
private _targetServerId?;
|
|
54
|
-
|
|
54
|
+
private rememberTargetServerId;
|
|
55
|
+
constructor(targetWindow: Window, targetOrigin: string, options?: ClientOptions, instanceId?: string);
|
|
55
56
|
/**
|
|
56
57
|
* Register stream message handler (StreamMessageHandler interface implementation)
|
|
57
58
|
*/
|
|
@@ -62,9 +63,11 @@ export declare class RequestIframeClientImpl implements RequestIframeClient, Str
|
|
|
62
63
|
unregisterStreamHandler(streamId: string): void;
|
|
63
64
|
postMessage(message: any): void;
|
|
64
65
|
/**
|
|
65
|
-
*
|
|
66
|
+
* Send raw framework message (advanced).
|
|
67
|
+
*
|
|
68
|
+
* Note: streams call `postMessage` via StreamMessageHandler, which delegates here.
|
|
66
69
|
*/
|
|
67
|
-
|
|
70
|
+
sendRaw(message: any): void;
|
|
68
71
|
/**
|
|
69
72
|
* Resolve header value (handle function type headers)
|
|
70
73
|
*/
|
|
@@ -106,9 +109,9 @@ export declare class RequestIframeClientImpl implements RequestIframeClient, Str
|
|
|
106
109
|
*/
|
|
107
110
|
private _sendRequest;
|
|
108
111
|
/**
|
|
109
|
-
* Get internal
|
|
112
|
+
* Get internal hub instance (for debugging)
|
|
110
113
|
*/
|
|
111
|
-
|
|
114
|
+
getHub(): RequestIframeEndpointHub;
|
|
112
115
|
/**
|
|
113
116
|
* Whether message handling is enabled
|
|
114
117
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/impl/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,cAAc,EACd,QAAQ,EAGR,mBAAmB,EACnB,eAAe,EACf,aAAa,EAEb,aAAa,EACb,eAAe,EAChB,MAAM,UAAU,CAAC;AAOlB,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAG3B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,wBAAwB,EAMzB,MAAM,aAAa,CAAC;AAcrB,OAAO,EAEL,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,WAAW,CAAC;AAInB;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,eAAe;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B,cAAc,CAAC,EAAE,eAAe,CAAC;IACjC,+EAA+E;IAC/E,QAAQ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