@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.
- package/CHANGELOG.md +382 -0
- package/README.md +534 -362
- package/dist/crypto/ber.d.ts +48 -0
- package/dist/crypto/ber.d.ts.map +1 -0
- package/dist/crypto/certificates.d.ts +21 -0
- package/dist/crypto/certificates.d.ts.map +1 -0
- package/dist/crypto/curves.d.ts +25 -0
- package/dist/crypto/curves.d.ts.map +1 -0
- package/dist/crypto/ecc.d.ts +34 -0
- package/dist/crypto/ecc.d.ts.map +1 -0
- package/dist/crypto/publicKeys.d.ts +51 -0
- package/dist/crypto/publicKeys.d.ts.map +1 -0
- package/dist/crypto/rsa.d.ts +30 -0
- package/dist/crypto/rsa.d.ts.map +1 -0
- package/dist/encoding/text.d.ts +9 -0
- package/dist/encoding/text.d.ts.map +1 -1
- package/dist/evTaler/amounts.d.ts +89 -0
- package/dist/evTaler/amounts.d.ts.map +1 -0
- package/dist/evTaler/contractTerms.d.ts +107 -0
- package/dist/evTaler/contractTerms.d.ts.map +1 -0
- package/dist/evTaler/meterValue.d.ts +65 -0
- package/dist/evTaler/meterValue.d.ts.map +1 -0
- package/dist/evTaler/payURI.d.ts +28 -0
- package/dist/evTaler/payURI.d.ts.map +1 -0
- package/dist/evTaler/settlement.d.ts +85 -0
- package/dist/evTaler/settlement.d.ts.map +1 -0
- package/dist/evTaler/step.d.ts +72 -0
- package/dist/evTaler/step.d.ts.map +1 -0
- package/dist/history/apply.d.ts +6 -1
- package/dist/history/apply.d.ts.map +1 -1
- package/dist/history/changeSet.d.ts +18 -2
- package/dist/history/changeSet.d.ts.map +1 -1
- package/dist/history/checkpoint.d.ts +7 -0
- package/dist/history/checkpoint.d.ts.map +1 -1
- package/dist/history/commit.d.ts +13 -1
- package/dist/history/commit.d.ts.map +1 -1
- package/dist/history/elements.d.ts +19 -0
- package/dist/history/elements.d.ts.map +1 -0
- package/dist/history/epoch.d.ts +2 -0
- package/dist/history/epoch.d.ts.map +1 -1
- package/dist/history/history.d.ts +46 -6
- package/dist/history/history.d.ts.map +1 -1
- package/dist/history/preconditions.d.ts +22 -0
- package/dist/history/preconditions.d.ts.map +1 -0
- package/dist/index.d.ts +18 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10296 -1558
- package/dist/index.js.map +1 -1
- package/dist/json/canonical.d.ts.map +1 -1
- package/dist/keys.d.ts +2 -0
- package/dist/keys.d.ts.map +1 -1
- package/dist/network/certificates.d.ts +16 -4
- package/dist/network/certificates.d.ts.map +1 -1
- package/dist/network/countries.d.ts +16 -0
- package/dist/network/countries.d.ts.map +1 -0
- package/dist/network/evTaler.d.ts +1 -14
- package/dist/network/evTaler.d.ts.map +1 -1
- package/dist/network/identifications.d.ts +6 -6
- package/dist/network/identifications.d.ts.map +1 -1
- package/dist/network/measurementPublicKey.d.ts +7 -0
- package/dist/network/measurementPublicKey.d.ts.map +1 -0
- package/dist/network/offers.d.ts +53 -0
- package/dist/network/offers.d.ts.map +1 -0
- package/dist/network/partyKeys.d.ts +8 -5
- package/dist/network/partyKeys.d.ts.map +1 -1
- package/dist/network/poiJSON.d.ts +172 -0
- package/dist/network/poiJSON.d.ts.map +1 -0
- package/dist/network/poiValues.d.ts +48 -0
- package/dist/network/poiValues.d.ts.map +1 -0
- package/dist/network/reading.d.ts +46 -0
- package/dist/network/reading.d.ts.map +1 -0
- package/dist/network/references.d.ts +36 -0
- package/dist/network/references.d.ts.map +1 -0
- package/dist/network/roamingNetwork.d.ts +10 -11
- package/dist/network/roamingNetwork.d.ts.map +1 -1
- package/dist/network/timeZones.d.ts +8 -0
- package/dist/network/timeZones.d.ts.map +1 -0
- package/dist/network/tree.d.ts +14 -0
- package/dist/network/tree.d.ts.map +1 -1
- package/dist/network/versionTexts.d.ts +1 -7
- package/dist/network/versionTexts.d.ts.map +1 -1
- package/dist/network/writtenForm.d.ts.map +1 -1
- package/dist/proofs/priceStatement.d.ts.map +1 -1
- package/dist/proofs/stationProof.d.ts +2 -0
- package/dist/proofs/stationProof.d.ts.map +1 -1
- package/dist/proofs/trustContext.d.ts +6 -0
- package/dist/proofs/trustContext.d.ts.map +1 -1
- package/dist/verifier/chargingStation.d.ts +5 -0
- package/dist/verifier/chargingStation.d.ts.map +1 -1
- package/dist/verifier/checkpoints.d.ts +6 -0
- package/dist/verifier/checkpoints.d.ts.map +1 -1
- package/dist/verifier/documentKeys.d.ts +27 -0
- package/dist/verifier/documentKeys.d.ts.map +1 -0
- package/dist/verifier/historicalMeasurements.d.ts +96 -0
- package/dist/verifier/historicalMeasurements.d.ts.map +1 -0
- package/dist/verifier/measurementKeys.d.ts +48 -0
- package/dist/verifier/measurementKeys.d.ts.map +1 -0
- package/dist/verifier/observedVersions.d.ts +70 -0
- package/dist/verifier/observedVersions.d.ts.map +1 -0
- package/dist/verifier/pricePublication.d.ts +74 -0
- package/dist/verifier/pricePublication.d.ts.map +1 -0
- package/dist/verifier/sessionPrices.d.ts +75 -0
- package/dist/verifier/sessionPrices.d.ts.map +1 -0
- package/dist/verifier/trustTransitions.d.ts +67 -0
- package/dist/verifier/trustTransitions.d.ts.map +1 -0
- package/package.json +15 -14
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pricePublication.d.ts","sourceRoot":"","sources":["../../src/verifier/pricePublication.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAGlE,4FAA4F;AAC5F,eAAO,MAAM,iCAAiC,yEAAyE,CAAC;AACxH,eAAO,MAAM,kCAAkC,0EAA0E,CAAC;AAC1H,uGAAuG;AACvG,wBAAgB,2BAA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AC;IACpG,QAAQ,CAAC,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACrG,GAAG,4BAA4B,CAmC/B"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { type JSONValue, type JSONObject } from '../json/value.ts';
|
|
2
|
+
import { TrustContext } from '../proofs/trustContext.ts';
|
|
3
|
+
import { type VerifiedChargingStation } from './chargingStation.ts';
|
|
4
|
+
import { HistoricalTrustContext, type HistoricalMeterPolicy } from './historicalMeasurements.ts';
|
|
5
|
+
import { type WitnessPublicationPolicy, type PricePublicationVerification } from './pricePublication.ts';
|
|
6
|
+
export declare const SESSION_PRICE_EVIDENCE_CONTEXT = "https://open.charging.cloud/contexts/wwcp/sessionPriceEvidence/v1";
|
|
7
|
+
export declare const SESSION_PRICE_AGREEMENT_CONTEXT = "https://open.charging.cloud/contexts/wwcp/sessionPriceAgreement/v1";
|
|
8
|
+
export declare const SIMPLE_GROSS_PRICE_PROFILE = "chargy-gross-rates/v1";
|
|
9
|
+
/** Experimental CPO assertion, distinct from customer consent. */
|
|
10
|
+
export declare class SessionPriceAgreement {
|
|
11
|
+
readonly json: JSONObject;
|
|
12
|
+
readonly chargingStarted: number;
|
|
13
|
+
readonly signedAt: number;
|
|
14
|
+
private constructor();
|
|
15
|
+
static parse(value: JSONValue): SessionPriceAgreement;
|
|
16
|
+
signingBytes(): Uint8Array;
|
|
17
|
+
verify(station: VerifiedChargingStation): void;
|
|
18
|
+
}
|
|
19
|
+
export interface SessionPriceEvidence {
|
|
20
|
+
readonly evseId: string;
|
|
21
|
+
readonly proof: JSONValue;
|
|
22
|
+
readonly priceStatements: readonly JSONValue[];
|
|
23
|
+
readonly publicationReceipts: readonly JSONValue[];
|
|
24
|
+
readonly witnessCandidates: readonly JSONValue[];
|
|
25
|
+
readonly agreement?: JSONValue;
|
|
26
|
+
readonly priceProofs: readonly JSONValue[];
|
|
27
|
+
readonly checkpoints: readonly {
|
|
28
|
+
readonly checkpoint: JSONValue;
|
|
29
|
+
readonly operator: JSONValue;
|
|
30
|
+
}[];
|
|
31
|
+
}
|
|
32
|
+
export declare function parseSessionPriceEvidence(value: JSONValue): SessionPriceEvidence;
|
|
33
|
+
export interface SessionPriceRequest {
|
|
34
|
+
readonly evseId: string;
|
|
35
|
+
readonly meterSerialNumber: string;
|
|
36
|
+
readonly chargingStarted: number;
|
|
37
|
+
readonly startDocumentSHA256: string;
|
|
38
|
+
}
|
|
39
|
+
export interface SessionPriceVerification {
|
|
40
|
+
readonly station: VerifiedChargingStation;
|
|
41
|
+
readonly signatures: 'valid' | 'invalid' | 'missing';
|
|
42
|
+
readonly applicability: 'bound' | 'unbound' | 'missing' | 'invalid' | 'ambiguous' | 'unsupported';
|
|
43
|
+
readonly agreement: 'valid' | 'invalid' | 'missing';
|
|
44
|
+
readonly publication: 'valid' | 'invalid' | 'missing' | 'incomplete';
|
|
45
|
+
readonly publicationBeforeStart: 'not-proven' | 'witnessed-before-signed-start' | 'invalid';
|
|
46
|
+
readonly publicationWitnesses?: PricePublicationVerification;
|
|
47
|
+
readonly customerConsent: 'not-proven';
|
|
48
|
+
readonly latestOrSoleOffer: 'not-proven';
|
|
49
|
+
readonly chainGaps: boolean;
|
|
50
|
+
readonly checkedAt: number;
|
|
51
|
+
readonly checkpointIds: readonly string[];
|
|
52
|
+
readonly witnessedBy: readonly string[];
|
|
53
|
+
readonly diagnostics: readonly string[];
|
|
54
|
+
readonly selected?: {
|
|
55
|
+
readonly statement: JSONObject;
|
|
56
|
+
readonly digest: string;
|
|
57
|
+
readonly tariff: JSONObject;
|
|
58
|
+
readonly currency: string;
|
|
59
|
+
readonly elements: readonly JSONObject[];
|
|
60
|
+
readonly rates?: {
|
|
61
|
+
readonly currency: string;
|
|
62
|
+
readonly energyPerKWh?: string;
|
|
63
|
+
readonly flatFee?: string;
|
|
64
|
+
readonly timePerHour?: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export declare function verifySessionPriceEvidence(current: TrustContext | HistoricalTrustContext, value: JSONValue, request: SessionPriceRequest, policy?: HistoricalMeterPolicy & {
|
|
69
|
+
readonly publicationPolicy?: WitnessPublicationPolicy;
|
|
70
|
+
readonly relatedCheckpoints?: readonly {
|
|
71
|
+
readonly checkpoint: JSONValue;
|
|
72
|
+
readonly operator: JSONValue;
|
|
73
|
+
}[];
|
|
74
|
+
}): SessionPriceVerification;
|
|
75
|
+
//# sourceMappingURL=sessionPrices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessionPrices.d.ts","sourceRoot":"","sources":["../../src/verifier/sessionPrices.ts"],"names":[],"mappings":"AAiBA,OAAO,EAA8B,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAK/F,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAKzD,OAAO,EAAgD,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAClH,OAAO,EAAE,sBAAsB,EAAyD,KAAK,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAExJ,OAAO,EAA0B,KAAK,wBAAwB,EAAE,KAAK,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAGjI,eAAO,MAAM,8BAA8B,sEAAsE,CAAC;AAClH,eAAO,MAAM,+BAA+B,uEAAuE,CAAC;AACpH,eAAO,MAAM,0BAA0B,0BAA0B,CAAC;AAClE,kEAAkE;AAClE,qBAAa,qBAAqB;aACM,IAAI,EAAE,UAAU;aAAkB,eAAe,EAAE,MAAM;aAAkB,QAAQ,EAAE,MAAM;IAA/H,OAAO;WACO,KAAK,CAAC,KAAK,EAAE,SAAS,GAAG,qBAAqB;IAQrD,YAAY,IAAI,UAAU;IAC1B,MAAM,CAAC,OAAO,EAAE,uBAAuB,GAAG,IAAI;CAMxD;AACD,MAAM,WAAW,oBAAoB;IACjC,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AA,QAAQ,CAAC,QAAQ,EAAC,SAAS,CAAA;KAAC,EAAE,CAAA;CAAI,GAAE,wBAAwB,CAuEvN"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { type JSONValue, type JSONObject } from '../json/value.ts';
|
|
2
|
+
import { TrustAnchor } from '../proofs/trustAnchor.ts';
|
|
3
|
+
import { KeyStatement } from '../proofs/keyStatement.ts';
|
|
4
|
+
import { TrustContext } from '../proofs/trustContext.ts';
|
|
5
|
+
import { Checkpoint } from '../history/checkpoint.ts';
|
|
6
|
+
import { type Epoch } from '../history/epoch.ts';
|
|
7
|
+
import { type ObservedVersions, type VersionComparison } from './observedVersions.ts';
|
|
8
|
+
/** Experimental compact trust delegation; not a replacement for History.followedBy or full owner/change-set replay. */
|
|
9
|
+
export declare const TRUST_TRANSITION_CONTEXT = "https://open.charging.cloud/contexts/wwcp/trustTransition/v1";
|
|
10
|
+
/** The digest of a key statement a transition continues: the SHA-256 of the canonical JSON of its content. */
|
|
11
|
+
export declare const trustStatementDigest: (statement: KeyStatement) => string;
|
|
12
|
+
/**
|
|
13
|
+
* The identity of the complete policy of a trust anchor: the SHA-256 of the canonical JSON (section 1) of
|
|
14
|
+
* `{network, holders, minConsensus, urls}`, its holders in their order, its URLs as a WHATWG URL serializes them (scheme
|
|
15
|
+
* and host in lower case, no default port) without trailing slashes, in their ordinal order; as lowercase hex, so that
|
|
16
|
+
* one endpoint spelled otherwise is one policy. WWCP_POI3 calculates it alike (`TrustTransition.PolicyIdOf`).
|
|
17
|
+
*/
|
|
18
|
+
export declare function trustPolicyId(anchor: TrustAnchor): string;
|
|
19
|
+
/**
|
|
20
|
+
* A compact delegation of trust from one authorized policy to the next: the exact policy and key statement it continues,
|
|
21
|
+
* the trust anchor and the roaming network operator it delegates to, its place in a chain of transitions, its interval,
|
|
22
|
+
* optionally the checkpoints of the old epoch and the start of the next one; signed by quorums of the holders of both.
|
|
23
|
+
*/
|
|
24
|
+
export declare class TrustTransition {
|
|
25
|
+
readonly json: JSONObject;
|
|
26
|
+
readonly sequence: number;
|
|
27
|
+
readonly previous: string | undefined;
|
|
28
|
+
readonly signedAt: number;
|
|
29
|
+
readonly validUntil: number;
|
|
30
|
+
readonly fromPolicyId: string;
|
|
31
|
+
readonly fromStatementDigest: string;
|
|
32
|
+
readonly anchor: TrustAnchor;
|
|
33
|
+
readonly operator: JSONObject;
|
|
34
|
+
private constructor();
|
|
35
|
+
static parse(value: JSONValue): TrustTransition;
|
|
36
|
+
/** What it names, but its signatures. */
|
|
37
|
+
content(): JSONObject;
|
|
38
|
+
/** The SHA-256 of the canonical JSON of its content: the `previous` of the next transition. */
|
|
39
|
+
digest(): string;
|
|
40
|
+
/** The signature input of a signature: its content with the side, the algorithm and the key of the signature. */
|
|
41
|
+
signingBytes(side: string, algorithm: string, keyId: string): Uint8Array;
|
|
42
|
+
}
|
|
43
|
+
export interface TransitionVerificationOptions {
|
|
44
|
+
readonly acceptedAt: number;
|
|
45
|
+
readonly epoch: Epoch;
|
|
46
|
+
readonly sequence: number;
|
|
47
|
+
readonly previous?: string | undefined;
|
|
48
|
+
}
|
|
49
|
+
/** Only produced after both holder quorums and the exact policies/evidence were authenticated. Never restored from a JSON flag. */
|
|
50
|
+
export declare class VerifiedTrustTransition {
|
|
51
|
+
readonly source: TrustTransition;
|
|
52
|
+
readonly context: TrustContext;
|
|
53
|
+
readonly epoch: Epoch;
|
|
54
|
+
readonly checkpoints: readonly Checkpoint[];
|
|
55
|
+
readonly first: Checkpoint | undefined;
|
|
56
|
+
readonly oldEpoch: Epoch;
|
|
57
|
+
readonly signedBy: {
|
|
58
|
+
readonly old: readonly number[];
|
|
59
|
+
readonly next: readonly number[];
|
|
60
|
+
};
|
|
61
|
+
private constructor();
|
|
62
|
+
static verify(basis: TrustContext, fromOperator: JSONValue, transition: TrustTransition, options: TransitionVerificationOptions): VerifiedTrustTransition;
|
|
63
|
+
}
|
|
64
|
+
/** Persist only original evidence and negative coordinates; authority is recreated on every resolver operation. */
|
|
65
|
+
export declare function applyVerifiedTrustTransition(before: ObservedVersions, verified: VerifiedTrustTransition, at: number): VersionComparison;
|
|
66
|
+
export declare const initialTrustEpoch: () => Epoch;
|
|
67
|
+
//# sourceMappingURL=trustTransitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trustTransitions.d.ts","sourceRoot":"","sources":["../../src/verifier/trustTransitions.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAO,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAKxE,OAAO,EAAE,WAAW,EAAE,MAA+B,0BAA0B,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAA8B,2BAA2B,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAA8B,2BAA2B,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAgC,0BAA0B,CAAC;AAEhF,OAAO,EAAiB,KAAK,KAAK,EAAE,MAAiB,qBAAqB,CAAC;AAI3E,OAAO,EACE,KAAK,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAItF,uHAAuH;AACvH,eAAO,MAAM,wBAAwB,iEAAiE,CAAC;AAEvG,8GAA8G;AAC9G,eAAO,MAAM,oBAAoB,GAAI,WAAW,YAAY,KAAG,MACG,CAAC;AAEnE;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAOzD;AAGD;;;;GAIG;AACH,qBAAa,eAAe;aAEY,IAAI,EAAkB,UAAU;aAChC,QAAQ,EAAc,MAAM;aAC5B,QAAQ,EAAc,MAAM,GAAG,SAAS;aACxC,QAAQ,EAAc,MAAM;aAC5B,UAAU,EAAY,MAAM;aAC5B,YAAY,EAAU,MAAM;aAC5B,mBAAmB,EAAG,MAAM;aAC5B,MAAM,EAAgB,WAAW;aACjC,QAAQ,EAAc,UAAU;IARpE,OAAO;WAWO,KAAK,CAAC,KAAK,EAAE,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
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Verifies WWCP/POI data in TypeScript: trust anchors, key statements, roaming networks and their ETags, commits, checkpoints, charging station proofs and price statements - so that an EV driver's app knows the charging station and its tariffs it shows are the ones the roaming network signed and published.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"wwcp",
|
|
@@ -69,26 +69,27 @@
|
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"@noble/hashes": "^2.4.0",
|
|
72
|
-
"@vanaheimr/cose": "^0.
|
|
73
|
-
"@vanaheimr/metrological-cbor": "^0.
|
|
72
|
+
"@vanaheimr/cose": "^0.15.0",
|
|
73
|
+
"@vanaheimr/metrological-cbor": "^0.12.0"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@eslint/js": "^10.0.1",
|
|
77
|
-
"@types/node": "^26.6.
|
|
78
|
-
"@vitest/browser": "^5.0
|
|
79
|
-
"@vitest/browser-playwright": "^5.0
|
|
80
|
-
"@vitest/coverage-v8": "^5.0
|
|
81
|
-
"eslint": "^10.
|
|
82
|
-
"globals": "^17.
|
|
83
|
-
"playwright": "^1.
|
|
77
|
+
"@types/node": "^26.6.6",
|
|
78
|
+
"@vitest/browser": "^5.1.0",
|
|
79
|
+
"@vitest/browser-playwright": "^5.1.0",
|
|
80
|
+
"@vitest/coverage-v8": "^5.1.0",
|
|
81
|
+
"eslint": "^10.14.0",
|
|
82
|
+
"globals": "^17.14.0",
|
|
83
|
+
"playwright": "^1.65.0",
|
|
84
84
|
"tsup": "^9.0.0",
|
|
85
85
|
"tsx": "^4.23.15",
|
|
86
86
|
"typescript": "^6.0.3",
|
|
87
|
-
"typescript-eslint": "^8.72.
|
|
88
|
-
"vite": "^8.3.
|
|
89
|
-
"vitest": "^5.0
|
|
87
|
+
"typescript-eslint": "^8.72.1",
|
|
88
|
+
"vite": "^8.3.6",
|
|
89
|
+
"vitest": "^5.1.0"
|
|
90
90
|
},
|
|
91
91
|
"overrides": {
|
|
92
|
-
"esbuild": "^0.28.2"
|
|
92
|
+
"esbuild": "^0.28.2",
|
|
93
|
+
"minimatch": "^11.0.4"
|
|
93
94
|
}
|
|
94
95
|
}
|