@lovrabet/lovrabet-cli 2.0.9-beta.6 → 2.0.10
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 -1
- 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 -1
- 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 +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
function a16_0x4fb1(_0x1cf5f6,_0x43e2c9){_0x1cf5f6=_0x1cf5f6-0x15f;const _0x2c91cd=a16_0x2c91();let _0x4fb165=_0x2c91cd[_0x1cf5f6];return _0x4fb165;}const a16_0x220e3a=a16_0x4fb1;(function(_0xd383b,_0x24d0e3){const _0xa48d31=a16_0x4fb1,_0x5d62da=_0xd383b();while(!![]){try{const _0x1c5be9=-parseInt(_0xa48d31(0x197))/0x1+parseInt(_0xa48d31(0x1b5))/0x2*(parseInt(_0xa48d31(0x1a2))/0x3)+-parseInt(_0xa48d31(0x1a8))/0x4*(-parseInt(_0xa48d31(0x164))/0x5)+-parseInt(_0xa48d31(0x19b))/0x6+-parseInt(_0xa48d31(0x1ad))/0x7+-parseInt(_0xa48d31(0x1a7))/0x8*(parseInt(_0xa48d31(0x160))/0x9)+parseInt(_0xa48d31(0x166))/0xa*(parseInt(_0xa48d31(0x162))/0xb);if(_0x1c5be9===_0x24d0e3)break;else _0x5d62da['push'](_0x5d62da['shift']());}catch(_0x2b2906){_0x5d62da['push'](_0x5d62da['shift']());}}}(a16_0x2c91,0x24324));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':'filter','operation':'filter','risk':a16_0x220e3a(0x1a6),'paramsRequired':![],'description':a16_0x220e3a(0x169),'paramsHint':a16_0x220e3a(0x178)+a16_0x220e3a(0x180),'helpExtra':[a16_0x220e3a(0x1b2),a16_0x220e3a(0x17f),a16_0x220e3a(0x181),a16_0x220e3a(0x182),'\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}',a16_0x220e3a(0x18c),'\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}',a16_0x220e3a(0x1a9),a16_0x220e3a(0x167),'\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}',a16_0x220e3a(0x173),'',a16_0x220e3a(0x16a),a16_0x220e3a(0x18d),a16_0x220e3a(0x177),'','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)',a16_0x220e3a(0x165),'\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]',a16_0x220e3a(0x161),'\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','',a16_0x220e3a(0x16b),a16_0x220e3a(0x187),a16_0x220e3a(0x188),a16_0x220e3a(0x171)][a16_0x220e3a(0x183)]('\x0a')},{'command':a16_0x220e3a(0x1b6),'operation':a16_0x220e3a(0x1b6),'risk':'read','paramsRequired':!![],'description':a16_0x220e3a(0x17e),'paramsHint':a16_0x220e3a(0x1a5)},{'command':a16_0x220e3a(0x185),'operation':a16_0x220e3a(0x185),'risk':a16_0x220e3a(0x1b4),'paramsRequired':!![],'description':'Create\x20a\x20new\x20record\x20in\x20a\x20dataset','paramsHint':a16_0x220e3a(0x194)},{'command':a16_0x220e3a(0x17d),'operation':'batchCreate','risk':'write','paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','paramsHint':a16_0x220e3a(0x1b0)},{'command':'update','operation':a16_0x220e3a(0x176),'risk':a16_0x220e3a(0x1b4),'paramsRequired':!![],'description':a16_0x220e3a(0x17c),'paramsHint':a16_0x220e3a(0x19a)},{'command':'delete','operation':a16_0x220e3a(0x1a0),'risk':a16_0x220e3a(0x18f),'paramsRequired':!![],'description':a16_0x220e3a(0x18a),'paramsHint':a16_0x220e3a(0x1a5)},{'command':'aggregate','operation':a16_0x220e3a(0x1a4),'risk':'read','paramsRequired':![],'description':a16_0x220e3a(0x1ab),'paramsHint':'JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20'+a16_0x220e3a(0x1ac),'helpExtra':['\x20\x20AGGREGATE\x20TYPES',a16_0x220e3a(0x184),a16_0x220e3a(0x170),a16_0x220e3a(0x168),a16_0x220e3a(0x17b),a16_0x220e3a(0x198),a16_0x220e3a(0x16c),a16_0x220e3a(0x1aa),'',a16_0x220e3a(0x175),a16_0x220e3a(0x19e),a16_0x220e3a(0x179),a16_0x220e3a(0x191),a16_0x220e3a(0x18e),a16_0x220e3a(0x189),a16_0x220e3a(0x1a1),'',a16_0x220e3a(0x193),a16_0x220e3a(0x1a3),a16_0x220e3a(0x16d),'','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter',a16_0x220e3a(0x195)][a16_0x220e3a(0x183)]('\x0a')}];function makeDataCommand(_0x4d25a5){const _0x48e9f8=a16_0x220e3a,_0x416e6f='data\x20'+_0x4d25a5[_0x48e9f8(0x18b)],_0xaa2ff8={'service':_0x48e9f8(0x17a),'command':_0x4d25a5[_0x48e9f8(0x18b)],'description':_0x4d25a5['description'],'risk':_0x4d25a5[_0x48e9f8(0x1b3)],'helpExtra':_0x4d25a5[_0x48e9f8(0x15f)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x4d25a5[_0x48e9f8(0x192)]}],'validate':async _0x94b205=>{const _0x56b466=_0x48e9f8;_0x4d25a5[_0x56b466(0x19f)]&&requireAnyOf(_0x94b205,[_0x56b466(0x1ae)],_0x416e6f),_0x4d25a5[_0x56b466(0x196)]==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x94b205[_0x56b466(0x19d)](_0x56b466(0x1ae))));},async 'execute'(_0x19ef94){const _0x1e8fe0=_0x48e9f8,_0xdeb688=_0x19ef94[_0x1e8fe0(0x19d)](_0x1e8fe0(0x19c)),_0x25b38a=_0x4d25a5['operation']==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x19ef94[_0x1e8fe0(0x19d)]('params'))):parseJsonParams(_0x19ef94[_0x1e8fe0(0x19d)](_0x1e8fe0(0x1ae)))??{},_0x8778f7=Date[_0x1e8fe0(0x199)](),_0x22f2ef=await executeData(_0xdeb688,_0x4d25a5[_0x1e8fe0(0x196)],_0x25b38a),_0x1bf856=Date[_0x1e8fe0(0x199)]()-_0x8778f7;return{'ok':!![],'data':{'result':_0x22f2ef,'elapsed':_0x1bf856},'message':'data\x20'+_0x4d25a5[_0x1e8fe0(0x18b)]+_0x1e8fe0(0x1b7)+_0x1bf856+'ms'};}};return _0x4d25a5[_0x48e9f8(0x1b3)]!==_0x48e9f8(0x1a6)&&(_0xaa2ff8[_0x48e9f8(0x16f)]=async _0x188811=>{const _0x1f4d5a=_0x48e9f8,_0x47239b=_0x188811['str'](_0x1f4d5a(0x19c)),_0x681e91=_0x4d25a5[_0x1f4d5a(0x196)]===_0x1f4d5a(0x17d)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x188811['str']('params'))):parseJsonParams(_0x188811[_0x1f4d5a(0x19d)](_0x1f4d5a(0x1ae)))??{};return dryRun(_0x1f4d5a(0x1af),_0x1f4d5a(0x190)+_0x47239b+'/'+_0x4d25a5[_0x1f4d5a(0x196)])[_0x1f4d5a(0x172)](_0x681e91)[_0x1f4d5a(0x174)](_0x1f4d5a(0x163)+_0x4d25a5['command']+_0x1f4d5a(0x1b1)+_0x47239b)[_0x1f4d5a(0x186)]();}),_0xaa2ff8;}function a16_0x2c91(){const _0x3d771a=['\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','operation','135185NJOWxN','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','now','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','57660Eeyyle','code','str','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','paramsRequired','delete','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','196869CrViJa','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','aggregate','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','read','48YHnhll','579512AeEPlM','\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','1347276vexvkV','params','POST','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','\x20on\x20dataset\x20','\x20\x20WHERE\x20OPERATORS','risk','write','4mORfbG','getOne','\x20completed\x20in\x20','helpExtra','410472zCjvLu','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','7249sTBXLX','Preview:\x20data\x20','5HAyuQY','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','7330yscEwI','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','Filter\x20dataset\x20records\x20with\x20query\x20conditions','\x20\x20LOGICAL\x20COMBINATORS','\x20\x20PAGINATION','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','map','dryRun','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','body','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','description','\x20\x20PARAMS\x20STRUCTURE','update','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','data','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','Update\x20an\x20existing\x20record','batchCreate','Get\x20a\x20single\x20record\x20by\x20ID','\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','join','\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20field\x20values\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','create','build','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Post-aggregation\x20filter,\x20e.g.\x20{\x22total\x22:{\x22$gt\x22:1000}}','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','command','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','high-risk-write','/api/{appCode}/','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','paramsHint','\x20\x20EXAMPLES','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27'];a16_0x2c91=function(){return _0x3d771a;};return a16_0x2c91();}export const dataDefinitions=specs[a16_0x220e3a(0x16e)](makeDataCommand);
|
|
1
|
+
const a16_0x512e7b=a16_0x7ff9;(function(_0x3caa7f,_0x4200dc){const _0x1533dd=a16_0x7ff9,_0x23b07a=_0x3caa7f();while(!![]){try{const _0x296665=-parseInt(_0x1533dd(0x179))/0x1*(parseInt(_0x1533dd(0x185))/0x2)+parseInt(_0x1533dd(0x164))/0x3*(-parseInt(_0x1533dd(0x152))/0x4)+parseInt(_0x1533dd(0x162))/0x5+-parseInt(_0x1533dd(0x18d))/0x6+-parseInt(_0x1533dd(0x192))/0x7+parseInt(_0x1533dd(0x16f))/0x8*(parseInt(_0x1533dd(0x184))/0x9)+parseInt(_0x1533dd(0x17b))/0xa;if(_0x296665===_0x4200dc)break;else _0x23b07a['push'](_0x23b07a['shift']());}catch(_0x142170){_0x23b07a['push'](_0x23b07a['shift']());}}}(a16_0x4e8e,0xee194));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';function a16_0x7ff9(_0x5dc10f,_0x1d0663){_0x5dc10f=_0x5dc10f-0x151;const _0x4e8eee=a16_0x4e8e();let _0x7ff9a1=_0x4e8eee[_0x5dc10f];return _0x7ff9a1;}import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a16_0x512e7b(0x191),'operation':'filter','risk':a16_0x512e7b(0x176),'paramsRequired':![],'description':a16_0x512e7b(0x171),'paramsHint':a16_0x512e7b(0x167)+'Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','helpExtra':[a16_0x512e7b(0x17d),'\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}',a16_0x512e7b(0x16a),a16_0x512e7b(0x160),a16_0x512e7b(0x189),'\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}',a16_0x512e7b(0x156),a16_0x512e7b(0x197),a16_0x512e7b(0x183),'\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','',a16_0x512e7b(0x173),'\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)',a16_0x512e7b(0x15e),'\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)',a16_0x512e7b(0x15d),'',a16_0x512e7b(0x175),'\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.',a16_0x512e7b(0x18c),a16_0x512e7b(0x199)][a16_0x512e7b(0x158)]('\x0a')},{'command':'getOne','operation':'getOne','risk':'read','paramsRequired':!![],'description':a16_0x512e7b(0x186),'paramsHint':a16_0x512e7b(0x16b)},{'command':a16_0x512e7b(0x157),'operation':a16_0x512e7b(0x157),'risk':a16_0x512e7b(0x188),'paramsRequired':!![],'description':a16_0x512e7b(0x18f),'paramsHint':a16_0x512e7b(0x15c)},{'command':a16_0x512e7b(0x190),'operation':'batchCreate','risk':a16_0x512e7b(0x188),'paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','paramsHint':'JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27'},{'command':a16_0x512e7b(0x168),'operation':a16_0x512e7b(0x168),'risk':'write','paramsRequired':!![],'description':a16_0x512e7b(0x17a),'paramsHint':'JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27'},{'command':'delete','operation':a16_0x512e7b(0x155),'risk':'high-risk-write','paramsRequired':!![],'description':a16_0x512e7b(0x166),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a16_0x512e7b(0x196),'operation':'aggregate','risk':a16_0x512e7b(0x176),'paramsRequired':![],'description':a16_0x512e7b(0x154),'paramsHint':a16_0x512e7b(0x193)+a16_0x512e7b(0x172),'helpExtra':[a16_0x512e7b(0x15f),a16_0x512e7b(0x187),'\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}',a16_0x512e7b(0x17c),'\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}',a16_0x512e7b(0x15a),a16_0x512e7b(0x165),'',a16_0x512e7b(0x198),'\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)',a16_0x512e7b(0x18a),a16_0x512e7b(0x16e),a16_0x512e7b(0x181),'\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','',a16_0x512e7b(0x174),a16_0x512e7b(0x153),a16_0x512e7b(0x177),'',a16_0x512e7b(0x15b),a16_0x512e7b(0x169)][a16_0x512e7b(0x158)]('\x0a')}];function a16_0x4e8e(){const _0x1554bc=['batchCreate','filter','298977SlpOEi','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','code','str','aggregate','\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','\x20\x20PARAMS\x20STRUCTURE','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','dryRun','28UmGIzF','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','delete','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','create','join','data\x20','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','\x20\x20AGGREGATE\x20TYPES','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','\x20on\x20dataset\x20','1421925XRjKjz','map','131436utmffw','\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','update','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','params','body','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','167368mbouqa','/api/{appCode}/','Filter\x20dataset\x20records\x20with\x20query\x20conditions','Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20LOGICAL\x20COMBINATORS','\x20\x20EXAMPLES','\x20\x20PAGINATION','read','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','operation','75403aJRwBk','Update\x20an\x20existing\x20record','30747690oMStqZ','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','\x20\x20WHERE\x20OPERATORS','now','paramsRequired','description','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Post-aggregation\x20filter,\x20e.g.\x20{\x22total\x22:{\x22$gt\x22:1000}}','paramsHint','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','45CEzJki','24RPgPkr','Get\x20a\x20single\x20record\x20by\x20ID','\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20field\x20values\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','write','\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','command','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','7405656IUsySc','build','Create\x20a\x20new\x20record\x20in\x20a\x20dataset'];a16_0x4e8e=function(){return _0x1554bc;};return a16_0x4e8e();}function makeDataCommand(_0x2f52f6){const _0x38302c=a16_0x512e7b,_0x2abbe4=_0x38302c(0x159)+_0x2f52f6[_0x38302c(0x18b)],_0x3aa0a7={'service':'data','command':_0x2f52f6[_0x38302c(0x18b)],'description':_0x2f52f6[_0x38302c(0x180)],'risk':_0x2f52f6['risk'],'helpExtra':_0x2f52f6['helpExtra'],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x2f52f6[_0x38302c(0x182)]}],'validate':async _0x592f3a=>{const _0x29cc96=_0x38302c;_0x2f52f6[_0x29cc96(0x17f)]&&requireAnyOf(_0x592f3a,['params'],_0x2abbe4),_0x2f52f6['operation']===_0x29cc96(0x190)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x592f3a['str']('params')));},async 'execute'(_0x2b06ff){const _0x36af29=_0x38302c,_0x17eda1=_0x2b06ff[_0x36af29(0x195)](_0x36af29(0x194)),_0x5d8dd9=_0x2f52f6[_0x36af29(0x178)]===_0x36af29(0x190)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x2b06ff[_0x36af29(0x195)](_0x36af29(0x16c)))):parseJsonParams(_0x2b06ff[_0x36af29(0x195)]('params'))??{},_0x36250c=Date[_0x36af29(0x17e)](),_0x4326ab=await executeData(_0x17eda1,_0x2f52f6[_0x36af29(0x178)],_0x5d8dd9),_0x381f44=Date[_0x36af29(0x17e)]()-_0x36250c;return{'ok':!![],'data':{'result':_0x4326ab,'elapsed':_0x381f44},'message':_0x36af29(0x159)+_0x2f52f6[_0x36af29(0x18b)]+'\x20completed\x20in\x20'+_0x381f44+'ms'};}};return _0x2f52f6['risk']!==_0x38302c(0x176)&&(_0x3aa0a7[_0x38302c(0x151)]=async _0x303fd1=>{const _0x52e6b9=_0x38302c,_0x53f0a1=_0x303fd1[_0x52e6b9(0x195)](_0x52e6b9(0x194)),_0x27bdfe=_0x2f52f6['operation']===_0x52e6b9(0x190)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x303fd1[_0x52e6b9(0x195)](_0x52e6b9(0x16c)))):parseJsonParams(_0x303fd1[_0x52e6b9(0x195)](_0x52e6b9(0x16c)))??{};return dryRun('POST',_0x52e6b9(0x170)+_0x53f0a1+'/'+_0x2f52f6[_0x52e6b9(0x178)])[_0x52e6b9(0x16d)](_0x27bdfe)[_0x52e6b9(0x180)]('Preview:\x20data\x20'+_0x2f52f6['command']+_0x52e6b9(0x161)+_0x53f0a1)[_0x52e6b9(0x18e)]();}),_0x3aa0a7;}export const dataDefinitions=specs[a16_0x512e7b(0x163)](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a17_0x1e89ee=a17_0x2fb6;(function(_0xaea5a0,_0x3621f5){const _0xa92b0c=a17_0x2fb6,_0x343fe5=_0xaea5a0();while(!![]){try{const _0xb5180=parseInt(_0xa92b0c(0x1d7))/0x1+parseInt(_0xa92b0c(0x19e))/0x2+-parseInt(_0xa92b0c(0x1a5))/0x3*(-parseInt(_0xa92b0c(0x1ca))/0x4)+-parseInt(_0xa92b0c(0x1d0))/0x5*(-parseInt(_0xa92b0c(0x18b))/0x6)+-parseInt(_0xa92b0c(0x1cd))/0x7*(-parseInt(_0xa92b0c(0x1a2))/0x8)+-parseInt(_0xa92b0c(0x1aa))/0x9+-parseInt(_0xa92b0c(0x18c))/0xa;if(_0xb5180===_0x3621f5)break;else _0x343fe5['push'](_0x343fe5['shift']());}catch(_0x125e97){_0x343fe5['push'](_0x343fe5['shift']());}}}(a17_0x253d,0xa7b62));function a17_0x2fb6(_0x11ee84,_0x1bee63){_0x11ee84=_0x11ee84-0x188;const _0x253d7d=a17_0x253d();let _0x2fb640=_0x253d7d[_0x11ee84];return _0x2fb640;}import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x15c40b){const _0x47542d=a17_0x2fb6;if(_0x15c40b['deleted'])return null;const _0x1fa8ee=Boolean(_0x15c40b[_0x47542d(0x1bd)]!==undefined||_0x15c40b[_0x47542d(0x1a6)]!==undefined);let _0x1093ce={};if(!_0x1fa8ee&&typeof _0x15c40b[_0x47542d(0x196)]==='string')try{_0x1093ce=JSON[_0x47542d(0x195)](_0x15c40b[_0x47542d(0x196)]);}catch{}const _0x287687=_0x1fa8ee?_0x15c40b[_0x47542d(0x1ba)]:_0x15c40b['code'],_0xbbc0ce=_0x1fa8ee?_0x15c40b[_0x47542d(0x1bd)]:_0x15c40b[_0x47542d(0x1ba)],_0x214483=_0x1fa8ee?_0x15c40b[_0x47542d(0x1a6)]:_0x15c40b['type']||_0x15c40b[_0x47542d(0x1b7)],_0x49005a=_0x1fa8ee?_0x15c40b['pkField']===!![]:_0x1093ce[_0x47542d(0x19c)]===!![],_0x301c4b=_0x1fa8ee?_0x15c40b[_0x47542d(0x19a)]===!![]:_0x1093ce[_0x47542d(0x19a)]===!![],_0x124b26=_0x1fa8ee?_0x15c40b[_0x47542d(0x18d)]??null:_0x1093ce[_0x47542d(0x18d)]??null,_0x1eeda8={'name':_0x287687,'displayName':_0xbbc0ce||_0x287687,'type':_0x214483,'dbType':_0x15c40b[_0x47542d(0x1b9)],'pk':_0x49005a,'required':_0x301c4b,'description':_0x15c40b[_0x47542d(0x1b5)]||undefined};return Array[_0x47542d(0x1b4)](_0x124b26)&&_0x124b26[_0x47542d(0x1a4)]>0x0&&(_0x1eeda8['options']=_0x124b26),_0x1eeda8;}function parseJsonMaybe(_0x4aacfa){const _0x3e2481=a17_0x2fb6;if(typeof _0x4aacfa!==_0x3e2481(0x1b1))return _0x4aacfa;try{return JSON[_0x3e2481(0x195)](_0x4aacfa);}catch{return _0x4aacfa;}}function a17_0x253d(){const _0x21ae4d=['appCode','path','toField','type','updateTimeField','833220RiVXyf','push','method','read','4669884lbJyee','27408410RoZHPY','options','tableComment','datasetKey','filter','modifierIdField','toDatasetName','validateRules','map','parse','extend','beforeScriptId','dataset','relatedPageInfoList','required','formatRules','pkField','trim','1639700dqXXZd','entries','str','relations','3258272qvgfne','object','length','550644nwzukU','doType','toFieldLabel','split','properties','4609521VXXFxd','dbName','indexes','toDatasetCode','creatorNameField','responseBody','host','string','detail','responseFields','isArray','description','allFieldNames','dataType','afterScriptId','dbType','name','operations','code','displayName','dblinkInfoDTO','dbtableConfig','find','modelId','doVersion','deleted','createTimeField','dbId','logicField','fromField','tableName','columnCodeListWithDeleted','24lEWEJZ','requestFields','allFields','7bpJBis','sourceType','source','5ruPUDL','requestBody'];a17_0x253d=function(){return _0x21ae4d;};return a17_0x253d();}function normalizeOperationEntry(_0x315a01,_0x396455){const _0x2011ae=a17_0x2fb6;if(!_0x396455||typeof _0x396455!==_0x2011ae(0x1a3))return null;if(!_0x396455[_0x2011ae(0x189)]||!_0x396455['path'])return null;const _0x110e6a={'name':_0x315a01,'method':_0x396455['method'],'path':_0x396455[_0x2011ae(0x1d3)]};if(_0x396455[_0x2011ae(0x1b0)])_0x110e6a[_0x2011ae(0x1b0)]=_0x396455['host'];if(_0x396455[_0x2011ae(0x1d1)]!=null)_0x110e6a[_0x2011ae(0x1d1)]=parseJsonMaybe(_0x396455[_0x2011ae(0x1d1)]);if(_0x396455[_0x2011ae(0x1af)]!=null)_0x110e6a[_0x2011ae(0x1af)]=parseJsonMaybe(_0x396455['responseBody']);if(_0x396455['beforeScriptId']!=null)_0x110e6a['beforeScriptId']=_0x396455[_0x2011ae(0x197)];if(_0x396455[_0x2011ae(0x1b8)]!=null)_0x110e6a[_0x2011ae(0x1b8)]=_0x396455['afterScriptId'];if(Array[_0x2011ae(0x1b4)](_0x396455['requestFields']))_0x110e6a[_0x2011ae(0x1cb)]=_0x396455['requestFields'];if(Array[_0x2011ae(0x1b4)](_0x396455['responseFields']))_0x110e6a['responseFields']=_0x396455[_0x2011ae(0x1b3)];return _0x110e6a;}function summarizeDbtable(_0x374ae4){const _0x389bb1=a17_0x2fb6,_0x530aa2={},_0x173d44=[_0x389bb1(0x1c5),'dbName',_0x389bb1(0x1c8),_0x389bb1(0x18f),_0x389bb1(0x19c),_0x389bb1(0x1cc),_0x389bb1(0x1c6),_0x389bb1(0x1c4),_0x389bb1(0x1d6),'creatorIdField',_0x389bb1(0x1ae),_0x389bb1(0x191),'modifierNameField','labelField',_0x389bb1(0x1be)];for(const _0x2d6822 of _0x173d44){if(_0x374ae4[_0x2d6822]!==undefined)_0x530aa2[_0x2d6822]=_0x374ae4[_0x2d6822];}return typeof _0x530aa2[_0x389bb1(0x1cc)]==='string'&&_0x530aa2['allFields'][_0x389bb1(0x1a4)]>0x0&&(_0x530aa2[_0x389bb1(0x1b6)]=_0x530aa2[_0x389bb1(0x1cc)]['split'](',')[_0x389bb1(0x194)](_0x18e855=>_0x18e855[_0x389bb1(0x19d)]())[_0x389bb1(0x190)](Boolean)),_0x530aa2;}function normalizeRelatedPages(_0x2a3b1a){const _0x37ff70=a17_0x2fb6;if(!Array['isArray'](_0x2a3b1a))return[];return _0x2a3b1a[_0x37ff70(0x190)](_0x31ace5=>_0x31ace5&&typeof _0x31ace5===_0x37ff70(0x1a3))[_0x37ff70(0x194)](_0x456635=>({'id':_0x456635['id'],'type':_0x456635[_0x37ff70(0x1d5)],'code':_0x456635['code'],'title':_0x456635['title'],'deleted':_0x456635[_0x37ff70(0x1c3)]===!![]}));}function normalizeFallbackFieldName(_0x42d78c,_0x121977){const _0xe4ba89=a17_0x2fb6,_0x312f5d=_0x42d78c[_0xe4ba89(0x19d)]();if(!_0x312f5d)return null;return{'name':_0x312f5d,'displayName':_0x312f5d,'type':undefined,'dbType':undefined,'pk':_0x312f5d===_0x121977,'required':![],'description':undefined};}async function loadListFieldFallback(_0x5ba0c9,_0x25847e){const _0x4d4166=a17_0x2fb6;if(!_0x5ba0c9||!_0x25847e)return[];try{const _0x22647c=await listDatasets(_0x5ba0c9,{'code':_0x25847e}),_0x53027e=_0x22647c[_0x4d4166(0x1c0)](_0x276946=>_0x276946[_0x4d4166(0x1bc)]===_0x25847e)??_0x22647c[0x0],_0x4e0b1b=_0x53027e?.[_0x4d4166(0x1bf)]??{},_0x4c1515=typeof _0x4e0b1b[_0x4d4166(0x1cc)]===_0x4d4166(0x1b1)?_0x4e0b1b[_0x4d4166(0x1cc)][_0x4d4166(0x1a8)](','):[];return _0x4c1515[_0x4d4166(0x194)](_0x4b2dbc=>normalizeFallbackFieldName(_0x4b2dbc,_0x4e0b1b[_0x4d4166(0x19c)]))[_0x4d4166(0x190)](_0x5e6851=>_0x5e6851!==null);}catch{return[];}}export const datasetDetail={'service':a17_0x1e89ee(0x198),'command':a17_0x1e89ee(0x1b2),'description':'Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','risk':a17_0x1e89ee(0x18a),'flags':[CODE_FLAG],async 'execute'(_0x5560f1){const _0x3f1878=a17_0x1e89ee,_0x54257c=await getDatasetDetail(_0x5560f1[_0x3f1878(0x1a0)]('code')),_0x27565c=Array[_0x3f1878(0x1b4)](_0x54257c['fields'])?_0x54257c['fields']:Array[_0x3f1878(0x1b4)](_0x54257c['properties'])?_0x54257c[_0x3f1878(0x1a9)]:[];let _0x4d6560=_0x27565c[_0x3f1878(0x194)](_0x29d9d3=>normalizeField(_0x29d9d3))['filter'](_0x33be54=>_0x33be54!==null);_0x4d6560[_0x3f1878(0x1a4)]===0x0&&(_0x4d6560=await loadListFieldFallback(_0x5560f1[_0x3f1878(0x1d2)],_0x5560f1[_0x3f1878(0x1a0)](_0x3f1878(0x1bc))));const _0x46f1a8=_0x54257c[_0x3f1878(0x1bb)]??{},_0x18693f=[];for(const [_0x4f0a3e,_0x22e73a]of Object[_0x3f1878(0x19f)](_0x46f1a8)){const _0x489cac=normalizeOperationEntry(_0x4f0a3e,_0x22e73a);if(_0x489cac)_0x18693f[_0x3f1878(0x188)](_0x489cac);}const _0x26d77c=_0x54257c[_0x3f1878(0x1bf)]??{},_0x364ddd=_0x54257c[_0x3f1878(0x198)]??{},_0x1b45bb=_0x26d77c[_0x3f1878(0x1c5)]!=null?{'id':_0x26d77c[_0x3f1878(0x1c5)],'name':_0x26d77c[_0x3f1878(0x1ab)]??null}:undefined;let _0x4a616c;return typeof _0x54257c[_0x3f1878(0x196)]===_0x3f1878(0x1b1)&&(_0x4a616c=parseJsonMaybe(_0x54257c[_0x3f1878(0x196)])),{'ok':!![],'data':{'id':_0x54257c[_0x3f1878(0x1c1)]??_0x54257c['id'],'name':_0x54257c['name'],'code':_0x54257c['modelCode']||_0x54257c[_0x3f1878(0x1bc)],'doVersion':_0x54257c[_0x3f1878(0x1c2)],'description':_0x54257c['description']||_0x364ddd[_0x3f1878(0x18e)]||undefined,'source':_0x54257c[_0x3f1878(0x1cf)]||_0x364ddd[_0x3f1878(0x1ce)],'table':_0x26d77c['tableName']||_0x364ddd['tableName'],'datasetKey':_0x26d77c[_0x3f1878(0x18f)],'pk':_0x26d77c[_0x3f1878(0x19c)],'db':_0x1b45bb,'dbtable':summarizeDbtable(_0x26d77c),'fields':_0x4d6560,'operations':_0x18693f,'indexes':Array[_0x3f1878(0x1b4)](_0x364ddd[_0x3f1878(0x1ac)])?_0x364ddd['indexes']:[],'relations':Array[_0x3f1878(0x1b4)](_0x54257c[_0x3f1878(0x1a1)])?_0x54257c[_0x3f1878(0x1a1)][_0x3f1878(0x194)](_0xb7126a=>({'fromField':_0xb7126a[_0x3f1878(0x1c7)],'toDataset':_0xb7126a[_0x3f1878(0x192)],'toCode':_0xb7126a[_0x3f1878(0x1ad)],'toTable':_0xb7126a['toTableName'],'toField':_0xb7126a[_0x3f1878(0x1d4)],'labelField':_0xb7126a[_0x3f1878(0x1a7)]||undefined})):[],'relatedPages':normalizeRelatedPages(_0x54257c[_0x3f1878(0x199)]),...Array['isArray'](_0x54257c['columnCodeListWithDeleted'])?{'columnCodeListWithDeleted':_0x54257c[_0x3f1878(0x1c9)]}:{},'formatRules':Array[_0x3f1878(0x1b4)](_0x54257c[_0x3f1878(0x19b)])?_0x54257c[_0x3f1878(0x19b)]:[],'validateRules':Array[_0x3f1878(0x1b4)](_0x54257c[_0x3f1878(0x193)])?_0x54257c[_0x3f1878(0x193)]:[],..._0x4a616c!==undefined?{'extend':_0x4a616c}:{},'stats':{'fieldCount':_0x4d6560['length'],'operationCount':_0x18693f[_0x3f1878(0x1a4)]}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xbcf2b4,_0x352c4b){const _0x32bfa7=a18_0x2a1a,_0x14ba6e=_0xbcf2b4();while(!![]){try{const _0x41c125=-parseInt(_0x32bfa7(0x1e6))/0x1*(-parseInt(_0x32bfa7(0x1e3))/0x2)+-parseInt(_0x32bfa7(0x1dc))/0x3+-parseInt(_0x32bfa7(0x1e0))/0x4*(parseInt(_0x32bfa7(0x1e1))/0x5)+-parseInt(_0x32bfa7(0x1e5))/0x6*(-parseInt(_0x32bfa7(0x1e4))/0x7)+-parseInt(_0x32bfa7(0x1db))/0x8*(parseInt(_0x32bfa7(0x1dd))/0x9)+parseInt(_0x32bfa7(0x1df))/0xa*(-parseInt(_0x32bfa7(0x1e7))/0xb)+parseInt(_0x32bfa7(0x1de))/0xc*(parseInt(_0x32bfa7(0x1e2))/0xd);if(_0x41c125===_0x352c4b)break;else _0x14ba6e['push'](_0x14ba6e['shift']());}catch(_0x136fdc){_0x14ba6e['push'](_0x14ba6e['shift']());}}}(a18_0x1911,0x5a548));function a18_0x2a1a(_0x3c6971,_0x1d2dc4){_0x3c6971=_0x3c6971-0x1db;const _0x191113=a18_0x1911();let _0x2a1a80=_0x191113[_0x3c6971];return _0x2a1a80;}function a18_0x1911(){const _0x5d7773=['5ZMjscS','26IbjocG','166GQsqIG','4724860nsGgHK','6pglwwC','1723ogIVhx','4057834vXtTFJ','4648vpoanT','1180113yxUzEw','5706Lkxvom','7709076YeabTu','20ipYZZr','933320NgdvZU'];a18_0x1911=function(){return _0x5d7773;};return a18_0x1911();}import{datasetList}from'../../commands/dataset/list.js';import{datasetDetail}from'../../commands/dataset/detail.js';export const datasetDefinitions=[datasetList,datasetDetail];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a19_0x4c5fcb=a19_0x39aa;(function(_0x3d0448,_0x56014b){const _0x580247=a19_0x39aa,_0x2379e9=_0x3d0448();while(!![]){try{const _0x4b32c8=-parseInt(_0x580247(0x1c7))/0x1*(-parseInt(_0x580247(0x1cc))/0x2)+-parseInt(_0x580247(0x1d0))/0x3*(parseInt(_0x580247(0x1b9))/0x4)+-parseInt(_0x580247(0x1bb))/0x5*(-parseInt(_0x580247(0x1be))/0x6)+-parseInt(_0x580247(0x1c5))/0x7+parseInt(_0x580247(0x1ba))/0x8+-parseInt(_0x580247(0x1bc))/0x9*(parseInt(_0x580247(0x1d1))/0xa)+parseInt(_0x580247(0x1c2))/0xb;if(_0x4b32c8===_0x56014b)break;else _0x2379e9['push'](_0x2379e9['shift']());}catch(_0x25f46a){_0x2379e9['push'](_0x2379e9['shift']());}}}(a19_0x24ec,0x48074));function a19_0x39aa(_0x51855f,_0x5922b5){_0x51855f=_0x51855f-0x1b9;const _0x24ec2c=a19_0x24ec();let _0x39aa0e=_0x24ec2c[_0x51855f];return _0x39aa0e;}import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function a19_0x24ec(){const _0x214138=['923205IGAHYC','36BsRhAi','Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)','12oTcVXG','allFields','pkField','code','7120784vovtRv','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','map','1684536lWqAxp','length','38SjdrbY','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','trim','source','datasetKey','2806nYszOa','dbtableConfig','split','tableName','824451mcmOJd','981290GKdXvh','appCode','string','description','8TNfciK','3263088FRbulN'];a19_0x24ec=function(){return _0x214138;};return a19_0x24ec();}export const datasetList={'service':'dataset','command':'list','description':a19_0x4c5fcb(0x1c3),'risk':'read','flags':[{'name':'name','type':a19_0x4c5fcb(0x1d3),'description':a19_0x4c5fcb(0x1bd)},{...CODE_FLAG,'required':![],'description':a19_0x4c5fcb(0x1c8)}],async 'execute'(_0x325576){const _0x51425f=a19_0x4c5fcb,_0x45ea24=_0x325576['str']('name'),_0x10c26c=_0x325576['str'](_0x51425f(0x1c1)),_0x5d43ec=await listDatasets(_0x325576[_0x51425f(0x1d2)],{..._0x45ea24&&{'name':_0x45ea24},..._0x10c26c&&{'code':_0x10c26c}});return{'ok':!![],'data':{'total':_0x5d43ec[_0x51425f(0x1c6)],'datasets':_0x5d43ec[_0x51425f(0x1c4)](_0x1b7d83=>{const _0x50d025=_0x51425f,_0x39ba5c=_0x1b7d83[_0x50d025(0x1cd)]??{};return{'id':_0x1b7d83['id'],'code':_0x1b7d83[_0x50d025(0x1c1)],'name':_0x1b7d83['name'],'source':_0x1b7d83[_0x50d025(0x1ca)],'description':_0x1b7d83[_0x50d025(0x1d4)],'table':_0x39ba5c[_0x50d025(0x1cf)],'datasetKey':_0x39ba5c[_0x50d025(0x1cb)],'pk':_0x39ba5c[_0x50d025(0x1c0)],'fields':_0x39ba5c[_0x50d025(0x1bf)]?_0x39ba5c[_0x50d025(0x1bf)][_0x50d025(0x1ce)](',')[_0x50d025(0x1c4)](_0x229ffc=>_0x229ffc[_0x50d025(0x1c9)]()):[]};})}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0xd4a594=a20_0x46c2;function a20_0x3ca8(){const _0x4ab0c8=['441MSdpRe','⚠\x20Empty\x20(treated\x20as\x20{})','\x20(legacy/compat\x20only)','format','(default:\x20','red','(missing)','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','12978306duDEeZ','log','ClientAk','961248KehMIf','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','\x20\x20Merged\x20Config','yellow','currentApp','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','(default)','locale','version','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','read','2826530AoMzOx','\x20\x20API\x20Endpoints','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','status','(not\x20found)','pageSize','1918RRWxJn','✓\x20Valid\x20JSON','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','\x20\x20─','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','bold','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','438qdoGaR','platform','verbose','length','missing','gray','\x20\x20Auth','\x20\x20runtimeDomain:\x20\x20\x20','(no\x20file)','green','\x20(accessKey)','accessKey','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','(none)','arch','\x20\x20Session\x20check:\x20\x20\x20','1358424RlYrKD','Project','Diagnose\x20CLI\x20configuration\x20and\x20environment','1989392lmTDUw','padEnd','\x20\x20auth\x20(effective):\x20','\x20doctor','52062RQjbaR','doctor','appCode','(set,\x20length=','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','(not\x20set)','repeat'];a20_0x3ca8=function(){return _0x4ab0c8;};return a20_0x3ca8();}(function(_0x1ca56c,_0x5a8b92){const _0x624e48=a20_0x46c2,_0x793b3a=_0x1ca56c();while(!![]){try{const _0x20f2cf=-parseInt(_0x624e48(0xa0))/0x1*(-parseInt(_0x624e48(0xa7))/0x2)+parseInt(_0x624e48(0xd0))/0x3+-parseInt(_0x624e48(0xb7))/0x4+parseInt(_0x624e48(0x9a))/0x5+parseInt(_0x624e48(0xbe))/0x6*(parseInt(_0x624e48(0xc5))/0x7)+parseInt(_0x624e48(0xba))/0x8+-parseInt(_0x624e48(0xcd))/0x9;if(_0x20f2cf===_0x5a8b92)break;else _0x793b3a['push'](_0x793b3a['shift']());}catch(_0x2f0105){_0x793b3a['push'](_0x793b3a['shift']());}}}(a20_0x3ca8,0x4dfd9));function a20_0x46c2(_0x379980,_0x332434){_0x379980=_0x379980-0x94;const _0x3ca8b7=a20_0x3ca8();let _0x46c281=_0x3ca8b7[_0x379980];return _0x46c281;}import a20_0x1791f6 from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';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(_0x4e391e){const _0x98e0b8=a20_0x46c2,_0x2fbae8=getCliVersion(),_0x962fe5=buildConfigFromFlags({});await initGlobalEnvironment(_0x962fe5),console[_0x98e0b8(0xce)](),console[_0x98e0b8(0xce)](a20_0x1791f6[_0x98e0b8(0xa5)](CLI_BIN_NAME+_0x98e0b8(0xbd))),console[_0x98e0b8(0xce)](a20_0x1791f6['gray']('─'[_0x98e0b8(0xc4)](0x32))),console[_0x98e0b8(0xce)]('\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20'+_0x2fbae8),console['log']('\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+process[_0x98e0b8(0x97)]),console['log']('\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20'+process[_0x98e0b8(0xa8)]+'\x20'+process[_0x98e0b8(0xb5)]),console['log'](),console[_0x98e0b8(0xce)](a20_0x1791f6['bold']('\x20\x20Config\x20Files')),console[_0x98e0b8(0xce)](a20_0x1791f6[_0x98e0b8(0xac)](_0x98e0b8(0xa3)[_0x98e0b8(0xc4)](0x1e)));const _0x5cdbd5=getGlobalConfigPath(),_0x101205=getProjectConfigPath();console[_0x98e0b8(0xce)]('\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x5cdbd5||a20_0x1791f6[_0x98e0b8(0xac)](_0x98e0b8(0x9e)))),console['log'](_0x98e0b8(0xb3)+(_0x101205||a20_0x1791f6[_0x98e0b8(0xac)](_0x98e0b8(0x9e)))),console[_0x98e0b8(0xce)](),console['log'](a20_0x1791f6['bold']('\x20\x20Config\x20JSON')),console[_0x98e0b8(0xce)](a20_0x1791f6['gray'](_0x98e0b8(0xa3)[_0x98e0b8(0xc4)](0x1e)));const _0x1639f6=(_0x398dc9,_0x47d36e)=>{const _0xe44385=_0x98e0b8;if(!_0x47d36e){console[_0xe44385(0xce)]('\x20\x20'+_0x398dc9[_0xe44385(0xbb)](0x11)+'\x20'+a20_0x1791f6['gray'](_0xe44385(0xaf)));return;}const _0x4dba20=inspectCliConfigJsonFile(_0x47d36e);if(_0x4dba20[_0xe44385(0x9d)]==='ok')console[_0xe44385(0xce)]('\x20\x20'+_0x398dc9[_0xe44385(0xbb)](0x11)+'\x20'+a20_0x1791f6[_0xe44385(0xb0)](_0xe44385(0xa1)));else{if(_0x4dba20[_0xe44385(0x9d)]==='empty')console[_0xe44385(0xce)]('\x20\x20'+_0x398dc9['padEnd'](0x11)+'\x20'+a20_0x1791f6[_0xe44385(0xd3)](_0xe44385(0xc6)));else _0x4dba20[_0xe44385(0x9d)]===_0xe44385(0xab)?console['log']('\x20\x20'+_0x398dc9[_0xe44385(0xbb)](0x11)+'\x20'+a20_0x1791f6['gray'](_0xe44385(0xcb))):(console[_0xe44385(0xce)]('\x20\x20'+_0x398dc9[_0xe44385(0xbb)](0x11)+'\x20'+a20_0x1791f6[_0xe44385(0xca)]('✗\x20Invalid\x20JSON')),console[_0xe44385(0xce)]('\x20\x20'+''[_0xe44385(0xbb)](0x11)+'\x20'+a20_0x1791f6['red'](_0x4dba20['message'])));}};_0x1639f6('Global',_0x5cdbd5),_0x1639f6(_0x98e0b8(0xb8),_0x101205),console[_0x98e0b8(0xce)](),console[_0x98e0b8(0xce)](a20_0x1791f6['bold'](_0x98e0b8(0xd2))),console[_0x98e0b8(0xce)](a20_0x1791f6['gray'](_0x98e0b8(0xa3)[_0x98e0b8(0xc4)](0x1e))),console[_0x98e0b8(0xce)](_0x98e0b8(0x94)+(_0x962fe5[_0x98e0b8(0xc0)]||a20_0x1791f6[_0x98e0b8(0xca)](_0x98e0b8(0xc3)))),console[_0x98e0b8(0xce)](_0x98e0b8(0xa4)+_0x962fe5['env']);const _0x4a5aeb=isLegacyCompatConfigKey(_0x98e0b8(0x96))?a20_0x1791f6[_0x98e0b8(0xac)](_0x962fe5[_0x98e0b8(0x96)]+_0x98e0b8(0xc7)):_0x962fe5[_0x98e0b8(0x96)];return console[_0x98e0b8(0xce)](_0x98e0b8(0x98)+_0x4a5aeb),console[_0x98e0b8(0xce)](_0x98e0b8(0xd1)+(_0x962fe5['defaultApp']||a20_0x1791f6['gray']('(none)'))),console['log']('\x20\x20currentApp:\x20\x20\x20\x20\x20\x20'+(_0x962fe5[_0x98e0b8(0xd4)]||a20_0x1791f6[_0x98e0b8(0xac)](_0x98e0b8(0xb4)))),console[_0x98e0b8(0xce)]('\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x962fe5[_0x98e0b8(0xc8)]||a20_0x1791f6[_0x98e0b8(0xac)](_0x98e0b8(0xc9)+DEFAULT_CONFIG_VALUES[_0x98e0b8(0xc8)]+')'))),console['log'](_0x98e0b8(0xc2)+(_0x962fe5[_0x98e0b8(0x9f)]??a20_0x1791f6['gray'](_0x98e0b8(0x95)))),console[_0x98e0b8(0xce)](_0x98e0b8(0xcc)+_0x962fe5['riskLevel']),console['log']('\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x962fe5[_0x98e0b8(0xa9)]),console[_0x98e0b8(0xce)](_0x98e0b8(0xbc)+AUTH_MODE['ClientAk']),console[_0x98e0b8(0xce)](_0x98e0b8(0xa6)+(_0x962fe5[_0x98e0b8(0xb2)]?a20_0x1791f6[_0x98e0b8(0xb0)](_0x98e0b8(0xc1)+_0x962fe5['accessKey'][_0x98e0b8(0xaa)]+')'):a20_0x1791f6[_0x98e0b8(0xac)](_0x98e0b8(0xb4)))),console[_0x98e0b8(0xce)](),console[_0x98e0b8(0xce)](a20_0x1791f6['bold'](_0x98e0b8(0x9b))),console[_0x98e0b8(0xce)](a20_0x1791f6['gray'](_0x98e0b8(0xa3)['repeat'](0x1e))),console[_0x98e0b8(0xce)](_0x98e0b8(0x9c)+getApiDomain()),console[_0x98e0b8(0xce)](_0x98e0b8(0xa2)+getUserDomain()),console[_0x98e0b8(0xce)](_0x98e0b8(0xae)+getRuntimeDomain()),console['log'](),console['log'](a20_0x1791f6[_0x98e0b8(0xa5)](_0x98e0b8(0xad))),console['log'](a20_0x1791f6[_0x98e0b8(0xac)](_0x98e0b8(0xa3)['repeat'](0x1e))),console['log']('\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+a20_0x1791f6[_0x98e0b8(0xb0)](AUTH_MODE[_0x98e0b8(0xcf)]+_0x98e0b8(0xb1))),console[_0x98e0b8(0xce)](_0x98e0b8(0xb6)+a20_0x1791f6[_0x98e0b8(0xac)]('(removed\x20—\x20cookie\x20auth\x20disabled)')),console[_0x98e0b8(0xce)](),{'ok':!![]};}export const doctorDefinition={'service':a20_0xd4a594(0xbf),'command':'check','description':a20_0xd4a594(0xb9),'risk':a20_0xd4a594(0x99),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a21_0x126870=a21_0xe183;(function(_0x4256f7,_0x530577){const _0x1979ca=a21_0xe183,_0x34c91d=_0x4256f7();while(!![]){try{const _0x7408b6=-parseInt(_0x1979ca(0x139))/0x1+-parseInt(_0x1979ca(0x12b))/0x2+parseInt(_0x1979ca(0x13c))/0x3*(-parseInt(_0x1979ca(0x13d))/0x4)+parseInt(_0x1979ca(0x14a))/0x5+-parseInt(_0x1979ca(0x125))/0x6+-parseInt(_0x1979ca(0x11e))/0x7*(parseInt(_0x1979ca(0x137))/0x8)+-parseInt(_0x1979ca(0x14c))/0x9*(-parseInt(_0x1979ca(0x126))/0xa);if(_0x7408b6===_0x530577)break;else _0x34c91d['push'](_0x34c91d['shift']());}catch(_0x41c7b8){_0x34c91d['push'](_0x34c91d['shift']());}}}(a21_0x47e5,0xbf1f8));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';function a21_0x47e5(){const _0x5f4570=['race','env','971670fYofek','84710FabTqR','app','\x20already\x20exists.\x20Overwrite?','file','parse','1479340IPFbMt','project','validation','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','name','Source\x20file\x20not\x20found:\x20','log','once','SIGINT','flagMissing','apiDir','cwd','10381648UOulQH',')\x20instead\x20of\x20project','721907bKwYGa','includes','Invalid\x20env\x20\x22','21bYWrAO','724832fLHzDH','[y/N]','Failed\x20to\x20parse\x20source\x20file:\x20','\x20\x20default:\x20','riskLevel','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','cancelled','yes','Usage:\x20','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','close','\x20\x20appcode:\x20','string','5845225jjGnsh','File\x20','4041TGYudR','\x22.\x20Allowed:\x20','Skip\x20confirmation\x20when\x20overwriting','object','\x20\x20config:\x20\x20','stdin','entries','boolean','Override\x20imported\x20default\x20env','App\x20code\x20for\x20the\x20project','App\x20code\x20cannot\x20be\x20empty.','Override\x20imported\x20default\x20appcode','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','[Y/n]','\x20\x20env:\x20\x20\x20\x20\x20','User\x20aborted\x20prompt','Initialized\x20','question','removeListener','trim','toLowerCase','newConfigFileName','Write\x20to\x20global\x20(~/','defaultApp','global','App\x20code','7HtfXZg','AbortPrompt','apps','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`.','appcode'];a21_0x47e5=function(){return _0x5f4570;};return a21_0x47e5();}import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';function a21_0xe183(_0x1d86bd,_0x30c864){_0x1d86bd=_0x1d86bd-0x10b;const _0x47e57d=a21_0x47e5();let _0xe1833f=_0x47e57d[_0x1d86bd];return _0xe1833f;}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':'appcode','type':a21_0x126870(0x149),'description':a21_0x126870(0x10d)},{'name':'env','type':a21_0x126870(0x149),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES['env']+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x126870(0x11c),'type':a21_0x126870(0x10b),'description':a21_0x126870(0x11a)+PRODUCT_CONFIG[a21_0x126870(0x119)]+a21_0x126870(0x138),'default':![]},{'name':'yes','type':a21_0x126870(0x10b),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':'file','type':a21_0x126870(0x149),'description':a21_0x126870(0x142),'required':!![]},{'name':a21_0x126870(0x122),'type':a21_0x126870(0x149),'description':a21_0x126870(0x10f)},{'name':'env','type':a21_0x126870(0x149),'description':a21_0x126870(0x10c),'enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x126870(0x11c),'type':a21_0x126870(0x10b),'description':a21_0x126870(0x11a)+PRODUCT_CONFIG[a21_0x126870(0x119)]+a21_0x126870(0x138),'default':![]},{'name':a21_0x126870(0x144),'type':a21_0x126870(0x10b),'description':a21_0x126870(0x14e),'default':![]}];export async function runInit(_0x24f80b){const _0x5f3476=a21_0x126870,_0x8dab54=isNonInteractiveMode(_0x24f80b),_0x5cd5e1=_0x24f80b[_0x5f3476(0x11c)]?_0x5f3476(0x11c):'project',_0x2c42a2=resolveWriteConfigPath(_0x5cd5e1);try{_0x8dab54?await runNonInteractive(_0x24f80b,_0x2c42a2):await runInteractive(_0x24f80b,_0x2c42a2);}catch(_0x3350d0){if(_0x3350d0 instanceof AbortPrompt)throw CliErrors[_0x5f3476(0x143)]();throw _0x3350d0;}}export async function runInitImport(_0x355f78){const _0x288804=a21_0x126870,_0x437e9f=_0x355f78[_0x288804(0x11c)]?_0x288804(0x11c):_0x288804(0x12c),_0x4e7aba=resolveWriteConfigPath(_0x437e9f);await runFromImport(_0x355f78,_0x4e7aba);}const RUNTIME_IRRELEVANT_KEYS=new Set([a21_0x126870(0x135)]);async function runFromImport(_0x34533a,_0x42c6a4){const _0x236d9a=a21_0x126870,_0x5b641e=resolveFilePath(_0x34533a[_0x236d9a(0x129)]);if(!existsSync(_0x5b641e))throw CliErrors[_0x236d9a(0x12d)](_0x236d9a(0x130)+_0x5b641e);const _0x4bd2ad=readSourceFile(_0x5b641e),_0x5ee47d=convertToRuntimeConfig(_0x4bd2ad);_0x34533a[_0x236d9a(0x122)]&&(_0x5ee47d[_0x236d9a(0x122)]=String(_0x34533a['appcode']));_0x34533a[_0x236d9a(0x124)]&&(_0x5ee47d[_0x236d9a(0x124)]=resolveInitEnv(_0x34533a));if(!_0x5ee47d[_0x236d9a(0x122)])throw CliErrors[_0x236d9a(0x12d)](_0x236d9a(0x146),_0x236d9a(0x121));await writeInitConfig(_0x42c6a4,_0x5ee47d,_0x34533a),console[_0x236d9a(0x131)]('Imported\x20from\x20'+_0x5b641e),console[_0x236d9a(0x131)](_0x236d9a(0x150)+_0x42c6a4),console['log']('\x20\x20appcode:\x20'+_0x5ee47d['appcode']);if(_0x5ee47d[_0x236d9a(0x11b)])console['log'](_0x236d9a(0x140)+_0x5ee47d[_0x236d9a(0x11b)]);}function convertToRuntimeConfig(_0x584756){const _0x2779fa=a21_0x126870;if(_0x584756['apps']&&typeof _0x584756[_0x2779fa(0x120)]===_0x2779fa(0x14f))throw CliErrors[_0x2779fa(0x12d)]('Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.',_0x2779fa(0x110));const _0x7cf276={};for(const _0x193836 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x584756[_0x193836]!==undefined&&(_0x7cf276[_0x193836]=_0x584756[_0x193836]);}return!_0x7cf276['riskLevel']&&(_0x7cf276['riskLevel']=DEFAULT_CONFIG_VALUES[_0x2779fa(0x141)]),_0x7cf276;}async function runNonInteractive(_0x3d4552,_0x146d57){const _0x48d2b7=a21_0x126870,_0x311b01=_0x3d4552[_0x48d2b7(0x122)];if(!_0x311b01)throw CliErrors[_0x48d2b7(0x134)](_0x48d2b7(0x122),_0x48d2b7(0x145)+CLI_BIN_NAME+_0x48d2b7(0x12e));const _0x9d9168=resolveInitEnv(_0x3d4552);await writeInitConfig(_0x146d57,{'appcode':_0x311b01,'env':_0x9d9168},_0x3d4552),console[_0x48d2b7(0x131)](_0x48d2b7(0x114)+_0x146d57),console[_0x48d2b7(0x131)]('\x20\x20appcode:\x20'+_0x311b01),console['log'](_0x48d2b7(0x112)+_0x9d9168);}async function runInteractive(_0x270bd0,_0x11fcd0){const _0x272bfc=a21_0x126870,_0x36aa96=loadExisting(_0x11fcd0),_0x42b4de=typeof _0x36aa96?.['appcode']==='string'?_0x36aa96['appcode']:'',_0x2ff693=resolveInitEnv(_0x270bd0);console[_0x272bfc(0x131)](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG[_0x272bfc(0x119)]+'\x0a');if(existsSync(_0x11fcd0)&&!_0x270bd0['yes']){const _0x54e3ea=await promptYesNo(_0x272bfc(0x14b)+_0x11fcd0+_0x272bfc(0x128),![]);if(!_0x54e3ea){console[_0x272bfc(0x131)]('Aborted.');return;}}const _0xe302ef=typeof _0x270bd0[_0x272bfc(0x122)]===_0x272bfc(0x149)?_0x270bd0[_0x272bfc(0x122)][_0x272bfc(0x117)]():'';let _0x29cc04=_0xe302ef;!_0x29cc04&&(_0x29cc04=await promptInput(_0x272bfc(0x11d),_0x42b4de));if(!_0x29cc04[_0x272bfc(0x117)]())throw CliErrors['validation'](_0x272bfc(0x10e));await writeInitConfig(_0x11fcd0,{'appcode':_0x29cc04['trim'](),'env':_0x2ff693},_0x270bd0),console[_0x272bfc(0x131)]('\x0aInitialized\x20'+_0x11fcd0),console[_0x272bfc(0x131)](_0x272bfc(0x148)+_0x29cc04[_0x272bfc(0x117)]()),console[_0x272bfc(0x131)](_0x272bfc(0x112)+_0x2ff693);}async function writeInitConfig(_0x298bb9,_0xe3185f,_0x1b1861){const _0x536fdb=a21_0x126870;let _0x1c8c23={};existsSync(_0x298bb9)&&!_0x1b1861[_0x536fdb(0x144)]&&(_0x1c8c23=readConfigFile(_0x298bb9));for(const [_0x2da136,_0xad0126]of Object[_0x536fdb(0x152)](_0xe3185f)){_0xad0126!==undefined&&(_0x1c8c23[_0x2da136]=_0xad0126);}if(_0x1c8c23[_0x536fdb(0x127)])delete _0x1c8c23[_0x536fdb(0x127)];writeConfigFile(_0x298bb9,_0x1c8c23);}class AbortPrompt extends Error{constructor(){const _0x130a16=a21_0x126870;super(_0x130a16(0x113)),this[_0x130a16(0x12f)]=_0x130a16(0x11f);}}function createSafeRl(){const _0x4a7362=a21_0x126870,_0x408202=createInterface({'input':process[_0x4a7362(0x151)],'output':process['stdout']});let _0x5b29cb;const _0x4a65dc=new Promise((_0x3235df,_0x41333c)=>{const _0x399d6a=_0x4a7362;_0x5b29cb=()=>{const _0x24772a=a21_0xe183;_0x5b29cb&&(_0x408202['removeListener'](_0x24772a(0x133),_0x5b29cb),_0x5b29cb=undefined);try{_0x408202['close']();}catch{}_0x41333c(new AbortPrompt());},_0x408202[_0x399d6a(0x132)](_0x399d6a(0x133),_0x5b29cb);}),_0x29bf12=()=>{const _0x1ff873=_0x4a7362;_0x5b29cb&&(_0x408202[_0x1ff873(0x116)](_0x1ff873(0x133),_0x5b29cb),_0x5b29cb=undefined);try{_0x408202[_0x1ff873(0x147)]();}catch{}};return{'rl':_0x408202,'abortPromise':_0x4a65dc,'disposeSuccess':_0x29bf12};}async function promptInput(_0x144739,_0x2ba887){const _0x5bbb44=a21_0x126870,{rl:_0x4d88e2,abortPromise:_0x387345,disposeSuccess:_0x1fdb4d}=createSafeRl(),_0x403f87=new Promise(_0x5c1e8b=>{const _0x44bfd0=a21_0xe183,_0xc2e930=_0x2ba887?'\x20\x20'+_0x144739+'\x20('+_0x2ba887+'):\x20':'\x20\x20'+_0x144739+':\x20';_0x4d88e2[_0x44bfd0(0x115)](_0xc2e930,_0x32e311=>{_0x1fdb4d(),_0x5c1e8b(_0x32e311['trim']()||_0x2ba887);});});return Promise[_0x5bbb44(0x123)]([_0x403f87,_0x387345]);}async function promptYesNo(_0x2f9336,_0x26a8b4){const _0x11590f=a21_0x126870,{rl:_0x678703,abortPromise:_0x55ff03,disposeSuccess:_0x18751}=createSafeRl(),_0x3bde2d=new Promise(_0x11cbd5=>{const _0x37055e=a21_0xe183,_0x1bf905=_0x26a8b4?_0x37055e(0x111):_0x37055e(0x13e);_0x678703[_0x37055e(0x115)]('\x20\x20'+_0x2f9336+'\x20'+_0x1bf905+':\x20',_0xfec4fc=>{const _0x3fc2ee=_0x37055e;_0x18751();const _0x14d9c8=_0xfec4fc[_0x3fc2ee(0x117)]()[_0x3fc2ee(0x118)]();if(_0x14d9c8==='y'||_0x14d9c8===_0x3fc2ee(0x144))_0x11cbd5(!![]);else{if(_0x14d9c8==='n'||_0x14d9c8==='no')_0x11cbd5(![]);else _0x11cbd5(_0x26a8b4);}});});return Promise[_0x11590f(0x123)]([_0x3bde2d,_0x55ff03]);}function loadExisting(_0x5bbc44){if(!existsSync(_0x5bbc44))return null;return readConfigFile(_0x5bbc44);}function resolveFilePath(_0x318779){const _0xec2944=a21_0x126870;return isAbsolute(_0x318779)?_0x318779:resolve(process[_0xec2944(0x136)](),_0x318779);}function readSourceFile(_0x492c66){const _0x57467f=a21_0x126870;try{const _0x1840b9=readFileSync(_0x492c66,{'encoding':'utf8'});return JSON[_0x57467f(0x12a)](_0x1840b9);}catch(_0x29f39a){throw CliErrors[_0x57467f(0x12d)](_0x57467f(0x13f)+_0x29f39a['message']);}}function resolveInitEnv(_0x465ef0){const _0x479682=a21_0x126870,_0x5da128=_0x465ef0[_0x479682(0x124)];if(_0x5da128===undefined||_0x5da128==='')return DEFAULT_CONFIG_VALUES[_0x479682(0x124)];if(!RUNTIME_ENV_VALUES[_0x479682(0x13a)](_0x5da128))throw CliErrors[_0x479682(0x12d)](_0x479682(0x13b)+_0x5da128+_0x479682(0x14d)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x5da128;}
|
|
1
|
+
const a21_0xccaa42=a21_0x3bda;(function(_0x2f5b8c,_0x3f3736){const _0x48cf15=a21_0x3bda,_0x150983=_0x2f5b8c();while(!![]){try{const _0x32fb25=parseInt(_0x48cf15(0x182))/0x1*(parseInt(_0x48cf15(0x18b))/0x2)+parseInt(_0x48cf15(0x16c))/0x3*(parseInt(_0x48cf15(0x17a))/0x4)+parseInt(_0x48cf15(0x18f))/0x5+parseInt(_0x48cf15(0x15f))/0x6*(parseInt(_0x48cf15(0x183))/0x7)+parseInt(_0x48cf15(0x16a))/0x8+parseInt(_0x48cf15(0x174))/0x9+-parseInt(_0x48cf15(0x17c))/0xa;if(_0x32fb25===_0x3f3736)break;else _0x150983['push'](_0x150983['shift']());}catch(_0x9d5ad3){_0x150983['push'](_0x150983['shift']());}}}(a21_0x25e8,0xd4028));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_0xccaa42(0x184),'type':a21_0xccaa42(0x165),'description':a21_0xccaa42(0x169)},{'name':'env','type':a21_0xccaa42(0x165),'description':a21_0xccaa42(0x186)+DEFAULT_CONFIG_VALUES[a21_0xccaa42(0x15a)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0xccaa42(0x167),'type':a21_0xccaa42(0x159),'description':a21_0xccaa42(0x185)+PRODUCT_CONFIG[a21_0xccaa42(0x16f)]+a21_0xccaa42(0x158),'default':![]},{'name':a21_0xccaa42(0x190),'type':a21_0xccaa42(0x159),'description':a21_0xccaa42(0x175),'default':![]}];export const initImportFlagDefs=[{'name':a21_0xccaa42(0x191),'type':'string','description':a21_0xccaa42(0x177),'required':!![]},{'name':a21_0xccaa42(0x184),'type':a21_0xccaa42(0x165),'description':a21_0xccaa42(0x196)},{'name':a21_0xccaa42(0x15a),'type':a21_0xccaa42(0x165),'description':a21_0xccaa42(0x17f),'enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0xccaa42(0x167),'type':'boolean','description':a21_0xccaa42(0x185)+PRODUCT_CONFIG[a21_0xccaa42(0x16f)]+a21_0xccaa42(0x158),'default':![]},{'name':a21_0xccaa42(0x190),'type':'boolean','description':a21_0xccaa42(0x175),'default':![]}];export async function runInit(_0x10177a){const _0x2a2962=a21_0xccaa42,_0x9b72c2=isNonInteractiveMode(_0x10177a),_0x3baacf=_0x10177a[_0x2a2962(0x167)]?_0x2a2962(0x167):_0x2a2962(0x16d),_0x3613bc=resolveWriteConfigPath(_0x3baacf);try{_0x9b72c2?await runNonInteractive(_0x10177a,_0x3613bc):await runInteractive(_0x10177a,_0x3613bc);}catch(_0x22c79d){if(_0x22c79d instanceof AbortPrompt)throw CliErrors[_0x2a2962(0x189)]();throw _0x22c79d;}}export async function runInitImport(_0x1a69cd){const _0x2767b0=a21_0xccaa42,_0x4111e8=_0x1a69cd[_0x2767b0(0x167)]?_0x2767b0(0x167):_0x2767b0(0x16d),_0x71567e=resolveWriteConfigPath(_0x4111e8);await runFromImport(_0x1a69cd,_0x71567e);}const RUNTIME_IRRELEVANT_KEYS=new Set([a21_0xccaa42(0x198)]);function a21_0x3bda(_0x4ec4e1,_0x1d7d11){_0x4ec4e1=_0x4ec4e1-0x155;const _0x25e8c0=a21_0x25e8();let _0x3bda7f=_0x25e8c0[_0x4ec4e1];return _0x3bda7f;}async function runFromImport(_0x13dbb5,_0xe9380b){const _0x35352e=a21_0xccaa42,_0x1056b3=resolveFilePath(_0x13dbb5['file']);if(!existsSync(_0x1056b3))throw CliErrors['validation'](_0x35352e(0x193)+_0x1056b3);const _0x46febe=readSourceFile(_0x1056b3),_0x553c2d=convertToRuntimeConfig(_0x46febe);_0x13dbb5['appcode']&&(_0x553c2d[_0x35352e(0x184)]=String(_0x13dbb5[_0x35352e(0x184)]));_0x13dbb5[_0x35352e(0x15a)]&&(_0x553c2d[_0x35352e(0x15a)]=resolveInitEnv(_0x13dbb5));if(!_0x553c2d['appcode'])throw CliErrors['validation'](_0x35352e(0x199),'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(_0xe9380b,_0x553c2d,_0x13dbb5),console[_0x35352e(0x188)](_0x35352e(0x172)+_0x1056b3),console[_0x35352e(0x188)](_0x35352e(0x160)+_0xe9380b),console[_0x35352e(0x188)](_0x35352e(0x18a)+_0x553c2d['appcode']);if(_0x553c2d[_0x35352e(0x161)])console[_0x35352e(0x188)](_0x35352e(0x187)+_0x553c2d[_0x35352e(0x161)]);}function convertToRuntimeConfig(_0x25391e){const _0x161542=a21_0xccaa42;if(_0x25391e['apps']&&typeof _0x25391e[_0x161542(0x192)]==='object')throw CliErrors['validation'](_0x161542(0x195),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x5c0e36={};for(const _0x35ffb4 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x25391e[_0x35ffb4]!==undefined&&(_0x5c0e36[_0x35ffb4]=_0x25391e[_0x35ffb4]);}return!_0x5c0e36['riskLevel']&&(_0x5c0e36[_0x161542(0x170)]=DEFAULT_CONFIG_VALUES[_0x161542(0x170)]),_0x5c0e36;}async function runNonInteractive(_0x114a61,_0x47e409){const _0x4d7050=a21_0xccaa42,_0x3f5322=_0x114a61[_0x4d7050(0x184)];if(!_0x3f5322)throw CliErrors[_0x4d7050(0x16b)]('appcode',_0x4d7050(0x181)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x234fa5=resolveInitEnv(_0x114a61);await writeInitConfig(_0x47e409,{'appcode':_0x3f5322,'env':_0x234fa5},_0x114a61),console['log'](_0x4d7050(0x171)+_0x47e409),console[_0x4d7050(0x188)](_0x4d7050(0x18a)+_0x3f5322),console[_0x4d7050(0x188)](_0x4d7050(0x173)+_0x234fa5);}async function runInteractive(_0x94383,_0x40cefe){const _0x25cd51=a21_0xccaa42,_0x19daa8=loadExisting(_0x40cefe),_0x1484e2=typeof _0x19daa8?.[_0x25cd51(0x184)]===_0x25cd51(0x165)?_0x19daa8[_0x25cd51(0x184)]:'',_0x40341f=resolveInitEnv(_0x94383);console['log'](CLI_BIN_NAME+_0x25cd51(0x157)+PRODUCT_CONFIG[_0x25cd51(0x16f)]+'\x0a');if(existsSync(_0x40cefe)&&!_0x94383['yes']){const _0x56e982=await promptYesNo(_0x25cd51(0x18c)+_0x40cefe+_0x25cd51(0x15c),![]);if(!_0x56e982){console[_0x25cd51(0x188)](_0x25cd51(0x18d));return;}}const _0xb2eb7c=typeof _0x94383['appcode']==='string'?_0x94383['appcode']['trim']():'';let _0x3e82ba=_0xb2eb7c;!_0x3e82ba&&(_0x3e82ba=await promptInput(_0x25cd51(0x17e),_0x1484e2));if(!_0x3e82ba['trim']())throw CliErrors['validation']('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x40cefe,{'appcode':_0x3e82ba[_0x25cd51(0x164)](),'env':_0x40341f},_0x94383),console[_0x25cd51(0x188)]('\x0aInitialized\x20'+_0x40cefe),console[_0x25cd51(0x188)](_0x25cd51(0x18a)+_0x3e82ba[_0x25cd51(0x164)]()),console[_0x25cd51(0x188)](_0x25cd51(0x173)+_0x40341f);}async function writeInitConfig(_0x3969a8,_0x235af5,_0x4165a7){const _0x276941=a21_0xccaa42;let _0x185da7={};existsSync(_0x3969a8)&&!_0x4165a7[_0x276941(0x190)]&&(_0x185da7=readConfigFile(_0x3969a8));for(const [_0x5e0b15,_0x260602]of Object[_0x276941(0x15d)](_0x235af5)){_0x260602!==undefined&&(_0x185da7[_0x5e0b15]=_0x260602);}if(_0x185da7[_0x276941(0x162)])delete _0x185da7[_0x276941(0x162)];writeConfigFile(_0x3969a8,_0x185da7);}class AbortPrompt extends Error{constructor(){const _0x4a9d62=a21_0xccaa42;super('User\x20aborted\x20prompt'),this[_0x4a9d62(0x180)]=_0x4a9d62(0x17d);}}function createSafeRl(){const _0x5b6eac=a21_0xccaa42,_0x1d8da8=createInterface({'input':process[_0x5b6eac(0x178)],'output':process['stdout']});let _0x30b417;const _0x3d0c27=new Promise((_0x2a9d4e,_0x3115ad)=>{const _0x445841=_0x5b6eac;_0x30b417=()=>{const _0x65e2a0=a21_0x3bda;_0x30b417&&(_0x1d8da8[_0x65e2a0(0x166)](_0x65e2a0(0x18e),_0x30b417),_0x30b417=undefined);try{_0x1d8da8[_0x65e2a0(0x155)]();}catch{}_0x3115ad(new AbortPrompt());},_0x1d8da8[_0x445841(0x179)](_0x445841(0x18e),_0x30b417);}),_0x154898=()=>{const _0xa6bc7e=_0x5b6eac;_0x30b417&&(_0x1d8da8[_0xa6bc7e(0x166)](_0xa6bc7e(0x18e),_0x30b417),_0x30b417=undefined);try{_0x1d8da8[_0xa6bc7e(0x155)]();}catch{}};return{'rl':_0x1d8da8,'abortPromise':_0x3d0c27,'disposeSuccess':_0x154898};}async function promptInput(_0x5c7d12,_0x168a86){const {rl:_0x51afb6,abortPromise:_0x33b8cd,disposeSuccess:_0x3aa1e2}=createSafeRl(),_0x405f59=new Promise(_0x268932=>{const _0x155060=a21_0x3bda,_0x794ae3=_0x168a86?'\x20\x20'+_0x5c7d12+'\x20('+_0x168a86+'):\x20':'\x20\x20'+_0x5c7d12+':\x20';_0x51afb6[_0x155060(0x16e)](_0x794ae3,_0x3032c3=>{const _0x17a652=_0x155060;_0x3aa1e2(),_0x268932(_0x3032c3[_0x17a652(0x164)]()||_0x168a86);});});return Promise['race']([_0x405f59,_0x33b8cd]);}async function promptYesNo(_0x55995f,_0x1759b6){const {rl:_0x4622fc,abortPromise:_0x3fd620,disposeSuccess:_0x58a3af}=createSafeRl(),_0x4e0346=new Promise(_0x566de3=>{const _0xccc7c3=a21_0x3bda,_0x1cd9fe=_0x1759b6?_0xccc7c3(0x197):_0xccc7c3(0x17b);_0x4622fc[_0xccc7c3(0x16e)]('\x20\x20'+_0x55995f+'\x20'+_0x1cd9fe+':\x20',_0x144326=>{const _0x5e5ab0=_0xccc7c3;_0x58a3af();const _0x33f8f8=_0x144326[_0x5e5ab0(0x164)]()[_0x5e5ab0(0x163)]();if(_0x33f8f8==='y'||_0x33f8f8===_0x5e5ab0(0x190))_0x566de3(!![]);else{if(_0x33f8f8==='n'||_0x33f8f8==='no')_0x566de3(![]);else _0x566de3(_0x1759b6);}});});return Promise['race']([_0x4e0346,_0x3fd620]);}function loadExisting(_0x5a50a7){if(!existsSync(_0x5a50a7))return null;return readConfigFile(_0x5a50a7);}function resolveFilePath(_0x2d2aae){const _0x262788=a21_0xccaa42;return isAbsolute(_0x2d2aae)?_0x2d2aae:resolve(process[_0x262788(0x176)](),_0x2d2aae);}function a21_0x25e8(){const _0x36fa8d=['Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','close','parse','\x20init\x20—\x20Create\x20',')\x20instead\x20of\x20project','boolean','env','validation','\x20already\x20exists.\x20Overwrite?','entries','message','2982ERhpWj','\x20\x20config:\x20\x20','defaultApp','app','toLowerCase','trim','string','removeListener','global','utf8','App\x20code\x20for\x20the\x20project','2105664MaxGud','flagMissing','3tyosKz','project','question','newConfigFileName','riskLevel','Initialized\x20','Imported\x20from\x20','\x20\x20env:\x20\x20\x20\x20\x20','12681AJEmud','Skip\x20confirmation\x20when\x20overwriting','cwd','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','stdin','once','6221552gjIiYu','[y/N]','30898950lrTJUJ','AbortPrompt','App\x20code','Override\x20imported\x20default\x20env','name','Usage:\x20','2HMzDUy','2646wOWNrH','appcode','Write\x20to\x20global\x20(~/','Target\x20environment\x20(default\x20','\x20\x20default:\x20','log','cancelled','\x20\x20appcode:\x20','1602928XIGOgF','File\x20','Aborted.','SIGINT','1737440RkMLRU','yes','file','apps','Source\x20file\x20not\x20found:\x20','Invalid\x20env\x20\x22','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Override\x20imported\x20default\x20appcode','[Y/n]','apiDir'];a21_0x25e8=function(){return _0x36fa8d;};return a21_0x25e8();}function readSourceFile(_0x56d443){const _0x597864=a21_0xccaa42;try{const _0x14b105=readFileSync(_0x56d443,{'encoding':_0x597864(0x168)});return JSON[_0x597864(0x156)](_0x14b105);}catch(_0x8fe261){throw CliErrors[_0x597864(0x15b)]('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x8fe261[_0x597864(0x15e)]);}}function resolveInitEnv(_0x574b08){const _0xb68782=a21_0xccaa42,_0x1651df=_0x574b08[_0xb68782(0x15a)];if(_0x1651df===undefined||_0x1651df==='')return DEFAULT_CONFIG_VALUES[_0xb68782(0x15a)];if(!RUNTIME_ENV_VALUES['includes'](_0x1651df))throw CliErrors[_0xb68782(0x15b)](_0xb68782(0x194)+_0x1651df+'\x22.\x20Allowed:\x20'+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x1651df;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a22_0x166321=a22_0x16c3;(function(_0x57fe43,_0x4d836f){const _0x545d41=a22_0x16c3,_0x56124d=_0x57fe43();while(!![]){try{const _0x574822=parseInt(_0x545d41(0xe8))/0x1*(parseInt(_0x545d41(0xf9))/0x2)+parseInt(_0x545d41(0x110))/0x3+parseInt(_0x545d41(0xee))/0x4*(parseInt(_0x545d41(0xfc))/0x5)+-parseInt(_0x545d41(0x115))/0x6*(parseInt(_0x545d41(0x11d))/0x7)+parseInt(_0x545d41(0x11f))/0x8*(parseInt(_0x545d41(0x10a))/0x9)+parseInt(_0x545d41(0x103))/0xa+parseInt(_0x545d41(0x118))/0xb*(-parseInt(_0x545d41(0x121))/0xc);if(_0x574822===_0x4d836f)break;else _0x56124d['push'](_0x56124d['shift']());}catch(_0x5321f3){_0x56124d['push'](_0x56124d['shift']());}}}(a22_0x4a59,0xf1a62));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_0x166321(0x114),'type':a22_0x166321(0x128),'required':!![],'description':'Personal\x20knowledge-base\x20entry\x20title'},FILE_FLAG={'name':a22_0x166321(0x125),'type':a22_0x166321(0x128),'required':!![],'description':a22_0x166321(0x107)},QUERY_FLAG={'name':a22_0x166321(0xfe),'type':'string','required':!![],'description':a22_0x166321(0x112)},TOPK_FLAG={'name':a22_0x166321(0x113),'type':a22_0x166321(0xf4),'description':a22_0x166321(0x11a)};function readKnowledgeFile(_0x1d70e3){const _0x9c61f9=a22_0x166321;if(!_0x1d70e3)throw CliErrors[_0x9c61f9(0x119)](_0x9c61f9(0x117));if(!existsSync(_0x1d70e3))throw CliErrors[_0x9c61f9(0x119)](_0x9c61f9(0xfd)+_0x1d70e3);if(!statSync(_0x1d70e3)['isFile']())throw CliErrors[_0x9c61f9(0x119)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x1d70e3);return readFileSync(_0x1d70e3,_0x9c61f9(0xe7));}function summarizePersonalItem(_0x16604e){const _0x279962=a22_0x166321;return{'id':_0x16604e['id'],'title':_0x16604e[_0x279962(0x114)],'version':_0x16604e[_0x279962(0xf1)],'ragStatus':_0x16604e[_0x279962(0x11e)],'ragErrorMessage':_0x16604e['ragErrorMessage'],'updateTime':_0x16604e['updateTime']};}function a22_0x16c3(_0x3fe5fd,_0x5d4a30){_0x3fe5fd=_0x3fe5fd-0xe6;const _0x4a59b6=a22_0x4a59();let _0x16c365=_0x4a59b6[_0x3fe5fd];return _0x16c365;}function detailPersonalItem(_0x166a59){const _0x250b3c=a22_0x166321;return{'id':_0x166a59['id'],'appCode':_0x166a59[_0x250b3c(0xea)],'scope':_0x166a59[_0x250b3c(0x129)],'userId':_0x166a59[_0x250b3c(0xf7)],'title':_0x166a59[_0x250b3c(0x114)],'content':_0x166a59['content']??'','version':_0x166a59[_0x250b3c(0xf1)],'ragStatus':_0x166a59[_0x250b3c(0x11e)],'ragErrorMessage':_0x166a59[_0x250b3c(0x12a)],'createTime':_0x166a59[_0x250b3c(0x105)],'updateTime':_0x166a59[_0x250b3c(0x111)]};}function summarizeSearchHit(_0xdf0d2d){const _0x404394=a22_0x166321;return{'scope':_0xdf0d2d[_0x404394(0x129)],'docId':_0xdf0d2d['docId'],'score':_0xdf0d2d['score'],'weightedScore':_0xdf0d2d[_0x404394(0x10f)],'content':_0xdf0d2d[_0x404394(0x10d)],'metadata':_0xdf0d2d[_0x404394(0x126)]};}function readTopK(_0xf1fb1e){const _0x46be76=a22_0x166321,_0x29eff4=_0xf1fb1e['flag'](_0x46be76(0x113));if(_0x29eff4===undefined||_0x29eff4===null||_0x29eff4==='')return undefined;const _0xba73c3=_0xf1fb1e[_0x46be76(0x101)](_0x46be76(0x113));if(!Number[_0x46be76(0x11b)](_0xba73c3)||_0xba73c3<0x1)throw CliErrors[_0x46be76(0x119)](_0x46be76(0xe6));return _0xba73c3;}function a22_0x4a59(){const _0x261d32=['Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','version','Override\x20the\x20existing\x20entry\x20title','Personal\x20knowledge-base\x20entry\x20ID','number','Updated\x20KB\x20entry\x20','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','userId','create','26tEqRCM','body','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','125tAiIfF','File\x20not\x20found:\x20','query','bool','description','num','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','8115560jEtVSe','/client/knowledge-base/personal/create','createTime','verbose','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','length','Created\x20KB\x20entry\x20','99fOjXVG','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','/update','content','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','weightedScore','3886815FbOoYl','updateTime','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','topk','title','114KnfdND','POST','File\x20path\x20is\x20required.','2779645IBWJGt','validation','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','isFinite','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','528640EFgIIy','ragStatus','724912zalPxV','update','120yFquSU','read','list','/client/knowledge-base/personal/','file','metadata','detail','string','scope','ragErrorMessage','build','--topk\x20must\x20be\x20a\x20positive\x20number.','utf8','16618MUhgQT','Search\x20query\x20is\x20required.','appCode','trim','write','str','261068zqKBfG','map'];a22_0x4a59=function(){return _0x261d32;};return a22_0x4a59();}const kbList={'service':'kb','command':a22_0x166321(0x123),'description':a22_0x166321(0x10b),'risk':a22_0x166321(0x122),'flags':[VERBOSE_FLAG],async 'execute'(_0x274958){const _0x3ab873=a22_0x166321,_0x15cffd=await listPersonalKnowledgeBaseItems(_0x274958[_0x3ab873(0xea)]);if(_0x274958[_0x3ab873(0xff)](_0x3ab873(0x106)))return{'ok':!![],'data':{'total':_0x15cffd['length'],'items':_0x15cffd}};return{'ok':!![],'data':{'total':_0x15cffd['length'],'items':_0x15cffd[_0x3ab873(0xef)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a22_0x166321(0x127),'description':a22_0x166321(0x102),'risk':a22_0x166321(0x122),'flags':[{...ID_FLAG,'description':a22_0x166321(0xf3)}],async 'execute'(_0x20f295){const _0x3a14e4=a22_0x166321,_0x450a48=await getPersonalKnowledgeBaseItem(_0x20f295[_0x3a14e4(0x101)]('id'),_0x20f295['appCode']);return{'ok':!![],'data':detailPersonalItem(_0x450a48)};}},kbCreate={'service':'kb','command':a22_0x166321(0xf8),'description':a22_0x166321(0x10e),'risk':a22_0x166321(0xec),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x6f476f){const _0x2570e9=a22_0x166321,_0x4cdffc=_0x6f476f['str']('title'),_0x575ab2=readKnowledgeFile(_0x6f476f['str'](_0x2570e9(0x125))),_0x34aaa3=await createPersonalKnowledgeBaseItem(_0x6f476f[_0x2570e9(0xea)],{'title':_0x4cdffc,'content':_0x575ab2});return{'ok':!![],'data':summarizePersonalItem(_0x34aaa3),'message':_0x2570e9(0x109)+_0x34aaa3['id']+'\x20('+_0x34aaa3[_0x2570e9(0x114)]+')'};},async 'dryRun'(_0x6da4b9){const _0x37a832=a22_0x166321,_0x5af745=_0x6da4b9['str']('title'),_0x2a4373=readKnowledgeFile(_0x6da4b9[_0x37a832(0xed)](_0x37a832(0x125)));return dryRun(_0x37a832(0x116),_0x37a832(0x104))[_0x37a832(0xfa)]({'appCode':_0x6da4b9['appCode'],'title':_0x5af745,'content':_0x2a4373})[_0x37a832(0x100)](_0x37a832(0x11c)+_0x5af745+'\x22')[_0x37a832(0x12b)]();}},kbUpdate={'service':'kb','command':a22_0x166321(0x120),'description':a22_0x166321(0xf6),'risk':'write','flags':[{...ID_FLAG,'description':'Personal\x20knowledge-base\x20entry\x20ID'},{...TITLE_FLAG,'required':![],'description':a22_0x166321(0xf2)},FILE_FLAG],async 'execute'(_0x5d3719){const _0x283c10=a22_0x166321,_0x4c1771=_0x5d3719[_0x283c10(0x101)]('id'),_0x1d2513=readKnowledgeFile(_0x5d3719[_0x283c10(0xed)](_0x283c10(0x125))),_0x431cf9=_0x5d3719['str']('title')||(await getPersonalKnowledgeBaseItem(_0x4c1771,_0x5d3719[_0x283c10(0xea)]))[_0x283c10(0x114)],_0x59b9ca=await updatePersonalKnowledgeBaseItem(_0x4c1771,_0x5d3719[_0x283c10(0xea)],{'title':_0x431cf9,'content':_0x1d2513});return{'ok':!![],'data':summarizePersonalItem(_0x59b9ca),'message':_0x283c10(0xf5)+_0x59b9ca['id']+'\x20('+_0x59b9ca[_0x283c10(0x114)]+')'};},async 'dryRun'(_0x3e8deb){const _0x4d0cf5=a22_0x166321,_0x501566=_0x3e8deb['num']('id'),_0x1e2906=readKnowledgeFile(_0x3e8deb[_0x4d0cf5(0xed)](_0x4d0cf5(0x125))),_0x40f387=_0x3e8deb[_0x4d0cf5(0xed)]('title')||(await getPersonalKnowledgeBaseItem(_0x501566,_0x3e8deb[_0x4d0cf5(0xea)]))[_0x4d0cf5(0x114)];return dryRun(_0x4d0cf5(0x116),_0x4d0cf5(0x124)+_0x501566+_0x4d0cf5(0x10c))[_0x4d0cf5(0xfa)]({'appCode':_0x3e8deb['appCode'],'title':_0x40f387,'content':_0x1e2906})[_0x4d0cf5(0x100)](_0x4d0cf5(0xfb)+_0x501566)[_0x4d0cf5(0x12b)]();}},kbSearch={'service':'kb','command':'search','description':a22_0x166321(0xf0),'risk':a22_0x166321(0x122),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x41cf74){const _0x4f01c0=a22_0x166321;if(!_0x41cf74[_0x4f01c0(0xed)](_0x4f01c0(0xfe))[_0x4f01c0(0xeb)]())throw CliErrors[_0x4f01c0(0x119)](_0x4f01c0(0xe9));readTopK(_0x41cf74);},async 'execute'(_0x2dfc86){const _0x4f98a9=a22_0x166321,_0x5a50e3=_0x2dfc86[_0x4f98a9(0xed)](_0x4f98a9(0xfe))['trim'](),_0x10c5a6=readTopK(_0x2dfc86),_0x46f936=await searchKnowledgeBase(_0x2dfc86[_0x4f98a9(0xea)],{'query':_0x5a50e3,'topK':_0x10c5a6});return{'ok':!![],'data':{'total':_0x46f936[_0x4f98a9(0x108)],'hits':_0x46f936[_0x4f98a9(0xef)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x206ca4=a23_0x5a96;(function(_0x4c0bd6,_0x161ab1){const _0x3ca8b0=a23_0x5a96,_0x20a3aa=_0x4c0bd6();while(!![]){try{const _0x24289a=parseInt(_0x3ca8b0(0x1bf))/0x1+-parseInt(_0x3ca8b0(0x1b6))/0x2*(parseInt(_0x3ca8b0(0x1b2))/0x3)+parseInt(_0x3ca8b0(0x1c1))/0x4*(-parseInt(_0x3ca8b0(0x1a8))/0x5)+-parseInt(_0x3ca8b0(0x1a7))/0x6+-parseInt(_0x3ca8b0(0x1a9))/0x7+-parseInt(_0x3ca8b0(0x1ad))/0x8+parseInt(_0x3ca8b0(0x1c2))/0x9*(parseInt(_0x3ca8b0(0x1c0))/0xa);if(_0x24289a===_0x161ab1)break;else _0x20a3aa['push'](_0x20a3aa['shift']());}catch(_0x3246e5){_0x20a3aa['push'](_0x20a3aa['shift']());}}}(a23_0x55f0,0x94fa8));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function a23_0x5a96(_0x3c51be,_0x52c452){_0x3c51be=_0x3c51be-0x1a7;const _0x55f081=a23_0x55f0();let _0x5a96e8=_0x55f081[_0x3c51be];return _0x5a96e8;}function a23_0x55f0(){const _0x12cbe7=['10mYcLAW','4lzGAtk','38168217nWXGAp','show','\x20\x20\x20Time:\x20','warn','timestamp','clearLogs','readLogs','\x20\x20\x20Duration:\x20','logs','write','6788856XSoola','5604595LOhhUv','3710903wDTPls','*\x20Logs\x20cleared','clear','toLocaleString','875712kpzcHb','duration','length','log','message','3hSNUaZ','details','forEach','stringify','2348358WbZoNy','keys','\x20\x20\x20Details:\x20','level','*\x20No\x20logs\x20found','Clear\x20command\x20history\x20logs','read','success','command','435470bqWcog'];a23_0x55f0=function(){return _0x12cbe7;};return a23_0x55f0();}function printLogs(_0x4b4084){const _0x2666d7=a23_0x5a96;if(_0x4b4084[_0x2666d7(0x1af)]===0x0){console[_0x2666d7(0x1b0)](_0x2666d7(0x1ba));return;}console['log']('*\x20'+CLI_DISPLAY_NAME+'\x20logs:\x0a'),_0x4b4084[_0x2666d7(0x1b4)]((_0x5e532e,_0xcad117)=>{const _0x52299b=_0x2666d7,_0x4d77fe=new Date(_0x5e532e[_0x52299b(0x1c6)])[_0x52299b(0x1ac)]('en-US'),_0x203270=_0x5e532e[_0x52299b(0x1b9)]===_0x52299b(0x1bd)?'√':_0x5e532e[_0x52299b(0x1b9)]==='error'?'×':_0x5e532e['level']===_0x52299b(0x1c5)?'!':'i';console[_0x52299b(0x1b0)](_0xcad117+0x1+'.\x20'+_0x203270+'\x20['+_0x5e532e[_0x52299b(0x1be)]+']\x20'+_0x5e532e[_0x52299b(0x1b1)]),console[_0x52299b(0x1b0)](_0x52299b(0x1c4)+_0x4d77fe),_0x5e532e[_0x52299b(0x1ae)]&&console[_0x52299b(0x1b0)](_0x52299b(0x1c9)+_0x5e532e[_0x52299b(0x1ae)]+'ms'),_0x5e532e[_0x52299b(0x1b3)]&&Object[_0x52299b(0x1b7)](_0x5e532e[_0x52299b(0x1b3)])['length']>0x0&&console[_0x52299b(0x1b0)](_0x52299b(0x1b8)+JSON[_0x52299b(0x1b5)](_0x5e532e[_0x52299b(0x1b3)],null,0x2)),console[_0x52299b(0x1b0)]('');});}export const logsDefinitions=[{'service':'logs','command':a23_0x206ca4(0x1c3),'description':'View\x20command\x20history\x20logs','risk':a23_0x206ca4(0x1bc),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x97858){const _0x3e9461=a23_0x206ca4;return printLogs(logger[_0x3e9461(0x1c8)]()),{'ok':!![]};}},{'service':a23_0x206ca4(0x1ca),'command':a23_0x206ca4(0x1ab),'description':a23_0x206ca4(0x1bb),'risk':a23_0x206ca4(0x1cb),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1b6fd6){const _0x4d2921=a23_0x206ca4;return logger[_0x4d2921(0x1c7)](),console[_0x4d2921(0x1b0)](_0x4d2921(0x1aa)),{'ok':!![]};}}];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a24_0x24c3(_0x4911ca,_0xed69f0){_0x4911ca=_0x4911ca-0x1f1;const _0xeb24c2=a24_0xeb24();let _0x24c3ff=_0xeb24c2[_0x4911ca];return _0x24c3ff;}const a24_0x95e8b0=a24_0x24c3;function a24_0xeb24(){const _0x450fb7=['BFF\x20Scripts','set','list','risk','944cYrQLq','command','352155TZIeIX','1712dkphjA','Schema','write','Knowledge\x20Base','2070qAFhxp','has','12slGeCE','get','Skills','description','map','push','\x20\x20[write]','SQL\x20Queries','369291xQHeXa','429037oKIpWd','Datasets','Authentication','isSingleCommand','468IClItb','Logs','24640fOLitS','Instant\x20API','defaultCommand','login','service','900566qUFLWu','1529AXZkDD','read','Diagnostics','12357VddrRY','install','\x20\x20[high-risk-write]','show','20vVhciC','values'];a24_0xeb24=function(){return _0x450fb7;};return a24_0xeb24();}(function(_0x39dfd3,_0x1f1207){const _0x5d49a5=a24_0x24c3,_0x2f1e71=_0x39dfd3();while(!![]){try{const _0x1f3c91=-parseInt(_0x5d49a5(0x203))/0x1+parseInt(_0x5d49a5(0x214))/0x2*(parseInt(_0x5d49a5(0x218))/0x3)+-parseInt(_0x5d49a5(0x20b))/0x4*(parseInt(_0x5d49a5(0x213))/0x5)+-parseInt(_0x5d49a5(0x21a))/0x6*(parseInt(_0x5d49a5(0x1f8))/0x7)+parseInt(_0x5d49a5(0x211))/0x8*(-parseInt(_0x5d49a5(0x207))/0x9)+-parseInt(_0x5d49a5(0x1fe))/0xa*(-parseInt(_0x5d49a5(0x204))/0xb)+-parseInt(_0x5d49a5(0x1fc))/0xc*(-parseInt(_0x5d49a5(0x1f7))/0xd);if(_0x1f3c91===_0x1f1207)break;else _0x2f1e71['push'](_0x2f1e71['shift']());}catch(_0x2cd414){_0x2f1e71['push'](_0x2f1e71['shift']());}}}(a24_0xeb24,0x7af8c));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';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(_0x28fc7b){const _0x4511c0=a24_0x24c3;for(const _0x59de59 of _0x28fc7b){definitions['set'](_0x59de59[_0x4511c0(0x202)]+':'+_0x59de59[_0x4511c0(0x212)],_0x59de59);let _0xf80a4c=serviceGroups['get'](_0x59de59[_0x4511c0(0x202)]);!_0xf80a4c&&(_0xf80a4c=[],serviceGroups[_0x4511c0(0x20e)](_0x59de59[_0x4511c0(0x202)],_0xf80a4c)),_0xf80a4c[_0x4511c0(0x1f4)](_0x59de59);}}function registerService(_0x573c51,_0x5c016c,_0x2381ef){const _0xafd6a7=a24_0x24c3;registerDefinitions(_0x5c016c);const _0x50462c=_0x2fbc00=>_0x2fbc00===_0xafd6a7(0x205)?'':_0x2fbc00===_0xafd6a7(0x216)?_0xafd6a7(0x1f5):_0xafd6a7(0x209),_0x2306fa={'service':_0x5c016c[0x0][_0xafd6a7(0x202)],'label':_0x573c51,'commands':_0x5c016c[_0xafd6a7(0x1f3)](_0x558be9=>({'command':_0x558be9[_0xafd6a7(0x212)],'description':_0x558be9[_0xafd6a7(0x1f2)],'tag':_0x50462c(_0x558be9[_0xafd6a7(0x210)])})),'defaultCommand':_0x2381ef?.[_0xafd6a7(0x200)]??(_0x2381ef?.[_0xafd6a7(0x1fb)]?_0x5c016c[0x0][_0xafd6a7(0x212)]:undefined),'isSingleCommand':_0x2381ef?.[_0xafd6a7(0x1fb)]};serviceRegistry[_0xafd6a7(0x1f4)](_0x2306fa),serviceByName[_0xafd6a7(0x20e)](_0x2306fa[_0xafd6a7(0x202)],_0x2306fa);}registerService(a24_0x95e8b0(0x1fa),authDefinitions,{'defaultCommand':a24_0x95e8b0(0x201)}),registerService(a24_0x95e8b0(0x1f9),datasetDefinitions),registerService(a24_0x95e8b0(0x1ff),dataDefinitions),registerService(a24_0x95e8b0(0x1f6),sqlDefinitions),registerService(a24_0x95e8b0(0x20d),bffDefinitions),registerService(a24_0x95e8b0(0x217),kbDefinitions),registerService('App\x20Management',appDefinitions,{'defaultCommand':a24_0x95e8b0(0x20f)}),registerService('Configuration',configDefinitions,{'defaultCommand':'list'}),registerService(a24_0x95e8b0(0x1f1),skillDefinitions,{'defaultCommand':a24_0x95e8b0(0x208)}),registerService('Self\x20Update',[updateDefinition],{'defaultCommand':'run','isSingleCommand':!![]}),registerService(a24_0x95e8b0(0x206),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a24_0x95e8b0(0x215),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a24_0x95e8b0(0x1fd),logsDefinitions,{'defaultCommand':a24_0x95e8b0(0x20a)});export function findDefinition(_0x2939ae,_0x2c379f){const _0x3105bc=a24_0x95e8b0;return definitions[_0x3105bc(0x21b)](_0x2939ae+':'+_0x2c379f);}export function isKnownService(_0x2f6f03){const _0x54ac6b=a24_0x95e8b0;return serviceByName[_0x54ac6b(0x219)](_0x2f6f03);}export function getServiceEntry(_0x2c8128){return serviceByName['get'](_0x2c8128);}export function getAllDefinitions(){const _0x24b34b=a24_0x95e8b0;return Array['from'](definitions[_0x24b34b(0x20c)]());}
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a25_0x4126(_0x25d4ca,_0x290f57){_0x25d4ca=_0x25d4ca-0x158;const _0x10dcb1=a25_0x10dc();let _0x412688=_0x10dcb1[_0x25d4ca];return _0x412688;}const a25_0x38af23=a25_0x4126;(function(_0x496056,_0x53a2f2){const _0x3b81e6=a25_0x4126,_0x528004=_0x496056();while(!![]){try{const _0x2ec6ef=parseInt(_0x3b81e6(0x15d))/0x1*(parseInt(_0x3b81e6(0x166))/0x2)+parseInt(_0x3b81e6(0x158))/0x3+-parseInt(_0x3b81e6(0x162))/0x4*(parseInt(_0x3b81e6(0x15c))/0x5)+parseInt(_0x3b81e6(0x15e))/0x6+parseInt(_0x3b81e6(0x165))/0x7*(parseInt(_0x3b81e6(0x164))/0x8)+-parseInt(_0x3b81e6(0x159))/0x9+-parseInt(_0x3b81e6(0x15a))/0xa*(-parseInt(_0x3b81e6(0x161))/0xb);if(_0x2ec6ef===_0x53a2f2)break;else _0x528004['push'](_0x528004['shift']());}catch(_0x5395ae){_0x528004['push'](_0x528004['shift']());}}}(a25_0x10dc,0x55359));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x5987d2){const _0x420993=await buildSchemaPayload();return{'ok':!![],'data':_0x420993};}function a25_0x10dc(){const _0x2205e9=['export','11496jedNdx','2471YTEkgE','556rrxikd','729336IuuqvB','4948839KkEVYN','20nvElZz','schema','15vRRkvm','417juUAGe','1277940QZcNWs','Export\x20machine-readable\x20command\x20schema\x20(JSON)','read','1303423amzUra','556516Sxjqzv'];a25_0x10dc=function(){return _0x2205e9;};return a25_0x10dc();}export const schemaDefinition={'service':a25_0x38af23(0x15b),'command':a25_0x38af23(0x163),'description':a25_0x38af23(0x15f),'risk':a25_0x38af23(0x160),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a26_0x2dd4(_0x211b60,_0x2c9fa0){_0x211b60=_0x211b60-0x1ad;const _0x3f8d0b=a26_0x3f8d();let _0x2dd401=_0x3f8d0b[_0x211b60];return _0x2dd401;}const a26_0x5bc738=a26_0x2dd4;function a26_0x3f8d(){const _0x480622=['map','string','code','reduce','accessKey','Check\x20network\x20connectivity\x20and\x20try\x20again.','company','str','8529678VbAZRt','created','../../skills/runtime-skill-sync.js','push','info','inherit','nonInteractive','cwd','\x20developer\x20skill','skill-install','skillCode','install','Only\x20pull\x20a\x20specific\x20runtime\x20Skill\x20code','skillName','6502YqSRwt','write','envName','filter','setLogPath','41536QUQald','Skipped\x20npx\x20(','error','\x20skill\x20installed','\x20-g\x20-y)...','action','\x20personal\x20and\x20','apiError','\x20skill\x20via\x20npx.','dir','333RPrWDC','length','log','Push\x20a\x20local\x20Skill\x20directory\x20to\x20personal\x20runtime\x20Skill\x20scope','input','skipped','Updated\x20personal\x20Skill\x20','unknown','authRequired','trim','Installing\x20published\x20','Local\x20Skill\x20directory\x20containing\x20SKILL.md','pull','6LVrcla','682248BMqhYf','\x20company\x20Skill(s).','scope','193392aVzwtU','readonly','1461957iUnksy','appCode','skill','3727510WsRwVt','../../core/api-client.js'];a26_0x3f8d=function(){return _0x480622;};return a26_0x3f8d();}(function(_0x4a2330,_0x3e7161){const _0x305e51=a26_0x2dd4,_0xbec7c=_0x4a2330();while(!![]){try{const _0x2af05d=parseInt(_0x305e51(0x1b7))/0x1+parseInt(_0x305e51(0x1d4))/0x2*(-parseInt(_0x305e51(0x1e3))/0x3)+parseInt(_0x305e51(0x1b4))/0x4+-parseInt(_0x305e51(0x1bc))/0x5*(parseInt(_0x305e51(0x1b3))/0x6)+parseInt(_0x305e51(0x1b9))/0x7+-parseInt(_0x305e51(0x1d9))/0x8+parseInt(_0x305e51(0x1c6))/0x9;if(_0x2af05d===_0x3e7161)break;else _0xbec7c['push'](_0xbec7c['shift']());}catch(_0xde0b1a){_0xbec7c['push'](_0xbec7c['shift']());}}}(a26_0x3f8d,0x63da0));import{CLI_BIN_NAME,CLI_DISPLAY_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';import{logger}from'../../utils/logger.js';const CODE_FLAG={'name':a26_0x5bc738(0x1c0),'type':a26_0x5bc738(0x1bf),'description':a26_0x5bc738(0x1d2)},DIR_FLAG={'name':a26_0x5bc738(0x1e2),'type':'string','required':!![],'description':a26_0x5bc738(0x1b1)};function summarizeRuntimeSkill(_0x56d47e){const _0xfb9334=a26_0x5bc738;return{'id':_0x56d47e['id'],'skillCode':_0x56d47e['skillCode'],'skillName':_0x56d47e[_0xfb9334(0x1d3)],'scope':_0x56d47e[_0xfb9334(0x1b6)],'version':_0x56d47e['version'],'readonly':_0x56d47e[_0xfb9334(0x1b8)]};}function filterByCode(_0x1e4dce,_0x5287ee){const _0x36ca43=a26_0x5bc738,_0x283ece=_0x5287ee[_0x36ca43(0x1af)]();if(!_0x283ece)return _0x1e4dce;return _0x1e4dce[_0x36ca43(0x1d7)](_0x47fce6=>_0x47fce6['skillCode']===_0x283ece);}export const skillDefinitions=[{'service':'skill','command':a26_0x5bc738(0x1d1),'description':'Install\x20the\x20published\x20'+CLI_BIN_NAME+a26_0x5bc738(0x1ce),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x19bc9a){const _0x310de8=a26_0x5bc738;logger[_0x310de8(0x1d8)](process[_0x310de8(0x1cd)]()),logger[_0x310de8(0x1ca)](_0x310de8(0x1cf),_0x310de8(0x1b0)+CLI_DISPLAY_NAME+_0x310de8(0x1e1));const {LOVRABET_SKILL_SOURCE:_0x2921b9,LOVRABET_SKIP_NPX_SKILLS_ENV:_0x51d2f5,runNpxSkillsAddGlobal:_0xe4b1c9}=await import('../../skills/npx-skills-add.js'),_0x38a474=_0x19bc9a[_0x310de8(0x1cc)]?'pipe':_0x310de8(0x1cb);console['log']('Installing\x20official\x20skill\x20via\x20npx\x20(npx\x20skills\x20add\x20'+_0x2921b9+_0x310de8(0x1dd));const _0x16a455=_0xe4b1c9(process[_0x310de8(0x1cd)](),_0x2921b9,{'stdio':_0x38a474});if(_0x16a455[_0x310de8(0x1e8)])console[_0x310de8(0x1e5)](_0x310de8(0x1da)+_0x51d2f5+'=1);\x20assuming\x20skill\x20is\x20already\x20present.');else{if(_0x16a455['ok'])console[_0x310de8(0x1e5)](CLI_BIN_NAME+_0x310de8(0x1dc));else throw CliErrors[_0x310de8(0x1e0)]('npx\x20skills\x20add\x20failed:\x20'+(_0x16a455[_0x310de8(0x1db)]||_0x310de8(0x1ad)),_0x310de8(0x1c3));}return{'ok':!![]};}},{'service':a26_0x5bc738(0x1bb),'command':a26_0x5bc738(0x1b2),'description':'Pull\x20personal\x20and\x20company\x20runtime\x20Skills\x20into\x20local\x20agent\x20skill\x20directories','risk':'write','flags':[CODE_FLAG],async 'execute'(_0x4b8269){const _0x3cc536=a26_0x5bc738,{listCompanyRuntimeSkills:_0x542d20,listPersonalRuntimeSkills:_0x13b004}=await import('../../core/api-client.js'),{linkEffectiveRuntimeSkills:_0x6a1e63,materializeRuntimeSkill:_0x37e935}=await import(_0x3cc536(0x1c8)),_0x532d8c=_0x4b8269[_0x3cc536(0x1c5)]('code'),_0x3d005c=_0x4b8269[_0x3cc536(0x1d6)]??'production',_0x249241=_0x4b8269[_0x3cc536(0x1c2)];if(!_0x249241)throw CliErrors['authRequired']();const _0x333ed8=filterByCode(await _0x13b004(_0x4b8269[_0x3cc536(0x1ba)]),_0x532d8c),_0x65ab7d=filterByCode(await _0x542d20(_0x4b8269['appCode']),_0x532d8c),_0x192a6c=[..._0x333ed8[_0x3cc536(0x1be)](_0x56f212=>_0x37e935(_0x56f212,'personal',{'env':_0x3d005c,'accessKey':_0x249241,'appCode':_0x4b8269[_0x3cc536(0x1ba)]})),..._0x65ab7d[_0x3cc536(0x1be)](_0x45e07f=>_0x37e935(_0x45e07f,_0x3cc536(0x1c4),{'env':_0x3d005c,'accessKey':_0x249241,'appCode':_0x4b8269[_0x3cc536(0x1ba)]}))],_0x1e599b=_0x6a1e63(_0x192a6c,_0x4b8269[_0x3cc536(0x1ba)]),_0x1b07e5=_0x1e599b[_0x3cc536(0x1c1)]((_0x1aeb51,_0x4e66b1)=>{const _0x1855c7=_0x3cc536;return _0x1aeb51[_0x4e66b1[_0x1855c7(0x1de)]]=(_0x1aeb51[_0x4e66b1[_0x1855c7(0x1de)]]??0x0)+0x1,_0x1aeb51;},{});return{'ok':!![],'data':{'appCode':_0x4b8269[_0x3cc536(0x1ba)],'personal':_0x333ed8[_0x3cc536(0x1e4)],'company':_0x65ab7d[_0x3cc536(0x1e4)],'materialized':_0x192a6c[_0x3cc536(0x1e4)],'links':{'total':_0x1e599b[_0x3cc536(0x1e4)],'created':_0x1b07e5[_0x3cc536(0x1c7)]??0x0,'updated':_0x1b07e5['updated']??0x0,'unchanged':_0x1b07e5['unchanged']??0x0,'skipped':0x0,'conflicted':0x0},'skills':{'personal':_0x333ed8[_0x3cc536(0x1be)](summarizeRuntimeSkill),'company':_0x65ab7d['map'](summarizeRuntimeSkill)}},'message':'Pulled\x20'+_0x333ed8[_0x3cc536(0x1e4)]+_0x3cc536(0x1df)+_0x65ab7d['length']+_0x3cc536(0x1b5)};}},{'service':'skill','command':a26_0x5bc738(0x1c9),'description':a26_0x5bc738(0x1e6),'risk':a26_0x5bc738(0x1d5),'flags':[DIR_FLAG],async 'execute'(_0xa9aacd){const _0x515749=a26_0x5bc738,{createPersonalRuntimeSkill:_0x26c197,listPersonalRuntimeSkills:_0x44ef0c,updatePersonalRuntimeSkill:_0x51fcf9}=await import(_0x515749(0x1bd)),{readPushDirectory:_0x52eef4}=await import(_0x515749(0x1c8));if(!_0xa9aacd['accessKey'])throw CliErrors[_0x515749(0x1ae)]();const _0x4fbb8f=_0x52eef4(_0xa9aacd['str'](_0x515749(0x1e2)),_0xa9aacd[_0x515749(0x1ba)]),_0x4db7d6=(await _0x44ef0c(_0xa9aacd[_0x515749(0x1ba)]))['find'](_0x27e97f=>_0x27e97f[_0x515749(0x1d0)]===_0x4fbb8f['skillCode']),_0x316997=_0x4db7d6?await _0x51fcf9(_0x4fbb8f[_0x515749(0x1d0)],_0xa9aacd['appCode'],_0x4fbb8f[_0x515749(0x1e7)]):await _0x26c197(_0xa9aacd['appCode'],_0x4fbb8f[_0x515749(0x1e7)]);return{'ok':!![],'data':summarizeRuntimeSkill(_0x316997),'message':_0x4db7d6?_0x515749(0x1e9)+_0x4fbb8f[_0x515749(0x1d0)]:'Created\x20personal\x20Skill\x20'+_0x4fbb8f[_0x515749(0x1d0)]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x30bd1d=a27_0x19da;function a27_0x35c9(){const _0x541afa=['4706408EYuVJI','sqlCode','str','sqlContent','sqlName','dbId','5444056PsBlpm','528180eBoUnZ','verbose','22775247DASOlm','322uqpmDx','3307420EXmqfU','3928vzoyVr','read','bool','description','12koARgJ','1533792ORCDyN','detail'];a27_0x35c9=function(){return _0x541afa;};return a27_0x35c9();}(function(_0x2ef710,_0x24442b){const _0x4c61f1=a27_0x19da,_0x5ddbe5=_0x2ef710();while(!![]){try{const _0x4392cf=parseInt(_0x4c61f1(0x18b))/0x1*(parseInt(_0x4c61f1(0x18d))/0x2)+parseInt(_0x4c61f1(0x19b))/0x3*(parseInt(_0x4c61f1(0x191))/0x4)+parseInt(_0x4c61f1(0x18c))/0x5+-parseInt(_0x4c61f1(0x192))/0x6+parseInt(_0x4c61f1(0x194))/0x7+parseInt(_0x4c61f1(0x19a))/0x8+-parseInt(_0x4c61f1(0x18a))/0x9;if(_0x4392cf===_0x24442b)break;else _0x5ddbe5['push'](_0x5ddbe5['shift']());}catch(_0x51ab4f){_0x5ddbe5['push'](_0x5ddbe5['shift']());}}}(a27_0x35c9,0x5ee64));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';function a27_0x19da(_0x3da3f8,_0x5c3ccc){_0x3da3f8=_0x3da3f8-0x18a;const _0x35c9ec=a27_0x35c9();let _0x19da14=_0x35c9ec[_0x3da3f8];return _0x19da14;}export const sqlDetail={'service':'sql','command':a27_0x30bd1d(0x193),'description':'Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','risk':a27_0x30bd1d(0x18e),'flags':[SQLCODE_FLAG,VERBOSE_FLAG],async 'execute'(_0xac28a4){const _0x15d155=a27_0x30bd1d,_0xe17ec7=await getSqlQueryInfo(_0xac28a4['appCode'],_0xac28a4[_0x15d155(0x196)]('sqlcode')),_0x1c9e7e=_0xac28a4[_0x15d155(0x18f)](_0x15d155(0x19c));if(_0x1c9e7e)return{'ok':!![],'data':_0xe17ec7};const _0x5cd347=_0xe17ec7[_0x15d155(0x199)]?await getDbName(_0xac28a4['appCode'],_0xe17ec7[_0x15d155(0x199)]):undefined;return{'ok':!![],'data':{'sqlCode':_0xe17ec7[_0x15d155(0x195)],'sqlName':_0xe17ec7[_0x15d155(0x198)],'db':_0x5cd347?_0x5cd347+'\x20('+_0xe17ec7[_0x15d155(0x199)]+')':_0xe17ec7[_0x15d155(0x199)]??'','description':_0xe17ec7[_0x15d155(0x190)]??'','sqlContent':_0xe17ec7[_0x15d155(0x197)]??''}};}};
|