dsh-xdpool 2.6.7 → 2.7.1
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 +110 -0
- package/lib/bin.js +59 -30
- package/lib/client.js +540 -24
- package/lib/index.d.ts +14 -6
- package/lib/index.js +4964 -2380
- package/package.json +1 -1
- package/vendor/channel-pack/pack.js +108 -2
package/lib/index.d.ts
CHANGED
|
@@ -192,7 +192,20 @@ interface ChatMessage {
|
|
|
192
192
|
//#endregion
|
|
193
193
|
//#region src/upstream.d.ts
|
|
194
194
|
/** Upstream failure classes the shim maps onto distinct HTTP answers. */
|
|
195
|
-
type UpstreamErrorKind = 'hard_credit' | 'soft_rate' | 'session_dead' |
|
|
195
|
+
type UpstreamErrorKind = 'hard_credit' | 'soft_rate' | 'session_dead' |
|
|
196
|
+
/**
|
|
197
|
+
* The account is blocked by the vendor's risk control — issue #127.
|
|
198
|
+
*
|
|
199
|
+
* A 403 whose body carries `code 11140` means "this account is flagged", not "this
|
|
200
|
+
* credential is invalid". The two were merged into `session_dead`, so the card printed
|
|
201
|
+
* "API 密钥无效" and the user was sent to re-authenticate over and over for a problem that
|
|
202
|
+
* re-authentication cannot fix — the sign-in succeeds, the flag remains.
|
|
203
|
+
*
|
|
204
|
+
* Separated because the remedy differs: a dead session wants a refresh, a flagged account
|
|
205
|
+
* wants the other accounts in the pool and, if all of them are flagged, a word with the
|
|
206
|
+
* vendor.
|
|
207
|
+
*/
|
|
208
|
+
'risk_blocked' | 'not_found' | 'server' | 'client';
|
|
196
209
|
/** Token-refresh answer; fields the upstream omits stay absent. */
|
|
197
210
|
interface WorkBuddyRefreshOutcome {
|
|
198
211
|
accessToken: string;
|
|
@@ -322,11 +335,6 @@ interface UpstreamClientOptions {
|
|
|
322
335
|
/** Region for a login domain; an empty domain means CN (matching upstream tooling). */
|
|
323
336
|
/** The two gateways WorkBuddy serves: the domestic one and the international one. */
|
|
324
337
|
type WorkBuddyRegion = 'cn' | 'global';
|
|
325
|
-
/**
|
|
326
|
-
* Classify an upstream failure from its HTTP status and body excerpt.
|
|
327
|
-
* Body markers win over status, because the upstream reuses 400/200 for
|
|
328
|
-
* several distinct conditions.
|
|
329
|
-
*/
|
|
330
338
|
export declare function classifyUpstreamError(status: number, body: string): UpstreamErrorKind;
|
|
331
339
|
/**
|
|
332
340
|
* Parse the reset time the upstream reports for a rate limit, when present.
|