@lovrabet/lovrabet-cli 2.0.8 → 2.0.9-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 -0
- 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 -0
- 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
|
-
function a16_0x397a(_0x380659,_0x3932f8){_0x380659=_0x380659-0xde;const _0x40213a=a16_0x4021();let _0x397a86=_0x40213a[_0x380659];return _0x397a86;}const a16_0x360d1c=a16_0x397a;(function(_0x353a1c,_0x5b649d){const _0x1d191a=a16_0x397a,_0x52d4ba=_0x353a1c();while(!![]){try{const _0x4a64f7=parseInt(_0x1d191a(0xf9))/0x1*(-parseInt(_0x1d191a(0x10f))/0x2)+parseInt(_0x1d191a(0xff))/0x3*(-parseInt(_0x1d191a(0xe1))/0x4)+-parseInt(_0x1d191a(0x130))/0x5*(-parseInt(_0x1d191a(0x10a))/0x6)+parseInt(_0x1d191a(0xfd))/0x7+parseInt(_0x1d191a(0x108))/0x8+parseInt(_0x1d191a(0x11f))/0x9*(parseInt(_0x1d191a(0xf6))/0xa)+-parseInt(_0x1d191a(0xe4))/0xb*(-parseInt(_0x1d191a(0xe7))/0xc);if(_0x4a64f7===_0x5b649d)break;else _0x52d4ba['push'](_0x52d4ba['shift']());}catch(_0x2f42c0){_0x52d4ba['push'](_0x52d4ba['shift']());}}}(a16_0x4021,0x19c06));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';function a16_0x4021(){const _0x243703=['body','map','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','Get\x20a\x20single\x20record\x20by\x20ID','dryRun','370JUSEyc','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','2067gOkltq','delete','getOne','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','96397hNKZgt','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','1479dHQSrO','description','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','high-risk-write','filter','\x20\x20LOGICAL\x20COMBINATORS','\x20\x20PARAMS\x20STRUCTURE','paramsRequired','build','407600qAtZVg','\x20on\x20dataset\x20','2364euPXBf','command','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','str','batchCreate','110imgnmm','\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]','Update\x20an\x20existing\x20record','read','\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}','update','data','\x20\x20WHERE\x20OPERATORS','\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','\x20completed\x20in\x20','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','3339GPJfOF','\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}}','risk','paramsHint','write','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','\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','join','data\x20','\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}}','create','\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}}','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','2050OutDbH','now','\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','\x20\x20EXAMPLES','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','444PYgtvn','POST','\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}','186439Bsfjav','aggregate','\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}','24EaUOFF','Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\x20--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','operation','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','code','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','Preview:\x20data\x20','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]'];a16_0x4021=function(){return _0x243703;};return a16_0x4021();}import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a16_0x360d1c(0x103),'operation':a16_0x360d1c(0x103),'risk':a16_0x360d1c(0x112),'paramsRequired':![],'description':'Filter\x20dataset\x20records\x20with\x20query\x20conditions','paramsHint':a16_0x360d1c(0x126)+'Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','helpExtra':[a16_0x360d1c(0x116),a16_0x360d1c(0x127),'\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}}',a16_0x360d1c(0x12b),a16_0x360d1c(0x120),'\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}',a16_0x360d1c(0x125),'\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_0x360d1c(0x124),'\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','',a16_0x360d1c(0x104),a16_0x360d1c(0xde),'\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','',a16_0x360d1c(0xfc),a16_0x360d1c(0xe0),'\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]',a16_0x360d1c(0xf0),'\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)',a16_0x360d1c(0x11b),'','\x20\x20PAGINATION',a16_0x360d1c(0xf7),a16_0x360d1c(0x11e),'\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)']['join']('\x0a')},{'command':a16_0x360d1c(0xfb),'operation':'getOne','risk':a16_0x360d1c(0x112),'paramsRequired':!![],'description':a16_0x360d1c(0xf4),'paramsHint':a16_0x360d1c(0xef)},{'command':a16_0x360d1c(0x12c),'operation':a16_0x360d1c(0x12c),'risk':a16_0x360d1c(0x123),'paramsRequired':!![],'description':a16_0x360d1c(0x12e),'paramsHint':a16_0x360d1c(0x12f)},{'command':a16_0x360d1c(0x10e),'operation':a16_0x360d1c(0x10e),'risk':a16_0x360d1c(0x123),'paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','paramsHint':a16_0x360d1c(0x101)},{'command':a16_0x360d1c(0x114),'operation':a16_0x360d1c(0x114),'risk':a16_0x360d1c(0x123),'paramsRequired':!![],'description':a16_0x360d1c(0x111),'paramsHint':a16_0x360d1c(0xf3)},{'command':a16_0x360d1c(0xfa),'operation':a16_0x360d1c(0xfa),'risk':a16_0x360d1c(0x102),'paramsRequired':!![],'description':a16_0x360d1c(0xfe),'paramsHint':a16_0x360d1c(0xef)},{'command':a16_0x360d1c(0xe5),'operation':a16_0x360d1c(0xe5),'risk':a16_0x360d1c(0x112),'paramsRequired':![],'description':a16_0x360d1c(0x11a),'paramsHint':a16_0x360d1c(0xeb)+a16_0x360d1c(0xe8),'helpExtra':['\x20\x20AGGREGATE\x20TYPES',a16_0x360d1c(0x113),a16_0x360d1c(0xe3),'\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','\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}',a16_0x360d1c(0xe6),a16_0x360d1c(0x117),'',a16_0x360d1c(0x105),a16_0x360d1c(0x110),a16_0x360d1c(0x118),a16_0x360d1c(0x10c),a16_0x360d1c(0xed),a16_0x360d1c(0x12d),a16_0x360d1c(0xf8),'',a16_0x360d1c(0xdf),'\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status',a16_0x360d1c(0x11d),'',a16_0x360d1c(0x119),a16_0x360d1c(0xe9)][a16_0x360d1c(0x129)]('\x0a')}];function makeDataCommand(_0x2eaf6d){const _0x312f2c=a16_0x360d1c,_0x4e5788='data\x20'+_0x2eaf6d[_0x312f2c(0x10b)],_0x4a2431={'service':_0x312f2c(0x115),'command':_0x2eaf6d[_0x312f2c(0x10b)],'description':_0x2eaf6d[_0x312f2c(0x100)],'risk':_0x2eaf6d[_0x312f2c(0x121)],'helpExtra':_0x2eaf6d['helpExtra'],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x2eaf6d[_0x312f2c(0x122)]}],'validate':async _0x1e0f97=>{const _0x316244=_0x312f2c;_0x2eaf6d[_0x316244(0x106)]&&requireAnyOf(_0x1e0f97,[_0x316244(0x128)],_0x4e5788),_0x2eaf6d[_0x316244(0xea)]==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x1e0f97['str'](_0x316244(0x128))));},async 'execute'(_0x139bae){const _0x34191f=_0x312f2c,_0x3cb7b0=_0x139bae[_0x34191f(0x10d)](_0x34191f(0xec)),_0x1a8763=_0x2eaf6d['operation']==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x139bae[_0x34191f(0x10d)](_0x34191f(0x128)))):parseJsonParams(_0x139bae[_0x34191f(0x10d)](_0x34191f(0x128)))??{},_0x53f32d=Date[_0x34191f(0x131)](),_0x3d0d98=await executeData(_0x3cb7b0,_0x2eaf6d['operation'],_0x1a8763),_0x5bc3d1=Date['now']()-_0x53f32d;return{'ok':!![],'data':{'result':_0x3d0d98,'elapsed':_0x5bc3d1},'message':_0x34191f(0x12a)+_0x2eaf6d['command']+_0x34191f(0x11c)+_0x5bc3d1+'ms'};}};return _0x2eaf6d[_0x312f2c(0x121)]!==_0x312f2c(0x112)&&(_0x4a2431[_0x312f2c(0xf5)]=async _0x2d2c51=>{const _0x71eee2=_0x312f2c,_0x3bf5e5=_0x2d2c51[_0x71eee2(0x10d)](_0x71eee2(0xec)),_0x114c0f=_0x2eaf6d[_0x71eee2(0xea)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x2d2c51[_0x71eee2(0x10d)](_0x71eee2(0x128)))):parseJsonParams(_0x2d2c51[_0x71eee2(0x10d)](_0x71eee2(0x128)))??{};return dryRun(_0x71eee2(0xe2),'/api/{appCode}/'+_0x3bf5e5+'/'+_0x2eaf6d[_0x71eee2(0xea)])[_0x71eee2(0xf1)](_0x114c0f)[_0x71eee2(0x100)](_0x71eee2(0xee)+_0x2eaf6d[_0x71eee2(0x10b)]+_0x71eee2(0x109)+_0x3bf5e5)[_0x71eee2(0x107)]();}),_0x4a2431;}export const dataDefinitions=specs[a16_0x360d1c(0xf2)](makeDataCommand);
|
|
1
|
+
const a16_0x32b822=a16_0x160e;(function(_0x2a8542,_0x155778){const _0x56e607=a16_0x160e,_0x2ce3d3=_0x2a8542();while(!![]){try{const _0x4528c6=parseInt(_0x56e607(0x188))/0x1+-parseInt(_0x56e607(0x180))/0x2*(-parseInt(_0x56e607(0x16d))/0x3)+parseInt(_0x56e607(0x17d))/0x4*(parseInt(_0x56e607(0x17a))/0x5)+-parseInt(_0x56e607(0x162))/0x6*(parseInt(_0x56e607(0x171))/0x7)+parseInt(_0x56e607(0x139))/0x8+parseInt(_0x56e607(0x13f))/0x9*(-parseInt(_0x56e607(0x177))/0xa)+-parseInt(_0x56e607(0x16f))/0xb;if(_0x4528c6===_0x155778)break;else _0x2ce3d3['push'](_0x2ce3d3['shift']());}catch(_0x111c45){_0x2ce3d3['push'](_0x2ce3d3['shift']());}}}(a16_0x22bb,0x915e3));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';function a16_0x160e(_0x11a944,_0x5f1d71){_0x11a944=_0x11a944-0x136;const _0x22bb71=a16_0x22bb();let _0x160e7a=_0x22bb71[_0x11a944];return _0x160e7a;}import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';function a16_0x22bb(){const _0x571316=['map','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','create','40BJXZtA','write','Update\x20an\x20existing\x20record','215uMrysB','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','params','55772XuSsFN','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','146wDscCe','body','read','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','\x20completed\x20in\x20','command','POST','getOne','209487nkHRgw','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','now','paramsRequired','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','Preview:\x20data\x20','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','7309808EbaThD','description','\x20on\x20dataset\x20','delete','operation','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','518553YczPnS','data','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20WHERE\x20OPERATORS','\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','\x20\x20PAGINATION','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','batchCreate','filter','\x20\x20AGGREGATE\x20TYPES','code','data\x20','Get\x20a\x20single\x20record\x20by\x20ID','build','\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','join','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20field\x20values\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','\x20\x20LOGICAL\x20COMBINATORS','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','helpExtra','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Post-aggregation\x20filter,\x20e.g.\x20{\x22total\x22:{\x22$gt\x22:1000}}','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','str','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','risk','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','24vgSbql','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','\x20\x20PARAMS\x20STRUCTURE','update','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}','/api/{appCode}/','aggregate','dryRun','45105LfoegR','Filter\x20dataset\x20records\x20with\x20query\x20conditions','15414366hEBiZt','high-risk-write','1037953pJrdAo','paramsHint','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]'];a16_0x22bb=function(){return _0x571316;};return a16_0x22bb();}import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a16_0x32b822(0x148),'operation':a16_0x32b822(0x148),'risk':a16_0x32b822(0x182),'paramsRequired':![],'description':a16_0x32b822(0x16e),'paramsHint':a16_0x32b822(0x17e)+a16_0x32b822(0x15f),'helpExtra':[a16_0x32b822(0x142),a16_0x32b822(0x169),'\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}',a16_0x32b822(0x183),a16_0x32b822(0x14f),a16_0x32b822(0x143),a16_0x32b822(0x136),a16_0x32b822(0x14e),'\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','',a16_0x32b822(0x158),a16_0x32b822(0x146),a16_0x32b822(0x159),'',a16_0x32b822(0x166),'\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)',a16_0x32b822(0x173),a16_0x32b822(0x17b),a16_0x32b822(0x168),'\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','',a16_0x32b822(0x144),'\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.',a16_0x32b822(0x163),'\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)'][a16_0x32b822(0x155)]('\x0a')},{'command':a16_0x32b822(0x187),'operation':a16_0x32b822(0x187),'risk':a16_0x32b822(0x182),'paramsRequired':!![],'description':a16_0x32b822(0x14c),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a16_0x32b822(0x176),'operation':a16_0x32b822(0x176),'risk':'write','paramsRequired':!![],'description':'Create\x20a\x20new\x20record\x20in\x20a\x20dataset','paramsHint':a16_0x32b822(0x161)},{'command':a16_0x32b822(0x147),'operation':a16_0x32b822(0x147),'risk':'write','paramsRequired':!![],'description':a16_0x32b822(0x150),'paramsHint':'JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27'},{'command':'update','operation':a16_0x32b822(0x165),'risk':a16_0x32b822(0x178),'paramsRequired':!![],'description':a16_0x32b822(0x179),'paramsHint':a16_0x32b822(0x153)},{'command':a16_0x32b822(0x13c),'operation':a16_0x32b822(0x13c),'risk':a16_0x32b822(0x170),'paramsRequired':!![],'description':'Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','paramsHint':a16_0x32b822(0x156)},{'command':'aggregate','operation':a16_0x32b822(0x16b),'risk':a16_0x32b822(0x182),'paramsRequired':![],'description':a16_0x32b822(0x138),'paramsHint':a16_0x32b822(0x189)+'Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','helpExtra':[a16_0x32b822(0x149),a16_0x32b822(0x157),a16_0x32b822(0x145),a16_0x32b822(0x18c),'\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}',a16_0x32b822(0x13e),a16_0x32b822(0x152),a16_0x32b822(0x15a),'',a16_0x32b822(0x164),a16_0x32b822(0x167),a16_0x32b822(0x17f),a16_0x32b822(0x175),a16_0x32b822(0x141),a16_0x32b822(0x15c),a16_0x32b822(0x137),'','\x20\x20EXAMPLES',a16_0x32b822(0x15d),a16_0x32b822(0x151),'',a16_0x32b822(0x154),'\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27'][a16_0x32b822(0x155)]('\x0a')}];function makeDataCommand(_0x10a5c4){const _0x273b15=a16_0x32b822,_0x5837e6=_0x273b15(0x14b)+_0x10a5c4[_0x273b15(0x185)],_0x5af5aa={'service':_0x273b15(0x140),'command':_0x10a5c4[_0x273b15(0x185)],'description':_0x10a5c4['description'],'risk':_0x10a5c4[_0x273b15(0x160)],'helpExtra':_0x10a5c4[_0x273b15(0x15b)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x10a5c4[_0x273b15(0x172)]}],'validate':async _0x589b21=>{const _0x3c0859=_0x273b15;_0x10a5c4[_0x3c0859(0x18b)]&&requireAnyOf(_0x589b21,[_0x3c0859(0x17c)],_0x5837e6),_0x10a5c4['operation']===_0x3c0859(0x147)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x589b21[_0x3c0859(0x15e)]('params')));},async 'execute'(_0x4debdc){const _0x52bbfa=_0x273b15,_0x121476=_0x4debdc[_0x52bbfa(0x15e)](_0x52bbfa(0x14a)),_0x3593e2=_0x10a5c4['operation']==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x4debdc[_0x52bbfa(0x15e)](_0x52bbfa(0x17c)))):parseJsonParams(_0x4debdc[_0x52bbfa(0x15e)](_0x52bbfa(0x17c)))??{},_0x1b3515=Date[_0x52bbfa(0x18a)](),_0x3b36c4=await executeData(_0x121476,_0x10a5c4['operation'],_0x3593e2),_0x597893=Date['now']()-_0x1b3515;return{'ok':!![],'data':{'result':_0x3b36c4,'elapsed':_0x597893},'message':_0x52bbfa(0x14b)+_0x10a5c4[_0x52bbfa(0x185)]+_0x52bbfa(0x184)+_0x597893+'ms'};}};return _0x10a5c4[_0x273b15(0x160)]!==_0x273b15(0x182)&&(_0x5af5aa[_0x273b15(0x16c)]=async _0x3342f1=>{const _0x147b98=_0x273b15,_0x477bec=_0x3342f1['str'](_0x147b98(0x14a)),_0x195cc8=_0x10a5c4['operation']===_0x147b98(0x147)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x3342f1['str']('params'))):parseJsonParams(_0x3342f1[_0x147b98(0x15e)]('params'))??{};return dryRun(_0x147b98(0x186),_0x147b98(0x16a)+_0x477bec+'/'+_0x10a5c4[_0x147b98(0x13d)])[_0x147b98(0x181)](_0x195cc8)[_0x147b98(0x13a)](_0x147b98(0x18d)+_0x10a5c4['command']+_0x147b98(0x13b)+_0x477bec)[_0x147b98(0x14d)]();}),_0x5af5aa;}export const dataDefinitions=specs[a16_0x32b822(0x174)](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a17_0x28111a=a17_0x3f19;(function(_0x1f5ca2,_0x49fbec){const _0x3974b0=a17_0x3f19,_0x3b569f=_0x1f5ca2();while(!![]){try{const _0x2bf425=parseInt(_0x3974b0(0x180))/0x1*(-parseInt(_0x3974b0(0x1a4))/0x2)+-parseInt(_0x3974b0(0x1b1))/0x3*(-parseInt(_0x3974b0(0x16a))/0x4)+-parseInt(_0x3974b0(0x192))/0x5*(-parseInt(_0x3974b0(0x1a9))/0x6)+-parseInt(_0x3974b0(0x18e))/0x7*(-parseInt(_0x3974b0(0x1aa))/0x8)+-parseInt(_0x3974b0(0x188))/0x9+parseInt(_0x3974b0(0x1a2))/0xa+-parseInt(_0x3974b0(0x184))/0xb;if(_0x2bf425===_0x49fbec)break;else _0x3b569f['push'](_0x3b569f['shift']());}catch(_0x356f19){_0x3b569f['push'](_0x3b569f['shift']());}}}(a17_0x1549,0x39f2e));import{getDatasetDetail}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x3a6b15){const _0x1d0f83=a17_0x3f19;if(_0x3a6b15[_0x1d0f83(0x177)])return null;const _0x25d5e5=Boolean(_0x3a6b15[_0x1d0f83(0x1a8)]!==undefined||_0x3a6b15[_0x1d0f83(0x183)]!==undefined);let _0x2528e5={};if(!_0x25d5e5&&typeof _0x3a6b15[_0x1d0f83(0x194)]===_0x1d0f83(0x17a))try{_0x2528e5=JSON['parse'](_0x3a6b15[_0x1d0f83(0x194)]);}catch{}const _0x79f013=_0x25d5e5?_0x3a6b15[_0x1d0f83(0x167)]:_0x3a6b15['code'],_0x313240=_0x25d5e5?_0x3a6b15['displayName']:_0x3a6b15[_0x1d0f83(0x167)],_0x28702e=_0x25d5e5?_0x3a6b15[_0x1d0f83(0x183)]:_0x3a6b15[_0x1d0f83(0x1ad)]||_0x3a6b15[_0x1d0f83(0x1ac)],_0x16ff0b=_0x25d5e5?_0x3a6b15['pkField']===!![]:_0x2528e5['pkField']===!![],_0x3319ab=_0x25d5e5?_0x3a6b15[_0x1d0f83(0x16f)]===!![]:_0x2528e5[_0x1d0f83(0x16f)]===!![],_0x31350f=_0x25d5e5?_0x3a6b15[_0x1d0f83(0x1a5)]??null:_0x2528e5[_0x1d0f83(0x1a5)]??null,_0x573f09={'name':_0x79f013,'displayName':_0x313240||_0x79f013,'type':_0x28702e,'dbType':_0x3a6b15[_0x1d0f83(0x189)],'pk':_0x16ff0b,'required':_0x3319ab,'description':_0x3a6b15[_0x1d0f83(0x1ae)]||undefined};return Array[_0x1d0f83(0x166)](_0x31350f)&&_0x31350f[_0x1d0f83(0x187)]>0x0&&(_0x573f09[_0x1d0f83(0x1a5)]=_0x31350f),_0x573f09;}function a17_0x3f19(_0x460705,_0x1eb5c2){_0x460705=_0x460705-0x166;const _0x154955=a17_0x1549();let _0x3f1964=_0x154955[_0x460705];return _0x3f1964;}function parseJsonMaybe(_0x10a404){const _0x1b59b8=a17_0x3f19;if(typeof _0x10a404!==_0x1b59b8(0x17a))return _0x10a404;try{return JSON[_0x1b59b8(0x16e)](_0x10a404);}catch{return _0x10a404;}}function normalizeOperationEntry(_0x312729,_0x2c46eb){const _0x3c7bae=a17_0x3f19;if(!_0x2c46eb||typeof _0x2c46eb!==_0x3c7bae(0x1b2))return null;if(!_0x2c46eb['method']||!_0x2c46eb[_0x3c7bae(0x1a7)])return null;const _0x45d741={'name':_0x312729,'method':_0x2c46eb[_0x3c7bae(0x176)],'path':_0x2c46eb['path']};if(_0x2c46eb[_0x3c7bae(0x168)])_0x45d741[_0x3c7bae(0x168)]=_0x2c46eb[_0x3c7bae(0x168)];if(_0x2c46eb[_0x3c7bae(0x175)]!=null)_0x45d741['requestBody']=parseJsonMaybe(_0x2c46eb[_0x3c7bae(0x175)]);if(_0x2c46eb[_0x3c7bae(0x1a0)]!=null)_0x45d741['responseBody']=parseJsonMaybe(_0x2c46eb['responseBody']);if(_0x2c46eb[_0x3c7bae(0x19c)]!=null)_0x45d741[_0x3c7bae(0x19c)]=_0x2c46eb['beforeScriptId'];if(_0x2c46eb[_0x3c7bae(0x169)]!=null)_0x45d741[_0x3c7bae(0x169)]=_0x2c46eb[_0x3c7bae(0x169)];if(Array[_0x3c7bae(0x166)](_0x2c46eb['requestFields']))_0x45d741['requestFields']=_0x2c46eb['requestFields'];if(Array[_0x3c7bae(0x166)](_0x2c46eb['responseFields']))_0x45d741[_0x3c7bae(0x1af)]=_0x2c46eb[_0x3c7bae(0x1af)];return _0x45d741;}function summarizeDbtable(_0x485f0d){const _0x43244b=a17_0x3f19,_0x2f002e={},_0x7c3f0a=[_0x43244b(0x197),'dbName',_0x43244b(0x18d),_0x43244b(0x19d),_0x43244b(0x19e),'allFields',_0x43244b(0x190),'createTimeField','updateTimeField',_0x43244b(0x172),_0x43244b(0x170),_0x43244b(0x18f),_0x43244b(0x182),_0x43244b(0x19b),'dblinkInfoDTO'];for(const _0x14433c of _0x7c3f0a){if(_0x485f0d[_0x14433c]!==undefined)_0x2f002e[_0x14433c]=_0x485f0d[_0x14433c];}return typeof _0x2f002e[_0x43244b(0x1a1)]===_0x43244b(0x17a)&&_0x2f002e[_0x43244b(0x1a1)]['length']>0x0&&(_0x2f002e['allFieldNames']=_0x2f002e['allFields']['split'](',')['map'](_0x58a7ca=>_0x58a7ca['trim']())[_0x43244b(0x193)](Boolean)),_0x2f002e;}function normalizeRelatedPages(_0x2dcf93){const _0x45bdeb=a17_0x3f19;if(!Array['isArray'](_0x2dcf93))return[];return _0x2dcf93['filter'](_0x45a340=>_0x45a340&&typeof _0x45a340==='object')[_0x45bdeb(0x18a)](_0x38d6b7=>({'id':_0x38d6b7['id'],'type':_0x38d6b7[_0x45bdeb(0x1ad)],'code':_0x38d6b7[_0x45bdeb(0x198)],'title':_0x38d6b7[_0x45bdeb(0x16b)],'deleted':_0x38d6b7[_0x45bdeb(0x177)]===!![]}));}export const datasetDetail={'service':a17_0x28111a(0x16d),'command':a17_0x28111a(0x18c),'description':a17_0x28111a(0x185),'risk':a17_0x28111a(0x17f),'flags':[CODE_FLAG],async 'execute'(_0x1a2dd0){const _0xc1dc6a=a17_0x28111a,_0x2f36de=await getDatasetDetail(_0x1a2dd0[_0xc1dc6a(0x19a)](_0xc1dc6a(0x198))),_0x4cb23a=Array[_0xc1dc6a(0x166)](_0x2f36de[_0xc1dc6a(0x196)])?_0x2f36de[_0xc1dc6a(0x196)]:Array[_0xc1dc6a(0x166)](_0x2f36de[_0xc1dc6a(0x1ab)])?_0x2f36de['properties']:[],_0x3fc9be=_0x4cb23a[_0xc1dc6a(0x18a)](_0x3c937a=>normalizeField(_0x3c937a))[_0xc1dc6a(0x193)](_0xde1340=>_0xde1340!==null),_0x22653b=_0x2f36de[_0xc1dc6a(0x17b)]??{},_0x3666a3=[];for(const [_0x57480d,_0x406e30]of Object[_0xc1dc6a(0x173)](_0x22653b)){const _0x136b27=normalizeOperationEntry(_0x57480d,_0x406e30);if(_0x136b27)_0x3666a3[_0xc1dc6a(0x186)](_0x136b27);}const _0x435de1=_0x2f36de[_0xc1dc6a(0x1a6)]??{},_0xb4b65=_0x2f36de['dataset']??{},_0x3656fa=_0x435de1[_0xc1dc6a(0x197)]!=null?{'id':_0x435de1[_0xc1dc6a(0x197)],'name':_0x435de1[_0xc1dc6a(0x191)]??null}:undefined;let _0x1cff64;return typeof _0x2f36de[_0xc1dc6a(0x194)]===_0xc1dc6a(0x17a)&&(_0x1cff64=parseJsonMaybe(_0x2f36de[_0xc1dc6a(0x194)])),{'ok':!![],'data':{'id':_0x2f36de[_0xc1dc6a(0x18b)]??_0x2f36de['id'],'name':_0x2f36de[_0xc1dc6a(0x167)],'code':_0x2f36de[_0xc1dc6a(0x17e)]||_0x2f36de[_0xc1dc6a(0x198)],'doVersion':_0x2f36de[_0xc1dc6a(0x1a3)],'description':_0x2f36de[_0xc1dc6a(0x1ae)]||_0xb4b65[_0xc1dc6a(0x1b0)]||undefined,'source':_0x2f36de[_0xc1dc6a(0x199)]||_0xb4b65[_0xc1dc6a(0x16c)],'table':_0x435de1['tableName']||_0xb4b65['tableName'],'datasetKey':_0x435de1[_0xc1dc6a(0x19d)],'pk':_0x435de1[_0xc1dc6a(0x19e)],'db':_0x3656fa,'dbtable':summarizeDbtable(_0x435de1),'fields':_0x3fc9be,'operations':_0x3666a3,'indexes':Array[_0xc1dc6a(0x166)](_0xb4b65['indexes'])?_0xb4b65[_0xc1dc6a(0x178)]:[],'relations':Array[_0xc1dc6a(0x166)](_0x2f36de[_0xc1dc6a(0x179)])?_0x2f36de[_0xc1dc6a(0x179)][_0xc1dc6a(0x18a)](_0x434c84=>({'fromField':_0x434c84[_0xc1dc6a(0x19f)],'toDataset':_0x434c84['toDatasetName'],'toCode':_0x434c84[_0xc1dc6a(0x17d)],'toTable':_0x434c84['toTableName'],'toField':_0x434c84['toField'],'labelField':_0x434c84[_0xc1dc6a(0x174)]||undefined})):[],'relatedPages':normalizeRelatedPages(_0x2f36de[_0xc1dc6a(0x171)]),...Array['isArray'](_0x2f36de['columnCodeListWithDeleted'])?{'columnCodeListWithDeleted':_0x2f36de[_0xc1dc6a(0x17c)]}:{},'formatRules':Array['isArray'](_0x2f36de[_0xc1dc6a(0x195)])?_0x2f36de['formatRules']:[],'validateRules':Array[_0xc1dc6a(0x166)](_0x2f36de[_0xc1dc6a(0x181)])?_0x2f36de[_0xc1dc6a(0x181)]:[],..._0x1cff64!==undefined?{'extend':_0x1cff64}:{},'stats':{'fieldCount':_0x3fc9be[_0xc1dc6a(0x187)],'operationCount':_0x3666a3[_0xc1dc6a(0x187)]}}};}};function a17_0x1549(){const _0x9ba289=['read','276NzGWyf','validateRules','modifierNameField','doType','389158AtUpdq','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','push','length','213498cLhRtS','dbType','map','modelId','detail','tableName','14BxqGfO','modifierIdField','logicField','dbName','217945Fyxadx','filter','extend','formatRules','fields','dbId','code','source','str','labelField','beforeScriptId','datasetKey','pkField','fromField','responseBody','allFields','571380MQhBjq','doVersion','2020LYrOKN','options','dbtableConfig','path','displayName','36HIYTmb','586072RElLFd','properties','dataType','type','description','responseFields','tableComment','1038rQpeMu','object','isArray','name','host','afterScriptId','1272OBsjcP','title','sourceType','dataset','parse','required','creatorNameField','relatedPageInfoList','creatorIdField','entries','toFieldLabel','requestBody','method','deleted','indexes','relations','string','operations','columnCodeListWithDeleted','toDatasetCode','modelCode'];a17_0x1549=function(){return _0x9ba289;};return a17_0x1549();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a18_0x26f8(){const _0x5261f7=['8oemdyn','423954ltbATA','470442nGYRAJ','7fJKbmH','3060574lOZdnG','8520HtRpkX','2qUkdOZ','528900dHcLZf','84DYHUrj','1782198PdNwyP','1233183ucOPwg'];a18_0x26f8=function(){return _0x5261f7;};return a18_0x26f8();}(function(_0x1d8f21,_0x276d9a){const _0x40458c=a18_0x58b4,_0x1f70b3=_0x1d8f21();while(!![]){try{const _0x1b5c29=-parseInt(_0x40458c(0x13c))/0x1+parseInt(_0x40458c(0x140))/0x2*(parseInt(_0x40458c(0x144))/0x3)+-parseInt(_0x40458c(0x142))/0x4*(parseInt(_0x40458c(0x13f))/0x5)+-parseInt(_0x40458c(0x13b))/0x6*(-parseInt(_0x40458c(0x13d))/0x7)+-parseInt(_0x40458c(0x13a))/0x8*(-parseInt(_0x40458c(0x143))/0x9)+-parseInt(_0x40458c(0x141))/0xa+parseInt(_0x40458c(0x13e))/0xb;if(_0x1b5c29===_0x276d9a)break;else _0x1f70b3['push'](_0x1f70b3['shift']());}catch(_0x3b1ccc){_0x1f70b3['push'](_0x1f70b3['shift']());}}}(a18_0x26f8,0x6160c));import{datasetList}from'../../commands/dataset/list.js';function a18_0x58b4(_0x4b8b14,_0x2f5c47){_0x4b8b14=_0x4b8b14-0x13a;const _0x26f829=a18_0x26f8();let _0x58b4bb=_0x26f829[_0x4b8b14];return _0x58b4bb;}import{datasetDetail}from'../../commands/dataset/detail.js';export const datasetDefinitions=[datasetList,datasetDetail];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0xcfcacd=a19_0x3ab6;(function(_0x5a815e,_0x17a193){const _0x295482=a19_0x3ab6,_0x22169c=_0x5a815e();while(!![]){try{const _0x9b4577=-parseInt(_0x295482(0x1e7))/0x1*(parseInt(_0x295482(0x1d9))/0x2)+parseInt(_0x295482(0x1e9))/0x3*(parseInt(_0x295482(0x1e1))/0x4)+-parseInt(_0x295482(0x1d5))/0x5*(-parseInt(_0x295482(0x1e8))/0x6)+parseInt(_0x295482(0x1df))/0x7+-parseInt(_0x295482(0x1dc))/0x8*(parseInt(_0x295482(0x1d8))/0x9)+-parseInt(_0x295482(0x1d7))/0xa+parseInt(_0x295482(0x1e2))/0xb*(parseInt(_0x295482(0x1eb))/0xc);if(_0x9b4577===_0x17a193)break;else _0x22169c['push'](_0x22169c['shift']());}catch(_0x5cbddf){_0x22169c['push'](_0x22169c['shift']());}}}(a19_0x4c31,0x5b294));import{listDatasets}from'../../core/api-client.js';function a19_0x3ab6(_0x241810,_0x3df775){_0x241810=_0x241810-0x1d1;const _0x4c31c2=a19_0x4c31();let _0x3ab636=_0x4c31c2[_0x241810];return _0x3ab636;}function a19_0x4c31(){const _0x6dd570=['3524388wNefBM','pkField','string','list','code','1414775QlKcTM','allFields','4489160yzVotN','184122JaHpVE','1028CmSdhh','name','appCode','248oWrxLG','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','split','4209779INjfRy','dbtableConfig','856NuXQoy','11KsYSBI','length','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','map','trim','219PRLAKG','12BsUaIa','1515YQuRyE','read'];a19_0x4c31=function(){return _0x6dd570;};return a19_0x4c31();}import{CODE_FLAG}from'../../commands/common/flags.js';export const datasetList={'service':'dataset','command':a19_0xcfcacd(0x1d3),'description':a19_0xcfcacd(0x1dd),'risk':a19_0xcfcacd(0x1ea),'flags':[{'name':a19_0xcfcacd(0x1da),'type':a19_0xcfcacd(0x1d2),'description':'Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)'},{...CODE_FLAG,'required':![],'description':a19_0xcfcacd(0x1e4)}],async 'execute'(_0x28cb4e){const _0x91a0a2=a19_0xcfcacd,_0x11c9fe=_0x28cb4e['str'](_0x91a0a2(0x1da)),_0x443126=_0x28cb4e['str'](_0x91a0a2(0x1d4)),_0x323055=await listDatasets(_0x28cb4e[_0x91a0a2(0x1db)],{..._0x11c9fe&&{'name':_0x11c9fe},..._0x443126&&{'code':_0x443126}});return{'ok':!![],'data':{'total':_0x323055[_0x91a0a2(0x1e3)],'datasets':_0x323055[_0x91a0a2(0x1e5)](_0x15b1e0=>{const _0x2a565a=_0x91a0a2,_0x2f9246=_0x15b1e0[_0x2a565a(0x1e0)]??{};return{'id':_0x15b1e0['id'],'code':_0x15b1e0[_0x2a565a(0x1d4)],'name':_0x15b1e0[_0x2a565a(0x1da)],'source':_0x15b1e0['source'],'description':_0x15b1e0['description'],'table':_0x2f9246['tableName'],'datasetKey':_0x2f9246['datasetKey'],'pk':_0x2f9246[_0x2a565a(0x1d1)],'fields':_0x2f9246[_0x2a565a(0x1d6)]?_0x2f9246[_0x2a565a(0x1d6)][_0x2a565a(0x1de)](',')['map'](_0x2e95ca=>_0x2e95ca[_0x2a565a(0x1e6)]()):[]};})}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a20_0x48f903=a20_0x49fe;(function(_0x479011,_0x543260){const _0x1bba2a=a20_0x49fe,_0x4dd72e=_0x479011();while(!![]){try{const _0x19ad9a=-parseInt(_0x1bba2a(0x1d0))/0x1*(parseInt(_0x1bba2a(0x1fe))/0x2)+parseInt(_0x1bba2a(0x1ed))/0x3*(parseInt(_0x1bba2a(0x208))/0x4)+-parseInt(_0x1bba2a(0x1ee))/0x5*(parseInt(_0x1bba2a(0x1ef))/0x6)+parseInt(_0x1bba2a(0x1d1))/0x7*(parseInt(_0x1bba2a(0x209))/0x8)+parseInt(_0x1bba2a(0x1cc))/0x9*(parseInt(_0x1bba2a(0x204))/0xa)+-parseInt(_0x1bba2a(0x1d5))/0xb*(-parseInt(_0x1bba2a(0x20e))/0xc)+parseInt(_0x1bba2a(0x1e4))/0xd*(-parseInt(_0x1bba2a(0x1e2))/0xe);if(_0x19ad9a===_0x543260)break;else _0x4dd72e['push'](_0x4dd72e['shift']());}catch(_0x12c736){_0x4dd72e['push'](_0x4dd72e['shift']());}}}(a20_0x483e,0x86dd6));import a20_0x3624cf 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_0x483e(){const _0x5c2431=['(missing)','(default:\x20','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','read','(not\x20set)','2198gYKoRR','bold','181779zLzmBA','defaultApp','\x20\x20Session\x20check:\x20\x20\x20','empty','\x20\x20─','gray','riskLevel','\x20\x20Auth','\x20(legacy/compat\x20only)','3HfsnfH','5JAwsMn','337566WeKlak','doctor','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','currentApp','yellow','ClientAk','appCode','Project','(default)','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','version','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','green','2tQdzHG','(removed\x20—\x20cookie\x20auth\x20disabled)','locale','verbose','(none)','red','180pfZfsR','\x20doctor','\x20\x20API\x20Endpoints','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','3375404uzGJlJ','7220496aNcAGD','✓\x20Valid\x20JSON','platform','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','34932UyysqY','527805bdIcON','pageSize','(no\x20file)','repeat','24224PIDbcO','7eCpHZF','check','padEnd','\x20(accessKey)','99KlaXan','\x20\x20auth\x20(effective):\x20','log','arch','(not\x20found)','accessKey','status','\x20\x20Merged\x20Config'];a20_0x483e=function(){return _0x5c2431;};return a20_0x483e();}function a20_0x49fe(_0x2edef1,_0x9472f9){_0x2edef1=_0x2edef1-0x1cc;const _0x483e0f=a20_0x483e();let _0x49fe4a=_0x483e0f[_0x2edef1];return _0x49fe4a;}import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';async function execute(_0x4782c7){const _0x11a90c=a20_0x49fe,_0x5db9da=getCliVersion(),_0x531c43=buildConfigFromFlags({});await initGlobalEnvironment(_0x531c43),console[_0x11a90c(0x1d7)](),console[_0x11a90c(0x1d7)](a20_0x3624cf['bold'](CLI_BIN_NAME+_0x11a90c(0x205))),console[_0x11a90c(0x1d7)](a20_0x3624cf[_0x11a90c(0x1e9)]('─'[_0x11a90c(0x1cf)](0x32))),console[_0x11a90c(0x1d7)](_0x11a90c(0x1f2)+_0x5db9da),console['log']('\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+process[_0x11a90c(0x1fb)]),console['log']('\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20'+process[_0x11a90c(0x20b)]+'\x20'+process[_0x11a90c(0x1d8)]),console[_0x11a90c(0x1d7)](),console[_0x11a90c(0x1d7)](a20_0x3624cf[_0x11a90c(0x1e3)]('\x20\x20Config\x20Files')),console['log'](a20_0x3624cf[_0x11a90c(0x1e9)](_0x11a90c(0x1e8)[_0x11a90c(0x1cf)](0x1e)));const _0x17827e=getGlobalConfigPath(),_0x4b3f97=getProjectConfigPath();console['log']('\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x17827e||a20_0x3624cf[_0x11a90c(0x1e9)]('(not\x20found)'))),console[_0x11a90c(0x1d7)]('\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x4b3f97||a20_0x3624cf[_0x11a90c(0x1e9)](_0x11a90c(0x1d9)))),console['log'](),console['log'](a20_0x3624cf[_0x11a90c(0x1e3)]('\x20\x20Config\x20JSON')),console['log'](a20_0x3624cf[_0x11a90c(0x1e9)](_0x11a90c(0x1e8)[_0x11a90c(0x1cf)](0x1e)));const _0x261e50=(_0x233370,_0x4ef913)=>{const _0x4f25d9=_0x11a90c;if(!_0x4ef913){console['log']('\x20\x20'+_0x233370['padEnd'](0x11)+'\x20'+a20_0x3624cf[_0x4f25d9(0x1e9)](_0x4f25d9(0x1ce)));return;}const _0x24fd53=inspectCliConfigJsonFile(_0x4ef913);if(_0x24fd53[_0x4f25d9(0x1db)]==='ok')console[_0x4f25d9(0x1d7)]('\x20\x20'+_0x233370[_0x4f25d9(0x1d3)](0x11)+'\x20'+a20_0x3624cf[_0x4f25d9(0x1fd)](_0x4f25d9(0x20a)));else{if(_0x24fd53[_0x4f25d9(0x1db)]===_0x4f25d9(0x1e7))console[_0x4f25d9(0x1d7)]('\x20\x20'+_0x233370['padEnd'](0x11)+'\x20'+a20_0x3624cf[_0x4f25d9(0x1f4)]('⚠\x20Empty\x20(treated\x20as\x20{})'));else _0x24fd53[_0x4f25d9(0x1db)]==='missing'?console[_0x4f25d9(0x1d7)]('\x20\x20'+_0x233370[_0x4f25d9(0x1d3)](0x11)+'\x20'+a20_0x3624cf[_0x4f25d9(0x1e9)](_0x4f25d9(0x1dd))):(console['log']('\x20\x20'+_0x233370[_0x4f25d9(0x1d3)](0x11)+'\x20'+a20_0x3624cf[_0x4f25d9(0x203)]('✗\x20Invalid\x20JSON')),console['log']('\x20\x20'+''[_0x4f25d9(0x1d3)](0x11)+'\x20'+a20_0x3624cf[_0x4f25d9(0x203)](_0x24fd53['message'])));}};_0x261e50('Global',_0x17827e),_0x261e50(_0x11a90c(0x1f7),_0x4b3f97),console['log'](),console[_0x11a90c(0x1d7)](a20_0x3624cf[_0x11a90c(0x1e3)](_0x11a90c(0x1dc))),console[_0x11a90c(0x1d7)](a20_0x3624cf['gray'](_0x11a90c(0x1e8)[_0x11a90c(0x1cf)](0x1e))),console[_0x11a90c(0x1d7)](_0x11a90c(0x1df)+(_0x531c43[_0x11a90c(0x1f6)]||a20_0x3624cf[_0x11a90c(0x203)](_0x11a90c(0x1e1)))),console[_0x11a90c(0x1d7)]('\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x531c43['env']);const _0x1ba6fd=isLegacyCompatConfigKey('locale')?a20_0x3624cf['gray'](_0x531c43[_0x11a90c(0x200)]+_0x11a90c(0x1ec)):_0x531c43[_0x11a90c(0x200)];return console['log']('\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x1ba6fd),console[_0x11a90c(0x1d7)]('\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20'+(_0x531c43[_0x11a90c(0x1e5)]||a20_0x3624cf[_0x11a90c(0x1e9)](_0x11a90c(0x202)))),console['log'](_0x11a90c(0x1fa)+(_0x531c43[_0x11a90c(0x1f3)]||a20_0x3624cf[_0x11a90c(0x1e9)](_0x11a90c(0x202)))),console[_0x11a90c(0x1d7)](_0x11a90c(0x20c)+(_0x531c43['format']||a20_0x3624cf[_0x11a90c(0x1e9)](_0x11a90c(0x1de)+DEFAULT_CONFIG_VALUES['format']+')'))),console[_0x11a90c(0x1d7)](_0x11a90c(0x1fc)+(_0x531c43[_0x11a90c(0x1cd)]??a20_0x3624cf[_0x11a90c(0x1e9)](_0x11a90c(0x1f8)))),console[_0x11a90c(0x1d7)]('\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20'+_0x531c43[_0x11a90c(0x1ea)]),console[_0x11a90c(0x1d7)](_0x11a90c(0x207)+_0x531c43[_0x11a90c(0x201)]),console[_0x11a90c(0x1d7)](_0x11a90c(0x1d6)+AUTH_MODE[_0x11a90c(0x1f5)]),console[_0x11a90c(0x1d7)](_0x11a90c(0x20d)+(_0x531c43[_0x11a90c(0x1da)]?a20_0x3624cf[_0x11a90c(0x1fd)]('(set,\x20length='+_0x531c43[_0x11a90c(0x1da)]['length']+')'):a20_0x3624cf['gray'](_0x11a90c(0x202)))),console[_0x11a90c(0x1d7)](),console[_0x11a90c(0x1d7)](a20_0x3624cf[_0x11a90c(0x1e3)](_0x11a90c(0x206))),console[_0x11a90c(0x1d7)](a20_0x3624cf[_0x11a90c(0x1e9)](_0x11a90c(0x1e8)[_0x11a90c(0x1cf)](0x1e))),console[_0x11a90c(0x1d7)]('\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20'+getApiDomain()),console[_0x11a90c(0x1d7)](_0x11a90c(0x1f1)+getUserDomain()),console['log']('\x20\x20runtimeDomain:\x20\x20\x20'+getRuntimeDomain()),console[_0x11a90c(0x1d7)](),console[_0x11a90c(0x1d7)](a20_0x3624cf[_0x11a90c(0x1e3)](_0x11a90c(0x1eb))),console['log'](a20_0x3624cf['gray'](_0x11a90c(0x1e8)[_0x11a90c(0x1cf)](0x1e))),console['log'](_0x11a90c(0x1f9)+a20_0x3624cf['green'](AUTH_MODE[_0x11a90c(0x1f5)]+_0x11a90c(0x1d4))),console[_0x11a90c(0x1d7)](_0x11a90c(0x1e6)+a20_0x3624cf['gray'](_0x11a90c(0x1ff))),console[_0x11a90c(0x1d7)](),{'ok':!![]};}export const doctorDefinition={'service':a20_0x48f903(0x1f0),'command':a20_0x48f903(0x1d2),'description':'Diagnose\x20CLI\x20configuration\x20and\x20environment','risk':a20_0x48f903(0x1e0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a21_0x478fda=a21_0xfd6c;(function(_0x47d74b,_0x364372){const _0x556385=a21_0xfd6c,_0x4215ae=_0x47d74b();while(!![]){try{const _0xd3be00=parseInt(_0x556385(0xe0))/0x1*(parseInt(_0x556385(0x103))/0x2)+-parseInt(_0x556385(0xd9))/0x3*(-parseInt(_0x556385(0x10b))/0x4)+parseInt(_0x556385(0x112))/0x5+parseInt(_0x556385(0x110))/0x6+-parseInt(_0x556385(0x108))/0x7*(parseInt(_0x556385(0x115))/0x8)+-parseInt(_0x556385(0x111))/0x9+parseInt(_0x556385(0xd8))/0xa*(-parseInt(_0x556385(0xec))/0xb);if(_0xd3be00===_0x364372)break;else _0x4215ae['push'](_0x4215ae['shift']());}catch(_0x297ed7){_0x4215ae['push'](_0x4215ae['shift']());}}}(a21_0x2180,0xbe736));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a21_0x478fda(0xf1),'type':'string','description':a21_0x478fda(0x11c)},{'name':a21_0x478fda(0xdf),'type':a21_0x478fda(0xf3),'description':a21_0x478fda(0xe6)+DEFAULT_CONFIG_VALUES[a21_0x478fda(0xdf)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x478fda(0xe4),'type':a21_0x478fda(0xfc),'description':a21_0x478fda(0x118)+PRODUCT_CONFIG[a21_0x478fda(0xd6)]+a21_0x478fda(0xda),'default':![]},{'name':a21_0x478fda(0x117),'type':'boolean','description':a21_0x478fda(0xf9),'default':![]}];export const initImportFlagDefs=[{'name':a21_0x478fda(0xd7),'type':a21_0x478fda(0xf3),'description':a21_0x478fda(0xf5),'required':!![]},{'name':a21_0x478fda(0xf1),'type':'string','description':a21_0x478fda(0xea)},{'name':a21_0x478fda(0xdf),'type':a21_0x478fda(0xf3),'description':a21_0x478fda(0x104),'enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x478fda(0xe4),'type':a21_0x478fda(0xfc),'description':a21_0x478fda(0x118)+PRODUCT_CONFIG[a21_0x478fda(0xd6)]+a21_0x478fda(0xda),'default':![]},{'name':'yes','type':a21_0x478fda(0xfc),'description':a21_0x478fda(0xf9),'default':![]}];export async function runInit(_0x30d95f){const _0x2e18c7=a21_0x478fda,_0x233fe7=isNonInteractiveMode(_0x30d95f),_0x5228a7=_0x30d95f[_0x2e18c7(0xe4)]?_0x2e18c7(0xe4):_0x2e18c7(0xdb),_0x4023a3=resolveWriteConfigPath(_0x5228a7);try{_0x233fe7?await runNonInteractive(_0x30d95f,_0x4023a3):await runInteractive(_0x30d95f,_0x4023a3);}catch(_0x44780c){if(_0x44780c instanceof AbortPrompt)throw CliErrors[_0x2e18c7(0x11a)]();throw _0x44780c;}}export async function runInitImport(_0x377ec4){const _0x409f5e=a21_0x478fda,_0x4ecd52=_0x377ec4['global']?_0x409f5e(0xe4):'project',_0x1bc5e8=resolveWriteConfigPath(_0x4ecd52);await runFromImport(_0x377ec4,_0x1bc5e8);}const RUNTIME_IRRELEVANT_KEYS=new Set(['apiDir']);async function runFromImport(_0x36c806,_0x5f2dfb){const _0x347879=a21_0x478fda,_0x40905a=resolveFilePath(_0x36c806['file']);if(!existsSync(_0x40905a))throw CliErrors[_0x347879(0x116)](_0x347879(0x101)+_0x40905a);const _0x1bef9c=readSourceFile(_0x40905a),_0x5161c2=convertToRuntimeConfig(_0x1bef9c);_0x36c806[_0x347879(0xf1)]&&(_0x5161c2[_0x347879(0xf1)]=String(_0x36c806[_0x347879(0xf1)]));_0x36c806[_0x347879(0xdf)]&&(_0x5161c2[_0x347879(0xdf)]=resolveInitEnv(_0x36c806));if(!_0x5161c2['appcode'])throw CliErrors[_0x347879(0x116)](_0x347879(0x113),_0x347879(0x10a));await writeInitConfig(_0x5f2dfb,_0x5161c2,_0x36c806),console[_0x347879(0xf6)]('Imported\x20from\x20'+_0x40905a),console[_0x347879(0xf6)](_0x347879(0xee)+_0x5f2dfb),console['log'](_0x347879(0x100)+_0x5161c2['appcode']);if(_0x5161c2[_0x347879(0x11b)])console[_0x347879(0xf6)](_0x347879(0xfd)+_0x5161c2[_0x347879(0x11b)]);}function convertToRuntimeConfig(_0x44fb78){const _0x26ee78=a21_0x478fda;if(_0x44fb78[_0x26ee78(0xef)]&&typeof _0x44fb78[_0x26ee78(0xef)]===_0x26ee78(0x10f))throw CliErrors[_0x26ee78(0x116)]('Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x234bf3={};for(const _0x1737c6 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x44fb78[_0x1737c6]!==undefined&&(_0x234bf3[_0x1737c6]=_0x44fb78[_0x1737c6]);}return!_0x234bf3['riskLevel']&&(_0x234bf3[_0x26ee78(0xdc)]=DEFAULT_CONFIG_VALUES[_0x26ee78(0xdc)]),_0x234bf3;}async function runNonInteractive(_0xaa1ff7,_0x173827){const _0x554597=a21_0x478fda,_0xd05bb=_0xaa1ff7['appcode'];if(!_0xd05bb)throw CliErrors['flagMissing'](_0x554597(0xf1),_0x554597(0x10d)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x274654=resolveInitEnv(_0xaa1ff7);await writeInitConfig(_0x173827,{'appcode':_0xd05bb,'env':_0x274654},_0xaa1ff7),console[_0x554597(0xf6)]('Initialized\x20'+_0x173827),console['log'](_0x554597(0x100)+_0xd05bb),console[_0x554597(0xf6)](_0x554597(0xff)+_0x274654);}function a21_0xfd6c(_0x2ef46e,_0x2a0e99){_0x2ef46e=_0x2ef46e-0xd6;const _0x2180b0=a21_0x2180();let _0xfd6ce4=_0x2180b0[_0x2ef46e];return _0xfd6ce4;}async function runInteractive(_0x37b379,_0x3f7d87){const _0x5a384f=a21_0x478fda,_0xd6c2a6=loadExisting(_0x3f7d87),_0x23b744=typeof _0xd6c2a6?.['appcode']===_0x5a384f(0xf3)?_0xd6c2a6[_0x5a384f(0xf1)]:'',_0x3fb439=resolveInitEnv(_0x37b379);console[_0x5a384f(0xf6)](CLI_BIN_NAME+_0x5a384f(0x107)+PRODUCT_CONFIG[_0x5a384f(0xd6)]+'\x0a');if(existsSync(_0x3f7d87)&&!_0x37b379[_0x5a384f(0x117)]){const _0x2ef231=await promptYesNo('File\x20'+_0x3f7d87+_0x5a384f(0xe8),![]);if(!_0x2ef231){console[_0x5a384f(0xf6)](_0x5a384f(0xe9));return;}}const _0x541632=typeof _0x37b379[_0x5a384f(0xf1)]==='string'?_0x37b379['appcode']['trim']():'';let _0x447aae=_0x541632;!_0x447aae&&(_0x447aae=await promptInput(_0x5a384f(0xf8),_0x23b744));if(!_0x447aae[_0x5a384f(0xe5)]())throw CliErrors[_0x5a384f(0x116)](_0x5a384f(0xdd));await writeInitConfig(_0x3f7d87,{'appcode':_0x447aae[_0x5a384f(0xe5)](),'env':_0x3fb439},_0x37b379),console[_0x5a384f(0xf6)](_0x5a384f(0xf0)+_0x3f7d87),console[_0x5a384f(0xf6)](_0x5a384f(0x100)+_0x447aae[_0x5a384f(0xe5)]()),console['log']('\x20\x20env:\x20\x20\x20\x20\x20'+_0x3fb439);}function a21_0x2180(){const _0x1f626d=['7968sAaNpJ','validation','yes','Write\x20to\x20global\x20(~/','includes','cancelled','defaultApp','App\x20code\x20for\x20the\x20project','newConfigFileName','file','10wHWrRs','3kbOcDt',')\x20instead\x20of\x20project','project','riskLevel','App\x20code\x20cannot\x20be\x20empty.','stdin','env','368249hQOdyG','removeListener','cwd','SIGINT','global','trim','Target\x20environment\x20(default\x20','parse','\x20already\x20exists.\x20Overwrite?','Aborted.','Override\x20imported\x20default\x20appcode','Failed\x20to\x20parse\x20source\x20file:\x20','13372843QsJBBL','Invalid\x20env\x20\x22','\x20\x20config:\x20\x20','apps','\x0aInitialized\x20','appcode','toLowerCase','string','once','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','log','close','App\x20code','Skip\x20confirmation\x20when\x20overwriting','name','question','boolean','\x20\x20default:\x20','entries','\x20\x20env:\x20\x20\x20\x20\x20','\x20\x20appcode:\x20','Source\x20file\x20not\x20found:\x20','utf8','6yqNdzj','Override\x20imported\x20default\x20env','app','[y/N]','\x20init\x20—\x20Create\x20','9191DpqIyU','[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`.','2906216RBEoNS','stdout','Usage:\x20','message','object','5954148jSjuLj','3586941FpBVEI','4392185fgMEJv','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','):\x20'];a21_0x2180=function(){return _0x1f626d;};return a21_0x2180();}async function writeInitConfig(_0x1b49e3,_0x3fd89a,_0x35bdb5){const _0x138063=a21_0x478fda;let _0x3535c5={};existsSync(_0x1b49e3)&&!_0x35bdb5['yes']&&(_0x3535c5=readConfigFile(_0x1b49e3));for(const [_0x3fc1cf,_0x21cbc7]of Object[_0x138063(0xfe)](_0x3fd89a)){_0x21cbc7!==undefined&&(_0x3535c5[_0x3fc1cf]=_0x21cbc7);}if(_0x3535c5[_0x138063(0x105)])delete _0x3535c5[_0x138063(0x105)];writeConfigFile(_0x1b49e3,_0x3535c5);}class AbortPrompt extends Error{constructor(){const _0x590c71=a21_0x478fda;super('User\x20aborted\x20prompt'),this[_0x590c71(0xfa)]='AbortPrompt';}}function createSafeRl(){const _0x161523=a21_0x478fda,_0x53efb6=createInterface({'input':process[_0x161523(0xde)],'output':process[_0x161523(0x10c)]});let _0x32a631;const _0x265704=new Promise((_0x1bb6a7,_0x346863)=>{const _0x3c9838=_0x161523;_0x32a631=()=>{const _0x5d7c5d=a21_0xfd6c;_0x32a631&&(_0x53efb6[_0x5d7c5d(0xe1)](_0x5d7c5d(0xe3),_0x32a631),_0x32a631=undefined);try{_0x53efb6[_0x5d7c5d(0xf7)]();}catch{}_0x346863(new AbortPrompt());},_0x53efb6[_0x3c9838(0xf4)]('SIGINT',_0x32a631);}),_0x4da660=()=>{const _0x32ad7a=_0x161523;_0x32a631&&(_0x53efb6['removeListener'](_0x32ad7a(0xe3),_0x32a631),_0x32a631=undefined);try{_0x53efb6[_0x32ad7a(0xf7)]();}catch{}};return{'rl':_0x53efb6,'abortPromise':_0x265704,'disposeSuccess':_0x4da660};}async function promptInput(_0x5a93e7,_0x28abbb){const {rl:_0x46de9f,abortPromise:_0x2677d8,disposeSuccess:_0x361676}=createSafeRl(),_0x451f66=new Promise(_0x4376ba=>{const _0x554c2c=a21_0xfd6c,_0x33cc80=_0x28abbb?'\x20\x20'+_0x5a93e7+'\x20('+_0x28abbb+_0x554c2c(0x114):'\x20\x20'+_0x5a93e7+':\x20';_0x46de9f[_0x554c2c(0xfb)](_0x33cc80,_0x275782=>{_0x361676(),_0x4376ba(_0x275782['trim']()||_0x28abbb);});});return Promise['race']([_0x451f66,_0x2677d8]);}async function promptYesNo(_0x7d7c60,_0xbf71fe){const {rl:_0x5e8476,abortPromise:_0x13c072,disposeSuccess:_0x4608f5}=createSafeRl(),_0x2f4ea7=new Promise(_0x442ce5=>{const _0x2cb14b=a21_0xfd6c,_0x1318a9=_0xbf71fe?_0x2cb14b(0x109):_0x2cb14b(0x106);_0x5e8476[_0x2cb14b(0xfb)]('\x20\x20'+_0x7d7c60+'\x20'+_0x1318a9+':\x20',_0x1fd15a=>{const _0x1e1db6=_0x2cb14b;_0x4608f5();const _0x328db1=_0x1fd15a[_0x1e1db6(0xe5)]()[_0x1e1db6(0xf2)]();if(_0x328db1==='y'||_0x328db1===_0x1e1db6(0x117))_0x442ce5(!![]);else{if(_0x328db1==='n'||_0x328db1==='no')_0x442ce5(![]);else _0x442ce5(_0xbf71fe);}});});return Promise['race']([_0x2f4ea7,_0x13c072]);}function loadExisting(_0x29ae64){if(!existsSync(_0x29ae64))return null;return readConfigFile(_0x29ae64);}function resolveFilePath(_0x2cd26e){const _0x22a45d=a21_0x478fda;return isAbsolute(_0x2cd26e)?_0x2cd26e:resolve(process[_0x22a45d(0xe2)](),_0x2cd26e);}function readSourceFile(_0x57c694){const _0x12e9e2=a21_0x478fda;try{const _0x43a84b=readFileSync(_0x57c694,{'encoding':_0x12e9e2(0x102)});return JSON[_0x12e9e2(0xe7)](_0x43a84b);}catch(_0x42f1e3){throw CliErrors[_0x12e9e2(0x116)](_0x12e9e2(0xeb)+_0x42f1e3[_0x12e9e2(0x10e)]);}}function resolveInitEnv(_0x53cf05){const _0x5463cb=a21_0x478fda,_0x47a430=_0x53cf05[_0x5463cb(0xdf)];if(_0x47a430===undefined||_0x47a430==='')return DEFAULT_CONFIG_VALUES[_0x5463cb(0xdf)];if(!RUNTIME_ENV_VALUES[_0x5463cb(0x119)](_0x47a430))throw CliErrors[_0x5463cb(0x116)](_0x5463cb(0xed)+_0x47a430+'\x22.\x20Allowed:\x20'+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x47a430;}
|
|
1
|
+
const a21_0x4cc5c0=a21_0x4989;(function(_0x57f017,_0x5e33a3){const _0x394fe0=a21_0x4989,_0x15ff09=_0x57f017();while(!![]){try{const _0x48d3d1=-parseInt(_0x394fe0(0x141))/0x1*(-parseInt(_0x394fe0(0x130))/0x2)+parseInt(_0x394fe0(0x13b))/0x3*(-parseInt(_0x394fe0(0x156))/0x4)+parseInt(_0x394fe0(0x12d))/0x5*(-parseInt(_0x394fe0(0x161))/0x6)+-parseInt(_0x394fe0(0x12c))/0x7+-parseInt(_0x394fe0(0x139))/0x8*(-parseInt(_0x394fe0(0x13e))/0x9)+parseInt(_0x394fe0(0x168))/0xa*(-parseInt(_0x394fe0(0x163))/0xb)+parseInt(_0x394fe0(0x15c))/0xc;if(_0x48d3d1===_0x5e33a3)break;else _0x15ff09['push'](_0x15ff09['shift']());}catch(_0xf93689){_0x15ff09['push'](_0x15ff09['shift']());}}}(a21_0x21a1,0x238c1));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';function a21_0x21a1(){const _0x3f3e6b=['apiDir','race','apps','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','removeListener','Invalid\x20env\x20\x22','\x0aInitialized\x20','validation','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','question','entries','newConfigFileName','App\x20code','8fPaznV','boolean','Failed\x20to\x20parse\x20source\x20file:\x20','[y/N]','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','3526032yHjrHu','message','yes','\x20\x20appcode:\x20','name','25446lLfoOr','object','2409bIKOgI','\x20init\x20—\x20Create\x20','):\x20','once','string','530VNqTje','riskLevel','Usage:\x20','flagMissing','stdin','Aborted.','env','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','\x20\x20env:\x20\x20\x20\x20\x20','1098601kqOAsa','85vqnGdd','[Y/n]','log','578fvbisl','\x20\x20default:\x20','Override\x20imported\x20default\x20appcode','Imported\x20from\x20','appcode','global','File\x20','file','trim','15448GfJLef','project','401535AeUKQU',')\x20instead\x20of\x20project','Override\x20imported\x20default\x20env','1017RcMsaV','close','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','491eRErri','cwd','app','Write\x20to\x20global\x20(~/','defaultApp','\x22.\x20Allowed:\x20','SIGINT','utf8'];a21_0x21a1=function(){return _0x3f3e6b;};return a21_0x21a1();}import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';function a21_0x4989(_0x4c3b12,_0x1e889c){_0x4c3b12=_0x4c3b12-0x127;const _0x21a106=a21_0x21a1();let _0x4989df=_0x21a106[_0x4c3b12];return _0x4989df;}import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a21_0x4cc5c0(0x134),'type':a21_0x4cc5c0(0x167),'description':'App\x20code\x20for\x20the\x20project'},{'name':a21_0x4cc5c0(0x129),'type':a21_0x4cc5c0(0x167),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES[a21_0x4cc5c0(0x129)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x4cc5c0(0x135),'type':a21_0x4cc5c0(0x157),'description':a21_0x4cc5c0(0x144)+PRODUCT_CONFIG[a21_0x4cc5c0(0x154)]+a21_0x4cc5c0(0x13c),'default':![]},{'name':'yes','type':a21_0x4cc5c0(0x157),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':a21_0x4cc5c0(0x137),'type':a21_0x4cc5c0(0x167),'description':a21_0x4cc5c0(0x14c),'required':!![]},{'name':a21_0x4cc5c0(0x134),'type':a21_0x4cc5c0(0x167),'description':a21_0x4cc5c0(0x132)},{'name':'env','type':a21_0x4cc5c0(0x167),'description':a21_0x4cc5c0(0x13d),'enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x4cc5c0(0x135),'type':'boolean','description':a21_0x4cc5c0(0x144)+PRODUCT_CONFIG[a21_0x4cc5c0(0x154)]+a21_0x4cc5c0(0x13c),'default':![]},{'name':a21_0x4cc5c0(0x15e),'type':a21_0x4cc5c0(0x157),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x1db3f9){const _0x17baab=a21_0x4cc5c0,_0x652324=isNonInteractiveMode(_0x1db3f9),_0x4ceba8=_0x1db3f9['global']?_0x17baab(0x135):_0x17baab(0x13a),_0x213c72=resolveWriteConfigPath(_0x4ceba8);try{_0x652324?await runNonInteractive(_0x1db3f9,_0x213c72):await runInteractive(_0x1db3f9,_0x213c72);}catch(_0x1c1871){if(_0x1c1871 instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0x1c1871;}}export async function runInitImport(_0x3a9b92){const _0x4174f2=a21_0x4cc5c0,_0x1b5836=_0x3a9b92[_0x4174f2(0x135)]?_0x4174f2(0x135):_0x4174f2(0x13a),_0x1bb914=resolveWriteConfigPath(_0x1b5836);await runFromImport(_0x3a9b92,_0x1bb914);}const RUNTIME_IRRELEVANT_KEYS=new Set([a21_0x4cc5c0(0x149)]);async function runFromImport(_0xcb103d,_0x161b59){const _0x1690c5=a21_0x4cc5c0,_0x306067=resolveFilePath(_0xcb103d[_0x1690c5(0x137)]);if(!existsSync(_0x306067))throw CliErrors[_0x1690c5(0x150)]('Source\x20file\x20not\x20found:\x20'+_0x306067);const _0x8d648f=readSourceFile(_0x306067),_0x42e470=convertToRuntimeConfig(_0x8d648f);_0xcb103d[_0x1690c5(0x134)]&&(_0x42e470[_0x1690c5(0x134)]=String(_0xcb103d[_0x1690c5(0x134)]));_0xcb103d['env']&&(_0x42e470[_0x1690c5(0x129)]=resolveInitEnv(_0xcb103d));if(!_0x42e470[_0x1690c5(0x134)])throw CliErrors['validation'](_0x1690c5(0x140),_0x1690c5(0x15b));await writeInitConfig(_0x161b59,_0x42e470,_0xcb103d),console['log'](_0x1690c5(0x133)+_0x306067),console[_0x1690c5(0x12f)]('\x20\x20config:\x20\x20'+_0x161b59),console[_0x1690c5(0x12f)](_0x1690c5(0x15f)+_0x42e470['appcode']);if(_0x42e470[_0x1690c5(0x145)])console[_0x1690c5(0x12f)](_0x1690c5(0x131)+_0x42e470[_0x1690c5(0x145)]);}function convertToRuntimeConfig(_0x51763d){const _0x4c5a67=a21_0x4cc5c0;if(_0x51763d[_0x4c5a67(0x14b)]&&typeof _0x51763d['apps']===_0x4c5a67(0x162))throw CliErrors[_0x4c5a67(0x150)](_0x4c5a67(0x12a),_0x4c5a67(0x15a));const _0x32b8df={};for(const _0x1b7dce of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x51763d[_0x1b7dce]!==undefined&&(_0x32b8df[_0x1b7dce]=_0x51763d[_0x1b7dce]);}return!_0x32b8df[_0x4c5a67(0x169)]&&(_0x32b8df['riskLevel']=DEFAULT_CONFIG_VALUES['riskLevel']),_0x32b8df;}async function runNonInteractive(_0x408514,_0x19d643){const _0x4f3898=a21_0x4cc5c0,_0x571135=_0x408514['appcode'];if(!_0x571135)throw CliErrors[_0x4f3898(0x16b)](_0x4f3898(0x134),_0x4f3898(0x16a)+CLI_BIN_NAME+_0x4f3898(0x151));const _0x3dabae=resolveInitEnv(_0x408514);await writeInitConfig(_0x19d643,{'appcode':_0x571135,'env':_0x3dabae},_0x408514),console[_0x4f3898(0x12f)]('Initialized\x20'+_0x19d643),console[_0x4f3898(0x12f)](_0x4f3898(0x15f)+_0x571135),console[_0x4f3898(0x12f)](_0x4f3898(0x12b)+_0x3dabae);}async function runInteractive(_0x13e9c1,_0x36f319){const _0x790032=a21_0x4cc5c0,_0x417be5=loadExisting(_0x36f319),_0x5e0a44=typeof _0x417be5?.[_0x790032(0x134)]==='string'?_0x417be5['appcode']:'',_0xdd2dc7=resolveInitEnv(_0x13e9c1);console[_0x790032(0x12f)](CLI_BIN_NAME+_0x790032(0x164)+PRODUCT_CONFIG[_0x790032(0x154)]+'\x0a');if(existsSync(_0x36f319)&&!_0x13e9c1['yes']){const _0x12bafd=await promptYesNo(_0x790032(0x136)+_0x36f319+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x12bafd){console[_0x790032(0x12f)](_0x790032(0x128));return;}}const _0x2276aa=typeof _0x13e9c1[_0x790032(0x134)]===_0x790032(0x167)?_0x13e9c1[_0x790032(0x134)][_0x790032(0x138)]():'';let _0x1182ae=_0x2276aa;!_0x1182ae&&(_0x1182ae=await promptInput(_0x790032(0x155),_0x5e0a44));if(!_0x1182ae[_0x790032(0x138)]())throw CliErrors[_0x790032(0x150)]('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x36f319,{'appcode':_0x1182ae[_0x790032(0x138)](),'env':_0xdd2dc7},_0x13e9c1),console[_0x790032(0x12f)](_0x790032(0x14f)+_0x36f319),console['log'](_0x790032(0x15f)+_0x1182ae['trim']()),console['log'](_0x790032(0x12b)+_0xdd2dc7);}async function writeInitConfig(_0xe1c443,_0x57b595,_0x48ccf4){const _0x165d9d=a21_0x4cc5c0;let _0x4cd3f7={};existsSync(_0xe1c443)&&!_0x48ccf4[_0x165d9d(0x15e)]&&(_0x4cd3f7=readConfigFile(_0xe1c443));for(const [_0x3655db,_0x371d1f]of Object[_0x165d9d(0x153)](_0x57b595)){_0x371d1f!==undefined&&(_0x4cd3f7[_0x3655db]=_0x371d1f);}if(_0x4cd3f7['app'])delete _0x4cd3f7[_0x165d9d(0x143)];writeConfigFile(_0xe1c443,_0x4cd3f7);}class AbortPrompt extends Error{constructor(){const _0x5bca39=a21_0x4cc5c0;super('User\x20aborted\x20prompt'),this[_0x5bca39(0x160)]='AbortPrompt';}}function createSafeRl(){const _0x4c5895=a21_0x4cc5c0,_0x278e3c=createInterface({'input':process[_0x4c5895(0x127)],'output':process['stdout']});let _0x367280;const _0x2ffebc=new Promise((_0x20d890,_0x4855f8)=>{const _0x299b81=_0x4c5895;_0x367280=()=>{const _0x31ddd8=a21_0x4989;_0x367280&&(_0x278e3c[_0x31ddd8(0x14d)](_0x31ddd8(0x147),_0x367280),_0x367280=undefined);try{_0x278e3c[_0x31ddd8(0x13f)]();}catch{}_0x4855f8(new AbortPrompt());},_0x278e3c[_0x299b81(0x166)](_0x299b81(0x147),_0x367280);}),_0x35224c=()=>{const _0x15c57=_0x4c5895;_0x367280&&(_0x278e3c[_0x15c57(0x14d)]('SIGINT',_0x367280),_0x367280=undefined);try{_0x278e3c['close']();}catch{}};return{'rl':_0x278e3c,'abortPromise':_0x2ffebc,'disposeSuccess':_0x35224c};}async function promptInput(_0x4841ad,_0x43b006){const _0x59d176=a21_0x4cc5c0,{rl:_0x231a2f,abortPromise:_0x5f07fa,disposeSuccess:_0x4e78a7}=createSafeRl(),_0x2a0832=new Promise(_0x131692=>{const _0x370399=a21_0x4989,_0x53bccc=_0x43b006?'\x20\x20'+_0x4841ad+'\x20('+_0x43b006+_0x370399(0x165):'\x20\x20'+_0x4841ad+':\x20';_0x231a2f[_0x370399(0x152)](_0x53bccc,_0x108df5=>{const _0x395464=_0x370399;_0x4e78a7(),_0x131692(_0x108df5[_0x395464(0x138)]()||_0x43b006);});});return Promise[_0x59d176(0x14a)]([_0x2a0832,_0x5f07fa]);}async function promptYesNo(_0x5cfef2,_0x4b458a){const _0x4d375e=a21_0x4cc5c0,{rl:_0x10139a,abortPromise:_0x4a663b,disposeSuccess:_0x1ad355}=createSafeRl(),_0x2a1db1=new Promise(_0x4e458b=>{const _0x226ba7=a21_0x4989,_0x4d797d=_0x4b458a?_0x226ba7(0x12e):_0x226ba7(0x159);_0x10139a[_0x226ba7(0x152)]('\x20\x20'+_0x5cfef2+'\x20'+_0x4d797d+':\x20',_0x345451=>{const _0xbf24=_0x226ba7;_0x1ad355();const _0x226a2c=_0x345451[_0xbf24(0x138)]()['toLowerCase']();if(_0x226a2c==='y'||_0x226a2c==='yes')_0x4e458b(!![]);else{if(_0x226a2c==='n'||_0x226a2c==='no')_0x4e458b(![]);else _0x4e458b(_0x4b458a);}});});return Promise[_0x4d375e(0x14a)]([_0x2a1db1,_0x4a663b]);}function loadExisting(_0x271321){if(!existsSync(_0x271321))return null;return readConfigFile(_0x271321);}function resolveFilePath(_0x16cfc1){const _0x138221=a21_0x4cc5c0;return isAbsolute(_0x16cfc1)?_0x16cfc1:resolve(process[_0x138221(0x142)](),_0x16cfc1);}function readSourceFile(_0x2810ff){const _0x54c377=a21_0x4cc5c0;try{const _0x4a0541=readFileSync(_0x2810ff,{'encoding':_0x54c377(0x148)});return JSON['parse'](_0x4a0541);}catch(_0x1204b0){throw CliErrors[_0x54c377(0x150)](_0x54c377(0x158)+_0x1204b0[_0x54c377(0x15d)]);}}function resolveInitEnv(_0xa05c9){const _0x544634=a21_0x4cc5c0,_0x1c2b7a=_0xa05c9[_0x544634(0x129)];if(_0x1c2b7a===undefined||_0x1c2b7a==='')return DEFAULT_CONFIG_VALUES[_0x544634(0x129)];if(!RUNTIME_ENV_VALUES['includes'](_0x1c2b7a))throw CliErrors[_0x544634(0x150)](_0x544634(0x14e)+_0x1c2b7a+_0x544634(0x146)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x1c2b7a;}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a22_0x4dac3c=a22_0x3999;(function(_0x436160,_0x378112){const _0x1549c7=a22_0x3999,_0x3bec34=_0x436160();while(!![]){try{const _0x59a798=-parseInt(_0x1549c7(0x207))/0x1+-parseInt(_0x1549c7(0x209))/0x2*(parseInt(_0x1549c7(0x1f6))/0x3)+-parseInt(_0x1549c7(0x1ec))/0x4+-parseInt(_0x1549c7(0x206))/0x5+-parseInt(_0x1549c7(0x20a))/0x6*(parseInt(_0x1549c7(0x1f8))/0x7)+parseInt(_0x1549c7(0x200))/0x8*(parseInt(_0x1549c7(0x218))/0x9)+parseInt(_0x1549c7(0x204))/0xa;if(_0x59a798===_0x378112)break;else _0x3bec34['push'](_0x3bec34['shift']());}catch(_0x1e192e){_0x3bec34['push'](_0x3bec34['shift']());}}}(a22_0x1fc9,0xafae6));function a22_0x3999(_0x140290,_0x20447d){_0x140290=_0x140290-0x1ea;const _0x1fc993=a22_0x1fc9();let _0x39990c=_0x1fc993[_0x140290];return _0x39990c;}import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a22_0x4dac3c(0x21f),'type':a22_0x4dac3c(0x223),'required':!![],'description':a22_0x4dac3c(0x20f)},FILE_FLAG={'name':a22_0x4dac3c(0x221),'type':a22_0x4dac3c(0x223),'required':!![],'description':'Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file'},QUERY_FLAG={'name':a22_0x4dac3c(0x215),'type':a22_0x4dac3c(0x223),'required':!![],'description':'Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge'},TOPK_FLAG={'name':'topk','type':a22_0x4dac3c(0x20d),'description':a22_0x4dac3c(0x201)};function readKnowledgeFile(_0x2dd81a){const _0x580103=a22_0x4dac3c;if(!_0x2dd81a)throw CliErrors[_0x580103(0x1f7)](_0x580103(0x1fa));if(!existsSync(_0x2dd81a))throw CliErrors[_0x580103(0x1f7)]('File\x20not\x20found:\x20'+_0x2dd81a);if(!statSync(_0x2dd81a)[_0x580103(0x213)]())throw CliErrors[_0x580103(0x1f7)](_0x580103(0x210)+_0x2dd81a);return readFileSync(_0x2dd81a,_0x580103(0x1f3));}function summarizePersonalItem(_0x5089a5){const _0x2725e5=a22_0x4dac3c;return{'id':_0x5089a5['id'],'title':_0x5089a5[_0x2725e5(0x21f)],'version':_0x5089a5[_0x2725e5(0x217)],'ragStatus':_0x5089a5['ragStatus'],'ragErrorMessage':_0x5089a5[_0x2725e5(0x228)],'updateTime':_0x5089a5[_0x2725e5(0x203)]};}function detailPersonalItem(_0x4381fe){const _0x2c4098=a22_0x4dac3c;return{'id':_0x4381fe['id'],'appCode':_0x4381fe['appCode'],'scope':_0x4381fe[_0x2c4098(0x1ed)],'userId':_0x4381fe[_0x2c4098(0x21c)],'title':_0x4381fe[_0x2c4098(0x21f)],'content':_0x4381fe['content']??'','version':_0x4381fe['version'],'ragStatus':_0x4381fe[_0x2c4098(0x20e)],'ragErrorMessage':_0x4381fe[_0x2c4098(0x228)],'createTime':_0x4381fe[_0x2c4098(0x1f0)],'updateTime':_0x4381fe[_0x2c4098(0x203)]};}function summarizeSearchHit(_0x1e444f){const _0x33650e=a22_0x4dac3c;return{'scope':_0x1e444f[_0x33650e(0x1ed)],'docId':_0x1e444f[_0x33650e(0x224)],'score':_0x1e444f[_0x33650e(0x212)],'weightedScore':_0x1e444f['weightedScore'],'content':_0x1e444f['content'],'metadata':_0x1e444f[_0x33650e(0x1f1)]};}function readTopK(_0x13f9d1){const _0x210288=a22_0x4dac3c,_0x829a07=_0x13f9d1['flag'](_0x210288(0x229));if(_0x829a07===undefined||_0x829a07===null||_0x829a07==='')return undefined;const _0x177a60=_0x13f9d1[_0x210288(0x219)](_0x210288(0x229));if(!Number[_0x210288(0x1f5)](_0x177a60)||_0x177a60<0x1)throw CliErrors[_0x210288(0x1f7)](_0x210288(0x1fb));return _0x177a60;}function a22_0x1fc9(){const _0x427238=['1935311umHGZl','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','File\x20path\x20is\x20required.','--topk\x20must\x20be\x20a\x20positive\x20number.','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','Created\x20KB\x20entry\x20','bool','create','2975512rvWsuv','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','write','updateTime','31239630SpBJIH','Updated\x20KB\x20entry\x20','1332495mPQHLf','894203qMgQxY','/update','290vYfCqj','24PoZjXf','verbose','body','number','ragStatus','Personal\x20knowledge-base\x20entry\x20title','File\x20is\x20not\x20a\x20regular\x20file:\x20','appCode','score','isFile','/client/knowledge-base/personal/','query','description','version','9PZdRwh','num','build','Personal\x20knowledge-base\x20entry\x20ID','userId','str','read','title','detail','file','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','string','docId','/client/knowledge-base/personal/create','POST','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','ragErrorMessage','topk','length','update','list','search','1824272fsnLSB','scope','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','Override\x20the\x20existing\x20entry\x20title','createTime','metadata','map','utf8','trim','isFinite','1110mrYySJ','validation'];a22_0x1fc9=function(){return _0x427238;};return a22_0x1fc9();}const kbList={'service':'kb','command':a22_0x4dac3c(0x1ea),'description':'List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0x3ec368){const _0x278f94=a22_0x4dac3c,_0x234704=await listPersonalKnowledgeBaseItems(_0x3ec368[_0x278f94(0x211)]);if(_0x3ec368[_0x278f94(0x1fe)](_0x278f94(0x20b)))return{'ok':!![],'data':{'total':_0x234704[_0x278f94(0x22a)],'items':_0x234704}};return{'ok':!![],'data':{'total':_0x234704[_0x278f94(0x22a)],'items':_0x234704[_0x278f94(0x1f2)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a22_0x4dac3c(0x220),'description':a22_0x4dac3c(0x1f9),'risk':a22_0x4dac3c(0x21e),'flags':[{...ID_FLAG,'description':a22_0x4dac3c(0x21b)}],async 'execute'(_0xead808){const _0x3b812f=a22_0x4dac3c,_0x442738=await getPersonalKnowledgeBaseItem(_0xead808[_0x3b812f(0x219)]('id'),_0xead808[_0x3b812f(0x211)]);return{'ok':!![],'data':detailPersonalItem(_0x442738)};}},kbCreate={'service':'kb','command':a22_0x4dac3c(0x1ff),'description':a22_0x4dac3c(0x1ee),'risk':a22_0x4dac3c(0x202),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x2496da){const _0x654c56=a22_0x4dac3c,_0x4fb3e6=_0x2496da['str'](_0x654c56(0x21f)),_0x21e732=readKnowledgeFile(_0x2496da[_0x654c56(0x21d)]('file')),_0x494f65=await createPersonalKnowledgeBaseItem(_0x2496da['appCode'],{'title':_0x4fb3e6,'content':_0x21e732});return{'ok':!![],'data':summarizePersonalItem(_0x494f65),'message':_0x654c56(0x1fd)+_0x494f65['id']+'\x20('+_0x494f65[_0x654c56(0x21f)]+')'};},async 'dryRun'(_0x967b58){const _0x508475=a22_0x4dac3c,_0x5af661=_0x967b58[_0x508475(0x21d)](_0x508475(0x21f)),_0x2ec714=readKnowledgeFile(_0x967b58[_0x508475(0x21d)](_0x508475(0x221)));return dryRun(_0x508475(0x226),_0x508475(0x225))['body']({'appCode':_0x967b58[_0x508475(0x211)],'title':_0x5af661,'content':_0x2ec714})[_0x508475(0x216)](_0x508475(0x222)+_0x5af661+'\x22')[_0x508475(0x21a)]();}},kbUpdate={'service':'kb','command':a22_0x4dac3c(0x22b),'description':'Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','risk':a22_0x4dac3c(0x202),'flags':[{...ID_FLAG,'description':a22_0x4dac3c(0x21b)},{...TITLE_FLAG,'required':![],'description':a22_0x4dac3c(0x1ef)},FILE_FLAG],async 'execute'(_0x1f491c){const _0x53507c=a22_0x4dac3c,_0xfb3990=_0x1f491c[_0x53507c(0x219)]('id'),_0x5f5bf9=readKnowledgeFile(_0x1f491c[_0x53507c(0x21d)](_0x53507c(0x221))),_0x4debc3=_0x1f491c[_0x53507c(0x21d)](_0x53507c(0x21f))||(await getPersonalKnowledgeBaseItem(_0xfb3990,_0x1f491c[_0x53507c(0x211)]))['title'],_0x5b40ba=await updatePersonalKnowledgeBaseItem(_0xfb3990,_0x1f491c[_0x53507c(0x211)],{'title':_0x4debc3,'content':_0x5f5bf9});return{'ok':!![],'data':summarizePersonalItem(_0x5b40ba),'message':_0x53507c(0x205)+_0x5b40ba['id']+'\x20('+_0x5b40ba[_0x53507c(0x21f)]+')'};},async 'dryRun'(_0x32d7d2){const _0xca72c6=a22_0x4dac3c,_0xa2102c=_0x32d7d2['num']('id'),_0x25464f=readKnowledgeFile(_0x32d7d2[_0xca72c6(0x21d)]('file')),_0x3126ae=_0x32d7d2['str']('title')||(await getPersonalKnowledgeBaseItem(_0xa2102c,_0x32d7d2['appCode']))[_0xca72c6(0x21f)];return dryRun('POST',_0xca72c6(0x214)+_0xa2102c+_0xca72c6(0x208))[_0xca72c6(0x20c)]({'appCode':_0x32d7d2[_0xca72c6(0x211)],'title':_0x3126ae,'content':_0x25464f})['description'](_0xca72c6(0x1fc)+_0xa2102c)[_0xca72c6(0x21a)]();}},kbSearch={'service':'kb','command':a22_0x4dac3c(0x1eb),'description':a22_0x4dac3c(0x227),'risk':a22_0x4dac3c(0x21e),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x151269){const _0x82b08b=a22_0x4dac3c;if(!_0x151269[_0x82b08b(0x21d)](_0x82b08b(0x215))[_0x82b08b(0x1f4)]())throw CliErrors[_0x82b08b(0x1f7)]('Search\x20query\x20is\x20required.');readTopK(_0x151269);},async 'execute'(_0x314197){const _0x5d0434=a22_0x4dac3c,_0x42a7f0=_0x314197[_0x5d0434(0x21d)](_0x5d0434(0x215))['trim'](),_0x1e3bd1=readTopK(_0x314197),_0x389ced=await searchKnowledgeBase(_0x314197[_0x5d0434(0x211)],{'query':_0x42a7f0,'topK':_0x1e3bd1});return{'ok':!![],'data':{'total':_0x389ced[_0x5d0434(0x22a)],'hits':_0x389ced[_0x5d0434(0x1f2)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x22504b=a23_0x1cc8;(function(_0x2cf396,_0x23f20f){const _0x4f5a9d=a23_0x1cc8,_0x5ad09b=_0x2cf396();while(!![]){try{const _0x49b6c0=-parseInt(_0x4f5a9d(0x1c6))/0x1*(-parseInt(_0x4f5a9d(0x1d4))/0x2)+-parseInt(_0x4f5a9d(0x1cf))/0x3+-parseInt(_0x4f5a9d(0x1c4))/0x4*(parseInt(_0x4f5a9d(0x1de))/0x5)+-parseInt(_0x4f5a9d(0x1df))/0x6+parseInt(_0x4f5a9d(0x1cd))/0x7*(-parseInt(_0x4f5a9d(0x1d3))/0x8)+parseInt(_0x4f5a9d(0x1e4))/0x9*(-parseInt(_0x4f5a9d(0x1d0))/0xa)+-parseInt(_0x4f5a9d(0x1e1))/0xb*(-parseInt(_0x4f5a9d(0x1cb))/0xc);if(_0x49b6c0===_0x23f20f)break;else _0x5ad09b['push'](_0x5ad09b['shift']());}catch(_0x5a2e30){_0x5ad09b['push'](_0x5ad09b['shift']());}}}(a23_0x45c7,0xbeea3));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function a23_0x1cc8(_0x2cc9c7,_0x113726){_0x2cc9c7=_0x2cc9c7-0x1c3;const _0x45c711=a23_0x45c7();let _0x1cc827=_0x45c711[_0x2cc9c7];return _0x1cc827;}function a23_0x45c7(){const _0x2521af=['*\x20Logs\x20cleared','24570852IBMBnE','stringify','1253NDyBcH','\x20\x20\x20Time:\x20','1785276pqtVjm','10MsFfTM','clearLogs','success','24008REaxCC','3826PTLOOA','timestamp','log','clear','level','error','readLogs','message','View\x20command\x20history\x20logs','details','59930cKcseQ','9033900fqAPHz','logs','22MSpUVr','\x20\x20\x20Duration:\x20','duration','3250593RdWHMM','toLocaleString','read','keys','length','108SJWBWj','\x20\x20\x20Details:\x20','5HGkkZI','forEach','write','en-US'];a23_0x45c7=function(){return _0x2521af;};return a23_0x45c7();}function printLogs(_0xe566c9){const _0x2d1cec=a23_0x1cc8;if(_0xe566c9[_0x2d1cec(0x1c3)]===0x0){console['log']('*\x20No\x20logs\x20found');return;}console[_0x2d1cec(0x1d6)]('*\x20'+CLI_DISPLAY_NAME+'\x20logs:\x0a'),_0xe566c9[_0x2d1cec(0x1c7)]((_0x3f65f7,_0x586de6)=>{const _0x27e329=_0x2d1cec,_0x34df4e=new Date(_0x3f65f7[_0x27e329(0x1d5)])[_0x27e329(0x1e5)](_0x27e329(0x1c9)),_0x486d8c=_0x3f65f7['level']===_0x27e329(0x1d2)?'√':_0x3f65f7[_0x27e329(0x1d8)]===_0x27e329(0x1d9)?'×':_0x3f65f7['level']==='warn'?'!':'i';console['log'](_0x586de6+0x1+'.\x20'+_0x486d8c+'\x20['+_0x3f65f7['command']+']\x20'+_0x3f65f7[_0x27e329(0x1db)]),console['log'](_0x27e329(0x1ce)+_0x34df4e),_0x3f65f7[_0x27e329(0x1e3)]&&console[_0x27e329(0x1d6)](_0x27e329(0x1e2)+_0x3f65f7[_0x27e329(0x1e3)]+'ms'),_0x3f65f7[_0x27e329(0x1dd)]&&Object[_0x27e329(0x1e7)](_0x3f65f7['details'])[_0x27e329(0x1c3)]>0x0&&console[_0x27e329(0x1d6)](_0x27e329(0x1c5)+JSON[_0x27e329(0x1cc)](_0x3f65f7[_0x27e329(0x1dd)],null,0x2)),console[_0x27e329(0x1d6)]('');});}export const logsDefinitions=[{'service':'logs','command':'show','description':a23_0x22504b(0x1dc),'risk':a23_0x22504b(0x1e6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1c4483){const _0x4cc865=a23_0x22504b;return printLogs(logger[_0x4cc865(0x1da)]()),{'ok':!![]};}},{'service':a23_0x22504b(0x1e0),'command':a23_0x22504b(0x1d7),'description':'Clear\x20command\x20history\x20logs','risk':a23_0x22504b(0x1c8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x4877fb){const _0x1fdca9=a23_0x22504b;return logger[_0x1fdca9(0x1d1)](),console[_0x1fdca9(0x1d6)](_0x1fdca9(0x1ca)),{'ok':!![]};}}];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a24_0x30cdc3=a24_0xa44c;(function(_0x17f191,_0x283edd){const _0x48d78a=a24_0xa44c,_0x543e6d=_0x17f191();while(!![]){try{const _0x13f446=parseInt(_0x48d78a(0x209))/0x1+-parseInt(_0x48d78a(0x1fa))/0x2+parseInt(_0x48d78a(0x1fb))/0x3*(parseInt(_0x48d78a(0x206))/0x4)+parseInt(_0x48d78a(0x201))/0x5+parseInt(_0x48d78a(0x1f8))/0x6*(parseInt(_0x48d78a(0x205))/0x7)+parseInt(_0x48d78a(0x213))/0x8*(-parseInt(_0x48d78a(0x204))/0x9)+parseInt(_0x48d78a(0x1f7))/0xa*(-parseInt(_0x48d78a(0x215))/0xb);if(_0x13f446===_0x283edd)break;else _0x543e6d['push'](_0x543e6d['shift']());}catch(_0x1be15f){_0x543e6d['push'](_0x543e6d['shift']());}}}(a24_0x5e9f,0xc24ad));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';function a24_0xa44c(_0x1874de,_0x2219d5){_0x1874de=_0x1874de-0x1ef;const _0x5e9f53=a24_0x5e9f();let _0xa44c8d=_0x5e9f53[_0x1874de];return _0xa44c8d;}import{skillDefinitions}from'../commands/skill/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x22d03){const _0x59919c=a24_0xa44c;for(const _0x5e799c of _0x22d03){definitions['set'](_0x5e799c[_0x59919c(0x202)]+':'+_0x5e799c[_0x59919c(0x1f6)],_0x5e799c);let _0x4b8e06=serviceGroups[_0x59919c(0x212)](_0x5e799c[_0x59919c(0x202)]);!_0x4b8e06&&(_0x4b8e06=[],serviceGroups[_0x59919c(0x1f3)](_0x5e799c[_0x59919c(0x202)],_0x4b8e06)),_0x4b8e06[_0x59919c(0x1fd)](_0x5e799c);}}function registerService(_0x4fa255,_0x223ed4,_0x52e533){const _0x34dd8a=a24_0xa44c;registerDefinitions(_0x223ed4);const _0x515e3b=_0x4a02ad=>_0x4a02ad===_0x34dd8a(0x20d)?'':_0x4a02ad===_0x34dd8a(0x211)?_0x34dd8a(0x20c):_0x34dd8a(0x1fc),_0x236348={'service':_0x223ed4[0x0]['service'],'label':_0x4fa255,'commands':_0x223ed4[_0x34dd8a(0x1f4)](_0x40fd4b=>({'command':_0x40fd4b['command'],'description':_0x40fd4b[_0x34dd8a(0x20e)],'tag':_0x515e3b(_0x40fd4b[_0x34dd8a(0x1f9)])})),'defaultCommand':_0x52e533?.[_0x34dd8a(0x1ff)]??(_0x52e533?.[_0x34dd8a(0x210)]?_0x223ed4[0x0][_0x34dd8a(0x1f6)]:undefined),'isSingleCommand':_0x52e533?.[_0x34dd8a(0x210)]};serviceRegistry[_0x34dd8a(0x1fd)](_0x236348),serviceByName[_0x34dd8a(0x1f3)](_0x236348[_0x34dd8a(0x202)],_0x236348);}registerService(a24_0x30cdc3(0x200),authDefinitions,{'defaultCommand':a24_0x30cdc3(0x208)}),registerService(a24_0x30cdc3(0x20a),datasetDefinitions),registerService(a24_0x30cdc3(0x1ef),dataDefinitions),registerService(a24_0x30cdc3(0x1fe),sqlDefinitions),registerService('BFF\x20Scripts',bffDefinitions),registerService('Knowledge\x20Base',kbDefinitions),registerService(a24_0x30cdc3(0x1f2),appDefinitions,{'defaultCommand':a24_0x30cdc3(0x214)}),registerService('Configuration',configDefinitions,{'defaultCommand':a24_0x30cdc3(0x214)}),registerService(a24_0x30cdc3(0x207),skillDefinitions,{'defaultCommand':a24_0x30cdc3(0x203)}),registerService('Self\x20Update',[updateDefinition],{'defaultCommand':a24_0x30cdc3(0x1f5),'isSingleCommand':!![]}),registerService(a24_0x30cdc3(0x1f0),[doctorDefinition],{'isSingleCommand':!![]}),registerService('Schema',[schemaDefinition],{'isSingleCommand':!![]}),registerService(a24_0x30cdc3(0x1f1),logsDefinitions,{'defaultCommand':a24_0x30cdc3(0x20b)});export function findDefinition(_0x305346,_0x1325bc){const _0x227ca3=a24_0x30cdc3;return definitions[_0x227ca3(0x212)](_0x305346+':'+_0x1325bc);}export function isKnownService(_0x5c5197){return serviceByName['has'](_0x5c5197);}function a24_0x5e9f(){const _0xe9548d=['show','\x20\x20[write]','read','description','from','isSingleCommand','write','get','128mrNuzK','list','22LPCpgB','Instant\x20API','Diagnostics','Logs','App\x20Management','set','map','run','command','3733010ughdKQ','72426LcSaNR','risk','1269982dibxVP','1929mZMjxI','\x20\x20[high-risk-write]','push','SQL\x20Queries','defaultCommand','Authentication','2537855cqkCtC','service','install','60282tmcNKQ','273sosiSs','6088bVEROe','Skills','login','327596GXrrvI','Datasets'];a24_0x5e9f=function(){return _0xe9548d;};return a24_0x5e9f();}export function getServiceEntry(_0x1eaaca){const _0x278486=a24_0x30cdc3;return serviceByName[_0x278486(0x212)](_0x1eaaca);}export function getAllDefinitions(){const _0x638dc=a24_0x30cdc3;return Array[_0x638dc(0x20f)](definitions['values']());}
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0xf6600=a25_0x2e00;function a25_0x2e00(_0x587470,_0x5bbd0c){_0x587470=_0x587470-0x11e;const _0x278905=a25_0x2789();let _0x2e0087=_0x278905[_0x587470];return _0x2e0087;}(function(_0x2f705b,_0x4215f4){const _0x398405=a25_0x2e00,_0x21f189=_0x2f705b();while(!![]){try{const _0xb70e5f=-parseInt(_0x398405(0x122))/0x1+parseInt(_0x398405(0x12a))/0x2*(parseInt(_0x398405(0x128))/0x3)+parseInt(_0x398405(0x123))/0x4*(-parseInt(_0x398405(0x124))/0x5)+parseInt(_0x398405(0x11f))/0x6*(-parseInt(_0x398405(0x125))/0x7)+parseInt(_0x398405(0x129))/0x8*(parseInt(_0x398405(0x126))/0x9)+parseInt(_0x398405(0x11e))/0xa*(parseInt(_0x398405(0x127))/0xb)+parseInt(_0x398405(0x121))/0xc;if(_0xb70e5f===_0x4215f4)break;else _0x21f189['push'](_0x21f189['shift']());}catch(_0x33c75c){_0x21f189['push'](_0x21f189['shift']());}}}(a25_0x2789,0xbd6c4));function a25_0x2789(){const _0x27fd84=['63VyDQRP','8FLPdpk','94932TiOVUe','15293070HVEHrq','7018350ZFacAd','Export\x20machine-readable\x20command\x20schema\x20(JSON)','3957504qOfugI','363298PlnmgZ','96ZeWrdW','302730gJTZAT','7fNUzLA','8155062GIesmi','11XBNegz'];a25_0x2789=function(){return _0x27fd84;};return a25_0x2789();}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0xe436e8){const _0x1f55d3=await buildSchemaPayload();return{'ok':!![],'data':_0x1f55d3};}export const schemaDefinition={'service':'schema','command':'export','description':a25_0xf6600(0x120),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x1ca061=a26_0xa1af;(function(_0x310787,_0x15399b){const _0x2cc65f=a26_0xa1af,_0x5d9f5d=_0x310787();while(!![]){try{const _0x1c66e8=parseInt(_0x2cc65f(0x138))/0x1*(parseInt(_0x2cc65f(0x15e))/0x2)+-parseInt(_0x2cc65f(0x149))/0x3+parseInt(_0x2cc65f(0x14e))/0x4+parseInt(_0x2cc65f(0x156))/0x5+-parseInt(_0x2cc65f(0x163))/0x6+-parseInt(_0x2cc65f(0x15b))/0x7+-parseInt(_0x2cc65f(0x140))/0x8;if(_0x1c66e8===_0x15399b)break;else _0x5d9f5d['push'](_0x5d9f5d['shift']());}catch(_0x1ebeb6){_0x5d9f5d['push'](_0x5d9f5d['shift']());}}}(a26_0xe92e,0x20127));import{CLI_BIN_NAME,CLI_DISPLAY_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';import{logger}from'../../utils/logger.js';const CODE_FLAG={'name':a26_0x1ca061(0x141),'type':a26_0x1ca061(0x16d),'description':a26_0x1ca061(0x14f)},DIR_FLAG={'name':'dir','type':'string','required':!![],'description':'Local\x20Skill\x20directory\x20containing\x20SKILL.md'};function a26_0xe92e(){const _0x20042d=['production','skillCode','apiError','string','nonInteractive','personal','setLogPath','pipe','info','Installing\x20official\x20skill\x20via\x20npx\x20(npx\x20skills\x20add\x20','=1);\x20assuming\x20skill\x20is\x20already\x20present.','202481IxFRTT','Updated\x20personal\x20Skill\x20','Install\x20the\x20published\x20','authRequired','action','skipped','input','../../core/api-client.js','946792AUqmrq','code','unchanged','map','find','\x20skill\x20via\x20npx.','skill-install','write','cwd','100809jGcGIc','length','created','Check\x20network\x20connectivity\x20and\x20try\x20again.','filter','184760GDKhTI','Only\x20pull\x20a\x20specific\x20runtime\x20Skill\x20code','appCode','\x20-g\x20-y)...','dir','pull','install','\x20personal\x20and\x20','1140715EKrhoe','skill','unknown','\x20company\x20Skill(s).','str','619969zZYlJg','Push\x20a\x20local\x20Skill\x20directory\x20to\x20personal\x20runtime\x20Skill\x20scope','reduce','2pHAgkX','Pull\x20personal\x20and\x20company\x20runtime\x20Skills\x20into\x20local\x20agent\x20skill\x20directories','accessKey','\x20developer\x20skill','../../skills/runtime-skill-sync.js','629568sBnrid','envName','Skipped\x20npx\x20(','Created\x20personal\x20Skill\x20','error','\x20skill\x20installed','push'];a26_0xe92e=function(){return _0x20042d;};return a26_0xe92e();}function summarizeRuntimeSkill(_0xe43bd2){const _0x31e3cf=a26_0x1ca061;return{'id':_0xe43bd2['id'],'skillCode':_0xe43bd2[_0x31e3cf(0x16b)],'skillName':_0xe43bd2['skillName'],'scope':_0xe43bd2['scope'],'version':_0xe43bd2['version'],'readonly':_0xe43bd2['readonly']};}function a26_0xa1af(_0x376155,_0x5e1cdb){_0x376155=_0x376155-0x135;const _0xe92e7b=a26_0xe92e();let _0xa1af9c=_0xe92e7b[_0x376155];return _0xa1af9c;}function filterByCode(_0x2c4eda,_0x412fe0){const _0x31079f=a26_0x1ca061,_0x14f2a3=_0x412fe0['trim']();if(!_0x14f2a3)return _0x2c4eda;return _0x2c4eda[_0x31079f(0x14d)](_0x67af26=>_0x67af26[_0x31079f(0x16b)]===_0x14f2a3);}export const skillDefinitions=[{'service':a26_0x1ca061(0x157),'command':a26_0x1ca061(0x154),'description':a26_0x1ca061(0x13a)+CLI_BIN_NAME+a26_0x1ca061(0x161),'risk':a26_0x1ca061(0x147),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x4758d6){const _0x504604=a26_0x1ca061;logger[_0x504604(0x170)](process[_0x504604(0x148)]()),logger[_0x504604(0x135)](_0x504604(0x146),'Installing\x20published\x20'+CLI_DISPLAY_NAME+_0x504604(0x145));const {LOVRABET_SKILL_SOURCE:_0x42084e,LOVRABET_SKIP_NPX_SKILLS_ENV:_0x5489f3,runNpxSkillsAddGlobal:_0xe45119}=await import('../../skills/npx-skills-add.js'),_0xb62adc=_0x4758d6[_0x504604(0x16e)]?_0x504604(0x171):'inherit';console['log'](_0x504604(0x136)+_0x42084e+_0x504604(0x151));const _0x391d7f=_0xe45119(process[_0x504604(0x148)](),_0x42084e,{'stdio':_0xb62adc});if(_0x391d7f[_0x504604(0x13d)])console['log'](_0x504604(0x165)+_0x5489f3+_0x504604(0x137));else{if(_0x391d7f['ok'])console['log'](CLI_BIN_NAME+_0x504604(0x168));else throw CliErrors[_0x504604(0x16c)]('npx\x20skills\x20add\x20failed:\x20'+(_0x391d7f[_0x504604(0x167)]||_0x504604(0x158)),_0x504604(0x14c));}return{'ok':!![]};}},{'service':a26_0x1ca061(0x157),'command':a26_0x1ca061(0x153),'description':a26_0x1ca061(0x15f),'risk':'write','flags':[CODE_FLAG],async 'execute'(_0x5b3ca2){const _0x362bda=a26_0x1ca061,{listCompanyRuntimeSkills:_0x73ae5c,listPersonalRuntimeSkills:_0xb38727}=await import(_0x362bda(0x13f)),{linkEffectiveRuntimeSkills:_0x208e65,materializeRuntimeSkill:_0x579406}=await import(_0x362bda(0x162)),_0x559b61=_0x5b3ca2[_0x362bda(0x15a)]('code'),_0x4799c6=_0x5b3ca2[_0x362bda(0x164)]??_0x362bda(0x16a),_0x3ab866=_0x5b3ca2[_0x362bda(0x160)];if(!_0x3ab866)throw CliErrors['authRequired']();const _0x7dd5e1=filterByCode(await _0xb38727(_0x5b3ca2['appCode']),_0x559b61),_0x3dc4f2=filterByCode(await _0x73ae5c(_0x5b3ca2[_0x362bda(0x150)]),_0x559b61),_0xb9750b=[..._0x7dd5e1['map'](_0x3c7597=>_0x579406(_0x3c7597,_0x362bda(0x16f),{'env':_0x4799c6,'accessKey':_0x3ab866,'appCode':_0x5b3ca2[_0x362bda(0x150)]})),..._0x3dc4f2['map'](_0x325d5e=>_0x579406(_0x325d5e,'company',{'env':_0x4799c6,'accessKey':_0x3ab866,'appCode':_0x5b3ca2[_0x362bda(0x150)]}))],_0x298891=_0x208e65(_0xb9750b,_0x5b3ca2[_0x362bda(0x150)]),_0x4ebb29=_0x298891[_0x362bda(0x15d)]((_0x1efc3d,_0x5de318)=>{const _0x240cce=_0x362bda;return _0x1efc3d[_0x5de318[_0x240cce(0x13c)]]=(_0x1efc3d[_0x5de318[_0x240cce(0x13c)]]??0x0)+0x1,_0x1efc3d;},{});return{'ok':!![],'data':{'appCode':_0x5b3ca2[_0x362bda(0x150)],'personal':_0x7dd5e1[_0x362bda(0x14a)],'company':_0x3dc4f2[_0x362bda(0x14a)],'materialized':_0xb9750b['length'],'links':{'total':_0x298891[_0x362bda(0x14a)],'created':_0x4ebb29[_0x362bda(0x14b)]??0x0,'updated':_0x4ebb29['updated']??0x0,'unchanged':_0x4ebb29[_0x362bda(0x142)]??0x0,'skipped':0x0,'conflicted':0x0},'skills':{'personal':_0x7dd5e1['map'](summarizeRuntimeSkill),'company':_0x3dc4f2[_0x362bda(0x143)](summarizeRuntimeSkill)}},'message':'Pulled\x20'+_0x7dd5e1['length']+_0x362bda(0x155)+_0x3dc4f2[_0x362bda(0x14a)]+_0x362bda(0x159)};}},{'service':'skill','command':a26_0x1ca061(0x169),'description':a26_0x1ca061(0x15c),'risk':a26_0x1ca061(0x147),'flags':[DIR_FLAG],async 'execute'(_0x41d892){const _0x2d9be0=a26_0x1ca061,{createPersonalRuntimeSkill:_0x1800bc,listPersonalRuntimeSkills:_0x673887,updatePersonalRuntimeSkill:_0x4cad12}=await import(_0x2d9be0(0x13f)),{readPushDirectory:_0x1ad65b}=await import('../../skills/runtime-skill-sync.js');if(!_0x41d892[_0x2d9be0(0x160)])throw CliErrors[_0x2d9be0(0x13b)]();const _0x3e1558=_0x1ad65b(_0x41d892[_0x2d9be0(0x15a)](_0x2d9be0(0x152)),_0x41d892[_0x2d9be0(0x150)]),_0x4c914a=(await _0x673887(_0x41d892[_0x2d9be0(0x150)]))[_0x2d9be0(0x144)](_0x36f7e2=>_0x36f7e2[_0x2d9be0(0x16b)]===_0x3e1558[_0x2d9be0(0x16b)]),_0x29aa89=_0x4c914a?await _0x4cad12(_0x3e1558['skillCode'],_0x41d892['appCode'],_0x3e1558[_0x2d9be0(0x13e)]):await _0x1800bc(_0x41d892[_0x2d9be0(0x150)],_0x3e1558[_0x2d9be0(0x13e)]);return{'ok':!![],'data':summarizeRuntimeSkill(_0x29aa89),'message':_0x4c914a?_0x2d9be0(0x139)+_0x3e1558[_0x2d9be0(0x16b)]:_0x2d9be0(0x166)+_0x3e1558[_0x2d9be0(0x16b)]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a27_0x4c2a5f=a27_0x469f;function a27_0x469f(_0x21e327,_0x3309ee){_0x21e327=_0x21e327-0x97;const _0xff727c=a27_0xff72();let _0x469f0c=_0xff727c[_0x21e327];return _0x469f0c;}(function(_0x23a8ef,_0x5314ec){const _0x2d78cc=a27_0x469f,_0x56d2b6=_0x23a8ef();while(!![]){try{const _0x2f8098=parseInt(_0x2d78cc(0x9d))/0x1*(parseInt(_0x2d78cc(0x9b))/0x2)+parseInt(_0x2d78cc(0x9c))/0x3*(-parseInt(_0x2d78cc(0x99))/0x4)+-parseInt(_0x2d78cc(0xa6))/0x5*(-parseInt(_0x2d78cc(0xa4))/0x6)+parseInt(_0x2d78cc(0x9f))/0x7*(parseInt(_0x2d78cc(0xaa))/0x8)+-parseInt(_0x2d78cc(0xa0))/0x9+parseInt(_0x2d78cc(0xa9))/0xa*(-parseInt(_0x2d78cc(0xac))/0xb)+parseInt(_0x2d78cc(0x97))/0xc;if(_0x2f8098===_0x5314ec)break;else _0x56d2b6['push'](_0x56d2b6['shift']());}catch(_0x119090){_0x56d2b6['push'](_0x56d2b6['shift']());}}}(a27_0xff72,0xbdba8));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';function a27_0xff72(){const _0xb5dee6=['6exmhfz','bool','6778155UCEqbC','detail','verbose','1070aBudeo','99552lXHhCA','dbId','133122fsQLfc','17747316IejpWq','sqlcode','2708yDHAaP','sqlCode','4MxlpdA','5277bRsXvu','226354jmAZoq','sqlContent','98dKdBqS','1787517aQDKNE','read','sqlName','appCode'];a27_0xff72=function(){return _0xb5dee6;};return a27_0xff72();}export const sqlDetail={'service':'sql','command':a27_0x4c2a5f(0xa7),'description':'Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','risk':a27_0x4c2a5f(0xa1),'flags':[SQLCODE_FLAG,VERBOSE_FLAG],async 'execute'(_0x4f0cf5){const _0x40de80=a27_0x4c2a5f,_0x50e62c=await getSqlQueryInfo(_0x4f0cf5[_0x40de80(0xa3)],_0x4f0cf5['str'](_0x40de80(0x98))),_0x8f902f=_0x4f0cf5[_0x40de80(0xa5)](_0x40de80(0xa8));if(_0x8f902f)return{'ok':!![],'data':_0x50e62c};const _0xf7c707=_0x50e62c[_0x40de80(0xab)]?await getDbName(_0x4f0cf5[_0x40de80(0xa3)],_0x50e62c[_0x40de80(0xab)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x50e62c[_0x40de80(0x9a)],'sqlName':_0x50e62c[_0x40de80(0xa2)],'db':_0xf7c707?_0xf7c707+'\x20('+_0x50e62c[_0x40de80(0xab)]+')':_0x50e62c[_0x40de80(0xab)]??'','description':_0x50e62c['description']??'','sqlContent':_0x50e62c[_0x40de80(0x9e)]??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a28_0x3aa973=a28_0x4a02;(function(_0x347550,_0x5d2456){const _0x59444a=a28_0x4a02,_0x5d8a46=_0x347550();while(!![]){try{const _0x4ffbf9=-parseInt(_0x59444a(0x97))/0x1+parseInt(_0x59444a(0x9c))/0x2*(-parseInt(_0x59444a(0x91))/0x3)+parseInt(_0x59444a(0x9b))/0x4*(parseInt(_0x59444a(0x8b))/0x5)+-parseInt(_0x59444a(0x8f))/0x6+parseInt(_0x59444a(0x95))/0x7+-parseInt(_0x59444a(0x90))/0x8*(-parseInt(_0x59444a(0x88))/0x9)+-parseInt(_0x59444a(0x87))/0xa*(-parseInt(_0x59444a(0x99))/0xb);if(_0x4ffbf9===_0x5d2456)break;else _0x5d8a46['push'](_0x5d8a46['shift']());}catch(_0x43e098){_0x5d8a46['push'](_0x5d8a46['shift']());}}}(a28_0x518b,0x8ca69));import{executeSdkSql}from'../../core/sdk-client.js';function a28_0x4a02(_0x23a6bc,_0x1871e6){_0x23a6bc=_0x23a6bc-0x86;const _0x518b1e=a28_0x518b();let _0x4a02d8=_0x518b1e[_0x23a6bc];return _0x4a02d8;}import{SQLCODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a28_0x3aa973(0x9a),'command':a28_0x3aa973(0x8a),'description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':a28_0x3aa973(0x86),'flags':[SQLCODE_FLAG,PARAMS_FLAG],async 'execute'(_0x2c4c31){const _0x4ff3a1=a28_0x3aa973,_0x523a35=parseJsonParams(_0x2c4c31[_0x4ff3a1(0x93)](_0x4ff3a1(0x92))),_0x2ae265=Date['now'](),_0x425018=await executeSdkSql(_0x2c4c31[_0x4ff3a1(0x93)](_0x4ff3a1(0x8c)),_0x523a35),_0x1c8b68=Date[_0x4ff3a1(0x8d)]()-_0x2ae265,_0x57fda3=_0x425018?.[_0x4ff3a1(0x96)]??_0x425018,_0x289224=_0x425018?.[_0x4ff3a1(0x94)]??!![];if(!_0x289224)return{'ok':![],'data':{'error':_0x425018?.['execError']||'SQL\x20execution\x20failed','elapsed':_0x1c8b68},'message':_0x4ff3a1(0x8e)};const _0x292e93=Array[_0x4ff3a1(0x98)](_0x57fda3)?_0x57fda3:[];return{'ok':!![],'data':{'rows':_0x292e93,'rowCount':_0x292e93['length'],'elapsed':_0x1c8b68},'message':_0x4ff3a1(0x9d)+_0x292e93['length']+_0x4ff3a1(0x89)+_0x1c8b68+'ms'};}};function a28_0x518b(){const _0x1adc1a=['sql','135828JEQJSl','774706sCKpsF','Returned\x20','read','40abfLrx','4816953MBFvRV','\x20row(s)\x20in\x20','exec','65uiMCJQ','sqlcode','now','SQL\x20execution\x20failed','6106656rOWAdG','16DosLhM','3QCnhZo','params','str','execSuccess','4276405YlKTzu','execResult','193708XDgYWf','isArray','143418ljuzFH'];a28_0x518b=function(){return _0x1adc1a;};return a28_0x518b();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a29_0x3039(){const _0x2a2e4a=['8jPQYJs','5723886xQmkYj','129xhnsce','3185788sHwGrn','113200BdNOrB','5gqWKwL','8625199kHJtSi','10HoaGkC','1mqNIlh','12970809kWFpIf','22786392TmKIHn','39DSymXs','5881212YoFBoC'];a29_0x3039=function(){return _0x2a2e4a;};return a29_0x3039();}(function(_0x5e40c7,_0x1b7c66){const _0xc60590=a29_0x1584,_0x23de41=_0x5e40c7();while(!![]){try{const _0x6ab6bd=parseInt(_0xc60590(0x1d8))/0x1*(-parseInt(_0xc60590(0x1d3))/0x2)+parseInt(_0xc60590(0x1d2))/0x3*(-parseInt(_0xc60590(0x1d4))/0x4)+-parseInt(_0xc60590(0x1d5))/0x5*(-parseInt(_0xc60590(0x1cf))/0x6)+-parseInt(_0xc60590(0x1d1))/0x7+-parseInt(_0xc60590(0x1d0))/0x8*(parseInt(_0xc60590(0x1d9))/0x9)+parseInt(_0xc60590(0x1d7))/0xa*(-parseInt(_0xc60590(0x1d6))/0xb)+-parseInt(_0xc60590(0x1cd))/0xc*(-parseInt(_0xc60590(0x1ce))/0xd);if(_0x6ab6bd===_0x1b7c66)break;else _0x23de41['push'](_0x23de41['shift']());}catch(_0x401c70){_0x23de41['push'](_0x23de41['shift']());}}}(a29_0x3039,0xc92be));import{sqlDetail}from'../../commands/sql/detail.js';import{sqlExec}from'../../commands/sql/exec.js';function a29_0x1584(_0x530487,_0x135168){_0x530487=_0x530487-0x1cd;const _0x303947=a29_0x3039();let _0x15846a=_0x303947[_0x530487];return _0x15846a;}export const sqlDefinitions=[sqlDetail,sqlExec];
|