@lovrabet/lovrabet-cli 2.0.9-beta.1 → 2.0.9-beta.3
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 -2
|
@@ -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_0x548c3a=a16_0xbe83;(function(_0x2a1c42,_0x134099){const _0x2744c6=a16_0xbe83,_0x3dfcb7=_0x2a1c42();while(!![]){try{const _0x5584fe=-parseInt(_0x2744c6(0x1bb))/0x1+-parseInt(_0x2744c6(0x1a4))/0x2*(parseInt(_0x2744c6(0x1ca))/0x3)+parseInt(_0x2744c6(0x1b3))/0x4+parseInt(_0x2744c6(0x1a3))/0x5+parseInt(_0x2744c6(0x1d1))/0x6*(parseInt(_0x2744c6(0x198))/0x7)+parseInt(_0x2744c6(0x1d5))/0x8+parseInt(_0x2744c6(0x1ba))/0x9*(-parseInt(_0x2744c6(0x1ac))/0xa);if(_0x5584fe===_0x134099)break;else _0x3dfcb7['push'](_0x3dfcb7['shift']());}catch(_0x43cbd5){_0x3dfcb7['push'](_0x3dfcb7['shift']());}}}(a16_0x4430,0x5cfc5));import{executeData}from'../../core/sdk-client.js';function a16_0x4430(){const _0x32120b=['JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','paramsRequired','198TdLRNZ','754332ixnaRe','\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}}','params','Example:\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#\x20Sum\x20amount\x20grouped\x20by\x20status','\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}','helpExtra','str','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','Get\x20a\x20single\x20record\x20by\x20ID','\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','\x20\x20\x20\x20$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\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','\x20\x20PAGINATION','\x20\x20LOGICAL\x20COMBINATORS','4008cFNhys','\x20completed\x20in\x20','operation','batchCreate','create','join','\x20\x20AGGREGATE\x20TYPES','78648Fdxuww','high-risk-write','Preview:\x20data\x20','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','3765144vySScv','write','now','update','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','\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}}','\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}]','delete','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','paramsHint','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','\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}}','\x20on\x20dataset\x20','\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}','dryRun','\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}}','\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','description','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','252icHIjh','\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\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','build','filter','Update\x20an\x20existing\x20record','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','\x20\x20\x20\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}}','command','\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}','1514125aynNAD','998hkAjjV','\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}}','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','\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}','code','aggregate','read','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','36860dqIPrn','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','POST','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','\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]}}','data','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','2550404yKLaaH','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','getOne','data\x20','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]'];a16_0x4430=function(){return _0x32120b;};return a16_0x4430();}function a16_0xbe83(_0x4b1907,_0x4c7c50){_0x4b1907=_0x4b1907-0x198;const _0x443091=a16_0x4430();let _0xbe833a=_0x443091[_0x4b1907];return _0xbe833a;}import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a16_0x548c3a(0x19d),'operation':'filter','risk':a16_0x548c3a(0x1aa),'paramsRequired':![],'description':'Filter\x20dataset\x20records\x20with\x20query\x20conditions','paramsHint':a16_0x548c3a(0x1af)+a16_0x548c3a(0x1ab),'helpExtra':['\x20\x20WHERE\x20OPERATORS',a16_0x548c3a(0x1da),a16_0x548c3a(0x1bc),'\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_0x548c3a(0x1a5),a16_0x548c3a(0x1e4),a16_0x548c3a(0x1b0),a16_0x548c3a(0x1c6),a16_0x548c3a(0x1a0),a16_0x548c3a(0x1e0),'',a16_0x548c3a(0x1c9),a16_0x548c3a(0x1c5),a16_0x548c3a(0x199),'',a16_0x548c3a(0x1d9),a16_0x548c3a(0x1b4),a16_0x548c3a(0x19f),a16_0x548c3a(0x1db),'\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','',a16_0x548c3a(0x1c8),a16_0x548c3a(0x1ad),a16_0x548c3a(0x19a),'\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)'][a16_0x548c3a(0x1cf)]('\x0a')},{'command':a16_0x548c3a(0x1b5),'operation':a16_0x548c3a(0x1b5),'risk':a16_0x548c3a(0x1aa),'paramsRequired':!![],'description':a16_0x548c3a(0x1c4),'paramsHint':a16_0x548c3a(0x1dd)},{'command':'create','operation':a16_0x548c3a(0x1ce),'risk':a16_0x548c3a(0x1d6),'paramsRequired':!![],'description':a16_0x548c3a(0x19b),'paramsHint':a16_0x548c3a(0x1b2)},{'command':a16_0x548c3a(0x1cd),'operation':a16_0x548c3a(0x1cd),'risk':a16_0x548c3a(0x1d6),'paramsRequired':!![],'description':a16_0x548c3a(0x1df),'paramsHint':a16_0x548c3a(0x1b8)},{'command':'update','operation':a16_0x548c3a(0x1d8),'risk':'write','paramsRequired':!![],'description':a16_0x548c3a(0x19e),'paramsHint':'JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27'},{'command':a16_0x548c3a(0x1dc),'operation':'delete','risk':a16_0x548c3a(0x1d2),'paramsRequired':!![],'description':a16_0x548c3a(0x1a6),'paramsHint':a16_0x548c3a(0x1dd)},{'command':a16_0x548c3a(0x1a9),'operation':'aggregate','risk':a16_0x548c3a(0x1aa),'paramsRequired':![],'description':'Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','paramsHint':a16_0x548c3a(0x1e7)+a16_0x548c3a(0x1be),'helpExtra':[a16_0x548c3a(0x1d0),'\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}',a16_0x548c3a(0x1a2),'\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','\x20\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_0x548c3a(0x1c0),a16_0x548c3a(0x1a7),a16_0x548c3a(0x1e2),'','\x20\x20PARAMS\x20STRUCTURE','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)',a16_0x548c3a(0x1c7),a16_0x548c3a(0x1d4),'\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}}',a16_0x548c3a(0x1b7),'','\x20\x20EXAMPLES',a16_0x548c3a(0x1bf),'\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','',a16_0x548c3a(0x1c3),a16_0x548c3a(0x1e5)][a16_0x548c3a(0x1cf)]('\x0a')}];function makeDataCommand(_0x3d66d6){const _0x418a99=a16_0x548c3a,_0x24d04d=_0x418a99(0x1b6)+_0x3d66d6['command'],_0x22885e={'service':_0x418a99(0x1b1),'command':_0x3d66d6['command'],'description':_0x3d66d6['description'],'risk':_0x3d66d6['risk'],'helpExtra':_0x3d66d6[_0x418a99(0x1c1)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x3d66d6[_0x418a99(0x1de)]}],'validate':async _0x39b96f=>{const _0x1c9297=_0x418a99;_0x3d66d6[_0x1c9297(0x1b9)]&&requireAnyOf(_0x39b96f,['params'],_0x24d04d),_0x3d66d6['operation']===_0x1c9297(0x1cd)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x39b96f[_0x1c9297(0x1c2)]('params')));},async 'execute'(_0x339172){const _0x36a206=_0x418a99,_0x98aac6=_0x339172[_0x36a206(0x1c2)]('code'),_0x2e8d2f=_0x3d66d6[_0x36a206(0x1cc)]===_0x36a206(0x1cd)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x339172[_0x36a206(0x1c2)](_0x36a206(0x1bd)))):parseJsonParams(_0x339172[_0x36a206(0x1c2)](_0x36a206(0x1bd)))??{},_0x4fa964=Date['now'](),_0x3b634a=await executeData(_0x98aac6,_0x3d66d6[_0x36a206(0x1cc)],_0x2e8d2f),_0x5ea885=Date[_0x36a206(0x1d7)]()-_0x4fa964;return{'ok':!![],'data':{'result':_0x3b634a,'elapsed':_0x5ea885},'message':'data\x20'+_0x3d66d6[_0x36a206(0x1a1)]+_0x36a206(0x1cb)+_0x5ea885+'ms'};}};return _0x3d66d6['risk']!==_0x418a99(0x1aa)&&(_0x22885e[_0x418a99(0x1e3)]=async _0x39799a=>{const _0x309321=_0x418a99,_0x2b8536=_0x39799a[_0x309321(0x1c2)](_0x309321(0x1a8)),_0x46f4a5=_0x3d66d6[_0x309321(0x1cc)]===_0x309321(0x1cd)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x39799a[_0x309321(0x1c2)]('params'))):parseJsonParams(_0x39799a['str']('params'))??{};return dryRun(_0x309321(0x1ae),'/api/{appCode}/'+_0x2b8536+'/'+_0x3d66d6[_0x309321(0x1cc)])['body'](_0x46f4a5)[_0x309321(0x1e6)](_0x309321(0x1d3)+_0x3d66d6['command']+_0x309321(0x1e1)+_0x2b8536)[_0x309321(0x19c)]();}),_0x22885e;}export const dataDefinitions=specs['map'](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a17_0x72d0dd=a17_0x1f07;(function(_0x22e789,_0x5c8b68){const _0x394067=a17_0x1f07,_0x4091f9=_0x22e789();while(!![]){try{const _0x18f2f4=-parseInt(_0x394067(0x21f))/0x1+parseInt(_0x394067(0x1e7))/0x2+-parseInt(_0x394067(0x229))/0x3*(-parseInt(_0x394067(0x1ff))/0x4)+parseInt(_0x394067(0x1e5))/0x5+-parseInt(_0x394067(0x208))/0x6*(-parseInt(_0x394067(0x1f1))/0x7)+parseInt(_0x394067(0x1da))/0x8*(parseInt(_0x394067(0x1eb))/0x9)+-parseInt(_0x394067(0x213))/0xa*(parseInt(_0x394067(0x21a))/0xb);if(_0x18f2f4===_0x5c8b68)break;else _0x4091f9['push'](_0x4091f9['shift']());}catch(_0x54c466){_0x4091f9['push'](_0x4091f9['shift']());}}}(a17_0x2ec6,0xe152b));function a17_0x1f07(_0x55ebe3,_0x1d8ed8){_0x55ebe3=_0x55ebe3-0x1da;const _0x2ec6d0=a17_0x2ec6();let _0x1f076a=_0x2ec6d0[_0x55ebe3];return _0x1f076a;}import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x24f619){const _0x251927=a17_0x1f07;if(_0x24f619[_0x251927(0x211)])return null;const _0x14d8f4=Boolean(_0x24f619[_0x251927(0x223)]!==undefined||_0x24f619['doType']!==undefined);let _0x31f93f={};if(!_0x14d8f4&&typeof _0x24f619[_0x251927(0x209)]===_0x251927(0x224))try{_0x31f93f=JSON[_0x251927(0x22d)](_0x24f619[_0x251927(0x209)]);}catch{}const _0x3ac031=_0x14d8f4?_0x24f619['name']:_0x24f619[_0x251927(0x206)],_0x193ce8=_0x14d8f4?_0x24f619['displayName']:_0x24f619[_0x251927(0x1ee)],_0x50ba83=_0x14d8f4?_0x24f619[_0x251927(0x1f5)]:_0x24f619['type']||_0x24f619[_0x251927(0x1f2)],_0x2ab5aa=_0x14d8f4?_0x24f619[_0x251927(0x22b)]===!![]:_0x31f93f[_0x251927(0x22b)]===!![],_0x170fb4=_0x14d8f4?_0x24f619[_0x251927(0x1e8)]===!![]:_0x31f93f[_0x251927(0x1e8)]===!![],_0x12a4c1=_0x14d8f4?_0x24f619['options']??null:_0x31f93f[_0x251927(0x214)]??null,_0x3073b8={'name':_0x3ac031,'displayName':_0x193ce8||_0x3ac031,'type':_0x50ba83,'dbType':_0x24f619[_0x251927(0x1f0)],'pk':_0x2ab5aa,'required':_0x170fb4,'description':_0x24f619[_0x251927(0x1e6)]||undefined};return Array['isArray'](_0x12a4c1)&&_0x12a4c1[_0x251927(0x21d)]>0x0&&(_0x3073b8[_0x251927(0x214)]=_0x12a4c1),_0x3073b8;}function parseJsonMaybe(_0x4595f6){const _0x2ffb26=a17_0x1f07;if(typeof _0x4595f6!==_0x2ffb26(0x224))return _0x4595f6;try{return JSON['parse'](_0x4595f6);}catch{return _0x4595f6;}}function normalizeOperationEntry(_0x248ace,_0x3ae2ad){const _0x3aeed6=a17_0x1f07;if(!_0x3ae2ad||typeof _0x3ae2ad!==_0x3aeed6(0x1fb))return null;if(!_0x3ae2ad['method']||!_0x3ae2ad[_0x3aeed6(0x1df)])return null;const _0x3efaeb={'name':_0x248ace,'method':_0x3ae2ad[_0x3aeed6(0x21c)],'path':_0x3ae2ad[_0x3aeed6(0x1df)]};if(_0x3ae2ad[_0x3aeed6(0x1e1)])_0x3efaeb[_0x3aeed6(0x1e1)]=_0x3ae2ad[_0x3aeed6(0x1e1)];if(_0x3ae2ad[_0x3aeed6(0x207)]!=null)_0x3efaeb[_0x3aeed6(0x207)]=parseJsonMaybe(_0x3ae2ad[_0x3aeed6(0x207)]);if(_0x3ae2ad[_0x3aeed6(0x1fc)]!=null)_0x3efaeb[_0x3aeed6(0x1fc)]=parseJsonMaybe(_0x3ae2ad[_0x3aeed6(0x1fc)]);if(_0x3ae2ad[_0x3aeed6(0x1e2)]!=null)_0x3efaeb[_0x3aeed6(0x1e2)]=_0x3ae2ad['beforeScriptId'];if(_0x3ae2ad[_0x3aeed6(0x1f6)]!=null)_0x3efaeb[_0x3aeed6(0x1f6)]=_0x3ae2ad[_0x3aeed6(0x1f6)];if(Array[_0x3aeed6(0x221)](_0x3ae2ad[_0x3aeed6(0x20a)]))_0x3efaeb[_0x3aeed6(0x20a)]=_0x3ae2ad[_0x3aeed6(0x20a)];if(Array[_0x3aeed6(0x221)](_0x3ae2ad[_0x3aeed6(0x1e3)]))_0x3efaeb[_0x3aeed6(0x1e3)]=_0x3ae2ad['responseFields'];return _0x3efaeb;}function summarizeDbtable(_0x457536){const _0xf4b7ca=a17_0x1f07,_0x12cfd9={},_0x53d890=['dbId',_0xf4b7ca(0x1e4),_0xf4b7ca(0x222),_0xf4b7ca(0x20c),_0xf4b7ca(0x22b),_0xf4b7ca(0x1ef),_0xf4b7ca(0x20e),_0xf4b7ca(0x215),'updateTimeField',_0xf4b7ca(0x1ec),'creatorNameField',_0xf4b7ca(0x205),_0xf4b7ca(0x20f),_0xf4b7ca(0x226),_0xf4b7ca(0x1f4)];for(const _0x30b0b6 of _0x53d890){if(_0x457536[_0x30b0b6]!==undefined)_0x12cfd9[_0x30b0b6]=_0x457536[_0x30b0b6];}return typeof _0x12cfd9['allFields']===_0xf4b7ca(0x224)&&_0x12cfd9['allFields']['length']>0x0&&(_0x12cfd9[_0xf4b7ca(0x228)]=_0x12cfd9[_0xf4b7ca(0x1ef)][_0xf4b7ca(0x1de)](',')['map'](_0x68e12a=>_0x68e12a[_0xf4b7ca(0x210)]())[_0xf4b7ca(0x227)](Boolean)),_0x12cfd9;}function normalizeRelatedPages(_0x4f8565){const _0x208a67=a17_0x1f07;if(!Array[_0x208a67(0x221)](_0x4f8565))return[];return _0x4f8565['filter'](_0x94df92=>_0x94df92&&typeof _0x94df92===_0x208a67(0x1fb))[_0x208a67(0x22c)](_0x435138=>({'id':_0x435138['id'],'type':_0x435138[_0x208a67(0x217)],'code':_0x435138[_0x208a67(0x206)],'title':_0x435138[_0x208a67(0x21b)],'deleted':_0x435138['deleted']===!![]}));}function normalizeFallbackFieldName(_0xff5c55,_0x27a92e){const _0x16611e=_0xff5c55['trim']();if(!_0x16611e)return null;return{'name':_0x16611e,'displayName':_0x16611e,'type':undefined,'dbType':undefined,'pk':_0x16611e===_0x27a92e,'required':![],'description':undefined};}async function loadListFieldFallback(_0x12a127,_0x2da170){const _0x3dfcab=a17_0x1f07;if(!_0x12a127||!_0x2da170)return[];try{const _0x42de52=await listDatasets(_0x12a127,{'code':_0x2da170}),_0x31c4b9=_0x42de52[_0x3dfcab(0x1fa)](_0x3803ea=>_0x3803ea[_0x3dfcab(0x206)]===_0x2da170)??_0x42de52[0x0],_0x210ded=_0x31c4b9?.[_0x3dfcab(0x20b)]??{},_0x41d12b=typeof _0x210ded[_0x3dfcab(0x1ef)]===_0x3dfcab(0x224)?_0x210ded[_0x3dfcab(0x1ef)][_0x3dfcab(0x1de)](','):[];return _0x41d12b[_0x3dfcab(0x22c)](_0x1f7bdc=>normalizeFallbackFieldName(_0x1f7bdc,_0x210ded[_0x3dfcab(0x22b)]))['filter'](_0x153c4a=>_0x153c4a!==null);}catch{return[];}}function a17_0x2ec6(){const _0x2d02a8=['type','source','validateRules','11idFeDv','title','method','length','toDatasetCode','25495vLnoFc','modelId','isArray','tableName','displayName','string','toField','labelField','filter','allFieldNames','4383ysrJBo','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','pkField','map','parse','14205584yUoTvG','properties','dbId','push','split','path','columnCodeListWithDeleted','host','beforeScriptId','responseFields','dbName','4883220pkQIXi','description','584390RsjtuC','required','str','appCode','9ANIyJs','creatorIdField','entries','name','allFields','dbType','619045SSeEWK','dataType','fields','dblinkInfoDTO','doType','afterScriptId','operations','formatRules','read','find','object','responseBody','sourceType','toFieldLabel','3180ESLcIk','fromField','doVersion','detail','relations','tableComment','modifierIdField','code','requestBody','102qSelgZ','extend','requestFields','dbtableConfig','datasetKey','relatedPageInfoList','logicField','modifierNameField','trim','deleted','toTableName','47610090AykMlG','options','createTimeField','dataset'];a17_0x2ec6=function(){return _0x2d02a8;};return a17_0x2ec6();}export const datasetDetail={'service':a17_0x72d0dd(0x216),'command':a17_0x72d0dd(0x202),'description':a17_0x72d0dd(0x22a),'risk':a17_0x72d0dd(0x1f9),'flags':[CODE_FLAG],async 'execute'(_0xc0a3ea){const _0x391b86=a17_0x72d0dd,_0x3e895d=await getDatasetDetail(_0xc0a3ea[_0x391b86(0x1e9)](_0x391b86(0x206))),_0x54d99d=Array['isArray'](_0x3e895d['fields'])?_0x3e895d[_0x391b86(0x1f3)]:Array[_0x391b86(0x221)](_0x3e895d['properties'])?_0x3e895d[_0x391b86(0x1db)]:[];let _0x397861=_0x54d99d[_0x391b86(0x22c)](_0x3ce5e5=>normalizeField(_0x3ce5e5))['filter'](_0x491faf=>_0x491faf!==null);_0x397861[_0x391b86(0x21d)]===0x0&&(_0x397861=await loadListFieldFallback(_0xc0a3ea[_0x391b86(0x1ea)],_0xc0a3ea[_0x391b86(0x1e9)](_0x391b86(0x206))));const _0x1efed9=_0x3e895d[_0x391b86(0x1f7)]??{},_0x113bc6=[];for(const [_0x267016,_0x1675d4]of Object[_0x391b86(0x1ed)](_0x1efed9)){const _0x45f169=normalizeOperationEntry(_0x267016,_0x1675d4);if(_0x45f169)_0x113bc6[_0x391b86(0x1dd)](_0x45f169);}const _0x2b8f7a=_0x3e895d[_0x391b86(0x20b)]??{},_0x37235a=_0x3e895d[_0x391b86(0x216)]??{},_0x186b88=_0x2b8f7a[_0x391b86(0x1dc)]!=null?{'id':_0x2b8f7a[_0x391b86(0x1dc)],'name':_0x2b8f7a[_0x391b86(0x1e4)]??null}:undefined;let _0x1b6bb9;return typeof _0x3e895d[_0x391b86(0x209)]===_0x391b86(0x224)&&(_0x1b6bb9=parseJsonMaybe(_0x3e895d[_0x391b86(0x209)])),{'ok':!![],'data':{'id':_0x3e895d[_0x391b86(0x220)]??_0x3e895d['id'],'name':_0x3e895d[_0x391b86(0x1ee)],'code':_0x3e895d['modelCode']||_0x3e895d[_0x391b86(0x206)],'doVersion':_0x3e895d[_0x391b86(0x201)],'description':_0x3e895d['description']||_0x37235a[_0x391b86(0x204)]||undefined,'source':_0x3e895d[_0x391b86(0x218)]||_0x37235a[_0x391b86(0x1fd)],'table':_0x2b8f7a[_0x391b86(0x222)]||_0x37235a[_0x391b86(0x222)],'datasetKey':_0x2b8f7a['datasetKey'],'pk':_0x2b8f7a[_0x391b86(0x22b)],'db':_0x186b88,'dbtable':summarizeDbtable(_0x2b8f7a),'fields':_0x397861,'operations':_0x113bc6,'indexes':Array[_0x391b86(0x221)](_0x37235a['indexes'])?_0x37235a['indexes']:[],'relations':Array[_0x391b86(0x221)](_0x3e895d[_0x391b86(0x203)])?_0x3e895d[_0x391b86(0x203)]['map'](_0x4fc826=>({'fromField':_0x4fc826[_0x391b86(0x200)],'toDataset':_0x4fc826['toDatasetName'],'toCode':_0x4fc826[_0x391b86(0x21e)],'toTable':_0x4fc826[_0x391b86(0x212)],'toField':_0x4fc826[_0x391b86(0x225)],'labelField':_0x4fc826[_0x391b86(0x1fe)]||undefined})):[],'relatedPages':normalizeRelatedPages(_0x3e895d[_0x391b86(0x20d)]),...Array[_0x391b86(0x221)](_0x3e895d[_0x391b86(0x1e0)])?{'columnCodeListWithDeleted':_0x3e895d[_0x391b86(0x1e0)]}:{},'formatRules':Array['isArray'](_0x3e895d[_0x391b86(0x1f8)])?_0x3e895d[_0x391b86(0x1f8)]:[],'validateRules':Array[_0x391b86(0x221)](_0x3e895d['validateRules'])?_0x3e895d[_0x391b86(0x219)]:[],..._0x1b6bb9!==undefined?{'extend':_0x1b6bb9}:{},'stats':{'fieldCount':_0x397861[_0x391b86(0x21d)],'operationCount':_0x113bc6['length']}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x9a88bd,_0x4acc99){const _0x540d96=a18_0xec9e,_0x39bc4b=_0x9a88bd();while(!![]){try{const _0x359ef3=-parseInt(_0x540d96(0xa8))/0x1+-parseInt(_0x540d96(0xa2))/0x2+parseInt(_0x540d96(0xa5))/0x3+parseInt(_0x540d96(0xa3))/0x4+parseInt(_0x540d96(0xaa))/0x5+-parseInt(_0x540d96(0xa9))/0x6*(-parseInt(_0x540d96(0xa6))/0x7)+parseInt(_0x540d96(0xa7))/0x8*(-parseInt(_0x540d96(0xa4))/0x9);if(_0x359ef3===_0x4acc99)break;else _0x39bc4b['push'](_0x39bc4b['shift']());}catch(_0x40182d){_0x39bc4b['push'](_0x39bc4b['shift']());}}}(a18_0x16f7,0xb5dc5));function a18_0xec9e(_0x2a74ce,_0x54bb9d){_0x2a74ce=_0x2a74ce-0xa2;const _0x16f7a7=a18_0x16f7();let _0xec9ea7=_0x16f7a7[_0x2a74ce];return _0xec9ea7;}import{datasetList}from'../../commands/dataset/list.js';function a18_0x16f7(){const _0x874e56=['18HlhdeG','4142607GOIlUk','3327947TDJuSB','3618832VZVulM','746510xmryPy','12MwwKEG','1123965BlTlcG','2710584UlVGyP','4779628DImZcY'];a18_0x16f7=function(){return _0x874e56;};return a18_0x16f7();}import{datasetDetail}from'../../commands/dataset/detail.js';export const datasetDefinitions=[datasetList,datasetDetail];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x9ac1ad=a19_0x1a9b;(function(_0x5a3f71,_0x4e091f){const _0x1ec6b4=a19_0x1a9b,_0xb26f19=_0x5a3f71();while(!![]){try{const _0x4f407d=parseInt(_0x1ec6b4(0x11f))/0x1+-parseInt(_0x1ec6b4(0x10d))/0x2*(parseInt(_0x1ec6b4(0x119))/0x3)+parseInt(_0x1ec6b4(0x125))/0x4*(parseInt(_0x1ec6b4(0x11b))/0x5)+-parseInt(_0x1ec6b4(0x121))/0x6*(parseInt(_0x1ec6b4(0x114))/0x7)+-parseInt(_0x1ec6b4(0x116))/0x8+parseInt(_0x1ec6b4(0x10e))/0x9+-parseInt(_0x1ec6b4(0x122))/0xa*(parseInt(_0x1ec6b4(0x118))/0xb);if(_0x4f407d===_0x4e091f)break;else _0xb26f19['push'](_0xb26f19['shift']());}catch(_0x53e1c1){_0xb26f19['push'](_0xb26f19['shift']());}}}(a19_0x1088,0x7a2d0));function a19_0x1a9b(_0x1fb2d0,_0x4e9cc2){_0x1fb2d0=_0x1fb2d0-0x10c;const _0x1088b6=a19_0x1088();let _0x1a9b2c=_0x1088b6[_0x1fb2d0];return _0x1a9b2c;}function a19_0x1088(){const _0x1a093a=['string','description','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','datasetKey','7RUTNVO','tableName','5332584DkYdAI','Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)','55hBNLpl','671385cnQExZ','read','214215FWynza','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','code','map','662920qsnhus','source','2143902iEztxf','1534850fsIlTy','appCode','str','80OtyGZD','dataset','list','pkField','2voVkul','8961858cNnJng','name'];a19_0x1088=function(){return _0x1a093a;};return a19_0x1088();}import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';export const datasetList={'service':a19_0x9ac1ad(0x126),'command':a19_0x9ac1ad(0x127),'description':a19_0x9ac1ad(0x112),'risk':a19_0x9ac1ad(0x11a),'flags':[{'name':a19_0x9ac1ad(0x10f),'type':a19_0x9ac1ad(0x110),'description':a19_0x9ac1ad(0x117)},{...CODE_FLAG,'required':![],'description':a19_0x9ac1ad(0x11c)}],async 'execute'(_0x5651ef){const _0x34bbe7=a19_0x9ac1ad,_0x19984b=_0x5651ef['str'](_0x34bbe7(0x10f)),_0x4a98d7=_0x5651ef[_0x34bbe7(0x124)]('code'),_0x486d5f=await listDatasets(_0x5651ef[_0x34bbe7(0x123)],{..._0x19984b&&{'name':_0x19984b},..._0x4a98d7&&{'code':_0x4a98d7}});return{'ok':!![],'data':{'total':_0x486d5f['length'],'datasets':_0x486d5f[_0x34bbe7(0x11e)](_0x2fdbbe=>{const _0xf2fda0=_0x34bbe7,_0x5cb12a=_0x2fdbbe['dbtableConfig']??{};return{'id':_0x2fdbbe['id'],'code':_0x2fdbbe[_0xf2fda0(0x11d)],'name':_0x2fdbbe[_0xf2fda0(0x10f)],'source':_0x2fdbbe[_0xf2fda0(0x120)],'description':_0x2fdbbe[_0xf2fda0(0x111)],'table':_0x5cb12a[_0xf2fda0(0x115)],'datasetKey':_0x5cb12a[_0xf2fda0(0x113)],'pk':_0x5cb12a[_0xf2fda0(0x10c)],'fields':_0x5cb12a['allFields']?_0x5cb12a['allFields']['split'](',')[_0xf2fda0(0x11e)](_0x53d4cc=>_0x53d4cc['trim']()):[]};})}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x1642d6=a20_0x44e1;(function(_0x2ec10e,_0x37bd1f){const _0x4fbb0c=a20_0x44e1,_0x2906c4=_0x2ec10e();while(!![]){try{const _0x247529=-parseInt(_0x4fbb0c(0x168))/0x1*(parseInt(_0x4fbb0c(0x14b))/0x2)+parseInt(_0x4fbb0c(0x124))/0x3+parseInt(_0x4fbb0c(0x142))/0x4*(-parseInt(_0x4fbb0c(0x152))/0x5)+-parseInt(_0x4fbb0c(0x16a))/0x6*(parseInt(_0x4fbb0c(0x131))/0x7)+-parseInt(_0x4fbb0c(0x156))/0x8*(-parseInt(_0x4fbb0c(0x128))/0x9)+-parseInt(_0x4fbb0c(0x12a))/0xa+parseInt(_0x4fbb0c(0x12f))/0xb;if(_0x247529===_0x37bd1f)break;else _0x2906c4['push'](_0x2906c4['shift']());}catch(_0x241f62){_0x2906c4['push'](_0x2906c4['shift']());}}}(a20_0x6ded,0x80cc7));import a20_0x34aea2 from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';function a20_0x6ded(){const _0x1174f9=['1966160KZcmRD','\x20\x20Config\x20Files','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20doctor','\x20\x20Config\x20JSON','16329786Phflle','\x20(legacy/compat\x20only)','21CKxaFj','version','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','bold','(default)','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','accessKey','(default:\x20','message','⚠\x20Empty\x20(treated\x20as\x20{})','\x20\x20Auth','\x20\x20API\x20Endpoints','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','env','ClientAk','1077924oGFWUs','\x20\x20Session\x20check:\x20\x20\x20','(missing)','(none)','\x20(accessKey)','arch','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','doctor','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','2odicZs','(removed\x20—\x20cookie\x20auth\x20disabled)','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','missing','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','red','gray','15ZJLqUG','status','currentApp','platform','224NGNdmc','Project','format','green','defaultApp','repeat','(not\x20set)','(no\x20file)','check','pageSize','(not\x20found)','\x20\x20Merged\x20Config','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','✗\x20Invalid\x20JSON','locale','empty','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','394115yFzREV','length','224754DXEdeb','log','read','154188YAxPKV','\x20\x20─','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','appCode','161739uAzxnF','padEnd'];a20_0x6ded=function(){return _0x1174f9;};return a20_0x6ded();}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_0x44e1(_0x3f91cf,_0x4bcca0){_0x3f91cf=_0x3f91cf-0x123;const _0x6ded91=a20_0x6ded();let _0x44e1fa=_0x6ded91[_0x3f91cf];return _0x44e1fa;}async function execute(_0x1a7d73){const _0x5493b3=a20_0x44e1,_0x4ce657=getCliVersion(),_0x238a12=buildConfigFromFlags({});await initGlobalEnvironment(_0x238a12),console['log'](),console[_0x5493b3(0x16b)](a20_0x34aea2[_0x5493b3(0x135)](CLI_BIN_NAME+_0x5493b3(0x12d))),console[_0x5493b3(0x16b)](a20_0x34aea2[_0x5493b3(0x151)]('─'[_0x5493b3(0x15b)](0x32))),console[_0x5493b3(0x16b)](_0x5493b3(0x162)+_0x4ce657),console[_0x5493b3(0x16b)](_0x5493b3(0x12c)+process[_0x5493b3(0x132)]),console[_0x5493b3(0x16b)]('\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20'+process[_0x5493b3(0x155)]+'\x20'+process[_0x5493b3(0x147)]),console[_0x5493b3(0x16b)](),console[_0x5493b3(0x16b)](a20_0x34aea2[_0x5493b3(0x135)](_0x5493b3(0x12b))),console[_0x5493b3(0x16b)](a20_0x34aea2[_0x5493b3(0x151)]('\x20\x20─'['repeat'](0x1e)));const _0x424902=getGlobalConfigPath(),_0x432f90=getProjectConfigPath();console[_0x5493b3(0x16b)](_0x5493b3(0x137)+(_0x424902||a20_0x34aea2[_0x5493b3(0x151)]('(not\x20found)'))),console[_0x5493b3(0x16b)](_0x5493b3(0x126)+(_0x432f90||a20_0x34aea2[_0x5493b3(0x151)](_0x5493b3(0x160)))),console[_0x5493b3(0x16b)](),console[_0x5493b3(0x16b)](a20_0x34aea2[_0x5493b3(0x135)](_0x5493b3(0x12e))),console[_0x5493b3(0x16b)](a20_0x34aea2[_0x5493b3(0x151)](_0x5493b3(0x125)[_0x5493b3(0x15b)](0x1e)));const _0x34e5c0=(_0x387277,_0x224313)=>{const _0x9476a6=_0x5493b3;if(!_0x224313){console[_0x9476a6(0x16b)]('\x20\x20'+_0x387277[_0x9476a6(0x129)](0x11)+'\x20'+a20_0x34aea2[_0x9476a6(0x151)](_0x9476a6(0x15d)));return;}const _0x63ad4=inspectCliConfigJsonFile(_0x224313);if(_0x63ad4['status']==='ok')console[_0x9476a6(0x16b)]('\x20\x20'+_0x387277['padEnd'](0x11)+'\x20'+a20_0x34aea2[_0x9476a6(0x159)]('✓\x20Valid\x20JSON'));else{if(_0x63ad4['status']===_0x9476a6(0x165))console[_0x9476a6(0x16b)]('\x20\x20'+_0x387277[_0x9476a6(0x129)](0x11)+'\x20'+a20_0x34aea2['yellow'](_0x9476a6(0x13c)));else _0x63ad4[_0x9476a6(0x153)]===_0x9476a6(0x14e)?console[_0x9476a6(0x16b)]('\x20\x20'+_0x387277[_0x9476a6(0x129)](0x11)+'\x20'+a20_0x34aea2[_0x9476a6(0x151)](_0x9476a6(0x144))):(console['log']('\x20\x20'+_0x387277['padEnd'](0x11)+'\x20'+a20_0x34aea2['red'](_0x9476a6(0x163))),console[_0x9476a6(0x16b)]('\x20\x20'+''[_0x9476a6(0x129)](0x11)+'\x20'+a20_0x34aea2['red'](_0x63ad4[_0x9476a6(0x13b)])));}};_0x34e5c0('Global',_0x424902),_0x34e5c0(_0x5493b3(0x157),_0x432f90),console['log'](),console[_0x5493b3(0x16b)](a20_0x34aea2[_0x5493b3(0x135)](_0x5493b3(0x161))),console['log'](a20_0x34aea2['gray']('\x20\x20─'[_0x5493b3(0x15b)](0x1e))),console[_0x5493b3(0x16b)](_0x5493b3(0x14a)+(_0x238a12[_0x5493b3(0x127)]||a20_0x34aea2[_0x5493b3(0x150)](_0x5493b3(0x15c)))),console[_0x5493b3(0x16b)](_0x5493b3(0x14f)+_0x238a12[_0x5493b3(0x140)]);const _0x24a716=isLegacyCompatConfigKey('locale')?a20_0x34aea2[_0x5493b3(0x151)](_0x238a12[_0x5493b3(0x164)]+_0x5493b3(0x130)):_0x238a12['locale'];return console[_0x5493b3(0x16b)](_0x5493b3(0x167)+_0x24a716),console[_0x5493b3(0x16b)](_0x5493b3(0x14d)+(_0x238a12[_0x5493b3(0x15a)]||a20_0x34aea2[_0x5493b3(0x151)](_0x5493b3(0x145)))),console['log'](_0x5493b3(0x134)+(_0x238a12[_0x5493b3(0x154)]||a20_0x34aea2[_0x5493b3(0x151)](_0x5493b3(0x145)))),console['log']('\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x238a12[_0x5493b3(0x158)]||a20_0x34aea2[_0x5493b3(0x151)](_0x5493b3(0x13a)+DEFAULT_CONFIG_VALUES[_0x5493b3(0x158)]+')'))),console[_0x5493b3(0x16b)](_0x5493b3(0x13f)+(_0x238a12[_0x5493b3(0x15f)]??a20_0x34aea2[_0x5493b3(0x151)](_0x5493b3(0x136)))),console[_0x5493b3(0x16b)](_0x5493b3(0x138)+_0x238a12['riskLevel']),console[_0x5493b3(0x16b)]('\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x238a12['verbose']),console[_0x5493b3(0x16b)]('\x20\x20auth\x20(effective):\x20'+AUTH_MODE[_0x5493b3(0x141)]),console[_0x5493b3(0x16b)](_0x5493b3(0x133)+(_0x238a12[_0x5493b3(0x139)]?a20_0x34aea2['green']('(set,\x20length='+_0x238a12['accessKey'][_0x5493b3(0x169)]+')'):a20_0x34aea2[_0x5493b3(0x151)]('(none)'))),console[_0x5493b3(0x16b)](),console[_0x5493b3(0x16b)](a20_0x34aea2[_0x5493b3(0x135)](_0x5493b3(0x13e))),console[_0x5493b3(0x16b)](a20_0x34aea2[_0x5493b3(0x151)]('\x20\x20─'['repeat'](0x1e))),console['log']('\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20'+getApiDomain()),console[_0x5493b3(0x16b)](_0x5493b3(0x148)+getUserDomain()),console[_0x5493b3(0x16b)]('\x20\x20runtimeDomain:\x20\x20\x20'+getRuntimeDomain()),console[_0x5493b3(0x16b)](),console[_0x5493b3(0x16b)](a20_0x34aea2[_0x5493b3(0x135)](_0x5493b3(0x13d))),console[_0x5493b3(0x16b)](a20_0x34aea2[_0x5493b3(0x151)]('\x20\x20─'['repeat'](0x1e))),console[_0x5493b3(0x16b)](_0x5493b3(0x166)+a20_0x34aea2[_0x5493b3(0x159)](AUTH_MODE[_0x5493b3(0x141)]+_0x5493b3(0x146))),console[_0x5493b3(0x16b)](_0x5493b3(0x143)+a20_0x34aea2[_0x5493b3(0x151)](_0x5493b3(0x14c))),console[_0x5493b3(0x16b)](),{'ok':!![]};}export const doctorDefinition={'service':a20_0x1642d6(0x149),'command':a20_0x1642d6(0x15e),'description':'Diagnose\x20CLI\x20configuration\x20and\x20environment','risk':a20_0x1642d6(0x123),'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_0x114dd2=a21_0x8934;(function(_0x15db57,_0x19eb01){const _0x1cf283=a21_0x8934,_0x5e0463=_0x15db57();while(!![]){try{const _0x8c6b49=parseInt(_0x1cf283(0x8c))/0x1*(-parseInt(_0x1cf283(0xb0))/0x2)+-parseInt(_0x1cf283(0x9e))/0x3+-parseInt(_0x1cf283(0x87))/0x4+parseInt(_0x1cf283(0x77))/0x5*(parseInt(_0x1cf283(0xae))/0x6)+-parseInt(_0x1cf283(0xaf))/0x7*(-parseInt(_0x1cf283(0xa1))/0x8)+-parseInt(_0x1cf283(0x89))/0x9+parseInt(_0x1cf283(0xa9))/0xa;if(_0x8c6b49===_0x19eb01)break;else _0x5e0463['push'](_0x5e0463['shift']());}catch(_0x39a90b){_0x5e0463['push'](_0x5e0463['shift']());}}}(a21_0x2614,0x994f7));function a21_0x8934(_0x18678d,_0x1843d0){_0x18678d=_0x18678d-0x74;const _0x2614d7=a21_0x2614();let _0x893449=_0x2614d7[_0x18678d];return _0x893449;}import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':'appcode','type':a21_0x114dd2(0x88),'description':a21_0x114dd2(0x98)},{'name':a21_0x114dd2(0x92),'type':a21_0x114dd2(0x88),'description':a21_0x114dd2(0xb3)+DEFAULT_CONFIG_VALUES[a21_0x114dd2(0x92)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x114dd2(0x9c),'type':a21_0x114dd2(0x76),'description':a21_0x114dd2(0x75)+PRODUCT_CONFIG['newConfigFileName']+')\x20instead\x20of\x20project','default':![]},{'name':a21_0x114dd2(0xac),'type':a21_0x114dd2(0x76),'description':a21_0x114dd2(0xb2),'default':![]}];export const initImportFlagDefs=[{'name':a21_0x114dd2(0x9b),'type':'string','description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':a21_0x114dd2(0xb9),'type':'string','description':a21_0x114dd2(0xa6)},{'name':'env','type':a21_0x114dd2(0x88),'description':a21_0x114dd2(0x9a),'enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x114dd2(0x9c),'type':a21_0x114dd2(0x76),'description':a21_0x114dd2(0x75)+PRODUCT_CONFIG[a21_0x114dd2(0x78)]+a21_0x114dd2(0x8a),'default':![]},{'name':a21_0x114dd2(0xac),'type':a21_0x114dd2(0x76),'description':a21_0x114dd2(0xb2),'default':![]}];export async function runInit(_0x81ed92){const _0x21af2c=a21_0x114dd2,_0x2dad08=isNonInteractiveMode(_0x81ed92),_0xd57ee3=_0x81ed92[_0x21af2c(0x9c)]?_0x21af2c(0x9c):_0x21af2c(0x97),_0x36e52f=resolveWriteConfigPath(_0xd57ee3);try{_0x2dad08?await runNonInteractive(_0x81ed92,_0x36e52f):await runInteractive(_0x81ed92,_0x36e52f);}catch(_0x71719){if(_0x71719 instanceof AbortPrompt)throw CliErrors[_0x21af2c(0x7f)]();throw _0x71719;}}export async function runInitImport(_0x1db03d){const _0xb4bc5b=a21_0x114dd2,_0x16141a=_0x1db03d[_0xb4bc5b(0x9c)]?'global':'project',_0x19a35c=resolveWriteConfigPath(_0x16141a);await runFromImport(_0x1db03d,_0x19a35c);}const RUNTIME_IRRELEVANT_KEYS=new Set(['apiDir']);async function runFromImport(_0x1f5f4a,_0x2148e7){const _0x169f6d=a21_0x114dd2,_0x149426=resolveFilePath(_0x1f5f4a['file']);if(!existsSync(_0x149426))throw CliErrors[_0x169f6d(0x81)](_0x169f6d(0x7b)+_0x149426);const _0x4dc49b=readSourceFile(_0x149426),_0x1d366c=convertToRuntimeConfig(_0x4dc49b);_0x1f5f4a[_0x169f6d(0xb9)]&&(_0x1d366c[_0x169f6d(0xb9)]=String(_0x1f5f4a['appcode']));_0x1f5f4a['env']&&(_0x1d366c[_0x169f6d(0x92)]=resolveInitEnv(_0x1f5f4a));if(!_0x1d366c[_0x169f6d(0xb9)])throw CliErrors[_0x169f6d(0x81)](_0x169f6d(0x95),_0x169f6d(0xa2));await writeInitConfig(_0x2148e7,_0x1d366c,_0x1f5f4a),console['log'](_0x169f6d(0xa8)+_0x149426),console[_0x169f6d(0x74)]('\x20\x20config:\x20\x20'+_0x2148e7),console['log'](_0x169f6d(0x99)+_0x1d366c['appcode']);if(_0x1d366c[_0x169f6d(0x96)])console[_0x169f6d(0x74)](_0x169f6d(0x8d)+_0x1d366c[_0x169f6d(0x96)]);}function convertToRuntimeConfig(_0x254e1a){const _0x3e209d=a21_0x114dd2;if(_0x254e1a['apps']&&typeof _0x254e1a[_0x3e209d(0x86)]===_0x3e209d(0xb1))throw CliErrors[_0x3e209d(0x81)](_0x3e209d(0xa5),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x2d80a6={};for(const _0x4d1135 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x254e1a[_0x4d1135]!==undefined&&(_0x2d80a6[_0x4d1135]=_0x254e1a[_0x4d1135]);}return!_0x2d80a6[_0x3e209d(0x79)]&&(_0x2d80a6[_0x3e209d(0x79)]=DEFAULT_CONFIG_VALUES[_0x3e209d(0x79)]),_0x2d80a6;}async function runNonInteractive(_0x51f8ed,_0x532f96){const _0x2b3431=a21_0x114dd2,_0x165716=_0x51f8ed['appcode'];if(!_0x165716)throw CliErrors['flagMissing'](_0x2b3431(0xb9),_0x2b3431(0x9f)+CLI_BIN_NAME+_0x2b3431(0xa0));const _0x38acef=resolveInitEnv(_0x51f8ed);await writeInitConfig(_0x532f96,{'appcode':_0x165716,'env':_0x38acef},_0x51f8ed),console['log'](_0x2b3431(0x80)+_0x532f96),console[_0x2b3431(0x74)](_0x2b3431(0x99)+_0x165716),console[_0x2b3431(0x74)](_0x2b3431(0x7c)+_0x38acef);}async function runInteractive(_0x40c626,_0x43c0d5){const _0x1f76af=a21_0x114dd2,_0x23db01=loadExisting(_0x43c0d5),_0x3aba95=typeof _0x23db01?.[_0x1f76af(0xb9)]===_0x1f76af(0x88)?_0x23db01[_0x1f76af(0xb9)]:'',_0xf630dd=resolveInitEnv(_0x40c626);console[_0x1f76af(0x74)](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG[_0x1f76af(0x78)]+'\x0a');if(existsSync(_0x43c0d5)&&!_0x40c626[_0x1f76af(0xac)]){const _0x3c541a=await promptYesNo(_0x1f76af(0x7e)+_0x43c0d5+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x3c541a){console[_0x1f76af(0x74)]('Aborted.');return;}}const _0x5597d4=typeof _0x40c626[_0x1f76af(0xb9)]===_0x1f76af(0x88)?_0x40c626[_0x1f76af(0xb9)]['trim']():'';let _0x4606c5=_0x5597d4;!_0x4606c5&&(_0x4606c5=await promptInput(_0x1f76af(0x9d),_0x3aba95));if(!_0x4606c5[_0x1f76af(0xb8)]())throw CliErrors['validation'](_0x1f76af(0x91));await writeInitConfig(_0x43c0d5,{'appcode':_0x4606c5['trim'](),'env':_0xf630dd},_0x40c626),console[_0x1f76af(0x74)]('\x0aInitialized\x20'+_0x43c0d5),console[_0x1f76af(0x74)](_0x1f76af(0x99)+_0x4606c5[_0x1f76af(0xb8)]()),console[_0x1f76af(0x74)](_0x1f76af(0x7c)+_0xf630dd);}async function writeInitConfig(_0x42a20b,_0x496392,_0x2d1c01){const _0x5cbfb1=a21_0x114dd2;let _0xd32b57={};existsSync(_0x42a20b)&&!_0x2d1c01[_0x5cbfb1(0xac)]&&(_0xd32b57=readConfigFile(_0x42a20b));for(const [_0x1039c4,_0x15d6c8]of Object[_0x5cbfb1(0x8e)](_0x496392)){_0x15d6c8!==undefined&&(_0xd32b57[_0x1039c4]=_0x15d6c8);}if(_0xd32b57[_0x5cbfb1(0xab)])delete _0xd32b57[_0x5cbfb1(0xab)];writeConfigFile(_0x42a20b,_0xd32b57);}class AbortPrompt extends Error{constructor(){const _0x2eeef9=a21_0x114dd2;super(_0x2eeef9(0xb7)),this[_0x2eeef9(0xb6)]=_0x2eeef9(0x94);}}function createSafeRl(){const _0x9df4a2=a21_0x114dd2,_0x3e2422=createInterface({'input':process[_0x9df4a2(0x83)],'output':process['stdout']});let _0x3fa635;const _0x36e0df=new Promise((_0x56efe7,_0x2e9944)=>{const _0x42dfb8=_0x9df4a2;_0x3fa635=()=>{const _0x43495d=a21_0x8934;_0x3fa635&&(_0x3e2422['removeListener'](_0x43495d(0x84),_0x3fa635),_0x3fa635=undefined);try{_0x3e2422[_0x43495d(0xa4)]();}catch{}_0x2e9944(new AbortPrompt());},_0x3e2422['once'](_0x42dfb8(0x84),_0x3fa635);}),_0x200c98=()=>{const _0x420031=_0x9df4a2;_0x3fa635&&(_0x3e2422[_0x420031(0x93)]('SIGINT',_0x3fa635),_0x3fa635=undefined);try{_0x3e2422[_0x420031(0xa4)]();}catch{}};return{'rl':_0x3e2422,'abortPromise':_0x36e0df,'disposeSuccess':_0x200c98};}async function promptInput(_0x685b52,_0x420bf1){const _0x5d5887=a21_0x114dd2,{rl:_0x267b2f,abortPromise:_0x1a7f35,disposeSuccess:_0x8d4198}=createSafeRl(),_0x230ca4=new Promise(_0x2fc58a=>{const _0xed640c=a21_0x8934,_0x5b5fc7=_0x420bf1?'\x20\x20'+_0x685b52+'\x20('+_0x420bf1+_0xed640c(0xa3):'\x20\x20'+_0x685b52+':\x20';_0x267b2f[_0xed640c(0xba)](_0x5b5fc7,_0x48ec05=>{_0x8d4198(),_0x2fc58a(_0x48ec05['trim']()||_0x420bf1);});});return Promise[_0x5d5887(0x7d)]([_0x230ca4,_0x1a7f35]);}async function promptYesNo(_0xf66051,_0x54fec2){const _0x3a2c76=a21_0x114dd2,{rl:_0x38b594,abortPromise:_0x2c0519,disposeSuccess:_0xfd8337}=createSafeRl(),_0x40a741=new Promise(_0x50e672=>{const _0x4de353=a21_0x8934,_0x33e06f=_0x54fec2?_0x4de353(0x82):_0x4de353(0xb5);_0x38b594[_0x4de353(0xba)]('\x20\x20'+_0xf66051+'\x20'+_0x33e06f+':\x20',_0x83f998=>{const _0x332403=_0x4de353;_0xfd8337();const _0x4c21fb=_0x83f998[_0x332403(0xb8)]()[_0x332403(0x8b)]();if(_0x4c21fb==='y'||_0x4c21fb===_0x332403(0xac))_0x50e672(!![]);else{if(_0x4c21fb==='n'||_0x4c21fb==='no')_0x50e672(![]);else _0x50e672(_0x54fec2);}});});return Promise[_0x3a2c76(0x7d)]([_0x40a741,_0x2c0519]);}function loadExisting(_0x26d563){if(!existsSync(_0x26d563))return null;return readConfigFile(_0x26d563);}function resolveFilePath(_0x441ed6){const _0xb69a97=a21_0x114dd2;return isAbsolute(_0x441ed6)?_0x441ed6:resolve(process[_0xb69a97(0xb4)](),_0x441ed6);}function a21_0x2614(){const _0x3a614b=['File\x20','cancelled','Initialized\x20','validation','[Y/n]','stdin','SIGINT','\x22.\x20Allowed:\x20','apps','3170236YCbnJs','string','6699969lMMODN',')\x20instead\x20of\x20project','toLowerCase','26186iPVePY','\x20\x20default:\x20','entries','message','includes','App\x20code\x20cannot\x20be\x20empty.','env','removeListener','AbortPrompt','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','defaultApp','project','App\x20code\x20for\x20the\x20project','\x20\x20appcode:\x20','Override\x20imported\x20default\x20env','file','global','App\x20code','1047162inMPHK','Usage:\x20','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','1665864BMpEnj','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`.','):\x20','close','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Override\x20imported\x20default\x20appcode','join','Imported\x20from\x20','16348440UYAOnD','utf8','app','yes','Failed\x20to\x20parse\x20source\x20file:\x20','12YLXxqP','21BuIGnG','76fjGGWn','object','Skip\x20confirmation\x20when\x20overwriting','Target\x20environment\x20(default\x20','cwd','[y/N]','name','User\x20aborted\x20prompt','trim','appcode','question','log','Write\x20to\x20global\x20(~/','boolean','3123845HtxOTU','newConfigFileName','riskLevel','Invalid\x20env\x20\x22','Source\x20file\x20not\x20found:\x20','\x20\x20env:\x20\x20\x20\x20\x20','race'];a21_0x2614=function(){return _0x3a614b;};return a21_0x2614();}function readSourceFile(_0x175601){const _0x7e3624=a21_0x114dd2;try{const _0x253356=readFileSync(_0x175601,{'encoding':_0x7e3624(0xaa)});return JSON['parse'](_0x253356);}catch(_0x391c15){throw CliErrors[_0x7e3624(0x81)](_0x7e3624(0xad)+_0x391c15[_0x7e3624(0x8f)]);}}function resolveInitEnv(_0xe92743){const _0x2bcfa6=a21_0x114dd2,_0x56fa50=_0xe92743['env'];if(_0x56fa50===undefined||_0x56fa50==='')return DEFAULT_CONFIG_VALUES[_0x2bcfa6(0x92)];if(!RUNTIME_ENV_VALUES[_0x2bcfa6(0x90)](_0x56fa50))throw CliErrors[_0x2bcfa6(0x81)](_0x2bcfa6(0x7a)+_0x56fa50+_0x2bcfa6(0x85)+RUNTIME_ENV_VALUES[_0x2bcfa6(0xa7)](',\x20'));return _0x56fa50;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a22_0x12ac49=a22_0x1767;(function(_0x40ef10,_0x3e2937){const _0xe97861=a22_0x1767,_0x297151=_0x40ef10();while(!![]){try{const _0x32f698=-parseInt(_0xe97861(0x131))/0x1+parseInt(_0xe97861(0x100))/0x2+parseInt(_0xe97861(0x10e))/0x3*(parseInt(_0xe97861(0x11d))/0x4)+parseInt(_0xe97861(0x11f))/0x5+parseInt(_0xe97861(0x109))/0x6+-parseInt(_0xe97861(0x10d))/0x7*(parseInt(_0xe97861(0x11e))/0x8)+-parseInt(_0xe97861(0x10b))/0x9;if(_0x32f698===_0x3e2937)break;else _0x297151['push'](_0x297151['shift']());}catch(_0x50ae74){_0x297151['push'](_0x297151['shift']());}}}(a22_0x2f46,0x6f44b));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':'title','type':a22_0x12ac49(0x11b),'required':!![],'description':a22_0x12ac49(0x119)},FILE_FLAG={'name':a22_0x12ac49(0x117),'type':a22_0x12ac49(0x11b),'required':!![],'description':'Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file'},QUERY_FLAG={'name':a22_0x12ac49(0xfa),'type':a22_0x12ac49(0x11b),'required':!![],'description':a22_0x12ac49(0x120)},TOPK_FLAG={'name':a22_0x12ac49(0x103),'type':'number','description':a22_0x12ac49(0xfd)};function readKnowledgeFile(_0xc2cc96){const _0x4d2c9b=a22_0x12ac49;if(!_0xc2cc96)throw CliErrors[_0x4d2c9b(0x115)](_0x4d2c9b(0x107));if(!existsSync(_0xc2cc96))throw CliErrors[_0x4d2c9b(0x115)](_0x4d2c9b(0x130)+_0xc2cc96);if(!statSync(_0xc2cc96)['isFile']())throw CliErrors['validation']('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0xc2cc96);return readFileSync(_0xc2cc96,'utf8');}function summarizePersonalItem(_0x376ec3){const _0x47b002=a22_0x12ac49;return{'id':_0x376ec3['id'],'title':_0x376ec3['title'],'version':_0x376ec3[_0x47b002(0x101)],'ragStatus':_0x376ec3[_0x47b002(0x12f)],'ragErrorMessage':_0x376ec3[_0x47b002(0xfb)],'updateTime':_0x376ec3[_0x47b002(0x123)]};}function detailPersonalItem(_0x3f24a1){const _0x54f69d=a22_0x12ac49;return{'id':_0x3f24a1['id'],'appCode':_0x3f24a1['appCode'],'scope':_0x3f24a1[_0x54f69d(0x10c)],'userId':_0x3f24a1['userId'],'title':_0x3f24a1[_0x54f69d(0x128)],'content':_0x3f24a1[_0x54f69d(0x112)]??'','version':_0x3f24a1['version'],'ragStatus':_0x3f24a1['ragStatus'],'ragErrorMessage':_0x3f24a1[_0x54f69d(0xfb)],'createTime':_0x3f24a1[_0x54f69d(0x116)],'updateTime':_0x3f24a1[_0x54f69d(0x123)]};}function summarizeSearchHit(_0x18bb6f){const _0x5d111c=a22_0x12ac49;return{'scope':_0x18bb6f[_0x5d111c(0x10c)],'docId':_0x18bb6f[_0x5d111c(0x122)],'score':_0x18bb6f[_0x5d111c(0x110)],'weightedScore':_0x18bb6f[_0x5d111c(0xf9)],'content':_0x18bb6f[_0x5d111c(0x112)],'metadata':_0x18bb6f['metadata']};}function a22_0x1767(_0x13117b,_0x2aa12e){_0x13117b=_0x13117b-0xf8;const _0x2f4663=a22_0x2f46();let _0x176762=_0x2f4663[_0x13117b];return _0x176762;}function readTopK(_0x66992c){const _0x339bb1=a22_0x12ac49,_0x4147af=_0x66992c[_0x339bb1(0x113)](_0x339bb1(0x103));if(_0x4147af===undefined||_0x4147af===null||_0x4147af==='')return undefined;const _0xbdb91d=_0x66992c['num'](_0x339bb1(0x103));if(!Number[_0x339bb1(0x11a)](_0xbdb91d)||_0xbdb91d<0x1)throw CliErrors[_0x339bb1(0x115)]('--topk\x20must\x20be\x20a\x20positive\x20number.');return _0xbdb91d;}const kbList={'service':'kb','command':a22_0x12ac49(0x108),'description':a22_0x12ac49(0x106),'risk':a22_0x12ac49(0xf8),'flags':[VERBOSE_FLAG],async 'execute'(_0x5f5419){const _0x173b17=a22_0x12ac49,_0x415b98=await listPersonalKnowledgeBaseItems(_0x5f5419['appCode']);if(_0x5f5419[_0x173b17(0xfc)]('verbose'))return{'ok':!![],'data':{'total':_0x415b98['length'],'items':_0x415b98}};return{'ok':!![],'data':{'total':_0x415b98[_0x173b17(0x11c)],'items':_0x415b98[_0x173b17(0x126)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a22_0x12ac49(0x12b),'description':a22_0x12ac49(0x12a),'risk':a22_0x12ac49(0xf8),'flags':[{...ID_FLAG,'description':'Personal\x20knowledge-base\x20entry\x20ID'}],async 'execute'(_0x5de639){const _0x1a0111=a22_0x12ac49,_0x5acfc4=await getPersonalKnowledgeBaseItem(_0x5de639[_0x1a0111(0x114)]('id'),_0x5de639[_0x1a0111(0x12d)]);return{'ok':!![],'data':detailPersonalItem(_0x5acfc4)};}},kbCreate={'service':'kb','command':'create','description':a22_0x12ac49(0x129),'risk':'write','flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x1d29ee){const _0xa2316a=a22_0x12ac49,_0x1dc9e6=_0x1d29ee[_0xa2316a(0x12c)](_0xa2316a(0x128)),_0x206b9f=readKnowledgeFile(_0x1d29ee['str'](_0xa2316a(0x117))),_0x526688=await createPersonalKnowledgeBaseItem(_0x1d29ee[_0xa2316a(0x12d)],{'title':_0x1dc9e6,'content':_0x206b9f});return{'ok':!![],'data':summarizePersonalItem(_0x526688),'message':'Created\x20KB\x20entry\x20'+_0x526688['id']+'\x20('+_0x526688['title']+')'};},async 'dryRun'(_0x13bc9b){const _0xc53e9f=a22_0x12ac49,_0xf2b9f9=_0x13bc9b[_0xc53e9f(0x12c)](_0xc53e9f(0x128)),_0x1e24ba=readKnowledgeFile(_0x13bc9b[_0xc53e9f(0x12c)](_0xc53e9f(0x117)));return dryRun(_0xc53e9f(0x124),_0xc53e9f(0x121))[_0xc53e9f(0x132)]({'appCode':_0x13bc9b['appCode'],'title':_0xf2b9f9,'content':_0x1e24ba})[_0xc53e9f(0x10a)](_0xc53e9f(0x133)+_0xf2b9f9+'\x22')[_0xc53e9f(0xff)]();}},kbUpdate={'service':'kb','command':'update','description':a22_0x12ac49(0x10f),'risk':a22_0x12ac49(0x104),'flags':[{...ID_FLAG,'description':a22_0x12ac49(0x102)},{...TITLE_FLAG,'required':![],'description':'Override\x20the\x20existing\x20entry\x20title'},FILE_FLAG],async 'execute'(_0x4235c6){const _0xe063e=a22_0x12ac49,_0x551ff4=_0x4235c6['num']('id'),_0x445c53=readKnowledgeFile(_0x4235c6[_0xe063e(0x12c)]('file')),_0x3bafc0=_0x4235c6[_0xe063e(0x12c)](_0xe063e(0x128))||(await getPersonalKnowledgeBaseItem(_0x551ff4,_0x4235c6[_0xe063e(0x12d)]))[_0xe063e(0x128)],_0x540ac6=await updatePersonalKnowledgeBaseItem(_0x551ff4,_0x4235c6['appCode'],{'title':_0x3bafc0,'content':_0x445c53});return{'ok':!![],'data':summarizePersonalItem(_0x540ac6),'message':_0xe063e(0x12e)+_0x540ac6['id']+'\x20('+_0x540ac6[_0xe063e(0x128)]+')'};},async 'dryRun'(_0x259588){const _0x42f750=a22_0x12ac49,_0x4fc4d4=_0x259588[_0x42f750(0x114)]('id'),_0xe155ec=readKnowledgeFile(_0x259588[_0x42f750(0x12c)](_0x42f750(0x117))),_0x3c0d92=_0x259588[_0x42f750(0x12c)](_0x42f750(0x128))||(await getPersonalKnowledgeBaseItem(_0x4fc4d4,_0x259588[_0x42f750(0x12d)]))[_0x42f750(0x128)];return dryRun(_0x42f750(0x124),_0x42f750(0xfe)+_0x4fc4d4+'/update')[_0x42f750(0x132)]({'appCode':_0x259588[_0x42f750(0x12d)],'title':_0x3c0d92,'content':_0xe155ec})[_0x42f750(0x10a)](_0x42f750(0x105)+_0x4fc4d4)['build']();}},kbSearch={'service':'kb','command':a22_0x12ac49(0x125),'description':a22_0x12ac49(0x111),'risk':a22_0x12ac49(0xf8),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x30e3fa){const _0x281880=a22_0x12ac49;if(!_0x30e3fa['str']('query')[_0x281880(0x127)]())throw CliErrors['validation'](_0x281880(0x118));readTopK(_0x30e3fa);},async 'execute'(_0x2a27ee){const _0x56b167=a22_0x12ac49,_0x5b70d7=_0x2a27ee[_0x56b167(0x12c)](_0x56b167(0xfa))['trim'](),_0x667150=readTopK(_0x2a27ee),_0x343aa2=await searchKnowledgeBase(_0x2a27ee[_0x56b167(0x12d)],{'query':_0x5b70d7,'topK':_0x667150});return{'ok':!![],'data':{'total':_0x343aa2[_0x56b167(0x11c)],'hits':_0x343aa2[_0x56b167(0x126)](summarizeSearchHit)}};}};function a22_0x2f46(){const _0x2c9b1c=['ragStatus','File\x20not\x20found:\x20','666285lDojQY','body','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','read','weightedScore','query','ragErrorMessage','bool','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','/client/knowledge-base/personal/','build','1484326bdnUoK','version','Personal\x20knowledge-base\x20entry\x20ID','topk','write','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','File\x20path\x20is\x20required.','list','199716aAreMD','description','4666284rYsskv','scope','161NJSKVm','3UyBuxZ','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','score','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','content','flag','num','validation','createTime','file','Search\x20query\x20is\x20required.','Personal\x20knowledge-base\x20entry\x20title','isFinite','string','length','2977248ayYZbn','9096nyhvNr','734530SZklMt','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','/client/knowledge-base/personal/create','docId','updateTime','POST','search','map','trim','title','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','detail','str','appCode','Updated\x20KB\x20entry\x20'];a22_0x2f46=function(){return _0x2c9b1c;};return a22_0x2f46();}export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x277492=a23_0x2c21;function a23_0x2c21(_0x3c502c,_0x3d2452){_0x3c502c=_0x3c502c-0x141;const _0x1b07f0=a23_0x1b07();let _0x2c2153=_0x1b07f0[_0x3c502c];return _0x2c2153;}(function(_0x58fbfa,_0x12f282){const _0x3290e5=a23_0x2c21,_0x18a770=_0x58fbfa();while(!![]){try{const _0x27de4a=-parseInt(_0x3290e5(0x150))/0x1+-parseInt(_0x3290e5(0x144))/0x2*(-parseInt(_0x3290e5(0x15e))/0x3)+-parseInt(_0x3290e5(0x155))/0x4*(parseInt(_0x3290e5(0x15a))/0x5)+parseInt(_0x3290e5(0x15c))/0x6+-parseInt(_0x3290e5(0x14b))/0x7+-parseInt(_0x3290e5(0x15b))/0x8*(-parseInt(_0x3290e5(0x14d))/0x9)+parseInt(_0x3290e5(0x157))/0xa;if(_0x27de4a===_0x12f282)break;else _0x18a770['push'](_0x18a770['shift']());}catch(_0x50d8ca){_0x18a770['push'](_0x18a770['shift']());}}}(a23_0x1b07,0xc0025));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x107d67){const _0x4b3bea=a23_0x2c21;if(_0x107d67[_0x4b3bea(0x158)]===0x0){console[_0x4b3bea(0x14f)](_0x4b3bea(0x152));return;}console[_0x4b3bea(0x14f)]('*\x20'+CLI_DISPLAY_NAME+_0x4b3bea(0x148)),_0x107d67['forEach']((_0x1941a5,_0x12a7e6)=>{const _0x2d144b=_0x4b3bea,_0x3e040d=new Date(_0x1941a5['timestamp'])[_0x2d144b(0x15f)](_0x2d144b(0x166)),_0x17849e=_0x1941a5[_0x2d144b(0x143)]===_0x2d144b(0x14c)?'√':_0x1941a5['level']===_0x2d144b(0x160)?'×':_0x1941a5[_0x2d144b(0x143)]===_0x2d144b(0x153)?'!':'i';console[_0x2d144b(0x14f)](_0x12a7e6+0x1+'.\x20'+_0x17849e+'\x20['+_0x1941a5['command']+']\x20'+_0x1941a5[_0x2d144b(0x154)]),console[_0x2d144b(0x14f)](_0x2d144b(0x145)+_0x3e040d),_0x1941a5[_0x2d144b(0x159)]&&console[_0x2d144b(0x14f)](_0x2d144b(0x164)+_0x1941a5[_0x2d144b(0x159)]+'ms'),_0x1941a5[_0x2d144b(0x151)]&&Object[_0x2d144b(0x149)](_0x1941a5[_0x2d144b(0x151)])['length']>0x0&&console[_0x2d144b(0x14f)](_0x2d144b(0x162)+JSON[_0x2d144b(0x141)](_0x1941a5['details'],null,0x2)),console['log']('');});}function a23_0x1b07(){const _0x3333b5=['read','\x20logs:\x0a','keys','readLogs','6036842muNfEz','success','45gPwcuy','clearLogs','log','89681YjVURN','details','*\x20No\x20logs\x20found','warn','message','1984732VktmFt','write','17037800hdXhiK','length','duration','15qgRdyu','368128fikHgd','1265586aSnhEN','*\x20Logs\x20cleared','28734GYNQiE','toLocaleString','error','clear','\x20\x20\x20Details:\x20','View\x20command\x20history\x20logs','\x20\x20\x20Duration:\x20','Clear\x20command\x20history\x20logs','en-US','stringify','logs','level','226OYFFZv','\x20\x20\x20Time:\x20','show'];a23_0x1b07=function(){return _0x3333b5;};return a23_0x1b07();}export const logsDefinitions=[{'service':a23_0x277492(0x142),'command':a23_0x277492(0x146),'description':a23_0x277492(0x163),'risk':a23_0x277492(0x147),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3bd1ae){const _0x3dc4d0=a23_0x277492;return printLogs(logger[_0x3dc4d0(0x14a)]()),{'ok':!![]};}},{'service':a23_0x277492(0x142),'command':a23_0x277492(0x161),'description':a23_0x277492(0x165),'risk':a23_0x277492(0x156),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x302378){const _0x2de5b5=a23_0x277492;return logger[_0x2de5b5(0x14e)](),console[_0x2de5b5(0x14f)](_0x2de5b5(0x15d)),{'ok':!![]};}}];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x168297=a24_0x750c;(function(_0x184feb,_0x1fced8){const _0xf6fe2c=a24_0x750c,_0x5442c4=_0x184feb();while(!![]){try{const _0x3503ff=parseInt(_0xf6fe2c(0x1b1))/0x1*(parseInt(_0xf6fe2c(0x1ab))/0x2)+parseInt(_0xf6fe2c(0x1ce))/0x3*(parseInt(_0xf6fe2c(0x1aa))/0x4)+parseInt(_0xf6fe2c(0x1c3))/0x5*(parseInt(_0xf6fe2c(0x1b9))/0x6)+parseInt(_0xf6fe2c(0x1d1))/0x7*(parseInt(_0xf6fe2c(0x1cc))/0x8)+-parseInt(_0xf6fe2c(0x1c4))/0x9*(-parseInt(_0xf6fe2c(0x1a8))/0xa)+parseInt(_0xf6fe2c(0x1b5))/0xb*(parseInt(_0xf6fe2c(0x1c5))/0xc)+-parseInt(_0xf6fe2c(0x1b6))/0xd*(parseInt(_0xf6fe2c(0x1ac))/0xe);if(_0x3503ff===_0x1fced8)break;else _0x5442c4['push'](_0x5442c4['shift']());}catch(_0x346901){_0x5442c4['push'](_0x5442c4['shift']());}}}(a24_0xeb73,0x84ffd));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x74173a){const _0x537099=a24_0x750c;for(const _0x3b1052 of _0x74173a){definitions[_0x537099(0x1ba)](_0x3b1052[_0x537099(0x1cb)]+':'+_0x3b1052['command'],_0x3b1052);let _0x52707a=serviceGroups['get'](_0x3b1052['service']);!_0x52707a&&(_0x52707a=[],serviceGroups['set'](_0x3b1052[_0x537099(0x1cb)],_0x52707a)),_0x52707a[_0x537099(0x1c9)](_0x3b1052);}}function registerService(_0xd26322,_0x5019ec,_0xdadf7d){const _0x5c814d=a24_0x750c;registerDefinitions(_0x5019ec);const _0x3053aa=_0x3f93e5=>_0x3f93e5===_0x5c814d(0x1b4)?'':_0x3f93e5===_0x5c814d(0x1c0)?_0x5c814d(0x1cd):_0x5c814d(0x1b8),_0x319e17={'service':_0x5019ec[0x0][_0x5c814d(0x1cb)],'label':_0xd26322,'commands':_0x5019ec['map'](_0x5e2861=>({'command':_0x5e2861[_0x5c814d(0x1cf)],'description':_0x5e2861['description'],'tag':_0x3053aa(_0x5e2861[_0x5c814d(0x1b7)])})),'defaultCommand':_0xdadf7d?.[_0x5c814d(0x1b3)]??(_0xdadf7d?.[_0x5c814d(0x1d0)]?_0x5019ec[0x0][_0x5c814d(0x1cf)]:undefined),'isSingleCommand':_0xdadf7d?.[_0x5c814d(0x1d0)]};serviceRegistry[_0x5c814d(0x1c9)](_0x319e17),serviceByName['set'](_0x319e17[_0x5c814d(0x1cb)],_0x319e17);}registerService(a24_0x168297(0x1d2),authDefinitions,{'defaultCommand':'login'}),registerService(a24_0x168297(0x1ae),datasetDefinitions),registerService(a24_0x168297(0x1bd),dataDefinitions),registerService(a24_0x168297(0x1af),sqlDefinitions),registerService(a24_0x168297(0x1bb),bffDefinitions),registerService(a24_0x168297(0x1ad),kbDefinitions),registerService(a24_0x168297(0x1c8),appDefinitions,{'defaultCommand':a24_0x168297(0x1b2)}),registerService(a24_0x168297(0x1bf),configDefinitions,{'defaultCommand':a24_0x168297(0x1b2)}),registerService(a24_0x168297(0x1c7),skillDefinitions,{'defaultCommand':a24_0x168297(0x1b0)}),registerService('Self\x20Update',[updateDefinition],{'defaultCommand':'run','isSingleCommand':!![]}),registerService(a24_0x168297(0x1c1),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a24_0x168297(0x1be),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a24_0x168297(0x1c2),logsDefinitions,{'defaultCommand':a24_0x168297(0x1bc)});export function findDefinition(_0x45e4d4,_0xc8f30c){const _0x2537ec=a24_0x168297;return definitions[_0x2537ec(0x1c6)](_0x45e4d4+':'+_0xc8f30c);}function a24_0xeb73(){const _0x60da52=['read','606595hnFQZI','3693807zYIfSw','risk','\x20\x20[high-risk-write]','96fImeLU','set','BFF\x20Scripts','show','Instant\x20API','Schema','Configuration','write','Diagnostics','Logs','215300Pfgrke','28638ntQRxT','156BmZcCn','get','Skills','App\x20Management','push','from','service','20744umDhIV','\x20\x20[write]','410955LYjkzB','command','isSingleCommand','1603QpRdZR','Authentication','3080EPcElZ','has','12GqXTZc','2RDVvTA','182ACtVfP','Knowledge\x20Base','Datasets','SQL\x20Queries','install','847919LiiCBY','list','defaultCommand'];a24_0xeb73=function(){return _0x60da52;};return a24_0xeb73();}function a24_0x750c(_0x4e2b13,_0x451a63){_0x4e2b13=_0x4e2b13-0x1a8;const _0xeb7306=a24_0xeb73();let _0x750c3b=_0xeb7306[_0x4e2b13];return _0x750c3b;}export function isKnownService(_0x548909){const _0x466a7e=a24_0x168297;return serviceByName[_0x466a7e(0x1a9)](_0x548909);}export function getServiceEntry(_0x26fba3){return serviceByName['get'](_0x26fba3);}export function getAllDefinitions(){const _0x73bc3b=a24_0x168297;return Array[_0x73bc3b(0x1ca)](definitions['values']());}
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a25_0x56a8(){const _0x4c304a=['8RVdokE','1264922Ccynmv','4629065uHlAmd','432yQyTud','23913itiPgD','190109sGsRKl','6jzhWgL','1330qfJqCc','export','47410qHdVGl','1032008wymyzt','2915242PLVXjI'];a25_0x56a8=function(){return _0x4c304a;};return a25_0x56a8();}function a25_0x5d91(_0x3d21ff,_0x5bdf59){_0x3d21ff=_0x3d21ff-0x19a;const _0x56a82b=a25_0x56a8();let _0x5d917a=_0x56a82b[_0x3d21ff];return _0x5d917a;}const a25_0x1b7ac6=a25_0x5d91;(function(_0x32c021,_0x5deedb){const _0x25883e=a25_0x5d91,_0xae92eb=_0x32c021();while(!![]){try{const _0x36c798=parseInt(_0x25883e(0x19a))/0x1+parseInt(_0x25883e(0x1a2))/0x2+-parseInt(_0x25883e(0x19b))/0x3*(parseInt(_0x25883e(0x19f))/0x4)+parseInt(_0x25883e(0x19e))/0x5*(-parseInt(_0x25883e(0x1a4))/0x6)+-parseInt(_0x25883e(0x1a3))/0x7*(-parseInt(_0x25883e(0x1a1))/0x8)+-parseInt(_0x25883e(0x1a5))/0x9*(-parseInt(_0x25883e(0x19c))/0xa)+-parseInt(_0x25883e(0x1a0))/0xb;if(_0x36c798===_0x5deedb)break;else _0xae92eb['push'](_0xae92eb['shift']());}catch(_0x2cb965){_0xae92eb['push'](_0xae92eb['shift']());}}}(a25_0x56a8,0x5b30c));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x4bba00){const _0x42e5a0=await buildSchemaPayload();return{'ok':!![],'data':_0x42e5a0};}export const schemaDefinition={'service':'schema','command':a25_0x1b7ac6(0x19d),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a26_0x2350(){const _0x5aa825=['1705815XjykLH','7SGwzUh','Push\x20a\x20local\x20Skill\x20directory\x20to\x20personal\x20runtime\x20Skill\x20scope','created','skillCode','scope','16971cfDxMh','skill','version','Install\x20the\x20published\x20','3271835YEBRYs','\x20developer\x20skill','Installing\x20published\x20','skipped','Pull\x20personal\x20and\x20company\x20runtime\x20Skills\x20into\x20local\x20agent\x20skill\x20directories','trim','Installing\x20official\x20skill\x20via\x20npx\x20(npx\x20skills\x20add\x20','info','72kUPDPp','38742ctiqLw','skillName','2KRaJoP','=1);\x20assuming\x20skill\x20is\x20already\x20present.','appCode','\x20-g\x20-y)...','5565688LwJEJU','string','filter','write','error','20omOLbM','Local\x20Skill\x20directory\x20containing\x20SKILL.md','push','authRequired','Only\x20pull\x20a\x20specific\x20runtime\x20Skill\x20code','\x20skill\x20via\x20npx.','Check\x20network\x20connectivity\x20and\x20try\x20again.','\x20skill\x20installed','Updated\x20personal\x20Skill\x20','accessKey','dir','Created\x20personal\x20Skill\x20','length','nonInteractive','../../skills/runtime-skill-sync.js','\x20personal\x20and\x20','Skipped\x20npx\x20(','code','envName','action','log','map','23055967mAnbAQ','../../core/api-client.js','pull','production','unchanged','input','inherit','759235HknUVR','personal','reduce'];a26_0x2350=function(){return _0x5aa825;};return a26_0x2350();}function a26_0x15ef(_0x5166ed,_0x1d58da){_0x5166ed=_0x5166ed-0x13e;const _0x235031=a26_0x2350();let _0x15ef70=_0x235031[_0x5166ed];return _0x15ef70;}const a26_0x43fac7=a26_0x15ef;(function(_0xd9cd8b,_0x23e18e){const _0x2db8d5=a26_0x15ef,_0x5855c7=_0xd9cd8b();while(!![]){try{const _0x6522dc=parseInt(_0x2db8d5(0x154))/0x1*(-parseInt(_0x2db8d5(0x16c))/0x2)+parseInt(_0x2db8d5(0x15d))/0x3*(parseInt(_0x2db8d5(0x169))/0x4)+-parseInt(_0x2db8d5(0x161))/0x5+parseInt(_0x2db8d5(0x16a))/0x6+parseInt(_0x2db8d5(0x158))/0x7*(-parseInt(_0x2db8d5(0x170))/0x8)+parseInt(_0x2db8d5(0x157))/0x9*(parseInt(_0x2db8d5(0x175))/0xa)+parseInt(_0x2db8d5(0x14d))/0xb;if(_0x6522dc===_0x23e18e)break;else _0x5855c7['push'](_0x5855c7['shift']());}catch(_0x214cc5){_0x5855c7['push'](_0x5855c7['shift']());}}}(a26_0x2350,0x73bb5));import{CLI_BIN_NAME,CLI_DISPLAY_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';import{logger}from'../../utils/logger.js';const CODE_FLAG={'name':'code','type':'string','description':a26_0x43fac7(0x179)},DIR_FLAG={'name':a26_0x43fac7(0x141),'type':a26_0x43fac7(0x171),'required':!![],'description':a26_0x43fac7(0x176)};function summarizeRuntimeSkill(_0x13d6a0){const _0x43f758=a26_0x43fac7;return{'id':_0x13d6a0['id'],'skillCode':_0x13d6a0[_0x43f758(0x15b)],'skillName':_0x13d6a0[_0x43f758(0x16b)],'scope':_0x13d6a0[_0x43f758(0x15c)],'version':_0x13d6a0[_0x43f758(0x15f)],'readonly':_0x13d6a0['readonly']};}function filterByCode(_0x562ea9,_0xa46856){const _0x250aa3=a26_0x43fac7,_0x3997d1=_0xa46856[_0x250aa3(0x166)]();if(!_0x3997d1)return _0x562ea9;return _0x562ea9[_0x250aa3(0x172)](_0x5b6543=>_0x5b6543['skillCode']===_0x3997d1);}export const skillDefinitions=[{'service':a26_0x43fac7(0x15e),'command':'install','description':a26_0x43fac7(0x160)+CLI_BIN_NAME+a26_0x43fac7(0x162),'risk':a26_0x43fac7(0x173),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3facb0){const _0x4d004e=a26_0x43fac7;logger['setLogPath'](process['cwd']()),logger[_0x4d004e(0x168)]('skill-install',_0x4d004e(0x163)+CLI_DISPLAY_NAME+_0x4d004e(0x17a));const {LOVRABET_SKILL_SOURCE:_0x2a15f0,LOVRABET_SKIP_NPX_SKILLS_ENV:_0x235038,runNpxSkillsAddGlobal:_0x3bea09}=await import('../../skills/npx-skills-add.js'),_0x35c5d7=_0x3facb0[_0x4d004e(0x144)]?'pipe':_0x4d004e(0x153);console[_0x4d004e(0x14b)](_0x4d004e(0x167)+_0x2a15f0+_0x4d004e(0x16f));const _0xd0dc3b=_0x3bea09(process['cwd'](),_0x2a15f0,{'stdio':_0x35c5d7});if(_0xd0dc3b[_0x4d004e(0x164)])console[_0x4d004e(0x14b)](_0x4d004e(0x147)+_0x235038+_0x4d004e(0x16d));else{if(_0xd0dc3b['ok'])console[_0x4d004e(0x14b)](CLI_BIN_NAME+_0x4d004e(0x13e));else throw CliErrors['apiError']('npx\x20skills\x20add\x20failed:\x20'+(_0xd0dc3b[_0x4d004e(0x174)]||'unknown'),_0x4d004e(0x17b));}return{'ok':!![]};}},{'service':a26_0x43fac7(0x15e),'command':a26_0x43fac7(0x14f),'description':a26_0x43fac7(0x165),'risk':a26_0x43fac7(0x173),'flags':[CODE_FLAG],async 'execute'(_0x341f9c){const _0x3ce6bf=a26_0x43fac7,{listCompanyRuntimeSkills:_0x340f14,listPersonalRuntimeSkills:_0x1c282b}=await import(_0x3ce6bf(0x14e)),{linkEffectiveRuntimeSkills:_0x42c670,materializeRuntimeSkill:_0xfb22e2}=await import(_0x3ce6bf(0x145)),_0x195fc7=_0x341f9c['str'](_0x3ce6bf(0x148)),_0x2b53fd=_0x341f9c[_0x3ce6bf(0x149)]??_0x3ce6bf(0x150),_0xa0f541=_0x341f9c['accessKey'];if(!_0xa0f541)throw CliErrors[_0x3ce6bf(0x178)]();const _0x1e89a8=filterByCode(await _0x1c282b(_0x341f9c['appCode']),_0x195fc7),_0x512d9d=filterByCode(await _0x340f14(_0x341f9c[_0x3ce6bf(0x16e)]),_0x195fc7),_0x3f235c=[..._0x1e89a8[_0x3ce6bf(0x14c)](_0x724869=>_0xfb22e2(_0x724869,_0x3ce6bf(0x155),{'env':_0x2b53fd,'accessKey':_0xa0f541,'appCode':_0x341f9c[_0x3ce6bf(0x16e)]})),..._0x512d9d[_0x3ce6bf(0x14c)](_0x5b3748=>_0xfb22e2(_0x5b3748,'company',{'env':_0x2b53fd,'accessKey':_0xa0f541,'appCode':_0x341f9c['appCode']}))],_0x5b1130=_0x42c670(_0x3f235c,_0x341f9c[_0x3ce6bf(0x16e)]),_0x33b888=_0x5b1130[_0x3ce6bf(0x156)]((_0x4a25f1,_0x345cf4)=>{const _0x1b5d49=_0x3ce6bf;return _0x4a25f1[_0x345cf4[_0x1b5d49(0x14a)]]=(_0x4a25f1[_0x345cf4[_0x1b5d49(0x14a)]]??0x0)+0x1,_0x4a25f1;},{});return{'ok':!![],'data':{'appCode':_0x341f9c['appCode'],'personal':_0x1e89a8[_0x3ce6bf(0x143)],'company':_0x512d9d[_0x3ce6bf(0x143)],'materialized':_0x3f235c[_0x3ce6bf(0x143)],'links':{'total':_0x5b1130[_0x3ce6bf(0x143)],'created':_0x33b888[_0x3ce6bf(0x15a)]??0x0,'updated':_0x33b888['updated']??0x0,'unchanged':_0x33b888[_0x3ce6bf(0x151)]??0x0,'skipped':0x0,'conflicted':0x0},'skills':{'personal':_0x1e89a8[_0x3ce6bf(0x14c)](summarizeRuntimeSkill),'company':_0x512d9d['map'](summarizeRuntimeSkill)}},'message':'Pulled\x20'+_0x1e89a8['length']+_0x3ce6bf(0x146)+_0x512d9d[_0x3ce6bf(0x143)]+'\x20company\x20Skill(s).'};}},{'service':a26_0x43fac7(0x15e),'command':a26_0x43fac7(0x177),'description':a26_0x43fac7(0x159),'risk':a26_0x43fac7(0x173),'flags':[DIR_FLAG],async 'execute'(_0x33900b){const _0x20bcbf=a26_0x43fac7,{createPersonalRuntimeSkill:_0x1382a4,listPersonalRuntimeSkills:_0x1acfe7,updatePersonalRuntimeSkill:_0x1f097b}=await import(_0x20bcbf(0x14e)),{readPushDirectory:_0x2972ae}=await import(_0x20bcbf(0x145));if(!_0x33900b[_0x20bcbf(0x140)])throw CliErrors['authRequired']();const _0x208829=_0x2972ae(_0x33900b['str'](_0x20bcbf(0x141)),_0x33900b[_0x20bcbf(0x16e)]),_0x57cc46=(await _0x1acfe7(_0x33900b['appCode']))['find'](_0x53b363=>_0x53b363[_0x20bcbf(0x15b)]===_0x208829['skillCode']),_0x3472cd=_0x57cc46?await _0x1f097b(_0x208829['skillCode'],_0x33900b['appCode'],_0x208829['input']):await _0x1382a4(_0x33900b[_0x20bcbf(0x16e)],_0x208829[_0x20bcbf(0x152)]);return{'ok':!![],'data':summarizeRuntimeSkill(_0x3472cd),'message':_0x57cc46?_0x20bcbf(0x13f)+_0x208829[_0x20bcbf(0x15b)]:_0x20bcbf(0x142)+_0x208829[_0x20bcbf(0x15b)]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x2a485f=a27_0x4724;(function(_0x1483dd,_0x202bab){const _0x828b3d=a27_0x4724,_0x26365c=_0x1483dd();while(!![]){try{const _0x1d4659=parseInt(_0x828b3d(0xe9))/0x1+-parseInt(_0x828b3d(0xf3))/0x2+-parseInt(_0x828b3d(0xea))/0x3+parseInt(_0x828b3d(0xe6))/0x4*(parseInt(_0x828b3d(0xf1))/0x5)+-parseInt(_0x828b3d(0xed))/0x6+-parseInt(_0x828b3d(0xe8))/0x7+parseInt(_0x828b3d(0xee))/0x8;if(_0x1d4659===_0x202bab)break;else _0x26365c['push'](_0x26365c['shift']());}catch(_0x14bfe2){_0x26365c['push'](_0x26365c['shift']());}}}(a27_0xcd04,0x3f87d));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a27_0xcd04(){const _0x2245e7=['bool','195120FhYPyU','5281312jDHBDs','str','read','40VlwpHQ','sql','959610EDaDcx','sqlContent','dbId','description','94148murcuT','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','776398XxiiPc','498521eICTEx','1390563PKMFqf','appCode'];a27_0xcd04=function(){return _0x2245e7;};return a27_0xcd04();}function a27_0x4724(_0x3f615b,_0x43e539){_0x3f615b=_0x3f615b-0xe6;const _0xcd04d0=a27_0xcd04();let _0x472450=_0xcd04d0[_0x3f615b];return _0x472450;}import{SQLCODE_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a27_0x2a485f(0xf2),'command':'detail','description':a27_0x2a485f(0xe7),'risk':a27_0x2a485f(0xf0),'flags':[SQLCODE_FLAG,VERBOSE_FLAG],async 'execute'(_0x42a73d){const _0x3788dd=a27_0x2a485f,_0x4c0d4b=await getSqlQueryInfo(_0x42a73d['appCode'],_0x42a73d[_0x3788dd(0xef)]('sqlcode')),_0x2c6b79=_0x42a73d[_0x3788dd(0xec)]('verbose');if(_0x2c6b79)return{'ok':!![],'data':_0x4c0d4b};const _0x488365=_0x4c0d4b[_0x3788dd(0xf5)]?await getDbName(_0x42a73d[_0x3788dd(0xeb)],_0x4c0d4b[_0x3788dd(0xf5)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x4c0d4b['sqlCode'],'sqlName':_0x4c0d4b['sqlName'],'db':_0x488365?_0x488365+'\x20('+_0x4c0d4b['dbId']+')':_0x4c0d4b[_0x3788dd(0xf5)]??'','description':_0x4c0d4b[_0x3788dd(0xf6)]??'','sqlContent':_0x4c0d4b[_0x3788dd(0xf4)]??''}};}};
|