@lovrabet/lovrabet-cli 2.0.14-beta.7 → 2.0.14-beta.9
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/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.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/artifact/index.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/dataset/sdk-doc.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/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.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/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.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/generated/build-info.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/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x33af19,_0x5626db){const _0xadda71=a15_0x3d59,_0x5a74a7=_0x33af19();while(!![]){try{const _0x3bc24e=-parseInt(_0xadda71(0x84))/0x1*(-parseInt(_0xadda71(0x83))/0x2)+parseInt(_0xadda71(0x88))/0x3*(parseInt(_0xadda71(0x95))/0x4)+-parseInt(_0xadda71(0x7f))/0x5*(parseInt(_0xadda71(0x91))/0x6)+parseInt(_0xadda71(0x8b))/0x7*(-parseInt(_0xadda71(0x98))/0x8)+-parseInt(_0xadda71(0x85))/0x9*(-parseInt(_0xadda71(0x8f))/0xa)+-parseInt(_0xadda71(0x8d))/0xb*(parseInt(_0xadda71(0x92))/0xc)+parseInt(_0xadda71(0x82))/0xd;if(_0x3bc24e===_0x5626db)break;else _0x5a74a7['push'](_0x5a74a7['shift']());}catch(_0x1459fa){_0x5a74a7['push'](_0x5a74a7['shift']());}}}(a15_0x2648,0xd2155));import{CliErrors}from'../../errors.js';function isSet(_0x2676c3,_0x4aadd5){const _0x51765e=_0x2676c3['flag'](_0x4aadd5);return _0x51765e!==undefined&&_0x51765e!==''&&_0x51765e!==![]&&_0x51765e!==0x0;}function fmtNames(_0x37ea0b){const _0x5c5885=a15_0x3d59;return _0x37ea0b[_0x5c5885(0x89)](_0x5eb493=>'--'+_0x5eb493)[_0x5c5885(0x90)](',\x20');}function a15_0x3d59(_0x2134db,_0x23c3e4){_0x2134db=_0x2134db-0x7b;const _0x26483e=a15_0x2648();let _0x3d590b=_0x26483e[_0x2134db];return _0x3d590b;}export function requireOneOf(_0x2357e2,_0x5e7921,_0x4996fd){const _0x152f51=a15_0x3d59,_0x17312c=_0x5e7921[_0x152f51(0x97)](_0x10ae52=>isSet(_0x2357e2,_0x10ae52));if(_0x17312c['length']!==0x1)throw CliErrors[_0x152f51(0x8c)](_0x17312c[_0x152f51(0x7e)]===0x0?_0x152f51(0x7b)+fmtNames(_0x5e7921)+_0x152f51(0x99)+_0x4996fd+'`.':'Only\x20one\x20of\x20'+fmtNames(_0x5e7921)+_0x152f51(0x86)+fmtNames(_0x17312c)+'.',_0x17312c[_0x152f51(0x7e)]===0x0?_0x152f51(0x81)+fmtNames(_0x5e7921):_0x152f51(0x80));}export function requireAnyOf(_0x2f2fa6,_0x580958,_0x194e34){const _0x18e55c=a15_0x3d59;if(!_0x580958[_0x18e55c(0x8a)](_0x5cfe22=>isSet(_0x2f2fa6,_0x5cfe22)))throw CliErrors[_0x18e55c(0x8c)](_0x18e55c(0x93)+fmtNames(_0x580958)+_0x18e55c(0x99)+_0x194e34+'`.',_0x18e55c(0x81)+fmtNames(_0x580958));}function a15_0x2648(){const _0x3a0f35=['At\x20least\x20one\x20of\x20','Invalid\x20--','4052evmVMS','test','filter','8lCRBhm','\x20is\x20required\x20for\x20`','Exactly\x20one\x20of\x20',',\x20got\x20\x22','Flags\x20','length','5sFaLDO','Remove\x20all\x20but\x20one.','Provide\x20one\x20of:\x20','13650741XuiVHG','110968PRAxfs','6XqMblI','702ZiVsCD','\x20is\x20allowed,\x20found:\x20','str','3831dWjPeQ','map','some','9525509DnbJUn','validation','11NGTRAp','Use\x20only\x20one\x20of:\x20','203460yXnSjb','join','9739398TjcVmI','5028348MLutRC'];a15_0x2648=function(){return _0x3a0f35;};return a15_0x2648();}export function mutuallyExclusive(_0x120e37,_0x1a9ad5,_0x34fda3){const _0x3284ee=a15_0x3d59,_0x3e344f=_0x1a9ad5[_0x3284ee(0x97)](_0x1ae201=>isSet(_0x120e37,_0x1ae201));if(_0x3e344f[_0x3284ee(0x7e)]>0x1)throw CliErrors[_0x3284ee(0x8c)](_0x3284ee(0x7d)+fmtNames(_0x3e344f)+'\x20are\x20mutually\x20exclusive\x20for\x20`'+_0x34fda3+'`.',_0x3284ee(0x8e)+fmtNames(_0x1a9ad5));}export function validatePattern(_0x24abfc,_0x16e761,_0x49d20d,_0x5a3ff0){const _0x22ecb2=a15_0x3d59,_0x29dd1b=_0x24abfc[_0x22ecb2(0x87)](_0x16e761);if(_0x29dd1b&&!_0x49d20d[_0x22ecb2(0x96)](_0x29dd1b))throw CliErrors[_0x22ecb2(0x8c)](_0x22ecb2(0x94)+_0x16e761+':\x20expected\x20'+_0x5a3ff0+_0x22ecb2(0x7c)+_0x29dd1b+'\x22.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a16_0x151f(_0x39c6d7,_0x8607a7){_0x39c6d7=_0x39c6d7-0x125;const _0x4f79d1=a16_0x4f79();let _0x151f0c=_0x4f79d1[_0x39c6d7];return _0x151f0c;}function a16_0x4f79(){const _0x1d8f6c=['116640pIYtIT','4928WVtdcH','Resource\x20name\x20for\x20lookup','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','code','params','9ZaZnkS','6560bZdzOn','Dataset\x20code\x20(32-char\x20hex\x20UUID)','23344vumNnu','verbose','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','22162pmIZNg','412926GoEIut','string','a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)','40674HlbJVb','name','Resource\x20ID','boolean','Return\x20full\x20raw\x20response\x20object','1111472DnKIju','sqlcode','115HqUlOz','14mbvttQ'];a16_0x4f79=function(){return _0x1d8f6c;};return a16_0x4f79();}const a16_0x551c54=a16_0x151f;(function(_0x4df831,_0x1083de){const _0x5e39c1=a16_0x151f,_0x2845fa=_0x4df831();while(!![]){try{const _0x4f050f=parseInt(_0x5e39c1(0x13c))/0x1+-parseInt(_0x5e39c1(0x130))/0x2+-parseInt(_0x5e39c1(0x127))/0x3+-parseInt(_0x5e39c1(0x139))/0x4*(parseInt(_0x5e39c1(0x12e))/0x5)+parseInt(_0x5e39c1(0x13d))/0x6*(parseInt(_0x5e39c1(0x12f))/0x7)+parseInt(_0x5e39c1(0x12c))/0x8*(-parseInt(_0x5e39c1(0x136))/0x9)+-parseInt(_0x5e39c1(0x137))/0xa*(-parseInt(_0x5e39c1(0x131))/0xb);if(_0x4f050f===_0x1083de)break;else _0x2845fa['push'](_0x2845fa['shift']());}catch(_0x3d6c53){_0x2845fa['push'](_0x2845fa['shift']());}}}(a16_0x4f79,0x1a86c));export const CODE_FLAG={'name':a16_0x551c54(0x134),'type':a16_0x551c54(0x125),'required':!![],'description':a16_0x551c54(0x138),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a16_0x551c54(0x126)}};export const SQLCODE_FLAG={'name':a16_0x551c54(0x12d),'type':'string','required':!![],'description':a16_0x551c54(0x13b),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':'SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)'}};export const VERBOSE_FLAG={'name':a16_0x551c54(0x13a),'type':a16_0x551c54(0x12a),'description':a16_0x551c54(0x12b)};export const PARAMS_FLAG={'name':a16_0x551c54(0x135),'type':'string','description':a16_0x551c54(0x133)};export const NAME_FLAG={'name':a16_0x551c54(0x128),'type':a16_0x551c54(0x125),'description':a16_0x551c54(0x132)};export const ID_FLAG={'name':'id','type':'number','required':!![],'description':a16_0x551c54(0x129)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a17_0x2c75(_0x59f670,_0x1dc1a2){_0x59f670=_0x59f670-0x1db;const _0x2dd2b3=a17_0x2dd2();let _0x2c7514=_0x2dd2b3[_0x59f670];return _0x2c7514;}const a17_0x1a2123=a17_0x2c75;(function(_0x2f303b,_0x43c7fe){const _0x185004=a17_0x2c75,_0x234c2f=_0x2f303b();while(!![]){try{const _0x4ad391=parseInt(_0x185004(0x200))/0x1+-parseInt(_0x185004(0x217))/0x2*(-parseInt(_0x185004(0x20d))/0x3)+-parseInt(_0x185004(0x1e9))/0x4+parseInt(_0x185004(0x1e6))/0x5+parseInt(_0x185004(0x1e4))/0x6+parseInt(_0x185004(0x20f))/0x7+-parseInt(_0x185004(0x1ff))/0x8;if(_0x4ad391===_0x43c7fe)break;else _0x234c2f['push'](_0x234c2f['shift']());}catch(_0x237f10){_0x234c2f['push'](_0x234c2f['shift']());}}}(a17_0x2dd2,0x57044));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';function a17_0x2dd2(){const _0x1e650f=['\x22\x20not\x20found\x20at\x20top\x20level.','\x20config\x20get\x20<key>','Usage:\x20','Set\x20a\x20config\x20value','Key\x20not\x20found:\x20','riskLevel','pageSize\x20must\x20be\x20a\x20positive\x20number','length','\x20\x20global:\x20\x20','Missing\x20key\x20argument.','Missing\x20key\x20or\x20value.','Deleted\x20`','field','log','validation','bool','keys','appcode','isArray','6399824UlIhYq','635727xWYdnw',';\x20apps.<alias>.appcode','args','pretty','apps','list','raw','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','\x22.\x20Allowed:\x20','includes','config','key','\x20config\x20set\x20<key>\x20<value>\x20[--global]','1923NkZNgM','Settable\x20keys:\x20','2056222jOMEXN','value','read','get','Delete\x20a\x20config\x20value','(none)','List\x20current\x20config','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','10qYSZZv','\x20(global)','delete','stringify','object','Invalid\x20value\x20for\x20\x22','Set\x20`','pageSize','global','project-or-global-explicit','alias','1335810EYAbhG','../../context.js','1839015IcnnAl','\x20config\x20delete\x20<key>\x20[--global]','split','1466872HwEoBb','Write\x20to\x20global\x20config','trim'];a17_0x2dd2=function(){return _0x1e650f;};return a17_0x2dd2();}import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':a17_0x1a2123(0x1e1),'type':'boolean','description':a17_0x1a2123(0x1ea),'default':![]};function parseAliasAppcodeSetKey(_0xd95110){const _0x59b381=a17_0x1a2123,_0x44ac1b=_0xd95110['split']('.');if(_0x44ac1b[_0x59b381(0x1f3)]!==0x3||_0x44ac1b[0x0]!==_0x59b381(0x204)||_0x44ac1b[0x2]!==_0x59b381(0x1fd))return undefined;const _0xa22491=_0x44ac1b[0x1]?.[_0x59b381(0x1eb)]();return _0xa22491?_0xa22491:undefined;}function parseAliasDeleteKey(_0x366551){const _0x153896=a17_0x1a2123,_0x51064e=_0x366551[_0x153896(0x1e8)]('.');if(_0x51064e[_0x153896(0x1f3)]===0x2&&_0x51064e[0x0]===_0x153896(0x204)){const _0x4fe48c=_0x51064e[0x1]?.[_0x153896(0x1eb)]();return _0x4fe48c?{'alias':_0x4fe48c}:undefined;}if(_0x51064e['length']===0x3&&_0x51064e[0x0]===_0x153896(0x204)&&_0x51064e[0x2]===_0x153896(0x1fd)){const _0x31b05e=_0x51064e[0x1]?.[_0x153896(0x1eb)]();return _0x31b05e?{'alias':_0x31b05e,'field':_0x153896(0x1fd)}:undefined;}return undefined;}function setLocalAppAlias(_0xb59fbc,_0x2ff48a,_0x3e012f){const _0x57fb7a=a17_0x1a2123,_0x554d53=_0xb59fbc[_0x57fb7a(0x204)]&&typeof _0xb59fbc[_0x57fb7a(0x204)]==='object'&&!Array[_0x57fb7a(0x1fe)](_0xb59fbc[_0x57fb7a(0x204)])?_0xb59fbc[_0x57fb7a(0x204)]:{},_0x51b383=_0x554d53[_0x2ff48a]&&typeof _0x554d53[_0x2ff48a]===_0x57fb7a(0x1dd)&&!Array[_0x57fb7a(0x1fe)](_0x554d53[_0x2ff48a])?_0x554d53[_0x2ff48a]:{};_0x51b383[_0x57fb7a(0x1fd)]=_0x3e012f,_0x554d53[_0x2ff48a]=_0x51b383,_0xb59fbc[_0x57fb7a(0x204)]=_0x554d53;}function deleteLocalAppAlias(_0xa32e48,_0x4124fa){const _0x34cb79=a17_0x1a2123;if(!_0xa32e48[_0x34cb79(0x204)]||typeof _0xa32e48[_0x34cb79(0x204)]!==_0x34cb79(0x1dd)||Array[_0x34cb79(0x1fe)](_0xa32e48[_0x34cb79(0x204)]))return![];const _0x4d795e=_0xa32e48[_0x34cb79(0x204)],_0x4f3928=_0x4d795e[_0x4124fa[_0x34cb79(0x1e3)]];if(!_0x4f3928||typeof _0x4f3928!==_0x34cb79(0x1dd)||Array[_0x34cb79(0x1fe)](_0x4f3928))return![];if(!_0x4124fa[_0x34cb79(0x1f8)])return delete _0x4d795e[_0x4124fa[_0x34cb79(0x1e3)]],!![];if(!(_0x4124fa[_0x34cb79(0x1f8)]in _0x4f3928))return![];return delete _0x4f3928[_0x4124fa[_0x34cb79(0x1f8)]],Object[_0x34cb79(0x1fc)](_0x4f3928)[_0x34cb79(0x1f3)]===0x0&&delete _0x4d795e[_0x4124fa[_0x34cb79(0x1e3)]],!![];}const listDef={'service':a17_0x1a2123(0x20a),'command':a17_0x1a2123(0x205),'description':a17_0x1a2123(0x215),'risk':a17_0x1a2123(0x211),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x2c9fb1){const _0xeb6929=a17_0x1a2123,{buildConfigFromFlags:_0x5325fe}=await import(_0xeb6929(0x1e5)),_0x33fb50=_0x5325fe({}),_0x42183b=getProjectConfigPath(),_0x1a6b75=resolveWriteConfigPath(_0xeb6929(0x1e1));if(_0x2c9fb1['format']===_0xeb6929(0x203))return{'ok':!![],'message':'#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a'+(JSON['stringify'](_0x33fb50[_0xeb6929(0x206)],null,0x2)+'\x0a\x0a')+'Config\x20files:\x0a'+('\x20\x20project:\x20'+(_0x42183b??_0xeb6929(0x214))+'\x0a')+(_0xeb6929(0x1f4)+_0x1a6b75)};return{'ok':!![],'data':{'effective':_0x33fb50[_0xeb6929(0x206)],'configFiles':{'project':_0x42183b??null,'global':_0x1a6b75}}};}},getDef={'service':a17_0x1a2123(0x20a),'command':a17_0x1a2123(0x212),'description':'Get\x20a\x20config\x20value','risk':a17_0x1a2123(0x211),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':a17_0x1a2123(0x207),'required':!![]}],'flags':[],async 'execute'(_0x1e692b){const _0x4479b7=a17_0x1a2123,_0x449cbc=_0x1e692b['args'][0x0];if(!_0x449cbc)throw CliErrors[_0x4479b7(0x1fa)](_0x4479b7(0x1f5),_0x4479b7(0x1ee)+CLI_BIN_NAME+_0x4479b7(0x1ed));const {buildConfigFromFlags:_0xa711ab}=await import('../../context.js'),{raw:_0x598300}=_0xa711ab({});if(_0x449cbc['includes']('.')){const _0x506c87=_0x449cbc[_0x4479b7(0x1e8)]('.');let _0x258c73=_0x598300;for(const _0x239e18 of _0x506c87){if(_0x258c73==null||typeof _0x258c73!==_0x4479b7(0x1dd))throw CliErrors[_0x4479b7(0x1fa)](_0x4479b7(0x1f0)+_0x449cbc);_0x258c73=_0x258c73[_0x239e18];}if(_0x258c73===undefined)throw CliErrors[_0x4479b7(0x1fa)](_0x4479b7(0x1f0)+_0x449cbc);return console[_0x4479b7(0x1f9)](typeof _0x258c73===_0x4479b7(0x1dd)?JSON[_0x4479b7(0x1dc)](_0x258c73,null,0x2):String(_0x258c73)),{'ok':!![]};}const _0x578dcc=_0x598300[_0x449cbc];if(_0x578dcc===undefined)throw CliErrors['validation'](_0x4479b7(0x1f0)+_0x449cbc);return console[_0x4479b7(0x1f9)](typeof _0x578dcc===_0x4479b7(0x1dd)?JSON['stringify'](_0x578dcc,null,0x2):String(_0x578dcc)),{'ok':!![]};}},setDef={'service':a17_0x1a2123(0x20a),'command':'set','description':a17_0x1a2123(0x1ef),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]},{'name':a17_0x1a2123(0x210),'description':'Value\x20to\x20assign','required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x163f3e){const _0x342bc3=a17_0x1a2123,_0x21198b=_0x163f3e[_0x342bc3(0x202)][0x0],_0x38bd92=_0x163f3e['args'][0x1];if(!_0x21198b||_0x38bd92===undefined)throw CliErrors['validation'](_0x342bc3(0x1f6),_0x342bc3(0x1ee)+CLI_BIN_NAME+_0x342bc3(0x20c));if(ENUM_KEYS[_0x21198b]&&!ENUM_KEYS[_0x21198b][_0x342bc3(0x209)](_0x38bd92))throw CliErrors['validation'](_0x342bc3(0x1de)+_0x21198b+_0x342bc3(0x208)+ENUM_KEYS[_0x21198b]['join'](',\x20'));if(_0x21198b===_0x342bc3(0x1f1))throw CliErrors[_0x342bc3(0x1fa)](_0x342bc3(0x216));if(_0x21198b===_0x342bc3(0x1e0)){const _0x4fe772=Number(_0x38bd92);if(isNaN(_0x4fe772)||_0x4fe772<=0x0)throw CliErrors['validation'](_0x342bc3(0x1f2));}const _0x5a36fa=resolveWriteScope({'explicitGlobal':_0x163f3e[_0x342bc3(0x1fb)]('global'),'policy':_0x342bc3(0x1e2)}),_0x50e595=toScopeFlags(_0x5a36fa),_0x46a6fd=readScopedConfig(_0x50e595),_0x3cbb6e=parseAliasAppcodeSetKey(_0x21198b);if(!_0x3cbb6e&&!isTopLevelConfigKey(_0x21198b))throw CliErrors[_0x342bc3(0x1fa)]('Top-level\x20key\x20\x22'+_0x21198b+'\x22\x20is\x20not\x20settable.',_0x342bc3(0x20e)+getTopLevelConfigKeySummary()+_0x342bc3(0x201));return _0x3cbb6e?setLocalAppAlias(_0x46a6fd,_0x3cbb6e,_0x38bd92):_0x46a6fd[_0x21198b]=_0x21198b===_0x342bc3(0x1e0)?Number(_0x38bd92):_0x38bd92,console[_0x342bc3(0x1f9)](_0x342bc3(0x1df)+_0x21198b+'`\x20=\x20\x22'+_0x38bd92+'\x22'+(_0x5a36fa==='global'?_0x342bc3(0x218):'')),writeScopedConfig(_0x46a6fd,_0x50e595),{'ok':!![]};}},deleteDef={'service':'config','command':a17_0x1a2123(0x1db),'description':a17_0x1a2123(0x213),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a17_0x1a2123(0x20b),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x339c7d){const _0x3e0355=a17_0x1a2123,_0x27ce2b=_0x339c7d[_0x3e0355(0x202)][0x0];if(!_0x27ce2b)throw CliErrors['validation'](_0x3e0355(0x1f5),_0x3e0355(0x1ee)+CLI_BIN_NAME+_0x3e0355(0x1e7));const _0x3193ee=resolveWriteScope({'explicitGlobal':_0x339c7d[_0x3e0355(0x1fb)](_0x3e0355(0x1e1)),'policy':_0x3e0355(0x1e2)}),_0x447a0f=toScopeFlags(_0x3193ee),_0x43a08f=readScopedConfig(_0x447a0f),_0x4d5d14=parseAliasDeleteKey(_0x27ce2b);if(_0x4d5d14){if(!deleteLocalAppAlias(_0x43a08f,_0x4d5d14))throw CliErrors['validation'](_0x3e0355(0x1f0)+_0x27ce2b);return console[_0x3e0355(0x1f9)](_0x3e0355(0x1f7)+_0x27ce2b+'`'+(_0x3193ee==='global'?_0x3e0355(0x218):'')),writeScopedConfig(_0x43a08f,_0x447a0f),{'ok':!![]};}if(_0x43a08f[_0x27ce2b]===undefined)throw CliErrors[_0x3e0355(0x1fa)]('Key\x20\x22'+_0x27ce2b+_0x3e0355(0x1ec));return delete _0x43a08f[_0x27ce2b],console[_0x3e0355(0x1f9)]('Deleted\x20`'+_0x27ce2b+'`'+(_0x3193ee===_0x3e0355(0x1e1)?_0x3e0355(0x218):'')),writeScopedConfig(_0x43a08f,_0x447a0f),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
1
|
+
const a17_0x2bbd9f=a17_0xe984;(function(_0x1a47c7,_0x10f417){const _0x2888a8=a17_0xe984,_0x1209c2=_0x1a47c7();while(!![]){try{const _0x2f021a=-parseInt(_0x2888a8(0x119))/0x1+-parseInt(_0x2888a8(0xd6))/0x2*(-parseInt(_0x2888a8(0x114))/0x3)+-parseInt(_0x2888a8(0xeb))/0x4+parseInt(_0x2888a8(0x113))/0x5*(parseInt(_0x2888a8(0x107))/0x6)+parseInt(_0x2888a8(0xd8))/0x7+parseInt(_0x2888a8(0xf2))/0x8+parseInt(_0x2888a8(0xdb))/0x9;if(_0x2f021a===_0x10f417)break;else _0x1209c2['push'](_0x1209c2['shift']());}catch(_0x31d058){_0x1209c2['push'](_0x1209c2['shift']());}}}(a17_0x3dfd,0x7a2b8));function a17_0xe984(_0x3bd285,_0x337608){_0x3bd285=_0x3bd285-0xd6;const _0x3dfd5d=a17_0x3dfd();let _0xe98443=_0x3dfd5d[_0x3bd285];return _0xe98443;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':a17_0x2bbd9f(0xff),'type':a17_0x2bbd9f(0x109),'description':a17_0x2bbd9f(0x10a),'default':![]};function parseAliasAppcodeSetKey(_0x5388d8){const _0x2effcc=a17_0x2bbd9f,_0x4464c6=_0x5388d8[_0x2effcc(0x118)]('.');if(_0x4464c6[_0x2effcc(0xfe)]!==0x3||_0x4464c6[0x0]!==_0x2effcc(0xfc)||_0x4464c6[0x2]!==_0x2effcc(0xfb))return undefined;const _0xb93760=_0x4464c6[0x1]?.[_0x2effcc(0xe9)]();return _0xb93760?_0xb93760:undefined;}function a17_0x3dfd(){const _0x4d22d2=['3915lrCzMn','1461087VcLKgw','pretty','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','split','820791jutlAQ','2cywdEV','Key\x20not\x20found:\x20','6230147KkwUOR','Top-level\x20key\x20\x22','\x20\x20project:\x20','3969324qUdDjd','Deleted\x20`','read','field','Set\x20a\x20config\x20value','args','\x20\x20global:\x20\x20','alias','validation','pageSize\x20must\x20be\x20a\x20positive\x20number','\x20config\x20delete\x20<key>\x20[--global]','key','value','Missing\x20key\x20argument.','trim','pageSize','3913188wDIrbP','Value\x20to\x20assign','\x20(global)','\x20config\x20set\x20<key>\x20<value>\x20[--global]','write','isArray','\x22.\x20Allowed:\x20','3412800cFHdza','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','object','raw','Set\x20`','Key\x20\x22','bool','../../context.js','Missing\x20key\x20or\x20value.','appcode','apps','Settable\x20keys:\x20','length','global','\x20config\x20get\x20<key>','Usage:\x20','includes','join','log','keys','Delete\x20a\x20config\x20value','420lDnMBv','Get\x20a\x20config\x20value','boolean','Write\x20to\x20global\x20config','stringify','`\x20=\x20\x22','config','project-or-global-explicit','List\x20current\x20config','(none)','set','\x22\x20not\x20found\x20at\x20top\x20level.'];a17_0x3dfd=function(){return _0x4d22d2;};return a17_0x3dfd();}function parseAliasDeleteKey(_0x1ccf84){const _0x1ad723=a17_0x2bbd9f,_0x2541e2=_0x1ccf84['split']('.');if(_0x2541e2[_0x1ad723(0xfe)]===0x2&&_0x2541e2[0x0]===_0x1ad723(0xfc)){const _0x517c68=_0x2541e2[0x1]?.[_0x1ad723(0xe9)]();return _0x517c68?{'alias':_0x517c68}:undefined;}if(_0x2541e2[_0x1ad723(0xfe)]===0x3&&_0x2541e2[0x0]===_0x1ad723(0xfc)&&_0x2541e2[0x2]===_0x1ad723(0xfb)){const _0x2d955b=_0x2541e2[0x1]?.[_0x1ad723(0xe9)]();return _0x2d955b?{'alias':_0x2d955b,'field':_0x1ad723(0xfb)}:undefined;}return undefined;}function setLocalAppAlias(_0x421c89,_0x49163a,_0x1d1fe4){const _0x5057b9=a17_0x2bbd9f,_0x51365d=_0x421c89[_0x5057b9(0xfc)]&&typeof _0x421c89['apps']==='object'&&!Array[_0x5057b9(0xf0)](_0x421c89[_0x5057b9(0xfc)])?_0x421c89['apps']:{},_0x103ce6=_0x51365d[_0x49163a]&&typeof _0x51365d[_0x49163a]==='object'&&!Array[_0x5057b9(0xf0)](_0x51365d[_0x49163a])?_0x51365d[_0x49163a]:{};_0x103ce6[_0x5057b9(0xfb)]=_0x1d1fe4,_0x51365d[_0x49163a]=_0x103ce6,_0x421c89[_0x5057b9(0xfc)]=_0x51365d;}function deleteLocalAppAlias(_0x391b88,_0x2663e0){const _0x12f64f=a17_0x2bbd9f;if(!_0x391b88[_0x12f64f(0xfc)]||typeof _0x391b88[_0x12f64f(0xfc)]!=='object'||Array['isArray'](_0x391b88[_0x12f64f(0xfc)]))return![];const _0x8022f6=_0x391b88[_0x12f64f(0xfc)],_0x1c479a=_0x8022f6[_0x2663e0['alias']];if(!_0x1c479a||typeof _0x1c479a!==_0x12f64f(0xf4)||Array[_0x12f64f(0xf0)](_0x1c479a))return![];if(!_0x2663e0['field'])return delete _0x8022f6[_0x2663e0[_0x12f64f(0xe2)]],!![];if(!(_0x2663e0[_0x12f64f(0xde)]in _0x1c479a))return![];return delete _0x1c479a[_0x2663e0[_0x12f64f(0xde)]],Object[_0x12f64f(0x105)](_0x1c479a)['length']===0x0&&delete _0x8022f6[_0x2663e0[_0x12f64f(0xe2)]],!![];}const listDef={'service':'config','command':'list','description':a17_0x2bbd9f(0x10f),'risk':a17_0x2bbd9f(0xdd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x485e23){const _0x355a0f=a17_0x2bbd9f,{buildConfigFromFlags:_0xf1a956}=await import('../../context.js'),_0x595665=_0xf1a956({}),_0x53bf25=getProjectConfigPath(),_0x5d7b92=resolveWriteConfigPath(_0x355a0f(0xff));if(_0x485e23['format']===_0x355a0f(0x115))return{'ok':!![],'message':_0x355a0f(0xf3)+(JSON[_0x355a0f(0x10b)](_0x595665[_0x355a0f(0xf5)],null,0x2)+'\x0a\x0a')+'Config\x20files:\x0a'+(_0x355a0f(0xda)+(_0x53bf25??_0x355a0f(0x110))+'\x0a')+(_0x355a0f(0xe1)+_0x5d7b92)};return{'ok':!![],'data':{'effective':_0x595665[_0x355a0f(0xf5)],'configFiles':{'project':_0x53bf25??null,'global':_0x5d7b92}}};}},getDef={'service':a17_0x2bbd9f(0x10d),'command':'get','description':a17_0x2bbd9f(0x108),'risk':a17_0x2bbd9f(0xdd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':a17_0x2bbd9f(0x116),'required':!![]}],'flags':[],async 'execute'(_0x3a6dd2){const _0x4832fe=a17_0x2bbd9f,_0x49bc5e=_0x3a6dd2[_0x4832fe(0xe0)][0x0];if(!_0x49bc5e)throw CliErrors['validation'](_0x4832fe(0xe8),_0x4832fe(0x101)+CLI_BIN_NAME+_0x4832fe(0x100));const {buildConfigFromFlags:_0x57d213}=await import(_0x4832fe(0xf9)),{raw:_0x2c4414}=_0x57d213({});if(_0x49bc5e[_0x4832fe(0x102)]('.')){const _0x2d421d=_0x49bc5e[_0x4832fe(0x118)]('.');let _0x2cfbca=_0x2c4414;for(const _0x185deb of _0x2d421d){if(_0x2cfbca==null||typeof _0x2cfbca!==_0x4832fe(0xf4))throw CliErrors[_0x4832fe(0xe3)](_0x4832fe(0xd7)+_0x49bc5e);_0x2cfbca=_0x2cfbca[_0x185deb];}if(_0x2cfbca===undefined)throw CliErrors[_0x4832fe(0xe3)](_0x4832fe(0xd7)+_0x49bc5e);return console[_0x4832fe(0x104)](typeof _0x2cfbca===_0x4832fe(0xf4)?JSON[_0x4832fe(0x10b)](_0x2cfbca,null,0x2):String(_0x2cfbca)),{'ok':!![]};}const _0x21f83d=_0x2c4414[_0x49bc5e];if(_0x21f83d===undefined)throw CliErrors[_0x4832fe(0xe3)](_0x4832fe(0xd7)+_0x49bc5e);return console[_0x4832fe(0x104)](typeof _0x21f83d===_0x4832fe(0xf4)?JSON['stringify'](_0x21f83d,null,0x2):String(_0x21f83d)),{'ok':!![]};}},setDef={'service':'config','command':a17_0x2bbd9f(0x111),'description':a17_0x2bbd9f(0xdf),'risk':a17_0x2bbd9f(0xef),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]},{'name':a17_0x2bbd9f(0xe7),'description':a17_0x2bbd9f(0xec),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x15054d){const _0x5468a4=a17_0x2bbd9f,_0x213296=_0x15054d[_0x5468a4(0xe0)][0x0],_0x355fc8=_0x15054d[_0x5468a4(0xe0)][0x1];if(!_0x213296||_0x355fc8===undefined)throw CliErrors[_0x5468a4(0xe3)](_0x5468a4(0xfa),_0x5468a4(0x101)+CLI_BIN_NAME+_0x5468a4(0xee));if(ENUM_KEYS[_0x213296]&&!ENUM_KEYS[_0x213296]['includes'](_0x355fc8))throw CliErrors['validation']('Invalid\x20value\x20for\x20\x22'+_0x213296+_0x5468a4(0xf1)+ENUM_KEYS[_0x213296][_0x5468a4(0x103)](',\x20'));if(_0x213296==='riskLevel')throw CliErrors['validation'](_0x5468a4(0x117));if(_0x213296===_0x5468a4(0xea)){const _0x1e9698=Number(_0x355fc8);if(isNaN(_0x1e9698)||_0x1e9698<=0x0)throw CliErrors[_0x5468a4(0xe3)](_0x5468a4(0xe4));}const _0x460a44=resolveWriteScope({'explicitGlobal':_0x15054d['bool'](_0x5468a4(0xff)),'policy':_0x5468a4(0x10e)}),_0x431df0=toScopeFlags(_0x460a44),_0xed9a31=readScopedConfig(_0x431df0),_0x485771=parseAliasAppcodeSetKey(_0x213296);if(!_0x485771&&!isTopLevelConfigKey(_0x213296))throw CliErrors['validation'](_0x5468a4(0xd9)+_0x213296+'\x22\x20is\x20not\x20settable.',_0x5468a4(0xfd)+getTopLevelConfigKeySummary()+';\x20apps.<alias>.appcode');return _0x485771?setLocalAppAlias(_0xed9a31,_0x485771,_0x355fc8):_0xed9a31[_0x213296]=_0x213296==='pageSize'?Number(_0x355fc8):_0x355fc8,console['log'](_0x5468a4(0xf6)+_0x213296+_0x5468a4(0x10c)+_0x355fc8+'\x22'+(_0x460a44===_0x5468a4(0xff)?_0x5468a4(0xed):'')),writeScopedConfig(_0xed9a31,_0x431df0),{'ok':!![]};}},deleteDef={'service':a17_0x2bbd9f(0x10d),'command':'delete','description':a17_0x2bbd9f(0x106),'risk':a17_0x2bbd9f(0xef),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a17_0x2bbd9f(0xe6),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x26a446){const _0x408299=a17_0x2bbd9f,_0x289106=_0x26a446[_0x408299(0xe0)][0x0];if(!_0x289106)throw CliErrors[_0x408299(0xe3)]('Missing\x20key\x20argument.','Usage:\x20'+CLI_BIN_NAME+_0x408299(0xe5));const _0x4b9df3=resolveWriteScope({'explicitGlobal':_0x26a446[_0x408299(0xf8)]('global'),'policy':_0x408299(0x10e)}),_0x5ba7ed=toScopeFlags(_0x4b9df3),_0xeb1637=readScopedConfig(_0x5ba7ed),_0x4cdcfe=parseAliasDeleteKey(_0x289106);if(_0x4cdcfe){if(!deleteLocalAppAlias(_0xeb1637,_0x4cdcfe))throw CliErrors[_0x408299(0xe3)](_0x408299(0xd7)+_0x289106);return console[_0x408299(0x104)](_0x408299(0xdc)+_0x289106+'`'+(_0x4b9df3===_0x408299(0xff)?'\x20(global)':'')),writeScopedConfig(_0xeb1637,_0x5ba7ed),{'ok':!![]};}if(_0xeb1637[_0x289106]===undefined)throw CliErrors['validation'](_0x408299(0xf7)+_0x289106+_0x408299(0x112));return delete _0xeb1637[_0x289106],console[_0x408299(0x104)](_0x408299(0xdc)+_0x289106+'`'+(_0x4b9df3===_0x408299(0xff)?_0x408299(0xed):'')),writeScopedConfig(_0xeb1637,_0x5ba7ed),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x57fd18,_0x181cdb){var _0x46c3c9=a18_0x57af,_0x5603f9=_0x57fd18();while(!![]){try{var _0x23fe23=-parseInt(_0x46c3c9(0x11a))/0x1*(-parseInt(_0x46c3c9(0x120))/0x2)+parseInt(_0x46c3c9(0x11c))/0x3*(-parseInt(_0x46c3c9(0x11f))/0x4)+parseInt(_0x46c3c9(0x125))/0x5*(parseInt(_0x46c3c9(0x123))/0x6)+parseInt(_0x46c3c9(0x11b))/0x7*(-parseInt(_0x46c3c9(0x121))/0x8)+-parseInt(_0x46c3c9(0x126))/0x9*(parseInt(_0x46c3c9(0x11e))/0xa)+-parseInt(_0x46c3c9(0x11d))/0xb*(-parseInt(_0x46c3c9(0x122))/0xc)+parseInt(_0x46c3c9(0x124))/0xd;if(_0x23fe23===_0x181cdb)break;else _0x5603f9['push'](_0x5603f9['shift']());}catch(_0x58ef94){_0x5603f9['push'](_0x5603f9['shift']());}}}(a18_0x1694,0x42adc));import{CLI_BIN_NAME}from'../../constant/cli.js';export{CLI_BIN_NAME};export{readScopedConfig,writeScopedConfig}from'../../context.js';export{resolveConfigScope as resolveWriteScope,TOP_LEVEL_CONFIG_KEYS as TOP_LEVEL_KEYS,CONFIG_ENUM_VALUES as ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey,toScopeFlags}from'../../commands/common/config-policy.js';function a18_0x57af(_0x29da85,_0x41887b){_0x29da85=_0x29da85-0x11a;var _0x1694ac=a18_0x1694();var _0x57afc0=_0x1694ac[_0x29da85];return _0x57afc0;}function a18_0x1694(){var _0x33f84d=['22HgPWNH','92230VdyPOJ','298916USVHkP','5142XmJHKr','148280KkHNcY','1543416tcIjgC','814338MYqRBl','503776kkpYAw','20EgInCr','18bAUtRb','5wFmLUw','14xJsZEf','21KzVkBT'];a18_0x1694=function(){return _0x33f84d;};return a18_0x1694();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a19_0x10ad21=a19_0x3023;(function(_0x239dcb,_0xe04334){const _0x1ed720=a19_0x3023,_0x2203fb=_0x239dcb();while(!![]){try{const _0x5a2b94=parseInt(_0x1ed720(0xf2))/0x1*(-parseInt(_0x1ed720(0xe3))/0x2)+parseInt(_0x1ed720(0x11d))/0x3*(-parseInt(_0x1ed720(0xde))/0x4)+parseInt(_0x1ed720(0x10e))/0x5+-parseInt(_0x1ed720(0xe5))/0x6+-parseInt(_0x1ed720(0xcd))/0x7*(-parseInt(_0x1ed720(0xed))/0x8)+-parseInt(_0x1ed720(0xdc))/0x9*(-parseInt(_0x1ed720(0xe2))/0xa)+parseInt(_0x1ed720(0xdd))/0xb;if(_0x5a2b94===_0xe04334)break;else _0x2203fb['push'](_0x2203fb['shift']());}catch(_0x2dd618){_0x2203fb['push'](_0x2203fb['shift']());}}}(a19_0x2558,0x303c1));import{executeData}from'../../core/sdk-client.js';function a19_0x2558(){const _0x17954f=['\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}}','Preview:\x20data\x20','paramsHint','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','31TAbHoU','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','\x20\x20EXAMPLES','helpExtra','map','str','\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\x20LOGICAL\x20COMBINATORS','code','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','POST','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','build','create','Update\x20an\x20existing\x20record','join','\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{\x22column\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','\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$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}}','batchCreate','Filter\x20dataset\x20records\x20with\x20query\x20conditions','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','\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]','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','aggregate','delete','operation','39460jVvHNj','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','read','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','data\x20','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','data','\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','\x20\x20\x20\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}}]}','risk','Get\x20a\x20single\x20record\x20by\x20ID','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','382692YiDtsb','\x20\x20AGGREGATE\x20TYPES','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','filter','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Post-aggregation\x20filters,\x20e.g.\x20[{\x22columnName\x22:\x22total\x22,\x22condition\x22:{\x22$gt\x22:1000}}]','763mhveya','\x20on\x20dataset\x20','description','command','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','\x20\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{\x22column\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','paramsRequired','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','dryRun','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{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','\x20\x20PAGINATION','write','12357ervwbC','9412887uDFEYC','4TeZsym','body','update','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','790jAtEid','21286oMpNAe','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','2059674RuaLmW','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','now','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\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','getOne','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','1928BHjsCx'];a19_0x2558=function(){return _0x17954f;};return a19_0x2558();}import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';function a19_0x3023(_0x1fbd50,_0x27ca91){_0x1fbd50=_0x1fbd50-0xcd;const _0x255842=a19_0x2558();let _0x30237c=_0x255842[_0x1fbd50];return _0x30237c;}import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a19_0x10ad21(0x120),'operation':'filter','risk':a19_0x10ad21(0x110),'paramsRequired':![],'description':a19_0x10ad21(0x107),'paramsHint':a19_0x10ad21(0xe8)+a19_0x10ad21(0xfe),'helpExtra':['\x20\x20WHERE\x20OPERATORS',a19_0x10ad21(0x104),'\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}}',a19_0x10ad21(0xf9),'\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}}',a19_0x10ad21(0xee),a19_0x10ad21(0x116),a19_0x10ad21(0x113),a19_0x10ad21(0xf4),a19_0x10ad21(0x105),'',a19_0x10ad21(0xfa),a19_0x10ad21(0x117),'\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}}]}','',a19_0x10ad21(0xfc),a19_0x10ad21(0xf3),a19_0x10ad21(0xd5),'\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}]',a19_0x10ad21(0xe9),'\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','',a19_0x10ad21(0xda),'\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.',a19_0x10ad21(0xe1),'\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)'][a19_0x10ad21(0x102)]('\x0a')},{'command':a19_0x10ad21(0xeb),'operation':'getOne','risk':a19_0x10ad21(0x110),'paramsRequired':!![],'description':a19_0x10ad21(0x119),'paramsHint':a19_0x10ad21(0x10a)},{'command':a19_0x10ad21(0x100),'operation':a19_0x10ad21(0x100),'risk':a19_0x10ad21(0xdb),'paramsRequired':!![],'description':a19_0x10ad21(0x11b),'paramsHint':a19_0x10ad21(0xe6)},{'command':a19_0x10ad21(0x106),'operation':a19_0x10ad21(0x106),'risk':a19_0x10ad21(0xdb),'paramsRequired':!![],'description':a19_0x10ad21(0xd1),'paramsHint':'JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27'},{'command':'update','operation':a19_0x10ad21(0xe0),'risk':a19_0x10ad21(0xdb),'paramsRequired':!![],'description':a19_0x10ad21(0x101),'paramsHint':a19_0x10ad21(0xd2)},{'command':a19_0x10ad21(0x10c),'operation':a19_0x10ad21(0x10c),'risk':'high-risk-write','paramsRequired':!![],'description':a19_0x10ad21(0xf1),'paramsHint':a19_0x10ad21(0x10a)},{'command':'aggregate','operation':a19_0x10ad21(0x10b),'risk':a19_0x10ad21(0x110),'paramsRequired':![],'description':a19_0x10ad21(0x11c),'paramsHint':a19_0x10ad21(0xec)+a19_0x10ad21(0xd6),'helpExtra':[a19_0x10ad21(0x11e),'\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}',a19_0x10ad21(0xd9),'\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{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}',a19_0x10ad21(0x11a),a19_0x10ad21(0x103),a19_0x10ad21(0xd3),'','\x20\x20PARAMS\x20STRUCTURE',a19_0x10ad21(0x109),'\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)',a19_0x10ad21(0x10f),a19_0x10ad21(0x11f),a19_0x10ad21(0x121),a19_0x10ad21(0xe4),'',a19_0x10ad21(0xf5),a19_0x10ad21(0x114),'\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','',a19_0x10ad21(0x111),a19_0x10ad21(0xea),'',a19_0x10ad21(0x108)][a19_0x10ad21(0x102)]('\x0a')}];function makeDataCommand(_0x2d793c){const _0x1af680=a19_0x10ad21,_0x1b1ebf=_0x1af680(0x112)+_0x2d793c[_0x1af680(0xd0)],_0x3980a3={'service':_0x1af680(0x115),'command':_0x2d793c[_0x1af680(0xd0)],'description':_0x2d793c[_0x1af680(0xcf)],'risk':_0x2d793c['risk'],'helpExtra':_0x2d793c[_0x1af680(0xf6)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x2d793c[_0x1af680(0xf0)]}],'validate':async _0x4738cc=>{const _0x5bee53=_0x1af680;_0x2d793c[_0x5bee53(0xd4)]&&requireAnyOf(_0x4738cc,[_0x5bee53(0xd8)],_0x1b1ebf),_0x2d793c[_0x5bee53(0x10d)]===_0x5bee53(0x106)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x4738cc[_0x5bee53(0xf8)](_0x5bee53(0xd8))));},async 'execute'(_0x19cf6e){const _0x3d2ca5=_0x1af680,_0x563d9a=_0x19cf6e['str'](_0x3d2ca5(0xfb)),_0x2d9cf4=_0x2d793c[_0x3d2ca5(0x10d)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x19cf6e[_0x3d2ca5(0xf8)](_0x3d2ca5(0xd8)))):parseJsonParams(_0x19cf6e['str'](_0x3d2ca5(0xd8)))??{},_0x54c74f=Date[_0x3d2ca5(0xe7)](),_0x3913dc=await executeData(_0x563d9a,_0x2d793c[_0x3d2ca5(0x10d)],_0x2d9cf4),_0x3d1bc0=Date['now']()-_0x54c74f;return{'ok':!![],'data':{'result':_0x3913dc,'elapsed':_0x3d1bc0},'message':_0x3d2ca5(0x112)+_0x2d793c['command']+'\x20completed\x20in\x20'+_0x3d1bc0+'ms'};}};return _0x2d793c[_0x1af680(0x118)]!=='read'&&(_0x3980a3[_0x1af680(0xd7)]=async _0x126b87=>{const _0x29c1d3=_0x1af680,_0x32cbad=_0x126b87[_0x29c1d3(0xf8)](_0x29c1d3(0xfb)),_0x48bffc=_0x2d793c['operation']===_0x29c1d3(0x106)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x126b87[_0x29c1d3(0xf8)](_0x29c1d3(0xd8)))):parseJsonParams(_0x126b87[_0x29c1d3(0xf8)](_0x29c1d3(0xd8)))??{};return dryRun(_0x29c1d3(0xfd),'/api/{appCode}/'+_0x32cbad+'/'+_0x2d793c['operation'])[_0x29c1d3(0xdf)](_0x48bffc)[_0x29c1d3(0xcf)](_0x29c1d3(0xef)+_0x2d793c[_0x29c1d3(0xd0)]+_0x29c1d3(0xce)+_0x32cbad)[_0x29c1d3(0xff)]();}),_0x3980a3;}export const dataDefinitions=specs[a19_0x10ad21(0xf7)](makeDataCommand);
|
|
1
|
+
const a19_0x3b228d=a19_0x38e3;(function(_0x293f44,_0x212d47){const _0xdee22f=a19_0x38e3,_0x14ffaa=_0x293f44();while(!![]){try{const _0x307c6c=-parseInt(_0xdee22f(0x119))/0x1*(parseInt(_0xdee22f(0x136))/0x2)+parseInt(_0xdee22f(0x12e))/0x3*(parseInt(_0xdee22f(0x149))/0x4)+-parseInt(_0xdee22f(0x123))/0x5+parseInt(_0xdee22f(0x148))/0x6+parseInt(_0xdee22f(0x14f))/0x7+parseInt(_0xdee22f(0x118))/0x8+parseInt(_0xdee22f(0x126))/0x9*(-parseInt(_0xdee22f(0x15b))/0xa);if(_0x307c6c===_0x212d47)break;else _0x14ffaa['push'](_0x14ffaa['shift']());}catch(_0x1fcb1a){_0x14ffaa['push'](_0x14ffaa['shift']());}}}(a19_0xf066,0x596d5));function a19_0xf066(){const _0x3d8b66=['getOne','write','132AdDMRZ','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','\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{\x22column\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','Filter\x20dataset\x20records\x20with\x20query\x20conditions','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','params','create','now','\x20\x20LOGICAL\x20COMBINATORS','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','\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]','3677316OkUleu','17332WAZnsM','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Post-aggregation\x20filters,\x20e.g.\x20[{\x22columnName\x22:\x22total\x22,\x22condition\x22:{\x22$gt\x22:1000}}]','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','join','\x20\x20PARAMS\x20STRUCTURE','\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','2657424tlQpYg','operation','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','Get\x20a\x20single\x20record\x20by\x20ID','filter','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','/api/{appCode}/','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','command','high-risk-write','\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}}','\x20on\x20dataset\x20','30gzyysb','\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','\x20\x20\x20\x20$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}}','read','\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}}','Update\x20an\x20existing\x20record','delete','\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}}','map','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','\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{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','data','4158952PwpGzx','7334SffJhw','helpExtra','description','build','code','dryRun','risk','str','batchCreate','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','1672370yPOsBx','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','\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{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','2815587WkjDjr','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','\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}}','update','\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','423lJESlm','Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','paramsRequired','\x20\x20EXAMPLES'];a19_0xf066=function(){return _0x3d8b66;};return a19_0xf066();}function a19_0x38e3(_0x156e44,_0xb22e5b){_0x156e44=_0x156e44-0x118;const _0xf06673=a19_0xf066();let _0x38e3ac=_0xf06673[_0x156e44];return _0x38e3ac;}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':'filter','operation':a19_0x3b228d(0x153),'risk':a19_0x3b228d(0x15e),'paramsRequired':![],'description':a19_0x3b228d(0x13c),'paramsHint':a19_0x3b228d(0x164)+'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}}','\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}}',a19_0x3b228d(0x15d),a19_0x3b228d(0x12b),a19_0x3b228d(0x162),a19_0x3b228d(0x159),'\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]}}',a19_0x3b228d(0x15f),a19_0x3b228d(0x15c),a19_0x3b228d(0x129),'',a19_0x3b228d(0x143),'\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}}]}',a19_0x3b228d(0x145),'',a19_0x3b228d(0x127),a19_0x3b228d(0x156),a19_0x3b228d(0x147),a19_0x3b228d(0x130),a19_0x3b228d(0x13e),a19_0x3b228d(0x128),'','\x20\x20PAGINATION',a19_0x3b228d(0x139),'\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)'][a19_0x3b228d(0x14c)]('\x0a')},{'command':a19_0x3b228d(0x134),'operation':a19_0x3b228d(0x134),'risk':a19_0x3b228d(0x15e),'paramsRequired':!![],'description':a19_0x3b228d(0x152),'paramsHint':a19_0x3b228d(0x12c)},{'command':a19_0x3b228d(0x141),'operation':a19_0x3b228d(0x141),'risk':a19_0x3b228d(0x135),'paramsRequired':!![],'description':'Create\x20a\x20new\x20record\x20in\x20a\x20dataset','paramsHint':'JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27'},{'command':a19_0x3b228d(0x121),'operation':'batchCreate','risk':a19_0x3b228d(0x135),'paramsRequired':!![],'description':a19_0x3b228d(0x124),'paramsHint':a19_0x3b228d(0x12d)},{'command':a19_0x3b228d(0x12a),'operation':a19_0x3b228d(0x12a),'risk':'write','paramsRequired':!![],'description':a19_0x3b228d(0x160),'paramsHint':a19_0x3b228d(0x154)},{'command':a19_0x3b228d(0x161),'operation':'delete','risk':a19_0x3b228d(0x158),'paramsRequired':!![],'description':a19_0x3b228d(0x122),'paramsHint':a19_0x3b228d(0x12c)},{'command':'aggregate','operation':'aggregate','risk':a19_0x3b228d(0x15e),'paramsRequired':![],'description':a19_0x3b228d(0x151),'paramsHint':a19_0x3b228d(0x13d)+a19_0x3b228d(0x12f),'helpExtra':['\x20\x20AGGREGATE\x20TYPES',a19_0x3b228d(0x14e),'\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}',a19_0x3b228d(0x165),a19_0x3b228d(0x125),a19_0x3b228d(0x13a),a19_0x3b228d(0x138),'',a19_0x3b228d(0x14d),'\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]',a19_0x3b228d(0x14b),a19_0x3b228d(0x146),a19_0x3b228d(0x13b),a19_0x3b228d(0x14a),a19_0x3b228d(0x131),'',a19_0x3b228d(0x133),'\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status',a19_0x3b228d(0x144),'',a19_0x3b228d(0x137),'\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\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','',a19_0x3b228d(0x13f)][a19_0x3b228d(0x14c)]('\x0a')}];function makeDataCommand(_0x2f58b6){const _0x5b6d15=a19_0x3b228d,_0x39ea0a='data\x20'+_0x2f58b6[_0x5b6d15(0x157)],_0x34e39d={'service':_0x5b6d15(0x166),'command':_0x2f58b6[_0x5b6d15(0x157)],'description':_0x2f58b6[_0x5b6d15(0x11b)],'risk':_0x2f58b6[_0x5b6d15(0x11f)],'helpExtra':_0x2f58b6[_0x5b6d15(0x11a)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x2f58b6['paramsHint']}],'validate':async _0x132bc9=>{const _0x1e9f4c=_0x5b6d15;_0x2f58b6[_0x1e9f4c(0x132)]&&requireAnyOf(_0x132bc9,[_0x1e9f4c(0x140)],_0x39ea0a),_0x2f58b6['operation']==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x132bc9[_0x1e9f4c(0x120)](_0x1e9f4c(0x140))));},async 'execute'(_0x5064f1){const _0x46cb44=_0x5b6d15,_0x302746=_0x5064f1[_0x46cb44(0x120)](_0x46cb44(0x11d)),_0x38f021=_0x2f58b6[_0x46cb44(0x150)]===_0x46cb44(0x121)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x5064f1[_0x46cb44(0x120)](_0x46cb44(0x140)))):parseJsonParams(_0x5064f1[_0x46cb44(0x120)](_0x46cb44(0x140)))??{},_0x22e455=Date[_0x46cb44(0x142)](),_0x2ff486=await executeData(_0x302746,_0x2f58b6[_0x46cb44(0x150)],_0x38f021),_0x16bc41=Date[_0x46cb44(0x142)]()-_0x22e455;return{'ok':!![],'data':{'result':_0x2ff486,'elapsed':_0x16bc41},'message':'data\x20'+_0x2f58b6[_0x46cb44(0x157)]+'\x20completed\x20in\x20'+_0x16bc41+'ms'};}};return _0x2f58b6[_0x5b6d15(0x11f)]!==_0x5b6d15(0x15e)&&(_0x34e39d[_0x5b6d15(0x11e)]=async _0x35f032=>{const _0x2681f2=_0x5b6d15,_0x48e190=_0x35f032[_0x2681f2(0x120)](_0x2681f2(0x11d)),_0x379f01=_0x2f58b6['operation']==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x35f032['str'](_0x2681f2(0x140)))):parseJsonParams(_0x35f032['str'](_0x2681f2(0x140)))??{};return dryRun('POST',_0x2681f2(0x155)+_0x48e190+'/'+_0x2f58b6[_0x2681f2(0x150)])['body'](_0x379f01)[_0x2681f2(0x11b)]('Preview:\x20data\x20'+_0x2f58b6[_0x2681f2(0x157)]+_0x2681f2(0x15a)+_0x48e190)[_0x2681f2(0x11c)]();}),_0x34e39d;}export const dataDefinitions=specs[a19_0x3b228d(0x163)](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a20_0x14df(){const _0x136853=['trim','displayName','name','required','length','fields','validateRules','afterScriptId','options','doVersion','string','relations','allFields','sourceType','datasetKey','7947kUQrra','type','doType','method','path','dbName','isArray','dataType','161afmFKe','labelField','116886wlAqVL','toField','split','dblinkInfoDTO','object','appCode','pkField','deleted','host','title','str','dbtableConfig','updateTimeField','dataset','modelId','15058OZMAif','source','fromField','tableName','toFieldLabel','dbId','responseFields','parse','12318383RpuKvx','description','111twMUEr','code','modelCode','2557595mKGSBU','modifierIdField','indexes','extend','37236DeXOSg','operations','map','find','beforeScriptId','1882990ZOApOe','requestBody','requestFields','toDatasetCode','6120TsnSlK','183MSxYoK','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','formatRules','properties','entries','filter','responseBody'];a20_0x14df=function(){return _0x136853;};return a20_0x14df();}const a20_0x251e52=a20_0x391c;(function(_0x3d8fc2,_0x4d98d9){const _0x5dbec5=a20_0x391c,_0x50cfa6=_0x3d8fc2();while(!![]){try{const _0x1bd52b=parseInt(_0x5dbec5(0x199))/0x1*(-parseInt(_0x5dbec5(0x18f))/0x2)+parseInt(_0x5dbec5(0x160))/0x3*(parseInt(_0x5dbec5(0x156))/0x4)+parseInt(_0x5dbec5(0x152))/0x5+-parseInt(_0x5dbec5(0x180))/0x6*(parseInt(_0x5dbec5(0x17e))/0x7)+-parseInt(_0x5dbec5(0x15f))/0x8*(parseInt(_0x5dbec5(0x176))/0x9)+parseInt(_0x5dbec5(0x15b))/0xa+parseInt(_0x5dbec5(0x197))/0xb;if(_0x1bd52b===_0x4d98d9)break;else _0x50cfa6['push'](_0x50cfa6['shift']());}catch(_0x557747){_0x50cfa6['push'](_0x50cfa6['shift']());}}}(a20_0x14df,0x688d3));import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x51693a){const _0x1200f2=a20_0x391c;if(_0x51693a[_0x1200f2(0x187)])return null;const _0x50184b=Boolean(_0x51693a[_0x1200f2(0x168)]!==undefined||_0x51693a[_0x1200f2(0x178)]!==undefined);let _0x4a84b4={};if(!_0x50184b&&typeof _0x51693a[_0x1200f2(0x155)]===_0x1200f2(0x171))try{_0x4a84b4=JSON[_0x1200f2(0x196)](_0x51693a[_0x1200f2(0x155)]);}catch{}const _0x4e190f=_0x50184b?_0x51693a[_0x1200f2(0x169)]:_0x51693a[_0x1200f2(0x19a)],_0x3eafb0=_0x50184b?_0x51693a[_0x1200f2(0x168)]:_0x51693a[_0x1200f2(0x169)],_0x2dfcd7=_0x50184b?_0x51693a[_0x1200f2(0x178)]:_0x51693a[_0x1200f2(0x177)]||_0x51693a[_0x1200f2(0x17d)],_0x194674=_0x50184b?_0x51693a[_0x1200f2(0x186)]===!![]:_0x4a84b4[_0x1200f2(0x186)]===!![],_0x309691=_0x50184b?_0x51693a[_0x1200f2(0x16a)]===!![]:_0x4a84b4['required']===!![],_0x1d9bff=_0x50184b?_0x51693a[_0x1200f2(0x16f)]??null:_0x4a84b4['options']??null,_0x4de5d8={'name':_0x4e190f,'displayName':_0x3eafb0||_0x4e190f,'type':_0x2dfcd7,'dbType':_0x51693a['dbType'],'pk':_0x194674,'required':_0x309691,'description':_0x51693a['description']||undefined};return Array[_0x1200f2(0x17c)](_0x1d9bff)&&_0x1d9bff['length']>0x0&&(_0x4de5d8[_0x1200f2(0x16f)]=_0x1d9bff),_0x4de5d8;}function parseJsonMaybe(_0x5daf8e){const _0x58b35c=a20_0x391c;if(typeof _0x5daf8e!==_0x58b35c(0x171))return _0x5daf8e;try{return JSON['parse'](_0x5daf8e);}catch{return _0x5daf8e;}}function a20_0x391c(_0xde1f9a,_0x5654f3){_0xde1f9a=_0xde1f9a-0x152;const _0x14df80=a20_0x14df();let _0x391ccc=_0x14df80[_0xde1f9a];return _0x391ccc;}function normalizeOperationEntry(_0x49c77c,_0x3524bf){const _0x4f050c=a20_0x391c;if(!_0x3524bf||typeof _0x3524bf!==_0x4f050c(0x184))return null;if(!_0x3524bf[_0x4f050c(0x179)]||!_0x3524bf['path'])return null;const _0x380022={'name':_0x49c77c,'method':_0x3524bf[_0x4f050c(0x179)],'path':_0x3524bf[_0x4f050c(0x17a)]};if(_0x3524bf[_0x4f050c(0x188)])_0x380022[_0x4f050c(0x188)]=_0x3524bf[_0x4f050c(0x188)];if(_0x3524bf[_0x4f050c(0x15c)]!=null)_0x380022[_0x4f050c(0x15c)]=parseJsonMaybe(_0x3524bf['requestBody']);if(_0x3524bf[_0x4f050c(0x166)]!=null)_0x380022[_0x4f050c(0x166)]=parseJsonMaybe(_0x3524bf[_0x4f050c(0x166)]);if(_0x3524bf['beforeScriptId']!=null)_0x380022[_0x4f050c(0x15a)]=_0x3524bf['beforeScriptId'];if(_0x3524bf['afterScriptId']!=null)_0x380022[_0x4f050c(0x16e)]=_0x3524bf['afterScriptId'];if(Array[_0x4f050c(0x17c)](_0x3524bf[_0x4f050c(0x15d)]))_0x380022[_0x4f050c(0x15d)]=_0x3524bf['requestFields'];if(Array[_0x4f050c(0x17c)](_0x3524bf[_0x4f050c(0x195)]))_0x380022[_0x4f050c(0x195)]=_0x3524bf['responseFields'];return _0x380022;}function summarizeDbtable(_0x3fdaf8){const _0x102168=a20_0x391c,_0x1273b3={},_0x386264=[_0x102168(0x194),_0x102168(0x17b),_0x102168(0x192),_0x102168(0x175),'pkField','allFields','logicField','createTimeField',_0x102168(0x18c),'creatorIdField','creatorNameField',_0x102168(0x153),'modifierNameField',_0x102168(0x17f),_0x102168(0x183)];for(const _0x145f6d of _0x386264){if(_0x3fdaf8[_0x145f6d]!==undefined)_0x1273b3[_0x145f6d]=_0x3fdaf8[_0x145f6d];}return typeof _0x1273b3[_0x102168(0x173)]===_0x102168(0x171)&&_0x1273b3['allFields'][_0x102168(0x16b)]>0x0&&(_0x1273b3['allFieldNames']=_0x1273b3[_0x102168(0x173)]['split'](',')[_0x102168(0x158)](_0x2dfc8f=>_0x2dfc8f[_0x102168(0x167)]())['filter'](Boolean)),_0x1273b3;}function normalizeRelatedPages(_0x33793f){const _0x69d526=a20_0x391c;if(!Array[_0x69d526(0x17c)](_0x33793f))return[];return _0x33793f[_0x69d526(0x165)](_0x3547dc=>_0x3547dc&&typeof _0x3547dc===_0x69d526(0x184))[_0x69d526(0x158)](_0x3cee8f=>({'id':_0x3cee8f['id'],'type':_0x3cee8f['type'],'code':_0x3cee8f['code'],'title':_0x3cee8f[_0x69d526(0x189)],'deleted':_0x3cee8f[_0x69d526(0x187)]===!![]}));}function normalizeFallbackFieldName(_0x1f4b5d,_0x1e2a06){const _0x45abbb=_0x1f4b5d['trim']();if(!_0x45abbb)return null;return{'name':_0x45abbb,'displayName':_0x45abbb,'type':undefined,'dbType':undefined,'pk':_0x45abbb===_0x1e2a06,'required':![],'description':undefined};}async function loadListFieldFallback(_0x13e4c3,_0x53151f){const _0x16e7c5=a20_0x391c;if(!_0x13e4c3||!_0x53151f)return[];try{const _0x2833cf=await listDatasets(_0x13e4c3,{'code':_0x53151f}),_0xea78dc=_0x2833cf[_0x16e7c5(0x159)](_0x286805=>_0x286805[_0x16e7c5(0x19a)]===_0x53151f)??_0x2833cf[0x0],_0x54ca4b=_0xea78dc?.[_0x16e7c5(0x18b)]??{},_0x378f22=typeof _0x54ca4b['allFields']===_0x16e7c5(0x171)?_0x54ca4b['allFields'][_0x16e7c5(0x182)](','):[];return _0x378f22[_0x16e7c5(0x158)](_0x16b15e=>normalizeFallbackFieldName(_0x16b15e,_0x54ca4b[_0x16e7c5(0x186)]))[_0x16e7c5(0x165)](_0x2ae98c=>_0x2ae98c!==null);}catch{return[];}}export const datasetDetail={'service':a20_0x251e52(0x18d),'command':'detail','description':a20_0x251e52(0x161),'risk':'read','flags':[CODE_FLAG],async 'execute'(_0x42b01a){const _0xb84bbc=a20_0x251e52,_0x2be7fb=await getDatasetDetail(_0x42b01a[_0xb84bbc(0x18a)](_0xb84bbc(0x19a))),_0x1cae1c=Array[_0xb84bbc(0x17c)](_0x2be7fb[_0xb84bbc(0x16c)])?_0x2be7fb['fields']:Array['isArray'](_0x2be7fb[_0xb84bbc(0x163)])?_0x2be7fb['properties']:[];let _0x4779f3=_0x1cae1c['map'](_0x26be8f=>normalizeField(_0x26be8f))[_0xb84bbc(0x165)](_0x51b013=>_0x51b013!==null);_0x4779f3[_0xb84bbc(0x16b)]===0x0&&(_0x4779f3=await loadListFieldFallback(_0x42b01a[_0xb84bbc(0x185)],_0x42b01a['str']('code')));const _0x4d1bfc=_0x2be7fb[_0xb84bbc(0x157)]??{},_0x2e7398=[];for(const [_0x15dc8e,_0x32174f]of Object[_0xb84bbc(0x164)](_0x4d1bfc)){const _0x1f6f2a=normalizeOperationEntry(_0x15dc8e,_0x32174f);if(_0x1f6f2a)_0x2e7398['push'](_0x1f6f2a);}const _0x498bd9=_0x2be7fb[_0xb84bbc(0x18b)]??{},_0x3b7ab8=_0x2be7fb['dataset']??{},_0x426588=_0x498bd9[_0xb84bbc(0x194)]!=null?{'id':_0x498bd9['dbId'],'name':_0x498bd9['dbName']??null}:undefined;let _0x35cca1;return typeof _0x2be7fb[_0xb84bbc(0x155)]===_0xb84bbc(0x171)&&(_0x35cca1=parseJsonMaybe(_0x2be7fb['extend'])),{'ok':!![],'data':{'id':_0x2be7fb[_0xb84bbc(0x18e)]??_0x2be7fb['id'],'name':_0x2be7fb[_0xb84bbc(0x169)],'code':_0x2be7fb[_0xb84bbc(0x19b)]||_0x2be7fb[_0xb84bbc(0x19a)],'doVersion':_0x2be7fb[_0xb84bbc(0x170)],'description':_0x2be7fb[_0xb84bbc(0x198)]||_0x3b7ab8['tableComment']||undefined,'source':_0x2be7fb[_0xb84bbc(0x190)]||_0x3b7ab8[_0xb84bbc(0x174)],'table':_0x498bd9[_0xb84bbc(0x192)]||_0x3b7ab8[_0xb84bbc(0x192)],'datasetKey':_0x498bd9[_0xb84bbc(0x175)],'pk':_0x498bd9[_0xb84bbc(0x186)],'db':_0x426588,'dbtable':summarizeDbtable(_0x498bd9),'fields':_0x4779f3,'operations':_0x2e7398,'indexes':Array['isArray'](_0x3b7ab8[_0xb84bbc(0x154)])?_0x3b7ab8[_0xb84bbc(0x154)]:[],'relations':Array[_0xb84bbc(0x17c)](_0x2be7fb[_0xb84bbc(0x172)])?_0x2be7fb[_0xb84bbc(0x172)][_0xb84bbc(0x158)](_0x337770=>({'fromField':_0x337770[_0xb84bbc(0x191)],'toDataset':_0x337770['toDatasetName'],'toCode':_0x337770[_0xb84bbc(0x15e)],'toTable':_0x337770['toTableName'],'toField':_0x337770[_0xb84bbc(0x181)],'labelField':_0x337770[_0xb84bbc(0x193)]||undefined})):[],'relatedPages':normalizeRelatedPages(_0x2be7fb['relatedPageInfoList']),...Array[_0xb84bbc(0x17c)](_0x2be7fb['columnCodeListWithDeleted'])?{'columnCodeListWithDeleted':_0x2be7fb['columnCodeListWithDeleted']}:{},'formatRules':Array['isArray'](_0x2be7fb[_0xb84bbc(0x162)])?_0x2be7fb[_0xb84bbc(0x162)]:[],'validateRules':Array[_0xb84bbc(0x17c)](_0x2be7fb[_0xb84bbc(0x16d)])?_0x2be7fb['validateRules']:[],..._0x35cca1!==undefined?{'extend':_0x35cca1}:{},'stats':{'fieldCount':_0x4779f3[_0xb84bbc(0x16b)],'operationCount':_0x2e7398['length']}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a21_0x52a6(_0x38ab33,_0x3a37d6){_0x38ab33=_0x38ab33-0xad;const _0x334afe=a21_0x334a();let _0x52a6e8=_0x334afe[_0x38ab33];return _0x52a6e8;}(function(_0x3aff36,_0x41ef8f){const _0x1bd9b9=a21_0x52a6,_0x37ce4f=_0x3aff36();while(!![]){try{const _0x1a0121=parseInt(_0x1bd9b9(0xae))/0x1+parseInt(_0x1bd9b9(0xb5))/0x2*(-parseInt(_0x1bd9b9(0xb6))/0x3)+parseInt(_0x1bd9b9(0xaf))/0x4+-parseInt(_0x1bd9b9(0xb1))/0x5*(-parseInt(_0x1bd9b9(0xb0))/0x6)+-parseInt(_0x1bd9b9(0xb3))/0x7*(-parseInt(_0x1bd9b9(0xb4))/0x8)+-parseInt(_0x1bd9b9(0xad))/0x9*(-parseInt(_0x1bd9b9(0xb7))/0xa)+parseInt(_0x1bd9b9(0xb2))/0xb*(-parseInt(_0x1bd9b9(0xb8))/0xc);if(_0x1a0121===_0x41ef8f)break;else _0x37ce4f['push'](_0x37ce4f['shift']());}catch(_0x22bd35){_0x37ce4f['push'](_0x37ce4f['shift']());}}}(a21_0x334a,0xbfc55));import{datasetList}from'../../commands/dataset/list.js';import{datasetDetail}from'../../commands/dataset/detail.js';import{datasetSdkDoc}from'../../commands/dataset/sdk-doc.js';export const datasetDefinitions=[datasetList,datasetDetail,datasetSdkDoc];function a21_0x334a(){const _0x2276a2=['5734cKqprr','186DHROlx','50ltLpkc','12YVoMfb','284553ilRUnz','1330926sgqzIY','3197068pzpCTf','12MSmOmU','795805WyelKi','26599903NPdvPI','2660HcbFYY','16312CRKcDS'];a21_0x334a=function(){return _0x2276a2;};return a21_0x334a();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a22_0x54c165=a22_0x2ea5;(function(_0x17c233,_0x1c742e){const _0x4c5e1f=a22_0x2ea5,_0x3b7b6a=_0x17c233();while(!![]){try{const _0xf1b836=-parseInt(_0x4c5e1f(0xbd))/0x1+-parseInt(_0x4c5e1f(0xae))/0x2*(-parseInt(_0x4c5e1f(0xba))/0x3)+-parseInt(_0x4c5e1f(0xaf))/0x4+parseInt(_0x4c5e1f(0xc2))/0x5+-parseInt(_0x4c5e1f(0xb7))/0x6*(parseInt(_0x4c5e1f(0xad))/0x7)+-parseInt(_0x4c5e1f(0xc0))/0x8+parseInt(_0x4c5e1f(0xbe))/0x9;if(_0xf1b836===_0x1c742e)break;else _0x3b7b6a['push'](_0x3b7b6a['shift']());}catch(_0x2f7add){_0x3b7b6a['push'](_0x3b7b6a['shift']());}}}(a22_0x2012,0x2ae5d));import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function a22_0x2ea5(_0x3b5580,_0x2cd5ef){_0x3b5580=_0x3b5580-0xad;const _0x2012e5=a22_0x2012();let _0x2ea53f=_0x2012e5[_0x3b5580];return _0x2ea53f;}export const datasetList={'service':'dataset','command':'list','description':a22_0x54c165(0xb1),'risk':a22_0x54c165(0xb5),'flags':[{'name':'name','type':a22_0x54c165(0xb9),'description':a22_0x54c165(0xc4)},{...CODE_FLAG,'required':![],'description':a22_0x54c165(0xb4)}],async 'execute'(_0x1eb666){const _0x3fcde4=a22_0x54c165,_0x1cbb59=_0x1eb666[_0x3fcde4(0xc1)]('name'),_0x491d97=_0x1eb666[_0x3fcde4(0xc1)](_0x3fcde4(0xc3)),_0x2f6dcb=await listDatasets(_0x1eb666[_0x3fcde4(0xb2)],{..._0x1cbb59&&{'name':_0x1cbb59},..._0x491d97&&{'code':_0x491d97}});return{'ok':!![],'data':{'total':_0x2f6dcb['length'],'datasets':_0x2f6dcb[_0x3fcde4(0xbc)](_0x7143d0=>{const _0x1e05ae=_0x3fcde4,_0x4a20e1=_0x7143d0[_0x1e05ae(0xb6)]??{};return{'id':_0x7143d0['id'],'code':_0x7143d0[_0x1e05ae(0xc3)],'name':_0x7143d0['name'],'source':_0x7143d0['source'],'description':_0x7143d0[_0x1e05ae(0xbf)],'table':_0x4a20e1[_0x1e05ae(0xc5)],'datasetKey':_0x4a20e1[_0x1e05ae(0xbb)],'pk':_0x4a20e1[_0x1e05ae(0xb8)],'fields':_0x4a20e1[_0x1e05ae(0xb3)]?_0x4a20e1[_0x1e05ae(0xb3)][_0x1e05ae(0xb0)](',')[_0x1e05ae(0xbc)](_0xee9b64=>_0xee9b64['trim']()):[]};})}};}};function a22_0x2012(){const _0x26739f=['2LtJIIe','977912GlzWLR','split','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','appCode','allFields','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','read','dbtableConfig','1645062dFosSL','pkField','string','57747PNxYMm','datasetKey','map','116148nvAOFU','6224490QjtMDp','description','888472DYSIbR','str','1053560yxOikD','code','Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)','tableName','7lKYaIt'];a22_0x2012=function(){return _0x26739f;};return a22_0x2012();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x73b809=a23_0x67d2;function a23_0x5644(){const _0x41dc90=['Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','8172GADjPH','sdk-doc','#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档','17324450GWIBRx','2270331gtfxjN','string','1040mcXNni','trim','appCode','4341375aHhDkD','Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','str','1838080gvnXrq','84776MPKsDq','22gEBido','4QlGOEL','code','12VVZmYB','776217lLiJDt','dataset'];a23_0x5644=function(){return _0x41dc90;};return a23_0x5644();}(function(_0x20acd1,_0x46ed28){const _0x1ff231=a23_0x67d2,_0x54e24c=_0x20acd1();while(!![]){try{const _0x30e662=parseInt(_0x1ff231(0x15b))/0x1*(-parseInt(_0x1ff231(0x15a))/0x2)+parseInt(_0x1ff231(0x15f))/0x3*(-parseInt(_0x1ff231(0x15c))/0x4)+parseInt(_0x1ff231(0x156))/0x5+-parseInt(_0x1ff231(0x15e))/0x6*(parseInt(_0x1ff231(0x166))/0x7)+-parseInt(_0x1ff231(0x159))/0x8+-parseInt(_0x1ff231(0x162))/0x9*(-parseInt(_0x1ff231(0x153))/0xa)+parseInt(_0x1ff231(0x165))/0xb;if(_0x30e662===_0x46ed28)break;else _0x54e24c['push'](_0x54e24c['shift']());}catch(_0x1d03ef){_0x54e24c['push'](_0x54e24c['shift']());}}}(a23_0x5644,0x723f4));import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';const DEFAULT_MARKDOWN=a23_0x73b809(0x164);function a23_0x67d2(_0x41e0cb,_0x96871b){_0x41e0cb=_0x41e0cb-0x153;const _0x564421=a23_0x5644();let _0x67d236=_0x564421[_0x41e0cb];return _0x67d236;}export function formatDatasetSdkMarkdown(_0x5a19e8){const _0x56da57=a23_0x73b809,_0x482813=typeof _0x5a19e8===_0x56da57(0x167)?_0x5a19e8[_0x56da57(0x154)]():'';return _0x482813||DEFAULT_MARKDOWN;}export const datasetSdkDoc={'service':a23_0x73b809(0x160),'command':a23_0x73b809(0x163),'description':a23_0x73b809(0x157),'risk':'read','flags':[{...CODE_FLAG,'description':a23_0x73b809(0x161)}],async 'execute'(_0x3149c6){const _0x56c7a2=a23_0x73b809,_0x4f9376=_0x3149c6[_0x56c7a2(0x158)](_0x56c7a2(0x15d)),_0x32d37b=await getDatasetSdkUsageDoc(_0x4f9376,_0x3149c6['appCode']);return{'ok':!![],'data':{'code':_0x4f9376,'appCode':_0x3149c6[_0x56c7a2(0x155)],'markdown':formatDatasetSdkMarkdown(_0x32d37b)}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x1968b1=a24_0x5797;(function(_0x514d5c,_0x1fd5b6){const _0x56df05=a24_0x5797,_0x307cbe=_0x514d5c();while(!![]){try{const _0xe3fe42=-parseInt(_0x56df05(0x221))/0x1+parseInt(_0x56df05(0x23c))/0x2*(-parseInt(_0x56df05(0x224))/0x3)+-parseInt(_0x56df05(0x216))/0x4*(parseInt(_0x56df05(0x239))/0x5)+-parseInt(_0x56df05(0x1f6))/0x6*(-parseInt(_0x56df05(0x1ef))/0x7)+parseInt(_0x56df05(0x1fa))/0x8*(-parseInt(_0x56df05(0x1f0))/0x9)+parseInt(_0x56df05(0x20b))/0xa+-parseInt(_0x56df05(0x218))/0xb*(-parseInt(_0x56df05(0x21a))/0xc);if(_0xe3fe42===_0x1fd5b6)break;else _0x307cbe['push'](_0x307cbe['shift']());}catch(_0x515311){_0x307cbe['push'](_0x307cbe['shift']());}}}(a24_0x2a18,0xae83b));import a24_0x4b94dc from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';import{inspectServiceRegistry}from'../commands/service/registry.js';async function execute(_0x13ab02){const _0x1bf027=a24_0x5797,_0x34b025=getCliVersion(),_0x2d3ee5=buildConfigFromFlags({});await initGlobalEnvironment(_0x2d3ee5),console[_0x1bf027(0x234)](),console['log'](a24_0x4b94dc['bold'](CLI_BIN_NAME+_0x1bf027(0x1fe))),console[_0x1bf027(0x234)](a24_0x4b94dc['gray']('─'['repeat'](0x32))),console[_0x1bf027(0x234)]('\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20'+_0x34b025),console[_0x1bf027(0x234)](_0x1bf027(0x21e)+process[_0x1bf027(0x1f8)]),console['log'](_0x1bf027(0x1ff)+process[_0x1bf027(0x23b)]+'\x20'+process[_0x1bf027(0x202)]),console['log'](),console['log'](a24_0x4b94dc[_0x1bf027(0x1f5)]('\x20\x20Config\x20Files')),console[_0x1bf027(0x234)](a24_0x4b94dc[_0x1bf027(0x1fd)](_0x1bf027(0x235)['repeat'](0x1e)));const _0x3ed9bc=getGlobalConfigPath(),_0x211c3e=getProjectConfigPath();console[_0x1bf027(0x234)]('\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x3ed9bc||a24_0x4b94dc[_0x1bf027(0x1fd)](_0x1bf027(0x214)))),console[_0x1bf027(0x234)](_0x1bf027(0x23d)+(_0x211c3e||a24_0x4b94dc[_0x1bf027(0x1fd)](_0x1bf027(0x214)))),console[_0x1bf027(0x234)](),console['log'](a24_0x4b94dc[_0x1bf027(0x1f5)](_0x1bf027(0x227))),console['log'](a24_0x4b94dc[_0x1bf027(0x1fd)](_0x1bf027(0x235)['repeat'](0x1e)));const _0x3f84b4=(_0x4df4c0,_0xc9b68a)=>{const _0x47632e=_0x1bf027;if(!_0xc9b68a){console[_0x47632e(0x234)]('\x20\x20'+_0x4df4c0[_0x47632e(0x219)](0x11)+'\x20'+a24_0x4b94dc[_0x47632e(0x1fd)](_0x47632e(0x22b)));return;}const _0x39fbec=inspectCliConfigJsonFile(_0xc9b68a);if(_0x39fbec['status']==='ok')console[_0x47632e(0x234)]('\x20\x20'+_0x4df4c0['padEnd'](0x11)+'\x20'+a24_0x4b94dc[_0x47632e(0x226)](_0x47632e(0x1f7)));else{if(_0x39fbec[_0x47632e(0x1ee)]===_0x47632e(0x217))console[_0x47632e(0x234)]('\x20\x20'+_0x4df4c0[_0x47632e(0x219)](0x11)+'\x20'+a24_0x4b94dc[_0x47632e(0x211)](_0x47632e(0x1fb)));else _0x39fbec[_0x47632e(0x1ee)]===_0x47632e(0x203)?console[_0x47632e(0x234)]('\x20\x20'+_0x4df4c0[_0x47632e(0x219)](0x11)+'\x20'+a24_0x4b94dc[_0x47632e(0x1fd)]('(missing)')):(console[_0x47632e(0x234)]('\x20\x20'+_0x4df4c0[_0x47632e(0x219)](0x11)+'\x20'+a24_0x4b94dc['red'](_0x47632e(0x21d))),console['log']('\x20\x20'+''[_0x47632e(0x219)](0x11)+'\x20'+a24_0x4b94dc[_0x47632e(0x1fc)](_0x39fbec[_0x47632e(0x240)])));}};_0x3f84b4(_0x1bf027(0x1f1),_0x3ed9bc),_0x3f84b4(_0x1bf027(0x231),_0x211c3e),console[_0x1bf027(0x234)](),console[_0x1bf027(0x234)](a24_0x4b94dc[_0x1bf027(0x1f5)](_0x1bf027(0x210))),console[_0x1bf027(0x234)](a24_0x4b94dc[_0x1bf027(0x1fd)]('\x20\x20─'['repeat'](0x1e))),console[_0x1bf027(0x234)](_0x1bf027(0x1f3)+(_0x2d3ee5[_0x1bf027(0x20f)]||a24_0x4b94dc[_0x1bf027(0x1fc)]('(not\x20set)'))),console[_0x1bf027(0x234)]('\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x2d3ee5[_0x1bf027(0x209)]);const _0x209144=isLegacyCompatConfigKey(_0x1bf027(0x22a))?a24_0x4b94dc[_0x1bf027(0x1fd)](_0x2d3ee5[_0x1bf027(0x22a)]+_0x1bf027(0x21c)):_0x2d3ee5[_0x1bf027(0x22a)];console[_0x1bf027(0x234)](_0x1bf027(0x232)+_0x209144),console['log'](_0x1bf027(0x1f2)+(_0x2d3ee5[_0x1bf027(0x22e)]||a24_0x4b94dc['gray'](_0x1bf027(0x23e)))),console[_0x1bf027(0x234)]('\x20\x20currentApp:\x20\x20\x20\x20\x20\x20'+(_0x2d3ee5[_0x1bf027(0x242)]||a24_0x4b94dc[_0x1bf027(0x1fd)](_0x1bf027(0x23e)))),console[_0x1bf027(0x234)](_0x1bf027(0x205)+(_0x2d3ee5[_0x1bf027(0x1f9)]||a24_0x4b94dc[_0x1bf027(0x1fd)](_0x1bf027(0x229)+DEFAULT_CONFIG_VALUES[_0x1bf027(0x1f9)]+')'))),console['log'](_0x1bf027(0x222)+(_0x2d3ee5['pageSize']??a24_0x4b94dc[_0x1bf027(0x1fd)](_0x1bf027(0x1f4)))),console[_0x1bf027(0x234)]('\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20'+_0x2d3ee5[_0x1bf027(0x20c)]),console['log'](_0x1bf027(0x225)+_0x2d3ee5[_0x1bf027(0x23f)]),console[_0x1bf027(0x234)](_0x1bf027(0x206)+AUTH_MODE[_0x1bf027(0x22f)]),console[_0x1bf027(0x234)](_0x1bf027(0x20e)+(_0x2d3ee5['accessKey']?a24_0x4b94dc[_0x1bf027(0x226)](_0x1bf027(0x230)+_0x2d3ee5[_0x1bf027(0x241)][_0x1bf027(0x244)]+')'):a24_0x4b94dc[_0x1bf027(0x1fd)](_0x1bf027(0x23e)))),console[_0x1bf027(0x234)](),console[_0x1bf027(0x234)](a24_0x4b94dc[_0x1bf027(0x1f5)](_0x1bf027(0x220))),console[_0x1bf027(0x234)](a24_0x4b94dc[_0x1bf027(0x1fd)](_0x1bf027(0x235)[_0x1bf027(0x208)](0x1e))),console[_0x1bf027(0x234)](_0x1bf027(0x243)+getApiDomain()),console['log']('\x20\x20userDomain:\x20\x20\x20\x20\x20\x20'+getUserDomain()),console[_0x1bf027(0x234)]('\x20\x20runtimeDomain:\x20\x20\x20'+getRuntimeDomain()),console['log'](),console[_0x1bf027(0x234)](a24_0x4b94dc[_0x1bf027(0x1f5)](_0x1bf027(0x238))),console[_0x1bf027(0x234)](a24_0x4b94dc[_0x1bf027(0x1fd)]('\x20\x20─'[_0x1bf027(0x208)](0x1e)));const _0x204b9b=inspectServiceRegistry();console[_0x1bf027(0x234)]('\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20'+_0x204b9b['registryPath']),console[_0x1bf027(0x234)](_0x1bf027(0x23a)+formatServiceRegistryStatus(_0x204b9b)),console[_0x1bf027(0x234)](_0x1bf027(0x237)+_0x204b9b[_0x1bf027(0x22c)]),console[_0x1bf027(0x234)](_0x1bf027(0x228)+_0x204b9b[_0x1bf027(0x213)]);for(const _0x2e7f74 of _0x204b9b[_0x1bf027(0x22d)]){console['log']('\x20\x20'+(_0x2e7f74['serviceCode']+':')[_0x1bf027(0x219)](0x11)+'\x20'+(_0x2e7f74['name']||a24_0x4b94dc[_0x1bf027(0x1fd)](_0x1bf027(0x200)))+'\x20('+_0x2e7f74[_0x1bf027(0x213)]+_0x1bf027(0x20d)),console['log']('\x20\x20'+''[_0x1bf027(0x219)](0x11)+_0x1bf027(0x236)+_0x2e7f74[_0x1bf027(0x20a)][_0x1bf027(0x201)]);}return console['log'](),console[_0x1bf027(0x234)](a24_0x4b94dc['bold']('\x20\x20Auth')),console['log'](a24_0x4b94dc[_0x1bf027(0x1fd)]('\x20\x20─'[_0x1bf027(0x208)](0x1e))),console[_0x1bf027(0x234)](_0x1bf027(0x223)+a24_0x4b94dc[_0x1bf027(0x226)](AUTH_MODE['ClientAk']+_0x1bf027(0x21f))),console[_0x1bf027(0x234)](_0x1bf027(0x215)+a24_0x4b94dc['gray'](_0x1bf027(0x207))),console[_0x1bf027(0x234)](),{'ok':!![]};}function formatServiceRegistryStatus(_0x213cf4){const _0x224014=a24_0x5797;if(_0x213cf4[_0x224014(0x1ee)]==='ok')return a24_0x4b94dc['green']('✓\x20Loaded');if(_0x213cf4[_0x224014(0x1ee)]==='missing')return a24_0x4b94dc[_0x224014(0x1fd)](_0x224014(0x214));if(_0x213cf4[_0x224014(0x1ee)]===_0x224014(0x217))return a24_0x4b94dc[_0x224014(0x211)](_0x224014(0x233));return a24_0x4b94dc['red']('✗\x20Invalid'+(_0x213cf4[_0x224014(0x240)]?':\x20'+_0x213cf4[_0x224014(0x240)]:''));}function a24_0x5797(_0x196185,_0x105b2b){_0x196185=_0x196185-0x1ee;const _0x2a1853=a24_0x2a18();let _0x579717=_0x2a1853[_0x196185];return _0x579717;}export const doctorDefinition={'service':a24_0x1968b1(0x21b),'command':'check','description':a24_0x1968b1(0x212),'risk':a24_0x1968b1(0x204),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};function a24_0x2a18(){const _0x37df04=['message','accessKey','currentApp','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','length','status','10500cgInte','1037367qGUObF','Global','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','(default)','bold','4152KRuLxp','✓\x20Valid\x20JSON','version','format','72fioueu','⚠\x20Empty\x20(treated\x20as\x20{})','red','gray','\x20doctor','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','(unnamed)','path','arch','missing','read','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20auth\x20(effective):\x20','(removed\x20—\x20cookie\x20auth\x20disabled)','repeat','env','source','5328430tLGrDK','riskLevel','\x20commands)','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','appCode','\x20\x20Merged\x20Config','yellow','Diagnose\x20CLI\x20configuration\x20and\x20environment','commandCount','(not\x20found)','\x20\x20Session\x20check:\x20\x20\x20','12OuBnlZ','empty','11693LtLoZu','padEnd','31404bUlKhQ','doctor','\x20(legacy/compat\x20only)','✗\x20Invalid\x20JSON','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20(accessKey)','\x20\x20API\x20Endpoints','882683EYvIDp','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','3upkYeJ','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','green','\x20\x20Config\x20JSON','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','(default:\x20','locale','(no\x20file)','serviceCount','services','defaultApp','ClientAk','(set,\x20length=','Project','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','⚠\x20Empty','log','\x20\x20─','\x20Imported\x20from:\x20','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Service\x20Tree','953140dchxZn','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','platform','2291938VYkQmC','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','(none)','verbose'];a24_0x2a18=function(){return _0x37df04;};return a24_0x2a18();}
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a25_0x5df030=a25_0x1eca;(function(_0x4d610a,_0x259047){const _0x12d5f0=a25_0x1eca,_0x2052ed=_0x4d610a();while(!![]){try{const _0x4f0988=parseInt(_0x12d5f0(0xd3))/0x1+-parseInt(_0x12d5f0(0xcf))/0x2*(-parseInt(_0x12d5f0(0xbb))/0x3)+parseInt(_0x12d5f0(0xbf))/0x4*(parseInt(_0x12d5f0(0xc3))/0x5)+-parseInt(_0x12d5f0(0xd4))/0x6+-parseInt(_0x12d5f0(0xdb))/0x7*(-parseInt(_0x12d5f0(0xda))/0x8)+parseInt(_0x12d5f0(0xca))/0x9*(-parseInt(_0x12d5f0(0xcc))/0xa)+-parseInt(_0x12d5f0(0xf0))/0xb;if(_0x4f0988===_0x259047)break;else _0x2052ed['push'](_0x2052ed['shift']());}catch(_0x275543){_0x2052ed['push'](_0x2052ed['shift']());}}}(a25_0x33b8,0xbe9bd));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':a25_0x5df030(0xc1),'type':'string','description':'App\x20code\x20for\x20the\x20project'},{'name':a25_0x5df030(0xe2),'type':'string','description':a25_0x5df030(0xd7)+DEFAULT_CONFIG_VALUES[a25_0x5df030(0xe2)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a25_0x5df030(0xf9),'type':a25_0x5df030(0xba),'description':a25_0x5df030(0xee)+PRODUCT_CONFIG[a25_0x5df030(0xf1)]+a25_0x5df030(0xfa),'default':![]},{'name':a25_0x5df030(0xd6),'type':'boolean','description':a25_0x5df030(0xbe),'default':![]}];export const initImportFlagDefs=[{'name':'file','type':a25_0x5df030(0xdf),'description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':'appcode','type':'string','description':a25_0x5df030(0xef)},{'name':a25_0x5df030(0xe2),'type':a25_0x5df030(0xdf),'description':a25_0x5df030(0xed),'enum':[...RUNTIME_ENV_VALUES]},{'name':a25_0x5df030(0xf9),'type':'boolean','description':a25_0x5df030(0xee)+PRODUCT_CONFIG[a25_0x5df030(0xf1)]+a25_0x5df030(0xfa),'default':![]},{'name':a25_0x5df030(0xd6),'type':'boolean','description':a25_0x5df030(0xbe),'default':![]}];export async function runInit(_0xb26f74){const _0x3910af=a25_0x5df030,_0x2bcb3b=isNonInteractiveMode(_0xb26f74),_0xdca752=_0xb26f74['global']?_0x3910af(0xf9):_0x3910af(0xfd),_0x5bbe1a=resolveWriteConfigPath(_0xdca752);try{_0x2bcb3b?await runNonInteractive(_0xb26f74,_0x5bbe1a):await runInteractive(_0xb26f74,_0x5bbe1a);}catch(_0x5539c1){if(_0x5539c1 instanceof AbortPrompt)throw CliErrors[_0x3910af(0xf6)]();throw _0x5539c1;}}function a25_0x33b8(){const _0x15aa75=['once','\x0aInitialized\x20','[Y/n]','\x20\x20config:\x20\x20','Failed\x20to\x20parse\x20source\x20file:\x20','Override\x20imported\x20default\x20env','Write\x20to\x20global\x20(~/','Override\x20imported\x20default\x20appcode','24150973CAoEuV','newConfigFileName','trim','entries','parse','App\x20code','cancelled','join','apiDir','global',')\x20instead\x20of\x20project','\x20\x20appcode:\x20','message','project','boolean','762HPryAA','utf8','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','Skip\x20confirmation\x20when\x20overwriting','1740112XaStjY','Source\x20file\x20not\x20found:\x20','appcode','Imported\x20from\x20','15tmAACa','toLowerCase','Usage:\x20','close','validation','file','question','4077WHqpra','Invalid\x20env\x20\x22','9080AacFFo','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`.','defaultApp','6822WQkrXn','User\x20aborted\x20prompt','stdout','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','1303591ZEPtqt','8729958FDIwHl','File\x20','yes','Target\x20environment\x20(default\x20','log','flagMissing','5470096zuhcnd','14eADDtL','):\x20','App\x20code\x20cannot\x20be\x20empty.','removeListener','string','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','\x20\x20env:\x20\x20\x20\x20\x20','env','AbortPrompt','SIGINT','riskLevel','\x20init\x20—\x20Create\x20','[y/N]'];a25_0x33b8=function(){return _0x15aa75;};return a25_0x33b8();}export async function runInitImport(_0x886e5b){const _0x1102ce=a25_0x5df030,_0x12765f=_0x886e5b[_0x1102ce(0xf9)]?'global':'project',_0x417ece=resolveWriteConfigPath(_0x12765f);await runFromImport(_0x886e5b,_0x417ece);}const RUNTIME_IRRELEVANT_KEYS=new Set([a25_0x5df030(0xf8)]);async function runFromImport(_0x5d23b9,_0x3d81c5){const _0x3ac557=a25_0x5df030,_0x4cefd5=resolveFilePath(_0x5d23b9[_0x3ac557(0xc8)]);if(!existsSync(_0x4cefd5))throw CliErrors[_0x3ac557(0xc7)](_0x3ac557(0xc0)+_0x4cefd5);const _0x297e4e=readSourceFile(_0x4cefd5),_0x3caf3c=convertToRuntimeConfig(_0x297e4e);_0x5d23b9['appcode']&&(_0x3caf3c['appcode']=String(_0x5d23b9[_0x3ac557(0xc1)]));_0x5d23b9[_0x3ac557(0xe2)]&&(_0x3caf3c['env']=resolveInitEnv(_0x5d23b9));if(!_0x3caf3c[_0x3ac557(0xc1)])throw CliErrors['validation'](_0x3ac557(0xbd),_0x3ac557(0xcd));await writeInitConfig(_0x3d81c5,_0x3caf3c,_0x5d23b9),console[_0x3ac557(0xd8)](_0x3ac557(0xc2)+_0x4cefd5),console[_0x3ac557(0xd8)](_0x3ac557(0xeb)+_0x3d81c5),console['log'](_0x3ac557(0xfb)+_0x3caf3c['appcode']);if(_0x3caf3c[_0x3ac557(0xce)])console[_0x3ac557(0xd8)]('\x20\x20default:\x20'+_0x3caf3c[_0x3ac557(0xce)]);}function convertToRuntimeConfig(_0x24ba6a){const _0xb2e71d=a25_0x5df030;if(_0x24ba6a['apps']&&typeof _0x24ba6a['apps']==='object')throw CliErrors['validation'](_0xb2e71d(0xe0),_0xb2e71d(0xd2));const _0x6105e2={};for(const _0x749a9e of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x24ba6a[_0x749a9e]!==undefined&&(_0x6105e2[_0x749a9e]=_0x24ba6a[_0x749a9e]);}return!_0x6105e2[_0xb2e71d(0xe5)]&&(_0x6105e2[_0xb2e71d(0xe5)]=DEFAULT_CONFIG_VALUES[_0xb2e71d(0xe5)]),_0x6105e2;}async function runNonInteractive(_0x3aed99,_0x20a4cc){const _0x134351=a25_0x5df030,_0x12132c=_0x3aed99[_0x134351(0xc1)];if(!_0x12132c)throw CliErrors[_0x134351(0xd9)](_0x134351(0xc1),_0x134351(0xc5)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x410f5d=resolveInitEnv(_0x3aed99);await writeInitConfig(_0x20a4cc,{'appcode':_0x12132c,'env':_0x410f5d},_0x3aed99),console[_0x134351(0xd8)]('Initialized\x20'+_0x20a4cc),console['log'](_0x134351(0xfb)+_0x12132c),console[_0x134351(0xd8)](_0x134351(0xe1)+_0x410f5d);}async function runInteractive(_0x5719ff,_0x4a8e0c){const _0x18ab91=a25_0x5df030,_0x44cdcc=loadExisting(_0x4a8e0c),_0x1aab1b=typeof _0x44cdcc?.[_0x18ab91(0xc1)]===_0x18ab91(0xdf)?_0x44cdcc['appcode']:'',_0x4bcbca=resolveInitEnv(_0x5719ff);console[_0x18ab91(0xd8)](CLI_BIN_NAME+_0x18ab91(0xe6)+PRODUCT_CONFIG['newConfigFileName']+'\x0a');if(existsSync(_0x4a8e0c)&&!_0x5719ff[_0x18ab91(0xd6)]){const _0x57c7c4=await promptYesNo(_0x18ab91(0xd5)+_0x4a8e0c+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x57c7c4){console[_0x18ab91(0xd8)]('Aborted.');return;}}const _0x561d85=typeof _0x5719ff[_0x18ab91(0xc1)]===_0x18ab91(0xdf)?_0x5719ff[_0x18ab91(0xc1)][_0x18ab91(0xf2)]():'';let _0x374993=_0x561d85;!_0x374993&&(_0x374993=await promptInput(_0x18ab91(0xf5),_0x1aab1b));if(!_0x374993[_0x18ab91(0xf2)]())throw CliErrors[_0x18ab91(0xc7)](_0x18ab91(0xdd));await writeInitConfig(_0x4a8e0c,{'appcode':_0x374993[_0x18ab91(0xf2)](),'env':_0x4bcbca},_0x5719ff),console[_0x18ab91(0xd8)](_0x18ab91(0xe9)+_0x4a8e0c),console[_0x18ab91(0xd8)](_0x18ab91(0xfb)+_0x374993[_0x18ab91(0xf2)]()),console[_0x18ab91(0xd8)](_0x18ab91(0xe1)+_0x4bcbca);}async function writeInitConfig(_0x1cf1b2,_0x288b3e,_0x354032){const _0x3ec796=a25_0x5df030;let _0x261375={};existsSync(_0x1cf1b2)&&!_0x354032['yes']&&(_0x261375=readConfigFile(_0x1cf1b2));for(const [_0x3ac85c,_0xd18017]of Object[_0x3ec796(0xf3)](_0x288b3e)){_0xd18017!==undefined&&(_0x261375[_0x3ac85c]=_0xd18017);}if(_0x261375['app'])delete _0x261375['app'];writeConfigFile(_0x1cf1b2,_0x261375);}class AbortPrompt extends Error{constructor(){const _0x331f86=a25_0x5df030;super(_0x331f86(0xd0)),this['name']=_0x331f86(0xe3);}}function a25_0x1eca(_0x5bf7c7,_0x3ad10a){_0x5bf7c7=_0x5bf7c7-0xba;const _0x33b8d0=a25_0x33b8();let _0x1eca46=_0x33b8d0[_0x5bf7c7];return _0x1eca46;}function createSafeRl(){const _0x557d73=a25_0x5df030,_0x312fd8=createInterface({'input':process['stdin'],'output':process[_0x557d73(0xd1)]});let _0x5ad3b2;const _0x5aea02=new Promise((_0x268018,_0x2a7da8)=>{const _0x3bb279=_0x557d73;_0x5ad3b2=()=>{const _0x75d044=a25_0x1eca;_0x5ad3b2&&(_0x312fd8[_0x75d044(0xde)](_0x75d044(0xe4),_0x5ad3b2),_0x5ad3b2=undefined);try{_0x312fd8['close']();}catch{}_0x2a7da8(new AbortPrompt());},_0x312fd8[_0x3bb279(0xe8)]('SIGINT',_0x5ad3b2);}),_0x1575c7=()=>{const _0x59bd14=_0x557d73;_0x5ad3b2&&(_0x312fd8[_0x59bd14(0xde)]('SIGINT',_0x5ad3b2),_0x5ad3b2=undefined);try{_0x312fd8[_0x59bd14(0xc6)]();}catch{}};return{'rl':_0x312fd8,'abortPromise':_0x5aea02,'disposeSuccess':_0x1575c7};}async function promptInput(_0x5178ad,_0x536a6d){const {rl:_0x4037a2,abortPromise:_0x3ac4f6,disposeSuccess:_0x2d5a51}=createSafeRl(),_0x5907fe=new Promise(_0x339d72=>{const _0x5ae8fc=a25_0x1eca,_0x37faab=_0x536a6d?'\x20\x20'+_0x5178ad+'\x20('+_0x536a6d+_0x5ae8fc(0xdc):'\x20\x20'+_0x5178ad+':\x20';_0x4037a2['question'](_0x37faab,_0x4d4ac5=>{const _0x2f64c1=_0x5ae8fc;_0x2d5a51(),_0x339d72(_0x4d4ac5[_0x2f64c1(0xf2)]()||_0x536a6d);});});return Promise['race']([_0x5907fe,_0x3ac4f6]);}async function promptYesNo(_0x408c19,_0x2a708d){const {rl:_0x21b05d,abortPromise:_0x44d211,disposeSuccess:_0x17f571}=createSafeRl(),_0x5d98e6=new Promise(_0x5c7312=>{const _0x4c5ef8=a25_0x1eca,_0x49e2fc=_0x2a708d?_0x4c5ef8(0xea):_0x4c5ef8(0xe7);_0x21b05d[_0x4c5ef8(0xc9)]('\x20\x20'+_0x408c19+'\x20'+_0x49e2fc+':\x20',_0x296ff9=>{const _0x4a857b=_0x4c5ef8;_0x17f571();const _0x580415=_0x296ff9[_0x4a857b(0xf2)]()[_0x4a857b(0xc4)]();if(_0x580415==='y'||_0x580415==='yes')_0x5c7312(!![]);else{if(_0x580415==='n'||_0x580415==='no')_0x5c7312(![]);else _0x5c7312(_0x2a708d);}});});return Promise['race']([_0x5d98e6,_0x44d211]);}function loadExisting(_0x34c727){if(!existsSync(_0x34c727))return null;return readConfigFile(_0x34c727);}function resolveFilePath(_0x3090ea){return isAbsolute(_0x3090ea)?_0x3090ea:resolve(process['cwd'](),_0x3090ea);}function readSourceFile(_0xa6ed86){const _0x4393ad=a25_0x5df030;try{const _0x1fb8f8=readFileSync(_0xa6ed86,{'encoding':_0x4393ad(0xbc)});return JSON[_0x4393ad(0xf4)](_0x1fb8f8);}catch(_0x4596c7){throw CliErrors[_0x4393ad(0xc7)](_0x4393ad(0xec)+_0x4596c7[_0x4393ad(0xfc)]);}}function resolveInitEnv(_0x5a8c1d){const _0x4a87e8=a25_0x5df030,_0x11643b=_0x5a8c1d[_0x4a87e8(0xe2)];if(_0x11643b===undefined||_0x11643b==='')return DEFAULT_CONFIG_VALUES[_0x4a87e8(0xe2)];if(!RUNTIME_ENV_VALUES['includes'](_0x11643b))throw CliErrors['validation'](_0x4a87e8(0xcb)+_0x11643b+'\x22.\x20Allowed:\x20'+RUNTIME_ENV_VALUES[_0x4a87e8(0xf7)](',\x20'));return _0x11643b;}
|
|
1
|
+
const a25_0x2b6240=a25_0xaac3;(function(_0x4164ac,_0x21f3f0){const _0x59e2de=a25_0xaac3,_0x26b74a=_0x4164ac();while(!![]){try{const _0x2c7c42=-parseInt(_0x59e2de(0xa0))/0x1+-parseInt(_0x59e2de(0x72))/0x2+-parseInt(_0x59e2de(0x7f))/0x3*(-parseInt(_0x59e2de(0x8e))/0x4)+-parseInt(_0x59e2de(0x9a))/0x5+parseInt(_0x59e2de(0x76))/0x6+-parseInt(_0x59e2de(0x79))/0x7+parseInt(_0x59e2de(0x6d))/0x8;if(_0x2c7c42===_0x21f3f0)break;else _0x26b74a['push'](_0x26b74a['shift']());}catch(_0x241916){_0x26b74a['push'](_0x26b74a['shift']());}}}(a25_0x2823,0xa98ba));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';function a25_0xaac3(_0x4e3586,_0x166512){_0x4e3586=_0x4e3586-0x68;const _0x282370=a25_0x2823();let _0xaac328=_0x282370[_0x4e3586];return _0xaac328;}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':a25_0x2b6240(0x97),'description':a25_0x2b6240(0x6a)},{'name':a25_0x2b6240(0x77),'type':a25_0x2b6240(0x97),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES[a25_0x2b6240(0x77)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a25_0x2b6240(0x6f),'type':a25_0x2b6240(0x9b),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a25_0x2b6240(0x80)]+a25_0x2b6240(0x81),'default':![]},{'name':'yes','type':a25_0x2b6240(0x9b),'description':a25_0x2b6240(0x7d),'default':![]}];export const initImportFlagDefs=[{'name':a25_0x2b6240(0x73),'type':a25_0x2b6240(0x97),'description':a25_0x2b6240(0x9c),'required':!![]},{'name':a25_0x2b6240(0x8c),'type':'string','description':a25_0x2b6240(0x7a)},{'name':a25_0x2b6240(0x77),'type':a25_0x2b6240(0x97),'description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':a25_0x2b6240(0x6f),'type':'boolean','description':a25_0x2b6240(0x7b)+PRODUCT_CONFIG[a25_0x2b6240(0x80)]+')\x20instead\x20of\x20project','default':![]},{'name':a25_0x2b6240(0x88),'type':'boolean','description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x3b182e){const _0x3ba0f4=a25_0x2b6240,_0x4e2585=isNonInteractiveMode(_0x3b182e),_0x4b751b=_0x3b182e[_0x3ba0f4(0x6f)]?_0x3ba0f4(0x6f):'project',_0x13d5f8=resolveWriteConfigPath(_0x4b751b);try{_0x4e2585?await runNonInteractive(_0x3b182e,_0x13d5f8):await runInteractive(_0x3b182e,_0x13d5f8);}catch(_0x558485){if(_0x558485 instanceof AbortPrompt)throw CliErrors[_0x3ba0f4(0x71)]();throw _0x558485;}}export async function runInitImport(_0x4b0e55){const _0x4e3b5f=a25_0x2b6240,_0x1b6582=_0x4b0e55[_0x4e3b5f(0x6f)]?_0x4e3b5f(0x6f):'project',_0x53cbdf=resolveWriteConfigPath(_0x1b6582);await runFromImport(_0x4b0e55,_0x53cbdf);}const RUNTIME_IRRELEVANT_KEYS=new Set([a25_0x2b6240(0x69)]);async function runFromImport(_0x35c6f8,_0x12012c){const _0x59011e=a25_0x2b6240,_0x43e16d=resolveFilePath(_0x35c6f8[_0x59011e(0x73)]);if(!existsSync(_0x43e16d))throw CliErrors[_0x59011e(0xa4)]('Source\x20file\x20not\x20found:\x20'+_0x43e16d);const _0xd3d3a3=readSourceFile(_0x43e16d),_0xa1cd0f=convertToRuntimeConfig(_0xd3d3a3);_0x35c6f8[_0x59011e(0x8c)]&&(_0xa1cd0f[_0x59011e(0x8c)]=String(_0x35c6f8[_0x59011e(0x8c)]));_0x35c6f8['env']&&(_0xa1cd0f[_0x59011e(0x77)]=resolveInitEnv(_0x35c6f8));if(!_0xa1cd0f[_0x59011e(0x8c)])throw CliErrors[_0x59011e(0xa4)]('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.',_0x59011e(0x93));await writeInitConfig(_0x12012c,_0xa1cd0f,_0x35c6f8),console[_0x59011e(0x7c)](_0x59011e(0x96)+_0x43e16d),console[_0x59011e(0x7c)]('\x20\x20config:\x20\x20'+_0x12012c),console[_0x59011e(0x7c)]('\x20\x20appcode:\x20'+_0xa1cd0f[_0x59011e(0x8c)]);if(_0xa1cd0f['defaultApp'])console[_0x59011e(0x7c)](_0x59011e(0x8a)+_0xa1cd0f[_0x59011e(0x83)]);}function convertToRuntimeConfig(_0x5982e1){const _0x4e239e=a25_0x2b6240;if(_0x5982e1[_0x4e239e(0x8d)]&&typeof _0x5982e1[_0x4e239e(0x8d)]===_0x4e239e(0x6e))throw CliErrors[_0x4e239e(0xa4)](_0x4e239e(0xa5),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x34723f={};for(const _0x2682e2 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x5982e1[_0x2682e2]!==undefined&&(_0x34723f[_0x2682e2]=_0x5982e1[_0x2682e2]);}return!_0x34723f['riskLevel']&&(_0x34723f['riskLevel']=DEFAULT_CONFIG_VALUES[_0x4e239e(0x92)]),_0x34723f;}async function runNonInteractive(_0x192f60,_0x398c9e){const _0x228011=a25_0x2b6240,_0x41b3df=_0x192f60[_0x228011(0x8c)];if(!_0x41b3df)throw CliErrors['flagMissing'](_0x228011(0x8c),_0x228011(0xa3)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x146cfe=resolveInitEnv(_0x192f60);await writeInitConfig(_0x398c9e,{'appcode':_0x41b3df,'env':_0x146cfe},_0x192f60),console[_0x228011(0x7c)](_0x228011(0x90)+_0x398c9e),console[_0x228011(0x7c)](_0x228011(0x8f)+_0x41b3df),console[_0x228011(0x7c)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x146cfe);}async function runInteractive(_0x2879da,_0x243394){const _0x24fc41=a25_0x2b6240,_0x3d5be5=loadExisting(_0x243394),_0x5204d9=typeof _0x3d5be5?.[_0x24fc41(0x8c)]==='string'?_0x3d5be5[_0x24fc41(0x8c)]:'',_0x366677=resolveInitEnv(_0x2879da);console[_0x24fc41(0x7c)](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG[_0x24fc41(0x80)]+'\x0a');if(existsSync(_0x243394)&&!_0x2879da[_0x24fc41(0x88)]){const _0x489c2f=await promptYesNo(_0x24fc41(0x89)+_0x243394+_0x24fc41(0x91),![]);if(!_0x489c2f){console[_0x24fc41(0x7c)]('Aborted.');return;}}const _0x4a4be3=typeof _0x2879da[_0x24fc41(0x8c)]===_0x24fc41(0x97)?_0x2879da[_0x24fc41(0x8c)][_0x24fc41(0xa2)]():'';let _0x425b75=_0x4a4be3;!_0x425b75&&(_0x425b75=await promptInput(_0x24fc41(0x78),_0x5204d9));if(!_0x425b75['trim']())throw CliErrors[_0x24fc41(0xa4)](_0x24fc41(0x70));await writeInitConfig(_0x243394,{'appcode':_0x425b75['trim'](),'env':_0x366677},_0x2879da),console[_0x24fc41(0x7c)](_0x24fc41(0x85)+_0x243394),console[_0x24fc41(0x7c)]('\x20\x20appcode:\x20'+_0x425b75['trim']()),console[_0x24fc41(0x7c)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x366677);}async function writeInitConfig(_0x2f92b1,_0x2225ee,_0x1f0075){const _0xaf0796=a25_0x2b6240;let _0xf85c1a={};existsSync(_0x2f92b1)&&!_0x1f0075['yes']&&(_0xf85c1a=readConfigFile(_0x2f92b1));for(const [_0x40faf5,_0x445bef]of Object[_0xaf0796(0x75)](_0x2225ee)){_0x445bef!==undefined&&(_0xf85c1a[_0x40faf5]=_0x445bef);}if(_0xf85c1a[_0xaf0796(0x7e)])delete _0xf85c1a[_0xaf0796(0x7e)];writeConfigFile(_0x2f92b1,_0xf85c1a);}class AbortPrompt extends Error{constructor(){const _0x475028=a25_0x2b6240;super(_0x475028(0x6b)),this[_0x475028(0x68)]=_0x475028(0x8b);}}function createSafeRl(){const _0x1d57ac=a25_0x2b6240,_0x1fc2dc=createInterface({'input':process[_0x1d57ac(0x87)],'output':process['stdout']});let _0xc09c7d;const _0x2906b1=new Promise((_0x365b87,_0x562d5d)=>{const _0x500376=_0x1d57ac;_0xc09c7d=()=>{const _0x1e75e0=a25_0xaac3;_0xc09c7d&&(_0x1fc2dc['removeListener'](_0x1e75e0(0x74),_0xc09c7d),_0xc09c7d=undefined);try{_0x1fc2dc[_0x1e75e0(0x95)]();}catch{}_0x562d5d(new AbortPrompt());},_0x1fc2dc[_0x500376(0x9f)](_0x500376(0x74),_0xc09c7d);}),_0x35bccc=()=>{const _0x8960a1=_0x1d57ac;_0xc09c7d&&(_0x1fc2dc[_0x8960a1(0x94)](_0x8960a1(0x74),_0xc09c7d),_0xc09c7d=undefined);try{_0x1fc2dc[_0x8960a1(0x95)]();}catch{}};return{'rl':_0x1fc2dc,'abortPromise':_0x2906b1,'disposeSuccess':_0x35bccc};}async function promptInput(_0x14f948,_0x5cd42f){const _0x5a3b7e=a25_0x2b6240,{rl:_0x481ea0,abortPromise:_0x5e3670,disposeSuccess:_0x5da696}=createSafeRl(),_0x472ee1=new Promise(_0x2042e4=>{const _0x3fda7a=a25_0xaac3,_0x47932f=_0x5cd42f?'\x20\x20'+_0x14f948+'\x20('+_0x5cd42f+_0x3fda7a(0x9d):'\x20\x20'+_0x14f948+':\x20';_0x481ea0[_0x3fda7a(0x86)](_0x47932f,_0x5a2081=>{const _0x2939bb=_0x3fda7a;_0x5da696(),_0x2042e4(_0x5a2081[_0x2939bb(0xa2)]()||_0x5cd42f);});});return Promise[_0x5a3b7e(0x9e)]([_0x472ee1,_0x5e3670]);}async function promptYesNo(_0x1cf1c6,_0x192907){const _0x59ad1e=a25_0x2b6240,{rl:_0x436884,abortPromise:_0x54f1c3,disposeSuccess:_0x5e4a64}=createSafeRl(),_0x2ddb6a=new Promise(_0x59df7b=>{const _0x218650=a25_0xaac3,_0x3edcbd=_0x192907?_0x218650(0x82):_0x218650(0xa1);_0x436884['question']('\x20\x20'+_0x1cf1c6+'\x20'+_0x3edcbd+':\x20',_0x867740=>{const _0x24eb69=_0x218650;_0x5e4a64();const _0x1d4a71=_0x867740[_0x24eb69(0xa2)]()[_0x24eb69(0x99)]();if(_0x1d4a71==='y'||_0x1d4a71===_0x24eb69(0x88))_0x59df7b(!![]);else{if(_0x1d4a71==='n'||_0x1d4a71==='no')_0x59df7b(![]);else _0x59df7b(_0x192907);}});});return Promise[_0x59ad1e(0x9e)]([_0x2ddb6a,_0x54f1c3]);}function loadExisting(_0x35336e){if(!existsSync(_0x35336e))return null;return readConfigFile(_0x35336e);}function resolveFilePath(_0x421f98){return isAbsolute(_0x421f98)?_0x421f98:resolve(process['cwd'](),_0x421f98);}function readSourceFile(_0x1fe24a){const _0x2db4d1=a25_0x2b6240;try{const _0x456bf6=readFileSync(_0x1fe24a,{'encoding':'utf8'});return JSON['parse'](_0x456bf6);}catch(_0x672334){throw CliErrors['validation'](_0x2db4d1(0x98)+_0x672334['message']);}}function a25_0x2823(){const _0x46ab89=['string','Failed\x20to\x20parse\x20source\x20file:\x20','toLowerCase','2691565WdVHPf','boolean','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','):\x20','race','once','865369ATrjNb','[y/N]','trim','Usage:\x20','validation','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','name','apiDir','App\x20code\x20for\x20the\x20project','User\x20aborted\x20prompt','includes','15010360MBTSFG','object','global','App\x20code\x20cannot\x20be\x20empty.','cancelled','1269620BfHmpk','file','SIGINT','entries','529284EvIbVS','env','App\x20code','2326660BkYoAN','Override\x20imported\x20default\x20appcode','Write\x20to\x20global\x20(~/','log','Skip\x20confirmation\x20when\x20overwriting','app','3KYAWda','newConfigFileName',')\x20instead\x20of\x20project','[Y/n]','defaultApp','Invalid\x20env\x20\x22','\x0aInitialized\x20','question','stdin','yes','File\x20','\x20\x20default:\x20','AbortPrompt','appcode','apps','4403284EPiPml','\x20\x20appcode:\x20','Initialized\x20','\x20already\x20exists.\x20Overwrite?','riskLevel','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`.','removeListener','close','Imported\x20from\x20'];a25_0x2823=function(){return _0x46ab89;};return a25_0x2823();}function resolveInitEnv(_0x37f889){const _0x1b10af=a25_0x2b6240,_0x204e05=_0x37f889[_0x1b10af(0x77)];if(_0x204e05===undefined||_0x204e05==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x1b10af(0x6c)](_0x204e05))throw CliErrors['validation'](_0x1b10af(0x84)+_0x204e05+'\x22.\x20Allowed:\x20'+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x204e05;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a26_0x15e62e=a26_0x2924;(function(_0x2fa07f,_0x595786){const _0x98c221=a26_0x2924,_0x440907=_0x2fa07f();while(!![]){try{const _0x37282f=-parseInt(_0x98c221(0x178))/0x1*(parseInt(_0x98c221(0x169))/0x2)+-parseInt(_0x98c221(0x167))/0x3+-parseInt(_0x98c221(0x18b))/0x4*(parseInt(_0x98c221(0x19f))/0x5)+-parseInt(_0x98c221(0x180))/0x6*(-parseInt(_0x98c221(0x181))/0x7)+-parseInt(_0x98c221(0x17e))/0x8+parseInt(_0x98c221(0x17d))/0x9*(-parseInt(_0x98c221(0x177))/0xa)+parseInt(_0x98c221(0x182))/0xb*(parseInt(_0x98c221(0x18e))/0xc);if(_0x37282f===_0x595786)break;else _0x440907['push'](_0x440907['shift']());}catch(_0x2ef91f){_0x440907['push'](_0x440907['shift']());}}}(a26_0xfc20,0x7ee90));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':a26_0x15e62e(0x163),'type':a26_0x15e62e(0x172),'required':!![],'description':'Personal\x20knowledge-base\x20entry\x20title'},FILE_FLAG={'name':'file','type':a26_0x15e62e(0x172),'required':!![],'description':'Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file'},QUERY_FLAG={'name':a26_0x15e62e(0x171),'type':a26_0x15e62e(0x172),'required':!![],'description':a26_0x15e62e(0x16d)},TOPK_FLAG={'name':a26_0x15e62e(0x1a2),'type':'number','description':a26_0x15e62e(0x170)};function readKnowledgeFile(_0x4ffff7){const _0x6d7581=a26_0x15e62e;if(!_0x4ffff7)throw CliErrors['validation'](_0x6d7581(0x18d));if(!existsSync(_0x4ffff7))throw CliErrors[_0x6d7581(0x173)](_0x6d7581(0x189)+_0x4ffff7);if(!statSync(_0x4ffff7)[_0x6d7581(0x184)]())throw CliErrors['validation'](_0x6d7581(0x16b)+_0x4ffff7);return readFileSync(_0x4ffff7,_0x6d7581(0x18c));}function summarizePersonalItem(_0x466616){const _0x50bf0b=a26_0x15e62e;return{'id':_0x466616['id'],'title':_0x466616['title'],'version':_0x466616[_0x50bf0b(0x194)],'ragStatus':_0x466616['ragStatus'],'ragErrorMessage':_0x466616[_0x50bf0b(0x17c)],'updateTime':_0x466616['updateTime']};}function a26_0x2924(_0x15e908,_0x1514ed){_0x15e908=_0x15e908-0x163;const _0xfc2008=a26_0xfc20();let _0x2924a8=_0xfc2008[_0x15e908];return _0x2924a8;}function detailPersonalItem(_0x14e254){const _0x42bb18=a26_0x15e62e;return{'id':_0x14e254['id'],'appCode':_0x14e254[_0x42bb18(0x19d)],'scope':_0x14e254['scope'],'userId':_0x14e254['userId'],'title':_0x14e254[_0x42bb18(0x163)],'content':_0x14e254[_0x42bb18(0x19b)]??'','version':_0x14e254[_0x42bb18(0x194)],'ragStatus':_0x14e254['ragStatus'],'ragErrorMessage':_0x14e254[_0x42bb18(0x17c)],'createTime':_0x14e254[_0x42bb18(0x164)],'updateTime':_0x14e254['updateTime']};}function summarizeSearchHit(_0x56e5be){const _0x32628e=a26_0x15e62e;return{'scope':_0x56e5be[_0x32628e(0x19a)],'docId':_0x56e5be['docId'],'score':_0x56e5be[_0x32628e(0x198)],'weightedScore':_0x56e5be[_0x32628e(0x183)],'content':_0x56e5be['content'],'metadata':_0x56e5be[_0x32628e(0x18f)]};}function readTopK(_0x44001f){const _0x4c1c14=a26_0x15e62e,_0x368512=_0x44001f[_0x4c1c14(0x174)](_0x4c1c14(0x1a2));if(_0x368512===undefined||_0x368512===null||_0x368512==='')return undefined;const _0x129551=_0x44001f['num']('topk');if(!Number[_0x4c1c14(0x16f)](_0x129551)||_0x129551<0x1)throw CliErrors[_0x4c1c14(0x173)](_0x4c1c14(0x195));return _0x129551;}function a26_0xfc20(){const _0x5d5d00=['Updated\x20KB\x20entry\x20','version','--topk\x20must\x20be\x20a\x20positive\x20number.','map','build','score','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','scope','content','file','appCode','Search\x20query\x20is\x20required.','4030hFFUFf','create','Personal\x20knowledge-base\x20entry\x20ID','topk','length','title','createTime','description','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','158034madSGQ','list','6DfiiDw','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','File\x20is\x20not\x20a\x20regular\x20file:\x20','Created\x20KB\x20entry\x20','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','body','isFinite','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','query','string','validation','flag','num','update','231950YtvJMr','64319GOKwGA','write','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','ragErrorMessage','207pHdtDY','7114384phKJxC','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','44418IcPWxg','763jxrTtI','1624381CpSife','weightedScore','isFile','/client/knowledge-base/personal/create','bool','str','verbose','File\x20not\x20found:\x20','Override\x20the\x20existing\x20entry\x20title','2672yjxPtS','utf8','File\x20path\x20is\x20required.','156pRJVeo','metadata','trim','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','read'];a26_0xfc20=function(){return _0x5d5d00;};return a26_0xfc20();}const kbList={'service':'kb','command':a26_0x15e62e(0x168),'description':a26_0x15e62e(0x17b),'risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0x417e86){const _0x4db9d9=a26_0x15e62e,_0x36ca64=await listPersonalKnowledgeBaseItems(_0x417e86[_0x4db9d9(0x19d)]);if(_0x417e86[_0x4db9d9(0x186)](_0x4db9d9(0x188)))return{'ok':!![],'data':{'total':_0x36ca64[_0x4db9d9(0x1a3)],'items':_0x36ca64}};return{'ok':!![],'data':{'total':_0x36ca64[_0x4db9d9(0x1a3)],'items':_0x36ca64[_0x4db9d9(0x196)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':'detail','description':a26_0x15e62e(0x16a),'risk':a26_0x15e62e(0x192),'flags':[{...ID_FLAG,'description':a26_0x15e62e(0x1a1)}],async 'execute'(_0x5d3661){const _0x58cee7=a26_0x15e62e,_0x52dac5=await getPersonalKnowledgeBaseItem(_0x5d3661[_0x58cee7(0x175)]('id'),_0x5d3661[_0x58cee7(0x19d)]);return{'ok':!![],'data':detailPersonalItem(_0x52dac5)};}},kbCreate={'service':'kb','command':a26_0x15e62e(0x1a0),'description':a26_0x15e62e(0x166),'risk':'write','flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x11bdd3){const _0x1258be=a26_0x15e62e,_0xe2da38=_0x11bdd3[_0x1258be(0x187)](_0x1258be(0x163)),_0x18024b=readKnowledgeFile(_0x11bdd3[_0x1258be(0x187)](_0x1258be(0x19c))),_0x440f54=await createPersonalKnowledgeBaseItem(_0x11bdd3['appCode'],{'title':_0xe2da38,'content':_0x18024b});return{'ok':!![],'data':summarizePersonalItem(_0x440f54),'message':_0x1258be(0x16c)+_0x440f54['id']+'\x20('+_0x440f54[_0x1258be(0x163)]+')'};},async 'dryRun'(_0x13393c){const _0x3ac48f=a26_0x15e62e,_0x51cb4a=_0x13393c['str']('title'),_0x2618c2=readKnowledgeFile(_0x13393c[_0x3ac48f(0x187)](_0x3ac48f(0x19c)));return dryRun('POST',_0x3ac48f(0x185))[_0x3ac48f(0x16e)]({'appCode':_0x13393c[_0x3ac48f(0x19d)],'title':_0x51cb4a,'content':_0x2618c2})['description'](_0x3ac48f(0x17f)+_0x51cb4a+'\x22')[_0x3ac48f(0x197)]();}},kbUpdate={'service':'kb','command':a26_0x15e62e(0x176),'description':a26_0x15e62e(0x191),'risk':a26_0x15e62e(0x179),'flags':[{...ID_FLAG,'description':a26_0x15e62e(0x1a1)},{...TITLE_FLAG,'required':![],'description':a26_0x15e62e(0x18a)},FILE_FLAG],async 'execute'(_0x5b82aa){const _0x2cd781=a26_0x15e62e,_0xfb85e=_0x5b82aa[_0x2cd781(0x175)]('id'),_0x11a0ee=readKnowledgeFile(_0x5b82aa[_0x2cd781(0x187)](_0x2cd781(0x19c))),_0x3554b5=_0x5b82aa[_0x2cd781(0x187)](_0x2cd781(0x163))||(await getPersonalKnowledgeBaseItem(_0xfb85e,_0x5b82aa[_0x2cd781(0x19d)]))[_0x2cd781(0x163)],_0x3cd88a=await updatePersonalKnowledgeBaseItem(_0xfb85e,_0x5b82aa[_0x2cd781(0x19d)],{'title':_0x3554b5,'content':_0x11a0ee});return{'ok':!![],'data':summarizePersonalItem(_0x3cd88a),'message':_0x2cd781(0x193)+_0x3cd88a['id']+'\x20('+_0x3cd88a['title']+')'};},async 'dryRun'(_0x5047cb){const _0x31496a=a26_0x15e62e,_0x2e44f0=_0x5047cb['num']('id'),_0x48c96a=readKnowledgeFile(_0x5047cb[_0x31496a(0x187)](_0x31496a(0x19c))),_0x250991=_0x5047cb[_0x31496a(0x187)](_0x31496a(0x163))||(await getPersonalKnowledgeBaseItem(_0x2e44f0,_0x5047cb['appCode']))[_0x31496a(0x163)];return dryRun('POST','/client/knowledge-base/personal/'+_0x2e44f0+'/update')[_0x31496a(0x16e)]({'appCode':_0x5047cb[_0x31496a(0x19d)],'title':_0x250991,'content':_0x48c96a})[_0x31496a(0x165)](_0x31496a(0x199)+_0x2e44f0)[_0x31496a(0x197)]();}},kbSearch={'service':'kb','command':'search','description':a26_0x15e62e(0x17a),'risk':'read','flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x150a00){const _0x15161f=a26_0x15e62e;if(!_0x150a00[_0x15161f(0x187)](_0x15161f(0x171))['trim']())throw CliErrors[_0x15161f(0x173)](_0x15161f(0x19e));readTopK(_0x150a00);},async 'execute'(_0x7fff53){const _0x5ce31b=a26_0x15e62e,_0x525f66=_0x7fff53[_0x5ce31b(0x187)](_0x5ce31b(0x171))[_0x5ce31b(0x190)](),_0x528b2c=readTopK(_0x7fff53),_0x185135=await searchKnowledgeBase(_0x7fff53[_0x5ce31b(0x19d)],{'query':_0x525f66,'topK':_0x528b2c});return{'ok':!![],'data':{'total':_0x185135[_0x5ce31b(0x1a3)],'hits':_0x185135['map'](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|