@lovrabet/lovrabet-cli 2.1.1-beta.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
|
-
|
|
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
|
-
|
|
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_0xbe9d31=a18_0x5270;(function(_0x4c8a6,_0xd4f59a){const _0x8b550=a18_0x5270,_0x420c1a=_0x4c8a6();while(!![]){try{const _0xe0555b=-parseInt(_0x8b550(0x144))/0x1*(parseInt(_0x8b550(0x143))/0x2)+parseInt(_0x8b550(0x173))/0x3+parseInt(_0x8b550(0x13b))/0x4+parseInt(_0x8b550(0x172))/0x5*(parseInt(_0x8b550(0x152))/0x6)+parseInt(_0x8b550(0x167))/0x7+-parseInt(_0x8b550(0x155))/0x8*(parseInt(_0x8b550(0x14f))/0x9)+-parseInt(_0x8b550(0x175))/0xa*(parseInt(_0x8b550(0x159))/0xb);if(_0xe0555b===_0xd4f59a)break;else _0x420c1a['push'](_0x420c1a['shift']());}catch(_0x199790){_0x420c1a['push'](_0x420c1a['shift']());}}}(a18_0x3af2,0xa56b2));import{CliErrors}from'../../errors.js';function a18_0x5270(_0x30642b,_0x54c26e){_0x30642b=_0x30642b-0x13a;const _0x3af273=a18_0x3af2();let _0x5270a7=_0x3af273[_0x30642b];return _0x5270a7;}import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';function a18_0x3af2(){const _0x5f2d25=['2398880MiWOzZ','\x22.\x20Allowed:\x20','log','value','delete','set','trim','args','547442yISfbh','2MDXecD','project-or-global-explicit','boolean','validation','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','get','apps','\x20\x20project:\x20','includes','`\x20=\x20\x22','length','27InccFa','join','field','6GzWJAM','split','Key\x20\x22','80192qVcOzD','list','key','Settable\x20keys:\x20','588412nZoqbx','raw',';\x20apps.<alias>.appcode','List\x20current\x20config','alias','Value\x20to\x20assign','Usage:\x20','../../context.js','\x20config\x20delete\x20<key>\x20[--global]','isArray','Missing\x20key\x20or\x20value.','keys','\x22\x20not\x20found\x20at\x20top\x20level.','riskLevel','942711kbVDCc','\x22\x20is\x20not\x20settable.','Key\x20not\x20found:\x20','Set\x20a\x20config\x20value','Config\x20files:\x0a','Missing\x20key\x20argument.','stringify','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','appcode','Delete\x20a\x20config\x20value','\x20(global)','6498905jmkRER','1514106jzjzSz','Deleted\x20`','240OXvCFj','write','object','(none)','global','read','format'];a18_0x3af2=function(){return _0x5f2d25;};return a18_0x3af2();}const GLOBAL_FLAG={'name':'global','type':a18_0xbe9d31(0x146),'description':'Write\x20to\x20global\x20config','default':![]};function parseAliasAppcodeSetKey(_0x1c6eeb){const _0x4175d7=a18_0xbe9d31,_0x1d909d=_0x1c6eeb['split']('.');if(_0x1d909d[_0x4175d7(0x14e)]!==0x3||_0x1d909d[0x0]!==_0x4175d7(0x14a)||_0x1d909d[0x2]!==_0x4175d7(0x16f))return undefined;const _0x3c617a=_0x1d909d[0x1]?.[_0x4175d7(0x141)]();return _0x3c617a?_0x3c617a:undefined;}function parseAliasDeleteKey(_0x24fdc7){const _0x1463cd=a18_0xbe9d31,_0x29108c=_0x24fdc7['split']('.');if(_0x29108c[_0x1463cd(0x14e)]===0x2&&_0x29108c[0x0]===_0x1463cd(0x14a)){const _0xd52d66=_0x29108c[0x1]?.[_0x1463cd(0x141)]();return _0xd52d66?{'alias':_0xd52d66}:undefined;}if(_0x29108c[_0x1463cd(0x14e)]===0x3&&_0x29108c[0x0]===_0x1463cd(0x14a)&&_0x29108c[0x2]==='appcode'){const _0x29b294=_0x29108c[0x1]?.[_0x1463cd(0x141)]();return _0x29b294?{'alias':_0x29b294,'field':'appcode'}:undefined;}return undefined;}function setLocalAppAlias(_0x4fbe7e,_0x5e9a11,_0x4706ad){const _0x2dde22=a18_0xbe9d31,_0x4ed8ca=_0x4fbe7e['apps']&&typeof _0x4fbe7e[_0x2dde22(0x14a)]===_0x2dde22(0x177)&&!Array[_0x2dde22(0x162)](_0x4fbe7e[_0x2dde22(0x14a)])?_0x4fbe7e[_0x2dde22(0x14a)]:{},_0x24685b=_0x4ed8ca[_0x5e9a11]&&typeof _0x4ed8ca[_0x5e9a11]==='object'&&!Array[_0x2dde22(0x162)](_0x4ed8ca[_0x5e9a11])?_0x4ed8ca[_0x5e9a11]:{};_0x24685b[_0x2dde22(0x16f)]=_0x4706ad,_0x4ed8ca[_0x5e9a11]=_0x24685b,_0x4fbe7e[_0x2dde22(0x14a)]=_0x4ed8ca;}function deleteLocalAppAlias(_0x5eb076,_0x5c74d1){const _0x1502e6=a18_0xbe9d31;if(!_0x5eb076[_0x1502e6(0x14a)]||typeof _0x5eb076[_0x1502e6(0x14a)]!=='object'||Array[_0x1502e6(0x162)](_0x5eb076[_0x1502e6(0x14a)]))return![];const _0x565c5c=_0x5eb076[_0x1502e6(0x14a)],_0x43f418=_0x565c5c[_0x5c74d1['alias']];if(!_0x43f418||typeof _0x43f418!=='object'||Array[_0x1502e6(0x162)](_0x43f418))return![];if(!_0x5c74d1[_0x1502e6(0x151)])return delete _0x565c5c[_0x5c74d1[_0x1502e6(0x15d)]],!![];if(!(_0x5c74d1[_0x1502e6(0x151)]in _0x43f418))return![];return delete _0x43f418[_0x5c74d1[_0x1502e6(0x151)]],Object[_0x1502e6(0x164)](_0x43f418)['length']===0x0&&delete _0x565c5c[_0x5c74d1['alias']],!![];}const listDef={'service':'config','command':a18_0xbe9d31(0x156),'description':a18_0xbe9d31(0x15c),'risk':a18_0xbe9d31(0x17a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x5ef1d3){const _0x4b8033=a18_0xbe9d31,{buildConfigFromFlags:_0x3318b5}=await import(_0x4b8033(0x160)),_0x5e70ef=_0x3318b5({}),_0x5e3a0c=getProjectConfigPath(),_0x3da313=resolveWriteConfigPath('global');if(_0x5ef1d3[_0x4b8033(0x13a)]==='pretty')return{'ok':!![],'message':_0x4b8033(0x16e)+(JSON[_0x4b8033(0x16d)](_0x5e70ef[_0x4b8033(0x15a)],null,0x2)+'\x0a\x0a')+_0x4b8033(0x16b)+(_0x4b8033(0x14b)+(_0x5e3a0c??_0x4b8033(0x178))+'\x0a')+('\x20\x20global:\x20\x20'+_0x3da313)};return{'ok':!![],'data':{'effective':_0x5e70ef['raw'],'configFiles':{'project':_0x5e3a0c??null,'global':_0x3da313}}};}},getDef={'service':'config','command':a18_0xbe9d31(0x149),'description':'Get\x20a\x20config\x20value','risk':a18_0xbe9d31(0x17a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0xbe9d31(0x157),'description':'Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','required':!![]}],'flags':[],async 'execute'(_0x3bed17){const _0x34e8ab=a18_0xbe9d31,_0xb749c9=_0x3bed17[_0x34e8ab(0x142)][0x0];if(!_0xb749c9)throw CliErrors[_0x34e8ab(0x147)]('Missing\x20key\x20argument.','Usage:\x20'+CLI_BIN_NAME+'\x20config\x20get\x20<key>');const {buildConfigFromFlags:_0x4a4dd5}=await import(_0x34e8ab(0x160)),{raw:_0x3f07a2}=_0x4a4dd5({});if(_0xb749c9['includes']('.')){const _0x1f918b=_0xb749c9[_0x34e8ab(0x153)]('.');let _0x491cb4=_0x3f07a2;for(const _0xfc9efb of _0x1f918b){if(_0x491cb4==null||typeof _0x491cb4!==_0x34e8ab(0x177))throw CliErrors[_0x34e8ab(0x147)](_0x34e8ab(0x169)+_0xb749c9);_0x491cb4=_0x491cb4[_0xfc9efb];}if(_0x491cb4===undefined)throw CliErrors['validation'](_0x34e8ab(0x169)+_0xb749c9);return console[_0x34e8ab(0x13d)](typeof _0x491cb4==='object'?JSON[_0x34e8ab(0x16d)](_0x491cb4,null,0x2):String(_0x491cb4)),{'ok':!![]};}const _0x506e3b=_0x3f07a2[_0xb749c9];if(_0x506e3b===undefined)throw CliErrors[_0x34e8ab(0x147)]('Key\x20not\x20found:\x20'+_0xb749c9);return console['log'](typeof _0x506e3b===_0x34e8ab(0x177)?JSON[_0x34e8ab(0x16d)](_0x506e3b,null,0x2):String(_0x506e3b)),{'ok':!![]};}},setDef={'service':'config','command':a18_0xbe9d31(0x140),'description':a18_0xbe9d31(0x16a),'risk':a18_0xbe9d31(0x176),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0xbe9d31(0x157),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a18_0xbe9d31(0x13e),'description':a18_0xbe9d31(0x15e),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x281178){const _0x44a94d=a18_0xbe9d31,_0x39a85d=_0x281178[_0x44a94d(0x142)][0x0],_0x3e9d83=_0x281178[_0x44a94d(0x142)][0x1];if(!_0x39a85d||_0x3e9d83===undefined)throw CliErrors[_0x44a94d(0x147)](_0x44a94d(0x163),_0x44a94d(0x15f)+CLI_BIN_NAME+'\x20config\x20set\x20<key>\x20<value>\x20[--global]');if(ENUM_KEYS[_0x39a85d]&&!ENUM_KEYS[_0x39a85d][_0x44a94d(0x14c)](_0x3e9d83))throw CliErrors[_0x44a94d(0x147)]('Invalid\x20value\x20for\x20\x22'+_0x39a85d+_0x44a94d(0x13c)+ENUM_KEYS[_0x39a85d][_0x44a94d(0x150)](',\x20'));if(_0x39a85d===_0x44a94d(0x166))throw CliErrors[_0x44a94d(0x147)](_0x44a94d(0x148));if(_0x39a85d==='pageSize'){const _0x2e9256=Number(_0x3e9d83);if(isNaN(_0x2e9256)||_0x2e9256<=0x0)throw CliErrors['validation']('pageSize\x20must\x20be\x20a\x20positive\x20number');}const _0x137661=resolveWriteScope({'explicitGlobal':_0x281178['bool'](_0x44a94d(0x179)),'policy':_0x44a94d(0x145)}),_0x37d045=toScopeFlags(_0x137661),_0x53599d=readScopedConfig(_0x37d045),_0x358373=parseAliasAppcodeSetKey(_0x39a85d);if(!_0x358373&&!isTopLevelConfigKey(_0x39a85d))throw CliErrors[_0x44a94d(0x147)]('Top-level\x20key\x20\x22'+_0x39a85d+_0x44a94d(0x168),_0x44a94d(0x158)+getTopLevelConfigKeySummary()+_0x44a94d(0x15b));return _0x358373?setLocalAppAlias(_0x53599d,_0x358373,_0x3e9d83):_0x53599d[_0x39a85d]=_0x39a85d==='pageSize'?Number(_0x3e9d83):_0x3e9d83,console[_0x44a94d(0x13d)]('Set\x20`'+_0x39a85d+_0x44a94d(0x14d)+_0x3e9d83+'\x22'+(_0x137661==='global'?_0x44a94d(0x171):'')),writeScopedConfig(_0x53599d,_0x37d045),{'ok':!![]};}},deleteDef={'service':'config','command':a18_0xbe9d31(0x13f),'description':a18_0xbe9d31(0x170),'risk':a18_0xbe9d31(0x176),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0xbe9d31(0x157),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x2cb998){const _0x43c9ad=a18_0xbe9d31,_0x205f66=_0x2cb998[_0x43c9ad(0x142)][0x0];if(!_0x205f66)throw CliErrors[_0x43c9ad(0x147)](_0x43c9ad(0x16c),'Usage:\x20'+CLI_BIN_NAME+_0x43c9ad(0x161));const _0x571d3a=resolveWriteScope({'explicitGlobal':_0x2cb998['bool']('global'),'policy':_0x43c9ad(0x145)}),_0x90d0f5=toScopeFlags(_0x571d3a),_0x57ab1c=readScopedConfig(_0x90d0f5),_0xb7ca1e=parseAliasDeleteKey(_0x205f66);if(_0xb7ca1e){if(!deleteLocalAppAlias(_0x57ab1c,_0xb7ca1e))throw CliErrors[_0x43c9ad(0x147)](_0x43c9ad(0x169)+_0x205f66);return console[_0x43c9ad(0x13d)](_0x43c9ad(0x174)+_0x205f66+'`'+(_0x571d3a===_0x43c9ad(0x179)?_0x43c9ad(0x171):'')),writeScopedConfig(_0x57ab1c,_0x90d0f5),{'ok':!![]};}if(_0x57ab1c[_0x205f66]===undefined)throw CliErrors[_0x43c9ad(0x147)](_0x43c9ad(0x154)+_0x205f66+_0x43c9ad(0x165));return delete _0x57ab1c[_0x205f66],console['log'](_0x43c9ad(0x174)+_0x205f66+'`'+(_0x571d3a==='global'?_0x43c9ad(0x171):'')),writeScopedConfig(_0x57ab1c,_0x90d0f5),{'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
|
-
(function(
|
|
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_0x230f48=a20_0x36d1;(function(_0xb70eb6,_0xec7188){const _0x3f9840=a20_0x36d1,_0x5e8455=_0xb70eb6();while(!![]){try{const _0x596f4a=-parseInt(_0x3f9840(0x1e0))/0x1*(-parseInt(_0x3f9840(0x22f))/0x2)+parseInt(_0x3f9840(0x1fc))/0x3*(parseInt(_0x3f9840(0x21c))/0x4)+parseInt(_0x3f9840(0x217))/0x5*(parseInt(_0x3f9840(0x1e7))/0x6)+parseInt(_0x3f9840(0x210))/0x7*(-parseInt(_0x3f9840(0x20e))/0x8)+parseInt(_0x3f9840(0x21e))/0x9*(parseInt(_0x3f9840(0x228))/0xa)+-parseInt(_0x3f9840(0x204))/0xb+parseInt(_0x3f9840(0x234))/0xc;if(_0x596f4a===_0xec7188)break;else _0x5e8455['push'](_0x5e8455['shift']());}catch(_0x3c997e){_0x5e8455['push'](_0x5e8455['shift']());}}}(a20_0x1aa5,0x5c399));function a20_0x1aa5(){const _0x142ce9=['read','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','6732451KkfKxd','\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\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\x20on\x20dataset\x20','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','\x20\x20AGGREGATE\x20TYPES','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','helpExtra','8scRQsO','\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}]','559412FKIzwo','Update\x20an\x20existing\x20record','operation','\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}}','Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\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}}','aggregate','3070960sPNDUm','\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}','map','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','316WiLuTE','POST','6489vAghjN','now','\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}','str','description','\x20\x20EXAMPLES','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','delete','1810OldjqM','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','code','high-risk-write','\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}}]}','params','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','3162ynErAT','\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}','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','\x20completed\x20in\x20','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','764952WJibjP','command','update','body','\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}}','97caARRI','\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}}','paramsHint','Preview:\x20data\x20','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','risk','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','6uagJaZ','\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}}','filter','data\x20','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','batchCreate','write','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','build','Get\x20a\x20single\x20record\x20by\x20ID','\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\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\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','create','join','\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--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\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}','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','4098zdnQNf','data','\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}}','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','getOne','\x20\x20WHERE\x20OPERATORS'];a20_0x1aa5=function(){return _0x142ce9;};return a20_0x1aa5();}import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a20_0x230f48(0x1e9),'operation':a20_0x230f48(0x1e9),'risk':a20_0x230f48(0x202),'paramsRequired':![],'description':'Filter\x20dataset\x20records\x20with\x20query\x20conditions','paramsHint':'JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20'+a20_0x230f48(0x1e6),'helpExtra':[a20_0x230f48(0x201),a20_0x230f48(0x1e1),a20_0x230f48(0x213),'\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}}',a20_0x230f48(0x1fe),a20_0x230f48(0x215),a20_0x230f48(0x1df),'\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_0x230f48(0x20c),a20_0x230f48(0x1f3),a20_0x230f48(0x1e8),'','\x20\x20LOGICAL\x20COMBINATORS',a20_0x230f48(0x22c),a20_0x230f48(0x21a),'',a20_0x230f48(0x21b),a20_0x230f48(0x1ee),a20_0x230f48(0x1f1),a20_0x230f48(0x20f),a20_0x230f48(0x22e),a20_0x230f48(0x231),'','\x20\x20PAGINATION',a20_0x230f48(0x229),a20_0x230f48(0x206),a20_0x230f48(0x20a)][a20_0x230f48(0x1f6)]('\x0a')},{'command':a20_0x230f48(0x200),'operation':a20_0x230f48(0x200),'risk':'read','paramsRequired':!![],'description':a20_0x230f48(0x1f0),'paramsHint':a20_0x230f48(0x207)},{'command':'create','operation':a20_0x230f48(0x1f5),'risk':a20_0x230f48(0x1ed),'paramsRequired':!![],'description':a20_0x230f48(0x203),'paramsHint':a20_0x230f48(0x209)},{'command':a20_0x230f48(0x1ec),'operation':a20_0x230f48(0x1ec),'risk':a20_0x230f48(0x1ed),'paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','paramsHint':a20_0x230f48(0x225)},{'command':a20_0x230f48(0x236),'operation':'update','risk':a20_0x230f48(0x1ed),'paramsRequired':!![],'description':a20_0x230f48(0x211),'paramsHint':a20_0x230f48(0x1fb)},{'command':a20_0x230f48(0x227),'operation':a20_0x230f48(0x227),'risk':a20_0x230f48(0x22b),'paramsRequired':!![],'description':a20_0x230f48(0x1fa),'paramsHint':a20_0x230f48(0x207)},{'command':a20_0x230f48(0x216),'operation':a20_0x230f48(0x216),'risk':a20_0x230f48(0x202),'paramsRequired':![],'description':'Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','paramsHint':a20_0x230f48(0x1ff)+a20_0x230f48(0x214),'helpExtra':[a20_0x230f48(0x20b),a20_0x230f48(0x218),'\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}',a20_0x230f48(0x1f9),a20_0x230f48(0x220),a20_0x230f48(0x230),'\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}',a20_0x230f48(0x1f2),'','\x20\x20PARAMS\x20STRUCTURE',a20_0x230f48(0x205),a20_0x230f48(0x233),a20_0x230f48(0x1f7),a20_0x230f48(0x1f4),'\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_0x230f48(0x224),'',a20_0x230f48(0x223),a20_0x230f48(0x1e4),a20_0x230f48(0x1f8),'',a20_0x230f48(0x226),'\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_0x230f48(0x1eb)][a20_0x230f48(0x1f6)]('\x0a')}];function makeDataCommand(_0x1f6f02){const _0x5ea026=a20_0x230f48,_0x159030=_0x5ea026(0x1ea)+_0x1f6f02[_0x5ea026(0x235)],_0x3eeea7={'service':_0x5ea026(0x1fd),'command':_0x1f6f02['command'],'description':_0x1f6f02[_0x5ea026(0x222)],'risk':_0x1f6f02[_0x5ea026(0x1e5)],'helpExtra':_0x1f6f02[_0x5ea026(0x20d)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x1f6f02[_0x5ea026(0x1e2)]}],'validate':async _0x30f8b6=>{const _0x368106=_0x5ea026;_0x1f6f02['paramsRequired']&&requireAnyOf(_0x30f8b6,[_0x368106(0x22d)],_0x159030),_0x1f6f02[_0x368106(0x212)]==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x30f8b6[_0x368106(0x221)](_0x368106(0x22d))));},async 'execute'(_0x48ef00){const _0x1cd2b1=_0x5ea026,_0x2f59a7=_0x48ef00[_0x1cd2b1(0x221)](_0x1cd2b1(0x22a)),_0x5317d0=_0x1f6f02[_0x1cd2b1(0x212)]===_0x1cd2b1(0x1ec)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x48ef00[_0x1cd2b1(0x221)](_0x1cd2b1(0x22d)))):parseJsonParams(_0x48ef00[_0x1cd2b1(0x221)](_0x1cd2b1(0x22d)))??{},_0x41a835=Date['now'](),_0x23f366=await executeData(_0x2f59a7,_0x1f6f02[_0x1cd2b1(0x212)],_0x5317d0),_0x4f5832=Date[_0x1cd2b1(0x21f)]()-_0x41a835;return{'ok':!![],'data':{'result':_0x23f366,'elapsed':_0x4f5832},'message':'data\x20'+_0x1f6f02['command']+_0x1cd2b1(0x232)+_0x4f5832+'ms'};}};return _0x1f6f02['risk']!=='read'&&(_0x3eeea7['dryRun']=async _0x486ab6=>{const _0x490cfc=_0x5ea026,_0x430b00=_0x486ab6['str'](_0x490cfc(0x22a)),_0x599e74=_0x1f6f02[_0x490cfc(0x212)]===_0x490cfc(0x1ec)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x486ab6[_0x490cfc(0x221)]('params'))):parseJsonParams(_0x486ab6[_0x490cfc(0x221)]('params'))??{};return dryRun(_0x490cfc(0x21d),'/api/{appCode}/'+_0x430b00+'/'+_0x1f6f02[_0x490cfc(0x212)])[_0x490cfc(0x237)](_0x599e74)[_0x490cfc(0x222)](_0x490cfc(0x1e3)+_0x1f6f02[_0x490cfc(0x235)]+_0x490cfc(0x208)+_0x430b00)[_0x490cfc(0x1ef)]();}),_0x3eeea7;}function a20_0x36d1(_0x2bfed2,_0x4fab55){_0x2bfed2=_0x2bfed2-0x1df;const _0x1aa5df=a20_0x1aa5();let _0x36d151=_0x1aa5df[_0x2bfed2];return _0x36d151;}export const dataDefinitions=specs[a20_0x230f48(0x219)](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_0x20a72c=a26_0x1074;(function(_0xf51377,_0x2f9a34){const _0x12446d=a26_0x1074,_0x1758c3=_0xf51377();while(!![]){try{const _0x51617e=-parseInt(_0x12446d(0x231))/0x1+-parseInt(_0x12446d(0x214))/0x2*(parseInt(_0x12446d(0x221))/0x3)+parseInt(_0x12446d(0x1f2))/0x4*(parseInt(_0x12446d(0x1fa))/0x5)+parseInt(_0x12446d(0x21b))/0x6+-parseInt(_0x12446d(0x239))/0x7+-parseInt(_0x12446d(0x226))/0x8*(parseInt(_0x12446d(0x22e))/0x9)+parseInt(_0x12446d(0x238))/0xa;if(_0x51617e===_0x2f9a34)break;else _0x1758c3['push'](_0x1758c3['shift']());}catch(_0x223a1b){_0x1758c3['push'](_0x1758c3['shift']());}}}(a26_0x1e8e,0x2bf40));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';function a26_0x1e8e(){const _0x216e25=['appcode','SIGINT','[Y/n]','includes','yes','\x20\x20config:\x20\x20','3935yMfMQo','project','name','log','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','[y/N]','trim','newConfigFileName','\x20\x20appcode:\x20','boolean','\x22.\x20Allowed:\x20','entries','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','App\x20code\x20cannot\x20be\x20empty.','stdout','file','join','parse','File\x20','App\x20code\x20for\x20the\x20project','\x20init\x20—\x20Create\x20','Imported\x20from\x20','string','env','Invalid\x20env\x20\x22','Override\x20imported\x20default\x20appcode','264332KtPxjB','message','App\x20code','Write\x20to\x20global\x20(~/','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.',')\x20instead\x20of\x20project','Aborted.','2121678AOmmbt','validation','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`.','removeListener','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','apps','3VvSmpX','flagMissing','close','Source\x20file\x20not\x20found:\x20','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','152tQUSRR','riskLevel','cwd','\x20\x20env:\x20\x20\x20\x20\x20','\x20\x20default:\x20','object','Initialized\x20','app','83385vZDVls','\x0aInitialized\x20','race','281181LaRzut','toLowerCase','Override\x20imported\x20default\x20env','question','Target\x20environment\x20(default\x20','AbortPrompt','defaultApp','3922820jYXlyI','1443995RxhQot','utf8','Skip\x20confirmation\x20when\x20overwriting','global','User\x20aborted\x20prompt','1168nwmAEF','stdin'];a26_0x1e8e=function(){return _0x216e25;};return a26_0x1e8e();}function a26_0x1074(_0x2f78d9,_0x2337b3){_0x2f78d9=_0x2f78d9-0x1ef;const _0x1e8eda=a26_0x1e8e();let _0x107490=_0x1e8eda[_0x2f78d9];return _0x107490;}import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a26_0x20a72c(0x1f4),'type':a26_0x20a72c(0x210),'description':a26_0x20a72c(0x20d)},{'name':a26_0x20a72c(0x211),'type':a26_0x20a72c(0x210),'description':a26_0x20a72c(0x235)+DEFAULT_CONFIG_VALUES['env']+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x20a72c(0x1f0),'type':a26_0x20a72c(0x203),'description':a26_0x20a72c(0x217)+PRODUCT_CONFIG[a26_0x20a72c(0x201)]+a26_0x20a72c(0x219),'default':![]},{'name':'yes','type':a26_0x20a72c(0x203),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':a26_0x20a72c(0x209),'type':a26_0x20a72c(0x210),'description':a26_0x20a72c(0x21f),'required':!![]},{'name':a26_0x20a72c(0x1f4),'type':a26_0x20a72c(0x210),'description':a26_0x20a72c(0x213)},{'name':'env','type':'string','description':a26_0x20a72c(0x233),'enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a26_0x20a72c(0x203),'description':a26_0x20a72c(0x217)+PRODUCT_CONFIG[a26_0x20a72c(0x201)]+')\x20instead\x20of\x20project','default':![]},{'name':a26_0x20a72c(0x1f8),'type':a26_0x20a72c(0x203),'description':a26_0x20a72c(0x1ef),'default':![]}];export async function runInit(_0x59b018){const _0x307505=a26_0x20a72c,_0x22e079=isNonInteractiveMode(_0x59b018),_0x40e892=_0x59b018[_0x307505(0x1f0)]?_0x307505(0x1f0):_0x307505(0x1fb),_0x51dd15=resolveWriteConfigPath(_0x40e892);try{_0x22e079?await runNonInteractive(_0x59b018,_0x51dd15):await runInteractive(_0x59b018,_0x51dd15);}catch(_0x5cb1e8){if(_0x5cb1e8 instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0x5cb1e8;}}export async function runInitImport(_0x198372){const _0x4411ee=a26_0x20a72c,_0x5013f5=_0x198372[_0x4411ee(0x1f0)]?_0x4411ee(0x1f0):_0x4411ee(0x1fb),_0xb66ff7=resolveWriteConfigPath(_0x5013f5);await runFromImport(_0x198372,_0xb66ff7);}const RUNTIME_IRRELEVANT_KEYS=new Set(['apiDir']);async function runFromImport(_0x1e1bba,_0x1f3ef0){const _0x5b181b=a26_0x20a72c,_0x155e17=resolveFilePath(_0x1e1bba[_0x5b181b(0x209)]);if(!existsSync(_0x155e17))throw CliErrors[_0x5b181b(0x21c)](_0x5b181b(0x224)+_0x155e17);const _0x17c9fe=readSourceFile(_0x155e17),_0x551eee=convertToRuntimeConfig(_0x17c9fe);_0x1e1bba[_0x5b181b(0x1f4)]&&(_0x551eee['appcode']=String(_0x1e1bba[_0x5b181b(0x1f4)]));_0x1e1bba[_0x5b181b(0x211)]&&(_0x551eee[_0x5b181b(0x211)]=resolveInitEnv(_0x1e1bba));if(!_0x551eee[_0x5b181b(0x1f4)])throw CliErrors[_0x5b181b(0x21c)](_0x5b181b(0x206),_0x5b181b(0x21d));await writeInitConfig(_0x1f3ef0,_0x551eee,_0x1e1bba),console['log'](_0x5b181b(0x20f)+_0x155e17),console[_0x5b181b(0x1fd)](_0x5b181b(0x1f9)+_0x1f3ef0),console[_0x5b181b(0x1fd)](_0x5b181b(0x202)+_0x551eee[_0x5b181b(0x1f4)]);if(_0x551eee['defaultApp'])console[_0x5b181b(0x1fd)](_0x5b181b(0x22a)+_0x551eee[_0x5b181b(0x237)]);}function convertToRuntimeConfig(_0x5c2dc4){const _0x497321=a26_0x20a72c;if(_0x5c2dc4[_0x497321(0x220)]&&typeof _0x5c2dc4[_0x497321(0x220)]===_0x497321(0x22b))throw CliErrors[_0x497321(0x21c)](_0x497321(0x218),_0x497321(0x225));const _0x5ef876={};for(const _0xfded38 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x5c2dc4[_0xfded38]!==undefined&&(_0x5ef876[_0xfded38]=_0x5c2dc4[_0xfded38]);}return!_0x5ef876[_0x497321(0x227)]&&(_0x5ef876['riskLevel']=DEFAULT_CONFIG_VALUES[_0x497321(0x227)]),_0x5ef876;}async function runNonInteractive(_0x5dc396,_0x465b5b){const _0x3f1a3f=a26_0x20a72c,_0xd2127a=_0x5dc396[_0x3f1a3f(0x1f4)];if(!_0xd2127a)throw CliErrors[_0x3f1a3f(0x222)](_0x3f1a3f(0x1f4),'Usage:\x20'+CLI_BIN_NAME+_0x3f1a3f(0x1fe));const _0x21e11c=resolveInitEnv(_0x5dc396);await writeInitConfig(_0x465b5b,{'appcode':_0xd2127a,'env':_0x21e11c},_0x5dc396),console[_0x3f1a3f(0x1fd)](_0x3f1a3f(0x22c)+_0x465b5b),console[_0x3f1a3f(0x1fd)]('\x20\x20appcode:\x20'+_0xd2127a),console[_0x3f1a3f(0x1fd)](_0x3f1a3f(0x229)+_0x21e11c);}async function runInteractive(_0x26ab22,_0x2dd31f){const _0x3dbf8b=a26_0x20a72c,_0x1a6d28=loadExisting(_0x2dd31f),_0x2fcfb8=typeof _0x1a6d28?.[_0x3dbf8b(0x1f4)]==='string'?_0x1a6d28[_0x3dbf8b(0x1f4)]:'',_0x19fd8f=resolveInitEnv(_0x26ab22);console['log'](CLI_BIN_NAME+_0x3dbf8b(0x20e)+PRODUCT_CONFIG[_0x3dbf8b(0x201)]+'\x0a');if(existsSync(_0x2dd31f)&&!_0x26ab22['yes']){const _0x153715=await promptYesNo(_0x3dbf8b(0x20c)+_0x2dd31f+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x153715){console[_0x3dbf8b(0x1fd)](_0x3dbf8b(0x21a));return;}}const _0x28921b=typeof _0x26ab22[_0x3dbf8b(0x1f4)]==='string'?_0x26ab22[_0x3dbf8b(0x1f4)][_0x3dbf8b(0x200)]():'';let _0x362a15=_0x28921b;!_0x362a15&&(_0x362a15=await promptInput(_0x3dbf8b(0x216),_0x2fcfb8));if(!_0x362a15['trim']())throw CliErrors['validation'](_0x3dbf8b(0x207));await writeInitConfig(_0x2dd31f,{'appcode':_0x362a15['trim'](),'env':_0x19fd8f},_0x26ab22),console[_0x3dbf8b(0x1fd)](_0x3dbf8b(0x22f)+_0x2dd31f),console['log'](_0x3dbf8b(0x202)+_0x362a15[_0x3dbf8b(0x200)]()),console[_0x3dbf8b(0x1fd)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x19fd8f);}async function writeInitConfig(_0x45c814,_0x2785e2,_0x2f1be2){const _0x79d34f=a26_0x20a72c;let _0x1d4f00={};existsSync(_0x45c814)&&!_0x2f1be2[_0x79d34f(0x1f8)]&&(_0x1d4f00=readConfigFile(_0x45c814));for(const [_0x5ee3e7,_0x32f649]of Object[_0x79d34f(0x205)](_0x2785e2)){_0x32f649!==undefined&&(_0x1d4f00[_0x5ee3e7]=_0x32f649);}if(_0x1d4f00[_0x79d34f(0x22d)])delete _0x1d4f00[_0x79d34f(0x22d)];writeConfigFile(_0x45c814,_0x1d4f00);}class AbortPrompt extends Error{constructor(){const _0x448397=a26_0x20a72c;super(_0x448397(0x1f1)),this[_0x448397(0x1fc)]=_0x448397(0x236);}}function createSafeRl(){const _0x56d380=a26_0x20a72c,_0x3784b8=createInterface({'input':process[_0x56d380(0x1f3)],'output':process[_0x56d380(0x208)]});let _0x5ed3e1;const _0x5c1802=new Promise((_0x372e6a,_0x267b69)=>{const _0xe729d1=_0x56d380;_0x5ed3e1=()=>{const _0x708be7=a26_0x1074;_0x5ed3e1&&(_0x3784b8[_0x708be7(0x21e)]('SIGINT',_0x5ed3e1),_0x5ed3e1=undefined);try{_0x3784b8[_0x708be7(0x223)]();}catch{}_0x267b69(new AbortPrompt());},_0x3784b8['once'](_0xe729d1(0x1f5),_0x5ed3e1);}),_0x4778f6=()=>{const _0x527106=_0x56d380;_0x5ed3e1&&(_0x3784b8[_0x527106(0x21e)](_0x527106(0x1f5),_0x5ed3e1),_0x5ed3e1=undefined);try{_0x3784b8[_0x527106(0x223)]();}catch{}};return{'rl':_0x3784b8,'abortPromise':_0x5c1802,'disposeSuccess':_0x4778f6};}async function promptInput(_0x3f9b8a,_0x2c982b){const _0x11d707=a26_0x20a72c,{rl:_0x15b162,abortPromise:_0x12e43d,disposeSuccess:_0xfab01a}=createSafeRl(),_0x5810ce=new Promise(_0x329202=>{const _0x327ada=a26_0x1074,_0x4bf3c9=_0x2c982b?'\x20\x20'+_0x3f9b8a+'\x20('+_0x2c982b+'):\x20':'\x20\x20'+_0x3f9b8a+':\x20';_0x15b162[_0x327ada(0x234)](_0x4bf3c9,_0x61d4f3=>{_0xfab01a(),_0x329202(_0x61d4f3['trim']()||_0x2c982b);});});return Promise[_0x11d707(0x230)]([_0x5810ce,_0x12e43d]);}async function promptYesNo(_0x30c91a,_0x40c4aa){const {rl:_0x555177,abortPromise:_0x324828,disposeSuccess:_0x2a6b1b}=createSafeRl(),_0x5b94d9=new Promise(_0x4464c7=>{const _0x3cac8b=a26_0x1074,_0x2f1620=_0x40c4aa?_0x3cac8b(0x1f6):_0x3cac8b(0x1ff);_0x555177[_0x3cac8b(0x234)]('\x20\x20'+_0x30c91a+'\x20'+_0x2f1620+':\x20',_0x311f06=>{const _0x27e4de=_0x3cac8b;_0x2a6b1b();const _0x41b018=_0x311f06['trim']()[_0x27e4de(0x232)]();if(_0x41b018==='y'||_0x41b018===_0x27e4de(0x1f8))_0x4464c7(!![]);else{if(_0x41b018==='n'||_0x41b018==='no')_0x4464c7(![]);else _0x4464c7(_0x40c4aa);}});});return Promise['race']([_0x5b94d9,_0x324828]);}function loadExisting(_0x168747){if(!existsSync(_0x168747))return null;return readConfigFile(_0x168747);}function resolveFilePath(_0x5a2861){const _0x2ae02b=a26_0x20a72c;return isAbsolute(_0x5a2861)?_0x5a2861:resolve(process[_0x2ae02b(0x228)](),_0x5a2861);}function readSourceFile(_0x24477a){const _0x318ea2=a26_0x20a72c;try{const _0x1534d3=readFileSync(_0x24477a,{'encoding':_0x318ea2(0x23a)});return JSON[_0x318ea2(0x20b)](_0x1534d3);}catch(_0x472815){throw CliErrors[_0x318ea2(0x21c)]('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x472815[_0x318ea2(0x215)]);}}function resolveInitEnv(_0x45e8af){const _0x1a460f=a26_0x20a72c,_0x92f957=_0x45e8af[_0x1a460f(0x211)];if(_0x92f957===undefined||_0x92f957==='')return DEFAULT_CONFIG_VALUES[_0x1a460f(0x211)];if(!RUNTIME_ENV_VALUES[_0x1a460f(0x1f7)](_0x92f957))throw CliErrors[_0x1a460f(0x21c)](_0x1a460f(0x212)+_0x92f957+_0x1a460f(0x204)+RUNTIME_ENV_VALUES[_0x1a460f(0x20a)](',\x20'));return _0x92f957;}
|
|
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;}
|