@xiotbox/e2e-channel 0.1.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/README.md +165 -0
- package/README.zh-CN.md +163 -0
- package/docs/assets/xiotbox-logo.png +0 -0
- package/docs/e2e-secure-channel.md +177 -0
- package/lib/crypto.d.ts +126 -0
- package/lib/crypto.js +283 -0
- package/lib/crypto.js.map +1 -0
- package/lib/index.d.ts +12 -0
- package/lib/index.js +13 -0
- package/lib/index.js.map +1 -0
- package/lib/secure-channel.d.ts +111 -0
- package/lib/secure-channel.js +319 -0
- package/lib/secure-channel.js.map +1 -0
- package/package.json +30 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* XiotBox E2E Secure Channel — generic end-to-end encrypted channel.
|
|
3
|
+
*
|
|
4
|
+
* Sits between an application protocol and the XiotBox Gateway relay: any
|
|
5
|
+
* channel that relays opaque JSON frames (DSH web tunnel, agent RPC, PTY
|
|
6
|
+
* streams, …) can wrap them with this layer and get:
|
|
7
|
+
*
|
|
8
|
+
* - confidentiality — the Gateway only ever sees ciphertext frames
|
|
9
|
+
* - integrity — AES-256-GCM AEAD rejects any modified frame
|
|
10
|
+
* - anti-replay — per-direction sequence counters bound in the AAD
|
|
11
|
+
* - forward secrecy — fresh ephemeral X25519 key pair per channel
|
|
12
|
+
* - peer authentication — Ed25519 identity signatures over the handshake
|
|
13
|
+
* transcript, pinned TOFU by the application via `peerIdentityPolicy`
|
|
14
|
+
*
|
|
15
|
+
* Wire format (all frames are JSON, base64-encoded by the relay):
|
|
16
|
+
* handshake: {t:'hello', v:1, pub, kid, nonce}
|
|
17
|
+
* {t:'hello_ack', v:1, pub, kid, nonce}
|
|
18
|
+
* {t:'ident', v:1, id, fp, sig} (identity claim, signed)
|
|
19
|
+
* {t:'ident_ack', v:1, id, fp, sig}
|
|
20
|
+
* data: {t:'enc', v:1, iv, tag, ct} (ct = encrypted app frame)
|
|
21
|
+
*
|
|
22
|
+
* Application keepalives (e.g. the tunnel's ping/pong) stay outside this
|
|
23
|
+
* layer and are relayed plaintext; they carry no sensitive content.
|
|
24
|
+
*
|
|
25
|
+
* See `docs/e2e-secure-channel.md` for the full protocol specification.
|
|
26
|
+
*/
|
|
27
|
+
import { randomBytes } from 'node:crypto';
|
|
28
|
+
import { b64d, b64e, buildFrameAad, buildHandshakeTranscript, computeIdentityFingerprint, deriveSessionKey, normalizeEd25519Pub, openFrame, sealFrame, signMessage, verifyMessage, x25519Keypair, x25519Shared, } from './crypto.js';
|
|
29
|
+
const DEFAULT_HANDSHAKE_TIMEOUT_MS = 10_000;
|
|
30
|
+
/**
|
|
31
|
+
* One E2E session bound to one relay channel. Created per channel; the
|
|
32
|
+
* session key lives only in memory and is dropped on close.
|
|
33
|
+
*/
|
|
34
|
+
export class SecureChannel {
|
|
35
|
+
opts;
|
|
36
|
+
state = 'init';
|
|
37
|
+
eph;
|
|
38
|
+
myNonce;
|
|
39
|
+
myKid;
|
|
40
|
+
peerEphPubB64 = '';
|
|
41
|
+
peerKid = '';
|
|
42
|
+
peerNonce = '';
|
|
43
|
+
peerIdentityFp = '';
|
|
44
|
+
sessionKey;
|
|
45
|
+
sendSeq = 0;
|
|
46
|
+
recvSeq = 0;
|
|
47
|
+
timeout;
|
|
48
|
+
closedReason = '';
|
|
49
|
+
constructor(options) {
|
|
50
|
+
this.opts = options;
|
|
51
|
+
this.eph = x25519Keypair();
|
|
52
|
+
this.myNonce = randomBytes(16).toString('hex');
|
|
53
|
+
this.myKid = options.keypair.keyId;
|
|
54
|
+
if (options.role === 'initiator')
|
|
55
|
+
this.state = 'hello_sent';
|
|
56
|
+
}
|
|
57
|
+
get ready() {
|
|
58
|
+
return this.state === 'ready';
|
|
59
|
+
}
|
|
60
|
+
get channelId() {
|
|
61
|
+
return this.opts.channelId;
|
|
62
|
+
}
|
|
63
|
+
get direction() {
|
|
64
|
+
return this.opts.role === 'initiator' ? 'c2p' : 'p2c';
|
|
65
|
+
}
|
|
66
|
+
/** Initiate (initiator) or arm the handshake timeout (responder). */
|
|
67
|
+
start() {
|
|
68
|
+
if (this.opts.role === 'initiator' && this.state === 'hello_sent') {
|
|
69
|
+
const ok = this.opts.send({
|
|
70
|
+
t: 'hello',
|
|
71
|
+
v: 1,
|
|
72
|
+
pub: b64e(this.eph.pub),
|
|
73
|
+
kid: this.myKid,
|
|
74
|
+
nonce: this.myNonce,
|
|
75
|
+
});
|
|
76
|
+
if (!ok) {
|
|
77
|
+
this.close('send_failed');
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
this.armTimeout();
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Feed an inbound relay frame. Returns:
|
|
85
|
+
* { status: 'ok', app?: Record } — app frame decrypted (when ready)
|
|
86
|
+
* { status: 'ok' } — handshake/control frame consumed
|
|
87
|
+
* { status: 'closed', reason } — protocol/security failure
|
|
88
|
+
*/
|
|
89
|
+
receive(frame) {
|
|
90
|
+
if (this.state === 'closed')
|
|
91
|
+
return { status: 'closed', reason: this.closedReason || 'closed' };
|
|
92
|
+
const t = String(frame.t ?? '');
|
|
93
|
+
if (t === 'enc') {
|
|
94
|
+
if (!this.ready)
|
|
95
|
+
return { status: 'closed', reason: 'enc_before_handshake' };
|
|
96
|
+
return this.handleEnc(frame);
|
|
97
|
+
}
|
|
98
|
+
switch (t) {
|
|
99
|
+
case 'hello':
|
|
100
|
+
return this.handleHello(frame);
|
|
101
|
+
case 'hello_ack':
|
|
102
|
+
return this.handleHelloAck(frame);
|
|
103
|
+
case 'ident':
|
|
104
|
+
return this.handleIdent(frame);
|
|
105
|
+
case 'ident_ack':
|
|
106
|
+
return this.handleIdentAck(frame);
|
|
107
|
+
default:
|
|
108
|
+
return { status: 'closed', reason: 'unexpected_frame' };
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/** Wrap an application frame into an encrypted relay frame. */
|
|
112
|
+
wrap(app) {
|
|
113
|
+
if (!this.ready || this.sessionKey === undefined) {
|
|
114
|
+
throw new Error('secure_channel_not_ready');
|
|
115
|
+
}
|
|
116
|
+
this.sendSeq += 1;
|
|
117
|
+
const aad = buildFrameAad(this.channelId, this.direction, this.sendSeq);
|
|
118
|
+
const sealed = sealFrame(this.sessionKey, Buffer.from(JSON.stringify(app), 'utf8'), aad);
|
|
119
|
+
return { t: 'enc', v: 1, ...sealed };
|
|
120
|
+
}
|
|
121
|
+
/** Close the channel; clears the session key and timers. */
|
|
122
|
+
close(reason = 'closed') {
|
|
123
|
+
if (this.state === 'closed')
|
|
124
|
+
return;
|
|
125
|
+
this.state = 'closed';
|
|
126
|
+
this.closedReason = reason;
|
|
127
|
+
this.clearTimeout();
|
|
128
|
+
this.sessionKey = undefined;
|
|
129
|
+
this.opts.onClose?.(reason);
|
|
130
|
+
}
|
|
131
|
+
// -------------------------------------------------------------------------
|
|
132
|
+
// Handshake
|
|
133
|
+
// -------------------------------------------------------------------------
|
|
134
|
+
handleHello(frame) {
|
|
135
|
+
if (this.opts.role !== 'responder' || this.state !== 'init') {
|
|
136
|
+
return { status: 'closed', reason: 'protocol_error' };
|
|
137
|
+
}
|
|
138
|
+
const pub = b64d(frame.pub);
|
|
139
|
+
const kid = String(frame.kid ?? '');
|
|
140
|
+
const nonce = String(frame.nonce ?? '');
|
|
141
|
+
if (pub === undefined || pub.length !== 32 || kid.length === 0 || nonce.length === 0) {
|
|
142
|
+
return { status: 'closed', reason: 'invalid_hello' };
|
|
143
|
+
}
|
|
144
|
+
if (this.opts.peerKid && kid !== this.opts.peerKid) {
|
|
145
|
+
this.opts.log?.('warn', `[E2E] peer kid mismatch channel=${this.channelId} got=${kid.slice(0, 8)}… expected=${this.opts.peerKid.slice(0, 8)}…`);
|
|
146
|
+
return { status: 'closed', reason: 'e2e_peer_kid_mismatch' };
|
|
147
|
+
}
|
|
148
|
+
this.peerEphPubB64 = frame.pub;
|
|
149
|
+
this.peerKid = kid;
|
|
150
|
+
this.peerNonce = nonce;
|
|
151
|
+
this.sessionKey = deriveSessionKey(x25519Shared(this.eph.priv, pub), this.channelId);
|
|
152
|
+
// Advance the state BEFORE sending: the synchronous send() re-enters the
|
|
153
|
+
// peer, which may immediately reply with its ident frame.
|
|
154
|
+
this.state = 'hello_received';
|
|
155
|
+
const ok = this.opts.send({
|
|
156
|
+
t: 'hello_ack',
|
|
157
|
+
v: 1,
|
|
158
|
+
pub: b64e(this.eph.pub),
|
|
159
|
+
kid: this.myKid,
|
|
160
|
+
nonce: this.myNonce,
|
|
161
|
+
});
|
|
162
|
+
if (!ok)
|
|
163
|
+
return { status: 'closed', reason: 'send_failed' };
|
|
164
|
+
return { status: 'ok' };
|
|
165
|
+
}
|
|
166
|
+
handleHelloAck(frame) {
|
|
167
|
+
if (this.opts.role !== 'initiator' || this.state !== 'hello_sent') {
|
|
168
|
+
return { status: 'closed', reason: 'protocol_error' };
|
|
169
|
+
}
|
|
170
|
+
const pub = b64d(frame.pub);
|
|
171
|
+
const kid = String(frame.kid ?? '');
|
|
172
|
+
const nonce = String(frame.nonce ?? '');
|
|
173
|
+
if (pub === undefined || pub.length !== 32 || kid.length === 0 || nonce.length === 0) {
|
|
174
|
+
return { status: 'closed', reason: 'invalid_hello_ack' };
|
|
175
|
+
}
|
|
176
|
+
if (this.opts.peerKid && kid !== this.opts.peerKid) {
|
|
177
|
+
this.opts.log?.('warn', `[E2E] peer kid mismatch channel=${this.channelId} got=${kid.slice(0, 8)}… expected=${this.opts.peerKid.slice(0, 8)}…`);
|
|
178
|
+
return { status: 'closed', reason: 'e2e_peer_kid_mismatch' };
|
|
179
|
+
}
|
|
180
|
+
this.peerEphPubB64 = frame.pub;
|
|
181
|
+
this.peerKid = kid;
|
|
182
|
+
this.peerNonce = nonce;
|
|
183
|
+
this.sessionKey = deriveSessionKey(x25519Shared(this.eph.priv, pub), this.channelId);
|
|
184
|
+
this.state = 'ident_sent';
|
|
185
|
+
// Identity claim over the full handshake transcript.
|
|
186
|
+
const transcript = this.buildTranscript('c2p');
|
|
187
|
+
const sig = signMessage(this.opts.identity.privKey, transcript);
|
|
188
|
+
const ok = this.opts.send({
|
|
189
|
+
t: 'ident',
|
|
190
|
+
v: 1,
|
|
191
|
+
id: b64e(this.opts.identity.pubRaw),
|
|
192
|
+
fp: this.opts.identity.fingerprint,
|
|
193
|
+
sig: b64e(sig),
|
|
194
|
+
});
|
|
195
|
+
if (!ok)
|
|
196
|
+
return { status: 'closed', reason: 'send_failed' };
|
|
197
|
+
return { status: 'ok' };
|
|
198
|
+
}
|
|
199
|
+
handleIdent(frame) {
|
|
200
|
+
if (this.opts.role !== 'responder' || this.state !== 'hello_received') {
|
|
201
|
+
return { status: 'closed', reason: 'protocol_error' };
|
|
202
|
+
}
|
|
203
|
+
const result = this.verifyIdentityClaim(frame, 'c2p');
|
|
204
|
+
if (!result.ok) {
|
|
205
|
+
this.opts.log?.('warn', `[E2E] peer identity rejected channel=${this.channelId} reason=${result.reason ?? 'invalid'}`);
|
|
206
|
+
return { status: 'closed', reason: result.reason ?? 'e2e_peer_identity_rejected' };
|
|
207
|
+
}
|
|
208
|
+
this.peerIdentityFp = String(frame.fp ?? '');
|
|
209
|
+
// Reply with our identity claim.
|
|
210
|
+
const transcript = this.buildTranscript('p2c');
|
|
211
|
+
const sig = signMessage(this.opts.identity.privKey, transcript);
|
|
212
|
+
const ok = this.opts.send({
|
|
213
|
+
t: 'ident_ack',
|
|
214
|
+
v: 1,
|
|
215
|
+
id: b64e(this.opts.identity.pubRaw),
|
|
216
|
+
fp: this.opts.identity.fingerprint,
|
|
217
|
+
sig: b64e(sig),
|
|
218
|
+
});
|
|
219
|
+
if (!ok)
|
|
220
|
+
return { status: 'closed', reason: 'send_failed' };
|
|
221
|
+
this.clearTimeout();
|
|
222
|
+
this.state = 'ready';
|
|
223
|
+
this.opts.log?.('info', `[E2E] channel ready channel=${this.channelId} peerFp=${this.peerIdentityFp.slice(0, 12)}…`);
|
|
224
|
+
return { status: 'ok' };
|
|
225
|
+
}
|
|
226
|
+
handleIdentAck(frame) {
|
|
227
|
+
if (this.opts.role !== 'initiator' || this.state !== 'ident_sent') {
|
|
228
|
+
return { status: 'closed', reason: 'protocol_error' };
|
|
229
|
+
}
|
|
230
|
+
const result = this.verifyIdentityClaim(frame, 'p2c');
|
|
231
|
+
if (!result.ok) {
|
|
232
|
+
this.opts.log?.('warn', `[E2E] peer identity rejected channel=${this.channelId} reason=${result.reason ?? 'invalid'}`);
|
|
233
|
+
return { status: 'closed', reason: result.reason ?? 'e2e_peer_identity_rejected' };
|
|
234
|
+
}
|
|
235
|
+
this.peerIdentityFp = String(frame.fp ?? '');
|
|
236
|
+
this.clearTimeout();
|
|
237
|
+
this.state = 'ready';
|
|
238
|
+
this.opts.log?.('info', `[E2E] channel ready channel=${this.channelId} peerFp=${this.peerIdentityFp.slice(0, 12)}…`);
|
|
239
|
+
return { status: 'ok' };
|
|
240
|
+
}
|
|
241
|
+
verifyIdentityClaim(frame, dir) {
|
|
242
|
+
const idDecoded = b64d(frame.id);
|
|
243
|
+
const sig = b64d(frame.sig);
|
|
244
|
+
if (idDecoded === undefined || sig === undefined) {
|
|
245
|
+
return { ok: false, reason: 'invalid_identity_claim' };
|
|
246
|
+
}
|
|
247
|
+
const idRaw = normalizeEd25519Pub(idDecoded);
|
|
248
|
+
if (idRaw === undefined) {
|
|
249
|
+
return { ok: false, reason: 'invalid_identity_claim' };
|
|
250
|
+
}
|
|
251
|
+
const transcript = this.buildTranscript(dir);
|
|
252
|
+
if (!verifyMessage(idRaw, transcript, sig)) {
|
|
253
|
+
return { ok: false, reason: 'e2e_identity_sig_invalid' };
|
|
254
|
+
}
|
|
255
|
+
// Advisory fingerprint check: SHA256 of the SPKI DER encoding (idRaw is
|
|
256
|
+
// always the raw 32 bytes here; canonical Ed25519 SPKI DER = prefix + raw).
|
|
257
|
+
const der = Buffer.concat([Buffer.from('302a300506032b6570032100', 'hex'), idRaw]);
|
|
258
|
+
const computedFp = computeIdentityFingerprint(der);
|
|
259
|
+
const claimedFp = String(frame.fp ?? '').trim().toLowerCase();
|
|
260
|
+
if (claimedFp && claimedFp !== computedFp) {
|
|
261
|
+
return { ok: false, reason: 'e2e_identity_fp_mismatch' };
|
|
262
|
+
}
|
|
263
|
+
if (this.opts.peerIdentityPolicy) {
|
|
264
|
+
return this.opts.peerIdentityPolicy(idRaw, claimedFp || computedFp, transcript, sig);
|
|
265
|
+
}
|
|
266
|
+
return { ok: true };
|
|
267
|
+
}
|
|
268
|
+
buildTranscript(dir) {
|
|
269
|
+
// Canonical c_/p_ fields: c_ = client/initiator side, p_ = plugin/responder
|
|
270
|
+
// side. Both peers must produce the identical string for the same dir.
|
|
271
|
+
const isInitiator = this.opts.role === 'initiator';
|
|
272
|
+
return buildHandshakeTranscript({
|
|
273
|
+
channelId: this.channelId,
|
|
274
|
+
dir,
|
|
275
|
+
cEphPubB64: isInitiator ? b64e(this.eph.pub) : this.peerEphPubB64,
|
|
276
|
+
pEphPubB64: isInitiator ? this.peerEphPubB64 : b64e(this.eph.pub),
|
|
277
|
+
cKid: isInitiator ? this.myKid : this.peerKid,
|
|
278
|
+
pKid: isInitiator ? this.peerKid : this.myKid,
|
|
279
|
+
cNonce: isInitiator ? this.myNonce : this.peerNonce,
|
|
280
|
+
pNonce: isInitiator ? this.peerNonce : this.myNonce,
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
handleEnc(frame) {
|
|
284
|
+
if (this.sessionKey === undefined)
|
|
285
|
+
return { status: 'closed', reason: 'no_session_key' };
|
|
286
|
+
this.recvSeq += 1;
|
|
287
|
+
const inboundDir = this.direction === 'c2p' ? 'p2c' : 'c2p';
|
|
288
|
+
const aad = buildFrameAad(this.channelId, inboundDir, this.recvSeq);
|
|
289
|
+
const plaintext = openFrame(this.sessionKey, frame, aad);
|
|
290
|
+
if (plaintext === undefined) {
|
|
291
|
+
this.opts.log?.('warn', `[E2E] frame auth failed channel=${this.channelId} seq=${this.recvSeq}`);
|
|
292
|
+
return { status: 'closed', reason: 'e2e_frame_auth_failed' };
|
|
293
|
+
}
|
|
294
|
+
try {
|
|
295
|
+
const app = JSON.parse(plaintext.toString('utf8'));
|
|
296
|
+
return { status: 'ok', app };
|
|
297
|
+
}
|
|
298
|
+
catch {
|
|
299
|
+
return { status: 'closed', reason: 'invalid_app_frame' };
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
armTimeout() {
|
|
303
|
+
this.clearTimeout();
|
|
304
|
+
const timeoutMs = this.opts.handshakeTimeoutMs ?? DEFAULT_HANDSHAKE_TIMEOUT_MS;
|
|
305
|
+
this.timeout = setTimeout(() => {
|
|
306
|
+
if (this.state !== 'ready' && this.state !== 'closed') {
|
|
307
|
+
this.opts.log?.('warn', `[E2E] handshake timeout channel=${this.channelId}`);
|
|
308
|
+
this.close('e2e_handshake_timeout');
|
|
309
|
+
}
|
|
310
|
+
}, timeoutMs);
|
|
311
|
+
}
|
|
312
|
+
clearTimeout() {
|
|
313
|
+
if (this.timeout !== undefined) {
|
|
314
|
+
clearTimeout(this.timeout);
|
|
315
|
+
this.timeout = undefined;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
//# sourceMappingURL=secure-channel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secure-channel.js","sourceRoot":"","sources":["../src/secure-channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,wBAAwB,EACxB,0BAA0B,EAC1B,gBAAgB,EAChB,mBAAmB,EACnB,SAAS,EACT,SAAS,EACT,WAAW,EACX,aAAa,EACb,aAAa,EACb,YAAY,GAGb,MAAM,aAAa,CAAA;AAmDpB,MAAM,4BAA4B,GAAG,MAAM,CAAA;AAE3C;;;GAGG;AACH,MAAM,OAAO,aAAa;IACP,IAAI,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,UAAU,CAAC,GAAG,EAAE;YAC7B,IAAI,IAAI,CAAC,KAAK,KAAK,OAAO,IAAI,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;gBACtD,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,mCAAmC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAA;gBAC5E,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;YACrC,CAAC;QACH,CAAC,EAAE,SAAS,CAAC,CAAA;IACf,CAAC;IAEO,YAAY;QAClB,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAC/B,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YAC1B,IAAI,CAAC,OAAO,GAAG,SAAS,CAAA;QAC1B,CAAC;IACH,CAAC;CACF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xiotbox/e2e-channel",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "XiotBox E2E Secure Channel — generic end-to-end encrypted relay protocol (TypeScript/Node implementation). Zero runtime dependencies (node:crypto only).",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"types": "lib/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./lib/index.d.ts",
|
|
11
|
+
"default": "./lib/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"lib",
|
|
17
|
+
"docs"
|
|
18
|
+
],
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc -p tsconfig.json",
|
|
22
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
23
|
+
"test": "npm run build && node --test test/*.test.js",
|
|
24
|
+
"prepare": "npm run build"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/node": "^22.0.0",
|
|
28
|
+
"typescript": "^5.6.0"
|
|
29
|
+
}
|
|
30
|
+
}
|