@lovrabet/lovrabet-cli 2.0.14-beta.2 → 2.0.14-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a15_0x553f34=a15_0x4413;function a15_0x1b4a(){const _0x4be696=['42202dPscwj','Return\x20full\x20raw\x20response\x20object','verbose','number','120195BpgJsS','6RWBiIw','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','659331qMmohr','params','2951824vSOevd','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','code','10LxhFvK','string','name','4372851qyylBZ','2364312fBxptk','Resource\x20name\x20for\x20lookup','257338LJOwxJ','Dataset\x20code\x20(32-char\x20hex\x20UUID)','80isItLB','sqlcode','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)'];a15_0x1b4a=function(){return _0x4be696;};return a15_0x1b4a();}(function(_0x55453a,_0x2fe070){const _0x3b5b09=a15_0x4413,_0x4e7220=_0x55453a();while(!![]){try{const _0x4dbef8=parseInt(_0x3b5b09(0x165))/0x1+parseInt(_0x3b5b09(0x16a))/0x2*(-parseInt(_0x3b5b09(0x16f))/0x3)+parseInt(_0x3b5b09(0x167))/0x4*(-parseInt(_0x3b5b09(0x16e))/0x5)+-parseInt(_0x3b5b09(0x163))/0x6+parseInt(_0x3b5b09(0x179))/0x7+parseInt(_0x3b5b09(0x173))/0x8+-parseInt(_0x3b5b09(0x171))/0x9*(-parseInt(_0x3b5b09(0x176))/0xa);if(_0x4dbef8===_0x2fe070)break;else _0x4e7220['push'](_0x4e7220['shift']());}catch(_0xfe13d8){_0x4e7220['push'](_0x4e7220['shift']());}}}(a15_0x1b4a,0x636c2));export const CODE_FLAG={'name':a15_0x553f34(0x175),'type':'string','required':!![],'description':a15_0x553f34(0x166),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':'a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)'}};export const SQLCODE_FLAG={'name':a15_0x553f34(0x168),'type':a15_0x553f34(0x177),'required':!![],'description':a15_0x553f34(0x174),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a15_0x553f34(0x169)}};export const VERBOSE_FLAG={'name':a15_0x553f34(0x16c),'type':'boolean','description':a15_0x553f34(0x16b)};function a15_0x4413(_0x221813,_0x3762cd){_0x221813=_0x221813-0x163;const _0x1b4ae1=a15_0x1b4a();let _0x4413f1=_0x1b4ae1[_0x221813];return _0x4413f1;}export const PARAMS_FLAG={'name':a15_0x553f34(0x172),'type':a15_0x553f34(0x177),'description':a15_0x553f34(0x170)};export const NAME_FLAG={'name':a15_0x553f34(0x178),'type':a15_0x553f34(0x177),'description':a15_0x553f34(0x164)};export const ID_FLAG={'name':'id','type':a15_0x553f34(0x16d),'required':!![],'description':'Resource\x20ID'};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a16_0x1b6f7d=a16_0x4b9c;(function(_0x3340b8,_0x2644ce){const _0x2eb6cf=a16_0x4b9c,_0x25f81d=_0x3340b8();while(!![]){try{const _0x247157=parseInt(_0x2eb6cf(0x1d1))/0x1*(parseInt(_0x2eb6cf(0x1d4))/0x2)+-parseInt(_0x2eb6cf(0x1f0))/0x3*(-parseInt(_0x2eb6cf(0x1db))/0x4)+-parseInt(_0x2eb6cf(0x1f9))/0x5+parseInt(_0x2eb6cf(0x1c1))/0x6+parseInt(_0x2eb6cf(0x1fe))/0x7*(parseInt(_0x2eb6cf(0x1f7))/0x8)+-parseInt(_0x2eb6cf(0x1c8))/0x9+-parseInt(_0x2eb6cf(0x1c4))/0xa;if(_0x247157===_0x2644ce)break;else _0x25f81d['push'](_0x25f81d['shift']());}catch(_0x593ac0){_0x25f81d['push'](_0x25f81d['shift']());}}}(a16_0xdd46,0xb117f));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';function a16_0xdd46(){const _0x2b27d6=['Get\x20a\x20config\x20value','log','read','15787Dpikcg','Delete\x20a\x20config\x20value','Value\x20to\x20assign','148oBrAXa','appcode','set','apps','`\x20=\x20\x22','Missing\x20key\x20argument.','Top-level\x20key\x20\x22','48MJfQyK','../../context.js','Key\x20not\x20found:\x20','bool','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','Deleted\x20`','pageSize\x20must\x20be\x20a\x20positive\x20number','\x20config\x20set\x20<key>\x20<value>\x20[--global]','key','Set\x20`','length','config','alias','object','field','isArray','Settable\x20keys:\x20','Usage:\x20','list','project-or-global-explicit','stringify','101859bpemiu','write','keys','join','Missing\x20key\x20or\x20value.','Invalid\x20value\x20for\x20\x22','pretty','13248IBIOQx','raw','5484730LoRuqH','pageSize','List\x20current\x20config',';\x20apps.<alias>.appcode','get','4816ZOETQR','(none)','\x22.\x20Allowed:\x20','\x20config\x20get\x20<key>','split','format','validation','5276868CmBkmM','\x22\x20is\x20not\x20settable.','Write\x20to\x20global\x20config','10519880IHummA','Set\x20a\x20config\x20value','\x20\x20global:\x20\x20','args','6481539SumhQR','\x20(global)','trim','value','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','global'];a16_0xdd46=function(){return _0x2b27d6;};return a16_0xdd46();}import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':'global','type':'boolean','description':a16_0x1b6f7d(0x1c3),'default':![]};function parseAliasAppcodeSetKey(_0x294be1){const _0x3828fb=a16_0x1b6f7d,_0x14abde=_0x294be1[_0x3828fb(0x1be)]('.');if(_0x14abde['length']!==0x3||_0x14abde[0x0]!==_0x3828fb(0x1d7)||_0x14abde[0x2]!==_0x3828fb(0x1d5))return undefined;const _0x438571=_0x14abde[0x1]?.['trim']();return _0x438571?_0x438571:undefined;}function parseAliasDeleteKey(_0x1e4083){const _0xcf3e35=a16_0x1b6f7d,_0x3cf6a4=_0x1e4083[_0xcf3e35(0x1be)]('.');if(_0x3cf6a4['length']===0x2&&_0x3cf6a4[0x0]===_0xcf3e35(0x1d7)){const _0x20dbda=_0x3cf6a4[0x1]?.[_0xcf3e35(0x1ca)]();return _0x20dbda?{'alias':_0x20dbda}:undefined;}if(_0x3cf6a4[_0xcf3e35(0x1e5)]===0x3&&_0x3cf6a4[0x0]===_0xcf3e35(0x1d7)&&_0x3cf6a4[0x2]===_0xcf3e35(0x1d5)){const _0x3d478d=_0x3cf6a4[0x1]?.[_0xcf3e35(0x1ca)]();return _0x3d478d?{'alias':_0x3d478d,'field':_0xcf3e35(0x1d5)}:undefined;}return undefined;}function setLocalAppAlias(_0x543ac5,_0x3a3b56,_0x15a8c5){const _0xe23aa4=a16_0x1b6f7d,_0x15ef29=_0x543ac5['apps']&&typeof _0x543ac5[_0xe23aa4(0x1d7)]===_0xe23aa4(0x1e8)&&!Array['isArray'](_0x543ac5['apps'])?_0x543ac5[_0xe23aa4(0x1d7)]:{},_0x5a207d=_0x15ef29[_0x3a3b56]&&typeof _0x15ef29[_0x3a3b56]===_0xe23aa4(0x1e8)&&!Array[_0xe23aa4(0x1ea)](_0x15ef29[_0x3a3b56])?_0x15ef29[_0x3a3b56]:{};_0x5a207d[_0xe23aa4(0x1d5)]=_0x15a8c5,_0x15ef29[_0x3a3b56]=_0x5a207d,_0x543ac5[_0xe23aa4(0x1d7)]=_0x15ef29;}function deleteLocalAppAlias(_0x29f906,_0x4e9a63){const _0x144c29=a16_0x1b6f7d;if(!_0x29f906['apps']||typeof _0x29f906[_0x144c29(0x1d7)]!==_0x144c29(0x1e8)||Array[_0x144c29(0x1ea)](_0x29f906['apps']))return![];const _0x191c41=_0x29f906[_0x144c29(0x1d7)],_0x57db10=_0x191c41[_0x4e9a63[_0x144c29(0x1e7)]];if(!_0x57db10||typeof _0x57db10!=='object'||Array[_0x144c29(0x1ea)](_0x57db10))return![];if(!_0x4e9a63[_0x144c29(0x1e9)])return delete _0x191c41[_0x4e9a63[_0x144c29(0x1e7)]],!![];if(!(_0x4e9a63[_0x144c29(0x1e9)]in _0x57db10))return![];return delete _0x57db10[_0x4e9a63[_0x144c29(0x1e9)]],Object[_0x144c29(0x1f2)](_0x57db10)[_0x144c29(0x1e5)]===0x0&&delete _0x191c41[_0x4e9a63['alias']],!![];}const listDef={'service':'config','command':a16_0x1b6f7d(0x1ed),'description':a16_0x1b6f7d(0x1fb),'risk':a16_0x1b6f7d(0x1d0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x5357f0){const _0x126775=a16_0x1b6f7d,{buildConfigFromFlags:_0x50fda3}=await import(_0x126775(0x1dc)),_0x40f4d7=_0x50fda3({}),_0x659fbd=getProjectConfigPath(),_0x2b9e25=resolveWriteConfigPath(_0x126775(0x1cd));if(_0x5357f0[_0x126775(0x1bf)]===_0x126775(0x1f6))return{'ok':!![],'message':_0x126775(0x1cc)+(JSON[_0x126775(0x1ef)](_0x40f4d7[_0x126775(0x1f8)],null,0x2)+'\x0a\x0a')+'Config\x20files:\x0a'+('\x20\x20project:\x20'+(_0x659fbd??_0x126775(0x1ff))+'\x0a')+(_0x126775(0x1c6)+_0x2b9e25)};return{'ok':!![],'data':{'effective':_0x40f4d7[_0x126775(0x1f8)],'configFiles':{'project':_0x659fbd??null,'global':_0x2b9e25}}};}},getDef={'service':a16_0x1b6f7d(0x1e6),'command':a16_0x1b6f7d(0x1fd),'description':a16_0x1b6f7d(0x1ce),'risk':a16_0x1b6f7d(0x1d0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x1b6f7d(0x1e3),'description':'Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','required':!![]}],'flags':[],async 'execute'(_0x4d6d4d){const _0x2916ed=a16_0x1b6f7d,_0x374f9b=_0x4d6d4d[_0x2916ed(0x1c7)][0x0];if(!_0x374f9b)throw CliErrors[_0x2916ed(0x1c0)](_0x2916ed(0x1d9),_0x2916ed(0x1ec)+CLI_BIN_NAME+_0x2916ed(0x1bd));const {buildConfigFromFlags:_0x3efb72}=await import(_0x2916ed(0x1dc)),{raw:_0x14a5fd}=_0x3efb72({});if(_0x374f9b['includes']('.')){const _0x38405e=_0x374f9b[_0x2916ed(0x1be)]('.');let _0x52f139=_0x14a5fd;for(const _0x5248bb of _0x38405e){if(_0x52f139==null||typeof _0x52f139!=='object')throw CliErrors[_0x2916ed(0x1c0)](_0x2916ed(0x1dd)+_0x374f9b);_0x52f139=_0x52f139[_0x5248bb];}if(_0x52f139===undefined)throw CliErrors[_0x2916ed(0x1c0)]('Key\x20not\x20found:\x20'+_0x374f9b);return console[_0x2916ed(0x1cf)](typeof _0x52f139===_0x2916ed(0x1e8)?JSON[_0x2916ed(0x1ef)](_0x52f139,null,0x2):String(_0x52f139)),{'ok':!![]};}const _0x22cac2=_0x14a5fd[_0x374f9b];if(_0x22cac2===undefined)throw CliErrors[_0x2916ed(0x1c0)](_0x2916ed(0x1dd)+_0x374f9b);return console[_0x2916ed(0x1cf)](typeof _0x22cac2===_0x2916ed(0x1e8)?JSON[_0x2916ed(0x1ef)](_0x22cac2,null,0x2):String(_0x22cac2)),{'ok':!![]};}},setDef={'service':a16_0x1b6f7d(0x1e6),'command':a16_0x1b6f7d(0x1d6),'description':a16_0x1b6f7d(0x1c5),'risk':a16_0x1b6f7d(0x1f1),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x1b6f7d(0x1e3),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a16_0x1b6f7d(0x1cb),'description':a16_0x1b6f7d(0x1d3),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x4983a8){const _0x59b8af=a16_0x1b6f7d,_0x26d447=_0x4983a8[_0x59b8af(0x1c7)][0x0],_0x60facd=_0x4983a8[_0x59b8af(0x1c7)][0x1];if(!_0x26d447||_0x60facd===undefined)throw CliErrors[_0x59b8af(0x1c0)](_0x59b8af(0x1f4),_0x59b8af(0x1ec)+CLI_BIN_NAME+_0x59b8af(0x1e2));if(ENUM_KEYS[_0x26d447]&&!ENUM_KEYS[_0x26d447]['includes'](_0x60facd))throw CliErrors[_0x59b8af(0x1c0)](_0x59b8af(0x1f5)+_0x26d447+_0x59b8af(0x1bc)+ENUM_KEYS[_0x26d447][_0x59b8af(0x1f3)](',\x20'));if(_0x26d447==='riskLevel')throw CliErrors['validation'](_0x59b8af(0x1df));if(_0x26d447===_0x59b8af(0x1fa)){const _0x5c6278=Number(_0x60facd);if(isNaN(_0x5c6278)||_0x5c6278<=0x0)throw CliErrors[_0x59b8af(0x1c0)](_0x59b8af(0x1e1));}const _0x5c6bc4=resolveWriteScope({'explicitGlobal':_0x4983a8[_0x59b8af(0x1de)](_0x59b8af(0x1cd)),'policy':_0x59b8af(0x1ee)}),_0xb764b2=toScopeFlags(_0x5c6bc4),_0x315d64=readScopedConfig(_0xb764b2),_0x4d7b67=parseAliasAppcodeSetKey(_0x26d447);if(!_0x4d7b67&&!isTopLevelConfigKey(_0x26d447))throw CliErrors['validation'](_0x59b8af(0x1da)+_0x26d447+_0x59b8af(0x1c2),_0x59b8af(0x1eb)+getTopLevelConfigKeySummary()+_0x59b8af(0x1fc));return _0x4d7b67?setLocalAppAlias(_0x315d64,_0x4d7b67,_0x60facd):_0x315d64[_0x26d447]=_0x26d447==='pageSize'?Number(_0x60facd):_0x60facd,console['log'](_0x59b8af(0x1e4)+_0x26d447+_0x59b8af(0x1d8)+_0x60facd+'\x22'+(_0x5c6bc4===_0x59b8af(0x1cd)?_0x59b8af(0x1c9):'')),writeScopedConfig(_0x315d64,_0xb764b2),{'ok':!![]};}},deleteDef={'service':a16_0x1b6f7d(0x1e6),'command':'delete','description':a16_0x1b6f7d(0x1d2),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x1b6f7d(0x1e3),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x56ff96){const _0x1e9719=a16_0x1b6f7d,_0x29c6b1=_0x56ff96[_0x1e9719(0x1c7)][0x0];if(!_0x29c6b1)throw CliErrors[_0x1e9719(0x1c0)](_0x1e9719(0x1d9),_0x1e9719(0x1ec)+CLI_BIN_NAME+'\x20config\x20delete\x20<key>\x20[--global]');const _0x4b5275=resolveWriteScope({'explicitGlobal':_0x56ff96[_0x1e9719(0x1de)](_0x1e9719(0x1cd)),'policy':'project-or-global-explicit'}),_0x50e564=toScopeFlags(_0x4b5275),_0x2136fd=readScopedConfig(_0x50e564),_0x2ab259=parseAliasDeleteKey(_0x29c6b1);if(_0x2ab259){if(!deleteLocalAppAlias(_0x2136fd,_0x2ab259))throw CliErrors[_0x1e9719(0x1c0)](_0x1e9719(0x1dd)+_0x29c6b1);return console[_0x1e9719(0x1cf)](_0x1e9719(0x1e0)+_0x29c6b1+'`'+(_0x4b5275===_0x1e9719(0x1cd)?_0x1e9719(0x1c9):'')),writeScopedConfig(_0x2136fd,_0x50e564),{'ok':!![]};}if(_0x2136fd[_0x29c6b1]===undefined)throw CliErrors[_0x1e9719(0x1c0)]('Key\x20\x22'+_0x29c6b1+'\x22\x20not\x20found\x20at\x20top\x20level.');return delete _0x2136fd[_0x29c6b1],console[_0x1e9719(0x1cf)](_0x1e9719(0x1e0)+_0x29c6b1+'`'+(_0x4b5275===_0x1e9719(0x1cd)?_0x1e9719(0x1c9):'')),writeScopedConfig(_0x2136fd,_0x50e564),{'ok':!![]};}};function a16_0x4b9c(_0x3307dc,_0x5c2ddf){_0x3307dc=_0x3307dc-0x1bc;const _0xdd46ab=a16_0xdd46();let _0x4b9c4d=_0xdd46ab[_0x3307dc];return _0x4b9c4d;}export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
1
|
+
const a16_0x48222=a16_0x5d0f;(function(_0x3a1180,_0x2aff3c){const _0x29f7b1=a16_0x5d0f,_0x414dbd=_0x3a1180();while(!![]){try{const _0x40685b=parseInt(_0x29f7b1(0x164))/0x1*(-parseInt(_0x29f7b1(0x14e))/0x2)+-parseInt(_0x29f7b1(0x14a))/0x3+parseInt(_0x29f7b1(0x17b))/0x4+parseInt(_0x29f7b1(0x14c))/0x5*(-parseInt(_0x29f7b1(0x185))/0x6)+-parseInt(_0x29f7b1(0x16e))/0x7*(parseInt(_0x29f7b1(0x14d))/0x8)+-parseInt(_0x29f7b1(0x14f))/0x9*(-parseInt(_0x29f7b1(0x179))/0xa)+parseInt(_0x29f7b1(0x155))/0xb;if(_0x40685b===_0x2aff3c)break;else _0x414dbd['push'](_0x414dbd['shift']());}catch(_0x421e5e){_0x414dbd['push'](_0x414dbd['shift']());}}}(a16_0x10ba,0xd7b75));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':a16_0x48222(0x184),'type':'boolean','description':a16_0x48222(0x150),'default':![]};function parseAliasAppcodeSetKey(_0xa64a51){const _0xa06b3b=a16_0x48222,_0x3f5e4c=_0xa64a51[_0xa06b3b(0x175)]('.');if(_0x3f5e4c[_0xa06b3b(0x171)]!==0x3||_0x3f5e4c[0x0]!==_0xa06b3b(0x17c)||_0x3f5e4c[0x2]!==_0xa06b3b(0x159))return undefined;const _0x14aba0=_0x3f5e4c[0x1]?.['trim']();return _0x14aba0?_0x14aba0:undefined;}function parseAliasDeleteKey(_0x18591a){const _0x3edf0d=a16_0x48222,_0x417b78=_0x18591a['split']('.');if(_0x417b78[_0x3edf0d(0x171)]===0x2&&_0x417b78[0x0]===_0x3edf0d(0x17c)){const _0x16c145=_0x417b78[0x1]?.[_0x3edf0d(0x15e)]();return _0x16c145?{'alias':_0x16c145}:undefined;}if(_0x417b78['length']===0x3&&_0x417b78[0x0]===_0x3edf0d(0x17c)&&_0x417b78[0x2]===_0x3edf0d(0x159)){const _0x1d5dd5=_0x417b78[0x1]?.[_0x3edf0d(0x15e)]();return _0x1d5dd5?{'alias':_0x1d5dd5,'field':_0x3edf0d(0x159)}:undefined;}return undefined;}function a16_0x5d0f(_0x55fcac,_0x2cfbeb){_0x55fcac=_0x55fcac-0x14a;const _0x10bae4=a16_0x10ba();let _0x5d0fc8=_0x10bae4[_0x55fcac];return _0x5d0fc8;}function a16_0x10ba(){const _0xf20a8f=['1078MeEabe','\x20\x20global:\x20\x20','Config\x20files:\x0a','length','pageSize','pretty','config','split','log','\x20config\x20get\x20<key>','pageSize\x20must\x20be\x20a\x20positive\x20number','14551510bkvTqR','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','2634788JUXsYn','apps','value','field','Missing\x20key\x20or\x20value.','(none)','project-or-global-explicit','keys','args','global','492gVoxXB','\x22.\x20Allowed:\x20','read','includes','stringify','List\x20current\x20config',';\x20apps.<alias>.appcode','Get\x20a\x20config\x20value','84825YcGscL','set','65945VwQUAS','120AdlqRH','18jzEHpB','9dKCpjn','Write\x20to\x20global\x20config','object','bool','riskLevel','format','17125174MqjZYH','validation','isArray','write','appcode','Key\x20\x22','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','Set\x20a\x20config\x20value','Key\x20not\x20found:\x20','trim','Settable\x20keys:\x20','get','Invalid\x20value\x20for\x20\x22','\x22\x20not\x20found\x20at\x20top\x20level.','Usage:\x20','186114SVlZYp','alias','\x20config\x20set\x20<key>\x20<value>\x20[--global]','Deleted\x20`','Delete\x20a\x20config\x20value','Missing\x20key\x20argument.','key','Value\x20to\x20assign','Top-level\x20key\x20\x22','raw'];a16_0x10ba=function(){return _0xf20a8f;};return a16_0x10ba();}function setLocalAppAlias(_0x502011,_0xda31b6,_0x560f69){const _0x2e11b5=a16_0x48222,_0x343105=_0x502011['apps']&&typeof _0x502011[_0x2e11b5(0x17c)]==='object'&&!Array[_0x2e11b5(0x157)](_0x502011[_0x2e11b5(0x17c)])?_0x502011[_0x2e11b5(0x17c)]:{},_0x457254=_0x343105[_0xda31b6]&&typeof _0x343105[_0xda31b6]==='object'&&!Array[_0x2e11b5(0x157)](_0x343105[_0xda31b6])?_0x343105[_0xda31b6]:{};_0x457254[_0x2e11b5(0x159)]=_0x560f69,_0x343105[_0xda31b6]=_0x457254,_0x502011[_0x2e11b5(0x17c)]=_0x343105;}function deleteLocalAppAlias(_0x40ebaf,_0x55c79a){const _0x2efa08=a16_0x48222;if(!_0x40ebaf['apps']||typeof _0x40ebaf['apps']!==_0x2efa08(0x151)||Array[_0x2efa08(0x157)](_0x40ebaf[_0x2efa08(0x17c)]))return![];const _0x5a4ff5=_0x40ebaf[_0x2efa08(0x17c)],_0x2a736c=_0x5a4ff5[_0x55c79a['alias']];if(!_0x2a736c||typeof _0x2a736c!==_0x2efa08(0x151)||Array['isArray'](_0x2a736c))return![];if(!_0x55c79a[_0x2efa08(0x17e)])return delete _0x5a4ff5[_0x55c79a['alias']],!![];if(!(_0x55c79a[_0x2efa08(0x17e)]in _0x2a736c))return![];return delete _0x2a736c[_0x55c79a[_0x2efa08(0x17e)]],Object[_0x2efa08(0x182)](_0x2a736c)[_0x2efa08(0x171)]===0x0&&delete _0x5a4ff5[_0x55c79a[_0x2efa08(0x165)]],!![];}const listDef={'service':a16_0x48222(0x174),'command':'list','description':a16_0x48222(0x18a),'risk':a16_0x48222(0x187),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x26d5a8){const _0x37de6a=a16_0x48222,{buildConfigFromFlags:_0x2ebb21}=await import('../../context.js'),_0x3cd8a5=_0x2ebb21({}),_0x52684a=getProjectConfigPath(),_0x527d11=resolveWriteConfigPath(_0x37de6a(0x184));if(_0x26d5a8[_0x37de6a(0x154)]===_0x37de6a(0x173))return{'ok':!![],'message':_0x37de6a(0x15b)+(JSON[_0x37de6a(0x189)](_0x3cd8a5['raw'],null,0x2)+'\x0a\x0a')+_0x37de6a(0x170)+('\x20\x20project:\x20'+(_0x52684a??_0x37de6a(0x180))+'\x0a')+(_0x37de6a(0x16f)+_0x527d11)};return{'ok':!![],'data':{'effective':_0x3cd8a5[_0x37de6a(0x16d)],'configFiles':{'project':_0x52684a??null,'global':_0x527d11}}};}},getDef={'service':a16_0x48222(0x174),'command':a16_0x48222(0x160),'description':a16_0x48222(0x18c),'risk':a16_0x48222(0x187),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x48222(0x16a),'description':a16_0x48222(0x17a),'required':!![]}],'flags':[],async 'execute'(_0x401405){const _0x5ed37c=a16_0x48222,_0xc56b34=_0x401405['args'][0x0];if(!_0xc56b34)throw CliErrors[_0x5ed37c(0x156)](_0x5ed37c(0x169),_0x5ed37c(0x163)+CLI_BIN_NAME+_0x5ed37c(0x177));const {buildConfigFromFlags:_0x724823}=await import('../../context.js'),{raw:_0x89929c}=_0x724823({});if(_0xc56b34[_0x5ed37c(0x188)]('.')){const _0xa5a12e=_0xc56b34[_0x5ed37c(0x175)]('.');let _0x3602cd=_0x89929c;for(const _0x4d843b of _0xa5a12e){if(_0x3602cd==null||typeof _0x3602cd!==_0x5ed37c(0x151))throw CliErrors[_0x5ed37c(0x156)](_0x5ed37c(0x15d)+_0xc56b34);_0x3602cd=_0x3602cd[_0x4d843b];}if(_0x3602cd===undefined)throw CliErrors[_0x5ed37c(0x156)](_0x5ed37c(0x15d)+_0xc56b34);return console[_0x5ed37c(0x176)](typeof _0x3602cd===_0x5ed37c(0x151)?JSON['stringify'](_0x3602cd,null,0x2):String(_0x3602cd)),{'ok':!![]};}const _0x37d178=_0x89929c[_0xc56b34];if(_0x37d178===undefined)throw CliErrors['validation']('Key\x20not\x20found:\x20'+_0xc56b34);return console['log'](typeof _0x37d178===_0x5ed37c(0x151)?JSON['stringify'](_0x37d178,null,0x2):String(_0x37d178)),{'ok':!![]};}},setDef={'service':a16_0x48222(0x174),'command':a16_0x48222(0x14b),'description':a16_0x48222(0x15c),'risk':a16_0x48222(0x158),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x48222(0x16a),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a16_0x48222(0x17d),'description':a16_0x48222(0x16b),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x506c0f){const _0x4fd928=a16_0x48222,_0x276c99=_0x506c0f[_0x4fd928(0x183)][0x0],_0xe2d0ee=_0x506c0f[_0x4fd928(0x183)][0x1];if(!_0x276c99||_0xe2d0ee===undefined)throw CliErrors['validation'](_0x4fd928(0x17f),'Usage:\x20'+CLI_BIN_NAME+_0x4fd928(0x166));if(ENUM_KEYS[_0x276c99]&&!ENUM_KEYS[_0x276c99][_0x4fd928(0x188)](_0xe2d0ee))throw CliErrors['validation'](_0x4fd928(0x161)+_0x276c99+_0x4fd928(0x186)+ENUM_KEYS[_0x276c99]['join'](',\x20'));if(_0x276c99===_0x4fd928(0x153))throw CliErrors[_0x4fd928(0x156)]('\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.');if(_0x276c99===_0x4fd928(0x172)){const _0x5c2b92=Number(_0xe2d0ee);if(isNaN(_0x5c2b92)||_0x5c2b92<=0x0)throw CliErrors[_0x4fd928(0x156)](_0x4fd928(0x178));}const _0x358e15=resolveWriteScope({'explicitGlobal':_0x506c0f[_0x4fd928(0x152)](_0x4fd928(0x184)),'policy':'project-or-global-explicit'}),_0x5b57a0=toScopeFlags(_0x358e15),_0x235959=readScopedConfig(_0x5b57a0),_0x206edf=parseAliasAppcodeSetKey(_0x276c99);if(!_0x206edf&&!isTopLevelConfigKey(_0x276c99))throw CliErrors[_0x4fd928(0x156)](_0x4fd928(0x16c)+_0x276c99+'\x22\x20is\x20not\x20settable.',_0x4fd928(0x15f)+getTopLevelConfigKeySummary()+_0x4fd928(0x18b));return _0x206edf?setLocalAppAlias(_0x235959,_0x206edf,_0xe2d0ee):_0x235959[_0x276c99]=_0x276c99===_0x4fd928(0x172)?Number(_0xe2d0ee):_0xe2d0ee,console[_0x4fd928(0x176)]('Set\x20`'+_0x276c99+'`\x20=\x20\x22'+_0xe2d0ee+'\x22'+(_0x358e15===_0x4fd928(0x184)?'\x20(global)':'')),writeScopedConfig(_0x235959,_0x5b57a0),{'ok':!![]};}},deleteDef={'service':a16_0x48222(0x174),'command':'delete','description':a16_0x48222(0x168),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x48222(0x16a),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x239a40){const _0x56f2fe=a16_0x48222,_0x3f802f=_0x239a40[_0x56f2fe(0x183)][0x0];if(!_0x3f802f)throw CliErrors[_0x56f2fe(0x156)]('Missing\x20key\x20argument.',_0x56f2fe(0x163)+CLI_BIN_NAME+'\x20config\x20delete\x20<key>\x20[--global]');const _0x23881e=resolveWriteScope({'explicitGlobal':_0x239a40[_0x56f2fe(0x152)](_0x56f2fe(0x184)),'policy':_0x56f2fe(0x181)}),_0xe9396b=toScopeFlags(_0x23881e),_0x36651f=readScopedConfig(_0xe9396b),_0x560893=parseAliasDeleteKey(_0x3f802f);if(_0x560893){if(!deleteLocalAppAlias(_0x36651f,_0x560893))throw CliErrors[_0x56f2fe(0x156)](_0x56f2fe(0x15d)+_0x3f802f);return console[_0x56f2fe(0x176)]('Deleted\x20`'+_0x3f802f+'`'+(_0x23881e===_0x56f2fe(0x184)?'\x20(global)':'')),writeScopedConfig(_0x36651f,_0xe9396b),{'ok':!![]};}if(_0x36651f[_0x3f802f]===undefined)throw CliErrors[_0x56f2fe(0x156)](_0x56f2fe(0x15a)+_0x3f802f+_0x56f2fe(0x162));return delete _0x36651f[_0x3f802f],console[_0x56f2fe(0x176)](_0x56f2fe(0x167)+_0x3f802f+'`'+(_0x23881e===_0x56f2fe(0x184)?'\x20(global)':'')),writeScopedConfig(_0x36651f,_0xe9396b),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a17_0x1d26(){var _0x603028=['203580MkLkWI','9951471ExgPTR','39fOgeep','766934MtkbcH','2oEKSsQ','461256mDAysf','3566983krGVWm','255272OuRXiV','4346070PlAVsl'];a17_0x1d26=function(){return _0x603028;};return a17_0x1d26();}(function(_0xb7a573,_0x15f291){var _0x1a6283=a17_0x3369,_0x50130e=_0xb7a573();while(!![]){try{var _0x55297c=parseInt(_0x1a6283(0x1c6))/0x1*(parseInt(_0x1a6283(0x1c5))/0x2)+parseInt(_0x1a6283(0x1c4))/0x3*(parseInt(_0x1a6283(0x1c9))/0x4)+parseInt(_0x1a6283(0x1c2))/0x5+parseInt(_0x1a6283(0x1ca))/0x6+-parseInt(_0x1a6283(0x1c8))/0x7+-parseInt(_0x1a6283(0x1c7))/0x8+-parseInt(_0x1a6283(0x1c3))/0x9;if(_0x55297c===_0x15f291)break;else _0x50130e['push'](_0x50130e['shift']());}catch(_0x41b2b2){_0x50130e['push'](_0x50130e['shift']());}}}(a17_0x1d26,0xa822c));function a17_0x3369(_0x182003,_0x353047){_0x182003=_0x182003-0x1c2;var _0x1d26e8=a17_0x1d26();var _0x3369e2=_0x1d26e8[_0x182003];return _0x3369e2;}import{CLI_BIN_NAME}from'../../constant/cli.js';export{CLI_BIN_NAME};export{readScopedConfig,writeScopedConfig}from'../../context.js';export{resolveConfigScope as resolveWriteScope,TOP_LEVEL_CONFIG_KEYS as TOP_LEVEL_KEYS,CONFIG_ENUM_VALUES as ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey,toScopeFlags}from'../../commands/common/config-policy.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a18_0x2436e9=a18_0x56fb;(function(_0x4b0e92,_0x432a71){const _0x179cce=a18_0x56fb,_0x568442=_0x4b0e92();while(!![]){try{const _0xf054de=parseInt(_0x179cce(0x16c))/0x1*(-parseInt(_0x179cce(0x18a))/0x2)+-parseInt(_0x179cce(0x147))/0x3+-parseInt(_0x179cce(0x139))/0x4*(-parseInt(_0x179cce(0x137))/0x5)+-parseInt(_0x179cce(0x164))/0x6+parseInt(_0x179cce(0x166))/0x7*(-parseInt(_0x179cce(0x185))/0x8)+parseInt(_0x179cce(0x16e))/0x9+parseInt(_0x179cce(0x146))/0xa;if(_0xf054de===_0x432a71)break;else _0x568442['push'](_0x568442['shift']());}catch(_0x190c3f){_0x568442['push'](_0x568442['shift']());}}}(a18_0x1c3a,0xe0b4b));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';function a18_0x1c3a(){const _0x44ed8e=['params','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','5aWpXCL','write','5884364trnqGA','\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\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}','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','\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\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','\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}','Get\x20a\x20single\x20record\x20by\x20ID','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','command','description','13538990TdLFYX','4129761XELZLN','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}}','now','getOne','Update\x20an\x20existing\x20record','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','body','aggregate','code','build','\x20on\x20dataset\x20','paramsRequired','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','delete','data','\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','\x20\x20\x20\x20$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\x20PAGINATION','paramsHint','\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}','risk','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','read','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','\x20\x20\x20\x20$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\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','4719126WCKzfJ','create','139090rJssaV','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','POST','\x20\x20AGGREGATE\x20TYPES','\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','Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','6879CnTDHy','\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}','16269966hgdlqA','\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\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','operation','high-risk-write','\x20\x20EXAMPLES','\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}','join','\x20\x20LOGICAL\x20COMBINATORS','\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}}','update','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','filter','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','\x20\x20PARAMS\x20STRUCTURE','data\x20','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\x20completed\x20in\x20','\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}}','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','dryRun','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','128MoAyjh','batchCreate','Filter\x20dataset\x20records\x20with\x20query\x20conditions','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','\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}','358BaeyTI','\x20\x20WHERE\x20OPERATORS','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','\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_0x1c3a=function(){return _0x44ed8e;};return a18_0x1c3a();}const specs=[{'command':a18_0x2436e9(0x17a),'operation':a18_0x2436e9(0x17a),'risk':a18_0x2436e9(0x160),'paramsRequired':![],'description':a18_0x2436e9(0x187),'paramsHint':a18_0x2436e9(0x140)+a18_0x2436e9(0x184),'helpExtra':[a18_0x2436e9(0x18b),a18_0x2436e9(0x15d),a18_0x2436e9(0x161),a18_0x2436e9(0x16f),a18_0x2436e9(0x177),a18_0x2436e9(0x13a),a18_0x2436e9(0x180),a18_0x2436e9(0x159),a18_0x2436e9(0x135),a18_0x2436e9(0x18d),a18_0x2436e9(0x15a),'',a18_0x2436e9(0x176),'\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}',a18_0x2436e9(0x162),'',a18_0x2436e9(0x163),a18_0x2436e9(0x134),a18_0x2436e9(0x170),a18_0x2436e9(0x17b),a18_0x2436e9(0x167),a18_0x2436e9(0x188),'',a18_0x2436e9(0x15b),a18_0x2436e9(0x15f),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27',a18_0x2436e9(0x13f)][a18_0x2436e9(0x175)]('\x0a')},{'command':a18_0x2436e9(0x14b),'operation':a18_0x2436e9(0x14b),'risk':'read','paramsRequired':!![],'description':a18_0x2436e9(0x142),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a18_0x2436e9(0x165),'operation':a18_0x2436e9(0x165),'risk':a18_0x2436e9(0x138),'paramsRequired':!![],'description':'Create\x20a\x20new\x20record\x20in\x20a\x20dataset','paramsHint':a18_0x2436e9(0x13c)},{'command':'batchCreate','operation':a18_0x2436e9(0x186),'risk':'write','paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','paramsHint':a18_0x2436e9(0x14d)},{'command':a18_0x2436e9(0x178),'operation':a18_0x2436e9(0x178),'risk':'write','paramsRequired':!![],'description':a18_0x2436e9(0x14c),'paramsHint':a18_0x2436e9(0x136)},{'command':a18_0x2436e9(0x157),'operation':a18_0x2436e9(0x157),'risk':a18_0x2436e9(0x172),'paramsRequired':!![],'description':a18_0x2436e9(0x179),'paramsHint':a18_0x2436e9(0x143)},{'command':a18_0x2436e9(0x151),'operation':a18_0x2436e9(0x151),'risk':a18_0x2436e9(0x160),'paramsRequired':![],'description':a18_0x2436e9(0x181),'paramsHint':a18_0x2436e9(0x18c)+a18_0x2436e9(0x16b),'helpExtra':[a18_0x2436e9(0x169),a18_0x2436e9(0x141),a18_0x2436e9(0x13b),a18_0x2436e9(0x13e),a18_0x2436e9(0x189),'\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}',a18_0x2436e9(0x16d),a18_0x2436e9(0x174),'',a18_0x2436e9(0x17c),'\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]',a18_0x2436e9(0x17e),a18_0x2436e9(0x14f),'\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]',a18_0x2436e9(0x149),a18_0x2436e9(0x182),'',a18_0x2436e9(0x173),a18_0x2436e9(0x13d),a18_0x2436e9(0x16a),'',a18_0x2436e9(0x156),a18_0x2436e9(0x14e)][a18_0x2436e9(0x175)]('\x0a')}];function a18_0x56fb(_0x470258,_0x4e80b4){_0x470258=_0x470258-0x133;const _0x1c3ae4=a18_0x1c3a();let _0x56fb22=_0x1c3ae4[_0x470258];return _0x56fb22;}function makeDataCommand(_0x3c6402){const _0x515d72=a18_0x2436e9,_0x270150=_0x515d72(0x17d)+_0x3c6402[_0x515d72(0x144)],_0x584e19={'service':_0x515d72(0x158),'command':_0x3c6402[_0x515d72(0x144)],'description':_0x3c6402[_0x515d72(0x145)],'risk':_0x3c6402[_0x515d72(0x15e)],'helpExtra':_0x3c6402['helpExtra'],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x3c6402[_0x515d72(0x15c)]}],'validate':async _0x456450=>{const _0x42a163=_0x515d72;_0x3c6402[_0x42a163(0x155)]&&requireAnyOf(_0x456450,['params'],_0x270150),_0x3c6402[_0x42a163(0x171)]==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x456450[_0x42a163(0x148)](_0x42a163(0x133))));},async 'execute'(_0x40353b){const _0x4048d7=_0x515d72,_0x435989=_0x40353b[_0x4048d7(0x148)](_0x4048d7(0x152)),_0x4a7281=_0x3c6402[_0x4048d7(0x171)]===_0x4048d7(0x186)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x40353b[_0x4048d7(0x148)](_0x4048d7(0x133)))):parseJsonParams(_0x40353b['str']('params'))??{},_0x3db28e=Date[_0x4048d7(0x14a)](),_0x2e4fda=await executeData(_0x435989,_0x3c6402[_0x4048d7(0x171)],_0x4a7281),_0x3d0712=Date[_0x4048d7(0x14a)]()-_0x3db28e;return{'ok':!![],'data':{'result':_0x2e4fda,'elapsed':_0x3d0712},'message':_0x4048d7(0x17d)+_0x3c6402[_0x4048d7(0x144)]+_0x4048d7(0x17f)+_0x3d0712+'ms'};}};return _0x3c6402['risk']!=='read'&&(_0x584e19[_0x515d72(0x183)]=async _0x1e9a1c=>{const _0x1e5c0f=_0x515d72,_0x5de11c=_0x1e9a1c[_0x1e5c0f(0x148)]('code'),_0x4aa955=_0x3c6402[_0x1e5c0f(0x171)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x1e9a1c['str'](_0x1e5c0f(0x133)))):parseJsonParams(_0x1e9a1c[_0x1e5c0f(0x148)](_0x1e5c0f(0x133)))??{};return dryRun(_0x1e5c0f(0x168),'/api/{appCode}/'+_0x5de11c+'/'+_0x3c6402['operation'])[_0x1e5c0f(0x150)](_0x4aa955)[_0x1e5c0f(0x145)]('Preview:\x20data\x20'+_0x3c6402[_0x1e5c0f(0x144)]+_0x1e5c0f(0x154)+_0x5de11c)[_0x1e5c0f(0x153)]();}),_0x584e19;}export const dataDefinitions=specs['map'](makeDataCommand);
|
|
1
|
+
const a18_0x57123e=a18_0x8ca1;(function(_0xc10fa1,_0x487d7b){const _0x286dc2=a18_0x8ca1,_0x9a1c92=_0xc10fa1();while(!![]){try{const _0x454f4b=-parseInt(_0x286dc2(0x198))/0x1+-parseInt(_0x286dc2(0x1a8))/0x2+parseInt(_0x286dc2(0x167))/0x3+parseInt(_0x286dc2(0x196))/0x4+parseInt(_0x286dc2(0x18a))/0x5*(-parseInt(_0x286dc2(0x17d))/0x6)+parseInt(_0x286dc2(0x19d))/0x7+-parseInt(_0x286dc2(0x185))/0x8*(-parseInt(_0x286dc2(0x1a6))/0x9);if(_0x454f4b===_0x487d7b)break;else _0x9a1c92['push'](_0x9a1c92['shift']());}catch(_0x516373){_0x9a1c92['push'](_0x9a1c92['shift']());}}}(a18_0x1e10,0x577e5));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a18_0x57123e(0x170),'operation':a18_0x57123e(0x170),'risk':'read','paramsRequired':![],'description':a18_0x57123e(0x199),'paramsHint':a18_0x57123e(0x183)+a18_0x57123e(0x1a0),'helpExtra':['\x20\x20WHERE\x20OPERATORS',a18_0x57123e(0x16d),'\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}',a18_0x57123e(0x15f),'\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}',a18_0x57123e(0x19a),'\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}',a18_0x57123e(0x15e),a18_0x57123e(0x19c),'',a18_0x57123e(0x1ad),a18_0x57123e(0x161),'\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','',a18_0x57123e(0x17e),a18_0x57123e(0x163),a18_0x57123e(0x166),a18_0x57123e(0x1a5),'\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)',a18_0x57123e(0x162),'',a18_0x57123e(0x1a1),a18_0x57123e(0x1a4),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27',a18_0x57123e(0x17c)][a18_0x57123e(0x19f)]('\x0a')},{'command':'getOne','operation':a18_0x57123e(0x16c),'risk':a18_0x57123e(0x16a),'paramsRequired':!![],'description':'Get\x20a\x20single\x20record\x20by\x20ID','paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a18_0x57123e(0x182),'operation':a18_0x57123e(0x182),'risk':'write','paramsRequired':!![],'description':a18_0x57123e(0x173),'paramsHint':a18_0x57123e(0x19e)},{'command':'batchCreate','operation':a18_0x57123e(0x168),'risk':a18_0x57123e(0x164),'paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','paramsHint':a18_0x57123e(0x16b)},{'command':a18_0x57123e(0x1a7),'operation':a18_0x57123e(0x1a7),'risk':a18_0x57123e(0x164),'paramsRequired':!![],'description':a18_0x57123e(0x188),'paramsHint':a18_0x57123e(0x18d)},{'command':a18_0x57123e(0x17b),'operation':a18_0x57123e(0x17b),'risk':'high-risk-write','paramsRequired':!![],'description':'Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','paramsHint':a18_0x57123e(0x165)},{'command':a18_0x57123e(0x18f),'operation':a18_0x57123e(0x18f),'risk':'read','paramsRequired':![],'description':a18_0x57123e(0x160),'paramsHint':a18_0x57123e(0x15b)+a18_0x57123e(0x176),'helpExtra':[a18_0x57123e(0x171),'\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20field\x20values\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}',a18_0x57123e(0x190),a18_0x57123e(0x197),a18_0x57123e(0x187),a18_0x57123e(0x18e),a18_0x57123e(0x175),a18_0x57123e(0x186),'',a18_0x57123e(0x177),a18_0x57123e(0x179),a18_0x57123e(0x17a),a18_0x57123e(0x189),a18_0x57123e(0x1af),a18_0x57123e(0x192),a18_0x57123e(0x18c),'',a18_0x57123e(0x15d),a18_0x57123e(0x15c),a18_0x57123e(0x18b),'',a18_0x57123e(0x193),a18_0x57123e(0x19b)]['join']('\x0a')}];function makeDataCommand(_0x36026f){const _0x2c7ec6=a18_0x57123e,_0x4941ca=_0x2c7ec6(0x178)+_0x36026f[_0x2c7ec6(0x1ac)],_0x3f9e26={'service':'data','command':_0x36026f[_0x2c7ec6(0x1ac)],'description':_0x36026f[_0x2c7ec6(0x1ae)],'risk':_0x36026f[_0x2c7ec6(0x1ab)],'helpExtra':_0x36026f[_0x2c7ec6(0x191)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x36026f[_0x2c7ec6(0x195)]}],'validate':async _0x116dc0=>{const _0xa0c146=_0x2c7ec6;_0x36026f[_0xa0c146(0x172)]&&requireAnyOf(_0x116dc0,[_0xa0c146(0x1a3)],_0x4941ca),_0x36026f[_0xa0c146(0x1aa)]===_0xa0c146(0x168)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x116dc0[_0xa0c146(0x184)](_0xa0c146(0x1a3))));},async 'execute'(_0x5a1965){const _0x561350=_0x2c7ec6,_0x169b30=_0x5a1965[_0x561350(0x184)](_0x561350(0x16f)),_0x450d96=_0x36026f['operation']==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x5a1965[_0x561350(0x184)](_0x561350(0x1a3)))):parseJsonParams(_0x5a1965[_0x561350(0x184)](_0x561350(0x1a3)))??{},_0x34691e=Date[_0x561350(0x16e)](),_0x22efc8=await executeData(_0x169b30,_0x36026f['operation'],_0x450d96),_0x3b90ba=Date[_0x561350(0x16e)]()-_0x34691e;return{'ok':!![],'data':{'result':_0x22efc8,'elapsed':_0x3b90ba},'message':_0x561350(0x178)+_0x36026f[_0x561350(0x1ac)]+_0x561350(0x181)+_0x3b90ba+'ms'};}};return _0x36026f[_0x2c7ec6(0x1ab)]!==_0x2c7ec6(0x16a)&&(_0x3f9e26[_0x2c7ec6(0x1a9)]=async _0x638ea5=>{const _0x47145b=_0x2c7ec6,_0x5b66df=_0x638ea5[_0x47145b(0x184)](_0x47145b(0x16f)),_0x470f44=_0x36026f[_0x47145b(0x1aa)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x638ea5[_0x47145b(0x184)](_0x47145b(0x1a3)))):parseJsonParams(_0x638ea5[_0x47145b(0x184)]('params'))??{};return dryRun(_0x47145b(0x194),_0x47145b(0x180)+_0x5b66df+'/'+_0x36026f[_0x47145b(0x1aa)])[_0x47145b(0x174)](_0x470f44)[_0x47145b(0x1ae)]('Preview:\x20data\x20'+_0x36026f[_0x47145b(0x1ac)]+_0x47145b(0x169)+_0x5b66df)[_0x47145b(0x17f)]();}),_0x3f9e26;}function a18_0x8ca1(_0x4220ef,_0x4f33fb){_0x4220ef=_0x4220ef-0x15b;const _0x1e1097=a18_0x1e10();let _0x8ca117=_0x1e1097[_0x4220ef];return _0x8ca117;}function a18_0x1e10(){const _0x28ab47=['19850NpHjoH','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','aggregate','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','helpExtra','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Post-aggregation\x20filter,\x20e.g.\x20{\x22total\x22:{\x22$gt\x22:1000}}','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','POST','paramsHint','276536gPuPrY','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','520552lYhVWg','Filter\x20dataset\x20records\x20with\x20query\x20conditions','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','2091194frlzRl','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','join','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\x20\x20PAGINATION','map','params','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','216SccUQi','update','243186DKbwQk','dryRun','operation','risk','command','\x20\x20LOGICAL\x20COMBINATORS','description','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','\x20\x20EXAMPLES','\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','write','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','2113710DogdUK','batchCreate','\x20on\x20dataset\x20','read','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','getOne','\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}','now','code','filter','\x20\x20AGGREGATE\x20TYPES','paramsRequired','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','body','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20PARAMS\x20STRUCTURE','data\x20','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','delete','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','360DugMps','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','build','/api/{appCode}/','\x20completed\x20in\x20','create','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','str','55424hKjPea','\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','Update\x20an\x20existing\x20record','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)'];a18_0x1e10=function(){return _0x28ab47;};return a18_0x1e10();}export const dataDefinitions=specs[a18_0x57123e(0x1a2)](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x557274=a19_0x58f4;(function(_0x3ead99,_0x56c640){const _0x2c038f=a19_0x58f4,_0x496a31=_0x3ead99();while(!![]){try{const _0x2a8433=parseInt(_0x2c038f(0x10d))/0x1+-parseInt(_0x2c038f(0xdf))/0x2*(parseInt(_0x2c038f(0xf0))/0x3)+parseInt(_0x2c038f(0x102))/0x4+-parseInt(_0x2c038f(0x100))/0x5*(-parseInt(_0x2c038f(0xf2))/0x6)+parseInt(_0x2c038f(0xee))/0x7+parseInt(_0x2c038f(0xfe))/0x8*(parseInt(_0x2c038f(0x10e))/0x9)+-parseInt(_0x2c038f(0xf5))/0xa*(parseInt(_0x2c038f(0xe1))/0xb);if(_0x2a8433===_0x56c640)break;else _0x496a31['push'](_0x496a31['shift']());}catch(_0x2297dd){_0x496a31['push'](_0x496a31['shift']());}}}(a19_0x53bd,0x1d685));function a19_0x58f4(_0x385e9c,_0x4be7db){_0x385e9c=_0x385e9c-0xd9;const _0x53bd07=a19_0x53bd();let _0x58f4c8=_0x53bd07[_0x385e9c];return _0x58f4c8;}import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x336d9e){const _0x269e32=a19_0x58f4;if(_0x336d9e[_0x269e32(0x120)])return null;const _0x38b623=Boolean(_0x336d9e[_0x269e32(0x127)]!==undefined||_0x336d9e[_0x269e32(0x11b)]!==undefined);let _0xa33f44={};if(!_0x38b623&&typeof _0x336d9e[_0x269e32(0xfd)]==='string')try{_0xa33f44=JSON[_0x269e32(0x108)](_0x336d9e['extend']);}catch{}const _0x5c42f0=_0x38b623?_0x336d9e['name']:_0x336d9e[_0x269e32(0xf8)],_0x4b1790=_0x38b623?_0x336d9e['displayName']:_0x336d9e[_0x269e32(0x116)],_0x5c0a21=_0x38b623?_0x336d9e[_0x269e32(0x11b)]:_0x336d9e[_0x269e32(0xf6)]||_0x336d9e[_0x269e32(0xf1)],_0x57ab5b=_0x38b623?_0x336d9e[_0x269e32(0x103)]===!![]:_0xa33f44['pkField']===!![],_0x506042=_0x38b623?_0x336d9e[_0x269e32(0xdd)]===!![]:_0xa33f44[_0x269e32(0xdd)]===!![],_0xf2d69b=_0x38b623?_0x336d9e[_0x269e32(0xfb)]??null:_0xa33f44[_0x269e32(0xfb)]??null,_0x1a9e31={'name':_0x5c42f0,'displayName':_0x4b1790||_0x5c42f0,'type':_0x5c0a21,'dbType':_0x336d9e[_0x269e32(0x119)],'pk':_0x57ab5b,'required':_0x506042,'description':_0x336d9e[_0x269e32(0x121)]||undefined};return Array[_0x269e32(0x101)](_0xf2d69b)&&_0xf2d69b[_0x269e32(0xfc)]>0x0&&(_0x1a9e31[_0x269e32(0xfb)]=_0xf2d69b),_0x1a9e31;}function parseJsonMaybe(_0x489689){const _0x168a7e=a19_0x58f4;if(typeof _0x489689!==_0x168a7e(0x124))return _0x489689;try{return JSON[_0x168a7e(0x108)](_0x489689);}catch{return _0x489689;}}function normalizeOperationEntry(_0x55d9de,_0x2182ab){const _0x1ce764=a19_0x58f4;if(!_0x2182ab||typeof _0x2182ab!==_0x1ce764(0x112))return null;if(!_0x2182ab[_0x1ce764(0x11a)]||!_0x2182ab[_0x1ce764(0xda)])return null;const _0x3ac67f={'name':_0x55d9de,'method':_0x2182ab[_0x1ce764(0x11a)],'path':_0x2182ab['path']};if(_0x2182ab[_0x1ce764(0xf9)])_0x3ac67f[_0x1ce764(0xf9)]=_0x2182ab['host'];if(_0x2182ab[_0x1ce764(0x118)]!=null)_0x3ac67f[_0x1ce764(0x118)]=parseJsonMaybe(_0x2182ab['requestBody']);if(_0x2182ab[_0x1ce764(0x10a)]!=null)_0x3ac67f[_0x1ce764(0x10a)]=parseJsonMaybe(_0x2182ab[_0x1ce764(0x10a)]);if(_0x2182ab[_0x1ce764(0xde)]!=null)_0x3ac67f[_0x1ce764(0xde)]=_0x2182ab['beforeScriptId'];if(_0x2182ab[_0x1ce764(0xe3)]!=null)_0x3ac67f[_0x1ce764(0xe3)]=_0x2182ab[_0x1ce764(0xe3)];if(Array['isArray'](_0x2182ab[_0x1ce764(0x105)]))_0x3ac67f[_0x1ce764(0x105)]=_0x2182ab[_0x1ce764(0x105)];if(Array[_0x1ce764(0x101)](_0x2182ab['responseFields']))_0x3ac67f[_0x1ce764(0x115)]=_0x2182ab['responseFields'];return _0x3ac67f;}function a19_0x53bd(){const _0x413ba1=['66xqJXIW','properties','creatorIdField','70510mpURbk','type','formatRules','code','host','toFieldLabel','options','length','extend','703776HmWKrh','relations','104880QyamFx','isArray','336468hFphqt','pkField','filter','requestFields','creatorNameField','datasetKey','parse','allFieldNames','responseBody','labelField','entries','220146sKzZsJ','18ZRZIIU','toDatasetName','relatedPageInfoList','title','object','detail','allFields','responseFields','name','modelId','requestBody','dbType','method','doType','tableName','dbtableConfig','push','indexes','deleted','description','modelCode','validateRules','string','find','dbId','displayName','toDatasetCode','map','path','createTimeField','source','required','beforeScriptId','47122MIrXBj','tableComment','935dmOOHl','appCode','afterScriptId','split','read','str','logicField','dbName','trim','columnCodeListWithDeleted','toField','toTableName','dataset','391769sqYhMJ','operations','6NeESuw','dataType'];a19_0x53bd=function(){return _0x413ba1;};return a19_0x53bd();}function summarizeDbtable(_0xaa49dc){const _0xfa1d10=a19_0x58f4,_0x492039={},_0x5195ac=[_0xfa1d10(0x126),'dbName',_0xfa1d10(0x11c),_0xfa1d10(0x107),'pkField','allFields',_0xfa1d10(0xe7),_0xfa1d10(0xdb),'updateTimeField',_0xfa1d10(0xf4),_0xfa1d10(0x106),'modifierIdField','modifierNameField',_0xfa1d10(0x10b),'dblinkInfoDTO'];for(const _0x3a2b17 of _0x5195ac){if(_0xaa49dc[_0x3a2b17]!==undefined)_0x492039[_0x3a2b17]=_0xaa49dc[_0x3a2b17];}return typeof _0x492039[_0xfa1d10(0x114)]===_0xfa1d10(0x124)&&_0x492039['allFields'][_0xfa1d10(0xfc)]>0x0&&(_0x492039[_0xfa1d10(0x109)]=_0x492039[_0xfa1d10(0x114)][_0xfa1d10(0xe4)](',')[_0xfa1d10(0xd9)](_0xa889af=>_0xa889af['trim']())[_0xfa1d10(0x104)](Boolean)),_0x492039;}function normalizeRelatedPages(_0x161329){const _0x393421=a19_0x58f4;if(!Array[_0x393421(0x101)](_0x161329))return[];return _0x161329[_0x393421(0x104)](_0x43e808=>_0x43e808&&typeof _0x43e808===_0x393421(0x112))[_0x393421(0xd9)](_0x259514=>({'id':_0x259514['id'],'type':_0x259514['type'],'code':_0x259514[_0x393421(0xf8)],'title':_0x259514[_0x393421(0x111)],'deleted':_0x259514[_0x393421(0x120)]===!![]}));}function normalizeFallbackFieldName(_0x226c1f,_0x2bbc43){const _0x582138=a19_0x58f4,_0x143951=_0x226c1f[_0x582138(0xe9)]();if(!_0x143951)return null;return{'name':_0x143951,'displayName':_0x143951,'type':undefined,'dbType':undefined,'pk':_0x143951===_0x2bbc43,'required':![],'description':undefined};}async function loadListFieldFallback(_0x29f7cb,_0x4fed30){const _0x117d46=a19_0x58f4;if(!_0x29f7cb||!_0x4fed30)return[];try{const _0x17f274=await listDatasets(_0x29f7cb,{'code':_0x4fed30}),_0x2ea231=_0x17f274[_0x117d46(0x125)](_0x43d680=>_0x43d680[_0x117d46(0xf8)]===_0x4fed30)??_0x17f274[0x0],_0xebf86e=_0x2ea231?.[_0x117d46(0x11d)]??{},_0x5479f7=typeof _0xebf86e[_0x117d46(0x114)]===_0x117d46(0x124)?_0xebf86e['allFields'][_0x117d46(0xe4)](','):[];return _0x5479f7[_0x117d46(0xd9)](_0x14cace=>normalizeFallbackFieldName(_0x14cace,_0xebf86e[_0x117d46(0x103)]))[_0x117d46(0x104)](_0x253000=>_0x253000!==null);}catch{return[];}}export const datasetDetail={'service':'dataset','command':a19_0x557274(0x113),'description':'Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','risk':a19_0x557274(0xe5),'flags':[CODE_FLAG],async 'execute'(_0x4b7957){const _0x5d18ae=a19_0x557274,_0x5859c0=await getDatasetDetail(_0x4b7957[_0x5d18ae(0xe6)](_0x5d18ae(0xf8))),_0x2b4b29=Array['isArray'](_0x5859c0['fields'])?_0x5859c0['fields']:Array['isArray'](_0x5859c0[_0x5d18ae(0xf3)])?_0x5859c0[_0x5d18ae(0xf3)]:[];let _0x2ebb50=_0x2b4b29['map'](_0x14b1c8=>normalizeField(_0x14b1c8))['filter'](_0x1a2951=>_0x1a2951!==null);_0x2ebb50[_0x5d18ae(0xfc)]===0x0&&(_0x2ebb50=await loadListFieldFallback(_0x4b7957[_0x5d18ae(0xe2)],_0x4b7957[_0x5d18ae(0xe6)](_0x5d18ae(0xf8))));const _0xb9b705=_0x5859c0[_0x5d18ae(0xef)]??{},_0x461cbd=[];for(const [_0x2e7607,_0xbb8f43]of Object[_0x5d18ae(0x10c)](_0xb9b705)){const _0x5b238b=normalizeOperationEntry(_0x2e7607,_0xbb8f43);if(_0x5b238b)_0x461cbd[_0x5d18ae(0x11e)](_0x5b238b);}const _0x340f25=_0x5859c0['dbtableConfig']??{},_0x4d79c1=_0x5859c0[_0x5d18ae(0xed)]??{},_0x2a36e5=_0x340f25[_0x5d18ae(0x126)]!=null?{'id':_0x340f25[_0x5d18ae(0x126)],'name':_0x340f25[_0x5d18ae(0xe8)]??null}:undefined;let _0x1bc1c9;return typeof _0x5859c0[_0x5d18ae(0xfd)]===_0x5d18ae(0x124)&&(_0x1bc1c9=parseJsonMaybe(_0x5859c0['extend'])),{'ok':!![],'data':{'id':_0x5859c0[_0x5d18ae(0x117)]??_0x5859c0['id'],'name':_0x5859c0['name'],'code':_0x5859c0[_0x5d18ae(0x122)]||_0x5859c0[_0x5d18ae(0xf8)],'doVersion':_0x5859c0['doVersion'],'description':_0x5859c0['description']||_0x4d79c1[_0x5d18ae(0xe0)]||undefined,'source':_0x5859c0[_0x5d18ae(0xdc)]||_0x4d79c1['sourceType'],'table':_0x340f25[_0x5d18ae(0x11c)]||_0x4d79c1[_0x5d18ae(0x11c)],'datasetKey':_0x340f25['datasetKey'],'pk':_0x340f25[_0x5d18ae(0x103)],'db':_0x2a36e5,'dbtable':summarizeDbtable(_0x340f25),'fields':_0x2ebb50,'operations':_0x461cbd,'indexes':Array[_0x5d18ae(0x101)](_0x4d79c1[_0x5d18ae(0x11f)])?_0x4d79c1['indexes']:[],'relations':Array[_0x5d18ae(0x101)](_0x5859c0[_0x5d18ae(0xff)])?_0x5859c0['relations'][_0x5d18ae(0xd9)](_0x17c610=>({'fromField':_0x17c610['fromField'],'toDataset':_0x17c610[_0x5d18ae(0x10f)],'toCode':_0x17c610[_0x5d18ae(0x128)],'toTable':_0x17c610[_0x5d18ae(0xec)],'toField':_0x17c610[_0x5d18ae(0xeb)],'labelField':_0x17c610[_0x5d18ae(0xfa)]||undefined})):[],'relatedPages':normalizeRelatedPages(_0x5859c0[_0x5d18ae(0x110)]),...Array[_0x5d18ae(0x101)](_0x5859c0[_0x5d18ae(0xea)])?{'columnCodeListWithDeleted':_0x5859c0[_0x5d18ae(0xea)]}:{},'formatRules':Array['isArray'](_0x5859c0[_0x5d18ae(0xf7)])?_0x5859c0['formatRules']:[],'validateRules':Array['isArray'](_0x5859c0[_0x5d18ae(0x123)])?_0x5859c0[_0x5d18ae(0x123)]:[],..._0x1bc1c9!==undefined?{'extend':_0x1bc1c9}:{},'stats':{'fieldCount':_0x2ebb50['length'],'operationCount':_0x461cbd['length']}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2f367e,_0x28fc90){const _0x53e32b=a20_0x5d94,_0x1893f0=_0x2f367e();while(!![]){try{const _0x31118b=parseInt(_0x53e32b(0x13e))/0x1*(parseInt(_0x53e32b(0x13b))/0x2)+-parseInt(_0x53e32b(0x135))/0x3*(parseInt(_0x53e32b(0x136))/0x4)+-parseInt(_0x53e32b(0x139))/0x5*(parseInt(_0x53e32b(0x13c))/0x6)+-parseInt(_0x53e32b(0x13d))/0x7+-parseInt(_0x53e32b(0x134))/0x8*(parseInt(_0x53e32b(0x137))/0x9)+-parseInt(_0x53e32b(0x133))/0xa*(parseInt(_0x53e32b(0x138))/0xb)+parseInt(_0x53e32b(0x13a))/0xc;if(_0x31118b===_0x28fc90)break;else _0x1893f0['push'](_0x1893f0['shift']());}catch(_0x45fe4f){_0x1893f0['push'](_0x1893f0['shift']());}}}(a20_0x5968,0x378e8));function a20_0x5968(){const _0x43d9ee=['5OqgSQX','17621676gRVPDM','5422muKcpE','2488938LJGSkc','2484615szBldA','86GoaQfq','10SsoJVJ','262008vlfEoe','10203pZoBfu','348WGcNhZ','99YkfLRf','529573iNjXoB'];a20_0x5968=function(){return _0x43d9ee;};return a20_0x5968();}import{datasetList}from'../../commands/dataset/list.js';import{datasetDetail}from'../../commands/dataset/detail.js';function a20_0x5d94(_0x17d5a6,_0x484a28){_0x17d5a6=_0x17d5a6-0x133;const _0x5968be=a20_0x5968();let _0x5d94ae=_0x5968be[_0x17d5a6];return _0x5d94ae;}import{datasetSdkDoc}from'../../commands/dataset/sdk-doc.js';export const datasetDefinitions=[datasetList,datasetDetail,datasetSdkDoc];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a21_0x2a4f(_0x318a47,_0x1607a3){_0x318a47=_0x318a47-0x1a0;const _0x3b8c16=a21_0x3b8c();let _0x2a4f49=_0x3b8c16[_0x318a47];return _0x2a4f49;}const a21_0x2963ce=a21_0x2a4f;(function(_0x5b4c45,_0x5b3566){const _0x5ed462=a21_0x2a4f,_0x221cd2=_0x5b4c45();while(!![]){try{const _0x13215e=parseInt(_0x5ed462(0x1a1))/0x1*(-parseInt(_0x5ed462(0x1b3))/0x2)+-parseInt(_0x5ed462(0x1a4))/0x3+-parseInt(_0x5ed462(0x1a3))/0x4*(-parseInt(_0x5ed462(0x1b5))/0x5)+parseInt(_0x5ed462(0x1ac))/0x6+parseInt(_0x5ed462(0x1a8))/0x7*(-parseInt(_0x5ed462(0x1bb))/0x8)+parseInt(_0x5ed462(0x1ae))/0x9*(-parseInt(_0x5ed462(0x1ba))/0xa)+parseInt(_0x5ed462(0x1b4))/0xb;if(_0x13215e===_0x5b3566)break;else _0x221cd2['push'](_0x221cd2['shift']());}catch(_0x1cb7dc){_0x221cd2['push'](_0x221cd2['shift']());}}}(a21_0x3b8c,0x2186c));import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function a21_0x3b8c(){const _0x159058=['list','map','370614xaCxVV','length','6057WhseEh','code','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','pkField','string','308dwEhgy','5771711NjSATc','5sTOfCJ','name','allFields','read','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','2470gYTogx','352wwVgOr','tableName','Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)','539BrpGZR','appCode','468516eFrqZb','373218eefBZX','datasetKey','str','dataset','30646zuapbF','description'];a21_0x3b8c=function(){return _0x159058;};return a21_0x3b8c();}export const datasetList={'service':a21_0x2963ce(0x1a7),'command':a21_0x2963ce(0x1aa),'description':a21_0x2963ce(0x1b0),'risk':a21_0x2963ce(0x1b8),'flags':[{'name':a21_0x2963ce(0x1b6),'type':a21_0x2963ce(0x1b2),'description':a21_0x2963ce(0x1a0)},{...CODE_FLAG,'required':![],'description':a21_0x2963ce(0x1b9)}],async 'execute'(_0x8b3358){const _0x200166=a21_0x2963ce,_0x5b3b2b=_0x8b3358['str']('name'),_0x1ee950=_0x8b3358[_0x200166(0x1a6)](_0x200166(0x1af)),_0x2f5f1e=await listDatasets(_0x8b3358[_0x200166(0x1a2)],{..._0x5b3b2b&&{'name':_0x5b3b2b},..._0x1ee950&&{'code':_0x1ee950}});return{'ok':!![],'data':{'total':_0x2f5f1e[_0x200166(0x1ad)],'datasets':_0x2f5f1e[_0x200166(0x1ab)](_0x370a86=>{const _0x35c51b=_0x200166,_0x735987=_0x370a86['dbtableConfig']??{};return{'id':_0x370a86['id'],'code':_0x370a86[_0x35c51b(0x1af)],'name':_0x370a86[_0x35c51b(0x1b6)],'source':_0x370a86['source'],'description':_0x370a86[_0x35c51b(0x1a9)],'table':_0x735987[_0x35c51b(0x1bc)],'datasetKey':_0x735987[_0x35c51b(0x1a5)],'pk':_0x735987[_0x35c51b(0x1b1)],'fields':_0x735987[_0x35c51b(0x1b7)]?_0x735987[_0x35c51b(0x1b7)]['split'](',')[_0x35c51b(0x1ab)](_0x3dca3=>_0x3dca3['trim']()):[]};})}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a22_0x3e30(){const _0x5cafcf=['trim','3240284ZcFIYz','sdk-doc','appCode','Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','20WTVIJj','15808266FtXYlx','438018vaVneb','340143RczhiK','str','Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','4983460BLUhQN','dataset','102RgwNIb','7740424aCAuMK','read','1371388McfTQV','code'];a22_0x3e30=function(){return _0x5cafcf;};return a22_0x3e30();}const a22_0x3200e4=a22_0x390a;function a22_0x390a(_0x3d539f,_0x163ffb){_0x3d539f=_0x3d539f-0xf5;const _0x3e302e=a22_0x3e30();let _0x390ae5=_0x3e302e[_0x3d539f];return _0x390ae5;}(function(_0x238fd3,_0x22f284){const _0x279597=a22_0x390a,_0x1993ee=_0x238fd3();while(!![]){try{const _0x2f1087=parseInt(_0x279597(0x103))/0x1+parseInt(_0x279597(0xf8))/0x2*(-parseInt(_0x279597(0xfb))/0x3)+-parseInt(_0x279597(0x106))/0x4+parseInt(_0x279597(0xfe))/0x5+-parseInt(_0x279597(0x100))/0x6*(-parseInt(_0x279597(0xfa))/0x7)+parseInt(_0x279597(0x101))/0x8+-parseInt(_0x279597(0xf9))/0x9;if(_0x2f1087===_0x22f284)break;else _0x1993ee['push'](_0x1993ee['shift']());}catch(_0x28a229){_0x1993ee['push'](_0x1993ee['shift']());}}}(a22_0x3e30,0xaaa9c));import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';const DEFAULT_MARKDOWN='#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档';export function formatDatasetSdkMarkdown(_0x3997eb){const _0x4f930c=a22_0x390a,_0x226a03=typeof _0x3997eb==='string'?_0x3997eb[_0x4f930c(0x105)]():'';return _0x226a03||DEFAULT_MARKDOWN;}export const datasetSdkDoc={'service':a22_0x3200e4(0xff),'command':a22_0x3200e4(0xf5),'description':a22_0x3200e4(0xfd),'risk':a22_0x3200e4(0x102),'flags':[{...CODE_FLAG,'description':a22_0x3200e4(0xf7)}],async 'execute'(_0x58bd91){const _0x116d25=a22_0x3200e4,_0x31fa19=_0x58bd91[_0x116d25(0xfc)](_0x116d25(0x104)),_0x26af6f=await getDatasetSdkUsageDoc(_0x31fa19,_0x58bd91[_0x116d25(0xf6)]);return{'ok':!![],'data':{'code':_0x31fa19,'appCode':_0x58bd91[_0x116d25(0xf6)],'markdown':formatDatasetSdkMarkdown(_0x26af6f)}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x380345=a23_0x5e06;(function(_0x461a12,_0x14b1a2){const _0x18c13e=a23_0x5e06,_0x4eb4b4=_0x461a12();while(!![]){try{const _0x122706=-parseInt(_0x18c13e(0x177))/0x1*(parseInt(_0x18c13e(0x1b3))/0x2)+parseInt(_0x18c13e(0x1b1))/0x3*(parseInt(_0x18c13e(0x180))/0x4)+parseInt(_0x18c13e(0x198))/0x5+-parseInt(_0x18c13e(0x197))/0x6*(-parseInt(_0x18c13e(0x182))/0x7)+parseInt(_0x18c13e(0x1b5))/0x8+parseInt(_0x18c13e(0x193))/0x9+-parseInt(_0x18c13e(0x19e))/0xa*(parseInt(_0x18c13e(0x19a))/0xb);if(_0x122706===_0x14b1a2)break;else _0x4eb4b4['push'](_0x4eb4b4['shift']());}catch(_0x5945a4){_0x4eb4b4['push'](_0x4eb4b4['shift']());}}}(a23_0xded9,0x6e516));import a23_0x2bfafc 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_0xded9(){const _0x421fc4=['(removed\x20—\x20cookie\x20auth\x20disabled)','\x20\x20Auth','ClientAk','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','platform','5165QQORGY','appCode','defaultApp','\x20\x20─','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','(default:\x20','green','verbose','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','16KnYElB','(missing)','238OWkjNw','\x20\x20API\x20Endpoints','empty','gray','Global','(not\x20set)','status','Diagnose\x20CLI\x20configuration\x20and\x20environment','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','(not\x20found)','(set,\x20length=','missing','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20(accessKey)','check','✓\x20Valid\x20JSON','(default)','3411828bulOYQ','\x20(legacy/compat\x20only)','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','8562jCfZqt','1037470oPCveL','length','11cNYtDx','⚠\x20Empty\x20(treated\x20as\x20{})','doctor','pageSize','16607110MHGoWd','\x20\x20Merged\x20Config','yellow','locale','format','message','red','read','Project','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','(none)','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','repeat','arch','\x20\x20auth\x20(effective):\x20','log','padEnd','\x20\x20Config\x20Files','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','626442CeDYyR','bold','76EbuiHI','accessKey','6707864NLsDOE','(no\x20file)','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20'];a23_0xded9=function(){return _0x421fc4;};return a23_0xded9();}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';function a23_0x5e06(_0x486f0d,_0x1067c3){_0x486f0d=_0x486f0d-0x175;const _0xded921=a23_0xded9();let _0x5e0654=_0xded921[_0x486f0d];return _0x5e0654;}import{isLegacyCompatConfigKey}from'../config/schema.js';async function execute(_0xae503e){const _0x50277e=a23_0x5e06,_0xc6c36=getCliVersion(),_0x2587e7=buildConfigFromFlags({});await initGlobalEnvironment(_0x2587e7),console['log'](),console[_0x50277e(0x1ad)](a23_0x2bfafc['bold'](CLI_BIN_NAME+'\x20doctor')),console['log'](a23_0x2bfafc[_0x50277e(0x185)]('─'[_0x50277e(0x1aa)](0x32))),console[_0x50277e(0x1ad)]('\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20'+_0xc6c36),console[_0x50277e(0x1ad)](_0x50277e(0x18e)+process['version']),console[_0x50277e(0x1ad)](_0x50277e(0x17b)+process[_0x50277e(0x176)]+'\x20'+process[_0x50277e(0x1ab)]),console['log'](),console[_0x50277e(0x1ad)](a23_0x2bfafc[_0x50277e(0x1b2)](_0x50277e(0x1af))),console['log'](a23_0x2bfafc[_0x50277e(0x185)](_0x50277e(0x17a)[_0x50277e(0x1aa)](0x1e)));const _0x5775a0=getGlobalConfigPath(),_0x94f9f7=getProjectConfigPath();console[_0x50277e(0x1ad)]('\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x5775a0||a23_0x2bfafc[_0x50277e(0x185)]('(not\x20found)'))),console[_0x50277e(0x1ad)](_0x50277e(0x18a)+(_0x94f9f7||a23_0x2bfafc[_0x50277e(0x185)](_0x50277e(0x18b)))),console[_0x50277e(0x1ad)](),console[_0x50277e(0x1ad)](a23_0x2bfafc[_0x50277e(0x1b2)]('\x20\x20Config\x20JSON')),console['log'](a23_0x2bfafc['gray']('\x20\x20─'[_0x50277e(0x1aa)](0x1e)));const _0xe66422=(_0xced337,_0x2b3ccd)=>{const _0x4bf5d3=_0x50277e;if(!_0x2b3ccd){console['log']('\x20\x20'+_0xced337[_0x4bf5d3(0x1ae)](0x11)+'\x20'+a23_0x2bfafc['gray'](_0x4bf5d3(0x1b6)));return;}const _0xe58782=inspectCliConfigJsonFile(_0x2b3ccd);if(_0xe58782[_0x4bf5d3(0x188)]==='ok')console['log']('\x20\x20'+_0xced337[_0x4bf5d3(0x1ae)](0x11)+'\x20'+a23_0x2bfafc[_0x4bf5d3(0x17d)](_0x4bf5d3(0x191)));else{if(_0xe58782['status']===_0x4bf5d3(0x184))console[_0x4bf5d3(0x1ad)]('\x20\x20'+_0xced337[_0x4bf5d3(0x1ae)](0x11)+'\x20'+a23_0x2bfafc[_0x4bf5d3(0x1a0)](_0x4bf5d3(0x19b)));else _0xe58782[_0x4bf5d3(0x188)]===_0x4bf5d3(0x18d)?console[_0x4bf5d3(0x1ad)]('\x20\x20'+_0xced337[_0x4bf5d3(0x1ae)](0x11)+'\x20'+a23_0x2bfafc[_0x4bf5d3(0x185)](_0x4bf5d3(0x181))):(console['log']('\x20\x20'+_0xced337[_0x4bf5d3(0x1ae)](0x11)+'\x20'+a23_0x2bfafc['red']('✗\x20Invalid\x20JSON')),console[_0x4bf5d3(0x1ad)]('\x20\x20'+''[_0x4bf5d3(0x1ae)](0x11)+'\x20'+a23_0x2bfafc[_0x4bf5d3(0x1a4)](_0xe58782[_0x4bf5d3(0x1a3)])));}};_0xe66422(_0x50277e(0x186),_0x5775a0),_0xe66422(_0x50277e(0x1a6),_0x94f9f7),console['log'](),console[_0x50277e(0x1ad)](a23_0x2bfafc['bold'](_0x50277e(0x19f))),console[_0x50277e(0x1ad)](a23_0x2bfafc[_0x50277e(0x185)](_0x50277e(0x17a)[_0x50277e(0x1aa)](0x1e))),console[_0x50277e(0x1ad)](_0x50277e(0x1a7)+(_0x2587e7[_0x50277e(0x178)]||a23_0x2bfafc[_0x50277e(0x1a4)](_0x50277e(0x187)))),console[_0x50277e(0x1ad)]('\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x2587e7['env']);const _0x4f2d8a=isLegacyCompatConfigKey(_0x50277e(0x1a1))?a23_0x2bfafc[_0x50277e(0x185)](_0x2587e7[_0x50277e(0x1a1)]+_0x50277e(0x194)):_0x2587e7[_0x50277e(0x1a1)];return console[_0x50277e(0x1ad)](_0x50277e(0x1a9)+_0x4f2d8a),console[_0x50277e(0x1ad)](_0x50277e(0x17f)+(_0x2587e7[_0x50277e(0x179)]||a23_0x2bfafc[_0x50277e(0x185)](_0x50277e(0x1a8)))),console['log'](_0x50277e(0x196)+(_0x2587e7['currentApp']||a23_0x2bfafc[_0x50277e(0x185)](_0x50277e(0x1a8)))),console[_0x50277e(0x1ad)](_0x50277e(0x1b0)+(_0x2587e7[_0x50277e(0x1a2)]||a23_0x2bfafc[_0x50277e(0x185)](_0x50277e(0x17c)+DEFAULT_CONFIG_VALUES[_0x50277e(0x1a2)]+')'))),console[_0x50277e(0x1ad)]('\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x2587e7[_0x50277e(0x19d)]??a23_0x2bfafc['gray'](_0x50277e(0x192)))),console[_0x50277e(0x1ad)]('\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20'+_0x2587e7['riskLevel']),console['log'](_0x50277e(0x195)+_0x2587e7[_0x50277e(0x17e)]),console[_0x50277e(0x1ad)](_0x50277e(0x1ac)+AUTH_MODE['ClientAk']),console[_0x50277e(0x1ad)]('\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20'+(_0x2587e7[_0x50277e(0x1b4)]?a23_0x2bfafc[_0x50277e(0x17d)](_0x50277e(0x18c)+_0x2587e7['accessKey'][_0x50277e(0x199)]+')'):a23_0x2bfafc[_0x50277e(0x185)]('(none)'))),console[_0x50277e(0x1ad)](),console[_0x50277e(0x1ad)](a23_0x2bfafc[_0x50277e(0x1b2)](_0x50277e(0x183))),console[_0x50277e(0x1ad)](a23_0x2bfafc['gray']('\x20\x20─'[_0x50277e(0x1aa)](0x1e))),console[_0x50277e(0x1ad)](_0x50277e(0x1b7)+getApiDomain()),console['log'](_0x50277e(0x175)+getUserDomain()),console[_0x50277e(0x1ad)]('\x20\x20runtimeDomain:\x20\x20\x20'+getRuntimeDomain()),console[_0x50277e(0x1ad)](),console[_0x50277e(0x1ad)](a23_0x2bfafc[_0x50277e(0x1b2)](_0x50277e(0x1b9))),console[_0x50277e(0x1ad)](a23_0x2bfafc['gray'](_0x50277e(0x17a)['repeat'](0x1e))),console['log']('\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+a23_0x2bfafc[_0x50277e(0x17d)](AUTH_MODE[_0x50277e(0x1ba)]+_0x50277e(0x18f))),console['log']('\x20\x20Session\x20check:\x20\x20\x20'+a23_0x2bfafc[_0x50277e(0x185)](_0x50277e(0x1b8))),console[_0x50277e(0x1ad)](),{'ok':!![]};}export const doctorDefinition={'service':a23_0x380345(0x19c),'command':a23_0x380345(0x190),'description':a23_0x380345(0x189),'risk':a23_0x380345(0x1a5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a24_0x2f7cb7=a24_0x1058;(function(_0x4fc799,_0x2003d5){const _0x25eb0b=a24_0x1058,_0x2db83a=_0x4fc799();while(!![]){try{const _0x265686=-parseInt(_0x25eb0b(0x11c))/0x1*(parseInt(_0x25eb0b(0x138))/0x2)+-parseInt(_0x25eb0b(0x117))/0x3+parseInt(_0x25eb0b(0x134))/0x4*(parseInt(_0x25eb0b(0x13b))/0x5)+parseInt(_0x25eb0b(0x133))/0x6+-parseInt(_0x25eb0b(0x11a))/0x7+parseInt(_0x25eb0b(0x119))/0x8+-parseInt(_0x25eb0b(0x135))/0x9*(-parseInt(_0x25eb0b(0x120))/0xa);if(_0x265686===_0x2003d5)break;else _0x2db83a['push'](_0x2db83a['shift']());}catch(_0x1626fb){_0x2db83a['push'](_0x2db83a['shift']());}}}(a24_0x2511,0xb0603));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_0x2f7cb7(0x144),'type':a24_0x2f7cb7(0x116),'description':'App\x20code\x20for\x20the\x20project'},{'name':a24_0x2f7cb7(0x147),'type':a24_0x2f7cb7(0x116),'description':a24_0x2f7cb7(0x143)+DEFAULT_CONFIG_VALUES[a24_0x2f7cb7(0x147)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':'boolean','description':a24_0x2f7cb7(0x139)+PRODUCT_CONFIG[a24_0x2f7cb7(0x111)]+')\x20instead\x20of\x20project','default':![]},{'name':a24_0x2f7cb7(0x13a),'type':a24_0x2f7cb7(0x128),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':'file','type':a24_0x2f7cb7(0x116),'description':a24_0x2f7cb7(0x114),'required':!![]},{'name':'appcode','type':a24_0x2f7cb7(0x116),'description':a24_0x2f7cb7(0x148)},{'name':a24_0x2f7cb7(0x147),'type':a24_0x2f7cb7(0x116),'description':a24_0x2f7cb7(0x121),'enum':[...RUNTIME_ENV_VALUES]},{'name':a24_0x2f7cb7(0x123),'type':a24_0x2f7cb7(0x128),'description':a24_0x2f7cb7(0x139)+PRODUCT_CONFIG[a24_0x2f7cb7(0x111)]+a24_0x2f7cb7(0x151),'default':![]},{'name':'yes','type':'boolean','description':a24_0x2f7cb7(0x13e),'default':![]}];export async function runInit(_0x38ff1d){const _0x2b4a3f=a24_0x2f7cb7,_0x324258=isNonInteractiveMode(_0x38ff1d),_0x26cd01=_0x38ff1d[_0x2b4a3f(0x123)]?_0x2b4a3f(0x123):'project',_0x2caa4c=resolveWriteConfigPath(_0x26cd01);try{_0x324258?await runNonInteractive(_0x38ff1d,_0x2caa4c):await runInteractive(_0x38ff1d,_0x2caa4c);}catch(_0x2e0fc0){if(_0x2e0fc0 instanceof AbortPrompt)throw CliErrors[_0x2b4a3f(0x131)]();throw _0x2e0fc0;}}export async function runInitImport(_0x2f3d42){const _0x4fc44c=a24_0x2f7cb7,_0x36b11d=_0x2f3d42[_0x4fc44c(0x123)]?_0x4fc44c(0x123):'project',_0x574a=resolveWriteConfigPath(_0x36b11d);await runFromImport(_0x2f3d42,_0x574a);}const RUNTIME_IRRELEVANT_KEYS=new Set([a24_0x2f7cb7(0x112)]);function a24_0x1058(_0x47cc4f,_0x5a87ab){_0x47cc4f=_0x47cc4f-0x10d;const _0x251132=a24_0x2511();let _0x10581d=_0x251132[_0x47cc4f];return _0x10581d;}async function runFromImport(_0x19e67c,_0x4de5fb){const _0x4c1f86=a24_0x2f7cb7,_0x3e53ce=resolveFilePath(_0x19e67c[_0x4c1f86(0x13f)]);if(!existsSync(_0x3e53ce))throw CliErrors[_0x4c1f86(0x145)](_0x4c1f86(0x132)+_0x3e53ce);const _0x1de0a4=readSourceFile(_0x3e53ce),_0x5c3567=convertToRuntimeConfig(_0x1de0a4);_0x19e67c[_0x4c1f86(0x144)]&&(_0x5c3567[_0x4c1f86(0x144)]=String(_0x19e67c[_0x4c1f86(0x144)]));_0x19e67c[_0x4c1f86(0x147)]&&(_0x5c3567['env']=resolveInitEnv(_0x19e67c));if(!_0x5c3567[_0x4c1f86(0x144)])throw CliErrors[_0x4c1f86(0x145)](_0x4c1f86(0x146),_0x4c1f86(0x12d));await writeInitConfig(_0x4de5fb,_0x5c3567,_0x19e67c),console['log'](_0x4c1f86(0x12b)+_0x3e53ce),console[_0x4c1f86(0x140)](_0x4c1f86(0x153)+_0x4de5fb),console[_0x4c1f86(0x140)](_0x4c1f86(0x10f)+_0x5c3567['appcode']);if(_0x5c3567['defaultApp'])console[_0x4c1f86(0x140)]('\x20\x20default:\x20'+_0x5c3567[_0x4c1f86(0x141)]);}function convertToRuntimeConfig(_0x3c06d2){const _0x368aa1=a24_0x2f7cb7;if(_0x3c06d2['apps']&&typeof _0x3c06d2[_0x368aa1(0x14d)]===_0x368aa1(0x11d))throw CliErrors['validation']('Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.',_0x368aa1(0x137));const _0x596dcb={};for(const _0x236cf4 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x3c06d2[_0x236cf4]!==undefined&&(_0x596dcb[_0x236cf4]=_0x3c06d2[_0x236cf4]);}return!_0x596dcb['riskLevel']&&(_0x596dcb[_0x368aa1(0x14a)]=DEFAULT_CONFIG_VALUES[_0x368aa1(0x14a)]),_0x596dcb;}async function runNonInteractive(_0x5d4fc3,_0x551c11){const _0x3e249a=a24_0x2f7cb7,_0x26fde0=_0x5d4fc3[_0x3e249a(0x144)];if(!_0x26fde0)throw CliErrors[_0x3e249a(0x10d)](_0x3e249a(0x144),'Usage:\x20'+CLI_BIN_NAME+_0x3e249a(0x152));const _0x1f24c9=resolveInitEnv(_0x5d4fc3);await writeInitConfig(_0x551c11,{'appcode':_0x26fde0,'env':_0x1f24c9},_0x5d4fc3),console[_0x3e249a(0x140)](_0x3e249a(0x12e)+_0x551c11),console[_0x3e249a(0x140)](_0x3e249a(0x10f)+_0x26fde0),console[_0x3e249a(0x140)](_0x3e249a(0x13c)+_0x1f24c9);}async function runInteractive(_0x209791,_0x447a62){const _0x29ee4e=a24_0x2f7cb7,_0x29bbd8=loadExisting(_0x447a62),_0x4b7ed0=typeof _0x29bbd8?.[_0x29ee4e(0x144)]===_0x29ee4e(0x116)?_0x29bbd8['appcode']:'',_0x50d885=resolveInitEnv(_0x209791);console[_0x29ee4e(0x140)](CLI_BIN_NAME+_0x29ee4e(0x136)+PRODUCT_CONFIG[_0x29ee4e(0x111)]+'\x0a');if(existsSync(_0x447a62)&&!_0x209791[_0x29ee4e(0x13a)]){const _0x3c2e46=await promptYesNo(_0x29ee4e(0x11b)+_0x447a62+_0x29ee4e(0x11f),![]);if(!_0x3c2e46){console[_0x29ee4e(0x140)](_0x29ee4e(0x12a));return;}}const _0xaefa5f=typeof _0x209791[_0x29ee4e(0x144)]===_0x29ee4e(0x116)?_0x209791[_0x29ee4e(0x144)][_0x29ee4e(0x14b)]():'';let _0x57293f=_0xaefa5f;!_0x57293f&&(_0x57293f=await promptInput(_0x29ee4e(0x14c),_0x4b7ed0));if(!_0x57293f['trim']())throw CliErrors[_0x29ee4e(0x145)]('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x447a62,{'appcode':_0x57293f[_0x29ee4e(0x14b)](),'env':_0x50d885},_0x209791),console[_0x29ee4e(0x140)]('\x0aInitialized\x20'+_0x447a62),console[_0x29ee4e(0x140)]('\x20\x20appcode:\x20'+_0x57293f[_0x29ee4e(0x14b)]()),console[_0x29ee4e(0x140)](_0x29ee4e(0x13c)+_0x50d885);}function a24_0x2511(){const _0x3e7cdb=['trim','App\x20code','apps','Failed\x20to\x20parse\x20source\x20file:\x20','stdout','once',')\x20instead\x20of\x20project','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','\x20\x20config:\x20\x20','name','flagMissing','removeListener','\x20\x20appcode:\x20','cwd','newConfigFileName','apiDir','entries','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','question','string','2732985YUSnem','SIGINT','4074496XvhnZa','9959117xOHzKB','File\x20','1pBkrQl','object','parse','\x20already\x20exists.\x20Overwrite?','10fsDmKw','Override\x20imported\x20default\x20env','race','global','utf8','\x22.\x20Allowed:\x20','[y/N]','toLowerCase','boolean','close','Aborted.','Imported\x20from\x20','app','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`.','Initialized\x20','Invalid\x20env\x20\x22','message','cancelled','Source\x20file\x20not\x20found:\x20','4071948yIkGtM','5514648OOHVKV','6453558pjhbMN','\x20init\x20—\x20Create\x20','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','455066eJHUDH','Write\x20to\x20global\x20(~/','yes','5LqJGkS','\x20\x20env:\x20\x20\x20\x20\x20','):\x20','Skip\x20confirmation\x20when\x20overwriting','file','log','defaultApp','[Y/n]','Target\x20environment\x20(default\x20','appcode','validation','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','env','Override\x20imported\x20default\x20appcode','User\x20aborted\x20prompt','riskLevel'];a24_0x2511=function(){return _0x3e7cdb;};return a24_0x2511();}async function writeInitConfig(_0x422429,_0x1ef698,_0x5b74bd){const _0x4f8064=a24_0x2f7cb7;let _0x5acb83={};existsSync(_0x422429)&&!_0x5b74bd[_0x4f8064(0x13a)]&&(_0x5acb83=readConfigFile(_0x422429));for(const [_0x2befc7,_0x7430e3]of Object[_0x4f8064(0x113)](_0x1ef698)){_0x7430e3!==undefined&&(_0x5acb83[_0x2befc7]=_0x7430e3);}if(_0x5acb83['app'])delete _0x5acb83[_0x4f8064(0x12c)];writeConfigFile(_0x422429,_0x5acb83);}class AbortPrompt extends Error{constructor(){const _0x4bff83=a24_0x2f7cb7;super(_0x4bff83(0x149)),this[_0x4bff83(0x154)]='AbortPrompt';}}function createSafeRl(){const _0x62ac7=a24_0x2f7cb7,_0x400500=createInterface({'input':process['stdin'],'output':process[_0x62ac7(0x14f)]});let _0x2cf7e7;const _0x138fa4=new Promise((_0x52b7f5,_0x2b70c8)=>{const _0x3eaea2=_0x62ac7;_0x2cf7e7=()=>{const _0x20e924=a24_0x1058;_0x2cf7e7&&(_0x400500[_0x20e924(0x10e)](_0x20e924(0x118),_0x2cf7e7),_0x2cf7e7=undefined);try{_0x400500[_0x20e924(0x129)]();}catch{}_0x2b70c8(new AbortPrompt());},_0x400500[_0x3eaea2(0x150)](_0x3eaea2(0x118),_0x2cf7e7);}),_0x4df548=()=>{const _0x490055=_0x62ac7;_0x2cf7e7&&(_0x400500['removeListener'](_0x490055(0x118),_0x2cf7e7),_0x2cf7e7=undefined);try{_0x400500[_0x490055(0x129)]();}catch{}};return{'rl':_0x400500,'abortPromise':_0x138fa4,'disposeSuccess':_0x4df548};}async function promptInput(_0xa3457,_0x2344e8){const {rl:_0x51821a,abortPromise:_0x1b80d6,disposeSuccess:_0x5cc44b}=createSafeRl(),_0x1c501a=new Promise(_0x2ac1f4=>{const _0x465625=a24_0x1058,_0x3ff37e=_0x2344e8?'\x20\x20'+_0xa3457+'\x20('+_0x2344e8+_0x465625(0x13d):'\x20\x20'+_0xa3457+':\x20';_0x51821a['question'](_0x3ff37e,_0x5280dc=>{const _0x4bd976=_0x465625;_0x5cc44b(),_0x2ac1f4(_0x5280dc[_0x4bd976(0x14b)]()||_0x2344e8);});});return Promise['race']([_0x1c501a,_0x1b80d6]);}async function promptYesNo(_0x1df4d8,_0x245fd1){const _0x545ffa=a24_0x2f7cb7,{rl:_0xf427c3,abortPromise:_0x222239,disposeSuccess:_0x47ada5}=createSafeRl(),_0x4a23e2=new Promise(_0x1b9fc5=>{const _0x57c1b6=a24_0x1058,_0x4fd181=_0x245fd1?_0x57c1b6(0x142):_0x57c1b6(0x126);_0xf427c3[_0x57c1b6(0x115)]('\x20\x20'+_0x1df4d8+'\x20'+_0x4fd181+':\x20',_0x48a9fd=>{const _0x49559b=_0x57c1b6;_0x47ada5();const _0x3bc90f=_0x48a9fd[_0x49559b(0x14b)]()[_0x49559b(0x127)]();if(_0x3bc90f==='y'||_0x3bc90f===_0x49559b(0x13a))_0x1b9fc5(!![]);else{if(_0x3bc90f==='n'||_0x3bc90f==='no')_0x1b9fc5(![]);else _0x1b9fc5(_0x245fd1);}});});return Promise[_0x545ffa(0x122)]([_0x4a23e2,_0x222239]);}function loadExisting(_0x4e0e9a){if(!existsSync(_0x4e0e9a))return null;return readConfigFile(_0x4e0e9a);}function resolveFilePath(_0x595ea1){const _0x921f21=a24_0x2f7cb7;return isAbsolute(_0x595ea1)?_0x595ea1:resolve(process[_0x921f21(0x110)](),_0x595ea1);}function readSourceFile(_0x14eee6){const _0x13fe7a=a24_0x2f7cb7;try{const _0x39d587=readFileSync(_0x14eee6,{'encoding':_0x13fe7a(0x124)});return JSON[_0x13fe7a(0x11e)](_0x39d587);}catch(_0xbab0d6){throw CliErrors['validation'](_0x13fe7a(0x14e)+_0xbab0d6[_0x13fe7a(0x130)]);}}function resolveInitEnv(_0xf5f684){const _0x207220=a24_0x2f7cb7,_0x2b0260=_0xf5f684[_0x207220(0x147)];if(_0x2b0260===undefined||_0x2b0260==='')return DEFAULT_CONFIG_VALUES[_0x207220(0x147)];if(!RUNTIME_ENV_VALUES['includes'](_0x2b0260))throw CliErrors['validation'](_0x207220(0x12f)+_0x2b0260+_0x207220(0x125)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x2b0260;}
|
|
1
|
+
const a24_0x511ea8=a24_0x5d49;(function(_0x4526a5,_0x1f73c1){const _0x9c75e3=a24_0x5d49,_0x27a6fd=_0x4526a5();while(!![]){try{const _0x1ef2b5=-parseInt(_0x9c75e3(0xb7))/0x1*(parseInt(_0x9c75e3(0xa6))/0x2)+parseInt(_0x9c75e3(0x9c))/0x3+-parseInt(_0x9c75e3(0x93))/0x4+-parseInt(_0x9c75e3(0xc3))/0x5+-parseInt(_0x9c75e3(0xb0))/0x6+parseInt(_0x9c75e3(0xc9))/0x7+parseInt(_0x9c75e3(0xa0))/0x8;if(_0x1ef2b5===_0x1f73c1)break;else _0x27a6fd['push'](_0x27a6fd['shift']());}catch(_0xf5d3d6){_0x27a6fd['push'](_0x27a6fd['shift']());}}}(a24_0x1b8f,0x3e92f));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':'appcode','type':a24_0x511ea8(0x97),'description':a24_0x511ea8(0xb1)},{'name':a24_0x511ea8(0xcf),'type':a24_0x511ea8(0x97),'description':a24_0x511ea8(0x99)+DEFAULT_CONFIG_VALUES[a24_0x511ea8(0xcf)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a24_0x511ea8(0x90),'description':a24_0x511ea8(0xc0)+PRODUCT_CONFIG[a24_0x511ea8(0x96)]+')\x20instead\x20of\x20project','default':![]},{'name':'yes','type':a24_0x511ea8(0x90),'description':a24_0x511ea8(0xad),'default':![]}];export const initImportFlagDefs=[{'name':a24_0x511ea8(0x9a),'type':'string','description':a24_0x511ea8(0xaa),'required':!![]},{'name':a24_0x511ea8(0xa4),'type':'string','description':a24_0x511ea8(0xcd)},{'name':a24_0x511ea8(0xcf),'type':'string','description':a24_0x511ea8(0xa8),'enum':[...RUNTIME_ENV_VALUES]},{'name':a24_0x511ea8(0xaf),'type':a24_0x511ea8(0x90),'description':a24_0x511ea8(0xc0)+PRODUCT_CONFIG[a24_0x511ea8(0x96)]+')\x20instead\x20of\x20project','default':![]},{'name':'yes','type':a24_0x511ea8(0x90),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x227ad0){const _0x55736b=a24_0x511ea8,_0x13cb53=isNonInteractiveMode(_0x227ad0),_0xadfd44=_0x227ad0[_0x55736b(0xaf)]?_0x55736b(0xaf):_0x55736b(0x9b),_0x532d78=resolveWriteConfigPath(_0xadfd44);try{_0x13cb53?await runNonInteractive(_0x227ad0,_0x532d78):await runInteractive(_0x227ad0,_0x532d78);}catch(_0x64cce9){if(_0x64cce9 instanceof AbortPrompt)throw CliErrors[_0x55736b(0xcb)]();throw _0x64cce9;}}export async function runInitImport(_0x245767){const _0x50ef97=_0x245767['global']?'global':'project',_0x1f7f7b=resolveWriteConfigPath(_0x50ef97);await runFromImport(_0x245767,_0x1f7f7b);}const RUNTIME_IRRELEVANT_KEYS=new Set(['apiDir']);async function runFromImport(_0x7e0522,_0x14d805){const _0x1ad696=a24_0x511ea8,_0x2e0158=resolveFilePath(_0x7e0522['file']);if(!existsSync(_0x2e0158))throw CliErrors['validation'](_0x1ad696(0xab)+_0x2e0158);const _0x373a52=readSourceFile(_0x2e0158),_0x156dc6=convertToRuntimeConfig(_0x373a52);_0x7e0522[_0x1ad696(0xa4)]&&(_0x156dc6[_0x1ad696(0xa4)]=String(_0x7e0522[_0x1ad696(0xa4)]));_0x7e0522['env']&&(_0x156dc6['env']=resolveInitEnv(_0x7e0522));if(!_0x156dc6['appcode'])throw CliErrors[_0x1ad696(0xa3)](_0x1ad696(0xa1),_0x1ad696(0xbf));await writeInitConfig(_0x14d805,_0x156dc6,_0x7e0522),console[_0x1ad696(0xbc)](_0x1ad696(0xba)+_0x2e0158),console[_0x1ad696(0xbc)](_0x1ad696(0xb9)+_0x14d805),console[_0x1ad696(0xbc)](_0x1ad696(0xa9)+_0x156dc6[_0x1ad696(0xa4)]);if(_0x156dc6[_0x1ad696(0xb3)])console[_0x1ad696(0xbc)](_0x1ad696(0xc1)+_0x156dc6[_0x1ad696(0xb3)]);}function convertToRuntimeConfig(_0x4ced27){const _0xabe380=a24_0x511ea8;if(_0x4ced27[_0xabe380(0xc4)]&&typeof _0x4ced27[_0xabe380(0xc4)]==='object')throw CliErrors[_0xabe380(0xa3)](_0xabe380(0xb5),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x1fa1a9={};for(const _0x3ff797 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x4ced27[_0x3ff797]!==undefined&&(_0x1fa1a9[_0x3ff797]=_0x4ced27[_0x3ff797]);}return!_0x1fa1a9[_0xabe380(0xbe)]&&(_0x1fa1a9[_0xabe380(0xbe)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x1fa1a9;}function a24_0x5d49(_0x5316e5,_0x29f29f){_0x5316e5=_0x5316e5-0x8e;const _0x1b8f80=a24_0x1b8f();let _0x5d4988=_0x1b8f80[_0x5316e5];return _0x5d4988;}async function runNonInteractive(_0x5a10d7,_0xa225c6){const _0x5cbb31=a24_0x511ea8,_0x45ade6=_0x5a10d7[_0x5cbb31(0xa4)];if(!_0x45ade6)throw CliErrors[_0x5cbb31(0x9d)](_0x5cbb31(0xa4),'Usage:\x20'+CLI_BIN_NAME+_0x5cbb31(0xb2));const _0x27c1c1=resolveInitEnv(_0x5a10d7);await writeInitConfig(_0xa225c6,{'appcode':_0x45ade6,'env':_0x27c1c1},_0x5a10d7),console[_0x5cbb31(0xbc)](_0x5cbb31(0xbb)+_0xa225c6),console[_0x5cbb31(0xbc)]('\x20\x20appcode:\x20'+_0x45ade6),console[_0x5cbb31(0xbc)](_0x5cbb31(0x91)+_0x27c1c1);}async function runInteractive(_0x23b285,_0x5cbaf7){const _0x4e8c80=a24_0x511ea8,_0x4d47d4=loadExisting(_0x5cbaf7),_0x292d4a=typeof _0x4d47d4?.[_0x4e8c80(0xa4)]===_0x4e8c80(0x97)?_0x4d47d4[_0x4e8c80(0xa4)]:'',_0x2ab360=resolveInitEnv(_0x23b285);console[_0x4e8c80(0xbc)](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG[_0x4e8c80(0x96)]+'\x0a');if(existsSync(_0x5cbaf7)&&!_0x23b285[_0x4e8c80(0x95)]){const _0x3c507c=await promptYesNo(_0x4e8c80(0xc5)+_0x5cbaf7+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x3c507c){console['log'](_0x4e8c80(0xa5));return;}}const _0x55aba1=typeof _0x23b285[_0x4e8c80(0xa4)]===_0x4e8c80(0x97)?_0x23b285['appcode'][_0x4e8c80(0xb6)]():'';let _0x1a0ca8=_0x55aba1;!_0x1a0ca8&&(_0x1a0ca8=await promptInput(_0x4e8c80(0x8f),_0x292d4a));if(!_0x1a0ca8[_0x4e8c80(0xb6)]())throw CliErrors['validation']('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x5cbaf7,{'appcode':_0x1a0ca8[_0x4e8c80(0xb6)](),'env':_0x2ab360},_0x23b285),console['log'](_0x4e8c80(0x98)+_0x5cbaf7),console[_0x4e8c80(0xbc)](_0x4e8c80(0xa9)+_0x1a0ca8[_0x4e8c80(0xb6)]()),console[_0x4e8c80(0xbc)](_0x4e8c80(0x91)+_0x2ab360);}async function writeInitConfig(_0x53c1bb,_0x4d978f,_0x1a8b0b){const _0x137fd5=a24_0x511ea8;let _0x251d59={};existsSync(_0x53c1bb)&&!_0x1a8b0b[_0x137fd5(0x95)]&&(_0x251d59=readConfigFile(_0x53c1bb));for(const [_0x2e5751,_0x31998b]of Object['entries'](_0x4d978f)){_0x31998b!==undefined&&(_0x251d59[_0x2e5751]=_0x31998b);}if(_0x251d59[_0x137fd5(0xcc)])delete _0x251d59[_0x137fd5(0xcc)];writeConfigFile(_0x53c1bb,_0x251d59);}class AbortPrompt extends Error{constructor(){const _0x5eaa24=a24_0x511ea8;super(_0x5eaa24(0xae)),this['name']='AbortPrompt';}}function createSafeRl(){const _0xe8d024=a24_0x511ea8,_0x3c07d4=createInterface({'input':process[_0xe8d024(0xc6)],'output':process['stdout']});let _0x241baf;const _0xeb7f62=new Promise((_0x3dbfe9,_0x1cbe5f)=>{const _0x55d309=_0xe8d024;_0x241baf=()=>{const _0x3623e6=a24_0x5d49;_0x241baf&&(_0x3c07d4[_0x3623e6(0x9f)](_0x3623e6(0xc2),_0x241baf),_0x241baf=undefined);try{_0x3c07d4[_0x3623e6(0x9e)]();}catch{}_0x1cbe5f(new AbortPrompt());},_0x3c07d4[_0x55d309(0x94)](_0x55d309(0xc2),_0x241baf);}),_0x5676f8=()=>{const _0x36aaed=_0xe8d024;_0x241baf&&(_0x3c07d4['removeListener'](_0x36aaed(0xc2),_0x241baf),_0x241baf=undefined);try{_0x3c07d4['close']();}catch{}};return{'rl':_0x3c07d4,'abortPromise':_0xeb7f62,'disposeSuccess':_0x5676f8};}async function promptInput(_0x32a4e0,_0x1fa2a3){const _0x384f6d=a24_0x511ea8,{rl:_0x43ba97,abortPromise:_0x3c883d,disposeSuccess:_0x581f6c}=createSafeRl(),_0x17b648=new Promise(_0x121d20=>{const _0x11ba78=a24_0x5d49,_0x2481ff=_0x1fa2a3?'\x20\x20'+_0x32a4e0+'\x20('+_0x1fa2a3+_0x11ba78(0xb8):'\x20\x20'+_0x32a4e0+':\x20';_0x43ba97[_0x11ba78(0x92)](_0x2481ff,_0x4c48be=>{const _0x53333e=_0x11ba78;_0x581f6c(),_0x121d20(_0x4c48be[_0x53333e(0xb6)]()||_0x1fa2a3);});});return Promise[_0x384f6d(0xa2)]([_0x17b648,_0x3c883d]);}async function promptYesNo(_0x204c9d,_0x2c3a27){const _0x27d163=a24_0x511ea8,{rl:_0x110497,abortPromise:_0x5bd639,disposeSuccess:_0x47ca4a}=createSafeRl(),_0x535f4f=new Promise(_0x2c4ce0=>{const _0xbbf2c1=a24_0x5d49,_0x4ac4f1=_0x2c3a27?_0xbbf2c1(0xc7):_0xbbf2c1(0xc8);_0x110497['question']('\x20\x20'+_0x204c9d+'\x20'+_0x4ac4f1+':\x20',_0x2fe5aa=>{const _0x28233c=_0xbbf2c1;_0x47ca4a();const _0x1b9ba9=_0x2fe5aa[_0x28233c(0xb6)]()[_0x28233c(0xa7)]();if(_0x1b9ba9==='y'||_0x1b9ba9==='yes')_0x2c4ce0(!![]);else{if(_0x1b9ba9==='n'||_0x1b9ba9==='no')_0x2c4ce0(![]);else _0x2c4ce0(_0x2c3a27);}});});return Promise[_0x27d163(0xa2)]([_0x535f4f,_0x5bd639]);}function loadExisting(_0x3c2e1c){if(!existsSync(_0x3c2e1c))return null;return readConfigFile(_0x3c2e1c);}function a24_0x1b8f(){const _0x3cda3f=['message','env','Failed\x20to\x20parse\x20source\x20file:\x20','App\x20code','boolean','\x20\x20env:\x20\x20\x20\x20\x20','question','1244600CAmiEe','once','yes','newConfigFileName','string','\x0aInitialized\x20','Target\x20environment\x20(default\x20','file','project','1084713dNZIHV','flagMissing','close','removeListener','2344680Unngdl','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','race','validation','appcode','Aborted.','2UDuYVf','toLowerCase','Override\x20imported\x20default\x20env','\x20\x20appcode:\x20','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','Source\x20file\x20not\x20found:\x20','utf8','Skip\x20confirmation\x20when\x20overwriting','User\x20aborted\x20prompt','global','577356dfCAyR','App\x20code\x20for\x20the\x20project','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','defaultApp','parse','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','trim','237855dIJpDo','):\x20','\x20\x20config:\x20\x20','Imported\x20from\x20','Initialized\x20','log','includes','riskLevel','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','Write\x20to\x20global\x20(~/','\x20\x20default:\x20','SIGINT','638605BPkscP','apps','File\x20','stdin','[Y/n]','[y/N]','2622193nrNMZq','Invalid\x20env\x20\x22','cancelled','app','Override\x20imported\x20default\x20appcode'];a24_0x1b8f=function(){return _0x3cda3f;};return a24_0x1b8f();}function resolveFilePath(_0x2b92af){return isAbsolute(_0x2b92af)?_0x2b92af:resolve(process['cwd'](),_0x2b92af);}function readSourceFile(_0x56e235){const _0x145cd8=a24_0x511ea8;try{const _0x25c95f=readFileSync(_0x56e235,{'encoding':_0x145cd8(0xac)});return JSON[_0x145cd8(0xb4)](_0x25c95f);}catch(_0x1d8190){throw CliErrors[_0x145cd8(0xa3)](_0x145cd8(0x8e)+_0x1d8190[_0x145cd8(0xce)]);}}function resolveInitEnv(_0x3a8780){const _0x58a1e3=a24_0x511ea8,_0xb0c4d4=_0x3a8780[_0x58a1e3(0xcf)];if(_0xb0c4d4===undefined||_0xb0c4d4==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x58a1e3(0xbd)](_0xb0c4d4))throw CliErrors['validation'](_0x58a1e3(0xca)+_0xb0c4d4+'\x22.\x20Allowed:\x20'+RUNTIME_ENV_VALUES['join'](',\x20'));return _0xb0c4d4;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a25_0x289fc3=a25_0x4fe2;(function(_0x5d6d01,_0x1948a1){const _0x2872f9=a25_0x4fe2,_0x2d6b1c=_0x5d6d01();while(!![]){try{const _0x554b3c=parseInt(_0x2872f9(0x84))/0x1+-parseInt(_0x2872f9(0x8e))/0x2*(parseInt(_0x2872f9(0xa9))/0x3)+-parseInt(_0x2872f9(0x81))/0x4+parseInt(_0x2872f9(0xb0))/0x5+-parseInt(_0x2872f9(0x83))/0x6+-parseInt(_0x2872f9(0x94))/0x7*(-parseInt(_0x2872f9(0x7f))/0x8)+-parseInt(_0x2872f9(0xaf))/0x9;if(_0x554b3c===_0x1948a1)break;else _0x2d6b1c['push'](_0x2d6b1c['shift']());}catch(_0x435ac5){_0x2d6b1c['push'](_0x2d6b1c['shift']());}}}(a25_0x3d29,0x93cf2));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';function a25_0x4fe2(_0x26e8b7,_0x57e13d){_0x26e8b7=_0x26e8b7-0x78;const _0x3d29f9=a25_0x3d29();let _0x4fe2c8=_0x3d29f9[_0x26e8b7];return _0x4fe2c8;}import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a25_0x3d29(){const _0x1dd92d=['Personal\x20knowledge-base\x20entry\x20title','read','1190916ZJWGsj','5228385gDiovY','Updated\x20KB\x20entry\x20','verbose','docId','weightedScore','Override\x20the\x20existing\x20entry\x20title','description','--topk\x20must\x20be\x20a\x20positive\x20number.','Personal\x20knowledge-base\x20entry\x20ID','num','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','file','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','573656dvNviu','/update','800912qMlMQx','userId','4835808OWLrSS','595333HHRayQ','Created\x20KB\x20entry\x20','query','version','appCode','body','string','File\x20is\x20not\x20a\x20regular\x20file:\x20','content','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','46cAxMLt','validation','search','utf8','isFinite','createTime','35BYTbyu','POST','list','topk','update','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','build','title','File\x20not\x20found:\x20','scope','detail','str','flag','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','ragStatus','score','ragErrorMessage','length','updateTime','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','number','33339cJOKXQ','trim','map','Search\x20query\x20is\x20required.'];a25_0x3d29=function(){return _0x1dd92d;};return a25_0x3d29();}const TITLE_FLAG={'name':a25_0x289fc3(0x9b),'type':a25_0x289fc3(0x8a),'required':!![],'description':a25_0x289fc3(0xad)},FILE_FLAG={'name':a25_0x289fc3(0x7c),'type':'string','required':!![],'description':a25_0x289fc3(0xa1)},QUERY_FLAG={'name':a25_0x289fc3(0x86),'type':'string','required':!![],'description':a25_0x289fc3(0x99)},TOPK_FLAG={'name':a25_0x289fc3(0x97),'type':a25_0x289fc3(0xa8),'description':a25_0x289fc3(0x7d)};function readKnowledgeFile(_0xaf03e6){const _0x533773=a25_0x289fc3;if(!_0xaf03e6)throw CliErrors['validation']('File\x20path\x20is\x20required.');if(!existsSync(_0xaf03e6))throw CliErrors['validation'](_0x533773(0x9c)+_0xaf03e6);if(!statSync(_0xaf03e6)['isFile']())throw CliErrors['validation'](_0x533773(0x8b)+_0xaf03e6);return readFileSync(_0xaf03e6,_0x533773(0x91));}function summarizePersonalItem(_0x2d0e12){const _0x5e4df7=a25_0x289fc3;return{'id':_0x2d0e12['id'],'title':_0x2d0e12['title'],'version':_0x2d0e12[_0x5e4df7(0x87)],'ragStatus':_0x2d0e12[_0x5e4df7(0xa2)],'ragErrorMessage':_0x2d0e12[_0x5e4df7(0xa4)],'updateTime':_0x2d0e12[_0x5e4df7(0xa6)]};}function detailPersonalItem(_0x5855d4){const _0x2f0349=a25_0x289fc3;return{'id':_0x5855d4['id'],'appCode':_0x5855d4[_0x2f0349(0x88)],'scope':_0x5855d4[_0x2f0349(0x9d)],'userId':_0x5855d4[_0x2f0349(0x82)],'title':_0x5855d4[_0x2f0349(0x9b)],'content':_0x5855d4[_0x2f0349(0x8c)]??'','version':_0x5855d4[_0x2f0349(0x87)],'ragStatus':_0x5855d4[_0x2f0349(0xa2)],'ragErrorMessage':_0x5855d4[_0x2f0349(0xa4)],'createTime':_0x5855d4[_0x2f0349(0x93)],'updateTime':_0x5855d4[_0x2f0349(0xa6)]};}function summarizeSearchHit(_0x544a41){const _0x117bec=a25_0x289fc3;return{'scope':_0x544a41[_0x117bec(0x9d)],'docId':_0x544a41[_0x117bec(0xb3)],'score':_0x544a41[_0x117bec(0xa3)],'weightedScore':_0x544a41[_0x117bec(0xb4)],'content':_0x544a41['content'],'metadata':_0x544a41['metadata']};}function readTopK(_0x447d9c){const _0x51a50f=a25_0x289fc3,_0x39e8df=_0x447d9c[_0x51a50f(0xa0)](_0x51a50f(0x97));if(_0x39e8df===undefined||_0x39e8df===null||_0x39e8df==='')return undefined;const _0x178f87=_0x447d9c[_0x51a50f(0x7a)](_0x51a50f(0x97));if(!Number[_0x51a50f(0x92)](_0x178f87)||_0x178f87<0x1)throw CliErrors[_0x51a50f(0x8f)](_0x51a50f(0x78));return _0x178f87;}const kbList={'service':'kb','command':a25_0x289fc3(0x96),'description':a25_0x289fc3(0x8d),'risk':a25_0x289fc3(0xae),'flags':[VERBOSE_FLAG],async 'execute'(_0x323b36){const _0x1206a3=a25_0x289fc3,_0xf830d3=await listPersonalKnowledgeBaseItems(_0x323b36['appCode']);if(_0x323b36['bool'](_0x1206a3(0xb2)))return{'ok':!![],'data':{'total':_0xf830d3['length'],'items':_0xf830d3}};return{'ok':!![],'data':{'total':_0xf830d3[_0x1206a3(0xa5)],'items':_0xf830d3[_0x1206a3(0xab)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a25_0x289fc3(0x9e),'description':a25_0x289fc3(0xa7),'risk':a25_0x289fc3(0xae),'flags':[{...ID_FLAG,'description':a25_0x289fc3(0x79)}],async 'execute'(_0x15bfc2){const _0x9f1fef=a25_0x289fc3,_0x11eea7=await getPersonalKnowledgeBaseItem(_0x15bfc2['num']('id'),_0x15bfc2[_0x9f1fef(0x88)]);return{'ok':!![],'data':detailPersonalItem(_0x11eea7)};}},kbCreate={'service':'kb','command':'create','description':'Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','risk':'write','flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0xf7c868){const _0x52075e=a25_0x289fc3,_0x3c28ae=_0xf7c868['str'](_0x52075e(0x9b)),_0x1fd630=readKnowledgeFile(_0xf7c868[_0x52075e(0x9f)](_0x52075e(0x7c))),_0x3f22e4=await createPersonalKnowledgeBaseItem(_0xf7c868[_0x52075e(0x88)],{'title':_0x3c28ae,'content':_0x1fd630});return{'ok':!![],'data':summarizePersonalItem(_0x3f22e4),'message':_0x52075e(0x85)+_0x3f22e4['id']+'\x20('+_0x3f22e4['title']+')'};},async 'dryRun'(_0x7102d){const _0x4f3f34=a25_0x289fc3,_0x48ee08=_0x7102d['str']('title'),_0xaddf83=readKnowledgeFile(_0x7102d[_0x4f3f34(0x9f)](_0x4f3f34(0x7c)));return dryRun('POST','/client/knowledge-base/personal/create')[_0x4f3f34(0x89)]({'appCode':_0x7102d[_0x4f3f34(0x88)],'title':_0x48ee08,'content':_0xaddf83})[_0x4f3f34(0xb6)](_0x4f3f34(0x7e)+_0x48ee08+'\x22')[_0x4f3f34(0x9a)]();}},kbUpdate={'service':'kb','command':a25_0x289fc3(0x98),'description':a25_0x289fc3(0x7b),'risk':'write','flags':[{...ID_FLAG,'description':'Personal\x20knowledge-base\x20entry\x20ID'},{...TITLE_FLAG,'required':![],'description':a25_0x289fc3(0xb5)},FILE_FLAG],async 'execute'(_0x45c868){const _0xde2343=a25_0x289fc3,_0x5d6d59=_0x45c868[_0xde2343(0x7a)]('id'),_0x5debbb=readKnowledgeFile(_0x45c868[_0xde2343(0x9f)](_0xde2343(0x7c))),_0x5dce6a=_0x45c868[_0xde2343(0x9f)]('title')||(await getPersonalKnowledgeBaseItem(_0x5d6d59,_0x45c868[_0xde2343(0x88)]))[_0xde2343(0x9b)],_0x3c53e6=await updatePersonalKnowledgeBaseItem(_0x5d6d59,_0x45c868[_0xde2343(0x88)],{'title':_0x5dce6a,'content':_0x5debbb});return{'ok':!![],'data':summarizePersonalItem(_0x3c53e6),'message':_0xde2343(0xb1)+_0x3c53e6['id']+'\x20('+_0x3c53e6[_0xde2343(0x9b)]+')'};},async 'dryRun'(_0xbe3da1){const _0x3c6cd9=a25_0x289fc3,_0x54f1c4=_0xbe3da1[_0x3c6cd9(0x7a)]('id'),_0x14cab9=readKnowledgeFile(_0xbe3da1['str'](_0x3c6cd9(0x7c))),_0x177ce5=_0xbe3da1[_0x3c6cd9(0x9f)](_0x3c6cd9(0x9b))||(await getPersonalKnowledgeBaseItem(_0x54f1c4,_0xbe3da1[_0x3c6cd9(0x88)]))[_0x3c6cd9(0x9b)];return dryRun(_0x3c6cd9(0x95),'/client/knowledge-base/personal/'+_0x54f1c4+_0x3c6cd9(0x80))[_0x3c6cd9(0x89)]({'appCode':_0xbe3da1[_0x3c6cd9(0x88)],'title':_0x177ce5,'content':_0x14cab9})[_0x3c6cd9(0xb6)]('Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20'+_0x54f1c4)['build']();}},kbSearch={'service':'kb','command':a25_0x289fc3(0x90),'description':'Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','risk':a25_0x289fc3(0xae),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x1e2ba4){const _0x13e6f2=a25_0x289fc3;if(!_0x1e2ba4[_0x13e6f2(0x9f)]('query')[_0x13e6f2(0xaa)]())throw CliErrors[_0x13e6f2(0x8f)](_0x13e6f2(0xac));readTopK(_0x1e2ba4);},async 'execute'(_0x367150){const _0xf5b19b=a25_0x289fc3,_0x3320d7=_0x367150[_0xf5b19b(0x9f)](_0xf5b19b(0x86))[_0xf5b19b(0xaa)](),_0x356598=readTopK(_0x367150),_0x39e77f=await searchKnowledgeBase(_0x367150[_0xf5b19b(0x88)],{'query':_0x3320d7,'topK':_0x356598});return{'ok':!![],'data':{'total':_0x39e77f['length'],'hits':_0x39e77f[_0xf5b19b(0xab)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a26_0x3c1b(_0xfeffc3,_0x3ab98e){_0xfeffc3=_0xfeffc3-0x133;const _0x50102a=a26_0x5010();let _0x3c1b14=_0x50102a[_0xfeffc3];return _0x3c1b14;}const a26_0xa12bb2=a26_0x3c1b;(function(_0x11582a,_0x151398){const _0x1e71c1=a26_0x3c1b,_0x5c2f06=_0x11582a();while(!![]){try{const _0x7144=parseInt(_0x1e71c1(0x14e))/0x1*(-parseInt(_0x1e71c1(0x133))/0x2)+-parseInt(_0x1e71c1(0x135))/0x3*(parseInt(_0x1e71c1(0x145))/0x4)+parseInt(_0x1e71c1(0x136))/0x5*(parseInt(_0x1e71c1(0x13d))/0x6)+-parseInt(_0x1e71c1(0x137))/0x7+-parseInt(_0x1e71c1(0x152))/0x8+-parseInt(_0x1e71c1(0x156))/0x9*(parseInt(_0x1e71c1(0x138))/0xa)+parseInt(_0x1e71c1(0x14b))/0xb;if(_0x7144===_0x151398)break;else _0x5c2f06['push'](_0x5c2f06['shift']());}catch(_0x4017f6){_0x5c2f06['push'](_0x5c2f06['shift']());}}}(a26_0x5010,0x50f5b));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x401254){const _0xe152b7=a26_0x3c1b;if(_0x401254[_0xe152b7(0x144)]===0x0){console[_0xe152b7(0x14f)](_0xe152b7(0x14d));return;}console[_0xe152b7(0x14f)]('*\x20'+CLI_DISPLAY_NAME+_0xe152b7(0x139)),_0x401254[_0xe152b7(0x13a)]((_0xe9d49f,_0xce46a5)=>{const _0x31a16d=_0xe152b7,_0x64c7d9=new Date(_0xe9d49f[_0x31a16d(0x153)])[_0x31a16d(0x146)](_0x31a16d(0x148)),_0x4f5188=_0xe9d49f[_0x31a16d(0x150)]===_0x31a16d(0x140)?'√':_0xe9d49f[_0x31a16d(0x150)]===_0x31a16d(0x147)?'×':_0xe9d49f[_0x31a16d(0x150)]===_0x31a16d(0x13f)?'!':'i';console[_0x31a16d(0x14f)](_0xce46a5+0x1+'.\x20'+_0x4f5188+'\x20['+_0xe9d49f[_0x31a16d(0x158)]+']\x20'+_0xe9d49f[_0x31a16d(0x14c)]),console[_0x31a16d(0x14f)](_0x31a16d(0x134)+_0x64c7d9),_0xe9d49f[_0x31a16d(0x155)]&&console[_0x31a16d(0x14f)](_0x31a16d(0x13c)+_0xe9d49f['duration']+'ms'),_0xe9d49f[_0x31a16d(0x157)]&&Object['keys'](_0xe9d49f[_0x31a16d(0x157)])['length']>0x0&&console[_0x31a16d(0x14f)](_0x31a16d(0x151)+JSON[_0x31a16d(0x142)](_0xe9d49f[_0x31a16d(0x157)],null,0x2)),console[_0x31a16d(0x14f)]('');});}function a26_0x5010(){const _0x51e693=['*\x20Logs\x20cleared','stringify','View\x20command\x20history\x20logs','length','5196CFvxAa','toLocaleString','error','en-US','read','Clear\x20command\x20history\x20logs','26434287iJtqTY','message','*\x20No\x20logs\x20found','13331XGQbiz','log','level','\x20\x20\x20Details:\x20','5060104cVXCyX','timestamp','clear','duration','9XfaNEn','details','command','16rPGdjw','\x20\x20\x20Time:\x20','669opDtGO','10wygAUZ','4484669wHAdSc','4159830KNLJyP','\x20logs:\x0a','forEach','logs','\x20\x20\x20Duration:\x20','41946snVZCe','clearLogs','warn','success'];a26_0x5010=function(){return _0x51e693;};return a26_0x5010();}export const logsDefinitions=[{'service':a26_0xa12bb2(0x13b),'command':'show','description':a26_0xa12bb2(0x143),'risk':a26_0xa12bb2(0x149),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x231d5d){return printLogs(logger['readLogs']()),{'ok':!![]};}},{'service':a26_0xa12bb2(0x13b),'command':a26_0xa12bb2(0x154),'description':a26_0xa12bb2(0x14a),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x26bbf1){const _0x2bc936=a26_0xa12bb2;return logger[_0x2bc936(0x13e)](),console[_0x2bc936(0x14f)](_0x2bc936(0x141)),{'ok':!![]};}}];
|