master-zapier-plan-draft/docs/developer/modules/nats.md
George Lambert 85b5b53ea9
Some checks are pending
offline / test (push) Waiting to run
Fix catalog book links and rewrite PDF destinations to live HTTPS.
Module and model book cards now point at generated index.html/index.pdf
instead of directory URLs that 404. WeasyPrint file:// annotations are
mapped to https://zapier.georgelambert.org/ paths that exist. Developer
module, architecture, and research snapshot links target published files.
2026-09-11 22:50:00 -04:00

28 lines
876 B
Markdown

# Module: `nats`
**Path:** `verae-zapier-middleware/src/nats/`
**Phase:** 7
**Debug namespace:** `nats`
## Files
| File | Purpose |
|------|---------|
| `subjects.js` | Subject, stream, consumer name constants |
| `connection.js` | Connect, ensure streams, close |
| `publishers.js` | enqueueWatch, publishJobEvent, enqueueWebhook |
## Function contracts
Full I/O tables: [function-reference.md](function-reference.md#natssubjectsjs)
Payload schemas: [../../02-architecture/nats-subjects.md](../../02-architecture/nats-subjects.md)
## Implementation status
Stubs throw until **GATE 7**. Call sites must check `config.natsEnabled` and fall back to in-process poller (Phase 6).
## Security
- Prefer `tokenRef` over raw Verae JWT in messages.
- All publish paths log via `createDebugger('nats')` with redaction.
- NATS must remain private (not exposed to Zapier).