Files
santifer--career-ops/plugins/_template/index.mjs
T
wehub-resource-sync d083df1fdb
CodeQL Analysis / Analyze (javascript-typescript) (push) Failing after 2s
Web CI / web typecheck + build (push) Failing after 1s
Release Please / release-please (push) Failing after 1s
CodeQL Analysis / Analyze (go) (push) Failing after 16s
chore: import upstream snapshot with attribution
2026-07-13 12:02:43 +08:00

23 lines
1.1 KiB
JavaScript

// @ts-check
// {{NAME}} — a career-ops plugin.
// Guide: https://github.com/santifer/career-ops/blob/main/docs/PLUGINS.md
//
// Rules the engine enforces for you:
// - Egress ONLY through ctx.fetch / ctx.fetchJson / ctx.fetchText (your manifest
// `allowedHosts` is applied + SSRF-guarded). Do NOT import node:http/net or
// call global fetch — community plugins are rejected for that.
// - Producers (provider/ingest/search) RETURN Job[] = { title, url, company, location };
// the engine writes them to the pipeline. Consumers (export/notify) push to
// the user's own store. There is no auto-submit hook.
// - Keys come from ctx.env (declare them in manifest.requiredEnv); non-secret
// settings come from ctx.settings (the user's config/plugins.yml block).
export default {
// Replace/add hooks to match manifest.hooks. Example ingest:
async ingest(ctx) {
// const data = await ctx.fetchJson('https://api.example.com/jobs');
// return data.results.map(j => ({ title: j.title, url: j.url, company: j.company, location: j.location || '' }));
return [];
},
};