@lovrabet/lovrabet-cli 2.0.12 → 2.0.13-beta.1
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
|
+
const a16_0x5a7ae5=a16_0x2fe6;function a16_0x2fe6(_0x1f698c,_0x57ae17){_0x1f698c=_0x1f698c-0x11b;const _0x2e9843=a16_0x2e98();let _0x2fe6f1=_0x2e9843[_0x1f698c];return _0x2fe6f1;}(function(_0x2b55ac,_0x5b5248){const _0x3475f7=a16_0x2fe6,_0x322aee=_0x2b55ac();while(!![]){try{const _0x1acfdd=parseInt(_0x3475f7(0x13f))/0x1+-parseInt(_0x3475f7(0x12b))/0x2*(-parseInt(_0x3475f7(0x15f))/0x3)+parseInt(_0x3475f7(0x12e))/0x4*(-parseInt(_0x3475f7(0x146))/0x5)+-parseInt(_0x3475f7(0x150))/0x6+-parseInt(_0x3475f7(0x15a))/0x7+-parseInt(_0x3475f7(0x123))/0x8+parseInt(_0x3475f7(0x127))/0x9;if(_0x1acfdd===_0x5b5248)break;else _0x322aee['push'](_0x322aee['shift']());}catch(_0x4b106c){_0x322aee['push'](_0x322aee['shift']());}}}(a16_0x2e98,0x416d4));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_0x5a7ae5(0x154),'operation':a16_0x5a7ae5(0x154),'risk':a16_0x5a7ae5(0x140),'paramsRequired':![],'description':'Filter\x20dataset\x20records\x20with\x20query\x20conditions','paramsHint':a16_0x5a7ae5(0x124)+'Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','helpExtra':[a16_0x5a7ae5(0x11d),a16_0x5a7ae5(0x130),a16_0x5a7ae5(0x13d),a16_0x5a7ae5(0x15b),a16_0x5a7ae5(0x156),a16_0x5a7ae5(0x121),'\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$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}',a16_0x5a7ae5(0x126),a16_0x5a7ae5(0x163),a16_0x5a7ae5(0x11b),'','\x20\x20LOGICAL\x20COMBINATORS',a16_0x5a7ae5(0x12d),a16_0x5a7ae5(0x142),'',a16_0x5a7ae5(0x125),a16_0x5a7ae5(0x133),a16_0x5a7ae5(0x144),'\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)','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','',a16_0x5a7ae5(0x164),a16_0x5a7ae5(0x165),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27',a16_0x5a7ae5(0x161)][a16_0x5a7ae5(0x153)]('\x0a')},{'command':a16_0x5a7ae5(0x155),'operation':a16_0x5a7ae5(0x155),'risk':a16_0x5a7ae5(0x140),'paramsRequired':!![],'description':a16_0x5a7ae5(0x14e),'paramsHint':a16_0x5a7ae5(0x128)},{'command':a16_0x5a7ae5(0x14d),'operation':a16_0x5a7ae5(0x14d),'risk':a16_0x5a7ae5(0x13b),'paramsRequired':!![],'description':'Create\x20a\x20new\x20record\x20in\x20a\x20dataset','paramsHint':a16_0x5a7ae5(0x132)},{'command':'batchCreate','operation':'batchCreate','risk':a16_0x5a7ae5(0x13b),'paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','paramsHint':'JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27'},{'command':a16_0x5a7ae5(0x15d),'operation':a16_0x5a7ae5(0x15d),'risk':a16_0x5a7ae5(0x13b),'paramsRequired':!![],'description':a16_0x5a7ae5(0x151),'paramsHint':a16_0x5a7ae5(0x138)},{'command':a16_0x5a7ae5(0x122),'operation':a16_0x5a7ae5(0x122),'risk':a16_0x5a7ae5(0x137),'paramsRequired':!![],'description':'Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','paramsHint':a16_0x5a7ae5(0x128)},{'command':a16_0x5a7ae5(0x157),'operation':a16_0x5a7ae5(0x157),'risk':a16_0x5a7ae5(0x140),'paramsRequired':![],'description':'Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','paramsHint':a16_0x5a7ae5(0x14b)+'Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','helpExtra':[a16_0x5a7ae5(0x152),a16_0x5a7ae5(0x13e),'\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','\x20\x20\x20\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}',a16_0x5a7ae5(0x149),a16_0x5a7ae5(0x14c),'\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','\x20\x20\x20\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}','',a16_0x5a7ae5(0x162),'\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)',a16_0x5a7ae5(0x12c),a16_0x5a7ae5(0x160),'\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}]','',a16_0x5a7ae5(0x136),a16_0x5a7ae5(0x143),a16_0x5a7ae5(0x148),'',a16_0x5a7ae5(0x158),a16_0x5a7ae5(0x11e)]['join']('\x0a')}];function makeDataCommand(_0x4425eb){const _0x53e4ec=a16_0x5a7ae5,_0x11a12b=_0x53e4ec(0x134)+_0x4425eb[_0x53e4ec(0x11c)],_0x14dda2={'service':_0x53e4ec(0x147),'command':_0x4425eb[_0x53e4ec(0x11c)],'description':_0x4425eb[_0x53e4ec(0x13c)],'risk':_0x4425eb[_0x53e4ec(0x135)],'helpExtra':_0x4425eb[_0x53e4ec(0x12f)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x4425eb[_0x53e4ec(0x13a)]}],'validate':async _0x385c8b=>{const _0xcd9530=_0x53e4ec;_0x4425eb['paramsRequired']&&requireAnyOf(_0x385c8b,[_0xcd9530(0x131)],_0x11a12b),_0x4425eb[_0xcd9530(0x14a)]===_0xcd9530(0x145)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x385c8b['str'](_0xcd9530(0x131))));},async 'execute'(_0x5bfc01){const _0x16858e=_0x53e4ec,_0x25d876=_0x5bfc01['str'](_0x16858e(0x129)),_0x113bf1=_0x4425eb[_0x16858e(0x14a)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x5bfc01['str'](_0x16858e(0x131)))):parseJsonParams(_0x5bfc01[_0x16858e(0x11f)](_0x16858e(0x131)))??{},_0xbd9267=Date[_0x16858e(0x15c)](),_0x2f80db=await executeData(_0x25d876,_0x4425eb[_0x16858e(0x14a)],_0x113bf1),_0x471ba2=Date[_0x16858e(0x15c)]()-_0xbd9267;return{'ok':!![],'data':{'result':_0x2f80db,'elapsed':_0x471ba2},'message':_0x16858e(0x134)+_0x4425eb[_0x16858e(0x11c)]+_0x16858e(0x12a)+_0x471ba2+'ms'};}};return _0x4425eb[_0x53e4ec(0x135)]!==_0x53e4ec(0x140)&&(_0x14dda2[_0x53e4ec(0x14f)]=async _0x17a868=>{const _0x2c23dd=_0x53e4ec,_0x46abee=_0x17a868[_0x2c23dd(0x11f)](_0x2c23dd(0x129)),_0x334d87=_0x4425eb[_0x2c23dd(0x14a)]===_0x2c23dd(0x145)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x17a868[_0x2c23dd(0x11f)](_0x2c23dd(0x131)))):parseJsonParams(_0x17a868['str']('params'))??{};return dryRun('POST',_0x2c23dd(0x139)+_0x46abee+'/'+_0x4425eb[_0x2c23dd(0x14a)])['body'](_0x334d87)[_0x2c23dd(0x13c)](_0x2c23dd(0x141)+_0x4425eb['command']+_0x2c23dd(0x120)+_0x46abee)[_0x2c23dd(0x15e)]();}),_0x14dda2;}function a16_0x2e98(){const _0xdb5522=['\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','Get\x20a\x20single\x20record\x20by\x20ID','dryRun','2061096pHBbmH','Update\x20an\x20existing\x20record','\x20\x20AGGREGATE\x20TYPES','join','filter','getOne','\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}}','aggregate','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','map','2998702VJFMpG','\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}}','now','update','build','5646AUhCso','\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\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','\x20\x20PARAMS\x20STRUCTURE','\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','\x20\x20PAGINATION','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','\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}}','command','\x20\x20WHERE\x20OPERATORS','\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','str','\x20on\x20dataset\x20','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','delete','3768256NexbZl','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','\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}}','14302134TCvSFk','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','code','\x20completed\x20in\x20','94NwGZvg','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','\x20\x20\x20\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}}]}','4ScLcHt','helpExtra','\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}}','params','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','data\x20','risk','\x20\x20EXAMPLES','high-risk-write','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','/api/{appCode}/','paramsHint','write','description','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20field\x20values\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','197531RQEzXN','read','Preview:\x20data\x20','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','\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]','batchCreate','1820945fjSeyN','data','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\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}','operation','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20'];a16_0x2e98=function(){return _0xdb5522;};return a16_0x2e98();}export const dataDefinitions=specs[a16_0x5a7ae5(0x159)](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a17_0x303cfc=a17_0x2062;(function(_0x27a5c9,_0x1aa678){const _0x1243d5=a17_0x2062,_0x3f6b30=_0x27a5c9();while(!![]){try{const _0x160e68=-parseInt(_0x1243d5(0x1ec))/0x1+-parseInt(_0x1243d5(0x1be))/0x2*(parseInt(_0x1243d5(0x1d4))/0x3)+parseInt(_0x1243d5(0x1cb))/0x4+parseInt(_0x1243d5(0x1d2))/0x5*(-parseInt(_0x1243d5(0x209))/0x6)+-parseInt(_0x1243d5(0x1c6))/0x7+parseInt(_0x1243d5(0x1e2))/0x8+parseInt(_0x1243d5(0x1f4))/0x9*(parseInt(_0x1243d5(0x1db))/0xa);if(_0x160e68===_0x1aa678)break;else _0x3f6b30['push'](_0x3f6b30['shift']());}catch(_0x1a9f55){_0x3f6b30['push'](_0x3f6b30['shift']());}}}(a17_0x2178,0xe861d));import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x620d02){const _0x2ab7e0=a17_0x2062;if(_0x620d02[_0x2ab7e0(0x1f8)])return null;const _0x484a26=Boolean(_0x620d02[_0x2ab7e0(0x1c4)]!==undefined||_0x620d02[_0x2ab7e0(0x1d7)]!==undefined);let _0x4b9b96={};if(!_0x484a26&&typeof _0x620d02[_0x2ab7e0(0x1d8)]===_0x2ab7e0(0x204))try{_0x4b9b96=JSON[_0x2ab7e0(0x1ca)](_0x620d02[_0x2ab7e0(0x1d8)]);}catch{}const _0x28b44=_0x484a26?_0x620d02[_0x2ab7e0(0x200)]:_0x620d02['code'],_0x582a48=_0x484a26?_0x620d02[_0x2ab7e0(0x1c4)]:_0x620d02[_0x2ab7e0(0x200)],_0x4bfa42=_0x484a26?_0x620d02[_0x2ab7e0(0x1d7)]:_0x620d02[_0x2ab7e0(0x1d5)]||_0x620d02[_0x2ab7e0(0x1d1)],_0x5b18fe=_0x484a26?_0x620d02[_0x2ab7e0(0x202)]===!![]:_0x4b9b96[_0x2ab7e0(0x202)]===!![],_0x2dc042=_0x484a26?_0x620d02[_0x2ab7e0(0x1f1)]===!![]:_0x4b9b96[_0x2ab7e0(0x1f1)]===!![],_0x58064f=_0x484a26?_0x620d02['options']??null:_0x4b9b96[_0x2ab7e0(0x1eb)]??null,_0x745824={'name':_0x28b44,'displayName':_0x582a48||_0x28b44,'type':_0x4bfa42,'dbType':_0x620d02[_0x2ab7e0(0x1f3)],'pk':_0x5b18fe,'required':_0x2dc042,'description':_0x620d02[_0x2ab7e0(0x1fd)]||undefined};return Array[_0x2ab7e0(0x1bf)](_0x58064f)&&_0x58064f[_0x2ab7e0(0x1f6)]>0x0&&(_0x745824[_0x2ab7e0(0x1eb)]=_0x58064f),_0x745824;}function parseJsonMaybe(_0x248fbb){if(typeof _0x248fbb!=='string')return _0x248fbb;try{return JSON['parse'](_0x248fbb);}catch{return _0x248fbb;}}function normalizeOperationEntry(_0x527267,_0x146391){const _0x5d5f55=a17_0x2062;if(!_0x146391||typeof _0x146391!==_0x5d5f55(0x201))return null;if(!_0x146391[_0x5d5f55(0x1c9)]||!_0x146391[_0x5d5f55(0x1c2)])return null;const _0x53f2fe={'name':_0x527267,'method':_0x146391[_0x5d5f55(0x1c9)],'path':_0x146391['path']};if(_0x146391['host'])_0x53f2fe[_0x5d5f55(0x1df)]=_0x146391[_0x5d5f55(0x1df)];if(_0x146391['requestBody']!=null)_0x53f2fe['requestBody']=parseJsonMaybe(_0x146391[_0x5d5f55(0x1fc)]);if(_0x146391['responseBody']!=null)_0x53f2fe['responseBody']=parseJsonMaybe(_0x146391[_0x5d5f55(0x1c8)]);if(_0x146391[_0x5d5f55(0x1c7)]!=null)_0x53f2fe['beforeScriptId']=_0x146391[_0x5d5f55(0x1c7)];if(_0x146391[_0x5d5f55(0x1e6)]!=null)_0x53f2fe[_0x5d5f55(0x1e6)]=_0x146391[_0x5d5f55(0x1e6)];if(Array[_0x5d5f55(0x1bf)](_0x146391[_0x5d5f55(0x20b)]))_0x53f2fe[_0x5d5f55(0x20b)]=_0x146391['requestFields'];if(Array['isArray'](_0x146391[_0x5d5f55(0x1c3)]))_0x53f2fe['responseFields']=_0x146391['responseFields'];return _0x53f2fe;}function summarizeDbtable(_0x2cd3b1){const _0x10c9c3=a17_0x2062,_0x4baad4={},_0x264510=[_0x10c9c3(0x205),_0x10c9c3(0x1e3),_0x10c9c3(0x1c0),_0x10c9c3(0x1f0),'pkField','allFields',_0x10c9c3(0x1e9),_0x10c9c3(0x1dd),'updateTimeField',_0x10c9c3(0x203),_0x10c9c3(0x1c5),_0x10c9c3(0x1ce),'modifierNameField',_0x10c9c3(0x1bd),_0x10c9c3(0x1e4)];for(const _0x569a36 of _0x264510){if(_0x2cd3b1[_0x569a36]!==undefined)_0x4baad4[_0x569a36]=_0x2cd3b1[_0x569a36];}return typeof _0x4baad4[_0x10c9c3(0x1e7)]===_0x10c9c3(0x204)&&_0x4baad4[_0x10c9c3(0x1e7)][_0x10c9c3(0x1f6)]>0x0&&(_0x4baad4['allFieldNames']=_0x4baad4[_0x10c9c3(0x1e7)]['split'](',')['map'](_0x14f9fd=>_0x14f9fd['trim']())['filter'](Boolean)),_0x4baad4;}function normalizeRelatedPages(_0x4f009d){const _0x3ba781=a17_0x2062;if(!Array[_0x3ba781(0x1bf)](_0x4f009d))return[];return _0x4f009d[_0x3ba781(0x1d0)](_0x12ab5b=>_0x12ab5b&&typeof _0x12ab5b===_0x3ba781(0x201))[_0x3ba781(0x208)](_0x3f0e9b=>({'id':_0x3f0e9b['id'],'type':_0x3f0e9b[_0x3ba781(0x1d5)],'code':_0x3f0e9b['code'],'title':_0x3f0e9b[_0x3ba781(0x1ed)],'deleted':_0x3f0e9b[_0x3ba781(0x1f8)]===!![]}));}function normalizeFallbackFieldName(_0x2d2e69,_0x5edec5){const _0x1afb87=_0x2d2e69['trim']();if(!_0x1afb87)return null;return{'name':_0x1afb87,'displayName':_0x1afb87,'type':undefined,'dbType':undefined,'pk':_0x1afb87===_0x5edec5,'required':![],'description':undefined};}function a17_0x2062(_0x3baadd,_0x17d9f2){_0x3baadd=_0x3baadd-0x1bc;const _0x217835=a17_0x2178();let _0x206257=_0x217835[_0x3baadd];return _0x206257;}async function loadListFieldFallback(_0x274cfe,_0x9f532c){const _0x469e5b=a17_0x2062;if(!_0x274cfe||!_0x9f532c)return[];try{const _0xc79c3f=await listDatasets(_0x274cfe,{'code':_0x9f532c}),_0x237a04=_0xc79c3f[_0x469e5b(0x1d6)](_0x17aebe=>_0x17aebe[_0x469e5b(0x1fa)]===_0x9f532c)??_0xc79c3f[0x0],_0x58bf3e=_0x237a04?.[_0x469e5b(0x1bc)]??{},_0x3cc604=typeof _0x58bf3e[_0x469e5b(0x1e7)]===_0x469e5b(0x204)?_0x58bf3e['allFields'][_0x469e5b(0x1f9)](','):[];return _0x3cc604[_0x469e5b(0x208)](_0x1efee3=>normalizeFallbackFieldName(_0x1efee3,_0x58bf3e[_0x469e5b(0x202)]))[_0x469e5b(0x1d0)](_0x819e0a=>_0x819e0a!==null);}catch{return[];}}export const datasetDetail={'service':'dataset','command':a17_0x303cfc(0x1f7),'description':a17_0x303cfc(0x206),'risk':'read','flags':[CODE_FLAG],async 'execute'(_0x14e003){const _0x5529b5=a17_0x303cfc,_0x394d26=await getDatasetDetail(_0x14e003[_0x5529b5(0x1e1)](_0x5529b5(0x1fa))),_0x4a65a4=Array[_0x5529b5(0x1bf)](_0x394d26[_0x5529b5(0x1cc)])?_0x394d26[_0x5529b5(0x1cc)]:Array[_0x5529b5(0x1bf)](_0x394d26[_0x5529b5(0x1c1)])?_0x394d26[_0x5529b5(0x1c1)]:[];let _0x12fb70=_0x4a65a4[_0x5529b5(0x208)](_0x1a717a=>normalizeField(_0x1a717a))['filter'](_0x2ea7da=>_0x2ea7da!==null);_0x12fb70[_0x5529b5(0x1f6)]===0x0&&(_0x12fb70=await loadListFieldFallback(_0x14e003[_0x5529b5(0x1cf)],_0x14e003[_0x5529b5(0x1e1)](_0x5529b5(0x1fa))));const _0x1abf44=_0x394d26[_0x5529b5(0x1f2)]??{},_0x629b3=[];for(const [_0x564986,_0x2c746f]of Object[_0x5529b5(0x1ff)](_0x1abf44)){const _0x35b267=normalizeOperationEntry(_0x564986,_0x2c746f);if(_0x35b267)_0x629b3['push'](_0x35b267);}const _0x65a69a=_0x394d26[_0x5529b5(0x1bc)]??{},_0x610956=_0x394d26[_0x5529b5(0x1e5)]??{},_0x1cdbfa=_0x65a69a['dbId']!=null?{'id':_0x65a69a[_0x5529b5(0x205)],'name':_0x65a69a['dbName']??null}:undefined;let _0x101ed2;return typeof _0x394d26[_0x5529b5(0x1d8)]===_0x5529b5(0x204)&&(_0x101ed2=parseJsonMaybe(_0x394d26[_0x5529b5(0x1d8)])),{'ok':!![],'data':{'id':_0x394d26[_0x5529b5(0x1ea)]??_0x394d26['id'],'name':_0x394d26[_0x5529b5(0x200)],'code':_0x394d26['modelCode']||_0x394d26[_0x5529b5(0x1fa)],'doVersion':_0x394d26[_0x5529b5(0x1fb)],'description':_0x394d26['description']||_0x610956[_0x5529b5(0x1f5)]||undefined,'source':_0x394d26[_0x5529b5(0x1dc)]||_0x610956[_0x5529b5(0x1ef)],'table':_0x65a69a[_0x5529b5(0x1c0)]||_0x610956[_0x5529b5(0x1c0)],'datasetKey':_0x65a69a[_0x5529b5(0x1f0)],'pk':_0x65a69a[_0x5529b5(0x202)],'db':_0x1cdbfa,'dbtable':summarizeDbtable(_0x65a69a),'fields':_0x12fb70,'operations':_0x629b3,'indexes':Array['isArray'](_0x610956[_0x5529b5(0x207)])?_0x610956[_0x5529b5(0x207)]:[],'relations':Array[_0x5529b5(0x1bf)](_0x394d26[_0x5529b5(0x1de)])?_0x394d26[_0x5529b5(0x1de)][_0x5529b5(0x208)](_0x2dc7f8=>({'fromField':_0x2dc7f8[_0x5529b5(0x1fe)],'toDataset':_0x2dc7f8[_0x5529b5(0x1cd)],'toCode':_0x2dc7f8['toDatasetCode'],'toTable':_0x2dc7f8[_0x5529b5(0x1da)],'toField':_0x2dc7f8[_0x5529b5(0x1d3)],'labelField':_0x2dc7f8[_0x5529b5(0x20a)]||undefined})):[],'relatedPages':normalizeRelatedPages(_0x394d26[_0x5529b5(0x1e8)]),...Array[_0x5529b5(0x1bf)](_0x394d26[_0x5529b5(0x1d9)])?{'columnCodeListWithDeleted':_0x394d26[_0x5529b5(0x1d9)]}:{},'formatRules':Array[_0x5529b5(0x1bf)](_0x394d26[_0x5529b5(0x1ee)])?_0x394d26[_0x5529b5(0x1ee)]:[],'validateRules':Array[_0x5529b5(0x1bf)](_0x394d26[_0x5529b5(0x1e0)])?_0x394d26['validateRules']:[],..._0x101ed2!==undefined?{'extend':_0x101ed2}:{},'stats':{'fieldCount':_0x12fb70[_0x5529b5(0x1f6)],'operationCount':_0x629b3['length']}}};}};function a17_0x2178(){const _0xec10c9=['relatedPageInfoList','logicField','modelId','options','825020zFEzjm','title','formatRules','sourceType','datasetKey','required','operations','dbType','27vZJEON','tableComment','length','detail','deleted','split','code','doVersion','requestBody','description','fromField','entries','name','object','pkField','creatorIdField','string','dbId','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','indexes','map','33102mMhaPj','toFieldLabel','requestFields','dbtableConfig','labelField','2866HVoorZ','isArray','tableName','properties','path','responseFields','displayName','creatorNameField','1656795xdGKYD','beforeScriptId','responseBody','method','parse','7481520IgFktg','fields','toDatasetName','modifierIdField','appCode','filter','dataType','890hwAyVu','toField','2505IVrWoz','type','find','doType','extend','columnCodeListWithDeleted','toTableName','6999980rKTKcL','source','createTimeField','relations','host','validateRules','str','1773992NAQOim','dbName','dblinkInfoDTO','dataset','afterScriptId','allFields'];a17_0x2178=function(){return _0xec10c9;};return a17_0x2178();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a18_0x211f(){const _0x25d2bf=['3911215jtLTvt','1684086tqhltX','9180OrWONy','4jRzUFX','5533CsOGaa','2058605JUspSw','45729XJsQIC','232idbJSE','168794cyfzNf','6sPIIMt','236632pZswKf'];a18_0x211f=function(){return _0x25d2bf;};return a18_0x211f();}(function(_0xd1ff22,_0x102ee9){const _0xa2e80f=a18_0xa843,_0x12ffd2=_0xd1ff22();while(!![]){try{const _0x9efabd=parseInt(_0xa2e80f(0x1cb))/0x1+parseInt(_0xa2e80f(0x1c9))/0x2*(parseInt(_0xa2e80f(0x1ca))/0x3)+-parseInt(_0xa2e80f(0x1cf))/0x4*(-parseInt(_0xa2e80f(0x1c6))/0x5)+-parseInt(_0xa2e80f(0x1cd))/0x6+-parseInt(_0xa2e80f(0x1cc))/0x7+-parseInt(_0xa2e80f(0x1c8))/0x8*(parseInt(_0xa2e80f(0x1c7))/0x9)+parseInt(_0xa2e80f(0x1ce))/0xa*(parseInt(_0xa2e80f(0x1c5))/0xb);if(_0x9efabd===_0x102ee9)break;else _0x12ffd2['push'](_0x12ffd2['shift']());}catch(_0x3a8ed4){_0x12ffd2['push'](_0x12ffd2['shift']());}}}(a18_0x211f,0x4751e));import{datasetList}from'../../commands/dataset/list.js';import{datasetDetail}from'../../commands/dataset/detail.js';function a18_0xa843(_0x47dfbe,_0x172d6c){_0x47dfbe=_0x47dfbe-0x1c5;const _0x211f05=a18_0x211f();let _0xa843c3=_0x211f05[_0x47dfbe];return _0xa843c3;}export const datasetDefinitions=[datasetList,datasetDetail];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0xdffc67=a19_0x5c1a;(function(_0x5ed43a,_0x35a526){const _0x42dd23=a19_0x5c1a,_0x5da4ce=_0x5ed43a();while(!![]){try{const _0x459d9d=-parseInt(_0x42dd23(0x8f))/0x1*(parseInt(_0x42dd23(0x93))/0x2)+-parseInt(_0x42dd23(0x83))/0x3+-parseInt(_0x42dd23(0x97))/0x4*(parseInt(_0x42dd23(0x7f))/0x5)+parseInt(_0x42dd23(0x7e))/0x6+-parseInt(_0x42dd23(0x8c))/0x7+-parseInt(_0x42dd23(0x96))/0x8+parseInt(_0x42dd23(0x85))/0x9*(parseInt(_0x42dd23(0x8a))/0xa);if(_0x459d9d===_0x35a526)break;else _0x5da4ce['push'](_0x5da4ce['shift']());}catch(_0x17f08d){_0x5da4ce['push'](_0x5da4ce['shift']());}}}(a19_0x55f2,0xd896e));function a19_0x55f2(){const _0x14fe32=['allFields','source','code','3234948UlfpEU','length','777330qDDMdZ','str','trim','map','list','580PxGuiq','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','10173394vFbUps','string','name','937xtiSyT','appCode','description','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','3506AJqXEN','datasetKey','dbtableConfig','8149968smlLlq','45340SmTKWQ','pkField','6491940CQwoTP','5OJHdMC'];a19_0x55f2=function(){return _0x14fe32;};return a19_0x55f2();}import{listDatasets}from'../../core/api-client.js';function a19_0x5c1a(_0x298d7e,_0x5654c8){_0x298d7e=_0x298d7e-0x7d;const _0x55f276=a19_0x55f2();let _0x5c1ae6=_0x55f276[_0x298d7e];return _0x5c1ae6;}import{CODE_FLAG}from'../../commands/common/flags.js';export const datasetList={'service':'dataset','command':a19_0xdffc67(0x89),'description':a19_0xdffc67(0x92),'risk':'read','flags':[{'name':'name','type':a19_0xdffc67(0x8d),'description':'Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)'},{...CODE_FLAG,'required':![],'description':a19_0xdffc67(0x8b)}],async 'execute'(_0x37bcfa){const _0x570091=a19_0xdffc67,_0x46eb6e=_0x37bcfa[_0x570091(0x86)](_0x570091(0x8e)),_0x4cff81=_0x37bcfa[_0x570091(0x86)](_0x570091(0x82)),_0x1bf526=await listDatasets(_0x37bcfa[_0x570091(0x90)],{..._0x46eb6e&&{'name':_0x46eb6e},..._0x4cff81&&{'code':_0x4cff81}});return{'ok':!![],'data':{'total':_0x1bf526[_0x570091(0x84)],'datasets':_0x1bf526[_0x570091(0x88)](_0x57e406=>{const _0x1b51e6=_0x570091,_0x2b4dda=_0x57e406[_0x1b51e6(0x95)]??{};return{'id':_0x57e406['id'],'code':_0x57e406[_0x1b51e6(0x82)],'name':_0x57e406['name'],'source':_0x57e406[_0x1b51e6(0x81)],'description':_0x57e406[_0x1b51e6(0x91)],'table':_0x2b4dda['tableName'],'datasetKey':_0x2b4dda[_0x1b51e6(0x94)],'pk':_0x2b4dda[_0x1b51e6(0x7d)],'fields':_0x2b4dda[_0x1b51e6(0x80)]?_0x2b4dda[_0x1b51e6(0x80)]['split'](',')[_0x1b51e6(0x88)](_0x5e88ed=>_0x5e88ed[_0x1b51e6(0x87)]()):[]};})}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x3e18ce=a20_0x44f1;(function(_0x528f52,_0xd4e07a){const _0x27d911=a20_0x44f1,_0x45ba7a=_0x528f52();while(!![]){try{const _0x2e4215=-parseInt(_0x27d911(0xd4))/0x1+parseInt(_0x27d911(0xb9))/0x2*(-parseInt(_0x27d911(0xc0))/0x3)+parseInt(_0x27d911(0xef))/0x4+parseInt(_0x27d911(0xf7))/0x5+parseInt(_0x27d911(0xdb))/0x6*(parseInt(_0x27d911(0xd8))/0x7)+parseInt(_0x27d911(0xc7))/0x8+parseInt(_0x27d911(0xcc))/0x9*(-parseInt(_0x27d911(0xf1))/0xa);if(_0x2e4215===_0xd4e07a)break;else _0x45ba7a['push'](_0x45ba7a['shift']());}catch(_0x163fb2){_0x45ba7a['push'](_0x45ba7a['shift']());}}}(a20_0x5385,0x9d62f));import a20_0xd8dd5a 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_0x5385(){const _0x1aa1df=['yellow','\x20\x20runtimeDomain:\x20\x20\x20','4239AxqmSI','read','locale','verbose','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','Project','env','format','42990SmqLCe','\x20\x20─','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','(set,\x20length=','1631jVpEtl','empty','\x20doctor','21342HcFIKi','(not\x20found)','(not\x20set)','repeat','✓\x20Valid\x20JSON','log','message','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','\x20\x20Auth','⚠\x20Empty\x20(treated\x20as\x20{})','Diagnose\x20CLI\x20configuration\x20and\x20environment','\x20(accessKey)','accessKey','✗\x20Invalid\x20JSON','\x20\x20Session\x20check:\x20\x20\x20','\x20\x20Config\x20Files','red','gray','ClientAk','(removed\x20—\x20cookie\x20auth\x20disabled)','4946272hZyPRF','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','52790tvogza','version','platform','\x20\x20Merged\x20Config','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','status','4825865LRhCEn','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','length','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','appCode','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','250854bJlfVr','riskLevel','(none)','pageSize','(missing)','arch','(no\x20file)','3EybueM','padEnd','bold','doctor','green','(default)','check','2151672hTciuE','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20'];a20_0x5385=function(){return _0x1aa1df;};return a20_0x5385();}function a20_0x44f1(_0x10a6a2,_0x1f20da){_0x10a6a2=_0x10a6a2-0xb4;const _0x538500=a20_0x5385();let _0x44f150=_0x538500[_0x10a6a2];return _0x44f150;}import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';async function execute(_0x8c42c8){const _0x24f85a=a20_0x44f1,_0x30b532=getCliVersion(),_0x3a2bf1=buildConfigFromFlags({});await initGlobalEnvironment(_0x3a2bf1),console[_0x24f85a(0xe0)](),console[_0x24f85a(0xe0)](a20_0xd8dd5a['bold'](CLI_BIN_NAME+_0x24f85a(0xda))),console[_0x24f85a(0xe0)](a20_0xd8dd5a[_0x24f85a(0xec)]('─'[_0x24f85a(0xde)](0x32))),console[_0x24f85a(0xe0)](_0x24f85a(0xe2)+_0x30b532),console[_0x24f85a(0xe0)]('\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+process[_0x24f85a(0xf2)]),console[_0x24f85a(0xe0)](_0x24f85a(0xb8)+process[_0x24f85a(0xf3)]+'\x20'+process[_0x24f85a(0xbe)]),console[_0x24f85a(0xe0)](),console[_0x24f85a(0xe0)](a20_0xd8dd5a[_0x24f85a(0xc2)](_0x24f85a(0xea))),console[_0x24f85a(0xe0)](a20_0xd8dd5a[_0x24f85a(0xec)]('\x20\x20─'[_0x24f85a(0xde)](0x1e)));const _0x1e689b=getGlobalConfigPath(),_0x482bd6=getProjectConfigPath();console[_0x24f85a(0xe0)]('\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x1e689b||a20_0xd8dd5a['gray'](_0x24f85a(0xdc)))),console['log']('\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x482bd6||a20_0xd8dd5a[_0x24f85a(0xec)](_0x24f85a(0xdc)))),console[_0x24f85a(0xe0)](),console[_0x24f85a(0xe0)](a20_0xd8dd5a['bold']('\x20\x20Config\x20JSON')),console[_0x24f85a(0xe0)](a20_0xd8dd5a['gray'](_0x24f85a(0xd5)['repeat'](0x1e)));const _0x3c2f2a=(_0x310a5e,_0x390a98)=>{const _0x435838=_0x24f85a;if(!_0x390a98){console[_0x435838(0xe0)]('\x20\x20'+_0x310a5e[_0x435838(0xc1)](0x11)+'\x20'+a20_0xd8dd5a[_0x435838(0xec)](_0x435838(0xbf)));return;}const _0x1255e5=inspectCliConfigJsonFile(_0x390a98);if(_0x1255e5[_0x435838(0xf6)]==='ok')console[_0x435838(0xe0)]('\x20\x20'+_0x310a5e[_0x435838(0xc1)](0x11)+'\x20'+a20_0xd8dd5a[_0x435838(0xc4)](_0x435838(0xdf)));else{if(_0x1255e5['status']===_0x435838(0xd9))console[_0x435838(0xe0)]('\x20\x20'+_0x310a5e['padEnd'](0x11)+'\x20'+a20_0xd8dd5a[_0x435838(0xca)](_0x435838(0xe4)));else _0x1255e5[_0x435838(0xf6)]==='missing'?console[_0x435838(0xe0)]('\x20\x20'+_0x310a5e[_0x435838(0xc1)](0x11)+'\x20'+a20_0xd8dd5a['gray'](_0x435838(0xbd))):(console[_0x435838(0xe0)]('\x20\x20'+_0x310a5e[_0x435838(0xc1)](0x11)+'\x20'+a20_0xd8dd5a[_0x435838(0xeb)](_0x435838(0xe8))),console[_0x435838(0xe0)]('\x20\x20'+''[_0x435838(0xc1)](0x11)+'\x20'+a20_0xd8dd5a[_0x435838(0xeb)](_0x1255e5[_0x435838(0xe1)])));}};_0x3c2f2a('Global',_0x1e689b),_0x3c2f2a(_0x24f85a(0xd1),_0x482bd6),console[_0x24f85a(0xe0)](),console[_0x24f85a(0xe0)](a20_0xd8dd5a[_0x24f85a(0xc2)](_0x24f85a(0xf4))),console[_0x24f85a(0xe0)](a20_0xd8dd5a[_0x24f85a(0xec)](_0x24f85a(0xd5)[_0x24f85a(0xde)](0x1e))),console['log'](_0x24f85a(0xf5)+(_0x3a2bf1[_0x24f85a(0xb7)]||a20_0xd8dd5a[_0x24f85a(0xeb)](_0x24f85a(0xdd)))),console[_0x24f85a(0xe0)]('\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x3a2bf1[_0x24f85a(0xd2)]);const _0x12c667=isLegacyCompatConfigKey(_0x24f85a(0xce))?a20_0xd8dd5a[_0x24f85a(0xec)](_0x3a2bf1['locale']+'\x20(legacy/compat\x20only)'):_0x3a2bf1[_0x24f85a(0xce)];return console['log'](_0x24f85a(0xb6)+_0x12c667),console[_0x24f85a(0xe0)](_0x24f85a(0xc9)+(_0x3a2bf1['defaultApp']||a20_0xd8dd5a[_0x24f85a(0xec)](_0x24f85a(0xbb)))),console[_0x24f85a(0xe0)](_0x24f85a(0xc8)+(_0x3a2bf1['currentApp']||a20_0xd8dd5a[_0x24f85a(0xec)]('(none)'))),console[_0x24f85a(0xe0)](_0x24f85a(0xd6)+(_0x3a2bf1['format']||a20_0xd8dd5a['gray']('(default:\x20'+DEFAULT_CONFIG_VALUES[_0x24f85a(0xd3)]+')'))),console[_0x24f85a(0xe0)](_0x24f85a(0xd0)+(_0x3a2bf1[_0x24f85a(0xbc)]??a20_0xd8dd5a[_0x24f85a(0xec)](_0x24f85a(0xc5)))),console[_0x24f85a(0xe0)]('\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20'+_0x3a2bf1[_0x24f85a(0xba)]),console['log']('\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x3a2bf1[_0x24f85a(0xcf)]),console[_0x24f85a(0xe0)]('\x20\x20auth\x20(effective):\x20'+AUTH_MODE[_0x24f85a(0xed)]),console[_0x24f85a(0xe0)]('\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20'+(_0x3a2bf1['accessKey']?a20_0xd8dd5a[_0x24f85a(0xc4)](_0x24f85a(0xd7)+_0x3a2bf1[_0x24f85a(0xe7)][_0x24f85a(0xb5)]+')'):a20_0xd8dd5a[_0x24f85a(0xec)](_0x24f85a(0xbb)))),console[_0x24f85a(0xe0)](),console[_0x24f85a(0xe0)](a20_0xd8dd5a[_0x24f85a(0xc2)]('\x20\x20API\x20Endpoints')),console[_0x24f85a(0xe0)](a20_0xd8dd5a[_0x24f85a(0xec)](_0x24f85a(0xd5)[_0x24f85a(0xde)](0x1e))),console['log']('\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20'+getApiDomain()),console[_0x24f85a(0xe0)](_0x24f85a(0xf0)+getUserDomain()),console['log'](_0x24f85a(0xcb)+getRuntimeDomain()),console[_0x24f85a(0xe0)](),console['log'](a20_0xd8dd5a[_0x24f85a(0xc2)](_0x24f85a(0xe3))),console['log'](a20_0xd8dd5a[_0x24f85a(0xec)]('\x20\x20─'[_0x24f85a(0xde)](0x1e))),console['log'](_0x24f85a(0xb4)+a20_0xd8dd5a[_0x24f85a(0xc4)](AUTH_MODE[_0x24f85a(0xed)]+_0x24f85a(0xe6))),console[_0x24f85a(0xe0)](_0x24f85a(0xe9)+a20_0xd8dd5a[_0x24f85a(0xec)](_0x24f85a(0xee))),console[_0x24f85a(0xe0)](),{'ok':!![]};}export const doctorDefinition={'service':a20_0x3e18ce(0xc3),'command':a20_0x3e18ce(0xc6),'description':a20_0x3e18ce(0xe5),'risk':a20_0x3e18ce(0xcd),'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_0x88f0aa=a21_0x487c;(function(_0x4222d1,_0x442700){const _0x2258b0=a21_0x487c,_0x36e644=_0x4222d1();while(!![]){try{const _0x2604d0=-parseInt(_0x2258b0(0x193))/0x1*(parseInt(_0x2258b0(0x16c))/0x2)+-parseInt(_0x2258b0(0x171))/0x3*(-parseInt(_0x2258b0(0x16a))/0x4)+parseInt(_0x2258b0(0x1a8))/0x5*(-parseInt(_0x2258b0(0x1b1))/0x6)+-parseInt(_0x2258b0(0x17e))/0x7*(parseInt(_0x2258b0(0x1b0))/0x8)+-parseInt(_0x2258b0(0x172))/0x9*(-parseInt(_0x2258b0(0x169))/0xa)+-parseInt(_0x2258b0(0x199))/0xb+parseInt(_0x2258b0(0x16d))/0xc;if(_0x2604d0===_0x442700)break;else _0x36e644['push'](_0x36e644['shift']());}catch(_0x301e15){_0x36e644['push'](_0x36e644['shift']());}}}(a21_0x186f,0xe7865));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';function a21_0x487c(_0x3c1ae8,_0x30de11){_0x3c1ae8=_0x3c1ae8-0x165;const _0x186f1f=a21_0x186f();let _0x487cf7=_0x186f1f[_0x3c1ae8];return _0x487cf7;}import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a21_0x88f0aa(0x1ae),'type':a21_0x88f0aa(0x165),'description':a21_0x88f0aa(0x1a7)},{'name':a21_0x88f0aa(0x16b),'type':'string','description':a21_0x88f0aa(0x1a2)+DEFAULT_CONFIG_VALUES[a21_0x88f0aa(0x16b)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':'boolean','description':a21_0x88f0aa(0x179)+PRODUCT_CONFIG[a21_0x88f0aa(0x176)]+a21_0x88f0aa(0x1a1),'default':![]},{'name':a21_0x88f0aa(0x1a6),'type':a21_0x88f0aa(0x177),'description':a21_0x88f0aa(0x196),'default':![]}];function a21_0x186f(){const _0x2d2202=['log','cwd','Invalid\x20env\x20\x22','\x0aInitialized\x20','Usage:\x20','\x22.\x20Allowed:\x20','Imported\x20from\x20','\x20\x20default:\x20','object','Initialized\x20','stdout','\x20\x20env:\x20\x20\x20\x20\x20','\x20\x20appcode:\x20','App\x20code','project','1VIUtvy','):\x20','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','Skip\x20confirmation\x20when\x20overwriting','SIGINT','\x20\x20config:\x20\x20','781781SluDmU','file','Failed\x20to\x20parse\x20source\x20file:\x20','apiDir','entries','apps','validation','\x20already\x20exists.\x20Overwrite?',')\x20instead\x20of\x20project','Target\x20environment\x20(default\x20','includes','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','removeListener','yes','App\x20code\x20for\x20the\x20project','1736905LAWOlk','Aborted.','parse','name','riskLevel','utf8','appcode','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','4221064UEjWKs','18ErCTbm','[Y/n]','string','question','flagMissing','Source\x20file\x20not\x20found:\x20','12716520ccWCZb','28hFarxj','env','3696306OIKyng','47332764oVVimr','\x20init\x20—\x20Create\x20','toLowerCase','Override\x20imported\x20default\x20env','118518ksuJGO','9hIjztz','File\x20','trim','User\x20aborted\x20prompt','newConfigFileName','boolean','message','Write\x20to\x20global\x20(~/','race','once','global','AbortPrompt','21XTrrkC','defaultApp','close','Override\x20imported\x20default\x20appcode','cancelled','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.'];a21_0x186f=function(){return _0x2d2202;};return a21_0x186f();}export const initImportFlagDefs=[{'name':a21_0x88f0aa(0x19a),'type':a21_0x88f0aa(0x165),'description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':a21_0x88f0aa(0x1ae),'type':a21_0x88f0aa(0x165),'description':a21_0x88f0aa(0x181)},{'name':a21_0x88f0aa(0x16b),'type':a21_0x88f0aa(0x165),'description':a21_0x88f0aa(0x170),'enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x88f0aa(0x17c),'type':'boolean','description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a21_0x88f0aa(0x176)]+a21_0x88f0aa(0x1a1),'default':![]},{'name':'yes','type':a21_0x88f0aa(0x177),'description':a21_0x88f0aa(0x196),'default':![]}];export async function runInit(_0xd25e20){const _0x36bc09=a21_0x88f0aa,_0x256d3a=isNonInteractiveMode(_0xd25e20),_0x4666ca=_0xd25e20['global']?_0x36bc09(0x17c):_0x36bc09(0x192),_0x35e017=resolveWriteConfigPath(_0x4666ca);try{_0x256d3a?await runNonInteractive(_0xd25e20,_0x35e017):await runInteractive(_0xd25e20,_0x35e017);}catch(_0x498196){if(_0x498196 instanceof AbortPrompt)throw CliErrors[_0x36bc09(0x182)]();throw _0x498196;}}export async function runInitImport(_0x4ed358){const _0x1d97a8=a21_0x88f0aa,_0x4116e1=_0x4ed358['global']?_0x1d97a8(0x17c):_0x1d97a8(0x192),_0x1c5fff=resolveWriteConfigPath(_0x4116e1);await runFromImport(_0x4ed358,_0x1c5fff);}const RUNTIME_IRRELEVANT_KEYS=new Set([a21_0x88f0aa(0x19c)]);async function runFromImport(_0x1b4dbd,_0x404958){const _0x113755=a21_0x88f0aa,_0xe4cfe8=resolveFilePath(_0x1b4dbd['file']);if(!existsSync(_0xe4cfe8))throw CliErrors['validation'](_0x113755(0x168)+_0xe4cfe8);const _0x83cc1e=readSourceFile(_0xe4cfe8),_0x5cd805=convertToRuntimeConfig(_0x83cc1e);_0x1b4dbd['appcode']&&(_0x5cd805[_0x113755(0x1ae)]=String(_0x1b4dbd[_0x113755(0x1ae)]));_0x1b4dbd[_0x113755(0x16b)]&&(_0x5cd805[_0x113755(0x16b)]=resolveInitEnv(_0x1b4dbd));if(!_0x5cd805[_0x113755(0x1ae)])throw CliErrors[_0x113755(0x19f)](_0x113755(0x1a4),'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(_0x404958,_0x5cd805,_0x1b4dbd),console['log'](_0x113755(0x18a)+_0xe4cfe8),console['log'](_0x113755(0x198)+_0x404958),console['log'](_0x113755(0x190)+_0x5cd805[_0x113755(0x1ae)]);if(_0x5cd805[_0x113755(0x17f)])console[_0x113755(0x184)](_0x113755(0x18b)+_0x5cd805[_0x113755(0x17f)]);}function convertToRuntimeConfig(_0xaa168a){const _0x444edf=a21_0x88f0aa;if(_0xaa168a[_0x444edf(0x19e)]&&typeof _0xaa168a[_0x444edf(0x19e)]===_0x444edf(0x18c))throw CliErrors[_0x444edf(0x19f)](_0x444edf(0x183),_0x444edf(0x1af));const _0x3231db={};for(const _0x19a631 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0xaa168a[_0x19a631]!==undefined&&(_0x3231db[_0x19a631]=_0xaa168a[_0x19a631]);}return!_0x3231db[_0x444edf(0x1ac)]&&(_0x3231db[_0x444edf(0x1ac)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x3231db;}async function runNonInteractive(_0x3e7416,_0x584f28){const _0x3f0c8d=a21_0x88f0aa,_0x558328=_0x3e7416['appcode'];if(!_0x558328)throw CliErrors[_0x3f0c8d(0x167)](_0x3f0c8d(0x1ae),_0x3f0c8d(0x188)+CLI_BIN_NAME+_0x3f0c8d(0x195));const _0x2e901d=resolveInitEnv(_0x3e7416);await writeInitConfig(_0x584f28,{'appcode':_0x558328,'env':_0x2e901d},_0x3e7416),console[_0x3f0c8d(0x184)](_0x3f0c8d(0x18d)+_0x584f28),console[_0x3f0c8d(0x184)]('\x20\x20appcode:\x20'+_0x558328),console['log']('\x20\x20env:\x20\x20\x20\x20\x20'+_0x2e901d);}async function runInteractive(_0xbe455b,_0x1f905a){const _0x2766a2=a21_0x88f0aa,_0x58bc3a=loadExisting(_0x1f905a),_0x28e996=typeof _0x58bc3a?.[_0x2766a2(0x1ae)]===_0x2766a2(0x165)?_0x58bc3a[_0x2766a2(0x1ae)]:'',_0x9f7a16=resolveInitEnv(_0xbe455b);console[_0x2766a2(0x184)](CLI_BIN_NAME+_0x2766a2(0x16e)+PRODUCT_CONFIG[_0x2766a2(0x176)]+'\x0a');if(existsSync(_0x1f905a)&&!_0xbe455b['yes']){const _0x52c3bf=await promptYesNo(_0x2766a2(0x173)+_0x1f905a+_0x2766a2(0x1a0),![]);if(!_0x52c3bf){console[_0x2766a2(0x184)](_0x2766a2(0x1a9));return;}}const _0x3be523=typeof _0xbe455b[_0x2766a2(0x1ae)]===_0x2766a2(0x165)?_0xbe455b[_0x2766a2(0x1ae)][_0x2766a2(0x174)]():'';let _0x52db89=_0x3be523;!_0x52db89&&(_0x52db89=await promptInput(_0x2766a2(0x191),_0x28e996));if(!_0x52db89['trim']())throw CliErrors[_0x2766a2(0x19f)]('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x1f905a,{'appcode':_0x52db89[_0x2766a2(0x174)](),'env':_0x9f7a16},_0xbe455b),console['log'](_0x2766a2(0x187)+_0x1f905a),console[_0x2766a2(0x184)](_0x2766a2(0x190)+_0x52db89[_0x2766a2(0x174)]()),console[_0x2766a2(0x184)](_0x2766a2(0x18f)+_0x9f7a16);}async function writeInitConfig(_0x159478,_0x7d39a,_0x28775f){const _0x5b049c=a21_0x88f0aa;let _0x68e5e={};existsSync(_0x159478)&&!_0x28775f[_0x5b049c(0x1a6)]&&(_0x68e5e=readConfigFile(_0x159478));for(const [_0x439fd3,_0x1de551]of Object[_0x5b049c(0x19d)](_0x7d39a)){_0x1de551!==undefined&&(_0x68e5e[_0x439fd3]=_0x1de551);}if(_0x68e5e['app'])delete _0x68e5e['app'];writeConfigFile(_0x159478,_0x68e5e);}class AbortPrompt extends Error{constructor(){const _0xe426d4=a21_0x88f0aa;super(_0xe426d4(0x175)),this[_0xe426d4(0x1ab)]=_0xe426d4(0x17d);}}function createSafeRl(){const _0xe718d2=a21_0x88f0aa,_0xb2fe25=createInterface({'input':process['stdin'],'output':process[_0xe718d2(0x18e)]});let _0x39c362;const _0x1c14c7=new Promise((_0x5b1397,_0x118c4d)=>{const _0x542718=_0xe718d2;_0x39c362=()=>{const _0x2abd44=a21_0x487c;_0x39c362&&(_0xb2fe25[_0x2abd44(0x1a5)](_0x2abd44(0x197),_0x39c362),_0x39c362=undefined);try{_0xb2fe25[_0x2abd44(0x180)]();}catch{}_0x118c4d(new AbortPrompt());},_0xb2fe25[_0x542718(0x17b)](_0x542718(0x197),_0x39c362);}),_0x5712af=()=>{const _0x152100=_0xe718d2;_0x39c362&&(_0xb2fe25[_0x152100(0x1a5)](_0x152100(0x197),_0x39c362),_0x39c362=undefined);try{_0xb2fe25['close']();}catch{}};return{'rl':_0xb2fe25,'abortPromise':_0x1c14c7,'disposeSuccess':_0x5712af};}async function promptInput(_0x3dde0b,_0x204a2d){const _0x1bf4d4=a21_0x88f0aa,{rl:_0xe4f649,abortPromise:_0x3d1185,disposeSuccess:_0x98c2bd}=createSafeRl(),_0x351034=new Promise(_0x50afbf=>{const _0x549243=a21_0x487c,_0x4f43c8=_0x204a2d?'\x20\x20'+_0x3dde0b+'\x20('+_0x204a2d+_0x549243(0x194):'\x20\x20'+_0x3dde0b+':\x20';_0xe4f649[_0x549243(0x166)](_0x4f43c8,_0x3cb271=>{const _0x32f56c=_0x549243;_0x98c2bd(),_0x50afbf(_0x3cb271[_0x32f56c(0x174)]()||_0x204a2d);});});return Promise[_0x1bf4d4(0x17a)]([_0x351034,_0x3d1185]);}async function promptYesNo(_0x14d84b,_0x461bc3){const _0x57ba00=a21_0x88f0aa,{rl:_0xe88aff,abortPromise:_0x531e7e,disposeSuccess:_0x1ad1bb}=createSafeRl(),_0x575c1e=new Promise(_0x4c6c5d=>{const _0x5bfa0e=a21_0x487c,_0x57e551=_0x461bc3?_0x5bfa0e(0x1b2):'[y/N]';_0xe88aff[_0x5bfa0e(0x166)]('\x20\x20'+_0x14d84b+'\x20'+_0x57e551+':\x20',_0x3db8d9=>{const _0x38297f=_0x5bfa0e;_0x1ad1bb();const _0x6150b4=_0x3db8d9[_0x38297f(0x174)]()[_0x38297f(0x16f)]();if(_0x6150b4==='y'||_0x6150b4===_0x38297f(0x1a6))_0x4c6c5d(!![]);else{if(_0x6150b4==='n'||_0x6150b4==='no')_0x4c6c5d(![]);else _0x4c6c5d(_0x461bc3);}});});return Promise[_0x57ba00(0x17a)]([_0x575c1e,_0x531e7e]);}function loadExisting(_0x261093){if(!existsSync(_0x261093))return null;return readConfigFile(_0x261093);}function resolveFilePath(_0xda675f){const _0x1c8b6f=a21_0x88f0aa;return isAbsolute(_0xda675f)?_0xda675f:resolve(process[_0x1c8b6f(0x185)](),_0xda675f);}function readSourceFile(_0x5bc266){const _0x85737c=a21_0x88f0aa;try{const _0x259b32=readFileSync(_0x5bc266,{'encoding':_0x85737c(0x1ad)});return JSON[_0x85737c(0x1aa)](_0x259b32);}catch(_0x5de215){throw CliErrors['validation'](_0x85737c(0x19b)+_0x5de215[_0x85737c(0x178)]);}}function resolveInitEnv(_0x513412){const _0x5e50bb=a21_0x88f0aa,_0x51114c=_0x513412[_0x5e50bb(0x16b)];if(_0x51114c===undefined||_0x51114c==='')return DEFAULT_CONFIG_VALUES[_0x5e50bb(0x16b)];if(!RUNTIME_ENV_VALUES[_0x5e50bb(0x1a3)](_0x51114c))throw CliErrors[_0x5e50bb(0x19f)](_0x5e50bb(0x186)+_0x51114c+_0x5e50bb(0x189)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x51114c;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a22_0x407583=a22_0x3c8a;(function(_0x22efbf,_0x4e41dc){const _0x4d798a=a22_0x3c8a,_0x34703f=_0x22efbf();while(!![]){try{const _0x1e85a6=-parseInt(_0x4d798a(0xb9))/0x1+-parseInt(_0x4d798a(0xd1))/0x2*(parseInt(_0x4d798a(0xaa))/0x3)+parseInt(_0x4d798a(0xc7))/0x4+-parseInt(_0x4d798a(0xca))/0x5+parseInt(_0x4d798a(0xbc))/0x6*(parseInt(_0x4d798a(0xa2))/0x7)+-parseInt(_0x4d798a(0xc9))/0x8+parseInt(_0x4d798a(0xb5))/0x9*(parseInt(_0x4d798a(0x9d))/0xa);if(_0x1e85a6===_0x4e41dc)break;else _0x34703f['push'](_0x34703f['shift']());}catch(_0x2fe2d1){_0x34703f['push'](_0x34703f['shift']());}}}(a22_0x3251,0x6feaa));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';function a22_0x3c8a(_0x5307cd,_0x333fd9){_0x5307cd=_0x5307cd-0x96;const _0x3251d7=a22_0x3251();let _0x3c8acc=_0x3251d7[_0x5307cd];return _0x3c8acc;}import{CliErrors}from'../../errors.js';function a22_0x3251(){const _0x45ca6a=['length','2283nwgGaK','/client/knowledge-base/personal/create','str','verbose','Updated\x20KB\x20entry\x20','version','POST','description','create','Search\x20query\x20is\x20required.','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','750717uLMavg','detail','ragStatus','Created\x20KB\x20entry\x20','385617nprHIt','query','trim','564bhwaOo','file','metadata','/update','validation','userId','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','map','flag','File\x20path\x20is\x20required.','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','1317376MIqtfo','content','6193376zmdEez','1199675qSvGmm','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','docId','read','number','/client/knowledge-base/personal/','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','908yrYGSh','string','Override\x20the\x20existing\x20entry\x20title','appCode','update','File\x20not\x20found:\x20','title','utf8','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','isFinite','updateTime','num','score','220xduDmS','topk','Personal\x20knowledge-base\x20entry\x20ID','isFile','File\x20is\x20not\x20a\x20regular\x20file:\x20','2919JaAYMO','--topk\x20must\x20be\x20a\x20positive\x20number.','bool','list','body','scope','build'];a22_0x3251=function(){return _0x45ca6a;};return a22_0x3251();}import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a22_0x407583(0x96),'type':'string','required':!![],'description':'Personal\x20knowledge-base\x20entry\x20title'},FILE_FLAG={'name':'file','type':a22_0x407583(0xd2),'required':!![],'description':'Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file'},QUERY_FLAG={'name':a22_0x407583(0xba),'type':a22_0x407583(0xd2),'required':!![],'description':a22_0x407583(0xd0)},TOPK_FLAG={'name':a22_0x407583(0x9e),'type':a22_0x407583(0xce),'description':'Maximum\x20number\x20of\x20search\x20hits\x20to\x20return'};function readKnowledgeFile(_0x1353ef){const _0x199d6b=a22_0x407583;if(!_0x1353ef)throw CliErrors['validation'](_0x199d6b(0xc5));if(!existsSync(_0x1353ef))throw CliErrors[_0x199d6b(0xc0)](_0x199d6b(0xd6)+_0x1353ef);if(!statSync(_0x1353ef)[_0x199d6b(0xa0)]())throw CliErrors[_0x199d6b(0xc0)](_0x199d6b(0xa1)+_0x1353ef);return readFileSync(_0x1353ef,_0x199d6b(0x97));}function summarizePersonalItem(_0x1b719e){const _0x5ec2ac=a22_0x407583;return{'id':_0x1b719e['id'],'title':_0x1b719e['title'],'version':_0x1b719e[_0x5ec2ac(0xaf)],'ragStatus':_0x1b719e[_0x5ec2ac(0xb7)],'ragErrorMessage':_0x1b719e['ragErrorMessage'],'updateTime':_0x1b719e[_0x5ec2ac(0x9a)]};}function detailPersonalItem(_0x4e5dc2){const _0x50bf09=a22_0x407583;return{'id':_0x4e5dc2['id'],'appCode':_0x4e5dc2['appCode'],'scope':_0x4e5dc2[_0x50bf09(0xa7)],'userId':_0x4e5dc2[_0x50bf09(0xc1)],'title':_0x4e5dc2['title'],'content':_0x4e5dc2[_0x50bf09(0xc8)]??'','version':_0x4e5dc2[_0x50bf09(0xaf)],'ragStatus':_0x4e5dc2[_0x50bf09(0xb7)],'ragErrorMessage':_0x4e5dc2['ragErrorMessage'],'createTime':_0x4e5dc2['createTime'],'updateTime':_0x4e5dc2[_0x50bf09(0x9a)]};}function summarizeSearchHit(_0x486077){const _0x1a33fe=a22_0x407583;return{'scope':_0x486077[_0x1a33fe(0xa7)],'docId':_0x486077[_0x1a33fe(0xcc)],'score':_0x486077[_0x1a33fe(0x9c)],'weightedScore':_0x486077['weightedScore'],'content':_0x486077[_0x1a33fe(0xc8)],'metadata':_0x486077[_0x1a33fe(0xbe)]};}function readTopK(_0x5d4586){const _0x3a69d3=a22_0x407583,_0x7e1f26=_0x5d4586[_0x3a69d3(0xc4)](_0x3a69d3(0x9e));if(_0x7e1f26===undefined||_0x7e1f26===null||_0x7e1f26==='')return undefined;const _0x2976d5=_0x5d4586[_0x3a69d3(0x9b)](_0x3a69d3(0x9e));if(!Number[_0x3a69d3(0x99)](_0x2976d5)||_0x2976d5<0x1)throw CliErrors['validation'](_0x3a69d3(0xa3));return _0x2976d5;}const kbList={'service':'kb','command':a22_0x407583(0xa5),'description':'List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','risk':a22_0x407583(0xcd),'flags':[VERBOSE_FLAG],async 'execute'(_0x5d9ce5){const _0x305ec1=a22_0x407583,_0x184082=await listPersonalKnowledgeBaseItems(_0x5d9ce5[_0x305ec1(0xd4)]);if(_0x5d9ce5[_0x305ec1(0xa4)](_0x305ec1(0xad)))return{'ok':!![],'data':{'total':_0x184082[_0x305ec1(0xa9)],'items':_0x184082}};return{'ok':!![],'data':{'total':_0x184082[_0x305ec1(0xa9)],'items':_0x184082[_0x305ec1(0xc3)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a22_0x407583(0xb6),'description':a22_0x407583(0x98),'risk':a22_0x407583(0xcd),'flags':[{...ID_FLAG,'description':a22_0x407583(0x9f)}],async 'execute'(_0x14c231){const _0x5946a6=a22_0x407583,_0x136500=await getPersonalKnowledgeBaseItem(_0x14c231[_0x5946a6(0x9b)]('id'),_0x14c231[_0x5946a6(0xd4)]);return{'ok':!![],'data':detailPersonalItem(_0x136500)};}},kbCreate={'service':'kb','command':a22_0x407583(0xb2),'description':'Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','risk':'write','flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x1b4cd1){const _0x4c08c2=a22_0x407583,_0x28cdd4=_0x1b4cd1['str'](_0x4c08c2(0x96)),_0x1fdf18=readKnowledgeFile(_0x1b4cd1[_0x4c08c2(0xac)]('file')),_0x1bd258=await createPersonalKnowledgeBaseItem(_0x1b4cd1[_0x4c08c2(0xd4)],{'title':_0x28cdd4,'content':_0x1fdf18});return{'ok':!![],'data':summarizePersonalItem(_0x1bd258),'message':_0x4c08c2(0xb8)+_0x1bd258['id']+'\x20('+_0x1bd258[_0x4c08c2(0x96)]+')'};},async 'dryRun'(_0x379814){const _0x1909b7=a22_0x407583,_0x5aabf3=_0x379814[_0x1909b7(0xac)](_0x1909b7(0x96)),_0x113e07=readKnowledgeFile(_0x379814['str'](_0x1909b7(0xbd)));return dryRun('POST',_0x1909b7(0xab))[_0x1909b7(0xa6)]({'appCode':_0x379814['appCode'],'title':_0x5aabf3,'content':_0x113e07})[_0x1909b7(0xb1)](_0x1909b7(0xb4)+_0x5aabf3+'\x22')[_0x1909b7(0xa8)]();}},kbUpdate={'service':'kb','command':a22_0x407583(0xd5),'description':a22_0x407583(0xc2),'risk':'write','flags':[{...ID_FLAG,'description':a22_0x407583(0x9f)},{...TITLE_FLAG,'required':![],'description':a22_0x407583(0xd3)},FILE_FLAG],async 'execute'(_0x118a4c){const _0x3baffe=a22_0x407583,_0x225f5a=_0x118a4c['num']('id'),_0x5bd29b=readKnowledgeFile(_0x118a4c[_0x3baffe(0xac)](_0x3baffe(0xbd))),_0x2ddb02=_0x118a4c[_0x3baffe(0xac)](_0x3baffe(0x96))||(await getPersonalKnowledgeBaseItem(_0x225f5a,_0x118a4c[_0x3baffe(0xd4)]))[_0x3baffe(0x96)],_0x54b638=await updatePersonalKnowledgeBaseItem(_0x225f5a,_0x118a4c[_0x3baffe(0xd4)],{'title':_0x2ddb02,'content':_0x5bd29b});return{'ok':!![],'data':summarizePersonalItem(_0x54b638),'message':_0x3baffe(0xae)+_0x54b638['id']+'\x20('+_0x54b638[_0x3baffe(0x96)]+')'};},async 'dryRun'(_0x2bd6e7){const _0x8d5b59=a22_0x407583,_0xe8ec54=_0x2bd6e7[_0x8d5b59(0x9b)]('id'),_0xbca1aa=readKnowledgeFile(_0x2bd6e7[_0x8d5b59(0xac)](_0x8d5b59(0xbd))),_0x267c72=_0x2bd6e7[_0x8d5b59(0xac)](_0x8d5b59(0x96))||(await getPersonalKnowledgeBaseItem(_0xe8ec54,_0x2bd6e7[_0x8d5b59(0xd4)]))[_0x8d5b59(0x96)];return dryRun(_0x8d5b59(0xb0),_0x8d5b59(0xcf)+_0xe8ec54+_0x8d5b59(0xbf))[_0x8d5b59(0xa6)]({'appCode':_0x2bd6e7[_0x8d5b59(0xd4)],'title':_0x267c72,'content':_0xbca1aa})[_0x8d5b59(0xb1)](_0x8d5b59(0xcb)+_0xe8ec54)[_0x8d5b59(0xa8)]();}},kbSearch={'service':'kb','command':'search','description':a22_0x407583(0xc6),'risk':a22_0x407583(0xcd),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x429690){const _0x312e4e=a22_0x407583;if(!_0x429690[_0x312e4e(0xac)](_0x312e4e(0xba))[_0x312e4e(0xbb)]())throw CliErrors[_0x312e4e(0xc0)](_0x312e4e(0xb3));readTopK(_0x429690);},async 'execute'(_0x90820a){const _0x3ad3ff=a22_0x407583,_0xe76d0f=_0x90820a[_0x3ad3ff(0xac)](_0x3ad3ff(0xba))[_0x3ad3ff(0xbb)](),_0x5be144=readTopK(_0x90820a),_0x3bc567=await searchKnowledgeBase(_0x90820a['appCode'],{'query':_0xe76d0f,'topK':_0x5be144});return{'ok':!![],'data':{'total':_0x3bc567[_0x3ad3ff(0xa9)],'hits':_0x3bc567[_0x3ad3ff(0xc3)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a23_0x54aa(_0x3c6760,_0x10211f){_0x3c6760=_0x3c6760-0x1d0;const _0x19fad2=a23_0x19fa();let _0x54aa30=_0x19fad2[_0x3c6760];return _0x54aa30;}const a23_0x5efc72=a23_0x54aa;function a23_0x19fa(){const _0x5d750c=['toLocaleString','666490DezNiC','11270021enINno','readLogs','23150sTFqNG','success','message','\x20\x20\x20Duration:\x20','2257640VDCdXB','Clear\x20command\x20history\x20logs','write','\x20\x20\x20Details:\x20','forEach','details','2813280QcUtRU','logs','length','error','915iyHxhm','39626622YdBPHj','keys','warn','log','\x20logs:\x0a','\x20\x20\x20Time:\x20','duration','timestamp','level','39156fPQSKA','3BAlpIC','View\x20command\x20history\x20logs'];a23_0x19fa=function(){return _0x5d750c;};return a23_0x19fa();}(function(_0x16c0b2,_0x37b46d){const _0x3144d5=a23_0x54aa,_0x3f9db2=_0x16c0b2();while(!![]){try{const _0x3c3770=-parseInt(_0x3144d5(0x1e0))/0x1+-parseInt(_0x3144d5(0x1dd))/0x2*(-parseInt(_0x3144d5(0x1da))/0x3)+-parseInt(_0x3144d5(0x1ea))/0x4+parseInt(_0x3144d5(0x1ee))/0x5*(-parseInt(_0x3144d5(0x1d9))/0x6)+-parseInt(_0x3144d5(0x1de))/0x7+-parseInt(_0x3144d5(0x1e4))/0x8+parseInt(_0x3144d5(0x1d0))/0x9;if(_0x3c3770===_0x37b46d)break;else _0x3f9db2['push'](_0x3f9db2['shift']());}catch(_0x1342d0){_0x3f9db2['push'](_0x3f9db2['shift']());}}}(a23_0x19fa,0xe1683));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x4939fc){const _0x49804e=a23_0x54aa;if(_0x4939fc[_0x49804e(0x1ec)]===0x0){console['log']('*\x20No\x20logs\x20found');return;}console[_0x49804e(0x1d3)]('*\x20'+CLI_DISPLAY_NAME+_0x49804e(0x1d4)),_0x4939fc[_0x49804e(0x1e8)]((_0x57f1d7,_0xb834f4)=>{const _0x551bbe=_0x49804e,_0x272bae=new Date(_0x57f1d7[_0x551bbe(0x1d7)])[_0x551bbe(0x1dc)]('en-US'),_0x554421=_0x57f1d7[_0x551bbe(0x1d8)]===_0x551bbe(0x1e1)?'√':_0x57f1d7[_0x551bbe(0x1d8)]===_0x551bbe(0x1ed)?'×':_0x57f1d7['level']===_0x551bbe(0x1d2)?'!':'i';console[_0x551bbe(0x1d3)](_0xb834f4+0x1+'.\x20'+_0x554421+'\x20['+_0x57f1d7['command']+']\x20'+_0x57f1d7[_0x551bbe(0x1e2)]),console[_0x551bbe(0x1d3)](_0x551bbe(0x1d5)+_0x272bae),_0x57f1d7['duration']&&console['log'](_0x551bbe(0x1e3)+_0x57f1d7[_0x551bbe(0x1d6)]+'ms'),_0x57f1d7[_0x551bbe(0x1e9)]&&Object[_0x551bbe(0x1d1)](_0x57f1d7['details'])['length']>0x0&&console['log'](_0x551bbe(0x1e7)+JSON['stringify'](_0x57f1d7['details'],null,0x2)),console['log']('');});}export const logsDefinitions=[{'service':a23_0x5efc72(0x1eb),'command':'show','description':a23_0x5efc72(0x1db),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x273684){const _0x242e0a=a23_0x5efc72;return printLogs(logger[_0x242e0a(0x1df)]()),{'ok':!![]};}},{'service':'logs','command':'clear','description':a23_0x5efc72(0x1e5),'risk':a23_0x5efc72(0x1e6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x4f3e98){const _0x57662e=a23_0x5efc72;return logger['clearLogs'](),console[_0x57662e(0x1d3)]('*\x20Logs\x20cleared'),{'ok':!![]};}}];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x1fe922=a24_0x4bc3;(function(_0x2b7075,_0x4dd18c){const _0x5160ce=a24_0x4bc3,_0x553116=_0x2b7075();while(!![]){try{const _0x41c71e=-parseInt(_0x5160ce(0x98))/0x1+-parseInt(_0x5160ce(0x82))/0x2*(-parseInt(_0x5160ce(0xa8))/0x3)+parseInt(_0x5160ce(0xa3))/0x4*(-parseInt(_0x5160ce(0x87))/0x5)+-parseInt(_0x5160ce(0x84))/0x6+parseInt(_0x5160ce(0xa9))/0x7*(-parseInt(_0x5160ce(0xa7))/0x8)+parseInt(_0x5160ce(0x89))/0x9*(parseInt(_0x5160ce(0x91))/0xa)+parseInt(_0x5160ce(0x92))/0xb*(parseInt(_0x5160ce(0x85))/0xc);if(_0x41c71e===_0x4dd18c)break;else _0x553116['push'](_0x553116['shift']());}catch(_0x46dde2){_0x553116['push'](_0x553116['shift']());}}}(a24_0x1532,0x2846a));import{authDefinitions}from'../commands/auth/index.js';function a24_0x1532(){const _0x2a82ba=['Datasets','service','SQL\x20Queries','command','Configuration','get','Self\x20Update','1270JuOHLQ','28930PIXgRG','Logs','from','values','BFF\x20Scripts','run','279152szUkIK','list','login','Schema','show','map','App\x20Management','set','push','\x20\x20[write]','install','801844FGlZoM','read','Skills','description','8tkpfLI','156594gzrcyr','1555309RclDIK','Knowledge\x20Base','isSingleCommand','\x20\x20[high-risk-write]','2PGtGVe','risk','1612686FQlFLj','4764xuguFH','Instant\x20API','5YICqFP','write','2781qibeZE'];a24_0x1532=function(){return _0x2a82ba;};return a24_0x1532();}import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';function a24_0x4bc3(_0x370c48,_0x50f769){_0x370c48=_0x370c48-0x81;const _0x1532b2=a24_0x1532();let _0x4bc360=_0x1532b2[_0x370c48];return _0x4bc360;}import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x571829){const _0x1f9a07=a24_0x4bc3;for(const _0x38e7ac of _0x571829){definitions[_0x1f9a07(0x9f)](_0x38e7ac[_0x1f9a07(0x8b)]+':'+_0x38e7ac['command'],_0x38e7ac);let _0x419041=serviceGroups[_0x1f9a07(0x8f)](_0x38e7ac[_0x1f9a07(0x8b)]);!_0x419041&&(_0x419041=[],serviceGroups[_0x1f9a07(0x9f)](_0x38e7ac['service'],_0x419041)),_0x419041[_0x1f9a07(0xa0)](_0x38e7ac);}}function registerService(_0x2b1242,_0x347658,_0x11dfc2){const _0xb39782=a24_0x4bc3;registerDefinitions(_0x347658);const _0x5596cd=_0x1cbd5d=>_0x1cbd5d===_0xb39782(0xa4)?'':_0x1cbd5d===_0xb39782(0x88)?_0xb39782(0xa1):_0xb39782(0x81),_0x2a3fde={'service':_0x347658[0x0][_0xb39782(0x8b)],'label':_0x2b1242,'commands':_0x347658[_0xb39782(0x9d)](_0x394ba8=>({'command':_0x394ba8['command'],'description':_0x394ba8[_0xb39782(0xa6)],'tag':_0x5596cd(_0x394ba8[_0xb39782(0x83)])})),'defaultCommand':_0x11dfc2?.['defaultCommand']??(_0x11dfc2?.[_0xb39782(0xab)]?_0x347658[0x0][_0xb39782(0x8d)]:undefined),'isSingleCommand':_0x11dfc2?.[_0xb39782(0xab)]};serviceRegistry['push'](_0x2a3fde),serviceByName[_0xb39782(0x9f)](_0x2a3fde['service'],_0x2a3fde);}registerService('Authentication',authDefinitions,{'defaultCommand':a24_0x1fe922(0x9a)}),registerService(a24_0x1fe922(0x8a),datasetDefinitions),registerService(a24_0x1fe922(0x86),dataDefinitions),registerService(a24_0x1fe922(0x8c),sqlDefinitions),registerService(a24_0x1fe922(0x96),bffDefinitions),registerService(a24_0x1fe922(0xaa),kbDefinitions),registerService(a24_0x1fe922(0x9e),appDefinitions,{'defaultCommand':a24_0x1fe922(0x99)}),registerService(a24_0x1fe922(0x8e),configDefinitions,{'defaultCommand':a24_0x1fe922(0x99)}),registerService(a24_0x1fe922(0xa5),skillDefinitions,{'defaultCommand':a24_0x1fe922(0xa2)}),registerService(a24_0x1fe922(0x90),[updateDefinition],{'defaultCommand':a24_0x1fe922(0x97),'isSingleCommand':!![]}),registerService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerService(a24_0x1fe922(0x9b),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a24_0x1fe922(0x93),logsDefinitions,{'defaultCommand':a24_0x1fe922(0x9c)});export function findDefinition(_0x13e6cd,_0x54ff54){const _0x3734d5=a24_0x1fe922;return definitions[_0x3734d5(0x8f)](_0x13e6cd+':'+_0x54ff54);}export function isKnownService(_0x20fe4e){return serviceByName['has'](_0x20fe4e);}export function getServiceEntry(_0x3c1c5d){return serviceByName['get'](_0x3c1c5d);}export function getAllDefinitions(){const _0x17276c=a24_0x1fe922;return Array[_0x17276c(0x94)](definitions[_0x17276c(0x95)]());}
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x4eead7=a25_0x5e0d;function a25_0x21a6(){const _0x6f0a1b=['1080437gIepbZ','537RLKtsa','export','403868oPubWq','39570dWVsDs','7071440sZxfjf','20954655NDWuMY','Export\x20machine-readable\x20command\x20schema\x20(JSON)','schema','4684jJDzKo','3857826LZoWzH','read','654pIFWwq'];a25_0x21a6=function(){return _0x6f0a1b;};return a25_0x21a6();}(function(_0x5e7e7f,_0x4c3446){const _0x12d7c3=a25_0x5e0d,_0x4b6f27=_0x5e7e7f();while(!![]){try{const _0x26506a=parseInt(_0x12d7c3(0x12c))/0x1+-parseInt(_0x12d7c3(0x122))/0x2+parseInt(_0x12d7c3(0x12d))/0x3*(-parseInt(_0x12d7c3(0x128))/0x4)+-parseInt(_0x12d7c3(0x123))/0x5*(parseInt(_0x12d7c3(0x12b))/0x6)+-parseInt(_0x12d7c3(0x129))/0x7+-parseInt(_0x12d7c3(0x124))/0x8+parseInt(_0x12d7c3(0x125))/0x9;if(_0x26506a===_0x4c3446)break;else _0x4b6f27['push'](_0x4b6f27['shift']());}catch(_0x3fcd5f){_0x4b6f27['push'](_0x4b6f27['shift']());}}}(a25_0x21a6,0xaac7b));import{buildSchemaPayload}from'../framework/schema-export.js';function a25_0x5e0d(_0x24f250,_0x1fa5d6){_0x24f250=_0x24f250-0x122;const _0x21a615=a25_0x21a6();let _0x5e0d67=_0x21a615[_0x24f250];return _0x5e0d67;}async function execute(_0x27d020){const _0x54c137=await buildSchemaPayload();return{'ok':!![],'data':_0x54c137};}export const schemaDefinition={'service':a25_0x4eead7(0x127),'command':a25_0x4eead7(0x12e),'description':a25_0x4eead7(0x126),'risk':a25_0x4eead7(0x12a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x208f3f=a26_0x5103;(function(_0x57391,_0x1dcef1){const _0xbd55b4=a26_0x5103,_0xec083e=_0x57391();while(!![]){try{const _0x9cdeed=parseInt(_0xbd55b4(0x145))/0x1*(parseInt(_0xbd55b4(0x129))/0x2)+-parseInt(_0xbd55b4(0x118))/0x3+parseInt(_0xbd55b4(0x119))/0x4+parseInt(_0xbd55b4(0x11e))/0x5*(-parseInt(_0xbd55b4(0x14b))/0x6)+-parseInt(_0xbd55b4(0x14d))/0x7*(-parseInt(_0xbd55b4(0x11a))/0x8)+parseInt(_0xbd55b4(0x133))/0x9*(-parseInt(_0xbd55b4(0x13c))/0xa)+parseInt(_0xbd55b4(0x12c))/0xb;if(_0x9cdeed===_0x1dcef1)break;else _0xec083e['push'](_0xec083e['shift']());}catch(_0x13d949){_0xec083e['push'](_0xec083e['shift']());}}}(a26_0x48c5,0x46759));import{CLI_BIN_NAME,CLI_DISPLAY_NAME}from'../../constant/cli.js';function a26_0x5103(_0x17a3ab,_0x144969){_0x17a3ab=_0x17a3ab-0x103;const _0x48c5a9=a26_0x48c5();let _0x5103a8=_0x48c5a9[_0x17a3ab];return _0x5103a8;}import{CliErrors}from'../../errors.js';import{logger}from'../../utils/logger.js';const CODE_FLAG={'name':a26_0x208f3f(0x107),'type':a26_0x208f3f(0x117),'description':a26_0x208f3f(0x104)},DIR_FLAG={'name':a26_0x208f3f(0x14e),'type':a26_0x208f3f(0x117),'required':!![],'description':'Local\x20Skill\x20directory\x20containing\x20SKILL.md'};function summarizeRuntimeSkill(_0x4b4ac2){const _0x1fb4bb=a26_0x208f3f;return{'id':_0x4b4ac2['id'],'skillCode':_0x4b4ac2['skillCode'],'skillName':_0x4b4ac2[_0x1fb4bb(0x116)],'scope':_0x4b4ac2['scope'],'version':_0x4b4ac2[_0x1fb4bb(0x150)],'readonly':_0x4b4ac2[_0x1fb4bb(0x11c)]};}function a26_0x48c5(){const _0x18eed4=['validation','24kRYBqF','Pulled\x20','\x20developer\x20skill','2792317QaZbfq','Upgrade\x20the\x20runtime\x20service\x20before\x20pushing\x20multi-file\x20Skill\x20directories.','unchanged','personal','setLogPath','Push\x20a\x20local\x20Skill\x20directory\x20to\x20personal\x20runtime\x20Skill\x20scope','\x20personal\x20and\x20','5787EhZVHY','authRequired','Backend\x20returned\x20a\x20different\x20multi-file\x20Skill\x20manifest\x20after\x20push.','files','log','filter','npx\x20skills\x20add\x20failed:\x20','Pull\x20personal\x20and\x20company\x20runtime\x20Skills\x20into\x20local\x20agent\x20skill\x20directories','unknown','190hzmMHd','inherit','install','\x20company\x20Skill(s).','input','isArray','find','accessKey','write','24086YMfLHQ','updated','apiError','Updated\x20personal\x20Skill\x20','path','../../skills/npx-skills-add.js','2450562iQSADH','skill-install','210yGgdPO','dir','skill','version','\x20-g\x20-y)...','company','Only\x20pull\x20a\x20specific\x20runtime\x20Skill\x20code','skillCode','production','code','Check\x20the\x20runtime\x20service\x20Skill\x20file\x20manifest\x20storage\x20before\x20pulling\x20this\x20Skill.','cwd','pipe','info','reduce','../../core/api-client.js','Created\x20personal\x20Skill\x20','appCode','length','push','Install\x20the\x20published\x20','trim','map','skipped','skillName','string','1426158XvEmEm','2135608wdPIFC','28760JqVaqF','str','readonly','=1);\x20assuming\x20skill\x20is\x20already\x20present.','5zhySFr','Check\x20network\x20connectivity\x20and\x20try\x20again.','Installing\x20published\x20','../../skills/runtime-skill-sync.js','action','\x20skill\x20via\x20npx.','SKILL.md','pull','Installing\x20official\x20skill\x20via\x20npx\x20(npx\x20skills\x20add\x20','Backend\x20did\x20not\x20persist\x20the\x20multi-file\x20Skill\x20manifest.'];a26_0x48c5=function(){return _0x18eed4;};return a26_0x48c5();}function filterByCode(_0x9642ab,_0x1a7255){const _0x4d1f77=a26_0x208f3f,_0x276740=_0x1a7255[_0x4d1f77(0x113)]();if(!_0x276740)return _0x9642ab;return _0x9642ab[_0x4d1f77(0x138)](_0x638ceb=>_0x638ceb[_0x4d1f77(0x105)]===_0x276740);}export const skillDefinitions=[{'service':a26_0x208f3f(0x14f),'command':a26_0x208f3f(0x13e),'description':a26_0x208f3f(0x112)+CLI_BIN_NAME+a26_0x208f3f(0x12b),'risk':a26_0x208f3f(0x144),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3b72ce){const _0x11f1b8=a26_0x208f3f;logger[_0x11f1b8(0x130)](process[_0x11f1b8(0x109)]()),logger[_0x11f1b8(0x10b)](_0x11f1b8(0x14c),_0x11f1b8(0x120)+CLI_DISPLAY_NAME+_0x11f1b8(0x123));const {LOVRABET_SKILL_SOURCE:_0x3d32aa,LOVRABET_SKIP_NPX_SKILLS_ENV:_0x249db4,runNpxSkillsAddGlobal:_0x2880f2}=await import(_0x11f1b8(0x14a)),_0xb8549=_0x3b72ce['nonInteractive']?_0x11f1b8(0x10a):_0x11f1b8(0x13d);console['log'](_0x11f1b8(0x126)+_0x3d32aa+_0x11f1b8(0x151));const _0x5a5da7=_0x2880f2(process[_0x11f1b8(0x109)](),_0x3d32aa,{'stdio':_0xb8549});if(_0x5a5da7[_0x11f1b8(0x115)])console[_0x11f1b8(0x137)]('Skipped\x20npx\x20('+_0x249db4+_0x11f1b8(0x11d));else{if(_0x5a5da7['ok'])console[_0x11f1b8(0x137)](CLI_BIN_NAME+'\x20skill\x20installed');else throw CliErrors[_0x11f1b8(0x147)](_0x11f1b8(0x139)+(_0x5a5da7['error']||_0x11f1b8(0x13b)),_0x11f1b8(0x11f));}return{'ok':!![]};}},{'service':a26_0x208f3f(0x14f),'command':a26_0x208f3f(0x125),'description':a26_0x208f3f(0x13a),'risk':a26_0x208f3f(0x144),'flags':[CODE_FLAG],async 'execute'(_0x49283c){const _0x5b66b4=a26_0x208f3f,{listCompanyRuntimeSkills:_0x5b3f2f,listPersonalRuntimeSkills:_0x4bb002}=await import(_0x5b66b4(0x10d)),{linkEffectiveRuntimeSkills:_0x44f617,materializeRuntimeSkill:_0x5a94b2}=await import(_0x5b66b4(0x121)),_0x21a7b3=_0x49283c['str']('code'),_0x3b28b9=_0x49283c['envName']??_0x5b66b4(0x106),_0x578119=_0x49283c['accessKey'];if(!_0x578119)throw CliErrors[_0x5b66b4(0x134)]();const _0x37e3f9=filterByCode(await _0x4bb002(_0x49283c[_0x5b66b4(0x10f)]),_0x21a7b3),_0x588774=filterByCode(await _0x5b3f2f(_0x49283c[_0x5b66b4(0x10f)]),_0x21a7b3),_0x339409=[..._0x37e3f9[_0x5b66b4(0x114)](_0x1a6921=>_0x5a94b2(_0x1a6921,_0x5b66b4(0x12f),{'env':_0x3b28b9,'accessKey':_0x578119,'appCode':_0x49283c['appCode']})),..._0x588774[_0x5b66b4(0x114)](_0x21649e=>_0x5a94b2(_0x21649e,_0x5b66b4(0x103),{'env':_0x3b28b9,'accessKey':_0x578119,'appCode':_0x49283c[_0x5b66b4(0x10f)]}))],_0xca2ee4=_0x44f617(_0x339409,_0x49283c['appCode']),_0x308aa8=_0xca2ee4[_0x5b66b4(0x10c)]((_0x379df4,_0x22e7ff)=>{const _0x2753db=_0x5b66b4;return _0x379df4[_0x22e7ff[_0x2753db(0x122)]]=(_0x379df4[_0x22e7ff[_0x2753db(0x122)]]??0x0)+0x1,_0x379df4;},{});return{'ok':!![],'data':{'appCode':_0x49283c[_0x5b66b4(0x10f)],'personal':_0x37e3f9['length'],'company':_0x588774[_0x5b66b4(0x110)],'materialized':_0x339409[_0x5b66b4(0x110)],'links':{'total':_0xca2ee4[_0x5b66b4(0x110)],'created':_0x308aa8['created']??0x0,'updated':_0x308aa8[_0x5b66b4(0x146)]??0x0,'unchanged':_0x308aa8[_0x5b66b4(0x12e)]??0x0,'skipped':0x0,'conflicted':0x0},'skills':{'personal':_0x37e3f9[_0x5b66b4(0x114)](summarizeRuntimeSkill),'company':_0x588774['map'](summarizeRuntimeSkill)}},'message':_0x5b66b4(0x12a)+_0x37e3f9['length']+_0x5b66b4(0x132)+_0x588774[_0x5b66b4(0x110)]+_0x5b66b4(0x13f)};}},{'service':'skill','command':a26_0x208f3f(0x111),'description':a26_0x208f3f(0x131),'risk':'write','flags':[DIR_FLAG],async 'execute'(_0x227b71){const _0xc9f340=a26_0x208f3f,{createPersonalRuntimeSkill:_0x34d259,listPersonalRuntimeSkills:_0x3a87cd,updatePersonalRuntimeSkill:_0x3739d7}=await import(_0xc9f340(0x10d)),{fileTreeHash:_0x465c24,readPushDirectory:_0xa12372,recordPushedRuntimeSkill:_0x5a6161}=await import(_0xc9f340(0x121));if(!_0x227b71[_0xc9f340(0x143)])throw CliErrors[_0xc9f340(0x134)]();const _0x4ff56f=_0xa12372(_0x227b71['str'](_0xc9f340(0x14e)),_0x227b71[_0xc9f340(0x10f)]),_0x983212=(await _0x3a87cd(_0x227b71[_0xc9f340(0x10f)]))[_0xc9f340(0x142)](_0x4cab1f=>_0x4cab1f['skillCode']===_0x4ff56f['skillCode']),_0x1715ce=_0x983212?await _0x3739d7(_0x4ff56f[_0xc9f340(0x105)],_0x227b71[_0xc9f340(0x10f)],_0x4ff56f[_0xc9f340(0x140)]):await _0x34d259(_0x227b71[_0xc9f340(0x10f)],_0x4ff56f[_0xc9f340(0x140)]);return assertMultiFilePushPersisted(_0x4ff56f[_0xc9f340(0x140)][_0xc9f340(0x136)],_0x1715ce,_0x465c24),_0x5a6161(_0x227b71[_0xc9f340(0x11b)](_0xc9f340(0x14e)),_0x1715ce,_0x227b71[_0xc9f340(0x10f)]),{'ok':!![],'data':summarizeRuntimeSkill(_0x1715ce),'message':_0x983212?_0xc9f340(0x148)+_0x4ff56f[_0xc9f340(0x105)]:_0xc9f340(0x10e)+_0x4ff56f[_0xc9f340(0x105)]};}}];function assertMultiFilePushPersisted(_0x380c03,_0x2398af,_0x3a152a){const _0x910fa3=a26_0x208f3f,_0x1ce6a1=Array[_0x910fa3(0x141)](_0x380c03)&&_0x380c03['some'](_0x1eb875=>_0x1eb875[_0x910fa3(0x149)]!=='SKILL.md');if(!_0x1ce6a1)return;if(!Array[_0x910fa3(0x141)](_0x2398af[_0x910fa3(0x136)])||!_0x2398af[_0x910fa3(0x136)]['some'](_0x508420=>_0x508420[_0x910fa3(0x149)]!==_0x910fa3(0x124)))throw CliErrors[_0x910fa3(0x128)](_0x910fa3(0x127),_0x910fa3(0x12d));if(_0x3a152a(_0x380c03)!==_0x3a152a(_0x2398af[_0x910fa3(0x136)]))throw CliErrors[_0x910fa3(0x128)](_0x910fa3(0x135),_0x910fa3(0x108));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x58a816=a27_0x3e9e;(function(_0x4c842e,_0x4800d4){const _0x59b54e=a27_0x3e9e,_0x2aa5d5=_0x4c842e();while(!![]){try{const _0x4024bf=parseInt(_0x59b54e(0x16b))/0x1*(-parseInt(_0x59b54e(0x163))/0x2)+-parseInt(_0x59b54e(0x15e))/0x3*(-parseInt(_0x59b54e(0x167))/0x4)+parseInt(_0x59b54e(0x15f))/0x5+parseInt(_0x59b54e(0x161))/0x6+-parseInt(_0x59b54e(0x168))/0x7*(parseInt(_0x59b54e(0x15a))/0x8)+-parseInt(_0x59b54e(0x15b))/0x9+-parseInt(_0x59b54e(0x15d))/0xa*(-parseInt(_0x59b54e(0x162))/0xb);if(_0x4024bf===_0x4800d4)break;else _0x2aa5d5['push'](_0x2aa5d5['shift']());}catch(_0x36d08a){_0x2aa5d5['push'](_0x2aa5d5['shift']());}}}(a27_0x9067,0xea4a7));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a27_0x9067(){const _0x3e3aad=['sql','4AFoobe','12887EZVgpG','verbose','description','884463gpilIa','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','sqlCode','dbId','4112zVXyYq','5678208iyQtWa','bool','36010RcqnUJ','5176299IryQaG','4185050AYDZXG','sqlName','4721046buFOLQ','220ujAPCt','2lRGFSq','read','sqlContent'];a27_0x9067=function(){return _0x3e3aad;};return a27_0x9067();}function a27_0x3e9e(_0xb76f00,_0x102d84){_0xb76f00=_0xb76f00-0x159;const _0x906736=a27_0x9067();let _0x3e9e64=_0x906736[_0xb76f00];return _0x3e9e64;}import{SQLCODE_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a27_0x58a816(0x166),'command':'detail','description':a27_0x58a816(0x16c),'risk':a27_0x58a816(0x164),'flags':[SQLCODE_FLAG,VERBOSE_FLAG],async 'execute'(_0x138793){const _0x2126ff=a27_0x58a816,_0x200960=await getSqlQueryInfo(_0x138793['appCode'],_0x138793['str']('sqlcode')),_0x35f641=_0x138793[_0x2126ff(0x15c)](_0x2126ff(0x169));if(_0x35f641)return{'ok':!![],'data':_0x200960};const _0x4b7062=_0x200960['dbId']?await getDbName(_0x138793['appCode'],_0x200960['dbId']):undefined;return{'ok':!![],'data':{'sqlCode':_0x200960[_0x2126ff(0x16d)],'sqlName':_0x200960[_0x2126ff(0x160)],'db':_0x4b7062?_0x4b7062+'\x20('+_0x200960['dbId']+')':_0x200960[_0x2126ff(0x159)]??'','description':_0x200960[_0x2126ff(0x16a)]??'','sqlContent':_0x200960[_0x2126ff(0x165)]??''}};}};
|