request-iframe 0.0.2 → 0.0.3
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.CN.md +269 -12
- package/README.md +266 -11
- package/library/__tests__/channel.test.ts +420 -0
- package/library/__tests__/debug.test.ts +588 -0
- package/library/__tests__/dispatcher.test.ts +481 -0
- package/library/__tests__/requestIframe.test.ts +2127 -99
- package/library/__tests__/server.test.ts +738 -0
- package/library/api/client.d.ts.map +1 -1
- package/library/api/client.js +11 -6
- package/library/api/server.d.ts +4 -3
- package/library/api/server.d.ts.map +1 -1
- package/library/api/server.js +25 -7
- package/library/constants/index.d.ts +14 -4
- package/library/constants/index.d.ts.map +1 -1
- package/library/constants/index.js +15 -7
- package/library/constants/messages.d.ts +35 -0
- package/library/constants/messages.d.ts.map +1 -1
- package/library/constants/messages.js +36 -1
- package/library/core/client-server.d.ts +101 -0
- package/library/core/client-server.d.ts.map +1 -0
- package/library/core/client-server.js +266 -0
- package/library/core/client.d.ts +22 -6
- package/library/core/client.d.ts.map +1 -1
- package/library/core/client.js +159 -24
- package/library/core/request.d.ts.map +1 -1
- package/library/core/response.d.ts +5 -1
- package/library/core/response.d.ts.map +1 -1
- package/library/core/response.js +85 -70
- package/library/core/server-client.d.ts +3 -1
- package/library/core/server-client.d.ts.map +1 -1
- package/library/core/server-client.js +19 -9
- package/library/core/server.d.ts +9 -1
- package/library/core/server.d.ts.map +1 -1
- package/library/core/server.js +96 -52
- package/library/index.d.ts +1 -1
- package/library/index.js +2 -2
- package/library/interceptors/index.d.ts.map +1 -1
- package/library/message/channel.d.ts +3 -1
- package/library/message/channel.d.ts.map +1 -1
- package/library/message/dispatcher.d.ts +7 -2
- package/library/message/dispatcher.d.ts.map +1 -1
- package/library/message/dispatcher.js +47 -2
- package/library/message/index.d.ts.map +1 -1
- package/library/stream/file-stream.d.ts +5 -0
- package/library/stream/file-stream.d.ts.map +1 -1
- package/library/stream/file-stream.js +41 -12
- package/library/stream/index.d.ts.map +1 -1
- package/library/stream/readable-stream.d.ts.map +1 -1
- package/library/stream/readable-stream.js +32 -30
- package/library/stream/types.d.ts +18 -0
- package/library/stream/types.d.ts.map +1 -1
- package/library/stream/writable-stream.d.ts +1 -0
- package/library/stream/writable-stream.d.ts.map +1 -1
- package/library/stream/writable-stream.js +7 -2
- package/library/types/index.d.ts +80 -28
- package/library/types/index.d.ts.map +1 -1
- package/library/utils/cache.d.ts +24 -0
- package/library/utils/cache.d.ts.map +1 -1
- package/library/utils/cache.js +76 -0
- package/library/utils/cookie.d.ts.map +1 -1
- package/library/utils/debug.d.ts.map +1 -1
- package/library/utils/debug.js +382 -20
- package/library/utils/index.d.ts +5 -0
- package/library/utils/index.d.ts.map +1 -1
- package/library/utils/index.js +14 -1
- package/library/utils/path-match.d.ts.map +1 -1
- package/library/utils/protocol.d.ts.map +1 -1
- package/package.json +3 -1
- package/react/library/__tests__/index.test.tsx +238 -267
- package/react/library/index.d.ts +4 -3
- package/react/library/index.d.ts.map +1 -1
- package/react/library/index.js +167 -158
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["debug.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/utils/debug.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAiDpE;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAsE9E;AA8GD;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CA+H3E"}
|
package/library/utils/debug.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
require("core-js/modules/es.array.filter.js");
|
|
4
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
5
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
3
6
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
7
|
Object.defineProperty(exports, "__esModule", {
|
|
5
8
|
value: true
|
|
@@ -7,8 +10,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
10
|
exports.setupClientDebugInterceptors = setupClientDebugInterceptors;
|
|
8
11
|
exports.setupServerDebugListeners = setupServerDebugListeners;
|
|
9
12
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
|
-
|
|
13
|
+
require("core-js/modules/es.array.iterator.js");
|
|
14
|
+
require("core-js/modules/es.map.js");
|
|
11
15
|
require("core-js/modules/es.promise.js");
|
|
16
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
17
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
18
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
19
|
+
var _constants = require("../constants");
|
|
20
|
+
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; }
|
|
21
|
+
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; }
|
|
12
22
|
/**
|
|
13
23
|
* Debug log prefix
|
|
14
24
|
*/
|
|
@@ -27,41 +37,202 @@ function log(level, message, data) {
|
|
|
27
37
|
}
|
|
28
38
|
}
|
|
29
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Format message data for logging (remove sensitive data if needed)
|
|
42
|
+
*/
|
|
43
|
+
function formatMessageData(data) {
|
|
44
|
+
if (!data) return data;
|
|
45
|
+
var formatted = _objectSpread({}, data);
|
|
46
|
+
|
|
47
|
+
// Limit body size in logs
|
|
48
|
+
if (formatted.body && typeof formatted.body === 'object') {
|
|
49
|
+
var bodyStr = JSON.stringify(formatted.body);
|
|
50
|
+
if (bodyStr.length > 500) {
|
|
51
|
+
formatted.body = bodyStr.substring(0, 500) + '... (truncated)';
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Limit data size in logs
|
|
56
|
+
if (formatted.data && typeof formatted.data === 'object') {
|
|
57
|
+
var dataStr = JSON.stringify(formatted.data);
|
|
58
|
+
if (dataStr.length > 500) {
|
|
59
|
+
formatted.data = dataStr.substring(0, 500) + '... (truncated)';
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return formatted;
|
|
63
|
+
}
|
|
64
|
+
|
|
30
65
|
/**
|
|
31
66
|
* Register debug interceptors for client
|
|
32
67
|
*/
|
|
33
68
|
function setupClientDebugInterceptors(client) {
|
|
34
69
|
// Request interceptor: log request start
|
|
35
70
|
client.interceptors.request.use(config => {
|
|
36
|
-
log('info',
|
|
71
|
+
log('info', _constants.Messages.DEBUG_CLIENT_REQUEST_START, formatMessageData({
|
|
37
72
|
path: config.path,
|
|
38
73
|
body: config.body,
|
|
74
|
+
headers: config.headers,
|
|
75
|
+
cookies: config.cookies,
|
|
39
76
|
ackTimeout: config.ackTimeout,
|
|
40
77
|
timeout: config.timeout,
|
|
41
78
|
asyncTimeout: config.asyncTimeout,
|
|
42
79
|
requestId: config.requestId
|
|
43
|
-
});
|
|
80
|
+
}));
|
|
44
81
|
return config;
|
|
45
82
|
});
|
|
46
83
|
|
|
47
84
|
// Response interceptor: log response success
|
|
48
85
|
client.interceptors.response.use(response => {
|
|
49
|
-
|
|
86
|
+
var logData = {
|
|
50
87
|
requestId: response.requestId,
|
|
51
88
|
status: response.status,
|
|
52
89
|
statusText: response.statusText,
|
|
53
|
-
|
|
54
|
-
}
|
|
90
|
+
headers: response.headers
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
// Check if response.data is a File or Blob
|
|
94
|
+
if (response.data instanceof File || response.data instanceof Blob) {
|
|
95
|
+
var file = response.data;
|
|
96
|
+
var fileName = file instanceof File ? file.name : undefined;
|
|
97
|
+
var mimeType = file.type || undefined;
|
|
98
|
+
var contentLength = file.size;
|
|
99
|
+
logData.fileData = {
|
|
100
|
+
fileName,
|
|
101
|
+
mimeType,
|
|
102
|
+
contentLength
|
|
103
|
+
};
|
|
104
|
+
log('info', _constants.Messages.DEBUG_CLIENT_REQUEST_SUCCESS_FILE, formatMessageData(logData));
|
|
105
|
+
} else if (response.stream) {
|
|
106
|
+
logData.stream = {
|
|
107
|
+
streamId: response.stream.streamId,
|
|
108
|
+
type: response.stream.type
|
|
109
|
+
};
|
|
110
|
+
log('info', _constants.Messages.DEBUG_CLIENT_REQUEST_SUCCESS_STREAM, formatMessageData(logData));
|
|
111
|
+
} else {
|
|
112
|
+
logData.data = response.data;
|
|
113
|
+
log('info', _constants.Messages.DEBUG_CLIENT_REQUEST_SUCCESS, formatMessageData(logData));
|
|
114
|
+
}
|
|
55
115
|
return response;
|
|
56
116
|
}, error => {
|
|
57
|
-
log('error',
|
|
117
|
+
log('error', _constants.Messages.DEBUG_CLIENT_REQUEST_FAILED, formatMessageData({
|
|
58
118
|
requestId: error.requestId,
|
|
59
119
|
code: error.code,
|
|
60
120
|
message: error.message,
|
|
121
|
+
config: error.config,
|
|
61
122
|
response: error.response
|
|
62
|
-
});
|
|
123
|
+
}));
|
|
63
124
|
return Promise.reject(error);
|
|
64
125
|
});
|
|
126
|
+
|
|
127
|
+
// Hook into client's internal message handling via server's message dispatcher
|
|
128
|
+
// This requires accessing internal properties, so we use type assertion
|
|
129
|
+
var clientImpl = client;
|
|
130
|
+
if (clientImpl.server && clientImpl.server.messageDispatcher) {
|
|
131
|
+
setupClientMessageDebugging(clientImpl);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Setup message-level debugging for client
|
|
137
|
+
*/
|
|
138
|
+
function setupClientMessageDebugging(clientImpl) {
|
|
139
|
+
var _server$_registerPend, _server$messageDispat;
|
|
140
|
+
var server = clientImpl.server;
|
|
141
|
+
|
|
142
|
+
// Store original _registerPendingRequest
|
|
143
|
+
var originalRegister = (_server$_registerPend = server._registerPendingRequest) === null || _server$_registerPend === void 0 ? void 0 : _server$_registerPend.bind(server);
|
|
144
|
+
if (originalRegister) {
|
|
145
|
+
server._registerPendingRequest = function (requestId, resolve, reject, origin) {
|
|
146
|
+
// Wrap resolve to log incoming messages
|
|
147
|
+
var wrappedResolve = data => {
|
|
148
|
+
if (data.type === _constants.MessageType.ACK) {
|
|
149
|
+
log('info', _constants.Messages.DEBUG_CLIENT_RECEIVED_ACK, formatMessageData({
|
|
150
|
+
requestId: data.requestId,
|
|
151
|
+
path: data.path
|
|
152
|
+
}));
|
|
153
|
+
} else if (data.type === _constants.MessageType.ASYNC) {
|
|
154
|
+
log('info', _constants.Messages.DEBUG_CLIENT_RECEIVED_ASYNC, formatMessageData({
|
|
155
|
+
requestId: data.requestId,
|
|
156
|
+
path: data.path
|
|
157
|
+
}));
|
|
158
|
+
} else if (data.type === _constants.MessageType.STREAM_START) {
|
|
159
|
+
var streamBody = data.body;
|
|
160
|
+
log('info', _constants.Messages.DEBUG_CLIENT_RECEIVED_STREAM_START, formatMessageData({
|
|
161
|
+
requestId: data.requestId,
|
|
162
|
+
streamId: streamBody === null || streamBody === void 0 ? void 0 : streamBody.streamId,
|
|
163
|
+
streamType: streamBody === null || streamBody === void 0 ? void 0 : streamBody.type,
|
|
164
|
+
chunked: streamBody === null || streamBody === void 0 ? void 0 : streamBody.chunked,
|
|
165
|
+
autoResolve: streamBody === null || streamBody === void 0 ? void 0 : streamBody.autoResolve,
|
|
166
|
+
metadata: streamBody === null || streamBody === void 0 ? void 0 : streamBody.metadata
|
|
167
|
+
}));
|
|
168
|
+
} else if (data.type === _constants.MessageType.STREAM_DATA) {
|
|
169
|
+
var _streamBody$data;
|
|
170
|
+
var _streamBody = data.body;
|
|
171
|
+
log('info', _constants.Messages.DEBUG_CLIENT_RECEIVED_STREAM_DATA, formatMessageData({
|
|
172
|
+
requestId: data.requestId,
|
|
173
|
+
streamId: _streamBody === null || _streamBody === void 0 ? void 0 : _streamBody.streamId,
|
|
174
|
+
done: _streamBody === null || _streamBody === void 0 ? void 0 : _streamBody.done,
|
|
175
|
+
dataLength: (_streamBody === null || _streamBody === void 0 || (_streamBody$data = _streamBody.data) === null || _streamBody$data === void 0 ? void 0 : _streamBody$data.length) || 0
|
|
176
|
+
}));
|
|
177
|
+
} else if (data.type === _constants.MessageType.STREAM_END) {
|
|
178
|
+
var _streamBody2 = data.body;
|
|
179
|
+
log('info', _constants.Messages.DEBUG_CLIENT_RECEIVED_STREAM_END, formatMessageData({
|
|
180
|
+
requestId: data.requestId,
|
|
181
|
+
streamId: _streamBody2 === null || _streamBody2 === void 0 ? void 0 : _streamBody2.streamId
|
|
182
|
+
}));
|
|
183
|
+
} else if (data.type === _constants.MessageType.RESPONSE) {
|
|
184
|
+
log('info', _constants.Messages.DEBUG_CLIENT_RECEIVED_RESPONSE, formatMessageData({
|
|
185
|
+
requestId: data.requestId,
|
|
186
|
+
status: data.status,
|
|
187
|
+
statusText: data.statusText,
|
|
188
|
+
requireAck: data.requireAck
|
|
189
|
+
}));
|
|
190
|
+
} else if (data.type === _constants.MessageType.ERROR) {
|
|
191
|
+
log('error', _constants.Messages.DEBUG_CLIENT_RECEIVED_ERROR, formatMessageData({
|
|
192
|
+
requestId: data.requestId,
|
|
193
|
+
status: data.status,
|
|
194
|
+
statusText: data.statusText,
|
|
195
|
+
error: data.error
|
|
196
|
+
}));
|
|
197
|
+
}
|
|
198
|
+
resolve(data);
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
// Wrap reject to log timeouts
|
|
202
|
+
var wrappedReject = () => {
|
|
203
|
+
log('warn', _constants.Messages.DEBUG_CLIENT_REQUEST_TIMEOUT, {
|
|
204
|
+
requestId,
|
|
205
|
+
origin
|
|
206
|
+
});
|
|
207
|
+
reject();
|
|
208
|
+
};
|
|
209
|
+
return originalRegister(requestId, wrappedResolve, wrappedReject, origin);
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// Log when messages are sent
|
|
214
|
+
var originalSendMessage = (_server$messageDispat = server.messageDispatcher) === null || _server$messageDispat === void 0 || (_server$messageDispat = _server$messageDispat.sendMessage) === null || _server$messageDispat === void 0 ? void 0 : _server$messageDispat.bind(server.messageDispatcher);
|
|
215
|
+
if (originalSendMessage) {
|
|
216
|
+
server.messageDispatcher.sendMessage = function (target, targetOrigin, type, requestId, data) {
|
|
217
|
+
if (type === _constants.MessageType.REQUEST) {
|
|
218
|
+
log('info', _constants.Messages.DEBUG_CLIENT_SENDING_REQUEST, formatMessageData({
|
|
219
|
+
requestId,
|
|
220
|
+
path: data === null || data === void 0 ? void 0 : data.path,
|
|
221
|
+
body: data === null || data === void 0 ? void 0 : data.body,
|
|
222
|
+
headers: data === null || data === void 0 ? void 0 : data.headers
|
|
223
|
+
}));
|
|
224
|
+
} else if (type === _constants.MessageType.PING) {
|
|
225
|
+
log('info', _constants.Messages.DEBUG_CLIENT_SENDING_PING, {
|
|
226
|
+
requestId
|
|
227
|
+
});
|
|
228
|
+
} else if (type === _constants.MessageType.RECEIVED) {
|
|
229
|
+
log('info', _constants.Messages.DEBUG_CLIENT_SENDING_RECEIVED_ACK, {
|
|
230
|
+
requestId
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
return originalSendMessage(target, targetOrigin, type, requestId, data);
|
|
234
|
+
};
|
|
235
|
+
}
|
|
65
236
|
}
|
|
66
237
|
|
|
67
238
|
/**
|
|
@@ -69,34 +240,72 @@ function setupClientDebugInterceptors(client) {
|
|
|
69
240
|
* Use middleware to log requests and responses
|
|
70
241
|
*/
|
|
71
242
|
function setupServerDebugListeners(server) {
|
|
243
|
+
var serverImpl = server;
|
|
244
|
+
var startTimes = new Map();
|
|
245
|
+
|
|
72
246
|
// Use global middleware to log requests
|
|
73
247
|
server.use((req, res, next) => {
|
|
74
|
-
|
|
248
|
+
var _res$sendStream;
|
|
249
|
+
var startTime = Date.now();
|
|
250
|
+
startTimes.set(req.requestId, startTime);
|
|
251
|
+
log('info', _constants.Messages.DEBUG_SERVER_RECEIVED_REQUEST, formatMessageData({
|
|
75
252
|
requestId: req.requestId,
|
|
76
253
|
path: req.path,
|
|
77
254
|
body: req.body,
|
|
78
255
|
origin: req.origin,
|
|
79
256
|
headers: req.headers,
|
|
80
|
-
cookies: req.cookies
|
|
81
|
-
|
|
257
|
+
cookies: req.cookies,
|
|
258
|
+
method: 'POST' // iframe requests are always POST-like
|
|
259
|
+
}));
|
|
82
260
|
|
|
83
261
|
// Store original send methods
|
|
84
262
|
var originalSend = res.send.bind(res);
|
|
85
263
|
var originalJson = res.json.bind(res);
|
|
86
264
|
var originalSendFile = res.sendFile.bind(res);
|
|
265
|
+
var originalSendStream = (_res$sendStream = res.sendStream) === null || _res$sendStream === void 0 ? void 0 : _res$sendStream.bind(res);
|
|
266
|
+
var originalStatus = res.status.bind(res);
|
|
267
|
+
var originalSetHeader = res.setHeader.bind(res);
|
|
268
|
+
|
|
269
|
+
// Track status code changes
|
|
270
|
+
res.status = function (code) {
|
|
271
|
+
log('info', _constants.Messages.DEBUG_SERVER_SETTING_STATUS_CODE, {
|
|
272
|
+
requestId: req.requestId,
|
|
273
|
+
path: req.path,
|
|
274
|
+
statusCode: code
|
|
275
|
+
});
|
|
276
|
+
return originalStatus(code);
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
// Track header changes
|
|
280
|
+
res.setHeader = function (name, value) {
|
|
281
|
+
log('info', _constants.Messages.DEBUG_SERVER_SETTING_HEADER, {
|
|
282
|
+
requestId: req.requestId,
|
|
283
|
+
path: req.path,
|
|
284
|
+
header: name,
|
|
285
|
+
value: Array.isArray(value) ? value.join(', ') : String(value)
|
|
286
|
+
});
|
|
287
|
+
return originalSetHeader(name, value);
|
|
288
|
+
};
|
|
87
289
|
|
|
88
290
|
// Override send method
|
|
89
291
|
res.send = /*#__PURE__*/function () {
|
|
90
292
|
var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(data, options) {
|
|
293
|
+
var duration;
|
|
91
294
|
return _regenerator.default.wrap(function (_context) {
|
|
92
295
|
while (1) switch (_context.prev = _context.next) {
|
|
93
296
|
case 0:
|
|
94
|
-
|
|
297
|
+
duration = Date.now() - (startTimes.get(req.requestId) || startTime);
|
|
298
|
+
startTimes.delete(req.requestId);
|
|
299
|
+
log('info', _constants.Messages.DEBUG_SERVER_SENDING_RESPONSE, formatMessageData({
|
|
95
300
|
requestId: req.requestId,
|
|
96
301
|
path: req.path,
|
|
97
302
|
status: res.statusCode,
|
|
98
|
-
|
|
99
|
-
|
|
303
|
+
statusText: (0, _constants.getStatusText)(res.statusCode),
|
|
304
|
+
requireAck: options === null || options === void 0 ? void 0 : options.requireAck,
|
|
305
|
+
headers: res.headers,
|
|
306
|
+
data,
|
|
307
|
+
duration: `${duration}ms`
|
|
308
|
+
}));
|
|
100
309
|
return _context.abrupt("return", originalSend(data, options));
|
|
101
310
|
case 1:
|
|
102
311
|
case "end":
|
|
@@ -112,15 +321,22 @@ function setupServerDebugListeners(server) {
|
|
|
112
321
|
// Override json method
|
|
113
322
|
res.json = /*#__PURE__*/function () {
|
|
114
323
|
var _ref2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(data, options) {
|
|
324
|
+
var duration;
|
|
115
325
|
return _regenerator.default.wrap(function (_context2) {
|
|
116
326
|
while (1) switch (_context2.prev = _context2.next) {
|
|
117
327
|
case 0:
|
|
118
|
-
|
|
328
|
+
duration = Date.now() - (startTimes.get(req.requestId) || startTime);
|
|
329
|
+
startTimes.delete(req.requestId);
|
|
330
|
+
log('info', _constants.Messages.DEBUG_SERVER_SENDING_JSON_RESPONSE, formatMessageData({
|
|
119
331
|
requestId: req.requestId,
|
|
120
332
|
path: req.path,
|
|
121
333
|
status: res.statusCode,
|
|
122
|
-
|
|
123
|
-
|
|
334
|
+
statusText: (0, _constants.getStatusText)(res.statusCode),
|
|
335
|
+
requireAck: options === null || options === void 0 ? void 0 : options.requireAck,
|
|
336
|
+
headers: res.headers,
|
|
337
|
+
data,
|
|
338
|
+
duration: `${duration}ms`
|
|
339
|
+
}));
|
|
124
340
|
return _context2.abrupt("return", originalJson(data, options));
|
|
125
341
|
case 1:
|
|
126
342
|
case "end":
|
|
@@ -136,16 +352,22 @@ function setupServerDebugListeners(server) {
|
|
|
136
352
|
// Override sendFile method
|
|
137
353
|
res.sendFile = /*#__PURE__*/function () {
|
|
138
354
|
var _ref3 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3(content, options) {
|
|
355
|
+
var duration;
|
|
139
356
|
return _regenerator.default.wrap(function (_context3) {
|
|
140
357
|
while (1) switch (_context3.prev = _context3.next) {
|
|
141
358
|
case 0:
|
|
142
|
-
|
|
359
|
+
duration = Date.now() - (startTimes.get(req.requestId) || startTime);
|
|
360
|
+
startTimes.delete(req.requestId);
|
|
361
|
+
log('info', _constants.Messages.DEBUG_SERVER_SENDING_FILE, formatMessageData({
|
|
143
362
|
requestId: req.requestId,
|
|
144
363
|
path: req.path,
|
|
145
364
|
status: res.statusCode,
|
|
365
|
+
statusText: (0, _constants.getStatusText)(res.statusCode),
|
|
146
366
|
fileName: options === null || options === void 0 ? void 0 : options.fileName,
|
|
147
|
-
mimeType: options === null || options === void 0 ? void 0 : options.mimeType
|
|
148
|
-
|
|
367
|
+
mimeType: options === null || options === void 0 ? void 0 : options.mimeType,
|
|
368
|
+
contentLength: typeof content === 'string' ? content.length : (content === null || content === void 0 ? void 0 : content.size) || 0,
|
|
369
|
+
duration: `${duration}ms`
|
|
370
|
+
}));
|
|
149
371
|
return _context3.abrupt("return", originalSendFile(content, options));
|
|
150
372
|
case 1:
|
|
151
373
|
case "end":
|
|
@@ -157,6 +379,146 @@ function setupServerDebugListeners(server) {
|
|
|
157
379
|
return _ref3.apply(this, arguments);
|
|
158
380
|
};
|
|
159
381
|
}();
|
|
382
|
+
|
|
383
|
+
// Override sendStream method if exists
|
|
384
|
+
if (originalSendStream) {
|
|
385
|
+
res.sendStream = /*#__PURE__*/function () {
|
|
386
|
+
var _ref4 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4(stream) {
|
|
387
|
+
var duration;
|
|
388
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
389
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
390
|
+
case 0:
|
|
391
|
+
duration = Date.now() - (startTimes.get(req.requestId) || startTime);
|
|
392
|
+
startTimes.delete(req.requestId);
|
|
393
|
+
log('info', _constants.Messages.DEBUG_SERVER_SENDING_STREAM, formatMessageData({
|
|
394
|
+
requestId: req.requestId,
|
|
395
|
+
path: req.path,
|
|
396
|
+
status: res.statusCode,
|
|
397
|
+
statusText: (0, _constants.getStatusText)(res.statusCode),
|
|
398
|
+
streamId: stream === null || stream === void 0 ? void 0 : stream.streamId,
|
|
399
|
+
duration: `${duration}ms`
|
|
400
|
+
}));
|
|
401
|
+
return _context4.abrupt("return", originalSendStream(stream));
|
|
402
|
+
case 1:
|
|
403
|
+
case "end":
|
|
404
|
+
return _context4.stop();
|
|
405
|
+
}
|
|
406
|
+
}, _callee4);
|
|
407
|
+
}));
|
|
408
|
+
return function (_x7) {
|
|
409
|
+
return _ref4.apply(this, arguments);
|
|
410
|
+
};
|
|
411
|
+
}();
|
|
412
|
+
}
|
|
160
413
|
next();
|
|
161
414
|
});
|
|
415
|
+
|
|
416
|
+
// Hook into server's message dispatcher for more detailed logging
|
|
417
|
+
if (serverImpl.messageDispatcher) {
|
|
418
|
+
setupServerMessageDebugging(serverImpl);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* Setup message-level debugging for server
|
|
424
|
+
*/
|
|
425
|
+
function setupServerMessageDebugging(serverImpl) {
|
|
426
|
+
var _dispatcher$sendMessa, _serverImpl$handleReq, _serverImpl$runMiddle;
|
|
427
|
+
var dispatcher = serverImpl.messageDispatcher;
|
|
428
|
+
|
|
429
|
+
// Log when messages are sent
|
|
430
|
+
var originalSendMessage = (_dispatcher$sendMessa = dispatcher.sendMessage) === null || _dispatcher$sendMessa === void 0 ? void 0 : _dispatcher$sendMessa.bind(dispatcher);
|
|
431
|
+
if (originalSendMessage) {
|
|
432
|
+
dispatcher.sendMessage = function (target, targetOrigin, type, requestId, data) {
|
|
433
|
+
if (type === _constants.MessageType.ACK) {
|
|
434
|
+
log('info', _constants.Messages.DEBUG_SERVER_SENDING_ACK, formatMessageData({
|
|
435
|
+
requestId,
|
|
436
|
+
path: data === null || data === void 0 ? void 0 : data.path
|
|
437
|
+
}));
|
|
438
|
+
} else if (type === _constants.MessageType.ASYNC) {
|
|
439
|
+
log('info', _constants.Messages.DEBUG_SERVER_SENDING_ASYNC, formatMessageData({
|
|
440
|
+
requestId,
|
|
441
|
+
path: data === null || data === void 0 ? void 0 : data.path
|
|
442
|
+
}));
|
|
443
|
+
} else if (type === _constants.MessageType.STREAM_START) {
|
|
444
|
+
var streamBody = (data === null || data === void 0 ? void 0 : data.body) || {};
|
|
445
|
+
log('info', _constants.Messages.DEBUG_SERVER_SENDING_STREAM_START, formatMessageData({
|
|
446
|
+
requestId,
|
|
447
|
+
streamId: streamBody.streamId,
|
|
448
|
+
streamType: streamBody.type,
|
|
449
|
+
chunked: streamBody.chunked,
|
|
450
|
+
autoResolve: streamBody.autoResolve,
|
|
451
|
+
metadata: streamBody.metadata
|
|
452
|
+
}));
|
|
453
|
+
} else if (type === _constants.MessageType.STREAM_DATA) {
|
|
454
|
+
var _streamBody3$data;
|
|
455
|
+
var _streamBody3 = (data === null || data === void 0 ? void 0 : data.body) || {};
|
|
456
|
+
log('info', _constants.Messages.DEBUG_SERVER_SENDING_STREAM_DATA, formatMessageData({
|
|
457
|
+
requestId,
|
|
458
|
+
streamId: _streamBody3.streamId,
|
|
459
|
+
done: _streamBody3.done,
|
|
460
|
+
dataLength: ((_streamBody3$data = _streamBody3.data) === null || _streamBody3$data === void 0 ? void 0 : _streamBody3$data.length) || 0
|
|
461
|
+
}));
|
|
462
|
+
} else if (type === _constants.MessageType.STREAM_END) {
|
|
463
|
+
var _streamBody4 = (data === null || data === void 0 ? void 0 : data.body) || {};
|
|
464
|
+
log('info', _constants.Messages.DEBUG_SERVER_SENDING_STREAM_END, formatMessageData({
|
|
465
|
+
requestId,
|
|
466
|
+
streamId: _streamBody4.streamId
|
|
467
|
+
}));
|
|
468
|
+
} else if (type === _constants.MessageType.ERROR) {
|
|
469
|
+
log('error', _constants.Messages.DEBUG_SERVER_SENDING_ERROR, formatMessageData({
|
|
470
|
+
requestId,
|
|
471
|
+
status: data === null || data === void 0 ? void 0 : data.status,
|
|
472
|
+
statusText: data === null || data === void 0 ? void 0 : data.statusText,
|
|
473
|
+
error: data === null || data === void 0 ? void 0 : data.error,
|
|
474
|
+
path: data === null || data === void 0 ? void 0 : data.path
|
|
475
|
+
}));
|
|
476
|
+
} else if (type === _constants.MessageType.RESPONSE) {
|
|
477
|
+
log('info', _constants.Messages.DEBUG_SERVER_SENDING_RESPONSE_VIA_DISPATCHER, formatMessageData({
|
|
478
|
+
requestId,
|
|
479
|
+
status: data === null || data === void 0 ? void 0 : data.status,
|
|
480
|
+
statusText: data === null || data === void 0 ? void 0 : data.statusText,
|
|
481
|
+
requireAck: data === null || data === void 0 ? void 0 : data.requireAck,
|
|
482
|
+
path: data === null || data === void 0 ? void 0 : data.path
|
|
483
|
+
}));
|
|
484
|
+
}
|
|
485
|
+
return originalSendMessage(target, targetOrigin, type, requestId, data);
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
// Log when requests are received (before handler)
|
|
490
|
+
var originalHandleRequest = (_serverImpl$handleReq = serverImpl.handleRequest) === null || _serverImpl$handleReq === void 0 ? void 0 : _serverImpl$handleReq.bind(serverImpl);
|
|
491
|
+
if (originalHandleRequest) {
|
|
492
|
+
serverImpl.handleRequest = function (data, context) {
|
|
493
|
+
log('info', _constants.Messages.DEBUG_SERVER_HANDLING_REQUEST, formatMessageData({
|
|
494
|
+
requestId: data.requestId,
|
|
495
|
+
path: data.path,
|
|
496
|
+
origin: context === null || context === void 0 ? void 0 : context.origin,
|
|
497
|
+
role: data.role,
|
|
498
|
+
creatorId: data.creatorId
|
|
499
|
+
}));
|
|
500
|
+
return originalHandleRequest(data, context);
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
// Log handler execution
|
|
505
|
+
var originalRunMiddlewares = (_serverImpl$runMiddle = serverImpl.runMiddlewares) === null || _serverImpl$runMiddle === void 0 ? void 0 : _serverImpl$runMiddle.bind(serverImpl);
|
|
506
|
+
if (originalRunMiddlewares) {
|
|
507
|
+
serverImpl.runMiddlewares = function (req, res, callback) {
|
|
508
|
+
var handlerStartTime = Date.now();
|
|
509
|
+
log('info', _constants.Messages.DEBUG_SERVER_EXECUTING_MIDDLEWARE_CHAIN, {
|
|
510
|
+
requestId: req.requestId,
|
|
511
|
+
path: req.path
|
|
512
|
+
});
|
|
513
|
+
return originalRunMiddlewares(req, res, () => {
|
|
514
|
+
var handlerDuration = Date.now() - handlerStartTime;
|
|
515
|
+
log('info', _constants.Messages.DEBUG_SERVER_MIDDLEWARE_CHAIN_COMPLETED, {
|
|
516
|
+
requestId: req.requestId,
|
|
517
|
+
path: req.path,
|
|
518
|
+
duration: `${handlerDuration}ms`
|
|
519
|
+
});
|
|
520
|
+
callback();
|
|
521
|
+
});
|
|
522
|
+
};
|
|
523
|
+
}
|
|
162
524
|
}
|
package/library/utils/index.d.ts
CHANGED
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
* Generate unique request ID
|
|
3
3
|
*/
|
|
4
4
|
export declare function generateRequestId(): string;
|
|
5
|
+
/**
|
|
6
|
+
* Generate unique instance ID
|
|
7
|
+
*/
|
|
8
|
+
export declare function generateInstanceId(): string;
|
|
5
9
|
/**
|
|
6
10
|
* Derive targetOrigin from iframe.src
|
|
7
11
|
*/
|
|
8
12
|
export declare function getIframeTargetOrigin(iframe: HTMLIFrameElement): string;
|
|
13
|
+
export declare function isPromise<T>(value: any): value is Promise<T>;
|
|
9
14
|
export { createPostMessage, isValidPostMessage, validatePostMessage, validateProtocolVersion, isRequestIframeMessage, getProtocolVersion, isCompatibleVersion } from './protocol';
|
|
10
15
|
export * from './cache';
|
|
11
16
|
export * from './path-match';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CASvE;AAGD,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAGpB,cAAc,SAAS,CAAC;AAGxB,cAAc,cAAc,CAAC;AAG7B,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CASvE;AAGD,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,CAE5D;AAED,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAGpB,cAAc,SAAS,CAAC;AAGxB,cAAc,cAAc,CAAC;AAG7B,cAAc,UAAU,CAAC"}
|
package/library/utils/index.js
CHANGED
|
@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
var _exportNames = {
|
|
8
8
|
generateRequestId: true,
|
|
9
|
+
generateInstanceId: true,
|
|
9
10
|
getIframeTargetOrigin: true,
|
|
11
|
+
isPromise: true,
|
|
10
12
|
createPostMessage: true,
|
|
11
13
|
isValidPostMessage: true,
|
|
12
14
|
validatePostMessage: true,
|
|
@@ -21,6 +23,7 @@ Object.defineProperty(exports, "createPostMessage", {
|
|
|
21
23
|
return _protocol.createPostMessage;
|
|
22
24
|
}
|
|
23
25
|
});
|
|
26
|
+
exports.generateInstanceId = generateInstanceId;
|
|
24
27
|
exports.generateRequestId = generateRequestId;
|
|
25
28
|
exports.getIframeTargetOrigin = getIframeTargetOrigin;
|
|
26
29
|
Object.defineProperty(exports, "getProtocolVersion", {
|
|
@@ -35,6 +38,7 @@ Object.defineProperty(exports, "isCompatibleVersion", {
|
|
|
35
38
|
return _protocol.isCompatibleVersion;
|
|
36
39
|
}
|
|
37
40
|
});
|
|
41
|
+
exports.isPromise = isPromise;
|
|
38
42
|
Object.defineProperty(exports, "isRequestIframeMessage", {
|
|
39
43
|
enumerable: true,
|
|
40
44
|
get: function get() {
|
|
@@ -109,6 +113,13 @@ function generateRequestId() {
|
|
|
109
113
|
return `req_${Date.now()}_${Math.random().toString(36).substring(2, 11)}`;
|
|
110
114
|
}
|
|
111
115
|
|
|
116
|
+
/**
|
|
117
|
+
* Generate unique instance ID
|
|
118
|
+
*/
|
|
119
|
+
function generateInstanceId() {
|
|
120
|
+
return `inst_${Date.now()}_${Math.random().toString(36).substring(2, 11)}`;
|
|
121
|
+
}
|
|
122
|
+
|
|
112
123
|
/**
|
|
113
124
|
* Derive targetOrigin from iframe.src
|
|
114
125
|
*/
|
|
@@ -122,7 +133,9 @@ function getIframeTargetOrigin(iframe) {
|
|
|
122
133
|
return '*';
|
|
123
134
|
}
|
|
124
135
|
}
|
|
125
|
-
|
|
136
|
+
function isPromise(value) {
|
|
137
|
+
return value !== null && typeof value === 'object' && 'then' in value;
|
|
138
|
+
}
|
|
126
139
|
// Export protocol-related functions
|
|
127
140
|
|
|
128
141
|
// Export cache-related functions
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-match.d.ts","sourceRoot":"","sources":["path-match.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC,CAAC;AAE/F;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CA+CrE"}
|
|
1
|
+
{"version":3,"file":"path-match.d.ts","sourceRoot":"","sources":["../../src/utils/path-match.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC,CAAC;AAE/F;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CA+CrE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAmB,wBAAwB,EAA2B,MAAM,cAAc,CAAC;AAElG;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,wBAAwB,CAuBjF;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,GAAG,GAAG,wBAAwB,GAAG;IAAE,IAAI,CAAC,EAAE,eAAe,CAAA;CAAE,CAiDpG;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAQzD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,EAC7B,SAAS,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,GAAG,MAAM,GAAG,WAAW,GAAG,WAAW,CAAC,CAAC,GAC9F,eAAe,CAQjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,IAAI,eAAe,CAQrE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAKhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE5D"}
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/utils/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAmB,wBAAwB,EAA2B,MAAM,cAAc,CAAC;AAElG;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,wBAAwB,CAuBjF;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,GAAG,GAAG,wBAAwB,GAAG;IAAE,IAAI,CAAC,EAAE,eAAe,CAAA;CAAE,CAiDpG;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAQzD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,EAC7B,SAAS,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,GAAG,MAAM,GAAG,WAAW,GAAG,WAAW,CAAC,CAAC,GAC9F,eAAe,CAQjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,IAAI,eAAe,CAQrE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAKhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE5D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "request-iframe",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Communicate with iframes like sending HTTP requests",
|
|
5
5
|
"main": "library/index.js",
|
|
6
6
|
"types": "library/index.d.ts",
|
|
@@ -26,8 +26,10 @@
|
|
|
26
26
|
"QUICKSTART.CN.md"
|
|
27
27
|
],
|
|
28
28
|
"keywords": [
|
|
29
|
+
"request-iframe",
|
|
29
30
|
"iframe",
|
|
30
31
|
"postMessage",
|
|
32
|
+
"http",
|
|
31
33
|
"request",
|
|
32
34
|
"axios"
|
|
33
35
|
],
|