@lovrabet/lovrabet-cli 2.0.9-beta.1 → 2.0.9-beta.2
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 +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a16_0x32b822=a16_0x160e;(function(_0x2a8542,_0x155778){const _0x56e607=a16_0x160e,_0x2ce3d3=_0x2a8542();while(!![]){try{const _0x4528c6=parseInt(_0x56e607(0x188))/0x1+-parseInt(_0x56e607(0x180))/0x2*(-parseInt(_0x56e607(0x16d))/0x3)+parseInt(_0x56e607(0x17d))/0x4*(parseInt(_0x56e607(0x17a))/0x5)+-parseInt(_0x56e607(0x162))/0x6*(parseInt(_0x56e607(0x171))/0x7)+parseInt(_0x56e607(0x139))/0x8+parseInt(_0x56e607(0x13f))/0x9*(-parseInt(_0x56e607(0x177))/0xa)+-parseInt(_0x56e607(0x16f))/0xb;if(_0x4528c6===_0x155778)break;else _0x2ce3d3['push'](_0x2ce3d3['shift']());}catch(_0x111c45){_0x2ce3d3['push'](_0x2ce3d3['shift']());}}}(a16_0x22bb,0x915e3));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';function a16_0x160e(_0x11a944,_0x5f1d71){_0x11a944=_0x11a944-0x136;const _0x22bb71=a16_0x22bb();let _0x160e7a=_0x22bb71[_0x11a944];return _0x160e7a;}import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';function a16_0x22bb(){const _0x571316=['map','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','create','40BJXZtA','write','Update\x20an\x20existing\x20record','215uMrysB','\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}]','params','55772XuSsFN','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)','146wDscCe','body','read','\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}}','\x20completed\x20in\x20','command','POST','getOne','209487nkHRgw','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','now','paramsRequired','\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}','Preview:\x20data\x20','\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\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','7309808EbaThD','description','\x20on\x20dataset\x20','delete','operation','\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}','518553YczPnS','data','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20WHERE\x20OPERATORS','\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\x20PAGINATION','\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\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}}]}','batchCreate','filter','\x20\x20AGGREGATE\x20TYPES','code','data\x20','Get\x20a\x20single\x20record\x20by\x20ID','build','\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$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\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','\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','\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}','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','join','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\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}','\x20\x20LOGICAL\x20COMBINATORS','\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\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}','helpExtra','\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}}','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','str','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','risk','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','24vgSbql','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','\x20\x20PARAMS\x20STRUCTURE','update','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','\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\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\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}}','/api/{appCode}/','aggregate','dryRun','45105LfoegR','Filter\x20dataset\x20records\x20with\x20query\x20conditions','15414366hEBiZt','high-risk-write','1037953pJrdAo','paramsHint','\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]'];a16_0x22bb=function(){return _0x571316;};return a16_0x22bb();}import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a16_0x32b822(0x148),'operation':a16_0x32b822(0x148),'risk':a16_0x32b822(0x182),'paramsRequired':![],'description':a16_0x32b822(0x16e),'paramsHint':a16_0x32b822(0x17e)+a16_0x32b822(0x15f),'helpExtra':[a16_0x32b822(0x142),a16_0x32b822(0x169),'\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}}','\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_0x32b822(0x183),a16_0x32b822(0x14f),a16_0x32b822(0x143),a16_0x32b822(0x136),a16_0x32b822(0x14e),'\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_0x32b822(0x158),a16_0x32b822(0x146),a16_0x32b822(0x159),'',a16_0x32b822(0x166),'\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)',a16_0x32b822(0x173),a16_0x32b822(0x17b),a16_0x32b822(0x168),'\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','',a16_0x32b822(0x144),'\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.',a16_0x32b822(0x163),'\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)'][a16_0x32b822(0x155)]('\x0a')},{'command':a16_0x32b822(0x187),'operation':a16_0x32b822(0x187),'risk':a16_0x32b822(0x182),'paramsRequired':!![],'description':a16_0x32b822(0x14c),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a16_0x32b822(0x176),'operation':a16_0x32b822(0x176),'risk':'write','paramsRequired':!![],'description':'Create\x20a\x20new\x20record\x20in\x20a\x20dataset','paramsHint':a16_0x32b822(0x161)},{'command':a16_0x32b822(0x147),'operation':a16_0x32b822(0x147),'risk':'write','paramsRequired':!![],'description':a16_0x32b822(0x150),'paramsHint':'JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27'},{'command':'update','operation':a16_0x32b822(0x165),'risk':a16_0x32b822(0x178),'paramsRequired':!![],'description':a16_0x32b822(0x179),'paramsHint':a16_0x32b822(0x153)},{'command':a16_0x32b822(0x13c),'operation':a16_0x32b822(0x13c),'risk':a16_0x32b822(0x170),'paramsRequired':!![],'description':'Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','paramsHint':a16_0x32b822(0x156)},{'command':'aggregate','operation':a16_0x32b822(0x16b),'risk':a16_0x32b822(0x182),'paramsRequired':![],'description':a16_0x32b822(0x138),'paramsHint':a16_0x32b822(0x189)+'Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','helpExtra':[a16_0x32b822(0x149),a16_0x32b822(0x157),a16_0x32b822(0x145),a16_0x32b822(0x18c),'\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}',a16_0x32b822(0x13e),a16_0x32b822(0x152),a16_0x32b822(0x15a),'',a16_0x32b822(0x164),a16_0x32b822(0x167),a16_0x32b822(0x17f),a16_0x32b822(0x175),a16_0x32b822(0x141),a16_0x32b822(0x15c),a16_0x32b822(0x137),'','\x20\x20EXAMPLES',a16_0x32b822(0x15d),a16_0x32b822(0x151),'',a16_0x32b822(0x154),'\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'][a16_0x32b822(0x155)]('\x0a')}];function makeDataCommand(_0x10a5c4){const _0x273b15=a16_0x32b822,_0x5837e6=_0x273b15(0x14b)+_0x10a5c4[_0x273b15(0x185)],_0x5af5aa={'service':_0x273b15(0x140),'command':_0x10a5c4[_0x273b15(0x185)],'description':_0x10a5c4['description'],'risk':_0x10a5c4[_0x273b15(0x160)],'helpExtra':_0x10a5c4[_0x273b15(0x15b)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x10a5c4[_0x273b15(0x172)]}],'validate':async _0x589b21=>{const _0x3c0859=_0x273b15;_0x10a5c4[_0x3c0859(0x18b)]&&requireAnyOf(_0x589b21,[_0x3c0859(0x17c)],_0x5837e6),_0x10a5c4['operation']===_0x3c0859(0x147)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x589b21[_0x3c0859(0x15e)]('params')));},async 'execute'(_0x4debdc){const _0x52bbfa=_0x273b15,_0x121476=_0x4debdc[_0x52bbfa(0x15e)](_0x52bbfa(0x14a)),_0x3593e2=_0x10a5c4['operation']==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x4debdc[_0x52bbfa(0x15e)](_0x52bbfa(0x17c)))):parseJsonParams(_0x4debdc[_0x52bbfa(0x15e)](_0x52bbfa(0x17c)))??{},_0x1b3515=Date[_0x52bbfa(0x18a)](),_0x3b36c4=await executeData(_0x121476,_0x10a5c4['operation'],_0x3593e2),_0x597893=Date['now']()-_0x1b3515;return{'ok':!![],'data':{'result':_0x3b36c4,'elapsed':_0x597893},'message':_0x52bbfa(0x14b)+_0x10a5c4[_0x52bbfa(0x185)]+_0x52bbfa(0x184)+_0x597893+'ms'};}};return _0x10a5c4[_0x273b15(0x160)]!==_0x273b15(0x182)&&(_0x5af5aa[_0x273b15(0x16c)]=async _0x3342f1=>{const _0x147b98=_0x273b15,_0x477bec=_0x3342f1['str'](_0x147b98(0x14a)),_0x195cc8=_0x10a5c4['operation']===_0x147b98(0x147)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x3342f1['str']('params'))):parseJsonParams(_0x3342f1[_0x147b98(0x15e)]('params'))??{};return dryRun(_0x147b98(0x186),_0x147b98(0x16a)+_0x477bec+'/'+_0x10a5c4[_0x147b98(0x13d)])[_0x147b98(0x181)](_0x195cc8)[_0x147b98(0x13a)](_0x147b98(0x18d)+_0x10a5c4['command']+_0x147b98(0x13b)+_0x477bec)[_0x147b98(0x14d)]();}),_0x5af5aa;}export const dataDefinitions=specs[a16_0x32b822(0x174)](makeDataCommand);
|
|
1
|
+
const a16_0x485f90=a16_0x13eb;(function(_0x20f57c,_0x284ad1){const _0x5509e8=a16_0x13eb,_0x2e83b3=_0x20f57c();while(!![]){try{const _0x200a2f=-parseInt(_0x5509e8(0xff))/0x1*(parseInt(_0x5509e8(0x12f))/0x2)+parseInt(_0x5509e8(0x12d))/0x3*(-parseInt(_0x5509e8(0x11e))/0x4)+parseInt(_0x5509e8(0x101))/0x5+parseInt(_0x5509e8(0x138))/0x6+parseInt(_0x5509e8(0x124))/0x7+-parseInt(_0x5509e8(0x123))/0x8*(-parseInt(_0x5509e8(0x129))/0x9)+-parseInt(_0x5509e8(0x132))/0xa;if(_0x200a2f===_0x284ad1)break;else _0x2e83b3['push'](_0x2e83b3['shift']());}catch(_0x37a028){_0x2e83b3['push'](_0x2e83b3['shift']());}}}(a16_0x4228,0x72c6c));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';function a16_0x4228(){const _0x119b37=['batchCreate','Preview:\x20data\x20','\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}}','write','\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]','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','command','high-risk-write','filter','\x20\x20AGGREGATE\x20TYPES','paramsRequired','\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}}','str','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','getOne','80187ciKnKx','\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}}','1314985xiWlHn','\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\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}','data\x20','now','operation','aggregate','Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','params','\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\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\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}','Filter\x20dataset\x20records\x20with\x20query\x20conditions','paramsHint','Update\x20an\x20existing\x20record','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','\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}','update','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','read','create','\x20\x20LOGICAL\x20COMBINATORS','\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}}','join','\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}','248egaGSQ','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','\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}}]}','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','code','1186832mQuTON','6341090IUEDAa','\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\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}','description','/api/{appCode}/','9xGBsLx','helpExtra','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','risk','44691cuunrt','map','10SgnHmH','\x20\x20PARAMS\x20STRUCTURE','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','1682120vyQEMc','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\x20\x20WHERE\x20OPERATORS','\x20\x20PAGINATION','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','3873984ITKCuC','\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}}','Get\x20a\x20single\x20record\x20by\x20ID','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\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}}','build','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','data','\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}}','\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}}]}','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','body'];a16_0x4228=function(){return _0x119b37;};return a16_0x4228();}import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a16_0x485f90(0x14d),'operation':a16_0x485f90(0x14d),'risk':a16_0x485f90(0x118),'paramsRequired':![],'description':a16_0x485f90(0x10e),'paramsHint':a16_0x485f90(0x137)+a16_0x485f90(0x121),'helpExtra':[a16_0x485f90(0x135),a16_0x485f90(0x139),a16_0x485f90(0x125),a16_0x485f90(0xfb),a16_0x485f90(0x11b),'\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_0x485f90(0x13c),'\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]}}',a16_0x485f90(0x100),a16_0x485f90(0x10b),a16_0x485f90(0x140),'',a16_0x485f90(0x11a),a16_0x485f90(0x120),a16_0x485f90(0x141),'',a16_0x485f90(0x111),'\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)',a16_0x485f90(0x149),'\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_0x485f90(0xfd),a16_0x485f90(0x117),'',a16_0x485f90(0x136),a16_0x485f90(0x131),a16_0x485f90(0x112),a16_0x485f90(0x115)][a16_0x485f90(0x11c)]('\x0a')},{'command':'getOne','operation':a16_0x485f90(0xfe),'risk':a16_0x485f90(0x118),'paramsRequired':!![],'description':a16_0x485f90(0x13a),'paramsHint':a16_0x485f90(0x13b)},{'command':a16_0x485f90(0x119),'operation':a16_0x485f90(0x119),'risk':a16_0x485f90(0x148),'paramsRequired':!![],'description':a16_0x485f90(0x109),'paramsHint':a16_0x485f90(0x12b)},{'command':'batchCreate','operation':'batchCreate','risk':'write','paramsRequired':!![],'description':a16_0x485f90(0x116),'paramsHint':a16_0x485f90(0x14a)},{'command':a16_0x485f90(0x114),'operation':a16_0x485f90(0x114),'risk':a16_0x485f90(0x148),'paramsRequired':!![],'description':a16_0x485f90(0x110),'paramsHint':'JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27'},{'command':'delete','operation':'delete','risk':a16_0x485f90(0x14c),'paramsRequired':!![],'description':'Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':'aggregate','operation':a16_0x485f90(0x107),'risk':a16_0x485f90(0x118),'paramsRequired':![],'description':a16_0x485f90(0x142),'paramsHint':a16_0x485f90(0x133)+a16_0x485f90(0x108),'helpExtra':[a16_0x485f90(0x14e),a16_0x485f90(0x126),a16_0x485f90(0x113),a16_0x485f90(0x11d),a16_0x485f90(0x10d),'\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}','\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}',a16_0x485f90(0x103),'',a16_0x485f90(0x130),a16_0x485f90(0x102),a16_0x485f90(0x134),a16_0x485f90(0x143),a16_0x485f90(0x10c),a16_0x485f90(0x147),a16_0x485f90(0x11f),'','\x20\x20EXAMPLES',a16_0x485f90(0x13e),'\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','','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','\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'][a16_0x485f90(0x11c)]('\x0a')}];function a16_0x13eb(_0x19fde4,_0x1c99b8){_0x19fde4=_0x19fde4-0xfb;const _0x4228df=a16_0x4228();let _0x13ebc0=_0x4228df[_0x19fde4];return _0x13ebc0;}function makeDataCommand(_0x80156b){const _0x5ebcd5=a16_0x485f90,_0x50b09f=_0x5ebcd5(0x104)+_0x80156b[_0x5ebcd5(0x14b)],_0x4ac2f3={'service':_0x5ebcd5(0x13f),'command':_0x80156b[_0x5ebcd5(0x14b)],'description':_0x80156b['description'],'risk':_0x80156b[_0x5ebcd5(0x12c)],'helpExtra':_0x80156b[_0x5ebcd5(0x12a)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x80156b[_0x5ebcd5(0x10f)]}],'validate':async _0x2564fd=>{const _0x4c81fc=_0x5ebcd5;_0x80156b[_0x4c81fc(0x14f)]&&requireAnyOf(_0x2564fd,[_0x4c81fc(0x10a)],_0x50b09f),_0x80156b[_0x4c81fc(0x106)]===_0x4c81fc(0x145)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x2564fd[_0x4c81fc(0xfc)](_0x4c81fc(0x10a))));},async 'execute'(_0x414302){const _0x2cb3ed=_0x5ebcd5,_0x1d6f4b=_0x414302[_0x2cb3ed(0xfc)](_0x2cb3ed(0x122)),_0x2a4ebd=_0x80156b[_0x2cb3ed(0x106)]===_0x2cb3ed(0x145)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x414302[_0x2cb3ed(0xfc)](_0x2cb3ed(0x10a)))):parseJsonParams(_0x414302['str'](_0x2cb3ed(0x10a)))??{},_0x30d387=Date[_0x2cb3ed(0x105)](),_0x419437=await executeData(_0x1d6f4b,_0x80156b[_0x2cb3ed(0x106)],_0x2a4ebd),_0x1a4ad0=Date['now']()-_0x30d387;return{'ok':!![],'data':{'result':_0x419437,'elapsed':_0x1a4ad0},'message':'data\x20'+_0x80156b[_0x2cb3ed(0x14b)]+'\x20completed\x20in\x20'+_0x1a4ad0+'ms'};}};return _0x80156b[_0x5ebcd5(0x12c)]!==_0x5ebcd5(0x118)&&(_0x4ac2f3['dryRun']=async _0x68465c=>{const _0x153925=_0x5ebcd5,_0x226ae7=_0x68465c[_0x153925(0xfc)](_0x153925(0x122)),_0x48982d=_0x80156b[_0x153925(0x106)]===_0x153925(0x145)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x68465c['str'](_0x153925(0x10a)))):parseJsonParams(_0x68465c[_0x153925(0xfc)](_0x153925(0x10a)))??{};return dryRun('POST',_0x153925(0x128)+_0x226ae7+'/'+_0x80156b[_0x153925(0x106)])[_0x153925(0x144)](_0x48982d)[_0x153925(0x127)](_0x153925(0x146)+_0x80156b[_0x153925(0x14b)]+'\x20on\x20dataset\x20'+_0x226ae7)[_0x153925(0x13d)]();}),_0x4ac2f3;}export const dataDefinitions=specs[a16_0x485f90(0x12e)](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a17_0xa3fbb3=a17_0x159e;(function(_0xdcb7eb,_0x4fc17c){const _0x4ed467=a17_0x159e,_0x2dac99=_0xdcb7eb();while(!![]){try{const _0x468d80=-parseInt(_0x4ed467(0x137))/0x1*(parseInt(_0x4ed467(0x12b))/0x2)+-parseInt(_0x4ed467(0x144))/0x3*(-parseInt(_0x4ed467(0x12a))/0x4)+parseInt(_0x4ed467(0x15f))/0x5+parseInt(_0x4ed467(0x11f))/0x6*(parseInt(_0x4ed467(0x12e))/0x7)+-parseInt(_0x4ed467(0x156))/0x8+-parseInt(_0x4ed467(0x143))/0x9*(-parseInt(_0x4ed467(0x140))/0xa)+-parseInt(_0x4ed467(0x127))/0xb;if(_0x468d80===_0x4fc17c)break;else _0x2dac99['push'](_0x2dac99['shift']());}catch(_0x2584ec){_0x2dac99['push'](_0x2dac99['shift']());}}}(a17_0x19a6,0xf22af));import{getDatasetDetail}from'../../core/api-client.js';function a17_0x19a6(){const _0x9ea47=['str','toDatasetCode','71589lXgbXV','map','requestFields','read','pkField','toDatasetName','labelField','code','toTableName','3TMXsXQ','columnCodeListWithDeleted','dblinkInfoDTO','type','dbId','updateTimeField','trim','dbtableConfig','responseBody','10nogppy','allFields','modelCode','15156621iqJaKh','24243JdDuhH','dataset','entries','createTimeField','modifierNameField','relatedPageInfoList','allFieldNames','creatorNameField','method','indexes','doType','detail','requestBody','validateRules','description','logicField','formatRules','datasetKey','8160528fnPEsU','properties','creatorIdField','dbType','name','afterScriptId','operations','host','displayName','7908025zdCRlP','source','options','beforeScriptId','parse','dataType','path','object','required','tableName','fields','isArray','title','deleted','filter','186cEztwV','extend','fromField','length','dbName','responseFields','string','toFieldLabel','13923723UihTqa','split','relations','16OeVzJA','224838ydHUUc'];a17_0x19a6=function(){return _0x9ea47;};return a17_0x19a6();}import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x191652){const _0x588626=a17_0x159e;if(_0x191652[_0x588626(0x11d)])return null;const _0xb360cc=Boolean(_0x191652[_0x588626(0x15e)]!==undefined||_0x191652[_0x588626(0x14e)]!==undefined);let _0x28ce01={};if(!_0xb360cc&&typeof _0x191652['extend']===_0x588626(0x125))try{_0x28ce01=JSON[_0x588626(0x163)](_0x191652['extend']);}catch{}const _0x4132a6=_0xb360cc?_0x191652[_0x588626(0x15a)]:_0x191652['code'],_0x27c18a=_0xb360cc?_0x191652['displayName']:_0x191652[_0x588626(0x15a)],_0x5b5903=_0xb360cc?_0x191652[_0x588626(0x14e)]:_0x191652[_0x588626(0x13a)]||_0x191652[_0x588626(0x164)],_0x20dcd2=_0xb360cc?_0x191652[_0x588626(0x132)]===!![]:_0x28ce01['pkField']===!![],_0x161a8c=_0xb360cc?_0x191652['required']===!![]:_0x28ce01[_0x588626(0x167)]===!![],_0x446ca7=_0xb360cc?_0x191652['options']??null:_0x28ce01[_0x588626(0x161)]??null,_0x3bad43={'name':_0x4132a6,'displayName':_0x27c18a||_0x4132a6,'type':_0x5b5903,'dbType':_0x191652[_0x588626(0x159)],'pk':_0x20dcd2,'required':_0x161a8c,'description':_0x191652[_0x588626(0x152)]||undefined};return Array[_0x588626(0x11b)](_0x446ca7)&&_0x446ca7[_0x588626(0x122)]>0x0&&(_0x3bad43[_0x588626(0x161)]=_0x446ca7),_0x3bad43;}function a17_0x159e(_0x330c44,_0x1afc18){_0x330c44=_0x330c44-0x119;const _0x19a610=a17_0x19a6();let _0x159e56=_0x19a610[_0x330c44];return _0x159e56;}function parseJsonMaybe(_0x441ee0){const _0x5d4f58=a17_0x159e;if(typeof _0x441ee0!=='string')return _0x441ee0;try{return JSON[_0x5d4f58(0x163)](_0x441ee0);}catch{return _0x441ee0;}}function normalizeOperationEntry(_0xf42632,_0x141c6d){const _0x160709=a17_0x159e;if(!_0x141c6d||typeof _0x141c6d!=='object')return null;if(!_0x141c6d['method']||!_0x141c6d[_0x160709(0x165)])return null;const _0x654e50={'name':_0xf42632,'method':_0x141c6d[_0x160709(0x14c)],'path':_0x141c6d[_0x160709(0x165)]};if(_0x141c6d[_0x160709(0x15d)])_0x654e50[_0x160709(0x15d)]=_0x141c6d['host'];if(_0x141c6d['requestBody']!=null)_0x654e50['requestBody']=parseJsonMaybe(_0x141c6d[_0x160709(0x150)]);if(_0x141c6d[_0x160709(0x13f)]!=null)_0x654e50[_0x160709(0x13f)]=parseJsonMaybe(_0x141c6d['responseBody']);if(_0x141c6d[_0x160709(0x162)]!=null)_0x654e50['beforeScriptId']=_0x141c6d[_0x160709(0x162)];if(_0x141c6d['afterScriptId']!=null)_0x654e50[_0x160709(0x15b)]=_0x141c6d[_0x160709(0x15b)];if(Array['isArray'](_0x141c6d['requestFields']))_0x654e50['requestFields']=_0x141c6d[_0x160709(0x130)];if(Array[_0x160709(0x11b)](_0x141c6d[_0x160709(0x124)]))_0x654e50[_0x160709(0x124)]=_0x141c6d[_0x160709(0x124)];return _0x654e50;}function summarizeDbtable(_0x39a720){const _0x5d7816=a17_0x159e,_0x3840e5={},_0x11080b=[_0x5d7816(0x13b),_0x5d7816(0x123),_0x5d7816(0x119),_0x5d7816(0x155),_0x5d7816(0x132),_0x5d7816(0x141),_0x5d7816(0x153),_0x5d7816(0x147),_0x5d7816(0x13c),_0x5d7816(0x158),_0x5d7816(0x14b),'modifierIdField',_0x5d7816(0x148),_0x5d7816(0x134),_0x5d7816(0x139)];for(const _0x2d1b94 of _0x11080b){if(_0x39a720[_0x2d1b94]!==undefined)_0x3840e5[_0x2d1b94]=_0x39a720[_0x2d1b94];}return typeof _0x3840e5[_0x5d7816(0x141)]==='string'&&_0x3840e5[_0x5d7816(0x141)][_0x5d7816(0x122)]>0x0&&(_0x3840e5[_0x5d7816(0x14a)]=_0x3840e5[_0x5d7816(0x141)][_0x5d7816(0x128)](',')['map'](_0x4815ee=>_0x4815ee[_0x5d7816(0x13d)]())[_0x5d7816(0x11e)](Boolean)),_0x3840e5;}function normalizeRelatedPages(_0x259420){const _0x52021e=a17_0x159e;if(!Array[_0x52021e(0x11b)](_0x259420))return[];return _0x259420[_0x52021e(0x11e)](_0x4bdc6d=>_0x4bdc6d&&typeof _0x4bdc6d===_0x52021e(0x166))[_0x52021e(0x12f)](_0x48b25d=>({'id':_0x48b25d['id'],'type':_0x48b25d[_0x52021e(0x13a)],'code':_0x48b25d[_0x52021e(0x135)],'title':_0x48b25d[_0x52021e(0x11c)],'deleted':_0x48b25d[_0x52021e(0x11d)]===!![]}));}export const datasetDetail={'service':a17_0xa3fbb3(0x145),'command':a17_0xa3fbb3(0x14f),'description':'Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','risk':a17_0xa3fbb3(0x131),'flags':[CODE_FLAG],async 'execute'(_0x38d564){const _0x495a75=a17_0xa3fbb3,_0xfbcd3a=await getDatasetDetail(_0x38d564[_0x495a75(0x12c)](_0x495a75(0x135))),_0x4313b0=Array['isArray'](_0xfbcd3a[_0x495a75(0x11a)])?_0xfbcd3a[_0x495a75(0x11a)]:Array[_0x495a75(0x11b)](_0xfbcd3a[_0x495a75(0x157)])?_0xfbcd3a[_0x495a75(0x157)]:[],_0x1a6110=_0x4313b0[_0x495a75(0x12f)](_0x319329=>normalizeField(_0x319329))[_0x495a75(0x11e)](_0x533042=>_0x533042!==null),_0x1de8cc=_0xfbcd3a[_0x495a75(0x15c)]??{},_0x4a9de3=[];for(const [_0x18b272,_0x434ef6]of Object[_0x495a75(0x146)](_0x1de8cc)){const _0x593c20=normalizeOperationEntry(_0x18b272,_0x434ef6);if(_0x593c20)_0x4a9de3['push'](_0x593c20);}const _0x2767d5=_0xfbcd3a[_0x495a75(0x13e)]??{},_0x8f1572=_0xfbcd3a[_0x495a75(0x145)]??{},_0x55d47b=_0x2767d5['dbId']!=null?{'id':_0x2767d5[_0x495a75(0x13b)],'name':_0x2767d5[_0x495a75(0x123)]??null}:undefined;let _0x22bb4d;return typeof _0xfbcd3a[_0x495a75(0x120)]==='string'&&(_0x22bb4d=parseJsonMaybe(_0xfbcd3a['extend'])),{'ok':!![],'data':{'id':_0xfbcd3a['modelId']??_0xfbcd3a['id'],'name':_0xfbcd3a['name'],'code':_0xfbcd3a[_0x495a75(0x142)]||_0xfbcd3a['code'],'doVersion':_0xfbcd3a['doVersion'],'description':_0xfbcd3a[_0x495a75(0x152)]||_0x8f1572['tableComment']||undefined,'source':_0xfbcd3a[_0x495a75(0x160)]||_0x8f1572['sourceType'],'table':_0x2767d5['tableName']||_0x8f1572[_0x495a75(0x119)],'datasetKey':_0x2767d5[_0x495a75(0x155)],'pk':_0x2767d5[_0x495a75(0x132)],'db':_0x55d47b,'dbtable':summarizeDbtable(_0x2767d5),'fields':_0x1a6110,'operations':_0x4a9de3,'indexes':Array[_0x495a75(0x11b)](_0x8f1572['indexes'])?_0x8f1572[_0x495a75(0x14d)]:[],'relations':Array[_0x495a75(0x11b)](_0xfbcd3a[_0x495a75(0x129)])?_0xfbcd3a[_0x495a75(0x129)][_0x495a75(0x12f)](_0x316dca=>({'fromField':_0x316dca[_0x495a75(0x121)],'toDataset':_0x316dca[_0x495a75(0x133)],'toCode':_0x316dca[_0x495a75(0x12d)],'toTable':_0x316dca[_0x495a75(0x136)],'toField':_0x316dca['toField'],'labelField':_0x316dca[_0x495a75(0x126)]||undefined})):[],'relatedPages':normalizeRelatedPages(_0xfbcd3a[_0x495a75(0x149)]),...Array[_0x495a75(0x11b)](_0xfbcd3a[_0x495a75(0x138)])?{'columnCodeListWithDeleted':_0xfbcd3a[_0x495a75(0x138)]}:{},'formatRules':Array[_0x495a75(0x11b)](_0xfbcd3a['formatRules'])?_0xfbcd3a[_0x495a75(0x154)]:[],'validateRules':Array[_0x495a75(0x11b)](_0xfbcd3a[_0x495a75(0x151)])?_0xfbcd3a['validateRules']:[],..._0x22bb4d!==undefined?{'extend':_0x22bb4d}:{},'stats':{'fieldCount':_0x1a6110['length'],'operationCount':_0x4a9de3[_0x495a75(0x122)]}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a18_0x58d9(){const _0x58f658=['281240PfHFTy','15NCiFaW','8isjqEZ','10082097BoDPvY','1507REanrn','6021304iRZaNZ','3966HPKwar','388217PyrKEl','405642sDvVis','1419640kesMrU','14448XVXlrt'];a18_0x58d9=function(){return _0x58f658;};return a18_0x58d9();}(function(_0x1980e0,_0x10b126){const _0x2ee458=a18_0x225c,_0x4876f3=_0x1980e0();while(!![]){try{const _0x2c9d90=-parseInt(_0x2ee458(0x192))/0x1+parseInt(_0x2ee458(0x193))/0x2*(-parseInt(_0x2ee458(0x197))/0x3)+-parseInt(_0x2ee458(0x19b))/0x4+-parseInt(_0x2ee458(0x194))/0x5+-parseInt(_0x2ee458(0x191))/0x6*(-parseInt(_0x2ee458(0x195))/0x7)+parseInt(_0x2ee458(0x198))/0x8*(-parseInt(_0x2ee458(0x199))/0x9)+-parseInt(_0x2ee458(0x196))/0xa*(-parseInt(_0x2ee458(0x19a))/0xb);if(_0x2c9d90===_0x10b126)break;else _0x4876f3['push'](_0x4876f3['shift']());}catch(_0x3d293f){_0x4876f3['push'](_0x4876f3['shift']());}}}(a18_0x58d9,0xdd10b));import{datasetList}from'../../commands/dataset/list.js';function a18_0x225c(_0xcca65a,_0x27cb20){_0xcca65a=_0xcca65a-0x191;const _0x58d9d9=a18_0x58d9();let _0x225cc9=_0x58d9d9[_0xcca65a];return _0x225cc9;}import{datasetDetail}from'../../commands/dataset/detail.js';export const datasetDefinitions=[datasetList,datasetDetail];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x3f15ea=a19_0x234e;(function(_0x119da4,_0x3eece1){const _0x24696a=a19_0x234e,_0x57c686=_0x119da4();while(!![]){try{const _0x238af3=-parseInt(_0x24696a(0x1b4))/0x1*(parseInt(_0x24696a(0x1c1))/0x2)+-parseInt(_0x24696a(0x1b9))/0x3*(parseInt(_0x24696a(0x1ae))/0x4)+-parseInt(_0x24696a(0x1bc))/0x5*(-parseInt(_0x24696a(0x1c7))/0x6)+-parseInt(_0x24696a(0x1c8))/0x7*(-parseInt(_0x24696a(0x1c5))/0x8)+-parseInt(_0x24696a(0x1ba))/0x9*(parseInt(_0x24696a(0x1ad))/0xa)+parseInt(_0x24696a(0x1bf))/0xb+-parseInt(_0x24696a(0x1b8))/0xc*(-parseInt(_0x24696a(0x1c9))/0xd);if(_0x238af3===_0x3eece1)break;else _0x57c686['push'](_0x57c686['shift']());}catch(_0x26c4d3){_0x57c686['push'](_0x57c686['shift']());}}}(a19_0xf892,0xe4fb0));import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function a19_0xf892(){const _0x2f6b21=['90FAwfDB','4plcpse','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','dbtableConfig','dataset','length','read','41453SbwNcm','trim','description','allFields','4066116RzpJxD','503742vQwjaa','1631844pKMhfo','Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)','18605eUuuLZ','tableName','name','14063280bNrqkI','str','18Tvhlnp','datasetKey','map','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','114184adueMg','string','786tXzqdK','161Fzfnqm','39BSIqkX','appCode','code'];a19_0xf892=function(){return _0x2f6b21;};return a19_0xf892();}function a19_0x234e(_0x5e376a,_0x420ae5){_0x5e376a=_0x5e376a-0x1ab;const _0xf892b4=a19_0xf892();let _0x234e2f=_0xf892b4[_0x5e376a];return _0x234e2f;}export const datasetList={'service':a19_0x3f15ea(0x1b1),'command':'list','description':a19_0x3f15ea(0x1c4),'risk':a19_0x3f15ea(0x1b3),'flags':[{'name':a19_0x3f15ea(0x1be),'type':a19_0x3f15ea(0x1c6),'description':a19_0x3f15ea(0x1bb)},{...CODE_FLAG,'required':![],'description':a19_0x3f15ea(0x1af)}],async 'execute'(_0x3c2392){const _0x1847b3=a19_0x3f15ea,_0x19ae3e=_0x3c2392['str']('name'),_0xa7da4=_0x3c2392[_0x1847b3(0x1c0)](_0x1847b3(0x1ac)),_0xe33d4b=await listDatasets(_0x3c2392[_0x1847b3(0x1ab)],{..._0x19ae3e&&{'name':_0x19ae3e},..._0xa7da4&&{'code':_0xa7da4}});return{'ok':!![],'data':{'total':_0xe33d4b[_0x1847b3(0x1b2)],'datasets':_0xe33d4b[_0x1847b3(0x1c3)](_0x1d4cbc=>{const _0x23f778=_0x1847b3,_0x104ad8=_0x1d4cbc[_0x23f778(0x1b0)]??{};return{'id':_0x1d4cbc['id'],'code':_0x1d4cbc[_0x23f778(0x1ac)],'name':_0x1d4cbc['name'],'source':_0x1d4cbc['source'],'description':_0x1d4cbc[_0x23f778(0x1b6)],'table':_0x104ad8[_0x23f778(0x1bd)],'datasetKey':_0x104ad8[_0x23f778(0x1c2)],'pk':_0x104ad8['pkField'],'fields':_0x104ad8[_0x23f778(0x1b7)]?_0x104ad8['allFields']['split'](',')['map'](_0x1e175d=>_0x1e175d[_0x23f778(0x1b5)]()):[]};})}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x499375=a20_0x7cb4;(function(_0x4b6b96,_0x1e97b2){const _0x57a05f=a20_0x7cb4,_0x418aa9=_0x4b6b96();while(!![]){try{const _0x5d97e8=-parseInt(_0x57a05f(0x20e))/0x1+parseInt(_0x57a05f(0x1f0))/0x2+-parseInt(_0x57a05f(0x229))/0x3*(-parseInt(_0x57a05f(0x21c))/0x4)+-parseInt(_0x57a05f(0x1f8))/0x5+parseInt(_0x57a05f(0x222))/0x6+-parseInt(_0x57a05f(0x218))/0x7*(-parseInt(_0x57a05f(0x213))/0x8)+parseInt(_0x57a05f(0x1fe))/0x9*(-parseInt(_0x57a05f(0x22e))/0xa);if(_0x5d97e8===_0x1e97b2)break;else _0x418aa9['push'](_0x418aa9['shift']());}catch(_0x3b8c54){_0x418aa9['push'](_0x418aa9['shift']());}}}(a20_0x40d2,0x20cfc));import a20_0x209774 from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';function a20_0x40d2(){const _0x4b4d46=['⚠\x20Empty\x20(treated\x20as\x20{})','appCode','\x20\x20Config\x20Files','repeat','\x20\x20runtimeDomain:\x20\x20\x20','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20(legacy/compat\x20only)','red','format','currentApp','229675UCfHHU','bold','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','version','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','144376tlVRCT','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','(default)','(missing)','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','77JqoLKI','green','pageSize','accessKey','1044532gqiNSn','\x20\x20Auth','Project','arch','padEnd','status','1188402FzrvxK','✓\x20Valid\x20JSON','check','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','\x20\x20─','ClientAk','message','3Kaiqgj','riskLevel','empty','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','verbose','190250DRySUJ','doctor','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20auth\x20(effective):\x20','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','length','465988CAbmrO','log','(default:\x20','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','locale','✗\x20Invalid\x20JSON','(set,\x20length=','gray','445325DwJrzi','\x20(accessKey)','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','platform','\x20\x20API\x20Endpoints','(removed\x20—\x20cookie\x20auth\x20disabled)','207bcYmTZ','Diagnose\x20CLI\x20configuration\x20and\x20environment','defaultApp','(no\x20file)','(none)','missing'];a20_0x40d2=function(){return _0x4b4d46;};return a20_0x40d2();}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';function a20_0x7cb4(_0x5d8af9,_0x49ce0e){_0x5d8af9=_0x5d8af9-0x1ef;const _0x40d26a=a20_0x40d2();let _0x7cb45=_0x40d26a[_0x5d8af9];return _0x7cb45;}async function execute(_0x3627e3){const _0x51217b=a20_0x7cb4,_0xad8b60=getCliVersion(),_0x2d270e=buildConfigFromFlags({});await initGlobalEnvironment(_0x2d270e),console[_0x51217b(0x1f1)](),console[_0x51217b(0x1f1)](a20_0x209774[_0x51217b(0x20f)](CLI_BIN_NAME+'\x20doctor')),console[_0x51217b(0x1f1)](a20_0x209774[_0x51217b(0x1f7)]('─'[_0x51217b(0x207)](0x32))),console['log'](_0x51217b(0x214)+_0xad8b60),console['log']('\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+process[_0x51217b(0x211)]),console[_0x51217b(0x1f1)](_0x51217b(0x210)+process[_0x51217b(0x1fb)]+'\x20'+process[_0x51217b(0x21f)]),console[_0x51217b(0x1f1)](),console[_0x51217b(0x1f1)](a20_0x209774[_0x51217b(0x20f)](_0x51217b(0x206))),console[_0x51217b(0x1f1)](a20_0x209774['gray'](_0x51217b(0x226)[_0x51217b(0x207)](0x1e)));const _0x385e7a=getGlobalConfigPath(),_0x4fd1ba=getProjectConfigPath();console[_0x51217b(0x1f1)](_0x51217b(0x217)+(_0x385e7a||a20_0x209774[_0x51217b(0x1f7)]('(not\x20found)'))),console[_0x51217b(0x1f1)](_0x51217b(0x230)+(_0x4fd1ba||a20_0x209774[_0x51217b(0x1f7)]('(not\x20found)'))),console[_0x51217b(0x1f1)](),console[_0x51217b(0x1f1)](a20_0x209774[_0x51217b(0x20f)]('\x20\x20Config\x20JSON')),console[_0x51217b(0x1f1)](a20_0x209774[_0x51217b(0x1f7)](_0x51217b(0x226)[_0x51217b(0x207)](0x1e)));const _0x37797b=(_0x154fcd,_0x505684)=>{const _0x581523=_0x51217b;if(!_0x505684){console[_0x581523(0x1f1)]('\x20\x20'+_0x154fcd[_0x581523(0x220)](0x11)+'\x20'+a20_0x209774[_0x581523(0x1f7)](_0x581523(0x201)));return;}const _0x3dd9d6=inspectCliConfigJsonFile(_0x505684);if(_0x3dd9d6['status']==='ok')console[_0x581523(0x1f1)]('\x20\x20'+_0x154fcd[_0x581523(0x220)](0x11)+'\x20'+a20_0x209774[_0x581523(0x219)](_0x581523(0x223)));else{if(_0x3dd9d6[_0x581523(0x221)]===_0x581523(0x22b))console['log']('\x20\x20'+_0x154fcd[_0x581523(0x220)](0x11)+'\x20'+a20_0x209774['yellow'](_0x581523(0x204)));else _0x3dd9d6[_0x581523(0x221)]===_0x581523(0x203)?console[_0x581523(0x1f1)]('\x20\x20'+_0x154fcd[_0x581523(0x220)](0x11)+'\x20'+a20_0x209774['gray'](_0x581523(0x216))):(console['log']('\x20\x20'+_0x154fcd['padEnd'](0x11)+'\x20'+a20_0x209774[_0x581523(0x20b)](_0x581523(0x1f5))),console['log']('\x20\x20'+''['padEnd'](0x11)+'\x20'+a20_0x209774['red'](_0x3dd9d6[_0x581523(0x228)])));}};_0x37797b('Global',_0x385e7a),_0x37797b(_0x51217b(0x21e),_0x4fd1ba),console[_0x51217b(0x1f1)](),console[_0x51217b(0x1f1)](a20_0x209774[_0x51217b(0x20f)]('\x20\x20Merged\x20Config')),console[_0x51217b(0x1f1)](a20_0x209774['gray'](_0x51217b(0x226)['repeat'](0x1e))),console[_0x51217b(0x1f1)](_0x51217b(0x22c)+(_0x2d270e[_0x51217b(0x205)]||a20_0x209774[_0x51217b(0x20b)]('(not\x20set)'))),console[_0x51217b(0x1f1)]('\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x2d270e['env']);const _0xf68698=isLegacyCompatConfigKey(_0x51217b(0x1f4))?a20_0x209774[_0x51217b(0x1f7)](_0x2d270e['locale']+_0x51217b(0x20a)):_0x2d270e['locale'];return console[_0x51217b(0x1f1)](_0x51217b(0x1f3)+_0xf68698),console[_0x51217b(0x1f1)](_0x51217b(0x225)+(_0x2d270e[_0x51217b(0x200)]||a20_0x209774[_0x51217b(0x1f7)](_0x51217b(0x202)))),console[_0x51217b(0x1f1)](_0x51217b(0x232)+(_0x2d270e[_0x51217b(0x20d)]||a20_0x209774[_0x51217b(0x1f7)]('(none)'))),console['log']('\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x2d270e[_0x51217b(0x20c)]||a20_0x209774[_0x51217b(0x1f7)](_0x51217b(0x1f2)+DEFAULT_CONFIG_VALUES[_0x51217b(0x20c)]+')'))),console[_0x51217b(0x1f1)](_0x51217b(0x1fa)+(_0x2d270e[_0x51217b(0x21a)]??a20_0x209774[_0x51217b(0x1f7)](_0x51217b(0x215)))),console[_0x51217b(0x1f1)]('\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20'+_0x2d270e[_0x51217b(0x22a)]),console['log'](_0x51217b(0x209)+_0x2d270e[_0x51217b(0x22d)]),console[_0x51217b(0x1f1)](_0x51217b(0x231)+AUTH_MODE[_0x51217b(0x227)]),console['log']('\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20'+(_0x2d270e[_0x51217b(0x21b)]?a20_0x209774['green'](_0x51217b(0x1f6)+_0x2d270e[_0x51217b(0x21b)][_0x51217b(0x1ef)]+')'):a20_0x209774[_0x51217b(0x1f7)](_0x51217b(0x202)))),console[_0x51217b(0x1f1)](),console[_0x51217b(0x1f1)](a20_0x209774[_0x51217b(0x20f)](_0x51217b(0x1fc))),console[_0x51217b(0x1f1)](a20_0x209774[_0x51217b(0x1f7)](_0x51217b(0x226)[_0x51217b(0x207)](0x1e))),console[_0x51217b(0x1f1)](_0x51217b(0x212)+getApiDomain()),console[_0x51217b(0x1f1)]('\x20\x20userDomain:\x20\x20\x20\x20\x20\x20'+getUserDomain()),console[_0x51217b(0x1f1)](_0x51217b(0x208)+getRuntimeDomain()),console[_0x51217b(0x1f1)](),console[_0x51217b(0x1f1)](a20_0x209774[_0x51217b(0x20f)](_0x51217b(0x21d))),console[_0x51217b(0x1f1)](a20_0x209774['gray'](_0x51217b(0x226)[_0x51217b(0x207)](0x1e))),console[_0x51217b(0x1f1)]('\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+a20_0x209774[_0x51217b(0x219)](AUTH_MODE['ClientAk']+_0x51217b(0x1f9))),console['log']('\x20\x20Session\x20check:\x20\x20\x20'+a20_0x209774[_0x51217b(0x1f7)](_0x51217b(0x1fd))),console['log'](),{'ok':!![]};}export const doctorDefinition={'service':a20_0x499375(0x22f),'command':a20_0x499375(0x224),'description':a20_0x499375(0x1ff),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a21_0x4cc5c0=a21_0x4989;(function(_0x57f017,_0x5e33a3){const _0x394fe0=a21_0x4989,_0x15ff09=_0x57f017();while(!![]){try{const _0x48d3d1=-parseInt(_0x394fe0(0x141))/0x1*(-parseInt(_0x394fe0(0x130))/0x2)+parseInt(_0x394fe0(0x13b))/0x3*(-parseInt(_0x394fe0(0x156))/0x4)+parseInt(_0x394fe0(0x12d))/0x5*(-parseInt(_0x394fe0(0x161))/0x6)+-parseInt(_0x394fe0(0x12c))/0x7+-parseInt(_0x394fe0(0x139))/0x8*(-parseInt(_0x394fe0(0x13e))/0x9)+parseInt(_0x394fe0(0x168))/0xa*(-parseInt(_0x394fe0(0x163))/0xb)+parseInt(_0x394fe0(0x15c))/0xc;if(_0x48d3d1===_0x5e33a3)break;else _0x15ff09['push'](_0x15ff09['shift']());}catch(_0xf93689){_0x15ff09['push'](_0x15ff09['shift']());}}}(a21_0x21a1,0x238c1));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';function a21_0x21a1(){const _0x3f3e6b=['apiDir','race','apps','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','removeListener','Invalid\x20env\x20\x22','\x0aInitialized\x20','validation','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','question','entries','newConfigFileName','App\x20code','8fPaznV','boolean','Failed\x20to\x20parse\x20source\x20file:\x20','[y/N]','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','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`.','3526032yHjrHu','message','yes','\x20\x20appcode:\x20','name','25446lLfoOr','object','2409bIKOgI','\x20init\x20—\x20Create\x20','):\x20','once','string','530VNqTje','riskLevel','Usage:\x20','flagMissing','stdin','Aborted.','env','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','\x20\x20env:\x20\x20\x20\x20\x20','1098601kqOAsa','85vqnGdd','[Y/n]','log','578fvbisl','\x20\x20default:\x20','Override\x20imported\x20default\x20appcode','Imported\x20from\x20','appcode','global','File\x20','file','trim','15448GfJLef','project','401535AeUKQU',')\x20instead\x20of\x20project','Override\x20imported\x20default\x20env','1017RcMsaV','close','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','491eRErri','cwd','app','Write\x20to\x20global\x20(~/','defaultApp','\x22.\x20Allowed:\x20','SIGINT','utf8'];a21_0x21a1=function(){return _0x3f3e6b;};return a21_0x21a1();}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';function a21_0x4989(_0x4c3b12,_0x1e889c){_0x4c3b12=_0x4c3b12-0x127;const _0x21a106=a21_0x21a1();let _0x4989df=_0x21a106[_0x4c3b12];return _0x4989df;}import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a21_0x4cc5c0(0x134),'type':a21_0x4cc5c0(0x167),'description':'App\x20code\x20for\x20the\x20project'},{'name':a21_0x4cc5c0(0x129),'type':a21_0x4cc5c0(0x167),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES[a21_0x4cc5c0(0x129)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x4cc5c0(0x135),'type':a21_0x4cc5c0(0x157),'description':a21_0x4cc5c0(0x144)+PRODUCT_CONFIG[a21_0x4cc5c0(0x154)]+a21_0x4cc5c0(0x13c),'default':![]},{'name':'yes','type':a21_0x4cc5c0(0x157),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':a21_0x4cc5c0(0x137),'type':a21_0x4cc5c0(0x167),'description':a21_0x4cc5c0(0x14c),'required':!![]},{'name':a21_0x4cc5c0(0x134),'type':a21_0x4cc5c0(0x167),'description':a21_0x4cc5c0(0x132)},{'name':'env','type':a21_0x4cc5c0(0x167),'description':a21_0x4cc5c0(0x13d),'enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x4cc5c0(0x135),'type':'boolean','description':a21_0x4cc5c0(0x144)+PRODUCT_CONFIG[a21_0x4cc5c0(0x154)]+a21_0x4cc5c0(0x13c),'default':![]},{'name':a21_0x4cc5c0(0x15e),'type':a21_0x4cc5c0(0x157),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x1db3f9){const _0x17baab=a21_0x4cc5c0,_0x652324=isNonInteractiveMode(_0x1db3f9),_0x4ceba8=_0x1db3f9['global']?_0x17baab(0x135):_0x17baab(0x13a),_0x213c72=resolveWriteConfigPath(_0x4ceba8);try{_0x652324?await runNonInteractive(_0x1db3f9,_0x213c72):await runInteractive(_0x1db3f9,_0x213c72);}catch(_0x1c1871){if(_0x1c1871 instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0x1c1871;}}export async function runInitImport(_0x3a9b92){const _0x4174f2=a21_0x4cc5c0,_0x1b5836=_0x3a9b92[_0x4174f2(0x135)]?_0x4174f2(0x135):_0x4174f2(0x13a),_0x1bb914=resolveWriteConfigPath(_0x1b5836);await runFromImport(_0x3a9b92,_0x1bb914);}const RUNTIME_IRRELEVANT_KEYS=new Set([a21_0x4cc5c0(0x149)]);async function runFromImport(_0xcb103d,_0x161b59){const _0x1690c5=a21_0x4cc5c0,_0x306067=resolveFilePath(_0xcb103d[_0x1690c5(0x137)]);if(!existsSync(_0x306067))throw CliErrors[_0x1690c5(0x150)]('Source\x20file\x20not\x20found:\x20'+_0x306067);const _0x8d648f=readSourceFile(_0x306067),_0x42e470=convertToRuntimeConfig(_0x8d648f);_0xcb103d[_0x1690c5(0x134)]&&(_0x42e470[_0x1690c5(0x134)]=String(_0xcb103d[_0x1690c5(0x134)]));_0xcb103d['env']&&(_0x42e470[_0x1690c5(0x129)]=resolveInitEnv(_0xcb103d));if(!_0x42e470[_0x1690c5(0x134)])throw CliErrors['validation'](_0x1690c5(0x140),_0x1690c5(0x15b));await writeInitConfig(_0x161b59,_0x42e470,_0xcb103d),console['log'](_0x1690c5(0x133)+_0x306067),console[_0x1690c5(0x12f)]('\x20\x20config:\x20\x20'+_0x161b59),console[_0x1690c5(0x12f)](_0x1690c5(0x15f)+_0x42e470['appcode']);if(_0x42e470[_0x1690c5(0x145)])console[_0x1690c5(0x12f)](_0x1690c5(0x131)+_0x42e470[_0x1690c5(0x145)]);}function convertToRuntimeConfig(_0x51763d){const _0x4c5a67=a21_0x4cc5c0;if(_0x51763d[_0x4c5a67(0x14b)]&&typeof _0x51763d['apps']===_0x4c5a67(0x162))throw CliErrors[_0x4c5a67(0x150)](_0x4c5a67(0x12a),_0x4c5a67(0x15a));const _0x32b8df={};for(const _0x1b7dce of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x51763d[_0x1b7dce]!==undefined&&(_0x32b8df[_0x1b7dce]=_0x51763d[_0x1b7dce]);}return!_0x32b8df[_0x4c5a67(0x169)]&&(_0x32b8df['riskLevel']=DEFAULT_CONFIG_VALUES['riskLevel']),_0x32b8df;}async function runNonInteractive(_0x408514,_0x19d643){const _0x4f3898=a21_0x4cc5c0,_0x571135=_0x408514['appcode'];if(!_0x571135)throw CliErrors[_0x4f3898(0x16b)](_0x4f3898(0x134),_0x4f3898(0x16a)+CLI_BIN_NAME+_0x4f3898(0x151));const _0x3dabae=resolveInitEnv(_0x408514);await writeInitConfig(_0x19d643,{'appcode':_0x571135,'env':_0x3dabae},_0x408514),console[_0x4f3898(0x12f)]('Initialized\x20'+_0x19d643),console[_0x4f3898(0x12f)](_0x4f3898(0x15f)+_0x571135),console[_0x4f3898(0x12f)](_0x4f3898(0x12b)+_0x3dabae);}async function runInteractive(_0x13e9c1,_0x36f319){const _0x790032=a21_0x4cc5c0,_0x417be5=loadExisting(_0x36f319),_0x5e0a44=typeof _0x417be5?.[_0x790032(0x134)]==='string'?_0x417be5['appcode']:'',_0xdd2dc7=resolveInitEnv(_0x13e9c1);console[_0x790032(0x12f)](CLI_BIN_NAME+_0x790032(0x164)+PRODUCT_CONFIG[_0x790032(0x154)]+'\x0a');if(existsSync(_0x36f319)&&!_0x13e9c1['yes']){const _0x12bafd=await promptYesNo(_0x790032(0x136)+_0x36f319+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x12bafd){console[_0x790032(0x12f)](_0x790032(0x128));return;}}const _0x2276aa=typeof _0x13e9c1[_0x790032(0x134)]===_0x790032(0x167)?_0x13e9c1[_0x790032(0x134)][_0x790032(0x138)]():'';let _0x1182ae=_0x2276aa;!_0x1182ae&&(_0x1182ae=await promptInput(_0x790032(0x155),_0x5e0a44));if(!_0x1182ae[_0x790032(0x138)]())throw CliErrors[_0x790032(0x150)]('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x36f319,{'appcode':_0x1182ae[_0x790032(0x138)](),'env':_0xdd2dc7},_0x13e9c1),console[_0x790032(0x12f)](_0x790032(0x14f)+_0x36f319),console['log'](_0x790032(0x15f)+_0x1182ae['trim']()),console['log'](_0x790032(0x12b)+_0xdd2dc7);}async function writeInitConfig(_0xe1c443,_0x57b595,_0x48ccf4){const _0x165d9d=a21_0x4cc5c0;let _0x4cd3f7={};existsSync(_0xe1c443)&&!_0x48ccf4[_0x165d9d(0x15e)]&&(_0x4cd3f7=readConfigFile(_0xe1c443));for(const [_0x3655db,_0x371d1f]of Object[_0x165d9d(0x153)](_0x57b595)){_0x371d1f!==undefined&&(_0x4cd3f7[_0x3655db]=_0x371d1f);}if(_0x4cd3f7['app'])delete _0x4cd3f7[_0x165d9d(0x143)];writeConfigFile(_0xe1c443,_0x4cd3f7);}class AbortPrompt extends Error{constructor(){const _0x5bca39=a21_0x4cc5c0;super('User\x20aborted\x20prompt'),this[_0x5bca39(0x160)]='AbortPrompt';}}function createSafeRl(){const _0x4c5895=a21_0x4cc5c0,_0x278e3c=createInterface({'input':process[_0x4c5895(0x127)],'output':process['stdout']});let _0x367280;const _0x2ffebc=new Promise((_0x20d890,_0x4855f8)=>{const _0x299b81=_0x4c5895;_0x367280=()=>{const _0x31ddd8=a21_0x4989;_0x367280&&(_0x278e3c[_0x31ddd8(0x14d)](_0x31ddd8(0x147),_0x367280),_0x367280=undefined);try{_0x278e3c[_0x31ddd8(0x13f)]();}catch{}_0x4855f8(new AbortPrompt());},_0x278e3c[_0x299b81(0x166)](_0x299b81(0x147),_0x367280);}),_0x35224c=()=>{const _0x15c57=_0x4c5895;_0x367280&&(_0x278e3c[_0x15c57(0x14d)]('SIGINT',_0x367280),_0x367280=undefined);try{_0x278e3c['close']();}catch{}};return{'rl':_0x278e3c,'abortPromise':_0x2ffebc,'disposeSuccess':_0x35224c};}async function promptInput(_0x4841ad,_0x43b006){const _0x59d176=a21_0x4cc5c0,{rl:_0x231a2f,abortPromise:_0x5f07fa,disposeSuccess:_0x4e78a7}=createSafeRl(),_0x2a0832=new Promise(_0x131692=>{const _0x370399=a21_0x4989,_0x53bccc=_0x43b006?'\x20\x20'+_0x4841ad+'\x20('+_0x43b006+_0x370399(0x165):'\x20\x20'+_0x4841ad+':\x20';_0x231a2f[_0x370399(0x152)](_0x53bccc,_0x108df5=>{const _0x395464=_0x370399;_0x4e78a7(),_0x131692(_0x108df5[_0x395464(0x138)]()||_0x43b006);});});return Promise[_0x59d176(0x14a)]([_0x2a0832,_0x5f07fa]);}async function promptYesNo(_0x5cfef2,_0x4b458a){const _0x4d375e=a21_0x4cc5c0,{rl:_0x10139a,abortPromise:_0x4a663b,disposeSuccess:_0x1ad355}=createSafeRl(),_0x2a1db1=new Promise(_0x4e458b=>{const _0x226ba7=a21_0x4989,_0x4d797d=_0x4b458a?_0x226ba7(0x12e):_0x226ba7(0x159);_0x10139a[_0x226ba7(0x152)]('\x20\x20'+_0x5cfef2+'\x20'+_0x4d797d+':\x20',_0x345451=>{const _0xbf24=_0x226ba7;_0x1ad355();const _0x226a2c=_0x345451[_0xbf24(0x138)]()['toLowerCase']();if(_0x226a2c==='y'||_0x226a2c==='yes')_0x4e458b(!![]);else{if(_0x226a2c==='n'||_0x226a2c==='no')_0x4e458b(![]);else _0x4e458b(_0x4b458a);}});});return Promise[_0x4d375e(0x14a)]([_0x2a1db1,_0x4a663b]);}function loadExisting(_0x271321){if(!existsSync(_0x271321))return null;return readConfigFile(_0x271321);}function resolveFilePath(_0x16cfc1){const _0x138221=a21_0x4cc5c0;return isAbsolute(_0x16cfc1)?_0x16cfc1:resolve(process[_0x138221(0x142)](),_0x16cfc1);}function readSourceFile(_0x2810ff){const _0x54c377=a21_0x4cc5c0;try{const _0x4a0541=readFileSync(_0x2810ff,{'encoding':_0x54c377(0x148)});return JSON['parse'](_0x4a0541);}catch(_0x1204b0){throw CliErrors[_0x54c377(0x150)](_0x54c377(0x158)+_0x1204b0[_0x54c377(0x15d)]);}}function resolveInitEnv(_0xa05c9){const _0x544634=a21_0x4cc5c0,_0x1c2b7a=_0xa05c9[_0x544634(0x129)];if(_0x1c2b7a===undefined||_0x1c2b7a==='')return DEFAULT_CONFIG_VALUES[_0x544634(0x129)];if(!RUNTIME_ENV_VALUES['includes'](_0x1c2b7a))throw CliErrors[_0x544634(0x150)](_0x544634(0x14e)+_0x1c2b7a+_0x544634(0x146)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x1c2b7a;}
|
|
1
|
+
const a21_0x2993af=a21_0xfb29;(function(_0x17f2df,_0x381e66){const _0x6a211d=a21_0xfb29,_0x108b5d=_0x17f2df();while(!![]){try{const _0x4629ad=-parseInt(_0x6a211d(0x124))/0x1*(-parseInt(_0x6a211d(0x150))/0x2)+parseInt(_0x6a211d(0x14e))/0x3*(parseInt(_0x6a211d(0x129))/0x4)+parseInt(_0x6a211d(0x116))/0x5*(-parseInt(_0x6a211d(0x119))/0x6)+-parseInt(_0x6a211d(0x141))/0x7+parseInt(_0x6a211d(0x123))/0x8*(parseInt(_0x6a211d(0x149))/0x9)+-parseInt(_0x6a211d(0x125))/0xa+parseInt(_0x6a211d(0x145))/0xb;if(_0x4629ad===_0x381e66)break;else _0x108b5d['push'](_0x108b5d['shift']());}catch(_0x5e5d5b){_0x108b5d['push'](_0x108b5d['shift']());}}}(a21_0x5c21,0xb1d06));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';function a21_0xfb29(_0x161857,_0x2b9456){_0x161857=_0x161857-0x116;const _0x5c21d4=a21_0x5c21();let _0xfb2935=_0x5c21d4[_0x161857];return _0xfb2935;}function a21_0x5c21(){const _0xb7e14a=['apps','[y/N]','yes','Write\x20to\x20global\x20(~/','\x20\x20env:\x20\x20\x20\x20\x20','appcode','App\x20code','stdin','entries','apiDir','Invalid\x20env\x20\x22','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','name','User\x20aborted\x20prompt','5XCrTEW','cwd','Skip\x20confirmation\x20when\x20overwriting','7526238TBEVCN','App\x20code\x20for\x20the\x20project','Initialized\x20','Target\x20environment\x20(default\x20','App\x20code\x20cannot\x20be\x20empty.','join','\x20\x20appcode:\x20','\x20already\x20exists.\x20Overwrite?','riskLevel','includes','204712jWRgiu','165fgdQJg','11068660QjMkQR','app','\x22.\x20Allowed:\x20','question','30996exLive','log','message','AbortPrompt','):\x20','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','env','once','validation','File\x20','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Failed\x20to\x20parse\x20source\x20file:\x20','race','file',')\x20instead\x20of\x20project','cancelled','global','Source\x20file\x20not\x20found:\x20','boolean','project','Override\x20imported\x20default\x20appcode','SIGINT','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','defaultApp','6828710SjCqZR','Override\x20imported\x20default\x20env','\x20\x20default:\x20','string','13486143ysWODx','close','\x20init\x20—\x20Create\x20','stdout','360zZJGOK','newConfigFileName','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','removeListener','Imported\x20from\x20','399WyqxvG','trim','9514dSkQqQ'];a21_0x5c21=function(){return _0xb7e14a;};return a21_0x5c21();}import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':'appcode','type':'string','description':a21_0x2993af(0x11a)},{'name':a21_0x2993af(0x12f),'type':a21_0x2993af(0x144),'description':a21_0x2993af(0x11c)+DEFAULT_CONFIG_VALUES['env']+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x2993af(0x139),'type':a21_0x2993af(0x13b),'description':a21_0x2993af(0x154)+PRODUCT_CONFIG['newConfigFileName']+a21_0x2993af(0x137),'default':![]},{'name':a21_0x2993af(0x153),'type':a21_0x2993af(0x13b),'description':a21_0x2993af(0x118),'default':![]}];export const initImportFlagDefs=[{'name':a21_0x2993af(0x136),'type':a21_0x2993af(0x144),'description':a21_0x2993af(0x14b),'required':!![]},{'name':a21_0x2993af(0x156),'type':a21_0x2993af(0x144),'description':a21_0x2993af(0x13d)},{'name':a21_0x2993af(0x12f),'type':a21_0x2993af(0x144),'description':a21_0x2993af(0x142),'enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x2993af(0x139),'type':a21_0x2993af(0x13b),'description':a21_0x2993af(0x154)+PRODUCT_CONFIG[a21_0x2993af(0x14a)]+')\x20instead\x20of\x20project','default':![]},{'name':a21_0x2993af(0x153),'type':a21_0x2993af(0x13b),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x384f25){const _0x5e8dad=a21_0x2993af,_0x144147=isNonInteractiveMode(_0x384f25),_0x2ceb88=_0x384f25[_0x5e8dad(0x139)]?'global':_0x5e8dad(0x13c),_0x46e42e=resolveWriteConfigPath(_0x2ceb88);try{_0x144147?await runNonInteractive(_0x384f25,_0x46e42e):await runInteractive(_0x384f25,_0x46e42e);}catch(_0x1da400){if(_0x1da400 instanceof AbortPrompt)throw CliErrors[_0x5e8dad(0x138)]();throw _0x1da400;}}export async function runInitImport(_0x2d9f73){const _0x25e3d8=a21_0x2993af,_0x4b9910=_0x2d9f73['global']?'global':_0x25e3d8(0x13c),_0x4e4dc1=resolveWriteConfigPath(_0x4b9910);await runFromImport(_0x2d9f73,_0x4e4dc1);}const RUNTIME_IRRELEVANT_KEYS=new Set([a21_0x2993af(0x15a)]);async function runFromImport(_0x4b9af7,_0x49db2d){const _0x63a5b1=a21_0x2993af,_0x10db9f=resolveFilePath(_0x4b9af7['file']);if(!existsSync(_0x10db9f))throw CliErrors[_0x63a5b1(0x131)](_0x63a5b1(0x13a)+_0x10db9f);const _0x477183=readSourceFile(_0x10db9f),_0x2beb41=convertToRuntimeConfig(_0x477183);_0x4b9af7[_0x63a5b1(0x156)]&&(_0x2beb41[_0x63a5b1(0x156)]=String(_0x4b9af7[_0x63a5b1(0x156)]));_0x4b9af7[_0x63a5b1(0x12f)]&&(_0x2beb41[_0x63a5b1(0x12f)]=resolveInitEnv(_0x4b9af7));if(!_0x2beb41[_0x63a5b1(0x156)])throw CliErrors[_0x63a5b1(0x131)](_0x63a5b1(0x15c),'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(_0x49db2d,_0x2beb41,_0x4b9af7),console[_0x63a5b1(0x12a)](_0x63a5b1(0x14d)+_0x10db9f),console[_0x63a5b1(0x12a)]('\x20\x20config:\x20\x20'+_0x49db2d),console[_0x63a5b1(0x12a)](_0x63a5b1(0x11f)+_0x2beb41[_0x63a5b1(0x156)]);if(_0x2beb41[_0x63a5b1(0x140)])console[_0x63a5b1(0x12a)](_0x63a5b1(0x143)+_0x2beb41[_0x63a5b1(0x140)]);}function convertToRuntimeConfig(_0x3565a4){const _0x16bec1=a21_0x2993af;if(_0x3565a4['apps']&&typeof _0x3565a4[_0x16bec1(0x151)]==='object')throw CliErrors[_0x16bec1(0x131)](_0x16bec1(0x133),_0x16bec1(0x13f));const _0x5113c5={};for(const _0x1b4613 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x3565a4[_0x1b4613]!==undefined&&(_0x5113c5[_0x1b4613]=_0x3565a4[_0x1b4613]);}return!_0x5113c5['riskLevel']&&(_0x5113c5[_0x16bec1(0x121)]=DEFAULT_CONFIG_VALUES[_0x16bec1(0x121)]),_0x5113c5;}async function runNonInteractive(_0x2b1412,_0x45e76b){const _0x7655b=a21_0x2993af,_0x31ef23=_0x2b1412['appcode'];if(!_0x31ef23)throw CliErrors['flagMissing'](_0x7655b(0x156),'Usage:\x20'+CLI_BIN_NAME+_0x7655b(0x12e));const _0x2999bd=resolveInitEnv(_0x2b1412);await writeInitConfig(_0x45e76b,{'appcode':_0x31ef23,'env':_0x2999bd},_0x2b1412),console['log'](_0x7655b(0x11b)+_0x45e76b),console[_0x7655b(0x12a)](_0x7655b(0x11f)+_0x31ef23),console[_0x7655b(0x12a)](_0x7655b(0x155)+_0x2999bd);}async function runInteractive(_0xa472de,_0x34c46a){const _0x3200f8=a21_0x2993af,_0x2d884b=loadExisting(_0x34c46a),_0x49fcd1=typeof _0x2d884b?.['appcode']===_0x3200f8(0x144)?_0x2d884b[_0x3200f8(0x156)]:'',_0x1ac2c1=resolveInitEnv(_0xa472de);console[_0x3200f8(0x12a)](CLI_BIN_NAME+_0x3200f8(0x147)+PRODUCT_CONFIG[_0x3200f8(0x14a)]+'\x0a');if(existsSync(_0x34c46a)&&!_0xa472de[_0x3200f8(0x153)]){const _0x29eff7=await promptYesNo(_0x3200f8(0x132)+_0x34c46a+_0x3200f8(0x120),![]);if(!_0x29eff7){console[_0x3200f8(0x12a)]('Aborted.');return;}}const _0x316003=typeof _0xa472de[_0x3200f8(0x156)]===_0x3200f8(0x144)?_0xa472de['appcode'][_0x3200f8(0x14f)]():'';let _0x25f9c5=_0x316003;!_0x25f9c5&&(_0x25f9c5=await promptInput(_0x3200f8(0x157),_0x49fcd1));if(!_0x25f9c5[_0x3200f8(0x14f)]())throw CliErrors[_0x3200f8(0x131)](_0x3200f8(0x11d));await writeInitConfig(_0x34c46a,{'appcode':_0x25f9c5['trim'](),'env':_0x1ac2c1},_0xa472de),console[_0x3200f8(0x12a)]('\x0aInitialized\x20'+_0x34c46a),console[_0x3200f8(0x12a)](_0x3200f8(0x11f)+_0x25f9c5[_0x3200f8(0x14f)]()),console[_0x3200f8(0x12a)](_0x3200f8(0x155)+_0x1ac2c1);}async function writeInitConfig(_0x471dcf,_0x3c25f7,_0x221e70){const _0x140ae1=a21_0x2993af;let _0x5097a8={};existsSync(_0x471dcf)&&!_0x221e70[_0x140ae1(0x153)]&&(_0x5097a8=readConfigFile(_0x471dcf));for(const [_0x738e4e,_0x141327]of Object[_0x140ae1(0x159)](_0x3c25f7)){_0x141327!==undefined&&(_0x5097a8[_0x738e4e]=_0x141327);}if(_0x5097a8['app'])delete _0x5097a8[_0x140ae1(0x126)];writeConfigFile(_0x471dcf,_0x5097a8);}class AbortPrompt extends Error{constructor(){const _0xdaec8b=a21_0x2993af;super(_0xdaec8b(0x15e)),this[_0xdaec8b(0x15d)]=_0xdaec8b(0x12c);}}function createSafeRl(){const _0x34d30b=a21_0x2993af,_0x375077=createInterface({'input':process[_0x34d30b(0x158)],'output':process[_0x34d30b(0x148)]});let _0x369693;const _0x120795=new Promise((_0x4a4301,_0x11cf93)=>{const _0x1841b5=_0x34d30b;_0x369693=()=>{const _0x2d98ba=a21_0xfb29;_0x369693&&(_0x375077[_0x2d98ba(0x14c)](_0x2d98ba(0x13e),_0x369693),_0x369693=undefined);try{_0x375077['close']();}catch{}_0x11cf93(new AbortPrompt());},_0x375077[_0x1841b5(0x130)](_0x1841b5(0x13e),_0x369693);}),_0x2daf85=()=>{const _0x4e069c=_0x34d30b;_0x369693&&(_0x375077[_0x4e069c(0x14c)](_0x4e069c(0x13e),_0x369693),_0x369693=undefined);try{_0x375077[_0x4e069c(0x146)]();}catch{}};return{'rl':_0x375077,'abortPromise':_0x120795,'disposeSuccess':_0x2daf85};}async function promptInput(_0x520d8a,_0x3be67b){const {rl:_0x18d097,abortPromise:_0x11cfc4,disposeSuccess:_0x2ca755}=createSafeRl(),_0x2196d4=new Promise(_0x1972ac=>{const _0xab51af=a21_0xfb29,_0xd616d1=_0x3be67b?'\x20\x20'+_0x520d8a+'\x20('+_0x3be67b+_0xab51af(0x12d):'\x20\x20'+_0x520d8a+':\x20';_0x18d097[_0xab51af(0x128)](_0xd616d1,_0x154cc3=>{const _0x20e33e=_0xab51af;_0x2ca755(),_0x1972ac(_0x154cc3[_0x20e33e(0x14f)]()||_0x3be67b);});});return Promise['race']([_0x2196d4,_0x11cfc4]);}async function promptYesNo(_0x56cd9d,_0x47137f){const _0x21b112=a21_0x2993af,{rl:_0x40cc21,abortPromise:_0x190c11,disposeSuccess:_0x3004bf}=createSafeRl(),_0x352dad=new Promise(_0x57d7a4=>{const _0x257eee=a21_0xfb29,_0x2561bd=_0x47137f?'[Y/n]':_0x257eee(0x152);_0x40cc21['question']('\x20\x20'+_0x56cd9d+'\x20'+_0x2561bd+':\x20',_0x35e1d0=>{const _0x2d586a=_0x257eee;_0x3004bf();const _0x57c9b7=_0x35e1d0['trim']()['toLowerCase']();if(_0x57c9b7==='y'||_0x57c9b7===_0x2d586a(0x153))_0x57d7a4(!![]);else{if(_0x57c9b7==='n'||_0x57c9b7==='no')_0x57d7a4(![]);else _0x57d7a4(_0x47137f);}});});return Promise[_0x21b112(0x135)]([_0x352dad,_0x190c11]);}function loadExisting(_0xfcf617){if(!existsSync(_0xfcf617))return null;return readConfigFile(_0xfcf617);}function resolveFilePath(_0x441c4b){const _0x275ddf=a21_0x2993af;return isAbsolute(_0x441c4b)?_0x441c4b:resolve(process[_0x275ddf(0x117)](),_0x441c4b);}function readSourceFile(_0x51f2f3){const _0x5b9c0e=a21_0x2993af;try{const _0x18e481=readFileSync(_0x51f2f3,{'encoding':'utf8'});return JSON['parse'](_0x18e481);}catch(_0x2119a7){throw CliErrors[_0x5b9c0e(0x131)](_0x5b9c0e(0x134)+_0x2119a7[_0x5b9c0e(0x12b)]);}}function resolveInitEnv(_0x5e8d7b){const _0x1d0869=a21_0x2993af,_0x118dff=_0x5e8d7b[_0x1d0869(0x12f)];if(_0x118dff===undefined||_0x118dff==='')return DEFAULT_CONFIG_VALUES[_0x1d0869(0x12f)];if(!RUNTIME_ENV_VALUES[_0x1d0869(0x122)](_0x118dff))throw CliErrors[_0x1d0869(0x131)](_0x1d0869(0x15b)+_0x118dff+_0x1d0869(0x127)+RUNTIME_ENV_VALUES[_0x1d0869(0x11e)](',\x20'));return _0x118dff;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a22_0x210ea7=a22_0x3be9;(function(_0x1032b1,_0x118a84){const _0x154cd6=a22_0x3be9,_0x4c6d2a=_0x1032b1();while(!![]){try{const _0x1954e8=parseInt(_0x154cd6(0x1b2))/0x1*(parseInt(_0x154cd6(0x1c1))/0x2)+parseInt(_0x154cd6(0x1be))/0x3+parseInt(_0x154cd6(0x194))/0x4*(parseInt(_0x154cd6(0x1a3))/0x5)+-parseInt(_0x154cd6(0x1cb))/0x6+parseInt(_0x154cd6(0x1bb))/0x7*(-parseInt(_0x154cd6(0x196))/0x8)+-parseInt(_0x154cd6(0x195))/0x9*(parseInt(_0x154cd6(0x1c9))/0xa)+-parseInt(_0x154cd6(0x1ac))/0xb*(-parseInt(_0x154cd6(0x1b6))/0xc);if(_0x1954e8===_0x118a84)break;else _0x4c6d2a['push'](_0x4c6d2a['shift']());}catch(_0x7d6ee){_0x4c6d2a['push'](_0x4c6d2a['shift']());}}}(a22_0x3d02,0x79345));import{existsSync,readFileSync,statSync}from'node:fs';function a22_0x3d02(){const _0x1b0631=['str','2148966XYfsrg','length','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','62QxccEO','score','update','Override\x20the\x20existing\x20entry\x20title','userId','validation','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','body','2110RfCSJg','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','2594448hJQMhF','scope','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','bool','list','Updated\x20KB\x20entry\x20','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','Personal\x20knowledge-base\x20entry\x20ID','File\x20is\x20not\x20a\x20regular\x20file:\x20','createTime','verbose','appCode','537052MbZwDt','20844GQKHwC','472IUIufv','ragErrorMessage','map','detail','file','utf8','content','/client/knowledge-base/personal/','ragStatus','flag','build','query','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','10uUehFG','metadata','num','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','description','--topk\x20must\x20be\x20a\x20positive\x20number.','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','File\x20path\x20is\x20required.','read','11DmnUPw','topk','trim','updateTime','search','/client/knowledge-base/personal/create','27053QvAwta','write','isFinite','string','2243244yWiTJd','number','weightedScore','title','docId','70343QyXTBK','create'];a22_0x3d02=function(){return _0x1b0631;};return a22_0x3d02();}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';function a22_0x3be9(_0x526c07,_0x4fe453){_0x526c07=_0x526c07-0x18a;const _0x3d022d=a22_0x3d02();let _0x3be912=_0x3d022d[_0x526c07];return _0x3be912;}const TITLE_FLAG={'name':'title','type':a22_0x210ea7(0x1b5),'required':!![],'description':'Personal\x20knowledge-base\x20entry\x20title'},FILE_FLAG={'name':'file','type':'string','required':!![],'description':a22_0x210ea7(0x1a6)},QUERY_FLAG={'name':a22_0x210ea7(0x1a1),'type':a22_0x210ea7(0x1b5),'required':!![],'description':a22_0x210ea7(0x1c0)},TOPK_FLAG={'name':a22_0x210ea7(0x1ad),'type':a22_0x210ea7(0x1b7),'description':a22_0x210ea7(0x1a2)};function readKnowledgeFile(_0x27a31a){const _0x463d51=a22_0x210ea7;if(!_0x27a31a)throw CliErrors[_0x463d51(0x1c6)](_0x463d51(0x1aa));if(!existsSync(_0x27a31a))throw CliErrors[_0x463d51(0x1c6)]('File\x20not\x20found:\x20'+_0x27a31a);if(!statSync(_0x27a31a)['isFile']())throw CliErrors[_0x463d51(0x1c6)](_0x463d51(0x190)+_0x27a31a);return readFileSync(_0x27a31a,_0x463d51(0x19b));}function summarizePersonalItem(_0x32a6cb){const _0x444466=a22_0x210ea7;return{'id':_0x32a6cb['id'],'title':_0x32a6cb[_0x444466(0x1b9)],'version':_0x32a6cb['version'],'ragStatus':_0x32a6cb[_0x444466(0x19e)],'ragErrorMessage':_0x32a6cb[_0x444466(0x197)],'updateTime':_0x32a6cb[_0x444466(0x1af)]};}function detailPersonalItem(_0x31e15f){const _0x15dd53=a22_0x210ea7;return{'id':_0x31e15f['id'],'appCode':_0x31e15f[_0x15dd53(0x193)],'scope':_0x31e15f[_0x15dd53(0x1cc)],'userId':_0x31e15f[_0x15dd53(0x1c5)],'title':_0x31e15f[_0x15dd53(0x1b9)],'content':_0x31e15f[_0x15dd53(0x19c)]??'','version':_0x31e15f['version'],'ragStatus':_0x31e15f[_0x15dd53(0x19e)],'ragErrorMessage':_0x31e15f['ragErrorMessage'],'createTime':_0x31e15f[_0x15dd53(0x191)],'updateTime':_0x31e15f[_0x15dd53(0x1af)]};}function summarizeSearchHit(_0x3f6e21){const _0x50e7ba=a22_0x210ea7;return{'scope':_0x3f6e21['scope'],'docId':_0x3f6e21[_0x50e7ba(0x1ba)],'score':_0x3f6e21[_0x50e7ba(0x1c2)],'weightedScore':_0x3f6e21[_0x50e7ba(0x1b8)],'content':_0x3f6e21[_0x50e7ba(0x19c)],'metadata':_0x3f6e21[_0x50e7ba(0x1a4)]};}function readTopK(_0x188d9f){const _0x34e233=a22_0x210ea7,_0x295844=_0x188d9f[_0x34e233(0x19f)](_0x34e233(0x1ad));if(_0x295844===undefined||_0x295844===null||_0x295844==='')return undefined;const _0x1d36cf=_0x188d9f[_0x34e233(0x1a5)](_0x34e233(0x1ad));if(!Number[_0x34e233(0x1b4)](_0x1d36cf)||_0x1d36cf<0x1)throw CliErrors[_0x34e233(0x1c6)](_0x34e233(0x1a8));return _0x1d36cf;}const kbList={'service':'kb','command':a22_0x210ea7(0x18b),'description':'List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','risk':a22_0x210ea7(0x1ab),'flags':[VERBOSE_FLAG],async 'execute'(_0x503880){const _0x2ef9e6=a22_0x210ea7,_0xa75159=await listPersonalKnowledgeBaseItems(_0x503880[_0x2ef9e6(0x193)]);if(_0x503880[_0x2ef9e6(0x18a)](_0x2ef9e6(0x192)))return{'ok':!![],'data':{'total':_0xa75159['length'],'items':_0xa75159}};return{'ok':!![],'data':{'total':_0xa75159['length'],'items':_0xa75159[_0x2ef9e6(0x198)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a22_0x210ea7(0x199),'description':a22_0x210ea7(0x18e),'risk':a22_0x210ea7(0x1ab),'flags':[{...ID_FLAG,'description':'Personal\x20knowledge-base\x20entry\x20ID'}],async 'execute'(_0x20936e){const _0x2560e5=a22_0x210ea7,_0x2bb522=await getPersonalKnowledgeBaseItem(_0x20936e['num']('id'),_0x20936e[_0x2560e5(0x193)]);return{'ok':!![],'data':detailPersonalItem(_0x2bb522)};}},kbCreate={'service':'kb','command':a22_0x210ea7(0x1bc),'description':a22_0x210ea7(0x1cd),'risk':a22_0x210ea7(0x1b3),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0xccfe10){const _0x32831b=a22_0x210ea7,_0x21fdf3=_0xccfe10[_0x32831b(0x1bd)]('title'),_0xc01b7=readKnowledgeFile(_0xccfe10[_0x32831b(0x1bd)](_0x32831b(0x19a))),_0xcfb62=await createPersonalKnowledgeBaseItem(_0xccfe10[_0x32831b(0x193)],{'title':_0x21fdf3,'content':_0xc01b7});return{'ok':!![],'data':summarizePersonalItem(_0xcfb62),'message':'Created\x20KB\x20entry\x20'+_0xcfb62['id']+'\x20('+_0xcfb62[_0x32831b(0x1b9)]+')'};},async 'dryRun'(_0x59a33c){const _0x10212a=a22_0x210ea7,_0x1c8f1b=_0x59a33c[_0x10212a(0x1bd)]('title'),_0x4f38b7=readKnowledgeFile(_0x59a33c[_0x10212a(0x1bd)](_0x10212a(0x19a)));return dryRun('POST',_0x10212a(0x1b1))['body']({'appCode':_0x59a33c['appCode'],'title':_0x1c8f1b,'content':_0x4f38b7})[_0x10212a(0x1a7)](_0x10212a(0x1c7)+_0x1c8f1b+'\x22')[_0x10212a(0x1a0)]();}},kbUpdate={'service':'kb','command':a22_0x210ea7(0x1c3),'description':a22_0x210ea7(0x1a9),'risk':a22_0x210ea7(0x1b3),'flags':[{...ID_FLAG,'description':a22_0x210ea7(0x18f)},{...TITLE_FLAG,'required':![],'description':a22_0x210ea7(0x1c4)},FILE_FLAG],async 'execute'(_0x191b81){const _0x586e34=a22_0x210ea7,_0x4ff4b7=_0x191b81[_0x586e34(0x1a5)]('id'),_0x47f5eb=readKnowledgeFile(_0x191b81[_0x586e34(0x1bd)](_0x586e34(0x19a))),_0x314cbc=_0x191b81[_0x586e34(0x1bd)](_0x586e34(0x1b9))||(await getPersonalKnowledgeBaseItem(_0x4ff4b7,_0x191b81['appCode']))[_0x586e34(0x1b9)],_0x2d8496=await updatePersonalKnowledgeBaseItem(_0x4ff4b7,_0x191b81[_0x586e34(0x193)],{'title':_0x314cbc,'content':_0x47f5eb});return{'ok':!![],'data':summarizePersonalItem(_0x2d8496),'message':_0x586e34(0x18c)+_0x2d8496['id']+'\x20('+_0x2d8496[_0x586e34(0x1b9)]+')'};},async 'dryRun'(_0x14c96b){const _0x3db8b3=a22_0x210ea7,_0x224bd9=_0x14c96b[_0x3db8b3(0x1a5)]('id'),_0x28d338=readKnowledgeFile(_0x14c96b[_0x3db8b3(0x1bd)]('file')),_0x2ce089=_0x14c96b[_0x3db8b3(0x1bd)]('title')||(await getPersonalKnowledgeBaseItem(_0x224bd9,_0x14c96b['appCode']))[_0x3db8b3(0x1b9)];return dryRun('POST',_0x3db8b3(0x19d)+_0x224bd9+'/update')[_0x3db8b3(0x1c8)]({'appCode':_0x14c96b['appCode'],'title':_0x2ce089,'content':_0x28d338})['description'](_0x3db8b3(0x18d)+_0x224bd9)['build']();}},kbSearch={'service':'kb','command':a22_0x210ea7(0x1b0),'description':a22_0x210ea7(0x1ca),'risk':a22_0x210ea7(0x1ab),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x4e97e5){const _0x70e730=a22_0x210ea7;if(!_0x4e97e5[_0x70e730(0x1bd)]('query')[_0x70e730(0x1ae)]())throw CliErrors['validation']('Search\x20query\x20is\x20required.');readTopK(_0x4e97e5);},async 'execute'(_0x42d487){const _0x5994bd=a22_0x210ea7,_0x3de1ed=_0x42d487[_0x5994bd(0x1bd)](_0x5994bd(0x1a1))[_0x5994bd(0x1ae)](),_0x139a45=readTopK(_0x42d487),_0x5b23c5=await searchKnowledgeBase(_0x42d487[_0x5994bd(0x193)],{'query':_0x3de1ed,'topK':_0x139a45});return{'ok':!![],'data':{'total':_0x5b23c5[_0x5994bd(0x1bf)],'hits':_0x5b23c5['map'](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a23_0xd373(){const _0x408638=['1982exBQvr','forEach','490156ozOXYr','level','*\x20No\x20logs\x20found','readLogs','en-US','message','677fSmdcO','show','command','read','2630pSqeto','length','*\x20Logs\x20cleared','5nIErPe','\x20\x20\x20Time:\x20','\x20\x20\x20Duration:\x20','3408372MbXUGX','details','clearLogs','clear','error','keys','Clear\x20command\x20history\x20logs','23769PwEAms','5199424BgQUXX','6629XBdJsV','logs','\x20logs:\x0a','write','174hJTMfT','827055PuiYkW','log','View\x20command\x20history\x20logs','stringify'];a23_0xd373=function(){return _0x408638;};return a23_0xd373();}const a23_0x497a3d=a23_0x57fe;(function(_0xbb587f,_0x5c2a29){const _0xd9ef75=a23_0x57fe,_0x34ff74=_0xbb587f();while(!![]){try{const _0x96ab8=parseInt(_0xd9ef75(0x101))/0x1*(parseInt(_0xd9ef75(0xf9))/0x2)+-parseInt(_0xd9ef75(0x119))/0x3+parseInt(_0xd9ef75(0xfb))/0x4*(-parseInt(_0xd9ef75(0x108))/0x5)+-parseInt(_0xd9ef75(0x118))/0x6*(-parseInt(_0xd9ef75(0x114))/0x7)+parseInt(_0xd9ef75(0x113))/0x8+-parseInt(_0xd9ef75(0x112))/0x9*(parseInt(_0xd9ef75(0x105))/0xa)+parseInt(_0xd9ef75(0x10b))/0xb;if(_0x96ab8===_0x5c2a29)break;else _0x34ff74['push'](_0x34ff74['shift']());}catch(_0xa72d92){_0x34ff74['push'](_0x34ff74['shift']());}}}(a23_0xd373,0x8a05f));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x2ced60){const _0x4e1a05=a23_0x57fe;if(_0x2ced60[_0x4e1a05(0x106)]===0x0){console[_0x4e1a05(0x11a)](_0x4e1a05(0xfd));return;}console[_0x4e1a05(0x11a)]('*\x20'+CLI_DISPLAY_NAME+_0x4e1a05(0x116)),_0x2ced60[_0x4e1a05(0xfa)]((_0x173f8c,_0x4eecc2)=>{const _0x5bc90f=_0x4e1a05,_0x3d0769=new Date(_0x173f8c['timestamp'])['toLocaleString'](_0x5bc90f(0xff)),_0x413dc2=_0x173f8c[_0x5bc90f(0xfc)]==='success'?'√':_0x173f8c[_0x5bc90f(0xfc)]===_0x5bc90f(0x10f)?'×':_0x173f8c['level']==='warn'?'!':'i';console[_0x5bc90f(0x11a)](_0x4eecc2+0x1+'.\x20'+_0x413dc2+'\x20['+_0x173f8c[_0x5bc90f(0x103)]+']\x20'+_0x173f8c[_0x5bc90f(0x100)]),console[_0x5bc90f(0x11a)](_0x5bc90f(0x109)+_0x3d0769),_0x173f8c['duration']&&console[_0x5bc90f(0x11a)](_0x5bc90f(0x10a)+_0x173f8c['duration']+'ms'),_0x173f8c[_0x5bc90f(0x10c)]&&Object[_0x5bc90f(0x110)](_0x173f8c[_0x5bc90f(0x10c)])[_0x5bc90f(0x106)]>0x0&&console[_0x5bc90f(0x11a)]('\x20\x20\x20Details:\x20'+JSON[_0x5bc90f(0x11c)](_0x173f8c[_0x5bc90f(0x10c)],null,0x2)),console[_0x5bc90f(0x11a)]('');});}function a23_0x57fe(_0x246ab7,_0x20f0ae){_0x246ab7=_0x246ab7-0xf9;const _0xd3738f=a23_0xd373();let _0x57fe95=_0xd3738f[_0x246ab7];return _0x57fe95;}export const logsDefinitions=[{'service':a23_0x497a3d(0x115),'command':a23_0x497a3d(0x102),'description':a23_0x497a3d(0x11b),'risk':a23_0x497a3d(0x104),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x50e805){const _0x18b54e=a23_0x497a3d;return printLogs(logger[_0x18b54e(0xfe)]()),{'ok':!![]};}},{'service':'logs','command':a23_0x497a3d(0x10e),'description':a23_0x497a3d(0x111),'risk':a23_0x497a3d(0x117),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1f8930){const _0x3500fa=a23_0x497a3d;return logger[_0x3500fa(0x10d)](),console[_0x3500fa(0x11a)](_0x3500fa(0x107)),{'ok':!![]};}}];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x2770fe=a24_0x45db;(function(_0x55f9e3,_0x4eea62){const _0x196f1c=a24_0x45db,_0x4611a9=_0x55f9e3();while(!![]){try{const _0xb3aed4=-parseInt(_0x196f1c(0x1af))/0x1*(-parseInt(_0x196f1c(0x1a8))/0x2)+parseInt(_0x196f1c(0x1b2))/0x3+parseInt(_0x196f1c(0x1a5))/0x4*(parseInt(_0x196f1c(0x199))/0x5)+parseInt(_0x196f1c(0x19a))/0x6*(parseInt(_0x196f1c(0x197))/0x7)+-parseInt(_0x196f1c(0x1a2))/0x8*(parseInt(_0x196f1c(0x1bb))/0x9)+-parseInt(_0x196f1c(0x1a1))/0xa+parseInt(_0x196f1c(0x1b8))/0xb;if(_0xb3aed4===_0x4eea62)break;else _0x4611a9['push'](_0x4611a9['shift']());}catch(_0x1dc349){_0x4611a9['push'](_0x4611a9['shift']());}}}(a24_0x1fba,0xeb840));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=[];function a24_0x45db(_0x13ce9a,_0x430796){_0x13ce9a=_0x13ce9a-0x196;const _0x1fbad8=a24_0x1fba();let _0x45db55=_0x1fbad8[_0x13ce9a];return _0x45db55;}const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x5d8192){const _0x2e5d5a=a24_0x45db;for(const _0x388533 of _0x5d8192){definitions[_0x2e5d5a(0x1b6)](_0x388533['service']+':'+_0x388533['command'],_0x388533);let _0x656d99=serviceGroups[_0x2e5d5a(0x19d)](_0x388533[_0x2e5d5a(0x1b5)]);!_0x656d99&&(_0x656d99=[],serviceGroups[_0x2e5d5a(0x1b6)](_0x388533[_0x2e5d5a(0x1b5)],_0x656d99)),_0x656d99[_0x2e5d5a(0x1bc)](_0x388533);}}function registerService(_0x4b9875,_0x23d66a,_0x55de88){const _0xaddac1=a24_0x45db;registerDefinitions(_0x23d66a);const _0x3fe2c9=_0x32810c=>_0x32810c==='read'?'':_0x32810c===_0xaddac1(0x1b7)?_0xaddac1(0x1ad):_0xaddac1(0x1b3),_0x1cd3cc={'service':_0x23d66a[0x0][_0xaddac1(0x1b5)],'label':_0x4b9875,'commands':_0x23d66a[_0xaddac1(0x1ab)](_0x2bfbe3=>({'command':_0x2bfbe3[_0xaddac1(0x1ac)],'description':_0x2bfbe3['description'],'tag':_0x3fe2c9(_0x2bfbe3[_0xaddac1(0x198)])})),'defaultCommand':_0x55de88?.[_0xaddac1(0x1a4)]??(_0x55de88?.[_0xaddac1(0x1b0)]?_0x23d66a[0x0]['command']:undefined),'isSingleCommand':_0x55de88?.[_0xaddac1(0x1b0)]};serviceRegistry[_0xaddac1(0x1bc)](_0x1cd3cc),serviceByName[_0xaddac1(0x1b6)](_0x1cd3cc[_0xaddac1(0x1b5)],_0x1cd3cc);}registerService(a24_0x2770fe(0x1a3),authDefinitions,{'defaultCommand':'login'}),registerService(a24_0x2770fe(0x19b),datasetDefinitions),registerService('Instant\x20API',dataDefinitions),registerService(a24_0x2770fe(0x1b1),sqlDefinitions),registerService(a24_0x2770fe(0x1b9),bffDefinitions),registerService(a24_0x2770fe(0x1b4),kbDefinitions),registerService(a24_0x2770fe(0x196),appDefinitions,{'defaultCommand':'list'}),registerService('Configuration',configDefinitions,{'defaultCommand':'list'}),registerService('Skills',skillDefinitions,{'defaultCommand':a24_0x2770fe(0x1a7)}),registerService(a24_0x2770fe(0x19c),[updateDefinition],{'defaultCommand':a24_0x2770fe(0x19f),'isSingleCommand':!![]}),registerService(a24_0x2770fe(0x1a9),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a24_0x2770fe(0x1ae),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a24_0x2770fe(0x19e),logsDefinitions,{'defaultCommand':a24_0x2770fe(0x1a0)});export function findDefinition(_0x5dfba3,_0x3cd09a){const _0x4547a4=a24_0x2770fe;return definitions[_0x4547a4(0x19d)](_0x5dfba3+':'+_0x3cd09a);}export function isKnownService(_0x24bc03){const _0x163019=a24_0x2770fe;return serviceByName[_0x163019(0x1aa)](_0x24bc03);}export function getServiceEntry(_0x38cfdf){return serviceByName['get'](_0x38cfdf);}export function getAllDefinitions(){const _0x9136a4=a24_0x2770fe;return Array[_0x9136a4(0x1ba)](definitions[_0x9136a4(0x1a6)]());}function a24_0x1fba(){const _0xb93277=['write','10262868FYRRMx','BFF\x20Scripts','from','9ybnQqO','push','App\x20Management','7oJMrkz','risk','5PncTnb','3590382FTzLEf','Datasets','Self\x20Update','get','Logs','run','show','18901740RliNME','4231064piOGaY','Authentication','defaultCommand','1490644fAdNzd','values','install','2974yYskay','Diagnostics','has','map','command','\x20\x20[write]','Schema','587wztuDt','isSingleCommand','SQL\x20Queries','1820442nMBVXD','\x20\x20[high-risk-write]','Knowledge\x20Base','service','set'];a24_0x1fba=function(){return _0xb93277;};return a24_0x1fba();}
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a25_0x24ad(_0x39316a,_0x51a498){_0x39316a=_0x39316a-0x1b9;const _0x530a3e=a25_0x530a();let _0x24ada=_0x530a3e[_0x39316a];return _0x24ada;}const a25_0x713d65=a25_0x24ad;function a25_0x530a(){const _0x344390=['1268HjpAuc','9772530AwObEB','3881DCFdco','Export\x20machine-readable\x20command\x20schema\x20(JSON)','schema','11AEglMT','2375ddxuWa','244MhXycs','11298EOwrwT','5871pjvbiJ','6173632lggcVv','8159494XWuNVT','8554770UJhmZU','export','read'];a25_0x530a=function(){return _0x344390;};return a25_0x530a();}(function(_0x3e680d,_0xa02387){const _0x8947bb=a25_0x24ad,_0xbda4ec=_0x3e680d();while(!![]){try{const _0x44a7a0=parseInt(_0x8947bb(0x1c0))/0x1*(parseInt(_0x8947bb(0x1c5))/0x2)+parseInt(_0x8947bb(0x1c7))/0x3*(-parseInt(_0x8947bb(0x1be))/0x4)+parseInt(_0x8947bb(0x1c4))/0x5*(parseInt(_0x8947bb(0x1c6))/0x6)+-parseInt(_0x8947bb(0x1ba))/0x7+-parseInt(_0x8947bb(0x1b9))/0x8+parseInt(_0x8947bb(0x1bb))/0x9+-parseInt(_0x8947bb(0x1bf))/0xa*(-parseInt(_0x8947bb(0x1c3))/0xb);if(_0x44a7a0===_0xa02387)break;else _0xbda4ec['push'](_0xbda4ec['shift']());}catch(_0x2db962){_0xbda4ec['push'](_0xbda4ec['shift']());}}}(a25_0x530a,0xb42b7));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x2b985a){const _0x5eff95=await buildSchemaPayload();return{'ok':!![],'data':_0x5eff95};}export const schemaDefinition={'service':a25_0x713d65(0x1c2),'command':a25_0x713d65(0x1bc),'description':a25_0x713d65(0x1c1),'risk':a25_0x713d65(0x1bd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x1c1a97=a26_0x173f;(function(_0x720c71,_0x23297d){const _0xb0ee26=a26_0x173f,_0x538195=_0x720c71();while(!![]){try{const _0x2ff46e=-parseInt(_0xb0ee26(0x1d5))/0x1*(parseInt(_0xb0ee26(0x1be))/0x2)+parseInt(_0xb0ee26(0x1ae))/0x3*(-parseInt(_0xb0ee26(0x1ac))/0x4)+-parseInt(_0xb0ee26(0x1bf))/0x5+-parseInt(_0xb0ee26(0x1c5))/0x6+parseInt(_0xb0ee26(0x1b4))/0x7*(parseInt(_0xb0ee26(0x1d3))/0x8)+-parseInt(_0xb0ee26(0x1d0))/0x9*(parseInt(_0xb0ee26(0x1d7))/0xa)+-parseInt(_0xb0ee26(0x1d8))/0xb*(-parseInt(_0xb0ee26(0x1de))/0xc);if(_0x2ff46e===_0x23297d)break;else _0x538195['push'](_0x538195['shift']());}catch(_0x4872f2){_0x538195['push'](_0x538195['shift']());}}}(a26_0x2976,0xe53be));function a26_0x2976(){const _0x39f713=['filter','npx\x20skills\x20add\x20failed:\x20','Skipped\x20npx\x20(','pipe','log','11252316noGApe','authRequired','Created\x20personal\x20Skill\x20','install','inherit','Installing\x20official\x20skill\x20via\x20npx\x20(npx\x20skills\x20add\x20','find','=1);\x20assuming\x20skill\x20is\x20already\x20present.','map','skipped','\x20-g\x20-y)...','7317dpXvIx','\x20developer\x20skill','Check\x20network\x20connectivity\x20and\x20try\x20again.','2951016PVusWG','personal','3XtKkgV','production','13190CJHjnk','190971ezWDcy','Only\x20pull\x20a\x20specific\x20runtime\x20Skill\x20code','version','readonly','unchanged','Local\x20Skill\x20directory\x20containing\x20SKILL.md','3828xhgvgK','nonInteractive','\x20skill\x20installed','cwd','updated','info','accessKey','skill','\x20personal\x20and\x20','code','error','setLogPath','scope','trim','input','52wxqdBN','length','391998rhYFvD','skillName','../../skills/npx-skills-add.js','../../core/api-client.js','\x20company\x20Skill(s).','created','14HOAvsh','skillCode','action','envName','../../skills/runtime-skill-sync.js','write','str','Updated\x20personal\x20Skill\x20','appCode','skill-install','204802xvqqyx','1916885crkLQq'];a26_0x2976=function(){return _0x39f713;};return a26_0x2976();}import{CLI_BIN_NAME,CLI_DISPLAY_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';function a26_0x173f(_0x2f9fac,_0x4b8e4c){_0x2f9fac=_0x2f9fac-0x1a2;const _0x2976b9=a26_0x2976();let _0x173f11=_0x2976b9[_0x2f9fac];return _0x173f11;}import{logger}from'../../utils/logger.js';const CODE_FLAG={'name':a26_0x1c1a97(0x1a6),'type':'string','description':a26_0x1c1a97(0x1d9)},DIR_FLAG={'name':'dir','type':'string','required':!![],'description':a26_0x1c1a97(0x1dd)};function summarizeRuntimeSkill(_0x3c8759){const _0x134a32=a26_0x1c1a97;return{'id':_0x3c8759['id'],'skillCode':_0x3c8759[_0x134a32(0x1b5)],'skillName':_0x3c8759[_0x134a32(0x1af)],'scope':_0x3c8759[_0x134a32(0x1a9)],'version':_0x3c8759[_0x134a32(0x1da)],'readonly':_0x3c8759[_0x134a32(0x1db)]};}function filterByCode(_0x5c7e09,_0x3ef745){const _0x4bd758=a26_0x1c1a97,_0x232362=_0x3ef745[_0x4bd758(0x1aa)]();if(!_0x232362)return _0x5c7e09;return _0x5c7e09[_0x4bd758(0x1c0)](_0x317c7f=>_0x317c7f['skillCode']===_0x232362);}export const skillDefinitions=[{'service':'skill','command':a26_0x1c1a97(0x1c8),'description':'Install\x20the\x20published\x20'+CLI_BIN_NAME+a26_0x1c1a97(0x1d1),'risk':a26_0x1c1a97(0x1b9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x337cd3){const _0x554ac1=a26_0x1c1a97;logger[_0x554ac1(0x1a8)](process['cwd']()),logger[_0x554ac1(0x1a2)](_0x554ac1(0x1bd),'Installing\x20published\x20'+CLI_DISPLAY_NAME+'\x20skill\x20via\x20npx.');const {LOVRABET_SKILL_SOURCE:_0x57cadc,LOVRABET_SKIP_NPX_SKILLS_ENV:_0x1b76c6,runNpxSkillsAddGlobal:_0x229e4c}=await import(_0x554ac1(0x1b0)),_0x34034d=_0x337cd3[_0x554ac1(0x1df)]?_0x554ac1(0x1c3):_0x554ac1(0x1c9);console[_0x554ac1(0x1c4)](_0x554ac1(0x1ca)+_0x57cadc+_0x554ac1(0x1cf));const _0x3b32f7=_0x229e4c(process[_0x554ac1(0x1e1)](),_0x57cadc,{'stdio':_0x34034d});if(_0x3b32f7[_0x554ac1(0x1ce)])console[_0x554ac1(0x1c4)](_0x554ac1(0x1c2)+_0x1b76c6+_0x554ac1(0x1cc));else{if(_0x3b32f7['ok'])console[_0x554ac1(0x1c4)](CLI_BIN_NAME+_0x554ac1(0x1e0));else throw CliErrors['apiError'](_0x554ac1(0x1c1)+(_0x3b32f7[_0x554ac1(0x1a7)]||'unknown'),_0x554ac1(0x1d2));}return{'ok':!![]};}},{'service':a26_0x1c1a97(0x1a4),'command':'pull','description':'Pull\x20personal\x20and\x20company\x20runtime\x20Skills\x20into\x20local\x20agent\x20skill\x20directories','risk':a26_0x1c1a97(0x1b9),'flags':[CODE_FLAG],async 'execute'(_0x1d166e){const _0x4b0f3e=a26_0x1c1a97,{listCompanyRuntimeSkills:_0x908097,listPersonalRuntimeSkills:_0x34bd93}=await import(_0x4b0f3e(0x1b1)),{linkEffectiveRuntimeSkills:_0xd46a37,materializeRuntimeSkill:_0x5c14e5}=await import(_0x4b0f3e(0x1b8)),_0x5cba79=_0x1d166e[_0x4b0f3e(0x1ba)](_0x4b0f3e(0x1a6)),_0x195d0=_0x1d166e[_0x4b0f3e(0x1b7)]??_0x4b0f3e(0x1d6),_0x1feee6=_0x1d166e[_0x4b0f3e(0x1a3)];if(!_0x1feee6)throw CliErrors['authRequired']();const _0x3a57a7=filterByCode(await _0x34bd93(_0x1d166e[_0x4b0f3e(0x1bc)]),_0x5cba79),_0x239e96=filterByCode(await _0x908097(_0x1d166e[_0x4b0f3e(0x1bc)]),_0x5cba79),_0x343185=[..._0x3a57a7['map'](_0x4e367b=>_0x5c14e5(_0x4e367b,_0x4b0f3e(0x1d4),{'env':_0x195d0,'accessKey':_0x1feee6,'appCode':_0x1d166e[_0x4b0f3e(0x1bc)]})),..._0x239e96[_0x4b0f3e(0x1cd)](_0x167a29=>_0x5c14e5(_0x167a29,'company',{'env':_0x195d0,'accessKey':_0x1feee6,'appCode':_0x1d166e[_0x4b0f3e(0x1bc)]}))],_0x58e37e=_0xd46a37(_0x343185,_0x1d166e[_0x4b0f3e(0x1bc)]),_0x2570f9=_0x58e37e['reduce']((_0x1c403b,_0x5f4b31)=>{const _0x25a9e2=_0x4b0f3e;return _0x1c403b[_0x5f4b31['action']]=(_0x1c403b[_0x5f4b31[_0x25a9e2(0x1b6)]]??0x0)+0x1,_0x1c403b;},{});return{'ok':!![],'data':{'appCode':_0x1d166e[_0x4b0f3e(0x1bc)],'personal':_0x3a57a7[_0x4b0f3e(0x1ad)],'company':_0x239e96[_0x4b0f3e(0x1ad)],'materialized':_0x343185[_0x4b0f3e(0x1ad)],'links':{'total':_0x58e37e['length'],'created':_0x2570f9[_0x4b0f3e(0x1b3)]??0x0,'updated':_0x2570f9[_0x4b0f3e(0x1e2)]??0x0,'unchanged':_0x2570f9[_0x4b0f3e(0x1dc)]??0x0,'skipped':0x0,'conflicted':0x0},'skills':{'personal':_0x3a57a7[_0x4b0f3e(0x1cd)](summarizeRuntimeSkill),'company':_0x239e96[_0x4b0f3e(0x1cd)](summarizeRuntimeSkill)}},'message':'Pulled\x20'+_0x3a57a7[_0x4b0f3e(0x1ad)]+_0x4b0f3e(0x1a5)+_0x239e96[_0x4b0f3e(0x1ad)]+_0x4b0f3e(0x1b2)};}},{'service':a26_0x1c1a97(0x1a4),'command':'push','description':'Push\x20a\x20local\x20Skill\x20directory\x20to\x20personal\x20runtime\x20Skill\x20scope','risk':a26_0x1c1a97(0x1b9),'flags':[DIR_FLAG],async 'execute'(_0x114b54){const _0x3f576e=a26_0x1c1a97,{createPersonalRuntimeSkill:_0x3b54a9,listPersonalRuntimeSkills:_0x1fa5dd,updatePersonalRuntimeSkill:_0x3b302b}=await import('../../core/api-client.js'),{readPushDirectory:_0x4f1e8b}=await import(_0x3f576e(0x1b8));if(!_0x114b54[_0x3f576e(0x1a3)])throw CliErrors[_0x3f576e(0x1c6)]();const _0x11c034=_0x4f1e8b(_0x114b54['str']('dir'),_0x114b54[_0x3f576e(0x1bc)]),_0x5612b5=(await _0x1fa5dd(_0x114b54[_0x3f576e(0x1bc)]))[_0x3f576e(0x1cb)](_0x562015=>_0x562015['skillCode']===_0x11c034[_0x3f576e(0x1b5)]),_0x5852a7=_0x5612b5?await _0x3b302b(_0x11c034['skillCode'],_0x114b54[_0x3f576e(0x1bc)],_0x11c034[_0x3f576e(0x1ab)]):await _0x3b54a9(_0x114b54['appCode'],_0x11c034['input']);return{'ok':!![],'data':summarizeRuntimeSkill(_0x5852a7),'message':_0x5612b5?_0x3f576e(0x1bb)+_0x11c034[_0x3f576e(0x1b5)]:_0x3f576e(0x1c7)+_0x11c034[_0x3f576e(0x1b5)]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x262c11=a27_0x4c1c;(function(_0x411977,_0x26d71b){const _0x18b0ff=a27_0x4c1c,_0x359afe=_0x411977();while(!![]){try{const _0x9936a2=-parseInt(_0x18b0ff(0x8a))/0x1*(-parseInt(_0x18b0ff(0x8d))/0x2)+parseInt(_0x18b0ff(0x95))/0x3+-parseInt(_0x18b0ff(0x9c))/0x4+-parseInt(_0x18b0ff(0x89))/0x5*(-parseInt(_0x18b0ff(0x92))/0x6)+parseInt(_0x18b0ff(0x99))/0x7*(-parseInt(_0x18b0ff(0x8c))/0x8)+parseInt(_0x18b0ff(0x97))/0x9*(-parseInt(_0x18b0ff(0x94))/0xa)+parseInt(_0x18b0ff(0x93))/0xb*(parseInt(_0x18b0ff(0x9a))/0xc);if(_0x9936a2===_0x26d71b)break;else _0x359afe['push'](_0x359afe['shift']());}catch(_0x4c85cd){_0x359afe['push'](_0x359afe['shift']());}}}(a27_0x4fbb,0x4c37e));import{getSqlQueryInfo}from'../../core/api-client.js';function a27_0x4fbb(){const _0x18c2ec=['1072434EzweYM','10MQwoir','1500834SiKmhY','dbId','2168469kHFPPq','bool','42fzrYJk','24rcsmXL','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','12644vGQcjx','detail','sqlContent','576230QDaumQ','4XklFfB','sqlCode','707440EVbEgH','22934RieORI','read','str','sqlName','sqlcode','18DYNhyI'];a27_0x4fbb=function(){return _0x18c2ec;};return a27_0x4fbb();}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';function a27_0x4c1c(_0x5293ec,_0x1202fe){_0x5293ec=_0x5293ec-0x88;const _0x4fbb6f=a27_0x4fbb();let _0x4c1ce9=_0x4fbb6f[_0x5293ec];return _0x4c1ce9;}export const sqlDetail={'service':'sql','command':a27_0x262c11(0x9d),'description':a27_0x262c11(0x9b),'risk':a27_0x262c11(0x8e),'flags':[SQLCODE_FLAG,VERBOSE_FLAG],async 'execute'(_0x34f240){const _0x6c979d=a27_0x262c11,_0x56ec52=await getSqlQueryInfo(_0x34f240['appCode'],_0x34f240[_0x6c979d(0x8f)](_0x6c979d(0x91))),_0xe901fa=_0x34f240[_0x6c979d(0x98)]('verbose');if(_0xe901fa)return{'ok':!![],'data':_0x56ec52};const _0x128b9b=_0x56ec52[_0x6c979d(0x96)]?await getDbName(_0x34f240['appCode'],_0x56ec52['dbId']):undefined;return{'ok':!![],'data':{'sqlCode':_0x56ec52[_0x6c979d(0x8b)],'sqlName':_0x56ec52[_0x6c979d(0x90)],'db':_0x128b9b?_0x128b9b+'\x20('+_0x56ec52['dbId']+')':_0x56ec52[_0x6c979d(0x96)]??'','description':_0x56ec52['description']??'','sqlContent':_0x56ec52[_0x6c979d(0x88)]??''}};}};
|