@carconnect-tech/webhook-contract
v1.0.0
Published
Shared webhook contract: types, normalization, assembler, rendering, and diff utilities
Readme
@carconnect-tech/webhook-contract
Shared webhook contract library for Gatherleads webhook ecosystem.
Modules
contract— Canonical types, enums, and interfaces (WebhookEventV2, LifecycleData, DomainData, etc.)normalization— Source adapters (Mongo change stream, DynamoDB stream, plain object) + DomainMapper interfaceassembler— Event assembly from NormalizedSourceEvent to WebhookEventV2rendering— Version-aware rendering (v2 → v1 byte-compatible)diff— Changed fields computation
Installation
npm install @carconnect-tech/webhook-contractUsage
import {
assembleEvent,
normalizeMongoChangeStream,
computeChangedFields,
} from "@carconnect-tech/webhook-contract";
// Or import specific modules
import { WebhookEventV2, ResourceType } from "@carconnect-tech/webhook-contract/contract";
import { renderForVersion } from "@carconnect-tech/webhook-contract/rendering";Development
npm install
npm run build # Build with tsup (ESM + CJS + .d.ts)
npm run test # Run tests with vitest
npm run lint # ESLint
npm run typecheck # TypeScript type checking
npm run format # PrettierRelease
Automated via semantic-release on push to main. Feature branches publish prerelease versions automatically.
