@cloudbase/cli 2.12.5-beta.1 → 2.12.5-beta.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/standalone/cli.js +17 -53
- package/package.json +1 -1
package/dist/standalone/cli.js
CHANGED
|
@@ -326169,7 +326169,7 @@ module.exports = function generate_pattern(it, $keyword, $ruleType) {
|
|
|
326169
326169
|
/***/ ((module) => {
|
|
326170
326170
|
|
|
326171
326171
|
"use strict";
|
|
326172
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@cloudbase/cli","version":"2.12.5-beta.
|
|
326172
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@cloudbase/cli","version":"2.12.5-beta.2","description":"cli tool for cloudbase","main":"lib/index.js","scripts":{"build":"rimraf lib types && tsc --resolveJsonModule && cpx \\"src/**/*.html\\" lib","watch":"rimraf lib types && tsc -w","dev":"rimraf lib types && cpx \\"src/**/*.html\\" lib && tsc -w","eslint":"eslint \\"./**/*.ts\\"","test":"node --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand --forceExit --detectOpenHandles --coverage --verbose --testTimeout=10000","tsc":"tsc","pkg":"pkg ./bin/cloudbase.js --out-path ./pkg","postinstall":"node ./post-install.js || exit 0 && patch-package","prepublishOnly":"node ./scripts/check-publish-source.js","debug":"bin/tcb.js lowcode watch","build:bundle":"webpack --config build/webpack/cli.cjs && webpack --config build/webpack/ccr.cjs && node build/scripts/copy-figlet-fonts.js","package:darwin-arm64":"OS=darwin ARCH=arm64 VERSION= node -e \\"require(\'child_process\').execSync(\'bash build/scripts/package.sh\',{stdio:\'inherit\'})\\"","package:darwin-x64":"OS=darwin ARCH=x64 VERSION= node -e \\"require(\'child_process\').execSync(\'bash build/scripts/package.sh\',{stdio:\'inherit\'})\\"","package:linux-arm64":"OS=linux ARCH=arm64 VERSION= node -e \\"require(\'child_process\').execSync(\'bash build/scripts/package.sh\',{stdio:\'inherit\'})\\"","package:linux-x64":"OS=linux ARCH=x64 VERSION= node -e \\"require(\'child_process\').execSync(\'bash build/scripts/package.sh\',{stdio:\'inherit\'})\\"","package:all":"bash build/scripts/build-all.sh","node:fetch:one":"node -e \\"require(\'child_process\').execSync(\'bash build/scripts/fetch-node.sh\',{stdio:\'inherit\'})\\"","node:fetch:all":"NODE_VERSION=22.18.0 bash build/scripts/fetch-node.sh --all","node:fetch:win-x64":"OS=windows ARCH=x64 NODE_VERSION=22.18.0 bash build/scripts/fetch-node.sh","node:fetch:win-arm64":"OS=windows ARCH=arm64 NODE_VERSION=22.18.0 bash build/scripts/fetch-node.sh","package:windows-x64":"OS=windows ARCH=x64 VERSION= node -e \\"require(\'child_process\').execSync(\'bash build/scripts/package.sh\',{stdio:\'inherit\'})\\"","package:windows-arm64":"OS=windows ARCH=arm64 VERSION= node -e \\"require(\'child_process\').execSync(\'bash build/scripts/package.sh\',{stdio:\'inherit\'})\\"","package:windows-all":"npm run -s node:fetch:win-x64 && npm run -s node:fetch:win-arm64 && npm run -s package:windows-x64 && npm run -s package:windows-arm64","package:npm":"npm run build && npm run build:bundle && bash build/scripts/prepare-publish.sh","out:prune":"bash build/scripts/prune-out.sh","i18n:scan":"i18next-scanner --config locales/i18next-scanner.config.js && node locales/scripts/generate.js","i18n:sync":"node locales/scripts/sync.js sync","publish":"node ./scripts/publish.js"},"repository":{"type":"git","url":"https://github.com/TencentCloudBase/cloud-base-cli.git"},"bin":{"cloudbase":"bin/cloudbase.js","cloudbase-mcp":"bin/cloudbase-mcp.cjs","tcb":"bin/tcb.js"},"husky":{"hooks":{"pre-commit":"npm run build"}},"author":"cwuyiqing@gmail.com","license":"ISC","dependencies":{"@cloudbase/cloud-api":"^0.5.5","@cloudbase/cloudbase-mcp":"^2.7.3","@cloudbase/framework-core":"^1.9.7","@cloudbase/functions-framework":"1.16.0","@cloudbase/iac-core":"0.0.3-alpha.14","@cloudbase/lowcode-cli":"^0.23.0","@cloudbase/manager-node":"4.7.4","@cloudbase/toolbox":"0.7.17-beta.1","@dotenvx/dotenvx":"^1.48.3","@musistudio/claude-code-router":"1.0.36","address":"^1.1.2","camelcase-keys":"^7.0.2","chalk":"^2.4.2","cli-table3":"^0.5.1","commander":"7","del":"^5.1.0","didyoumean":"^1.2.2","enquirer":"^2.3.6","execa":"^4.0.3","figlet":"^1.7.0","fs-extra":"^8.1.0","gradient-string":"^2.0.2","https-proxy-agent":"^5.0.1","i":"^0.3.7","inquirer":"^6.5.0","json-schema-to-typescript":"^14.0.5","lodash":"^4.17.21","log-symbols":"^3.0.0","lowdb":"^1.0.0","make-dir":"^3.0.0","node-fetch":"^2.6.0","nodemon":"^3.1.4","npm":"^11.5.2","open":"^7.0.0","ora":"^4.0.2","os-locale":"5.0.0","patch-package":"^8.0.0","portfinder":"^1.0.28","progress":"^2.0.3","query-string":"^6.8.1","reflect-metadata":"^0.1.13","semver":"^7.3.7","simple-git":"^3.28.0","tar-fs":"^2.0.1","terminal-link":"^2.1.1","toml":"^3.0.0","unzipper":"^0.10.10","update-notifier":"^4.0.0","xdg-basedir":"^4.0.0","yargs":"^16.2.0","yargs-parser":"^21.0.1","zod":"^4.0.13"},"devDependencies":{"@babel/parser":"^7.28.4","@babel/traverse":"^7.28.4","@babel/types":"^7.28.4","@types/fs-extra":"^11.0.4","@types/jest":"^27","@types/koa__router":"^8.0.11","@types/lodash":"^4.14.182","@types/node":"^12.12.38","@types/node-fetch":"^2.5.4","@types/react":"^17.0.37","@types/semver":"^7.3.9","@types/unzipper":"^0.10.11","@types/webpack-dev-server":"^3.11.1","@typescript-eslint/eslint-plugin":"^4.8.1","@typescript-eslint/parser":"^4.8.1","cpx":"^1.5.0","eslint":"^7.14.0","eslint-config-alloy":"^3.8.2","husky":"^3.0.9","i18next-scanner":"^4.6.0","jest":"^27","rimraf":"^3.0.2","ts-jest":"^27","typescript":"^4.7.2","webpack":"^5.92.0","webpack-cli":"^5.1.4"},"packageManager":"yarn@3.6.2+sha512.2c2f8b9615e6659773f65cdec7cf92ef773a98a99e611579601f61c7a91ec94c89c929aac86f1cee819421a9b0db7acfd53ec3ebb95af44f77f77634b08b9557","ai":{"skills":"./skills","skillsIndex":"./skills/index.json","compatible":["codebuddy","cursor","copilot","claude","windsurf"],"description":"CloudBase CLI - 腾讯云云开发命令行工具,支持云函数、云数据库、静态托管等全栈云开发能力"}}');
|
|
326173
326173
|
|
|
326174
326174
|
/***/ }),
|
|
326175
326175
|
|
|
@@ -398315,7 +398315,6 @@ const web_auth_1 = __webpack_require__(76097);
|
|
|
398315
398315
|
const oauth_1 = __webpack_require__(92423);
|
|
398316
398316
|
const common_1 = __webpack_require__(96711);
|
|
398317
398317
|
const credential_1 = __webpack_require__(99795);
|
|
398318
|
-
const web_1 = __webpack_require__(2240);
|
|
398319
398318
|
const error_1 = __webpack_require__(64119);
|
|
398320
398319
|
__exportStar(__webpack_require__(96711), exports);
|
|
398321
398320
|
__exportStar(__webpack_require__(99795), exports);
|
|
@@ -398370,7 +398369,7 @@ class AuthSupervisor {
|
|
|
398370
398369
|
*/
|
|
398371
398370
|
loginByWebAuth(options = {}) {
|
|
398372
398371
|
return __awaiter(this, void 0, void 0, function* () {
|
|
398373
|
-
const { getAuthUrl, throwError, noBrowser, callbackTimeout, mode:
|
|
398372
|
+
const { getAuthUrl, throwError, noBrowser, callbackTimeout, mode: AuthFlowMode, client_id, onDeviceCode } = options;
|
|
398374
398373
|
if (this.cacheCredential && this.needCache && !this.isCacheExpire()) {
|
|
398375
398374
|
return this.cacheCredential;
|
|
398376
398375
|
}
|
|
@@ -398379,42 +398378,15 @@ class AuthSupervisor {
|
|
|
398379
398378
|
if (credential)
|
|
398380
398379
|
return credential;
|
|
398381
398380
|
// 根据授权方式获取凭证
|
|
398382
|
-
|
|
398383
|
-
|
|
398384
|
-
|
|
398385
|
-
|
|
398386
|
-
|
|
398387
|
-
|
|
398388
|
-
|
|
398389
|
-
|
|
398390
|
-
|
|
398391
|
-
});
|
|
398392
|
-
break;
|
|
398393
|
-
case 'default':
|
|
398394
|
-
default: {
|
|
398395
|
-
const isNoBrowser = noBrowser || (0, web_1.isTruthyFlag)(process.env.TCB_NO_BROWSER);
|
|
398396
|
-
if (isNoBrowser) {
|
|
398397
|
-
credential = yield (0, oauth_1.getAuthTokenByDeviceFlow)({ client_id, onDeviceCode });
|
|
398398
|
-
}
|
|
398399
|
-
else {
|
|
398400
|
-
try {
|
|
398401
|
-
credential = yield (0, web_auth_1.getAuthTokenFromWeb)({
|
|
398402
|
-
getAuthUrl,
|
|
398403
|
-
callbackTimeout,
|
|
398404
|
-
onOpenFailed: () => { }
|
|
398405
|
-
});
|
|
398406
|
-
}
|
|
398407
|
-
catch (e) {
|
|
398408
|
-
if ((e === null || e === void 0 ? void 0 : e.code) === 'BROWSER_OPEN_FAILED') {
|
|
398409
|
-
credential = yield (0, oauth_1.getAuthTokenByDeviceFlow)({ client_id, onDeviceCode });
|
|
398410
|
-
}
|
|
398411
|
-
else {
|
|
398412
|
-
throw e;
|
|
398413
|
-
}
|
|
398414
|
-
}
|
|
398415
|
-
}
|
|
398416
|
-
break;
|
|
398417
|
-
}
|
|
398381
|
+
if (AuthFlowMode === 'web') {
|
|
398382
|
+
credential = yield (0, web_auth_1.getAuthTokenFromWeb)({
|
|
398383
|
+
getAuthUrl,
|
|
398384
|
+
noBrowser,
|
|
398385
|
+
callbackTimeout
|
|
398386
|
+
});
|
|
398387
|
+
}
|
|
398388
|
+
else {
|
|
398389
|
+
credential = yield (0, oauth_1.getAuthTokenByDeviceFlow)({ client_id, onDeviceCode });
|
|
398418
398390
|
}
|
|
398419
398391
|
credential = (0, common_1.resolveCredential)(credential);
|
|
398420
398392
|
try {
|
|
@@ -410397,12 +410369,11 @@ function openUrlByBrowserEnv(url) {
|
|
|
410397
410369
|
function shouldUseBrowserEnvFallback() {
|
|
410398
410370
|
return process.platform === 'linux' && isVSCodeEnvironment();
|
|
410399
410371
|
}
|
|
410400
|
-
function openUrl(url
|
|
410372
|
+
function openUrl(url) {
|
|
410401
410373
|
return __awaiter(this, void 0, void 0, function* () {
|
|
410402
|
-
const { skipBrowserFallback = false } = options;
|
|
410403
410374
|
try {
|
|
410404
410375
|
const child = yield (0, open_1.default)(url, { url: true });
|
|
410405
|
-
if (
|
|
410376
|
+
if (child === null || child === void 0 ? void 0 : child.once) {
|
|
410406
410377
|
child.once('error', (error) => __awaiter(this, void 0, void 0, function* () {
|
|
410407
410378
|
if (shouldUseBrowserEnvFallback()) {
|
|
410408
410379
|
yield openUrlByBrowserEnv(url);
|
|
@@ -410412,7 +410383,7 @@ function openUrl(url, options = {}) {
|
|
|
410412
410383
|
return true;
|
|
410413
410384
|
}
|
|
410414
410385
|
catch (e) {
|
|
410415
|
-
if (
|
|
410386
|
+
if (shouldUseBrowserEnvFallback()) {
|
|
410416
410387
|
return openUrlByBrowserEnv(url);
|
|
410417
410388
|
}
|
|
410418
410389
|
return false;
|
|
@@ -410437,13 +410408,7 @@ function getDataFromWeb(getUrl, type, options = {}) {
|
|
|
410437
410408
|
// 对 url 转码, 避免 wsl 无法正常打开地址
|
|
410438
410409
|
// https://www.npmjs.com/package/open#url
|
|
410439
410410
|
// https://github.com/sindresorhus/open/blob/master/index.js#L48
|
|
410440
|
-
|
|
410441
|
-
const opened = yield openUrl(url, { skipBrowserFallback });
|
|
410442
|
-
if (!opened && options.onOpenFailed) {
|
|
410443
|
-
server.close();
|
|
410444
|
-
options.onOpenFailed();
|
|
410445
|
-
throw new error_1.CloudBaseError('浏览器打开失败', { code: 'BROWSER_OPEN_FAILED' });
|
|
410446
|
-
}
|
|
410411
|
+
yield openUrl(url);
|
|
410447
410412
|
}
|
|
410448
410413
|
return new Promise((resolve, reject) => {
|
|
410449
410414
|
let finished = false;
|
|
@@ -743444,7 +743409,7 @@ exports.CLI_AUTH_BASE_URL = 'https://tcb.cloud.tencent.com/dev';
|
|
|
743444
743409
|
// 打开云开发控制台,获取授权
|
|
743445
743410
|
function getAuthTokenFromWeb(options = {}) {
|
|
743446
743411
|
return __awaiter(this, void 0, void 0, function* () {
|
|
743447
|
-
const { getAuthUrl, noBrowser, callbackTimeout
|
|
743412
|
+
const { getAuthUrl, noBrowser, callbackTimeout } = options;
|
|
743448
743413
|
const mac = yield (0, system_1.getMacAddress)();
|
|
743449
743414
|
const os = (0, system_1.getOSInfo)();
|
|
743450
743415
|
const macHash = (0, coding_1.md5Encoding)(mac);
|
|
@@ -743470,8 +743435,7 @@ function getAuthTokenFromWeb(options = {}) {
|
|
|
743470
743435
|
return cliAuthUrl;
|
|
743471
743436
|
}, 'login', {
|
|
743472
743437
|
noBrowser,
|
|
743473
|
-
callbackTimeout
|
|
743474
|
-
onOpenFailed
|
|
743438
|
+
callbackTimeout
|
|
743475
743439
|
});
|
|
743476
743440
|
const credential = (0, common_1.resolveCredential)(query);
|
|
743477
743441
|
return credential;
|