Initial import of verae-middleware from zapier monorepo
This commit is contained in:
commit
fb6db30e0e
66 changed files with 6590 additions and 0 deletions
47
src/nats/subjects.js
Normal file
47
src/nats/subjects.js
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/**
|
||||
* @fileoverview NATS subject and stream name constants.
|
||||
* @module nats/subjects
|
||||
*
|
||||
* See docs/architecture/nats-subjects.md for payload schemas.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Subject strings used by publishers and consumers.
|
||||
* @readonly
|
||||
*/
|
||||
export const SUBJECTS = Object.freeze({
|
||||
/** Work queue: poll Verae job status */
|
||||
JOBS_WATCH: 'verae.zapier.jobs.watch',
|
||||
/** Terminal job outcomes */
|
||||
JOBS_EVENTS: 'verae.zapier.jobs.events',
|
||||
/** Work queue: HTTP POST to Zapier REST Hooks */
|
||||
WEBHOOKS_DELIVER: 'verae.zapier.webhooks.deliver',
|
||||
/** Optional metering stream */
|
||||
USAGE: 'verae.zapier.usage',
|
||||
/** Off-chain WORM / tree-node puts */
|
||||
ARCHIVE_PUT: 'verae.archive.put',
|
||||
/** Broadcast hash lookup to every WORM and tree node (no queue group) */
|
||||
ARCHIVE_QUERY: 'verae.archive.query',
|
||||
});
|
||||
|
||||
/**
|
||||
* JetStream stream names.
|
||||
* @readonly
|
||||
*/
|
||||
export const STREAMS = Object.freeze({
|
||||
ZAPIER_JOBS: 'ZAPIER_JOBS',
|
||||
ZAPIER_EVENTS: 'ZAPIER_EVENTS',
|
||||
ZAPIER_WEBHOOKS: 'ZAPIER_WEBHOOKS',
|
||||
ZAPIER_USAGE: 'ZAPIER_USAGE',
|
||||
});
|
||||
|
||||
/**
|
||||
* Durable consumer names (queue groups).
|
||||
* @readonly
|
||||
*/
|
||||
export const CONSUMERS = Object.freeze({
|
||||
JOB_POLLER: 'job-poller',
|
||||
EVENT_WEBHOOK_ROUTER: 'event-webhook-router',
|
||||
WEBHOOK_DELIVER: 'webhook-deliver',
|
||||
USAGE_WRITER: 'usage-writer',
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue