Around remaining blockers (Zapier login, live Verae): generate PDF receipts without extra deps; AES-256-GCM object store with tenant isolation and share tokens; scripts/nats-tunnel.sh to NS1; SHA256 Hash Text local Zapier action; scripts/test-offline.sh for the no-login suite. Learned: other-tenant object GET is 403; share token is the mock unwrap path.
36 lines
1,017 B
JavaScript
36 lines
1,017 B
JavaScript
/**
|
|
* SHA256 of a string — local, no API. Lets you hash a file/text in a Zap.
|
|
* @module creates/sha256
|
|
*/
|
|
|
|
const { createHash } = require('node:crypto');
|
|
|
|
const perform = async (_z, bundle) => {
|
|
const text = String(bundle.inputData.text ?? '');
|
|
const sha256 = createHash('sha256').update(text, 'utf8').digest('hex');
|
|
return { textLength: text.length, sha256, mode: 'local' };
|
|
};
|
|
|
|
module.exports = {
|
|
key: 'sha256_hash',
|
|
noun: 'Hash',
|
|
display: {
|
|
label: 'SHA256 Hash Text',
|
|
description: 'Computes SHA256 hex of text inside Zapier. No Verae call.',
|
|
},
|
|
operation: {
|
|
cleanInputData: false,
|
|
inputFields: [{ key: 'text', label: 'Text', type: 'text', required: true }],
|
|
perform,
|
|
sample: {
|
|
textLength: 5,
|
|
sha256: '2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824',
|
|
mode: 'local',
|
|
},
|
|
outputFields: [
|
|
{ key: 'sha256', type: 'string' },
|
|
{ key: 'textLength', type: 'integer' },
|
|
{ key: 'mode', type: 'string' },
|
|
],
|
|
},
|
|
};
|