hunter-mate 0.1.3 → 0.1.4

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 (101) hide show
  1. package/LICENSE +21 -0
  2. package/dist/assets/extension/background/service-worker.js +113 -24
  3. package/dist/assets/extension/content/index.js +239 -134
  4. package/dist/assets/extension/manifest.json +2 -4
  5. package/dist/assets/extension/sidepanel/index.js +76 -2
  6. package/dist/assets/server/app.module.js +4 -2
  7. package/dist/assets/server/app.module.js.map +1 -1
  8. package/dist/assets/server/build-info.json +1 -1
  9. package/dist/assets/server/db/sqlite.module.js +4 -0
  10. package/dist/assets/server/db/sqlite.module.js.map +1 -1
  11. package/dist/assets/server/devops/devops-sink-init.d.ts +14 -1
  12. package/dist/assets/server/devops/devops-sink-init.js +8 -3
  13. package/dist/assets/server/devops/devops-sink-init.js.map +1 -1
  14. package/dist/assets/server/doctor/doctor.controller.d.ts +13 -0
  15. package/dist/assets/server/doctor/doctor.controller.js +62 -0
  16. package/dist/assets/server/doctor/doctor.controller.js.map +1 -0
  17. package/dist/assets/server/doctor/doctor.module.d.ts +2 -0
  18. package/dist/assets/server/doctor/doctor.module.js +27 -0
  19. package/dist/assets/server/doctor/doctor.module.js.map +1 -0
  20. package/dist/assets/server/doctor/doctor.service.d.ts +15 -0
  21. package/dist/assets/server/doctor/doctor.service.js +209 -0
  22. package/dist/assets/server/doctor/doctor.service.js.map +1 -0
  23. package/dist/assets/server/doctor/doctor.types.d.ts +46 -0
  24. package/dist/assets/server/doctor/doctor.types.js +3 -0
  25. package/dist/assets/server/doctor/doctor.types.js.map +1 -0
  26. package/dist/assets/server/extraction/adapter.service.d.ts +18 -4
  27. package/dist/assets/server/extraction/adapter.service.js +129 -15
  28. package/dist/assets/server/extraction/adapter.service.js.map +1 -1
  29. package/dist/assets/server/extraction/anomaly-report.service.d.ts +12 -0
  30. package/dist/assets/server/extraction/anomaly-report.service.js +81 -0
  31. package/dist/assets/server/extraction/anomaly-report.service.js.map +1 -0
  32. package/dist/assets/server/extraction/entities/adapter-rule.entity.d.ts +13 -0
  33. package/dist/assets/server/extraction/entities/adapter-rule.entity.js +71 -0
  34. package/dist/assets/server/extraction/entities/adapter-rule.entity.js.map +1 -0
  35. package/dist/assets/server/extraction/entities/parse-log.entity.d.ts +4 -1
  36. package/dist/assets/server/extraction/entities/parse-log.entity.js +15 -0
  37. package/dist/assets/server/extraction/entities/parse-log.entity.js.map +1 -1
  38. package/dist/assets/server/extraction/extraction-entity.controller.d.ts +40 -2
  39. package/dist/assets/server/extraction/extraction-entity.controller.js +196 -13
  40. package/dist/assets/server/extraction/extraction-entity.controller.js.map +1 -1
  41. package/dist/assets/server/extraction/extraction-rule.service.js +16 -8
  42. package/dist/assets/server/extraction/extraction-rule.service.js.map +1 -1
  43. package/dist/assets/server/extraction/extraction.module.js +12 -2
  44. package/dist/assets/server/extraction/extraction.module.js.map +1 -1
  45. package/dist/assets/server/extraction/extraction.service.d.ts +17 -1
  46. package/dist/assets/server/extraction/extraction.service.js +125 -42
  47. package/dist/assets/server/extraction/extraction.service.js.map +1 -1
  48. package/dist/assets/server/extraction/linkedin-extractor.d.ts +1 -0
  49. package/dist/assets/server/extraction/linkedin-extractor.js +244 -0
  50. package/dist/assets/server/extraction/linkedin-extractor.js.map +1 -0
  51. package/dist/assets/server/extraction/rrweb-snapshot.utils.d.ts +15 -0
  52. package/dist/assets/server/extraction/rrweb-snapshot.utils.js +48 -0
  53. package/dist/assets/server/extraction/rrweb-snapshot.utils.js.map +1 -0
  54. package/dist/assets/server/extraction/rrweb-snapshot.utils.spec.d.ts +1 -0
  55. package/dist/assets/server/extraction/rrweb-snapshot.utils.spec.js +60 -0
  56. package/dist/assets/server/extraction/rrweb-snapshot.utils.spec.js.map +1 -0
  57. package/dist/assets/server/extraction/script-rule.d.ts +1 -0
  58. package/dist/assets/server/extraction/script-rule.js +4 -0
  59. package/dist/assets/server/extraction/script-rule.js.map +1 -1
  60. package/dist/assets/server/extraction/snapshot-analysis.service.d.ts +23 -0
  61. package/dist/assets/server/extraction/snapshot-analysis.service.js +147 -0
  62. package/dist/assets/server/extraction/snapshot-analysis.service.js.map +1 -0
  63. package/dist/assets/server/recording/entities/recording-snapshot.entity.d.ts +16 -0
  64. package/dist/assets/server/recording/entities/recording-snapshot.entity.js +91 -0
  65. package/dist/assets/server/recording/entities/recording-snapshot.entity.js.map +1 -0
  66. package/dist/assets/server/recording/recording-event-bus.service.d.ts +4 -0
  67. package/dist/assets/server/recording/recording-event-bus.service.js +25 -0
  68. package/dist/assets/server/recording/recording-event-bus.service.js.map +1 -0
  69. package/dist/assets/server/recording/recording-snapshot.service.d.ts +13 -0
  70. package/dist/assets/server/recording/recording-snapshot.service.js +81 -0
  71. package/dist/assets/server/recording/recording-snapshot.service.js.map +1 -0
  72. package/dist/assets/server/recording/recording-snapshot.service.spec.d.ts +1 -0
  73. package/dist/assets/server/recording/recording-snapshot.service.spec.js +65 -0
  74. package/dist/assets/server/recording/recording-snapshot.service.spec.js.map +1 -0
  75. package/dist/assets/server/recording/recording.controller.d.ts +3 -1
  76. package/dist/assets/server/recording/recording.controller.js +7 -3
  77. package/dist/assets/server/recording/recording.controller.js.map +1 -1
  78. package/dist/assets/server/recording/recording.module.js +11 -4
  79. package/dist/assets/server/recording/recording.module.js.map +1 -1
  80. package/dist/assets/server/recording/recording.service.d.ts +5 -21
  81. package/dist/assets/server/recording/recording.service.js +22 -9
  82. package/dist/assets/server/recording/recording.service.js.map +1 -1
  83. package/dist/assets/server/site/entities/site-registry.entity.d.ts +2 -0
  84. package/dist/assets/server/site/entities/site-registry.entity.js +10 -0
  85. package/dist/assets/server/site/entities/site-registry.entity.js.map +1 -1
  86. package/dist/assets/server/site/site.controller.d.ts +2 -0
  87. package/dist/assets/server/site/site.controller.js +1 -1
  88. package/dist/assets/server/site/site.controller.js.map +1 -1
  89. package/dist/assets/server/site/site.service.d.ts +2 -1
  90. package/dist/assets/server/site/site.service.js +10 -3
  91. package/dist/assets/server/site/site.service.js.map +1 -1
  92. package/dist/auto-doctor.d.ts +8 -0
  93. package/dist/auto-doctor.js +34 -0
  94. package/dist/commands/doctor.d.ts +38 -0
  95. package/dist/commands/doctor.js +162 -7
  96. package/dist/commands/extension.js +2 -2
  97. package/dist/commands/extras.d.ts +1 -1
  98. package/dist/commands/extras.js +4 -3
  99. package/dist/commands/install.js +11 -8
  100. package/dist/index.js +7 -0
  101. package/package.json +3 -3
@@ -173,6 +173,8 @@
173
173
 
174
174
  // src/sidepanel/index.ts
175
175
  var state = {
176
+ tabId: -1,
177
+ url: "",
176
178
  serverConnected: false,
177
179
  wsConnected: false,
178
180
  recordingSessionId: null,
@@ -280,6 +282,40 @@
280
282
  }
281
283
  adjustStatusPolling();
282
284
  }
285
+ async function loadCurrentUrlEntity() {
286
+ if (!currentUrl || isInternalUrl(currentUrl) || !state.serverConnected) return;
287
+ try {
288
+ const data = await withRetry(
289
+ () => api(`/entities/by-url?url=${encodeURIComponent(currentUrl)}`),
290
+ { label: "loadCurrentUrlEntity", maxAttempts: 2 }
291
+ );
292
+ if (data.found && data.entity && data.type) {
293
+ currentEntity = {
294
+ id: data.entity.id,
295
+ type: data.type,
296
+ isNew: false,
297
+ tags: data.entity.tags || []
298
+ };
299
+ lastParse = {
300
+ status: data.latestParse?.status || "ok",
301
+ sessionId: data.latestParse?.sessionId,
302
+ sourceUrl: data.entity.sourceUrl,
303
+ entity: { id: data.entity.id, type: data.type, isNew: false },
304
+ extracted: data.entity.extracted || {}
305
+ };
306
+ parseStatus = "parsed";
307
+ parseError = "";
308
+ const e = data.entity.extracted || {};
309
+ const fields = Object.entries(e).filter(([k, v]) => v != null && String(v).trim()).slice(0, 8).map(([k, v]) => `<b>${escapeHtml(k)}</b>: ${escapeHtml(String(v).slice(0, 120))}`).join("<br>");
310
+ els.parseResult.innerHTML = `\u5F53\u524D\u9875\u9762\u5DF2\u89E3\u6790: <b>${CLS_LABEL[data.type] || data.type} #${data.entity.id}</b><br>${fields || "(\u6682\u65E0\u5B57\u6BB5)"}`;
311
+ els.parseResult.className = "info";
312
+ renderEntities(currentType);
313
+ render();
314
+ }
315
+ } catch (err) {
316
+ sidepanelLogger.warn("sidepanel:loadCurrentUrlEntity:failed", { error: err.message });
317
+ }
318
+ }
283
319
  async function loadCurrentTabInfo() {
284
320
  try {
285
321
  const tabs = await new Promise((resolve) => {
@@ -295,6 +331,7 @@
295
331
  currentUrl = tab.url || tab.pendingUrl || "";
296
332
  currentTitle = tab.title || "";
297
333
  updateTabInfoUI();
334
+ await loadCurrentUrlEntity();
298
335
  } catch {
299
336
  resetTabInfo();
300
337
  }
@@ -442,8 +479,23 @@ ${currentUrl}` : currentUrl;
442
479
  if (e.key === "Enter") handleJump();
443
480
  });
444
481
  els.jumpBtn.addEventListener("click", handleJump);
482
+ function isInternalUrl(url) {
483
+ if (!url) return true;
484
+ return url.startsWith("chrome://") || url.startsWith("chrome-extension://") || url.startsWith("about:") || url.startsWith("file://") || url.startsWith("edge://");
485
+ }
445
486
  function render() {
446
487
  renderStatusDots();
488
+ if (isInternalUrl(state.url)) {
489
+ els.recordingIndicator.style.display = "none";
490
+ els.clsBadge.textContent = "\u672A\u8BC6\u522B";
491
+ els.clsBadge.className = "badge b-unknown";
492
+ els.clsDetail.textContent = "\u5F53\u524D\u9875\u4E0D\u5728\u5F55\u5236\u8303\u56F4\u5185(\u5185\u90E8\u9875\u9762)\u3002";
493
+ els.parseBtn.disabled = true;
494
+ els.copyBtn.disabled = !lastParse;
495
+ renderParseStatus();
496
+ renderEntityTags();
497
+ return;
498
+ }
447
499
  if (state.recordingSessionId) {
448
500
  els.recordingIndicator.style.display = "";
449
501
  els.recordingText.textContent = `\u91C7\u96C6\u4E2D \xB7 ${state.eventCount}\u4E8B\u4EF6`;
@@ -451,10 +503,14 @@ ${currentUrl}` : currentUrl;
451
503
  els.recordingIndicator.style.display = "none";
452
504
  }
453
505
  const cls = state.classification;
454
- if (!cls) {
506
+ if (currentEntity && !cls) {
507
+ els.clsBadge.textContent = `${CLS_LABEL[currentEntity.type] || currentEntity.type} \xB7 \u5DF2\u89E3\u6790`;
508
+ els.clsBadge.className = `badge b-${currentEntity.type}`;
509
+ els.clsDetail.textContent = `\u5F53\u524D\u9875\u9762\u5DF2\u5165\u5E93 #${currentEntity.id}\u3002`;
510
+ } else if (!cls) {
455
511
  els.clsBadge.textContent = "\u672A\u8BC6\u522B";
456
512
  els.clsBadge.className = "badge b-unknown";
457
- els.clsDetail.textContent = "\u5F53\u524D\u9875\u65E0\u5206\u7C7B(\u672A\u6CE8\u5165\u62DB\u8058\u57DF)\u3002";
513
+ els.clsDetail.textContent = "\u5F53\u524D\u9875\u65E0\u5206\u7C7B(\u672A\u547D\u4E2D\u62DB\u8058\u57DF\u6216\u672A\u8FD4\u56DE\u5206\u7C7B)\u3002";
458
514
  } else if (cls.abortSignal) {
459
515
  els.clsBadge.textContent = "\u5DF2\u4E2D\u6B62";
460
516
  els.clsBadge.className = "badge b-abort";
@@ -782,8 +838,17 @@ ${currentUrl}` : currentUrl;
782
838
  async function requestStatus() {
783
839
  try {
784
840
  const res = await chrome.runtime.sendMessage({ type: "get-status" });
841
+ const prevUrl = state.url;
785
842
  Object.assign(state, res);
786
843
  state.statusKnown = true;
844
+ if (state.url !== prevUrl && state.url) {
845
+ autoParsedSessionIds.clear();
846
+ parseStatus = "idle";
847
+ parseError = "";
848
+ currentEntity = null;
849
+ lastParse = null;
850
+ loadCurrentUrlEntity();
851
+ }
787
852
  onServerStateChanged();
788
853
  render();
789
854
  maybeAutoParse();
@@ -807,7 +872,15 @@ ${currentUrl}` : currentUrl;
807
872
  }
808
873
  chrome.runtime.onMessage.addListener((message) => {
809
874
  if (message.type === "status" && message.payload) {
875
+ const prevUrl = state.url;
810
876
  Object.assign(state, message.payload);
877
+ if (state.url !== prevUrl && state.url) {
878
+ autoParsedSessionIds.clear();
879
+ parseStatus = "idle";
880
+ parseError = "";
881
+ currentEntity = null;
882
+ lastParse = null;
883
+ }
811
884
  onServerStateChanged();
812
885
  render();
813
886
  maybeAutoParse();
@@ -825,6 +898,7 @@ ${currentUrl}` : currentUrl;
825
898
  if (document.visibilityState === "visible") {
826
899
  requestStatus();
827
900
  loadCurrentTabInfo();
901
+ loadCurrentUrlEntity();
828
902
  loadPendingSites();
829
903
  renderEntities(currentType);
830
904
  }
@@ -11,7 +11,7 @@ const common_1 = require("@nestjs/common");
11
11
  const config_1 = require("@nestjs/config");
12
12
  const serve_static_1 = require("@nestjs/serve-static");
13
13
  const path_1 = require("path");
14
- const nestjs_1 = require("@chromepilot/logger-kit/dist/nestjs");
14
+ const nestjs_1 = require("@chromepilot/logger-kit/nestjs");
15
15
  const sqlite_module_1 = require("./db/sqlite.module");
16
16
  const common_module_1 = require("./common/common.module");
17
17
  const hcapi_module_1 = require("./hcapi/hcapi.module");
@@ -40,12 +40,13 @@ const llm_module_1 = require("./llm/llm.module");
40
40
  const devops_sink_module_1 = require("./devops/devops-sink.module");
41
41
  const site_module_1 = require("./site/site.module");
42
42
  const telemetry_module_1 = require("./telemetry/telemetry.module");
43
+ const doctor_module_1 = require("./doctor/doctor.module");
43
44
  const WEB_DIST = (0, path_1.join)(__dirname, '..', '..', 'web', 'dist');
44
45
  let AppModule = class AppModule {
45
46
  configure(consumer) {
46
47
  consumer
47
48
  .apply(auth_middleware_1.AuthMiddleware)
48
- .exclude({ path: '/', method: common_1.RequestMethod.GET }, { path: 'entity', method: common_1.RequestMethod.GET }, { path: 'talents', method: common_1.RequestMethod.GET }, { path: 'jobs', method: common_1.RequestMethod.GET }, { path: 'companies', method: common_1.RequestMethod.GET }, { path: 'parselog', method: common_1.RequestMethod.GET }, { path: 'recordings', method: common_1.RequestMethod.GET }, { path: '_next/(.*)', method: common_1.RequestMethod.ALL }, { path: 'health', method: common_1.RequestMethod.GET }, { path: 'health/db', method: common_1.RequestMethod.GET }, { path: 'auth/device-code', method: common_1.RequestMethod.ALL }, { path: 'auth/login', method: common_1.RequestMethod.ALL }, { path: 'auth/approve', method: common_1.RequestMethod.ALL }, { path: 'auth/token', method: common_1.RequestMethod.ALL }, { path: 'auth/verify-info', method: common_1.RequestMethod.ALL }, { path: 'auth/verify', method: common_1.RequestMethod.GET }, { path: 'system/(.*)', method: common_1.RequestMethod.ALL }, { path: 'extension/version', method: common_1.RequestMethod.GET }, { path: 'extensions', method: common_1.RequestMethod.ALL }, { path: 'extensions/(.*)', method: common_1.RequestMethod.ALL }, { path: 'sites', method: common_1.RequestMethod.ALL }, { path: 'sites/(.*)', method: common_1.RequestMethod.ALL }, { path: 'entities', method: common_1.RequestMethod.ALL }, { path: 'entities/(.*)', method: common_1.RequestMethod.ALL }, { path: 'parse-log', method: common_1.RequestMethod.ALL }, { path: 'parse-log/(.*)', method: common_1.RequestMethod.ALL }, { path: 'parse/(.*)', method: common_1.RequestMethod.ALL }, { path: 'extract/(.*)', method: common_1.RequestMethod.ALL }, { path: 'adapters', method: common_1.RequestMethod.ALL }, { path: 'adapters/(.*)', method: common_1.RequestMethod.ALL }, { path: 'recordings', method: common_1.RequestMethod.ALL }, { path: 'recordings/(.*)', method: common_1.RequestMethod.ALL }, { path: 'logs', method: common_1.RequestMethod.ALL }, { path: 'logs/(.*)', method: common_1.RequestMethod.ALL })
49
+ .exclude({ path: '/', method: common_1.RequestMethod.GET }, { path: 'entity', method: common_1.RequestMethod.GET }, { path: 'talents', method: common_1.RequestMethod.GET }, { path: 'jobs', method: common_1.RequestMethod.GET }, { path: 'companies', method: common_1.RequestMethod.GET }, { path: 'parselog', method: common_1.RequestMethod.GET }, { path: 'recordings', method: common_1.RequestMethod.GET }, { path: '_next/(.*)', method: common_1.RequestMethod.ALL }, { path: 'health', method: common_1.RequestMethod.GET }, { path: 'health/db', method: common_1.RequestMethod.GET }, { path: 'auth/device-code', method: common_1.RequestMethod.ALL }, { path: 'auth/login', method: common_1.RequestMethod.ALL }, { path: 'auth/approve', method: common_1.RequestMethod.ALL }, { path: 'auth/token', method: common_1.RequestMethod.ALL }, { path: 'auth/verify-info', method: common_1.RequestMethod.ALL }, { path: 'auth/verify', method: common_1.RequestMethod.GET }, { path: 'system/(.*)', method: common_1.RequestMethod.ALL }, { path: 'extension/version', method: common_1.RequestMethod.GET }, { path: 'extensions', method: common_1.RequestMethod.ALL }, { path: 'extensions/(.*)', method: common_1.RequestMethod.ALL }, { path: 'sites', method: common_1.RequestMethod.ALL }, { path: 'sites/(.*)', method: common_1.RequestMethod.ALL }, { path: 'entities', method: common_1.RequestMethod.ALL }, { path: 'entities/(.*)', method: common_1.RequestMethod.ALL }, { path: 'parse-log', method: common_1.RequestMethod.ALL }, { path: 'parse-log/(.*)', method: common_1.RequestMethod.ALL }, { path: 'parse/(.*)', method: common_1.RequestMethod.ALL }, { path: 'extract/(.*)', method: common_1.RequestMethod.ALL }, { path: 'adapters', method: common_1.RequestMethod.ALL }, { path: 'adapters/(.*)', method: common_1.RequestMethod.ALL }, { path: 'recordings', method: common_1.RequestMethod.ALL }, { path: 'recordings/(.*)', method: common_1.RequestMethod.ALL }, { path: 'logs', method: common_1.RequestMethod.ALL }, { path: 'logs/(.*)', method: common_1.RequestMethod.ALL }, { path: 'doctor', method: common_1.RequestMethod.ALL }, { path: 'doctor/(.*)', method: common_1.RequestMethod.ALL })
49
50
  .forRoutes('*');
50
51
  }
51
52
  };
@@ -118,6 +119,7 @@ exports.AppModule = AppModule = __decorate([
118
119
  site_module_1.SiteModule,
119
120
  telemetry_module_1.TelemetryModule,
120
121
  devops_sink_module_1.DevopsSinkModule,
122
+ doctor_module_1.DoctorModule,
121
123
  ],
122
124
  controllers: [health_controller_1.HealthController],
123
125
  })
@@ -1 +1 @@
1
- {"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA2E;AAC3E,2CAA8C;AAC9C,uDAAyD;AACzD,+BAA4B;AAC5B,gEAAsE;AACtE,sDAAkD;AAClD,0DAAsD;AACtD,uDAAmD;AACnD,uDAAmD;AACnD,6DAAyD;AACz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eAAe;oBACf,WAAW;oBACX,gBAAgB;oBAChB,iBAAiB;oBACjB,sBAAsB;oBACtB,cAAc;oBACd,aAAa;oBACb,iBAAiB;oBACjB,6BAA6B;oBAC7B,eAAe;oBACf,KAAK;iBACN;aACF,CAAC;YACF,4BAAY;YACZ,wBAAe,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;YAC7C,4BAAY;YACZ,0BAAW;YACX,0BAAW;YACX,8BAAa;YACb,oCAAgB;YAChB,4BAAY;YACZ,0CAAmB;YACnB,0BAAW;YACX,4BAAY;YACZ,kCAAe;YACf,kCAAe;YACf,wBAAU;YACV,4BAAY;YACZ,gCAAc;YACd,yCAAkB;YAClB,6CAAoB;YACpB,mDAAuB;YACvB,8CAAoB;YACpB,4BAAY;YACZ,gCAAc;YACd,8BAAa;YACb,sBAAS;YACT,wBAAU;YACV,kCAAe;YACf,qCAAgB;SACjB;QACD,WAAW,EAAE,CAAC,oCAAgB,CAAC;KAChC,CAAC;GACW,SAAS,CAqDrB"}
1
+ {"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA2E;AAC3E,2CAA8C;AAC9C,uDAAyD;AACzD,+BAA4B;AAC5B,2DAAiE;AACjE,sDAAkD;AAClD,0DAAsD;AACtD,uDAAmD;AACnD,uDAAmD;AACnD,6DAAyD;AACzD,sEAAkE;AAClE,0DAAsD;AACtD,+EAA2E;AAC3E,4DAAwD;AACxD,oDAAgD;AAChD,kEAA8D;AAC9D,uDAAmD;AACnD,0DAAsD;AACtD,mEAA+D;AAC/D,mEAA+D;AAC/D,0DAAsD;AACtD,gEAA4D;AAC5D,+EAA0E;AAC1E,qFAAgF;AAChF,8FAAyF;AACzF,wFAAkF;AAClF,0DAAsD;AACtD,gEAA4D;AAC5D,6DAAyD;AACzD,iDAA6C;AAC7C,oEAA+D;AAC/D,oDAAgD;AAChD,mEAA+D;AAC/D,0DAAsD;AAEtD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OAAO,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;YAC7C,4BAAY;YACZ,0BAAW;YACX,0BAAW;YACX,8BAAa;YACb,oCAAgB;YAChB,4BAAY;YACZ,0CAAmB;YACnB,0BAAW;YACX,4BAAY;YACZ,kCAAe;YACf,kCAAe;YACf,wBAAU;YACV,4BAAY;YACZ,gCAAc;YACd,yCAAkB;YAClB,6CAAoB;YACpB,mDAAuB;YACvB,8CAAoB;YACpB,4BAAY;YACZ,gCAAc;YACd,8BAAa;YACb,sBAAS;YACT,wBAAU;YACV,kCAAe;YACf,qCAAgB;YAChB,4BAAY;SACb;QACD,WAAW,EAAE,CAAC,oCAAgB,CAAC;KAChC,CAAC;GACW,SAAS,CAwDrB"}
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "version": "0.1.0",
3
- "buildTime": "2026-08-30T16:25:32.165Z"
3
+ "buildTime": "2026-08-31T15:36:34.666Z"
4
4
  }
@@ -28,6 +28,8 @@ const parse_log_entity_1 = require("../extraction/entities/parse-log.entity");
28
28
  const talent_profile_entity_1 = require("../extraction/entities/talent-profile.entity");
29
29
  const job_posting_entity_1 = require("../extraction/entities/job-posting.entity");
30
30
  const company_profile_entity_1 = require("../extraction/entities/company-profile.entity");
31
+ const recording_snapshot_entity_1 = require("../recording/entities/recording-snapshot.entity");
32
+ const adapter_rule_entity_1 = require("../extraction/entities/adapter-rule.entity");
31
33
  const schema_version_entity_1 = require("./schema-version.entity");
32
34
  const schema_validator_service_1 = require("./schema-validator.service");
33
35
  const HOME = () => process.env.HUNTER_MATE_HOME || process.env.HOME || process.env.USERPROFILE || '.';
@@ -65,6 +67,8 @@ exports.SqliteModule = SqliteModule = __decorate([
65
67
  talent_profile_entity_1.TalentProfile,
66
68
  job_posting_entity_1.JobPosting,
67
69
  company_profile_entity_1.CompanyProfile,
70
+ recording_snapshot_entity_1.RecordingSnapshot,
71
+ adapter_rule_entity_1.AdapterRule,
68
72
  schema_version_entity_1.SchemaVersion,
69
73
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,YAAY;IA3CxB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,YAAY,CAAC;gBACzB,OAAO,EAAE,CAAC,qBAAY,CAAC;gBACvB,MAAM,EAAE,CAAC,sBAAa,CAAC;gBACvB,UAAU,EAAE,CAAC,MAAqB,EAAE,EAAE;oBACpC,MAAM,MAAM,GACV,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC;wBACzB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,cAAc,EAAE,gBAAgB,CAAC,CAAC;oBACtD,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;oBACxD,OAAO;wBACL,IAAI,EAAE,gBAAyB;wBAC/B,QAAQ,EAAE,MAAM;wBAChB,WAAW,EAAE,MAAM,CAAC,GAAG,CAAC,oBAAoB,EAAE,MAAM,CAAC,KAAK,OAAO;wBACjE,QAAQ,EAAE;4BACR,uCAAc;4BACd,wBAAO;4BACP,uCAAc;4BACd,iDAAmB;4BACnB,iCAAW;4BACX,mCAAY;4BACZ,uCAAc;4BACd,6CAAiB;4BACjB,wCAAc;4BACd,sBAAM;4BACN,4CAAgB;4BAChB,mCAAY;4BACZ,2BAAQ;4BACR,qCAAa;4BACb,+BAAU;4BACV,uCAAc;4BACd,6CAAiB;4BACjB,iCAAW;4BACX,qCAAa;yBACd;qBACF,CAAC;gBACJ,CAAC;aACF,CAAC;YACF,uBAAa,CAAC,UAAU,CAAC,CAAC,qCAAa,CAAC,CAAC;SAC1C;QACD,SAAS,EAAE,CAAC,iDAAsB,CAAC;QACnC,OAAO,EAAE,CAAC,iDAAsB,CAAC;KAClC,CAAC;GACW,YAAY,CAAG"}
@@ -1,5 +1,18 @@
1
1
  import { OnModuleInit } from '@nestjs/common';
2
- import { type UsageSink, type LogSink } from '@chromepilot/logger-kit';
2
+ export interface UsageSink {
3
+ capture(payload: {
4
+ feature: string;
5
+ event: string;
6
+ context?: Record<string, unknown>;
7
+ }): void;
8
+ }
9
+ export interface LogSink {
10
+ log(entry: {
11
+ level: string;
12
+ message: string;
13
+ context?: Record<string, unknown>;
14
+ }): void;
15
+ }
3
16
  export declare class DevopsSinkInit implements OnModuleInit {
4
17
  private readonly logger;
5
18
  usage: UsageSink | null;
@@ -12,7 +12,12 @@ const common_1 = require("@nestjs/common");
12
12
  const fs_1 = require("fs");
13
13
  const os_1 = require("os");
14
14
  const path_1 = require("path");
15
- const logger_kit_1 = require("@chromepilot/logger-kit");
15
+ function createUsageSink(_opts) {
16
+ return { capture: () => { } };
17
+ }
18
+ function createLogSink(_opts) {
19
+ return { log: () => { } };
20
+ }
16
21
  const INSTALL_FILE = (0, path_1.join)((0, os_1.homedir)(), '.config', 'dev-ops', 'hunter-mate.json');
17
22
  let DevopsSinkInit = DevopsSinkInit_1 = class DevopsSinkInit {
18
23
  logger = new common_1.Logger(DevopsSinkInit_1.name);
@@ -32,13 +37,13 @@ let DevopsSinkInit = DevopsSinkInit_1 = class DevopsSinkInit {
32
37
  this.installId = await this.loadOrRegister(endpoint, apiKey);
33
38
  if (!this.installId)
34
39
  return;
35
- this.usage = (0, logger_kit_1.createUsageSink)({
40
+ this.usage = createUsageSink({
36
41
  endpoint,
37
42
  product: 'hunter-mate',
38
43
  apiKey,
39
44
  installId: this.installId,
40
45
  });
41
- this.log = (0, logger_kit_1.createLogSink)({
46
+ this.log = createLogSink({
42
47
  endpoint,
43
48
  product: 'hunter-mate',
44
49
  apiKey,
@@ -1 +1 @@
1
- {"version":3,"file":"devops-sink-init.js","sourceRoot":"","sources":["../../src/devops/devops-sink-init.ts"],"names":[],"mappings":";;;;;;;;;;AAaA,2CAAkE;AAClE,2BAAoC;AACpC,2BAAiD;AACjD,+BAA4B;AAC5B,wDAAuG;AAEvG,MAAM,YAAY,GAAG,IAAA,WAAI,EAAC,IAAA,YAAO,GAAE,EAAE,SAAS,EAAE,SAAS,EAAE,kB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OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;CACF,CAAA;AApFY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;GACA,cAAc,CAoF1B"}
@@ -0,0 +1,13 @@
1
+ import { DoctorService } from './doctor.service';
2
+ import type { DoctorRunOptions, DoctorRunResult } from './doctor.types';
3
+ export declare class DoctorController {
4
+ private readonly doctorService;
5
+ constructor(doctorService: DoctorService);
6
+ list(): {
7
+ checks: Pick<import("./doctor.types").DoctorCheckHandler, "id" | "name" | "description" | "severity" | "fixable">[];
8
+ };
9
+ run(body: DoctorRunOptions): Promise<DoctorRunResult>;
10
+ repairLinkedInDupes(body: {
11
+ dryRun?: boolean;
12
+ }): Promise<DoctorRunResult>;
13
+ }
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.DoctorController = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const doctor_service_1 = require("./doctor.service");
18
+ let DoctorController = class DoctorController {
19
+ doctorService;
20
+ constructor(doctorService) {
21
+ this.doctorService = doctorService;
22
+ }
23
+ list() {
24
+ return { checks: this.doctorService.list() };
25
+ }
26
+ run(body) {
27
+ return this.doctorService.run(body);
28
+ }
29
+ repairLinkedInDupes(body) {
30
+ return this.doctorService.run({
31
+ checks: ['linkedin-dupes'],
32
+ mode: 'repair',
33
+ dryRun: body?.dryRun,
34
+ });
35
+ }
36
+ };
37
+ exports.DoctorController = DoctorController;
38
+ __decorate([
39
+ (0, common_1.Get)('checks'),
40
+ __metadata("design:type", Function),
41
+ __metadata("design:paramtypes", []),
42
+ __metadata("design:returntype", void 0)
43
+ ], DoctorController.prototype, "list", null);
44
+ __decorate([
45
+ (0, common_1.Post)('run'),
46
+ __param(0, (0, common_1.Body)()),
47
+ __metadata("design:type", Function),
48
+ __metadata("design:paramtypes", [Object]),
49
+ __metadata("design:returntype", Promise)
50
+ ], DoctorController.prototype, "run", null);
51
+ __decorate([
52
+ (0, common_1.Post)('repair-linkedin-dupes'),
53
+ __param(0, (0, common_1.Body)()),
54
+ __metadata("design:type", Function),
55
+ __metadata("design:paramtypes", [Object]),
56
+ __metadata("design:returntype", Promise)
57
+ ], DoctorController.prototype, "repairLinkedInDupes", null);
58
+ exports.DoctorController = DoctorController = __decorate([
59
+ (0, common_1.Controller)('doctor'),
60
+ __metadata("design:paramtypes", [doctor_service_1.DoctorService])
61
+ ], DoctorController);
62
+ //# sourceMappingURL=doctor.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.controller.js","sourceRoot":"","sources":["../../src/doctor/doctor.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA6D;AAC7D,qDAAiD;AAI1C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IACE;IAA7B,YAA6B,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAI7D,IAAI;QACF,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC;IAC/C,CAAC;IAID,GAAG,CAAS,IAAsB;QAChC,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAOD,mBAAmB,CAAS,IAA0B;QACpD,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC;YAC5B,MAAM,EAAE,CAAC,gBAAkC,CAAC;YAC5C,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,IAAI,EAAE,MAAM;SACrB,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AA3BY,4CAAgB;AAK3B;IADC,IAAA,YAAG,EAAC,QAAQ,CAAC;;;;4CAGb;AAID;IADC,IAAA,aAAI,EAAC,KAAK,CAAC;IACP,WAAA,IAAA,aAAI,GAAE,CAAA;;;;2CAEV;AAOD;IADC,IAAA,aAAI,EAAC,uBAAuB,CAAC;IACT,WAAA,IAAA,aAAI,GAAE,CAAA;;;;2DAM1B;2BA1BU,gBAAgB;IAD5B,IAAA,mBAAU,EAAC,QAAQ,CAAC;qCAEyB,8BAAa;GAD9C,gBAAgB,CA2B5B"}
@@ -0,0 +1,2 @@
1
+ export declare class DoctorModule {
2
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.DoctorModule = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const typeorm_1 = require("@nestjs/typeorm");
12
+ const doctor_service_1 = require("./doctor.service");
13
+ const doctor_controller_1 = require("./doctor.controller");
14
+ const talent_profile_entity_1 = require("../extraction/entities/talent-profile.entity");
15
+ const parse_log_entity_1 = require("../extraction/entities/parse-log.entity");
16
+ let DoctorModule = class DoctorModule {
17
+ };
18
+ exports.DoctorModule = DoctorModule;
19
+ exports.DoctorModule = DoctorModule = __decorate([
20
+ (0, common_1.Module)({
21
+ imports: [typeorm_1.TypeOrmModule.forFeature([talent_profile_entity_1.TalentProfile, parse_log_entity_1.ParseLog])],
22
+ providers: [doctor_service_1.DoctorService],
23
+ controllers: [doctor_controller_1.DoctorController],
24
+ exports: [doctor_service_1.DoctorService],
25
+ })
26
+ ], DoctorModule);
27
+ //# sourceMappingURL=doctor.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.module.js","sourceRoot":"","sources":["../../src/doctor/doctor.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,qDAAiD;AACjD,2DAAuD;AACvD,wFAA6E;AAC7E,8EAAmE;AAQ5D,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IANxB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,qCAAa,EAAE,2BAAQ,CAAC,CAAC,CAAC;QAC9D,SAAS,EAAE,CAAC,8BAAa,CAAC;QAC1B,WAAW,EAAE,CAAC,oCAAgB,CAAC;QAC/B,OAAO,EAAE,CAAC,8BAAa,CAAC;KACzB,CAAC;GACW,YAAY,CAAG"}
@@ -0,0 +1,15 @@
1
+ import { Repository } from 'typeorm';
2
+ import { ParseLog } from '../extraction/entities/parse-log.entity';
3
+ import { TalentProfile } from '../extraction/entities/talent-profile.entity';
4
+ import type { DoctorCheckHandler, DoctorRunOptions, DoctorRunResult } from './doctor.types';
5
+ export declare class DoctorService {
6
+ private readonly talentRepo;
7
+ private readonly parseLogRepo;
8
+ private readonly checks;
9
+ constructor(talentRepo: Repository<TalentProfile>, parseLogRepo: Repository<ParseLog>);
10
+ list(): Array<Pick<DoctorCheckHandler, 'id' | 'name' | 'description' | 'severity' | 'fixable'>>;
11
+ run(options: DoctorRunOptions): Promise<DoctorRunResult>;
12
+ private registerLinkedInDupesCheck;
13
+ private groupLinkedInTalentDupes;
14
+ private repairLinkedInDupes;
15
+ }
@@ -0,0 +1,209 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.DoctorService = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const typeorm_1 = require("@nestjs/typeorm");
18
+ const typeorm_2 = require("typeorm");
19
+ const extraction_service_1 = require("../extraction/extraction.service");
20
+ const parse_log_entity_1 = require("../extraction/entities/parse-log.entity");
21
+ const talent_profile_entity_1 = require("../extraction/entities/talent-profile.entity");
22
+ let DoctorService = class DoctorService {
23
+ talentRepo;
24
+ parseLogRepo;
25
+ checks = new Map();
26
+ constructor(talentRepo, parseLogRepo) {
27
+ this.talentRepo = talentRepo;
28
+ this.parseLogRepo = parseLogRepo;
29
+ this.registerLinkedInDupesCheck();
30
+ }
31
+ list() {
32
+ return Array.from(this.checks.values()).map((c) => ({
33
+ id: c.id,
34
+ name: c.name,
35
+ description: c.description,
36
+ severity: c.severity,
37
+ fixable: c.fixable,
38
+ }));
39
+ }
40
+ async run(options) {
41
+ const mode = options.mode ?? 'check';
42
+ const dryRun = options.dryRun === true;
43
+ const ids = options.checks && options.checks.length ? options.checks : Array.from(this.checks.keys());
44
+ const results = [];
45
+ for (const id of ids) {
46
+ const handler = this.checks.get(id);
47
+ if (!handler) {
48
+ results.push({
49
+ id: id,
50
+ name: id,
51
+ description: 'unknown check',
52
+ severity: 'error',
53
+ ok: false,
54
+ fixable: false,
55
+ message: `unknown check: ${id}`,
56
+ });
57
+ continue;
58
+ }
59
+ const checkRes = await handler.check();
60
+ const base = {
61
+ id: handler.id,
62
+ name: handler.name,
63
+ description: handler.description,
64
+ severity: handler.severity,
65
+ ok: checkRes.ok,
66
+ fixable: handler.fixable,
67
+ details: checkRes.details,
68
+ message: checkRes.message,
69
+ };
70
+ if (mode === 'repair' && !checkRes.ok && handler.fix && handler.fix) {
71
+ const fixRes = await handler.fix(checkRes.details, dryRun);
72
+ base.ok = fixRes.fixed;
73
+ base.message = fixRes.message ?? base.message;
74
+ if (fixRes.details)
75
+ base.details = { ...base.details, ...fixRes.details };
76
+ }
77
+ results.push(base);
78
+ }
79
+ const summary = results.some((r) => r.severity === 'error' && !r.ok)
80
+ ? 'error'
81
+ : results.some((r) => r.severity === 'warn' && !r.ok)
82
+ ? 'warn'
83
+ : 'ok';
84
+ return {
85
+ mode,
86
+ dryRun,
87
+ summary,
88
+ checks: results,
89
+ repaired: results.find((r) => r.id === 'linkedin-dupes')?.details?.merged,
90
+ };
91
+ }
92
+ registerLinkedInDupesCheck() {
93
+ const handler = {
94
+ id: 'linkedin-dupes',
95
+ name: 'LinkedIn talent 重复(详情子页)',
96
+ description: '检测 /in/<slug>/details/... 子页是否产生了重复 talent 记录',
97
+ severity: 'warn',
98
+ fixable: true,
99
+ check: async () => {
100
+ const groups = await this.groupLinkedInTalentDupes();
101
+ const duplicateGroups = Array.from(groups.entries()).filter(([, items]) => items.length > 1);
102
+ return {
103
+ ok: duplicateGroups.length === 0,
104
+ details: {
105
+ totalCandidates: groups.size,
106
+ duplicateGroups: duplicateGroups.length,
107
+ groups: duplicateGroups.map(([dedupKey, items]) => ({
108
+ dedupKey,
109
+ ids: items.map((i) => i.id),
110
+ sourceUrls: items.map((i) => i.sourceUrl),
111
+ })),
112
+ },
113
+ message: duplicateGroups.length
114
+ ? `发现 ${duplicateGroups.length} 组重复 LinkedIn talent`
115
+ : '未发现重复 LinkedIn talent',
116
+ };
117
+ },
118
+ fix: async (_details, dryRun) => {
119
+ const merged = await this.repairLinkedInDupes(dryRun);
120
+ return {
121
+ fixed: true,
122
+ message: dryRun
123
+ ? `[dry-run] 发现 ${merged.length} 组可合并重复`
124
+ : `已合并 ${merged.length} 组重复 talent`,
125
+ details: { merged, count: merged.length },
126
+ };
127
+ },
128
+ };
129
+ this.checks.set(handler.id, handler);
130
+ }
131
+ async groupLinkedInTalentDupes() {
132
+ const all = await this.talentRepo.find({ where: { source: 'linkedin.com' } });
133
+ const groups = new Map();
134
+ for (const item of all) {
135
+ if (!item.sourceUrl)
136
+ continue;
137
+ const norm = (0, extraction_service_1.normalizeUrlForDedup)(item.sourceUrl);
138
+ if (!norm.includes('/in/'))
139
+ continue;
140
+ if (!groups.has(norm))
141
+ groups.set(norm, []);
142
+ groups.get(norm).push(item);
143
+ }
144
+ return groups;
145
+ }
146
+ async repairLinkedInDupes(dryRun = false) {
147
+ const groups = await this.groupLinkedInTalentDupes();
148
+ const merged = [];
149
+ for (const [norm, items] of groups.entries()) {
150
+ if (items.length <= 1)
151
+ continue;
152
+ const baseCandidate = items.find((i) => i.sourceUrl && !/\/details\//.test(i.sourceUrl));
153
+ items.sort((a, b) => {
154
+ const ta = a.updatedAt ? new Date(a.updatedAt).getTime() : 0;
155
+ const tb = b.updatedAt ? new Date(b.updatedAt).getTime() : 0;
156
+ return tb - ta;
157
+ });
158
+ const master = baseCandidate || items[0];
159
+ const slaves = items.filter((i) => i.id !== master.id);
160
+ const slaveIds = slaves.map((s) => s.id);
161
+ const mergedExtracted = { ...(master.extracted || {}) };
162
+ for (const slave of slaves) {
163
+ const extracted = (slave.extracted || {});
164
+ for (const [k, v] of Object.entries(extracted)) {
165
+ if (v == null)
166
+ continue;
167
+ if (mergedExtracted[k] == null) {
168
+ mergedExtracted[k] = v;
169
+ }
170
+ else if (Array.isArray(v) && Array.isArray(mergedExtracted[k]) && mergedExtracted[k].length === 0) {
171
+ mergedExtracted[k] = v;
172
+ }
173
+ }
174
+ }
175
+ if (!dryRun) {
176
+ if (/\/in\/[^/]+\/details\//.test(master.sourceUrl)) {
177
+ master.sourceUrl = master.sourceUrl.replace(/^(.*?\/in\/[^/]+)\/details\/.*$/, '$1/');
178
+ }
179
+ master.dedupKey = `${(0, extraction_service_1.etldPlus1)(new URL(master.sourceUrl).hostname)}:${(0, extraction_service_1.normalizeUrlForDedup)(master.sourceUrl)}`;
180
+ master.extracted = mergedExtracted;
181
+ master.raw = {
182
+ ...(master.raw || {}),
183
+ repairedFrom: slaveIds,
184
+ repairedAt: new Date().toISOString(),
185
+ };
186
+ await this.talentRepo.save(master);
187
+ await this.parseLogRepo.update({ entityId: (0, typeorm_2.In)(slaveIds), pageClass: 'talent' }, { entityId: master.id });
188
+ await this.talentRepo.remove(slaves);
189
+ }
190
+ merged.push({
191
+ dedupKey: norm,
192
+ masterId: master.id,
193
+ removedIds: slaveIds,
194
+ mergedFields: Object.keys(mergedExtracted),
195
+ sourceUrl: master.sourceUrl,
196
+ });
197
+ }
198
+ return merged;
199
+ }
200
+ };
201
+ exports.DoctorService = DoctorService;
202
+ exports.DoctorService = DoctorService = __decorate([
203
+ (0, common_1.Injectable)(),
204
+ __param(0, (0, typeorm_1.InjectRepository)(talent_profile_entity_1.TalentProfile)),
205
+ __param(1, (0, typeorm_1.InjectRepository)(parse_log_entity_1.ParseLog)),
206
+ __metadata("design:paramtypes", [typeorm_2.Repository,
207
+ typeorm_2.Repository])
208
+ ], DoctorService);
209
+ //# sourceMappingURL=doctor.service.js.map