ai-project-manage-cli 5.0.1 → 5.0.2
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/index.js +12 -9
- package/package.json +2 -4
package/dist/index.js
CHANGED
|
@@ -254,25 +254,28 @@ async function runLogin(opts) {
|
|
|
254
254
|
);
|
|
255
255
|
process.exit(1);
|
|
256
256
|
}
|
|
257
|
-
console.error(
|
|
258
|
-
"[apm] \u8BF7\u6C42\u5931\u8D25:",
|
|
259
|
-
raw instanceof Error ? raw.message : raw
|
|
260
|
-
);
|
|
257
|
+
console.error("[apm] \u8BF7\u6C42\u5931\u8D25:", raw instanceof Error ? raw.message : raw);
|
|
261
258
|
process.exit(1);
|
|
262
259
|
}
|
|
263
|
-
|
|
264
|
-
|
|
260
|
+
const userId = data?.user?.id;
|
|
261
|
+
const token = data?.token;
|
|
262
|
+
if (!userId || !token) {
|
|
263
|
+
console.error(
|
|
264
|
+
"[apm] \u54CD\u5E94\u7F3A\u5C11 user.id / token\uFF08\u8BF7\u786E\u8BA4\u670D\u52A1\u7AEF\u4E3A /api/auth/login\uFF09"
|
|
265
|
+
);
|
|
265
266
|
process.exit(1);
|
|
266
267
|
}
|
|
267
268
|
const cfg = {
|
|
268
269
|
baseUrl,
|
|
269
|
-
userId
|
|
270
|
-
token
|
|
270
|
+
userId,
|
|
271
|
+
token,
|
|
271
272
|
email: opts.email
|
|
272
273
|
};
|
|
273
274
|
await writeApmConfig(cfg);
|
|
274
275
|
console.error(`[apm] \u5DF2\u4FDD\u5B58\u767B\u5F55\u4FE1\u606F: ${APM_CONFIG_PATH}`);
|
|
275
|
-
console.log(
|
|
276
|
+
console.log(
|
|
277
|
+
JSON.stringify({ userId: cfg.userId, baseUrl: cfg.baseUrl }, null, 2)
|
|
278
|
+
);
|
|
276
279
|
}
|
|
277
280
|
|
|
278
281
|
// src/commands/branch.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-project-manage-cli",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.2",
|
|
4
4
|
"description": "命令行工具:后续用于调用平台后端 API 完成运维与自动化操作",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -15,9 +15,7 @@
|
|
|
15
15
|
],
|
|
16
16
|
"scripts": {
|
|
17
17
|
"build": "rm -rf dist && esbuild src/index.ts --bundle --platform=node --format=esm --packages=external --outfile=dist/index.js && tsc --noEmit -p tsconfig.json",
|
|
18
|
-
"prepublishOnly": "npm run build"
|
|
19
|
-
"test": "vitest run",
|
|
20
|
-
"test:watch": "vitest"
|
|
18
|
+
"prepublishOnly": "npm run build"
|
|
21
19
|
},
|
|
22
20
|
"devDependencies": {
|
|
23
21
|
"@types/node": "^22.0.0",
|