Add Zapier interface simulator, tree-node Merkle lookups, and user docs
Some checks are pending
offline / test (push) Waiting to run
Some checks are pending
offline / test (push) Waiting to run
In-process trace console validates hops, faults, recoveries, and suggested changes before zapier-platform push. User guide covers signup through central-chain and bulk-summary tree-node hash lookup.
This commit is contained in:
parent
3daa88866d
commit
f3dc0e6eee
56 changed files with 2341 additions and 8 deletions
|
|
@ -5,6 +5,6 @@ This Zapier Platform app **does not use NATS**.
|
|||
| Direction | Address | Peer | Body |
|
||||
|-----------|---------|------|------|
|
||||
| IN | Zapier runtime | user Zap | create/search/trigger fields |
|
||||
| OUT HTTPS | middleware `/zapier/v1/timestamp`, `/wait`, `/verify`, `/status/{id}`, `/hashes/{sha256}`, REST Hook subscribe | verae-middleware | Bearer `zmw_` |
|
||||
| OUT HTTPS | middleware `/zapier/v1/timestamp`, `/wait`, `/verify`, `/status/{id}`, `/hashes/{sha256}`, `/hashes/{sha256}?includeTree=true`, REST Hook subscribe | verae-middleware | Bearer `zmw_` |
|
||||
|
||||
Job completion is a REST Hook HTTP POST from webhook-deliver, not a NATS client in Zapier.
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ const batchTimestamp = require('./creates/batch_timestamp');
|
|||
const addNumbers = require('./creates/add_numbers');
|
||||
const jobStatus = require('./searches/job_status');
|
||||
const hashLookup = require('./searches/hash_lookup');
|
||||
const treeLookup = require('./searches/tree_lookup');
|
||||
const timestampCompleted = require('./triggers/timestamp_completed');
|
||||
|
||||
/**
|
||||
|
|
@ -76,5 +77,6 @@ module.exports = {
|
|||
searches: {
|
||||
[jobStatus.key]: jobStatus,
|
||||
[hashLookup.key]: hashLookup,
|
||||
[treeLookup.key]: treeLookup,
|
||||
},
|
||||
};
|
||||
|
|
|
|||
45
packages/verae-zapier/searches/tree_lookup.js
Normal file
45
packages/verae-zapier/searches/tree_lookup.js
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
const base = () => process.env.MIDDLEWARE_BASE_URL || 'http://127.0.0.1:3100';
|
||||
|
||||
const perform = async (z, bundle) => {
|
||||
try {
|
||||
const sha = encodeURIComponent(bundle.inputData.sha256);
|
||||
const response = await z.request({
|
||||
method: 'GET',
|
||||
url: `${base()}/zapier/v1/hashes/${sha}?includeAttached=true&includeTree=true`,
|
||||
});
|
||||
return [response.data];
|
||||
} catch (err) {
|
||||
if (err.status === 404) return [];
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
key: 'tree_lookup',
|
||||
noun: 'Timestamp',
|
||||
display: {
|
||||
label: 'Find Hash (tree nodes + central chain)',
|
||||
description:
|
||||
'Looks up a SHA256 on the main Verae chain, then queries external tree-node archives for leaves that were only sealed as a bulk Merkle summary.',
|
||||
},
|
||||
operation: {
|
||||
inputFields: [
|
||||
{
|
||||
key: 'sha256',
|
||||
label: 'SHA256',
|
||||
type: 'string',
|
||||
required: true,
|
||||
helpText:
|
||||
'64-char hex. If this hash was part of a batch, it may not be itemized on the main chain — this search still finds the Merkle proof on tree nodes.',
|
||||
},
|
||||
],
|
||||
perform,
|
||||
sample: {
|
||||
sha256: '2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824',
|
||||
exists: true,
|
||||
itemizedOnMainChain: false,
|
||||
merkleRoot: 'ab'.repeat(32),
|
||||
proofOk: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
@ -28,6 +28,7 @@ describe('verae-zapier app definition', () => {
|
|||
assert.ok(App.creates.batch_timestamp);
|
||||
assert.ok(App.searches.job_status);
|
||||
assert.ok(App.searches.hash_lookup);
|
||||
assert.ok(App.searches.tree_lookup);
|
||||
assert.ok(App.triggers.timestamp_completed);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue