@lovrabet/lovrabet-cli 2.0.9-beta.2 → 2.0.9-beta.4
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_0x485f90=a16_0x13eb;(function(_0x20f57c,_0x284ad1){const _0x5509e8=a16_0x13eb,_0x2e83b3=_0x20f57c();while(!![]){try{const _0x200a2f=-parseInt(_0x5509e8(0xff))/0x1*(parseInt(_0x5509e8(0x12f))/0x2)+parseInt(_0x5509e8(0x12d))/0x3*(-parseInt(_0x5509e8(0x11e))/0x4)+parseInt(_0x5509e8(0x101))/0x5+parseInt(_0x5509e8(0x138))/0x6+parseInt(_0x5509e8(0x124))/0x7+-parseInt(_0x5509e8(0x123))/0x8*(-parseInt(_0x5509e8(0x129))/0x9)+-parseInt(_0x5509e8(0x132))/0xa;if(_0x200a2f===_0x284ad1)break;else _0x2e83b3['push'](_0x2e83b3['shift']());}catch(_0x37a028){_0x2e83b3['push'](_0x2e83b3['shift']());}}}(a16_0x4228,0x72c6c));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';function a16_0x4228(){const _0x119b37=['batchCreate','Preview:\x20data\x20','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Post-aggregation\x20filter,\x20e.g.\x20{\x22total\x22:{\x22$gt\x22:1000}}','write','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','command','high-risk-write','filter','\x20\x20AGGREGATE\x20TYPES','paramsRequired','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','str','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','getOne','80187ciKnKx','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','1314985xiWlHn','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','data\x20','now','operation','aggregate','Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','params','\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','Filter\x20dataset\x20records\x20with\x20query\x20conditions','paramsHint','Update\x20an\x20existing\x20record','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','update','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','read','create','\x20\x20LOGICAL\x20COMBINATORS','\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','join','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','248egaGSQ','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','code','1186832mQuTON','6341090IUEDAa','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20field\x20values\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','description','/api/{appCode}/','9xGBsLx','helpExtra','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','risk','44691cuunrt','map','10SgnHmH','\x20\x20PARAMS\x20STRUCTURE','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','1682120vyQEMc','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\x20\x20WHERE\x20OPERATORS','\x20\x20PAGINATION','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','3873984ITKCuC','\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}','Get\x20a\x20single\x20record\x20by\x20ID','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','build','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','data','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','body'];a16_0x4228=function(){return _0x119b37;};return a16_0x4228();}import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a16_0x485f90(0x14d),'operation':a16_0x485f90(0x14d),'risk':a16_0x485f90(0x118),'paramsRequired':![],'description':a16_0x485f90(0x10e),'paramsHint':a16_0x485f90(0x137)+a16_0x485f90(0x121),'helpExtra':[a16_0x485f90(0x135),a16_0x485f90(0x139),a16_0x485f90(0x125),a16_0x485f90(0xfb),a16_0x485f90(0x11b),'\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}',a16_0x485f90(0x13c),'\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}',a16_0x485f90(0x100),a16_0x485f90(0x10b),a16_0x485f90(0x140),'',a16_0x485f90(0x11a),a16_0x485f90(0x120),a16_0x485f90(0x141),'',a16_0x485f90(0x111),'\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)',a16_0x485f90(0x149),'\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]',a16_0x485f90(0xfd),a16_0x485f90(0x117),'',a16_0x485f90(0x136),a16_0x485f90(0x131),a16_0x485f90(0x112),a16_0x485f90(0x115)][a16_0x485f90(0x11c)]('\x0a')},{'command':'getOne','operation':a16_0x485f90(0xfe),'risk':a16_0x485f90(0x118),'paramsRequired':!![],'description':a16_0x485f90(0x13a),'paramsHint':a16_0x485f90(0x13b)},{'command':a16_0x485f90(0x119),'operation':a16_0x485f90(0x119),'risk':a16_0x485f90(0x148),'paramsRequired':!![],'description':a16_0x485f90(0x109),'paramsHint':a16_0x485f90(0x12b)},{'command':'batchCreate','operation':'batchCreate','risk':'write','paramsRequired':!![],'description':a16_0x485f90(0x116),'paramsHint':a16_0x485f90(0x14a)},{'command':a16_0x485f90(0x114),'operation':a16_0x485f90(0x114),'risk':a16_0x485f90(0x148),'paramsRequired':!![],'description':a16_0x485f90(0x110),'paramsHint':'JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27'},{'command':'delete','operation':'delete','risk':a16_0x485f90(0x14c),'paramsRequired':!![],'description':'Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':'aggregate','operation':a16_0x485f90(0x107),'risk':a16_0x485f90(0x118),'paramsRequired':![],'description':a16_0x485f90(0x142),'paramsHint':a16_0x485f90(0x133)+a16_0x485f90(0x108),'helpExtra':[a16_0x485f90(0x14e),a16_0x485f90(0x126),a16_0x485f90(0x113),a16_0x485f90(0x11d),a16_0x485f90(0x10d),'\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}',a16_0x485f90(0x103),'',a16_0x485f90(0x130),a16_0x485f90(0x102),a16_0x485f90(0x134),a16_0x485f90(0x143),a16_0x485f90(0x10c),a16_0x485f90(0x147),a16_0x485f90(0x11f),'','\x20\x20EXAMPLES',a16_0x485f90(0x13e),'\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27'][a16_0x485f90(0x11c)]('\x0a')}];function a16_0x13eb(_0x19fde4,_0x1c99b8){_0x19fde4=_0x19fde4-0xfb;const _0x4228df=a16_0x4228();let _0x13ebc0=_0x4228df[_0x19fde4];return _0x13ebc0;}function makeDataCommand(_0x80156b){const _0x5ebcd5=a16_0x485f90,_0x50b09f=_0x5ebcd5(0x104)+_0x80156b[_0x5ebcd5(0x14b)],_0x4ac2f3={'service':_0x5ebcd5(0x13f),'command':_0x80156b[_0x5ebcd5(0x14b)],'description':_0x80156b['description'],'risk':_0x80156b[_0x5ebcd5(0x12c)],'helpExtra':_0x80156b[_0x5ebcd5(0x12a)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x80156b[_0x5ebcd5(0x10f)]}],'validate':async _0x2564fd=>{const _0x4c81fc=_0x5ebcd5;_0x80156b[_0x4c81fc(0x14f)]&&requireAnyOf(_0x2564fd,[_0x4c81fc(0x10a)],_0x50b09f),_0x80156b[_0x4c81fc(0x106)]===_0x4c81fc(0x145)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x2564fd[_0x4c81fc(0xfc)](_0x4c81fc(0x10a))));},async 'execute'(_0x414302){const _0x2cb3ed=_0x5ebcd5,_0x1d6f4b=_0x414302[_0x2cb3ed(0xfc)](_0x2cb3ed(0x122)),_0x2a4ebd=_0x80156b[_0x2cb3ed(0x106)]===_0x2cb3ed(0x145)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x414302[_0x2cb3ed(0xfc)](_0x2cb3ed(0x10a)))):parseJsonParams(_0x414302['str'](_0x2cb3ed(0x10a)))??{},_0x30d387=Date[_0x2cb3ed(0x105)](),_0x419437=await executeData(_0x1d6f4b,_0x80156b[_0x2cb3ed(0x106)],_0x2a4ebd),_0x1a4ad0=Date['now']()-_0x30d387;return{'ok':!![],'data':{'result':_0x419437,'elapsed':_0x1a4ad0},'message':'data\x20'+_0x80156b[_0x2cb3ed(0x14b)]+'\x20completed\x20in\x20'+_0x1a4ad0+'ms'};}};return _0x80156b[_0x5ebcd5(0x12c)]!==_0x5ebcd5(0x118)&&(_0x4ac2f3['dryRun']=async _0x68465c=>{const _0x153925=_0x5ebcd5,_0x226ae7=_0x68465c[_0x153925(0xfc)](_0x153925(0x122)),_0x48982d=_0x80156b[_0x153925(0x106)]===_0x153925(0x145)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x68465c['str'](_0x153925(0x10a)))):parseJsonParams(_0x68465c[_0x153925(0xfc)](_0x153925(0x10a)))??{};return dryRun('POST',_0x153925(0x128)+_0x226ae7+'/'+_0x80156b[_0x153925(0x106)])[_0x153925(0x144)](_0x48982d)[_0x153925(0x127)](_0x153925(0x146)+_0x80156b[_0x153925(0x14b)]+'\x20on\x20dataset\x20'+_0x226ae7)[_0x153925(0x13d)]();}),_0x4ac2f3;}export const dataDefinitions=specs[a16_0x485f90(0x12e)](makeDataCommand);
|
|
1
|
+
const a16_0x4cc9e9=a16_0x492d;(function(_0x3c2691,_0x1bea69){const _0x343e5c=a16_0x492d,_0x110410=_0x3c2691();while(!![]){try{const _0x4998c0=-parseInt(_0x343e5c(0x138))/0x1*(-parseInt(_0x343e5c(0xef))/0x2)+parseInt(_0x343e5c(0x101))/0x3*(-parseInt(_0x343e5c(0x106))/0x4)+parseInt(_0x343e5c(0xe2))/0x5*(parseInt(_0x343e5c(0xee))/0x6)+-parseInt(_0x343e5c(0x112))/0x7*(parseInt(_0x343e5c(0x117))/0x8)+-parseInt(_0x343e5c(0xed))/0x9*(-parseInt(_0x343e5c(0x129))/0xa)+-parseInt(_0x343e5c(0x13a))/0xb*(parseInt(_0x343e5c(0x108))/0xc)+parseInt(_0x343e5c(0x11d))/0xd*(parseInt(_0x343e5c(0x11f))/0xe);if(_0x4998c0===_0x1bea69)break;else _0x110410['push'](_0x110410['shift']());}catch(_0x389855){_0x110410['push'](_0x110410['shift']());}}}(a16_0xd30b,0xd0c89));function a16_0xd30b(){const _0x12e0fb=['command','helpExtra','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','\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}','\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}','read','2pGuDUm','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','6422218rPQkKT','data\x20','\x20\x20PAGINATION','35fhifMk','write','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\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}','\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]','getOne','\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}]','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$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\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\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}}','65358eBtnqq','839412CLUakS','819572kFwWtL','description','\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}}]}','filter','\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\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','Update\x20an\x20existing\x20record','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','paramsRequired','\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\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','\x20\x20LOGICAL\x20COMBINATORS','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','Filter\x20dataset\x20records\x20with\x20query\x20conditions','batchCreate','\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}','params','21NdlVPt','operation','\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}}','code','\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}}','208340RClIgq','paramsHint','24kccZXL','update','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','delete','join','\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]','now','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','\x20\x20PARAMS\x20STRUCTURE','4729445dlffIE','create','\x20completed\x20in\x20','\x20\x20EXAMPLES','map','8IDJsoM','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','dryRun','\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}}','body','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','110981ZsMUjQ','str','1442eBUogf','\x20\x20WHERE\x20OPERATORS','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\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]}}','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\x20on\x20dataset\x20','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','aggregate','530fBAEIh','\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\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','Get\x20a\x20single\x20record\x20by\x20ID','build','\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$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','high-risk-write'];a16_0xd30b=function(){return _0x12e0fb;};return a16_0xd30b();}import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';function a16_0x492d(_0x2da01e,_0x151fd5){_0x2da01e=_0x2da01e-0xe0;const _0xd30b48=a16_0xd30b();let _0x492df5=_0xd30b48[_0x2da01e];return _0x492df5;}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_0x4cc9e9(0xf2),'operation':a16_0x4cc9e9(0xf2),'risk':a16_0x4cc9e9(0x137),'paramsRequired':![],'description':a16_0x4cc9e9(0xfd),'paramsHint':'JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20'+a16_0x4cc9e9(0x121),'helpExtra':[a16_0x4cc9e9(0x120),a16_0x4cc9e9(0xf9),a16_0x4cc9e9(0x12e),a16_0x4cc9e9(0xec),a16_0x4cc9e9(0x12b),a16_0x4cc9e9(0x11a),a16_0x4cc9e9(0x12f),a16_0x4cc9e9(0x122),a16_0x4cc9e9(0x105),'\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}',a16_0x4cc9e9(0x11c),'',a16_0x4cc9e9(0xfb),a16_0x4cc9e9(0xea),a16_0x4cc9e9(0xf1),'',a16_0x4cc9e9(0x110),'\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)',a16_0x4cc9e9(0x10d),a16_0x4cc9e9(0xe8),a16_0x4cc9e9(0xf4),'\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','',a16_0x4cc9e9(0xe1),a16_0x4cc9e9(0xf7),a16_0x4cc9e9(0x10f),a16_0x4cc9e9(0xfa)][a16_0x4cc9e9(0x10c)]('\x0a')},{'command':'getOne','operation':a16_0x4cc9e9(0xe7),'risk':a16_0x4cc9e9(0x137),'paramsRequired':!![],'description':a16_0x4cc9e9(0x12c),'paramsHint':a16_0x4cc9e9(0x124)},{'command':'create','operation':a16_0x4cc9e9(0x113),'risk':a16_0x4cc9e9(0xe3),'paramsRequired':!![],'description':'Create\x20a\x20new\x20record\x20in\x20a\x20dataset','paramsHint':a16_0x4cc9e9(0x118)},{'command':a16_0x4cc9e9(0xfe),'operation':a16_0x4cc9e9(0xfe),'risk':a16_0x4cc9e9(0xe3),'paramsRequired':!![],'description':a16_0x4cc9e9(0x126),'paramsHint':a16_0x4cc9e9(0xe4)},{'command':a16_0x4cc9e9(0x109),'operation':a16_0x4cc9e9(0x109),'risk':'write','paramsRequired':!![],'description':a16_0x4cc9e9(0xf6),'paramsHint':a16_0x4cc9e9(0x134)},{'command':a16_0x4cc9e9(0x10b),'operation':a16_0x4cc9e9(0x10b),'risk':a16_0x4cc9e9(0x130),'paramsRequired':!![],'description':a16_0x4cc9e9(0x123),'paramsHint':a16_0x4cc9e9(0x124)},{'command':'aggregate','operation':a16_0x4cc9e9(0x128),'risk':a16_0x4cc9e9(0x137),'paramsRequired':![],'description':a16_0x4cc9e9(0xfc),'paramsHint':a16_0x4cc9e9(0x133)+a16_0x4cc9e9(0xe9),'helpExtra':['\x20\x20AGGREGATE\x20TYPES',a16_0x4cc9e9(0xff),'\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}',a16_0x4cc9e9(0x12a),'\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_0x4cc9e9(0x136),a16_0x4cc9e9(0xe5),a16_0x4cc9e9(0x135),'',a16_0x4cc9e9(0x111),a16_0x4cc9e9(0xe6),a16_0x4cc9e9(0xeb),a16_0x4cc9e9(0xf3),a16_0x4cc9e9(0xf5),a16_0x4cc9e9(0x103),a16_0x4cc9e9(0x127),'',a16_0x4cc9e9(0x115),a16_0x4cc9e9(0x10a),'\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_0x4cc9e9(0x139),'\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_0x4cc9e9(0x10c)]('\x0a')}];function makeDataCommand(_0x2c8cff){const _0x5914dd=a16_0x4cc9e9,_0x466715='data\x20'+_0x2c8cff['command'],_0x408b43={'service':'data','command':_0x2c8cff[_0x5914dd(0x131)],'description':_0x2c8cff['description'],'risk':_0x2c8cff['risk'],'helpExtra':_0x2c8cff[_0x5914dd(0x132)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x2c8cff[_0x5914dd(0x107)]}],'validate':async _0x1909e9=>{const _0x303dd9=_0x5914dd;_0x2c8cff[_0x303dd9(0xf8)]&&requireAnyOf(_0x1909e9,[_0x303dd9(0x100)],_0x466715),_0x2c8cff['operation']===_0x303dd9(0xfe)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x1909e9[_0x303dd9(0x11e)]('params')));},async 'execute'(_0x27198f){const _0x1af510=_0x5914dd,_0x3a9357=_0x27198f['str'](_0x1af510(0x104)),_0x5f1838=_0x2c8cff['operation']===_0x1af510(0xfe)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x27198f['str']('params'))):parseJsonParams(_0x27198f[_0x1af510(0x11e)](_0x1af510(0x100)))??{},_0x7a2a4f=Date[_0x1af510(0x10e)](),_0x1098ae=await executeData(_0x3a9357,_0x2c8cff[_0x1af510(0x102)],_0x5f1838),_0x16ab42=Date[_0x1af510(0x10e)]()-_0x7a2a4f;return{'ok':!![],'data':{'result':_0x1098ae,'elapsed':_0x16ab42},'message':_0x1af510(0xe0)+_0x2c8cff[_0x1af510(0x131)]+_0x1af510(0x114)+_0x16ab42+'ms'};}};return _0x2c8cff['risk']!==_0x5914dd(0x137)&&(_0x408b43[_0x5914dd(0x119)]=async _0x4af795=>{const _0xe12bed=_0x5914dd,_0x3e0753=_0x4af795[_0xe12bed(0x11e)]('code'),_0x4890de=_0x2c8cff[_0xe12bed(0x102)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x4af795[_0xe12bed(0x11e)]('params'))):parseJsonParams(_0x4af795[_0xe12bed(0x11e)](_0xe12bed(0x100)))??{};return dryRun('POST','/api/{appCode}/'+_0x3e0753+'/'+_0x2c8cff[_0xe12bed(0x102)])[_0xe12bed(0x11b)](_0x4890de)[_0xe12bed(0xf0)]('Preview:\x20data\x20'+_0x2c8cff[_0xe12bed(0x131)]+_0xe12bed(0x125)+_0x3e0753)[_0xe12bed(0x12d)]();}),_0x408b43;}export const dataDefinitions=specs[a16_0x4cc9e9(0x116)](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a17_0x389681=a17_0x2e05;(function(_0x5356eb,_0x1b6b80){const _0x47db25=a17_0x2e05,_0xfc420d=_0x5356eb();while(!![]){try{const _0x302665=parseInt(_0x47db25(0x1ec))/0x1*(-parseInt(_0x47db25(0x1de))/0x2)+parseInt(_0x47db25(0x1f8))/0x3+parseInt(_0x47db25(0x20b))/0x4*(parseInt(_0x47db25(0x1f3))/0x5)+-parseInt(_0x47db25(0x1d0))/0x6+parseInt(_0x47db25(0x207))/0x7*(parseInt(_0x47db25(0x1e9))/0x8)+-parseInt(_0x47db25(0x20a))/0x9+parseInt(_0x47db25(0x219))/0xa*(-parseInt(_0x47db25(0x1f1))/0xb);if(_0x302665===_0x1b6b80)break;else _0xfc420d['push'](_0xfc420d['shift']());}catch(_0x23caa1){_0xfc420d['push'](_0xfc420d['shift']());}}}(a17_0x4922,0xe64e0));import{getDatasetDetail,listDatasets}from'../../core/api-client.js';function a17_0x2e05(_0x38f918,_0x5a3054){_0x38f918=_0x38f918-0x1cc;const _0x4922fc=a17_0x4922();let _0x2e059f=_0x4922fc[_0x38f918];return _0x2e059f;}import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x1b2dc6){const _0x3d4b28=a17_0x2e05;if(_0x1b2dc6[_0x3d4b28(0x1e2)])return null;const _0x2aba1d=Boolean(_0x1b2dc6[_0x3d4b28(0x1e0)]!==undefined||_0x1b2dc6[_0x3d4b28(0x206)]!==undefined);let _0x437e28={};if(!_0x2aba1d&&typeof _0x1b2dc6['extend']==='string')try{_0x437e28=JSON[_0x3d4b28(0x1fa)](_0x1b2dc6[_0x3d4b28(0x1f0)]);}catch{}const _0x1b1048=_0x2aba1d?_0x1b2dc6[_0x3d4b28(0x1e4)]:_0x1b2dc6[_0x3d4b28(0x1e6)],_0x539633=_0x2aba1d?_0x1b2dc6[_0x3d4b28(0x1e0)]:_0x1b2dc6['name'],_0x6ca626=_0x2aba1d?_0x1b2dc6[_0x3d4b28(0x206)]:_0x1b2dc6['type']||_0x1b2dc6[_0x3d4b28(0x212)],_0x5591d4=_0x2aba1d?_0x1b2dc6[_0x3d4b28(0x1d4)]===!![]:_0x437e28[_0x3d4b28(0x1d4)]===!![],_0xf9f6a9=_0x2aba1d?_0x1b2dc6[_0x3d4b28(0x1d3)]===!![]:_0x437e28[_0x3d4b28(0x1d3)]===!![],_0x43e76=_0x2aba1d?_0x1b2dc6['options']??null:_0x437e28[_0x3d4b28(0x1fb)]??null,_0x5f4899={'name':_0x1b1048,'displayName':_0x539633||_0x1b1048,'type':_0x6ca626,'dbType':_0x1b2dc6[_0x3d4b28(0x1d5)],'pk':_0x5591d4,'required':_0xf9f6a9,'description':_0x1b2dc6[_0x3d4b28(0x209)]||undefined};return Array[_0x3d4b28(0x1d9)](_0x43e76)&&_0x43e76[_0x3d4b28(0x214)]>0x0&&(_0x5f4899[_0x3d4b28(0x1fb)]=_0x43e76),_0x5f4899;}function parseJsonMaybe(_0x5a93e9){const _0x1e9294=a17_0x2e05;if(typeof _0x5a93e9!==_0x1e9294(0x1df))return _0x5a93e9;try{return JSON['parse'](_0x5a93e9);}catch{return _0x5a93e9;}}function normalizeOperationEntry(_0x2d80f4,_0x2d516a){const _0x5ae9a4=a17_0x2e05;if(!_0x2d516a||typeof _0x2d516a!==_0x5ae9a4(0x1eb))return null;if(!_0x2d516a[_0x5ae9a4(0x1f2)]||!_0x2d516a[_0x5ae9a4(0x203)])return null;const _0x2e4305={'name':_0x2d80f4,'method':_0x2d516a[_0x5ae9a4(0x1f2)],'path':_0x2d516a[_0x5ae9a4(0x203)]};if(_0x2d516a[_0x5ae9a4(0x1f6)])_0x2e4305[_0x5ae9a4(0x1f6)]=_0x2d516a[_0x5ae9a4(0x1f6)];if(_0x2d516a[_0x5ae9a4(0x1ed)]!=null)_0x2e4305['requestBody']=parseJsonMaybe(_0x2d516a[_0x5ae9a4(0x1ed)]);if(_0x2d516a[_0x5ae9a4(0x218)]!=null)_0x2e4305[_0x5ae9a4(0x218)]=parseJsonMaybe(_0x2d516a[_0x5ae9a4(0x218)]);if(_0x2d516a[_0x5ae9a4(0x205)]!=null)_0x2e4305[_0x5ae9a4(0x205)]=_0x2d516a['beforeScriptId'];if(_0x2d516a[_0x5ae9a4(0x20e)]!=null)_0x2e4305[_0x5ae9a4(0x20e)]=_0x2d516a[_0x5ae9a4(0x20e)];if(Array['isArray'](_0x2d516a[_0x5ae9a4(0x1e3)]))_0x2e4305[_0x5ae9a4(0x1e3)]=_0x2d516a[_0x5ae9a4(0x1e3)];if(Array[_0x5ae9a4(0x1d9)](_0x2d516a['responseFields']))_0x2e4305['responseFields']=_0x2d516a['responseFields'];return _0x2e4305;}function summarizeDbtable(_0x5da551){const _0x5b40a5=a17_0x2e05,_0x283e23={},_0x28bb81=[_0x5b40a5(0x1fe),'dbName',_0x5b40a5(0x1f7),_0x5b40a5(0x1fd),'pkField',_0x5b40a5(0x204),_0x5b40a5(0x1cc),_0x5b40a5(0x1f4),_0x5b40a5(0x20d),_0x5b40a5(0x1f9),_0x5b40a5(0x1e7),_0x5b40a5(0x201),'modifierNameField',_0x5b40a5(0x216),'dblinkInfoDTO'];for(const _0x188582 of _0x28bb81){if(_0x5da551[_0x188582]!==undefined)_0x283e23[_0x188582]=_0x5da551[_0x188582];}return typeof _0x283e23['allFields']==='string'&&_0x283e23[_0x5b40a5(0x204)][_0x5b40a5(0x214)]>0x0&&(_0x283e23['allFieldNames']=_0x283e23[_0x5b40a5(0x204)][_0x5b40a5(0x215)](',')[_0x5b40a5(0x1d2)](_0x425f8c=>_0x425f8c[_0x5b40a5(0x1db)]())[_0x5b40a5(0x217)](Boolean)),_0x283e23;}function normalizeRelatedPages(_0x19ffe4){const _0x27ef2f=a17_0x2e05;if(!Array[_0x27ef2f(0x1d9)](_0x19ffe4))return[];return _0x19ffe4[_0x27ef2f(0x217)](_0x43a8a2=>_0x43a8a2&&typeof _0x43a8a2===_0x27ef2f(0x1eb))[_0x27ef2f(0x1d2)](_0x252d1f=>({'id':_0x252d1f['id'],'type':_0x252d1f['type'],'code':_0x252d1f[_0x27ef2f(0x1e6)],'title':_0x252d1f[_0x27ef2f(0x1ea)],'deleted':_0x252d1f[_0x27ef2f(0x1e2)]===!![]}));}function normalizeFallbackFieldName(_0xc78855,_0x3c4c67){const _0x1a9807=a17_0x2e05,_0x709e02=_0xc78855[_0x1a9807(0x1db)]();if(!_0x709e02)return null;return{'name':_0x709e02,'displayName':_0x709e02,'type':undefined,'dbType':undefined,'pk':_0x709e02===_0x3c4c67,'required':![],'description':undefined};}async function loadListFieldFallback(_0x12448d,_0x401daf){const _0x59597e=a17_0x2e05;if(!_0x12448d||!_0x401daf)return[];try{const _0x395c11=await listDatasets(_0x12448d,{'code':_0x401daf}),_0x563bd4=_0x395c11[_0x59597e(0x20f)](_0x25a555=>_0x25a555[_0x59597e(0x1e6)]===_0x401daf)??_0x395c11[0x0],_0x454392=_0x563bd4?.[_0x59597e(0x1e5)]??{},_0x310daa=typeof _0x454392[_0x59597e(0x204)]===_0x59597e(0x1df)?_0x454392['allFields']['split'](','):[];return _0x310daa['map'](_0x50903e=>normalizeFallbackFieldName(_0x50903e,_0x454392[_0x59597e(0x1d4)]))[_0x59597e(0x217)](_0x2acfba=>_0x2acfba!==null);}catch{return[];}}function a17_0x4922(){const _0x1359de=['toFieldLabel','length','split','labelField','filter','responseBody','110afyJWQ','logicField','relatedPageInfoList','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','appCode','1651074wJdunS','doVersion','map','required','pkField','dbType','modelId','indexes','dataset','isArray','tableComment','trim','formatRules','read','2DpVMtN','string','displayName','push','deleted','requestFields','name','dbtableConfig','code','creatorNameField','fields','9016UVImXN','title','object','475991wyJrNH','requestBody','properties','operations','extend','176539giegyp','method','1963905PxrCMR','createTimeField','toDatasetName','host','tableName','4465053DtFTHQ','creatorIdField','parse','options','entries','datasetKey','dbId','columnCodeListWithDeleted','detail','modifierIdField','dbName','path','allFields','beforeScriptId','doType','3052VZCGmW','source','description','11583261fAylPg','12VzcyMC','modelCode','updateTimeField','afterScriptId','find','relations','validateRules','dataType'];a17_0x4922=function(){return _0x1359de;};return a17_0x4922();}export const datasetDetail={'service':a17_0x389681(0x1d8),'command':a17_0x389681(0x200),'description':a17_0x389681(0x1ce),'risk':a17_0x389681(0x1dd),'flags':[CODE_FLAG],async 'execute'(_0x22d360){const _0x274d39=a17_0x389681,_0x2faedb=await getDatasetDetail(_0x22d360['str'](_0x274d39(0x1e6))),_0x2d1ef5=Array['isArray'](_0x2faedb[_0x274d39(0x1e8)])?_0x2faedb[_0x274d39(0x1e8)]:Array[_0x274d39(0x1d9)](_0x2faedb[_0x274d39(0x1ee)])?_0x2faedb[_0x274d39(0x1ee)]:[];let _0xe3274f=_0x2d1ef5[_0x274d39(0x1d2)](_0x303768=>normalizeField(_0x303768))[_0x274d39(0x217)](_0x550a2b=>_0x550a2b!==null);_0xe3274f[_0x274d39(0x214)]===0x0&&(_0xe3274f=await loadListFieldFallback(_0x22d360[_0x274d39(0x1cf)],_0x22d360['str'](_0x274d39(0x1e6))));const _0x3e0506=_0x2faedb[_0x274d39(0x1ef)]??{},_0x130840=[];for(const [_0x3aa074,_0x165054]of Object[_0x274d39(0x1fc)](_0x3e0506)){const _0x54a344=normalizeOperationEntry(_0x3aa074,_0x165054);if(_0x54a344)_0x130840[_0x274d39(0x1e1)](_0x54a344);}const _0x3561b2=_0x2faedb[_0x274d39(0x1e5)]??{},_0x767f9e=_0x2faedb[_0x274d39(0x1d8)]??{},_0x3c3c08=_0x3561b2[_0x274d39(0x1fe)]!=null?{'id':_0x3561b2[_0x274d39(0x1fe)],'name':_0x3561b2[_0x274d39(0x202)]??null}:undefined;let _0x11fa13;return typeof _0x2faedb[_0x274d39(0x1f0)]===_0x274d39(0x1df)&&(_0x11fa13=parseJsonMaybe(_0x2faedb[_0x274d39(0x1f0)])),{'ok':!![],'data':{'id':_0x2faedb[_0x274d39(0x1d6)]??_0x2faedb['id'],'name':_0x2faedb[_0x274d39(0x1e4)],'code':_0x2faedb[_0x274d39(0x20c)]||_0x2faedb[_0x274d39(0x1e6)],'doVersion':_0x2faedb[_0x274d39(0x1d1)],'description':_0x2faedb['description']||_0x767f9e[_0x274d39(0x1da)]||undefined,'source':_0x2faedb[_0x274d39(0x208)]||_0x767f9e['sourceType'],'table':_0x3561b2[_0x274d39(0x1f7)]||_0x767f9e[_0x274d39(0x1f7)],'datasetKey':_0x3561b2[_0x274d39(0x1fd)],'pk':_0x3561b2[_0x274d39(0x1d4)],'db':_0x3c3c08,'dbtable':summarizeDbtable(_0x3561b2),'fields':_0xe3274f,'operations':_0x130840,'indexes':Array[_0x274d39(0x1d9)](_0x767f9e[_0x274d39(0x1d7)])?_0x767f9e[_0x274d39(0x1d7)]:[],'relations':Array['isArray'](_0x2faedb[_0x274d39(0x210)])?_0x2faedb[_0x274d39(0x210)][_0x274d39(0x1d2)](_0x3eccde=>({'fromField':_0x3eccde['fromField'],'toDataset':_0x3eccde[_0x274d39(0x1f5)],'toCode':_0x3eccde['toDatasetCode'],'toTable':_0x3eccde['toTableName'],'toField':_0x3eccde['toField'],'labelField':_0x3eccde[_0x274d39(0x213)]||undefined})):[],'relatedPages':normalizeRelatedPages(_0x2faedb[_0x274d39(0x1cd)]),...Array[_0x274d39(0x1d9)](_0x2faedb[_0x274d39(0x1ff)])?{'columnCodeListWithDeleted':_0x2faedb[_0x274d39(0x1ff)]}:{},'formatRules':Array['isArray'](_0x2faedb['formatRules'])?_0x2faedb[_0x274d39(0x1dc)]:[],'validateRules':Array[_0x274d39(0x1d9)](_0x2faedb[_0x274d39(0x211)])?_0x2faedb['validateRules']:[],..._0x11fa13!==undefined?{'extend':_0x11fa13}:{},'stats':{'fieldCount':_0xe3274f[_0x274d39(0x214)],'operationCount':_0x130840[_0x274d39(0x214)]}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xb6235c,_0x51bd4b){const _0x22998f=a18_0x3665,_0x20bf47=_0xb6235c();while(!![]){try{const _0x1c162d=-parseInt(_0x22998f(0x1f5))/0x1*(parseInt(_0x22998f(0x1f2))/0x2)+-parseInt(_0x22998f(0x1f8))/0x3+parseInt(_0x22998f(0x1f7))/0x4+parseInt(_0x22998f(0x1f4))/0x5+-parseInt(_0x22998f(0x1fa))/0x6*(-parseInt(_0x22998f(0x1f9))/0x7)+parseInt(_0x22998f(0x1f3))/0x8*(parseInt(_0x22998f(0x1f6))/0x9)+-parseInt(_0x22998f(0x1f0))/0xa*(parseInt(_0x22998f(0x1f1))/0xb);if(_0x1c162d===_0x51bd4b)break;else _0x20bf47['push'](_0x20bf47['shift']());}catch(_0x5a30bb){_0x20bf47['push'](_0x20bf47['shift']());}}}(a18_0x4a0c,0xedeba));import{datasetList}from'../../commands/dataset/list.js';function a18_0x4a0c(){const _0x55922e=['486enehau','11720CCdmHo','5358215MXjGvF','2261FmodQq','11646jWVWLy','2639632KjTkKw','3784992UrOCGn','42BiWctB','1201038rHIRNp','20YXTtWU','11234795czilGq'];a18_0x4a0c=function(){return _0x55922e;};return a18_0x4a0c();}import{datasetDetail}from'../../commands/dataset/detail.js';function a18_0x3665(_0x5b7a51,_0x350bcd){_0x5b7a51=_0x5b7a51-0x1f0;const _0x4a0c2e=a18_0x4a0c();let _0x366512=_0x4a0c2e[_0x5b7a51];return _0x366512;}export const datasetDefinitions=[datasetList,datasetDetail];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x4c81b3=a19_0x37f9;function a19_0xaf69(){const _0x3957d8=['map','226542OxwEil','description','tableName','appCode','59430QTsPaj','source','1078464cDGBXs','dataset','3tnWIkY','name','1872978tXZYtb','length','7BBvYAj','dbtableConfig','1130795xgDVMj','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','259049dRBLyc','allFields','read','split','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','str','code','trim','1367088GvBJkV','1611xoRcCr','pkField','string','list'];a19_0xaf69=function(){return _0x3957d8;};return a19_0xaf69();}function a19_0x37f9(_0x5abbad,_0x13243b){_0x5abbad=_0x5abbad-0x140;const _0xaf693a=a19_0xaf69();let _0x37f9a6=_0xaf693a[_0x5abbad];return _0x37f9a6;}(function(_0x3b7dd5,_0x476595){const _0xb86c1d=a19_0x37f9,_0x27afd0=_0x3b7dd5();while(!![]){try{const _0x5a4d07=-parseInt(_0xb86c1d(0x15b))/0x1+-parseInt(_0xb86c1d(0x14b))/0x2*(parseInt(_0xb86c1d(0x153))/0x3)+-parseInt(_0xb86c1d(0x151))/0x4+parseInt(_0xb86c1d(0x159))/0x5+-parseInt(_0xb86c1d(0x155))/0x6*(parseInt(_0xb86c1d(0x157))/0x7)+-parseInt(_0xb86c1d(0x145))/0x8+-parseInt(_0xb86c1d(0x146))/0x9*(-parseInt(_0xb86c1d(0x14f))/0xa);if(_0x5a4d07===_0x476595)break;else _0x27afd0['push'](_0x27afd0['shift']());}catch(_0x5b6a50){_0x27afd0['push'](_0x27afd0['shift']());}}}(a19_0xaf69,0x2846b));import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';export const datasetList={'service':a19_0x4c81b3(0x152),'command':a19_0x4c81b3(0x149),'description':a19_0x4c81b3(0x141),'risk':a19_0x4c81b3(0x15d),'flags':[{'name':a19_0x4c81b3(0x154),'type':a19_0x4c81b3(0x148),'description':'Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)'},{...CODE_FLAG,'required':![],'description':a19_0x4c81b3(0x15a)}],async 'execute'(_0x13f101){const _0x3f42c6=a19_0x4c81b3,_0x21c009=_0x13f101[_0x3f42c6(0x142)]('name'),_0x5469a2=_0x13f101[_0x3f42c6(0x142)](_0x3f42c6(0x143)),_0x1485bb=await listDatasets(_0x13f101[_0x3f42c6(0x14e)],{..._0x21c009&&{'name':_0x21c009},..._0x5469a2&&{'code':_0x5469a2}});return{'ok':!![],'data':{'total':_0x1485bb[_0x3f42c6(0x156)],'datasets':_0x1485bb['map'](_0x4dcd16=>{const _0x6343d3=_0x3f42c6,_0x461218=_0x4dcd16[_0x6343d3(0x158)]??{};return{'id':_0x4dcd16['id'],'code':_0x4dcd16['code'],'name':_0x4dcd16['name'],'source':_0x4dcd16[_0x6343d3(0x150)],'description':_0x4dcd16[_0x6343d3(0x14c)],'table':_0x461218[_0x6343d3(0x14d)],'datasetKey':_0x461218['datasetKey'],'pk':_0x461218[_0x6343d3(0x147)],'fields':_0x461218[_0x6343d3(0x15c)]?_0x461218[_0x6343d3(0x15c)][_0x6343d3(0x140)](',')[_0x6343d3(0x14a)](_0x2fe953=>_0x2fe953[_0x6343d3(0x144)]()):[]};})}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x2b80b8=a20_0x1239;(function(_0x5c3226,_0x2d3c8f){const _0x3776c7=a20_0x1239,_0x2a700a=_0x5c3226();while(!![]){try{const _0x54c7ad=parseInt(_0x3776c7(0x1e0))/0x1*(-parseInt(_0x3776c7(0x1f7))/0x2)+-parseInt(_0x3776c7(0x20d))/0x3+-parseInt(_0x3776c7(0x217))/0x4+-parseInt(_0x3776c7(0x1ec))/0x5+-parseInt(_0x3776c7(0x1f6))/0x6*(parseInt(_0x3776c7(0x1f1))/0x7)+-parseInt(_0x3776c7(0x21e))/0x8*(-parseInt(_0x3776c7(0x1fc))/0x9)+parseInt(_0x3776c7(0x200))/0xa;if(_0x54c7ad===_0x2d3c8f)break;else _0x2a700a['push'](_0x2a700a['shift']());}catch(_0x32d8e5){_0x2a700a['push'](_0x2a700a['shift']());}}}(a20_0x3c9a,0x6b795));function a20_0x3c9a(){const _0x4aeaa5=['\x20\x20Config\x20JSON','48saCHDH','riskLevel','\x20\x20runtimeDomain:\x20\x20\x20','\x20\x20Auth','9759PqNmWu','\x20(legacy/compat\x20only)','\x20\x20Session\x20check:\x20\x20\x20','(removed\x20—\x20cookie\x20auth\x20disabled)','status','Project','check','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','platform','\x20doctor','doctor','(set,\x20length=','4348890tTawsZ','verbose','(no\x20file)','version','\x20(accessKey)','3004624AMRjOi','red','padEnd','defaultApp','log','6zLnsft','94zUfTvD','✓\x20Valid\x20JSON','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','279198bqVnCx','format','\x20\x20API\x20Endpoints','(none)','31296710nagCKj','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','(default)','missing','⚠\x20Empty\x20(treated\x20as\x20{})','appCode','\x20\x20Config\x20Files','message','arch','bold','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','(default:\x20','locale','901785KoaddL','green','repeat','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','\x20\x20Merged\x20Config','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','gray','\x20\x20─','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','3269248tctAiK','length','Diagnose\x20CLI\x20configuration\x20and\x20environment','(not\x20found)','accessKey','currentApp'];a20_0x3c9a=function(){return _0x4aeaa5;};return a20_0x3c9a();}import a20_0x51b998 from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';function a20_0x1239(_0x386e53,_0x370c72){_0x386e53=_0x386e53-0x1e0;const _0x3c9a7e=a20_0x3c9a();let _0x123951=_0x3c9a7e[_0x386e53];return _0x123951;}import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';async function execute(_0x10e077){const _0x2efc1b=a20_0x1239,_0x5d1840=getCliVersion(),_0x252a7b=buildConfigFromFlags({});await initGlobalEnvironment(_0x252a7b),console[_0x2efc1b(0x1f5)](),console[_0x2efc1b(0x1f5)](a20_0x51b998['bold'](CLI_BIN_NAME+_0x2efc1b(0x1e9))),console[_0x2efc1b(0x1f5)](a20_0x51b998[_0x2efc1b(0x214)]('─'[_0x2efc1b(0x20f)](0x32))),console['log'](_0x2efc1b(0x213)+_0x5d1840),console[_0x2efc1b(0x1f5)](_0x2efc1b(0x201)+process[_0x2efc1b(0x1ef)]),console[_0x2efc1b(0x1f5)]('\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20'+process[_0x2efc1b(0x1e8)]+'\x20'+process[_0x2efc1b(0x208)]),console[_0x2efc1b(0x1f5)](),console[_0x2efc1b(0x1f5)](a20_0x51b998[_0x2efc1b(0x209)](_0x2efc1b(0x206))),console[_0x2efc1b(0x1f5)](a20_0x51b998[_0x2efc1b(0x214)](_0x2efc1b(0x215)['repeat'](0x1e)));const _0x2479f5=getGlobalConfigPath(),_0x1e3aef=getProjectConfigPath();console[_0x2efc1b(0x1f5)](_0x2efc1b(0x1fb)+(_0x2479f5||a20_0x51b998[_0x2efc1b(0x214)](_0x2efc1b(0x21a)))),console[_0x2efc1b(0x1f5)]('\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x1e3aef||a20_0x51b998[_0x2efc1b(0x214)]('(not\x20found)'))),console['log'](),console[_0x2efc1b(0x1f5)](a20_0x51b998['bold'](_0x2efc1b(0x21d))),console[_0x2efc1b(0x1f5)](a20_0x51b998[_0x2efc1b(0x214)](_0x2efc1b(0x215)[_0x2efc1b(0x20f)](0x1e)));const _0x399126=(_0x40cd42,_0x596f84)=>{const _0x338fe0=_0x2efc1b;if(!_0x596f84){console[_0x338fe0(0x1f5)]('\x20\x20'+_0x40cd42[_0x338fe0(0x1f3)](0x11)+'\x20'+a20_0x51b998['gray'](_0x338fe0(0x1ee)));return;}const _0x3f124b=inspectCliConfigJsonFile(_0x596f84);if(_0x3f124b[_0x338fe0(0x1e4)]==='ok')console['log']('\x20\x20'+_0x40cd42[_0x338fe0(0x1f3)](0x11)+'\x20'+a20_0x51b998[_0x338fe0(0x20e)](_0x338fe0(0x1f8)));else{if(_0x3f124b[_0x338fe0(0x1e4)]==='empty')console['log']('\x20\x20'+_0x40cd42[_0x338fe0(0x1f3)](0x11)+'\x20'+a20_0x51b998['yellow'](_0x338fe0(0x204)));else _0x3f124b[_0x338fe0(0x1e4)]===_0x338fe0(0x203)?console[_0x338fe0(0x1f5)]('\x20\x20'+_0x40cd42[_0x338fe0(0x1f3)](0x11)+'\x20'+a20_0x51b998['gray']('(missing)')):(console[_0x338fe0(0x1f5)]('\x20\x20'+_0x40cd42[_0x338fe0(0x1f3)](0x11)+'\x20'+a20_0x51b998[_0x338fe0(0x1f2)]('✗\x20Invalid\x20JSON')),console[_0x338fe0(0x1f5)]('\x20\x20'+''[_0x338fe0(0x1f3)](0x11)+'\x20'+a20_0x51b998[_0x338fe0(0x1f2)](_0x3f124b[_0x338fe0(0x207)])));}};_0x399126('Global',_0x2479f5),_0x399126(_0x2efc1b(0x1e5),_0x1e3aef),console[_0x2efc1b(0x1f5)](),console[_0x2efc1b(0x1f5)](a20_0x51b998['bold'](_0x2efc1b(0x211))),console[_0x2efc1b(0x1f5)](a20_0x51b998[_0x2efc1b(0x214)](_0x2efc1b(0x215)[_0x2efc1b(0x20f)](0x1e))),console[_0x2efc1b(0x1f5)](_0x2efc1b(0x1fa)+(_0x252a7b[_0x2efc1b(0x205)]||a20_0x51b998[_0x2efc1b(0x1f2)]('(not\x20set)'))),console[_0x2efc1b(0x1f5)]('\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x252a7b['env']);const _0x1d6bf3=isLegacyCompatConfigKey(_0x2efc1b(0x20c))?a20_0x51b998[_0x2efc1b(0x214)](_0x252a7b[_0x2efc1b(0x20c)]+_0x2efc1b(0x1e1)):_0x252a7b[_0x2efc1b(0x20c)];return console['log']('\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x1d6bf3),console['log']('\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20'+(_0x252a7b[_0x2efc1b(0x1f4)]||a20_0x51b998['gray'](_0x2efc1b(0x1ff)))),console['log'](_0x2efc1b(0x210)+(_0x252a7b[_0x2efc1b(0x21c)]||a20_0x51b998[_0x2efc1b(0x214)](_0x2efc1b(0x1ff)))),console[_0x2efc1b(0x1f5)](_0x2efc1b(0x20a)+(_0x252a7b[_0x2efc1b(0x1fd)]||a20_0x51b998['gray'](_0x2efc1b(0x20b)+DEFAULT_CONFIG_VALUES[_0x2efc1b(0x1fd)]+')'))),console['log'](_0x2efc1b(0x216)+(_0x252a7b['pageSize']??a20_0x51b998[_0x2efc1b(0x214)](_0x2efc1b(0x202)))),console[_0x2efc1b(0x1f5)](_0x2efc1b(0x1e7)+_0x252a7b[_0x2efc1b(0x21f)]),console[_0x2efc1b(0x1f5)]('\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x252a7b[_0x2efc1b(0x1ed)]),console[_0x2efc1b(0x1f5)]('\x20\x20auth\x20(effective):\x20'+AUTH_MODE['ClientAk']),console[_0x2efc1b(0x1f5)](_0x2efc1b(0x1f9)+(_0x252a7b[_0x2efc1b(0x21b)]?a20_0x51b998[_0x2efc1b(0x20e)](_0x2efc1b(0x1eb)+_0x252a7b[_0x2efc1b(0x21b)][_0x2efc1b(0x218)]+')'):a20_0x51b998[_0x2efc1b(0x214)](_0x2efc1b(0x1ff)))),console['log'](),console[_0x2efc1b(0x1f5)](a20_0x51b998['bold'](_0x2efc1b(0x1fe))),console[_0x2efc1b(0x1f5)](a20_0x51b998['gray'](_0x2efc1b(0x215)[_0x2efc1b(0x20f)](0x1e))),console[_0x2efc1b(0x1f5)](_0x2efc1b(0x212)+getApiDomain()),console['log']('\x20\x20userDomain:\x20\x20\x20\x20\x20\x20'+getUserDomain()),console[_0x2efc1b(0x1f5)](_0x2efc1b(0x220)+getRuntimeDomain()),console[_0x2efc1b(0x1f5)](),console['log'](a20_0x51b998['bold'](_0x2efc1b(0x221))),console[_0x2efc1b(0x1f5)](a20_0x51b998[_0x2efc1b(0x214)](_0x2efc1b(0x215)[_0x2efc1b(0x20f)](0x1e))),console[_0x2efc1b(0x1f5)]('\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+a20_0x51b998[_0x2efc1b(0x20e)](AUTH_MODE['ClientAk']+_0x2efc1b(0x1f0))),console[_0x2efc1b(0x1f5)](_0x2efc1b(0x1e2)+a20_0x51b998[_0x2efc1b(0x214)](_0x2efc1b(0x1e3))),console[_0x2efc1b(0x1f5)](),{'ok':!![]};}export const doctorDefinition={'service':a20_0x2b80b8(0x1ea),'command':a20_0x2b80b8(0x1e6),'description':a20_0x2b80b8(0x219),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a21_0x2993af=a21_0xfb29;(function(_0x17f2df,_0x381e66){const _0x6a211d=a21_0xfb29,_0x108b5d=_0x17f2df();while(!![]){try{const _0x4629ad=-parseInt(_0x6a211d(0x124))/0x1*(-parseInt(_0x6a211d(0x150))/0x2)+parseInt(_0x6a211d(0x14e))/0x3*(parseInt(_0x6a211d(0x129))/0x4)+parseInt(_0x6a211d(0x116))/0x5*(-parseInt(_0x6a211d(0x119))/0x6)+-parseInt(_0x6a211d(0x141))/0x7+parseInt(_0x6a211d(0x123))/0x8*(parseInt(_0x6a211d(0x149))/0x9)+-parseInt(_0x6a211d(0x125))/0xa+parseInt(_0x6a211d(0x145))/0xb;if(_0x4629ad===_0x381e66)break;else _0x108b5d['push'](_0x108b5d['shift']());}catch(_0x5e5d5b){_0x108b5d['push'](_0x108b5d['shift']());}}}(a21_0x5c21,0xb1d06));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';function a21_0xfb29(_0x161857,_0x2b9456){_0x161857=_0x161857-0x116;const _0x5c21d4=a21_0x5c21();let _0xfb2935=_0x5c21d4[_0x161857];return _0xfb2935;}function a21_0x5c21(){const _0xb7e14a=['apps','[y/N]','yes','Write\x20to\x20global\x20(~/','\x20\x20env:\x20\x20\x20\x20\x20','appcode','App\x20code','stdin','entries','apiDir','Invalid\x20env\x20\x22','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','name','User\x20aborted\x20prompt','5XCrTEW','cwd','Skip\x20confirmation\x20when\x20overwriting','7526238TBEVCN','App\x20code\x20for\x20the\x20project','Initialized\x20','Target\x20environment\x20(default\x20','App\x20code\x20cannot\x20be\x20empty.','join','\x20\x20appcode:\x20','\x20already\x20exists.\x20Overwrite?','riskLevel','includes','204712jWRgiu','165fgdQJg','11068660QjMkQR','app','\x22.\x20Allowed:\x20','question','30996exLive','log','message','AbortPrompt','):\x20','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','env','once','validation','File\x20','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Failed\x20to\x20parse\x20source\x20file:\x20','race','file',')\x20instead\x20of\x20project','cancelled','global','Source\x20file\x20not\x20found:\x20','boolean','project','Override\x20imported\x20default\x20appcode','SIGINT','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','defaultApp','6828710SjCqZR','Override\x20imported\x20default\x20env','\x20\x20default:\x20','string','13486143ysWODx','close','\x20init\x20—\x20Create\x20','stdout','360zZJGOK','newConfigFileName','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','removeListener','Imported\x20from\x20','399WyqxvG','trim','9514dSkQqQ'];a21_0x5c21=function(){return _0xb7e14a;};return a21_0x5c21();}import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':'appcode','type':'string','description':a21_0x2993af(0x11a)},{'name':a21_0x2993af(0x12f),'type':a21_0x2993af(0x144),'description':a21_0x2993af(0x11c)+DEFAULT_CONFIG_VALUES['env']+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x2993af(0x139),'type':a21_0x2993af(0x13b),'description':a21_0x2993af(0x154)+PRODUCT_CONFIG['newConfigFileName']+a21_0x2993af(0x137),'default':![]},{'name':a21_0x2993af(0x153),'type':a21_0x2993af(0x13b),'description':a21_0x2993af(0x118),'default':![]}];export const initImportFlagDefs=[{'name':a21_0x2993af(0x136),'type':a21_0x2993af(0x144),'description':a21_0x2993af(0x14b),'required':!![]},{'name':a21_0x2993af(0x156),'type':a21_0x2993af(0x144),'description':a21_0x2993af(0x13d)},{'name':a21_0x2993af(0x12f),'type':a21_0x2993af(0x144),'description':a21_0x2993af(0x142),'enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x2993af(0x139),'type':a21_0x2993af(0x13b),'description':a21_0x2993af(0x154)+PRODUCT_CONFIG[a21_0x2993af(0x14a)]+')\x20instead\x20of\x20project','default':![]},{'name':a21_0x2993af(0x153),'type':a21_0x2993af(0x13b),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x384f25){const _0x5e8dad=a21_0x2993af,_0x144147=isNonInteractiveMode(_0x384f25),_0x2ceb88=_0x384f25[_0x5e8dad(0x139)]?'global':_0x5e8dad(0x13c),_0x46e42e=resolveWriteConfigPath(_0x2ceb88);try{_0x144147?await runNonInteractive(_0x384f25,_0x46e42e):await runInteractive(_0x384f25,_0x46e42e);}catch(_0x1da400){if(_0x1da400 instanceof AbortPrompt)throw CliErrors[_0x5e8dad(0x138)]();throw _0x1da400;}}export async function runInitImport(_0x2d9f73){const _0x25e3d8=a21_0x2993af,_0x4b9910=_0x2d9f73['global']?'global':_0x25e3d8(0x13c),_0x4e4dc1=resolveWriteConfigPath(_0x4b9910);await runFromImport(_0x2d9f73,_0x4e4dc1);}const RUNTIME_IRRELEVANT_KEYS=new Set([a21_0x2993af(0x15a)]);async function runFromImport(_0x4b9af7,_0x49db2d){const _0x63a5b1=a21_0x2993af,_0x10db9f=resolveFilePath(_0x4b9af7['file']);if(!existsSync(_0x10db9f))throw CliErrors[_0x63a5b1(0x131)](_0x63a5b1(0x13a)+_0x10db9f);const _0x477183=readSourceFile(_0x10db9f),_0x2beb41=convertToRuntimeConfig(_0x477183);_0x4b9af7[_0x63a5b1(0x156)]&&(_0x2beb41[_0x63a5b1(0x156)]=String(_0x4b9af7[_0x63a5b1(0x156)]));_0x4b9af7[_0x63a5b1(0x12f)]&&(_0x2beb41[_0x63a5b1(0x12f)]=resolveInitEnv(_0x4b9af7));if(!_0x2beb41[_0x63a5b1(0x156)])throw CliErrors[_0x63a5b1(0x131)](_0x63a5b1(0x15c),'Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.');await writeInitConfig(_0x49db2d,_0x2beb41,_0x4b9af7),console[_0x63a5b1(0x12a)](_0x63a5b1(0x14d)+_0x10db9f),console[_0x63a5b1(0x12a)]('\x20\x20config:\x20\x20'+_0x49db2d),console[_0x63a5b1(0x12a)](_0x63a5b1(0x11f)+_0x2beb41[_0x63a5b1(0x156)]);if(_0x2beb41[_0x63a5b1(0x140)])console[_0x63a5b1(0x12a)](_0x63a5b1(0x143)+_0x2beb41[_0x63a5b1(0x140)]);}function convertToRuntimeConfig(_0x3565a4){const _0x16bec1=a21_0x2993af;if(_0x3565a4['apps']&&typeof _0x3565a4[_0x16bec1(0x151)]==='object')throw CliErrors[_0x16bec1(0x131)](_0x16bec1(0x133),_0x16bec1(0x13f));const _0x5113c5={};for(const _0x1b4613 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x3565a4[_0x1b4613]!==undefined&&(_0x5113c5[_0x1b4613]=_0x3565a4[_0x1b4613]);}return!_0x5113c5['riskLevel']&&(_0x5113c5[_0x16bec1(0x121)]=DEFAULT_CONFIG_VALUES[_0x16bec1(0x121)]),_0x5113c5;}async function runNonInteractive(_0x2b1412,_0x45e76b){const _0x7655b=a21_0x2993af,_0x31ef23=_0x2b1412['appcode'];if(!_0x31ef23)throw CliErrors['flagMissing'](_0x7655b(0x156),'Usage:\x20'+CLI_BIN_NAME+_0x7655b(0x12e));const _0x2999bd=resolveInitEnv(_0x2b1412);await writeInitConfig(_0x45e76b,{'appcode':_0x31ef23,'env':_0x2999bd},_0x2b1412),console['log'](_0x7655b(0x11b)+_0x45e76b),console[_0x7655b(0x12a)](_0x7655b(0x11f)+_0x31ef23),console[_0x7655b(0x12a)](_0x7655b(0x155)+_0x2999bd);}async function runInteractive(_0xa472de,_0x34c46a){const _0x3200f8=a21_0x2993af,_0x2d884b=loadExisting(_0x34c46a),_0x49fcd1=typeof _0x2d884b?.['appcode']===_0x3200f8(0x144)?_0x2d884b[_0x3200f8(0x156)]:'',_0x1ac2c1=resolveInitEnv(_0xa472de);console[_0x3200f8(0x12a)](CLI_BIN_NAME+_0x3200f8(0x147)+PRODUCT_CONFIG[_0x3200f8(0x14a)]+'\x0a');if(existsSync(_0x34c46a)&&!_0xa472de[_0x3200f8(0x153)]){const _0x29eff7=await promptYesNo(_0x3200f8(0x132)+_0x34c46a+_0x3200f8(0x120),![]);if(!_0x29eff7){console[_0x3200f8(0x12a)]('Aborted.');return;}}const _0x316003=typeof _0xa472de[_0x3200f8(0x156)]===_0x3200f8(0x144)?_0xa472de['appcode'][_0x3200f8(0x14f)]():'';let _0x25f9c5=_0x316003;!_0x25f9c5&&(_0x25f9c5=await promptInput(_0x3200f8(0x157),_0x49fcd1));if(!_0x25f9c5[_0x3200f8(0x14f)]())throw CliErrors[_0x3200f8(0x131)](_0x3200f8(0x11d));await writeInitConfig(_0x34c46a,{'appcode':_0x25f9c5['trim'](),'env':_0x1ac2c1},_0xa472de),console[_0x3200f8(0x12a)]('\x0aInitialized\x20'+_0x34c46a),console[_0x3200f8(0x12a)](_0x3200f8(0x11f)+_0x25f9c5[_0x3200f8(0x14f)]()),console[_0x3200f8(0x12a)](_0x3200f8(0x155)+_0x1ac2c1);}async function writeInitConfig(_0x471dcf,_0x3c25f7,_0x221e70){const _0x140ae1=a21_0x2993af;let _0x5097a8={};existsSync(_0x471dcf)&&!_0x221e70[_0x140ae1(0x153)]&&(_0x5097a8=readConfigFile(_0x471dcf));for(const [_0x738e4e,_0x141327]of Object[_0x140ae1(0x159)](_0x3c25f7)){_0x141327!==undefined&&(_0x5097a8[_0x738e4e]=_0x141327);}if(_0x5097a8['app'])delete _0x5097a8[_0x140ae1(0x126)];writeConfigFile(_0x471dcf,_0x5097a8);}class AbortPrompt extends Error{constructor(){const _0xdaec8b=a21_0x2993af;super(_0xdaec8b(0x15e)),this[_0xdaec8b(0x15d)]=_0xdaec8b(0x12c);}}function createSafeRl(){const _0x34d30b=a21_0x2993af,_0x375077=createInterface({'input':process[_0x34d30b(0x158)],'output':process[_0x34d30b(0x148)]});let _0x369693;const _0x120795=new Promise((_0x4a4301,_0x11cf93)=>{const _0x1841b5=_0x34d30b;_0x369693=()=>{const _0x2d98ba=a21_0xfb29;_0x369693&&(_0x375077[_0x2d98ba(0x14c)](_0x2d98ba(0x13e),_0x369693),_0x369693=undefined);try{_0x375077['close']();}catch{}_0x11cf93(new AbortPrompt());},_0x375077[_0x1841b5(0x130)](_0x1841b5(0x13e),_0x369693);}),_0x2daf85=()=>{const _0x4e069c=_0x34d30b;_0x369693&&(_0x375077[_0x4e069c(0x14c)](_0x4e069c(0x13e),_0x369693),_0x369693=undefined);try{_0x375077[_0x4e069c(0x146)]();}catch{}};return{'rl':_0x375077,'abortPromise':_0x120795,'disposeSuccess':_0x2daf85};}async function promptInput(_0x520d8a,_0x3be67b){const {rl:_0x18d097,abortPromise:_0x11cfc4,disposeSuccess:_0x2ca755}=createSafeRl(),_0x2196d4=new Promise(_0x1972ac=>{const _0xab51af=a21_0xfb29,_0xd616d1=_0x3be67b?'\x20\x20'+_0x520d8a+'\x20('+_0x3be67b+_0xab51af(0x12d):'\x20\x20'+_0x520d8a+':\x20';_0x18d097[_0xab51af(0x128)](_0xd616d1,_0x154cc3=>{const _0x20e33e=_0xab51af;_0x2ca755(),_0x1972ac(_0x154cc3[_0x20e33e(0x14f)]()||_0x3be67b);});});return Promise['race']([_0x2196d4,_0x11cfc4]);}async function promptYesNo(_0x56cd9d,_0x47137f){const _0x21b112=a21_0x2993af,{rl:_0x40cc21,abortPromise:_0x190c11,disposeSuccess:_0x3004bf}=createSafeRl(),_0x352dad=new Promise(_0x57d7a4=>{const _0x257eee=a21_0xfb29,_0x2561bd=_0x47137f?'[Y/n]':_0x257eee(0x152);_0x40cc21['question']('\x20\x20'+_0x56cd9d+'\x20'+_0x2561bd+':\x20',_0x35e1d0=>{const _0x2d586a=_0x257eee;_0x3004bf();const _0x57c9b7=_0x35e1d0['trim']()['toLowerCase']();if(_0x57c9b7==='y'||_0x57c9b7===_0x2d586a(0x153))_0x57d7a4(!![]);else{if(_0x57c9b7==='n'||_0x57c9b7==='no')_0x57d7a4(![]);else _0x57d7a4(_0x47137f);}});});return Promise[_0x21b112(0x135)]([_0x352dad,_0x190c11]);}function loadExisting(_0xfcf617){if(!existsSync(_0xfcf617))return null;return readConfigFile(_0xfcf617);}function resolveFilePath(_0x441c4b){const _0x275ddf=a21_0x2993af;return isAbsolute(_0x441c4b)?_0x441c4b:resolve(process[_0x275ddf(0x117)](),_0x441c4b);}function readSourceFile(_0x51f2f3){const _0x5b9c0e=a21_0x2993af;try{const _0x18e481=readFileSync(_0x51f2f3,{'encoding':'utf8'});return JSON['parse'](_0x18e481);}catch(_0x2119a7){throw CliErrors[_0x5b9c0e(0x131)](_0x5b9c0e(0x134)+_0x2119a7[_0x5b9c0e(0x12b)]);}}function resolveInitEnv(_0x5e8d7b){const _0x1d0869=a21_0x2993af,_0x118dff=_0x5e8d7b[_0x1d0869(0x12f)];if(_0x118dff===undefined||_0x118dff==='')return DEFAULT_CONFIG_VALUES[_0x1d0869(0x12f)];if(!RUNTIME_ENV_VALUES[_0x1d0869(0x122)](_0x118dff))throw CliErrors[_0x1d0869(0x131)](_0x1d0869(0x15b)+_0x118dff+_0x1d0869(0x127)+RUNTIME_ENV_VALUES[_0x1d0869(0x11e)](',\x20'));return _0x118dff;}
|
|
1
|
+
const a21_0x440122=a21_0x21b0;(function(_0x338abf,_0x416bf8){const _0x14b870=a21_0x21b0,_0x5cec94=_0x338abf();while(!![]){try{const _0x3ea1df=-parseInt(_0x14b870(0x126))/0x1+parseInt(_0x14b870(0x11a))/0x2+parseInt(_0x14b870(0x14a))/0x3*(parseInt(_0x14b870(0x144))/0x4)+parseInt(_0x14b870(0x142))/0x5+parseInt(_0x14b870(0x141))/0x6+parseInt(_0x14b870(0x130))/0x7+-parseInt(_0x14b870(0x136))/0x8;if(_0x3ea1df===_0x416bf8)break;else _0x5cec94['push'](_0x5cec94['shift']());}catch(_0x454364){_0x5cec94['push'](_0x5cec94['shift']());}}}(a21_0x2182,0xc344d));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_0x440122(0x14d),'description':a21_0x440122(0x138)},{'name':a21_0x440122(0x143),'type':a21_0x440122(0x14d),'description':a21_0x440122(0x124)+DEFAULT_CONFIG_VALUES[a21_0x440122(0x143)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a21_0x440122(0x153),'description':a21_0x440122(0x12c)+PRODUCT_CONFIG[a21_0x440122(0x147)]+a21_0x440122(0x150),'default':![]},{'name':'yes','type':a21_0x440122(0x153),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':'file','type':a21_0x440122(0x14d),'description':a21_0x440122(0x123),'required':!![]},{'name':a21_0x440122(0x14c),'type':a21_0x440122(0x14d),'description':a21_0x440122(0x11d)},{'name':a21_0x440122(0x143),'type':a21_0x440122(0x14d),'description':a21_0x440122(0x149),'enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x440122(0x12f),'type':a21_0x440122(0x153),'description':a21_0x440122(0x12c)+PRODUCT_CONFIG[a21_0x440122(0x147)]+')\x20instead\x20of\x20project','default':![]},{'name':'yes','type':'boolean','description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x3438cc){const _0x33aebc=a21_0x440122,_0x399615=isNonInteractiveMode(_0x3438cc),_0x5c9621=_0x3438cc[_0x33aebc(0x12f)]?_0x33aebc(0x12f):_0x33aebc(0x121),_0x1a51e4=resolveWriteConfigPath(_0x5c9621);try{_0x399615?await runNonInteractive(_0x3438cc,_0x1a51e4):await runInteractive(_0x3438cc,_0x1a51e4);}catch(_0x18bbb7){if(_0x18bbb7 instanceof AbortPrompt)throw CliErrors[_0x33aebc(0x129)]();throw _0x18bbb7;}}export async function runInitImport(_0x47e1b6){const _0x4ae488=a21_0x440122,_0x319cd4=_0x47e1b6[_0x4ae488(0x12f)]?_0x4ae488(0x12f):_0x4ae488(0x121),_0x5f09c9=resolveWriteConfigPath(_0x319cd4);await runFromImport(_0x47e1b6,_0x5f09c9);}const RUNTIME_IRRELEVANT_KEYS=new Set(['apiDir']);async function runFromImport(_0x1a8953,_0x44141c){const _0x4b58bd=a21_0x440122,_0x1c039f=resolveFilePath(_0x1a8953[_0x4b58bd(0x13d)]);if(!existsSync(_0x1c039f))throw CliErrors[_0x4b58bd(0x148)](_0x4b58bd(0x145)+_0x1c039f);const _0x233218=readSourceFile(_0x1c039f),_0x1f3137=convertToRuntimeConfig(_0x233218);_0x1a8953[_0x4b58bd(0x14c)]&&(_0x1f3137[_0x4b58bd(0x14c)]=String(_0x1a8953[_0x4b58bd(0x14c)]));_0x1a8953[_0x4b58bd(0x143)]&&(_0x1f3137[_0x4b58bd(0x143)]=resolveInitEnv(_0x1a8953));if(!_0x1f3137[_0x4b58bd(0x14c)])throw CliErrors[_0x4b58bd(0x148)](_0x4b58bd(0x133),_0x4b58bd(0x120));await writeInitConfig(_0x44141c,_0x1f3137,_0x1a8953),console['log'](_0x4b58bd(0x139)+_0x1c039f),console[_0x4b58bd(0x12b)](_0x4b58bd(0x11e)+_0x44141c),console[_0x4b58bd(0x12b)](_0x4b58bd(0x131)+_0x1f3137['appcode']);if(_0x1f3137[_0x4b58bd(0x11f)])console[_0x4b58bd(0x12b)]('\x20\x20default:\x20'+_0x1f3137[_0x4b58bd(0x11f)]);}function convertToRuntimeConfig(_0x32b66d){const _0x42c44b=a21_0x440122;if(_0x32b66d['apps']&&typeof _0x32b66d[_0x42c44b(0x128)]==='object')throw CliErrors[_0x42c44b(0x148)]('Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.',_0x42c44b(0x116));const _0x174a03={};for(const _0x8b267 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x32b66d[_0x8b267]!==undefined&&(_0x174a03[_0x8b267]=_0x32b66d[_0x8b267]);}return!_0x174a03[_0x42c44b(0x117)]&&(_0x174a03[_0x42c44b(0x117)]=DEFAULT_CONFIG_VALUES[_0x42c44b(0x117)]),_0x174a03;}async function runNonInteractive(_0x24ed81,_0x23bcc6){const _0x17ced7=a21_0x440122,_0x4d5607=_0x24ed81[_0x17ced7(0x14c)];if(!_0x4d5607)throw CliErrors[_0x17ced7(0x146)](_0x17ced7(0x14c),_0x17ced7(0x12d)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x4cf55b=resolveInitEnv(_0x24ed81);await writeInitConfig(_0x23bcc6,{'appcode':_0x4d5607,'env':_0x4cf55b},_0x24ed81),console[_0x17ced7(0x12b)]('Initialized\x20'+_0x23bcc6),console[_0x17ced7(0x12b)]('\x20\x20appcode:\x20'+_0x4d5607),console[_0x17ced7(0x12b)](_0x17ced7(0x151)+_0x4cf55b);}async function runInteractive(_0x4137aa,_0x3ebd57){const _0x34ee12=a21_0x440122,_0x2c77c9=loadExisting(_0x3ebd57),_0x59c5e9=typeof _0x2c77c9?.['appcode']==='string'?_0x2c77c9[_0x34ee12(0x14c)]:'',_0x1da0e4=resolveInitEnv(_0x4137aa);console[_0x34ee12(0x12b)](CLI_BIN_NAME+_0x34ee12(0x13c)+PRODUCT_CONFIG['newConfigFileName']+'\x0a');if(existsSync(_0x3ebd57)&&!_0x4137aa[_0x34ee12(0x137)]){const _0x50f5a4=await promptYesNo(_0x34ee12(0x122)+_0x3ebd57+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x50f5a4){console[_0x34ee12(0x12b)](_0x34ee12(0x127));return;}}const _0x3115e3=typeof _0x4137aa[_0x34ee12(0x14c)]==='string'?_0x4137aa[_0x34ee12(0x14c)][_0x34ee12(0x132)]():'';let _0x517cba=_0x3115e3;!_0x517cba&&(_0x517cba=await promptInput(_0x34ee12(0x125),_0x59c5e9));if(!_0x517cba[_0x34ee12(0x132)]())throw CliErrors[_0x34ee12(0x148)](_0x34ee12(0x135));await writeInitConfig(_0x3ebd57,{'appcode':_0x517cba[_0x34ee12(0x132)](),'env':_0x1da0e4},_0x4137aa),console['log'](_0x34ee12(0x14b)+_0x3ebd57),console[_0x34ee12(0x12b)](_0x34ee12(0x131)+_0x517cba[_0x34ee12(0x132)]()),console['log'](_0x34ee12(0x151)+_0x1da0e4);}async function writeInitConfig(_0x29dd5c,_0x2a9926,_0x104587){const _0x32eb25=a21_0x440122;let _0x1e7c99={};existsSync(_0x29dd5c)&&!_0x104587[_0x32eb25(0x137)]&&(_0x1e7c99=readConfigFile(_0x29dd5c));for(const [_0x2f9b26,_0x441fe3]of Object['entries'](_0x2a9926)){_0x441fe3!==undefined&&(_0x1e7c99[_0x2f9b26]=_0x441fe3);}if(_0x1e7c99[_0x32eb25(0x152)])delete _0x1e7c99[_0x32eb25(0x152)];writeConfigFile(_0x29dd5c,_0x1e7c99);}class AbortPrompt extends Error{constructor(){const _0x3db838=a21_0x440122;super('User\x20aborted\x20prompt'),this['name']=_0x3db838(0x140);}}function createSafeRl(){const _0x3937a2=a21_0x440122,_0x632916=createInterface({'input':process[_0x3937a2(0x13a)],'output':process[_0x3937a2(0x11b)]});let _0xd68cff;const _0x3342d0=new Promise((_0x5ac6bd,_0x30730f)=>{const _0x2428ae=_0x3937a2;_0xd68cff=()=>{const _0x198341=a21_0x21b0;_0xd68cff&&(_0x632916[_0x198341(0x13b)](_0x198341(0x119),_0xd68cff),_0xd68cff=undefined);try{_0x632916['close']();}catch{}_0x30730f(new AbortPrompt());},_0x632916[_0x2428ae(0x14e)]('SIGINT',_0xd68cff);}),_0x8b62ec=()=>{const _0x216908=_0x3937a2;_0xd68cff&&(_0x632916[_0x216908(0x13b)](_0x216908(0x119),_0xd68cff),_0xd68cff=undefined);try{_0x632916['close']();}catch{}};return{'rl':_0x632916,'abortPromise':_0x3342d0,'disposeSuccess':_0x8b62ec};}async function promptInput(_0xbaadf4,_0x470525){const _0x3e1a21=a21_0x440122,{rl:_0x256252,abortPromise:_0x23b202,disposeSuccess:_0x566761}=createSafeRl(),_0x449032=new Promise(_0x333cbe=>{const _0x201edd=a21_0x21b0,_0x19583b=_0x470525?'\x20\x20'+_0xbaadf4+'\x20('+_0x470525+_0x201edd(0x11c):'\x20\x20'+_0xbaadf4+':\x20';_0x256252[_0x201edd(0x12a)](_0x19583b,_0x2da2c9=>{const _0x438797=_0x201edd;_0x566761(),_0x333cbe(_0x2da2c9[_0x438797(0x132)]()||_0x470525);});});return Promise[_0x3e1a21(0x154)]([_0x449032,_0x23b202]);}function a21_0x21b0(_0x322241,_0x5ec48b){_0x322241=_0x322241-0x116;const _0x2182ea=a21_0x2182();let _0x21b07e=_0x2182ea[_0x322241];return _0x21b07e;}async function promptYesNo(_0x37354e,_0x2e0b38){const {rl:_0x3d1c68,abortPromise:_0x15a1e9,disposeSuccess:_0x294ac3}=createSafeRl(),_0x454393=new Promise(_0x5aeceb=>{const _0x41af58=a21_0x21b0,_0x578ab9=_0x2e0b38?_0x41af58(0x155):'[y/N]';_0x3d1c68['question']('\x20\x20'+_0x37354e+'\x20'+_0x578ab9+':\x20',_0x57ece2=>{const _0x2e046d=_0x41af58;_0x294ac3();const _0x5cbea7=_0x57ece2[_0x2e046d(0x132)]()['toLowerCase']();if(_0x5cbea7==='y'||_0x5cbea7===_0x2e046d(0x137))_0x5aeceb(!![]);else{if(_0x5cbea7==='n'||_0x5cbea7==='no')_0x5aeceb(![]);else _0x5aeceb(_0x2e0b38);}});});return Promise['race']([_0x454393,_0x15a1e9]);}function loadExisting(_0x46cd61){if(!existsSync(_0x46cd61))return null;return readConfigFile(_0x46cd61);}function resolveFilePath(_0x3d14af){const _0x370f7c=a21_0x440122;return isAbsolute(_0x3d14af)?_0x3d14af:resolve(process[_0x370f7c(0x134)](),_0x3d14af);}function readSourceFile(_0x1299c8){const _0x593a3b=a21_0x440122;try{const _0x5d860c=readFileSync(_0x1299c8,{'encoding':'utf8'});return JSON[_0x593a3b(0x14f)](_0x5d860c);}catch(_0x9d689d){throw CliErrors[_0x593a3b(0x148)](_0x593a3b(0x13f)+_0x9d689d['message']);}}function a21_0x2182(){const _0x365efc=['Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','Target\x20environment\x20(default\x20','App\x20code','1025613trcASc','Aborted.','apps','cancelled','question','log','Write\x20to\x20global\x20(~/','Usage:\x20','join','global','10235428txrdOU','\x20\x20appcode:\x20','trim','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','cwd','App\x20code\x20cannot\x20be\x20empty.','36275088WzpYGR','yes','App\x20code\x20for\x20the\x20project','Imported\x20from\x20','stdin','removeListener','\x20init\x20—\x20Create\x20','file','\x22.\x20Allowed:\x20','Failed\x20to\x20parse\x20source\x20file:\x20','AbortPrompt','7445340bHRIcG','5378770gaqkto','env','20kSxrVi','Source\x20file\x20not\x20found:\x20','flagMissing','newConfigFileName','validation','Override\x20imported\x20default\x20env','930813pzImkl','\x0aInitialized\x20','appcode','string','once','parse',')\x20instead\x20of\x20project','\x20\x20env:\x20\x20\x20\x20\x20','app','boolean','race','[Y/n]','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','riskLevel','Invalid\x20env\x20\x22','SIGINT','2059234UWDIvP','stdout','):\x20','Override\x20imported\x20default\x20appcode','\x20\x20config:\x20\x20','defaultApp','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`.','project','File\x20'];a21_0x2182=function(){return _0x365efc;};return a21_0x2182();}function resolveInitEnv(_0x9e6c13){const _0x2748b8=a21_0x440122,_0x551a09=_0x9e6c13[_0x2748b8(0x143)];if(_0x551a09===undefined||_0x551a09==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES['includes'](_0x551a09))throw CliErrors['validation'](_0x2748b8(0x118)+_0x551a09+_0x2748b8(0x13e)+RUNTIME_ENV_VALUES[_0x2748b8(0x12e)](',\x20'));return _0x551a09;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a22_0x3e84(_0x326071,_0x10249b){_0x326071=_0x326071-0x1a7;const _0x107b6e=a22_0x107b();let _0x3e8478=_0x107b6e[_0x326071];return _0x3e8478;}function a22_0x107b(){const _0xb70871=['Personal\x20knowledge-base\x20entry\x20title','build','5637qDXgyM','File\x20path\x20is\x20required.','string','--topk\x20must\x20be\x20a\x20positive\x20number.','utf8','/client/knowledge-base/personal/create','version','5316JRUBzh','query','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','appCode','Override\x20the\x20existing\x20entry\x20title','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','map','description','read','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','3269244tOUdCV','59795UInZJA','1592zywjND','424wuwPJt','scope','weightedScore','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','title','detail','validation','createTime','docId','num','isFinite','11FCMAiA','str','body','98RWuDcZ','Updated\x20KB\x20entry\x20','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','bool','updateTime','metadata','/update','Personal\x20knowledge-base\x20entry\x20ID','ragStatus','verbose','ragErrorMessage','48294PBGdfG','length','score','30446LREhug','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','content','POST','5293900llmwpu','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','file','update','66ndXfGE','write','number','topk','104634POlIgR'];a22_0x107b=function(){return _0xb70871;};return a22_0x107b();}const a22_0x29943c=a22_0x3e84;(function(_0x580783,_0x56dc5d){const _0x4d682d=a22_0x3e84,_0x1794e9=_0x580783();while(!![]){try{const _0x109c3d=-parseInt(_0x4d682d(0x1c6))/0x1*(-parseInt(_0x4d682d(0x1bf))/0x2)+-parseInt(_0x4d682d(0x1d8))/0x3+-parseInt(_0x4d682d(0x1db))/0x4*(parseInt(_0x4d682d(0x1d9))/0x5)+parseInt(_0x4d682d(0x1c3))/0x6*(parseInt(_0x4d682d(0x1a8))/0x7)+-parseInt(_0x4d682d(0x1da))/0x8*(-parseInt(_0x4d682d(0x1b3))/0x9)+parseInt(_0x4d682d(0x1bb))/0xa*(parseInt(_0x4d682d(0x1e6))/0xb)+-parseInt(_0x4d682d(0x1cd))/0xc*(-parseInt(_0x4d682d(0x1b6))/0xd);if(_0x109c3d===_0x56dc5d)break;else _0x1794e9['push'](_0x1794e9['shift']());}catch(_0x224fe9){_0x1794e9['push'](_0x1794e9['shift']());}}}(a22_0x107b,0xacba7));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a22_0x29943c(0x1df),'type':a22_0x29943c(0x1c8),'required':!![],'description':a22_0x29943c(0x1c4)},FILE_FLAG={'name':'file','type':a22_0x29943c(0x1c8),'required':!![],'description':a22_0x29943c(0x1de)},QUERY_FLAG={'name':a22_0x29943c(0x1ce),'type':'string','required':!![],'description':a22_0x29943c(0x1b8)},TOPK_FLAG={'name':a22_0x29943c(0x1c2),'type':a22_0x29943c(0x1c1),'description':a22_0x29943c(0x1d7)};function readKnowledgeFile(_0x47d706){const _0x4dad1a=a22_0x29943c;if(!_0x47d706)throw CliErrors[_0x4dad1a(0x1e1)](_0x4dad1a(0x1c7));if(!existsSync(_0x47d706))throw CliErrors[_0x4dad1a(0x1e1)]('File\x20not\x20found:\x20'+_0x47d706);if(!statSync(_0x47d706)['isFile']())throw CliErrors[_0x4dad1a(0x1e1)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x47d706);return readFileSync(_0x47d706,_0x4dad1a(0x1ca));}function summarizePersonalItem(_0x47f2d4){const _0x451853=a22_0x29943c;return{'id':_0x47f2d4['id'],'title':_0x47f2d4[_0x451853(0x1df)],'version':_0x47f2d4[_0x451853(0x1cc)],'ragStatus':_0x47f2d4[_0x451853(0x1b0)],'ragErrorMessage':_0x47f2d4[_0x451853(0x1b2)],'updateTime':_0x47f2d4['updateTime']};}function detailPersonalItem(_0x1663ba){const _0x4a19dd=a22_0x29943c;return{'id':_0x1663ba['id'],'appCode':_0x1663ba[_0x4a19dd(0x1d0)],'scope':_0x1663ba['scope'],'userId':_0x1663ba['userId'],'title':_0x1663ba[_0x4a19dd(0x1df)],'content':_0x1663ba[_0x4a19dd(0x1b9)]??'','version':_0x1663ba[_0x4a19dd(0x1cc)],'ragStatus':_0x1663ba[_0x4a19dd(0x1b0)],'ragErrorMessage':_0x1663ba[_0x4a19dd(0x1b2)],'createTime':_0x1663ba[_0x4a19dd(0x1e2)],'updateTime':_0x1663ba[_0x4a19dd(0x1ac)]};}function summarizeSearchHit(_0x4cfa22){const _0x3f3732=a22_0x29943c;return{'scope':_0x4cfa22[_0x3f3732(0x1dc)],'docId':_0x4cfa22[_0x3f3732(0x1e3)],'score':_0x4cfa22[_0x3f3732(0x1b5)],'weightedScore':_0x4cfa22[_0x3f3732(0x1dd)],'content':_0x4cfa22[_0x3f3732(0x1b9)],'metadata':_0x4cfa22[_0x3f3732(0x1ad)]};}function readTopK(_0x18c29a){const _0x311feb=a22_0x29943c,_0xf9caf9=_0x18c29a['flag'](_0x311feb(0x1c2));if(_0xf9caf9===undefined||_0xf9caf9===null||_0xf9caf9==='')return undefined;const _0x9aca90=_0x18c29a[_0x311feb(0x1e4)]('topk');if(!Number[_0x311feb(0x1e5)](_0x9aca90)||_0x9aca90<0x1)throw CliErrors['validation'](_0x311feb(0x1c9));return _0x9aca90;}const kbList={'service':'kb','command':'list','description':'List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','risk':a22_0x29943c(0x1d5),'flags':[VERBOSE_FLAG],async 'execute'(_0xd7c358){const _0x54e258=a22_0x29943c,_0x4710b4=await listPersonalKnowledgeBaseItems(_0xd7c358[_0x54e258(0x1d0)]);if(_0xd7c358[_0x54e258(0x1ab)](_0x54e258(0x1b1)))return{'ok':!![],'data':{'total':_0x4710b4['length'],'items':_0x4710b4}};return{'ok':!![],'data':{'total':_0x4710b4[_0x54e258(0x1b4)],'items':_0x4710b4['map'](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a22_0x29943c(0x1e0),'description':a22_0x29943c(0x1d2),'risk':'read','flags':[{...ID_FLAG,'description':a22_0x29943c(0x1af)}],async 'execute'(_0x5a128a){const _0x4fa572=a22_0x29943c,_0x33a210=await getPersonalKnowledgeBaseItem(_0x5a128a[_0x4fa572(0x1e4)]('id'),_0x5a128a[_0x4fa572(0x1d0)]);return{'ok':!![],'data':detailPersonalItem(_0x33a210)};}},kbCreate={'service':'kb','command':'create','description':a22_0x29943c(0x1b7),'risk':a22_0x29943c(0x1c0),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x32e991){const _0x177a9c=a22_0x29943c,_0x528d38=_0x32e991[_0x177a9c(0x1e7)](_0x177a9c(0x1df)),_0x50fbe1=readKnowledgeFile(_0x32e991[_0x177a9c(0x1e7)](_0x177a9c(0x1bd))),_0x45e0ed=await createPersonalKnowledgeBaseItem(_0x32e991[_0x177a9c(0x1d0)],{'title':_0x528d38,'content':_0x50fbe1});return{'ok':!![],'data':summarizePersonalItem(_0x45e0ed),'message':'Created\x20KB\x20entry\x20'+_0x45e0ed['id']+'\x20('+_0x45e0ed[_0x177a9c(0x1df)]+')'};},async 'dryRun'(_0x3b2676){const _0x49892c=a22_0x29943c,_0xd2e40a=_0x3b2676[_0x49892c(0x1e7)](_0x49892c(0x1df)),_0x4a8fd8=readKnowledgeFile(_0x3b2676[_0x49892c(0x1e7)](_0x49892c(0x1bd)));return dryRun(_0x49892c(0x1ba),_0x49892c(0x1cb))[_0x49892c(0x1a7)]({'appCode':_0x3b2676[_0x49892c(0x1d0)],'title':_0xd2e40a,'content':_0x4a8fd8})['description'](_0x49892c(0x1aa)+_0xd2e40a+'\x22')['build']();}},kbUpdate={'service':'kb','command':a22_0x29943c(0x1be),'description':a22_0x29943c(0x1cf),'risk':a22_0x29943c(0x1c0),'flags':[{...ID_FLAG,'description':a22_0x29943c(0x1af)},{...TITLE_FLAG,'required':![],'description':a22_0x29943c(0x1d1)},FILE_FLAG],async 'execute'(_0x14ba19){const _0x56c7f3=a22_0x29943c,_0x5cdd50=_0x14ba19[_0x56c7f3(0x1e4)]('id'),_0x348daf=readKnowledgeFile(_0x14ba19['str'](_0x56c7f3(0x1bd))),_0x5c171b=_0x14ba19[_0x56c7f3(0x1e7)](_0x56c7f3(0x1df))||(await getPersonalKnowledgeBaseItem(_0x5cdd50,_0x14ba19[_0x56c7f3(0x1d0)]))[_0x56c7f3(0x1df)],_0x2629ac=await updatePersonalKnowledgeBaseItem(_0x5cdd50,_0x14ba19[_0x56c7f3(0x1d0)],{'title':_0x5c171b,'content':_0x348daf});return{'ok':!![],'data':summarizePersonalItem(_0x2629ac),'message':_0x56c7f3(0x1a9)+_0x2629ac['id']+'\x20('+_0x2629ac[_0x56c7f3(0x1df)]+')'};},async 'dryRun'(_0x14dc72){const _0xbfdc0e=a22_0x29943c,_0x5b8525=_0x14dc72[_0xbfdc0e(0x1e4)]('id'),_0xca83b9=readKnowledgeFile(_0x14dc72[_0xbfdc0e(0x1e7)](_0xbfdc0e(0x1bd))),_0x232acd=_0x14dc72[_0xbfdc0e(0x1e7)](_0xbfdc0e(0x1df))||(await getPersonalKnowledgeBaseItem(_0x5b8525,_0x14dc72[_0xbfdc0e(0x1d0)]))[_0xbfdc0e(0x1df)];return dryRun('POST','/client/knowledge-base/personal/'+_0x5b8525+_0xbfdc0e(0x1ae))[_0xbfdc0e(0x1a7)]({'appCode':_0x14dc72[_0xbfdc0e(0x1d0)],'title':_0x232acd,'content':_0xca83b9})[_0xbfdc0e(0x1d4)](_0xbfdc0e(0x1bc)+_0x5b8525)[_0xbfdc0e(0x1c5)]();}},kbSearch={'service':'kb','command':'search','description':a22_0x29943c(0x1d6),'risk':a22_0x29943c(0x1d5),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x24df89){const _0x2a67bd=a22_0x29943c;if(!_0x24df89[_0x2a67bd(0x1e7)](_0x2a67bd(0x1ce))['trim']())throw CliErrors[_0x2a67bd(0x1e1)]('Search\x20query\x20is\x20required.');readTopK(_0x24df89);},async 'execute'(_0x33161e){const _0x33aef5=a22_0x29943c,_0x434c18=_0x33161e['str'](_0x33aef5(0x1ce))['trim'](),_0x3d931a=readTopK(_0x33161e),_0x294ff0=await searchKnowledgeBase(_0x33161e[_0x33aef5(0x1d0)],{'query':_0x434c18,'topK':_0x3d931a});return{'ok':!![],'data':{'total':_0x294ff0[_0x33aef5(0x1b4)],'hits':_0x294ff0[_0x33aef5(0x1d3)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a23_0x40c365=a23_0x5a0e;(function(_0x33a513,_0x4694ba){const _0x31b186=a23_0x5a0e,_0x491ac7=_0x33a513();while(!![]){try{const _0x1dcee2=-parseInt(_0x31b186(0x9e))/0x1+-parseInt(_0x31b186(0xa3))/0x2+-parseInt(_0x31b186(0x91))/0x3+-parseInt(_0x31b186(0x98))/0x4*(parseInt(_0x31b186(0xa8))/0x5)+-parseInt(_0x31b186(0xa4))/0x6*(parseInt(_0x31b186(0xaa))/0x7)+parseInt(_0x31b186(0x94))/0x8*(-parseInt(_0x31b186(0xa2))/0x9)+parseInt(_0x31b186(0xa5))/0xa;if(_0x1dcee2===_0x4694ba)break;else _0x491ac7['push'](_0x491ac7['shift']());}catch(_0xd2e172){_0x491ac7['push'](_0x491ac7['shift']());}}}(a23_0xac8a,0xc0890));function a23_0xac8a(){const _0xf4c20c=['read','details','log','292053SobxLB','message','en-US','8498896mzSXtz','\x20\x20\x20Details:\x20','warn','Clear\x20command\x20history\x20logs','200EbgpzX','\x20\x20\x20Time:\x20','level','readLogs','timestamp','length','1499772cYfLie','clearLogs','write','forEach','9WOPyiQ','982818myNCpd','1464KuuErp','64879800XYBuPp','clear','success','134115EmiOQo','*\x20No\x20logs\x20found','34636GdTfxE','command','\x20\x20\x20Duration:\x20'];a23_0xac8a=function(){return _0xf4c20c;};return a23_0xac8a();}function a23_0x5a0e(_0x2f4461,_0x325073){_0x2f4461=_0x2f4461-0x91;const _0xac8a33=a23_0xac8a();let _0x5a0eb9=_0xac8a33[_0x2f4461];return _0x5a0eb9;}import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0xe2d806){const _0x3104b5=a23_0x5a0e;if(_0xe2d806[_0x3104b5(0x9d)]===0x0){console[_0x3104b5(0xaf)](_0x3104b5(0xa9));return;}console[_0x3104b5(0xaf)]('*\x20'+CLI_DISPLAY_NAME+'\x20logs:\x0a'),_0xe2d806[_0x3104b5(0xa1)]((_0x2a9a05,_0x277b81)=>{const _0x5f0839=_0x3104b5,_0x476b0d=new Date(_0x2a9a05[_0x5f0839(0x9c)])['toLocaleString'](_0x5f0839(0x93)),_0x573dbd=_0x2a9a05[_0x5f0839(0x9a)]===_0x5f0839(0xa7)?'√':_0x2a9a05[_0x5f0839(0x9a)]==='error'?'×':_0x2a9a05[_0x5f0839(0x9a)]===_0x5f0839(0x96)?'!':'i';console[_0x5f0839(0xaf)](_0x277b81+0x1+'.\x20'+_0x573dbd+'\x20['+_0x2a9a05[_0x5f0839(0xab)]+']\x20'+_0x2a9a05[_0x5f0839(0x92)]),console[_0x5f0839(0xaf)](_0x5f0839(0x99)+_0x476b0d),_0x2a9a05['duration']&&console[_0x5f0839(0xaf)](_0x5f0839(0xac)+_0x2a9a05['duration']+'ms'),_0x2a9a05[_0x5f0839(0xae)]&&Object['keys'](_0x2a9a05[_0x5f0839(0xae)])['length']>0x0&&console[_0x5f0839(0xaf)](_0x5f0839(0x95)+JSON['stringify'](_0x2a9a05['details'],null,0x2)),console[_0x5f0839(0xaf)]('');});}export const logsDefinitions=[{'service':'logs','command':'show','description':'View\x20command\x20history\x20logs','risk':a23_0x40c365(0xad),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3f1123){const _0x194829=a23_0x40c365;return printLogs(logger[_0x194829(0x9b)]()),{'ok':!![]};}},{'service':'logs','command':a23_0x40c365(0xa6),'description':a23_0x40c365(0x97),'risk':a23_0x40c365(0xa0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x119b5f){const _0x4516e5=a23_0x40c365;return logger[_0x4516e5(0x9f)](),console[_0x4516e5(0xaf)]('*\x20Logs\x20cleared'),{'ok':!![]};}}];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x2b5d02=a24_0xde19;(function(_0x41eee9,_0x490a16){const _0x275ff9=a24_0xde19,_0x57f3b3=_0x41eee9();while(!![]){try{const _0x13a0ee=parseInt(_0x275ff9(0xde))/0x1+-parseInt(_0x275ff9(0xd1))/0x2+-parseInt(_0x275ff9(0xdd))/0x3+-parseInt(_0x275ff9(0xea))/0x4*(-parseInt(_0x275ff9(0xd6))/0x5)+parseInt(_0x275ff9(0xe0))/0x6*(parseInt(_0x275ff9(0xca))/0x7)+parseInt(_0x275ff9(0xcd))/0x8*(-parseInt(_0x275ff9(0xe7))/0x9)+-parseInt(_0x275ff9(0xe5))/0xa*(parseInt(_0x275ff9(0xd7))/0xb);if(_0x13a0ee===_0x490a16)break;else _0x57f3b3['push'](_0x57f3b3['shift']());}catch(_0x5bb60e){_0x57f3b3['push'](_0x57f3b3['shift']());}}}(a24_0x24a4,0x993c8));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';function a24_0xde19(_0x21d169,_0x45239d){_0x21d169=_0x21d169-0xc8;const _0x24a468=a24_0x24a4();let _0xde192d=_0x24a468[_0x21d169];return _0xde192d;}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(_0x3fd851){const _0x154762=a24_0xde19;for(const _0x454c8e of _0x3fd851){definitions[_0x154762(0xcf)](_0x454c8e[_0x154762(0xe6)]+':'+_0x454c8e['command'],_0x454c8e);let _0x53830b=serviceGroups[_0x154762(0xc9)](_0x454c8e['service']);!_0x53830b&&(_0x53830b=[],serviceGroups[_0x154762(0xcf)](_0x454c8e[_0x154762(0xe6)],_0x53830b)),_0x53830b[_0x154762(0xdc)](_0x454c8e);}}function registerService(_0x477f91,_0x5a966e,_0x198897){const _0x4c8211=a24_0xde19;registerDefinitions(_0x5a966e);const _0x51f7a2=_0x444dcc=>_0x444dcc==='read'?'':_0x444dcc===_0x4c8211(0xdb)?_0x4c8211(0xcc):'\x20\x20[high-risk-write]',_0x5a2afe={'service':_0x5a966e[0x0][_0x4c8211(0xe6)],'label':_0x477f91,'commands':_0x5a966e['map'](_0x13692a=>({'command':_0x13692a[_0x4c8211(0xd0)],'description':_0x13692a[_0x4c8211(0xcb)],'tag':_0x51f7a2(_0x13692a['risk'])})),'defaultCommand':_0x198897?.[_0x4c8211(0xd2)]??(_0x198897?.[_0x4c8211(0xd3)]?_0x5a966e[0x0][_0x4c8211(0xd0)]:undefined),'isSingleCommand':_0x198897?.[_0x4c8211(0xd3)]};serviceRegistry[_0x4c8211(0xdc)](_0x5a2afe),serviceByName[_0x4c8211(0xcf)](_0x5a2afe[_0x4c8211(0xe6)],_0x5a2afe);}registerService(a24_0x2b5d02(0xe3),authDefinitions,{'defaultCommand':'login'}),registerService(a24_0x2b5d02(0xe2),datasetDefinitions),registerService(a24_0x2b5d02(0xce),dataDefinitions),registerService(a24_0x2b5d02(0xd8),sqlDefinitions),registerService(a24_0x2b5d02(0xdf),bffDefinitions),registerService('Knowledge\x20Base',kbDefinitions),registerService(a24_0x2b5d02(0xd9),appDefinitions,{'defaultCommand':a24_0x2b5d02(0xe4)}),registerService(a24_0x2b5d02(0xe9),configDefinitions,{'defaultCommand':a24_0x2b5d02(0xe4)}),registerService(a24_0x2b5d02(0xec),skillDefinitions,{'defaultCommand':a24_0x2b5d02(0xc8)}),registerService('Self\x20Update',[updateDefinition],{'defaultCommand':a24_0x2b5d02(0xe1),'isSingleCommand':!![]}),registerService(a24_0x2b5d02(0xd4),[doctorDefinition],{'isSingleCommand':!![]}),registerService('Schema',[schemaDefinition],{'isSingleCommand':!![]}),registerService(a24_0x2b5d02(0xd5),logsDefinitions,{'defaultCommand':a24_0x2b5d02(0xda)});export function findDefinition(_0x277104,_0x3173d9){const _0x1f4a0e=a24_0x2b5d02;return definitions[_0x1f4a0e(0xc9)](_0x277104+':'+_0x3173d9);}export function isKnownService(_0x372542){const _0x52d315=a24_0x2b5d02;return serviceByName[_0x52d315(0xe8)](_0x372542);}export function getServiceEntry(_0xbf691e){const _0x155447=a24_0x2b5d02;return serviceByName[_0x155447(0xc9)](_0xbf691e);}export function getAllDefinitions(){const _0x39a401=a24_0x2b5d02;return Array['from'](definitions[_0x39a401(0xeb)]());}function a24_0x24a4(){const _0x31c4c0=['276742FrmaAL','defaultCommand','isSingleCommand','Diagnostics','Logs','25gpTosk','482933MXUkmM','SQL\x20Queries','App\x20Management','show','write','push','3188430sskKZm','1165074FAcXOK','BFF\x20Scripts','433212JKaoKS','run','Datasets','Authentication','list','90Rwpuez','service','1503nFpVHc','has','Configuration','804308COAzTS','values','Skills','install','get','28nOWawp','description','\x20\x20[write]','11272RPvuaY','Instant\x20API','set','command'];a24_0x24a4=function(){return _0x31c4c0;};return a24_0x24a4();}
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a25_0x36c4b6=a25_0x11cf;function a25_0x11cf(_0x1dc62b,_0x26e3d1){_0x1dc62b=_0x1dc62b-0xf6;const _0x5636ed=a25_0x5636();let _0x11cf1a=_0x5636ed[_0x1dc62b];return _0x11cf1a;}(function(_0x26d515,_0x322179){const _0x16fc23=a25_0x11cf,_0x28652d=_0x26d515();while(!![]){try{const _0x5675e9=parseInt(_0x16fc23(0xfc))/0x1*(-parseInt(_0x16fc23(0x100))/0x2)+-parseInt(_0x16fc23(0xf6))/0x3+parseInt(_0x16fc23(0x104))/0x4*(parseInt(_0x16fc23(0xf9))/0x5)+parseInt(_0x16fc23(0xff))/0x6*(parseInt(_0x16fc23(0x102))/0x7)+-parseInt(_0x16fc23(0x101))/0x8*(parseInt(_0x16fc23(0xf7))/0x9)+-parseInt(_0x16fc23(0xfb))/0xa*(parseInt(_0x16fc23(0xfd))/0xb)+parseInt(_0x16fc23(0xf8))/0xc;if(_0x5675e9===_0x322179)break;else _0x28652d['push'](_0x28652d['shift']());}catch(_0x4f6f67){_0x28652d['push'](_0x28652d['shift']());}}}(a25_0x5636,0x8b91d));function a25_0x5636(){const _0x20d0db=['153JDVKDA','19125648ZUapsa','10mvtyXO','read','50AoKMhw','657925uKFUwc','982993JFfNuw','Export\x20machine-readable\x20command\x20schema\x20(JSON)','31314zgRKcq','2wOplZh','115912DnSXdV','497FeinDc','export','194608wIctTg','416781kkIZiF'];a25_0x5636=function(){return _0x20d0db;};return a25_0x5636();}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x5f0e9e){const _0x553edc=await buildSchemaPayload();return{'ok':!![],'data':_0x553edc};}export const schemaDefinition={'service':'schema','command':a25_0x36c4b6(0x103),'description':a25_0x36c4b6(0xfe),'risk':a25_0x36c4b6(0xfa),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a26_0x2b31(){const _0x409030=['Check\x20network\x20connectivity\x20and\x20try\x20again.','authRequired','170934hmBZPA','../../skills/npx-skills-add.js','readonly','info','Updated\x20personal\x20Skill\x20','6oDbDkf','trim','skipped','719703tbPnxL','Install\x20the\x20published\x20','map','string','nonInteractive','Installing\x20official\x20skill\x20via\x20npx\x20(npx\x20skills\x20add\x20','skillName','skill','Pull\x20personal\x20and\x20company\x20runtime\x20Skills\x20into\x20local\x20agent\x20skill\x20directories','action','16PgEqtu','\x20-g\x20-y)...','skill-install','write','\x20developer\x20skill','119CUIRtM','log','company','\x20personal\x20and\x20','version','Local\x20Skill\x20directory\x20containing\x20SKILL.md','updated','3919288hDplCc','str','scope','length','apiError','pipe','appCode','reduce','118695RFhvyJ','dir','find','production','Push\x20a\x20local\x20Skill\x20directory\x20to\x20personal\x20runtime\x20Skill\x20scope','cwd','unchanged','20MZIjgz','=1);\x20assuming\x20skill\x20is\x20already\x20present.','code','unknown','933685sbNkUI','../../core/api-client.js','Only\x20pull\x20a\x20specific\x20runtime\x20Skill\x20code','input','\x20skill\x20via\x20npx.','../../skills/runtime-skill-sync.js','error','accessKey','inherit','created','push','skillCode','3283577YuXWQW','4374459WObyXW','personal'];a26_0x2b31=function(){return _0x409030;};return a26_0x2b31();}const a26_0x3c6822=a26_0x860a;(function(_0x1d3806,_0x323f75){const _0x47ad41=a26_0x860a,_0x1be193=_0x1d3806();while(!![]){try{const _0x191b3f=-parseInt(_0x47ad41(0x134))/0x1+-parseInt(_0x47ad41(0x113))/0x2*(parseInt(_0x47ad41(0x116))/0x3)+parseInt(_0x47ad41(0x120))/0x4*(parseInt(_0x47ad41(0xfd))/0x5)+parseInt(_0x47ad41(0x10e))/0x6*(parseInt(_0x47ad41(0x125))/0x7)+-parseInt(_0x47ad41(0x12c))/0x8+parseInt(_0x47ad41(0x10a))/0x9*(parseInt(_0x47ad41(0xf9))/0xa)+-parseInt(_0x47ad41(0x109))/0xb;if(_0x191b3f===_0x323f75)break;else _0x1be193['push'](_0x1be193['shift']());}catch(_0x39b025){_0x1be193['push'](_0x1be193['shift']());}}}(a26_0x2b31,0x8cc23));import{CLI_BIN_NAME,CLI_DISPLAY_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';import{logger}from'../../utils/logger.js';const CODE_FLAG={'name':a26_0x3c6822(0xfb),'type':'string','description':a26_0x3c6822(0xff)},DIR_FLAG={'name':a26_0x3c6822(0x135),'type':a26_0x3c6822(0x119),'required':!![],'description':a26_0x3c6822(0x12a)};function summarizeRuntimeSkill(_0x2bda28){const _0x1d76eb=a26_0x3c6822;return{'id':_0x2bda28['id'],'skillCode':_0x2bda28[_0x1d76eb(0x108)],'skillName':_0x2bda28[_0x1d76eb(0x11c)],'scope':_0x2bda28[_0x1d76eb(0x12e)],'version':_0x2bda28[_0x1d76eb(0x129)],'readonly':_0x2bda28[_0x1d76eb(0x110)]};}function filterByCode(_0x5b4e90,_0x44924d){const _0x1dc1db=a26_0x3c6822,_0x41a97e=_0x44924d[_0x1dc1db(0x114)]();if(!_0x41a97e)return _0x5b4e90;return _0x5b4e90['filter'](_0x3c8e56=>_0x3c8e56['skillCode']===_0x41a97e);}function a26_0x860a(_0x4784a1,_0x1044ca){_0x4784a1=_0x4784a1-0xf8;const _0x2b31ff=a26_0x2b31();let _0x860a0c=_0x2b31ff[_0x4784a1];return _0x860a0c;}export const skillDefinitions=[{'service':a26_0x3c6822(0x11d),'command':'install','description':a26_0x3c6822(0x117)+CLI_BIN_NAME+a26_0x3c6822(0x124),'risk':a26_0x3c6822(0x123),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x5639b4){const _0x24a27c=a26_0x3c6822;logger['setLogPath'](process[_0x24a27c(0x139)]()),logger[_0x24a27c(0x111)](_0x24a27c(0x122),'Installing\x20published\x20'+CLI_DISPLAY_NAME+_0x24a27c(0x101));const {LOVRABET_SKILL_SOURCE:_0x1e8463,LOVRABET_SKIP_NPX_SKILLS_ENV:_0x44526f,runNpxSkillsAddGlobal:_0x511bed}=await import(_0x24a27c(0x10f)),_0x36c383=_0x5639b4[_0x24a27c(0x11a)]?_0x24a27c(0x131):_0x24a27c(0x105);console[_0x24a27c(0x126)](_0x24a27c(0x11b)+_0x1e8463+_0x24a27c(0x121));const _0x58536e=_0x511bed(process['cwd'](),_0x1e8463,{'stdio':_0x36c383});if(_0x58536e[_0x24a27c(0x115)])console['log']('Skipped\x20npx\x20('+_0x44526f+_0x24a27c(0xfa));else{if(_0x58536e['ok'])console[_0x24a27c(0x126)](CLI_BIN_NAME+'\x20skill\x20installed');else throw CliErrors[_0x24a27c(0x130)]('npx\x20skills\x20add\x20failed:\x20'+(_0x58536e[_0x24a27c(0x103)]||_0x24a27c(0xfc)),_0x24a27c(0x10c));}return{'ok':!![]};}},{'service':'skill','command':'pull','description':a26_0x3c6822(0x11e),'risk':a26_0x3c6822(0x123),'flags':[CODE_FLAG],async 'execute'(_0x3709a9){const _0x5d0aba=a26_0x3c6822,{listCompanyRuntimeSkills:_0x4b7703,listPersonalRuntimeSkills:_0x31c058}=await import(_0x5d0aba(0xfe)),{linkEffectiveRuntimeSkills:_0x519f44,materializeRuntimeSkill:_0x1efb81}=await import(_0x5d0aba(0x102)),_0x968eab=_0x3709a9[_0x5d0aba(0x12d)](_0x5d0aba(0xfb)),_0x1ff16b=_0x3709a9['envName']??_0x5d0aba(0x137),_0x594679=_0x3709a9['accessKey'];if(!_0x594679)throw CliErrors[_0x5d0aba(0x10d)]();const _0x13341e=filterByCode(await _0x31c058(_0x3709a9[_0x5d0aba(0x132)]),_0x968eab),_0x5ecdb5=filterByCode(await _0x4b7703(_0x3709a9['appCode']),_0x968eab),_0x306679=[..._0x13341e['map'](_0x579e6b=>_0x1efb81(_0x579e6b,_0x5d0aba(0x10b),{'env':_0x1ff16b,'accessKey':_0x594679,'appCode':_0x3709a9['appCode']})),..._0x5ecdb5[_0x5d0aba(0x118)](_0x5a5b5e=>_0x1efb81(_0x5a5b5e,_0x5d0aba(0x127),{'env':_0x1ff16b,'accessKey':_0x594679,'appCode':_0x3709a9[_0x5d0aba(0x132)]}))],_0x5049ed=_0x519f44(_0x306679,_0x3709a9[_0x5d0aba(0x132)]),_0x5e4ddb=_0x5049ed[_0x5d0aba(0x133)]((_0x4d34ed,_0x1f953b)=>{const _0x520ea8=_0x5d0aba;return _0x4d34ed[_0x1f953b[_0x520ea8(0x11f)]]=(_0x4d34ed[_0x1f953b[_0x520ea8(0x11f)]]??0x0)+0x1,_0x4d34ed;},{});return{'ok':!![],'data':{'appCode':_0x3709a9['appCode'],'personal':_0x13341e[_0x5d0aba(0x12f)],'company':_0x5ecdb5['length'],'materialized':_0x306679[_0x5d0aba(0x12f)],'links':{'total':_0x5049ed[_0x5d0aba(0x12f)],'created':_0x5e4ddb[_0x5d0aba(0x106)]??0x0,'updated':_0x5e4ddb[_0x5d0aba(0x12b)]??0x0,'unchanged':_0x5e4ddb[_0x5d0aba(0xf8)]??0x0,'skipped':0x0,'conflicted':0x0},'skills':{'personal':_0x13341e[_0x5d0aba(0x118)](summarizeRuntimeSkill),'company':_0x5ecdb5[_0x5d0aba(0x118)](summarizeRuntimeSkill)}},'message':'Pulled\x20'+_0x13341e['length']+_0x5d0aba(0x128)+_0x5ecdb5['length']+'\x20company\x20Skill(s).'};}},{'service':a26_0x3c6822(0x11d),'command':a26_0x3c6822(0x107),'description':a26_0x3c6822(0x138),'risk':a26_0x3c6822(0x123),'flags':[DIR_FLAG],async 'execute'(_0x19bdde){const _0x4d6708=a26_0x3c6822,{createPersonalRuntimeSkill:_0x54a560,listPersonalRuntimeSkills:_0x313e6d,updatePersonalRuntimeSkill:_0x3b0a16}=await import(_0x4d6708(0xfe)),{readPushDirectory:_0x2df6c9}=await import(_0x4d6708(0x102));if(!_0x19bdde[_0x4d6708(0x104)])throw CliErrors[_0x4d6708(0x10d)]();const _0x54af74=_0x2df6c9(_0x19bdde[_0x4d6708(0x12d)](_0x4d6708(0x135)),_0x19bdde[_0x4d6708(0x132)]),_0x57c33a=(await _0x313e6d(_0x19bdde[_0x4d6708(0x132)]))[_0x4d6708(0x136)](_0x524ece=>_0x524ece[_0x4d6708(0x108)]===_0x54af74['skillCode']),_0x1fcde6=_0x57c33a?await _0x3b0a16(_0x54af74[_0x4d6708(0x108)],_0x19bdde['appCode'],_0x54af74[_0x4d6708(0x100)]):await _0x54a560(_0x19bdde['appCode'],_0x54af74['input']);return{'ok':!![],'data':summarizeRuntimeSkill(_0x1fcde6),'message':_0x57c33a?_0x4d6708(0x112)+_0x54af74[_0x4d6708(0x108)]:'Created\x20personal\x20Skill\x20'+_0x54af74['skillCode']};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x1bcbad=a27_0x4441;function a27_0x4441(_0x14efa7,_0x1bf059){_0x14efa7=_0x14efa7-0x9e;const _0x1375b9=a27_0x1375();let _0x4441ad=_0x1375b9[_0x14efa7];return _0x4441ad;}(function(_0x5deb8a,_0x5b95a3){const _0x52ec1e=a27_0x4441,_0x3a1f02=_0x5deb8a();while(!![]){try{const _0x31b323=-parseInt(_0x52ec1e(0x9f))/0x1+-parseInt(_0x52ec1e(0xa0))/0x2+-parseInt(_0x52ec1e(0xac))/0x3+-parseInt(_0x52ec1e(0xad))/0x4+-parseInt(_0x52ec1e(0xaa))/0x5+-parseInt(_0x52ec1e(0xa7))/0x6*(parseInt(_0x52ec1e(0xa4))/0x7)+parseInt(_0x52ec1e(0xaf))/0x8;if(_0x31b323===_0x5b95a3)break;else _0x3a1f02['push'](_0x3a1f02['shift']());}catch(_0x238ee8){_0x3a1f02['push'](_0x3a1f02['shift']());}}}(a27_0x1375,0xe82bc));function a27_0x1375(){const _0x74b718=['5182368sXnZFD','598564wzfrLQ','detail','61787736fhqlOF','appCode','1816601ZLfJwY','2708926MSYDwb','dbId','bool','sqlcode','16849uBjMZQ','str','description','552PaHgXJ','read','verbose','7514450yWvdCR','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode'];a27_0x1375=function(){return _0x74b718;};return a27_0x1375();}import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':'sql','command':a27_0x1bcbad(0xae),'description':a27_0x1bcbad(0xab),'risk':a27_0x1bcbad(0xa8),'flags':[SQLCODE_FLAG,VERBOSE_FLAG],async 'execute'(_0x2d53f0){const _0x4ce213=a27_0x1bcbad,_0x10155f=await getSqlQueryInfo(_0x2d53f0[_0x4ce213(0x9e)],_0x2d53f0[_0x4ce213(0xa5)](_0x4ce213(0xa3))),_0x25a1d0=_0x2d53f0[_0x4ce213(0xa2)](_0x4ce213(0xa9));if(_0x25a1d0)return{'ok':!![],'data':_0x10155f};const _0x2a203f=_0x10155f['dbId']?await getDbName(_0x2d53f0[_0x4ce213(0x9e)],_0x10155f[_0x4ce213(0xa1)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x10155f['sqlCode'],'sqlName':_0x10155f['sqlName'],'db':_0x2a203f?_0x2a203f+'\x20('+_0x10155f[_0x4ce213(0xa1)]+')':_0x10155f[_0x4ce213(0xa1)]??'','description':_0x10155f[_0x4ce213(0xa6)]??'','sqlContent':_0x10155f['sqlContent']??''}};}};
|