Some checks are pending
offline / test (push) Waiting to run
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.
20 lines
568 B
JavaScript
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',
|
|
};
|
|
}
|