Generic handler now accepts options (transformUrl, formDetector, submitSelector, resumeSelector, beforeSubmit, verifySelector, etc.). Each ATS handler passes its overrides instead of reimplementing. Registry resolves handlers by: apply_type -> URL domain -> generic fallback. New ATS handlers only need to export SUPPORTED_TYPES and an apply() that calls genericApply with platform-specific options. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
24 lines
935 B
JavaScript
24 lines
935 B
JavaScript
/**
|
|
* ashby.mjs — Ashby ATS handler (extends generic)
|
|
*/
|
|
import { apply as genericApply } from './generic.mjs';
|
|
|
|
export const SUPPORTED_TYPES = ['ashby'];
|
|
|
|
export async function apply(page, job, formFiller) {
|
|
return genericApply(page, job, formFiller, {
|
|
transformUrl: (url) => url.includes('/application') ? url : url.replace(/\/?(\?|$)/, '/application$1'),
|
|
formDetector: '#_systemfield_name',
|
|
applyButtonSelector: 'button:has-text("Apply for this Job"), a:has-text("Apply for this Job")',
|
|
submitSelector: 'button:has-text("Submit Application")',
|
|
verifySelector: '#_systemfield_name',
|
|
beforeSubmit: async (page, formFiller) => {
|
|
const resumeInput = await page.$('#_systemfield_resume');
|
|
if (resumeInput && formFiller.profile.resume_path) {
|
|
await resumeInput.setInputFiles(formFiller.profile.resume_path).catch(() => {});
|
|
await page.waitForTimeout(1000);
|
|
}
|
|
},
|
|
});
|
|
}
|