@lovrabet/lovrabet-cli 2.0.9-beta.7 → 2.0.11
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 +19 -5
|
@@ -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_0x217a37=a16_0x5e20;function a16_0x5e20(_0x550319,_0x5af7c5){_0x550319=_0x550319-0x128;const _0x4a8ffb=a16_0x4a8f();let _0x5e2074=_0x4a8ffb[_0x550319];return _0x5e2074;}(function(_0x10770c,_0x43644b){const _0x335102=a16_0x5e20,_0x43236b=_0x10770c();while(!![]){try{const _0x47a736=parseInt(_0x335102(0x16f))/0x1+parseInt(_0x335102(0x128))/0x2+-parseInt(_0x335102(0x17f))/0x3+parseInt(_0x335102(0x163))/0x4*(parseInt(_0x335102(0x173))/0x5)+-parseInt(_0x335102(0x138))/0x6+parseInt(_0x335102(0x161))/0x7+parseInt(_0x335102(0x16b))/0x8;if(_0x47a736===_0x43644b)break;else _0x43236b['push'](_0x43236b['shift']());}catch(_0x4f27d7){_0x43236b['push'](_0x43236b['shift']());}}}(a16_0x4a8f,0x9030e));import{executeData}from'../../core/sdk-client.js';function a16_0x4a8f(){const _0x44c281=['JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','filter','dryRun','operation','\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\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','high-risk-write','\x20\x20EXAMPLES','95221WWrVnn','\x20\x20PAGINATION','60PiBORy','paramsHint','\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\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','\x20completed\x20in\x20','map','\x20on\x20dataset\x20','4877928YWIHhr','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','POST','write','368446dfpGgI','batchCreate','params','\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}','71695fIFIcZ','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','description','read','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','delete','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','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\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','2684355cWFaBD','2132348BmYyWI','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','\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}}','code','\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]','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\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}}','getOne','\x20\x20PARAMS\x20STRUCTURE','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','command','data\x20','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','helpExtra','risk','4725948MrmgBo','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','create','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','\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\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','paramsRequired','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','\x20\x20\x20\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}','update','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','\x20\x20\x20\x20$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\x20having\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Post-aggregation\x20filter,\x20e.g.\x20{\x22total\x22:{\x22$gt\x22:1000}}','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','Preview:\x20data\x20','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','\x20\x20AGGREGATE\x20TYPES','str','now','data','Get\x20a\x20single\x20record\x20by\x20ID','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','\x20\x20LOGICAL\x20COMBINATORS','Update\x20an\x20existing\x20record','body','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','aggregate','Create\x20a\x20new\x20record\x20in\x20a\x20dataset'];a16_0x4a8f=function(){return _0x44c281;};return a16_0x4a8f();}import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':'filter','operation':a16_0x217a37(0x15a),'risk':a16_0x217a37(0x177),'paramsRequired':![],'description':'Filter\x20dataset\x20records\x20with\x20query\x20conditions','paramsHint':a16_0x217a37(0x167)+a16_0x217a37(0x12d),'helpExtra':['\x20\x20WHERE\x20OPERATORS',a16_0x217a37(0x13e),'\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}',a16_0x217a37(0x13d),'\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}',a16_0x217a37(0x165),a16_0x217a37(0x174),a16_0x217a37(0x12e),a16_0x217a37(0x12a),'',a16_0x217a37(0x153),a16_0x217a37(0x148),a16_0x217a37(0x135),'',a16_0x217a37(0x13b),a16_0x217a37(0x166),a16_0x217a37(0x12c),a16_0x217a37(0x13c),a16_0x217a37(0x178),a16_0x217a37(0x175),'',a16_0x217a37(0x162),a16_0x217a37(0x14c),a16_0x217a37(0x156),a16_0x217a37(0x14a)]['join']('\x0a')},{'command':a16_0x217a37(0x12f),'operation':a16_0x217a37(0x12f),'risk':a16_0x217a37(0x177),'paramsRequired':!![],'description':a16_0x217a37(0x151),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':'create','operation':a16_0x217a37(0x13a),'risk':a16_0x217a37(0x16e),'paramsRequired':!![],'description':a16_0x217a37(0x158),'paramsHint':a16_0x217a37(0x16c)},{'command':a16_0x217a37(0x170),'operation':a16_0x217a37(0x170),'risk':a16_0x217a37(0x16e),'paramsRequired':!![],'description':a16_0x217a37(0x129),'paramsHint':'JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27'},{'command':a16_0x217a37(0x146),'operation':'update','risk':a16_0x217a37(0x16e),'paramsRequired':!![],'description':a16_0x217a37(0x154),'paramsHint':a16_0x217a37(0x143)},{'command':a16_0x217a37(0x17a),'operation':a16_0x217a37(0x17a),'risk':a16_0x217a37(0x15f),'paramsRequired':!![],'description':a16_0x217a37(0x141),'paramsHint':a16_0x217a37(0x17c)},{'command':a16_0x217a37(0x157),'operation':a16_0x217a37(0x157),'risk':'read','paramsRequired':![],'description':a16_0x217a37(0x139),'paramsHint':a16_0x217a37(0x159)+a16_0x217a37(0x17d),'helpExtra':[a16_0x217a37(0x14d),'\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20field\x20values\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}',a16_0x217a37(0x131),a16_0x217a37(0x147),a16_0x217a37(0x172),a16_0x217a37(0x152),a16_0x217a37(0x144),a16_0x217a37(0x145),'',a16_0x217a37(0x130),a16_0x217a37(0x15e),a16_0x217a37(0x13f),a16_0x217a37(0x17e),a16_0x217a37(0x179),a16_0x217a37(0x149),a16_0x217a37(0x140),'',a16_0x217a37(0x160),a16_0x217a37(0x132),'\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_0x217a37(0x17b),a16_0x217a37(0x15d)]['join']('\x0a')}];function makeDataCommand(_0x4e2fe6){const _0x5b2cf4=a16_0x217a37,_0x3c13d9=_0x5b2cf4(0x134)+_0x4e2fe6[_0x5b2cf4(0x133)],_0x449724={'service':_0x5b2cf4(0x150),'command':_0x4e2fe6[_0x5b2cf4(0x133)],'description':_0x4e2fe6[_0x5b2cf4(0x176)],'risk':_0x4e2fe6[_0x5b2cf4(0x137)],'helpExtra':_0x4e2fe6[_0x5b2cf4(0x136)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x4e2fe6[_0x5b2cf4(0x164)]}],'validate':async _0x2d9cbe=>{const _0x438081=_0x5b2cf4;_0x4e2fe6[_0x438081(0x142)]&&requireAnyOf(_0x2d9cbe,[_0x438081(0x171)],_0x3c13d9),_0x4e2fe6['operation']===_0x438081(0x170)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x2d9cbe[_0x438081(0x14e)](_0x438081(0x171))));},async 'execute'(_0x96a6f1){const _0x214dbc=_0x5b2cf4,_0x20eec6=_0x96a6f1['str'](_0x214dbc(0x12b)),_0x5285e4=_0x4e2fe6[_0x214dbc(0x15c)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x96a6f1['str'](_0x214dbc(0x171)))):parseJsonParams(_0x96a6f1['str'](_0x214dbc(0x171)))??{},_0x43521d=Date[_0x214dbc(0x14f)](),_0x1bcda9=await executeData(_0x20eec6,_0x4e2fe6['operation'],_0x5285e4),_0x70ab6b=Date[_0x214dbc(0x14f)]()-_0x43521d;return{'ok':!![],'data':{'result':_0x1bcda9,'elapsed':_0x70ab6b},'message':'data\x20'+_0x4e2fe6['command']+_0x214dbc(0x168)+_0x70ab6b+'ms'};}};return _0x4e2fe6[_0x5b2cf4(0x137)]!=='read'&&(_0x449724[_0x5b2cf4(0x15b)]=async _0xd74d4f=>{const _0x3b629c=_0x5b2cf4,_0x4e0930=_0xd74d4f[_0x3b629c(0x14e)](_0x3b629c(0x12b)),_0x4e6979=_0x4e2fe6['operation']===_0x3b629c(0x170)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0xd74d4f['str']('params'))):parseJsonParams(_0xd74d4f[_0x3b629c(0x14e)]('params'))??{};return dryRun(_0x3b629c(0x16d),'/api/{appCode}/'+_0x4e0930+'/'+_0x4e2fe6[_0x3b629c(0x15c)])[_0x3b629c(0x155)](_0x4e6979)[_0x3b629c(0x176)](_0x3b629c(0x14b)+_0x4e2fe6['command']+_0x3b629c(0x16a)+_0x4e0930)['build']();}),_0x449724;}export const dataDefinitions=specs[a16_0x217a37(0x169)](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1e3a72,_0x10f5d2){const _0x1aaaae=a17_0x2eb0,_0x197b92=_0x1e3a72();while(!![]){try{const _0x4beab6=parseInt(_0x1aaaae(0x16c))/0x1*(-parseInt(_0x1aaaae(0x13a))/0x2)+-parseInt(_0x1aaaae(0x14f))/0x3*(-parseInt(_0x1aaaae(0x15e))/0x4)+-parseInt(_0x1aaaae(0x14b))/0x5+-parseInt(_0x1aaaae(0x13f))/0x6+-parseInt(_0x1aaaae(0x14c))/0x7+parseInt(_0x1aaaae(0x17e))/0x8*(parseInt(_0x1aaaae(0x176))/0x9)+parseInt(_0x1aaaae(0x13e))/0xa*(parseInt(_0x1aaaae(0x158))/0xb);if(_0x4beab6===_0x10f5d2)break;else _0x197b92['push'](_0x197b92['shift']());}catch(_0xddcd62){_0x197b92['push'](_0x197b92['shift']());}}}(a17_0x1142,0x6dcd7));import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x81aee8){const _0x1655ff=a17_0x2eb0;if(_0x81aee8[_0x1655ff(0x15c)])return null;const _0x94b603=Boolean(_0x81aee8[_0x1655ff(0x135)]!==undefined||_0x81aee8['doType']!==undefined);let _0x8299d9={};if(!_0x94b603&&typeof _0x81aee8[_0x1655ff(0x17b)]===_0x1655ff(0x175))try{_0x8299d9=JSON[_0x1655ff(0x15a)](_0x81aee8[_0x1655ff(0x17b)]);}catch{}const _0x3a4b77=_0x94b603?_0x81aee8[_0x1655ff(0x139)]:_0x81aee8[_0x1655ff(0x141)],_0x5a7172=_0x94b603?_0x81aee8[_0x1655ff(0x135)]:_0x81aee8[_0x1655ff(0x139)],_0xa2f5ca=_0x94b603?_0x81aee8[_0x1655ff(0x15f)]:_0x81aee8[_0x1655ff(0x137)]||_0x81aee8[_0x1655ff(0x15b)],_0x5a99e0=_0x94b603?_0x81aee8['pkField']===!![]:_0x8299d9[_0x1655ff(0x142)]===!![],_0x467c3f=_0x94b603?_0x81aee8['required']===!![]:_0x8299d9['required']===!![],_0x42fb91=_0x94b603?_0x81aee8['options']??null:_0x8299d9[_0x1655ff(0x146)]??null,_0x2ef138={'name':_0x3a4b77,'displayName':_0x5a7172||_0x3a4b77,'type':_0xa2f5ca,'dbType':_0x81aee8[_0x1655ff(0x16f)],'pk':_0x5a99e0,'required':_0x467c3f,'description':_0x81aee8[_0x1655ff(0x13c)]||undefined};return Array[_0x1655ff(0x163)](_0x42fb91)&&_0x42fb91[_0x1655ff(0x160)]>0x0&&(_0x2ef138['options']=_0x42fb91),_0x2ef138;}function parseJsonMaybe(_0x2d9b83){const _0x5b779e=a17_0x2eb0;if(typeof _0x2d9b83!=='string')return _0x2d9b83;try{return JSON[_0x5b779e(0x15a)](_0x2d9b83);}catch{return _0x2d9b83;}}function normalizeOperationEntry(_0x398a73,_0x397728){const _0x24fc12=a17_0x2eb0;if(!_0x397728||typeof _0x397728!=='object')return null;if(!_0x397728[_0x24fc12(0x152)]||!_0x397728['path'])return null;const _0x3ea9c4={'name':_0x398a73,'method':_0x397728[_0x24fc12(0x152)],'path':_0x397728[_0x24fc12(0x17c)]};if(_0x397728[_0x24fc12(0x165)])_0x3ea9c4[_0x24fc12(0x165)]=_0x397728[_0x24fc12(0x165)];if(_0x397728[_0x24fc12(0x17a)]!=null)_0x3ea9c4['requestBody']=parseJsonMaybe(_0x397728['requestBody']);if(_0x397728['responseBody']!=null)_0x3ea9c4['responseBody']=parseJsonMaybe(_0x397728[_0x24fc12(0x161)]);if(_0x397728[_0x24fc12(0x177)]!=null)_0x3ea9c4[_0x24fc12(0x177)]=_0x397728[_0x24fc12(0x177)];if(_0x397728[_0x24fc12(0x168)]!=null)_0x3ea9c4['afterScriptId']=_0x397728[_0x24fc12(0x168)];if(Array['isArray'](_0x397728['requestFields']))_0x3ea9c4[_0x24fc12(0x16a)]=_0x397728[_0x24fc12(0x16a)];if(Array[_0x24fc12(0x163)](_0x397728[_0x24fc12(0x157)]))_0x3ea9c4['responseFields']=_0x397728['responseFields'];return _0x3ea9c4;}function summarizeDbtable(_0x462777){const _0x1fca3e=a17_0x2eb0,_0x3cca1c={},_0x471759=[_0x1fca3e(0x150),_0x1fca3e(0x153),'tableName','datasetKey',_0x1fca3e(0x142),'allFields','logicField',_0x1fca3e(0x178),_0x1fca3e(0x136),_0x1fca3e(0x14d),_0x1fca3e(0x147),_0x1fca3e(0x144),_0x1fca3e(0x174),_0x1fca3e(0x16e),_0x1fca3e(0x179)];for(const _0x5a87d4 of _0x471759){if(_0x462777[_0x5a87d4]!==undefined)_0x3cca1c[_0x5a87d4]=_0x462777[_0x5a87d4];}return typeof _0x3cca1c[_0x1fca3e(0x162)]==='string'&&_0x3cca1c[_0x1fca3e(0x162)][_0x1fca3e(0x160)]>0x0&&(_0x3cca1c[_0x1fca3e(0x173)]=_0x3cca1c['allFields'][_0x1fca3e(0x15d)](',')[_0x1fca3e(0x143)](_0x353633=>_0x353633['trim']())[_0x1fca3e(0x156)](Boolean)),_0x3cca1c;}function a17_0x2eb0(_0x2b8a47,_0x30650a){_0x2b8a47=_0x2b8a47-0x134;const _0x1142de=a17_0x1142();let _0x2eb026=_0x1142de[_0x2b8a47];return _0x2eb026;}function normalizeRelatedPages(_0xd1e266){const _0x1e92cf=a17_0x2eb0;if(!Array[_0x1e92cf(0x163)](_0xd1e266))return[];return _0xd1e266['filter'](_0x174f20=>_0x174f20&&typeof _0x174f20==='object')[_0x1e92cf(0x143)](_0x358576=>({'id':_0x358576['id'],'type':_0x358576[_0x1e92cf(0x137)],'code':_0x358576[_0x1e92cf(0x141)],'title':_0x358576[_0x1e92cf(0x148)],'deleted':_0x358576['deleted']===!![]}));}function normalizeFallbackFieldName(_0x126614,_0x16fbc2){const _0x1d2d0e=_0x126614['trim']();if(!_0x1d2d0e)return null;return{'name':_0x1d2d0e,'displayName':_0x1d2d0e,'type':undefined,'dbType':undefined,'pk':_0x1d2d0e===_0x16fbc2,'required':![],'description':undefined};}function a17_0x1142(){const _0x55931c=['relatedPageInfoList','toDatasetName','filter','responseFields','66fCRqhq','formatRules','parse','dataType','deleted','split','272CPWbSd','doType','length','responseBody','allFields','isArray','fields','host','tableName','entries','afterScriptId','appCode','requestFields','toField','2ExHIei','str','labelField','dbType','relations','properties','indexes','allFieldNames','modifierNameField','string','2463894DfyWjk','beforeScriptId','createTimeField','dblinkInfoDTO','requestBody','extend','path','push','8rmmZKo','columnCodeListWithDeleted','displayName','updateTimeField','type','source','name','146716cccjGN','dbtableConfig','description','find','2314580QoJpJf','1494888MMeaTO','validateRules','code','pkField','map','modifierIdField','datasetKey','options','creatorNameField','title','modelId','toDatasetCode','3829800MktFBk','4450649VcEVUH','creatorIdField','doVersion','25803OShuQb','dbId','modelCode','method','dbName'];a17_0x1142=function(){return _0x55931c;};return a17_0x1142();}async function loadListFieldFallback(_0x37e05d,_0x44d92d){const _0x3f8568=a17_0x2eb0;if(!_0x37e05d||!_0x44d92d)return[];try{const _0x1d15c9=await listDatasets(_0x37e05d,{'code':_0x44d92d}),_0x54bfb9=_0x1d15c9[_0x3f8568(0x13d)](_0x40a343=>_0x40a343[_0x3f8568(0x141)]===_0x44d92d)??_0x1d15c9[0x0],_0x5c629d=_0x54bfb9?.[_0x3f8568(0x13b)]??{},_0x42927d=typeof _0x5c629d['allFields']===_0x3f8568(0x175)?_0x5c629d[_0x3f8568(0x162)][_0x3f8568(0x15d)](','):[];return _0x42927d[_0x3f8568(0x143)](_0x253304=>normalizeFallbackFieldName(_0x253304,_0x5c629d[_0x3f8568(0x142)]))[_0x3f8568(0x156)](_0x3e148b=>_0x3e148b!==null);}catch{return[];}}export const datasetDetail={'service':'dataset','command':'detail','description':'Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','risk':'read','flags':[CODE_FLAG],async 'execute'(_0x5cd06a){const _0x3338a3=a17_0x2eb0,_0xc7840d=await getDatasetDetail(_0x5cd06a[_0x3338a3(0x16d)](_0x3338a3(0x141))),_0x13401f=Array[_0x3338a3(0x163)](_0xc7840d['fields'])?_0xc7840d[_0x3338a3(0x164)]:Array[_0x3338a3(0x163)](_0xc7840d[_0x3338a3(0x171)])?_0xc7840d['properties']:[];let _0x4e71a5=_0x13401f['map'](_0x44097c=>normalizeField(_0x44097c))['filter'](_0x320f08=>_0x320f08!==null);_0x4e71a5['length']===0x0&&(_0x4e71a5=await loadListFieldFallback(_0x5cd06a[_0x3338a3(0x169)],_0x5cd06a['str'](_0x3338a3(0x141))));const _0x3acea7=_0xc7840d['operations']??{},_0x1ad0ba=[];for(const [_0x831165,_0x5e66c6]of Object[_0x3338a3(0x167)](_0x3acea7)){const _0x35fd7e=normalizeOperationEntry(_0x831165,_0x5e66c6);if(_0x35fd7e)_0x1ad0ba[_0x3338a3(0x17d)](_0x35fd7e);}const _0x3ff6e5=_0xc7840d['dbtableConfig']??{},_0x117256=_0xc7840d['dataset']??{},_0x5b070e=_0x3ff6e5[_0x3338a3(0x150)]!=null?{'id':_0x3ff6e5[_0x3338a3(0x150)],'name':_0x3ff6e5['dbName']??null}:undefined;let _0x43555c;return typeof _0xc7840d[_0x3338a3(0x17b)]===_0x3338a3(0x175)&&(_0x43555c=parseJsonMaybe(_0xc7840d['extend'])),{'ok':!![],'data':{'id':_0xc7840d[_0x3338a3(0x149)]??_0xc7840d['id'],'name':_0xc7840d[_0x3338a3(0x139)],'code':_0xc7840d[_0x3338a3(0x151)]||_0xc7840d[_0x3338a3(0x141)],'doVersion':_0xc7840d[_0x3338a3(0x14e)],'description':_0xc7840d[_0x3338a3(0x13c)]||_0x117256['tableComment']||undefined,'source':_0xc7840d[_0x3338a3(0x138)]||_0x117256['sourceType'],'table':_0x3ff6e5[_0x3338a3(0x166)]||_0x117256[_0x3338a3(0x166)],'datasetKey':_0x3ff6e5[_0x3338a3(0x145)],'pk':_0x3ff6e5['pkField'],'db':_0x5b070e,'dbtable':summarizeDbtable(_0x3ff6e5),'fields':_0x4e71a5,'operations':_0x1ad0ba,'indexes':Array['isArray'](_0x117256[_0x3338a3(0x172)])?_0x117256[_0x3338a3(0x172)]:[],'relations':Array[_0x3338a3(0x163)](_0xc7840d[_0x3338a3(0x170)])?_0xc7840d[_0x3338a3(0x170)][_0x3338a3(0x143)](_0x3742c7=>({'fromField':_0x3742c7['fromField'],'toDataset':_0x3742c7[_0x3338a3(0x155)],'toCode':_0x3742c7[_0x3338a3(0x14a)],'toTable':_0x3742c7['toTableName'],'toField':_0x3742c7[_0x3338a3(0x16b)],'labelField':_0x3742c7['toFieldLabel']||undefined})):[],'relatedPages':normalizeRelatedPages(_0xc7840d[_0x3338a3(0x154)]),...Array[_0x3338a3(0x163)](_0xc7840d[_0x3338a3(0x134)])?{'columnCodeListWithDeleted':_0xc7840d['columnCodeListWithDeleted']}:{},'formatRules':Array[_0x3338a3(0x163)](_0xc7840d['formatRules'])?_0xc7840d[_0x3338a3(0x159)]:[],'validateRules':Array['isArray'](_0xc7840d[_0x3338a3(0x140)])?_0xc7840d[_0x3338a3(0x140)]:[],..._0x43555c!==undefined?{'extend':_0x43555c}:{},'stats':{'fieldCount':_0x4e71a5[_0x3338a3(0x160)],'operationCount':_0x1ad0ba['length']}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x224edc,_0x322c87){const _0x563402=a18_0x2b0f,_0x5d5f19=_0x224edc();while(!![]){try{const _0x55bb0e=parseInt(_0x563402(0x143))/0x1*(parseInt(_0x563402(0x141))/0x2)+-parseInt(_0x563402(0x13a))/0x3*(parseInt(_0x563402(0x139))/0x4)+parseInt(_0x563402(0x137))/0x5*(parseInt(_0x563402(0x142))/0x6)+-parseInt(_0x563402(0x13c))/0x7+-parseInt(_0x563402(0x138))/0x8*(-parseInt(_0x563402(0x13b))/0x9)+parseInt(_0x563402(0x13e))/0xa*(-parseInt(_0x563402(0x140))/0xb)+-parseInt(_0x563402(0x13d))/0xc*(parseInt(_0x563402(0x13f))/0xd);if(_0x55bb0e===_0x322c87)break;else _0x5d5f19['push'](_0x5d5f19['shift']());}catch(_0x5511b2){_0x5d5f19['push'](_0x5d5f19['shift']());}}}(a18_0x5105,0xb3e84));import{datasetList}from'../../commands/dataset/list.js';function a18_0x5105(){const _0x27a6ba=['3020PKGmku','32071RTIEHJ','39457NkzODp','2nbWptc','6vjQgaa','1295579WEynvD','2426540epLPAD','8728RzmzIa','145016qrzfLT','9zUbalf','8577LQPmWo','2597959XGrRsF','2532TNqHgx'];a18_0x5105=function(){return _0x27a6ba;};return a18_0x5105();}function a18_0x2b0f(_0x4e7113,_0x249c8b){_0x4e7113=_0x4e7113-0x137;const _0x510596=a18_0x5105();let _0x2b0f9c=_0x510596[_0x4e7113];return _0x2b0f9c;}import{datasetDetail}from'../../commands/dataset/detail.js';export const datasetDefinitions=[datasetList,datasetDetail];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0xc013c8=a19_0x3b2d;function a19_0x3b2d(_0x316eaf,_0x48b189){_0x316eaf=_0x316eaf-0x1c3;const _0x562780=a19_0x5627();let _0x3b2dfb=_0x562780[_0x316eaf];return _0x3b2dfb;}(function(_0x550552,_0x566e95){const _0x12c2cc=a19_0x3b2d,_0x4d2a17=_0x550552();while(!![]){try{const _0x59ef5f=-parseInt(_0x12c2cc(0x1d5))/0x1+-parseInt(_0x12c2cc(0x1c3))/0x2+-parseInt(_0x12c2cc(0x1c4))/0x3+parseInt(_0x12c2cc(0x1c6))/0x4*(parseInt(_0x12c2cc(0x1d4))/0x5)+parseInt(_0x12c2cc(0x1c7))/0x6*(-parseInt(_0x12c2cc(0x1d7))/0x7)+-parseInt(_0x12c2cc(0x1cf))/0x8*(parseInt(_0x12c2cc(0x1ca))/0x9)+parseInt(_0x12c2cc(0x1dd))/0xa*(parseInt(_0x12c2cc(0x1cd))/0xb);if(_0x59ef5f===_0x566e95)break;else _0x4d2a17['push'](_0x4d2a17['shift']());}catch(_0x2f317f){_0x4d2a17['push'](_0x4d2a17['shift']());}}}(a19_0x5627,0x5d4f0));import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';export const datasetList={'service':a19_0xc013c8(0x1d1),'command':a19_0xc013c8(0x1df),'description':a19_0xc013c8(0x1c5),'risk':a19_0xc013c8(0x1da),'flags':[{'name':a19_0xc013c8(0x1dc),'type':a19_0xc013c8(0x1d2),'description':a19_0xc013c8(0x1c8)},{...CODE_FLAG,'required':![],'description':'Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)'}],async 'execute'(_0x3eac8b){const _0x2640c9=a19_0xc013c8,_0x3e2d1b=_0x3eac8b['str'](_0x2640c9(0x1dc)),_0x8c0b06=_0x3eac8b[_0x2640c9(0x1d6)]('code'),_0x32e749=await listDatasets(_0x3eac8b[_0x2640c9(0x1d8)],{..._0x3e2d1b&&{'name':_0x3e2d1b},..._0x8c0b06&&{'code':_0x8c0b06}});return{'ok':!![],'data':{'total':_0x32e749[_0x2640c9(0x1db)],'datasets':_0x32e749[_0x2640c9(0x1e0)](_0x176fc1=>{const _0x30172e=_0x2640c9,_0x23e55d=_0x176fc1[_0x30172e(0x1c9)]??{};return{'id':_0x176fc1['id'],'code':_0x176fc1[_0x30172e(0x1cc)],'name':_0x176fc1[_0x30172e(0x1dc)],'source':_0x176fc1['source'],'description':_0x176fc1[_0x30172e(0x1de)],'table':_0x23e55d[_0x30172e(0x1d3)],'datasetKey':_0x23e55d[_0x30172e(0x1d9)],'pk':_0x23e55d['pkField'],'fields':_0x23e55d[_0x30172e(0x1cb)]?_0x23e55d[_0x30172e(0x1cb)][_0x30172e(0x1ce)](',')[_0x30172e(0x1e0)](_0x202720=>_0x202720[_0x30172e(0x1d0)]()):[]};})}};}};function a19_0x5627(){const _0x3d5342=['tableName','10235Bqvvhl','205229bMzzpo','str','28CFRZlR','appCode','datasetKey','read','length','name','4710NYkJuf','description','list','map','1492018CjJsEv','543048OsNmyl','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','356iDXXIT','868536goBmLq','Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)','dbtableConfig','9JnxqRh','allFields','code','58014psSMsr','split','4582136eCXxeE','trim','dataset','string'];a19_0x5627=function(){return _0x3d5342;};return a19_0x5627();}
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0xb923f3=a20_0x4c28;(function(_0x12f90e,_0x673317){const _0x43e9e8=a20_0x4c28,_0x5dfe23=_0x12f90e();while(!![]){try{const _0x1c5ad2=-parseInt(_0x43e9e8(0x16f))/0x1+-parseInt(_0x43e9e8(0x16a))/0x2*(parseInt(_0x43e9e8(0x17b))/0x3)+-parseInt(_0x43e9e8(0x190))/0x4*(parseInt(_0x43e9e8(0x1a4))/0x5)+parseInt(_0x43e9e8(0x165))/0x6*(-parseInt(_0x43e9e8(0x1a8))/0x7)+-parseInt(_0x43e9e8(0x17d))/0x8+parseInt(_0x43e9e8(0x166))/0x9+parseInt(_0x43e9e8(0x196))/0xa*(parseInt(_0x43e9e8(0x188))/0xb);if(_0x1c5ad2===_0x673317)break;else _0x5dfe23['push'](_0x5dfe23['shift']());}catch(_0x65dd87){_0x5dfe23['push'](_0x5dfe23['shift']());}}}(a20_0x2264,0xa30ba));import a20_0x4b56ae from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';function a20_0x4c28(_0x4f7947,_0x3b72d8){_0x4f7947=_0x4f7947-0x163;const _0x226430=a20_0x2264();let _0x4c28f9=_0x226430[_0x4f7947];return _0x4c28f9;}import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';function a20_0x2264(){const _0x4a1dd7=['version','11pqZTmM','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','format','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','\x20\x20Config\x20Files','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','pageSize','2396rNaCCb','gray','(missing)','message','accessKey','locale','45429530ceKTwQ','\x20\x20runtimeDomain:\x20\x20\x20','\x20\x20auth\x20(effective):\x20','✗\x20Invalid\x20JSON','check','red','log','currentApp','missing','\x20doctor','✓\x20Valid\x20JSON','⚠\x20Empty\x20(treated\x20as\x20{})','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','8895kZqjdi','verbose','Diagnose\x20CLI\x20configuration\x20and\x20environment','Global','1820tKCTlF','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20─','env','25224dFZzwi','1366119cUpExX','appCode','(not\x20set)','defaultApp','2OpcCyB','green','(default:\x20','(not\x20found)','(set,\x20length=','741967BUcEkU','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','(default)','status','\x20\x20Session\x20check:\x20\x20\x20','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','\x20\x20Merged\x20Config','repeat','\x20\x20API\x20Endpoints','arch','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','length','1365885peuCTq','bold','5367896TgwNxR','platform','Project','read','padEnd','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','ClientAk','\x20\x20Config\x20JSON','(none)','(no\x20file)'];a20_0x2264=function(){return _0x4a1dd7;};return a20_0x2264();}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(_0x2aae66){const _0x146ab8=a20_0x4c28,_0x1f67cf=getCliVersion(),_0x5a65bd=buildConfigFromFlags({});await initGlobalEnvironment(_0x5a65bd),console[_0x146ab8(0x19c)](),console[_0x146ab8(0x19c)](a20_0x4b56ae[_0x146ab8(0x17c)](CLI_BIN_NAME+_0x146ab8(0x19f))),console[_0x146ab8(0x19c)](a20_0x4b56ae[_0x146ab8(0x191)]('─'[_0x146ab8(0x176)](0x32))),console[_0x146ab8(0x19c)](_0x146ab8(0x18e)+_0x1f67cf),console[_0x146ab8(0x19c)]('\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+process[_0x146ab8(0x187)]),console['log'](_0x146ab8(0x179)+process[_0x146ab8(0x17e)]+'\x20'+process[_0x146ab8(0x178)]),console[_0x146ab8(0x19c)](),console[_0x146ab8(0x19c)](a20_0x4b56ae[_0x146ab8(0x17c)](_0x146ab8(0x18d))),console[_0x146ab8(0x19c)](a20_0x4b56ae[_0x146ab8(0x191)](_0x146ab8(0x163)['repeat'](0x1e)));const _0x3cae84=getGlobalConfigPath(),_0x1871b6=getProjectConfigPath();console[_0x146ab8(0x19c)]('\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x3cae84||a20_0x4b56ae[_0x146ab8(0x191)](_0x146ab8(0x16d)))),console['log']('\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x1871b6||a20_0x4b56ae[_0x146ab8(0x191)](_0x146ab8(0x16d)))),console[_0x146ab8(0x19c)](),console[_0x146ab8(0x19c)](a20_0x4b56ae[_0x146ab8(0x17c)](_0x146ab8(0x184))),console[_0x146ab8(0x19c)](a20_0x4b56ae[_0x146ab8(0x191)]('\x20\x20─'[_0x146ab8(0x176)](0x1e)));const _0xecf8e8=(_0x269e2c,_0x2092ac)=>{const _0x2c9dde=_0x146ab8;if(!_0x2092ac){console['log']('\x20\x20'+_0x269e2c['padEnd'](0x11)+'\x20'+a20_0x4b56ae[_0x2c9dde(0x191)](_0x2c9dde(0x186)));return;}const _0x3427cf=inspectCliConfigJsonFile(_0x2092ac);if(_0x3427cf['status']==='ok')console[_0x2c9dde(0x19c)]('\x20\x20'+_0x269e2c['padEnd'](0x11)+'\x20'+a20_0x4b56ae[_0x2c9dde(0x16b)](_0x2c9dde(0x1a0)));else{if(_0x3427cf[_0x2c9dde(0x172)]==='empty')console[_0x2c9dde(0x19c)]('\x20\x20'+_0x269e2c[_0x2c9dde(0x181)](0x11)+'\x20'+a20_0x4b56ae['yellow'](_0x2c9dde(0x1a1)));else _0x3427cf[_0x2c9dde(0x172)]===_0x2c9dde(0x19e)?console[_0x2c9dde(0x19c)]('\x20\x20'+_0x269e2c[_0x2c9dde(0x181)](0x11)+'\x20'+a20_0x4b56ae['gray'](_0x2c9dde(0x192))):(console['log']('\x20\x20'+_0x269e2c[_0x2c9dde(0x181)](0x11)+'\x20'+a20_0x4b56ae[_0x2c9dde(0x19b)](_0x2c9dde(0x199))),console[_0x2c9dde(0x19c)]('\x20\x20'+''[_0x2c9dde(0x181)](0x11)+'\x20'+a20_0x4b56ae[_0x2c9dde(0x19b)](_0x3427cf[_0x2c9dde(0x193)])));}};_0xecf8e8(_0x146ab8(0x1a7),_0x3cae84),_0xecf8e8(_0x146ab8(0x17f),_0x1871b6),console[_0x146ab8(0x19c)](),console[_0x146ab8(0x19c)](a20_0x4b56ae[_0x146ab8(0x17c)](_0x146ab8(0x175))),console[_0x146ab8(0x19c)](a20_0x4b56ae[_0x146ab8(0x191)](_0x146ab8(0x163)[_0x146ab8(0x176)](0x1e))),console[_0x146ab8(0x19c)](_0x146ab8(0x189)+(_0x5a65bd[_0x146ab8(0x167)]||a20_0x4b56ae['red'](_0x146ab8(0x168)))),console[_0x146ab8(0x19c)](_0x146ab8(0x1a2)+_0x5a65bd[_0x146ab8(0x164)]);const _0x11758c=isLegacyCompatConfigKey('locale')?a20_0x4b56ae[_0x146ab8(0x191)](_0x5a65bd[_0x146ab8(0x195)]+'\x20(legacy/compat\x20only)'):_0x5a65bd['locale'];return console[_0x146ab8(0x19c)](_0x146ab8(0x1a3)+_0x11758c),console['log'](_0x146ab8(0x170)+(_0x5a65bd[_0x146ab8(0x169)]||a20_0x4b56ae[_0x146ab8(0x191)](_0x146ab8(0x185)))),console[_0x146ab8(0x19c)]('\x20\x20currentApp:\x20\x20\x20\x20\x20\x20'+(_0x5a65bd[_0x146ab8(0x19d)]||a20_0x4b56ae['gray'](_0x146ab8(0x185)))),console[_0x146ab8(0x19c)]('\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x5a65bd[_0x146ab8(0x18b)]||a20_0x4b56ae[_0x146ab8(0x191)](_0x146ab8(0x16c)+DEFAULT_CONFIG_VALUES[_0x146ab8(0x18b)]+')'))),console[_0x146ab8(0x19c)](_0x146ab8(0x182)+(_0x5a65bd[_0x146ab8(0x18f)]??a20_0x4b56ae[_0x146ab8(0x191)](_0x146ab8(0x171)))),console['log']('\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20'+_0x5a65bd['riskLevel']),console[_0x146ab8(0x19c)](_0x146ab8(0x1a9)+_0x5a65bd[_0x146ab8(0x1a5)]),console[_0x146ab8(0x19c)](_0x146ab8(0x198)+AUTH_MODE['ClientAk']),console[_0x146ab8(0x19c)]('\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20'+(_0x5a65bd[_0x146ab8(0x194)]?a20_0x4b56ae['green'](_0x146ab8(0x16e)+_0x5a65bd['accessKey'][_0x146ab8(0x17a)]+')'):a20_0x4b56ae[_0x146ab8(0x191)](_0x146ab8(0x185)))),console[_0x146ab8(0x19c)](),console['log'](a20_0x4b56ae[_0x146ab8(0x17c)](_0x146ab8(0x177))),console[_0x146ab8(0x19c)](a20_0x4b56ae['gray'](_0x146ab8(0x163)['repeat'](0x1e))),console[_0x146ab8(0x19c)](_0x146ab8(0x174)+getApiDomain()),console[_0x146ab8(0x19c)](_0x146ab8(0x18c)+getUserDomain()),console[_0x146ab8(0x19c)](_0x146ab8(0x197)+getRuntimeDomain()),console['log'](),console[_0x146ab8(0x19c)](a20_0x4b56ae[_0x146ab8(0x17c)]('\x20\x20Auth')),console[_0x146ab8(0x19c)](a20_0x4b56ae[_0x146ab8(0x191)](_0x146ab8(0x163)['repeat'](0x1e))),console[_0x146ab8(0x19c)](_0x146ab8(0x18a)+a20_0x4b56ae[_0x146ab8(0x16b)](AUTH_MODE[_0x146ab8(0x183)]+'\x20(accessKey)')),console[_0x146ab8(0x19c)](_0x146ab8(0x173)+a20_0x4b56ae[_0x146ab8(0x191)]('(removed\x20—\x20cookie\x20auth\x20disabled)')),console[_0x146ab8(0x19c)](),{'ok':!![]};}export const doctorDefinition={'service':'doctor','command':a20_0xb923f3(0x19a),'description':a20_0xb923f3(0x1a6),'risk':a20_0xb923f3(0x180),'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_0x1739c9=a21_0x3feb;(function(_0x27dd7d,_0x475b28){const _0x638bfb=a21_0x3feb,_0x535cdd=_0x27dd7d();while(!![]){try{const _0x3adc26=parseInt(_0x638bfb(0x1c6))/0x1+-parseInt(_0x638bfb(0x207))/0x2+-parseInt(_0x638bfb(0x1df))/0x3+-parseInt(_0x638bfb(0x200))/0x4*(-parseInt(_0x638bfb(0x1c4))/0x5)+-parseInt(_0x638bfb(0x201))/0x6*(-parseInt(_0x638bfb(0x1f2))/0x7)+-parseInt(_0x638bfb(0x1de))/0x8*(-parseInt(_0x638bfb(0x1e7))/0x9)+-parseInt(_0x638bfb(0x1f1))/0xa;if(_0x3adc26===_0x475b28)break;else _0x535cdd['push'](_0x535cdd['shift']());}catch(_0x1d17cf){_0x535cdd['push'](_0x535cdd['shift']());}}}(a21_0x43ca,0x61434));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_0x1739c9(0x1fb),'type':a21_0x1739c9(0x1f4),'description':a21_0x1739c9(0x1e1)},{'name':a21_0x1739c9(0x1e2),'type':a21_0x1739c9(0x1f4),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES[a21_0x1739c9(0x1e2)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x1739c9(0x1fa),'type':a21_0x1739c9(0x1dd),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a21_0x1739c9(0x1eb)]+a21_0x1739c9(0x1c9),'default':![]},{'name':a21_0x1739c9(0x1ec),'type':a21_0x1739c9(0x1dd),'description':a21_0x1739c9(0x1d4),'default':![]}];export const initImportFlagDefs=[{'name':'file','type':a21_0x1739c9(0x1f4),'description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':a21_0x1739c9(0x1fb),'type':'string','description':a21_0x1739c9(0x1ed)},{'name':a21_0x1739c9(0x1e2),'type':a21_0x1739c9(0x1f4),'description':a21_0x1739c9(0x1fd),'enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x1739c9(0x1fa),'type':a21_0x1739c9(0x1dd),'description':a21_0x1739c9(0x1d6)+PRODUCT_CONFIG['newConfigFileName']+')\x20instead\x20of\x20project','default':![]},{'name':a21_0x1739c9(0x1ec),'type':a21_0x1739c9(0x1dd),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x4ff09a){const _0x4b9017=a21_0x1739c9,_0x1057eb=isNonInteractiveMode(_0x4ff09a),_0x145271=_0x4ff09a['global']?_0x4b9017(0x1fa):_0x4b9017(0x1f9),_0x5c46ae=resolveWriteConfigPath(_0x145271);try{_0x1057eb?await runNonInteractive(_0x4ff09a,_0x5c46ae):await runInteractive(_0x4ff09a,_0x5c46ae);}catch(_0x4b3aa2){if(_0x4b3aa2 instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0x4b3aa2;}}export async function runInitImport(_0x14b516){const _0x5584cc=a21_0x1739c9,_0x215733=_0x14b516['global']?_0x5584cc(0x1fa):_0x5584cc(0x1f9),_0x5c1681=resolveWriteConfigPath(_0x215733);await runFromImport(_0x14b516,_0x5c1681);}const RUNTIME_IRRELEVANT_KEYS=new Set(['apiDir']);async function runFromImport(_0x9d7b29,_0x4c881b){const _0x1c7b86=a21_0x1739c9,_0xdba58b=resolveFilePath(_0x9d7b29[_0x1c7b86(0x1d9)]);if(!existsSync(_0xdba58b))throw CliErrors[_0x1c7b86(0x1cc)](_0x1c7b86(0x1e3)+_0xdba58b);const _0x2332bd=readSourceFile(_0xdba58b),_0x8d2cff=convertToRuntimeConfig(_0x2332bd);_0x9d7b29[_0x1c7b86(0x1fb)]&&(_0x8d2cff[_0x1c7b86(0x1fb)]=String(_0x9d7b29[_0x1c7b86(0x1fb)]));_0x9d7b29[_0x1c7b86(0x1e2)]&&(_0x8d2cff[_0x1c7b86(0x1e2)]=resolveInitEnv(_0x9d7b29));if(!_0x8d2cff[_0x1c7b86(0x1fb)])throw CliErrors[_0x1c7b86(0x1cc)](_0x1c7b86(0x1d5),'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(_0x4c881b,_0x8d2cff,_0x9d7b29),console[_0x1c7b86(0x1ee)](_0x1c7b86(0x1d2)+_0xdba58b),console[_0x1c7b86(0x1ee)](_0x1c7b86(0x205)+_0x4c881b),console[_0x1c7b86(0x1ee)](_0x1c7b86(0x202)+_0x8d2cff[_0x1c7b86(0x1fb)]);if(_0x8d2cff[_0x1c7b86(0x1cb)])console[_0x1c7b86(0x1ee)](_0x1c7b86(0x1fe)+_0x8d2cff['defaultApp']);}function a21_0x3feb(_0x4770f0,_0x5cceb0){_0x4770f0=_0x4770f0-0x1c4;const _0x43ca71=a21_0x43ca();let _0x3feb90=_0x43ca71[_0x4770f0];return _0x3feb90;}function convertToRuntimeConfig(_0xdcb10b){const _0x540c07=a21_0x1739c9;if(_0xdcb10b[_0x540c07(0x1ff)]&&typeof _0xdcb10b[_0x540c07(0x1ff)]===_0x540c07(0x1db))throw CliErrors[_0x540c07(0x1cc)]('Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.',_0x540c07(0x206));const _0x14e357={};for(const _0x139453 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0xdcb10b[_0x139453]!==undefined&&(_0x14e357[_0x139453]=_0xdcb10b[_0x139453]);}return!_0x14e357[_0x540c07(0x1f8)]&&(_0x14e357[_0x540c07(0x1f8)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x14e357;}async function runNonInteractive(_0x408cca,_0x7a0af4){const _0x2b12ae=a21_0x1739c9,_0x34a053=_0x408cca[_0x2b12ae(0x1fb)];if(!_0x34a053)throw CliErrors[_0x2b12ae(0x204)](_0x2b12ae(0x1fb),_0x2b12ae(0x1f0)+CLI_BIN_NAME+_0x2b12ae(0x1cf));const _0x5c6b4a=resolveInitEnv(_0x408cca);await writeInitConfig(_0x7a0af4,{'appcode':_0x34a053,'env':_0x5c6b4a},_0x408cca),console[_0x2b12ae(0x1ee)](_0x2b12ae(0x1e6)+_0x7a0af4),console[_0x2b12ae(0x1ee)](_0x2b12ae(0x202)+_0x34a053),console[_0x2b12ae(0x1ee)](_0x2b12ae(0x1ce)+_0x5c6b4a);}async function runInteractive(_0x5bfdec,_0x1857e8){const _0x45c8bb=a21_0x1739c9,_0x26fd53=loadExisting(_0x1857e8),_0xff9073=typeof _0x26fd53?.[_0x45c8bb(0x1fb)]===_0x45c8bb(0x1f4)?_0x26fd53[_0x45c8bb(0x1fb)]:'',_0x381c25=resolveInitEnv(_0x5bfdec);console['log'](CLI_BIN_NAME+_0x45c8bb(0x1d8)+PRODUCT_CONFIG[_0x45c8bb(0x1eb)]+'\x0a');if(existsSync(_0x1857e8)&&!_0x5bfdec[_0x45c8bb(0x1ec)]){const _0x29d2be=await promptYesNo(_0x45c8bb(0x209)+_0x1857e8+_0x45c8bb(0x203),![]);if(!_0x29d2be){console[_0x45c8bb(0x1ee)](_0x45c8bb(0x1fc));return;}}const _0x14095b=typeof _0x5bfdec[_0x45c8bb(0x1fb)]===_0x45c8bb(0x1f4)?_0x5bfdec[_0x45c8bb(0x1fb)][_0x45c8bb(0x1d3)]():'';let _0x119ad4=_0x14095b;!_0x119ad4&&(_0x119ad4=await promptInput(_0x45c8bb(0x1cd),_0xff9073));if(!_0x119ad4[_0x45c8bb(0x1d3)]())throw CliErrors[_0x45c8bb(0x1cc)]('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x1857e8,{'appcode':_0x119ad4[_0x45c8bb(0x1d3)](),'env':_0x381c25},_0x5bfdec),console[_0x45c8bb(0x1ee)](_0x45c8bb(0x1f3)+_0x1857e8),console[_0x45c8bb(0x1ee)](_0x45c8bb(0x202)+_0x119ad4['trim']()),console[_0x45c8bb(0x1ee)](_0x45c8bb(0x1ce)+_0x381c25);}async function writeInitConfig(_0xaabf6d,_0x4ecef7,_0x1e1c11){const _0x2b6a85=a21_0x1739c9;let _0x4c6175={};existsSync(_0xaabf6d)&&!_0x1e1c11['yes']&&(_0x4c6175=readConfigFile(_0xaabf6d));for(const [_0x4297e3,_0xf75229]of Object[_0x2b6a85(0x1e4)](_0x4ecef7)){_0xf75229!==undefined&&(_0x4c6175[_0x4297e3]=_0xf75229);}if(_0x4c6175[_0x2b6a85(0x1d1)])delete _0x4c6175[_0x2b6a85(0x1d1)];writeConfigFile(_0xaabf6d,_0x4c6175);}class AbortPrompt extends Error{constructor(){const _0x34405a=a21_0x1739c9;super(_0x34405a(0x1f5)),this[_0x34405a(0x1c7)]=_0x34405a(0x1d7);}}function createSafeRl(){const _0x4df82b=a21_0x1739c9,_0xc1379=createInterface({'input':process[_0x4df82b(0x208)],'output':process['stdout']});let _0x4fbd97;const _0x5350af=new Promise((_0x4ba406,_0x181b24)=>{const _0xf49e5f=_0x4df82b;_0x4fbd97=()=>{const _0x4734ea=a21_0x3feb;_0x4fbd97&&(_0xc1379[_0x4734ea(0x1ef)](_0x4734ea(0x1dc),_0x4fbd97),_0x4fbd97=undefined);try{_0xc1379[_0x4734ea(0x1da)]();}catch{}_0x181b24(new AbortPrompt());},_0xc1379[_0xf49e5f(0x1e8)]('SIGINT',_0x4fbd97);}),_0x1033a6=()=>{const _0x1811e8=_0x4df82b;_0x4fbd97&&(_0xc1379[_0x1811e8(0x1ef)]('SIGINT',_0x4fbd97),_0x4fbd97=undefined);try{_0xc1379['close']();}catch{}};return{'rl':_0xc1379,'abortPromise':_0x5350af,'disposeSuccess':_0x1033a6};}async function promptInput(_0x5807ad,_0x36e02b){const {rl:_0x428497,abortPromise:_0x5bc550,disposeSuccess:_0x262937}=createSafeRl(),_0x33a323=new Promise(_0x301827=>{const _0x3388ae=a21_0x3feb,_0xa5859d=_0x36e02b?'\x20\x20'+_0x5807ad+'\x20('+_0x36e02b+_0x3388ae(0x1f6):'\x20\x20'+_0x5807ad+':\x20';_0x428497['question'](_0xa5859d,_0x1ec5b1=>{_0x262937(),_0x301827(_0x1ec5b1['trim']()||_0x36e02b);});});return Promise['race']([_0x33a323,_0x5bc550]);}async function promptYesNo(_0x28c810,_0x1b7306){const _0x1e1440=a21_0x1739c9,{rl:_0x5d1466,abortPromise:_0x3d7d59,disposeSuccess:_0x3bbc40}=createSafeRl(),_0x24c385=new Promise(_0x15811d=>{const _0x5c7334=a21_0x3feb,_0x5cadfb=_0x1b7306?_0x5c7334(0x1f7):'[y/N]';_0x5d1466['question']('\x20\x20'+_0x28c810+'\x20'+_0x5cadfb+':\x20',_0x3c36ec=>{const _0x3a9963=_0x5c7334;_0x3bbc40();const _0x14ee5b=_0x3c36ec[_0x3a9963(0x1d3)]()[_0x3a9963(0x1e0)]();if(_0x14ee5b==='y'||_0x14ee5b===_0x3a9963(0x1ec))_0x15811d(!![]);else{if(_0x14ee5b==='n'||_0x14ee5b==='no')_0x15811d(![]);else _0x15811d(_0x1b7306);}});});return Promise[_0x1e1440(0x1c8)]([_0x24c385,_0x3d7d59]);}function loadExisting(_0xf03e3f){if(!existsSync(_0xf03e3f))return null;return readConfigFile(_0xf03e3f);}function a21_0x43ca(){const _0x3fe448=['\x0aInitialized\x20','string','User\x20aborted\x20prompt','):\x20','[Y/n]','riskLevel','project','global','appcode','Aborted.','Override\x20imported\x20default\x20env','\x20\x20default:\x20','apps','1444Oqeclc','6UgzVhb','\x20\x20appcode:\x20','\x20already\x20exists.\x20Overwrite?','flagMissing','\x20\x20config:\x20\x20','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','1323144RcyjHx','stdin','File\x20','5795rTelQn','utf8','779861UnSPpH','name','race',')\x20instead\x20of\x20project','includes','defaultApp','validation','App\x20code','\x20\x20env:\x20\x20\x20\x20\x20','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','Failed\x20to\x20parse\x20source\x20file:\x20','app','Imported\x20from\x20','trim','Skip\x20confirmation\x20when\x20overwriting','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','Write\x20to\x20global\x20(~/','AbortPrompt','\x20init\x20—\x20Create\x20','file','close','object','SIGINT','boolean','120myeiRF','1874019lrwWqZ','toLowerCase','App\x20code\x20for\x20the\x20project','env','Source\x20file\x20not\x20found:\x20','entries','Invalid\x20env\x20\x22','Initialized\x20','151605QVTyNk','once','parse','\x22.\x20Allowed:\x20','newConfigFileName','yes','Override\x20imported\x20default\x20appcode','log','removeListener','Usage:\x20','4145310SlhRbS','4537603KJUFab'];a21_0x43ca=function(){return _0x3fe448;};return a21_0x43ca();}function resolveFilePath(_0xd9cb1c){return isAbsolute(_0xd9cb1c)?_0xd9cb1c:resolve(process['cwd'](),_0xd9cb1c);}function readSourceFile(_0x5bde95){const _0x488583=a21_0x1739c9;try{const _0x2285b5=readFileSync(_0x5bde95,{'encoding':_0x488583(0x1c5)});return JSON[_0x488583(0x1e9)](_0x2285b5);}catch(_0x28f1d8){throw CliErrors[_0x488583(0x1cc)](_0x488583(0x1d0)+_0x28f1d8['message']);}}function resolveInitEnv(_0x5d5edf){const _0x75faca=a21_0x1739c9,_0x31eed7=_0x5d5edf['env'];if(_0x31eed7===undefined||_0x31eed7==='')return DEFAULT_CONFIG_VALUES[_0x75faca(0x1e2)];if(!RUNTIME_ENV_VALUES[_0x75faca(0x1ca)](_0x31eed7))throw CliErrors[_0x75faca(0x1cc)](_0x75faca(0x1e5)+_0x31eed7+_0x75faca(0x1ea)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x31eed7;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a22_0x2f0d60=a22_0x1904;(function(_0x12c954,_0x3c4f0c){const _0x3aba03=a22_0x1904,_0xba0398=_0x12c954();while(!![]){try{const _0x4e8aad=parseInt(_0x3aba03(0x1df))/0x1+parseInt(_0x3aba03(0x1ef))/0x2+-parseInt(_0x3aba03(0x1e1))/0x3+-parseInt(_0x3aba03(0x213))/0x4*(-parseInt(_0x3aba03(0x21d))/0x5)+-parseInt(_0x3aba03(0x200))/0x6+-parseInt(_0x3aba03(0x1ea))/0x7+-parseInt(_0x3aba03(0x1e6))/0x8*(-parseInt(_0x3aba03(0x1fb))/0x9);if(_0x4e8aad===_0x3c4f0c)break;else _0xba0398['push'](_0xba0398['shift']());}catch(_0x6b02e1){_0xba0398['push'](_0xba0398['shift']());}}}(a22_0x84ad,0x2004f));import{existsSync,readFileSync,statSync}from'node:fs';function a22_0x1904(_0x24b130,_0x86da00){_0x24b130=_0x24b130-0x1dd;const _0x84ad2a=a22_0x84ad();let _0x1904b6=_0x84ad2a[_0x24b130];return _0x1904b6;}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_0x2f0d60(0x21c),'type':a22_0x2f0d60(0x1ee),'required':!![],'description':a22_0x2f0d60(0x1f6)},FILE_FLAG={'name':a22_0x2f0d60(0x1e8),'type':a22_0x2f0d60(0x1ee),'required':!![],'description':a22_0x2f0d60(0x219)},QUERY_FLAG={'name':'query','type':a22_0x2f0d60(0x1ee),'required':!![],'description':a22_0x2f0d60(0x218)},TOPK_FLAG={'name':'topk','type':a22_0x2f0d60(0x215),'description':a22_0x2f0d60(0x203)};function readKnowledgeFile(_0x317ca6){const _0x5014f3=a22_0x2f0d60;if(!_0x317ca6)throw CliErrors[_0x5014f3(0x1dd)]('File\x20path\x20is\x20required.');if(!existsSync(_0x317ca6))throw CliErrors['validation'](_0x5014f3(0x211)+_0x317ca6);if(!statSync(_0x317ca6)[_0x5014f3(0x20d)]())throw CliErrors['validation'](_0x5014f3(0x1ec)+_0x317ca6);return readFileSync(_0x317ca6,_0x5014f3(0x1f4));}function summarizePersonalItem(_0x247a93){const _0x1d4542=a22_0x2f0d60;return{'id':_0x247a93['id'],'title':_0x247a93[_0x1d4542(0x21c)],'version':_0x247a93['version'],'ragStatus':_0x247a93[_0x1d4542(0x1f7)],'ragErrorMessage':_0x247a93['ragErrorMessage'],'updateTime':_0x247a93['updateTime']};}function a22_0x84ad(){const _0x44c422=['trim','weightedScore','16kjWcyS','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','file','version','118363CawTYP','num','File\x20is\x20not\x20a\x20regular\x20file:\x20','flag','string','309568rTJHhl','/client/knowledge-base/personal/create','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','--topk\x20must\x20be\x20a\x20positive\x20number.','Search\x20query\x20is\x20required.','utf8','Created\x20KB\x20entry\x20','Personal\x20knowledge-base\x20entry\x20title','ragStatus','create','docId','write','364941sDxxZN','isFinite','update','createTime','ragErrorMessage','485118swNxyE','Personal\x20knowledge-base\x20entry\x20ID','score','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','topk','bool','content','/client/knowledge-base/personal/','/update','read','list','query','Updated\x20KB\x20entry\x20','isFile','str','scope','metadata','File\x20not\x20found:\x20','build','96pjDyna','search','number','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','POST','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','title','14095YMeNSH','userId','body','length','appCode','validation','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','152118ujZIAV','updateTime','680229hhgEKo','map','detail'];a22_0x84ad=function(){return _0x44c422;};return a22_0x84ad();}function detailPersonalItem(_0x358dc9){const _0x368347=a22_0x2f0d60;return{'id':_0x358dc9['id'],'appCode':_0x358dc9[_0x368347(0x221)],'scope':_0x358dc9[_0x368347(0x20f)],'userId':_0x358dc9[_0x368347(0x21e)],'title':_0x358dc9[_0x368347(0x21c)],'content':_0x358dc9[_0x368347(0x206)]??'','version':_0x358dc9[_0x368347(0x1e9)],'ragStatus':_0x358dc9[_0x368347(0x1f7)],'ragErrorMessage':_0x358dc9[_0x368347(0x1ff)],'createTime':_0x358dc9[_0x368347(0x1fe)],'updateTime':_0x358dc9[_0x368347(0x1e0)]};}function summarizeSearchHit(_0x5c6a72){const _0x352cdb=a22_0x2f0d60;return{'scope':_0x5c6a72[_0x352cdb(0x20f)],'docId':_0x5c6a72[_0x352cdb(0x1f9)],'score':_0x5c6a72[_0x352cdb(0x202)],'weightedScore':_0x5c6a72[_0x352cdb(0x1e5)],'content':_0x5c6a72[_0x352cdb(0x206)],'metadata':_0x5c6a72[_0x352cdb(0x210)]};}function readTopK(_0x374c4a){const _0x5b7743=a22_0x2f0d60,_0x20af78=_0x374c4a[_0x5b7743(0x1ed)](_0x5b7743(0x204));if(_0x20af78===undefined||_0x20af78===null||_0x20af78==='')return undefined;const _0xa3d4d5=_0x374c4a[_0x5b7743(0x1eb)]('topk');if(!Number[_0x5b7743(0x1fc)](_0xa3d4d5)||_0xa3d4d5<0x1)throw CliErrors[_0x5b7743(0x1dd)](_0x5b7743(0x1f2));return _0xa3d4d5;}const kbList={'service':'kb','command':a22_0x2f0d60(0x20a),'description':a22_0x2f0d60(0x216),'risk':a22_0x2f0d60(0x209),'flags':[VERBOSE_FLAG],async 'execute'(_0x4f68dd){const _0x13924b=a22_0x2f0d60,_0x3b3129=await listPersonalKnowledgeBaseItems(_0x4f68dd[_0x13924b(0x221)]);if(_0x4f68dd[_0x13924b(0x205)]('verbose'))return{'ok':!![],'data':{'total':_0x3b3129[_0x13924b(0x220)],'items':_0x3b3129}};return{'ok':!![],'data':{'total':_0x3b3129[_0x13924b(0x220)],'items':_0x3b3129[_0x13924b(0x1e2)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a22_0x2f0d60(0x1e3),'description':a22_0x2f0d60(0x1de),'risk':a22_0x2f0d60(0x209),'flags':[{...ID_FLAG,'description':'Personal\x20knowledge-base\x20entry\x20ID'}],async 'execute'(_0x263363){const _0x3b64c2=a22_0x2f0d60,_0x12dd3a=await getPersonalKnowledgeBaseItem(_0x263363[_0x3b64c2(0x1eb)]('id'),_0x263363[_0x3b64c2(0x221)]);return{'ok':!![],'data':detailPersonalItem(_0x12dd3a)};}},kbCreate={'service':'kb','command':a22_0x2f0d60(0x1f8),'description':a22_0x2f0d60(0x1e7),'risk':a22_0x2f0d60(0x1fa),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x329b4a){const _0xdba3dc=a22_0x2f0d60,_0x82890c=_0x329b4a[_0xdba3dc(0x20e)](_0xdba3dc(0x21c)),_0x52331d=readKnowledgeFile(_0x329b4a['str'](_0xdba3dc(0x1e8))),_0xedf4e7=await createPersonalKnowledgeBaseItem(_0x329b4a[_0xdba3dc(0x221)],{'title':_0x82890c,'content':_0x52331d});return{'ok':!![],'data':summarizePersonalItem(_0xedf4e7),'message':_0xdba3dc(0x1f5)+_0xedf4e7['id']+'\x20('+_0xedf4e7['title']+')'};},async 'dryRun'(_0x5c6e79){const _0x8bd1be=a22_0x2f0d60,_0x4d9097=_0x5c6e79[_0x8bd1be(0x20e)](_0x8bd1be(0x21c)),_0x2d2e79=readKnowledgeFile(_0x5c6e79[_0x8bd1be(0x20e)](_0x8bd1be(0x1e8)));return dryRun(_0x8bd1be(0x217),_0x8bd1be(0x1f0))[_0x8bd1be(0x21f)]({'appCode':_0x5c6e79[_0x8bd1be(0x221)],'title':_0x4d9097,'content':_0x2d2e79})['description'](_0x8bd1be(0x21a)+_0x4d9097+'\x22')[_0x8bd1be(0x212)]();}},kbUpdate={'service':'kb','command':a22_0x2f0d60(0x1fd),'description':a22_0x2f0d60(0x1f1),'risk':a22_0x2f0d60(0x1fa),'flags':[{...ID_FLAG,'description':a22_0x2f0d60(0x201)},{...TITLE_FLAG,'required':![],'description':'Override\x20the\x20existing\x20entry\x20title'},FILE_FLAG],async 'execute'(_0x2b295f){const _0x495443=a22_0x2f0d60,_0x12f358=_0x2b295f[_0x495443(0x1eb)]('id'),_0x285047=readKnowledgeFile(_0x2b295f[_0x495443(0x20e)](_0x495443(0x1e8))),_0x5754c8=_0x2b295f['str'](_0x495443(0x21c))||(await getPersonalKnowledgeBaseItem(_0x12f358,_0x2b295f[_0x495443(0x221)]))[_0x495443(0x21c)],_0x12e0e1=await updatePersonalKnowledgeBaseItem(_0x12f358,_0x2b295f[_0x495443(0x221)],{'title':_0x5754c8,'content':_0x285047});return{'ok':!![],'data':summarizePersonalItem(_0x12e0e1),'message':_0x495443(0x20c)+_0x12e0e1['id']+'\x20('+_0x12e0e1['title']+')'};},async 'dryRun'(_0x72c43){const _0x10e066=a22_0x2f0d60,_0x5530c5=_0x72c43[_0x10e066(0x1eb)]('id'),_0x13dd7f=readKnowledgeFile(_0x72c43['str'](_0x10e066(0x1e8))),_0x2346fb=_0x72c43[_0x10e066(0x20e)](_0x10e066(0x21c))||(await getPersonalKnowledgeBaseItem(_0x5530c5,_0x72c43[_0x10e066(0x221)]))['title'];return dryRun(_0x10e066(0x217),_0x10e066(0x207)+_0x5530c5+_0x10e066(0x208))['body']({'appCode':_0x72c43[_0x10e066(0x221)],'title':_0x2346fb,'content':_0x13dd7f})['description']('Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20'+_0x5530c5)[_0x10e066(0x212)]();}},kbSearch={'service':'kb','command':a22_0x2f0d60(0x214),'description':a22_0x2f0d60(0x21b),'risk':'read','flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x156153){const _0x5dafee=a22_0x2f0d60;if(!_0x156153[_0x5dafee(0x20e)](_0x5dafee(0x20b))[_0x5dafee(0x1e4)]())throw CliErrors[_0x5dafee(0x1dd)](_0x5dafee(0x1f3));readTopK(_0x156153);},async 'execute'(_0x73562f){const _0x51f79=a22_0x2f0d60,_0x5c8cb1=_0x73562f['str'](_0x51f79(0x20b))[_0x51f79(0x1e4)](),_0x5aa320=readTopK(_0x73562f),_0xfd7ade=await searchKnowledgeBase(_0x73562f[_0x51f79(0x221)],{'query':_0x5c8cb1,'topK':_0x5aa320});return{'ok':!![],'data':{'total':_0xfd7ade[_0x51f79(0x220)],'hits':_0xfd7ade['map'](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x6473a1=a23_0x36f6;(function(_0x3ad3e2,_0x5434a4){const _0x3e798d=a23_0x36f6,_0x58358b=_0x3ad3e2();while(!![]){try{const _0x3ccac6=-parseInt(_0x3e798d(0x16d))/0x1*(parseInt(_0x3e798d(0x15d))/0x2)+-parseInt(_0x3e798d(0x15b))/0x3*(parseInt(_0x3e798d(0x165))/0x4)+-parseInt(_0x3e798d(0x16f))/0x5*(-parseInt(_0x3e798d(0x168))/0x6)+-parseInt(_0x3e798d(0x174))/0x7*(-parseInt(_0x3e798d(0x16c))/0x8)+parseInt(_0x3e798d(0x16b))/0x9*(-parseInt(_0x3e798d(0x159))/0xa)+-parseInt(_0x3e798d(0x161))/0xb*(-parseInt(_0x3e798d(0x166))/0xc)+parseInt(_0x3e798d(0x170))/0xd*(parseInt(_0x3e798d(0x172))/0xe);if(_0x3ccac6===_0x5434a4)break;else _0x58358b['push'](_0x58358b['shift']());}catch(_0x55b854){_0x58358b['push'](_0x58358b['shift']());}}}(a23_0x1fd3,0xa6d07));function a23_0x1fd3(){const _0x5ec8f5=['read','length','message','174801czBMDX','logs','level','\x20\x20\x20Duration:\x20','1362076mySNBY','924IkKGOG','success','4662qYTeUr','log','timestamp','999IeLwMl','8PHLFfs','162rzXcCA','warn','6695IuQnjI','3520933CIzoFK','en-US','14faAVPg','\x20\x20\x20Time:\x20','3529148fKWgIT','keys','toLocaleString','write','stringify','forEach','error','readLogs','details','duration','show','command','\x20\x20\x20Details:\x20','94890eQYoPW','\x20logs:\x0a','9RpWpce','*\x20No\x20logs\x20found','3468jSdJyO'];a23_0x1fd3=function(){return _0x5ec8f5;};return a23_0x1fd3();}function a23_0x36f6(_0x4fd79a,_0x3c4fd2){_0x4fd79a=_0x4fd79a-0x152;const _0x1fd313=a23_0x1fd3();let _0x36f65b=_0x1fd313[_0x4fd79a];return _0x36f65b;}import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x282b55){const _0x1b7ba3=a23_0x36f6;if(_0x282b55[_0x1b7ba3(0x15f)]===0x0){console[_0x1b7ba3(0x169)](_0x1b7ba3(0x15c));return;}console[_0x1b7ba3(0x169)]('*\x20'+CLI_DISPLAY_NAME+_0x1b7ba3(0x15a)),_0x282b55[_0x1b7ba3(0x179)]((_0x137ca1,_0x2ef1c3)=>{const _0x2ab8eb=_0x1b7ba3,_0x553014=new Date(_0x137ca1[_0x2ab8eb(0x16a)])[_0x2ab8eb(0x176)](_0x2ab8eb(0x171)),_0x10ede6=_0x137ca1[_0x2ab8eb(0x163)]===_0x2ab8eb(0x167)?'√':_0x137ca1[_0x2ab8eb(0x163)]===_0x2ab8eb(0x152)?'×':_0x137ca1[_0x2ab8eb(0x163)]===_0x2ab8eb(0x16e)?'!':'i';console['log'](_0x2ef1c3+0x1+'.\x20'+_0x10ede6+'\x20['+_0x137ca1[_0x2ab8eb(0x157)]+']\x20'+_0x137ca1[_0x2ab8eb(0x160)]),console[_0x2ab8eb(0x169)](_0x2ab8eb(0x173)+_0x553014),_0x137ca1['duration']&&console[_0x2ab8eb(0x169)](_0x2ab8eb(0x164)+_0x137ca1[_0x2ab8eb(0x155)]+'ms'),_0x137ca1[_0x2ab8eb(0x154)]&&Object[_0x2ab8eb(0x175)](_0x137ca1[_0x2ab8eb(0x154)])[_0x2ab8eb(0x15f)]>0x0&&console[_0x2ab8eb(0x169)](_0x2ab8eb(0x158)+JSON[_0x2ab8eb(0x178)](_0x137ca1['details'],null,0x2)),console[_0x2ab8eb(0x169)]('');});}export const logsDefinitions=[{'service':a23_0x6473a1(0x162),'command':a23_0x6473a1(0x156),'description':'View\x20command\x20history\x20logs','risk':a23_0x6473a1(0x15e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1a7340){const _0x2545ce=a23_0x6473a1;return printLogs(logger[_0x2545ce(0x153)]()),{'ok':!![]};}},{'service':a23_0x6473a1(0x162),'command':'clear','description':'Clear\x20command\x20history\x20logs','risk':a23_0x6473a1(0x177),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x4a9571){const _0x19e354=a23_0x6473a1;return logger['clearLogs'](),console[_0x19e354(0x169)]('*\x20Logs\x20cleared'),{'ok':!![]};}}];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a24_0x2f3443=a24_0x2e73;(function(_0x47ce6a,_0x1d8991){const _0x1d5da8=a24_0x2e73,_0x4c34e4=_0x47ce6a();while(!![]){try{const _0x5d7f5f=parseInt(_0x1d5da8(0xdb))/0x1*(-parseInt(_0x1d5da8(0xef))/0x2)+-parseInt(_0x1d5da8(0xe6))/0x3+parseInt(_0x1d5da8(0xda))/0x4*(-parseInt(_0x1d5da8(0xed))/0x5)+parseInt(_0x1d5da8(0xdf))/0x6+-parseInt(_0x1d5da8(0xd6))/0x7*(-parseInt(_0x1d5da8(0xf5))/0x8)+-parseInt(_0x1d5da8(0xe4))/0x9*(parseInt(_0x1d5da8(0xe3))/0xa)+parseInt(_0x1d5da8(0xe9))/0xb;if(_0x5d7f5f===_0x1d8991)break;else _0x4c34e4['push'](_0x4c34e4['shift']());}catch(_0x15d798){_0x4c34e4['push'](_0x4c34e4['shift']());}}}(a24_0x15db,0xb3f21));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';function a24_0x15db(){const _0x122249=['SQL\x20Queries','service','description','isSingleCommand','25496Buktpc','write','Instant\x20API','get','2282fJJGcv','Knowledge\x20Base','Diagnostics','\x20\x20[write]','18376MjZhgS','1mlbCTV','command','Configuration','set','7777422HZTYwx','Authentication','from','map','4730410CHuEWz','18izckbF','defaultCommand','1066128xWXILQ','read','values','5401011zIePAS','push','list','show','665bGnCCs','login','353366NZBzyH','risk'];a24_0x15db=function(){return _0x122249;};return a24_0x15db();}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();function a24_0x2e73(_0xad7891,_0x53876c){_0xad7891=_0xad7891-0xd4;const _0x15dbda=a24_0x15db();let _0x2e7311=_0x15dbda[_0xad7891];return _0x2e7311;}export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x292a7d){const _0x508d93=a24_0x2e73;for(const _0x523a49 of _0x292a7d){definitions[_0x508d93(0xde)](_0x523a49['service']+':'+_0x523a49[_0x508d93(0xdc)],_0x523a49);let _0x335dd8=serviceGroups[_0x508d93(0xd5)](_0x523a49[_0x508d93(0xf2)]);!_0x335dd8&&(_0x335dd8=[],serviceGroups[_0x508d93(0xde)](_0x523a49[_0x508d93(0xf2)],_0x335dd8)),_0x335dd8[_0x508d93(0xea)](_0x523a49);}}function registerService(_0xe2a15d,_0x597bcf,_0x5c7a0b){const _0x14180e=a24_0x2e73;registerDefinitions(_0x597bcf);const _0x86b051=_0x18141b=>_0x18141b===_0x14180e(0xe7)?'':_0x18141b===_0x14180e(0xf6)?_0x14180e(0xd9):'\x20\x20[high-risk-write]',_0x177ac6={'service':_0x597bcf[0x0]['service'],'label':_0xe2a15d,'commands':_0x597bcf[_0x14180e(0xe2)](_0x58aecd=>({'command':_0x58aecd[_0x14180e(0xdc)],'description':_0x58aecd[_0x14180e(0xf3)],'tag':_0x86b051(_0x58aecd[_0x14180e(0xf0)])})),'defaultCommand':_0x5c7a0b?.[_0x14180e(0xe5)]??(_0x5c7a0b?.[_0x14180e(0xf4)]?_0x597bcf[0x0][_0x14180e(0xdc)]:undefined),'isSingleCommand':_0x5c7a0b?.[_0x14180e(0xf4)]};serviceRegistry[_0x14180e(0xea)](_0x177ac6),serviceByName['set'](_0x177ac6[_0x14180e(0xf2)],_0x177ac6);}registerService(a24_0x2f3443(0xe0),authDefinitions,{'defaultCommand':a24_0x2f3443(0xee)}),registerService('Datasets',datasetDefinitions),registerService(a24_0x2f3443(0xd4),dataDefinitions),registerService(a24_0x2f3443(0xf1),sqlDefinitions),registerService('BFF\x20Scripts',bffDefinitions),registerService(a24_0x2f3443(0xd7),kbDefinitions),registerService('App\x20Management',appDefinitions,{'defaultCommand':a24_0x2f3443(0xeb)}),registerService(a24_0x2f3443(0xdd),configDefinitions,{'defaultCommand':a24_0x2f3443(0xeb)}),registerService('Skills',skillDefinitions,{'defaultCommand':'install'}),registerService('Self\x20Update',[updateDefinition],{'defaultCommand':'run','isSingleCommand':!![]}),registerService(a24_0x2f3443(0xd8),[doctorDefinition],{'isSingleCommand':!![]}),registerService('Schema',[schemaDefinition],{'isSingleCommand':!![]}),registerService('Logs',logsDefinitions,{'defaultCommand':a24_0x2f3443(0xec)});export function findDefinition(_0x49dcc4,_0x193008){const _0x5bd424=a24_0x2f3443;return definitions[_0x5bd424(0xd5)](_0x49dcc4+':'+_0x193008);}export function isKnownService(_0x2c495d){return serviceByName['has'](_0x2c495d);}export function getServiceEntry(_0x546951){const _0x1c18db=a24_0x2f3443;return serviceByName[_0x1c18db(0xd5)](_0x546951);}export function getAllDefinitions(){const _0x4deb43=a24_0x2f3443;return Array[_0x4deb43(0xe1)](definitions[_0x4deb43(0xe8)]());}
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x4301b7=a25_0x5f18;(function(_0x32410f,_0x42fa01){const _0x2f27b7=a25_0x5f18,_0x353bb4=_0x32410f();while(!![]){try{const _0x550993=parseInt(_0x2f27b7(0x191))/0x1*(parseInt(_0x2f27b7(0x19a))/0x2)+parseInt(_0x2f27b7(0x196))/0x3+parseInt(_0x2f27b7(0x194))/0x4+parseInt(_0x2f27b7(0x192))/0x5+parseInt(_0x2f27b7(0x193))/0x6*(-parseInt(_0x2f27b7(0x19b))/0x7)+-parseInt(_0x2f27b7(0x198))/0x8+-parseInt(_0x2f27b7(0x199))/0x9;if(_0x550993===_0x42fa01)break;else _0x353bb4['push'](_0x353bb4['shift']());}catch(_0x48de6c){_0x353bb4['push'](_0x353bb4['shift']());}}}(a25_0x1678,0x9248b));import{buildSchemaPayload}from'../framework/schema-export.js';function a25_0x5f18(_0x48bdad,_0x183e01){_0x48bdad=_0x48bdad-0x191;const _0x16787b=a25_0x1678();let _0x5f18f1=_0x16787b[_0x48bdad];return _0x5f18f1;}async function execute(_0x4b3c8a){const _0x3cdc95=await buildSchemaPayload();return{'ok':!![],'data':_0x3cdc95};}function a25_0x1678(){const _0xda3439=['1568287RJxkKv','6056hUGuvA','1140545LxQlhA','6bOvDEn','906456QSyrRv','schema','1305576tziVNH','read','4046656oPkHqS','5912991eTJDly','362TDJZAQ'];a25_0x1678=function(){return _0xda3439;};return a25_0x1678();}export const schemaDefinition={'service':a25_0x4301b7(0x195),'command':'export','description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a25_0x4301b7(0x197),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a26_0x450e(){const _0x86962d=['Installing\x20published\x20','\x20personal\x20and\x20','find','=1);\x20assuming\x20skill\x20is\x20already\x20present.','inherit','122805PrinCB','nonInteractive','unknown','unchanged','filter','\x20-g\x20-y)...','action','updated','../../skills/runtime-skill-sync.js','appCode','Install\x20the\x20published\x20','Installing\x20official\x20skill\x20via\x20npx\x20(npx\x20skills\x20add\x20','info','authRequired','skillCode','personal','Created\x20personal\x20Skill\x20','reduce','created','length','11732931mWPxyz','push','log','skipped','5932696NVcDcB','14JaDATc','2698026OWXPxE','Local\x20Skill\x20directory\x20containing\x20SKILL.md','dir','company','str','../../core/api-client.js','Updated\x20personal\x20Skill\x20','write','pull','179803wwCqzD','scope','\x20company\x20Skill(s).','code','cwd','6YppiMy','Pulled\x20','accessKey','map','skillName','\x20developer\x20skill','Check\x20network\x20connectivity\x20and\x20try\x20again.','9741000hjmefS','Pull\x20personal\x20and\x20company\x20runtime\x20Skills\x20into\x20local\x20agent\x20skill\x20directories','version','Skipped\x20npx\x20(','apiError','trim','error','input','string','setLogPath','\x20skill\x20installed','164iwuBcM','9387610PjASKy'];a26_0x450e=function(){return _0x86962d;};return a26_0x450e();}const a26_0x168d75=a26_0x2cfe;(function(_0x469fdd,_0x480703){const _0x3667d7=a26_0x2cfe,_0x366981=_0x469fdd();while(!![]){try{const _0x4e9e3a=-parseInt(_0x3667d7(0x124))/0x1*(parseInt(_0x3667d7(0x11a))/0x2)+-parseInt(_0x3667d7(0x11b))/0x3+parseInt(_0x3667d7(0x13b))/0x4*(parseInt(_0x3667d7(0x142))/0x5)+parseInt(_0x3667d7(0x129))/0x6*(parseInt(_0x3667d7(0x119))/0x7)+-parseInt(_0x3667d7(0x130))/0x8+parseInt(_0x3667d7(0x115))/0x9+parseInt(_0x3667d7(0x13c))/0xa;if(_0x4e9e3a===_0x480703)break;else _0x366981['push'](_0x366981['shift']());}catch(_0x96ce14){_0x366981['push'](_0x366981['shift']());}}}(a26_0x450e,0xb01d1));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_0x168d75(0x127),'type':'string','description':'Only\x20pull\x20a\x20specific\x20runtime\x20Skill\x20code'},DIR_FLAG={'name':a26_0x168d75(0x11d),'type':a26_0x168d75(0x138),'required':!![],'description':a26_0x168d75(0x11c)};function summarizeRuntimeSkill(_0x4ba461){const _0x2cf5fe=a26_0x168d75;return{'id':_0x4ba461['id'],'skillCode':_0x4ba461[_0x2cf5fe(0x150)],'skillName':_0x4ba461[_0x2cf5fe(0x12d)],'scope':_0x4ba461[_0x2cf5fe(0x125)],'version':_0x4ba461[_0x2cf5fe(0x132)],'readonly':_0x4ba461['readonly']};}function a26_0x2cfe(_0x58b4e2,_0x1299a7){_0x58b4e2=_0x58b4e2-0x111;const _0x450e5b=a26_0x450e();let _0x2cfe76=_0x450e5b[_0x58b4e2];return _0x2cfe76;}function filterByCode(_0x19335d,_0x4d76ac){const _0x2c3de8=a26_0x168d75,_0xd5533a=_0x4d76ac[_0x2c3de8(0x135)]();if(!_0xd5533a)return _0x19335d;return _0x19335d[_0x2c3de8(0x146)](_0x174964=>_0x174964[_0x2c3de8(0x150)]===_0xd5533a);}export const skillDefinitions=[{'service':'skill','command':'install','description':a26_0x168d75(0x14c)+CLI_BIN_NAME+a26_0x168d75(0x12e),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x273861){const _0x7fa231=a26_0x168d75;logger[_0x7fa231(0x139)](process['cwd']()),logger[_0x7fa231(0x14e)]('skill-install',_0x7fa231(0x13d)+CLI_DISPLAY_NAME+'\x20skill\x20via\x20npx.');const {LOVRABET_SKILL_SOURCE:_0x4d6eda,LOVRABET_SKIP_NPX_SKILLS_ENV:_0x3aa33f,runNpxSkillsAddGlobal:_0x481a1a}=await import('../../skills/npx-skills-add.js'),_0x140c02=_0x273861[_0x7fa231(0x143)]?'pipe':_0x7fa231(0x141);console[_0x7fa231(0x117)](_0x7fa231(0x14d)+_0x4d6eda+_0x7fa231(0x147));const _0x2ae076=_0x481a1a(process[_0x7fa231(0x128)](),_0x4d6eda,{'stdio':_0x140c02});if(_0x2ae076[_0x7fa231(0x118)])console[_0x7fa231(0x117)](_0x7fa231(0x133)+_0x3aa33f+_0x7fa231(0x140));else{if(_0x2ae076['ok'])console[_0x7fa231(0x117)](CLI_BIN_NAME+_0x7fa231(0x13a));else throw CliErrors[_0x7fa231(0x134)]('npx\x20skills\x20add\x20failed:\x20'+(_0x2ae076[_0x7fa231(0x136)]||_0x7fa231(0x144)),_0x7fa231(0x12f));}return{'ok':!![]};}},{'service':'skill','command':a26_0x168d75(0x123),'description':a26_0x168d75(0x131),'risk':a26_0x168d75(0x122),'flags':[CODE_FLAG],async 'execute'(_0xbd8c04){const _0x400a8b=a26_0x168d75,{listCompanyRuntimeSkills:_0x4ec099,listPersonalRuntimeSkills:_0x179a81}=await import(_0x400a8b(0x120)),{linkEffectiveRuntimeSkills:_0x16ae6b,materializeRuntimeSkill:_0x1256a5}=await import(_0x400a8b(0x14a)),_0x337648=_0xbd8c04['str']('code'),_0x1f20b2=_0xbd8c04['envName']??'production',_0x36c6b1=_0xbd8c04[_0x400a8b(0x12b)];if(!_0x36c6b1)throw CliErrors[_0x400a8b(0x14f)]();const _0xbec0c3=filterByCode(await _0x179a81(_0xbd8c04[_0x400a8b(0x14b)]),_0x337648),_0x14ca50=filterByCode(await _0x4ec099(_0xbd8c04[_0x400a8b(0x14b)]),_0x337648),_0x4a0e6e=[..._0xbec0c3[_0x400a8b(0x12c)](_0x22aae3=>_0x1256a5(_0x22aae3,_0x400a8b(0x151),{'env':_0x1f20b2,'accessKey':_0x36c6b1,'appCode':_0xbd8c04[_0x400a8b(0x14b)]})),..._0x14ca50[_0x400a8b(0x12c)](_0x4d4abf=>_0x1256a5(_0x4d4abf,_0x400a8b(0x11e),{'env':_0x1f20b2,'accessKey':_0x36c6b1,'appCode':_0xbd8c04['appCode']}))],_0x296ab6=_0x16ae6b(_0x4a0e6e,_0xbd8c04['appCode']),_0x1f0512=_0x296ab6[_0x400a8b(0x112)]((_0x5041f4,_0x5cf052)=>{const _0x5bc24f=_0x400a8b;return _0x5041f4[_0x5cf052[_0x5bc24f(0x148)]]=(_0x5041f4[_0x5cf052[_0x5bc24f(0x148)]]??0x0)+0x1,_0x5041f4;},{});return{'ok':!![],'data':{'appCode':_0xbd8c04[_0x400a8b(0x14b)],'personal':_0xbec0c3[_0x400a8b(0x114)],'company':_0x14ca50[_0x400a8b(0x114)],'materialized':_0x4a0e6e['length'],'links':{'total':_0x296ab6[_0x400a8b(0x114)],'created':_0x1f0512[_0x400a8b(0x113)]??0x0,'updated':_0x1f0512[_0x400a8b(0x149)]??0x0,'unchanged':_0x1f0512[_0x400a8b(0x145)]??0x0,'skipped':0x0,'conflicted':0x0},'skills':{'personal':_0xbec0c3[_0x400a8b(0x12c)](summarizeRuntimeSkill),'company':_0x14ca50[_0x400a8b(0x12c)](summarizeRuntimeSkill)}},'message':_0x400a8b(0x12a)+_0xbec0c3[_0x400a8b(0x114)]+_0x400a8b(0x13e)+_0x14ca50[_0x400a8b(0x114)]+_0x400a8b(0x126)};}},{'service':'skill','command':a26_0x168d75(0x116),'description':'Push\x20a\x20local\x20Skill\x20directory\x20to\x20personal\x20runtime\x20Skill\x20scope','risk':a26_0x168d75(0x122),'flags':[DIR_FLAG],async 'execute'(_0x340566){const _0x41fc08=a26_0x168d75,{createPersonalRuntimeSkill:_0x43c971,listPersonalRuntimeSkills:_0x56036c,updatePersonalRuntimeSkill:_0x43bcd8}=await import(_0x41fc08(0x120)),{readPushDirectory:_0x2f2ca1}=await import(_0x41fc08(0x14a));if(!_0x340566['accessKey'])throw CliErrors[_0x41fc08(0x14f)]();const _0x12e239=_0x2f2ca1(_0x340566[_0x41fc08(0x11f)](_0x41fc08(0x11d)),_0x340566['appCode']),_0x3dd80d=(await _0x56036c(_0x340566[_0x41fc08(0x14b)]))[_0x41fc08(0x13f)](_0x97ab84=>_0x97ab84['skillCode']===_0x12e239[_0x41fc08(0x150)]),_0x1b4786=_0x3dd80d?await _0x43bcd8(_0x12e239[_0x41fc08(0x150)],_0x340566['appCode'],_0x12e239[_0x41fc08(0x137)]):await _0x43c971(_0x340566[_0x41fc08(0x14b)],_0x12e239[_0x41fc08(0x137)]);return{'ok':!![],'data':summarizeRuntimeSkill(_0x1b4786),'message':_0x3dd80d?_0x41fc08(0x121)+_0x12e239['skillCode']:_0x41fc08(0x111)+_0x12e239['skillCode']};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a27_0x2fc0(_0x279836,_0x110abe){_0x279836=_0x279836-0x18c;const _0x276e66=a27_0x276e();let _0x2fc0b2=_0x276e66[_0x279836];return _0x2fc0b2;}const a27_0x2a2fc0=a27_0x2fc0;(function(_0xcfd5c3,_0x5126c2){const _0x31a3b1=a27_0x2fc0,_0x50bc76=_0xcfd5c3();while(!![]){try{const _0x2c518b=parseInt(_0x31a3b1(0x191))/0x1+parseInt(_0x31a3b1(0x193))/0x2*(-parseInt(_0x31a3b1(0x1a0))/0x3)+parseInt(_0x31a3b1(0x198))/0x4*(parseInt(_0x31a3b1(0x18c))/0x5)+parseInt(_0x31a3b1(0x19e))/0x6*(-parseInt(_0x31a3b1(0x195))/0x7)+parseInt(_0x31a3b1(0x196))/0x8*(-parseInt(_0x31a3b1(0x19b))/0x9)+-parseInt(_0x31a3b1(0x19a))/0xa+parseInt(_0x31a3b1(0x1a1))/0xb;if(_0x2c518b===_0x5126c2)break;else _0x50bc76['push'](_0x50bc76['shift']());}catch(_0x28eb08){_0x50bc76['push'](_0x50bc76['shift']());}}}(a27_0x276e,0xd1534));function a27_0x276e(){const _0x3f51f8=['14PIfdaF','58360JQXuYt','description','20SkncPd','sqlcode','17108000YHkcOp','1044jsNYpa','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','verbose','1111794oUfvQx','sqlContent','667848anaFQt','22261943cqKnRj','1637675tZQwvk','sql','read','dbId','detail','346142rsqZVM','appCode','2fLLFfE','bool'];a27_0x276e=function(){return _0x3f51f8;};return a27_0x276e();}import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a27_0x2a2fc0(0x18d),'command':a27_0x2a2fc0(0x190),'description':a27_0x2a2fc0(0x19c),'risk':a27_0x2a2fc0(0x18e),'flags':[SQLCODE_FLAG,VERBOSE_FLAG],async 'execute'(_0x416c06){const _0x4b63d8=a27_0x2a2fc0,_0x4df8ac=await getSqlQueryInfo(_0x416c06['appCode'],_0x416c06['str'](_0x4b63d8(0x199))),_0x1a4870=_0x416c06[_0x4b63d8(0x194)](_0x4b63d8(0x19d));if(_0x1a4870)return{'ok':!![],'data':_0x4df8ac};const _0x3b93c7=_0x4df8ac['dbId']?await getDbName(_0x416c06[_0x4b63d8(0x192)],_0x4df8ac['dbId']):undefined;return{'ok':!![],'data':{'sqlCode':_0x4df8ac['sqlCode'],'sqlName':_0x4df8ac['sqlName'],'db':_0x3b93c7?_0x3b93c7+'\x20('+_0x4df8ac[_0x4b63d8(0x18f)]+')':_0x4df8ac['dbId']??'','description':_0x4df8ac[_0x4b63d8(0x197)]??'','sqlContent':_0x4df8ac[_0x4b63d8(0x19f)]??''}};}};
|