@dmarket/p2p-tracker-headless 1.4.1-SNAPSHOT-development.327 → 1.5.0-beta
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/dmarket-p2p-tracker-core-domain.mjs +5337 -5483
- package/dmarket-p2p-tracker-core-domain.mjs.map +1 -1
- package/index.d.ts +47 -4
- package/kotlin-kotlin-stdlib.mjs +1473 -1812
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlinx-atomicfu.mjs +13 -13
- package/kotlinx-coroutines-core.mjs +2308 -2308
- package/kotlinx-coroutines-core.mjs.map +1 -1
- package/kotlinx-io-kotlinx-io-bytestring.mjs +32 -32
- package/kotlinx-io-kotlinx-io-core.mjs +451 -451
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1895 -1895
- package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1580 -1580
- package/ktor-ktor-client-core.mjs +1962 -1962
- package/ktor-ktor-events.mjs +6 -6
- package/ktor-ktor-http-cio.mjs +320 -320
- package/ktor-ktor-http.mjs +794 -1742
- package/ktor-ktor-http.mjs.map +1 -1
- package/ktor-ktor-io.mjs +628 -628
- package/ktor-ktor-utils.mjs +722 -725
- package/ktor-ktor-websockets.mjs +391 -391
- package/p2p-tracker-core.mjs +10543 -10592
- package/p2p-tracker-core.mjs.map +1 -1
- package/p2p-tracker-headless.mjs +1376 -1141
- package/p2p-tracker-headless.mjs.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -61,6 +61,20 @@ export interface HeadlessTrackerOptions {
|
|
|
61
61
|
onProverLine?: (stream: ProverLineStream, line: string) => void;
|
|
62
62
|
/** The clock, in epoch milliseconds; the system clock by default. */
|
|
63
63
|
nowMs?: () => number;
|
|
64
|
+
/**
|
|
65
|
+
* `true` to fail closed without a Steam proxy from the start: for a host that knows this account uses one, as
|
|
66
|
+
* after a restart (the proxy is held in memory only; the host remembers the fact and sets this). No token is held
|
|
67
|
+
* without a proxy: a push that would leave none held (none named and none held, or `proxy: null`) rejects with an
|
|
68
|
+
* `Error` coded `steamProxyRequiredCode()` and changes nothing. With no token held the tracker sends no heartbeat
|
|
69
|
+
* and makes no Steam call and no proof, so nothing reaches Steam, directly or otherwise. (The Steam transport and the
|
|
70
|
+
* prover refuse to go direct as well, a backstop a host does not see in practice.) The host hears `SteamProxyMissing`
|
|
71
|
+
* (ended by `SteamProxyRecovered`), and the state says `steamProxy: "none"`, `steamProxyRequired: true` meanwhile.
|
|
72
|
+
* Needs `prover.mode` `mpc`.
|
|
73
|
+
*
|
|
74
|
+
* `false` by default: the proxy is optional, but the tracker pins itself to one the first time it holds one
|
|
75
|
+
* (`proxy: null` then rejects coded `steamProxyLockedCode()`), for as long as it runs.
|
|
76
|
+
*/
|
|
77
|
+
requireSteamProxy?: boolean;
|
|
64
78
|
}
|
|
65
79
|
|
|
66
80
|
/** What became of a pushed key compared with the one held before it. */
|
|
@@ -108,6 +122,13 @@ export interface TrackerState {
|
|
|
108
122
|
readonly steamProxyUnreachable: boolean;
|
|
109
123
|
/** Since when, while `steamProxyUnreachable`. */
|
|
110
124
|
readonly steamProxyUnreachableSinceMs: number | null;
|
|
125
|
+
/** Whether a Steam proxy is held with the token: `set` or `none`, never which one. */
|
|
126
|
+
readonly steamProxy: "set" | "none";
|
|
127
|
+
/**
|
|
128
|
+
* Whether no Steam traffic may go direct: `requireSteamProxy`, or a proxy held once (the tracker is pinned). With
|
|
129
|
+
* `steamProxy: "none"` nothing reaches Steam until a token is pushed with a proxy.
|
|
130
|
+
*/
|
|
131
|
+
readonly steamProxyRequired: boolean;
|
|
111
132
|
}
|
|
112
133
|
|
|
113
134
|
/** The options of a Steam token push. */
|
|
@@ -115,14 +136,19 @@ export interface SteamTokenPushOptions {
|
|
|
115
136
|
/**
|
|
116
137
|
* The HTTP proxy this Steam account's traffic goes through, `http://user:pass@host:port` (HTTP CONNECT; no
|
|
117
138
|
* SOCKS), held with the token. Absent (or `undefined`): a renewal, the proxy held before stays — a push that names
|
|
118
|
-
* none never moves the account back to this host's address. A URL: that proxy from now on
|
|
119
|
-
* now on, Steam reached directly
|
|
139
|
+
* none never moves the account back to this host's address. A URL: that proxy from now on, replacing the one held.
|
|
140
|
+
* `null`: no proxy from now on, Steam reached directly — only while none has ever been held (else rejected coded
|
|
141
|
+
* `steamProxyLockedCode()`) and without `requireSteamProxy` (else `steamProxyRequiredCode()`). A token that is not
|
|
142
|
+
* held changes neither. Write-only.
|
|
120
143
|
*/
|
|
121
144
|
proxy?: string | null;
|
|
122
145
|
}
|
|
123
146
|
|
|
124
|
-
/**
|
|
125
|
-
|
|
147
|
+
/**
|
|
148
|
+
* Why a prover process ended before its proof did. `proxy_pinned`: cut because the account's first Steam proxy was
|
|
149
|
+
* pushed mid-proof; the proof runs again through it.
|
|
150
|
+
*/
|
|
151
|
+
export type KillCause = "out_of_memory" | "connect_deadline" | "session_deadline" | "exited" | "proxy_pinned";
|
|
126
152
|
|
|
127
153
|
/** Why a proof produced nothing. Every text in it, `summary` included, is redacted. */
|
|
128
154
|
export type ProofFailure =
|
|
@@ -178,6 +204,10 @@ export declare function pushTradingApiKey(
|
|
|
178
204
|
* failed — and a proof's `proxy_unreachable`. Rejects a `proxy` that is neither `null` nor an `http://` URL with a host
|
|
179
205
|
* and a port with an `Error` whose `code` is `steamProxyInvalidCode()`, naming the rule and never the value; resolves
|
|
180
206
|
* `invalid` where the host cannot route Steam through a proxy.
|
|
207
|
+
*
|
|
208
|
+
* The proxy is optional, but sticky once set: from the first push held with one, `proxy: null` rejects with an `Error`
|
|
209
|
+
* coded `steamProxyLockedCode()`; with `requireSteamProxy`, a push that would leave none held rejects coded
|
|
210
|
+
* `steamProxyRequiredCode()`. Either way nothing changed, and the caller asked for something refused (a 400).
|
|
181
211
|
*/
|
|
182
212
|
export declare function pushSteamToken(
|
|
183
213
|
handle: TrackerHandle,
|
|
@@ -196,6 +226,7 @@ export declare function reasons(): Readonly<{
|
|
|
196
226
|
proofTokenExpiring: "the Steam token is too close to its expiry to start a proof";
|
|
197
227
|
noProver: "no notary prover is configured on this host";
|
|
198
228
|
steamProxyUnreachable: "not sent: the Steam proxy could not be reached";
|
|
229
|
+
steamProxyMissing: "no Steam proxy is held, and this tracker requires one";
|
|
199
230
|
}>;
|
|
200
231
|
|
|
201
232
|
/** The `kind` of a failed-cancel check, by name. The same frozen object each call. */
|
|
@@ -223,6 +254,18 @@ export declare function steamNotLinkedCode(): "P2P_STEAM_NOT_LINKED";
|
|
|
223
254
|
*/
|
|
224
255
|
export declare function steamProxyInvalidCode(): "STEAM_PROXY_INVALID";
|
|
225
256
|
|
|
257
|
+
/**
|
|
258
|
+
* The `code` of the `Error` `pushSteamToken` rejects with for `proxy: null` once a proxy has been held: the tracker is
|
|
259
|
+
* pinned to a proxy; another may replace it, none may not. Nothing changed.
|
|
260
|
+
*/
|
|
261
|
+
export declare function steamProxyLockedCode(): "STEAM_PROXY_LOCKED";
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* The `code` of the `Error` `pushSteamToken` rejects with, on a tracker made with `requireSteamProxy`, for a push that
|
|
265
|
+
* would leave no proxy held: none named with none held, or `proxy: null`. Nothing changed.
|
|
266
|
+
*/
|
|
267
|
+
export declare function steamProxyRequiredCode(): "STEAM_PROXY_REQUIRED";
|
|
268
|
+
|
|
226
269
|
/** Under this much token life no create or proof starts. */
|
|
227
270
|
export declare function minWriteTokenLifetimeMs(): number;
|
|
228
271
|
|