Feature/html output#56
Open
emilwojtaszek wants to merge 17 commits into
Open
Conversation
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>
24226a4 to
5b40799
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.