@cloudbase/cloudbase-mcp 1.0.10 → 1.0.11
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/auth.js +1 -1
- package/dist/cloudbase-manager.js +3 -3
- package/package.json +1 -1
package/dist/auth.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AuthSupevisor } from '@cloudbase/toolbox';
|
|
2
2
|
const auth = AuthSupevisor.getInstance({});
|
|
3
|
-
export async function
|
|
3
|
+
export async function getLoginState() {
|
|
4
4
|
const { TENCENTCLOUD_SECRETID, TENCENTCLOUD_SECRETKEY, TENCENTCLOUD_SESSIONTOKEN } = process.env;
|
|
5
5
|
if (TENCENTCLOUD_SECRETID && TENCENTCLOUD_SECRETKEY) {
|
|
6
6
|
await auth.loginByApiSecret(TENCENTCLOUD_SECRETID, TENCENTCLOUD_SECRETKEY, TENCENTCLOUD_SESSIONTOKEN);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import CloudBase from "@cloudbase/manager-node";
|
|
2
|
-
import {
|
|
2
|
+
import { getLoginState } from './auth.js';
|
|
3
3
|
export async function getCloudBaseManager() {
|
|
4
|
-
const loginState = await
|
|
4
|
+
const loginState = await getLoginState();
|
|
5
5
|
const { envId, secretId, secretKey, token } = loginState;
|
|
6
6
|
const cloudbase = new CloudBase({
|
|
7
|
-
envId,
|
|
7
|
+
envId: process.env.CLOUDBASE_ENV_ID || envId,
|
|
8
8
|
secretId,
|
|
9
9
|
secretKey,
|
|
10
10
|
token
|