@lovrabet/lovrabet-cli 2.0.9-beta.7 → 2.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const a16_0x5260cd=a16_0x26c6;(function(_0x3bcece,_0x41aa42){const _0x1d4f20=a16_0x26c6,_0x4d84c8=_0x3bcece();while(!![]){try{const _0x3b7b4f=-parseInt(_0x1d4f20(0x1b0))/0x1*(-parseInt(_0x1d4f20(0x17e))/0x2)+parseInt(_0x1d4f20(0x19c))/0x3+-parseInt(_0x1d4f20(0x17f))/0x4+-parseInt(_0x1d4f20(0x1ad))/0x5*(-parseInt(_0x1d4f20(0x1cd))/0x6)+-parseInt(_0x1d4f20(0x187))/0x7+parseInt(_0x1d4f20(0x18f))/0x8+-parseInt(_0x1d4f20(0x1ae))/0x9*(parseInt(_0x1d4f20(0x183))/0xa);if(_0x3b7b4f===_0x41aa42)break;else _0x4d84c8['push'](_0x4d84c8['shift']());}catch(_0x44a0f6){_0x4d84c8['push'](_0x4d84c8['shift']());}}}(a16_0x46b9,0x940b7));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';function a16_0x26c6(_0x9f773e,_0x47ca02){_0x9f773e=_0x9f773e-0x17c;const _0x46b920=a16_0x46b9();let _0x26c62a=_0x46b920[_0x9f773e];return _0x26c62a;}import{requireAnyOf}from'../../commands/common/constraints.js';function a16_0x46b9(){const _0x395345=['\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\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','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\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}','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','delete','\x20completed\x20in\x20','high-risk-write','\x20\x20AGGREGATE\x20TYPES','\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}}','POST','Update\x20an\x20existing\x20record','dryRun','command','\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}','6111618zkKpTB','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','update','5074rYsIVQ','2876120mKvXKA','\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','data\x20','\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}','110oOsuAf','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','\x20\x20\x20\x20$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}}]}','paramsRequired','8297646xHtlBI','batchCreate','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','risk','map','Get\x20a\x20single\x20record\x20by\x20ID','\x20\x20PARAMS\x20STRUCTURE','6869312wlAGnb','aggregate','\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\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','\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','body','description','\x20\x20WHERE\x20OPERATORS','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','\x20\x20\x20\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}}','operation','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','now','1340592NiohfZ','str','\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\x20LOGICAL\x20COMBINATORS','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','\x20\x20PAGINATION','getOne','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\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}}','code','filter','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','paramsHint','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','5YoTVGT','225054JJNNGj','create','182stdmaR','\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}','data','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','Preview:\x20data\x20','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','write','params','\x20on\x20dataset\x20','join','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20'];a16_0x46b9=function(){return _0x395345;};return a16_0x46b9();}import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a16_0x5260cd(0x1a7),'operation':a16_0x5260cd(0x1a7),'risk':'read','paramsRequired':![],'description':'Filter\x20dataset\x20records\x20with\x20query\x20conditions','paramsHint':a16_0x5260cd(0x1bd)+a16_0x5260cd(0x1c2),'helpExtra':[a16_0x5260cd(0x196),'\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}}',a16_0x5260cd(0x198),a16_0x5260cd(0x1a5),'\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_0x5260cd(0x184),'\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}',a16_0x5260cd(0x180),'\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}',a16_0x5260cd(0x191),a16_0x5260cd(0x1a9),'',a16_0x5260cd(0x19f),a16_0x5260cd(0x185),a16_0x5260cd(0x1be),'',a16_0x5260cd(0x1ac),'\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)',a16_0x5260cd(0x1b3),a16_0x5260cd(0x1b4),a16_0x5260cd(0x189),a16_0x5260cd(0x17c),'',a16_0x5260cd(0x1a2),a16_0x5260cd(0x192),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27',a16_0x5260cd(0x1bf)][a16_0x5260cd(0x1ba)]('\x0a')},{'command':a16_0x5260cd(0x1a3),'operation':a16_0x5260cd(0x1a3),'risk':'read','paramsRequired':!![],'description':a16_0x5260cd(0x18d),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a16_0x5260cd(0x1af),'operation':'create','risk':'write','paramsRequired':!![],'description':a16_0x5260cd(0x18a),'paramsHint':a16_0x5260cd(0x1a8)},{'command':a16_0x5260cd(0x188),'operation':a16_0x5260cd(0x188),'risk':a16_0x5260cd(0x1b7),'paramsRequired':!![],'description':a16_0x5260cd(0x1a0),'paramsHint':a16_0x5260cd(0x1b6)},{'command':a16_0x5260cd(0x17d),'operation':a16_0x5260cd(0x17d),'risk':a16_0x5260cd(0x1b7),'paramsRequired':!![],'description':a16_0x5260cd(0x1c9),'paramsHint':a16_0x5260cd(0x1a1)},{'command':a16_0x5260cd(0x1c3),'operation':a16_0x5260cd(0x1c3),'risk':a16_0x5260cd(0x1c5),'paramsRequired':!![],'description':'Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','paramsHint':a16_0x5260cd(0x1a4)},{'command':a16_0x5260cd(0x190),'operation':a16_0x5260cd(0x190),'risk':'read','paramsRequired':![],'description':'Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','paramsHint':a16_0x5260cd(0x19a)+a16_0x5260cd(0x1c0),'helpExtra':[a16_0x5260cd(0x1c6),a16_0x5260cd(0x1b1),a16_0x5260cd(0x182),'\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}',a16_0x5260cd(0x19e),a16_0x5260cd(0x1cc),a16_0x5260cd(0x197),a16_0x5260cd(0x1c1),'',a16_0x5260cd(0x18e),'\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]',a16_0x5260cd(0x1bc),'\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]',a16_0x5260cd(0x1c7),'\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','','\x20\x20EXAMPLES',a16_0x5260cd(0x1bb),'\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','',a16_0x5260cd(0x1aa),a16_0x5260cd(0x193)][a16_0x5260cd(0x1ba)]('\x0a')}];function makeDataCommand(_0xa87ff0){const _0xbbd3be=a16_0x5260cd,_0x2d0650=_0xbbd3be(0x181)+_0xa87ff0[_0xbbd3be(0x1cb)],_0x2b5fd0={'service':_0xbbd3be(0x1b2),'command':_0xa87ff0['command'],'description':_0xa87ff0[_0xbbd3be(0x195)],'risk':_0xa87ff0[_0xbbd3be(0x18b)],'helpExtra':_0xa87ff0['helpExtra'],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0xa87ff0[_0xbbd3be(0x1ab)]}],'validate':async _0x2d15ba=>{const _0x2e267d=_0xbbd3be;_0xa87ff0[_0x2e267d(0x186)]&&requireAnyOf(_0x2d15ba,[_0x2e267d(0x1b8)],_0x2d0650),_0xa87ff0[_0x2e267d(0x199)]===_0x2e267d(0x188)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x2d15ba[_0x2e267d(0x19d)](_0x2e267d(0x1b8))));},async 'execute'(_0x6796d){const _0x2032b5=_0xbbd3be,_0x5e99fb=_0x6796d['str'](_0x2032b5(0x1a6)),_0x333d27=_0xa87ff0[_0x2032b5(0x199)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x6796d[_0x2032b5(0x19d)](_0x2032b5(0x1b8)))):parseJsonParams(_0x6796d[_0x2032b5(0x19d)](_0x2032b5(0x1b8)))??{},_0x157026=Date[_0x2032b5(0x19b)](),_0x58ca05=await executeData(_0x5e99fb,_0xa87ff0[_0x2032b5(0x199)],_0x333d27),_0x5494f3=Date[_0x2032b5(0x19b)]()-_0x157026;return{'ok':!![],'data':{'result':_0x58ca05,'elapsed':_0x5494f3},'message':_0x2032b5(0x181)+_0xa87ff0[_0x2032b5(0x1cb)]+_0x2032b5(0x1c4)+_0x5494f3+'ms'};}};return _0xa87ff0[_0xbbd3be(0x18b)]!=='read'&&(_0x2b5fd0[_0xbbd3be(0x1ca)]=async _0x578305=>{const _0x2d4042=_0xbbd3be,_0x26aa39=_0x578305[_0x2d4042(0x19d)]('code'),_0x352f2b=_0xa87ff0[_0x2d4042(0x199)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x578305['str'](_0x2d4042(0x1b8)))):parseJsonParams(_0x578305[_0x2d4042(0x19d)](_0x2d4042(0x1b8)))??{};return dryRun(_0x2d4042(0x1c8),'/api/{appCode}/'+_0x26aa39+'/'+_0xa87ff0[_0x2d4042(0x199)])[_0x2d4042(0x194)](_0x352f2b)[_0x2d4042(0x195)](_0x2d4042(0x1b5)+_0xa87ff0['command']+_0x2d4042(0x1b9)+_0x26aa39)['build']();}),_0x2b5fd0;}export const dataDefinitions=specs[a16_0x5260cd(0x18c)](makeDataCommand);
|
|
1
|
+
const a16_0x512e7b=a16_0x7ff9;(function(_0x3caa7f,_0x4200dc){const _0x1533dd=a16_0x7ff9,_0x23b07a=_0x3caa7f();while(!![]){try{const _0x296665=-parseInt(_0x1533dd(0x179))/0x1*(parseInt(_0x1533dd(0x185))/0x2)+parseInt(_0x1533dd(0x164))/0x3*(-parseInt(_0x1533dd(0x152))/0x4)+parseInt(_0x1533dd(0x162))/0x5+-parseInt(_0x1533dd(0x18d))/0x6+-parseInt(_0x1533dd(0x192))/0x7+parseInt(_0x1533dd(0x16f))/0x8*(parseInt(_0x1533dd(0x184))/0x9)+parseInt(_0x1533dd(0x17b))/0xa;if(_0x296665===_0x4200dc)break;else _0x23b07a['push'](_0x23b07a['shift']());}catch(_0x142170){_0x23b07a['push'](_0x23b07a['shift']());}}}(a16_0x4e8e,0xee194));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';function a16_0x7ff9(_0x5dc10f,_0x1d0663){_0x5dc10f=_0x5dc10f-0x151;const _0x4e8eee=a16_0x4e8e();let _0x7ff9a1=_0x4e8eee[_0x5dc10f];return _0x7ff9a1;}import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a16_0x512e7b(0x191),'operation':'filter','risk':a16_0x512e7b(0x176),'paramsRequired':![],'description':a16_0x512e7b(0x171),'paramsHint':a16_0x512e7b(0x167)+'Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','helpExtra':[a16_0x512e7b(0x17d),'\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}}',a16_0x512e7b(0x16a),a16_0x512e7b(0x160),a16_0x512e7b(0x189),'\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_0x512e7b(0x156),a16_0x512e7b(0x197),a16_0x512e7b(0x183),'\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_0x512e7b(0x173),'\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','\x20\x20\x20\x20$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\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)',a16_0x512e7b(0x15e),'\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)',a16_0x512e7b(0x15d),'',a16_0x512e7b(0x175),'\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.',a16_0x512e7b(0x18c),a16_0x512e7b(0x199)][a16_0x512e7b(0x158)]('\x0a')},{'command':'getOne','operation':'getOne','risk':'read','paramsRequired':!![],'description':a16_0x512e7b(0x186),'paramsHint':a16_0x512e7b(0x16b)},{'command':a16_0x512e7b(0x157),'operation':a16_0x512e7b(0x157),'risk':a16_0x512e7b(0x188),'paramsRequired':!![],'description':a16_0x512e7b(0x18f),'paramsHint':a16_0x512e7b(0x15c)},{'command':a16_0x512e7b(0x190),'operation':'batchCreate','risk':a16_0x512e7b(0x188),'paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','paramsHint':'JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27'},{'command':a16_0x512e7b(0x168),'operation':a16_0x512e7b(0x168),'risk':'write','paramsRequired':!![],'description':a16_0x512e7b(0x17a),'paramsHint':'JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27'},{'command':'delete','operation':a16_0x512e7b(0x155),'risk':'high-risk-write','paramsRequired':!![],'description':a16_0x512e7b(0x166),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a16_0x512e7b(0x196),'operation':'aggregate','risk':a16_0x512e7b(0x176),'paramsRequired':![],'description':a16_0x512e7b(0x154),'paramsHint':a16_0x512e7b(0x193)+a16_0x512e7b(0x172),'helpExtra':[a16_0x512e7b(0x15f),a16_0x512e7b(0x187),'\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}',a16_0x512e7b(0x17c),'\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_0x512e7b(0x15a),a16_0x512e7b(0x165),'',a16_0x512e7b(0x198),'\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)',a16_0x512e7b(0x18a),a16_0x512e7b(0x16e),a16_0x512e7b(0x181),'\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','',a16_0x512e7b(0x174),a16_0x512e7b(0x153),a16_0x512e7b(0x177),'',a16_0x512e7b(0x15b),a16_0x512e7b(0x169)][a16_0x512e7b(0x158)]('\x0a')}];function a16_0x4e8e(){const _0x1554bc=['batchCreate','filter','298977SlpOEi','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','code','str','aggregate','\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\x20PARAMS\x20STRUCTURE','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','dryRun','28UmGIzF','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','delete','\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','join','data\x20','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','\x20\x20AGGREGATE\x20TYPES','\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}}','\x20on\x20dataset\x20','1421925XRjKjz','map','131436utmffw','\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}','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','update','\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','\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}}','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','params','body','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','167368mbouqa','/api/{appCode}/','Filter\x20dataset\x20records\x20with\x20query\x20conditions','Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20LOGICAL\x20COMBINATORS','\x20\x20EXAMPLES','\x20\x20PAGINATION','read','\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','operation','75403aJRwBk','Update\x20an\x20existing\x20record','30747690oMStqZ','\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\x20WHERE\x20OPERATORS','now','paramsRequired','description','\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}}','paramsHint','\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}}','45CEzJki','24RPgPkr','Get\x20a\x20single\x20record\x20by\x20ID','\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}','write','\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','command','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','7405656IUsySc','build','Create\x20a\x20new\x20record\x20in\x20a\x20dataset'];a16_0x4e8e=function(){return _0x1554bc;};return a16_0x4e8e();}function makeDataCommand(_0x2f52f6){const _0x38302c=a16_0x512e7b,_0x2abbe4=_0x38302c(0x159)+_0x2f52f6[_0x38302c(0x18b)],_0x3aa0a7={'service':'data','command':_0x2f52f6[_0x38302c(0x18b)],'description':_0x2f52f6[_0x38302c(0x180)],'risk':_0x2f52f6['risk'],'helpExtra':_0x2f52f6['helpExtra'],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x2f52f6[_0x38302c(0x182)]}],'validate':async _0x592f3a=>{const _0x29cc96=_0x38302c;_0x2f52f6[_0x29cc96(0x17f)]&&requireAnyOf(_0x592f3a,['params'],_0x2abbe4),_0x2f52f6['operation']===_0x29cc96(0x190)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x592f3a['str']('params')));},async 'execute'(_0x2b06ff){const _0x36af29=_0x38302c,_0x17eda1=_0x2b06ff[_0x36af29(0x195)](_0x36af29(0x194)),_0x5d8dd9=_0x2f52f6[_0x36af29(0x178)]===_0x36af29(0x190)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x2b06ff[_0x36af29(0x195)](_0x36af29(0x16c)))):parseJsonParams(_0x2b06ff[_0x36af29(0x195)]('params'))??{},_0x36250c=Date[_0x36af29(0x17e)](),_0x4326ab=await executeData(_0x17eda1,_0x2f52f6[_0x36af29(0x178)],_0x5d8dd9),_0x381f44=Date[_0x36af29(0x17e)]()-_0x36250c;return{'ok':!![],'data':{'result':_0x4326ab,'elapsed':_0x381f44},'message':_0x36af29(0x159)+_0x2f52f6[_0x36af29(0x18b)]+'\x20completed\x20in\x20'+_0x381f44+'ms'};}};return _0x2f52f6['risk']!==_0x38302c(0x176)&&(_0x3aa0a7[_0x38302c(0x151)]=async _0x303fd1=>{const _0x52e6b9=_0x38302c,_0x53f0a1=_0x303fd1[_0x52e6b9(0x195)](_0x52e6b9(0x194)),_0x27bdfe=_0x2f52f6['operation']===_0x52e6b9(0x190)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x303fd1[_0x52e6b9(0x195)](_0x52e6b9(0x16c)))):parseJsonParams(_0x303fd1[_0x52e6b9(0x195)](_0x52e6b9(0x16c)))??{};return dryRun('POST',_0x52e6b9(0x170)+_0x53f0a1+'/'+_0x2f52f6[_0x52e6b9(0x178)])[_0x52e6b9(0x16d)](_0x27bdfe)[_0x52e6b9(0x180)]('Preview:\x20data\x20'+_0x2f52f6['command']+_0x52e6b9(0x161)+_0x53f0a1)[_0x52e6b9(0x18e)]();}),_0x3aa0a7;}export const dataDefinitions=specs[a16_0x512e7b(0x163)](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a17_0x1e89ee=a17_0x2fb6;(function(_0xaea5a0,_0x3621f5){const _0xa92b0c=a17_0x2fb6,_0x343fe5=_0xaea5a0();while(!![]){try{const _0xb5180=parseInt(_0xa92b0c(0x1d7))/0x1+parseInt(_0xa92b0c(0x19e))/0x2+-parseInt(_0xa92b0c(0x1a5))/0x3*(-parseInt(_0xa92b0c(0x1ca))/0x4)+-parseInt(_0xa92b0c(0x1d0))/0x5*(-parseInt(_0xa92b0c(0x18b))/0x6)+-parseInt(_0xa92b0c(0x1cd))/0x7*(-parseInt(_0xa92b0c(0x1a2))/0x8)+-parseInt(_0xa92b0c(0x1aa))/0x9+-parseInt(_0xa92b0c(0x18c))/0xa;if(_0xb5180===_0x3621f5)break;else _0x343fe5['push'](_0x343fe5['shift']());}catch(_0x125e97){_0x343fe5['push'](_0x343fe5['shift']());}}}(a17_0x253d,0xa7b62));function a17_0x2fb6(_0x11ee84,_0x1bee63){_0x11ee84=_0x11ee84-0x188;const _0x253d7d=a17_0x253d();let _0x2fb640=_0x253d7d[_0x11ee84];return _0x2fb640;}import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x15c40b){const _0x47542d=a17_0x2fb6;if(_0x15c40b['deleted'])return null;const _0x1fa8ee=Boolean(_0x15c40b[_0x47542d(0x1bd)]!==undefined||_0x15c40b[_0x47542d(0x1a6)]!==undefined);let _0x1093ce={};if(!_0x1fa8ee&&typeof _0x15c40b[_0x47542d(0x196)]==='string')try{_0x1093ce=JSON[_0x47542d(0x195)](_0x15c40b[_0x47542d(0x196)]);}catch{}const _0x287687=_0x1fa8ee?_0x15c40b[_0x47542d(0x1ba)]:_0x15c40b['code'],_0xbbc0ce=_0x1fa8ee?_0x15c40b[_0x47542d(0x1bd)]:_0x15c40b[_0x47542d(0x1ba)],_0x214483=_0x1fa8ee?_0x15c40b[_0x47542d(0x1a6)]:_0x15c40b['type']||_0x15c40b[_0x47542d(0x1b7)],_0x49005a=_0x1fa8ee?_0x15c40b['pkField']===!![]:_0x1093ce[_0x47542d(0x19c)]===!![],_0x301c4b=_0x1fa8ee?_0x15c40b[_0x47542d(0x19a)]===!![]:_0x1093ce[_0x47542d(0x19a)]===!![],_0x124b26=_0x1fa8ee?_0x15c40b[_0x47542d(0x18d)]??null:_0x1093ce[_0x47542d(0x18d)]??null,_0x1eeda8={'name':_0x287687,'displayName':_0xbbc0ce||_0x287687,'type':_0x214483,'dbType':_0x15c40b[_0x47542d(0x1b9)],'pk':_0x49005a,'required':_0x301c4b,'description':_0x15c40b[_0x47542d(0x1b5)]||undefined};return Array[_0x47542d(0x1b4)](_0x124b26)&&_0x124b26[_0x47542d(0x1a4)]>0x0&&(_0x1eeda8['options']=_0x124b26),_0x1eeda8;}function parseJsonMaybe(_0x4aacfa){const _0x3e2481=a17_0x2fb6;if(typeof _0x4aacfa!==_0x3e2481(0x1b1))return _0x4aacfa;try{return JSON[_0x3e2481(0x195)](_0x4aacfa);}catch{return _0x4aacfa;}}function a17_0x253d(){const _0x21ae4d=['appCode','path','toField','type','updateTimeField','833220RiVXyf','push','method','read','4669884lbJyee','27408410RoZHPY','options','tableComment','datasetKey','filter','modifierIdField','toDatasetName','validateRules','map','parse','extend','beforeScriptId','dataset','relatedPageInfoList','required','formatRules','pkField','trim','1639700dqXXZd','entries','str','relations','3258272qvgfne','object','length','550644nwzukU','doType','toFieldLabel','split','properties','4609521VXXFxd','dbName','indexes','toDatasetCode','creatorNameField','responseBody','host','string','detail','responseFields','isArray','description','allFieldNames','dataType','afterScriptId','dbType','name','operations','code','displayName','dblinkInfoDTO','dbtableConfig','find','modelId','doVersion','deleted','createTimeField','dbId','logicField','fromField','tableName','columnCodeListWithDeleted','24lEWEJZ','requestFields','allFields','7bpJBis','sourceType','source','5ruPUDL','requestBody'];a17_0x253d=function(){return _0x21ae4d;};return a17_0x253d();}function normalizeOperationEntry(_0x315a01,_0x396455){const _0x2011ae=a17_0x2fb6;if(!_0x396455||typeof _0x396455!==_0x2011ae(0x1a3))return null;if(!_0x396455[_0x2011ae(0x189)]||!_0x396455['path'])return null;const _0x110e6a={'name':_0x315a01,'method':_0x396455['method'],'path':_0x396455[_0x2011ae(0x1d3)]};if(_0x396455[_0x2011ae(0x1b0)])_0x110e6a[_0x2011ae(0x1b0)]=_0x396455['host'];if(_0x396455[_0x2011ae(0x1d1)]!=null)_0x110e6a[_0x2011ae(0x1d1)]=parseJsonMaybe(_0x396455[_0x2011ae(0x1d1)]);if(_0x396455[_0x2011ae(0x1af)]!=null)_0x110e6a[_0x2011ae(0x1af)]=parseJsonMaybe(_0x396455['responseBody']);if(_0x396455['beforeScriptId']!=null)_0x110e6a['beforeScriptId']=_0x396455[_0x2011ae(0x197)];if(_0x396455[_0x2011ae(0x1b8)]!=null)_0x110e6a[_0x2011ae(0x1b8)]=_0x396455['afterScriptId'];if(Array[_0x2011ae(0x1b4)](_0x396455['requestFields']))_0x110e6a[_0x2011ae(0x1cb)]=_0x396455['requestFields'];if(Array[_0x2011ae(0x1b4)](_0x396455['responseFields']))_0x110e6a['responseFields']=_0x396455[_0x2011ae(0x1b3)];return _0x110e6a;}function summarizeDbtable(_0x374ae4){const _0x389bb1=a17_0x2fb6,_0x530aa2={},_0x173d44=[_0x389bb1(0x1c5),'dbName',_0x389bb1(0x1c8),_0x389bb1(0x18f),_0x389bb1(0x19c),_0x389bb1(0x1cc),_0x389bb1(0x1c6),_0x389bb1(0x1c4),_0x389bb1(0x1d6),'creatorIdField',_0x389bb1(0x1ae),_0x389bb1(0x191),'modifierNameField','labelField',_0x389bb1(0x1be)];for(const _0x2d6822 of _0x173d44){if(_0x374ae4[_0x2d6822]!==undefined)_0x530aa2[_0x2d6822]=_0x374ae4[_0x2d6822];}return typeof _0x530aa2[_0x389bb1(0x1cc)]==='string'&&_0x530aa2['allFields'][_0x389bb1(0x1a4)]>0x0&&(_0x530aa2[_0x389bb1(0x1b6)]=_0x530aa2[_0x389bb1(0x1cc)]['split'](',')[_0x389bb1(0x194)](_0x18e855=>_0x18e855[_0x389bb1(0x19d)]())[_0x389bb1(0x190)](Boolean)),_0x530aa2;}function normalizeRelatedPages(_0x2a3b1a){const _0x37ff70=a17_0x2fb6;if(!Array['isArray'](_0x2a3b1a))return[];return _0x2a3b1a[_0x37ff70(0x190)](_0x31ace5=>_0x31ace5&&typeof _0x31ace5===_0x37ff70(0x1a3))[_0x37ff70(0x194)](_0x456635=>({'id':_0x456635['id'],'type':_0x456635[_0x37ff70(0x1d5)],'code':_0x456635['code'],'title':_0x456635['title'],'deleted':_0x456635[_0x37ff70(0x1c3)]===!![]}));}function normalizeFallbackFieldName(_0x42d78c,_0x121977){const _0xe4ba89=a17_0x2fb6,_0x312f5d=_0x42d78c[_0xe4ba89(0x19d)]();if(!_0x312f5d)return null;return{'name':_0x312f5d,'displayName':_0x312f5d,'type':undefined,'dbType':undefined,'pk':_0x312f5d===_0x121977,'required':![],'description':undefined};}async function loadListFieldFallback(_0x5ba0c9,_0x25847e){const _0x4d4166=a17_0x2fb6;if(!_0x5ba0c9||!_0x25847e)return[];try{const _0x22647c=await listDatasets(_0x5ba0c9,{'code':_0x25847e}),_0x53027e=_0x22647c[_0x4d4166(0x1c0)](_0x276946=>_0x276946[_0x4d4166(0x1bc)]===_0x25847e)??_0x22647c[0x0],_0x4e0b1b=_0x53027e?.[_0x4d4166(0x1bf)]??{},_0x4c1515=typeof _0x4e0b1b[_0x4d4166(0x1cc)]===_0x4d4166(0x1b1)?_0x4e0b1b[_0x4d4166(0x1cc)][_0x4d4166(0x1a8)](','):[];return _0x4c1515[_0x4d4166(0x194)](_0x4b2dbc=>normalizeFallbackFieldName(_0x4b2dbc,_0x4e0b1b[_0x4d4166(0x19c)]))[_0x4d4166(0x190)](_0x5e6851=>_0x5e6851!==null);}catch{return[];}}export const datasetDetail={'service':a17_0x1e89ee(0x198),'command':a17_0x1e89ee(0x1b2),'description':'Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','risk':a17_0x1e89ee(0x18a),'flags':[CODE_FLAG],async 'execute'(_0x5560f1){const _0x3f1878=a17_0x1e89ee,_0x54257c=await getDatasetDetail(_0x5560f1[_0x3f1878(0x1a0)]('code')),_0x27565c=Array[_0x3f1878(0x1b4)](_0x54257c['fields'])?_0x54257c['fields']:Array[_0x3f1878(0x1b4)](_0x54257c['properties'])?_0x54257c[_0x3f1878(0x1a9)]:[];let _0x4d6560=_0x27565c[_0x3f1878(0x194)](_0x29d9d3=>normalizeField(_0x29d9d3))['filter'](_0x33be54=>_0x33be54!==null);_0x4d6560[_0x3f1878(0x1a4)]===0x0&&(_0x4d6560=await loadListFieldFallback(_0x5560f1[_0x3f1878(0x1d2)],_0x5560f1[_0x3f1878(0x1a0)](_0x3f1878(0x1bc))));const _0x46f1a8=_0x54257c[_0x3f1878(0x1bb)]??{},_0x18693f=[];for(const [_0x4f0a3e,_0x22e73a]of Object[_0x3f1878(0x19f)](_0x46f1a8)){const _0x489cac=normalizeOperationEntry(_0x4f0a3e,_0x22e73a);if(_0x489cac)_0x18693f[_0x3f1878(0x188)](_0x489cac);}const _0x26d77c=_0x54257c[_0x3f1878(0x1bf)]??{},_0x364ddd=_0x54257c[_0x3f1878(0x198)]??{},_0x1b45bb=_0x26d77c[_0x3f1878(0x1c5)]!=null?{'id':_0x26d77c[_0x3f1878(0x1c5)],'name':_0x26d77c[_0x3f1878(0x1ab)]??null}:undefined;let _0x4a616c;return typeof _0x54257c[_0x3f1878(0x196)]===_0x3f1878(0x1b1)&&(_0x4a616c=parseJsonMaybe(_0x54257c[_0x3f1878(0x196)])),{'ok':!![],'data':{'id':_0x54257c[_0x3f1878(0x1c1)]??_0x54257c['id'],'name':_0x54257c['name'],'code':_0x54257c['modelCode']||_0x54257c[_0x3f1878(0x1bc)],'doVersion':_0x54257c[_0x3f1878(0x1c2)],'description':_0x54257c['description']||_0x364ddd[_0x3f1878(0x18e)]||undefined,'source':_0x54257c[_0x3f1878(0x1cf)]||_0x364ddd[_0x3f1878(0x1ce)],'table':_0x26d77c['tableName']||_0x364ddd['tableName'],'datasetKey':_0x26d77c[_0x3f1878(0x18f)],'pk':_0x26d77c[_0x3f1878(0x19c)],'db':_0x1b45bb,'dbtable':summarizeDbtable(_0x26d77c),'fields':_0x4d6560,'operations':_0x18693f,'indexes':Array[_0x3f1878(0x1b4)](_0x364ddd[_0x3f1878(0x1ac)])?_0x364ddd['indexes']:[],'relations':Array[_0x3f1878(0x1b4)](_0x54257c[_0x3f1878(0x1a1)])?_0x54257c[_0x3f1878(0x1a1)][_0x3f1878(0x194)](_0xb7126a=>({'fromField':_0xb7126a[_0x3f1878(0x1c7)],'toDataset':_0xb7126a[_0x3f1878(0x192)],'toCode':_0xb7126a[_0x3f1878(0x1ad)],'toTable':_0xb7126a['toTableName'],'toField':_0xb7126a[_0x3f1878(0x1d4)],'labelField':_0xb7126a[_0x3f1878(0x1a7)]||undefined})):[],'relatedPages':normalizeRelatedPages(_0x54257c[_0x3f1878(0x199)]),...Array['isArray'](_0x54257c['columnCodeListWithDeleted'])?{'columnCodeListWithDeleted':_0x54257c[_0x3f1878(0x1c9)]}:{},'formatRules':Array[_0x3f1878(0x1b4)](_0x54257c[_0x3f1878(0x19b)])?_0x54257c[_0x3f1878(0x19b)]:[],'validateRules':Array[_0x3f1878(0x1b4)](_0x54257c[_0x3f1878(0x193)])?_0x54257c[_0x3f1878(0x193)]:[],..._0x4a616c!==undefined?{'extend':_0x4a616c}:{},'stats':{'fieldCount':_0x4d6560['length'],'operationCount':_0x18693f[_0x3f1878(0x1a4)]}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xbcf2b4,_0x352c4b){const _0x32bfa7=a18_0x2a1a,_0x14ba6e=_0xbcf2b4();while(!![]){try{const _0x41c125=-parseInt(_0x32bfa7(0x1e6))/0x1*(-parseInt(_0x32bfa7(0x1e3))/0x2)+-parseInt(_0x32bfa7(0x1dc))/0x3+-parseInt(_0x32bfa7(0x1e0))/0x4*(parseInt(_0x32bfa7(0x1e1))/0x5)+-parseInt(_0x32bfa7(0x1e5))/0x6*(-parseInt(_0x32bfa7(0x1e4))/0x7)+-parseInt(_0x32bfa7(0x1db))/0x8*(parseInt(_0x32bfa7(0x1dd))/0x9)+parseInt(_0x32bfa7(0x1df))/0xa*(-parseInt(_0x32bfa7(0x1e7))/0xb)+parseInt(_0x32bfa7(0x1de))/0xc*(parseInt(_0x32bfa7(0x1e2))/0xd);if(_0x41c125===_0x352c4b)break;else _0x14ba6e['push'](_0x14ba6e['shift']());}catch(_0x136fdc){_0x14ba6e['push'](_0x14ba6e['shift']());}}}(a18_0x1911,0x5a548));function a18_0x2a1a(_0x3c6971,_0x1d2dc4){_0x3c6971=_0x3c6971-0x1db;const _0x191113=a18_0x1911();let _0x2a1a80=_0x191113[_0x3c6971];return _0x2a1a80;}function a18_0x1911(){const _0x5d7773=['5ZMjscS','26IbjocG','166GQsqIG','4724860nsGgHK','6pglwwC','1723ogIVhx','4057834vXtTFJ','4648vpoanT','1180113yxUzEw','5706Lkxvom','7709076YeabTu','20ipYZZr','933320NgdvZU'];a18_0x1911=function(){return _0x5d7773;};return a18_0x1911();}import{datasetList}from'../../commands/dataset/list.js';import{datasetDetail}from'../../commands/dataset/detail.js';export const datasetDefinitions=[datasetList,datasetDetail];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x4c5fcb=a19_0x39aa;(function(_0x3d0448,_0x56014b){const _0x580247=a19_0x39aa,_0x2379e9=_0x3d0448();while(!![]){try{const _0x4b32c8=-parseInt(_0x580247(0x1c7))/0x1*(-parseInt(_0x580247(0x1cc))/0x2)+-parseInt(_0x580247(0x1d0))/0x3*(parseInt(_0x580247(0x1b9))/0x4)+-parseInt(_0x580247(0x1bb))/0x5*(-parseInt(_0x580247(0x1be))/0x6)+-parseInt(_0x580247(0x1c5))/0x7+parseInt(_0x580247(0x1ba))/0x8+-parseInt(_0x580247(0x1bc))/0x9*(parseInt(_0x580247(0x1d1))/0xa)+parseInt(_0x580247(0x1c2))/0xb;if(_0x4b32c8===_0x56014b)break;else _0x2379e9['push'](_0x2379e9['shift']());}catch(_0x25f46a){_0x2379e9['push'](_0x2379e9['shift']());}}}(a19_0x24ec,0x48074));function a19_0x39aa(_0x51855f,_0x5922b5){_0x51855f=_0x51855f-0x1b9;const _0x24ec2c=a19_0x24ec();let _0x39aa0e=_0x24ec2c[_0x51855f];return _0x39aa0e;}import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function a19_0x24ec(){const _0x214138=['923205IGAHYC','36BsRhAi','Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)','12oTcVXG','allFields','pkField','code','7120784vovtRv','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','map','1684536lWqAxp','length','38SjdrbY','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','trim','source','datasetKey','2806nYszOa','dbtableConfig','split','tableName','824451mcmOJd','981290GKdXvh','appCode','string','description','8TNfciK','3263088FRbulN'];a19_0x24ec=function(){return _0x214138;};return a19_0x24ec();}export const datasetList={'service':'dataset','command':'list','description':a19_0x4c5fcb(0x1c3),'risk':'read','flags':[{'name':'name','type':a19_0x4c5fcb(0x1d3),'description':a19_0x4c5fcb(0x1bd)},{...CODE_FLAG,'required':![],'description':a19_0x4c5fcb(0x1c8)}],async 'execute'(_0x325576){const _0x51425f=a19_0x4c5fcb,_0x45ea24=_0x325576['str']('name'),_0x10c26c=_0x325576['str'](_0x51425f(0x1c1)),_0x5d43ec=await listDatasets(_0x325576[_0x51425f(0x1d2)],{..._0x45ea24&&{'name':_0x45ea24},..._0x10c26c&&{'code':_0x10c26c}});return{'ok':!![],'data':{'total':_0x5d43ec[_0x51425f(0x1c6)],'datasets':_0x5d43ec[_0x51425f(0x1c4)](_0x1b7d83=>{const _0x50d025=_0x51425f,_0x39ba5c=_0x1b7d83[_0x50d025(0x1cd)]??{};return{'id':_0x1b7d83['id'],'code':_0x1b7d83[_0x50d025(0x1c1)],'name':_0x1b7d83['name'],'source':_0x1b7d83[_0x50d025(0x1ca)],'description':_0x1b7d83[_0x50d025(0x1d4)],'table':_0x39ba5c[_0x50d025(0x1cf)],'datasetKey':_0x39ba5c[_0x50d025(0x1cb)],'pk':_0x39ba5c[_0x50d025(0x1c0)],'fields':_0x39ba5c[_0x50d025(0x1bf)]?_0x39ba5c[_0x50d025(0x1bf)][_0x50d025(0x1ce)](',')[_0x50d025(0x1c4)](_0x229ffc=>_0x229ffc[_0x50d025(0x1c9)]()):[]};})}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0xd4a594=a20_0x46c2;function a20_0x3ca8(){const _0x4ab0c8=['441MSdpRe','⚠\x20Empty\x20(treated\x20as\x20{})','\x20(legacy/compat\x20only)','format','(default:\x20','red','(missing)','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','12978306duDEeZ','log','ClientAk','961248KehMIf','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','\x20\x20Merged\x20Config','yellow','currentApp','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','(default)','locale','version','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','read','2826530AoMzOx','\x20\x20API\x20Endpoints','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','status','(not\x20found)','pageSize','1918RRWxJn','✓\x20Valid\x20JSON','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','\x20\x20─','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','bold','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','438qdoGaR','platform','verbose','length','missing','gray','\x20\x20Auth','\x20\x20runtimeDomain:\x20\x20\x20','(no\x20file)','green','\x20(accessKey)','accessKey','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','(none)','arch','\x20\x20Session\x20check:\x20\x20\x20','1358424RlYrKD','Project','Diagnose\x20CLI\x20configuration\x20and\x20environment','1989392lmTDUw','padEnd','\x20\x20auth\x20(effective):\x20','\x20doctor','52062RQjbaR','doctor','appCode','(set,\x20length=','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','(not\x20set)','repeat'];a20_0x3ca8=function(){return _0x4ab0c8;};return a20_0x3ca8();}(function(_0x1ca56c,_0x5a8b92){const _0x624e48=a20_0x46c2,_0x793b3a=_0x1ca56c();while(!![]){try{const _0x20f2cf=-parseInt(_0x624e48(0xa0))/0x1*(-parseInt(_0x624e48(0xa7))/0x2)+parseInt(_0x624e48(0xd0))/0x3+-parseInt(_0x624e48(0xb7))/0x4+parseInt(_0x624e48(0x9a))/0x5+parseInt(_0x624e48(0xbe))/0x6*(parseInt(_0x624e48(0xc5))/0x7)+parseInt(_0x624e48(0xba))/0x8+-parseInt(_0x624e48(0xcd))/0x9;if(_0x20f2cf===_0x5a8b92)break;else _0x793b3a['push'](_0x793b3a['shift']());}catch(_0x2f0105){_0x793b3a['push'](_0x793b3a['shift']());}}}(a20_0x3ca8,0x4dfd9));function a20_0x46c2(_0x379980,_0x332434){_0x379980=_0x379980-0x94;const _0x3ca8b7=a20_0x3ca8();let _0x46c281=_0x3ca8b7[_0x379980];return _0x46c281;}import a20_0x1791f6 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';import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';async function execute(_0x4e391e){const _0x98e0b8=a20_0x46c2,_0x2fbae8=getCliVersion(),_0x962fe5=buildConfigFromFlags({});await initGlobalEnvironment(_0x962fe5),console[_0x98e0b8(0xce)](),console[_0x98e0b8(0xce)](a20_0x1791f6[_0x98e0b8(0xa5)](CLI_BIN_NAME+_0x98e0b8(0xbd))),console[_0x98e0b8(0xce)](a20_0x1791f6['gray']('─'[_0x98e0b8(0xc4)](0x32))),console[_0x98e0b8(0xce)]('\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20'+_0x2fbae8),console['log']('\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+process[_0x98e0b8(0x97)]),console['log']('\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20'+process[_0x98e0b8(0xa8)]+'\x20'+process[_0x98e0b8(0xb5)]),console['log'](),console[_0x98e0b8(0xce)](a20_0x1791f6['bold']('\x20\x20Config\x20Files')),console[_0x98e0b8(0xce)](a20_0x1791f6[_0x98e0b8(0xac)](_0x98e0b8(0xa3)[_0x98e0b8(0xc4)](0x1e)));const _0x5cdbd5=getGlobalConfigPath(),_0x101205=getProjectConfigPath();console[_0x98e0b8(0xce)]('\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x5cdbd5||a20_0x1791f6[_0x98e0b8(0xac)](_0x98e0b8(0x9e)))),console['log'](_0x98e0b8(0xb3)+(_0x101205||a20_0x1791f6[_0x98e0b8(0xac)](_0x98e0b8(0x9e)))),console[_0x98e0b8(0xce)](),console['log'](a20_0x1791f6['bold']('\x20\x20Config\x20JSON')),console[_0x98e0b8(0xce)](a20_0x1791f6['gray'](_0x98e0b8(0xa3)[_0x98e0b8(0xc4)](0x1e)));const _0x1639f6=(_0x398dc9,_0x47d36e)=>{const _0xe44385=_0x98e0b8;if(!_0x47d36e){console[_0xe44385(0xce)]('\x20\x20'+_0x398dc9[_0xe44385(0xbb)](0x11)+'\x20'+a20_0x1791f6['gray'](_0xe44385(0xaf)));return;}const _0x4dba20=inspectCliConfigJsonFile(_0x47d36e);if(_0x4dba20[_0xe44385(0x9d)]==='ok')console[_0xe44385(0xce)]('\x20\x20'+_0x398dc9[_0xe44385(0xbb)](0x11)+'\x20'+a20_0x1791f6[_0xe44385(0xb0)](_0xe44385(0xa1)));else{if(_0x4dba20[_0xe44385(0x9d)]==='empty')console[_0xe44385(0xce)]('\x20\x20'+_0x398dc9['padEnd'](0x11)+'\x20'+a20_0x1791f6[_0xe44385(0xd3)](_0xe44385(0xc6)));else _0x4dba20[_0xe44385(0x9d)]===_0xe44385(0xab)?console['log']('\x20\x20'+_0x398dc9[_0xe44385(0xbb)](0x11)+'\x20'+a20_0x1791f6['gray'](_0xe44385(0xcb))):(console[_0xe44385(0xce)]('\x20\x20'+_0x398dc9[_0xe44385(0xbb)](0x11)+'\x20'+a20_0x1791f6[_0xe44385(0xca)]('✗\x20Invalid\x20JSON')),console[_0xe44385(0xce)]('\x20\x20'+''[_0xe44385(0xbb)](0x11)+'\x20'+a20_0x1791f6['red'](_0x4dba20['message'])));}};_0x1639f6('Global',_0x5cdbd5),_0x1639f6(_0x98e0b8(0xb8),_0x101205),console[_0x98e0b8(0xce)](),console[_0x98e0b8(0xce)](a20_0x1791f6['bold'](_0x98e0b8(0xd2))),console[_0x98e0b8(0xce)](a20_0x1791f6['gray'](_0x98e0b8(0xa3)[_0x98e0b8(0xc4)](0x1e))),console[_0x98e0b8(0xce)](_0x98e0b8(0x94)+(_0x962fe5[_0x98e0b8(0xc0)]||a20_0x1791f6[_0x98e0b8(0xca)](_0x98e0b8(0xc3)))),console[_0x98e0b8(0xce)](_0x98e0b8(0xa4)+_0x962fe5['env']);const _0x4a5aeb=isLegacyCompatConfigKey(_0x98e0b8(0x96))?a20_0x1791f6[_0x98e0b8(0xac)](_0x962fe5[_0x98e0b8(0x96)]+_0x98e0b8(0xc7)):_0x962fe5[_0x98e0b8(0x96)];return console[_0x98e0b8(0xce)](_0x98e0b8(0x98)+_0x4a5aeb),console[_0x98e0b8(0xce)](_0x98e0b8(0xd1)+(_0x962fe5['defaultApp']||a20_0x1791f6['gray']('(none)'))),console['log']('\x20\x20currentApp:\x20\x20\x20\x20\x20\x20'+(_0x962fe5[_0x98e0b8(0xd4)]||a20_0x1791f6[_0x98e0b8(0xac)](_0x98e0b8(0xb4)))),console[_0x98e0b8(0xce)]('\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x962fe5[_0x98e0b8(0xc8)]||a20_0x1791f6[_0x98e0b8(0xac)](_0x98e0b8(0xc9)+DEFAULT_CONFIG_VALUES[_0x98e0b8(0xc8)]+')'))),console['log'](_0x98e0b8(0xc2)+(_0x962fe5[_0x98e0b8(0x9f)]??a20_0x1791f6['gray'](_0x98e0b8(0x95)))),console[_0x98e0b8(0xce)](_0x98e0b8(0xcc)+_0x962fe5['riskLevel']),console['log']('\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x962fe5[_0x98e0b8(0xa9)]),console[_0x98e0b8(0xce)](_0x98e0b8(0xbc)+AUTH_MODE['ClientAk']),console[_0x98e0b8(0xce)](_0x98e0b8(0xa6)+(_0x962fe5[_0x98e0b8(0xb2)]?a20_0x1791f6[_0x98e0b8(0xb0)](_0x98e0b8(0xc1)+_0x962fe5['accessKey'][_0x98e0b8(0xaa)]+')'):a20_0x1791f6[_0x98e0b8(0xac)](_0x98e0b8(0xb4)))),console[_0x98e0b8(0xce)](),console[_0x98e0b8(0xce)](a20_0x1791f6['bold'](_0x98e0b8(0x9b))),console[_0x98e0b8(0xce)](a20_0x1791f6['gray'](_0x98e0b8(0xa3)['repeat'](0x1e))),console[_0x98e0b8(0xce)](_0x98e0b8(0x9c)+getApiDomain()),console[_0x98e0b8(0xce)](_0x98e0b8(0xa2)+getUserDomain()),console[_0x98e0b8(0xce)](_0x98e0b8(0xae)+getRuntimeDomain()),console['log'](),console['log'](a20_0x1791f6[_0x98e0b8(0xa5)](_0x98e0b8(0xad))),console['log'](a20_0x1791f6[_0x98e0b8(0xac)](_0x98e0b8(0xa3)['repeat'](0x1e))),console['log']('\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+a20_0x1791f6[_0x98e0b8(0xb0)](AUTH_MODE[_0x98e0b8(0xcf)]+_0x98e0b8(0xb1))),console[_0x98e0b8(0xce)](_0x98e0b8(0xb6)+a20_0x1791f6[_0x98e0b8(0xac)]('(removed\x20—\x20cookie\x20auth\x20disabled)')),console[_0x98e0b8(0xce)](),{'ok':!![]};}export const doctorDefinition={'service':a20_0xd4a594(0xbf),'command':'check','description':a20_0xd4a594(0xb9),'risk':a20_0xd4a594(0x99),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a21_0x4ed9b5=a21_0x570d;(function(_0x3fa08e,_0x5a4bfc){const _0x49760e=a21_0x570d,_0x2ca813=_0x3fa08e();while(!![]){try{const _0x587ee3=parseInt(_0x49760e(0xa0))/0x1*(parseInt(_0x49760e(0xd4))/0x2)+parseInt(_0x49760e(0xba))/0x3+-parseInt(_0x49760e(0xd0))/0x4+parseInt(_0x49760e(0xc1))/0x5+-parseInt(_0x49760e(0xbc))/0x6+-parseInt(_0x49760e(0xc2))/0x7+parseInt(_0x49760e(0x96))/0x8;if(_0x587ee3===_0x5a4bfc)break;else _0x2ca813['push'](_0x2ca813['shift']());}catch(_0x523e2a){_0x2ca813['push'](_0x2ca813['shift']());}}}(a21_0x4724,0x3bfc3));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_0x4ed9b5(0xd3),'type':a21_0x4ed9b5(0xbe),'description':a21_0x4ed9b5(0x9f)},{'name':a21_0x4ed9b5(0xd7),'type':a21_0x4ed9b5(0xbe),'description':a21_0x4ed9b5(0x91)+DEFAULT_CONFIG_VALUES[a21_0x4ed9b5(0xd7)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x4ed9b5(0xd5),'type':'boolean','description':a21_0x4ed9b5(0xaf)+PRODUCT_CONFIG['newConfigFileName']+a21_0x4ed9b5(0xc3),'default':![]},{'name':a21_0x4ed9b5(0xd6),'type':a21_0x4ed9b5(0xce),'description':a21_0x4ed9b5(0xcc),'default':![]}];export const initImportFlagDefs=[{'name':a21_0x4ed9b5(0xc9),'type':'string','description':a21_0x4ed9b5(0xaa),'required':!![]},{'name':a21_0x4ed9b5(0xd3),'type':a21_0x4ed9b5(0xbe),'description':a21_0x4ed9b5(0xb3)},{'name':'env','type':a21_0x4ed9b5(0xbe),'description':a21_0x4ed9b5(0xac),'enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x4ed9b5(0xd5),'type':a21_0x4ed9b5(0xce),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a21_0x4ed9b5(0xb0)]+')\x20instead\x20of\x20project','default':![]},{'name':a21_0x4ed9b5(0xd6),'type':a21_0x4ed9b5(0xce),'description':a21_0x4ed9b5(0xcc),'default':![]}];function a21_0x4724(){const _0x39722e=['join','298788rxgcLX','\x0aInitialized\x20','411348PUNgqt','Source\x20file\x20not\x20found:\x20','string','SIGINT','):\x20','771475CESWFe','943453USqZKj',')\x20instead\x20of\x20project','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','defaultApp','validation','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','stdin','file','AbortPrompt','flagMissing','Skip\x20confirmation\x20when\x20overwriting','name','boolean','Imported\x20from\x20','1148544mojDLp','once','Initialized\x20','appcode','15178ZExYVR','global','yes','env','\x20\x20appcode:\x20','[Y/n]','Target\x20environment\x20(default\x20','race','Usage:\x20','App\x20code\x20cannot\x20be\x20empty.','cancelled','2522584HdGcIR','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','utf8','Invalid\x20env\x20\x22','\x20init\x20—\x20Create\x20','close','question','message','Failed\x20to\x20parse\x20source\x20file:\x20','App\x20code\x20for\x20the\x20project','22cYtetb','project','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`.','riskLevel','User\x20aborted\x20prompt','app','object','removeListener','apps','apiDir','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','App\x20code','Override\x20imported\x20default\x20env','cwd','\x20\x20env:\x20\x20\x20\x20\x20','Write\x20to\x20global\x20(~/','newConfigFileName','entries','stdout','Override\x20imported\x20default\x20appcode','trim','includes','\x20\x20default:\x20','log','File\x20'];a21_0x4724=function(){return _0x39722e;};return a21_0x4724();}export async function runInit(_0x72b010){const _0x3496b6=a21_0x4ed9b5,_0x343949=isNonInteractiveMode(_0x72b010),_0x15dea4=_0x72b010[_0x3496b6(0xd5)]?_0x3496b6(0xd5):_0x3496b6(0xa1),_0x33a2f2=resolveWriteConfigPath(_0x15dea4);try{_0x343949?await runNonInteractive(_0x72b010,_0x33a2f2):await runInteractive(_0x72b010,_0x33a2f2);}catch(_0x55da27){if(_0x55da27 instanceof AbortPrompt)throw CliErrors[_0x3496b6(0x95)]();throw _0x55da27;}}export async function runInitImport(_0x67a0f3){const _0x488587=a21_0x4ed9b5,_0x3759fe=_0x67a0f3[_0x488587(0xd5)]?_0x488587(0xd5):_0x488587(0xa1),_0x56e1f5=resolveWriteConfigPath(_0x3759fe);await runFromImport(_0x67a0f3,_0x56e1f5);}const RUNTIME_IRRELEVANT_KEYS=new Set([a21_0x4ed9b5(0xa9)]);async function runFromImport(_0x2dee68,_0x3d3101){const _0x1207e1=a21_0x4ed9b5,_0x1c7080=resolveFilePath(_0x2dee68[_0x1207e1(0xc9)]);if(!existsSync(_0x1c7080))throw CliErrors[_0x1207e1(0xc6)](_0x1207e1(0xbd)+_0x1c7080);const _0x47c3b9=readSourceFile(_0x1c7080),_0x2797c7=convertToRuntimeConfig(_0x47c3b9);_0x2dee68[_0x1207e1(0xd3)]&&(_0x2797c7[_0x1207e1(0xd3)]=String(_0x2dee68[_0x1207e1(0xd3)]));_0x2dee68['env']&&(_0x2797c7[_0x1207e1(0xd7)]=resolveInitEnv(_0x2dee68));if(!_0x2797c7['appcode'])throw CliErrors[_0x1207e1(0xc6)]('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.',_0x1207e1(0xa2));await writeInitConfig(_0x3d3101,_0x2797c7,_0x2dee68),console[_0x1207e1(0xb7)](_0x1207e1(0xcf)+_0x1c7080),console[_0x1207e1(0xb7)]('\x20\x20config:\x20\x20'+_0x3d3101),console[_0x1207e1(0xb7)]('\x20\x20appcode:\x20'+_0x2797c7[_0x1207e1(0xd3)]);if(_0x2797c7[_0x1207e1(0xc5)])console['log'](_0x1207e1(0xb6)+_0x2797c7[_0x1207e1(0xc5)]);}function convertToRuntimeConfig(_0x1c447b){const _0x529850=a21_0x4ed9b5;if(_0x1c447b[_0x529850(0xa8)]&&typeof _0x1c447b[_0x529850(0xa8)]===_0x529850(0xa6))throw CliErrors[_0x529850(0xc6)](_0x529850(0x97),_0x529850(0xc4));const _0x18591c={};for(const _0x1823f4 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x1c447b[_0x1823f4]!==undefined&&(_0x18591c[_0x1823f4]=_0x1c447b[_0x1823f4]);}return!_0x18591c['riskLevel']&&(_0x18591c['riskLevel']=DEFAULT_CONFIG_VALUES[_0x529850(0xa3)]),_0x18591c;}async function runNonInteractive(_0x2a4e35,_0x2ad348){const _0x149086=a21_0x4ed9b5,_0x21d135=_0x2a4e35[_0x149086(0xd3)];if(!_0x21d135)throw CliErrors[_0x149086(0xcb)](_0x149086(0xd3),_0x149086(0x93)+CLI_BIN_NAME+_0x149086(0xc7));const _0x182f34=resolveInitEnv(_0x2a4e35);await writeInitConfig(_0x2ad348,{'appcode':_0x21d135,'env':_0x182f34},_0x2a4e35),console[_0x149086(0xb7)](_0x149086(0xd2)+_0x2ad348),console[_0x149086(0xb7)](_0x149086(0xd8)+_0x21d135),console[_0x149086(0xb7)](_0x149086(0xae)+_0x182f34);}async function runInteractive(_0x18bad3,_0x4e983a){const _0x1d8d00=a21_0x4ed9b5,_0x582073=loadExisting(_0x4e983a),_0x13a51b=typeof _0x582073?.[_0x1d8d00(0xd3)]===_0x1d8d00(0xbe)?_0x582073[_0x1d8d00(0xd3)]:'',_0x1862b5=resolveInitEnv(_0x18bad3);console['log'](CLI_BIN_NAME+_0x1d8d00(0x9a)+PRODUCT_CONFIG[_0x1d8d00(0xb0)]+'\x0a');if(existsSync(_0x4e983a)&&!_0x18bad3[_0x1d8d00(0xd6)]){const _0x35f7d2=await promptYesNo(_0x1d8d00(0xb8)+_0x4e983a+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x35f7d2){console[_0x1d8d00(0xb7)]('Aborted.');return;}}const _0x17d8a8=typeof _0x18bad3[_0x1d8d00(0xd3)]===_0x1d8d00(0xbe)?_0x18bad3[_0x1d8d00(0xd3)]['trim']():'';let _0xd4cda0=_0x17d8a8;!_0xd4cda0&&(_0xd4cda0=await promptInput(_0x1d8d00(0xab),_0x13a51b));if(!_0xd4cda0[_0x1d8d00(0xb4)]())throw CliErrors['validation'](_0x1d8d00(0x94));await writeInitConfig(_0x4e983a,{'appcode':_0xd4cda0[_0x1d8d00(0xb4)](),'env':_0x1862b5},_0x18bad3),console[_0x1d8d00(0xb7)](_0x1d8d00(0xbb)+_0x4e983a),console[_0x1d8d00(0xb7)](_0x1d8d00(0xd8)+_0xd4cda0[_0x1d8d00(0xb4)]()),console[_0x1d8d00(0xb7)](_0x1d8d00(0xae)+_0x1862b5);}async function writeInitConfig(_0x3245e5,_0xf94448,_0x445918){const _0x2eb7a6=a21_0x4ed9b5;let _0x377ee1={};existsSync(_0x3245e5)&&!_0x445918[_0x2eb7a6(0xd6)]&&(_0x377ee1=readConfigFile(_0x3245e5));for(const [_0x1ba4f6,_0x3489d8]of Object[_0x2eb7a6(0xb1)](_0xf94448)){_0x3489d8!==undefined&&(_0x377ee1[_0x1ba4f6]=_0x3489d8);}if(_0x377ee1['app'])delete _0x377ee1[_0x2eb7a6(0xa5)];writeConfigFile(_0x3245e5,_0x377ee1);}class AbortPrompt extends Error{constructor(){const _0x3450be=a21_0x4ed9b5;super(_0x3450be(0xa4)),this[_0x3450be(0xcd)]=_0x3450be(0xca);}}function a21_0x570d(_0x953b75,_0x4d9701){_0x953b75=_0x953b75-0x91;const _0x472458=a21_0x4724();let _0x570d9b=_0x472458[_0x953b75];return _0x570d9b;}function createSafeRl(){const _0x2ff9f1=a21_0x4ed9b5,_0xc82dd4=createInterface({'input':process[_0x2ff9f1(0xc8)],'output':process[_0x2ff9f1(0xb2)]});let _0x482144;const _0x48bc39=new Promise((_0x50223f,_0x50039f)=>{const _0x99be54=_0x2ff9f1;_0x482144=()=>{const _0x3207dc=a21_0x570d;_0x482144&&(_0xc82dd4['removeListener'](_0x3207dc(0xbf),_0x482144),_0x482144=undefined);try{_0xc82dd4[_0x3207dc(0x9b)]();}catch{}_0x50039f(new AbortPrompt());},_0xc82dd4[_0x99be54(0xd1)](_0x99be54(0xbf),_0x482144);}),_0xb06737=()=>{const _0x3069e1=_0x2ff9f1;_0x482144&&(_0xc82dd4[_0x3069e1(0xa7)](_0x3069e1(0xbf),_0x482144),_0x482144=undefined);try{_0xc82dd4[_0x3069e1(0x9b)]();}catch{}};return{'rl':_0xc82dd4,'abortPromise':_0x48bc39,'disposeSuccess':_0xb06737};}async function promptInput(_0x336be8,_0x2814d4){const _0x4b7ddc=a21_0x4ed9b5,{rl:_0x4dd974,abortPromise:_0x2b3a50,disposeSuccess:_0x2edef9}=createSafeRl(),_0x3af510=new Promise(_0x2c5d36=>{const _0x59aa19=a21_0x570d,_0x323ed2=_0x2814d4?'\x20\x20'+_0x336be8+'\x20('+_0x2814d4+_0x59aa19(0xc0):'\x20\x20'+_0x336be8+':\x20';_0x4dd974[_0x59aa19(0x9c)](_0x323ed2,_0x518f95=>{_0x2edef9(),_0x2c5d36(_0x518f95['trim']()||_0x2814d4);});});return Promise[_0x4b7ddc(0x92)]([_0x3af510,_0x2b3a50]);}async function promptYesNo(_0x2c3562,_0x4d1a2b){const _0x5697f3=a21_0x4ed9b5,{rl:_0x1d0b58,abortPromise:_0x3975ec,disposeSuccess:_0x645a8}=createSafeRl(),_0x23cf48=new Promise(_0x5d3a7f=>{const _0xb88847=a21_0x570d,_0x503722=_0x4d1a2b?_0xb88847(0xd9):'[y/N]';_0x1d0b58['question']('\x20\x20'+_0x2c3562+'\x20'+_0x503722+':\x20',_0xd74dd6=>{const _0x501e5f=_0xb88847;_0x645a8();const _0x4f9c4a=_0xd74dd6[_0x501e5f(0xb4)]()['toLowerCase']();if(_0x4f9c4a==='y'||_0x4f9c4a===_0x501e5f(0xd6))_0x5d3a7f(!![]);else{if(_0x4f9c4a==='n'||_0x4f9c4a==='no')_0x5d3a7f(![]);else _0x5d3a7f(_0x4d1a2b);}});});return Promise[_0x5697f3(0x92)]([_0x23cf48,_0x3975ec]);}function loadExisting(_0x45f8aa){if(!existsSync(_0x45f8aa))return null;return readConfigFile(_0x45f8aa);}function resolveFilePath(_0x3d1522){const _0x4db6e5=a21_0x4ed9b5;return isAbsolute(_0x3d1522)?_0x3d1522:resolve(process[_0x4db6e5(0xad)](),_0x3d1522);}function readSourceFile(_0x4374bc){const _0x2e5208=a21_0x4ed9b5;try{const _0x353cac=readFileSync(_0x4374bc,{'encoding':_0x2e5208(0x98)});return JSON['parse'](_0x353cac);}catch(_0x4f0d35){throw CliErrors[_0x2e5208(0xc6)](_0x2e5208(0x9e)+_0x4f0d35[_0x2e5208(0x9d)]);}}function resolveInitEnv(_0x3ebdf4){const _0x54573c=a21_0x4ed9b5,_0xfb6d1e=_0x3ebdf4[_0x54573c(0xd7)];if(_0xfb6d1e===undefined||_0xfb6d1e==='')return DEFAULT_CONFIG_VALUES[_0x54573c(0xd7)];if(!RUNTIME_ENV_VALUES[_0x54573c(0xb5)](_0xfb6d1e))throw CliErrors[_0x54573c(0xc6)](_0x54573c(0x99)+_0xfb6d1e+'\x22.\x20Allowed:\x20'+RUNTIME_ENV_VALUES[_0x54573c(0xb9)](',\x20'));return _0xfb6d1e;}
|
|
1
|
+
const a21_0xccaa42=a21_0x3bda;(function(_0x2f5b8c,_0x3f3736){const _0x48cf15=a21_0x3bda,_0x150983=_0x2f5b8c();while(!![]){try{const _0x32fb25=parseInt(_0x48cf15(0x182))/0x1*(parseInt(_0x48cf15(0x18b))/0x2)+parseInt(_0x48cf15(0x16c))/0x3*(parseInt(_0x48cf15(0x17a))/0x4)+parseInt(_0x48cf15(0x18f))/0x5+parseInt(_0x48cf15(0x15f))/0x6*(parseInt(_0x48cf15(0x183))/0x7)+parseInt(_0x48cf15(0x16a))/0x8+parseInt(_0x48cf15(0x174))/0x9+-parseInt(_0x48cf15(0x17c))/0xa;if(_0x32fb25===_0x3f3736)break;else _0x150983['push'](_0x150983['shift']());}catch(_0x9d5ad3){_0x150983['push'](_0x150983['shift']());}}}(a21_0x25e8,0xd4028));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_0xccaa42(0x184),'type':a21_0xccaa42(0x165),'description':a21_0xccaa42(0x169)},{'name':'env','type':a21_0xccaa42(0x165),'description':a21_0xccaa42(0x186)+DEFAULT_CONFIG_VALUES[a21_0xccaa42(0x15a)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0xccaa42(0x167),'type':a21_0xccaa42(0x159),'description':a21_0xccaa42(0x185)+PRODUCT_CONFIG[a21_0xccaa42(0x16f)]+a21_0xccaa42(0x158),'default':![]},{'name':a21_0xccaa42(0x190),'type':a21_0xccaa42(0x159),'description':a21_0xccaa42(0x175),'default':![]}];export const initImportFlagDefs=[{'name':a21_0xccaa42(0x191),'type':'string','description':a21_0xccaa42(0x177),'required':!![]},{'name':a21_0xccaa42(0x184),'type':a21_0xccaa42(0x165),'description':a21_0xccaa42(0x196)},{'name':a21_0xccaa42(0x15a),'type':a21_0xccaa42(0x165),'description':a21_0xccaa42(0x17f),'enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0xccaa42(0x167),'type':'boolean','description':a21_0xccaa42(0x185)+PRODUCT_CONFIG[a21_0xccaa42(0x16f)]+a21_0xccaa42(0x158),'default':![]},{'name':a21_0xccaa42(0x190),'type':'boolean','description':a21_0xccaa42(0x175),'default':![]}];export async function runInit(_0x10177a){const _0x2a2962=a21_0xccaa42,_0x9b72c2=isNonInteractiveMode(_0x10177a),_0x3baacf=_0x10177a[_0x2a2962(0x167)]?_0x2a2962(0x167):_0x2a2962(0x16d),_0x3613bc=resolveWriteConfigPath(_0x3baacf);try{_0x9b72c2?await runNonInteractive(_0x10177a,_0x3613bc):await runInteractive(_0x10177a,_0x3613bc);}catch(_0x22c79d){if(_0x22c79d instanceof AbortPrompt)throw CliErrors[_0x2a2962(0x189)]();throw _0x22c79d;}}export async function runInitImport(_0x1a69cd){const _0x2767b0=a21_0xccaa42,_0x4111e8=_0x1a69cd[_0x2767b0(0x167)]?_0x2767b0(0x167):_0x2767b0(0x16d),_0x71567e=resolveWriteConfigPath(_0x4111e8);await runFromImport(_0x1a69cd,_0x71567e);}const RUNTIME_IRRELEVANT_KEYS=new Set([a21_0xccaa42(0x198)]);function a21_0x3bda(_0x4ec4e1,_0x1d7d11){_0x4ec4e1=_0x4ec4e1-0x155;const _0x25e8c0=a21_0x25e8();let _0x3bda7f=_0x25e8c0[_0x4ec4e1];return _0x3bda7f;}async function runFromImport(_0x13dbb5,_0xe9380b){const _0x35352e=a21_0xccaa42,_0x1056b3=resolveFilePath(_0x13dbb5['file']);if(!existsSync(_0x1056b3))throw CliErrors['validation'](_0x35352e(0x193)+_0x1056b3);const _0x46febe=readSourceFile(_0x1056b3),_0x553c2d=convertToRuntimeConfig(_0x46febe);_0x13dbb5['appcode']&&(_0x553c2d[_0x35352e(0x184)]=String(_0x13dbb5[_0x35352e(0x184)]));_0x13dbb5[_0x35352e(0x15a)]&&(_0x553c2d[_0x35352e(0x15a)]=resolveInitEnv(_0x13dbb5));if(!_0x553c2d['appcode'])throw CliErrors['validation'](_0x35352e(0x199),'Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.');await writeInitConfig(_0xe9380b,_0x553c2d,_0x13dbb5),console[_0x35352e(0x188)](_0x35352e(0x172)+_0x1056b3),console[_0x35352e(0x188)](_0x35352e(0x160)+_0xe9380b),console[_0x35352e(0x188)](_0x35352e(0x18a)+_0x553c2d['appcode']);if(_0x553c2d[_0x35352e(0x161)])console[_0x35352e(0x188)](_0x35352e(0x187)+_0x553c2d[_0x35352e(0x161)]);}function convertToRuntimeConfig(_0x25391e){const _0x161542=a21_0xccaa42;if(_0x25391e['apps']&&typeof _0x25391e[_0x161542(0x192)]==='object')throw CliErrors['validation'](_0x161542(0x195),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x5c0e36={};for(const _0x35ffb4 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x25391e[_0x35ffb4]!==undefined&&(_0x5c0e36[_0x35ffb4]=_0x25391e[_0x35ffb4]);}return!_0x5c0e36['riskLevel']&&(_0x5c0e36[_0x161542(0x170)]=DEFAULT_CONFIG_VALUES[_0x161542(0x170)]),_0x5c0e36;}async function runNonInteractive(_0x114a61,_0x47e409){const _0x4d7050=a21_0xccaa42,_0x3f5322=_0x114a61[_0x4d7050(0x184)];if(!_0x3f5322)throw CliErrors[_0x4d7050(0x16b)]('appcode',_0x4d7050(0x181)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x234fa5=resolveInitEnv(_0x114a61);await writeInitConfig(_0x47e409,{'appcode':_0x3f5322,'env':_0x234fa5},_0x114a61),console['log'](_0x4d7050(0x171)+_0x47e409),console[_0x4d7050(0x188)](_0x4d7050(0x18a)+_0x3f5322),console[_0x4d7050(0x188)](_0x4d7050(0x173)+_0x234fa5);}async function runInteractive(_0x94383,_0x40cefe){const _0x25cd51=a21_0xccaa42,_0x19daa8=loadExisting(_0x40cefe),_0x1484e2=typeof _0x19daa8?.[_0x25cd51(0x184)]===_0x25cd51(0x165)?_0x19daa8[_0x25cd51(0x184)]:'',_0x40341f=resolveInitEnv(_0x94383);console['log'](CLI_BIN_NAME+_0x25cd51(0x157)+PRODUCT_CONFIG[_0x25cd51(0x16f)]+'\x0a');if(existsSync(_0x40cefe)&&!_0x94383['yes']){const _0x56e982=await promptYesNo(_0x25cd51(0x18c)+_0x40cefe+_0x25cd51(0x15c),![]);if(!_0x56e982){console[_0x25cd51(0x188)](_0x25cd51(0x18d));return;}}const _0xb2eb7c=typeof _0x94383['appcode']==='string'?_0x94383['appcode']['trim']():'';let _0x3e82ba=_0xb2eb7c;!_0x3e82ba&&(_0x3e82ba=await promptInput(_0x25cd51(0x17e),_0x1484e2));if(!_0x3e82ba['trim']())throw CliErrors['validation']('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x40cefe,{'appcode':_0x3e82ba[_0x25cd51(0x164)](),'env':_0x40341f},_0x94383),console[_0x25cd51(0x188)]('\x0aInitialized\x20'+_0x40cefe),console[_0x25cd51(0x188)](_0x25cd51(0x18a)+_0x3e82ba[_0x25cd51(0x164)]()),console[_0x25cd51(0x188)](_0x25cd51(0x173)+_0x40341f);}async function writeInitConfig(_0x3969a8,_0x235af5,_0x4165a7){const _0x276941=a21_0xccaa42;let _0x185da7={};existsSync(_0x3969a8)&&!_0x4165a7[_0x276941(0x190)]&&(_0x185da7=readConfigFile(_0x3969a8));for(const [_0x5e0b15,_0x260602]of Object[_0x276941(0x15d)](_0x235af5)){_0x260602!==undefined&&(_0x185da7[_0x5e0b15]=_0x260602);}if(_0x185da7[_0x276941(0x162)])delete _0x185da7[_0x276941(0x162)];writeConfigFile(_0x3969a8,_0x185da7);}class AbortPrompt extends Error{constructor(){const _0x4a9d62=a21_0xccaa42;super('User\x20aborted\x20prompt'),this[_0x4a9d62(0x180)]=_0x4a9d62(0x17d);}}function createSafeRl(){const _0x5b6eac=a21_0xccaa42,_0x1d8da8=createInterface({'input':process[_0x5b6eac(0x178)],'output':process['stdout']});let _0x30b417;const _0x3d0c27=new Promise((_0x2a9d4e,_0x3115ad)=>{const _0x445841=_0x5b6eac;_0x30b417=()=>{const _0x65e2a0=a21_0x3bda;_0x30b417&&(_0x1d8da8[_0x65e2a0(0x166)](_0x65e2a0(0x18e),_0x30b417),_0x30b417=undefined);try{_0x1d8da8[_0x65e2a0(0x155)]();}catch{}_0x3115ad(new AbortPrompt());},_0x1d8da8[_0x445841(0x179)](_0x445841(0x18e),_0x30b417);}),_0x154898=()=>{const _0xa6bc7e=_0x5b6eac;_0x30b417&&(_0x1d8da8[_0xa6bc7e(0x166)](_0xa6bc7e(0x18e),_0x30b417),_0x30b417=undefined);try{_0x1d8da8[_0xa6bc7e(0x155)]();}catch{}};return{'rl':_0x1d8da8,'abortPromise':_0x3d0c27,'disposeSuccess':_0x154898};}async function promptInput(_0x5c7d12,_0x168a86){const {rl:_0x51afb6,abortPromise:_0x33b8cd,disposeSuccess:_0x3aa1e2}=createSafeRl(),_0x405f59=new Promise(_0x268932=>{const _0x155060=a21_0x3bda,_0x794ae3=_0x168a86?'\x20\x20'+_0x5c7d12+'\x20('+_0x168a86+'):\x20':'\x20\x20'+_0x5c7d12+':\x20';_0x51afb6[_0x155060(0x16e)](_0x794ae3,_0x3032c3=>{const _0x17a652=_0x155060;_0x3aa1e2(),_0x268932(_0x3032c3[_0x17a652(0x164)]()||_0x168a86);});});return Promise['race']([_0x405f59,_0x33b8cd]);}async function promptYesNo(_0x55995f,_0x1759b6){const {rl:_0x4622fc,abortPromise:_0x3fd620,disposeSuccess:_0x58a3af}=createSafeRl(),_0x4e0346=new Promise(_0x566de3=>{const _0xccc7c3=a21_0x3bda,_0x1cd9fe=_0x1759b6?_0xccc7c3(0x197):_0xccc7c3(0x17b);_0x4622fc[_0xccc7c3(0x16e)]('\x20\x20'+_0x55995f+'\x20'+_0x1cd9fe+':\x20',_0x144326=>{const _0x5e5ab0=_0xccc7c3;_0x58a3af();const _0x33f8f8=_0x144326[_0x5e5ab0(0x164)]()[_0x5e5ab0(0x163)]();if(_0x33f8f8==='y'||_0x33f8f8===_0x5e5ab0(0x190))_0x566de3(!![]);else{if(_0x33f8f8==='n'||_0x33f8f8==='no')_0x566de3(![]);else _0x566de3(_0x1759b6);}});});return Promise['race']([_0x4e0346,_0x3fd620]);}function loadExisting(_0x5a50a7){if(!existsSync(_0x5a50a7))return null;return readConfigFile(_0x5a50a7);}function resolveFilePath(_0x2d2aae){const _0x262788=a21_0xccaa42;return isAbsolute(_0x2d2aae)?_0x2d2aae:resolve(process[_0x262788(0x176)](),_0x2d2aae);}function a21_0x25e8(){const _0x36fa8d=['Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','close','parse','\x20init\x20—\x20Create\x20',')\x20instead\x20of\x20project','boolean','env','validation','\x20already\x20exists.\x20Overwrite?','entries','message','2982ERhpWj','\x20\x20config:\x20\x20','defaultApp','app','toLowerCase','trim','string','removeListener','global','utf8','App\x20code\x20for\x20the\x20project','2105664MaxGud','flagMissing','3tyosKz','project','question','newConfigFileName','riskLevel','Initialized\x20','Imported\x20from\x20','\x20\x20env:\x20\x20\x20\x20\x20','12681AJEmud','Skip\x20confirmation\x20when\x20overwriting','cwd','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','stdin','once','6221552gjIiYu','[y/N]','30898950lrTJUJ','AbortPrompt','App\x20code','Override\x20imported\x20default\x20env','name','Usage:\x20','2HMzDUy','2646wOWNrH','appcode','Write\x20to\x20global\x20(~/','Target\x20environment\x20(default\x20','\x20\x20default:\x20','log','cancelled','\x20\x20appcode:\x20','1602928XIGOgF','File\x20','Aborted.','SIGINT','1737440RkMLRU','yes','file','apps','Source\x20file\x20not\x20found:\x20','Invalid\x20env\x20\x22','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Override\x20imported\x20default\x20appcode','[Y/n]','apiDir'];a21_0x25e8=function(){return _0x36fa8d;};return a21_0x25e8();}function readSourceFile(_0x56d443){const _0x597864=a21_0xccaa42;try{const _0x14b105=readFileSync(_0x56d443,{'encoding':_0x597864(0x168)});return JSON[_0x597864(0x156)](_0x14b105);}catch(_0x8fe261){throw CliErrors[_0x597864(0x15b)]('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x8fe261[_0x597864(0x15e)]);}}function resolveInitEnv(_0x574b08){const _0xb68782=a21_0xccaa42,_0x1651df=_0x574b08[_0xb68782(0x15a)];if(_0x1651df===undefined||_0x1651df==='')return DEFAULT_CONFIG_VALUES[_0xb68782(0x15a)];if(!RUNTIME_ENV_VALUES['includes'](_0x1651df))throw CliErrors[_0xb68782(0x15b)](_0xb68782(0x194)+_0x1651df+'\x22.\x20Allowed:\x20'+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x1651df;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a22_0x166321=a22_0x16c3;(function(_0x57fe43,_0x4d836f){const _0x545d41=a22_0x16c3,_0x56124d=_0x57fe43();while(!![]){try{const _0x574822=parseInt(_0x545d41(0xe8))/0x1*(parseInt(_0x545d41(0xf9))/0x2)+parseInt(_0x545d41(0x110))/0x3+parseInt(_0x545d41(0xee))/0x4*(parseInt(_0x545d41(0xfc))/0x5)+-parseInt(_0x545d41(0x115))/0x6*(parseInt(_0x545d41(0x11d))/0x7)+parseInt(_0x545d41(0x11f))/0x8*(parseInt(_0x545d41(0x10a))/0x9)+parseInt(_0x545d41(0x103))/0xa+parseInt(_0x545d41(0x118))/0xb*(-parseInt(_0x545d41(0x121))/0xc);if(_0x574822===_0x4d836f)break;else _0x56124d['push'](_0x56124d['shift']());}catch(_0x5321f3){_0x56124d['push'](_0x56124d['shift']());}}}(a22_0x4a59,0xf1a62));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_0x166321(0x114),'type':a22_0x166321(0x128),'required':!![],'description':'Personal\x20knowledge-base\x20entry\x20title'},FILE_FLAG={'name':a22_0x166321(0x125),'type':a22_0x166321(0x128),'required':!![],'description':a22_0x166321(0x107)},QUERY_FLAG={'name':a22_0x166321(0xfe),'type':'string','required':!![],'description':a22_0x166321(0x112)},TOPK_FLAG={'name':a22_0x166321(0x113),'type':a22_0x166321(0xf4),'description':a22_0x166321(0x11a)};function readKnowledgeFile(_0x1d70e3){const _0x9c61f9=a22_0x166321;if(!_0x1d70e3)throw CliErrors[_0x9c61f9(0x119)](_0x9c61f9(0x117));if(!existsSync(_0x1d70e3))throw CliErrors[_0x9c61f9(0x119)](_0x9c61f9(0xfd)+_0x1d70e3);if(!statSync(_0x1d70e3)['isFile']())throw CliErrors[_0x9c61f9(0x119)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x1d70e3);return readFileSync(_0x1d70e3,_0x9c61f9(0xe7));}function summarizePersonalItem(_0x16604e){const _0x279962=a22_0x166321;return{'id':_0x16604e['id'],'title':_0x16604e[_0x279962(0x114)],'version':_0x16604e[_0x279962(0xf1)],'ragStatus':_0x16604e[_0x279962(0x11e)],'ragErrorMessage':_0x16604e['ragErrorMessage'],'updateTime':_0x16604e['updateTime']};}function a22_0x16c3(_0x3fe5fd,_0x5d4a30){_0x3fe5fd=_0x3fe5fd-0xe6;const _0x4a59b6=a22_0x4a59();let _0x16c365=_0x4a59b6[_0x3fe5fd];return _0x16c365;}function detailPersonalItem(_0x166a59){const _0x250b3c=a22_0x166321;return{'id':_0x166a59['id'],'appCode':_0x166a59[_0x250b3c(0xea)],'scope':_0x166a59[_0x250b3c(0x129)],'userId':_0x166a59[_0x250b3c(0xf7)],'title':_0x166a59[_0x250b3c(0x114)],'content':_0x166a59['content']??'','version':_0x166a59[_0x250b3c(0xf1)],'ragStatus':_0x166a59[_0x250b3c(0x11e)],'ragErrorMessage':_0x166a59[_0x250b3c(0x12a)],'createTime':_0x166a59[_0x250b3c(0x105)],'updateTime':_0x166a59[_0x250b3c(0x111)]};}function summarizeSearchHit(_0xdf0d2d){const _0x404394=a22_0x166321;return{'scope':_0xdf0d2d[_0x404394(0x129)],'docId':_0xdf0d2d['docId'],'score':_0xdf0d2d['score'],'weightedScore':_0xdf0d2d[_0x404394(0x10f)],'content':_0xdf0d2d[_0x404394(0x10d)],'metadata':_0xdf0d2d[_0x404394(0x126)]};}function readTopK(_0xf1fb1e){const _0x46be76=a22_0x166321,_0x29eff4=_0xf1fb1e['flag'](_0x46be76(0x113));if(_0x29eff4===undefined||_0x29eff4===null||_0x29eff4==='')return undefined;const _0xba73c3=_0xf1fb1e[_0x46be76(0x101)](_0x46be76(0x113));if(!Number[_0x46be76(0x11b)](_0xba73c3)||_0xba73c3<0x1)throw CliErrors[_0x46be76(0x119)](_0x46be76(0xe6));return _0xba73c3;}function a22_0x4a59(){const _0x261d32=['Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','version','Override\x20the\x20existing\x20entry\x20title','Personal\x20knowledge-base\x20entry\x20ID','number','Updated\x20KB\x20entry\x20','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','userId','create','26tEqRCM','body','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','125tAiIfF','File\x20not\x20found:\x20','query','bool','description','num','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','8115560jEtVSe','/client/knowledge-base/personal/create','createTime','verbose','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','length','Created\x20KB\x20entry\x20','99fOjXVG','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','/update','content','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','weightedScore','3886815FbOoYl','updateTime','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','topk','title','114KnfdND','POST','File\x20path\x20is\x20required.','2779645IBWJGt','validation','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','isFinite','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','528640EFgIIy','ragStatus','724912zalPxV','update','120yFquSU','read','list','/client/knowledge-base/personal/','file','metadata','detail','string','scope','ragErrorMessage','build','--topk\x20must\x20be\x20a\x20positive\x20number.','utf8','16618MUhgQT','Search\x20query\x20is\x20required.','appCode','trim','write','str','261068zqKBfG','map'];a22_0x4a59=function(){return _0x261d32;};return a22_0x4a59();}const kbList={'service':'kb','command':a22_0x166321(0x123),'description':a22_0x166321(0x10b),'risk':a22_0x166321(0x122),'flags':[VERBOSE_FLAG],async 'execute'(_0x274958){const _0x3ab873=a22_0x166321,_0x15cffd=await listPersonalKnowledgeBaseItems(_0x274958[_0x3ab873(0xea)]);if(_0x274958[_0x3ab873(0xff)](_0x3ab873(0x106)))return{'ok':!![],'data':{'total':_0x15cffd['length'],'items':_0x15cffd}};return{'ok':!![],'data':{'total':_0x15cffd['length'],'items':_0x15cffd[_0x3ab873(0xef)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a22_0x166321(0x127),'description':a22_0x166321(0x102),'risk':a22_0x166321(0x122),'flags':[{...ID_FLAG,'description':a22_0x166321(0xf3)}],async 'execute'(_0x20f295){const _0x3a14e4=a22_0x166321,_0x450a48=await getPersonalKnowledgeBaseItem(_0x20f295[_0x3a14e4(0x101)]('id'),_0x20f295['appCode']);return{'ok':!![],'data':detailPersonalItem(_0x450a48)};}},kbCreate={'service':'kb','command':a22_0x166321(0xf8),'description':a22_0x166321(0x10e),'risk':a22_0x166321(0xec),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x6f476f){const _0x2570e9=a22_0x166321,_0x4cdffc=_0x6f476f['str']('title'),_0x575ab2=readKnowledgeFile(_0x6f476f['str'](_0x2570e9(0x125))),_0x34aaa3=await createPersonalKnowledgeBaseItem(_0x6f476f[_0x2570e9(0xea)],{'title':_0x4cdffc,'content':_0x575ab2});return{'ok':!![],'data':summarizePersonalItem(_0x34aaa3),'message':_0x2570e9(0x109)+_0x34aaa3['id']+'\x20('+_0x34aaa3[_0x2570e9(0x114)]+')'};},async 'dryRun'(_0x6da4b9){const _0x37a832=a22_0x166321,_0x5af745=_0x6da4b9['str']('title'),_0x2a4373=readKnowledgeFile(_0x6da4b9[_0x37a832(0xed)](_0x37a832(0x125)));return dryRun(_0x37a832(0x116),_0x37a832(0x104))[_0x37a832(0xfa)]({'appCode':_0x6da4b9['appCode'],'title':_0x5af745,'content':_0x2a4373})[_0x37a832(0x100)](_0x37a832(0x11c)+_0x5af745+'\x22')[_0x37a832(0x12b)]();}},kbUpdate={'service':'kb','command':a22_0x166321(0x120),'description':a22_0x166321(0xf6),'risk':'write','flags':[{...ID_FLAG,'description':'Personal\x20knowledge-base\x20entry\x20ID'},{...TITLE_FLAG,'required':![],'description':a22_0x166321(0xf2)},FILE_FLAG],async 'execute'(_0x5d3719){const _0x283c10=a22_0x166321,_0x4c1771=_0x5d3719[_0x283c10(0x101)]('id'),_0x1d2513=readKnowledgeFile(_0x5d3719[_0x283c10(0xed)](_0x283c10(0x125))),_0x431cf9=_0x5d3719['str']('title')||(await getPersonalKnowledgeBaseItem(_0x4c1771,_0x5d3719[_0x283c10(0xea)]))[_0x283c10(0x114)],_0x59b9ca=await updatePersonalKnowledgeBaseItem(_0x4c1771,_0x5d3719[_0x283c10(0xea)],{'title':_0x431cf9,'content':_0x1d2513});return{'ok':!![],'data':summarizePersonalItem(_0x59b9ca),'message':_0x283c10(0xf5)+_0x59b9ca['id']+'\x20('+_0x59b9ca[_0x283c10(0x114)]+')'};},async 'dryRun'(_0x3e8deb){const _0x4d0cf5=a22_0x166321,_0x501566=_0x3e8deb['num']('id'),_0x1e2906=readKnowledgeFile(_0x3e8deb[_0x4d0cf5(0xed)](_0x4d0cf5(0x125))),_0x40f387=_0x3e8deb[_0x4d0cf5(0xed)]('title')||(await getPersonalKnowledgeBaseItem(_0x501566,_0x3e8deb[_0x4d0cf5(0xea)]))[_0x4d0cf5(0x114)];return dryRun(_0x4d0cf5(0x116),_0x4d0cf5(0x124)+_0x501566+_0x4d0cf5(0x10c))[_0x4d0cf5(0xfa)]({'appCode':_0x3e8deb['appCode'],'title':_0x40f387,'content':_0x1e2906})[_0x4d0cf5(0x100)](_0x4d0cf5(0xfb)+_0x501566)[_0x4d0cf5(0x12b)]();}},kbSearch={'service':'kb','command':'search','description':a22_0x166321(0xf0),'risk':a22_0x166321(0x122),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x41cf74){const _0x4f01c0=a22_0x166321;if(!_0x41cf74[_0x4f01c0(0xed)](_0x4f01c0(0xfe))[_0x4f01c0(0xeb)]())throw CliErrors[_0x4f01c0(0x119)](_0x4f01c0(0xe9));readTopK(_0x41cf74);},async 'execute'(_0x2dfc86){const _0x4f98a9=a22_0x166321,_0x5a50e3=_0x2dfc86[_0x4f98a9(0xed)](_0x4f98a9(0xfe))['trim'](),_0x10c5a6=readTopK(_0x2dfc86),_0x46f936=await searchKnowledgeBase(_0x2dfc86[_0x4f98a9(0xea)],{'query':_0x5a50e3,'topK':_0x10c5a6});return{'ok':!![],'data':{'total':_0x46f936[_0x4f98a9(0x108)],'hits':_0x46f936[_0x4f98a9(0xef)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x206ca4=a23_0x5a96;(function(_0x4c0bd6,_0x161ab1){const _0x3ca8b0=a23_0x5a96,_0x20a3aa=_0x4c0bd6();while(!![]){try{const _0x24289a=parseInt(_0x3ca8b0(0x1bf))/0x1+-parseInt(_0x3ca8b0(0x1b6))/0x2*(parseInt(_0x3ca8b0(0x1b2))/0x3)+parseInt(_0x3ca8b0(0x1c1))/0x4*(-parseInt(_0x3ca8b0(0x1a8))/0x5)+-parseInt(_0x3ca8b0(0x1a7))/0x6+-parseInt(_0x3ca8b0(0x1a9))/0x7+-parseInt(_0x3ca8b0(0x1ad))/0x8+parseInt(_0x3ca8b0(0x1c2))/0x9*(parseInt(_0x3ca8b0(0x1c0))/0xa);if(_0x24289a===_0x161ab1)break;else _0x20a3aa['push'](_0x20a3aa['shift']());}catch(_0x3246e5){_0x20a3aa['push'](_0x20a3aa['shift']());}}}(a23_0x55f0,0x94fa8));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function a23_0x5a96(_0x3c51be,_0x52c452){_0x3c51be=_0x3c51be-0x1a7;const _0x55f081=a23_0x55f0();let _0x5a96e8=_0x55f081[_0x3c51be];return _0x5a96e8;}function a23_0x55f0(){const _0x12cbe7=['10mYcLAW','4lzGAtk','38168217nWXGAp','show','\x20\x20\x20Time:\x20','warn','timestamp','clearLogs','readLogs','\x20\x20\x20Duration:\x20','logs','write','6788856XSoola','5604595LOhhUv','3710903wDTPls','*\x20Logs\x20cleared','clear','toLocaleString','875712kpzcHb','duration','length','log','message','3hSNUaZ','details','forEach','stringify','2348358WbZoNy','keys','\x20\x20\x20Details:\x20','level','*\x20No\x20logs\x20found','Clear\x20command\x20history\x20logs','read','success','command','435470bqWcog'];a23_0x55f0=function(){return _0x12cbe7;};return a23_0x55f0();}function printLogs(_0x4b4084){const _0x2666d7=a23_0x5a96;if(_0x4b4084[_0x2666d7(0x1af)]===0x0){console[_0x2666d7(0x1b0)](_0x2666d7(0x1ba));return;}console['log']('*\x20'+CLI_DISPLAY_NAME+'\x20logs:\x0a'),_0x4b4084[_0x2666d7(0x1b4)]((_0x5e532e,_0xcad117)=>{const _0x52299b=_0x2666d7,_0x4d77fe=new Date(_0x5e532e[_0x52299b(0x1c6)])[_0x52299b(0x1ac)]('en-US'),_0x203270=_0x5e532e[_0x52299b(0x1b9)]===_0x52299b(0x1bd)?'√':_0x5e532e[_0x52299b(0x1b9)]==='error'?'×':_0x5e532e['level']===_0x52299b(0x1c5)?'!':'i';console[_0x52299b(0x1b0)](_0xcad117+0x1+'.\x20'+_0x203270+'\x20['+_0x5e532e[_0x52299b(0x1be)]+']\x20'+_0x5e532e[_0x52299b(0x1b1)]),console[_0x52299b(0x1b0)](_0x52299b(0x1c4)+_0x4d77fe),_0x5e532e[_0x52299b(0x1ae)]&&console[_0x52299b(0x1b0)](_0x52299b(0x1c9)+_0x5e532e[_0x52299b(0x1ae)]+'ms'),_0x5e532e[_0x52299b(0x1b3)]&&Object[_0x52299b(0x1b7)](_0x5e532e[_0x52299b(0x1b3)])['length']>0x0&&console[_0x52299b(0x1b0)](_0x52299b(0x1b8)+JSON[_0x52299b(0x1b5)](_0x5e532e[_0x52299b(0x1b3)],null,0x2)),console[_0x52299b(0x1b0)]('');});}export const logsDefinitions=[{'service':'logs','command':a23_0x206ca4(0x1c3),'description':'View\x20command\x20history\x20logs','risk':a23_0x206ca4(0x1bc),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x97858){const _0x3e9461=a23_0x206ca4;return printLogs(logger[_0x3e9461(0x1c8)]()),{'ok':!![]};}},{'service':a23_0x206ca4(0x1ca),'command':a23_0x206ca4(0x1ab),'description':a23_0x206ca4(0x1bb),'risk':a23_0x206ca4(0x1cb),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1b6fd6){const _0x4d2921=a23_0x206ca4;return logger[_0x4d2921(0x1c7)](),console[_0x4d2921(0x1b0)](_0x4d2921(0x1aa)),{'ok':!![]};}}];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a24_0x24c3(_0x4911ca,_0xed69f0){_0x4911ca=_0x4911ca-0x1f1;const _0xeb24c2=a24_0xeb24();let _0x24c3ff=_0xeb24c2[_0x4911ca];return _0x24c3ff;}const a24_0x95e8b0=a24_0x24c3;function a24_0xeb24(){const _0x450fb7=['BFF\x20Scripts','set','list','risk','944cYrQLq','command','352155TZIeIX','1712dkphjA','Schema','write','Knowledge\x20Base','2070qAFhxp','has','12slGeCE','get','Skills','description','map','push','\x20\x20[write]','SQL\x20Queries','369291xQHeXa','429037oKIpWd','Datasets','Authentication','isSingleCommand','468IClItb','Logs','24640fOLitS','Instant\x20API','defaultCommand','login','service','900566qUFLWu','1529AXZkDD','read','Diagnostics','12357VddrRY','install','\x20\x20[high-risk-write]','show','20vVhciC','values'];a24_0xeb24=function(){return _0x450fb7;};return a24_0xeb24();}(function(_0x39dfd3,_0x1f1207){const _0x5d49a5=a24_0x24c3,_0x2f1e71=_0x39dfd3();while(!![]){try{const _0x1f3c91=-parseInt(_0x5d49a5(0x203))/0x1+parseInt(_0x5d49a5(0x214))/0x2*(parseInt(_0x5d49a5(0x218))/0x3)+-parseInt(_0x5d49a5(0x20b))/0x4*(parseInt(_0x5d49a5(0x213))/0x5)+-parseInt(_0x5d49a5(0x21a))/0x6*(parseInt(_0x5d49a5(0x1f8))/0x7)+parseInt(_0x5d49a5(0x211))/0x8*(-parseInt(_0x5d49a5(0x207))/0x9)+-parseInt(_0x5d49a5(0x1fe))/0xa*(-parseInt(_0x5d49a5(0x204))/0xb)+-parseInt(_0x5d49a5(0x1fc))/0xc*(-parseInt(_0x5d49a5(0x1f7))/0xd);if(_0x1f3c91===_0x1f1207)break;else _0x2f1e71['push'](_0x2f1e71['shift']());}catch(_0x2cd414){_0x2f1e71['push'](_0x2f1e71['shift']());}}}(a24_0xeb24,0x7af8c));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x28fc7b){const _0x4511c0=a24_0x24c3;for(const _0x59de59 of _0x28fc7b){definitions['set'](_0x59de59[_0x4511c0(0x202)]+':'+_0x59de59[_0x4511c0(0x212)],_0x59de59);let _0xf80a4c=serviceGroups['get'](_0x59de59[_0x4511c0(0x202)]);!_0xf80a4c&&(_0xf80a4c=[],serviceGroups[_0x4511c0(0x20e)](_0x59de59[_0x4511c0(0x202)],_0xf80a4c)),_0xf80a4c[_0x4511c0(0x1f4)](_0x59de59);}}function registerService(_0x573c51,_0x5c016c,_0x2381ef){const _0xafd6a7=a24_0x24c3;registerDefinitions(_0x5c016c);const _0x50462c=_0x2fbc00=>_0x2fbc00===_0xafd6a7(0x205)?'':_0x2fbc00===_0xafd6a7(0x216)?_0xafd6a7(0x1f5):_0xafd6a7(0x209),_0x2306fa={'service':_0x5c016c[0x0][_0xafd6a7(0x202)],'label':_0x573c51,'commands':_0x5c016c[_0xafd6a7(0x1f3)](_0x558be9=>({'command':_0x558be9[_0xafd6a7(0x212)],'description':_0x558be9[_0xafd6a7(0x1f2)],'tag':_0x50462c(_0x558be9[_0xafd6a7(0x210)])})),'defaultCommand':_0x2381ef?.[_0xafd6a7(0x200)]??(_0x2381ef?.[_0xafd6a7(0x1fb)]?_0x5c016c[0x0][_0xafd6a7(0x212)]:undefined),'isSingleCommand':_0x2381ef?.[_0xafd6a7(0x1fb)]};serviceRegistry[_0xafd6a7(0x1f4)](_0x2306fa),serviceByName[_0xafd6a7(0x20e)](_0x2306fa[_0xafd6a7(0x202)],_0x2306fa);}registerService(a24_0x95e8b0(0x1fa),authDefinitions,{'defaultCommand':a24_0x95e8b0(0x201)}),registerService(a24_0x95e8b0(0x1f9),datasetDefinitions),registerService(a24_0x95e8b0(0x1ff),dataDefinitions),registerService(a24_0x95e8b0(0x1f6),sqlDefinitions),registerService(a24_0x95e8b0(0x20d),bffDefinitions),registerService(a24_0x95e8b0(0x217),kbDefinitions),registerService('App\x20Management',appDefinitions,{'defaultCommand':a24_0x95e8b0(0x20f)}),registerService('Configuration',configDefinitions,{'defaultCommand':'list'}),registerService(a24_0x95e8b0(0x1f1),skillDefinitions,{'defaultCommand':a24_0x95e8b0(0x208)}),registerService('Self\x20Update',[updateDefinition],{'defaultCommand':'run','isSingleCommand':!![]}),registerService(a24_0x95e8b0(0x206),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a24_0x95e8b0(0x215),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a24_0x95e8b0(0x1fd),logsDefinitions,{'defaultCommand':a24_0x95e8b0(0x20a)});export function findDefinition(_0x2939ae,_0x2c379f){const _0x3105bc=a24_0x95e8b0;return definitions[_0x3105bc(0x21b)](_0x2939ae+':'+_0x2c379f);}export function isKnownService(_0x2f6f03){const _0x54ac6b=a24_0x95e8b0;return serviceByName[_0x54ac6b(0x219)](_0x2f6f03);}export function getServiceEntry(_0x2c8128){return serviceByName['get'](_0x2c8128);}export function getAllDefinitions(){const _0x24b34b=a24_0x95e8b0;return Array['from'](definitions[_0x24b34b(0x20c)]());}
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a25_0x4126(_0x25d4ca,_0x290f57){_0x25d4ca=_0x25d4ca-0x158;const _0x10dcb1=a25_0x10dc();let _0x412688=_0x10dcb1[_0x25d4ca];return _0x412688;}const a25_0x38af23=a25_0x4126;(function(_0x496056,_0x53a2f2){const _0x3b81e6=a25_0x4126,_0x528004=_0x496056();while(!![]){try{const _0x2ec6ef=parseInt(_0x3b81e6(0x15d))/0x1*(parseInt(_0x3b81e6(0x166))/0x2)+parseInt(_0x3b81e6(0x158))/0x3+-parseInt(_0x3b81e6(0x162))/0x4*(parseInt(_0x3b81e6(0x15c))/0x5)+parseInt(_0x3b81e6(0x15e))/0x6+parseInt(_0x3b81e6(0x165))/0x7*(parseInt(_0x3b81e6(0x164))/0x8)+-parseInt(_0x3b81e6(0x159))/0x9+-parseInt(_0x3b81e6(0x15a))/0xa*(-parseInt(_0x3b81e6(0x161))/0xb);if(_0x2ec6ef===_0x53a2f2)break;else _0x528004['push'](_0x528004['shift']());}catch(_0x5395ae){_0x528004['push'](_0x528004['shift']());}}}(a25_0x10dc,0x55359));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x5987d2){const _0x420993=await buildSchemaPayload();return{'ok':!![],'data':_0x420993};}function a25_0x10dc(){const _0x2205e9=['export','11496jedNdx','2471YTEkgE','556rrxikd','729336IuuqvB','4948839KkEVYN','20nvElZz','schema','15vRRkvm','417juUAGe','1277940QZcNWs','Export\x20machine-readable\x20command\x20schema\x20(JSON)','read','1303423amzUra','556516Sxjqzv'];a25_0x10dc=function(){return _0x2205e9;};return a25_0x10dc();}export const schemaDefinition={'service':a25_0x38af23(0x15b),'command':a25_0x38af23(0x163),'description':a25_0x38af23(0x15f),'risk':a25_0x38af23(0x160),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a26_0x2dd4(_0x211b60,_0x2c9fa0){_0x211b60=_0x211b60-0x1ad;const _0x3f8d0b=a26_0x3f8d();let _0x2dd401=_0x3f8d0b[_0x211b60];return _0x2dd401;}const a26_0x5bc738=a26_0x2dd4;function a26_0x3f8d(){const _0x480622=['map','string','code','reduce','accessKey','Check\x20network\x20connectivity\x20and\x20try\x20again.','company','str','8529678VbAZRt','created','../../skills/runtime-skill-sync.js','push','info','inherit','nonInteractive','cwd','\x20developer\x20skill','skill-install','skillCode','install','Only\x20pull\x20a\x20specific\x20runtime\x20Skill\x20code','skillName','6502YqSRwt','write','envName','filter','setLogPath','41536QUQald','Skipped\x20npx\x20(','error','\x20skill\x20installed','\x20-g\x20-y)...','action','\x20personal\x20and\x20','apiError','\x20skill\x20via\x20npx.','dir','333RPrWDC','length','log','Push\x20a\x20local\x20Skill\x20directory\x20to\x20personal\x20runtime\x20Skill\x20scope','input','skipped','Updated\x20personal\x20Skill\x20','unknown','authRequired','trim','Installing\x20published\x20','Local\x20Skill\x20directory\x20containing\x20SKILL.md','pull','6LVrcla','682248BMqhYf','\x20company\x20Skill(s).','scope','193392aVzwtU','readonly','1461957iUnksy','appCode','skill','3727510WsRwVt','../../core/api-client.js'];a26_0x3f8d=function(){return _0x480622;};return a26_0x3f8d();}(function(_0x4a2330,_0x3e7161){const _0x305e51=a26_0x2dd4,_0xbec7c=_0x4a2330();while(!![]){try{const _0x2af05d=parseInt(_0x305e51(0x1b7))/0x1+parseInt(_0x305e51(0x1d4))/0x2*(-parseInt(_0x305e51(0x1e3))/0x3)+parseInt(_0x305e51(0x1b4))/0x4+-parseInt(_0x305e51(0x1bc))/0x5*(parseInt(_0x305e51(0x1b3))/0x6)+parseInt(_0x305e51(0x1b9))/0x7+-parseInt(_0x305e51(0x1d9))/0x8+parseInt(_0x305e51(0x1c6))/0x9;if(_0x2af05d===_0x3e7161)break;else _0xbec7c['push'](_0xbec7c['shift']());}catch(_0xde0b1a){_0xbec7c['push'](_0xbec7c['shift']());}}}(a26_0x3f8d,0x63da0));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_0x5bc738(0x1c0),'type':a26_0x5bc738(0x1bf),'description':a26_0x5bc738(0x1d2)},DIR_FLAG={'name':a26_0x5bc738(0x1e2),'type':'string','required':!![],'description':a26_0x5bc738(0x1b1)};function summarizeRuntimeSkill(_0x56d47e){const _0xfb9334=a26_0x5bc738;return{'id':_0x56d47e['id'],'skillCode':_0x56d47e['skillCode'],'skillName':_0x56d47e[_0xfb9334(0x1d3)],'scope':_0x56d47e[_0xfb9334(0x1b6)],'version':_0x56d47e['version'],'readonly':_0x56d47e[_0xfb9334(0x1b8)]};}function filterByCode(_0x1e4dce,_0x5287ee){const _0x36ca43=a26_0x5bc738,_0x283ece=_0x5287ee[_0x36ca43(0x1af)]();if(!_0x283ece)return _0x1e4dce;return _0x1e4dce[_0x36ca43(0x1d7)](_0x47fce6=>_0x47fce6['skillCode']===_0x283ece);}export const skillDefinitions=[{'service':'skill','command':a26_0x5bc738(0x1d1),'description':'Install\x20the\x20published\x20'+CLI_BIN_NAME+a26_0x5bc738(0x1ce),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x19bc9a){const _0x310de8=a26_0x5bc738;logger[_0x310de8(0x1d8)](process[_0x310de8(0x1cd)]()),logger[_0x310de8(0x1ca)](_0x310de8(0x1cf),_0x310de8(0x1b0)+CLI_DISPLAY_NAME+_0x310de8(0x1e1));const {LOVRABET_SKILL_SOURCE:_0x2921b9,LOVRABET_SKIP_NPX_SKILLS_ENV:_0x51d2f5,runNpxSkillsAddGlobal:_0xe4b1c9}=await import('../../skills/npx-skills-add.js'),_0x38a474=_0x19bc9a[_0x310de8(0x1cc)]?'pipe':_0x310de8(0x1cb);console['log']('Installing\x20official\x20skill\x20via\x20npx\x20(npx\x20skills\x20add\x20'+_0x2921b9+_0x310de8(0x1dd));const _0x16a455=_0xe4b1c9(process[_0x310de8(0x1cd)](),_0x2921b9,{'stdio':_0x38a474});if(_0x16a455[_0x310de8(0x1e8)])console[_0x310de8(0x1e5)](_0x310de8(0x1da)+_0x51d2f5+'=1);\x20assuming\x20skill\x20is\x20already\x20present.');else{if(_0x16a455['ok'])console[_0x310de8(0x1e5)](CLI_BIN_NAME+_0x310de8(0x1dc));else throw CliErrors[_0x310de8(0x1e0)]('npx\x20skills\x20add\x20failed:\x20'+(_0x16a455[_0x310de8(0x1db)]||_0x310de8(0x1ad)),_0x310de8(0x1c3));}return{'ok':!![]};}},{'service':a26_0x5bc738(0x1bb),'command':a26_0x5bc738(0x1b2),'description':'Pull\x20personal\x20and\x20company\x20runtime\x20Skills\x20into\x20local\x20agent\x20skill\x20directories','risk':'write','flags':[CODE_FLAG],async 'execute'(_0x4b8269){const _0x3cc536=a26_0x5bc738,{listCompanyRuntimeSkills:_0x542d20,listPersonalRuntimeSkills:_0x13b004}=await import('../../core/api-client.js'),{linkEffectiveRuntimeSkills:_0x6a1e63,materializeRuntimeSkill:_0x37e935}=await import(_0x3cc536(0x1c8)),_0x532d8c=_0x4b8269[_0x3cc536(0x1c5)]('code'),_0x3d005c=_0x4b8269[_0x3cc536(0x1d6)]??'production',_0x249241=_0x4b8269[_0x3cc536(0x1c2)];if(!_0x249241)throw CliErrors['authRequired']();const _0x333ed8=filterByCode(await _0x13b004(_0x4b8269[_0x3cc536(0x1ba)]),_0x532d8c),_0x65ab7d=filterByCode(await _0x542d20(_0x4b8269['appCode']),_0x532d8c),_0x192a6c=[..._0x333ed8[_0x3cc536(0x1be)](_0x56f212=>_0x37e935(_0x56f212,'personal',{'env':_0x3d005c,'accessKey':_0x249241,'appCode':_0x4b8269[_0x3cc536(0x1ba)]})),..._0x65ab7d[_0x3cc536(0x1be)](_0x45e07f=>_0x37e935(_0x45e07f,_0x3cc536(0x1c4),{'env':_0x3d005c,'accessKey':_0x249241,'appCode':_0x4b8269[_0x3cc536(0x1ba)]}))],_0x1e599b=_0x6a1e63(_0x192a6c,_0x4b8269[_0x3cc536(0x1ba)]),_0x1b07e5=_0x1e599b[_0x3cc536(0x1c1)]((_0x1aeb51,_0x4e66b1)=>{const _0x1855c7=_0x3cc536;return _0x1aeb51[_0x4e66b1[_0x1855c7(0x1de)]]=(_0x1aeb51[_0x4e66b1[_0x1855c7(0x1de)]]??0x0)+0x1,_0x1aeb51;},{});return{'ok':!![],'data':{'appCode':_0x4b8269[_0x3cc536(0x1ba)],'personal':_0x333ed8[_0x3cc536(0x1e4)],'company':_0x65ab7d[_0x3cc536(0x1e4)],'materialized':_0x192a6c[_0x3cc536(0x1e4)],'links':{'total':_0x1e599b[_0x3cc536(0x1e4)],'created':_0x1b07e5[_0x3cc536(0x1c7)]??0x0,'updated':_0x1b07e5['updated']??0x0,'unchanged':_0x1b07e5['unchanged']??0x0,'skipped':0x0,'conflicted':0x0},'skills':{'personal':_0x333ed8[_0x3cc536(0x1be)](summarizeRuntimeSkill),'company':_0x65ab7d['map'](summarizeRuntimeSkill)}},'message':'Pulled\x20'+_0x333ed8[_0x3cc536(0x1e4)]+_0x3cc536(0x1df)+_0x65ab7d['length']+_0x3cc536(0x1b5)};}},{'service':'skill','command':a26_0x5bc738(0x1c9),'description':a26_0x5bc738(0x1e6),'risk':a26_0x5bc738(0x1d5),'flags':[DIR_FLAG],async 'execute'(_0xa9aacd){const _0x515749=a26_0x5bc738,{createPersonalRuntimeSkill:_0x26c197,listPersonalRuntimeSkills:_0x44ef0c,updatePersonalRuntimeSkill:_0x51fcf9}=await import(_0x515749(0x1bd)),{readPushDirectory:_0x52eef4}=await import(_0x515749(0x1c8));if(!_0xa9aacd['accessKey'])throw CliErrors[_0x515749(0x1ae)]();const _0x4fbb8f=_0x52eef4(_0xa9aacd['str'](_0x515749(0x1e2)),_0xa9aacd[_0x515749(0x1ba)]),_0x4db7d6=(await _0x44ef0c(_0xa9aacd[_0x515749(0x1ba)]))['find'](_0x27e97f=>_0x27e97f[_0x515749(0x1d0)]===_0x4fbb8f['skillCode']),_0x316997=_0x4db7d6?await _0x51fcf9(_0x4fbb8f[_0x515749(0x1d0)],_0xa9aacd['appCode'],_0x4fbb8f[_0x515749(0x1e7)]):await _0x26c197(_0xa9aacd['appCode'],_0x4fbb8f[_0x515749(0x1e7)]);return{'ok':!![],'data':summarizeRuntimeSkill(_0x316997),'message':_0x4db7d6?_0x515749(0x1e9)+_0x4fbb8f[_0x515749(0x1d0)]:'Created\x20personal\x20Skill\x20'+_0x4fbb8f[_0x515749(0x1d0)]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x30bd1d=a27_0x19da;function a27_0x35c9(){const _0x541afa=['4706408EYuVJI','sqlCode','str','sqlContent','sqlName','dbId','5444056PsBlpm','528180eBoUnZ','verbose','22775247DASOlm','322uqpmDx','3307420EXmqfU','3928vzoyVr','read','bool','description','12koARgJ','1533792ORCDyN','detail'];a27_0x35c9=function(){return _0x541afa;};return a27_0x35c9();}(function(_0x2ef710,_0x24442b){const _0x4c61f1=a27_0x19da,_0x5ddbe5=_0x2ef710();while(!![]){try{const _0x4392cf=parseInt(_0x4c61f1(0x18b))/0x1*(parseInt(_0x4c61f1(0x18d))/0x2)+parseInt(_0x4c61f1(0x19b))/0x3*(parseInt(_0x4c61f1(0x191))/0x4)+parseInt(_0x4c61f1(0x18c))/0x5+-parseInt(_0x4c61f1(0x192))/0x6+parseInt(_0x4c61f1(0x194))/0x7+parseInt(_0x4c61f1(0x19a))/0x8+-parseInt(_0x4c61f1(0x18a))/0x9;if(_0x4392cf===_0x24442b)break;else _0x5ddbe5['push'](_0x5ddbe5['shift']());}catch(_0x51ab4f){_0x5ddbe5['push'](_0x5ddbe5['shift']());}}}(a27_0x35c9,0x5ee64));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_0x19da(_0x3da3f8,_0x5c3ccc){_0x3da3f8=_0x3da3f8-0x18a;const _0x35c9ec=a27_0x35c9();let _0x19da14=_0x35c9ec[_0x3da3f8];return _0x19da14;}export const sqlDetail={'service':'sql','command':a27_0x30bd1d(0x193),'description':'Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','risk':a27_0x30bd1d(0x18e),'flags':[SQLCODE_FLAG,VERBOSE_FLAG],async 'execute'(_0xac28a4){const _0x15d155=a27_0x30bd1d,_0xe17ec7=await getSqlQueryInfo(_0xac28a4['appCode'],_0xac28a4[_0x15d155(0x196)]('sqlcode')),_0x1c9e7e=_0xac28a4[_0x15d155(0x18f)](_0x15d155(0x19c));if(_0x1c9e7e)return{'ok':!![],'data':_0xe17ec7};const _0x5cd347=_0xe17ec7[_0x15d155(0x199)]?await getDbName(_0xac28a4['appCode'],_0xe17ec7[_0x15d155(0x199)]):undefined;return{'ok':!![],'data':{'sqlCode':_0xe17ec7[_0x15d155(0x195)],'sqlName':_0xe17ec7[_0x15d155(0x198)],'db':_0x5cd347?_0x5cd347+'\x20('+_0xe17ec7[_0x15d155(0x199)]+')':_0xe17ec7[_0x15d155(0x199)]??'','description':_0xe17ec7[_0x15d155(0x190)]??'','sqlContent':_0xe17ec7[_0x15d155(0x197)]??''}};}};
|