@wps365-open/comate-cli 0.0.21 → 0.0.22
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/dist/commands/auth/login.js +1 -1
- package/dist/commands/auth/logout.js +1 -1
- package/dist/commands/auth/status.js +1 -1
- package/dist/commands/code/config.js +1 -1
- package/dist/commands/code/create.js +1 -1
- package/dist/commands/code/deploy.js +1 -1
- package/dist/commands/code/download.js +1 -1
- package/dist/commands/code/fetch-html.js +1 -1
- package/dist/commands/code/files.js +1 -1
- package/dist/commands/code/lookup.js +1 -1
- package/dist/commands/code/publish.js +1 -1
- package/dist/commands/code/recall.js +1 -1
- package/dist/commands/code/resume.js +1 -1
- package/dist/commands/code/send.js +1 -1
- package/dist/commands/code/status.js +1 -1
- package/dist/commands/code/upload.js +1 -1
- package/dist/commands/code/visibility.js +1 -0
- package/dist/commands/update.js +1 -1
- package/dist/hooks/init/logger.js +1 -1
- package/dist/hooks/prerun/update-checker.js +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/account/login-service.js +1 -1
- package/dist/lib/config/constants.js +1 -1
- package/dist/lib/config/manager.js +1 -1
- package/dist/lib/extends/command.js +1 -1
- package/dist/lib/http/auth-headers.js +1 -1
- package/dist/lib/http/client.js +1 -1
- package/dist/lib/log/logger.js +1 -1
- package/dist/lib/service/auth.js +1 -1
- package/dist/lib/service/cloud-agent.js +1 -1
- package/dist/lib/service/cloud-publish.js +1 -1
- package/dist/lib/service/manage.js +1 -1
- package/dist/lib/service/project-context.js +1 -1
- package/oclif.manifest.json +70 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a13_0x3560(_0xb061c9,_0xa2d0f6){_0xb061c9=_0xb061c9-0x1ac;const _0x1413a9=a13_0x1413();let _0x356076=_0x1413a9[_0xb061c9];return _0x356076;}const a13_0x456887=a13_0x3560;(function(_0x299221,_0x4cd1a6){const _0x12862f=a13_0x3560,_0x33a83d=_0x299221();while(!![]){try{const _0x3756e6=-parseInt(_0x12862f(0x1af))/0x1+-parseInt(_0x12862f(0x1b5))/0x2*(-parseInt(_0x12862f(0x1c7))/0x3)+-parseInt(_0x12862f(0x1bb))/0x4*(-parseInt(_0x12862f(0x1ae))/0x5)+-parseInt(_0x12862f(0x1ad))/0x6*(parseInt(_0x12862f(0x1c6))/0x7)+parseInt(_0x12862f(0x1b8))/0x8+parseInt(_0x12862f(0x1b1))/0x9*(-parseInt(_0x12862f(0x1b4))/0xa)+parseInt(_0x12862f(0x1b6))/0xb;if(_0x3756e6===_0x4cd1a6)break;else _0x33a83d['push'](_0x33a83d['shift']());}catch(_0x50f351){_0x33a83d['push'](_0x33a83d['shift']());}}}(a13_0x1413,0x8398d));import{Args,Flags}from'@oclif/core';function a13_0x1413(){const _0x2c1ae1=['parse','5028784JecXPu','log','submitted','2047756prGeJh','assistant-id','string','发送给云端\x20Agent\x20的消息','description','云端\x20Agent\x20ID','flags','提交消息到云端\x20Agent...','向云端\x20Agent\x20发送消息(提交后立即返回)','message','examples','266oxuKPk','3bTTUOn','enableJsonFlag','143778HOcIXH','5qtVADa','570737eiEglk','integer','252iJLcyH','thread-id','项目\x20ID(从\x20code\x20create\x20获取,用于生成访问地址)','199070yvZuxp','1525924UVcrFh','7416739vCZjZv'];a13_0x1413=function(){return _0x2c1ae1;};return a13_0x1413();}import a13_0x2daf61 from'../../lib/extends/command.js';import{submitRun}from'../../lib/service/cloud-agent.js';export default class CodeSend extends a13_0x2daf61{static [a13_0x456887(0x1bf)]=a13_0x456887(0x1c3);static [a13_0x456887(0x1ac)]=!![];static [a13_0x456887(0x1c5)]=['<%=\x20config.bin\x20%>\x20code\x20send\x20--thread-id\x20thread_xxx\x20--project-id\x20206\x20\x22做一个待办应用\x22\x20--json'];static ['args']={'message':Args['string']({'description':a13_0x456887(0x1be),'required':!![]})};static [a13_0x456887(0x1c1)]={'thread-id':Flags[a13_0x456887(0x1bd)]({'description':'会话\x20ID(从\x20code\x20create\x20获取)','required':!![]}),'project-id':Flags[a13_0x456887(0x1b0)]({'description':a13_0x456887(0x1b3)}),'assistant-id':Flags[a13_0x456887(0x1bd)]({'description':a13_0x456887(0x1c0),'default':'app-buddy'})};async['run'](){const _0x46f053=a13_0x456887;await this['requireAuth']();const {args:_0x2de2a8,flags:_0x41f421}=await this[_0x46f053(0x1b7)](CodeSend),_0x1501eb=this['jsonEnabled'](),_0x558333=_0x41f421[_0x46f053(0x1b2)],_0x1f662d=_0x41f421['project-id'];if(!_0x1501eb)this[_0x46f053(0x1b9)](_0x46f053(0x1c2));return await submitRun({'threadId':_0x558333,'messages':[{'role':'user','content':_0x2de2a8[_0x46f053(0x1c4)]}],'assistantId':_0x41f421[_0x46f053(0x1bc)]}),!_0x1501eb&&this['log']('消息已提交,云端\x20Agent\x20正在处理'),{'status':_0x46f053(0x1ba),'thread_id':_0x558333,'project_id':_0x1f662d};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a14_0x3699c3=a14_0x1b1e;(function(_0x37d0d2,_0x563e1c){const _0x27f098=a14_0x1b1e,_0x12d235=_0x37d0d2();while(!![]){try{const _0x1933a4=parseInt(_0x27f098(0x18a))/0x1*(parseInt(_0x27f098(0x1ae))/0x2)+parseInt(_0x27f098(0x190))/0x3+parseInt(_0x27f098(0x19a))/0x4*(-parseInt(_0x27f098(0x185))/0x5)+-parseInt(_0x27f098(0x1b7))/0x6*(parseInt(_0x27f098(0x1ac))/0x7)+-parseInt(_0x27f098(0x1a9))/0x8+-parseInt(_0x27f098(0x19f))/0x9*(parseInt(_0x27f098(0x191))/0xa)+-parseInt(_0x27f098(0x1af))/0xb*(-parseInt(_0x27f098(0x1aa))/0xc);if(_0x1933a4===_0x563e1c)break;else _0x12d235['push'](_0x12d235['shift']());}catch(_0x22cd1d){_0x12d235['push'](_0x12d235['shift']());}}}(a14_0x5533,0x69566));import{Flags}from'@oclif/core';import a14_0x541785 from'../../lib/extends/command.js';function a14_0x1b1e(_0x232bce,_0x3da544){_0x232bce=_0x232bce-0x185;const _0x553399=a14_0x5533();let _0x1b1eee=_0x553399[_0x232bce];return _0x1b1eee;}import{getProjectContext}from'../../lib/service/project-context.js';function a14_0x5533(){const _0xf9723a=['message','yellow','description','⚠\x20WAITING:\x20Agent\x20等待确认\x20—\x20\x22','215136CoHDgg','Deploy:\x20\x20\x20\x20','Short\x20URL:\x20','run','正在查询项目状态...','project-id','colorize','printHuman','<%=\x20config.bin\x20%>\x20code\x20status\x20--thread-id\x20thread_xxx\x20--json','agent','2580880CtMsSz','4414980uTziPt','\x20—\x20','77pXkZSL','Agent:\x20\x20\x20\x20\x20','2HnHNDH','33usBrsG','error','integer','examples','createLoading','未知原因','access_url','build','102504HlOZrD','3727560xZgGhf','phase','\x20tasks','urls','查看云端项目综合状态(Agent\x20/\x20构建\x20/\x20部署\x20/\x20HITL\x20中断)','225569sqxoTd','\x20messages,\x20','<%=\x20config.bin\x20%>\x20code\x20status\x20--thread-id\x20thread_xxx\x20--project-id\x20206\x20--json','Thread:\x20\x20\x20\x20','deploy','stopLoading','2293686PyiabK','170cMNCYf','parse','interrupt','jsonEnabled','messages_count','log','runtime','short_url','enableJsonFlag','4SeazQc'];a14_0x5533=function(){return _0xf9723a;};return a14_0x5533();}export default class CodeStatus extends a14_0x541785{static ['description']=a14_0x3699c3(0x189);static [a14_0x3699c3(0x199)]=!![];static [a14_0x3699c3(0x1b2)]=[a14_0x3699c3(0x1a7),a14_0x3699c3(0x18c)];static ['flags']={'thread-id':Flags['string']({'description':'会话\x20ID','required':!![]}),'project-id':Flags[a14_0x3699c3(0x1b1)]({'description':'项目\x20ID(可选,传入后返回版本和部署信息)'})};async[a14_0x3699c3(0x1a2)](){const _0x4bddad=a14_0x3699c3;await this['requireAuth']();const {flags:_0x4c73c5}=await this[_0x4bddad(0x192)](CodeStatus);!this[_0x4bddad(0x194)]()&&await this[_0x4bddad(0x1b3)](_0x4bddad(0x1a3));try{const _0x46f6ae=await getProjectContext(_0x4c73c5['thread-id'],_0x4c73c5[_0x4bddad(0x1a4)]);return this[_0x4bddad(0x18f)]('查询完成'),!this['jsonEnabled']()&&this[_0x4bddad(0x1a6)](_0x46f6ae),_0x46f6ae;}catch(_0x16d48a){this[_0x4bddad(0x18f)](),this[_0x4bddad(0x1b0)](_0x16d48a instanceof Error?_0x16d48a[_0x4bddad(0x19b)]:String(_0x16d48a));}}['printHuman'](_0x15feb3){const _0x4188b8=a14_0x3699c3;this[_0x4188b8(0x196)](_0x4188b8(0x18d)+_0x15feb3['thread_id']),this[_0x4188b8(0x196)](_0x4188b8(0x1ad)+_0x15feb3[_0x4188b8(0x1a8)][_0x4188b8(0x195)]+_0x4188b8(0x18b)+_0x15feb3[_0x4188b8(0x1a8)]['file_count']+'\x20files,\x20'+_0x15feb3['agent']['tasks_count']+_0x4188b8(0x187));if(_0x15feb3[_0x4188b8(0x193)]['waiting']){const _0x4b6d6d=_0x15feb3[_0x4188b8(0x193)][_0x4188b8(0x19d)]??_0x4188b8(0x1b4);this[_0x4188b8(0x196)](this[_0x4188b8(0x1a5)](_0x4188b8(0x19e)+_0x4b6d6d+'\x22',_0x4188b8(0x19c)));}this[_0x4188b8(0x196)]('Build:\x20\x20\x20\x20\x20'+_0x15feb3[_0x4188b8(0x1b6)][_0x4188b8(0x186)]+(_0x15feb3['build']['message']?_0x4188b8(0x1ab)+_0x15feb3['build'][_0x4188b8(0x19b)]:'')),this[_0x4188b8(0x196)](_0x4188b8(0x1a0)+_0x15feb3[_0x4188b8(0x18e)]['status']+(_0x15feb3['deploy'][_0x4188b8(0x1b5)]?'\x20→\x20'+_0x15feb3[_0x4188b8(0x18e)][_0x4188b8(0x1b5)]:'')),_0x15feb3[_0x4188b8(0x188)][_0x4188b8(0x197)]&&this[_0x4188b8(0x196)]('Runtime:\x20\x20\x20'+_0x15feb3[_0x4188b8(0x188)][_0x4188b8(0x197)]),_0x15feb3[_0x4188b8(0x188)][_0x4188b8(0x198)]&&this[_0x4188b8(0x196)](_0x4188b8(0x1a1)+_0x15feb3[_0x4188b8(0x188)][_0x4188b8(0x198)]);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a15_0x2a6dc6=a15_0x4c47;(function(_0x2f5ee8,_0x58cfba){const _0x296de0=a15_0x4c47,_0x85c346=_0x2f5ee8();while(!![]){try{const _0x381e19=-parseInt(_0x296de0(0x216))/0x1+-parseInt(_0x296de0(0x201))/0x2+parseInt(_0x296de0(0x1f6))/0x3*(parseInt(_0x296de0(0x203))/0x4)+parseInt(_0x296de0(0x1f5))/0x5+-parseInt(_0x296de0(0x1ee))/0x6+parseInt(_0x296de0(0x1fd))/0x7+-parseInt(_0x296de0(0x1dc))/0x8;if(_0x381e19===_0x58cfba)break;else _0x85c346['push'](_0x85c346['shift']());}catch(_0x48d7b8){_0x85c346['push'](_0x85c346['shift']());}}}(a15_0x295f,0xb3e69));import a15_0x9a3de2 from'node:fs';function a15_0x295f(){const _0x1e60e0=['requireAuth','toFixed','2064060sOPuMK','86763lfoxXE','\x20个文件\x20(','路径不存在:\x20','push','\x20KB','reduce','sandbox\x20中的目标目录前缀','8857520KPYKfU','flags','split','content','1170100IAWgEr','收集到\x20','20eAtdgS','examples','startsWith','run','isBuffer','createLoading','map','.hg','sep','parse','readFileSync','.cache','join','skills','.svn','thread-id','basename','prefix','不支持的文件类型:\x20','308033tVEOES','node_modules','collectDirectory','error','log','collectSingleFile','正在上传...','没有可上传的文件','isDirectory','string','<%=\x20config.bin\x20%>\x20code\x20upload\x20--thread-id\x20thread_xxx\x20-d\x20./my-site\x20--json','1139816zlbeft','code','dir','本地文件或目录路径','length','上传完成:\x20','jsonEnabled','\x20个文件','has','relative','enableJsonFlag','/index.html','\x20MB','上传本地文件或目录到云端\x20Agent\x20会话的\x20sandbox','description','stopLoading','isFile','<%=\x20config.bin\x20%>\x20code\x20upload\x20--thread-id\x20thread_xxx\x20-d\x20./index.html\x20--json','302064lUfdPz','collectLocalFiles','name','existsSync','statSync'];a15_0x295f=function(){return _0x1e60e0;};return a15_0x295f();}import a15_0x56ba34 from'node:path';function a15_0x4c47(_0xd640a9,_0x13584c){_0xd640a9=_0xd640a9-0x1d7;const _0x295f0b=a15_0x295f();let _0x4c4744=_0x295f0b[_0xd640a9];return _0x4c4744;}import{Flags}from'@oclif/core';import a15_0x7a2711 from'../../lib/extends/command.js';import{uploadFiles}from'../../lib/service/cloud-agent.js';const EXCLUDE_DIRS=new Set(['.git',a15_0x2a6dc6(0x211),a15_0x2a6dc6(0x20a),a15_0x2a6dc6(0x217),a15_0x2a6dc6(0x20e),'coverage',a15_0x2a6dc6(0x210)]);export default class CodeUpload extends a15_0x7a2711{static [a15_0x2a6dc6(0x1ea)]=a15_0x2a6dc6(0x1e9);static [a15_0x2a6dc6(0x1e6)]=!![];static [a15_0x2a6dc6(0x204)]=[a15_0x2a6dc6(0x1db),a15_0x2a6dc6(0x1ed),'<%=\x20config.bin\x20%>\x20code\x20upload\x20--thread-id\x20thread_xxx\x20-d\x20./dist\x20--prefix\x20code\x20--json'];static [a15_0x2a6dc6(0x1fe)]={'thread-id':Flags['string']({'description':'会话\x20ID','required':!![]}),'dir':Flags[a15_0x2a6dc6(0x1da)]({'char':'d','description':a15_0x2a6dc6(0x1df),'required':!![]}),'prefix':Flags[a15_0x2a6dc6(0x1da)]({'description':a15_0x2a6dc6(0x1fc),'default':a15_0x2a6dc6(0x1dd)})};async[a15_0x2a6dc6(0x206)](){const _0x2ba7af=a15_0x2a6dc6;await this[_0x2ba7af(0x1f3)]();const {flags:_0xd2753d}=await this[_0x2ba7af(0x20c)](CodeUpload),_0x160412=this[_0x2ba7af(0x1e2)](),_0x1bc9b2=a15_0x56ba34['resolve'](_0xd2753d[_0x2ba7af(0x1de)]);!a15_0x9a3de2[_0x2ba7af(0x1f1)](_0x1bc9b2)&&this[_0x2ba7af(0x219)](_0x2ba7af(0x1f8)+_0x1bc9b2);const _0x4a34ed=_0xd2753d[_0x2ba7af(0x214)]['replace'](/\/+$/,'');!_0x160412&&await this['createLoading']('正在收集文件...');const _0x88ac99=this[_0x2ba7af(0x1ef)](_0x1bc9b2,_0x4a34ed);_0x88ac99[_0x2ba7af(0x1e0)]===0x0&&(this[_0x2ba7af(0x1eb)](),this[_0x2ba7af(0x219)](_0x2ba7af(0x1d8)));const _0x12d1db=_0x88ac99[_0x2ba7af(0x1fb)]((_0x2280b7,_0x21db2c)=>{const _0x3abfa6=_0x2ba7af,_0x2e41dd=_0x21db2c[_0x3abfa6(0x200)];return _0x2280b7+(Buffer[_0x3abfa6(0x207)](_0x2e41dd)?_0x2e41dd[_0x3abfa6(0x1e0)]:Buffer['byteLength'](_0x2e41dd));},0x0);!_0x160412&&(this[_0x2ba7af(0x1eb)](_0x2ba7af(0x202)+_0x88ac99[_0x2ba7af(0x1e0)]+_0x2ba7af(0x1f7)+formatBytes(_0x12d1db)+')'),await this[_0x2ba7af(0x208)](_0x2ba7af(0x1d7)));try{await uploadFiles(_0xd2753d[_0x2ba7af(0x212)],_0x88ac99);const _0x35e491=_0x88ac99[_0x2ba7af(0x209)](_0x4e80ed=>_0x4e80ed[_0x2ba7af(0x1f0)]);this[_0x2ba7af(0x1eb)](_0x2ba7af(0x1e1)+_0x88ac99['length']+_0x2ba7af(0x1e3));if(!_0x160412)for(const _0x4aa6e1 of _0x35e491){this[_0x2ba7af(0x21a)]('\x20\x20'+_0x4aa6e1);}return{'thread_id':_0xd2753d[_0x2ba7af(0x212)],'uploaded':_0x88ac99[_0x2ba7af(0x1e0)],'total_bytes':_0x12d1db,'files':_0x35e491,'prefix':_0x4a34ed};}catch(_0xad04a9){this[_0x2ba7af(0x1eb)](),this[_0x2ba7af(0x219)](_0xad04a9 instanceof Error?_0xad04a9['message']:String(_0xad04a9));}}[a15_0x2a6dc6(0x1ef)](_0x12a298,_0x106484){const _0x4e3230=a15_0x2a6dc6,_0xbd2bd6=a15_0x9a3de2[_0x4e3230(0x1f2)](_0x12a298);if(_0xbd2bd6['isFile']())return this[_0x4e3230(0x21b)](_0x12a298,_0x106484);if(_0xbd2bd6[_0x4e3230(0x1d9)]())return this[_0x4e3230(0x218)](_0x12a298,_0x106484);throw new Error(_0x4e3230(0x215)+_0x12a298);}['collectSingleFile'](_0x4e0622,_0x155096){const _0x5f53f0=a15_0x2a6dc6,_0x6dccff=a15_0x56ba34[_0x5f53f0(0x213)](_0x4e0622),_0x55960d=a15_0x9a3de2[_0x5f53f0(0x20d)](_0x4e0622),_0x1a16bb=[{'name':_0x155096+'/'+_0x6dccff,'content':_0x55960d}];return _0x6dccff!=='index.html'&&_0x6dccff['endsWith']('.html')&&_0x1a16bb['push']({'name':_0x155096+_0x5f53f0(0x1e7),'content':_0x55960d}),_0x1a16bb;}[a15_0x2a6dc6(0x218)](_0x117c20,_0x2451da){const _0x361d28=[],_0x359127=_0x5035b6=>{const _0x2bbbbf=a15_0x4c47;for(const _0x40f53d of a15_0x9a3de2['readdirSync'](_0x5035b6,{'withFileTypes':!![]})){if(_0x40f53d[_0x2bbbbf(0x1f0)][_0x2bbbbf(0x205)]('.')&&EXCLUDE_DIRS[_0x2bbbbf(0x1e4)](_0x40f53d[_0x2bbbbf(0x1f0)]))continue;const _0x214bf3=a15_0x56ba34[_0x2bbbbf(0x20f)](_0x5035b6,_0x40f53d[_0x2bbbbf(0x1f0)]);if(_0x40f53d['isDirectory']()){if(EXCLUDE_DIRS[_0x2bbbbf(0x1e4)](_0x40f53d[_0x2bbbbf(0x1f0)]))continue;_0x359127(_0x214bf3);}else{if(_0x40f53d[_0x2bbbbf(0x1ec)]()){const _0x116f66=a15_0x56ba34[_0x2bbbbf(0x1e5)](_0x117c20,_0x214bf3)[_0x2bbbbf(0x1ff)](a15_0x56ba34[_0x2bbbbf(0x20b)])['join']('/');_0x361d28[_0x2bbbbf(0x1f9)]({'name':_0x2451da+'/'+_0x116f66,'content':a15_0x9a3de2[_0x2bbbbf(0x20d)](_0x214bf3)});}}}};return _0x359127(_0x117c20),_0x361d28;}}function formatBytes(_0xed06e9){const _0x3e8b05=a15_0x2a6dc6;if(_0xed06e9<0x400)return _0xed06e9+'\x20B';if(_0xed06e9<0x400*0x400)return(_0xed06e9/0x400)[_0x3e8b05(0x1f4)](0x1)+_0x3e8b05(0x1fa);return(_0xed06e9/(0x400*0x400))[_0x3e8b05(0x1f4)](0x1)+_0x3e8b05(0x1e8);}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a16_0x2dcf16=a16_0x2a3f;(function(_0x52e4f7,_0x49d893){const _0x2eaf9f=a16_0x2a3f,_0x35da40=_0x52e4f7();while(!![]){try{const _0x7f0e86=parseInt(_0x2eaf9f(0x125))/0x1*(-parseInt(_0x2eaf9f(0x152))/0x2)+parseInt(_0x2eaf9f(0x13e))/0x3+parseInt(_0x2eaf9f(0x134))/0x4+-parseInt(_0x2eaf9f(0x14a))/0x5+-parseInt(_0x2eaf9f(0x126))/0x6+parseInt(_0x2eaf9f(0x15d))/0x7*(-parseInt(_0x2eaf9f(0x142))/0x8)+parseInt(_0x2eaf9f(0x127))/0x9;if(_0x7f0e86===_0x49d893)break;else _0x35da40['push'](_0x35da40['shift']());}catch(_0x1fec96){_0x35da40['push'](_0x35da40['shift']());}}}(a16_0x2623,0x5d571));import{Flags}from'@oclif/core';import a16_0x3cd22f from'../../lib/extends/command.js';function a16_0x2a3f(_0x4f119f,_0x1bbe19){_0x4f119f=_0x4f119f-0x122;const _0x2623a2=a16_0x2623();let _0x2a3f8f=_0x2623a2[_0x4f119f];return _0x2a3f8f;}import{setDeploymentVisibility,getDeploymentVisibility,lookupDeployment}from'../../lib/service/manage.js';function a16_0x2623(){const _0x325fe0=['3578425hDARXC','stopLoading','项目\x20ID(与\x20--url\x20二选一)','<%=\x20config.bin\x20%>\x20code\x20visibility\x20--project-id\x20477\x20--json','grant','string','仅自己可见','正在设置可见范围为「','44guULoQ','项目\x20','parseGrants','\x0a格式应为:\x20https://o.wpsgo.com/app/<company_id>/<short_slug>/','examples','<%=\x20config.bin\x20%>\x20code\x20visibility\x20--project-id\x20477\x20--set\x20private','...','log','请提供\x20--project-id\x20或\x20--url\x20参数','jsonEnabled','flags','161CKlRXR','应用短链\x20URL(与\x20--project-id\x20二选一)','visibility','<%=\x20config.bin\x20%>\x20code\x20visibility\x20--url\x20https://o.wpsgo.com/app/41000207/6Ne2UkWT3ytn/\x20--set\x20private','requireAuth','message','project_id','error','正在查询\x20','company','user','length','4418BwuFrc','3949548EPdEac','15285951NwFEyD','resolveProjectId','parse','指定成员或团队可见','已设置为:\x20','无法解析短链:\x20','createLoading','slice','private','grant_type','设置可见范围:\x20private\x20|\x20company\x20|\x20custom','failed','查询完成','1384340xtPIsU','」...','access_grants','授权列表:',':\x20缺少\x20ID','companyId','shortSlug','企业内可见','custom','enableJsonFlag','1000491RaUVtu','正在查询可见范围...','project-id','grant_target','182456mRuDvk','\x22,仅支持\x20user\x20或\x20team','url','--grant\x20','查看或设置项目的发布可见范围(仅自己\x20/\x20企业内\x20/\x20指定成员或团队)','set','无效的\x20--grant\x20格式:\x20\x22','showVisibility'];a16_0x2623=function(){return _0x325fe0;};return a16_0x2623();}const VALID_VISIBILITY=[a16_0x2dcf16(0x12f),a16_0x2dcf16(0x122),a16_0x2dcf16(0x13c)],VISIBILITY_LABELS={'private':a16_0x2dcf16(0x150),'company':a16_0x2dcf16(0x13b),'custom':a16_0x2dcf16(0x12a)};function parseShortUrl(_0x44c6c6){const _0xa2b99=_0x44c6c6['match'](/\/app\/([^/]+)\/([^/]+)/);return _0xa2b99?{'companyId':_0xa2b99[0x1],'shortSlug':_0xa2b99[0x2]}:null;}export default class CodeVisibility extends a16_0x3cd22f{static ['description']=a16_0x2dcf16(0x146);static [a16_0x2dcf16(0x13d)]=!![];static [a16_0x2dcf16(0x156)]=[a16_0x2dcf16(0x14d),a16_0x2dcf16(0x157),'<%=\x20config.bin\x20%>\x20code\x20visibility\x20--project-id\x20477\x20--set\x20company\x20--json','<%=\x20config.bin\x20%>\x20code\x20visibility\x20--project-id\x20477\x20--set\x20custom\x20--grant\x20user:100002\x20--grant\x20team:100003',a16_0x2dcf16(0x160)];static [a16_0x2dcf16(0x15c)]={'project-id':Flags['integer']({'description':a16_0x2dcf16(0x14c)}),'url':Flags['string']({'description':a16_0x2dcf16(0x15e)}),'set':Flags[a16_0x2dcf16(0x14f)]({'description':a16_0x2dcf16(0x131),'options':VALID_VISIBILITY}),'grant':Flags[a16_0x2dcf16(0x14f)]({'description':'授权对象,格式为\x20<type>:<id>(如\x20user:100002\x20或\x20team:100003),可多次指定;仅\x20--set\x20custom\x20时有效','multiple':!![]})};async['run'](){const _0xd5615c=a16_0x2dcf16;await this[_0xd5615c(0x161)]();const {flags:_0x47d29d}=await this[_0xd5615c(0x129)](CodeVisibility),_0x31fbca=this[_0xd5615c(0x15b)]();try{const _0x5119fe=await this[_0xd5615c(0x128)](_0x47d29d,_0x31fbca),_0xd2059=_0x47d29d[_0xd5615c(0x147)];if(!_0xd2059)return this['showVisibility'](_0x5119fe,_0x31fbca);return this['updateVisibility'](_0x5119fe,_0xd2059,_0x47d29d[_0xd5615c(0x14e)],_0x31fbca);}catch(_0x5b88e0){this['stopLoading']();const _0x5911ca=_0x5b88e0 instanceof Error?_0x5b88e0[_0xd5615c(0x162)]:String(_0x5b88e0);if(_0x31fbca)return{'status':_0xd5615c(0x132),'project_id':_0x47d29d[_0xd5615c(0x140)]??0x0,'visibility':'','error':_0x5911ca};this[_0xd5615c(0x164)](_0x5911ca);}}async[a16_0x2dcf16(0x128)](_0x1cc9f0,_0x2a239f){const _0x1c432c=a16_0x2dcf16;if(_0x1cc9f0[_0x1c432c(0x140)])return _0x1cc9f0[_0x1c432c(0x140)];if(_0x1cc9f0[_0x1c432c(0x144)]){const _0x172dd3=parseShortUrl(_0x1cc9f0[_0x1c432c(0x144)]);if(!_0x172dd3)throw new Error(_0x1c432c(0x12c)+_0x1cc9f0[_0x1c432c(0x144)]+_0x1c432c(0x155));if(!_0x2a239f)await this['createLoading'](_0x1c432c(0x165)+_0x172dd3[_0x1c432c(0x139)]+'/'+_0x172dd3['shortSlug']+_0x1c432c(0x158));const _0x5edab3=await lookupDeployment(_0x172dd3[_0x1c432c(0x139)],_0x172dd3[_0x1c432c(0x13a)]);if(!_0x2a239f)this[_0x1c432c(0x14b)]('找到项目\x20'+_0x5edab3[_0x1c432c(0x163)]);return _0x5edab3[_0x1c432c(0x163)];}throw new Error(_0x1c432c(0x15a));}async[a16_0x2dcf16(0x149)](_0x1411f4,_0x5a1440){const _0xfa42dc=a16_0x2dcf16;if(!_0x5a1440)await this[_0xfa42dc(0x12d)](_0xfa42dc(0x13f));const _0x3cdf08=await getDeploymentVisibility(_0x1411f4);if(!_0x5a1440){this[_0xfa42dc(0x14b)](_0xfa42dc(0x133)),this[_0xfa42dc(0x159)](_0xfa42dc(0x153)+_0x1411f4+'\x20的可见范围:\x20'+(VISIBILITY_LABELS[_0x3cdf08[_0xfa42dc(0x15f)]]??_0x3cdf08[_0xfa42dc(0x15f)]));if(_0x3cdf08[_0xfa42dc(0x15f)]===_0xfa42dc(0x13c)&&_0x3cdf08[_0xfa42dc(0x136)]?.[_0xfa42dc(0x124)]){this['log'](_0xfa42dc(0x137));for(const _0x3d2887 of _0x3cdf08[_0xfa42dc(0x136)]){this[_0xfa42dc(0x159)]('\x20\x20'+_0x3d2887[_0xfa42dc(0x130)]+':\x20'+_0x3d2887[_0xfa42dc(0x141)]);}}}return{'status':'ok','project_id':_0x1411f4,'visibility':_0x3cdf08[_0xfa42dc(0x15f)],'access_grants':_0x3cdf08[_0xfa42dc(0x136)]};}async['updateVisibility'](_0xdeaf2f,_0x4b7f20,_0x5dac5f,_0x103f7c){const _0x49ab29=a16_0x2dcf16;let _0x19f646;if(_0x4b7f20===_0x49ab29(0x13c)){_0x19f646=this[_0x49ab29(0x154)](_0x5dac5f);if(_0x19f646[_0x49ab29(0x124)]===0x0)throw new Error('--set\x20custom\x20需要至少一个\x20--grant\x20参数,格式:\x20--grant\x20user:<id>\x20或\x20--grant\x20team:<id>');}!_0x103f7c&&await this[_0x49ab29(0x12d)](_0x49ab29(0x151)+VISIBILITY_LABELS[_0x4b7f20]+_0x49ab29(0x135));const _0x5cd21e=await setDeploymentVisibility(_0xdeaf2f,_0x4b7f20,_0x19f646);if(!_0x103f7c){this[_0x49ab29(0x14b)](_0x49ab29(0x12b)+VISIBILITY_LABELS[_0x5cd21e['visibility']]);if(_0x5cd21e[_0x49ab29(0x15f)]==='custom'&&_0x5cd21e[_0x49ab29(0x136)]?.[_0x49ab29(0x124)]){this['log'](_0x49ab29(0x137));for(const _0x2ce385 of _0x5cd21e['access_grants']){this[_0x49ab29(0x159)]('\x20\x20'+_0x2ce385['grant_type']+':\x20'+_0x2ce385[_0x49ab29(0x141)]);}}}return{'status':'ok','project_id':_0xdeaf2f,'visibility':_0x5cd21e['visibility'],'access_grants':_0x5cd21e[_0x49ab29(0x136)]};}[a16_0x2dcf16(0x154)](_0x25df7b){const _0xebeb57=a16_0x2dcf16;if(!_0x25df7b?.[_0xebeb57(0x124)])return[];return _0x25df7b['map'](_0x3f9002=>{const _0x4478e6=_0xebeb57,_0x5f26de=_0x3f9002['indexOf'](':');if(_0x5f26de===-0x1)throw new Error(_0x4478e6(0x148)+_0x3f9002+'\x22,应为\x20user:<id>\x20或\x20team:<id>');const _0x462047=_0x3f9002[_0x4478e6(0x12e)](0x0,_0x5f26de),_0x46e160=_0x3f9002['slice'](_0x5f26de+0x1);if(_0x462047!==_0x4478e6(0x123)&&_0x462047!=='team')throw new Error('无效的授权类型:\x20\x22'+_0x462047+_0x4478e6(0x143));if(!_0x46e160)throw new Error(_0x4478e6(0x145)+_0x462047+_0x4478e6(0x138));return{'grant_type':_0x462047,'grant_target':_0x46e160};});}}
|
package/dist/commands/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a17_0x5279(_0x5c8118,_0x51044c){_0x5c8118=_0x5c8118-0xef;const _0xcf2b49=a17_0xcf2b();let _0x527966=_0xcf2b49[_0x5c8118];return _0x527966;}const a17_0x2330d9=a17_0x5279;(function(_0x258c55,_0x19f414){const _0xb23acd=a17_0x5279,_0x525de0=_0x258c55();while(!![]){try{const _0x42ba4a=parseInt(_0xb23acd(0xfa))/0x1*(-parseInt(_0xb23acd(0xef))/0x2)+-parseInt(_0xb23acd(0x10f))/0x3*(parseInt(_0xb23acd(0x110))/0x4)+parseInt(_0xb23acd(0xf1))/0x5*(-parseInt(_0xb23acd(0xff))/0x6)+parseInt(_0xb23acd(0xf7))/0x7*(-parseInt(_0xb23acd(0x10e))/0x8)+-parseInt(_0xb23acd(0x100))/0x9+parseInt(_0xb23acd(0x102))/0xa+parseInt(_0xb23acd(0x10d))/0xb;if(_0x42ba4a===_0x19f414)break;else _0x525de0['push'](_0x525de0['shift']());}catch(_0xdb5595){_0x525de0['push'](_0x525de0['shift']());}}}(a17_0xcf2b,0x1b933));import{execSync}from'node:child_process';function a17_0xcf2b(){const _0x361967=['112dyoIpy','98277Rrlvzr','16WRYurS','utf-8','发现新版本:\x20v','run','\x20...','17502saiCKB','cyan','5CZBoVc','npm\x20view\x20@wps365-open/comate-cli\x20version\x20--registry=https://registry.npmjs.org/','../../package.json','更新成功:\x20v','colorize','pipe','101696caoBTW','\x0a手动更新:\x20npm\x20install\x20-g\x20@wps365-open/comate-cli@latest','error','20uYxtzM','正在更新\x20v','enableJsonFlag','node:module','更新\x20comate-cli\x20到最新版本','1067028bQSNtS','422307mMmjHO','已是最新版本\x20v','437020MGvueK','version','无法获取最新版本信息,请检查网络连接','stopLoading','更新失败:\x20','jsonEnabled','log','\x20→\x20v','当前版本:\x20','message','createLoading','8837994TPjwiv'];a17_0xcf2b=function(){return _0x361967;};return a17_0xcf2b();}import a17_0x3d41d6 from'../lib/extends/command.js';export default class Update extends a17_0x3d41d6{static ['description']=a17_0x2330d9(0xfe);static [a17_0x2330d9(0xfc)]=!![];async[a17_0x2330d9(0x113)](){const _0x16c6c7=a17_0x2330d9;await this['parse'](Update);const {createRequire:_0x5059bf}=await import(_0x16c6c7(0xfd)),_0x21844d=_0x5059bf(import.meta.url),_0x3ff5a3=_0x21844d(_0x16c6c7(0xf3)),_0x1abc32=_0x3ff5a3[_0x16c6c7(0x103)];!this[_0x16c6c7(0x107)]()&&(this[_0x16c6c7(0x108)](_0x16c6c7(0x10a)+this[_0x16c6c7(0xf5)]('v'+_0x1abc32,_0x16c6c7(0xf0))),await this[_0x16c6c7(0x10c)]('正在检查最新版本...'));let _0x53473a;try{_0x53473a=execSync(_0x16c6c7(0xf2),{'encoding':_0x16c6c7(0x111),'timeout':0x3a98})['trim']();}catch{this['stopLoading'](),this[_0x16c6c7(0xf9)](_0x16c6c7(0x104));}if(_0x53473a===_0x1abc32)return this[_0x16c6c7(0x105)](_0x16c6c7(0x101)+_0x1abc32),{'previousVersion':_0x1abc32,'currentVersion':_0x1abc32,'updated':![]};!this[_0x16c6c7(0x107)]()&&(this[_0x16c6c7(0x105)](_0x16c6c7(0x112)+_0x53473a),await this[_0x16c6c7(0x10c)](_0x16c6c7(0xfb)+_0x1abc32+_0x16c6c7(0x109)+_0x53473a+_0x16c6c7(0x114)));try{return execSync('npm\x20install\x20-g\x20@wps365-open/comate-cli@latest\x20--registry=https://registry.npmjs.org/',{'encoding':_0x16c6c7(0x111),'timeout':0xea60,'stdio':_0x16c6c7(0xf6)}),this[_0x16c6c7(0x105)](_0x16c6c7(0xf4)+_0x1abc32+'\x20→\x20v'+_0x53473a),{'previousVersion':_0x1abc32,'currentVersion':_0x53473a,'updated':!![]};}catch(_0x36f329){this['stopLoading'](),this[_0x16c6c7(0xf9)](_0x16c6c7(0x106)+(_0x36f329 instanceof Error?_0x36f329[_0x16c6c7(0x10b)]:String(_0x36f329))+_0x16c6c7(0xf8));}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a18_0x4212(){const _0x19aa31=['parseInt','exit','5305208uxiCcz','8691525UcDaJp','2012326mpSYIl','3XKHIRy','max','log','2472745TumCJg','min','336JfKCEX','env','7qnByna','SIGTERM','SIGINT','1137444RwpZrX','133508dwdirl'];a18_0x4212=function(){return _0x19aa31;};return a18_0x4212();}(function(_0x3617e2,_0x41e64b){const _0x451da9=a18_0x276b,_0x4fc613=_0x3617e2();while(!![]){try{const _0x8b6c07=parseInt(_0x451da9(0x172))/0x1+-parseInt(_0x451da9(0x166))/0x2*(-parseInt(_0x451da9(0x167))/0x3)+-parseInt(_0x451da9(0x16c))/0x4+-parseInt(_0x451da9(0x16a))/0x5+parseInt(_0x451da9(0x171))/0x6+parseInt(_0x451da9(0x16e))/0x7*(parseInt(_0x451da9(0x175))/0x8)+-parseInt(_0x451da9(0x176))/0x9;if(_0x8b6c07===_0x41e64b)break;else _0x4fc613['push'](_0x4fc613['shift']());}catch(_0x307341){_0x4fc613['push'](_0x4fc613['shift']());}}}(a18_0x4212,0x81e46));import{randomUUID}from'node:crypto';import{join}from'node:path';import{homedir}from'node:os';import{NewLoggerWithLevel,CleanLogFile}from'../../lib/log/logger.js';import{COMATE_DIR_NAME,ENV_VERBOSE}from'../../lib/config/constants.js';function a18_0x276b(_0x4a19b5,_0x5a5401){_0x4a19b5=_0x4a19b5-0x166;const _0x42129c=a18_0x4212();let _0x276b24=_0x42129c[_0x4a19b5];return _0x276b24;}const LOG_SUFFIX='.log',hook=async function(){const _0x4d5d81=a18_0x276b,_0x398f92=0x3,_0xdac867=process[_0x4d5d81(0x16d)][ENV_VERBOSE],_0x1cbbc5=_0xdac867?Math[_0x4d5d81(0x16b)](0x5,Math[_0x4d5d81(0x168)](0x1,Number[_0x4d5d81(0x173)](_0xdac867,0xa)||_0x398f92)):_0x398f92,_0x5909b1=randomUUID(),_0x420dea=join(homedir(),COMATE_DIR_NAME,_0x4d5d81(0x169),''+_0x5909b1+LOG_SUFFIX);NewLoggerWithLevel(_0x1cbbc5,_0x420dea);const _0x5ae376=()=>{CleanLogFile();};process['on'](_0x4d5d81(0x174),_0x5ae376),process['on'](_0x4d5d81(0x170),()=>{const _0x455185=_0x4d5d81;_0x5ae376(),process[_0x455185(0x174)](0x82);}),process['on'](_0x4d5d81(0x16f),()=>{const _0x3791df=_0x4d5d81;_0x5ae376(),process[_0x3791df(0x174)](0x8f);});};export default hook;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x24d39a,_0x2608d4){const _0x3879a5=a19_0x23bf,_0x965753=_0x24d39a();while(!![]){try{const _0x490936=parseInt(_0x3879a5(0x127))/0x1*(parseInt(_0x3879a5(0x126))/0x2)+-parseInt(_0x3879a5(0x129))/0x3+-parseInt(_0x3879a5(0x130))/0x4*(parseInt(_0x3879a5(0x12a))/0x5)+parseInt(_0x3879a5(0x134))/0x6+parseInt(_0x3879a5(0x123))/0x7*(parseInt(_0x3879a5(0x121))/0x8)+-parseInt(_0x3879a5(0x122))/0x9*(-parseInt(_0x3879a5(0x11f))/0xa)+-parseInt(_0x3879a5(0x132))/0xb*(-parseInt(_0x3879a5(0x12e))/0xc);if(_0x490936===_0x2608d4)break;else _0x965753['push'](_0x965753['shift']());}catch(_0x211427){_0x965753['push'](_0x965753['shift']());}}}(a19_0x406e,0x758cc));async function checkForUpdates(_0x1dd197){const _0x575d81=a19_0x23bf;try{const _0x41b022=await fetch(_0x575d81(0x125),{'signal':AbortSignal[_0x575d81(0x12d)](0x7d0)});if(!_0x41b022['ok'])return{'hasUpdate':![],'currentVersion':_0x1dd197,'latestVersion':_0x1dd197};const _0x3b29f4=await _0x41b022[_0x575d81(0x124)](),_0x369339=_0x3b29f4[_0x575d81(0x120)];return{'hasUpdate':_0x369339!==_0x1dd197,'currentVersion':_0x1dd197,'latestVersion':_0x369339};}catch{return{'hasUpdate':![],'currentVersion':_0x1dd197,'latestVersion':_0x1dd197};}}const hook=async function(_0xa29ae3){const _0x16a9ce=a19_0x23bf,_0x1bc96f=_0xa29ae3[_0x16a9ce(0x12c)]['version'],_0x2a0e1e={'hasUpdate':![],'currentVersion':_0x1bc96f,'latestVersion':_0x1bc96f},_0x2c0952=await Promise['race']([checkForUpdates(_0x1bc96f),new Promise(_0x4640ab=>setTimeout(()=>_0x4640ab(_0x2a0e1e),0x7d0))]);if(_0x2c0952['hasUpdate']){const _0xa049b6=process[_0x16a9ce(0x133)][0x1]?.[_0x16a9ce(0x12b)](_0x16a9ce(0x131));if(_0xa049b6)return;this[_0x16a9ce(0x128)]('\x0a\x20\x20更新可用:\x20'+_0x2c0952['currentVersion']+_0x16a9ce(0x135)+_0x2c0952['latestVersion']),this[_0x16a9ce(0x128)](_0x16a9ce(0x12f));}};function a19_0x23bf(_0x215a56,_0x457323){_0x215a56=_0x215a56-0x11f;const _0x406e4b=a19_0x406e();let _0x23bf18=_0x406e4b[_0x215a56];return _0x23bf18;}export default hook;function a19_0x406e(){const _0x4f6545=['159442OIsRDg','6EvLCwI','log','2728671zSDzyA','25SjNrrF','includes','config','timeout','735096dCNUqP','\x20\x20请运行\x20comate-cli\x20update\x20进行更新\x0a','190348skQCTZ','_npx','11UoHydw','argv','3593394vVCnMO','\x20→\x20','59490RNrgOl','version','8wzxONK','243UtpqFr','2309090KKYtso','json','https://registry.npmjs.org/@wps365-open/comate-cli/latest'];a19_0x406e=function(){return _0x4f6545;};return a19_0x406e();}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a20_0x4af3(_0x22f577,_0x57f384){_0x22f577=_0x22f577-0x101;var _0x12339f=a20_0x1233();var _0x4af3fc=_0x12339f[_0x22f577];return _0x4af3fc;}(function(_0x4c9eea,_0x310537){var _0xcd9c49=a20_0x4af3,_0x40086b=_0x4c9eea();while(!![]){try{var _0x5b4e5b=parseInt(_0xcd9c49(0x105))/0x1+-parseInt(_0xcd9c49(0x103))/0x2+-parseInt(_0xcd9c49(0x101))/0x3+-parseInt(_0xcd9c49(0x108))/0x4*(-parseInt(_0xcd9c49(0x109))/0x5)+-parseInt(_0xcd9c49(0x107))/0x6*(-parseInt(_0xcd9c49(0x102))/0x7)+parseInt(_0xcd9c49(0x106))/0x8+-parseInt(_0xcd9c49(0x104))/0x9;if(_0x5b4e5b===_0x310537)break;else _0x40086b['push'](_0x40086b['shift']());}catch(_0x19d225){_0x40086b['push'](_0x40086b['shift']());}}}(a20_0x1233,0x328e0));export{run}from'@oclif/core';function a20_0x1233(){var _0x28f976=['245210OxkIUr','890352pQlwiD','114BqNgqs','4ukQZTN','640335UpKZdF','373635DRAsEs','39634qSdtmy','35766ryVwKY','2183841DWOuot'];a20_0x1233=function(){return _0x28f976;};return a20_0x1233();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2f2a0f,_0x234dc8){const _0x5e107a=a21_0x3afc,_0x19fbd6=_0x2f2a0f();while(!![]){try{const _0x14b812=-parseInt(_0x5e107a(0xcb))/0x1+parseInt(_0x5e107a(0xc1))/0x2+-parseInt(_0x5e107a(0xb0))/0x3+parseInt(_0x5e107a(0xc7))/0x4+-parseInt(_0x5e107a(0xce))/0x5*(parseInt(_0x5e107a(0xc8))/0x6)+parseInt(_0x5e107a(0xb2))/0x7*(-parseInt(_0x5e107a(0xab))/0x8)+parseInt(_0x5e107a(0xbe))/0x9;if(_0x14b812===_0x234dc8)break;else _0x19fbd6['push'](_0x19fbd6['shift']());}catch(_0x1f6085){_0x19fbd6['push'](_0x19fbd6['shift']());}}}(a21_0x5bf2,0xcdb05));import a21_0x24ecde from'node:http';import{randomUUID}from'node:crypto';import a21_0x37df18 from'open';import{configManager}from'../config/manager.js';function a21_0x3afc(_0xbd95f5,_0x44ff1b){_0xbd95f5=_0xbd95f5-0xa6;const _0x5bf2df=a21_0x5bf2();let _0x3afc47=_0x5bf2df[_0xbd95f5];return _0x3afc47;}import{getUserToken,getCurrentUser}from'../service/auth.js';import{AGENTSPACE_BASE,WPS_ACCOUNT_BASE,OAUTH_PORT_MIN,OAUTH_PORT_MAX,OAUTH_TIMEOUT_MS}from'../config/constants.js';function a21_0x5bf2(){const _0x514859=['2576019okokxv','登录超时(60\x20秒),请重试','2389303wsWcEj','回调参数不完整,请重试','end','code','\x20被占用,请重试','http://localhost:','writeHead','/?cb=','?cb=','/v7/devhub/users/login_callback','get','url','24324570IinasP','端口\x20','启动本地服务器失败:\x20','2417862JHbekt','app_id','createServer','random','pathname','/oauth-callback','2012832iKLjvJ','2170140gAiwzq','close','&state=','986689tUBTSm','saveSid','<html><body><h2>登录成功,请返回终端继续操作</h2><script>setTimeout(()=>window.close(),1000)</script></body></html>','5ijdlbF','无法打开浏览器:\x20','text/html;\x20charset=utf-8','state','message','searchParams','32XgTmdG','登录状态校验失败,请重试','nickname','EADDRINUSE','error'];a21_0x5bf2=function(){return _0x514859;};return a21_0x5bf2();}function pickPort(){const _0x170043=a21_0x3afc;return OAUTH_PORT_MIN+Math['floor'](Math[_0x170043(0xc4)]()*(OAUTH_PORT_MAX-OAUTH_PORT_MIN+0x1));}function buildLoginUrl(_0x3c766d,_0x4dab78){const _0x16a2b2=a21_0x3afc,_0x4f4324=AGENTSPACE_BASE+_0x16a2b2(0xbb)+(_0x16a2b2(0xba)+encodeURIComponent(_0x4dab78)+_0x16a2b2(0xca)+_0x3c766d);return WPS_ACCOUNT_BASE+_0x16a2b2(0xb9)+encodeURIComponent(_0x4f4324);}export async function loginWithBrowser(){const _0x5f2ebb=a21_0x3afc,_0x3fb846=pickPort(),_0x57dec0=randomUUID(),_0x48f17f=_0x5f2ebb(0xb7)+_0x3fb846+_0x5f2ebb(0xc6),_0x1836c3=await new Promise((_0x444558,_0x28f402)=>{const _0xfd4ee7=_0x5f2ebb,_0xf28dee=setTimeout(()=>{const _0x3f7489=a21_0x3afc;_0x37cdaf[_0x3f7489(0xc9)](),_0x28f402(new Error(_0x3f7489(0xb1)));},OAUTH_TIMEOUT_MS),_0x37cdaf=a21_0x24ecde[_0xfd4ee7(0xc3)]((_0x322a07,_0x2f04cb)=>{const _0x382b3e=_0xfd4ee7,_0x3fd486=new URL(_0x322a07[_0x382b3e(0xbd)],_0x382b3e(0xb7)+_0x3fb846);if(_0x3fd486[_0x382b3e(0xc5)]!==_0x382b3e(0xc6)){_0x2f04cb['writeHead'](0x194),_0x2f04cb[_0x382b3e(0xb4)]();return;}const _0x18457b=_0x3fd486[_0x382b3e(0xaa)]['get'](_0x382b3e(0xb5)),_0x40caff=_0x3fd486[_0x382b3e(0xaa)][_0x382b3e(0xbc)]('state'),_0x263e06=_0x3fd486['searchParams'][_0x382b3e(0xbc)](_0x382b3e(0xc2));_0x2f04cb[_0x382b3e(0xb8)](0xc8,{'Content-Type':_0x382b3e(0xa7)}),_0x2f04cb[_0x382b3e(0xb4)](_0x382b3e(0xcd)),clearTimeout(_0xf28dee),_0x37cdaf[_0x382b3e(0xc9)](),!_0x18457b||!_0x40caff||!_0x263e06?_0x28f402(new Error(_0x382b3e(0xb3))):_0x444558({'code':_0x18457b,'state':_0x40caff,'app_id':_0x263e06});});_0x37cdaf['listen'](_0x3fb846,'127.0.0.1',async()=>{const _0x17de6a=_0xfd4ee7;try{const _0x522188=buildLoginUrl(_0x57dec0,_0x48f17f);await a21_0x37df18(_0x522188);}catch(_0xbd5bc6){clearTimeout(_0xf28dee),_0x37cdaf['close'](),_0x28f402(new Error(_0x17de6a(0xa6)+(_0xbd5bc6 instanceof Error?_0xbd5bc6[_0x17de6a(0xa9)]:String(_0xbd5bc6))));}}),_0x37cdaf['on'](_0xfd4ee7(0xaf),_0x55df4f=>{const _0x35208b=_0xfd4ee7;clearTimeout(_0xf28dee),_0x55df4f[_0x35208b(0xb5)]===_0x35208b(0xae)?_0x28f402(new Error(_0x35208b(0xbf)+_0x3fb846+_0x35208b(0xb6))):_0x28f402(new Error(_0x35208b(0xc0)+_0x55df4f['message']));});});if(_0x1836c3['state']!==_0x57dec0)throw new Error(_0x5f2ebb(0xac));const _0x878fd7=await getUserToken(_0x1836c3[_0x5f2ebb(0xc2)],_0x1836c3[_0x5f2ebb(0xb5)],_0x1836c3[_0x5f2ebb(0xa8)]);configManager[_0x5f2ebb(0xcc)](_0x878fd7);const _0x308023=await getCurrentUser();return configManager['saveUserInfo'](_0x308023),{'sid':_0x878fd7,'nickname':_0x308023[_0x5f2ebb(0xad)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a22_0x57258f=a22_0x5da9;(function(_0x1b0a8b,_0x4c8b64){const _0x3d8e83=a22_0x5da9,_0x46f954=_0x1b0a8b();while(!![]){try{const _0x38f692=-parseInt(_0x3d8e83(0xc8))/0x1*(parseInt(_0x3d8e83(0xc5))/0x2)+-parseInt(_0x3d8e83(0xb8))/0x3+parseInt(_0x3d8e83(0xc2))/0x4+-parseInt(_0x3d8e83(0xca))/0x5*(parseInt(_0x3d8e83(0xc3))/0x6)+parseInt(_0x3d8e83(0xb9))/0x7*(-parseInt(_0x3d8e83(0xcb))/0x8)+parseInt(_0x3d8e83(0xbf))/0x9*(-parseInt(_0x3d8e83(0xb6))/0xa)+-parseInt(_0x3d8e83(0xbb))/0xb*(-parseInt(_0x3d8e83(0xbe))/0xc);if(_0x38f692===_0x4c8b64)break;else _0x46f954['push'](_0x46f954['shift']());}catch(_0x17a67e){_0x46f954['push'](_0x46f954['shift']());}}}(a22_0x317e,0x76bb8));import a22_0x4a7a86 from'node:path';import{homedir}from'node:os';export const COMATE_DIR_NAME=a22_0x57258f(0xc6);export const COMATE_HOME=a22_0x4a7a86[a22_0x57258f(0xb7)](homedir(),COMATE_DIR_NAME);export const CONFIG_FILE=a22_0x4a7a86[a22_0x57258f(0xb7)](COMATE_HOME,a22_0x57258f(0xc4));export const LOG_DIR=a22_0x4a7a86[a22_0x57258f(0xb7)](COMATE_HOME,a22_0x57258f(0xc7));export const ENV_VERBOSE=a22_0x57258f(0xc9);export const AGENTSPACE_BASE=a22_0x57258f(0xba);export const APP_STUDIO_BASE=a22_0x57258f(0xc0);export const WPS_ACCOUNT_BASE=a22_0x57258f(0xbc);function a22_0x5da9(_0x3a7daa,_0x211b98){_0x3a7daa=_0x3a7daa-0xb6;const _0x317ec2=a22_0x317e();let _0x5da9f6=_0x317ec2[_0x3a7daa];return _0x5da9f6;}export const OPEN_PLATFORM_BASE=a22_0x57258f(0xc1);function a22_0x317e(){const _0x3d09e5=['377748IwhGYF','450NBxdqZ','config.json','3088UhIxnZ','.comate-cli','log','482hXCTon','COMATE_VERBOSE','25125hfTDzj','32IjLKMF','2100580vxYvGa','join','278889whwEmO','794066VgGtME','https://agentspace.wps.cn','281215pOizkP','https://account.wps.cn','https://o.wpsgo.com/app-studio/runtime','1164ftwPQi','18RaxpDH','https://open.wps.cn/app-studio','https://365.kdocs.cn/3rd/open'];a22_0x317e=function(){return _0x3d09e5;};return a22_0x317e();}export const RUNTIME_BASE=a22_0x57258f(0xbd);export const OAUTH_PORT_MIN=0x2e0f;export const OAUTH_PORT_MAX=0x2e22;export const OAUTH_TIMEOUT_MS=0xea60;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a23_0xf423c7=a23_0x45e1;(function(_0x52d674,_0x4e177c){const _0x2960ff=a23_0x45e1,_0x1c91e9=_0x52d674();while(!![]){try{const _0x30a61a=-parseInt(_0x2960ff(0xe8))/0x1*(parseInt(_0x2960ff(0xc9))/0x2)+parseInt(_0x2960ff(0xf3))/0x3*(parseInt(_0x2960ff(0xf7))/0x4)+parseInt(_0x2960ff(0xcb))/0x5*(parseInt(_0x2960ff(0xce))/0x6)+-parseInt(_0x2960ff(0xe7))/0x7+parseInt(_0x2960ff(0xd7))/0x8*(parseInt(_0x2960ff(0xf4))/0x9)+parseInt(_0x2960ff(0xf0))/0xa*(-parseInt(_0x2960ff(0xef))/0xb)+parseInt(_0x2960ff(0xd8))/0xc*(-parseInt(_0x2960ff(0xed))/0xd);if(_0x30a61a===_0x4e177c)break;else _0x1c91e9['push'](_0x1c91e9['shift']());}catch(_0x185ae3){_0x1c91e9['push'](_0x1c91e9['shift']());}}}(a23_0x1140,0x81a2f));import a23_0x59e038 from'node:crypto';import a23_0x5c674c from'node:fs';function a23_0x45e1(_0x4bb1fd,_0x4fa351){_0x4bb1fd=_0x4bb1fd-0xc8;const _0x114058=a23_0x1140();let _0x45e16a=_0x114058[_0x4bb1fd];return _0x45e16a;}import{homedir}from'node:os';import a23_0x3dc120 from'node:path';import{CONFIG_FILE}from'./constants.js';const PI_CLIENT_AUTH_PATH=a23_0x3dc120[a23_0xf423c7(0xeb)](homedir(),a23_0xf423c7(0xde),a23_0xf423c7(0xe9),a23_0xf423c7(0xf1),a23_0xf423c7(0xdd)),PI_CLIENT_KEY=Buffer[a23_0xf423c7(0xd6)](a23_0xf423c7(0xd0),a23_0xf423c7(0xc8)),GCM_NONCE_LEN=0xc,GCM_TAG_LEN=0x10;function decryptPiClientToken(_0x23748c){const _0x2f6950=a23_0xf423c7,_0x2994b9=Buffer[_0x2f6950(0xd6)](_0x23748c['trim'](),'base64');if(_0x2994b9[_0x2f6950(0xe5)]<=GCM_NONCE_LEN+GCM_TAG_LEN)throw new Error('invalid\x20ciphertext');const _0x21816b=_0x2994b9[_0x2f6950(0xd2)](0x0,GCM_NONCE_LEN),_0x187de2=_0x2994b9[_0x2f6950(0xd2)](GCM_NONCE_LEN,_0x2994b9[_0x2f6950(0xe5)]-GCM_TAG_LEN),_0x3c6b7e=_0x2994b9[_0x2f6950(0xd2)](_0x2994b9[_0x2f6950(0xe5)]-GCM_TAG_LEN),_0x3a112e=a23_0x59e038[_0x2f6950(0xdb)]('aes-256-gcm',PI_CLIENT_KEY,_0x21816b);return _0x3a112e[_0x2f6950(0xf5)](_0x3c6b7e),Buffer[_0x2f6950(0xe6)]([_0x3a112e[_0x2f6950(0xd9)](_0x187de2),_0x3a112e[_0x2f6950(0xf6)]()])[_0x2f6950(0xec)]('utf-8');}function a23_0x1140(){const _0x41a666=['9RCXBPK','setAuthTag','final','12400RWzlvR','utf-8','652SkfiUm','clear','5SRmiud','stringify','trim','6292620OKLBET','parse','WpsCom@te#2024!Secur3K3y_Agent!!','mkdirSync','subarray','save','saveSid','string','from','6223768ZJypZI','1714488vrCTUn','update','WPS_SID','createDecipheriv','env','user_auth.json','.wpscomate','readFileSync','token','user_info','configPath','dirname','writeFileSync','length','concat','4959241ncjCzE','1066CIkWGN','agent','wps_sid','join','toString','39eLZoUG','load','11DWXmUm','6388490jUdaJP','auth','saveUserInfo','801NcDSXG'];a23_0x1140=function(){return _0x41a666;};return a23_0x1140();}function loadPiClientSid(){const _0x50c726=a23_0xf423c7;try{const _0x4fee2c=a23_0x5c674c['readFileSync'](PI_CLIENT_AUTH_PATH,_0x50c726(0xc8)),_0x48c0f3=JSON['parse'](_0x4fee2c[_0x50c726(0xcd)]());if(typeof _0x48c0f3[_0x50c726(0xe0)]===_0x50c726(0xd5)&&_0x48c0f3[_0x50c726(0xe0)])return decryptPiClientToken(_0x48c0f3[_0x50c726(0xe0)]);if(typeof _0x48c0f3['wps_sid']===_0x50c726(0xd5)&&_0x48c0f3['wps_sid'])return _0x48c0f3[_0x50c726(0xea)];}catch{}return null;}export class ConfigManager{[a23_0xf423c7(0xe2)];constructor(_0x148f04){const _0x693bf0=a23_0xf423c7;this[_0x693bf0(0xe2)]=_0x148f04??CONFIG_FILE;}[a23_0xf423c7(0xee)](){const _0xaec649=a23_0xf423c7;let _0xf0b38d=null,_0x262d2a=null;try{const _0x2498cd=a23_0x5c674c[_0xaec649(0xdf)](this[_0xaec649(0xe2)],_0xaec649(0xc8)),_0x1f4ca8=JSON[_0xaec649(0xcf)](_0x2498cd);_0x262d2a=_0x1f4ca8[_0xaec649(0xea)]??null,_0xf0b38d=_0x1f4ca8[_0xaec649(0xe1)]??null;}catch{}const _0x31fdc2=loadPiClientSid()??process[_0xaec649(0xdc)][_0xaec649(0xda)]?.['trim']()??_0x262d2a;return{'wps_sid':_0x31fdc2||null,'user_info':_0xf0b38d};}['save'](_0x5776dc){const _0x3fa524=a23_0xf423c7,_0x3ea66e=a23_0x3dc120[_0x3fa524(0xe3)](this[_0x3fa524(0xe2)]);a23_0x5c674c[_0x3fa524(0xd1)](_0x3ea66e,{'recursive':!![]}),a23_0x5c674c[_0x3fa524(0xe4)](this[_0x3fa524(0xe2)],JSON[_0x3fa524(0xcc)](_0x5776dc,null,0x2),_0x3fa524(0xc8));}[a23_0xf423c7(0xd4)](_0x2e222b){const _0x19bf95=a23_0xf423c7,_0x214406=this[_0x19bf95(0xee)]();_0x214406[_0x19bf95(0xea)]=_0x2e222b,this[_0x19bf95(0xd3)](_0x214406);}[a23_0xf423c7(0xf2)](_0x22b320){const _0xbd6fb6=a23_0xf423c7,_0x34ab28=this[_0xbd6fb6(0xee)]();_0x34ab28['user_info']=_0x22b320,this[_0xbd6fb6(0xd3)](_0x34ab28);}[a23_0xf423c7(0xca)](){const _0x4ac33f=a23_0xf423c7;this[_0x4ac33f(0xd3)]({'wps_sid':null,'user_info':null});}}export const configManager=new ConfigManager();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x4183e8=a24_0x3461;(function(_0x4e22ad,_0x9a26b2){const _0x5f5639=a24_0x3461,_0x44f1a1=_0x4e22ad();while(!![]){try{const _0x5c0b63=-parseInt(_0x5f5639(0x1e7))/0x1*(-parseInt(_0x5f5639(0x200))/0x2)+-parseInt(_0x5f5639(0x1ff))/0x3*(parseInt(_0x5f5639(0x1ea))/0x4)+parseInt(_0x5f5639(0x1f1))/0x5+parseInt(_0x5f5639(0x1ef))/0x6+parseInt(_0x5f5639(0x201))/0x7*(-parseInt(_0x5f5639(0x1ee))/0x8)+parseInt(_0x5f5639(0x1f0))/0x9+parseInt(_0x5f5639(0x1fa))/0xa*(-parseInt(_0x5f5639(0x1ec))/0xb);if(_0x5c0b63===_0x9a26b2)break;else _0x44f1a1['push'](_0x44f1a1['shift']());}catch(_0x317602){_0x44f1a1['push'](_0x44f1a1['shift']());}}}(a24_0x562a,0x72d64));import{Command}from'@oclif/core';function a24_0x562a(){const _0x58dea9=['344NHJwnn','1809744nniWTS','6007149RdPBtE','1780170mUMsdA','error','未登录,请先执行\x20npx\x20--yes\x20@wps365-open/comate-cli@latest\x20auth\x20login','requireAuth','log','map','ora','finally','colorize','1098210PBRrfh','jsonEnabled','string','stop','spinner','9xEaoMj','34RHLwtC','45612mXltip','join','succeed','19961RvFopi','_actionActive','wps_sid','193532Dvkjzm','exit','77dQGida','stopLoading'];a24_0x562a=function(){return _0x58dea9;};return a24_0x562a();}import a24_0x51b786 from'chalk';function a24_0x3461(_0x4d3120,_0x19d147){_0x4d3120=_0x4d3120-0x1e6;const _0x562a38=a24_0x562a();let _0x3461e1=_0x562a38[_0x4d3120];return _0x3461e1;}import{configManager}from'../config/manager.js';import{FileOnly}from'../log/logger.js';export default class BaseCommand extends Command{[a24_0x4183e8(0x1fe)];[a24_0x4183e8(0x1e8)]=![];[a24_0x4183e8(0x1f9)](_0x348fc6,_0x3421e6){return a24_0x51b786[_0x3421e6](_0x348fc6);}async['createLoading'](_0x1563b7){const _0x59b419=a24_0x4183e8,_0xbfb4c8=await import(_0x59b419(0x1f7));this['spinner']=_0xbfb4c8['default']({'text':_0x1563b7})['start'](),this[_0x59b419(0x1e8)]=!![];}['stopLoading'](_0x50eedc){const _0xdc3f61=a24_0x4183e8;if(!this['spinner'])return;if(_0x50eedc)this[_0xdc3f61(0x1fe)][_0xdc3f61(0x1e6)](_0x50eedc);else this[_0xdc3f61(0x1fe)][_0xdc3f61(0x1fd)]();this[_0xdc3f61(0x1fe)]=undefined,this[_0xdc3f61(0x1e8)]=![];}async[a24_0x4183e8(0x1f4)](){const _0xc2c47=a24_0x4183e8,_0x4e57e8=configManager['load']();return!_0x4e57e8[_0xc2c47(0x1e9)]&&(this[_0xc2c47(0x1fb)]()&&(this['logJson']({'status':'error','message':_0xc2c47(0x1f3),'code':'AUTH_REQUIRED'}),this[_0xc2c47(0x1eb)](0x2)),this[_0xc2c47(0x1f2)](_0xc2c47(0x1f3))),{'sid':_0x4e57e8[_0xc2c47(0x1e9)]};}[a24_0x4183e8(0x1f5)](_0x49990c,..._0x5d0358){const _0x20d6bd=a24_0x4183e8,_0x3512fb=[_0x49990c,..._0x5d0358][_0x20d6bd(0x1f6)](_0x48dc30=>typeof _0x48dc30===_0x20d6bd(0x1fc)?_0x48dc30:JSON['stringify'](_0x48dc30))[_0x20d6bd(0x202)]('\x20');FileOnly(_0x3512fb);if(this[_0x20d6bd(0x1e8)])this[_0x20d6bd(0x1ed)]();super[_0x20d6bd(0x1f5)](_0x49990c,..._0x5d0358);}async[a24_0x4183e8(0x1f8)](_0x422b0e){const _0x1049cb=a24_0x4183e8;return this[_0x1049cb(0x1ed)](),super[_0x1049cb(0x1f8)](_0x422b0e);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a25_0x3494(){const _0x46cc86=['1158411FFgBoH','1468cEAVbF','wps_sid','502RBJkZY','7KnljfI','286ROumbo','7940298ewmeoW','4219256TVcLaC','randomBytes','416170wqtRFu',';csrf=','wps_sid=','4051DXRLGX','load','4426236rEijuD','2105rItwJM'];a25_0x3494=function(){return _0x46cc86;};return a25_0x3494();}(function(_0x50e9b8,_0x5b67dd){const _0x286abd=a25_0x2e20,_0x23f57b=_0x50e9b8();while(!![]){try{const _0x3e9b3a=-parseInt(_0x286abd(0xd7))/0x1*(-parseInt(_0x286abd(0xde))/0x2)+-parseInt(_0x286abd(0xdb))/0x3+-parseInt(_0x286abd(0xdc))/0x4*(parseInt(_0x286abd(0xda))/0x5)+-parseInt(_0x286abd(0xe1))/0x6*(-parseInt(_0x286abd(0xdf))/0x7)+parseInt(_0x286abd(0xe2))/0x8+-parseInt(_0x286abd(0xd9))/0x9+-parseInt(_0x286abd(0xd4))/0xa*(parseInt(_0x286abd(0xe0))/0xb);if(_0x3e9b3a===_0x5b67dd)break;else _0x23f57b['push'](_0x23f57b['shift']());}catch(_0x42c375){_0x23f57b['push'](_0x23f57b['shift']());}}}(a25_0x3494,0xb7dcd));import a25_0x37516b from'node:crypto';function a25_0x2e20(_0x1a212d,_0xb8a0d2){_0x1a212d=_0x1a212d-0xd3;const _0x34942d=a25_0x3494();let _0x2e20b6=_0x34942d[_0x1a212d];return _0x2e20b6;}import{configManager}from'../config/manager.js';function generateCsrf(){const _0x5c87a8=a25_0x2e20;return a25_0x37516b[_0x5c87a8(0xd3)](0x10)['toString']('hex');}export function buildAuthHeaders(){const _0x3c7843=a25_0x2e20,_0x11a73a=configManager[_0x3c7843(0xd8)](),_0x505f9d=generateCsrf(),_0x7a4703={'Content-Type':'application/json','X-CSRFToken':_0x505f9d};return _0x11a73a[_0x3c7843(0xdd)]&&(_0x7a4703['Cookie']=_0x3c7843(0xd6)+_0x11a73a[_0x3c7843(0xdd)]+_0x3c7843(0xd5)+_0x505f9d),_0x7a4703;}
|
package/dist/lib/http/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a26_0x5522(){const _0x2fd5a0=['baseUrl','6aAYHkS','41441520kxsoVz','3pcacrT','initialize','baseURL','10700165rbVvLS','get','1599464odiTfi','944dCxPbK','clear','1143348BlhtGO','登录已过期,请重新执行\x20npx\x20--yes\x20@wps365-open/comate-cli@latest\x20auth\x20login','wrapError','请求失败\x20(','网络错误:\x20','config','17685030VSsWlr','18jMkXZU','message','10pxBiKc','ENOTFOUND','axiosInstance','url','response','请求超时,请稍后重试','):\x20','getClient','无法连接到服务器,请检查网络','ECONNABORTED','code','data','create','2372POqYvO','3794785wYeGth','ECONNREFUSED'];a26_0x5522=function(){return _0x2fd5a0;};return a26_0x5522();}function a26_0x35eb(_0x29250b,_0x14ffc9){_0x29250b=_0x29250b-0x128;const _0x552260=a26_0x5522();let _0x35eb04=_0x552260[_0x29250b];return _0x35eb04;}const a26_0xdbdc85=a26_0x35eb;(function(_0x37f0bf,_0x1eba27){const _0x3dc373=a26_0x35eb,_0xec050c=_0x37f0bf();while(!![]){try{const _0x354c0b=parseInt(_0x3dc373(0x142))/0x1*(-parseInt(_0x3dc373(0x136))/0x2)+-parseInt(_0x3dc373(0x13c))/0x3*(parseInt(_0x3dc373(0x144))/0x4)+-parseInt(_0x3dc373(0x137))/0x5+-parseInt(_0x3dc373(0x13a))/0x6*(-parseInt(_0x3dc373(0x13f))/0x7)+-parseInt(_0x3dc373(0x141))/0x8*(parseInt(_0x3dc373(0x14b))/0x9)+-parseInt(_0x3dc373(0x129))/0xa*(parseInt(_0x3dc373(0x14a))/0xb)+parseInt(_0x3dc373(0x13b))/0xc;if(_0x354c0b===_0x1eba27)break;else _0xec050c['push'](_0xec050c['shift']());}catch(_0x4058a7){_0xec050c['push'](_0xec050c['shift']());}}}(a26_0x5522,0xc5c61));import a26_0x3fd84d from'axios';import{configManager}from'../config/manager.js';import{AGENTSPACE_BASE}from'../config/constants.js';import{buildAuthHeaders}from'./auth-headers.js';export class SimpleHttpClient{[a26_0xdbdc85(0x12b)]=null;[a26_0xdbdc85(0x139)];constructor(_0xe37632){const _0x5e5d45=a26_0xdbdc85;this[_0x5e5d45(0x139)]=_0xe37632??AGENTSPACE_BASE;}['initialize'](){const _0xb8d9dd=a26_0xdbdc85;this[_0xb8d9dd(0x12b)]=a26_0x3fd84d[_0xb8d9dd(0x135)]({'baseURL':this[_0xb8d9dd(0x139)],'headers':buildAuthHeaders(),'timeout':0x7530});}[a26_0xdbdc85(0x130)](){const _0x171cea=a26_0xdbdc85;if(!this[_0x171cea(0x12b)])this[_0x171cea(0x13d)]();return this[_0x171cea(0x12b)];}async[a26_0xdbdc85(0x140)](_0x29c780){const _0x28b19e=a26_0xdbdc85;try{const _0xac9c72=await this[_0x28b19e(0x130)]()[_0x28b19e(0x140)](_0x29c780);return _0xac9c72[_0x28b19e(0x134)];}catch(_0x2ab3f2){throw this[_0x28b19e(0x146)](_0x2ab3f2);}}async['post'](_0x5bebf1,_0x3571e3){const _0x1b8fa1=a26_0xdbdc85;try{const _0x141393=await this['getClient']()['post'](_0x5bebf1,_0x3571e3);return _0x141393[_0x1b8fa1(0x134)];}catch(_0x55de8a){throw this['wrapError'](_0x55de8a);}}[a26_0xdbdc85(0x146)](_0x5a7152){const _0xd19c03=a26_0xdbdc85;if(_0x5a7152['response']){const _0xa0e707=_0x5a7152[_0xd19c03(0x12d)]['status'],_0x185cb6=_0x5a7152[_0xd19c03(0x149)]?.[_0xd19c03(0x12c)]??_0x5a7152['config']?.[_0xd19c03(0x13e)]??'';if(_0xa0e707===0x191)return configManager[_0xd19c03(0x143)](),new Error(_0xd19c03(0x145));const _0x4c6bbf=_0x5a7152[_0xd19c03(0x12d)]['data'],_0x383adf=_0x4c6bbf?.['msg']??_0x4c6bbf?.[_0xd19c03(0x128)]??'';return new Error(_0xd19c03(0x147)+_0xa0e707+_0xd19c03(0x12f)+(_0x383adf||_0x5a7152[_0xd19c03(0x128)])+'\x20['+_0x185cb6+']');}if(_0x5a7152[_0xd19c03(0x133)]===_0xd19c03(0x138))return new Error(_0xd19c03(0x131));if(_0x5a7152[_0xd19c03(0x133)]===_0xd19c03(0x12a))return new Error('DNS\x20解析失败,请检查网络连接');if(_0x5a7152[_0xd19c03(0x133)]===_0xd19c03(0x132))return new Error(_0xd19c03(0x12e));return new Error(_0xd19c03(0x148)+_0x5a7152[_0xd19c03(0x128)]);}}export const httpClient=new SimpleHttpClient();
|
package/dist/lib/log/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3045ba,_0x4f58a2){const _0x382f75=a27_0x4b00,_0xfb0d42=_0x3045ba();while(!![]){try{const _0x5b7ad4=-parseInt(_0x382f75(0x10e))/0x1*(parseInt(_0x382f75(0x11c))/0x2)+-parseInt(_0x382f75(0x10f))/0x3+-parseInt(_0x382f75(0x11f))/0x4+parseInt(_0x382f75(0x11e))/0x5*(-parseInt(_0x382f75(0x115))/0x6)+parseInt(_0x382f75(0x119))/0x7*(parseInt(_0x382f75(0x11b))/0x8)+-parseInt(_0x382f75(0x108))/0x9+parseInt(_0x382f75(0x11a))/0xa*(parseInt(_0x382f75(0x118))/0xb);if(_0x5b7ad4===_0x4f58a2)break;else _0xfb0d42['push'](_0xfb0d42['shift']());}catch(_0x2bc946){_0xfb0d42['push'](_0xfb0d42['shift']());}}}(a27_0x10fb,0xb9321));import a27_0xb24174 from'node:fs';import a27_0xeef23a from'node:path';import{LOG_DIR,ENV_VERBOSE}from'../config/constants.js';import{randomUUID}from'node:crypto';let logFilePath=null,logLevel=0x3;function a27_0x4b00(_0x5a6014,_0x48b16f){_0x5a6014=_0x5a6014-0x108;const _0x10fb6b=a27_0x10fb();let _0x4b005f=_0x10fb6b[_0x5a6014];return _0x4b005f;}const LOG_SUFFIX='.log';export function NewLoggerWithLevel(_0x4a8dae,_0x26cedd){const _0x3de9bc=a27_0x4b00;logLevel=_0x4a8dae,logFilePath=_0x26cedd;const _0x36106c=a27_0xeef23a['dirname'](_0x26cedd);a27_0xb24174[_0x3de9bc(0x112)](_0x36106c,{'recursive':!![]}),a27_0xb24174[_0x3de9bc(0x11d)](_0x26cedd,_0x3de9bc(0x10b)+new Date()[_0x3de9bc(0x10a)]()+'\x0a',_0x3de9bc(0x117));}let hasLogWriteFailed=![];export function FileOnly(_0x2ea485){const _0x16d43f=a27_0x4b00;if(!logFilePath)return;try{a27_0xb24174[_0x16d43f(0x113)](logFilePath,new Date()[_0x16d43f(0x10a)]()+'\x20'+_0x2ea485+'\x0a',_0x16d43f(0x117));}catch(_0x19f5be){!hasLogWriteFailed&&(hasLogWriteFailed=!![],process[_0x16d43f(0x10d)][_0x16d43f(0x111)](_0x16d43f(0x116)+(_0x19f5be instanceof Error?_0x19f5be[_0x16d43f(0x109)]:String(_0x19f5be))+'\x0a'));}}export function CleanLogFile(){logFilePath=null;}export function initLogger(){const _0x9ac220=a27_0x4b00,_0x17b6bf=0x3,_0x2b9728=process[_0x9ac220(0x10c)][ENV_VERBOSE],_0x2036ef=_0x2b9728?Math[_0x9ac220(0x114)](0x5,Math[_0x9ac220(0x110)](0x1,Number['parseInt'](_0x2b9728,0xa)||_0x17b6bf)):_0x17b6bf,_0x15a2e0=randomUUID(),_0x104c45=a27_0xeef23a['join'](LOG_DIR,''+_0x15a2e0+LOG_SUFFIX);return NewLoggerWithLevel(_0x2036ef,_0x104c45),_0x104c45;}function a27_0x10fb(){const _0x466ec4=['10XxLkUa','writeFileSync','5nZTFCt','309852wjVvhT','2083734fwjUYN','message','toISOString','[comate-cli]\x20Log\x20started\x20at\x20','env','stderr','186503pKXnHq','2757213fthhyq','max','write','mkdirSync','appendFileSync','min','4917048SZOddo','[comate-cli]\x20log\x20write\x20failed:\x20','utf-8','154tDuGvP','23261FtxRIG','2504310xriPNc','560fgoFrI'];a27_0x10fb=function(){return _0x466ec4;};return a27_0x10fb();}export function getLogLevel(){return logLevel;}
|
package/dist/lib/service/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x947cb8,_0x509a96){const _0x3ff131=a28_0x2ef1,_0x15452a=_0x947cb8();while(!![]){try{const _0x29d189=-parseInt(_0x3ff131(0x155))/0x1+-parseInt(_0x3ff131(0x15f))/0x2*(parseInt(_0x3ff131(0x14b))/0x3)+-parseInt(_0x3ff131(0x15c))/0x4*(parseInt(_0x3ff131(0x15e))/0x5)+-parseInt(_0x3ff131(0x152))/0x6*(parseInt(_0x3ff131(0x14c))/0x7)+-parseInt(_0x3ff131(0x154))/0x8*(parseInt(_0x3ff131(0x14a))/0x9)+parseInt(_0x3ff131(0x153))/0xa*(-parseInt(_0x3ff131(0x151))/0xb)+parseInt(_0x3ff131(0x15b))/0xc*(parseInt(_0x3ff131(0x158))/0xd);if(_0x29d189===_0x509a96)break;else _0x15452a['push'](_0x15452a['shift']());}catch(_0x5aeaa8){_0x15452a['push'](_0x15452a['shift']());}}}(a28_0x49ea,0x3ef35));import{httpClient}from'../http/client.js';function a28_0x2ef1(_0x3d0108,_0x514af4){_0x3d0108=_0x3d0108-0x14a;const _0x49eab9=a28_0x49ea();let _0x2ef13c=_0x49eab9[_0x3d0108];return _0x2ef13c;}import{AGENTSPACE_BASE}from'../config/constants.js';import a28_0x2b028 from'axios';export async function getUserToken(_0xe88718,_0xe4966c,_0x53c021){const _0x4e697a=a28_0x2ef1,_0x2d8daf=await a28_0x2b028[_0x4e697a(0x14d)](AGENTSPACE_BASE+_0x4e697a(0x156),{'app_id':_0xe88718,'code':_0xe4966c,'state':_0x53c021});if(_0x2d8daf['data'][_0x4e697a(0x14e)]!==0x0||!_0x2d8daf[_0x4e697a(0x150)]['data']?.[_0x4e697a(0x15d)])throw new Error(_0x2d8daf[_0x4e697a(0x150)][_0x4e697a(0x14f)]||_0x4e697a(0x159));return _0x2d8daf[_0x4e697a(0x150)]['data'][_0x4e697a(0x15d)];}function a28_0x49ea(){const _0x5b26e8=['2NQPVnz','99HoOjXd','611139TNYSMD','1630629LjxfoK','post','code','msg','data','1396791ZfAoUq','6GknCyY','20JGsSaI','244744yVXlOl','164513ydOnTE','/v7/devhub/users/user_token','获取用户信息失败','13dBfMWj','获取登录凭证失败','initialize','19755444MPFxwL','8032tuTbFN','token','490IMmdqH'];a28_0x49ea=function(){return _0x5b26e8;};return a28_0x49ea();}export async function getCurrentUser(){const _0x24480a=a28_0x2ef1;httpClient[_0x24480a(0x15a)]();const _0x348b59=await httpClient['get']('/v7/devhub/users/current');if(_0x348b59[_0x24480a(0x14e)]!==0x0)throw new Error(_0x348b59[_0x24480a(0x14f)]||_0x24480a(0x157));return _0x348b59[_0x24480a(0x150)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0xae8bfc=a29_0x5f37;(function(_0xe9e3f3,_0x422263){const _0x271099=a29_0x5f37,_0x26a362=_0xe9e3f3();while(!![]){try{const _0x452cbe=-parseInt(_0x271099(0x154))/0x1*(parseInt(_0x271099(0x177))/0x2)+-parseInt(_0x271099(0x162))/0x3+-parseInt(_0x271099(0x16e))/0x4*(-parseInt(_0x271099(0x163))/0x5)+parseInt(_0x271099(0x167))/0x6+parseInt(_0x271099(0x182))/0x7*(parseInt(_0x271099(0x173))/0x8)+parseInt(_0x271099(0x17d))/0x9+parseInt(_0x271099(0x168))/0xa;if(_0x452cbe===_0x422263)break;else _0x26a362['push'](_0x26a362['shift']());}catch(_0x5abc7c){_0x26a362['push'](_0x26a362['shift']());}}}(a29_0x5a8a,0xe08e5));import{configManager}from'../config/manager.js';import{APP_STUDIO_BASE}from'../config/constants.js';import{buildAuthHeaders}from'../http/auth-headers.js';const CLOUD_API_BASE=process[a29_0xae8bfc(0x16d)][a29_0xae8bfc(0x175)]??APP_STUDIO_BASE;function getHeaders(){return buildAuthHeaders();}async function assertOk(_0x1e969c,_0x2eb245){const _0xe7dbbb=a29_0xae8bfc;if(!_0x1e969c['ok']){const _0x5f210d=await _0x1e969c[_0xe7dbbb(0x158)]()[_0xe7dbbb(0x153)](()=>'');if(_0x1e969c['status']===0x191){configManager[_0xe7dbbb(0x170)]();throw new Error('登录已过期,请重新执行\x20npx\x20--yes\x20@wps365-open/comate-cli@latest\x20auth\x20login');}if(_0x1e969c['status']===0x193){let _0x48b9b0=_0x5f210d;try{_0x48b9b0=JSON['parse'](_0x5f210d)[_0xe7dbbb(0x180)]??_0x5f210d;}catch{}throw new Error(_0xe7dbbb(0x15b)+_0x48b9b0);}throw new Error(_0x2eb245+'\x20失败\x20('+_0x1e969c[_0xe7dbbb(0x156)]+_0xe7dbbb(0x16f)+_0x5f210d);}}export async function createThread(_0x26c526='app-builder'){const _0x255a1a=a29_0xae8bfc,_0x59309e=await fetch(CLOUD_API_BASE+'/api/v3/threads',{'method':'POST','headers':getHeaders(),'body':JSON[_0x255a1a(0x17c)]({'agent_id':_0x26c526})});return await assertOk(_0x59309e,_0x255a1a(0x179)),_0x59309e['json']();}export async function submitRun(_0x32d15c){const _0x43a2d2=a29_0xae8bfc,{threadId:_0x3efd64,messages:_0x31d5b3,assistantId:_0x5ac61b}=_0x32d15c,_0x5aa06f={'input':{'messages':_0x31d5b3},'stream_mode':[_0x43a2d2(0x16a)]};if(_0x5ac61b)_0x5aa06f[_0x43a2d2(0x176)]=_0x5ac61b;const _0x11018d=await fetch(CLOUD_API_BASE+_0x43a2d2(0x171)+_0x3efd64+_0x43a2d2(0x160),{'method':_0x43a2d2(0x155),'headers':{...getHeaders(),'Accept':_0x43a2d2(0x15d)},'body':JSON[_0x43a2d2(0x17c)](_0x5aa06f)});await assertOk(_0x11018d,'提交消息');if(_0x11018d[_0x43a2d2(0x15c)]){const _0x19b805=_0x11018d['body'][_0x43a2d2(0x164)]();_0x19b805[_0x43a2d2(0x165)]()[_0x43a2d2(0x153)](()=>{});}return{'thread_id':_0x3efd64};}function a29_0x5a8a(){const _0x58e0b9=['isBuffer','COMATE_CLOUD_API_BASE','assistant_id','70342BKypCg','length','创建会话','/files/upload','octet-stream','stringify','9677664cMYcNV','GET','results','error','append','3682161NFnsoY','threadId','Content-Type','catch','39HwagMX','POST','status','name','text','headers','/state','权限不足\x20(403):\x20','body','text/event-stream','/files/download','timeout','/runs/stream','上传文件','4264500gDjWcL','25SUeaOd','getReader','cancel','/api/v3/runs/active','3697128kbgtYX','8261080CQWPJV','application/octet-stream','updates','恢复中断','获取会话状态','env','535468RHEUEZ','):\x20','clear','/api/v3/threads/','json','8RLangL'];a29_0x5a8a=function(){return _0x58e0b9;};return a29_0x5a8a();}export async function resumeRun(_0x188115){const _0x1fef68=a29_0xae8bfc,{threadId:_0x180a16,resumeValue:_0x257c91,assistantId:_0x1903bb}=_0x188115,_0x3b76c3={'command':{'resume':_0x257c91},'stream_mode':[_0x1fef68(0x16a)]};if(_0x1903bb)_0x3b76c3[_0x1fef68(0x176)]=_0x1903bb;const _0x57cf83=await fetch(CLOUD_API_BASE+_0x1fef68(0x171)+_0x180a16+_0x1fef68(0x160),{'method':_0x1fef68(0x155),'headers':{...getHeaders(),'Accept':_0x1fef68(0x15d)},'body':JSON['stringify'](_0x3b76c3)});await assertOk(_0x57cf83,_0x1fef68(0x16b));if(_0x57cf83[_0x1fef68(0x15c)]){const _0x4bb7f7=_0x57cf83[_0x1fef68(0x15c)][_0x1fef68(0x164)]();_0x4bb7f7['cancel']()['catch'](()=>{});}return{'thread_id':_0x180a16};}export async function isThreadRunning(_0x2ad5db){const _0x362017=a29_0xae8bfc;try{const _0x501fbf=await fetch(CLOUD_API_BASE+_0x362017(0x166),{'method':_0x362017(0x17e),'headers':getHeaders(),'signal':AbortSignal[_0x362017(0x15f)](0x1388)});if(!_0x501fbf['ok'])return![];const _0x6e7e93=await _0x501fbf['json']();return _0x6e7e93['activeRuns']?.['some'](_0xbbed22=>_0xbbed22[_0x362017(0x151)]===_0x2ad5db)??![];}catch{return![];}}export async function getThreadState(_0x2e03c2){const _0x4e47d4=a29_0xae8bfc,_0x5ca827=await fetch(CLOUD_API_BASE+_0x4e47d4(0x171)+_0x2e03c2+_0x4e47d4(0x15a),{'method':_0x4e47d4(0x17e),'headers':getHeaders(),'signal':AbortSignal[_0x4e47d4(0x15f)](0x3a98)});return await assertOk(_0x5ca827,_0x4e47d4(0x16c)),_0x5ca827[_0x4e47d4(0x172)]();}export async function downloadFiles(_0x4b3313,_0x1a0a92){const _0x3869aa=a29_0xae8bfc,_0x1fd837=await fetch(CLOUD_API_BASE+_0x3869aa(0x171)+_0x4b3313+_0x3869aa(0x15e),{'method':_0x3869aa(0x155),'headers':getHeaders(),'body':JSON[_0x3869aa(0x17c)]({'paths':_0x1a0a92})});await assertOk(_0x1fd837,'下载文件');if(_0x1a0a92[_0x3869aa(0x178)]===0x1){const _0x3eab96=_0x1fd837[_0x3869aa(0x159)]['get']('content-type')??'';if(_0x3eab96['includes'](_0x3869aa(0x17b))){const _0x1e245f=await _0x1fd837['text']();return[{'path':_0x1a0a92[0x0],'content':_0x1e245f,'error':null}];}}const _0x414641=await _0x1fd837[_0x3869aa(0x172)]();return _0x414641[_0x3869aa(0x17f)]??[];}function a29_0x5f37(_0x26de3a,_0x47258a){_0x26de3a=_0x26de3a-0x151;const _0x5a8a7e=a29_0x5a8a();let _0x5f3739=_0x5a8a7e[_0x26de3a];return _0x5f3739;}export async function uploadFiles(_0x6965ef,_0x5d7163){const _0x34837e=a29_0xae8bfc,_0x4c05e3=new FormData();for(const _0x3ea175 of _0x5d7163){const _0x166ba0=Buffer[_0x34837e(0x174)](_0x3ea175['content'])?new Uint8Array(_0x3ea175['content']):_0x3ea175['content'],_0x31b1f5=new Blob([_0x166ba0],{'type':_0x34837e(0x169)});_0x4c05e3[_0x34837e(0x181)](_0x3ea175[_0x34837e(0x157)],_0x31b1f5,_0x3ea175['name']);}const _0x3185c8=getHeaders();delete _0x3185c8[_0x34837e(0x152)];const _0x4cc8fe=await fetch(CLOUD_API_BASE+'/api/v3/threads/'+_0x6965ef+_0x34837e(0x17a),{'method':_0x34837e(0x155),'headers':_0x3185c8,'body':_0x4c05e3});return await assertOk(_0x4cc8fe,_0x34837e(0x161)),_0x4cc8fe['json']();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a29_0x553e97=a29_0x4011;(function(_0x3c9dfe,_0x450890){const _0x15e9bc=a29_0x4011,_0x102690=_0x3c9dfe();while(!![]){try{const _0x5f21ff=parseInt(_0x15e9bc(0x1f2))/0x1+parseInt(_0x15e9bc(0x218))/0x2*(-parseInt(_0x15e9bc(0x23c))/0x3)+parseInt(_0x15e9bc(0x226))/0x4*(-parseInt(_0x15e9bc(0x252))/0x5)+-parseInt(_0x15e9bc(0x23d))/0x6+-parseInt(_0x15e9bc(0x236))/0x7*(parseInt(_0x15e9bc(0x233))/0x8)+parseInt(_0x15e9bc(0x243))/0x9*(parseInt(_0x15e9bc(0x1f6))/0xa)+parseInt(_0x15e9bc(0x251))/0xb*(parseInt(_0x15e9bc(0x23f))/0xc);if(_0x5f21ff===_0x450890)break;else _0x102690['push'](_0x102690['shift']());}catch(_0x527ac9){_0x102690['push'](_0x102690['shift']());}}}(a29_0x44ff,0xd7fdb));import{configManager}from'../config/manager.js';import{APP_STUDIO_BASE,RUNTIME_BASE}from'../config/constants.js';import{buildAuthHeaders}from'../http/auth-headers.js';import{publishVersion,getDeploymentStatus}from'./manage.js';import{FileOnly}from'../log/logger.js';const CLOUD_API_BASE=process[a29_0x553e97(0x22f)][a29_0x553e97(0x204)]??APP_STUDIO_BASE;function log(_0x55f57b){const _0x588c7a=a29_0x553e97;FileOnly(_0x588c7a(0x1fb)+_0x55f57b);}function getHeaders(){return buildAuthHeaders();}async function assertOk(_0x1e1c63,_0x4d9e00){const _0x5daa09=a29_0x553e97;if(!_0x1e1c63['ok']){const _0x8dbb19=await _0x1e1c63[_0x5daa09(0x24a)]()['catch'](()=>'');log(_0x4d9e00+'\x20HTTP\x20'+_0x1e1c63[_0x5daa09(0x230)]+':\x20'+_0x8dbb19[_0x5daa09(0x23e)](0x0,0x1f4));if(_0x1e1c63[_0x5daa09(0x230)]===0x191){configManager[_0x5daa09(0x1e7)]();throw new Error(_0x5daa09(0x23a));}throw new Error(_0x4d9e00+_0x5daa09(0x1f3)+_0x1e1c63[_0x5daa09(0x230)]+_0x5daa09(0x1f9)+_0x8dbb19);}}export async function submitBuild(_0x303e56){const _0x385e50=a29_0x553e97,{threadId:_0x4cd6c4,projectId:_0x3cbbbd,versionId:_0x177004,buildCommand:_0x2cf06e,skipBuild:_0x1abde5}=_0x303e56,_0x2a1ede={'projectId':_0x3cbbbd,'versionId':_0x177004};if(_0x2cf06e)_0x2a1ede['buildCommand']=_0x2cf06e;if(_0x1abde5)_0x2a1ede[_0x385e50(0x235)]=!![];const _0x370f17=CLOUD_API_BASE+_0x385e50(0x20a)+_0x4cd6c4+_0x385e50(0x21d);log(_0x385e50(0x22a)+_0x370f17+_0x385e50(0x22e)+JSON['stringify'](_0x2a1ede));const _0xa67107=await fetch(_0x370f17,{'method':_0x385e50(0x1fa),'headers':getHeaders(),'body':JSON[_0x385e50(0x238)](_0x2a1ede)});await assertOk(_0xa67107,_0x385e50(0x211));const _0x911a5f=await _0xa67107[_0x385e50(0x240)](),_0x3396a4=_0x911a5f['data']??_0x911a5f;return log(_0x385e50(0x223)+_0x3396a4[_0x385e50(0x202)]+_0x385e50(0x1e9)+_0x3396a4[_0x385e50(0x205)]),_0x3396a4;}export async function getBuildStatus(_0x596aad){const _0x16169f=a29_0x553e97,_0x48f526=CLOUD_API_BASE+'/api/v2/threads/'+_0x596aad+_0x16169f(0x222),_0x39d803=await fetch(_0x48f526,{'method':_0x16169f(0x221),'headers':getHeaders()});await assertOk(_0x39d803,_0x16169f(0x1f4));const _0x576d94=await _0x39d803['text']();let _0x36544f;try{_0x36544f=JSON[_0x16169f(0x1f7)](_0x576d94);}catch{log(_0x16169f(0x1f0)+_0x576d94[_0x16169f(0x23e)](0x0,0x1f4));throw new Error(_0x16169f(0x21b)+_0x576d94[_0x16169f(0x23e)](0x0,0xc8));}const _0x23ad47=_0x36544f['data']??_0x36544f;return log(_0x16169f(0x1fc)+_0x23ad47[_0x16169f(0x202)]+'\x20message='+_0x23ad47['message']+_0x16169f(0x1e8)+(_0x23ad47[_0x16169f(0x24d)]?.[_0x16169f(0x250)]??0x0)+_0x16169f(0x200)+!!_0x23ad47[_0x16169f(0x231)]),_0x23ad47['result']&&log('\x20\x20result:\x20files='+_0x23ad47[_0x16169f(0x231)][_0x16169f(0x210)]+_0x16169f(0x1ef)+_0x23ad47[_0x16169f(0x231)][_0x16169f(0x1ed)]),_0x23ad47;}const BUILD_TERMINAL=new Set([a29_0x553e97(0x24c),a29_0x553e97(0x1ea)]),POLL_INTERVAL=0xbb8;export async function runFullPublish(_0x3b9d84,_0x47ca47,_0x25ee8e=0x927c0){const _0x41ab9f=a29_0x553e97,_0x539512=Date[_0x41ab9f(0x227)]()+_0x25ee8e;log('runFullPublish\x20start:\x20threadId='+_0x3b9d84[_0x41ab9f(0x1e6)]+_0x41ab9f(0x20e)+_0x3b9d84[_0x41ab9f(0x1ec)]+'\x20versionId='+_0x3b9d84[_0x41ab9f(0x234)]+_0x41ab9f(0x248)+_0x3b9d84[_0x41ab9f(0x235)]+_0x41ab9f(0x1f1)+_0x25ee8e+'ms'),await submitBuild(_0x3b9d84),_0x47ca47?.({'step':_0x41ab9f(0x246),'message':'构建任务已提交'});let _0x5ef3d8,_0x253a97=null,_0x35699e=0x0;while(Date[_0x41ab9f(0x227)]()<_0x539512){const _0x804c1f=await getBuildStatus(_0x3b9d84['threadId']);_0x5ef3d8=_0x804c1f,_0x35699e++;if(_0x804c1f[_0x41ab9f(0x202)]!==_0x253a97){log(_0x41ab9f(0x1f8)+_0x253a97+_0x41ab9f(0x23b)+_0x804c1f[_0x41ab9f(0x202)]+_0x41ab9f(0x219)+_0x35699e+')'),_0x253a97=_0x804c1f['phase'];const _0x2049a6=mapBuildPhase(_0x804c1f[_0x41ab9f(0x202)]);_0x47ca47?.({'step':_0x2049a6,'message':_0x804c1f[_0x41ab9f(0x205)]});}if(_0x804c1f[_0x41ab9f(0x202)]===_0x41ab9f(0x1ea))return log(_0x41ab9f(0x24f)+_0x804c1f['message']),_0x804c1f['logs']?.['length']&&log(_0x41ab9f(0x207)+_0x804c1f[_0x41ab9f(0x24d)][_0x41ab9f(0x23e)](-0xa)[_0x41ab9f(0x1eb)]('\x0a')),{'status':'failed','deploy_error':_0x41ab9f(0x241)+_0x804c1f['message'],'build_result':_0x804c1f[_0x41ab9f(0x231)],'build_logs':_0x804c1f['logs']};if(BUILD_TERMINAL['has'](_0x804c1f[_0x41ab9f(0x202)])){log(_0x41ab9f(0x237)+_0x804c1f[_0x41ab9f(0x202)]+_0x41ab9f(0x203)+_0x35699e+_0x41ab9f(0x208));break;}await sleep(POLL_INTERVAL);}if(!_0x5ef3d8||!BUILD_TERMINAL[_0x41ab9f(0x20c)](_0x5ef3d8[_0x41ab9f(0x202)]))return log(_0x41ab9f(0x21e)+_0x35699e+_0x41ab9f(0x1fe)+_0x5ef3d8?.[_0x41ab9f(0x202)]),{'status':_0x41ab9f(0x1f5),'deploy_error':_0x41ab9f(0x1ee),'build_logs':_0x5ef3d8?.[_0x41ab9f(0x24d)]};_0x47ca47?.({'step':_0x41ab9f(0x213),'message':_0x41ab9f(0x206)});let _0x4fd038,_0x2f6816;try{const _0x5eda11=await publishVersion(_0x3b9d84[_0x41ab9f(0x1ec)],_0x3b9d84[_0x41ab9f(0x234)]);log(_0x41ab9f(0x21c)+_0x5eda11['deploy_status']+_0x41ab9f(0x216)+_0x5eda11[_0x41ab9f(0x228)]+_0x41ab9f(0x24b)+(_0x5eda11['short_url']??'N/A')),_0x4fd038=extractDeploymentId(_0x5eda11[_0x41ab9f(0x228)]),_0x2f6816=_0x5eda11[_0x41ab9f(0x214)];}catch(_0x6874d0){const _0x1ef588=_0x6874d0 instanceof Error?_0x6874d0[_0x41ab9f(0x205)]:String(_0x6874d0);return log(_0x41ab9f(0x22b)+_0x1ef588),{'status':_0x41ab9f(0x1f5),'deploy_error':'触发部署失败:\x20'+_0x1ef588,'build_result':_0x5ef3d8?.[_0x41ab9f(0x231)],'build_logs':_0x5ef3d8?.['logs']};}if(!_0x4fd038)return log(_0x41ab9f(0x1fd)),{'status':'failed','deploy_error':'未获取到\x20deployment\x20ID','build_result':_0x5ef3d8?.['result'],'build_logs':_0x5ef3d8?.['logs']};log(_0x41ab9f(0x20b)+_0x4fd038+',\x20starting\x20runtime\x20poll...'),_0x47ca47?.({'step':_0x41ab9f(0x213),'message':'部署中\x20('+_0x4fd038[_0x41ab9f(0x23e)](0x0,0x8)+_0x41ab9f(0x215)});let _0x2a1720=0x0;while(Date[_0x41ab9f(0x227)]()<_0x539512){await sleep(POLL_INTERVAL),_0x2a1720++;let _0x35548a;try{_0x35548a=await getDeploymentStatus(_0x4fd038),log('deploy\x20poll\x20#'+_0x2a1720+_0x41ab9f(0x239)+_0x35548a[_0x41ab9f(0x230)]+_0x41ab9f(0x249)+(_0x35548a[_0x41ab9f(0x1ea)]??'none'));}catch(_0x53b8eb){log(_0x41ab9f(0x209)+_0x2a1720+_0x41ab9f(0x245)+(_0x53b8eb instanceof Error?_0x53b8eb[_0x41ab9f(0x205)]:String(_0x53b8eb)));continue;}if(_0x35548a[_0x41ab9f(0x230)]===_0x41ab9f(0x232)){const _0x300140=RUNTIME_BASE+'/'+_0x4fd038+'/',_0x53c7b7=_0x2f6816||_0x35548a[_0x41ab9f(0x214)],_0x509c2b=_0x53c7b7||_0x300140;log(_0x41ab9f(0x1e5)+_0x509c2b),_0x47ca47?.({'step':_0x41ab9f(0x242),'message':_0x41ab9f(0x229)+_0x509c2b});const _0xc6da7=buildScreenshotUrl(_0x509c2b);return _0xc6da7&&void captureScreenshot(_0x3b9d84[_0x41ab9f(0x1ec)],_0xc6da7),{'status':_0x41ab9f(0x242),'access_url':_0x509c2b,'short_url':_0x53c7b7,'build_result':_0x5ef3d8?.[_0x41ab9f(0x231)]};}if(_0x35548a[_0x41ab9f(0x230)]==='failed')return log('deploy\x20FAILED:\x20'+(_0x35548a[_0x41ab9f(0x1ea)]??_0x41ab9f(0x22c))),_0x47ca47?.({'step':_0x41ab9f(0x1f5),'message':_0x41ab9f(0x24e)+(_0x35548a[_0x41ab9f(0x1ea)]??_0x41ab9f(0x22c))}),{'status':'failed','deploy_error':_0x35548a[_0x41ab9f(0x1ea)]??_0x41ab9f(0x201),'build_result':_0x5ef3d8?.['result'],'build_logs':_0x5ef3d8?.['logs']};}return log(_0x41ab9f(0x244)+_0x2a1720+'\x20polls'),{'status':_0x41ab9f(0x1f5),'deploy_error':_0x41ab9f(0x21f),'build_result':_0x5ef3d8?.[_0x41ab9f(0x231)],'build_logs':_0x5ef3d8?.[_0x41ab9f(0x24d)]};}const SCREENSHOT_RUNTIME_BASE=a29_0x553e97(0x20f),URL_REWRITES=[['https://o.wpsgo.com/app/',SCREENSHOT_RUNTIME_BASE],[a29_0x553e97(0x217),SCREENSHOT_RUNTIME_BASE]];function a29_0x4011(_0x1c08a8,_0xccdc01){_0x1c08a8=_0x1c08a8-0x1e5;const _0x44ff41=a29_0x44ff();let _0x4011d9=_0x44ff41[_0x1c08a8];return _0x4011d9;}function buildScreenshotUrl(_0x523e53){const _0xe4b2c6=a29_0x553e97;if(!_0x523e53)return undefined;for(const [_0x42c691,_0x2bdb21]of URL_REWRITES){if(_0x523e53[_0xe4b2c6(0x224)](_0x42c691))return _0x523e53[_0xe4b2c6(0x20d)](_0x42c691,_0x2bdb21);}return undefined;}async function captureScreenshot(_0x3772d4,_0x5bbd7f){const _0x44d6f7=a29_0x553e97,_0x3b7635=CLOUD_API_BASE+'/api/v2/projects/'+_0x3772d4+'/screenshot';log('captureScreenshot\x20POST\x20'+_0x3b7635);try{const _0x15e162=await fetch(_0x3b7635,{'method':'POST','headers':getHeaders(),'body':JSON[_0x44d6f7(0x238)]({'url':_0x5bbd7f})});if(!_0x15e162['ok']){const _0x34a618=await _0x15e162['text']()[_0x44d6f7(0x22d)](()=>'');log(_0x44d6f7(0x247)+_0x15e162[_0x44d6f7(0x230)]+_0x44d6f7(0x1f9)+_0x34a618[_0x44d6f7(0x23e)](0x0,0xc8));}else log('captureScreenshot:\x20截图任务已提交');}catch(_0x2f1af4){log(_0x44d6f7(0x220)+(_0x2f1af4 instanceof Error?_0x2f1af4['message']:String(_0x2f1af4)));}}function mapBuildPhase(_0x3f168a){const _0x6c75ff=a29_0x553e97;switch(_0x3f168a){case _0x6c75ff(0x212):return _0x6c75ff(0x246);case'installing':return _0x6c75ff(0x225);case'building':return'build_building';case _0x6c75ff(0x21a):return'build_publishing';case _0x6c75ff(0x24c):return'build_done';case _0x6c75ff(0x1ea):return _0x6c75ff(0x1f5);}}function a29_0x44ff(){const _0x43f54e=['build\x20FAILED:\x20','length','2101XWPgbn','3682610JYElvD','deploy\x20SUCCESS:\x20','threadId','clear','\x20logs=','\x20message=','error','join','projectId','totalZipSize','构建超时','\x20zip=','getBuildStatus\x20parse\x20error,\x20raw=','\x20timeout=','1383365IKmxfz','\x20失败\x20(','查询构建状态','failed','490LKFWPn','parse','build\x20phase\x20changed:\x20','):\x20','POST','[publish]\x20','getBuildStatus:\x20phase=','FAILED:\x20no\x20deployment\x20ID\x20extracted','\x20polls,\x20last\x20phase:\x20','match','\x20hasResult=','部署失败','phase','\x20after\x20','COMATE_CLOUD_API_BASE','message','触发部署...','build\x20logs\x20(last\x2010):\x0a','\x20polls','deploy\x20poll\x20#','/api/v2/threads/','deployment\x20ID\x20extracted:\x20','has','replace','\x20projectId=','https://open.wps.cn/app-studio/runtime/','totalFileCount','提交构建','pending','deploying','short_url','...)','\x20access_url=','https://o.wpsgo.com/app-studio/runtime/','4DBsmjL','\x20(poll\x20#','publishing','构建状态解析失败:\x20','publishVersion:\x20deploy_status=','/publish','build\x20TIMEOUT\x20after\x20','部署超时','captureScreenshot\x20error:\x20','GET','/publish/status','submitBuild\x20response:\x20phase=','startsWith','build_installing','8vJjAyV','now','access_url','部署成功:\x20','submitBuild\x20POST\x20','publishVersion\x20FAILED:\x20','未知错误','catch','\x20body=','env','status','result','active','728JhObMj','versionId','skipBuild','27958lHJmmW','build\x20reached\x20terminal\x20phase:\x20','stringify',':\x20status=','登录已过期,请重新执行\x20npx\x20--yes\x20@wps365-open/comate-cli@latest\x20auth\x20login','\x20→\x20','1494063QhODkG','7387836mODfgZ','slice','210648ehNJUf','json','构建失败:\x20','deployed','39006fcIqnB','deploy\x20TIMEOUT\x20after\x20','\x20error:\x20','build_pending','captureScreenshot\x20failed\x20(','\x20skipBuild=','\x20error=','text','\x20short_url=','published','logs','部署失败:\x20'];a29_0x44ff=function(){return _0x43f54e;};return a29_0x44ff();}function extractDeploymentId(_0x1f8f71){const _0x14089e=a29_0x553e97,_0x198a85=_0x1f8f71[_0x14089e(0x1ff)](/\/([0-9a-f-]{36})\/?/);return _0x198a85?.[0x1];}function sleep(_0x4a462c){return new Promise(_0xfb0eae=>setTimeout(_0xfb0eae,_0x4a462c));}
|
|
1
|
+
const a30_0x4a031f=a30_0x367d;(function(_0x33b751,_0x5027a8){const _0x2db503=a30_0x367d,_0x47c679=_0x33b751();while(!![]){try{const _0x443d09=parseInt(_0x2db503(0x11b))/0x1*(-parseInt(_0x2db503(0xd0))/0x2)+-parseInt(_0x2db503(0xff))/0x3+parseInt(_0x2db503(0xfb))/0x4+-parseInt(_0x2db503(0xdf))/0x5*(-parseInt(_0x2db503(0xe0))/0x6)+parseInt(_0x2db503(0xce))/0x7+-parseInt(_0x2db503(0xd1))/0x8+parseInt(_0x2db503(0xd5))/0x9;if(_0x443d09===_0x5027a8)break;else _0x47c679['push'](_0x47c679['shift']());}catch(_0x14c813){_0x47c679['push'](_0x47c679['shift']());}}}(a30_0xa84e,0x43057));function a30_0x367d(_0xde73e5,_0x5e805c){_0xde73e5=_0xde73e5-0xc6;const _0xa84ec4=a30_0xa84e();let _0x367d7a=_0xa84ec4[_0xde73e5];return _0x367d7a;}import{configManager}from'../config/manager.js';import{APP_STUDIO_BASE,RUNTIME_BASE}from'../config/constants.js';import{buildAuthHeaders}from'../http/auth-headers.js';import{publishVersion,getDeploymentStatus}from'./manage.js';import{FileOnly}from'../log/logger.js';const CLOUD_API_BASE=process[a30_0x4a031f(0x102)][a30_0x4a031f(0xd9)]??APP_STUDIO_BASE;function log(_0x1da880){FileOnly('[publish]\x20'+_0x1da880);}function getHeaders(){return buildAuthHeaders();}async function assertOk(_0x35557b,_0x2e9e5d){const _0x1a9ad8=a30_0x4a031f;if(!_0x35557b['ok']){const _0x335f4f=await _0x35557b[_0x1a9ad8(0xe7)]()['catch'](()=>'');log(_0x2e9e5d+_0x1a9ad8(0x117)+_0x35557b['status']+':\x20'+_0x335f4f[_0x1a9ad8(0x10e)](0x0,0x1f4));if(_0x35557b[_0x1a9ad8(0xdc)]===0x191){configManager['clear']();throw new Error(_0x1a9ad8(0x12a));}throw new Error(_0x2e9e5d+_0x1a9ad8(0xd2)+_0x35557b[_0x1a9ad8(0xdc)]+_0x1a9ad8(0x105)+_0x335f4f);}}export async function submitBuild(_0x1834af){const _0x161864=a30_0x4a031f,{threadId:_0x35ec03,projectId:_0x4d962c,versionId:_0x1999b4,buildCommand:_0x4a55ae,skipBuild:_0x1323c5}=_0x1834af,_0x2b2f43={'projectId':_0x4d962c,'versionId':_0x1999b4};if(_0x4a55ae)_0x2b2f43[_0x161864(0xe1)]=_0x4a55ae;if(_0x1323c5)_0x2b2f43[_0x161864(0xda)]=!![];const _0x6f0d0c=CLOUD_API_BASE+_0x161864(0xe8)+_0x35ec03+'/publish';log(_0x161864(0xf5)+_0x6f0d0c+_0x161864(0xee)+JSON[_0x161864(0xe6)](_0x2b2f43));const _0x5b52ff=await fetch(_0x6f0d0c,{'method':_0x161864(0x11e),'headers':getHeaders(),'body':JSON[_0x161864(0xe6)](_0x2b2f43)});await assertOk(_0x5b52ff,_0x161864(0xf2));const _0x1b0990=await _0x5b52ff['json'](),_0x2836ad=_0x1b0990[_0x161864(0xcc)]??_0x1b0990;return log(_0x161864(0x11c)+_0x2836ad[_0x161864(0xe4)]+_0x161864(0x12c)+_0x2836ad['message']),_0x2836ad;}export async function getBuildStatus(_0x36f2fd){const _0x3ef63f=a30_0x4a031f,_0x481d49=CLOUD_API_BASE+_0x3ef63f(0xe8)+_0x36f2fd+'/publish/status',_0x366c5a=await fetch(_0x481d49,{'method':'GET','headers':getHeaders()});await assertOk(_0x366c5a,_0x3ef63f(0x10a));const _0x51124b=await _0x366c5a['text']();let _0x35c338;try{_0x35c338=JSON[_0x3ef63f(0x127)](_0x51124b);}catch{log(_0x3ef63f(0x11d)+_0x51124b[_0x3ef63f(0x10e)](0x0,0x1f4));throw new Error('构建状态解析失败:\x20'+_0x51124b['slice'](0x0,0xc8));}const _0x1ee84a=_0x35c338[_0x3ef63f(0xcc)]??_0x35c338;return log(_0x3ef63f(0x106)+_0x1ee84a['phase']+_0x3ef63f(0x12c)+_0x1ee84a[_0x3ef63f(0x125)]+_0x3ef63f(0x120)+(_0x1ee84a['logs']?.[_0x3ef63f(0x10f)]??0x0)+_0x3ef63f(0xc7)+!!_0x1ee84a[_0x3ef63f(0xd3)]),_0x1ee84a[_0x3ef63f(0xd3)]&&log(_0x3ef63f(0xea)+_0x1ee84a[_0x3ef63f(0xd3)][_0x3ef63f(0x116)]+_0x3ef63f(0x118)+_0x1ee84a[_0x3ef63f(0xd3)]['totalZipSize']),_0x1ee84a;}const BUILD_TERMINAL=new Set([a30_0x4a031f(0x12b),'error']),POLL_INTERVAL=0xbb8;export async function runFullPublish(_0x1ca44f,_0x2603bc,_0x27a767=0x927c0){const _0x4ed42c=a30_0x4a031f,_0x38a98b=Date[_0x4ed42c(0xe2)]()+_0x27a767;log(_0x4ed42c(0x103)+_0x1ca44f[_0x4ed42c(0xf6)]+_0x4ed42c(0xf9)+_0x1ca44f[_0x4ed42c(0x10d)]+_0x4ed42c(0x100)+_0x1ca44f['versionId']+'\x20skipBuild='+_0x1ca44f[_0x4ed42c(0xda)]+_0x4ed42c(0x109)+_0x27a767+'ms'),await submitBuild(_0x1ca44f),_0x2603bc?.({'step':_0x4ed42c(0x107),'message':_0x4ed42c(0x128)});let _0x3e2812,_0x31b5e1=null,_0x5ef061=0x0;while(Date[_0x4ed42c(0xe2)]()<_0x38a98b){const _0xf212ea=await getBuildStatus(_0x1ca44f[_0x4ed42c(0xf6)]);_0x3e2812=_0xf212ea,_0x5ef061++;if(_0xf212ea['phase']!==_0x31b5e1){log(_0x4ed42c(0x11f)+_0x31b5e1+_0x4ed42c(0x123)+_0xf212ea['phase']+_0x4ed42c(0xeb)+_0x5ef061+')'),_0x31b5e1=_0xf212ea[_0x4ed42c(0xe4)];const _0x7d7c85=mapBuildPhase(_0xf212ea[_0x4ed42c(0xe4)]);_0x2603bc?.({'step':_0x7d7c85,'message':_0xf212ea[_0x4ed42c(0x125)]});}if(_0xf212ea['phase']===_0x4ed42c(0xe3))return log('build\x20FAILED:\x20'+_0xf212ea[_0x4ed42c(0x125)]),_0xf212ea[_0x4ed42c(0xcf)]?.[_0x4ed42c(0x10f)]&&log('build\x20logs\x20(last\x2010):\x0a'+_0xf212ea[_0x4ed42c(0xcf)]['slice'](-0xa)[_0x4ed42c(0x10c)]('\x0a')),{'status':_0x4ed42c(0xec),'deploy_error':_0x4ed42c(0xfc)+_0xf212ea['message'],'build_result':_0xf212ea[_0x4ed42c(0xd3)],'build_logs':_0xf212ea[_0x4ed42c(0xcf)]};if(BUILD_TERMINAL[_0x4ed42c(0xd4)](_0xf212ea[_0x4ed42c(0xe4)])){log(_0x4ed42c(0x112)+_0xf212ea[_0x4ed42c(0xe4)]+_0x4ed42c(0xde)+_0x5ef061+_0x4ed42c(0x110));break;}await sleep(POLL_INTERVAL);}if(!_0x3e2812||!BUILD_TERMINAL[_0x4ed42c(0xd4)](_0x3e2812[_0x4ed42c(0xe4)]))return log(_0x4ed42c(0xf4)+_0x5ef061+_0x4ed42c(0xef)+_0x3e2812?.[_0x4ed42c(0xe4)]),{'status':_0x4ed42c(0xec),'deploy_error':_0x4ed42c(0x124),'build_logs':_0x3e2812?.[_0x4ed42c(0xcf)]};_0x2603bc?.({'step':_0x4ed42c(0xd6),'message':'触发部署...'});let _0x4f8a13,_0x538198;try{const _0x333257=await publishVersion(_0x1ca44f[_0x4ed42c(0x10d)],_0x1ca44f[_0x4ed42c(0x10b)]);log('publishVersion:\x20deploy_status='+_0x333257['deploy_status']+_0x4ed42c(0xf8)+_0x333257[_0x4ed42c(0x129)]+_0x4ed42c(0xfd)+(_0x333257[_0x4ed42c(0x119)]??_0x4ed42c(0xcb))),_0x4f8a13=extractDeploymentId(_0x333257[_0x4ed42c(0x129)]),_0x538198=_0x333257[_0x4ed42c(0x119)];}catch(_0x3d08d5){const _0x13352d=_0x3d08d5 instanceof Error?_0x3d08d5[_0x4ed42c(0x125)]:String(_0x3d08d5);return log(_0x4ed42c(0x101)+_0x13352d),{'status':'failed','deploy_error':'触发部署失败:\x20'+_0x13352d,'build_result':_0x3e2812?.[_0x4ed42c(0xd3)],'build_logs':_0x3e2812?.[_0x4ed42c(0xcf)]};}if(!_0x4f8a13)return log('FAILED:\x20no\x20deployment\x20ID\x20extracted'),{'status':_0x4ed42c(0xec),'deploy_error':_0x4ed42c(0xfe),'build_result':_0x3e2812?.[_0x4ed42c(0xd3)],'build_logs':_0x3e2812?.['logs']};log('deployment\x20ID\x20extracted:\x20'+_0x4f8a13+',\x20starting\x20runtime\x20poll...'),_0x2603bc?.({'step':_0x4ed42c(0xd6),'message':_0x4ed42c(0xf3)+_0x4f8a13[_0x4ed42c(0x10e)](0x0,0x8)+_0x4ed42c(0xdb)});let _0x7f85cc=0x0;while(Date[_0x4ed42c(0xe2)]()<_0x38a98b){await sleep(POLL_INTERVAL),_0x7f85cc++;let _0x100230;try{_0x100230=await getDeploymentStatus(_0x4f8a13),log(_0x4ed42c(0x104)+_0x7f85cc+_0x4ed42c(0x114)+_0x100230[_0x4ed42c(0xdc)]+_0x4ed42c(0x115)+(_0x100230[_0x4ed42c(0xe3)]??'none'));}catch(_0x1bb0b9){log('deploy\x20poll\x20#'+_0x7f85cc+'\x20error:\x20'+(_0x1bb0b9 instanceof Error?_0x1bb0b9[_0x4ed42c(0x125)]:String(_0x1bb0b9)));continue;}if(_0x100230[_0x4ed42c(0xdc)]==='active'){const _0x5396e4=RUNTIME_BASE+'/'+_0x4f8a13+'/',_0x4379c9=_0x538198||_0x100230['short_url'],_0x46f697=_0x4379c9||_0x5396e4;log(_0x4ed42c(0x126)+_0x46f697),_0x2603bc?.({'step':'deployed','message':'部署成功:\x20'+_0x46f697});const _0x110ceb=buildScreenshotUrl(_0x46f697);return _0x110ceb&&void captureScreenshot(_0x1ca44f['projectId'],_0x110ceb),{'status':_0x4ed42c(0xf0),'access_url':_0x46f697,'short_url':_0x4379c9,'build_result':_0x3e2812?.[_0x4ed42c(0xd3)]};}if(_0x100230[_0x4ed42c(0xdc)]==='failed')return log(_0x4ed42c(0xc8)+(_0x100230['error']??_0x4ed42c(0xfa))),_0x2603bc?.({'step':'failed','message':_0x4ed42c(0xe5)+(_0x100230['error']??_0x4ed42c(0xfa))}),{'status':_0x4ed42c(0xec),'deploy_error':_0x100230[_0x4ed42c(0xe3)]??_0x4ed42c(0xed),'build_result':_0x3e2812?.[_0x4ed42c(0xd3)],'build_logs':_0x3e2812?.[_0x4ed42c(0xcf)]};}return log(_0x4ed42c(0x122)+_0x7f85cc+_0x4ed42c(0x110)),{'status':'failed','deploy_error':_0x4ed42c(0x113),'build_result':_0x3e2812?.['result'],'build_logs':_0x3e2812?.[_0x4ed42c(0xcf)]};}const SCREENSHOT_RUNTIME_BASE='https://open.wps.cn/app-studio/runtime/',URL_REWRITES=[[a30_0x4a031f(0x12d),SCREENSHOT_RUNTIME_BASE],[a30_0x4a031f(0xd8),SCREENSHOT_RUNTIME_BASE]];function buildScreenshotUrl(_0x511b55){const _0x7f1430=a30_0x4a031f;if(!_0x511b55)return undefined;for(const [_0x53b95f,_0x170b66]of URL_REWRITES){if(_0x511b55[_0x7f1430(0x108)](_0x53b95f))return _0x511b55[_0x7f1430(0xf1)](_0x53b95f,_0x170b66);}return undefined;}async function captureScreenshot(_0x15c16e,_0x124ed6){const _0xb8d0be=a30_0x4a031f,_0xbfa2e2=CLOUD_API_BASE+_0xb8d0be(0x11a)+_0x15c16e+'/screenshot';log(_0xb8d0be(0xc6)+_0xbfa2e2);try{const _0x446dbd=await fetch(_0xbfa2e2,{'method':_0xb8d0be(0x11e),'headers':getHeaders(),'body':JSON[_0xb8d0be(0xe6)]({'url':_0x124ed6})});if(!_0x446dbd['ok']){const _0xda205b=await _0x446dbd[_0xb8d0be(0xe7)]()[_0xb8d0be(0xc9)](()=>'');log(_0xb8d0be(0xe9)+_0x446dbd['status']+'):\x20'+_0xda205b[_0xb8d0be(0x10e)](0x0,0xc8));}else log(_0xb8d0be(0x121));}catch(_0x4a462b){log(_0xb8d0be(0xcd)+(_0x4a462b instanceof Error?_0x4a462b[_0xb8d0be(0x125)]:String(_0x4a462b)));}}function mapBuildPhase(_0xaa436f){const _0x48367f=a30_0x4a031f;switch(_0xaa436f){case'pending':return _0x48367f(0x107);case _0x48367f(0x111):return _0x48367f(0xdd);case'building':return'build_building';case _0x48367f(0xf7):return _0x48367f(0xd7);case _0x48367f(0x12b):return _0x48367f(0xca);case _0x48367f(0xe3):return _0x48367f(0xec);}}function extractDeploymentId(_0x427346){const _0x4d3ff8=_0x427346['match'](/\/([0-9a-f-]{36})\/?/);return _0x4d3ff8?.[0x1];}function sleep(_0x52d1fc){return new Promise(_0x5dac2c=>setTimeout(_0x5dac2c,_0x52d1fc));}function a30_0xa84e(){const _0x4125b8=['构建任务已提交','access_url','登录已过期,请重新执行\x20npx\x20--yes\x20@wps365-open/comate-cli@latest\x20auth\x20login','published','\x20message=','https://o.wpsgo.com/app/','captureScreenshot\x20POST\x20','\x20hasResult=','deploy\x20FAILED:\x20','catch','build_done','N/A','data','captureScreenshot\x20error:\x20','1896993wDvyIi','logs','10LScDJf','3334656OSiMYz','\x20失败\x20(','result','has','5265603ogaViQ','deploying','build_publishing','https://o.wpsgo.com/app-studio/runtime/','COMATE_CLOUD_API_BASE','skipBuild','...)','status','build_installing','\x20after\x20','60jPTcBy','492NXUNzW','buildCommand','now','error','phase','部署失败:\x20','stringify','text','/api/v2/threads/','captureScreenshot\x20failed\x20(','\x20\x20result:\x20files=','\x20(poll\x20#','failed','部署失败','\x20body=','\x20polls,\x20last\x20phase:\x20','deployed','replace','提交构建','部署中\x20(','build\x20TIMEOUT\x20after\x20','submitBuild\x20POST\x20','threadId','publishing','\x20access_url=','\x20projectId=','未知错误','1291128aGDayt','构建失败:\x20','\x20short_url=','未获取到\x20deployment\x20ID','617298bNzqzh','\x20versionId=','publishVersion\x20FAILED:\x20','env','runFullPublish\x20start:\x20threadId=','deploy\x20poll\x20#','):\x20','getBuildStatus:\x20phase=','build_pending','startsWith','\x20timeout=','查询构建状态','versionId','join','projectId','slice','length','\x20polls','installing','build\x20reached\x20terminal\x20phase:\x20','部署超时',':\x20status=','\x20error=','totalFileCount','\x20HTTP\x20','\x20zip=','short_url','/api/v2/projects/','56543fUHjyc','submitBuild\x20response:\x20phase=','getBuildStatus\x20parse\x20error,\x20raw=','POST','build\x20phase\x20changed:\x20','\x20logs=','captureScreenshot:\x20截图任务已提交','deploy\x20TIMEOUT\x20after\x20','\x20→\x20','构建超时','message','deploy\x20SUCCESS:\x20','parse'];a30_0xa84e=function(){return _0x4125b8;};return a30_0xa84e();}
|