Skip to content

feat: Ashby adapter for fetch-jd.ts - #91

Closed
Samhit21 wants to merge 1 commit into
mainfrom
sa/ashby-adapter-74
Closed

feat: Ashby adapter for fetch-jd.ts#91
Samhit21 wants to merge 1 commit into
mainfrom
sa/ashby-adapter-74

Conversation

@Samhit21

Copy link
Copy Markdown
Collaborator

Summary

  • Adds Ashby to src/lib/jd-match/fetch-jd.ts's dispatch table — fifth platform after Greenhouse, Lever, Workable, Recruitee. Follows the existing adapter shape so the public surface (fetchJdFromUrl) doesn't change.
  • URL parser matches jobs.ashbyhq.com/{token}/{uuid} and pulls out token (job-board slug, becomes company) + the UUID jobId. UUID-strict so non-UUID tails fall through instead of producing a 404 on the API.
  • Fetcher hits https://api.ashbyhq.com/posting-api/job-board/{token} — public, no auth, CORS-open — finds the posting by id, returns title / company / descriptionHtml. The shared htmlToPlaintext strip on the way out is reused.

Files

  • src/lib/jd-match/fetch-jd.tsAtsPlatform union, parseAshbyUrl, fetchAshbyJob, dispatch entry.
  • src/lib/jd-match/fetch-jd.test.ts — URL parse test + non-UUID rejection + mocked-fetch end-to-end (happy path, missing-id, non-2xx).

Test plan

  • npm run test — 347/347 green (+3 new)
  • npm run typecheck — clean
  • npm run build — clean
  • Manual: paste a real Ashby URL, confirm the textarea populates and the JD-match panel scores it (deferred until JD URL input + honest host-aware fallback, wire to setJdText #75's URL-input wiring lands; same as the other adapters).

Refs #74

🤖 Generated with Claude Code

Add Ashby to the ATS-fetch dispatch table:

- URL parse: `jobs.ashbyhq.com/{token}/{uuid}` → { token, uuid }.
  jobId pattern is strict (UUID v4 shape), so a non-UUID tail falls
  through to the next parser instead of producing a 404 on the API.
- Fetch: `https://api.ashbyhq.com/posting-api/job-board/{token}`
  returns the whole board; find the posting by id, return
  title / company / descriptionHtml. CORS open, no auth.

Tests:
- URL parser test (matches existing adapter style).
- Negative URL parse test for non-UUID jobId.
- Mocked-fetch end-to-end test asserting the API URL, the picked-up
  posting, and that the descriptionHtml is plaintext on the way out.
- Mocked tests for the missing-id and non-2xx fallbacks (return null).

Refs #74

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Samhit21 Samhit21 closed this Jun 15, 2026
@Samhit21
Samhit21 deleted the sa/ashby-adapter-74 branch June 15, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant