zmp-cli 3.15.6-beta.1 → 3.15.7

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.
Files changed (56) hide show
  1. package/build/index.js +1 -1
  2. package/config/index.js +1 -1
  3. package/create/index.js +1 -1
  4. package/create/init-zmp-ui.js +1 -1
  5. package/create/utils/colors.js +1 -1
  6. package/create/utils/generate-app-config.js +1 -1
  7. package/create/utils/generate-gitignore.js +1 -1
  8. package/create/utils/generate-npm-scripts.js +1 -1
  9. package/create/utils/generate-package-json.js +1 -1
  10. package/create/utils/generate-readme.js +1 -1
  11. package/create/utils/get-options.js +1 -1
  12. package/create/utils/indent.js +1 -1
  13. package/create/utils/npm-scripts.js +1 -1
  14. package/create/utils/string.js +1 -1
  15. package/create/utils/styles-extension.js +1 -1
  16. package/create/utils/template-if.js +1 -1
  17. package/deploy/index.js +1 -1
  18. package/deploy/utils/get-options.js +1 -1
  19. package/deploy/utils/request-upload.js +1 -1
  20. package/deploy/utils/upload-app.js +1 -1
  21. package/index.js +1 -1
  22. package/login/index.js +1 -1
  23. package/login/utils/get-options.js +1 -1
  24. package/login/utils/zalo-login.js +1 -1
  25. package/migrate/icons/update-icon-v3.js +1 -1
  26. package/migrate/index.js +1 -1
  27. package/migrate/utils/get-options.js +1 -1
  28. package/migrate/utils/migrate-react.js +1 -1
  29. package/package.json +1 -1
  30. package/start/generate-hr-config.js +1 -1
  31. package/start/index.js +1 -1
  32. package/sync/index-to-app-config.js +1 -1
  33. package/sync/index.js +1 -1
  34. package/utils/axios.js +1 -1
  35. package/utils/check-update.js +1 -1
  36. package/utils/constants.js +1 -1
  37. package/utils/env.js +1 -1
  38. package/utils/error.js +1 -1
  39. package/utils/find-files-by-ext.js +1 -1
  40. package/utils/find-free-port.js +1 -1
  41. package/utils/fs-extra.js +1 -1
  42. package/utils/generate-pages-map.js +1 -1
  43. package/utils/get-app-info.js +1 -1
  44. package/utils/get-current-project.js +1 -1
  45. package/utils/get-ip.js +1 -1
  46. package/utils/log.js +1 -1
  47. package/utils/node-blob.js +1 -1
  48. package/utils/resumable.d.js +1 -1
  49. package/utils/resumable.js +1 -1
  50. package/utils/spinner.js +1 -1
  51. package/utils/tunnel.js +1 -1
  52. package/create/templates/react/dist/generate-scripts.dev.js +0 -23
  53. package/create/templates/react-typescript/dist/generate-scripts.dev.js +0 -23
  54. package/deploy/utils/dist/request-upload.dev.js +0 -62
  55. package/deploy/utils/dist/upload-app.dev.js +0 -113
  56. package/login/utils/dist/zalo-login.dev.js +0 -41
package/utils/spinner.js CHANGED
@@ -1 +1 @@
1
- 'use strict';const _0x116b5b=_0x5c96;(function(_0x2eb063,_0xfef5df){const _0x67ab9b=_0x5c96,_0x171659=_0x2eb063();while(!![]){try{const _0x5ae6a2=-parseInt(_0x67ab9b(0x1e1))/0x1*(-parseInt(_0x67ab9b(0x1dd))/0x2)+parseInt(_0x67ab9b(0x1e2))/0x3+parseInt(_0x67ab9b(0x1e9))/0x4+-parseInt(_0x67ab9b(0x1df))/0x5+parseInt(_0x67ab9b(0x1e5))/0x6+parseInt(_0x67ab9b(0x1e6))/0x7+-parseInt(_0x67ab9b(0x1e7))/0x8;if(_0x5ae6a2===_0xfef5df)break;else _0x171659['push'](_0x171659['shift']());}catch(_0x5529f6){_0x171659['push'](_0x171659['shift']());}}}(_0x8054,0x6f68c));function _0x8054(){const _0x3cec38=['exports','163XfcWLG','999885TPvNpA','green','ora','1261998BQmIGc','1008434Aejalg','8364048WoUtQm','text','2637012tDTcve','done','instance','5744XggQZt','fail','1566205FxYTlp'];_0x8054=function(){return _0x3cec38;};return _0x8054();}const n=require(_0x116b5b(0x1e4)),e={'instance':null,'start'(_0xd46483){const _0x4b4272=_0x116b5b;e[_0x4b4272(0x1dc)]=n({'color':_0x4b4272(0x1e3),'text':_0xd46483})['start']();},'done'(_0x5e53bf){const _0x5d46e1=_0x116b5b;e[_0x5d46e1(0x1dc)]&&e['instance']['succeed'](_0x5e53bf);},'end'(..._0x451daf){const _0x210e14=_0x116b5b;e[_0x210e14(0x1ea)](..._0x451daf);},'fail'(_0x1cbc13){e['instance']&&e['instance']['fail'](_0x1cbc13);},'error'(_0x332a60){const _0x4a1e07=_0x116b5b;e['instance']&&e[_0x4a1e07(0x1dc)][_0x4a1e07(0x1de)](_0x332a60);},'text'(_0x347149){const _0x393467=_0x116b5b;e[_0x393467(0x1dc)]&&(e[_0x393467(0x1dc)][_0x393467(0x1e8)]=_0x347149);}};function _0x5c96(_0x12b8af,_0x4a0dba){const _0x805400=_0x8054();return _0x5c96=function(_0x5c9653,_0x70de85){_0x5c9653=_0x5c9653-0x1dc;let _0x252965=_0x805400[_0x5c9653];return _0x252965;},_0x5c96(_0x12b8af,_0x4a0dba);}module[_0x116b5b(0x1e0)]=e;
1
+ 'use strict';const _0x56eeec=_0x421f;function _0x5046(){const _0x9bde93=['4FAgzXC','succeed','120fVKoyS','661735TqIAtD','6651jSpctL','start','4145768TmtfwI','fail','60607iiFIxq','ora','3141096DPrhKf','960LjdvpM','14ZpwhDt','379839NlrUUu','done','text','exports','instance','139937zdpkuI','green'];_0x5046=function(){return _0x9bde93;};return _0x5046();}(function(_0x3c91e8,_0x243a2b){const _0x477bb9=_0x421f,_0x282ff5=_0x3c91e8();while(!![]){try{const _0x44efcd=-parseInt(_0x477bb9(0x1ee))/0x1*(-parseInt(_0x477bb9(0x1f2))/0x2)+parseInt(_0x477bb9(0x1f3))/0x3*(parseInt(_0x477bb9(0x1e6))/0x4)+parseInt(_0x477bb9(0x1e9))/0x5+-parseInt(_0x477bb9(0x1f0))/0x6+parseInt(_0x477bb9(0x1e4))/0x7*(-parseInt(_0x477bb9(0x1e8))/0x8)+parseInt(_0x477bb9(0x1ea))/0x9*(parseInt(_0x477bb9(0x1f1))/0xa)+parseInt(_0x477bb9(0x1ec))/0xb;if(_0x44efcd===_0x243a2b)break;else _0x282ff5['push'](_0x282ff5['shift']());}catch(_0x266409){_0x282ff5['push'](_0x282ff5['shift']());}}}(_0x5046,0x4b1cc));function _0x421f(_0x18282a,_0x366383){const _0x504633=_0x5046();return _0x421f=function(_0x421f8f,_0x538ee9){_0x421f8f=_0x421f8f-0x1e2;let _0x18e60a=_0x504633[_0x421f8f];return _0x18e60a;},_0x421f(_0x18282a,_0x366383);}const n=require(_0x56eeec(0x1ef)),e={'instance':null,'start'(_0x2799b8){const _0x40fa0=_0x56eeec;e[_0x40fa0(0x1e3)]=n({'color':_0x40fa0(0x1e5),'text':_0x2799b8})[_0x40fa0(0x1eb)]();},'done'(_0x5c887d){const _0x4276c3=_0x56eeec;e[_0x4276c3(0x1e3)]&&e['instance'][_0x4276c3(0x1e7)](_0x5c887d);},'end'(..._0x50c67e){const _0x432ea8=_0x56eeec;e[_0x432ea8(0x1f4)](..._0x50c67e);},'fail'(_0x21cf55){const _0x4e618f=_0x56eeec;e[_0x4e618f(0x1e3)]&&e[_0x4e618f(0x1e3)]['fail'](_0x21cf55);},'error'(_0x5f4e16){const _0x309e9e=_0x56eeec;e[_0x309e9e(0x1e3)]&&e[_0x309e9e(0x1e3)][_0x309e9e(0x1ed)](_0x5f4e16);},'text'(_0x55683b){const _0x313802=_0x56eeec;e[_0x313802(0x1e3)]&&(e[_0x313802(0x1e3)][_0x313802(0x1f5)]=_0x55683b);}};module[_0x56eeec(0x1e2)]=e;
package/utils/tunnel.js CHANGED
@@ -1 +1 @@
1
- 'use strict';const _0x5e0baf=_0x395a;function _0x43e7(){const _0x2f3a72=['173392kMxCPB','https://','reduce','url','880590EDFPze','30734724twkCFP','2038880tUBsPU','33981UGhcAp','171IQfMas','TUNNEL_SERVER_HOST','map','4416054augiCA','1157112ITryme','250lxvQhU','localtunnel','./constants','11pYFQdG','10eSuGMW','161nypyzL'];_0x43e7=function(){return _0x2f3a72;};return _0x43e7();}(function(_0xc0c07b,_0xffc0f9){const _0x11edfb=_0x395a,_0x2547fc=_0xc0c07b();while(!![]){try{const _0x4244a8=-parseInt(_0x11edfb(0x121))/0x1+parseInt(_0x11edfb(0x122))/0x2*(parseInt(_0x11edfb(0x12f))/0x3)+parseInt(_0x11edfb(0x12e))/0x4+parseInt(_0x11edfb(0x126))/0x5*(parseInt(_0x11edfb(0x133))/0x6)+parseInt(_0x11edfb(0x127))/0x7*(-parseInt(_0x11edfb(0x128))/0x8)+-parseInt(_0x11edfb(0x130))/0x9*(-parseInt(_0x11edfb(0x12c))/0xa)+parseInt(_0x11edfb(0x125))/0xb*(-parseInt(_0x11edfb(0x12d))/0xc);if(_0x4244a8===_0xffc0f9)break;else _0x2547fc['push'](_0x2547fc['shift']());}catch(_0xe33ce9){_0x2547fc['push'](_0x2547fc['shift']());}}}(_0x43e7,0xd0785));const t=require(_0x5e0baf(0x123)),{deviceModeSetup:e}=require(_0x5e0baf(0x124)),n={};async function r(_0x1d9011,_0x5edbdd){const _0xf21bac=_0x5e0baf;let _0x33a152=await t({'port':_0x1d9011,'host':_0xf21bac(0x129)+e[_0xf21bac(0x131)],'subdomain':_0x5edbdd});return n[_0x33a152['url']]=_0x33a152,_0x33a152[_0xf21bac(0x12b)];}async function s(_0x46e477){let _0x3b4dfd=n[_0x46e477];return!!_0x3b4dfd&&(_0x3b4dfd['close'](),!0x0);}function _0x395a(_0x569e53,_0x907b53){const _0x43e7f5=_0x43e7();return _0x395a=function(_0x395a08,_0x5584c8){_0x395a08=_0x395a08-0x121;let _0x162c5=_0x43e7f5[_0x395a08];return _0x162c5;},_0x395a(_0x569e53,_0x907b53);}async function u(){const _0x15e502=_0x5e0baf;return(await Promise['all'](Object['keys'](n)[_0x15e502(0x132)](_0x4debcb=>s(_0x4debcb))))[_0x15e502(0x12a)]((_0x3b10c2,_0x4cd11d)=>_0x3b10c2+(_0x4cd11d?0x1:0x0),0x0);}module['exports']={'openTunnel':r,'closeTunnel':s,'closeAllTunnels':u};
1
+ 'use strict';function _0x53a6(_0xcd527d,_0x167fbf){const _0x7c00da=_0x7c00();return _0x53a6=function(_0x53a6bf,_0x2ac05e){_0x53a6bf=_0x53a6bf-0x14f;let _0x24bba5=_0x7c00da[_0x53a6bf];return _0x24bba5;},_0x53a6(_0xcd527d,_0x167fbf);}const _0x5d66ac=_0x53a6;(function(_0x4cbe06,_0x542b2b){const _0x49ce23=_0x53a6,_0x3d7c42=_0x4cbe06();while(!![]){try{const _0x39252a=-parseInt(_0x49ce23(0x15e))/0x1+-parseInt(_0x49ce23(0x151))/0x2+parseInt(_0x49ce23(0x159))/0x3*(parseInt(_0x49ce23(0x157))/0x4)+-parseInt(_0x49ce23(0x153))/0x5*(-parseInt(_0x49ce23(0x15f))/0x6)+-parseInt(_0x49ce23(0x15c))/0x7+parseInt(_0x49ce23(0x152))/0x8*(-parseInt(_0x49ce23(0x15a))/0x9)+-parseInt(_0x49ce23(0x15d))/0xa*(-parseInt(_0x49ce23(0x156))/0xb);if(_0x39252a===_0x542b2b)break;else _0x3d7c42['push'](_0x3d7c42['shift']());}catch(_0x3d7569){_0x3d7c42['push'](_0x3d7c42['shift']());}}}(_0x7c00,0xc3902));const t=require(_0x5d66ac(0x162)),{deviceModeSetup:e}=require(_0x5d66ac(0x155)),n={};async function r(_0x5027c8,_0x74eed3){const _0x52e212=_0x5d66ac;let _0x20f117=await t({'port':_0x5027c8,'host':_0x52e212(0x160)+e['TUNNEL_SERVER_HOST'],'subdomain':_0x74eed3});return n[_0x20f117[_0x52e212(0x154)]]=_0x20f117,_0x20f117[_0x52e212(0x154)];}async function s(_0xac0d35){const _0x247c86=_0x5d66ac;let _0x58f191=n[_0xac0d35];return!!_0x58f191&&(_0x58f191[_0x247c86(0x150)](),!0x0);}async function u(){const _0x391587=_0x5d66ac;return(await Promise[_0x391587(0x158)](Object[_0x391587(0x161)](n)[_0x391587(0x14f)](_0x4542e2=>s(_0x4542e2))))[_0x391587(0x15b)]((_0x343822,_0x18b9aa)=>_0x343822+(_0x18b9aa?0x1:0x0),0x0);}module['exports']={'openTunnel':r,'closeTunnel':s,'closeAllTunnels':u};function _0x7c00(){const _0xf98365=['close','809522PlJeQc','5841272znRsQp','1229105rlHGxb','url','./constants','22ftRkwD','6616ffqHKB','all','942OGjsEN','9TFKCvO','reduce','7050897uCYiBy','14274830LzDTsH','1168568oWcmxq','18OMyBrM','https://','keys','localtunnel','map'];_0x7c00=function(){return _0xf98365;};return _0x7c00();}
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- var templateIf = require('../../utils/template-if');
4
-
5
- var indent = require('../../utils/indent');
6
-
7
- var stylesExtension = require('../../utils/styles-extension');
8
-
9
- module.exports = function (options) {
10
- var cssPreProcessor = options.cssPreProcessor,
11
- theming = options.theming,
12
- customBuild = options.customBuild,
13
- includeTailwind = options.includeTailwind;
14
- var scripts = '';
15
- scripts += indent(0, "\n // Import React and ReactDOM\n import React from 'react';\n import { createRoot } from 'react-dom/client';\n\n // Import ZMP\n import ZMP from '".concat(customBuild ? './zmp-custom.js' : 'zmp-framework/core/lite-bundle', "';\n\n // Import ZMP-React Plugin\n import ZMPReact from 'zmp-framework/react';").concat(includeTailwind ? "\n\n // Import tailwind styles\n import './css/tailwind.css';\n " : '', "\n\n // Import ZMP Styles\n ").concat(templateIf(customBuild, function () {
16
- return "\n import './css/zmp-custom.less';\n ";
17
- }, function () {
18
- return "\n import 'zmp-framework/".concat(theming.useUiKits ? 'zmp-bundle.min.css' : 'zmp.min.css', "';\n ");
19
- }), "\n\n // Import Icons and App Custom Styles\n ").concat(templateIf(theming.iconFonts, function () {
20
- return "\n import './css/icons.css';\n ";
21
- }), "\n import './css/app.").concat(stylesExtension(cssPreProcessor), "';\n\n // Import App Component\n import App from './components/app.jsx';\n import appConfig from '../app-config.json';\n\n if (!window.APP_CONFIG) {\n window.APP_CONFIG = appConfig;\n }\n\n // Init ZMP React Plugin\n ZMP.use(ZMPReact)\n\n // Mount React App\n const root = createRoot(document.getElementById('app'));\n root.render(React.createElement(App));\n "));
22
- return scripts.trim();
23
- };
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- var templateIf = require('../../utils/template-if');
4
-
5
- var indent = require('../../utils/indent');
6
-
7
- var stylesExtension = require('../../utils/styles-extension');
8
-
9
- module.exports = function (options) {
10
- var cssPreProcessor = options.cssPreProcessor,
11
- theming = options.theming,
12
- customBuild = options.customBuild,
13
- includeTailwind = options.includeTailwind;
14
- var scripts = '';
15
- scripts += indent(0, "\n // Import React and ReactDOM\n import React from 'react';\n import { createRoot } from 'react-dom/client';\n\n // Import ZMP\n import ZMP from '".concat(customBuild ? './zmp-custom.js' : 'zmp-framework/core/lite-bundle', "';\n\n // Import ZMP-React Plugin\n import ZMPReact from 'zmp-framework/react';").concat(includeTailwind ? "\n\n // Import tailwind styles\n import './css/tailwind.css';\n " : '', "\n\n // Import ZMP Styles\n ").concat(templateIf(customBuild, function () {
16
- return "\n import './css/zmp-custom.less';\n ";
17
- }, function () {
18
- return "\n import 'zmp-framework/".concat(theming.useUiKits ? 'zmp-bundle.min.css' : 'zmp.min.css', "';\n ");
19
- }), "\n\n // Import Icons and App Custom Styles\n ").concat(templateIf(theming.iconFonts, function () {
20
- return "\n import './css/icons.css';\n ";
21
- }), "\n import './css/app.").concat(stylesExtension(cssPreProcessor), "';\n\n // Import App Component\n import App from './components/app';\n import appConfig from '../app-config.json';\n\n if (!(window as any).APP_CONFIG) {\n (window as any).APP_CONFIG = appConfig\n }\n\n // Init ZMP React Plugin\n ZMP.use(ZMPReact)\n\n // Mount React App\n const root = createRoot(document.getElementById('app')!);\n root.render(React.createElement(App));\n "));
22
- return scripts.trim();
23
- };
@@ -1,62 +0,0 @@
1
- "use strict";
2
-
3
- var axios = require('axios')["default"];
4
-
5
- var config = require('../../config');
6
-
7
- var requestUpload = function requestUpload(url, appData, versionStatus, token) {
8
- var appName, appDesc, appConfig, frameworkVersions, params, headers, res, resData;
9
- return regeneratorRuntime.async(function requestUpload$(_context) {
10
- while (1) {
11
- switch (_context.prev = _context.next) {
12
- case 0:
13
- appName = appData.appName, appDesc = appData.appDesc, appConfig = appData.appConfig, frameworkVersions = appData.frameworkVersions;
14
- params = {
15
- name: appName,
16
- desc: appDesc,
17
- config: appConfig,
18
- versionStatus: versionStatus,
19
- frameworkVersions: frameworkVersions
20
- };
21
- headers = {
22
- Authorization: "Bearer ".concat(token),
23
- 'cache-control': 'no-cache'
24
- };
25
- _context.next = 5;
26
- return regeneratorRuntime.awrap(axios.get(url, {
27
- params: params,
28
- headers: headers,
29
- withCredentials: true
30
- }));
31
-
32
- case 5:
33
- res = _context.sent;
34
- resData = res.data;
35
-
36
- if (!(!resData || resData.err < 0)) {
37
- _context.next = 11;
38
- break;
39
- }
40
-
41
- if (!(resData && resData.err === config.error_code.permission_denied)) {
42
- _context.next = 10;
43
- break;
44
- }
45
-
46
- throw new Error(config.error_msg.permission_denied);
47
-
48
- case 10:
49
- throw new Error(JSON.stringify(resData));
50
-
51
- case 11:
52
- return _context.abrupt("return", resData.data);
53
-
54
- case 12:
55
- case "end":
56
- return _context.stop();
57
- }
58
- }
59
- });
60
- };
61
-
62
- module.exports = requestUpload;
@@ -1,113 +0,0 @@
1
- "use strict";
2
-
3
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
4
-
5
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6
-
7
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
-
9
- var Resumable = require('../../utils/resumable');
10
-
11
- var chalk = require('chalk');
12
-
13
- var config = require('../../config');
14
-
15
- var envUtils = require('../../utils/env');
16
-
17
- var File = require('file-api').File;
18
-
19
- var FormData = require('form-data');
20
-
21
- var _ = require('lodash');
22
-
23
- module.exports = function _callee(data, options, logger) {
24
- var apiDomain, uploadAppByChunk, apiUploadAppByChunk, appName, appDesc, appBuffer, appConfig, identifier, token, resumable, formData, i;
25
- return regeneratorRuntime.async(function _callee$(_context) {
26
- while (1) {
27
- switch (_context.prev = _context.next) {
28
- case 0:
29
- apiDomain = config.api_domain;
30
-
31
- uploadAppByChunk = function uploadAppByChunk(resumable, bufferData) {
32
- return new Promise(function (resolve, reject) {
33
- try {
34
- var file = new File({
35
- name: 'www.zip',
36
- // required
37
- buffer: bufferData
38
- });
39
- resumable.on('fileAdded', function () {
40
- resumable.upload();
41
- });
42
- resumable.on('complete', function () {
43
- return resolve();
44
- });
45
- resumable.on('fileError', function (file, message) {
46
- return reject(new Error("Error upload app: ".concat(message)));
47
- });
48
- resumable.on('cancel', function () {
49
- return reject(new Error('Error upload app: cancel'));
50
- });
51
- resumable.on('fileSuccess', function (file, message) {
52
- var resData = JSON.parse(message);
53
-
54
- if (_.isNumber(resData.err) && resData.err < 0) {
55
- return reject(new Error("Error upload app: ".concat(message)));
56
- }
57
-
58
- return resolve(resData);
59
- });
60
- resumable.addFile(file);
61
- } catch (error) {
62
- return reject(error);
63
- }
64
- });
65
- };
66
-
67
- apiUploadAppByChunk = "".concat(apiDomain).concat(config.path.uploadAppByChunk);
68
- appName = data.appName, appDesc = data.appDesc, appBuffer = data.appBuffer, appConfig = data.appConfig, identifier = data.identifier;
69
- token = envUtils.getEnv(config.env.token);
70
- resumable = new Resumable(_objectSpread({}, config.resumable_option, {
71
- target: apiUploadAppByChunk,
72
- headers: {
73
- Authorization: "Bearer ".concat(token)
74
- },
75
- generateUniqueIdentifier: function generateUniqueIdentifier() {
76
- return identifier;
77
- }
78
- }));
79
- formData = new FormData();
80
- formData.append('zipFile', appBuffer);
81
- formData.append('name', appName);
82
- formData.append('desc', appDesc);
83
- formData.append('config', appConfig); // Resumable.js isn't supported!
84
-
85
- if (resumable.support) {
86
- _context.next = 15;
87
- break;
88
- }
89
-
90
- logger.statusError('Does not support upload app');
91
- _context.next = 20;
92
- break;
93
-
94
- case 15:
95
- i = 0;
96
- resumable.on('fileProgress', function (file) {
97
- i = Math.round(file.progress() * 100) % (100 + 1);
98
- var chunks = new Array(i + 1).join('|');
99
- logger.statusText("Deploying Your App ".concat(chalk.gray('\n' + chunks + ' ' + Math.round(file.progress() * 100) + '%')));
100
- });
101
- _context.next = 19;
102
- return regeneratorRuntime.awrap(uploadAppByChunk(resumable, appBuffer));
103
-
104
- case 19:
105
- return _context.abrupt("return", _context.sent);
106
-
107
- case 20:
108
- case "end":
109
- return _context.stop();
110
- }
111
- }
112
- });
113
- };
@@ -1,41 +0,0 @@
1
- "use strict";
2
-
3
- var axios = require('axios');
4
-
5
- var envUtils = require('../../utils/env');
6
-
7
- var config = require('../../config');
8
-
9
- var env = envUtils.getEnv('NODE_ENV') || 'production';
10
-
11
- module.exports = function () {
12
- var apiRequestLogin = "".concat(config.api_domain).concat(config.path.requestLogin);
13
- var apiCheckStatusLogin = "".concat(config.api_domain).concat(config.path.checkLoginStatus);
14
-
15
- var getQRCode = function getQRCode(appId) {
16
- return axios({
17
- method: 'get',
18
- url: "".concat(apiRequestLogin, "?appId=").concat(appId),
19
- headers: {
20
- 'cache-control': 'no-cache'
21
- },
22
- withCredentials: true
23
- });
24
- };
25
-
26
- var checkStatus = function checkStatus(zmpsk) {
27
- return axios({
28
- method: 'get',
29
- url: "".concat(apiCheckStatusLogin, "?zmpsk=").concat(zmpsk),
30
- headers: {
31
- 'cache-control': 'no-cache'
32
- },
33
- withCredentials: true
34
- });
35
- };
36
-
37
- return {
38
- getQRCode: getQRCode,
39
- checkStatus: checkStatus
40
- };
41
- }();