@open-charging-cloud/chargy-core 0.14.0 → 0.14.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 CHANGED
@@ -140,28 +140,6 @@ Keeping these paths separate has several advantages:
140
140
  When adding runtime-sensitive dependencies, avoid branching on runtime inside shared source code if that would make bundlers see both implementations. Prefer a small adapter under `src/` and let the build or conditional exports select the runtime-specific implementation.
141
141
 
142
142
 
143
- ### PDF.js Version Pin
144
-
145
- > **`pdfjs-dist` is pinned to an exact version, currently `6.2.108`. Always run the PDF/A-3 test when raising it.**
146
-
147
- It is the only dependency in `package.json` without a `^`, because PDF.js has shipped a silently breaking attachment API change within a minor release. Going from `6.0.227` to `6.2.108` changed `getDocument().getAttachments()` in two ways:
148
-
149
- 1. It resolves to a **`Map`** instead of a plain object. Reading the result with `Object.values()` yields an empty array for a `Map`, so every attachment is dropped.
150
- 2. Entries no longer carry the file bytes eagerly. `content` is only set when it happens to be loaded already, otherwise the payload has to be fetched via the new `getAttachmentContent(id)`.
151
-
152
- Both are handled in `src/chargy.ts`, which iterates the `Map` and falls back to `getAttachmentContent()` whenever an entry has no inline `content`.
153
-
154
- What makes this class of change dangerous is that it fails silently: nothing throws, so the `try`/`catch` around the call never fires. The embedded record simply disappears and verification then reports `InvalidSessionFormat` with *"No charge transparency records found!"*. `npm run typecheck` and `npm run lint` both stay green; only `tests/SAFE.tests.ts` ("SAFE Testdata 02 with XML namespace via PDF/A-3") detects it, by extracting a real embedded XML file from `tests/fixtures/SAFE/SAFE-Testdata-02_withXMLNamespace.pdf`.
155
-
156
- So before changing the pin, always run:
157
-
158
- ```bash
159
- npm run test:node -- tests/SAFE.tests.ts
160
- ```
161
-
162
- Staying on an old version is not a safe default either — `6.0.227` was affected by [GHSA-hq66-cqwq-w95j](https://github.com/advisories/GHSA-hq66-cqwq-w95j) (high severity, arbitrary JavaScript execution when opening a malicious PDF), which is fixed in `6.2.108`.
163
-
164
-
165
143
  ## Development
166
144
 
167
145
  ```bash
@@ -207,7 +185,7 @@ npx playwright install chromium
207
185
  ## Publishing
208
186
 
209
187
  ```bash
210
- npm version 0.14.0 --no-git-tag-version
188
+ npm version 0.14.2 --no-git-tag-version
211
189
  npm run verify
212
190
  npm pack --dry-run
213
191
  npm pack
@@ -13704,10 +13704,12 @@ var Chargy = class {
13704
13704
  verifyLiveLinkSignatures(LiveLink) {
13705
13705
  const result = verifyDocumentSignatures(LiveLink);
13706
13706
  const warnings = new Array();
13707
+ const reported = /* @__PURE__ */ new Set();
13707
13708
  const warn = (messageKey, level) => {
13708
- const message = this.GetMultilanguageText(messageKey);
13709
- if (!warnings.some((warning) => warning.message === message))
13710
- warnings.push({ level, message });
13709
+ if (reported.has(messageKey))
13710
+ return;
13711
+ reported.add(messageKey);
13712
+ warnings.push({ level, message: this.GetMultilanguageText(messageKey) });
13711
13713
  };
13712
13714
  if (result.status === "unsigned")
13713
13715
  warn("DocumentSignature_Missing", "low" /* low */);