master-zapier-plan-draft/packages/verae-nats-process/src/handle.js
George Lambert a32c91475c
Some checks are pending
offline / test (push) Waiting to run
Add overview repo and verae-nats-process expansion template
High-level system map with diagrams, TOC, and a docs index. Template
worker shows how to add a new verae.* address for search, storage, or
unplanned functions without teaching Zapier NATS.
2026-09-11 13:50:37 -04:00

20 lines
568 B
JavaScript

/**
* Replace this with search, store, or any new function.
* Must be idempotent: the same correlationId may be redelivered.
*
* @param {object} msg
* @returns {Promise<object>|object}
*/
export function handle(msg = {}) {
const correlationId = msg.correlationId || msg.traceId;
if (!correlationId) {
throw new Error('correlationId or traceId is required');
}
return {
ok: true,
correlationId,
echo: msg.payload ?? msg,
processedAt: new Date().toISOString(),
note: 'Template handler — replace handle() in src/handle.js',
};
}