Add overview repo and verae-nats-process expansion template
Some checks are pending
offline / test (push) Waiting to run
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.
This commit is contained in:
parent
a694f246fb
commit
a32c91475c
37 changed files with 767 additions and 0 deletions
20
packages/verae-nats-process/src/handle.js
Normal file
20
packages/verae-nats-process/src/handle.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/**
|
||||
* 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',
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue