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.
34 lines
916 B
JavaScript
34 lines
916 B
JavaScript
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',
|
|
},
|
|
},
|
|
};
|