@opentapd/tplugin-cli 0.39.1-alpha.0 → 0.40.0

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/lib/deploy.js CHANGED
@@ -261,7 +261,7 @@ async function deploy(branch, commit, code, { nick } = {}) {
261
261
  spinner.start('部署中... ...');
262
262
  let i = 0;
263
263
  // 轮训等待部署任务结果
264
- while (i++ < 60) {
264
+ while (i++ < 120) {
265
265
  let buildStatus = '';
266
266
  try {
267
267
  const { data } = await tapdsdk.request({ url: 'open_user_app/get_build_status', params: {
package/lib/serve.js CHANGED
@@ -65,6 +65,51 @@ module.exports = async () => {
65
65
  workspaceId = session.getConfig('companyId');
66
66
  }
67
67
 
68
+ if (tpluginConf.tapd.pluginEnv === 'cloud') {
69
+ //获取当前公司信息
70
+ const { data } = await tapdsdk.request({ url: 'open_user_app/get_company_info', params: {}, method: 'POST' });
71
+
72
+ //获取公司信息失败
73
+ if (!data.status || !data.data) {
74
+ spinner.fail("获取公司信息失败");
75
+ process.exit(1);
76
+ }
77
+
78
+
79
+ if(!data.data.is_test) {
80
+ spinner.info("当前企业不是测试企业");
81
+ const { data } = await tapdsdk.request({ url: 'open_user_app/get_test_deploy_company_option', params: {}, method: 'POST' });
82
+ if (!data.status || !data.data) {
83
+ spinner.fail("获取测试公司信息失败");
84
+ process.exit(1);
85
+ }
86
+
87
+ if(Array.isArray(data.data.data_list) && data.data.data_list.length === 0) {
88
+ const { createTestCompany } = await inquirer.prompt({
89
+ type: 'confirm',
90
+ message: '是否创建测试企业',
91
+ name: 'createTestCompany',
92
+ });
93
+
94
+ if (createTestCompany) {
95
+ spinner.info('开始创建测试企业');
96
+ const { data } = await tapdsdk.request({ url: 'open_user_app/register_test_company', params: {}, method: 'POST' });
97
+ if (!data.status) {
98
+ spinner.fail("创建测试企业失败");
99
+ process.exit(1);
100
+ }
101
+ spinner.succeed("创建测试企业成功,请重新登陆切换到测试企业");
102
+ process.exit(1);
103
+ } else {
104
+ spinner.info("请前往开放平台->开发者后台->应用测试创建测试企业");
105
+ process.exit(1);
106
+ }
107
+ } else {
108
+ spinner.fail("当前企业不是测试企业,请重新登陆切换到测试企业调试应用");
109
+ process.exit(1);
110
+ }
111
+ }
112
+ }
68
113
 
69
114
  console.log(`\n 进入调试空间: ${chalk.red(`${tpluginConf.tapd.tapdHost}/${workspaceId}`)}`);
70
115
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentapd/tplugin-cli",
3
- "version": "0.39.1-alpha.0",
3
+ "version": "0.40.0",
4
4
  "description": "tplugin-cli",
5
5
  "bin": {
6
6
  "tplugin-cli": "index.js"
@@ -78,5 +78,5 @@
78
78
  "node": ">=14.13.0"
79
79
  },
80
80
  "main": "index.js",
81
- "gitHead": "3237e1a29988e4f95f87be3309f7ce27ef669866"
81
+ "gitHead": "7cc83729aa15bbadec7de5ae3aad71e52984f9cc"
82
82
  }