@getpeppr/cli 0.6.0 → 0.7.1
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/CHANGELOG.md +233 -0
- package/README.md +27 -0
- package/dist/index.js +304 -45
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@getpeppr/cli` are documented here.
|
|
4
|
+
|
|
5
|
+
The CLI bundles `@getpeppr/sdk` into its published artifact (tsup `noExternal`), so `validate`, `convert` and `init` run the SDK's validators, country rules and UBL builder locally — an SDK release only reaches CLI users once the CLI is rebundled. Rebundle-only releases are listed with the SDK version they ship.
|
|
6
|
+
|
|
7
|
+
## [0.7.1] — 2026-08-18
|
|
8
|
+
|
|
9
|
+
Rebundle SDK 4.1.1. This release matters for `getpeppr validate`, which runs the
|
|
10
|
+
schematron validator locally from the bundled SDK.
|
|
11
|
+
|
|
12
|
+
**Four rule identifiers were wrong, and 0.7.0 still reports them.** They named
|
|
13
|
+
real rules from the Peppol rulebook — just not the ones being checked — which is
|
|
14
|
+
worse than a typo: you could look one up, read a genuine rule, and find it had
|
|
15
|
+
nothing to do with your document.
|
|
16
|
+
|
|
17
|
+
| `validate` reported | It now reports | What the check actually verifies |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| `BR-S-01` | `BR-S-05` | standard-rated line must carry a VAT rate above zero |
|
|
20
|
+
| `BR-S-05` | `BR-Z-05` | zero-rated line must carry a rate of exactly zero |
|
|
21
|
+
| `BR-S-06` | `BR-E-05` | VAT-exempt line must carry a rate of exactly zero |
|
|
22
|
+
| `BR-S-08` | `BR-AE-05` | reverse-charge line must carry a rate of exactly zero |
|
|
23
|
+
|
|
24
|
+
The checks themselves were always right — a zero-rated line carrying a non-zero
|
|
25
|
+
rate was always caught. Only the label was wrong. **If you branch on any of these
|
|
26
|
+
identifiers in a pipeline, they change with this version.**
|
|
27
|
+
|
|
28
|
+
Fixed in SDK 4.1.0 on 2026-08-18; CLI users only receive it now, because the CLI
|
|
29
|
+
bundles the SDK rather than depending on it at runtime.
|
|
30
|
+
|
|
31
|
+
Also carries SDK 4.1.1, which corrects the JSDoc on `importFile()` — raw import
|
|
32
|
+
does not preserve your document byte for byte, and the SDK said it did.
|
|
33
|
+
|
|
34
|
+
## [0.7.0] — 2026-08-16
|
|
35
|
+
|
|
36
|
+
Rebundle SDK 4.0.0 (GPR-1061). `getpeppr send --watch` could not confirm a
|
|
37
|
+
delivery: it polled every 2 seconds, was handed an invented `submitted` every
|
|
38
|
+
time, and after 60 seconds printed *"Timeout — invoice was sent but delivery not
|
|
39
|
+
confirmed"* on invoices that had in fact been delivered. The status was never
|
|
40
|
+
measured; the SDK was supplying it.
|
|
41
|
+
|
|
42
|
+
The SDK now refuses a status the gateway did not send, so `--watch` stops
|
|
43
|
+
reporting a timeout it cannot justify. When the gateway answers without a
|
|
44
|
+
status, the watch ends immediately with `⚠ Watch error:` and the reason, instead
|
|
45
|
+
of waiting a minute to say nothing.
|
|
46
|
+
|
|
47
|
+
### Changed
|
|
48
|
+
|
|
49
|
+
- `send --watch` surfaces a gateway protocol fault instead of polling to
|
|
50
|
+
timeout. Minor rather than patch: a script that read the 60-second timeout as
|
|
51
|
+
"not delivered yet" will now see an error much sooner — which is the point,
|
|
52
|
+
since that timeout was never evidence of anything.
|
|
53
|
+
- **`send --watch` exits 1 when the watch itself fails.** It used to print the
|
|
54
|
+
error and exit 0, leaving the send-time `submitted` on stdout: an automation
|
|
55
|
+
gating on the exit code read a broken API as a confirmed delivery. A watch you
|
|
56
|
+
asked for and could not run is not a success.
|
|
57
|
+
|
|
58
|
+
A watch that merely **times out** still exits 0, unchanged. The send worked;
|
|
59
|
+
delivery is simply unconfirmed within the window. That is a different fact
|
|
60
|
+
from "the API answered something the SDK refused to interpret".
|
|
61
|
+
|
|
62
|
+
## [0.6.0] — 2026-08-12
|
|
63
|
+
|
|
64
|
+
Rebundle SDK 3.2.0 (GPR-1012, GPR-1020). Minor rather than patch: `validate` now
|
|
65
|
+
**fails** documents it used to pass, so a pipeline gating on its exit code will
|
|
66
|
+
start rejecting invoices — which is the point, since those invoices were being
|
|
67
|
+
refused at send time anyway.
|
|
68
|
+
|
|
69
|
+
Measured against the published `0.5.4` on the same file, before and after:
|
|
70
|
+
|
|
71
|
+
| `vatCategory` | 0.5.4 said | 0.6.0 says |
|
|
72
|
+
| --- | --- | --- |
|
|
73
|
+
| `L` (IGIC) | *nothing* — passed silently | `unsupported_vat_category`, explained |
|
|
74
|
+
| `M` (IPSI) | *nothing* — passed silently | `unsupported_vat_category`, explained |
|
|
75
|
+
| `B` (split payment) | `invalid VAT category` | `unsupported_vat_category` |
|
|
76
|
+
| `ae` | `invalid VAT category` | `BR-CL-17` + a note that codes are case-sensitive |
|
|
77
|
+
|
|
78
|
+
### Changed
|
|
79
|
+
|
|
80
|
+
- `validate` reports unroutable VAT categories instead of passing them. `L` and
|
|
81
|
+
`M` are valid EN 16931 codes our provider has no vocabulary for, so a document
|
|
82
|
+
carrying one is refused with a 422 at send time. `0.5.4` said nothing about
|
|
83
|
+
them, which meant the offline validator's verdict and the gateway's disagreed
|
|
84
|
+
on exactly the case where the developer needed the warning.
|
|
85
|
+
- `validate` no longer emits the rule id `PEPPOL-EN16931-R006`. That id does not
|
|
86
|
+
exist in Peppol rulebook v3.0.20 — the family stops at R005, R007 and R008 —
|
|
87
|
+
so the CLI was citing a rule a reader could not look up. Violations now carry
|
|
88
|
+
`BR-CL-17` (a genuine EN 16931 rule) or `unsupported_vat_category`.
|
|
89
|
+
- `validate` accepts `B` (Italian split payment) as a real VAT category. It was
|
|
90
|
+
reported invalid, which is the more expensive direction of error: telling a
|
|
91
|
+
developer the network refuses a code it accepts closes a corridor that is open.
|
|
92
|
+
- A `vatCategory` of `null` is treated as absent rather than reported as the
|
|
93
|
+
literal string `"null"` — the shape any JSON serialiser emits for an unset
|
|
94
|
+
field, and the shape the gateway has always accepted.
|
|
95
|
+
|
|
96
|
+
### Unchanged
|
|
97
|
+
|
|
98
|
+
- `lookup`, `login`, `logout` and `send` behave identically.
|
|
99
|
+
- The scheme and identifier fixes from SDK 3.0.0 (`GB:CRN` removal, `GB:VAT` and
|
|
100
|
+
Leitweg-ID patterns) are **not** in this bundle and never were: those symbols
|
|
101
|
+
live in a module the CLI does not import, and tsup tree-shakes them out.
|
|
102
|
+
Verified on the built artifact — `SCHEMES_BY_COUNTRY`, `validatePeppolIdentifier`
|
|
103
|
+
and `LEITWEG` are absent while `buildInvoiceXml` and `validateSchematron` are
|
|
104
|
+
present, so the absence is real and not a broken grep. SDK 3.1.0 was type-only
|
|
105
|
+
and had nothing to bundle.
|
|
106
|
+
|
|
107
|
+
## [0.5.4] — 2026-07-24
|
|
108
|
+
|
|
109
|
+
### Changed
|
|
110
|
+
|
|
111
|
+
- Rebundle SDK 2.5.0 (GPR-868): `directory.search()` pagination meta remap, `WebhookEventType` phantom values removed. No CLI command change (`lookup` uses its own directory client).
|
|
112
|
+
|
|
113
|
+
## [0.5.3] — 2026-07-20
|
|
114
|
+
|
|
115
|
+
### Changed
|
|
116
|
+
|
|
117
|
+
- `init` templates now target the getpeppr sandbox test receiver, so a scaffolded invoice can be sent successfully on the first try in sandbox (GPR-828).
|
|
118
|
+
|
|
119
|
+
## [0.5.2] — 2026-07-16
|
|
120
|
+
|
|
121
|
+
### Changed
|
|
122
|
+
|
|
123
|
+
- Rebundle SDK 2.4.0 (GPR-134): `validate`/`convert` now apply the France country rules (FR-01 SIREN/SIRET checksums with the corrected La Poste model, FR-02 VAT key alphabet, FR-03 DGFiP VAT key formula) locally.
|
|
124
|
+
|
|
125
|
+
## [0.5.1] — 2026-07-16
|
|
126
|
+
|
|
127
|
+
### Fixed
|
|
128
|
+
|
|
129
|
+
- Rebundle SDK 2.3.0 (GPR-838): `convert`/`validate` now emit EN 16931 BR-CO-17-compliant UBL — group-level VAT rounding replaced per-line accumulation, which could drift the payable amount by one cent on sub-cent line amounts.
|
|
130
|
+
|
|
131
|
+
## [0.5.0] — 2026-07-13
|
|
132
|
+
|
|
133
|
+
### Changed
|
|
134
|
+
|
|
135
|
+
- `send --watch` stops on the terminal `no_action` status (recipient not deliverable) and `send` exits 1 on it (GPR-830). Rebundles SDK 2.1.0 (`invoice.undeliverable` webhook event, `waitFor` terminal semantics).
|
|
136
|
+
|
|
137
|
+
## [0.4.7] — 2026-06-21
|
|
138
|
+
|
|
139
|
+
### Changed
|
|
140
|
+
|
|
141
|
+
- Rebundle SDK 2.0.0 (bundle hygiene, no command change).
|
|
142
|
+
|
|
143
|
+
## [0.4.6] — 2026-06-19
|
|
144
|
+
|
|
145
|
+
### Changed
|
|
146
|
+
|
|
147
|
+
- Rebundle SDK 1.9.0 (GPR-738: `invoices.list()` blank `number`/`createdAt` fix).
|
|
148
|
+
|
|
149
|
+
## [0.4.5] — 2026-06-04
|
|
150
|
+
|
|
151
|
+
### Changed
|
|
152
|
+
|
|
153
|
+
- Rebundle SDK 1.5.2 (directory response alignment).
|
|
154
|
+
|
|
155
|
+
## [0.4.4] — 2026-06-04
|
|
156
|
+
|
|
157
|
+
### Changed
|
|
158
|
+
|
|
159
|
+
- Rebundle SDK 1.5.1 (patch train).
|
|
160
|
+
|
|
161
|
+
## [0.4.3] — 2026-05-24
|
|
162
|
+
|
|
163
|
+
### Changed
|
|
164
|
+
|
|
165
|
+
- Rebundle SDK 1.5.0 (server validation contract updates).
|
|
166
|
+
|
|
167
|
+
## [0.4.2] — 2026-05-07
|
|
168
|
+
|
|
169
|
+
### Fixed
|
|
170
|
+
|
|
171
|
+
- Repaired published package imports (#289) — same packaging fix as SDK 1.4.2.
|
|
172
|
+
|
|
173
|
+
## [0.4.1] — 2026-05-07
|
|
174
|
+
|
|
175
|
+
### Changed
|
|
176
|
+
|
|
177
|
+
- Version alignment with SDK 1.4.1, package metadata normalization (#287, #290).
|
|
178
|
+
|
|
179
|
+
## [0.4.0] — 2026-05-01
|
|
180
|
+
|
|
181
|
+
### Added
|
|
182
|
+
|
|
183
|
+
- `DirectoryError` class for directory lookup failures (GPR-414 PR-B, #270).
|
|
184
|
+
|
|
185
|
+
### Fixed
|
|
186
|
+
|
|
187
|
+
- `lookup`/search requests now carry `AbortSignal.timeout(15s)` and an HTTP ok-check — previously a slow Peppol Directory response could hang the command forever.
|
|
188
|
+
|
|
189
|
+
## [0.3.1] — 2026-04-27
|
|
190
|
+
|
|
191
|
+
### Changed
|
|
192
|
+
|
|
193
|
+
- README documents the `send`, `login` and `logout` commands.
|
|
194
|
+
|
|
195
|
+
## [0.3.0] — 2026-04-27
|
|
196
|
+
|
|
197
|
+
### Added
|
|
198
|
+
|
|
199
|
+
- `send [file]` — send an invoice to the Peppol network via the getpeppr API (`--watch`, `--prod`) (GPR-278).
|
|
200
|
+
- `login` / `logout` — store/remove the API key in `~/.config/getpeppr/credentials.json` (mode 0600).
|
|
201
|
+
- SDK now bundled into the published artifact via tsup `noExternal` (fixes `ERR_UNSUPPORTED_DIR_IMPORT` on user installs). 7 commands total.
|
|
202
|
+
|
|
203
|
+
## [0.2.2] — 2026-04-09
|
|
204
|
+
|
|
205
|
+
### Changed
|
|
206
|
+
|
|
207
|
+
- README documents the `init`, `convert` and `lookup` commands.
|
|
208
|
+
|
|
209
|
+
## [0.2.1] — 2026-04-09
|
|
210
|
+
|
|
211
|
+
### Changed
|
|
212
|
+
|
|
213
|
+
- Belgian seller templates for `init`.
|
|
214
|
+
|
|
215
|
+
## [0.2.0] — 2026-04-09
|
|
216
|
+
|
|
217
|
+
### Added
|
|
218
|
+
|
|
219
|
+
- `init [file]` — scaffold an invoice/credit-note JSON template (GPR-275).
|
|
220
|
+
- `convert <file>` — JSON → Peppol BIS 3.0 UBL XML on stdout (GPR-276).
|
|
221
|
+
- `lookup <peppolId>` — Peppol Directory participant search (GPR-277).
|
|
222
|
+
|
|
223
|
+
## [0.1.1] — 2026-04-07
|
|
224
|
+
|
|
225
|
+
### Changed
|
|
226
|
+
|
|
227
|
+
- npm README and website docs page (GPR-159).
|
|
228
|
+
|
|
229
|
+
## [0.1.0] — 2026-04-07
|
|
230
|
+
|
|
231
|
+
### Added
|
|
232
|
+
|
|
233
|
+
- Initial release: `getpeppr validate <file>` — offline Peppol invoice validation running the SDK's three validators locally, no account required (GPR-265/266/267). Exit codes: 0 = valid, 1 = validation errors, 2 = fatal.
|
package/README.md
CHANGED
|
@@ -175,6 +175,23 @@ Removes `~/.config/getpeppr/credentials.json`. No-op if the file doesn't exist.
|
|
|
175
175
|
| `1` | Failure (invalid invoice, participant not found) |
|
|
176
176
|
| `2` | Input error (file not found, invalid JSON, bad arguments) |
|
|
177
177
|
|
|
178
|
+
### `send --watch` is two outcomes, not one
|
|
179
|
+
|
|
180
|
+
Since 0.7.0, a watch that fails because the API answered something the CLI
|
|
181
|
+
cannot honestly read exits **1**. Before 0.7.0 it printed a warning and exited
|
|
182
|
+
`0`, which meant an automation could read a broken API as a confirmed delivery.
|
|
183
|
+
|
|
184
|
+
A watch that runs out of time still exits **0**, and that is a different fact:
|
|
185
|
+
the document was accepted, and the watch stopped without having *seen* a
|
|
186
|
+
terminal status. It does not follow that the document is still in flight. The
|
|
187
|
+
deadline is checked between polls, so a status can turn terminal during the
|
|
188
|
+
final wait and never be read — the status printed on a timeout may already be
|
|
189
|
+
stale. Poll again or use a webhook rather than treating a timeout as a failure.
|
|
190
|
+
|
|
191
|
+
⚠️ The 60 seconds bound when the **last poll starts**, not when the command
|
|
192
|
+
ends. The deadline is checked before each request, so a slow or retried call
|
|
193
|
+
carries the run past it. If a pipeline needs a hard ceiling, impose your own.
|
|
194
|
+
|
|
178
195
|
## CI/CD integration
|
|
179
196
|
|
|
180
197
|
```bash
|
|
@@ -271,6 +288,16 @@ const result = await peppol.invoices.send(invoice);
|
|
|
271
288
|
|
|
272
289
|
Sign up at [getpeppr.dev](https://getpeppr.dev) to get your API key.
|
|
273
290
|
|
|
291
|
+
## Release notes
|
|
292
|
+
|
|
293
|
+
`validate` runs the Peppol rules bundled into the version you installed, so its
|
|
294
|
+
verdict can change between releases — which matters most if you gate a pipeline
|
|
295
|
+
on its exit code. Two places tell you what moved:
|
|
296
|
+
|
|
297
|
+
- `CHANGELOG.md`, shipped inside the package (`node_modules/@getpeppr/cli/CHANGELOG.md`).
|
|
298
|
+
- [getpeppr.dev/news](https://getpeppr.dev/news) for the same notes on the web,
|
|
299
|
+
alongside gateway and SDK changes.
|
|
300
|
+
|
|
274
301
|
## License
|
|
275
302
|
|
|
276
303
|
MIT
|