feat: FA(3) typed SDK, CLI session checkpoints, and workflow extensions#34
Open
smekcio wants to merge 3 commits into
Open
feat: FA(3) typed SDK, CLI session checkpoints, and workflow extensions#34smekcio wants to merge 3 commits into
smekcio wants to merge 3 commits into
Conversation
added 3 commits
May 17, 2026 15:27
…rity Expand the FA(3) document layer with domain helpers, importer/template APIs, runtime XSD validation (optional libxmljs2), packaged schemas, and seller NIP rules aligned with the Python SDK. Update docs to API v2.6.0 and extend tests.
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.
Summary
Ten PR domyka duży pakiet prac na gałęzi
feat/sdk-workflows-fa3: rozszerzone workflow sesji KSeF, pełny typed SDK FA(3) z walidacją XSD, parytet identyfikatorów stron z Python SDK oraz aktualizację dokumentacji do KSeF API v2.6.0. Branch zawiera 3 commity względemmain(~12k linii dodanych w 59 plikach).Zmiany wg obszaru
1. CLI — checkpointy sesji (resume)
sessionStorei komendysession online|batchz zapisywanymi checkpointami (open → send → close).--id,--resume,--jsonoraz operacje na zapisanych stanach sesji.cliSessionCommands.test.js,cliArgs.test.js,cliInternalsCoverage.test.js.docs/cli/README.md(sekcja Session checkpoints).2. Workflow serwisów
batchSessionWorkflow,onlineSessionWorkflow,invoiceExportWorkflow,hwmCoordinator,invoiceFiltersValidation.3. Typed SDK FA(3)
Nowy / rozbudowany moduł
src/documents/fa3/:builder.tsFA3Invoice,FA3Draft,FA3BatchDraft), mapowanie do XML FA(3)types.tsdomain.tsInvoiceParty,TaxCategory,Address, …)identifier.tsPartyIdentifierKind, resolve/validate/map identyfikatorów stronsections.tstax.tsimporter.ts/template.tsxml.ts/xsd.tsxsdMap.ts/xsdAudit.tspublicApi.tsschemas/Rodzaje faktur: basic, simplified, correction, advance, settlement (+ warianty korekt).
Sekcje XSD: Podmiot1/2/3, płatności, korekty, rozliczenia, zamówienia, transport, załączniki, adnotacje.
Eksport pakietu: subpath
ksef-client/documents/fa3+ build kopiuje schematy (scripts/copy-fa3-schemas.mjs,tsup.config.ts).4. Parytet identyfikatorów stron (jak Python SDK)
PartyIdentifier/PartyIdentifierKind(NIP,EU_VAT,FOREIGN,INTERNAL,NONE).InvoiceParty.polishCompany,euCompany,foreignCompany,withoutTaxIdustawiająidentifierna stronie.Podmiot1/PodmiotUpowazniony wymaga identyfikatora NIP.).taxIdnadal jest wnioskowane, gdy brakidentifier.5. Walidacja XSD
libxmljs2jako optionalDependency —toXml({ xsdValidate: true })wymaga natywnego modułu.distprzynpm run build.libxmljs2nie pasuje do wersji Node (znane ograniczenie).6. XML / invoice builder
src/xml/invoice.ts: wsparcie schematu FA(3) obok dotychczasowych formatów.xmlBuilder,pefXmlBuilder,xmlBuilder.property.7. Dokumentacja (API v2.6.0)
docs/README.md,docs/parity-ksef-docs.md,docs/api/tokens.md,docs/errors.md,docs/configuration.md,docs/maintainers.md.docs/examples/fa3-typed-sdk.md.ksef-docs2.6.0 (bez zmiany w tym PR — potwierdzone wcześniej na branchu).8. Testy
fa3Sdk.test.js(rodzaje faktur, sekcje, płatności, strony trzecie, korekty, XSD).fa3PublicApiParity.test.js— kontrakt publicznego API FA(3) w TS (bez zależności od repo Python).check-python-parity— parytet utrzymywany lokalnie przez testy kontraktu i zachowania.Commity na branchu
feat: update workflows and add FA(3) draft SDKfeat(cli): add resumable session checkpoint commands and storefeat(fa3): complete typed FA(3) SDK with XSD validation and Python parityTest plan
npm run buildnpm run typechecknpm run lintnpm run check:openapi-coverage(78/78)npm test(testy XSD opcjonalnie skipowane bez kompatybilnegolibxmljs2)docs/examples/fa3-typed-sdk.mdna środowisku testowym KSeFlibxmljs2dla pełnej walidacji XSDUwagi dla reviewerów
.tmp/nie jest commitowany (artefakty lokalne).