Files
SGF/scripts/sgf-bank-report-http.mjs
2026-11-11 09:00:17 +02:00

3 lines
898 B
JavaScript

import fs from 'node:fs';import assert from 'node:assert/strict';import crypto from 'node:crypto';import {session} from './sgf-single-http.mjs';
const s=await session('sgf:read_only','finance'),r=await s.get('/api/bank-reconciliation/report');assert.equal(r.status,200);assert(r.headers.get('content-type').includes('text/csv'));const bytes=Buffer.from(await r.arrayBuffer());assert.equal(crypto.createHash('sha256').update(bytes).digest('hex'),r.headers.get('x-content-sha256'));const run=JSON.parse(fs.readFileSync('C:/laragon/data/sgf-tempo/run/modular-regression-current.json')),file=run.root+'/private/receipt-composition-cc50a276c10c/bank-report-http-20261110.json';fs.writeFileSync(file,JSON.stringify({passed:true,checks:3,checksum:r.headers.get('x-content-sha256'),shared_http_busy_handler:true,business_commands:0},null,2));console.log(JSON.stringify({passed:true,checks:3,proof:file}));