@lovrabet/lovrabet-cli 2.0.14-beta.6 → 2.0.14-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -0
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1dd9d5,_0x42e8f4){const _0x1431ca=a15_0x54bd,_0x3eac4e=_0x1dd9d5();while(!![]){try{const _0x298913=-parseInt(_0x1431ca(0xa4))/0x1+-parseInt(_0x1431ca(0x9f))/0x2*(parseInt(_0x1431ca(0x94))/0x3)+-parseInt(_0x1431ca(0xa1))/0x4+parseInt(_0x1431ca(0xa8))/0x5+-parseInt(_0x1431ca(0x95))/0x6*(-parseInt(_0x1431ca(0x92))/0x7)+parseInt(_0x1431ca(0xa7))/0x8+parseInt(_0x1431ca(0x99))/0x9;if(_0x298913===_0x42e8f4)break;else _0x3eac4e['push'](_0x3eac4e['shift']());}catch(_0x2643fc){_0x3eac4e['push'](_0x3eac4e['shift']());}}}(a15_0x52e8,0x1c2c1));function a15_0x54bd(_0xcdbf,_0x25fc21){_0xcdbf=_0xcdbf-0x91;const _0x52e817=a15_0x52e8();let _0x54bd37=_0x52e817[_0xcdbf];return _0x54bd37;}import{CliErrors}from'../../errors.js';function isSet(_0x45631f,_0x45fd97){const _0x314061=a15_0x54bd,_0x4e8d53=_0x45631f[_0x314061(0xa5)](_0x45fd97);return _0x4e8d53!==undefined&&_0x4e8d53!==''&&_0x4e8d53!==![]&&_0x4e8d53!==0x0;}function a15_0x52e8(){const _0x3c01ec=['800308XbIjlh','length','Provide\x20one\x20of:\x20','33458MhkGJV','flag','Exactly\x20one\x20of\x20','682416nsdmUV','194195LcPNmP','\x20are\x20mutually\x20exclusive\x20for\x20`','some','1098713ThjqkW','Flags\x20','159SekNzg','6BGWTeY','map','str','Invalid\x20--','2222712AeZsvG','filter','join','Only\x20one\x20of\x20','At\x20least\x20one\x20of\x20','validation','6760IIljMT',':\x20expected\x20'];a15_0x52e8=function(){return _0x3c01ec;};return a15_0x52e8();}function fmtNames(_0xfe9aa8){const _0x3f8321=a15_0x54bd;return _0xfe9aa8[_0x3f8321(0x96)](_0x53a3bb=>'--'+_0x53a3bb)[_0x3f8321(0x9b)](',\x20');}export function requireOneOf(_0x51efd1,_0x55d58d,_0x31f711){const _0x13d77c=a15_0x54bd,_0x37e50f=_0x55d58d[_0x13d77c(0x9a)](_0x148b4a=>isSet(_0x51efd1,_0x148b4a));if(_0x37e50f[_0x13d77c(0xa2)]!==0x1)throw CliErrors[_0x13d77c(0x9e)](_0x37e50f[_0x13d77c(0xa2)]===0x0?_0x13d77c(0xa6)+fmtNames(_0x55d58d)+'\x20is\x20required\x20for\x20`'+_0x31f711+'`.':_0x13d77c(0x9c)+fmtNames(_0x55d58d)+'\x20is\x20allowed,\x20found:\x20'+fmtNames(_0x37e50f)+'.',_0x37e50f[_0x13d77c(0xa2)]===0x0?_0x13d77c(0xa3)+fmtNames(_0x55d58d):'Remove\x20all\x20but\x20one.');}export function requireAnyOf(_0x478b32,_0x509c22,_0x4c9318){const _0x1e5d3e=a15_0x54bd;if(!_0x509c22[_0x1e5d3e(0x91)](_0x285de4=>isSet(_0x478b32,_0x285de4)))throw CliErrors['validation'](_0x1e5d3e(0x9d)+fmtNames(_0x509c22)+'\x20is\x20required\x20for\x20`'+_0x4c9318+'`.',_0x1e5d3e(0xa3)+fmtNames(_0x509c22));}export function mutuallyExclusive(_0x314ac6,_0x36f248,_0x24aa58){const _0xeff68a=a15_0x54bd,_0x2b37f8=_0x36f248[_0xeff68a(0x9a)](_0x290772=>isSet(_0x314ac6,_0x290772));if(_0x2b37f8[_0xeff68a(0xa2)]>0x1)throw CliErrors[_0xeff68a(0x9e)](_0xeff68a(0x93)+fmtNames(_0x2b37f8)+_0xeff68a(0xa9)+_0x24aa58+'`.','Use\x20only\x20one\x20of:\x20'+fmtNames(_0x36f248));}export function validatePattern(_0x4d6e49,_0xd78015,_0x1d3488,_0x26835c){const _0x380d3f=a15_0x54bd,_0x17ea4c=_0x4d6e49[_0x380d3f(0x97)](_0xd78015);if(_0x17ea4c&&!_0x1d3488['test'](_0x17ea4c))throw CliErrors[_0x380d3f(0x9e)](_0x380d3f(0x98)+_0xd78015+_0x380d3f(0xa0)+_0x26835c+',\x20got\x20\x22'+_0x17ea4c+'\x22.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a16_0x5b0b15=a16_0x489d;(function(_0x1fb540,_0x173ce7){const _0x254bdb=a16_0x489d,_0x2d0e1b=_0x1fb540();while(!![]){try{const _0x205c95=parseInt(_0x254bdb(0x185))/0x1*(-parseInt(_0x254bdb(0x17e))/0x2)+parseInt(_0x254bdb(0x18c))/0x3*(parseInt(_0x254bdb(0x193))/0x4)+-parseInt(_0x254bdb(0x181))/0x5+parseInt(_0x254bdb(0x183))/0x6*(-parseInt(_0x254bdb(0x17c))/0x7)+parseInt(_0x254bdb(0x18a))/0x8+-parseInt(_0x254bdb(0x17d))/0x9+-parseInt(_0x254bdb(0x191))/0xa*(-parseInt(_0x254bdb(0x188))/0xb);if(_0x205c95===_0x173ce7)break;else _0x2d0e1b['push'](_0x2d0e1b['shift']());}catch(_0x5a68c2){_0x2d0e1b['push'](_0x2d0e1b['shift']());}}}(a16_0x33fe,0x2d794));function a16_0x489d(_0x2bc579,_0x55295f){_0x2bc579=_0x2bc579-0x17b;const _0x33feac=a16_0x33fe();let _0x489d3e=_0x33feac[_0x2bc579];return _0x489d3e;}export const CODE_FLAG={'name':a16_0x5b0b15(0x194),'type':a16_0x5b0b15(0x192),'required':!![],'description':a16_0x5b0b15(0x18d),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a16_0x5b0b15(0x186)}};export const SQLCODE_FLAG={'name':a16_0x5b0b15(0x182),'type':'string','required':!![],'description':a16_0x5b0b15(0x190),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a16_0x5b0b15(0x184)}};export const VERBOSE_FLAG={'name':a16_0x5b0b15(0x18f),'type':a16_0x5b0b15(0x180),'description':a16_0x5b0b15(0x17f)};export const PARAMS_FLAG={'name':a16_0x5b0b15(0x187),'type':a16_0x5b0b15(0x192),'description':a16_0x5b0b15(0x18e)};export const NAME_FLAG={'name':a16_0x5b0b15(0x17b),'type':'string','description':'Resource\x20name\x20for\x20lookup'};function a16_0x33fe(){const _0x5a339b=['4420zKtNqJ','Return\x20full\x20raw\x20response\x20object','boolean','503220FLiqFU','sqlcode','2154qHUUHa','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','16Qiplqh','a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)','params','2497099oZhqYg','Resource\x20ID','1886224LaEtCo','number','3pPSdpN','Dataset\x20code\x20(32-char\x20hex\x20UUID)','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','verbose','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','10HRjuip','string','579668OoYMpR','code','name','5033GExWXR','245871JDBEZc'];a16_0x33fe=function(){return _0x5a339b;};return a16_0x33fe();}export const ID_FLAG={'name':'id','type':a16_0x5b0b15(0x18b),'required':!![],'description':a16_0x5b0b15(0x189)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a17_0x74b8ae=a17_0x2b75;(function(_0x5ca408,_0x4f9f1d){const _0x514c70=a17_0x2b75,_0x4f8db8=_0x5ca408();while(!![]){try{const _0x3f7f26=parseInt(_0x514c70(0x143))/0x1+parseInt(_0x514c70(0x113))/0x2+parseInt(_0x514c70(0x105))/0x3+-parseInt(_0x514c70(0x10f))/0x4*(parseInt(_0x514c70(0x10b))/0x5)+parseInt(_0x514c70(0x107))/0x6*(parseInt(_0x514c70(0x108))/0x7)+-parseInt(_0x514c70(0x11f))/0x8+-parseInt(_0x514c70(0x10a))/0x9*(parseInt(_0x514c70(0x132))/0xa);if(_0x3f7f26===_0x4f9f1d)break;else _0x4f8db8['push'](_0x4f8db8['shift']());}catch(_0x5697cd){_0x4f8db8['push'](_0x4f8db8['shift']());}}}(a17_0x11f3,0x3bf07));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':a17_0x74b8ae(0x110),'type':a17_0x74b8ae(0x11e),'description':'Write\x20to\x20global\x20config','default':![]};function parseAliasAppcodeSetKey(_0x56fe3c){const _0x1ca060=a17_0x74b8ae,_0x103c04=_0x56fe3c[_0x1ca060(0x109)]('.');if(_0x103c04[_0x1ca060(0x10c)]!==0x3||_0x103c04[0x0]!==_0x1ca060(0x147)||_0x103c04[0x2]!==_0x1ca060(0x11c))return undefined;const _0x43b3ed=_0x103c04[0x1]?.[_0x1ca060(0x13d)]();return _0x43b3ed?_0x43b3ed:undefined;}function parseAliasDeleteKey(_0x6f09f2){const _0x120523=a17_0x74b8ae,_0x5743ac=_0x6f09f2['split']('.');if(_0x5743ac[_0x120523(0x10c)]===0x2&&_0x5743ac[0x0]===_0x120523(0x147)){const _0x4a2e6a=_0x5743ac[0x1]?.[_0x120523(0x13d)]();return _0x4a2e6a?{'alias':_0x4a2e6a}:undefined;}if(_0x5743ac['length']===0x3&&_0x5743ac[0x0]==='apps'&&_0x5743ac[0x2]===_0x120523(0x11c)){const _0x2fb16b=_0x5743ac[0x1]?.['trim']();return _0x2fb16b?{'alias':_0x2fb16b,'field':_0x120523(0x11c)}:undefined;}return undefined;}function a17_0x11f3(){const _0x1dd46b=['\x20\x20project:\x20','81804QrvKVF','7CftZvT','split','9BPhOlK','275290iRSYIT','length','pretty','\x22\x20is\x20not\x20settable.','12khtVFu','global','\x20(global)','value','512266VbDXSP','Value\x20to\x20assign','Usage:\x20','format','project-or-global-explicit','\x20config\x20get\x20<key>','Settable\x20keys:\x20','bool','Config\x20files:\x0a','appcode','(none)','boolean','253136EOzAws','key','validation','Key\x20not\x20found:\x20','list','\x20config\x20set\x20<key>\x20<value>\x20[--global]','delete','isArray','Deleted\x20`','pageSize','includes','Missing\x20key\x20or\x20value.','raw','Key\x20\x22','../../context.js','read','\x22.\x20Allowed:\x20','config','alias','2967150rJEKsZ','object','Get\x20a\x20config\x20value','stringify','join','riskLevel','write','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','log','args','field','trim','Set\x20`',';\x20apps.<alias>.appcode','Invalid\x20value\x20for\x20\x22','Missing\x20key\x20argument.','Set\x20a\x20config\x20value','192525rYodwv','Top-level\x20key\x20\x22','pageSize\x20must\x20be\x20a\x20positive\x20number','\x20\x20global:\x20\x20','apps','830250IFfWEi'];a17_0x11f3=function(){return _0x1dd46b;};return a17_0x11f3();}function setLocalAppAlias(_0xba2ff9,_0x26a0d1,_0x21cbc9){const _0xc5031b=a17_0x74b8ae,_0x42be99=_0xba2ff9[_0xc5031b(0x147)]&&typeof _0xba2ff9[_0xc5031b(0x147)]===_0xc5031b(0x133)&&!Array[_0xc5031b(0x126)](_0xba2ff9[_0xc5031b(0x147)])?_0xba2ff9[_0xc5031b(0x147)]:{},_0x2621c6=_0x42be99[_0x26a0d1]&&typeof _0x42be99[_0x26a0d1]===_0xc5031b(0x133)&&!Array[_0xc5031b(0x126)](_0x42be99[_0x26a0d1])?_0x42be99[_0x26a0d1]:{};_0x2621c6[_0xc5031b(0x11c)]=_0x21cbc9,_0x42be99[_0x26a0d1]=_0x2621c6,_0xba2ff9[_0xc5031b(0x147)]=_0x42be99;}function deleteLocalAppAlias(_0x57af35,_0xb329df){const _0x10e75f=a17_0x74b8ae;if(!_0x57af35[_0x10e75f(0x147)]||typeof _0x57af35[_0x10e75f(0x147)]!==_0x10e75f(0x133)||Array[_0x10e75f(0x126)](_0x57af35[_0x10e75f(0x147)]))return![];const _0x151d4f=_0x57af35['apps'],_0x4ef910=_0x151d4f[_0xb329df[_0x10e75f(0x131)]];if(!_0x4ef910||typeof _0x4ef910!==_0x10e75f(0x133)||Array[_0x10e75f(0x126)](_0x4ef910))return![];if(!_0xb329df[_0x10e75f(0x13c)])return delete _0x151d4f[_0xb329df[_0x10e75f(0x131)]],!![];if(!(_0xb329df['field']in _0x4ef910))return![];return delete _0x4ef910[_0xb329df[_0x10e75f(0x13c)]],Object['keys'](_0x4ef910)[_0x10e75f(0x10c)]===0x0&&delete _0x151d4f[_0xb329df['alias']],!![];}const listDef={'service':a17_0x74b8ae(0x130),'command':a17_0x74b8ae(0x123),'description':'List\x20current\x20config','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x1b3f93){const _0x4acfd3=a17_0x74b8ae,{buildConfigFromFlags:_0x4b2c2e}=await import(_0x4acfd3(0x12d)),_0x11d993=_0x4b2c2e({}),_0x1b6149=getProjectConfigPath(),_0x5f0b71=resolveWriteConfigPath('global');if(_0x1b3f93[_0x4acfd3(0x116)]===_0x4acfd3(0x10d))return{'ok':!![],'message':'#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a'+(JSON[_0x4acfd3(0x135)](_0x11d993[_0x4acfd3(0x12b)],null,0x2)+'\x0a\x0a')+_0x4acfd3(0x11b)+(_0x4acfd3(0x106)+(_0x1b6149??_0x4acfd3(0x11d))+'\x0a')+(_0x4acfd3(0x146)+_0x5f0b71)};return{'ok':!![],'data':{'effective':_0x11d993[_0x4acfd3(0x12b)],'configFiles':{'project':_0x1b6149??null,'global':_0x5f0b71}}};}},getDef={'service':a17_0x74b8ae(0x130),'command':'get','description':a17_0x74b8ae(0x134),'risk':a17_0x74b8ae(0x12e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a17_0x74b8ae(0x120),'description':'Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','required':!![]}],'flags':[],async 'execute'(_0x1a7ed0){const _0x5146a3=a17_0x74b8ae,_0x9bd2f6=_0x1a7ed0['args'][0x0];if(!_0x9bd2f6)throw CliErrors['validation'](_0x5146a3(0x141),'Usage:\x20'+CLI_BIN_NAME+_0x5146a3(0x118));const {buildConfigFromFlags:_0x53099c}=await import(_0x5146a3(0x12d)),{raw:_0x262f35}=_0x53099c({});if(_0x9bd2f6[_0x5146a3(0x129)]('.')){const _0x18c43e=_0x9bd2f6[_0x5146a3(0x109)]('.');let _0x532534=_0x262f35;for(const _0x17d61a of _0x18c43e){if(_0x532534==null||typeof _0x532534!=='object')throw CliErrors[_0x5146a3(0x121)](_0x5146a3(0x122)+_0x9bd2f6);_0x532534=_0x532534[_0x17d61a];}if(_0x532534===undefined)throw CliErrors['validation'](_0x5146a3(0x122)+_0x9bd2f6);return console[_0x5146a3(0x13a)](typeof _0x532534===_0x5146a3(0x133)?JSON[_0x5146a3(0x135)](_0x532534,null,0x2):String(_0x532534)),{'ok':!![]};}const _0x436c55=_0x262f35[_0x9bd2f6];if(_0x436c55===undefined)throw CliErrors[_0x5146a3(0x121)](_0x5146a3(0x122)+_0x9bd2f6);return console['log'](typeof _0x436c55===_0x5146a3(0x133)?JSON[_0x5146a3(0x135)](_0x436c55,null,0x2):String(_0x436c55)),{'ok':!![]};}},setDef={'service':a17_0x74b8ae(0x130),'command':'set','description':a17_0x74b8ae(0x142),'risk':a17_0x74b8ae(0x138),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]},{'name':a17_0x74b8ae(0x112),'description':a17_0x74b8ae(0x114),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x471184){const _0x4e4787=a17_0x74b8ae,_0x45c4a7=_0x471184[_0x4e4787(0x13b)][0x0],_0x4e7edb=_0x471184[_0x4e4787(0x13b)][0x1];if(!_0x45c4a7||_0x4e7edb===undefined)throw CliErrors[_0x4e4787(0x121)](_0x4e4787(0x12a),_0x4e4787(0x115)+CLI_BIN_NAME+_0x4e4787(0x124));if(ENUM_KEYS[_0x45c4a7]&&!ENUM_KEYS[_0x45c4a7][_0x4e4787(0x129)](_0x4e7edb))throw CliErrors['validation'](_0x4e4787(0x140)+_0x45c4a7+_0x4e4787(0x12f)+ENUM_KEYS[_0x45c4a7][_0x4e4787(0x136)](',\x20'));if(_0x45c4a7===_0x4e4787(0x137))throw CliErrors[_0x4e4787(0x121)](_0x4e4787(0x139));if(_0x45c4a7===_0x4e4787(0x128)){const _0x32ae30=Number(_0x4e7edb);if(isNaN(_0x32ae30)||_0x32ae30<=0x0)throw CliErrors[_0x4e4787(0x121)](_0x4e4787(0x145));}const _0x195143=resolveWriteScope({'explicitGlobal':_0x471184[_0x4e4787(0x11a)](_0x4e4787(0x110)),'policy':_0x4e4787(0x117)}),_0x534c20=toScopeFlags(_0x195143),_0x4571eb=readScopedConfig(_0x534c20),_0x49adbb=parseAliasAppcodeSetKey(_0x45c4a7);if(!_0x49adbb&&!isTopLevelConfigKey(_0x45c4a7))throw CliErrors[_0x4e4787(0x121)](_0x4e4787(0x144)+_0x45c4a7+_0x4e4787(0x10e),_0x4e4787(0x119)+getTopLevelConfigKeySummary()+_0x4e4787(0x13f));return _0x49adbb?setLocalAppAlias(_0x4571eb,_0x49adbb,_0x4e7edb):_0x4571eb[_0x45c4a7]=_0x45c4a7===_0x4e4787(0x128)?Number(_0x4e7edb):_0x4e7edb,console[_0x4e4787(0x13a)](_0x4e4787(0x13e)+_0x45c4a7+'`\x20=\x20\x22'+_0x4e7edb+'\x22'+(_0x195143==='global'?'\x20(global)':'')),writeScopedConfig(_0x4571eb,_0x534c20),{'ok':!![]};}},deleteDef={'service':a17_0x74b8ae(0x130),'command':a17_0x74b8ae(0x125),'description':'Delete\x20a\x20config\x20value','risk':a17_0x74b8ae(0x138),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0xcf695){const _0x2d94c5=a17_0x74b8ae,_0x2558b6=_0xcf695[_0x2d94c5(0x13b)][0x0];if(!_0x2558b6)throw CliErrors[_0x2d94c5(0x121)]('Missing\x20key\x20argument.','Usage:\x20'+CLI_BIN_NAME+'\x20config\x20delete\x20<key>\x20[--global]');const _0x81efc4=resolveWriteScope({'explicitGlobal':_0xcf695[_0x2d94c5(0x11a)](_0x2d94c5(0x110)),'policy':_0x2d94c5(0x117)}),_0x151fdf=toScopeFlags(_0x81efc4),_0x1968ff=readScopedConfig(_0x151fdf),_0x416cf0=parseAliasDeleteKey(_0x2558b6);if(_0x416cf0){if(!deleteLocalAppAlias(_0x1968ff,_0x416cf0))throw CliErrors[_0x2d94c5(0x121)](_0x2d94c5(0x122)+_0x2558b6);return console[_0x2d94c5(0x13a)](_0x2d94c5(0x127)+_0x2558b6+'`'+(_0x81efc4==='global'?_0x2d94c5(0x111):'')),writeScopedConfig(_0x1968ff,_0x151fdf),{'ok':!![]};}if(_0x1968ff[_0x2558b6]===undefined)throw CliErrors[_0x2d94c5(0x121)](_0x2d94c5(0x12c)+_0x2558b6+'\x22\x20not\x20found\x20at\x20top\x20level.');return delete _0x1968ff[_0x2558b6],console[_0x2d94c5(0x13a)](_0x2d94c5(0x127)+_0x2558b6+'`'+(_0x81efc4===_0x2d94c5(0x110)?_0x2d94c5(0x111):'')),writeScopedConfig(_0x1968ff,_0x151fdf),{'ok':!![]};}};function a17_0x2b75(_0x59a620,_0xce42c5){_0x59a620=_0x59a620-0x105;const _0x11f350=a17_0x11f3();let _0x2b754d=_0x11f350[_0x59a620];return _0x2b754d;}export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
1
|
+
const a17_0x248e34=a17_0x235e;(function(_0x2af652,_0x1268d1){const _0x307c35=a17_0x235e,_0x4e2ab8=_0x2af652();while(!![]){try{const _0x8b1343=-parseInt(_0x307c35(0xe3))/0x1+-parseInt(_0x307c35(0xf6))/0x2*(-parseInt(_0x307c35(0x100))/0x3)+parseInt(_0x307c35(0xcd))/0x4*(parseInt(_0x307c35(0xfb))/0x5)+parseInt(_0x307c35(0xe8))/0x6*(parseInt(_0x307c35(0xe7))/0x7)+-parseInt(_0x307c35(0xdd))/0x8+parseInt(_0x307c35(0xf0))/0x9+parseInt(_0x307c35(0xce))/0xa*(-parseInt(_0x307c35(0xd5))/0xb);if(_0x8b1343===_0x1268d1)break;else _0x4e2ab8['push'](_0x4e2ab8['shift']());}catch(_0x26cddf){_0x4e2ab8['push'](_0x4e2ab8['shift']());}}}(a17_0x3d42,0x3a245));function a17_0x3d42(){const _0x3a302b=['1190331qcIGzG','Settable\x20keys:\x20','Value\x20to\x20assign','length','Set\x20`','args','64696tNRDcL','bool','validation','\x20\x20project:\x20','Write\x20to\x20global\x20config','10YQTZTB','\x22.\x20Allowed:\x20','list','isArray','Get\x20a\x20config\x20value','21KarwGC','\x20(global)','object','Key\x20\x22','`\x20=\x20\x22','raw','keys','config','stringify','value','List\x20current\x20config','apps','Set\x20a\x20config\x20value','includes','Key\x20not\x20found:\x20','write','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','riskLevel','Missing\x20key\x20argument.','Missing\x20key\x20or\x20value.','811360BkHPuX','20ETDjuK','alias','field','key','Deleted\x20`','\x20config\x20get\x20<key>','Top-level\x20key\x20\x22','770594ubOtph','boolean','\x22\x20is\x20not\x20settable.','read','split','format','global','log','877896nAscge','Config\x20files:\x0a','\x20\x20global:\x20\x20','\x20config\x20set\x20<key>\x20<value>\x20[--global]','(none)','Delete\x20a\x20config\x20value','367017BesvKI','\x22\x20not\x20found\x20at\x20top\x20level.','Invalid\x20value\x20for\x20\x22','project-or-global-explicit','22659jrnbSo','168QasimF','pretty','set','appcode','Usage:\x20','trim','../../context.js','pageSize\x20must\x20be\x20a\x20positive\x20number'];a17_0x3d42=function(){return _0x3a302b;};return a17_0x3d42();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';function a17_0x235e(_0xa7dc01,_0x41e2ac){_0xa7dc01=_0xa7dc01-0xbe;const _0x3d42cf=a17_0x3d42();let _0x235e24=_0x3d42cf[_0xa7dc01];return _0x235e24;}import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':a17_0x248e34(0xdb),'type':a17_0x248e34(0xd6),'description':a17_0x248e34(0xfa),'default':![]};function parseAliasAppcodeSetKey(_0x5be7fa){const _0x58be3c=a17_0x248e34,_0x3825b3=_0x5be7fa['split']('.');if(_0x3825b3['length']!==0x3||_0x3825b3[0x0]!==_0x58be3c(0xc4)||_0x3825b3[0x2]!==_0x58be3c(0xeb))return undefined;const _0x5e10e6=_0x3825b3[0x1]?.[_0x58be3c(0xed)]();return _0x5e10e6?_0x5e10e6:undefined;}function parseAliasDeleteKey(_0x1d54a9){const _0x72e93f=a17_0x248e34,_0x106ed7=_0x1d54a9[_0x72e93f(0xd9)]('.');if(_0x106ed7[_0x72e93f(0xf3)]===0x2&&_0x106ed7[0x0]===_0x72e93f(0xc4)){const _0x1174ab=_0x106ed7[0x1]?.[_0x72e93f(0xed)]();return _0x1174ab?{'alias':_0x1174ab}:undefined;}if(_0x106ed7[_0x72e93f(0xf3)]===0x3&&_0x106ed7[0x0]===_0x72e93f(0xc4)&&_0x106ed7[0x2]==='appcode'){const _0x1cc194=_0x106ed7[0x1]?.['trim']();return _0x1cc194?{'alias':_0x1cc194,'field':'appcode'}:undefined;}return undefined;}function setLocalAppAlias(_0x58a184,_0x300f23,_0x52de96){const _0x1bae9c=a17_0x248e34,_0x50e472=_0x58a184['apps']&&typeof _0x58a184['apps']==='object'&&!Array['isArray'](_0x58a184['apps'])?_0x58a184[_0x1bae9c(0xc4)]:{},_0x46abf6=_0x50e472[_0x300f23]&&typeof _0x50e472[_0x300f23]===_0x1bae9c(0x102)&&!Array[_0x1bae9c(0xfe)](_0x50e472[_0x300f23])?_0x50e472[_0x300f23]:{};_0x46abf6['appcode']=_0x52de96,_0x50e472[_0x300f23]=_0x46abf6,_0x58a184[_0x1bae9c(0xc4)]=_0x50e472;}function deleteLocalAppAlias(_0x5c5165,_0x31d6da){const _0x260fd1=a17_0x248e34;if(!_0x5c5165[_0x260fd1(0xc4)]||typeof _0x5c5165['apps']!==_0x260fd1(0x102)||Array[_0x260fd1(0xfe)](_0x5c5165[_0x260fd1(0xc4)]))return![];const _0x527d19=_0x5c5165[_0x260fd1(0xc4)],_0xf6c934=_0x527d19[_0x31d6da['alias']];if(!_0xf6c934||typeof _0xf6c934!==_0x260fd1(0x102)||Array[_0x260fd1(0xfe)](_0xf6c934))return![];if(!_0x31d6da[_0x260fd1(0xd0)])return delete _0x527d19[_0x31d6da[_0x260fd1(0xcf)]],!![];if(!(_0x31d6da[_0x260fd1(0xd0)]in _0xf6c934))return![];return delete _0xf6c934[_0x31d6da['field']],Object[_0x260fd1(0xbf)](_0xf6c934)[_0x260fd1(0xf3)]===0x0&&delete _0x527d19[_0x31d6da[_0x260fd1(0xcf)]],!![];}const listDef={'service':a17_0x248e34(0xc0),'command':a17_0x248e34(0xfd),'description':a17_0x248e34(0xc3),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x9a2549){const _0x492e17=a17_0x248e34,{buildConfigFromFlags:_0x305fd9}=await import(_0x492e17(0xee)),_0x334151=_0x305fd9({}),_0x2b2386=getProjectConfigPath(),_0x2619ea=resolveWriteConfigPath(_0x492e17(0xdb));if(_0x9a2549[_0x492e17(0xda)]===_0x492e17(0xe9))return{'ok':!![],'message':'#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a'+(JSON[_0x492e17(0xc1)](_0x334151[_0x492e17(0xbe)],null,0x2)+'\x0a\x0a')+_0x492e17(0xde)+(_0x492e17(0xf9)+(_0x2b2386??_0x492e17(0xe1))+'\x0a')+(_0x492e17(0xdf)+_0x2619ea)};return{'ok':!![],'data':{'effective':_0x334151[_0x492e17(0xbe)],'configFiles':{'project':_0x2b2386??null,'global':_0x2619ea}}};}},getDef={'service':a17_0x248e34(0xc0),'command':'get','description':a17_0x248e34(0xff),'risk':a17_0x248e34(0xd8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a17_0x248e34(0xd1),'description':a17_0x248e34(0xc9),'required':!![]}],'flags':[],async 'execute'(_0x5390a7){const _0x15f8dd=a17_0x248e34,_0x464822=_0x5390a7[_0x15f8dd(0xf5)][0x0];if(!_0x464822)throw CliErrors[_0x15f8dd(0xf8)]('Missing\x20key\x20argument.',_0x15f8dd(0xec)+CLI_BIN_NAME+_0x15f8dd(0xd3));const {buildConfigFromFlags:_0x450400}=await import('../../context.js'),{raw:_0x4661a3}=_0x450400({});if(_0x464822[_0x15f8dd(0xc6)]('.')){const _0x39f340=_0x464822[_0x15f8dd(0xd9)]('.');let _0x2d5eea=_0x4661a3;for(const _0x48af55 of _0x39f340){if(_0x2d5eea==null||typeof _0x2d5eea!==_0x15f8dd(0x102))throw CliErrors[_0x15f8dd(0xf8)]('Key\x20not\x20found:\x20'+_0x464822);_0x2d5eea=_0x2d5eea[_0x48af55];}if(_0x2d5eea===undefined)throw CliErrors['validation'](_0x15f8dd(0xc7)+_0x464822);return console[_0x15f8dd(0xdc)](typeof _0x2d5eea===_0x15f8dd(0x102)?JSON[_0x15f8dd(0xc1)](_0x2d5eea,null,0x2):String(_0x2d5eea)),{'ok':!![]};}const _0x42bedc=_0x4661a3[_0x464822];if(_0x42bedc===undefined)throw CliErrors[_0x15f8dd(0xf8)](_0x15f8dd(0xc7)+_0x464822);return console[_0x15f8dd(0xdc)](typeof _0x42bedc===_0x15f8dd(0x102)?JSON[_0x15f8dd(0xc1)](_0x42bedc,null,0x2):String(_0x42bedc)),{'ok':!![]};}},setDef={'service':a17_0x248e34(0xc0),'command':a17_0x248e34(0xea),'description':a17_0x248e34(0xc5),'risk':a17_0x248e34(0xc8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a17_0x248e34(0xd1),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a17_0x248e34(0xc2),'description':a17_0x248e34(0xf2),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x26bd93){const _0x417fc6=a17_0x248e34,_0x7a15ec=_0x26bd93['args'][0x0],_0x13865e=_0x26bd93['args'][0x1];if(!_0x7a15ec||_0x13865e===undefined)throw CliErrors['validation'](_0x417fc6(0xcc),'Usage:\x20'+CLI_BIN_NAME+_0x417fc6(0xe0));if(ENUM_KEYS[_0x7a15ec]&&!ENUM_KEYS[_0x7a15ec][_0x417fc6(0xc6)](_0x13865e))throw CliErrors['validation'](_0x417fc6(0xe5)+_0x7a15ec+_0x417fc6(0xfc)+ENUM_KEYS[_0x7a15ec]['join'](',\x20'));if(_0x7a15ec===_0x417fc6(0xca))throw CliErrors[_0x417fc6(0xf8)]('\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.');if(_0x7a15ec==='pageSize'){const _0x317b9f=Number(_0x13865e);if(isNaN(_0x317b9f)||_0x317b9f<=0x0)throw CliErrors[_0x417fc6(0xf8)](_0x417fc6(0xef));}const _0x2de08a=resolveWriteScope({'explicitGlobal':_0x26bd93[_0x417fc6(0xf7)](_0x417fc6(0xdb)),'policy':_0x417fc6(0xe6)}),_0x4eed0a=toScopeFlags(_0x2de08a),_0x52d7d3=readScopedConfig(_0x4eed0a),_0x1de024=parseAliasAppcodeSetKey(_0x7a15ec);if(!_0x1de024&&!isTopLevelConfigKey(_0x7a15ec))throw CliErrors[_0x417fc6(0xf8)](_0x417fc6(0xd4)+_0x7a15ec+_0x417fc6(0xd7),_0x417fc6(0xf1)+getTopLevelConfigKeySummary()+';\x20apps.<alias>.appcode');return _0x1de024?setLocalAppAlias(_0x52d7d3,_0x1de024,_0x13865e):_0x52d7d3[_0x7a15ec]=_0x7a15ec==='pageSize'?Number(_0x13865e):_0x13865e,console[_0x417fc6(0xdc)](_0x417fc6(0xf4)+_0x7a15ec+_0x417fc6(0x104)+_0x13865e+'\x22'+(_0x2de08a===_0x417fc6(0xdb)?_0x417fc6(0x101):'')),writeScopedConfig(_0x52d7d3,_0x4eed0a),{'ok':!![]};}},deleteDef={'service':a17_0x248e34(0xc0),'command':'delete','description':a17_0x248e34(0xe2),'risk':a17_0x248e34(0xc8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a17_0x248e34(0xd1),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x3496bb){const _0x20f6c8=a17_0x248e34,_0xf54243=_0x3496bb[_0x20f6c8(0xf5)][0x0];if(!_0xf54243)throw CliErrors[_0x20f6c8(0xf8)](_0x20f6c8(0xcb),_0x20f6c8(0xec)+CLI_BIN_NAME+'\x20config\x20delete\x20<key>\x20[--global]');const _0x1673a5=resolveWriteScope({'explicitGlobal':_0x3496bb[_0x20f6c8(0xf7)](_0x20f6c8(0xdb)),'policy':'project-or-global-explicit'}),_0x328cee=toScopeFlags(_0x1673a5),_0x4cfe21=readScopedConfig(_0x328cee),_0x3bf9d5=parseAliasDeleteKey(_0xf54243);if(_0x3bf9d5){if(!deleteLocalAppAlias(_0x4cfe21,_0x3bf9d5))throw CliErrors['validation']('Key\x20not\x20found:\x20'+_0xf54243);return console[_0x20f6c8(0xdc)]('Deleted\x20`'+_0xf54243+'`'+(_0x1673a5===_0x20f6c8(0xdb)?_0x20f6c8(0x101):'')),writeScopedConfig(_0x4cfe21,_0x328cee),{'ok':!![]};}if(_0x4cfe21[_0xf54243]===undefined)throw CliErrors['validation'](_0x20f6c8(0x103)+_0xf54243+_0x20f6c8(0xe4));return delete _0x4cfe21[_0xf54243],console[_0x20f6c8(0xdc)](_0x20f6c8(0xd2)+_0xf54243+'`'+(_0x1673a5===_0x20f6c8(0xdb)?_0x20f6c8(0x101):'')),writeScopedConfig(_0x4cfe21,_0x328cee),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x104c3a,_0x3c5399){var _0x66368d=a18_0x3232,_0xd302af=_0x104c3a();while(!![]){try{var _0x18b970=parseInt(_0x66368d(0x94))/0x1+parseInt(_0x66368d(0x96))/0x2+parseInt(_0x66368d(0x9b))/0x3+parseInt(_0x66368d(0x97))/0x4*(-parseInt(_0x66368d(0x9a))/0x5)+parseInt(_0x66368d(0x91))/0x6*(-parseInt(_0x66368d(0x99))/0x7)+parseInt(_0x66368d(0x92))/0x8*(-parseInt(_0x66368d(0x98))/0x9)+parseInt(_0x66368d(0x95))/0xa*(parseInt(_0x66368d(0x93))/0xb);if(_0x18b970===_0x3c5399)break;else _0xd302af['push'](_0xd302af['shift']());}catch(_0x50df81){_0xd302af['push'](_0xd302af['shift']());}}}(a18_0x3918,0x50082));import{CLI_BIN_NAME}from'../../constant/cli.js';export{CLI_BIN_NAME};export{readScopedConfig,writeScopedConfig}from'../../context.js';function a18_0x3232(_0x92e4a9,_0x394507){_0x92e4a9=_0x92e4a9-0x91;var _0x3918a5=a18_0x3918();var _0x32320c=_0x3918a5[_0x92e4a9];return _0x32320c;}function a18_0x3918(){var _0x17a8e8=['460dbnmEy','445554jTIpvF','2175052OoVIML','1042623qhNrxs','3899ykytiT','5dxBGwI','686103Rqqktm','2016tLLzQD','32TjmcAg','149237rOgpnp','446553mhzKFH'];a18_0x3918=function(){return _0x17a8e8;};return a18_0x3918();}export{resolveConfigScope as resolveWriteScope,TOP_LEVEL_CONFIG_KEYS as TOP_LEVEL_KEYS,CONFIG_ENUM_VALUES as ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey,toScopeFlags}from'../../commands/common/config-policy.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a19_0x3872(){const _0x50f65d=['\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','3692421GMkeEG','2370155tjmVnc','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','create','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','Update\x20an\x20existing\x20record','\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}}','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\x20\x20WHERE\x20OPERATORS','command','dryRun','paramsHint','1503523Ksfdvl','63716ibEfph','93PRPYiX','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','6kBjqcc','\x20\x20PAGINATION','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','\x20on\x20dataset\x20','operation','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','read','1NdUmpk','body','3922768UYSNJA','Filter\x20dataset\x20records\x20with\x20query\x20conditions','write','7038944SmmDgx','\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$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','join','paramsRequired','description','\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\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','\x20\x20AGGREGATE\x20TYPES','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','Preview:\x20data\x20','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','data','\x20\x20LOGICAL\x20COMBINATORS','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','10fSOVUS','\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\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','filter','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','params','386882kAJLmd','batchCreate','delete','\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#\x20Count\x20orders\x20per\x20region\x20with\x20filter','aggregate','update','build','risk','getOne','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20PARAMS\x20STRUCTURE','\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\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','helpExtra','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','now','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','data\x20','\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','/api/{appCode}/','\x20\x20EXAMPLES','str','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'];a19_0x3872=function(){return _0x50f65d;};return a19_0x3872();}const a19_0x228f61=a19_0x34df;(function(_0x4aaebe,_0x246e2c){const _0x2cddaa=a19_0x34df,_0x1e49e4=_0x4aaebe();while(!![]){try{const _0x55385a=parseInt(_0x2cddaa(0x123))/0x1*(parseInt(_0x2cddaa(0xed))/0x2)+-parseInt(_0x2cddaa(0x117))/0x3*(-parseInt(_0x2cddaa(0x116))/0x4)+parseInt(_0x2cddaa(0x10a))/0x5+parseInt(_0x2cddaa(0x11b))/0x6*(-parseInt(_0x2cddaa(0x115))/0x7)+parseInt(_0x2cddaa(0x125))/0x8+parseInt(_0x2cddaa(0x109))/0x9*(-parseInt(_0x2cddaa(0xe5))/0xa)+-parseInt(_0x2cddaa(0x128))/0xb;if(_0x55385a===_0x246e2c)break;else _0x1e49e4['push'](_0x1e49e4['shift']());}catch(_0x3e08a3){_0x1e49e4['push'](_0x1e49e4['shift']());}}}(a19_0x3872,0x5e65f));import{executeData}from'../../core/sdk-client.js';function a19_0x34df(_0x272b35,_0x49de08){_0x272b35=_0x272b35-0xd9;const _0x38728b=a19_0x3872();let _0x34dfc6=_0x38728b[_0x272b35];return _0x34dfc6;}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':a19_0x228f61(0xe9),'operation':a19_0x228f61(0xe9),'risk':a19_0x228f61(0x122),'paramsRequired':![],'description':a19_0x228f61(0x126),'paramsHint':'JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20'+a19_0x228f61(0x110),'helpExtra':[a19_0x228f61(0x111),a19_0x228f61(0x12a),'\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}',a19_0x228f61(0x10f),a19_0x228f61(0x119),a19_0x228f61(0x129),a19_0x228f61(0xf0),'\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}',a19_0x228f61(0xfa),'\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','',a19_0x228f61(0xe3),a19_0x228f61(0xe6),'\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)',a19_0x228f61(0xea),a19_0x228f61(0x12b),a19_0x228f61(0xfb),'\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','',a19_0x228f61(0x11c),a19_0x228f61(0x106),a19_0x228f61(0xe4),a19_0x228f61(0x11a)]['join']('\x0a')},{'command':a19_0x228f61(0xf6),'operation':a19_0x228f61(0xf6),'risk':a19_0x228f61(0x122),'paramsRequired':!![],'description':'Get\x20a\x20single\x20record\x20by\x20ID','paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a19_0x228f61(0x10c),'operation':a19_0x228f61(0x10c),'risk':'write','paramsRequired':!![],'description':a19_0x228f61(0xdd),'paramsHint':'JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27'},{'command':'batchCreate','operation':a19_0x228f61(0xee),'risk':a19_0x228f61(0x127),'paramsRequired':!![],'description':a19_0x228f61(0xe1),'paramsHint':a19_0x228f61(0x121)},{'command':a19_0x228f61(0xf3),'operation':'update','risk':a19_0x228f61(0x127),'paramsRequired':!![],'description':a19_0x228f61(0x10e),'paramsHint':'JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27'},{'command':a19_0x228f61(0xef),'operation':a19_0x228f61(0xef),'risk':'high-risk-write','paramsRequired':!![],'description':a19_0x228f61(0xf7),'paramsHint':a19_0x228f61(0x107)},{'command':a19_0x228f61(0xf2),'operation':'aggregate','risk':'read','paramsRequired':![],'description':a19_0x228f61(0x10d),'paramsHint':a19_0x228f61(0x102)+'Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','helpExtra':[a19_0x228f61(0xde),a19_0x228f61(0x101),a19_0x228f61(0xe8),a19_0x228f61(0xdc),a19_0x228f61(0xe7),a19_0x228f61(0xff),'\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}',a19_0x228f61(0x11e),'',a19_0x228f61(0xf9),a19_0x228f61(0xdb),a19_0x228f61(0xeb),a19_0x228f61(0x118),a19_0x228f61(0xf8),'\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Post-aggregation\x20filters,\x20e.g.\x20[{\x22columnName\x22:\x22total\x22,\x22condition\x22:{\x22$gt\x22:1000}}]',a19_0x228f61(0x108),'',a19_0x228f61(0x104),a19_0x228f61(0xfd),a19_0x228f61(0x11d),'',a19_0x228f61(0xf1),a19_0x228f61(0x10b),'',a19_0x228f61(0xdf)][a19_0x228f61(0x12c)]('\x0a')}];function makeDataCommand(_0x17a5f6){const _0x362d4d=a19_0x228f61,_0x4a4620=_0x362d4d(0x100)+_0x17a5f6[_0x362d4d(0x112)],_0x16a201={'service':_0x362d4d(0xe2),'command':_0x17a5f6['command'],'description':_0x17a5f6[_0x362d4d(0xda)],'risk':_0x17a5f6[_0x362d4d(0xf5)],'helpExtra':_0x17a5f6[_0x362d4d(0xfc)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x17a5f6[_0x362d4d(0x114)]}],'validate':async _0x1e9119=>{const _0x43702c=_0x362d4d;_0x17a5f6[_0x43702c(0xd9)]&&requireAnyOf(_0x1e9119,[_0x43702c(0xec)],_0x4a4620),_0x17a5f6[_0x43702c(0x120)]==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x1e9119[_0x43702c(0x105)]('params')));},async 'execute'(_0x22657d){const _0x3b976d=_0x362d4d,_0x1b3e9c=_0x22657d[_0x3b976d(0x105)]('code'),_0x49843a=_0x17a5f6['operation']===_0x3b976d(0xee)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x22657d['str'](_0x3b976d(0xec)))):parseJsonParams(_0x22657d[_0x3b976d(0x105)](_0x3b976d(0xec)))??{},_0x4e2e5b=Date[_0x3b976d(0xfe)](),_0x498a9c=await executeData(_0x1b3e9c,_0x17a5f6[_0x3b976d(0x120)],_0x49843a),_0x1c1505=Date[_0x3b976d(0xfe)]()-_0x4e2e5b;return{'ok':!![],'data':{'result':_0x498a9c,'elapsed':_0x1c1505},'message':_0x3b976d(0x100)+_0x17a5f6['command']+'\x20completed\x20in\x20'+_0x1c1505+'ms'};}};return _0x17a5f6[_0x362d4d(0xf5)]!=='read'&&(_0x16a201[_0x362d4d(0x113)]=async _0x4d3c02=>{const _0x284444=_0x362d4d,_0xd66dc5=_0x4d3c02['str']('code'),_0x2e7ffb=_0x17a5f6[_0x284444(0x120)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x4d3c02['str'](_0x284444(0xec)))):parseJsonParams(_0x4d3c02[_0x284444(0x105)](_0x284444(0xec)))??{};return dryRun('POST',_0x284444(0x103)+_0xd66dc5+'/'+_0x17a5f6[_0x284444(0x120)])[_0x284444(0x124)](_0x2e7ffb)['description'](_0x284444(0xe0)+_0x17a5f6[_0x284444(0x112)]+_0x284444(0x11f)+_0xd66dc5)[_0x284444(0xf4)]();}),_0x16a201;}export const dataDefinitions=specs['map'](makeDataCommand);
|
|
1
|
+
const a19_0x57542f=a19_0x3919;(function(_0x560ae8,_0x20c638){const _0x1db67d=a19_0x3919,_0x305f36=_0x560ae8();while(!![]){try{const _0x3581ef=parseInt(_0x1db67d(0x1f8))/0x1*(parseInt(_0x1db67d(0x229))/0x2)+parseInt(_0x1db67d(0x228))/0x3*(-parseInt(_0x1db67d(0x205))/0x4)+parseInt(_0x1db67d(0x203))/0x5+parseInt(_0x1db67d(0x235))/0x6+parseInt(_0x1db67d(0x20c))/0x7*(-parseInt(_0x1db67d(0x217))/0x8)+parseInt(_0x1db67d(0x23a))/0x9+-parseInt(_0x1db67d(0x1f2))/0xa*(-parseInt(_0x1db67d(0x20e))/0xb);if(_0x3581ef===_0x20c638)break;else _0x305f36['push'](_0x305f36['shift']());}catch(_0x176524){_0x305f36['push'](_0x305f36['shift']());}}}(a19_0x1413,0x5cae5));import{executeData}from'../../core/sdk-client.js';function a19_0x1413(){const _0x271b93=['data\x20','build','\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','Filter\x20dataset\x20records\x20with\x20query\x20conditions','\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','/api/{appCode}/','\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','\x20\x20WHERE\x20OPERATORS','write','code','6246uaAnmk','551434pFuwFw','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','command','filter','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\x20on\x20dataset\x20','Get\x20a\x20single\x20record\x20by\x20ID','\x20\x20LOGICAL\x20COMBINATORS','high-risk-write','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','Update\x20an\x20existing\x20record','2393682FmYHLQ','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','POST','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','654012wXoBAF','\x20\x20AGGREGATE\x20TYPES','\x20\x20PAGINATION','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','aggregate','create','map','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','risk','params','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','170mFYSsh','paramsHint','\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','read','update','1xOmrND','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','batchCreate','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','now','description','operation','join','417770yVApwa','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','1024nGuCbr','paramsRequired','Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20EXAMPLES','delete','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','1379cdwgZc','str','81818FYnqsB','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','dryRun','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Post-aggregation\x20filters,\x20e.g.\x20[{\x22columnName\x22:\x22total\x22,\x22condition\x22:{\x22$gt\x22:1000}}]','Preview:\x20data\x20','\x20\x20PARAMS\x20STRUCTURE','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','1816mkZYLi','\x20completed\x20in\x20','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','Create\x20a\x20new\x20record\x20in\x20a\x20dataset'];a19_0x1413=function(){return _0x271b93;};return a19_0x1413();}import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';function a19_0x3919(_0x24c9ea,_0x18513d){_0x24c9ea=_0x24c9ea-0x1eb;const _0x1413da=a19_0x1413();let _0x391908=_0x1413da[_0x24c9ea];return _0x391908;}import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a19_0x57542f(0x22c),'operation':a19_0x57542f(0x22c),'risk':a19_0x57542f(0x1f6),'paramsRequired':![],'description':a19_0x57542f(0x21f),'paramsHint':a19_0x57542f(0x219)+a19_0x57542f(0x215),'helpExtra':[a19_0x57542f(0x225),a19_0x57542f(0x1f4),a19_0x57542f(0x1f0),'\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}',a19_0x57542f(0x224),a19_0x57542f(0x233),a19_0x57542f(0x23d),a19_0x57542f(0x223),'\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}',a19_0x57542f(0x1fa),'\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','',a19_0x57542f(0x230),'\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}',a19_0x57542f(0x214),'',a19_0x57542f(0x1ed),'\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)',a19_0x57542f(0x236),a19_0x57542f(0x239),a19_0x57542f(0x20f),'\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','',a19_0x57542f(0x23c),a19_0x57542f(0x1f9),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)']['join']('\x0a')},{'command':'getOne','operation':'getOne','risk':a19_0x57542f(0x1f6),'paramsRequired':!![],'description':a19_0x57542f(0x22f),'paramsHint':a19_0x57542f(0x22d)},{'command':a19_0x57542f(0x1eb),'operation':a19_0x57542f(0x1eb),'risk':a19_0x57542f(0x226),'paramsRequired':!![],'description':a19_0x57542f(0x21b),'paramsHint':'JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27'},{'command':a19_0x57542f(0x1fb),'operation':a19_0x57542f(0x1fb),'risk':'write','paramsRequired':!![],'description':a19_0x57542f(0x1fe),'paramsHint':a19_0x57542f(0x1fc)},{'command':a19_0x57542f(0x1f7),'operation':'update','risk':'write','paramsRequired':!![],'description':a19_0x57542f(0x234),'paramsHint':a19_0x57542f(0x21a)},{'command':'delete','operation':a19_0x57542f(0x209),'risk':a19_0x57542f(0x231),'paramsRequired':!![],'description':a19_0x57542f(0x232),'paramsHint':a19_0x57542f(0x22d)},{'command':'aggregate','operation':a19_0x57542f(0x240),'risk':a19_0x57542f(0x1f6),'paramsRequired':![],'description':a19_0x57542f(0x20a),'paramsHint':a19_0x57542f(0x216)+a19_0x57542f(0x207),'helpExtra':[a19_0x57542f(0x23b),a19_0x57542f(0x220),a19_0x57542f(0x23f),a19_0x57542f(0x22a),a19_0x57542f(0x20b),'\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}',a19_0x57542f(0x1f5),a19_0x57542f(0x21e),'',a19_0x57542f(0x213),a19_0x57542f(0x238),'\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)',a19_0x57542f(0x221),a19_0x57542f(0x1fd),a19_0x57542f(0x211),'\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','',a19_0x57542f(0x208),a19_0x57542f(0x204),a19_0x57542f(0x23e),'','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter',a19_0x57542f(0x1f1),'','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.'][a19_0x57542f(0x202)]('\x0a')}];function makeDataCommand(_0x1b0b73){const _0x2525d5=a19_0x57542f,_0x32a087=_0x2525d5(0x21c)+_0x1b0b73[_0x2525d5(0x22b)],_0x18cfaf={'service':'data','command':_0x1b0b73[_0x2525d5(0x22b)],'description':_0x1b0b73[_0x2525d5(0x200)],'risk':_0x1b0b73[_0x2525d5(0x1ee)],'helpExtra':_0x1b0b73['helpExtra'],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x1b0b73[_0x2525d5(0x1f3)]}],'validate':async _0x2901b9=>{const _0x23b6ab=_0x2525d5;_0x1b0b73[_0x23b6ab(0x206)]&&requireAnyOf(_0x2901b9,['params'],_0x32a087),_0x1b0b73[_0x23b6ab(0x201)]===_0x23b6ab(0x1fb)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x2901b9[_0x23b6ab(0x20d)]('params')));},async 'execute'(_0x159258){const _0x17a37d=_0x2525d5,_0x5b5955=_0x159258['str'](_0x17a37d(0x227)),_0x4a2cc4=_0x1b0b73['operation']==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x159258[_0x17a37d(0x20d)](_0x17a37d(0x1ef)))):parseJsonParams(_0x159258[_0x17a37d(0x20d)]('params'))??{},_0x30b7c9=Date[_0x17a37d(0x1ff)](),_0x531373=await executeData(_0x5b5955,_0x1b0b73[_0x17a37d(0x201)],_0x4a2cc4),_0x226967=Date[_0x17a37d(0x1ff)]()-_0x30b7c9;return{'ok':!![],'data':{'result':_0x531373,'elapsed':_0x226967},'message':'data\x20'+_0x1b0b73[_0x17a37d(0x22b)]+_0x17a37d(0x218)+_0x226967+'ms'};}};return _0x1b0b73[_0x2525d5(0x1ee)]!==_0x2525d5(0x1f6)&&(_0x18cfaf[_0x2525d5(0x210)]=async _0x579b48=>{const _0x3856cc=_0x2525d5,_0x4ab7f3=_0x579b48['str']('code'),_0x60d922=_0x1b0b73[_0x3856cc(0x201)]===_0x3856cc(0x1fb)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x579b48[_0x3856cc(0x20d)](_0x3856cc(0x1ef)))):parseJsonParams(_0x579b48['str']('params'))??{};return dryRun(_0x3856cc(0x237),_0x3856cc(0x222)+_0x4ab7f3+'/'+_0x1b0b73[_0x3856cc(0x201)])['body'](_0x60d922)[_0x3856cc(0x200)](_0x3856cc(0x212)+_0x1b0b73[_0x3856cc(0x22b)]+_0x3856cc(0x22e)+_0x4ab7f3)[_0x3856cc(0x21d)]();}),_0x18cfaf;}export const dataDefinitions=specs[a19_0x57542f(0x1ec)](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x2024f9=a20_0x10a2;(function(_0x14a36e,_0x1e1616){const _0x25bb49=a20_0x10a2,_0x475701=_0x14a36e();while(!![]){try{const _0x459ab6=parseInt(_0x25bb49(0xa5))/0x1*(-parseInt(_0x25bb49(0x9d))/0x2)+-parseInt(_0x25bb49(0xc7))/0x3+-parseInt(_0x25bb49(0xa8))/0x4*(-parseInt(_0x25bb49(0xb6))/0x5)+-parseInt(_0x25bb49(0xcb))/0x6+parseInt(_0x25bb49(0xd4))/0x7*(parseInt(_0x25bb49(0xb1))/0x8)+parseInt(_0x25bb49(0xb4))/0x9*(parseInt(_0x25bb49(0xb5))/0xa)+parseInt(_0x25bb49(0xc5))/0xb;if(_0x459ab6===_0x1e1616)break;else _0x475701['push'](_0x475701['shift']());}catch(_0x3215ac){_0x475701['push'](_0x475701['shift']());}}}(a20_0x127b,0x50a87));import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x260a47){const _0x245147=a20_0x10a2;if(_0x260a47[_0x245147(0x98)])return null;const _0x22ec6e=Boolean(_0x260a47[_0x245147(0xa2)]!==undefined||_0x260a47['doType']!==undefined);let _0x1ddcd2={};if(!_0x22ec6e&&typeof _0x260a47[_0x245147(0x90)]==='string')try{_0x1ddcd2=JSON[_0x245147(0xbf)](_0x260a47['extend']);}catch{}const _0x5c1682=_0x22ec6e?_0x260a47[_0x245147(0xac)]:_0x260a47[_0x245147(0xc3)],_0x21f3a6=_0x22ec6e?_0x260a47[_0x245147(0xa2)]:_0x260a47[_0x245147(0xac)],_0x218198=_0x22ec6e?_0x260a47['doType']:_0x260a47[_0x245147(0xb0)]||_0x260a47[_0x245147(0xbb)],_0x10db82=_0x22ec6e?_0x260a47[_0x245147(0x9e)]===!![]:_0x1ddcd2[_0x245147(0x9e)]===!![],_0x1ffe2c=_0x22ec6e?_0x260a47[_0x245147(0xc2)]===!![]:_0x1ddcd2['required']===!![],_0x574953=_0x22ec6e?_0x260a47[_0x245147(0xae)]??null:_0x1ddcd2[_0x245147(0xae)]??null,_0x3665eb={'name':_0x5c1682,'displayName':_0x21f3a6||_0x5c1682,'type':_0x218198,'dbType':_0x260a47[_0x245147(0xa0)],'pk':_0x10db82,'required':_0x1ffe2c,'description':_0x260a47[_0x245147(0xb8)]||undefined};return Array[_0x245147(0xa9)](_0x574953)&&_0x574953[_0x245147(0x91)]>0x0&&(_0x3665eb[_0x245147(0xae)]=_0x574953),_0x3665eb;}function parseJsonMaybe(_0x10c325){const _0x55b182=a20_0x10a2;if(typeof _0x10c325!==_0x55b182(0xaf))return _0x10c325;try{return JSON[_0x55b182(0xbf)](_0x10c325);}catch{return _0x10c325;}}function normalizeOperationEntry(_0x5ea729,_0x2369cc){const _0x39a760=a20_0x10a2;if(!_0x2369cc||typeof _0x2369cc!==_0x39a760(0xab))return null;if(!_0x2369cc[_0x39a760(0xa7)]||!_0x2369cc[_0x39a760(0xba)])return null;const _0x48943c={'name':_0x5ea729,'method':_0x2369cc[_0x39a760(0xa7)],'path':_0x2369cc[_0x39a760(0xba)]};if(_0x2369cc[_0x39a760(0xad)])_0x48943c['host']=_0x2369cc[_0x39a760(0xad)];if(_0x2369cc[_0x39a760(0xd8)]!=null)_0x48943c[_0x39a760(0xd8)]=parseJsonMaybe(_0x2369cc[_0x39a760(0xd8)]);if(_0x2369cc[_0x39a760(0xd1)]!=null)_0x48943c['responseBody']=parseJsonMaybe(_0x2369cc[_0x39a760(0xd1)]);if(_0x2369cc[_0x39a760(0xc6)]!=null)_0x48943c['beforeScriptId']=_0x2369cc['beforeScriptId'];if(_0x2369cc[_0x39a760(0xb7)]!=null)_0x48943c[_0x39a760(0xb7)]=_0x2369cc[_0x39a760(0xb7)];if(Array[_0x39a760(0xa9)](_0x2369cc[_0x39a760(0xa4)]))_0x48943c[_0x39a760(0xa4)]=_0x2369cc[_0x39a760(0xa4)];if(Array[_0x39a760(0xa9)](_0x2369cc[_0x39a760(0xc0)]))_0x48943c[_0x39a760(0xc0)]=_0x2369cc[_0x39a760(0xc0)];return _0x48943c;}function summarizeDbtable(_0x45c79b){const _0x385518=a20_0x10a2,_0x4a7d18={},_0x43d847=[_0x385518(0xd5),'dbName','tableName',_0x385518(0x95),'pkField',_0x385518(0xa1),'logicField',_0x385518(0xd2),'updateTimeField','creatorIdField','creatorNameField','modifierIdField',_0x385518(0xd6),_0x385518(0xd7),_0x385518(0x9c)];for(const _0x2439a3 of _0x43d847){if(_0x45c79b[_0x2439a3]!==undefined)_0x4a7d18[_0x2439a3]=_0x45c79b[_0x2439a3];}return typeof _0x4a7d18[_0x385518(0xa1)]===_0x385518(0xaf)&&_0x4a7d18[_0x385518(0xa1)][_0x385518(0x91)]>0x0&&(_0x4a7d18[_0x385518(0x9f)]=_0x4a7d18[_0x385518(0xa1)][_0x385518(0xa6)](',')[_0x385518(0xb3)](_0x35c4f4=>_0x35c4f4[_0x385518(0xa3)]())[_0x385518(0xb9)](Boolean)),_0x4a7d18;}function a20_0x127b(){const _0x18fd92=['fields','object','name','host','options','string','type','2511968neigDA','formatRules','map','9udhnsk','5046100AGIqTK','245uHaDDH','afterScriptId','description','filter','path','dataType','source','validateRules','str','parse','responseFields','toDatasetCode','required','code','title','1067286WXQwfU','beforeScriptId','1193703zRTHZK','dbtableConfig','operations','toField','910872BescRy','tableName','relations','push','properties','dbName','responseBody','createTimeField','modelCode','14fFMCEo','dbId','modifierNameField','labelField','requestBody','read','extend','length','appCode','indexes','toDatasetName','datasetKey','dataset','doVersion','deleted','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','toFieldLabel','sourceType','dblinkInfoDTO','8lkiuPI','pkField','allFieldNames','dbType','allFields','displayName','trim','requestFields','90962WTilTH','split','method','1168QQKeoe','isArray'];a20_0x127b=function(){return _0x18fd92;};return a20_0x127b();}function normalizeRelatedPages(_0x199dea){const _0x3a67d3=a20_0x10a2;if(!Array[_0x3a67d3(0xa9)](_0x199dea))return[];return _0x199dea[_0x3a67d3(0xb9)](_0x13c960=>_0x13c960&&typeof _0x13c960===_0x3a67d3(0xab))[_0x3a67d3(0xb3)](_0x51254a=>({'id':_0x51254a['id'],'type':_0x51254a[_0x3a67d3(0xb0)],'code':_0x51254a[_0x3a67d3(0xc3)],'title':_0x51254a[_0x3a67d3(0xc4)],'deleted':_0x51254a['deleted']===!![]}));}function normalizeFallbackFieldName(_0x1422f2,_0xd4e9ed){const _0x27987b=a20_0x10a2,_0x2274db=_0x1422f2[_0x27987b(0xa3)]();if(!_0x2274db)return null;return{'name':_0x2274db,'displayName':_0x2274db,'type':undefined,'dbType':undefined,'pk':_0x2274db===_0xd4e9ed,'required':![],'description':undefined};}async function loadListFieldFallback(_0x166284,_0x426bee){const _0x268659=a20_0x10a2;if(!_0x166284||!_0x426bee)return[];try{const _0x2a2558=await listDatasets(_0x166284,{'code':_0x426bee}),_0xd5a8ca=_0x2a2558['find'](_0x147801=>_0x147801[_0x268659(0xc3)]===_0x426bee)??_0x2a2558[0x0],_0x4c18b5=_0xd5a8ca?.[_0x268659(0xc8)]??{},_0x236da3=typeof _0x4c18b5[_0x268659(0xa1)]===_0x268659(0xaf)?_0x4c18b5['allFields']['split'](','):[];return _0x236da3[_0x268659(0xb3)](_0x38f0e4=>normalizeFallbackFieldName(_0x38f0e4,_0x4c18b5[_0x268659(0x9e)]))['filter'](_0x4be66a=>_0x4be66a!==null);}catch{return[];}}function a20_0x10a2(_0x46cac4,_0x55844f){_0x46cac4=_0x46cac4-0x8f;const _0x127b5b=a20_0x127b();let _0x10a2d3=_0x127b5b[_0x46cac4];return _0x10a2d3;}export const datasetDetail={'service':'dataset','command':'detail','description':a20_0x2024f9(0x99),'risk':a20_0x2024f9(0x8f),'flags':[CODE_FLAG],async 'execute'(_0x1af63f){const _0x5b5727=a20_0x2024f9,_0x36a025=await getDatasetDetail(_0x1af63f[_0x5b5727(0xbe)](_0x5b5727(0xc3))),_0xf9f85b=Array[_0x5b5727(0xa9)](_0x36a025['fields'])?_0x36a025[_0x5b5727(0xaa)]:Array[_0x5b5727(0xa9)](_0x36a025[_0x5b5727(0xcf)])?_0x36a025[_0x5b5727(0xcf)]:[];let _0x200fc4=_0xf9f85b[_0x5b5727(0xb3)](_0x503792=>normalizeField(_0x503792))[_0x5b5727(0xb9)](_0xd050c0=>_0xd050c0!==null);_0x200fc4[_0x5b5727(0x91)]===0x0&&(_0x200fc4=await loadListFieldFallback(_0x1af63f[_0x5b5727(0x92)],_0x1af63f[_0x5b5727(0xbe)](_0x5b5727(0xc3))));const _0x51b804=_0x36a025[_0x5b5727(0xc9)]??{},_0x59641e=[];for(const [_0xe47d55,_0x2d22e8]of Object['entries'](_0x51b804)){const _0x5f0c05=normalizeOperationEntry(_0xe47d55,_0x2d22e8);if(_0x5f0c05)_0x59641e[_0x5b5727(0xce)](_0x5f0c05);}const _0x537f2b=_0x36a025[_0x5b5727(0xc8)]??{},_0x12d045=_0x36a025[_0x5b5727(0x96)]??{},_0x380efc=_0x537f2b['dbId']!=null?{'id':_0x537f2b[_0x5b5727(0xd5)],'name':_0x537f2b[_0x5b5727(0xd0)]??null}:undefined;let _0x23807a;return typeof _0x36a025[_0x5b5727(0x90)]===_0x5b5727(0xaf)&&(_0x23807a=parseJsonMaybe(_0x36a025[_0x5b5727(0x90)])),{'ok':!![],'data':{'id':_0x36a025['modelId']??_0x36a025['id'],'name':_0x36a025[_0x5b5727(0xac)],'code':_0x36a025[_0x5b5727(0xd3)]||_0x36a025[_0x5b5727(0xc3)],'doVersion':_0x36a025[_0x5b5727(0x97)],'description':_0x36a025['description']||_0x12d045['tableComment']||undefined,'source':_0x36a025[_0x5b5727(0xbc)]||_0x12d045[_0x5b5727(0x9b)],'table':_0x537f2b['tableName']||_0x12d045[_0x5b5727(0xcc)],'datasetKey':_0x537f2b[_0x5b5727(0x95)],'pk':_0x537f2b[_0x5b5727(0x9e)],'db':_0x380efc,'dbtable':summarizeDbtable(_0x537f2b),'fields':_0x200fc4,'operations':_0x59641e,'indexes':Array[_0x5b5727(0xa9)](_0x12d045[_0x5b5727(0x93)])?_0x12d045[_0x5b5727(0x93)]:[],'relations':Array[_0x5b5727(0xa9)](_0x36a025[_0x5b5727(0xcd)])?_0x36a025[_0x5b5727(0xcd)][_0x5b5727(0xb3)](_0x5d0ddb=>({'fromField':_0x5d0ddb['fromField'],'toDataset':_0x5d0ddb[_0x5b5727(0x94)],'toCode':_0x5d0ddb[_0x5b5727(0xc1)],'toTable':_0x5d0ddb['toTableName'],'toField':_0x5d0ddb[_0x5b5727(0xca)],'labelField':_0x5d0ddb[_0x5b5727(0x9a)]||undefined})):[],'relatedPages':normalizeRelatedPages(_0x36a025['relatedPageInfoList']),...Array['isArray'](_0x36a025['columnCodeListWithDeleted'])?{'columnCodeListWithDeleted':_0x36a025['columnCodeListWithDeleted']}:{},'formatRules':Array[_0x5b5727(0xa9)](_0x36a025[_0x5b5727(0xb2)])?_0x36a025[_0x5b5727(0xb2)]:[],'validateRules':Array[_0x5b5727(0xa9)](_0x36a025['validateRules'])?_0x36a025[_0x5b5727(0xbd)]:[],..._0x23807a!==undefined?{'extend':_0x23807a}:{},'stats':{'fieldCount':_0x200fc4[_0x5b5727(0x91)],'operationCount':_0x59641e['length']}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2ae531,_0x599247){const _0x4c5d7a=a21_0x27ba,_0x2297a2=_0x2ae531();while(!![]){try{const _0x3b88a8=parseInt(_0x4c5d7a(0x10f))/0x1+-parseInt(_0x4c5d7a(0x114))/0x2+parseInt(_0x4c5d7a(0x110))/0x3*(-parseInt(_0x4c5d7a(0x115))/0x4)+-parseInt(_0x4c5d7a(0x113))/0x5*(parseInt(_0x4c5d7a(0x117))/0x6)+parseInt(_0x4c5d7a(0x111))/0x7*(-parseInt(_0x4c5d7a(0x10e))/0x8)+-parseInt(_0x4c5d7a(0x10d))/0x9+parseInt(_0x4c5d7a(0x112))/0xa*(parseInt(_0x4c5d7a(0x116))/0xb);if(_0x3b88a8===_0x599247)break;else _0x2297a2['push'](_0x2297a2['shift']());}catch(_0x24e119){_0x2297a2['push'](_0x2297a2['shift']());}}}(a21_0x3d4b,0x679cb));import{datasetList}from'../../commands/dataset/list.js';function a21_0x27ba(_0x589dcf,_0x2c54ed){_0x589dcf=_0x589dcf-0x10d;const _0x3d4b4d=a21_0x3d4b();let _0x27bac0=_0x3d4b4d[_0x589dcf];return _0x27bac0;}function a21_0x3d4b(){const _0x38c659=['4727178BkHvfh','50496qwFmWA','224074trMbFZ','10683ngYPfU','266qRZami','26893990aKcxle','3524795MjqKRO','1518136tXMacl','292joFhAq','11BXaRsB','6PzBBkm'];a21_0x3d4b=function(){return _0x38c659;};return a21_0x3d4b();}import{datasetDetail}from'../../commands/dataset/detail.js';import{datasetSdkDoc}from'../../commands/dataset/sdk-doc.js';export const datasetDefinitions=[datasetList,datasetDetail,datasetSdkDoc];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a22_0x2303(_0x23c7be,_0x17a801){_0x23c7be=_0x23c7be-0x10e;const _0x50eca4=a22_0x50ec();let _0x23038=_0x50eca4[_0x23c7be];return _0x23038;}const a22_0x51c346=a22_0x2303;(function(_0x17802a,_0x5d251d){const _0x5df319=a22_0x2303,_0x46d731=_0x17802a();while(!![]){try{const _0x530a5f=parseInt(_0x5df319(0x114))/0x1*(parseInt(_0x5df319(0x11c))/0x2)+-parseInt(_0x5df319(0x116))/0x3*(-parseInt(_0x5df319(0x117))/0x4)+-parseInt(_0x5df319(0x11a))/0x5*(-parseInt(_0x5df319(0x11e))/0x6)+-parseInt(_0x5df319(0x125))/0x7*(-parseInt(_0x5df319(0x111))/0x8)+parseInt(_0x5df319(0x119))/0x9+-parseInt(_0x5df319(0x11b))/0xa+-parseInt(_0x5df319(0x10f))/0xb*(parseInt(_0x5df319(0x123))/0xc);if(_0x530a5f===_0x5d251d)break;else _0x46d731['push'](_0x46d731['shift']());}catch(_0x3404bc){_0x46d731['push'](_0x46d731['shift']());}}}(a22_0x50ec,0xa5d97));import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';export const datasetList={'service':a22_0x51c346(0x120),'command':'list','description':a22_0x51c346(0x118),'risk':'read','flags':[{'name':a22_0x51c346(0x115),'type':a22_0x51c346(0x122),'description':a22_0x51c346(0x124)},{...CODE_FLAG,'required':![],'description':a22_0x51c346(0x126)}],async 'execute'(_0x2b0342){const _0x4ba547=a22_0x51c346,_0x169071=_0x2b0342[_0x4ba547(0x112)]('name'),_0x30da73=_0x2b0342['str']('code'),_0x220b77=await listDatasets(_0x2b0342['appCode'],{..._0x169071&&{'name':_0x169071},..._0x30da73&&{'code':_0x30da73}});return{'ok':!![],'data':{'total':_0x220b77[_0x4ba547(0x11f)],'datasets':_0x220b77[_0x4ba547(0x128)](_0x18ed3c=>{const _0x4b567d=_0x4ba547,_0xf4a0b3=_0x18ed3c[_0x4b567d(0x121)]??{};return{'id':_0x18ed3c['id'],'code':_0x18ed3c['code'],'name':_0x18ed3c['name'],'source':_0x18ed3c[_0x4b567d(0x129)],'description':_0x18ed3c[_0x4b567d(0x11d)],'table':_0xf4a0b3[_0x4b567d(0x110)],'datasetKey':_0xf4a0b3['datasetKey'],'pk':_0xf4a0b3['pkField'],'fields':_0xf4a0b3['allFields']?_0xf4a0b3[_0x4b567d(0x113)][_0x4b567d(0x127)](',')[_0x4b567d(0x128)](_0x169cc9=>_0x169cc9[_0x4b567d(0x10e)]()):[]};})}};}};function a22_0x50ec(){const _0x2572c3=['allFields','1BJkODm','name','120066vNHkFV','124uouyIc','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','4171599uIXNlp','115ztdZtB','6565000cFEmtW','1883770xNQzti','description','16572UzlhXK','length','dataset','dbtableConfig','string','12ymFLof','Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)','1253DydauE','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','split','map','source','trim','26649975wbqfUI','tableName','46880hUgoCC','str'];a22_0x50ec=function(){return _0x2572c3;};return a22_0x50ec();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x5910e9=a23_0x4517;function a23_0x4517(_0x3fd0c1,_0x5b0be2){_0x3fd0c1=_0x3fd0c1-0xa2;const _0x2026b1=a23_0x2026();let _0x451719=_0x2026b1[_0x3fd0c1];return _0x451719;}function a23_0x2026(){const _0x2cf1fe=['sdk-doc','4397193LhBMgF','9636540baheap','45992obvRQJ','4730404GeCcgD','10gHhlTY','56oQBdLG','trim','str','appCode','2nXXcrq','#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档','code','1112733zkIwkt','Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','6078305bSbmbU','1586473QNrHtO','Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code'];a23_0x2026=function(){return _0x2cf1fe;};return a23_0x2026();}(function(_0x168695,_0x4e2c45){const _0x497ea1=a23_0x4517,_0x12dd66=_0x168695();while(!![]){try{const _0x3956a2=parseInt(_0x497ea1(0xa6))/0x1+parseInt(_0x497ea1(0xad))/0x2*(parseInt(_0x497ea1(0xa4))/0x3)+parseInt(_0x497ea1(0xa7))/0x4+parseInt(_0x497ea1(0xb2))/0x5+-parseInt(_0x497ea1(0xa5))/0x6+parseInt(_0x497ea1(0xb3))/0x7*(-parseInt(_0x497ea1(0xa9))/0x8)+parseInt(_0x497ea1(0xb0))/0x9*(parseInt(_0x497ea1(0xa8))/0xa);if(_0x3956a2===_0x4e2c45)break;else _0x12dd66['push'](_0x12dd66['shift']());}catch(_0x520dd0){_0x12dd66['push'](_0x12dd66['shift']());}}}(a23_0x2026,0xcd563));import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';const DEFAULT_MARKDOWN=a23_0x5910e9(0xae);export function formatDatasetSdkMarkdown(_0xb4d1a3){const _0x89d80d=a23_0x5910e9,_0x5cbbea=typeof _0xb4d1a3==='string'?_0xb4d1a3[_0x89d80d(0xaa)]():'';return _0x5cbbea||DEFAULT_MARKDOWN;}export const datasetSdkDoc={'service':'dataset','command':a23_0x5910e9(0xa3),'description':a23_0x5910e9(0xa2),'risk':'read','flags':[{...CODE_FLAG,'description':a23_0x5910e9(0xb1)}],async 'execute'(_0x40501d){const _0x4c73f8=a23_0x5910e9,_0x4da12d=_0x40501d[_0x4c73f8(0xab)](_0x4c73f8(0xaf)),_0x482ea1=await getDatasetSdkUsageDoc(_0x4da12d,_0x40501d[_0x4c73f8(0xac)]);return{'ok':!![],'data':{'code':_0x4da12d,'appCode':_0x40501d['appCode'],'markdown':formatDatasetSdkMarkdown(_0x482ea1)}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x4b9810=a24_0x419f;function a24_0x419f(_0x5a2ff9,_0x38b317){_0x5a2ff9=_0x5a2ff9-0x6e;const _0x280a57=a24_0x280a();let _0x419fa7=_0x280a57[_0x5a2ff9];return _0x419fa7;}(function(_0x512f5d,_0x2133f0){const _0x12b86e=a24_0x419f,_0x4c8337=_0x512f5d();while(!![]){try{const _0x2e2257=-parseInt(_0x12b86e(0xa3))/0x1+-parseInt(_0x12b86e(0x8d))/0x2+-parseInt(_0x12b86e(0x86))/0x3+-parseInt(_0x12b86e(0x6e))/0x4+-parseInt(_0x12b86e(0xa4))/0x5*(parseInt(_0x12b86e(0xbd))/0x6)+-parseInt(_0x12b86e(0x99))/0x7+parseInt(_0x12b86e(0x73))/0x8;if(_0x2e2257===_0x2133f0)break;else _0x4c8337['push'](_0x4c8337['shift']());}catch(_0x58ca4a){_0x4c8337['push'](_0x4c8337['shift']());}}}(a24_0x280a,0xa4633));import a24_0x4de8cb from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';import{inspectServiceRegistry}from'../commands/service/registry.js';async function execute(_0x285105){const _0x42ea10=a24_0x419f,_0x3b9ff7=getCliVersion(),_0x269051=buildConfigFromFlags({});await initGlobalEnvironment(_0x269051),console[_0x42ea10(0xb2)](),console[_0x42ea10(0xb2)](a24_0x4de8cb[_0x42ea10(0x84)](CLI_BIN_NAME+'\x20doctor')),console[_0x42ea10(0xb2)](a24_0x4de8cb['gray']('─'[_0x42ea10(0xaf)](0x32))),console[_0x42ea10(0xb2)]('\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20'+_0x3b9ff7),console['log'](_0x42ea10(0x9d)+process[_0x42ea10(0x6f)]),console[_0x42ea10(0xb2)](_0x42ea10(0x93)+process['platform']+'\x20'+process[_0x42ea10(0xb7)]),console['log'](),console[_0x42ea10(0xb2)](a24_0x4de8cb['bold'](_0x42ea10(0xc0))),console[_0x42ea10(0xb2)](a24_0x4de8cb[_0x42ea10(0x77)](_0x42ea10(0xbb)[_0x42ea10(0xaf)](0x1e)));const _0x18107a=getGlobalConfigPath(),_0x7515ae=getProjectConfigPath();console[_0x42ea10(0xb2)](_0x42ea10(0x75)+(_0x18107a||a24_0x4de8cb['gray'](_0x42ea10(0xbc)))),console['log'](_0x42ea10(0x7e)+(_0x7515ae||a24_0x4de8cb[_0x42ea10(0x77)](_0x42ea10(0xbc)))),console[_0x42ea10(0xb2)](),console['log'](a24_0x4de8cb['bold'](_0x42ea10(0x76))),console[_0x42ea10(0xb2)](a24_0x4de8cb[_0x42ea10(0x77)](_0x42ea10(0xbb)[_0x42ea10(0xaf)](0x1e)));const _0x28a25a=(_0x2a4a6d,_0x339926)=>{const _0x2dc44a=_0x42ea10;if(!_0x339926){console[_0x2dc44a(0xb2)]('\x20\x20'+_0x2a4a6d[_0x2dc44a(0x8a)](0x11)+'\x20'+a24_0x4de8cb['gray'](_0x2dc44a(0x88)));return;}const _0x5355ff=inspectCliConfigJsonFile(_0x339926);if(_0x5355ff[_0x2dc44a(0x7b)]==='ok')console[_0x2dc44a(0xb2)]('\x20\x20'+_0x2a4a6d[_0x2dc44a(0x8a)](0x11)+'\x20'+a24_0x4de8cb[_0x2dc44a(0xc3)](_0x2dc44a(0xba)));else{if(_0x5355ff[_0x2dc44a(0x7b)]===_0x2dc44a(0x9f))console[_0x2dc44a(0xb2)]('\x20\x20'+_0x2a4a6d[_0x2dc44a(0x8a)](0x11)+'\x20'+a24_0x4de8cb[_0x2dc44a(0xaa)]('⚠\x20Empty\x20(treated\x20as\x20{})'));else _0x5355ff['status']===_0x2dc44a(0x79)?console['log']('\x20\x20'+_0x2a4a6d[_0x2dc44a(0x8a)](0x11)+'\x20'+a24_0x4de8cb['gray'](_0x2dc44a(0x8e))):(console[_0x2dc44a(0xb2)]('\x20\x20'+_0x2a4a6d[_0x2dc44a(0x8a)](0x11)+'\x20'+a24_0x4de8cb[_0x2dc44a(0x7d)]('✗\x20Invalid\x20JSON')),console[_0x2dc44a(0xb2)]('\x20\x20'+''[_0x2dc44a(0x8a)](0x11)+'\x20'+a24_0x4de8cb[_0x2dc44a(0x7d)](_0x5355ff[_0x2dc44a(0xa8)])));}};_0x28a25a(_0x42ea10(0xa9),_0x18107a),_0x28a25a(_0x42ea10(0x85),_0x7515ae),console[_0x42ea10(0xb2)](),console[_0x42ea10(0xb2)](a24_0x4de8cb[_0x42ea10(0x84)]('\x20\x20Merged\x20Config')),console[_0x42ea10(0xb2)](a24_0x4de8cb[_0x42ea10(0x77)](_0x42ea10(0xbb)[_0x42ea10(0xaf)](0x1e))),console[_0x42ea10(0xb2)](_0x42ea10(0x89)+(_0x269051[_0x42ea10(0xb4)]||a24_0x4de8cb['red'](_0x42ea10(0x94)))),console[_0x42ea10(0xb2)](_0x42ea10(0xb9)+_0x269051[_0x42ea10(0x9a)]);const _0x2c0e69=isLegacyCompatConfigKey('locale')?a24_0x4de8cb[_0x42ea10(0x77)](_0x269051[_0x42ea10(0x92)]+_0x42ea10(0x83)):_0x269051[_0x42ea10(0x92)];console[_0x42ea10(0xb2)](_0x42ea10(0x96)+_0x2c0e69),console[_0x42ea10(0xb2)](_0x42ea10(0xa1)+(_0x269051[_0x42ea10(0xc2)]||a24_0x4de8cb[_0x42ea10(0x77)]('(none)'))),console[_0x42ea10(0xb2)](_0x42ea10(0xb1)+(_0x269051[_0x42ea10(0xa2)]||a24_0x4de8cb['gray']('(none)'))),console['log'](_0x42ea10(0xae)+(_0x269051[_0x42ea10(0x7c)]||a24_0x4de8cb[_0x42ea10(0x77)](_0x42ea10(0x78)+DEFAULT_CONFIG_VALUES[_0x42ea10(0x7c)]+')'))),console[_0x42ea10(0xb2)](_0x42ea10(0x82)+(_0x269051[_0x42ea10(0x8f)]??a24_0x4de8cb[_0x42ea10(0x77)](_0x42ea10(0xb3)))),console[_0x42ea10(0xb2)](_0x42ea10(0x95)+_0x269051[_0x42ea10(0xab)]),console[_0x42ea10(0xb2)](_0x42ea10(0xc5)+_0x269051[_0x42ea10(0x70)]),console['log'](_0x42ea10(0x9b)+AUTH_MODE[_0x42ea10(0x74)]),console['log'](_0x42ea10(0x71)+(_0x269051['accessKey']?a24_0x4de8cb[_0x42ea10(0xc3)](_0x42ea10(0xac)+_0x269051['accessKey'][_0x42ea10(0x9e)]+')'):a24_0x4de8cb['gray'](_0x42ea10(0x9c)))),console[_0x42ea10(0xb2)](),console[_0x42ea10(0xb2)](a24_0x4de8cb['bold'](_0x42ea10(0x8b))),console[_0x42ea10(0xb2)](a24_0x4de8cb[_0x42ea10(0x77)]('\x20\x20─'['repeat'](0x1e))),console[_0x42ea10(0xb2)](_0x42ea10(0xc1)+getApiDomain()),console[_0x42ea10(0xb2)](_0x42ea10(0xa7)+getUserDomain()),console['log']('\x20\x20runtimeDomain:\x20\x20\x20'+getRuntimeDomain()),console[_0x42ea10(0xb2)](),console[_0x42ea10(0xb2)](a24_0x4de8cb['bold'](_0x42ea10(0xa6))),console[_0x42ea10(0xb2)](a24_0x4de8cb[_0x42ea10(0x77)](_0x42ea10(0xbb)['repeat'](0x1e)));const _0x3f4f84=inspectServiceRegistry();console[_0x42ea10(0xb2)](_0x42ea10(0x80)+_0x3f4f84[_0x42ea10(0xbf)]),console[_0x42ea10(0xb2)](_0x42ea10(0xbe)+formatServiceRegistryStatus(_0x3f4f84)),console[_0x42ea10(0xb2)](_0x42ea10(0xb5)+_0x3f4f84[_0x42ea10(0xad)]),console[_0x42ea10(0xb2)](_0x42ea10(0x8c)+_0x3f4f84['commandCount']);for(const _0x5eb47e of _0x3f4f84['services']){console['log']('\x20\x20'+(_0x5eb47e[_0x42ea10(0x87)]+':')[_0x42ea10(0x8a)](0x11)+'\x20'+(_0x5eb47e['name']||a24_0x4de8cb[_0x42ea10(0x77)](_0x42ea10(0x72)))+'\x20('+_0x5eb47e[_0x42ea10(0xa5)]+_0x42ea10(0x98)),console['log']('\x20\x20'+''[_0x42ea10(0x8a)](0x11)+'\x20Imported\x20from:\x20'+_0x5eb47e[_0x42ea10(0xa0)]['path']);}return console['log'](),console['log'](a24_0x4de8cb[_0x42ea10(0x84)](_0x42ea10(0x81))),console[_0x42ea10(0xb2)](a24_0x4de8cb[_0x42ea10(0x77)](_0x42ea10(0xbb)[_0x42ea10(0xaf)](0x1e))),console[_0x42ea10(0xb2)](_0x42ea10(0x7f)+a24_0x4de8cb[_0x42ea10(0xc3)](AUTH_MODE[_0x42ea10(0x74)]+_0x42ea10(0x90))),console[_0x42ea10(0xb2)](_0x42ea10(0xb6)+a24_0x4de8cb[_0x42ea10(0x77)]('(removed\x20—\x20cookie\x20auth\x20disabled)')),console[_0x42ea10(0xb2)](),{'ok':!![]};}function formatServiceRegistryStatus(_0x3071b3){const _0x209eb4=a24_0x419f;if(_0x3071b3[_0x209eb4(0x7b)]==='ok')return a24_0x4de8cb[_0x209eb4(0xc3)](_0x209eb4(0x91));if(_0x3071b3[_0x209eb4(0x7b)]==='missing')return a24_0x4de8cb[_0x209eb4(0x77)]('(not\x20found)');if(_0x3071b3[_0x209eb4(0x7b)]==='empty')return a24_0x4de8cb[_0x209eb4(0xaa)](_0x209eb4(0xb0));return a24_0x4de8cb[_0x209eb4(0x7d)](_0x209eb4(0x7a)+(_0x3071b3[_0x209eb4(0xa8)]?':\x20'+_0x3071b3[_0x209eb4(0xa8)]:''));}function a24_0x280a(){const _0x4dda0f=['source','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','currentApp','1162818GzEToP','12205JnJvcc','commandCount','\x20\x20Service\x20Tree','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','message','Global','yellow','riskLevel','(set,\x20length=','serviceCount','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','repeat','⚠\x20Empty','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','log','(default)','appCode','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Session\x20check:\x20\x20\x20','arch','check','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','✓\x20Valid\x20JSON','\x20\x20─','(not\x20found)','762kjOMaI','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','registryPath','\x20\x20Config\x20Files','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','defaultApp','green','Diagnose\x20CLI\x20configuration\x20and\x20environment','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','1238544kSHoPa','version','verbose','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','(unnamed)','37332208eyyhDW','ClientAk','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Config\x20JSON','gray','(default:\x20','missing','✗\x20Invalid','status','format','red','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Auth','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','\x20(legacy/compat\x20only)','bold','Project','1567545GCJPXn','serviceCode','(no\x20file)','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','padEnd','\x20\x20API\x20Endpoints','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','1448772lJipht','(missing)','pageSize','\x20(accessKey)','✓\x20Loaded','locale','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','(not\x20set)','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','doctor','\x20commands)','6746831vIdRaZ','env','\x20\x20auth\x20(effective):\x20','(none)','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','length','empty'];a24_0x280a=function(){return _0x4dda0f;};return a24_0x280a();}export const doctorDefinition={'service':a24_0x4b9810(0x97),'command':a24_0x4b9810(0xb8),'description':a24_0x4b9810(0xc4),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a25_0x359cbe=a25_0x5e12;(function(_0x2539f4,_0x4e3ca3){const _0x1377a3=a25_0x5e12,_0x5f56c2=_0x2539f4();while(!![]){try{const _0x21cab4=parseInt(_0x1377a3(0x191))/0x1*(parseInt(_0x1377a3(0x1c0))/0x2)+parseInt(_0x1377a3(0x1ca))/0x3+parseInt(_0x1377a3(0x1cc))/0x4+-parseInt(_0x1377a3(0x1c4))/0x5*(-parseInt(_0x1377a3(0x1bd))/0x6)+parseInt(_0x1377a3(0x18e))/0x7+parseInt(_0x1377a3(0x1bc))/0x8+-parseInt(_0x1377a3(0x19f))/0x9*(parseInt(_0x1377a3(0x195))/0xa);if(_0x21cab4===_0x4e3ca3)break;else _0x5f56c2['push'](_0x5f56c2['shift']());}catch(_0x55a4aa){_0x5f56c2['push'](_0x5f56c2['shift']());}}}(a25_0x5024,0x2a5ef));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a25_0x359cbe(0x192),'type':a25_0x359cbe(0x18f),'description':a25_0x359cbe(0x1c3)},{'name':a25_0x359cbe(0x1a6),'type':a25_0x359cbe(0x18f),'description':a25_0x359cbe(0x1ad)+DEFAULT_CONFIG_VALUES[a25_0x359cbe(0x1a6)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a25_0x359cbe(0x1c2),'type':a25_0x359cbe(0x1a7),'description':a25_0x359cbe(0x1a5)+PRODUCT_CONFIG[a25_0x359cbe(0x1b3)]+a25_0x359cbe(0x1c6),'default':![]},{'name':'yes','type':a25_0x359cbe(0x1a7),'description':a25_0x359cbe(0x1ae),'default':![]}];function a25_0x5024(){const _0x9b816a=['\x20init\x20—\x20Create\x20','50GsvwCi','cancelled','riskLevel','log','yes','apiDir','app','file','toLowerCase','App\x20code\x20cannot\x20be\x20empty.','1690569ZILQZd','SIGINT','race','[Y/n]','flagMissing','apps','Write\x20to\x20global\x20(~/','env','boolean','Source\x20file\x20not\x20found:\x20','Override\x20imported\x20default\x20env','trim','validation','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','Target\x20environment\x20(default\x20','Skip\x20confirmation\x20when\x20overwriting','entries','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','includes','\x20\x20env:\x20\x20\x20\x20\x20','newConfigFileName','\x0aInitialized\x20','AbortPrompt','message','[y/N]','once','stdout','removeListener','close','2141088PcpzKJ','1656870rdhSuZ','Aborted.','\x20\x20default:\x20','4kFnYVt','defaultApp','global','App\x20code\x20for\x20the\x20project','5satOag','User\x20aborted\x20prompt',')\x20instead\x20of\x20project','name','join','project','23784hMojuu','\x20\x20appcode:\x20','635576jKAIPo','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`.','File\x20','parse','Failed\x20to\x20parse\x20source\x20file:\x20','Invalid\x20env\x20\x22','\x20already\x20exists.\x20Overwrite?','stdin','1991927kIBIwY','string','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','58796AcDiJc','appcode','object'];a25_0x5024=function(){return _0x9b816a;};return a25_0x5024();}export const initImportFlagDefs=[{'name':a25_0x359cbe(0x19c),'type':'string','description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':'appcode','type':a25_0x359cbe(0x18f),'description':'Override\x20imported\x20default\x20appcode'},{'name':'env','type':a25_0x359cbe(0x18f),'description':a25_0x359cbe(0x1a9),'enum':[...RUNTIME_ENV_VALUES]},{'name':a25_0x359cbe(0x1c2),'type':a25_0x359cbe(0x1a7),'description':a25_0x359cbe(0x1a5)+PRODUCT_CONFIG['newConfigFileName']+a25_0x359cbe(0x1c6),'default':![]},{'name':a25_0x359cbe(0x199),'type':'boolean','description':a25_0x359cbe(0x1ae),'default':![]}];export async function runInit(_0x3bf89f){const _0x149244=a25_0x359cbe,_0x13e197=isNonInteractiveMode(_0x3bf89f),_0xb0a24b=_0x3bf89f[_0x149244(0x1c2)]?_0x149244(0x1c2):_0x149244(0x1c9),_0x20e8aa=resolveWriteConfigPath(_0xb0a24b);try{_0x13e197?await runNonInteractive(_0x3bf89f,_0x20e8aa):await runInteractive(_0x3bf89f,_0x20e8aa);}catch(_0x4bde59){if(_0x4bde59 instanceof AbortPrompt)throw CliErrors[_0x149244(0x196)]();throw _0x4bde59;}}export async function runInitImport(_0x1105f2){const _0x1cc9fc=a25_0x359cbe,_0x10c73d=_0x1105f2[_0x1cc9fc(0x1c2)]?'global':'project',_0x48423c=resolveWriteConfigPath(_0x10c73d);await runFromImport(_0x1105f2,_0x48423c);}const RUNTIME_IRRELEVANT_KEYS=new Set([a25_0x359cbe(0x19a)]);async function runFromImport(_0x3f0217,_0x4c76ab){const _0x1091a8=a25_0x359cbe,_0x15eb06=resolveFilePath(_0x3f0217[_0x1091a8(0x19c)]);if(!existsSync(_0x15eb06))throw CliErrors[_0x1091a8(0x1ab)](_0x1091a8(0x1a8)+_0x15eb06);const _0x52e8d8=readSourceFile(_0x15eb06),_0x3fb50c=convertToRuntimeConfig(_0x52e8d8);_0x3f0217['appcode']&&(_0x3fb50c[_0x1091a8(0x192)]=String(_0x3f0217[_0x1091a8(0x192)]));_0x3f0217['env']&&(_0x3fb50c[_0x1091a8(0x1a6)]=resolveInitEnv(_0x3f0217));if(!_0x3fb50c[_0x1091a8(0x192)])throw CliErrors[_0x1091a8(0x1ab)](_0x1091a8(0x190),_0x1091a8(0x1cd));await writeInitConfig(_0x4c76ab,_0x3fb50c,_0x3f0217),console['log']('Imported\x20from\x20'+_0x15eb06),console[_0x1091a8(0x198)]('\x20\x20config:\x20\x20'+_0x4c76ab),console['log'](_0x1091a8(0x1cb)+_0x3fb50c[_0x1091a8(0x192)]);if(_0x3fb50c[_0x1091a8(0x1c1)])console[_0x1091a8(0x198)](_0x1091a8(0x1bf)+_0x3fb50c[_0x1091a8(0x1c1)]);}function convertToRuntimeConfig(_0x181ab7){const _0x2aacd8=a25_0x359cbe;if(_0x181ab7['apps']&&typeof _0x181ab7[_0x2aacd8(0x1a4)]===_0x2aacd8(0x193))throw CliErrors[_0x2aacd8(0x1ab)](_0x2aacd8(0x1b0),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x5b54b4={};for(const _0x3dc8e9 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x181ab7[_0x3dc8e9]!==undefined&&(_0x5b54b4[_0x3dc8e9]=_0x181ab7[_0x3dc8e9]);}return!_0x5b54b4['riskLevel']&&(_0x5b54b4['riskLevel']=DEFAULT_CONFIG_VALUES[_0x2aacd8(0x197)]),_0x5b54b4;}async function runNonInteractive(_0x38789b,_0x3b4093){const _0x4cd8ae=a25_0x359cbe,_0x13345f=_0x38789b['appcode'];if(!_0x13345f)throw CliErrors[_0x4cd8ae(0x1a3)](_0x4cd8ae(0x192),'Usage:\x20'+CLI_BIN_NAME+_0x4cd8ae(0x1ac));const _0x20e406=resolveInitEnv(_0x38789b);await writeInitConfig(_0x3b4093,{'appcode':_0x13345f,'env':_0x20e406},_0x38789b),console['log']('Initialized\x20'+_0x3b4093),console[_0x4cd8ae(0x198)](_0x4cd8ae(0x1cb)+_0x13345f),console[_0x4cd8ae(0x198)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x20e406);}async function runInteractive(_0x3ebfd8,_0x1c3dfb){const _0xdf7387=a25_0x359cbe,_0x3d727a=loadExisting(_0x1c3dfb),_0x3d89d8=typeof _0x3d727a?.[_0xdf7387(0x192)]===_0xdf7387(0x18f)?_0x3d727a['appcode']:'',_0x387b3e=resolveInitEnv(_0x3ebfd8);console[_0xdf7387(0x198)](CLI_BIN_NAME+_0xdf7387(0x194)+PRODUCT_CONFIG[_0xdf7387(0x1b3)]+'\x0a');if(existsSync(_0x1c3dfb)&&!_0x3ebfd8[_0xdf7387(0x199)]){const _0x54f677=await promptYesNo(_0xdf7387(0x1ce)+_0x1c3dfb+_0xdf7387(0x18c),![]);if(!_0x54f677){console['log'](_0xdf7387(0x1be));return;}}const _0x240933=typeof _0x3ebfd8[_0xdf7387(0x192)]===_0xdf7387(0x18f)?_0x3ebfd8[_0xdf7387(0x192)][_0xdf7387(0x1aa)]():'';let _0x34a376=_0x240933;!_0x34a376&&(_0x34a376=await promptInput('App\x20code',_0x3d89d8));if(!_0x34a376[_0xdf7387(0x1aa)]())throw CliErrors['validation'](_0xdf7387(0x19e));await writeInitConfig(_0x1c3dfb,{'appcode':_0x34a376[_0xdf7387(0x1aa)](),'env':_0x387b3e},_0x3ebfd8),console[_0xdf7387(0x198)](_0xdf7387(0x1b4)+_0x1c3dfb),console[_0xdf7387(0x198)](_0xdf7387(0x1cb)+_0x34a376[_0xdf7387(0x1aa)]()),console[_0xdf7387(0x198)](_0xdf7387(0x1b2)+_0x387b3e);}async function writeInitConfig(_0x4b71ec,_0x5e176a,_0x56f6a4){const _0x48dda0=a25_0x359cbe;let _0x250345={};existsSync(_0x4b71ec)&&!_0x56f6a4[_0x48dda0(0x199)]&&(_0x250345=readConfigFile(_0x4b71ec));for(const [_0x3408cd,_0x1c4cf5]of Object[_0x48dda0(0x1af)](_0x5e176a)){_0x1c4cf5!==undefined&&(_0x250345[_0x3408cd]=_0x1c4cf5);}if(_0x250345[_0x48dda0(0x19b)])delete _0x250345[_0x48dda0(0x19b)];writeConfigFile(_0x4b71ec,_0x250345);}class AbortPrompt extends Error{constructor(){const _0x302b66=a25_0x359cbe;super(_0x302b66(0x1c5)),this[_0x302b66(0x1c7)]=_0x302b66(0x1b5);}}function createSafeRl(){const _0x566f0e=a25_0x359cbe,_0x51b938=createInterface({'input':process[_0x566f0e(0x18d)],'output':process[_0x566f0e(0x1b9)]});let _0x4b5cf4;const _0x10f932=new Promise((_0x3b9db4,_0x25daf3)=>{const _0x551ff0=_0x566f0e;_0x4b5cf4=()=>{const _0x4c6df3=a25_0x5e12;_0x4b5cf4&&(_0x51b938[_0x4c6df3(0x1ba)]('SIGINT',_0x4b5cf4),_0x4b5cf4=undefined);try{_0x51b938['close']();}catch{}_0x25daf3(new AbortPrompt());},_0x51b938[_0x551ff0(0x1b8)]('SIGINT',_0x4b5cf4);}),_0x58af96=()=>{const _0x1b3b96=_0x566f0e;_0x4b5cf4&&(_0x51b938[_0x1b3b96(0x1ba)](_0x1b3b96(0x1a0),_0x4b5cf4),_0x4b5cf4=undefined);try{_0x51b938[_0x1b3b96(0x1bb)]();}catch{}};return{'rl':_0x51b938,'abortPromise':_0x10f932,'disposeSuccess':_0x58af96};}async function promptInput(_0x59e1b5,_0x58b021){const _0x2d5fe2=a25_0x359cbe,{rl:_0x1bd5ac,abortPromise:_0x380e14,disposeSuccess:_0x1d0c7e}=createSafeRl(),_0x2b073d=new Promise(_0x21d7a6=>{const _0x4ac13f=_0x58b021?'\x20\x20'+_0x59e1b5+'\x20('+_0x58b021+'):\x20':'\x20\x20'+_0x59e1b5+':\x20';_0x1bd5ac['question'](_0x4ac13f,_0x126628=>{const _0x30a37c=a25_0x5e12;_0x1d0c7e(),_0x21d7a6(_0x126628[_0x30a37c(0x1aa)]()||_0x58b021);});});return Promise[_0x2d5fe2(0x1a1)]([_0x2b073d,_0x380e14]);}async function promptYesNo(_0x5392a8,_0x43ff40){const _0x113f22=a25_0x359cbe,{rl:_0x34cdae,abortPromise:_0x2da211,disposeSuccess:_0x3f5071}=createSafeRl(),_0x3dae70=new Promise(_0x3a8133=>{const _0x212465=a25_0x5e12,_0x2a6d07=_0x43ff40?_0x212465(0x1a2):_0x212465(0x1b7);_0x34cdae['question']('\x20\x20'+_0x5392a8+'\x20'+_0x2a6d07+':\x20',_0x5e4f92=>{const _0xce169c=_0x212465;_0x3f5071();const _0x475371=_0x5e4f92[_0xce169c(0x1aa)]()[_0xce169c(0x19d)]();if(_0x475371==='y'||_0x475371==='yes')_0x3a8133(!![]);else{if(_0x475371==='n'||_0x475371==='no')_0x3a8133(![]);else _0x3a8133(_0x43ff40);}});});return Promise[_0x113f22(0x1a1)]([_0x3dae70,_0x2da211]);}function loadExisting(_0x1bbfb8){if(!existsSync(_0x1bbfb8))return null;return readConfigFile(_0x1bbfb8);}function a25_0x5e12(_0x104293,_0x56f164){_0x104293=_0x104293-0x18a;const _0x5024c9=a25_0x5024();let _0x5e1245=_0x5024c9[_0x104293];return _0x5e1245;}function resolveFilePath(_0xe9366a){return isAbsolute(_0xe9366a)?_0xe9366a:resolve(process['cwd'](),_0xe9366a);}function readSourceFile(_0x493e1a){const _0x48e2d5=a25_0x359cbe;try{const _0x315d7c=readFileSync(_0x493e1a,{'encoding':'utf8'});return JSON[_0x48e2d5(0x1cf)](_0x315d7c);}catch(_0x19583b){throw CliErrors[_0x48e2d5(0x1ab)](_0x48e2d5(0x18a)+_0x19583b[_0x48e2d5(0x1b6)]);}}function resolveInitEnv(_0x251c9b){const _0x129fa1=a25_0x359cbe,_0x220521=_0x251c9b[_0x129fa1(0x1a6)];if(_0x220521===undefined||_0x220521==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x129fa1(0x1b1)](_0x220521))throw CliErrors[_0x129fa1(0x1ab)](_0x129fa1(0x18b)+_0x220521+'\x22.\x20Allowed:\x20'+RUNTIME_ENV_VALUES[_0x129fa1(0x1c8)](',\x20'));return _0x220521;}
|
|
1
|
+
function a25_0x3e3e(_0x5efd81,_0xa29a2c){_0x5efd81=_0x5efd81-0xc3;const _0x2f1b72=a25_0x2f1b();let _0x3e3e75=_0x2f1b72[_0x5efd81];return _0x3e3e75;}const a25_0x775789=a25_0x3e3e;function a25_0x2f1b(){const _0xb26320=['Invalid\x20env\x20\x22','appcode','apiDir',')\x20instead\x20of\x20project','237028TzDAnk','Aborted.','global','cwd','stdout','entries','project','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','\x22.\x20Allowed:\x20','validation','9fTlJnW','Override\x20imported\x20default\x20env','5NxDold','110CSEZIy','1343046ldrOqt','cancelled','riskLevel','\x20already\x20exists.\x20Overwrite?','Write\x20to\x20global\x20(~/','149398ALSoVy','\x20\x20env:\x20\x20\x20\x20\x20','App\x20code\x20for\x20the\x20project','Target\x20environment\x20(default\x20','name','once','apps','message','140552BIOkYL','race','defaultApp','App\x20code','6132445pcOfzo','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','boolean','removeListener','close','stdin','35172mmAtuH','includes','env','User\x20aborted\x20prompt','21iLpxNB','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','Initialized\x20','app','Skip\x20confirmation\x20when\x20overwriting','Source\x20file\x20not\x20found:\x20','App\x20code\x20cannot\x20be\x20empty.','File\x20','string','SIGINT','yes','[y/N]','Failed\x20to\x20parse\x20source\x20file:\x20','question','newConfigFileName','AbortPrompt','log','):\x20','object','utf8','\x20\x20appcode:\x20','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','trim','Override\x20imported\x20default\x20appcode','413928QfRhqh','file'];a25_0x2f1b=function(){return _0xb26320;};return a25_0x2f1b();}(function(_0x3056a8,_0x5d9161){const _0x3a07b7=a25_0x3e3e,_0x2482a9=_0x3056a8();while(!![]){try{const _0x12b33b=-parseInt(_0x3a07b7(0xc6))/0x1+parseInt(_0x3a07b7(0xd9))/0x2*(parseInt(_0x3a07b7(0xd0))/0x3)+-parseInt(_0x3a07b7(0x107))/0x4+parseInt(_0x3a07b7(0xd2))/0x5*(-parseInt(_0x3a07b7(0xd4))/0x6)+parseInt(_0x3a07b7(0xef))/0x7*(-parseInt(_0x3a07b7(0xe1))/0x8)+-parseInt(_0x3a07b7(0xeb))/0x9*(parseInt(_0x3a07b7(0xd3))/0xa)+parseInt(_0x3a07b7(0xe5))/0xb;if(_0x12b33b===_0x5d9161)break;else _0x2482a9['push'](_0x2482a9['shift']());}catch(_0x525c1a){_0x2482a9['push'](_0x2482a9['shift']());}}}(a25_0x2f1b,0x1daca));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a25_0x775789(0xc3),'type':a25_0x775789(0xf7),'description':a25_0x775789(0xdb)},{'name':a25_0x775789(0xed),'type':a25_0x775789(0xf7),'description':a25_0x775789(0xdc)+DEFAULT_CONFIG_VALUES[a25_0x775789(0xed)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a25_0x775789(0xc8),'type':a25_0x775789(0xe7),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a25_0x775789(0xfd)]+a25_0x775789(0xc5),'default':![]},{'name':a25_0x775789(0xf9),'type':a25_0x775789(0xe7),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':a25_0x775789(0x108),'type':a25_0x775789(0xf7),'description':a25_0x775789(0xf0),'required':!![]},{'name':a25_0x775789(0xc3),'type':a25_0x775789(0xf7),'description':a25_0x775789(0x106)},{'name':'env','type':a25_0x775789(0xf7),'description':a25_0x775789(0xd1),'enum':[...RUNTIME_ENV_VALUES]},{'name':a25_0x775789(0xc8),'type':a25_0x775789(0xe7),'description':a25_0x775789(0xd8)+PRODUCT_CONFIG[a25_0x775789(0xfd)]+a25_0x775789(0xc5),'default':![]},{'name':'yes','type':a25_0x775789(0xe7),'description':a25_0x775789(0xf3),'default':![]}];export async function runInit(_0x5093f2){const _0x1b918a=a25_0x775789,_0x5095b8=isNonInteractiveMode(_0x5093f2),_0x4c0622=_0x5093f2[_0x1b918a(0xc8)]?_0x1b918a(0xc8):_0x1b918a(0xcc),_0x54a907=resolveWriteConfigPath(_0x4c0622);try{_0x5095b8?await runNonInteractive(_0x5093f2,_0x54a907):await runInteractive(_0x5093f2,_0x54a907);}catch(_0x336211){if(_0x336211 instanceof AbortPrompt)throw CliErrors[_0x1b918a(0xd5)]();throw _0x336211;}}export async function runInitImport(_0x2f819f){const _0x26f062=a25_0x775789,_0x46ff00=_0x2f819f['global']?_0x26f062(0xc8):_0x26f062(0xcc),_0xe19fb6=resolveWriteConfigPath(_0x46ff00);await runFromImport(_0x2f819f,_0xe19fb6);}const RUNTIME_IRRELEVANT_KEYS=new Set([a25_0x775789(0xc4)]);async function runFromImport(_0x3b3453,_0x12dd0e){const _0x44a69e=a25_0x775789,_0x555913=resolveFilePath(_0x3b3453[_0x44a69e(0x108)]);if(!existsSync(_0x555913))throw CliErrors[_0x44a69e(0xcf)](_0x44a69e(0xf4)+_0x555913);const _0x477c3a=readSourceFile(_0x555913),_0x4d720f=convertToRuntimeConfig(_0x477c3a);_0x3b3453[_0x44a69e(0xc3)]&&(_0x4d720f[_0x44a69e(0xc3)]=String(_0x3b3453[_0x44a69e(0xc3)]));_0x3b3453['env']&&(_0x4d720f[_0x44a69e(0xed)]=resolveInitEnv(_0x3b3453));if(!_0x4d720f[_0x44a69e(0xc3)])throw CliErrors['validation']('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.',_0x44a69e(0xcd));await writeInitConfig(_0x12dd0e,_0x4d720f,_0x3b3453),console[_0x44a69e(0xff)]('Imported\x20from\x20'+_0x555913),console[_0x44a69e(0xff)]('\x20\x20config:\x20\x20'+_0x12dd0e),console[_0x44a69e(0xff)](_0x44a69e(0x103)+_0x4d720f[_0x44a69e(0xc3)]);if(_0x4d720f[_0x44a69e(0xe3)])console[_0x44a69e(0xff)]('\x20\x20default:\x20'+_0x4d720f[_0x44a69e(0xe3)]);}function convertToRuntimeConfig(_0x48de50){const _0x11c6cc=a25_0x775789;if(_0x48de50[_0x11c6cc(0xdf)]&&typeof _0x48de50['apps']===_0x11c6cc(0x101))throw CliErrors[_0x11c6cc(0xcf)](_0x11c6cc(0xe6),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x31cdc4={};for(const _0x8e928a of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x48de50[_0x8e928a]!==undefined&&(_0x31cdc4[_0x8e928a]=_0x48de50[_0x8e928a]);}return!_0x31cdc4[_0x11c6cc(0xd6)]&&(_0x31cdc4['riskLevel']=DEFAULT_CONFIG_VALUES[_0x11c6cc(0xd6)]),_0x31cdc4;}async function runNonInteractive(_0x173d66,_0x4dc97d){const _0x282326=a25_0x775789,_0x1713b1=_0x173d66[_0x282326(0xc3)];if(!_0x1713b1)throw CliErrors['flagMissing'](_0x282326(0xc3),'Usage:\x20'+CLI_BIN_NAME+_0x282326(0x104));const _0x403304=resolveInitEnv(_0x173d66);await writeInitConfig(_0x4dc97d,{'appcode':_0x1713b1,'env':_0x403304},_0x173d66),console[_0x282326(0xff)](_0x282326(0xf1)+_0x4dc97d),console[_0x282326(0xff)](_0x282326(0x103)+_0x1713b1),console[_0x282326(0xff)](_0x282326(0xda)+_0x403304);}async function runInteractive(_0x4bf668,_0x3e1b7){const _0x309212=a25_0x775789,_0x4b96f5=loadExisting(_0x3e1b7),_0xe4a34=typeof _0x4b96f5?.[_0x309212(0xc3)]===_0x309212(0xf7)?_0x4b96f5[_0x309212(0xc3)]:'',_0x5bd96f=resolveInitEnv(_0x4bf668);console[_0x309212(0xff)](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG['newConfigFileName']+'\x0a');if(existsSync(_0x3e1b7)&&!_0x4bf668['yes']){const _0x500317=await promptYesNo(_0x309212(0xf6)+_0x3e1b7+_0x309212(0xd7),![]);if(!_0x500317){console['log'](_0x309212(0xc7));return;}}const _0xd9664b=typeof _0x4bf668[_0x309212(0xc3)]===_0x309212(0xf7)?_0x4bf668[_0x309212(0xc3)][_0x309212(0x105)]():'';let _0x49c55c=_0xd9664b;!_0x49c55c&&(_0x49c55c=await promptInput(_0x309212(0xe4),_0xe4a34));if(!_0x49c55c[_0x309212(0x105)]())throw CliErrors['validation'](_0x309212(0xf5));await writeInitConfig(_0x3e1b7,{'appcode':_0x49c55c[_0x309212(0x105)](),'env':_0x5bd96f},_0x4bf668),console['log']('\x0aInitialized\x20'+_0x3e1b7),console[_0x309212(0xff)]('\x20\x20appcode:\x20'+_0x49c55c[_0x309212(0x105)]()),console[_0x309212(0xff)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x5bd96f);}async function writeInitConfig(_0x187c61,_0x5c8dfc,_0x14a3ea){const _0x2136d0=a25_0x775789;let _0x579b5a={};existsSync(_0x187c61)&&!_0x14a3ea[_0x2136d0(0xf9)]&&(_0x579b5a=readConfigFile(_0x187c61));for(const [_0x56a736,_0x468b24]of Object[_0x2136d0(0xcb)](_0x5c8dfc)){_0x468b24!==undefined&&(_0x579b5a[_0x56a736]=_0x468b24);}if(_0x579b5a[_0x2136d0(0xf2)])delete _0x579b5a[_0x2136d0(0xf2)];writeConfigFile(_0x187c61,_0x579b5a);}class AbortPrompt extends Error{constructor(){const _0x26caa4=a25_0x775789;super(_0x26caa4(0xee)),this[_0x26caa4(0xdd)]=_0x26caa4(0xfe);}}function createSafeRl(){const _0x1fdfa3=a25_0x775789,_0x4a138f=createInterface({'input':process[_0x1fdfa3(0xea)],'output':process[_0x1fdfa3(0xca)]});let _0x22926b;const _0x118209=new Promise((_0x592258,_0x8b7221)=>{const _0x4818ed=_0x1fdfa3;_0x22926b=()=>{const _0x3addd3=a25_0x3e3e;_0x22926b&&(_0x4a138f['removeListener'](_0x3addd3(0xf8),_0x22926b),_0x22926b=undefined);try{_0x4a138f[_0x3addd3(0xe9)]();}catch{}_0x8b7221(new AbortPrompt());},_0x4a138f[_0x4818ed(0xde)](_0x4818ed(0xf8),_0x22926b);}),_0x54cce2=()=>{const _0x2a968b=_0x1fdfa3;_0x22926b&&(_0x4a138f[_0x2a968b(0xe8)](_0x2a968b(0xf8),_0x22926b),_0x22926b=undefined);try{_0x4a138f[_0x2a968b(0xe9)]();}catch{}};return{'rl':_0x4a138f,'abortPromise':_0x118209,'disposeSuccess':_0x54cce2};}async function promptInput(_0x4d0801,_0x33e7b8){const _0x4faf15=a25_0x775789,{rl:_0x1d6a00,abortPromise:_0x102a41,disposeSuccess:_0xfb356e}=createSafeRl(),_0x5eccf8=new Promise(_0xf5c4d5=>{const _0x3f08a1=a25_0x3e3e,_0x338d9a=_0x33e7b8?'\x20\x20'+_0x4d0801+'\x20('+_0x33e7b8+_0x3f08a1(0x100):'\x20\x20'+_0x4d0801+':\x20';_0x1d6a00[_0x3f08a1(0xfc)](_0x338d9a,_0x1b0b52=>{_0xfb356e(),_0xf5c4d5(_0x1b0b52['trim']()||_0x33e7b8);});});return Promise[_0x4faf15(0xe2)]([_0x5eccf8,_0x102a41]);}async function promptYesNo(_0x25db52,_0x3eafdf){const {rl:_0xbe971d,abortPromise:_0x11d8e5,disposeSuccess:_0xffe856}=createSafeRl(),_0x6c5a8b=new Promise(_0x1c2f74=>{const _0x3ef118=a25_0x3e3e,_0x2c0436=_0x3eafdf?'[Y/n]':_0x3ef118(0xfa);_0xbe971d[_0x3ef118(0xfc)]('\x20\x20'+_0x25db52+'\x20'+_0x2c0436+':\x20',_0x397032=>{const _0x11c9d5=_0x3ef118;_0xffe856();const _0xde28c8=_0x397032[_0x11c9d5(0x105)]()['toLowerCase']();if(_0xde28c8==='y'||_0xde28c8===_0x11c9d5(0xf9))_0x1c2f74(!![]);else{if(_0xde28c8==='n'||_0xde28c8==='no')_0x1c2f74(![]);else _0x1c2f74(_0x3eafdf);}});});return Promise['race']([_0x6c5a8b,_0x11d8e5]);}function loadExisting(_0x50c312){if(!existsSync(_0x50c312))return null;return readConfigFile(_0x50c312);}function resolveFilePath(_0x2e7d87){const _0xcc883c=a25_0x775789;return isAbsolute(_0x2e7d87)?_0x2e7d87:resolve(process[_0xcc883c(0xc9)](),_0x2e7d87);}function readSourceFile(_0x4b87d8){const _0x47ceda=a25_0x775789;try{const _0x22f066=readFileSync(_0x4b87d8,{'encoding':_0x47ceda(0x102)});return JSON['parse'](_0x22f066);}catch(_0x201ce3){throw CliErrors[_0x47ceda(0xcf)](_0x47ceda(0xfb)+_0x201ce3[_0x47ceda(0xe0)]);}}function resolveInitEnv(_0x515d43){const _0x328ecb=a25_0x775789,_0x5112b4=_0x515d43[_0x328ecb(0xed)];if(_0x5112b4===undefined||_0x5112b4==='')return DEFAULT_CONFIG_VALUES[_0x328ecb(0xed)];if(!RUNTIME_ENV_VALUES[_0x328ecb(0xec)](_0x5112b4))throw CliErrors[_0x328ecb(0xcf)](_0x328ecb(0x109)+_0x5112b4+_0x328ecb(0xce)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x5112b4;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a26_0x32d24c=a26_0x5936;(function(_0x2e2cc2,_0x1ace8d){const _0x48a9b4=a26_0x5936,_0x2c848a=_0x2e2cc2();while(!![]){try{const _0x347948=-parseInt(_0x48a9b4(0x93))/0x1+-parseInt(_0x48a9b4(0xa4))/0x2+-parseInt(_0x48a9b4(0xa2))/0x3*(parseInt(_0x48a9b4(0xb6))/0x4)+parseInt(_0x48a9b4(0x98))/0x5*(parseInt(_0x48a9b4(0x95))/0x6)+parseInt(_0x48a9b4(0x8e))/0x7+parseInt(_0x48a9b4(0xaf))/0x8*(parseInt(_0x48a9b4(0xbb))/0x9)+-parseInt(_0x48a9b4(0xad))/0xa;if(_0x347948===_0x1ace8d)break;else _0x2c848a['push'](_0x2c848a['shift']());}catch(_0x30e712){_0x2c848a['push'](_0x2c848a['shift']());}}}(a26_0x3da5,0xdb19d));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a26_0x32d24c(0x97),'type':a26_0x32d24c(0x9f),'required':!![],'description':a26_0x32d24c(0x87)},FILE_FLAG={'name':a26_0x32d24c(0x91),'type':a26_0x32d24c(0x9f),'required':!![],'description':'Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file'},QUERY_FLAG={'name':a26_0x32d24c(0xc0),'type':a26_0x32d24c(0x9f),'required':!![],'description':a26_0x32d24c(0xa7)},TOPK_FLAG={'name':a26_0x32d24c(0xbe),'type':a26_0x32d24c(0xb5),'description':a26_0x32d24c(0xaa)};function readKnowledgeFile(_0x5a65ba){const _0x2e9a46=a26_0x32d24c;if(!_0x5a65ba)throw CliErrors[_0x2e9a46(0xa6)](_0x2e9a46(0x8b));if(!existsSync(_0x5a65ba))throw CliErrors[_0x2e9a46(0xa6)](_0x2e9a46(0xba)+_0x5a65ba);if(!statSync(_0x5a65ba)['isFile']())throw CliErrors['validation']('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x5a65ba);return readFileSync(_0x5a65ba,_0x2e9a46(0xb3));}function summarizePersonalItem(_0x4af61a){const _0x32e03b=a26_0x32d24c;return{'id':_0x4af61a['id'],'title':_0x4af61a[_0x32e03b(0x97)],'version':_0x4af61a['version'],'ragStatus':_0x4af61a[_0x32e03b(0xb1)],'ragErrorMessage':_0x4af61a[_0x32e03b(0xbf)],'updateTime':_0x4af61a[_0x32e03b(0x9d)]};}function detailPersonalItem(_0xedd481){const _0x151e58=a26_0x32d24c;return{'id':_0xedd481['id'],'appCode':_0xedd481[_0x151e58(0xa5)],'scope':_0xedd481[_0x151e58(0x90)],'userId':_0xedd481['userId'],'title':_0xedd481[_0x151e58(0x97)],'content':_0xedd481[_0x151e58(0xa0)]??'','version':_0xedd481[_0x151e58(0x88)],'ragStatus':_0xedd481[_0x151e58(0xb1)],'ragErrorMessage':_0xedd481['ragErrorMessage'],'createTime':_0xedd481[_0x151e58(0x89)],'updateTime':_0xedd481[_0x151e58(0x9d)]};}function summarizeSearchHit(_0x44584c){const _0x4d320f=a26_0x32d24c;return{'scope':_0x44584c['scope'],'docId':_0x44584c[_0x4d320f(0xb2)],'score':_0x44584c[_0x4d320f(0xb9)],'weightedScore':_0x44584c[_0x4d320f(0xb0)],'content':_0x44584c[_0x4d320f(0xa0)],'metadata':_0x44584c['metadata']};}function readTopK(_0x3bfa51){const _0x4ec442=a26_0x32d24c,_0x3b1235=_0x3bfa51[_0x4ec442(0x96)]('topk');if(_0x3b1235===undefined||_0x3b1235===null||_0x3b1235==='')return undefined;const _0x504457=_0x3bfa51[_0x4ec442(0xa8)](_0x4ec442(0xbe));if(!Number[_0x4ec442(0xac)](_0x504457)||_0x504457<0x1)throw CliErrors[_0x4ec442(0xa6)]('--topk\x20must\x20be\x20a\x20positive\x20number.');return _0x504457;}function a26_0x5936(_0x188a3d,_0x158707){_0x188a3d=_0x188a3d-0x85;const _0x3da534=a26_0x3da5();let _0x59368e=_0x3da534[_0x188a3d];return _0x59368e;}function a26_0x3da5(){const _0x52a38a=['Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','list','Personal\x20knowledge-base\x20entry\x20title','version','createTime','body','File\x20path\x20is\x20required.','create','str','8608194eGQHvA','Search\x20query\x20is\x20required.','scope','file','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','428206aCyFvS','POST','259662fXkjLk','flag','title','135tjRWqJ','Updated\x20KB\x20entry\x20','read','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','trim','updateTime','bool','string','content','search','3621rNiOBp','Personal\x20knowledge-base\x20entry\x20ID','289790qupfhx','appCode','validation','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','num','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','Override\x20the\x20existing\x20entry\x20title','isFinite','1163160TObahb','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','1958064IvwKDT','weightedScore','ragStatus','docId','utf8','length','number','3500PYIRyP','write','verbose','score','File\x20not\x20found:\x20','9wHdvVW','Created\x20KB\x20entry\x20','map','topk','ragErrorMessage','query','description','update','build'];a26_0x3da5=function(){return _0x52a38a;};return a26_0x3da5();}const kbList={'service':'kb','command':a26_0x32d24c(0x86),'description':a26_0x32d24c(0xa9),'risk':a26_0x32d24c(0x9a),'flags':[VERBOSE_FLAG],async 'execute'(_0xae7e8a){const _0x3de2f3=a26_0x32d24c,_0x5aa159=await listPersonalKnowledgeBaseItems(_0xae7e8a['appCode']);if(_0xae7e8a[_0x3de2f3(0x9e)](_0x3de2f3(0xb8)))return{'ok':!![],'data':{'total':_0x5aa159['length'],'items':_0x5aa159}};return{'ok':!![],'data':{'total':_0x5aa159[_0x3de2f3(0xb4)],'items':_0x5aa159[_0x3de2f3(0xbd)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':'detail','description':a26_0x32d24c(0xae),'risk':a26_0x32d24c(0x9a),'flags':[{...ID_FLAG,'description':a26_0x32d24c(0xa3)}],async 'execute'(_0x3e05b5){const _0x7f25e9=a26_0x32d24c,_0x8cc780=await getPersonalKnowledgeBaseItem(_0x3e05b5['num']('id'),_0x3e05b5[_0x7f25e9(0xa5)]);return{'ok':!![],'data':detailPersonalItem(_0x8cc780)};}},kbCreate={'service':'kb','command':a26_0x32d24c(0x8c),'description':'Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','risk':'write','flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x57c800){const _0x58f99b=a26_0x32d24c,_0x20871b=_0x57c800[_0x58f99b(0x8d)](_0x58f99b(0x97)),_0x441967=readKnowledgeFile(_0x57c800['str']('file')),_0x28eec4=await createPersonalKnowledgeBaseItem(_0x57c800['appCode'],{'title':_0x20871b,'content':_0x441967});return{'ok':!![],'data':summarizePersonalItem(_0x28eec4),'message':_0x58f99b(0xbc)+_0x28eec4['id']+'\x20('+_0x28eec4[_0x58f99b(0x97)]+')'};},async 'dryRun'(_0x48c077){const _0x51e474=a26_0x32d24c,_0x411eca=_0x48c077[_0x51e474(0x8d)](_0x51e474(0x97)),_0x199fea=readKnowledgeFile(_0x48c077[_0x51e474(0x8d)]('file'));return dryRun('POST','/client/knowledge-base/personal/create')[_0x51e474(0x8a)]({'appCode':_0x48c077[_0x51e474(0xa5)],'title':_0x411eca,'content':_0x199fea})[_0x51e474(0xc1)](_0x51e474(0x85)+_0x411eca+'\x22')[_0x51e474(0xc3)]();}},kbUpdate={'service':'kb','command':a26_0x32d24c(0xc2),'description':a26_0x32d24c(0x9b),'risk':a26_0x32d24c(0xb7),'flags':[{...ID_FLAG,'description':a26_0x32d24c(0xa3)},{...TITLE_FLAG,'required':![],'description':a26_0x32d24c(0xab)},FILE_FLAG],async 'execute'(_0x4a1abc){const _0x2e9211=a26_0x32d24c,_0x589126=_0x4a1abc['num']('id'),_0x5b27a1=readKnowledgeFile(_0x4a1abc[_0x2e9211(0x8d)](_0x2e9211(0x91))),_0x4da178=_0x4a1abc['str'](_0x2e9211(0x97))||(await getPersonalKnowledgeBaseItem(_0x589126,_0x4a1abc['appCode']))['title'],_0x1ee00f=await updatePersonalKnowledgeBaseItem(_0x589126,_0x4a1abc[_0x2e9211(0xa5)],{'title':_0x4da178,'content':_0x5b27a1});return{'ok':!![],'data':summarizePersonalItem(_0x1ee00f),'message':_0x2e9211(0x99)+_0x1ee00f['id']+'\x20('+_0x1ee00f[_0x2e9211(0x97)]+')'};},async 'dryRun'(_0x486266){const _0x415426=a26_0x32d24c,_0x40efa3=_0x486266[_0x415426(0xa8)]('id'),_0x264dbb=readKnowledgeFile(_0x486266[_0x415426(0x8d)]('file')),_0x16e771=_0x486266[_0x415426(0x8d)](_0x415426(0x97))||(await getPersonalKnowledgeBaseItem(_0x40efa3,_0x486266[_0x415426(0xa5)]))['title'];return dryRun(_0x415426(0x94),'/client/knowledge-base/personal/'+_0x40efa3+'/update')['body']({'appCode':_0x486266[_0x415426(0xa5)],'title':_0x16e771,'content':_0x264dbb})[_0x415426(0xc1)]('Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20'+_0x40efa3)[_0x415426(0xc3)]();}},kbSearch={'service':'kb','command':a26_0x32d24c(0xa1),'description':a26_0x32d24c(0x92),'risk':'read','flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x1fa3e5){const _0xbb4c27=a26_0x32d24c;if(!_0x1fa3e5['str'](_0xbb4c27(0xc0))[_0xbb4c27(0x9c)]())throw CliErrors[_0xbb4c27(0xa6)](_0xbb4c27(0x8f));readTopK(_0x1fa3e5);},async 'execute'(_0x5e1699){const _0x16c916=a26_0x32d24c,_0x5cfa0a=_0x5e1699[_0x16c916(0x8d)](_0x16c916(0xc0))['trim'](),_0x3cf2f0=readTopK(_0x5e1699),_0x174fb9=await searchKnowledgeBase(_0x5e1699[_0x16c916(0xa5)],{'query':_0x5cfa0a,'topK':_0x3cf2f0});return{'ok':!![],'data':{'total':_0x174fb9[_0x16c916(0xb4)],'hits':_0x174fb9['map'](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|