whistle.pastekitlab 1.9.7 → 1.9.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +6 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -209,6 +209,7 @@ function startWebSocketServer() {
209
209
  ws.on('message', (data) => {
210
210
  try {
211
211
  const msg = JSON.parse(data.toString());
212
+ log(`收到 WebSocket 消息: ${msg.msgType || msg.type}`);
212
213
 
213
214
  if (msg.msgType === 'domain') {
214
215
  domainConfig = msg.domain || [];
@@ -218,6 +219,7 @@ function startWebSocketServer() {
218
219
  if (msg.msgType === 'mockData') {
219
220
  const mockDataList = msg.mockDataList || [];
220
221
  log(`收到 Mock 数据: ${mockDataList.length} 条`);
222
+ log(`Mock 数据详情: ${JSON.stringify(mockDataList.map(m => ({ruleId: m.ruleId, url: m.urlPattern})))}`);
221
223
 
222
224
  // 清空旧缓存
223
225
  mockRulesCache.clear();
@@ -234,11 +236,14 @@ function startWebSocketServer() {
234
236
  data: mockItem.data,
235
237
  isEncrypted: mockItem.isEncrypted
236
238
  });
239
+ log(`缓存 Mock 规则: ${key}`);
237
240
  });
238
241
 
239
242
  log(`Mock 数据缓存完成,共 ${mockRulesCache.size} 条`);
240
243
  }
241
- } catch {
244
+ } catch (error) {
245
+ log(`处理 WebSocket 消息失败: ${error.message}`);
246
+ log(`原始数据: ${data.toString().substring(0, 500)}`);
242
247
  }
243
248
  });
244
249
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whistle.pastekitlab",
3
- "version": "1.9.7",
3
+ "version": "1.9.8",
4
4
  "description": "Whistle plugin for PasteKit Lab - Intercepts requests and sends them to requestlistviewer via WebSocket",
5
5
  "main": "index.js",
6
6
  "scripts": {