Milestone 3: NATS wait (gate 9), hash lookup, zappier timestamp, NS1 tunnel
Wait-via-NATS returns completed or pending+jobId (GATE 9). Mock SHA256
idempotent register + GET /hashes/{sha256}. Zappier commercial edge has
POST /v1/timestamp and hash-lookup. GATE 12 smoke (signup + wait) passes.
NS1 NATS is 127.0.0.1:4222 on 70.88.205.138; SSH tunnel :14222. Local
nats-server -js used for isolated tests. Activate app adds Echo Text.
Learned: JetStream on NS1 is loopback-only; do not bind 4222 public.
This commit is contained in:
parent
10c663cc0c
commit
51ae79b75f
75 changed files with 1114 additions and 123 deletions
29
packages/verae-activate/creates/echo.js
Normal file
29
packages/verae-activate/creates/echo.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/**
|
||||
* Echo — returns the input string. Second activate-now action (no backend).
|
||||
* @module creates/echo
|
||||
*/
|
||||
|
||||
const perform = async (_z, bundle) => {
|
||||
const text = String(bundle.inputData.text ?? '');
|
||||
return { text, length: text.length, mode: 'local' };
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
key: 'echo',
|
||||
noun: 'Echo',
|
||||
display: {
|
||||
label: 'Echo Text',
|
||||
description: 'Returns the text you send. No API required.',
|
||||
},
|
||||
operation: {
|
||||
cleanInputData: false,
|
||||
inputFields: [{ key: 'text', label: 'Text', type: 'string', required: true }],
|
||||
perform,
|
||||
sample: { text: 'hello', length: 5, mode: 'local' },
|
||||
outputFields: [
|
||||
{ key: 'text', type: 'string' },
|
||||
{ key: 'length', type: 'integer' },
|
||||
{ key: 'mode', type: 'string' },
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
const authentication = require('./authentication');
|
||||
const addNumbers = require('./creates/add_numbers');
|
||||
const echo = require('./creates/echo');
|
||||
|
||||
module.exports = {
|
||||
version: require('./package.json').version,
|
||||
|
|
@ -16,5 +17,6 @@ module.exports = {
|
|||
authentication,
|
||||
creates: {
|
||||
[addNumbers.key]: addNumbers,
|
||||
[echo.key]: echo,
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ describe('verae-activate app', () => {
|
|||
it('exports Add Numbers create and custom auth', () => {
|
||||
assert.equal(authentication.type, 'custom');
|
||||
assert.ok(App.creates.add_numbers);
|
||||
assert.ok(App.creates.echo);
|
||||
assert.equal(addNumbers.key, 'add_numbers');
|
||||
assert.ok(addNumbers.operation.inputFields.some((f) => f.key === 'number1'));
|
||||
assert.ok(addNumbers.operation.inputFields.some((f) => f.key === 'number2'));
|
||||
|
|
@ -63,6 +64,13 @@ describe('verae-activate app', () => {
|
|||
assert.equal(result.sum, 5);
|
||||
});
|
||||
|
||||
it('echo returns text length', async () => {
|
||||
const echo = require('../creates/echo');
|
||||
const out = await echo.operation.perform({}, { inputData: { text: 'ab' }, authData: {} });
|
||||
assert.equal(out.length, 2);
|
||||
assert.equal(out.mode, 'local');
|
||||
});
|
||||
|
||||
it('auth test is local when fields empty', async () => {
|
||||
const out = await authentication.test({ request: async () => ({ data: {} }) }, { authData: {} });
|
||||
assert.equal(out.ok, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue