@tokenbuddy/tokenbuddy 1.0.39 → 1.0.41
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/dist/src/buyer-store.d.ts +22 -0
- package/dist/src/buyer-store.js +46 -7
- package/dist/src/daemon.d.ts +16 -0
- package/dist/src/daemon.js +421 -17
- package/dist/src/init-clawtip-activation.js +16 -2
- package/dist/src/provider-install.d.ts +3 -5
- package/dist/src/provider-install.js +33 -425
- package/dist/src/route-failover.js +10 -0
- package/dist/src/seller-pool.d.ts +5 -5
- package/dist/src/seller-pool.js +5 -7
- package/dist/src/seller-route-recommendations.d.ts +110 -0
- package/dist/src/seller-route-recommendations.js +334 -0
- package/package.json +2 -2
- package/static/ui/assets/index-Ca_IcEY6.js +271 -0
- package/static/ui/assets/index-DAq0t0SA.css +1 -0
- package/static/ui/index.html +2 -2
- package/static/ui/assets/index-BAwWDK4H.js +0 -271
- package/static/ui/assets/index-DM9SnAfj.css +0 -1
|
@@ -37,7 +37,10 @@ function isClawtipPayWalletAuthOutput(args, output) {
|
|
|
37
37
|
|| output.includes("MEDIA:")
|
|
38
38
|
|| lower.includes("clawtipid")
|
|
39
39
|
|| lower.includes("qrcode")
|
|
40
|
-
|| lower.includes("扫码")
|
|
40
|
+
|| lower.includes("扫码")
|
|
41
|
+
|| output.includes("人工授权")
|
|
42
|
+
|| output.includes("付款凭证缺失")
|
|
43
|
+
|| output.includes("首次使用");
|
|
41
44
|
}
|
|
42
45
|
export function resolveNpxCommand(options = {}) {
|
|
43
46
|
const platform = options.platform ?? process.platform;
|
|
@@ -198,12 +201,20 @@ function findClawtipFailureMessage(output) {
|
|
|
198
201
|
}
|
|
199
202
|
const returnedMessage = trimmed.match(/^返回消息[::]\s*(.+)$/);
|
|
200
203
|
const returnedText = returnedMessage?.[1]?.trim();
|
|
204
|
+
if (returnedText && isClawtipManualAuthorizationMessage(returnedText)) {
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
201
207
|
if (returnedText && !returnedText.includes("成功")) {
|
|
202
208
|
return sanitizeClawtipOutput(trimmed);
|
|
203
209
|
}
|
|
204
210
|
}
|
|
205
211
|
return undefined;
|
|
206
212
|
}
|
|
213
|
+
function isClawtipManualAuthorizationMessage(message) {
|
|
214
|
+
return message.includes("人工授权")
|
|
215
|
+
|| message.includes("付款凭证缺失")
|
|
216
|
+
|| message.includes("首次使用");
|
|
217
|
+
}
|
|
207
218
|
function decodeClawtipValue(value) {
|
|
208
219
|
try {
|
|
209
220
|
return decodeURIComponent(value);
|
|
@@ -273,7 +284,10 @@ export function parseClawtipCliOutput(output) {
|
|
|
273
284
|
|| lower.includes("authurl")
|
|
274
285
|
|| lower.includes("qrcode")
|
|
275
286
|
|| lower.includes("scan")
|
|
276
|
-
|| lower.includes("扫码")
|
|
287
|
+
|| lower.includes("扫码")
|
|
288
|
+
|| output.includes("人工授权")
|
|
289
|
+
|| output.includes("付款凭证缺失")
|
|
290
|
+
|| output.includes("首次使用")),
|
|
277
291
|
walletReady: lower.includes("register success")
|
|
278
292
|
|| lower.includes("注册成功")
|
|
279
293
|
|| lower.includes("tokeninfo")
|
|
@@ -154,11 +154,9 @@ export declare function previewProviderInstall(options: ProviderInstallOptions):
|
|
|
154
154
|
*/
|
|
155
155
|
export declare function applyProviderInstall(options: ProviderInstallOptions, store: BuyerStore): ProviderApplyResult[];
|
|
156
156
|
/**
|
|
157
|
-
*
|
|
158
|
-
* 从 `store`
|
|
159
|
-
*
|
|
160
|
-
* 配置升级后的 disconnect 语义是移除 TokenBuddy,而不是恢复旧 TokenBuddy。
|
|
161
|
-
* 没有快照的 provider 标记为 `missing_snapshot`。
|
|
157
|
+
* 断开 provider 安装。
|
|
158
|
+
* 从 `store` 读取首次 connect 前的快照,精确恢复原文件或删除当次创建的文件。
|
|
159
|
+
* 没有快照时不猜测、不清理第三方配置,只返回 `missing_snapshot`。
|
|
162
160
|
*
|
|
163
161
|
* @param options 回滚选项
|
|
164
162
|
* @param store buyer store
|