@crvouga/mockingbird-service-checkr

中文文档
1.11.0发布于 2026/11/11MITTypeScriptES Module构建来源已验证近 30 天下载 2898

Stateful Checkr candidates, invitations, hierarchy and report reads.

原始使用文档
文档目录7 节
  1. Install
  2. Usage
  3. Routes
  4. State and controls
  5. Verification
  6. Deliberately not modelled
  7. API

@crvouga/mockingbird-service-checkr

Local emulators. Real API contracts. Part of Mockingbird.

WIP Checkr v1 emulator for synthetic candidates, package/hierarchy enumeration, invitations and seeded report/ETA reads. No checks run, emails are sent or real personal data is needed.

Install

bun add -d @crvouga/mockingbird-service-checkr

Usage

import { createServer } from "@crvouga/mockingbird-service-checkr/server"

// Test setup: the emulator. The application's Checkr origin becomes server.url.
const server = await createServer()
const baseUrl = server.url

// Application code: the request it sends to api.checkr.com, Basic auth with the API key.
const response = await fetch(`${baseUrl}/v1/packages`, {
  headers: { authorization: `Basic ${btoa("mock_checkr_key:")}` },
})
const packages = (await response.json()) as { data: { slug: string }[] }
await server.close()

Inject server.url into the consumer's origin seam; it replaces the production/staging origin, not the /v1 prefix. createRuntime().fetch(Request) supports in-process adapters. Basic auth accepts apiKey (default mock_checkr_key) as username and an empty password.

Routes

GET /v1/packages, /v1/nodes, /v1/candidates, /v1/invitations enumerate with page/per_page and local next_href links. Candidate email and invitation candidate/status filters are supported. POST /v1/candidates and /v1/invitations create records; invitations validate candidate/package references and work locations before storing anything. GET/DELETE /v1/invitations/{id} reads/cancels an invitation. Cancellation is deletion, not an invented canceled status: deleted_at is set, ordinary reads/lists exclude it, and GET ?include_deleted=true exposes it. This follows the documented cancellation/delete and include_deleted mechanism; the reference's generic DELETE response example does not demonstrate post-delete timestamps. Pending invitations expire after seven days by default. GET /v1/reports/{id} and /v1/reports/{id}/eta read seeded reports; missing ETA returns 404.

State and controls

Runtime seeds: packages, nodes, candidates, reports; hierarchyEnabled defaults false, so nodes returns 403 while other APIs work. Enabled hierarchy requires an available node/package on invitation creation. invitationTtlMs and the emulator clock drive expiration. All records and settings are collections in /__admin/state: edit prices, report state/ETA, invitation expiry/completion and hierarchy access without external services. An admin-seeded report is reflected in its candidate's report_ids. The admin controls intentionally do not enforce vendor referential integrity; seed coherent fixtures.

Standard admin reset, Timeline snapshots/branches, clocks and journals are available. Namespaces use x-mockingbird-namespace, /__admin/ns/<name>/…, or mapped Basic credentials; pagination URLs retain the namespace, including relocated adminPrefix paths. Journals retain request metadata only, not candidate data or credentials. Presets: forbidden, hierarchy_denied, rate_limited, server_error, non_json, connection_drop. Generic fault latency and client AbortSignal model deterministic timeouts. No webhooks are implemented or claimed.

Verification

bun test covers each reported behavior through a raw-fetch client port, served HTTP, namespaces/faults/reset, independent OpenAPI walks and deliberately divergent instances. No official SDK is used by this consumer. The port follows the issue's surface; unchanged private app acceptance is not claimed. The official Checkr reference is the oracle; no live credentials or background-check requests were used. CHECKR_API_KEY=… bun run parity safely checks a package-list response shape; without the key it exits 2. It never creates candidates, invitations or reports.

Deliberately not modelled

Actual background screening, criminal records, real PII, invitation email delivery, hosted candidate consent UI, webhook delivery and production adjudication decisions. Reports are explicit synthetic fixtures; no automatic report is created merely by inviting a candidate. Error diagnostic strings and full vendor per-field validation are outside this scoped WIP.

API

Root runtime exports: CheckrAPI, CHECKR_NAMESPACE, DEFAULT_PACKAGES, createRuntime, CHECKR_PRESETS, document, operationIds, supportedOperationIds. Types: Package, Node, Candidate, Invitation, Report, CheckrAPIOptions, CheckrRuntimeOptions, CheckrRuntime, OperationId, SupportedOperationId. The /server entry exports createServer, serveTarget, DEFAULT_PORT.

版本与发布记录

@crvouga/mockingbird-service-checkr 共发布 22 个版本,首次发布于 2026/10/05;过去 12 个月发布了 22 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.11.0latest2026/11/11今天
1.10.92026/11/038 天前
1.10.82026/11/038 天前
1.10.72026/11/038 天前
1.10.62026/11/038 天前
1.10.52026/11/038 天前

关于 @crvouga/mockingbird-service-checkr 的常见问题

@crvouga/mockingbird-service-checkr 是什么?

Stateful Checkr candidates, invitations, hierarchy and report reads.

如何安装 @crvouga/mockingbird-service-checkr?

在项目目录运行 npm install @crvouga/mockingbird-service-checkr,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 mockingbird-checkr,可以用 npx mockingbird-checkr 直接运行。

@crvouga/mockingbird-service-checkr 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@crvouga/mockingbird-service-checkr 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@crvouga/mockingbird-service-checkr 可以商用吗?

@crvouga/mockingbird-service-checkr 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@crvouga/mockingbird-service-checkr 的下载量有多少?

根据 npm 官方下载统计,@crvouga/mockingbird-service-checkr 在 2026/10/11 – 2026/11/09 这 30 天内被下载 2,898 次,日均约 97 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@crvouga/mockingbird-service-checkr 还在维护吗?

最新版本 1.11.0 发布于 2026/11/11(今天);至今共发布 22 个版本,其中过去 12 个月发布了 22 个;首次发布于 2026/10/05。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。