@lovrabet/lovrabet-cli 2.1.1 → 2.1.2-beta.1
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/cli-skill/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 -1
- 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 +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xcd2e45,_0x5a9ddd){const _0x38f2da=a15_0x1729,_0x3f8314=_0xcd2e45();while(!![]){try{const _0xf5d335=parseInt(_0x38f2da(0xa1))/0x1+-parseInt(_0x38f2da(0xaa))/0x2*(parseInt(_0x38f2da(0xa9))/0x3)+-parseInt(_0x38f2da(0x9e))/0x4+-parseInt(_0x38f2da(0xb3))/0x5*(parseInt(_0x38f2da(0xb1))/0x6)+-parseInt(_0x38f2da(0xa5))/0x7*(-parseInt(_0x38f2da(0xb2))/0x8)+-parseInt(_0x38f2da(0xa6))/0x9+parseInt(_0x38f2da(0xac))/0xa*(parseInt(_0x38f2da(0x9f))/0xb);if(_0xf5d335===_0x5a9ddd)break;else _0x3f8314['push'](_0x3f8314['shift']());}catch(_0x6cb42c){_0x3f8314['push'](_0x3f8314['shift']());}}}(a15_0x4240,0xc4022));import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG}from'../../constant/product.js';export{DEFAULT_APP_PROFILE_NAME,DEFAULT_CONFIG_VALUES}from'../../constant/defaults.js';export{RUNTIME_ENV_VALUES}from'../../constant/env.js';function a15_0x1729(_0x49a280,_0x3f479e){_0x49a280=_0x49a280-0x9e;const _0x4240dd=a15_0x4240();let _0x1729ed=_0x4240dd[_0x49a280];return _0x1729ed;}export{OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{isInProject}from'../../context.js';import{CliErrors}from'../../errors.js';export{buildAppProfileListFields,CONFIG_ENUM_VALUES,IMPORTABLE_RUNTIME_CONFIG_KEYS,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getConfigDefaultValue,getConfigEnumValues,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isLegacyCompatConfigKey,isTopLevelConfigKey}from'../../config/schema.js';export function resolveConfigScope(_0x34ae98){const _0x597981=a15_0x1729,{explicitGlobal:explicitGlobal=![],explicitProject:explicitProject=![],policy:_0x5d30dc}=_0x34ae98;if(explicitGlobal&&explicitProject)throw CliErrors[_0x597981(0xb0)](_0x597981(0xa4),'Use\x20only\x20one\x20config\x20scope\x20flag.');if(explicitGlobal)return'global';if(explicitProject)return'project';switch(_0x5d30dc){case _0x597981(0xa8):return _0x597981(0xa2);case'project-default':return _0x34ae98[_0x597981(0xab)]??isInProject()?'project':_0x597981(0xa2);case _0x597981(0xae):if(!(_0x34ae98[_0x597981(0xab)]??isInProject()))throw CliErrors['validation']('Not\x20inside\x20a\x20project\x20(no\x20'+PRODUCT_CONFIG['newConfigFileName']+_0x597981(0xad),'Add\x20--global\x20to\x20write\x20to\x20~/'+PRODUCT_CONFIG[_0x597981(0xb4)]+_0x597981(0xa7)+CLI_BIN_NAME+_0x597981(0xaf));return _0x597981(0xa3);}}function a15_0x4240(){const _0x16c704=['inProject','10740UHnxJJ','\x20found).','project-or-global-explicit','\x20init`\x20first.','validation','444IPqaYq','24JUVeWR','18970umSxcs','newConfigFileName','4947612yorFJG','34166qRhNBN','\x20(global)','569553owcstZ','global','project','Flags\x20--global\x20and\x20--project\x20are\x20mutually\x20exclusive.','767375yMCQos','7317486cGTfSy',',\x20or\x20run\x20`','global-default','30861xJRMEi','214UOkJSv'];a15_0x4240=function(){return _0x16c704;};return a15_0x4240();}export function toScopeFlags(_0x2be6e6){const _0xedc724=a15_0x1729;return{'global':_0x2be6e6===_0xedc724(0xa2)};}export function formatScopeLabel(_0x1402a7){const _0x29f2f5=a15_0x1729;return _0x1402a7===_0x29f2f5(0xa2)?_0x29f2f5(0xa0):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x44cafe,_0x4c4254){const _0x3b51c7=a16_0x4a5c,_0x22c566=_0x44cafe();while(!![]){try{const _0x55dfa8=parseInt(_0x3b51c7(0x170))/0x1+parseInt(_0x3b51c7(0x17c))/0x2*(-parseInt(_0x3b51c7(0x173))/0x3)+parseInt(_0x3b51c7(0x168))/0x4*(-parseInt(_0x3b51c7(0x17a))/0x5)+parseInt(_0x3b51c7(0x172))/0x6+parseInt(_0x3b51c7(0x16e))/0x7+-parseInt(_0x3b51c7(0x166))/0x8+-parseInt(_0x3b51c7(0x164))/0x9*(parseInt(_0x3b51c7(0x16d))/0xa);if(_0x55dfa8===_0x4c4254)break;else _0x22c566['push'](_0x22c566['shift']());}catch(_0x4a0203){_0x22c566['push'](_0x22c566['shift']());}}}(a16_0xcbbe,0x65824));import{CliErrors}from'../../errors.js';function a16_0xcbbe(){const _0x55ffc7=['Use\x20only\x20one\x20of:\x20',',\x20got\x20\x22','85NvaFAa','\x20are\x20mutually\x20exclusive\x20for\x20`','4Bmdudy','\x20is\x20allowed,\x20found:\x20','9KWuIBX','filter','4464952UsPbse','Exactly\x20one\x20of\x20','77524bInHsd','Provide\x20one\x20of:\x20','length','map',':\x20expected\x20','3292950dasoQP','5574289SxTUED','join','459715eTtraM','\x20is\x20required\x20for\x20`','4493922iqlyFk','558537Sftbjw','Remove\x20all\x20but\x20one.','At\x20least\x20one\x20of\x20','validation','flag'];a16_0xcbbe=function(){return _0x55ffc7;};return a16_0xcbbe();}function isSet(_0x4434bd,_0x1cccca){const _0x315a30=a16_0x4a5c,_0x4a1c46=_0x4434bd[_0x315a30(0x177)](_0x1cccca);return _0x4a1c46!==undefined&&_0x4a1c46!==''&&_0x4a1c46!==![]&&_0x4a1c46!==0x0;}function fmtNames(_0x28f85a){const _0x16a1ae=a16_0x4a5c;return _0x28f85a[_0x16a1ae(0x16b)](_0x1a91a6=>'--'+_0x1a91a6)[_0x16a1ae(0x16f)](',\x20');}export function requireOneOf(_0x46abc3,_0x1f8462,_0x32ffff){const _0x34aec6=a16_0x4a5c,_0x2b16ff=_0x1f8462[_0x34aec6(0x165)](_0x4a3000=>isSet(_0x46abc3,_0x4a3000));if(_0x2b16ff['length']!==0x1)throw CliErrors[_0x34aec6(0x176)](_0x2b16ff[_0x34aec6(0x16a)]===0x0?_0x34aec6(0x167)+fmtNames(_0x1f8462)+_0x34aec6(0x171)+_0x32ffff+'`.':'Only\x20one\x20of\x20'+fmtNames(_0x1f8462)+_0x34aec6(0x17d)+fmtNames(_0x2b16ff)+'.',_0x2b16ff[_0x34aec6(0x16a)]===0x0?_0x34aec6(0x169)+fmtNames(_0x1f8462):_0x34aec6(0x174));}export function requireAnyOf(_0x3f5bde,_0x294ac4,_0x40d7f9){const _0x4041c1=a16_0x4a5c;if(!_0x294ac4['some'](_0x1e47d9=>isSet(_0x3f5bde,_0x1e47d9)))throw CliErrors['validation'](_0x4041c1(0x175)+fmtNames(_0x294ac4)+_0x4041c1(0x171)+_0x40d7f9+'`.',_0x4041c1(0x169)+fmtNames(_0x294ac4));}function a16_0x4a5c(_0x32d15d,_0x401e30){_0x32d15d=_0x32d15d-0x164;const _0xcbbeef=a16_0xcbbe();let _0x4a5cd2=_0xcbbeef[_0x32d15d];return _0x4a5cd2;}export function mutuallyExclusive(_0x2315ca,_0x484285,_0x58f8e5){const _0x3fa7eb=a16_0x4a5c,_0x6a4fa0=_0x484285[_0x3fa7eb(0x165)](_0x377c01=>isSet(_0x2315ca,_0x377c01));if(_0x6a4fa0[_0x3fa7eb(0x16a)]>0x1)throw CliErrors[_0x3fa7eb(0x176)]('Flags\x20'+fmtNames(_0x6a4fa0)+_0x3fa7eb(0x17b)+_0x58f8e5+'`.',_0x3fa7eb(0x178)+fmtNames(_0x484285));}export function validatePattern(_0x1c89fc,_0x238cfb,_0x3a02db,_0xce8818){const _0xb4f3e0=a16_0x4a5c,_0x2812b5=_0x1c89fc['str'](_0x238cfb);if(_0x2812b5&&!_0x3a02db['test'](_0x2812b5))throw CliErrors[_0xb4f3e0(0x176)]('Invalid\x20--'+_0x238cfb+_0xb4f3e0(0x16c)+_0xce8818+_0xb4f3e0(0x179)+_0x2812b5+'\x22.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a17_0x20b8b9=a17_0xc06b;(function(_0x588bc7,_0x589ba6){const _0x2d53a2=a17_0xc06b,_0x2fb35b=_0x588bc7();while(!![]){try{const _0x334be4=parseInt(_0x2d53a2(0x1a6))/0x1+parseInt(_0x2d53a2(0x19d))/0x2*(-parseInt(_0x2d53a2(0x1a5))/0x3)+-parseInt(_0x2d53a2(0x1ae))/0x4*(-parseInt(_0x2d53a2(0x1a2))/0x5)+parseInt(_0x2d53a2(0x19a))/0x6*(-parseInt(_0x2d53a2(0x1ad))/0x7)+parseInt(_0x2d53a2(0x19b))/0x8*(parseInt(_0x2d53a2(0x1a4))/0x9)+-parseInt(_0x2d53a2(0x1b0))/0xa*(parseInt(_0x2d53a2(0x19e))/0xb)+parseInt(_0x2d53a2(0x1a9))/0xc;if(_0x334be4===_0x589ba6)break;else _0x2fb35b['push'](_0x2fb35b['shift']());}catch(_0x4d2e0f){_0x2fb35b['push'](_0x2fb35b['shift']());}}}(a17_0x7724,0x85c52));function a17_0x7724(){const _0x1be29a=['number','360vAEwaz','406029uOTlkb','111566eYkWTF','verbose','string','12647676hSbwVY','sqlcode','boolean','Resource\x20name\x20for\x20lookup','168McAChI','844684DqxgmV','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','70sBZtpu','code','Dataset\x20code\x20(32-char\x20hex\x20UUID)','49722ANAkGf','144112EpszPJ','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','16KmyEpu','1416217pHsbUn','params','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','Return\x20full\x20raw\x20response\x20object','20NRIwxB'];a17_0x7724=function(){return _0x1be29a;};return a17_0x7724();}export const CODE_FLAG={'name':a17_0x20b8b9(0x198),'type':a17_0x20b8b9(0x1a8),'required':!![],'description':a17_0x20b8b9(0x199),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':'a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)'}};export const SQLCODE_FLAG={'name':a17_0x20b8b9(0x1aa),'type':'string','required':!![],'description':a17_0x20b8b9(0x19c),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a17_0x20b8b9(0x1a0)}};export const VERBOSE_FLAG={'name':a17_0x20b8b9(0x1a7),'type':a17_0x20b8b9(0x1ab),'description':a17_0x20b8b9(0x1a1)};function a17_0xc06b(_0x41669d,_0x47c05a){_0x41669d=_0x41669d-0x198;const _0x7724db=a17_0x7724();let _0xc06bf4=_0x7724db[_0x41669d];return _0xc06bf4;}export const PARAMS_FLAG={'name':a17_0x20b8b9(0x19f),'type':a17_0x20b8b9(0x1a8),'description':a17_0x20b8b9(0x1af)};export const NAME_FLAG={'name':'name','type':a17_0x20b8b9(0x1a8),'description':a17_0x20b8b9(0x1ac)};export const ID_FLAG={'name':'id','type':a17_0x20b8b9(0x1a3),'required':!![],'description':'Resource\x20ID'};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a18_0x550f8f=a18_0x4078;(function(_0x790151,_0x1e681c){const _0x1c222b=a18_0x4078,_0x46b227=_0x790151();while(!![]){try{const _0x426b25=-parseInt(_0x1c222b(0x150))/0x1*(parseInt(_0x1c222b(0x171))/0x2)+-parseInt(_0x1c222b(0x156))/0x3*(-parseInt(_0x1c222b(0x16c))/0x4)+-parseInt(_0x1c222b(0x186))/0x5+-parseInt(_0x1c222b(0x14a))/0x6*(-parseInt(_0x1c222b(0x161))/0x7)+parseInt(_0x1c222b(0x168))/0x8*(-parseInt(_0x1c222b(0x181))/0x9)+-parseInt(_0x1c222b(0x184))/0xa+-parseInt(_0x1c222b(0x185))/0xb*(-parseInt(_0x1c222b(0x146))/0xc);if(_0x426b25===_0x1e681c)break;else _0x46b227['push'](_0x46b227['shift']());}catch(_0x2ee64c){_0x46b227['push'](_0x46b227['shift']());}}}(a18_0x22ea,0x8a46d));import{CliErrors}from'../../errors.js';function a18_0x22ea(){const _0x2aeda5=['includes','Missing\x20key\x20or\x20value.','appcode','\x20\x20global:\x20\x20','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','value','Top-level\x20key\x20\x22','\x20config\x20get\x20<key>','\x22.\x20Allowed:\x20','stringify','\x20\x20project:\x20','Set\x20`','trim','pretty','193761yEkItf','Usage:\x20','log','9052750FElQaT','2527976qYqjxW','4289030RPZmbu','Missing\x20key\x20argument.','validation','\x22\x20not\x20found\x20at\x20top\x20level.','global','boolean','144rvRKTV','isArray','Key\x20not\x20found:\x20','Write\x20to\x20global\x20config','498KQUEKU','../../context.js','\x20(global)','pageSize\x20must\x20be\x20a\x20positive\x20number','apps','read','2xZTlwL','Set\x20a\x20config\x20value','bool','field','length','project-or-global-explicit','3319551QqHOTo','List\x20current\x20config','raw','list','(none)','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','format','alias','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','config','args','812zWgBWx','Invalid\x20value\x20for\x20\x22','object','\x20config\x20delete\x20<key>\x20[--global]','Deleted\x20`','`\x20=\x20\x22','Delete\x20a\x20config\x20value','232PIuKOa','\x20config\x20set\x20<key>\x20<value>\x20[--global]','Config\x20files:\x0a','Value\x20to\x20assign','4yGSMWE','pageSize','split','riskLevel','\x22\x20is\x20not\x20settable.','920134EdBqRu','key'];a18_0x22ea=function(){return _0x2aeda5;};return a18_0x22ea();}import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';function a18_0x4078(_0x20c29b,_0x3fa9cf){_0x20c29b=_0x20c29b-0x141;const _0x22ea8e=a18_0x22ea();let _0x40788b=_0x22ea8e[_0x20c29b];return _0x40788b;}import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':a18_0x550f8f(0x144),'type':a18_0x550f8f(0x145),'description':a18_0x550f8f(0x149),'default':![]};function parseAliasAppcodeSetKey(_0x2ed279){const _0x14c4fe=a18_0x550f8f,_0x20defa=_0x2ed279[_0x14c4fe(0x16e)]('.');if(_0x20defa[_0x14c4fe(0x154)]!==0x3||_0x20defa[0x0]!==_0x14c4fe(0x14e)||_0x20defa[0x2]!=='appcode')return undefined;const _0x2691f1=_0x20defa[0x1]?.[_0x14c4fe(0x17f)]();return _0x2691f1?_0x2691f1:undefined;}function parseAliasDeleteKey(_0x1db415){const _0x528a71=a18_0x550f8f,_0x59b0b3=_0x1db415[_0x528a71(0x16e)]('.');if(_0x59b0b3['length']===0x2&&_0x59b0b3[0x0]===_0x528a71(0x14e)){const _0x4b58f0=_0x59b0b3[0x1]?.[_0x528a71(0x17f)]();return _0x4b58f0?{'alias':_0x4b58f0}:undefined;}if(_0x59b0b3[_0x528a71(0x154)]===0x3&&_0x59b0b3[0x0]==='apps'&&_0x59b0b3[0x2]==='appcode'){const _0x398e3d=_0x59b0b3[0x1]?.[_0x528a71(0x17f)]();return _0x398e3d?{'alias':_0x398e3d,'field':_0x528a71(0x175)}:undefined;}return undefined;}function setLocalAppAlias(_0x5c6161,_0x508755,_0xc0fcc4){const _0x4ec0ff=a18_0x550f8f,_0x4c5936=_0x5c6161['apps']&&typeof _0x5c6161['apps']===_0x4ec0ff(0x163)&&!Array[_0x4ec0ff(0x147)](_0x5c6161[_0x4ec0ff(0x14e)])?_0x5c6161[_0x4ec0ff(0x14e)]:{},_0x3006b8=_0x4c5936[_0x508755]&&typeof _0x4c5936[_0x508755]===_0x4ec0ff(0x163)&&!Array[_0x4ec0ff(0x147)](_0x4c5936[_0x508755])?_0x4c5936[_0x508755]:{};_0x3006b8[_0x4ec0ff(0x175)]=_0xc0fcc4,_0x4c5936[_0x508755]=_0x3006b8,_0x5c6161[_0x4ec0ff(0x14e)]=_0x4c5936;}function deleteLocalAppAlias(_0x13bbbc,_0x9ce8c6){const _0x4d87b6=a18_0x550f8f;if(!_0x13bbbc[_0x4d87b6(0x14e)]||typeof _0x13bbbc['apps']!==_0x4d87b6(0x163)||Array[_0x4d87b6(0x147)](_0x13bbbc['apps']))return![];const _0x52fa26=_0x13bbbc['apps'],_0x1bf4fa=_0x52fa26[_0x9ce8c6[_0x4d87b6(0x15d)]];if(!_0x1bf4fa||typeof _0x1bf4fa!==_0x4d87b6(0x163)||Array[_0x4d87b6(0x147)](_0x1bf4fa))return![];if(!_0x9ce8c6[_0x4d87b6(0x153)])return delete _0x52fa26[_0x9ce8c6['alias']],!![];if(!(_0x9ce8c6[_0x4d87b6(0x153)]in _0x1bf4fa))return![];return delete _0x1bf4fa[_0x9ce8c6['field']],Object['keys'](_0x1bf4fa)[_0x4d87b6(0x154)]===0x0&&delete _0x52fa26[_0x9ce8c6[_0x4d87b6(0x15d)]],!![];}const listDef={'service':'config','command':a18_0x550f8f(0x159),'description':a18_0x550f8f(0x157),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x363e46){const _0x33b347=a18_0x550f8f,{buildConfigFromFlags:_0x5d6134}=await import(_0x33b347(0x14b)),_0x1fc426=_0x5d6134({}),_0x2d0001=getProjectConfigPath(),_0x378be9=resolveWriteConfigPath('global');if(_0x363e46[_0x33b347(0x15c)]===_0x33b347(0x180))return{'ok':!![],'message':_0x33b347(0x177)+(JSON['stringify'](_0x1fc426[_0x33b347(0x158)],null,0x2)+'\x0a\x0a')+_0x33b347(0x16a)+(_0x33b347(0x17d)+(_0x2d0001??_0x33b347(0x15a))+'\x0a')+(_0x33b347(0x176)+_0x378be9)};return{'ok':!![],'data':{'effective':_0x1fc426[_0x33b347(0x158)],'configFiles':{'project':_0x2d0001??null,'global':_0x378be9}}};}},getDef={'service':a18_0x550f8f(0x15f),'command':'get','description':'Get\x20a\x20config\x20value','risk':a18_0x550f8f(0x14f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':a18_0x550f8f(0x15e),'required':!![]}],'flags':[],async 'execute'(_0x3c54c7){const _0x343053=a18_0x550f8f,_0x438cf0=_0x3c54c7[_0x343053(0x160)][0x0];if(!_0x438cf0)throw CliErrors[_0x343053(0x142)](_0x343053(0x141),_0x343053(0x182)+CLI_BIN_NAME+_0x343053(0x17a));const {buildConfigFromFlags:_0x2a5e10}=await import(_0x343053(0x14b)),{raw:_0x18952e}=_0x2a5e10({});if(_0x438cf0[_0x343053(0x173)]('.')){const _0x2d7822=_0x438cf0[_0x343053(0x16e)]('.');let _0x9a9d5b=_0x18952e;for(const _0x4df9b2 of _0x2d7822){if(_0x9a9d5b==null||typeof _0x9a9d5b!==_0x343053(0x163))throw CliErrors['validation'](_0x343053(0x148)+_0x438cf0);_0x9a9d5b=_0x9a9d5b[_0x4df9b2];}if(_0x9a9d5b===undefined)throw CliErrors[_0x343053(0x142)](_0x343053(0x148)+_0x438cf0);return console[_0x343053(0x183)](typeof _0x9a9d5b===_0x343053(0x163)?JSON[_0x343053(0x17c)](_0x9a9d5b,null,0x2):String(_0x9a9d5b)),{'ok':!![]};}const _0x34995b=_0x18952e[_0x438cf0];if(_0x34995b===undefined)throw CliErrors[_0x343053(0x142)](_0x343053(0x148)+_0x438cf0);return console['log'](typeof _0x34995b===_0x343053(0x163)?JSON[_0x343053(0x17c)](_0x34995b,null,0x2):String(_0x34995b)),{'ok':!![]};}},setDef={'service':'config','command':'set','description':a18_0x550f8f(0x151),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x550f8f(0x172),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a18_0x550f8f(0x178),'description':a18_0x550f8f(0x16b),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x3627cf){const _0x101421=a18_0x550f8f,_0x58e861=_0x3627cf[_0x101421(0x160)][0x0],_0x4e7422=_0x3627cf[_0x101421(0x160)][0x1];if(!_0x58e861||_0x4e7422===undefined)throw CliErrors[_0x101421(0x142)](_0x101421(0x174),_0x101421(0x182)+CLI_BIN_NAME+_0x101421(0x169));if(ENUM_KEYS[_0x58e861]&&!ENUM_KEYS[_0x58e861]['includes'](_0x4e7422))throw CliErrors[_0x101421(0x142)](_0x101421(0x162)+_0x58e861+_0x101421(0x17b)+ENUM_KEYS[_0x58e861]['join'](',\x20'));if(_0x58e861===_0x101421(0x16f))throw CliErrors[_0x101421(0x142)](_0x101421(0x15b));if(_0x58e861==='pageSize'){const _0x1e9a1b=Number(_0x4e7422);if(isNaN(_0x1e9a1b)||_0x1e9a1b<=0x0)throw CliErrors[_0x101421(0x142)](_0x101421(0x14d));}const _0x1bf772=resolveWriteScope({'explicitGlobal':_0x3627cf[_0x101421(0x152)](_0x101421(0x144)),'policy':_0x101421(0x155)}),_0x51c007=toScopeFlags(_0x1bf772),_0x59aef2=readScopedConfig(_0x51c007),_0x33bb82=parseAliasAppcodeSetKey(_0x58e861);if(!_0x33bb82&&!isTopLevelConfigKey(_0x58e861))throw CliErrors[_0x101421(0x142)](_0x101421(0x179)+_0x58e861+_0x101421(0x170),'Settable\x20keys:\x20'+getTopLevelConfigKeySummary()+';\x20apps.<alias>.appcode');return _0x33bb82?setLocalAppAlias(_0x59aef2,_0x33bb82,_0x4e7422):_0x59aef2[_0x58e861]=_0x58e861===_0x101421(0x16d)?Number(_0x4e7422):_0x4e7422,console['log'](_0x101421(0x17e)+_0x58e861+_0x101421(0x166)+_0x4e7422+'\x22'+(_0x1bf772===_0x101421(0x144)?'\x20(global)':'')),writeScopedConfig(_0x59aef2,_0x51c007),{'ok':!![]};}},deleteDef={'service':a18_0x550f8f(0x15f),'command':'delete','description':a18_0x550f8f(0x167),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x550f8f(0x172),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x370b4e){const _0x5f447a=a18_0x550f8f,_0x527fcf=_0x370b4e['args'][0x0];if(!_0x527fcf)throw CliErrors[_0x5f447a(0x142)](_0x5f447a(0x141),'Usage:\x20'+CLI_BIN_NAME+_0x5f447a(0x164));const _0xbe5439=resolveWriteScope({'explicitGlobal':_0x370b4e[_0x5f447a(0x152)](_0x5f447a(0x144)),'policy':_0x5f447a(0x155)}),_0x498d14=toScopeFlags(_0xbe5439),_0x328553=readScopedConfig(_0x498d14),_0x5a7d3a=parseAliasDeleteKey(_0x527fcf);if(_0x5a7d3a){if(!deleteLocalAppAlias(_0x328553,_0x5a7d3a))throw CliErrors[_0x5f447a(0x142)](_0x5f447a(0x148)+_0x527fcf);return console[_0x5f447a(0x183)](_0x5f447a(0x165)+_0x527fcf+'`'+(_0xbe5439===_0x5f447a(0x144)?_0x5f447a(0x14c):'')),writeScopedConfig(_0x328553,_0x498d14),{'ok':!![]};}if(_0x328553[_0x527fcf]===undefined)throw CliErrors[_0x5f447a(0x142)]('Key\x20\x22'+_0x527fcf+_0x5f447a(0x143));return delete _0x328553[_0x527fcf],console[_0x5f447a(0x183)](_0x5f447a(0x165)+_0x527fcf+'`'+(_0xbe5439===_0x5f447a(0x144)?_0x5f447a(0x14c):'')),writeScopedConfig(_0x328553,_0x498d14),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
1
|
+
const a18_0x37bb51=a18_0x3088;(function(_0x20f003,_0x113530){const _0x24a3fd=a18_0x3088,_0x14863c=_0x20f003();while(!![]){try{const _0x330b3a=parseInt(_0x24a3fd(0xd0))/0x1+parseInt(_0x24a3fd(0xab))/0x2*(parseInt(_0x24a3fd(0xa9))/0x3)+parseInt(_0x24a3fd(0xb9))/0x4*(-parseInt(_0x24a3fd(0x9d))/0x5)+parseInt(_0x24a3fd(0x95))/0x6*(parseInt(_0x24a3fd(0xcd))/0x7)+-parseInt(_0x24a3fd(0xa8))/0x8+-parseInt(_0x24a3fd(0x96))/0x9+-parseInt(_0x24a3fd(0xcb))/0xa;if(_0x330b3a===_0x113530)break;else _0x14863c['push'](_0x14863c['shift']());}catch(_0x1eee9e){_0x14863c['push'](_0x14863c['shift']());}}}(a18_0x4468,0x1d9a4));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':a18_0x37bb51(0x9c),'type':a18_0x37bb51(0xd9),'description':'Write\x20to\x20global\x20config','default':![]};function parseAliasAppcodeSetKey(_0x447648){const _0x456f9b=a18_0x37bb51,_0x567f86=_0x447648[_0x456f9b(0xd4)]('.');if(_0x567f86[_0x456f9b(0xb6)]!==0x3||_0x567f86[0x0]!==_0x456f9b(0x99)||_0x567f86[0x2]!==_0x456f9b(0x98))return undefined;const _0x3df129=_0x567f86[0x1]?.[_0x456f9b(0xca)]();return _0x3df129?_0x3df129:undefined;}function parseAliasDeleteKey(_0x3c5173){const _0x1759f1=a18_0x37bb51,_0x5f195a=_0x3c5173[_0x1759f1(0xd4)]('.');if(_0x5f195a[_0x1759f1(0xb6)]===0x2&&_0x5f195a[0x0]===_0x1759f1(0x99)){const _0x43df90=_0x5f195a[0x1]?.['trim']();return _0x43df90?{'alias':_0x43df90}:undefined;}if(_0x5f195a['length']===0x3&&_0x5f195a[0x0]==='apps'&&_0x5f195a[0x2]===_0x1759f1(0x98)){const _0x5c1ad8=_0x5f195a[0x1]?.[_0x1759f1(0xca)]();return _0x5c1ad8?{'alias':_0x5c1ad8,'field':_0x1759f1(0x98)}:undefined;}return undefined;}function a18_0x3088(_0x278455,_0xab32ef){_0x278455=_0x278455-0x95;const _0x4468e2=a18_0x4468();let _0x3088e4=_0x4468e2[_0x278455];return _0x3088e4;}function setLocalAppAlias(_0x2ff8f8,_0x525174,_0x1c443d){const _0x3beb90=a18_0x37bb51,_0x39dfce=_0x2ff8f8[_0x3beb90(0x99)]&&typeof _0x2ff8f8[_0x3beb90(0x99)]===_0x3beb90(0x97)&&!Array[_0x3beb90(0xba)](_0x2ff8f8[_0x3beb90(0x99)])?_0x2ff8f8[_0x3beb90(0x99)]:{},_0xc6a734=_0x39dfce[_0x525174]&&typeof _0x39dfce[_0x525174]===_0x3beb90(0x97)&&!Array[_0x3beb90(0xba)](_0x39dfce[_0x525174])?_0x39dfce[_0x525174]:{};_0xc6a734['appcode']=_0x1c443d,_0x39dfce[_0x525174]=_0xc6a734,_0x2ff8f8[_0x3beb90(0x99)]=_0x39dfce;}function a18_0x4468(){const _0x292b4d=['trim','621290GfWEEz','../../context.js','1631756NEXdaL','Top-level\x20key\x20\x22','Invalid\x20value\x20for\x20\x22','162172WkmzKA','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','read','Delete\x20a\x20config\x20value','split','(none)','value','Config\x20files:\x0a','\x22\x20is\x20not\x20settable.','boolean','\x20\x20global:\x20\x20','\x20config\x20get\x20<key>','format','6BQwplN','1400400EvUjZy','object','appcode','apps','\x20config\x20set\x20<key>\x20<value>\x20[--global]','Usage:\x20','global','10OoDVVs','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','\x22.\x20Allowed:\x20','\x22\x20not\x20found\x20at\x20top\x20level.','Key\x20not\x20found:\x20','project-or-global-explicit','stringify','Missing\x20key\x20or\x20value.',';\x20apps.<alias>.appcode','\x20(global)','alias','1166520OyJAaT','1656sTfHgc','config','782hFoJiT','field','Settable\x20keys:\x20','raw','validation','write','Deleted\x20`','get','`\x20=\x20\x22','keys','Missing\x20key\x20argument.','length','pageSize\x20must\x20be\x20a\x20positive\x20number','set','252632YAGWAk','isArray','Get\x20a\x20config\x20value','log','\x20\x20project:\x20','Value\x20to\x20assign','bool','pretty','List\x20current\x20config','Key\x20\x22','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','includes','args','pageSize','Set\x20a\x20config\x20value','Set\x20`','key'];a18_0x4468=function(){return _0x292b4d;};return a18_0x4468();}function deleteLocalAppAlias(_0x5e665e,_0x4d1de7){const _0x287229=a18_0x37bb51;if(!_0x5e665e[_0x287229(0x99)]||typeof _0x5e665e[_0x287229(0x99)]!==_0x287229(0x97)||Array[_0x287229(0xba)](_0x5e665e[_0x287229(0x99)]))return![];const _0x3b6437=_0x5e665e[_0x287229(0x99)],_0x58cbaa=_0x3b6437[_0x4d1de7['alias']];if(!_0x58cbaa||typeof _0x58cbaa!==_0x287229(0x97)||Array[_0x287229(0xba)](_0x58cbaa))return![];if(!_0x4d1de7[_0x287229(0xac)])return delete _0x3b6437[_0x4d1de7[_0x287229(0xa7)]],!![];if(!(_0x4d1de7[_0x287229(0xac)]in _0x58cbaa))return![];return delete _0x58cbaa[_0x4d1de7['field']],Object[_0x287229(0xb4)](_0x58cbaa)['length']===0x0&&delete _0x3b6437[_0x4d1de7[_0x287229(0xa7)]],!![];}const listDef={'service':a18_0x37bb51(0xaa),'command':'list','description':a18_0x37bb51(0xc1),'risk':a18_0x37bb51(0xd2),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x4c7eb1){const _0x3bca54=a18_0x37bb51,{buildConfigFromFlags:_0x503b9a}=await import(_0x3bca54(0xcc)),_0xd4574e=_0x503b9a({}),_0xd9a24a=getProjectConfigPath(),_0x38944b=resolveWriteConfigPath(_0x3bca54(0x9c));if(_0x4c7eb1[_0x3bca54(0xdc)]===_0x3bca54(0xc0))return{'ok':!![],'message':_0x3bca54(0x9e)+(JSON[_0x3bca54(0xa3)](_0xd4574e['raw'],null,0x2)+'\x0a\x0a')+_0x3bca54(0xd7)+(_0x3bca54(0xbd)+(_0xd9a24a??_0x3bca54(0xd5))+'\x0a')+(_0x3bca54(0xda)+_0x38944b)};return{'ok':!![],'data':{'effective':_0xd4574e[_0x3bca54(0xae)],'configFiles':{'project':_0xd9a24a??null,'global':_0x38944b}}};}},getDef={'service':a18_0x37bb51(0xaa),'command':a18_0x37bb51(0xb2),'description':a18_0x37bb51(0xbb),'risk':a18_0x37bb51(0xd2),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x37bb51(0xc9),'description':a18_0x37bb51(0xc3),'required':!![]}],'flags':[],async 'execute'(_0x10e6b3){const _0x484136=a18_0x37bb51,_0x22c93a=_0x10e6b3[_0x484136(0xc5)][0x0];if(!_0x22c93a)throw CliErrors[_0x484136(0xaf)](_0x484136(0xb5),_0x484136(0x9b)+CLI_BIN_NAME+_0x484136(0xdb));const {buildConfigFromFlags:_0x274fd4}=await import(_0x484136(0xcc)),{raw:_0x40006b}=_0x274fd4({});if(_0x22c93a[_0x484136(0xc4)]('.')){const _0x421da8=_0x22c93a[_0x484136(0xd4)]('.');let _0x585f06=_0x40006b;for(const _0xd2f11e of _0x421da8){if(_0x585f06==null||typeof _0x585f06!==_0x484136(0x97))throw CliErrors[_0x484136(0xaf)]('Key\x20not\x20found:\x20'+_0x22c93a);_0x585f06=_0x585f06[_0xd2f11e];}if(_0x585f06===undefined)throw CliErrors['validation'](_0x484136(0xa1)+_0x22c93a);return console['log'](typeof _0x585f06===_0x484136(0x97)?JSON['stringify'](_0x585f06,null,0x2):String(_0x585f06)),{'ok':!![]};}const _0x5c439f=_0x40006b[_0x22c93a];if(_0x5c439f===undefined)throw CliErrors[_0x484136(0xaf)]('Key\x20not\x20found:\x20'+_0x22c93a);return console[_0x484136(0xbc)](typeof _0x5c439f===_0x484136(0x97)?JSON[_0x484136(0xa3)](_0x5c439f,null,0x2):String(_0x5c439f)),{'ok':!![]};}},setDef={'service':a18_0x37bb51(0xaa),'command':a18_0x37bb51(0xb8),'description':a18_0x37bb51(0xc7),'risk':a18_0x37bb51(0xb0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x37bb51(0xc9),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a18_0x37bb51(0xd6),'description':a18_0x37bb51(0xbe),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x563dd3){const _0x45b111=a18_0x37bb51,_0x3d0b0d=_0x563dd3[_0x45b111(0xc5)][0x0],_0x25f93a=_0x563dd3[_0x45b111(0xc5)][0x1];if(!_0x3d0b0d||_0x25f93a===undefined)throw CliErrors[_0x45b111(0xaf)](_0x45b111(0xa4),_0x45b111(0x9b)+CLI_BIN_NAME+_0x45b111(0x9a));if(ENUM_KEYS[_0x3d0b0d]&&!ENUM_KEYS[_0x3d0b0d][_0x45b111(0xc4)](_0x25f93a))throw CliErrors[_0x45b111(0xaf)](_0x45b111(0xcf)+_0x3d0b0d+_0x45b111(0x9f)+ENUM_KEYS[_0x3d0b0d]['join'](',\x20'));if(_0x3d0b0d==='riskLevel')throw CliErrors[_0x45b111(0xaf)](_0x45b111(0xd1));if(_0x3d0b0d===_0x45b111(0xc6)){const _0x488484=Number(_0x25f93a);if(isNaN(_0x488484)||_0x488484<=0x0)throw CliErrors[_0x45b111(0xaf)](_0x45b111(0xb7));}const _0x459004=resolveWriteScope({'explicitGlobal':_0x563dd3[_0x45b111(0xbf)](_0x45b111(0x9c)),'policy':_0x45b111(0xa2)}),_0x3e87e=toScopeFlags(_0x459004),_0x53a9c8=readScopedConfig(_0x3e87e),_0x280414=parseAliasAppcodeSetKey(_0x3d0b0d);if(!_0x280414&&!isTopLevelConfigKey(_0x3d0b0d))throw CliErrors[_0x45b111(0xaf)](_0x45b111(0xce)+_0x3d0b0d+_0x45b111(0xd8),_0x45b111(0xad)+getTopLevelConfigKeySummary()+_0x45b111(0xa5));return _0x280414?setLocalAppAlias(_0x53a9c8,_0x280414,_0x25f93a):_0x53a9c8[_0x3d0b0d]=_0x3d0b0d===_0x45b111(0xc6)?Number(_0x25f93a):_0x25f93a,console[_0x45b111(0xbc)](_0x45b111(0xc8)+_0x3d0b0d+_0x45b111(0xb3)+_0x25f93a+'\x22'+(_0x459004===_0x45b111(0x9c)?'\x20(global)':'')),writeScopedConfig(_0x53a9c8,_0x3e87e),{'ok':!![]};}},deleteDef={'service':'config','command':'delete','description':a18_0x37bb51(0xd3),'risk':a18_0x37bb51(0xb0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x534179){const _0x875d22=a18_0x37bb51,_0x1f67ac=_0x534179[_0x875d22(0xc5)][0x0];if(!_0x1f67ac)throw CliErrors[_0x875d22(0xaf)](_0x875d22(0xb5),'Usage:\x20'+CLI_BIN_NAME+'\x20config\x20delete\x20<key>\x20[--global]');const _0x46b0d1=resolveWriteScope({'explicitGlobal':_0x534179[_0x875d22(0xbf)](_0x875d22(0x9c)),'policy':_0x875d22(0xa2)}),_0x2f0236=toScopeFlags(_0x46b0d1),_0x30e3dc=readScopedConfig(_0x2f0236),_0x58f583=parseAliasDeleteKey(_0x1f67ac);if(_0x58f583){if(!deleteLocalAppAlias(_0x30e3dc,_0x58f583))throw CliErrors[_0x875d22(0xaf)]('Key\x20not\x20found:\x20'+_0x1f67ac);return console[_0x875d22(0xbc)]('Deleted\x20`'+_0x1f67ac+'`'+(_0x46b0d1===_0x875d22(0x9c)?'\x20(global)':'')),writeScopedConfig(_0x30e3dc,_0x2f0236),{'ok':!![]};}if(_0x30e3dc[_0x1f67ac]===undefined)throw CliErrors[_0x875d22(0xaf)](_0x875d22(0xc2)+_0x1f67ac+_0x875d22(0xa0));return delete _0x30e3dc[_0x1f67ac],console[_0x875d22(0xbc)](_0x875d22(0xb1)+_0x1f67ac+'`'+(_0x46b0d1===_0x875d22(0x9c)?_0x875d22(0xa6):'')),writeScopedConfig(_0x30e3dc,_0x2f0236),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x157be0,_0x4751b1){var _0x205c59=a19_0xeafd,_0x17c195=_0x157be0();while(!![]){try{var _0x357112=parseInt(_0x205c59(0x100))/0x1*(-parseInt(_0x205c59(0xfb))/0x2)+-parseInt(_0x205c59(0xf9))/0x3*(parseInt(_0x205c59(0xfc))/0x4)+-parseInt(_0x205c59(0xfe))/0x5+parseInt(_0x205c59(0xff))/0x6+parseInt(_0x205c59(0xfd))/0x7+parseInt(_0x205c59(0x101))/0x8+-parseInt(_0x205c59(0xfa))/0x9*(-parseInt(_0x205c59(0x102))/0xa);if(_0x357112===_0x4751b1)break;else _0x17c195['push'](_0x17c195['shift']());}catch(_0xf563cf){_0x17c195['push'](_0x17c195['shift']());}}}(a19_0x955f,0xc9e22));function a19_0xeafd(_0x41fb7f,_0x276cfd){_0x41fb7f=_0x41fb7f-0xf9;var _0x955fe5=a19_0x955f();var _0xeafdeb=_0x955fe5[_0x41fb7f];return _0xeafdeb;}import{CLI_BIN_NAME}from'../../constant/cli.js';function a19_0x955f(){var _0x3cb520=['9990435omsOgL','4120655dHeRzQ','3653322GwVtxO','1203756kRxSkA','1044584sLJtIT','412500xhLzWr','3NZTrzW','198bkXJvf','2XLAowQ','877456tKDtYm'];a19_0x955f=function(){return _0x3cb520;};return a19_0x955f();}export{CLI_BIN_NAME};export{readScopedConfig,writeScopedConfig}from'../../context.js';export{resolveConfigScope as resolveWriteScope,TOP_LEVEL_CONFIG_KEYS as TOP_LEVEL_KEYS,CONFIG_ENUM_VALUES as ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey,toScopeFlags}from'../../commands/common/config-policy.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a20_0x21a95c=a20_0x2c8d;(function(_0xdaca1a,_0x236220){const _0x286102=a20_0x2c8d,_0x117496=_0xdaca1a();while(!![]){try{const _0x5ecc43=parseInt(_0x286102(0x114))/0x1+parseInt(_0x286102(0xfc))/0x2+-parseInt(_0x286102(0x10c))/0x3+-parseInt(_0x286102(0xf3))/0x4*(-parseInt(_0x286102(0xf8))/0x5)+-parseInt(_0x286102(0x10d))/0x6+-parseInt(_0x286102(0x116))/0x7*(-parseInt(_0x286102(0x130))/0x8)+-parseInt(_0x286102(0x106))/0x9*(parseInt(_0x286102(0x138))/0xa);if(_0x5ecc43===_0x236220)break;else _0x117496['push'](_0x117496['shift']());}catch(_0xb63c80){_0x117496['push'](_0x117496['shift']());}}}(a20_0x3655,0x83be3));function a20_0x3655(){const _0x383a94=['read','update','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','\x20\x20\x20\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}','Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','helpExtra','str','POST','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','data','create','Update\x20an\x20existing\x20record','data\x20','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','map','\x20\x20WHERE\x20OPERATORS','\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','paramsRequired','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','8MDHOLE','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','risk','\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}}','Preview:\x20data\x20','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','\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}}','10JLGzdS','Get\x20a\x20single\x20record\x20by\x20ID','command','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','delete','\x20\x20EXAMPLES','\x20\x20PAGINATION','write','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','Filter\x20dataset\x20records\x20with\x20query\x20conditions','\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}}','now','join','92DyAbPp','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','getOne','code','141285KMSBIX','\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}','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\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','816666QkTPAg','\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}}]','batchCreate','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\x20\x20AGGREGATE\x20TYPES','\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}}','filter','paramsHint','operation','build','5295033XTptAH','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','\x20\x20LOGICAL\x20COMBINATORS','\x20on\x20dataset\x20','\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','dryRun','1867629LxuWOH','3605472fNvzkP','aggregate','description','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','967266nAZzrH','params','2281307OuFBOA','\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}'];a20_0x3655=function(){return _0x383a94;};return a20_0x3655();}import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';function a20_0x2c8d(_0x2a19c3,_0x4239be){_0x2a19c3=_0x2a19c3-0xe6;const _0x365511=a20_0x3655();let _0x2c8d93=_0x365511[_0x2a19c3];return _0x2c8d93;}import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a20_0x21a95c(0x102),'operation':'filter','risk':'read','paramsRequired':![],'description':a20_0x21a95c(0xef),'paramsHint':a20_0x21a95c(0x12c)+a20_0x21a95c(0xfa),'helpExtra':[a20_0x21a95c(0x12a),a20_0x21a95c(0x12b),'\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}}',a20_0x21a95c(0x107),a20_0x21a95c(0x136),a20_0x21a95c(0x101),a20_0x21a95c(0xf0),'\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]}}',a20_0x21a95c(0x133),a20_0x21a95c(0x137),a20_0x21a95c(0x11a),'',a20_0x21a95c(0x108),'\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','\x20\x20\x20\x20$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}}]}','',a20_0x21a95c(0x120),a20_0x21a95c(0x127),a20_0x21a95c(0xed),'\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}]',a20_0x21a95c(0x128),'\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','',a20_0x21a95c(0xeb),a20_0x21a95c(0xee),a20_0x21a95c(0x12e),a20_0x21a95c(0x112)][a20_0x21a95c(0xf2)]('\x0a')},{'command':'getOne','operation':a20_0x21a95c(0xf6),'risk':a20_0x21a95c(0x118),'paramsRequired':!![],'description':a20_0x21a95c(0xe6),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a20_0x21a95c(0x122),'operation':a20_0x21a95c(0x122),'risk':'write','paramsRequired':!![],'description':a20_0x21a95c(0x110),'paramsHint':'JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27'},{'command':a20_0x21a95c(0xfe),'operation':a20_0x21a95c(0xfe),'risk':'write','paramsRequired':!![],'description':a20_0x21a95c(0xf4),'paramsHint':'JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27'},{'command':a20_0x21a95c(0x119),'operation':'update','risk':a20_0x21a95c(0xec),'paramsRequired':!![],'description':a20_0x21a95c(0x123),'paramsHint':a20_0x21a95c(0x126)},{'command':a20_0x21a95c(0xe9),'operation':'delete','risk':'high-risk-write','paramsRequired':!![],'description':a20_0x21a95c(0x111),'paramsHint':a20_0x21a95c(0xff)},{'command':a20_0x21a95c(0x10e),'operation':a20_0x21a95c(0x10e),'risk':a20_0x21a95c(0x118),'paramsRequired':![],'description':a20_0x21a95c(0x131),'paramsHint':a20_0x21a95c(0xe8)+a20_0x21a95c(0x11c),'helpExtra':[a20_0x21a95c(0x100),a20_0x21a95c(0x117),a20_0x21a95c(0x11b),a20_0x21a95c(0x12f),a20_0x21a95c(0xf9),a20_0x21a95c(0x125),'\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}','\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}','','\x20\x20PARAMS\x20STRUCTURE','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)',a20_0x21a95c(0x113),a20_0x21a95c(0xfd),a20_0x21a95c(0x135),'',a20_0x21a95c(0xea),'\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status',a20_0x21a95c(0xfb),'',a20_0x21a95c(0xf5),a20_0x21a95c(0x10a),'','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.'][a20_0x21a95c(0xf2)]('\x0a')}];function makeDataCommand(_0x1acbcc){const _0x1cc841=a20_0x21a95c,_0x874313=_0x1cc841(0x124)+_0x1acbcc[_0x1cc841(0xe7)],_0xbb86fd={'service':_0x1cc841(0x121),'command':_0x1acbcc[_0x1cc841(0xe7)],'description':_0x1acbcc[_0x1cc841(0x10f)],'risk':_0x1acbcc[_0x1cc841(0x132)],'helpExtra':_0x1acbcc[_0x1cc841(0x11d)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x1acbcc[_0x1cc841(0x103)]}],'validate':async _0x3cf6fc=>{const _0x168923=_0x1cc841;_0x1acbcc[_0x168923(0x12d)]&&requireAnyOf(_0x3cf6fc,['params'],_0x874313),_0x1acbcc[_0x168923(0x104)]==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x3cf6fc[_0x168923(0x11e)]('params')));},async 'execute'(_0x403fda){const _0xf7719=_0x1cc841,_0x44f0ed=_0x403fda['str'](_0xf7719(0xf7)),_0x4e3c91=_0x1acbcc[_0xf7719(0x104)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x403fda['str'](_0xf7719(0x115)))):parseJsonParams(_0x403fda[_0xf7719(0x11e)](_0xf7719(0x115)))??{},_0xc5a0d3=Date['now'](),_0xdc1eb9=await executeData(_0x44f0ed,_0x1acbcc[_0xf7719(0x104)],_0x4e3c91),_0x26d143=Date[_0xf7719(0xf1)]()-_0xc5a0d3;return{'ok':!![],'data':{'result':_0xdc1eb9,'elapsed':_0x26d143},'message':_0xf7719(0x124)+_0x1acbcc[_0xf7719(0xe7)]+'\x20completed\x20in\x20'+_0x26d143+'ms'};}};return _0x1acbcc[_0x1cc841(0x132)]!==_0x1cc841(0x118)&&(_0xbb86fd[_0x1cc841(0x10b)]=async _0x35519f=>{const _0x5c0add=_0x1cc841,_0xf7954e=_0x35519f['str']('code'),_0xdcb7c5=_0x1acbcc[_0x5c0add(0x104)]===_0x5c0add(0xfe)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x35519f[_0x5c0add(0x11e)](_0x5c0add(0x115)))):parseJsonParams(_0x35519f['str'](_0x5c0add(0x115)))??{};return dryRun(_0x5c0add(0x11f),'/api/{appCode}/'+_0xf7954e+'/'+_0x1acbcc[_0x5c0add(0x104)])['body'](_0xdcb7c5)['description'](_0x5c0add(0x134)+_0x1acbcc[_0x5c0add(0xe7)]+_0x5c0add(0x109)+_0xf7954e)[_0x5c0add(0x105)]();}),_0xbb86fd;}export const dataDefinitions=specs[a20_0x21a95c(0x129)](makeDataCommand);
|
|
1
|
+
const a20_0x4dc0d1=a20_0x4748;(function(_0x5dfc6b,_0x8debda){const _0x3236f6=a20_0x4748,_0x3fcb7f=_0x5dfc6b();while(!![]){try{const _0x1dc78a=parseInt(_0x3236f6(0xa0))/0x1*(parseInt(_0x3236f6(0x8d))/0x2)+parseInt(_0x3236f6(0x77))/0x3+parseInt(_0x3236f6(0xab))/0x4*(-parseInt(_0x3236f6(0xb1))/0x5)+parseInt(_0x3236f6(0xc5))/0x6+-parseInt(_0x3236f6(0xbd))/0x7*(-parseInt(_0x3236f6(0x95))/0x8)+parseInt(_0x3236f6(0x7b))/0x9+-parseInt(_0x3236f6(0xa5))/0xa;if(_0x1dc78a===_0x8debda)break;else _0x3fcb7f['push'](_0x3fcb7f['shift']());}catch(_0xcca355){_0x3fcb7f['push'](_0x3fcb7f['shift']());}}}(a20_0xd63d,0xeefd0));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';function a20_0x4748(_0xe8d136,_0x4df5f2){_0xe8d136=_0xe8d136-0x76;const _0xd63d67=a20_0xd63d();let _0x4748a4=_0xd63d67[_0xe8d136];return _0x4748a4;}function a20_0xd63d(){const _0x4119fb=['join','create','Preview:\x20data\x20','\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}','batchCreate','delete','code','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','44170gGOsXf','map','Filter\x20dataset\x20records\x20with\x20query\x20conditions','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','operation','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','1197654DANLtu','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','\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}}','risk','command','1534014jodKuJ','\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\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}','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','4169970AEBopr','\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\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}','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\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]','aggregate','Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\x20on\x20dataset\x20','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\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}','data\x20','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','\x20completed\x20in\x20','high-risk-write','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','266840pFsLGd','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','\x20\x20\x20\x20$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}}','update','Get\x20a\x20single\x20record\x20by\x20ID','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','\x20\x20WHERE\x20OPERATORS','1304THQByb','\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','read','\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$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\x20PAGINATION','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','build','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','Update\x20an\x20existing\x20record','dryRun','12UBEmKa','write','\x20\x20AGGREGATE\x20TYPES','\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}}]}','str','14030840yIpOYY','description','body','helpExtra','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','filter','4ggSUkr','\x20\x20EXAMPLES','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}','paramsHint','getOne','7109335hrUcej','params','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\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}'];a20_0xd63d=function(){return _0x4119fb;};return a20_0xd63d();}import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a20_0x4dc0d1(0xaa),'operation':'filter','risk':a20_0x4dc0d1(0x97),'paramsRequired':![],'description':a20_0x4dc0d1(0xbf),'paramsHint':a20_0x4dc0d1(0x8c)+a20_0x4dc0d1(0x82),'helpExtra':[a20_0x4dc0d1(0x94),a20_0x4dc0d1(0x7c),a20_0x4dc0d1(0x8f),a20_0x4dc0d1(0xb3),'\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}',a20_0x4dc0d1(0x99),'\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}',a20_0x4dc0d1(0xc7),a20_0x4dc0d1(0x88),'','\x20\x20LOGICAL\x20COMBINATORS',a20_0x4dc0d1(0x78),a20_0x4dc0d1(0xa3),'',a20_0x4dc0d1(0xbc),a20_0x4dc0d1(0x8e),a20_0x4dc0d1(0x7f),a20_0x4dc0d1(0xc4),a20_0x4dc0d1(0x92),'\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','',a20_0x4dc0d1(0x9a),a20_0x4dc0d1(0xa9),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27',a20_0x4dc0d1(0xc3)][a20_0x4dc0d1(0xb5)]('\x0a')},{'command':'getOne','operation':a20_0x4dc0d1(0xb0),'risk':a20_0x4dc0d1(0x97),'paramsRequired':!![],'description':a20_0x4dc0d1(0x91),'paramsHint':a20_0x4dc0d1(0x87)},{'command':a20_0x4dc0d1(0xb6),'operation':a20_0x4dc0d1(0xb6),'risk':'write','paramsRequired':!![],'description':a20_0x4dc0d1(0xc1),'paramsHint':a20_0x4dc0d1(0x9b)},{'command':'batchCreate','operation':a20_0x4dc0d1(0xb9),'risk':a20_0x4dc0d1(0xa1),'paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','paramsHint':a20_0x4dc0d1(0x7a)},{'command':a20_0x4dc0d1(0x90),'operation':a20_0x4dc0d1(0x90),'risk':'write','paramsRequired':!![],'description':a20_0x4dc0d1(0x9e),'paramsHint':a20_0x4dc0d1(0x9d)},{'command':a20_0x4dc0d1(0xba),'operation':a20_0x4dc0d1(0xba),'risk':a20_0x4dc0d1(0x8a),'paramsRequired':!![],'description':'Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','paramsHint':a20_0x4dc0d1(0x87)},{'command':a20_0x4dc0d1(0x80),'operation':a20_0x4dc0d1(0x80),'risk':'read','paramsRequired':![],'description':a20_0x4dc0d1(0xc6),'paramsHint':'JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20'+a20_0x4dc0d1(0x81),'helpExtra':[a20_0x4dc0d1(0xa2),a20_0x4dc0d1(0x85),a20_0x4dc0d1(0xb8),'\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}',a20_0x4dc0d1(0xb4),a20_0x4dc0d1(0xae),a20_0x4dc0d1(0x79),a20_0x4dc0d1(0x7d),'','\x20\x20PARAMS\x20STRUCTURE',a20_0x4dc0d1(0x84),a20_0x4dc0d1(0x7e),a20_0x4dc0d1(0x98),'\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\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}}]',a20_0x4dc0d1(0xc0),'',a20_0x4dc0d1(0xac),'\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status',a20_0x4dc0d1(0x96),'',a20_0x4dc0d1(0x8b),'\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','',a20_0x4dc0d1(0x93)][a20_0x4dc0d1(0xb5)]('\x0a')}];function makeDataCommand(_0xe7e8db){const _0x364c3d=a20_0x4dc0d1,_0x11e631=_0x364c3d(0x86)+_0xe7e8db[_0x364c3d(0x76)],_0x36d1c3={'service':'data','command':_0xe7e8db['command'],'description':_0xe7e8db[_0x364c3d(0xa6)],'risk':_0xe7e8db[_0x364c3d(0xc8)],'helpExtra':_0xe7e8db[_0x364c3d(0xa8)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0xe7e8db[_0x364c3d(0xaf)]}],'validate':async _0x5aa2ee=>{const _0x352d7a=_0x364c3d;_0xe7e8db['paramsRequired']&&requireAnyOf(_0x5aa2ee,[_0x352d7a(0xb2)],_0x11e631),_0xe7e8db[_0x352d7a(0xc2)]===_0x352d7a(0xb9)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x5aa2ee['str']('params')));},async 'execute'(_0x2e8fd9){const _0x2406cb=_0x364c3d,_0x58c2a8=_0x2e8fd9[_0x2406cb(0xa4)](_0x2406cb(0xbb)),_0x4b7d2b=_0xe7e8db[_0x2406cb(0xc2)]===_0x2406cb(0xb9)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x2e8fd9[_0x2406cb(0xa4)](_0x2406cb(0xb2)))):parseJsonParams(_0x2e8fd9[_0x2406cb(0xa4)](_0x2406cb(0xb2)))??{},_0x8a6361=Date[_0x2406cb(0xad)](),_0x11534c=await executeData(_0x58c2a8,_0xe7e8db[_0x2406cb(0xc2)],_0x4b7d2b),_0x2e78db=Date['now']()-_0x8a6361;return{'ok':!![],'data':{'result':_0x11534c,'elapsed':_0x2e78db},'message':'data\x20'+_0xe7e8db[_0x2406cb(0x76)]+_0x2406cb(0x89)+_0x2e78db+'ms'};}};return _0xe7e8db[_0x364c3d(0xc8)]!==_0x364c3d(0x97)&&(_0x36d1c3[_0x364c3d(0x9f)]=async _0x5ed01e=>{const _0x3128f7=_0x364c3d,_0x30a8f4=_0x5ed01e[_0x3128f7(0xa4)]('code'),_0x20172b=_0xe7e8db[_0x3128f7(0xc2)]===_0x3128f7(0xb9)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x5ed01e[_0x3128f7(0xa4)]('params'))):parseJsonParams(_0x5ed01e[_0x3128f7(0xa4)]('params'))??{};return dryRun('POST','/api/{appCode}/'+_0x30a8f4+'/'+_0xe7e8db[_0x3128f7(0xc2)])[_0x3128f7(0xa7)](_0x20172b)[_0x3128f7(0xa6)](_0x3128f7(0xb7)+_0xe7e8db[_0x3128f7(0x76)]+_0x3128f7(0x83)+_0x30a8f4)[_0x3128f7(0x9c)]();}),_0x36d1c3;}export const dataDefinitions=specs[a20_0x4dc0d1(0xbe)](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x194d28=a21_0x26fc;(function(_0x2ce685,_0x347af5){const _0x2b3d5c=a21_0x26fc,_0x45c1b5=_0x2ce685();while(!![]){try{const _0x324f07=parseInt(_0x2b3d5c(0xc5))/0x1+-parseInt(_0x2b3d5c(0xd1))/0x2*(-parseInt(_0x2b3d5c(0xa9))/0x3)+parseInt(_0x2b3d5c(0xbc))/0x4*(parseInt(_0x2b3d5c(0xad))/0x5)+parseInt(_0x2b3d5c(0xd4))/0x6*(-parseInt(_0x2b3d5c(0xe8))/0x7)+-parseInt(_0x2b3d5c(0xaa))/0x8*(-parseInt(_0x2b3d5c(0xb1))/0x9)+parseInt(_0x2b3d5c(0xb7))/0xa+-parseInt(_0x2b3d5c(0xe3))/0xb*(parseInt(_0x2b3d5c(0xef))/0xc);if(_0x324f07===_0x347af5)break;else _0x45c1b5['push'](_0x45c1b5['shift']());}catch(_0x4bb378){_0x45c1b5['push'](_0x45c1b5['shift']());}}}(a21_0x55a9,0x9a96b));import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x3bf85f){const _0x5f0cc9=a21_0x26fc;if(_0x3bf85f['deleted'])return null;const _0x1eabde=Boolean(_0x3bf85f['displayName']!==undefined||_0x3bf85f[_0x5f0cc9(0xf1)]!==undefined);let _0x439164={};if(!_0x1eabde&&typeof _0x3bf85f[_0x5f0cc9(0xa5)]==='string')try{_0x439164=JSON['parse'](_0x3bf85f['extend']);}catch{}const _0x3e6e6=_0x1eabde?_0x3bf85f[_0x5f0cc9(0xd6)]:_0x3bf85f[_0x5f0cc9(0xae)],_0x558fcc=_0x1eabde?_0x3bf85f['displayName']:_0x3bf85f[_0x5f0cc9(0xd6)],_0x546f13=_0x1eabde?_0x3bf85f[_0x5f0cc9(0xf1)]:_0x3bf85f[_0x5f0cc9(0xed)]||_0x3bf85f[_0x5f0cc9(0xd3)],_0x5d4728=_0x1eabde?_0x3bf85f[_0x5f0cc9(0xa6)]===!![]:_0x439164[_0x5f0cc9(0xa6)]===!![],_0x4f61e8=_0x1eabde?_0x3bf85f[_0x5f0cc9(0xb0)]===!![]:_0x439164[_0x5f0cc9(0xb0)]===!![],_0x3a1fad=_0x1eabde?_0x3bf85f[_0x5f0cc9(0xcb)]??null:_0x439164[_0x5f0cc9(0xcb)]??null,_0x244b1a={'name':_0x3e6e6,'displayName':_0x558fcc||_0x3e6e6,'type':_0x546f13,'dbType':_0x3bf85f[_0x5f0cc9(0xda)],'pk':_0x5d4728,'required':_0x4f61e8,'description':_0x3bf85f[_0x5f0cc9(0xd0)]||undefined};return Array[_0x5f0cc9(0xdb)](_0x3a1fad)&&_0x3a1fad[_0x5f0cc9(0xc3)]>0x0&&(_0x244b1a[_0x5f0cc9(0xcb)]=_0x3a1fad),_0x244b1a;}function parseJsonMaybe(_0xb4f550){const _0x47a9c7=a21_0x26fc;if(typeof _0xb4f550!==_0x47a9c7(0xde))return _0xb4f550;try{return JSON[_0x47a9c7(0xcc)](_0xb4f550);}catch{return _0xb4f550;}}function normalizeOperationEntry(_0x4e713e,_0x28c4c9){const _0x35356d=a21_0x26fc;if(!_0x28c4c9||typeof _0x28c4c9!==_0x35356d(0xc6))return null;if(!_0x28c4c9[_0x35356d(0xb2)]||!_0x28c4c9[_0x35356d(0xe7)])return null;const _0x4396cb={'name':_0x4e713e,'method':_0x28c4c9[_0x35356d(0xb2)],'path':_0x28c4c9[_0x35356d(0xe7)]};if(_0x28c4c9[_0x35356d(0xbf)])_0x4396cb[_0x35356d(0xbf)]=_0x28c4c9[_0x35356d(0xbf)];if(_0x28c4c9[_0x35356d(0xea)]!=null)_0x4396cb['requestBody']=parseJsonMaybe(_0x28c4c9[_0x35356d(0xea)]);if(_0x28c4c9['responseBody']!=null)_0x4396cb[_0x35356d(0xbd)]=parseJsonMaybe(_0x28c4c9[_0x35356d(0xbd)]);if(_0x28c4c9[_0x35356d(0xe4)]!=null)_0x4396cb[_0x35356d(0xe4)]=_0x28c4c9[_0x35356d(0xe4)];if(_0x28c4c9[_0x35356d(0xee)]!=null)_0x4396cb['afterScriptId']=_0x28c4c9[_0x35356d(0xee)];if(Array['isArray'](_0x28c4c9[_0x35356d(0xba)]))_0x4396cb[_0x35356d(0xba)]=_0x28c4c9[_0x35356d(0xba)];if(Array['isArray'](_0x28c4c9[_0x35356d(0xce)]))_0x4396cb[_0x35356d(0xce)]=_0x28c4c9[_0x35356d(0xce)];return _0x4396cb;}function summarizeDbtable(_0x249ab3){const _0x319da0=a21_0x26fc,_0x553d69={},_0x24f1d6=[_0x319da0(0xdd),_0x319da0(0xf0),_0x319da0(0xb4),'datasetKey','pkField','allFields','logicField','createTimeField',_0x319da0(0xb5),'creatorIdField',_0x319da0(0xe6),_0x319da0(0xc7),'modifierNameField',_0x319da0(0xec),_0x319da0(0xd7)];for(const _0x186bcd of _0x24f1d6){if(_0x249ab3[_0x186bcd]!==undefined)_0x553d69[_0x186bcd]=_0x249ab3[_0x186bcd];}return typeof _0x553d69[_0x319da0(0xb8)]===_0x319da0(0xde)&&_0x553d69[_0x319da0(0xb8)][_0x319da0(0xc3)]>0x0&&(_0x553d69[_0x319da0(0xbb)]=_0x553d69[_0x319da0(0xb8)]['split'](',')[_0x319da0(0xd2)](_0x2546cc=>_0x2546cc[_0x319da0(0xe1)]())[_0x319da0(0xb3)](Boolean)),_0x553d69;}function normalizeRelatedPages(_0xada222){const _0x2f4957=a21_0x26fc;if(!Array[_0x2f4957(0xdb)](_0xada222))return[];return _0xada222['filter'](_0x2211c8=>_0x2211c8&&typeof _0x2211c8===_0x2f4957(0xc6))['map'](_0x2d6d05=>({'id':_0x2d6d05['id'],'type':_0x2d6d05['type'],'code':_0x2d6d05[_0x2f4957(0xae)],'title':_0x2d6d05['title'],'deleted':_0x2d6d05['deleted']===!![]}));}function a21_0x26fc(_0xe6688b,_0x54a51a){_0xe6688b=_0xe6688b-0xa5;const _0x55a9df=a21_0x55a9();let _0x26fccb=_0x55a9df[_0xe6688b];return _0x26fccb;}function normalizeFallbackFieldName(_0x46d955,_0x35f76a){const _0x549285=_0x46d955['trim']();if(!_0x549285)return null;return{'name':_0x549285,'displayName':_0x549285,'type':undefined,'dbType':undefined,'pk':_0x549285===_0x35f76a,'required':![],'description':undefined};}async function loadListFieldFallback(_0xaf71ad,_0x2c85b6){const _0x3980bb=a21_0x26fc;if(!_0xaf71ad||!_0x2c85b6)return[];try{const _0x1aaf1d=await listDatasets(_0xaf71ad,{'code':_0x2c85b6}),_0x2090f7=_0x1aaf1d[_0x3980bb(0xdf)](_0x2fa75c=>_0x2fa75c['code']===_0x2c85b6)??_0x1aaf1d[0x0],_0x30784a=_0x2090f7?.['dbtableConfig']??{},_0x3f1690=typeof _0x30784a[_0x3980bb(0xb8)]===_0x3980bb(0xde)?_0x30784a['allFields'][_0x3980bb(0xeb)](','):[];return _0x3f1690['map'](_0x2aa89c=>normalizeFallbackFieldName(_0x2aa89c,_0x30784a[_0x3980bb(0xa6)]))[_0x3980bb(0xb3)](_0x20af74=>_0x20af74!==null);}catch{return[];}}export const datasetDetail={'service':a21_0x194d28(0xcf),'command':a21_0x194d28(0xa7),'description':a21_0x194d28(0xc9),'risk':a21_0x194d28(0xc4),'flags':[CODE_FLAG],async 'execute'(_0x52333e){const _0x169722=a21_0x194d28,_0x1ee5f2=await getDatasetDetail(_0x52333e[_0x169722(0xb6)](_0x169722(0xae))),_0x3ccece=Array[_0x169722(0xdb)](_0x1ee5f2['fields'])?_0x1ee5f2[_0x169722(0xdc)]:Array[_0x169722(0xdb)](_0x1ee5f2['properties'])?_0x1ee5f2[_0x169722(0xbe)]:[];let _0x217401=_0x3ccece[_0x169722(0xd2)](_0x240890=>normalizeField(_0x240890))['filter'](_0x563b71=>_0x563b71!==null);_0x217401[_0x169722(0xc3)]===0x0&&(_0x217401=await loadListFieldFallback(_0x52333e[_0x169722(0xe5)],_0x52333e[_0x169722(0xb6)]('code')));const _0x58f001=_0x1ee5f2['operations']??{},_0x35d13a=[];for(const [_0x153ccd,_0x4da3d0]of Object[_0x169722(0xc8)](_0x58f001)){const _0x7ebb52=normalizeOperationEntry(_0x153ccd,_0x4da3d0);if(_0x7ebb52)_0x35d13a[_0x169722(0xe9)](_0x7ebb52);}const _0x14c824=_0x1ee5f2['dbtableConfig']??{},_0x537acc=_0x1ee5f2['dataset']??{},_0x21244f=_0x14c824['dbId']!=null?{'id':_0x14c824[_0x169722(0xdd)],'name':_0x14c824['dbName']??null}:undefined;let _0x3aaadf;return typeof _0x1ee5f2[_0x169722(0xa5)]===_0x169722(0xde)&&(_0x3aaadf=parseJsonMaybe(_0x1ee5f2[_0x169722(0xa5)])),{'ok':!![],'data':{'id':_0x1ee5f2[_0x169722(0xc0)]??_0x1ee5f2['id'],'name':_0x1ee5f2[_0x169722(0xd6)],'code':_0x1ee5f2[_0x169722(0xc1)]||_0x1ee5f2[_0x169722(0xae)],'doVersion':_0x1ee5f2[_0x169722(0xe0)],'description':_0x1ee5f2[_0x169722(0xd0)]||_0x537acc['tableComment']||undefined,'source':_0x1ee5f2['source']||_0x537acc[_0x169722(0xac)],'table':_0x14c824[_0x169722(0xb4)]||_0x537acc[_0x169722(0xb4)],'datasetKey':_0x14c824['datasetKey'],'pk':_0x14c824[_0x169722(0xa6)],'db':_0x21244f,'dbtable':summarizeDbtable(_0x14c824),'fields':_0x217401,'operations':_0x35d13a,'indexes':Array[_0x169722(0xdb)](_0x537acc[_0x169722(0xc2)])?_0x537acc[_0x169722(0xc2)]:[],'relations':Array[_0x169722(0xdb)](_0x1ee5f2[_0x169722(0xca)])?_0x1ee5f2[_0x169722(0xca)][_0x169722(0xd2)](_0x3628ce=>({'fromField':_0x3628ce[_0x169722(0xd5)],'toDataset':_0x3628ce[_0x169722(0xd9)],'toCode':_0x3628ce[_0x169722(0xa8)],'toTable':_0x3628ce['toTableName'],'toField':_0x3628ce[_0x169722(0xe2)],'labelField':_0x3628ce[_0x169722(0xb9)]||undefined})):[],'relatedPages':normalizeRelatedPages(_0x1ee5f2[_0x169722(0xab)]),...Array[_0x169722(0xdb)](_0x1ee5f2['columnCodeListWithDeleted'])?{'columnCodeListWithDeleted':_0x1ee5f2[_0x169722(0xaf)]}:{},'formatRules':Array[_0x169722(0xdb)](_0x1ee5f2['formatRules'])?_0x1ee5f2[_0x169722(0xd8)]:[],'validateRules':Array['isArray'](_0x1ee5f2[_0x169722(0xcd)])?_0x1ee5f2['validateRules']:[],..._0x3aaadf!==undefined?{'extend':_0x3aaadf}:{},'stats':{'fieldCount':_0x217401[_0x169722(0xc3)],'operationCount':_0x35d13a[_0x169722(0xc3)]}}};}};function a21_0x55a9(){const _0x3f2467=['relations','options','parse','validateRules','responseFields','dataset','description','224746loVpHB','map','dataType','24HSRraC','fromField','name','dblinkInfoDTO','formatRules','toDatasetName','dbType','isArray','fields','dbId','string','find','doVersion','trim','toField','4323pztIzI','beforeScriptId','appCode','creatorNameField','path','2110003OWOBXO','push','requestBody','split','labelField','type','afterScriptId','71160GqTOyC','dbName','doType','extend','pkField','detail','toDatasetCode','33pBfayH','3245416aldDXg','relatedPageInfoList','sourceType','85tzxZiN','code','columnCodeListWithDeleted','required','9oXTZAh','method','filter','tableName','updateTimeField','str','5045540UaNIVr','allFields','toFieldLabel','requestFields','allFieldNames','208732YrsZss','responseBody','properties','host','modelId','modelCode','indexes','length','read','1135956BjgrGG','object','modifierIdField','entries','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations'];a21_0x55a9=function(){return _0x3f2467;};return a21_0x55a9();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3cdcd1,_0x5b65cd){const _0x55c665=a22_0x3873,_0xb5afe7=_0x3cdcd1();while(!![]){try{const _0x50340b=-parseInt(_0x55c665(0x11c))/0x1+-parseInt(_0x55c665(0x124))/0x2*(-parseInt(_0x55c665(0x11d))/0x3)+-parseInt(_0x55c665(0x11f))/0x4+parseInt(_0x55c665(0x122))/0x5+parseInt(_0x55c665(0x11e))/0x6+parseInt(_0x55c665(0x123))/0x7*(parseInt(_0x55c665(0x125))/0x8)+-parseInt(_0x55c665(0x120))/0x9*(parseInt(_0x55c665(0x121))/0xa);if(_0x50340b===_0x5b65cd)break;else _0xb5afe7['push'](_0xb5afe7['shift']());}catch(_0x2f33c3){_0xb5afe7['push'](_0xb5afe7['shift']());}}}(a22_0x3f68,0xbe324));import{datasetList}from'../../commands/dataset/list.js';import{datasetDetail}from'../../commands/dataset/detail.js';import{datasetSdkDoc}from'../../commands/dataset/sdk-doc.js';function a22_0x3873(_0x38b51b,_0x1c4dd4){_0x38b51b=_0x38b51b-0x11c;const _0x3f68ec=a22_0x3f68();let _0x387316=_0x3f68ec[_0x38b51b];return _0x387316;}export const datasetDefinitions=[datasetList,datasetDetail,datasetSdkDoc];function a22_0x3f68(){const _0x4631ea=['4086HAZAQF','40190QAcJAt','6074415jUTFwp','40985hUvALu','4xVaIYx','1112IEOeAE','185245VNMZeq','1550103hEgdhi','5523582IjaliO','4775248OXbKyg'];a22_0x3f68=function(){return _0x4631ea;};return a22_0x3f68();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a23_0x501c(_0x577849,_0x565836){_0x577849=_0x577849-0x16a;const _0x482f82=a23_0x482f();let _0x501cb9=_0x482f82[_0x577849];return _0x501cb9;}const a23_0x11a1e6=a23_0x501c;(function(_0x3726dd,_0x516e79){const _0x275ccb=a23_0x501c,_0x5c7f9b=_0x3726dd();while(!![]){try{const _0x3034a7=-parseInt(_0x275ccb(0x16a))/0x1+parseInt(_0x275ccb(0x179))/0x2+-parseInt(_0x275ccb(0x16d))/0x3+parseInt(_0x275ccb(0x17a))/0x4*(-parseInt(_0x275ccb(0x16b))/0x5)+parseInt(_0x275ccb(0x180))/0x6+-parseInt(_0x275ccb(0x178))/0x7+parseInt(_0x275ccb(0x176))/0x8;if(_0x3034a7===_0x516e79)break;else _0x5c7f9b['push'](_0x5c7f9b['shift']());}catch(_0x453817){_0x5c7f9b['push'](_0x5c7f9b['shift']());}}}(a23_0x482f,0xa9b70));function a23_0x482f(){const _0x3f0bab=['2390926nTeBMy','2124068wpzVwM','string','allFields','dbtableConfig','name','datasetKey','154038TxdGDI','trim','str','appCode','802593mYWgYN','10nsjdOK','map','930594LfqHtl','dataset','length','code','read','Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','description','tableName','17525568RSqerA','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','3792985xntoEi'];a23_0x482f=function(){return _0x3f0bab;};return a23_0x482f();}import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';export const datasetList={'service':a23_0x11a1e6(0x16e),'command':'list','description':a23_0x11a1e6(0x177),'risk':a23_0x11a1e6(0x171),'flags':[{'name':a23_0x11a1e6(0x17e),'type':a23_0x11a1e6(0x17b),'description':a23_0x11a1e6(0x172)},{...CODE_FLAG,'required':![],'description':a23_0x11a1e6(0x173)}],async 'execute'(_0x468edc){const _0x40db18=a23_0x11a1e6,_0x51bbbc=_0x468edc[_0x40db18(0x182)](_0x40db18(0x17e)),_0x54a512=_0x468edc[_0x40db18(0x182)](_0x40db18(0x170)),_0x198e81=await listDatasets(_0x468edc[_0x40db18(0x183)],{..._0x51bbbc&&{'name':_0x51bbbc},..._0x54a512&&{'code':_0x54a512}});return{'ok':!![],'data':{'total':_0x198e81[_0x40db18(0x16f)],'datasets':_0x198e81[_0x40db18(0x16c)](_0x343193=>{const _0x52165d=_0x40db18,_0x2d9207=_0x343193[_0x52165d(0x17d)]??{};return{'id':_0x343193['id'],'code':_0x343193[_0x52165d(0x170)],'name':_0x343193[_0x52165d(0x17e)],'source':_0x343193['source'],'description':_0x343193[_0x52165d(0x174)],'table':_0x2d9207[_0x52165d(0x175)],'datasetKey':_0x2d9207[_0x52165d(0x17f)],'pk':_0x2d9207['pkField'],'fields':_0x2d9207['allFields']?_0x2d9207[_0x52165d(0x17c)]['split'](',')[_0x52165d(0x16c)](_0x326226=>_0x326226[_0x52165d(0x181)]()):[]};})}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x5c7e01=a24_0x7db1;(function(_0x2d55e9,_0x201b86){const _0x3a197b=a24_0x7db1,_0x346be6=_0x2d55e9();while(!![]){try{const _0x20b50d=-parseInt(_0x3a197b(0xd7))/0x1+parseInt(_0x3a197b(0xe6))/0x2+-parseInt(_0x3a197b(0xe0))/0x3+parseInt(_0x3a197b(0xdc))/0x4*(-parseInt(_0x3a197b(0xd6))/0x5)+-parseInt(_0x3a197b(0xd4))/0x6*(parseInt(_0x3a197b(0xd3))/0x7)+-parseInt(_0x3a197b(0xe4))/0x8*(-parseInt(_0x3a197b(0xd2))/0x9)+parseInt(_0x3a197b(0xde))/0xa;if(_0x20b50d===_0x201b86)break;else _0x346be6['push'](_0x346be6['shift']());}catch(_0x5c3ea3){_0x346be6['push'](_0x346be6['shift']());}}}(a24_0x3da5,0x7e699));import{getDatasetSdkUsageDoc}from'../../core/api-client.js';function a24_0x7db1(_0x4804f3,_0x2ecf0f){_0x4804f3=_0x4804f3-0xd2;const _0x3da51e=a24_0x3da5();let _0x7db1f4=_0x3da51e[_0x4804f3];return _0x7db1f4;}import{CODE_FLAG}from'../../commands/common/flags.js';const DEFAULT_MARKDOWN=a24_0x5c7e01(0xd9);export function formatDatasetSdkMarkdown(_0x2d2a31){const _0x4b86d9=a24_0x5c7e01,_0x50ebc2=typeof _0x2d2a31===_0x4b86d9(0xe2)?_0x2d2a31[_0x4b86d9(0xdb)]():'';return _0x50ebc2||DEFAULT_MARKDOWN;}function a24_0x3da5(){const _0x529026=['316aAwOVl','dataset','22546430mfzTnQ','sdk-doc','450093PskMmO','Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','string','read','11272YLFtAU','str','932952JvIzeG','315DjbIlq','4282817vafDzB','6gxjKYF','appCode','47615CkPOWx','738470jWrJRx','Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档','code','trim'];a24_0x3da5=function(){return _0x529026;};return a24_0x3da5();}export const datasetSdkDoc={'service':a24_0x5c7e01(0xdd),'command':a24_0x5c7e01(0xdf),'description':a24_0x5c7e01(0xd8),'risk':a24_0x5c7e01(0xe3),'flags':[{...CODE_FLAG,'description':a24_0x5c7e01(0xe1)}],async 'execute'(_0x2c7a39){const _0x3753ee=a24_0x5c7e01,_0xf93368=_0x2c7a39[_0x3753ee(0xe5)](_0x3753ee(0xda)),_0x17ee9f=await getDatasetSdkUsageDoc(_0xf93368,_0x2c7a39[_0x3753ee(0xd5)]);return{'ok':!![],'data':{'code':_0xf93368,'appCode':_0x2c7a39['appCode'],'markdown':formatDatasetSdkMarkdown(_0x17ee9f)}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x44a7ae=a25_0x22b4;function a25_0x22b4(_0x102eb6,_0xab6c73){_0x102eb6=_0x102eb6-0x1ef;const _0x4365d6=a25_0x4365();let _0x22b4ad=_0x4365d6[_0x102eb6];return _0x22b4ad;}(function(_0x2f2b1f,_0x3947f1){const _0x1c0adb=a25_0x22b4,_0xa305f5=_0x2f2b1f();while(!![]){try{const _0x51c3c4=-parseInt(_0x1c0adb(0x209))/0x1*(parseInt(_0x1c0adb(0x210))/0x2)+-parseInt(_0x1c0adb(0x229))/0x3+-parseInt(_0x1c0adb(0x1fe))/0x4+parseInt(_0x1c0adb(0x200))/0x5+-parseInt(_0x1c0adb(0x22c))/0x6+parseInt(_0x1c0adb(0x1f5))/0x7*(parseInt(_0x1c0adb(0x202))/0x8)+parseInt(_0x1c0adb(0x22e))/0x9;if(_0x51c3c4===_0x3947f1)break;else _0xa305f5['push'](_0xa305f5['shift']());}catch(_0x8a0eb1){_0xa305f5['push'](_0xa305f5['shift']());}}}(a25_0x4365,0x8abc9));import a25_0x46d631 from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';function a25_0x4365(){const _0x31839f=['\x20\x20runtimeDomain:\x20\x20\x20','commandCount','(none)','392778fgNwRN','verbose','\x20commands)','doctor','padEnd','\x20Imported\x20from:\x20','Global','green','\x20\x20Session\x20check:\x20\x20\x20','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','format','\x20doctor','message','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','gray','log','✓\x20Loaded','ClientAk','arch','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','Diagnose\x20CLI\x20configuration\x20and\x20environment','\x20\x20Config\x20Files','bold','riskLevel','env','1686255WQwrgu','accessKey','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','4640754UmPYbh','read','15351516xZEsVz','(missing)','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','empty','repeat','check','(unnamed)','Project','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','✗\x20Invalid\x20JSON','name','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','currentApp','length','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','(removed\x20—\x20cookie\x20auth\x20disabled)','locale','(set,\x20length=','(not\x20set)','red','status','(not\x20found)','\x20\x20─','37079pJagiJ','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','\x20\x20auth\x20(effective):\x20','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','✓\x20Valid\x20JSON','(default)','\x20\x20Service\x20Tree','pageSize','platform','2627936yHxNXx','yellow','1897695VuupkC','\x20(accessKey)','1608mRklnb','\x20\x20Config\x20JSON','source','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Merged\x20Config','\x20\x20Auth','serviceCode','3rChjGf','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','services','missing'];a25_0x4365=function(){return _0x31839f;};return a25_0x4365();}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(_0x338d21){const _0x114d40=a25_0x22b4,_0xbb52fd=getCliVersion(),_0x781f79=buildConfigFromFlags({});await initGlobalEnvironment(_0x781f79),console[_0x114d40(0x21f)](),console[_0x114d40(0x21f)](a25_0x46d631[_0x114d40(0x226)](CLI_BIN_NAME+_0x114d40(0x21b))),console[_0x114d40(0x21f)](a25_0x46d631[_0x114d40(0x21e)]('─'['repeat'](0x32))),console[_0x114d40(0x21f)](_0x114d40(0x23a)+_0xbb52fd),console['log']('\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+process['version']),console[_0x114d40(0x21f)]('\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20'+process[_0x114d40(0x1fd)]+'\x20'+process[_0x114d40(0x222)]),console[_0x114d40(0x21f)](),console[_0x114d40(0x21f)](a25_0x46d631['bold'](_0x114d40(0x225))),console['log'](a25_0x46d631[_0x114d40(0x21e)](_0x114d40(0x1f4)[_0x114d40(0x232)](0x1e)));const _0x3f1174=getGlobalConfigPath(),_0x56df64=getProjectConfigPath();console[_0x114d40(0x21f)]('\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x3f1174||a25_0x46d631[_0x114d40(0x21e)](_0x114d40(0x1f3)))),console[_0x114d40(0x21f)](_0x114d40(0x1f8)+(_0x56df64||a25_0x46d631['gray'](_0x114d40(0x1f3)))),console[_0x114d40(0x21f)](),console[_0x114d40(0x21f)](a25_0x46d631['bold'](_0x114d40(0x203))),console[_0x114d40(0x21f)](a25_0x46d631['gray'](_0x114d40(0x1f4)['repeat'](0x1e)));const _0x550a3f=(_0x34a9e9,_0x10451a)=>{const _0x958065=_0x114d40;if(!_0x10451a){console[_0x958065(0x21f)]('\x20\x20'+_0x34a9e9[_0x958065(0x214)](0x11)+'\x20'+a25_0x46d631[_0x958065(0x21e)]('(no\x20file)'));return;}const _0xea05d2=inspectCliConfigJsonFile(_0x10451a);if(_0xea05d2[_0x958065(0x1f2)]==='ok')console[_0x958065(0x21f)]('\x20\x20'+_0x34a9e9['padEnd'](0x11)+'\x20'+a25_0x46d631[_0x958065(0x217)](_0x958065(0x1f9)));else{if(_0xea05d2[_0x958065(0x1f2)]===_0x958065(0x231))console[_0x958065(0x21f)]('\x20\x20'+_0x34a9e9[_0x958065(0x214)](0x11)+'\x20'+a25_0x46d631[_0x958065(0x1ff)]('⚠\x20Empty\x20(treated\x20as\x20{})'));else _0xea05d2[_0x958065(0x1f2)]===_0x958065(0x20c)?console[_0x958065(0x21f)]('\x20\x20'+_0x34a9e9[_0x958065(0x214)](0x11)+'\x20'+a25_0x46d631['gray'](_0x958065(0x22f))):(console['log']('\x20\x20'+_0x34a9e9['padEnd'](0x11)+'\x20'+a25_0x46d631[_0x958065(0x1f1)](_0x958065(0x237))),console['log']('\x20\x20'+''[_0x958065(0x214)](0x11)+'\x20'+a25_0x46d631[_0x958065(0x1f1)](_0xea05d2[_0x958065(0x21c)])));}};_0x550a3f(_0x114d40(0x216),_0x3f1174),_0x550a3f(_0x114d40(0x235),_0x56df64),console[_0x114d40(0x21f)](),console['log'](a25_0x46d631[_0x114d40(0x226)](_0x114d40(0x206))),console[_0x114d40(0x21f)](a25_0x46d631[_0x114d40(0x21e)]('\x20\x20─'[_0x114d40(0x232)](0x1e))),console[_0x114d40(0x21f)](_0x114d40(0x205)+(_0x781f79['appCode']||a25_0x46d631['red'](_0x114d40(0x1f0)))),console[_0x114d40(0x21f)](_0x114d40(0x21d)+_0x781f79[_0x114d40(0x228)]);const _0x6ab106=isLegacyCompatConfigKey(_0x114d40(0x23f))?a25_0x46d631[_0x114d40(0x21e)](_0x781f79[_0x114d40(0x23f)]+'\x20(legacy/compat\x20only)'):_0x781f79['locale'];console[_0x114d40(0x21f)]('\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x6ab106),console['log'](_0x114d40(0x219)+(_0x781f79['defaultApp']||a25_0x46d631[_0x114d40(0x21e)](_0x114d40(0x20f)))),console[_0x114d40(0x21f)](_0x114d40(0x239)+(_0x781f79[_0x114d40(0x23b)]||a25_0x46d631['gray'](_0x114d40(0x20f)))),console[_0x114d40(0x21f)](_0x114d40(0x20a)+(_0x781f79[_0x114d40(0x21a)]||a25_0x46d631[_0x114d40(0x21e)]('(default:\x20'+DEFAULT_CONFIG_VALUES[_0x114d40(0x21a)]+')'))),console['log'](_0x114d40(0x223)+(_0x781f79[_0x114d40(0x1fc)]??a25_0x46d631[_0x114d40(0x21e)](_0x114d40(0x1fa)))),console[_0x114d40(0x21f)](_0x114d40(0x1f6)+_0x781f79[_0x114d40(0x227)]),console['log']('\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x781f79[_0x114d40(0x211)]),console[_0x114d40(0x21f)](_0x114d40(0x1f7)+AUTH_MODE[_0x114d40(0x221)]),console[_0x114d40(0x21f)](_0x114d40(0x23d)+(_0x781f79[_0x114d40(0x22a)]?a25_0x46d631['green'](_0x114d40(0x1ef)+_0x781f79[_0x114d40(0x22a)][_0x114d40(0x23c)]+')'):a25_0x46d631[_0x114d40(0x21e)](_0x114d40(0x20f)))),console[_0x114d40(0x21f)](),console[_0x114d40(0x21f)](a25_0x46d631[_0x114d40(0x226)]('\x20\x20API\x20Endpoints')),console[_0x114d40(0x21f)](a25_0x46d631[_0x114d40(0x21e)](_0x114d40(0x1f4)[_0x114d40(0x232)](0x1e))),console[_0x114d40(0x21f)]('\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20'+getApiDomain()),console[_0x114d40(0x21f)](_0x114d40(0x22b)+getUserDomain()),console[_0x114d40(0x21f)](_0x114d40(0x20d)+getRuntimeDomain()),console['log'](),console[_0x114d40(0x21f)](a25_0x46d631[_0x114d40(0x226)](_0x114d40(0x1fb))),console[_0x114d40(0x21f)](a25_0x46d631[_0x114d40(0x21e)](_0x114d40(0x1f4)[_0x114d40(0x232)](0x1e)));const _0x4fffca=inspectServiceRegistry();console[_0x114d40(0x21f)]('\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20'+_0x4fffca['registryPath']),console[_0x114d40(0x21f)](_0x114d40(0x236)+formatServiceRegistryStatus(_0x4fffca)),console['log']('\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20'+_0x4fffca['serviceCount']),console[_0x114d40(0x21f)]('\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20'+_0x4fffca[_0x114d40(0x20e)]);for(const _0x2c8003 of _0x4fffca[_0x114d40(0x20b)]){console[_0x114d40(0x21f)]('\x20\x20'+(_0x2c8003[_0x114d40(0x208)]+':')[_0x114d40(0x214)](0x11)+'\x20'+(_0x2c8003[_0x114d40(0x238)]||a25_0x46d631[_0x114d40(0x21e)](_0x114d40(0x234)))+'\x20('+_0x2c8003[_0x114d40(0x20e)]+_0x114d40(0x212)),console[_0x114d40(0x21f)]('\x20\x20'+''[_0x114d40(0x214)](0x11)+_0x114d40(0x215)+_0x2c8003[_0x114d40(0x204)]['path']);}return console[_0x114d40(0x21f)](),console[_0x114d40(0x21f)](a25_0x46d631['bold'](_0x114d40(0x207))),console[_0x114d40(0x21f)](a25_0x46d631[_0x114d40(0x21e)]('\x20\x20─'['repeat'](0x1e))),console['log'](_0x114d40(0x230)+a25_0x46d631[_0x114d40(0x217)](AUTH_MODE[_0x114d40(0x221)]+_0x114d40(0x201))),console[_0x114d40(0x21f)](_0x114d40(0x218)+a25_0x46d631[_0x114d40(0x21e)](_0x114d40(0x23e))),console['log'](),{'ok':!![]};}function formatServiceRegistryStatus(_0x5cee51){const _0x3e5022=a25_0x22b4;if(_0x5cee51[_0x3e5022(0x1f2)]==='ok')return a25_0x46d631[_0x3e5022(0x217)](_0x3e5022(0x220));if(_0x5cee51[_0x3e5022(0x1f2)]==='missing')return a25_0x46d631[_0x3e5022(0x21e)](_0x3e5022(0x1f3));if(_0x5cee51[_0x3e5022(0x1f2)]===_0x3e5022(0x231))return a25_0x46d631['yellow']('⚠\x20Empty');return a25_0x46d631[_0x3e5022(0x1f1)]('✗\x20Invalid'+(_0x5cee51['message']?':\x20'+_0x5cee51[_0x3e5022(0x21c)]:''));}export const doctorDefinition={'service':a25_0x44a7ae(0x213),'command':a25_0x44a7ae(0x233),'description':a25_0x44a7ae(0x224),'risk':a25_0x44a7ae(0x22d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x673cad=a26_0x9359;(function(_0x522d47,_0x400eab){const _0xb8cdf7=a26_0x9359,_0x587a99=_0x522d47();while(!![]){try{const _0x5e3acf=-parseInt(_0xb8cdf7(0x1b5))/0x1*(-parseInt(_0xb8cdf7(0x1a5))/0x2)+parseInt(_0xb8cdf7(0x1aa))/0x3*(-parseInt(_0xb8cdf7(0x1eb))/0x4)+-parseInt(_0xb8cdf7(0x1d0))/0x5+parseInt(_0xb8cdf7(0x1de))/0x6*(parseInt(_0xb8cdf7(0x1d1))/0x7)+parseInt(_0xb8cdf7(0x1d6))/0x8+parseInt(_0xb8cdf7(0x1da))/0x9+-parseInt(_0xb8cdf7(0x1a7))/0xa;if(_0x5e3acf===_0x400eab)break;else _0x587a99['push'](_0x587a99['shift']());}catch(_0x2a5918){_0x587a99['push'](_0x587a99['shift']());}}}(a26_0x563a,0xcb7de));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';function a26_0x563a(){const _0x2316e6=['boolean','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','defaultApp','apps','trim','race','\x20\x20default:\x20',')\x20instead\x20of\x20project','Write\x20to\x20global\x20(~/','App\x20code','toLowerCase','entries','name','Source\x20file\x20not\x20found:\x20','\x20\x20config:\x20\x20','env','\x20\x20appcode:\x20','\x20already\x20exists.\x20Overwrite?','\x20\x20env:\x20\x20\x20\x20\x20','cwd','file','676015XDLJLv','49Kdgqwu','string','newConfigFileName','validation','User\x20aborted\x20prompt','12956512ZvfdDU','AbortPrompt','Failed\x20to\x20parse\x20source\x20file:\x20','appcode','5582862NtDSQd','[y/N]','Initialized\x20','cancelled','1135842ByzFlw','stdout','\x0aInitialized\x20','question','Imported\x20from\x20','join','message','\x20init\x20—\x20Create\x20','yes','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`.','Target\x20environment\x20(default\x20','App\x20code\x20cannot\x20be\x20empty.','global','5169272iyntWD','Skip\x20confirmation\x20when\x20overwriting','2408216dOICuF','apiDir','25081160LAdqzy','\x22.\x20Allowed:\x20','flagMissing','3sgUbVY','Override\x20imported\x20default\x20env','app','project','log','riskLevel','stdin','App\x20code\x20for\x20the\x20project','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Usage:\x20','1BODPiC','close','SIGINT','Invalid\x20env\x20\x22','includes','Aborted.'];a26_0x563a=function(){return _0x2316e6;};return a26_0x563a();}import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a26_0x673cad(0x1d9),'type':a26_0x673cad(0x1d2),'description':a26_0x673cad(0x1b1)},{'name':a26_0x673cad(0x1ca),'type':'string','description':a26_0x673cad(0x1e8)+DEFAULT_CONFIG_VALUES[a26_0x673cad(0x1ca)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x673cad(0x1ea),'type':a26_0x673cad(0x1bb),'description':a26_0x673cad(0x1c3)+PRODUCT_CONFIG[a26_0x673cad(0x1d3)]+a26_0x673cad(0x1c2),'default':![]},{'name':a26_0x673cad(0x1e6),'type':'boolean','description':a26_0x673cad(0x1ec),'default':![]}];export const initImportFlagDefs=[{'name':a26_0x673cad(0x1cf),'type':'string','description':a26_0x673cad(0x1b2),'required':!![]},{'name':a26_0x673cad(0x1d9),'type':a26_0x673cad(0x1d2),'description':'Override\x20imported\x20default\x20appcode'},{'name':a26_0x673cad(0x1ca),'type':a26_0x673cad(0x1d2),'description':a26_0x673cad(0x1ab),'enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x673cad(0x1ea),'type':a26_0x673cad(0x1bb),'description':a26_0x673cad(0x1c3)+PRODUCT_CONFIG[a26_0x673cad(0x1d3)]+')\x20instead\x20of\x20project','default':![]},{'name':a26_0x673cad(0x1e6),'type':a26_0x673cad(0x1bb),'description':a26_0x673cad(0x1ec),'default':![]}];export async function runInit(_0x250a4f){const _0x3b309c=a26_0x673cad,_0x3350b6=isNonInteractiveMode(_0x250a4f),_0x1631cd=_0x250a4f[_0x3b309c(0x1ea)]?_0x3b309c(0x1ea):_0x3b309c(0x1ad),_0x2d3f8f=resolveWriteConfigPath(_0x1631cd);try{_0x3350b6?await runNonInteractive(_0x250a4f,_0x2d3f8f):await runInteractive(_0x250a4f,_0x2d3f8f);}catch(_0x16050a){if(_0x16050a instanceof AbortPrompt)throw CliErrors[_0x3b309c(0x1dd)]();throw _0x16050a;}}export async function runInitImport(_0x105ee3){const _0x367372=a26_0x673cad,_0x379545=_0x105ee3['global']?_0x367372(0x1ea):_0x367372(0x1ad),_0x328e0b=resolveWriteConfigPath(_0x379545);await runFromImport(_0x105ee3,_0x328e0b);}const RUNTIME_IRRELEVANT_KEYS=new Set([a26_0x673cad(0x1a6)]);async function runFromImport(_0x413451,_0x386e15){const _0x4ad329=a26_0x673cad,_0x1f9475=resolveFilePath(_0x413451[_0x4ad329(0x1cf)]);if(!existsSync(_0x1f9475))throw CliErrors[_0x4ad329(0x1d4)](_0x4ad329(0x1c8)+_0x1f9475);const _0x37ae08=readSourceFile(_0x1f9475),_0x3eb028=convertToRuntimeConfig(_0x37ae08);_0x413451['appcode']&&(_0x3eb028[_0x4ad329(0x1d9)]=String(_0x413451[_0x4ad329(0x1d9)]));_0x413451['env']&&(_0x3eb028[_0x4ad329(0x1ca)]=resolveInitEnv(_0x413451));if(!_0x3eb028[_0x4ad329(0x1d9)])throw CliErrors[_0x4ad329(0x1d4)](_0x4ad329(0x1bc),_0x4ad329(0x1e7));await writeInitConfig(_0x386e15,_0x3eb028,_0x413451),console[_0x4ad329(0x1ae)](_0x4ad329(0x1e2)+_0x1f9475),console[_0x4ad329(0x1ae)](_0x4ad329(0x1c9)+_0x386e15),console[_0x4ad329(0x1ae)]('\x20\x20appcode:\x20'+_0x3eb028['appcode']);if(_0x3eb028['defaultApp'])console[_0x4ad329(0x1ae)](_0x4ad329(0x1c1)+_0x3eb028[_0x4ad329(0x1bd)]);}function convertToRuntimeConfig(_0x31d237){const _0x17a4ff=a26_0x673cad;if(_0x31d237['apps']&&typeof _0x31d237[_0x17a4ff(0x1be)]==='object')throw CliErrors[_0x17a4ff(0x1d4)](_0x17a4ff(0x1b3),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x31e8b5={};for(const _0x2e4d17 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x31d237[_0x2e4d17]!==undefined&&(_0x31e8b5[_0x2e4d17]=_0x31d237[_0x2e4d17]);}return!_0x31e8b5[_0x17a4ff(0x1af)]&&(_0x31e8b5[_0x17a4ff(0x1af)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x31e8b5;}async function runNonInteractive(_0x293681,_0xdda148){const _0x5a8a87=a26_0x673cad,_0x15dc24=_0x293681['appcode'];if(!_0x15dc24)throw CliErrors[_0x5a8a87(0x1a9)](_0x5a8a87(0x1d9),_0x5a8a87(0x1b4)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0xb05980=resolveInitEnv(_0x293681);await writeInitConfig(_0xdda148,{'appcode':_0x15dc24,'env':_0xb05980},_0x293681),console[_0x5a8a87(0x1ae)](_0x5a8a87(0x1dc)+_0xdda148),console[_0x5a8a87(0x1ae)](_0x5a8a87(0x1cb)+_0x15dc24),console[_0x5a8a87(0x1ae)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0xb05980);}async function runInteractive(_0x58cc0b,_0x5ce12e){const _0x12c53b=a26_0x673cad,_0x54ad2e=loadExisting(_0x5ce12e),_0x1d53a9=typeof _0x54ad2e?.[_0x12c53b(0x1d9)]===_0x12c53b(0x1d2)?_0x54ad2e[_0x12c53b(0x1d9)]:'',_0x4ad219=resolveInitEnv(_0x58cc0b);console[_0x12c53b(0x1ae)](CLI_BIN_NAME+_0x12c53b(0x1e5)+PRODUCT_CONFIG[_0x12c53b(0x1d3)]+'\x0a');if(existsSync(_0x5ce12e)&&!_0x58cc0b[_0x12c53b(0x1e6)]){const _0x1442ed=await promptYesNo('File\x20'+_0x5ce12e+_0x12c53b(0x1cc),![]);if(!_0x1442ed){console['log'](_0x12c53b(0x1ba));return;}}const _0x280b13=typeof _0x58cc0b['appcode']==='string'?_0x58cc0b[_0x12c53b(0x1d9)][_0x12c53b(0x1bf)]():'';let _0x3a6ebf=_0x280b13;!_0x3a6ebf&&(_0x3a6ebf=await promptInput(_0x12c53b(0x1c4),_0x1d53a9));if(!_0x3a6ebf[_0x12c53b(0x1bf)]())throw CliErrors[_0x12c53b(0x1d4)](_0x12c53b(0x1e9));await writeInitConfig(_0x5ce12e,{'appcode':_0x3a6ebf[_0x12c53b(0x1bf)](),'env':_0x4ad219},_0x58cc0b),console[_0x12c53b(0x1ae)](_0x12c53b(0x1e0)+_0x5ce12e),console[_0x12c53b(0x1ae)](_0x12c53b(0x1cb)+_0x3a6ebf[_0x12c53b(0x1bf)]()),console[_0x12c53b(0x1ae)](_0x12c53b(0x1cd)+_0x4ad219);}function a26_0x9359(_0x300215,_0x3de408){_0x300215=_0x300215-0x1a5;const _0x563a75=a26_0x563a();let _0x93597a=_0x563a75[_0x300215];return _0x93597a;}async function writeInitConfig(_0x13ce85,_0x6130bd,_0x117a87){const _0x59331a=a26_0x673cad;let _0x3d6e7a={};existsSync(_0x13ce85)&&!_0x117a87[_0x59331a(0x1e6)]&&(_0x3d6e7a=readConfigFile(_0x13ce85));for(const [_0x49a839,_0x4c5cbd]of Object[_0x59331a(0x1c6)](_0x6130bd)){_0x4c5cbd!==undefined&&(_0x3d6e7a[_0x49a839]=_0x4c5cbd);}if(_0x3d6e7a['app'])delete _0x3d6e7a[_0x59331a(0x1ac)];writeConfigFile(_0x13ce85,_0x3d6e7a);}class AbortPrompt extends Error{constructor(){const _0x32827c=a26_0x673cad;super(_0x32827c(0x1d5)),this[_0x32827c(0x1c7)]=_0x32827c(0x1d7);}}function createSafeRl(){const _0x214a8d=a26_0x673cad,_0x6d1a77=createInterface({'input':process[_0x214a8d(0x1b0)],'output':process[_0x214a8d(0x1df)]});let _0x4e368b;const _0x28062b=new Promise((_0x35916f,_0x3c6067)=>{_0x4e368b=()=>{const _0x519695=a26_0x9359;_0x4e368b&&(_0x6d1a77['removeListener'](_0x519695(0x1b7),_0x4e368b),_0x4e368b=undefined);try{_0x6d1a77[_0x519695(0x1b6)]();}catch{}_0x3c6067(new AbortPrompt());},_0x6d1a77['once']('SIGINT',_0x4e368b);}),_0x390b4c=()=>{const _0x166498=_0x214a8d;_0x4e368b&&(_0x6d1a77['removeListener'](_0x166498(0x1b7),_0x4e368b),_0x4e368b=undefined);try{_0x6d1a77[_0x166498(0x1b6)]();}catch{}};return{'rl':_0x6d1a77,'abortPromise':_0x28062b,'disposeSuccess':_0x390b4c};}async function promptInput(_0x47e819,_0x176c73){const _0x2356a4=a26_0x673cad,{rl:_0x8598af,abortPromise:_0x40260b,disposeSuccess:_0x248af1}=createSafeRl(),_0x7cf2cd=new Promise(_0xfb5c81=>{const _0x66ee43=a26_0x9359,_0x386999=_0x176c73?'\x20\x20'+_0x47e819+'\x20('+_0x176c73+'):\x20':'\x20\x20'+_0x47e819+':\x20';_0x8598af[_0x66ee43(0x1e1)](_0x386999,_0x1877cf=>{_0x248af1(),_0xfb5c81(_0x1877cf['trim']()||_0x176c73);});});return Promise[_0x2356a4(0x1c0)]([_0x7cf2cd,_0x40260b]);}async function promptYesNo(_0x5bb9ce,_0x3b2b60){const _0x35ef99=a26_0x673cad,{rl:_0x12b111,abortPromise:_0x583500,disposeSuccess:_0x4ab7a2}=createSafeRl(),_0x331e62=new Promise(_0x2b9bac=>{const _0x68e3ae=a26_0x9359,_0x44502d=_0x3b2b60?'[Y/n]':_0x68e3ae(0x1db);_0x12b111['question']('\x20\x20'+_0x5bb9ce+'\x20'+_0x44502d+':\x20',_0x39dc53=>{const _0xb0f864=_0x68e3ae;_0x4ab7a2();const _0x491aff=_0x39dc53[_0xb0f864(0x1bf)]()[_0xb0f864(0x1c5)]();if(_0x491aff==='y'||_0x491aff===_0xb0f864(0x1e6))_0x2b9bac(!![]);else{if(_0x491aff==='n'||_0x491aff==='no')_0x2b9bac(![]);else _0x2b9bac(_0x3b2b60);}});});return Promise[_0x35ef99(0x1c0)]([_0x331e62,_0x583500]);}function loadExisting(_0x4f840a){if(!existsSync(_0x4f840a))return null;return readConfigFile(_0x4f840a);}function resolveFilePath(_0x174c3c){const _0x408ab3=a26_0x673cad;return isAbsolute(_0x174c3c)?_0x174c3c:resolve(process[_0x408ab3(0x1ce)](),_0x174c3c);}function readSourceFile(_0x23aeae){const _0x78f559=a26_0x673cad;try{const _0x1ebfd4=readFileSync(_0x23aeae,{'encoding':'utf8'});return JSON['parse'](_0x1ebfd4);}catch(_0x52e00a){throw CliErrors[_0x78f559(0x1d4)](_0x78f559(0x1d8)+_0x52e00a[_0x78f559(0x1e4)]);}}function resolveInitEnv(_0x5aa21e){const _0x13fcb6=a26_0x673cad,_0x4bbe5b=_0x5aa21e[_0x13fcb6(0x1ca)];if(_0x4bbe5b===undefined||_0x4bbe5b==='')return DEFAULT_CONFIG_VALUES[_0x13fcb6(0x1ca)];if(!RUNTIME_ENV_VALUES[_0x13fcb6(0x1b9)](_0x4bbe5b))throw CliErrors[_0x13fcb6(0x1d4)](_0x13fcb6(0x1b8)+_0x4bbe5b+_0x13fcb6(0x1a8)+RUNTIME_ENV_VALUES[_0x13fcb6(0x1e3)](',\x20'));return _0x4bbe5b;}
|
|
1
|
+
const a26_0x36a972=a26_0x555c;function a26_0x555c(_0x20fa7c,_0x591a11){_0x20fa7c=_0x20fa7c-0x181;const _0x5c59fc=a26_0x5c59();let _0x555ca5=_0x5c59fc[_0x20fa7c];return _0x555ca5;}(function(_0x2668ef,_0x5f3d0d){const _0x2ba8a7=a26_0x555c,_0x39945b=_0x2668ef();while(!![]){try{const _0x1e3bad=parseInt(_0x2ba8a7(0x181))/0x1+parseInt(_0x2ba8a7(0x1c5))/0x2+-parseInt(_0x2ba8a7(0x18d))/0x3+-parseInt(_0x2ba8a7(0x191))/0x4*(parseInt(_0x2ba8a7(0x1a4))/0x5)+parseInt(_0x2ba8a7(0x195))/0x6+-parseInt(_0x2ba8a7(0x1b6))/0x7+parseInt(_0x2ba8a7(0x189))/0x8;if(_0x1e3bad===_0x5f3d0d)break;else _0x39945b['push'](_0x39945b['shift']());}catch(_0x5e76b9){_0x39945b['push'](_0x39945b['shift']());}}}(a26_0x5c59,0x206af));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';function a26_0x5c59(){const _0x3308d7=['string','question','App\x20code\x20for\x20the\x20project','\x0aInitialized\x20','cwd','20584UVrxgi','78010EbVMmJ','object','User\x20aborted\x20prompt','App\x20code\x20cannot\x20be\x20empty.','cancelled','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','\x20already\x20exists.\x20Overwrite?','toLowerCase','3073760rrzYKx','apps','message','File\x20','159288iYtOTM','entries','file','newConfigFileName','92hsixxw','[Y/n]','Target\x20environment\x20(default\x20','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','768972xXSSUH','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`.','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','includes','name','app','\x20\x20appcode:\x20','project',')\x20instead\x20of\x20project','\x22.\x20Allowed:\x20','once','Source\x20file\x20not\x20found:\x20','riskLevel','appcode','):\x20','33370AufFeY','boolean','Override\x20imported\x20default\x20env','race','Skip\x20confirmation\x20when\x20overwriting','global','close','stdout','trim','Imported\x20from\x20','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','Override\x20imported\x20default\x20appcode','Failed\x20to\x20parse\x20source\x20file:\x20','\x20\x20config:\x20\x20','App\x20code','env','Invalid\x20env\x20\x22','removeListener','1829121XQgHYk','apiDir','stdin','log','SIGINT','validation','\x20\x20env:\x20\x20\x20\x20\x20','yes','defaultApp','AbortPrompt'];a26_0x5c59=function(){return _0x3308d7;};return a26_0x5c59();}export const initCreateFlagDefs=[{'name':a26_0x36a972(0x1a2),'type':a26_0x36a972(0x1c0),'description':a26_0x36a972(0x1c2)},{'name':'env','type':a26_0x36a972(0x1c0),'description':a26_0x36a972(0x193)+DEFAULT_CONFIG_VALUES['env']+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x36a972(0x1a9),'type':a26_0x36a972(0x1a5),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a26_0x36a972(0x190)]+a26_0x36a972(0x19d),'default':![]},{'name':'yes','type':a26_0x36a972(0x1a5),'description':a26_0x36a972(0x1a8),'default':![]}];export const initImportFlagDefs=[{'name':a26_0x36a972(0x18f),'type':a26_0x36a972(0x1c0),'description':a26_0x36a972(0x186),'required':!![]},{'name':a26_0x36a972(0x1a2),'type':'string','description':a26_0x36a972(0x1af)},{'name':a26_0x36a972(0x1b3),'type':a26_0x36a972(0x1c0),'description':a26_0x36a972(0x1a6),'enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':'boolean','description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG['newConfigFileName']+a26_0x36a972(0x19d),'default':![]},{'name':'yes','type':a26_0x36a972(0x1a5),'description':a26_0x36a972(0x1a8),'default':![]}];export async function runInit(_0x50e981){const _0x328190=a26_0x36a972,_0x58620c=isNonInteractiveMode(_0x50e981),_0x2779f3=_0x50e981['global']?_0x328190(0x1a9):_0x328190(0x19c),_0x259e90=resolveWriteConfigPath(_0x2779f3);try{_0x58620c?await runNonInteractive(_0x50e981,_0x259e90):await runInteractive(_0x50e981,_0x259e90);}catch(_0x28ded5){if(_0x28ded5 instanceof AbortPrompt)throw CliErrors[_0x328190(0x185)]();throw _0x28ded5;}}export async function runInitImport(_0x4cd909){const _0x32840a=a26_0x36a972,_0x4047c2=_0x4cd909[_0x32840a(0x1a9)]?_0x32840a(0x1a9):'project',_0x14972c=resolveWriteConfigPath(_0x4047c2);await runFromImport(_0x4cd909,_0x14972c);}const RUNTIME_IRRELEVANT_KEYS=new Set([a26_0x36a972(0x1b7)]);async function runFromImport(_0x7863b2,_0x4e96e7){const _0x7d8762=a26_0x36a972,_0x4e603d=resolveFilePath(_0x7863b2[_0x7d8762(0x18f)]);if(!existsSync(_0x4e603d))throw CliErrors[_0x7d8762(0x1bb)](_0x7d8762(0x1a0)+_0x4e603d);const _0x5a38c4=readSourceFile(_0x4e603d),_0x1c5931=convertToRuntimeConfig(_0x5a38c4);_0x7863b2[_0x7d8762(0x1a2)]&&(_0x1c5931[_0x7d8762(0x1a2)]=String(_0x7863b2[_0x7d8762(0x1a2)]));_0x7863b2[_0x7d8762(0x1b3)]&&(_0x1c5931[_0x7d8762(0x1b3)]=resolveInitEnv(_0x7863b2));if(!_0x1c5931[_0x7d8762(0x1a2)])throw CliErrors[_0x7d8762(0x1bb)](_0x7d8762(0x1ae),_0x7d8762(0x196));await writeInitConfig(_0x4e96e7,_0x1c5931,_0x7863b2),console['log'](_0x7d8762(0x1ad)+_0x4e603d),console[_0x7d8762(0x1b9)](_0x7d8762(0x1b1)+_0x4e96e7),console[_0x7d8762(0x1b9)]('\x20\x20appcode:\x20'+_0x1c5931[_0x7d8762(0x1a2)]);if(_0x1c5931['defaultApp'])console['log']('\x20\x20default:\x20'+_0x1c5931[_0x7d8762(0x1be)]);}function convertToRuntimeConfig(_0x10ac28){const _0x247272=a26_0x36a972;if(_0x10ac28[_0x247272(0x18a)]&&typeof _0x10ac28[_0x247272(0x18a)]===_0x247272(0x182))throw CliErrors[_0x247272(0x1bb)](_0x247272(0x194),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x19a5a2={};for(const _0xbff7cf of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x10ac28[_0xbff7cf]!==undefined&&(_0x19a5a2[_0xbff7cf]=_0x10ac28[_0xbff7cf]);}return!_0x19a5a2[_0x247272(0x1a1)]&&(_0x19a5a2[_0x247272(0x1a1)]=DEFAULT_CONFIG_VALUES[_0x247272(0x1a1)]),_0x19a5a2;}async function runNonInteractive(_0x71a0b4,_0x4e048a){const _0x3d0a8b=a26_0x36a972,_0x52df0a=_0x71a0b4[_0x3d0a8b(0x1a2)];if(!_0x52df0a)throw CliErrors['flagMissing'](_0x3d0a8b(0x1a2),'Usage:\x20'+CLI_BIN_NAME+_0x3d0a8b(0x197));const _0x395eec=resolveInitEnv(_0x71a0b4);await writeInitConfig(_0x4e048a,{'appcode':_0x52df0a,'env':_0x395eec},_0x71a0b4),console['log']('Initialized\x20'+_0x4e048a),console['log'](_0x3d0a8b(0x19b)+_0x52df0a),console[_0x3d0a8b(0x1b9)](_0x3d0a8b(0x1bc)+_0x395eec);}async function runInteractive(_0x1acd9f,_0x2662e2){const _0x408265=a26_0x36a972,_0x52fdab=loadExisting(_0x2662e2),_0x5ba3c0=typeof _0x52fdab?.[_0x408265(0x1a2)]===_0x408265(0x1c0)?_0x52fdab[_0x408265(0x1a2)]:'',_0x509288=resolveInitEnv(_0x1acd9f);console[_0x408265(0x1b9)](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG[_0x408265(0x190)]+'\x0a');if(existsSync(_0x2662e2)&&!_0x1acd9f[_0x408265(0x1bd)]){const _0xeab6c5=await promptYesNo(_0x408265(0x18c)+_0x2662e2+_0x408265(0x187),![]);if(!_0xeab6c5){console['log']('Aborted.');return;}}const _0x1c64f5=typeof _0x1acd9f[_0x408265(0x1a2)]==='string'?_0x1acd9f[_0x408265(0x1a2)][_0x408265(0x1ac)]():'';let _0x52e834=_0x1c64f5;!_0x52e834&&(_0x52e834=await promptInput(_0x408265(0x1b2),_0x5ba3c0));if(!_0x52e834[_0x408265(0x1ac)]())throw CliErrors[_0x408265(0x1bb)](_0x408265(0x184));await writeInitConfig(_0x2662e2,{'appcode':_0x52e834[_0x408265(0x1ac)](),'env':_0x509288},_0x1acd9f),console['log'](_0x408265(0x1c3)+_0x2662e2),console[_0x408265(0x1b9)](_0x408265(0x19b)+_0x52e834[_0x408265(0x1ac)]()),console['log'](_0x408265(0x1bc)+_0x509288);}async function writeInitConfig(_0xe15849,_0x3bb96f,_0xea478c){const _0x76285=a26_0x36a972;let _0x38a31d={};existsSync(_0xe15849)&&!_0xea478c[_0x76285(0x1bd)]&&(_0x38a31d=readConfigFile(_0xe15849));for(const [_0xb3468a,_0x142eb4]of Object[_0x76285(0x18e)](_0x3bb96f)){_0x142eb4!==undefined&&(_0x38a31d[_0xb3468a]=_0x142eb4);}if(_0x38a31d[_0x76285(0x19a)])delete _0x38a31d[_0x76285(0x19a)];writeConfigFile(_0xe15849,_0x38a31d);}class AbortPrompt extends Error{constructor(){const _0xd34339=a26_0x36a972;super(_0xd34339(0x183)),this[_0xd34339(0x199)]=_0xd34339(0x1bf);}}function createSafeRl(){const _0x445492=a26_0x36a972,_0xb92a73=createInterface({'input':process[_0x445492(0x1b8)],'output':process[_0x445492(0x1ab)]});let _0x7580ba;const _0x56e253=new Promise((_0x14d4b5,_0xac886a)=>{const _0x23ecba=_0x445492;_0x7580ba=()=>{const _0x30cc2a=a26_0x555c;_0x7580ba&&(_0xb92a73[_0x30cc2a(0x1b5)]('SIGINT',_0x7580ba),_0x7580ba=undefined);try{_0xb92a73[_0x30cc2a(0x1aa)]();}catch{}_0xac886a(new AbortPrompt());},_0xb92a73[_0x23ecba(0x19f)]('SIGINT',_0x7580ba);}),_0x449b7e=()=>{const _0x5dc87c=_0x445492;_0x7580ba&&(_0xb92a73[_0x5dc87c(0x1b5)](_0x5dc87c(0x1ba),_0x7580ba),_0x7580ba=undefined);try{_0xb92a73[_0x5dc87c(0x1aa)]();}catch{}};return{'rl':_0xb92a73,'abortPromise':_0x56e253,'disposeSuccess':_0x449b7e};}async function promptInput(_0x7792e,_0x1dd869){const _0x3d620e=a26_0x36a972,{rl:_0xb61f31,abortPromise:_0x3b29f7,disposeSuccess:_0x370b2d}=createSafeRl(),_0x303843=new Promise(_0x354e73=>{const _0x10849d=a26_0x555c,_0x5123c7=_0x1dd869?'\x20\x20'+_0x7792e+'\x20('+_0x1dd869+_0x10849d(0x1a3):'\x20\x20'+_0x7792e+':\x20';_0xb61f31['question'](_0x5123c7,_0x491574=>{const _0x24468d=_0x10849d;_0x370b2d(),_0x354e73(_0x491574[_0x24468d(0x1ac)]()||_0x1dd869);});});return Promise[_0x3d620e(0x1a7)]([_0x303843,_0x3b29f7]);}async function promptYesNo(_0x56fb91,_0x415dbb){const _0x122ce1=a26_0x36a972,{rl:_0x68c779,abortPromise:_0x255188,disposeSuccess:_0x53adb3}=createSafeRl(),_0x5eb069=new Promise(_0x5351ca=>{const _0x32f395=a26_0x555c,_0x164edc=_0x415dbb?_0x32f395(0x192):'[y/N]';_0x68c779[_0x32f395(0x1c1)]('\x20\x20'+_0x56fb91+'\x20'+_0x164edc+':\x20',_0x3bc4a7=>{const _0xc137c5=_0x32f395;_0x53adb3();const _0x440d02=_0x3bc4a7[_0xc137c5(0x1ac)]()[_0xc137c5(0x188)]();if(_0x440d02==='y'||_0x440d02===_0xc137c5(0x1bd))_0x5351ca(!![]);else{if(_0x440d02==='n'||_0x440d02==='no')_0x5351ca(![]);else _0x5351ca(_0x415dbb);}});});return Promise[_0x122ce1(0x1a7)]([_0x5eb069,_0x255188]);}function loadExisting(_0x567bf0){if(!existsSync(_0x567bf0))return null;return readConfigFile(_0x567bf0);}function resolveFilePath(_0x1fdaab){const _0x9fb27d=a26_0x36a972;return isAbsolute(_0x1fdaab)?_0x1fdaab:resolve(process[_0x9fb27d(0x1c4)](),_0x1fdaab);}function readSourceFile(_0x432369){const _0x3ecc95=a26_0x36a972;try{const _0x5d660a=readFileSync(_0x432369,{'encoding':'utf8'});return JSON['parse'](_0x5d660a);}catch(_0x569b92){throw CliErrors[_0x3ecc95(0x1bb)](_0x3ecc95(0x1b0)+_0x569b92[_0x3ecc95(0x18b)]);}}function resolveInitEnv(_0x4819d3){const _0x26d72c=a26_0x36a972,_0x4c2aea=_0x4819d3['env'];if(_0x4c2aea===undefined||_0x4c2aea==='')return DEFAULT_CONFIG_VALUES[_0x26d72c(0x1b3)];if(!RUNTIME_ENV_VALUES[_0x26d72c(0x198)](_0x4c2aea))throw CliErrors[_0x26d72c(0x1bb)](_0x26d72c(0x1b4)+_0x4c2aea+_0x26d72c(0x19e)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x4c2aea;}
|