hunter-mate 0.1.23 → 0.1.24
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/dist/assets/extension/build-info.json +1 -1
- package/dist/assets/extension/manifest.json +3 -3
- package/dist/assets/server/main.mjs +68 -18
- package/dist/index.js +63 -19
- package/dist/web/dist/404.html +1 -1
- package/dist/web/dist/_next/static/chunks/253-a05d05b94bfbd7a4.js +1 -0
- package/dist/web/dist/_next/static/chunks/{852-248884963a986600.js → 852-ad19b97821a4cf9e.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/companies/{page-ec27ce9ab3610221.js → page-e8d02fe997579315.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/jobs/page-4827a9ef286b6483.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/talents/{page-c0a0c250eb5f5459.js → page-0edef6d07b3cf69d.js} +1 -1
- package/dist/web/dist/_next/static/css/10ba1fa1d6ce23a7.css +3 -0
- package/dist/web/dist/admin/data.html +1 -1
- package/dist/web/dist/admin/data.txt +1 -1
- package/dist/web/dist/auth/verify.html +1 -1
- package/dist/web/dist/auth/verify.txt +1 -1
- package/dist/web/dist/companies.html +1 -1
- package/dist/web/dist/companies.txt +2 -2
- package/dist/web/dist/company/admin.html +1 -1
- package/dist/web/dist/company/admin.txt +1 -1
- package/dist/web/dist/entity.html +1 -1
- package/dist/web/dist/entity.txt +1 -1
- package/dist/web/dist/index.html +1 -1
- package/dist/web/dist/index.txt +1 -1
- package/dist/web/dist/jobs.html +1 -1
- package/dist/web/dist/jobs.txt +2 -2
- package/dist/web/dist/logs.html +1 -1
- package/dist/web/dist/logs.txt +1 -1
- package/dist/web/dist/matching/jobs/placeholder/talents.html +1 -1
- package/dist/web/dist/matching/jobs/placeholder/talents.txt +1 -1
- package/dist/web/dist/matching/portraits/placeholder/jobs.html +1 -1
- package/dist/web/dist/matching/portraits/placeholder/jobs.txt +1 -1
- package/dist/web/dist/parselog.html +1 -1
- package/dist/web/dist/parselog.txt +1 -1
- package/dist/web/dist/recordings.html +1 -1
- package/dist/web/dist/recordings.txt +1 -1
- package/dist/web/dist/resource-usage.html +1 -1
- package/dist/web/dist/resource-usage.txt +1 -1
- package/dist/web/dist/shared/placeholder.html +1 -1
- package/dist/web/dist/shared/placeholder.txt +1 -1
- package/dist/web/dist/snapshots/placeholder/agent-prompt.html +1 -1
- package/dist/web/dist/snapshots/placeholder/agent-prompt.txt +1 -1
- package/dist/web/dist/talents.html +1 -1
- package/dist/web/dist/talents.txt +2 -2
- package/dist/web/dist/team/insights.html +1 -1
- package/dist/web/dist/team/insights.txt +1 -1
- package/package.json +1 -1
- package/dist/web/dist/_next/static/chunks/954-fb0212fe71f60a52.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/jobs/page-4175a90f1b42f87d.js +0 -1
- package/dist/web/dist/_next/static/css/bd072fee69ae8474.css +0 -3
- /package/dist/assets/extension/background/{service-worker.20261016165050.js → service-worker.20261017012007.js} +0 -0
- /package/dist/web/dist/_next/static/{a_JzW5lROd6a66UMqSE9Z → hBLezfvVOMiGqm4V9F15i}/_buildManifest.js +0 -0
- /package/dist/web/dist/_next/static/{a_JzW5lROd6a66UMqSE9Z → hBLezfvVOMiGqm4V9F15i}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"buildTime":"2026-10-
|
|
1
|
+
{"buildTime":"2026-10-17T01:20:07.102Z","version":"0.1.24"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"manifest_version": 3,
|
|
3
3
|
"minimum_chrome_version": "116",
|
|
4
4
|
"name": "__MSG_extName__",
|
|
5
|
-
"description": "[build 10-
|
|
6
|
-
"version": "0.1.
|
|
5
|
+
"description": "[build 10-17 01:20:07] __MSG_extDescription__",
|
|
6
|
+
"version": "0.1.24",
|
|
7
7
|
"default_locale": "zh_CN",
|
|
8
8
|
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAi/S88toqsiW6zleTj+V8jPUVTmrJiyDPvqTd+Cqrl/Ax9PCxaMsiXXUh2sNJh6sMj7xj0YBclCPMsI2wxIF8y4r6KnmWt49RuMg7EynvOT8fcRjxXBWGAz6hjGepWesOCMn9dgJ5IqgXP3j+Bfb+636IeW1nZxOedT25zJwJr81G4gIyc9kk+wCZPHUhQTsfNVxd8xfbxYQpcDuuVk1dDNEszeLUZGKYl9JcOQcaEQOWA4ED5avn67ZWQx5kzowB7XYtcTH0vz63cKNcK3O1iQ0hmFoohPKRWh9tNl545UQ2+mPaU6B/CNSZP2qwb+tgK7lVh5zG5qQkbaP8ZP8XaQIDAQAB",
|
|
9
9
|
"permissions": [
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"<all_urls>"
|
|
28
28
|
],
|
|
29
29
|
"background": {
|
|
30
|
-
"service_worker": "background/service-worker.
|
|
30
|
+
"service_worker": "background/service-worker.20261017012007.js",
|
|
31
31
|
"type": "module"
|
|
32
32
|
},
|
|
33
33
|
"content_scripts": [
|
|
@@ -221713,6 +221713,17 @@ var JobcaseService = class JobcaseService2 {
|
|
|
221713
221713
|
for (const it of items)
|
|
221714
221714
|
it.rsUserIds = rsMap.get(it.id) ?? [];
|
|
221715
221715
|
}
|
|
221716
|
+
const custIds = Array.from(new Set(items.map((i) => i.customerId).filter((n) => n != null)));
|
|
221717
|
+
if (custIds.length) {
|
|
221718
|
+
const custs = await this.customerRepo.find({
|
|
221719
|
+
where: { id: In(custIds) },
|
|
221720
|
+
select: ["id", "canonicalName"]
|
|
221721
|
+
});
|
|
221722
|
+
const nameMap = new Map(custs.map((c) => [c.id, c.canonicalName]));
|
|
221723
|
+
for (const it of items) {
|
|
221724
|
+
it.customerName = it.customerId != null ? nameMap.get(it.customerId) ?? null : null;
|
|
221725
|
+
}
|
|
221726
|
+
}
|
|
221716
221727
|
return { items, total, statusCounts };
|
|
221717
221728
|
}
|
|
221718
221729
|
async create(dto) {
|
|
@@ -222273,6 +222284,11 @@ var AuthService = AuthService_1 = class AuthService2 {
|
|
|
222273
222284
|
expires_in: 60 * 60 * 24 * 7
|
|
222274
222285
|
};
|
|
222275
222286
|
}
|
|
222287
|
+
issueStableLocalToken(userId) {
|
|
222288
|
+
const DAY = 86400;
|
|
222289
|
+
const exp = (Math.floor(Date.now() / 1e3 / DAY) + 2) * DAY;
|
|
222290
|
+
return jwt.sign({ data: { _id: userId }, exp }, this.secret, { noTimestamp: true });
|
|
222291
|
+
}
|
|
222276
222292
|
async sendEmailCode(body) {
|
|
222277
222293
|
try {
|
|
222278
222294
|
const res = await (0, import_rxjs2.firstValueFrom)(this.http.post(`${this.saasBaseUrl}/hunter-mate/auth/email/send-code`, body));
|
|
@@ -222359,7 +222375,7 @@ var AuthService = AuthService_1 = class AuthService2 {
|
|
|
222359
222375
|
loggedIn: true,
|
|
222360
222376
|
email,
|
|
222361
222377
|
hmUserId,
|
|
222362
|
-
token: this.
|
|
222378
|
+
token: this.issueStableLocalToken(hmUserId)
|
|
222363
222379
|
};
|
|
222364
222380
|
}
|
|
222365
222381
|
extractUserId(saasToken, data) {
|
|
@@ -222800,8 +222816,10 @@ var DatasyncService = class DatasyncService2 {
|
|
|
222800
222816
|
tenant;
|
|
222801
222817
|
logger = new import_common18.Logger(DatasyncService_1.name);
|
|
222802
222818
|
static SYNC_VIEW_TTL_MS = 2e4;
|
|
222819
|
+
static SYNC_VIEW_STALE_GRACE_MS = 6e5;
|
|
222803
222820
|
timer;
|
|
222804
222821
|
syncViewCache = null;
|
|
222822
|
+
syncViewRefresh = null;
|
|
222805
222823
|
pushing = false;
|
|
222806
222824
|
pulling = false;
|
|
222807
222825
|
authFailed = false;
|
|
@@ -222988,22 +223006,18 @@ var DatasyncService = class DatasyncService2 {
|
|
|
222988
223006
|
return { ...base, loggedIn: false };
|
|
222989
223007
|
const uid = this.hmUserIdOf(token.token);
|
|
222990
223008
|
const cached2 = this.syncViewCache;
|
|
222991
|
-
if (cached2 && cached2.uid === uid
|
|
222992
|
-
|
|
223009
|
+
if (cached2 && cached2.uid === uid) {
|
|
223010
|
+
const age = Date.now() - cached2.at;
|
|
223011
|
+
if (age < DatasyncService_1.SYNC_VIEW_TTL_MS) {
|
|
223012
|
+
return { ...base, loggedIn: true, ...cached2.view, activeTenantId: await this.getActiveTenantId() };
|
|
223013
|
+
}
|
|
223014
|
+
if (age < DatasyncService_1.SYNC_VIEW_STALE_GRACE_MS) {
|
|
223015
|
+
this.kickSyncViewBackgroundRefresh(uid, token.token);
|
|
223016
|
+
return { ...base, loggedIn: true, ...cached2.view, activeTenantId: await this.getActiveTenantId() };
|
|
223017
|
+
}
|
|
222993
223018
|
}
|
|
222994
223019
|
try {
|
|
222995
|
-
const
|
|
222996
|
-
headers: { Authorization: `HMJWT ${token.token}` }
|
|
222997
|
-
});
|
|
222998
|
-
if (!res.ok)
|
|
222999
|
-
return { ...base, loggedIn: true, remoteError: `HTTP ${res.status}` };
|
|
223000
|
-
const body = await res.json();
|
|
223001
|
-
const view = {
|
|
223002
|
-
hmUserId: body.hmUserId,
|
|
223003
|
-
memberships: body.memberships ?? [],
|
|
223004
|
-
serverSuggestedTenantId: body.activeTenantId ?? null,
|
|
223005
|
-
heads: []
|
|
223006
|
-
};
|
|
223020
|
+
const view = await this.fetchSyncView(uid, token.token);
|
|
223007
223021
|
this.syncViewCache = { uid, at: Date.now(), view };
|
|
223008
223022
|
return {
|
|
223009
223023
|
...base,
|
|
@@ -223015,6 +223029,37 @@ var DatasyncService = class DatasyncService2 {
|
|
|
223015
223029
|
return { ...base, loggedIn: true, remoteError: err.message ?? String(err) };
|
|
223016
223030
|
}
|
|
223017
223031
|
}
|
|
223032
|
+
async fetchSyncView(uid, jwt5) {
|
|
223033
|
+
const res = await fetch(`${this.saasBaseUrl}/hunter-mate/sync/state?heads=0`, {
|
|
223034
|
+
headers: { Authorization: `HMJWT ${jwt5}` }
|
|
223035
|
+
});
|
|
223036
|
+
if (!res.ok)
|
|
223037
|
+
throw new Error(`HTTP ${res.status}`);
|
|
223038
|
+
const body = await res.json();
|
|
223039
|
+
return {
|
|
223040
|
+
hmUserId: body.hmUserId,
|
|
223041
|
+
memberships: body.memberships ?? [],
|
|
223042
|
+
serverSuggestedTenantId: body.activeTenantId ?? null,
|
|
223043
|
+
heads: []
|
|
223044
|
+
};
|
|
223045
|
+
}
|
|
223046
|
+
kickSyncViewBackgroundRefresh(uid, jwt5) {
|
|
223047
|
+
if (this.syncViewRefresh)
|
|
223048
|
+
return;
|
|
223049
|
+
this.syncViewRefresh = (async () => {
|
|
223050
|
+
try {
|
|
223051
|
+
const view = await this.fetchSyncView(uid, jwt5);
|
|
223052
|
+
if (this.syncViewCache?.uid === uid)
|
|
223053
|
+
this.syncViewCache = { uid, at: Date.now(), view };
|
|
223054
|
+
} catch (err) {
|
|
223055
|
+
this.logger.warn(`sync view \u540E\u53F0\u5237\u65B0\u5931\u8D25,\u7F13\u5B58\u5DF2\u6E05(\u4E0B\u56DE\u963B\u585E\u5F0F\u91CD\u8BD5): ${err?.message ?? err}`);
|
|
223056
|
+
if (this.syncViewCache?.uid === uid)
|
|
223057
|
+
this.syncViewCache = null;
|
|
223058
|
+
} finally {
|
|
223059
|
+
this.syncViewRefresh = null;
|
|
223060
|
+
}
|
|
223061
|
+
})();
|
|
223062
|
+
}
|
|
223018
223063
|
async listVersions(entity) {
|
|
223019
223064
|
const where = entity ? { entity } : {};
|
|
223020
223065
|
const rows = await this.versionRepo.find({ where, order: { entity: "ASC", localId: "ASC" } });
|
|
@@ -223400,7 +223445,7 @@ var DatasyncService = class DatasyncService2 {
|
|
|
223400
223445
|
let deleted = 0;
|
|
223401
223446
|
let pooled = 0;
|
|
223402
223447
|
let since = cursor.pulledWatermark ?? void 0;
|
|
223403
|
-
const LIMIT =
|
|
223448
|
+
const LIMIT = 100;
|
|
223404
223449
|
for (let page = 0; page < 20; page++) {
|
|
223405
223450
|
const url2 = new URL(`${this.saasBaseUrl}/hunter-mate/sync/pull`);
|
|
223406
223451
|
url2.searchParams.set("entity", table);
|
|
@@ -307067,12 +307112,17 @@ var RecommendationService = RecommendationService_1 = class RecommendationServic
|
|
|
307067
307112
|
if (!ids.length)
|
|
307068
307113
|
return {};
|
|
307069
307114
|
const now = /* @__PURE__ */ new Date();
|
|
307115
|
+
const dayStart = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
|
307070
307116
|
const weekStart = new Date(now.getFullYear(), now.getMonth(), now.getDate() - (now.getDay() + 6) % 7);
|
|
307071
|
-
const rows = await this.recRepo.createQueryBuilder("r").select("r.jobCaseId", "jobCaseId").addSelect("r.stage", "stage").addSelect("COUNT(*)", "c").addSelect("SUM(CASE WHEN r.updatedAt >= :weekStart THEN 1 ELSE 0 END)", "weekC").where("r.jobCaseId IN (:...ids)", { ids }).setParameter("weekStart", weekStart.toISOString()).groupBy("r.jobCaseId").addGroupBy("r.stage").getRawMany();
|
|
307117
|
+
const rows = await this.recRepo.createQueryBuilder("r").select("r.jobCaseId", "jobCaseId").addSelect("r.stage", "stage").addSelect("COUNT(*)", "c").addSelect("SUM(CASE WHEN r.updatedAt >= :weekStart THEN 1 ELSE 0 END)", "weekC").addSelect("SUM(CASE WHEN r.updatedAt >= :dayStart THEN 1 ELSE 0 END)", "todayC").where("r.jobCaseId IN (:...ids)", { ids }).setParameter("weekStart", weekStart.toISOString()).setParameter("dayStart", dayStart.toISOString()).groupBy("r.jobCaseId").addGroupBy("r.stage").getRawMany();
|
|
307072
307118
|
const out = {};
|
|
307073
307119
|
for (const r of rows) {
|
|
307074
307120
|
const jc = Number(r.jobCaseId);
|
|
307075
|
-
(out[jc] ??= {})[r.stage] = {
|
|
307121
|
+
(out[jc] ??= {})[r.stage] = {
|
|
307122
|
+
total: Number(r.c),
|
|
307123
|
+
week: Number(r.weekC ?? 0),
|
|
307124
|
+
today: Number(r.todayC ?? 0)
|
|
307125
|
+
};
|
|
307076
307126
|
}
|
|
307077
307127
|
return out;
|
|
307078
307128
|
}
|
package/dist/index.js
CHANGED
|
@@ -70211,7 +70211,7 @@ var init_auto_doctor = __esm({
|
|
|
70211
70211
|
var hmh_sync_exports = {};
|
|
70212
70212
|
__export(hmh_sync_exports, {
|
|
70213
70213
|
maybeSyncHmhLocal: () => maybeSyncHmhLocal,
|
|
70214
|
-
parseFrontmatter: () =>
|
|
70214
|
+
parseFrontmatter: () => parseFrontmatter2,
|
|
70215
70215
|
resolveHmhLocalDir: () => resolveHmhLocalDir
|
|
70216
70216
|
});
|
|
70217
70217
|
import * as fs28 from "fs";
|
|
@@ -70254,7 +70254,7 @@ function resolveHmhLocalDir() {
|
|
|
70254
70254
|
}
|
|
70255
70255
|
return null;
|
|
70256
70256
|
}
|
|
70257
|
-
function
|
|
70257
|
+
function parseFrontmatter2(text) {
|
|
70258
70258
|
const m = text.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
70259
70259
|
if (!m) return {};
|
|
70260
70260
|
const meta = {};
|
|
@@ -70360,7 +70360,7 @@ async function maybeSyncHmhLocal() {
|
|
|
70360
70360
|
const clientsDir = path30.join(localDir, "clients");
|
|
70361
70361
|
for (const clientDir of listIndexDirs(clientsDir)) {
|
|
70362
70362
|
const indexFile = path30.join(clientDir, "INDEX.md");
|
|
70363
|
-
const meta =
|
|
70363
|
+
const meta = parseFrontmatter2(fs28.readFileSync(indexFile, "utf8"));
|
|
70364
70364
|
const clientName = cleanValue(meta.client) || path30.basename(clientDir);
|
|
70365
70365
|
report.checkedClients = (report.checkedClients ?? 0) + 1;
|
|
70366
70366
|
const wantName = looseName(clientName);
|
|
@@ -70410,7 +70410,7 @@ async function maybeSyncHmhLocal() {
|
|
|
70410
70410
|
const positionsDir = path30.join(clientDir, "positions");
|
|
70411
70411
|
for (const posDir of listIndexDirs(positionsDir)) {
|
|
70412
70412
|
const posIndexFile = path30.join(posDir, "INDEX.md");
|
|
70413
|
-
const posMeta =
|
|
70413
|
+
const posMeta = parseFrontmatter2(fs28.readFileSync(posIndexFile, "utf8"));
|
|
70414
70414
|
const posName = cleanValue(posMeta.position) || path30.basename(posDir);
|
|
70415
70415
|
report.checkedPositions = (report.checkedPositions ?? 0) + 1;
|
|
70416
70416
|
const posCustomerStamped = Number(posMeta.customer_id);
|
|
@@ -71114,24 +71114,47 @@ function collectJobFiles(dir, relPrefix = "", out = {}) {
|
|
|
71114
71114
|
}
|
|
71115
71115
|
return out;
|
|
71116
71116
|
}
|
|
71117
|
+
function parseFrontmatter(text) {
|
|
71118
|
+
const m = text.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
71119
|
+
if (!m) return {};
|
|
71120
|
+
const out = {};
|
|
71121
|
+
for (const line of m[1].split(/\r?\n/)) {
|
|
71122
|
+
const idx = line.indexOf(":");
|
|
71123
|
+
if (idx <= 0) continue;
|
|
71124
|
+
const key = line.slice(0, idx).trim();
|
|
71125
|
+
let value = line.slice(idx + 1).trim();
|
|
71126
|
+
if (value.startsWith('"') && value.endsWith('"')) value = value.slice(1, -1);
|
|
71127
|
+
if (value.startsWith("'") && value.endsWith("'")) value = value.slice(1, -1);
|
|
71128
|
+
if (key && value) out[key] = value;
|
|
71129
|
+
}
|
|
71130
|
+
return out;
|
|
71131
|
+
}
|
|
71132
|
+
var FM_REQUIREMENT_KEYS = ["company", "location", "salary", "employment", "department"];
|
|
71133
|
+
function orderedFileKeys(rawFiles) {
|
|
71134
|
+
const keys = Object.keys(rawFiles);
|
|
71135
|
+
const md = keys.filter((k2) => k2.endsWith(".md"));
|
|
71136
|
+
const rootMd = md.filter((k2) => !k2.includes("/"));
|
|
71137
|
+
const preferred = rootMd.filter((k2) => /^(job|jd|index)\.md$/i.test(k2));
|
|
71138
|
+
return [...preferred, ...rootMd.filter((k2) => !preferred.includes(k2)), ...md.filter((k2) => !rootMd.includes(k2))];
|
|
71139
|
+
}
|
|
71140
|
+
async function resolveCustomerId(customerRef) {
|
|
71141
|
+
if (/^\d+$/.test(customerRef.trim())) return parseInt(customerRef.trim(), 10);
|
|
71142
|
+
const hits = await runCustomerList(customerRef.trim());
|
|
71143
|
+
if (!hits.length) {
|
|
71144
|
+
throw new Error(`\u5BA2\u6237 "${customerRef}" \u672A\u5165\u5E93,\u8BF7\u5148: hunter-mate customer upsert --name "${customerRef}"`);
|
|
71145
|
+
}
|
|
71146
|
+
if (hits.length > 1) {
|
|
71147
|
+
console.error(`\u2139 \u5BA2\u6237 "${customerRef}" \u547D\u4E2D ${hits.length} \u6761,\u4F7F\u7528\u7B2C\u4E00\u4E2A: [${hits[0].id}] ${hits[0].canonicalName}`);
|
|
71148
|
+
}
|
|
71149
|
+
return hits[0].id;
|
|
71150
|
+
}
|
|
71117
71151
|
async function runJobCreate(folderPath, customerRef) {
|
|
71118
71152
|
const config = loadConfig();
|
|
71119
71153
|
const token = await getToken();
|
|
71120
71154
|
const headers = token ? { Authorization: `UTOKEN ${token}` } : {};
|
|
71121
71155
|
let customerId;
|
|
71122
71156
|
if (customerRef) {
|
|
71123
|
-
|
|
71124
|
-
customerId = parseInt(customerRef.trim(), 10);
|
|
71125
|
-
} else {
|
|
71126
|
-
const hits = await runCustomerList(customerRef.trim());
|
|
71127
|
-
if (!hits.length) {
|
|
71128
|
-
throw new Error(`\u5BA2\u6237 "${customerRef}" \u672A\u5165\u5E93,\u8BF7\u5148: hunter-mate customer upsert --name "${customerRef}"`);
|
|
71129
|
-
}
|
|
71130
|
-
customerId = hits[0].id;
|
|
71131
|
-
if (hits.length > 1) {
|
|
71132
|
-
console.error(`\u2139 \u5BA2\u6237 "${customerRef}" \u547D\u4E2D ${hits.length} \u6761,\u4F7F\u7528\u7B2C\u4E00\u4E2A: [${hits[0].id}] ${hits[0].canonicalName}`);
|
|
71133
|
-
}
|
|
71134
|
-
}
|
|
71157
|
+
customerId = await resolveCustomerId(customerRef);
|
|
71135
71158
|
}
|
|
71136
71159
|
const resolved = path17.resolve(folderPath);
|
|
71137
71160
|
if (!fs15.existsSync(resolved)) {
|
|
@@ -71142,9 +71165,29 @@ async function runJobCreate(folderPath, customerRef) {
|
|
|
71142
71165
|
throw new Error(`Folder \u5185\u672A\u627E\u5230 .md/.txt/.pdf \u6587\u4EF6: ${resolved}`);
|
|
71143
71166
|
}
|
|
71144
71167
|
const rawText = Object.values(rawFiles).join("\n---\n");
|
|
71168
|
+
const fm = {};
|
|
71169
|
+
for (const key of orderedFileKeys(rawFiles)) {
|
|
71170
|
+
const parsed = parseFrontmatter(rawFiles[key]);
|
|
71171
|
+
if (Object.keys(parsed).length) {
|
|
71172
|
+
Object.assign(fm, parsed);
|
|
71173
|
+
break;
|
|
71174
|
+
}
|
|
71175
|
+
}
|
|
71176
|
+
if (customerId === void 0 && fm.customer) {
|
|
71177
|
+
customerId = await resolveCustomerId(fm.customer);
|
|
71178
|
+
console.error(`\u2139 \u5BA2\u6237\u53D6\u81EA JD frontmatter: ${fm.customer} \u2192 id=${customerId}`);
|
|
71179
|
+
}
|
|
71180
|
+
const requirements = {};
|
|
71181
|
+
for (const k2 of FM_REQUIREMENT_KEYS) {
|
|
71182
|
+
if (fm[k2]) requirements[k2] = fm[k2];
|
|
71183
|
+
}
|
|
71145
71184
|
const firstKey = Object.keys(rawFiles)[0];
|
|
71146
71185
|
const titleBase = firstKey.includes("/") ? firstKey.split("/").pop() : firstKey;
|
|
71147
|
-
const
|
|
71186
|
+
const fallbackTitle = titleBase.replace(/\.[^.]+$/, "") || "Untitled JobCase";
|
|
71187
|
+
const title = (fm.title ?? "").trim() || fallbackTitle;
|
|
71188
|
+
if (fm.title) {
|
|
71189
|
+
console.error(`\u2139 \u804C\u4F4D\u540D\u53D6\u81EA JD frontmatter: "${title}"`);
|
|
71190
|
+
}
|
|
71148
71191
|
const res = await axios_default.post(
|
|
71149
71192
|
`${config.serverUrl}/job-cases`,
|
|
71150
71193
|
{
|
|
@@ -71152,7 +71195,8 @@ async function runJobCreate(folderPath, customerRef) {
|
|
|
71152
71195
|
title,
|
|
71153
71196
|
folderPath: resolved,
|
|
71154
71197
|
rawFiles,
|
|
71155
|
-
customerId
|
|
71198
|
+
customerId,
|
|
71199
|
+
requirements: Object.keys(requirements).length ? requirements : void 0
|
|
71156
71200
|
},
|
|
71157
71201
|
{ headers, proxy: false }
|
|
71158
71202
|
);
|
|
@@ -73579,7 +73623,7 @@ function installLocalProxyBypass() {
|
|
|
73579
73623
|
// package.json
|
|
73580
73624
|
var package_default = {
|
|
73581
73625
|
name: "hunter-mate",
|
|
73582
|
-
version: "0.1.
|
|
73626
|
+
version: "0.1.24",
|
|
73583
73627
|
type: "module",
|
|
73584
73628
|
description: "HiredChina \u730E\u5934 Agent \u6570\u636E\u52A9\u624B CLI:\u4EBA\u624D\u5E93/\u5BA2\u6237/\u804C\u4F4D\u6570\u636E\u8BBF\u95EE,\u6D4F\u89C8\u5668\u5F55\u5236\u89E3\u6790\u7B80\u5386,server/\u6269\u5C55\u4E00\u81F4\u6027\u81EA\u6108",
|
|
73585
73629
|
license: "MIT",
|
package/dist/web/dist/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="zh-CN"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/
|
|
1
|
+
<!DOCTYPE html><html lang="zh-CN"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/10ba1fa1d6ce23a7.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-54e74ccc9e9451ee.js"/><script src="/_next/static/chunks/a7067448-e416655baf443992.js" async=""></script><script src="/_next/static/chunks/935-7be3e60dd8bc29d2.js" async=""></script><script src="/_next/static/chunks/main-app-f496bd51a73ef9f3.js" async=""></script><script src="/_next/static/chunks/589-f984bff035a1cb85.js" async=""></script><script src="/_next/static/chunks/105-dcd8f6d5867c8995.js" async=""></script><script src="/_next/static/chunks/app/layout-af39afc7866e74db.js" async=""></script><meta name="robots" content="noindex"/><title>HunterMate 采集仪表盘</title><meta name="description" content="HunterMate 采集/解析/入库仪表盘"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="flex h-screen overflow-hidden bg-gray-50 text-gray-900"><div class="flex h-screen w-screen flex-col items-center justify-center bg-gray-50"><span class="hm-spinner" aria-label="加载中"></span><div class="mt-4 text-sm text-gray-400">正在加载,请稍候…</div></div><script src="/_next/static/chunks/webpack-54e74ccc9e9451ee.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/10ba1fa1d6ce23a7.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[76939,[],\"\"]\n4:I[74268,[],\"\"]\n5:I[81050,[],\"\"]\n6:I[15214,[\"589\",\"static/chunks/589-f984bff035a1cb85.js\",\"105\",\"static/chunks/105-dcd8f6d5867c8995.js\",\"185\",\"static/chunks/app/layout-af39afc7866e74db.js\"],\"AuthGate\"]\n7:I[67188,[\"589\",\"static/chunks/589-f984bff035a1cb85.js\",\"105\",\"static/chunks/105-dcd8f6d5867c8995.js\",\"185\",\"static/chunks/app/layout-af39afc7866e74db.js\"],\"AntdProvider\"]\n8:I[9424,[\"589\",\"static/chunks/589-f984bff035a1cb85.js\",\"105\",\"static/chunks/105-dcd8f6d5867c8995.js\",\"185\",\"static/chunks/app/layout-af39afc7866e74db.js\"],\"SystemSidebar\"]\ne:I[62319,[],\"\"]\n9:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\na:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\nb:{\"display\":\"inline-block\"}\nc:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nf:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L2\",null,{\"buildId\":\"hBLezfvVOMiGqm4V9F15i\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"_not-found\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/10ba1fa1d6ce23a7.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"zh-CN\",\"children\":[\"$\",\"body\",null,{\"className\":\"flex h-screen overflow-hidden bg-gray-50 text-gray-900\",\"children\":[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$L7\",null,{\"children\":[[\"$\",\"$L8\",null,{}],[\"$\",\"main\",null,{\"className\":\"flex-1 overflow-hidden\",\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$9\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$a\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$b\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$c\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]]}]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$Ld\"],\"globalErrorComponent\":\"$e\",\"missingSlots\":\"$Wf\"}]\n"])</script><script>self.__next_f.push([1,"d:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"HunterMate 采集仪表盘\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"HunterMate 采集/解析/入库仪表盘\"}]]\n3:null\n"])</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d94bef85-19b8-4754-8ff1-524e1467ad51",e._sentryDebugIdIdentifier="sentry-dbid-d94bef85-19b8-4754-8ff1-524e1467ad51")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[253],{94518:function(e,t,n){n.d(t,{m:function(){return r}});var l=n(72835);function r(e){let{filterBar:t,listPanel:n,detailPanel:r}=e;return(0,l.jsxs)("div",{className:"flex h-full",children:[(0,l.jsxs)("div",{className:"flex w-80 flex-col border-r border-gray-200 bg-white",children:[t,n]}),(0,l.jsx)("div",{className:"flex-1 overflow-auto bg-gray-50 p-6",children:r})]})}},63718:function(e,t,n){n.d(t,{L:function(){return a}});var l=n(72835),r=n(60635);function a(e){let{items:t,selectedId:n,onSelect:a,loading:s,emptyText:i="暂无数据",onLoadMore:c,loadingMore:u,exhausted:o}=e,d=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!c)return;let e=d.current;if(!e)return;let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&c()},{root:e.closest(".overflow-auto"),rootMargin:"200px"});return t.observe(e),()=>t.disconnect()},[c]),(0,l.jsxs)("div",{className:"flex-1 overflow-auto",children:[s?(0,l.jsx)("div",{className:"p-4 text-center text-sm text-gray-400",children:"加载中…"}):0===t.length?(0,l.jsx)("div",{className:"p-4 text-center text-sm text-gray-400",children:i}):(0,l.jsx)("ul",{className:"divide-y divide-gray-100",children:t.map(e=>(0,l.jsx)("li",{role:"button",tabIndex:0,onClick:()=>a(e.id),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&a(e.id)},className:"cursor-pointer px-3 py-2 text-sm transition-colors ".concat(n===e.id?"bg-blue-50":"hover:bg-gray-50"),children:e.content},e.id))}),c&&!s&&t.length>0&&(0,l.jsx)("div",{ref:d,className:"p-3 text-center text-xs text-gray-400",children:u?"加载更多…":o?"没有更多了":""})]})}},27828:function(e,t,n){n.d(t,{dy:function(){return f},rY:function(){return g},h5:function(){return x},oj:function(){return i}});var l=n(72835),r=n(84704);function a(e){return String(e).padStart(2,"0")}function s(e){let{value:t}=e;if(!t)return null;let n=new Date(t);return Number.isNaN(n.getTime())?null:(0,l.jsx)("span",{title:function(e){let t="string"==typeof e?new Date(e):e;return Number.isNaN(t.getTime())?"":"".concat(t.getFullYear(),"/").concat(a(t.getMonth()+1),"/").concat(a(t.getDate())," ")+"".concat(a(t.getHours()),":").concat(a(t.getMinutes()),":").concat(a(t.getSeconds()))}(n),className:"cursor-default",children:function(e,t){let n="string"==typeof e?new Date(e):e,l=n.getTime();if(Number.isNaN(l))return"";let r=Math.floor(Math.max(0,t.getTime()-l)/6e4);if(r<1)return"刚刚";if(r<60)return"".concat(r," 分钟前");let s=Math.floor(r/60);if(s<24)return"".concat(s," 小时前");let i=Math.floor((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime())/864e5);return i<=1?"昨天":i<30?"".concat(i," 天前"):"".concat(n.getFullYear(),"/").concat(a(n.getMonth()+1),"/").concat(a(n.getDate()))}(n,new Date)})}function i(e){let{name:t,headline:n,source:r,updatedAt:a}=e;return(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("div",{className:"font-medium text-gray-900",children:t}),n?(0,l.jsx)("div",{className:"truncate text-xs text-gray-500",children:n}):null,(0,l.jsxs)("div",{className:"mt-0.5 flex items-center gap-2 text-xs text-gray-400",children:[r?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{children:r}),(0,l.jsx)("span",{children:"\xb7"})]}):null,(0,l.jsx)(s,{value:a})]})]})}let c={active:"启动中",closed:"结束"},u={recommended:"推荐人才",pending_invite:"待邀请",invited:"已邀请待回复",replied:"已回复待筛选",to_client:"待推荐给客户",interview_pending:"已推荐待安排面试",interview_scheduled:"已安排面试",offer_pending:"待offer",onboarding:"待上班",rejected:"不合适"};function o(e){let{stages:t}=e,n=Object.keys(t).filter(e=>{var n,l;return(null!==(l=null===(n=t[e])||void 0===n?void 0:n.total)&&void 0!==l?l:0)>0});return n.length?(0,l.jsx)("div",{className:"mt-1 flex flex-wrap items-center gap-1",children:n.map(e=>{var n;let r=t[e],a=null!==(n=u[e])&&void 0!==n?n:e;return(0,l.jsxs)("span",{title:"".concat(a," 今天").concat(r.today,"/本周").concat(r.week,"/全部").concat(r.total),className:"rounded bg-[color:var(--brand-soft)] px-1.5 py-0.5 text-[10px] font-medium",style:{color:"var(--brand)"},children:[a," ",r.today,"/",r.week,"/",r.total]},e)})}):null}function d(e){let{platforms:t}=e;return t.length?(0,l.jsx)("span",{className:"flex items-center gap-0.5",title:t.join("、"),children:t.map(e=>{let t=(0,r.mS)(e);return(0,l.jsx)("span",{title:e,className:"flex h-4 w-4 items-center justify-center rounded bg-[color:var(--brand-soft)] text-[9px] font-semibold",style:{color:t.fg},children:t.label},e)})}):null}function f(e){var t,n;let{title:r,status:a,hmhLocal:i,subtitle:u,customerName:f,opName:x,rsNames:g,time:h,updatedAt:m,createdAt:p,stages:v,platforms:y,myRole:b}=e,j=null!==(t=null!=m?m:h)&&void 0!==t?t:"",N=null!=p?p:"",w=!!j&&!!N&&1e3>Math.abs(new Date(j).getTime()-new Date(N).getTime());return(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"truncate font-medium text-gray-900",children:r}),(0,l.jsx)("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-xs ".concat("active"===a?"bg-emerald-100 text-emerald-700":"bg-gray-100 text-gray-500"),children:null!==(n=c[a])&&void 0!==n?n:a}),i?(0,l.jsx)("span",{className:"shrink-0 rounded bg-purple-100 px-1.5 py-0.5 text-xs text-purple-700",children:"本地"}):null,"op"===b?(0,l.jsx)("span",{className:"shrink-0 rounded bg-blue-100 px-1.5 py-0.5 text-xs text-blue-700",children:"op"}):null,"rs"===b?(0,l.jsx)("span",{className:"shrink-0 rounded bg-cyan-100 px-1.5 py-0.5 text-xs text-cyan-700",children:"rs"}):null,y?(0,l.jsx)(d,{platforms:y}):null]}),u?(0,l.jsx)("div",{className:"truncate text-xs text-gray-500",children:u}):null,void 0!==f?(0,l.jsx)("div",{className:"truncate text-xs text-gray-500",children:f}):null,x||g&&g.length?(0,l.jsxs)("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 text-xs text-gray-500",children:[x?(0,l.jsxs)("span",{children:["op:",(0,l.jsx)("span",{className:"text-gray-700",children:x})]}):null,g&&g.length?(0,l.jsxs)("span",{children:["rs:",(0,l.jsx)("span",{className:"text-gray-700",children:g.join("、")})]}):null]}):null,v?(0,l.jsx)(o,{stages:v}):null,j?(0,l.jsxs)("div",{className:"mt-0.5 flex items-center justify-between gap-2 text-xs text-gray-400",children:[(0,l.jsx)(s,{value:j}),N&&!w?(0,l.jsx)(s,{value:N}):null]}):null]})}function x(e){var t;let{name:n,headline:r,overall:a,invitationChannel:i,updatedAt:c}=e;return(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"font-medium text-gray-900",children:n}),null!=a?(0,l.jsxs)("span",{className:"rounded bg-emerald-100 px-1.5 py-0.5 text-xs text-emerald-700",children:[a,"分"]}):null,i?(0,l.jsx)("span",{className:"rounded bg-sky-100 px-1.5 py-0.5 text-xs text-sky-700",children:null!==(t=({email:"邮件",linkedin:"LinkedIn",wechat:"微信"})[i])&&void 0!==t?t:i}):null]}),r?(0,l.jsx)("div",{className:"truncate text-xs text-gray-500",children:r}):null,(0,l.jsx)("div",{className:"mt-0.5 text-xs text-gray-400",children:(0,l.jsx)(s,{value:c})})]})}function g(e){let{title:t,source:n,company:r,sourceUrl:a,updatedAt:i}=e;return(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"font-medium text-gray-900",children:t}),(0,l.jsx)("span",{className:"rounded bg-blue-100 px-1.5 py-0.5 text-xs text-blue-700",children:n})]}),r?(0,l.jsx)("div",{className:"truncate text-xs text-gray-500",children:r}):null,(0,l.jsxs)("div",{className:"mt-0.5 flex items-center gap-2 text-xs text-gray-400",children:[(0,l.jsx)(s,{value:i}),a?(0,l.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",className:"text-blue-500 hover:underline",onClick:e=>e.stopPropagation(),children:"来源"}):null]})]})}},26119:function(e,t,n){n.d(t,{B:function(){return s}});var l=n(72835),r=n(60635),a=n(82182);function s(e){let[t,n]=(0,r.useState)(new Set),[s,i]=(0,r.useState)(null),[c,u]=(0,r.useState)(!1),[o,d]=(0,r.useState)(null),f=(0,r.useCallback)(e=>{n(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),x=(0,r.useCallback)(e=>{let t=new Set(e);n(e=>{let n=new Set(Array.from(e).filter(e=>t.has(e)));return n.size===e.size?e:n})},[]),g=(0,r.useCallback)(()=>n(new Set),[]),h=(0,r.useCallback)(e=>(0,l.jsx)("input",{type:"checkbox",className:"mt-1 accent-blue-600",checked:t.has(e),onChange:()=>f(e),onClick:e=>e.stopPropagation()}),[t,f]),m=(0,r.useCallback)(async()=>{if(!s)return;u(!0),d(null);let t=s.ids;try{var l,r;let s=await fetch(e.deleteUrl,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:t})});if(!s.ok){let l=await s.json().catch(()=>null),i=null==l?void 0:l.message;if(401===s.status){d("登录已过期,请在弹窗中重新登录;登录后自动继续删除"),(0,a.jr)({message:"string"==typeof i?i:"登录已过期,请重新登录",oldUserId:null!==(r=e.currentUserId)&&void 0!==r?r:null,retry:async()=>{var l;let r=await fetch(e.deleteUrl,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:t})});if(!r.ok){let e=await r.json().catch(()=>null),t=null==e?void 0:e.message;return d("string"==typeof t?t:"续跑删除仍失败,请稍后重试"),!1}return n(new Set),d("已删除 ".concat(t.length," 条")),null===(l=e.onDeleted)||void 0===l||l.call(e),!0}});return}d("string"==typeof i?i:"操作失败,请稍后重试");return}n(new Set),d("已删除 ".concat(t.length," 条")),null===(l=e.onDeleted)||void 0===l||l.call(e)}finally{u(!1),i(null)}},[s,e.deleteUrl,e.onDeleted,e.currentUserId]),p=(0,r.useCallback)(e=>(0,l.jsxs)("div",{className:"flex items-center gap-3 border-t border-gray-100 px-3 py-2",children:[(0,l.jsxs)("label",{className:"flex items-center gap-1.5 text-sm text-gray-600",children:[(0,l.jsx)("input",{type:"checkbox",className:"accent-blue-600",checked:e.length>0&&t.size===e.length,onChange:()=>n(t=>t.size===e.length&&e.length>0?new Set:new Set(e.map(e=>String(e.id))))}),"全选"]}),t.size>0&&(0,l.jsxs)("span",{className:"flex items-center gap-2 text-sm",children:[(0,l.jsxs)("span",{className:"text-gray-500",children:["已选 ",t.size," 条"]}),(0,l.jsx)("button",{type:"button",onClick:()=>i({ids:Array.from(t).map(Number)}),className:"rounded-lg bg-red-600 px-3 py-1 text-white hover:bg-red-700",children:"删除"})]}),o&&(0,l.jsx)("span",{className:"text-xs text-green-600",children:o})]}),[t,o]);return{selectedIds:t,checkbox:h,prune:x,bar:p,modal:(0,r.useCallback)(()=>s?(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:(0,l.jsxs)("div",{className:"w-96 rounded-xl bg-white p-6 shadow-xl",children:[(0,l.jsx)("h3",{className:"text-base font-semibold text-gray-900",children:"删除确认"}),(0,l.jsxs)("p",{className:"mt-3 text-sm text-gray-600",children:["确定删除选中的 ",s.ids.length," 条",e.label,"吗?删除后不能自行恢复;如误删,请联系管理员找回。"]}),(0,l.jsxs)("div",{className:"mt-6 flex justify-end gap-2",children:[(0,l.jsx)("button",{type:"button",disabled:c,onClick:()=>i(null),className:"rounded-lg px-4 py-1.5 text-sm text-gray-600 hover:bg-gray-100",children:"取消"}),(0,l.jsx)("button",{type:"button",disabled:c,onClick:()=>void m(),className:"rounded-lg bg-red-600 px-4 py-1.5 text-sm text-white hover:bg-red-700 disabled:opacity-50",children:c?"处理中…":"确定"})]})]})}):null,[s,c,m,e.label]),clear:g}}},93464:function(e,t,n){n.d(t,{k:function(){return r}});var l=n(60635);function r(e){var t,n,r;let a=null!==(t=e.pageSize)&&void 0!==t?t:50,[s,i]=(0,l.useState)([]),[c,u]=(0,l.useState)(0),[o,d]=(0,l.useState)(!0),[f,x]=(0,l.useState)(!1),[g,h]=(0,l.useState)(null),m=(0,l.useRef)(0),p=(0,l.useRef)(!1),v=(0,l.useRef)([]),y=null!==(n=e.byKey)&&void 0!==n?n:e=>String(e.id),b=(0,l.useRef)(0),j=(0,l.useCallback)(async(t,n)=>{let l=++m.current;0===t?d(!0):x(!0),h(null);try{var r;let s=await e.fetchPage(t,a);if(l!==m.current)return;b.current=null!==(r=s.nextOffset)&&void 0!==r?r:t+s.items.length,n&&0===s.items.length?u(e=>Math.min(e,v.current.length)):u(s.total),i(e=>{if(!n)return s.items;let t=new Set(e.map(y));return[...e,...s.items.filter(e=>!t.has(y(e)))]})}catch(e){if(l!==m.current)return;h(e instanceof Error?e.message:"加载失败")}finally{l===m.current&&(d(!1),x(!1),p.current=!1)}},[e.fetchPage,a]);(0,l.useEffect)(()=>{p.current=!0,j(0,!1)},[j,...null!==(r=e.deps)&&void 0!==r?r:[]]),(0,l.useEffect)(()=>{v.current=s},[s]);let N=(0,l.useCallback)(()=>{!p.current&&(v.current.length>=c||(p.current=!0,j(b.current,!0)))},[j,c]),w=(0,l.useCallback)(()=>{p.current=!0,b.current=0,j(0,!1)},[j]);return{items:s,total:c,loading:o,loadingMore:f,exhausted:!o&&s.length>=c,error:g,loadMore:N,refresh:w}}},65777:function(e,t,n){let l;n.d(t,{Cd:function(){return S},Xc:function(){return C},aG:function(){return w},cp:function(){return k},nu:function(){return N},tQ:function(){return E}});var r=n(60635),a=n(74431),s=n(67002),i=n(60529);let c=null,u=null,o=null,d=new Set;function f(){d.forEach(e=>e())}function x(e){c=c?{...c,refreshing:e}:{...y,refreshing:e},f()}async function g(){try{return await (0,a.aA)("/auth/session")}catch(e){return null}}async function h(e){let t=new Headers,n=(0,s.Xc)();n&&t.set("Authorization","UTOKEN ".concat(n));try{return await (0,a.aA)(e,{headers:t})}catch(e){return null}}async function m(){x(!0);try{var e;let[t,n]=await Promise.all([g(),h("/datasync/state")]),r=(null==t?void 0:t.loggedIn)&&t.token?t.token:null,a=null!=n?n:null;!a&&t&&r&&r!==(0,s.Xc)()?((0,s.GK)(r),a=await h("/datasync/state")):(0,s.GK)(r),function(e){if(void 0===l){l=e;return}if(e!==l){l=e;try{window.localStorage.removeItem("hm-view-mode")}catch(e){}}}((null==t?void 0:t.loggedIn)&&null!==(e=t.hmUserId)&&void 0!==e?e:null);let i=!!((null==t?void 0:t.loggedIn)||(null==a?void 0:a.loggedIn));if(!t&&!a){c=c?{...c,loadError:"本地服务无响应"}:{...y,loadError:"本地服务无响应"},f();return}c={session:null!=t?t:{loggedIn:!1},sync:a,utoken:(0,s.Xc)(),loadError:null,refreshing:!1,authStatus:i?"in":"out",refresh:p},f()}finally{(null==c?void 0:c.refreshing)&&x(!1)}}function p(){return u||(u=m().finally(()=>{u=null}))}function v(e){return d.add(e),1===d.size&&(p(),o=setInterval(()=>void p(),6e4)),()=>{d.delete(e),0===d.size&&o&&(clearInterval(o),o=null)}}let y={session:null,sync:null,utoken:null,loadError:null,refreshing:!1,authStatus:"loading",refresh:p};function b(){return null!=c?c:y}function j(){return b()}function N(){return(0,r.useSyncExternalStore)(v,b,j)}function w(e){var t;return(null!==(t=null==e?void 0:e.memberships)&&void 0!==t?t:[]).filter(e=>!e.isPersonal&&!e.leftAt)}function k(e){var t,n;let l=null!==(t=null==e?void 0:e.activeTenantId)&&void 0!==t?t:null;if(null==l)return null;let r=(null!==(n=null==e?void 0:e.memberships)&&void 0!==n?n:[]).find(e=>e.tenantId===l&&!e.leftAt);return!r||r.isPersonal?null:l}function S(e,t){var n,l;if(!t)return null;let r=(null!==(n=null==e?void 0:e.memberships)&&void 0!==n?n:[]).find(e=>e.tenantId===t&&!e.leftAt&&!e.isPersonal);return null!==(l=null==r?void 0:r.role)&&void 0!==l?l:null}function E(){return i.env.NEXT_PUBLIC_HUNTER_MATE_SERVER_URL||""}function C(){return(0,s.Xc)()}},82182:function(e,t,n){n.d(t,{H7:function(){return o},jr:function(){return s},mn:function(){return u},nk:function(){return c},qd:function(){return i}});let l=null,r=new Set;function a(){r.forEach(e=>e())}function s(e){l=e,a()}function i(){l&&(l=null,a())}function c(){return l}function u(e){return r.add(e),()=>r.delete(e)}function o(e){if(!e)return null;try{var t,n,l,r,a;let s=e.split(".")[1],i=JSON.parse(decodeURIComponent(escape(atob(s.replace(/-/g,"+").replace(/_/g,"/"))))),c=null!==(a=null!==(r=null!==(l=null==i?void 0:null===(t=i.data)||void 0===t?void 0:t._id)&&void 0!==l?l:null==i?void 0:null===(n=i.data)||void 0===n?void 0:n.id)&&void 0!==r?r:null==i?void 0:i.sub)&&void 0!==a?a:null;return"number"==typeof c?c:null}catch(e){return null}}},8448:function(e,t,n){n.d(t,{d3:function(){return l}});function l(e){return e?("string"==typeof e?new Date(e):e).toLocaleString("zh-CN",{hour12:!1}):""}},74431:function(e,t,n){n.d(t,{Ox:function(){return a},aA:function(){return c}});var l=n(67002),r=n(60529);function a(){return r.env.HUNTER_MATE_SERVER_URL||""}let s=a();class i extends Error{constructor(e,t,n){super(null!=n?n:"请求失败(".concat(e,")").concat(t?": ".concat(t):"")),this.status=e,this.path=t,this.name="HttpError"}}async function c(e,t){let n;try{n=await fetch("".concat(s).concat(e),{cache:"no-store",...function(e){let t=(0,l.Xc)();if(!t)return e;let n=new Headers(null==e?void 0:e.headers);return n.has("Authorization")||n.set("Authorization","UTOKEN ".concat(t)),{...e,headers:n}}(t)})}catch(t){throw new i(0,e,t instanceof Error?t.message:"网络错误")}if(!n.ok)throw new i(n.status,e,"HTTP ".concat(n.status));try{return await n.json()}catch(t){throw new i(n.status,e,t instanceof Error?"响应解析失败: ".concat(t.message):"响应解析失败")}}},84704:function(e,t,n){n.d(t,{mS:function(){return r}});let l={linkedin:{label:"in",fg:"#0a66c2"},builtin:{label:"bi",fg:"#5c2d91"},lagou:{label:"拉",fg:"#00b38a"},zhaopin:{label:"智",fg:"#ff7f00"},"51job":{label:"前",fg:"#ff6000"},liepin:{label:"猎",fg:"#008ccb"},boss:{label:"B",fg:"#00bebd"}};function r(e){var t;return null!==(t=l[e.replace(/^www\./,"").split(".")[0].toLowerCase()])&&void 0!==t?t:{label:e.slice(0,1).toUpperCase(),fg:"var(--brand)"}}},67002:function(e,t,n){n.d(t,{GK:function(){return s},Lc:function(){return i},Xc:function(){return a}});let l=null,r=new Set;function a(){return l}function s(e){e!==l&&(l=e,r.forEach(e=>e()))}function i(e){return r.add(e),()=>{r.delete(e)}}}}]);
|