@wps365-open/comate-cli 0.0.20 → 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
|
-
const
|
|
1
|
+
const a31_0x591648=a31_0x349f;function a31_0x349f(_0x2a04fc,_0x382253){_0x2a04fc=_0x2a04fc-0x131;const _0x1661b3=a31_0x1661();let _0x349ff9=_0x1661b3[_0x2a04fc];return _0x349ff9;}(function(_0x37b1f4,_0x5515ee){const _0x228e61=a31_0x349f,_0x3e619d=_0x37b1f4();while(!![]){try{const _0x4680e3=-parseInt(_0x228e61(0x14e))/0x1+parseInt(_0x228e61(0x149))/0x2*(-parseInt(_0x228e61(0x141))/0x3)+-parseInt(_0x228e61(0x159))/0x4*(parseInt(_0x228e61(0x144))/0x5)+parseInt(_0x228e61(0x14c))/0x6*(parseInt(_0x228e61(0x154))/0x7)+-parseInt(_0x228e61(0x147))/0x8*(-parseInt(_0x228e61(0x160))/0x9)+parseInt(_0x228e61(0x137))/0xa+-parseInt(_0x228e61(0x135))/0xb*(-parseInt(_0x228e61(0x15f))/0xc);if(_0x4680e3===_0x5515ee)break;else _0x3e619d['push'](_0x3e619d['shift']());}catch(_0x43247d){_0x3e619d['push'](_0x3e619d['shift']());}}}(a31_0x1661,0xa31b5));import{SimpleHttpClient}from'../http/client.js';import{APP_STUDIO_BASE}from'../config/constants.js';const manageClient=new SimpleHttpClient(APP_STUDIO_BASE),MANAGE_PREFIX=a31_0x591648(0x15c);export async function getMyTeams(){const _0x1944db=a31_0x591648;manageClient['initialize']();const _0x2f0b95=await manageClient[_0x1944db(0x148)](MANAGE_PREFIX+_0x1944db(0x14b));if(Array['isArray'](_0x2f0b95[_0x1944db(0x156)]?.[_0x1944db(0x134)]))return _0x2f0b95['data'][_0x1944db(0x134)];const _0x330f5c=_0x2f0b95;return _0x330f5c[_0x1944db(0x134)]??[];}function a31_0x1661(){const _0x24a63a=['2ChlWyC','/thread','/teams/my','1006728qfBVrm','/publish','971968jZXnuz','code','initialize','/scopes/update','isArray','/projects?team_id=','7EWnrJE','config_value','data','description','/deployment/recall','16UcDQkR','custom','/configs','/api/manage/v1','object','/teams','840wrmfFZ','9whsfIT','teamId','length','API\x20返回数据为空\x20(code:\x20','items','84634urUOfY','projectName','13085070YnTnAR','config_key','/projects/','/deployment/visibility','/deployments/','msg','/api/runtime/v1/deployments/','access_grants','&page=1&page_size=100','/frontend/download','1162641aKbcoA','/versions/','post','589255XdwlXm','/versions','\x20version','3873032ENPejI','get'];a31_0x1661=function(){return _0x24a63a;};return a31_0x1661();}export async function createTeam(_0x3559e8){const _0x25fe99=a31_0x591648;manageClient[_0x25fe99(0x150)]();const _0x3cdc9=await manageClient[_0x25fe99(0x143)](MANAGE_PREFIX+_0x25fe99(0x15e),{'team_name':_0x3559e8});return unwrap(_0x3cdc9);}export async function upsertProjectThread(_0x245b76,_0x15c741){const _0x205b47=a31_0x591648;manageClient[_0x205b47(0x150)]();const _0x1a0800=await manageClient[_0x205b47(0x143)](MANAGE_PREFIX+_0x205b47(0x139)+_0x245b76+_0x205b47(0x14a),{'thread_id':_0x15c741});return unwrap(_0x1a0800);}export async function getProjectThread(_0x194f97){const _0x3278f4=a31_0x591648;manageClient[_0x3278f4(0x150)]();const _0x416a1a=await manageClient[_0x3278f4(0x148)](MANAGE_PREFIX+_0x3278f4(0x139)+_0x194f97+_0x3278f4(0x14a));return unwrap(_0x416a1a);}function unwrap(_0x2ecc9b){const _0xf1cb4=a31_0x591648;if(_0x2ecc9b['data']!==undefined&&_0x2ecc9b[_0xf1cb4(0x156)]!==null)return _0x2ecc9b[_0xf1cb4(0x156)];if(typeof _0x2ecc9b===_0xf1cb4(0x15d)&&!(_0xf1cb4(0x14f)in _0x2ecc9b&&'msg'in _0x2ecc9b))return _0x2ecc9b;throw new Error(_0xf1cb4(0x133)+_0x2ecc9b[_0xf1cb4(0x14f)]+',\x20msg:\x20'+_0x2ecc9b[_0xf1cb4(0x13c)]+')');}function unwrapList(_0x14d245){const _0x4680e1=a31_0x591648;return _0x14d245[_0x4680e1(0x156)]?.['items']??[];}export async function createProject(_0xc234d4){const _0x2e0491=a31_0x591648;manageClient[_0x2e0491(0x150)]();const _0x56950e=await manageClient[_0x2e0491(0x143)](MANAGE_PREFIX+'/projects',{'team_id':_0xc234d4[_0x2e0491(0x131)],'project_name':_0xc234d4[_0x2e0491(0x136)],'description':_0xc234d4[_0x2e0491(0x157)]??''});return unwrap(_0x56950e);}export async function listProjects(_0x2f68e0){const _0x1f8495=a31_0x591648;manageClient[_0x1f8495(0x150)]();const _0x7772b6=await manageClient[_0x1f8495(0x148)](MANAGE_PREFIX+_0x1f8495(0x153)+_0x2f68e0+_0x1f8495(0x13f));return unwrapList(_0x7772b6);}export async function getProjectVersions(_0x4d1222){const _0xaefba2=a31_0x591648;manageClient[_0xaefba2(0x150)]();const _0x2ad9da=await manageClient[_0xaefba2(0x148)](MANAGE_PREFIX+_0xaefba2(0x139)+_0x4d1222+_0xaefba2(0x145));return unwrapList(_0x2ad9da);}export async function createVersion(_0x4db940,_0x3bf400){const _0x23493f=a31_0x591648;manageClient[_0x23493f(0x150)]();const _0x2bd1be=await manageClient[_0x23493f(0x143)](MANAGE_PREFIX+'/projects/'+_0x4db940+'/versions',{'version_number':_0x3bf400,'description':_0x3bf400+_0x23493f(0x146)});return unwrap(_0x2bd1be);}export async function publishVersion(_0x2c49a5,_0x286a76){const _0x10ded3=a31_0x591648;manageClient['initialize']();const _0x1dd2a5=await manageClient['post'](MANAGE_PREFIX+_0x10ded3(0x139)+_0x2c49a5+_0x10ded3(0x142)+_0x286a76+_0x10ded3(0x14d));return unwrap(_0x1dd2a5);}export async function getDeploymentStatus(_0x4ba7eb){const _0x427343=a31_0x591648;manageClient[_0x427343(0x150)]();const _0x1ecc24=await manageClient['get'](_0x427343(0x13d)+_0x4ba7eb);return unwrap(_0x1ecc24);}export async function lookupDeployment(_0xb16581,_0x452ca6){const _0x1d884c=a31_0x591648;manageClient[_0x1d884c(0x150)]();const _0x2931dd=await manageClient[_0x1d884c(0x148)](MANAGE_PREFIX+_0x1d884c(0x13b)+_0xb16581+'/'+_0x452ca6);return unwrap(_0x2931dd);}export async function recallDeployment(_0x4aced8){const _0x419adb=a31_0x591648;manageClient['initialize']();const _0x571f5b=await manageClient['post'](MANAGE_PREFIX+_0x419adb(0x139)+_0x4aced8+_0x419adb(0x158));return unwrap(_0x571f5b);}export async function downloadFrontend(_0x253848,_0x23d3c3){const _0x53dac6=a31_0x591648;manageClient['initialize']();const _0x37a30a=await manageClient[_0x53dac6(0x148)](MANAGE_PREFIX+_0x53dac6(0x139)+_0x253848+_0x53dac6(0x142)+_0x23d3c3+_0x53dac6(0x140));return unwrap(_0x37a30a);}export async function getProjectConfigs(_0x2b7239){const _0x2576ce=a31_0x591648;manageClient[_0x2576ce(0x150)]();const _0x1487ff=await manageClient[_0x2576ce(0x148)](MANAGE_PREFIX+_0x2576ce(0x139)+_0x2b7239+_0x2576ce(0x15b)),_0x120b0d=unwrap(_0x1487ff);if(Array[_0x2576ce(0x152)](_0x120b0d)){const _0x1a7026={};for(const _0x26e415 of _0x120b0d)_0x1a7026[_0x26e415[_0x2576ce(0x138)]]=_0x26e415[_0x2576ce(0x155)];return _0x1a7026;}return _0x120b0d;}export async function setProjectConfig(_0x94a0d5,_0xfa3dfb,_0x3be6d5){const _0x2bda85=a31_0x591648;manageClient[_0x2bda85(0x150)](),await manageClient[_0x2bda85(0x143)](MANAGE_PREFIX+_0x2bda85(0x139)+_0x94a0d5+'/configs',{'config_key':_0xfa3dfb,'config_value':_0x3be6d5});}export async function bindAppToProject(_0x593d8f,_0x14ae75,_0x3c08b8){const _0x820312=a31_0x591648;manageClient['initialize']();const _0x3bb05a=await manageClient[_0x820312(0x143)](MANAGE_PREFIX+_0x820312(0x139)+_0x593d8f+'/apps',{'open_app_id':_0x14ae75,'open_ssid':_0x3c08b8});return unwrap(_0x3bb05a);}export async function setDeploymentVisibility(_0x4eeee,_0x16af94,_0x53206a){const _0x43b69e=a31_0x591648;manageClient[_0x43b69e(0x150)]();const _0x5d9121={'visibility':_0x16af94};_0x16af94===_0x43b69e(0x15a)&&_0x53206a?.[_0x43b69e(0x132)]&&(_0x5d9121[_0x43b69e(0x13e)]=_0x53206a);const _0x1e330c=await manageClient[_0x43b69e(0x143)](MANAGE_PREFIX+'/projects/'+_0x4eeee+_0x43b69e(0x13a),_0x5d9121);return unwrap(_0x1e330c);}export async function getDeploymentVisibility(_0x161024){const _0x2e3cda=a31_0x591648;manageClient[_0x2e3cda(0x150)]();const _0x2a151c=await manageClient['get'](MANAGE_PREFIX+_0x2e3cda(0x139)+_0x161024+'/deployment/visibility');return unwrap(_0x2a151c);}export async function updateProjectAppScopes(_0x1e67d5,_0x1b2567,_0x3b90cc){const _0x5e021a=a31_0x591648;manageClient[_0x5e021a(0x150)]();const _0x12adc7=await manageClient[_0x5e021a(0x143)](MANAGE_PREFIX+'/projects/'+_0x1e67d5+'/apps/'+_0x1b2567+_0x5e021a(0x151),{'scopes':_0x3b90cc});return unwrap(_0x12adc7);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2360e6,_0x285018){const _0x3dece0=a32_0x46f6,_0x5d4d6b=_0x2360e6();while(!![]){try{const _0xae1cd=-parseInt(_0x3dece0(0xbf))/0x1+parseInt(_0x3dece0(0xd0))/0x2*(parseInt(_0x3dece0(0xc2))/0x3)+parseInt(_0x3dece0(0xcc))/0x4+-parseInt(_0x3dece0(0xc1))/0x5*(parseInt(_0x3dece0(0xca))/0x6)+-parseInt(_0x3dece0(0xd7))/0x7+parseInt(_0x3dece0(0xc3))/0x8+-parseInt(_0x3dece0(0xe0))/0x9*(parseInt(_0x3dece0(0xd4))/0xa);if(_0xae1cd===_0x285018)break;else _0x5d4d6b['push'](_0x5d4d6b['shift']());}catch(_0x1bba17){_0x5d4d6b['push'](_0x5d4d6b['shift']());}}}(a32_0x5929,0x73b28));import{getThreadState}from'./cloud-agent.js';import{getBuildStatus}from'./cloud-publish.js';import{getProjectVersions}from'./manage.js';function extractDescription(_0xbe2767){const _0x49bfcf=a32_0x46f6;if(typeof _0xbe2767==='string')return _0xbe2767;if(!_0xbe2767||typeof _0xbe2767!==_0x49bfcf(0xc9))return null;const _0x33695f=_0xbe2767;return _0x33695f[_0x49bfcf(0xc4)]??_0x33695f['message']??_0x33695f[_0x49bfcf(0xc8)]??null;}function extractInterrupt(_0x1e7e80){const _0x5da89e=a32_0x46f6;for(const _0x16cbb6 of _0x1e7e80){const _0x5c97de=_0x16cbb6,_0x83bc63=_0x5c97de[_0x5da89e(0xc6)];if(_0x83bc63?.[_0x5da89e(0xdf)]){const _0x524626=_0x83bc63[0x0],_0x96b972=_0x524626['value'];return{'waiting':!![],'description':extractDescription(_0x96b972),'value':_0x96b972};}}return{'waiting':![]};}function a32_0x46f6(_0x29bf72,_0x2b2cb3){_0x29bf72=_0x29bf72-0xbe;const _0x59291b=a32_0x5929();let _0x46f6f4=_0x59291b[_0x29bf72];return _0x46f6f4;}function settled(_0x37f2fe){const _0x504dc8=a32_0x46f6;return _0x37f2fe[_0x504dc8(0xd8)]==='fulfilled'?_0x37f2fe['value']:null;}function buildAgentBlock(_0x5f4225){const _0x304446=a32_0x46f6;if(!_0x5f4225)return{'messages_count':0x0,'file_count':0x0,'has_todos':![],'tasks_count':0x0};const _0x54a5da=_0x5f4225[_0x304446(0xdd)]?.[_0x304446(0xd3)],_0x4c1958=_0x5f4225['values']?.[_0x304446(0xd5)],_0x5ae931=_0x5f4225[_0x304446(0xdd)]?.[_0x304446(0xcf)];let _0x58deae=0x0;return _0x4c1958&&typeof _0x4c1958==='object'&&(_0x58deae=Object[_0x304446(0xbe)](_0x4c1958)[_0x304446(0xdf)]),{'messages_count':Array[_0x304446(0xc7)](_0x54a5da)?_0x54a5da[_0x304446(0xdf)]:0x0,'file_count':_0x58deae,'has_todos':Array[_0x304446(0xc7)](_0x5ae931)?_0x5ae931[_0x304446(0xdf)]>0x0:![],'tasks_count':Array['isArray'](_0x5f4225['tasks'])?_0x5f4225['tasks'][_0x304446(0xdf)]:0x0};}function buildBuildBlock(_0x209096){const _0x4790ac=a32_0x46f6;if(!_0x209096)return{'phase':_0x4790ac(0xe1),'message':''};return{'phase':_0x209096['phase'],'message':_0x209096['message']};}function buildDeployBlock(_0x2e7da2){const _0x265e38=a32_0x46f6;if(!_0x2e7da2)return{'status':'none','access_url':null,'short_url':null};const _0x349e54=_0x2e7da2[_0x265e38(0xcd)]?.[_0x265e38(0xde)];if(!_0x349e54)return{'status':_0x265e38(0xe1),'access_url':null,'short_url':null};const _0x2e304d={'deployed':_0x265e38(0xd9),'deploying':'deploying','failed':'failed'};return{'status':_0x2e304d[_0x349e54[_0x265e38(0xc5)]??'']??_0x265e38(0xe1),'access_url':_0x349e54[_0x265e38(0xdb)]||null,'short_url':_0x349e54['short_url']||null};}function a32_0x5929(){const _0x5c9a53=['1239972sQnDVX','7080528nWxGjT','description','deploy_status','interrupts','isArray','type','object','4198776zpXHhN','next','3589232bGuuKG','result','sort','todos','2yWpqvk','created_at','tasks','messages','22820jznHsQ','files','resolve','2771195YVPdNI','status','deployed','short_url','access_url','version_number','values','publishResponse','length','1719PEmDTO','none','keys','190259aPcnIk','allSettled','5HEWzqZ'];a32_0x5929=function(){return _0x5c9a53;};return a32_0x5929();}function buildProjectBlock(_0x407ff9,_0x286b6f){const _0x4148a7=a32_0x46f6;if(!_0x286b6f)return{'id':_0x407ff9,'name':null,'versions_count':0x0,'latest_version':null};const _0xe8b29a=[..._0x286b6f][_0x4148a7(0xce)]((_0x5a7142,_0x356394)=>_0x356394[_0x4148a7(0xd1)]-_0x5a7142[_0x4148a7(0xd1)]);return{'id':_0x407ff9,'name':null,'versions_count':_0x286b6f['length'],'latest_version':_0xe8b29a[0x0]?.[_0x4148a7(0xdc)]??null};}export async function getProjectContext(_0x949c95,_0x25c8b4){const _0x12d260=a32_0x46f6,[_0x1ff9f5,_0x199570,_0x219bd3]=await Promise[_0x12d260(0xc0)]([getThreadState(_0x949c95),getBuildStatus(_0x949c95),_0x25c8b4?getProjectVersions(_0x25c8b4):Promise[_0x12d260(0xd6)](null)]),_0x43b4c5=settled(_0x1ff9f5),_0x237b25=settled(_0x199570),_0x50da64=settled(_0x219bd3),_0x4744a0=buildDeployBlock(_0x237b25),_0x9b4f43=buildAgentBlock(_0x43b4c5),_0x409f98=_0x43b4c5?(_0x43b4c5[_0x12d260(0xcb)]?.[_0x12d260(0xdf)]??0x0)>0x0:![];return{'thread_id':_0x949c95,'agent':{..._0x9b4f43,'running':_0x409f98},'interrupt':extractInterrupt(_0x43b4c5?.[_0x12d260(0xd2)]??[]),'build':buildBuildBlock(_0x237b25),'deploy':_0x4744a0,'project':_0x25c8b4!=null?buildProjectBlock(_0x25c8b4,_0x50da64):null,'urls':{'runtime':_0x4744a0[_0x12d260(0xda)]||_0x4744a0[_0x12d260(0xdb)],'short_url':_0x4744a0[_0x12d260(0xda)]}};}
|
package/oclif.manifest.json
CHANGED
|
@@ -875,7 +875,76 @@
|
|
|
875
875
|
"code",
|
|
876
876
|
"upload.js"
|
|
877
877
|
]
|
|
878
|
+
},
|
|
879
|
+
"code:visibility": {
|
|
880
|
+
"aliases": [],
|
|
881
|
+
"args": {},
|
|
882
|
+
"description": "查看或设置项目的发布可见范围(仅自己 / 企业内 / 指定成员或团队)",
|
|
883
|
+
"examples": [
|
|
884
|
+
"<%= config.bin %> code visibility --project-id 477 --json",
|
|
885
|
+
"<%= config.bin %> code visibility --project-id 477 --set private",
|
|
886
|
+
"<%= config.bin %> code visibility --project-id 477 --set company --json",
|
|
887
|
+
"<%= config.bin %> code visibility --project-id 477 --set custom --grant user:100002 --grant team:100003",
|
|
888
|
+
"<%= config.bin %> code visibility --url https://o.wpsgo.com/app/41000207/6Ne2UkWT3ytn/ --set private"
|
|
889
|
+
],
|
|
890
|
+
"flags": {
|
|
891
|
+
"json": {
|
|
892
|
+
"description": "Format output as json.",
|
|
893
|
+
"helpGroup": "GLOBAL",
|
|
894
|
+
"name": "json",
|
|
895
|
+
"allowNo": false,
|
|
896
|
+
"type": "boolean"
|
|
897
|
+
},
|
|
898
|
+
"project-id": {
|
|
899
|
+
"description": "项目 ID(与 --url 二选一)",
|
|
900
|
+
"name": "project-id",
|
|
901
|
+
"hasDynamicHelp": false,
|
|
902
|
+
"multiple": false,
|
|
903
|
+
"type": "option"
|
|
904
|
+
},
|
|
905
|
+
"url": {
|
|
906
|
+
"description": "应用短链 URL(与 --project-id 二选一)",
|
|
907
|
+
"name": "url",
|
|
908
|
+
"hasDynamicHelp": false,
|
|
909
|
+
"multiple": false,
|
|
910
|
+
"type": "option"
|
|
911
|
+
},
|
|
912
|
+
"set": {
|
|
913
|
+
"description": "设置可见范围: private | company | custom",
|
|
914
|
+
"name": "set",
|
|
915
|
+
"hasDynamicHelp": false,
|
|
916
|
+
"multiple": false,
|
|
917
|
+
"options": [
|
|
918
|
+
"private",
|
|
919
|
+
"company",
|
|
920
|
+
"custom"
|
|
921
|
+
],
|
|
922
|
+
"type": "option"
|
|
923
|
+
},
|
|
924
|
+
"grant": {
|
|
925
|
+
"description": "授权对象,格式为 <type>:<id>(如 user:100002 或 team:100003),可多次指定;仅 --set custom 时有效",
|
|
926
|
+
"name": "grant",
|
|
927
|
+
"hasDynamicHelp": false,
|
|
928
|
+
"multiple": true,
|
|
929
|
+
"type": "option"
|
|
930
|
+
}
|
|
931
|
+
},
|
|
932
|
+
"hasDynamicHelp": false,
|
|
933
|
+
"hiddenAliases": [],
|
|
934
|
+
"id": "code:visibility",
|
|
935
|
+
"pluginAlias": "@wps365-open/comate-cli",
|
|
936
|
+
"pluginName": "@wps365-open/comate-cli",
|
|
937
|
+
"pluginType": "core",
|
|
938
|
+
"strict": true,
|
|
939
|
+
"enableJsonFlag": true,
|
|
940
|
+
"isESM": true,
|
|
941
|
+
"relativePath": [
|
|
942
|
+
"dist",
|
|
943
|
+
"commands",
|
|
944
|
+
"code",
|
|
945
|
+
"visibility.js"
|
|
946
|
+
]
|
|
878
947
|
}
|
|
879
948
|
},
|
|
880
|
-
"version": "0.0.
|
|
949
|
+
"version": "0.0.22"
|
|
881
950
|
}
|