@lovrabet/lovrabet-cli 2.0.13-beta.0 → 2.0.13-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
function a16_0x991f(){const _0x3e3f9e=['\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','build','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','\x20completed\x20in\x20','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','\x20\x20LOGICAL\x20COMBINATORS','4lpGvuN','delete','Update\x20an\x20existing\x20record','str','12cJRmFv','\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','Preview:\x20data\x20','1265209ZGKAbr','187794OKukqI','data\x20','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','update','description','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','63oxJLpe','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','write','Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Post-aggregation\x20filter,\x20e.g.\x20{\x22total\x22:{\x22$gt\x22:1000}}','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','15183cXkTTo','\x20on\x20dataset\x20','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','now','\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','high-risk-write','read','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','POST','code','paramsHint','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','\x20\x20AGGREGATE\x20TYPES','batchCreate','131608MyNFGk','body','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','filter','operation','aggregate','\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','map','15IPEZYG','dryRun','173850gGaAmj','\x20\x20EXAMPLES','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','546036xBJfca','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\x20\x20PAGINATION','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20field\x20values\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','Get\x20a\x20single\x20record\x20by\x20ID','risk','params','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','command','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','57634KvdeDU','create','730EUxabO','getOne','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)'];a16_0x991f=function(){return _0x3e3f9e;};return a16_0x991f();}function a16_0x28dc(_0x2bc91f,_0x1aec2e){_0x2bc91f=_0x2bc91f-0xba;const _0x991f79=a16_0x991f();let _0x28dc3d=_0x991f79[_0x2bc91f];return _0x28dc3d;}const a16_0x1b5f6a=a16_0x28dc;(function(_0x36bef7,_0x4486fa){const _0x2ec226=a16_0x28dc,_0x24d902=_0x36bef7();while(!![]){try{const _0x2488b3=parseInt(_0x2ec226(0xbf))/0x1+parseInt(_0x2ec226(0x104))/0x2+parseInt(_0x2ec226(0x107))/0x3*(-parseInt(_0x2ec226(0xcc))/0x4)+parseInt(_0x2ec226(0x102))/0x5*(parseInt(_0x2ec226(0xd6))/0x6)+-parseInt(_0x2ec226(0xdd))/0x7*(parseInt(_0x2ec226(0xf8))/0x8)+parseInt(_0x2ec226(0xe6))/0x9*(parseInt(_0x2ec226(0xc1))/0xa)+-parseInt(_0x2ec226(0xd5))/0xb*(-parseInt(_0x2ec226(0xd0))/0xc);if(_0x2488b3===_0x4486fa)break;else _0x24d902['push'](_0x24d902['shift']());}catch(_0x3aea94){_0x24d902['push'](_0x24d902['shift']());}}}(a16_0x991f,0x23c7b));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a16_0x1b5f6a(0xfc),'operation':'filter','risk':'read','paramsRequired':![],'description':'Filter\x20dataset\x20records\x20with\x20query\x20conditions','paramsHint':'JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20'+a16_0x1b5f6a(0x108),'helpExtra':['\x20\x20WHERE\x20OPERATORS',a16_0x1b5f6a(0xd1),a16_0x1b5f6a(0xe5),a16_0x1b5f6a(0xd2),a16_0x1b5f6a(0xeb),'\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}',a16_0x1b5f6a(0xc5),'\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}',a16_0x1b5f6a(0xc4),'',a16_0x1b5f6a(0xcb),a16_0x1b5f6a(0xff),'\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','',a16_0x1b5f6a(0xe2),a16_0x1b5f6a(0xfa),a16_0x1b5f6a(0xf1),'\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]',a16_0x1b5f6a(0xbe),a16_0x1b5f6a(0x10a),'',a16_0x1b5f6a(0x109),a16_0x1b5f6a(0xc7),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)']['join']('\x0a')},{'command':'getOne','operation':a16_0x1b5f6a(0xc2),'risk':'read','paramsRequired':!![],'description':a16_0x1b5f6a(0x10d),'paramsHint':a16_0x1b5f6a(0xfb)},{'command':a16_0x1b5f6a(0xc0),'operation':'create','risk':a16_0x1b5f6a(0xdf),'paramsRequired':!![],'description':a16_0x1b5f6a(0xe1),'paramsHint':a16_0x1b5f6a(0xde)},{'command':a16_0x1b5f6a(0xf7),'operation':a16_0x1b5f6a(0xf7),'risk':a16_0x1b5f6a(0xdf),'paramsRequired':!![],'description':a16_0x1b5f6a(0x106),'paramsHint':a16_0x1b5f6a(0xe9)},{'command':a16_0x1b5f6a(0xda),'operation':a16_0x1b5f6a(0xda),'risk':'write','paramsRequired':!![],'description':a16_0x1b5f6a(0xce),'paramsHint':a16_0x1b5f6a(0xe3)},{'command':a16_0x1b5f6a(0xcd),'operation':a16_0x1b5f6a(0xcd),'risk':a16_0x1b5f6a(0xef),'paramsRequired':!![],'description':a16_0x1b5f6a(0xc3),'paramsHint':a16_0x1b5f6a(0xfb)},{'command':a16_0x1b5f6a(0xfe),'operation':a16_0x1b5f6a(0xfe),'risk':a16_0x1b5f6a(0xf0),'paramsRequired':![],'description':a16_0x1b5f6a(0x10c),'paramsHint':a16_0x1b5f6a(0xf5)+a16_0x1b5f6a(0xe0),'helpExtra':[a16_0x1b5f6a(0xf6),a16_0x1b5f6a(0x10b),a16_0x1b5f6a(0xd9),a16_0x1b5f6a(0xbb),a16_0x1b5f6a(0xc8),'\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}',a16_0x1b5f6a(0xee),'','\x20\x20PARAMS\x20STRUCTURE',a16_0x1b5f6a(0xd8),a16_0x1b5f6a(0xed),a16_0x1b5f6a(0xca),a16_0x1b5f6a(0xbc),a16_0x1b5f6a(0xe4),a16_0x1b5f6a(0xd3),'',a16_0x1b5f6a(0x105),a16_0x1b5f6a(0x100),a16_0x1b5f6a(0xe8),'',a16_0x1b5f6a(0xec),a16_0x1b5f6a(0xdc)]['join']('\x0a')}];function makeDataCommand(_0x463642){const _0x2d7053=a16_0x1b5f6a,_0xef7cf5=_0x2d7053(0xd7)+_0x463642[_0x2d7053(0xbd)],_0x43baf2={'service':'data','command':_0x463642[_0x2d7053(0xbd)],'description':_0x463642[_0x2d7053(0xdb)],'risk':_0x463642['risk'],'helpExtra':_0x463642['helpExtra'],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x463642[_0x2d7053(0xf4)]}],'validate':async _0x40a61c=>{const _0x14d423=_0x2d7053;_0x463642['paramsRequired']&&requireAnyOf(_0x40a61c,[_0x14d423(0xba)],_0xef7cf5),_0x463642[_0x14d423(0xfd)]==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x40a61c[_0x14d423(0xcf)]('params')));},async 'execute'(_0x571354){const _0x20f5a9=_0x2d7053,_0x510b5a=_0x571354[_0x20f5a9(0xcf)](_0x20f5a9(0xf3)),_0x413681=_0x463642[_0x20f5a9(0xfd)]===_0x20f5a9(0xf7)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x571354['str'](_0x20f5a9(0xba)))):parseJsonParams(_0x571354[_0x20f5a9(0xcf)](_0x20f5a9(0xba)))??{},_0x320071=Date[_0x20f5a9(0xea)](),_0x13fb68=await executeData(_0x510b5a,_0x463642[_0x20f5a9(0xfd)],_0x413681),_0x36d5ec=Date[_0x20f5a9(0xea)]()-_0x320071;return{'ok':!![],'data':{'result':_0x13fb68,'elapsed':_0x36d5ec},'message':'data\x20'+_0x463642['command']+_0x20f5a9(0xc9)+_0x36d5ec+'ms'};}};return _0x463642[_0x2d7053(0x10e)]!=='read'&&(_0x43baf2[_0x2d7053(0x103)]=async _0x49bf58=>{const _0x133cbc=_0x2d7053,_0xf052f2=_0x49bf58[_0x133cbc(0xcf)](_0x133cbc(0xf3)),_0x213fe5=_0x463642[_0x133cbc(0xfd)]===_0x133cbc(0xf7)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x49bf58[_0x133cbc(0xcf)]('params'))):parseJsonParams(_0x49bf58['str'](_0x133cbc(0xba)))??{};return dryRun(_0x133cbc(0xf2),'/api/{appCode}/'+_0xf052f2+'/'+_0x463642[_0x133cbc(0xfd)])[_0x133cbc(0xf9)](_0x213fe5)[_0x133cbc(0xdb)](_0x133cbc(0xd4)+_0x463642['command']+_0x133cbc(0xe7)+_0xf052f2)[_0x133cbc(0xc6)]();}),_0x43baf2;}export const dataDefinitions=specs[a16_0x1b5f6a(0x101)](makeDataCommand);
|
|
1
|
+
const a16_0x189ea2=a16_0x453b;(function(_0x26704a,_0x15c5c0){const _0x4c06df=a16_0x453b,_0x4871e6=_0x26704a();while(!![]){try{const _0x108d61=-parseInt(_0x4c06df(0x226))/0x1*(-parseInt(_0x4c06df(0x200))/0x2)+-parseInt(_0x4c06df(0x1ee))/0x3+parseInt(_0x4c06df(0x1f4))/0x4+parseInt(_0x4c06df(0x1ed))/0x5+parseInt(_0x4c06df(0x205))/0x6*(parseInt(_0x4c06df(0x221))/0x7)+-parseInt(_0x4c06df(0x204))/0x8+parseInt(_0x4c06df(0x1fa))/0x9;if(_0x108d61===_0x15c5c0)break;else _0x4871e6['push'](_0x4871e6['shift']());}catch(_0x140cd8){_0x4871e6['push'](_0x4871e6['shift']());}}}(a16_0x598d,0x8b665));function a16_0x453b(_0x2b7223,_0x1e042e){_0x2b7223=_0x2b7223-0x1e1;const _0x598d39=a16_0x598d();let _0x453bac=_0x598d39[_0x2b7223];return _0x453bac;}import{executeData}from'../../core/sdk-client.js';function a16_0x598d(){const _0x3c6c71=['\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}}','5326165jGeSVJ','2656041ciTkuL','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','delete','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','now','\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]','3020004xxyZft','getOne','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','\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\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','1838340rgCOrT','read','high-risk-write','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}','Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','28kWBLMT','POST','\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\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}','8007608PwpEWy','2572098uKjQwE','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','filter','\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\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','\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}}','operation','\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','\x20\x20PARAMS\x20STRUCTURE','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','\x20\x20EXAMPLES','aggregate','command','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','\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\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\x20on\x20dataset\x20','batchCreate','\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}}]}','params','helpExtra','body','write','\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\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}','7xuVHfE','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\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}','join','\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}}','293aIBBbS','Preview:\x20data\x20','/api/{appCode}/','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','\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--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','\x20\x20\x20\x20$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}}]}','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','paramsHint','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','data\x20','create','\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}','str','code','update','description'];a16_0x598d=function(){return _0x3c6c71;};return a16_0x598d();}import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a16_0x189ea2(0x207),'operation':a16_0x189ea2(0x207),'risk':'read','paramsRequired':![],'description':'Filter\x20dataset\x20records\x20with\x20query\x20conditions','paramsHint':a16_0x189ea2(0x1f6)+'Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','helpExtra':['\x20\x20WHERE\x20OPERATORS','\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_0x189ea2(0x1e3),a16_0x189ea2(0x1e4),a16_0x189ea2(0x20b),a16_0x189ea2(0x1ef),a16_0x189ea2(0x1ec),a16_0x189ea2(0x20d),a16_0x189ea2(0x208),a16_0x189ea2(0x225),a16_0x189ea2(0x21f),'','\x20\x20LOGICAL\x20COMBINATORS',a16_0x189ea2(0x22c),a16_0x189ea2(0x21a),'',a16_0x189ea2(0x1f9),a16_0x189ea2(0x209),a16_0x189ea2(0x202),a16_0x189ea2(0x22a),'\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)',a16_0x189ea2(0x216),'','\x20\x20PAGINATION',a16_0x189ea2(0x214),a16_0x189ea2(0x20a),'\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)']['join']('\x0a')},{'command':a16_0x189ea2(0x1f5),'operation':a16_0x189ea2(0x1f5),'risk':'read','paramsRequired':!![],'description':'Get\x20a\x20single\x20record\x20by\x20ID','paramsHint':a16_0x189ea2(0x20f)},{'command':a16_0x189ea2(0x1e6),'operation':'create','risk':'write','paramsRequired':!![],'description':'Create\x20a\x20new\x20record\x20in\x20a\x20dataset','paramsHint':a16_0x189ea2(0x1e1)},{'command':a16_0x189ea2(0x219),'operation':'batchCreate','risk':a16_0x189ea2(0x21e),'paramsRequired':!![],'description':a16_0x189ea2(0x1f1),'paramsHint':a16_0x189ea2(0x1f7)},{'command':a16_0x189ea2(0x1ea),'operation':'update','risk':a16_0x189ea2(0x21e),'paramsRequired':!![],'description':'Update\x20an\x20existing\x20record','paramsHint':a16_0x189ea2(0x1fd)},{'command':'delete','operation':a16_0x189ea2(0x1f0),'risk':a16_0x189ea2(0x1fc),'paramsRequired':!![],'description':a16_0x189ea2(0x206),'paramsHint':a16_0x189ea2(0x20f)},{'command':a16_0x189ea2(0x212),'operation':'aggregate','risk':a16_0x189ea2(0x1fb),'paramsRequired':![],'description':'Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','paramsHint':'JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20'+a16_0x189ea2(0x1ff),'helpExtra':['\x20\x20AGGREGATE\x20TYPES',a16_0x189ea2(0x1e7),a16_0x189ea2(0x220),'\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_0x189ea2(0x223),a16_0x189ea2(0x1f8),a16_0x189ea2(0x1fe),a16_0x189ea2(0x203),'',a16_0x189ea2(0x20e),a16_0x189ea2(0x1f3),a16_0x189ea2(0x217),a16_0x189ea2(0x215),a16_0x189ea2(0x222),'\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}}',a16_0x189ea2(0x210),'',a16_0x189ea2(0x211),'\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','\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_0x189ea2(0x229),a16_0x189ea2(0x22b)][a16_0x189ea2(0x224)]('\x0a')}];function makeDataCommand(_0x1b6457){const _0x23e6d5=a16_0x189ea2,_0x3f11e1=_0x23e6d5(0x1e5)+_0x1b6457['command'],_0xc0a14b={'service':'data','command':_0x1b6457[_0x23e6d5(0x213)],'description':_0x1b6457['description'],'risk':_0x1b6457['risk'],'helpExtra':_0x1b6457[_0x23e6d5(0x21c)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x1b6457[_0x23e6d5(0x1e2)]}],'validate':async _0x100aa1=>{const _0x31d87e=_0x23e6d5;_0x1b6457['paramsRequired']&&requireAnyOf(_0x100aa1,[_0x31d87e(0x21b)],_0x3f11e1),_0x1b6457[_0x31d87e(0x20c)]==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x100aa1[_0x31d87e(0x1e8)]('params')));},async 'execute'(_0x75dddd){const _0x9ecfb=_0x23e6d5,_0x13d8fb=_0x75dddd[_0x9ecfb(0x1e8)]('code'),_0x439960=_0x1b6457[_0x9ecfb(0x20c)]===_0x9ecfb(0x219)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x75dddd[_0x9ecfb(0x1e8)](_0x9ecfb(0x21b)))):parseJsonParams(_0x75dddd[_0x9ecfb(0x1e8)](_0x9ecfb(0x21b)))??{},_0x5b9edb=Date[_0x9ecfb(0x1f2)](),_0x508194=await executeData(_0x13d8fb,_0x1b6457[_0x9ecfb(0x20c)],_0x439960),_0x4d36fd=Date[_0x9ecfb(0x1f2)]()-_0x5b9edb;return{'ok':!![],'data':{'result':_0x508194,'elapsed':_0x4d36fd},'message':_0x9ecfb(0x1e5)+_0x1b6457[_0x9ecfb(0x213)]+'\x20completed\x20in\x20'+_0x4d36fd+'ms'};}};return _0x1b6457['risk']!==_0x23e6d5(0x1fb)&&(_0xc0a14b['dryRun']=async _0x1e982b=>{const _0x1f087b=_0x23e6d5,_0x5d0702=_0x1e982b[_0x1f087b(0x1e8)](_0x1f087b(0x1e9)),_0x378bf8=_0x1b6457[_0x1f087b(0x20c)]===_0x1f087b(0x219)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x1e982b[_0x1f087b(0x1e8)](_0x1f087b(0x21b)))):parseJsonParams(_0x1e982b['str']('params'))??{};return dryRun(_0x1f087b(0x201),_0x1f087b(0x228)+_0x5d0702+'/'+_0x1b6457[_0x1f087b(0x20c)])[_0x1f087b(0x21d)](_0x378bf8)[_0x1f087b(0x1eb)](_0x1f087b(0x227)+_0x1b6457['command']+_0x1f087b(0x218)+_0x5d0702)['build']();}),_0xc0a14b;}export const dataDefinitions=specs['map'](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a17_0x56c223=a17_0x5b4b;(function(_0x37d5d0,_0xf8e202){const _0x121779=a17_0x5b4b,_0x2fd1ab=_0x37d5d0();while(!![]){try{const _0x5ba697=-parseInt(_0x121779(0x1d5))/0x1+parseInt(_0x121779(0x1bc))/0x2*(parseInt(_0x121779(0x1c7))/0x3)+parseInt(_0x121779(0x1ba))/0x4+parseInt(_0x121779(0x1cc))/0x5*(-parseInt(_0x121779(0x1d2))/0x6)+parseInt(_0x121779(0x1dc))/0x7*(parseInt(_0x121779(0x19b))/0x8)+-parseInt(_0x121779(0x1b5))/0x9*(parseInt(_0x121779(0x195))/0xa)+-parseInt(_0x121779(0x19c))/0xb*(parseInt(_0x121779(0x1c4))/0xc);if(_0x5ba697===_0xf8e202)break;else _0x2fd1ab['push'](_0x2fd1ab['shift']());}catch(_0x22ea8f){_0x2fd1ab['push'](_0x2fd1ab['shift']());}}}(a17_0x2ddc,0x1a47e));function a17_0x5b4b(_0x4075ef,_0x43c1b1){_0x4075ef=_0x4075ef-0x190;const _0x2ddcc4=a17_0x2ddc();let _0x5b4bc1=_0x2ddcc4[_0x4075ef];return _0x5b4bc1;}import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x40a265){const _0x40934b=a17_0x5b4b;if(_0x40a265[_0x40934b(0x1c9)])return null;const _0x32ac7a=Boolean(_0x40a265[_0x40934b(0x191)]!==undefined||_0x40a265[_0x40934b(0x1bd)]!==undefined);let _0x394e20={};if(!_0x32ac7a&&typeof _0x40a265[_0x40934b(0x1d8)]===_0x40934b(0x1d0))try{_0x394e20=JSON['parse'](_0x40a265[_0x40934b(0x1d8)]);}catch{}const _0x1fcc48=_0x32ac7a?_0x40a265[_0x40934b(0x1c3)]:_0x40a265[_0x40934b(0x1a0)],_0x481e81=_0x32ac7a?_0x40a265[_0x40934b(0x191)]:_0x40a265[_0x40934b(0x1c3)],_0x2286f5=_0x32ac7a?_0x40a265['doType']:_0x40a265[_0x40934b(0x1d1)]||_0x40a265[_0x40934b(0x1b1)],_0xdf99ac=_0x32ac7a?_0x40a265[_0x40934b(0x1b7)]===!![]:_0x394e20[_0x40934b(0x1b7)]===!![],_0x184334=_0x32ac7a?_0x40a265[_0x40934b(0x1c2)]===!![]:_0x394e20['required']===!![],_0x32cfd3=_0x32ac7a?_0x40a265[_0x40934b(0x1ab)]??null:_0x394e20[_0x40934b(0x1ab)]??null,_0x13c300={'name':_0x1fcc48,'displayName':_0x481e81||_0x1fcc48,'type':_0x2286f5,'dbType':_0x40a265[_0x40934b(0x192)],'pk':_0xdf99ac,'required':_0x184334,'description':_0x40a265[_0x40934b(0x190)]||undefined};return Array[_0x40934b(0x1a3)](_0x32cfd3)&&_0x32cfd3[_0x40934b(0x1d7)]>0x0&&(_0x13c300['options']=_0x32cfd3),_0x13c300;}function parseJsonMaybe(_0x16c580){const _0x5bbb79=a17_0x5b4b;if(typeof _0x16c580!==_0x5bbb79(0x1d0))return _0x16c580;try{return JSON[_0x5bbb79(0x1c0)](_0x16c580);}catch{return _0x16c580;}}function a17_0x2ddc(){const _0x38b73d=['detail','host','beforeScriptId','dataType','modifierIdField','relations','find','9LFJjCQ','fields','pkField','responseFields','doVersion','760800DYdpdi','updateTimeField','2BvevdM','doType','toTableName','columnCodeListWithDeleted','parse','modelCode','required','name','1740kIucdY','dbtableConfig','formatRules','433326wcRkzn','toFieldLabel','deleted','dataset','relatedPageInfoList','55RnYymu','trim','modifierNameField','indexes','string','type','97758LEVCwh','afterScriptId','dblinkInfoDTO','9315hmbBgR','toDatasetName','length','extend','requestBody','validateRules','datasetKey','620998yBrxmP','properties','description','displayName','dbType','creatorIdField','path','275570UnIIDV','tableName','responseBody','map','split','dbName','8szjnuR','7557gdTtFm','allFields','filter','str','code','dbId','push','isArray','tableComment','read','fromField','object','entries','labelField','appCode','options','title','requestFields'];a17_0x2ddc=function(){return _0x38b73d;};return a17_0x2ddc();}function normalizeOperationEntry(_0x37264d,_0x477984){const _0x258eaa=a17_0x5b4b;if(!_0x477984||typeof _0x477984!=='object')return null;if(!_0x477984['method']||!_0x477984[_0x258eaa(0x194)])return null;const _0x34d319={'name':_0x37264d,'method':_0x477984['method'],'path':_0x477984[_0x258eaa(0x194)]};if(_0x477984[_0x258eaa(0x1af)])_0x34d319[_0x258eaa(0x1af)]=_0x477984[_0x258eaa(0x1af)];if(_0x477984['requestBody']!=null)_0x34d319['requestBody']=parseJsonMaybe(_0x477984[_0x258eaa(0x1d9)]);if(_0x477984[_0x258eaa(0x197)]!=null)_0x34d319[_0x258eaa(0x197)]=parseJsonMaybe(_0x477984[_0x258eaa(0x197)]);if(_0x477984[_0x258eaa(0x1b0)]!=null)_0x34d319['beforeScriptId']=_0x477984[_0x258eaa(0x1b0)];if(_0x477984[_0x258eaa(0x1d3)]!=null)_0x34d319[_0x258eaa(0x1d3)]=_0x477984[_0x258eaa(0x1d3)];if(Array[_0x258eaa(0x1a3)](_0x477984[_0x258eaa(0x1ad)]))_0x34d319['requestFields']=_0x477984[_0x258eaa(0x1ad)];if(Array[_0x258eaa(0x1a3)](_0x477984[_0x258eaa(0x1b8)]))_0x34d319[_0x258eaa(0x1b8)]=_0x477984[_0x258eaa(0x1b8)];return _0x34d319;}function summarizeDbtable(_0x46d207){const _0xa951ef=a17_0x5b4b,_0x2087bc={},_0x388c9c=[_0xa951ef(0x1a1),_0xa951ef(0x19a),_0xa951ef(0x196),_0xa951ef(0x1db),_0xa951ef(0x1b7),_0xa951ef(0x19d),'logicField','createTimeField',_0xa951ef(0x1bb),_0xa951ef(0x193),'creatorNameField',_0xa951ef(0x1b2),_0xa951ef(0x1ce),_0xa951ef(0x1a9),_0xa951ef(0x1d4)];for(const _0x1ba43d of _0x388c9c){if(_0x46d207[_0x1ba43d]!==undefined)_0x2087bc[_0x1ba43d]=_0x46d207[_0x1ba43d];}return typeof _0x2087bc['allFields']===_0xa951ef(0x1d0)&&_0x2087bc[_0xa951ef(0x19d)]['length']>0x0&&(_0x2087bc['allFieldNames']=_0x2087bc[_0xa951ef(0x19d)][_0xa951ef(0x199)](',')['map'](_0x43e6eb=>_0x43e6eb[_0xa951ef(0x1cd)]())[_0xa951ef(0x19e)](Boolean)),_0x2087bc;}function normalizeRelatedPages(_0x3d5dbd){const _0x25c77d=a17_0x5b4b;if(!Array[_0x25c77d(0x1a3)](_0x3d5dbd))return[];return _0x3d5dbd[_0x25c77d(0x19e)](_0x3afb07=>_0x3afb07&&typeof _0x3afb07===_0x25c77d(0x1a7))[_0x25c77d(0x198)](_0xa46bd0=>({'id':_0xa46bd0['id'],'type':_0xa46bd0[_0x25c77d(0x1d1)],'code':_0xa46bd0[_0x25c77d(0x1a0)],'title':_0xa46bd0[_0x25c77d(0x1ac)],'deleted':_0xa46bd0[_0x25c77d(0x1c9)]===!![]}));}function normalizeFallbackFieldName(_0x4554f8,_0x5f0268){const _0x409263=a17_0x5b4b,_0x102229=_0x4554f8[_0x409263(0x1cd)]();if(!_0x102229)return null;return{'name':_0x102229,'displayName':_0x102229,'type':undefined,'dbType':undefined,'pk':_0x102229===_0x5f0268,'required':![],'description':undefined};}async function loadListFieldFallback(_0x5c6423,_0x61104d){const _0x2247be=a17_0x5b4b;if(!_0x5c6423||!_0x61104d)return[];try{const _0x1e4011=await listDatasets(_0x5c6423,{'code':_0x61104d}),_0x237b71=_0x1e4011[_0x2247be(0x1b4)](_0x22750b=>_0x22750b[_0x2247be(0x1a0)]===_0x61104d)??_0x1e4011[0x0],_0x6b8d14=_0x237b71?.[_0x2247be(0x1c5)]??{},_0x3a06b0=typeof _0x6b8d14[_0x2247be(0x19d)]===_0x2247be(0x1d0)?_0x6b8d14[_0x2247be(0x19d)][_0x2247be(0x199)](','):[];return _0x3a06b0[_0x2247be(0x198)](_0x330627=>normalizeFallbackFieldName(_0x330627,_0x6b8d14['pkField']))[_0x2247be(0x19e)](_0x25f435=>_0x25f435!==null);}catch{return[];}}export const datasetDetail={'service':'dataset','command':a17_0x56c223(0x1ae),'description':'Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','risk':a17_0x56c223(0x1a5),'flags':[CODE_FLAG],async 'execute'(_0x3c44ff){const _0x459f43=a17_0x56c223,_0x1b3b0a=await getDatasetDetail(_0x3c44ff[_0x459f43(0x19f)]('code')),_0x3a2aa5=Array[_0x459f43(0x1a3)](_0x1b3b0a[_0x459f43(0x1b6)])?_0x1b3b0a[_0x459f43(0x1b6)]:Array[_0x459f43(0x1a3)](_0x1b3b0a[_0x459f43(0x1dd)])?_0x1b3b0a[_0x459f43(0x1dd)]:[];let _0x39b913=_0x3a2aa5[_0x459f43(0x198)](_0x1bc3e2=>normalizeField(_0x1bc3e2))[_0x459f43(0x19e)](_0x5a936b=>_0x5a936b!==null);_0x39b913[_0x459f43(0x1d7)]===0x0&&(_0x39b913=await loadListFieldFallback(_0x3c44ff[_0x459f43(0x1aa)],_0x3c44ff[_0x459f43(0x19f)](_0x459f43(0x1a0))));const _0x5214ee=_0x1b3b0a['operations']??{},_0x4227f9=[];for(const [_0x425f5e,_0x58f4d1]of Object[_0x459f43(0x1a8)](_0x5214ee)){const _0x49f4b0=normalizeOperationEntry(_0x425f5e,_0x58f4d1);if(_0x49f4b0)_0x4227f9[_0x459f43(0x1a2)](_0x49f4b0);}const _0x144eec=_0x1b3b0a['dbtableConfig']??{},_0x5447d6=_0x1b3b0a[_0x459f43(0x1ca)]??{},_0x34a24b=_0x144eec[_0x459f43(0x1a1)]!=null?{'id':_0x144eec[_0x459f43(0x1a1)],'name':_0x144eec[_0x459f43(0x19a)]??null}:undefined;let _0x168768;return typeof _0x1b3b0a['extend']===_0x459f43(0x1d0)&&(_0x168768=parseJsonMaybe(_0x1b3b0a['extend'])),{'ok':!![],'data':{'id':_0x1b3b0a['modelId']??_0x1b3b0a['id'],'name':_0x1b3b0a[_0x459f43(0x1c3)],'code':_0x1b3b0a[_0x459f43(0x1c1)]||_0x1b3b0a['code'],'doVersion':_0x1b3b0a[_0x459f43(0x1b9)],'description':_0x1b3b0a[_0x459f43(0x190)]||_0x5447d6[_0x459f43(0x1a4)]||undefined,'source':_0x1b3b0a['source']||_0x5447d6['sourceType'],'table':_0x144eec[_0x459f43(0x196)]||_0x5447d6[_0x459f43(0x196)],'datasetKey':_0x144eec['datasetKey'],'pk':_0x144eec[_0x459f43(0x1b7)],'db':_0x34a24b,'dbtable':summarizeDbtable(_0x144eec),'fields':_0x39b913,'operations':_0x4227f9,'indexes':Array[_0x459f43(0x1a3)](_0x5447d6['indexes'])?_0x5447d6[_0x459f43(0x1cf)]:[],'relations':Array[_0x459f43(0x1a3)](_0x1b3b0a[_0x459f43(0x1b3)])?_0x1b3b0a[_0x459f43(0x1b3)]['map'](_0x47bfa3=>({'fromField':_0x47bfa3[_0x459f43(0x1a6)],'toDataset':_0x47bfa3[_0x459f43(0x1d6)],'toCode':_0x47bfa3['toDatasetCode'],'toTable':_0x47bfa3[_0x459f43(0x1be)],'toField':_0x47bfa3['toField'],'labelField':_0x47bfa3[_0x459f43(0x1c8)]||undefined})):[],'relatedPages':normalizeRelatedPages(_0x1b3b0a[_0x459f43(0x1cb)]),...Array[_0x459f43(0x1a3)](_0x1b3b0a[_0x459f43(0x1bf)])?{'columnCodeListWithDeleted':_0x1b3b0a[_0x459f43(0x1bf)]}:{},'formatRules':Array[_0x459f43(0x1a3)](_0x1b3b0a[_0x459f43(0x1c6)])?_0x1b3b0a[_0x459f43(0x1c6)]:[],'validateRules':Array[_0x459f43(0x1a3)](_0x1b3b0a['validateRules'])?_0x1b3b0a[_0x459f43(0x1da)]:[],..._0x168768!==undefined?{'extend':_0x168768}:{},'stats':{'fieldCount':_0x39b913[_0x459f43(0x1d7)],'operationCount':_0x4227f9['length']}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x387dfc,_0x5ddeff){const _0xb66a7e=a18_0x3c3c,_0x15ff9b=_0x387dfc();while(!![]){try{const _0x500e90=-parseInt(_0xb66a7e(0xf8))/0x1+-parseInt(_0xb66a7e(0xf2))/0x2*(-parseInt(_0xb66a7e(0xf3))/0x3)+parseInt(_0xb66a7e(0xf5))/0x4*(-parseInt(_0xb66a7e(0xf1))/0x5)+-parseInt(_0xb66a7e(0xfb))/0x6+-parseInt(_0xb66a7e(0xf6))/0x7+-parseInt(_0xb66a7e(0xf7))/0x8*(-parseInt(_0xb66a7e(0xf4))/0x9)+parseInt(_0xb66a7e(0xfa))/0xa*(parseInt(_0xb66a7e(0xf9))/0xb);if(_0x500e90===_0x5ddeff)break;else _0x15ff9b['push'](_0x15ff9b['shift']());}catch(_0x43e3ca){_0x15ff9b['push'](_0x15ff9b['shift']());}}}(a18_0x56d3,0x57402));import{datasetList}from'../../commands/dataset/list.js';function a18_0x56d3(){const _0x54a2aa=['4dfTdFq','181737WAiKMh','35703YEfqSm','4LuHHeN','1275722JXhIgP','568GEQtyN','497241PrGMcC','1969JSUXvU','74540ORwpCV','2931858dhAewM','1057865iOnaMm'];a18_0x56d3=function(){return _0x54a2aa;};return a18_0x56d3();}function a18_0x3c3c(_0xf77a3f,_0x3b4f54){_0xf77a3f=_0xf77a3f-0xf1;const _0x56d3c2=a18_0x56d3();let _0x3c3c5b=_0x56d3c2[_0xf77a3f];return _0x3c3c5b;}import{datasetDetail}from'../../commands/dataset/detail.js';export const datasetDefinitions=[datasetList,datasetDetail];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a19_0x1606(){const _0x48d422=['string','code','31899qPgIOK','376670BgswuM','split','tableName','6CWowny','str','111960IKWqSA','pkField','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','220lTAOhP','length','882453jHQedn','dbtableConfig','appCode','66515XHChea','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','1388412yHBENA','name','map','374336ISoUmk','list','allFields','Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)','description'];a19_0x1606=function(){return _0x48d422;};return a19_0x1606();}const a19_0x5e2167=a19_0x2c00;function a19_0x2c00(_0x22a9b1,_0x393d2c){_0x22a9b1=_0x22a9b1-0x1b8;const _0x160638=a19_0x1606();let _0x2c000c=_0x160638[_0x22a9b1];return _0x2c000c;}(function(_0x54566d,_0x21132d){const _0x20c241=a19_0x2c00,_0x2ef465=_0x54566d();while(!![]){try{const _0x38131a=-parseInt(_0x20c241(0x1bc))/0x1+-parseInt(_0x20c241(0x1c1))/0x2+parseInt(_0x20c241(0x1c6))/0x3+-parseInt(_0x20c241(0x1c4))/0x4*(-parseInt(_0x20c241(0x1c9))/0x5)+parseInt(_0x20c241(0x1bf))/0x6*(-parseInt(_0x20c241(0x1bb))/0x7)+-parseInt(_0x20c241(0x1ce))/0x8+-parseInt(_0x20c241(0x1cb))/0x9;if(_0x38131a===_0x21132d)break;else _0x2ef465['push'](_0x2ef465['shift']());}catch(_0x59321c){_0x2ef465['push'](_0x2ef465['shift']());}}}(a19_0x1606,0x5e9dd));import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';export const datasetList={'service':'dataset','command':a19_0x5e2167(0x1cf),'description':a19_0x5e2167(0x1c3),'risk':'read','flags':[{'name':'name','type':a19_0x5e2167(0x1b9),'description':a19_0x5e2167(0x1d1)},{...CODE_FLAG,'required':![],'description':a19_0x5e2167(0x1ca)}],async 'execute'(_0x505885){const _0x4726c9=a19_0x5e2167,_0x185229=_0x505885[_0x4726c9(0x1c0)](_0x4726c9(0x1cc)),_0x19bca1=_0x505885[_0x4726c9(0x1c0)]('code'),_0x1bfbef=await listDatasets(_0x505885[_0x4726c9(0x1c8)],{..._0x185229&&{'name':_0x185229},..._0x19bca1&&{'code':_0x19bca1}});return{'ok':!![],'data':{'total':_0x1bfbef[_0x4726c9(0x1c5)],'datasets':_0x1bfbef[_0x4726c9(0x1cd)](_0x4e301e=>{const _0x366699=_0x4726c9,_0xc2440d=_0x4e301e[_0x366699(0x1c7)]??{};return{'id':_0x4e301e['id'],'code':_0x4e301e[_0x366699(0x1ba)],'name':_0x4e301e[_0x366699(0x1cc)],'source':_0x4e301e['source'],'description':_0x4e301e[_0x366699(0x1b8)],'table':_0xc2440d[_0x366699(0x1be)],'datasetKey':_0xc2440d['datasetKey'],'pk':_0xc2440d[_0x366699(0x1c2)],'fields':_0xc2440d['allFields']?_0xc2440d[_0x366699(0x1d0)][_0x366699(0x1bd)](',')[_0x366699(0x1cd)](_0x47f1bb=>_0x47f1bb['trim']()):[]};})}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x23199c=a20_0x48e0;(function(_0xd8364c,_0x280bcb){const _0xad2145=a20_0x48e0,_0x3e20f2=_0xd8364c();while(!![]){try{const _0x1e1d7a=-parseInt(_0xad2145(0x156))/0x1+parseInt(_0xad2145(0x160))/0x2*(parseInt(_0xad2145(0x165))/0x3)+-parseInt(_0xad2145(0x16d))/0x4*(-parseInt(_0xad2145(0x15e))/0x5)+-parseInt(_0xad2145(0x15f))/0x6*(-parseInt(_0xad2145(0x177))/0x7)+-parseInt(_0xad2145(0x150))/0x8*(parseInt(_0xad2145(0x167))/0x9)+parseInt(_0xad2145(0x18b))/0xa*(parseInt(_0xad2145(0x173))/0xb)+-parseInt(_0xad2145(0x163))/0xc*(parseInt(_0xad2145(0x14e))/0xd);if(_0x1e1d7a===_0x280bcb)break;else _0x3e20f2['push'](_0x3e20f2['shift']());}catch(_0x112a9c){_0x3e20f2['push'](_0x3e20f2['shift']());}}}(a20_0x5b02,0x6aec8));import a20_0x55ddb6 from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';function a20_0x5b02(){const _0x13cf3a=['empty','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','(default)','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','✓\x20Valid\x20JSON','platform','524589AXKjmu','green','2618056hFMeBL','\x20\x20Config\x20Files','\x20doctor','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','locale','608391ATIdUB','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','(missing)','red','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','defaultApp','(not\x20found)','verbose','5ItFRDe','234jvvaNM','1444oDTdDx','(default:\x20','padEnd','36vKXtnL','ClientAk','3048aolQWI','accessKey','18JyRRUe','yellow','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20(accessKey)','\x20\x20Session\x20check:\x20\x20\x20','status','1867076QMtlyh','arch','\x20\x20─','message','bold','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','57189vpbbJn','Global','gray','appCode','106904VEfhno','doctor','repeat','(no\x20file)','\x20\x20Auth','Project','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20runtimeDomain:\x20\x20\x20','(not\x20set)','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','format','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','riskLevel','log','\x20\x20Config\x20JSON','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','pageSize','(none)','env','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','50BObPBR','\x20\x20Merged\x20Config'];a20_0x5b02=function(){return _0x13cf3a;};return a20_0x5b02();}import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';async function execute(_0x157931){const _0x3b0566=a20_0x48e0,_0x49d48a=getCliVersion(),_0x4931ad=buildConfigFromFlags({});await initGlobalEnvironment(_0x4931ad),console[_0x3b0566(0x184)](),console[_0x3b0566(0x184)](a20_0x55ddb6['bold'](CLI_BIN_NAME+_0x3b0566(0x152))),console[_0x3b0566(0x184)](a20_0x55ddb6[_0x3b0566(0x175)]('─'[_0x3b0566(0x179)](0x32))),console[_0x3b0566(0x184)]('\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20'+_0x49d48a),console['log'](_0x3b0566(0x153)+process['version']),console[_0x3b0566(0x184)]('\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20'+process[_0x3b0566(0x14d)]+'\x20'+process[_0x3b0566(0x16e)]),console[_0x3b0566(0x184)](),console['log'](a20_0x55ddb6['bold'](_0x3b0566(0x151))),console[_0x3b0566(0x184)](a20_0x55ddb6[_0x3b0566(0x175)](_0x3b0566(0x16f)[_0x3b0566(0x179)](0x1e)));const _0x520e11=getGlobalConfigPath(),_0x52e3c1=getProjectConfigPath();console['log'](_0x3b0566(0x157)+(_0x520e11||a20_0x55ddb6[_0x3b0566(0x175)]('(not\x20found)'))),console[_0x3b0566(0x184)](_0x3b0566(0x17d)+(_0x52e3c1||a20_0x55ddb6[_0x3b0566(0x175)](_0x3b0566(0x15c)))),console[_0x3b0566(0x184)](),console[_0x3b0566(0x184)](a20_0x55ddb6[_0x3b0566(0x171)](_0x3b0566(0x185))),console[_0x3b0566(0x184)](a20_0x55ddb6['gray'](_0x3b0566(0x16f)[_0x3b0566(0x179)](0x1e)));const _0x10f77f=(_0x51043c,_0x540372)=>{const _0x370011=_0x3b0566;if(!_0x540372){console[_0x370011(0x184)]('\x20\x20'+_0x51043c[_0x370011(0x162)](0x11)+'\x20'+a20_0x55ddb6[_0x370011(0x175)](_0x370011(0x17a)));return;}const _0x4b5c0b=inspectCliConfigJsonFile(_0x540372);if(_0x4b5c0b['status']==='ok')console[_0x370011(0x184)]('\x20\x20'+_0x51043c['padEnd'](0x11)+'\x20'+a20_0x55ddb6['green'](_0x370011(0x191)));else{if(_0x4b5c0b[_0x370011(0x16c)]===_0x370011(0x18d))console[_0x370011(0x184)]('\x20\x20'+_0x51043c['padEnd'](0x11)+'\x20'+a20_0x55ddb6[_0x370011(0x168)]('⚠\x20Empty\x20(treated\x20as\x20{})'));else _0x4b5c0b[_0x370011(0x16c)]==='missing'?console[_0x370011(0x184)]('\x20\x20'+_0x51043c[_0x370011(0x162)](0x11)+'\x20'+a20_0x55ddb6[_0x370011(0x175)](_0x370011(0x158))):(console[_0x370011(0x184)]('\x20\x20'+_0x51043c[_0x370011(0x162)](0x11)+'\x20'+a20_0x55ddb6['red']('✗\x20Invalid\x20JSON')),console['log']('\x20\x20'+''[_0x370011(0x162)](0x11)+'\x20'+a20_0x55ddb6['red'](_0x4b5c0b[_0x370011(0x170)])));}};_0x10f77f(_0x3b0566(0x174),_0x520e11),_0x10f77f(_0x3b0566(0x17c),_0x52e3c1),console['log'](),console[_0x3b0566(0x184)](a20_0x55ddb6[_0x3b0566(0x171)](_0x3b0566(0x18c))),console[_0x3b0566(0x184)](a20_0x55ddb6['gray'](_0x3b0566(0x16f)[_0x3b0566(0x179)](0x1e))),console[_0x3b0566(0x184)](_0x3b0566(0x190)+(_0x4931ad[_0x3b0566(0x176)]||a20_0x55ddb6[_0x3b0566(0x159)](_0x3b0566(0x17f)))),console[_0x3b0566(0x184)](_0x3b0566(0x172)+_0x4931ad[_0x3b0566(0x189)]);const _0x50718c=isLegacyCompatConfigKey(_0x3b0566(0x155))?a20_0x55ddb6[_0x3b0566(0x175)](_0x4931ad[_0x3b0566(0x155)]+'\x20(legacy/compat\x20only)'):_0x4931ad[_0x3b0566(0x155)];return console[_0x3b0566(0x184)](_0x3b0566(0x180)+_0x50718c),console[_0x3b0566(0x184)](_0x3b0566(0x15a)+(_0x4931ad[_0x3b0566(0x15b)]||a20_0x55ddb6[_0x3b0566(0x175)]('(none)'))),console[_0x3b0566(0x184)](_0x3b0566(0x154)+(_0x4931ad['currentApp']||a20_0x55ddb6[_0x3b0566(0x175)]('(none)'))),console[_0x3b0566(0x184)](_0x3b0566(0x18a)+(_0x4931ad[_0x3b0566(0x181)]||a20_0x55ddb6[_0x3b0566(0x175)](_0x3b0566(0x161)+DEFAULT_CONFIG_VALUES['format']+')'))),console[_0x3b0566(0x184)]('\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x4931ad[_0x3b0566(0x187)]??a20_0x55ddb6[_0x3b0566(0x175)](_0x3b0566(0x18f)))),console['log'](_0x3b0566(0x18e)+_0x4931ad[_0x3b0566(0x183)]),console[_0x3b0566(0x184)]('\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x4931ad[_0x3b0566(0x15d)]),console[_0x3b0566(0x184)]('\x20\x20auth\x20(effective):\x20'+AUTH_MODE['ClientAk']),console[_0x3b0566(0x184)]('\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20'+(_0x4931ad['accessKey']?a20_0x55ddb6[_0x3b0566(0x14f)]('(set,\x20length='+_0x4931ad[_0x3b0566(0x166)]['length']+')'):a20_0x55ddb6[_0x3b0566(0x175)](_0x3b0566(0x188)))),console[_0x3b0566(0x184)](),console[_0x3b0566(0x184)](a20_0x55ddb6[_0x3b0566(0x171)]('\x20\x20API\x20Endpoints')),console['log'](a20_0x55ddb6['gray']('\x20\x20─'[_0x3b0566(0x179)](0x1e))),console['log'](_0x3b0566(0x182)+getApiDomain()),console['log'](_0x3b0566(0x186)+getUserDomain()),console[_0x3b0566(0x184)](_0x3b0566(0x17e)+getRuntimeDomain()),console[_0x3b0566(0x184)](),console[_0x3b0566(0x184)](a20_0x55ddb6['bold'](_0x3b0566(0x17b))),console[_0x3b0566(0x184)](a20_0x55ddb6[_0x3b0566(0x175)]('\x20\x20─'[_0x3b0566(0x179)](0x1e))),console[_0x3b0566(0x184)](_0x3b0566(0x169)+a20_0x55ddb6[_0x3b0566(0x14f)](AUTH_MODE[_0x3b0566(0x164)]+_0x3b0566(0x16a))),console[_0x3b0566(0x184)](_0x3b0566(0x16b)+a20_0x55ddb6[_0x3b0566(0x175)]('(removed\x20—\x20cookie\x20auth\x20disabled)')),console[_0x3b0566(0x184)](),{'ok':!![]};}function a20_0x48e0(_0x272a95,_0x9db4ad){_0x272a95=_0x272a95-0x14d;const _0x5b02bb=a20_0x5b02();let _0x48e011=_0x5b02bb[_0x272a95];return _0x48e011;}export const doctorDefinition={'service':a20_0x23199c(0x178),'command':'check','description':'Diagnose\x20CLI\x20configuration\x20and\x20environment','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a21_0x21e75d=a21_0x6b03;(function(_0x4bddda,_0x3f064c){const _0x2757fc=a21_0x6b03,_0x22aa27=_0x4bddda();while(!![]){try{const _0xc0f796=parseInt(_0x2757fc(0x163))/0x1*(-parseInt(_0x2757fc(0x192))/0x2)+-parseInt(_0x2757fc(0x164))/0x3+parseInt(_0x2757fc(0x19b))/0x4*(-parseInt(_0x2757fc(0x179))/0x5)+-parseInt(_0x2757fc(0x182))/0x6+parseInt(_0x2757fc(0x171))/0x7+parseInt(_0x2757fc(0x16b))/0x8*(-parseInt(_0x2757fc(0x168))/0x9)+-parseInt(_0x2757fc(0x195))/0xa*(-parseInt(_0x2757fc(0x19d))/0xb);if(_0xc0f796===_0x3f064c)break;else _0x22aa27['push'](_0x22aa27['shift']());}catch(_0x503f96){_0x22aa27['push'](_0x22aa27['shift']());}}}(a21_0x214b,0xebdde));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';function a21_0x214b(){const _0x3c0591=['\x20\x20appcode:\x20','Imported\x20from\x20','7885591wuWJNO','message','utf8','Usage:\x20','):\x20','log','AbortPrompt','yes','74850HNxRTo','app','\x22.\x20Allowed:\x20','apiDir','newConfigFileName','trim','cwd','riskLevel','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','10726968vAiENB','App\x20code','\x20\x20env:\x20\x20\x20\x20\x20','Initialized\x20','Failed\x20to\x20parse\x20source\x20file:\x20','cancelled','validation','toLowerCase','project','boolean','removeListener','entries','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','string','SIGINT','Override\x20imported\x20default\x20env','1556jLbuJN','appcode','question','55936840ppooBt','env','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','File\x20','\x20already\x20exists.\x20Overwrite?','includes','260VAMrig','Target\x20environment\x20(default\x20','11pVadaB','parse','object','stdout','Aborted.','name','join','Invalid\x20env\x20\x22','race','1377dLRcmg','1675968GbUEpP','global','close','Skip\x20confirmation\x20when\x20overwriting','153bvQoRZ','file','\x0aInitialized\x20','641528gAVLxS','[y/N]','Override\x20imported\x20default\x20appcode','apps'];a21_0x214b=function(){return _0x3c0591;};return a21_0x214b();}import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a21_0x21e75d(0x193),'type':a21_0x21e75d(0x18f),'description':'App\x20code\x20for\x20the\x20project'},{'name':'env','type':a21_0x21e75d(0x18f),'description':a21_0x21e75d(0x19c)+DEFAULT_CONFIG_VALUES[a21_0x21e75d(0x196)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':'boolean','description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a21_0x21e75d(0x17d)]+')\x20instead\x20of\x20project','default':![]},{'name':a21_0x21e75d(0x178),'type':a21_0x21e75d(0x18b),'description':a21_0x21e75d(0x167),'default':![]}];export const initImportFlagDefs=[{'name':'file','type':'string','description':a21_0x21e75d(0x197),'required':!![]},{'name':'appcode','type':a21_0x21e75d(0x18f),'description':a21_0x21e75d(0x16d)},{'name':a21_0x21e75d(0x196),'type':a21_0x21e75d(0x18f),'description':a21_0x21e75d(0x191),'enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x21e75d(0x165),'type':a21_0x21e75d(0x18b),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a21_0x21e75d(0x17d)]+')\x20instead\x20of\x20project','default':![]},{'name':a21_0x21e75d(0x178),'type':a21_0x21e75d(0x18b),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];function a21_0x6b03(_0x422740,_0xd7488e){_0x422740=_0x422740-0x15d;const _0x214b40=a21_0x214b();let _0x6b0334=_0x214b40[_0x422740];return _0x6b0334;}export async function runInit(_0x1644ed){const _0x5aa8ce=a21_0x21e75d,_0x2430eb=isNonInteractiveMode(_0x1644ed),_0x132f3e=_0x1644ed['global']?'global':_0x5aa8ce(0x18a),_0x221e0e=resolveWriteConfigPath(_0x132f3e);try{_0x2430eb?await runNonInteractive(_0x1644ed,_0x221e0e):await runInteractive(_0x1644ed,_0x221e0e);}catch(_0x19340b){if(_0x19340b instanceof AbortPrompt)throw CliErrors[_0x5aa8ce(0x187)]();throw _0x19340b;}}export async function runInitImport(_0x1b8de0){const _0x23220b=a21_0x21e75d,_0x2453c5=_0x1b8de0[_0x23220b(0x165)]?_0x23220b(0x165):_0x23220b(0x18a),_0x2b7101=resolveWriteConfigPath(_0x2453c5);await runFromImport(_0x1b8de0,_0x2b7101);}const RUNTIME_IRRELEVANT_KEYS=new Set([a21_0x21e75d(0x17c)]);async function runFromImport(_0x3f44f9,_0x5d9587){const _0x18dce2=a21_0x21e75d,_0x141b23=resolveFilePath(_0x3f44f9[_0x18dce2(0x169)]);if(!existsSync(_0x141b23))throw CliErrors['validation']('Source\x20file\x20not\x20found:\x20'+_0x141b23);const _0x204c04=readSourceFile(_0x141b23),_0x3380f0=convertToRuntimeConfig(_0x204c04);_0x3f44f9[_0x18dce2(0x193)]&&(_0x3380f0['appcode']=String(_0x3f44f9['appcode']));_0x3f44f9[_0x18dce2(0x196)]&&(_0x3380f0[_0x18dce2(0x196)]=resolveInitEnv(_0x3f44f9));if(!_0x3380f0[_0x18dce2(0x193)])throw CliErrors[_0x18dce2(0x188)]('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.');await writeInitConfig(_0x5d9587,_0x3380f0,_0x3f44f9),console[_0x18dce2(0x176)](_0x18dce2(0x170)+_0x141b23),console[_0x18dce2(0x176)]('\x20\x20config:\x20\x20'+_0x5d9587),console[_0x18dce2(0x176)](_0x18dce2(0x16f)+_0x3380f0[_0x18dce2(0x193)]);if(_0x3380f0['defaultApp'])console[_0x18dce2(0x176)]('\x20\x20default:\x20'+_0x3380f0['defaultApp']);}function convertToRuntimeConfig(_0x33698b){const _0x539b3b=a21_0x21e75d;if(_0x33698b[_0x539b3b(0x16e)]&&typeof _0x33698b['apps']===_0x539b3b(0x19f))throw CliErrors[_0x539b3b(0x188)]('Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.',_0x539b3b(0x18e));const _0x1e7dcc={};for(const _0x1a5eef of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x33698b[_0x1a5eef]!==undefined&&(_0x1e7dcc[_0x1a5eef]=_0x33698b[_0x1a5eef]);}return!_0x1e7dcc[_0x539b3b(0x180)]&&(_0x1e7dcc['riskLevel']=DEFAULT_CONFIG_VALUES[_0x539b3b(0x180)]),_0x1e7dcc;}async function runNonInteractive(_0x4c8c89,_0x40bb4a){const _0x53f03d=a21_0x21e75d,_0x3d1e70=_0x4c8c89['appcode'];if(!_0x3d1e70)throw CliErrors['flagMissing']('appcode',_0x53f03d(0x174)+CLI_BIN_NAME+_0x53f03d(0x181));const _0x580c19=resolveInitEnv(_0x4c8c89);await writeInitConfig(_0x40bb4a,{'appcode':_0x3d1e70,'env':_0x580c19},_0x4c8c89),console[_0x53f03d(0x176)](_0x53f03d(0x185)+_0x40bb4a),console[_0x53f03d(0x176)](_0x53f03d(0x16f)+_0x3d1e70),console[_0x53f03d(0x176)](_0x53f03d(0x184)+_0x580c19);}async function runInteractive(_0x44529f,_0x35bc8a){const _0x476f42=a21_0x21e75d,_0x559988=loadExisting(_0x35bc8a),_0x4b6016=typeof _0x559988?.[_0x476f42(0x193)]==='string'?_0x559988[_0x476f42(0x193)]:'',_0xea1fe2=resolveInitEnv(_0x44529f);console['log'](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG[_0x476f42(0x17d)]+'\x0a');if(existsSync(_0x35bc8a)&&!_0x44529f[_0x476f42(0x178)]){const _0x4dffad=await promptYesNo(_0x476f42(0x198)+_0x35bc8a+_0x476f42(0x199),![]);if(!_0x4dffad){console[_0x476f42(0x176)](_0x476f42(0x15e));return;}}const _0x5570be=typeof _0x44529f[_0x476f42(0x193)]===_0x476f42(0x18f)?_0x44529f[_0x476f42(0x193)][_0x476f42(0x17e)]():'';let _0x5f4e17=_0x5570be;!_0x5f4e17&&(_0x5f4e17=await promptInput(_0x476f42(0x183),_0x4b6016));if(!_0x5f4e17[_0x476f42(0x17e)]())throw CliErrors[_0x476f42(0x188)]('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x35bc8a,{'appcode':_0x5f4e17[_0x476f42(0x17e)](),'env':_0xea1fe2},_0x44529f),console[_0x476f42(0x176)](_0x476f42(0x16a)+_0x35bc8a),console[_0x476f42(0x176)](_0x476f42(0x16f)+_0x5f4e17[_0x476f42(0x17e)]()),console['log']('\x20\x20env:\x20\x20\x20\x20\x20'+_0xea1fe2);}async function writeInitConfig(_0x15cbcf,_0x58f83c,_0x127b61){const _0x10db4d=a21_0x21e75d;let _0x26c350={};existsSync(_0x15cbcf)&&!_0x127b61[_0x10db4d(0x178)]&&(_0x26c350=readConfigFile(_0x15cbcf));for(const [_0x4cdfdb,_0x709c1a]of Object[_0x10db4d(0x18d)](_0x58f83c)){_0x709c1a!==undefined&&(_0x26c350[_0x4cdfdb]=_0x709c1a);}if(_0x26c350[_0x10db4d(0x17a)])delete _0x26c350[_0x10db4d(0x17a)];writeConfigFile(_0x15cbcf,_0x26c350);}class AbortPrompt extends Error{constructor(){const _0x35780b=a21_0x21e75d;super('User\x20aborted\x20prompt'),this[_0x35780b(0x15f)]=_0x35780b(0x177);}}function createSafeRl(){const _0x5c9778=a21_0x21e75d,_0x254d15=createInterface({'input':process['stdin'],'output':process[_0x5c9778(0x15d)]});let _0xaef36;const _0x3cc2e0=new Promise((_0x22afb2,_0x27f370)=>{const _0xbab511=_0x5c9778;_0xaef36=()=>{const _0x29d836=a21_0x6b03;_0xaef36&&(_0x254d15['removeListener'](_0x29d836(0x190),_0xaef36),_0xaef36=undefined);try{_0x254d15[_0x29d836(0x166)]();}catch{}_0x27f370(new AbortPrompt());},_0x254d15['once'](_0xbab511(0x190),_0xaef36);}),_0x24aa49=()=>{const _0x2870fb=_0x5c9778;_0xaef36&&(_0x254d15[_0x2870fb(0x18c)](_0x2870fb(0x190),_0xaef36),_0xaef36=undefined);try{_0x254d15[_0x2870fb(0x166)]();}catch{}};return{'rl':_0x254d15,'abortPromise':_0x3cc2e0,'disposeSuccess':_0x24aa49};}async function promptInput(_0x3728fe,_0x47fad9){const _0x227912=a21_0x21e75d,{rl:_0xd37fc8,abortPromise:_0x45a4f5,disposeSuccess:_0x17fb70}=createSafeRl(),_0x1c9ee3=new Promise(_0xec5b01=>{const _0x58869f=a21_0x6b03,_0x589ac3=_0x47fad9?'\x20\x20'+_0x3728fe+'\x20('+_0x47fad9+_0x58869f(0x175):'\x20\x20'+_0x3728fe+':\x20';_0xd37fc8['question'](_0x589ac3,_0x525f4c=>{const _0x117022=_0x58869f;_0x17fb70(),_0xec5b01(_0x525f4c[_0x117022(0x17e)]()||_0x47fad9);});});return Promise[_0x227912(0x162)]([_0x1c9ee3,_0x45a4f5]);}async function promptYesNo(_0x28ec34,_0xaf191f){const _0x4e33ba=a21_0x21e75d,{rl:_0x138b24,abortPromise:_0x1888b6,disposeSuccess:_0x4ac7fc}=createSafeRl(),_0x33a016=new Promise(_0x54c135=>{const _0x103cd2=a21_0x6b03,_0x14fdf2=_0xaf191f?'[Y/n]':_0x103cd2(0x16c);_0x138b24[_0x103cd2(0x194)]('\x20\x20'+_0x28ec34+'\x20'+_0x14fdf2+':\x20',_0x374ee4=>{const _0x4353b1=_0x103cd2;_0x4ac7fc();const _0x55b9e7=_0x374ee4[_0x4353b1(0x17e)]()[_0x4353b1(0x189)]();if(_0x55b9e7==='y'||_0x55b9e7==='yes')_0x54c135(!![]);else{if(_0x55b9e7==='n'||_0x55b9e7==='no')_0x54c135(![]);else _0x54c135(_0xaf191f);}});});return Promise[_0x4e33ba(0x162)]([_0x33a016,_0x1888b6]);}function loadExisting(_0x3f3363){if(!existsSync(_0x3f3363))return null;return readConfigFile(_0x3f3363);}function resolveFilePath(_0x229914){const _0x721f5e=a21_0x21e75d;return isAbsolute(_0x229914)?_0x229914:resolve(process[_0x721f5e(0x17f)](),_0x229914);}function readSourceFile(_0x2547cb){const _0x552aa4=a21_0x21e75d;try{const _0x67308=readFileSync(_0x2547cb,{'encoding':_0x552aa4(0x173)});return JSON[_0x552aa4(0x19e)](_0x67308);}catch(_0x4fdba9){throw CliErrors[_0x552aa4(0x188)](_0x552aa4(0x186)+_0x4fdba9[_0x552aa4(0x172)]);}}function resolveInitEnv(_0xcdaaee){const _0xa4a54c=a21_0x21e75d,_0x19c034=_0xcdaaee['env'];if(_0x19c034===undefined||_0x19c034==='')return DEFAULT_CONFIG_VALUES[_0xa4a54c(0x196)];if(!RUNTIME_ENV_VALUES[_0xa4a54c(0x19a)](_0x19c034))throw CliErrors[_0xa4a54c(0x188)](_0xa4a54c(0x161)+_0x19c034+_0xa4a54c(0x17b)+RUNTIME_ENV_VALUES[_0xa4a54c(0x160)](',\x20'));return _0x19c034;}
|
|
1
|
+
const a21_0x1c812f=a21_0x41db;(function(_0x418028,_0x1dfcf0){const _0xc04075=a21_0x41db,_0x57dd02=_0x418028();while(!![]){try{const _0x15cf98=parseInt(_0xc04075(0x148))/0x1*(-parseInt(_0xc04075(0x145))/0x2)+parseInt(_0xc04075(0x14c))/0x3+parseInt(_0xc04075(0x120))/0x4*(-parseInt(_0xc04075(0x119))/0x5)+parseInt(_0xc04075(0x152))/0x6+parseInt(_0xc04075(0x13e))/0x7+-parseInt(_0xc04075(0x127))/0x8+-parseInt(_0xc04075(0x143))/0x9;if(_0x15cf98===_0x1dfcf0)break;else _0x57dd02['push'](_0x57dd02['shift']());}catch(_0x49bfff){_0x57dd02['push'](_0x57dd02['shift']());}}}(a21_0x4ef8,0xdb694));function a21_0x41db(_0x24cbcc,_0x12f2fd){_0x24cbcc=_0x24cbcc-0x118;const _0x4ef8aa=a21_0x4ef8();let _0x41db0a=_0x4ef8aa[_0x24cbcc];return _0x41db0a;}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':'appcode','type':a21_0x1c812f(0x158),'description':a21_0x1c812f(0x12c)},{'name':a21_0x1c812f(0x139),'type':a21_0x1c812f(0x158),'description':a21_0x1c812f(0x12e)+DEFAULT_CONFIG_VALUES[a21_0x1c812f(0x139)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x1c812f(0x136),'type':'boolean','description':a21_0x1c812f(0x128)+PRODUCT_CONFIG['newConfigFileName']+a21_0x1c812f(0x14b),'default':![]},{'name':a21_0x1c812f(0x14e),'type':a21_0x1c812f(0x138),'description':a21_0x1c812f(0x11f),'default':![]}];export const initImportFlagDefs=[{'name':'file','type':a21_0x1c812f(0x158),'description':a21_0x1c812f(0x150),'required':!![]},{'name':a21_0x1c812f(0x13f),'type':a21_0x1c812f(0x158),'description':'Override\x20imported\x20default\x20appcode'},{'name':a21_0x1c812f(0x139),'type':'string','description':a21_0x1c812f(0x157),'enum':[...RUNTIME_ENV_VALUES]},{'name':a21_0x1c812f(0x136),'type':a21_0x1c812f(0x138),'description':a21_0x1c812f(0x128)+PRODUCT_CONFIG['newConfigFileName']+a21_0x1c812f(0x14b),'default':![]},{'name':'yes','type':a21_0x1c812f(0x138),'description':a21_0x1c812f(0x11f),'default':![]}];export async function runInit(_0x512712){const _0x4868b0=a21_0x1c812f,_0x33efb6=isNonInteractiveMode(_0x512712),_0x31d9dc=_0x512712[_0x4868b0(0x136)]?'global':'project',_0xf0f9b=resolveWriteConfigPath(_0x31d9dc);try{_0x33efb6?await runNonInteractive(_0x512712,_0xf0f9b):await runInteractive(_0x512712,_0xf0f9b);}catch(_0x1a96fa){if(_0x1a96fa instanceof AbortPrompt)throw CliErrors[_0x4868b0(0x144)]();throw _0x1a96fa;}}export async function runInitImport(_0x55f18e){const _0x58dac7=a21_0x1c812f,_0x4572d7=_0x55f18e[_0x58dac7(0x136)]?_0x58dac7(0x136):_0x58dac7(0x13a),_0x5f1fce=resolveWriteConfigPath(_0x4572d7);await runFromImport(_0x55f18e,_0x5f1fce);}const RUNTIME_IRRELEVANT_KEYS=new Set(['apiDir']);function a21_0x4ef8(){const _0x5c8295=['Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','):\x20','App\x20code\x20for\x20the\x20project','\x20\x20appcode:\x20','Target\x20environment\x20(default\x20','utf8','close','Imported\x20from\x20','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','[y/N]','stdin','AbortPrompt','global','cwd','boolean','env','project','app','trim','validation','7191961NbZYhe','appcode','message','\x20\x20env:\x20\x20\x20\x20\x20','User\x20aborted\x20prompt','3690522KaODoX','cancelled','324976YskLco','stdout','flagMissing','6dnroKr','toLowerCase','Aborted.',')\x20instead\x20of\x20project','2042856hcIVAX','\x20\x20default:\x20','yes','\x20already\x20exists.\x20Overwrite?','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','file','9971646ERyxJG','\x20\x20config:\x20\x20','\x20init\x20—\x20Create\x20','join','File\x20','Override\x20imported\x20default\x20env','string','App\x20code\x20cannot\x20be\x20empty.','newConfigFileName','SIGINT','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`.','5QbUGOX','\x22.\x20Allowed:\x20','riskLevel','parse','removeListener','defaultApp','Skip\x20confirmation\x20when\x20overwriting','41696bEUWUg','question','log','race','\x0aInitialized\x20','App\x20code','Usage:\x20','8609584RcfSqe','Write\x20to\x20global\x20(~/','apps'];a21_0x4ef8=function(){return _0x5c8295;};return a21_0x4ef8();}async function runFromImport(_0x353eaf,_0x51b478){const _0x37614f=a21_0x1c812f,_0xccc087=resolveFilePath(_0x353eaf[_0x37614f(0x151)]);if(!existsSync(_0xccc087))throw CliErrors['validation']('Source\x20file\x20not\x20found:\x20'+_0xccc087);const _0x3cc2fe=readSourceFile(_0xccc087),_0x2c3e02=convertToRuntimeConfig(_0x3cc2fe);_0x353eaf[_0x37614f(0x13f)]&&(_0x2c3e02[_0x37614f(0x13f)]=String(_0x353eaf[_0x37614f(0x13f)]));_0x353eaf[_0x37614f(0x139)]&&(_0x2c3e02[_0x37614f(0x139)]=resolveInitEnv(_0x353eaf));if(!_0x2c3e02[_0x37614f(0x13f)])throw CliErrors['validation']('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.',_0x37614f(0x118));await writeInitConfig(_0x51b478,_0x2c3e02,_0x353eaf),console['log'](_0x37614f(0x131)+_0xccc087),console['log'](_0x37614f(0x153)+_0x51b478),console[_0x37614f(0x122)](_0x37614f(0x12d)+_0x2c3e02['appcode']);if(_0x2c3e02['defaultApp'])console[_0x37614f(0x122)](_0x37614f(0x14d)+_0x2c3e02[_0x37614f(0x11e)]);}function convertToRuntimeConfig(_0x4dde0d){const _0x5a2178=a21_0x1c812f;if(_0x4dde0d['apps']&&typeof _0x4dde0d[_0x5a2178(0x129)]==='object')throw CliErrors['validation'](_0x5a2178(0x12a),_0x5a2178(0x132));const _0x4af926={};for(const _0x37d870 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x4dde0d[_0x37d870]!==undefined&&(_0x4af926[_0x37d870]=_0x4dde0d[_0x37d870]);}return!_0x4af926[_0x5a2178(0x11b)]&&(_0x4af926[_0x5a2178(0x11b)]=DEFAULT_CONFIG_VALUES[_0x5a2178(0x11b)]),_0x4af926;}async function runNonInteractive(_0x21515f,_0x8ca324){const _0x2127be=a21_0x1c812f,_0x18be11=_0x21515f[_0x2127be(0x13f)];if(!_0x18be11)throw CliErrors[_0x2127be(0x147)](_0x2127be(0x13f),_0x2127be(0x126)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x3f3f5f=resolveInitEnv(_0x21515f);await writeInitConfig(_0x8ca324,{'appcode':_0x18be11,'env':_0x3f3f5f},_0x21515f),console[_0x2127be(0x122)]('Initialized\x20'+_0x8ca324),console[_0x2127be(0x122)](_0x2127be(0x12d)+_0x18be11),console[_0x2127be(0x122)](_0x2127be(0x141)+_0x3f3f5f);}async function runInteractive(_0x4ff2cd,_0x19a954){const _0x51ee44=a21_0x1c812f,_0x2c0f0f=loadExisting(_0x19a954),_0x59b7af=typeof _0x2c0f0f?.[_0x51ee44(0x13f)]===_0x51ee44(0x158)?_0x2c0f0f[_0x51ee44(0x13f)]:'',_0x448bb7=resolveInitEnv(_0x4ff2cd);console[_0x51ee44(0x122)](CLI_BIN_NAME+_0x51ee44(0x154)+PRODUCT_CONFIG[_0x51ee44(0x15a)]+'\x0a');if(existsSync(_0x19a954)&&!_0x4ff2cd[_0x51ee44(0x14e)]){const _0x25d06d=await promptYesNo(_0x51ee44(0x156)+_0x19a954+_0x51ee44(0x14f),![]);if(!_0x25d06d){console['log'](_0x51ee44(0x14a));return;}}const _0xea2efe=typeof _0x4ff2cd[_0x51ee44(0x13f)]==='string'?_0x4ff2cd[_0x51ee44(0x13f)][_0x51ee44(0x13c)]():'';let _0x22ad47=_0xea2efe;!_0x22ad47&&(_0x22ad47=await promptInput(_0x51ee44(0x125),_0x59b7af));if(!_0x22ad47[_0x51ee44(0x13c)]())throw CliErrors[_0x51ee44(0x13d)](_0x51ee44(0x159));await writeInitConfig(_0x19a954,{'appcode':_0x22ad47['trim'](),'env':_0x448bb7},_0x4ff2cd),console['log'](_0x51ee44(0x124)+_0x19a954),console['log'](_0x51ee44(0x12d)+_0x22ad47[_0x51ee44(0x13c)]()),console[_0x51ee44(0x122)](_0x51ee44(0x141)+_0x448bb7);}async function writeInitConfig(_0x24d352,_0x1ab374,_0x318364){const _0x4b1e8c=a21_0x1c812f;let _0x48d8d9={};existsSync(_0x24d352)&&!_0x318364[_0x4b1e8c(0x14e)]&&(_0x48d8d9=readConfigFile(_0x24d352));for(const [_0x3bfbbc,_0x1aabae]of Object['entries'](_0x1ab374)){_0x1aabae!==undefined&&(_0x48d8d9[_0x3bfbbc]=_0x1aabae);}if(_0x48d8d9[_0x4b1e8c(0x13b)])delete _0x48d8d9[_0x4b1e8c(0x13b)];writeConfigFile(_0x24d352,_0x48d8d9);}class AbortPrompt extends Error{constructor(){const _0x48c0bf=a21_0x1c812f;super(_0x48c0bf(0x142)),this['name']=_0x48c0bf(0x135);}}function createSafeRl(){const _0x6a8b19=a21_0x1c812f,_0x5f47c7=createInterface({'input':process[_0x6a8b19(0x134)],'output':process[_0x6a8b19(0x146)]});let _0x57d8fa;const _0x2cbc88=new Promise((_0x227c77,_0x4fa4b2)=>{_0x57d8fa=()=>{const _0x341a48=a21_0x41db;_0x57d8fa&&(_0x5f47c7[_0x341a48(0x11d)](_0x341a48(0x15b),_0x57d8fa),_0x57d8fa=undefined);try{_0x5f47c7[_0x341a48(0x130)]();}catch{}_0x4fa4b2(new AbortPrompt());},_0x5f47c7['once']('SIGINT',_0x57d8fa);}),_0x1f3d04=()=>{const _0x31de8c=_0x6a8b19;_0x57d8fa&&(_0x5f47c7[_0x31de8c(0x11d)]('SIGINT',_0x57d8fa),_0x57d8fa=undefined);try{_0x5f47c7['close']();}catch{}};return{'rl':_0x5f47c7,'abortPromise':_0x2cbc88,'disposeSuccess':_0x1f3d04};}async function promptInput(_0x2a6209,_0x2795f8){const {rl:_0x205d8f,abortPromise:_0x441ac2,disposeSuccess:_0x52f781}=createSafeRl(),_0x11fe55=new Promise(_0x31df73=>{const _0x27c65c=a21_0x41db,_0xe18cb4=_0x2795f8?'\x20\x20'+_0x2a6209+'\x20('+_0x2795f8+_0x27c65c(0x12b):'\x20\x20'+_0x2a6209+':\x20';_0x205d8f[_0x27c65c(0x121)](_0xe18cb4,_0x2c932f=>{_0x52f781(),_0x31df73(_0x2c932f['trim']()||_0x2795f8);});});return Promise['race']([_0x11fe55,_0x441ac2]);}async function promptYesNo(_0x42e0d9,_0xfdedcb){const _0x66717a=a21_0x1c812f,{rl:_0xee53f8,abortPromise:_0x190257,disposeSuccess:_0x3aa097}=createSafeRl(),_0x2c1270=new Promise(_0xd1ad31=>{const _0x4b8290=a21_0x41db,_0x732def=_0xfdedcb?'[Y/n]':_0x4b8290(0x133);_0xee53f8[_0x4b8290(0x121)]('\x20\x20'+_0x42e0d9+'\x20'+_0x732def+':\x20',_0x1a5d9f=>{const _0x49930b=_0x4b8290;_0x3aa097();const _0x49af29=_0x1a5d9f['trim']()[_0x49930b(0x149)]();if(_0x49af29==='y'||_0x49af29===_0x49930b(0x14e))_0xd1ad31(!![]);else{if(_0x49af29==='n'||_0x49af29==='no')_0xd1ad31(![]);else _0xd1ad31(_0xfdedcb);}});});return Promise[_0x66717a(0x123)]([_0x2c1270,_0x190257]);}function loadExisting(_0x54d58d){if(!existsSync(_0x54d58d))return null;return readConfigFile(_0x54d58d);}function resolveFilePath(_0x1ef148){const _0x5dfa1e=a21_0x1c812f;return isAbsolute(_0x1ef148)?_0x1ef148:resolve(process[_0x5dfa1e(0x137)](),_0x1ef148);}function readSourceFile(_0x3bd245){const _0x4aace1=a21_0x1c812f;try{const _0x3ec939=readFileSync(_0x3bd245,{'encoding':_0x4aace1(0x12f)});return JSON[_0x4aace1(0x11c)](_0x3ec939);}catch(_0x41552f){throw CliErrors[_0x4aace1(0x13d)]('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x41552f[_0x4aace1(0x140)]);}}function resolveInitEnv(_0x1cf997){const _0x2f6d57=a21_0x1c812f,_0x57e99c=_0x1cf997[_0x2f6d57(0x139)];if(_0x57e99c===undefined||_0x57e99c==='')return DEFAULT_CONFIG_VALUES[_0x2f6d57(0x139)];if(!RUNTIME_ENV_VALUES['includes'](_0x57e99c))throw CliErrors[_0x2f6d57(0x13d)]('Invalid\x20env\x20\x22'+_0x57e99c+_0x2f6d57(0x11a)+RUNTIME_ENV_VALUES[_0x2f6d57(0x155)](',\x20'));return _0x57e99c;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a22_0x56a8a7=a22_0xf8b3;(function(_0x2342dc,_0x30f817){const _0x3bf6c5=a22_0xf8b3,_0x1e9223=_0x2342dc();while(!![]){try{const _0x5c0bc8=-parseInt(_0x3bf6c5(0xf4))/0x1+-parseInt(_0x3bf6c5(0xea))/0x2+-parseInt(_0x3bf6c5(0xec))/0x3+-parseInt(_0x3bf6c5(0xff))/0x4*(-parseInt(_0x3bf6c5(0xfb))/0x5)+-parseInt(_0x3bf6c5(0x114))/0x6*(parseInt(_0x3bf6c5(0x10a))/0x7)+-parseInt(_0x3bf6c5(0xe7))/0x8+-parseInt(_0x3bf6c5(0x110))/0x9*(-parseInt(_0x3bf6c5(0xf5))/0xa);if(_0x5c0bc8===_0x30f817)break;else _0x1e9223['push'](_0x1e9223['shift']());}catch(_0x4f2040){_0x1e9223['push'](_0x1e9223['shift']());}}}(a22_0xc25c,0x900e9));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a22_0x56a8a7(0xe5),'type':'string','required':!![],'description':'Personal\x20knowledge-base\x20entry\x20title'},FILE_FLAG={'name':'file','type':a22_0x56a8a7(0x10d),'required':!![],'description':a22_0x56a8a7(0xf1)},QUERY_FLAG={'name':a22_0x56a8a7(0x10f),'type':'string','required':!![],'description':a22_0x56a8a7(0xf7)},TOPK_FLAG={'name':a22_0x56a8a7(0x11b),'type':a22_0x56a8a7(0x10e),'description':a22_0x56a8a7(0xfe)};function readKnowledgeFile(_0x45dfd4){const _0xe6f16f=a22_0x56a8a7;if(!_0x45dfd4)throw CliErrors['validation']('File\x20path\x20is\x20required.');if(!existsSync(_0x45dfd4))throw CliErrors[_0xe6f16f(0x118)](_0xe6f16f(0x10b)+_0x45dfd4);if(!statSync(_0x45dfd4)['isFile']())throw CliErrors[_0xe6f16f(0x118)](_0xe6f16f(0x11d)+_0x45dfd4);return readFileSync(_0x45dfd4,_0xe6f16f(0x108));}function summarizePersonalItem(_0x2d8aef){const _0x58db28=a22_0x56a8a7;return{'id':_0x2d8aef['id'],'title':_0x2d8aef[_0x58db28(0xe5)],'version':_0x2d8aef[_0x58db28(0xf8)],'ragStatus':_0x2d8aef[_0x58db28(0xfc)],'ragErrorMessage':_0x2d8aef[_0x58db28(0x11e)],'updateTime':_0x2d8aef[_0x58db28(0x113)]};}function detailPersonalItem(_0x4045b4){const _0x51b1a4=a22_0x56a8a7;return{'id':_0x4045b4['id'],'appCode':_0x4045b4[_0x51b1a4(0x104)],'scope':_0x4045b4[_0x51b1a4(0xf3)],'userId':_0x4045b4[_0x51b1a4(0x119)],'title':_0x4045b4['title'],'content':_0x4045b4['content']??'','version':_0x4045b4[_0x51b1a4(0xf8)],'ragStatus':_0x4045b4[_0x51b1a4(0xfc)],'ragErrorMessage':_0x4045b4[_0x51b1a4(0x11e)],'createTime':_0x4045b4[_0x51b1a4(0x112)],'updateTime':_0x4045b4[_0x51b1a4(0x113)]};}function summarizeSearchHit(_0xa1283){const _0xe094aa=a22_0x56a8a7;return{'scope':_0xa1283['scope'],'docId':_0xa1283[_0xe094aa(0x102)],'score':_0xa1283[_0xe094aa(0xe8)],'weightedScore':_0xa1283[_0xe094aa(0x116)],'content':_0xa1283['content'],'metadata':_0xa1283[_0xe094aa(0x100)]};}function a22_0xc25c(){const _0x5f390d=['detail','scope','1058712WMdswN','374860klGDMU','/update','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','version','length','write','10akUlNk','ragStatus','verbose','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','2248852BVsipG','metadata','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','docId','Override\x20the\x20existing\x20entry\x20title','appCode','read','Search\x20query\x20is\x20required.','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','utf8','description','336pGduaW','File\x20not\x20found:\x20','isFinite','string','number','query','585afjaXT','Updated\x20KB\x20entry\x20','createTime','updateTime','60156OdTSLT','--topk\x20must\x20be\x20a\x20positive\x20number.','weightedScore','search','validation','userId','/client/knowledge-base/personal/create','topk','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','File\x20is\x20not\x20a\x20regular\x20file:\x20','ragErrorMessage','file','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','str','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','title','body','2346528vryKDN','score','trim','2085870egiCVU','/client/knowledge-base/personal/','284244tRVrJG','build','num','POST','create','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file'];a22_0xc25c=function(){return _0x5f390d;};return a22_0xc25c();}function a22_0xf8b3(_0x3e01b2,_0x3e807c){_0x3e01b2=_0x3e01b2-0xe2;const _0xc25cdf=a22_0xc25c();let _0xf8b303=_0xc25cdf[_0x3e01b2];return _0xf8b303;}function readTopK(_0x4dd195){const _0x517490=a22_0x56a8a7,_0x3cae87=_0x4dd195['flag'](_0x517490(0x11b));if(_0x3cae87===undefined||_0x3cae87===null||_0x3cae87==='')return undefined;const _0xe870b0=_0x4dd195[_0x517490(0xee)](_0x517490(0x11b));if(!Number[_0x517490(0x10c)](_0xe870b0)||_0xe870b0<0x1)throw CliErrors[_0x517490(0x118)](_0x517490(0x115));return _0xe870b0;}const kbList={'service':'kb','command':'list','description':'List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','risk':a22_0x56a8a7(0x105),'flags':[VERBOSE_FLAG],async 'execute'(_0x2fb0da){const _0x3229b5=a22_0x56a8a7,_0x9a7835=await listPersonalKnowledgeBaseItems(_0x2fb0da[_0x3229b5(0x104)]);if(_0x2fb0da['bool'](_0x3229b5(0xfd)))return{'ok':!![],'data':{'total':_0x9a7835['length'],'items':_0x9a7835}};return{'ok':!![],'data':{'total':_0x9a7835['length'],'items':_0x9a7835['map'](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a22_0x56a8a7(0xf2),'description':a22_0x56a8a7(0x11c),'risk':a22_0x56a8a7(0x105),'flags':[{...ID_FLAG,'description':'Personal\x20knowledge-base\x20entry\x20ID'}],async 'execute'(_0x385e05){const _0x4bc067=a22_0x56a8a7,_0x856535=await getPersonalKnowledgeBaseItem(_0x385e05['num']('id'),_0x385e05[_0x4bc067(0x104)]);return{'ok':!![],'data':detailPersonalItem(_0x856535)};}},kbCreate={'service':'kb','command':a22_0x56a8a7(0xf0),'description':a22_0x56a8a7(0x107),'risk':a22_0x56a8a7(0xfa),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x4b323e){const _0x2a06be=a22_0x56a8a7,_0x1d3411=_0x4b323e[_0x2a06be(0xe3)](_0x2a06be(0xe5)),_0x50eb2e=readKnowledgeFile(_0x4b323e[_0x2a06be(0xe3)](_0x2a06be(0x11f))),_0x1f5221=await createPersonalKnowledgeBaseItem(_0x4b323e[_0x2a06be(0x104)],{'title':_0x1d3411,'content':_0x50eb2e});return{'ok':!![],'data':summarizePersonalItem(_0x1f5221),'message':'Created\x20KB\x20entry\x20'+_0x1f5221['id']+'\x20('+_0x1f5221[_0x2a06be(0xe5)]+')'};},async 'dryRun'(_0x15c19b){const _0x1df658=a22_0x56a8a7,_0x5b4c3e=_0x15c19b[_0x1df658(0xe3)](_0x1df658(0xe5)),_0x3469b6=readKnowledgeFile(_0x15c19b[_0x1df658(0xe3)](_0x1df658(0x11f)));return dryRun('POST',_0x1df658(0x11a))[_0x1df658(0xe6)]({'appCode':_0x15c19b[_0x1df658(0x104)],'title':_0x5b4c3e,'content':_0x3469b6})['description'](_0x1df658(0xe2)+_0x5b4c3e+'\x22')[_0x1df658(0xed)]();}},kbUpdate={'service':'kb','command':'update','description':a22_0x56a8a7(0xe4),'risk':a22_0x56a8a7(0xfa),'flags':[{...ID_FLAG,'description':'Personal\x20knowledge-base\x20entry\x20ID'},{...TITLE_FLAG,'required':![],'description':a22_0x56a8a7(0x103)},FILE_FLAG],async 'execute'(_0x5e0e6c){const _0x35c4e4=a22_0x56a8a7,_0x48e133=_0x5e0e6c[_0x35c4e4(0xee)]('id'),_0x82e284=readKnowledgeFile(_0x5e0e6c[_0x35c4e4(0xe3)](_0x35c4e4(0x11f))),_0x40faf5=_0x5e0e6c[_0x35c4e4(0xe3)]('title')||(await getPersonalKnowledgeBaseItem(_0x48e133,_0x5e0e6c[_0x35c4e4(0x104)]))[_0x35c4e4(0xe5)],_0x1fa572=await updatePersonalKnowledgeBaseItem(_0x48e133,_0x5e0e6c['appCode'],{'title':_0x40faf5,'content':_0x82e284});return{'ok':!![],'data':summarizePersonalItem(_0x1fa572),'message':_0x35c4e4(0x111)+_0x1fa572['id']+'\x20('+_0x1fa572[_0x35c4e4(0xe5)]+')'};},async 'dryRun'(_0x194301){const _0x21a0de=a22_0x56a8a7,_0x24e7c8=_0x194301[_0x21a0de(0xee)]('id'),_0x33a27e=readKnowledgeFile(_0x194301[_0x21a0de(0xe3)](_0x21a0de(0x11f))),_0x299942=_0x194301[_0x21a0de(0xe3)]('title')||(await getPersonalKnowledgeBaseItem(_0x24e7c8,_0x194301[_0x21a0de(0x104)]))[_0x21a0de(0xe5)];return dryRun(_0x21a0de(0xef),_0x21a0de(0xeb)+_0x24e7c8+_0x21a0de(0xf6))[_0x21a0de(0xe6)]({'appCode':_0x194301[_0x21a0de(0x104)],'title':_0x299942,'content':_0x33a27e})[_0x21a0de(0x109)](_0x21a0de(0x101)+_0x24e7c8)[_0x21a0de(0xed)]();}},kbSearch={'service':'kb','command':a22_0x56a8a7(0x117),'description':'Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','risk':'read','flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x1cdacd){const _0x3cc2ca=a22_0x56a8a7;if(!_0x1cdacd[_0x3cc2ca(0xe3)](_0x3cc2ca(0x10f))[_0x3cc2ca(0xe9)]())throw CliErrors[_0x3cc2ca(0x118)](_0x3cc2ca(0x106));readTopK(_0x1cdacd);},async 'execute'(_0xc07424){const _0x44f883=a22_0x56a8a7,_0x27b512=_0xc07424[_0x44f883(0xe3)](_0x44f883(0x10f))[_0x44f883(0xe9)](),_0x29a886=readTopK(_0xc07424),_0x735189=await searchKnowledgeBase(_0xc07424[_0x44f883(0x104)],{'query':_0x27b512,'topK':_0x29a886});return{'ok':!![],'data':{'total':_0x735189[_0x44f883(0xf9)],'hits':_0x735189['map'](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x392db7=a23_0x46eb;(function(_0x2c972c,_0x5e41ea){const _0x5839d3=a23_0x46eb,_0x2b9af2=_0x2c972c();while(!![]){try{const _0x498450=-parseInt(_0x5839d3(0x180))/0x1+-parseInt(_0x5839d3(0x17f))/0x2*(-parseInt(_0x5839d3(0x17c))/0x3)+-parseInt(_0x5839d3(0x183))/0x4+parseInt(_0x5839d3(0x185))/0x5*(parseInt(_0x5839d3(0x178))/0x6)+parseInt(_0x5839d3(0x190))/0x7+-parseInt(_0x5839d3(0x175))/0x8*(-parseInt(_0x5839d3(0x192))/0x9)+-parseInt(_0x5839d3(0x18c))/0xa*(parseInt(_0x5839d3(0x17e))/0xb);if(_0x498450===_0x5e41ea)break;else _0x2b9af2['push'](_0x2b9af2['shift']());}catch(_0x147b15){_0x2b9af2['push'](_0x2b9af2['shift']());}}}(a23_0x39f8,0x53b42));function a23_0x39f8(){const _0x4a3e3e=['33wlEGAn','46lNQJTF','359242hMDUnu','show','details','366912tRXjRx','\x20\x20\x20Time:\x20','15FrGSHI','en-US','forEach','warn','length','\x20\x20\x20Details:\x20','readLogs','921110pIATuA','level','clearLogs','command','576562WmFsJl','*\x20No\x20logs\x20found','418023cEvZxW','log','keys','logs','toLocaleString','\x20logs:\x0a','*\x20Logs\x20cleared','40oLIpEr','read','\x20\x20\x20Duration:\x20','251946uOzfap','View\x20command\x20history\x20logs','stringify','success','82119OgiREq','duration'];a23_0x39f8=function(){return _0x4a3e3e;};return a23_0x39f8();}import{logger}from'../../utils/logger.js';function a23_0x46eb(_0x2d503e,_0x401c2d){_0x2d503e=_0x2d503e-0x171;const _0x39f8f1=a23_0x39f8();let _0x46eb52=_0x39f8f1[_0x2d503e];return _0x46eb52;}import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0xe74929){const _0x53b1bb=a23_0x46eb;if(_0xe74929['length']===0x0){console[_0x53b1bb(0x193)](_0x53b1bb(0x191));return;}console[_0x53b1bb(0x193)]('*\x20'+CLI_DISPLAY_NAME+_0x53b1bb(0x173)),_0xe74929[_0x53b1bb(0x187)]((_0x3cefe1,_0x58b830)=>{const _0x524008=_0x53b1bb,_0x5365ac=new Date(_0x3cefe1['timestamp'])[_0x524008(0x172)](_0x524008(0x186)),_0x37ebb8=_0x3cefe1[_0x524008(0x18d)]===_0x524008(0x17b)?'√':_0x3cefe1[_0x524008(0x18d)]==='error'?'×':_0x3cefe1[_0x524008(0x18d)]===_0x524008(0x188)?'!':'i';console[_0x524008(0x193)](_0x58b830+0x1+'.\x20'+_0x37ebb8+'\x20['+_0x3cefe1[_0x524008(0x18f)]+']\x20'+_0x3cefe1['message']),console[_0x524008(0x193)](_0x524008(0x184)+_0x5365ac),_0x3cefe1['duration']&&console['log'](_0x524008(0x177)+_0x3cefe1[_0x524008(0x17d)]+'ms'),_0x3cefe1[_0x524008(0x182)]&&Object[_0x524008(0x194)](_0x3cefe1[_0x524008(0x182)])[_0x524008(0x189)]>0x0&&console[_0x524008(0x193)](_0x524008(0x18a)+JSON[_0x524008(0x17a)](_0x3cefe1[_0x524008(0x182)],null,0x2)),console[_0x524008(0x193)]('');});}export const logsDefinitions=[{'service':a23_0x392db7(0x171),'command':a23_0x392db7(0x181),'description':a23_0x392db7(0x179),'risk':a23_0x392db7(0x176),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x2fbe79){const _0x50e457=a23_0x392db7;return printLogs(logger[_0x50e457(0x18b)]()),{'ok':!![]};}},{'service':a23_0x392db7(0x171),'command':'clear','description':'Clear\x20command\x20history\x20logs','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x5238d0){const _0x2ae116=a23_0x392db7;return logger[_0x2ae116(0x18e)](),console[_0x2ae116(0x193)](_0x2ae116(0x174)),{'ok':!![]};}}];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x46ef40=a24_0x53b5;(function(_0x583f9d,_0x444cbb){const _0x29a360=a24_0x53b5,_0x583879=_0x583f9d();while(!![]){try{const _0x19aca9=-parseInt(_0x29a360(0xc8))/0x1*(-parseInt(_0x29a360(0xc5))/0x2)+parseInt(_0x29a360(0xa5))/0x3*(parseInt(_0x29a360(0xa4))/0x4)+parseInt(_0x29a360(0xa7))/0x5*(parseInt(_0x29a360(0xab))/0x6)+parseInt(_0x29a360(0xc7))/0x7*(parseInt(_0x29a360(0xba))/0x8)+parseInt(_0x29a360(0xbb))/0x9+-parseInt(_0x29a360(0xc1))/0xa+parseInt(_0x29a360(0xb5))/0xb*(-parseInt(_0x29a360(0xbc))/0xc);if(_0x19aca9===_0x444cbb)break;else _0x583879['push'](_0x583879['shift']());}catch(_0x12c1d3){_0x583879['push'](_0x583879['shift']());}}}(a24_0x1731,0x196ba));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';function a24_0x1731(){const _0x50565c=['1MAdtKe','values','142224PCVesI','12MDQtYH','write','50jMvOuN','push','risk','SQL\x20Queries','24762KJlGaQ','Instant\x20API','set','command','Diagnostics','service','show','defaultCommand','\x20\x20[high-risk-write]','get','11GUASqt','read','App\x20Management','Datasets','login','16ByuXno','35091WEkxmw','3552312vtaLyG','Knowledge\x20Base','Configuration','from','isSingleCommand','141470qACtYy','Skills','has','run','174808WyIEIZ','list','488243armDqN'];a24_0x1731=function(){return _0x50565c;};return a24_0x1731();}import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';export const serviceRegistry=[];function a24_0x53b5(_0x110b71,_0x441be6){_0x110b71=_0x110b71-0xa3;const _0x173123=a24_0x1731();let _0x53b5b0=_0x173123[_0x110b71];return _0x53b5b0;}const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x2dd06e){const _0x3b4448=a24_0x53b5;for(const _0x5a6c46 of _0x2dd06e){definitions[_0x3b4448(0xad)](_0x5a6c46[_0x3b4448(0xb0)]+':'+_0x5a6c46[_0x3b4448(0xae)],_0x5a6c46);let _0x19d9ce=serviceGroups[_0x3b4448(0xb4)](_0x5a6c46['service']);!_0x19d9ce&&(_0x19d9ce=[],serviceGroups[_0x3b4448(0xad)](_0x5a6c46[_0x3b4448(0xb0)],_0x19d9ce)),_0x19d9ce['push'](_0x5a6c46);}}function registerService(_0x3b95b2,_0x305152,_0x485bec){const _0x2260ac=a24_0x53b5;registerDefinitions(_0x305152);const _0x51d9fc=_0x238a85=>_0x238a85===_0x2260ac(0xb6)?'':_0x238a85===_0x2260ac(0xa6)?'\x20\x20[write]':_0x2260ac(0xb3),_0x31d4f0={'service':_0x305152[0x0][_0x2260ac(0xb0)],'label':_0x3b95b2,'commands':_0x305152['map'](_0x24a208=>({'command':_0x24a208['command'],'description':_0x24a208['description'],'tag':_0x51d9fc(_0x24a208[_0x2260ac(0xa9)])})),'defaultCommand':_0x485bec?.[_0x2260ac(0xb2)]??(_0x485bec?.[_0x2260ac(0xc0)]?_0x305152[0x0][_0x2260ac(0xae)]:undefined),'isSingleCommand':_0x485bec?.[_0x2260ac(0xc0)]};serviceRegistry[_0x2260ac(0xa8)](_0x31d4f0),serviceByName[_0x2260ac(0xad)](_0x31d4f0[_0x2260ac(0xb0)],_0x31d4f0);}registerService('Authentication',authDefinitions,{'defaultCommand':a24_0x46ef40(0xb9)}),registerService(a24_0x46ef40(0xb8),datasetDefinitions),registerService(a24_0x46ef40(0xac),dataDefinitions),registerService(a24_0x46ef40(0xaa),sqlDefinitions),registerService('BFF\x20Scripts',bffDefinitions),registerService(a24_0x46ef40(0xbd),kbDefinitions),registerService(a24_0x46ef40(0xb7),appDefinitions,{'defaultCommand':a24_0x46ef40(0xc6)}),registerService(a24_0x46ef40(0xbe),configDefinitions,{'defaultCommand':a24_0x46ef40(0xc6)}),registerService(a24_0x46ef40(0xc2),skillDefinitions,{'defaultCommand':'install'}),registerService('Self\x20Update',[updateDefinition],{'defaultCommand':a24_0x46ef40(0xc4),'isSingleCommand':!![]}),registerService(a24_0x46ef40(0xaf),[doctorDefinition],{'isSingleCommand':!![]}),registerService('Schema',[schemaDefinition],{'isSingleCommand':!![]}),registerService('Logs',logsDefinitions,{'defaultCommand':a24_0x46ef40(0xb1)});export function findDefinition(_0x15681b,_0x5b140d){const _0x1809fc=a24_0x46ef40;return definitions[_0x1809fc(0xb4)](_0x15681b+':'+_0x5b140d);}export function isKnownService(_0x399dc0){const _0x56b458=a24_0x46ef40;return serviceByName[_0x56b458(0xc3)](_0x399dc0);}export function getServiceEntry(_0x62d7ca){const _0x26e402=a24_0x46ef40;return serviceByName[_0x26e402(0xb4)](_0x62d7ca);}export function getAllDefinitions(){const _0x52296a=a24_0x46ef40;return Array[_0x52296a(0xbf)](definitions[_0x52296a(0xa3)]());}
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a25_0x2855(){const _0x4ca024=['175460tIzQZf','10PUrjLO','50stoNgH','142ugFySg','2806119FipaGd','791WNAZbC','12bxYplr','1211552nMdkNe','9886525ikSmHf','6336hGbjGm','Export\x20machine-readable\x20command\x20schema\x20(JSON)','schema','17061FJAInV','2179PCQwdG','read'];a25_0x2855=function(){return _0x4ca024;};return a25_0x2855();}const a25_0x43f63c=a25_0x1bae;(function(_0x47ecec,_0x4f1568){const _0x20f5f7=a25_0x1bae,_0x3df071=_0x47ecec();while(!![]){try{const _0x5dad36=parseInt(_0x20f5f7(0x16c))/0x1*(-parseInt(_0x20f5f7(0x171))/0x2)+-parseInt(_0x20f5f7(0x16b))/0x3+-parseInt(_0x20f5f7(0x16e))/0x4*(parseInt(_0x20f5f7(0x170))/0x5)+parseInt(_0x20f5f7(0x168))/0x6*(parseInt(_0x20f5f7(0x173))/0x7)+parseInt(_0x20f5f7(0x166))/0x8+parseInt(_0x20f5f7(0x172))/0x9*(-parseInt(_0x20f5f7(0x16f))/0xa)+-parseInt(_0x20f5f7(0x167))/0xb*(-parseInt(_0x20f5f7(0x174))/0xc);if(_0x5dad36===_0x4f1568)break;else _0x3df071['push'](_0x3df071['shift']());}catch(_0x223cfb){_0x3df071['push'](_0x3df071['shift']());}}}(a25_0x2855,0x3f296));import{buildSchemaPayload}from'../framework/schema-export.js';function a25_0x1bae(_0x49f400,_0x30dd80){_0x49f400=_0x49f400-0x166;const _0x2855c7=a25_0x2855();let _0x1baef3=_0x2855c7[_0x49f400];return _0x1baef3;}async function execute(_0x4df692){const _0x1cac01=await buildSchemaPayload();return{'ok':!![],'data':_0x1cac01};}export const schemaDefinition={'service':a25_0x43f63c(0x16a),'command':'export','description':a25_0x43f63c(0x169),'risk':a25_0x43f63c(0x16d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x414964=a26_0x57b8;(function(_0x241a49,_0x1d0d96){const _0x431d57=a26_0x57b8,_0x504912=_0x241a49();while(!![]){try{const _0x1bbec9=-parseInt(_0x431d57(0x1e3))/0x1*(parseInt(_0x431d57(0x204))/0x2)+parseInt(_0x431d57(0x20d))/0x3+-parseInt(_0x431d57(0x215))/0x4+parseInt(_0x431d57(0x211))/0x5*(parseInt(_0x431d57(0x1e2))/0x6)+-parseInt(_0x431d57(0x213))/0x7+parseInt(_0x431d57(0x208))/0x8+parseInt(_0x431d57(0x1e4))/0x9;if(_0x1bbec9===_0x1d0d96)break;else _0x504912['push'](_0x504912['shift']());}catch(_0x549e7b){_0x504912['push'](_0x504912['shift']());}}}(a26_0x23e7,0x60bd7));import{CLI_BIN_NAME,CLI_DISPLAY_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';import{logger}from'../../utils/logger.js';const CODE_FLAG={'name':a26_0x414964(0x1d9),'type':a26_0x414964(0x1ee),'description':a26_0x414964(0x205)},DIR_FLAG={'name':a26_0x414964(0x20c),'type':'string','required':!![],'description':a26_0x414964(0x212)};function summarizeRuntimeSkill(_0xbba186){const _0x2e1c0f=a26_0x414964;return{'id':_0xbba186['id'],'skillCode':_0xbba186[_0x2e1c0f(0x1ec)],'skillName':_0xbba186['skillName'],'scope':_0xbba186[_0x2e1c0f(0x1fd)],'version':_0xbba186[_0x2e1c0f(0x1ff)],'readonly':_0xbba186[_0x2e1c0f(0x1fc)]};}function a26_0x57b8(_0x150edd,_0x32bb50){_0x150edd=_0x150edd-0x1d9;const _0x23e7a5=a26_0x23e7();let _0x57b89f=_0x23e7a5[_0x150edd];return _0x57b89f;}function a26_0x23e7(){const _0x4ac875=['dir','1192179Coinpe','Installing\x20official\x20skill\x20via\x20npx\x20(npx\x20skills\x20add\x20','length','unchanged','410Mifpyb','Local\x20Skill\x20directory\x20containing\x20SKILL.md','9772cELxqz','error','1087756vfMMiD','code','\x20personal\x20and\x20','npx\x20skills\x20add\x20failed:\x20','filter','find','install','personal','updated','input','4188BrZqXP','750298vxfoPP','5642649xxCcsq','Pulled\x20','nonInteractive','write','pipe','log','Install\x20the\x20published\x20','str','skillCode','\x20skill\x20via\x20npx.','string','reduce','skill','../../skills/runtime-skill-sync.js','Push\x20a\x20local\x20Skill\x20directory\x20to\x20personal\x20runtime\x20Skill\x20scope','trim','=1);\x20assuming\x20skill\x20is\x20already\x20present.','envName','map','cwd','../../skills/npx-skills-add.js','Pull\x20personal\x20and\x20company\x20runtime\x20Skills\x20into\x20local\x20agent\x20skill\x20directories','setLogPath','unknown','readonly','scope','Skipped\x20npx\x20(','version','apiError','authRequired','../../core/api-client.js','pull','2LaCyGj','Only\x20pull\x20a\x20specific\x20runtime\x20Skill\x20code','Installing\x20published\x20','appCode','2706320rfVYUx','company','action','accessKey'];a26_0x23e7=function(){return _0x4ac875;};return a26_0x23e7();}function filterByCode(_0x46d928,_0x16c93c){const _0x1912e7=a26_0x414964,_0x2804e0=_0x16c93c[_0x1912e7(0x1f3)]();if(!_0x2804e0)return _0x46d928;return _0x46d928[_0x1912e7(0x1dc)](_0x5719e4=>_0x5719e4['skillCode']===_0x2804e0);}export const skillDefinitions=[{'service':a26_0x414964(0x1f0),'command':a26_0x414964(0x1de),'description':a26_0x414964(0x1ea)+CLI_BIN_NAME+'\x20developer\x20skill','risk':a26_0x414964(0x1e7),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1bc7e9){const _0x74680c=a26_0x414964;logger[_0x74680c(0x1fa)](process[_0x74680c(0x1f7)]()),logger['info']('skill-install',_0x74680c(0x206)+CLI_DISPLAY_NAME+_0x74680c(0x1ed));const {LOVRABET_SKILL_SOURCE:_0x31a54f,LOVRABET_SKIP_NPX_SKILLS_ENV:_0x552573,runNpxSkillsAddGlobal:_0x38e19b}=await import(_0x74680c(0x1f8)),_0x3817d7=_0x1bc7e9[_0x74680c(0x1e6)]?_0x74680c(0x1e8):'inherit';console[_0x74680c(0x1e9)](_0x74680c(0x20e)+_0x31a54f+'\x20-g\x20-y)...');const _0x5cd1e7=_0x38e19b(process[_0x74680c(0x1f7)](),_0x31a54f,{'stdio':_0x3817d7});if(_0x5cd1e7['skipped'])console[_0x74680c(0x1e9)](_0x74680c(0x1fe)+_0x552573+_0x74680c(0x1f4));else{if(_0x5cd1e7['ok'])console[_0x74680c(0x1e9)](CLI_BIN_NAME+'\x20skill\x20installed');else throw CliErrors[_0x74680c(0x200)](_0x74680c(0x1db)+(_0x5cd1e7[_0x74680c(0x214)]||_0x74680c(0x1fb)),'Check\x20network\x20connectivity\x20and\x20try\x20again.');}return{'ok':!![]};}},{'service':a26_0x414964(0x1f0),'command':a26_0x414964(0x203),'description':a26_0x414964(0x1f9),'risk':a26_0x414964(0x1e7),'flags':[CODE_FLAG],async 'execute'(_0x5287de){const _0x418a35=a26_0x414964,{listCompanyRuntimeSkills:_0x12bb36,listPersonalRuntimeSkills:_0x8661a8}=await import(_0x418a35(0x202)),{linkEffectiveRuntimeSkills:_0x13aac3,materializeRuntimeSkill:_0x3baa85}=await import(_0x418a35(0x1f1)),_0xf3513c=_0x5287de['str'](_0x418a35(0x1d9)),_0x20b2c0=_0x5287de[_0x418a35(0x1f5)]??'production',_0x1c35df=_0x5287de[_0x418a35(0x20b)];if(!_0x1c35df)throw CliErrors[_0x418a35(0x201)]();const _0x46e8b9=filterByCode(await _0x8661a8(_0x5287de[_0x418a35(0x207)]),_0xf3513c),_0x2ac63c=filterByCode(await _0x12bb36(_0x5287de[_0x418a35(0x207)]),_0xf3513c),_0x2f5273=[..._0x46e8b9[_0x418a35(0x1f6)](_0x53a212=>_0x3baa85(_0x53a212,_0x418a35(0x1df),{'env':_0x20b2c0,'accessKey':_0x1c35df,'appCode':_0x5287de[_0x418a35(0x207)]})),..._0x2ac63c[_0x418a35(0x1f6)](_0x5e18a5=>_0x3baa85(_0x5e18a5,_0x418a35(0x209),{'env':_0x20b2c0,'accessKey':_0x1c35df,'appCode':_0x5287de[_0x418a35(0x207)]}))],_0x40db04=_0x13aac3(_0x2f5273,_0x5287de[_0x418a35(0x207)]),_0x14b88d=_0x40db04[_0x418a35(0x1ef)]((_0x13c895,_0x37386d)=>{const _0x5f1a70=_0x418a35;return _0x13c895[_0x37386d[_0x5f1a70(0x20a)]]=(_0x13c895[_0x37386d[_0x5f1a70(0x20a)]]??0x0)+0x1,_0x13c895;},{});return{'ok':!![],'data':{'appCode':_0x5287de[_0x418a35(0x207)],'personal':_0x46e8b9[_0x418a35(0x20f)],'company':_0x2ac63c[_0x418a35(0x20f)],'materialized':_0x2f5273[_0x418a35(0x20f)],'links':{'total':_0x40db04['length'],'created':_0x14b88d['created']??0x0,'updated':_0x14b88d[_0x418a35(0x1e0)]??0x0,'unchanged':_0x14b88d[_0x418a35(0x210)]??0x0,'skipped':0x0,'conflicted':0x0},'skills':{'personal':_0x46e8b9['map'](summarizeRuntimeSkill),'company':_0x2ac63c[_0x418a35(0x1f6)](summarizeRuntimeSkill)}},'message':_0x418a35(0x1e5)+_0x46e8b9[_0x418a35(0x20f)]+_0x418a35(0x1da)+_0x2ac63c['length']+'\x20company\x20Skill(s).'};}},{'service':a26_0x414964(0x1f0),'command':'push','description':a26_0x414964(0x1f2),'risk':a26_0x414964(0x1e7),'flags':[DIR_FLAG],async 'execute'(_0xdcea00){const _0x1904b2=a26_0x414964,{createPersonalRuntimeSkill:_0x330748,listPersonalRuntimeSkills:_0x3f89d5,updatePersonalRuntimeSkill:_0x14bd7e}=await import('../../core/api-client.js'),{readPushDirectory:_0x1067e7}=await import(_0x1904b2(0x1f1));if(!_0xdcea00['accessKey'])throw CliErrors['authRequired']();const _0xe72c2f=_0x1067e7(_0xdcea00[_0x1904b2(0x1eb)](_0x1904b2(0x20c)),_0xdcea00['appCode']),_0x4b9492=(await _0x3f89d5(_0xdcea00[_0x1904b2(0x207)]))[_0x1904b2(0x1dd)](_0x227193=>_0x227193[_0x1904b2(0x1ec)]===_0xe72c2f[_0x1904b2(0x1ec)]),_0x53d7fe=_0x4b9492?await _0x14bd7e(_0xe72c2f[_0x1904b2(0x1ec)],_0xdcea00[_0x1904b2(0x207)],_0xe72c2f[_0x1904b2(0x1e1)]):await _0x330748(_0xdcea00['appCode'],_0xe72c2f[_0x1904b2(0x1e1)]);return{'ok':!![],'data':summarizeRuntimeSkill(_0x53d7fe),'message':_0x4b9492?'Updated\x20personal\x20Skill\x20'+_0xe72c2f[_0x1904b2(0x1ec)]:'Created\x20personal\x20Skill\x20'+_0xe72c2f[_0x1904b2(0x1ec)]};}}];
|
|
1
|
+
function a26_0x231a(){const _0x8650fb=['appCode','personal','cwd','Skipped\x20npx\x20(','Only\x20pull\x20a\x20specific\x20runtime\x20Skill\x20code','\x20skill\x20installed','20164YCJjLv','Backend\x20did\x20not\x20persist\x20the\x20multi-file\x20Skill\x20manifest.','str','authRequired','unchanged','pipe','input','22KvMImI','treeSha256','filter','write','ossPath','Installing\x20published\x20','16935xfJOry','action','1723812WwADtE','\x20personal\x20and\x20','reduce','path','trim','accessKey','string','isArray','\x20company\x20Skill(s).','Check\x20network\x20connectivity\x20and\x20try\x20again.','code','validation','\x20developer\x20skill','install','scope','inherit','Installing\x20official\x20skill\x20via\x20npx\x20(npx\x20skills\x20add\x20','length','zipSize','skillCode','SKILL.md','zipSha256','67020iryHqn','readonly','Check\x20the\x20runtime\x20service\x20Skill\x20file\x20manifest\x20storage\x20before\x20pulling\x20this\x20Skill.','join','push','10MKCrdg','log','skill','size','172470wxvufn','setLogPath','Install\x20the\x20published\x20','envName','../../core/api-client.js','object','Backend\x20returned\x20a\x20different\x20multi-file\x20Skill\x20manifest\x20after\x20push.','sha256','603NABOvl','created','skipped','Local\x20Skill\x20directory\x20containing\x20SKILL.md','apiError','map','skill-install','dir','../../skills/npx-skills-add.js','27080OgKvxs','pull','575806PNBcWz','info','updated','36nyBjaN','files','company'];a26_0x231a=function(){return _0x8650fb;};return a26_0x231a();}const a26_0x2fa19c=a26_0x1196;(function(_0x4c461a,_0x19a1f3){const _0xff1854=a26_0x1196,_0xbca94c=_0x4c461a();while(!![]){try{const _0x4f53c5=-parseInt(_0xff1854(0xa6))/0x1*(-parseInt(_0xff1854(0xc9))/0x2)+-parseInt(_0xff1854(0xaa))/0x3+parseInt(_0xff1854(0xc0))/0x4*(-parseInt(_0xff1854(0xd6))/0x5)+parseInt(_0xff1854(0xd8))/0x6+parseInt(_0xff1854(0xbd))/0x7+-parseInt(_0xff1854(0xbb))/0x8*(parseInt(_0xff1854(0xb2))/0x9)+parseInt(_0xff1854(0xee))/0xa*(parseInt(_0xff1854(0xd0))/0xb);if(_0x4f53c5===_0x19a1f3)break;else _0xbca94c['push'](_0xbca94c['shift']());}catch(_0x567850){_0xbca94c['push'](_0xbca94c['shift']());}}}(a26_0x231a,0x29438));import{CLI_BIN_NAME,CLI_DISPLAY_NAME}from'../../constant/cli.js';function a26_0x1196(_0x3c9008,_0x3cfe27){_0x3c9008=_0x3c9008-0xa5;const _0x231a01=a26_0x231a();let _0x119606=_0x231a01[_0x3c9008];return _0x119606;}import{CliErrors}from'../../errors.js';import{logger}from'../../utils/logger.js';const CODE_FLAG={'name':'code','type':a26_0x2fa19c(0xde),'description':a26_0x2fa19c(0xc7)},DIR_FLAG={'name':a26_0x2fa19c(0xb9),'type':'string','required':!![],'description':a26_0x2fa19c(0xb5)};function summarizeRuntimeSkill(_0x4c2f42){const _0x38221d=a26_0x2fa19c;return{'id':_0x4c2f42['id'],'skillCode':_0x4c2f42[_0x38221d(0xeb)],'skillName':_0x4c2f42['skillName'],'scope':_0x4c2f42[_0x38221d(0xe6)],'version':_0x4c2f42['version'],'readonly':_0x4c2f42[_0x38221d(0xef)]};}function filterByCode(_0x2e6b6b,_0x9232be){const _0x52727c=a26_0x2fa19c,_0x30d6a=_0x9232be[_0x52727c(0xdc)]();if(!_0x30d6a)return _0x2e6b6b;return _0x2e6b6b[_0x52727c(0xd2)](_0x430101=>_0x430101[_0x52727c(0xeb)]===_0x30d6a);}export const skillDefinitions=[{'service':a26_0x2fa19c(0xa8),'command':a26_0x2fa19c(0xe5),'description':a26_0x2fa19c(0xac)+CLI_BIN_NAME+a26_0x2fa19c(0xe4),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x51d552){const _0x11d530=a26_0x2fa19c;logger[_0x11d530(0xab)](process[_0x11d530(0xc5)]()),logger[_0x11d530(0xbe)](_0x11d530(0xb8),_0x11d530(0xd5)+CLI_DISPLAY_NAME+'\x20skill\x20via\x20npx.');const {LOVRABET_SKILL_SOURCE:_0xa71149,LOVRABET_SKIP_NPX_SKILLS_ENV:_0x4007e2,runNpxSkillsAddGlobal:_0x13acb5}=await import(_0x11d530(0xba)),_0x3e50ce=_0x51d552['nonInteractive']?_0x11d530(0xce):_0x11d530(0xe7);console['log'](_0x11d530(0xe8)+_0xa71149+'\x20-g\x20-y)...');const _0x4e994f=_0x13acb5(process[_0x11d530(0xc5)](),_0xa71149,{'stdio':_0x3e50ce});if(_0x4e994f[_0x11d530(0xb4)])console[_0x11d530(0xa7)](_0x11d530(0xc6)+_0x4007e2+'=1);\x20assuming\x20skill\x20is\x20already\x20present.');else{if(_0x4e994f['ok'])console[_0x11d530(0xa7)](CLI_BIN_NAME+_0x11d530(0xc8));else throw CliErrors[_0x11d530(0xb6)]('npx\x20skills\x20add\x20failed:\x20'+(_0x4e994f['error']||'unknown'),_0x11d530(0xe1));}return{'ok':!![]};}},{'service':a26_0x2fa19c(0xa8),'command':a26_0x2fa19c(0xbc),'description':'Pull\x20personal\x20and\x20company\x20runtime\x20Skills\x20into\x20local\x20agent\x20skill\x20directories','risk':'write','flags':[CODE_FLAG],async 'execute'(_0x3503bd){const _0x4e8208=a26_0x2fa19c,{downloadRuntimeSkillPackage:_0x538f7c,listCompanyRuntimeSkills:_0x94a59a,listPersonalRuntimeSkills:_0x46967a}=await import(_0x4e8208(0xae)),{linkEffectiveRuntimeSkills:_0x28dd40,materializeRuntimeSkill:_0x5c242f}=await import('../../skills/runtime-skill-sync.js'),_0x1aa33b=_0x3503bd[_0x4e8208(0xcb)](_0x4e8208(0xe2)),_0x149825=_0x3503bd[_0x4e8208(0xad)]??'production',_0x12ced2=_0x3503bd[_0x4e8208(0xdd)];if(!_0x12ced2)throw CliErrors[_0x4e8208(0xcc)]();const _0x4099a5=filterByCode(await _0x46967a(_0x3503bd['appCode']),_0x1aa33b),_0x5ed0a6=filterByCode(await _0x94a59a(_0x3503bd['appCode']),_0x1aa33b),_0xa8ff1d=[];for(const _0x2881c7 of _0x4099a5){_0xa8ff1d['push'](_0x5c242f(_0x2881c7,_0x4e8208(0xc4),{'env':_0x149825,'accessKey':_0x12ced2,'appCode':_0x3503bd['appCode'],'packageBytes':await downloadPackageIfNeeded(_0x2881c7,_0x4e8208(0xc4),_0x3503bd['appCode'],_0x538f7c)}));}for(const _0x4cbd3a of _0x5ed0a6){_0xa8ff1d['push'](_0x5c242f(_0x4cbd3a,'company',{'env':_0x149825,'accessKey':_0x12ced2,'appCode':_0x3503bd[_0x4e8208(0xc3)],'packageBytes':await downloadPackageIfNeeded(_0x4cbd3a,_0x4e8208(0xc2),_0x3503bd[_0x4e8208(0xc3)],_0x538f7c)}));}const _0xa6fa55=_0x28dd40(_0xa8ff1d,_0x3503bd[_0x4e8208(0xc3)]),_0x4bb8ab=_0xa6fa55[_0x4e8208(0xda)]((_0x210406,_0x197d29)=>{const _0x4b4099=_0x4e8208;return _0x210406[_0x197d29[_0x4b4099(0xd7)]]=(_0x210406[_0x197d29[_0x4b4099(0xd7)]]??0x0)+0x1,_0x210406;},{});return{'ok':!![],'data':{'appCode':_0x3503bd[_0x4e8208(0xc3)],'personal':_0x4099a5[_0x4e8208(0xe9)],'company':_0x5ed0a6[_0x4e8208(0xe9)],'materialized':_0xa8ff1d[_0x4e8208(0xe9)],'links':{'total':_0xa6fa55[_0x4e8208(0xe9)],'created':_0x4bb8ab[_0x4e8208(0xb3)]??0x0,'updated':_0x4bb8ab[_0x4e8208(0xbf)]??0x0,'unchanged':_0x4bb8ab[_0x4e8208(0xcd)]??0x0,'skipped':0x0,'conflicted':0x0},'skills':{'personal':_0x4099a5[_0x4e8208(0xb7)](summarizeRuntimeSkill),'company':_0x5ed0a6[_0x4e8208(0xb7)](summarizeRuntimeSkill)}},'message':'Pulled\x20'+_0x4099a5[_0x4e8208(0xe9)]+_0x4e8208(0xd9)+_0x5ed0a6['length']+_0x4e8208(0xe0)};}},{'service':'skill','command':a26_0x2fa19c(0xa5),'description':'Push\x20a\x20local\x20Skill\x20directory\x20to\x20personal\x20runtime\x20Skill\x20scope','risk':a26_0x2fa19c(0xd3),'flags':[DIR_FLAG],async 'execute'(_0x21ca9e){const _0x17ef25=a26_0x2fa19c,{createPersonalRuntimeSkill:_0xff5fc7,downloadRuntimeSkillPackage:_0x250453,listPersonalRuntimeSkills:_0x28ea56,updatePersonalRuntimeSkill:_0x297efc}=await import(_0x17ef25(0xae)),{verifyRuntimeSkillPackage:_0x20a25d,readPushDirectory:_0x5d21d5,recordPushedRuntimeSkill:_0x2acf3b}=await import('../../skills/runtime-skill-sync.js');if(!_0x21ca9e[_0x17ef25(0xdd)])throw CliErrors['authRequired']();const _0x35b60e=_0x5d21d5(_0x21ca9e['str'](_0x17ef25(0xb9)),_0x21ca9e[_0x17ef25(0xc3)]),_0x5b4f11=(await _0x28ea56(_0x21ca9e['appCode']))['find'](_0x3e8de2=>_0x3e8de2['skillCode']===_0x35b60e[_0x17ef25(0xeb)]),_0x5aacb3=_0x5b4f11?await _0x297efc(_0x35b60e['skillCode'],_0x21ca9e[_0x17ef25(0xc3)],_0x35b60e[_0x17ef25(0xcf)]):await _0xff5fc7(_0x21ca9e[_0x17ef25(0xc3)],_0x35b60e[_0x17ef25(0xcf)]);assertMultiFilePushPersisted(_0x35b60e[_0x17ef25(0xcf)][_0x17ef25(0xc1)],_0x5aacb3);if(isPackageBackedMultiFile(_0x5aacb3['files'])){const _0x1ded82=await _0x250453('personal',_0x35b60e[_0x17ef25(0xeb)],_0x21ca9e[_0x17ef25(0xc3)]);_0x20a25d(_0x5aacb3[_0x17ef25(0xc1)],_0x1ded82);}return _0x2acf3b(_0x21ca9e[_0x17ef25(0xcb)](_0x17ef25(0xb9)),_0x5aacb3,_0x21ca9e[_0x17ef25(0xc3)]),{'ok':!![],'data':summarizeRuntimeSkill(_0x5aacb3),'message':_0x5b4f11?'Updated\x20personal\x20Skill\x20'+_0x35b60e[_0x17ef25(0xeb)]:'Created\x20personal\x20Skill\x20'+_0x35b60e['skillCode']};}}];async function downloadPackageIfNeeded(_0xc23122,_0x1cc87a,_0x25b515,_0x1b4d7e){const _0x3956ab=a26_0x2fa19c;if(!isPackageBackedManifest(_0xc23122[_0x3956ab(0xc1)]))return undefined;return _0x1b4d7e(_0x1cc87a,_0xc23122['skillCode'],_0x25b515);}function assertMultiFilePushPersisted(_0x420409,_0x1d9e13){const _0x493d91=a26_0x2fa19c;if(!isMultiFileManifest(_0x420409))return;if(!isPackageBackedMultiFile(_0x1d9e13[_0x493d91(0xc1)]))throw CliErrors[_0x493d91(0xe3)](_0x493d91(0xca),'Upgrade\x20the\x20runtime\x20service\x20before\x20pushing\x20multi-file\x20Skill\x20directories.');if(_0x420409[_0x493d91(0xd1)]!==_0x1d9e13[_0x493d91(0xc1)][_0x493d91(0xd1)]||_0x420409[_0x493d91(0xed)]!==_0x1d9e13[_0x493d91(0xc1)][_0x493d91(0xed)]||_0x420409['zipSize']!==_0x1d9e13[_0x493d91(0xc1)][_0x493d91(0xea)]||!_0x1d9e13[_0x493d91(0xc1)]['ossPath']||manifestFileSignature(_0x420409)!==manifestFileSignature(_0x1d9e13[_0x493d91(0xc1)]))throw CliErrors['validation'](_0x493d91(0xb0),_0x493d91(0xf0));}function isPackageBackedManifest(_0xd37278){const _0x322e33=a26_0x2fa19c;return!!_0xd37278&&typeof _0xd37278===_0x322e33(0xaf)&&!Array[_0x322e33(0xdf)](_0xd37278)&&typeof _0xd37278[_0x322e33(0xd4)]==='string'&&_0xd37278[_0x322e33(0xd4)][_0x322e33(0xe9)]>0x0&&Array[_0x322e33(0xdf)](_0xd37278[_0x322e33(0xc1)]);}function isPackageBackedMultiFile(_0x3fa836){return isPackageBackedManifest(_0x3fa836)&&isMultiFileManifest(_0x3fa836);}function isMultiFileManifest(_0x1fa94b){const _0x40fac0=a26_0x2fa19c;return!!_0x1fa94b&&typeof _0x1fa94b===_0x40fac0(0xaf)&&!Array[_0x40fac0(0xdf)](_0x1fa94b)&&Array[_0x40fac0(0xdf)](_0x1fa94b[_0x40fac0(0xc1)])&&_0x1fa94b[_0x40fac0(0xc1)]['some'](_0x1438aa=>_0x1438aa['path']!==_0x40fac0(0xec));}function manifestFileSignature(_0x2e6985){const _0x48381f=a26_0x2fa19c;return[..._0x2e6985[_0x48381f(0xc1)]][_0x48381f(0xb7)](_0x567a56=>_0x567a56[_0x48381f(0xdb)]+'\x00'+_0x567a56[_0x48381f(0xb1)]+'\x00'+_0x567a56[_0x48381f(0xa9)])['sort']()[_0x48381f(0xf1)]('\x00');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a27_0xa509e9=a27_0x5c9d;(function(_0x255e5d,_0x242b2c){const _0x2c38e6=a27_0x5c9d,_0x2f3f80=_0x255e5d();while(!![]){try{const _0x33ee24=-parseInt(_0x2c38e6(0x11d))/0x1+parseInt(_0x2c38e6(0x12d))/0x2*(parseInt(_0x2c38e6(0x122))/0x3)+-parseInt(_0x2c38e6(0x12e))/0x4+-parseInt(_0x2c38e6(0x128))/0x5*(parseInt(_0x2c38e6(0x129))/0x6)+-parseInt(_0x2c38e6(0x121))/0x7+-parseInt(_0x2c38e6(0x11f))/0x8*(-parseInt(_0x2c38e6(0x127))/0x9)+parseInt(_0x2c38e6(0x12c))/0xa;if(_0x33ee24===_0x242b2c)break;else _0x2f3f80['push'](_0x2f3f80['shift']());}catch(_0x5ca874){_0x2f3f80['push'](_0x2f3f80['shift']());}}}(a27_0x58bf,0x5386b));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a27_0x5c9d(_0x449301,_0x1d04eb){_0x449301=_0x449301-0x11a;const _0x58bffb=a27_0x58bf();let _0x5c9df0=_0x58bffb[_0x449301];return _0x5c9df0;}import{SQLCODE_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a27_0xa509e9(0x11b),'command':a27_0xa509e9(0x11a),'description':'Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','risk':a27_0xa509e9(0x11e),'flags':[SQLCODE_FLAG,VERBOSE_FLAG],async 'execute'(_0x3fde04){const _0x3b0548=a27_0xa509e9,_0x37afb0=await getSqlQueryInfo(_0x3fde04[_0x3b0548(0x12b)],_0x3fde04[_0x3b0548(0x125)](_0x3b0548(0x11c))),_0x3803ef=_0x3fde04[_0x3b0548(0x124)](_0x3b0548(0x12f));if(_0x3803ef)return{'ok':!![],'data':_0x37afb0};const _0x68058=_0x37afb0[_0x3b0548(0x123)]?await getDbName(_0x3fde04[_0x3b0548(0x12b)],_0x37afb0[_0x3b0548(0x123)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x37afb0['sqlCode'],'sqlName':_0x37afb0[_0x3b0548(0x12a)],'db':_0x68058?_0x68058+'\x20('+_0x37afb0[_0x3b0548(0x123)]+')':_0x37afb0[_0x3b0548(0x123)]??'','description':_0x37afb0[_0x3b0548(0x126)]??'','sqlContent':_0x37afb0[_0x3b0548(0x120)]??''}};}};function a27_0x58bf(){const _0x48b828=['608hcdXQS','sqlContent','4469787wAkRCX','1723611AzdAlK','dbId','bool','str','description','72369LHVEiy','1606765NVJlCL','6pfbJtF','sqlName','appCode','9157530rmuRvW','2jjHAns','2362940HmkPcT','verbose','detail','sql','sqlcode','208654FAVTAM','read'];a27_0x58bf=function(){return _0x48b828;};return a27_0x58bf();}
|