@lovrabet/lovrabet-cli 2.0.13-beta.8 → 2.0.13
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/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a15_0x556df1=a15_0x3389;(function(_0x551ac1,_0x23d24e){const _0xfec585=a15_0x3389,_0x5d9240=_0x551ac1();while(!![]){try{const _0x1de8e0=-parseInt(_0xfec585(0x9a))/0x1*(parseInt(_0xfec585(0xa3))/0x2)+-parseInt(_0xfec585(0xa5))/0x3+-parseInt(_0xfec585(0x98))/0x4*(parseInt(_0xfec585(0x9c))/0x5)+parseInt(_0xfec585(0xa8))/0x6*(parseInt(_0xfec585(0x95))/0x7)+-parseInt(_0xfec585(0xa4))/0x8*(-parseInt(_0xfec585(0x9b))/0x9)+parseInt(_0xfec585(0x99))/0xa+-parseInt(_0xfec585(0x94))/0xb*(-parseInt(_0xfec585(0x92))/0xc);if(_0x1de8e0===_0x23d24e)break;else _0x5d9240['push'](_0x5d9240['shift']());}catch(_0x332005){_0x5d9240['push'](_0x5d9240['shift']());}}}(a15_0x2ea3,0x8bd3d));function a15_0x2ea3(){const _0x15deb8=['204ixFhHo','name','421861DgetGJ','14tIERlU','Resource\x20name\x20for\x20lookup','params','1917908sUDAFI','311100TjowRI','4469AcdnVR','9XvpIvz','10foTfhr','a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)','string','number','Return\x20full\x20raw\x20response\x20object','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','code','2JYZUyp','5638104sCQVOo','651138kREZUN','verbose','Dataset\x20code\x20(32-char\x20hex\x20UUID)','1096086FAUGMG','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)'];a15_0x2ea3=function(){return _0x15deb8;};return a15_0x2ea3();}export const CODE_FLAG={'name':a15_0x556df1(0xa2),'type':'string','required':!![],'description':a15_0x556df1(0xa7),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a15_0x556df1(0x9d)}};export const SQLCODE_FLAG={'name':'sqlcode','type':'string','required':!![],'description':a15_0x556df1(0xa9),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a15_0x556df1(0xa1)}};function a15_0x3389(_0x5c8fd9,_0x52981e){_0x5c8fd9=_0x5c8fd9-0x92;const _0x2ea380=a15_0x2ea3();let _0x338967=_0x2ea380[_0x5c8fd9];return _0x338967;}export const VERBOSE_FLAG={'name':a15_0x556df1(0xa6),'type':'boolean','description':a15_0x556df1(0xa0)};export const PARAMS_FLAG={'name':a15_0x556df1(0x97),'type':a15_0x556df1(0x9e),'description':a15_0x556df1(0xaa)};export const NAME_FLAG={'name':a15_0x556df1(0x93),'type':'string','description':a15_0x556df1(0x96)};export const ID_FLAG={'name':'id','type':a15_0x556df1(0x9f),'required':!![],'description':'Resource\x20ID'};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a16_0x97df6b=a16_0x3f44;(function(_0x163714,_0x2f4f9e){const _0x3b52ed=a16_0x3f44,_0x57b049=_0x163714();while(!![]){try{const _0x816a15=-parseInt(_0x3b52ed(0x87))/0x1*(parseInt(_0x3b52ed(0xb7))/0x2)+-parseInt(_0x3b52ed(0xbe))/0x3*(-parseInt(_0x3b52ed(0xa1))/0x4)+parseInt(_0x3b52ed(0xa8))/0x5*(parseInt(_0x3b52ed(0x94))/0x6)+-parseInt(_0x3b52ed(0xa9))/0x7*(parseInt(_0x3b52ed(0x99))/0x8)+-parseInt(_0x3b52ed(0xbf))/0x9+-parseInt(_0x3b52ed(0x89))/0xa*(parseInt(_0x3b52ed(0x9b))/0xb)+parseInt(_0x3b52ed(0xc4))/0xc*(parseInt(_0x3b52ed(0x93))/0xd);if(_0x816a15===_0x2f4f9e)break;else _0x57b049['push'](_0x57b049['shift']());}catch(_0x30bdff){_0x57b049['push'](_0x57b049['shift']());}}}(a16_0x4591,0x83c13));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':a16_0x97df6b(0xb5),'type':'boolean','description':a16_0x97df6b(0xa0),'default':![]};function parseAliasAppcodeSetKey(_0x489e50){const _0x1d0310=a16_0x97df6b,_0x4a2f32=_0x489e50[_0x1d0310(0x8c)]('.');if(_0x4a2f32[_0x1d0310(0xb0)]!==0x3||_0x4a2f32[0x0]!==_0x1d0310(0x9c)||_0x4a2f32[0x2]!=='appcode')return undefined;const _0x263c92=_0x4a2f32[0x1]?.['trim']();return _0x263c92?_0x263c92:undefined;}function parseAliasDeleteKey(_0x431c44){const _0x1cd73f=a16_0x97df6b,_0x3759d5=_0x431c44['split']('.');if(_0x3759d5[_0x1cd73f(0xb0)]===0x2&&_0x3759d5[0x0]===_0x1cd73f(0x9c)){const _0x5ac730=_0x3759d5[0x1]?.['trim']();return _0x5ac730?{'alias':_0x5ac730}:undefined;}if(_0x3759d5[_0x1cd73f(0xb0)]===0x3&&_0x3759d5[0x0]===_0x1cd73f(0x9c)&&_0x3759d5[0x2]===_0x1cd73f(0x91)){const _0x185059=_0x3759d5[0x1]?.[_0x1cd73f(0x90)]();return _0x185059?{'alias':_0x185059,'field':_0x1cd73f(0x91)}:undefined;}return undefined;}function setLocalAppAlias(_0x4443c4,_0x5f199d,_0x5378b7){const _0x30c132=a16_0x97df6b,_0x151633=_0x4443c4[_0x30c132(0x9c)]&&typeof _0x4443c4[_0x30c132(0x9c)]===_0x30c132(0x96)&&!Array[_0x30c132(0xad)](_0x4443c4[_0x30c132(0x9c)])?_0x4443c4[_0x30c132(0x9c)]:{},_0x2876b7=_0x151633[_0x5f199d]&&typeof _0x151633[_0x5f199d]===_0x30c132(0x96)&&!Array[_0x30c132(0xad)](_0x151633[_0x5f199d])?_0x151633[_0x5f199d]:{};_0x2876b7['appcode']=_0x5378b7,_0x151633[_0x5f199d]=_0x2876b7,_0x4443c4[_0x30c132(0x9c)]=_0x151633;}function deleteLocalAppAlias(_0x31189f,_0x2f150d){const _0x47b113=a16_0x97df6b;if(!_0x31189f['apps']||typeof _0x31189f[_0x47b113(0x9c)]!==_0x47b113(0x96)||Array['isArray'](_0x31189f[_0x47b113(0x9c)]))return![];const _0x55fbc8=_0x31189f[_0x47b113(0x9c)],_0x14b8d5=_0x55fbc8[_0x2f150d[_0x47b113(0x81)]];if(!_0x14b8d5||typeof _0x14b8d5!==_0x47b113(0x96)||Array[_0x47b113(0xad)](_0x14b8d5))return![];if(!_0x2f150d[_0x47b113(0xb8)])return delete _0x55fbc8[_0x2f150d[_0x47b113(0x81)]],!![];if(!(_0x2f150d['field']in _0x14b8d5))return![];return delete _0x14b8d5[_0x2f150d['field']],Object[_0x47b113(0xbd)](_0x14b8d5)[_0x47b113(0xb0)]===0x0&&delete _0x55fbc8[_0x2f150d[_0x47b113(0x81)]],!![];}function a16_0x3f44(_0xbaed69,_0x52ad5f){_0xbaed69=_0xbaed69-0x7e;const _0x45918a=a16_0x4591();let _0x3f44de=_0x45918a[_0xbaed69];return _0x3f44de;}const listDef={'service':a16_0x97df6b(0x9e),'command':a16_0x97df6b(0xc1),'description':a16_0x97df6b(0xa7),'risk':a16_0x97df6b(0xa4),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x1e2392){const _0x2d3363=a16_0x97df6b,{buildConfigFromFlags:_0x1595fa}=await import(_0x2d3363(0x8e)),_0xfccc0f=_0x1595fa({}),_0x39d2f7=getProjectConfigPath(),_0x55597d=resolveWriteConfigPath('global');if(_0x1e2392['format']===_0x2d3363(0x85))return{'ok':!![],'message':'#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a'+(JSON[_0x2d3363(0xb1)](_0xfccc0f[_0x2d3363(0x82)],null,0x2)+'\x0a\x0a')+_0x2d3363(0xaa)+(_0x2d3363(0xac)+(_0x39d2f7??_0x2d3363(0x8d))+'\x0a')+(_0x2d3363(0xab)+_0x55597d)};return{'ok':!![],'data':{'effective':_0xfccc0f['raw'],'configFiles':{'project':_0x39d2f7??null,'global':_0x55597d}}};}},getDef={'service':a16_0x97df6b(0x9e),'command':'get','description':a16_0x97df6b(0x95),'risk':a16_0x97df6b(0xa4),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x97df6b(0xb2),'description':a16_0x97df6b(0x84),'required':!![]}],'flags':[],async 'execute'(_0x49c725){const _0x557ee1=a16_0x97df6b,_0x10d274=_0x49c725[_0x557ee1(0xaf)][0x0];if(!_0x10d274)throw CliErrors['validation'](_0x557ee1(0x8f),_0x557ee1(0x98)+CLI_BIN_NAME+_0x557ee1(0x7e));const {buildConfigFromFlags:_0x3de62a}=await import(_0x557ee1(0x8e)),{raw:_0x197404}=_0x3de62a({});if(_0x10d274[_0x557ee1(0x92)]('.')){const _0xbe7ba0=_0x10d274['split']('.');let _0x1f8eda=_0x197404;for(const _0x36f345 of _0xbe7ba0){if(_0x1f8eda==null||typeof _0x1f8eda!==_0x557ee1(0x96))throw CliErrors[_0x557ee1(0xa5)](_0x557ee1(0xa2)+_0x10d274);_0x1f8eda=_0x1f8eda[_0x36f345];}if(_0x1f8eda===undefined)throw CliErrors[_0x557ee1(0xa5)](_0x557ee1(0xa2)+_0x10d274);return console[_0x557ee1(0x8b)](typeof _0x1f8eda===_0x557ee1(0x96)?JSON[_0x557ee1(0xb1)](_0x1f8eda,null,0x2):String(_0x1f8eda)),{'ok':!![]};}const _0x2f26fc=_0x197404[_0x10d274];if(_0x2f26fc===undefined)throw CliErrors['validation']('Key\x20not\x20found:\x20'+_0x10d274);return console[_0x557ee1(0x8b)](typeof _0x2f26fc===_0x557ee1(0x96)?JSON['stringify'](_0x2f26fc,null,0x2):String(_0x2f26fc)),{'ok':!![]};}},setDef={'service':a16_0x97df6b(0x9e),'command':a16_0x97df6b(0x86),'description':a16_0x97df6b(0xa3),'risk':a16_0x97df6b(0xa6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x97df6b(0xb2),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':'value','description':'Value\x20to\x20assign','required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x1cd39c){const _0x3025e2=a16_0x97df6b,_0x47760b=_0x1cd39c[_0x3025e2(0xaf)][0x0],_0x5735b5=_0x1cd39c[_0x3025e2(0xaf)][0x1];if(!_0x47760b||_0x5735b5===undefined)throw CliErrors[_0x3025e2(0xa5)](_0x3025e2(0xb6),_0x3025e2(0x98)+CLI_BIN_NAME+_0x3025e2(0x7f));if(ENUM_KEYS[_0x47760b]&&!ENUM_KEYS[_0x47760b][_0x3025e2(0x92)](_0x5735b5))throw CliErrors[_0x3025e2(0xa5)](_0x3025e2(0x9a)+_0x47760b+_0x3025e2(0xc0)+ENUM_KEYS[_0x47760b]['join'](',\x20'));if(_0x47760b===_0x3025e2(0xae))throw CliErrors[_0x3025e2(0xa5)](_0x3025e2(0x9d));if(_0x47760b===_0x3025e2(0x8a)){const _0x476b82=Number(_0x5735b5);if(isNaN(_0x476b82)||_0x476b82<=0x0)throw CliErrors[_0x3025e2(0xa5)]('pageSize\x20must\x20be\x20a\x20positive\x20number');}const _0x485b61=resolveWriteScope({'explicitGlobal':_0x1cd39c[_0x3025e2(0xbc)](_0x3025e2(0xb5)),'policy':_0x3025e2(0x80)}),_0x19a44a=toScopeFlags(_0x485b61),_0x3ea25c=readScopedConfig(_0x19a44a),_0x4a2182=parseAliasAppcodeSetKey(_0x47760b);if(!_0x4a2182&&!isTopLevelConfigKey(_0x47760b))throw CliErrors['validation'](_0x3025e2(0xbb)+_0x47760b+_0x3025e2(0xb9),'Settable\x20keys:\x20'+getTopLevelConfigKeySummary()+_0x3025e2(0xb4));return _0x4a2182?setLocalAppAlias(_0x3ea25c,_0x4a2182,_0x5735b5):_0x3ea25c[_0x47760b]=_0x47760b===_0x3025e2(0x8a)?Number(_0x5735b5):_0x5735b5,console[_0x3025e2(0x8b)](_0x3025e2(0x9f)+_0x47760b+_0x3025e2(0xb3)+_0x5735b5+'\x22'+(_0x485b61==='global'?_0x3025e2(0xba):'')),writeScopedConfig(_0x3ea25c,_0x19a44a),{'ok':!![]};}},deleteDef={'service':a16_0x97df6b(0x9e),'command':a16_0x97df6b(0xc2),'description':a16_0x97df6b(0x83),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x24a973){const _0x681631=a16_0x97df6b,_0x4c45c5=_0x24a973[_0x681631(0xaf)][0x0];if(!_0x4c45c5)throw CliErrors[_0x681631(0xa5)](_0x681631(0x8f),_0x681631(0x98)+CLI_BIN_NAME+_0x681631(0x88));const _0x26db8d=resolveWriteScope({'explicitGlobal':_0x24a973[_0x681631(0xbc)](_0x681631(0xb5)),'policy':_0x681631(0x80)}),_0x56e19a=toScopeFlags(_0x26db8d),_0x2cd8fd=readScopedConfig(_0x56e19a),_0x3822b5=parseAliasDeleteKey(_0x4c45c5);if(_0x3822b5){if(!deleteLocalAppAlias(_0x2cd8fd,_0x3822b5))throw CliErrors[_0x681631(0xa5)](_0x681631(0xa2)+_0x4c45c5);return console[_0x681631(0x8b)](_0x681631(0xc3)+_0x4c45c5+'`'+(_0x26db8d==='global'?_0x681631(0xba):'')),writeScopedConfig(_0x2cd8fd,_0x56e19a),{'ok':!![]};}if(_0x2cd8fd[_0x4c45c5]===undefined)throw CliErrors[_0x681631(0xa5)]('Key\x20\x22'+_0x4c45c5+_0x681631(0x97));return delete _0x2cd8fd[_0x4c45c5],console[_0x681631(0x8b)](_0x681631(0xc3)+_0x4c45c5+'`'+(_0x26db8d===_0x681631(0xb5)?_0x681631(0xba):'')),writeScopedConfig(_0x2cd8fd,_0x56e19a),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];function a16_0x4591(){const _0x4a9046=['10krtgKd','49jEoCTW','Config\x20files:\x0a','\x20\x20global:\x20\x20','\x20\x20project:\x20','isArray','riskLevel','args','length','stringify','key','`\x20=\x20\x22',';\x20apps.<alias>.appcode','global','Missing\x20key\x20or\x20value.','1583028HvRrKR','field','\x22\x20is\x20not\x20settable.','\x20(global)','Top-level\x20key\x20\x22','bool','keys','111jfbrIa','7442730cvxLQu','\x22.\x20Allowed:\x20','list','delete','Deleted\x20`','10284LDrfWZ','\x20config\x20get\x20<key>','\x20config\x20set\x20<key>\x20<value>\x20[--global]','project-or-global-explicit','alias','raw','Delete\x20a\x20config\x20value','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','pretty','set','1RivJsB','\x20config\x20delete\x20<key>\x20[--global]','20nQATMp','pageSize','log','split','(none)','../../context.js','Missing\x20key\x20argument.','trim','appcode','includes','24713vrrCzU','3072042iEvvHP','Get\x20a\x20config\x20value','object','\x22\x20not\x20found\x20at\x20top\x20level.','Usage:\x20','525736qKAbxh','Invalid\x20value\x20for\x20\x22','502436eMQjWY','apps','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','config','Set\x20`','Write\x20to\x20global\x20config','6092khTLeM','Key\x20not\x20found:\x20','Set\x20a\x20config\x20value','read','validation','write','List\x20current\x20config'];a16_0x4591=function(){return _0x4a9046;};return a16_0x4591();}
|
|
1
|
+
const a16_0x491b58=a16_0x167b;(function(_0x1bca99,_0x119832){const _0x1d1a7f=a16_0x167b,_0x3429d9=_0x1bca99();while(!![]){try{const _0x2105de=-parseInt(_0x1d1a7f(0x18f))/0x1+-parseInt(_0x1d1a7f(0x174))/0x2+-parseInt(_0x1d1a7f(0x166))/0x3+-parseInt(_0x1d1a7f(0x19b))/0x4+-parseInt(_0x1d1a7f(0x170))/0x5*(-parseInt(_0x1d1a7f(0x18b))/0x6)+-parseInt(_0x1d1a7f(0x17c))/0x7+-parseInt(_0x1d1a7f(0x16e))/0x8*(-parseInt(_0x1d1a7f(0x161))/0x9);if(_0x2105de===_0x119832)break;else _0x3429d9['push'](_0x3429d9['shift']());}catch(_0x9a0b1e){_0x3429d9['push'](_0x3429d9['shift']());}}}(a16_0x47a3,0x4cc41));function a16_0x167b(_0x753224,_0x42dd15){_0x753224=_0x753224-0x15e;const _0x47a3bc=a16_0x47a3();let _0x167bd7=_0x47a3bc[_0x753224];return _0x167bd7;}function a16_0x47a3(){const _0x1fafcf=['Config\x20files:\x0a','alias','1576jXxqEh','validation','5qmIpAR','Key\x20\x22','Missing\x20key\x20or\x20value.','get','644506lOrCjC','write','Set\x20`','config','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','length','apps','object','1716722fxALib','`\x20=\x20\x22','raw','../../context.js','pageSize\x20must\x20be\x20a\x20positive\x20number','keys','Missing\x20key\x20argument.','Usage:\x20','includes','stringify','\x22\x20is\x20not\x20settable.','global','bool','\x20\x20global:\x20\x20','pageSize','608376AvXCUa','key','isArray','Set\x20a\x20config\x20value','501400TLYTwN','trim','Key\x20not\x20found:\x20','Write\x20to\x20global\x20config','riskLevel','args','\x20(global)','project-or-global-explicit','split','\x20config\x20delete\x20<key>\x20[--global]','Get\x20a\x20config\x20value','appcode','2274404dnrPAw','delete','\x22\x20not\x20found\x20at\x20top\x20level.','\x20config\x20get\x20<key>','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','85599ipwijt','list','log','Deleted\x20`','format','69390kpBLtZ','join','set','field','read','\x20\x20project:\x20'];a16_0x47a3=function(){return _0x1fafcf;};return a16_0x47a3();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':a16_0x491b58(0x187),'type':'boolean','description':a16_0x491b58(0x192),'default':![]};function parseAliasAppcodeSetKey(_0x23a4f7){const _0x11ebec=a16_0x491b58,_0xdfc686=_0x23a4f7['split']('.');if(_0xdfc686[_0x11ebec(0x179)]!==0x3||_0xdfc686[0x0]!==_0x11ebec(0x17a)||_0xdfc686[0x2]!=='appcode')return undefined;const _0x117258=_0xdfc686[0x1]?.[_0x11ebec(0x190)]();return _0x117258?_0x117258:undefined;}function parseAliasDeleteKey(_0x354d9f){const _0x152d16=a16_0x491b58,_0x39f726=_0x354d9f['split']('.');if(_0x39f726[_0x152d16(0x179)]===0x2&&_0x39f726[0x0]==='apps'){const _0x136fbf=_0x39f726[0x1]?.['trim']();return _0x136fbf?{'alias':_0x136fbf}:undefined;}if(_0x39f726[_0x152d16(0x179)]===0x3&&_0x39f726[0x0]==='apps'&&_0x39f726[0x2]===_0x152d16(0x19a)){const _0x4479dc=_0x39f726[0x1]?.['trim']();return _0x4479dc?{'alias':_0x4479dc,'field':_0x152d16(0x19a)}:undefined;}return undefined;}function setLocalAppAlias(_0x2b88fd,_0x241344,_0x510564){const _0x5e9ace=a16_0x491b58,_0x22e1dd=_0x2b88fd[_0x5e9ace(0x17a)]&&typeof _0x2b88fd[_0x5e9ace(0x17a)]===_0x5e9ace(0x17b)&&!Array[_0x5e9ace(0x18d)](_0x2b88fd['apps'])?_0x2b88fd[_0x5e9ace(0x17a)]:{},_0x13ad21=_0x22e1dd[_0x241344]&&typeof _0x22e1dd[_0x241344]==='object'&&!Array[_0x5e9ace(0x18d)](_0x22e1dd[_0x241344])?_0x22e1dd[_0x241344]:{};_0x13ad21[_0x5e9ace(0x19a)]=_0x510564,_0x22e1dd[_0x241344]=_0x13ad21,_0x2b88fd[_0x5e9ace(0x17a)]=_0x22e1dd;}function deleteLocalAppAlias(_0x53cdc1,_0x5d4f4f){const _0x4c2e08=a16_0x491b58;if(!_0x53cdc1[_0x4c2e08(0x17a)]||typeof _0x53cdc1[_0x4c2e08(0x17a)]!==_0x4c2e08(0x17b)||Array[_0x4c2e08(0x18d)](_0x53cdc1[_0x4c2e08(0x17a)]))return![];const _0x394e69=_0x53cdc1[_0x4c2e08(0x17a)],_0x2441e6=_0x394e69[_0x5d4f4f[_0x4c2e08(0x16d)]];if(!_0x2441e6||typeof _0x2441e6!==_0x4c2e08(0x17b)||Array[_0x4c2e08(0x18d)](_0x2441e6))return![];if(!_0x5d4f4f[_0x4c2e08(0x169)])return delete _0x394e69[_0x5d4f4f[_0x4c2e08(0x16d)]],!![];if(!(_0x5d4f4f[_0x4c2e08(0x169)]in _0x2441e6))return![];return delete _0x2441e6[_0x5d4f4f[_0x4c2e08(0x169)]],Object[_0x4c2e08(0x181)](_0x2441e6)[_0x4c2e08(0x179)]===0x0&&delete _0x394e69[_0x5d4f4f[_0x4c2e08(0x16d)]],!![];}const listDef={'service':'config','command':a16_0x491b58(0x162),'description':'List\x20current\x20config','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x244ba5){const _0x158029=a16_0x491b58,{buildConfigFromFlags:_0x574372}=await import(_0x158029(0x17f)),_0x436960=_0x574372({}),_0xf24bd7=getProjectConfigPath(),_0x5c6b68=resolveWriteConfigPath(_0x158029(0x187));if(_0x244ba5[_0x158029(0x165)]==='pretty')return{'ok':!![],'message':_0x158029(0x178)+(JSON[_0x158029(0x185)](_0x436960['raw'],null,0x2)+'\x0a\x0a')+_0x158029(0x16c)+(_0x158029(0x16b)+(_0xf24bd7??'(none)')+'\x0a')+(_0x158029(0x189)+_0x5c6b68)};return{'ok':!![],'data':{'effective':_0x436960[_0x158029(0x17e)],'configFiles':{'project':_0xf24bd7??null,'global':_0x5c6b68}}};}},getDef={'service':a16_0x491b58(0x177),'command':a16_0x491b58(0x173),'description':a16_0x491b58(0x199),'risk':a16_0x491b58(0x16a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x491b58(0x18c),'description':a16_0x491b58(0x160),'required':!![]}],'flags':[],async 'execute'(_0x1a7266){const _0x173e03=a16_0x491b58,_0xf380bc=_0x1a7266['args'][0x0];if(!_0xf380bc)throw CliErrors[_0x173e03(0x16f)](_0x173e03(0x182),_0x173e03(0x183)+CLI_BIN_NAME+_0x173e03(0x15f));const {buildConfigFromFlags:_0x18ae92}=await import('../../context.js'),{raw:_0x60a1ac}=_0x18ae92({});if(_0xf380bc['includes']('.')){const _0x501116=_0xf380bc[_0x173e03(0x197)]('.');let _0x1b02ac=_0x60a1ac;for(const _0xe86382 of _0x501116){if(_0x1b02ac==null||typeof _0x1b02ac!=='object')throw CliErrors[_0x173e03(0x16f)](_0x173e03(0x191)+_0xf380bc);_0x1b02ac=_0x1b02ac[_0xe86382];}if(_0x1b02ac===undefined)throw CliErrors['validation'](_0x173e03(0x191)+_0xf380bc);return console['log'](typeof _0x1b02ac===_0x173e03(0x17b)?JSON[_0x173e03(0x185)](_0x1b02ac,null,0x2):String(_0x1b02ac)),{'ok':!![]};}const _0x2d2927=_0x60a1ac[_0xf380bc];if(_0x2d2927===undefined)throw CliErrors[_0x173e03(0x16f)](_0x173e03(0x191)+_0xf380bc);return console[_0x173e03(0x163)](typeof _0x2d2927===_0x173e03(0x17b)?JSON[_0x173e03(0x185)](_0x2d2927,null,0x2):String(_0x2d2927)),{'ok':!![]};}},setDef={'service':a16_0x491b58(0x177),'command':a16_0x491b58(0x168),'description':a16_0x491b58(0x18e),'risk':a16_0x491b58(0x175),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x491b58(0x18c),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':'value','description':'Value\x20to\x20assign','required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x157f87){const _0x1584e3=a16_0x491b58,_0x1d51f7=_0x157f87[_0x1584e3(0x194)][0x0],_0x1370d4=_0x157f87[_0x1584e3(0x194)][0x1];if(!_0x1d51f7||_0x1370d4===undefined)throw CliErrors['validation'](_0x1584e3(0x172),_0x1584e3(0x183)+CLI_BIN_NAME+'\x20config\x20set\x20<key>\x20<value>\x20[--global]');if(ENUM_KEYS[_0x1d51f7]&&!ENUM_KEYS[_0x1d51f7][_0x1584e3(0x184)](_0x1370d4))throw CliErrors[_0x1584e3(0x16f)]('Invalid\x20value\x20for\x20\x22'+_0x1d51f7+'\x22.\x20Allowed:\x20'+ENUM_KEYS[_0x1d51f7][_0x1584e3(0x167)](',\x20'));if(_0x1d51f7===_0x1584e3(0x193))throw CliErrors['validation']('\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.');if(_0x1d51f7===_0x1584e3(0x18a)){const _0x3d87dd=Number(_0x1370d4);if(isNaN(_0x3d87dd)||_0x3d87dd<=0x0)throw CliErrors['validation'](_0x1584e3(0x180));}const _0x37ee4b=resolveWriteScope({'explicitGlobal':_0x157f87[_0x1584e3(0x188)](_0x1584e3(0x187)),'policy':_0x1584e3(0x196)}),_0x2fd2e7=toScopeFlags(_0x37ee4b),_0x194f85=readScopedConfig(_0x2fd2e7),_0x32e8ff=parseAliasAppcodeSetKey(_0x1d51f7);if(!_0x32e8ff&&!isTopLevelConfigKey(_0x1d51f7))throw CliErrors[_0x1584e3(0x16f)]('Top-level\x20key\x20\x22'+_0x1d51f7+_0x1584e3(0x186),'Settable\x20keys:\x20'+getTopLevelConfigKeySummary()+';\x20apps.<alias>.appcode');return _0x32e8ff?setLocalAppAlias(_0x194f85,_0x32e8ff,_0x1370d4):_0x194f85[_0x1d51f7]=_0x1d51f7===_0x1584e3(0x18a)?Number(_0x1370d4):_0x1370d4,console[_0x1584e3(0x163)](_0x1584e3(0x176)+_0x1d51f7+_0x1584e3(0x17d)+_0x1370d4+'\x22'+(_0x37ee4b==='global'?_0x1584e3(0x195):'')),writeScopedConfig(_0x194f85,_0x2fd2e7),{'ok':!![]};}},deleteDef={'service':a16_0x491b58(0x177),'command':a16_0x491b58(0x19c),'description':'Delete\x20a\x20config\x20value','risk':a16_0x491b58(0x175),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x5c0f2c){const _0x2425bf=a16_0x491b58,_0x3d8d1b=_0x5c0f2c['args'][0x0];if(!_0x3d8d1b)throw CliErrors['validation']('Missing\x20key\x20argument.',_0x2425bf(0x183)+CLI_BIN_NAME+_0x2425bf(0x198));const _0x2296ba=resolveWriteScope({'explicitGlobal':_0x5c0f2c[_0x2425bf(0x188)](_0x2425bf(0x187)),'policy':_0x2425bf(0x196)}),_0x56bc24=toScopeFlags(_0x2296ba),_0x425afa=readScopedConfig(_0x56bc24),_0x1bc9be=parseAliasDeleteKey(_0x3d8d1b);if(_0x1bc9be){if(!deleteLocalAppAlias(_0x425afa,_0x1bc9be))throw CliErrors[_0x2425bf(0x16f)]('Key\x20not\x20found:\x20'+_0x3d8d1b);return console[_0x2425bf(0x163)](_0x2425bf(0x164)+_0x3d8d1b+'`'+(_0x2296ba==='global'?_0x2425bf(0x195):'')),writeScopedConfig(_0x425afa,_0x56bc24),{'ok':!![]};}if(_0x425afa[_0x3d8d1b]===undefined)throw CliErrors['validation'](_0x2425bf(0x171)+_0x3d8d1b+_0x2425bf(0x15e));return delete _0x425afa[_0x3d8d1b],console['log'](_0x2425bf(0x164)+_0x3d8d1b+'`'+(_0x2296ba===_0x2425bf(0x187)?_0x2425bf(0x195):'')),writeScopedConfig(_0x425afa,_0x56bc24),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2b5062,_0x4fa94a){var _0x47fd3f=a17_0x26b3,_0x3d727c=_0x2b5062();while(!![]){try{var _0x139f88=-parseInt(_0x47fd3f(0x1a3))/0x1*(parseInt(_0x47fd3f(0x1a7))/0x2)+parseInt(_0x47fd3f(0x1a5))/0x3*(-parseInt(_0x47fd3f(0x1a8))/0x4)+-parseInt(_0x47fd3f(0x1a9))/0x5+-parseInt(_0x47fd3f(0x1a0))/0x6+-parseInt(_0x47fd3f(0x1a2))/0x7+parseInt(_0x47fd3f(0x1a4))/0x8*(parseInt(_0x47fd3f(0x1a1))/0x9)+parseInt(_0x47fd3f(0x19f))/0xa*(parseInt(_0x47fd3f(0x1a6))/0xb);if(_0x139f88===_0x4fa94a)break;else _0x3d727c['push'](_0x3d727c['shift']());}catch(_0x2fce3a){_0x3d727c['push'](_0x3d727c['shift']());}}}(a17_0xc527,0x7655e));import{CLI_BIN_NAME}from'../../constant/cli.js';function a17_0x26b3(_0x4628b3,_0x491b05){_0x4628b3=_0x4628b3-0x19f;var _0xc5273d=a17_0xc527();var _0x26b390=_0xc5273d[_0x4628b3];return _0x26b390;}export{CLI_BIN_NAME};export{readScopedConfig,writeScopedConfig}from'../../context.js';function a17_0xc527(){var _0x215137=['5934952lIFfOh','44001HxYIjV','18786977ZLEHcp','182548vjyBXX','12laluwN','2710970eKrdbt','10jxaEKj','2001426vrSdxM','9uWkTQP','2844730tJXJfG','7YcRBQo'];a17_0xc527=function(){return _0x215137;};return a17_0xc527();}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_0xe689e6=a18_0x3bd0;(function(_0x11e2e4,_0x4a4ffb){const _0x4700a7=a18_0x3bd0,_0x3fb3f2=_0x11e2e4();while(!![]){try{const _0xb9b269=-parseInt(_0x4700a7(0x150))/0x1+parseInt(_0x4700a7(0x110))/0x2+-parseInt(_0x4700a7(0x142))/0x3+parseInt(_0x4700a7(0x10f))/0x4*(parseInt(_0x4700a7(0x148))/0x5)+-parseInt(_0x4700a7(0x145))/0x6*(-parseInt(_0x4700a7(0x11a))/0x7)+-parseInt(_0x4700a7(0x137))/0x8*(parseInt(_0x4700a7(0x133))/0x9)+-parseInt(_0x4700a7(0x140))/0xa*(-parseInt(_0x4700a7(0x121))/0xb);if(_0xb9b269===_0x4a4ffb)break;else _0x3fb3f2['push'](_0x3fb3f2['shift']());}catch(_0x51b5cc){_0x3fb3f2['push'](_0x3fb3f2['shift']());}}}(a18_0x48cb,0xd7956));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';function a18_0x48cb(){const _0x31d821=['JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','\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','192jySAyx','1650054fFIjeZ','\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\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','paramsHint','\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}','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','paramsRequired','\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}}','3332OoPaHh','\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$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]}}','operation','now','build','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','3282686jYYXio','Preview:\x20data\x20','command','\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}','code','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','Update\x20an\x20existing\x20record','update','\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]','map','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','\x20completed\x20in\x20','join','description','\x20\x20EXAMPLES','getOne','batchCreate','198ENrwic','\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','risk','128936DPXMsj','Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\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--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','/api/{appCode}/','dryRun','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','30VNMYfg','\x20\x20AGGREGATE\x20TYPES','4342524qBRHnT','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','aggregate','4596uTTiFP','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','123315Qqzhdm','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}','params','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','\x20\x20PAGINATION','data','583633HJkVFe','data\x20','\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\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','write','\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\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','read','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','body','str','create','high-risk-write','\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}}','\x20on\x20dataset\x20'];a18_0x48cb=function(){return _0x31d821;};return a18_0x48cb();}import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';function a18_0x3bd0(_0x24caee,_0x1fac65){_0x24caee=_0x24caee-0x10c;const _0x48cbc3=a18_0x48cb();let _0x3bd097=_0x48cbc3[_0x24caee];return _0x3bd097;}import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':'filter','operation':'filter','risk':a18_0xe689e6(0x159),'paramsRequired':![],'description':'Filter\x20dataset\x20records\x20with\x20query\x20conditions','paramsHint':a18_0xe689e6(0x146)+a18_0xe689e6(0x15a),'helpExtra':['\x20\x20WHERE\x20OPERATORS','\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}',a18_0xe689e6(0x135),a18_0xe689e6(0x155),a18_0xe689e6(0x15f),'\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}',a18_0xe689e6(0x11c),a18_0xe689e6(0x119),'\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_0xe689e6(0x157),'','\x20\x20LOGICAL\x20COMBINATORS',a18_0xe689e6(0x134),a18_0xe689e6(0x11b),'',a18_0xe689e6(0x13b),a18_0xe689e6(0x13e),a18_0xe689e6(0x158),'\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}]',a18_0xe689e6(0x147),a18_0xe689e6(0x143),'',a18_0xe689e6(0x14e),a18_0xe689e6(0x112),a18_0xe689e6(0x13f),a18_0xe689e6(0x126)][a18_0xe689e6(0x12e)]('\x0a')},{'command':a18_0xe689e6(0x131),'operation':a18_0xe689e6(0x131),'risk':a18_0xe689e6(0x159),'paramsRequired':!![],'description':'Get\x20a\x20single\x20record\x20by\x20ID','paramsHint':a18_0xe689e6(0x153)},{'command':a18_0xe689e6(0x15d),'operation':a18_0xe689e6(0x15d),'risk':'write','paramsRequired':!![],'description':'Create\x20a\x20new\x20record\x20in\x20a\x20dataset','paramsHint':a18_0xe689e6(0x10d)},{'command':a18_0xe689e6(0x132),'operation':a18_0xe689e6(0x132),'risk':a18_0xe689e6(0x154),'paramsRequired':!![],'description':a18_0xe689e6(0x12c),'paramsHint':a18_0xe689e6(0x116)},{'command':a18_0xe689e6(0x129),'operation':'update','risk':'write','paramsRequired':!![],'description':a18_0xe689e6(0x128),'paramsHint':'JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27'},{'command':'delete','operation':'delete','risk':a18_0xe689e6(0x15e),'paramsRequired':!![],'description':a18_0xe689e6(0x14d),'paramsHint':a18_0xe689e6(0x153)},{'command':a18_0xe689e6(0x144),'operation':'aggregate','risk':a18_0xe689e6(0x159),'paramsRequired':![],'description':'Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','paramsHint':'JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20'+a18_0xe689e6(0x138),'helpExtra':[a18_0xe689e6(0x141),a18_0xe689e6(0x139),a18_0xe689e6(0x14a),a18_0xe689e6(0x152),a18_0xe689e6(0x124),a18_0xe689e6(0x156),a18_0xe689e6(0x115),'\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','','\x20\x20PARAMS\x20STRUCTURE',a18_0xe689e6(0x12a),a18_0xe689e6(0x14c),'\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)',a18_0xe689e6(0x120),a18_0xe689e6(0x111),a18_0xe689e6(0x117),'',a18_0xe689e6(0x130),a18_0xe689e6(0x113),a18_0xe689e6(0x13a),'',a18_0xe689e6(0x127),a18_0xe689e6(0x10e)][a18_0xe689e6(0x12e)]('\x0a')}];function makeDataCommand(_0x232534){const _0x3b32c3=a18_0xe689e6,_0x358eed=_0x3b32c3(0x151)+_0x232534['command'],_0x1144a6={'service':_0x3b32c3(0x14f),'command':_0x232534['command'],'description':_0x232534[_0x3b32c3(0x12f)],'risk':_0x232534[_0x3b32c3(0x136)],'helpExtra':_0x232534['helpExtra'],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x232534[_0x3b32c3(0x114)]}],'validate':async _0x1f32ea=>{const _0x530ccf=_0x3b32c3;_0x232534[_0x530ccf(0x118)]&&requireAnyOf(_0x1f32ea,[_0x530ccf(0x14b)],_0x358eed),_0x232534[_0x530ccf(0x11d)]===_0x530ccf(0x132)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x1f32ea[_0x530ccf(0x15c)]('params')));},async 'execute'(_0x16f08c){const _0x4d4548=_0x3b32c3,_0x35db85=_0x16f08c[_0x4d4548(0x15c)](_0x4d4548(0x125)),_0x61423a=_0x232534[_0x4d4548(0x11d)]===_0x4d4548(0x132)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x16f08c[_0x4d4548(0x15c)](_0x4d4548(0x14b)))):parseJsonParams(_0x16f08c['str'](_0x4d4548(0x14b)))??{},_0x4746d5=Date[_0x4d4548(0x11e)](),_0x18e044=await executeData(_0x35db85,_0x232534[_0x4d4548(0x11d)],_0x61423a),_0x542c14=Date['now']()-_0x4746d5;return{'ok':!![],'data':{'result':_0x18e044,'elapsed':_0x542c14},'message':_0x4d4548(0x151)+_0x232534[_0x4d4548(0x123)]+_0x4d4548(0x12d)+_0x542c14+'ms'};}};return _0x232534['risk']!==_0x3b32c3(0x159)&&(_0x1144a6[_0x3b32c3(0x13d)]=async _0x3ecde9=>{const _0x26c1af=_0x3b32c3,_0x45c064=_0x3ecde9['str'](_0x26c1af(0x125)),_0x22d16e=_0x232534['operation']===_0x26c1af(0x132)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x3ecde9[_0x26c1af(0x15c)](_0x26c1af(0x14b)))):parseJsonParams(_0x3ecde9['str'](_0x26c1af(0x14b)))??{};return dryRun(_0x26c1af(0x149),_0x26c1af(0x13c)+_0x45c064+'/'+_0x232534['operation'])[_0x26c1af(0x15b)](_0x22d16e)[_0x26c1af(0x12f)](_0x26c1af(0x122)+_0x232534['command']+_0x26c1af(0x10c)+_0x45c064)[_0x26c1af(0x11f)]();}),_0x1144a6;}export const dataDefinitions=specs[a18_0xe689e6(0x12b)](makeDataCommand);
|
|
1
|
+
function a18_0x84fe(_0x2c0f53,_0x18ecc7){_0x2c0f53=_0x2c0f53-0x179;const _0x268342=a18_0x2683();let _0x84fee0=_0x268342[_0x2c0f53];return _0x84fee0;}const a18_0x2db958=a18_0x84fe;(function(_0x293acc,_0x1a5aea){const _0x4784f6=a18_0x84fe,_0x240410=_0x293acc();while(!![]){try{const _0x3e6efd=-parseInt(_0x4784f6(0x1a7))/0x1*(-parseInt(_0x4784f6(0x1c2))/0x2)+-parseInt(_0x4784f6(0x199))/0x3*(-parseInt(_0x4784f6(0x198))/0x4)+-parseInt(_0x4784f6(0x1ad))/0x5+parseInt(_0x4784f6(0x18e))/0x6*(parseInt(_0x4784f6(0x1cb))/0x7)+parseInt(_0x4784f6(0x17a))/0x8+-parseInt(_0x4784f6(0x19b))/0x9+parseInt(_0x4784f6(0x191))/0xa*(-parseInt(_0x4784f6(0x185))/0xb);if(_0x3e6efd===_0x1a5aea)break;else _0x240410['push'](_0x240410['shift']());}catch(_0x57cf3e){_0x240410['push'](_0x240410['shift']());}}}(a18_0x2683,0xd278e));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a18_0x2db958(0x18b),'operation':a18_0x2db958(0x18b),'risk':a18_0x2db958(0x17b),'paramsRequired':![],'description':a18_0x2db958(0x1a3),'paramsHint':'JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20'+a18_0x2db958(0x17e),'helpExtra':[a18_0x2db958(0x1bc),a18_0x2db958(0x1af),a18_0x2db958(0x1cc),a18_0x2db958(0x193),a18_0x2db958(0x1a0),a18_0x2db958(0x1a1),a18_0x2db958(0x1c3),a18_0x2db958(0x1a5),a18_0x2db958(0x1ba),'\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_0x2db958(0x19a),'',a18_0x2db958(0x182),a18_0x2db958(0x1b1),'\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_0x2db958(0x1b6),a18_0x2db958(0x19e),a18_0x2db958(0x1c1),a18_0x2db958(0x1aa),a18_0x2db958(0x1bf),'\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','',a18_0x2db958(0x1ac),a18_0x2db958(0x1bd),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27',a18_0x2db958(0x1b3)][a18_0x2db958(0x196)]('\x0a')},{'command':a18_0x2db958(0x1ce),'operation':a18_0x2db958(0x1ce),'risk':a18_0x2db958(0x17b),'paramsRequired':!![],'description':a18_0x2db958(0x1be),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a18_0x2db958(0x1ca),'operation':a18_0x2db958(0x1ca),'risk':'write','paramsRequired':!![],'description':a18_0x2db958(0x195),'paramsHint':a18_0x2db958(0x187)},{'command':a18_0x2db958(0x1a2),'operation':a18_0x2db958(0x1a2),'risk':'write','paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','paramsHint':'JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27'},{'command':a18_0x2db958(0x17f),'operation':'update','risk':a18_0x2db958(0x1c5),'paramsRequired':!![],'description':a18_0x2db958(0x18a),'paramsHint':a18_0x2db958(0x19d)},{'command':a18_0x2db958(0x183),'operation':'delete','risk':'high-risk-write','paramsRequired':!![],'description':a18_0x2db958(0x190),'paramsHint':a18_0x2db958(0x1c6)},{'command':'aggregate','operation':a18_0x2db958(0x1cd),'risk':a18_0x2db958(0x17b),'paramsRequired':![],'description':a18_0x2db958(0x1b4),'paramsHint':a18_0x2db958(0x1bb)+'Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','helpExtra':[a18_0x2db958(0x19f),'\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20field\x20values\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}',a18_0x2db958(0x181),a18_0x2db958(0x1c7),a18_0x2db958(0x186),a18_0x2db958(0x1c8),a18_0x2db958(0x179),'\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}','',a18_0x2db958(0x1c4),a18_0x2db958(0x192),'\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)',a18_0x2db958(0x188),a18_0x2db958(0x1b9),a18_0x2db958(0x1b8),a18_0x2db958(0x1a4),'','\x20\x20EXAMPLES',a18_0x2db958(0x1ae),a18_0x2db958(0x180),'',a18_0x2db958(0x189),a18_0x2db958(0x1a6)][a18_0x2db958(0x196)]('\x0a')}];function makeDataCommand(_0x5a7695){const _0x9b55bf=a18_0x2db958,_0x3cd155=_0x9b55bf(0x1c9)+_0x5a7695['command'],_0x55f3f2={'service':_0x9b55bf(0x18f),'command':_0x5a7695['command'],'description':_0x5a7695[_0x9b55bf(0x1c0)],'risk':_0x5a7695[_0x9b55bf(0x18d)],'helpExtra':_0x5a7695[_0x9b55bf(0x1a8)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x5a7695[_0x9b55bf(0x1ab)]}],'validate':async _0x541755=>{const _0x128050=_0x9b55bf;_0x5a7695[_0x128050(0x17c)]&&requireAnyOf(_0x541755,[_0x128050(0x1a9)],_0x3cd155),_0x5a7695['operation']==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x541755[_0x128050(0x1b7)](_0x128050(0x1a9))));},async 'execute'(_0x2f63dc){const _0x383560=_0x9b55bf,_0x4949f1=_0x2f63dc['str'](_0x383560(0x1b5)),_0x114832=_0x5a7695[_0x383560(0x194)]===_0x383560(0x1a2)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x2f63dc[_0x383560(0x1b7)]('params'))):parseJsonParams(_0x2f63dc['str']('params'))??{},_0x16165c=Date[_0x383560(0x19c)](),_0x41851e=await executeData(_0x4949f1,_0x5a7695[_0x383560(0x194)],_0x114832),_0x56a8ed=Date[_0x383560(0x19c)]()-_0x16165c;return{'ok':!![],'data':{'result':_0x41851e,'elapsed':_0x56a8ed},'message':_0x383560(0x1c9)+_0x5a7695[_0x383560(0x17d)]+'\x20completed\x20in\x20'+_0x56a8ed+'ms'};}};return _0x5a7695['risk']!=='read'&&(_0x55f3f2[_0x9b55bf(0x184)]=async _0x3fb643=>{const _0x1a8676=_0x9b55bf,_0x3560f9=_0x3fb643['str'](_0x1a8676(0x1b5)),_0x3b0dc3=_0x5a7695['operation']==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x3fb643[_0x1a8676(0x1b7)](_0x1a8676(0x1a9)))):parseJsonParams(_0x3fb643[_0x1a8676(0x1b7)](_0x1a8676(0x1a9)))??{};return dryRun(_0x1a8676(0x18c),_0x1a8676(0x1b0)+_0x3560f9+'/'+_0x5a7695[_0x1a8676(0x194)])['body'](_0x3b0dc3)['description']('Preview:\x20data\x20'+_0x5a7695[_0x1a8676(0x17d)]+_0x1a8676(0x197)+_0x3560f9)[_0x1a8676(0x1b2)]();}),_0x55f3f2;}function a18_0x2683(){const _0x20bc9b=['data','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','17084810BXVGIT','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\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}}','operation','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','join','\x20on\x20dataset\x20','1868592bSwuah','3EpQkjA','\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}}','634140AkvOWd','now','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','\x20\x20AGGREGATE\x20TYPES','\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}}','batchCreate','Filter\x20dataset\x20records\x20with\x20query\x20conditions','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','\x20\x20\x20\x20--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','1662Zboalw','helpExtra','params','\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}]','paramsHint','\x20\x20PAGINATION','1435495QOvCax','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','\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}}','/api/{appCode}/','\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}}]}','build','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','code','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','str','\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\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','\x20\x20WHERE\x20OPERATORS','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','Get\x20a\x20single\x20record\x20by\x20ID','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','description','\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]','1906NkLzQE','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','\x20\x20PARAMS\x20STRUCTURE','write','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','\x20\x20\x20\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}','data\x20','create','2999528uqNCvM','\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}}','aggregate','getOne','\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}','6972520fZiiag','read','paramsRequired','command','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','update','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\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}','\x20\x20LOGICAL\x20COMBINATORS','delete','dryRun','22ssJxTW','\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}','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','Update\x20an\x20existing\x20record','filter','POST','risk','24JKhyok'];a18_0x2683=function(){return _0x20bc9b;};return a18_0x2683();}export const dataDefinitions=specs['map'](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a19_0xa6ed2e=a19_0x1b27;(function(_0x37a23c,_0x20c9b4){const _0x252837=a19_0x1b27,_0x3a0abc=_0x37a23c();while(!![]){try{const _0x38deaf=-parseInt(_0x252837(0x160))/0x1+parseInt(_0x252837(0x16b))/0x2+-parseInt(_0x252837(0x148))/0x3+-parseInt(_0x252837(0x16a))/0x4+-parseInt(_0x252837(0x135))/0x5*(-parseInt(_0x252837(0x13c))/0x6)+parseInt(_0x252837(0x163))/0x7*(-parseInt(_0x252837(0x150))/0x8)+parseInt(_0x252837(0x170))/0x9;if(_0x38deaf===_0x20c9b4)break;else _0x3a0abc['push'](_0x3a0abc['shift']());}catch(_0x21a600){_0x3a0abc['push'](_0x3a0abc['shift']());}}}(a19_0x502e,0x7cd31));function a19_0x1b27(_0x366197,_0x2b0696){_0x366197=_0x366197-0x12c;const _0x502e96=a19_0x502e();let _0x1b27c2=_0x502e96[_0x366197];return _0x1b27c2;}import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x3a4579){const _0x49330a=a19_0x1b27;if(_0x3a4579['deleted'])return null;const _0x5ee3f9=Boolean(_0x3a4579[_0x49330a(0x15a)]!==undefined||_0x3a4579[_0x49330a(0x156)]!==undefined);let _0x2b8bbe={};if(!_0x5ee3f9&&typeof _0x3a4579['extend']==='string')try{_0x2b8bbe=JSON['parse'](_0x3a4579['extend']);}catch{}const _0x1dae95=_0x5ee3f9?_0x3a4579[_0x49330a(0x136)]:_0x3a4579[_0x49330a(0x15e)],_0xb4e1b=_0x5ee3f9?_0x3a4579['displayName']:_0x3a4579[_0x49330a(0x136)],_0x1b9b24=_0x5ee3f9?_0x3a4579[_0x49330a(0x156)]:_0x3a4579[_0x49330a(0x158)]||_0x3a4579[_0x49330a(0x159)],_0x33b8b4=_0x5ee3f9?_0x3a4579[_0x49330a(0x12e)]===!![]:_0x2b8bbe[_0x49330a(0x12e)]===!![],_0x4a2819=_0x5ee3f9?_0x3a4579[_0x49330a(0x13f)]===!![]:_0x2b8bbe[_0x49330a(0x13f)]===!![],_0x33a18b=_0x5ee3f9?_0x3a4579[_0x49330a(0x139)]??null:_0x2b8bbe['options']??null,_0x17fcf0={'name':_0x1dae95,'displayName':_0xb4e1b||_0x1dae95,'type':_0x1b9b24,'dbType':_0x3a4579['dbType'],'pk':_0x33b8b4,'required':_0x4a2819,'description':_0x3a4579[_0x49330a(0x15f)]||undefined};return Array['isArray'](_0x33a18b)&&_0x33a18b['length']>0x0&&(_0x17fcf0[_0x49330a(0x139)]=_0x33a18b),_0x17fcf0;}function parseJsonMaybe(_0x1eb517){const _0xb6bde4=a19_0x1b27;if(typeof _0x1eb517!==_0xb6bde4(0x133))return _0x1eb517;try{return JSON[_0xb6bde4(0x145)](_0x1eb517);}catch{return _0x1eb517;}}function normalizeOperationEntry(_0x340b21,_0x582b74){const _0x2896ed=a19_0x1b27;if(!_0x582b74||typeof _0x582b74!==_0x2896ed(0x14e))return null;if(!_0x582b74[_0x2896ed(0x12d)]||!_0x582b74[_0x2896ed(0x146)])return null;const _0x728fe3={'name':_0x340b21,'method':_0x582b74[_0x2896ed(0x12d)],'path':_0x582b74[_0x2896ed(0x146)]};if(_0x582b74[_0x2896ed(0x140)])_0x728fe3[_0x2896ed(0x140)]=_0x582b74[_0x2896ed(0x140)];if(_0x582b74[_0x2896ed(0x14f)]!=null)_0x728fe3[_0x2896ed(0x14f)]=parseJsonMaybe(_0x582b74[_0x2896ed(0x14f)]);if(_0x582b74['responseBody']!=null)_0x728fe3[_0x2896ed(0x14b)]=parseJsonMaybe(_0x582b74[_0x2896ed(0x14b)]);if(_0x582b74[_0x2896ed(0x165)]!=null)_0x728fe3[_0x2896ed(0x165)]=_0x582b74[_0x2896ed(0x165)];if(_0x582b74[_0x2896ed(0x15d)]!=null)_0x728fe3[_0x2896ed(0x15d)]=_0x582b74[_0x2896ed(0x15d)];if(Array[_0x2896ed(0x137)](_0x582b74[_0x2896ed(0x16c)]))_0x728fe3[_0x2896ed(0x16c)]=_0x582b74[_0x2896ed(0x16c)];if(Array['isArray'](_0x582b74[_0x2896ed(0x166)]))_0x728fe3[_0x2896ed(0x166)]=_0x582b74[_0x2896ed(0x166)];return _0x728fe3;}function summarizeDbtable(_0x458d2f){const _0x59037b=a19_0x1b27,_0x1b2b94={},_0x924410=[_0x59037b(0x174),_0x59037b(0x173),_0x59037b(0x13b),'datasetKey','pkField','allFields','logicField',_0x59037b(0x16d),_0x59037b(0x141),_0x59037b(0x14a),_0x59037b(0x134),_0x59037b(0x161),'modifierNameField','labelField',_0x59037b(0x14c)];for(const _0x498930 of _0x924410){if(_0x458d2f[_0x498930]!==undefined)_0x1b2b94[_0x498930]=_0x458d2f[_0x498930];}return typeof _0x1b2b94[_0x59037b(0x171)]===_0x59037b(0x133)&&_0x1b2b94[_0x59037b(0x171)][_0x59037b(0x162)]>0x0&&(_0x1b2b94['allFieldNames']=_0x1b2b94[_0x59037b(0x171)]['split'](',')['map'](_0x4a7135=>_0x4a7135[_0x59037b(0x14d)]())['filter'](Boolean)),_0x1b2b94;}function normalizeRelatedPages(_0x33f24c){const _0x2ff8c7=a19_0x1b27;if(!Array[_0x2ff8c7(0x137)](_0x33f24c))return[];return _0x33f24c[_0x2ff8c7(0x142)](_0x193206=>_0x193206&&typeof _0x193206===_0x2ff8c7(0x14e))[_0x2ff8c7(0x16e)](_0x51e912=>({'id':_0x51e912['id'],'type':_0x51e912[_0x2ff8c7(0x158)],'code':_0x51e912['code'],'title':_0x51e912['title'],'deleted':_0x51e912['deleted']===!![]}));}function normalizeFallbackFieldName(_0x1e3dd7,_0x4b9758){const _0x16bc08=a19_0x1b27,_0x10ac50=_0x1e3dd7[_0x16bc08(0x14d)]();if(!_0x10ac50)return null;return{'name':_0x10ac50,'displayName':_0x10ac50,'type':undefined,'dbType':undefined,'pk':_0x10ac50===_0x4b9758,'required':![],'description':undefined};}async function loadListFieldFallback(_0x17104e,_0x4fc499){const _0x222a7d=a19_0x1b27;if(!_0x17104e||!_0x4fc499)return[];try{const _0x360384=await listDatasets(_0x17104e,{'code':_0x4fc499}),_0x318579=_0x360384[_0x222a7d(0x152)](_0x10d31b=>_0x10d31b[_0x222a7d(0x15e)]===_0x4fc499)??_0x360384[0x0],_0x5d846c=_0x318579?.['dbtableConfig']??{},_0x41dbc5=typeof _0x5d846c['allFields']===_0x222a7d(0x133)?_0x5d846c[_0x222a7d(0x171)][_0x222a7d(0x15c)](','):[];return _0x41dbc5[_0x222a7d(0x16e)](_0x4a0fda=>normalizeFallbackFieldName(_0x4a0fda,_0x5d846c[_0x222a7d(0x12e)]))[_0x222a7d(0x142)](_0x3c3055=>_0x3c3055!==null);}catch{return[];}}function a19_0x502e(){const _0x491ae1=['read','split','afterScriptId','code','description','630456hPZqLJ','modifierIdField','length','231091xCSRxu','str','beforeScriptId','responseFields','relations','formatRules','toDatasetCode','629308uJdSAi','1543710UOgAJB','requestFields','createTimeField','map','sourceType','4490874OrQIhH','allFields','validateRules','dbName','dbId','modelId','method','pkField','datasetKey','doVersion','columnCodeListWithDeleted','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','string','creatorNameField','400515BLTTca','name','isArray','toField','options','operations','tableName','66TIcjqA','indexes','fromField','required','host','updateTimeField','filter','entries','properties','parse','path','tableComment','2459691QtmVLH','dbtableConfig','creatorIdField','responseBody','dblinkInfoDTO','trim','object','requestBody','8nloWbV','extend','find','fields','dataset','toFieldLabel','doType','appCode','type','dataType','displayName'];a19_0x502e=function(){return _0x491ae1;};return a19_0x502e();}export const datasetDetail={'service':a19_0xa6ed2e(0x154),'command':'detail','description':a19_0xa6ed2e(0x132),'risk':a19_0xa6ed2e(0x15b),'flags':[CODE_FLAG],async 'execute'(_0x1b7196){const _0x2fb543=a19_0xa6ed2e,_0x1bf3c9=await getDatasetDetail(_0x1b7196['str'](_0x2fb543(0x15e))),_0x255149=Array[_0x2fb543(0x137)](_0x1bf3c9[_0x2fb543(0x153)])?_0x1bf3c9[_0x2fb543(0x153)]:Array[_0x2fb543(0x137)](_0x1bf3c9[_0x2fb543(0x144)])?_0x1bf3c9[_0x2fb543(0x144)]:[];let _0x5cf4c8=_0x255149['map'](_0x2d56dc=>normalizeField(_0x2d56dc))[_0x2fb543(0x142)](_0x4bd79f=>_0x4bd79f!==null);_0x5cf4c8[_0x2fb543(0x162)]===0x0&&(_0x5cf4c8=await loadListFieldFallback(_0x1b7196[_0x2fb543(0x157)],_0x1b7196[_0x2fb543(0x164)](_0x2fb543(0x15e))));const _0x5e9955=_0x1bf3c9[_0x2fb543(0x13a)]??{},_0x2e6b06=[];for(const [_0xdb8dd1,_0x3022b7]of Object[_0x2fb543(0x143)](_0x5e9955)){const _0x5f2945=normalizeOperationEntry(_0xdb8dd1,_0x3022b7);if(_0x5f2945)_0x2e6b06['push'](_0x5f2945);}const _0x4d146a=_0x1bf3c9[_0x2fb543(0x149)]??{},_0x232c22=_0x1bf3c9[_0x2fb543(0x154)]??{},_0x2cc63f=_0x4d146a[_0x2fb543(0x174)]!=null?{'id':_0x4d146a[_0x2fb543(0x174)],'name':_0x4d146a[_0x2fb543(0x173)]??null}:undefined;let _0x4a0368;return typeof _0x1bf3c9[_0x2fb543(0x151)]===_0x2fb543(0x133)&&(_0x4a0368=parseJsonMaybe(_0x1bf3c9[_0x2fb543(0x151)])),{'ok':!![],'data':{'id':_0x1bf3c9[_0x2fb543(0x12c)]??_0x1bf3c9['id'],'name':_0x1bf3c9[_0x2fb543(0x136)],'code':_0x1bf3c9['modelCode']||_0x1bf3c9[_0x2fb543(0x15e)],'doVersion':_0x1bf3c9[_0x2fb543(0x130)],'description':_0x1bf3c9['description']||_0x232c22[_0x2fb543(0x147)]||undefined,'source':_0x1bf3c9['source']||_0x232c22[_0x2fb543(0x16f)],'table':_0x4d146a[_0x2fb543(0x13b)]||_0x232c22[_0x2fb543(0x13b)],'datasetKey':_0x4d146a[_0x2fb543(0x12f)],'pk':_0x4d146a[_0x2fb543(0x12e)],'db':_0x2cc63f,'dbtable':summarizeDbtable(_0x4d146a),'fields':_0x5cf4c8,'operations':_0x2e6b06,'indexes':Array[_0x2fb543(0x137)](_0x232c22[_0x2fb543(0x13d)])?_0x232c22[_0x2fb543(0x13d)]:[],'relations':Array[_0x2fb543(0x137)](_0x1bf3c9[_0x2fb543(0x167)])?_0x1bf3c9['relations']['map'](_0x4e9ee1=>({'fromField':_0x4e9ee1[_0x2fb543(0x13e)],'toDataset':_0x4e9ee1['toDatasetName'],'toCode':_0x4e9ee1[_0x2fb543(0x169)],'toTable':_0x4e9ee1['toTableName'],'toField':_0x4e9ee1[_0x2fb543(0x138)],'labelField':_0x4e9ee1[_0x2fb543(0x155)]||undefined})):[],'relatedPages':normalizeRelatedPages(_0x1bf3c9['relatedPageInfoList']),...Array[_0x2fb543(0x137)](_0x1bf3c9['columnCodeListWithDeleted'])?{'columnCodeListWithDeleted':_0x1bf3c9[_0x2fb543(0x131)]}:{},'formatRules':Array[_0x2fb543(0x137)](_0x1bf3c9[_0x2fb543(0x168)])?_0x1bf3c9['formatRules']:[],'validateRules':Array[_0x2fb543(0x137)](_0x1bf3c9[_0x2fb543(0x172)])?_0x1bf3c9[_0x2fb543(0x172)]:[],..._0x4a0368!==undefined?{'extend':_0x4a0368}:{},'stats':{'fieldCount':_0x5cf4c8[_0x2fb543(0x162)],'operationCount':_0x2e6b06['length']}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2e711e,_0x40507c){const _0x52cad2=a20_0x22dd,_0x144b18=_0x2e711e();while(!![]){try{const _0x4dc016=-parseInt(_0x52cad2(0xd0))/0x1+-parseInt(_0x52cad2(0xca))/0x2*(parseInt(_0x52cad2(0xcb))/0x3)+parseInt(_0x52cad2(0xcc))/0x4+-parseInt(_0x52cad2(0xd4))/0x5*(-parseInt(_0x52cad2(0xcf))/0x6)+-parseInt(_0x52cad2(0xd2))/0x7+-parseInt(_0x52cad2(0xd1))/0x8*(-parseInt(_0x52cad2(0xd3))/0x9)+-parseInt(_0x52cad2(0xcd))/0xa*(-parseInt(_0x52cad2(0xce))/0xb);if(_0x4dc016===_0x40507c)break;else _0x144b18['push'](_0x144b18['shift']());}catch(_0x3b936e){_0x144b18['push'](_0x144b18['shift']());}}}(a20_0xc530,0x9af0d));import{datasetList}from'../../commands/dataset/list.js';import{datasetDetail}from'../../commands/dataset/detail.js';function a20_0xc530(){const _0x5abf7c=['14853GUvzZR','330044TdWMxI','10hWvnYq','8682509eRYXsR','18CRWSmn','1054871XspUZM','8SNRNbA','3602347IZzvFA','10089927aHcpGG','607795DMUNmx','62fBwQLe'];a20_0xc530=function(){return _0x5abf7c;};return a20_0xc530();}import{datasetSdkDoc}from'../../commands/dataset/sdk-doc.js';function a20_0x22dd(_0x1afefb,_0x4d2211){_0x1afefb=_0x1afefb-0xca;const _0xc5309c=a20_0xc530();let _0x22dd1f=_0xc5309c[_0x1afefb];return _0x22dd1f;}export const datasetDefinitions=[datasetList,datasetDetail,datasetSdkDoc];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x170f95=a21_0x3f7b;(function(_0x33cdef,_0x327b8b){const _0x56e1e4=a21_0x3f7b,_0x1af2a2=_0x33cdef();while(!![]){try{const _0x47fe75=-parseInt(_0x56e1e4(0x1a0))/0x1+-parseInt(_0x56e1e4(0x1b1))/0x2*(-parseInt(_0x56e1e4(0x1af))/0x3)+-parseInt(_0x56e1e4(0x197))/0x4*(parseInt(_0x56e1e4(0x1b4))/0x5)+-parseInt(_0x56e1e4(0x19a))/0x6+parseInt(_0x56e1e4(0x1a4))/0x7+-parseInt(_0x56e1e4(0x1ad))/0x8+parseInt(_0x56e1e4(0x1aa))/0x9*(parseInt(_0x56e1e4(0x1a2))/0xa);if(_0x47fe75===_0x327b8b)break;else _0x1af2a2['push'](_0x1af2a2['shift']());}catch(_0x1914f4){_0x1af2a2['push'](_0x1af2a2['shift']());}}}(a21_0x4e47,0x5fca9));function a21_0x4e47(){const _0x4035ef=['string','read','5942792MeqJWK','split','3FAGlBd','tableName','1250614udJlYx','appCode','length','1375sloSET','2420HuKRcl','source','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','2609748VwSgeZ','pkField','code','map','Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)','name','385625HCowmE','list','450zcdLDk','str','1679762nbwkef','allFields','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','dbtableConfig','trim','description','251379RVwcDY'];a21_0x4e47=function(){return _0x4035ef;};return a21_0x4e47();}import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function a21_0x3f7b(_0x335d38,_0x447f95){_0x335d38=_0x335d38-0x197;const _0x4e4777=a21_0x4e47();let _0x3f7b66=_0x4e4777[_0x335d38];return _0x3f7b66;}export const datasetList={'service':'dataset','command':a21_0x170f95(0x1a1),'description':a21_0x170f95(0x199),'risk':a21_0x170f95(0x1ac),'flags':[{'name':a21_0x170f95(0x19f),'type':a21_0x170f95(0x1ab),'description':a21_0x170f95(0x19e)},{...CODE_FLAG,'required':![],'description':a21_0x170f95(0x1a6)}],async 'execute'(_0x582837){const _0x548940=a21_0x170f95,_0x264282=_0x582837['str'](_0x548940(0x19f)),_0x4e58cf=_0x582837[_0x548940(0x1a3)](_0x548940(0x19c)),_0xbef91a=await listDatasets(_0x582837[_0x548940(0x1b2)],{..._0x264282&&{'name':_0x264282},..._0x4e58cf&&{'code':_0x4e58cf}});return{'ok':!![],'data':{'total':_0xbef91a[_0x548940(0x1b3)],'datasets':_0xbef91a[_0x548940(0x19d)](_0x2315a0=>{const _0x471684=_0x548940,_0x308b25=_0x2315a0[_0x471684(0x1a7)]??{};return{'id':_0x2315a0['id'],'code':_0x2315a0[_0x471684(0x19c)],'name':_0x2315a0[_0x471684(0x19f)],'source':_0x2315a0[_0x471684(0x198)],'description':_0x2315a0[_0x471684(0x1a9)],'table':_0x308b25[_0x471684(0x1b0)],'datasetKey':_0x308b25['datasetKey'],'pk':_0x308b25[_0x471684(0x19b)],'fields':_0x308b25[_0x471684(0x1a5)]?_0x308b25[_0x471684(0x1a5)][_0x471684(0x1ae)](',')[_0x471684(0x19d)](_0x6892a4=>_0x6892a4[_0x471684(0x1a8)]()):[]};})}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a22_0x563d(){const _0x3d91ff=['string','1327808MFOcYv','Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','read','29829555NSnjZt','11212390IFWMQI','1172159pRaQbY','appCode','20tmDIfp','7399512TSvNpE','55806ZKCgxJ','dataset','sdk-doc','code','trim','1330404KMzQrb','Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','2mzqzIT','#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档'];a22_0x563d=function(){return _0x3d91ff;};return a22_0x563d();}const a22_0x325332=a22_0x1bfd;(function(_0x21331e,_0x2a3280){const _0x4dcee7=a22_0x1bfd,_0x29c60e=_0x21331e();while(!![]){try{const _0x47b682=parseInt(_0x4dcee7(0x185))/0x1*(-parseInt(_0x4dcee7(0x190))/0x2)+-parseInt(_0x4dcee7(0x189))/0x3+parseInt(_0x4dcee7(0x193))/0x4+parseInt(_0x4dcee7(0x187))/0x5*(-parseInt(_0x4dcee7(0x18e))/0x6)+-parseInt(_0x4dcee7(0x184))/0x7+parseInt(_0x4dcee7(0x188))/0x8+parseInt(_0x4dcee7(0x183))/0x9;if(_0x47b682===_0x2a3280)break;else _0x29c60e['push'](_0x29c60e['shift']());}catch(_0x5ae76e){_0x29c60e['push'](_0x29c60e['shift']());}}}(a22_0x563d,0xd9bab));import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function a22_0x1bfd(_0x1ff516,_0x13dcc3){_0x1ff516=_0x1ff516-0x183;const _0x563d8b=a22_0x563d();let _0x1bfdb4=_0x563d8b[_0x1ff516];return _0x1bfdb4;}const DEFAULT_MARKDOWN=a22_0x325332(0x191);export function formatDatasetSdkMarkdown(_0x102440){const _0x441e01=a22_0x325332,_0x422764=typeof _0x102440===_0x441e01(0x192)?_0x102440[_0x441e01(0x18d)]():'';return _0x422764||DEFAULT_MARKDOWN;}export const datasetSdkDoc={'service':a22_0x325332(0x18a),'command':a22_0x325332(0x18b),'description':a22_0x325332(0x18f),'risk':a22_0x325332(0x195),'flags':[{...CODE_FLAG,'description':a22_0x325332(0x194)}],async 'execute'(_0x1697af){const _0x42a083=a22_0x325332,_0x1bf799=_0x1697af['str'](_0x42a083(0x18c)),_0xc6033c=await getDatasetSdkUsageDoc(_0x1bf799,_0x1697af[_0x42a083(0x186)]);return{'ok':!![],'data':{'code':_0x1bf799,'appCode':_0x1697af[_0x42a083(0x186)],'markdown':formatDatasetSdkMarkdown(_0xc6033c)}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x5c471d=a23_0x4e9e;(function(_0x41e415,_0x1b2c22){const _0x10be3b=a23_0x4e9e,_0x5dc6ed=_0x41e415();while(!![]){try{const _0x2ddb9f=parseInt(_0x10be3b(0x11c))/0x1*(parseInt(_0x10be3b(0xef))/0x2)+-parseInt(_0x10be3b(0x113))/0x3+-parseInt(_0x10be3b(0xdd))/0x4+parseInt(_0x10be3b(0xde))/0x5+parseInt(_0x10be3b(0x106))/0x6*(parseInt(_0x10be3b(0x100))/0x7)+-parseInt(_0x10be3b(0xf4))/0x8*(-parseInt(_0x10be3b(0xea))/0x9)+-parseInt(_0x10be3b(0xe8))/0xa;if(_0x2ddb9f===_0x1b2c22)break;else _0x5dc6ed['push'](_0x5dc6ed['shift']());}catch(_0x50096f){_0x5dc6ed['push'](_0x5dc6ed['shift']());}}}(a23_0x3567,0x414bd));import a23_0x33679f from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';function a23_0x4e9e(_0x9ba071,_0x35283d){_0x9ba071=_0x9ba071-0xdd;const _0x3567f1=a23_0x3567();let _0x4e9ef2=_0x3567f1[_0x9ba071];return _0x4e9ef2;}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(_0x4f2599){const _0x3ef7b8=a23_0x4e9e,_0x17b61d=getCliVersion(),_0x47f486=buildConfigFromFlags({});await initGlobalEnvironment(_0x47f486),console['log'](),console['log'](a23_0x33679f[_0x3ef7b8(0xe6)](CLI_BIN_NAME+_0x3ef7b8(0x108))),console['log'](a23_0x33679f[_0x3ef7b8(0x117)]('─'[_0x3ef7b8(0x10a)](0x32))),console[_0x3ef7b8(0xfe)](_0x3ef7b8(0x11e)+_0x17b61d),console['log'](_0x3ef7b8(0xf3)+process[_0x3ef7b8(0xdf)]),console[_0x3ef7b8(0xfe)](_0x3ef7b8(0x119)+process['platform']+'\x20'+process[_0x3ef7b8(0x112)]),console[_0x3ef7b8(0xfe)](),console[_0x3ef7b8(0xfe)](a23_0x33679f[_0x3ef7b8(0xe6)]('\x20\x20Config\x20Files')),console[_0x3ef7b8(0xfe)](a23_0x33679f[_0x3ef7b8(0x117)](_0x3ef7b8(0x10e)[_0x3ef7b8(0x10a)](0x1e)));const _0x2df0f7=getGlobalConfigPath(),_0x42c2e2=getProjectConfigPath();console[_0x3ef7b8(0xfe)](_0x3ef7b8(0xff)+(_0x2df0f7||a23_0x33679f[_0x3ef7b8(0x117)]('(not\x20found)'))),console[_0x3ef7b8(0xfe)](_0x3ef7b8(0x10d)+(_0x42c2e2||a23_0x33679f['gray'](_0x3ef7b8(0xe2)))),console[_0x3ef7b8(0xfe)](),console[_0x3ef7b8(0xfe)](a23_0x33679f[_0x3ef7b8(0xe6)](_0x3ef7b8(0x116))),console[_0x3ef7b8(0xfe)](a23_0x33679f[_0x3ef7b8(0x117)](_0x3ef7b8(0x10e)['repeat'](0x1e)));const _0x7afb7a=(_0x12d3e2,_0xfbdbaf)=>{const _0x4986a6=_0x3ef7b8;if(!_0xfbdbaf){console[_0x4986a6(0xfe)]('\x20\x20'+_0x12d3e2[_0x4986a6(0x111)](0x11)+'\x20'+a23_0x33679f[_0x4986a6(0x117)]('(no\x20file)'));return;}const _0x31af25=inspectCliConfigJsonFile(_0xfbdbaf);if(_0x31af25[_0x4986a6(0x105)]==='ok')console[_0x4986a6(0xfe)]('\x20\x20'+_0x12d3e2[_0x4986a6(0x111)](0x11)+'\x20'+a23_0x33679f['green'](_0x4986a6(0xe7)));else{if(_0x31af25[_0x4986a6(0x105)]==='empty')console['log']('\x20\x20'+_0x12d3e2['padEnd'](0x11)+'\x20'+a23_0x33679f['yellow'](_0x4986a6(0xfb)));else _0x31af25[_0x4986a6(0x105)]===_0x4986a6(0xf5)?console[_0x4986a6(0xfe)]('\x20\x20'+_0x12d3e2[_0x4986a6(0x111)](0x11)+'\x20'+a23_0x33679f[_0x4986a6(0x117)](_0x4986a6(0x118))):(console['log']('\x20\x20'+_0x12d3e2[_0x4986a6(0x111)](0x11)+'\x20'+a23_0x33679f[_0x4986a6(0x107)]('✗\x20Invalid\x20JSON')),console[_0x4986a6(0xfe)]('\x20\x20'+''['padEnd'](0x11)+'\x20'+a23_0x33679f[_0x4986a6(0x107)](_0x31af25[_0x4986a6(0x102)])));}};_0x7afb7a(_0x3ef7b8(0x10b),_0x2df0f7),_0x7afb7a('Project',_0x42c2e2),console['log'](),console[_0x3ef7b8(0xfe)](a23_0x33679f[_0x3ef7b8(0xe6)](_0x3ef7b8(0xf0))),console[_0x3ef7b8(0xfe)](a23_0x33679f[_0x3ef7b8(0x117)](_0x3ef7b8(0x10e)[_0x3ef7b8(0x10a)](0x1e))),console[_0x3ef7b8(0xfe)]('\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x47f486[_0x3ef7b8(0x101)]||a23_0x33679f['red'](_0x3ef7b8(0xf2)))),console['log']('\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x47f486[_0x3ef7b8(0xf8)]);const _0x5c0885=isLegacyCompatConfigKey(_0x3ef7b8(0x104))?a23_0x33679f['gray'](_0x47f486['locale']+_0x3ef7b8(0xe4)):_0x47f486['locale'];return console[_0x3ef7b8(0xfe)](_0x3ef7b8(0xfc)+_0x5c0885),console[_0x3ef7b8(0xfe)](_0x3ef7b8(0x110)+(_0x47f486[_0x3ef7b8(0xe1)]||a23_0x33679f['gray'](_0x3ef7b8(0xe3)))),console['log'](_0x3ef7b8(0xe9)+(_0x47f486['currentApp']||a23_0x33679f[_0x3ef7b8(0x117)](_0x3ef7b8(0xe3)))),console[_0x3ef7b8(0xfe)]('\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x47f486[_0x3ef7b8(0x103)]||a23_0x33679f[_0x3ef7b8(0x117)]('(default:\x20'+DEFAULT_CONFIG_VALUES[_0x3ef7b8(0x103)]+')'))),console[_0x3ef7b8(0xfe)](_0x3ef7b8(0xe0)+(_0x47f486[_0x3ef7b8(0xeb)]??a23_0x33679f['gray'](_0x3ef7b8(0xfd)))),console[_0x3ef7b8(0xfe)](_0x3ef7b8(0x114)+_0x47f486['riskLevel']),console[_0x3ef7b8(0xfe)]('\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x47f486[_0x3ef7b8(0xf9)]),console[_0x3ef7b8(0xfe)](_0x3ef7b8(0x11a)+AUTH_MODE['ClientAk']),console[_0x3ef7b8(0xfe)](_0x3ef7b8(0xee)+(_0x47f486[_0x3ef7b8(0x11b)]?a23_0x33679f[_0x3ef7b8(0x10f)](_0x3ef7b8(0x115)+_0x47f486[_0x3ef7b8(0x11b)][_0x3ef7b8(0xec)]+')'):a23_0x33679f['gray'](_0x3ef7b8(0xe3)))),console['log'](),console[_0x3ef7b8(0xfe)](a23_0x33679f['bold']('\x20\x20API\x20Endpoints')),console[_0x3ef7b8(0xfe)](a23_0x33679f[_0x3ef7b8(0x117)](_0x3ef7b8(0x10e)[_0x3ef7b8(0x10a)](0x1e))),console[_0x3ef7b8(0xfe)](_0x3ef7b8(0xf6)+getApiDomain()),console[_0x3ef7b8(0xfe)]('\x20\x20userDomain:\x20\x20\x20\x20\x20\x20'+getUserDomain()),console[_0x3ef7b8(0xfe)]('\x20\x20runtimeDomain:\x20\x20\x20'+getRuntimeDomain()),console[_0x3ef7b8(0xfe)](),console[_0x3ef7b8(0xfe)](a23_0x33679f[_0x3ef7b8(0xe6)](_0x3ef7b8(0xfa))),console['log'](a23_0x33679f[_0x3ef7b8(0x117)]('\x20\x20─'['repeat'](0x1e))),console[_0x3ef7b8(0xfe)](_0x3ef7b8(0xf7)+a23_0x33679f[_0x3ef7b8(0x10f)](AUTH_MODE[_0x3ef7b8(0x109)]+_0x3ef7b8(0xe5))),console['log'](_0x3ef7b8(0xed)+a23_0x33679f[_0x3ef7b8(0x117)](_0x3ef7b8(0x11d))),console['log'](),{'ok':!![]};}function a23_0x3567(){const _0x5b4f0e=['\x20\x20Merged\x20Config','doctor','(not\x20set)','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','99120tYLKLH','missing','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','env','verbose','\x20\x20Auth','⚠\x20Empty\x20(treated\x20as\x20{})','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','(default)','log','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','2774261YhfKwa','appCode','message','format','locale','status','6PROMcL','red','\x20doctor','ClientAk','repeat','Global','check','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20─','green','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','padEnd','arch','738699zcInyn','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','(set,\x20length=','\x20\x20Config\x20JSON','gray','(missing)','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20auth\x20(effective):\x20','accessKey','2mIquXV','(removed\x20—\x20cookie\x20auth\x20disabled)','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','1956328zFJEPX','1337310xTuxuU','version','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','defaultApp','(not\x20found)','(none)','\x20(legacy/compat\x20only)','\x20(accessKey)','bold','✓\x20Valid\x20JSON','6386350vCWNaI','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','369CovUvb','pageSize','length','\x20\x20Session\x20check:\x20\x20\x20','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','469628pHjUTH'];a23_0x3567=function(){return _0x5b4f0e;};return a23_0x3567();}export const doctorDefinition={'service':a23_0x5c471d(0xf1),'command':a23_0x5c471d(0x10c),'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_0x4e7f28=a24_0x8d21;(function(_0x3e3a36,_0x4e44f6){const _0x5b01b1=a24_0x8d21,_0x3e1988=_0x3e3a36();while(!![]){try{const _0x26851e=parseInt(_0x5b01b1(0x22d))/0x1*(parseInt(_0x5b01b1(0x225))/0x2)+parseInt(_0x5b01b1(0x1f4))/0x3+-parseInt(_0x5b01b1(0x1fd))/0x4+parseInt(_0x5b01b1(0x1f9))/0x5+parseInt(_0x5b01b1(0x1f0))/0x6*(-parseInt(_0x5b01b1(0x1ec))/0x7)+-parseInt(_0x5b01b1(0x22e))/0x8*(parseInt(_0x5b01b1(0x21b))/0x9)+parseInt(_0x5b01b1(0x1fc))/0xa*(-parseInt(_0x5b01b1(0x212))/0xb);if(_0x26851e===_0x4e44f6)break;else _0x3e1988['push'](_0x3e1988['shift']());}catch(_0x50dccd){_0x3e1988['push'](_0x3e1988['shift']());}}}(a24_0x235a,0x7fffd));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':'appcode','type':a24_0x4e7f28(0x223),'description':a24_0x4e7f28(0x1f5)},{'name':a24_0x4e7f28(0x1ff),'type':a24_0x4e7f28(0x223),'description':a24_0x4e7f28(0x22b)+DEFAULT_CONFIG_VALUES['env']+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a24_0x4e7f28(0x1eb),'type':a24_0x4e7f28(0x224),'description':a24_0x4e7f28(0x227)+PRODUCT_CONFIG['newConfigFileName']+a24_0x4e7f28(0x21d),'default':![]},{'name':a24_0x4e7f28(0x20a),'type':'boolean','description':a24_0x4e7f28(0x1fa),'default':![]}];export const initImportFlagDefs=[{'name':a24_0x4e7f28(0x211),'type':'string','description':a24_0x4e7f28(0x20c),'required':!![]},{'name':a24_0x4e7f28(0x21c),'type':a24_0x4e7f28(0x223),'description':a24_0x4e7f28(0x209)},{'name':a24_0x4e7f28(0x1ff),'type':a24_0x4e7f28(0x223),'description':a24_0x4e7f28(0x1fb),'enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a24_0x4e7f28(0x224),'description':a24_0x4e7f28(0x227)+PRODUCT_CONFIG[a24_0x4e7f28(0x228)]+a24_0x4e7f28(0x21d),'default':![]},{'name':a24_0x4e7f28(0x20a),'type':'boolean','description':a24_0x4e7f28(0x1fa),'default':![]}];function a24_0x235a(){const _0x289b41=['project','env','Invalid\x20env\x20\x22','removeListener','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','[Y/n]','stdin','defaultApp','validation','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','AbortPrompt','Override\x20imported\x20default\x20appcode','yes','\x20init\x20—\x20Create\x20','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','stdout','Aborted.','\x20\x20config:\x20\x20','SIGINT','file','11bVBMsU','join','trim','apiDir','entries','):\x20','includes','message','race','18PjPOam','appcode',')\x20instead\x20of\x20project','log','app','\x0aInitialized\x20','riskLevel','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','string','boolean','864770WxgEik','object','Write\x20to\x20global\x20(~/','newConfigFileName','User\x20aborted\x20prompt','toLowerCase','Target\x20environment\x20(default\x20','\x20\x20appcode:\x20','1GrEINo','96848mhtYfL','once','question','Usage:\x20','close','cancelled','global','2433067gIzqyz','apps','Imported\x20from\x20','\x20already\x20exists.\x20Overwrite?','6vFKqQK','\x20\x20env:\x20\x20\x20\x20\x20','\x22.\x20Allowed:\x20','App\x20code','1521624amMQoF','App\x20code\x20for\x20the\x20project','name','flagMissing','parse','2543550ixmpDA','Skip\x20confirmation\x20when\x20overwriting','Override\x20imported\x20default\x20env','544010LbVsxL','1991296ipOhzC'];a24_0x235a=function(){return _0x289b41;};return a24_0x235a();}function a24_0x8d21(_0x2cf32d,_0x1249fd){_0x2cf32d=_0x2cf32d-0x1ea;const _0x235a91=a24_0x235a();let _0x8d2132=_0x235a91[_0x2cf32d];return _0x8d2132;}export async function runInit(_0x158cc6){const _0x533acd=a24_0x4e7f28,_0x184f10=isNonInteractiveMode(_0x158cc6),_0x35c647=_0x158cc6['global']?_0x533acd(0x1eb):_0x533acd(0x1fe),_0x32ff43=resolveWriteConfigPath(_0x35c647);try{_0x184f10?await runNonInteractive(_0x158cc6,_0x32ff43):await runInteractive(_0x158cc6,_0x32ff43);}catch(_0x4afec8){if(_0x4afec8 instanceof AbortPrompt)throw CliErrors[_0x533acd(0x1ea)]();throw _0x4afec8;}}export async function runInitImport(_0x13b393){const _0x42a847=a24_0x4e7f28,_0x7fe4db=_0x13b393[_0x42a847(0x1eb)]?_0x42a847(0x1eb):'project',_0x2970f5=resolveWriteConfigPath(_0x7fe4db);await runFromImport(_0x13b393,_0x2970f5);}const RUNTIME_IRRELEVANT_KEYS=new Set([a24_0x4e7f28(0x215)]);async function runFromImport(_0x2bba0b,_0x3352c5){const _0x20a285=a24_0x4e7f28,_0x5af7d2=resolveFilePath(_0x2bba0b[_0x20a285(0x211)]);if(!existsSync(_0x5af7d2))throw CliErrors['validation']('Source\x20file\x20not\x20found:\x20'+_0x5af7d2);const _0x10c21e=readSourceFile(_0x5af7d2),_0x4b1434=convertToRuntimeConfig(_0x10c21e);_0x2bba0b['appcode']&&(_0x4b1434[_0x20a285(0x21c)]=String(_0x2bba0b[_0x20a285(0x21c)]));_0x2bba0b[_0x20a285(0x1ff)]&&(_0x4b1434[_0x20a285(0x1ff)]=resolveInitEnv(_0x2bba0b));if(!_0x4b1434[_0x20a285(0x21c)])throw CliErrors['validation'](_0x20a285(0x222),'Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.');await writeInitConfig(_0x3352c5,_0x4b1434,_0x2bba0b),console[_0x20a285(0x21e)](_0x20a285(0x1ee)+_0x5af7d2),console[_0x20a285(0x21e)](_0x20a285(0x20f)+_0x3352c5),console['log'](_0x20a285(0x22c)+_0x4b1434[_0x20a285(0x21c)]);if(_0x4b1434['defaultApp'])console[_0x20a285(0x21e)]('\x20\x20default:\x20'+_0x4b1434[_0x20a285(0x205)]);}function convertToRuntimeConfig(_0x1867ce){const _0x2c1547=a24_0x4e7f28;if(_0x1867ce[_0x2c1547(0x1ed)]&&typeof _0x1867ce[_0x2c1547(0x1ed)]===_0x2c1547(0x226))throw CliErrors[_0x2c1547(0x206)](_0x2c1547(0x202),_0x2c1547(0x207));const _0x4b0ba5={};for(const _0x392824 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x1867ce[_0x392824]!==undefined&&(_0x4b0ba5[_0x392824]=_0x1867ce[_0x392824]);}return!_0x4b0ba5[_0x2c1547(0x221)]&&(_0x4b0ba5['riskLevel']=DEFAULT_CONFIG_VALUES['riskLevel']),_0x4b0ba5;}async function runNonInteractive(_0xac2c19,_0x108a55){const _0x455acf=a24_0x4e7f28,_0x40f2e8=_0xac2c19[_0x455acf(0x21c)];if(!_0x40f2e8)throw CliErrors[_0x455acf(0x1f7)](_0x455acf(0x21c),_0x455acf(0x231)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x3ff909=resolveInitEnv(_0xac2c19);await writeInitConfig(_0x108a55,{'appcode':_0x40f2e8,'env':_0x3ff909},_0xac2c19),console[_0x455acf(0x21e)]('Initialized\x20'+_0x108a55),console[_0x455acf(0x21e)](_0x455acf(0x22c)+_0x40f2e8),console[_0x455acf(0x21e)](_0x455acf(0x1f1)+_0x3ff909);}async function runInteractive(_0x1d131e,_0x41b0d8){const _0x5d8f46=a24_0x4e7f28,_0x771e14=loadExisting(_0x41b0d8),_0x5c948b=typeof _0x771e14?.[_0x5d8f46(0x21c)]===_0x5d8f46(0x223)?_0x771e14[_0x5d8f46(0x21c)]:'',_0x144072=resolveInitEnv(_0x1d131e);console[_0x5d8f46(0x21e)](CLI_BIN_NAME+_0x5d8f46(0x20b)+PRODUCT_CONFIG[_0x5d8f46(0x228)]+'\x0a');if(existsSync(_0x41b0d8)&&!_0x1d131e[_0x5d8f46(0x20a)]){const _0x2a580c=await promptYesNo('File\x20'+_0x41b0d8+_0x5d8f46(0x1ef),![]);if(!_0x2a580c){console[_0x5d8f46(0x21e)](_0x5d8f46(0x20e));return;}}const _0x23b3de=typeof _0x1d131e[_0x5d8f46(0x21c)]===_0x5d8f46(0x223)?_0x1d131e[_0x5d8f46(0x21c)][_0x5d8f46(0x214)]():'';let _0x154d1e=_0x23b3de;!_0x154d1e&&(_0x154d1e=await promptInput(_0x5d8f46(0x1f3),_0x5c948b));if(!_0x154d1e[_0x5d8f46(0x214)]())throw CliErrors['validation']('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x41b0d8,{'appcode':_0x154d1e[_0x5d8f46(0x214)](),'env':_0x144072},_0x1d131e),console['log'](_0x5d8f46(0x220)+_0x41b0d8),console[_0x5d8f46(0x21e)]('\x20\x20appcode:\x20'+_0x154d1e[_0x5d8f46(0x214)]()),console[_0x5d8f46(0x21e)](_0x5d8f46(0x1f1)+_0x144072);}async function writeInitConfig(_0x3491a4,_0x4cc7e2,_0x5c47cd){const _0x33a01f=a24_0x4e7f28;let _0x5abaaf={};existsSync(_0x3491a4)&&!_0x5c47cd[_0x33a01f(0x20a)]&&(_0x5abaaf=readConfigFile(_0x3491a4));for(const [_0x1fdfdc,_0x283c09]of Object[_0x33a01f(0x216)](_0x4cc7e2)){_0x283c09!==undefined&&(_0x5abaaf[_0x1fdfdc]=_0x283c09);}if(_0x5abaaf[_0x33a01f(0x21f)])delete _0x5abaaf[_0x33a01f(0x21f)];writeConfigFile(_0x3491a4,_0x5abaaf);}class AbortPrompt extends Error{constructor(){const _0x362e2f=a24_0x4e7f28;super(_0x362e2f(0x229)),this[_0x362e2f(0x1f6)]=_0x362e2f(0x208);}}function createSafeRl(){const _0x32a24=a24_0x4e7f28,_0x3cefac=createInterface({'input':process[_0x32a24(0x204)],'output':process[_0x32a24(0x20d)]});let _0x33c38a;const _0x4c1b3f=new Promise((_0x2c6cb5,_0x4adc36)=>{const _0x33fb2c=_0x32a24;_0x33c38a=()=>{const _0x2dc481=a24_0x8d21;_0x33c38a&&(_0x3cefac['removeListener'](_0x2dc481(0x210),_0x33c38a),_0x33c38a=undefined);try{_0x3cefac[_0x2dc481(0x232)]();}catch{}_0x4adc36(new AbortPrompt());},_0x3cefac[_0x33fb2c(0x22f)](_0x33fb2c(0x210),_0x33c38a);}),_0x3a5708=()=>{const _0x25dc00=_0x32a24;_0x33c38a&&(_0x3cefac[_0x25dc00(0x201)](_0x25dc00(0x210),_0x33c38a),_0x33c38a=undefined);try{_0x3cefac[_0x25dc00(0x232)]();}catch{}};return{'rl':_0x3cefac,'abortPromise':_0x4c1b3f,'disposeSuccess':_0x3a5708};}async function promptInput(_0x7298b9,_0x4be55b){const {rl:_0x37ad12,abortPromise:_0x29fdab,disposeSuccess:_0x54af12}=createSafeRl(),_0x385f10=new Promise(_0xe107dc=>{const _0x5b6592=a24_0x8d21,_0x5a9321=_0x4be55b?'\x20\x20'+_0x7298b9+'\x20('+_0x4be55b+_0x5b6592(0x217):'\x20\x20'+_0x7298b9+':\x20';_0x37ad12[_0x5b6592(0x230)](_0x5a9321,_0x16bd56=>{const _0x391a94=_0x5b6592;_0x54af12(),_0xe107dc(_0x16bd56[_0x391a94(0x214)]()||_0x4be55b);});});return Promise['race']([_0x385f10,_0x29fdab]);}async function promptYesNo(_0x1d7835,_0x540950){const _0x3506f1=a24_0x4e7f28,{rl:_0x193953,abortPromise:_0x1155af,disposeSuccess:_0x563823}=createSafeRl(),_0x10ae9d=new Promise(_0x340530=>{const _0x59de57=a24_0x8d21,_0x268ecd=_0x540950?_0x59de57(0x203):'[y/N]';_0x193953[_0x59de57(0x230)]('\x20\x20'+_0x1d7835+'\x20'+_0x268ecd+':\x20',_0x5d704c=>{const _0x325da1=_0x59de57;_0x563823();const _0x3e2870=_0x5d704c[_0x325da1(0x214)]()[_0x325da1(0x22a)]();if(_0x3e2870==='y'||_0x3e2870===_0x325da1(0x20a))_0x340530(!![]);else{if(_0x3e2870==='n'||_0x3e2870==='no')_0x340530(![]);else _0x340530(_0x540950);}});});return Promise[_0x3506f1(0x21a)]([_0x10ae9d,_0x1155af]);}function loadExisting(_0x3eda5e){if(!existsSync(_0x3eda5e))return null;return readConfigFile(_0x3eda5e);}function resolveFilePath(_0x1338db){return isAbsolute(_0x1338db)?_0x1338db:resolve(process['cwd'](),_0x1338db);}function readSourceFile(_0x50c84c){const _0x3636eb=a24_0x4e7f28;try{const _0x2a78e=readFileSync(_0x50c84c,{'encoding':'utf8'});return JSON[_0x3636eb(0x1f8)](_0x2a78e);}catch(_0x10a960){throw CliErrors[_0x3636eb(0x206)]('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x10a960[_0x3636eb(0x219)]);}}function resolveInitEnv(_0x30a957){const _0x97a3ce=a24_0x4e7f28,_0x4e73a2=_0x30a957[_0x97a3ce(0x1ff)];if(_0x4e73a2===undefined||_0x4e73a2==='')return DEFAULT_CONFIG_VALUES[_0x97a3ce(0x1ff)];if(!RUNTIME_ENV_VALUES[_0x97a3ce(0x218)](_0x4e73a2))throw CliErrors[_0x97a3ce(0x206)](_0x97a3ce(0x200)+_0x4e73a2+_0x97a3ce(0x1f2)+RUNTIME_ENV_VALUES[_0x97a3ce(0x213)](',\x20'));return _0x4e73a2;}
|
|
1
|
+
const a24_0x18b4ca=a24_0x20b4;(function(_0x18c848,_0x580daf){const _0x217c7e=a24_0x20b4,_0x104f95=_0x18c848();while(!![]){try{const _0x4b42a8=-parseInt(_0x217c7e(0xd7))/0x1+-parseInt(_0x217c7e(0xa0))/0x2*(-parseInt(_0x217c7e(0xbe))/0x3)+parseInt(_0x217c7e(0xcc))/0x4+parseInt(_0x217c7e(0xab))/0x5+parseInt(_0x217c7e(0xda))/0x6+parseInt(_0x217c7e(0xa9))/0x7+-parseInt(_0x217c7e(0xdc))/0x8;if(_0x4b42a8===_0x580daf)break;else _0x104f95['push'](_0x104f95['shift']());}catch(_0x1162eb){_0x104f95['push'](_0x104f95['shift']());}}}(a24_0x3b5c,0xe6059));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a24_0x18b4ca(0xaf),'type':a24_0x18b4ca(0xb1),'description':'App\x20code\x20for\x20the\x20project'},{'name':a24_0x18b4ca(0xac),'type':a24_0x18b4ca(0xb1),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES[a24_0x18b4ca(0xac)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a24_0x18b4ca(0xc1),'type':a24_0x18b4ca(0xbf),'description':a24_0x18b4ca(0xb2)+PRODUCT_CONFIG[a24_0x18b4ca(0xde)]+')\x20instead\x20of\x20project','default':![]},{'name':a24_0x18b4ca(0xc3),'type':'boolean','description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':a24_0x18b4ca(0xc6),'type':'string','description':a24_0x18b4ca(0xd1),'required':!![]},{'name':'appcode','type':a24_0x18b4ca(0xb1),'description':a24_0x18b4ca(0xb3)},{'name':a24_0x18b4ca(0xac),'type':a24_0x18b4ca(0xb1),'description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':a24_0x18b4ca(0xc1),'type':a24_0x18b4ca(0xbf),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a24_0x18b4ca(0xde)]+a24_0x18b4ca(0xa4),'default':![]},{'name':a24_0x18b4ca(0xc3),'type':a24_0x18b4ca(0xbf),'description':a24_0x18b4ca(0xb7),'default':![]}];export async function runInit(_0x2a21b5){const _0x113032=a24_0x18b4ca,_0x46be61=isNonInteractiveMode(_0x2a21b5),_0x454459=_0x2a21b5[_0x113032(0xc1)]?_0x113032(0xc1):_0x113032(0xb9),_0x58427f=resolveWriteConfigPath(_0x454459);try{_0x46be61?await runNonInteractive(_0x2a21b5,_0x58427f):await runInteractive(_0x2a21b5,_0x58427f);}catch(_0x4c2a3e){if(_0x4c2a3e instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0x4c2a3e;}}export async function runInitImport(_0x2fef1b){const _0x8eff76=a24_0x18b4ca,_0x322611=_0x2fef1b['global']?_0x8eff76(0xc1):'project',_0x2e6e87=resolveWriteConfigPath(_0x322611);await runFromImport(_0x2fef1b,_0x2e6e87);}const RUNTIME_IRRELEVANT_KEYS=new Set(['apiDir']);async function runFromImport(_0x405f79,_0x480207){const _0x5180d9=a24_0x18b4ca,_0x4739d4=resolveFilePath(_0x405f79[_0x5180d9(0xc6)]);if(!existsSync(_0x4739d4))throw CliErrors[_0x5180d9(0xbd)](_0x5180d9(0xa3)+_0x4739d4);const _0x1873cf=readSourceFile(_0x4739d4),_0x597345=convertToRuntimeConfig(_0x1873cf);_0x405f79[_0x5180d9(0xaf)]&&(_0x597345[_0x5180d9(0xaf)]=String(_0x405f79[_0x5180d9(0xaf)]));_0x405f79[_0x5180d9(0xac)]&&(_0x597345[_0x5180d9(0xac)]=resolveInitEnv(_0x405f79));if(!_0x597345[_0x5180d9(0xaf)])throw CliErrors[_0x5180d9(0xbd)](_0x5180d9(0xcf),_0x5180d9(0xd6));await writeInitConfig(_0x480207,_0x597345,_0x405f79),console[_0x5180d9(0xae)](_0x5180d9(0xd5)+_0x4739d4),console[_0x5180d9(0xae)]('\x20\x20config:\x20\x20'+_0x480207),console['log'](_0x5180d9(0xad)+_0x597345[_0x5180d9(0xaf)]);if(_0x597345[_0x5180d9(0xb4)])console[_0x5180d9(0xae)](_0x5180d9(0xba)+_0x597345[_0x5180d9(0xb4)]);}function convertToRuntimeConfig(_0x496c2a){const _0x28ed6f=a24_0x18b4ca;if(_0x496c2a[_0x28ed6f(0xd3)]&&typeof _0x496c2a[_0x28ed6f(0xd3)]==='object')throw CliErrors[_0x28ed6f(0xbd)](_0x28ed6f(0xdb),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x160c5e={};for(const _0x914184 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x496c2a[_0x914184]!==undefined&&(_0x160c5e[_0x914184]=_0x496c2a[_0x914184]);}return!_0x160c5e['riskLevel']&&(_0x160c5e['riskLevel']=DEFAULT_CONFIG_VALUES['riskLevel']),_0x160c5e;}async function runNonInteractive(_0x43a5fd,_0x129946){const _0x3876cb=a24_0x18b4ca,_0x420db0=_0x43a5fd[_0x3876cb(0xaf)];if(!_0x420db0)throw CliErrors[_0x3876cb(0xbc)](_0x3876cb(0xaf),_0x3876cb(0xbb)+CLI_BIN_NAME+_0x3876cb(0xca));const _0x4437c9=resolveInitEnv(_0x43a5fd);await writeInitConfig(_0x129946,{'appcode':_0x420db0,'env':_0x4437c9},_0x43a5fd),console[_0x3876cb(0xae)](_0x3876cb(0xcb)+_0x129946),console['log'](_0x3876cb(0xad)+_0x420db0),console[_0x3876cb(0xae)](_0x3876cb(0xa7)+_0x4437c9);}async function runInteractive(_0x45e569,_0x3b2182){const _0x55f0d3=a24_0x18b4ca,_0x20cb14=loadExisting(_0x3b2182),_0xa48eba=typeof _0x20cb14?.[_0x55f0d3(0xaf)]==='string'?_0x20cb14[_0x55f0d3(0xaf)]:'',_0x4d8157=resolveInitEnv(_0x45e569);console[_0x55f0d3(0xae)](CLI_BIN_NAME+_0x55f0d3(0xc7)+PRODUCT_CONFIG[_0x55f0d3(0xde)]+'\x0a');if(existsSync(_0x3b2182)&&!_0x45e569[_0x55f0d3(0xc3)]){const _0x907da9=await promptYesNo(_0x55f0d3(0xb5)+_0x3b2182+_0x55f0d3(0xc9),![]);if(!_0x907da9){console[_0x55f0d3(0xae)](_0x55f0d3(0x9f));return;}}const _0x58a2a6=typeof _0x45e569[_0x55f0d3(0xaf)]===_0x55f0d3(0xb1)?_0x45e569['appcode'][_0x55f0d3(0xc5)]():'';let _0x1db2a6=_0x58a2a6;!_0x1db2a6&&(_0x1db2a6=await promptInput(_0x55f0d3(0xc0),_0xa48eba));if(!_0x1db2a6[_0x55f0d3(0xc5)]())throw CliErrors[_0x55f0d3(0xbd)](_0x55f0d3(0xc4));await writeInitConfig(_0x3b2182,{'appcode':_0x1db2a6[_0x55f0d3(0xc5)](),'env':_0x4d8157},_0x45e569),console['log']('\x0aInitialized\x20'+_0x3b2182),console['log'](_0x55f0d3(0xad)+_0x1db2a6[_0x55f0d3(0xc5)]()),console[_0x55f0d3(0xae)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x4d8157);}async function writeInitConfig(_0x4a2bf0,_0x4a1e38,_0x3645e2){const _0x391338=a24_0x18b4ca;let _0x2311ec={};existsSync(_0x4a2bf0)&&!_0x3645e2[_0x391338(0xc3)]&&(_0x2311ec=readConfigFile(_0x4a2bf0));for(const [_0x151447,_0x2f8c42]of Object[_0x391338(0xa2)](_0x4a1e38)){_0x2f8c42!==undefined&&(_0x2311ec[_0x151447]=_0x2f8c42);}if(_0x2311ec['app'])delete _0x2311ec[_0x391338(0xa5)];writeConfigFile(_0x4a2bf0,_0x2311ec);}class AbortPrompt extends Error{constructor(){const _0x27fc52=a24_0x18b4ca;super('User\x20aborted\x20prompt'),this[_0x27fc52(0xb8)]=_0x27fc52(0xdf);}}function createSafeRl(){const _0x3378b1=a24_0x18b4ca,_0x911ee5=createInterface({'input':process['stdin'],'output':process[_0x3378b1(0xd8)]});let _0x24743b;const _0x21f649=new Promise((_0x35388c,_0x3d7f2c)=>{const _0xaa9027=_0x3378b1;_0x24743b=()=>{const _0x556fee=a24_0x20b4;_0x24743b&&(_0x911ee5[_0x556fee(0xb6)](_0x556fee(0xd0),_0x24743b),_0x24743b=undefined);try{_0x911ee5[_0x556fee(0xb0)]();}catch{}_0x3d7f2c(new AbortPrompt());},_0x911ee5[_0xaa9027(0xc8)](_0xaa9027(0xd0),_0x24743b);}),_0x307d2b=()=>{const _0x58444a=_0x3378b1;_0x24743b&&(_0x911ee5[_0x58444a(0xb6)](_0x58444a(0xd0),_0x24743b),_0x24743b=undefined);try{_0x911ee5[_0x58444a(0xb0)]();}catch{}};return{'rl':_0x911ee5,'abortPromise':_0x21f649,'disposeSuccess':_0x307d2b};}async function promptInput(_0x40d98c,_0x224219){const _0x3ab488=a24_0x18b4ca,{rl:_0x3a2809,abortPromise:_0x47e8e8,disposeSuccess:_0x5bfa9c}=createSafeRl(),_0x18ae13=new Promise(_0x551661=>{const _0x3e2e67=a24_0x20b4,_0x3ccf2a=_0x224219?'\x20\x20'+_0x40d98c+'\x20('+_0x224219+'):\x20':'\x20\x20'+_0x40d98c+':\x20';_0x3a2809[_0x3e2e67(0xdd)](_0x3ccf2a,_0x47975a=>{const _0x338fc5=_0x3e2e67;_0x5bfa9c(),_0x551661(_0x47975a[_0x338fc5(0xc5)]()||_0x224219);});});return Promise[_0x3ab488(0xc2)]([_0x18ae13,_0x47e8e8]);}function a24_0x3b5c(){const _0x46d87d=['apps','Invalid\x20env\x20\x22','Imported\x20from\x20','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`.','998449ARqwJu','stdout','utf8','9303048gCWeAJ','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','34145744kGIkhI','question','newConfigFileName','AbortPrompt','Aborted.','2XFqfID','toLowerCase','entries','Source\x20file\x20not\x20found:\x20',')\x20instead\x20of\x20project','app','[y/N]','\x20\x20env:\x20\x20\x20\x20\x20','includes','10431064iBVCov','parse','6514075ReJMjl','env','\x20\x20appcode:\x20','log','appcode','close','string','Write\x20to\x20global\x20(~/','Override\x20imported\x20default\x20appcode','defaultApp','File\x20','removeListener','Skip\x20confirmation\x20when\x20overwriting','name','project','\x20\x20default:\x20','Usage:\x20','flagMissing','validation','2273073ieiCWE','boolean','App\x20code','global','race','yes','App\x20code\x20cannot\x20be\x20empty.','trim','file','\x20init\x20—\x20Create\x20','once','\x20already\x20exists.\x20Overwrite?','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','Initialized\x20','4430680fbqjaH','message','Failed\x20to\x20parse\x20source\x20file:\x20','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','SIGINT','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','\x22.\x20Allowed:\x20'];a24_0x3b5c=function(){return _0x46d87d;};return a24_0x3b5c();}async function promptYesNo(_0x22e7d3,_0xa88ac3){const _0x9df08a=a24_0x18b4ca,{rl:_0x2b4f2d,abortPromise:_0x116eb4,disposeSuccess:_0x2fb46c}=createSafeRl(),_0x327888=new Promise(_0x2854be=>{const _0x375e6e=a24_0x20b4,_0xf0dff1=_0xa88ac3?'[Y/n]':_0x375e6e(0xa6);_0x2b4f2d['question']('\x20\x20'+_0x22e7d3+'\x20'+_0xf0dff1+':\x20',_0x23aef9=>{const _0x1b96ba=_0x375e6e;_0x2fb46c();const _0x3afbae=_0x23aef9[_0x1b96ba(0xc5)]()[_0x1b96ba(0xa1)]();if(_0x3afbae==='y'||_0x3afbae===_0x1b96ba(0xc3))_0x2854be(!![]);else{if(_0x3afbae==='n'||_0x3afbae==='no')_0x2854be(![]);else _0x2854be(_0xa88ac3);}});});return Promise[_0x9df08a(0xc2)]([_0x327888,_0x116eb4]);}function loadExisting(_0x5b8567){if(!existsSync(_0x5b8567))return null;return readConfigFile(_0x5b8567);}function resolveFilePath(_0x5a2573){return isAbsolute(_0x5a2573)?_0x5a2573:resolve(process['cwd'](),_0x5a2573);}function a24_0x20b4(_0x4c07db,_0x125c32){_0x4c07db=_0x4c07db-0x9f;const _0x3b5c74=a24_0x3b5c();let _0x20b420=_0x3b5c74[_0x4c07db];return _0x20b420;}function readSourceFile(_0x3d1c5a){const _0x270e20=a24_0x18b4ca;try{const _0x1df1c6=readFileSync(_0x3d1c5a,{'encoding':_0x270e20(0xd9)});return JSON[_0x270e20(0xaa)](_0x1df1c6);}catch(_0xd5fe86){throw CliErrors[_0x270e20(0xbd)](_0x270e20(0xce)+_0xd5fe86[_0x270e20(0xcd)]);}}function resolveInitEnv(_0x21e546){const _0x18a3c3=a24_0x18b4ca,_0x6be098=_0x21e546[_0x18a3c3(0xac)];if(_0x6be098===undefined||_0x6be098==='')return DEFAULT_CONFIG_VALUES[_0x18a3c3(0xac)];if(!RUNTIME_ENV_VALUES[_0x18a3c3(0xa8)](_0x6be098))throw CliErrors[_0x18a3c3(0xbd)](_0x18a3c3(0xd4)+_0x6be098+_0x18a3c3(0xd2)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x6be098;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x5a53eb=a25_0x5507;(function(_0x223ac7,_0x5d38f5){const _0x5cc438=a25_0x5507,_0x5304c3=_0x223ac7();while(!![]){try{const _0x133274=-parseInt(_0x5cc438(0x113))/0x1+parseInt(_0x5cc438(0xf1))/0x2*(-parseInt(_0x5cc438(0x11d))/0x3)+parseInt(_0x5cc438(0xf0))/0x4*(-parseInt(_0x5cc438(0xfa))/0x5)+parseInt(_0x5cc438(0xee))/0x6+parseInt(_0x5cc438(0x110))/0x7+-parseInt(_0x5cc438(0x102))/0x8+-parseInt(_0x5cc438(0x118))/0x9*(-parseInt(_0x5cc438(0xe8))/0xa);if(_0x133274===_0x5d38f5)break;else _0x5304c3['push'](_0x5304c3['shift']());}catch(_0xf79ce2){_0x5304c3['push'](_0x5304c3['shift']());}}}(a25_0x31cc,0x6c932));import{existsSync,readFileSync,statSync}from'node:fs';function a25_0x5507(_0x5da177,_0x7bdfea){_0x5da177=_0x5da177-0xe5;const _0x31ccc0=a25_0x31cc();let _0x550730=_0x31ccc0[_0x5da177];return _0x550730;}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';function a25_0x31cc(){const _0x36828c=['docId','/client/knowledge-base/personal/','write','string','read','5913648xJnxfU','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','title','--topk\x20must\x20be\x20a\x20positive\x20number.','File\x20path\x20is\x20required.','isFinite','appCode','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','Personal\x20knowledge-base\x20entry\x20ID','query','list','File\x20not\x20found:\x20','verbose','4931941HLTnrM','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','userId','32047QwlyQK','topk','str','Updated\x20KB\x20entry\x20','create','70542VTRwNI','ragStatus','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','body','scope','9zIwNUl','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','validation','Personal\x20knowledge-base\x20entry\x20title','weightedScore','metadata','ragErrorMessage','version','detail','content','1340lYQGbg','update','Created\x20KB\x20entry\x20','map','POST','number','2230968mwNVcZ','utf8','859756YWKoAI','463846CKuWjB','bool','file','length','/update','num','score','build','description','5zKhLqs','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id'];a25_0x31cc=function(){return _0x36828c;};return a25_0x31cc();}import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a25_0x5a53eb(0x105),'type':a25_0x5a53eb(0x100),'required':!![],'description':a25_0x5a53eb(0x120)},FILE_FLAG={'name':'file','type':'string','required':!![],'description':a25_0x5a53eb(0x10a)},QUERY_FLAG={'name':a25_0x5a53eb(0x10c),'type':a25_0x5a53eb(0x100),'required':!![],'description':a25_0x5a53eb(0x11a)},TOPK_FLAG={'name':a25_0x5a53eb(0x114),'type':a25_0x5a53eb(0xed),'description':'Maximum\x20number\x20of\x20search\x20hits\x20to\x20return'};function readKnowledgeFile(_0x39ddec){const _0x5e7296=a25_0x5a53eb;if(!_0x39ddec)throw CliErrors['validation'](_0x5e7296(0x107));if(!existsSync(_0x39ddec))throw CliErrors[_0x5e7296(0x11f)](_0x5e7296(0x10e)+_0x39ddec);if(!statSync(_0x39ddec)['isFile']())throw CliErrors[_0x5e7296(0x11f)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x39ddec);return readFileSync(_0x39ddec,_0x5e7296(0xef));}function summarizePersonalItem(_0x16f058){const _0x341cbd=a25_0x5a53eb;return{'id':_0x16f058['id'],'title':_0x16f058[_0x341cbd(0x105)],'version':_0x16f058[_0x341cbd(0xe5)],'ragStatus':_0x16f058[_0x341cbd(0x119)],'ragErrorMessage':_0x16f058['ragErrorMessage'],'updateTime':_0x16f058['updateTime']};}function detailPersonalItem(_0x1478bc){const _0x3c345d=a25_0x5a53eb;return{'id':_0x1478bc['id'],'appCode':_0x1478bc[_0x3c345d(0x109)],'scope':_0x1478bc[_0x3c345d(0x11c)],'userId':_0x1478bc[_0x3c345d(0x112)],'title':_0x1478bc[_0x3c345d(0x105)],'content':_0x1478bc[_0x3c345d(0xe7)]??'','version':_0x1478bc[_0x3c345d(0xe5)],'ragStatus':_0x1478bc['ragStatus'],'ragErrorMessage':_0x1478bc[_0x3c345d(0x123)],'createTime':_0x1478bc['createTime'],'updateTime':_0x1478bc['updateTime']};}function summarizeSearchHit(_0x434eb6){const _0x15b893=a25_0x5a53eb;return{'scope':_0x434eb6[_0x15b893(0x11c)],'docId':_0x434eb6[_0x15b893(0xfd)],'score':_0x434eb6[_0x15b893(0xf7)],'weightedScore':_0x434eb6[_0x15b893(0x121)],'content':_0x434eb6['content'],'metadata':_0x434eb6[_0x15b893(0x122)]};}function readTopK(_0x32b932){const _0x39c176=a25_0x5a53eb,_0x2da464=_0x32b932['flag']('topk');if(_0x2da464===undefined||_0x2da464===null||_0x2da464==='')return undefined;const _0x334eae=_0x32b932[_0x39c176(0xf6)]('topk');if(!Number[_0x39c176(0x108)](_0x334eae)||_0x334eae<0x1)throw CliErrors['validation'](_0x39c176(0x106));return _0x334eae;}const kbList={'service':'kb','command':a25_0x5a53eb(0x10d),'description':'List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','risk':a25_0x5a53eb(0x101),'flags':[VERBOSE_FLAG],async 'execute'(_0x4a3d72){const _0x221c79=a25_0x5a53eb,_0x3d59aa=await listPersonalKnowledgeBaseItems(_0x4a3d72[_0x221c79(0x109)]);if(_0x4a3d72[_0x221c79(0xf2)](_0x221c79(0x10f)))return{'ok':!![],'data':{'total':_0x3d59aa['length'],'items':_0x3d59aa}};return{'ok':!![],'data':{'total':_0x3d59aa[_0x221c79(0xf4)],'items':_0x3d59aa['map'](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a25_0x5a53eb(0xe6),'description':a25_0x5a53eb(0xfc),'risk':a25_0x5a53eb(0x101),'flags':[{...ID_FLAG,'description':a25_0x5a53eb(0x10b)}],async 'execute'(_0x1325db){const _0x55a9d6=a25_0x5a53eb,_0x219bbc=await getPersonalKnowledgeBaseItem(_0x1325db['num']('id'),_0x1325db[_0x55a9d6(0x109)]);return{'ok':!![],'data':detailPersonalItem(_0x219bbc)};}},kbCreate={'service':'kb','command':a25_0x5a53eb(0x117),'description':a25_0x5a53eb(0x104),'risk':a25_0x5a53eb(0xff),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0xb6f99c){const _0x5a520e=a25_0x5a53eb,_0x3e751b=_0xb6f99c[_0x5a520e(0x115)]('title'),_0x2254d7=readKnowledgeFile(_0xb6f99c['str']('file')),_0x411a0d=await createPersonalKnowledgeBaseItem(_0xb6f99c[_0x5a520e(0x109)],{'title':_0x3e751b,'content':_0x2254d7});return{'ok':!![],'data':summarizePersonalItem(_0x411a0d),'message':_0x5a520e(0xea)+_0x411a0d['id']+'\x20('+_0x411a0d[_0x5a520e(0x105)]+')'};},async 'dryRun'(_0x46ce9b){const _0x2c307f=a25_0x5a53eb,_0x469ea7=_0x46ce9b[_0x2c307f(0x115)](_0x2c307f(0x105)),_0x59789a=readKnowledgeFile(_0x46ce9b[_0x2c307f(0x115)](_0x2c307f(0xf3)));return dryRun('POST','/client/knowledge-base/personal/create')[_0x2c307f(0x11b)]({'appCode':_0x46ce9b[_0x2c307f(0x109)],'title':_0x469ea7,'content':_0x59789a})[_0x2c307f(0xf9)](_0x2c307f(0xfb)+_0x469ea7+'\x22')['build']();}},kbUpdate={'service':'kb','command':a25_0x5a53eb(0xe9),'description':a25_0x5a53eb(0x11e),'risk':a25_0x5a53eb(0xff),'flags':[{...ID_FLAG,'description':a25_0x5a53eb(0x10b)},{...TITLE_FLAG,'required':![],'description':'Override\x20the\x20existing\x20entry\x20title'},FILE_FLAG],async 'execute'(_0x2fdfde){const _0x301160=a25_0x5a53eb,_0x19d53c=_0x2fdfde[_0x301160(0xf6)]('id'),_0x14ad9a=readKnowledgeFile(_0x2fdfde['str'](_0x301160(0xf3))),_0x5a3fe1=_0x2fdfde['str'](_0x301160(0x105))||(await getPersonalKnowledgeBaseItem(_0x19d53c,_0x2fdfde[_0x301160(0x109)]))[_0x301160(0x105)],_0x220291=await updatePersonalKnowledgeBaseItem(_0x19d53c,_0x2fdfde['appCode'],{'title':_0x5a3fe1,'content':_0x14ad9a});return{'ok':!![],'data':summarizePersonalItem(_0x220291),'message':_0x301160(0x116)+_0x220291['id']+'\x20('+_0x220291[_0x301160(0x105)]+')'};},async 'dryRun'(_0x48ceef){const _0x11a5c0=a25_0x5a53eb,_0x30b0dd=_0x48ceef[_0x11a5c0(0xf6)]('id'),_0xd42acf=readKnowledgeFile(_0x48ceef['str'](_0x11a5c0(0xf3))),_0x2a198b=_0x48ceef['str'](_0x11a5c0(0x105))||(await getPersonalKnowledgeBaseItem(_0x30b0dd,_0x48ceef[_0x11a5c0(0x109)]))[_0x11a5c0(0x105)];return dryRun(_0x11a5c0(0xec),_0x11a5c0(0xfe)+_0x30b0dd+_0x11a5c0(0xf5))[_0x11a5c0(0x11b)]({'appCode':_0x48ceef[_0x11a5c0(0x109)],'title':_0x2a198b,'content':_0xd42acf})[_0x11a5c0(0xf9)](_0x11a5c0(0x103)+_0x30b0dd)[_0x11a5c0(0xf8)]();}},kbSearch={'service':'kb','command':'search','description':a25_0x5a53eb(0x111),'risk':a25_0x5a53eb(0x101),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x365251){const _0x36e3c3=a25_0x5a53eb;if(!_0x365251[_0x36e3c3(0x115)](_0x36e3c3(0x10c))['trim']())throw CliErrors['validation']('Search\x20query\x20is\x20required.');readTopK(_0x365251);},async 'execute'(_0x2ca8d7){const _0x35b8e9=a25_0x5a53eb,_0x3fc417=_0x2ca8d7[_0x35b8e9(0x115)](_0x35b8e9(0x10c))['trim'](),_0x36307c=readTopK(_0x2ca8d7),_0x547003=await searchKnowledgeBase(_0x2ca8d7[_0x35b8e9(0x109)],{'query':_0x3fc417,'topK':_0x36307c});return{'ok':!![],'data':{'total':_0x547003[_0x35b8e9(0xf4)],'hits':_0x547003[_0x35b8e9(0xeb)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x52f35c=a26_0x5ef9;(function(_0x1afed8,_0x31f330){const _0x510765=a26_0x5ef9,_0x96ecf9=_0x1afed8();while(!![]){try{const _0x494c60=parseInt(_0x510765(0x7b))/0x1+-parseInt(_0x510765(0x8d))/0x2*(parseInt(_0x510765(0x8e))/0x3)+-parseInt(_0x510765(0x75))/0x4+parseInt(_0x510765(0x84))/0x5*(parseInt(_0x510765(0x83))/0x6)+-parseInt(_0x510765(0x8c))/0x7*(-parseInt(_0x510765(0x71))/0x8)+parseInt(_0x510765(0x78))/0x9*(parseInt(_0x510765(0x8f))/0xa)+parseInt(_0x510765(0x73))/0xb;if(_0x494c60===_0x31f330)break;else _0x96ecf9['push'](_0x96ecf9['shift']());}catch(_0x54d6c9){_0x96ecf9['push'](_0x96ecf9['shift']());}}}(a26_0x185d,0xe2af0));function a26_0x185d(){const _0x450601=['594ApGDFY','10PrinXp','forEach','length','\x20\x20\x20Time:\x20','timestamp','\x20\x20\x20Details:\x20','\x20\x20\x20Duration:\x20','readLogs','1051792XQzmWJ','warn','6173244PmSpaA','error','7094780rFFJQH','*\x20No\x20logs\x20found','en-US','3598065KmaXzI','details','stringify','405163rMMPeq','clearLogs','Clear\x20command\x20history\x20logs','View\x20command\x20history\x20logs','log','*\x20Logs\x20cleared','clear','show','345174ObNRWc','5sAmIuV','duration','toLocaleString','command','level','success','logs','message','84qbJrrR','3022LwjIrm'];a26_0x185d=function(){return _0x450601;};return a26_0x185d();}import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function a26_0x5ef9(_0x3ee805,_0x25d1fe){_0x3ee805=_0x3ee805-0x6b;const _0x185d6e=a26_0x185d();let _0x5ef91b=_0x185d6e[_0x3ee805];return _0x5ef91b;}function printLogs(_0x2faa67){const _0x4a6650=a26_0x5ef9;if(_0x2faa67['length']===0x0){console[_0x4a6650(0x7f)](_0x4a6650(0x76));return;}console[_0x4a6650(0x7f)]('*\x20'+CLI_DISPLAY_NAME+'\x20logs:\x0a'),_0x2faa67[_0x4a6650(0x90)]((_0x58e87e,_0xf6638d)=>{const _0x546ddf=_0x4a6650,_0x3e41d7=new Date(_0x58e87e[_0x546ddf(0x6d)])[_0x546ddf(0x86)](_0x546ddf(0x77)),_0x133f26=_0x58e87e['level']===_0x546ddf(0x89)?'√':_0x58e87e[_0x546ddf(0x88)]===_0x546ddf(0x74)?'×':_0x58e87e['level']===_0x546ddf(0x72)?'!':'i';console[_0x546ddf(0x7f)](_0xf6638d+0x1+'.\x20'+_0x133f26+'\x20['+_0x58e87e[_0x546ddf(0x87)]+']\x20'+_0x58e87e[_0x546ddf(0x8b)]),console['log'](_0x546ddf(0x6c)+_0x3e41d7),_0x58e87e[_0x546ddf(0x85)]&&console[_0x546ddf(0x7f)](_0x546ddf(0x6f)+_0x58e87e[_0x546ddf(0x85)]+'ms'),_0x58e87e[_0x546ddf(0x79)]&&Object['keys'](_0x58e87e[_0x546ddf(0x79)])[_0x546ddf(0x6b)]>0x0&&console[_0x546ddf(0x7f)](_0x546ddf(0x6e)+JSON[_0x546ddf(0x7a)](_0x58e87e[_0x546ddf(0x79)],null,0x2)),console[_0x546ddf(0x7f)]('');});}export const logsDefinitions=[{'service':a26_0x52f35c(0x8a),'command':a26_0x52f35c(0x82),'description':a26_0x52f35c(0x7e),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x34ea34){const _0x10de13=a26_0x52f35c;return printLogs(logger[_0x10de13(0x70)]()),{'ok':!![]};}},{'service':'logs','command':a26_0x52f35c(0x81),'description':a26_0x52f35c(0x7d),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x12f420){const _0x200ce5=a26_0x52f35c;return logger[_0x200ce5(0x7c)](),console[_0x200ce5(0x7f)](_0x200ce5(0x80)),{'ok':!![]};}}];
|