Initial import of verae-zapier-app from zapier monorepo
This commit is contained in:
commit
fcee7d7590
16 changed files with 618 additions and 0 deletions
34
searches/hash_lookup.js
Normal file
34
searches/hash_lookup.js
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
const base = () => process.env.MIDDLEWARE_BASE_URL || 'http://127.0.0.1:3100';
|
||||
|
||||
const perform = async (z, bundle) => {
|
||||
try {
|
||||
const response = await z.request({
|
||||
method: 'GET',
|
||||
url: `${base()}/zapier/v1/hashes/${encodeURIComponent(bundle.inputData.sha256)}`,
|
||||
});
|
||||
return [response.data];
|
||||
} catch (err) {
|
||||
if (err.status === 404) return [];
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
key: 'hash_lookup',
|
||||
noun: 'Timestamp',
|
||||
display: {
|
||||
label: 'Find Timestamp by SHA256',
|
||||
description: 'Looks up an existing timestamp for a SHA256 hex digest (mock/middleware).',
|
||||
},
|
||||
operation: {
|
||||
inputFields: [
|
||||
{ key: 'sha256', label: 'SHA256', type: 'string', required: true },
|
||||
],
|
||||
perform,
|
||||
sample: {
|
||||
sha256: '2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824',
|
||||
exists: true,
|
||||
jobId: '550e8400-e29b-41d4-a716-446655440000',
|
||||
},
|
||||
},
|
||||
};
|
||||
33
searches/job_status.js
Normal file
33
searches/job_status.js
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
const base = () => process.env.MIDDLEWARE_BASE_URL || 'http://127.0.0.1:3100';
|
||||
|
||||
const perform = async (z, bundle) => {
|
||||
const response = await z.request({
|
||||
url: `${base()}/zapier/v1/status/${encodeURIComponent(bundle.inputData.jobId)}`,
|
||||
});
|
||||
return [response.data];
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
key: 'job_status',
|
||||
noun: 'Job',
|
||||
display: {
|
||||
label: 'Find Job Status',
|
||||
description: 'Look up a timestamp job by ID.',
|
||||
},
|
||||
operation: {
|
||||
inputFields: [
|
||||
{ key: 'jobId', label: 'Job ID', type: 'string', required: true },
|
||||
],
|
||||
perform,
|
||||
sample: {
|
||||
id: '550e8400-e29b-41d4-a716-446655440000',
|
||||
status: 'completed',
|
||||
result: 'mock-cert',
|
||||
},
|
||||
outputFields: [
|
||||
{ key: 'id', label: 'Job ID' },
|
||||
{ key: 'status', label: 'Status' },
|
||||
{ key: 'result', label: 'Result' },
|
||||
],
|
||||
},
|
||||
};
|
||||
45
searches/tree_lookup.js
Normal file
45
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,
|
||||
},
|
||||
},
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue