react-native-update-cli 1.38.0 → 1.38.1

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/api.js CHANGED
@@ -15,6 +15,9 @@ _export(exports, {
15
15
  doDelete: function() {
16
16
  return doDelete;
17
17
  },
18
+ get: function() {
19
+ return get;
20
+ },
18
21
  getSession: function() {
19
22
  return getSession;
20
23
  },
@@ -126,6 +129,7 @@ function queryWithBody(method) {
126
129
  body: JSON.stringify(body)
127
130
  });
128
131
  }
132
+ const get = queryWithoutBody('GET');
129
133
  const post = queryWithBody('POST');
130
134
  const put = queryWithBody('PUT');
131
135
  const doDelete = queryWithBody('DELETE');
package/lib/versions.js CHANGED
@@ -106,12 +106,12 @@ const commands = {
106
106
  });
107
107
  }
108
108
  },
109
- versions: async function({ options }) {
109
+ versions: async ({ options })=>{
110
110
  const platform = (0, _app.checkPlatform)(options.platform || await (0, _utils.question)('平台(ios/android/harmony):'));
111
111
  const { appId } = await (0, _app.getSelectedApp)(platform);
112
112
  await listVersions(appId);
113
113
  },
114
- update: async function({ args, options }) {
114
+ update: async ({ args, options })=>{
115
115
  const platform = (0, _app.checkPlatform)(options.platform || await (0, _utils.question)('平台(ios/android/harmony):'));
116
116
  const { appId } = await (0, _app.getSelectedApp)(platform);
117
117
  let versionId = options.versionId || (await chooseVersion(appId)).id;
@@ -127,7 +127,7 @@ const commands = {
127
127
  rollout = null;
128
128
  } else {
129
129
  try {
130
- rollout = parseInt(rollout);
130
+ rollout = Number.parseInt(rollout);
131
131
  } catch (e) {
132
132
  throw new Error('rollout 必须是 1-100 的整数');
133
133
  }
@@ -228,7 +228,7 @@ const commands = {
228
228
  });
229
229
  console.log(`已将热更版本 ${versionId} 绑定到原生版本 ${pkgVersion} (id: ${pkgId})`);
230
230
  },
231
- updateVersionInfo: async function({ args, options }) {
231
+ updateVersionInfo: async ({ args, options })=>{
232
232
  const platform = (0, _app.checkPlatform)(options.platform || await (0, _utils.question)('平台(ios/android/harmony):'));
233
233
  const { appId } = await (0, _app.getSelectedApp)(platform);
234
234
  const versionId = options.versionId || (await chooseVersion(appId)).id;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-update-cli",
3
- "version": "1.38.0",
3
+ "version": "1.38.1",
4
4
  "description": "Command tools for javaScript updater with `pushy` service for react native apps.",
5
5
  "main": "index.js",
6
6
  "bin": {
package/src/api.ts CHANGED
@@ -101,6 +101,7 @@ function queryWithBody(method: string) {
101
101
  });
102
102
  }
103
103
 
104
+ export const get = queryWithoutBody('GET');
104
105
  export const post = queryWithBody('POST');
105
106
  export const put = queryWithBody('PUT');
106
107
  export const doDelete = queryWithBody('DELETE');
package/src/versions.js CHANGED
@@ -112,14 +112,14 @@ export const commands = {
112
112
  await this.update({ args: [], options: { versionId: id, platform } });
113
113
  }
114
114
  },
115
- versions: async function ({ options }) {
115
+ versions: async ({ options }) => {
116
116
  const platform = checkPlatform(
117
117
  options.platform || (await question('平台(ios/android/harmony):')),
118
118
  );
119
119
  const { appId } = await getSelectedApp(platform);
120
120
  await listVersions(appId);
121
121
  },
122
- update: async function ({ args, options }) {
122
+ update: async ({ args, options }) => {
123
123
  const platform = checkPlatform(
124
124
  options.platform || (await question('平台(ios/android/harmony):')),
125
125
  );
@@ -138,7 +138,7 @@ export const commands = {
138
138
  rollout = null;
139
139
  } else {
140
140
  try {
141
- rollout = parseInt(rollout);
141
+ rollout = Number.parseInt(rollout);
142
142
  } catch (e) {
143
143
  throw new Error('rollout 必须是 1-100 的整数');
144
144
  }
@@ -173,7 +173,9 @@ export const commands = {
173
173
  await put(`/app/${appId}/package/${pkg.id}`, {
174
174
  versionId,
175
175
  });
176
- console.log(`已将热更版本 ${versionId} 绑定到原生版本 ${pkg.name} (id: ${pkg.id})`);
176
+ console.log(
177
+ `已将热更版本 ${versionId} 绑定到原生版本 ${pkg.name} (id: ${pkg.id})`,
178
+ );
177
179
  }
178
180
  console.log(`操作完成,共已绑定 ${pkgs.length} 个原生版本`);
179
181
  return;
@@ -205,7 +207,9 @@ export const commands = {
205
207
  await put(`/app/${appId}/package/${pkg.id}`, {
206
208
  versionId,
207
209
  });
208
- console.log(`已将热更版本 ${versionId} 绑定到原生版本 ${pkg.name} (id: ${pkg.id})`);
210
+ console.log(
211
+ `已将热更版本 ${versionId} 绑定到原生版本 ${pkg.name} (id: ${pkg.id})`,
212
+ );
209
213
  }
210
214
  console.log(`操作完成,共已绑定 ${pkgs.length} 个原生版本`);
211
215
  return;
@@ -228,14 +232,14 @@ export const commands = {
228
232
  if (!pkgId) {
229
233
  throw new Error('请提供 packageId 或 packageVersion 参数');
230
234
  }
231
-
235
+
232
236
  if (!pkgVersion) {
233
237
  const pkg = data.find((d) => d.id === pkgId);
234
238
  if (pkg) {
235
239
  pkgVersion = pkg.name;
236
240
  }
237
241
  }
238
-
242
+
239
243
  if (rollout) {
240
244
  await put(`/app/${appId}/version/${versionId}`, {
241
245
  config: {
@@ -251,9 +255,11 @@ export const commands = {
251
255
  await put(`/app/${appId}/package/${pkgId}`, {
252
256
  versionId,
253
257
  });
254
- console.log(`已将热更版本 ${versionId} 绑定到原生版本 ${pkgVersion} (id: ${pkgId})`);
258
+ console.log(
259
+ `已将热更版本 ${versionId} 绑定到原生版本 ${pkgVersion} (id: ${pkgId})`,
260
+ );
255
261
  },
256
- updateVersionInfo: async function ({ args, options }) {
262
+ updateVersionInfo: async ({ args, options }) => {
257
263
  const platform = checkPlatform(
258
264
  options.platform || (await question('平台(ios/android/harmony):')),
259
265
  );