@hadoku/jobplatform-worker 2.32.19 → 2.32.21
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/clients/mailfeed.d.ts.map +1 -1
- package/dist/index.js +20 -23
- package/dist/routes/jobs/tailoring.d.ts.map +1 -1
- package/dist/types.d.ts +0 -7
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mailfeed.d.ts","sourceRoot":"","sources":["../../src/clients/mailfeed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAI1C,uEAAuE;AACvE,MAAM,WAAW,WAAW;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B;AAED,MAAM,WAAW,QAAQ;IACxB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,SAAS;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,EAAE,CAAC;CACxB;
|
|
1
|
+
{"version":3,"file":"mailfeed.d.ts","sourceRoot":"","sources":["../../src/clients/mailfeed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAI1C,uEAAuE;AACvE,MAAM,WAAW,WAAW;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B;AAED,MAAM,WAAW,QAAQ;IACxB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,SAAS;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,EAAE,CAAC;CACxB;AA0DD;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAEpF;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAClC,GAAG,EAAE,MAAM,EACX,IAAI,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,GACnE,OAAO,CAAC,QAAQ,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAMvC;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,KAAK,IAAI;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAEvF"}
|
package/dist/index.js
CHANGED
|
@@ -834,12 +834,17 @@ const DEFAULT_BASE_URL$1 = "https://hadoku.me/contact/api/mailfeed";
|
|
|
834
834
|
function baseUrl$1(env) {
|
|
835
835
|
return (env.MAILFEED_BASE_URL ?? DEFAULT_BASE_URL$1).replace(/\/$/, "");
|
|
836
836
|
}
|
|
837
|
+
function feedFetch(env, url, init) {
|
|
838
|
+
if (env.MAILFEED_BASE_URL) return fetch(url, init);
|
|
839
|
+
if (!env.EDGE) throw new Error("EDGE service binding not configured");
|
|
840
|
+
return env.EDGE.fetch(url, init);
|
|
841
|
+
}
|
|
837
842
|
async function get(env, path) {
|
|
838
843
|
const key = env.HADOKU_SERVICE_KEY;
|
|
839
844
|
if (!key) return { error: "HADOKU_SERVICE_KEY is not bound — cannot read the mail feed" };
|
|
840
845
|
let res;
|
|
841
846
|
try {
|
|
842
|
-
res = await
|
|
847
|
+
res = await feedFetch(env, `${baseUrl$1(env)}${path}`, { headers: { "X-User-Key": key } });
|
|
843
848
|
} catch (err) {
|
|
844
849
|
return { error: `mail feed unreachable: ${err instanceof Error ? err.message : String(err)}` };
|
|
845
850
|
}
|
|
@@ -3879,37 +3884,29 @@ function registerFeedbackRoutes(app2) {
|
|
|
3879
3884
|
}
|
|
3880
3885
|
);
|
|
3881
3886
|
}
|
|
3887
|
+
var EDGE_BASE = "https://hadoku.me";
|
|
3882
3888
|
async function loadTailoringFields(db, id) {
|
|
3883
3889
|
return db.prepare("SELECT title, company, description, location, workplace_type FROM jobs WHERE id = ?").bind(id).first();
|
|
3884
3890
|
}
|
|
3891
|
+
function resumeViaEdge(env, path, init) {
|
|
3892
|
+
if (!env.EDGE) throw new Error("EDGE service binding not configured");
|
|
3893
|
+
const key = env.HADOKU_SERVICE_KEY?.trim();
|
|
3894
|
+
if (!key) throw new Error("HADOKU_SERVICE_KEY not configured");
|
|
3895
|
+
const headers = new Headers(init.headers);
|
|
3896
|
+
headers.set("X-User-Key", key);
|
|
3897
|
+
return env.EDGE.fetch(`${EDGE_BASE}${path}`, { ...init, headers });
|
|
3898
|
+
}
|
|
3885
3899
|
async function callResumeBinding(env, path, payload) {
|
|
3886
|
-
|
|
3887
|
-
throw new Error("RESUME service binding not configured");
|
|
3888
|
-
}
|
|
3889
|
-
return env.RESUME.fetch(`https://resume-api${path}`, {
|
|
3900
|
+
return resumeViaEdge(env, path, {
|
|
3890
3901
|
method: "POST",
|
|
3891
|
-
headers: {
|
|
3892
|
-
"Content-Type": "application/json",
|
|
3893
|
-
"X-Edge-Auth": env.EDGE_AUTH_SECRET ?? "",
|
|
3894
|
-
"X-Hadoku-Tier": "service"
|
|
3895
|
-
},
|
|
3902
|
+
headers: { "Content-Type": "application/json" },
|
|
3896
3903
|
body: JSON.stringify(payload)
|
|
3897
3904
|
});
|
|
3898
3905
|
}
|
|
3899
3906
|
async function fetchMintedResume(env, slug) {
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
}
|
|
3903
|
-
const res = await env.RESUME.fetch(
|
|
3904
|
-
`https://resume-api/resume/api/resume?v=${encodeURIComponent(slug)}`,
|
|
3905
|
-
{
|
|
3906
|
-
method: "GET",
|
|
3907
|
-
headers: {
|
|
3908
|
-
"X-Edge-Auth": env.EDGE_AUTH_SECRET ?? "",
|
|
3909
|
-
"X-Hadoku-Tier": "service"
|
|
3910
|
-
}
|
|
3911
|
-
}
|
|
3912
|
-
);
|
|
3907
|
+
const res = await resumeViaEdge(env, `/resume/api/resume?v=${encodeURIComponent(slug)}`, {
|
|
3908
|
+
method: "GET"
|
|
3909
|
+
});
|
|
3913
3910
|
if (!res.ok) return { expired: true };
|
|
3914
3911
|
const body = await res.json();
|
|
3915
3912
|
if (!body.variant || !body.content) return { expired: true };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tailoring.d.ts","sourceRoot":"","sources":["../../../src/routes/jobs/tailoring.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tailoring.d.ts","sourceRoot":"","sources":["../../../src/routes/jobs/tailoring.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAqD,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAmG9F,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAsN1D"}
|
package/dist/types.d.ts
CHANGED
|
@@ -41,13 +41,6 @@ export interface AppEnv {
|
|
|
41
41
|
* = admin only. hadoku_site sets it to the scraper's apply queue.
|
|
42
42
|
*/
|
|
43
43
|
ON_BEHALF_CALLER_USER_IDS?: string;
|
|
44
|
-
/**
|
|
45
|
-
* Cloudflare service binding to the resume-api worker, declared in
|
|
46
|
-
* hadoku_site wrangler.toml as [[services]] binding="RESUME" service="resume-api".
|
|
47
|
-
* Bypasses the public edge; calls stamp X-Edge-Auth (= EDGE_AUTH_SECRET) +
|
|
48
|
-
* X-Hadoku-Tier: service so resume-api's in-worker gate admits them.
|
|
49
|
-
*/
|
|
50
|
-
RESUME?: Fetcher;
|
|
51
44
|
/**
|
|
52
45
|
* Service binding to edge-router, for ONE question: what userId does this
|
|
53
46
|
* display name belong to. Declared in hadoku_site wrangler.toml as
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAErE,MAAM,WAAW,MAAM;IAKtB,4EAA4E;IAC5E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAM1B,8EAA8E;IAC9E,eAAe,EAAE,UAAU,CAAC;IAM5B;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,+EAA+E;IAC/E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAM1B;;;;;;;;;OASG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;;;;;;OASG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;;;;OAIG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAErE,MAAM,WAAW,MAAM;IAKtB,4EAA4E;IAC5E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAM1B,8EAA8E;IAC9E,eAAe,EAAE,UAAU,CAAC;IAM5B;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,+EAA+E;IAC/E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAM1B;;;;;;;;;OASG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;;;;;;OASG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;;;;OAIG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAUnC;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CACf"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hadoku/jobplatform-worker",
|
|
3
|
-
"version": "2.32.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "2.32.21",
|
|
4
|
+
"gitHead": "31c61f8415f9704f771c475cf87f9ea240bf68de",
|
|
5
5
|
"description": "Job listings aggregation and tracking dashboard - Worker package",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|