zmp-cli 3.15.2 → 3.15.4

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/deploy/index.js CHANGED
@@ -44,10 +44,17 @@ module.exports = async (
44
44
  const packageJsonFilename = config.filename.packageJson;
45
45
 
46
46
  let appConfigJson;
47
+ let writeAppConfig = true;
47
48
  try {
48
49
  appConfigJson = require(resolvePath(appConfigFilename));
49
50
  } catch (err) {
50
- errorExit(new Error(config.error_msg.app_config_not_found));
51
+ try {
52
+ // If app-config.json not found, try to use the one in the outputDir
53
+ appConfigJson = require(resolvePath(`${outputDir}/${appConfigFilename}`));
54
+ writeAppConfig = false;
55
+ } catch (err) {
56
+ errorExit(new Error(config.error_msg.app_config_not_found));
57
+ }
51
58
  }
52
59
 
53
60
  let packageJson;
@@ -94,14 +101,16 @@ module.exports = async (
94
101
  if (flag === 0) {
95
102
  errorExit(
96
103
  new Error(
97
- 'Please define your assets output at app-config.json. Read more: https:/'
104
+ 'Please define your assets output at app-config.json. Read more: https://mini.zalo.me/intro/getting-started/app-config/'
98
105
  )
99
106
  );
100
107
  }
101
- fse.writeFileSync(
102
- resolvePath(`${outputDir}/${config.filename.appConfig}`),
103
- JSON.stringify(appConfigJson)
104
- );
108
+ if (writeAppConfig) {
109
+ fse.writeFileSync(
110
+ resolvePath(`${outputDir}/${config.filename.appConfig}`),
111
+ JSON.stringify(appConfigJson)
112
+ );
113
+ }
105
114
  } else {
106
115
  appConfigJson = await buildApp(
107
116
  { ...options, appConfigJson, nextVersion },
package/login/index.js CHANGED
@@ -10,6 +10,7 @@ const envUtils = require('../utils/env');
10
10
  const log = require('../utils/log');
11
11
  const zaloLogin = require('./utils/zalo-login');
12
12
  const { axiosClient } = require('../utils/axios');
13
+ const qs = require('qs');
13
14
 
14
15
  const waitText = chalk.gray('Login...');
15
16
  const spinner = ora(waitText);
@@ -123,11 +124,16 @@ module.exports = async (options = {}, logger, { exitOnError = true } = {}) => {
123
124
  } else {
124
125
  await new Promise((resolve, reject) => {
125
126
  axiosClient({
126
- method: 'get',
127
- url: `${apiLogin}?accessToken=${token}&appId=${appId}`,
127
+ url: apiLogin,
128
+ method: 'POST',
128
129
  headers: {
129
130
  'cache-control': 'no-cache',
131
+ 'content-type': 'application/x-www-form-urlencoded',
130
132
  },
133
+ data: qs.stringify({
134
+ accessToken: token,
135
+ appId: appId,
136
+ }),
131
137
  withCredentials: true,
132
138
  })
133
139
  .then(function (response) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zmp-cli",
3
- "version": "3.15.2",
3
+ "version": "3.15.4",
4
4
  "description": "ZMP command line utility (CLI)",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -11,10 +11,6 @@
11
11
  "release": "node scripts/release.js",
12
12
  "lint": "eslint ."
13
13
  },
14
- "repository": {
15
- "type": "git",
16
- "url": "https://zalogit2.zing.vn/ZaloMiniApps/zmp-cli.git"
17
- },
18
14
  "keywords": [
19
15
  "zmp",
20
16
  "cli",