@temboplus/reports-client
v1.0.2
Published
A frontend client for fetching and downloading TemboPlus reports from the reports generation service.
Readme
@temboplus/reports-client
Frontend client for discovering, fetching, and downloading reports from the TemboPlus reports service (pdf-maker).
Quick Start
bun add @temboplus/reports-client
# or: npm install @temboplus/reports-clientimport {
FileFormat,
ProjectType,
ReportClientSchemas,
ReportManager,
ReportType,
} from "@temboplus/reports-client";
const reports = new ReportManager();
const request = ReportClientSchemas.request.parse({
token: "your-auth-token",
projectType: ProjectType.DASHBOARD,
reportType: ReportType.DISBURSEMENT_HISTORY,
fileFormat: FileFormat.EXCEL,
input: {
accountNo: "1234567890",
startDate: "2026-03-01",
endDate: "2026-03-31",
filters: { statusIn: ["PAYMENT_ACCEPTED", "PENDING"] },
},
});
await reports.downloadReport(request);Requests are issued as POST with a JSON body. The body shape is validated server-side by the reports service's typed DTO for each endpoint.
downloadReport()— for browser environments; triggers a file download.fetchReport()— server-friendly; returns the response so you can save or stream it yourself.
Consumed By
- TemboPlus Afloat (Next.js frontend) — customer-facing Afloat app.
- TemboPlus Dashboard (Next.js frontend) — internal dashboard.
Development
Bun for everything, Biome for lint+format, mise for the toolchain pin.
mise install # one-time: installs pinned Bun
bun install
bun run dev # rollup build in watch mode| Script | Does |
| --- | --- |
| bun run dev | Rollup build in watch mode |
| bun run build | Rollup + tsc declaration emit to dist/ |
| bun run test | bun:test (passes with zero tests; smoke test only) |
| bun run lint | Biome check |
| bun run format | Biome auto-fix |
| bun run typecheck | tsc --noEmit |
Tag-driven releases via .github/workflows/release.yml — update CHANGELOG.md, bump package.json, push a vX.Y.Z tag.
License
MIT © TemboPlus
