@hadoku/jobplatform-worker 2.32.18 → 2.32.20

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/index.js CHANGED
@@ -3879,37 +3879,29 @@ function registerFeedbackRoutes(app2) {
3879
3879
  }
3880
3880
  );
3881
3881
  }
3882
+ var EDGE_BASE = "https://hadoku.me";
3882
3883
  async function loadTailoringFields(db, id) {
3883
3884
  return db.prepare("SELECT title, company, description, location, workplace_type FROM jobs WHERE id = ?").bind(id).first();
3884
3885
  }
3886
+ function resumeViaEdge(env, path, init) {
3887
+ if (!env.EDGE) throw new Error("EDGE service binding not configured");
3888
+ const key = env.HADOKU_SERVICE_KEY?.trim();
3889
+ if (!key) throw new Error("HADOKU_SERVICE_KEY not configured");
3890
+ const headers = new Headers(init.headers);
3891
+ headers.set("X-User-Key", key);
3892
+ return env.EDGE.fetch(`${EDGE_BASE}${path}`, { ...init, headers });
3893
+ }
3885
3894
  async function callResumeBinding(env, path, payload) {
3886
- if (!env.RESUME) {
3887
- throw new Error("RESUME service binding not configured");
3888
- }
3889
- return env.RESUME.fetch(`https://resume-api${path}`, {
3895
+ return resumeViaEdge(env, path, {
3890
3896
  method: "POST",
3891
- headers: {
3892
- "Content-Type": "application/json",
3893
- "X-Edge-Auth": env.EDGE_AUTH_SECRET ?? "",
3894
- "X-Hadoku-Tier": "service"
3895
- },
3897
+ headers: { "Content-Type": "application/json" },
3896
3898
  body: JSON.stringify(payload)
3897
3899
  });
3898
3900
  }
3899
3901
  async function fetchMintedResume(env, slug) {
3900
- if (!env.RESUME) {
3901
- throw new Error("RESUME service binding not configured");
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
- );
3902
+ const res = await resumeViaEdge(env, `/resume/api/resume?v=${encodeURIComponent(slug)}`, {
3903
+ method: "GET"
3904
+ });
3913
3905
  if (!res.ok) return { expired: true };
3914
3906
  const body = await res.json();
3915
3907
  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":"AAiBA,OAAO,EAAqD,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AA+F9F,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAsN1D"}
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
@@ -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;IAMnC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAMjB;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CACf"}
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.18",
4
- "gitHead": "c57ef6de26d28ed1beb8f0363a895e3ad950f8ae",
3
+ "version": "2.32.20",
4
+ "gitHead": "f0ff002cee5f8ef57379696ab111f03c0aca586f",
5
5
  "description": "Job listings aggregation and tracking dashboard - Worker package",
6
6
  "license": "MIT",
7
7
  "type": "module",