ksef-client-ts 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -4
- package/dist/cli.js +5908 -4985
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +870 -744
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -2
- package/dist/index.d.ts +27 -2
- package/dist/index.js +975 -852
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,9 +15,10 @@ TypeScript client for the Polish National e-Invoice System (KSeF) API v2.
|
|
|
15
15
|
- **Streaming batch uploads** — constant-memory batch upload via Web Streams API with ZIP bomb protection
|
|
16
16
|
- **Incremental export** — HWM-based paginated export with file-based state persistence
|
|
17
17
|
- **Multiple document structures** — FA, PEF, PEF_KOR, FA_RR with typed FormCode constants and UPO parsing
|
|
18
|
-
- **Invoice XML validation** — three-level client-side validation (well-formedness, XSD schema via Zod, NIP/PESEL checksums) with auto-detection for all 6 invoice types
|
|
18
|
+
- **Invoice XML validation** — three-level client-side validation (well-formedness, XSD schema via Zod, NIP/PESEL checksums, future date rejection) with auto-detection for all 6 invoice types
|
|
19
19
|
- **Typed errors & fluent builders** — `KSeFError` hierarchy (401, 403, 429, validation) and request builders
|
|
20
20
|
- **Comprehensive test coverage** — unit + E2E tests across HTTP, crypto, services, workflows; CI on every change
|
|
21
|
+
- **Interactive setup wizard** — `ksef setup` guides through environment selection, authentication, and token generation in one flow
|
|
21
22
|
- **Zero HTTP dependencies** — native `fetch` (Node 18+); dual ESM/CJS via tsup
|
|
22
23
|
|
|
23
24
|
Requires **Node.js 18+**.
|
|
@@ -63,9 +64,10 @@ const challenge = await client.auth.getChallenge();
|
|
|
63
64
|
|
|
64
65
|
```bash
|
|
65
66
|
ksef auth login --token "$KSEF_TOKEN" --nip "$KSEF_NIP"
|
|
66
|
-
ksef session open
|
|
67
|
-
ksef invoice send invoice.xml
|
|
68
|
-
ksef session
|
|
67
|
+
ksef session open # 1. Open online session (required)
|
|
68
|
+
ksef invoice send invoice.xml # 2. Send invoice
|
|
69
|
+
ksef session invoices # 3. Verify invoice status
|
|
70
|
+
ksef session close # 4. Close session (optional)
|
|
69
71
|
```
|
|
70
72
|
|
|
71
73
|
See the [documentation](https://flopsstuff.github.io/ksef-client-ts) for full usage, [API reference](https://flopsstuff.github.io/ksef-client-ts/api-reference), and [CLI reference](https://flopsstuff.github.io/ksef-client-ts/cli).
|