@browsercore/contracts 0.2.3 → 0.2.5
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 +30 -11
- package/dist/contracts.d.ts +101 -147
- package/dist/contracts.d.ts.map +1 -1
- package/dist/events.d.ts +10 -1
- package/dist/events.d.ts.map +1 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +25 -2
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js.map +1 -1
- package/package.json +4 -4
- package/dist/options.d.ts +0 -51
- package/dist/options.d.ts.map +0 -1
- package/dist/options.js +0 -9
- package/dist/options.js.map +0 -1
package/README.md
CHANGED
|
@@ -6,10 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
The canonical interface package for the browsercore stack. Every protocol
|
|
8
8
|
package, runtime adapter, and consumer depends on these contracts — they
|
|
9
|
-
define how components communicate without coupling them to each other.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
define how components communicate without coupling them to each other. As of
|
|
10
|
+
0.2.5 this is the canonical single definition for `Transport`,
|
|
11
|
+
`CryptoProvider`, and `CompressionProvider` (the implementing packages
|
|
12
|
+
re-export them), plus the `Platform` service contracts (events, time,
|
|
13
|
+
telemetry, network). A few deliberately package-local surfaces remain
|
|
14
|
+
duplicated (e.g. `CookieJar`, per-package `Clock` shapes) — converging them is
|
|
15
|
+
tracked separately.
|
|
13
16
|
|
|
14
17
|
## Why this package exists
|
|
15
18
|
|
|
@@ -21,8 +24,9 @@ cross-package interface here, a type error becomes a compile error the moment
|
|
|
21
24
|
any package diverges.
|
|
22
25
|
|
|
23
26
|
**Alternative implementations welcome.** The contracts define exactly what a
|
|
24
|
-
component must satisfy — nothing more. Want to write a different
|
|
25
|
-
Implement `
|
|
27
|
+
component must satisfy — nothing more. Want to write a different transport?
|
|
28
|
+
Implement `Transport`. A different crypto backend? Implement
|
|
29
|
+
`CryptoProvider` (synchronous — WebCrypto cannot satisfy it). A
|
|
26
30
|
different runtime (Bun, Deno, Workers)? Implement the `Platform` service
|
|
27
31
|
interfaces. The contracts are the spec; the packages are the reference
|
|
28
32
|
implementations.
|
|
@@ -56,16 +60,24 @@ compression, events, telemetry, time) down through options.
|
|
|
56
60
|
|
|
57
61
|
| Module | Purpose | Key exports |
|
|
58
62
|
|---|---|---|
|
|
59
|
-
| **Contracts** |
|
|
63
|
+
| **Contracts** | Canonical provider interfaces — the single definitions the implementing packages re-export | `CryptoProvider`, `CompressionProvider`, `Transport`, `DatagramTransport`, `CookieJar`, `PacketCallback` |
|
|
60
64
|
| **Platform** | The composition root + per-service bundles | `Platform`, `PlatformOptions`, `Network`, `Crypto`, `Compression` |
|
|
61
|
-
| **Events** | EventTarget-backed
|
|
65
|
+
| **Events** | Structural emitter interface (a method surface, **not** EventTarget-backed) injected via `Platform.events` | `EventProvider`, `TypedEventEmitter<T>` |
|
|
62
66
|
| **Time** | Clock + scheduler with composable deadlines | `Clock`, `Duration`, `Scheduler`, `Deadline`, `Time` |
|
|
63
67
|
| **Telemetry** | OTel-aligned observability | `Logger`, `Tracer`, `Span`, `Metrics`, `Telemetry` |
|
|
64
68
|
| **Models** | Shared data structures that cross package boundaries | `BrowserProfile`, `TlsProfile`, `Http1Profile`, `Http2Profile`, `Request`, `Response`, `Headers`, `Cookie`, `TransportState`, `CloseReason`, `ContentEncoding` |
|
|
65
69
|
| **Net** | Platform-agnostic TCP + DNS contracts for runtime portability | `Net`, `DnsResolver`, `Socket`, `ConnectOptions`, `IPAddress` |
|
|
66
|
-
| **Options** | Configuration objects passed to each protocol package | `TlsOptions`, `Http1Options`, `Http2Options`, `Http3Options`, `QuicOptions`, `FetchClientOptions` |
|
|
67
70
|
| **IANA Tables** | Canonical TLS wire code lookup tables (single source of truth) | `CIPHER_SUITE_CODES`, `NAMED_GROUP_CODES`, `SIGNATURE_SCHEME_CODES`, `VERSION_CODES` |
|
|
68
71
|
|
|
72
|
+
The former "Protocol Connection Contracts" (`TlsConnection`, `Http1Connection`,
|
|
73
|
+
`Http2Connection`, `Http3Connection`, `QuicConnection`, `QuicStream`,
|
|
74
|
+
`FetchClient`) and the Options layer (`TlsOptions` … `FetchClientOptions`) were
|
|
75
|
+
removed in 0.2.5: they had zero consumers — every consumer binds the
|
|
76
|
+
implementation-local types exported by the protocol packages themselves
|
|
77
|
+
(replaceability audit, 2026-11-16). `Transport` and `CryptoProvider` here are
|
|
78
|
+
now the canonical single definitions that `@browsercore/transport` and
|
|
79
|
+
`@browsercore/crypto` re-export.
|
|
80
|
+
|
|
69
81
|
## Usage
|
|
70
82
|
|
|
71
83
|
### Importing types (compile-time only)
|
|
@@ -107,8 +119,11 @@ class MyCustomTransport implements Transport {
|
|
|
107
119
|
3. **No Node built-ins.** Types reference only portable primitives:
|
|
108
120
|
`string`, `number`, `Uint8Array`, `Promise`, `IterableIterator`.
|
|
109
121
|
|
|
110
|
-
4. **Branded types
|
|
111
|
-
|
|
122
|
+
4. **Branded types live in the implementing packages.** Opaque ID brands
|
|
123
|
+
(`TransportId` in transport, `ConnectionId` in quic, `CryptoSessionId` in
|
|
124
|
+
crypto) are defined per-package and stay assignable to the plain
|
|
125
|
+
`string`/`number` fields here. Contracts itself ships plain aliases —
|
|
126
|
+
`ProfileId` is a plain `string`, not a brand.
|
|
112
127
|
|
|
113
128
|
5. **Discriminated unions for state.** `TransportState`, `CloseReason`,
|
|
114
129
|
`TlsState` model every valid state explicitly — invalid combinations
|
|
@@ -119,3 +134,7 @@ class MyCustomTransport implements Transport {
|
|
|
119
134
|
All type exports are erased by the TypeScript compiler. The only runtime
|
|
120
135
|
exports are the IANA wire code tables and `Duration` factories — plain
|
|
121
136
|
`const` objects with no dependencies, no side effects.
|
|
137
|
+
|
|
138
|
+
## Contributing
|
|
139
|
+
|
|
140
|
+
Contributions are welcome — bug reports, reproductions, docs and code alike. Start with [CONTRIBUTING.md](CONTRIBUTING.md); the full guide lives in the [browsersmith repo](https://github.com/jverneuer/browsersmith/blob/main/CONTRIBUTING.md). First timer? Check the [`good first issue`](https://github.com/jverneuer/browsercore-contracts/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) label. Security issues: [SECURITY.md](SECURITY.md), never a public issue.
|
package/dist/contracts.d.ts
CHANGED
|
@@ -4,16 +4,25 @@
|
|
|
4
4
|
* Litmus test: "Could another package reasonably import this type?"
|
|
5
5
|
* If yes → belongs here. If only one protocol touches it → stays in that package.
|
|
6
6
|
*/
|
|
7
|
-
import type { ContentEncoding, Cookie, DatagramCloseReason, EcdhCurve, EcdhKeyPair,
|
|
7
|
+
import type { ContentEncoding, Cookie, DatagramCloseReason, EcdhCurve, EcdhKeyPair, HashId, ProtocolFrame, TransportState, CloseReason, UdpAddress, X25519KeyPair, MLKEM768KeyPair } from "./models.js";
|
|
8
|
+
import type { EventProvider } from "./events.js";
|
|
8
9
|
/**
|
|
9
|
-
* `CryptoProvider` — the injected cryptographic primitive surface.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
10
|
+
* `CryptoProvider` — the canonical injected cryptographic primitive surface.
|
|
11
|
+
*
|
|
12
|
+
* Canonical definition (replaceability audit 2026-11-16): this is the single
|
|
13
|
+
* Transport/Crypto-level source of truth. `@browsercore/crypto` re-exports
|
|
14
|
+
* this exact type; `HashId` is a plain union here while the branded
|
|
15
|
+
* specializations (`Sha256Id`/`Sha384Id`, the `SHA_256`/`SHA_384` constants)
|
|
16
|
+
* stay in `@browsercore/crypto` and remain assignable to these parameters in
|
|
17
|
+
* both directions (verified by compile check).
|
|
18
|
+
*
|
|
19
|
+
* Implemented by: the composition root (`browsersmith`) assembles the
|
|
20
|
+
* Node-backed provider from `@browsercore/crypto` building blocks and injects
|
|
21
|
+
* it as `Platform.crypto.provider` — protocol packages (tls, quic, http2,
|
|
22
|
+
* fetch) never import `node:crypto` or any runtime builtin directly.
|
|
23
|
+
*
|
|
24
|
+
* All operations are synchronous by design — an async-only backend such as
|
|
25
|
+
* WebCrypto cannot implement this interface; it is NOT a valid backend.
|
|
17
26
|
*/
|
|
18
27
|
export interface CryptoProvider {
|
|
19
28
|
randomBytes(length: number): Uint8Array;
|
|
@@ -35,17 +44,45 @@ export interface CryptoProvider {
|
|
|
35
44
|
ecdhSharedSecret(curve: EcdhCurve, secretKey: Uint8Array, peerPublicKey: Uint8Array): Uint8Array;
|
|
36
45
|
verifySignature(scheme: string, publicKey: Uint8Array, signature: Uint8Array, data: Uint8Array): boolean;
|
|
37
46
|
aesEcbEncrypt(key: Uint8Array, block: Uint8Array): Uint8Array;
|
|
47
|
+
/**
|
|
48
|
+
* Generate an ML-KEM-768 key pair (FIPS 203, formerly Kyber).
|
|
49
|
+
*
|
|
50
|
+
* The public key (encapsulation key) is sent in the TLS 1.3
|
|
51
|
+
* `X25519MLKEM768` key-share entry; the secret key (decapsulation key)
|
|
52
|
+
* is held locally to recover the shared secret from the peer's ciphertext.
|
|
53
|
+
*/
|
|
54
|
+
mlkem768GenerateKeyPair(): MLKEM768KeyPair;
|
|
55
|
+
/**
|
|
56
|
+
* ML-KEM-768 decapsulation — recover the 32-byte shared secret from a
|
|
57
|
+
* ciphertext produced by the peer's encapsulation.
|
|
58
|
+
*/
|
|
59
|
+
mlkem768Decapsulate(secretKey: Uint8Array, ciphertext: Uint8Array): Uint8Array;
|
|
60
|
+
/**
|
|
61
|
+
* Compute the TLS 1.3 `X25519MLKEM768` hybrid shared secret.
|
|
62
|
+
*
|
|
63
|
+
* Per draft-ietf-tls-ecdhe-mlkem, the post-quantum and classical shared
|
|
64
|
+
* secrets are concatenated — `mlkem_shared_secret || x25519_shared_secret`
|
|
65
|
+
* (post-quantum first) — and the 64-byte result is fed into the TLS 1.3
|
|
66
|
+
* key schedule. Order verified against OpenSSL's X25519MLKEM768 peer.
|
|
67
|
+
*/
|
|
68
|
+
x25519MLKEM768SharedSecret(x25519SecretKey: Uint8Array, x25519PeerPublicKey: Uint8Array, mlkemSecretKey: Uint8Array, mlkemCiphertext: Uint8Array): Uint8Array;
|
|
38
69
|
}
|
|
39
70
|
/**
|
|
40
|
-
* `CompressionProvider` — the injected compression surface.
|
|
71
|
+
* `CompressionProvider` — the canonical injected compression surface.
|
|
41
72
|
*
|
|
42
|
-
*
|
|
73
|
+
* Canonical definition (replaceability audit 2026-11-16): signature-identical
|
|
74
|
+
* to `@browsercore/compression`'s local copy — verified method-by-method; this
|
|
75
|
+
* interface is the single source of truth, the compression package keeps a
|
|
76
|
+
* compatible re-export.
|
|
43
77
|
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* bind to `node:zlib`
|
|
47
|
-
*
|
|
48
|
-
*
|
|
78
|
+
* Implemented by: the composition root (`browsersmith`) assembles the
|
|
79
|
+
* node:zlib-backed provider and injects it as `Platform.compression` —
|
|
80
|
+
* HTTP/1 and HTTP/2 receive it through options and never bind to `node:zlib`
|
|
81
|
+
* directly.
|
|
82
|
+
*
|
|
83
|
+
* All operations are synchronous by design. An async-stream backend such as
|
|
84
|
+
* WebCompressionStream cannot implement this interface — it is NOT a valid
|
|
85
|
+
* backend (the former claim that it was has been corrected).
|
|
49
86
|
*
|
|
50
87
|
* The async `encode/decode(ContentEncoding)` shape had zero consumers and is
|
|
51
88
|
* dropped. This sync shape is the single source of truth.
|
|
@@ -69,41 +106,60 @@ export interface CompressionProvider {
|
|
|
69
106
|
decompress(data: Uint8Array, encoding: ContentEncoding): Uint8Array;
|
|
70
107
|
}
|
|
71
108
|
/**
|
|
72
|
-
* `Transport` — the injected reliable byte stream (TCP).
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
109
|
+
* `Transport` — the canonical injected reliable byte stream (TCP).
|
|
110
|
+
*
|
|
111
|
+
* Canonical definition (replaceability audit 2026-11-16): this is the shape
|
|
112
|
+
* `@browsercore/transport` implements and every protocol package consumes —
|
|
113
|
+
* `@browsercore/transport` re-exports this exact type instead of declaring a
|
|
114
|
+
* competing one. The former contracts-only variant (literal-event `on`/`once`
|
|
115
|
+
* overloads plus a `bytesTransferred` counter on the open state) was
|
|
116
|
+
* implemented by nobody and is gone.
|
|
117
|
+
*
|
|
118
|
+
* Implemented by: `@browsercore/transport`'s `TcpTransport` (via
|
|
119
|
+
* `Platform.network.tcp` + `connect()`), and `@browsercore/proxy`'s
|
|
120
|
+
* socket adapter for tunneled streams. Consumed by tls, http1, http2, fetch.
|
|
121
|
+
*
|
|
122
|
+
* Events: `on`/`once` are inherited from {@link EventProvider} — the broad
|
|
123
|
+
* `(event: string, listener: (...args: unknown[]) => void)` surface every
|
|
124
|
+
* implementation actually declares. Narrowing them to per-literal overloads
|
|
125
|
+
* here would reject those implementations under strict checks (verified by
|
|
126
|
+
* compile probe on this toolchain), so the typed 3-event overloads of the old
|
|
127
|
+
* contracts variant are deliberately not preserved. Consumers subscribe to
|
|
128
|
+
* `"data"`/`"close"`/`"error"` through the EventProvider surface.
|
|
129
|
+
*
|
|
130
|
+
* `id` is a plain string; the branded `TransportId` specialization lives in
|
|
131
|
+
* `@browsercore/transport` and assigns to/from this field.
|
|
85
132
|
*/
|
|
86
|
-
export interface Transport {
|
|
133
|
+
export interface Transport extends EventProvider {
|
|
134
|
+
/** Opaque identifier for logging / correlation. */
|
|
87
135
|
readonly id: string;
|
|
136
|
+
/** Current lifecycle state (see {@link TransportState}). */
|
|
88
137
|
readonly state: TransportState;
|
|
138
|
+
/**
|
|
139
|
+
* Write bytes to the stream. Resolves when the data has been handed to the
|
|
140
|
+
* kernel (or buffered). Rejects if the transport is not open.
|
|
141
|
+
*/
|
|
89
142
|
write(data: Uint8Array): Promise<void>;
|
|
143
|
+
/**
|
|
144
|
+
* Read available data. Resolves with the next chunk of bytes, or rejects if
|
|
145
|
+
* the transport closes before any data arrives. For a streaming read API,
|
|
146
|
+
* subscribe to the `"data"` event instead.
|
|
147
|
+
*/
|
|
90
148
|
read(): Promise<Uint8Array>;
|
|
149
|
+
/**
|
|
150
|
+
* Gracefully close the transport. Resolves once the stream has closed.
|
|
151
|
+
* `reason` is recorded for observability.
|
|
152
|
+
*/
|
|
91
153
|
close(reason?: CloseReason): Promise<void>;
|
|
92
|
-
on(event: "data", listener: (data: Uint8Array) => void): void;
|
|
93
|
-
on(event: "close", listener: (reason: CloseReason) => void): void;
|
|
94
|
-
on(event: "error", listener: (error: Error) => void): void;
|
|
95
|
-
once(event: "data", listener: (data: Uint8Array) => void): void;
|
|
96
|
-
once(event: "close", listener: (reason: CloseReason) => void): void;
|
|
97
|
-
once(event: "error", listener: (error: Error) => void): void;
|
|
98
154
|
}
|
|
99
155
|
/**
|
|
100
|
-
* `DatagramTransport` — the injected UDP datagram surface.
|
|
156
|
+
* `DatagramTransport` — the canonical injected UDP datagram surface.
|
|
101
157
|
*
|
|
102
|
-
*
|
|
158
|
+
* Canonical definition (replaceability audit 2026-11-16): signature-identical
|
|
159
|
+
* to `@browsercore/transport`'s local copy, which re-exports this one.
|
|
103
160
|
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* protocol packages never bind to a runtime socket directly.
|
|
161
|
+
* Implemented by: the composition root's UDP adapter (`browsersmith`,
|
|
162
|
+
* `Platform.network.udp`). Consumed by `@browsercore/quic`.
|
|
107
163
|
*/
|
|
108
164
|
export interface DatagramTransport {
|
|
109
165
|
readonly id: string;
|
|
@@ -114,115 +170,13 @@ export interface DatagramTransport {
|
|
|
114
170
|
}>;
|
|
115
171
|
close(reason?: DatagramCloseReason): Promise<void>;
|
|
116
172
|
}
|
|
117
|
-
/**
|
|
118
|
-
* `TlsConnection` — the injected TLS connection surface.
|
|
119
|
-
*
|
|
120
|
-
* Implemented by: `@browsercore/tls`
|
|
121
|
-
*
|
|
122
|
-
* Why here: fetch consumes `TlsConnection`. The TLS package receives its
|
|
123
|
-
* injected dependencies (transport, crypto, events) through `TlsOptions`,
|
|
124
|
-
* which is populated from the `Platform` composition root.
|
|
125
|
-
*/
|
|
126
|
-
export interface TlsConnection {
|
|
127
|
-
readonly id: string;
|
|
128
|
-
readonly state: TlsState;
|
|
129
|
-
handshake(): Promise<void>;
|
|
130
|
-
read(): Promise<Uint8Array>;
|
|
131
|
-
write(data: Uint8Array): Promise<void>;
|
|
132
|
-
close(): Promise<void>;
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* `Http1Connection` — the injected HTTP/1 connection surface.
|
|
136
|
-
*
|
|
137
|
-
* Implemented by: `@browsercore/http1`
|
|
138
|
-
*
|
|
139
|
-
* Why here: fetch consumes `Http1Connection`. The package receives its
|
|
140
|
-
* injected transport and profile through `Http1Options`.
|
|
141
|
-
*/
|
|
142
|
-
export interface Http1Connection {
|
|
143
|
-
readonly id: string;
|
|
144
|
-
request(req: Request): Promise<Response>;
|
|
145
|
-
close(): Promise<void>;
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* `Http2Connection` — the injected HTTP/2 connection surface.
|
|
149
|
-
*
|
|
150
|
-
* Implemented by: `@browsercore/http2`
|
|
151
|
-
*
|
|
152
|
-
* Why here: fetch consumes `Http2Connection`. The package receives its
|
|
153
|
-
* injected transport and profile through `Http2Options`.
|
|
154
|
-
*/
|
|
155
|
-
export interface Http2Connection {
|
|
156
|
-
readonly id: string;
|
|
157
|
-
request(req: Request): Promise<Response>;
|
|
158
|
-
close(): Promise<void>;
|
|
159
|
-
goaway(): Promise<void>;
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* `Http3Connection` — the injected HTTP/3 connection surface.
|
|
163
|
-
*
|
|
164
|
-
* Implemented by: `@browsercore/http3`
|
|
165
|
-
*
|
|
166
|
-
* Why here: fetch consumes `Http3Connection`. Built on top of
|
|
167
|
-
* `QuicConnection`; receives its injected QUIC transport through
|
|
168
|
-
* `Http3Options`.
|
|
169
|
-
*/
|
|
170
|
-
export interface Http3Connection {
|
|
171
|
-
readonly id: string;
|
|
172
|
-
request(req: Request): Promise<Response>;
|
|
173
|
-
close(): Promise<void>;
|
|
174
|
-
goaway(streamId: bigint): Promise<void>;
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* `QuicConnection` — the injected QUIC connection surface.
|
|
178
|
-
*
|
|
179
|
-
* Implemented by: `@browsercore/quic`
|
|
180
|
-
*
|
|
181
|
-
* Why here: HTTP/3 consumes `QuicConnection`. The package receives its
|
|
182
|
-
* injected UDP transport and crypto through `QuicOptions`, populated from
|
|
183
|
-
* `Platform`.
|
|
184
|
-
*/
|
|
185
|
-
export interface QuicConnection {
|
|
186
|
-
readonly id: string;
|
|
187
|
-
handshake(): Promise<void>;
|
|
188
|
-
openBidirectionalStream(): Promise<QuicStream>;
|
|
189
|
-
acceptBidirectionalStream(): Promise<QuicStream>;
|
|
190
|
-
openUnidirectionalStream(): Promise<QuicStream>;
|
|
191
|
-
acceptUnidirectionalStream(): Promise<QuicStream>;
|
|
192
|
-
close(errorCode: bigint, reason: string): Promise<void>;
|
|
193
|
-
sendPathChallenge(data: Uint8Array): void;
|
|
194
|
-
hasPendingPathChallenge(data: Uint8Array): boolean;
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* `QuicStream` — an injected QUIC stream handle.
|
|
198
|
-
*
|
|
199
|
-
* Why here: `QuicConnection` returns `QuicStream`; HTTP/3 uses it for
|
|
200
|
-
* request multiplexing. Streams are owned by the QUIC package and carry no
|
|
201
|
-
* direct runtime dependency.
|
|
202
|
-
*/
|
|
203
|
-
export interface QuicStream {
|
|
204
|
-
readonly id: bigint;
|
|
205
|
-
write(data: Uint8Array): Promise<void>;
|
|
206
|
-
read(): Promise<Uint8Array>;
|
|
207
|
-
close(): Promise<void>;
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* `FetchClient` — the injected high-level fetch surface.
|
|
211
|
-
*
|
|
212
|
-
* Implemented by: `@browsercore/fetch`
|
|
213
|
-
*
|
|
214
|
-
* Why here: browsersmith consumes `FetchClient`. Assembled from the
|
|
215
|
-
* protocol connections and injected services (`CookieJar`, transport, crypto)
|
|
216
|
-
* via `FetchClientOptions`, which `browsersmith` populates from `Platform`.
|
|
217
|
-
*/
|
|
218
|
-
export interface FetchClient {
|
|
219
|
-
fetch(url: string, options?: FetchOptions): Promise<FetchResponse>;
|
|
220
|
-
close(): Promise<void>;
|
|
221
|
-
}
|
|
222
173
|
/**
|
|
223
174
|
* `CookieJar` — the injected cookie storage surface.
|
|
224
175
|
*
|
|
225
|
-
* Implemented by: `@browsercore/cookies`
|
|
176
|
+
* Implemented by: `@browsercore/cookies` (its local `CookieJar` is the shape
|
|
177
|
+
* consumers actually bind; note its `setCookie` parameter order is
|
|
178
|
+
* `(cookie, url)` — flipped relative to this interface. Reconciling the two
|
|
179
|
+
* is tracked separately from the Transport/CryptoProvider unification.)
|
|
226
180
|
*
|
|
227
181
|
* Why here: fetch and browsersmith both use `CookieJar`. Provided via
|
|
228
182
|
* `FetchClientOptions.cookieJar`, populated from `Platform` or a custom
|
package/dist/contracts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACR,eAAe,EACf,MAAM,EACN,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACR,eAAe,EACf,MAAM,EACN,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,MAAM,EACN,aAAa,EACb,cAAc,EACd,WAAW,EACX,UAAU,EACV,aAAa,EACb,eAAe,EAClB,MAAM,aAAa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U,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC,CAAC;IAC1E,KAAK,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtD;AAMD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,SAAS;IACtB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IAC3C,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7C,KAAK,IAAI,IAAI,CAAC;IACd,SAAS,IAAI,MAAM,CAAC;IACpB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAWD;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC;CACtC"}
|
package/dist/events.d.ts
CHANGED
|
@@ -33,8 +33,17 @@ export interface EventProvider {
|
|
|
33
33
|
* Consumers define a map of event names to listener signatures and get
|
|
34
34
|
* type-safe `emit`/`on` calls. This is the typed counterpart to the
|
|
35
35
|
* untyped `EventProvider` — same injection pattern, stronger guarantees.
|
|
36
|
+
*
|
|
37
|
+
* The constraint uses `(...args: never[]) => void`: `never` is the bottom
|
|
38
|
+
* type, so by contravariance ANY listener signature satisfies it
|
|
39
|
+
* (`(x: number) => void`, `() => void`, …). The former `unknown[]`
|
|
40
|
+
* constraint rejected every map with typed parameters — i.e. the exact
|
|
41
|
+
* pattern this interface documents — while `any[]` (the original) is banned
|
|
42
|
+
* by the coding standards. `never[]` is the no-`any` way to say "any
|
|
43
|
+
* listener shape" (corrected with the 2026-11-16 test-rot fix; the tests
|
|
44
|
+
* had never been typechecked against this constraint).
|
|
36
45
|
*/
|
|
37
|
-
export interface TypedEventEmitter<T extends Record<string, (...args:
|
|
46
|
+
export interface TypedEventEmitter<T extends Record<string, (...args: never[]) => void>> {
|
|
38
47
|
on<K extends keyof T>(event: K, listener: T[K]): void;
|
|
39
48
|
once<K extends keyof T>(event: K, listener: T[K]): void;
|
|
40
49
|
off<K extends keyof T>(event: K, listener: T[K]): void;
|
package/dist/events.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC1B,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,GAAG,IAAI,CAAC;IAChE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,GAAG,IAAI,CAAC;IAClE,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,GAAG,IAAI,CAAC;IACjE,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,GAAG,IAAI,CAAC;IAC5E,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACjD,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACrC,kBAAkB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5C;AAED
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW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AI,CAAC;IACvD,IAAI,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;CACzE"}
|
package/dist/index.d.ts
CHANGED
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
* ▼
|
|
23
23
|
* browsersmith (composition root — builds & threads Platform)
|
|
24
24
|
*/
|
|
25
|
-
export type { CryptoProvider, CompressionProvider, Transport, DatagramTransport,
|
|
26
|
-
export type { ProfileId, BrowserProfile, TlsProfile, Http1Profile, Http2Profile, HpackProfile, Http2PriorityFrame, Request, Response, FetchOptions, FetchResponse, Headers, Cookie, HashId, EcdhCurve, X25519KeyPair, EcdhKeyPair, UdpAddress, TransportState, CloseReason, DatagramCloseReason, TlsState, ContentEncoding, } from "./models.js";
|
|
25
|
+
export type { CryptoProvider, CompressionProvider, Transport, DatagramTransport, CookieJar, PacketCallback, PacketInspectionOptions, } from "./contracts.js";
|
|
26
|
+
export type { ProfileId, BrowserProfile, TlsProfile, Http1Profile, Http2Profile, HpackProfile, Http2PriorityFrame, Request, Response, FetchOptions, FetchResponse, Headers, Cookie, HashId, EcdhCurve, X25519KeyPair, MLKEM768KeyPair, EcdhKeyPair, UdpAddress, TransportState, CloseReason, DatagramCloseReason, TlsState, ContentEncoding, } from "./models.js";
|
|
27
27
|
export { CIPHER_GREASE_PLACEHOLDER, CIPHER_SUITE_CODES, NAMED_GROUP_CODES, SIGNATURE_SCHEME_CODES, VERSION_CODES, } from "./models.js";
|
|
28
28
|
export type { ConnectOptions, Socket, Net, DnsResolver, IPAddress, Network, } from "./tcp-transport.js";
|
|
29
29
|
export type { EventProvider, TypedEventEmitter, } from "./events.js";
|
|
@@ -32,5 +32,4 @@ export type { Clock, Deadline, Scheduler, Time, } from "./time.js";
|
|
|
32
32
|
/** Duration static factories — `Duration.seconds(5)`, `Duration.milliseconds(250)`. */
|
|
33
33
|
export { Duration } from "./time.js";
|
|
34
34
|
export type { Compression, Crypto, Platform, PlatformOptions, } from "./platform.js";
|
|
35
|
-
export type { TlsOptions, Http1Options, Http2Options, Http3Options, QuicOptions, FetchClientOptions, } from "./options.js";
|
|
36
35
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAMH,YAAY,EAER,cAAc,EACd,mBAAmB,EACnB,SAAS,EACT,iBAAiB,EAEjB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAMH,YAAY,EAER,cAAc,EACd,mBAAmB,EACnB,SAAS,EACT,iBAAiB,EAEjB,SAAS,EAET,cAAc,EACd,uBAAuB,GAC1B,MAAM,gBAAgB,CAAC;AAMxB,YAAY,EAER,SAAS,EAET,cAAc,EACd,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAElB,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,aAAa,EAEb,OAAO,EAEP,MAAM,EAEN,MAAM,EACN,SAAS,EACT,aAAa,EACb,eAAe,EACf,WAAW,EAEX,UAAU,EACV,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,QAAQ,EAER,eAAe,GAClB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACH,yBAAyB,EACzB,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,aAAa,GAChB,MAAM,aAAa,CAAC;AAMrB,YAAY,EACR,cAAc,EACd,MAAM,EACN,GAAG,EACH,WAAW,EACX,SAAS,EACT,OAAO,GACV,MAAM,oBAAoB,CAAC;AAM5B,YAAY,EACR,aAAa,EACb,iBAAiB,GACpB,MAAM,aAAa,CAAC;AAMrB,YAAY,EACR,MAAM,EACN,IAAI,EACJ,MAAM,EACN,OAAO,EACP,SAAS,GACZ,MAAM,gBAAgB,CAAC;AAMxB,YAAY,EACR,KAAK,EACL,QAAQ,EACR,SAAS,EACT,IAAI,GACP,MAAM,WAAW,CAAC;AAEnB,uFAAuF;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAMrC,YAAY,EACR,WAAW,EACX,MAAM,EACN,QAAQ,EACR,eAAe,GAClB,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -26,4 +26,9 @@
|
|
|
26
26
|
export { CIPHER_GREASE_PLACEHOLDER, CIPHER_SUITE_CODES, NAMED_GROUP_CODES, SIGNATURE_SCHEME_CODES, VERSION_CODES, } from "./models.js";
|
|
27
27
|
/** Duration static factories — `Duration.seconds(5)`, `Duration.milliseconds(250)`. */
|
|
28
28
|
export { Duration } from "./time.js";
|
|
29
|
+
// The former Options layer (TlsOptions/Http1Options/…/FetchClientOptions) and
|
|
30
|
+
// the Protocol Connection Contracts (TlsConnection/Http1Connection/…
|
|
31
|
+
// /QuicConnection/QuicStream/FetchClient) were removed: zero consumers
|
|
32
|
+
// repo-wide, every consumer binds implementation-local types
|
|
33
|
+
// (replaceability audit 2026-11-16).
|
|
29
34
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AA0DH,8DAA8D;AAC9D,OAAO,EACH,yBAAyB,EACzB,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,aAAa,GAChB,MAAM,aAAa,CAAC;AA+CrB,uFAAuF;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAarC,8EAA8E;AAC9E,qEAAqE;AACrE,uEAAuE;AACvE,6DAA6D;AAC7D,qCAAqC"}
|
package/dist/models.d.ts
CHANGED
|
@@ -22,7 +22,10 @@ export interface ProtocolFrame {
|
|
|
22
22
|
/** Timestamp (ms since epoch) when the frame was captured. */
|
|
23
23
|
readonly timestamp: number;
|
|
24
24
|
}
|
|
25
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Profile identifier — a plain string (registry key into @browsercore/profiles).
|
|
27
|
+
* Branding deliberately lives in the implementing packages, not here.
|
|
28
|
+
*/
|
|
26
29
|
export type ProfileId = string;
|
|
27
30
|
/**
|
|
28
31
|
* Complete browser fingerprint definition.
|
|
@@ -263,6 +266,17 @@ export interface X25519KeyPair {
|
|
|
263
266
|
readonly publicKey: Uint8Array;
|
|
264
267
|
readonly secretKey: Uint8Array;
|
|
265
268
|
}
|
|
269
|
+
/**
|
|
270
|
+
* ML-KEM-768 (FIPS 203) key pair.
|
|
271
|
+
*
|
|
272
|
+
* `publicKey` is the 1184-byte encapsulation key sent in the TLS 1.3
|
|
273
|
+
* `X25519MLKEM768` key-share entry; `secretKey` is the 2400-byte decapsulation
|
|
274
|
+
* key held locally to recover the shared secret from the peer's ciphertext.
|
|
275
|
+
*/
|
|
276
|
+
export interface MLKEM768KeyPair {
|
|
277
|
+
readonly publicKey: Uint8Array;
|
|
278
|
+
readonly secretKey: Uint8Array;
|
|
279
|
+
}
|
|
266
280
|
export interface EcdhKeyPair {
|
|
267
281
|
readonly curve: EcdhCurve;
|
|
268
282
|
readonly publicKey: Uint8Array;
|
|
@@ -273,11 +287,20 @@ export interface UdpAddress {
|
|
|
273
287
|
readonly port: number;
|
|
274
288
|
readonly family: 4 | 6;
|
|
275
289
|
}
|
|
290
|
+
/**
|
|
291
|
+
* Lifecycle state of a transport connection.
|
|
292
|
+
*
|
|
293
|
+
* Canonical shape — identical to the one `@browsercore/transport` implements
|
|
294
|
+
* and every protocol package consumes. The `open` variant carries no byte
|
|
295
|
+
* counter: the former `bytesTransferred` field was implemented by nobody
|
|
296
|
+
* (only faked by @browsercore/proxy's socket adapter) and is gone
|
|
297
|
+
* (replaceability audit 2026-11-16). Extra state fields stay permitted via
|
|
298
|
+
* structural typing — implementations may keep richer internal states.
|
|
299
|
+
*/
|
|
276
300
|
export type TransportState = {
|
|
277
301
|
readonly state: "connecting";
|
|
278
302
|
} | {
|
|
279
303
|
readonly state: "open";
|
|
280
|
-
readonly bytesTransferred: number;
|
|
281
304
|
} | {
|
|
282
305
|
readonly state: "closing";
|
|
283
306
|
} | {
|
package/dist/models.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,qCAAqC;AACrC,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,UAAU,CAAC;AAElD;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC1B,wCAAwC;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,+CAA+C;IAC/C,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC,8DAA8D;IAC9D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC9B;AAMD
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,qCAAqC;AACrC,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,UAAU,CAAC;AAElD;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC1B,wCAAwC;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,+CAA+C;IAC/C,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC,8DAA8D;IAC9D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC9B;AAMD;;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AC,MAAM,EAAE,MAAM,CAAC,CAK1D,CAAC"}
|
package/dist/models.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.js","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA6XH,8EAA8E;AAC9E,6DAA6D;AAC7D,8EAA8E;AAC9E,EAAE;AACF,8EAA8E;AAC9E,6EAA6E;AAC7E,sEAAsE;AACtE,0EAA0E;AAC1E,kBAAkB;AAElB,sFAAsF;AACtF,MAAM,CAAC,MAAM,yBAAyB,GAAG,uBAAuB,CAAC;AAEjE;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAqC;IAChE,CAAC,yBAAyB,CAAC,EAAE,MAAM;IACnC,sBAAsB,EAAE,MAAM;IAC9B,sBAAsB,EAAE,MAAM;IAC9B,4BAA4B,EAAE,MAAM;IACpC,sBAAsB,EAAE,MAAM;IAC9B,uCAAuC,EAAE,MAAM;IAC/C,qCAAqC,EAAE,MAAM;IAC7C,uCAAuC,EAAE,MAAM;IAC/C,qCAAqC,EAAE,MAAM;IAC7C,6CAA6C,EAAE,MAAM;IACrD,2CAA2C,EAAE,MAAM;IACnD,kCAAkC,EAAE,MAAM;IAC1C,kCAAkC,EAAE,MAAM;IAC1C,oCAAoC,EAAE,MAAM;IAC5C,oCAAoC,EAAE,MAAM;IAC5C,uCAAuC,EAAE,MAAM;IAC/C,uCAAuC,EAAE,MAAM;IAC/C,qCAAqC,EAAE,MAAM;IAC7C,qCAAqC,EAAE,MAAM;IAC7C,+BAA+B,EAAE,MAAM;IACvC,+BAA+B,EAAE,MAAM;IACvC,4BAA4B,EAAE,MAAM;IACpC,4BAA4B,EAAE,MAAM;IACpC,+BAA+B,EAAE,MAAM;IACvC,+BAA+B,EAAE,MAAM;IACvC,qCAAqC,EAAE,MAAM;IAC7C,mCAAmC,EAAE,MAAM;IAC3C,6BAA6B,EAAE,MAAM;CACxC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAqC;IAC/D,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,MAAM;IACjB,cAAc,EAAE,MAAM;IACtB,cAAc,EAAE,MAAM;CACzB,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAqC;IACpE,sBAAsB,EAAE,MAAM;IAC9B,sBAAsB,EAAE,MAAM;IAC9B,sBAAsB,EAAE,MAAM;IAC9B,UAAU,EAAE,MAAM;IAClB,mBAAmB,EAAE,MAAM;IAC3B,mBAAmB,EAAE,MAAM;IAC3B,mBAAmB,EAAE,MAAM;IAC3B,gBAAgB,EAAE,MAAM;IACxB,gBAAgB,EAAE,MAAM;IACxB,gBAAgB,EAAE,MAAM;IACxB,cAAc,EAAE,MAAM;IACtB,OAAO,EAAE,MAAM;CAClB,CAAC;AAEF,2EAA2E;AAC3E,MAAM,CAAC,MAAM,aAAa,GAAqC;IAC3D,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,MAAM;CACpB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@browsercore/contracts",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Shared interfaces
|
|
3
|
+
"version": "0.2.5",
|
|
4
|
+
"description": "Shared interfaces and models for the browsercore stack",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/jverneuer/browsercore-contracts.git"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"clean": "rm -rf dist",
|
|
34
34
|
"build": "tsc -p tsconfig.json",
|
|
35
35
|
"prepublishOnly": "npm run clean && npm run build",
|
|
36
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
36
|
+
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json --noEmit",
|
|
37
37
|
"test": "vitest run",
|
|
38
38
|
"lint": "oxlint --type-aware src/"
|
|
39
39
|
},
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@types/node": "^26.1.2",
|
|
42
42
|
"@vitest/coverage-v8": "^4.1.10",
|
|
43
43
|
"oxlint": "^1.76.0",
|
|
44
|
-
"oxlint-tsgolint": "7.0.
|
|
44
|
+
"oxlint-tsgolint": "7.0.2005",
|
|
45
45
|
"typescript": "^7.0.2",
|
|
46
46
|
"vitest": "^4.1.10"
|
|
47
47
|
}
|
package/dist/options.d.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Options — configuration for protocol packages.
|
|
3
|
-
*
|
|
4
|
-
* Each protocol package accepts an options object that implements one of
|
|
5
|
-
* these interfaces. Options are implementation-independent configuration
|
|
6
|
-
* that gets passed down from consumers like browsersmith.
|
|
7
|
-
*/
|
|
8
|
-
import type { Transport, DatagramTransport, QuicConnection, PacketCallback, CookieJar } from "./contracts.js";
|
|
9
|
-
import type { Clock } from "./time.js";
|
|
10
|
-
import type { BrowserProfile, UdpAddress } from "./models.js";
|
|
11
|
-
export interface TlsOptions {
|
|
12
|
-
readonly transport: Transport;
|
|
13
|
-
readonly profile: BrowserProfile;
|
|
14
|
-
readonly serverName: string;
|
|
15
|
-
readonly clock?: Clock;
|
|
16
|
-
readonly onPacket?: PacketCallback;
|
|
17
|
-
}
|
|
18
|
-
export interface Http1Options {
|
|
19
|
-
readonly transport: Transport;
|
|
20
|
-
readonly profile: BrowserProfile;
|
|
21
|
-
readonly onPacket?: PacketCallback;
|
|
22
|
-
}
|
|
23
|
-
export interface Http2Options {
|
|
24
|
-
readonly transport: Transport;
|
|
25
|
-
readonly profile: BrowserProfile;
|
|
26
|
-
readonly onPacket?: PacketCallback;
|
|
27
|
-
}
|
|
28
|
-
export interface Http3Options {
|
|
29
|
-
readonly quic: QuicConnection;
|
|
30
|
-
readonly clock?: Clock;
|
|
31
|
-
readonly onPacket?: PacketCallback;
|
|
32
|
-
}
|
|
33
|
-
export interface QuicOptions {
|
|
34
|
-
readonly transport: DatagramTransport;
|
|
35
|
-
readonly peer: UdpAddress;
|
|
36
|
-
readonly serverName: string;
|
|
37
|
-
readonly initialDcid: Uint8Array;
|
|
38
|
-
readonly initialScid: Uint8Array;
|
|
39
|
-
readonly handshakeTimeoutMs?: number;
|
|
40
|
-
readonly clock?: Clock;
|
|
41
|
-
readonly onPacket?: PacketCallback;
|
|
42
|
-
}
|
|
43
|
-
export interface FetchClientOptions {
|
|
44
|
-
readonly profile?: BrowserProfile;
|
|
45
|
-
readonly cookieJar?: CookieJar;
|
|
46
|
-
readonly tls?: Partial<TlsOptions>;
|
|
47
|
-
readonly http2?: Partial<Http2Options>;
|
|
48
|
-
readonly http3?: Partial<Http3Options>;
|
|
49
|
-
readonly transport?: Transport;
|
|
50
|
-
}
|
|
51
|
-
//# sourceMappingURL=options.d.ts.map
|
package/dist/options.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACR,SAAS,EACT,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,SAAS,EACZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAM9D,MAAM,WAAW,UAAU;IACvB,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,OAAO,E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G,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACnC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IACvC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IACvC,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;CAClC"}
|
package/dist/options.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Options — configuration for protocol packages.
|
|
3
|
-
*
|
|
4
|
-
* Each protocol package accepts an options object that implements one of
|
|
5
|
-
* these interfaces. Options are implementation-independent configuration
|
|
6
|
-
* that gets passed down from consumers like browsersmith.
|
|
7
|
-
*/
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=options.js.map
|
package/dist/options.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|