@lovrabet/lovrabet-cli 2.0.12 → 2.0.13-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a16_0xf79ee9=a16_0x3364;(function(_0xc4f506,_0x153144){const _0x22b4ca=a16_0x3364,_0x21eced=_0xc4f506();while(!![]){try{const _0x3ab459=-parseInt(_0x22b4ca(0x13a))/0x1*(-parseInt(_0x22b4ca(0x13d))/0x2)+parseInt(_0x22b4ca(0x14e))/0x3*(parseInt(_0x22b4ca(0x13e))/0x4)+parseInt(_0x22b4ca(0x158))/0x5*(parseInt(_0x22b4ca(0x135))/0x6)+parseInt(_0x22b4ca(0x155))/0x7*(-parseInt(_0x22b4ca(0x15d))/0x8)+-parseInt(_0x22b4ca(0x177))/0x9*(parseInt(_0x22b4ca(0x132))/0xa)+parseInt(_0x22b4ca(0x170))/0xb*(-parseInt(_0x22b4ca(0x12a))/0xc)+-parseInt(_0x22b4ca(0x163))/0xd*(-parseInt(_0x22b4ca(0x176))/0xe);if(_0x3ab459===_0x153144)break;else _0x21eced['push'](_0x21eced['shift']());}catch(_0xbea91){_0x21eced['push'](_0x21eced['shift']());}}}(a16_0x52b7,0x5d7b8));import{executeData}from'../../core/sdk-client.js';function a16_0x3364(_0x10847f,_0x57a5a9){_0x10847f=_0x10847f-0x121;const _0x52b7cf=a16_0x52b7();let _0x33641a=_0x52b7cf[_0x10847f];return _0x33641a;}function a16_0x52b7(){const _0x4e4635=['1206AvIOnh','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','\x20\x20\x20\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}}]}','description','join','helpExtra','\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}}','8309evydDm','params','now','2123285VrwmVH','batchCreate','\x20\x20AGGREGATE\x20TYPES','\x20completed\x20in\x20','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','5096wcHvWc','delete','getOne','\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}}','high-risk-write','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','13PdTBPG','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','data','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','build','\x20\x20PAGINATION','8342543vLkYdi','risk','\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\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','operation','\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}','15831578SmatCJ','81LUGlSo','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','data\x20','read','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','Get\x20a\x20single\x20record\x20by\x20ID','command','\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]}}','write','12oBpqRK','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','filter','\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}','create','\x20\x20LOGICAL\x20COMBINATORS','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','\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}}]}','285370UIqqzy','update','\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}','6OXKybh','\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}}','str','\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}}','Update\x20an\x20existing\x20record','73769AgYHzl','Preview:\x20data\x20','dryRun','6mtwAgv','3756HCnNxt','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','/api/{appCode}/','POST','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20WHERE\x20OPERATORS','body','map','code','\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}}','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','paramsRequired','\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}','aggregate','\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}}'];a16_0x52b7=function(){return _0x4e4635;};return a16_0x52b7();}import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a16_0xf79ee9(0x12c),'operation':a16_0xf79ee9(0x12c),'risk':a16_0xf79ee9(0x124),'paramsRequired':![],'description':'Filter\x20dataset\x20records\x20with\x20query\x20conditions','paramsHint':'JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20'+a16_0xf79ee9(0x162),'helpExtra':[a16_0xf79ee9(0x144),a16_0xf79ee9(0x136),a16_0xf79ee9(0x16b),a16_0xf79ee9(0x138),a16_0xf79ee9(0x148),a16_0xf79ee9(0x160),a16_0xf79ee9(0x142),a16_0xf79ee9(0x128),a16_0xf79ee9(0x14d),a16_0xf79ee9(0x154),a16_0xf79ee9(0x168),'',a16_0xf79ee9(0x12f),a16_0xf79ee9(0x150),a16_0xf79ee9(0x131),'',a16_0xf79ee9(0x122),a16_0xf79ee9(0x15c),a16_0xf79ee9(0x166),a16_0xf79ee9(0x16c),a16_0xf79ee9(0x16d),a16_0xf79ee9(0x121),'',a16_0xf79ee9(0x16f),a16_0xf79ee9(0x13f),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)'][a16_0xf79ee9(0x152)]('\x0a')},{'command':a16_0xf79ee9(0x15f),'operation':'getOne','risk':a16_0xf79ee9(0x124),'paramsRequired':!![],'description':a16_0xf79ee9(0x126),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a16_0xf79ee9(0x12e),'operation':a16_0xf79ee9(0x12e),'risk':a16_0xf79ee9(0x129),'paramsRequired':!![],'description':a16_0xf79ee9(0x130),'paramsHint':a16_0xf79ee9(0x16a)},{'command':a16_0xf79ee9(0x159),'operation':a16_0xf79ee9(0x159),'risk':'write','paramsRequired':!![],'description':a16_0xf79ee9(0x164),'paramsHint':'JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27'},{'command':a16_0xf79ee9(0x133),'operation':a16_0xf79ee9(0x133),'risk':a16_0xf79ee9(0x129),'paramsRequired':!![],'description':a16_0xf79ee9(0x139),'paramsHint':'JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27'},{'command':a16_0xf79ee9(0x15e),'operation':a16_0xf79ee9(0x15e),'risk':a16_0xf79ee9(0x161),'paramsRequired':!![],'description':'Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','paramsHint':a16_0xf79ee9(0x149)},{'command':a16_0xf79ee9(0x14c),'operation':a16_0xf79ee9(0x14c),'risk':a16_0xf79ee9(0x124),'paramsRequired':![],'description':'Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','paramsHint':a16_0xf79ee9(0x12b)+'Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','helpExtra':[a16_0xf79ee9(0x15a),'\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20field\x20values\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}',a16_0xf79ee9(0x14b),a16_0xf79ee9(0x175),a16_0xf79ee9(0x14f),a16_0xf79ee9(0x12d),'\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_0xf79ee9(0x134),'','\x20\x20PARAMS\x20STRUCTURE',a16_0xf79ee9(0x172),'\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)',a16_0xf79ee9(0x173),a16_0xf79ee9(0x167),'\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Post-aggregation\x20filter,\x20e.g.\x20{\x22total\x22:{\x22$gt\x22:1000}}','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','','\x20\x20EXAMPLES',a16_0xf79ee9(0x169),a16_0xf79ee9(0x143),'',a16_0xf79ee9(0x125),'\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']['join']('\x0a')}];function makeDataCommand(_0x38c01d){const _0x39a0f4=a16_0xf79ee9,_0x5e3cba=_0x39a0f4(0x123)+_0x38c01d['command'],_0x5bede7={'service':_0x39a0f4(0x165),'command':_0x38c01d[_0x39a0f4(0x127)],'description':_0x38c01d['description'],'risk':_0x38c01d['risk'],'helpExtra':_0x38c01d[_0x39a0f4(0x153)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x38c01d['paramsHint']}],'validate':async _0x1b442e=>{const _0x351aa5=_0x39a0f4;_0x38c01d[_0x351aa5(0x14a)]&&requireAnyOf(_0x1b442e,['params'],_0x5e3cba),_0x38c01d['operation']==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x1b442e[_0x351aa5(0x137)](_0x351aa5(0x156))));},async 'execute'(_0x2310f5){const _0x4d721f=_0x39a0f4,_0x4cf7ff=_0x2310f5[_0x4d721f(0x137)](_0x4d721f(0x147)),_0x502efa=_0x38c01d[_0x4d721f(0x174)]===_0x4d721f(0x159)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x2310f5['str']('params'))):parseJsonParams(_0x2310f5[_0x4d721f(0x137)](_0x4d721f(0x156)))??{},_0x317261=Date['now'](),_0x30e5b0=await executeData(_0x4cf7ff,_0x38c01d[_0x4d721f(0x174)],_0x502efa),_0x11d3a3=Date[_0x4d721f(0x157)]()-_0x317261;return{'ok':!![],'data':{'result':_0x30e5b0,'elapsed':_0x11d3a3},'message':_0x4d721f(0x123)+_0x38c01d['command']+_0x4d721f(0x15b)+_0x11d3a3+'ms'};}};return _0x38c01d[_0x39a0f4(0x171)]!==_0x39a0f4(0x124)&&(_0x5bede7[_0x39a0f4(0x13c)]=async _0x40ac68=>{const _0x30aab8=_0x39a0f4,_0x6b6344=_0x40ac68[_0x30aab8(0x137)](_0x30aab8(0x147)),_0x59da78=_0x38c01d[_0x30aab8(0x174)]===_0x30aab8(0x159)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x40ac68[_0x30aab8(0x137)]('params'))):parseJsonParams(_0x40ac68[_0x30aab8(0x137)](_0x30aab8(0x156)))??{};return dryRun(_0x30aab8(0x141),_0x30aab8(0x140)+_0x6b6344+'/'+_0x38c01d['operation'])[_0x30aab8(0x145)](_0x59da78)[_0x30aab8(0x151)](_0x30aab8(0x13b)+_0x38c01d['command']+'\x20on\x20dataset\x20'+_0x6b6344)[_0x30aab8(0x16e)]();}),_0x5bede7;}export const dataDefinitions=specs[a16_0xf79ee9(0x146)](makeDataCommand);
|
|
1
|
+
function a16_0x991f(){const _0x3e3f9e=['\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$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]}}','build','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','\x20\x20\x20\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}','\x20completed\x20in\x20','\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\x20LOGICAL\x20COMBINATORS','4lpGvuN','delete','Update\x20an\x20existing\x20record','str','12cJRmFv','\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\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','Preview:\x20data\x20','1265209ZGKAbr','187794OKukqI','data\x20','\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\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','description','\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','63oxJLpe','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','write','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','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Post-aggregation\x20filter,\x20e.g.\x20{\x22total\x22:{\x22$gt\x22:1000}}','\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}}','15183cXkTTo','\x20on\x20dataset\x20','\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','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','now','\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\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}','high-risk-write','read','\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]','POST','code','paramsHint','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','\x20\x20AGGREGATE\x20TYPES','batchCreate','131608MyNFGk','body','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','filter','operation','aggregate','\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','map','15IPEZYG','dryRun','173850gGaAmj','\x20\x20EXAMPLES','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','546036xBJfca','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\x20\x20PAGINATION','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','\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}','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','Get\x20a\x20single\x20record\x20by\x20ID','risk','params','\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\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','command','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','57634KvdeDU','create','730EUxabO','getOne','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)'];a16_0x991f=function(){return _0x3e3f9e;};return a16_0x991f();}function a16_0x28dc(_0x2bc91f,_0x1aec2e){_0x2bc91f=_0x2bc91f-0xba;const _0x991f79=a16_0x991f();let _0x28dc3d=_0x991f79[_0x2bc91f];return _0x28dc3d;}const a16_0x1b5f6a=a16_0x28dc;(function(_0x36bef7,_0x4486fa){const _0x2ec226=a16_0x28dc,_0x24d902=_0x36bef7();while(!![]){try{const _0x2488b3=parseInt(_0x2ec226(0xbf))/0x1+parseInt(_0x2ec226(0x104))/0x2+parseInt(_0x2ec226(0x107))/0x3*(-parseInt(_0x2ec226(0xcc))/0x4)+parseInt(_0x2ec226(0x102))/0x5*(parseInt(_0x2ec226(0xd6))/0x6)+-parseInt(_0x2ec226(0xdd))/0x7*(parseInt(_0x2ec226(0xf8))/0x8)+parseInt(_0x2ec226(0xe6))/0x9*(parseInt(_0x2ec226(0xc1))/0xa)+-parseInt(_0x2ec226(0xd5))/0xb*(-parseInt(_0x2ec226(0xd0))/0xc);if(_0x2488b3===_0x4486fa)break;else _0x24d902['push'](_0x24d902['shift']());}catch(_0x3aea94){_0x24d902['push'](_0x24d902['shift']());}}}(a16_0x991f,0x23c7b));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a16_0x1b5f6a(0xfc),'operation':'filter','risk':'read','paramsRequired':![],'description':'Filter\x20dataset\x20records\x20with\x20query\x20conditions','paramsHint':'JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20'+a16_0x1b5f6a(0x108),'helpExtra':['\x20\x20WHERE\x20OPERATORS',a16_0x1b5f6a(0xd1),a16_0x1b5f6a(0xe5),a16_0x1b5f6a(0xd2),a16_0x1b5f6a(0xeb),'\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}',a16_0x1b5f6a(0xc5),'\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','\x20\x20\x20\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_0x1b5f6a(0xc4),'',a16_0x1b5f6a(0xcb),a16_0x1b5f6a(0xff),'\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}}]}','',a16_0x1b5f6a(0xe2),a16_0x1b5f6a(0xfa),a16_0x1b5f6a(0xf1),'\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_0x1b5f6a(0xbe),a16_0x1b5f6a(0x10a),'',a16_0x1b5f6a(0x109),a16_0x1b5f6a(0xc7),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)']['join']('\x0a')},{'command':'getOne','operation':a16_0x1b5f6a(0xc2),'risk':'read','paramsRequired':!![],'description':a16_0x1b5f6a(0x10d),'paramsHint':a16_0x1b5f6a(0xfb)},{'command':a16_0x1b5f6a(0xc0),'operation':'create','risk':a16_0x1b5f6a(0xdf),'paramsRequired':!![],'description':a16_0x1b5f6a(0xe1),'paramsHint':a16_0x1b5f6a(0xde)},{'command':a16_0x1b5f6a(0xf7),'operation':a16_0x1b5f6a(0xf7),'risk':a16_0x1b5f6a(0xdf),'paramsRequired':!![],'description':a16_0x1b5f6a(0x106),'paramsHint':a16_0x1b5f6a(0xe9)},{'command':a16_0x1b5f6a(0xda),'operation':a16_0x1b5f6a(0xda),'risk':'write','paramsRequired':!![],'description':a16_0x1b5f6a(0xce),'paramsHint':a16_0x1b5f6a(0xe3)},{'command':a16_0x1b5f6a(0xcd),'operation':a16_0x1b5f6a(0xcd),'risk':a16_0x1b5f6a(0xef),'paramsRequired':!![],'description':a16_0x1b5f6a(0xc3),'paramsHint':a16_0x1b5f6a(0xfb)},{'command':a16_0x1b5f6a(0xfe),'operation':a16_0x1b5f6a(0xfe),'risk':a16_0x1b5f6a(0xf0),'paramsRequired':![],'description':a16_0x1b5f6a(0x10c),'paramsHint':a16_0x1b5f6a(0xf5)+a16_0x1b5f6a(0xe0),'helpExtra':[a16_0x1b5f6a(0xf6),a16_0x1b5f6a(0x10b),a16_0x1b5f6a(0xd9),a16_0x1b5f6a(0xbb),a16_0x1b5f6a(0xc8),'\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_0x1b5f6a(0xee),'','\x20\x20PARAMS\x20STRUCTURE',a16_0x1b5f6a(0xd8),a16_0x1b5f6a(0xed),a16_0x1b5f6a(0xca),a16_0x1b5f6a(0xbc),a16_0x1b5f6a(0xe4),a16_0x1b5f6a(0xd3),'',a16_0x1b5f6a(0x105),a16_0x1b5f6a(0x100),a16_0x1b5f6a(0xe8),'',a16_0x1b5f6a(0xec),a16_0x1b5f6a(0xdc)]['join']('\x0a')}];function makeDataCommand(_0x463642){const _0x2d7053=a16_0x1b5f6a,_0xef7cf5=_0x2d7053(0xd7)+_0x463642[_0x2d7053(0xbd)],_0x43baf2={'service':'data','command':_0x463642[_0x2d7053(0xbd)],'description':_0x463642[_0x2d7053(0xdb)],'risk':_0x463642['risk'],'helpExtra':_0x463642['helpExtra'],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x463642[_0x2d7053(0xf4)]}],'validate':async _0x40a61c=>{const _0x14d423=_0x2d7053;_0x463642['paramsRequired']&&requireAnyOf(_0x40a61c,[_0x14d423(0xba)],_0xef7cf5),_0x463642[_0x14d423(0xfd)]==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x40a61c[_0x14d423(0xcf)]('params')));},async 'execute'(_0x571354){const _0x20f5a9=_0x2d7053,_0x510b5a=_0x571354[_0x20f5a9(0xcf)](_0x20f5a9(0xf3)),_0x413681=_0x463642[_0x20f5a9(0xfd)]===_0x20f5a9(0xf7)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x571354['str'](_0x20f5a9(0xba)))):parseJsonParams(_0x571354[_0x20f5a9(0xcf)](_0x20f5a9(0xba)))??{},_0x320071=Date[_0x20f5a9(0xea)](),_0x13fb68=await executeData(_0x510b5a,_0x463642[_0x20f5a9(0xfd)],_0x413681),_0x36d5ec=Date[_0x20f5a9(0xea)]()-_0x320071;return{'ok':!![],'data':{'result':_0x13fb68,'elapsed':_0x36d5ec},'message':'data\x20'+_0x463642['command']+_0x20f5a9(0xc9)+_0x36d5ec+'ms'};}};return _0x463642[_0x2d7053(0x10e)]!=='read'&&(_0x43baf2[_0x2d7053(0x103)]=async _0x49bf58=>{const _0x133cbc=_0x2d7053,_0xf052f2=_0x49bf58[_0x133cbc(0xcf)](_0x133cbc(0xf3)),_0x213fe5=_0x463642[_0x133cbc(0xfd)]===_0x133cbc(0xf7)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x49bf58[_0x133cbc(0xcf)]('params'))):parseJsonParams(_0x49bf58['str'](_0x133cbc(0xba)))??{};return dryRun(_0x133cbc(0xf2),'/api/{appCode}/'+_0xf052f2+'/'+_0x463642[_0x133cbc(0xfd)])[_0x133cbc(0xf9)](_0x213fe5)[_0x133cbc(0xdb)](_0x133cbc(0xd4)+_0x463642['command']+_0x133cbc(0xe7)+_0xf052f2)[_0x133cbc(0xc6)]();}),_0x43baf2;}export const dataDefinitions=specs[a16_0x1b5f6a(0x101)](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a17_0x43f06f=a17_0x2060;function a17_0x2060(_0x4b1227,_0x59fdc9){_0x4b1227=_0x4b1227-0xd9;const _0x3924de=a17_0x3924();let _0x206052=_0x3924de[_0x4b1227];return _0x206052;}(function(_0x5ac805,_0x4af6ce){const _0x40e102=a17_0x2060,_0x27b88f=_0x5ac805();while(!![]){try{const _0x152441=-parseInt(_0x40e102(0x104))/0x1*(-parseInt(_0x40e102(0x117))/0x2)+-parseInt(_0x40e102(0xfe))/0x3*(-parseInt(_0x40e102(0xf3))/0x4)+-parseInt(_0x40e102(0x120))/0x5+-parseInt(_0x40e102(0x119))/0x6*(parseInt(_0x40e102(0x10b))/0x7)+-parseInt(_0x40e102(0xf8))/0x8+parseInt(_0x40e102(0xf4))/0x9+-parseInt(_0x40e102(0xe5))/0xa*(-parseInt(_0x40e102(0xf1))/0xb);if(_0x152441===_0x4af6ce)break;else _0x27b88f['push'](_0x27b88f['shift']());}catch(_0x5b3226){_0x27b88f['push'](_0x27b88f['shift']());}}}(a17_0x3924,0x617b4));import{getDatasetDetail,listDatasets}from'../../core/api-client.js';function a17_0x3924(){const _0x5d4c3e=['extend','toField','entries','22SlqFav','requestBody','568sIWhMv','845667ZwbGBc','split','responseFields','code','1102832RkambH','beforeScriptId','map','find','formatRules','object','11373AxmSkN','source','requestFields','description','dbtableConfig','parse','84269IbPejO','allFields','toTableName','dbId','datasetKey','dataset','length','772366bwLmhI','relatedPageInfoList','doVersion','host','validateRules','responseBody','tableComment','type','doType','fields','read','dblinkInfoDTO','6ZjfjBM','fromField','18NteqVy','modelCode','relations','creatorIdField','indexes','operations','string','1317030WwDNlm','detail','isArray','modifierIdField','deleted','logicField','createTimeField','trim','path','options','modifierNameField','tableName','push','dbType','str','sourceType','dbName','properties','1232330KKjxaW','required','method','filter','name','pkField','afterScriptId','columnCodeListWithDeleted','title'];a17_0x3924=function(){return _0x5d4c3e;};return a17_0x3924();}import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x3137e6){const _0x110759=a17_0x2060;if(_0x3137e6['deleted'])return null;const _0x5c46fd=Boolean(_0x3137e6['displayName']!==undefined||_0x3137e6[_0x110759(0x113)]!==undefined);let _0x5f4a88={};if(!_0x5c46fd&&typeof _0x3137e6[_0x110759(0xee)]===_0x110759(0x11f))try{_0x5f4a88=JSON[_0x110759(0x103)](_0x3137e6[_0x110759(0xee)]);}catch{}const _0x3f4a69=_0x5c46fd?_0x3137e6[_0x110759(0xe9)]:_0x3137e6[_0x110759(0xf7)],_0x3d3ce1=_0x5c46fd?_0x3137e6['displayName']:_0x3137e6[_0x110759(0xe9)],_0x3ff21d=_0x5c46fd?_0x3137e6[_0x110759(0x113)]:_0x3137e6[_0x110759(0x112)]||_0x3137e6['dataType'],_0x2d81c5=_0x5c46fd?_0x3137e6[_0x110759(0xea)]===!![]:_0x5f4a88['pkField']===!![],_0x42b7ec=_0x5c46fd?_0x3137e6[_0x110759(0xe6)]===!![]:_0x5f4a88[_0x110759(0xe6)]===!![],_0x2e2d54=_0x5c46fd?_0x3137e6[_0x110759(0xdc)]??null:_0x5f4a88[_0x110759(0xdc)]??null,_0xfe07f9={'name':_0x3f4a69,'displayName':_0x3d3ce1||_0x3f4a69,'type':_0x3ff21d,'dbType':_0x3137e6[_0x110759(0xe0)],'pk':_0x2d81c5,'required':_0x42b7ec,'description':_0x3137e6[_0x110759(0x101)]||undefined};return Array[_0x110759(0x122)](_0x2e2d54)&&_0x2e2d54['length']>0x0&&(_0xfe07f9['options']=_0x2e2d54),_0xfe07f9;}function parseJsonMaybe(_0xbc48d6){const _0x5a2431=a17_0x2060;if(typeof _0xbc48d6!=='string')return _0xbc48d6;try{return JSON[_0x5a2431(0x103)](_0xbc48d6);}catch{return _0xbc48d6;}}function normalizeOperationEntry(_0x9a9041,_0x37a8a0){const _0x4b9d9a=a17_0x2060;if(!_0x37a8a0||typeof _0x37a8a0!==_0x4b9d9a(0xfd))return null;if(!_0x37a8a0[_0x4b9d9a(0xe7)]||!_0x37a8a0['path'])return null;const _0x47ca70={'name':_0x9a9041,'method':_0x37a8a0['method'],'path':_0x37a8a0[_0x4b9d9a(0xdb)]};if(_0x37a8a0['host'])_0x47ca70[_0x4b9d9a(0x10e)]=_0x37a8a0['host'];if(_0x37a8a0[_0x4b9d9a(0xf2)]!=null)_0x47ca70['requestBody']=parseJsonMaybe(_0x37a8a0[_0x4b9d9a(0xf2)]);if(_0x37a8a0['responseBody']!=null)_0x47ca70[_0x4b9d9a(0x110)]=parseJsonMaybe(_0x37a8a0[_0x4b9d9a(0x110)]);if(_0x37a8a0['beforeScriptId']!=null)_0x47ca70['beforeScriptId']=_0x37a8a0[_0x4b9d9a(0xf9)];if(_0x37a8a0[_0x4b9d9a(0xeb)]!=null)_0x47ca70['afterScriptId']=_0x37a8a0[_0x4b9d9a(0xeb)];if(Array[_0x4b9d9a(0x122)](_0x37a8a0[_0x4b9d9a(0x100)]))_0x47ca70[_0x4b9d9a(0x100)]=_0x37a8a0[_0x4b9d9a(0x100)];if(Array[_0x4b9d9a(0x122)](_0x37a8a0[_0x4b9d9a(0xf6)]))_0x47ca70[_0x4b9d9a(0xf6)]=_0x37a8a0[_0x4b9d9a(0xf6)];return _0x47ca70;}function summarizeDbtable(_0x44c11e){const _0x4fa6e9=a17_0x2060,_0x194ca9={},_0x1409f5=[_0x4fa6e9(0x107),_0x4fa6e9(0xe3),_0x4fa6e9(0xde),_0x4fa6e9(0x108),_0x4fa6e9(0xea),'allFields',_0x4fa6e9(0x125),_0x4fa6e9(0xd9),'updateTimeField',_0x4fa6e9(0x11c),'creatorNameField',_0x4fa6e9(0x123),_0x4fa6e9(0xdd),'labelField',_0x4fa6e9(0x116)];for(const _0x5d16a6 of _0x1409f5){if(_0x44c11e[_0x5d16a6]!==undefined)_0x194ca9[_0x5d16a6]=_0x44c11e[_0x5d16a6];}return typeof _0x194ca9[_0x4fa6e9(0x105)]===_0x4fa6e9(0x11f)&&_0x194ca9['allFields']['length']>0x0&&(_0x194ca9['allFieldNames']=_0x194ca9[_0x4fa6e9(0x105)][_0x4fa6e9(0xf5)](',')['map'](_0x4e812b=>_0x4e812b[_0x4fa6e9(0xda)]())['filter'](Boolean)),_0x194ca9;}function normalizeRelatedPages(_0x20c734){const _0x4c5b9d=a17_0x2060;if(!Array['isArray'](_0x20c734))return[];return _0x20c734[_0x4c5b9d(0xe8)](_0x312124=>_0x312124&&typeof _0x312124===_0x4c5b9d(0xfd))['map'](_0x5ef631=>({'id':_0x5ef631['id'],'type':_0x5ef631[_0x4c5b9d(0x112)],'code':_0x5ef631['code'],'title':_0x5ef631[_0x4c5b9d(0xed)],'deleted':_0x5ef631[_0x4c5b9d(0x124)]===!![]}));}function normalizeFallbackFieldName(_0x431da2,_0x20b271){const _0x126a65=a17_0x2060,_0x212ae7=_0x431da2[_0x126a65(0xda)]();if(!_0x212ae7)return null;return{'name':_0x212ae7,'displayName':_0x212ae7,'type':undefined,'dbType':undefined,'pk':_0x212ae7===_0x20b271,'required':![],'description':undefined};}async function loadListFieldFallback(_0x203416,_0x423805){const _0x1ab5bd=a17_0x2060;if(!_0x203416||!_0x423805)return[];try{const _0x8c004=await listDatasets(_0x203416,{'code':_0x423805}),_0x325954=_0x8c004[_0x1ab5bd(0xfb)](_0x3ff254=>_0x3ff254[_0x1ab5bd(0xf7)]===_0x423805)??_0x8c004[0x0],_0x2a598c=_0x325954?.[_0x1ab5bd(0x102)]??{},_0x301682=typeof _0x2a598c[_0x1ab5bd(0x105)]===_0x1ab5bd(0x11f)?_0x2a598c[_0x1ab5bd(0x105)][_0x1ab5bd(0xf5)](','):[];return _0x301682['map'](_0x221498=>normalizeFallbackFieldName(_0x221498,_0x2a598c[_0x1ab5bd(0xea)]))[_0x1ab5bd(0xe8)](_0x11adfe=>_0x11adfe!==null);}catch{return[];}}export const datasetDetail={'service':a17_0x43f06f(0x109),'command':a17_0x43f06f(0x121),'description':'Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','risk':a17_0x43f06f(0x115),'flags':[CODE_FLAG],async 'execute'(_0x56ee3a){const _0x418606=a17_0x43f06f,_0x22720e=await getDatasetDetail(_0x56ee3a[_0x418606(0xe1)](_0x418606(0xf7))),_0xc0303f=Array[_0x418606(0x122)](_0x22720e[_0x418606(0x114)])?_0x22720e['fields']:Array['isArray'](_0x22720e[_0x418606(0xe4)])?_0x22720e['properties']:[];let _0x671155=_0xc0303f[_0x418606(0xfa)](_0xb1814e=>normalizeField(_0xb1814e))['filter'](_0x21c427=>_0x21c427!==null);_0x671155[_0x418606(0x10a)]===0x0&&(_0x671155=await loadListFieldFallback(_0x56ee3a['appCode'],_0x56ee3a['str'](_0x418606(0xf7))));const _0xa6e923=_0x22720e[_0x418606(0x11e)]??{},_0xaef550=[];for(const [_0xcf1fe8,_0x1dd1f5]of Object[_0x418606(0xf0)](_0xa6e923)){const _0x28c4f9=normalizeOperationEntry(_0xcf1fe8,_0x1dd1f5);if(_0x28c4f9)_0xaef550[_0x418606(0xdf)](_0x28c4f9);}const _0x31a1c1=_0x22720e[_0x418606(0x102)]??{},_0x4ddea1=_0x22720e[_0x418606(0x109)]??{},_0x377536=_0x31a1c1[_0x418606(0x107)]!=null?{'id':_0x31a1c1['dbId'],'name':_0x31a1c1[_0x418606(0xe3)]??null}:undefined;let _0x1aa88f;return typeof _0x22720e[_0x418606(0xee)]==='string'&&(_0x1aa88f=parseJsonMaybe(_0x22720e[_0x418606(0xee)])),{'ok':!![],'data':{'id':_0x22720e['modelId']??_0x22720e['id'],'name':_0x22720e[_0x418606(0xe9)],'code':_0x22720e[_0x418606(0x11a)]||_0x22720e[_0x418606(0xf7)],'doVersion':_0x22720e[_0x418606(0x10d)],'description':_0x22720e['description']||_0x4ddea1[_0x418606(0x111)]||undefined,'source':_0x22720e[_0x418606(0xff)]||_0x4ddea1[_0x418606(0xe2)],'table':_0x31a1c1['tableName']||_0x4ddea1[_0x418606(0xde)],'datasetKey':_0x31a1c1['datasetKey'],'pk':_0x31a1c1['pkField'],'db':_0x377536,'dbtable':summarizeDbtable(_0x31a1c1),'fields':_0x671155,'operations':_0xaef550,'indexes':Array['isArray'](_0x4ddea1[_0x418606(0x11d)])?_0x4ddea1[_0x418606(0x11d)]:[],'relations':Array[_0x418606(0x122)](_0x22720e[_0x418606(0x11b)])?_0x22720e[_0x418606(0x11b)][_0x418606(0xfa)](_0x59c5fd=>({'fromField':_0x59c5fd[_0x418606(0x118)],'toDataset':_0x59c5fd['toDatasetName'],'toCode':_0x59c5fd['toDatasetCode'],'toTable':_0x59c5fd[_0x418606(0x106)],'toField':_0x59c5fd[_0x418606(0xef)],'labelField':_0x59c5fd['toFieldLabel']||undefined})):[],'relatedPages':normalizeRelatedPages(_0x22720e[_0x418606(0x10c)]),...Array[_0x418606(0x122)](_0x22720e[_0x418606(0xec)])?{'columnCodeListWithDeleted':_0x22720e['columnCodeListWithDeleted']}:{},'formatRules':Array[_0x418606(0x122)](_0x22720e[_0x418606(0xfc)])?_0x22720e[_0x418606(0xfc)]:[],'validateRules':Array[_0x418606(0x122)](_0x22720e['validateRules'])?_0x22720e[_0x418606(0x10f)]:[],..._0x1aa88f!==undefined?{'extend':_0x1aa88f}:{},'stats':{'fieldCount':_0x671155[_0x418606(0x10a)],'operationCount':_0xaef550[_0x418606(0x10a)]}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x26eaef,_0x81bb8d){const _0x2c31d5=a18_0x4c9d,_0x2292fc=_0x26eaef();while(!![]){try{const _0xa7350a=parseInt(_0x2c31d5(0xd1))/0x1+-parseInt(_0x2c31d5(0xd5))/0x2+-parseInt(_0x2c31d5(0xd3))/0x3+parseInt(_0x2c31d5(0xd2))/0x4+parseInt(_0x2c31d5(0xd4))/0x5*(parseInt(_0x2c31d5(0xd0))/0x6)+-parseInt(_0x2c31d5(0xce))/0x7+parseInt(_0x2c31d5(0xcf))/0x8;if(_0xa7350a===_0x81bb8d)break;else _0x2292fc['push'](_0x2292fc['shift']());}catch(_0x4955f5){_0x2292fc['push'](_0x2292fc['shift']());}}}(a18_0x4f56,0xe4c7e));import{datasetList}from'../../commands/dataset/list.js';import{datasetDetail}from'../../commands/dataset/detail.js';export const datasetDefinitions=[datasetList,datasetDetail];function a18_0x4c9d(_0x344bb3,_0x2e5f8c){_0x344bb3=_0x344bb3-0xce;const _0x4f5626=a18_0x4f56();let _0x4c9d5e=_0x4f5626[_0x344bb3];return _0x4c9d5e;}function a18_0x4f56(){const _0x18354f=['7141704NZQkQK','1181106zqLOEv','767310PZavwt','3347704EAoFkp','813636ZEjGOe','5LQTevJ','371762JdflOv','9097347OWpgUf'];a18_0x4f56=function(){return _0x18354f;};return a18_0x4f56();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a19_0x34c2(){const _0x1fa3c4=['tableName','appCode','pkField','Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)','1043514MqykPE','length','allFields','split','str','code','76671HDmtaG','345452KOImsr','1924585OXATMx','string','source','dataset','name','read','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','map','list','trim','344fWUPDx','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','1830774wVpnGM','4lpvGey','599361ESehvM','244785zJeOnb'];a19_0x34c2=function(){return _0x1fa3c4;};return a19_0x34c2();}const a19_0x4d726a=a19_0x4fa6;(function(_0x57c184,_0x4d5150){const _0x573a53=a19_0x4fa6,_0xce8624=_0x57c184();while(!![]){try{const _0x3a1381=-parseInt(_0x573a53(0x143))/0x1+-parseInt(_0x573a53(0x133))/0x2+-parseInt(_0x573a53(0x12c))/0x3*(parseInt(_0x573a53(0x141))/0x4)+parseInt(_0x573a53(0x134))/0x5+parseInt(_0x573a53(0x140))/0x6+-parseInt(_0x573a53(0x142))/0x7+parseInt(_0x573a53(0x13e))/0x8*(parseInt(_0x573a53(0x132))/0x9);if(_0x3a1381===_0x4d5150)break;else _0xce8624['push'](_0xce8624['shift']());}catch(_0x1109d7){_0xce8624['push'](_0xce8624['shift']());}}}(a19_0x34c2,0x3224f));import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function a19_0x4fa6(_0x4841e2,_0x5ee6db){_0x4841e2=_0x4841e2-0x12c;const _0x34c2b2=a19_0x34c2();let _0x4fa65f=_0x34c2b2[_0x4841e2];return _0x4fa65f;}export const datasetList={'service':a19_0x4d726a(0x137),'command':a19_0x4d726a(0x13c),'description':a19_0x4d726a(0x13f),'risk':a19_0x4d726a(0x139),'flags':[{'name':a19_0x4d726a(0x138),'type':a19_0x4d726a(0x135),'description':a19_0x4d726a(0x147)},{...CODE_FLAG,'required':![],'description':a19_0x4d726a(0x13a)}],async 'execute'(_0x13a0ba){const _0x182c12=a19_0x4d726a,_0x3e0aed=_0x13a0ba[_0x182c12(0x130)]('name'),_0x38df9c=_0x13a0ba[_0x182c12(0x130)](_0x182c12(0x131)),_0x3199b7=await listDatasets(_0x13a0ba[_0x182c12(0x145)],{..._0x3e0aed&&{'name':_0x3e0aed},..._0x38df9c&&{'code':_0x38df9c}});return{'ok':!![],'data':{'total':_0x3199b7[_0x182c12(0x12d)],'datasets':_0x3199b7[_0x182c12(0x13b)](_0x1f82c1=>{const _0x16c8cc=_0x182c12,_0x1b5885=_0x1f82c1['dbtableConfig']??{};return{'id':_0x1f82c1['id'],'code':_0x1f82c1[_0x16c8cc(0x131)],'name':_0x1f82c1[_0x16c8cc(0x138)],'source':_0x1f82c1[_0x16c8cc(0x136)],'description':_0x1f82c1['description'],'table':_0x1b5885[_0x16c8cc(0x144)],'datasetKey':_0x1b5885['datasetKey'],'pk':_0x1b5885[_0x16c8cc(0x146)],'fields':_0x1b5885['allFields']?_0x1b5885[_0x16c8cc(0x12e)][_0x16c8cc(0x12f)](',')[_0x16c8cc(0x13b)](_0x467a7a=>_0x467a7a[_0x16c8cc(0x13d)]()):[]};})}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x252947=a20_0x3c89;(function(_0x1e0989,_0x1f9667){const _0x3fc45c=a20_0x3c89,_0x4a37c2=_0x1e0989();while(!![]){try{const _0xfa0418=-parseInt(_0x3fc45c(0x1e8))/0x1+parseInt(_0x3fc45c(0x1c7))/0x2*(-parseInt(_0x3fc45c(0x1cf))/0x3)+-parseInt(_0x3fc45c(0x1dd))/0x4*(parseInt(_0x3fc45c(0x1e7))/0x5)+-parseInt(_0x3fc45c(0x1e3))/0x6+-parseInt(_0x3fc45c(0x1ee))/0x7+-parseInt(_0x3fc45c(0x1d8))/0x8+parseInt(_0x3fc45c(0x1c9))/0x9*(parseInt(_0x3fc45c(0x1d6))/0xa);if(_0xfa0418===_0x1f9667)break;else _0x4a37c2['push'](_0x4a37c2['shift']());}catch(_0x1e2c66){_0x4a37c2['push'](_0x4a37c2['shift']());}}}(a20_0x35c2,0x5f33d));import a20_0x1ba798 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_0x3c89(_0x4bfe55,_0x47475c){_0x4bfe55=_0x4bfe55-0x1c6;const _0x35c242=a20_0x35c2();let _0x3c891c=_0x35c242[_0x4bfe55];return _0x3c891c;}import{AUTH_MODE}from'../constant/auth-mode.js';function a20_0x35c2(){const _0x50082c=['currentApp','235YbkKZF','157252tOIPQQ','✗\x20Invalid\x20JSON','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','(set,\x20length=','\x20\x20API\x20Endpoints','accessKey','2323951FTfHMf','riskLevel','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','status','(default:\x20','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','env','(missing)','Diagnose\x20CLI\x20configuration\x20and\x20environment','bold','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','Project','✓\x20Valid\x20JSON','version','(not\x20set)','yellow','padEnd','green','\x20(accessKey)','repeat','(not\x20found)','length','empty','\x20\x20─','log','⚠\x20Empty\x20(treated\x20as\x20{})','format','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Config\x20JSON','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','1612OFemQl','ClientAk','24441093HAEhIb','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Session\x20check:\x20\x20\x20','red','gray','check','2517HBgOGf','Global','message','\x20\x20auth\x20(effective):\x20','defaultApp','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','missing','10HcORXp','arch','3686024jeaqcc','platform','\x20\x20runtimeDomain:\x20\x20\x20','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','(removed\x20—\x20cookie\x20auth\x20disabled)','16596xnZWwa','\x20\x20Merged\x20Config','\x20\x20Auth','(none)','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','\x20doctor','3026958GzTaMJ','\x20\x20Config\x20Files','locale'];a20_0x35c2=function(){return _0x50082c;};return a20_0x35c2();}import{isLegacyCompatConfigKey}from'../config/schema.js';async function execute(_0x345ad0){const _0x579858=a20_0x3c89,_0x26ab58=getCliVersion(),_0x4d7e98=buildConfigFromFlags({});await initGlobalEnvironment(_0x4d7e98),console[_0x579858(0x206)](),console[_0x579858(0x206)](a20_0x1ba798[_0x579858(0x1f7)](CLI_BIN_NAME+_0x579858(0x1e2))),console['log'](a20_0x1ba798['gray']('─'[_0x579858(0x201)](0x32))),console['log'](_0x579858(0x1e1)+_0x26ab58),console[_0x579858(0x206)](_0x579858(0x1ca)+process[_0x579858(0x1fb)]),console[_0x579858(0x206)](_0x579858(0x20b)+process[_0x579858(0x1d9)]+'\x20'+process[_0x579858(0x1d7)]),console[_0x579858(0x206)](),console[_0x579858(0x206)](a20_0x1ba798['bold'](_0x579858(0x1e4))),console[_0x579858(0x206)](a20_0x1ba798[_0x579858(0x1cd)](_0x579858(0x205)[_0x579858(0x201)](0x1e)));const _0x3d8673=getGlobalConfigPath(),_0x3e12f5=getProjectConfigPath();console[_0x579858(0x206)](_0x579858(0x1c6)+(_0x3d8673||a20_0x1ba798[_0x579858(0x1cd)](_0x579858(0x202)))),console[_0x579858(0x206)](_0x579858(0x1d4)+(_0x3e12f5||a20_0x1ba798[_0x579858(0x1cd)](_0x579858(0x202)))),console[_0x579858(0x206)](),console['log'](a20_0x1ba798[_0x579858(0x1f7)](_0x579858(0x20c))),console['log'](a20_0x1ba798[_0x579858(0x1cd)](_0x579858(0x205)[_0x579858(0x201)](0x1e)));const _0x2eec49=(_0x553b7e,_0x635d48)=>{const _0x352cfa=_0x579858;if(!_0x635d48){console[_0x352cfa(0x206)]('\x20\x20'+_0x553b7e[_0x352cfa(0x1fe)](0x11)+'\x20'+a20_0x1ba798['gray']('(no\x20file)'));return;}const _0x18561a=inspectCliConfigJsonFile(_0x635d48);if(_0x18561a['status']==='ok')console[_0x352cfa(0x206)]('\x20\x20'+_0x553b7e[_0x352cfa(0x1fe)](0x11)+'\x20'+a20_0x1ba798[_0x352cfa(0x1ff)](_0x352cfa(0x1fa)));else{if(_0x18561a['status']===_0x352cfa(0x204))console[_0x352cfa(0x206)]('\x20\x20'+_0x553b7e[_0x352cfa(0x1fe)](0x11)+'\x20'+a20_0x1ba798[_0x352cfa(0x1fd)](_0x352cfa(0x207)));else _0x18561a[_0x352cfa(0x1f1)]===_0x352cfa(0x1d5)?console[_0x352cfa(0x206)]('\x20\x20'+_0x553b7e[_0x352cfa(0x1fe)](0x11)+'\x20'+a20_0x1ba798[_0x352cfa(0x1cd)](_0x352cfa(0x1f5))):(console[_0x352cfa(0x206)]('\x20\x20'+_0x553b7e[_0x352cfa(0x1fe)](0x11)+'\x20'+a20_0x1ba798[_0x352cfa(0x1cc)](_0x352cfa(0x1e9))),console[_0x352cfa(0x206)]('\x20\x20'+''[_0x352cfa(0x1fe)](0x11)+'\x20'+a20_0x1ba798[_0x352cfa(0x1cc)](_0x18561a[_0x352cfa(0x1d1)])));}};_0x2eec49(_0x579858(0x1d0),_0x3d8673),_0x2eec49(_0x579858(0x1f9),_0x3e12f5),console[_0x579858(0x206)](),console[_0x579858(0x206)](a20_0x1ba798[_0x579858(0x1f7)](_0x579858(0x1de))),console['log'](a20_0x1ba798[_0x579858(0x1cd)]('\x20\x20─'[_0x579858(0x201)](0x1e))),console[_0x579858(0x206)](_0x579858(0x1db)+(_0x4d7e98['appCode']||a20_0x1ba798[_0x579858(0x1cc)](_0x579858(0x1fc)))),console['log'](_0x579858(0x20a)+_0x4d7e98[_0x579858(0x1f4)]);const _0x286b74=isLegacyCompatConfigKey(_0x579858(0x1e5))?a20_0x1ba798[_0x579858(0x1cd)](_0x4d7e98[_0x579858(0x1e5)]+'\x20(legacy/compat\x20only)'):_0x4d7e98[_0x579858(0x1e5)];return console[_0x579858(0x206)]('\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x286b74),console[_0x579858(0x206)]('\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20'+(_0x4d7e98[_0x579858(0x1d3)]||a20_0x1ba798['gray'](_0x579858(0x1e0)))),console['log']('\x20\x20currentApp:\x20\x20\x20\x20\x20\x20'+(_0x4d7e98[_0x579858(0x1e6)]||a20_0x1ba798[_0x579858(0x1cd)](_0x579858(0x1e0)))),console['log'](_0x579858(0x1ea)+(_0x4d7e98[_0x579858(0x208)]||a20_0x1ba798[_0x579858(0x1cd)](_0x579858(0x1f2)+DEFAULT_CONFIG_VALUES[_0x579858(0x208)]+')'))),console['log'](_0x579858(0x1f8)+(_0x4d7e98['pageSize']??a20_0x1ba798[_0x579858(0x1cd)]('(default)'))),console[_0x579858(0x206)](_0x579858(0x20d)+_0x4d7e98[_0x579858(0x1ef)]),console[_0x579858(0x206)](_0x579858(0x1f3)+_0x4d7e98['verbose']),console[_0x579858(0x206)](_0x579858(0x1d2)+AUTH_MODE[_0x579858(0x1c8)]),console[_0x579858(0x206)]('\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20'+(_0x4d7e98[_0x579858(0x1ed)]?a20_0x1ba798[_0x579858(0x1ff)](_0x579858(0x1eb)+_0x4d7e98['accessKey'][_0x579858(0x203)]+')'):a20_0x1ba798[_0x579858(0x1cd)]('(none)'))),console['log'](),console[_0x579858(0x206)](a20_0x1ba798[_0x579858(0x1f7)](_0x579858(0x1ec))),console[_0x579858(0x206)](a20_0x1ba798['gray']('\x20\x20─'['repeat'](0x1e))),console[_0x579858(0x206)](_0x579858(0x209)+getApiDomain()),console[_0x579858(0x206)]('\x20\x20userDomain:\x20\x20\x20\x20\x20\x20'+getUserDomain()),console['log'](_0x579858(0x1da)+getRuntimeDomain()),console[_0x579858(0x206)](),console[_0x579858(0x206)](a20_0x1ba798[_0x579858(0x1f7)](_0x579858(0x1df))),console[_0x579858(0x206)](a20_0x1ba798['gray'](_0x579858(0x205)[_0x579858(0x201)](0x1e))),console[_0x579858(0x206)](_0x579858(0x1f0)+a20_0x1ba798[_0x579858(0x1ff)](AUTH_MODE[_0x579858(0x1c8)]+_0x579858(0x200))),console['log'](_0x579858(0x1cb)+a20_0x1ba798[_0x579858(0x1cd)](_0x579858(0x1dc))),console[_0x579858(0x206)](),{'ok':!![]};}export const doctorDefinition={'service':'doctor','command':a20_0x252947(0x1ce),'description':a20_0x252947(0x1f6),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a21_0x382402=a21_0x2c3c;(function(_0x4f4350,_0x3f163e){const _0x206355=a21_0x2c3c,_0xe7278a=_0x4f4350();while(!![]){try{const _0x68316a=parseInt(_0x206355(0xc0))/0x1*(-parseInt(_0x206355(0xd4))/0x2)+parseInt(_0x206355(0xc5))/0x3*(parseInt(_0x206355(0xbe))/0x4)+parseInt(_0x206355(0xd1))/0x5*(-parseInt(_0x206355(0xc4))/0x6)+-parseInt(_0x206355(0xc9))/0x7*(parseInt(_0x206355(0xba))/0x8)+parseInt(_0x206355(0xaf))/0x9+-parseInt(_0x206355(0xa5))/0xa*(-parseInt(_0x206355(0xb3))/0xb)+parseInt(_0x206355(0x9f))/0xc*(parseInt(_0x206355(0xde))/0xd);if(_0x68316a===_0x3f163e)break;else _0xe7278a['push'](_0xe7278a['shift']());}catch(_0x4da6d6){_0xe7278a['push'](_0xe7278a['shift']());}}}(a21_0x3de9,0xce206));import{existsSync,readFileSync}from'node:fs';function a21_0x2c3c(_0x2425d9,_0xae0754){_0x2425d9=_0x2425d9-0x98;const _0x3de9a2=a21_0x3de9();let _0x2c3c6a=_0x3de9a2[_0x2425d9];return _0x2c3c6a;}import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';function a21_0x3de9(){const _0x3e0393=['App\x20code\x20cannot\x20be\x20empty.','boolean','message','\x20\x20appcode:\x20','file','76921NKLSTi','removeListener','[y/N]','Aborted.','close','Imported\x20from\x20','[Y/n]','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`.','User\x20aborted\x20prompt','Initialized\x20','1716VaCoLf','question','apps','cwd','Source\x20file\x20not\x20found:\x20','join','1914490edEALW','):\x20','project','newConfigFileName','object','utf8','Write\x20to\x20global\x20(~/','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','\x20\x20default:\x20','validation','10459737mTrwxM','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','env','cancelled','77dJkJFr','app','stdin','flagMissing','defaultApp','race','appcode','1549648PqMXHC','parse','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','\x0aInitialized\x20','13372VKjTXS','apiDir','167445JTAKar','\x22.\x20Allowed:\x20','\x20\x20env:\x20\x20\x20\x20\x20','Failed\x20to\x20parse\x20source\x20file:\x20','7650078tauEwU','597zwzFAY','log','once','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','14CkcYCH',')\x20instead\x20of\x20project','\x20already\x20exists.\x20Overwrite?','string','trim','App\x20code','Skip\x20confirmation\x20when\x20overwriting','\x20init\x20—\x20Create\x20','5TLWnZE','global','SIGINT','18Bkctio','\x20\x20config:\x20\x20','entries','includes','yes'];a21_0x3de9=function(){return _0x3e0393;};return a21_0x3de9();}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':'string','description':'App\x20code\x20for\x20the\x20project'},{'name':a21_0x382402(0xb1),'type':a21_0x382402(0xcc),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES[a21_0x382402(0xb1)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x382402(0xd2),'type':a21_0x382402(0xda),'description':a21_0x382402(0xab)+PRODUCT_CONFIG[a21_0x382402(0xa8)]+a21_0x382402(0xca),'default':![]},{'name':a21_0x382402(0xd8),'type':'boolean','description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':'file','type':a21_0x382402(0xcc),'description':a21_0x382402(0xb0),'required':!![]},{'name':a21_0x382402(0xb9),'type':'string','description':'Override\x20imported\x20default\x20appcode'},{'name':a21_0x382402(0xb1),'type':a21_0x382402(0xcc),'description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x382402(0xd2),'type':a21_0x382402(0xda),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG['newConfigFileName']+')\x20instead\x20of\x20project','default':![]},{'name':a21_0x382402(0xd8),'type':a21_0x382402(0xda),'description':a21_0x382402(0xcf),'default':![]}];export async function runInit(_0x3e15d8){const _0x29ec67=a21_0x382402,_0x1433b1=isNonInteractiveMode(_0x3e15d8),_0x328f61=_0x3e15d8['global']?_0x29ec67(0xd2):_0x29ec67(0xa7),_0x273534=resolveWriteConfigPath(_0x328f61);try{_0x1433b1?await runNonInteractive(_0x3e15d8,_0x273534):await runInteractive(_0x3e15d8,_0x273534);}catch(_0x10abe9){if(_0x10abe9 instanceof AbortPrompt)throw CliErrors[_0x29ec67(0xb2)]();throw _0x10abe9;}}export async function runInitImport(_0x1ba24e){const _0x15a2e5=a21_0x382402,_0x94d38e=_0x1ba24e['global']?_0x15a2e5(0xd2):_0x15a2e5(0xa7),_0x33f4c8=resolveWriteConfigPath(_0x94d38e);await runFromImport(_0x1ba24e,_0x33f4c8);}const RUNTIME_IRRELEVANT_KEYS=new Set([a21_0x382402(0xbf)]);async function runFromImport(_0x52b884,_0x36b701){const _0x4a3571=a21_0x382402,_0x4c96e1=resolveFilePath(_0x52b884[_0x4a3571(0xdd)]);if(!existsSync(_0x4c96e1))throw CliErrors[_0x4a3571(0xae)](_0x4a3571(0xa3)+_0x4c96e1);const _0x2398ac=readSourceFile(_0x4c96e1),_0x452acb=convertToRuntimeConfig(_0x2398ac);_0x52b884[_0x4a3571(0xb9)]&&(_0x452acb[_0x4a3571(0xb9)]=String(_0x52b884['appcode']));_0x52b884[_0x4a3571(0xb1)]&&(_0x452acb[_0x4a3571(0xb1)]=resolveInitEnv(_0x52b884));if(!_0x452acb[_0x4a3571(0xb9)])throw CliErrors[_0x4a3571(0xae)](_0x4a3571(0xc8),_0x4a3571(0x9c));await writeInitConfig(_0x36b701,_0x452acb,_0x52b884),console['log'](_0x4a3571(0x9a)+_0x4c96e1),console['log'](_0x4a3571(0xd5)+_0x36b701),console[_0x4a3571(0xc6)](_0x4a3571(0xdc)+_0x452acb['appcode']);if(_0x452acb['defaultApp'])console[_0x4a3571(0xc6)](_0x4a3571(0xad)+_0x452acb[_0x4a3571(0xb7)]);}function convertToRuntimeConfig(_0x4b1453){const _0x246bba=a21_0x382402;if(_0x4b1453['apps']&&typeof _0x4b1453[_0x246bba(0xa1)]===_0x246bba(0xa9))throw CliErrors[_0x246bba(0xae)]('Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.',_0x246bba(0xac));const _0x1b9c39={};for(const _0x499586 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x4b1453[_0x499586]!==undefined&&(_0x1b9c39[_0x499586]=_0x4b1453[_0x499586]);}return!_0x1b9c39['riskLevel']&&(_0x1b9c39['riskLevel']=DEFAULT_CONFIG_VALUES['riskLevel']),_0x1b9c39;}async function runNonInteractive(_0x2ce22d,_0x136287){const _0xa470d=a21_0x382402,_0x212e9d=_0x2ce22d['appcode'];if(!_0x212e9d)throw CliErrors[_0xa470d(0xb6)](_0xa470d(0xb9),'Usage:\x20'+CLI_BIN_NAME+_0xa470d(0xbc));const _0x391d28=resolveInitEnv(_0x2ce22d);await writeInitConfig(_0x136287,{'appcode':_0x212e9d,'env':_0x391d28},_0x2ce22d),console[_0xa470d(0xc6)](_0xa470d(0x9e)+_0x136287),console[_0xa470d(0xc6)](_0xa470d(0xdc)+_0x212e9d),console[_0xa470d(0xc6)](_0xa470d(0xc2)+_0x391d28);}async function runInteractive(_0x399b9a,_0x5bb8b3){const _0x1238c7=a21_0x382402,_0xc55773=loadExisting(_0x5bb8b3),_0x110fcd=typeof _0xc55773?.[_0x1238c7(0xb9)]===_0x1238c7(0xcc)?_0xc55773[_0x1238c7(0xb9)]:'',_0x2b6549=resolveInitEnv(_0x399b9a);console['log'](CLI_BIN_NAME+_0x1238c7(0xd0)+PRODUCT_CONFIG[_0x1238c7(0xa8)]+'\x0a');if(existsSync(_0x5bb8b3)&&!_0x399b9a[_0x1238c7(0xd8)]){const _0x12c6d3=await promptYesNo('File\x20'+_0x5bb8b3+_0x1238c7(0xcb),![]);if(!_0x12c6d3){console[_0x1238c7(0xc6)](_0x1238c7(0x98));return;}}const _0x153eb4=typeof _0x399b9a['appcode']===_0x1238c7(0xcc)?_0x399b9a[_0x1238c7(0xb9)][_0x1238c7(0xcd)]():'';let _0x11eb3a=_0x153eb4;!_0x11eb3a&&(_0x11eb3a=await promptInput(_0x1238c7(0xce),_0x110fcd));if(!_0x11eb3a[_0x1238c7(0xcd)]())throw CliErrors['validation'](_0x1238c7(0xd9));await writeInitConfig(_0x5bb8b3,{'appcode':_0x11eb3a[_0x1238c7(0xcd)](),'env':_0x2b6549},_0x399b9a),console[_0x1238c7(0xc6)](_0x1238c7(0xbd)+_0x5bb8b3),console[_0x1238c7(0xc6)]('\x20\x20appcode:\x20'+_0x11eb3a[_0x1238c7(0xcd)]()),console['log'](_0x1238c7(0xc2)+_0x2b6549);}async function writeInitConfig(_0x42bf73,_0x46b17b,_0x535294){const _0x37c529=a21_0x382402;let _0x3ae68d={};existsSync(_0x42bf73)&&!_0x535294['yes']&&(_0x3ae68d=readConfigFile(_0x42bf73));for(const [_0x499e83,_0x200344]of Object[_0x37c529(0xd6)](_0x46b17b)){_0x200344!==undefined&&(_0x3ae68d[_0x499e83]=_0x200344);}if(_0x3ae68d[_0x37c529(0xb4)])delete _0x3ae68d['app'];writeConfigFile(_0x42bf73,_0x3ae68d);}class AbortPrompt extends Error{constructor(){const _0x54f968=a21_0x382402;super(_0x54f968(0x9d)),this['name']='AbortPrompt';}}function createSafeRl(){const _0x45136f=a21_0x382402,_0x1e3bbc=createInterface({'input':process[_0x45136f(0xb5)],'output':process['stdout']});let _0xffe34a;const _0x355fb9=new Promise((_0x17f52b,_0x247eee)=>{const _0x4be5a6=_0x45136f;_0xffe34a=()=>{const _0xb668a4=a21_0x2c3c;_0xffe34a&&(_0x1e3bbc['removeListener']('SIGINT',_0xffe34a),_0xffe34a=undefined);try{_0x1e3bbc[_0xb668a4(0x99)]();}catch{}_0x247eee(new AbortPrompt());},_0x1e3bbc[_0x4be5a6(0xc7)](_0x4be5a6(0xd3),_0xffe34a);}),_0x122b8d=()=>{const _0x17cd4d=_0x45136f;_0xffe34a&&(_0x1e3bbc[_0x17cd4d(0xdf)]('SIGINT',_0xffe34a),_0xffe34a=undefined);try{_0x1e3bbc[_0x17cd4d(0x99)]();}catch{}};return{'rl':_0x1e3bbc,'abortPromise':_0x355fb9,'disposeSuccess':_0x122b8d};}async function promptInput(_0x468811,_0x4054d6){const _0x41e7e0=a21_0x382402,{rl:_0x4df96c,abortPromise:_0x287ff8,disposeSuccess:_0x26ce1d}=createSafeRl(),_0x39aef2=new Promise(_0x190868=>{const _0x5241c6=a21_0x2c3c,_0x1c6c5c=_0x4054d6?'\x20\x20'+_0x468811+'\x20('+_0x4054d6+_0x5241c6(0xa6):'\x20\x20'+_0x468811+':\x20';_0x4df96c[_0x5241c6(0xa0)](_0x1c6c5c,_0x94d1ba=>{const _0x283e7a=_0x5241c6;_0x26ce1d(),_0x190868(_0x94d1ba[_0x283e7a(0xcd)]()||_0x4054d6);});});return Promise[_0x41e7e0(0xb8)]([_0x39aef2,_0x287ff8]);}async function promptYesNo(_0x4cb34f,_0xd83184){const {rl:_0x1ceaff,abortPromise:_0x49afca,disposeSuccess:_0xdbbed2}=createSafeRl(),_0x569619=new Promise(_0xc2b826=>{const _0x3509da=a21_0x2c3c,_0x4b66aa=_0xd83184?_0x3509da(0x9b):_0x3509da(0xe0);_0x1ceaff[_0x3509da(0xa0)]('\x20\x20'+_0x4cb34f+'\x20'+_0x4b66aa+':\x20',_0x4fe291=>{const _0x26a56f=_0x3509da;_0xdbbed2();const _0x3e6eaf=_0x4fe291[_0x26a56f(0xcd)]()['toLowerCase']();if(_0x3e6eaf==='y'||_0x3e6eaf===_0x26a56f(0xd8))_0xc2b826(!![]);else{if(_0x3e6eaf==='n'||_0x3e6eaf==='no')_0xc2b826(![]);else _0xc2b826(_0xd83184);}});});return Promise['race']([_0x569619,_0x49afca]);}function loadExisting(_0x4c143a){if(!existsSync(_0x4c143a))return null;return readConfigFile(_0x4c143a);}function resolveFilePath(_0x59dd75){const _0x12bd61=a21_0x382402;return isAbsolute(_0x59dd75)?_0x59dd75:resolve(process[_0x12bd61(0xa2)](),_0x59dd75);}function readSourceFile(_0x498cf7){const _0x2cf673=a21_0x382402;try{const _0x357693=readFileSync(_0x498cf7,{'encoding':_0x2cf673(0xaa)});return JSON[_0x2cf673(0xbb)](_0x357693);}catch(_0x9b6b45){throw CliErrors[_0x2cf673(0xae)](_0x2cf673(0xc3)+_0x9b6b45[_0x2cf673(0xdb)]);}}function resolveInitEnv(_0xf1f657){const _0x4692c9=a21_0x382402,_0x5e41b2=_0xf1f657['env'];if(_0x5e41b2===undefined||_0x5e41b2==='')return DEFAULT_CONFIG_VALUES[_0x4692c9(0xb1)];if(!RUNTIME_ENV_VALUES[_0x4692c9(0xd7)](_0x5e41b2))throw CliErrors[_0x4692c9(0xae)]('Invalid\x20env\x20\x22'+_0x5e41b2+_0x4692c9(0xc1)+RUNTIME_ENV_VALUES[_0x4692c9(0xa4)](',\x20'));return _0x5e41b2;}
|
|
1
|
+
const a21_0x21e75d=a21_0x6b03;(function(_0x4bddda,_0x3f064c){const _0x2757fc=a21_0x6b03,_0x22aa27=_0x4bddda();while(!![]){try{const _0xc0f796=parseInt(_0x2757fc(0x163))/0x1*(-parseInt(_0x2757fc(0x192))/0x2)+-parseInt(_0x2757fc(0x164))/0x3+parseInt(_0x2757fc(0x19b))/0x4*(-parseInt(_0x2757fc(0x179))/0x5)+-parseInt(_0x2757fc(0x182))/0x6+parseInt(_0x2757fc(0x171))/0x7+parseInt(_0x2757fc(0x16b))/0x8*(-parseInt(_0x2757fc(0x168))/0x9)+-parseInt(_0x2757fc(0x195))/0xa*(-parseInt(_0x2757fc(0x19d))/0xb);if(_0xc0f796===_0x3f064c)break;else _0x22aa27['push'](_0x22aa27['shift']());}catch(_0x503f96){_0x22aa27['push'](_0x22aa27['shift']());}}}(a21_0x214b,0xebdde));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';function a21_0x214b(){const _0x3c0591=['\x20\x20appcode:\x20','Imported\x20from\x20','7885591wuWJNO','message','utf8','Usage:\x20','):\x20','log','AbortPrompt','yes','74850HNxRTo','app','\x22.\x20Allowed:\x20','apiDir','newConfigFileName','trim','cwd','riskLevel','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','10726968vAiENB','App\x20code','\x20\x20env:\x20\x20\x20\x20\x20','Initialized\x20','Failed\x20to\x20parse\x20source\x20file:\x20','cancelled','validation','toLowerCase','project','boolean','removeListener','entries','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','string','SIGINT','Override\x20imported\x20default\x20env','1556jLbuJN','appcode','question','55936840ppooBt','env','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','File\x20','\x20already\x20exists.\x20Overwrite?','includes','260VAMrig','Target\x20environment\x20(default\x20','11pVadaB','parse','object','stdout','Aborted.','name','join','Invalid\x20env\x20\x22','race','1377dLRcmg','1675968GbUEpP','global','close','Skip\x20confirmation\x20when\x20overwriting','153bvQoRZ','file','\x0aInitialized\x20','641528gAVLxS','[y/N]','Override\x20imported\x20default\x20appcode','apps'];a21_0x214b=function(){return _0x3c0591;};return a21_0x214b();}import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a21_0x21e75d(0x193),'type':a21_0x21e75d(0x18f),'description':'App\x20code\x20for\x20the\x20project'},{'name':'env','type':a21_0x21e75d(0x18f),'description':a21_0x21e75d(0x19c)+DEFAULT_CONFIG_VALUES[a21_0x21e75d(0x196)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':'boolean','description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a21_0x21e75d(0x17d)]+')\x20instead\x20of\x20project','default':![]},{'name':a21_0x21e75d(0x178),'type':a21_0x21e75d(0x18b),'description':a21_0x21e75d(0x167),'default':![]}];export const initImportFlagDefs=[{'name':'file','type':'string','description':a21_0x21e75d(0x197),'required':!![]},{'name':'appcode','type':a21_0x21e75d(0x18f),'description':a21_0x21e75d(0x16d)},{'name':a21_0x21e75d(0x196),'type':a21_0x21e75d(0x18f),'description':a21_0x21e75d(0x191),'enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x21e75d(0x165),'type':a21_0x21e75d(0x18b),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a21_0x21e75d(0x17d)]+')\x20instead\x20of\x20project','default':![]},{'name':a21_0x21e75d(0x178),'type':a21_0x21e75d(0x18b),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];function a21_0x6b03(_0x422740,_0xd7488e){_0x422740=_0x422740-0x15d;const _0x214b40=a21_0x214b();let _0x6b0334=_0x214b40[_0x422740];return _0x6b0334;}export async function runInit(_0x1644ed){const _0x5aa8ce=a21_0x21e75d,_0x2430eb=isNonInteractiveMode(_0x1644ed),_0x132f3e=_0x1644ed['global']?'global':_0x5aa8ce(0x18a),_0x221e0e=resolveWriteConfigPath(_0x132f3e);try{_0x2430eb?await runNonInteractive(_0x1644ed,_0x221e0e):await runInteractive(_0x1644ed,_0x221e0e);}catch(_0x19340b){if(_0x19340b instanceof AbortPrompt)throw CliErrors[_0x5aa8ce(0x187)]();throw _0x19340b;}}export async function runInitImport(_0x1b8de0){const _0x23220b=a21_0x21e75d,_0x2453c5=_0x1b8de0[_0x23220b(0x165)]?_0x23220b(0x165):_0x23220b(0x18a),_0x2b7101=resolveWriteConfigPath(_0x2453c5);await runFromImport(_0x1b8de0,_0x2b7101);}const RUNTIME_IRRELEVANT_KEYS=new Set([a21_0x21e75d(0x17c)]);async function runFromImport(_0x3f44f9,_0x5d9587){const _0x18dce2=a21_0x21e75d,_0x141b23=resolveFilePath(_0x3f44f9[_0x18dce2(0x169)]);if(!existsSync(_0x141b23))throw CliErrors['validation']('Source\x20file\x20not\x20found:\x20'+_0x141b23);const _0x204c04=readSourceFile(_0x141b23),_0x3380f0=convertToRuntimeConfig(_0x204c04);_0x3f44f9[_0x18dce2(0x193)]&&(_0x3380f0['appcode']=String(_0x3f44f9['appcode']));_0x3f44f9[_0x18dce2(0x196)]&&(_0x3380f0[_0x18dce2(0x196)]=resolveInitEnv(_0x3f44f9));if(!_0x3380f0[_0x18dce2(0x193)])throw CliErrors[_0x18dce2(0x188)]('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','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(_0x5d9587,_0x3380f0,_0x3f44f9),console[_0x18dce2(0x176)](_0x18dce2(0x170)+_0x141b23),console[_0x18dce2(0x176)]('\x20\x20config:\x20\x20'+_0x5d9587),console[_0x18dce2(0x176)](_0x18dce2(0x16f)+_0x3380f0[_0x18dce2(0x193)]);if(_0x3380f0['defaultApp'])console[_0x18dce2(0x176)]('\x20\x20default:\x20'+_0x3380f0['defaultApp']);}function convertToRuntimeConfig(_0x33698b){const _0x539b3b=a21_0x21e75d;if(_0x33698b[_0x539b3b(0x16e)]&&typeof _0x33698b['apps']===_0x539b3b(0x19f))throw CliErrors[_0x539b3b(0x188)]('Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.',_0x539b3b(0x18e));const _0x1e7dcc={};for(const _0x1a5eef of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x33698b[_0x1a5eef]!==undefined&&(_0x1e7dcc[_0x1a5eef]=_0x33698b[_0x1a5eef]);}return!_0x1e7dcc[_0x539b3b(0x180)]&&(_0x1e7dcc['riskLevel']=DEFAULT_CONFIG_VALUES[_0x539b3b(0x180)]),_0x1e7dcc;}async function runNonInteractive(_0x4c8c89,_0x40bb4a){const _0x53f03d=a21_0x21e75d,_0x3d1e70=_0x4c8c89['appcode'];if(!_0x3d1e70)throw CliErrors['flagMissing']('appcode',_0x53f03d(0x174)+CLI_BIN_NAME+_0x53f03d(0x181));const _0x580c19=resolveInitEnv(_0x4c8c89);await writeInitConfig(_0x40bb4a,{'appcode':_0x3d1e70,'env':_0x580c19},_0x4c8c89),console[_0x53f03d(0x176)](_0x53f03d(0x185)+_0x40bb4a),console[_0x53f03d(0x176)](_0x53f03d(0x16f)+_0x3d1e70),console[_0x53f03d(0x176)](_0x53f03d(0x184)+_0x580c19);}async function runInteractive(_0x44529f,_0x35bc8a){const _0x476f42=a21_0x21e75d,_0x559988=loadExisting(_0x35bc8a),_0x4b6016=typeof _0x559988?.[_0x476f42(0x193)]==='string'?_0x559988[_0x476f42(0x193)]:'',_0xea1fe2=resolveInitEnv(_0x44529f);console['log'](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG[_0x476f42(0x17d)]+'\x0a');if(existsSync(_0x35bc8a)&&!_0x44529f[_0x476f42(0x178)]){const _0x4dffad=await promptYesNo(_0x476f42(0x198)+_0x35bc8a+_0x476f42(0x199),![]);if(!_0x4dffad){console[_0x476f42(0x176)](_0x476f42(0x15e));return;}}const _0x5570be=typeof _0x44529f[_0x476f42(0x193)]===_0x476f42(0x18f)?_0x44529f[_0x476f42(0x193)][_0x476f42(0x17e)]():'';let _0x5f4e17=_0x5570be;!_0x5f4e17&&(_0x5f4e17=await promptInput(_0x476f42(0x183),_0x4b6016));if(!_0x5f4e17[_0x476f42(0x17e)]())throw CliErrors[_0x476f42(0x188)]('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x35bc8a,{'appcode':_0x5f4e17[_0x476f42(0x17e)](),'env':_0xea1fe2},_0x44529f),console[_0x476f42(0x176)](_0x476f42(0x16a)+_0x35bc8a),console[_0x476f42(0x176)](_0x476f42(0x16f)+_0x5f4e17[_0x476f42(0x17e)]()),console['log']('\x20\x20env:\x20\x20\x20\x20\x20'+_0xea1fe2);}async function writeInitConfig(_0x15cbcf,_0x58f83c,_0x127b61){const _0x10db4d=a21_0x21e75d;let _0x26c350={};existsSync(_0x15cbcf)&&!_0x127b61[_0x10db4d(0x178)]&&(_0x26c350=readConfigFile(_0x15cbcf));for(const [_0x4cdfdb,_0x709c1a]of Object[_0x10db4d(0x18d)](_0x58f83c)){_0x709c1a!==undefined&&(_0x26c350[_0x4cdfdb]=_0x709c1a);}if(_0x26c350[_0x10db4d(0x17a)])delete _0x26c350[_0x10db4d(0x17a)];writeConfigFile(_0x15cbcf,_0x26c350);}class AbortPrompt extends Error{constructor(){const _0x35780b=a21_0x21e75d;super('User\x20aborted\x20prompt'),this[_0x35780b(0x15f)]=_0x35780b(0x177);}}function createSafeRl(){const _0x5c9778=a21_0x21e75d,_0x254d15=createInterface({'input':process['stdin'],'output':process[_0x5c9778(0x15d)]});let _0xaef36;const _0x3cc2e0=new Promise((_0x22afb2,_0x27f370)=>{const _0xbab511=_0x5c9778;_0xaef36=()=>{const _0x29d836=a21_0x6b03;_0xaef36&&(_0x254d15['removeListener'](_0x29d836(0x190),_0xaef36),_0xaef36=undefined);try{_0x254d15[_0x29d836(0x166)]();}catch{}_0x27f370(new AbortPrompt());},_0x254d15['once'](_0xbab511(0x190),_0xaef36);}),_0x24aa49=()=>{const _0x2870fb=_0x5c9778;_0xaef36&&(_0x254d15[_0x2870fb(0x18c)](_0x2870fb(0x190),_0xaef36),_0xaef36=undefined);try{_0x254d15[_0x2870fb(0x166)]();}catch{}};return{'rl':_0x254d15,'abortPromise':_0x3cc2e0,'disposeSuccess':_0x24aa49};}async function promptInput(_0x3728fe,_0x47fad9){const _0x227912=a21_0x21e75d,{rl:_0xd37fc8,abortPromise:_0x45a4f5,disposeSuccess:_0x17fb70}=createSafeRl(),_0x1c9ee3=new Promise(_0xec5b01=>{const _0x58869f=a21_0x6b03,_0x589ac3=_0x47fad9?'\x20\x20'+_0x3728fe+'\x20('+_0x47fad9+_0x58869f(0x175):'\x20\x20'+_0x3728fe+':\x20';_0xd37fc8['question'](_0x589ac3,_0x525f4c=>{const _0x117022=_0x58869f;_0x17fb70(),_0xec5b01(_0x525f4c[_0x117022(0x17e)]()||_0x47fad9);});});return Promise[_0x227912(0x162)]([_0x1c9ee3,_0x45a4f5]);}async function promptYesNo(_0x28ec34,_0xaf191f){const _0x4e33ba=a21_0x21e75d,{rl:_0x138b24,abortPromise:_0x1888b6,disposeSuccess:_0x4ac7fc}=createSafeRl(),_0x33a016=new Promise(_0x54c135=>{const _0x103cd2=a21_0x6b03,_0x14fdf2=_0xaf191f?'[Y/n]':_0x103cd2(0x16c);_0x138b24[_0x103cd2(0x194)]('\x20\x20'+_0x28ec34+'\x20'+_0x14fdf2+':\x20',_0x374ee4=>{const _0x4353b1=_0x103cd2;_0x4ac7fc();const _0x55b9e7=_0x374ee4[_0x4353b1(0x17e)]()[_0x4353b1(0x189)]();if(_0x55b9e7==='y'||_0x55b9e7==='yes')_0x54c135(!![]);else{if(_0x55b9e7==='n'||_0x55b9e7==='no')_0x54c135(![]);else _0x54c135(_0xaf191f);}});});return Promise[_0x4e33ba(0x162)]([_0x33a016,_0x1888b6]);}function loadExisting(_0x3f3363){if(!existsSync(_0x3f3363))return null;return readConfigFile(_0x3f3363);}function resolveFilePath(_0x229914){const _0x721f5e=a21_0x21e75d;return isAbsolute(_0x229914)?_0x229914:resolve(process[_0x721f5e(0x17f)](),_0x229914);}function readSourceFile(_0x2547cb){const _0x552aa4=a21_0x21e75d;try{const _0x67308=readFileSync(_0x2547cb,{'encoding':_0x552aa4(0x173)});return JSON[_0x552aa4(0x19e)](_0x67308);}catch(_0x4fdba9){throw CliErrors[_0x552aa4(0x188)](_0x552aa4(0x186)+_0x4fdba9[_0x552aa4(0x172)]);}}function resolveInitEnv(_0xcdaaee){const _0xa4a54c=a21_0x21e75d,_0x19c034=_0xcdaaee['env'];if(_0x19c034===undefined||_0x19c034==='')return DEFAULT_CONFIG_VALUES[_0xa4a54c(0x196)];if(!RUNTIME_ENV_VALUES[_0xa4a54c(0x19a)](_0x19c034))throw CliErrors[_0xa4a54c(0x188)](_0xa4a54c(0x161)+_0x19c034+_0xa4a54c(0x17b)+RUNTIME_ENV_VALUES[_0xa4a54c(0x160)](',\x20'));return _0x19c034;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a22_0x255610=a22_0x5b59;(function(_0x2e849f,_0x67c776){const _0x3df224=a22_0x5b59,_0x88730=_0x2e849f();while(!![]){try{const _0x52eceb=-parseInt(_0x3df224(0x1c0))/0x1*(-parseInt(_0x3df224(0x1bf))/0x2)+-parseInt(_0x3df224(0x1b0))/0x3*(parseInt(_0x3df224(0x1cb))/0x4)+-parseInt(_0x3df224(0x19e))/0x5*(-parseInt(_0x3df224(0x1a3))/0x6)+-parseInt(_0x3df224(0x1d9))/0x7*(-parseInt(_0x3df224(0x1c8))/0x8)+-parseInt(_0x3df224(0x1d0))/0x9*(parseInt(_0x3df224(0x1c4))/0xa)+-parseInt(_0x3df224(0x1ac))/0xb*(-parseInt(_0x3df224(0x1b5))/0xc)+-parseInt(_0x3df224(0x1ca))/0xd;if(_0x52eceb===_0x67c776)break;else _0x88730['push'](_0x88730['shift']());}catch(_0x5bed09){_0x88730['push'](_0x88730['shift']());}}}(a22_0x4168,0x227d6));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_0x255610(0x1be),'type':a22_0x255610(0x1b4),'required':!![],'description':'Personal\x20knowledge-base\x20entry\x20title'},FILE_FLAG={'name':a22_0x255610(0x1cc),'type':a22_0x255610(0x1b4),'required':!![],'description':a22_0x255610(0x1df)},QUERY_FLAG={'name':'query','type':a22_0x255610(0x1b4),'required':!![],'description':a22_0x255610(0x1c7)},TOPK_FLAG={'name':'topk','type':'number','description':a22_0x255610(0x1da)};function a22_0x5b59(_0x42e125,_0x5c60ef){_0x42e125=_0x42e125-0x19d;const _0x4168f6=a22_0x4168();let _0x5b59ec=_0x4168f6[_0x42e125];return _0x5b59ec;}function readKnowledgeFile(_0x237cb1){const _0x5c8a17=a22_0x255610;if(!_0x237cb1)throw CliErrors['validation'](_0x5c8a17(0x1b6));if(!existsSync(_0x237cb1))throw CliErrors[_0x5c8a17(0x1bd)]('File\x20not\x20found:\x20'+_0x237cb1);if(!statSync(_0x237cb1)['isFile']())throw CliErrors[_0x5c8a17(0x1bd)](_0x5c8a17(0x19f)+_0x237cb1);return readFileSync(_0x237cb1,_0x5c8a17(0x1c2));}function summarizePersonalItem(_0x383e45){const _0xe5098c=a22_0x255610;return{'id':_0x383e45['id'],'title':_0x383e45['title'],'version':_0x383e45[_0xe5098c(0x1ab)],'ragStatus':_0x383e45[_0xe5098c(0x1a9)],'ragErrorMessage':_0x383e45[_0xe5098c(0x1ad)],'updateTime':_0x383e45[_0xe5098c(0x1d4)]};}function detailPersonalItem(_0xd3b69){const _0x1aaa21=a22_0x255610;return{'id':_0xd3b69['id'],'appCode':_0xd3b69[_0x1aaa21(0x1d2)],'scope':_0xd3b69[_0x1aaa21(0x1b7)],'userId':_0xd3b69['userId'],'title':_0xd3b69[_0x1aaa21(0x1be)],'content':_0xd3b69[_0x1aaa21(0x1b8)]??'','version':_0xd3b69[_0x1aaa21(0x1ab)],'ragStatus':_0xd3b69[_0x1aaa21(0x1a9)],'ragErrorMessage':_0xd3b69[_0x1aaa21(0x1ad)],'createTime':_0xd3b69[_0x1aaa21(0x1af)],'updateTime':_0xd3b69[_0x1aaa21(0x1d4)]};}function summarizeSearchHit(_0x3c8b98){const _0x1b39bf=a22_0x255610;return{'scope':_0x3c8b98[_0x1b39bf(0x1b7)],'docId':_0x3c8b98[_0x1b39bf(0x1de)],'score':_0x3c8b98[_0x1b39bf(0x1db)],'weightedScore':_0x3c8b98[_0x1b39bf(0x1ce)],'content':_0x3c8b98[_0x1b39bf(0x1b8)],'metadata':_0x3c8b98[_0x1b39bf(0x1d3)]};}function readTopK(_0x113682){const _0x12b8da=a22_0x255610,_0x214c6c=_0x113682[_0x12b8da(0x1d1)](_0x12b8da(0x1ba));if(_0x214c6c===undefined||_0x214c6c===null||_0x214c6c==='')return undefined;const _0x2b9230=_0x113682[_0x12b8da(0x1b9)]('topk');if(!Number['isFinite'](_0x2b9230)||_0x2b9230<0x1)throw CliErrors[_0x12b8da(0x1bd)](_0x12b8da(0x1d7));return _0x2b9230;}function a22_0x4168(){const _0x4c1bd8=['Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','score','trim','POST','docId','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','/client/knowledge-base/personal/','16655pfztnX','File\x20is\x20not\x20a\x20regular\x20file:\x20','create','build','/client/knowledge-base/personal/create','96bjdRTB','description','length','read','verbose','write','ragStatus','update','version','32681QuysUn','ragErrorMessage','body','createTime','18507rJwloc','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','Personal\x20knowledge-base\x20entry\x20ID','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','string','36Csljgz','File\x20path\x20is\x20required.','scope','content','num','topk','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','str','validation','title','283918RQxPct','1cEhGAF','bool','utf8','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','3980jsulQd','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','96FltWsy','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','588575QBhXVK','116mFtrdk','file','list','weightedScore','Search\x20query\x20is\x20required.','2115mZlgPU','flag','appCode','metadata','updateTime','query','Override\x20the\x20existing\x20entry\x20title','--topk\x20must\x20be\x20a\x20positive\x20number.','map','148638FfghVh'];a22_0x4168=function(){return _0x4c1bd8;};return a22_0x4168();}const kbList={'service':'kb','command':a22_0x255610(0x1cd),'description':a22_0x255610(0x1c9),'risk':a22_0x255610(0x1a6),'flags':[VERBOSE_FLAG],async 'execute'(_0x58c890){const _0x3d4eed=a22_0x255610,_0x46e7d6=await listPersonalKnowledgeBaseItems(_0x58c890[_0x3d4eed(0x1d2)]);if(_0x58c890[_0x3d4eed(0x1c1)](_0x3d4eed(0x1a7)))return{'ok':!![],'data':{'total':_0x46e7d6['length'],'items':_0x46e7d6}};return{'ok':!![],'data':{'total':_0x46e7d6[_0x3d4eed(0x1a5)],'items':_0x46e7d6['map'](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':'detail','description':a22_0x255610(0x1c3),'risk':a22_0x255610(0x1a6),'flags':[{...ID_FLAG,'description':a22_0x255610(0x1b2)}],async 'execute'(_0xae3672){const _0x1cc190=a22_0x255610,_0x4ca00e=await getPersonalKnowledgeBaseItem(_0xae3672[_0x1cc190(0x1b9)]('id'),_0xae3672[_0x1cc190(0x1d2)]);return{'ok':!![],'data':detailPersonalItem(_0x4ca00e)};}},kbCreate={'service':'kb','command':a22_0x255610(0x1a0),'description':a22_0x255610(0x1c6),'risk':a22_0x255610(0x1a8),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x5b1470){const _0x5464db=a22_0x255610,_0x8d3582=_0x5b1470[_0x5464db(0x1bc)](_0x5464db(0x1be)),_0x1d42cd=readKnowledgeFile(_0x5b1470[_0x5464db(0x1bc)](_0x5464db(0x1cc))),_0x3ac83e=await createPersonalKnowledgeBaseItem(_0x5b1470[_0x5464db(0x1d2)],{'title':_0x8d3582,'content':_0x1d42cd});return{'ok':!![],'data':summarizePersonalItem(_0x3ac83e),'message':'Created\x20KB\x20entry\x20'+_0x3ac83e['id']+'\x20('+_0x3ac83e['title']+')'};},async 'dryRun'(_0x43d968){const _0x23c4b7=a22_0x255610,_0x493a9e=_0x43d968['str'](_0x23c4b7(0x1be)),_0x48e6b4=readKnowledgeFile(_0x43d968['str']('file'));return dryRun(_0x23c4b7(0x1dd),_0x23c4b7(0x1a2))['body']({'appCode':_0x43d968[_0x23c4b7(0x1d2)],'title':_0x493a9e,'content':_0x48e6b4})['description'](_0x23c4b7(0x1c5)+_0x493a9e+'\x22')['build']();}},kbUpdate={'service':'kb','command':a22_0x255610(0x1aa),'description':a22_0x255610(0x1bb),'risk':a22_0x255610(0x1a8),'flags':[{...ID_FLAG,'description':a22_0x255610(0x1b2)},{...TITLE_FLAG,'required':![],'description':a22_0x255610(0x1d6)},FILE_FLAG],async 'execute'(_0x98ced){const _0x2b6677=a22_0x255610,_0x2ff4f0=_0x98ced[_0x2b6677(0x1b9)]('id'),_0x1c1a9e=readKnowledgeFile(_0x98ced[_0x2b6677(0x1bc)]('file')),_0x4a4e0f=_0x98ced[_0x2b6677(0x1bc)](_0x2b6677(0x1be))||(await getPersonalKnowledgeBaseItem(_0x2ff4f0,_0x98ced[_0x2b6677(0x1d2)]))[_0x2b6677(0x1be)],_0x4e8ee0=await updatePersonalKnowledgeBaseItem(_0x2ff4f0,_0x98ced[_0x2b6677(0x1d2)],{'title':_0x4a4e0f,'content':_0x1c1a9e});return{'ok':!![],'data':summarizePersonalItem(_0x4e8ee0),'message':'Updated\x20KB\x20entry\x20'+_0x4e8ee0['id']+'\x20('+_0x4e8ee0[_0x2b6677(0x1be)]+')'};},async 'dryRun'(_0x33b07a){const _0x223fe3=a22_0x255610,_0x24a129=_0x33b07a[_0x223fe3(0x1b9)]('id'),_0xee041=readKnowledgeFile(_0x33b07a[_0x223fe3(0x1bc)](_0x223fe3(0x1cc))),_0x5321ee=_0x33b07a[_0x223fe3(0x1bc)](_0x223fe3(0x1be))||(await getPersonalKnowledgeBaseItem(_0x24a129,_0x33b07a[_0x223fe3(0x1d2)]))['title'];return dryRun('POST',_0x223fe3(0x19d)+_0x24a129+'/update')[_0x223fe3(0x1ae)]({'appCode':_0x33b07a['appCode'],'title':_0x5321ee,'content':_0xee041})[_0x223fe3(0x1a4)](_0x223fe3(0x1b1)+_0x24a129)[_0x223fe3(0x1a1)]();}},kbSearch={'service':'kb','command':'search','description':a22_0x255610(0x1b3),'risk':a22_0x255610(0x1a6),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x250c17){const _0x560045=a22_0x255610;if(!_0x250c17[_0x560045(0x1bc)](_0x560045(0x1d5))[_0x560045(0x1dc)]())throw CliErrors[_0x560045(0x1bd)](_0x560045(0x1cf));readTopK(_0x250c17);},async 'execute'(_0x4d97ed){const _0x6d6a75=a22_0x255610,_0x53a67d=_0x4d97ed[_0x6d6a75(0x1bc)](_0x6d6a75(0x1d5))['trim'](),_0x44f3dd=readTopK(_0x4d97ed),_0x447df5=await searchKnowledgeBase(_0x4d97ed[_0x6d6a75(0x1d2)],{'query':_0x53a67d,'topK':_0x44f3dd});return{'ok':!![],'data':{'total':_0x447df5[_0x6d6a75(0x1a5)],'hits':_0x447df5[_0x6d6a75(0x1d8)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x57e054=a23_0x59af;(function(_0x520eb7,_0x5c8fff){const _0x46983f=a23_0x59af,_0x266201=_0x520eb7();while(!![]){try{const _0xee121d=-parseInt(_0x46983f(0x130))/0x1*(parseInt(_0x46983f(0x124))/0x2)+parseInt(_0x46983f(0x11a))/0x3*(parseInt(_0x46983f(0x117))/0x4)+parseInt(_0x46983f(0x12e))/0x5*(parseInt(_0x46983f(0x12a))/0x6)+parseInt(_0x46983f(0x134))/0x7*(parseInt(_0x46983f(0x122))/0x8)+-parseInt(_0x46983f(0x12b))/0x9+parseInt(_0x46983f(0x113))/0xa+-parseInt(_0x46983f(0x114))/0xb;if(_0xee121d===_0x5c8fff)break;else _0x266201['push'](_0x266201['shift']());}catch(_0x570040){_0x266201['push'](_0x266201['shift']());}}}(a23_0x3ba5,0xf2edc));function a23_0x59af(_0x5cffe5,_0x2ca2f7){_0x5cffe5=_0x5cffe5-0x112;const _0x3ba560=a23_0x3ba5();let _0x59afa8=_0x3ba560[_0x5cffe5];return _0x59afa8;}function a23_0x3ba5(){const _0x4e7aed=['command','success','813231EtinGR','warn','details','level','timestamp','clearLogs','keys','View\x20command\x20history\x20logs','12622360wurJNM','Clear\x20command\x20history\x20logs','178174xnIOSy','\x20logs:\x0a','logs','readLogs','\x20\x20\x20Time:\x20','length','6787074tZrFVM','7252407trfvdh','write','error','5XrOctY','duration','11iyixSV','*\x20Logs\x20cleared','toLocaleString','en-US','7EedqMn','log','stringify','\x20\x20\x20Details:\x20','clear','show','message','6632250sYEfxh','15450754jggCus','\x20\x20\x20Duration:\x20','read','12pBUCcP'];a23_0x3ba5=function(){return _0x4e7aed;};return a23_0x3ba5();}import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x2b3262){const _0x49d026=a23_0x59af;if(_0x2b3262[_0x49d026(0x129)]===0x0){console[_0x49d026(0x135)]('*\x20No\x20logs\x20found');return;}console[_0x49d026(0x135)]('*\x20'+CLI_DISPLAY_NAME+_0x49d026(0x125)),_0x2b3262['forEach']((_0x138e64,_0x589095)=>{const _0x172b8c=_0x49d026,_0x206176=new Date(_0x138e64[_0x172b8c(0x11e)])[_0x172b8c(0x132)](_0x172b8c(0x133)),_0x2a322b=_0x138e64[_0x172b8c(0x11d)]===_0x172b8c(0x119)?'√':_0x138e64[_0x172b8c(0x11d)]===_0x172b8c(0x12d)?'×':_0x138e64['level']===_0x172b8c(0x11b)?'!':'i';console[_0x172b8c(0x135)](_0x589095+0x1+'.\x20'+_0x2a322b+'\x20['+_0x138e64[_0x172b8c(0x118)]+']\x20'+_0x138e64[_0x172b8c(0x112)]),console['log'](_0x172b8c(0x128)+_0x206176),_0x138e64['duration']&&console[_0x172b8c(0x135)](_0x172b8c(0x115)+_0x138e64[_0x172b8c(0x12f)]+'ms'),_0x138e64[_0x172b8c(0x11c)]&&Object[_0x172b8c(0x120)](_0x138e64[_0x172b8c(0x11c)])['length']>0x0&&console[_0x172b8c(0x135)](_0x172b8c(0x137)+JSON[_0x172b8c(0x136)](_0x138e64[_0x172b8c(0x11c)],null,0x2)),console[_0x172b8c(0x135)]('');});}export const logsDefinitions=[{'service':a23_0x57e054(0x126),'command':a23_0x57e054(0x139),'description':a23_0x57e054(0x121),'risk':a23_0x57e054(0x116),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x5713db){const _0x4a4429=a23_0x57e054;return printLogs(logger[_0x4a4429(0x127)]()),{'ok':!![]};}},{'service':a23_0x57e054(0x126),'command':a23_0x57e054(0x138),'description':a23_0x57e054(0x123),'risk':a23_0x57e054(0x12c),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x51c9d1){const _0x32417d=a23_0x57e054;return logger[_0x32417d(0x11f)](),console['log'](_0x32417d(0x131)),{'ok':!![]};}}];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0xa92de8=a24_0x3742;(function(_0x270afc,_0x41e93d){const _0x2c41bb=a24_0x3742,_0xded53c=_0x270afc();while(!![]){try{const _0x1c54c6=parseInt(_0x2c41bb(0xf8))/0x1*(parseInt(_0x2c41bb(0xf4))/0x2)+-parseInt(_0x2c41bb(0xec))/0x3*(-parseInt(_0x2c41bb(0xe5))/0x4)+-parseInt(_0x2c41bb(0xe0))/0x5+-parseInt(_0x2c41bb(0xd6))/0x6*(parseInt(_0x2c41bb(0xe3))/0x7)+-parseInt(_0x2c41bb(0xe2))/0x8*(parseInt(_0x2c41bb(0xde))/0x9)+-parseInt(_0x2c41bb(0xef))/0xa*(-parseInt(_0x2c41bb(0xf9))/0xb)+-parseInt(_0x2c41bb(0xe8))/0xc;if(_0x1c54c6===_0x41e93d)break;else _0xded53c['push'](_0xded53c['shift']());}catch(_0xa54975){_0xded53c['push'](_0xded53c['shift']());}}}(a24_0xb673,0x7a3c9));import{authDefinitions}from'../commands/auth/index.js';function a24_0x3742(_0x153e00,_0x267425){_0x153e00=_0x153e00-0xd0;const _0xb67388=a24_0xb673();let _0x374211=_0xb67388[_0x153e00];return _0x374211;}import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';export const serviceRegistry=[];function a24_0xb673(){const _0x3c5eca=['App\x20Management','map','isSingleCommand','45DogxsV','push','1947930OoqapO','run','522520ktxBOr','6006217GWHumq','Schema','8NGIOpj','Knowledge\x20Base','risk','7758468ftJXPX','read','install','set','1435368shgmeQ','write','show','9932110imBIVf','defaultCommand','list','\x20\x20[high-risk-write]','has','2Aaicui','get','Instant\x20API','command','771289iMDGFf','11WOIIXX','values','BFF\x20Scripts','Skills','login','from','Logs','description','6IuuZOX','\x20\x20[write]','service','Self\x20Update','Diagnostics'];a24_0xb673=function(){return _0x3c5eca;};return a24_0xb673();}const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x5d042a){const _0x2882f3=a24_0x3742;for(const _0x32b958 of _0x5d042a){definitions[_0x2882f3(0xeb)](_0x32b958[_0x2882f3(0xd8)]+':'+_0x32b958[_0x2882f3(0xf7)],_0x32b958);let _0x5a50e3=serviceGroups[_0x2882f3(0xf5)](_0x32b958['service']);!_0x5a50e3&&(_0x5a50e3=[],serviceGroups[_0x2882f3(0xeb)](_0x32b958[_0x2882f3(0xd8)],_0x5a50e3)),_0x5a50e3[_0x2882f3(0xdf)](_0x32b958);}}function registerService(_0x4dd48c,_0x25c4b4,_0x26386f){const _0x15d0ad=a24_0x3742;registerDefinitions(_0x25c4b4);const _0x249ecb=_0x3e9903=>_0x3e9903===_0x15d0ad(0xe9)?'':_0x3e9903===_0x15d0ad(0xed)?_0x15d0ad(0xd7):_0x15d0ad(0xf2),_0x27b77={'service':_0x25c4b4[0x0][_0x15d0ad(0xd8)],'label':_0x4dd48c,'commands':_0x25c4b4[_0x15d0ad(0xdc)](_0x9dbc30=>({'command':_0x9dbc30[_0x15d0ad(0xf7)],'description':_0x9dbc30[_0x15d0ad(0xd5)],'tag':_0x249ecb(_0x9dbc30[_0x15d0ad(0xe7)])})),'defaultCommand':_0x26386f?.[_0x15d0ad(0xf0)]??(_0x26386f?.[_0x15d0ad(0xdd)]?_0x25c4b4[0x0][_0x15d0ad(0xf7)]:undefined),'isSingleCommand':_0x26386f?.[_0x15d0ad(0xdd)]};serviceRegistry[_0x15d0ad(0xdf)](_0x27b77),serviceByName[_0x15d0ad(0xeb)](_0x27b77['service'],_0x27b77);}registerService('Authentication',authDefinitions,{'defaultCommand':a24_0xa92de8(0xd2)}),registerService('Datasets',datasetDefinitions),registerService(a24_0xa92de8(0xf6),dataDefinitions),registerService('SQL\x20Queries',sqlDefinitions),registerService(a24_0xa92de8(0xd0),bffDefinitions),registerService(a24_0xa92de8(0xe6),kbDefinitions),registerService(a24_0xa92de8(0xdb),appDefinitions,{'defaultCommand':a24_0xa92de8(0xf1)}),registerService('Configuration',configDefinitions,{'defaultCommand':a24_0xa92de8(0xf1)}),registerService(a24_0xa92de8(0xd1),skillDefinitions,{'defaultCommand':a24_0xa92de8(0xea)}),registerService(a24_0xa92de8(0xd9),[updateDefinition],{'defaultCommand':a24_0xa92de8(0xe1),'isSingleCommand':!![]}),registerService(a24_0xa92de8(0xda),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a24_0xa92de8(0xe4),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a24_0xa92de8(0xd4),logsDefinitions,{'defaultCommand':a24_0xa92de8(0xee)});export function findDefinition(_0x2d6c2d,_0x175f4f){return definitions['get'](_0x2d6c2d+':'+_0x175f4f);}export function isKnownService(_0x2d2212){const _0x50f8df=a24_0xa92de8;return serviceByName[_0x50f8df(0xf3)](_0x2d2212);}export function getServiceEntry(_0x15468d){const _0x235250=a24_0xa92de8;return serviceByName[_0x235250(0xf5)](_0x15468d);}export function getAllDefinitions(){const _0x45975e=a24_0xa92de8;return Array[_0x45975e(0xd3)](definitions[_0x45975e(0xfa)]());}
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x43f890=a25_0x91be;(function(_0x24c818,_0x35d27c){const _0x4de341=a25_0x91be,_0x258b7e=_0x24c818();while(!![]){try{const _0xa10710=parseInt(_0x4de341(0x9b))/0x1*(parseInt(_0x4de341(0x94))/0x2)+-parseInt(_0x4de341(0x9d))/0x3*(parseInt(_0x4de341(0x95))/0x4)+-parseInt(_0x4de341(0x9f))/0x5+parseInt(_0x4de341(0x9c))/0x6*(-parseInt(_0x4de341(0x98))/0x7)+parseInt(_0x4de341(0x99))/0x8*(parseInt(_0x4de341(0x9e))/0x9)+-parseInt(_0x4de341(0x96))/0xa*(-parseInt(_0x4de341(0xa2))/0xb)+parseInt(_0x4de341(0x97))/0xc;if(_0xa10710===_0x35d27c)break;else _0x258b7e['push'](_0x258b7e['shift']());}catch(_0x56eccf){_0x258b7e['push'](_0x258b7e['shift']());}}}(a25_0x47c2,0x45d4a));import{buildSchemaPayload}from'../framework/schema-export.js';function a25_0x91be(_0x27cf21,_0x4f625f){_0x27cf21=_0x27cf21-0x94;const _0x47c289=a25_0x47c2();let _0x91bee3=_0x47c289[_0x27cf21];return _0x91bee3;}async function execute(_0x1b395f){const _0x543c8d=await buildSchemaPayload();return{'ok':!![],'data':_0x543c8d};}export const schemaDefinition={'service':'schema','command':a25_0x43f890(0xa1),'description':a25_0x43f890(0xa0),'risk':a25_0x43f890(0x9a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};function a25_0x47c2(){const _0x20a4d2=['Export\x20machine-readable\x20command\x20schema\x20(JSON)','export','894685viuIhE','937798QDNlSv','59900LUPKLv','10eUlFNg','4342800QZqkht','42BEPTQM','8rQMYRj','read','1glcgWd','130836DStOID','12GvTgAl','147681oHUEez','2258905JPZBUr'];a25_0x47c2=function(){return _0x20a4d2;};return a25_0x47c2();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x414964=a26_0x57b8;(function(_0x241a49,_0x1d0d96){const _0x431d57=a26_0x57b8,_0x504912=_0x241a49();while(!![]){try{const _0x1bbec9=-parseInt(_0x431d57(0x1e3))/0x1*(parseInt(_0x431d57(0x204))/0x2)+parseInt(_0x431d57(0x20d))/0x3+-parseInt(_0x431d57(0x215))/0x4+parseInt(_0x431d57(0x211))/0x5*(parseInt(_0x431d57(0x1e2))/0x6)+-parseInt(_0x431d57(0x213))/0x7+parseInt(_0x431d57(0x208))/0x8+parseInt(_0x431d57(0x1e4))/0x9;if(_0x1bbec9===_0x1d0d96)break;else _0x504912['push'](_0x504912['shift']());}catch(_0x549e7b){_0x504912['push'](_0x504912['shift']());}}}(a26_0x23e7,0x60bd7));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_0x414964(0x1d9),'type':a26_0x414964(0x1ee),'description':a26_0x414964(0x205)},DIR_FLAG={'name':a26_0x414964(0x20c),'type':'string','required':!![],'description':a26_0x414964(0x212)};function summarizeRuntimeSkill(_0xbba186){const _0x2e1c0f=a26_0x414964;return{'id':_0xbba186['id'],'skillCode':_0xbba186[_0x2e1c0f(0x1ec)],'skillName':_0xbba186['skillName'],'scope':_0xbba186[_0x2e1c0f(0x1fd)],'version':_0xbba186[_0x2e1c0f(0x1ff)],'readonly':_0xbba186[_0x2e1c0f(0x1fc)]};}function a26_0x57b8(_0x150edd,_0x32bb50){_0x150edd=_0x150edd-0x1d9;const _0x23e7a5=a26_0x23e7();let _0x57b89f=_0x23e7a5[_0x150edd];return _0x57b89f;}function a26_0x23e7(){const _0x4ac875=['dir','1192179Coinpe','Installing\x20official\x20skill\x20via\x20npx\x20(npx\x20skills\x20add\x20','length','unchanged','410Mifpyb','Local\x20Skill\x20directory\x20containing\x20SKILL.md','9772cELxqz','error','1087756vfMMiD','code','\x20personal\x20and\x20','npx\x20skills\x20add\x20failed:\x20','filter','find','install','personal','updated','input','4188BrZqXP','750298vxfoPP','5642649xxCcsq','Pulled\x20','nonInteractive','write','pipe','log','Install\x20the\x20published\x20','str','skillCode','\x20skill\x20via\x20npx.','string','reduce','skill','../../skills/runtime-skill-sync.js','Push\x20a\x20local\x20Skill\x20directory\x20to\x20personal\x20runtime\x20Skill\x20scope','trim','=1);\x20assuming\x20skill\x20is\x20already\x20present.','envName','map','cwd','../../skills/npx-skills-add.js','Pull\x20personal\x20and\x20company\x20runtime\x20Skills\x20into\x20local\x20agent\x20skill\x20directories','setLogPath','unknown','readonly','scope','Skipped\x20npx\x20(','version','apiError','authRequired','../../core/api-client.js','pull','2LaCyGj','Only\x20pull\x20a\x20specific\x20runtime\x20Skill\x20code','Installing\x20published\x20','appCode','2706320rfVYUx','company','action','accessKey'];a26_0x23e7=function(){return _0x4ac875;};return a26_0x23e7();}function filterByCode(_0x46d928,_0x16c93c){const _0x1912e7=a26_0x414964,_0x2804e0=_0x16c93c[_0x1912e7(0x1f3)]();if(!_0x2804e0)return _0x46d928;return _0x46d928[_0x1912e7(0x1dc)](_0x5719e4=>_0x5719e4['skillCode']===_0x2804e0);}export const skillDefinitions=[{'service':a26_0x414964(0x1f0),'command':a26_0x414964(0x1de),'description':a26_0x414964(0x1ea)+CLI_BIN_NAME+'\x20developer\x20skill','risk':a26_0x414964(0x1e7),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1bc7e9){const _0x74680c=a26_0x414964;logger[_0x74680c(0x1fa)](process[_0x74680c(0x1f7)]()),logger['info']('skill-install',_0x74680c(0x206)+CLI_DISPLAY_NAME+_0x74680c(0x1ed));const {LOVRABET_SKILL_SOURCE:_0x31a54f,LOVRABET_SKIP_NPX_SKILLS_ENV:_0x552573,runNpxSkillsAddGlobal:_0x38e19b}=await import(_0x74680c(0x1f8)),_0x3817d7=_0x1bc7e9[_0x74680c(0x1e6)]?_0x74680c(0x1e8):'inherit';console[_0x74680c(0x1e9)](_0x74680c(0x20e)+_0x31a54f+'\x20-g\x20-y)...');const _0x5cd1e7=_0x38e19b(process[_0x74680c(0x1f7)](),_0x31a54f,{'stdio':_0x3817d7});if(_0x5cd1e7['skipped'])console[_0x74680c(0x1e9)](_0x74680c(0x1fe)+_0x552573+_0x74680c(0x1f4));else{if(_0x5cd1e7['ok'])console[_0x74680c(0x1e9)](CLI_BIN_NAME+'\x20skill\x20installed');else throw CliErrors[_0x74680c(0x200)](_0x74680c(0x1db)+(_0x5cd1e7[_0x74680c(0x214)]||_0x74680c(0x1fb)),'Check\x20network\x20connectivity\x20and\x20try\x20again.');}return{'ok':!![]};}},{'service':a26_0x414964(0x1f0),'command':a26_0x414964(0x203),'description':a26_0x414964(0x1f9),'risk':a26_0x414964(0x1e7),'flags':[CODE_FLAG],async 'execute'(_0x5287de){const _0x418a35=a26_0x414964,{listCompanyRuntimeSkills:_0x12bb36,listPersonalRuntimeSkills:_0x8661a8}=await import(_0x418a35(0x202)),{linkEffectiveRuntimeSkills:_0x13aac3,materializeRuntimeSkill:_0x3baa85}=await import(_0x418a35(0x1f1)),_0xf3513c=_0x5287de['str'](_0x418a35(0x1d9)),_0x20b2c0=_0x5287de[_0x418a35(0x1f5)]??'production',_0x1c35df=_0x5287de[_0x418a35(0x20b)];if(!_0x1c35df)throw CliErrors[_0x418a35(0x201)]();const _0x46e8b9=filterByCode(await _0x8661a8(_0x5287de[_0x418a35(0x207)]),_0xf3513c),_0x2ac63c=filterByCode(await _0x12bb36(_0x5287de[_0x418a35(0x207)]),_0xf3513c),_0x2f5273=[..._0x46e8b9[_0x418a35(0x1f6)](_0x53a212=>_0x3baa85(_0x53a212,_0x418a35(0x1df),{'env':_0x20b2c0,'accessKey':_0x1c35df,'appCode':_0x5287de[_0x418a35(0x207)]})),..._0x2ac63c[_0x418a35(0x1f6)](_0x5e18a5=>_0x3baa85(_0x5e18a5,_0x418a35(0x209),{'env':_0x20b2c0,'accessKey':_0x1c35df,'appCode':_0x5287de[_0x418a35(0x207)]}))],_0x40db04=_0x13aac3(_0x2f5273,_0x5287de[_0x418a35(0x207)]),_0x14b88d=_0x40db04[_0x418a35(0x1ef)]((_0x13c895,_0x37386d)=>{const _0x5f1a70=_0x418a35;return _0x13c895[_0x37386d[_0x5f1a70(0x20a)]]=(_0x13c895[_0x37386d[_0x5f1a70(0x20a)]]??0x0)+0x1,_0x13c895;},{});return{'ok':!![],'data':{'appCode':_0x5287de[_0x418a35(0x207)],'personal':_0x46e8b9[_0x418a35(0x20f)],'company':_0x2ac63c[_0x418a35(0x20f)],'materialized':_0x2f5273[_0x418a35(0x20f)],'links':{'total':_0x40db04['length'],'created':_0x14b88d['created']??0x0,'updated':_0x14b88d[_0x418a35(0x1e0)]??0x0,'unchanged':_0x14b88d[_0x418a35(0x210)]??0x0,'skipped':0x0,'conflicted':0x0},'skills':{'personal':_0x46e8b9['map'](summarizeRuntimeSkill),'company':_0x2ac63c[_0x418a35(0x1f6)](summarizeRuntimeSkill)}},'message':_0x418a35(0x1e5)+_0x46e8b9[_0x418a35(0x20f)]+_0x418a35(0x1da)+_0x2ac63c['length']+'\x20company\x20Skill(s).'};}},{'service':a26_0x414964(0x1f0),'command':'push','description':a26_0x414964(0x1f2),'risk':a26_0x414964(0x1e7),'flags':[DIR_FLAG],async 'execute'(_0xdcea00){const _0x1904b2=a26_0x414964,{createPersonalRuntimeSkill:_0x330748,listPersonalRuntimeSkills:_0x3f89d5,updatePersonalRuntimeSkill:_0x14bd7e}=await import('../../core/api-client.js'),{readPushDirectory:_0x1067e7}=await import(_0x1904b2(0x1f1));if(!_0xdcea00['accessKey'])throw CliErrors['authRequired']();const _0xe72c2f=_0x1067e7(_0xdcea00[_0x1904b2(0x1eb)](_0x1904b2(0x20c)),_0xdcea00['appCode']),_0x4b9492=(await _0x3f89d5(_0xdcea00[_0x1904b2(0x207)]))[_0x1904b2(0x1dd)](_0x227193=>_0x227193[_0x1904b2(0x1ec)]===_0xe72c2f[_0x1904b2(0x1ec)]),_0x53d7fe=_0x4b9492?await _0x14bd7e(_0xe72c2f[_0x1904b2(0x1ec)],_0xdcea00[_0x1904b2(0x207)],_0xe72c2f[_0x1904b2(0x1e1)]):await _0x330748(_0xdcea00['appCode'],_0xe72c2f[_0x1904b2(0x1e1)]);return{'ok':!![],'data':summarizeRuntimeSkill(_0x53d7fe),'message':_0x4b9492?'Updated\x20personal\x20Skill\x20'+_0xe72c2f[_0x1904b2(0x1ec)]:'Created\x20personal\x20Skill\x20'+_0xe72c2f[_0x1904b2(0x1ec)]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a27_0x441c(){const _0x296448=['526176xfkcWm','detail','95qKkbjq','781968ySDQap','3192040VXWroU','read','9Mcevxx','sqlcode','bool','sqlCode','44328OGqghx','551202DQKill','234890lsFrlt','description','verbose','sqlContent','7269850EMQgzV','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','dbId','sqlName','str','sql','3OMnlFb'];a27_0x441c=function(){return _0x296448;};return a27_0x441c();}const a27_0x265aac=a27_0x56b1;(function(_0x29713d,_0x5189a6){const _0x585ba5=a27_0x56b1,_0x10315b=_0x29713d();while(!![]){try{const _0x4844bf=parseInt(_0x585ba5(0xbc))/0x1+parseInt(_0x585ba5(0xbb))/0x2*(parseInt(_0x585ba5(0xc6))/0x3)+-parseInt(_0x585ba5(0xca))/0x4+parseInt(_0x585ba5(0xc9))/0x5*(parseInt(_0x585ba5(0xba))/0x6)+parseInt(_0x585ba5(0xc7))/0x7+parseInt(_0x585ba5(0xcb))/0x8+parseInt(_0x585ba5(0xcd))/0x9*(-parseInt(_0x585ba5(0xc0))/0xa);if(_0x4844bf===_0x5189a6)break;else _0x10315b['push'](_0x10315b['shift']());}catch(_0x17a709){_0x10315b['push'](_0x10315b['shift']());}}}(a27_0x441c,0x3173f));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';function a27_0x56b1(_0x145b98,_0xb1f739){_0x145b98=_0x145b98-0xb9;const _0x441cfc=a27_0x441c();let _0x56b131=_0x441cfc[_0x145b98];return _0x56b131;}export const sqlDetail={'service':a27_0x265aac(0xc5),'command':a27_0x265aac(0xc8),'description':a27_0x265aac(0xc1),'risk':a27_0x265aac(0xcc),'flags':[SQLCODE_FLAG,VERBOSE_FLAG],async 'execute'(_0x8c5a69){const _0x46a4ef=a27_0x265aac,_0x43bca2=await getSqlQueryInfo(_0x8c5a69['appCode'],_0x8c5a69[_0x46a4ef(0xc4)](_0x46a4ef(0xce))),_0x29eeaa=_0x8c5a69[_0x46a4ef(0xcf)](_0x46a4ef(0xbe));if(_0x29eeaa)return{'ok':!![],'data':_0x43bca2};const _0x13aecb=_0x43bca2['dbId']?await getDbName(_0x8c5a69['appCode'],_0x43bca2[_0x46a4ef(0xc2)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x43bca2[_0x46a4ef(0xb9)],'sqlName':_0x43bca2[_0x46a4ef(0xc3)],'db':_0x13aecb?_0x13aecb+'\x20('+_0x43bca2[_0x46a4ef(0xc2)]+')':_0x43bca2[_0x46a4ef(0xc2)]??'','description':_0x43bca2[_0x46a4ef(0xbd)]??'','sqlContent':_0x43bca2[_0x46a4ef(0xbf)]??''}};}};
|