@lovrabet/lovrabet-cli 2.0.14-beta.3 → 2.0.14-beta.4
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/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/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/config/schema.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/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 +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a15_0x630f5b=a15_0x24df;(function(_0x47266e,_0x18c102){const _0x59dff9=a15_0x24df,_0x4104a5=_0x47266e();while(!![]){try{const _0x3442c9=-parseInt(_0x59dff9(0x1a7))/0x1*(-parseInt(_0x59dff9(0x1ac))/0x2)+parseInt(_0x59dff9(0x19c))/0x3*(parseInt(_0x59dff9(0x1a2))/0x4)+parseInt(_0x59dff9(0x1a6))/0x5+parseInt(_0x59dff9(0x1ad))/0x6*(-parseInt(_0x59dff9(0x19e))/0x7)+-parseInt(_0x59dff9(0x1a5))/0x8*(-parseInt(_0x59dff9(0x1b3))/0x9)+-parseInt(_0x59dff9(0x1a3))/0xa*(-parseInt(_0x59dff9(0x1ab))/0xb)+-parseInt(_0x59dff9(0x1a8))/0xc*(parseInt(_0x59dff9(0x1a0))/0xd);if(_0x3442c9===_0x18c102)break;else _0x4104a5['push'](_0x4104a5['shift']());}catch(_0x490750){_0x4104a5['push'](_0x4104a5['shift']());}}}(a15_0x13d1,0xeea55));export const CODE_FLAG={'name':a15_0x630f5b(0x1aa),'type':a15_0x630f5b(0x1b0),'required':!![],'description':a15_0x630f5b(0x19d),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a15_0x630f5b(0x1ae)}};export const SQLCODE_FLAG={'name':a15_0x630f5b(0x1b4),'type':a15_0x630f5b(0x1b0),'required':!![],'description':'SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':'SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)'}};export const VERBOSE_FLAG={'name':a15_0x630f5b(0x1af),'type':a15_0x630f5b(0x1a1),'description':a15_0x630f5b(0x1a9)};export const PARAMS_FLAG={'name':'params','type':'string','description':a15_0x630f5b(0x1b2)};function a15_0x24df(_0xab0615,_0x524c84){_0xab0615=_0xab0615-0x19c;const _0x13d1e4=a15_0x13d1();let _0x24dfd2=_0x13d1e4[_0xab0615];return _0x24dfd2;}export const NAME_FLAG={'name':a15_0x630f5b(0x1a4),'type':'string','description':'Resource\x20name\x20for\x20lookup'};function a15_0x13d1(){const _0x9b0b3d=['Dataset\x20code\x20(32-char\x20hex\x20UUID)','14yxsAJx','number','30875Guaexc','boolean','4BzPJcX','6370tjgQHf','name','56CDwKQW','5135030ZQHhOB','1725965ErgSQz','13548XvXfgD','Return\x20full\x20raw\x20response\x20object','code','5401kqtNpP','2mgWeZs','4520028VBhNzW','a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)','verbose','string','Resource\x20ID','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','2511693rntwUR','sqlcode','438801nyfxgA'];a15_0x13d1=function(){return _0x9b0b3d;};return a15_0x13d1();}export const ID_FLAG={'name':'id','type':a15_0x630f5b(0x19f),'required':!![],'description':a15_0x630f5b(0x1b1)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a16_0x48222=a16_0x5d0f;(function(_0x3a1180,_0x2aff3c){const _0x29f7b1=a16_0x5d0f,_0x414dbd=_0x3a1180();while(!![]){try{const _0x40685b=parseInt(_0x29f7b1(0x164))/0x1*(-parseInt(_0x29f7b1(0x14e))/0x2)+-parseInt(_0x29f7b1(0x14a))/0x3+parseInt(_0x29f7b1(0x17b))/0x4+parseInt(_0x29f7b1(0x14c))/0x5*(-parseInt(_0x29f7b1(0x185))/0x6)+-parseInt(_0x29f7b1(0x16e))/0x7*(parseInt(_0x29f7b1(0x14d))/0x8)+-parseInt(_0x29f7b1(0x14f))/0x9*(-parseInt(_0x29f7b1(0x179))/0xa)+parseInt(_0x29f7b1(0x155))/0xb;if(_0x40685b===_0x2aff3c)break;else _0x414dbd['push'](_0x414dbd['shift']());}catch(_0x421e5e){_0x414dbd['push'](_0x414dbd['shift']());}}}(a16_0x10ba,0xd7b75));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':a16_0x48222(0x184),'type':'boolean','description':a16_0x48222(0x150),'default':![]};function parseAliasAppcodeSetKey(_0xa64a51){const _0xa06b3b=a16_0x48222,_0x3f5e4c=_0xa64a51[_0xa06b3b(0x175)]('.');if(_0x3f5e4c[_0xa06b3b(0x171)]!==0x3||_0x3f5e4c[0x0]!==_0xa06b3b(0x17c)||_0x3f5e4c[0x2]!==_0xa06b3b(0x159))return undefined;const _0x14aba0=_0x3f5e4c[0x1]?.['trim']();return _0x14aba0?_0x14aba0:undefined;}function parseAliasDeleteKey(_0x18591a){const _0x3edf0d=a16_0x48222,_0x417b78=_0x18591a['split']('.');if(_0x417b78[_0x3edf0d(0x171)]===0x2&&_0x417b78[0x0]===_0x3edf0d(0x17c)){const _0x16c145=_0x417b78[0x1]?.[_0x3edf0d(0x15e)]();return _0x16c145?{'alias':_0x16c145}:undefined;}if(_0x417b78['length']===0x3&&_0x417b78[0x0]===_0x3edf0d(0x17c)&&_0x417b78[0x2]===_0x3edf0d(0x159)){const _0x1d5dd5=_0x417b78[0x1]?.[_0x3edf0d(0x15e)]();return _0x1d5dd5?{'alias':_0x1d5dd5,'field':_0x3edf0d(0x159)}:undefined;}return undefined;}function a16_0x5d0f(_0x55fcac,_0x2cfbeb){_0x55fcac=_0x55fcac-0x14a;const _0x10bae4=a16_0x10ba();let _0x5d0fc8=_0x10bae4[_0x55fcac];return _0x5d0fc8;}function a16_0x10ba(){const _0xf20a8f=['1078MeEabe','\x20\x20global:\x20\x20','Config\x20files:\x0a','length','pageSize','pretty','config','split','log','\x20config\x20get\x20<key>','pageSize\x20must\x20be\x20a\x20positive\x20number','14551510bkvTqR','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','2634788JUXsYn','apps','value','field','Missing\x20key\x20or\x20value.','(none)','project-or-global-explicit','keys','args','global','492gVoxXB','\x22.\x20Allowed:\x20','read','includes','stringify','List\x20current\x20config',';\x20apps.<alias>.appcode','Get\x20a\x20config\x20value','84825YcGscL','set','65945VwQUAS','120AdlqRH','18jzEHpB','9dKCpjn','Write\x20to\x20global\x20config','object','bool','riskLevel','format','17125174MqjZYH','validation','isArray','write','appcode','Key\x20\x22','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','Set\x20a\x20config\x20value','Key\x20not\x20found:\x20','trim','Settable\x20keys:\x20','get','Invalid\x20value\x20for\x20\x22','\x22\x20not\x20found\x20at\x20top\x20level.','Usage:\x20','186114SVlZYp','alias','\x20config\x20set\x20<key>\x20<value>\x20[--global]','Deleted\x20`','Delete\x20a\x20config\x20value','Missing\x20key\x20argument.','key','Value\x20to\x20assign','Top-level\x20key\x20\x22','raw'];a16_0x10ba=function(){return _0xf20a8f;};return a16_0x10ba();}function setLocalAppAlias(_0x502011,_0xda31b6,_0x560f69){const _0x2e11b5=a16_0x48222,_0x343105=_0x502011['apps']&&typeof _0x502011[_0x2e11b5(0x17c)]==='object'&&!Array[_0x2e11b5(0x157)](_0x502011[_0x2e11b5(0x17c)])?_0x502011[_0x2e11b5(0x17c)]:{},_0x457254=_0x343105[_0xda31b6]&&typeof _0x343105[_0xda31b6]==='object'&&!Array[_0x2e11b5(0x157)](_0x343105[_0xda31b6])?_0x343105[_0xda31b6]:{};_0x457254[_0x2e11b5(0x159)]=_0x560f69,_0x343105[_0xda31b6]=_0x457254,_0x502011[_0x2e11b5(0x17c)]=_0x343105;}function deleteLocalAppAlias(_0x40ebaf,_0x55c79a){const _0x2efa08=a16_0x48222;if(!_0x40ebaf['apps']||typeof _0x40ebaf['apps']!==_0x2efa08(0x151)||Array[_0x2efa08(0x157)](_0x40ebaf[_0x2efa08(0x17c)]))return![];const _0x5a4ff5=_0x40ebaf[_0x2efa08(0x17c)],_0x2a736c=_0x5a4ff5[_0x55c79a['alias']];if(!_0x2a736c||typeof _0x2a736c!==_0x2efa08(0x151)||Array['isArray'](_0x2a736c))return![];if(!_0x55c79a[_0x2efa08(0x17e)])return delete _0x5a4ff5[_0x55c79a['alias']],!![];if(!(_0x55c79a[_0x2efa08(0x17e)]in _0x2a736c))return![];return delete _0x2a736c[_0x55c79a[_0x2efa08(0x17e)]],Object[_0x2efa08(0x182)](_0x2a736c)[_0x2efa08(0x171)]===0x0&&delete _0x5a4ff5[_0x55c79a[_0x2efa08(0x165)]],!![];}const listDef={'service':a16_0x48222(0x174),'command':'list','description':a16_0x48222(0x18a),'risk':a16_0x48222(0x187),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x26d5a8){const _0x37de6a=a16_0x48222,{buildConfigFromFlags:_0x2ebb21}=await import('../../context.js'),_0x3cd8a5=_0x2ebb21({}),_0x52684a=getProjectConfigPath(),_0x527d11=resolveWriteConfigPath(_0x37de6a(0x184));if(_0x26d5a8[_0x37de6a(0x154)]===_0x37de6a(0x173))return{'ok':!![],'message':_0x37de6a(0x15b)+(JSON[_0x37de6a(0x189)](_0x3cd8a5['raw'],null,0x2)+'\x0a\x0a')+_0x37de6a(0x170)+('\x20\x20project:\x20'+(_0x52684a??_0x37de6a(0x180))+'\x0a')+(_0x37de6a(0x16f)+_0x527d11)};return{'ok':!![],'data':{'effective':_0x3cd8a5[_0x37de6a(0x16d)],'configFiles':{'project':_0x52684a??null,'global':_0x527d11}}};}},getDef={'service':a16_0x48222(0x174),'command':a16_0x48222(0x160),'description':a16_0x48222(0x18c),'risk':a16_0x48222(0x187),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x48222(0x16a),'description':a16_0x48222(0x17a),'required':!![]}],'flags':[],async 'execute'(_0x401405){const _0x5ed37c=a16_0x48222,_0xc56b34=_0x401405['args'][0x0];if(!_0xc56b34)throw CliErrors[_0x5ed37c(0x156)](_0x5ed37c(0x169),_0x5ed37c(0x163)+CLI_BIN_NAME+_0x5ed37c(0x177));const {buildConfigFromFlags:_0x724823}=await import('../../context.js'),{raw:_0x89929c}=_0x724823({});if(_0xc56b34[_0x5ed37c(0x188)]('.')){const _0xa5a12e=_0xc56b34[_0x5ed37c(0x175)]('.');let _0x3602cd=_0x89929c;for(const _0x4d843b of _0xa5a12e){if(_0x3602cd==null||typeof _0x3602cd!==_0x5ed37c(0x151))throw CliErrors[_0x5ed37c(0x156)](_0x5ed37c(0x15d)+_0xc56b34);_0x3602cd=_0x3602cd[_0x4d843b];}if(_0x3602cd===undefined)throw CliErrors[_0x5ed37c(0x156)](_0x5ed37c(0x15d)+_0xc56b34);return console[_0x5ed37c(0x176)](typeof _0x3602cd===_0x5ed37c(0x151)?JSON['stringify'](_0x3602cd,null,0x2):String(_0x3602cd)),{'ok':!![]};}const _0x37d178=_0x89929c[_0xc56b34];if(_0x37d178===undefined)throw CliErrors['validation']('Key\x20not\x20found:\x20'+_0xc56b34);return console['log'](typeof _0x37d178===_0x5ed37c(0x151)?JSON['stringify'](_0x37d178,null,0x2):String(_0x37d178)),{'ok':!![]};}},setDef={'service':a16_0x48222(0x174),'command':a16_0x48222(0x14b),'description':a16_0x48222(0x15c),'risk':a16_0x48222(0x158),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x48222(0x16a),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a16_0x48222(0x17d),'description':a16_0x48222(0x16b),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x506c0f){const _0x4fd928=a16_0x48222,_0x276c99=_0x506c0f[_0x4fd928(0x183)][0x0],_0xe2d0ee=_0x506c0f[_0x4fd928(0x183)][0x1];if(!_0x276c99||_0xe2d0ee===undefined)throw CliErrors['validation'](_0x4fd928(0x17f),'Usage:\x20'+CLI_BIN_NAME+_0x4fd928(0x166));if(ENUM_KEYS[_0x276c99]&&!ENUM_KEYS[_0x276c99][_0x4fd928(0x188)](_0xe2d0ee))throw CliErrors['validation'](_0x4fd928(0x161)+_0x276c99+_0x4fd928(0x186)+ENUM_KEYS[_0x276c99]['join'](',\x20'));if(_0x276c99===_0x4fd928(0x153))throw CliErrors[_0x4fd928(0x156)]('\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.');if(_0x276c99===_0x4fd928(0x172)){const _0x5c2b92=Number(_0xe2d0ee);if(isNaN(_0x5c2b92)||_0x5c2b92<=0x0)throw CliErrors[_0x4fd928(0x156)](_0x4fd928(0x178));}const _0x358e15=resolveWriteScope({'explicitGlobal':_0x506c0f[_0x4fd928(0x152)](_0x4fd928(0x184)),'policy':'project-or-global-explicit'}),_0x5b57a0=toScopeFlags(_0x358e15),_0x235959=readScopedConfig(_0x5b57a0),_0x206edf=parseAliasAppcodeSetKey(_0x276c99);if(!_0x206edf&&!isTopLevelConfigKey(_0x276c99))throw CliErrors[_0x4fd928(0x156)](_0x4fd928(0x16c)+_0x276c99+'\x22\x20is\x20not\x20settable.',_0x4fd928(0x15f)+getTopLevelConfigKeySummary()+_0x4fd928(0x18b));return _0x206edf?setLocalAppAlias(_0x235959,_0x206edf,_0xe2d0ee):_0x235959[_0x276c99]=_0x276c99===_0x4fd928(0x172)?Number(_0xe2d0ee):_0xe2d0ee,console[_0x4fd928(0x176)]('Set\x20`'+_0x276c99+'`\x20=\x20\x22'+_0xe2d0ee+'\x22'+(_0x358e15===_0x4fd928(0x184)?'\x20(global)':'')),writeScopedConfig(_0x235959,_0x5b57a0),{'ok':!![]};}},deleteDef={'service':a16_0x48222(0x174),'command':'delete','description':a16_0x48222(0x168),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x48222(0x16a),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x239a40){const _0x56f2fe=a16_0x48222,_0x3f802f=_0x239a40[_0x56f2fe(0x183)][0x0];if(!_0x3f802f)throw CliErrors[_0x56f2fe(0x156)]('Missing\x20key\x20argument.',_0x56f2fe(0x163)+CLI_BIN_NAME+'\x20config\x20delete\x20<key>\x20[--global]');const _0x23881e=resolveWriteScope({'explicitGlobal':_0x239a40[_0x56f2fe(0x152)](_0x56f2fe(0x184)),'policy':_0x56f2fe(0x181)}),_0xe9396b=toScopeFlags(_0x23881e),_0x36651f=readScopedConfig(_0xe9396b),_0x560893=parseAliasDeleteKey(_0x3f802f);if(_0x560893){if(!deleteLocalAppAlias(_0x36651f,_0x560893))throw CliErrors[_0x56f2fe(0x156)](_0x56f2fe(0x15d)+_0x3f802f);return console[_0x56f2fe(0x176)]('Deleted\x20`'+_0x3f802f+'`'+(_0x23881e===_0x56f2fe(0x184)?'\x20(global)':'')),writeScopedConfig(_0x36651f,_0xe9396b),{'ok':!![]};}if(_0x36651f[_0x3f802f]===undefined)throw CliErrors[_0x56f2fe(0x156)](_0x56f2fe(0x15a)+_0x3f802f+_0x56f2fe(0x162));return delete _0x36651f[_0x3f802f],console[_0x56f2fe(0x176)](_0x56f2fe(0x167)+_0x3f802f+'`'+(_0x23881e===_0x56f2fe(0x184)?'\x20(global)':'')),writeScopedConfig(_0x36651f,_0xe9396b),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
1
|
+
const a16_0x4eebbe=a16_0x4577;(function(_0x176d08,_0x7042d1){const _0x23c544=a16_0x4577,_0x381d0d=_0x176d08();while(!![]){try{const _0x3a571e=-parseInt(_0x23c544(0x18f))/0x1+parseInt(_0x23c544(0x19f))/0x2+parseInt(_0x23c544(0x190))/0x3+parseInt(_0x23c544(0x1a0))/0x4+-parseInt(_0x23c544(0x19c))/0x5*(-parseInt(_0x23c544(0x197))/0x6)+parseInt(_0x23c544(0x1ae))/0x7*(-parseInt(_0x23c544(0x18a))/0x8)+parseInt(_0x23c544(0x1a4))/0x9*(-parseInt(_0x23c544(0x1b6))/0xa);if(_0x3a571e===_0x7042d1)break;else _0x381d0d['push'](_0x381d0d['shift']());}catch(_0xee8c89){_0x381d0d['push'](_0x381d0d['shift']());}}}(a16_0x29a6,0x807cd));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':a16_0x4eebbe(0x186),'type':a16_0x4eebbe(0x18d),'description':'Write\x20to\x20global\x20config','default':![]};function a16_0x29a6(){const _0x5dbc49=['Top-level\x20key\x20\x22','set','get','\x20config\x20delete\x20<key>\x20[--global]','../../context.js','apps','Value\x20to\x20assign','Usage:\x20','alias','args','bool','format','stringify','global','list','\x22\x20is\x20not\x20settable.','write','2504SoSgOu','delete','object','boolean','log','195226IvUXBt','2745141ZGndVk','Missing\x20key\x20or\x20value.','\x20\x20global:\x20\x20','split','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','Invalid\x20value\x20for\x20\x22','Deleted\x20`','1641444OKjuSA','keys','\x22\x20not\x20found\x20at\x20top\x20level.','List\x20current\x20config','Missing\x20key\x20argument.','5KBIvxb','Settable\x20keys:\x20','\x22.\x20Allowed:\x20','1498526PErmaP','1665364hSUFRA','appcode','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','field','13964823rbNtLb','Config\x20files:\x0a','isArray','pageSize','includes','value','Set\x20a\x20config\x20value','pretty',';\x20apps.<alias>.appcode','length','1813wCgPyR','pageSize\x20must\x20be\x20a\x20positive\x20number','raw','Delete\x20a\x20config\x20value','read','config','trim','project-or-global-explicit','10JDXVWy','validation','\x20(global)','Key\x20not\x20found:\x20','Get\x20a\x20config\x20value','key','join'];a16_0x29a6=function(){return _0x5dbc49;};return a16_0x29a6();}function parseAliasAppcodeSetKey(_0x34421c){const _0x3b206d=a16_0x4eebbe,_0x123865=_0x34421c[_0x3b206d(0x193)]('.');if(_0x123865[_0x3b206d(0x1ad)]!==0x3||_0x123865[0x0]!=='apps'||_0x123865[0x2]!==_0x3b206d(0x1a1))return undefined;const _0xa4a4c7=_0x123865[0x1]?.['trim']();return _0xa4a4c7?_0xa4a4c7:undefined;}function parseAliasDeleteKey(_0x50f875){const _0x152369=a16_0x4eebbe,_0x3b9654=_0x50f875[_0x152369(0x193)]('.');if(_0x3b9654[_0x152369(0x1ad)]===0x2&&_0x3b9654[0x0]===_0x152369(0x17e)){const _0xc33135=_0x3b9654[0x1]?.[_0x152369(0x1b4)]();return _0xc33135?{'alias':_0xc33135}:undefined;}if(_0x3b9654[_0x152369(0x1ad)]===0x3&&_0x3b9654[0x0]===_0x152369(0x17e)&&_0x3b9654[0x2]===_0x152369(0x1a1)){const _0x1d92d5=_0x3b9654[0x1]?.[_0x152369(0x1b4)]();return _0x1d92d5?{'alias':_0x1d92d5,'field':_0x152369(0x1a1)}:undefined;}return undefined;}function setLocalAppAlias(_0x47e65e,_0x26b357,_0x509948){const _0x2388e3=a16_0x4eebbe,_0x2f855a=_0x47e65e[_0x2388e3(0x17e)]&&typeof _0x47e65e[_0x2388e3(0x17e)]==='object'&&!Array[_0x2388e3(0x1a6)](_0x47e65e[_0x2388e3(0x17e)])?_0x47e65e['apps']:{},_0x595204=_0x2f855a[_0x26b357]&&typeof _0x2f855a[_0x26b357]==='object'&&!Array[_0x2388e3(0x1a6)](_0x2f855a[_0x26b357])?_0x2f855a[_0x26b357]:{};_0x595204[_0x2388e3(0x1a1)]=_0x509948,_0x2f855a[_0x26b357]=_0x595204,_0x47e65e[_0x2388e3(0x17e)]=_0x2f855a;}function a16_0x4577(_0x49ed45,_0x27f273){_0x49ed45=_0x49ed45-0x17b;const _0x29a64f=a16_0x29a6();let _0x457781=_0x29a64f[_0x49ed45];return _0x457781;}function deleteLocalAppAlias(_0x4c7460,_0x178716){const _0x7309c5=a16_0x4eebbe;if(!_0x4c7460[_0x7309c5(0x17e)]||typeof _0x4c7460['apps']!==_0x7309c5(0x18c)||Array['isArray'](_0x4c7460[_0x7309c5(0x17e)]))return![];const _0x2cf0df=_0x4c7460['apps'],_0xad62e7=_0x2cf0df[_0x178716[_0x7309c5(0x181)]];if(!_0xad62e7||typeof _0xad62e7!==_0x7309c5(0x18c)||Array[_0x7309c5(0x1a6)](_0xad62e7))return![];if(!_0x178716[_0x7309c5(0x1a3)])return delete _0x2cf0df[_0x178716['alias']],!![];if(!(_0x178716[_0x7309c5(0x1a3)]in _0xad62e7))return![];return delete _0xad62e7[_0x178716[_0x7309c5(0x1a3)]],Object[_0x7309c5(0x198)](_0xad62e7)['length']===0x0&&delete _0x2cf0df[_0x178716[_0x7309c5(0x181)]],!![];}const listDef={'service':a16_0x4eebbe(0x1b3),'command':a16_0x4eebbe(0x187),'description':a16_0x4eebbe(0x19a),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x60a0db){const _0x30cd4a=a16_0x4eebbe,{buildConfigFromFlags:_0x30b0f9}=await import('../../context.js'),_0x2fa288=_0x30b0f9({}),_0x25142c=getProjectConfigPath(),_0x3a4bb8=resolveWriteConfigPath(_0x30cd4a(0x186));if(_0x60a0db[_0x30cd4a(0x184)]===_0x30cd4a(0x1ab))return{'ok':!![],'message':_0x30cd4a(0x1a2)+(JSON[_0x30cd4a(0x185)](_0x2fa288[_0x30cd4a(0x1b0)],null,0x2)+'\x0a\x0a')+_0x30cd4a(0x1a5)+('\x20\x20project:\x20'+(_0x25142c??'(none)')+'\x0a')+(_0x30cd4a(0x192)+_0x3a4bb8)};return{'ok':!![],'data':{'effective':_0x2fa288[_0x30cd4a(0x1b0)],'configFiles':{'project':_0x25142c??null,'global':_0x3a4bb8}}};}},getDef={'service':a16_0x4eebbe(0x1b3),'command':a16_0x4eebbe(0x17b),'description':a16_0x4eebbe(0x1ba),'risk':a16_0x4eebbe(0x1b2),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':'Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','required':!![]}],'flags':[],async 'execute'(_0x1316bb){const _0x5872d7=a16_0x4eebbe,_0x3677ca=_0x1316bb[_0x5872d7(0x182)][0x0];if(!_0x3677ca)throw CliErrors[_0x5872d7(0x1b7)]('Missing\x20key\x20argument.',_0x5872d7(0x180)+CLI_BIN_NAME+'\x20config\x20get\x20<key>');const {buildConfigFromFlags:_0x1a65c9}=await import(_0x5872d7(0x17d)),{raw:_0x13ff61}=_0x1a65c9({});if(_0x3677ca[_0x5872d7(0x1a8)]('.')){const _0x3ba461=_0x3677ca[_0x5872d7(0x193)]('.');let _0x173ad2=_0x13ff61;for(const _0x7805a5 of _0x3ba461){if(_0x173ad2==null||typeof _0x173ad2!==_0x5872d7(0x18c))throw CliErrors[_0x5872d7(0x1b7)](_0x5872d7(0x1b9)+_0x3677ca);_0x173ad2=_0x173ad2[_0x7805a5];}if(_0x173ad2===undefined)throw CliErrors[_0x5872d7(0x1b7)]('Key\x20not\x20found:\x20'+_0x3677ca);return console[_0x5872d7(0x18e)](typeof _0x173ad2==='object'?JSON[_0x5872d7(0x185)](_0x173ad2,null,0x2):String(_0x173ad2)),{'ok':!![]};}const _0x58bc37=_0x13ff61[_0x3677ca];if(_0x58bc37===undefined)throw CliErrors[_0x5872d7(0x1b7)](_0x5872d7(0x1b9)+_0x3677ca);return console[_0x5872d7(0x18e)](typeof _0x58bc37===_0x5872d7(0x18c)?JSON['stringify'](_0x58bc37,null,0x2):String(_0x58bc37)),{'ok':!![]};}},setDef={'service':'config','command':a16_0x4eebbe(0x1be),'description':a16_0x4eebbe(0x1aa),'risk':a16_0x4eebbe(0x189),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]},{'name':a16_0x4eebbe(0x1a9),'description':a16_0x4eebbe(0x17f),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x1b6a34){const _0x5e7be8=a16_0x4eebbe,_0x44e978=_0x1b6a34[_0x5e7be8(0x182)][0x0],_0x27ecb7=_0x1b6a34[_0x5e7be8(0x182)][0x1];if(!_0x44e978||_0x27ecb7===undefined)throw CliErrors[_0x5e7be8(0x1b7)](_0x5e7be8(0x191),'Usage:\x20'+CLI_BIN_NAME+'\x20config\x20set\x20<key>\x20<value>\x20[--global]');if(ENUM_KEYS[_0x44e978]&&!ENUM_KEYS[_0x44e978][_0x5e7be8(0x1a8)](_0x27ecb7))throw CliErrors[_0x5e7be8(0x1b7)](_0x5e7be8(0x195)+_0x44e978+_0x5e7be8(0x19e)+ENUM_KEYS[_0x44e978][_0x5e7be8(0x1bc)](',\x20'));if(_0x44e978==='riskLevel')throw CliErrors['validation'](_0x5e7be8(0x194));if(_0x44e978===_0x5e7be8(0x1a7)){const _0x422180=Number(_0x27ecb7);if(isNaN(_0x422180)||_0x422180<=0x0)throw CliErrors[_0x5e7be8(0x1b7)](_0x5e7be8(0x1af));}const _0x32dad7=resolveWriteScope({'explicitGlobal':_0x1b6a34[_0x5e7be8(0x183)](_0x5e7be8(0x186)),'policy':_0x5e7be8(0x1b5)}),_0xba3fa=toScopeFlags(_0x32dad7),_0x22305d=readScopedConfig(_0xba3fa),_0x58a13d=parseAliasAppcodeSetKey(_0x44e978);if(!_0x58a13d&&!isTopLevelConfigKey(_0x44e978))throw CliErrors[_0x5e7be8(0x1b7)](_0x5e7be8(0x1bd)+_0x44e978+_0x5e7be8(0x188),_0x5e7be8(0x19d)+getTopLevelConfigKeySummary()+_0x5e7be8(0x1ac));return _0x58a13d?setLocalAppAlias(_0x22305d,_0x58a13d,_0x27ecb7):_0x22305d[_0x44e978]=_0x44e978==='pageSize'?Number(_0x27ecb7):_0x27ecb7,console[_0x5e7be8(0x18e)]('Set\x20`'+_0x44e978+'`\x20=\x20\x22'+_0x27ecb7+'\x22'+(_0x32dad7===_0x5e7be8(0x186)?'\x20(global)':'')),writeScopedConfig(_0x22305d,_0xba3fa),{'ok':!![]};}},deleteDef={'service':a16_0x4eebbe(0x1b3),'command':a16_0x4eebbe(0x18b),'description':a16_0x4eebbe(0x1b1),'risk':a16_0x4eebbe(0x189),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x4eebbe(0x1bb),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x4d51e6){const _0x17f8a4=a16_0x4eebbe,_0x45f978=_0x4d51e6[_0x17f8a4(0x182)][0x0];if(!_0x45f978)throw CliErrors[_0x17f8a4(0x1b7)](_0x17f8a4(0x19b),_0x17f8a4(0x180)+CLI_BIN_NAME+_0x17f8a4(0x17c));const _0xf2535f=resolveWriteScope({'explicitGlobal':_0x4d51e6[_0x17f8a4(0x183)](_0x17f8a4(0x186)),'policy':_0x17f8a4(0x1b5)}),_0x3429e6=toScopeFlags(_0xf2535f),_0x46246b=readScopedConfig(_0x3429e6),_0x24f9a7=parseAliasDeleteKey(_0x45f978);if(_0x24f9a7){if(!deleteLocalAppAlias(_0x46246b,_0x24f9a7))throw CliErrors[_0x17f8a4(0x1b7)](_0x17f8a4(0x1b9)+_0x45f978);return console['log'](_0x17f8a4(0x196)+_0x45f978+'`'+(_0xf2535f===_0x17f8a4(0x186)?_0x17f8a4(0x1b8):'')),writeScopedConfig(_0x46246b,_0x3429e6),{'ok':!![]};}if(_0x46246b[_0x45f978]===undefined)throw CliErrors[_0x17f8a4(0x1b7)]('Key\x20\x22'+_0x45f978+_0x17f8a4(0x199));return delete _0x46246b[_0x45f978],console[_0x17f8a4(0x18e)](_0x17f8a4(0x196)+_0x45f978+'`'+(_0xf2535f===_0x17f8a4(0x186)?_0x17f8a4(0x1b8):'')),writeScopedConfig(_0x46246b,_0x3429e6),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x176a50,_0x41af56){var _0x56ed94=a17_0x5c8e,_0x437eba=_0x176a50();while(!![]){try{var _0x2af7ce=parseInt(_0x56ed94(0x128))/0x1*(-parseInt(_0x56ed94(0x122))/0x2)+-parseInt(_0x56ed94(0x129))/0x3+parseInt(_0x56ed94(0x126))/0x4+-parseInt(_0x56ed94(0x121))/0x5+parseInt(_0x56ed94(0x127))/0x6+-parseInt(_0x56ed94(0x125))/0x7*(parseInt(_0x56ed94(0x124))/0x8)+parseInt(_0x56ed94(0x123))/0x9;if(_0x2af7ce===_0x41af56)break;else _0x437eba['push'](_0x437eba['shift']());}catch(_0x84c3da){_0x437eba['push'](_0x437eba['shift']());}}}(a17_0x332b,0xe10bd));import{CLI_BIN_NAME}from'../../constant/cli.js';function a17_0x5c8e(_0x573abf,_0x2eacc6){_0x573abf=_0x573abf-0x121;var _0x332b49=a17_0x332b();var _0x5c8edb=_0x332b49[_0x573abf];return _0x5c8edb;}export{CLI_BIN_NAME};export{readScopedConfig,writeScopedConfig}from'../../context.js';export{resolveConfigScope as resolveWriteScope,TOP_LEVEL_CONFIG_KEYS as TOP_LEVEL_KEYS,CONFIG_ENUM_VALUES as ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey,toScopeFlags}from'../../commands/common/config-policy.js';function a17_0x332b(){var _0x2cf3fb=['16mNWDCS','1350139mhdvkU','3731628LLZlRq','4516338InwdRl','1memknt','2315421DIIWtl','983135HtjKgu','2041576cDynKs','14500215tvJuWG'];a17_0x332b=function(){return _0x2cf3fb;};return a17_0x332b();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a18_0x57123e=a18_0x8ca1;(function(_0xc10fa1,_0x487d7b){const _0x286dc2=a18_0x8ca1,_0x9a1c92=_0xc10fa1();while(!![]){try{const _0x454f4b=-parseInt(_0x286dc2(0x198))/0x1+-parseInt(_0x286dc2(0x1a8))/0x2+parseInt(_0x286dc2(0x167))/0x3+parseInt(_0x286dc2(0x196))/0x4+parseInt(_0x286dc2(0x18a))/0x5*(-parseInt(_0x286dc2(0x17d))/0x6)+parseInt(_0x286dc2(0x19d))/0x7+-parseInt(_0x286dc2(0x185))/0x8*(-parseInt(_0x286dc2(0x1a6))/0x9);if(_0x454f4b===_0x487d7b)break;else _0x9a1c92['push'](_0x9a1c92['shift']());}catch(_0x516373){_0x9a1c92['push'](_0x9a1c92['shift']());}}}(a18_0x1e10,0x577e5));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a18_0x57123e(0x170),'operation':a18_0x57123e(0x170),'risk':'read','paramsRequired':![],'description':a18_0x57123e(0x199),'paramsHint':a18_0x57123e(0x183)+a18_0x57123e(0x1a0),'helpExtra':['\x20\x20WHERE\x20OPERATORS',a18_0x57123e(0x16d),'\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}}',a18_0x57123e(0x15f),'\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}}',a18_0x57123e(0x19a),'\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$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$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}',a18_0x57123e(0x15e),a18_0x57123e(0x19c),'',a18_0x57123e(0x1ad),a18_0x57123e(0x161),'\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}}]}','',a18_0x57123e(0x17e),a18_0x57123e(0x163),a18_0x57123e(0x166),a18_0x57123e(0x1a5),'\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)',a18_0x57123e(0x162),'',a18_0x57123e(0x1a1),a18_0x57123e(0x1a4),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27',a18_0x57123e(0x17c)][a18_0x57123e(0x19f)]('\x0a')},{'command':'getOne','operation':a18_0x57123e(0x16c),'risk':a18_0x57123e(0x16a),'paramsRequired':!![],'description':'Get\x20a\x20single\x20record\x20by\x20ID','paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a18_0x57123e(0x182),'operation':a18_0x57123e(0x182),'risk':'write','paramsRequired':!![],'description':a18_0x57123e(0x173),'paramsHint':a18_0x57123e(0x19e)},{'command':'batchCreate','operation':a18_0x57123e(0x168),'risk':a18_0x57123e(0x164),'paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','paramsHint':a18_0x57123e(0x16b)},{'command':a18_0x57123e(0x1a7),'operation':a18_0x57123e(0x1a7),'risk':a18_0x57123e(0x164),'paramsRequired':!![],'description':a18_0x57123e(0x188),'paramsHint':a18_0x57123e(0x18d)},{'command':a18_0x57123e(0x17b),'operation':a18_0x57123e(0x17b),'risk':'high-risk-write','paramsRequired':!![],'description':'Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','paramsHint':a18_0x57123e(0x165)},{'command':a18_0x57123e(0x18f),'operation':a18_0x57123e(0x18f),'risk':'read','paramsRequired':![],'description':a18_0x57123e(0x160),'paramsHint':a18_0x57123e(0x15b)+a18_0x57123e(0x176),'helpExtra':[a18_0x57123e(0x171),'\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20field\x20values\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}',a18_0x57123e(0x190),a18_0x57123e(0x197),a18_0x57123e(0x187),a18_0x57123e(0x18e),a18_0x57123e(0x175),a18_0x57123e(0x186),'',a18_0x57123e(0x177),a18_0x57123e(0x179),a18_0x57123e(0x17a),a18_0x57123e(0x189),a18_0x57123e(0x1af),a18_0x57123e(0x192),a18_0x57123e(0x18c),'',a18_0x57123e(0x15d),a18_0x57123e(0x15c),a18_0x57123e(0x18b),'',a18_0x57123e(0x193),a18_0x57123e(0x19b)]['join']('\x0a')}];function makeDataCommand(_0x36026f){const _0x2c7ec6=a18_0x57123e,_0x4941ca=_0x2c7ec6(0x178)+_0x36026f[_0x2c7ec6(0x1ac)],_0x3f9e26={'service':'data','command':_0x36026f[_0x2c7ec6(0x1ac)],'description':_0x36026f[_0x2c7ec6(0x1ae)],'risk':_0x36026f[_0x2c7ec6(0x1ab)],'helpExtra':_0x36026f[_0x2c7ec6(0x191)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x36026f[_0x2c7ec6(0x195)]}],'validate':async _0x116dc0=>{const _0xa0c146=_0x2c7ec6;_0x36026f[_0xa0c146(0x172)]&&requireAnyOf(_0x116dc0,[_0xa0c146(0x1a3)],_0x4941ca),_0x36026f[_0xa0c146(0x1aa)]===_0xa0c146(0x168)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x116dc0[_0xa0c146(0x184)](_0xa0c146(0x1a3))));},async 'execute'(_0x5a1965){const _0x561350=_0x2c7ec6,_0x169b30=_0x5a1965[_0x561350(0x184)](_0x561350(0x16f)),_0x450d96=_0x36026f['operation']==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x5a1965[_0x561350(0x184)](_0x561350(0x1a3)))):parseJsonParams(_0x5a1965[_0x561350(0x184)](_0x561350(0x1a3)))??{},_0x34691e=Date[_0x561350(0x16e)](),_0x22efc8=await executeData(_0x169b30,_0x36026f['operation'],_0x450d96),_0x3b90ba=Date[_0x561350(0x16e)]()-_0x34691e;return{'ok':!![],'data':{'result':_0x22efc8,'elapsed':_0x3b90ba},'message':_0x561350(0x178)+_0x36026f[_0x561350(0x1ac)]+_0x561350(0x181)+_0x3b90ba+'ms'};}};return _0x36026f[_0x2c7ec6(0x1ab)]!==_0x2c7ec6(0x16a)&&(_0x3f9e26[_0x2c7ec6(0x1a9)]=async _0x638ea5=>{const _0x47145b=_0x2c7ec6,_0x5b66df=_0x638ea5[_0x47145b(0x184)](_0x47145b(0x16f)),_0x470f44=_0x36026f[_0x47145b(0x1aa)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x638ea5[_0x47145b(0x184)](_0x47145b(0x1a3)))):parseJsonParams(_0x638ea5[_0x47145b(0x184)]('params'))??{};return dryRun(_0x47145b(0x194),_0x47145b(0x180)+_0x5b66df+'/'+_0x36026f[_0x47145b(0x1aa)])[_0x47145b(0x174)](_0x470f44)[_0x47145b(0x1ae)]('Preview:\x20data\x20'+_0x36026f[_0x47145b(0x1ac)]+_0x47145b(0x169)+_0x5b66df)[_0x47145b(0x17f)]();}),_0x3f9e26;}function a18_0x8ca1(_0x4220ef,_0x4f33fb){_0x4220ef=_0x4220ef-0x15b;const _0x1e1097=a18_0x1e10();let _0x8ca117=_0x1e1097[_0x4220ef];return _0x8ca117;}function a18_0x1e10(){const _0x28ab47=['19850NpHjoH','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','aggregate','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','helpExtra','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Post-aggregation\x20filter,\x20e.g.\x20{\x22total\x22:{\x22$gt\x22:1000}}','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','POST','paramsHint','276536gPuPrY','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','520552lYhVWg','Filter\x20dataset\x20records\x20with\x20query\x20conditions','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','\x20\x20\x20\x20$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}}','2091194frlzRl','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','join','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\x20\x20PAGINATION','map','params','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','\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}]','216SccUQi','update','243186DKbwQk','dryRun','operation','risk','command','\x20\x20LOGICAL\x20COMBINATORS','description','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','\x20\x20EXAMPLES','\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','write','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\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]','2113710DogdUK','batchCreate','\x20on\x20dataset\x20','read','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','getOne','\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}}','now','code','filter','\x20\x20AGGREGATE\x20TYPES','paramsRequired','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','body','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20PARAMS\x20STRUCTURE','data\x20','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','delete','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','360DugMps','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','build','/api/{appCode}/','\x20completed\x20in\x20','create','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','str','55424hKjPea','\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','Update\x20an\x20existing\x20record','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)'];a18_0x1e10=function(){return _0x28ab47;};return a18_0x1e10();}export const dataDefinitions=specs[a18_0x57123e(0x1a2)](makeDataCommand);
|
|
1
|
+
const a18_0xbaf1e8=a18_0x5409;function a18_0x5409(_0x50366b,_0x31603a){_0x50366b=_0x50366b-0xfc;const _0x2ab4c7=a18_0x2ab4();let _0x540955=_0x2ab4c7[_0x50366b];return _0x540955;}(function(_0x5a95f7,_0x1987b0){const _0x500ce5=a18_0x5409,_0xf10819=_0x5a95f7();while(!![]){try{const _0x746cc0=parseInt(_0x500ce5(0x103))/0x1*(-parseInt(_0x500ce5(0x124))/0x2)+parseInt(_0x500ce5(0x120))/0x3+parseInt(_0x500ce5(0x112))/0x4+parseInt(_0x500ce5(0x10a))/0x5*(-parseInt(_0x500ce5(0x13c))/0x6)+-parseInt(_0x500ce5(0x12f))/0x7*(-parseInt(_0x500ce5(0x12e))/0x8)+-parseInt(_0x500ce5(0x12a))/0x9+parseInt(_0x500ce5(0x11a))/0xa*(parseInt(_0x500ce5(0x10f))/0xb);if(_0x746cc0===_0x1987b0)break;else _0xf10819['push'](_0xf10819['shift']());}catch(_0x3d816e){_0xf10819['push'](_0xf10819['shift']());}}}(a18_0x2ab4,0x98e7a));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';function a18_0x2ab4(){const _0x2a3788=['description','high-risk-write','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','POST','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','dryRun','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','5819484vahJnO','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\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}}','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','now','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','Get\x20a\x20single\x20record\x20by\x20ID','\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}}]}','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','getOne','params','\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}}','delete','Update\x20an\x20existing\x20record','code','\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}}','update','operation','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','risk','\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}}','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','227543YvyFeX','str','\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','\x20\x20\x20\x20$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\x20WHERE\x20OPERATORS','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','batchCreate','5RZDJOV','create','body','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','\x20\x20\x20\x20$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]}}','2025133qYYjsv','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Post-aggregation\x20filter,\x20e.g.\x20{\x22total\x22:{\x22$gt\x22:1000}}','command','4530384pudKse','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','write','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','join','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','10RiuHFz','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','\x20\x20AGGREGATE\x20TYPES','\x20on\x20dataset\x20','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','2774988AtkQLh','read','data\x20','\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}]','2GLLDOz','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','\x20\x20EXAMPLES','filter','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','5218695XAMqpy','\x20completed\x20in\x20','map','paramsHint','4888LseWdt','1855BEmRmG','\x20\x20PAGINATION','data'];a18_0x2ab4=function(){return _0x2a3788;};return a18_0x2ab4();}import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':'filter','operation':a18_0xbaf1e8(0x127),'risk':a18_0xbaf1e8(0x121),'paramsRequired':![],'description':'Filter\x20dataset\x20records\x20with\x20query\x20conditions','paramsHint':a18_0xbaf1e8(0x13f)+a18_0xbaf1e8(0x102),'helpExtra':[a18_0xbaf1e8(0x107),a18_0xbaf1e8(0x14c),a18_0xbaf1e8(0x106),'\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}}',a18_0xbaf1e8(0x13e),a18_0xbaf1e8(0x141),a18_0xbaf1e8(0x148),a18_0xbaf1e8(0x10e),a18_0xbaf1e8(0x129),a18_0xbaf1e8(0x101),'\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','','\x20\x20LOGICAL\x20COMBINATORS',a18_0xbaf1e8(0x105),a18_0xbaf1e8(0x144),'','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)',a18_0xbaf1e8(0x138),a18_0xbaf1e8(0x123),a18_0xbaf1e8(0x115),a18_0xbaf1e8(0x134),'',a18_0xbaf1e8(0x130),'\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27',a18_0xbaf1e8(0x142)][a18_0xbaf1e8(0x117)]('\x0a')},{'command':a18_0xbaf1e8(0x146),'operation':a18_0xbaf1e8(0x146),'risk':a18_0xbaf1e8(0x121),'paramsRequired':!![],'description':a18_0xbaf1e8(0x143),'paramsHint':a18_0xbaf1e8(0x145)},{'command':a18_0xbaf1e8(0x10b),'operation':a18_0xbaf1e8(0x10b),'risk':'write','paramsRequired':!![],'description':a18_0xbaf1e8(0x11e),'paramsHint':a18_0xbaf1e8(0xff)},{'command':'batchCreate','operation':'batchCreate','risk':a18_0xbaf1e8(0x114),'paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','paramsHint':'JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27'},{'command':a18_0xbaf1e8(0xfc),'operation':'update','risk':'write','paramsRequired':!![],'description':a18_0xbaf1e8(0x14a),'paramsHint':'JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27'},{'command':a18_0xbaf1e8(0x149),'operation':a18_0xbaf1e8(0x149),'risk':a18_0xbaf1e8(0x133),'paramsRequired':!![],'description':a18_0xbaf1e8(0x113),'paramsHint':a18_0xbaf1e8(0x145)},{'command':'aggregate','operation':'aggregate','risk':a18_0xbaf1e8(0x121),'paramsRequired':![],'description':a18_0xbaf1e8(0x135),'paramsHint':a18_0xbaf1e8(0x116)+a18_0xbaf1e8(0x119),'helpExtra':[a18_0xbaf1e8(0x11c),'\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20field\x20values\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}',a18_0xbaf1e8(0x118),a18_0xbaf1e8(0x10d),a18_0xbaf1e8(0x11f),'\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}',a18_0xbaf1e8(0x125),'\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','','\x20\x20PARAMS\x20STRUCTURE','\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]',a18_0xbaf1e8(0x139),a18_0xbaf1e8(0x108),a18_0xbaf1e8(0x128),a18_0xbaf1e8(0x110),a18_0xbaf1e8(0x13d),'',a18_0xbaf1e8(0x126),a18_0xbaf1e8(0x11b),a18_0xbaf1e8(0x137),'',a18_0xbaf1e8(0x13b),a18_0xbaf1e8(0xfe)][a18_0xbaf1e8(0x117)]('\x0a')}];function makeDataCommand(_0x7f5ee8){const _0x51e580=a18_0xbaf1e8,_0x3944e0=_0x51e580(0x122)+_0x7f5ee8[_0x51e580(0x111)],_0x57c182={'service':_0x51e580(0x131),'command':_0x7f5ee8[_0x51e580(0x111)],'description':_0x7f5ee8[_0x51e580(0x132)],'risk':_0x7f5ee8[_0x51e580(0x100)],'helpExtra':_0x7f5ee8['helpExtra'],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x7f5ee8[_0x51e580(0x12d)]}],'validate':async _0x54dff8=>{const _0x578766=_0x51e580;_0x7f5ee8['paramsRequired']&&requireAnyOf(_0x54dff8,[_0x578766(0x147)],_0x3944e0),_0x7f5ee8[_0x578766(0xfd)]==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x54dff8['str'](_0x578766(0x147))));},async 'execute'(_0xc22f67){const _0x3aed28=_0x51e580,_0x568bf9=_0xc22f67[_0x3aed28(0x104)](_0x3aed28(0x14b)),_0x2e2205=_0x7f5ee8[_0x3aed28(0xfd)]===_0x3aed28(0x109)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0xc22f67[_0x3aed28(0x104)](_0x3aed28(0x147)))):parseJsonParams(_0xc22f67['str'](_0x3aed28(0x147)))??{},_0x2b3a26=Date[_0x3aed28(0x140)](),_0x2bda1c=await executeData(_0x568bf9,_0x7f5ee8[_0x3aed28(0xfd)],_0x2e2205),_0x3e09f7=Date[_0x3aed28(0x140)]()-_0x2b3a26;return{'ok':!![],'data':{'result':_0x2bda1c,'elapsed':_0x3e09f7},'message':_0x3aed28(0x122)+_0x7f5ee8[_0x3aed28(0x111)]+_0x3aed28(0x12b)+_0x3e09f7+'ms'};}};return _0x7f5ee8['risk']!==_0x51e580(0x121)&&(_0x57c182[_0x51e580(0x13a)]=async _0x49f1bd=>{const _0x5e6ff0=_0x51e580,_0x361b23=_0x49f1bd[_0x5e6ff0(0x104)](_0x5e6ff0(0x14b)),_0x116042=_0x7f5ee8['operation']===_0x5e6ff0(0x109)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x49f1bd[_0x5e6ff0(0x104)](_0x5e6ff0(0x147)))):parseJsonParams(_0x49f1bd[_0x5e6ff0(0x104)](_0x5e6ff0(0x147)))??{};return dryRun(_0x5e6ff0(0x136),'/api/{appCode}/'+_0x361b23+'/'+_0x7f5ee8[_0x5e6ff0(0xfd)])[_0x5e6ff0(0x10c)](_0x116042)[_0x5e6ff0(0x132)]('Preview:\x20data\x20'+_0x7f5ee8[_0x5e6ff0(0x111)]+_0x5e6ff0(0x11d)+_0x361b23)['build']();}),_0x57c182;}export const dataDefinitions=specs[a18_0xbaf1e8(0x12c)](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x486643=a19_0x19e6;(function(_0x4a92f9,_0x253837){const _0x28eec1=a19_0x19e6,_0x37ee77=_0x4a92f9();while(!![]){try{const _0x2e67b9=parseInt(_0x28eec1(0x118))/0x1*(parseInt(_0x28eec1(0xfa))/0x2)+-parseInt(_0x28eec1(0xf7))/0x3*(parseInt(_0x28eec1(0x107))/0x4)+parseInt(_0x28eec1(0xe7))/0x5*(parseInt(_0x28eec1(0xfb))/0x6)+parseInt(_0x28eec1(0xd8))/0x7+parseInt(_0x28eec1(0x10e))/0x8*(parseInt(_0x28eec1(0x10f))/0x9)+parseInt(_0x28eec1(0x10c))/0xa+-parseInt(_0x28eec1(0x10a))/0xb;if(_0x2e67b9===_0x253837)break;else _0x37ee77['push'](_0x37ee77['shift']());}catch(_0x1e713d){_0x37ee77['push'](_0x37ee77['shift']());}}}(a19_0x1eb4,0x3edb6));import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x3b4fdd){const _0x2d6376=a19_0x19e6;if(_0x3b4fdd[_0x2d6376(0x108)])return null;const _0x25fe39=Boolean(_0x3b4fdd[_0x2d6376(0xf8)]!==undefined||_0x3b4fdd[_0x2d6376(0x100)]!==undefined);let _0x40e3db={};if(!_0x25fe39&&typeof _0x3b4fdd[_0x2d6376(0x101)]===_0x2d6376(0x115))try{_0x40e3db=JSON[_0x2d6376(0x112)](_0x3b4fdd[_0x2d6376(0x101)]);}catch{}const _0x5a385d=_0x25fe39?_0x3b4fdd[_0x2d6376(0xe8)]:_0x3b4fdd[_0x2d6376(0xd7)],_0x5ae1a5=_0x25fe39?_0x3b4fdd[_0x2d6376(0xf8)]:_0x3b4fdd[_0x2d6376(0xe8)],_0x5135e4=_0x25fe39?_0x3b4fdd[_0x2d6376(0x100)]:_0x3b4fdd[_0x2d6376(0x117)]||_0x3b4fdd['dataType'],_0xe3496d=_0x25fe39?_0x3b4fdd[_0x2d6376(0xcb)]===!![]:_0x40e3db[_0x2d6376(0xcb)]===!![],_0x4366cb=_0x25fe39?_0x3b4fdd[_0x2d6376(0x104)]===!![]:_0x40e3db[_0x2d6376(0x104)]===!![],_0x4b9587=_0x25fe39?_0x3b4fdd[_0x2d6376(0xec)]??null:_0x40e3db['options']??null,_0x295a36={'name':_0x5a385d,'displayName':_0x5ae1a5||_0x5a385d,'type':_0x5135e4,'dbType':_0x3b4fdd[_0x2d6376(0xcf)],'pk':_0xe3496d,'required':_0x4366cb,'description':_0x3b4fdd[_0x2d6376(0xeb)]||undefined};return Array[_0x2d6376(0xf4)](_0x4b9587)&&_0x4b9587[_0x2d6376(0xd4)]>0x0&&(_0x295a36[_0x2d6376(0xec)]=_0x4b9587),_0x295a36;}function parseJsonMaybe(_0x9bc0b8){if(typeof _0x9bc0b8!=='string')return _0x9bc0b8;try{return JSON['parse'](_0x9bc0b8);}catch{return _0x9bc0b8;}}function normalizeOperationEntry(_0x335d36,_0x3b5836){const _0x3584d8=a19_0x19e6;if(!_0x3b5836||typeof _0x3b5836!==_0x3584d8(0x10d))return null;if(!_0x3b5836[_0x3584d8(0xdd)]||!_0x3b5836['path'])return null;const _0x3cfccc={'name':_0x335d36,'method':_0x3b5836[_0x3584d8(0xdd)],'path':_0x3b5836[_0x3584d8(0xdc)]};if(_0x3b5836[_0x3584d8(0xda)])_0x3cfccc[_0x3584d8(0xda)]=_0x3b5836[_0x3584d8(0xda)];if(_0x3b5836['requestBody']!=null)_0x3cfccc[_0x3584d8(0xef)]=parseJsonMaybe(_0x3b5836['requestBody']);if(_0x3b5836[_0x3584d8(0xd3)]!=null)_0x3cfccc[_0x3584d8(0xd3)]=parseJsonMaybe(_0x3b5836['responseBody']);if(_0x3b5836[_0x3584d8(0xf9)]!=null)_0x3cfccc['beforeScriptId']=_0x3b5836[_0x3584d8(0xf9)];if(_0x3b5836[_0x3584d8(0x110)]!=null)_0x3cfccc['afterScriptId']=_0x3b5836[_0x3584d8(0x110)];if(Array['isArray'](_0x3b5836[_0x3584d8(0x102)]))_0x3cfccc[_0x3584d8(0x102)]=_0x3b5836[_0x3584d8(0x102)];if(Array[_0x3584d8(0xf4)](_0x3b5836[_0x3584d8(0x113)]))_0x3cfccc[_0x3584d8(0x113)]=_0x3b5836[_0x3584d8(0x113)];return _0x3cfccc;}function summarizeDbtable(_0x4f9ef9){const _0x1a8b2d=a19_0x19e6,_0x256c11={},_0x51ae37=[_0x1a8b2d(0xfe),'dbName',_0x1a8b2d(0xd6),_0x1a8b2d(0xdb),_0x1a8b2d(0xcb),'allFields',_0x1a8b2d(0xd9),'createTimeField',_0x1a8b2d(0x116),_0x1a8b2d(0xce),_0x1a8b2d(0xf3),_0x1a8b2d(0xd0),'modifierNameField','labelField',_0x1a8b2d(0xee)];for(const _0x1b972f of _0x51ae37){if(_0x4f9ef9[_0x1b972f]!==undefined)_0x256c11[_0x1b972f]=_0x4f9ef9[_0x1b972f];}return typeof _0x256c11[_0x1a8b2d(0xe2)]===_0x1a8b2d(0x115)&&_0x256c11[_0x1a8b2d(0xe2)][_0x1a8b2d(0xd4)]>0x0&&(_0x256c11[_0x1a8b2d(0xf2)]=_0x256c11[_0x1a8b2d(0xe2)][_0x1a8b2d(0xe3)](',')['map'](_0x4c93b7=>_0x4c93b7[_0x1a8b2d(0xd2)]())[_0x1a8b2d(0xd1)](Boolean)),_0x256c11;}function normalizeRelatedPages(_0xfb2e69){const _0x3536e6=a19_0x19e6;if(!Array[_0x3536e6(0xf4)](_0xfb2e69))return[];return _0xfb2e69['filter'](_0x457c2a=>_0x457c2a&&typeof _0x457c2a==='object')[_0x3536e6(0xdf)](_0x4b0328=>({'id':_0x4b0328['id'],'type':_0x4b0328[_0x3536e6(0x117)],'code':_0x4b0328[_0x3536e6(0xd7)],'title':_0x4b0328['title'],'deleted':_0x4b0328['deleted']===!![]}));}function normalizeFallbackFieldName(_0x51d3de,_0x53addb){const _0xfa70e3=_0x51d3de['trim']();if(!_0xfa70e3)return null;return{'name':_0xfa70e3,'displayName':_0xfa70e3,'type':undefined,'dbType':undefined,'pk':_0xfa70e3===_0x53addb,'required':![],'description':undefined};}function a19_0x19e6(_0x59fd94,_0x4ee2b8){_0x59fd94=_0x59fd94-0xcb;const _0x1eb4ef=a19_0x1eb4();let _0x19e6c6=_0x1eb4ef[_0x59fd94];return _0x19e6c6;}function a19_0x1eb4(){const _0x2c9c7a=['updateTimeField','type','13383yqWmAY','pkField','toTableName','source','creatorIdField','dbType','modifierIdField','filter','trim','responseBody','length','dbtableConfig','tableName','code','3319176xGYWNe','logicField','host','datasetKey','path','method','formatRules','map','entries','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','allFields','split','str','modelId','find','2276245HzojfA','name','properties','toFieldLabel','description','options','relatedPageInfoList','dblinkInfoDTO','requestBody','doVersion','indexes','allFieldNames','creatorNameField','isArray','toField','modelCode','891JgbrZp','displayName','beforeScriptId','24ZTrPAD','6pgbrxZ','read','toDatasetCode','dbId','relations','doType','extend','requestFields','validateRules','required','fields','columnCodeListWithDeleted','2216BrAdgp','deleted','toDatasetName','14014033zThTZM','dataset','4146720tDGUCQ','object','272ELcCVl','50643lDAxdh','afterScriptId','operations','parse','responseFields','tableComment','string'];a19_0x1eb4=function(){return _0x2c9c7a;};return a19_0x1eb4();}async function loadListFieldFallback(_0x531f56,_0x5a37d1){const _0x381a40=a19_0x19e6;if(!_0x531f56||!_0x5a37d1)return[];try{const _0x4dcdbb=await listDatasets(_0x531f56,{'code':_0x5a37d1}),_0x4902d1=_0x4dcdbb[_0x381a40(0xe6)](_0xec7db1=>_0xec7db1['code']===_0x5a37d1)??_0x4dcdbb[0x0],_0x297cf0=_0x4902d1?.[_0x381a40(0xd5)]??{},_0x3ec577=typeof _0x297cf0[_0x381a40(0xe2)]===_0x381a40(0x115)?_0x297cf0[_0x381a40(0xe2)][_0x381a40(0xe3)](','):[];return _0x3ec577[_0x381a40(0xdf)](_0x3d6292=>normalizeFallbackFieldName(_0x3d6292,_0x297cf0['pkField']))[_0x381a40(0xd1)](_0x4da5de=>_0x4da5de!==null);}catch{return[];}}export const datasetDetail={'service':'dataset','command':'detail','description':a19_0x486643(0xe1),'risk':a19_0x486643(0xfc),'flags':[CODE_FLAG],async 'execute'(_0x1c77d8){const _0x388eb3=a19_0x486643,_0x13350f=await getDatasetDetail(_0x1c77d8['str'](_0x388eb3(0xd7))),_0x22f5bd=Array[_0x388eb3(0xf4)](_0x13350f['fields'])?_0x13350f[_0x388eb3(0x105)]:Array[_0x388eb3(0xf4)](_0x13350f['properties'])?_0x13350f[_0x388eb3(0xe9)]:[];let _0x2ed86f=_0x22f5bd[_0x388eb3(0xdf)](_0x55c1cf=>normalizeField(_0x55c1cf))[_0x388eb3(0xd1)](_0x2e7a5c=>_0x2e7a5c!==null);_0x2ed86f[_0x388eb3(0xd4)]===0x0&&(_0x2ed86f=await loadListFieldFallback(_0x1c77d8['appCode'],_0x1c77d8[_0x388eb3(0xe4)](_0x388eb3(0xd7))));const _0x371a3b=_0x13350f[_0x388eb3(0x111)]??{},_0xc53c01=[];for(const [_0x1f2637,_0xb0c9d9]of Object[_0x388eb3(0xe0)](_0x371a3b)){const _0x2d79b8=normalizeOperationEntry(_0x1f2637,_0xb0c9d9);if(_0x2d79b8)_0xc53c01['push'](_0x2d79b8);}const _0x53c871=_0x13350f[_0x388eb3(0xd5)]??{},_0x212def=_0x13350f[_0x388eb3(0x10b)]??{},_0x20bebe=_0x53c871[_0x388eb3(0xfe)]!=null?{'id':_0x53c871[_0x388eb3(0xfe)],'name':_0x53c871['dbName']??null}:undefined;let _0x4dac47;return typeof _0x13350f[_0x388eb3(0x101)]===_0x388eb3(0x115)&&(_0x4dac47=parseJsonMaybe(_0x13350f[_0x388eb3(0x101)])),{'ok':!![],'data':{'id':_0x13350f[_0x388eb3(0xe5)]??_0x13350f['id'],'name':_0x13350f[_0x388eb3(0xe8)],'code':_0x13350f[_0x388eb3(0xf6)]||_0x13350f[_0x388eb3(0xd7)],'doVersion':_0x13350f[_0x388eb3(0xf0)],'description':_0x13350f['description']||_0x212def[_0x388eb3(0x114)]||undefined,'source':_0x13350f[_0x388eb3(0xcd)]||_0x212def['sourceType'],'table':_0x53c871['tableName']||_0x212def[_0x388eb3(0xd6)],'datasetKey':_0x53c871[_0x388eb3(0xdb)],'pk':_0x53c871[_0x388eb3(0xcb)],'db':_0x20bebe,'dbtable':summarizeDbtable(_0x53c871),'fields':_0x2ed86f,'operations':_0xc53c01,'indexes':Array['isArray'](_0x212def[_0x388eb3(0xf1)])?_0x212def[_0x388eb3(0xf1)]:[],'relations':Array[_0x388eb3(0xf4)](_0x13350f[_0x388eb3(0xff)])?_0x13350f[_0x388eb3(0xff)][_0x388eb3(0xdf)](_0x23ea49=>({'fromField':_0x23ea49['fromField'],'toDataset':_0x23ea49[_0x388eb3(0x109)],'toCode':_0x23ea49[_0x388eb3(0xfd)],'toTable':_0x23ea49[_0x388eb3(0xcc)],'toField':_0x23ea49[_0x388eb3(0xf5)],'labelField':_0x23ea49[_0x388eb3(0xea)]||undefined})):[],'relatedPages':normalizeRelatedPages(_0x13350f[_0x388eb3(0xed)]),...Array[_0x388eb3(0xf4)](_0x13350f[_0x388eb3(0x106)])?{'columnCodeListWithDeleted':_0x13350f[_0x388eb3(0x106)]}:{},'formatRules':Array['isArray'](_0x13350f['formatRules'])?_0x13350f[_0x388eb3(0xde)]:[],'validateRules':Array[_0x388eb3(0xf4)](_0x13350f[_0x388eb3(0x103)])?_0x13350f['validateRules']:[],..._0x4dac47!==undefined?{'extend':_0x4dac47}:{},'stats':{'fieldCount':_0x2ed86f[_0x388eb3(0xd4)],'operationCount':_0xc53c01[_0x388eb3(0xd4)]}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a20_0x499e(){const _0x28e962=['6mMOXSx','1755831AWoDlO','2679952MfyVTz','1077474xgGoNc','40GdgbON','6366sfQJpv','264EDueRQ','3232080rUnKGZ','1282lLMtaY','4761836NFLjzu','253467rTAwqF'];a20_0x499e=function(){return _0x28e962;};return a20_0x499e();}(function(_0x42b723,_0x4a3469){const _0x430053=a20_0x598c,_0x5b3412=_0x42b723();while(!![]){try{const _0xac7a2d=parseInt(_0x430053(0x1e7))/0x1+-parseInt(_0x430053(0x1e1))/0x2*(-parseInt(_0x430053(0x1e9))/0x3)+parseInt(_0x430053(0x1e2))/0x4+-parseInt(_0x430053(0x1e0))/0x5*(parseInt(_0x430053(0x1e4))/0x6)+-parseInt(_0x430053(0x1e5))/0x7+-parseInt(_0x430053(0x1df))/0x8*(parseInt(_0x430053(0x1e3))/0x9)+parseInt(_0x430053(0x1e8))/0xa*(-parseInt(_0x430053(0x1e6))/0xb);if(_0xac7a2d===_0x4a3469)break;else _0x5b3412['push'](_0x5b3412['shift']());}catch(_0x3d8ac8){_0x5b3412['push'](_0x5b3412['shift']());}}}(a20_0x499e,0xc9e63));import{datasetList}from'../../commands/dataset/list.js';function a20_0x598c(_0x128239,_0x5d3d72){_0x128239=_0x128239-0x1df;const _0x499e57=a20_0x499e();let _0x598cd9=_0x499e57[_0x128239];return _0x598cd9;}import{datasetDetail}from'../../commands/dataset/detail.js';import{datasetSdkDoc}from'../../commands/dataset/sdk-doc.js';export const datasetDefinitions=[datasetList,datasetDetail,datasetSdkDoc];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a21_0x1a3c55=a21_0x5bb6;(function(_0x12e4e2,_0x7c5b9f){const _0x48b64a=a21_0x5bb6,_0x172280=_0x12e4e2();while(!![]){try{const _0x21a87a=-parseInt(_0x48b64a(0x18d))/0x1+parseInt(_0x48b64a(0x187))/0x2*(parseInt(_0x48b64a(0x17e))/0x3)+-parseInt(_0x48b64a(0x199))/0x4+parseInt(_0x48b64a(0x189))/0x5*(-parseInt(_0x48b64a(0x188))/0x6)+-parseInt(_0x48b64a(0x18f))/0x7+parseInt(_0x48b64a(0x186))/0x8*(parseInt(_0x48b64a(0x18b))/0x9)+-parseInt(_0x48b64a(0x193))/0xa*(-parseInt(_0x48b64a(0x17f))/0xb);if(_0x21a87a===_0x7c5b9f)break;else _0x172280['push'](_0x172280['shift']());}catch(_0x51bde6){_0x172280['push'](_0x172280['shift']());}}}(a21_0x403b,0xefc55));import{listDatasets}from'../../core/api-client.js';function a21_0x403b(){const _0x545e0f=['name','description','datasetKey','20ooVfQY','dbtableConfig','list','allFields','trim','pkField','4468448PDCjEc','str','978BehJkB','26147869edOfMF','read','dataset','map','code','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','54216ZKrXbf','1528sipyNd','6iVVhYE','5351695rfrBUT','appCode','117KvfNke','source','1869282aTfEVo','Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)','367423twvdMm'];a21_0x403b=function(){return _0x545e0f;};return a21_0x403b();}import{CODE_FLAG}from'../../commands/common/flags.js';function a21_0x5bb6(_0x58e611,_0x26d193){_0x58e611=_0x58e611-0x17e;const _0x403b10=a21_0x403b();let _0x5bb69b=_0x403b10[_0x58e611];return _0x5bb69b;}export const datasetList={'service':a21_0x1a3c55(0x181),'command':a21_0x1a3c55(0x195),'description':a21_0x1a3c55(0x185),'risk':a21_0x1a3c55(0x180),'flags':[{'name':'name','type':'string','description':a21_0x1a3c55(0x18e)},{...CODE_FLAG,'required':![],'description':a21_0x1a3c55(0x184)}],async 'execute'(_0x54c981){const _0x177928=a21_0x1a3c55,_0x487782=_0x54c981[_0x177928(0x19a)]('name'),_0x2219e6=_0x54c981[_0x177928(0x19a)](_0x177928(0x183)),_0x1e7fe8=await listDatasets(_0x54c981[_0x177928(0x18a)],{..._0x487782&&{'name':_0x487782},..._0x2219e6&&{'code':_0x2219e6}});return{'ok':!![],'data':{'total':_0x1e7fe8['length'],'datasets':_0x1e7fe8[_0x177928(0x182)](_0x42332e=>{const _0x558ddf=_0x177928,_0x4627c3=_0x42332e[_0x558ddf(0x194)]??{};return{'id':_0x42332e['id'],'code':_0x42332e[_0x558ddf(0x183)],'name':_0x42332e[_0x558ddf(0x190)],'source':_0x42332e[_0x558ddf(0x18c)],'description':_0x42332e[_0x558ddf(0x191)],'table':_0x4627c3['tableName'],'datasetKey':_0x4627c3[_0x558ddf(0x192)],'pk':_0x4627c3[_0x558ddf(0x198)],'fields':_0x4627c3[_0x558ddf(0x196)]?_0x4627c3[_0x558ddf(0x196)]['split'](',')['map'](_0x3c2560=>_0x3c2560[_0x558ddf(0x197)]()):[]};})}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a22_0x3d98(){const _0x103e1e=['sdk-doc','read','5700101fIyyzn','268849ylOLew','Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','188HgAaGn','appCode','string','dataset','342xjlATY','7947CPllxt','5880PHcBTi','1467657PGixjP','40QDNRNg','str','473810JrqjwM','564uqhzVr','code','313FaVLSu','trim'];a22_0x3d98=function(){return _0x103e1e;};return a22_0x3d98();}const a22_0x44167f=a22_0x4e81;(function(_0x57e29f,_0x4ba804){const _0x54523e=a22_0x4e81,_0x5505a1=_0x57e29f();while(!![]){try{const _0x115f8f=parseInt(_0x54523e(0x12a))/0x1*(-parseInt(_0x54523e(0x128))/0x2)+parseInt(_0x54523e(0x122))/0x3*(-parseInt(_0x54523e(0x11d))/0x4)+-parseInt(_0x54523e(0x123))/0x5*(parseInt(_0x54523e(0x121))/0x6)+-parseInt(_0x54523e(0x11b))/0x7*(parseInt(_0x54523e(0x125))/0x8)+parseInt(_0x54523e(0x124))/0x9+-parseInt(_0x54523e(0x127))/0xa+parseInt(_0x54523e(0x11a))/0xb;if(_0x115f8f===_0x4ba804)break;else _0x5505a1['push'](_0x5505a1['shift']());}catch(_0x18ad0a){_0x5505a1['push'](_0x5505a1['shift']());}}}(a22_0x3d98,0x278ff));function a22_0x4e81(_0x44455a,_0x3602e5){_0x44455a=_0x44455a-0x11a;const _0x3d980b=a22_0x3d98();let _0x4e81a2=_0x3d980b[_0x44455a];return _0x4e81a2;}import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';const DEFAULT_MARKDOWN='#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档';export function formatDatasetSdkMarkdown(_0x132734){const _0x202772=a22_0x4e81,_0x190826=typeof _0x132734===_0x202772(0x11f)?_0x132734[_0x202772(0x12b)]():'';return _0x190826||DEFAULT_MARKDOWN;}export const datasetSdkDoc={'service':a22_0x44167f(0x120),'command':a22_0x44167f(0x12c),'description':a22_0x44167f(0x11c),'risk':a22_0x44167f(0x12d),'flags':[{...CODE_FLAG,'description':'Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.'}],async 'execute'(_0x29bdf2){const _0x5b2f79=a22_0x44167f,_0x301bf4=_0x29bdf2[_0x5b2f79(0x126)](_0x5b2f79(0x129)),_0x19030c=await getDatasetSdkUsageDoc(_0x301bf4,_0x29bdf2[_0x5b2f79(0x11e)]);return{'ok':!![],'data':{'code':_0x301bf4,'appCode':_0x29bdf2[_0x5b2f79(0x11e)],'markdown':formatDatasetSdkMarkdown(_0x19030c)}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x336474=a23_0x1b45;(function(_0x20afd,_0x43e737){const _0x318d08=a23_0x1b45,_0x2ca03e=_0x20afd();while(!![]){try{const _0x29d222=parseInt(_0x318d08(0xe9))/0x1+-parseInt(_0x318d08(0xe7))/0x2*(-parseInt(_0x318d08(0xff))/0x3)+-parseInt(_0x318d08(0xec))/0x4+parseInt(_0x318d08(0xd8))/0x5*(parseInt(_0x318d08(0xf4))/0x6)+parseInt(_0x318d08(0x106))/0x7+-parseInt(_0x318d08(0xf7))/0x8*(-parseInt(_0x318d08(0xf9))/0x9)+parseInt(_0x318d08(0xfa))/0xa*(-parseInt(_0x318d08(0xd5))/0xb);if(_0x29d222===_0x43e737)break;else _0x2ca03e['push'](_0x2ca03e['shift']());}catch(_0x24ba38){_0x2ca03e['push'](_0x2ca03e['shift']());}}}(a23_0x16aa,0xac2f8));import a23_0x4e409e 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';function a23_0x16aa(){const _0x35986d=['(default)','\x20\x20─','✓\x20Valid\x20JSON','ClientAk','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','(removed\x20—\x20cookie\x20auth\x20disabled)','22aZTBlN','message','bold','3760sqOLPz','\x20\x20auth\x20(effective):\x20','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','(default:\x20','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','read','format','\x20\x20Session\x20check:\x20\x20\x20','accessKey','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','gray','(set,\x20length=','red','2376518YyTZVm','log','596022vxheZZ','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','check','1892488wxuKUe','✗\x20Invalid\x20JSON','defaultApp','empty','env','padEnd','(none)','Global','4794zkFbfA','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','\x20\x20Merged\x20Config','8947912sMQAeX','green','9ivLgIV','18667570VkZEUy','riskLevel','\x20doctor','status','missing','3EUfAtX','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','\x20(legacy/compat\x20only)','currentApp','repeat','\x20(accessKey)','(not\x20found)','9858030aSeFIf','version','\x20\x20Auth','(missing)','⚠\x20Empty\x20(treated\x20as\x20{})','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','length','verbose','\x20\x20API\x20Endpoints','locale','arch','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20'];a23_0x16aa=function(){return _0x35986d;};return a23_0x16aa();}import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';function a23_0x1b45(_0x261a67,_0x243a51){_0x261a67=_0x261a67-0xd3;const _0x16aae4=a23_0x16aa();let _0x1b450d=_0x16aae4[_0x261a67];return _0x1b450d;}import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';async function execute(_0x5bde65){const _0x5a7a7b=a23_0x1b45,_0x174c5d=getCliVersion(),_0x3bd35a=buildConfigFromFlags({});await initGlobalEnvironment(_0x3bd35a),console[_0x5a7a7b(0xe8)](),console[_0x5a7a7b(0xe8)](a23_0x4e409e['bold'](CLI_BIN_NAME+_0x5a7a7b(0xfc))),console[_0x5a7a7b(0xe8)](a23_0x4e409e[_0x5a7a7b(0xe4)]('─'[_0x5a7a7b(0x103)](0x32))),console['log'](_0x5a7a7b(0xe3)+_0x174c5d),console[_0x5a7a7b(0xe8)]('\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+process[_0x5a7a7b(0x107)]),console[_0x5a7a7b(0xe8)]('\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20'+process['platform']+'\x20'+process[_0x5a7a7b(0x110)]),console['log'](),console[_0x5a7a7b(0xe8)](a23_0x4e409e[_0x5a7a7b(0xd7)]('\x20\x20Config\x20Files')),console[_0x5a7a7b(0xe8)](a23_0x4e409e[_0x5a7a7b(0xe4)](_0x5a7a7b(0x113)[_0x5a7a7b(0x103)](0x1e)));const _0x3fed3c=getGlobalConfigPath(),_0x436363=getProjectConfigPath();console[_0x5a7a7b(0xe8)](_0x5a7a7b(0xdd)+(_0x3fed3c||a23_0x4e409e['gray'](_0x5a7a7b(0x105)))),console[_0x5a7a7b(0xe8)]('\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x436363||a23_0x4e409e[_0x5a7a7b(0xe4)](_0x5a7a7b(0x105)))),console['log'](),console[_0x5a7a7b(0xe8)](a23_0x4e409e['bold']('\x20\x20Config\x20JSON')),console[_0x5a7a7b(0xe8)](a23_0x4e409e[_0x5a7a7b(0xe4)]('\x20\x20─'['repeat'](0x1e)));const _0x4a1bae=(_0x16986c,_0x339015)=>{const _0x4a20ac=_0x5a7a7b;if(!_0x339015){console['log']('\x20\x20'+_0x16986c['padEnd'](0x11)+'\x20'+a23_0x4e409e[_0x4a20ac(0xe4)]('(no\x20file)'));return;}const _0x2468b8=inspectCliConfigJsonFile(_0x339015);if(_0x2468b8[_0x4a20ac(0xfd)]==='ok')console[_0x4a20ac(0xe8)]('\x20\x20'+_0x16986c[_0x4a20ac(0xf1)](0x11)+'\x20'+a23_0x4e409e[_0x4a20ac(0xf8)](_0x4a20ac(0x114)));else{if(_0x2468b8['status']===_0x4a20ac(0xef))console[_0x4a20ac(0xe8)]('\x20\x20'+_0x16986c[_0x4a20ac(0xf1)](0x11)+'\x20'+a23_0x4e409e['yellow'](_0x4a20ac(0x10a)));else _0x2468b8[_0x4a20ac(0xfd)]===_0x4a20ac(0xfe)?console[_0x4a20ac(0xe8)]('\x20\x20'+_0x16986c[_0x4a20ac(0xf1)](0x11)+'\x20'+a23_0x4e409e[_0x4a20ac(0xe4)](_0x4a20ac(0x109))):(console['log']('\x20\x20'+_0x16986c[_0x4a20ac(0xf1)](0x11)+'\x20'+a23_0x4e409e[_0x4a20ac(0xe6)](_0x4a20ac(0xed))),console[_0x4a20ac(0xe8)]('\x20\x20'+''['padEnd'](0x11)+'\x20'+a23_0x4e409e['red'](_0x2468b8[_0x4a20ac(0xd6)])));}};_0x4a1bae(_0x5a7a7b(0xf3),_0x3fed3c),_0x4a1bae('Project',_0x436363),console['log'](),console[_0x5a7a7b(0xe8)](a23_0x4e409e[_0x5a7a7b(0xd7)](_0x5a7a7b(0xf6))),console[_0x5a7a7b(0xe8)](a23_0x4e409e[_0x5a7a7b(0xe4)](_0x5a7a7b(0x113)[_0x5a7a7b(0x103)](0x1e))),console['log']('\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x3bd35a['appCode']||a23_0x4e409e['red']('(not\x20set)'))),console[_0x5a7a7b(0xe8)]('\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x3bd35a[_0x5a7a7b(0xf0)]);const _0x5766fb=isLegacyCompatConfigKey(_0x5a7a7b(0x10f))?a23_0x4e409e[_0x5a7a7b(0xe4)](_0x3bd35a[_0x5a7a7b(0x10f)]+_0x5a7a7b(0x101)):_0x3bd35a[_0x5a7a7b(0x10f)];return console[_0x5a7a7b(0xe8)](_0x5a7a7b(0xdb)+_0x5766fb),console[_0x5a7a7b(0xe8)]('\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20'+(_0x3bd35a[_0x5a7a7b(0xee)]||a23_0x4e409e['gray'](_0x5a7a7b(0xf2)))),console[_0x5a7a7b(0xe8)](_0x5a7a7b(0xf5)+(_0x3bd35a[_0x5a7a7b(0x102)]||a23_0x4e409e[_0x5a7a7b(0xe4)](_0x5a7a7b(0xf2)))),console[_0x5a7a7b(0xe8)](_0x5a7a7b(0x10b)+(_0x3bd35a[_0x5a7a7b(0xe0)]||a23_0x4e409e[_0x5a7a7b(0xe4)](_0x5a7a7b(0xdc)+DEFAULT_CONFIG_VALUES[_0x5a7a7b(0xe0)]+')'))),console[_0x5a7a7b(0xe8)](_0x5a7a7b(0xde)+(_0x3bd35a['pageSize']??a23_0x4e409e[_0x5a7a7b(0xe4)](_0x5a7a7b(0x112)))),console[_0x5a7a7b(0xe8)](_0x5a7a7b(0x100)+_0x3bd35a[_0x5a7a7b(0xfb)]),console[_0x5a7a7b(0xe8)](_0x5a7a7b(0x111)+_0x3bd35a[_0x5a7a7b(0x10d)]),console['log'](_0x5a7a7b(0xd9)+AUTH_MODE[_0x5a7a7b(0x115)]),console[_0x5a7a7b(0xe8)](_0x5a7a7b(0xd3)+(_0x3bd35a[_0x5a7a7b(0xe2)]?a23_0x4e409e[_0x5a7a7b(0xf8)](_0x5a7a7b(0xe5)+_0x3bd35a[_0x5a7a7b(0xe2)][_0x5a7a7b(0x10c)]+')'):a23_0x4e409e['gray'](_0x5a7a7b(0xf2)))),console[_0x5a7a7b(0xe8)](),console['log'](a23_0x4e409e[_0x5a7a7b(0xd7)](_0x5a7a7b(0x10e))),console['log'](a23_0x4e409e[_0x5a7a7b(0xe4)](_0x5a7a7b(0x113)[_0x5a7a7b(0x103)](0x1e))),console[_0x5a7a7b(0xe8)]('\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20'+getApiDomain()),console[_0x5a7a7b(0xe8)](_0x5a7a7b(0xea)+getUserDomain()),console['log']('\x20\x20runtimeDomain:\x20\x20\x20'+getRuntimeDomain()),console[_0x5a7a7b(0xe8)](),console[_0x5a7a7b(0xe8)](a23_0x4e409e[_0x5a7a7b(0xd7)](_0x5a7a7b(0x108))),console[_0x5a7a7b(0xe8)](a23_0x4e409e['gray']('\x20\x20─'['repeat'](0x1e))),console[_0x5a7a7b(0xe8)](_0x5a7a7b(0xda)+a23_0x4e409e[_0x5a7a7b(0xf8)](AUTH_MODE[_0x5a7a7b(0x115)]+_0x5a7a7b(0x104))),console[_0x5a7a7b(0xe8)](_0x5a7a7b(0xe1)+a23_0x4e409e['gray'](_0x5a7a7b(0xd4))),console['log'](),{'ok':!![]};}export const doctorDefinition={'service':'doctor','command':a23_0x336474(0xeb),'description':'Diagnose\x20CLI\x20configuration\x20and\x20environment','risk':a23_0x336474(0xdf),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a24_0x511ea8=a24_0x5d49;(function(_0x4526a5,_0x1f73c1){const _0x9c75e3=a24_0x5d49,_0x27a6fd=_0x4526a5();while(!![]){try{const _0x1ef2b5=-parseInt(_0x9c75e3(0xb7))/0x1*(parseInt(_0x9c75e3(0xa6))/0x2)+parseInt(_0x9c75e3(0x9c))/0x3+-parseInt(_0x9c75e3(0x93))/0x4+-parseInt(_0x9c75e3(0xc3))/0x5+-parseInt(_0x9c75e3(0xb0))/0x6+parseInt(_0x9c75e3(0xc9))/0x7+parseInt(_0x9c75e3(0xa0))/0x8;if(_0x1ef2b5===_0x1f73c1)break;else _0x27a6fd['push'](_0x27a6fd['shift']());}catch(_0xf5d3d6){_0x27a6fd['push'](_0x27a6fd['shift']());}}}(a24_0x1b8f,0x3e92f));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':'appcode','type':a24_0x511ea8(0x97),'description':a24_0x511ea8(0xb1)},{'name':a24_0x511ea8(0xcf),'type':a24_0x511ea8(0x97),'description':a24_0x511ea8(0x99)+DEFAULT_CONFIG_VALUES[a24_0x511ea8(0xcf)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a24_0x511ea8(0x90),'description':a24_0x511ea8(0xc0)+PRODUCT_CONFIG[a24_0x511ea8(0x96)]+')\x20instead\x20of\x20project','default':![]},{'name':'yes','type':a24_0x511ea8(0x90),'description':a24_0x511ea8(0xad),'default':![]}];export const initImportFlagDefs=[{'name':a24_0x511ea8(0x9a),'type':'string','description':a24_0x511ea8(0xaa),'required':!![]},{'name':a24_0x511ea8(0xa4),'type':'string','description':a24_0x511ea8(0xcd)},{'name':a24_0x511ea8(0xcf),'type':'string','description':a24_0x511ea8(0xa8),'enum':[...RUNTIME_ENV_VALUES]},{'name':a24_0x511ea8(0xaf),'type':a24_0x511ea8(0x90),'description':a24_0x511ea8(0xc0)+PRODUCT_CONFIG[a24_0x511ea8(0x96)]+')\x20instead\x20of\x20project','default':![]},{'name':'yes','type':a24_0x511ea8(0x90),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x227ad0){const _0x55736b=a24_0x511ea8,_0x13cb53=isNonInteractiveMode(_0x227ad0),_0xadfd44=_0x227ad0[_0x55736b(0xaf)]?_0x55736b(0xaf):_0x55736b(0x9b),_0x532d78=resolveWriteConfigPath(_0xadfd44);try{_0x13cb53?await runNonInteractive(_0x227ad0,_0x532d78):await runInteractive(_0x227ad0,_0x532d78);}catch(_0x64cce9){if(_0x64cce9 instanceof AbortPrompt)throw CliErrors[_0x55736b(0xcb)]();throw _0x64cce9;}}export async function runInitImport(_0x245767){const _0x50ef97=_0x245767['global']?'global':'project',_0x1f7f7b=resolveWriteConfigPath(_0x50ef97);await runFromImport(_0x245767,_0x1f7f7b);}const RUNTIME_IRRELEVANT_KEYS=new Set(['apiDir']);async function runFromImport(_0x7e0522,_0x14d805){const _0x1ad696=a24_0x511ea8,_0x2e0158=resolveFilePath(_0x7e0522['file']);if(!existsSync(_0x2e0158))throw CliErrors['validation'](_0x1ad696(0xab)+_0x2e0158);const _0x373a52=readSourceFile(_0x2e0158),_0x156dc6=convertToRuntimeConfig(_0x373a52);_0x7e0522[_0x1ad696(0xa4)]&&(_0x156dc6[_0x1ad696(0xa4)]=String(_0x7e0522[_0x1ad696(0xa4)]));_0x7e0522['env']&&(_0x156dc6['env']=resolveInitEnv(_0x7e0522));if(!_0x156dc6['appcode'])throw CliErrors[_0x1ad696(0xa3)](_0x1ad696(0xa1),_0x1ad696(0xbf));await writeInitConfig(_0x14d805,_0x156dc6,_0x7e0522),console[_0x1ad696(0xbc)](_0x1ad696(0xba)+_0x2e0158),console[_0x1ad696(0xbc)](_0x1ad696(0xb9)+_0x14d805),console[_0x1ad696(0xbc)](_0x1ad696(0xa9)+_0x156dc6[_0x1ad696(0xa4)]);if(_0x156dc6[_0x1ad696(0xb3)])console[_0x1ad696(0xbc)](_0x1ad696(0xc1)+_0x156dc6[_0x1ad696(0xb3)]);}function convertToRuntimeConfig(_0x4ced27){const _0xabe380=a24_0x511ea8;if(_0x4ced27[_0xabe380(0xc4)]&&typeof _0x4ced27[_0xabe380(0xc4)]==='object')throw CliErrors[_0xabe380(0xa3)](_0xabe380(0xb5),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x1fa1a9={};for(const _0x3ff797 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x4ced27[_0x3ff797]!==undefined&&(_0x1fa1a9[_0x3ff797]=_0x4ced27[_0x3ff797]);}return!_0x1fa1a9[_0xabe380(0xbe)]&&(_0x1fa1a9[_0xabe380(0xbe)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x1fa1a9;}function a24_0x5d49(_0x5316e5,_0x29f29f){_0x5316e5=_0x5316e5-0x8e;const _0x1b8f80=a24_0x1b8f();let _0x5d4988=_0x1b8f80[_0x5316e5];return _0x5d4988;}async function runNonInteractive(_0x5a10d7,_0xa225c6){const _0x5cbb31=a24_0x511ea8,_0x45ade6=_0x5a10d7[_0x5cbb31(0xa4)];if(!_0x45ade6)throw CliErrors[_0x5cbb31(0x9d)](_0x5cbb31(0xa4),'Usage:\x20'+CLI_BIN_NAME+_0x5cbb31(0xb2));const _0x27c1c1=resolveInitEnv(_0x5a10d7);await writeInitConfig(_0xa225c6,{'appcode':_0x45ade6,'env':_0x27c1c1},_0x5a10d7),console[_0x5cbb31(0xbc)](_0x5cbb31(0xbb)+_0xa225c6),console[_0x5cbb31(0xbc)]('\x20\x20appcode:\x20'+_0x45ade6),console[_0x5cbb31(0xbc)](_0x5cbb31(0x91)+_0x27c1c1);}async function runInteractive(_0x23b285,_0x5cbaf7){const _0x4e8c80=a24_0x511ea8,_0x4d47d4=loadExisting(_0x5cbaf7),_0x292d4a=typeof _0x4d47d4?.[_0x4e8c80(0xa4)]===_0x4e8c80(0x97)?_0x4d47d4[_0x4e8c80(0xa4)]:'',_0x2ab360=resolveInitEnv(_0x23b285);console[_0x4e8c80(0xbc)](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG[_0x4e8c80(0x96)]+'\x0a');if(existsSync(_0x5cbaf7)&&!_0x23b285[_0x4e8c80(0x95)]){const _0x3c507c=await promptYesNo(_0x4e8c80(0xc5)+_0x5cbaf7+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x3c507c){console['log'](_0x4e8c80(0xa5));return;}}const _0x55aba1=typeof _0x23b285[_0x4e8c80(0xa4)]===_0x4e8c80(0x97)?_0x23b285['appcode'][_0x4e8c80(0xb6)]():'';let _0x1a0ca8=_0x55aba1;!_0x1a0ca8&&(_0x1a0ca8=await promptInput(_0x4e8c80(0x8f),_0x292d4a));if(!_0x1a0ca8[_0x4e8c80(0xb6)]())throw CliErrors['validation']('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x5cbaf7,{'appcode':_0x1a0ca8[_0x4e8c80(0xb6)](),'env':_0x2ab360},_0x23b285),console['log'](_0x4e8c80(0x98)+_0x5cbaf7),console[_0x4e8c80(0xbc)](_0x4e8c80(0xa9)+_0x1a0ca8[_0x4e8c80(0xb6)]()),console[_0x4e8c80(0xbc)](_0x4e8c80(0x91)+_0x2ab360);}async function writeInitConfig(_0x53c1bb,_0x4d978f,_0x1a8b0b){const _0x137fd5=a24_0x511ea8;let _0x251d59={};existsSync(_0x53c1bb)&&!_0x1a8b0b[_0x137fd5(0x95)]&&(_0x251d59=readConfigFile(_0x53c1bb));for(const [_0x2e5751,_0x31998b]of Object['entries'](_0x4d978f)){_0x31998b!==undefined&&(_0x251d59[_0x2e5751]=_0x31998b);}if(_0x251d59[_0x137fd5(0xcc)])delete _0x251d59[_0x137fd5(0xcc)];writeConfigFile(_0x53c1bb,_0x251d59);}class AbortPrompt extends Error{constructor(){const _0x5eaa24=a24_0x511ea8;super(_0x5eaa24(0xae)),this['name']='AbortPrompt';}}function createSafeRl(){const _0xe8d024=a24_0x511ea8,_0x3c07d4=createInterface({'input':process[_0xe8d024(0xc6)],'output':process['stdout']});let _0x241baf;const _0xeb7f62=new Promise((_0x3dbfe9,_0x1cbe5f)=>{const _0x55d309=_0xe8d024;_0x241baf=()=>{const _0x3623e6=a24_0x5d49;_0x241baf&&(_0x3c07d4[_0x3623e6(0x9f)](_0x3623e6(0xc2),_0x241baf),_0x241baf=undefined);try{_0x3c07d4[_0x3623e6(0x9e)]();}catch{}_0x1cbe5f(new AbortPrompt());},_0x3c07d4[_0x55d309(0x94)](_0x55d309(0xc2),_0x241baf);}),_0x5676f8=()=>{const _0x36aaed=_0xe8d024;_0x241baf&&(_0x3c07d4['removeListener'](_0x36aaed(0xc2),_0x241baf),_0x241baf=undefined);try{_0x3c07d4['close']();}catch{}};return{'rl':_0x3c07d4,'abortPromise':_0xeb7f62,'disposeSuccess':_0x5676f8};}async function promptInput(_0x32a4e0,_0x1fa2a3){const _0x384f6d=a24_0x511ea8,{rl:_0x43ba97,abortPromise:_0x3c883d,disposeSuccess:_0x581f6c}=createSafeRl(),_0x17b648=new Promise(_0x121d20=>{const _0x11ba78=a24_0x5d49,_0x2481ff=_0x1fa2a3?'\x20\x20'+_0x32a4e0+'\x20('+_0x1fa2a3+_0x11ba78(0xb8):'\x20\x20'+_0x32a4e0+':\x20';_0x43ba97[_0x11ba78(0x92)](_0x2481ff,_0x4c48be=>{const _0x53333e=_0x11ba78;_0x581f6c(),_0x121d20(_0x4c48be[_0x53333e(0xb6)]()||_0x1fa2a3);});});return Promise[_0x384f6d(0xa2)]([_0x17b648,_0x3c883d]);}async function promptYesNo(_0x204c9d,_0x2c3a27){const _0x27d163=a24_0x511ea8,{rl:_0x110497,abortPromise:_0x5bd639,disposeSuccess:_0x47ca4a}=createSafeRl(),_0x535f4f=new Promise(_0x2c4ce0=>{const _0xbbf2c1=a24_0x5d49,_0x4ac4f1=_0x2c3a27?_0xbbf2c1(0xc7):_0xbbf2c1(0xc8);_0x110497['question']('\x20\x20'+_0x204c9d+'\x20'+_0x4ac4f1+':\x20',_0x2fe5aa=>{const _0x28233c=_0xbbf2c1;_0x47ca4a();const _0x1b9ba9=_0x2fe5aa[_0x28233c(0xb6)]()[_0x28233c(0xa7)]();if(_0x1b9ba9==='y'||_0x1b9ba9==='yes')_0x2c4ce0(!![]);else{if(_0x1b9ba9==='n'||_0x1b9ba9==='no')_0x2c4ce0(![]);else _0x2c4ce0(_0x2c3a27);}});});return Promise[_0x27d163(0xa2)]([_0x535f4f,_0x5bd639]);}function loadExisting(_0x3c2e1c){if(!existsSync(_0x3c2e1c))return null;return readConfigFile(_0x3c2e1c);}function a24_0x1b8f(){const _0x3cda3f=['message','env','Failed\x20to\x20parse\x20source\x20file:\x20','App\x20code','boolean','\x20\x20env:\x20\x20\x20\x20\x20','question','1244600CAmiEe','once','yes','newConfigFileName','string','\x0aInitialized\x20','Target\x20environment\x20(default\x20','file','project','1084713dNZIHV','flagMissing','close','removeListener','2344680Unngdl','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','race','validation','appcode','Aborted.','2UDuYVf','toLowerCase','Override\x20imported\x20default\x20env','\x20\x20appcode:\x20','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','Source\x20file\x20not\x20found:\x20','utf8','Skip\x20confirmation\x20when\x20overwriting','User\x20aborted\x20prompt','global','577356dfCAyR','App\x20code\x20for\x20the\x20project','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','defaultApp','parse','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','trim','237855dIJpDo','):\x20','\x20\x20config:\x20\x20','Imported\x20from\x20','Initialized\x20','log','includes','riskLevel','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','Write\x20to\x20global\x20(~/','\x20\x20default:\x20','SIGINT','638605BPkscP','apps','File\x20','stdin','[Y/n]','[y/N]','2622193nrNMZq','Invalid\x20env\x20\x22','cancelled','app','Override\x20imported\x20default\x20appcode'];a24_0x1b8f=function(){return _0x3cda3f;};return a24_0x1b8f();}function resolveFilePath(_0x2b92af){return isAbsolute(_0x2b92af)?_0x2b92af:resolve(process['cwd'](),_0x2b92af);}function readSourceFile(_0x56e235){const _0x145cd8=a24_0x511ea8;try{const _0x25c95f=readFileSync(_0x56e235,{'encoding':_0x145cd8(0xac)});return JSON[_0x145cd8(0xb4)](_0x25c95f);}catch(_0x1d8190){throw CliErrors[_0x145cd8(0xa3)](_0x145cd8(0x8e)+_0x1d8190[_0x145cd8(0xce)]);}}function resolveInitEnv(_0x3a8780){const _0x58a1e3=a24_0x511ea8,_0xb0c4d4=_0x3a8780[_0x58a1e3(0xcf)];if(_0xb0c4d4===undefined||_0xb0c4d4==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x58a1e3(0xbd)](_0xb0c4d4))throw CliErrors['validation'](_0x58a1e3(0xca)+_0xb0c4d4+'\x22.\x20Allowed:\x20'+RUNTIME_ENV_VALUES['join'](',\x20'));return _0xb0c4d4;}
|
|
1
|
+
const a24_0x1a7b98=a24_0x18e3;(function(_0x4ffe92,_0x7e279b){const _0x2e06c0=a24_0x18e3,_0x4f9692=_0x4ffe92();while(!![]){try{const _0x332fcb=parseInt(_0x2e06c0(0xe6))/0x1*(-parseInt(_0x2e06c0(0xe3))/0x2)+-parseInt(_0x2e06c0(0xd6))/0x3*(-parseInt(_0x2e06c0(0xb1))/0x4)+parseInt(_0x2e06c0(0xd4))/0x5*(parseInt(_0x2e06c0(0xf2))/0x6)+-parseInt(_0x2e06c0(0xd5))/0x7*(parseInt(_0x2e06c0(0xcb))/0x8)+parseInt(_0x2e06c0(0xc5))/0x9+parseInt(_0x2e06c0(0xc3))/0xa+-parseInt(_0x2e06c0(0xb2))/0xb*(parseInt(_0x2e06c0(0xf5))/0xc);if(_0x332fcb===_0x7e279b)break;else _0x4f9692['push'](_0x4f9692['shift']());}catch(_0x15102d){_0x4f9692['push'](_0x4f9692['shift']());}}}(a24_0x8b0a,0xd5bdc));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';function a24_0x18e3(_0xc6aaae,_0xa4d31e){_0xc6aaae=_0xc6aaae-0xb1;const _0x8b0a7b=a24_0x8b0a();let _0x18e3b9=_0x8b0a7b[_0xc6aaae];return _0x18e3b9;}function a24_0x8b0a(){const _0x499882=['8851000jfDEKQ','App\x20code','3435579IAqHVI','utf8','env','\x20already\x20exists.\x20Overwrite?','parse','Aborted.','1688GTFJVd','Override\x20imported\x20default\x20appcode','\x20init\x20—\x20Create\x20','log','File\x20','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','validation',')\x20instead\x20of\x20project','app','50YjxtlG','36169cIvUVy','19566UGGmrW','Imported\x20from\x20','Usage:\x20','includes','entries','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`.','appcode','apiDir','global','flagMissing','AbortPrompt','close','question','1234RuSSnn','stdin','Skip\x20confirmation\x20when\x20overwriting','2703ROESQz','Write\x20to\x20global\x20(~/','\x0aInitialized\x20','string','User\x20aborted\x20prompt','[y/N]','newConfigFileName','riskLevel','Source\x20file\x20not\x20found:\x20','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','cancelled','\x20\x20appcode:\x20','920022puizaV','yes','Initialized\x20','127596ZnvatW','cwd','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','App\x20code\x20for\x20the\x20project','\x20\x20config:\x20\x20','648dHCLHl','231ngzWbK','apps','\x20\x20env:\x20\x20\x20\x20\x20','race','message','App\x20code\x20cannot\x20be\x20empty.','Invalid\x20env\x20\x22','removeListener','\x22.\x20Allowed:\x20','file','stdout','SIGINT','project','boolean','\x20\x20default:\x20','trim','Failed\x20to\x20parse\x20source\x20file:\x20'];a24_0x8b0a=function(){return _0x499882;};return a24_0x8b0a();}import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':'appcode','type':a24_0x1a7b98(0xe9),'description':a24_0x1a7b98(0xf8)},{'name':a24_0x1a7b98(0xc7),'type':a24_0x1a7b98(0xe9),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES[a24_0x1a7b98(0xc7)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a24_0x1a7b98(0xbf),'description':a24_0x1a7b98(0xe7)+PRODUCT_CONFIG[a24_0x1a7b98(0xec)]+a24_0x1a7b98(0xd2),'default':![]},{'name':a24_0x1a7b98(0xf3),'type':a24_0x1a7b98(0xbf),'description':a24_0x1a7b98(0xe5),'default':![]}];export const initImportFlagDefs=[{'name':a24_0x1a7b98(0xbb),'type':a24_0x1a7b98(0xe9),'description':a24_0x1a7b98(0xd0),'required':!![]},{'name':a24_0x1a7b98(0xdc),'type':'string','description':a24_0x1a7b98(0xcc)},{'name':a24_0x1a7b98(0xc7),'type':a24_0x1a7b98(0xe9),'description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':a24_0x1a7b98(0xde),'type':a24_0x1a7b98(0xbf),'description':a24_0x1a7b98(0xe7)+PRODUCT_CONFIG[a24_0x1a7b98(0xec)]+a24_0x1a7b98(0xd2),'default':![]},{'name':a24_0x1a7b98(0xf3),'type':'boolean','description':a24_0x1a7b98(0xe5),'default':![]}];export async function runInit(_0x1553a6){const _0x5a4c42=a24_0x1a7b98,_0x5650d9=isNonInteractiveMode(_0x1553a6),_0x3cc521=_0x1553a6[_0x5a4c42(0xde)]?_0x5a4c42(0xde):'project',_0x57626e=resolveWriteConfigPath(_0x3cc521);try{_0x5650d9?await runNonInteractive(_0x1553a6,_0x57626e):await runInteractive(_0x1553a6,_0x57626e);}catch(_0x4ac171){if(_0x4ac171 instanceof AbortPrompt)throw CliErrors[_0x5a4c42(0xf0)]();throw _0x4ac171;}}export async function runInitImport(_0x2255ff){const _0x47d540=a24_0x1a7b98,_0x443d20=_0x2255ff[_0x47d540(0xde)]?_0x47d540(0xde):_0x47d540(0xbe),_0x198d4f=resolveWriteConfigPath(_0x443d20);await runFromImport(_0x2255ff,_0x198d4f);}const RUNTIME_IRRELEVANT_KEYS=new Set([a24_0x1a7b98(0xdd)]);async function runFromImport(_0x18db56,_0x8d6e7d){const _0x78d0e4=a24_0x1a7b98,_0x44e229=resolveFilePath(_0x18db56['file']);if(!existsSync(_0x44e229))throw CliErrors[_0x78d0e4(0xd1)](_0x78d0e4(0xee)+_0x44e229);const _0x1016b6=readSourceFile(_0x44e229),_0x2c4af9=convertToRuntimeConfig(_0x1016b6);_0x18db56['appcode']&&(_0x2c4af9['appcode']=String(_0x18db56[_0x78d0e4(0xdc)]));_0x18db56[_0x78d0e4(0xc7)]&&(_0x2c4af9[_0x78d0e4(0xc7)]=resolveInitEnv(_0x18db56));if(!_0x2c4af9['appcode'])throw CliErrors['validation']('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.',_0x78d0e4(0xdb));await writeInitConfig(_0x8d6e7d,_0x2c4af9,_0x18db56),console[_0x78d0e4(0xce)](_0x78d0e4(0xd7)+_0x44e229),console[_0x78d0e4(0xce)](_0x78d0e4(0xf9)+_0x8d6e7d),console[_0x78d0e4(0xce)](_0x78d0e4(0xf1)+_0x2c4af9[_0x78d0e4(0xdc)]);if(_0x2c4af9['defaultApp'])console[_0x78d0e4(0xce)](_0x78d0e4(0xc0)+_0x2c4af9['defaultApp']);}function convertToRuntimeConfig(_0xb9339e){const _0x43014f=a24_0x1a7b98;if(_0xb9339e['apps']&&typeof _0xb9339e[_0x43014f(0xb3)]==='object')throw CliErrors[_0x43014f(0xd1)]('Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.',_0x43014f(0xef));const _0x1b0f25={};for(const _0x217129 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0xb9339e[_0x217129]!==undefined&&(_0x1b0f25[_0x217129]=_0xb9339e[_0x217129]);}return!_0x1b0f25[_0x43014f(0xed)]&&(_0x1b0f25['riskLevel']=DEFAULT_CONFIG_VALUES[_0x43014f(0xed)]),_0x1b0f25;}async function runNonInteractive(_0x53e05d,_0x3516ca){const _0x4cb013=a24_0x1a7b98,_0x9ff943=_0x53e05d[_0x4cb013(0xdc)];if(!_0x9ff943)throw CliErrors[_0x4cb013(0xdf)]('appcode',_0x4cb013(0xd8)+CLI_BIN_NAME+_0x4cb013(0xf7));const _0x3284a4=resolveInitEnv(_0x53e05d);await writeInitConfig(_0x3516ca,{'appcode':_0x9ff943,'env':_0x3284a4},_0x53e05d),console[_0x4cb013(0xce)](_0x4cb013(0xf4)+_0x3516ca),console[_0x4cb013(0xce)]('\x20\x20appcode:\x20'+_0x9ff943),console[_0x4cb013(0xce)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x3284a4);}async function runInteractive(_0x4708ff,_0x393d4d){const _0xbb7e46=a24_0x1a7b98,_0x47341e=loadExisting(_0x393d4d),_0x24f553=typeof _0x47341e?.[_0xbb7e46(0xdc)]==='string'?_0x47341e[_0xbb7e46(0xdc)]:'',_0x1ed720=resolveInitEnv(_0x4708ff);console[_0xbb7e46(0xce)](CLI_BIN_NAME+_0xbb7e46(0xcd)+PRODUCT_CONFIG[_0xbb7e46(0xec)]+'\x0a');if(existsSync(_0x393d4d)&&!_0x4708ff['yes']){const _0x45b4ff=await promptYesNo(_0xbb7e46(0xcf)+_0x393d4d+_0xbb7e46(0xc8),![]);if(!_0x45b4ff){console[_0xbb7e46(0xce)](_0xbb7e46(0xca));return;}}const _0x3f4dc6=typeof _0x4708ff['appcode']===_0xbb7e46(0xe9)?_0x4708ff[_0xbb7e46(0xdc)]['trim']():'';let _0x23740e=_0x3f4dc6;!_0x23740e&&(_0x23740e=await promptInput(_0xbb7e46(0xc4),_0x24f553));if(!_0x23740e[_0xbb7e46(0xc1)]())throw CliErrors[_0xbb7e46(0xd1)](_0xbb7e46(0xb7));await writeInitConfig(_0x393d4d,{'appcode':_0x23740e[_0xbb7e46(0xc1)](),'env':_0x1ed720},_0x4708ff),console[_0xbb7e46(0xce)](_0xbb7e46(0xe8)+_0x393d4d),console[_0xbb7e46(0xce)]('\x20\x20appcode:\x20'+_0x23740e[_0xbb7e46(0xc1)]()),console[_0xbb7e46(0xce)](_0xbb7e46(0xb4)+_0x1ed720);}async function writeInitConfig(_0x45dded,_0x1eb7ac,_0x3b9cd0){const _0x549616=a24_0x1a7b98;let _0x35fbfe={};existsSync(_0x45dded)&&!_0x3b9cd0[_0x549616(0xf3)]&&(_0x35fbfe=readConfigFile(_0x45dded));for(const [_0x5df703,_0x29687a]of Object[_0x549616(0xda)](_0x1eb7ac)){_0x29687a!==undefined&&(_0x35fbfe[_0x5df703]=_0x29687a);}if(_0x35fbfe['app'])delete _0x35fbfe[_0x549616(0xd3)];writeConfigFile(_0x45dded,_0x35fbfe);}class AbortPrompt extends Error{constructor(){const _0x42a45d=a24_0x1a7b98;super(_0x42a45d(0xea)),this['name']=_0x42a45d(0xe0);}}function createSafeRl(){const _0x57f9dd=a24_0x1a7b98,_0x1734f9=createInterface({'input':process[_0x57f9dd(0xe4)],'output':process[_0x57f9dd(0xbc)]});let _0x5e0903;const _0x33880a=new Promise((_0x758112,_0x499512)=>{const _0x534dde=_0x57f9dd;_0x5e0903=()=>{const _0x3a3b5f=a24_0x18e3;_0x5e0903&&(_0x1734f9['removeListener']('SIGINT',_0x5e0903),_0x5e0903=undefined);try{_0x1734f9[_0x3a3b5f(0xe1)]();}catch{}_0x499512(new AbortPrompt());},_0x1734f9['once'](_0x534dde(0xbd),_0x5e0903);}),_0x1c413b=()=>{const _0x54d331=_0x57f9dd;_0x5e0903&&(_0x1734f9[_0x54d331(0xb9)](_0x54d331(0xbd),_0x5e0903),_0x5e0903=undefined);try{_0x1734f9[_0x54d331(0xe1)]();}catch{}};return{'rl':_0x1734f9,'abortPromise':_0x33880a,'disposeSuccess':_0x1c413b};}async function promptInput(_0x5bb998,_0x3c98d5){const _0x5446bb=a24_0x1a7b98,{rl:_0x3587e9,abortPromise:_0x31488f,disposeSuccess:_0x5d13b2}=createSafeRl(),_0x18774e=new Promise(_0x3036b4=>{const _0x58163a=a24_0x18e3,_0x4d17ec=_0x3c98d5?'\x20\x20'+_0x5bb998+'\x20('+_0x3c98d5+'):\x20':'\x20\x20'+_0x5bb998+':\x20';_0x3587e9[_0x58163a(0xe2)](_0x4d17ec,_0x4c91d0=>{const _0x374448=_0x58163a;_0x5d13b2(),_0x3036b4(_0x4c91d0[_0x374448(0xc1)]()||_0x3c98d5);});});return Promise[_0x5446bb(0xb5)]([_0x18774e,_0x31488f]);}async function promptYesNo(_0x2325b9,_0x4c189e){const _0x5eea98=a24_0x1a7b98,{rl:_0x532435,abortPromise:_0x42f3bf,disposeSuccess:_0x4a982d}=createSafeRl(),_0x151bb7=new Promise(_0x1cd493=>{const _0x374acd=a24_0x18e3,_0x52b465=_0x4c189e?'[Y/n]':_0x374acd(0xeb);_0x532435['question']('\x20\x20'+_0x2325b9+'\x20'+_0x52b465+':\x20',_0x512ecf=>{const _0xa426ce=_0x374acd;_0x4a982d();const _0x311b38=_0x512ecf[_0xa426ce(0xc1)]()['toLowerCase']();if(_0x311b38==='y'||_0x311b38==='yes')_0x1cd493(!![]);else{if(_0x311b38==='n'||_0x311b38==='no')_0x1cd493(![]);else _0x1cd493(_0x4c189e);}});});return Promise[_0x5eea98(0xb5)]([_0x151bb7,_0x42f3bf]);}function loadExisting(_0x4a4b14){if(!existsSync(_0x4a4b14))return null;return readConfigFile(_0x4a4b14);}function resolveFilePath(_0x2c92ac){const _0x542b08=a24_0x1a7b98;return isAbsolute(_0x2c92ac)?_0x2c92ac:resolve(process[_0x542b08(0xf6)](),_0x2c92ac);}function readSourceFile(_0x39e249){const _0xc4462e=a24_0x1a7b98;try{const _0xee87d5=readFileSync(_0x39e249,{'encoding':_0xc4462e(0xc6)});return JSON[_0xc4462e(0xc9)](_0xee87d5);}catch(_0x4611b3){throw CliErrors[_0xc4462e(0xd1)](_0xc4462e(0xc2)+_0x4611b3[_0xc4462e(0xb6)]);}}function resolveInitEnv(_0x536753){const _0x1c68e5=a24_0x1a7b98,_0x44afa9=_0x536753[_0x1c68e5(0xc7)];if(_0x44afa9===undefined||_0x44afa9==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x1c68e5(0xd9)](_0x44afa9))throw CliErrors[_0x1c68e5(0xd1)](_0x1c68e5(0xb8)+_0x44afa9+_0x1c68e5(0xba)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x44afa9;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x57bc96=a25_0x92ab;(function(_0x18a233,_0x2167b4){const _0x2bb2b5=a25_0x92ab,_0x59129f=_0x18a233();while(!![]){try{const _0x5b9a9f=parseInt(_0x2bb2b5(0x11b))/0x1+parseInt(_0x2bb2b5(0x108))/0x2+parseInt(_0x2bb2b5(0x114))/0x3*(parseInt(_0x2bb2b5(0xe9))/0x4)+parseInt(_0x2bb2b5(0x119))/0x5*(parseInt(_0x2bb2b5(0xee))/0x6)+parseInt(_0x2bb2b5(0x113))/0x7+parseInt(_0x2bb2b5(0xe7))/0x8*(-parseInt(_0x2bb2b5(0xfb))/0x9)+parseInt(_0x2bb2b5(0x106))/0xa*(-parseInt(_0x2bb2b5(0xe6))/0xb);if(_0x5b9a9f===_0x2167b4)break;else _0x59129f['push'](_0x59129f['shift']());}catch(_0x4f39f2){_0x59129f['push'](_0x59129f['shift']());}}}(a25_0x386d,0xb328d));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';function a25_0x92ab(_0x2f6eef,_0x5a6802){_0x2f6eef=_0x2f6eef-0xdc;const _0x386db4=a25_0x386d();let _0x92abe0=_0x386db4[_0x2f6eef];return _0x92abe0;}import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a25_0x386d(){const _0x4953c2=['file','scope','--topk\x20must\x20be\x20a\x20positive\x20number.','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','File\x20is\x20not\x20a\x20regular\x20file:\x20','ragStatus','length','flag','build','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','/client/knowledge-base/personal/create','333ikDNvB','ragErrorMessage','title','appCode','validation','content','createTime','search','map','trim','write','139330WYYdlQ','utf8','2887284tjypiN','docId','description','query','bool','version','create','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','isFile','Personal\x20knowledge-base\x20entry\x20title','read','5014905lZLANJ','354CHeWxH','topk','Personal\x20knowledge-base\x20entry\x20ID','detail','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','20IjTFff','string','701580fwyUoo','/update','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','metadata','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','update','Updated\x20KB\x20entry\x20','File\x20path\x20is\x20required.','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','str','POST','userId','1749kFIjLU','113480CaUJJY','num','13432dsMFYL','updateTime','weightedScore','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','body','324222pszyqp','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app'];a25_0x386d=function(){return _0x4953c2;};return a25_0x386d();}const TITLE_FLAG={'name':a25_0x57bc96(0xfd),'type':a25_0x57bc96(0x11a),'required':!![],'description':a25_0x57bc96(0x111)},FILE_FLAG={'name':'file','type':a25_0x57bc96(0x11a),'required':!![],'description':a25_0x57bc96(0xdc)},QUERY_FLAG={'name':a25_0x57bc96(0x10b),'type':a25_0x57bc96(0x11a),'required':!![],'description':a25_0x57bc96(0xec)},TOPK_FLAG={'name':a25_0x57bc96(0x115),'type':'number','description':a25_0x57bc96(0xf9)};function readKnowledgeFile(_0x226ca8){const _0x332812=a25_0x57bc96;if(!_0x226ca8)throw CliErrors['validation'](_0x332812(0xe1));if(!existsSync(_0x226ca8))throw CliErrors['validation']('File\x20not\x20found:\x20'+_0x226ca8);if(!statSync(_0x226ca8)[_0x332812(0x110)]())throw CliErrors[_0x332812(0xff)](_0x332812(0xf4)+_0x226ca8);return readFileSync(_0x226ca8,_0x332812(0x107));}function summarizePersonalItem(_0x3a8c4b){const _0x4b36c3=a25_0x57bc96;return{'id':_0x3a8c4b['id'],'title':_0x3a8c4b[_0x4b36c3(0xfd)],'version':_0x3a8c4b[_0x4b36c3(0x10d)],'ragStatus':_0x3a8c4b['ragStatus'],'ragErrorMessage':_0x3a8c4b[_0x4b36c3(0xfc)],'updateTime':_0x3a8c4b[_0x4b36c3(0xea)]};}function detailPersonalItem(_0x500998){const _0x4abb10=a25_0x57bc96;return{'id':_0x500998['id'],'appCode':_0x500998[_0x4abb10(0xfe)],'scope':_0x500998[_0x4abb10(0xf1)],'userId':_0x500998[_0x4abb10(0xe5)],'title':_0x500998['title'],'content':_0x500998[_0x4abb10(0x100)]??'','version':_0x500998[_0x4abb10(0x10d)],'ragStatus':_0x500998[_0x4abb10(0xf5)],'ragErrorMessage':_0x500998['ragErrorMessage'],'createTime':_0x500998[_0x4abb10(0x101)],'updateTime':_0x500998['updateTime']};}function summarizeSearchHit(_0x2b4c95){const _0x1b208c=a25_0x57bc96;return{'scope':_0x2b4c95[_0x1b208c(0xf1)],'docId':_0x2b4c95[_0x1b208c(0x109)],'score':_0x2b4c95['score'],'weightedScore':_0x2b4c95[_0x1b208c(0xeb)],'content':_0x2b4c95[_0x1b208c(0x100)],'metadata':_0x2b4c95[_0x1b208c(0xdd)]};}function readTopK(_0x43c0ca){const _0x2923c4=a25_0x57bc96,_0x3a2424=_0x43c0ca[_0x2923c4(0xf7)](_0x2923c4(0x115));if(_0x3a2424===undefined||_0x3a2424===null||_0x3a2424==='')return undefined;const _0xa0b1c=_0x43c0ca['num'](_0x2923c4(0x115));if(!Number['isFinite'](_0xa0b1c)||_0xa0b1c<0x1)throw CliErrors[_0x2923c4(0xff)](_0x2923c4(0xf2));return _0xa0b1c;}const kbList={'service':'kb','command':'list','description':a25_0x57bc96(0xef),'risk':a25_0x57bc96(0x112),'flags':[VERBOSE_FLAG],async 'execute'(_0x31fa49){const _0x166b2b=a25_0x57bc96,_0xb191a9=await listPersonalKnowledgeBaseItems(_0x31fa49['appCode']);if(_0x31fa49[_0x166b2b(0x10c)]('verbose'))return{'ok':!![],'data':{'total':_0xb191a9[_0x166b2b(0xf6)],'items':_0xb191a9}};return{'ok':!![],'data':{'total':_0xb191a9[_0x166b2b(0xf6)],'items':_0xb191a9[_0x166b2b(0x103)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a25_0x57bc96(0x117),'description':a25_0x57bc96(0xe2),'risk':a25_0x57bc96(0x112),'flags':[{...ID_FLAG,'description':a25_0x57bc96(0x116)}],async 'execute'(_0x5795c8){const _0x1c8a92=a25_0x57bc96,_0x408076=await getPersonalKnowledgeBaseItem(_0x5795c8['num']('id'),_0x5795c8[_0x1c8a92(0xfe)]);return{'ok':!![],'data':detailPersonalItem(_0x408076)};}},kbCreate={'service':'kb','command':a25_0x57bc96(0x10e),'description':a25_0x57bc96(0xde),'risk':a25_0x57bc96(0x105),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x456f18){const _0xf03ef6=a25_0x57bc96,_0x4c87e2=_0x456f18['str']('title'),_0x5f3868=readKnowledgeFile(_0x456f18[_0xf03ef6(0xe3)](_0xf03ef6(0xf0))),_0x229bb5=await createPersonalKnowledgeBaseItem(_0x456f18[_0xf03ef6(0xfe)],{'title':_0x4c87e2,'content':_0x5f3868});return{'ok':!![],'data':summarizePersonalItem(_0x229bb5),'message':'Created\x20KB\x20entry\x20'+_0x229bb5['id']+'\x20('+_0x229bb5[_0xf03ef6(0xfd)]+')'};},async 'dryRun'(_0x525aa0){const _0x3aa55f=a25_0x57bc96,_0x314e2a=_0x525aa0[_0x3aa55f(0xe3)]('title'),_0x2a7c92=readKnowledgeFile(_0x525aa0[_0x3aa55f(0xe3)]('file'));return dryRun(_0x3aa55f(0xe4),_0x3aa55f(0xfa))[_0x3aa55f(0xed)]({'appCode':_0x525aa0[_0x3aa55f(0xfe)],'title':_0x314e2a,'content':_0x2a7c92})[_0x3aa55f(0x10a)](_0x3aa55f(0x10f)+_0x314e2a+'\x22')[_0x3aa55f(0xf8)]();}},kbUpdate={'service':'kb','command':a25_0x57bc96(0xdf),'description':a25_0x57bc96(0x118),'risk':a25_0x57bc96(0x105),'flags':[{...ID_FLAG,'description':'Personal\x20knowledge-base\x20entry\x20ID'},{...TITLE_FLAG,'required':![],'description':'Override\x20the\x20existing\x20entry\x20title'},FILE_FLAG],async 'execute'(_0x477af8){const _0xe1a185=a25_0x57bc96,_0x2fcccd=_0x477af8[_0xe1a185(0xe8)]('id'),_0x59f821=readKnowledgeFile(_0x477af8[_0xe1a185(0xe3)](_0xe1a185(0xf0))),_0x51116d=_0x477af8['str']('title')||(await getPersonalKnowledgeBaseItem(_0x2fcccd,_0x477af8[_0xe1a185(0xfe)]))[_0xe1a185(0xfd)],_0x210dc0=await updatePersonalKnowledgeBaseItem(_0x2fcccd,_0x477af8['appCode'],{'title':_0x51116d,'content':_0x59f821});return{'ok':!![],'data':summarizePersonalItem(_0x210dc0),'message':_0xe1a185(0xe0)+_0x210dc0['id']+'\x20('+_0x210dc0['title']+')'};},async 'dryRun'(_0x56c90b){const _0x503c9e=a25_0x57bc96,_0x390932=_0x56c90b[_0x503c9e(0xe8)]('id'),_0x3a3c65=readKnowledgeFile(_0x56c90b[_0x503c9e(0xe3)](_0x503c9e(0xf0))),_0x4b2fce=_0x56c90b[_0x503c9e(0xe3)]('title')||(await getPersonalKnowledgeBaseItem(_0x390932,_0x56c90b[_0x503c9e(0xfe)]))[_0x503c9e(0xfd)];return dryRun('POST','/client/knowledge-base/personal/'+_0x390932+_0x503c9e(0x11c))[_0x503c9e(0xed)]({'appCode':_0x56c90b['appCode'],'title':_0x4b2fce,'content':_0x3a3c65})[_0x503c9e(0x10a)](_0x503c9e(0xf3)+_0x390932)['build']();}},kbSearch={'service':'kb','command':a25_0x57bc96(0x102),'description':'Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','risk':'read','flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x4dcd55){const _0x3a9ba3=a25_0x57bc96;if(!_0x4dcd55[_0x3a9ba3(0xe3)](_0x3a9ba3(0x10b))[_0x3a9ba3(0x104)]())throw CliErrors[_0x3a9ba3(0xff)]('Search\x20query\x20is\x20required.');readTopK(_0x4dcd55);},async 'execute'(_0x5383ba){const _0x521c86=a25_0x57bc96,_0x46ee9c=_0x5383ba[_0x521c86(0xe3)](_0x521c86(0x10b))['trim'](),_0x34da07=readTopK(_0x5383ba),_0xbb76fb=await searchKnowledgeBase(_0x5383ba[_0x521c86(0xfe)],{'query':_0x46ee9c,'topK':_0x34da07});return{'ok':!![],'data':{'total':_0xbb76fb[_0x521c86(0xf6)],'hits':_0xbb76fb['map'](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a26_0x2f3d09=a26_0xd23c;(function(_0x2888fa,_0x5aa577){const _0x19873d=a26_0xd23c,_0x58f14a=_0x2888fa();while(!![]){try{const _0x340b87=-parseInt(_0x19873d(0x171))/0x1+parseInt(_0x19873d(0x179))/0x2+parseInt(_0x19873d(0x187))/0x3+-parseInt(_0x19873d(0x17c))/0x4+parseInt(_0x19873d(0x17f))/0x5*(parseInt(_0x19873d(0x188))/0x6)+parseInt(_0x19873d(0x194))/0x7*(parseInt(_0x19873d(0x175))/0x8)+-parseInt(_0x19873d(0x189))/0x9;if(_0x340b87===_0x5aa577)break;else _0x58f14a['push'](_0x58f14a['shift']());}catch(_0x1a5083){_0x58f14a['push'](_0x58f14a['shift']());}}}(a26_0x1e5f,0xcc9ec));function a26_0x1e5f(){const _0x48d321=['Clear\x20command\x20history\x20logs','11576hGHtvb','\x20logs:\x0a','\x20\x20\x20Duration:\x20','error','1168932wOIkCo','show','*\x20No\x20logs\x20found','3637944PHqOUd','clearLogs','logs','15AMzKMz','keys','*\x20Logs\x20cleared','read','readLogs','\x20\x20\x20Details:\x20','duration','level','3603768DOqgAu','1736364vZFcAG','3651831qXeOVe','message','\x20\x20\x20Time:\x20','timestamp','View\x20command\x20history\x20logs','toLocaleString','clear','stringify','en-US','write','length','70zCZhiz','log','515005LjMBPf','success','details'];a26_0x1e5f=function(){return _0x48d321;};return a26_0x1e5f();}function a26_0xd23c(_0xc8cbba,_0x1cb5fc){_0xc8cbba=_0xc8cbba-0x170;const _0x1e5fff=a26_0x1e5f();let _0xd23cab=_0x1e5fff[_0xc8cbba];return _0xd23cab;}import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x275117){const _0x47683a=a26_0xd23c;if(_0x275117[_0x47683a(0x193)]===0x0){console['log'](_0x47683a(0x17b));return;}console[_0x47683a(0x170)]('*\x20'+CLI_DISPLAY_NAME+_0x47683a(0x176)),_0x275117['forEach']((_0x59ae03,_0x4f5371)=>{const _0x10fa10=_0x47683a,_0x51eabf=new Date(_0x59ae03[_0x10fa10(0x18c)])[_0x10fa10(0x18e)](_0x10fa10(0x191)),_0x46e063=_0x59ae03[_0x10fa10(0x186)]===_0x10fa10(0x172)?'√':_0x59ae03[_0x10fa10(0x186)]===_0x10fa10(0x178)?'×':_0x59ae03[_0x10fa10(0x186)]==='warn'?'!':'i';console['log'](_0x4f5371+0x1+'.\x20'+_0x46e063+'\x20['+_0x59ae03['command']+']\x20'+_0x59ae03[_0x10fa10(0x18a)]),console[_0x10fa10(0x170)](_0x10fa10(0x18b)+_0x51eabf),_0x59ae03[_0x10fa10(0x185)]&&console[_0x10fa10(0x170)](_0x10fa10(0x177)+_0x59ae03[_0x10fa10(0x185)]+'ms'),_0x59ae03[_0x10fa10(0x173)]&&Object[_0x10fa10(0x180)](_0x59ae03[_0x10fa10(0x173)])[_0x10fa10(0x193)]>0x0&&console[_0x10fa10(0x170)](_0x10fa10(0x184)+JSON[_0x10fa10(0x190)](_0x59ae03[_0x10fa10(0x173)],null,0x2)),console['log']('');});}export const logsDefinitions=[{'service':a26_0x2f3d09(0x17e),'command':a26_0x2f3d09(0x17a),'description':a26_0x2f3d09(0x18d),'risk':a26_0x2f3d09(0x182),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x4f8a5b){const _0x5e5557=a26_0x2f3d09;return printLogs(logger[_0x5e5557(0x183)]()),{'ok':!![]};}},{'service':'logs','command':a26_0x2f3d09(0x18f),'description':a26_0x2f3d09(0x174),'risk':a26_0x2f3d09(0x192),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x2a7244){const _0x7645da=a26_0x2f3d09;return logger[_0x7645da(0x17d)](),console[_0x7645da(0x170)](_0x7645da(0x181)),{'ok':!![]};}}];
|