@lovrabet/lovrabet-cli 2.0.13-beta.6 → 2.0.13-beta.7
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/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/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_0x51a249=a15_0x49b6;(function(_0x4a9740,_0x355d6e){const _0x5c0efa=a15_0x49b6,_0x3e79fb=_0x4a9740();while(!![]){try{const _0x32dadd=parseInt(_0x5c0efa(0x130))/0x1*(parseInt(_0x5c0efa(0x135))/0x2)+-parseInt(_0x5c0efa(0x13e))/0x3*(-parseInt(_0x5c0efa(0x13c))/0x4)+-parseInt(_0x5c0efa(0x13d))/0x5+parseInt(_0x5c0efa(0x139))/0x6*(-parseInt(_0x5c0efa(0x134))/0x7)+-parseInt(_0x5c0efa(0x143))/0x8+parseInt(_0x5c0efa(0x13f))/0x9*(parseInt(_0x5c0efa(0x132))/0xa)+parseInt(_0x5c0efa(0x12f))/0xb;if(_0x32dadd===_0x355d6e)break;else _0x3e79fb['push'](_0x3e79fb['shift']());}catch(_0x4f1cce){_0x3e79fb['push'](_0x3e79fb['shift']());}}}(a15_0x3d89,0xca963));function a15_0x3d89(){const _0x4b9550=['Resource\x20ID','318880uUpmZJ','name','658707VTVNjW','14VHuMKj','Resource\x20name\x20for\x20lookup','number','Return\x20full\x20raw\x20response\x20object','102LPpGzm','string','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','17716NJIfHg','7195165CzNFdE','831zkcadb','207tpxwwR','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','sqlcode','boolean','8312992uGUWmt','verbose','Dataset\x20code\x20(32-char\x20hex\x20UUID)','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','27078117hjLtqw','69395ASdjdS'];a15_0x3d89=function(){return _0x4b9550;};return a15_0x3d89();}export const CODE_FLAG={'name':'code','type':a15_0x51a249(0x13a),'required':!![],'description':a15_0x51a249(0x145),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':'a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)'}};function a15_0x49b6(_0x34266b,_0x16fa7d){_0x34266b=_0x34266b-0x12e;const _0x3d8972=a15_0x3d89();let _0x49b6d9=_0x3d8972[_0x34266b];return _0x49b6d9;}export const SQLCODE_FLAG={'name':a15_0x51a249(0x141),'type':a15_0x51a249(0x13a),'required':!![],'description':a15_0x51a249(0x12e),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a15_0x51a249(0x13b)}};export const VERBOSE_FLAG={'name':a15_0x51a249(0x144),'type':a15_0x51a249(0x142),'description':a15_0x51a249(0x138)};export const PARAMS_FLAG={'name':'params','type':a15_0x51a249(0x13a),'description':a15_0x51a249(0x140)};export const NAME_FLAG={'name':a15_0x51a249(0x133),'type':a15_0x51a249(0x13a),'description':a15_0x51a249(0x136)};export const ID_FLAG={'name':'id','type':a15_0x51a249(0x137),'required':!![],'description':a15_0x51a249(0x131)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a16_0x1017ff=a16_0x1bf3;(function(_0x11d4ab,_0xf991c2){const _0x11913c=a16_0x1bf3,_0x58914e=_0x11d4ab();while(!![]){try{const _0xd16a5e=-parseInt(_0x11913c(0x124))/0x1+parseInt(_0x11913c(0x140))/0x2*(-parseInt(_0x11913c(0x126))/0x3)+-parseInt(_0x11913c(0x14d))/0x4*(-parseInt(_0x11913c(0x11d))/0x5)+parseInt(_0x11913c(0x11e))/0x6*(-parseInt(_0x11913c(0x158))/0x7)+parseInt(_0x11913c(0x11b))/0x8+-parseInt(_0x11913c(0x122))/0x9*(parseInt(_0x11913c(0x153))/0xa)+parseInt(_0x11913c(0x146))/0xb*(parseInt(_0x11913c(0x13b))/0xc);if(_0xd16a5e===_0xf991c2)break;else _0x58914e['push'](_0x58914e['shift']());}catch(_0x43628b){_0x58914e['push'](_0x58914e['shift']());}}}(a16_0x3bdb,0xbd6aa));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';function a16_0x3bdb(){const _0x56de62=['field','38504TSQckt','`\x20=\x20\x22','\x20config\x20set\x20<key>\x20<value>\x20[--global]','object','key','delete','15180860DKLWaK','Get\x20a\x20config\x20value','join','Key\x20not\x20found:\x20','split','7bxnmKm','alias','appcode','riskLevel','pageSize\x20must\x20be\x20a\x20positive\x20number','log','Value\x20to\x20assign','bool','pretty','isArray','1462504bfgGGx','list','175WHoutI','3216354iNYSSA','Settable\x20keys:\x20','Top-level\x20key\x20\x22','pageSize','9OLIkMl','List\x20current\x20config','1085854FOtXFV','\x20\x20global:\x20\x20','3ZqKFYC','Deleted\x20`','\x20\x20project:\x20','project-or-global-explicit','set','trim','stringify','boolean','includes','global','read','\x20(global)','Usage:\x20','keys','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','config','Missing\x20key\x20argument.','Key\x20\x22','value','Missing\x20key\x20or\x20value.','\x22.\x20Allowed:\x20','28788cKXOQo','length','Delete\x20a\x20config\x20value','../../context.js','apps','601466wWpboN','write','args','(none)','Config\x20files:\x0a','\x20config\x20get\x20<key>','16951uEGheI','get','Set\x20a\x20config\x20value','\x20config\x20delete\x20<key>\x20[--global]','raw','validation'];a16_0x3bdb=function(){return _0x56de62;};return a16_0x3bdb();}import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';function a16_0x1bf3(_0x5c5815,_0x49c69b){_0x5c5815=_0x5c5815-0x11a;const _0x3bdb97=a16_0x3bdb();let _0x1bf319=_0x3bdb97[_0x5c5815];return _0x1bf319;}const GLOBAL_FLAG={'name':'global','type':a16_0x1017ff(0x12d),'description':'Write\x20to\x20global\x20config','default':![]};function parseAliasAppcodeSetKey(_0x4a774b){const _0x52f2c5=a16_0x1017ff,_0x1d6cfb=_0x4a774b[_0x52f2c5(0x157)]('.');if(_0x1d6cfb['length']!==0x3||_0x1d6cfb[0x0]!==_0x52f2c5(0x13f)||_0x1d6cfb[0x2]!==_0x52f2c5(0x15a))return undefined;const _0x1765f0=_0x1d6cfb[0x1]?.[_0x52f2c5(0x12b)]();return _0x1765f0?_0x1765f0:undefined;}function parseAliasDeleteKey(_0x25e0ec){const _0x47d3cf=a16_0x1017ff,_0x45da56=_0x25e0ec[_0x47d3cf(0x157)]('.');if(_0x45da56[_0x47d3cf(0x13c)]===0x2&&_0x45da56[0x0]===_0x47d3cf(0x13f)){const _0x36676f=_0x45da56[0x1]?.['trim']();return _0x36676f?{'alias':_0x36676f}:undefined;}if(_0x45da56[_0x47d3cf(0x13c)]===0x3&&_0x45da56[0x0]===_0x47d3cf(0x13f)&&_0x45da56[0x2]===_0x47d3cf(0x15a)){const _0xa7a023=_0x45da56[0x1]?.[_0x47d3cf(0x12b)]();return _0xa7a023?{'alias':_0xa7a023,'field':_0x47d3cf(0x15a)}:undefined;}return undefined;}function setLocalAppAlias(_0x3e390f,_0xcefe9a,_0x4d40a0){const _0x11174b=a16_0x1017ff,_0xa5536b=_0x3e390f['apps']&&typeof _0x3e390f[_0x11174b(0x13f)]==='object'&&!Array[_0x11174b(0x11a)](_0x3e390f['apps'])?_0x3e390f[_0x11174b(0x13f)]:{},_0x29ba47=_0xa5536b[_0xcefe9a]&&typeof _0xa5536b[_0xcefe9a]==='object'&&!Array['isArray'](_0xa5536b[_0xcefe9a])?_0xa5536b[_0xcefe9a]:{};_0x29ba47[_0x11174b(0x15a)]=_0x4d40a0,_0xa5536b[_0xcefe9a]=_0x29ba47,_0x3e390f[_0x11174b(0x13f)]=_0xa5536b;}function deleteLocalAppAlias(_0x512279,_0x4e70ec){const _0x177702=a16_0x1017ff;if(!_0x512279['apps']||typeof _0x512279['apps']!==_0x177702(0x150)||Array[_0x177702(0x11a)](_0x512279[_0x177702(0x13f)]))return![];const _0x2bbeb3=_0x512279[_0x177702(0x13f)],_0x5af76e=_0x2bbeb3[_0x4e70ec['alias']];if(!_0x5af76e||typeof _0x5af76e!==_0x177702(0x150)||Array[_0x177702(0x11a)](_0x5af76e))return![];if(!_0x4e70ec[_0x177702(0x14c)])return delete _0x2bbeb3[_0x4e70ec[_0x177702(0x159)]],!![];if(!(_0x4e70ec[_0x177702(0x14c)]in _0x5af76e))return![];return delete _0x5af76e[_0x4e70ec['field']],Object[_0x177702(0x133)](_0x5af76e)[_0x177702(0x13c)]===0x0&&delete _0x2bbeb3[_0x4e70ec[_0x177702(0x159)]],!![];}const listDef={'service':a16_0x1017ff(0x135),'command':a16_0x1017ff(0x11c),'description':a16_0x1017ff(0x123),'risk':a16_0x1017ff(0x130),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x4cfd20){const _0x2a2734=a16_0x1017ff,{buildConfigFromFlags:_0x56f6b9}=await import(_0x2a2734(0x13e)),_0x2c34f5=_0x56f6b9({}),_0x38aee1=getProjectConfigPath(),_0x4d2e3a=resolveWriteConfigPath(_0x2a2734(0x12f));if(_0x4cfd20['format']===_0x2a2734(0x160))return{'ok':!![],'message':'#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a'+(JSON[_0x2a2734(0x12c)](_0x2c34f5[_0x2a2734(0x14a)],null,0x2)+'\x0a\x0a')+_0x2a2734(0x144)+(_0x2a2734(0x128)+(_0x38aee1??_0x2a2734(0x143))+'\x0a')+(_0x2a2734(0x125)+_0x4d2e3a)};return{'ok':!![],'data':{'effective':_0x2c34f5[_0x2a2734(0x14a)],'configFiles':{'project':_0x38aee1??null,'global':_0x4d2e3a}}};}},getDef={'service':a16_0x1017ff(0x135),'command':a16_0x1017ff(0x147),'description':a16_0x1017ff(0x154),'risk':a16_0x1017ff(0x130),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x1017ff(0x151),'description':'Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','required':!![]}],'flags':[],async 'execute'(_0x6aef4b){const _0x30eb6a=a16_0x1017ff,_0x5045b4=_0x6aef4b[_0x30eb6a(0x142)][0x0];if(!_0x5045b4)throw CliErrors[_0x30eb6a(0x14b)]('Missing\x20key\x20argument.',_0x30eb6a(0x132)+CLI_BIN_NAME+_0x30eb6a(0x145));const {buildConfigFromFlags:_0x3f35ed}=await import(_0x30eb6a(0x13e)),{raw:_0x16f336}=_0x3f35ed({});if(_0x5045b4[_0x30eb6a(0x12e)]('.')){const _0x5c2acf=_0x5045b4[_0x30eb6a(0x157)]('.');let _0x59d5cc=_0x16f336;for(const _0x39d347 of _0x5c2acf){if(_0x59d5cc==null||typeof _0x59d5cc!==_0x30eb6a(0x150))throw CliErrors[_0x30eb6a(0x14b)]('Key\x20not\x20found:\x20'+_0x5045b4);_0x59d5cc=_0x59d5cc[_0x39d347];}if(_0x59d5cc===undefined)throw CliErrors['validation'](_0x30eb6a(0x156)+_0x5045b4);return console[_0x30eb6a(0x15d)](typeof _0x59d5cc===_0x30eb6a(0x150)?JSON[_0x30eb6a(0x12c)](_0x59d5cc,null,0x2):String(_0x59d5cc)),{'ok':!![]};}const _0x2a9861=_0x16f336[_0x5045b4];if(_0x2a9861===undefined)throw CliErrors[_0x30eb6a(0x14b)](_0x30eb6a(0x156)+_0x5045b4);return console[_0x30eb6a(0x15d)](typeof _0x2a9861===_0x30eb6a(0x150)?JSON['stringify'](_0x2a9861,null,0x2):String(_0x2a9861)),{'ok':!![]};}},setDef={'service':a16_0x1017ff(0x135),'command':a16_0x1017ff(0x12a),'description':a16_0x1017ff(0x148),'risk':a16_0x1017ff(0x141),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]},{'name':a16_0x1017ff(0x138),'description':a16_0x1017ff(0x15e),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x16c21e){const _0xf86919=a16_0x1017ff,_0x423b3f=_0x16c21e[_0xf86919(0x142)][0x0],_0x372bec=_0x16c21e[_0xf86919(0x142)][0x1];if(!_0x423b3f||_0x372bec===undefined)throw CliErrors[_0xf86919(0x14b)](_0xf86919(0x139),_0xf86919(0x132)+CLI_BIN_NAME+_0xf86919(0x14f));if(ENUM_KEYS[_0x423b3f]&&!ENUM_KEYS[_0x423b3f]['includes'](_0x372bec))throw CliErrors[_0xf86919(0x14b)]('Invalid\x20value\x20for\x20\x22'+_0x423b3f+_0xf86919(0x13a)+ENUM_KEYS[_0x423b3f][_0xf86919(0x155)](',\x20'));if(_0x423b3f===_0xf86919(0x15b))throw CliErrors[_0xf86919(0x14b)](_0xf86919(0x134));if(_0x423b3f===_0xf86919(0x121)){const _0x2e8b34=Number(_0x372bec);if(isNaN(_0x2e8b34)||_0x2e8b34<=0x0)throw CliErrors[_0xf86919(0x14b)](_0xf86919(0x15c));}const _0x2e2b83=resolveWriteScope({'explicitGlobal':_0x16c21e[_0xf86919(0x15f)](_0xf86919(0x12f)),'policy':_0xf86919(0x129)}),_0x3c0939=toScopeFlags(_0x2e2b83),_0x5b1142=readScopedConfig(_0x3c0939),_0x38f83a=parseAliasAppcodeSetKey(_0x423b3f);if(!_0x38f83a&&!isTopLevelConfigKey(_0x423b3f))throw CliErrors['validation'](_0xf86919(0x120)+_0x423b3f+'\x22\x20is\x20not\x20settable.',_0xf86919(0x11f)+getTopLevelConfigKeySummary()+';\x20apps.<alias>.appcode');return _0x38f83a?setLocalAppAlias(_0x5b1142,_0x38f83a,_0x372bec):_0x5b1142[_0x423b3f]=_0x423b3f===_0xf86919(0x121)?Number(_0x372bec):_0x372bec,console[_0xf86919(0x15d)]('Set\x20`'+_0x423b3f+_0xf86919(0x14e)+_0x372bec+'\x22'+(_0x2e2b83===_0xf86919(0x12f)?_0xf86919(0x131):'')),writeScopedConfig(_0x5b1142,_0x3c0939),{'ok':!![]};}},deleteDef={'service':a16_0x1017ff(0x135),'command':a16_0x1017ff(0x152),'description':a16_0x1017ff(0x13d),'risk':a16_0x1017ff(0x141),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0xfdfe2a){const _0x2318ea=a16_0x1017ff,_0x15161f=_0xfdfe2a['args'][0x0];if(!_0x15161f)throw CliErrors[_0x2318ea(0x14b)](_0x2318ea(0x136),_0x2318ea(0x132)+CLI_BIN_NAME+_0x2318ea(0x149));const _0x239109=resolveWriteScope({'explicitGlobal':_0xfdfe2a['bool'](_0x2318ea(0x12f)),'policy':_0x2318ea(0x129)}),_0x508796=toScopeFlags(_0x239109),_0x2089cb=readScopedConfig(_0x508796),_0x376013=parseAliasDeleteKey(_0x15161f);if(_0x376013){if(!deleteLocalAppAlias(_0x2089cb,_0x376013))throw CliErrors[_0x2318ea(0x14b)](_0x2318ea(0x156)+_0x15161f);return console['log'](_0x2318ea(0x127)+_0x15161f+'`'+(_0x239109===_0x2318ea(0x12f)?_0x2318ea(0x131):'')),writeScopedConfig(_0x2089cb,_0x508796),{'ok':!![]};}if(_0x2089cb[_0x15161f]===undefined)throw CliErrors[_0x2318ea(0x14b)](_0x2318ea(0x137)+_0x15161f+'\x22\x20not\x20found\x20at\x20top\x20level.');return delete _0x2089cb[_0x15161f],console[_0x2318ea(0x15d)](_0x2318ea(0x127)+_0x15161f+'`'+(_0x239109===_0x2318ea(0x12f)?_0x2318ea(0x131):'')),writeScopedConfig(_0x2089cb,_0x508796),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
1
|
+
const a16_0x11aa2a=a16_0xa693;function a16_0xe5b2(){const _0x2c8250=['Invalid\x20value\x20for\x20\x22','pageSize\x20must\x20be\x20a\x20positive\x20number','Delete\x20a\x20config\x20value','join','pageSize',';\x20apps.<alias>.appcode','key','format','477982NAfTWf','Config\x20files:\x0a','`\x20=\x20\x22','trim','args','apps','4566552jBMhnl','2310jOjPWR','field','set','\x20(global)','project-or-global-explicit','list','stringify','Set\x20a\x20config\x20value','\x20config\x20set\x20<key>\x20<value>\x20[--global]','length','object','config','Deleted\x20`','pretty','delete','(none)','81fryNbS','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','split','validation','321636ErKCuG','alias','4368331qGFEiv','Set\x20`','Value\x20to\x20assign','isArray','Missing\x20key\x20argument.','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','\x20\x20global:\x20\x20','32huFhby','raw','557385Soaakh','Usage:\x20','\x22\x20not\x20found\x20at\x20top\x20level.','Key\x20not\x20found:\x20','get','1FCPtPT','Missing\x20key\x20or\x20value.','bool','value','14266NyodMx','Get\x20a\x20config\x20value','write','appcode','boolean','read','Settable\x20keys:\x20','\x20config\x20get\x20<key>','Top-level\x20key\x20\x22','global','Key\x20\x22','log','994090mkCVuR'];a16_0xe5b2=function(){return _0x2c8250;};return a16_0xe5b2();}(function(_0x3827e4,_0x1f1498){const _0x399f9c=a16_0xa693,_0x1de526=_0x3827e4();while(!![]){try{const _0x52a036=parseInt(_0x399f9c(0xca))/0x1*(-parseInt(_0x399f9c(0xe3))/0x2)+-parseInt(_0x399f9c(0xfe))/0x3+-parseInt(_0x399f9c(0xc3))/0x4*(-parseInt(_0x399f9c(0xc5))/0x5)+parseInt(_0x399f9c(0xea))/0x6*(-parseInt(_0x399f9c(0xce))/0x7)+-parseInt(_0x399f9c(0xe9))/0x8+parseInt(_0x399f9c(0xfa))/0x9*(parseInt(_0x399f9c(0xda))/0xa)+parseInt(_0x399f9c(0x100))/0xb;if(_0x52a036===_0x1f1498)break;else _0x1de526['push'](_0x1de526['shift']());}catch(_0xd2e944){_0x1de526['push'](_0x1de526['shift']());}}}(a16_0xe5b2,0x75aae));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';function a16_0xa693(_0x514c75,_0x36a78b){_0x514c75=_0x514c75-0xbd;const _0xe5b2ae=a16_0xe5b2();let _0xa6932b=_0xe5b2ae[_0x514c75];return _0xa6932b;}const GLOBAL_FLAG={'name':'global','type':a16_0x11aa2a(0xd2),'description':'Write\x20to\x20global\x20config','default':![]};function parseAliasAppcodeSetKey(_0x567806){const _0x161e99=a16_0x11aa2a,_0x3cf968=_0x567806['split']('.');if(_0x3cf968[_0x161e99(0xf3)]!==0x3||_0x3cf968[0x0]!==_0x161e99(0xe8)||_0x3cf968[0x2]!=='appcode')return undefined;const _0x1611f2=_0x3cf968[0x1]?.[_0x161e99(0xe6)]();return _0x1611f2?_0x1611f2:undefined;}function parseAliasDeleteKey(_0x52ad2f){const _0x4f353e=a16_0x11aa2a,_0x91ee93=_0x52ad2f[_0x4f353e(0xfc)]('.');if(_0x91ee93[_0x4f353e(0xf3)]===0x2&&_0x91ee93[0x0]===_0x4f353e(0xe8)){const _0xf16787=_0x91ee93[0x1]?.['trim']();return _0xf16787?{'alias':_0xf16787}:undefined;}if(_0x91ee93[_0x4f353e(0xf3)]===0x3&&_0x91ee93[0x0]===_0x4f353e(0xe8)&&_0x91ee93[0x2]===_0x4f353e(0xd1)){const _0x53f68f=_0x91ee93[0x1]?.[_0x4f353e(0xe6)]();return _0x53f68f?{'alias':_0x53f68f,'field':_0x4f353e(0xd1)}:undefined;}return undefined;}function setLocalAppAlias(_0x3d1bf2,_0x573cca,_0x2d1f96){const _0x3baf94=a16_0x11aa2a,_0x20b1f8=_0x3d1bf2[_0x3baf94(0xe8)]&&typeof _0x3d1bf2[_0x3baf94(0xe8)]==='object'&&!Array[_0x3baf94(0xbf)](_0x3d1bf2[_0x3baf94(0xe8)])?_0x3d1bf2['apps']:{},_0x3cbaa5=_0x20b1f8[_0x573cca]&&typeof _0x20b1f8[_0x573cca]===_0x3baf94(0xf4)&&!Array['isArray'](_0x20b1f8[_0x573cca])?_0x20b1f8[_0x573cca]:{};_0x3cbaa5[_0x3baf94(0xd1)]=_0x2d1f96,_0x20b1f8[_0x573cca]=_0x3cbaa5,_0x3d1bf2['apps']=_0x20b1f8;}function deleteLocalAppAlias(_0x48d3cc,_0x249bb4){const _0x53bad0=a16_0x11aa2a;if(!_0x48d3cc[_0x53bad0(0xe8)]||typeof _0x48d3cc[_0x53bad0(0xe8)]!=='object'||Array[_0x53bad0(0xbf)](_0x48d3cc['apps']))return![];const _0x4716e3=_0x48d3cc[_0x53bad0(0xe8)],_0x3b883f=_0x4716e3[_0x249bb4[_0x53bad0(0xff)]];if(!_0x3b883f||typeof _0x3b883f!==_0x53bad0(0xf4)||Array['isArray'](_0x3b883f))return![];if(!_0x249bb4[_0x53bad0(0xeb)])return delete _0x4716e3[_0x249bb4[_0x53bad0(0xff)]],!![];if(!(_0x249bb4[_0x53bad0(0xeb)]in _0x3b883f))return![];return delete _0x3b883f[_0x249bb4[_0x53bad0(0xeb)]],Object['keys'](_0x3b883f)['length']===0x0&&delete _0x4716e3[_0x249bb4['alias']],!![];}const listDef={'service':'config','command':a16_0x11aa2a(0xef),'description':'List\x20current\x20config','risk':a16_0x11aa2a(0xd3),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x41c638){const _0x3065da=a16_0x11aa2a,{buildConfigFromFlags:_0x3cb373}=await import('../../context.js'),_0x31ecc5=_0x3cb373({}),_0x5d0e11=getProjectConfigPath(),_0x581cec=resolveWriteConfigPath(_0x3065da(0xd7));if(_0x41c638[_0x3065da(0xe2)]===_0x3065da(0xf7))return{'ok':!![],'message':_0x3065da(0xc1)+(JSON['stringify'](_0x31ecc5['raw'],null,0x2)+'\x0a\x0a')+_0x3065da(0xe4)+('\x20\x20project:\x20'+(_0x5d0e11??_0x3065da(0xf9))+'\x0a')+(_0x3065da(0xc2)+_0x581cec)};return{'ok':!![],'data':{'effective':_0x31ecc5[_0x3065da(0xc4)],'configFiles':{'project':_0x5d0e11??null,'global':_0x581cec}}};}},getDef={'service':a16_0x11aa2a(0xf5),'command':a16_0x11aa2a(0xc9),'description':a16_0x11aa2a(0xcf),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x11aa2a(0xe1),'description':a16_0x11aa2a(0xfb),'required':!![]}],'flags':[],async 'execute'(_0x591fb8){const _0x276a8b=a16_0x11aa2a,_0x4e8f59=_0x591fb8['args'][0x0];if(!_0x4e8f59)throw CliErrors['validation']('Missing\x20key\x20argument.',_0x276a8b(0xc6)+CLI_BIN_NAME+_0x276a8b(0xd5));const {buildConfigFromFlags:_0x4b46eb}=await import('../../context.js'),{raw:_0x248453}=_0x4b46eb({});if(_0x4e8f59['includes']('.')){const _0x560844=_0x4e8f59[_0x276a8b(0xfc)]('.');let _0x4baccc=_0x248453;for(const _0xf802d8 of _0x560844){if(_0x4baccc==null||typeof _0x4baccc!=='object')throw CliErrors['validation'](_0x276a8b(0xc8)+_0x4e8f59);_0x4baccc=_0x4baccc[_0xf802d8];}if(_0x4baccc===undefined)throw CliErrors[_0x276a8b(0xfd)](_0x276a8b(0xc8)+_0x4e8f59);return console[_0x276a8b(0xd9)](typeof _0x4baccc===_0x276a8b(0xf4)?JSON['stringify'](_0x4baccc,null,0x2):String(_0x4baccc)),{'ok':!![]};}const _0x23bf2d=_0x248453[_0x4e8f59];if(_0x23bf2d===undefined)throw CliErrors[_0x276a8b(0xfd)](_0x276a8b(0xc8)+_0x4e8f59);return console['log'](typeof _0x23bf2d==='object'?JSON[_0x276a8b(0xf0)](_0x23bf2d,null,0x2):String(_0x23bf2d)),{'ok':!![]};}},setDef={'service':a16_0x11aa2a(0xf5),'command':a16_0x11aa2a(0xec),'description':a16_0x11aa2a(0xf1),'risk':a16_0x11aa2a(0xd0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x11aa2a(0xe1),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a16_0x11aa2a(0xcd),'description':a16_0x11aa2a(0xbe),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x307f29){const _0x1ed34a=a16_0x11aa2a,_0x43febd=_0x307f29[_0x1ed34a(0xe7)][0x0],_0x28b154=_0x307f29[_0x1ed34a(0xe7)][0x1];if(!_0x43febd||_0x28b154===undefined)throw CliErrors['validation'](_0x1ed34a(0xcb),_0x1ed34a(0xc6)+CLI_BIN_NAME+_0x1ed34a(0xf2));if(ENUM_KEYS[_0x43febd]&&!ENUM_KEYS[_0x43febd]['includes'](_0x28b154))throw CliErrors[_0x1ed34a(0xfd)](_0x1ed34a(0xdb)+_0x43febd+'\x22.\x20Allowed:\x20'+ENUM_KEYS[_0x43febd][_0x1ed34a(0xde)](',\x20'));if(_0x43febd==='riskLevel')throw CliErrors[_0x1ed34a(0xfd)]('\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.');if(_0x43febd==='pageSize'){const _0x4e860e=Number(_0x28b154);if(isNaN(_0x4e860e)||_0x4e860e<=0x0)throw CliErrors[_0x1ed34a(0xfd)](_0x1ed34a(0xdc));}const _0x4eb827=resolveWriteScope({'explicitGlobal':_0x307f29[_0x1ed34a(0xcc)](_0x1ed34a(0xd7)),'policy':_0x1ed34a(0xee)}),_0x4e32fd=toScopeFlags(_0x4eb827),_0x505f3b=readScopedConfig(_0x4e32fd),_0x9fb8a3=parseAliasAppcodeSetKey(_0x43febd);if(!_0x9fb8a3&&!isTopLevelConfigKey(_0x43febd))throw CliErrors[_0x1ed34a(0xfd)](_0x1ed34a(0xd6)+_0x43febd+'\x22\x20is\x20not\x20settable.',_0x1ed34a(0xd4)+getTopLevelConfigKeySummary()+_0x1ed34a(0xe0));return _0x9fb8a3?setLocalAppAlias(_0x505f3b,_0x9fb8a3,_0x28b154):_0x505f3b[_0x43febd]=_0x43febd===_0x1ed34a(0xdf)?Number(_0x28b154):_0x28b154,console[_0x1ed34a(0xd9)](_0x1ed34a(0xbd)+_0x43febd+_0x1ed34a(0xe5)+_0x28b154+'\x22'+(_0x4eb827===_0x1ed34a(0xd7)?_0x1ed34a(0xed):'')),writeScopedConfig(_0x505f3b,_0x4e32fd),{'ok':!![]};}},deleteDef={'service':a16_0x11aa2a(0xf5),'command':a16_0x11aa2a(0xf8),'description':a16_0x11aa2a(0xdd),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x11aa2a(0xe1),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x1dee17){const _0x1e56a9=a16_0x11aa2a,_0xfa5c16=_0x1dee17[_0x1e56a9(0xe7)][0x0];if(!_0xfa5c16)throw CliErrors[_0x1e56a9(0xfd)](_0x1e56a9(0xc0),'Usage:\x20'+CLI_BIN_NAME+'\x20config\x20delete\x20<key>\x20[--global]');const _0x135e5b=resolveWriteScope({'explicitGlobal':_0x1dee17[_0x1e56a9(0xcc)](_0x1e56a9(0xd7)),'policy':_0x1e56a9(0xee)}),_0x2da033=toScopeFlags(_0x135e5b),_0x2358b6=readScopedConfig(_0x2da033),_0x27e723=parseAliasDeleteKey(_0xfa5c16);if(_0x27e723){if(!deleteLocalAppAlias(_0x2358b6,_0x27e723))throw CliErrors[_0x1e56a9(0xfd)]('Key\x20not\x20found:\x20'+_0xfa5c16);return console[_0x1e56a9(0xd9)]('Deleted\x20`'+_0xfa5c16+'`'+(_0x135e5b==='global'?_0x1e56a9(0xed):'')),writeScopedConfig(_0x2358b6,_0x2da033),{'ok':!![]};}if(_0x2358b6[_0xfa5c16]===undefined)throw CliErrors[_0x1e56a9(0xfd)](_0x1e56a9(0xd8)+_0xfa5c16+_0x1e56a9(0xc7));return delete _0x2358b6[_0xfa5c16],console[_0x1e56a9(0xd9)](_0x1e56a9(0xf6)+_0xfa5c16+'`'+(_0x135e5b===_0x1e56a9(0xd7)?'\x20(global)':'')),writeScopedConfig(_0x2358b6,_0x2da033),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x37a481,_0x365419){var _0x2303f4=a17_0x45f5,_0x5582a4=_0x37a481();while(!![]){try{var _0x277079=parseInt(_0x2303f4(0x165))/0x1*(parseInt(_0x2303f4(0x15f))/0x2)+parseInt(_0x2303f4(0x160))/0x3+parseInt(_0x2303f4(0x163))/0x4+parseInt(_0x2303f4(0x15e))/0x5+parseInt(_0x2303f4(0x164))/0x6*(parseInt(_0x2303f4(0x161))/0x7)+parseInt(_0x2303f4(0x162))/0x8+-parseInt(_0x2303f4(0x15d))/0x9;if(_0x277079===_0x365419)break;else _0x5582a4['push'](_0x5582a4['shift']());}catch(_0x292355){_0x5582a4['push'](_0x5582a4['shift']());}}}(a17_0x288e,0x80015));function a17_0x288e(){var _0x2db706=['5053910VjIwet','115586pdOkhz','2497392cAgMJw','1052541bMPote','7215144tmZorn','2090872ngIoGe','36IkecpI','12Eoxjzp','39053178mflqhf'];a17_0x288e=function(){return _0x2db706;};return a17_0x288e();}import{CLI_BIN_NAME}from'../../constant/cli.js';export{CLI_BIN_NAME};function a17_0x45f5(_0x4c5036,_0x2cd897){_0x4c5036=_0x4c5036-0x15d;var _0x288e4d=a17_0x288e();var _0x45f54b=_0x288e4d[_0x4c5036];return _0x45f54b;}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';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a18_0x4a8133=a18_0x329d;function a18_0x329d(_0x29c432,_0x20496a){_0x29c432=_0x29c432-0x84;const _0x26a741=a18_0x26a7();let _0x329d41=_0x26a741[_0x29c432];return _0x329d41;}(function(_0x4644d5,_0xa7f92d){const _0x1a92ae=a18_0x329d,_0x5a06ad=_0x4644d5();while(!![]){try{const _0xf5073b=-parseInt(_0x1a92ae(0xab))/0x1*(-parseInt(_0x1a92ae(0x9e))/0x2)+-parseInt(_0x1a92ae(0xc5))/0x3+-parseInt(_0x1a92ae(0x9b))/0x4*(-parseInt(_0x1a92ae(0x97))/0x5)+parseInt(_0x1a92ae(0x8d))/0x6*(parseInt(_0x1a92ae(0x99))/0x7)+parseInt(_0x1a92ae(0xa3))/0x8*(parseInt(_0x1a92ae(0xb9))/0x9)+parseInt(_0x1a92ae(0xc7))/0xa*(-parseInt(_0x1a92ae(0x8e))/0xb)+-parseInt(_0x1a92ae(0xcf))/0xc;if(_0xf5073b===_0xa7f92d)break;else _0x5a06ad['push'](_0x5a06ad['shift']());}catch(_0x4a6241){_0x5a06ad['push'](_0x5a06ad['shift']());}}}(a18_0x26a7,0xe9ce0));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':'filter','operation':a18_0x4a8133(0x90),'risk':'read','paramsRequired':![],'description':a18_0x4a8133(0x85),'paramsHint':'JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20'+'Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','helpExtra':[a18_0x4a8133(0xa7),'\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}}',a18_0x4a8133(0x8b),'\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}',a18_0x4a8133(0x8c),'\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]}}',a18_0x4a8133(0x8f),a18_0x4a8133(0xaf),a18_0x4a8133(0xc0),'',a18_0x4a8133(0xb5),a18_0x4a8133(0xb1),'\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_0x4a8133(0xbe),a18_0x4a8133(0x98),'\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]',a18_0x4a8133(0xb4),a18_0x4a8133(0x95),'\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','',a18_0x4a8133(0x9a),'\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.',a18_0x4a8133(0x88),a18_0x4a8133(0xba)][a18_0x4a8133(0xbd)]('\x0a')},{'command':a18_0x4a8133(0xb8),'operation':a18_0x4a8133(0xb8),'risk':'read','paramsRequired':!![],'description':'Get\x20a\x20single\x20record\x20by\x20ID','paramsHint':a18_0x4a8133(0x86)},{'command':a18_0x4a8133(0xa8),'operation':a18_0x4a8133(0xa8),'risk':a18_0x4a8133(0x93),'paramsRequired':!![],'description':a18_0x4a8133(0x8a),'paramsHint':a18_0x4a8133(0x9c)},{'command':a18_0x4a8133(0xa0),'operation':a18_0x4a8133(0xa0),'risk':'write','paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','paramsHint':a18_0x4a8133(0xc1)},{'command':a18_0x4a8133(0xad),'operation':'update','risk':'write','paramsRequired':!![],'description':a18_0x4a8133(0xd1),'paramsHint':a18_0x4a8133(0xa4)},{'command':'delete','operation':'delete','risk':a18_0x4a8133(0xcb),'paramsRequired':!![],'description':'Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','paramsHint':a18_0x4a8133(0x86)},{'command':a18_0x4a8133(0xce),'operation':a18_0x4a8133(0xce),'risk':a18_0x4a8133(0x91),'paramsRequired':![],'description':a18_0x4a8133(0xc4),'paramsHint':a18_0x4a8133(0x94)+a18_0x4a8133(0xc6),'helpExtra':[a18_0x4a8133(0xac),a18_0x4a8133(0xbf),a18_0x4a8133(0xca),a18_0x4a8133(0xbc),a18_0x4a8133(0x96),'\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_0x4a8133(0xaa),a18_0x4a8133(0xbb),'','\x20\x20PARAMS\x20STRUCTURE',a18_0x4a8133(0xa5),a18_0x4a8133(0xd3),a18_0x4a8133(0xb2),a18_0x4a8133(0xc3),a18_0x4a8133(0x87),a18_0x4a8133(0xa1),'',a18_0x4a8133(0x9f),a18_0x4a8133(0xc2),a18_0x4a8133(0x89),'',a18_0x4a8133(0xd2),a18_0x4a8133(0xb7)][a18_0x4a8133(0xbd)]('\x0a')}];function a18_0x26a7(){const _0x418fa4=['join','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','\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}','\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}}','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','153615HTBGDy','Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','943530IXrpMP','risk','POST','\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}','high-risk-write','params','body','aggregate','29436384YQDNjL','data\x20','Update\x20an\x20existing\x20record','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','dryRun','Filter\x20dataset\x20records\x20with\x20query\x20conditions','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Post-aggregation\x20filter,\x20e.g.\x20{\x22total\x22:{\x22$gt\x22:1000}}','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','\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','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','1252734uVytJi','99sdWUzr','\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}}','filter','read','description','write','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\x20\x20\x20\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}','375hpktSU','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','7HIlFFf','\x20\x20PAGINATION','16316OyswDh','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','str','322HMohRo','\x20\x20EXAMPLES','batchCreate','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','operation','888wWhNlx','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','command','\x20\x20WHERE\x20OPERATORS','create','helpExtra','\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}','11827KkvMug','\x20\x20AGGREGATE\x20TYPES','update','data','\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}}','now','\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\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','build','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','\x20\x20LOGICAL\x20COMBINATORS','\x20on\x20dataset\x20','\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','getOne','153423WHBpFg','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','\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\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}'];a18_0x26a7=function(){return _0x418fa4;};return a18_0x26a7();}function makeDataCommand(_0x1d3071){const _0x16ad01=a18_0x4a8133,_0x23f6d7='data\x20'+_0x1d3071[_0x16ad01(0xa6)],_0x47250e={'service':_0x16ad01(0xae),'command':_0x1d3071[_0x16ad01(0xa6)],'description':_0x1d3071[_0x16ad01(0x92)],'risk':_0x1d3071[_0x16ad01(0xc8)],'helpExtra':_0x1d3071[_0x16ad01(0xa9)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x1d3071['paramsHint']}],'validate':async _0x4dc07b=>{const _0x2ea826=_0x16ad01;_0x1d3071['paramsRequired']&&requireAnyOf(_0x4dc07b,['params'],_0x23f6d7),_0x1d3071[_0x2ea826(0xa2)]===_0x2ea826(0xa0)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x4dc07b[_0x2ea826(0x9d)](_0x2ea826(0xcc))));},async 'execute'(_0x3d998d){const _0x1a0cf9=_0x16ad01,_0x138bc3=_0x3d998d[_0x1a0cf9(0x9d)]('code'),_0x1f279c=_0x1d3071[_0x1a0cf9(0xa2)]===_0x1a0cf9(0xa0)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x3d998d[_0x1a0cf9(0x9d)]('params'))):parseJsonParams(_0x3d998d[_0x1a0cf9(0x9d)](_0x1a0cf9(0xcc)))??{},_0x12e40f=Date[_0x1a0cf9(0xb0)](),_0x17f39c=await executeData(_0x138bc3,_0x1d3071[_0x1a0cf9(0xa2)],_0x1f279c),_0x32b8b1=Date[_0x1a0cf9(0xb0)]()-_0x12e40f;return{'ok':!![],'data':{'result':_0x17f39c,'elapsed':_0x32b8b1},'message':_0x1a0cf9(0xd0)+_0x1d3071[_0x1a0cf9(0xa6)]+'\x20completed\x20in\x20'+_0x32b8b1+'ms'};}};return _0x1d3071[_0x16ad01(0xc8)]!=='read'&&(_0x47250e[_0x16ad01(0x84)]=async _0x2ce8e1=>{const _0x5785f6=_0x16ad01,_0x307af5=_0x2ce8e1[_0x5785f6(0x9d)]('code'),_0x2677f6=_0x1d3071['operation']==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x2ce8e1[_0x5785f6(0x9d)](_0x5785f6(0xcc)))):parseJsonParams(_0x2ce8e1[_0x5785f6(0x9d)](_0x5785f6(0xcc)))??{};return dryRun(_0x5785f6(0xc9),'/api/{appCode}/'+_0x307af5+'/'+_0x1d3071['operation'])[_0x5785f6(0xcd)](_0x2677f6)[_0x5785f6(0x92)]('Preview:\x20data\x20'+_0x1d3071[_0x5785f6(0xa6)]+_0x5785f6(0xb6)+_0x307af5)[_0x5785f6(0xb3)]();}),_0x47250e;}export const dataDefinitions=specs['map'](makeDataCommand);
|
|
1
|
+
const a18_0x6b2538=a18_0x5c3d;(function(_0x11b9c9,_0x1cb31d){const _0x41afa8=a18_0x5c3d,_0x33e132=_0x11b9c9();while(!![]){try{const _0x76dffa=parseInt(_0x41afa8(0xff))/0x1*(-parseInt(_0x41afa8(0x108))/0x2)+-parseInt(_0x41afa8(0x101))/0x3+-parseInt(_0x41afa8(0x10d))/0x4+parseInt(_0x41afa8(0xca))/0x5*(-parseInt(_0x41afa8(0xf2))/0x6)+-parseInt(_0x41afa8(0x10c))/0x7+-parseInt(_0x41afa8(0x109))/0x8+parseInt(_0x41afa8(0xe3))/0x9;if(_0x76dffa===_0x1cb31d)break;else _0x33e132['push'](_0x33e132['shift']());}catch(_0x30a40d){_0x33e132['push'](_0x33e132['shift']());}}}(a18_0x1927,0x981de));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';function a18_0x1927(){const _0x1a9af2=['732DxDyGq','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','paramsHint','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\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}','data','write','getOne','data\x20','read','\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}}','4027Tthegm','\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}','900534rsDhvb','\x20\x20WHERE\x20OPERATORS','\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','command','update','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}','226WPvUsO','1222448xVWoAE','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','description','5055274CaIAQk','981092oUkLlC','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','body','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','now','create','str','dryRun','risk','\x20\x20PAGINATION','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','\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}}','code','build','\x20\x20LOGICAL\x20COMBINATORS','Update\x20an\x20existing\x20record','25485mPmLnH','Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','Filter\x20dataset\x20records\x20with\x20query\x20conditions','\x20\x20PARAMS\x20STRUCTURE','\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}]','map','join','\x20\x20EXAMPLES','aggregate','\x20on\x20dataset\x20','\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\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','high-risk-write','delete','\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\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}','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','\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}}','params','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','Preview:\x20data\x20','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','\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\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','helpExtra','28083546VCYNVL','\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\x20AGGREGATE\x20TYPES','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','/api/{appCode}/','POST','operation','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','\x20\x20\x20\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}}','Get\x20a\x20single\x20record\x20by\x20ID','batchCreate','\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}','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','filter'];a18_0x1927=function(){return _0x1a9af2;};return a18_0x1927();}import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a18_0x6b2538(0xf1),'operation':'filter','risk':'read','paramsRequired':![],'description':a18_0x6b2538(0xcc),'paramsHint':a18_0x6b2538(0xf0)+a18_0x6b2538(0x10a),'helpExtra':[a18_0x6b2538(0x102),a18_0x6b2538(0x107),'\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_0x6b2538(0x106),a18_0x6b2538(0xfe),a18_0x6b2538(0xec),a18_0x6b2538(0xc5),'\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]}}',a18_0x6b2538(0xe6),'\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}}',a18_0x6b2538(0xdb),'',a18_0x6b2538(0xc8),'\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}}]}',a18_0x6b2538(0xeb),'','\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_0x6b2538(0xd8),a18_0x6b2538(0xce),a18_0x6b2538(0xf7),'\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','',a18_0x6b2538(0xc3),a18_0x6b2538(0x112),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)'][a18_0x6b2538(0xd0)]('\x0a')},{'command':'getOne','operation':a18_0x6b2538(0xfb),'risk':a18_0x6b2538(0xfd),'paramsRequired':!![],'description':a18_0x6b2538(0xed),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a18_0x6b2538(0xbf),'operation':a18_0x6b2538(0xbf),'risk':a18_0x6b2538(0xfa),'paramsRequired':!![],'description':a18_0x6b2538(0xf4),'paramsHint':'JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27'},{'command':a18_0x6b2538(0xee),'operation':a18_0x6b2538(0xee),'risk':'write','paramsRequired':!![],'description':a18_0x6b2538(0x111),'paramsHint':a18_0x6b2538(0xf3)},{'command':a18_0x6b2538(0x105),'operation':a18_0x6b2538(0x105),'risk':a18_0x6b2538(0xfa),'paramsRequired':!![],'description':a18_0x6b2538(0xc9),'paramsHint':a18_0x6b2538(0xc4)},{'command':a18_0x6b2538(0xd7),'operation':'delete','risk':a18_0x6b2538(0xd6),'paramsRequired':!![],'description':a18_0x6b2538(0xda),'paramsHint':a18_0x6b2538(0xf5)},{'command':a18_0x6b2538(0xd2),'operation':a18_0x6b2538(0xd2),'risk':a18_0x6b2538(0xfd),'paramsRequired':![],'description':a18_0x6b2538(0xd5),'paramsHint':a18_0x6b2538(0xdf)+a18_0x6b2538(0xcb),'helpExtra':[a18_0x6b2538(0xe5),a18_0x6b2538(0xd9),'\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}',a18_0x6b2538(0xef),'\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}',a18_0x6b2538(0xd4),a18_0x6b2538(0xf8),a18_0x6b2538(0x100),'',a18_0x6b2538(0xcd),a18_0x6b2538(0x10f),'\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)',a18_0x6b2538(0xe1),a18_0x6b2538(0xe0),a18_0x6b2538(0xe4),a18_0x6b2538(0xe7),'',a18_0x6b2538(0xd1),'\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status',a18_0x6b2538(0x103),'',a18_0x6b2538(0xdd),a18_0x6b2538(0x10e)]['join']('\x0a')}];function a18_0x5c3d(_0x36c98a,_0x157342){_0x36c98a=_0x36c98a-0xbe;const _0x1927c5=a18_0x1927();let _0x5c3dd4=_0x1927c5[_0x36c98a];return _0x5c3dd4;}function makeDataCommand(_0x39c9f0){const _0x23adca=a18_0x6b2538,_0x42c4da=_0x23adca(0xfc)+_0x39c9f0[_0x23adca(0x104)],_0x47aa3e={'service':_0x23adca(0xf9),'command':_0x39c9f0[_0x23adca(0x104)],'description':_0x39c9f0[_0x23adca(0x10b)],'risk':_0x39c9f0['risk'],'helpExtra':_0x39c9f0[_0x23adca(0xe2)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x39c9f0[_0x23adca(0xf6)]}],'validate':async _0xe8bf32=>{const _0x39e3fb=_0x23adca;_0x39c9f0['paramsRequired']&&requireAnyOf(_0xe8bf32,['params'],_0x42c4da),_0x39c9f0[_0x39e3fb(0xea)]==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0xe8bf32[_0x39e3fb(0xc0)]('params')));},async 'execute'(_0x54c5c5){const _0x16798f=_0x23adca,_0x1fe328=_0x54c5c5[_0x16798f(0xc0)](_0x16798f(0xc6)),_0x172ba9=_0x39c9f0[_0x16798f(0xea)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x54c5c5['str'](_0x16798f(0xdc)))):parseJsonParams(_0x54c5c5[_0x16798f(0xc0)](_0x16798f(0xdc)))??{},_0x3960cb=Date['now'](),_0x312a0c=await executeData(_0x1fe328,_0x39c9f0['operation'],_0x172ba9),_0x3869c6=Date[_0x16798f(0xbe)]()-_0x3960cb;return{'ok':!![],'data':{'result':_0x312a0c,'elapsed':_0x3869c6},'message':_0x16798f(0xfc)+_0x39c9f0[_0x16798f(0x104)]+'\x20completed\x20in\x20'+_0x3869c6+'ms'};}};return _0x39c9f0[_0x23adca(0xc2)]!==_0x23adca(0xfd)&&(_0x47aa3e[_0x23adca(0xc1)]=async _0x5b5a25=>{const _0x2555d0=_0x23adca,_0x37a8c9=_0x5b5a25[_0x2555d0(0xc0)]('code'),_0xdee8f6=_0x39c9f0[_0x2555d0(0xea)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x5b5a25[_0x2555d0(0xc0)]('params'))):parseJsonParams(_0x5b5a25[_0x2555d0(0xc0)](_0x2555d0(0xdc)))??{};return dryRun(_0x2555d0(0xe9),_0x2555d0(0xe8)+_0x37a8c9+'/'+_0x39c9f0[_0x2555d0(0xea)])[_0x2555d0(0x110)](_0xdee8f6)[_0x2555d0(0x10b)](_0x2555d0(0xde)+_0x39c9f0['command']+_0x2555d0(0xd3)+_0x37a8c9)[_0x2555d0(0xc7)]();}),_0x47aa3e;}export const dataDefinitions=specs[a18_0x6b2538(0xcf)](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x4a5bc3=a19_0x1485;(function(_0x5f323e,_0x537a81){const _0x5da49c=a19_0x1485,_0x239fb2=_0x5f323e();while(!![]){try{const _0x4a70ab=-parseInt(_0x5da49c(0x12b))/0x1+parseInt(_0x5da49c(0x149))/0x2*(parseInt(_0x5da49c(0x135))/0x3)+-parseInt(_0x5da49c(0x128))/0x4*(parseInt(_0x5da49c(0x146))/0x5)+parseInt(_0x5da49c(0x118))/0x6+parseInt(_0x5da49c(0x13a))/0x7*(parseInt(_0x5da49c(0x130))/0x8)+-parseInt(_0x5da49c(0x10d))/0x9+parseInt(_0x5da49c(0x139))/0xa*(parseInt(_0x5da49c(0x103))/0xb);if(_0x4a70ab===_0x537a81)break;else _0x239fb2['push'](_0x239fb2['shift']());}catch(_0x2d40f8){_0x239fb2['push'](_0x239fb2['shift']());}}}(a19_0x5686,0x22700));import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function a19_0x1485(_0x5e5b61,_0x2d34d9){_0x5e5b61=_0x5e5b61-0x102;const _0x5686dc=a19_0x5686();let _0x148531=_0x5686dc[_0x5e5b61];return _0x148531;}function a19_0x5686(){const _0x21d808=['afterScriptId','deleted','length','70iFIEwq','dataset','dataType','2iBTRxa','options','str','toTableName','indexes','doVersion','requestBody','1409188oTwKpf','read','relatedPageInfoList','filter','toDatasetCode','detail','title','modelCode','properties','requestFields','1923372vSrpZc','host','code','allFieldNames','modifierIdField','dblinkInfoDTO','columnCodeListWithDeleted','relations','creatorIdField','extend','responseBody','1389804IFetwW','map','allFields','sourceType','formatRules','dbType','object','dbName','trim','toFieldLabel','datasetKey','tableName','path','pkField','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','logicField','75108SncIeJ','required','entries','260372TQQNvH','validateRules','parse','createTimeField','fields','328MjkohL','name','displayName','isArray','type','172203ROhsRU','responseFields','string','appCode','40rvRWZh','13069SsgUoo','source','beforeScriptId','description','split','dbId','push','toField','dbtableConfig'];a19_0x5686=function(){return _0x21d808;};return a19_0x5686();}function normalizeField(_0x311013){const _0x5c7f25=a19_0x1485;if(_0x311013[_0x5c7f25(0x144)])return null;const _0x805b11=Boolean(_0x311013[_0x5c7f25(0x132)]!==undefined||_0x311013['doType']!==undefined);let _0x457170={};if(!_0x805b11&&typeof _0x311013[_0x5c7f25(0x116)]==='string')try{_0x457170=JSON[_0x5c7f25(0x12d)](_0x311013[_0x5c7f25(0x116)]);}catch{}const _0x456e7d=_0x805b11?_0x311013[_0x5c7f25(0x131)]:_0x311013[_0x5c7f25(0x10f)],_0x483ca4=_0x805b11?_0x311013[_0x5c7f25(0x132)]:_0x311013['name'],_0x1497c6=_0x805b11?_0x311013['doType']:_0x311013[_0x5c7f25(0x134)]||_0x311013[_0x5c7f25(0x148)],_0x519d5a=_0x805b11?_0x311013['pkField']===!![]:_0x457170[_0x5c7f25(0x125)]===!![],_0x4e594d=_0x805b11?_0x311013['required']===!![]:_0x457170[_0x5c7f25(0x129)]===!![],_0x47f54e=_0x805b11?_0x311013[_0x5c7f25(0x14a)]??null:_0x457170[_0x5c7f25(0x14a)]??null,_0x3145cc={'name':_0x456e7d,'displayName':_0x483ca4||_0x456e7d,'type':_0x1497c6,'dbType':_0x311013[_0x5c7f25(0x11d)],'pk':_0x519d5a,'required':_0x4e594d,'description':_0x311013[_0x5c7f25(0x13d)]||undefined};return Array[_0x5c7f25(0x133)](_0x47f54e)&&_0x47f54e[_0x5c7f25(0x145)]>0x0&&(_0x3145cc[_0x5c7f25(0x14a)]=_0x47f54e),_0x3145cc;}function parseJsonMaybe(_0x4797c3){const _0x31d462=a19_0x1485;if(typeof _0x4797c3!==_0x31d462(0x137))return _0x4797c3;try{return JSON[_0x31d462(0x12d)](_0x4797c3);}catch{return _0x4797c3;}}function normalizeOperationEntry(_0x5b7484,_0x4b3a03){const _0x47ae5b=a19_0x1485;if(!_0x4b3a03||typeof _0x4b3a03!==_0x47ae5b(0x11e))return null;if(!_0x4b3a03['method']||!_0x4b3a03[_0x47ae5b(0x124)])return null;const _0x27e7e2={'name':_0x5b7484,'method':_0x4b3a03['method'],'path':_0x4b3a03['path']};if(_0x4b3a03[_0x47ae5b(0x10e)])_0x27e7e2[_0x47ae5b(0x10e)]=_0x4b3a03[_0x47ae5b(0x10e)];if(_0x4b3a03[_0x47ae5b(0x102)]!=null)_0x27e7e2[_0x47ae5b(0x102)]=parseJsonMaybe(_0x4b3a03[_0x47ae5b(0x102)]);if(_0x4b3a03[_0x47ae5b(0x117)]!=null)_0x27e7e2[_0x47ae5b(0x117)]=parseJsonMaybe(_0x4b3a03[_0x47ae5b(0x117)]);if(_0x4b3a03['beforeScriptId']!=null)_0x27e7e2[_0x47ae5b(0x13c)]=_0x4b3a03[_0x47ae5b(0x13c)];if(_0x4b3a03[_0x47ae5b(0x143)]!=null)_0x27e7e2['afterScriptId']=_0x4b3a03['afterScriptId'];if(Array['isArray'](_0x4b3a03[_0x47ae5b(0x10c)]))_0x27e7e2[_0x47ae5b(0x10c)]=_0x4b3a03[_0x47ae5b(0x10c)];if(Array['isArray'](_0x4b3a03[_0x47ae5b(0x136)]))_0x27e7e2[_0x47ae5b(0x136)]=_0x4b3a03[_0x47ae5b(0x136)];return _0x27e7e2;}function summarizeDbtable(_0x7b203c){const _0x1615ef=a19_0x1485,_0x3a176a={},_0xc58f4a=[_0x1615ef(0x13f),_0x1615ef(0x11f),'tableName',_0x1615ef(0x122),'pkField','allFields',_0x1615ef(0x127),_0x1615ef(0x12e),'updateTimeField',_0x1615ef(0x115),'creatorNameField',_0x1615ef(0x111),'modifierNameField','labelField',_0x1615ef(0x112)];for(const _0x45a75c of _0xc58f4a){if(_0x7b203c[_0x45a75c]!==undefined)_0x3a176a[_0x45a75c]=_0x7b203c[_0x45a75c];}return typeof _0x3a176a['allFields']==='string'&&_0x3a176a[_0x1615ef(0x11a)][_0x1615ef(0x145)]>0x0&&(_0x3a176a[_0x1615ef(0x110)]=_0x3a176a[_0x1615ef(0x11a)][_0x1615ef(0x13e)](',')['map'](_0x49c6d6=>_0x49c6d6['trim']())[_0x1615ef(0x106)](Boolean)),_0x3a176a;}function normalizeRelatedPages(_0x27f9af){const _0x5a45e9=a19_0x1485;if(!Array['isArray'](_0x27f9af))return[];return _0x27f9af[_0x5a45e9(0x106)](_0x5974b2=>_0x5974b2&&typeof _0x5974b2==='object')[_0x5a45e9(0x119)](_0x13e809=>({'id':_0x13e809['id'],'type':_0x13e809['type'],'code':_0x13e809['code'],'title':_0x13e809[_0x5a45e9(0x109)],'deleted':_0x13e809[_0x5a45e9(0x144)]===!![]}));}function normalizeFallbackFieldName(_0x35888,_0x552454){const _0x231378=a19_0x1485,_0x973a6f=_0x35888[_0x231378(0x120)]();if(!_0x973a6f)return null;return{'name':_0x973a6f,'displayName':_0x973a6f,'type':undefined,'dbType':undefined,'pk':_0x973a6f===_0x552454,'required':![],'description':undefined};}async function loadListFieldFallback(_0x281e51,_0x5da128){const _0x53a001=a19_0x1485;if(!_0x281e51||!_0x5da128)return[];try{const _0x569f7a=await listDatasets(_0x281e51,{'code':_0x5da128}),_0x3dda9e=_0x569f7a['find'](_0x4190ca=>_0x4190ca['code']===_0x5da128)??_0x569f7a[0x0],_0x30cfe1=_0x3dda9e?.[_0x53a001(0x142)]??{},_0x149d24=typeof _0x30cfe1[_0x53a001(0x11a)]===_0x53a001(0x137)?_0x30cfe1[_0x53a001(0x11a)]['split'](','):[];return _0x149d24[_0x53a001(0x119)](_0x4d5e3d=>normalizeFallbackFieldName(_0x4d5e3d,_0x30cfe1[_0x53a001(0x125)]))[_0x53a001(0x106)](_0x209b7b=>_0x209b7b!==null);}catch{return[];}}export const datasetDetail={'service':a19_0x4a5bc3(0x147),'command':a19_0x4a5bc3(0x108),'description':a19_0x4a5bc3(0x126),'risk':a19_0x4a5bc3(0x104),'flags':[CODE_FLAG],async 'execute'(_0x31531b){const _0x44e9e9=a19_0x4a5bc3,_0x476070=await getDatasetDetail(_0x31531b[_0x44e9e9(0x14b)](_0x44e9e9(0x10f))),_0x2e4ff5=Array[_0x44e9e9(0x133)](_0x476070[_0x44e9e9(0x12f)])?_0x476070[_0x44e9e9(0x12f)]:Array['isArray'](_0x476070['properties'])?_0x476070[_0x44e9e9(0x10b)]:[];let _0xbae68b=_0x2e4ff5[_0x44e9e9(0x119)](_0x6b4e55=>normalizeField(_0x6b4e55))[_0x44e9e9(0x106)](_0x5ea3c6=>_0x5ea3c6!==null);_0xbae68b[_0x44e9e9(0x145)]===0x0&&(_0xbae68b=await loadListFieldFallback(_0x31531b[_0x44e9e9(0x138)],_0x31531b[_0x44e9e9(0x14b)]('code')));const _0x2de0c1=_0x476070['operations']??{},_0xcf2d8d=[];for(const [_0x57c7ea,_0x51c6c4]of Object[_0x44e9e9(0x12a)](_0x2de0c1)){const _0x20568a=normalizeOperationEntry(_0x57c7ea,_0x51c6c4);if(_0x20568a)_0xcf2d8d[_0x44e9e9(0x140)](_0x20568a);}const _0x3040cb=_0x476070[_0x44e9e9(0x142)]??{},_0x4a40bd=_0x476070[_0x44e9e9(0x147)]??{},_0x372fb6=_0x3040cb[_0x44e9e9(0x13f)]!=null?{'id':_0x3040cb[_0x44e9e9(0x13f)],'name':_0x3040cb[_0x44e9e9(0x11f)]??null}:undefined;let _0x256e90;return typeof _0x476070[_0x44e9e9(0x116)]===_0x44e9e9(0x137)&&(_0x256e90=parseJsonMaybe(_0x476070[_0x44e9e9(0x116)])),{'ok':!![],'data':{'id':_0x476070['modelId']??_0x476070['id'],'name':_0x476070['name'],'code':_0x476070[_0x44e9e9(0x10a)]||_0x476070[_0x44e9e9(0x10f)],'doVersion':_0x476070[_0x44e9e9(0x14e)],'description':_0x476070[_0x44e9e9(0x13d)]||_0x4a40bd['tableComment']||undefined,'source':_0x476070[_0x44e9e9(0x13b)]||_0x4a40bd[_0x44e9e9(0x11b)],'table':_0x3040cb['tableName']||_0x4a40bd[_0x44e9e9(0x123)],'datasetKey':_0x3040cb[_0x44e9e9(0x122)],'pk':_0x3040cb[_0x44e9e9(0x125)],'db':_0x372fb6,'dbtable':summarizeDbtable(_0x3040cb),'fields':_0xbae68b,'operations':_0xcf2d8d,'indexes':Array[_0x44e9e9(0x133)](_0x4a40bd[_0x44e9e9(0x14d)])?_0x4a40bd[_0x44e9e9(0x14d)]:[],'relations':Array[_0x44e9e9(0x133)](_0x476070[_0x44e9e9(0x114)])?_0x476070[_0x44e9e9(0x114)][_0x44e9e9(0x119)](_0x49ce39=>({'fromField':_0x49ce39['fromField'],'toDataset':_0x49ce39['toDatasetName'],'toCode':_0x49ce39[_0x44e9e9(0x107)],'toTable':_0x49ce39[_0x44e9e9(0x14c)],'toField':_0x49ce39[_0x44e9e9(0x141)],'labelField':_0x49ce39[_0x44e9e9(0x121)]||undefined})):[],'relatedPages':normalizeRelatedPages(_0x476070[_0x44e9e9(0x105)]),...Array[_0x44e9e9(0x133)](_0x476070[_0x44e9e9(0x113)])?{'columnCodeListWithDeleted':_0x476070['columnCodeListWithDeleted']}:{},'formatRules':Array[_0x44e9e9(0x133)](_0x476070[_0x44e9e9(0x11c)])?_0x476070[_0x44e9e9(0x11c)]:[],'validateRules':Array[_0x44e9e9(0x133)](_0x476070['validateRules'])?_0x476070[_0x44e9e9(0x12c)]:[],..._0x256e90!==undefined?{'extend':_0x256e90}:{},'stats':{'fieldCount':_0xbae68b[_0x44e9e9(0x145)],'operationCount':_0xcf2d8d['length']}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x16b7d9,_0x42166a){const _0x2155a7=a20_0x1aef,_0x581cf6=_0x16b7d9();while(!![]){try{const _0x526e9a=parseInt(_0x2155a7(0x1c9))/0x1*(-parseInt(_0x2155a7(0x1cf))/0x2)+-parseInt(_0x2155a7(0x1c6))/0x3*(parseInt(_0x2155a7(0x1c8))/0x4)+parseInt(_0x2155a7(0x1cd))/0x5+-parseInt(_0x2155a7(0x1ce))/0x6+-parseInt(_0x2155a7(0x1cb))/0x7*(-parseInt(_0x2155a7(0x1ca))/0x8)+parseInt(_0x2155a7(0x1cc))/0x9+parseInt(_0x2155a7(0x1c7))/0xa;if(_0x526e9a===_0x42166a)break;else _0x581cf6['push'](_0x581cf6['shift']());}catch(_0x187443){_0x581cf6['push'](_0x581cf6['shift']());}}}(a20_0x1fc6,0x21855));function a20_0x1fc6(){const _0x332f42=['7567gdrSDR','1297269lGYqLx','374950jfmybs','1539276QFpSUY','146mxLYlD','3wSqGsQ','2987650Hnzurf','301112oKgryF','1216sEGZVQ','296JZgBDD'];a20_0x1fc6=function(){return _0x332f42;};return a20_0x1fc6();}import{datasetList}from'../../commands/dataset/list.js';import{datasetDetail}from'../../commands/dataset/detail.js';function a20_0x1aef(_0x1d183e,_0x2d8d06){_0x1d183e=_0x1d183e-0x1c6;const _0x1fc6ce=a20_0x1fc6();let _0x1aef86=_0x1fc6ce[_0x1d183e];return _0x1aef86;}import{datasetSdkDoc}from'../../commands/dataset/sdk-doc.js';export const datasetDefinitions=[datasetList,datasetDetail,datasetSdkDoc];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x3b0a0a=a21_0x3e7d;function a21_0x3e7d(_0x30d7d6,_0x4d4516){_0x30d7d6=_0x30d7d6-0x166;const _0x1bdd44=a21_0x1bdd();let _0x3e7dbf=_0x1bdd44[_0x30d7d6];return _0x3e7dbf;}(function(_0x4defb3,_0x17c681){const _0xa3a625=a21_0x3e7d,_0x2e72ae=_0x4defb3();while(!![]){try{const _0x108865=parseInt(_0xa3a625(0x179))/0x1*(parseInt(_0xa3a625(0x180))/0x2)+-parseInt(_0xa3a625(0x168))/0x3+-parseInt(_0xa3a625(0x16c))/0x4+parseInt(_0xa3a625(0x17d))/0x5*(parseInt(_0xa3a625(0x171))/0x6)+parseInt(_0xa3a625(0x16a))/0x7*(parseInt(_0xa3a625(0x181))/0x8)+parseInt(_0xa3a625(0x166))/0x9*(parseInt(_0xa3a625(0x172))/0xa)+-parseInt(_0xa3a625(0x16d))/0xb;if(_0x108865===_0x17c681)break;else _0x2e72ae['push'](_0x2e72ae['shift']());}catch(_0x5b42cc){_0x2e72ae['push'](_0x2e72ae['shift']());}}}(a21_0x1bdd,0x9e4c9));function a21_0x1bdd(){const _0x2a8b36=['tableName','description','4426675fbFQKE','dataset','code','211522Evmxqq','1192cDSnXa','string','873QHGTuw','Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)','2188272vhsyvr','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','55741dobgMC','name','5034636MOzIos','8321896WxlatI','dbtableConfig','split','pkField','6JcWhqv','16270pRTnBI','str','allFields','list','map','length','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','11rdIBhM','trim'];a21_0x1bdd=function(){return _0x2a8b36;};return a21_0x1bdd();}import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';export const datasetList={'service':a21_0x3b0a0a(0x17e),'command':a21_0x3b0a0a(0x175),'description':a21_0x3b0a0a(0x169),'risk':'read','flags':[{'name':'name','type':a21_0x3b0a0a(0x182),'description':a21_0x3b0a0a(0x167)},{...CODE_FLAG,'required':![],'description':a21_0x3b0a0a(0x178)}],async 'execute'(_0x11983e){const _0x25cd5d=a21_0x3b0a0a,_0x4f0573=_0x11983e[_0x25cd5d(0x173)](_0x25cd5d(0x16b)),_0x387de3=_0x11983e[_0x25cd5d(0x173)](_0x25cd5d(0x17f)),_0x4a9386=await listDatasets(_0x11983e['appCode'],{..._0x4f0573&&{'name':_0x4f0573},..._0x387de3&&{'code':_0x387de3}});return{'ok':!![],'data':{'total':_0x4a9386[_0x25cd5d(0x177)],'datasets':_0x4a9386[_0x25cd5d(0x176)](_0x3706cc=>{const _0x417554=_0x25cd5d,_0x213366=_0x3706cc[_0x417554(0x16e)]??{};return{'id':_0x3706cc['id'],'code':_0x3706cc[_0x417554(0x17f)],'name':_0x3706cc[_0x417554(0x16b)],'source':_0x3706cc['source'],'description':_0x3706cc[_0x417554(0x17c)],'table':_0x213366[_0x417554(0x17b)],'datasetKey':_0x213366['datasetKey'],'pk':_0x213366[_0x417554(0x170)],'fields':_0x213366[_0x417554(0x174)]?_0x213366['allFields'][_0x417554(0x16f)](',')[_0x417554(0x176)](_0x4fbf58=>_0x4fbf58[_0x417554(0x17a)]()):[]};})}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a22_0x3b5461=a22_0x45e9;function a22_0x45e9(_0x1bde3c,_0x59a4e6){_0x1bde3c=_0x1bde3c-0x168;const _0x3bf380=a22_0x3bf3();let _0x45e920=_0x3bf380[_0x1bde3c];return _0x45e920;}(function(_0x3057f2,_0x1e618e){const _0x29104d=a22_0x45e9,_0x54b921=_0x3057f2();while(!![]){try{const _0x43fbcf=parseInt(_0x29104d(0x178))/0x1*(parseInt(_0x29104d(0x168))/0x2)+parseInt(_0x29104d(0x172))/0x3+-parseInt(_0x29104d(0x177))/0x4+-parseInt(_0x29104d(0x170))/0x5+-parseInt(_0x29104d(0x16d))/0x6+-parseInt(_0x29104d(0x16f))/0x7+parseInt(_0x29104d(0x16a))/0x8*(parseInt(_0x29104d(0x173))/0x9);if(_0x43fbcf===_0x1e618e)break;else _0x54b921['push'](_0x54b921['shift']());}catch(_0x84a1b6){_0x54b921['push'](_0x54b921['shift']());}}}(a22_0x3bf3,0x9c62d));import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function a22_0x3bf3(){const _0xaddbdb=['35037531QHCHEn','trim','Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','appCode','4106928YunptV','73gheTYR','str','Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','7238XJakMb','sdk-doc','8tFuErZ','#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档','read','4202982OxhhyW','code','4338964felANF','6125970OSLecB','dataset','166758qpjSwb'];a22_0x3bf3=function(){return _0xaddbdb;};return a22_0x3bf3();}const DEFAULT_MARKDOWN=a22_0x3b5461(0x16b);export function formatDatasetSdkMarkdown(_0x17ef57){const _0x425bcd=a22_0x3b5461,_0x7fb127=typeof _0x17ef57==='string'?_0x17ef57[_0x425bcd(0x174)]():'';return _0x7fb127||DEFAULT_MARKDOWN;}export const datasetSdkDoc={'service':a22_0x3b5461(0x171),'command':a22_0x3b5461(0x169),'description':a22_0x3b5461(0x175),'risk':a22_0x3b5461(0x16c),'flags':[{...CODE_FLAG,'description':a22_0x3b5461(0x17a)}],async 'execute'(_0x4da446){const _0x257a0a=a22_0x3b5461,_0x4aa0fd=_0x4da446[_0x257a0a(0x179)](_0x257a0a(0x16e)),_0x491516=await getDatasetSdkUsageDoc(_0x4aa0fd,_0x4da446[_0x257a0a(0x176)]);return{'ok':!![],'data':{'code':_0x4aa0fd,'appCode':_0x4da446['appCode'],'markdown':formatDatasetSdkMarkdown(_0x491516)}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x377951=a23_0x44dc;(function(_0x344481,_0x511de5){const _0x1b740b=a23_0x44dc,_0xcb1fbc=_0x344481();while(!![]){try{const _0x289694=parseInt(_0x1b740b(0x176))/0x1*(-parseInt(_0x1b740b(0x18c))/0x2)+-parseInt(_0x1b740b(0x1a2))/0x3*(-parseInt(_0x1b740b(0x181))/0x4)+-parseInt(_0x1b740b(0x180))/0x5+-parseInt(_0x1b740b(0x18a))/0x6+-parseInt(_0x1b740b(0x197))/0x7*(parseInt(_0x1b740b(0x1a4))/0x8)+-parseInt(_0x1b740b(0x19f))/0x9+parseInt(_0x1b740b(0x17a))/0xa;if(_0x289694===_0x511de5)break;else _0xcb1fbc['push'](_0xcb1fbc['shift']());}catch(_0x7f47a0){_0xcb1fbc['push'](_0xcb1fbc['shift']());}}}(a23_0x48b5,0xc2a3a));import a23_0x2ce35a from'chalk';function a23_0x48b5(){const _0x1df53c=['green','3753415Zdlzxb','4XktCPh','log','(none)','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','(missing)','defaultApp','\x20\x20auth\x20(effective):\x20','doctor','24390epLNdN','check','2ZPfkFX','\x20\x20runtimeDomain:\x20\x20\x20','(removed\x20—\x20cookie\x20auth\x20disabled)','accessKey','\x20\x20Config\x20Files','format','gray','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','(not\x20found)','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','Project','77756YFaClQ','✗\x20Invalid\x20JSON','red','currentApp','appCode','\x20\x20Auth','\x20\x20Merged\x20Config','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','6167853UNLkjs','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','(default)','1677777OhGKOP','\x20\x20─','968PhAIMI','locale','⚠\x20Empty\x20(treated\x20as\x20{})','platform','version','repeat','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','ClientAk','riskLevel','status','\x20(accessKey)','(set,\x20length=','padEnd','message','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','\x20doctor','bold','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','✓\x20Valid\x20JSON','arch','(no\x20file)','env','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','678932dsknCR','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Session\x20check:\x20\x20\x20','37010480gQbpOw','\x20\x20API\x20Endpoints','pageSize','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','\x20(legacy/compat\x20only)'];a23_0x48b5=function(){return _0x1df53c;};return a23_0x48b5();}import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';function a23_0x44dc(_0x1f0744,_0xf6c79d){_0x1f0744=_0x1f0744-0x160;const _0x48b57b=a23_0x48b5();let _0x44dcbe=_0x48b57b[_0x1f0744];return _0x44dcbe;}import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';async function execute(_0x53f581){const _0xcd53a3=a23_0x44dc,_0x2ccd21=getCliVersion(),_0x31fb43=buildConfigFromFlags({});await initGlobalEnvironment(_0x31fb43),console['log'](),console[_0xcd53a3(0x182)](a23_0x2ce35a[_0xcd53a3(0x16f)](CLI_BIN_NAME+_0xcd53a3(0x16e))),console[_0xcd53a3(0x182)](a23_0x2ce35a[_0xcd53a3(0x192)]('─'[_0xcd53a3(0x164)](0x32))),console['log'](_0xcd53a3(0x16d)+_0x2ccd21),console[_0xcd53a3(0x182)]('\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+process[_0xcd53a3(0x163)]),console[_0xcd53a3(0x182)](_0xcd53a3(0x1a0)+process[_0xcd53a3(0x162)]+'\x20'+process[_0xcd53a3(0x172)]),console[_0xcd53a3(0x182)](),console[_0xcd53a3(0x182)](a23_0x2ce35a[_0xcd53a3(0x16f)](_0xcd53a3(0x190))),console[_0xcd53a3(0x182)](a23_0x2ce35a[_0xcd53a3(0x192)]('\x20\x20─'['repeat'](0x1e)));const _0x4a50d7=getGlobalConfigPath(),_0x30f839=getProjectConfigPath();console[_0xcd53a3(0x182)](_0xcd53a3(0x165)+(_0x4a50d7||a23_0x2ce35a[_0xcd53a3(0x192)](_0xcd53a3(0x194)))),console[_0xcd53a3(0x182)](_0xcd53a3(0x193)+(_0x30f839||a23_0x2ce35a[_0xcd53a3(0x192)]('(not\x20found)'))),console[_0xcd53a3(0x182)](),console[_0xcd53a3(0x182)](a23_0x2ce35a[_0xcd53a3(0x16f)]('\x20\x20Config\x20JSON')),console['log'](a23_0x2ce35a[_0xcd53a3(0x192)](_0xcd53a3(0x1a3)['repeat'](0x1e)));const _0x85697a=(_0x5cd9a6,_0x40f8d0)=>{const _0x5a2c5b=_0xcd53a3;if(!_0x40f8d0){console[_0x5a2c5b(0x182)]('\x20\x20'+_0x5cd9a6['padEnd'](0x11)+'\x20'+a23_0x2ce35a['gray'](_0x5a2c5b(0x173)));return;}const _0xde23ae=inspectCliConfigJsonFile(_0x40f8d0);if(_0xde23ae[_0x5a2c5b(0x168)]==='ok')console[_0x5a2c5b(0x182)]('\x20\x20'+_0x5cd9a6[_0x5a2c5b(0x16b)](0x11)+'\x20'+a23_0x2ce35a[_0x5a2c5b(0x17f)](_0x5a2c5b(0x171)));else{if(_0xde23ae[_0x5a2c5b(0x168)]==='empty')console[_0x5a2c5b(0x182)]('\x20\x20'+_0x5cd9a6['padEnd'](0x11)+'\x20'+a23_0x2ce35a['yellow'](_0x5a2c5b(0x161)));else _0xde23ae[_0x5a2c5b(0x168)]==='missing'?console['log']('\x20\x20'+_0x5cd9a6[_0x5a2c5b(0x16b)](0x11)+'\x20'+a23_0x2ce35a[_0x5a2c5b(0x192)](_0x5a2c5b(0x186))):(console['log']('\x20\x20'+_0x5cd9a6[_0x5a2c5b(0x16b)](0x11)+'\x20'+a23_0x2ce35a[_0x5a2c5b(0x199)](_0x5a2c5b(0x198))),console[_0x5a2c5b(0x182)]('\x20\x20'+''[_0x5a2c5b(0x16b)](0x11)+'\x20'+a23_0x2ce35a['red'](_0xde23ae[_0x5a2c5b(0x16c)])));}};_0x85697a('Global',_0x4a50d7),_0x85697a(_0xcd53a3(0x196),_0x30f839),console[_0xcd53a3(0x182)](),console['log'](a23_0x2ce35a[_0xcd53a3(0x16f)](_0xcd53a3(0x19d))),console['log'](a23_0x2ce35a[_0xcd53a3(0x192)](_0xcd53a3(0x1a3)[_0xcd53a3(0x164)](0x1e))),console[_0xcd53a3(0x182)](_0xcd53a3(0x19e)+(_0x31fb43[_0xcd53a3(0x19b)]||a23_0x2ce35a[_0xcd53a3(0x199)]('(not\x20set)'))),console[_0xcd53a3(0x182)](_0xcd53a3(0x170)+_0x31fb43[_0xcd53a3(0x174)]);const _0x46165=isLegacyCompatConfigKey(_0xcd53a3(0x160))?a23_0x2ce35a[_0xcd53a3(0x192)](_0x31fb43[_0xcd53a3(0x160)]+_0xcd53a3(0x17e)):_0x31fb43[_0xcd53a3(0x160)];return console[_0xcd53a3(0x182)]('\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x46165),console[_0xcd53a3(0x182)](_0xcd53a3(0x17d)+(_0x31fb43[_0xcd53a3(0x187)]||a23_0x2ce35a[_0xcd53a3(0x192)](_0xcd53a3(0x183)))),console[_0xcd53a3(0x182)](_0xcd53a3(0x184)+(_0x31fb43[_0xcd53a3(0x19a)]||a23_0x2ce35a['gray'](_0xcd53a3(0x183)))),console['log'](_0xcd53a3(0x185)+(_0x31fb43[_0xcd53a3(0x191)]||a23_0x2ce35a['gray']('(default:\x20'+DEFAULT_CONFIG_VALUES[_0xcd53a3(0x191)]+')'))),console[_0xcd53a3(0x182)]('\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x31fb43[_0xcd53a3(0x17c)]??a23_0x2ce35a[_0xcd53a3(0x192)](_0xcd53a3(0x1a1)))),console[_0xcd53a3(0x182)]('\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20'+_0x31fb43[_0xcd53a3(0x167)]),console[_0xcd53a3(0x182)](_0xcd53a3(0x178)+_0x31fb43['verbose']),console['log'](_0xcd53a3(0x188)+AUTH_MODE[_0xcd53a3(0x166)]),console[_0xcd53a3(0x182)](_0xcd53a3(0x195)+(_0x31fb43['accessKey']?a23_0x2ce35a['green'](_0xcd53a3(0x16a)+_0x31fb43[_0xcd53a3(0x18f)]['length']+')'):a23_0x2ce35a[_0xcd53a3(0x192)]('(none)'))),console[_0xcd53a3(0x182)](),console[_0xcd53a3(0x182)](a23_0x2ce35a['bold'](_0xcd53a3(0x17b))),console[_0xcd53a3(0x182)](a23_0x2ce35a[_0xcd53a3(0x192)](_0xcd53a3(0x1a3)[_0xcd53a3(0x164)](0x1e))),console[_0xcd53a3(0x182)](_0xcd53a3(0x175)+getApiDomain()),console[_0xcd53a3(0x182)]('\x20\x20userDomain:\x20\x20\x20\x20\x20\x20'+getUserDomain()),console[_0xcd53a3(0x182)](_0xcd53a3(0x18d)+getRuntimeDomain()),console[_0xcd53a3(0x182)](),console[_0xcd53a3(0x182)](a23_0x2ce35a[_0xcd53a3(0x16f)](_0xcd53a3(0x19c))),console[_0xcd53a3(0x182)](a23_0x2ce35a[_0xcd53a3(0x192)](_0xcd53a3(0x1a3)[_0xcd53a3(0x164)](0x1e))),console[_0xcd53a3(0x182)](_0xcd53a3(0x177)+a23_0x2ce35a[_0xcd53a3(0x17f)](AUTH_MODE[_0xcd53a3(0x166)]+_0xcd53a3(0x169))),console['log'](_0xcd53a3(0x179)+a23_0x2ce35a['gray'](_0xcd53a3(0x18e))),console['log'](),{'ok':!![]};}export const doctorDefinition={'service':a23_0x377951(0x189),'command':a23_0x377951(0x18b),'description':'Diagnose\x20CLI\x20configuration\x20and\x20environment','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a24_0x576c6e=a24_0x141b;(function(_0x4cf7ef,_0x218f07){const _0xfd6d10=a24_0x141b,_0x8d727b=_0x4cf7ef();while(!![]){try{const _0x3041b2=-parseInt(_0xfd6d10(0x121))/0x1+parseInt(_0xfd6d10(0x12d))/0x2+parseInt(_0xfd6d10(0x106))/0x3+-parseInt(_0xfd6d10(0x10d))/0x4+parseInt(_0xfd6d10(0xfd))/0x5*(parseInt(_0xfd6d10(0x11a))/0x6)+-parseInt(_0xfd6d10(0x124))/0x7+-parseInt(_0xfd6d10(0x100))/0x8*(-parseInt(_0xfd6d10(0x11c))/0x9);if(_0x3041b2===_0x218f07)break;else _0x8d727b['push'](_0x8d727b['shift']());}catch(_0x2f6119){_0x8d727b['push'](_0x8d727b['shift']());}}}(a24_0x1870,0xb6b89));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';function a24_0x141b(_0x3273d9,_0x2437f1){_0x3273d9=_0x3273d9-0xf6;const _0x187012=a24_0x1870();let _0x141b40=_0x187012[_0x3273d9];return _0x141b40;}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_0x576c6e(0x128),'description':'App\x20code\x20for\x20the\x20project'},{'name':a24_0x576c6e(0x119),'type':a24_0x576c6e(0x128),'description':a24_0x576c6e(0x135)+DEFAULT_CONFIG_VALUES[a24_0x576c6e(0x119)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a24_0x576c6e(0xf9),'type':a24_0x576c6e(0x126),'description':a24_0x576c6e(0x12e)+PRODUCT_CONFIG['newConfigFileName']+')\x20instead\x20of\x20project','default':![]},{'name':'yes','type':a24_0x576c6e(0x126),'description':a24_0x576c6e(0x113),'default':![]}];export const initImportFlagDefs=[{'name':a24_0x576c6e(0x132),'type':'string','description':a24_0x576c6e(0x101),'required':!![]},{'name':a24_0x576c6e(0x111),'type':a24_0x576c6e(0x128),'description':'Override\x20imported\x20default\x20appcode'},{'name':a24_0x576c6e(0x119),'type':a24_0x576c6e(0x128),'description':a24_0x576c6e(0x107),'enum':[...RUNTIME_ENV_VALUES]},{'name':a24_0x576c6e(0xf9),'type':'boolean','description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG['newConfigFileName']+a24_0x576c6e(0x138),'default':![]},{'name':a24_0x576c6e(0x117),'type':a24_0x576c6e(0x126),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x75e721){const _0x2a4dbb=a24_0x576c6e,_0x1d656b=isNonInteractiveMode(_0x75e721),_0x4d6c69=_0x75e721[_0x2a4dbb(0xf9)]?_0x2a4dbb(0xf9):_0x2a4dbb(0x104),_0x4d672d=resolveWriteConfigPath(_0x4d6c69);try{_0x1d656b?await runNonInteractive(_0x75e721,_0x4d672d):await runInteractive(_0x75e721,_0x4d672d);}catch(_0x44ec57){if(_0x44ec57 instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0x44ec57;}}export async function runInitImport(_0x240bbf){const _0x5c15f3=a24_0x576c6e,_0x2194e5=_0x240bbf[_0x5c15f3(0xf9)]?'global':_0x5c15f3(0x104),_0x2610a3=resolveWriteConfigPath(_0x2194e5);await runFromImport(_0x240bbf,_0x2610a3);}const RUNTIME_IRRELEVANT_KEYS=new Set([a24_0x576c6e(0x112)]);async function runFromImport(_0x2aa09b,_0x160da1){const _0x42186f=a24_0x576c6e,_0x4c6dc6=resolveFilePath(_0x2aa09b[_0x42186f(0x132)]);if(!existsSync(_0x4c6dc6))throw CliErrors[_0x42186f(0x11f)](_0x42186f(0x10f)+_0x4c6dc6);const _0x3e3f30=readSourceFile(_0x4c6dc6),_0x424b6b=convertToRuntimeConfig(_0x3e3f30);_0x2aa09b[_0x42186f(0x111)]&&(_0x424b6b['appcode']=String(_0x2aa09b['appcode']));_0x2aa09b[_0x42186f(0x119)]&&(_0x424b6b['env']=resolveInitEnv(_0x2aa09b));if(!_0x424b6b[_0x42186f(0x111)])throw CliErrors[_0x42186f(0x11f)](_0x42186f(0x12a),_0x42186f(0xfa));await writeInitConfig(_0x160da1,_0x424b6b,_0x2aa09b),console[_0x42186f(0x123)](_0x42186f(0x109)+_0x4c6dc6),console[_0x42186f(0x123)](_0x42186f(0xf7)+_0x160da1),console[_0x42186f(0x123)]('\x20\x20appcode:\x20'+_0x424b6b[_0x42186f(0x111)]);if(_0x424b6b[_0x42186f(0x10b)])console[_0x42186f(0x123)](_0x42186f(0x116)+_0x424b6b[_0x42186f(0x10b)]);}function convertToRuntimeConfig(_0xf19b41){const _0xf5881f=a24_0x576c6e;if(_0xf19b41[_0xf5881f(0x134)]&&typeof _0xf19b41[_0xf5881f(0x134)]===_0xf5881f(0x11b))throw CliErrors[_0xf5881f(0x11f)](_0xf5881f(0x102),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x5f0b2a={};for(const _0x2120a9 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0xf19b41[_0x2120a9]!==undefined&&(_0x5f0b2a[_0x2120a9]=_0xf19b41[_0x2120a9]);}return!_0x5f0b2a['riskLevel']&&(_0x5f0b2a[_0xf5881f(0x120)]=DEFAULT_CONFIG_VALUES[_0xf5881f(0x120)]),_0x5f0b2a;}async function runNonInteractive(_0xdcccd5,_0x32bb8d){const _0x22ebc2=a24_0x576c6e,_0x42a819=_0xdcccd5[_0x22ebc2(0x111)];if(!_0x42a819)throw CliErrors[_0x22ebc2(0xfb)](_0x22ebc2(0x111),_0x22ebc2(0x12f)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x527403=resolveInitEnv(_0xdcccd5);await writeInitConfig(_0x32bb8d,{'appcode':_0x42a819,'env':_0x527403},_0xdcccd5),console[_0x22ebc2(0x123)]('Initialized\x20'+_0x32bb8d),console[_0x22ebc2(0x123)](_0x22ebc2(0x139)+_0x42a819),console[_0x22ebc2(0x123)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x527403);}async function runInteractive(_0xb85e6,_0x4a8ca9){const _0x146ffe=a24_0x576c6e,_0x320c31=loadExisting(_0x4a8ca9),_0x353a9a=typeof _0x320c31?.[_0x146ffe(0x111)]===_0x146ffe(0x128)?_0x320c31[_0x146ffe(0x111)]:'',_0x8adc29=resolveInitEnv(_0xb85e6);console[_0x146ffe(0x123)](CLI_BIN_NAME+_0x146ffe(0x12b)+PRODUCT_CONFIG[_0x146ffe(0x115)]+'\x0a');if(existsSync(_0x4a8ca9)&&!_0xb85e6['yes']){const _0x440446=await promptYesNo('File\x20'+_0x4a8ca9+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x440446){console[_0x146ffe(0x123)](_0x146ffe(0x11e));return;}}const _0x55d7bb=typeof _0xb85e6[_0x146ffe(0x111)]===_0x146ffe(0x128)?_0xb85e6[_0x146ffe(0x111)]['trim']():'';let _0x3c6ba3=_0x55d7bb;!_0x3c6ba3&&(_0x3c6ba3=await promptInput(_0x146ffe(0x133),_0x353a9a));if(!_0x3c6ba3['trim']())throw CliErrors[_0x146ffe(0x11f)](_0x146ffe(0x114));await writeInitConfig(_0x4a8ca9,{'appcode':_0x3c6ba3['trim'](),'env':_0x8adc29},_0xb85e6),console[_0x146ffe(0x123)]('\x0aInitialized\x20'+_0x4a8ca9),console['log'](_0x146ffe(0x139)+_0x3c6ba3['trim']()),console[_0x146ffe(0x123)](_0x146ffe(0x11d)+_0x8adc29);}async function writeInitConfig(_0x24177e,_0xd4a635,_0x228ac6){const _0x1a2d11=a24_0x576c6e;let _0xa8e156={};existsSync(_0x24177e)&&!_0x228ac6[_0x1a2d11(0x117)]&&(_0xa8e156=readConfigFile(_0x24177e));for(const [_0x497c3f,_0x4a3fe4]of Object[_0x1a2d11(0x103)](_0xd4a635)){_0x4a3fe4!==undefined&&(_0xa8e156[_0x497c3f]=_0x4a3fe4);}if(_0xa8e156[_0x1a2d11(0x137)])delete _0xa8e156[_0x1a2d11(0x137)];writeConfigFile(_0x24177e,_0xa8e156);}class AbortPrompt extends Error{constructor(){const _0x2b5aa8=a24_0x576c6e;super(_0x2b5aa8(0x108)),this[_0x2b5aa8(0x125)]=_0x2b5aa8(0x118);}}function createSafeRl(){const _0x20c70a=a24_0x576c6e,_0x43e55e=createInterface({'input':process[_0x20c70a(0xff)],'output':process[_0x20c70a(0xf8)]});let _0xf5b102;const _0x3875c4=new Promise((_0x4e86b9,_0x145b5f)=>{const _0x259607=_0x20c70a;_0xf5b102=()=>{const _0x1020f9=a24_0x141b;_0xf5b102&&(_0x43e55e[_0x1020f9(0x105)]('SIGINT',_0xf5b102),_0xf5b102=undefined);try{_0x43e55e['close']();}catch{}_0x145b5f(new AbortPrompt());},_0x43e55e[_0x259607(0x129)]('SIGINT',_0xf5b102);}),_0x540a42=()=>{const _0x3e6a8b=_0x20c70a;_0xf5b102&&(_0x43e55e[_0x3e6a8b(0x105)](_0x3e6a8b(0x127),_0xf5b102),_0xf5b102=undefined);try{_0x43e55e['close']();}catch{}};return{'rl':_0x43e55e,'abortPromise':_0x3875c4,'disposeSuccess':_0x540a42};}async function promptInput(_0x8b5b2d,_0x3987f6){const _0xb7ef90=a24_0x576c6e,{rl:_0x6b70d1,abortPromise:_0x350770,disposeSuccess:_0x29cfe0}=createSafeRl(),_0x3b68ba=new Promise(_0x326859=>{const _0x1cf82b=a24_0x141b,_0x3e9919=_0x3987f6?'\x20\x20'+_0x8b5b2d+'\x20('+_0x3987f6+_0x1cf82b(0x122):'\x20\x20'+_0x8b5b2d+':\x20';_0x6b70d1[_0x1cf82b(0x12c)](_0x3e9919,_0x2b64fd=>{const _0x29ea64=_0x1cf82b;_0x29cfe0(),_0x326859(_0x2b64fd[_0x29ea64(0xfe)]()||_0x3987f6);});});return Promise[_0xb7ef90(0x131)]([_0x3b68ba,_0x350770]);}async function promptYesNo(_0x597852,_0x3651ad){const {rl:_0x5b59b8,abortPromise:_0x5b10fb,disposeSuccess:_0x1d2125}=createSafeRl(),_0x53dabf=new Promise(_0x140ac0=>{const _0x2626c1=a24_0x141b,_0x193688=_0x3651ad?_0x2626c1(0xf6):_0x2626c1(0x10c);_0x5b59b8[_0x2626c1(0x12c)]('\x20\x20'+_0x597852+'\x20'+_0x193688+':\x20',_0x355e11=>{const _0x38db0e=_0x2626c1;_0x1d2125();const _0x9b4bb0=_0x355e11[_0x38db0e(0xfe)]()[_0x38db0e(0x110)]();if(_0x9b4bb0==='y'||_0x9b4bb0===_0x38db0e(0x117))_0x140ac0(!![]);else{if(_0x9b4bb0==='n'||_0x9b4bb0==='no')_0x140ac0(![]);else _0x140ac0(_0x3651ad);}});});return Promise['race']([_0x53dabf,_0x5b10fb]);}function loadExisting(_0x59361){if(!existsSync(_0x59361))return null;return readConfigFile(_0x59361);}function resolveFilePath(_0x312004){const _0x26725c=a24_0x576c6e;return isAbsolute(_0x312004)?_0x312004:resolve(process[_0x26725c(0x10e)](),_0x312004);}function readSourceFile(_0x448328){const _0x5b53cb=a24_0x576c6e;try{const _0x155d2c=readFileSync(_0x448328,{'encoding':_0x5b53cb(0x136)});return JSON['parse'](_0x155d2c);}catch(_0x203272){throw CliErrors[_0x5b53cb(0x11f)](_0x5b53cb(0xfc)+_0x203272['message']);}}function resolveInitEnv(_0x38dbee){const _0x3c4c51=a24_0x576c6e,_0x1b103c=_0x38dbee['env'];if(_0x1b103c===undefined||_0x1b103c==='')return DEFAULT_CONFIG_VALUES[_0x3c4c51(0x119)];if(!RUNTIME_ENV_VALUES['includes'](_0x1b103c))throw CliErrors[_0x3c4c51(0x11f)]('Invalid\x20env\x20\x22'+_0x1b103c+_0x3c4c51(0x130)+RUNTIME_ENV_VALUES[_0x3c4c51(0x10a)](',\x20'));return _0x1b103c;}function a24_0x1870(){const _0x3df82a=['\x20init\x20—\x20Create\x20','question','2750072vTfvcQ','Write\x20to\x20global\x20(~/','Usage:\x20','\x22.\x20Allowed:\x20','race','file','App\x20code','apps','Target\x20environment\x20(default\x20','utf8','app',')\x20instead\x20of\x20project','\x20\x20appcode:\x20','[Y/n]','\x20\x20config:\x20\x20','stdout','global','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`.','flagMissing','Failed\x20to\x20parse\x20source\x20file:\x20','3763855CNKkdZ','trim','stdin','13064rtfNVx','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','entries','project','removeListener','1515036vuBYFv','Override\x20imported\x20default\x20env','User\x20aborted\x20prompt','Imported\x20from\x20','join','defaultApp','[y/N]','5909024qDFDxM','cwd','Source\x20file\x20not\x20found:\x20','toLowerCase','appcode','apiDir','Skip\x20confirmation\x20when\x20overwriting','App\x20code\x20cannot\x20be\x20empty.','newConfigFileName','\x20\x20default:\x20','yes','AbortPrompt','env','6LFlMTJ','object','3735MmpKbS','\x20\x20env:\x20\x20\x20\x20\x20','Aborted.','validation','riskLevel','885925Gmjzws','):\x20','log','1392356gOOlTQ','name','boolean','SIGINT','string','once','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.'];a24_0x1870=function(){return _0x3df82a;};return a24_0x1870();}
|
|
1
|
+
const a24_0xa3bb58=a24_0x1e72;(function(_0x3629b0,_0x1d6bc9){const _0x327137=a24_0x1e72,_0x411146=_0x3629b0();while(!![]){try{const _0x2bd6be=-parseInt(_0x327137(0x195))/0x1+parseInt(_0x327137(0x1a4))/0x2*(-parseInt(_0x327137(0x192))/0x3)+-parseInt(_0x327137(0x196))/0x4*(parseInt(_0x327137(0x182))/0x5)+parseInt(_0x327137(0x174))/0x6+-parseInt(_0x327137(0x183))/0x7+parseInt(_0x327137(0x16b))/0x8+parseInt(_0x327137(0x16a))/0x9;if(_0x2bd6be===_0x1d6bc9)break;else _0x411146['push'](_0x411146['shift']());}catch(_0x41a22e){_0x411146['push'](_0x411146['shift']());}}}(a24_0x36c3,0x60f89));import{existsSync,readFileSync}from'node:fs';function a24_0x1e72(_0x4ae0fb,_0x4ca9e7){_0x4ae0fb=_0x4ae0fb-0x162;const _0x36c344=a24_0x36c3();let _0x1e72e9=_0x36c344[_0x4ae0fb];return _0x1e72e9;}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':a24_0xa3bb58(0x19e),'type':a24_0xa3bb58(0x18c),'description':a24_0xa3bb58(0x185)},{'name':a24_0xa3bb58(0x191),'type':a24_0xa3bb58(0x18c),'description':a24_0xa3bb58(0x19d)+DEFAULT_CONFIG_VALUES[a24_0xa3bb58(0x191)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a24_0xa3bb58(0x193),'type':'boolean','description':a24_0xa3bb58(0x169)+PRODUCT_CONFIG['newConfigFileName']+a24_0xa3bb58(0x181),'default':![]},{'name':a24_0xa3bb58(0x186),'type':a24_0xa3bb58(0x17e),'description':a24_0xa3bb58(0x180),'default':![]}];export const initImportFlagDefs=[{'name':a24_0xa3bb58(0x16f),'type':a24_0xa3bb58(0x18c),'description':a24_0xa3bb58(0x1a2),'required':!![]},{'name':a24_0xa3bb58(0x19e),'type':a24_0xa3bb58(0x18c),'description':a24_0xa3bb58(0x17f)},{'name':a24_0xa3bb58(0x191),'type':a24_0xa3bb58(0x18c),'description':a24_0xa3bb58(0x1a1),'enum':[...RUNTIME_ENV_VALUES]},{'name':a24_0xa3bb58(0x193),'type':a24_0xa3bb58(0x17e),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a24_0xa3bb58(0x17d)]+')\x20instead\x20of\x20project','default':![]},{'name':'yes','type':a24_0xa3bb58(0x17e),'description':a24_0xa3bb58(0x180),'default':![]}];export async function runInit(_0x1ead5a){const _0x369fc3=a24_0xa3bb58,_0x4c4ac9=isNonInteractiveMode(_0x1ead5a),_0x25f498=_0x1ead5a[_0x369fc3(0x193)]?_0x369fc3(0x193):'project',_0x23dec7=resolveWriteConfigPath(_0x25f498);try{_0x4c4ac9?await runNonInteractive(_0x1ead5a,_0x23dec7):await runInteractive(_0x1ead5a,_0x23dec7);}catch(_0x28a439){if(_0x28a439 instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0x28a439;}}function a24_0x36c3(){const _0x28da1f=['defaultApp','close','Failed\x20to\x20parse\x20source\x20file:\x20','message','Target\x20environment\x20(default\x20','appcode','Aborted.','validation','Override\x20imported\x20default\x20env','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','log','103798xuGuum','\x20\x20default:\x20','apiDir','join','race','Initialized\x20','object','riskLevel','once','Write\x20to\x20global\x20(~/','13057326UsbNMd','4816920RqUvrY','\x20init\x20—\x20Create\x20','SIGINT','stdin','file','Imported\x20from\x20','[y/N]','User\x20aborted\x20prompt','\x20\x20env:\x20\x20\x20\x20\x20','1537716zZuHVv','project','app','\x20\x20appcode:\x20','trim','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','utf8','name','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`.','newConfigFileName','boolean','Override\x20imported\x20default\x20appcode','Skip\x20confirmation\x20when\x20overwriting',')\x20instead\x20of\x20project','10XceCWT','5003474qfmeQM','\x22.\x20Allowed:\x20','App\x20code\x20for\x20the\x20project','yes','\x0aInitialized\x20','):\x20','question','flagMissing','App\x20code','string','stdout','Invalid\x20env\x20\x22','cwd','removeListener','env','15LRbvSd','global','parse','621423IYHgTD','632644rrkHjf','entries','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.'];a24_0x36c3=function(){return _0x28da1f;};return a24_0x36c3();}export async function runInitImport(_0x47f73a){const _0x6255c8=a24_0xa3bb58,_0x40f957=_0x47f73a[_0x6255c8(0x193)]?'global':_0x6255c8(0x175),_0x4f75b6=resolveWriteConfigPath(_0x40f957);await runFromImport(_0x47f73a,_0x4f75b6);}const RUNTIME_IRRELEVANT_KEYS=new Set([a24_0xa3bb58(0x162)]);async function runFromImport(_0x4686b1,_0x2ae660){const _0x388179=a24_0xa3bb58,_0xc64547=resolveFilePath(_0x4686b1[_0x388179(0x16f)]);if(!existsSync(_0xc64547))throw CliErrors[_0x388179(0x1a0)]('Source\x20file\x20not\x20found:\x20'+_0xc64547);const _0x676d5c=readSourceFile(_0xc64547),_0x280f7c=convertToRuntimeConfig(_0x676d5c);_0x4686b1[_0x388179(0x19e)]&&(_0x280f7c[_0x388179(0x19e)]=String(_0x4686b1[_0x388179(0x19e)]));_0x4686b1['env']&&(_0x280f7c[_0x388179(0x191)]=resolveInitEnv(_0x4686b1));if(!_0x280f7c[_0x388179(0x19e)])throw CliErrors[_0x388179(0x1a0)]('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.',_0x388179(0x17c));await writeInitConfig(_0x2ae660,_0x280f7c,_0x4686b1),console[_0x388179(0x1a3)](_0x388179(0x170)+_0xc64547),console[_0x388179(0x1a3)]('\x20\x20config:\x20\x20'+_0x2ae660),console['log'](_0x388179(0x177)+_0x280f7c[_0x388179(0x19e)]);if(_0x280f7c[_0x388179(0x199)])console[_0x388179(0x1a3)](_0x388179(0x1a5)+_0x280f7c[_0x388179(0x199)]);}function convertToRuntimeConfig(_0xfdf93a){const _0xc4e488=a24_0xa3bb58;if(_0xfdf93a['apps']&&typeof _0xfdf93a['apps']===_0xc4e488(0x166))throw CliErrors[_0xc4e488(0x1a0)](_0xc4e488(0x198),_0xc4e488(0x179));const _0x2e3470={};for(const _0x12265e of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0xfdf93a[_0x12265e]!==undefined&&(_0x2e3470[_0x12265e]=_0xfdf93a[_0x12265e]);}return!_0x2e3470[_0xc4e488(0x167)]&&(_0x2e3470[_0xc4e488(0x167)]=DEFAULT_CONFIG_VALUES[_0xc4e488(0x167)]),_0x2e3470;}async function runNonInteractive(_0x2427f8,_0x2eee86){const _0x55cf06=a24_0xa3bb58,_0x32dd6d=_0x2427f8[_0x55cf06(0x19e)];if(!_0x32dd6d)throw CliErrors[_0x55cf06(0x18a)]('appcode','Usage:\x20'+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x5c388e=resolveInitEnv(_0x2427f8);await writeInitConfig(_0x2eee86,{'appcode':_0x32dd6d,'env':_0x5c388e},_0x2427f8),console[_0x55cf06(0x1a3)](_0x55cf06(0x165)+_0x2eee86),console[_0x55cf06(0x1a3)](_0x55cf06(0x177)+_0x32dd6d),console[_0x55cf06(0x1a3)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x5c388e);}async function runInteractive(_0x20c48a,_0x3d1db7){const _0x3ebbd8=a24_0xa3bb58,_0x20f7bc=loadExisting(_0x3d1db7),_0x1554d3=typeof _0x20f7bc?.[_0x3ebbd8(0x19e)]===_0x3ebbd8(0x18c)?_0x20f7bc[_0x3ebbd8(0x19e)]:'',_0xa14766=resolveInitEnv(_0x20c48a);console[_0x3ebbd8(0x1a3)](CLI_BIN_NAME+_0x3ebbd8(0x16c)+PRODUCT_CONFIG[_0x3ebbd8(0x17d)]+'\x0a');if(existsSync(_0x3d1db7)&&!_0x20c48a[_0x3ebbd8(0x186)]){const _0x2599fe=await promptYesNo('File\x20'+_0x3d1db7+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x2599fe){console[_0x3ebbd8(0x1a3)](_0x3ebbd8(0x19f));return;}}const _0x398777=typeof _0x20c48a[_0x3ebbd8(0x19e)]==='string'?_0x20c48a[_0x3ebbd8(0x19e)]['trim']():'';let _0x4fd85c=_0x398777;!_0x4fd85c&&(_0x4fd85c=await promptInput(_0x3ebbd8(0x18b),_0x1554d3));if(!_0x4fd85c[_0x3ebbd8(0x178)]())throw CliErrors[_0x3ebbd8(0x1a0)]('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x3d1db7,{'appcode':_0x4fd85c[_0x3ebbd8(0x178)](),'env':_0xa14766},_0x20c48a),console['log'](_0x3ebbd8(0x187)+_0x3d1db7),console[_0x3ebbd8(0x1a3)](_0x3ebbd8(0x177)+_0x4fd85c['trim']()),console['log'](_0x3ebbd8(0x173)+_0xa14766);}async function writeInitConfig(_0x12f62c,_0x2f8633,_0x496457){const _0x4b1fbb=a24_0xa3bb58;let _0x14aafb={};existsSync(_0x12f62c)&&!_0x496457['yes']&&(_0x14aafb=readConfigFile(_0x12f62c));for(const [_0x1deef0,_0x4ad518]of Object[_0x4b1fbb(0x197)](_0x2f8633)){_0x4ad518!==undefined&&(_0x14aafb[_0x1deef0]=_0x4ad518);}if(_0x14aafb[_0x4b1fbb(0x176)])delete _0x14aafb['app'];writeConfigFile(_0x12f62c,_0x14aafb);}class AbortPrompt extends Error{constructor(){const _0x56a9a4=a24_0xa3bb58;super(_0x56a9a4(0x172)),this[_0x56a9a4(0x17b)]='AbortPrompt';}}function createSafeRl(){const _0x28a7c9=a24_0xa3bb58,_0x144ac6=createInterface({'input':process[_0x28a7c9(0x16e)],'output':process[_0x28a7c9(0x18d)]});let _0x37de47;const _0x582f73=new Promise((_0xd5e75c,_0x393c5f)=>{const _0x15d633=_0x28a7c9;_0x37de47=()=>{const _0x46f31f=a24_0x1e72;_0x37de47&&(_0x144ac6[_0x46f31f(0x190)]('SIGINT',_0x37de47),_0x37de47=undefined);try{_0x144ac6[_0x46f31f(0x19a)]();}catch{}_0x393c5f(new AbortPrompt());},_0x144ac6[_0x15d633(0x168)](_0x15d633(0x16d),_0x37de47);}),_0x3c1abb=()=>{const _0x523507=_0x28a7c9;_0x37de47&&(_0x144ac6['removeListener'](_0x523507(0x16d),_0x37de47),_0x37de47=undefined);try{_0x144ac6['close']();}catch{}};return{'rl':_0x144ac6,'abortPromise':_0x582f73,'disposeSuccess':_0x3c1abb};}async function promptInput(_0x202d31,_0x1d9925){const _0x2af350=a24_0xa3bb58,{rl:_0x307a27,abortPromise:_0x5739c8,disposeSuccess:_0x5e062c}=createSafeRl(),_0x195412=new Promise(_0x30e66c=>{const _0x5e3311=a24_0x1e72,_0x1d7121=_0x1d9925?'\x20\x20'+_0x202d31+'\x20('+_0x1d9925+_0x5e3311(0x188):'\x20\x20'+_0x202d31+':\x20';_0x307a27[_0x5e3311(0x189)](_0x1d7121,_0x546b22=>{const _0x4c79fc=_0x5e3311;_0x5e062c(),_0x30e66c(_0x546b22[_0x4c79fc(0x178)]()||_0x1d9925);});});return Promise[_0x2af350(0x164)]([_0x195412,_0x5739c8]);}async function promptYesNo(_0x2757e9,_0x1466ec){const _0x123e99=a24_0xa3bb58,{rl:_0x1033e4,abortPromise:_0x1d929f,disposeSuccess:_0x4bd78a}=createSafeRl(),_0x3f2d9a=new Promise(_0x57684a=>{const _0x1a4161=a24_0x1e72,_0x155a8f=_0x1466ec?'[Y/n]':_0x1a4161(0x171);_0x1033e4[_0x1a4161(0x189)]('\x20\x20'+_0x2757e9+'\x20'+_0x155a8f+':\x20',_0x19f4b4=>{const _0x56ca83=_0x1a4161;_0x4bd78a();const _0x4fdf06=_0x19f4b4[_0x56ca83(0x178)]()['toLowerCase']();if(_0x4fdf06==='y'||_0x4fdf06===_0x56ca83(0x186))_0x57684a(!![]);else{if(_0x4fdf06==='n'||_0x4fdf06==='no')_0x57684a(![]);else _0x57684a(_0x1466ec);}});});return Promise[_0x123e99(0x164)]([_0x3f2d9a,_0x1d929f]);}function loadExisting(_0xc8ed5a){if(!existsSync(_0xc8ed5a))return null;return readConfigFile(_0xc8ed5a);}function resolveFilePath(_0x425663){const _0x484dcd=a24_0xa3bb58;return isAbsolute(_0x425663)?_0x425663:resolve(process[_0x484dcd(0x18f)](),_0x425663);}function readSourceFile(_0xc39847){const _0x46e757=a24_0xa3bb58;try{const _0x48542e=readFileSync(_0xc39847,{'encoding':_0x46e757(0x17a)});return JSON[_0x46e757(0x194)](_0x48542e);}catch(_0x2db9c4){throw CliErrors[_0x46e757(0x1a0)](_0x46e757(0x19b)+_0x2db9c4[_0x46e757(0x19c)]);}}function resolveInitEnv(_0x11cca8){const _0xaf83d8=a24_0xa3bb58,_0x5557c8=_0x11cca8['env'];if(_0x5557c8===undefined||_0x5557c8==='')return DEFAULT_CONFIG_VALUES[_0xaf83d8(0x191)];if(!RUNTIME_ENV_VALUES['includes'](_0x5557c8))throw CliErrors[_0xaf83d8(0x1a0)](_0xaf83d8(0x18e)+_0x5557c8+_0xaf83d8(0x184)+RUNTIME_ENV_VALUES[_0xaf83d8(0x163)](',\x20'));return _0x5557c8;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a25_0x200b4a=a25_0x498d;(function(_0x564262,_0x1c8d51){const _0x3aa647=a25_0x498d,_0x4acc70=_0x564262();while(!![]){try{const _0x27df44=parseInt(_0x3aa647(0x201))/0x1*(parseInt(_0x3aa647(0x1f4))/0x2)+parseInt(_0x3aa647(0x211))/0x3+parseInt(_0x3aa647(0x1f2))/0x4*(parseInt(_0x3aa647(0x1f9))/0x5)+parseInt(_0x3aa647(0x217))/0x6+-parseInt(_0x3aa647(0x219))/0x7*(parseInt(_0x3aa647(0x20a))/0x8)+-parseInt(_0x3aa647(0x1e0))/0x9*(parseInt(_0x3aa647(0x21d))/0xa)+-parseInt(_0x3aa647(0x1e8))/0xb;if(_0x27df44===_0x1c8d51)break;else _0x4acc70['push'](_0x4acc70['shift']());}catch(_0x5ea9f4){_0x4acc70['push'](_0x4acc70['shift']());}}}(a25_0x8490,0x78c3d));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':'title','type':'string','required':!![],'description':a25_0x200b4a(0x212)},FILE_FLAG={'name':a25_0x200b4a(0x1e4),'type':a25_0x200b4a(0x1eb),'required':!![],'description':a25_0x200b4a(0x1f0)},QUERY_FLAG={'name':a25_0x200b4a(0x210),'type':a25_0x200b4a(0x1eb),'required':!![],'description':a25_0x200b4a(0x1fc)},TOPK_FLAG={'name':a25_0x200b4a(0x1ec),'type':a25_0x200b4a(0x1e3),'description':a25_0x200b4a(0x224)};function readKnowledgeFile(_0x4231b2){const _0x5d32c3=a25_0x200b4a;if(!_0x4231b2)throw CliErrors[_0x5d32c3(0x1ef)](_0x5d32c3(0x209));if(!existsSync(_0x4231b2))throw CliErrors['validation']('File\x20not\x20found:\x20'+_0x4231b2);if(!statSync(_0x4231b2)[_0x5d32c3(0x1e7)]())throw CliErrors['validation'](_0x5d32c3(0x21c)+_0x4231b2);return readFileSync(_0x4231b2,_0x5d32c3(0x21f));}function a25_0x498d(_0x187b23,_0x5d1bd0){_0x187b23=_0x187b23-0x1e0;const _0x8490ef=a25_0x8490();let _0x498da9=_0x8490ef[_0x187b23];return _0x498da9;}function summarizePersonalItem(_0x1e5774){const _0x2ae40d=a25_0x200b4a;return{'id':_0x1e5774['id'],'title':_0x1e5774[_0x2ae40d(0x204)],'version':_0x1e5774[_0x2ae40d(0x1e1)],'ragStatus':_0x1e5774[_0x2ae40d(0x207)],'ragErrorMessage':_0x1e5774['ragErrorMessage'],'updateTime':_0x1e5774['updateTime']};}function detailPersonalItem(_0x5a4352){const _0x30d109=a25_0x200b4a;return{'id':_0x5a4352['id'],'appCode':_0x5a4352[_0x30d109(0x214)],'scope':_0x5a4352[_0x30d109(0x21a)],'userId':_0x5a4352[_0x30d109(0x206)],'title':_0x5a4352[_0x30d109(0x204)],'content':_0x5a4352[_0x30d109(0x200)]??'','version':_0x5a4352[_0x30d109(0x1e1)],'ragStatus':_0x5a4352[_0x30d109(0x207)],'ragErrorMessage':_0x5a4352['ragErrorMessage'],'createTime':_0x5a4352[_0x30d109(0x1fe)],'updateTime':_0x5a4352['updateTime']};}function summarizeSearchHit(_0x11b269){const _0x5a8555=a25_0x200b4a;return{'scope':_0x11b269['scope'],'docId':_0x11b269[_0x5a8555(0x1ee)],'score':_0x11b269[_0x5a8555(0x1ea)],'weightedScore':_0x11b269[_0x5a8555(0x1fb)],'content':_0x11b269[_0x5a8555(0x200)],'metadata':_0x11b269[_0x5a8555(0x222)]};}function readTopK(_0x4c6895){const _0x4833df=a25_0x200b4a,_0x3b4bee=_0x4c6895[_0x4833df(0x223)](_0x4833df(0x1ec));if(_0x3b4bee===undefined||_0x3b4bee===null||_0x3b4bee==='')return undefined;const _0x230456=_0x4c6895[_0x4833df(0x1f3)]('topk');if(!Number['isFinite'](_0x230456)||_0x230456<0x1)throw CliErrors[_0x4833df(0x1ef)]('--topk\x20must\x20be\x20a\x20positive\x20number.');return _0x230456;}function a25_0x8490(){const _0xc01216=['410KmqeDl','build','utf8','write','Personal\x20knowledge-base\x20entry\x20ID','metadata','flag','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','154863cQvWbW','version','str','number','file','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','search','isFile','11691966NpHdNx','read','score','string','topk','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','docId','validation','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','/client/knowledge-base/personal/create','3880204uUnoYF','num','40uisGZH','/update','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','/client/knowledge-base/personal/','bool','5hEDAjU','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','weightedScore','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','Search\x20query\x20is\x20required.','createTime','trim','content','40168tclhRl','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','verbose','title','map','userId','ragStatus','length','File\x20path\x20is\x20required.','248PkgftU','body','Created\x20KB\x20entry\x20','list','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','Updated\x20KB\x20entry\x20','query','1870056atncvz','Personal\x20knowledge-base\x20entry\x20title','description','appCode','create','POST','2458650VzRaqr','detail','122724QwaFrN','scope','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','File\x20is\x20not\x20a\x20regular\x20file:\x20'];a25_0x8490=function(){return _0xc01216;};return a25_0x8490();}const kbList={'service':'kb','command':a25_0x200b4a(0x20d),'description':a25_0x200b4a(0x202),'risk':a25_0x200b4a(0x1e9),'flags':[VERBOSE_FLAG],async 'execute'(_0x2cb5c8){const _0x48dc57=a25_0x200b4a,_0x3707e7=await listPersonalKnowledgeBaseItems(_0x2cb5c8['appCode']);if(_0x2cb5c8[_0x48dc57(0x1f8)](_0x48dc57(0x203)))return{'ok':!![],'data':{'total':_0x3707e7[_0x48dc57(0x208)],'items':_0x3707e7}};return{'ok':!![],'data':{'total':_0x3707e7[_0x48dc57(0x208)],'items':_0x3707e7['map'](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a25_0x200b4a(0x218),'description':a25_0x200b4a(0x1fa),'risk':a25_0x200b4a(0x1e9),'flags':[{...ID_FLAG,'description':a25_0x200b4a(0x221)}],async 'execute'(_0x5f4e5f){const _0x1ce2d8=a25_0x200b4a,_0x468ab6=await getPersonalKnowledgeBaseItem(_0x5f4e5f[_0x1ce2d8(0x1f3)]('id'),_0x5f4e5f[_0x1ce2d8(0x214)]);return{'ok':!![],'data':detailPersonalItem(_0x468ab6)};}},kbCreate={'service':'kb','command':a25_0x200b4a(0x215),'description':a25_0x200b4a(0x20e),'risk':'write','flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x131c5f){const _0x444c2b=a25_0x200b4a,_0x540454=_0x131c5f[_0x444c2b(0x1e2)](_0x444c2b(0x204)),_0x554fd2=readKnowledgeFile(_0x131c5f['str'](_0x444c2b(0x1e4))),_0x444077=await createPersonalKnowledgeBaseItem(_0x131c5f['appCode'],{'title':_0x540454,'content':_0x554fd2});return{'ok':!![],'data':summarizePersonalItem(_0x444077),'message':_0x444c2b(0x20c)+_0x444077['id']+'\x20('+_0x444077['title']+')'};},async 'dryRun'(_0x3d51ef){const _0x4e8b12=a25_0x200b4a,_0x4ef0b8=_0x3d51ef[_0x4e8b12(0x1e2)](_0x4e8b12(0x204)),_0xb0788f=readKnowledgeFile(_0x3d51ef[_0x4e8b12(0x1e2)](_0x4e8b12(0x1e4)));return dryRun(_0x4e8b12(0x216),_0x4e8b12(0x1f1))[_0x4e8b12(0x20b)]({'appCode':_0x3d51ef[_0x4e8b12(0x214)],'title':_0x4ef0b8,'content':_0xb0788f})[_0x4e8b12(0x213)](_0x4e8b12(0x1e5)+_0x4ef0b8+'\x22')[_0x4e8b12(0x21e)]();}},kbUpdate={'service':'kb','command':'update','description':a25_0x200b4a(0x1f6),'risk':a25_0x200b4a(0x220),'flags':[{...ID_FLAG,'description':a25_0x200b4a(0x221)},{...TITLE_FLAG,'required':![],'description':'Override\x20the\x20existing\x20entry\x20title'},FILE_FLAG],async 'execute'(_0x24e2bc){const _0x273070=a25_0x200b4a,_0x16a0a2=_0x24e2bc[_0x273070(0x1f3)]('id'),_0x31fe8a=readKnowledgeFile(_0x24e2bc[_0x273070(0x1e2)](_0x273070(0x1e4))),_0x2c8f51=_0x24e2bc['str'](_0x273070(0x204))||(await getPersonalKnowledgeBaseItem(_0x16a0a2,_0x24e2bc[_0x273070(0x214)]))[_0x273070(0x204)],_0x664426=await updatePersonalKnowledgeBaseItem(_0x16a0a2,_0x24e2bc[_0x273070(0x214)],{'title':_0x2c8f51,'content':_0x31fe8a});return{'ok':!![],'data':summarizePersonalItem(_0x664426),'message':_0x273070(0x20f)+_0x664426['id']+'\x20('+_0x664426['title']+')'};},async 'dryRun'(_0x142999){const _0x16d9f1=a25_0x200b4a,_0x15d13f=_0x142999[_0x16d9f1(0x1f3)]('id'),_0x24a552=readKnowledgeFile(_0x142999[_0x16d9f1(0x1e2)](_0x16d9f1(0x1e4))),_0x5cb748=_0x142999[_0x16d9f1(0x1e2)]('title')||(await getPersonalKnowledgeBaseItem(_0x15d13f,_0x142999[_0x16d9f1(0x214)]))['title'];return dryRun(_0x16d9f1(0x216),_0x16d9f1(0x1f7)+_0x15d13f+_0x16d9f1(0x1f5))['body']({'appCode':_0x142999[_0x16d9f1(0x214)],'title':_0x5cb748,'content':_0x24a552})[_0x16d9f1(0x213)](_0x16d9f1(0x21b)+_0x15d13f)['build']();}},kbSearch={'service':'kb','command':a25_0x200b4a(0x1e6),'description':a25_0x200b4a(0x1ed),'risk':a25_0x200b4a(0x1e9),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x854e76){const _0x2f6dfd=a25_0x200b4a;if(!_0x854e76[_0x2f6dfd(0x1e2)](_0x2f6dfd(0x210))[_0x2f6dfd(0x1ff)]())throw CliErrors[_0x2f6dfd(0x1ef)](_0x2f6dfd(0x1fd));readTopK(_0x854e76);},async 'execute'(_0xe2c9e2){const _0x48497c=a25_0x200b4a,_0x179294=_0xe2c9e2[_0x48497c(0x1e2)](_0x48497c(0x210))[_0x48497c(0x1ff)](),_0x263028=readTopK(_0xe2c9e2),_0x1ed2b4=await searchKnowledgeBase(_0xe2c9e2['appCode'],{'query':_0x179294,'topK':_0x263028});return{'ok':!![],'data':{'total':_0x1ed2b4[_0x48497c(0x208)],'hits':_0x1ed2b4[_0x48497c(0x205)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a26_0x319718=a26_0x3815;function a26_0x2d14(){const _0x4ab6f0=['6qeBuje','486164nOYDET','read','show','\x20\x20\x20Details:\x20','791920tpnXsE','82932NQbbxM','*\x20Logs\x20cleared','logs','length','duration','clear','toLocaleString','success','timestamp','11722488atCGhO','warn','write','readLogs','\x20logs:\x0a','292922BCoQMR','*\x20No\x20logs\x20found','\x20\x20\x20Duration:\x20','View\x20command\x20history\x20logs','level','2360615ajgLxT','details','message','stringify','log','3413081iYopiz'];a26_0x2d14=function(){return _0x4ab6f0;};return a26_0x2d14();}(function(_0xaa04de,_0x15e256){const _0x2de9e2=a26_0x3815,_0x1dd3f0=_0xaa04de();while(!![]){try{const _0x42caf8=-parseInt(_0x2de9e2(0x120))/0x1+parseInt(_0x2de9e2(0x12c))/0x2+parseInt(_0x2de9e2(0x131))/0x3+-parseInt(_0x2de9e2(0x130))/0x4+-parseInt(_0x2de9e2(0x125))/0x5+-parseInt(_0x2de9e2(0x12b))/0x6*(parseInt(_0x2de9e2(0x12a))/0x7)+parseInt(_0x2de9e2(0x13a))/0x8;if(_0x42caf8===_0x15e256)break;else _0x1dd3f0['push'](_0x1dd3f0['shift']());}catch(_0x3270fe){_0x1dd3f0['push'](_0x1dd3f0['shift']());}}}(a26_0x2d14,0x45af5));function a26_0x3815(_0x42aac8,_0x44c59c){_0x42aac8=_0x42aac8-0x11c;const _0x2d1407=a26_0x2d14();let _0x381580=_0x2d1407[_0x42aac8];return _0x381580;}import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x3cf9e1){const _0x6ea105=a26_0x3815;if(_0x3cf9e1[_0x6ea105(0x134)]===0x0){console[_0x6ea105(0x129)](_0x6ea105(0x121));return;}console[_0x6ea105(0x129)]('*\x20'+CLI_DISPLAY_NAME+_0x6ea105(0x11f)),_0x3cf9e1['forEach']((_0x21ffeb,_0x1993fc)=>{const _0x36ff5b=_0x6ea105,_0x7cf8a9=new Date(_0x21ffeb[_0x36ff5b(0x139)])[_0x36ff5b(0x137)]('en-US'),_0x2bf2e0=_0x21ffeb[_0x36ff5b(0x124)]===_0x36ff5b(0x138)?'√':_0x21ffeb['level']==='error'?'×':_0x21ffeb[_0x36ff5b(0x124)]===_0x36ff5b(0x11c)?'!':'i';console['log'](_0x1993fc+0x1+'.\x20'+_0x2bf2e0+'\x20['+_0x21ffeb['command']+']\x20'+_0x21ffeb[_0x36ff5b(0x127)]),console[_0x36ff5b(0x129)]('\x20\x20\x20Time:\x20'+_0x7cf8a9),_0x21ffeb[_0x36ff5b(0x135)]&&console[_0x36ff5b(0x129)](_0x36ff5b(0x122)+_0x21ffeb['duration']+'ms'),_0x21ffeb[_0x36ff5b(0x126)]&&Object['keys'](_0x21ffeb['details'])[_0x36ff5b(0x134)]>0x0&&console[_0x36ff5b(0x129)](_0x36ff5b(0x12f)+JSON[_0x36ff5b(0x128)](_0x21ffeb['details'],null,0x2)),console[_0x36ff5b(0x129)]('');});}export const logsDefinitions=[{'service':a26_0x319718(0x133),'command':a26_0x319718(0x12e),'description':a26_0x319718(0x123),'risk':a26_0x319718(0x12d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x2a5a1e){const _0x34c1f2=a26_0x319718;return printLogs(logger[_0x34c1f2(0x11e)]()),{'ok':!![]};}},{'service':a26_0x319718(0x133),'command':a26_0x319718(0x136),'description':'Clear\x20command\x20history\x20logs','risk':a26_0x319718(0x11d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1ddea1){const _0x5baecf=a26_0x319718;return logger['clearLogs'](),console[_0x5baecf(0x129)](_0x5baecf(0x132)),{'ok':!![]};}}];
|