@opentapd/tplugin-cli 0.20.0-beta.11 → 0.20.0-beta.13

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/config.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "tapd": {
3
3
  "openHost": "https://open.tapd.cn",
4
- "tapdHost": "https://tapd.cn",
4
+ "tapdHost": "https://www.tapd.cn",
5
5
  "websocketHost": "wss://proxifer.tapd.cn/proxy",
6
6
  "apiHost": "https://api.tapd.cn",
7
7
  "upgradeWebsocketHost": "wss://upgrader.tapd.cn",
package/lib/create.js CHANGED
@@ -75,18 +75,7 @@ module.exports = async (code, options) => {
75
75
 
76
76
  spinner.start('稍等片刻,正在创建...');
77
77
  // 调起创建插件
78
- const res = await create(params);
79
-
80
- if (!res || !res.status) {
81
- spinner.fail('创建插件失败');
82
- return;
83
- }
84
-
85
- if (res && res.status) {
86
- spinner.stop();
87
- // 创建完成后,拉取代码
88
- await cloneRepo(res, code);
89
- }
78
+ await create(params);
90
79
  };
91
80
 
92
81
  /**
@@ -139,7 +128,27 @@ async function getEntranceOpts() {
139
128
  // create(params): 创建插件请求
140
129
  async function create(params) {
141
130
  const { data } = await tapdsdk.request({ url: '/open_user_app/create_app', method: 'POST', params });
142
- return data;
131
+ if (!data || !data.status) {
132
+ spinner.fail('创建插件失败');
133
+ return ;
134
+ }
135
+
136
+ await getAppCreateStatus(params.code);
137
+ }
138
+
139
+ async function getAppCreateStatus(code) {
140
+ const { data } = await tapdsdk.request({ url: `/open_user_app/get_create_app_status/${code}`, method: 'GET' });
141
+ if (!data || data.data.status === '7') {
142
+ spinner.fail('创建插件失败');
143
+ return;
144
+ }
145
+ if (data.data.status === '0') {
146
+ setTimeout(() => getAppCreateStatus(code), 1);
147
+ } else if (data.data.status === '1') {
148
+ spinner.stop();
149
+ // 创建完成后,拉取代码
150
+ await cloneRepo(data, code);
151
+ }
143
152
  }
144
153
 
145
154
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentapd/tplugin-cli",
3
- "version": "0.20.0-beta.11",
3
+ "version": "0.20.0-beta.13",
4
4
  "description": "tplugin-cli",
5
5
  "bin": {
6
6
  "tplugin-cli": "index.js"