import type { Bundle, ZObject } from 'zapier-platform-core'; import { zapierV1 } from '../lib/base.js'; const perform = async (z: ZObject, bundle: Bundle) => { const response = await z.request({ skipThrowForStatus: true, url: zapierV1( bundle, `/status/${encodeURIComponent(String(bundle.inputData.jobId))}/verification`, ), headers: { accept: 'application/json' }, }); if (response.status === 404) { return []; } if (response.status >= 400) { throw new z.errors.Error( response.data?.error || `Verification lookup failed (${response.status})`, 'JobVerifyError', response.status, ); } return [response.data]; }; export default { key: 'job_verification', noun: 'Job Verification', display: { label: 'Find Job Verification', description: 'Get block and verification details for a completed timestamp job.', }, operation: { perform, inputFields: [ { key: 'jobId', label: 'Job ID', type: 'string' as const, required: true }, ], sample: { id: '550e8400-e29b-41d4-a716-446655440000', status: 'completed', metadata: { blockIndex: 42, timestamp: '2023-01-01T12:00:00Z' }, }, }, };