jd-minigame-ci 0.1.8 → 0.2.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/README.md CHANGED
@@ -4,14 +4,13 @@
4
4
 
5
5
  jd-minigame-ci 是为京东小游戏开发者提供的工具包。开发者无需打开开发者工具,使用工具包即可完成小程序代码的上传、预览等操作。
6
6
 
7
-
8
-
9
7
  ## 上传秘钥
10
8
 
11
9
  使用工具包之前,请访问“[京东小程序控制台](https://mp-console.jd.com/)—设置—开发设置—小游戏代码上传秘钥”获取上传秘钥。
12
10
 
13
- ![alt 京东小程序秘钥生成](https://storage.360buyimg.com/ide-update/images/upload_key.png
14
- )
11
+ 需要注意的是,获取上传密钥权限目前仅小游戏管理员可以获取。
12
+
13
+ ![alt 京东小程序秘钥生成](https://storage.360buyimg.com/ide-update/images/game_cli.png)
15
14
 
16
15
  ## 功能
17
16
 
@@ -30,21 +29,20 @@ npm install -g jd-minigame-ci
30
29
  为确保使用最新功能和安全更新,如果检测到您的本地npm包版本落后于仓库中的最新版本,建议首先卸载本地包,随后安装最新版本。
31
30
 
32
31
  通过以下命令可获取本地京东小游戏CLI工具版本:
33
-
34
- ```shell
32
+ ```Shell
35
33
  jgc -v
36
34
  jgc -V
37
- jgc --version
38
35
  ```
39
36
  以上命令均可获取本地京东小游戏CLI工具版本。
40
37
 
41
38
  也可以通过以下命令行:
42
39
 
43
- ```shell
40
+ ```Shell
44
41
  jgc latest
45
42
  ```
46
43
  以上命令将拉取京东小游戏CLI工具在npm官方仓库最新版本,并与本地版本进行对比,提示版本对比信息。
47
44
 
45
+
48
46
  ## 命令行调用
49
47
 
50
48
  ### 创建小游戏配置文件
@@ -75,8 +73,7 @@ jgc preview
75
73
  ```
76
74
  执行完上述命令后,如果一切正常,会在Termina出现二维码,
77
75
 
78
- ![alt 预览二维码](https://storage.360buyimg.com/ide-update/images/WX20240227-184741.png
79
- )
76
+ ![alt 预览二维码](https://storage.360buyimg.com/ide-update/images/jgc_preview.png)
80
77
 
81
78
  ### 上传功能
82
79
 
@@ -87,9 +84,15 @@ jgc preview
87
84
  ```Shell
88
85
  jgc upload
89
86
  ```
90
- ![alt 体验版二维码](https://storage.360buyimg.com/ide-update/images/upload.png
91
- )
87
+ ![alt 体验版二维码](https://storage.360buyimg.com/ide-update/images/jgc_upload.png)
92
88
 
89
+ ## 客户端调试
90
+ 在非线上小游戏,iOS/Android均支持打开调试模式,支持vConsole查看调试日志。
91
+
92
+ ![alt 开启调试](https://storage.360buyimg.com/ide-update/images/jgc_vconsole.png)
93
+
94
+ ![alt 调试](https://storage.360buyimg.com/ide-update/images/game_vconsole.jpg
95
+ )
93
96
 
94
97
  ## 脚本调用
95
98
 
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- !function(t,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var e=r();for(var n in e)("object"==typeof exports?exports:t)[n]=e[n]}}(global,(()=>{return t={538:(t,r,e)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return r};var t,r={},e=Object.prototype,i=e.hasOwnProperty,a=Object.defineProperty||function(t,r,e){t[r]=e.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function p(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{p({},"")}catch(t){p=function(t,r,e){return t[r]=e}}function l(t,r,e,n){var o=r&&r.prototype instanceof w?r:w,i=Object.create(o.prototype),c=new N(n||[]);return a(i,"_invoke",{value:S(t,e,c)}),i}function h(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}r.wrap=l;var y="suspendedStart",v="suspendedYield",d="executing",g="completed",m={};function w(){}function b(){}function x(){}var k={};p(k,u,(function(){return this}));var L=Object.getPrototypeOf,E=L&&L(L(q([])));E&&E!==e&&i.call(E,u)&&(k=E);var O=x.prototype=w.prototype=Object.create(k);function j(t){["next","throw","return"].forEach((function(r){p(t,r,(function(t){return this._invoke(r,t)}))}))}function _(t,r){function e(o,a,c,u){var s=h(t[o],t,a);if("throw"!==s.type){var f=s.arg,p=f.value;return p&&"object"==n(p)&&i.call(p,"__await")?r.resolve(p.__await).then((function(t){e("next",t,c,u)}),(function(t){e("throw",t,c,u)})):r.resolve(p).then((function(t){f.value=t,c(f)}),(function(t){return e("throw",t,c,u)}))}u(s.arg)}var o;a(this,"_invoke",{value:function(t,n){function i(){return new r((function(r,o){e(t,n,r,o)}))}return o=o?o.then(i,i):i()}})}function S(r,e,n){var o=y;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=h(r,e,n);if("normal"===s.type){if(o=n.done?g:v,s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=g,n.method="throw",n.arg=s.arg)}}}function P(r,e){var n=e.method,o=r.iterator[n];if(o===t)return e.delegate=null,"throw"===n&&r.iterator.return&&(e.method="return",e.arg=t,P(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(o,r.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;var a=i.arg;return a?a.done?(e[r.resultName]=a.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,m):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function T(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function I(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function q(r){if(r||""===r){var e=r[u];if(e)return e.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function e(){for(;++o<r.length;)if(i.call(r,o))return e.value=r[o],e.done=!1,e;return e.value=t,e.done=!0,e};return a.next=a}}throw new TypeError(n(r)+" is not iterable")}return b.prototype=x,a(O,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=p(x,f,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===b||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,p(t,f,"GeneratorFunction")),t.prototype=Object.create(O),t},r.awrap=function(t){return{__await:t}},j(_.prototype),p(_.prototype,s,(function(){return this})),r.AsyncIterator=_,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new _(l(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(O),p(O,f,"Generator"),p(O,u,(function(){return this})),p(O,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=q,N.prototype={constructor:N,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!r)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function n(n,o){return c.type="throw",c.arg=r,e.next=n,o&&(e.method="next",e.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=r,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),m},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),I(e),m}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;I(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:q(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),m}},r}function i(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void e(t)}c.done?r(u):Promise.resolve(u).then(n,o)}var a=e(652),c=e(928),u=e(172),s=e(410).globSync;function f(t){try{if(a.pathExistsSync(t))return!0;if(f(c.dirname(t)))return a.mkdirsSync(t),!0}catch(t){console.log("make dir error,",t)}}r.writeFile=function(){var t,r=(t=o().mark((function t(r,e){var n,i=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=i.length>2&&void 0!==i[2]?i[2]:"utf8",f(c.posix.parse(r).dir)&&a.writeFileSync(r,e,n);case 4:case"end":return t.stop()}}),t)})),function(){var r=this,e=arguments;return new Promise((function(n,o){var a=t.apply(r,e);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))});return function(t,e){return r.apply(this,arguments)}}(),r.hasGameJsonFile=function(t){return a.pathExistsSync(t)?s("game.json",{cwd:t,ignore:"node_modules/**"}).length>0:console.log("当前入口文件目录不存在!")},r.hasJgcConfigFile=function(t){try{return a.accessSync(t,a.constants.F_OK),!0}catch(t){return console.log("文件不存在"),!1}},r.compressDirectory=function(t,r){return new Promise((function(e,n){var o=a.createWriteStream(r),i=u("zip",{zlib:{level:9}});o.on("close",(function(){return e(i.pointer())})),i.on("warning",(function(t){return"ENOENT"!==t.code&&n(t)})),i.on("error",n),i.pipe(o),i.glob("**/*",{cwd:t}),i.finalize()}))},r.deleteFile=function(t){a.existsSync(t)&&a.unlink(t,(function(t){t&&console.log("删除zip文件失败: ",t)}))}},954:(t,r,e)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return r};var t,r={},e=Object.prototype,i=e.hasOwnProperty,a=Object.defineProperty||function(t,r,e){t[r]=e.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function p(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{p({},"")}catch(t){p=function(t,r,e){return t[r]=e}}function l(t,r,e,n){var o=r&&r.prototype instanceof w?r:w,i=Object.create(o.prototype),c=new N(n||[]);return a(i,"_invoke",{value:S(t,e,c)}),i}function h(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}r.wrap=l;var y="suspendedStart",v="suspendedYield",d="executing",g="completed",m={};function w(){}function b(){}function x(){}var k={};p(k,u,(function(){return this}));var L=Object.getPrototypeOf,E=L&&L(L(q([])));E&&E!==e&&i.call(E,u)&&(k=E);var O=x.prototype=w.prototype=Object.create(k);function j(t){["next","throw","return"].forEach((function(r){p(t,r,(function(t){return this._invoke(r,t)}))}))}function _(t,r){function e(o,a,c,u){var s=h(t[o],t,a);if("throw"!==s.type){var f=s.arg,p=f.value;return p&&"object"==n(p)&&i.call(p,"__await")?r.resolve(p.__await).then((function(t){e("next",t,c,u)}),(function(t){e("throw",t,c,u)})):r.resolve(p).then((function(t){f.value=t,c(f)}),(function(t){return e("throw",t,c,u)}))}u(s.arg)}var o;a(this,"_invoke",{value:function(t,n){function i(){return new r((function(r,o){e(t,n,r,o)}))}return o=o?o.then(i,i):i()}})}function S(r,e,n){var o=y;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=h(r,e,n);if("normal"===s.type){if(o=n.done?g:v,s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=g,n.method="throw",n.arg=s.arg)}}}function P(r,e){var n=e.method,o=r.iterator[n];if(o===t)return e.delegate=null,"throw"===n&&r.iterator.return&&(e.method="return",e.arg=t,P(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(o,r.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;var a=i.arg;return a?a.done?(e[r.resultName]=a.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,m):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function T(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function I(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function q(r){if(r||""===r){var e=r[u];if(e)return e.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function e(){for(;++o<r.length;)if(i.call(r,o))return e.value=r[o],e.done=!1,e;return e.value=t,e.done=!0,e};return a.next=a}}throw new TypeError(n(r)+" is not iterable")}return b.prototype=x,a(O,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=p(x,f,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===b||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,p(t,f,"GeneratorFunction")),t.prototype=Object.create(O),t},r.awrap=function(t){return{__await:t}},j(_.prototype),p(_.prototype,s,(function(){return this})),r.AsyncIterator=_,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new _(l(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(O),p(O,f,"Generator"),p(O,u,(function(){return this})),p(O,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=q,N.prototype={constructor:N,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!r)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function n(n,o){return c.type="throw",c.arg=r,e.next=n,o&&(e.method="next",e.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=r,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),m},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),I(e),m}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;I(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:q(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),m}},r}function i(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void e(t)}c.done?r(u):Promise.resolve(u).then(n,o)}var a=e(928),c=e(857),u=e(538),s=e(60),f=e(425),p=-1;function l(t,r){return h.apply(this,arguments)}function h(){var t;return t=o().mark((function t(r,e){var n,i,l,h,y,v,d,g,m,w,b,x,k;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s.checkConfigOptions(r,e)){t.next=3;break}throw{code:p,errMsg:"配置参数验证失败"};case 3:if(n=r.appId,i=r.requestToken,l=r.entry,h=r.versionName||"1.0.0",y=r.description||" ",u.hasGameJsonFile(l)){t.next=9;break}throw{code:p,errMsg:"".concat(l,"目录不存在 game.json")};case 9:return v=a.join(c.tmpdir(),"jd_game_temp.zip"),t.prev=10,u.deleteFile(v),t.next=14,u.compressDirectory(l,v);case 14:t.next=19;break;case 16:throw t.prev=16,t.t0=t.catch(10),new Error("压缩失效:",t.t0);case 19:return t.next=21,f.uploadProject({sourceFile:v,appId:n,requestToken:i});case 21:if(d=t.sent,1!==e){t.next=31;break}return t.next=25,f.generateQrCode({packId:d,appId:n,requestToken:i});case 25:return g=t.sent,m=g.imgUrl,w=g.expiredTime,t.abrupt("return",{url:m,expiredTime:w});case 31:if(2!==e){t.next=38;break}return t.next=34,f.setDevPackage({appId:n,requestToken:i,versionName:h,entry:l,description:y},d);case 34:return b=t.sent,x=b.imgUrl,k=b.expiredTime,t.abrupt("return",{url:x,expiredTime:k});case 38:case"end":return t.stop()}}),t,null,[[10,16]])})),h=function(){var r=this,e=arguments;return new Promise((function(n,o){var a=t.apply(r,e);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))},h.apply(this,arguments)}t.exports={preview:function(t){return l(t,1)},upload:function(t){return l(t,2)}}},425:(t,r,e)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function i(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?o(Object(e),!0).forEach((function(r){a(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):o(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}function a(t,r,e){var o;return o=function(t,r){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var o=e.call(t,r||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(r,"string"),(r="symbol"==n(o)?o:o+"")in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function c(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */c=function(){return r};var t,r={},e=Object.prototype,o=e.hasOwnProperty,i=Object.defineProperty||function(t,r,e){t[r]=e.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function p(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{p({},"")}catch(t){p=function(t,r,e){return t[r]=e}}function l(t,r,e,n){var o=r&&r.prototype instanceof w?r:w,a=Object.create(o.prototype),c=new N(n||[]);return i(a,"_invoke",{value:S(t,e,c)}),a}function h(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}r.wrap=l;var y="suspendedStart",v="suspendedYield",d="executing",g="completed",m={};function w(){}function b(){}function x(){}var k={};p(k,u,(function(){return this}));var L=Object.getPrototypeOf,E=L&&L(L(q([])));E&&E!==e&&o.call(E,u)&&(k=E);var O=x.prototype=w.prototype=Object.create(k);function j(t){["next","throw","return"].forEach((function(r){p(t,r,(function(t){return this._invoke(r,t)}))}))}function _(t,r){function e(i,a,c,u){var s=h(t[i],t,a);if("throw"!==s.type){var f=s.arg,p=f.value;return p&&"object"==n(p)&&o.call(p,"__await")?r.resolve(p.__await).then((function(t){e("next",t,c,u)}),(function(t){e("throw",t,c,u)})):r.resolve(p).then((function(t){f.value=t,c(f)}),(function(t){return e("throw",t,c,u)}))}u(s.arg)}var a;i(this,"_invoke",{value:function(t,n){function o(){return new r((function(r,o){e(t,n,r,o)}))}return a=a?a.then(o,o):o()}})}function S(r,e,n){var o=y;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=h(r,e,n);if("normal"===s.type){if(o=n.done?g:v,s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=g,n.method="throw",n.arg=s.arg)}}}function P(r,e){var n=e.method,o=r.iterator[n];if(o===t)return e.delegate=null,"throw"===n&&r.iterator.return&&(e.method="return",e.arg=t,P(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(o,r.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;var a=i.arg;return a?a.done?(e[r.resultName]=a.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,m):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function T(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function I(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function q(r){if(r||""===r){var e=r[u];if(e)return e.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var i=-1,a=function e(){for(;++i<r.length;)if(o.call(r,i))return e.value=r[i],e.done=!1,e;return e.value=t,e.done=!0,e};return a.next=a}}throw new TypeError(n(r)+" is not iterable")}return b.prototype=x,i(O,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:b,configurable:!0}),b.displayName=p(x,f,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===b||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,p(t,f,"GeneratorFunction")),t.prototype=Object.create(O),t},r.awrap=function(t){return{__await:t}},j(_.prototype),p(_.prototype,s,(function(){return this})),r.AsyncIterator=_,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new _(l(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(O),p(O,f,"Generator"),p(O,u,(function(){return this})),p(O,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=q,N.prototype={constructor:N,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!r)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function n(n,o){return c.type="throw",c.arg=r,e.next=n,o&&(e.method="next",e.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),s=o.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),m},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),I(e),m}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;I(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:q(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),m}},r}function u(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void e(t)}c.done?r(u):Promise.resolve(u).then(n,o)}function s(t){return function(){var r=this,e=arguments;return new Promise((function(n,o){var i=t.apply(r,e);function a(t){u(i,n,o,a,c,"next",t)}function c(t){u(i,n,o,a,c,"throw",t)}a(void 0)}))}}var f=e(938),p=e(305),l=e(652),h="https://vapp-ide-pack.jd.com";function y(){return(y=s(c().mark((function t(r){var e,n;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,g(r);case 3:if(0===(e=t.sent).code){t.next=6;break}return t.abrupt("return",N(e));case 6:return t.next=8,w(r,e.result);case 8:if(0===(n=t.sent).code){t.next=11;break}return t.abrupt("return",N(n));case 11:return t.abrupt("return",{code:0,packId:n.packId});case 14:return t.prev=14,t.t0=t.catch(0),t.abrupt("return",{code:-2,error_msg:"上传失败!"});case 17:case"end":return t.stop()}}),t,null,[[0,14]])})))).apply(this,arguments)}function v(t,r){return d.apply(this,arguments)}function d(){return d=s(c().mark((function t(r,e){var n,o,a,u,s,l,h,y=arguments;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(a in n=y.length>2&&void 0!==y[2]?y[2]:"请求失败",o=new p,e)o.append(a,e[a]);return t.prev=3,t.next=6,f.post(r,o,{headers:i({},o.getHeaders())});case 6:if(0!==(u=t.sent).data.code){t.next=9;break}return t.abrupt("return",u.data);case 9:return t.abrupt("return",{code:-1,error_msg:"".concat(n,": ").concat(u.data.errorMessage)});case 12:return t.prev=12,t.t0=t.catch(3),s=t.t0.response.data,l=s.status,h=s.path,t.abrupt("return",{code:-2,error_msg:"".concat(n," -> ").concat(h," status is ").concat(l)});case 16:case"end":return t.stop()}}),t,null,[[3,12]])}))),d.apply(this,arguments)}function g(t){return m.apply(this,arguments)}function m(){return(m=s(c().mark((function t(r){var e,n,o,i,a;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.sourceFile,n=r.appId,o=r.requestToken,i="".concat(h,"/v1/devops/pack"),a={appId:n,requestToken:o,sourceFile:l.createReadStream(e)},t.abrupt("return",v(i,a,"文件上传报错"));case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function w(t,r){return b.apply(this,arguments)}function b(){return(b=s(c().mark((function t(r,e){var n,o,i,a;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=Date.now(),o=6e5,i=3e3;case 3:if(!(Date.now()-n<o)){t.next=17;break}return t.next=6,new Promise((function(t){return setTimeout(t,i)}));case 6:return t.next=8,x(r,e);case 8:if(0!==(a=t.sent).code||!a.result){t.next=13;break}return t.abrupt("return",{code:0,packId:a.result});case 13:if(0===a.code){t.next=15;break}return t.abrupt("return",{code:a.code,error_msg:a.error_msg});case 15:t.next=3;break;case 17:return t.abrupt("return",{code:-1,error_msg:"查询超时"});case 18:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function x(t,r){return k.apply(this,arguments)}function k(){return(k=s(c().mark((function t(r,e){var n,o,i;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.appId,o=r.requestToken,i={appId:n,requestToken:o,uuid:e},t.abrupt("return",v("".concat(h,"/v1/ci/queryPackIdByUuid"),i,"获取构建包id失效"));case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function L(){return(L=s(c().mark((function t(r){var e,n,o,i,a,u;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.appId,n=r.requestToken,o=r.packId,i={appId:e,requestToken:n,packId:o},t.next=4,v("".concat(h,"/v1/ci/queryQrcodeByPackId"),i,"获取二维码失效");case 4:if(0===(a=t.sent).code){t.next=7;break}return t.abrupt("return",{code:a.code,error_msg:a.error_msg});case 7:return(u=new Date).setMinutes(u.getMinutes()+25),t.abrupt("return",{code:0,imgUrl:a.result,expiredTime:"".concat(E(u.getHours()),":").concat(E(u.getMinutes()))});case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function E(t){return String(t).length<2?"0".concat(String(t)):String(t)}function O(){return(O=s(c().mark((function t(r,e){var n,o;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,j(r,e);case 2:return n=t.sent,t.next=5,S(r,n);case 5:return t.next=7,T(r);case 7:return o=t.sent,t.abrupt("return",o);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function j(t,r){return _.apply(this,arguments)}function _(){return(_=s(c().mark((function t(r,e){var n,o,i,a,u;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.appId,o=r.requestToken,i=r.versionName,a=r.description,u={packId:e,appId:n,requestToken:o,versionName:i,description:a},t.next=4,v("".concat(h,"/v1/ci/commitDevVersion"),u,"设置为开发版失效");case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function S(t,r){return P.apply(this,arguments)}function P(){return(P=s(c().mark((function t(r,e){var n,o,i;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.appId,o=r.requestToken,i={appId:n,requestToken:o,devId:e},t.next=4,v("".concat(h,"/v1/ci/devExperience"),i,"设置为体验版失效");case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function T(t){return I.apply(this,arguments)}function I(){return(I=s(c().mark((function t(r){var e,n,o,i,a,u;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.appId,n=r.requestToken,o={appId:e,requestToken:n},t.next=4,v("".concat(h,"/v1/ci/queryExperienceQrcode"),o,"获取体验二维码失效");case 4:return i=t.sent,a=i.result,(u=new Date).setMinutes(u.getMinutes()+25),t.abrupt("return",{imgUrl:a,expiredTime:"".concat(E(u.getHours()),":").concat(E(u.getMinutes()))});case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function N(t){return{code:t.code,error_msg:t.error_msg}}t.exports={uploadProject:function(t){return y.apply(this,arguments)},generateQrCode:function(t){return L.apply(this,arguments)},setDevPackage:function(t,r){return O.apply(this,arguments)},commitDevVersion:j,setDevExperience:S,queryExperienceQrcodeByPackId:T}},60:(t,r)=>{r.checkConfigOptions=function(t,r){var e=t||{},n=e.appId,o=e.requestToken;return entry=e.entry,[n,o,entry].every((function(t){return function(t){return"string"==typeof t&&!!t.trim()}(t)}))}},172:t=>{"use strict";t.exports=require("archiver")},938:t=>{"use strict";t.exports=require("axios")},305:t=>{"use strict";t.exports=require("form-data")},652:t=>{"use strict";t.exports=require("fs-extra")},410:t=>{"use strict";t.exports=require("glob")},857:t=>{"use strict";t.exports=require("os")},928:t=>{"use strict";t.exports=require("path")}},r={},function e(n){var o=r[n];if(void 0!==o)return o.exports;var i=r[n]={exports:{}};return t[n](i,i.exports,e),i.exports}(954);var t,r}));
2
+ !function(t,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var e=r();for(var n in e)("object"==typeof exports?exports:t)[n]=e[n]}}(global,(()=>{return t={85:t=>{t.exports={FAIL_CODE:-1,SUCCEED_CODE:0}},538:(t,r,e)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return r};var t,r={},e=Object.prototype,i=e.hasOwnProperty,a=Object.defineProperty||function(t,r,e){t[r]=e.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function l(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{l({},"")}catch(t){l=function(t,r,e){return t[r]=e}}function p(t,r,e,n){var o=r&&r.prototype instanceof b?r:b,i=Object.create(o.prototype),c=new q(n||[]);return a(i,"_invoke",{value:S(t,e,c)}),i}function h(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var y="suspendedStart",d="suspendedYield",v="executing",m="completed",g={};function b(){}function w(){}function x(){}var k={};l(k,u,(function(){return this}));var E=Object.getPrototypeOf,L=E&&E(E(N([])));L&&L!==e&&i.call(L,u)&&(k=L);var _=x.prototype=b.prototype=Object.create(k);function O(t){["next","throw","return"].forEach((function(r){l(t,r,(function(t){return this._invoke(r,t)}))}))}function j(t,r){function e(o,a,c,u){var s=h(t[o],t,a);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==n(l)&&i.call(l,"__await")?r.resolve(l.__await).then((function(t){e("next",t,c,u)}),(function(t){e("throw",t,c,u)})):r.resolve(l).then((function(t){f.value=t,c(f)}),(function(t){return e("throw",t,c,u)}))}u(s.arg)}var o;a(this,"_invoke",{value:function(t,n){function i(){return new r((function(r,o){e(t,n,r,o)}))}return o=o?o.then(i,i):i()}})}function S(r,e,n){var o=y;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=T(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var s=h(r,e,n);if("normal"===s.type){if(o=n.done?m:d,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=m,n.method="throw",n.arg=s.arg)}}}function T(r,e){var n=e.method,o=r.iterator[n];if(o===t)return e.delegate=null,"throw"===n&&r.iterator.return&&(e.method="return",e.arg=t,T(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=h(o,r.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var a=i.arg;return a?a.done?(e[r.resultName]=a.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,g):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function I(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function P(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function q(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function N(r){if(r||""===r){var e=r[u];if(e)return e.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function e(){for(;++o<r.length;)if(i.call(r,o))return e.value=r[o],e.done=!1,e;return e.value=t,e.done=!0,e};return a.next=a}}throw new TypeError(n(r)+" is not iterable")}return w.prototype=x,a(_,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=l(x,f,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===w||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,l(t,f,"GeneratorFunction")),t.prototype=Object.create(_),t},r.awrap=function(t){return{__await:t}},O(j.prototype),l(j.prototype,s,(function(){return this})),r.AsyncIterator=j,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new j(p(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(_),l(_,f,"Generator"),l(_,u,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=N,q.prototype={constructor:q,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!r)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function n(n,o){return c.type="throw",c.arg=r,e.next=n,o&&(e.method="next",e.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=r,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),g},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),P(e),g}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;P(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:N(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),g}},r}function i(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void e(t)}c.done?r(u):Promise.resolve(u).then(n,o)}var a=e(652),c=e(928),u=e(172),s=e(410).globSync;function f(t){try{if(a.pathExistsSync(t))return!0;if(f(c.dirname(t)))return a.mkdirsSync(t),!0}catch(t){console.log("make dir error,",t)}}r.writeFile=function(){var t,r=(t=o().mark((function t(r,e){var n,i=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=i.length>2&&void 0!==i[2]?i[2]:"utf8",f(c.posix.parse(r).dir)&&a.writeFileSync(r,e,n);case 4:case"end":return t.stop()}}),t)})),function(){var r=this,e=arguments;return new Promise((function(n,o){var a=t.apply(r,e);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))});return function(t,e){return r.apply(this,arguments)}}(),r.verifyGameRequiredFilesExist=function(t){if(!a.pathExistsSync(t))return{code:-1,err_msg:"当前入口文件目录不存在!"};var r=s("game.json",{cwd:t,ignore:"node_modules/**"}),e=s("game.js",{cwd:t,ignore:"node_modules/**"});return 0===r.length?{code:-1,err_msg:"被打包的游戏的目录下不存在game.json!"}:0===e.length?{code:-1,err_msg:"被打包的游戏的目录下不存在game.js!"}:{code:0,err_msg:"ok"}},r.hasJgcConfigFile=function(t){try{return a.accessSync(t,a.constants.F_OK),!0}catch(t){return console.log("文件不存在"),!1}},r.compressDirectory=function(t,r){return new Promise((function(e,n){var o=a.createWriteStream(r),i=u("zip",{zlib:{level:9}});o.on("close",(function(){return e(i.pointer())})),i.on("warning",(function(t){return"ENOENT"!==t.code&&n(t)})),i.on("error",n),i.pipe(o),i.glob("**/*",{cwd:t,ignore:["**/.*","**/*.js.map"]}),i.finalize()}))},r.deleteFile=function(t){a.existsSync(t)&&a.unlink(t,(function(t){t&&console.log("删除zip文件失败: ",t)}))}},954:(t,r,e)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return r};var t,r={},e=Object.prototype,i=e.hasOwnProperty,a=Object.defineProperty||function(t,r,e){t[r]=e.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function l(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{l({},"")}catch(t){l=function(t,r,e){return t[r]=e}}function p(t,r,e,n){var o=r&&r.prototype instanceof b?r:b,i=Object.create(o.prototype),c=new q(n||[]);return a(i,"_invoke",{value:S(t,e,c)}),i}function h(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var y="suspendedStart",d="suspendedYield",v="executing",m="completed",g={};function b(){}function w(){}function x(){}var k={};l(k,u,(function(){return this}));var E=Object.getPrototypeOf,L=E&&E(E(N([])));L&&L!==e&&i.call(L,u)&&(k=L);var _=x.prototype=b.prototype=Object.create(k);function O(t){["next","throw","return"].forEach((function(r){l(t,r,(function(t){return this._invoke(r,t)}))}))}function j(t,r){function e(o,a,c,u){var s=h(t[o],t,a);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==n(l)&&i.call(l,"__await")?r.resolve(l.__await).then((function(t){e("next",t,c,u)}),(function(t){e("throw",t,c,u)})):r.resolve(l).then((function(t){f.value=t,c(f)}),(function(t){return e("throw",t,c,u)}))}u(s.arg)}var o;a(this,"_invoke",{value:function(t,n){function i(){return new r((function(r,o){e(t,n,r,o)}))}return o=o?o.then(i,i):i()}})}function S(r,e,n){var o=y;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=T(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var s=h(r,e,n);if("normal"===s.type){if(o=n.done?m:d,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=m,n.method="throw",n.arg=s.arg)}}}function T(r,e){var n=e.method,o=r.iterator[n];if(o===t)return e.delegate=null,"throw"===n&&r.iterator.return&&(e.method="return",e.arg=t,T(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=h(o,r.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var a=i.arg;return a?a.done?(e[r.resultName]=a.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,g):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function I(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function P(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function q(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function N(r){if(r||""===r){var e=r[u];if(e)return e.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function e(){for(;++o<r.length;)if(i.call(r,o))return e.value=r[o],e.done=!1,e;return e.value=t,e.done=!0,e};return a.next=a}}throw new TypeError(n(r)+" is not iterable")}return w.prototype=x,a(_,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=l(x,f,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===w||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,l(t,f,"GeneratorFunction")),t.prototype=Object.create(_),t},r.awrap=function(t){return{__await:t}},O(j.prototype),l(j.prototype,s,(function(){return this})),r.AsyncIterator=j,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new j(p(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(_),l(_,f,"Generator"),l(_,u,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=N,q.prototype={constructor:q,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!r)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function n(n,o){return c.type="throw",c.arg=r,e.next=n,o&&(e.method="next",e.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=r,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),g},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),P(e),g}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;P(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:N(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),g}},r}function i(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void e(t)}c.done?r(u):Promise.resolve(u).then(n,o)}var a=e(928),c=e(857),u=e(538),s=e(60),f=e(425),l=e(85).SUCCEED_CODE;function p(t,r){return h.apply(this,arguments)}function h(){var t;return t=o().mark((function t(r,e){var n,i,p,h,y,d,v,m,g,b,w,x,k,E,L,_,O,j,S,T,I;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=s.checkConfigOptions(r,e),i=n.code,p=n.err_msg,0===i){t.next=4;break}return t.abrupt("return",{code:i,errMsg:p});case 4:if(h=r.appId,y=r.requestToken,d=r.entry,v=r.versionName,m=r.description,0===(g=u.verifyGameRequiredFilesExist(d)).code){t.next=8;break}return t.abrupt("return",{code:g.code,errMsg:g.err_msg});case 8:return b=a.join(c.tmpdir(),"jd_game_temp.zip"),t.prev=9,u.deleteFile(b),t.next=13,u.compressDirectory(d,b);case 13:t.next=18;break;case 15:throw t.prev=15,t.t0=t.catch(9),new Error("压缩失效:",t.t0);case 18:return t.next=20,f.uploadProject({sourceFile:b,appId:h,requestToken:y});case 20:if((w=t.sent).code===l){t.next=23;break}return t.abrupt("return",w);case 23:if(x=w.packId,1!==e){t.next=34;break}return t.next=27,f.generateQrCode({packId:x,appId:h,requestToken:y});case 27:if((k=t.sent).code===l){t.next=30;break}return t.abrupt("return",k);case 30:return E=k.imgUrl,L=k.expiredTime,t.abrupt("return",{code:l,url:E,expiredTime:L});case 34:if(2!==e){t.next=53;break}return t.next=37,f.commitDevVersion({appId:h,requestToken:y,versionName:v,description:m},x);case 37:if((_=t.sent).code===l){t.next=40;break}return t.abrupt("return",_);case 40:return O=_.devId,t.next=43,f.setDevExperience({appId:h,requestToken:y},O);case 43:if((j=t.sent).code===l){t.next=46;break}return t.abrupt("return",j);case 46:return t.next=48,f.queryExperienceQrcodeByPackId({appId:h,requestToken:y});case 48:if((S=t.sent).code===l){t.next=51;break}return t.abrupt("return",S);case 51:return T=S.imgUrl,I=S.expiredTime,t.abrupt("return",{url:T,expiredTime:I});case 53:case"end":return t.stop()}}),t,null,[[9,15]])})),h=function(){var r=this,e=arguments;return new Promise((function(n,o){var a=t.apply(r,e);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))},h.apply(this,arguments)}t.exports={preview:function(t){return p(t,1)},upload:function(t){return p(t,2)}}},425:(t,r,e)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function i(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?o(Object(e),!0).forEach((function(r){a(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):o(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}function a(t,r,e){return(r=function(t){var r=function(t,r){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var o=e.call(t,r||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==n(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function c(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */c=function(){return r};var t,r={},e=Object.prototype,o=e.hasOwnProperty,i=Object.defineProperty||function(t,r,e){t[r]=e.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function l(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{l({},"")}catch(t){l=function(t,r,e){return t[r]=e}}function p(t,r,e,n){var o=r&&r.prototype instanceof b?r:b,a=Object.create(o.prototype),c=new q(n||[]);return i(a,"_invoke",{value:S(t,e,c)}),a}function h(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var y="suspendedStart",d="suspendedYield",v="executing",m="completed",g={};function b(){}function w(){}function x(){}var k={};l(k,u,(function(){return this}));var E=Object.getPrototypeOf,L=E&&E(E(N([])));L&&L!==e&&o.call(L,u)&&(k=L);var _=x.prototype=b.prototype=Object.create(k);function O(t){["next","throw","return"].forEach((function(r){l(t,r,(function(t){return this._invoke(r,t)}))}))}function j(t,r){function e(i,a,c,u){var s=h(t[i],t,a);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==n(l)&&o.call(l,"__await")?r.resolve(l.__await).then((function(t){e("next",t,c,u)}),(function(t){e("throw",t,c,u)})):r.resolve(l).then((function(t){f.value=t,c(f)}),(function(t){return e("throw",t,c,u)}))}u(s.arg)}var a;i(this,"_invoke",{value:function(t,n){function o(){return new r((function(r,o){e(t,n,r,o)}))}return a=a?a.then(o,o):o()}})}function S(r,e,n){var o=y;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=T(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var s=h(r,e,n);if("normal"===s.type){if(o=n.done?m:d,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=m,n.method="throw",n.arg=s.arg)}}}function T(r,e){var n=e.method,o=r.iterator[n];if(o===t)return e.delegate=null,"throw"===n&&r.iterator.return&&(e.method="return",e.arg=t,T(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=h(o,r.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var a=i.arg;return a?a.done?(e[r.resultName]=a.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,g):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function I(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function P(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function q(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function N(r){if(r||""===r){var e=r[u];if(e)return e.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var i=-1,a=function e(){for(;++i<r.length;)if(o.call(r,i))return e.value=r[i],e.done=!1,e;return e.value=t,e.done=!0,e};return a.next=a}}throw new TypeError(n(r)+" is not iterable")}return w.prototype=x,i(_,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=l(x,f,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===w||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,l(t,f,"GeneratorFunction")),t.prototype=Object.create(_),t},r.awrap=function(t){return{__await:t}},O(j.prototype),l(j.prototype,s,(function(){return this})),r.AsyncIterator=j,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new j(p(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(_),l(_,f,"Generator"),l(_,u,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=N,q.prototype={constructor:q,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!r)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function n(n,o){return c.type="throw",c.arg=r,e.next=n,o&&(e.method="next",e.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),s=o.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),g},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),P(e),g}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;P(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:N(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),g}},r}function u(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void e(t)}c.done?r(u):Promise.resolve(u).then(n,o)}function s(t){return function(){var r=this,e=arguments;return new Promise((function(n,o){var i=t.apply(r,e);function a(t){u(i,n,o,a,c,"next",t)}function c(t){u(i,n,o,a,c,"throw",t)}a(void 0)}))}}var f=e(938),l=e(305),p=e(652),h=e(85),y=h.FAIL_CODE,d=h.SUCCEED_CODE,v="https://vapp-ide-pack.jd.com";function m(){return(m=s(c().mark((function t(r){var e,n,o;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,w(r);case 3:if((e=t.sent).code===d){t.next=6;break}return t.abrupt("return",e);case 6:return n=e.data.result,t.next=9,k(r,n);case 9:if((o=t.sent).code===d){t.next=12;break}return t.abrupt("return",o);case 12:return t.abrupt("return",{code:d,packId:o.data});case 15:return t.prev=15,t.t0=t.catch(0),t.abrupt("return",{code:y,err_msg:t.t0 instanceof Error?t.t0.message:"上传失败"});case 18:case"end":return t.stop()}}),t,null,[[0,15]])})))).apply(this,arguments)}function g(t,r){return b.apply(this,arguments)}function b(){return b=s(c().mark((function t(r,e){var n,o,a,u,s=arguments;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(a in n=s.length>2&&void 0!==s[2]?s[2]:"请求失败",o=new l,e)o.append(a,e[a]);return t.prev=3,t.next=6,f.post(r,o,{headers:i({},o.getHeaders())});case 6:if((u=t.sent).data.code!==d){t.next=9;break}return t.abrupt("return",{code:d,data:u.data});case 9:return t.abrupt("return",{code:y,err_msg:"".concat(n,": ").concat(u.data.errorMessage)});case 12:return t.prev=12,t.t0=t.catch(3),t.abrupt("return",{code:y,err_msg:"".concat(n,": ").concat(t.t0)});case 15:case"end":return t.stop()}}),t,null,[[3,12]])}))),b.apply(this,arguments)}function w(t){return x.apply(this,arguments)}function x(){return(x=s(c().mark((function t(r){var e,n,o,i,a;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.sourceFile,n=r.appId,o=r.requestToken,i="".concat(v,"/v1/devops/pack"),a={appId:n,requestToken:o,sourceFile:p.createReadStream(e)},t.abrupt("return",g(i,a,"文件上传报错"));case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function k(t,r){return E.apply(this,arguments)}function E(){return(E=s(c().mark((function t(r,e){var n,o,i,a;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=Date.now(),o=5e5,i=3e3;case 3:if(!(Date.now()-n<o)){t.next=15;break}return t.next=6,new Promise((function(t){return setTimeout(t,i)}));case 6:return t.next=8,L(r,e);case 8:if((a=t.sent).code===d){t.next=11;break}return t.abrupt("return",{code:y,err_msg:a.err_msg});case 11:if(!a.data.result){t.next=13;break}return t.abrupt("return",{code:d,data:a.data.result});case 13:t.next=3;break;case 15:return t.abrupt("return",{code:y,err_msg:"查询超时"});case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function L(t,r){return _.apply(this,arguments)}function _(){return(_=s(c().mark((function t(r,e){var n,o,i;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.appId,o=r.requestToken,i={appId:n,requestToken:o,uuid:e},t.abrupt("return",g("".concat(v,"/v1/ci/queryPackIdByUuid"),i,"获取构建包id失效"));case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function O(){return(O=s(c().mark((function t(r){var e,n,o,i,a,u;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.appId,n=r.requestToken,o=r.packId,i={appId:e,requestToken:n,packId:o},t.next=4,g("".concat(v,"/v1/ci/queryQrcodeByPackId"),i,"获取二维码失效");case 4:if((a=t.sent).code===d){t.next=7;break}return t.abrupt("return",{code:y,err_msg:a.err_msg});case 7:if(!a.data.result){t.next=13;break}return(u=new Date).setMinutes(u.getMinutes()+25),t.abrupt("return",{code:d,imgUrl:a.data.result,expiredTime:"".concat(j(u.getHours()),":").concat(j(u.getMinutes()))});case 13:return t.abrupt("return",{code:y,err_msg:"二维码生成完成请求返回为空"});case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function j(t){return String(t).length<2?"0".concat(String(t)):String(t)}function S(){return(S=s(c().mark((function t(r,e){var n,o,i,a,u,s;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.appId,o=r.requestToken,i=r.versionName,a=r.description,u={packId:e,appId:n,requestToken:o,versionName:i,description:a},t.next=4,g("".concat(v,"/v1/ci/commitDevVersion"),u,"设置为开发版失效");case 4:if((s=t.sent).code===d){t.next=7;break}return t.abrupt("return",s);case 7:return t.abrupt("return",{code:d,devId:s.data.result});case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function T(){return(T=s(c().mark((function t(r,e){var n,o,i,a;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.appId,o=r.requestToken,i={appId:n,requestToken:o,devId:e},t.next=4,g("".concat(v,"/v1/ci/devExperience"),i,"设置为体验版失效");case 4:if((a=t.sent).code===d){t.next=7;break}return t.abrupt("return",a);case 7:return t.abrupt("return",{code:d});case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function I(){return(I=s(c().mark((function t(r){var e,n,o,i,a,u;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.appId,n=r.requestToken,o={appId:e,requestToken:n},t.next=4,g("".concat(v,"/v1/ci/queryExperienceQrcode"),o,"获取体验二维码失效");case 4:if((i=t.sent).code===d){t.next=7;break}return t.abrupt("return",{code:y,err_msg:i.err_msg});case 7:return a=i.data.result,(u=new Date).setMinutes(u.getMinutes()+25),t.abrupt("return",{code:d,imgUrl:a,expiredTime:"".concat(j(u.getHours()),":").concat(j(u.getMinutes()))});case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}t.exports={uploadProject:function(t){return m.apply(this,arguments)},generateQrCode:function(t){return O.apply(this,arguments)},commitDevVersion:function(t,r){return S.apply(this,arguments)},setDevExperience:function(t,r){return T.apply(this,arguments)},queryExperienceQrcodeByPackId:function(t){return I.apply(this,arguments)}}},60:(t,r)=>{function e(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;u=!1}else for(;!(u=(n=i.call(e)).done)&&(c.push(n.value),c.length!==r);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,r)||function(t,r){if(t){if("string"==typeof t)return n(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?n(t,r):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}r.checkConfigOptions=function(t,r){for(var n,o=t||{},i=o.appId,a=o.requestToken,c=o.entry,u=o.versionName,s=o.description,f=1===r?{appId:i,requestToken:a,entry:c}:{appId:i,requestToken:a,entry:c,versionName:u,description:s},l=0,p=Object.entries(f);l<p.length;l++){var h=e(p[l],2),y=h[0],d=h[1];if("string"!=typeof(n=d)||!n.trim())return{code:-1,err_msg:"".concat(y," 不能为空")}}return{code:0,err_msg:"ok"}}},172:t=>{"use strict";t.exports=require("archiver")},938:t=>{"use strict";t.exports=require("axios")},305:t=>{"use strict";t.exports=require("form-data")},652:t=>{"use strict";t.exports=require("fs-extra")},410:t=>{"use strict";t.exports=require("glob")},857:t=>{"use strict";t.exports=require("os")},928:t=>{"use strict";t.exports=require("path")}},r={},function e(n){var o=r[n];if(void 0!==o)return o.exports;var i=r[n]={exports:{}};return t[n](i,i.exports,e),i.exports}(954);var t,r}));
package/dist/jgc.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(global,(()=>(()=>{var t={538:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return e};var t,e={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",p=c.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof w?e:w,i=Object.create(o.prototype),c=new q(n||[]);return a(i,"_invoke",{value:S(t,r,c)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",y="suspendedYield",v="executing",m="completed",g={};function w(){}function b(){}function x(){}var k={};f(k,u,(function(){return this}));var j=Object.getPrototypeOf,E=j&&j(j(N([])));E&&E!==r&&i.call(E,u)&&(k=E);var L=x.prototype=w.prototype=Object.create(k);function O(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,a,c,u){var s=h(t[o],t,a);if("throw"!==s.type){var p=s.arg,f=p.value;return f&&"object"==n(f)&&i.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,c,u)}),(function(t){r("throw",t,c,u)})):e.resolve(f).then((function(t){p.value=t,c(p)}),(function(t){return r("throw",t,c,u)}))}u(s.arg)}var o;a(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}})}function S(e,r,n){var o=d;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var s=h(e,r,n);if("normal"===s.type){if(o=n.done?m:y,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=m,n.method="throw",n.arg=s.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function q(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function N(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(i.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(n(e)+" is not iterable")}return b.prototype=x,a(L,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=f(x,p,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,p,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},O(_.prototype),f(_.prototype,s,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new _(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(L),f(L,p,"Generator"),f(L,u,(function(){return this})),f(L,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=N,q.prototype={constructor:q,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function i(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var a=r(652),c=r(928),u=r(172),s=r(410).globSync;function p(t){try{if(a.pathExistsSync(t))return!0;if(p(c.dirname(t)))return a.mkdirsSync(t),!0}catch(t){console.log("make dir error,",t)}}e.writeFile=function(){var t,e=(t=o().mark((function t(e,r){var n,i=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=i.length>2&&void 0!==i[2]?i[2]:"utf8",p(c.posix.parse(e).dir)&&a.writeFileSync(e,r,n);case 4:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))});return function(t,r){return e.apply(this,arguments)}}(),e.hasGameJsonFile=function(t){return a.pathExistsSync(t)?s("game.json",{cwd:t,ignore:"node_modules/**"}).length>0:console.log("当前入口文件目录不存在!")},e.hasJgcConfigFile=function(t){try{return a.accessSync(t,a.constants.F_OK),!0}catch(t){return console.log("文件不存在"),!1}},e.compressDirectory=function(t,e){return new Promise((function(r,n){var o=a.createWriteStream(e),i=u("zip",{zlib:{level:9}});o.on("close",(function(){return r(i.pointer())})),i.on("warning",(function(t){return"ENOENT"!==t.code&&n(t)})),i.on("error",n),i.pipe(o),i.glob("**/*",{cwd:t}),i.finalize()}))},e.deleteFile=function(t){a.existsSync(t)&&a.unlink(t,(function(t){t&&console.log("删除zip文件失败: ",t)}))}},522:t=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function r(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,n(o.key),o)}}function n(t){var r=function(t,r){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,r||"default");if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==e(r)?r:r+""}var o=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.configPrompts=[{name:"type",message:"请选择要发布的包类型:",type:"list",choices:[{name:"小游戏",value:"game"},{name:"插件",value:"plugin"}],default:"game"},{name:"appId",type:"input",message:"请输入appId:",validate:function(t){return!!t||"appId不能为空"}},{name:"requestToken",type:"input",message:"请输入代码上传秘钥:",validate:function(t){return!!t||"代码上传秘钥不能为空"}},{name:"entry",type:"input",message:"请输入需要被打包的游戏(或者插件)的路径:",default:"./"},{name:"versionName",type:"input",message:"请输入需要被打包的游戏(或者插件)的版本号:",default:"1.0.0"},{name:"description",type:"input",message:"请输入需要被打包的游戏(或者插件)的备注:",default:""}]},(e=[{key:"getPrompts",value:function(){return this.configPrompts}}])&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();t.exports=o},890:(t,e,r)=>{var n=r(420),o=r(241),i=r(268);e.showQrCode=function(t){return new Promise((function(e,r){n.read(t).then((function(t){var r=t.bitmap,n=r.width,a=r.height,c=r.data,u=new Uint8ClampedArray(c),s=i(u,n,a);o.generate(s.data,{small:!0}),e(!0)})).catch((function(t){r(t)}))}))},e.getBase64=function(t){return n.read(t).then((function(t){return t.getBase64Async("image/png")})).catch((function(){throw new Error("获取二维码base64失败")}))}},425:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){a(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function a(t,e,r){var o;return o=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(e,"string"),(e="symbol"==n(o)?o:o+"")in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function c(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */c=function(){return e};var t,e={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",p=a.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof w?e:w,a=Object.create(o.prototype),c=new q(n||[]);return i(a,"_invoke",{value:S(t,r,c)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",y="suspendedYield",v="executing",m="completed",g={};function w(){}function b(){}function x(){}var k={};f(k,u,(function(){return this}));var j=Object.getPrototypeOf,E=j&&j(j(N([])));E&&E!==r&&o.call(E,u)&&(k=E);var L=x.prototype=w.prototype=Object.create(k);function O(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(i,a,c,u){var s=h(t[i],t,a);if("throw"!==s.type){var p=s.arg,f=p.value;return f&&"object"==n(f)&&o.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,c,u)}),(function(t){r("throw",t,c,u)})):e.resolve(f).then((function(t){p.value=t,c(p)}),(function(t){return r("throw",t,c,u)}))}u(s.arg)}var a;i(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function S(e,r,n){var o=d;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var s=h(e,r,n);if("normal"===s.type){if(o=n.done?m:y,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=m,n.method="throw",n.arg=s.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function q(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function N(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(o.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(n(e)+" is not iterable")}return b.prototype=x,i(L,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:b,configurable:!0}),b.displayName=f(x,p,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,p,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},O(_.prototype),f(_.prototype,s,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new _(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(L),f(L,p,"Generator"),f(L,u,(function(){return this})),f(L,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=N,q.prototype={constructor:q,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),s=o.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function u(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function s(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){u(i,n,o,a,c,"next",t)}function c(t){u(i,n,o,a,c,"throw",t)}a(void 0)}))}}var p=r(938),f=r(305),l=r(652),h="https://vapp-ide-pack.jd.com";function d(){return(d=s(c().mark((function t(e){var r,n;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,m(e);case 3:if(0===(r=t.sent).code){t.next=6;break}return t.abrupt("return",q(r));case 6:return t.next=8,w(e,r.result);case 8:if(0===(n=t.sent).code){t.next=11;break}return t.abrupt("return",q(n));case 11:return t.abrupt("return",{code:0,packId:n.packId});case 14:return t.prev=14,t.t0=t.catch(0),t.abrupt("return",{code:-2,error_msg:"上传失败!"});case 17:case"end":return t.stop()}}),t,null,[[0,14]])})))).apply(this,arguments)}function y(t,e){return v.apply(this,arguments)}function v(){return v=s(c().mark((function t(e,r){var n,o,a,u,s,l,h,d=arguments;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(a in n=d.length>2&&void 0!==d[2]?d[2]:"请求失败",o=new f,r)o.append(a,r[a]);return t.prev=3,t.next=6,p.post(e,o,{headers:i({},o.getHeaders())});case 6:if(0!==(u=t.sent).data.code){t.next=9;break}return t.abrupt("return",u.data);case 9:return t.abrupt("return",{code:-1,error_msg:"".concat(n,": ").concat(u.data.errorMessage)});case 12:return t.prev=12,t.t0=t.catch(3),s=t.t0.response.data,l=s.status,h=s.path,t.abrupt("return",{code:-2,error_msg:"".concat(n," -> ").concat(h," status is ").concat(l)});case 16:case"end":return t.stop()}}),t,null,[[3,12]])}))),v.apply(this,arguments)}function m(t){return g.apply(this,arguments)}function g(){return(g=s(c().mark((function t(e){var r,n,o,i,a;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.sourceFile,n=e.appId,o=e.requestToken,i="".concat(h,"/v1/devops/pack"),"文件上传报错",a={appId:n,requestToken:o,sourceFile:l.createReadStream(r)},t.abrupt("return",y(i,a,"文件上传报错"));case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function w(t,e){return b.apply(this,arguments)}function b(){return(b=s(c().mark((function t(e,r){var n,o,i,a;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=Date.now(),o=6e5,i=3e3;case 3:if(!(Date.now()-n<o)){t.next=17;break}return t.next=6,new Promise((function(t){return setTimeout(t,i)}));case 6:return t.next=8,x(e,r);case 8:if(0!==(a=t.sent).code||!a.result){t.next=13;break}return t.abrupt("return",{code:0,packId:a.result});case 13:if(0===a.code){t.next=15;break}return t.abrupt("return",{code:a.code,error_msg:a.error_msg});case 15:t.next=3;break;case 17:return t.abrupt("return",{code:-1,error_msg:"查询超时"});case 18:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function x(t,e){return k.apply(this,arguments)}function k(){return(k=s(c().mark((function t(e,r){var n,o,i;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.appId,o=e.requestToken,i={appId:n,requestToken:o,uuid:r},t.abrupt("return",y("".concat(h,"/v1/ci/queryPackIdByUuid"),i,"获取构建包id失效"));case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function j(){return(j=s(c().mark((function t(e){var r,n,o,i,a,u;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.appId,n=e.requestToken,o=e.packId,i={appId:r,requestToken:n,packId:o},t.next=4,y("".concat(h,"/v1/ci/queryQrcodeByPackId"),i,"获取二维码失效");case 4:if(0===(a=t.sent).code){t.next=7;break}return t.abrupt("return",{code:a.code,error_msg:a.error_msg});case 7:return(u=new Date).setMinutes(u.getMinutes()+25),t.abrupt("return",{code:0,imgUrl:a.result,expiredTime:"".concat(E(u.getHours()),":").concat(E(u.getMinutes()))});case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function E(t){return String(t).length<2?"0".concat(String(t)):String(t)}function L(){return(L=s(c().mark((function t(e,r){var n,o;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,O(e,r);case 2:return n=t.sent,t.next=5,S(e,n);case 5:return t.next=7,I(e);case 7:return o=t.sent,t.abrupt("return",o);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function O(t,e){return _.apply(this,arguments)}function _(){return(_=s(c().mark((function t(e,r){var n,o,i,a,u;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.appId,o=e.requestToken,i=e.versionName,a=e.description,u={packId:r,appId:n,requestToken:o,versionName:i,description:a},t.next=4,y("".concat(h,"/v1/ci/commitDevVersion"),u,"设置为开发版失效");case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function S(t,e){return P.apply(this,arguments)}function P(){return(P=s(c().mark((function t(e,r){var n,o,i;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.appId,o=e.requestToken,i={appId:n,requestToken:o,devId:r},t.next=4,y("".concat(h,"/v1/ci/devExperience"),i,"设置为体验版失效");case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function I(t){return T.apply(this,arguments)}function T(){return(T=s(c().mark((function t(e){var r,n,o,i,a,u;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.appId,n=e.requestToken,o={appId:r,requestToken:n},t.next=4,y("".concat(h,"/v1/ci/queryExperienceQrcode"),o,"获取体验二维码失效");case 4:return i=t.sent,a=i.result,(u=new Date).setMinutes(u.getMinutes()+25),t.abrupt("return",{imgUrl:a,expiredTime:"".concat(E(u.getHours()),":").concat(E(u.getMinutes()))});case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function q(t){return{code:t.code,error_msg:t.error_msg}}t.exports={uploadProject:function(t){return d.apply(this,arguments)},generateQrCode:function(t){return j.apply(this,arguments)},setDevPackage:function(t,e){return L.apply(this,arguments)},commitDevVersion:O,setDevExperience:S,queryExperienceQrcodeByPackId:I}},60:(t,e)=>{e.checkConfigOptions=function(t,e){var r=t||{},n=r.appId,o=r.requestToken;return entry=r.entry,[n,o,entry].every((function(t){return function(t){return"string"==typeof t&&!!t.trim()}(t)}))}},589:t=>{function e(t){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}e.keys=()=>[],e.resolve=e,e.id=589,t.exports=e},172:t=>{"use strict";t.exports=require("archiver")},938:t=>{"use strict";t.exports=require("axios")},858:t=>{"use strict";t.exports=require("commander")},305:t=>{"use strict";t.exports=require("form-data")},652:t=>{"use strict";t.exports=require("fs-extra")},410:t=>{"use strict";t.exports=require("glob")},937:t=>{"use strict";t.exports=require("inquirer")},420:t=>{"use strict";t.exports=require("jimp")},268:t=>{"use strict";t.exports=require("jsqr")},720:t=>{"use strict";t.exports=require("ora")},205:t=>{"use strict";t.exports=require("picocolors")},241:t=>{"use strict";t.exports=require("qrcode-terminal")},857:t=>{"use strict";t.exports=require("os")},928:t=>{"use strict";t.exports=require("path")},330:t=>{"use strict";t.exports=JSON.parse('{"name":"jd-minigame-ci","version":"0.1.6","description":"The jd-minigame-ci is a toolkit provided for developers of JD Mini Games. Developers can complete code upload and preview operations for JD Mini Games without the need to open the developer tools, simply by using this toolkit.","author":"chenlong328","license":"ISC","main":"dist/index.js","bin":{"jgc":"./dist/jgc.js"},"scripts":{"config":"NODE_ENV=development node ./dist/jgc.js config","preview":"NODE_ENV=development node ./dist/jgc.js preview","dev:preview":"NODE_ENV=development node ./src/jgc.js preview","dev:upload":"NODE_ENV=development node ./src/jgc.js upload","dev:latest":"NODE_ENV=development node ./src/jgc.js latest","build":"webpack --mode production --progress --config webpack.config.js && chmod 777 ./dist/index.js && chmod 777 ./dist/jgc.js"},"dependencies":{"@babel/cli":"^7.23.9","@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","archiver":"^6.0.1","axios":"^1.6.7","commander":"^11.1.0","fs-extra":"^11.2.0","glob":"^10.3.10","inquirer":"8.2.6","jimp":"^0.22.12","minimist":"^1.2.8","ora":"5.4.1","qrcode":"^1.5.3","qrcode-terminal":"^0.12.0","strip-ansi":"6.0.1","string-width":"4.2.3","jsqr":"1.4.0"},"devDependencies":{"babel-loader":"^9.1.3","babel-minify-webpack-plugin":"^0.3.1","clean-webpack-plugin":"^4.0.0","terser-webpack-plugin":"^5.3.10","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"files":["dist","package.json","README.md"]}')}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);return(()=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e=function(){return n};var r,n={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",p=c.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(r){f=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof w?e:w,i=Object.create(o.prototype),c=new q(n||[]);return a(i,"_invoke",{value:S(t,r,c)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}n.wrap=l;var d="suspendedStart",y="suspendedYield",v="executing",m="completed",g={};function w(){}function b(){}function x(){}var k={};f(k,u,(function(){return this}));var j=Object.getPrototypeOf,E=j&&j(j(N([])));E&&E!==o&&i.call(E,u)&&(k=E);var L=x.prototype=w.prototype=Object.create(k);function O(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function _(e,r){function n(o,a,c,u){var s=h(e[o],e,a);if("throw"!==s.type){var p=s.arg,f=p.value;return f&&"object"==t(f)&&i.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):r.resolve(f).then((function(t){p.value=t,c(p)}),(function(t){return n("throw",t,c,u)}))}u(s.arg)}var o;a(this,"_invoke",{value:function(t,e){function i(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(i,i):i()}})}function S(t,e,n){var o=d;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var s=h(t,e,n);if("normal"===s.type){if(o=n.done?m:y,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=m,n.method="throw",n.arg=s.arg)}}}function P(t,e){var n=e.method,o=t.iterator[n];if(o===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,P(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=h(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,g):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function q(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function N(e){if(e||""===e){var n=e[u];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function t(){for(;++o<e.length;)if(i.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=r,t.done=!0,t};return a.next=a}}throw new TypeError(t(e)+" is not iterable")}return b.prototype=x,a(L,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=f(x,p,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,p,"GeneratorFunction")),t.prototype=Object.create(L),t},n.awrap=function(t){return{__await:t}},O(_.prototype),f(_.prototype,s,(function(){return this})),n.AsyncIterator=_,n.async=function(t,e,r,o,i){void 0===i&&(i=Promise);var a=new _(l(t,e,r,o),i);return n.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(L),f(L,p,"Generator"),f(L,u,(function(){return this})),f(L,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},n.values=N,q.prototype={constructor:q,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(T),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,o){return c.type="throw",c.arg=t,e.next=n,o&&(e.method="next",e.arg=r),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:N(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),g}},n}function n(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function c(t){n(a,o,i,c,u,"next",t)}function u(t){n(a,o,i,c,u,"throw",t)}c(void 0)}))}}var i=r(928),a=r(857),c=r(720),u=r(205),s=r(938),p=new(0,r(858).Command),f=r(937),l=r(522),h=r(538),d=r(60),y=r(425),v=r(890),m=r(330);function g(t){return w.apply(this,arguments)}function w(){return(w=o(e().mark((function t(n){var o,s,p,f,l,m,g,w,b,x,k,j,E,L,O,_,S,P,I,T,q,N,F,G,D,C,M,A,J,Q,V,U,B,Y;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=1===n?"preview":"upload",s=i.posix.resolve("","./jgc.config.js"),h.hasJgcConfigFile(s)){t.next=5;break}return t.abrupt("return",console.log("".concat(u.red("请先创建配置文件!"))));case 5:if(p="function"==typeof require?require:r(589),f=p(s),d.checkConfigOptions(f)){t.next=10;break}return t.abrupt("return",console.log("配置参数校验失败!请检查"));case 10:if(l=f.appId,m=f.requestToken,g=f.versionName,w=f.entry,b=f.description,h.hasGameJsonFile(w)){t.next=14;break}return t.abrupt("return",console.log("请确定需要被打包的游戏(或者插件)的目录下存在game.json!"));case 14:return x=a.tmpdir()+i.sep+"jd_game_temp.zip",h.deleteFile(x),k=c("文件压缩").start(),t.prev=17,t.next=20,h.compressDirectory(w,x);case 20:j=t.sent,k.succeed("压缩完成,共"+j/1e3+"KB"),t.next=28;break;case 24:t.prev=24,t.t0=t.catch(17),k.fail("压缩失败:",t.t0),process.exit(1);case 28:return k.start(),k.text="上传中",t.next=32,y.uploadProject({sourceFile:x,appId:l,requestToken:m});case 32:if(0!==(E=t.sent).code&&(L=E.code,O=E.error_msg,_="压缩失败,code: ".concat(L,",").concat(O),k.fail(_),process.exit(1)),S=E.packId,k.succeed("上传完成,packId:".concat(S)),"preview"!==o){t.next=56;break}return t.prev=37,t.next=40,y.generateQrCode({packId:S,appId:l,requestToken:m});case 40:return 0!==(P=t.sent).code&&(I=P.code,T=P.error_msg,q="预览码生成失败,code: ".concat(I,",").concat(T),k.fail(q),process.exit(1)),N=P.imgUrl,F=P.expiredTime,t.next=45,v.showQrCode(N);case 45:k.succeed("二维码生成完成,将于".concat(F,"过期")),k.info("二维码仅支持协作成员访问"),t.next=54;break;case 49:t.prev=49,t.t1=t.catch(37),G="预览码生成失败,code: -2,".concat(t.t1),k.fail(G),process.exit(1);case 54:t.next=78;break;case 56:if("upload"!==o){t.next=78;break}return k.start(),t.next=60,y.commitDevVersion({appId:l,requestToken:m,versionName:g,description:b},S);case 60:return 0!==(D=t.sent).code&&(C="预览码生成失败,code: ".concat(D.code,",").concat(D.error_msg),k.fail(C),process.exit(1)),M=D.result,k.succeed("开发版设置完成, devId:"+M),t.next=66,y.setDevExperience({appId:l,requestToken:m},M);case 66:return 0!==(A=t.sent).code&&(J=A.code,Q=A.error_msg,V="体验版设置失败,code: ".concat(J,",").concat(Q),k.fail(V),process.exit(1)),k.succeed("体验版设置完成"),t.next=71,y.queryExperienceQrcodeByPackId({appId:l,requestToken:m});case 71:return U=t.sent,B=U.imgUrl,Y=U.expiredTime,t.next=76,v.showQrCode(B);case 76:k.info("二维码仅支持协作成员访问"),k.succeed("二维码生成完成,将于".concat(Y,"过期"));case 78:case"end":return t.stop()}}),t,null,[[17,24],[37,49]])})))).apply(this,arguments)}function b(){return(b=o(e().mark((function t(){var r,n,o,i,a,c;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=m.version,n=m.name,t.prev=2,o="https://registry.npmjs.org/".concat(n,"/latest"),t.next=6,s.get(o);case 6:i=t.sent,a=i.data,c=a.version,r!==c?(console.log("当前版本: ".concat(r)),console.log("最新版本: ".concat(c)),console.log("请及时更新到最新版本: npm install -g "+n)):console.log("已经是最新版本了:".concat(r)),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(2),console.error("Error fetching package info:",t.t0);case 15:case"end":return t.stop()}}),t,null,[[2,12]])})))).apply(this,arguments)}p.command("config").description("小游戏配置").action(o(e().mark((function t(){var r,n;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=(new l).getPrompts(),t.next=3,f.prompt(r);case 3:if(n=t.sent,h.hasGameJsonFile(n.entry)){t.next=7;break}return t.abrupt("return",console.log("".concat(u.red("请确定需要被打包的游戏(或者插件)的目录下存在game.json"))));case 7:try{"jgc.config.js",h.writeFile("./".concat("jgc.config.js"),"module.exports = ".concat(JSON.stringify(n,null,2)),"utf-8"),console.log("✨ ".concat(u.green("创建小游戏配置文件成功")))}catch(t){console.log("创建小游戏配置文件失败:",t)}case 8:case"end":return t.stop()}}),t)})))),p.command("preview").description("小游戏真机预览").action(o(e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:g(1);case 1:case"end":return t.stop()}}),t)})))),p.version(m.version,"-v, -V, --version","显示小游戏CLI工具的版本").description("京东小游戏CLI工具"),p.command("latest").description("京东小游戏CLI工具latest版本").action((function(){!function(){b.apply(this,arguments)}()})),p.command("upload").description("小游戏发布").action(o(e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:g(2);case 1:case"end":return t.stop()}}),t)})))),p.parse(process.argv)})(),{}})()));
2
+ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(global,(()=>(()=>{var t={85:t=>{t.exports={FAIL_CODE:-1,SUCCEED_CODE:0}},538:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return e};var t,e={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",p=c.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),c=new T(n||[]);return a(i,"_invoke",{value:S(t,r,c)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",y="suspendedYield",v="executing",m="completed",g={};function b(){}function w(){}function x(){}var k={};f(k,u,(function(){return this}));var E=Object.getPrototypeOf,j=E&&E(E(N([])));j&&j!==r&&i.call(j,u)&&(k=j);var L=x.prototype=b.prototype=Object.create(k);function O(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,a,c,u){var s=h(t[o],t,a);if("throw"!==s.type){var p=s.arg,f=p.value;return f&&"object"==n(f)&&i.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,c,u)}),(function(t){r("throw",t,c,u)})):e.resolve(f).then((function(t){p.value=t,c(p)}),(function(t){return r("throw",t,c,u)}))}u(s.arg)}var o;a(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}})}function S(e,r,n){var o=d;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=I(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var s=h(e,r,n);if("normal"===s.type){if(o=n.done?m:y,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=m,n.method="throw",n.arg=s.arg)}}}function I(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,I(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function q(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function N(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(i.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(n(e)+" is not iterable")}return w.prototype=x,a(L,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,p,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,p,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},O(_.prototype),f(_.prototype,s,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new _(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(L),f(L,p,"Generator"),f(L,u,(function(){return this})),f(L,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=N,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),q(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;q(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function i(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var a=r(652),c=r(928),u=r(172),s=r(410).globSync;function p(t){try{if(a.pathExistsSync(t))return!0;if(p(c.dirname(t)))return a.mkdirsSync(t),!0}catch(t){console.log("make dir error,",t)}}e.writeFile=function(){var t,e=(t=o().mark((function t(e,r){var n,i=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=i.length>2&&void 0!==i[2]?i[2]:"utf8",p(c.posix.parse(e).dir)&&a.writeFileSync(e,r,n);case 4:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))});return function(t,r){return e.apply(this,arguments)}}(),e.verifyGameRequiredFilesExist=function(t){if(!a.pathExistsSync(t))return{code:-1,err_msg:"当前入口文件目录不存在!"};var e=s("game.json",{cwd:t,ignore:"node_modules/**"}),r=s("game.js",{cwd:t,ignore:"node_modules/**"});return 0===e.length?{code:-1,err_msg:"被打包的游戏的目录下不存在game.json!"}:0===r.length?{code:-1,err_msg:"被打包的游戏的目录下不存在game.js!"}:{code:0,err_msg:"ok"}},e.hasJgcConfigFile=function(t){try{return a.accessSync(t,a.constants.F_OK),!0}catch(t){return console.log("文件不存在"),!1}},e.compressDirectory=function(t,e){return new Promise((function(r,n){var o=a.createWriteStream(e),i=u("zip",{zlib:{level:9}});o.on("close",(function(){return r(i.pointer())})),i.on("warning",(function(t){return"ENOENT"!==t.code&&n(t)})),i.on("error",n),i.pipe(o),i.glob("**/*",{cwd:t,ignore:["**/.*","**/*.js.map"]}),i.finalize()}))},e.deleteFile=function(t){a.existsSync(t)&&a.unlink(t,(function(t){t&&console.log("删除zip文件失败: ",t)}))}},522:t=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function r(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,n(o.key),o)}}function n(t){var r=function(t,r){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,r||"default");if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==e(r)?r:r+""}var o=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.configPrompts=[{name:"appId",type:"input",message:"请输入appId:",validate:function(t){return!!t||"appId不能为空"}},{name:"requestToken",type:"input",message:"请输入代码上传秘钥:",validate:function(t){return!!t||"代码上传秘钥不能为空"}},{name:"entry",type:"input",message:"请输入需要被打包的游戏(或者插件)的路径:",default:"./"},{name:"versionName",type:"input",message:"请输入需要被打包的游戏(或者插件)的版本号:",default:"1.0.0"},{name:"description",type:"input",message:"请输入需要被打包的游戏(或者插件)的备注:",default:""}]},(e=[{key:"getPrompts",value:function(){return this.configPrompts}}])&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();t.exports=o},890:(t,e,r)=>{var n=r(420),o=r(241),i=r(268);e.showQrCode=function(t){return new Promise((function(e,r){n.read(t).then((function(t){var r=t.bitmap,n=r.width,a=r.height,c=r.data,u=new Uint8ClampedArray(c),s=i(u,n,a);o.generate(s.data,{small:!1}),e(!0)})).catch((function(t){r(!1)}))}))},e.getBase64=function(t){return n.read(t).then((function(t){return t.getBase64Async("image/png")})).catch((function(){throw new Error("获取二维码base64失败")}))}},425:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){a(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function a(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function c(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */c=function(){return e};var t,e={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",p=a.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,a=Object.create(o.prototype),c=new T(n||[]);return i(a,"_invoke",{value:S(t,r,c)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",y="suspendedYield",v="executing",m="completed",g={};function b(){}function w(){}function x(){}var k={};f(k,u,(function(){return this}));var E=Object.getPrototypeOf,j=E&&E(E(N([])));j&&j!==r&&o.call(j,u)&&(k=j);var L=x.prototype=b.prototype=Object.create(k);function O(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(i,a,c,u){var s=h(t[i],t,a);if("throw"!==s.type){var p=s.arg,f=p.value;return f&&"object"==n(f)&&o.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,c,u)}),(function(t){r("throw",t,c,u)})):e.resolve(f).then((function(t){p.value=t,c(p)}),(function(t){return r("throw",t,c,u)}))}u(s.arg)}var a;i(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function S(e,r,n){var o=d;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=I(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var s=h(e,r,n);if("normal"===s.type){if(o=n.done?m:y,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=m,n.method="throw",n.arg=s.arg)}}}function I(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,I(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function q(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function N(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(o.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(n(e)+" is not iterable")}return w.prototype=x,i(L,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,p,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,p,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},O(_.prototype),f(_.prototype,s,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new _(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(L),f(L,p,"Generator"),f(L,u,(function(){return this})),f(L,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=N,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!e)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),s=o.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),q(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;q(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function u(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function s(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){u(i,n,o,a,c,"next",t)}function c(t){u(i,n,o,a,c,"throw",t)}a(void 0)}))}}var p=r(938),f=r(305),l=r(652),h=r(85),d=h.FAIL_CODE,y=h.SUCCEED_CODE,v="https://vapp-ide-pack.jd.com";function m(){return(m=s(c().mark((function t(e){var r,n,o;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,w(e);case 3:if((r=t.sent).code===y){t.next=6;break}return t.abrupt("return",r);case 6:return n=r.data.result,t.next=9,k(e,n);case 9:if((o=t.sent).code===y){t.next=12;break}return t.abrupt("return",o);case 12:return t.abrupt("return",{code:y,packId:o.data});case 15:return t.prev=15,t.t0=t.catch(0),t.abrupt("return",{code:d,err_msg:t.t0 instanceof Error?t.t0.message:"上传失败"});case 18:case"end":return t.stop()}}),t,null,[[0,15]])})))).apply(this,arguments)}function g(t,e){return b.apply(this,arguments)}function b(){return b=s(c().mark((function t(e,r){var n,o,a,u,s=arguments;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(a in n=s.length>2&&void 0!==s[2]?s[2]:"请求失败",o=new f,r)o.append(a,r[a]);return t.prev=3,t.next=6,p.post(e,o,{headers:i({},o.getHeaders())});case 6:if((u=t.sent).data.code!==y){t.next=9;break}return t.abrupt("return",{code:y,data:u.data});case 9:return t.abrupt("return",{code:d,err_msg:"".concat(n,": ").concat(u.data.errorMessage)});case 12:return t.prev=12,t.t0=t.catch(3),t.abrupt("return",{code:d,err_msg:"".concat(n,": ").concat(t.t0)});case 15:case"end":return t.stop()}}),t,null,[[3,12]])}))),b.apply(this,arguments)}function w(t){return x.apply(this,arguments)}function x(){return(x=s(c().mark((function t(e){var r,n,o,i,a;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.sourceFile,n=e.appId,o=e.requestToken,i="".concat(v,"/v1/devops/pack"),a={appId:n,requestToken:o,sourceFile:l.createReadStream(r)},t.abrupt("return",g(i,a,"文件上传报错"));case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function k(t,e){return E.apply(this,arguments)}function E(){return(E=s(c().mark((function t(e,r){var n,o,i,a;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=Date.now(),o=5e5,i=3e3;case 3:if(!(Date.now()-n<o)){t.next=15;break}return t.next=6,new Promise((function(t){return setTimeout(t,i)}));case 6:return t.next=8,j(e,r);case 8:if((a=t.sent).code===y){t.next=11;break}return t.abrupt("return",{code:d,err_msg:a.err_msg});case 11:if(!a.data.result){t.next=13;break}return t.abrupt("return",{code:y,data:a.data.result});case 13:t.next=3;break;case 15:return t.abrupt("return",{code:d,err_msg:"查询超时"});case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function j(t,e){return L.apply(this,arguments)}function L(){return(L=s(c().mark((function t(e,r){var n,o,i;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.appId,o=e.requestToken,i={appId:n,requestToken:o,uuid:r},t.abrupt("return",g("".concat(v,"/v1/ci/queryPackIdByUuid"),i,"获取构建包id失效"));case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function O(){return(O=s(c().mark((function t(e){var r,n,o,i,a,u;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.appId,n=e.requestToken,o=e.packId,i={appId:r,requestToken:n,packId:o},t.next=4,g("".concat(v,"/v1/ci/queryQrcodeByPackId"),i,"获取二维码失效");case 4:if((a=t.sent).code===y){t.next=7;break}return t.abrupt("return",{code:d,err_msg:a.err_msg});case 7:if(!a.data.result){t.next=13;break}return(u=new Date).setMinutes(u.getMinutes()+25),t.abrupt("return",{code:y,imgUrl:a.data.result,expiredTime:"".concat(_(u.getHours()),":").concat(_(u.getMinutes()))});case 13:return t.abrupt("return",{code:d,err_msg:"二维码生成完成请求返回为空"});case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function _(t){return String(t).length<2?"0".concat(String(t)):String(t)}function S(){return(S=s(c().mark((function t(e,r){var n,o,i,a,u,s;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.appId,o=e.requestToken,i=e.versionName,a=e.description,u={packId:r,appId:n,requestToken:o,versionName:i,description:a},t.next=4,g("".concat(v,"/v1/ci/commitDevVersion"),u,"设置为开发版失效");case 4:if((s=t.sent).code===y){t.next=7;break}return t.abrupt("return",s);case 7:return t.abrupt("return",{code:y,devId:s.data.result});case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function I(){return(I=s(c().mark((function t(e,r){var n,o,i,a;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.appId,o=e.requestToken,i={appId:n,requestToken:o,devId:r},t.next=4,g("".concat(v,"/v1/ci/devExperience"),i,"设置为体验版失效");case 4:if((a=t.sent).code===y){t.next=7;break}return t.abrupt("return",a);case 7:return t.abrupt("return",{code:y});case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function P(){return(P=s(c().mark((function t(e){var r,n,o,i,a,u;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.appId,n=e.requestToken,o={appId:r,requestToken:n},t.next=4,g("".concat(v,"/v1/ci/queryExperienceQrcode"),o,"获取体验二维码失效");case 4:if((i=t.sent).code===y){t.next=7;break}return t.abrupt("return",{code:d,err_msg:i.err_msg});case 7:return a=i.data.result,(u=new Date).setMinutes(u.getMinutes()+25),t.abrupt("return",{code:y,imgUrl:a,expiredTime:"".concat(_(u.getHours()),":").concat(_(u.getMinutes()))});case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}t.exports={uploadProject:function(t){return m.apply(this,arguments)},generateQrCode:function(t){return O.apply(this,arguments)},commitDevVersion:function(t,e){return S.apply(this,arguments)},setDevExperience:function(t,e){return I.apply(this,arguments)},queryExperienceQrcodeByPackId:function(t){return P.apply(this,arguments)}}},60:(t,e)=>{function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}e.checkConfigOptions=function(t,e){for(var n,o=t||{},i=o.appId,a=o.requestToken,c=o.entry,u=o.versionName,s=o.description,p=1===e?{appId:i,requestToken:a,entry:c}:{appId:i,requestToken:a,entry:c,versionName:u,description:s},f=0,l=Object.entries(p);f<l.length;f++){var h=r(l[f],2),d=h[0],y=h[1];if("string"!=typeof(n=y)||!n.trim())return{code:-1,err_msg:"".concat(d," 不能为空")}}return{code:0,err_msg:"ok"}}},589:t=>{function e(t){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}e.keys=()=>[],e.resolve=e,e.id=589,t.exports=e},172:t=>{"use strict";t.exports=require("archiver")},938:t=>{"use strict";t.exports=require("axios")},858:t=>{"use strict";t.exports=require("commander")},305:t=>{"use strict";t.exports=require("form-data")},652:t=>{"use strict";t.exports=require("fs-extra")},410:t=>{"use strict";t.exports=require("glob")},937:t=>{"use strict";t.exports=require("inquirer")},420:t=>{"use strict";t.exports=require("jimp")},268:t=>{"use strict";t.exports=require("jsqr")},720:t=>{"use strict";t.exports=require("ora")},205:t=>{"use strict";t.exports=require("picocolors")},241:t=>{"use strict";t.exports=require("qrcode-terminal")},857:t=>{"use strict";t.exports=require("os")},928:t=>{"use strict";t.exports=require("path")},330:t=>{"use strict";t.exports=JSON.parse('{"name":"jd-minigame-ci","version":"0.2.0","description":"The jd-minigame-ci is a toolkit provided for developers of JD Mini Games. Developers can complete code upload and preview operations for JD Mini Games without the need to open the developer tools, simply by using this toolkit.","author":"chenlong328","license":"ISC","main":"dist/index.js","bin":{"jgc":"./dist/jgc.js"},"scripts":{"config":"NODE_ENV=development node ./dist/jgc.js config","preview":"NODE_ENV=development node ./dist/jgc.js preview","dev:preview":"NODE_ENV=development node ./src/jgc.js preview","dev:upload":"NODE_ENV=development node ./src/jgc.js upload","build":"webpack --mode production --progress --config webpack.config.js && chmod 777 ./dist/index.js && chmod 777 ./dist/jgc.js"},"dependencies":{"@babel/cli":"^7.23.9","@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","archiver":"^6.0.1","axios":"^1.7.3","commander":"^11.1.0","fs-extra":"^11.2.0","glob":"^10.3.10","inquirer":"8.2.6","jimp":"^0.22.12","jsqr":"1.4.0","minimist":"^1.2.8","ora":"5.4.1","qrcode":"^1.5.3","qrcode-terminal":"^0.12.0","string-width":"4.2.3","strip-ansi":"6.0.1"},"devDependencies":{"babel-loader":"^9.1.3","babel-minify-webpack-plugin":"^0.3.1","clean-webpack-plugin":"^4.0.0","terser-webpack-plugin":"^5.3.10","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"files":["dist","package.json","README.md"]}')}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return e};var t,e={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",p=c.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),c=new T(n||[]);return a(i,"_invoke",{value:S(t,r,c)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",y="suspendedYield",v="executing",m="completed",g={};function b(){}function w(){}function x(){}var k={};f(k,u,(function(){return this}));var E=Object.getPrototypeOf,j=E&&E(E(N([])));j&&j!==r&&i.call(j,u)&&(k=j);var L=x.prototype=b.prototype=Object.create(k);function O(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,a,c,u){var s=h(t[o],t,a);if("throw"!==s.type){var p=s.arg,f=p.value;return f&&"object"==n(f)&&i.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,c,u)}),(function(t){r("throw",t,c,u)})):e.resolve(f).then((function(t){p.value=t,c(p)}),(function(t){return r("throw",t,c,u)}))}u(s.arg)}var o;a(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}})}function S(e,r,n){var o=d;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=I(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var s=h(e,r,n);if("normal"===s.type){if(o=n.done?m:y,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=m,n.method="throw",n.arg=s.arg)}}}function I(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,I(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function q(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function N(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(i.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(n(e)+" is not iterable")}return w.prototype=x,a(L,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,p,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,p,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},O(_.prototype),f(_.prototype,s,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new _(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(L),f(L,p,"Generator"),f(L,u,(function(){return this})),f(L,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=N,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),q(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;q(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function i(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function a(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))}}var c=r(928),u=r(857),s=r(720),p=r(205),f=new(0,r(858).Command),l=r(937),h=r(938),d=r(522),y=r(538),v=r(60),m=r(425),g=r(890),b=r(85).SUCCEED_CODE,w=r(330);function x(t){return k.apply(this,arguments)}function k(){return(k=a(o().mark((function t(e){var n,i,a,f,l,h,d,w,x,k,E,j,L,O,_,S,I,P,q,T,N,D,F,C,G;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=1===e?"preview":"upload",i=c.posix.resolve("","./jgc.config.js"),y.hasJgcConfigFile(i)){t.next=5;break}return t.abrupt("return",console.log("".concat(p.red("请先创建配置文件!"))));case 5:if(a="function"==typeof require?require:r(589),f=a(i),(l=v.checkConfigOptions(f,e)).code===b){t.next=10;break}return t.abrupt("return",console.log(l.err_msg));case 10:if(h=f.appId,d=f.requestToken,w=f.versionName,x=f.entry,k=f.description,(E=y.verifyGameRequiredFilesExist(x)).code===b){t.next=14;break}return t.abrupt("return",console.log(E.err_msg));case 14:return j=u.tmpdir()+c.sep+"jd_game_temp.zip",y.deleteFile(j),L=s("文件压缩").start(),t.prev=17,t.next=20,y.compressDirectory(x,j);case 20:O=t.sent,L.succeed("压缩完成,共"+O/1e3+"KB"),t.next=28;break;case 24:t.prev=24,t.t0=t.catch(17),L.fail("压缩失败:",t.t0),process.exit(1);case 28:return L.start(),L.text="上传中",t.prev=30,t.next=33,m.uploadProject({sourceFile:j,appId:h,requestToken:d});case 33:if((_=t.sent).code!==b&&(L.fail(_.err_msg),process.exit(1)),S=_.packId,L.succeed("上传完成,packId:".concat(S)),"preview"!==n){t.next=49;break}return t.next=40,m.generateQrCode({packId:S,appId:h,requestToken:d});case 40:return(I=t.sent).code!==b&&(L.fail(I.err_msg),process.exit(1)),P=I.imgUrl,q=I.expiredTime,t.next=45,g.showQrCode(P);case 45:L.succeed("二维码生成完成,将于".concat(q,"过期")),L.info("二维码仅支持协作成员访问"),t.next=71;break;case 49:if("upload"!==n){t.next=71;break}return L.start(),t.next=53,m.commitDevVersion({appId:h,requestToken:d,versionName:w,description:k},S);case 53:return(T=t.sent).code!==b&&(L.fail(T.err_msg),process.exit(1)),N=T.devId,L.succeed("开发版设置完成, devId:"+N),t.next=59,m.setDevExperience({appId:h,requestToken:d},N);case 59:return(D=t.sent).code!==b&&(L.fail(D.err_msg),process.exit(1)),L.succeed("体验版设置完成"),t.next=64,m.queryExperienceQrcodeByPackId({appId:h,requestToken:d});case 64:return(F=t.sent).code!==b&&(L.fail(F.err_msg),process.exit(1)),C=F.imgUrl,G=F.expiredTime,t.next=69,g.showQrCode(C);case 69:L.info("二维码仅支持协作成员访问"),L.succeed("二维码生成完成,将于".concat(G,"过期"));case 71:t.next=77;break;case 73:t.prev=73,t.t1=t.catch(30),L.fail("CLI执行报错 --\x3e".concat(t.t1)),process.exit(1);case 77:case"end":return t.stop()}}),t,null,[[17,24],[30,73]])})))).apply(this,arguments)}return f.command("config").description("小游戏配置").action(a(o().mark((function t(){var e,r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=(new d).getPrompts(),t.next=3,l.prompt(e);case 3:if(r=t.sent,y.hasGameJsonFile(r.entry)){t.next=7;break}return t.abrupt("return",console.log("".concat(p.red("请确定需要被打包的游戏(或者插件)的目录下存在game.json"))));case 7:return t.prev=7,y.writeFile("./".concat("jgc.config.js"),"module.exports = ".concat(JSON.stringify(r,null,2)),"utf-8"),t.abrupt("return",console.log("✨ ".concat(p.green("创建小游戏配置文件成功"))));case 13:t.prev=13,t.t0=t.catch(7),console.log("创建小游戏配置文件失败:",t.t0);case 16:case"end":return t.stop()}}),t,null,[[7,13]])})))),f.command("preview").description("小游戏真机预览").action(a(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:x(1);case 1:case"end":return t.stop()}}),t)})))),f.command("upload").description("小游戏发布").action(a(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:x(2);case 1:case"end":return t.stop()}}),t)})))),f.version(w.version,"-v, -V").description("获取本地京东小游戏CLI工具版本"),f.command("latest").description("获取并对比京东小游戏CLI工具最新版本").action(a(o().mark((function t(){var e,r,n,i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e=s("npm最新版本获取中……").start(),t.next=4,h.get("https://registry.npmjs.org/jd-minigame-ci/latest");case 4:r=t.sent,n=r.data.version,i=w.version,e.succeed("最新版本: ".concat(n)),n===i?e.info("当前版本 (".concat(i,") 已是最新版本。")):(e.info("本地版本: ".concat(i)),e.info("请更新到最新版本以获取最新功能和修复。")),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(0),spinner.fail("获取最新版本信息失败: ".concat(t.t0));case 14:case"end":return t.stop()}}),t,null,[[0,11]])})))),f.parse(process.argv),{}})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jd-minigame-ci",
3
- "version": "0.1.8",
3
+ "version": "0.2.0",
4
4
  "description": "The jd-minigame-ci is a toolkit provided for developers of JD Mini Games. Developers can complete code upload and preview operations for JD Mini Games without the need to open the developer tools, simply by using this toolkit.",
5
5
  "author": "chenlong328",
6
6
  "license": "ISC",
@@ -13,7 +13,6 @@
13
13
  "preview": "NODE_ENV=development node ./dist/jgc.js preview",
14
14
  "dev:preview": "NODE_ENV=development node ./src/jgc.js preview",
15
15
  "dev:upload": "NODE_ENV=development node ./src/jgc.js upload",
16
- "dev:latest": "NODE_ENV=development node ./src/jgc.js latest",
17
16
  "build": "webpack --mode production --progress --config webpack.config.js && chmod 777 ./dist/index.js && chmod 777 ./dist/jgc.js"
18
17
  },
19
18
  "dependencies": {
@@ -21,19 +20,19 @@
21
20
  "@babel/core": "^7.23.9",
22
21
  "@babel/preset-env": "^7.23.9",
23
22
  "archiver": "^6.0.1",
24
- "axios": "^1.6.7",
23
+ "axios": "^1.7.3",
25
24
  "commander": "^11.1.0",
26
25
  "fs-extra": "^11.2.0",
27
26
  "glob": "^10.3.10",
28
27
  "inquirer": "8.2.6",
29
28
  "jimp": "^0.22.12",
29
+ "jsqr": "1.4.0",
30
30
  "minimist": "^1.2.8",
31
31
  "ora": "5.4.1",
32
32
  "qrcode": "^1.5.3",
33
33
  "qrcode-terminal": "^0.12.0",
34
- "strip-ansi": "6.0.1",
35
34
  "string-width": "4.2.3",
36
- "jsqr": "1.4.0"
35
+ "strip-ansi": "6.0.1"
37
36
  },
38
37
  "devDependencies": {
39
38
  "babel-loader": "^9.1.3",