@lovrabet/lovrabet-cli 2.0.14-beta.7 → 2.0.14-beta.8
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(_0x1dd9d5,_0x42e8f4){const _0x1431ca=a15_0x54bd,_0x3eac4e=_0x1dd9d5();while(!![]){try{const _0x298913=-parseInt(_0x1431ca(0xa4))/0x1+-parseInt(_0x1431ca(0x9f))/0x2*(parseInt(_0x1431ca(0x94))/0x3)+-parseInt(_0x1431ca(0xa1))/0x4+parseInt(_0x1431ca(0xa8))/0x5+-parseInt(_0x1431ca(0x95))/0x6*(-parseInt(_0x1431ca(0x92))/0x7)+parseInt(_0x1431ca(0xa7))/0x8+parseInt(_0x1431ca(0x99))/0x9;if(_0x298913===_0x42e8f4)break;else _0x3eac4e['push'](_0x3eac4e['shift']());}catch(_0x2643fc){_0x3eac4e['push'](_0x3eac4e['shift']());}}}(a15_0x52e8,0x1c2c1));function a15_0x54bd(_0xcdbf,_0x25fc21){_0xcdbf=_0xcdbf-0x91;const _0x52e817=a15_0x52e8();let _0x54bd37=_0x52e817[_0xcdbf];return _0x54bd37;}import{CliErrors}from'../../errors.js';function isSet(_0x45631f,_0x45fd97){const _0x314061=a15_0x54bd,_0x4e8d53=_0x45631f[_0x314061(0xa5)](_0x45fd97);return _0x4e8d53!==undefined&&_0x4e8d53!==''&&_0x4e8d53!==![]&&_0x4e8d53!==0x0;}function a15_0x52e8(){const _0x3c01ec=['800308XbIjlh','length','Provide\x20one\x20of:\x20','33458MhkGJV','flag','Exactly\x20one\x20of\x20','682416nsdmUV','194195LcPNmP','\x20are\x20mutually\x20exclusive\x20for\x20`','some','1098713ThjqkW','Flags\x20','159SekNzg','6BGWTeY','map','str','Invalid\x20--','2222712AeZsvG','filter','join','Only\x20one\x20of\x20','At\x20least\x20one\x20of\x20','validation','6760IIljMT',':\x20expected\x20'];a15_0x52e8=function(){return _0x3c01ec;};return a15_0x52e8();}function fmtNames(_0xfe9aa8){const _0x3f8321=a15_0x54bd;return _0xfe9aa8[_0x3f8321(0x96)](_0x53a3bb=>'--'+_0x53a3bb)[_0x3f8321(0x9b)](',\x20');}export function requireOneOf(_0x51efd1,_0x55d58d,_0x31f711){const _0x13d77c=a15_0x54bd,_0x37e50f=_0x55d58d[_0x13d77c(0x9a)](_0x148b4a=>isSet(_0x51efd1,_0x148b4a));if(_0x37e50f[_0x13d77c(0xa2)]!==0x1)throw CliErrors[_0x13d77c(0x9e)](_0x37e50f[_0x13d77c(0xa2)]===0x0?_0x13d77c(0xa6)+fmtNames(_0x55d58d)+'\x20is\x20required\x20for\x20`'+_0x31f711+'`.':_0x13d77c(0x9c)+fmtNames(_0x55d58d)+'\x20is\x20allowed,\x20found:\x20'+fmtNames(_0x37e50f)+'.',_0x37e50f[_0x13d77c(0xa2)]===0x0?_0x13d77c(0xa3)+fmtNames(_0x55d58d):'Remove\x20all\x20but\x20one.');}export function requireAnyOf(_0x478b32,_0x509c22,_0x4c9318){const _0x1e5d3e=a15_0x54bd;if(!_0x509c22[_0x1e5d3e(0x91)](_0x285de4=>isSet(_0x478b32,_0x285de4)))throw CliErrors['validation'](_0x1e5d3e(0x9d)+fmtNames(_0x509c22)+'\x20is\x20required\x20for\x20`'+_0x4c9318+'`.',_0x1e5d3e(0xa3)+fmtNames(_0x509c22));}export function mutuallyExclusive(_0x314ac6,_0x36f248,_0x24aa58){const _0xeff68a=a15_0x54bd,_0x2b37f8=_0x36f248[_0xeff68a(0x9a)](_0x290772=>isSet(_0x314ac6,_0x290772));if(_0x2b37f8[_0xeff68a(0xa2)]>0x1)throw CliErrors[_0xeff68a(0x9e)](_0xeff68a(0x93)+fmtNames(_0x2b37f8)+_0xeff68a(0xa9)+_0x24aa58+'`.','Use\x20only\x20one\x20of:\x20'+fmtNames(_0x36f248));}export function validatePattern(_0x4d6e49,_0xd78015,_0x1d3488,_0x26835c){const _0x380d3f=a15_0x54bd,_0x17ea4c=_0x4d6e49[_0x380d3f(0x97)](_0xd78015);if(_0x17ea4c&&!_0x1d3488['test'](_0x17ea4c))throw CliErrors[_0x380d3f(0x9e)](_0x380d3f(0x98)+_0xd78015+_0x380d3f(0xa0)+_0x26835c+',\x20got\x20\x22'+_0x17ea4c+'\x22.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a16_0x5b0b15=a16_0x489d;(function(_0x1fb540,_0x173ce7){const _0x254bdb=a16_0x489d,_0x2d0e1b=_0x1fb540();while(!![]){try{const _0x205c95=parseInt(_0x254bdb(0x185))/0x1*(-parseInt(_0x254bdb(0x17e))/0x2)+parseInt(_0x254bdb(0x18c))/0x3*(parseInt(_0x254bdb(0x193))/0x4)+-parseInt(_0x254bdb(0x181))/0x5+parseInt(_0x254bdb(0x183))/0x6*(-parseInt(_0x254bdb(0x17c))/0x7)+parseInt(_0x254bdb(0x18a))/0x8+-parseInt(_0x254bdb(0x17d))/0x9+-parseInt(_0x254bdb(0x191))/0xa*(-parseInt(_0x254bdb(0x188))/0xb);if(_0x205c95===_0x173ce7)break;else _0x2d0e1b['push'](_0x2d0e1b['shift']());}catch(_0x5a68c2){_0x2d0e1b['push'](_0x2d0e1b['shift']());}}}(a16_0x33fe,0x2d794));function a16_0x489d(_0x2bc579,_0x55295f){_0x2bc579=_0x2bc579-0x17b;const _0x33feac=a16_0x33fe();let _0x489d3e=_0x33feac[_0x2bc579];return _0x489d3e;}export const CODE_FLAG={'name':a16_0x5b0b15(0x194),'type':a16_0x5b0b15(0x192),'required':!![],'description':a16_0x5b0b15(0x18d),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a16_0x5b0b15(0x186)}};export const SQLCODE_FLAG={'name':a16_0x5b0b15(0x182),'type':'string','required':!![],'description':a16_0x5b0b15(0x190),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a16_0x5b0b15(0x184)}};export const VERBOSE_FLAG={'name':a16_0x5b0b15(0x18f),'type':a16_0x5b0b15(0x180),'description':a16_0x5b0b15(0x17f)};export const PARAMS_FLAG={'name':a16_0x5b0b15(0x187),'type':a16_0x5b0b15(0x192),'description':a16_0x5b0b15(0x18e)};export const NAME_FLAG={'name':a16_0x5b0b15(0x17b),'type':'string','description':'Resource\x20name\x20for\x20lookup'};function a16_0x33fe(){const _0x5a339b=['4420zKtNqJ','Return\x20full\x20raw\x20response\x20object','boolean','503220FLiqFU','sqlcode','2154qHUUHa','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','16Qiplqh','a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)','params','2497099oZhqYg','Resource\x20ID','1886224LaEtCo','number','3pPSdpN','Dataset\x20code\x20(32-char\x20hex\x20UUID)','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','verbose','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','10HRjuip','string','579668OoYMpR','code','name','5033GExWXR','245871JDBEZc'];a16_0x33fe=function(){return _0x5a339b;};return a16_0x33fe();}export const ID_FLAG={'name':'id','type':a16_0x5b0b15(0x18b),'required':!![],'description':a16_0x5b0b15(0x189)};
|
|
@@ -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_0x248e34=a17_0x235e;(function(_0x2af652,_0x1268d1){const _0x307c35=a17_0x235e,_0x4e2ab8=_0x2af652();while(!![]){try{const _0x8b1343=-parseInt(_0x307c35(0xe3))/0x1+-parseInt(_0x307c35(0xf6))/0x2*(-parseInt(_0x307c35(0x100))/0x3)+parseInt(_0x307c35(0xcd))/0x4*(parseInt(_0x307c35(0xfb))/0x5)+parseInt(_0x307c35(0xe8))/0x6*(parseInt(_0x307c35(0xe7))/0x7)+-parseInt(_0x307c35(0xdd))/0x8+parseInt(_0x307c35(0xf0))/0x9+parseInt(_0x307c35(0xce))/0xa*(-parseInt(_0x307c35(0xd5))/0xb);if(_0x8b1343===_0x1268d1)break;else _0x4e2ab8['push'](_0x4e2ab8['shift']());}catch(_0x26cddf){_0x4e2ab8['push'](_0x4e2ab8['shift']());}}}(a17_0x3d42,0x3a245));function a17_0x3d42(){const _0x3a302b=['1190331qcIGzG','Settable\x20keys:\x20','Value\x20to\x20assign','length','Set\x20`','args','64696tNRDcL','bool','validation','\x20\x20project:\x20','Write\x20to\x20global\x20config','10YQTZTB','\x22.\x20Allowed:\x20','list','isArray','Get\x20a\x20config\x20value','21KarwGC','\x20(global)','object','Key\x20\x22','`\x20=\x20\x22','raw','keys','config','stringify','value','List\x20current\x20config','apps','Set\x20a\x20config\x20value','includes','Key\x20not\x20found:\x20','write','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','riskLevel','Missing\x20key\x20argument.','Missing\x20key\x20or\x20value.','811360BkHPuX','20ETDjuK','alias','field','key','Deleted\x20`','\x20config\x20get\x20<key>','Top-level\x20key\x20\x22','770594ubOtph','boolean','\x22\x20is\x20not\x20settable.','read','split','format','global','log','877896nAscge','Config\x20files:\x0a','\x20\x20global:\x20\x20','\x20config\x20set\x20<key>\x20<value>\x20[--global]','(none)','Delete\x20a\x20config\x20value','367017BesvKI','\x22\x20not\x20found\x20at\x20top\x20level.','Invalid\x20value\x20for\x20\x22','project-or-global-explicit','22659jrnbSo','168QasimF','pretty','set','appcode','Usage:\x20','trim','../../context.js','pageSize\x20must\x20be\x20a\x20positive\x20number'];a17_0x3d42=function(){return _0x3a302b;};return a17_0x3d42();}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_0x235e(_0xa7dc01,_0x41e2ac){_0xa7dc01=_0xa7dc01-0xbe;const _0x3d42cf=a17_0x3d42();let _0x235e24=_0x3d42cf[_0xa7dc01];return _0x235e24;}import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':a17_0x248e34(0xdb),'type':a17_0x248e34(0xd6),'description':a17_0x248e34(0xfa),'default':![]};function parseAliasAppcodeSetKey(_0x5be7fa){const _0x58be3c=a17_0x248e34,_0x3825b3=_0x5be7fa['split']('.');if(_0x3825b3['length']!==0x3||_0x3825b3[0x0]!==_0x58be3c(0xc4)||_0x3825b3[0x2]!==_0x58be3c(0xeb))return undefined;const _0x5e10e6=_0x3825b3[0x1]?.[_0x58be3c(0xed)]();return _0x5e10e6?_0x5e10e6:undefined;}function parseAliasDeleteKey(_0x1d54a9){const _0x72e93f=a17_0x248e34,_0x106ed7=_0x1d54a9[_0x72e93f(0xd9)]('.');if(_0x106ed7[_0x72e93f(0xf3)]===0x2&&_0x106ed7[0x0]===_0x72e93f(0xc4)){const _0x1174ab=_0x106ed7[0x1]?.[_0x72e93f(0xed)]();return _0x1174ab?{'alias':_0x1174ab}:undefined;}if(_0x106ed7[_0x72e93f(0xf3)]===0x3&&_0x106ed7[0x0]===_0x72e93f(0xc4)&&_0x106ed7[0x2]==='appcode'){const _0x1cc194=_0x106ed7[0x1]?.['trim']();return _0x1cc194?{'alias':_0x1cc194,'field':'appcode'}:undefined;}return undefined;}function setLocalAppAlias(_0x58a184,_0x300f23,_0x52de96){const _0x1bae9c=a17_0x248e34,_0x50e472=_0x58a184['apps']&&typeof _0x58a184['apps']==='object'&&!Array['isArray'](_0x58a184['apps'])?_0x58a184[_0x1bae9c(0xc4)]:{},_0x46abf6=_0x50e472[_0x300f23]&&typeof _0x50e472[_0x300f23]===_0x1bae9c(0x102)&&!Array[_0x1bae9c(0xfe)](_0x50e472[_0x300f23])?_0x50e472[_0x300f23]:{};_0x46abf6['appcode']=_0x52de96,_0x50e472[_0x300f23]=_0x46abf6,_0x58a184[_0x1bae9c(0xc4)]=_0x50e472;}function deleteLocalAppAlias(_0x5c5165,_0x31d6da){const _0x260fd1=a17_0x248e34;if(!_0x5c5165[_0x260fd1(0xc4)]||typeof _0x5c5165['apps']!==_0x260fd1(0x102)||Array[_0x260fd1(0xfe)](_0x5c5165[_0x260fd1(0xc4)]))return![];const _0x527d19=_0x5c5165[_0x260fd1(0xc4)],_0xf6c934=_0x527d19[_0x31d6da['alias']];if(!_0xf6c934||typeof _0xf6c934!==_0x260fd1(0x102)||Array[_0x260fd1(0xfe)](_0xf6c934))return![];if(!_0x31d6da[_0x260fd1(0xd0)])return delete _0x527d19[_0x31d6da[_0x260fd1(0xcf)]],!![];if(!(_0x31d6da[_0x260fd1(0xd0)]in _0xf6c934))return![];return delete _0xf6c934[_0x31d6da['field']],Object[_0x260fd1(0xbf)](_0xf6c934)[_0x260fd1(0xf3)]===0x0&&delete _0x527d19[_0x31d6da[_0x260fd1(0xcf)]],!![];}const listDef={'service':a17_0x248e34(0xc0),'command':a17_0x248e34(0xfd),'description':a17_0x248e34(0xc3),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x9a2549){const _0x492e17=a17_0x248e34,{buildConfigFromFlags:_0x305fd9}=await import(_0x492e17(0xee)),_0x334151=_0x305fd9({}),_0x2b2386=getProjectConfigPath(),_0x2619ea=resolveWriteConfigPath(_0x492e17(0xdb));if(_0x9a2549[_0x492e17(0xda)]===_0x492e17(0xe9))return{'ok':!![],'message':'#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a'+(JSON[_0x492e17(0xc1)](_0x334151[_0x492e17(0xbe)],null,0x2)+'\x0a\x0a')+_0x492e17(0xde)+(_0x492e17(0xf9)+(_0x2b2386??_0x492e17(0xe1))+'\x0a')+(_0x492e17(0xdf)+_0x2619ea)};return{'ok':!![],'data':{'effective':_0x334151[_0x492e17(0xbe)],'configFiles':{'project':_0x2b2386??null,'global':_0x2619ea}}};}},getDef={'service':a17_0x248e34(0xc0),'command':'get','description':a17_0x248e34(0xff),'risk':a17_0x248e34(0xd8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a17_0x248e34(0xd1),'description':a17_0x248e34(0xc9),'required':!![]}],'flags':[],async 'execute'(_0x5390a7){const _0x15f8dd=a17_0x248e34,_0x464822=_0x5390a7[_0x15f8dd(0xf5)][0x0];if(!_0x464822)throw CliErrors[_0x15f8dd(0xf8)]('Missing\x20key\x20argument.',_0x15f8dd(0xec)+CLI_BIN_NAME+_0x15f8dd(0xd3));const {buildConfigFromFlags:_0x450400}=await import('../../context.js'),{raw:_0x4661a3}=_0x450400({});if(_0x464822[_0x15f8dd(0xc6)]('.')){const _0x39f340=_0x464822[_0x15f8dd(0xd9)]('.');let _0x2d5eea=_0x4661a3;for(const _0x48af55 of _0x39f340){if(_0x2d5eea==null||typeof _0x2d5eea!==_0x15f8dd(0x102))throw CliErrors[_0x15f8dd(0xf8)]('Key\x20not\x20found:\x20'+_0x464822);_0x2d5eea=_0x2d5eea[_0x48af55];}if(_0x2d5eea===undefined)throw CliErrors['validation'](_0x15f8dd(0xc7)+_0x464822);return console[_0x15f8dd(0xdc)](typeof _0x2d5eea===_0x15f8dd(0x102)?JSON[_0x15f8dd(0xc1)](_0x2d5eea,null,0x2):String(_0x2d5eea)),{'ok':!![]};}const _0x42bedc=_0x4661a3[_0x464822];if(_0x42bedc===undefined)throw CliErrors[_0x15f8dd(0xf8)](_0x15f8dd(0xc7)+_0x464822);return console[_0x15f8dd(0xdc)](typeof _0x42bedc===_0x15f8dd(0x102)?JSON[_0x15f8dd(0xc1)](_0x42bedc,null,0x2):String(_0x42bedc)),{'ok':!![]};}},setDef={'service':a17_0x248e34(0xc0),'command':a17_0x248e34(0xea),'description':a17_0x248e34(0xc5),'risk':a17_0x248e34(0xc8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a17_0x248e34(0xd1),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a17_0x248e34(0xc2),'description':a17_0x248e34(0xf2),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x26bd93){const _0x417fc6=a17_0x248e34,_0x7a15ec=_0x26bd93['args'][0x0],_0x13865e=_0x26bd93['args'][0x1];if(!_0x7a15ec||_0x13865e===undefined)throw CliErrors['validation'](_0x417fc6(0xcc),'Usage:\x20'+CLI_BIN_NAME+_0x417fc6(0xe0));if(ENUM_KEYS[_0x7a15ec]&&!ENUM_KEYS[_0x7a15ec][_0x417fc6(0xc6)](_0x13865e))throw CliErrors['validation'](_0x417fc6(0xe5)+_0x7a15ec+_0x417fc6(0xfc)+ENUM_KEYS[_0x7a15ec]['join'](',\x20'));if(_0x7a15ec===_0x417fc6(0xca))throw CliErrors[_0x417fc6(0xf8)]('\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.');if(_0x7a15ec==='pageSize'){const _0x317b9f=Number(_0x13865e);if(isNaN(_0x317b9f)||_0x317b9f<=0x0)throw CliErrors[_0x417fc6(0xf8)](_0x417fc6(0xef));}const _0x2de08a=resolveWriteScope({'explicitGlobal':_0x26bd93[_0x417fc6(0xf7)](_0x417fc6(0xdb)),'policy':_0x417fc6(0xe6)}),_0x4eed0a=toScopeFlags(_0x2de08a),_0x52d7d3=readScopedConfig(_0x4eed0a),_0x1de024=parseAliasAppcodeSetKey(_0x7a15ec);if(!_0x1de024&&!isTopLevelConfigKey(_0x7a15ec))throw CliErrors[_0x417fc6(0xf8)](_0x417fc6(0xd4)+_0x7a15ec+_0x417fc6(0xd7),_0x417fc6(0xf1)+getTopLevelConfigKeySummary()+';\x20apps.<alias>.appcode');return _0x1de024?setLocalAppAlias(_0x52d7d3,_0x1de024,_0x13865e):_0x52d7d3[_0x7a15ec]=_0x7a15ec==='pageSize'?Number(_0x13865e):_0x13865e,console[_0x417fc6(0xdc)](_0x417fc6(0xf4)+_0x7a15ec+_0x417fc6(0x104)+_0x13865e+'\x22'+(_0x2de08a===_0x417fc6(0xdb)?_0x417fc6(0x101):'')),writeScopedConfig(_0x52d7d3,_0x4eed0a),{'ok':!![]};}},deleteDef={'service':a17_0x248e34(0xc0),'command':'delete','description':a17_0x248e34(0xe2),'risk':a17_0x248e34(0xc8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a17_0x248e34(0xd1),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x3496bb){const _0x20f6c8=a17_0x248e34,_0xf54243=_0x3496bb[_0x20f6c8(0xf5)][0x0];if(!_0xf54243)throw CliErrors[_0x20f6c8(0xf8)](_0x20f6c8(0xcb),_0x20f6c8(0xec)+CLI_BIN_NAME+'\x20config\x20delete\x20<key>\x20[--global]');const _0x1673a5=resolveWriteScope({'explicitGlobal':_0x3496bb[_0x20f6c8(0xf7)](_0x20f6c8(0xdb)),'policy':'project-or-global-explicit'}),_0x328cee=toScopeFlags(_0x1673a5),_0x4cfe21=readScopedConfig(_0x328cee),_0x3bf9d5=parseAliasDeleteKey(_0xf54243);if(_0x3bf9d5){if(!deleteLocalAppAlias(_0x4cfe21,_0x3bf9d5))throw CliErrors['validation']('Key\x20not\x20found:\x20'+_0xf54243);return console[_0x20f6c8(0xdc)]('Deleted\x20`'+_0xf54243+'`'+(_0x1673a5===_0x20f6c8(0xdb)?_0x20f6c8(0x101):'')),writeScopedConfig(_0x4cfe21,_0x328cee),{'ok':!![]};}if(_0x4cfe21[_0xf54243]===undefined)throw CliErrors['validation'](_0x20f6c8(0x103)+_0xf54243+_0x20f6c8(0xe4));return delete _0x4cfe21[_0xf54243],console[_0x20f6c8(0xdc)](_0x20f6c8(0xd2)+_0xf54243+'`'+(_0x1673a5===_0x20f6c8(0xdb)?_0x20f6c8(0x101):'')),writeScopedConfig(_0x4cfe21,_0x328cee),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x104c3a,_0x3c5399){var _0x66368d=a18_0x3232,_0xd302af=_0x104c3a();while(!![]){try{var _0x18b970=parseInt(_0x66368d(0x94))/0x1+parseInt(_0x66368d(0x96))/0x2+parseInt(_0x66368d(0x9b))/0x3+parseInt(_0x66368d(0x97))/0x4*(-parseInt(_0x66368d(0x9a))/0x5)+parseInt(_0x66368d(0x91))/0x6*(-parseInt(_0x66368d(0x99))/0x7)+parseInt(_0x66368d(0x92))/0x8*(-parseInt(_0x66368d(0x98))/0x9)+parseInt(_0x66368d(0x95))/0xa*(parseInt(_0x66368d(0x93))/0xb);if(_0x18b970===_0x3c5399)break;else _0xd302af['push'](_0xd302af['shift']());}catch(_0x50df81){_0xd302af['push'](_0xd302af['shift']());}}}(a18_0x3918,0x50082));import{CLI_BIN_NAME}from'../../constant/cli.js';export{CLI_BIN_NAME};export{readScopedConfig,writeScopedConfig}from'../../context.js';function a18_0x3232(_0x92e4a9,_0x394507){_0x92e4a9=_0x92e4a9-0x91;var _0x3918a5=a18_0x3918();var _0x32320c=_0x3918a5[_0x92e4a9];return _0x32320c;}function a18_0x3918(){var _0x17a8e8=['460dbnmEy','445554jTIpvF','2175052OoVIML','1042623qhNrxs','3899ykytiT','5dxBGwI','686103Rqqktm','2016tLLzQD','32TjmcAg','149237rOgpnp','446553mhzKFH'];a18_0x3918=function(){return _0x17a8e8;};return a18_0x3918();}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';
|
|
@@ -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_0x57542f=a19_0x3919;(function(_0x560ae8,_0x20c638){const _0x1db67d=a19_0x3919,_0x305f36=_0x560ae8();while(!![]){try{const _0x3581ef=parseInt(_0x1db67d(0x1f8))/0x1*(parseInt(_0x1db67d(0x229))/0x2)+parseInt(_0x1db67d(0x228))/0x3*(-parseInt(_0x1db67d(0x205))/0x4)+parseInt(_0x1db67d(0x203))/0x5+parseInt(_0x1db67d(0x235))/0x6+parseInt(_0x1db67d(0x20c))/0x7*(-parseInt(_0x1db67d(0x217))/0x8)+parseInt(_0x1db67d(0x23a))/0x9+-parseInt(_0x1db67d(0x1f2))/0xa*(-parseInt(_0x1db67d(0x20e))/0xb);if(_0x3581ef===_0x20c638)break;else _0x305f36['push'](_0x305f36['shift']());}catch(_0x176524){_0x305f36['push'](_0x305f36['shift']());}}}(a19_0x1413,0x5cae5));import{executeData}from'../../core/sdk-client.js';function a19_0x1413(){const _0x271b93=['data\x20','build','\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}','Filter\x20dataset\x20records\x20with\x20query\x20conditions','\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\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','/api/{appCode}/','\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$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','\x20\x20WHERE\x20OPERATORS','write','code','6246uaAnmk','551434pFuwFw','\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}','command','filter','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\x20on\x20dataset\x20','Get\x20a\x20single\x20record\x20by\x20ID','\x20\x20LOGICAL\x20COMBINATORS','high-risk-write','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','\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}}','Update\x20an\x20existing\x20record','2393682FmYHLQ','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','POST','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','654012wXoBAF','\x20\x20AGGREGATE\x20TYPES','\x20\x20PAGINATION','\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}}','\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\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}','aggregate','create','map','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','risk','params','\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--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','170mFYSsh','paramsHint','\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\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}','read','update','1xOmrND','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','batchCreate','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','now','description','operation','join','417770yVApwa','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','1024nGuCbr','paramsRequired','Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20EXAMPLES','delete','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','\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}','1379cdwgZc','str','81818FYnqsB','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','dryRun','\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}}]','Preview:\x20data\x20','\x20\x20PARAMS\x20STRUCTURE','\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}}]}','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','1816mkZYLi','\x20completed\x20in\x20','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','Create\x20a\x20new\x20record\x20in\x20a\x20dataset'];a19_0x1413=function(){return _0x271b93;};return a19_0x1413();}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_0x3919(_0x24c9ea,_0x18513d){_0x24c9ea=_0x24c9ea-0x1eb;const _0x1413da=a19_0x1413();let _0x391908=_0x1413da[_0x24c9ea];return _0x391908;}import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a19_0x57542f(0x22c),'operation':a19_0x57542f(0x22c),'risk':a19_0x57542f(0x1f6),'paramsRequired':![],'description':a19_0x57542f(0x21f),'paramsHint':a19_0x57542f(0x219)+a19_0x57542f(0x215),'helpExtra':[a19_0x57542f(0x225),a19_0x57542f(0x1f4),a19_0x57542f(0x1f0),'\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_0x57542f(0x224),a19_0x57542f(0x233),a19_0x57542f(0x23d),a19_0x57542f(0x223),'\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}}',a19_0x57542f(0x1fa),'\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}}','',a19_0x57542f(0x230),'\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_0x57542f(0x214),'',a19_0x57542f(0x1ed),'\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)',a19_0x57542f(0x236),a19_0x57542f(0x239),a19_0x57542f(0x20f),'\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','',a19_0x57542f(0x23c),a19_0x57542f(0x1f9),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)']['join']('\x0a')},{'command':'getOne','operation':'getOne','risk':a19_0x57542f(0x1f6),'paramsRequired':!![],'description':a19_0x57542f(0x22f),'paramsHint':a19_0x57542f(0x22d)},{'command':a19_0x57542f(0x1eb),'operation':a19_0x57542f(0x1eb),'risk':a19_0x57542f(0x226),'paramsRequired':!![],'description':a19_0x57542f(0x21b),'paramsHint':'JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27'},{'command':a19_0x57542f(0x1fb),'operation':a19_0x57542f(0x1fb),'risk':'write','paramsRequired':!![],'description':a19_0x57542f(0x1fe),'paramsHint':a19_0x57542f(0x1fc)},{'command':a19_0x57542f(0x1f7),'operation':'update','risk':'write','paramsRequired':!![],'description':a19_0x57542f(0x234),'paramsHint':a19_0x57542f(0x21a)},{'command':'delete','operation':a19_0x57542f(0x209),'risk':a19_0x57542f(0x231),'paramsRequired':!![],'description':a19_0x57542f(0x232),'paramsHint':a19_0x57542f(0x22d)},{'command':'aggregate','operation':a19_0x57542f(0x240),'risk':a19_0x57542f(0x1f6),'paramsRequired':![],'description':a19_0x57542f(0x20a),'paramsHint':a19_0x57542f(0x216)+a19_0x57542f(0x207),'helpExtra':[a19_0x57542f(0x23b),a19_0x57542f(0x220),a19_0x57542f(0x23f),a19_0x57542f(0x22a),a19_0x57542f(0x20b),'\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}',a19_0x57542f(0x1f5),a19_0x57542f(0x21e),'',a19_0x57542f(0x213),a19_0x57542f(0x238),'\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)',a19_0x57542f(0x221),a19_0x57542f(0x1fd),a19_0x57542f(0x211),'\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','',a19_0x57542f(0x208),a19_0x57542f(0x204),a19_0x57542f(0x23e),'','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter',a19_0x57542f(0x1f1),'','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.'][a19_0x57542f(0x202)]('\x0a')}];function makeDataCommand(_0x1b0b73){const _0x2525d5=a19_0x57542f,_0x32a087=_0x2525d5(0x21c)+_0x1b0b73[_0x2525d5(0x22b)],_0x18cfaf={'service':'data','command':_0x1b0b73[_0x2525d5(0x22b)],'description':_0x1b0b73[_0x2525d5(0x200)],'risk':_0x1b0b73[_0x2525d5(0x1ee)],'helpExtra':_0x1b0b73['helpExtra'],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x1b0b73[_0x2525d5(0x1f3)]}],'validate':async _0x2901b9=>{const _0x23b6ab=_0x2525d5;_0x1b0b73[_0x23b6ab(0x206)]&&requireAnyOf(_0x2901b9,['params'],_0x32a087),_0x1b0b73[_0x23b6ab(0x201)]===_0x23b6ab(0x1fb)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x2901b9[_0x23b6ab(0x20d)]('params')));},async 'execute'(_0x159258){const _0x17a37d=_0x2525d5,_0x5b5955=_0x159258['str'](_0x17a37d(0x227)),_0x4a2cc4=_0x1b0b73['operation']==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x159258[_0x17a37d(0x20d)](_0x17a37d(0x1ef)))):parseJsonParams(_0x159258[_0x17a37d(0x20d)]('params'))??{},_0x30b7c9=Date[_0x17a37d(0x1ff)](),_0x531373=await executeData(_0x5b5955,_0x1b0b73[_0x17a37d(0x201)],_0x4a2cc4),_0x226967=Date[_0x17a37d(0x1ff)]()-_0x30b7c9;return{'ok':!![],'data':{'result':_0x531373,'elapsed':_0x226967},'message':'data\x20'+_0x1b0b73[_0x17a37d(0x22b)]+_0x17a37d(0x218)+_0x226967+'ms'};}};return _0x1b0b73[_0x2525d5(0x1ee)]!==_0x2525d5(0x1f6)&&(_0x18cfaf[_0x2525d5(0x210)]=async _0x579b48=>{const _0x3856cc=_0x2525d5,_0x4ab7f3=_0x579b48['str']('code'),_0x60d922=_0x1b0b73[_0x3856cc(0x201)]===_0x3856cc(0x1fb)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x579b48[_0x3856cc(0x20d)](_0x3856cc(0x1ef)))):parseJsonParams(_0x579b48['str']('params'))??{};return dryRun(_0x3856cc(0x237),_0x3856cc(0x222)+_0x4ab7f3+'/'+_0x1b0b73[_0x3856cc(0x201)])['body'](_0x60d922)[_0x3856cc(0x200)](_0x3856cc(0x212)+_0x1b0b73[_0x3856cc(0x22b)]+_0x3856cc(0x22e)+_0x4ab7f3)[_0x3856cc(0x21d)]();}),_0x18cfaf;}export const dataDefinitions=specs[a19_0x57542f(0x1ec)](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x2024f9=a20_0x10a2;(function(_0x14a36e,_0x1e1616){const _0x25bb49=a20_0x10a2,_0x475701=_0x14a36e();while(!![]){try{const _0x459ab6=parseInt(_0x25bb49(0xa5))/0x1*(-parseInt(_0x25bb49(0x9d))/0x2)+-parseInt(_0x25bb49(0xc7))/0x3+-parseInt(_0x25bb49(0xa8))/0x4*(-parseInt(_0x25bb49(0xb6))/0x5)+-parseInt(_0x25bb49(0xcb))/0x6+parseInt(_0x25bb49(0xd4))/0x7*(parseInt(_0x25bb49(0xb1))/0x8)+parseInt(_0x25bb49(0xb4))/0x9*(parseInt(_0x25bb49(0xb5))/0xa)+parseInt(_0x25bb49(0xc5))/0xb;if(_0x459ab6===_0x1e1616)break;else _0x475701['push'](_0x475701['shift']());}catch(_0x3215ac){_0x475701['push'](_0x475701['shift']());}}}(a20_0x127b,0x50a87));import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x260a47){const _0x245147=a20_0x10a2;if(_0x260a47[_0x245147(0x98)])return null;const _0x22ec6e=Boolean(_0x260a47[_0x245147(0xa2)]!==undefined||_0x260a47['doType']!==undefined);let _0x1ddcd2={};if(!_0x22ec6e&&typeof _0x260a47[_0x245147(0x90)]==='string')try{_0x1ddcd2=JSON[_0x245147(0xbf)](_0x260a47['extend']);}catch{}const _0x5c1682=_0x22ec6e?_0x260a47[_0x245147(0xac)]:_0x260a47[_0x245147(0xc3)],_0x21f3a6=_0x22ec6e?_0x260a47[_0x245147(0xa2)]:_0x260a47[_0x245147(0xac)],_0x218198=_0x22ec6e?_0x260a47['doType']:_0x260a47[_0x245147(0xb0)]||_0x260a47[_0x245147(0xbb)],_0x10db82=_0x22ec6e?_0x260a47[_0x245147(0x9e)]===!![]:_0x1ddcd2[_0x245147(0x9e)]===!![],_0x1ffe2c=_0x22ec6e?_0x260a47[_0x245147(0xc2)]===!![]:_0x1ddcd2['required']===!![],_0x574953=_0x22ec6e?_0x260a47[_0x245147(0xae)]??null:_0x1ddcd2[_0x245147(0xae)]??null,_0x3665eb={'name':_0x5c1682,'displayName':_0x21f3a6||_0x5c1682,'type':_0x218198,'dbType':_0x260a47[_0x245147(0xa0)],'pk':_0x10db82,'required':_0x1ffe2c,'description':_0x260a47[_0x245147(0xb8)]||undefined};return Array[_0x245147(0xa9)](_0x574953)&&_0x574953[_0x245147(0x91)]>0x0&&(_0x3665eb[_0x245147(0xae)]=_0x574953),_0x3665eb;}function parseJsonMaybe(_0x10c325){const _0x55b182=a20_0x10a2;if(typeof _0x10c325!==_0x55b182(0xaf))return _0x10c325;try{return JSON[_0x55b182(0xbf)](_0x10c325);}catch{return _0x10c325;}}function normalizeOperationEntry(_0x5ea729,_0x2369cc){const _0x39a760=a20_0x10a2;if(!_0x2369cc||typeof _0x2369cc!==_0x39a760(0xab))return null;if(!_0x2369cc[_0x39a760(0xa7)]||!_0x2369cc[_0x39a760(0xba)])return null;const _0x48943c={'name':_0x5ea729,'method':_0x2369cc[_0x39a760(0xa7)],'path':_0x2369cc[_0x39a760(0xba)]};if(_0x2369cc[_0x39a760(0xad)])_0x48943c['host']=_0x2369cc[_0x39a760(0xad)];if(_0x2369cc[_0x39a760(0xd8)]!=null)_0x48943c[_0x39a760(0xd8)]=parseJsonMaybe(_0x2369cc[_0x39a760(0xd8)]);if(_0x2369cc[_0x39a760(0xd1)]!=null)_0x48943c['responseBody']=parseJsonMaybe(_0x2369cc[_0x39a760(0xd1)]);if(_0x2369cc[_0x39a760(0xc6)]!=null)_0x48943c['beforeScriptId']=_0x2369cc['beforeScriptId'];if(_0x2369cc[_0x39a760(0xb7)]!=null)_0x48943c[_0x39a760(0xb7)]=_0x2369cc[_0x39a760(0xb7)];if(Array[_0x39a760(0xa9)](_0x2369cc[_0x39a760(0xa4)]))_0x48943c[_0x39a760(0xa4)]=_0x2369cc[_0x39a760(0xa4)];if(Array[_0x39a760(0xa9)](_0x2369cc[_0x39a760(0xc0)]))_0x48943c[_0x39a760(0xc0)]=_0x2369cc[_0x39a760(0xc0)];return _0x48943c;}function summarizeDbtable(_0x45c79b){const _0x385518=a20_0x10a2,_0x4a7d18={},_0x43d847=[_0x385518(0xd5),'dbName','tableName',_0x385518(0x95),'pkField',_0x385518(0xa1),'logicField',_0x385518(0xd2),'updateTimeField','creatorIdField','creatorNameField','modifierIdField',_0x385518(0xd6),_0x385518(0xd7),_0x385518(0x9c)];for(const _0x2439a3 of _0x43d847){if(_0x45c79b[_0x2439a3]!==undefined)_0x4a7d18[_0x2439a3]=_0x45c79b[_0x2439a3];}return typeof _0x4a7d18[_0x385518(0xa1)]===_0x385518(0xaf)&&_0x4a7d18[_0x385518(0xa1)][_0x385518(0x91)]>0x0&&(_0x4a7d18[_0x385518(0x9f)]=_0x4a7d18[_0x385518(0xa1)][_0x385518(0xa6)](',')[_0x385518(0xb3)](_0x35c4f4=>_0x35c4f4[_0x385518(0xa3)]())[_0x385518(0xb9)](Boolean)),_0x4a7d18;}function a20_0x127b(){const _0x18fd92=['fields','object','name','host','options','string','type','2511968neigDA','formatRules','map','9udhnsk','5046100AGIqTK','245uHaDDH','afterScriptId','description','filter','path','dataType','source','validateRules','str','parse','responseFields','toDatasetCode','required','code','title','1067286WXQwfU','beforeScriptId','1193703zRTHZK','dbtableConfig','operations','toField','910872BescRy','tableName','relations','push','properties','dbName','responseBody','createTimeField','modelCode','14fFMCEo','dbId','modifierNameField','labelField','requestBody','read','extend','length','appCode','indexes','toDatasetName','datasetKey','dataset','doVersion','deleted','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','toFieldLabel','sourceType','dblinkInfoDTO','8lkiuPI','pkField','allFieldNames','dbType','allFields','displayName','trim','requestFields','90962WTilTH','split','method','1168QQKeoe','isArray'];a20_0x127b=function(){return _0x18fd92;};return a20_0x127b();}function normalizeRelatedPages(_0x199dea){const _0x3a67d3=a20_0x10a2;if(!Array[_0x3a67d3(0xa9)](_0x199dea))return[];return _0x199dea[_0x3a67d3(0xb9)](_0x13c960=>_0x13c960&&typeof _0x13c960===_0x3a67d3(0xab))[_0x3a67d3(0xb3)](_0x51254a=>({'id':_0x51254a['id'],'type':_0x51254a[_0x3a67d3(0xb0)],'code':_0x51254a[_0x3a67d3(0xc3)],'title':_0x51254a[_0x3a67d3(0xc4)],'deleted':_0x51254a['deleted']===!![]}));}function normalizeFallbackFieldName(_0x1422f2,_0xd4e9ed){const _0x27987b=a20_0x10a2,_0x2274db=_0x1422f2[_0x27987b(0xa3)]();if(!_0x2274db)return null;return{'name':_0x2274db,'displayName':_0x2274db,'type':undefined,'dbType':undefined,'pk':_0x2274db===_0xd4e9ed,'required':![],'description':undefined};}async function loadListFieldFallback(_0x166284,_0x426bee){const _0x268659=a20_0x10a2;if(!_0x166284||!_0x426bee)return[];try{const _0x2a2558=await listDatasets(_0x166284,{'code':_0x426bee}),_0xd5a8ca=_0x2a2558['find'](_0x147801=>_0x147801[_0x268659(0xc3)]===_0x426bee)??_0x2a2558[0x0],_0x4c18b5=_0xd5a8ca?.[_0x268659(0xc8)]??{},_0x236da3=typeof _0x4c18b5[_0x268659(0xa1)]===_0x268659(0xaf)?_0x4c18b5['allFields']['split'](','):[];return _0x236da3[_0x268659(0xb3)](_0x38f0e4=>normalizeFallbackFieldName(_0x38f0e4,_0x4c18b5[_0x268659(0x9e)]))['filter'](_0x4be66a=>_0x4be66a!==null);}catch{return[];}}function a20_0x10a2(_0x46cac4,_0x55844f){_0x46cac4=_0x46cac4-0x8f;const _0x127b5b=a20_0x127b();let _0x10a2d3=_0x127b5b[_0x46cac4];return _0x10a2d3;}export const datasetDetail={'service':'dataset','command':'detail','description':a20_0x2024f9(0x99),'risk':a20_0x2024f9(0x8f),'flags':[CODE_FLAG],async 'execute'(_0x1af63f){const _0x5b5727=a20_0x2024f9,_0x36a025=await getDatasetDetail(_0x1af63f[_0x5b5727(0xbe)](_0x5b5727(0xc3))),_0xf9f85b=Array[_0x5b5727(0xa9)](_0x36a025['fields'])?_0x36a025[_0x5b5727(0xaa)]:Array[_0x5b5727(0xa9)](_0x36a025[_0x5b5727(0xcf)])?_0x36a025[_0x5b5727(0xcf)]:[];let _0x200fc4=_0xf9f85b[_0x5b5727(0xb3)](_0x503792=>normalizeField(_0x503792))[_0x5b5727(0xb9)](_0xd050c0=>_0xd050c0!==null);_0x200fc4[_0x5b5727(0x91)]===0x0&&(_0x200fc4=await loadListFieldFallback(_0x1af63f[_0x5b5727(0x92)],_0x1af63f[_0x5b5727(0xbe)](_0x5b5727(0xc3))));const _0x51b804=_0x36a025[_0x5b5727(0xc9)]??{},_0x59641e=[];for(const [_0xe47d55,_0x2d22e8]of Object['entries'](_0x51b804)){const _0x5f0c05=normalizeOperationEntry(_0xe47d55,_0x2d22e8);if(_0x5f0c05)_0x59641e[_0x5b5727(0xce)](_0x5f0c05);}const _0x537f2b=_0x36a025[_0x5b5727(0xc8)]??{},_0x12d045=_0x36a025[_0x5b5727(0x96)]??{},_0x380efc=_0x537f2b['dbId']!=null?{'id':_0x537f2b[_0x5b5727(0xd5)],'name':_0x537f2b[_0x5b5727(0xd0)]??null}:undefined;let _0x23807a;return typeof _0x36a025[_0x5b5727(0x90)]===_0x5b5727(0xaf)&&(_0x23807a=parseJsonMaybe(_0x36a025[_0x5b5727(0x90)])),{'ok':!![],'data':{'id':_0x36a025['modelId']??_0x36a025['id'],'name':_0x36a025[_0x5b5727(0xac)],'code':_0x36a025[_0x5b5727(0xd3)]||_0x36a025[_0x5b5727(0xc3)],'doVersion':_0x36a025[_0x5b5727(0x97)],'description':_0x36a025['description']||_0x12d045['tableComment']||undefined,'source':_0x36a025[_0x5b5727(0xbc)]||_0x12d045[_0x5b5727(0x9b)],'table':_0x537f2b['tableName']||_0x12d045[_0x5b5727(0xcc)],'datasetKey':_0x537f2b[_0x5b5727(0x95)],'pk':_0x537f2b[_0x5b5727(0x9e)],'db':_0x380efc,'dbtable':summarizeDbtable(_0x537f2b),'fields':_0x200fc4,'operations':_0x59641e,'indexes':Array[_0x5b5727(0xa9)](_0x12d045[_0x5b5727(0x93)])?_0x12d045[_0x5b5727(0x93)]:[],'relations':Array[_0x5b5727(0xa9)](_0x36a025[_0x5b5727(0xcd)])?_0x36a025[_0x5b5727(0xcd)][_0x5b5727(0xb3)](_0x5d0ddb=>({'fromField':_0x5d0ddb['fromField'],'toDataset':_0x5d0ddb[_0x5b5727(0x94)],'toCode':_0x5d0ddb[_0x5b5727(0xc1)],'toTable':_0x5d0ddb['toTableName'],'toField':_0x5d0ddb[_0x5b5727(0xca)],'labelField':_0x5d0ddb[_0x5b5727(0x9a)]||undefined})):[],'relatedPages':normalizeRelatedPages(_0x36a025['relatedPageInfoList']),...Array['isArray'](_0x36a025['columnCodeListWithDeleted'])?{'columnCodeListWithDeleted':_0x36a025['columnCodeListWithDeleted']}:{},'formatRules':Array[_0x5b5727(0xa9)](_0x36a025[_0x5b5727(0xb2)])?_0x36a025[_0x5b5727(0xb2)]:[],'validateRules':Array[_0x5b5727(0xa9)](_0x36a025['validateRules'])?_0x36a025[_0x5b5727(0xbd)]:[],..._0x23807a!==undefined?{'extend':_0x23807a}:{},'stats':{'fieldCount':_0x200fc4[_0x5b5727(0x91)],'operationCount':_0x59641e['length']}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2ae531,_0x599247){const _0x4c5d7a=a21_0x27ba,_0x2297a2=_0x2ae531();while(!![]){try{const _0x3b88a8=parseInt(_0x4c5d7a(0x10f))/0x1+-parseInt(_0x4c5d7a(0x114))/0x2+parseInt(_0x4c5d7a(0x110))/0x3*(-parseInt(_0x4c5d7a(0x115))/0x4)+-parseInt(_0x4c5d7a(0x113))/0x5*(parseInt(_0x4c5d7a(0x117))/0x6)+parseInt(_0x4c5d7a(0x111))/0x7*(-parseInt(_0x4c5d7a(0x10e))/0x8)+-parseInt(_0x4c5d7a(0x10d))/0x9+parseInt(_0x4c5d7a(0x112))/0xa*(parseInt(_0x4c5d7a(0x116))/0xb);if(_0x3b88a8===_0x599247)break;else _0x2297a2['push'](_0x2297a2['shift']());}catch(_0x24e119){_0x2297a2['push'](_0x2297a2['shift']());}}}(a21_0x3d4b,0x679cb));import{datasetList}from'../../commands/dataset/list.js';function a21_0x27ba(_0x589dcf,_0x2c54ed){_0x589dcf=_0x589dcf-0x10d;const _0x3d4b4d=a21_0x3d4b();let _0x27bac0=_0x3d4b4d[_0x589dcf];return _0x27bac0;}function a21_0x3d4b(){const _0x38c659=['4727178BkHvfh','50496qwFmWA','224074trMbFZ','10683ngYPfU','266qRZami','26893990aKcxle','3524795MjqKRO','1518136tXMacl','292joFhAq','11BXaRsB','6PzBBkm'];a21_0x3d4b=function(){return _0x38c659;};return a21_0x3d4b();}import{datasetDetail}from'../../commands/dataset/detail.js';import{datasetSdkDoc}from'../../commands/dataset/sdk-doc.js';export const datasetDefinitions=[datasetList,datasetDetail,datasetSdkDoc];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a22_0x2303(_0x23c7be,_0x17a801){_0x23c7be=_0x23c7be-0x10e;const _0x50eca4=a22_0x50ec();let _0x23038=_0x50eca4[_0x23c7be];return _0x23038;}const a22_0x51c346=a22_0x2303;(function(_0x17802a,_0x5d251d){const _0x5df319=a22_0x2303,_0x46d731=_0x17802a();while(!![]){try{const _0x530a5f=parseInt(_0x5df319(0x114))/0x1*(parseInt(_0x5df319(0x11c))/0x2)+-parseInt(_0x5df319(0x116))/0x3*(-parseInt(_0x5df319(0x117))/0x4)+-parseInt(_0x5df319(0x11a))/0x5*(-parseInt(_0x5df319(0x11e))/0x6)+-parseInt(_0x5df319(0x125))/0x7*(-parseInt(_0x5df319(0x111))/0x8)+parseInt(_0x5df319(0x119))/0x9+-parseInt(_0x5df319(0x11b))/0xa+-parseInt(_0x5df319(0x10f))/0xb*(parseInt(_0x5df319(0x123))/0xc);if(_0x530a5f===_0x5d251d)break;else _0x46d731['push'](_0x46d731['shift']());}catch(_0x3404bc){_0x46d731['push'](_0x46d731['shift']());}}}(a22_0x50ec,0xa5d97));import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';export const datasetList={'service':a22_0x51c346(0x120),'command':'list','description':a22_0x51c346(0x118),'risk':'read','flags':[{'name':a22_0x51c346(0x115),'type':a22_0x51c346(0x122),'description':a22_0x51c346(0x124)},{...CODE_FLAG,'required':![],'description':a22_0x51c346(0x126)}],async 'execute'(_0x2b0342){const _0x4ba547=a22_0x51c346,_0x169071=_0x2b0342[_0x4ba547(0x112)]('name'),_0x30da73=_0x2b0342['str']('code'),_0x220b77=await listDatasets(_0x2b0342['appCode'],{..._0x169071&&{'name':_0x169071},..._0x30da73&&{'code':_0x30da73}});return{'ok':!![],'data':{'total':_0x220b77[_0x4ba547(0x11f)],'datasets':_0x220b77[_0x4ba547(0x128)](_0x18ed3c=>{const _0x4b567d=_0x4ba547,_0xf4a0b3=_0x18ed3c[_0x4b567d(0x121)]??{};return{'id':_0x18ed3c['id'],'code':_0x18ed3c['code'],'name':_0x18ed3c['name'],'source':_0x18ed3c[_0x4b567d(0x129)],'description':_0x18ed3c[_0x4b567d(0x11d)],'table':_0xf4a0b3[_0x4b567d(0x110)],'datasetKey':_0xf4a0b3['datasetKey'],'pk':_0xf4a0b3['pkField'],'fields':_0xf4a0b3['allFields']?_0xf4a0b3[_0x4b567d(0x113)][_0x4b567d(0x127)](',')[_0x4b567d(0x128)](_0x169cc9=>_0x169cc9[_0x4b567d(0x10e)]()):[]};})}};}};function a22_0x50ec(){const _0x2572c3=['allFields','1BJkODm','name','120066vNHkFV','124uouyIc','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','4171599uIXNlp','115ztdZtB','6565000cFEmtW','1883770xNQzti','description','16572UzlhXK','length','dataset','dbtableConfig','string','12ymFLof','Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)','1253DydauE','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','split','map','source','trim','26649975wbqfUI','tableName','46880hUgoCC','str'];a22_0x50ec=function(){return _0x2572c3;};return a22_0x50ec();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x5910e9=a23_0x4517;function a23_0x4517(_0x3fd0c1,_0x5b0be2){_0x3fd0c1=_0x3fd0c1-0xa2;const _0x2026b1=a23_0x2026();let _0x451719=_0x2026b1[_0x3fd0c1];return _0x451719;}function a23_0x2026(){const _0x2cf1fe=['sdk-doc','4397193LhBMgF','9636540baheap','45992obvRQJ','4730404GeCcgD','10gHhlTY','56oQBdLG','trim','str','appCode','2nXXcrq','#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档','code','1112733zkIwkt','Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','6078305bSbmbU','1586473QNrHtO','Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code'];a23_0x2026=function(){return _0x2cf1fe;};return a23_0x2026();}(function(_0x168695,_0x4e2c45){const _0x497ea1=a23_0x4517,_0x12dd66=_0x168695();while(!![]){try{const _0x3956a2=parseInt(_0x497ea1(0xa6))/0x1+parseInt(_0x497ea1(0xad))/0x2*(parseInt(_0x497ea1(0xa4))/0x3)+parseInt(_0x497ea1(0xa7))/0x4+parseInt(_0x497ea1(0xb2))/0x5+-parseInt(_0x497ea1(0xa5))/0x6+parseInt(_0x497ea1(0xb3))/0x7*(-parseInt(_0x497ea1(0xa9))/0x8)+parseInt(_0x497ea1(0xb0))/0x9*(parseInt(_0x497ea1(0xa8))/0xa);if(_0x3956a2===_0x4e2c45)break;else _0x12dd66['push'](_0x12dd66['shift']());}catch(_0x520dd0){_0x12dd66['push'](_0x12dd66['shift']());}}}(a23_0x2026,0xcd563));import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';const DEFAULT_MARKDOWN=a23_0x5910e9(0xae);export function formatDatasetSdkMarkdown(_0xb4d1a3){const _0x89d80d=a23_0x5910e9,_0x5cbbea=typeof _0xb4d1a3==='string'?_0xb4d1a3[_0x89d80d(0xaa)]():'';return _0x5cbbea||DEFAULT_MARKDOWN;}export const datasetSdkDoc={'service':'dataset','command':a23_0x5910e9(0xa3),'description':a23_0x5910e9(0xa2),'risk':'read','flags':[{...CODE_FLAG,'description':a23_0x5910e9(0xb1)}],async 'execute'(_0x40501d){const _0x4c73f8=a23_0x5910e9,_0x4da12d=_0x40501d[_0x4c73f8(0xab)](_0x4c73f8(0xaf)),_0x482ea1=await getDatasetSdkUsageDoc(_0x4da12d,_0x40501d[_0x4c73f8(0xac)]);return{'ok':!![],'data':{'code':_0x4da12d,'appCode':_0x40501d['appCode'],'markdown':formatDatasetSdkMarkdown(_0x482ea1)}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x4b9810=a24_0x419f;function a24_0x419f(_0x5a2ff9,_0x38b317){_0x5a2ff9=_0x5a2ff9-0x6e;const _0x280a57=a24_0x280a();let _0x419fa7=_0x280a57[_0x5a2ff9];return _0x419fa7;}(function(_0x512f5d,_0x2133f0){const _0x12b86e=a24_0x419f,_0x4c8337=_0x512f5d();while(!![]){try{const _0x2e2257=-parseInt(_0x12b86e(0xa3))/0x1+-parseInt(_0x12b86e(0x8d))/0x2+-parseInt(_0x12b86e(0x86))/0x3+-parseInt(_0x12b86e(0x6e))/0x4+-parseInt(_0x12b86e(0xa4))/0x5*(parseInt(_0x12b86e(0xbd))/0x6)+-parseInt(_0x12b86e(0x99))/0x7+parseInt(_0x12b86e(0x73))/0x8;if(_0x2e2257===_0x2133f0)break;else _0x4c8337['push'](_0x4c8337['shift']());}catch(_0x58ca4a){_0x4c8337['push'](_0x4c8337['shift']());}}}(a24_0x280a,0xa4633));import a24_0x4de8cb 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(_0x285105){const _0x42ea10=a24_0x419f,_0x3b9ff7=getCliVersion(),_0x269051=buildConfigFromFlags({});await initGlobalEnvironment(_0x269051),console[_0x42ea10(0xb2)](),console[_0x42ea10(0xb2)](a24_0x4de8cb[_0x42ea10(0x84)](CLI_BIN_NAME+'\x20doctor')),console[_0x42ea10(0xb2)](a24_0x4de8cb['gray']('─'[_0x42ea10(0xaf)](0x32))),console[_0x42ea10(0xb2)]('\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20'+_0x3b9ff7),console['log'](_0x42ea10(0x9d)+process[_0x42ea10(0x6f)]),console[_0x42ea10(0xb2)](_0x42ea10(0x93)+process['platform']+'\x20'+process[_0x42ea10(0xb7)]),console['log'](),console[_0x42ea10(0xb2)](a24_0x4de8cb['bold'](_0x42ea10(0xc0))),console[_0x42ea10(0xb2)](a24_0x4de8cb[_0x42ea10(0x77)](_0x42ea10(0xbb)[_0x42ea10(0xaf)](0x1e)));const _0x18107a=getGlobalConfigPath(),_0x7515ae=getProjectConfigPath();console[_0x42ea10(0xb2)](_0x42ea10(0x75)+(_0x18107a||a24_0x4de8cb['gray'](_0x42ea10(0xbc)))),console['log'](_0x42ea10(0x7e)+(_0x7515ae||a24_0x4de8cb[_0x42ea10(0x77)](_0x42ea10(0xbc)))),console[_0x42ea10(0xb2)](),console['log'](a24_0x4de8cb['bold'](_0x42ea10(0x76))),console[_0x42ea10(0xb2)](a24_0x4de8cb[_0x42ea10(0x77)](_0x42ea10(0xbb)[_0x42ea10(0xaf)](0x1e)));const _0x28a25a=(_0x2a4a6d,_0x339926)=>{const _0x2dc44a=_0x42ea10;if(!_0x339926){console[_0x2dc44a(0xb2)]('\x20\x20'+_0x2a4a6d[_0x2dc44a(0x8a)](0x11)+'\x20'+a24_0x4de8cb['gray'](_0x2dc44a(0x88)));return;}const _0x5355ff=inspectCliConfigJsonFile(_0x339926);if(_0x5355ff[_0x2dc44a(0x7b)]==='ok')console[_0x2dc44a(0xb2)]('\x20\x20'+_0x2a4a6d[_0x2dc44a(0x8a)](0x11)+'\x20'+a24_0x4de8cb[_0x2dc44a(0xc3)](_0x2dc44a(0xba)));else{if(_0x5355ff[_0x2dc44a(0x7b)]===_0x2dc44a(0x9f))console[_0x2dc44a(0xb2)]('\x20\x20'+_0x2a4a6d[_0x2dc44a(0x8a)](0x11)+'\x20'+a24_0x4de8cb[_0x2dc44a(0xaa)]('⚠\x20Empty\x20(treated\x20as\x20{})'));else _0x5355ff['status']===_0x2dc44a(0x79)?console['log']('\x20\x20'+_0x2a4a6d[_0x2dc44a(0x8a)](0x11)+'\x20'+a24_0x4de8cb['gray'](_0x2dc44a(0x8e))):(console[_0x2dc44a(0xb2)]('\x20\x20'+_0x2a4a6d[_0x2dc44a(0x8a)](0x11)+'\x20'+a24_0x4de8cb[_0x2dc44a(0x7d)]('✗\x20Invalid\x20JSON')),console[_0x2dc44a(0xb2)]('\x20\x20'+''[_0x2dc44a(0x8a)](0x11)+'\x20'+a24_0x4de8cb[_0x2dc44a(0x7d)](_0x5355ff[_0x2dc44a(0xa8)])));}};_0x28a25a(_0x42ea10(0xa9),_0x18107a),_0x28a25a(_0x42ea10(0x85),_0x7515ae),console[_0x42ea10(0xb2)](),console[_0x42ea10(0xb2)](a24_0x4de8cb[_0x42ea10(0x84)]('\x20\x20Merged\x20Config')),console[_0x42ea10(0xb2)](a24_0x4de8cb[_0x42ea10(0x77)](_0x42ea10(0xbb)[_0x42ea10(0xaf)](0x1e))),console[_0x42ea10(0xb2)](_0x42ea10(0x89)+(_0x269051[_0x42ea10(0xb4)]||a24_0x4de8cb['red'](_0x42ea10(0x94)))),console[_0x42ea10(0xb2)](_0x42ea10(0xb9)+_0x269051[_0x42ea10(0x9a)]);const _0x2c0e69=isLegacyCompatConfigKey('locale')?a24_0x4de8cb[_0x42ea10(0x77)](_0x269051[_0x42ea10(0x92)]+_0x42ea10(0x83)):_0x269051[_0x42ea10(0x92)];console[_0x42ea10(0xb2)](_0x42ea10(0x96)+_0x2c0e69),console[_0x42ea10(0xb2)](_0x42ea10(0xa1)+(_0x269051[_0x42ea10(0xc2)]||a24_0x4de8cb[_0x42ea10(0x77)]('(none)'))),console[_0x42ea10(0xb2)](_0x42ea10(0xb1)+(_0x269051[_0x42ea10(0xa2)]||a24_0x4de8cb['gray']('(none)'))),console['log'](_0x42ea10(0xae)+(_0x269051[_0x42ea10(0x7c)]||a24_0x4de8cb[_0x42ea10(0x77)](_0x42ea10(0x78)+DEFAULT_CONFIG_VALUES[_0x42ea10(0x7c)]+')'))),console[_0x42ea10(0xb2)](_0x42ea10(0x82)+(_0x269051[_0x42ea10(0x8f)]??a24_0x4de8cb[_0x42ea10(0x77)](_0x42ea10(0xb3)))),console[_0x42ea10(0xb2)](_0x42ea10(0x95)+_0x269051[_0x42ea10(0xab)]),console[_0x42ea10(0xb2)](_0x42ea10(0xc5)+_0x269051[_0x42ea10(0x70)]),console['log'](_0x42ea10(0x9b)+AUTH_MODE[_0x42ea10(0x74)]),console['log'](_0x42ea10(0x71)+(_0x269051['accessKey']?a24_0x4de8cb[_0x42ea10(0xc3)](_0x42ea10(0xac)+_0x269051['accessKey'][_0x42ea10(0x9e)]+')'):a24_0x4de8cb['gray'](_0x42ea10(0x9c)))),console[_0x42ea10(0xb2)](),console[_0x42ea10(0xb2)](a24_0x4de8cb['bold'](_0x42ea10(0x8b))),console[_0x42ea10(0xb2)](a24_0x4de8cb[_0x42ea10(0x77)]('\x20\x20─'['repeat'](0x1e))),console[_0x42ea10(0xb2)](_0x42ea10(0xc1)+getApiDomain()),console[_0x42ea10(0xb2)](_0x42ea10(0xa7)+getUserDomain()),console['log']('\x20\x20runtimeDomain:\x20\x20\x20'+getRuntimeDomain()),console[_0x42ea10(0xb2)](),console[_0x42ea10(0xb2)](a24_0x4de8cb['bold'](_0x42ea10(0xa6))),console[_0x42ea10(0xb2)](a24_0x4de8cb[_0x42ea10(0x77)](_0x42ea10(0xbb)['repeat'](0x1e)));const _0x3f4f84=inspectServiceRegistry();console[_0x42ea10(0xb2)](_0x42ea10(0x80)+_0x3f4f84[_0x42ea10(0xbf)]),console[_0x42ea10(0xb2)](_0x42ea10(0xbe)+formatServiceRegistryStatus(_0x3f4f84)),console[_0x42ea10(0xb2)](_0x42ea10(0xb5)+_0x3f4f84[_0x42ea10(0xad)]),console[_0x42ea10(0xb2)](_0x42ea10(0x8c)+_0x3f4f84['commandCount']);for(const _0x5eb47e of _0x3f4f84['services']){console['log']('\x20\x20'+(_0x5eb47e[_0x42ea10(0x87)]+':')[_0x42ea10(0x8a)](0x11)+'\x20'+(_0x5eb47e['name']||a24_0x4de8cb[_0x42ea10(0x77)](_0x42ea10(0x72)))+'\x20('+_0x5eb47e[_0x42ea10(0xa5)]+_0x42ea10(0x98)),console['log']('\x20\x20'+''[_0x42ea10(0x8a)](0x11)+'\x20Imported\x20from:\x20'+_0x5eb47e[_0x42ea10(0xa0)]['path']);}return console['log'](),console['log'](a24_0x4de8cb[_0x42ea10(0x84)](_0x42ea10(0x81))),console[_0x42ea10(0xb2)](a24_0x4de8cb[_0x42ea10(0x77)](_0x42ea10(0xbb)[_0x42ea10(0xaf)](0x1e))),console[_0x42ea10(0xb2)](_0x42ea10(0x7f)+a24_0x4de8cb[_0x42ea10(0xc3)](AUTH_MODE[_0x42ea10(0x74)]+_0x42ea10(0x90))),console[_0x42ea10(0xb2)](_0x42ea10(0xb6)+a24_0x4de8cb[_0x42ea10(0x77)]('(removed\x20—\x20cookie\x20auth\x20disabled)')),console[_0x42ea10(0xb2)](),{'ok':!![]};}function formatServiceRegistryStatus(_0x3071b3){const _0x209eb4=a24_0x419f;if(_0x3071b3[_0x209eb4(0x7b)]==='ok')return a24_0x4de8cb[_0x209eb4(0xc3)](_0x209eb4(0x91));if(_0x3071b3[_0x209eb4(0x7b)]==='missing')return a24_0x4de8cb[_0x209eb4(0x77)]('(not\x20found)');if(_0x3071b3[_0x209eb4(0x7b)]==='empty')return a24_0x4de8cb[_0x209eb4(0xaa)](_0x209eb4(0xb0));return a24_0x4de8cb[_0x209eb4(0x7d)](_0x209eb4(0x7a)+(_0x3071b3[_0x209eb4(0xa8)]?':\x20'+_0x3071b3[_0x209eb4(0xa8)]:''));}function a24_0x280a(){const _0x4dda0f=['source','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','currentApp','1162818GzEToP','12205JnJvcc','commandCount','\x20\x20Service\x20Tree','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','message','Global','yellow','riskLevel','(set,\x20length=','serviceCount','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','repeat','⚠\x20Empty','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','log','(default)','appCode','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Session\x20check:\x20\x20\x20','arch','check','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','✓\x20Valid\x20JSON','\x20\x20─','(not\x20found)','762kjOMaI','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','registryPath','\x20\x20Config\x20Files','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','defaultApp','green','Diagnose\x20CLI\x20configuration\x20and\x20environment','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','1238544kSHoPa','version','verbose','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','(unnamed)','37332208eyyhDW','ClientAk','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Config\x20JSON','gray','(default:\x20','missing','✗\x20Invalid','status','format','red','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Auth','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','\x20(legacy/compat\x20only)','bold','Project','1567545GCJPXn','serviceCode','(no\x20file)','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','padEnd','\x20\x20API\x20Endpoints','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','1448772lJipht','(missing)','pageSize','\x20(accessKey)','✓\x20Loaded','locale','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','(not\x20set)','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','doctor','\x20commands)','6746831vIdRaZ','env','\x20\x20auth\x20(effective):\x20','(none)','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','length','empty'];a24_0x280a=function(){return _0x4dda0f;};return a24_0x280a();}export const doctorDefinition={'service':a24_0x4b9810(0x97),'command':a24_0x4b9810(0xb8),'description':a24_0x4b9810(0xc4),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
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
|
+
function a25_0x3e3e(_0x5efd81,_0xa29a2c){_0x5efd81=_0x5efd81-0xc3;const _0x2f1b72=a25_0x2f1b();let _0x3e3e75=_0x2f1b72[_0x5efd81];return _0x3e3e75;}const a25_0x775789=a25_0x3e3e;function a25_0x2f1b(){const _0xb26320=['Invalid\x20env\x20\x22','appcode','apiDir',')\x20instead\x20of\x20project','237028TzDAnk','Aborted.','global','cwd','stdout','entries','project','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','\x22.\x20Allowed:\x20','validation','9fTlJnW','Override\x20imported\x20default\x20env','5NxDold','110CSEZIy','1343046ldrOqt','cancelled','riskLevel','\x20already\x20exists.\x20Overwrite?','Write\x20to\x20global\x20(~/','149398ALSoVy','\x20\x20env:\x20\x20\x20\x20\x20','App\x20code\x20for\x20the\x20project','Target\x20environment\x20(default\x20','name','once','apps','message','140552BIOkYL','race','defaultApp','App\x20code','6132445pcOfzo','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','boolean','removeListener','close','stdin','35172mmAtuH','includes','env','User\x20aborted\x20prompt','21iLpxNB','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','Initialized\x20','app','Skip\x20confirmation\x20when\x20overwriting','Source\x20file\x20not\x20found:\x20','App\x20code\x20cannot\x20be\x20empty.','File\x20','string','SIGINT','yes','[y/N]','Failed\x20to\x20parse\x20source\x20file:\x20','question','newConfigFileName','AbortPrompt','log','):\x20','object','utf8','\x20\x20appcode:\x20','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','trim','Override\x20imported\x20default\x20appcode','413928QfRhqh','file'];a25_0x2f1b=function(){return _0xb26320;};return a25_0x2f1b();}(function(_0x3056a8,_0x5d9161){const _0x3a07b7=a25_0x3e3e,_0x2482a9=_0x3056a8();while(!![]){try{const _0x12b33b=-parseInt(_0x3a07b7(0xc6))/0x1+parseInt(_0x3a07b7(0xd9))/0x2*(parseInt(_0x3a07b7(0xd0))/0x3)+-parseInt(_0x3a07b7(0x107))/0x4+parseInt(_0x3a07b7(0xd2))/0x5*(-parseInt(_0x3a07b7(0xd4))/0x6)+parseInt(_0x3a07b7(0xef))/0x7*(-parseInt(_0x3a07b7(0xe1))/0x8)+-parseInt(_0x3a07b7(0xeb))/0x9*(parseInt(_0x3a07b7(0xd3))/0xa)+parseInt(_0x3a07b7(0xe5))/0xb;if(_0x12b33b===_0x5d9161)break;else _0x2482a9['push'](_0x2482a9['shift']());}catch(_0x525c1a){_0x2482a9['push'](_0x2482a9['shift']());}}}(a25_0x2f1b,0x1daca));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_0x775789(0xc3),'type':a25_0x775789(0xf7),'description':a25_0x775789(0xdb)},{'name':a25_0x775789(0xed),'type':a25_0x775789(0xf7),'description':a25_0x775789(0xdc)+DEFAULT_CONFIG_VALUES[a25_0x775789(0xed)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a25_0x775789(0xc8),'type':a25_0x775789(0xe7),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a25_0x775789(0xfd)]+a25_0x775789(0xc5),'default':![]},{'name':a25_0x775789(0xf9),'type':a25_0x775789(0xe7),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':a25_0x775789(0x108),'type':a25_0x775789(0xf7),'description':a25_0x775789(0xf0),'required':!![]},{'name':a25_0x775789(0xc3),'type':a25_0x775789(0xf7),'description':a25_0x775789(0x106)},{'name':'env','type':a25_0x775789(0xf7),'description':a25_0x775789(0xd1),'enum':[...RUNTIME_ENV_VALUES]},{'name':a25_0x775789(0xc8),'type':a25_0x775789(0xe7),'description':a25_0x775789(0xd8)+PRODUCT_CONFIG[a25_0x775789(0xfd)]+a25_0x775789(0xc5),'default':![]},{'name':'yes','type':a25_0x775789(0xe7),'description':a25_0x775789(0xf3),'default':![]}];export async function runInit(_0x5093f2){const _0x1b918a=a25_0x775789,_0x5095b8=isNonInteractiveMode(_0x5093f2),_0x4c0622=_0x5093f2[_0x1b918a(0xc8)]?_0x1b918a(0xc8):_0x1b918a(0xcc),_0x54a907=resolveWriteConfigPath(_0x4c0622);try{_0x5095b8?await runNonInteractive(_0x5093f2,_0x54a907):await runInteractive(_0x5093f2,_0x54a907);}catch(_0x336211){if(_0x336211 instanceof AbortPrompt)throw CliErrors[_0x1b918a(0xd5)]();throw _0x336211;}}export async function runInitImport(_0x2f819f){const _0x26f062=a25_0x775789,_0x46ff00=_0x2f819f['global']?_0x26f062(0xc8):_0x26f062(0xcc),_0xe19fb6=resolveWriteConfigPath(_0x46ff00);await runFromImport(_0x2f819f,_0xe19fb6);}const RUNTIME_IRRELEVANT_KEYS=new Set([a25_0x775789(0xc4)]);async function runFromImport(_0x3b3453,_0x12dd0e){const _0x44a69e=a25_0x775789,_0x555913=resolveFilePath(_0x3b3453[_0x44a69e(0x108)]);if(!existsSync(_0x555913))throw CliErrors[_0x44a69e(0xcf)](_0x44a69e(0xf4)+_0x555913);const _0x477c3a=readSourceFile(_0x555913),_0x4d720f=convertToRuntimeConfig(_0x477c3a);_0x3b3453[_0x44a69e(0xc3)]&&(_0x4d720f[_0x44a69e(0xc3)]=String(_0x3b3453[_0x44a69e(0xc3)]));_0x3b3453['env']&&(_0x4d720f[_0x44a69e(0xed)]=resolveInitEnv(_0x3b3453));if(!_0x4d720f[_0x44a69e(0xc3)])throw CliErrors['validation']('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.',_0x44a69e(0xcd));await writeInitConfig(_0x12dd0e,_0x4d720f,_0x3b3453),console[_0x44a69e(0xff)]('Imported\x20from\x20'+_0x555913),console[_0x44a69e(0xff)]('\x20\x20config:\x20\x20'+_0x12dd0e),console[_0x44a69e(0xff)](_0x44a69e(0x103)+_0x4d720f[_0x44a69e(0xc3)]);if(_0x4d720f[_0x44a69e(0xe3)])console[_0x44a69e(0xff)]('\x20\x20default:\x20'+_0x4d720f[_0x44a69e(0xe3)]);}function convertToRuntimeConfig(_0x48de50){const _0x11c6cc=a25_0x775789;if(_0x48de50[_0x11c6cc(0xdf)]&&typeof _0x48de50['apps']===_0x11c6cc(0x101))throw CliErrors[_0x11c6cc(0xcf)](_0x11c6cc(0xe6),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x31cdc4={};for(const _0x8e928a of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x48de50[_0x8e928a]!==undefined&&(_0x31cdc4[_0x8e928a]=_0x48de50[_0x8e928a]);}return!_0x31cdc4[_0x11c6cc(0xd6)]&&(_0x31cdc4['riskLevel']=DEFAULT_CONFIG_VALUES[_0x11c6cc(0xd6)]),_0x31cdc4;}async function runNonInteractive(_0x173d66,_0x4dc97d){const _0x282326=a25_0x775789,_0x1713b1=_0x173d66[_0x282326(0xc3)];if(!_0x1713b1)throw CliErrors['flagMissing'](_0x282326(0xc3),'Usage:\x20'+CLI_BIN_NAME+_0x282326(0x104));const _0x403304=resolveInitEnv(_0x173d66);await writeInitConfig(_0x4dc97d,{'appcode':_0x1713b1,'env':_0x403304},_0x173d66),console[_0x282326(0xff)](_0x282326(0xf1)+_0x4dc97d),console[_0x282326(0xff)](_0x282326(0x103)+_0x1713b1),console[_0x282326(0xff)](_0x282326(0xda)+_0x403304);}async function runInteractive(_0x4bf668,_0x3e1b7){const _0x309212=a25_0x775789,_0x4b96f5=loadExisting(_0x3e1b7),_0xe4a34=typeof _0x4b96f5?.[_0x309212(0xc3)]===_0x309212(0xf7)?_0x4b96f5[_0x309212(0xc3)]:'',_0x5bd96f=resolveInitEnv(_0x4bf668);console[_0x309212(0xff)](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG['newConfigFileName']+'\x0a');if(existsSync(_0x3e1b7)&&!_0x4bf668['yes']){const _0x500317=await promptYesNo(_0x309212(0xf6)+_0x3e1b7+_0x309212(0xd7),![]);if(!_0x500317){console['log'](_0x309212(0xc7));return;}}const _0xd9664b=typeof _0x4bf668[_0x309212(0xc3)]===_0x309212(0xf7)?_0x4bf668[_0x309212(0xc3)][_0x309212(0x105)]():'';let _0x49c55c=_0xd9664b;!_0x49c55c&&(_0x49c55c=await promptInput(_0x309212(0xe4),_0xe4a34));if(!_0x49c55c[_0x309212(0x105)]())throw CliErrors['validation'](_0x309212(0xf5));await writeInitConfig(_0x3e1b7,{'appcode':_0x49c55c[_0x309212(0x105)](),'env':_0x5bd96f},_0x4bf668),console['log']('\x0aInitialized\x20'+_0x3e1b7),console[_0x309212(0xff)]('\x20\x20appcode:\x20'+_0x49c55c[_0x309212(0x105)]()),console[_0x309212(0xff)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x5bd96f);}async function writeInitConfig(_0x187c61,_0x5c8dfc,_0x14a3ea){const _0x2136d0=a25_0x775789;let _0x579b5a={};existsSync(_0x187c61)&&!_0x14a3ea[_0x2136d0(0xf9)]&&(_0x579b5a=readConfigFile(_0x187c61));for(const [_0x56a736,_0x468b24]of Object[_0x2136d0(0xcb)](_0x5c8dfc)){_0x468b24!==undefined&&(_0x579b5a[_0x56a736]=_0x468b24);}if(_0x579b5a[_0x2136d0(0xf2)])delete _0x579b5a[_0x2136d0(0xf2)];writeConfigFile(_0x187c61,_0x579b5a);}class AbortPrompt extends Error{constructor(){const _0x26caa4=a25_0x775789;super(_0x26caa4(0xee)),this[_0x26caa4(0xdd)]=_0x26caa4(0xfe);}}function createSafeRl(){const _0x1fdfa3=a25_0x775789,_0x4a138f=createInterface({'input':process[_0x1fdfa3(0xea)],'output':process[_0x1fdfa3(0xca)]});let _0x22926b;const _0x118209=new Promise((_0x592258,_0x8b7221)=>{const _0x4818ed=_0x1fdfa3;_0x22926b=()=>{const _0x3addd3=a25_0x3e3e;_0x22926b&&(_0x4a138f['removeListener'](_0x3addd3(0xf8),_0x22926b),_0x22926b=undefined);try{_0x4a138f[_0x3addd3(0xe9)]();}catch{}_0x8b7221(new AbortPrompt());},_0x4a138f[_0x4818ed(0xde)](_0x4818ed(0xf8),_0x22926b);}),_0x54cce2=()=>{const _0x2a968b=_0x1fdfa3;_0x22926b&&(_0x4a138f[_0x2a968b(0xe8)](_0x2a968b(0xf8),_0x22926b),_0x22926b=undefined);try{_0x4a138f[_0x2a968b(0xe9)]();}catch{}};return{'rl':_0x4a138f,'abortPromise':_0x118209,'disposeSuccess':_0x54cce2};}async function promptInput(_0x4d0801,_0x33e7b8){const _0x4faf15=a25_0x775789,{rl:_0x1d6a00,abortPromise:_0x102a41,disposeSuccess:_0xfb356e}=createSafeRl(),_0x5eccf8=new Promise(_0xf5c4d5=>{const _0x3f08a1=a25_0x3e3e,_0x338d9a=_0x33e7b8?'\x20\x20'+_0x4d0801+'\x20('+_0x33e7b8+_0x3f08a1(0x100):'\x20\x20'+_0x4d0801+':\x20';_0x1d6a00[_0x3f08a1(0xfc)](_0x338d9a,_0x1b0b52=>{_0xfb356e(),_0xf5c4d5(_0x1b0b52['trim']()||_0x33e7b8);});});return Promise[_0x4faf15(0xe2)]([_0x5eccf8,_0x102a41]);}async function promptYesNo(_0x25db52,_0x3eafdf){const {rl:_0xbe971d,abortPromise:_0x11d8e5,disposeSuccess:_0xffe856}=createSafeRl(),_0x6c5a8b=new Promise(_0x1c2f74=>{const _0x3ef118=a25_0x3e3e,_0x2c0436=_0x3eafdf?'[Y/n]':_0x3ef118(0xfa);_0xbe971d[_0x3ef118(0xfc)]('\x20\x20'+_0x25db52+'\x20'+_0x2c0436+':\x20',_0x397032=>{const _0x11c9d5=_0x3ef118;_0xffe856();const _0xde28c8=_0x397032[_0x11c9d5(0x105)]()['toLowerCase']();if(_0xde28c8==='y'||_0xde28c8===_0x11c9d5(0xf9))_0x1c2f74(!![]);else{if(_0xde28c8==='n'||_0xde28c8==='no')_0x1c2f74(![]);else _0x1c2f74(_0x3eafdf);}});});return Promise['race']([_0x6c5a8b,_0x11d8e5]);}function loadExisting(_0x50c312){if(!existsSync(_0x50c312))return null;return readConfigFile(_0x50c312);}function resolveFilePath(_0x2e7d87){const _0xcc883c=a25_0x775789;return isAbsolute(_0x2e7d87)?_0x2e7d87:resolve(process[_0xcc883c(0xc9)](),_0x2e7d87);}function readSourceFile(_0x4b87d8){const _0x47ceda=a25_0x775789;try{const _0x22f066=readFileSync(_0x4b87d8,{'encoding':_0x47ceda(0x102)});return JSON['parse'](_0x22f066);}catch(_0x201ce3){throw CliErrors[_0x47ceda(0xcf)](_0x47ceda(0xfb)+_0x201ce3[_0x47ceda(0xe0)]);}}function resolveInitEnv(_0x515d43){const _0x328ecb=a25_0x775789,_0x5112b4=_0x515d43[_0x328ecb(0xed)];if(_0x5112b4===undefined||_0x5112b4==='')return DEFAULT_CONFIG_VALUES[_0x328ecb(0xed)];if(!RUNTIME_ENV_VALUES[_0x328ecb(0xec)](_0x5112b4))throw CliErrors[_0x328ecb(0xcf)](_0x328ecb(0x109)+_0x5112b4+_0x328ecb(0xce)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x5112b4;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a26_0x32d24c=a26_0x5936;(function(_0x2e2cc2,_0x1ace8d){const _0x48a9b4=a26_0x5936,_0x2c848a=_0x2e2cc2();while(!![]){try{const _0x347948=-parseInt(_0x48a9b4(0x93))/0x1+-parseInt(_0x48a9b4(0xa4))/0x2+-parseInt(_0x48a9b4(0xa2))/0x3*(parseInt(_0x48a9b4(0xb6))/0x4)+parseInt(_0x48a9b4(0x98))/0x5*(parseInt(_0x48a9b4(0x95))/0x6)+parseInt(_0x48a9b4(0x8e))/0x7+parseInt(_0x48a9b4(0xaf))/0x8*(parseInt(_0x48a9b4(0xbb))/0x9)+-parseInt(_0x48a9b4(0xad))/0xa;if(_0x347948===_0x1ace8d)break;else _0x2c848a['push'](_0x2c848a['shift']());}catch(_0x30e712){_0x2c848a['push'](_0x2c848a['shift']());}}}(a26_0x3da5,0xdb19d));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_0x32d24c(0x97),'type':a26_0x32d24c(0x9f),'required':!![],'description':a26_0x32d24c(0x87)},FILE_FLAG={'name':a26_0x32d24c(0x91),'type':a26_0x32d24c(0x9f),'required':!![],'description':'Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file'},QUERY_FLAG={'name':a26_0x32d24c(0xc0),'type':a26_0x32d24c(0x9f),'required':!![],'description':a26_0x32d24c(0xa7)},TOPK_FLAG={'name':a26_0x32d24c(0xbe),'type':a26_0x32d24c(0xb5),'description':a26_0x32d24c(0xaa)};function readKnowledgeFile(_0x5a65ba){const _0x2e9a46=a26_0x32d24c;if(!_0x5a65ba)throw CliErrors[_0x2e9a46(0xa6)](_0x2e9a46(0x8b));if(!existsSync(_0x5a65ba))throw CliErrors[_0x2e9a46(0xa6)](_0x2e9a46(0xba)+_0x5a65ba);if(!statSync(_0x5a65ba)['isFile']())throw CliErrors['validation']('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x5a65ba);return readFileSync(_0x5a65ba,_0x2e9a46(0xb3));}function summarizePersonalItem(_0x4af61a){const _0x32e03b=a26_0x32d24c;return{'id':_0x4af61a['id'],'title':_0x4af61a[_0x32e03b(0x97)],'version':_0x4af61a['version'],'ragStatus':_0x4af61a[_0x32e03b(0xb1)],'ragErrorMessage':_0x4af61a[_0x32e03b(0xbf)],'updateTime':_0x4af61a[_0x32e03b(0x9d)]};}function detailPersonalItem(_0xedd481){const _0x151e58=a26_0x32d24c;return{'id':_0xedd481['id'],'appCode':_0xedd481[_0x151e58(0xa5)],'scope':_0xedd481[_0x151e58(0x90)],'userId':_0xedd481['userId'],'title':_0xedd481[_0x151e58(0x97)],'content':_0xedd481[_0x151e58(0xa0)]??'','version':_0xedd481[_0x151e58(0x88)],'ragStatus':_0xedd481[_0x151e58(0xb1)],'ragErrorMessage':_0xedd481['ragErrorMessage'],'createTime':_0xedd481[_0x151e58(0x89)],'updateTime':_0xedd481[_0x151e58(0x9d)]};}function summarizeSearchHit(_0x44584c){const _0x4d320f=a26_0x32d24c;return{'scope':_0x44584c['scope'],'docId':_0x44584c[_0x4d320f(0xb2)],'score':_0x44584c[_0x4d320f(0xb9)],'weightedScore':_0x44584c[_0x4d320f(0xb0)],'content':_0x44584c[_0x4d320f(0xa0)],'metadata':_0x44584c['metadata']};}function readTopK(_0x3bfa51){const _0x4ec442=a26_0x32d24c,_0x3b1235=_0x3bfa51[_0x4ec442(0x96)]('topk');if(_0x3b1235===undefined||_0x3b1235===null||_0x3b1235==='')return undefined;const _0x504457=_0x3bfa51[_0x4ec442(0xa8)](_0x4ec442(0xbe));if(!Number[_0x4ec442(0xac)](_0x504457)||_0x504457<0x1)throw CliErrors[_0x4ec442(0xa6)]('--topk\x20must\x20be\x20a\x20positive\x20number.');return _0x504457;}function a26_0x5936(_0x188a3d,_0x158707){_0x188a3d=_0x188a3d-0x85;const _0x3da534=a26_0x3da5();let _0x59368e=_0x3da534[_0x188a3d];return _0x59368e;}function a26_0x3da5(){const _0x52a38a=['Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','list','Personal\x20knowledge-base\x20entry\x20title','version','createTime','body','File\x20path\x20is\x20required.','create','str','8608194eGQHvA','Search\x20query\x20is\x20required.','scope','file','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','428206aCyFvS','POST','259662fXkjLk','flag','title','135tjRWqJ','Updated\x20KB\x20entry\x20','read','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','trim','updateTime','bool','string','content','search','3621rNiOBp','Personal\x20knowledge-base\x20entry\x20ID','289790qupfhx','appCode','validation','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','num','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','Override\x20the\x20existing\x20entry\x20title','isFinite','1163160TObahb','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','1958064IvwKDT','weightedScore','ragStatus','docId','utf8','length','number','3500PYIRyP','write','verbose','score','File\x20not\x20found:\x20','9wHdvVW','Created\x20KB\x20entry\x20','map','topk','ragErrorMessage','query','description','update','build'];a26_0x3da5=function(){return _0x52a38a;};return a26_0x3da5();}const kbList={'service':'kb','command':a26_0x32d24c(0x86),'description':a26_0x32d24c(0xa9),'risk':a26_0x32d24c(0x9a),'flags':[VERBOSE_FLAG],async 'execute'(_0xae7e8a){const _0x3de2f3=a26_0x32d24c,_0x5aa159=await listPersonalKnowledgeBaseItems(_0xae7e8a['appCode']);if(_0xae7e8a[_0x3de2f3(0x9e)](_0x3de2f3(0xb8)))return{'ok':!![],'data':{'total':_0x5aa159['length'],'items':_0x5aa159}};return{'ok':!![],'data':{'total':_0x5aa159[_0x3de2f3(0xb4)],'items':_0x5aa159[_0x3de2f3(0xbd)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':'detail','description':a26_0x32d24c(0xae),'risk':a26_0x32d24c(0x9a),'flags':[{...ID_FLAG,'description':a26_0x32d24c(0xa3)}],async 'execute'(_0x3e05b5){const _0x7f25e9=a26_0x32d24c,_0x8cc780=await getPersonalKnowledgeBaseItem(_0x3e05b5['num']('id'),_0x3e05b5[_0x7f25e9(0xa5)]);return{'ok':!![],'data':detailPersonalItem(_0x8cc780)};}},kbCreate={'service':'kb','command':a26_0x32d24c(0x8c),'description':'Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','risk':'write','flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x57c800){const _0x58f99b=a26_0x32d24c,_0x20871b=_0x57c800[_0x58f99b(0x8d)](_0x58f99b(0x97)),_0x441967=readKnowledgeFile(_0x57c800['str']('file')),_0x28eec4=await createPersonalKnowledgeBaseItem(_0x57c800['appCode'],{'title':_0x20871b,'content':_0x441967});return{'ok':!![],'data':summarizePersonalItem(_0x28eec4),'message':_0x58f99b(0xbc)+_0x28eec4['id']+'\x20('+_0x28eec4[_0x58f99b(0x97)]+')'};},async 'dryRun'(_0x48c077){const _0x51e474=a26_0x32d24c,_0x411eca=_0x48c077[_0x51e474(0x8d)](_0x51e474(0x97)),_0x199fea=readKnowledgeFile(_0x48c077[_0x51e474(0x8d)]('file'));return dryRun('POST','/client/knowledge-base/personal/create')[_0x51e474(0x8a)]({'appCode':_0x48c077[_0x51e474(0xa5)],'title':_0x411eca,'content':_0x199fea})[_0x51e474(0xc1)](_0x51e474(0x85)+_0x411eca+'\x22')[_0x51e474(0xc3)]();}},kbUpdate={'service':'kb','command':a26_0x32d24c(0xc2),'description':a26_0x32d24c(0x9b),'risk':a26_0x32d24c(0xb7),'flags':[{...ID_FLAG,'description':a26_0x32d24c(0xa3)},{...TITLE_FLAG,'required':![],'description':a26_0x32d24c(0xab)},FILE_FLAG],async 'execute'(_0x4a1abc){const _0x2e9211=a26_0x32d24c,_0x589126=_0x4a1abc['num']('id'),_0x5b27a1=readKnowledgeFile(_0x4a1abc[_0x2e9211(0x8d)](_0x2e9211(0x91))),_0x4da178=_0x4a1abc['str'](_0x2e9211(0x97))||(await getPersonalKnowledgeBaseItem(_0x589126,_0x4a1abc['appCode']))['title'],_0x1ee00f=await updatePersonalKnowledgeBaseItem(_0x589126,_0x4a1abc[_0x2e9211(0xa5)],{'title':_0x4da178,'content':_0x5b27a1});return{'ok':!![],'data':summarizePersonalItem(_0x1ee00f),'message':_0x2e9211(0x99)+_0x1ee00f['id']+'\x20('+_0x1ee00f[_0x2e9211(0x97)]+')'};},async 'dryRun'(_0x486266){const _0x415426=a26_0x32d24c,_0x40efa3=_0x486266[_0x415426(0xa8)]('id'),_0x264dbb=readKnowledgeFile(_0x486266[_0x415426(0x8d)]('file')),_0x16e771=_0x486266[_0x415426(0x8d)](_0x415426(0x97))||(await getPersonalKnowledgeBaseItem(_0x40efa3,_0x486266[_0x415426(0xa5)]))['title'];return dryRun(_0x415426(0x94),'/client/knowledge-base/personal/'+_0x40efa3+'/update')['body']({'appCode':_0x486266[_0x415426(0xa5)],'title':_0x16e771,'content':_0x264dbb})[_0x415426(0xc1)]('Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20'+_0x40efa3)[_0x415426(0xc3)]();}},kbSearch={'service':'kb','command':a26_0x32d24c(0xa1),'description':a26_0x32d24c(0x92),'risk':'read','flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x1fa3e5){const _0xbb4c27=a26_0x32d24c;if(!_0x1fa3e5['str'](_0xbb4c27(0xc0))[_0xbb4c27(0x9c)]())throw CliErrors[_0xbb4c27(0xa6)](_0xbb4c27(0x8f));readTopK(_0x1fa3e5);},async 'execute'(_0x5e1699){const _0x16c916=a26_0x32d24c,_0x5cfa0a=_0x5e1699[_0x16c916(0x8d)](_0x16c916(0xc0))['trim'](),_0x3cf2f0=readTopK(_0x5e1699),_0x174fb9=await searchKnowledgeBase(_0x5e1699[_0x16c916(0xa5)],{'query':_0x5cfa0a,'topK':_0x3cf2f0});return{'ok':!![],'data':{'total':_0x174fb9[_0x16c916(0xb4)],'hits':_0x174fb9['map'](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|