@open-charging-cloud/chargy-core 0.15.0 → 0.15.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 CHANGED
@@ -7,6 +7,143 @@ While the version number is below 1.0.0, breaking changes are released in minor
7
7
  versions and are always listed first below.
8
8
 
9
9
 
10
+ ## [0.15.1] - 2026-09-07
11
+
12
+ ### Fixed
13
+
14
+ - **`isTOTPConfig()` rejected every TOTP configuration that named its hash
15
+ algorithm.** It asked for a number where `TOTPConfig.hashAlgorithm` is a
16
+ string, so a transport stating `"SHA-256"` was not a transport any more.
17
+ Nothing said so: `isLiveTransport()` simply returned false, and a reader
18
+ filtering its transports through it dropped that one without a word. Only
19
+ configurations leaving the property out were unaffected, which is why the
20
+ fixtures did not catch it.
21
+
22
+ ### Changed
23
+
24
+ - **The OCMF-Test-01 series still spelled the TOTP secret the old way.** The
25
+ rename to `sharedSecret` reached the interfaces in 0.15.0 but not the
26
+ fixtures, so `isLiveTransport()` dropped the websocket and the httpSSE
27
+ transport of every document in it - the test data did not survive its own
28
+ type guard. The template says `sharedSecret` now, and the series and
29
+ `ChargeTransparencyLiveLink_1.json` are regenerated and re-signed from it.
30
+
31
+
32
+ ## [0.15.0] - 2026-09-07
33
+
34
+ ### Breaking
35
+
36
+ - **A live link is recognised by the three things every one of them has.**
37
+ `IsAChargeTransparencyLiveLink()` requires the `@context`, a `created`
38
+ timestamp and a `liveTransports` array; a document missing any of them is not
39
+ a live link. Everything else stays unvalidated there - a malformed optional
40
+ field, and a broken transport most of all, must not turn a document into an
41
+ unrecognised one that then fails as an "unknown format". A transport is
42
+ judged where the transports are read, not where the document is identified.
43
+
44
+ - **Reading a document no longer fills in a missing `created`.** It used to get
45
+ the current UTC time, which recorded when the document was *read*. In a
46
+ legally relevant document that is not what "created" means, and reading is
47
+ not creating. A live link states its own timestamp, and one that does not is
48
+ not a live link.
49
+
50
+ - **A transport names its endpoints in `urls`, and only there.** The singular
51
+ `url` was the older spelling of the same thing, was never part of
52
+ `ILiveTransport`, and `isLiveTransport()` no longer looks at it. A transport
53
+ that carries only `url` is still recognised - an unknown property is not an
54
+ error - but it names no endpoint, so there is nothing to show and nothing to
55
+ poll. The fixtures, the format documentation and the tests all say `urls`.
56
+
57
+ - **`Transport` is now `LiveTransports`, `ITransport` is `ILiveTransport`, and
58
+ `ITransportURL` is gone.** An entry of `urls` is either the URL itself or a
59
+ `chargyInterfaces.IURL` carrying it alongside a `priority` and a `weight`.
60
+ The type guard is `isLiveTransport()`; the top-level export keeps the name
61
+ `isTransport`, so a consumer importing it from the package index sees no
62
+ rename, while one reaching through the `ChargeTransparencyLiveLink` namespace
63
+ has to follow.
64
+
65
+ - **`TOTPConfig` moved to `chargyInterfaces`, and `initialSharedSecret` is now
66
+ `sharedSecret`.** It also gained `validityTime`, `totpLength`, `alphabet`,
67
+ `timestamp` and `hashAlgorithm`, and `timeStep` became optional - the shape
68
+ the TOTP library actually takes. `isTOTPConfig()` validates it, and
69
+ `isLiveTransport()` calls it, so a transport still spelling the secret the
70
+ old way is dropped along with its TOTP.
71
+
72
+ - **The top-level `IURL` is a different type now.** `chargyInterfaces.IURL` -
73
+ a `url` with an optional `priority` and `weight` - is what the name resolves
74
+ to when it is imported from the package index; the JSON-LD document with the
75
+ `@context` of `URLContext` is `SimpleURL.IURL` and is no longer re-exported
76
+ by name. The two guards keep them apart: `IsAURL()` judges the document,
77
+ `isURL()` the transport endpoint. Code importing `IURL` from the index keeps
78
+ compiling and means something else.
79
+
80
+ - **`IChargeTransparencyLiveLink` lost `imageURLs`, `geoLocation` and
81
+ `connector`.** Images belong to whoever they show, so they hang off
82
+ `IChargingStationOperator`, `IChargingStation` and the other things that have
83
+ one; the position belongs to the charging station, and the connector to its
84
+ EVSE. A document keeps saying all of it, one level further in.
85
+
86
+ - **`ILegallyRelevantLogMessage` moved from `IChargeTransparencyRecord` to
87
+ `chargyInterfaces`,** where a live link can reach it as easily as a record
88
+ can, and `isConnector()` moved to `chargyInterfaces` next to the `IConnector`
89
+ it validates. Both keep their names at the package index; only the
90
+ namespace-qualified paths change.
91
+
92
+ ### Added
93
+
94
+ - **The interfaces name the quantities they carry.** A metrological value is
95
+ text - `"22 kW"`, `"(230.00 ±0.12) V, k=2"` - because resolution and
96
+ uncertainty are part of the reading and a number would drop both, so `Volt`,
97
+ `Ampere`, `Watt`, `WattHour`, `Ohm`, `Meter`, `Second` and `Kelvin` are
98
+ aliases of `MetrologicalText` rather than of `number`. `Timestamp`,
99
+ `CalendarDate`, `LocalTime`, `ISO8601Duration`, `DurationSeconds`, `Degrees`,
100
+ `LinkedDataContext`, `URL`, `UnitSymbol`, `DecimalScale` and
101
+ `MeasurementMagnitude` do the same for the values that were plain strings and
102
+ numbers before. They document meaning and do not validate syntax: parse at
103
+ the serialization boundary before doing arithmetic.
104
+
105
+ - **A live link says what it is about, not only where to fetch it.** It may now
106
+ carry its `timeSource`, `lastUpdated`, `updates` and `docRefIdGeneration`,
107
+ the `chargingStationOperator`, `chargingStation`, `chargingSessionId`,
108
+ `eMobilityProvider` and `contract` of the session, its `signedMeterValues`,
109
+ `chargingPeriods`, `legallyRelevantLogMessages` and `supportMessages`, and
110
+ the `keyIdGeneration` its signatures are read under. Most of it was already
111
+ in the documents and read untyped; it is described now.
112
+
113
+ - **`@context` may be a list.** A document can name an extension context
114
+ alongside this one, and is recognised as long as the list contains the live
115
+ link context.
116
+
117
+ - **New shapes for what the documents already contained:**
118
+ `IDocumentSignature` - the signature `verifyDocumentSignatures()` consumes -,
119
+ `ISignedMeterValues`, `ITimeSource` with `ITimeServer`, `ISupportMessage`,
120
+ `ILocalController`, `ITemperatureSensor` and `IMetrologicalCable`, the cable
121
+ profile that states its length and resistance as quantity text without a
122
+ second unit field.
123
+
124
+ - **The topology interfaces carry ids next to their objects.** A charging pool,
125
+ station, EVSE or energy meter can name what it belongs to and what belongs to
126
+ it by id - `chargingStationIds`, `EVSEIds`, `energyMeterIds`,
127
+ `chargingTariffIds`, `temperaturSensorIds` and the singular counterparts -
128
+ so a document may reference rather than nest. They also gained `imageURLs`,
129
+ an operator gained a `name`, an EVSE a `powerType` and a `maxPower`, and a
130
+ public key `keyUsage` and `encodings`.
131
+
132
+ ### Changed
133
+
134
+ - **The OCMF-Test-01 fixture series is regenerated from its template and
135
+ re-signed,** which the changed transport of every document required.
136
+
137
+ ### Internal dependencies
138
+
139
+ - @types/node 26.4.1, eslint 10.10.0, globals 17.12.0, playwright 1.63.0 and
140
+ typescript-eslint 8.69.0. The last of those extends
141
+ `no-meaningless-void-operator` to expressions that are not calls, which
142
+ caught the `void x;` idiom marking a parameter as deliberately unused. Those
143
+ parameters now carry the underscore prefix `argsIgnorePattern` already
144
+ covers, the way `_Context` always did.
145
+
146
+
10
147
  ## [0.14.4] - 2026-09-05
11
148
 
12
149
  ### Changed
package/README.md CHANGED
@@ -185,7 +185,7 @@ npx playwright install chromium
185
185
  ## Publishing
186
186
 
187
187
  ```bash
188
- npm version 0.15.0 --no-git-tag-version
188
+ npm version 0.15.1 --no-git-tag-version
189
189
  npm run verify
190
190
  npm pack --dry-run
191
191
  npm pack
@@ -2006,7 +2006,7 @@ function OIDInfo(data) {
2006
2006
  return "";
2007
2007
  }
2008
2008
  function isTOTPConfig(data) {
2009
- return isObject(data) && typeof data["sharedSecret"] === "string" && (data["timeStep"] === void 0 || typeof data["timeStep"] === "number") && (data["validityTime"] === void 0 || typeof data["validityTime"] === "number") && (data["totpLength"] === void 0 || typeof data["totpLength"] === "number") && (data["alphabet"] === void 0 || typeof data["alphabet"] === "string") && (data["timestamp"] === void 0 || typeof data["timestamp"] === "string") && (data["hashAlgorithm"] === void 0 || typeof data["hashAlgorithm"] === "number");
2009
+ return isObject(data) && typeof data["sharedSecret"] === "string" && (data["timeStep"] === void 0 || typeof data["timeStep"] === "number") && (data["validityTime"] === void 0 || typeof data["validityTime"] === "number") && (data["totpLength"] === void 0 || typeof data["totpLength"] === "number") && (data["alphabet"] === void 0 || typeof data["alphabet"] === "string") && (data["timestamp"] === void 0 || typeof data["timestamp"] === "string") && (data["hashAlgorithm"] === void 0 || typeof data["hashAlgorithm"] === "string");
2010
2010
  }
2011
2011
  function isURL(data) {
2012
2012
  if (typeof data === "string")