job-pro 1.0.34 → 1.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +25 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -716,6 +716,25 @@ async function runCompany(adapter, company, rawArgs) {
716
716
  message: `${staged.unanswered_required.length} required field(s) still unanswered; refusing to submit incomplete application`,
717
717
  }, compact);
718
718
  }
719
+ // Speculative-endpoint gate (4th safety layer). 19 of 22 bespoke
720
+ // multipart-session endpoints returned 404 on no-auth probe — the
721
+ // inferred URLs are wrong guesses. Refusing by default prevents
722
+ // accidental fires against broken endpoints; users who *want* to
723
+ // shake out what the real endpoint should be opt in via env.
724
+ const allowSpeculative = process.env.JOB_PRO_ALLOW_SPECULATIVE_ENDPOINT === "yes";
725
+ if (staged.submit_kind !== "external" && staged.submit_kind !== "multipart-anon" && staged.endpoint_verified !== true && !allowSpeculative) {
726
+ return emit({
727
+ ok: false,
728
+ source: company,
729
+ post_id: postId,
730
+ mode: "really-submit-blocked",
731
+ staged,
732
+ message: `submit_endpoint for ${company} is speculative — inferred from JS-bundle recon, ` +
733
+ `not end-to-end verified. Most such endpoints (19 of 22 probed) are wrong and ` +
734
+ `would 4xx. Verify with \`apply ${postId} --debug-submit-to <your-echo-url>\` first, ` +
735
+ `or set \`JOB_PRO_ALLOW_SPECULATIVE_ENDPOINT=yes\` if you're knowingly probing.`,
736
+ }, compact);
737
+ }
719
738
  // Submission flow selection by submit_kind. Only the generic
720
739
  // multipart families are wired to actually fire today; everything
721
740
  // else gets a useful refusal message.
@@ -776,6 +795,9 @@ async function runCompany(adapter, company, rawArgs) {
776
795
  }, compact);
777
796
  }
778
797
  const result = await familyExecutor(staged, session, { kind: "upstream" });
798
+ if (result.ok) {
799
+ memoryEvent("applied", `${company} ${postId} — ${staged.job_title}`);
800
+ }
779
801
  return emit({ mode: "really-submit", staged, submit_kind: kind, session_used: true, result }, compact);
780
802
  }
781
803
  if (!isGenericMultipart) {
@@ -825,6 +847,9 @@ async function runCompany(adapter, company, rawArgs) {
825
847
  }
826
848
  }
827
849
  const result = await submitApplication(staged, { kind: "upstream" }, { session });
850
+ if (result.ok) {
851
+ memoryEvent("applied", `${company} ${postId} — ${staged.job_title}`);
852
+ }
828
853
  return emit({ mode: "really-submit", staged, submit_kind: kind, session_used: !!session, result }, compact);
829
854
  }
830
855
  // Default: dry-run print, no network.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "job-pro",
3
- "version": "1.0.34",
3
+ "version": "1.0.36",
4
4
  "description": "Query Chinese big-tech campus recruiting from your terminal. 50 companies, all 50 live. 46 via each company's own API; the 4 with no public canonical feed (Hikvision, CICC, Cainiao, WeBank) surfaced via Liepin as a clearly-labeled third-party fallback. No signup, no token, no server.",
5
5
  "homepage": "https://job.ha7ch.com",
6
6
  "repository": "https://github.com/HA7CH/job-pro",