request-iframe 0.0.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 +269 -0
- package/QUICKSTART.md +269 -0
- package/README.CN.md +1369 -0
- package/README.md +1016 -0
- package/library/__tests__/interceptors.test.ts +124 -0
- package/library/__tests__/requestIframe.test.ts +2216 -0
- package/library/__tests__/stream.test.ts +650 -0
- package/library/__tests__/utils.test.ts +433 -0
- package/library/api/client.d.ts +16 -0
- package/library/api/client.d.ts.map +1 -0
- package/library/api/client.js +72 -0
- package/library/api/server.d.ts +16 -0
- package/library/api/server.d.ts.map +1 -0
- package/library/api/server.js +44 -0
- package/library/constants/index.d.ts +209 -0
- package/library/constants/index.d.ts.map +1 -0
- package/library/constants/index.js +260 -0
- package/library/constants/messages.d.ts +80 -0
- package/library/constants/messages.d.ts.map +1 -0
- package/library/constants/messages.js +123 -0
- package/library/core/client.d.ts +99 -0
- package/library/core/client.d.ts.map +1 -0
- package/library/core/client.js +440 -0
- package/library/core/message-handler.d.ts +110 -0
- package/library/core/message-handler.d.ts.map +1 -0
- package/library/core/message-handler.js +320 -0
- package/library/core/request-response.d.ts +59 -0
- package/library/core/request-response.d.ts.map +1 -0
- package/library/core/request-response.js +337 -0
- package/library/core/request.d.ts +17 -0
- package/library/core/request.d.ts.map +1 -0
- package/library/core/request.js +34 -0
- package/library/core/response.d.ts +51 -0
- package/library/core/response.d.ts.map +1 -0
- package/library/core/response.js +323 -0
- package/library/core/server-base.d.ts +86 -0
- package/library/core/server-base.d.ts.map +1 -0
- package/library/core/server-base.js +257 -0
- package/library/core/server-client.d.ts +99 -0
- package/library/core/server-client.d.ts.map +1 -0
- package/library/core/server-client.js +256 -0
- package/library/core/server.d.ts +82 -0
- package/library/core/server.d.ts.map +1 -0
- package/library/core/server.js +338 -0
- package/library/index.d.ts +16 -0
- package/library/index.d.ts.map +1 -0
- package/library/index.js +211 -0
- package/library/interceptors/index.d.ts +41 -0
- package/library/interceptors/index.d.ts.map +1 -0
- package/library/interceptors/index.js +126 -0
- package/library/message/channel.d.ts +107 -0
- package/library/message/channel.d.ts.map +1 -0
- package/library/message/channel.js +184 -0
- package/library/message/dispatcher.d.ts +119 -0
- package/library/message/dispatcher.d.ts.map +1 -0
- package/library/message/dispatcher.js +249 -0
- package/library/message/index.d.ts +5 -0
- package/library/message/index.d.ts.map +1 -0
- package/library/message/index.js +25 -0
- package/library/stream/file-stream.d.ts +48 -0
- package/library/stream/file-stream.d.ts.map +1 -0
- package/library/stream/file-stream.js +240 -0
- package/library/stream/index.d.ts +15 -0
- package/library/stream/index.d.ts.map +1 -0
- package/library/stream/index.js +83 -0
- package/library/stream/readable-stream.d.ts +83 -0
- package/library/stream/readable-stream.d.ts.map +1 -0
- package/library/stream/readable-stream.js +249 -0
- package/library/stream/types.d.ts +165 -0
- package/library/stream/types.d.ts.map +1 -0
- package/library/stream/types.js +5 -0
- package/library/stream/writable-stream.d.ts +60 -0
- package/library/stream/writable-stream.d.ts.map +1 -0
- package/library/stream/writable-stream.js +348 -0
- package/library/types/index.d.ts +408 -0
- package/library/types/index.d.ts.map +1 -0
- package/library/types/index.js +5 -0
- package/library/utils/cache.d.ts +19 -0
- package/library/utils/cache.d.ts.map +1 -0
- package/library/utils/cache.js +83 -0
- package/library/utils/cookie.d.ts +117 -0
- package/library/utils/cookie.d.ts.map +1 -0
- package/library/utils/cookie.js +365 -0
- package/library/utils/debug.d.ts +11 -0
- package/library/utils/debug.d.ts.map +1 -0
- package/library/utils/debug.js +162 -0
- package/library/utils/index.d.ts +13 -0
- package/library/utils/index.d.ts.map +1 -0
- package/library/utils/index.js +132 -0
- package/library/utils/path-match.d.ts +17 -0
- package/library/utils/path-match.d.ts.map +1 -0
- package/library/utils/path-match.js +90 -0
- package/library/utils/protocol.d.ts +61 -0
- package/library/utils/protocol.d.ts.map +1 -0
- package/library/utils/protocol.js +169 -0
- package/package.json +58 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { RequestOptions, Response, RequestIframeClient, RequestDefaults } from '../types';
|
|
2
|
+
import { RequestInterceptorManager, ResponseInterceptorManager } from '../interceptors';
|
|
3
|
+
import { RequestIframeClientServer } from './server-client';
|
|
4
|
+
import { StreamMessageHandler, StreamMessageData } from '../stream';
|
|
5
|
+
/**
|
|
6
|
+
* Client configuration options
|
|
7
|
+
*/
|
|
8
|
+
export interface ClientOptions extends RequestDefaults {
|
|
9
|
+
secretKey?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* RequestIframeClient implementation (only responsible for initiating requests, reuses server's listener)
|
|
13
|
+
*/
|
|
14
|
+
export declare class RequestIframeClientImpl implements RequestIframeClient, StreamMessageHandler {
|
|
15
|
+
interceptors: {
|
|
16
|
+
request: RequestInterceptorManager;
|
|
17
|
+
response: ResponseInterceptorManager;
|
|
18
|
+
};
|
|
19
|
+
private readonly targetWindow;
|
|
20
|
+
private readonly targetOrigin;
|
|
21
|
+
private readonly server;
|
|
22
|
+
private readonly secretKey?;
|
|
23
|
+
/** Default timeout configuration */
|
|
24
|
+
private readonly defaultAckTimeout;
|
|
25
|
+
private readonly defaultTimeout;
|
|
26
|
+
private readonly defaultAsyncTimeout;
|
|
27
|
+
/**
|
|
28
|
+
* Internal cookies storage
|
|
29
|
+
* - Automatically includes cookies matching the path when sending requests
|
|
30
|
+
* - Automatically parses Set-Cookie and saves when receiving response
|
|
31
|
+
*/
|
|
32
|
+
private _cookieStore;
|
|
33
|
+
/**
|
|
34
|
+
* Stream message handler map
|
|
35
|
+
* key: streamId
|
|
36
|
+
* value: stream message handler function
|
|
37
|
+
*/
|
|
38
|
+
private readonly streamHandlers;
|
|
39
|
+
constructor(targetWindow: Window, targetOrigin: string, server: RequestIframeClientServer, options?: ClientOptions);
|
|
40
|
+
/**
|
|
41
|
+
* Register stream message handler (StreamMessageHandler interface implementation)
|
|
42
|
+
*/
|
|
43
|
+
registerStreamHandler(streamId: string, handler: (data: StreamMessageData) => void): void;
|
|
44
|
+
/**
|
|
45
|
+
* Unregister stream message handler (StreamMessageHandler interface implementation)
|
|
46
|
+
*/
|
|
47
|
+
unregisterStreamHandler(streamId: string): void;
|
|
48
|
+
/**
|
|
49
|
+
* Send message (StreamMessageHandler interface implementation)
|
|
50
|
+
*/
|
|
51
|
+
postMessage(message: any): void;
|
|
52
|
+
/**
|
|
53
|
+
* Dispatch stream message to corresponding handler
|
|
54
|
+
*/
|
|
55
|
+
private dispatchStreamMessage;
|
|
56
|
+
/**
|
|
57
|
+
* Check if server is reachable
|
|
58
|
+
*/
|
|
59
|
+
isConnect(): Promise<boolean>;
|
|
60
|
+
send<T = any>(path: string, body?: Record<string, any>, options?: RequestOptions): Promise<Response<T>>;
|
|
61
|
+
private prefixPath;
|
|
62
|
+
/**
|
|
63
|
+
* Get internal server instance (for debugging)
|
|
64
|
+
*/
|
|
65
|
+
getServer(): RequestIframeClientServer;
|
|
66
|
+
/**
|
|
67
|
+
* Get all cookies matching specified path
|
|
68
|
+
* @param path Request path, returns all cookies if not provided
|
|
69
|
+
*/
|
|
70
|
+
getCookies(path?: string): Record<string, string>;
|
|
71
|
+
/**
|
|
72
|
+
* Get specified cookie
|
|
73
|
+
* @param name Cookie name
|
|
74
|
+
* @param path Path (optional)
|
|
75
|
+
*/
|
|
76
|
+
getCookie(name: string, path?: string): string | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Set cookie
|
|
79
|
+
* @param name Cookie name
|
|
80
|
+
* @param value Cookie value
|
|
81
|
+
* @param options Cookie options (path, etc.)
|
|
82
|
+
*/
|
|
83
|
+
setCookie(name: string, value: string, options?: {
|
|
84
|
+
path?: string;
|
|
85
|
+
expires?: Date;
|
|
86
|
+
maxAge?: number;
|
|
87
|
+
}): void;
|
|
88
|
+
/**
|
|
89
|
+
* Remove specified cookie
|
|
90
|
+
* @param name Cookie name
|
|
91
|
+
* @param path Path (optional, defaults to '/')
|
|
92
|
+
*/
|
|
93
|
+
removeCookie(name: string, path?: string): void;
|
|
94
|
+
/**
|
|
95
|
+
* Clear all cookies
|
|
96
|
+
*/
|
|
97
|
+
clearCookies(): void;
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/core/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EACd,QAAQ,EAGR,mBAAmB,EACnB,eAAe,EAChB,MAAM,UAAU,CAAC;AAKlB,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAG3B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAY5D,OAAO,EAGL,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,WAAW,CAAC;AAEnB;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,eAAe;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,qBAAa,uBAAwB,YAAW,mBAAmB,EAAE,oBAAoB;IAChF,YAAY;;;MAGjB;IAEF,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA4B;IACnD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAS;IAEpC,oCAAoC;IACpC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAS;IAC3C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAS;IAE7C;;;;OAIG;IACH,OAAO,CAAC,YAAY,CAAkC;IAEtD;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAwD;gBAGrF,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,yBAAyB,EACjC,OAAO,CAAC,EAAE,aAAa;IAkB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+
|
|
3
|
+
require("core-js/modules/es.symbol.description.js");
|
|
4
|
+
require("core-js/modules/es.array.filter.js");
|
|
5
|
+
require("core-js/modules/es.array.from.js");
|
|
6
|
+
require("core-js/modules/es.array.slice.js");
|
|
7
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
8
|
+
require("core-js/modules/es.regexp.to-string.js");
|
|
9
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
10
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
11
|
+
Object.defineProperty(exports, "__esModule", {
|
|
12
|
+
value: true
|
|
13
|
+
});
|
|
14
|
+
exports.RequestIframeClientImpl = void 0;
|
|
15
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
16
|
+
require("core-js/modules/es.array.iterator.js");
|
|
17
|
+
require("core-js/modules/es.map.js");
|
|
18
|
+
require("core-js/modules/es.promise.js");
|
|
19
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
20
|
+
require("core-js/modules/es.string.replace.js");
|
|
21
|
+
require("core-js/modules/es.string.starts-with.js");
|
|
22
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
23
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
24
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
+
var _utils = require("../utils");
|
|
26
|
+
var _interceptors = require("../interceptors");
|
|
27
|
+
var _constants = require("../constants");
|
|
28
|
+
var _stream = require("../stream");
|
|
29
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
30
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
31
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
32
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
33
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
34
|
+
/**
|
|
35
|
+
* Client configuration options
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* RequestIframeClient implementation (only responsible for initiating requests, reuses server's listener)
|
|
40
|
+
*/
|
|
41
|
+
class RequestIframeClientImpl {
|
|
42
|
+
constructor(targetWindow, targetOrigin, server, options) {
|
|
43
|
+
var _options$ackTimeout, _options$timeout, _options$asyncTimeout;
|
|
44
|
+
(0, _defineProperty2.default)(this, "interceptors", {
|
|
45
|
+
request: new _interceptors.RequestInterceptorManager(),
|
|
46
|
+
response: new _interceptors.ResponseInterceptorManager()
|
|
47
|
+
});
|
|
48
|
+
/**
|
|
49
|
+
* Internal cookies storage
|
|
50
|
+
* - Automatically includes cookies matching the path when sending requests
|
|
51
|
+
* - Automatically parses Set-Cookie and saves when receiving response
|
|
52
|
+
*/
|
|
53
|
+
(0, _defineProperty2.default)(this, "_cookieStore", new _utils.CookieStore());
|
|
54
|
+
/**
|
|
55
|
+
* Stream message handler map
|
|
56
|
+
* key: streamId
|
|
57
|
+
* value: stream message handler function
|
|
58
|
+
*/
|
|
59
|
+
(0, _defineProperty2.default)(this, "streamHandlers", new Map());
|
|
60
|
+
this.targetWindow = targetWindow;
|
|
61
|
+
this.targetOrigin = targetOrigin;
|
|
62
|
+
this.server = server;
|
|
63
|
+
this.secretKey = options === null || options === void 0 ? void 0 : options.secretKey;
|
|
64
|
+
|
|
65
|
+
// Set default timeout configuration
|
|
66
|
+
this.defaultAckTimeout = (_options$ackTimeout = options === null || options === void 0 ? void 0 : options.ackTimeout) !== null && _options$ackTimeout !== void 0 ? _options$ackTimeout : _constants.DefaultTimeout.ACK;
|
|
67
|
+
this.defaultTimeout = (_options$timeout = options === null || options === void 0 ? void 0 : options.timeout) !== null && _options$timeout !== void 0 ? _options$timeout : _constants.DefaultTimeout.REQUEST;
|
|
68
|
+
this.defaultAsyncTimeout = (_options$asyncTimeout = options === null || options === void 0 ? void 0 : options.asyncTimeout) !== null && _options$asyncTimeout !== void 0 ? _options$asyncTimeout : _constants.DefaultTimeout.ASYNC;
|
|
69
|
+
|
|
70
|
+
// Register stream message processing callback
|
|
71
|
+
this.server.setStreamCallback(data => {
|
|
72
|
+
this.dispatchStreamMessage(data);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Register stream message handler (StreamMessageHandler interface implementation)
|
|
78
|
+
*/
|
|
79
|
+
registerStreamHandler(streamId, handler) {
|
|
80
|
+
this.streamHandlers.set(streamId, handler);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Unregister stream message handler (StreamMessageHandler interface implementation)
|
|
85
|
+
*/
|
|
86
|
+
unregisterStreamHandler(streamId) {
|
|
87
|
+
this.streamHandlers.delete(streamId);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Send message (StreamMessageHandler interface implementation)
|
|
92
|
+
*/
|
|
93
|
+
postMessage(message) {
|
|
94
|
+
this.server.messageDispatcher.send(this.targetWindow, message, this.targetOrigin);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Dispatch stream message to corresponding handler
|
|
99
|
+
*/
|
|
100
|
+
dispatchStreamMessage(data) {
|
|
101
|
+
var body = data.body;
|
|
102
|
+
if (!body || !body.streamId) return;
|
|
103
|
+
var handler = this.streamHandlers.get(body.streamId);
|
|
104
|
+
if (handler) {
|
|
105
|
+
// Extract message type (remove stream_ prefix)
|
|
106
|
+
var messageType = data.type.replace('stream_', '');
|
|
107
|
+
handler(_objectSpread(_objectSpread({}, body), {}, {
|
|
108
|
+
type: messageType
|
|
109
|
+
}));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Check if server is reachable
|
|
115
|
+
*/
|
|
116
|
+
isConnect() {
|
|
117
|
+
return new Promise(resolve => {
|
|
118
|
+
var requestId = (0, _utils.generateRequestId)();
|
|
119
|
+
var done = false;
|
|
120
|
+
var timeoutId = null;
|
|
121
|
+
var cleanup = () => {
|
|
122
|
+
if (timeoutId) clearTimeout(timeoutId);
|
|
123
|
+
this.server._unregisterPendingRequest(requestId);
|
|
124
|
+
};
|
|
125
|
+
this.server._registerPendingRequest(requestId, data => {
|
|
126
|
+
if (done) return;
|
|
127
|
+
if (data.type === _constants.MessageType.PONG) {
|
|
128
|
+
done = true;
|
|
129
|
+
cleanup();
|
|
130
|
+
resolve(true);
|
|
131
|
+
}
|
|
132
|
+
}, () => {
|
|
133
|
+
if (done) return;
|
|
134
|
+
done = true;
|
|
135
|
+
cleanup();
|
|
136
|
+
resolve(false);
|
|
137
|
+
}, this.targetOrigin);
|
|
138
|
+
timeoutId = setTimeout(() => {
|
|
139
|
+
if (done) return;
|
|
140
|
+
done = true;
|
|
141
|
+
cleanup();
|
|
142
|
+
resolve(false);
|
|
143
|
+
}, this.defaultAckTimeout);
|
|
144
|
+
|
|
145
|
+
// Send ping via MessageDispatcher
|
|
146
|
+
this.server.messageDispatcher.sendMessage(this.targetWindow, this.targetOrigin, _constants.MessageType.PING, requestId);
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
send(path, body, options) {
|
|
150
|
+
var _this = this;
|
|
151
|
+
return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
152
|
+
var config, processedConfig, processedPath, processedBody, processedHeaders, processedCookies, _processedConfig$ackT, ackTimeout, _processedConfig$time, timeout, _processedConfig$asyn, asyncTimeout, _processedConfig$requ, requestId;
|
|
153
|
+
return _regenerator.default.wrap(function (_context) {
|
|
154
|
+
while (1) switch (_context.prev = _context.next) {
|
|
155
|
+
case 0:
|
|
156
|
+
config = _objectSpread({
|
|
157
|
+
path,
|
|
158
|
+
body
|
|
159
|
+
}, options);
|
|
160
|
+
_context.next = 1;
|
|
161
|
+
return (0, _interceptors.runRequestInterceptors)(_this.interceptors.request, config);
|
|
162
|
+
case 1:
|
|
163
|
+
processedConfig = _context.sent;
|
|
164
|
+
processedPath = processedConfig.path, processedBody = processedConfig.body, processedHeaders = processedConfig.headers, processedCookies = processedConfig.cookies, _processedConfig$ackT = processedConfig.ackTimeout, ackTimeout = _processedConfig$ackT === void 0 ? _this.defaultAckTimeout : _processedConfig$ackT, _processedConfig$time = processedConfig.timeout, timeout = _processedConfig$time === void 0 ? _this.defaultTimeout : _processedConfig$time, _processedConfig$asyn = processedConfig.asyncTimeout, asyncTimeout = _processedConfig$asyn === void 0 ? _this.defaultAsyncTimeout : _processedConfig$asyn, _processedConfig$requ = processedConfig.requestId, requestId = _processedConfig$requ === void 0 ? (0, _utils.generateRequestId)() : _processedConfig$requ;
|
|
165
|
+
return _context.abrupt("return", new Promise((resolve, reject) => {
|
|
166
|
+
var prefixedPath = _this.prefixPath(processedPath);
|
|
167
|
+
var done = false;
|
|
168
|
+
var timeoutId = null;
|
|
169
|
+
var cleanup = () => {
|
|
170
|
+
if (timeoutId) clearTimeout(timeoutId);
|
|
171
|
+
_this.server._unregisterPendingRequest(requestId);
|
|
172
|
+
};
|
|
173
|
+
var fail = error => {
|
|
174
|
+
if (done) return;
|
|
175
|
+
done = true;
|
|
176
|
+
cleanup();
|
|
177
|
+
reject(error);
|
|
178
|
+
};
|
|
179
|
+
var setAckTimeout = () => {
|
|
180
|
+
if (timeoutId) clearTimeout(timeoutId);
|
|
181
|
+
timeoutId = setTimeout(() => {
|
|
182
|
+
fail({
|
|
183
|
+
message: (0, _constants.formatMessage)(_constants.Messages.ACK_TIMEOUT, ackTimeout),
|
|
184
|
+
code: _constants.ErrorCode.ACK_TIMEOUT,
|
|
185
|
+
config: processedConfig,
|
|
186
|
+
requestId
|
|
187
|
+
});
|
|
188
|
+
}, ackTimeout);
|
|
189
|
+
};
|
|
190
|
+
var setRequestTimeout = () => {
|
|
191
|
+
if (timeoutId) clearTimeout(timeoutId);
|
|
192
|
+
timeoutId = setTimeout(() => {
|
|
193
|
+
fail({
|
|
194
|
+
message: (0, _constants.formatMessage)(_constants.Messages.REQUEST_TIMEOUT, timeout),
|
|
195
|
+
code: _constants.ErrorCode.TIMEOUT,
|
|
196
|
+
config: processedConfig,
|
|
197
|
+
requestId
|
|
198
|
+
});
|
|
199
|
+
}, timeout);
|
|
200
|
+
};
|
|
201
|
+
var setAsyncTimeout = () => {
|
|
202
|
+
if (timeoutId) clearTimeout(timeoutId);
|
|
203
|
+
timeoutId = setTimeout(() => {
|
|
204
|
+
fail({
|
|
205
|
+
message: (0, _constants.formatMessage)(_constants.Messages.ASYNC_REQUEST_TIMEOUT, asyncTimeout),
|
|
206
|
+
code: _constants.ErrorCode.ASYNC_TIMEOUT,
|
|
207
|
+
config: processedConfig,
|
|
208
|
+
requestId
|
|
209
|
+
});
|
|
210
|
+
}, asyncTimeout);
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
// Register to server's pending requests
|
|
214
|
+
_this.server._registerPendingRequest(requestId, data => {
|
|
215
|
+
if (done) return;
|
|
216
|
+
|
|
217
|
+
// Received ACK: server has received request
|
|
218
|
+
if (data.type === _constants.MessageType.ACK) {
|
|
219
|
+
// Switch to request timeout
|
|
220
|
+
setRequestTimeout();
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// Received ASYNC notification: this is an async task
|
|
225
|
+
if (data.type === _constants.MessageType.ASYNC) {
|
|
226
|
+
// Switch to async timeout
|
|
227
|
+
setAsyncTimeout();
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// Received stream start message
|
|
232
|
+
if (data.type === _constants.MessageType.STREAM_START) {
|
|
233
|
+
var _streamBody$chunked;
|
|
234
|
+
done = true;
|
|
235
|
+
cleanup();
|
|
236
|
+
var streamBody = data.body;
|
|
237
|
+
var streamId = streamBody.streamId;
|
|
238
|
+
var streamType = streamBody.type || _constants.StreamType.DATA;
|
|
239
|
+
var streamChunked = (_streamBody$chunked = streamBody.chunked) !== null && _streamBody$chunked !== void 0 ? _streamBody$chunked : true;
|
|
240
|
+
var streamMetadata = streamBody.metadata;
|
|
241
|
+
|
|
242
|
+
// Create corresponding readable stream based on stream type
|
|
243
|
+
var readableStream;
|
|
244
|
+
if (streamType === _constants.StreamType.FILE) {
|
|
245
|
+
readableStream = new _stream.IframeFileReadableStream(streamId, requestId, _this, {
|
|
246
|
+
chunked: streamChunked,
|
|
247
|
+
metadata: streamMetadata,
|
|
248
|
+
filename: streamMetadata === null || streamMetadata === void 0 ? void 0 : streamMetadata.filename,
|
|
249
|
+
mimeType: streamMetadata === null || streamMetadata === void 0 ? void 0 : streamMetadata.mimeType,
|
|
250
|
+
size: streamMetadata === null || streamMetadata === void 0 ? void 0 : streamMetadata.size
|
|
251
|
+
});
|
|
252
|
+
} else {
|
|
253
|
+
readableStream = new _stream.IframeReadableStream(streamId, requestId, _this, {
|
|
254
|
+
type: streamType,
|
|
255
|
+
chunked: streamChunked,
|
|
256
|
+
metadata: streamMetadata
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
var resp = {
|
|
260
|
+
data: undefined,
|
|
261
|
+
status: data.status || _constants.HttpStatus.OK,
|
|
262
|
+
statusText: data.statusText || _constants.HttpStatusText[_constants.HttpStatus.OK],
|
|
263
|
+
requestId,
|
|
264
|
+
headers: data.headers,
|
|
265
|
+
stream: readableStream
|
|
266
|
+
};
|
|
267
|
+
(0, _interceptors.runResponseInterceptors)(_this.interceptors.response, resp).then(resolve).catch(reject);
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// Received stream data/end/error/cancel message - dispatch to stream handler
|
|
272
|
+
if (data.type.startsWith('stream_')) {
|
|
273
|
+
_this.dispatchStreamMessage(data);
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// Received response
|
|
278
|
+
if (data.type === _constants.MessageType.RESPONSE) {
|
|
279
|
+
done = true;
|
|
280
|
+
cleanup();
|
|
281
|
+
|
|
282
|
+
// If server requires acknowledgment, send received message
|
|
283
|
+
if (data.requireAck) {
|
|
284
|
+
_this.server.messageDispatcher.sendMessage(_this.targetWindow, _this.targetOrigin, _constants.MessageType.RECEIVED, requestId, {
|
|
285
|
+
path: prefixedPath
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// Parse and save server-set cookies (from Set-Cookie header)
|
|
290
|
+
if (data.headers && data.headers[_constants.HttpHeader.SET_COOKIE]) {
|
|
291
|
+
var setCookies = data.headers[_constants.HttpHeader.SET_COOKIE];
|
|
292
|
+
var setCookieArray = Array.isArray(setCookies) ? setCookies : [setCookies];
|
|
293
|
+
var _iterator = _createForOfIteratorHelper(setCookieArray),
|
|
294
|
+
_step;
|
|
295
|
+
try {
|
|
296
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
297
|
+
var setCookieStr = _step.value;
|
|
298
|
+
_this._cookieStore.setFromSetCookie(setCookieStr);
|
|
299
|
+
}
|
|
300
|
+
} catch (err) {
|
|
301
|
+
_iterator.e(err);
|
|
302
|
+
} finally {
|
|
303
|
+
_iterator.f();
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
var _resp = {
|
|
307
|
+
data: data.data,
|
|
308
|
+
status: data.status || _constants.HttpStatus.OK,
|
|
309
|
+
statusText: data.statusText || _constants.HttpStatusText[_constants.HttpStatus.OK],
|
|
310
|
+
requestId,
|
|
311
|
+
headers: data.headers,
|
|
312
|
+
fileData: data.fileData
|
|
313
|
+
};
|
|
314
|
+
(0, _interceptors.runResponseInterceptors)(_this.interceptors.response, _resp).then(resolve).catch(reject);
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// Received error
|
|
319
|
+
if (data.type === _constants.MessageType.ERROR) {
|
|
320
|
+
var _data$error, _data$error2;
|
|
321
|
+
// If server requires acknowledgment, send received message
|
|
322
|
+
if (data.requireAck) {
|
|
323
|
+
_this.server.messageDispatcher.sendMessage(_this.targetWindow, _this.targetOrigin, _constants.MessageType.RECEIVED, requestId, {
|
|
324
|
+
path: prefixedPath
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
var err = {
|
|
328
|
+
message: ((_data$error = data.error) === null || _data$error === void 0 ? void 0 : _data$error.message) || _constants.Messages.REQUEST_FAILED,
|
|
329
|
+
code: ((_data$error2 = data.error) === null || _data$error2 === void 0 ? void 0 : _data$error2.code) || _constants.ErrorCode.REQUEST_ERROR,
|
|
330
|
+
config: processedConfig,
|
|
331
|
+
response: data.status ? {
|
|
332
|
+
data: data.data,
|
|
333
|
+
status: data.status,
|
|
334
|
+
statusText: data.statusText || _constants.Messages.ERROR
|
|
335
|
+
} : undefined,
|
|
336
|
+
requestId
|
|
337
|
+
};
|
|
338
|
+
fail(err);
|
|
339
|
+
}
|
|
340
|
+
}, error => {
|
|
341
|
+
fail({
|
|
342
|
+
message: error.message || _constants.Messages.REQUEST_FAILED,
|
|
343
|
+
code: _constants.ErrorCode.REQUEST_ERROR,
|
|
344
|
+
config: processedConfig,
|
|
345
|
+
requestId
|
|
346
|
+
});
|
|
347
|
+
}, _this.targetOrigin);
|
|
348
|
+
|
|
349
|
+
// Set ACK timeout
|
|
350
|
+
setAckTimeout();
|
|
351
|
+
|
|
352
|
+
// Get cookies matching request path and merge with user-provided cookies (user-provided takes precedence)
|
|
353
|
+
var pathMatchedCookies = _this._cookieStore.getForPath(processedPath);
|
|
354
|
+
var mergedCookies = _objectSpread(_objectSpread({}, pathMatchedCookies), processedCookies);
|
|
355
|
+
|
|
356
|
+
// Send request via MessageDispatcher
|
|
357
|
+
_this.server.messageDispatcher.sendMessage(_this.targetWindow, _this.targetOrigin, _constants.MessageType.REQUEST, requestId, {
|
|
358
|
+
path: prefixedPath,
|
|
359
|
+
body: processedBody,
|
|
360
|
+
headers: processedHeaders,
|
|
361
|
+
cookies: mergedCookies
|
|
362
|
+
});
|
|
363
|
+
}));
|
|
364
|
+
case 2:
|
|
365
|
+
case "end":
|
|
366
|
+
return _context.stop();
|
|
367
|
+
}
|
|
368
|
+
}, _callee);
|
|
369
|
+
}))();
|
|
370
|
+
}
|
|
371
|
+
prefixPath(path) {
|
|
372
|
+
return this.secretKey ? `${this.secretKey}:${path}` : path;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Get internal server instance (for debugging)
|
|
377
|
+
*/
|
|
378
|
+
getServer() {
|
|
379
|
+
return this.server;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Get all cookies matching specified path
|
|
384
|
+
* @param path Request path, returns all cookies if not provided
|
|
385
|
+
*/
|
|
386
|
+
getCookies(path) {
|
|
387
|
+
if (path) {
|
|
388
|
+
return this._cookieStore.getForPath(path);
|
|
389
|
+
}
|
|
390
|
+
return this._cookieStore.getAllSimple();
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Get specified cookie
|
|
395
|
+
* @param name Cookie name
|
|
396
|
+
* @param path Path (optional)
|
|
397
|
+
*/
|
|
398
|
+
getCookie(name, path) {
|
|
399
|
+
return this._cookieStore.get(name, path);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Set cookie
|
|
404
|
+
* @param name Cookie name
|
|
405
|
+
* @param value Cookie value
|
|
406
|
+
* @param options Cookie options (path, etc.)
|
|
407
|
+
*/
|
|
408
|
+
setCookie(name, value, options) {
|
|
409
|
+
var _options$path;
|
|
410
|
+
var expires;
|
|
411
|
+
if (options !== null && options !== void 0 && options.expires) {
|
|
412
|
+
expires = options.expires.getTime();
|
|
413
|
+
} else if ((options === null || options === void 0 ? void 0 : options.maxAge) !== undefined) {
|
|
414
|
+
expires = Date.now() + options.maxAge * 1000;
|
|
415
|
+
}
|
|
416
|
+
this._cookieStore.set({
|
|
417
|
+
name,
|
|
418
|
+
value,
|
|
419
|
+
path: (_options$path = options === null || options === void 0 ? void 0 : options.path) !== null && _options$path !== void 0 ? _options$path : '/',
|
|
420
|
+
expires
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Remove specified cookie
|
|
426
|
+
* @param name Cookie name
|
|
427
|
+
* @param path Path (optional, defaults to '/')
|
|
428
|
+
*/
|
|
429
|
+
removeCookie(name, path) {
|
|
430
|
+
this._cookieStore.remove(name, path !== null && path !== void 0 ? path : '/');
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* Clear all cookies
|
|
435
|
+
*/
|
|
436
|
+
clearCookies() {
|
|
437
|
+
this._cookieStore.clear();
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
exports.RequestIframeClientImpl = RequestIframeClientImpl;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { PostMessageData, ServerEventName } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* 消息处理器配置
|
|
4
|
+
*/
|
|
5
|
+
export interface MessageHandlerOptions {
|
|
6
|
+
/** 消息隔离标识 */
|
|
7
|
+
uniqueKey?: string;
|
|
8
|
+
/** ACK 超时时间 */
|
|
9
|
+
ackTimeout?: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 消息处理回调
|
|
13
|
+
*/
|
|
14
|
+
export interface MessageHandlerCallbacks {
|
|
15
|
+
/** 处理请求 */
|
|
16
|
+
onRequest?: (data: PostMessageData, event: MessageEvent) => void;
|
|
17
|
+
/** 处理客户端响应(ack、async、response、error) */
|
|
18
|
+
onClientResponse?: (data: PostMessageData, event: MessageEvent) => void;
|
|
19
|
+
/** 处理 received 确认 */
|
|
20
|
+
onReceived?: (data: PostMessageData, event: MessageEvent) => void;
|
|
21
|
+
/** 处理 ping */
|
|
22
|
+
onPing?: (data: PostMessageData, event: MessageEvent) => void;
|
|
23
|
+
/** 处理 pong */
|
|
24
|
+
onPong?: (data: PostMessageData, event: MessageEvent) => void;
|
|
25
|
+
/** 处理流消息 */
|
|
26
|
+
onStream?: (data: PostMessageData, event: MessageEvent) => void;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* IframeMessageHandler - 底层消息处理器
|
|
30
|
+
* 负责 postMessage 监听、协议验证、uniqueKey 隔离、事件分发
|
|
31
|
+
*/
|
|
32
|
+
export declare class IframeMessageHandler {
|
|
33
|
+
readonly uniqueKey?: string;
|
|
34
|
+
readonly ackTimeout: number;
|
|
35
|
+
private readonly listeners;
|
|
36
|
+
/** 等待客户端确认的响应 */
|
|
37
|
+
private readonly pendingAcks;
|
|
38
|
+
/** 等待响应的请求 */
|
|
39
|
+
private readonly pendingRequests;
|
|
40
|
+
/** 消息处理回调 */
|
|
41
|
+
private callbacks;
|
|
42
|
+
/** 消息监听函数(绑定 this) */
|
|
43
|
+
private readonly boundOnMessage;
|
|
44
|
+
constructor(options?: MessageHandlerOptions);
|
|
45
|
+
/**
|
|
46
|
+
* 设置消息处理回调
|
|
47
|
+
*/
|
|
48
|
+
setCallbacks(callbacks: MessageHandlerCallbacks): void;
|
|
49
|
+
/**
|
|
50
|
+
* 消息处理入口
|
|
51
|
+
*/
|
|
52
|
+
private onMessage;
|
|
53
|
+
/**
|
|
54
|
+
* 分发消息到具体处理器
|
|
55
|
+
*/
|
|
56
|
+
private dispatchMessage;
|
|
57
|
+
/**
|
|
58
|
+
* 处理客户端响应
|
|
59
|
+
*/
|
|
60
|
+
private handleClientResponse;
|
|
61
|
+
/**
|
|
62
|
+
* 处理 received 确认
|
|
63
|
+
*/
|
|
64
|
+
private handleReceived;
|
|
65
|
+
/**
|
|
66
|
+
* 处理 ping
|
|
67
|
+
*/
|
|
68
|
+
private handlePing;
|
|
69
|
+
/**
|
|
70
|
+
* 处理 pong
|
|
71
|
+
*/
|
|
72
|
+
private handlePong;
|
|
73
|
+
/**
|
|
74
|
+
* 注册等待确认的响应
|
|
75
|
+
*/
|
|
76
|
+
registerPendingAck(requestId: string, resolve: (received: boolean) => void, reject: (error: Error) => void): void;
|
|
77
|
+
/**
|
|
78
|
+
* 注册等待响应的请求
|
|
79
|
+
*/
|
|
80
|
+
registerPendingRequest(requestId: string, resolve: (data: PostMessageData) => void, reject: (error: Error) => void, origin?: string): void;
|
|
81
|
+
/**
|
|
82
|
+
* 取消等待响应
|
|
83
|
+
*/
|
|
84
|
+
unregisterPendingRequest(requestId: string): void;
|
|
85
|
+
/**
|
|
86
|
+
* 监听事件
|
|
87
|
+
*/
|
|
88
|
+
on(event: ServerEventName, fn: (payload: any, messageEvent?: MessageEvent) => void): void;
|
|
89
|
+
/**
|
|
90
|
+
* 取消监听
|
|
91
|
+
*/
|
|
92
|
+
off(event: ServerEventName, fn?: (payload: any, messageEvent?: MessageEvent) => void): void;
|
|
93
|
+
/**
|
|
94
|
+
* 触发事件
|
|
95
|
+
*/
|
|
96
|
+
private emit;
|
|
97
|
+
/**
|
|
98
|
+
* 添加 path 前缀
|
|
99
|
+
*/
|
|
100
|
+
prefixPath(path: string): string;
|
|
101
|
+
/**
|
|
102
|
+
* 发送协议版本错误
|
|
103
|
+
*/
|
|
104
|
+
private sendProtocolError;
|
|
105
|
+
/**
|
|
106
|
+
* 销毁
|
|
107
|
+
*/
|
|
108
|
+
destroy(): void;
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=message-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-handler.d.ts","sourceRoot":"","sources":["../../src/core/message-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,eAAe,EAChB,MAAM,UAAU,CAAC;AAIlB;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,aAAa;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,WAAW;IACX,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IACjE,wCAAwC;IACxC,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IACxE,qBAAqB;IACrB,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAClE,cAAc;IACd,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe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