@lovrabet/lovrabet-cli 2.0.7 → 2.0.9-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -0
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -0
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a17_0x2cec0d=a17_0x3ec0;(function(_0x52909c,_0x14223b){const _0x1e5994=a17_0x3ec0,_0x2ce4f2=_0x52909c();while(!![]){try{const _0x3c24b1=-parseInt(_0x1e5994(0x1c8))/0x1+parseInt(_0x1e5994(0x1e7))/0x2+parseInt(_0x1e5994(0x200))/0x3+-parseInt(_0x1e5994(0x1d9))/0x4+-parseInt(_0x1e5994(0x1cd))/0x5*(-parseInt(_0x1e5994(0x1e8))/0x6)+parseInt(_0x1e5994(0x1c4))/0x7*(-parseInt(_0x1e5994(0x1d4))/0x8)+-parseInt(_0x1e5994(0x1e4))/0x9*(-parseInt(_0x1e5994(0x1f3))/0xa);if(_0x3c24b1===_0x14223b)break;else _0x2ce4f2['push'](_0x2ce4f2['shift']());}catch(_0x22d7c8){_0x2ce4f2['push'](_0x2ce4f2['shift']());}}}(a17_0x1e35,0xa4c79));import{getDatasetDetail}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function a17_0x3ec0(_0x3caacd,_0x3b6dee){_0x3caacd=_0x3caacd-0x1c4;const _0x1e35fb=a17_0x1e35();let _0x3ec012=_0x1e35fb[_0x3caacd];return _0x3ec012;}function normalizeField(_0x6ee723){const _0x583c9b=a17_0x3ec0;if(_0x6ee723[_0x583c9b(0x1f0)])return null;const _0x19acf5=Boolean(_0x6ee723[_0x583c9b(0x1d6)]!==undefined||_0x6ee723[_0x583c9b(0x1e1)]!==undefined);let _0x4c7937={};if(!_0x19acf5&&typeof _0x6ee723[_0x583c9b(0x1ca)]===_0x583c9b(0x209))try{_0x4c7937=JSON[_0x583c9b(0x1d1)](_0x6ee723[_0x583c9b(0x1ca)]);}catch{}const _0x5a8ce0=_0x19acf5?_0x6ee723[_0x583c9b(0x201)]:_0x6ee723[_0x583c9b(0x1f8)],_0x586575=_0x19acf5?_0x6ee723[_0x583c9b(0x1d6)]:_0x6ee723['name'],_0x9a0643=_0x19acf5?_0x6ee723[_0x583c9b(0x1e1)]:_0x6ee723['type']||_0x6ee723['dataType'],_0x1ede3=_0x19acf5?_0x6ee723[_0x583c9b(0x1cf)]===!![]:_0x4c7937['pkField']===!![],_0x2e5b3a=_0x19acf5?_0x6ee723[_0x583c9b(0x1e5)]===!![]:_0x4c7937[_0x583c9b(0x1e5)]===!![],_0x49205f=_0x19acf5?_0x6ee723[_0x583c9b(0x208)]??null:_0x4c7937['options']??null,_0x46567e={'name':_0x5a8ce0,'displayName':_0x586575||_0x5a8ce0,'type':_0x9a0643,'dbType':_0x6ee723[_0x583c9b(0x1d2)],'pk':_0x1ede3,'required':_0x2e5b3a,'description':_0x6ee723[_0x583c9b(0x1d5)]||undefined};return Array['isArray'](_0x49205f)&&_0x49205f[_0x583c9b(0x207)]>0x0&&(_0x46567e['options']=_0x49205f),_0x46567e;}function parseJsonMaybe(_0x39ef93){const _0x285f08=a17_0x3ec0;if(typeof _0x39ef93!==_0x285f08(0x209))return _0x39ef93;try{return JSON[_0x285f08(0x1d1)](_0x39ef93);}catch{return _0x39ef93;}}function a17_0x1e35(){const _0x4c5398=['name','requestBody','toField','beforeScriptId','host','entries','length','options','string','properties','273guAYtR','responseBody','creatorNameField','operations','265164YxvbEQ','requestFields','extend','fromField','createTimeField','15ujvPSH','toTableName','pkField','dbtableConfig','parse','dbType','dbName','224568NIqnYN','description','displayName','modifierIdField','object','4522080bqPlYb','dbId','tableName','sourceType','map','indexes','method','isArray','doType','formatRules','read','92727kEnfLj','required','afterScriptId','405894TTzAKx','2565174JUsDMq','doVersion','toDatasetCode','filter','tableComment','modifierNameField','toDatasetName','str','deleted','creatorIdField','title','1030uxidHj','path','labelField','updateTimeField','modelCode','code','datasetKey','validateRules','relatedPageInfoList','toFieldLabel','responseFields','allFields','relations','1855941jrsyxL'];a17_0x1e35=function(){return _0x4c5398;};return a17_0x1e35();}function normalizeOperationEntry(_0x553b0b,_0x458ad9){const _0x57fcb7=a17_0x3ec0;if(!_0x458ad9||typeof _0x458ad9!==_0x57fcb7(0x1d8))return null;if(!_0x458ad9[_0x57fcb7(0x1df)]||!_0x458ad9['path'])return null;const _0x587510={'name':_0x553b0b,'method':_0x458ad9[_0x57fcb7(0x1df)],'path':_0x458ad9[_0x57fcb7(0x1f4)]};if(_0x458ad9[_0x57fcb7(0x205)])_0x587510[_0x57fcb7(0x205)]=_0x458ad9[_0x57fcb7(0x205)];if(_0x458ad9[_0x57fcb7(0x202)]!=null)_0x587510[_0x57fcb7(0x202)]=parseJsonMaybe(_0x458ad9[_0x57fcb7(0x202)]);if(_0x458ad9[_0x57fcb7(0x1c5)]!=null)_0x587510[_0x57fcb7(0x1c5)]=parseJsonMaybe(_0x458ad9[_0x57fcb7(0x1c5)]);if(_0x458ad9['beforeScriptId']!=null)_0x587510['beforeScriptId']=_0x458ad9[_0x57fcb7(0x204)];if(_0x458ad9[_0x57fcb7(0x1e6)]!=null)_0x587510[_0x57fcb7(0x1e6)]=_0x458ad9['afterScriptId'];if(Array['isArray'](_0x458ad9[_0x57fcb7(0x1c9)]))_0x587510['requestFields']=_0x458ad9[_0x57fcb7(0x1c9)];if(Array['isArray'](_0x458ad9[_0x57fcb7(0x1fd)]))_0x587510[_0x57fcb7(0x1fd)]=_0x458ad9[_0x57fcb7(0x1fd)];return _0x587510;}function summarizeDbtable(_0x413a3c){const _0x76e69=a17_0x3ec0,_0x5bc699={},_0x2d53ff=[_0x76e69(0x1da),_0x76e69(0x1d3),_0x76e69(0x1db),_0x76e69(0x1f9),_0x76e69(0x1cf),'allFields','logicField',_0x76e69(0x1cc),_0x76e69(0x1f6),_0x76e69(0x1f1),_0x76e69(0x1c6),_0x76e69(0x1d7),_0x76e69(0x1ed),_0x76e69(0x1f5),'dblinkInfoDTO'];for(const _0x156f87 of _0x2d53ff){if(_0x413a3c[_0x156f87]!==undefined)_0x5bc699[_0x156f87]=_0x413a3c[_0x156f87];}return typeof _0x5bc699[_0x76e69(0x1fe)]===_0x76e69(0x209)&&_0x5bc699[_0x76e69(0x1fe)]['length']>0x0&&(_0x5bc699['allFieldNames']=_0x5bc699['allFields']['split'](',')[_0x76e69(0x1dd)](_0x58ed5e=>_0x58ed5e['trim']())[_0x76e69(0x1eb)](Boolean)),_0x5bc699;}function normalizeRelatedPages(_0xee1c7b){const _0x2ee89b=a17_0x3ec0;if(!Array[_0x2ee89b(0x1e0)](_0xee1c7b))return[];return _0xee1c7b[_0x2ee89b(0x1eb)](_0x4cad49=>_0x4cad49&&typeof _0x4cad49===_0x2ee89b(0x1d8))[_0x2ee89b(0x1dd)](_0x2eae6b=>({'id':_0x2eae6b['id'],'type':_0x2eae6b['type'],'code':_0x2eae6b[_0x2ee89b(0x1f8)],'title':_0x2eae6b[_0x2ee89b(0x1f2)],'deleted':_0x2eae6b[_0x2ee89b(0x1f0)]===!![]}));}export const datasetDetail={'service':'dataset','command':'detail','description':'Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','risk':a17_0x2cec0d(0x1e3),'flags':[CODE_FLAG],async 'execute'(_0x351c21){const _0xbbf7fa=a17_0x2cec0d,_0xce32ab=await getDatasetDetail(_0x351c21[_0xbbf7fa(0x1ef)](_0xbbf7fa(0x1f8))),_0x30bfe4=Array['isArray'](_0xce32ab['fields'])?_0xce32ab['fields']:Array['isArray'](_0xce32ab[_0xbbf7fa(0x20a)])?_0xce32ab[_0xbbf7fa(0x20a)]:[],_0x1f85c5=_0x30bfe4['map'](_0x181bb=>normalizeField(_0x181bb))[_0xbbf7fa(0x1eb)](_0x3bbfa0=>_0x3bbfa0!==null),_0x5b7991=_0xce32ab[_0xbbf7fa(0x1c7)]??{},_0x554aaf=[];for(const [_0x4dc4cf,_0x1bb08d]of Object[_0xbbf7fa(0x206)](_0x5b7991)){const _0x218a00=normalizeOperationEntry(_0x4dc4cf,_0x1bb08d);if(_0x218a00)_0x554aaf['push'](_0x218a00);}const _0xdf0cfc=_0xce32ab[_0xbbf7fa(0x1d0)]??{},_0x1f7aaf=_0xce32ab['dataset']??{},_0xabee0e=_0xdf0cfc['dbId']!=null?{'id':_0xdf0cfc[_0xbbf7fa(0x1da)],'name':_0xdf0cfc[_0xbbf7fa(0x1d3)]??null}:undefined;let _0x35ccf6;return typeof _0xce32ab['extend']===_0xbbf7fa(0x209)&&(_0x35ccf6=parseJsonMaybe(_0xce32ab[_0xbbf7fa(0x1ca)])),{'ok':!![],'data':{'id':_0xce32ab['modelId']??_0xce32ab['id'],'name':_0xce32ab['name'],'code':_0xce32ab[_0xbbf7fa(0x1f7)]||_0xce32ab[_0xbbf7fa(0x1f8)],'doVersion':_0xce32ab[_0xbbf7fa(0x1e9)],'description':_0xce32ab[_0xbbf7fa(0x1d5)]||_0x1f7aaf[_0xbbf7fa(0x1ec)]||undefined,'source':_0xce32ab['source']||_0x1f7aaf[_0xbbf7fa(0x1dc)],'table':_0xdf0cfc[_0xbbf7fa(0x1db)]||_0x1f7aaf[_0xbbf7fa(0x1db)],'datasetKey':_0xdf0cfc[_0xbbf7fa(0x1f9)],'pk':_0xdf0cfc['pkField'],'db':_0xabee0e,'dbtable':summarizeDbtable(_0xdf0cfc),'fields':_0x1f85c5,'operations':_0x554aaf,'indexes':Array[_0xbbf7fa(0x1e0)](_0x1f7aaf[_0xbbf7fa(0x1de)])?_0x1f7aaf[_0xbbf7fa(0x1de)]:[],'relations':Array[_0xbbf7fa(0x1e0)](_0xce32ab[_0xbbf7fa(0x1ff)])?_0xce32ab[_0xbbf7fa(0x1ff)]['map'](_0x49cb31=>({'fromField':_0x49cb31[_0xbbf7fa(0x1cb)],'toDataset':_0x49cb31[_0xbbf7fa(0x1ee)],'toCode':_0x49cb31[_0xbbf7fa(0x1ea)],'toTable':_0x49cb31[_0xbbf7fa(0x1ce)],'toField':_0x49cb31[_0xbbf7fa(0x203)],'labelField':_0x49cb31[_0xbbf7fa(0x1fc)]||undefined})):[],'relatedPages':normalizeRelatedPages(_0xce32ab[_0xbbf7fa(0x1fb)]),...Array[_0xbbf7fa(0x1e0)](_0xce32ab['columnCodeListWithDeleted'])?{'columnCodeListWithDeleted':_0xce32ab['columnCodeListWithDeleted']}:{},'formatRules':Array['isArray'](_0xce32ab[_0xbbf7fa(0x1e2)])?_0xce32ab[_0xbbf7fa(0x1e2)]:[],'validateRules':Array[_0xbbf7fa(0x1e0)](_0xce32ab[_0xbbf7fa(0x1fa)])?_0xce32ab[_0xbbf7fa(0x1fa)]:[],..._0x35ccf6!==undefined?{'extend':_0x35ccf6}:{},'stats':{'fieldCount':_0x1f85c5[_0xbbf7fa(0x207)],'operationCount':_0x554aaf[_0xbbf7fa(0x207)]}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x85ce1d,_0x262476){const _0x56019a=a18_0x1254,_0x562cd6=_0x85ce1d();while(!![]){try{const _0x41e633=parseInt(_0x56019a(0x133))/0x1+parseInt(_0x56019a(0x130))/0x2*(-parseInt(_0x56019a(0x134))/0x3)+-parseInt(_0x56019a(0x131))/0x4+parseInt(_0x56019a(0x12d))/0x5+-parseInt(_0x56019a(0x132))/0x6+-parseInt(_0x56019a(0x12f))/0x7+parseInt(_0x56019a(0x12e))/0x8;if(_0x41e633===_0x262476)break;else _0x562cd6['push'](_0x562cd6['shift']());}catch(_0x5530fc){_0x562cd6['push'](_0x562cd6['shift']());}}}(a18_0x4387,0xa51bf));import{datasetList}from'../../commands/dataset/list.js';function a18_0x4387(){const _0x5ae8c8=['6810012uopydj','707938pxiAYe','6PKkJiq','1373685KLDoxK','37935200SInpbj','8549471cXVsJs','1346626SnmhID','5381228IFRChN'];a18_0x4387=function(){return _0x5ae8c8;};return a18_0x4387();}import{datasetDetail}from'../../commands/dataset/detail.js';function a18_0x1254(_0x24c3e6,_0x29b2b9){_0x24c3e6=_0x24c3e6-0x12d;const _0x4387e7=a18_0x4387();let _0x125410=_0x4387e7[_0x24c3e6];return _0x125410;}export const datasetDefinitions=[datasetList,datasetDetail];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x2baed3=a19_0x7460;function a19_0x7460(_0xe714b3,_0x2a3fc2){_0xe714b3=_0xe714b3-0x151;const _0x238e27=a19_0x238e();let _0x74609=_0x238e27[_0xe714b3];return _0x74609;}function a19_0x238e(){const _0x58c509=['description','dataset','tableName','237650cUtFVH','6681790oDjWZD','str','36mIknca','appCode','length','4VenoVt','map','trim','112xVDteC','1124128cCYjib','1255521WdEikf','string','49511ltPOXd','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','source','pkField','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','code','name','178983ZjjofS','11042JqCRHx','list'];a19_0x238e=function(){return _0x58c509;};return a19_0x238e();}(function(_0x185c78,_0x1d71f1){const _0x1c40a1=a19_0x7460,_0x51b63a=_0x185c78();while(!![]){try{const _0x52d213=-parseInt(_0x1c40a1(0x163))/0x1*(parseInt(_0x1c40a1(0x154))/0x2)+-parseInt(_0x1c40a1(0x159))/0x3+-parseInt(_0x1c40a1(0x158))/0x4+-parseInt(_0x1c40a1(0x168))/0x5+parseInt(_0x1c40a1(0x151))/0x6*(parseInt(_0x1c40a1(0x15b))/0x7)+-parseInt(_0x1c40a1(0x157))/0x8*(-parseInt(_0x1c40a1(0x162))/0x9)+parseInt(_0x1c40a1(0x169))/0xa;if(_0x52d213===_0x1d71f1)break;else _0x51b63a['push'](_0x51b63a['shift']());}catch(_0x83bdb6){_0x51b63a['push'](_0x51b63a['shift']());}}}(a19_0x238e,0x35aea));import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';export const datasetList={'service':a19_0x2baed3(0x166),'command':a19_0x2baed3(0x164),'description':a19_0x2baed3(0x15c),'risk':'read','flags':[{'name':a19_0x2baed3(0x161),'type':a19_0x2baed3(0x15a),'description':'Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)'},{...CODE_FLAG,'required':![],'description':a19_0x2baed3(0x15f)}],async 'execute'(_0x480f39){const _0x2c62a5=a19_0x2baed3,_0xeee6ce=_0x480f39[_0x2c62a5(0x16a)]('name'),_0xa647b2=_0x480f39[_0x2c62a5(0x16a)](_0x2c62a5(0x160)),_0x3c2d57=await listDatasets(_0x480f39[_0x2c62a5(0x152)],{..._0xeee6ce&&{'name':_0xeee6ce},..._0xa647b2&&{'code':_0xa647b2}});return{'ok':!![],'data':{'total':_0x3c2d57[_0x2c62a5(0x153)],'datasets':_0x3c2d57[_0x2c62a5(0x155)](_0x22921b=>{const _0x1aadaf=_0x2c62a5,_0x534f97=_0x22921b['dbtableConfig']??{};return{'id':_0x22921b['id'],'code':_0x22921b[_0x1aadaf(0x160)],'name':_0x22921b['name'],'source':_0x22921b[_0x1aadaf(0x15d)],'description':_0x22921b[_0x1aadaf(0x165)],'table':_0x534f97[_0x1aadaf(0x167)],'datasetKey':_0x534f97['datasetKey'],'pk':_0x534f97[_0x1aadaf(0x15e)],'fields':_0x534f97['allFields']?_0x534f97['allFields']['split'](',')[_0x1aadaf(0x155)](_0x690ce3=>_0x690ce3[_0x1aadaf(0x156)]()):[]};})}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a20_0x3b3151=a20_0x238c;(function(_0x3b7c84,_0x4b6068){const _0x4b2a59=a20_0x238c,_0x4cd24d=_0x3b7c84();while(!![]){try{const _0x2b85e9=parseInt(_0x4b2a59(0xdc))/0x1+parseInt(_0x4b2a59(0xf4))/0x2*(parseInt(_0x4b2a59(0xd2))/0x3)+parseInt(_0x4b2a59(0xd8))/0x4*(parseInt(_0x4b2a59(0xdd))/0x5)+parseInt(_0x4b2a59(0xd1))/0x6*(parseInt(_0x4b2a59(0xdb))/0x7)+parseInt(_0x4b2a59(0x116))/0x8*(-parseInt(_0x4b2a59(0x109))/0x9)+-parseInt(_0x4b2a59(0x10c))/0xa*(parseInt(_0x4b2a59(0xf9))/0xb)+-parseInt(_0x4b2a59(0xe7))/0xc;if(_0x2b85e9===_0x4b6068)break;else _0x4cd24d['push'](_0x4cd24d['shift']());}catch(_0x153cf9){_0x4cd24d['push'](_0x4cd24d['shift']());}}}(a20_0x5a0d,0x93b56));import a20_0x58d8c8 from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';function a20_0x5a0d(){const _0x304257=['repeat','(none)','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','log','verbose','26382wMtXVE','empty','env','\x20\x20Merged\x20Config','\x20\x20Config\x20JSON','11zcvWFU','\x20\x20Config\x20Files','doctor','\x20\x20API\x20Endpoints','(not\x20set)','✓\x20Valid\x20JSON','message','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','format','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','read','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','gray','\x20\x20Session\x20check:\x20\x20\x20','\x20\x20runtimeDomain:\x20\x20\x20','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','72270vPEPOI','currentApp','appCode','4186870JWlFkL','(not\x20found)','accessKey','(default)','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','missing','locale','Global','\x20\x20auth\x20(effective):\x20','160OffOxe','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','12UpoUVP','201iLxyxu','red','status','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','(missing)','\x20doctor','2121124Ggblyj','\x20(legacy/compat\x20only)','⚠\x20Empty\x20(treated\x20as\x20{})','3082793MvlOrf','940844uQOSQa','5vbEPeI','padEnd','bold','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','platform','\x20\x20─','(set,\x20length=','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','ClientAk','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','24617028FIKntM','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','pageSize','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','(no\x20file)','Project','\x20\x20Auth','green'];a20_0x5a0d=function(){return _0x304257;};return a20_0x5a0d();}import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';async function execute(_0x50d7c8){const _0x5e7c9f=a20_0x238c,_0x50bc8a=getCliVersion(),_0x4569d8=buildConfigFromFlags({});await initGlobalEnvironment(_0x4569d8),console[_0x5e7c9f(0xf2)](),console['log'](a20_0x58d8c8[_0x5e7c9f(0xdf)](CLI_BIN_NAME+_0x5e7c9f(0xd7))),console['log'](a20_0x58d8c8[_0x5e7c9f(0x105)]('─'['repeat'](0x32))),console[_0x5e7c9f(0xf2)](_0x5e7c9f(0x104)+_0x50bc8a),console['log'](_0x5e7c9f(0xd0)+process['version']),console[_0x5e7c9f(0xf2)](_0x5e7c9f(0x110)+process[_0x5e7c9f(0xe1)]+'\x20'+process['arch']),console['log'](),console[_0x5e7c9f(0xf2)](a20_0x58d8c8['bold'](_0x5e7c9f(0xfa))),console['log'](a20_0x58d8c8[_0x5e7c9f(0x105)](_0x5e7c9f(0xe2)[_0x5e7c9f(0xef)](0x1e)));const _0x5566a0=getGlobalConfigPath(),_0x3dcca5=getProjectConfigPath();console[_0x5e7c9f(0xf2)](_0x5e7c9f(0xd5)+(_0x5566a0||a20_0x58d8c8['gray'](_0x5e7c9f(0x10d)))),console[_0x5e7c9f(0xf2)](_0x5e7c9f(0xcf)+(_0x3dcca5||a20_0x58d8c8[_0x5e7c9f(0x105)](_0x5e7c9f(0x10d)))),console[_0x5e7c9f(0xf2)](),console[_0x5e7c9f(0xf2)](a20_0x58d8c8[_0x5e7c9f(0xdf)](_0x5e7c9f(0xf8))),console[_0x5e7c9f(0xf2)](a20_0x58d8c8[_0x5e7c9f(0x105)]('\x20\x20─'[_0x5e7c9f(0xef)](0x1e)));const _0x25a4b6=(_0x200023,_0x41ebf3)=>{const _0x267229=_0x5e7c9f;if(!_0x41ebf3){console[_0x267229(0xf2)]('\x20\x20'+_0x200023['padEnd'](0x11)+'\x20'+a20_0x58d8c8[_0x267229(0x105)](_0x267229(0xeb)));return;}const _0x3e164b=inspectCliConfigJsonFile(_0x41ebf3);if(_0x3e164b[_0x267229(0xd4)]==='ok')console[_0x267229(0xf2)]('\x20\x20'+_0x200023['padEnd'](0x11)+'\x20'+a20_0x58d8c8[_0x267229(0xee)](_0x267229(0xfe)));else{if(_0x3e164b[_0x267229(0xd4)]===_0x267229(0xf5))console[_0x267229(0xf2)]('\x20\x20'+_0x200023['padEnd'](0x11)+'\x20'+a20_0x58d8c8['yellow'](_0x267229(0xda)));else _0x3e164b[_0x267229(0xd4)]===_0x267229(0x112)?console[_0x267229(0xf2)]('\x20\x20'+_0x200023['padEnd'](0x11)+'\x20'+a20_0x58d8c8[_0x267229(0x105)](_0x267229(0xd6))):(console[_0x267229(0xf2)]('\x20\x20'+_0x200023[_0x267229(0xde)](0x11)+'\x20'+a20_0x58d8c8[_0x267229(0xd3)]('✗\x20Invalid\x20JSON')),console[_0x267229(0xf2)]('\x20\x20'+''[_0x267229(0xde)](0x11)+'\x20'+a20_0x58d8c8['red'](_0x3e164b[_0x267229(0xff)])));}};_0x25a4b6(_0x5e7c9f(0x114),_0x5566a0),_0x25a4b6(_0x5e7c9f(0xec),_0x3dcca5),console[_0x5e7c9f(0xf2)](),console[_0x5e7c9f(0xf2)](a20_0x58d8c8[_0x5e7c9f(0xdf)](_0x5e7c9f(0xf7))),console['log'](a20_0x58d8c8[_0x5e7c9f(0x105)](_0x5e7c9f(0xe2)[_0x5e7c9f(0xef)](0x1e))),console[_0x5e7c9f(0xf2)](_0x5e7c9f(0x100)+(_0x4569d8[_0x5e7c9f(0x10b)]||a20_0x58d8c8[_0x5e7c9f(0xd3)](_0x5e7c9f(0xfd)))),console[_0x5e7c9f(0xf2)](_0x5e7c9f(0x117)+_0x4569d8[_0x5e7c9f(0xf6)]);const _0x5f08cc=isLegacyCompatConfigKey(_0x5e7c9f(0x113))?a20_0x58d8c8['gray'](_0x4569d8[_0x5e7c9f(0x113)]+_0x5e7c9f(0xd9)):_0x4569d8[_0x5e7c9f(0x113)];return console[_0x5e7c9f(0xf2)](_0x5e7c9f(0xe6)+_0x5f08cc),console[_0x5e7c9f(0xf2)](_0x5e7c9f(0x108)+(_0x4569d8['defaultApp']||a20_0x58d8c8['gray'](_0x5e7c9f(0xf0)))),console['log'](_0x5e7c9f(0x102)+(_0x4569d8[_0x5e7c9f(0x10a)]||a20_0x58d8c8[_0x5e7c9f(0x105)](_0x5e7c9f(0xf0)))),console['log'](_0x5e7c9f(0xe0)+(_0x4569d8[_0x5e7c9f(0x101)]||a20_0x58d8c8[_0x5e7c9f(0x105)]('(default:\x20'+DEFAULT_CONFIG_VALUES[_0x5e7c9f(0x101)]+')'))),console[_0x5e7c9f(0xf2)](_0x5e7c9f(0xe8)+(_0x4569d8[_0x5e7c9f(0xe9)]??a20_0x58d8c8[_0x5e7c9f(0x105)](_0x5e7c9f(0x10f)))),console[_0x5e7c9f(0xf2)](_0x5e7c9f(0xf1)+_0x4569d8['riskLevel']),console[_0x5e7c9f(0xf2)]('\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x4569d8[_0x5e7c9f(0xf3)]),console[_0x5e7c9f(0xf2)](_0x5e7c9f(0x115)+AUTH_MODE[_0x5e7c9f(0xe5)]),console[_0x5e7c9f(0xf2)](_0x5e7c9f(0xea)+(_0x4569d8[_0x5e7c9f(0x10e)]?a20_0x58d8c8[_0x5e7c9f(0xee)](_0x5e7c9f(0xe3)+_0x4569d8[_0x5e7c9f(0x10e)]['length']+')'):a20_0x58d8c8[_0x5e7c9f(0x105)](_0x5e7c9f(0xf0)))),console[_0x5e7c9f(0xf2)](),console[_0x5e7c9f(0xf2)](a20_0x58d8c8[_0x5e7c9f(0xdf)](_0x5e7c9f(0xfc))),console['log'](a20_0x58d8c8[_0x5e7c9f(0x105)](_0x5e7c9f(0xe2)['repeat'](0x1e))),console['log'](_0x5e7c9f(0x111)+getApiDomain()),console[_0x5e7c9f(0xf2)](_0x5e7c9f(0xe4)+getUserDomain()),console[_0x5e7c9f(0xf2)](_0x5e7c9f(0x107)+getRuntimeDomain()),console[_0x5e7c9f(0xf2)](),console[_0x5e7c9f(0xf2)](a20_0x58d8c8[_0x5e7c9f(0xdf)](_0x5e7c9f(0xed))),console[_0x5e7c9f(0xf2)](a20_0x58d8c8[_0x5e7c9f(0x105)](_0x5e7c9f(0xe2)[_0x5e7c9f(0xef)](0x1e))),console['log']('\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+a20_0x58d8c8['green'](AUTH_MODE[_0x5e7c9f(0xe5)]+'\x20(accessKey)')),console[_0x5e7c9f(0xf2)](_0x5e7c9f(0x106)+a20_0x58d8c8[_0x5e7c9f(0x105)]('(removed\x20—\x20cookie\x20auth\x20disabled)')),console[_0x5e7c9f(0xf2)](),{'ok':!![]};}function a20_0x238c(_0x59d9a9,_0x2d0961){_0x59d9a9=_0x59d9a9-0xcf;const _0x5a0dd2=a20_0x5a0d();let _0x238c9b=_0x5a0dd2[_0x59d9a9];return _0x238c9b;}export const doctorDefinition={'service':a20_0x3b3151(0xfb),'command':'check','description':'Diagnose\x20CLI\x20configuration\x20and\x20environment','risk':a20_0x3b3151(0x103),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a21_0x4cbd69=a21_0x8939;(function(_0x5811ed,_0x1012f2){const _0x312873=a21_0x8939,_0x252901=_0x5811ed();while(!![]){try{const _0x270792=-parseInt(_0x312873(0x19a))/0x1+parseInt(_0x312873(0x186))/0x2+-parseInt(_0x312873(0x189))/0x3*(parseInt(_0x312873(0x193))/0x4)+-parseInt(_0x312873(0x17b))/0x5+-parseInt(_0x312873(0x16e))/0x6+parseInt(_0x312873(0x177))/0x7*(parseInt(_0x312873(0x192))/0x8)+parseInt(_0x312873(0x15c))/0x9;if(_0x270792===_0x1012f2)break;else _0x252901['push'](_0x252901['shift']());}catch(_0x434a50){_0x252901['push'](_0x252901['shift']());}}}(a21_0x4e41,0x507d2));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';function a21_0x8939(_0x3af7ff,_0x4020c4){_0x3af7ff=_0x3af7ff-0x15c;const _0x4e4188=a21_0x4e41();let _0x89399d=_0x4e4188[_0x3af7ff];return _0x89399d;}import{CliErrors}from'../errors.js';function a21_0x4e41(){const _0x2214ed=['flagMissing','Failed\x20to\x20parse\x20source\x20file:\x20','apps','object','validation','8rPaJuo','1915896sktDRP','name','Usage:\x20','project','cancelled','app','Override\x20imported\x20default\x20appcode','460151LqxUeU','log','[Y/n]','utf8','App\x20code\x20for\x20the\x20project','App\x20code\x20cannot\x20be\x20empty.','12211272kpQaAY','Aborted.','Write\x20to\x20global\x20(~/','file','stdin','removeListener','File\x20','App\x20code','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','\x20\x20appcode:\x20','race','message','Override\x20imported\x20default\x20env','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','env','yes','Initialized\x20','string','1503516RUFDbi','Skip\x20confirmation\x20when\x20overwriting','entries','apiDir','[y/N]','appcode','Imported\x20from\x20','includes','once','2915521fHcKVo','SIGINT','trim','join','1530980dsMjio','riskLevel','question','User\x20aborted\x20prompt','stdout','boolean',')\x20instead\x20of\x20project','global','\x20init\x20—\x20Create\x20','newConfigFileName','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','104556OWpXFy','parse','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','3NXlzFk','close','\x20\x20env:\x20\x20\x20\x20\x20','Invalid\x20env\x20\x22'];a21_0x4e41=function(){return _0x2214ed;};return a21_0x4e41();}import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a21_0x4cbd69(0x173),'type':a21_0x4cbd69(0x16d),'description':a21_0x4cbd69(0x19e)},{'name':a21_0x4cbd69(0x16a),'type':'string','description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES[a21_0x4cbd69(0x16a)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x4cbd69(0x182),'type':a21_0x4cbd69(0x180),'description':a21_0x4cbd69(0x15e)+PRODUCT_CONFIG[a21_0x4cbd69(0x184)]+a21_0x4cbd69(0x181),'default':![]},{'name':a21_0x4cbd69(0x16b),'type':a21_0x4cbd69(0x180),'description':a21_0x4cbd69(0x16f),'default':![]}];export const initImportFlagDefs=[{'name':'file','type':a21_0x4cbd69(0x16d),'description':a21_0x4cbd69(0x185),'required':!![]},{'name':a21_0x4cbd69(0x173),'type':'string','description':a21_0x4cbd69(0x199)},{'name':a21_0x4cbd69(0x16a),'type':a21_0x4cbd69(0x16d),'description':a21_0x4cbd69(0x168),'enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a21_0x4cbd69(0x180),'description':a21_0x4cbd69(0x15e)+PRODUCT_CONFIG[a21_0x4cbd69(0x184)]+a21_0x4cbd69(0x181),'default':![]},{'name':a21_0x4cbd69(0x16b),'type':a21_0x4cbd69(0x180),'description':a21_0x4cbd69(0x16f),'default':![]}];export async function runInit(_0x4632f8){const _0x13b986=a21_0x4cbd69,_0x14e54e=isNonInteractiveMode(_0x4632f8),_0x317fbb=_0x4632f8[_0x13b986(0x182)]?_0x13b986(0x182):_0x13b986(0x196),_0x346c79=resolveWriteConfigPath(_0x317fbb);try{_0x14e54e?await runNonInteractive(_0x4632f8,_0x346c79):await runInteractive(_0x4632f8,_0x346c79);}catch(_0x9769ed){if(_0x9769ed instanceof AbortPrompt)throw CliErrors[_0x13b986(0x197)]();throw _0x9769ed;}}export async function runInitImport(_0x2e5966){const _0x2e0baa=a21_0x4cbd69,_0x18d9ba=_0x2e5966[_0x2e0baa(0x182)]?_0x2e0baa(0x182):_0x2e0baa(0x196),_0x5b9a6=resolveWriteConfigPath(_0x18d9ba);await runFromImport(_0x2e5966,_0x5b9a6);}const RUNTIME_IRRELEVANT_KEYS=new Set([a21_0x4cbd69(0x171)]);async function runFromImport(_0x480806,_0x2c0c81){const _0x59c88d=a21_0x4cbd69,_0x529d79=resolveFilePath(_0x480806[_0x59c88d(0x15f)]);if(!existsSync(_0x529d79))throw CliErrors[_0x59c88d(0x191)]('Source\x20file\x20not\x20found:\x20'+_0x529d79);const _0x740844=readSourceFile(_0x529d79),_0x504d3a=convertToRuntimeConfig(_0x740844);_0x480806['appcode']&&(_0x504d3a[_0x59c88d(0x173)]=String(_0x480806[_0x59c88d(0x173)]));_0x480806[_0x59c88d(0x16a)]&&(_0x504d3a[_0x59c88d(0x16a)]=resolveInitEnv(_0x480806));if(!_0x504d3a[_0x59c88d(0x173)])throw CliErrors[_0x59c88d(0x191)](_0x59c88d(0x164),'Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.');await writeInitConfig(_0x2c0c81,_0x504d3a,_0x480806),console[_0x59c88d(0x19b)](_0x59c88d(0x174)+_0x529d79),console[_0x59c88d(0x19b)]('\x20\x20config:\x20\x20'+_0x2c0c81),console[_0x59c88d(0x19b)](_0x59c88d(0x165)+_0x504d3a['appcode']);if(_0x504d3a['defaultApp'])console[_0x59c88d(0x19b)]('\x20\x20default:\x20'+_0x504d3a['defaultApp']);}function convertToRuntimeConfig(_0x2cad81){const _0x5ada12=a21_0x4cbd69;if(_0x2cad81[_0x5ada12(0x18f)]&&typeof _0x2cad81[_0x5ada12(0x18f)]===_0x5ada12(0x190))throw CliErrors['validation'](_0x5ada12(0x169),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x5d51e7={};for(const _0x30c4a7 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x2cad81[_0x30c4a7]!==undefined&&(_0x5d51e7[_0x30c4a7]=_0x2cad81[_0x30c4a7]);}return!_0x5d51e7[_0x5ada12(0x17c)]&&(_0x5d51e7[_0x5ada12(0x17c)]=DEFAULT_CONFIG_VALUES[_0x5ada12(0x17c)]),_0x5d51e7;}async function runNonInteractive(_0x48fb0b,_0x46a84a){const _0x3dacc3=a21_0x4cbd69,_0x520a48=_0x48fb0b[_0x3dacc3(0x173)];if(!_0x520a48)throw CliErrors[_0x3dacc3(0x18d)](_0x3dacc3(0x173),_0x3dacc3(0x195)+CLI_BIN_NAME+_0x3dacc3(0x188));const _0x23e1ae=resolveInitEnv(_0x48fb0b);await writeInitConfig(_0x46a84a,{'appcode':_0x520a48,'env':_0x23e1ae},_0x48fb0b),console[_0x3dacc3(0x19b)](_0x3dacc3(0x16c)+_0x46a84a),console['log']('\x20\x20appcode:\x20'+_0x520a48),console[_0x3dacc3(0x19b)](_0x3dacc3(0x18b)+_0x23e1ae);}async function runInteractive(_0x5135e1,_0xf7cea5){const _0x50c7e1=a21_0x4cbd69,_0x17c545=loadExisting(_0xf7cea5),_0x5478c1=typeof _0x17c545?.['appcode']===_0x50c7e1(0x16d)?_0x17c545['appcode']:'',_0xb52b05=resolveInitEnv(_0x5135e1);console[_0x50c7e1(0x19b)](CLI_BIN_NAME+_0x50c7e1(0x183)+PRODUCT_CONFIG[_0x50c7e1(0x184)]+'\x0a');if(existsSync(_0xf7cea5)&&!_0x5135e1[_0x50c7e1(0x16b)]){const _0x26cd3b=await promptYesNo(_0x50c7e1(0x162)+_0xf7cea5+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x26cd3b){console[_0x50c7e1(0x19b)](_0x50c7e1(0x15d));return;}}const _0x583fb6=typeof _0x5135e1['appcode']===_0x50c7e1(0x16d)?_0x5135e1['appcode'][_0x50c7e1(0x179)]():'';let _0x394b48=_0x583fb6;!_0x394b48&&(_0x394b48=await promptInput(_0x50c7e1(0x163),_0x5478c1));if(!_0x394b48[_0x50c7e1(0x179)]())throw CliErrors[_0x50c7e1(0x191)](_0x50c7e1(0x19f));await writeInitConfig(_0xf7cea5,{'appcode':_0x394b48['trim'](),'env':_0xb52b05},_0x5135e1),console[_0x50c7e1(0x19b)]('\x0aInitialized\x20'+_0xf7cea5),console['log']('\x20\x20appcode:\x20'+_0x394b48[_0x50c7e1(0x179)]()),console[_0x50c7e1(0x19b)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0xb52b05);}async function writeInitConfig(_0xc8c07f,_0x4caa18,_0x3a080d){const _0x3626c8=a21_0x4cbd69;let _0x89b9da={};existsSync(_0xc8c07f)&&!_0x3a080d[_0x3626c8(0x16b)]&&(_0x89b9da=readConfigFile(_0xc8c07f));for(const [_0x1b5ea4,_0x4e7285]of Object[_0x3626c8(0x170)](_0x4caa18)){_0x4e7285!==undefined&&(_0x89b9da[_0x1b5ea4]=_0x4e7285);}if(_0x89b9da[_0x3626c8(0x198)])delete _0x89b9da[_0x3626c8(0x198)];writeConfigFile(_0xc8c07f,_0x89b9da);}class AbortPrompt extends Error{constructor(){const _0x213859=a21_0x4cbd69;super(_0x213859(0x17e)),this[_0x213859(0x194)]='AbortPrompt';}}function createSafeRl(){const _0x4b5ded=a21_0x4cbd69,_0x55d944=createInterface({'input':process[_0x4b5ded(0x160)],'output':process[_0x4b5ded(0x17f)]});let _0x10a104;const _0x5ab252=new Promise((_0x2e13ce,_0x320801)=>{const _0x11e0be=_0x4b5ded;_0x10a104=()=>{const _0x3cb52b=a21_0x8939;_0x10a104&&(_0x55d944['removeListener'](_0x3cb52b(0x178),_0x10a104),_0x10a104=undefined);try{_0x55d944[_0x3cb52b(0x18a)]();}catch{}_0x320801(new AbortPrompt());},_0x55d944[_0x11e0be(0x176)](_0x11e0be(0x178),_0x10a104);}),_0x5d6543=()=>{const _0x1172ca=_0x4b5ded;_0x10a104&&(_0x55d944[_0x1172ca(0x161)](_0x1172ca(0x178),_0x10a104),_0x10a104=undefined);try{_0x55d944[_0x1172ca(0x18a)]();}catch{}};return{'rl':_0x55d944,'abortPromise':_0x5ab252,'disposeSuccess':_0x5d6543};}async function promptInput(_0x26a4c1,_0x1aa0ac){const {rl:_0x2bf77d,abortPromise:_0x14d709,disposeSuccess:_0x5a2d5b}=createSafeRl(),_0x5d747c=new Promise(_0x89ec90=>{const _0x335fb7=a21_0x8939,_0x4ad33d=_0x1aa0ac?'\x20\x20'+_0x26a4c1+'\x20('+_0x1aa0ac+'):\x20':'\x20\x20'+_0x26a4c1+':\x20';_0x2bf77d[_0x335fb7(0x17d)](_0x4ad33d,_0xb1197a=>{const _0x3f8c2c=_0x335fb7;_0x5a2d5b(),_0x89ec90(_0xb1197a[_0x3f8c2c(0x179)]()||_0x1aa0ac);});});return Promise['race']([_0x5d747c,_0x14d709]);}async function promptYesNo(_0x646720,_0x2f66e9){const _0x5b0c52=a21_0x4cbd69,{rl:_0x3da0fb,abortPromise:_0x3d6965,disposeSuccess:_0xd632f5}=createSafeRl(),_0x5a0870=new Promise(_0x55441f=>{const _0x339bda=a21_0x8939,_0x2c8bef=_0x2f66e9?_0x339bda(0x19c):_0x339bda(0x172);_0x3da0fb[_0x339bda(0x17d)]('\x20\x20'+_0x646720+'\x20'+_0x2c8bef+':\x20',_0x5dbc54=>{const _0x3477b7=_0x339bda;_0xd632f5();const _0x610e75=_0x5dbc54['trim']()['toLowerCase']();if(_0x610e75==='y'||_0x610e75===_0x3477b7(0x16b))_0x55441f(!![]);else{if(_0x610e75==='n'||_0x610e75==='no')_0x55441f(![]);else _0x55441f(_0x2f66e9);}});});return Promise[_0x5b0c52(0x166)]([_0x5a0870,_0x3d6965]);}function loadExisting(_0x4a937d){if(!existsSync(_0x4a937d))return null;return readConfigFile(_0x4a937d);}function resolveFilePath(_0x196c08){return isAbsolute(_0x196c08)?_0x196c08:resolve(process['cwd'](),_0x196c08);}function readSourceFile(_0x1a32d2){const _0x39b404=a21_0x4cbd69;try{const _0x197166=readFileSync(_0x1a32d2,{'encoding':_0x39b404(0x19d)});return JSON[_0x39b404(0x187)](_0x197166);}catch(_0x38998b){throw CliErrors[_0x39b404(0x191)](_0x39b404(0x18e)+_0x38998b[_0x39b404(0x167)]);}}function resolveInitEnv(_0x1a991e){const _0x2c642b=a21_0x4cbd69,_0x2413e7=_0x1a991e['env'];if(_0x2413e7===undefined||_0x2413e7==='')return DEFAULT_CONFIG_VALUES[_0x2c642b(0x16a)];if(!RUNTIME_ENV_VALUES[_0x2c642b(0x175)](_0x2413e7))throw CliErrors[_0x2c642b(0x191)](_0x2c642b(0x18c)+_0x2413e7+'\x22.\x20Allowed:\x20'+RUNTIME_ENV_VALUES[_0x2c642b(0x17a)](',\x20'));return _0x2413e7;}
|
|
1
|
+
const a21_0x24d3f4=a21_0x2cae;(function(_0x4c380b,_0x252de6){const _0x3008bc=a21_0x2cae,_0x4a15e8=_0x4c380b();while(!![]){try{const _0x3da32c=parseInt(_0x3008bc(0x106))/0x1*(parseInt(_0x3008bc(0x104))/0x2)+parseInt(_0x3008bc(0xf5))/0x3*(-parseInt(_0x3008bc(0x12e))/0x4)+parseInt(_0x3008bc(0x109))/0x5+-parseInt(_0x3008bc(0x107))/0x6*(-parseInt(_0x3008bc(0x10e))/0x7)+parseInt(_0x3008bc(0x11b))/0x8*(-parseInt(_0x3008bc(0xef))/0x9)+-parseInt(_0x3008bc(0x12c))/0xa*(-parseInt(_0x3008bc(0xfe))/0xb)+parseInt(_0x3008bc(0x12d))/0xc*(parseInt(_0x3008bc(0x120))/0xd);if(_0x3da32c===_0x252de6)break;else _0x4a15e8['push'](_0x4a15e8['shift']());}catch(_0x3eae13){_0x4a15e8['push'](_0x4a15e8['shift']());}}}(a21_0xec52,0xea491));function a21_0xec52(){const _0x5ebd41=['project','once','string','\x20\x20default:\x20','appcode','newConfigFileName','boolean','Invalid\x20env\x20\x22','416581SHVyAr','Write\x20to\x20global\x20(~/','apps','User\x20aborted\x20prompt','riskLevel','stdin','10zAAyoj','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','218301ifFURM','9798WXZPcd','toLowerCase','521985urlRxc','global','log','yes','join','3962wyScgW','\x22.\x20Allowed:\x20','defaultApp','app','[Y/n]','\x0aInitialized\x20','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','):\x20','Source\x20file\x20not\x20found:\x20','AbortPrompt',')\x20instead\x20of\x20project','App\x20code\x20cannot\x20be\x20empty.','Failed\x20to\x20parse\x20source\x20file:\x20','31576VwxRiA','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','App\x20code','file','Imported\x20from\x20','3855007vTvHQB','race','entries','Initialized\x20','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','trim','question','\x20\x20env:\x20\x20\x20\x20\x20','name','stdout','cancelled','File\x20','60KVNeTd','12MrhLGZ','1648uEulqJ','validation','Skip\x20confirmation\x20when\x20overwriting','removeListener','env','object','cwd','Override\x20imported\x20default\x20appcode','\x20\x20config:\x20\x20','1476uYLEBT','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','includes','close','SIGINT','\x20\x20appcode:\x20','7551xhvqiA'];a21_0xec52=function(){return _0x5ebd41;};return a21_0xec52();}import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a21_0x24d3f4(0xfa),'type':a21_0x24d3f4(0xf8),'description':'App\x20code\x20for\x20the\x20project'},{'name':a21_0x24d3f4(0x132),'type':a21_0x24d3f4(0xf8),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES['env']+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a21_0x24d3f4(0xfc),'description':a21_0x24d3f4(0xff)+PRODUCT_CONFIG[a21_0x24d3f4(0xfb)]+a21_0x24d3f4(0x118),'default':![]},{'name':a21_0x24d3f4(0x10c),'type':a21_0x24d3f4(0xfc),'description':a21_0x24d3f4(0x130),'default':![]}];export const initImportFlagDefs=[{'name':a21_0x24d3f4(0x11e),'type':a21_0x24d3f4(0xf8),'description':a21_0x24d3f4(0x124),'required':!![]},{'name':a21_0x24d3f4(0xfa),'type':a21_0x24d3f4(0xf8),'description':a21_0x24d3f4(0xed)},{'name':a21_0x24d3f4(0x132),'type':'string','description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x24d3f4(0x10a),'type':a21_0x24d3f4(0xfc),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG['newConfigFileName']+a21_0x24d3f4(0x118),'default':![]},{'name':'yes','type':a21_0x24d3f4(0xfc),'description':a21_0x24d3f4(0x130),'default':![]}];export async function runInit(_0x323b86){const _0xb311e2=a21_0x24d3f4,_0x2255a7=isNonInteractiveMode(_0x323b86),_0xe584c8=_0x323b86['global']?_0xb311e2(0x10a):_0xb311e2(0xf6),_0x1cc656=resolveWriteConfigPath(_0xe584c8);try{_0x2255a7?await runNonInteractive(_0x323b86,_0x1cc656):await runInteractive(_0x323b86,_0x1cc656);}catch(_0x3de886){if(_0x3de886 instanceof AbortPrompt)throw CliErrors[_0xb311e2(0x12a)]();throw _0x3de886;}}export async function runInitImport(_0x538880){const _0x53f69b=a21_0x24d3f4,_0x4d699f=_0x538880[_0x53f69b(0x10a)]?_0x53f69b(0x10a):_0x53f69b(0xf6),_0x15c5b1=resolveWriteConfigPath(_0x4d699f);await runFromImport(_0x538880,_0x15c5b1);}const RUNTIME_IRRELEVANT_KEYS=new Set(['apiDir']);async function runFromImport(_0x5a3c88,_0x19c4af){const _0xa1d4b9=a21_0x24d3f4,_0x10bd41=resolveFilePath(_0x5a3c88[_0xa1d4b9(0x11e)]);if(!existsSync(_0x10bd41))throw CliErrors['validation'](_0xa1d4b9(0x116)+_0x10bd41);const _0x2ad90c=readSourceFile(_0x10bd41),_0x222632=convertToRuntimeConfig(_0x2ad90c);_0x5a3c88[_0xa1d4b9(0xfa)]&&(_0x222632['appcode']=String(_0x5a3c88['appcode']));_0x5a3c88[_0xa1d4b9(0x132)]&&(_0x222632[_0xa1d4b9(0x132)]=resolveInitEnv(_0x5a3c88));if(!_0x222632[_0xa1d4b9(0xfa)])throw CliErrors[_0xa1d4b9(0x12f)](_0xa1d4b9(0x114),_0xa1d4b9(0x11c));await writeInitConfig(_0x19c4af,_0x222632,_0x5a3c88),console[_0xa1d4b9(0x10b)](_0xa1d4b9(0x11f)+_0x10bd41),console['log'](_0xa1d4b9(0xee)+_0x19c4af),console['log']('\x20\x20appcode:\x20'+_0x222632[_0xa1d4b9(0xfa)]);if(_0x222632['defaultApp'])console[_0xa1d4b9(0x10b)](_0xa1d4b9(0xf9)+_0x222632[_0xa1d4b9(0x110)]);}function convertToRuntimeConfig(_0x35d360){const _0x842e75=a21_0x24d3f4;if(_0x35d360['apps']&&typeof _0x35d360[_0x842e75(0x100)]===_0x842e75(0x133))throw CliErrors[_0x842e75(0x12f)](_0x842e75(0x105),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x2b6183={};for(const _0x2539b9 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x35d360[_0x2539b9]!==undefined&&(_0x2b6183[_0x2539b9]=_0x35d360[_0x2539b9]);}return!_0x2b6183['riskLevel']&&(_0x2b6183['riskLevel']=DEFAULT_CONFIG_VALUES[_0x842e75(0x102)]),_0x2b6183;}async function runNonInteractive(_0x1745c9,_0x118249){const _0x426f45=a21_0x24d3f4,_0x526d40=_0x1745c9[_0x426f45(0xfa)];if(!_0x526d40)throw CliErrors['flagMissing'](_0x426f45(0xfa),'Usage:\x20'+CLI_BIN_NAME+_0x426f45(0xf0));const _0x33b5ce=resolveInitEnv(_0x1745c9);await writeInitConfig(_0x118249,{'appcode':_0x526d40,'env':_0x33b5ce},_0x1745c9),console[_0x426f45(0x10b)](_0x426f45(0x123)+_0x118249),console[_0x426f45(0x10b)](_0x426f45(0xf4)+_0x526d40),console[_0x426f45(0x10b)](_0x426f45(0x127)+_0x33b5ce);}async function runInteractive(_0x50c16a,_0x244c96){const _0xc22a7=a21_0x24d3f4,_0x46bfcd=loadExisting(_0x244c96),_0x43a6fa=typeof _0x46bfcd?.[_0xc22a7(0xfa)]===_0xc22a7(0xf8)?_0x46bfcd['appcode']:'',_0x668940=resolveInitEnv(_0x50c16a);console['log'](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG[_0xc22a7(0xfb)]+'\x0a');if(existsSync(_0x244c96)&&!_0x50c16a[_0xc22a7(0x10c)]){const _0x418698=await promptYesNo(_0xc22a7(0x12b)+_0x244c96+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x418698){console['log']('Aborted.');return;}}const _0x490c4a=typeof _0x50c16a[_0xc22a7(0xfa)]===_0xc22a7(0xf8)?_0x50c16a[_0xc22a7(0xfa)]['trim']():'';let _0x18daf7=_0x490c4a;!_0x18daf7&&(_0x18daf7=await promptInput(_0xc22a7(0x11d),_0x43a6fa));if(!_0x18daf7[_0xc22a7(0x125)]())throw CliErrors[_0xc22a7(0x12f)](_0xc22a7(0x119));await writeInitConfig(_0x244c96,{'appcode':_0x18daf7[_0xc22a7(0x125)](),'env':_0x668940},_0x50c16a),console[_0xc22a7(0x10b)](_0xc22a7(0x113)+_0x244c96),console[_0xc22a7(0x10b)](_0xc22a7(0xf4)+_0x18daf7[_0xc22a7(0x125)]()),console['log']('\x20\x20env:\x20\x20\x20\x20\x20'+_0x668940);}async function writeInitConfig(_0x3f6fc1,_0x540104,_0x19dd3e){const _0x2aec05=a21_0x24d3f4;let _0x50abe4={};existsSync(_0x3f6fc1)&&!_0x19dd3e[_0x2aec05(0x10c)]&&(_0x50abe4=readConfigFile(_0x3f6fc1));for(const [_0x1303aa,_0x44efc9]of Object[_0x2aec05(0x122)](_0x540104)){_0x44efc9!==undefined&&(_0x50abe4[_0x1303aa]=_0x44efc9);}if(_0x50abe4['app'])delete _0x50abe4[_0x2aec05(0x111)];writeConfigFile(_0x3f6fc1,_0x50abe4);}class AbortPrompt extends Error{constructor(){const _0x29852c=a21_0x24d3f4;super(_0x29852c(0x101)),this[_0x29852c(0x128)]=_0x29852c(0x117);}}function createSafeRl(){const _0x4ce388=a21_0x24d3f4,_0x1618fc=createInterface({'input':process[_0x4ce388(0x103)],'output':process[_0x4ce388(0x129)]});let _0x224739;const _0xf06209=new Promise((_0x4bb8fd,_0x5b3f73)=>{const _0x3f952c=_0x4ce388;_0x224739=()=>{const _0x2b780b=a21_0x2cae;_0x224739&&(_0x1618fc['removeListener'](_0x2b780b(0xf3),_0x224739),_0x224739=undefined);try{_0x1618fc[_0x2b780b(0xf2)]();}catch{}_0x5b3f73(new AbortPrompt());},_0x1618fc[_0x3f952c(0xf7)](_0x3f952c(0xf3),_0x224739);}),_0x1ffa9e=()=>{const _0x5e2fff=_0x4ce388;_0x224739&&(_0x1618fc[_0x5e2fff(0x131)](_0x5e2fff(0xf3),_0x224739),_0x224739=undefined);try{_0x1618fc['close']();}catch{}};return{'rl':_0x1618fc,'abortPromise':_0xf06209,'disposeSuccess':_0x1ffa9e};}async function promptInput(_0x57b25b,_0x24d039){const _0x1ff025=a21_0x24d3f4,{rl:_0x5b44f5,abortPromise:_0x36fb3f,disposeSuccess:_0x2fd7cd}=createSafeRl(),_0x3c18ff=new Promise(_0x36e147=>{const _0x4db67a=a21_0x2cae,_0xeeefc9=_0x24d039?'\x20\x20'+_0x57b25b+'\x20('+_0x24d039+_0x4db67a(0x115):'\x20\x20'+_0x57b25b+':\x20';_0x5b44f5[_0x4db67a(0x126)](_0xeeefc9,_0x47805f=>{const _0x53cc34=_0x4db67a;_0x2fd7cd(),_0x36e147(_0x47805f[_0x53cc34(0x125)]()||_0x24d039);});});return Promise[_0x1ff025(0x121)]([_0x3c18ff,_0x36fb3f]);}function a21_0x2cae(_0x3f1ec5,_0x4d5a00){_0x3f1ec5=_0x3f1ec5-0xec;const _0xec521b=a21_0xec52();let _0x2cae03=_0xec521b[_0x3f1ec5];return _0x2cae03;}async function promptYesNo(_0x14f754,_0x3a32fc){const _0x3dc31e=a21_0x24d3f4,{rl:_0x50580a,abortPromise:_0x899664,disposeSuccess:_0xe31dc0}=createSafeRl(),_0x3bef58=new Promise(_0x526f38=>{const _0x4df40b=a21_0x2cae,_0x48294c=_0x3a32fc?_0x4df40b(0x112):'[y/N]';_0x50580a[_0x4df40b(0x126)]('\x20\x20'+_0x14f754+'\x20'+_0x48294c+':\x20',_0x197abf=>{const _0xa75add=_0x4df40b;_0xe31dc0();const _0x1519c7=_0x197abf[_0xa75add(0x125)]()[_0xa75add(0x108)]();if(_0x1519c7==='y'||_0x1519c7===_0xa75add(0x10c))_0x526f38(!![]);else{if(_0x1519c7==='n'||_0x1519c7==='no')_0x526f38(![]);else _0x526f38(_0x3a32fc);}});});return Promise[_0x3dc31e(0x121)]([_0x3bef58,_0x899664]);}function loadExisting(_0x408d10){if(!existsSync(_0x408d10))return null;return readConfigFile(_0x408d10);}function resolveFilePath(_0x5b1842){const _0x354d7c=a21_0x24d3f4;return isAbsolute(_0x5b1842)?_0x5b1842:resolve(process[_0x354d7c(0xec)](),_0x5b1842);}function readSourceFile(_0x5bb3d5){const _0x48cfee=a21_0x24d3f4;try{const _0x3145fa=readFileSync(_0x5bb3d5,{'encoding':'utf8'});return JSON['parse'](_0x3145fa);}catch(_0x5715d9){throw CliErrors['validation'](_0x48cfee(0x11a)+_0x5715d9['message']);}}function resolveInitEnv(_0x532fe7){const _0x2e25df=a21_0x24d3f4,_0x45030d=_0x532fe7[_0x2e25df(0x132)];if(_0x45030d===undefined||_0x45030d==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x2e25df(0xf1)](_0x45030d))throw CliErrors['validation'](_0x2e25df(0xfd)+_0x45030d+_0x2e25df(0x10f)+RUNTIME_ENV_VALUES[_0x2e25df(0x10d)](',\x20'));return _0x45030d;}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a22_0x3547(){const _0x1531ef=['appCode','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','1090golUPz','--topk\x20must\x20be\x20a\x20positive\x20number.','trim','isFinite','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','map','file','detail','165txXXMz','1101898QyawSe','create','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','flag','verbose','1859763dEDLSH','2540625ODNerq','score','4suKkrZ','build','/client/knowledge-base/personal/','ragStatus','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','POST','query','content','title','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','ragErrorMessage','21564JhWYjC','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','2TratwZ','userId','weightedScore','4866582aOAOwm','Created\x20KB\x20entry\x20','topk','validation','File\x20path\x20is\x20required.','length','docId','list','number','num','Personal\x20knowledge-base\x20entry\x20title','Personal\x20knowledge-base\x20entry\x20ID','/update','write','read','/client/knowledge-base/personal/create','File\x20not\x20found:\x20','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','480696KPnNjZ','Override\x20the\x20existing\x20entry\x20title','body','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','updateTime','415709byCSMg','string','File\x20is\x20not\x20a\x20regular\x20file:\x20','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','16wSZHyO','description','str','Updated\x20KB\x20entry\x20','isFile','scope'];a22_0x3547=function(){return _0x1531ef;};return a22_0x3547();}const a22_0x435563=a22_0x3cef;(function(_0x38de91,_0x34cf6e){const _0x312b6f=a22_0x3cef,_0x1b811c=_0x38de91();while(!![]){try{const _0x595c5f=-parseInt(_0x312b6f(0x208))/0x1*(-parseInt(_0x312b6f(0x1ee))/0x2)+-parseInt(_0x312b6f(0x1de))/0x3*(parseInt(_0x312b6f(0x1e1))/0x4)+parseInt(_0x312b6f(0x1df))/0x5+parseInt(_0x312b6f(0x1f1))/0x6+-parseInt(_0x312b6f(0x1d9))/0x7*(parseInt(_0x312b6f(0x20c))/0x8)+parseInt(_0x312b6f(0x1ec))/0x9*(parseInt(_0x312b6f(0x1d0))/0xa)+-parseInt(_0x312b6f(0x1d8))/0xb*(parseInt(_0x312b6f(0x203))/0xc);if(_0x595c5f===_0x34cf6e)break;else _0x1b811c['push'](_0x1b811c['shift']());}catch(_0x4950ee){_0x1b811c['push'](_0x1b811c['shift']());}}}(a22_0x3547,0x706bc));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a22_0x435563(0x1e9),'type':a22_0x435563(0x209),'required':!![],'description':a22_0x435563(0x1fb)},FILE_FLAG={'name':'file','type':a22_0x435563(0x209),'required':!![],'description':a22_0x435563(0x1db)},QUERY_FLAG={'name':a22_0x435563(0x1e7),'type':a22_0x435563(0x209),'required':!![],'description':'Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge'},TOPK_FLAG={'name':'topk','type':a22_0x435563(0x1f9),'description':a22_0x435563(0x1ea)};function a22_0x3cef(_0x27f9a2,_0x3c4209){_0x27f9a2=_0x27f9a2-0x1cd;const _0x3547cb=a22_0x3547();let _0x3cefb9=_0x3547cb[_0x27f9a2];return _0x3cefb9;}function readKnowledgeFile(_0x5971ca){const _0x58986e=a22_0x435563;if(!_0x5971ca)throw CliErrors[_0x58986e(0x1f4)](_0x58986e(0x1f5));if(!existsSync(_0x5971ca))throw CliErrors[_0x58986e(0x1f4)](_0x58986e(0x201)+_0x5971ca);if(!statSync(_0x5971ca)[_0x58986e(0x210)]())throw CliErrors[_0x58986e(0x1f4)](_0x58986e(0x20a)+_0x5971ca);return readFileSync(_0x5971ca,'utf8');}function summarizePersonalItem(_0xd342d3){const _0x29c317=a22_0x435563;return{'id':_0xd342d3['id'],'title':_0xd342d3[_0x29c317(0x1e9)],'version':_0xd342d3['version'],'ragStatus':_0xd342d3[_0x29c317(0x1e4)],'ragErrorMessage':_0xd342d3[_0x29c317(0x1eb)],'updateTime':_0xd342d3[_0x29c317(0x207)]};}function detailPersonalItem(_0x5615d8){const _0x5ef91d=a22_0x435563;return{'id':_0x5615d8['id'],'appCode':_0x5615d8[_0x5ef91d(0x1ce)],'scope':_0x5615d8[_0x5ef91d(0x1cd)],'userId':_0x5615d8[_0x5ef91d(0x1ef)],'title':_0x5615d8[_0x5ef91d(0x1e9)],'content':_0x5615d8[_0x5ef91d(0x1e8)]??'','version':_0x5615d8['version'],'ragStatus':_0x5615d8['ragStatus'],'ragErrorMessage':_0x5615d8[_0x5ef91d(0x1eb)],'createTime':_0x5615d8['createTime'],'updateTime':_0x5615d8[_0x5ef91d(0x207)]};}function summarizeSearchHit(_0x6d1477){const _0x3ab469=a22_0x435563;return{'scope':_0x6d1477['scope'],'docId':_0x6d1477[_0x3ab469(0x1f7)],'score':_0x6d1477[_0x3ab469(0x1e0)],'weightedScore':_0x6d1477[_0x3ab469(0x1f0)],'content':_0x6d1477[_0x3ab469(0x1e8)],'metadata':_0x6d1477['metadata']};}function readTopK(_0x369243){const _0x59d1be=a22_0x435563,_0x169110=_0x369243[_0x59d1be(0x1dc)](_0x59d1be(0x1f3));if(_0x169110===undefined||_0x169110===null||_0x169110==='')return undefined;const _0x1c546a=_0x369243['num'](_0x59d1be(0x1f3));if(!Number[_0x59d1be(0x1d3)](_0x1c546a)||_0x1c546a<0x1)throw CliErrors[_0x59d1be(0x1f4)](_0x59d1be(0x1d1));return _0x1c546a;}const kbList={'service':'kb','command':a22_0x435563(0x1f8),'description':a22_0x435563(0x1cf),'risk':a22_0x435563(0x1ff),'flags':[VERBOSE_FLAG],async 'execute'(_0x3f7774){const _0x57f0b0=a22_0x435563,_0x679526=await listPersonalKnowledgeBaseItems(_0x3f7774[_0x57f0b0(0x1ce)]);if(_0x3f7774['bool'](_0x57f0b0(0x1dd)))return{'ok':!![],'data':{'total':_0x679526[_0x57f0b0(0x1f6)],'items':_0x679526}};return{'ok':!![],'data':{'total':_0x679526[_0x57f0b0(0x1f6)],'items':_0x679526[_0x57f0b0(0x1d5)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a22_0x435563(0x1d7),'description':a22_0x435563(0x20b),'risk':'read','flags':[{...ID_FLAG,'description':'Personal\x20knowledge-base\x20entry\x20ID'}],async 'execute'(_0x2c93c8){const _0x2b3af6=a22_0x435563,_0x27f6c5=await getPersonalKnowledgeBaseItem(_0x2c93c8['num']('id'),_0x2c93c8[_0x2b3af6(0x1ce)]);return{'ok':!![],'data':detailPersonalItem(_0x27f6c5)};}},kbCreate={'service':'kb','command':a22_0x435563(0x1da),'description':a22_0x435563(0x1d4),'risk':a22_0x435563(0x1fe),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x996513){const _0x548ff6=a22_0x435563,_0x49d906=_0x996513[_0x548ff6(0x20e)]('title'),_0x1317dc=readKnowledgeFile(_0x996513[_0x548ff6(0x20e)](_0x548ff6(0x1d6))),_0x9f71b=await createPersonalKnowledgeBaseItem(_0x996513['appCode'],{'title':_0x49d906,'content':_0x1317dc});return{'ok':!![],'data':summarizePersonalItem(_0x9f71b),'message':_0x548ff6(0x1f2)+_0x9f71b['id']+'\x20('+_0x9f71b[_0x548ff6(0x1e9)]+')'};},async 'dryRun'(_0x4cae56){const _0xfdc180=a22_0x435563,_0x1ed84e=_0x4cae56[_0xfdc180(0x20e)]('title'),_0x2fa9f6=readKnowledgeFile(_0x4cae56[_0xfdc180(0x20e)](_0xfdc180(0x1d6)));return dryRun(_0xfdc180(0x1e6),_0xfdc180(0x200))[_0xfdc180(0x205)]({'appCode':_0x4cae56['appCode'],'title':_0x1ed84e,'content':_0x2fa9f6})[_0xfdc180(0x20d)](_0xfdc180(0x1ed)+_0x1ed84e+'\x22')[_0xfdc180(0x1e2)]();}},kbUpdate={'service':'kb','command':'update','description':a22_0x435563(0x1e5),'risk':'write','flags':[{...ID_FLAG,'description':a22_0x435563(0x1fc)},{...TITLE_FLAG,'required':![],'description':a22_0x435563(0x204)},FILE_FLAG],async 'execute'(_0x2ffc4d){const _0x529bad=a22_0x435563,_0x5bac37=_0x2ffc4d[_0x529bad(0x1fa)]('id'),_0x58de14=readKnowledgeFile(_0x2ffc4d[_0x529bad(0x20e)](_0x529bad(0x1d6))),_0x11e5b4=_0x2ffc4d[_0x529bad(0x20e)]('title')||(await getPersonalKnowledgeBaseItem(_0x5bac37,_0x2ffc4d[_0x529bad(0x1ce)]))[_0x529bad(0x1e9)],_0x3c0780=await updatePersonalKnowledgeBaseItem(_0x5bac37,_0x2ffc4d['appCode'],{'title':_0x11e5b4,'content':_0x58de14});return{'ok':!![],'data':summarizePersonalItem(_0x3c0780),'message':_0x529bad(0x20f)+_0x3c0780['id']+'\x20('+_0x3c0780[_0x529bad(0x1e9)]+')'};},async 'dryRun'(_0x75a7ad){const _0x99e3df=a22_0x435563,_0x4cf27d=_0x75a7ad[_0x99e3df(0x1fa)]('id'),_0x4ba366=readKnowledgeFile(_0x75a7ad[_0x99e3df(0x20e)](_0x99e3df(0x1d6))),_0x399a96=_0x75a7ad[_0x99e3df(0x20e)](_0x99e3df(0x1e9))||(await getPersonalKnowledgeBaseItem(_0x4cf27d,_0x75a7ad[_0x99e3df(0x1ce)]))[_0x99e3df(0x1e9)];return dryRun(_0x99e3df(0x1e6),_0x99e3df(0x1e3)+_0x4cf27d+_0x99e3df(0x1fd))[_0x99e3df(0x205)]({'appCode':_0x75a7ad[_0x99e3df(0x1ce)],'title':_0x399a96,'content':_0x4ba366})[_0x99e3df(0x20d)](_0x99e3df(0x206)+_0x4cf27d)[_0x99e3df(0x1e2)]();}},kbSearch={'service':'kb','command':'search','description':a22_0x435563(0x202),'risk':a22_0x435563(0x1ff),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x102d2f){const _0xb329eb=a22_0x435563;if(!_0x102d2f[_0xb329eb(0x20e)](_0xb329eb(0x1e7))[_0xb329eb(0x1d2)]())throw CliErrors['validation']('Search\x20query\x20is\x20required.');readTopK(_0x102d2f);},async 'execute'(_0x2fea60){const _0x451942=a22_0x435563,_0x26c858=_0x2fea60[_0x451942(0x20e)](_0x451942(0x1e7))[_0x451942(0x1d2)](),_0x5b726b=readTopK(_0x2fea60),_0x3aec87=await searchKnowledgeBase(_0x2fea60['appCode'],{'query':_0x26c858,'topK':_0x5b726b});return{'ok':!![],'data':{'total':_0x3aec87['length'],'hits':_0x3aec87[_0x451942(0x1d5)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a23_0xb46b(){const _0x45b604=['logs','1643232UURPcs','level','1475632SMZmBC','12631130bircsJ','3GpGhhh','43312MQFkcI','168988mNobJW','length','show','clearLogs','log','message','88pgfWnZ','44wrXPBp','timestamp','9QkkVty','readLogs','*\x20No\x20logs\x20found','\x20\x20\x20Time:\x20','761928JUkJCl','toLocaleString','30magXwg','522340EYOwSH','details','keys','duration','\x20logs:\x0a','\x20\x20\x20Details:\x20','command'];a23_0xb46b=function(){return _0x45b604;};return a23_0xb46b();}const a23_0x53eb38=a23_0x4d69;(function(_0x3a8a17,_0x534796){const _0x453196=a23_0x4d69,_0x24e362=_0x3a8a17();while(!![]){try{const _0x3e75cd=-parseInt(_0x453196(0x16e))/0x1*(-parseInt(_0x453196(0x176))/0x2)+parseInt(_0x453196(0x16d))/0x3*(parseInt(_0x453196(0x16f))/0x4)+parseInt(_0x453196(0x17e))/0x5*(-parseInt(_0x453196(0x17c))/0x6)+parseInt(_0x453196(0x17f))/0x7+parseInt(_0x453196(0x16b))/0x8+parseInt(_0x453196(0x178))/0x9*(parseInt(_0x453196(0x16c))/0xa)+-parseInt(_0x453196(0x175))/0xb*(parseInt(_0x453196(0x169))/0xc);if(_0x3e75cd===_0x534796)break;else _0x24e362['push'](_0x24e362['shift']());}catch(_0x39f0d8){_0x24e362['push'](_0x24e362['shift']());}}}(a23_0xb46b,0xa11aa));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x1a4617){const _0x260b28=a23_0x4d69;if(_0x1a4617[_0x260b28(0x170)]===0x0){console[_0x260b28(0x173)](_0x260b28(0x17a));return;}console['log']('*\x20'+CLI_DISPLAY_NAME+_0x260b28(0x183)),_0x1a4617['forEach']((_0x53c420,_0x41fc37)=>{const _0x3d9d8c=_0x260b28,_0x4d3468=new Date(_0x53c420[_0x3d9d8c(0x177)])[_0x3d9d8c(0x17d)]('en-US'),_0x29f47b=_0x53c420[_0x3d9d8c(0x16a)]==='success'?'√':_0x53c420[_0x3d9d8c(0x16a)]==='error'?'×':_0x53c420[_0x3d9d8c(0x16a)]==='warn'?'!':'i';console[_0x3d9d8c(0x173)](_0x41fc37+0x1+'.\x20'+_0x29f47b+'\x20['+_0x53c420[_0x3d9d8c(0x167)]+']\x20'+_0x53c420[_0x3d9d8c(0x174)]),console[_0x3d9d8c(0x173)](_0x3d9d8c(0x17b)+_0x4d3468),_0x53c420[_0x3d9d8c(0x182)]&&console[_0x3d9d8c(0x173)]('\x20\x20\x20Duration:\x20'+_0x53c420['duration']+'ms'),_0x53c420[_0x3d9d8c(0x180)]&&Object[_0x3d9d8c(0x181)](_0x53c420[_0x3d9d8c(0x180)])[_0x3d9d8c(0x170)]>0x0&&console['log'](_0x3d9d8c(0x166)+JSON['stringify'](_0x53c420[_0x3d9d8c(0x180)],null,0x2)),console['log']('');});}function a23_0x4d69(_0x1c8031,_0x154634){_0x1c8031=_0x1c8031-0x166;const _0xb46b94=a23_0xb46b();let _0x4d697e=_0xb46b94[_0x1c8031];return _0x4d697e;}export const logsDefinitions=[{'service':'logs','command':a23_0x53eb38(0x171),'description':'View\x20command\x20history\x20logs','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1d883e){const _0x35642c=a23_0x53eb38;return printLogs(logger[_0x35642c(0x179)]()),{'ok':!![]};}},{'service':a23_0x53eb38(0x168),'command':'clear','description':'Clear\x20command\x20history\x20logs','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x23dec3){const _0x5be609=a23_0x53eb38;return logger[_0x5be609(0x172)](),console[_0x5be609(0x173)]('*\x20Logs\x20cleared'),{'ok':!![]};}}];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a24_0x8476(_0x42265f,_0x13e925){_0x42265f=_0x42265f-0x1e9;const _0x16ae6a=a24_0x16ae();let _0x84764e=_0x16ae6a[_0x42265f];return _0x84764e;}const a24_0x3262b8=a24_0x8476;(function(_0x194a8c,_0x26516a){const _0x66e13c=a24_0x8476,_0x30455f=_0x194a8c();while(!![]){try{const _0x1747fd=parseInt(_0x66e13c(0x1eb))/0x1+-parseInt(_0x66e13c(0x20c))/0x2+parseInt(_0x66e13c(0x20d))/0x3+-parseInt(_0x66e13c(0x1f7))/0x4+parseInt(_0x66e13c(0x1fb))/0x5*(-parseInt(_0x66e13c(0x1ea))/0x6)+parseInt(_0x66e13c(0x207))/0x7*(-parseInt(_0x66e13c(0x20a))/0x8)+parseInt(_0x66e13c(0x1f0))/0x9*(parseInt(_0x66e13c(0x203))/0xa);if(_0x1747fd===_0x26516a)break;else _0x30455f['push'](_0x30455f['shift']());}catch(_0x4beb82){_0x30455f['push'](_0x30455f['shift']());}}}(a24_0x16ae,0xaff12));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';function a24_0x16ae(){const _0x2d999a=['10LolDEa','SQL\x20Queries','Configuration','Self\x20Update','1486646XJZvAZ','Datasets','read','8UGyneQ','\x20\x20[high-risk-write]','2240202TFrEHC','2555544PLjtJc','from','run','7746sEeMgF','562750eIQigr','defaultCommand','service','command','push','25575183Splutx','write','get','map','BFF\x20Scripts','install','description','5027380PfizdD','\x20\x20[write]','Instant\x20API','set','3665jXXUwT','has','risk','Skills','show','login','values','isSingleCommand'];a24_0x16ae=function(){return _0x2d999a;};return a24_0x16ae();}import{kbDefinitions}from'../commands/kb/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x1c05ce){const _0x382739=a24_0x8476;for(const _0x151323 of _0x1c05ce){definitions[_0x382739(0x1fa)](_0x151323['service']+':'+_0x151323[_0x382739(0x1ee)],_0x151323);let _0x5e06a0=serviceGroups[_0x382739(0x1f2)](_0x151323[_0x382739(0x1ed)]);!_0x5e06a0&&(_0x5e06a0=[],serviceGroups[_0x382739(0x1fa)](_0x151323[_0x382739(0x1ed)],_0x5e06a0)),_0x5e06a0['push'](_0x151323);}}function registerService(_0x14e70a,_0x1ca007,_0x564351){const _0x27530f=a24_0x8476;registerDefinitions(_0x1ca007);const _0x2173ee=_0x49754d=>_0x49754d===_0x27530f(0x209)?'':_0x49754d===_0x27530f(0x1f1)?_0x27530f(0x1f8):_0x27530f(0x20b),_0x536e8f={'service':_0x1ca007[0x0][_0x27530f(0x1ed)],'label':_0x14e70a,'commands':_0x1ca007[_0x27530f(0x1f3)](_0x38f4d2=>({'command':_0x38f4d2[_0x27530f(0x1ee)],'description':_0x38f4d2[_0x27530f(0x1f6)],'tag':_0x2173ee(_0x38f4d2[_0x27530f(0x1fd)])})),'defaultCommand':_0x564351?.[_0x27530f(0x1ec)]??(_0x564351?.[_0x27530f(0x202)]?_0x1ca007[0x0][_0x27530f(0x1ee)]:undefined),'isSingleCommand':_0x564351?.[_0x27530f(0x202)]};serviceRegistry[_0x27530f(0x1ef)](_0x536e8f),serviceByName[_0x27530f(0x1fa)](_0x536e8f[_0x27530f(0x1ed)],_0x536e8f);}registerService('Authentication',authDefinitions,{'defaultCommand':a24_0x3262b8(0x200)}),registerService(a24_0x3262b8(0x208),datasetDefinitions),registerService(a24_0x3262b8(0x1f9),dataDefinitions),registerService(a24_0x3262b8(0x204),sqlDefinitions),registerService(a24_0x3262b8(0x1f4),bffDefinitions),registerService('Knowledge\x20Base',kbDefinitions),registerService('App\x20Management',appDefinitions,{'defaultCommand':'list'}),registerService(a24_0x3262b8(0x205),configDefinitions,{'defaultCommand':'list'}),registerService(a24_0x3262b8(0x1fe),skillDefinitions,{'defaultCommand':a24_0x3262b8(0x1f5)}),registerService(a24_0x3262b8(0x206),[updateDefinition],{'defaultCommand':a24_0x3262b8(0x1e9),'isSingleCommand':!![]}),registerService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerService('Schema',[schemaDefinition],{'isSingleCommand':!![]}),registerService('Logs',logsDefinitions,{'defaultCommand':a24_0x3262b8(0x1ff)});export function findDefinition(_0x6f9899,_0x476a68){const _0x3f345c=a24_0x3262b8;return definitions[_0x3f345c(0x1f2)](_0x6f9899+':'+_0x476a68);}export function isKnownService(_0xc07862){const _0x728c9d=a24_0x3262b8;return serviceByName[_0x728c9d(0x1fc)](_0xc07862);}export function getServiceEntry(_0x4e9c6f){const _0x4aa2b5=a24_0x3262b8;return serviceByName[_0x4aa2b5(0x1f2)](_0x4e9c6f);}export function getAllDefinitions(){const _0x369127=a24_0x3262b8;return Array[_0x369127(0x20e)](definitions[_0x369127(0x201)]());}
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a25_0xdcb3(){const _0x2eaefc=['Export\x20machine-readable\x20command\x20schema\x20(JSON)','1242iMugtt','1033070BalawD','5790DaAKCa','read','573948NgAvIj','322Lhhhir','20478XTklOE','1106121KvNzfe','2431640mPFYgJ','219106dUXuXM','7SFRiLA'];a25_0xdcb3=function(){return _0x2eaefc;};return a25_0xdcb3();}const a25_0x24409d=a25_0x3c65;function a25_0x3c65(_0x349dd3,_0x443da4){_0x349dd3=_0x349dd3-0x1ac;const _0xdcb3d4=a25_0xdcb3();let _0x3c6547=_0xdcb3d4[_0x349dd3];return _0x3c6547;}(function(_0x41a2c0,_0x3149c5){const _0x9f3ecf=a25_0x3c65,_0x1ee2da=_0x41a2c0();while(!![]){try{const _0x7001=-parseInt(_0x9f3ecf(0x1b5))/0x1*(parseInt(_0x9f3ecf(0x1b4))/0x2)+parseInt(_0x9f3ecf(0x1b2))/0x3+parseInt(_0x9f3ecf(0x1af))/0x4+parseInt(_0x9f3ecf(0x1ac))/0x5+-parseInt(_0x9f3ecf(0x1b1))/0x6*(-parseInt(_0x9f3ecf(0x1b0))/0x7)+parseInt(_0x9f3ecf(0x1b3))/0x8+parseInt(_0x9f3ecf(0x1b7))/0x9*(parseInt(_0x9f3ecf(0x1ad))/0xa);if(_0x7001===_0x3149c5)break;else _0x1ee2da['push'](_0x1ee2da['shift']());}catch(_0x1f16b2){_0x1ee2da['push'](_0x1ee2da['shift']());}}}(a25_0xdcb3,0x784f8));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0xc29830){const _0x4e3455=await buildSchemaPayload();return{'ok':!![],'data':_0x4e3455};}export const schemaDefinition={'service':'schema','command':'export','description':a25_0x24409d(0x1b6),'risk':a25_0x24409d(0x1ae),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x1f8493=a26_0x21c4;function a26_0x21c4(_0x556d58,_0x36ffb7){_0x556d58=_0x556d58-0x96;const _0xb74feb=a26_0xb74f();let _0x21c498=_0xb74feb[_0x556d58];return _0x21c498;}(function(_0x59f1b4,_0x324447){const _0x3db9a3=a26_0x21c4,_0x2d263e=_0x59f1b4();while(!![]){try{const _0x372a2c=-parseInt(_0x3db9a3(0x9e))/0x1+parseInt(_0x3db9a3(0xa4))/0x2+-parseInt(_0x3db9a3(0xc9))/0x3+parseInt(_0x3db9a3(0xbb))/0x4*(parseInt(_0x3db9a3(0xb9))/0x5)+-parseInt(_0x3db9a3(0xb1))/0x6+-parseInt(_0x3db9a3(0x9a))/0x7*(-parseInt(_0x3db9a3(0x98))/0x8)+-parseInt(_0x3db9a3(0xa3))/0x9*(parseInt(_0x3db9a3(0xd5))/0xa);if(_0x372a2c===_0x324447)break;else _0x2d263e['push'](_0x2d263e['shift']());}catch(_0x2eeeb0){_0x2d263e['push'](_0x2d263e['shift']());}}}(a26_0xb74f,0x23304));import{CLI_BIN_NAME,CLI_DISPLAY_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';import{logger}from'../../utils/logger.js';function a26_0xb74f(){const _0x66775d=['trim','unknown','map','code','\x20skill\x20installed','\x20company\x20Skill(s).','405492xVCndP','action','Pulled\x20','authRequired','length','Skipped\x20npx\x20(','skipped','Installing\x20published\x20','81635TzWTvA','cwd','56BgMCiP','input','Local\x20Skill\x20directory\x20containing\x20SKILL.md','Only\x20pull\x20a\x20specific\x20runtime\x20Skill\x20code','filter','error','reduce','push','../../skills/runtime-skill-sync.js','Installing\x20official\x20skill\x20via\x20npx\x20(npx\x20skills\x20add\x20','appCode','Pull\x20personal\x20and\x20company\x20runtime\x20Skills\x20into\x20local\x20agent\x20skill\x20directories','readonly','../../skills/npx-skills-add.js','621123zAZACo','npx\x20skills\x20add\x20failed:\x20','\x20developer\x20skill','log','skillCode','../../core/api-client.js','updated','envName','production','str','setLogPath','skillName','590omgZVl','Updated\x20personal\x20Skill\x20','version','Created\x20personal\x20Skill\x20','accessKey','8hfLRlF','\x20-g\x20-y)...','879781QdkGhX','pull','pipe','skill','25043BlynfU','string','=1);\x20assuming\x20skill\x20is\x20already\x20present.','Check\x20network\x20connectivity\x20and\x20try\x20again.','company','10053bHENzA','310880vlogsI','apiError','created','dir','write','info','personal'];a26_0xb74f=function(){return _0x66775d;};return a26_0xb74f();}const CODE_FLAG={'name':a26_0x1f8493(0xae),'type':a26_0x1f8493(0x9f),'description':a26_0x1f8493(0xbe)},DIR_FLAG={'name':a26_0x1f8493(0xa7),'type':'string','required':!![],'description':a26_0x1f8493(0xbd)};function summarizeRuntimeSkill(_0x397030){const _0x5bb83b=a26_0x1f8493;return{'id':_0x397030['id'],'skillCode':_0x397030[_0x5bb83b(0xcd)],'skillName':_0x397030[_0x5bb83b(0xd4)],'scope':_0x397030['scope'],'version':_0x397030[_0x5bb83b(0xd7)],'readonly':_0x397030[_0x5bb83b(0xc7)]};}function filterByCode(_0x4e9142,_0x21cdb7){const _0x4bb8b1=a26_0x1f8493,_0x11100c=_0x21cdb7[_0x4bb8b1(0xab)]();if(!_0x11100c)return _0x4e9142;return _0x4e9142[_0x4bb8b1(0xbf)](_0x5b3b4d=>_0x5b3b4d[_0x4bb8b1(0xcd)]===_0x11100c);}export const skillDefinitions=[{'service':a26_0x1f8493(0x9d),'command':'install','description':'Install\x20the\x20published\x20'+CLI_BIN_NAME+a26_0x1f8493(0xcb),'risk':a26_0x1f8493(0xa8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x17e9b4){const _0x158f6c=a26_0x1f8493;logger[_0x158f6c(0xd3)](process[_0x158f6c(0xba)]()),logger[_0x158f6c(0xa9)]('skill-install',_0x158f6c(0xb8)+CLI_DISPLAY_NAME+'\x20skill\x20via\x20npx.');const {LOVRABET_SKILL_SOURCE:_0xda66d6,LOVRABET_SKIP_NPX_SKILLS_ENV:_0x23ec9d,runNpxSkillsAddGlobal:_0x2edee6}=await import(_0x158f6c(0xc8)),_0x7c0e23=_0x17e9b4['nonInteractive']?_0x158f6c(0x9c):'inherit';console[_0x158f6c(0xcc)](_0x158f6c(0xc4)+_0xda66d6+_0x158f6c(0x99));const _0x2554a4=_0x2edee6(process['cwd'](),_0xda66d6,{'stdio':_0x7c0e23});if(_0x2554a4[_0x158f6c(0xb7)])console[_0x158f6c(0xcc)](_0x158f6c(0xb6)+_0x23ec9d+_0x158f6c(0xa0));else{if(_0x2554a4['ok'])console[_0x158f6c(0xcc)](CLI_BIN_NAME+_0x158f6c(0xaf));else throw CliErrors[_0x158f6c(0xa5)](_0x158f6c(0xca)+(_0x2554a4[_0x158f6c(0xc0)]||_0x158f6c(0xac)),_0x158f6c(0xa1));}return{'ok':!![]};}},{'service':'skill','command':a26_0x1f8493(0x9b),'description':a26_0x1f8493(0xc6),'risk':'write','flags':[CODE_FLAG],async 'execute'(_0x170553){const _0x628d4b=a26_0x1f8493,{listCompanyRuntimeSkills:_0x3be2a2,listPersonalRuntimeSkills:_0x5e49d2}=await import(_0x628d4b(0xce)),{linkEffectiveRuntimeSkills:_0x196a67,materializeRuntimeSkill:_0x3089b4}=await import(_0x628d4b(0xc3)),_0x2d9241=_0x170553[_0x628d4b(0xd2)]('code'),_0x411f1b=_0x170553[_0x628d4b(0xd0)]??_0x628d4b(0xd1),_0x226c54=_0x170553[_0x628d4b(0x97)];if(!_0x226c54)throw CliErrors[_0x628d4b(0xb4)]();const _0x1ffb67=filterByCode(await _0x5e49d2(_0x170553[_0x628d4b(0xc5)]),_0x2d9241),_0x3f95d5=filterByCode(await _0x3be2a2(_0x170553[_0x628d4b(0xc5)]),_0x2d9241),_0x95cb40=[..._0x1ffb67[_0x628d4b(0xad)](_0x531f06=>_0x3089b4(_0x531f06,_0x628d4b(0xaa),{'env':_0x411f1b,'accessKey':_0x226c54,'appCode':_0x170553[_0x628d4b(0xc5)]})),..._0x3f95d5[_0x628d4b(0xad)](_0x294be4=>_0x3089b4(_0x294be4,_0x628d4b(0xa2),{'env':_0x411f1b,'accessKey':_0x226c54,'appCode':_0x170553[_0x628d4b(0xc5)]}))],_0x34fbf0=_0x196a67(_0x95cb40,_0x170553[_0x628d4b(0xc5)]),_0x475d4c=_0x34fbf0[_0x628d4b(0xc1)]((_0x4ccf9c,_0x49df5b)=>{const _0x5ac16f=_0x628d4b;return _0x4ccf9c[_0x49df5b[_0x5ac16f(0xb2)]]=(_0x4ccf9c[_0x49df5b['action']]??0x0)+0x1,_0x4ccf9c;},{});return{'ok':!![],'data':{'appCode':_0x170553['appCode'],'personal':_0x1ffb67[_0x628d4b(0xb5)],'company':_0x3f95d5[_0x628d4b(0xb5)],'materialized':_0x95cb40[_0x628d4b(0xb5)],'links':{'total':_0x34fbf0[_0x628d4b(0xb5)],'created':_0x475d4c[_0x628d4b(0xa6)]??0x0,'updated':_0x475d4c[_0x628d4b(0xcf)]??0x0,'unchanged':_0x475d4c['unchanged']??0x0,'skipped':0x0,'conflicted':0x0},'skills':{'personal':_0x1ffb67[_0x628d4b(0xad)](summarizeRuntimeSkill),'company':_0x3f95d5[_0x628d4b(0xad)](summarizeRuntimeSkill)}},'message':_0x628d4b(0xb3)+_0x1ffb67[_0x628d4b(0xb5)]+'\x20personal\x20and\x20'+_0x3f95d5[_0x628d4b(0xb5)]+_0x628d4b(0xb0)};}},{'service':'skill','command':a26_0x1f8493(0xc2),'description':'Push\x20a\x20local\x20Skill\x20directory\x20to\x20personal\x20runtime\x20Skill\x20scope','risk':a26_0x1f8493(0xa8),'flags':[DIR_FLAG],async 'execute'(_0x2b6878){const _0x5640a9=a26_0x1f8493,{createPersonalRuntimeSkill:_0x5b7991,listPersonalRuntimeSkills:_0x138e44,updatePersonalRuntimeSkill:_0x41ecdc}=await import(_0x5640a9(0xce)),{readPushDirectory:_0x239c5a}=await import(_0x5640a9(0xc3));if(!_0x2b6878[_0x5640a9(0x97)])throw CliErrors['authRequired']();const _0x37a2aa=_0x239c5a(_0x2b6878[_0x5640a9(0xd2)](_0x5640a9(0xa7)),_0x2b6878['appCode']),_0x31cf58=(await _0x138e44(_0x2b6878[_0x5640a9(0xc5)]))['find'](_0x1ab898=>_0x1ab898[_0x5640a9(0xcd)]===_0x37a2aa[_0x5640a9(0xcd)]),_0x2348e4=_0x31cf58?await _0x41ecdc(_0x37a2aa['skillCode'],_0x2b6878[_0x5640a9(0xc5)],_0x37a2aa[_0x5640a9(0xbc)]):await _0x5b7991(_0x2b6878[_0x5640a9(0xc5)],_0x37a2aa[_0x5640a9(0xbc)]);return{'ok':!![],'data':summarizeRuntimeSkill(_0x2348e4),'message':_0x31cf58?_0x5640a9(0xd6)+_0x37a2aa[_0x5640a9(0xcd)]:_0x5640a9(0x96)+_0x37a2aa[_0x5640a9(0xcd)]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a27_0x12ed(_0xc7337d,_0x3a9c4c){_0xc7337d=_0xc7337d-0x16f;const _0x68627=a27_0x6862();let _0x12edd4=_0x68627[_0xc7337d];return _0x12edd4;}function a27_0x6862(){const _0x3c03c=['sqlName','appCode','verbose','498687FPRsOm','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','972639QqALbq','2532080tHoamy','detail','2305oTXAUu','454092AwDfNe','1528320fXWRAs','dbId','str','82URKWHg','description','sqlContent','bool','sql','8yUMrkD','read','1058595bXCZxc','sqlcode'];a27_0x6862=function(){return _0x3c03c;};return a27_0x6862();}const a27_0x383fb5=a27_0x12ed;(function(_0x4dd54c,_0x3b8615){const _0x81aabc=a27_0x12ed,_0x35092a=_0x4dd54c();while(!![]){try{const _0x5d6984=-parseInt(_0x81aabc(0x17b))/0x1*(parseInt(_0x81aabc(0x180))/0x2)+parseInt(_0x81aabc(0x171))/0x3+-parseInt(_0x81aabc(0x17d))/0x4+parseInt(_0x81aabc(0x179))/0x5+-parseInt(_0x81aabc(0x17c))/0x6+-parseInt(_0x81aabc(0x176))/0x7+parseInt(_0x81aabc(0x16f))/0x8*(parseInt(_0x81aabc(0x178))/0x9);if(_0x5d6984===_0x3b8615)break;else _0x35092a['push'](_0x35092a['shift']());}catch(_0x3c714f){_0x35092a['push'](_0x35092a['shift']());}}}(a27_0x6862,0x53f24));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a27_0x383fb5(0x184),'command':a27_0x383fb5(0x17a),'description':a27_0x383fb5(0x177),'risk':a27_0x383fb5(0x170),'flags':[SQLCODE_FLAG,VERBOSE_FLAG],async 'execute'(_0x34dd2d){const _0x3edfe7=a27_0x383fb5,_0x33c30d=await getSqlQueryInfo(_0x34dd2d[_0x3edfe7(0x174)],_0x34dd2d[_0x3edfe7(0x17f)](_0x3edfe7(0x172))),_0x45c953=_0x34dd2d[_0x3edfe7(0x183)](_0x3edfe7(0x175));if(_0x45c953)return{'ok':!![],'data':_0x33c30d};const _0x4a22be=_0x33c30d[_0x3edfe7(0x17e)]?await getDbName(_0x34dd2d[_0x3edfe7(0x174)],_0x33c30d['dbId']):undefined;return{'ok':!![],'data':{'sqlCode':_0x33c30d['sqlCode'],'sqlName':_0x33c30d[_0x3edfe7(0x173)],'db':_0x4a22be?_0x4a22be+'\x20('+_0x33c30d[_0x3edfe7(0x17e)]+')':_0x33c30d['dbId']??'','description':_0x33c30d[_0x3edfe7(0x181)]??'','sqlContent':_0x33c30d[_0x3edfe7(0x182)]??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x196826=a28_0x5869;(function(_0x531935,_0x45bd1e){const _0x1f540f=a28_0x5869,_0x31d671=_0x531935();while(!![]){try{const _0x359d6b=-parseInt(_0x1f540f(0xea))/0x1+parseInt(_0x1f540f(0xdc))/0x2+parseInt(_0x1f540f(0xe7))/0x3*(parseInt(_0x1f540f(0xf1))/0x4)+parseInt(_0x1f540f(0xed))/0x5*(parseInt(_0x1f540f(0xeb))/0x6)+-parseInt(_0x1f540f(0xe1))/0x7*(-parseInt(_0x1f540f(0xee))/0x8)+-parseInt(_0x1f540f(0xec))/0x9*(parseInt(_0x1f540f(0xdb))/0xa)+-parseInt(_0x1f540f(0xe0))/0xb*(parseInt(_0x1f540f(0xe4))/0xc);if(_0x359d6b===_0x45bd1e)break;else _0x31d671['push'](_0x31d671['shift']());}catch(_0x58d83e){_0x31d671['push'](_0x31d671['shift']());}}}(a28_0x1f91,0x626b9));import{executeSdkSql}from'../../core/sdk-client.js';import{SQLCODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';function a28_0x5869(_0x459876,_0x429566){_0x459876=_0x459876-0xda;const _0x1f91c1=a28_0x1f91();let _0x58693a=_0x1f91c1[_0x459876];return _0x58693a;}function a28_0x1f91(){const _0x187956=['exec','1985260vWdlLx','1215470YUxnBB','execResult','SQL\x20execution\x20failed','now','11UGkSNR','334978JoXhXc','params','\x20row(s)\x20in\x20','14951412knSBsO','execError','isArray','116691UcHZWM','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','length','58687BkJjAO','344766IopahU','9utyPUN','50nclOBO','56KuoLTf','str','Returned\x20','40jXNrfc'];a28_0x1f91=function(){return _0x187956;};return a28_0x1f91();}import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':'sql','command':a28_0x196826(0xda),'description':a28_0x196826(0xe8),'risk':'read','flags':[SQLCODE_FLAG,PARAMS_FLAG],async 'execute'(_0x325468){const _0x533816=a28_0x196826,_0xaf02f3=parseJsonParams(_0x325468[_0x533816(0xef)](_0x533816(0xe2))),_0x39f592=Date['now'](),_0xa92bef=await executeSdkSql(_0x325468[_0x533816(0xef)]('sqlcode'),_0xaf02f3),_0xe9b914=Date[_0x533816(0xdf)]()-_0x39f592,_0x359a9c=_0xa92bef?.[_0x533816(0xdd)]??_0xa92bef,_0x1d54e1=_0xa92bef?.['execSuccess']??!![];if(!_0x1d54e1)return{'ok':![],'data':{'error':_0xa92bef?.[_0x533816(0xe5)]||'SQL\x20execution\x20failed','elapsed':_0xe9b914},'message':_0x533816(0xde)};const _0x545ffb=Array[_0x533816(0xe6)](_0x359a9c)?_0x359a9c:[];return{'ok':!![],'data':{'rows':_0x545ffb,'rowCount':_0x545ffb[_0x533816(0xe9)],'elapsed':_0xe9b914},'message':_0x533816(0xf0)+_0x545ffb[_0x533816(0xe9)]+_0x533816(0xe3)+_0xe9b914+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4873ab,_0x2f85fb){const _0x3180b5=a29_0x42b5,_0xda7d3e=_0x4873ab();while(!![]){try{const _0x11849a=parseInt(_0x3180b5(0xba))/0x1*(parseInt(_0x3180b5(0xbd))/0x2)+parseInt(_0x3180b5(0xbb))/0x3+-parseInt(_0x3180b5(0xb8))/0x4+-parseInt(_0x3180b5(0xbf))/0x5+parseInt(_0x3180b5(0xbe))/0x6+-parseInt(_0x3180b5(0xb7))/0x7*(parseInt(_0x3180b5(0xb9))/0x8)+-parseInt(_0x3180b5(0xbc))/0x9;if(_0x11849a===_0x2f85fb)break;else _0xda7d3e['push'](_0xda7d3e['shift']());}catch(_0xce0d79){_0xda7d3e['push'](_0xda7d3e['shift']());}}}(a29_0x1fc1,0x4db62));import{sqlDetail}from'../../commands/sql/detail.js';function a29_0x1fc1(){const _0x377b26=['2QIjClJ','3469926Hyelks','2602685tliKPs','1853509kTiKpZ','725516gAMMJZ','8YvCjAy','276162zVrFiH','1365828piSeIX','222750HsypuI'];a29_0x1fc1=function(){return _0x377b26;};return a29_0x1fc1();}import{sqlExec}from'../../commands/sql/exec.js';function a29_0x42b5(_0x3902c1,_0x599e43){_0x3902c1=_0x3902c1-0xb7;const _0x1fc1f3=a29_0x1fc1();let _0x42b540=_0x1fc1f3[_0x3902c1];return _0x42b540;}export const sqlDefinitions=[sqlDetail,sqlExec];
|
package/lib/commands/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a29_0x29eae7=a29_0x19ce;(function(_0x437ebf,_0x4b4d16){const _0x5923f9=a29_0x19ce,_0x41ce26=_0x437ebf();while(!![]){try{const _0x52633b=parseInt(_0x5923f9(0x19d))/0x1+-parseInt(_0x5923f9(0x15a))/0x2+parseInt(_0x5923f9(0x17a))/0x3+parseInt(_0x5923f9(0x185))/0x4+-parseInt(_0x5923f9(0x177))/0x5*(-parseInt(_0x5923f9(0x179))/0x6)+-parseInt(_0x5923f9(0x16c))/0x7+parseInt(_0x5923f9(0x176))/0x8*(-parseInt(_0x5923f9(0x151))/0x9);if(_0x52633b===_0x4b4d16)break;else _0x41ce26['push'](_0x41ce26['shift']());}catch(_0x402275){_0x41ce26['push'](_0x41ce26['shift']());}}}(a29_0x5b3f,0x40a67));import{spawnSync}from'node:child_process';import{CliErrors}from'../errors.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{LOVRABET_NPM_PACKAGE_NAME,LOVRABET_SKILL_SOURCE,NPM_REGISTRY_BASE_URL}from'../constant/distribution.js';import{resolveNpmBin}from'../utils/platform.js';import{getCliVersion}from'../utils/version.js';import{LOVRABET_SKIP_NPX_SKILLS_ENV,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';const updateFlags=[{'name':a29_0x29eae7(0x17c),'type':a29_0x29eae7(0x150),'description':a29_0x29eae7(0x171),'default':![]},{'name':a29_0x29eae7(0x166),'type':'boolean','description':'Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','default':![]},{'name':a29_0x29eae7(0x156),'type':a29_0x29eae7(0x188),'description':a29_0x29eae7(0x196)},{'name':a29_0x29eae7(0x174),'type':'boolean','description':'Skip\x20official\x20skill\x20package\x20refresh\x20after\x20updating','default':![]},{'name':'skills','type':'boolean','description':a29_0x29eae7(0x182),'default':!![],'hidden':!![]}];function a29_0x19ce(_0x548a2b,_0x403f90){_0x548a2b=_0x548a2b-0x150;const _0x5b3fd7=a29_0x5b3f();let _0x19ce06=_0x5b3fd7[_0x548a2b];return _0x19ce06;}function parseSemver(_0x3616c0){const _0x1b6d87=a29_0x29eae7,_0x418485=_0x3616c0[_0x1b6d87(0x186)]()[_0x1b6d87(0x189)](/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);if(!_0x418485)return null;return{'major':Number(_0x418485[0x1]),'minor':Number(_0x418485[0x2]),'patch':Number(_0x418485[0x3]),'prerelease':_0x418485[0x4]};}function a29_0x5b3f(){const _0x5449da=['bool','install','Refresh\x20official\x20skill\x20package\x20after\x20updating','npm','\x20\x20Official\x20skill\x20update\x20failed:\x20','1556204vlbgLM','trim','patch','string','match','Use\x20full\x20semver\x20versions\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','\x20\x20Skipped\x20skill\x20install\x20(','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','toString','Unable\x20to\x20resolve\x20','nonInteractive','pipe','skills','skipped','join','str','Invalid\x20version:\x20','Install\x20a\x20specific\x20CLI\x20version','length','unknown','fromEntries','object','inherit','major','460149bXHkcY','prerelease','boolean','9WxvNnK','Already\x20on\x20requested\x20version\x20(v','exit\x20','status','\x20-g\x20-y','version','Version\x20comparison\x20failed.','cwd','\x20\x20Official\x20skill\x20package\x20is\x20up\x20to\x20date.','995636BIBqmo','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','source','flag','Already\x20up\x20to\x20date\x20(v','Current\x20version:\x20','entries','Choose\x20exactly\x20one\x20target:\x20--latest,\x20--beta,\x20or\x20--version\x20<version>.','--latest,\x20--beta,\x20and\x20version\x20cannot\x20be\x20used\x20together.','validation','json','stdout','beta','\x20\x20Try\x20manually:\x20npm\x20install\x20-g\x20','\x20->\x20','filter','map','warn','832265pQSZOn','Checking\x20official\x20skill\x20package...','error','=1).','Checking\x20npm\x20dist-tags...','Install\x20the\x20version\x20from\x20npm\x20latest\x20dist-tag','Update\x20failed:\x20','\x20CLI\x20from\x20npm','no-skills','stderr','6604328CLZkvt','878335bBGeup','args','18uHErYe','992580UChMcB','log','latest','Use\x20a\x20full\x20semver\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','Updated\x20to\x20v','timeout'];a29_0x5b3f=function(){return _0x5449da;};return a29_0x5b3f();}function compareSemver(_0x196e2a,_0x29bcf0){const _0x51f03f=a29_0x29eae7,_0x316d9d=parseSemver(_0x196e2a),_0x195ca9=parseSemver(_0x29bcf0);if(!_0x316d9d||!_0x195ca9)throw CliErrors[_0x51f03f(0x163)](_0x51f03f(0x157),_0x51f03f(0x18a));for(const _0xb979bf of[_0x51f03f(0x19c),'minor',_0x51f03f(0x187)]){if(_0x316d9d[_0xb979bf]<_0x195ca9[_0xb979bf])return-0x1;if(_0x316d9d[_0xb979bf]>_0x195ca9[_0xb979bf])return 0x1;}if(!_0x316d9d[_0x51f03f(0x19e)]&&!_0x195ca9[_0x51f03f(0x19e)])return 0x0;if(!_0x316d9d['prerelease'])return 0x1;if(!_0x195ca9[_0x51f03f(0x19e)])return-0x1;if(_0x316d9d[_0x51f03f(0x19e)]===_0x195ca9[_0x51f03f(0x19e)])return 0x0;return _0x316d9d[_0x51f03f(0x19e)]<_0x195ca9['prerelease']?-0x1:0x1;}function getRequestedVersion(_0x596de9){const _0x42ab83=a29_0x29eae7,_0x43b589=_0x596de9[_0x42ab83(0x194)](_0x42ab83(0x156))['trim']();if(_0x43b589)return _0x43b589;return String(_0x596de9[_0x42ab83(0x178)]?.[0x0]??'')['trim']();}function shouldSkipOfficialSkill(_0x44867e){const _0x3b9870=a29_0x29eae7;return _0x44867e['bool'](_0x3b9870(0x174))||_0x44867e[_0x3b9870(0x15d)](_0x3b9870(0x191))===![];}async function validateUpdateFlags(_0x1c5549){const _0x139b9b=a29_0x29eae7,_0x3f0bf1=getRequestedVersion(_0x1c5549),_0x339718=[_0x1c5549[_0x139b9b(0x180)]('latest')?_0x139b9b(0x17c):'',_0x1c5549['bool']('beta')?_0x139b9b(0x166):'',_0x3f0bf1?_0x139b9b(0x156):'']['filter'](Boolean);if(_0x339718[_0x139b9b(0x197)]>0x1)throw CliErrors['validation'](_0x139b9b(0x162),_0x139b9b(0x161));if(_0x3f0bf1&&!parseSemver(_0x3f0bf1))throw CliErrors[_0x139b9b(0x163)](_0x139b9b(0x195)+_0x3f0bf1,_0x139b9b(0x17d));}async function fetchNpmDistTags(){const _0x454f01=a29_0x29eae7;try{const _0x1d4b40=NPM_REGISTRY_BASE_URL+'/-/package/'+encodeURIComponent(LOVRABET_NPM_PACKAGE_NAME)+'/dist-tags',_0x5e21b3=await fetch(_0x1d4b40,{'signal':AbortSignal[_0x454f01(0x17f)](0x2710)});if(!_0x5e21b3['ok'])return null;const _0x1af852=await _0x5e21b3[_0x454f01(0x164)]();if(!_0x1af852||typeof _0x1af852!==_0x454f01(0x19a))return null;return Object[_0x454f01(0x199)](Object[_0x454f01(0x160)](_0x1af852)[_0x454f01(0x169)](([,_0x17370b])=>typeof _0x17370b===_0x454f01(0x188)&&_0x17370b[_0x454f01(0x186)]())[_0x454f01(0x16a)](([_0x1d14d6,_0x1c862e])=>[_0x1d14d6,String(_0x1c862e)['trim']()]));}catch{return null;}}async function resolveTargetVersion(_0xfa1ca0){const _0x5edd5e=a29_0x29eae7,_0x2a2171=getRequestedVersion(_0xfa1ca0);if(_0x2a2171)return{'version':_0x2a2171,'source':_0x5edd5e(0x156)};const _0x41db0b=_0xfa1ca0[_0x5edd5e(0x180)](_0x5edd5e(0x166))?_0x5edd5e(0x166):'latest',_0x5664c5=await fetchNpmDistTags(),_0x44ff4c=_0x5664c5?.[_0x41db0b];if(!_0x44ff4c)return null;return{'version':_0x44ff4c,'source':_0x41db0b};}function shouldInstallTarget(_0x57b7a2,_0x2e60ed){const _0x1c5062=a29_0x29eae7,_0xd9478a=compareSemver(_0x57b7a2,_0x2e60ed['version']);if(_0x2e60ed[_0x1c5062(0x15c)]===_0x1c5062(0x156))return _0xd9478a!==0x0;return _0xd9478a<0x0;}function installCliPackage(_0x4f43a1,_0x2aa921){const _0x13f4eb=a29_0x29eae7,_0x270a16=resolveNpmBin(_0x13f4eb(0x183)),_0x55b063=[_0x13f4eb(0x181),'-g',LOVRABET_NPM_PACKAGE_NAME+'@'+_0x4f43a1];console[_0x13f4eb(0x17b)]('*\x20'+[_0x270a16,..._0x55b063][_0x13f4eb(0x193)]('\x20'));const _0x41e298=spawnSync(_0x270a16,_0x55b063,{'cwd':process[_0x13f4eb(0x158)](),'stdio':_0x2aa921?'pipe':_0x13f4eb(0x19b),'env':process.env,'shell':![]});if(_0x41e298['status']===0x0)return{'ok':!![]};let _0x33d80b=_0x41e298[_0x13f4eb(0x16e)]?.['message']||_0x13f4eb(0x153)+(_0x41e298[_0x13f4eb(0x154)]??_0x13f4eb(0x198));if(_0x2aa921){const _0xcf6490=_0x41e298[_0x13f4eb(0x175)]?_0x41e298[_0x13f4eb(0x175)]['toString']()[_0x13f4eb(0x186)]():'',_0x582d07=_0x41e298[_0x13f4eb(0x165)]?_0x41e298[_0x13f4eb(0x165)][_0x13f4eb(0x18d)]()[_0x13f4eb(0x186)]():'';if(_0xcf6490)_0x33d80b=_0xcf6490;else{if(_0x582d07)_0x33d80b=_0x582d07;}}return{'ok':![],'error':_0x33d80b};}async function installOfficialSkill(_0x9a7736){const _0x3c332f=a29_0x29eae7;console[_0x3c332f(0x17b)](_0x3c332f(0x16d));const _0x466be2=runNpxSkillsAddGlobal(process[_0x3c332f(0x158)](),LOVRABET_SKILL_SOURCE,{'stdio':_0x9a7736?_0x3c332f(0x190):_0x3c332f(0x19b)});if(_0x466be2[_0x3c332f(0x192)]){console['log'](_0x3c332f(0x18b)+LOVRABET_SKIP_NPX_SKILLS_ENV+_0x3c332f(0x16f));return;}if(_0x466be2['ok']){console[_0x3c332f(0x17b)](_0x3c332f(0x159));return;}console['warn'](_0x3c332f(0x184)+(_0x466be2[_0x3c332f(0x16e)]||_0x3c332f(0x198))),console[_0x3c332f(0x17b)]('\x20\x20Run\x20manually:\x20npx\x20skills\x20add\x20'+LOVRABET_SKILL_SOURCE+_0x3c332f(0x155));}async function execute(_0x37114b){const _0x1bf263=a29_0x29eae7;await validateUpdateFlags(_0x37114b);const _0x1bab05=getCliVersion();console[_0x1bf263(0x17b)](_0x1bf263(0x15f)+_0x1bab05),console[_0x1bf263(0x17b)](_0x1bf263(0x170));const _0x24ada2=await resolveTargetVersion(_0x37114b);if(!_0x24ada2){const _0x1187bf=_0x37114b[_0x1bf263(0x180)](_0x1bf263(0x166))?_0x1bf263(0x166):'latest',_0x35b7d8=_0x1bf263(0x18e)+_0x1187bf+'\x20version\x20from\x20npm.';return console[_0x1bf263(0x16b)](_0x35b7d8),console[_0x1bf263(0x17b)](_0x1bf263(0x18c)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x1187bf),{'ok':![]};}if(!shouldInstallTarget(_0x1bab05,_0x24ada2)){const _0x158a00=_0x24ada2[_0x1bf263(0x15c)]===_0x1bf263(0x156)?_0x1bf263(0x152)+_0x24ada2[_0x1bf263(0x156)]+').':_0x1bf263(0x15e)+_0x24ada2[_0x1bf263(0x156)]+').';return console[_0x1bf263(0x17b)](_0x158a00),shouldSkipOfficialSkill(_0x37114b)?console['log']('Skipping\x20official\x20skill\x20package\x20(--no-skills).'):await installOfficialSkill(_0x37114b[_0x1bf263(0x18f)]),{'ok':!![]};}console[_0x1bf263(0x17b)]('Updating\x20'+LOVRABET_NPM_PACKAGE_NAME+':\x20'+_0x1bab05+_0x1bf263(0x168)+_0x24ada2['version']);const _0x282058=installCliPackage(_0x24ada2[_0x1bf263(0x156)],_0x37114b[_0x1bf263(0x18f)]);if(!_0x282058['ok']){const _0x1e1784=_0x1bf263(0x172)+(_0x282058[_0x1bf263(0x16e)]||_0x1bf263(0x198));return console[_0x1bf263(0x16e)](_0x1e1784),console[_0x1bf263(0x17b)](_0x1bf263(0x167)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x24ada2['version']),{'ok':![]};}return console[_0x1bf263(0x17b)](_0x1bf263(0x17e)+_0x24ada2['version']+'.'),console[_0x1bf263(0x17b)](_0x1bf263(0x15b)),shouldSkipOfficialSkill(_0x37114b)?console[_0x1bf263(0x17b)]('Skipping\x20official\x20skill\x20package\x20(--no-skills).'):await installOfficialSkill(_0x37114b['nonInteractive']),{'ok':!![]};}export const updateDefinition={'service':'update','command':'run','description':'Update\x20'+CLI_BIN_NAME+a29_0x29eae7(0x173),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a30_0xeb4b32=a30_0x318e;(function(_0x298d4e,_0x383c32){const _0xcece76=a30_0x318e,_0x35a88a=_0x298d4e();while(!![]){try{const _0xe3ab95=parseInt(_0xcece76(0xe9))/0x1*(parseInt(_0xcece76(0x115))/0x2)+parseInt(_0xcece76(0xe1))/0x3+-parseInt(_0xcece76(0xda))/0x4*(parseInt(_0xcece76(0x119))/0x5)+-parseInt(_0xcece76(0x10f))/0x6*(parseInt(_0xcece76(0x11a))/0x7)+parseInt(_0xcece76(0xe4))/0x8+-parseInt(_0xcece76(0x11f))/0x9+parseInt(_0xcece76(0xe0))/0xa;if(_0xe3ab95===_0x383c32)break;else _0x35a88a['push'](_0x35a88a['shift']());}catch(_0x414365){_0x35a88a['push'](_0x35a88a['shift']());}}}(a30_0x3c0d,0xc4bf6));import{spawnSync}from'node:child_process';import{CliErrors}from'../errors.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{LOVRABET_NPM_PACKAGE_NAME,LOVRABET_SKILL_SOURCE,NPM_REGISTRY_BASE_URL}from'../constant/distribution.js';import{resolveNpmBin}from'../utils/platform.js';import{getCliVersion}from'../utils/version.js';import{LOVRABET_SKIP_NPX_SKILLS_ENV,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';const updateFlags=[{'name':a30_0xeb4b32(0xe2),'type':a30_0xeb4b32(0x107),'description':a30_0xeb4b32(0xdd),'default':![]},{'name':a30_0xeb4b32(0xe7),'type':a30_0xeb4b32(0x107),'description':a30_0xeb4b32(0x11b),'default':![]},{'name':'version','type':a30_0xeb4b32(0xf8),'description':a30_0xeb4b32(0xeb)},{'name':a30_0xeb4b32(0xf5),'type':'boolean','description':'Skip\x20official\x20skill\x20package\x20refresh\x20after\x20updating','default':![]},{'name':a30_0xeb4b32(0xfb),'type':'boolean','description':a30_0xeb4b32(0x116),'default':!![],'hidden':!![]}];function parseSemver(_0x1f5eb7){const _0x46b00e=a30_0xeb4b32,_0x483a5b=_0x1f5eb7[_0x46b00e(0xd8)]()[_0x46b00e(0x120)](/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);if(!_0x483a5b)return null;return{'major':Number(_0x483a5b[0x1]),'minor':Number(_0x483a5b[0x2]),'patch':Number(_0x483a5b[0x3]),'prerelease':_0x483a5b[0x4]};}function compareSemver(_0x452faf,_0x385145){const _0x14bc62=a30_0xeb4b32,_0x5aae0a=parseSemver(_0x452faf),_0x33df86=parseSemver(_0x385145);if(!_0x5aae0a||!_0x33df86)throw CliErrors[_0x14bc62(0xfe)](_0x14bc62(0x117),_0x14bc62(0xf1));for(const _0x156910 of[_0x14bc62(0x112),_0x14bc62(0xe3),_0x14bc62(0x103)]){if(_0x5aae0a[_0x156910]<_0x33df86[_0x156910])return-0x1;if(_0x5aae0a[_0x156910]>_0x33df86[_0x156910])return 0x1;}if(!_0x5aae0a[_0x14bc62(0xdf)]&&!_0x33df86[_0x14bc62(0xdf)])return 0x0;if(!_0x5aae0a[_0x14bc62(0xdf)])return 0x1;if(!_0x33df86[_0x14bc62(0xdf)])return-0x1;if(_0x5aae0a[_0x14bc62(0xdf)]===_0x33df86[_0x14bc62(0xdf)])return 0x0;return _0x5aae0a[_0x14bc62(0xdf)]<_0x33df86[_0x14bc62(0xdf)]?-0x1:0x1;}function getRequestedVersion(_0x5773b1){const _0x1c0596=a30_0xeb4b32,_0x36365f=_0x5773b1[_0x1c0596(0xea)]('version')[_0x1c0596(0xd8)]();if(_0x36365f)return _0x36365f;return String(_0x5773b1[_0x1c0596(0x106)]?.[0x0]??'')['trim']();}function shouldSkipOfficialSkill(_0x9ba168){const _0x5b0565=a30_0xeb4b32;return _0x9ba168[_0x5b0565(0xf4)](_0x5b0565(0xf5))||_0x9ba168[_0x5b0565(0x10a)](_0x5b0565(0xfb))===![];}async function validateUpdateFlags(_0x440b9c){const _0x22a1d4=a30_0xeb4b32,_0x4ffcbb=getRequestedVersion(_0x440b9c),_0x36bebc=[_0x440b9c[_0x22a1d4(0xf4)]('latest')?_0x22a1d4(0xe2):'',_0x440b9c[_0x22a1d4(0xf4)](_0x22a1d4(0xe7))?_0x22a1d4(0xe7):'',_0x4ffcbb?'version':''][_0x22a1d4(0xec)](Boolean);if(_0x36bebc[_0x22a1d4(0xf3)]>0x1)throw CliErrors[_0x22a1d4(0xfe)](_0x22a1d4(0x118),'Choose\x20exactly\x20one\x20target:\x20--latest,\x20--beta,\x20or\x20--version\x20<version>.');if(_0x4ffcbb&&!parseSemver(_0x4ffcbb))throw CliErrors[_0x22a1d4(0xfe)](_0x22a1d4(0x111)+_0x4ffcbb,_0x22a1d4(0x104));}async function fetchNpmDistTags(){const _0xb07321=a30_0xeb4b32;try{const _0x39cf13=NPM_REGISTRY_BASE_URL+'/-/package/'+encodeURIComponent(LOVRABET_NPM_PACKAGE_NAME)+_0xb07321(0xe6),_0x1c0bf4=await fetch(_0x39cf13,{'signal':AbortSignal[_0xb07321(0xd9)](0x2710)});if(!_0x1c0bf4['ok'])return null;const _0xbd6aa8=await _0x1c0bf4[_0xb07321(0xf7)]();if(!_0xbd6aa8||typeof _0xbd6aa8!==_0xb07321(0xd3))return null;return Object['fromEntries'](Object['entries'](_0xbd6aa8)[_0xb07321(0xec)](([,_0x314545])=>typeof _0x314545===_0xb07321(0xf8)&&_0x314545[_0xb07321(0xd8)]())['map'](([_0x2aaeb0,_0x2fcf0e])=>[_0x2aaeb0,String(_0x2fcf0e)[_0xb07321(0xd8)]()]));}catch{return null;}}async function resolveTargetVersion(_0x2baeff){const _0x1dd32a=a30_0xeb4b32,_0x3815a3=getRequestedVersion(_0x2baeff);if(_0x3815a3)return{'version':_0x3815a3,'source':_0x1dd32a(0xee)};const _0x5396fc=_0x2baeff['bool'](_0x1dd32a(0xe7))?_0x1dd32a(0xe7):_0x1dd32a(0xe2),_0x35d96a=await fetchNpmDistTags(),_0x50bf1e=_0x35d96a?.[_0x5396fc];if(!_0x50bf1e)return null;return{'version':_0x50bf1e,'source':_0x5396fc};}function a30_0x318e(_0x2195cb,_0x57b15b){_0x2195cb=_0x2195cb-0xd3;const _0x3c0df1=a30_0x3c0d();let _0x318e28=_0x3c0df1[_0x2195cb];return _0x318e28;}function shouldInstallTarget(_0x1e01b7,_0xeff127){const _0x2702d5=a30_0xeb4b32,_0x152024=compareSemver(_0x1e01b7,_0xeff127['version']);if(_0xeff127[_0x2702d5(0xfc)]===_0x2702d5(0xee))return _0x152024!==0x0;return _0x152024<0x0;}function installCliPackage(_0x4dc8c8,_0x55d123){const _0xf6884=a30_0xeb4b32,_0x66c6d=resolveNpmBin('npm'),_0x448947=[_0xf6884(0x100),'-g',LOVRABET_NPM_PACKAGE_NAME+'@'+_0x4dc8c8];console['log']('*\x20'+[_0x66c6d,..._0x448947][_0xf6884(0x10d)]('\x20'));const _0x574ed4=spawnSync(_0x66c6d,_0x448947,{'cwd':process[_0xf6884(0x10c)](),'stdio':_0x55d123?'pipe':_0xf6884(0xfd),'env':process.env,'shell':![]});if(_0x574ed4[_0xf6884(0xde)]===0x0)return{'ok':!![]};let _0x33d12f=_0x574ed4[_0xf6884(0x108)]?.[_0xf6884(0xd4)]||_0xf6884(0x105)+(_0x574ed4[_0xf6884(0xde)]??_0xf6884(0x113));if(_0x55d123){const _0x25177b=_0x574ed4[_0xf6884(0x109)]?_0x574ed4[_0xf6884(0x109)][_0xf6884(0x10b)]()[_0xf6884(0xd8)]():'',_0x2690f1=_0x574ed4[_0xf6884(0x114)]?_0x574ed4[_0xf6884(0x114)]['toString']()[_0xf6884(0xd8)]():'';if(_0x25177b)_0x33d12f=_0x25177b;else{if(_0x2690f1)_0x33d12f=_0x2690f1;}}return{'ok':![],'error':_0x33d12f};}async function installOfficialSkill(_0x58539a){const _0x10b1ab=a30_0xeb4b32;console[_0x10b1ab(0xd7)]('Checking\x20official\x20skill\x20package...');const _0x3dd7b6=runNpxSkillsAddGlobal(process[_0x10b1ab(0x10c)](),LOVRABET_SKILL_SOURCE,{'stdio':_0x58539a?_0x10b1ab(0x102):_0x10b1ab(0xfd)});if(_0x3dd7b6['skipped']){console[_0x10b1ab(0xd7)]('\x20\x20Skipped\x20skill\x20install\x20('+LOVRABET_SKIP_NPX_SKILLS_ENV+_0x10b1ab(0xe5));return;}if(_0x3dd7b6['ok']){console[_0x10b1ab(0xd7)]('\x20\x20Official\x20skill\x20package\x20is\x20up\x20to\x20date.');return;}console[_0x10b1ab(0x11e)]('\x20\x20Official\x20skill\x20update\x20failed:\x20'+(_0x3dd7b6['error']||'unknown')),console['log']('\x20\x20Run\x20manually:\x20npx\x20skills\x20add\x20'+LOVRABET_SKILL_SOURCE+_0x10b1ab(0xf6));}async function execute(_0xf0c783){const _0x3ab98d=a30_0xeb4b32;await validateUpdateFlags(_0xf0c783);const _0xc0cc4a=getCliVersion();console[_0x3ab98d(0xd7)](_0x3ab98d(0xdc)+_0xc0cc4a),console['log'](_0x3ab98d(0x110));const _0x112d1c=await resolveTargetVersion(_0xf0c783);if(!_0x112d1c){const _0x38ebf3=_0xf0c783[_0x3ab98d(0xf4)](_0x3ab98d(0xe7))?_0x3ab98d(0xe7):_0x3ab98d(0xe2),_0xb3a462=_0x3ab98d(0xdb)+_0x38ebf3+_0x3ab98d(0xff);return console[_0x3ab98d(0x11e)](_0xb3a462),console[_0x3ab98d(0xd7)](_0x3ab98d(0xf0)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x38ebf3),{'ok':![]};}if(!shouldInstallTarget(_0xc0cc4a,_0x112d1c)){const _0xc0218d=_0x112d1c[_0x3ab98d(0xfc)]==='version'?_0x3ab98d(0x11d)+_0x112d1c['version']+').':_0x3ab98d(0xe8)+_0x112d1c[_0x3ab98d(0xee)]+').';return console['log'](_0xc0218d),shouldSkipOfficialSkill(_0xf0c783)?console[_0x3ab98d(0xd7)]('Skipping\x20official\x20skill\x20package\x20(--no-skills).'):await installOfficialSkill(_0xf0c783[_0x3ab98d(0x10e)]),{'ok':!![]};}console[_0x3ab98d(0xd7)](_0x3ab98d(0xf2)+LOVRABET_NPM_PACKAGE_NAME+':\x20'+_0xc0cc4a+'\x20->\x20'+_0x112d1c[_0x3ab98d(0xee)]);const _0xd06ac=installCliPackage(_0x112d1c[_0x3ab98d(0xee)],_0xf0c783[_0x3ab98d(0x10e)]);if(!_0xd06ac['ok']){const _0x1b3067=_0x3ab98d(0xd6)+(_0xd06ac[_0x3ab98d(0x108)]||_0x3ab98d(0x113));return console[_0x3ab98d(0x108)](_0x1b3067),console[_0x3ab98d(0xd7)](_0x3ab98d(0xf9)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x112d1c[_0x3ab98d(0xee)]),{'ok':![]};}return console['log']('Updated\x20to\x20v'+_0x112d1c[_0x3ab98d(0xee)]+'.'),console[_0x3ab98d(0xd7)](_0x3ab98d(0xef)),shouldSkipOfficialSkill(_0xf0c783)?console['log'](_0x3ab98d(0x101)):await installOfficialSkill(_0xf0c783[_0x3ab98d(0x10e)]),{'ok':!![]};}export const updateDefinition={'service':'update','command':a30_0xeb4b32(0xd5),'description':a30_0xeb4b32(0x11c)+CLI_BIN_NAME+a30_0xeb4b32(0xfa),'risk':a30_0xeb4b32(0xed),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};function a30_0x3c0d(){const _0x157865=['Current\x20version:\x20','Install\x20the\x20version\x20from\x20npm\x20latest\x20dist-tag','status','prerelease','5561870SnwRMc','3017877SWlsCL','latest','minor','982064RYBCYa','=1).','/dist-tags','beta','Already\x20up\x20to\x20date\x20(v','1FpHmCN','str','Install\x20a\x20specific\x20CLI\x20version','filter','write','version','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','Use\x20full\x20semver\x20versions\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','Updating\x20','length','bool','no-skills','\x20-g\x20-y','json','string','\x20\x20Try\x20manually:\x20npm\x20install\x20-g\x20','\x20CLI\x20from\x20npm','skills','source','inherit','validation','\x20version\x20from\x20npm.','install','Skipping\x20official\x20skill\x20package\x20(--no-skills).','pipe','patch','Use\x20a\x20full\x20semver\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','exit\x20','args','boolean','error','stderr','flag','toString','cwd','join','nonInteractive','114UkNDQq','Checking\x20npm\x20dist-tags...','Invalid\x20version:\x20','major','unknown','stdout','2993958EWGLqR','Refresh\x20official\x20skill\x20package\x20after\x20updating','Version\x20comparison\x20failed.','--latest,\x20--beta,\x20and\x20version\x20cannot\x20be\x20used\x20together.','30MwPdaS','389011HLQrtD','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','Update\x20','Already\x20on\x20requested\x20version\x20(v','warn','9674460DkjYfz','match','object','message','run','Update\x20failed:\x20','log','trim','timeout','163452swSCyB','Unable\x20to\x20resolve\x20'];a30_0x3c0d=function(){return _0x157865;};return a30_0x3c0d();}
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x2c4655=a31_0x13ba;(function(_0x4269ca,_0x41de33){const _0x1416c9=a31_0x13ba,_0x3e5633=_0x4269ca();while(!![]){try{const _0x5b7a8a=parseInt(_0x1416c9(0x11b))/0x1*(parseInt(_0x1416c9(0x10d))/0x2)+-parseInt(_0x1416c9(0x10e))/0x3+parseInt(_0x1416c9(0x108))/0x4*(-parseInt(_0x1416c9(0x10b))/0x5)+-parseInt(_0x1416c9(0x107))/0x6*(-parseInt(_0x1416c9(0x11e))/0x7)+-parseInt(_0x1416c9(0x114))/0x8+-parseInt(_0x1416c9(0x11d))/0x9+parseInt(_0x1416c9(0x11f))/0xa;if(_0x5b7a8a===_0x41de33)break;else _0x3e5633['push'](_0x3e5633['shift']());}catch(_0xe5b1f0){_0x3e5633['push'](_0x3e5633['shift']());}}}(a31_0x5ac4,0x562db));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{OUTPUT_FORMAT_VALUES}from'../constant/output.js';function a31_0x5ac4(){const _0x329124=['1289169AmcBQx','cliSettableTopLevel','importable','Access\x20key\x20(client-ak\x20auth)','riskLevel','format','1846096ULynnR','Override\x20API\x20domain','enumValues','map','env','Locale','filter','364933nXORDp','has','2804184zRxmpH','4662mZDrax','10080440TWsNxe','locale','Override\x20runtime\x20domain','Risk\x20level','1644hlCjXw','13756IznBdW','Default\x20output\x20format','entries','335puSkXS','Default\x20page\x20size','2subbNb'];a31_0x5ac4=function(){return _0x329124;};return a31_0x5ac4();}export const CONFIG_FIELD_SCHEMAS={'env':{'description':'Target\x20environment','topLevel':!![],'cliSettableTopLevel':!![],'enumValues':RUNTIME_ENV_VALUES,'defaultValue':DEFAULT_CONFIG_VALUES[a31_0x2c4655(0x118)],'importable':!![]},'format':{'description':a31_0x2c4655(0x109),'topLevel':!![],'cliSettableTopLevel':!![],'enumValues':OUTPUT_FORMAT_VALUES,'defaultValue':DEFAULT_CONFIG_VALUES[a31_0x2c4655(0x113)],'importable':!![]},'pageSize':{'description':a31_0x2c4655(0x10c),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'apiDomain':{'description':a31_0x2c4655(0x115),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'userDomain':{'description':'Override\x20user\x20domain','topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'runtimeDomain':{'description':a31_0x2c4655(0x105),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'accessKey':{'description':a31_0x2c4655(0x111),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'riskLevel':{'description':a31_0x2c4655(0x106),'topLevel':!![],'defaultValue':DEFAULT_CONFIG_VALUES[a31_0x2c4655(0x112)],'importable':!![]},'locale':{'description':a31_0x2c4655(0x119),'topLevel':!![],'defaultValue':DEFAULT_CONFIG_VALUES[a31_0x2c4655(0x120)],'importable':!![],'legacyCompatOnly':!![]}};export const TOP_LEVEL_CONFIG_KEYS=new Set(Object['entries'](CONFIG_FIELD_SCHEMAS)[a31_0x2c4655(0x11a)](([,_0x3671a7])=>_0x3671a7[a31_0x2c4655(0x10f)])[a31_0x2c4655(0x117)](([_0x58de64])=>_0x58de64));export const CONFIG_ENUM_VALUES=Object['fromEntries'](Object[a31_0x2c4655(0x10a)](CONFIG_FIELD_SCHEMAS)[a31_0x2c4655(0x11a)](([,_0x59de26])=>_0x59de26['enumValues'])[a31_0x2c4655(0x117)](([_0x29f28f,_0xe490c])=>[_0x29f28f,[..._0xe490c[a31_0x2c4655(0x116)]||[]]]));export const IMPORTABLE_RUNTIME_CONFIG_KEYS=Object[a31_0x2c4655(0x10a)](CONFIG_FIELD_SCHEMAS)[a31_0x2c4655(0x11a)](([,_0xce3f9d])=>_0xce3f9d[a31_0x2c4655(0x110)])[a31_0x2c4655(0x117)](([_0x1d37d1])=>_0x1d37d1);export function getConfigFieldSchema(_0x149cf7){return CONFIG_FIELD_SCHEMAS[_0x149cf7];}export function getConfigEnumValues(_0x12de5a){return getConfigFieldSchema(_0x12de5a)?.['enumValues'];}export function getConfigDefaultValue(_0x516172){return getConfigFieldSchema(_0x516172)?.['defaultValue'];}export function isTopLevelConfigKey(_0x15e6b6){const _0x3e6a69=a31_0x2c4655;return TOP_LEVEL_CONFIG_KEYS[_0x3e6a69(0x11c)](_0x15e6b6);}export function isLegacyCompatConfigKey(_0x3d8dcc){return getConfigFieldSchema(_0x3d8dcc)?.['legacyCompatOnly']===!![];}function a31_0x13ba(_0x26c5d8,_0x56f867){_0x26c5d8=_0x26c5d8-0x105;const _0x5ac49b=a31_0x5ac4();let _0x13bac7=_0x5ac49b[_0x26c5d8];return _0x13bac7;}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function formatConfigKeyList(_0x648888){return[..._0x648888]['join'](',\x20');}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){return'Config\x20key.\x20Top-level:\x20'+getTopLevelConfigKeySummary()+';\x20local\x20alias:\x20apps.<alias>.appcode';}export function buildAppProfileListFields(_0x5c7190){return{'env':_0x5c7190,'hasAccessKey':![],'format':null,'pageSize':null,'riskLevel':null,'locale':null};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a32_0x23b2d1=a32_0x1d78;function a32_0x1d78(_0x57997d,_0x3f5a7b){_0x57997d=_0x57997d-0x1eb;const _0x5d7952=a32_0x5d79();let _0x1d7820=_0x5d7952[_0x57997d];return _0x1d7820;}(function(_0x40b8f2,_0xdaeff5){const _0x23d9ec=a32_0x1d78,_0x255310=_0x40b8f2();while(!![]){try{const _0x427c19=parseInt(_0x23d9ec(0x1f4))/0x1*(-parseInt(_0x23d9ec(0x1f3))/0x2)+parseInt(_0x23d9ec(0x1ef))/0x3*(-parseInt(_0x23d9ec(0x1eb))/0x4)+-parseInt(_0x23d9ec(0x1f0))/0x5*(parseInt(_0x23d9ec(0x1f5))/0x6)+-parseInt(_0x23d9ec(0x1ed))/0x7+parseInt(_0x23d9ec(0x1f1))/0x8+parseInt(_0x23d9ec(0x1f7))/0x9*(-parseInt(_0x23d9ec(0x1f6))/0xa)+parseInt(_0x23d9ec(0x1ec))/0xb;if(_0x427c19===_0xdaeff5)break;else _0x255310['push'](_0x255310['shift']());}catch(_0x5afb21){_0x255310['push'](_0x255310['shift']());}}}(a32_0x5d79,0x63c85));export const AUTH_MODE={'ClientAk':a32_0x23b2d1(0x1ee)};export function isAuthMode(_0x5e6186){const _0x341892=a32_0x23b2d1;return _0x5e6186===AUTH_MODE[_0x341892(0x1f2)];}function a32_0x5d79(){const _0x40eaec=['46omgsHL','14795BjHsSQ','6558BkgByG','8730GZXcKl','3987Iyjnwf','791036RBnluq','17995681jOGDwg','2349760vxWYSV','client-ak','9bFFuxQ','1295uAcURC','5694448iFSHUr','ClientAk'];a32_0x5d79=function(){return _0x40eaec;};return a32_0x5d79();}
|