Skip to content

Feature/html output#56

Open
emilwojtaszek wants to merge 17 commits into
CIRFMF:mainfrom
appunite:feature/html-output
Open

Feature/html output#56
emilwojtaszek wants to merge 17 commits into
CIRFMF:mainfrom
appunite:feature/html-output

Conversation

@emilwojtaszek

Copy link
Copy Markdown

No description provided.

emilwojtaszek and others added 17 commits February 12, 2026 12:17
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wrap the existing library in a minimal node:http server (server/index.js)
that accepts KSeF XML via POST /generate and returns a PDF. Includes
Dockerfile, integration tests, and README documentation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Read X-KSeF-Number and X-KSeF-QRCode headers in POST /generate
and pass them as additionalData to the PDF generator.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Document X-KSeF-Number and X-KSeF-QRCode optional headers
with usage examples for POST /generate endpoint.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Builds and pushes to ghcr.io on every push to main.
Tags with :latest and :sha.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Split each generator into two steps: building the pdfmake
TDocumentDefinitions object and rendering to PDF. This enables
reuse of the doc definition for alternative output formats.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add renderDocDefinitionToHtml() for server-side HTML rendering
- Add 'html' format option to generateInvoice()
- Export buildFA1/FA2/FA3DocDefinition and buildUPODocDefinition
- Externalize server-only deps in Vite config

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Same interface as /generate (XML body, X-KSeF-Number/X-KSeF-QRCode
headers) but returns text/html instead of application/pdf.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The pdfmake-html-renderer SSR module requires Node.js APIs (fs, module)
that Vite browser-externalizes in the library bundle. Instead, keep the
HTML rendering logic in server/render-html.js (not bundled) and export
buildInvoiceDocDefinition from the library for server-side consumers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests cover: valid XML returning HTML, empty body returning 400,
and invalid XML returning 500.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- collectBody enforces configurable max body size (10 MB default,
  configurable via MAX_BODY_BYTES env var), returns 413 on overflow
- Catch block logs full error server-side, returns generic message
  to clients (no internal details leaked)
- Test afterAll awaits process exit with SIGKILL fallback

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add request ID (UUID) to all log lines and error responses for
  client-server correlation
- Document intentional jsdom global pollution with process isolation note
- Fix PORT=0 support so OS can assign a free port (tests + server)
- Tests parse actual port from server stdout instead of random range
- Strengthen error response assertions: verify exact message and
  non-empty requestId
- Add ESLint padding-line blank lines in test helper
- Fix QR code header description to cover both PDF and HTML output

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix broken git clone URL (trailing #, wrong org)
- Add test verifying X-KSeF-Number header appears in HTML output

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@MichalChudyAKMF MichalChudyAKMF force-pushed the main branch 2 times, most recently from 24226a4 to 5b40799 Compare March 27, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant