dsh-xdpool 3.0.5 → 3.0.7
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 +42 -0
- package/README.md +29 -6
- package/lib/bin.js +88 -4
- package/lib/client.js +206 -547
- package/lib/index.d.ts +13 -1
- package/lib/index.js +533 -294
- package/package.json +1 -1
- package/vendor/channel-pack/pack.js +14 -20
package/lib/index.d.ts
CHANGED
|
@@ -1716,6 +1716,18 @@ export declare class WorkBuddyAccountPool {
|
|
|
1716
1716
|
* Returns true when the token is known good afterwards (refreshed, or still
|
|
1717
1717
|
* valid), false when the credential was proven dead.
|
|
1718
1718
|
*/
|
|
1719
|
+
/**
|
|
1720
|
+
* 取一个账号「可以用来发一次请求」的凭据:过期就先刷新。
|
|
1721
|
+
*
|
|
1722
|
+
* 签到 / 积分这些端点走的是「按 id 直接找账号」的路径,和选号路径不同 ——
|
|
1723
|
+
* 以前它们直接拿池里的 `account.credential`,凭据过期时上游回 401,界面只能
|
|
1724
|
+
* 说「领取失败」,而同一时刻对话却正常(对话走 `getAvailableAccount`,那里会
|
|
1725
|
+
* 先 `ensureFresh`)。用户反馈的「积分领取全部失败」就是这一处。
|
|
1726
|
+
*
|
|
1727
|
+
* 返回 undefined 表示「刷新失败」:调用方应当直接告诉用户重新登录,
|
|
1728
|
+
* 而不是拿旧 token 再去撞一次 401。
|
|
1729
|
+
*/
|
|
1730
|
+
freshCredential(id: string): Promise<WorkBuddyCredential | undefined>;
|
|
1719
1731
|
private ensureFresh;
|
|
1720
1732
|
/**
|
|
1721
1733
|
* Cool a whole account after the upstream reports its credits are spent.
|
|
@@ -2148,7 +2160,7 @@ interface PoolWebRelayStatus {
|
|
|
2148
2160
|
stats?: {
|
|
2149
2161
|
requests: number;
|
|
2150
2162
|
failed: number;
|
|
2151
|
-
avgLatencyMs?: number;
|
|
2163
|
+
avgLatencyMs?: number | undefined;
|
|
2152
2164
|
inputTokens: number;
|
|
2153
2165
|
outputTokens: number;
|
|
2154
2166
|
} | undefined;
|