@x-all-in-one/coding-helper 0.4.0 → 0.4.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.
|
@@ -7,8 +7,9 @@ export declare class ApiKeyFlow {
|
|
|
7
7
|
static getInstance(): ApiKeyFlow;
|
|
8
8
|
/**
|
|
9
9
|
* 运行 API Key 配置流程
|
|
10
|
+
* @returns 'success' 验证成功, 'back' 返回上级, undefined 其他情况
|
|
10
11
|
*/
|
|
11
|
-
run(): Promise<void>;
|
|
12
|
+
run(): Promise<'success' | 'back' | void>;
|
|
12
13
|
/**
|
|
13
14
|
* 输入并验证 API Key
|
|
14
15
|
*/
|
|
@@ -24,6 +24,7 @@ export class ApiKeyFlow {
|
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* 运行 API Key 配置流程
|
|
27
|
+
* @returns 'success' 验证成功, 'back' 返回上级, undefined 其他情况
|
|
27
28
|
*/
|
|
28
29
|
async run() {
|
|
29
30
|
while (true) {
|
|
@@ -60,12 +61,12 @@ export class ApiKeyFlow {
|
|
|
60
61
|
process.exit(0);
|
|
61
62
|
}
|
|
62
63
|
if (action === 'back') {
|
|
63
|
-
return;
|
|
64
|
+
return 'back';
|
|
64
65
|
}
|
|
65
66
|
if (action === 'input') {
|
|
66
67
|
const success = await this.inputApiKey();
|
|
67
68
|
if (success) {
|
|
68
|
-
return;
|
|
69
|
+
return 'success';
|
|
69
70
|
}
|
|
70
71
|
// 验证失败,继续循环
|
|
71
72
|
}
|