@open-charging-cloud/wwcp-poi 0.1.1 → 0.3.0

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.
Files changed (106) hide show
  1. package/CHANGELOG.md +382 -0
  2. package/README.md +534 -362
  3. package/dist/crypto/ber.d.ts +48 -0
  4. package/dist/crypto/ber.d.ts.map +1 -0
  5. package/dist/crypto/certificates.d.ts +21 -0
  6. package/dist/crypto/certificates.d.ts.map +1 -0
  7. package/dist/crypto/curves.d.ts +25 -0
  8. package/dist/crypto/curves.d.ts.map +1 -0
  9. package/dist/crypto/ecc.d.ts +34 -0
  10. package/dist/crypto/ecc.d.ts.map +1 -0
  11. package/dist/crypto/publicKeys.d.ts +51 -0
  12. package/dist/crypto/publicKeys.d.ts.map +1 -0
  13. package/dist/crypto/rsa.d.ts +30 -0
  14. package/dist/crypto/rsa.d.ts.map +1 -0
  15. package/dist/encoding/text.d.ts +9 -0
  16. package/dist/encoding/text.d.ts.map +1 -1
  17. package/dist/evTaler/amounts.d.ts +89 -0
  18. package/dist/evTaler/amounts.d.ts.map +1 -0
  19. package/dist/evTaler/contractTerms.d.ts +107 -0
  20. package/dist/evTaler/contractTerms.d.ts.map +1 -0
  21. package/dist/evTaler/meterValue.d.ts +65 -0
  22. package/dist/evTaler/meterValue.d.ts.map +1 -0
  23. package/dist/evTaler/payURI.d.ts +28 -0
  24. package/dist/evTaler/payURI.d.ts.map +1 -0
  25. package/dist/evTaler/settlement.d.ts +85 -0
  26. package/dist/evTaler/settlement.d.ts.map +1 -0
  27. package/dist/evTaler/step.d.ts +72 -0
  28. package/dist/evTaler/step.d.ts.map +1 -0
  29. package/dist/history/apply.d.ts +6 -1
  30. package/dist/history/apply.d.ts.map +1 -1
  31. package/dist/history/changeSet.d.ts +18 -2
  32. package/dist/history/changeSet.d.ts.map +1 -1
  33. package/dist/history/checkpoint.d.ts +7 -0
  34. package/dist/history/checkpoint.d.ts.map +1 -1
  35. package/dist/history/commit.d.ts +13 -1
  36. package/dist/history/commit.d.ts.map +1 -1
  37. package/dist/history/elements.d.ts +19 -0
  38. package/dist/history/elements.d.ts.map +1 -0
  39. package/dist/history/epoch.d.ts +2 -0
  40. package/dist/history/epoch.d.ts.map +1 -1
  41. package/dist/history/history.d.ts +46 -6
  42. package/dist/history/history.d.ts.map +1 -1
  43. package/dist/history/preconditions.d.ts +22 -0
  44. package/dist/history/preconditions.d.ts.map +1 -0
  45. package/dist/index.d.ts +18 -4
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +10296 -1558
  48. package/dist/index.js.map +1 -1
  49. package/dist/json/canonical.d.ts.map +1 -1
  50. package/dist/keys.d.ts +2 -0
  51. package/dist/keys.d.ts.map +1 -1
  52. package/dist/network/certificates.d.ts +16 -4
  53. package/dist/network/certificates.d.ts.map +1 -1
  54. package/dist/network/countries.d.ts +16 -0
  55. package/dist/network/countries.d.ts.map +1 -0
  56. package/dist/network/evTaler.d.ts +1 -14
  57. package/dist/network/evTaler.d.ts.map +1 -1
  58. package/dist/network/identifications.d.ts +6 -6
  59. package/dist/network/identifications.d.ts.map +1 -1
  60. package/dist/network/measurementPublicKey.d.ts +7 -0
  61. package/dist/network/measurementPublicKey.d.ts.map +1 -0
  62. package/dist/network/offers.d.ts +53 -0
  63. package/dist/network/offers.d.ts.map +1 -0
  64. package/dist/network/partyKeys.d.ts +8 -5
  65. package/dist/network/partyKeys.d.ts.map +1 -1
  66. package/dist/network/poiJSON.d.ts +172 -0
  67. package/dist/network/poiJSON.d.ts.map +1 -0
  68. package/dist/network/poiValues.d.ts +48 -0
  69. package/dist/network/poiValues.d.ts.map +1 -0
  70. package/dist/network/reading.d.ts +46 -0
  71. package/dist/network/reading.d.ts.map +1 -0
  72. package/dist/network/references.d.ts +36 -0
  73. package/dist/network/references.d.ts.map +1 -0
  74. package/dist/network/roamingNetwork.d.ts +10 -11
  75. package/dist/network/roamingNetwork.d.ts.map +1 -1
  76. package/dist/network/timeZones.d.ts +8 -0
  77. package/dist/network/timeZones.d.ts.map +1 -0
  78. package/dist/network/tree.d.ts +14 -0
  79. package/dist/network/tree.d.ts.map +1 -1
  80. package/dist/network/versionTexts.d.ts +1 -7
  81. package/dist/network/versionTexts.d.ts.map +1 -1
  82. package/dist/network/writtenForm.d.ts.map +1 -1
  83. package/dist/proofs/priceStatement.d.ts.map +1 -1
  84. package/dist/proofs/stationProof.d.ts +2 -0
  85. package/dist/proofs/stationProof.d.ts.map +1 -1
  86. package/dist/proofs/trustContext.d.ts +6 -0
  87. package/dist/proofs/trustContext.d.ts.map +1 -1
  88. package/dist/verifier/chargingStation.d.ts +5 -0
  89. package/dist/verifier/chargingStation.d.ts.map +1 -1
  90. package/dist/verifier/checkpoints.d.ts +6 -0
  91. package/dist/verifier/checkpoints.d.ts.map +1 -1
  92. package/dist/verifier/documentKeys.d.ts +27 -0
  93. package/dist/verifier/documentKeys.d.ts.map +1 -0
  94. package/dist/verifier/historicalMeasurements.d.ts +96 -0
  95. package/dist/verifier/historicalMeasurements.d.ts.map +1 -0
  96. package/dist/verifier/measurementKeys.d.ts +48 -0
  97. package/dist/verifier/measurementKeys.d.ts.map +1 -0
  98. package/dist/verifier/observedVersions.d.ts +70 -0
  99. package/dist/verifier/observedVersions.d.ts.map +1 -0
  100. package/dist/verifier/pricePublication.d.ts +74 -0
  101. package/dist/verifier/pricePublication.d.ts.map +1 -0
  102. package/dist/verifier/sessionPrices.d.ts +75 -0
  103. package/dist/verifier/sessionPrices.d.ts.map +1 -0
  104. package/dist/verifier/trustTransitions.d.ts +67 -0
  105. package/dist/verifier/trustTransitions.d.ts.map +1 -0
  106. package/package.json +15 -14
@@ -0,0 +1,85 @@
1
+ import { type JSONObject, type JSONValue } from '../json/value.ts';
2
+ import type { VerifiedChargingStation } from '../verifier/chargingStation.ts';
3
+ import { NetDecimal } from './amounts.ts';
4
+ import { type EVTalerAmountCheck, type EVTalerVerifiedStep } from './contractTerms.ts';
5
+ import { EVTalerSignedMeterValue, type EVTalerMeterValueVerifier, type EVTalerVerifiedMeterValue } from './meterValue.ts';
6
+ /** The JSON-LD context of a settlement statement. */
7
+ export declare const EV_TALER_SETTLEMENT_CONTEXT: string;
8
+ /** An order of a step of a session and what it took. */
9
+ export interface EVTalerSettledOrder {
10
+ readonly orderId: string;
11
+ readonly amount: NetDecimal;
12
+ }
13
+ /** What a reader established of a settlement statement (`EVTalerSettlementVerification`, 5.4). */
14
+ export interface EVTalerSettlementVerification {
15
+ readonly settlement: EVTalerSettlement;
16
+ /** The signed meter values at the start and at the end, verified. */
17
+ readonly start: EVTalerVerifiedMeterValue;
18
+ readonly end: EVTalerVerifiedMeterValue;
19
+ /** The energy of the session, in kWh: the end value less the start value. */
20
+ readonly energy: NetDecimal;
21
+ /** The price of the session by its rates, where they are of the simple profile. */
22
+ readonly computedPrice: NetDecimal | undefined;
23
+ /** Exact when the price was recalculated, else unsupported. */
24
+ readonly priceCheck: EVTalerAmountCheck;
25
+ readonly diagnostics: readonly string[];
26
+ }
27
+ /** The settlement statement of an EV Taler session (`EVTalerSettlement`). */
28
+ export declare class EVTalerSettlement {
29
+ /** The JSON as signed. */
30
+ readonly json: JSONObject;
31
+ /** When it started: the time of the signed meter value at the start, in milliseconds since 1970. */
32
+ readonly start: number;
33
+ /** When it ended: the time of the signed meter value at the end. */
34
+ readonly end: number;
35
+ /** The signed meter values at the start and at the end, as the station sent them. */
36
+ readonly meterValues: readonly [EVTalerSignedMeterValue, EVTalerSignedMeterValue];
37
+ /** The energy, in kWh. */
38
+ readonly energy: NetDecimal;
39
+ /** The orders of the steps, in their order, and what each took. */
40
+ readonly orders: readonly EVTalerSettledOrder[];
41
+ readonly price: NetDecimal;
42
+ /** What the steps took together. */
43
+ readonly paid: NetDecimal;
44
+ /** What was refunded: the paid amount less the price, not less than nothing. */
45
+ readonly refunded: NetDecimal;
46
+ readonly signedAt: number;
47
+ private constructor();
48
+ private text;
49
+ get roamingNetworkId(): string;
50
+ get EVSEId(): string;
51
+ get sessionId(): string;
52
+ /** The public key of the merchant instance that took the steps, as in evTaler. */
53
+ get merchantPublicKey(): string;
54
+ get chargingTariffId(): string;
55
+ /** The digest of the price statement that priced it, if any. */
56
+ get priceStatement(): string | undefined;
57
+ get currency(): string;
58
+ /** The charging station operator signing it. */
59
+ get signer(): string;
60
+ get algorithm(): string;
61
+ /** The @id of the signing key. */
62
+ get keyId(): string;
63
+ /** The signature, Base64. */
64
+ get value(): string;
65
+ /**
66
+ * Reads the given settlement statement (`EVTalerSettlement.TryParse`): its context and role, nothing it does not know,
67
+ * both signed meter values, at least one order, its decimals as texts, what was paid the sum of the orders and what was
68
+ * refunded the paid amount less the price, not less than nothing. Refused in the words of WWCP_POI.
69
+ */
70
+ static parse(json: JSONValue | undefined): EVTalerSettlement;
71
+ /** The signature input: the canonical JSON of what it names, but its value. */
72
+ signingBytes(): Uint8Array;
73
+ /**
74
+ * Verifies this settlement statement against the verified charging station and the verified steps of its session
75
+ * (`EVTalerSettlement.TryVerify`, 5.4): signed by the operator with a key that may sign payments, valid when it was
76
+ * signed; of the merchant, EVSE, session, tariff and price statement of the steps, naming their orders and amounts; both
77
+ * signed meter values verified with one measurement key the proof gives, the start value the one the steps name, the end
78
+ * value after and not below it, the times and the energy theirs; and, where the prices are of the simple profile, the
79
+ * price recalculated. Refused in the words of WWCP_POI.
80
+ */
81
+ verify(station: VerifiedChargingStation, steps: readonly EVTalerVerifiedStep[], verifier: EVTalerMeterValueVerifier): EVTalerSettlementVerification;
82
+ /** E.g. "7.412 kWh, 5.32 EUR". */
83
+ toString(): string;
84
+ }
85
+ //# sourceMappingURL=settlement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settlement.d.ts","sourceRoot":"","sources":["../../src/evTaler/settlement.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAmC,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAGpG,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC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B,IAAI,EAAU,UAAU;IACxC,gFAAgF;aAChE,QAAQ,EAAM,UAAU;aACxB,QAAQ,EAAM,MAAM;IAlBxC,OAAO;IAqBP,OAAO,CAAC,IAAI;IAKZ,IAAW,gBAAgB,IAAM,MAAM,CAA0C;IACjF,IAAW,MAAM,IAAgB,MAAM,CAAgC;IACvE,IAAW,SAAS,IAAa,MAAM,CAAmC;IAC1E,kFAAkF;IAClF,IAAW,iBAAiB,IAAK,MAAM,CAA2C;IAClF,IAAW,gBAAgB,IAAM,MAAM,CAA0C;IACjF,gEAAgE;IAChE,IAAW,cAAc,IAAQ,MAAM,GAAG,SAAS,CAA6G;IAChK,IAAW,QAAQ,IAAc,MAAM,CAAkC;IACzE,gDAAgD;IAChD,IAAW,MAAM,IAAgB,MAAM,CAAgC;IACvE,IAAW,SAAS,IAAa,MAAM,CAAmC;IAC1E,kCAAkC;IAClC,IAAW,KAAK,IAAiB,MAAM,CAA+B;IACtE,6BAA6B;IAC7B,IAAW,KAAK,IAAiB,MAAM,CAA+B;IAEtE;;;;OAIG;WACW,KAAK,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,iBAAiB;IAyFnE,+EAA+E;IACxE,YAAY,IAAI,UAAU;IAIjC;;;;;;;OAOG;IACI,MAAM,CAAC,OAAO,EAAI,uBAAuB,EAClC,KAAK,EAAM,SAAS,mBAAmB,EAAE,EACzC,QAAQ,EAAG,yBAAyB,GAAG,6BAA6B;IAoHlF,kCAAkC;IAC3B,QAAQ,IAAI,MAAM;CAI5B"}
@@ -0,0 +1,72 @@
1
+ import { type JSONObject, type JSONValue } from '../json/value.ts';
2
+ import { NetDecimal } from './amounts.ts';
3
+ import { EVTalerSignedMeterValue } from './meterValue.ts';
4
+ /** The JSON-LD context of a step. */
5
+ export declare const EV_TALER_STEP_CONTEXT: string;
6
+ /** What a step covers: energy, in kWh, or time, in minutes. */
7
+ export type EVTalerCoversUnit = 'kWh' | 'min';
8
+ /** What a step of an EV Taler session pays for, counted from the start of the session: from, to, and the unit. */
9
+ export declare class EVTalerCovers {
10
+ readonly from: NetDecimal;
11
+ readonly to: NetDecimal;
12
+ readonly unit: EVTalerCoversUnit;
13
+ private constructor();
14
+ /** What a step covers: from less than to, neither negative, in kWh or minutes; refused in the words of WWCP_POI otherwise. */
15
+ static create(from: NetDecimal | number, to: NetDecimal | number, unit: string): EVTalerCovers;
16
+ /** Reads what a step covers (`EVTalerCovers.TryParse`), its decimals as texts; refused in its words. */
17
+ static parse(json: JSONValue | undefined): EVTalerCovers;
18
+ /** The decimals as texts. */
19
+ toJSON(): JSONObject;
20
+ equals(other: EVTalerCovers): boolean;
21
+ /** E.g. "0 to 5 kWh". */
22
+ toString(): string;
23
+ }
24
+ /** Whether the given text is a session of the offers server: 128 bits, canonical base64url without padding, 22 characters. */
25
+ export declare function isEVTalerSessionId(text: string | undefined): text is string;
26
+ /** The data of a step: as `EVTalerStep.create` takes it. */
27
+ export interface EVTalerStepData {
28
+ readonly roamingNetworkId: string;
29
+ readonly EVSEId: string;
30
+ readonly sessionId: string;
31
+ readonly step: number;
32
+ readonly previousOrderId?: string | undefined;
33
+ readonly chargingTariffId: string;
34
+ readonly priceStatement?: string | undefined;
35
+ readonly covers: EVTalerCovers;
36
+ readonly startMeterValue?: EVTalerSignedMeterValue | undefined;
37
+ }
38
+ /**
39
+ * A step of an EV Taler session in WWCP terms (`EVTalerStep`): where, which session, which step after which order, the EV
40
+ * Taler tariff and the price statement, what it covers, and from step 2 on the signed meter value at the start.
41
+ */
42
+ export declare class EVTalerStep {
43
+ /** The roaming network, trimmed as its identification reads it. */
44
+ readonly roamingNetworkId: string;
45
+ /** The EVSE, as the roaming network writes it. */
46
+ readonly EVSEId: string;
47
+ /** The session at the offers server: 128 random bits, base64url. Not GNU Taler's session_id of an order. */
48
+ readonly sessionId: string;
49
+ /** The number of the step: 1, 2, … */
50
+ readonly step: number;
51
+ /** The order_id of the step before; none in step 1. */
52
+ readonly previousOrderId: string | undefined;
53
+ /** The EV Taler tariff of the EVSE (4.3). */
54
+ readonly chargingTariffId: string;
55
+ /** The digest of the price statement whose elements price the session; none when the tariff's own do. */
56
+ readonly priceStatement: string | undefined;
57
+ readonly covers: EVTalerCovers;
58
+ /** From step 2 on: the signed meter value at the start of the session, as the station sent it. */
59
+ readonly startMeterValue: EVTalerSignedMeterValue | undefined;
60
+ private constructor();
61
+ /** A step of an EV Taler session, refused in the words of WWCP_POI where it is no valid one. */
62
+ static create(data: EVTalerStepData): EVTalerStep;
63
+ /**
64
+ * Reads a step of an EV Taler session, the object of "extra": { "wwcp": … } (`EVTalerStep.TryParse`): its context,
65
+ * nothing it does not know, and the rules of `create`; refused in the words of WWCP_POI.
66
+ */
67
+ static parse(json: JSONValue | undefined): EVTalerStep;
68
+ /** The JSON of "extra": { "wwcp": … }. */
69
+ toJSON(): JSONObject;
70
+ private invalid;
71
+ }
72
+ //# sourceMappingURL=step.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../src/evTaler/step.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAiB,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAIlF,OAAO,EAAiB,UAAU,EAAgB,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAO1D,qCAAqC;AACrC,eAAO,MAAM,qBAAqB,QAAmD,CAAC;AAEtF,+DAA+D;AAC/D,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,KAAK,CAAC;AAG9C,kHAAkH;AAClH,qBAAa,aAAa;aAGF,IAAI,EAAG,UAAU;aACjB,EAAE,EAAK,UAAU;aACjB,IAAI,EAAG,iBAAiB;IAH5C,OAAO;IAMP,8HAA8H;WAChH,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,EAAE,EAAE,EAAE,UAAU,GAAG,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa;IAerG,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E,OAAO;IAoBP,gGAAgG;WAClF,MAAM,CAAC,IAAI,EAAE,eAAe,GAAG,WAAW;IAkBxD;;;OAGG;WACW,KAAK,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW;IA0D7D,0CAA0C;IACnC,MAAM,IAAI,UAAU;IAe3B,OAAO,CAAC,OAAO;CAiClB"}
@@ -1,5 +1,5 @@
1
1
  import { RoamingNetwork } from '../network/roamingNetwork.ts';
2
- import type { ChangeSet } from './changeSet.ts';
2
+ import { type ChangeSet } from './changeSet.ts';
3
3
  /**
4
4
  * Checks the signatures of a change set against the version it is applied to (4.1): every signature valid, by a key of a
5
5
  * party of the version valid at `createdAt` or by a new identity key of one of its changes (proof of possession); for every
@@ -11,6 +11,11 @@ export declare function checkOwnership(before: RoamingNetwork, changeSet: Change
11
11
  * Applies a change set to the version it fits (4, 5.2): its owners signed it (unless `checkOwnership` is false), its
12
12
  * `beforeETags` are those of the version, its changes apply, and the result has its `afterETags`. Returns the new version.
13
13
  */
14
+ /**
15
+ * The stamp of a change set applied to the given version (SPECIFICATION.md 4, S5): its createdAt, or the lastChange of the
16
+ * roaming network of the version, where that is later; in milliseconds since 1970.
17
+ */
18
+ export declare function stampOf(before: RoamingNetwork, changeSet: ChangeSet): number;
14
19
  export declare function applyChangeSet(before: RoamingNetwork, changeSet: ChangeSet, options?: {
15
20
  checkOwnership?: boolean;
16
21
  }): RoamingNetwork;
@@ -1 +1 @@
1
- {"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../src/history/apply.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,cAAc,EAAE,MAAsB,8BAA8B,CAAC;AAK9E,OAAO,KAAK,EAAU,SAAS,EAAE,MAAc,gBAAgB,CAAC;AAwiChE;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI,CA6IjF;AAuBD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,GAAE;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,cAAc,CAoEvI"}
1
+ {"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../src/history/apply.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,cAAc,EAAE,MAAsB,8BAA8B,CAAC;AAM9E,OAAO,EAAoD,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AA+mDlG;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI,CA6KjF;AAuBD;;;GAGG;AACH;;;GAGG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,GAAG,MAAM,CAI5E;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,GAAE;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,cAAc,CAiFvI"}
@@ -1,6 +1,7 @@
1
1
  import { type JSONObject, type JSONValue } from '../json/value.ts';
2
2
  import { type ETag } from '../etags.ts';
3
3
  import type { POIPublicKey } from '../keys.ts';
4
+ import { type Precondition } from './preconditions.ts';
4
5
  /** The context of a change set, also of the signature input of its signatures (4). */
5
6
  export declare const CHANGE_SET_CONTEXT: string;
6
7
  /** How the identification of the change set of a merge starts, which is identified by its parents, not by its content (5.3). */
@@ -12,6 +13,20 @@ export declare const MERGE_CHANGE_SET_ID_PREFIX = "merge-";
12
13
  export declare function changeSetIdentification(json: JSONObject): string;
13
14
  /** The kinds of changes (SPECIFICATION.md section 4). */
14
15
  export type ChangeKind = 'Add' | 'Remove' | 'UpdateProperty' | 'RemoveProperty' | 'AddElement' | 'RemoveElement' | 'ReplaceElement' | 'UpdateElementProperty' | 'RemoveElementProperty';
16
+ /** The context of a segment of an element path, where it is given. */
17
+ export declare const ELEMENT_PATH_SEGMENT_CONTEXT: string;
18
+ /**
19
+ * One step of an element path (`POIElementPathSegment`): a property of the entity, or of the element the step before
20
+ * addresses, and the identification of an element of it, which an array needs and one identified object may name.
21
+ */
22
+ export interface ElementPathSegment {
23
+ readonly propertyName: string;
24
+ readonly elementId: string | undefined;
25
+ }
26
+ /** Whether a change addresses an element of a property of its entity by its element path. */
27
+ export declare const isElementChange: (change: Change) => boolean;
28
+ /** The property of the entity itself a change changes: of an element change the one its path starts with. */
29
+ export declare const entityPropertyName: (change: Change) => string | undefined;
15
30
  /** One change of a change set. */
16
31
  export interface Change {
17
32
  readonly kind: ChangeKind;
@@ -23,7 +38,8 @@ export interface Change {
23
38
  readonly newValue: JSONValue | undefined;
24
39
  readonly parentEntityType: string | undefined;
25
40
  readonly parentEntityId: string | undefined;
26
- readonly elementPath: readonly JSONObject[] | undefined;
41
+ /** The element path of an element change, not empty; `undefined` for every other change. */
42
+ readonly elementPath: readonly ElementPathSegment[] | undefined;
27
43
  readonly json: JSONObject;
28
44
  }
29
45
  /** A signature of a change set: by an owner of one of its changes, or a new identity key as its proof of possession. */
@@ -41,7 +57,7 @@ export declare class ChangeSet {
41
57
  readonly roamingNetworkId: string;
42
58
  readonly createdAt: number;
43
59
  readonly changes: readonly Change[];
44
- readonly preconditions: readonly JSONObject[];
60
+ readonly preconditions: readonly Precondition[];
45
61
  readonly beforeETags: readonly ETag[];
46
62
  readonly afterETags: readonly ETag[];
47
63
  readonly signatures: readonly ChangeSetSignature[];
@@ -1 +1 @@
1
- {"version":3,"file":"changeSet.d.ts","sourceRoot":"","sources":["../../src/history/changeSet.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAwC,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAIzG,OAAO,EAAc,KAAK,IAAI,EAAE,MAAU,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAc,YAAY,CAAC;AAIvD,sFAAsF;A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AS,MAAM,EAAE;aACpC,aAAa,EAAM,SAAS,YAAY,EAAE;aAC1C,WAAW,EAAQ,SAAS,IAAI,EAAE;aAClC,UAAU,EAAS,SAAS,IAAI,EAAE;aAClC,UAAU,EAAS,SAAS,kBAAkB,EAAE;aAChD,IAAI,EAAe,UAAU;IATjD,OAAO;WAaO,KAAK,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS;IA4F5D,6CAA6C;IAC7C,IAAW,WAAW,IAAI,MAAM,GAAG,SAAS,CAG3C;IAED,mIAAmI;IAC5H,YAAY,CAAC,SAAS,EAAE,kBAAkB,GAAG,UAAU;IAS9D,iDAAiD;IAC1C,eAAe,CAAC,SAAS,EAAE,kBAAkB,EAAE,GAAG,EAAE,YAAY,GAAG,IAAI;CASjF"}
@@ -36,6 +36,13 @@ export declare class Checkpoint {
36
36
  private constructor();
37
37
  /** Whether this is the final checkpoint of its epoch, `"final": true` with the next epoch (11.2). */
38
38
  get isFinal(): boolean;
39
+ /**
40
+ * This checkpoint with only those of its signatures that are given, e.g. the ones verified where it is taken
41
+ * (`WithSignaturesOnly` of WWCP_POI 399b7c8, POI3-ISSUES.md S39): the others left out, its identification the same.
42
+ * A signature is given when one of the same role, signer, time, algorithm, key and value is, each given one once: of
43
+ * two exact copies, one given keeps the first alone, as WWCP_POI reads them as one.
44
+ */
45
+ withSignaturesOnly(signatures: readonly RoleSignature[]): Checkpoint;
39
46
  static parse(value: JSONValue | undefined): Checkpoint;
40
47
  /** What the identification is the digest of: the checkpoint without `@id` and `signatures`, with its `@context`. */
41
48
  identificationContent(): JSONObject;
@@ -1 +1 @@
1
- {"version":3,"file":"checkpoint.d.ts","sourceRoot":"","sources":["../../src/history/checkpoint.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAgB,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAAc,OAAO,EAAqB,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAuC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kHAAkH;IAC3G,aAAa,IAAI,UAAU;IAM3B,YAAY,CAAC,SAAS,EAAE,aAAa,GAAG,UAAU;IAIzD,8EAA8E;IACvE,eAAe,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,EAAE,YAAY,GAAG,IAAI;IASzE,iFAAiF;IAC1E,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAKpC;;;;OAIG;IACI,aAAa,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI;CAazD;AAGD,iIAAiI;AACjI,eAAO,MAAM,cAAc,GAAI,MAAM,UAAU,EAAE,WAAW,aAAa,KAAG,UAC3B,CAAC;AAElD,qEAAqE;AACrE,eAAO,MAAM,WAAW,GAAI,SAAS,SAAS,MAAM,EAAE,EAAE,WAAW,aAAa,KAAG,UAC6B,CAAC;AAGjH;;;GAGG;AACH,qBAAa,eAAe;aAGJ,YAAY,EAAG,MAAM;aACrB,IAAI,EAAW,UAAU;aACzB,QAAQ,EAAO,MAAM;aACrB,QAAQ,EAAO,MAAM;aACrB,KAAK,EAAU,SAAS,IAAI,EAAE;aAC9B,KAAK,EAAU,MAAM;aACrB,IAAI,EAAW,MAAM;aACrB,SAAS,EAAM,SAAS,UAAU,EAAE;aACpC,IAAI,EAAW,UAAU;IAT7C,OAAO;WAaO,KAAK,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,eAAe;IA2BlE;;;OAGG;IACI,MAAM,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;CAe9C;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -12,7 +12,7 @@ export declare const SignatureRoles: {
12
12
  readonly ChargingStationOperator: "chargingStationOperator";
13
13
  readonly Witness: "witness";
14
14
  };
15
- /** A signature of a commit or a checkpoint (5.4, 10.2), its `signedAt` signed as written. */
15
+ /** A signature of a commit or a checkpoint (5.4, 10.2), as WWCP_POI3 reads it: its role, time, algorithm, key and value trimmed. */
16
16
  export interface RoleSignature {
17
17
  readonly role: string;
18
18
  readonly signer: string | undefined;
@@ -23,6 +23,18 @@ export interface RoleSignature {
23
23
  readonly json: JSONObject;
24
24
  }
25
25
  export declare function parseRoleSignature(value: JSONValue | undefined, what: string): RoleSignature;
26
+ /** Whether two signatures of a commit or checkpoint are the same: of one role, signer, time, algorithm, key and value. */
27
+ export declare const sameRoleSignature: (a: RoleSignature, b: RoleSignature) => boolean;
28
+ /**
29
+ * Whether two signatures of a commit or checkpoint are of one key in one role (`IsOfTheSameKeyAndRoleAs` of WWCP_POI):
30
+ * where a checkpoint is taken, the first of them that verifies is kept (S39).
31
+ */
32
+ export declare const ofTheSameKeyAndRole: (a: RoleSignature, b: RoleSignature) => boolean;
33
+ /**
34
+ * A signature of a commit or checkpoint as WWCP_POI names it in its messages (`ToString`): its role, its signer if it
35
+ * names one, its key and when it signed.
36
+ */
37
+ export declare const describeRoleSignature: (signature: RoleSignature) => string;
26
38
  /** The signature input of a commit or checkpoint signature: its own fields, and what it signs under `property`. */
27
39
  export declare function roleSignatureBytes(context: string, signature: RoleSignature, property: string, signed: JSONObject): Uint8Array;
28
40
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"commit.d.ts","sourceRoot":"","sources":["../../src/history/commit.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAe,OAAO,EAAqB,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE5G,OAAO,EAAuC,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE5F,OAAO,EAAc,KAAK,IAAI,EAAE,MAAU,aAAa,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAEvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAc,YAAY,CAAC;AAIvD,eAAO,MAAM,cAAc,QAAyD,CAAC;AACrF,eAAO,MAAM,wBAAwB,QAAwD,CAAC;AAG9F,iEAAiE;AACjE,eAAO,MAAM,cAAc;;;;;CAKjB,CAAC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;IAYlC,0DAA0D;IACnD,YAAY,CAAC,SAAS,EAAE,aAAa,GAAG,UAAU;IAIzD,8EAA8E;IACvE,eAAe,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,EAAE,YAAY,GAAG,IAAI;IASzE,gEAAgE;IAChE,IAAW,WAAW,IAAI,MAAM,GAAG,SAAS,CAG3C;IAED,+GAA+G;IACxG,cAAc,IAAI,UAAU;CAItC;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { type JSONValue } from '../json/value.ts';
2
+ import type { Change, ElementPathSegment } from './changeSet.ts';
3
+ /** An element path as a text for messages, e.g. `chargingConnectors['1'].maxPower` (`PathText`). */
4
+ export declare function pathText(path: readonly ElementPathSegment[], propertyName?: string): string;
5
+ /** What an element change makes of the property its path starts with, or why it does not apply. */
6
+ export type ElementApplied = {
7
+ readonly error: string;
8
+ } | {
9
+ readonly error?: undefined;
10
+ readonly newValue: JSONValue | undefined;
11
+ readonly current: JSONValue | undefined;
12
+ };
13
+ /**
14
+ * Applies an element change to the value of the property of the entity its path starts with (`POIElements.TryApply`):
15
+ * the new value of that property, `undefined` when it is removed, and the value the change finds, as its old value names
16
+ * it: the element, or the property of the element, `undefined` when absent. The given value is not changed.
17
+ */
18
+ export declare function applyElement(change: Change, propertyValue: JSONValue | undefined): ElementApplied;
19
+ //# sourceMappingURL=elements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../src/history/elements.ts"],"names":[],"mappings":"AAkBA,OAAO,EAA8E,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG9H,OAAO,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAgIjE,oGAAoG;AACpG,wBAAgB,QAAQ,CAAC,IAAI,EAAE,SAAS,kBAAkB,EAAE,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAG3F;AAGD,mGAAmG;AACnG,MAAM,MAAM,cAAc,GACpB;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC1B;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,GAAG,SAAS,CAAA;CAAE,CAAC;AAGxH;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,GAAG,SAAS,GAAG,cAAc,CA+LjG"}
@@ -27,6 +27,8 @@ export declare class EpochProfiles {
27
27
  /** An epoch: its number, from 1 on, and its profiles (11.1). */
28
28
  export interface Epoch {
29
29
  readonly number: number;
30
+ /** Locally verified first-checkpoint time; not a wire field. */
31
+ readonly startedAt?: number;
30
32
  readonly profiles: EpochProfiles;
31
33
  }
32
34
  export declare const FIRST_EPOCH: Epoch;
@@ -1 +1 @@
1
- {"version":3,"file":"epoch.d.ts","sourceRoot":"","sources":["../../src/history/epoch.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAgB,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAExE,OAAO,EAAc,KAAK,IAAI,EAAE,MAAW,aAAa,CAAC;AAQzD,eAAO,MAAM,sBAAsB,QAAsD,CAAC;AAC1F,eAAO,MAAM,aAAa,QAAuD,CAAC;AAClF,eAAO,MAAM,kBAAkB,QAAsD,CAAC;AAEtF,0EAA0E;AAC1E,eAAO,MAAM,mBAAmB,2BAA+B,CAAC;AAQhE;;;;GAIG;AACH,qBAAa,aAAa;aAGF,kBAAkB,EAAI,aAAa;aACnC,mBAAmB,EAAG,SAAS,MAAM,EAAE;IAF3D,OAAO;IAKP,2FAA2F;IAC3F,gBAAuB,KAAK,gBAAmC;IAG/D,oHAAoH;WACtG,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AAO,MAAM,mBAAmB,2BAA+B,CAAC;AAQhE;;;;GAIG;AACH,qBAAa,aAAa;aAGF,kBAAkB,EAAI,aAAa;aACnC,mBAAmB,EAAG,SAAS,MAAM,EAAE;IAF3D,OAAO;IAKP,2FAA2F;IAC3F,gBAAuB,KAAK,gBAAmC;IAG/D,oHAAoH;WACtG,KAAK,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,aAAa;IA0ChE,6DAA6D;IACtD,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAMpD,MAAM,IAAI,UAAU;IAWpB,QAAQ,IAAI,MAAM;CAI5B;AAGD,gEAAgE;AAChE,MAAM,WAAW,KAAK;IAClB,QAAQ,CAAC,MAAM,EAAK,MAAM,CAAC;IAC3B,gEAAgE;IAChE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAG,aAAa,CAAC;CACrC;AAED,eAAO,MAAM,WAAW,EAAE,KAAoD,CAAC;AAE/E,kHAAkH;AAClH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,EAAE,IAAI,SAAa,GAAG,KAAK,CAcjF;AAED,+DAA+D;AAC/D,eAAO,MAAM,SAAS,GAAI,MAAM,KAAK,EAAE,OAAO,KAAK,KAAG,OAGoC,CAAC;AAG3F,qGAAqG;AACrG,MAAM,WAAW,SAAS;IACtB,QAAQ,CAAC,KAAK,EAAU,MAAM,CAAC;IAC/B,QAAQ,CAAC,YAAY,EAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAU,SAAS,IAAI,EAAE,CAAC;CAC3C;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAetE"}
@@ -1,7 +1,7 @@
1
1
  import { type JSONValue } from '../json/value.ts';
2
2
  import { RoamingNetwork } from '../network/roamingNetwork.ts';
3
3
  import type { TrustAnchor } from '../proofs/trustAnchor.ts';
4
- import { Commit } from './commit.ts';
4
+ import { Commit, type RoleSignature } from './commit.ts';
5
5
  import { Checkpoint } from './checkpoint.ts';
6
6
  import { EpochProfiles, type Epoch, type EpochLink } from './epoch.ts';
7
7
  /** A version with the commit leading to it. */
@@ -19,9 +19,30 @@ export interface HistoryOptions {
19
19
  * is the version before, unknown for the commit of a snapshot. Required for a signed commit.
20
20
  */
21
21
  readonly verifyCommit?: (commit: Commit, before: RoamingNetwork | undefined, after: RoamingNetwork) => void;
22
- /** Refuses a checkpoint whose signatures are not those required. Required for a signed checkpoint. */
23
- readonly verifyCheckpoint?: (checkpoint: Checkpoint) => void;
22
+ /**
23
+ * Refuses a checkpoint whose signatures are not those required, e.g. of the roaming network operator by its quorum and
24
+ * of the witnesses trusted here (`verifyCheckpointSignatures`), and returns those of its signatures that verify: the
25
+ * checkpoint is taken with them only, the first of each key and role, the others left out, not refused (POI3-ISSUES.md
26
+ * S39), and the roles it must be signed in are counted among them. Returning `undefined`, every signature verifies.
27
+ * Required for a signed checkpoint.
28
+ */
29
+ readonly verifyCheckpoint?: (checkpoint: Checkpoint) => readonly RoleSignature[] | undefined;
30
+ /**
31
+ * The roles a commit must be signed in, e.g. `roamingNetworkOperator` or `leader` (`RequiredSignatureRoles` of WWCP_POI
32
+ * 12e993a, POI3-ISSUES.md S24): each by a signature whose key the version the commit leads to lets sign in it, once
33
+ * `verifyCommit` verified the signatures (`keyMaySignIn`).
34
+ */
35
+ readonly requiredSignatureRoles?: readonly string[];
36
+ /** The roles a checkpoint must be signed in, e.g. `roamingNetworkOperator` or `witness`, by signatures `verifyCheckpoint` verified. */
37
+ readonly requiredCheckpointSignatureRoles?: readonly string[];
24
38
  }
39
+ /**
40
+ * Whether the key of the given signature may sign in its role, as far as the given version tells it
41
+ * (`RoamingNetworkCommitSignatureRoles.KeyMaySignIn` of WWCP_POI 12e993a, S24): in the role of the roaming network operator
42
+ * a signing key certified for it, in the role of a charging station operator a signing key of the operator its signer
43
+ * names. Who leads or witnesses no version says: those roles are the verifier's to judge by the keys it trusts.
44
+ */
45
+ export declare function keyMaySignIn(signature: RoleSignature, version: RoamingNetwork): boolean;
25
46
  /**
26
47
  * How a history starts from a snapshot of another server (10.5, *Anchored*): only anchored in the trust anchor of its
27
48
  * roaming network, fail closed. A snapshot of a checkpoint is anchored by the checkpoint, signed as the roaming network
@@ -104,8 +125,26 @@ export declare class History {
104
125
  private anchorCheckpoint;
105
126
  /** Refuses a signed commit without a verifier of commit signatures, as `CheckSignatures` of WWCP_POI; verifies it otherwise. */
106
127
  private verifyCommitSignatures;
107
- /** Refuses a signed checkpoint without a verifier of checkpoint signatures, as WWCP_POI; verifies it otherwise. */
128
+ /**
129
+ * The checkpoint as it is taken, with the signatures that verify here (`TryAddCheckpoint` and
130
+ * `TryVerifyCheckpointSignatures` of WWCP_POI 399b7c8, POI3-ISSUES.md S39): a signed one without a verifier of checkpoint
131
+ * signatures is refused, as WWCP_POI refuses it; otherwise `verifyCheckpoint` verifies it, and of the signatures it
132
+ * verified the first of each key and role is kept. One it did not verify, invalid or by a key not trusted here, is left
133
+ * out, not refused, so that nobody blocks a checkpoint by adding a signature, and a witness trusted elsewhere and not
134
+ * here keeps none from it. Refused when it is not signed in a required role by one that is kept, saying why the first
135
+ * one was left out.
136
+ */
108
137
  private verifyCheckpointSignatures;
138
+ /**
139
+ * Refuses a commit not signed as required, without verifying a signature (`SignedAsRequiredError`): signed without a
140
+ * verifier of commit signatures, or not signed in a required role.
141
+ */
142
+ private checkSignedAsRequired;
143
+ /**
144
+ * Refuses a commit not signed in a required role by a key the given version, the one it leads to, lets sign in it
145
+ * (`RequiredRolesError`): a role is no more than what a signature says, unless its key may sign in it.
146
+ */
147
+ private checkRequiredRoles;
109
148
  /** Refuses a commit of another epoch, identified or signed otherwise than its profiles say (`CommitEpochError`). */
110
149
  private checkCommitEpoch;
111
150
  /** Refuses a version whose operator states its keys with algorithms the epoch does not accept (`VersionEpochError`). */
@@ -130,8 +169,9 @@ export declare class History {
130
169
  /**
131
170
  * Takes the next checkpoint of the line (10.1): of this roaming network and epoch, its commit one this history holds
132
171
  * with its revision and ETags, following the latest checkpoint taken (sequence one more, naming it), its commits those
133
- * since the commit of the previous checkpoint (all since the root for the first one this history takes), carrying the
134
- * signatures required. A final checkpoint names the head, or the commit of the checkpoint before it alone (11.2).
172
+ * since the commit of the previous checkpoint (all since the root for the first one this history takes), signed in the
173
+ * roles required by signatures that verify here. A final checkpoint names the head, or the commit of the checkpoint
174
+ * before it alone (11.2). Returns it as taken: with the signatures verified here only (S39).
135
175
  */
136
176
  takeCheckpoint(value: JSONValue | Checkpoint): Checkpoint;
137
177
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/history/history.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAO,KAAK,SAAS,EAAE,MAAiB,kBAAkB,CAAC;AAElE,OAAO,EAAE,cAAc,EAAE,MAAsB,8BAA8B,CAAC;AAG9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAoB,0BAA0B,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAA8B,aAAa,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAA0B,iBAAiB,CAAC;AAGjE,OAAO,EAAE,aAAa,EAAsD,KAAK,KAAK,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAI3H,+CAA+C;AAC/C,MAAM,WAAW,OAAO;IACpB,QAAQ,CAAC,OAAO,EAAG,cAAc,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAI,MAAM,CAAC;CAC7B;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC3B;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,SAAS,EAAE,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACjH,sGAAsG;IACtG,QAAQ,CAAC,gBAAgB,CAAC,EAAG,CAAC,UA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E,SAAS,GAAG,UAAU,GAAG,UAAU;IA4DhE;;;OAGG;IACI,gBAAgB,IAAI,OAAO;IAqBlC;;;;OAIG;IACI,cAAc,CAAC,OAAO,GAAE,cAA6B,GAAG,OAAO;CAczE"}
@@ -0,0 +1,22 @@
1
+ import { type JSONObject, type JSONValue } from '../json/value.ts';
2
+ import { type ETag } from '../etags.ts';
3
+ /** The context of a precondition, where it is given. */
4
+ export declare const PRECONDITION_CONTEXT: string;
5
+ /** A precondition of a change set: the entity of a type and identification still has the given ETag. */
6
+ export interface Precondition {
7
+ readonly entityType: string;
8
+ readonly entityId: string;
9
+ readonly eTag: ETag;
10
+ }
11
+ /**
12
+ * The preconditions of a change set as WWCP_POI3 reads them (`RoamingNetworkPrecondition.TryParse`): an array of objects,
13
+ * each with its entity type and identification and its ETag, written in hex; refused in its words, which name only the
14
+ * index of the precondition it does not read.
15
+ */
16
+ export declare function parsePreconditions(value: JSONValue | undefined): Precondition[];
17
+ /**
18
+ * The error, when a precondition does not hold in the given content of a version (`TryCheckPreconditions`): the entity it
19
+ * names does not exist, or has another ETag.
20
+ */
21
+ export declare function brokenPrecondition(content: JSONObject, preconditions: readonly Precondition[]): string | undefined;
22
+ //# sourceMappingURL=preconditions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preconditions.d.ts","sourceRoot":"","sources":["../../src/history/preconditions.ts"],"names":[],"mappings":"AAmBA,OAAO,EAA0B,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE3F,OAAO,EAA6C,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAanF,wDAAwD;AACxD,eAAO,MAAM,oBAAoB,QAAoD,CAAC;AAEtF,wGAAwG;AACxG,MAAM,WAAW,YAAY;IACzB,QAAQ,CAAC,UAAU,EAAG,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAK,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAS,IAAI,CAAC;CAC9B;AAGD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,YAAY,EAAE,CAiC/E;AAyGD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,YAAY,EAAE,GAAG,MAAM,GAAG,SAAS,CAqBlH"}
package/dist/index.d.ts CHANGED
@@ -24,11 +24,11 @@ export { hash, type HashAlgorithm } from './crypto/hash.ts';
24
24
  export { SIGNATURE_ALGORITHMS, verifySignature, type SignatureAlgorithm } from './crypto/signature.ts';
25
25
  export { KeyUsages, POIPublicKey, type KeyUsage } from './keys.ts';
26
26
  export { cborETag, etagToJSON, etagToText, jsonETag, parseETag, parseETags, sameETag, sameETags, type ETag, type ETagFormat } from './etags.ts';
27
- export { auditPath, leafHash, merkleRoot, merkleRootOfLeafHashes, nodeHash, rootFromAuditPath } from './merkle.ts';
27
+ export { auditPath, leafHash, merkleRoot, merkleRootOfLeafHashes, nodeHash, rootFromAuditPath, type MerkleTreeHead } from './merkle.ts';
28
28
  export { RoamingNetwork, RoamingNetworkOperator, ROAMING_NETWORK_CONTEXT } from './network/roamingNetwork.ts';
29
29
  export { EV_TALER_EXCHANGE_CONTEXT, EV_TALER_MERCHANT_CONTEXT, EV_TALER_PAYMENT_MEANS, EV_TALER_PAYMENT_OPTION, evTalerMerchantOf, isTalerPublicKey, paymentOptionName, type EVTalerExchange, type EVTalerMerchant } from './network/evTaler.ts';
30
30
  export { effectiveContent, effectiveChargingStationOperator } from './network/effective.ts';
31
- export { CHILD_ARRAYS, effectiveTreeETag, entityDigest, prunedTree, skeleton } from './network/tree.ts';
31
+ export { CHILD_ARRAYS, effectiveTreeETag, entityDigest, givesCompletely, prunedTree, sizeOf, skeleton, type PrunedTree, type TreeNodeKind } from './network/tree.ts';
32
32
  export { TrustContext, type TrustEvaluation, type TrustEvaluationOptions } from './proofs/trustContext.ts';
33
33
  export { TrustAnchor, TRUST_ANCHOR_CONTEXT, TRUST_ANCHOR_QR_PREFIX, type I18NText } from './proofs/trustAnchor.ts';
34
34
  export { KeyStatement, KEY_STATEMENT_CONTEXT, type KeyStatementSignature } from './proofs/keyStatement.ts';
@@ -37,10 +37,11 @@ export { Attestation, ATTESTATION_CONTEXT } from './proofs/attestation.ts';
37
37
  export { ChargingStationProof, PROOF_CONTEXT, type VerifiedProof } from './proofs/stationProof.ts';
38
38
  export { MAX_PRICE_STATEMENT_SEQUENCE, PriceStatement, PriceStatementProof, parsePriceStatements, priceStatementChainOf, priceStatementsRoot, verifyCheckpointPriceStatements, verifyPriceStatementChain } from './proofs/priceStatement.ts';
39
39
  export { Commit, SignatureRoles, COMMIT_CONTEXT, type RoleSignature } from './history/commit.ts';
40
- export { ChangeSet, CHANGE_SET_CONTEXT, MERGE_CHANGE_SET_ID_PREFIX, changeSetIdentification, type Change, type ChangeKind, type ChangeSetSignature } from './history/changeSet.ts';
40
+ export { ChangeSet, CHANGE_SET_CONTEXT, MERGE_CHANGE_SET_ID_PREFIX, changeSetIdentification, type Change, type ChangeKind, type ChangeSetSignature, type ElementPathSegment } from './history/changeSet.ts';
41
+ export { type Precondition } from './history/preconditions.ts';
41
42
  export { applyChangeSet, checkOwnership } from './history/apply.ts';
42
43
  export { Checkpoint, CheckpointProof, commitsRoot, CHECKPOINT_CONTEXT } from './history/checkpoint.ts';
43
- export { History, type EpochStatus, type HistoryOptions, type SnapshotOptions, type Version } from './history/history.ts';
44
+ export { History, keyMaySignIn, type EpochStatus, type HistoryOptions, type SnapshotOptions, type Version } from './history/history.ts';
44
45
  export { EpochProfiles, FIRST_EPOCH, parseEpoch, parseEpochLink, sameEpoch, EPOCH_CONTEXT, EPOCH_LINK_CONTEXT, EPOCH_PROFILES_CONTEXT, STYX_CANONICAL_JSON, type Epoch, type EpochLink } from './history/epoch.ts';
45
46
  export { ArchiveSegment, parseArchiveSegmentInfo, verifySegmentLine, type ArchiveSegmentInfo } from './history/archive.ts';
46
47
  export { QIDigitalDocument, QIDigitalSignature } from './qidigital/document.ts';
@@ -53,8 +54,21 @@ export { OperatorTrust } from './verifier/trust.ts';
53
54
  export { verifyVersion, describeVersion, type VerifiedVersion } from './verifier/version.ts';
54
55
  export { verifyChargingStation, verifyPriceStatements, type Manufactured, type NamedCertificate, type NamedTransparencySoftware, type VerifiedChargingStation, type VerifiedPrice } from './verifier/chargingStation.ts';
55
56
  export { evTalerExchangesAt, evTalerTariffOf } from './verifier/evTaler.ts';
57
+ export { EVTalerRates, NetDecimal, minorUnitDigits, roundToNearest, roundUp, talerAmountOf, writeAmount, writeDecimal } from './evTaler/amounts.ts';
58
+ export { EVTalerSignedMeterValue, verifyMeterValue, type EVTalerMeasurementKey, type EVTalerMeterReading, type EVTalerMeterValueVerifier, type EVTalerVerifiedMeterValue } from './evTaler/meterValue.ts';
59
+ export { EVTalerCovers, EVTalerStep, EV_TALER_STEP_CONTEXT, isEVTalerSessionId, type EVTalerCoversUnit, type EVTalerStepData } from './evTaler/step.ts';
60
+ export { EVTalerPayURI, sameBaseURL } from './evTaler/payURI.ts';
61
+ export { EVTalerAmountChecks, EVTalerContractTerms, evTalerTariff, type EVTalerAmountCheck, type EVTalerContractExchange, type EVTalerVerifiedStep } from './evTaler/contractTerms.ts';
62
+ export { EVTalerSettlement, EV_TALER_SETTLEMENT_CONTEXT, type EVTalerSettledOrder, type EVTalerSettlementVerification } from './evTaler/settlement.ts';
56
63
  export { parseTrustedWitnesses, verifyCheckpointLine, verifyCheckpointSignatures, type CheckpointSignatures, type TrustedWitness } from './verifier/checkpoints.ts';
57
64
  export { parseEvidence, verifyEvidence, type Evidence, type VerifiedEvidence } from './verifier/evidence.ts';
58
65
  export { POIClient, type CheckedChargingStation, type Fetch } from './client.ts';
59
66
  export { LIVE_TOPICS, RUNTIME_STATUS_KINDS, STATUS_UPDATE_CONTEXT, RuntimeStatus, liveRequest, parseFrame, parseStatusUpdate, subscribeRequest, type LiveFrame, type RuntimeStatusEntry, type RuntimeStatusKind, type StatusUpdate } from './live.ts';
67
+ export { parseMeasurementPublicKey, verifyMeterKey, MeasurementKeyError, type MeasurementPublicKey, type MeasurementKeyFormat, type MeasurementKeyProblem, type VerifiedMeterKeyBinding } from './verifier/measurementKeys.ts';
68
+ export * from './verifier/historicalMeasurements.ts';
69
+ export * from './verifier/sessionPrices.ts';
70
+ export * from './verifier/observedVersions.ts';
71
+ export * from './verifier/documentKeys.ts';
72
+ export * from './verifier/trustTransitions.ts';
73
+ export * from './verifier/pricePublication.ts';
60
74
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiBA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,OAAO,EAAE,MAA0B,aAAa,CAAC;AAGhF,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAA6B,mBAAmB,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,MAAa,iBAAiB,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACrG,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5I,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACxG,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,MAAY,aAAa,CAAC;AAGhF,OAAO,EAAE,IA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