@lovrabet/lovrabet-cli 2.1.6 → 2.1.7-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/commands/create.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.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/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x385137,_0x1b1782){const _0x5adebf=a15_0x4478,_0x5ddece=_0x385137();while(!![]){try{const _0x4ef782=-parseInt(_0x5adebf(0x1ca))/0x1+parseInt(_0x5adebf(0x1ce))/0x2*(parseInt(_0x5adebf(0x1c8))/0x3)+parseInt(_0x5adebf(0x1d0))/0x4+parseInt(_0x5adebf(0x1c6))/0x5+-parseInt(_0x5adebf(0x1d2))/0x6*(-parseInt(_0x5adebf(0x1c2))/0x7)+parseInt(_0x5adebf(0x1d1))/0x8+parseInt(_0x5adebf(0x1c4))/0x9*(-parseInt(_0x5adebf(0x1c9))/0xa);if(_0x4ef782===_0x1b1782)break;else _0x5ddece['push'](_0x5ddece['shift']());}catch(_0x3a7cec){_0x5ddece['push'](_0x5ddece['shift']());}}}(a15_0x10e4,0xce8c4));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';function a15_0x10e4(){const _0xe3ca58=['9VCBxLd','global-default','2672105nSuiIY','newConfigFileName','1457889aHrgrm','33015990uRVVwg','591417grekbE','validation','Flags\x20--global\x20and\x20--project\x20are\x20mutually\x20exclusive.','Use\x20only\x20one\x20config\x20scope\x20flag.','2QaEVaf','project','5652404NwgrFx','6373600YiYwTF','6fZEGcE','Not\x20inside\x20a\x20project\x20(no\x20','global',',\x20or\x20run\x20`','\x20init`\x20first.','10561957VqCkhW','\x20(global)'];a15_0x10e4=function(){return _0xe3ca58;};return a15_0x10e4();}export{RUNTIME_ENV_VALUES}from'../../constant/env.js';export{OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{isInProject}from'../../context.js';import{CliErrors}from'../../errors.js';function a15_0x4478(_0x5b96f2,_0x6f66e8){_0x5b96f2=_0x5b96f2-0x1c2;const _0x10e49c=a15_0x10e4();let _0x4478f3=_0x10e49c[_0x5b96f2];return _0x4478f3;}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(_0x2dcaca){const _0x808d08=a15_0x4478,{explicitGlobal:explicitGlobal=![],explicitProject:explicitProject=![],policy:_0x328003}=_0x2dcaca;if(explicitGlobal&&explicitProject)throw CliErrors[_0x808d08(0x1cb)](_0x808d08(0x1cc),_0x808d08(0x1cd));if(explicitGlobal)return _0x808d08(0x1d4);if(explicitProject)return _0x808d08(0x1cf);switch(_0x328003){case _0x808d08(0x1c5):return _0x808d08(0x1d4);case'project-default':return _0x2dcaca['inProject']??isInProject()?'project':'global';case'project-or-global-explicit':if(!(_0x2dcaca['inProject']??isInProject()))throw CliErrors[_0x808d08(0x1cb)](_0x808d08(0x1d3)+PRODUCT_CONFIG[_0x808d08(0x1c7)]+'\x20found).','Add\x20--global\x20to\x20write\x20to\x20~/'+PRODUCT_CONFIG[_0x808d08(0x1c7)]+_0x808d08(0x1d5)+CLI_BIN_NAME+_0x808d08(0x1d6));return _0x808d08(0x1cf);}}export function toScopeFlags(_0x36ce37){const _0x4eeb4b=a15_0x4478;return{'global':_0x36ce37===_0x4eeb4b(0x1d4)};}export function formatScopeLabel(_0x55ab34){const _0x187ab0=a15_0x4478;return _0x55ab34==='global'?_0x187ab0(0x1c3):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x145ba2,_0x23daf4){const _0x478361=a16_0x7280,_0x457b66=_0x145ba2();while(!![]){try{const _0x2c8258=-parseInt(_0x478361(0x194))/0x1+parseInt(_0x478361(0x1a6))/0x2*(parseInt(_0x478361(0x19e))/0x3)+-parseInt(_0x478361(0x1a0))/0x4+parseInt(_0x478361(0x19b))/0x5+-parseInt(_0x478361(0x198))/0x6+-parseInt(_0x478361(0x1a8))/0x7*(parseInt(_0x478361(0x1a7))/0x8)+parseInt(_0x478361(0x1ad))/0x9;if(_0x2c8258===_0x23daf4)break;else _0x457b66['push'](_0x457b66['shift']());}catch(_0x31e294){_0x457b66['push'](_0x457b66['shift']());}}}(a16_0x562b,0x7e336));import{CliErrors}from'../../errors.js';function isSet(_0x4b2d02,_0x4b7132){const _0x2c8da5=a16_0x7280,_0xeb71f0=_0x4b2d02[_0x2c8da5(0x19a)](_0x4b7132);return _0xeb71f0!==undefined&&_0xeb71f0!==''&&_0xeb71f0!==![]&&_0xeb71f0!==0x0;}function fmtNames(_0x4eac14){const _0x543a00=a16_0x7280;return _0x4eac14['map'](_0x258ee4=>'--'+_0x258ee4)[_0x543a00(0x197)](',\x20');}function a16_0x7280(_0xd30a23,_0x4788fe){_0xd30a23=_0xd30a23-0x194;const _0x562b85=a16_0x562b();let _0x728064=_0x562b85[_0xd30a23];return _0x728064;}function a16_0x562b(){const _0x112aec=['Provide\x20one\x20of:\x20','94610rDIUQL','24knNgxi','480893DjGiXW','Flags\x20','Exactly\x20one\x20of\x20','test','\x20are\x20mutually\x20exclusive\x20for\x20`','15034248vqUiNP','Invalid\x20--','164090tCcycm',':\x20expected\x20','str','join','4428402wOLcpb','filter','flag','3601420ylAiUI','Remove\x20all\x20but\x20one.','validation','15Ypaudo','\x20is\x20required\x20for\x20`','4008436YBvgdO','At\x20least\x20one\x20of\x20','Only\x20one\x20of\x20','length',',\x20got\x20\x22'];a16_0x562b=function(){return _0x112aec;};return a16_0x562b();}export function requireOneOf(_0x160640,_0x206c54,_0x10a7ef){const _0x3eab3c=a16_0x7280,_0x158871=_0x206c54[_0x3eab3c(0x199)](_0x4d46db=>isSet(_0x160640,_0x4d46db));if(_0x158871[_0x3eab3c(0x1a3)]!==0x1)throw CliErrors['validation'](_0x158871[_0x3eab3c(0x1a3)]===0x0?_0x3eab3c(0x1aa)+fmtNames(_0x206c54)+_0x3eab3c(0x19f)+_0x10a7ef+'`.':_0x3eab3c(0x1a2)+fmtNames(_0x206c54)+'\x20is\x20allowed,\x20found:\x20'+fmtNames(_0x158871)+'.',_0x158871[_0x3eab3c(0x1a3)]===0x0?'Provide\x20one\x20of:\x20'+fmtNames(_0x206c54):_0x3eab3c(0x19c));}export function requireAnyOf(_0x576322,_0x8ef952,_0x195e15){const _0x488c84=a16_0x7280;if(!_0x8ef952['some'](_0x5802cd=>isSet(_0x576322,_0x5802cd)))throw CliErrors[_0x488c84(0x19d)](_0x488c84(0x1a1)+fmtNames(_0x8ef952)+'\x20is\x20required\x20for\x20`'+_0x195e15+'`.',_0x488c84(0x1a5)+fmtNames(_0x8ef952));}export function mutuallyExclusive(_0x17a533,_0x2b63dd,_0x423a04){const _0x454c9d=a16_0x7280,_0x20a7d2=_0x2b63dd[_0x454c9d(0x199)](_0x761511=>isSet(_0x17a533,_0x761511));if(_0x20a7d2[_0x454c9d(0x1a3)]>0x1)throw CliErrors['validation'](_0x454c9d(0x1a9)+fmtNames(_0x20a7d2)+_0x454c9d(0x1ac)+_0x423a04+'`.','Use\x20only\x20one\x20of:\x20'+fmtNames(_0x2b63dd));}export function validatePattern(_0x5a7667,_0x596d08,_0x5a2d73,_0x41f4c9){const _0x570e5=a16_0x7280,_0x421746=_0x5a7667[_0x570e5(0x196)](_0x596d08);if(_0x421746&&!_0x5a2d73[_0x570e5(0x1ab)](_0x421746))throw CliErrors[_0x570e5(0x19d)](_0x570e5(0x1ae)+_0x596d08+_0x570e5(0x195)+_0x41f4c9+_0x570e5(0x1a4)+_0x421746+'\x22.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a17_0x1a0e(_0x277453,_0x5b4a4b){_0x277453=_0x277453-0xce;const _0x1a8192=a17_0x1a81();let _0x1a0e53=_0x1a8192[_0x277453];return _0x1a0e53;}const a17_0x3e61d5=a17_0x1a0e;(function(_0x396b10,_0x1f7e6c){const _0x38969c=a17_0x1a0e,_0x495f8e=_0x396b10();while(!![]){try{const _0x1f63b4=parseInt(_0x38969c(0xe2))/0x1*(-parseInt(_0x38969c(0xd0))/0x2)+parseInt(_0x38969c(0xe0))/0x3+parseInt(_0x38969c(0xd3))/0x4*(parseInt(_0x38969c(0xd9))/0x5)+-parseInt(_0x38969c(0xce))/0x6+parseInt(_0x38969c(0xe1))/0x7*(-parseInt(_0x38969c(0xd4))/0x8)+parseInt(_0x38969c(0xda))/0x9+-parseInt(_0x38969c(0xdc))/0xa;if(_0x1f63b4===_0x1f7e6c)break;else _0x495f8e['push'](_0x495f8e['shift']());}catch(_0x53006d){_0x495f8e['push'](_0x495f8e['shift']());}}}(a17_0x1a81,0xa5664));function a17_0x1a81(){const _0x2f2bef=['4584fNbiFa','414632snoSUp','string','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','params','4650DKXVXR','10433331qptfgo','number','8140060acPWWo','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','Dataset\x20code\x20(32-char\x20hex\x20UUID)','code','3735024OivhLD','98EgnGpO','937463tXnSbd','Return\x20full\x20raw\x20response\x20object','1892976OhsgOy','Resource\x20ID','2baKYGd','Resource\x20name\x20for\x20lookup','boolean'];a17_0x1a81=function(){return _0x2f2bef;};return a17_0x1a81();}export const CODE_FLAG={'name':a17_0x3e61d5(0xdf),'type':a17_0x3e61d5(0xd5),'required':!![],'description':a17_0x3e61d5(0xde),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':'a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)'}};export const SQLCODE_FLAG={'name':'sqlcode','type':a17_0x3e61d5(0xd5),'required':!![],'description':a17_0x3e61d5(0xdd),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a17_0x3e61d5(0xd6)}};export const VERBOSE_FLAG={'name':'verbose','type':a17_0x3e61d5(0xd2),'description':a17_0x3e61d5(0xe3)};export const PARAMS_FLAG={'name':a17_0x3e61d5(0xd8),'type':a17_0x3e61d5(0xd5),'description':a17_0x3e61d5(0xd7)};export const NAME_FLAG={'name':'name','type':'string','description':a17_0x3e61d5(0xd1)};export const ID_FLAG={'name':'id','type':a17_0x3e61d5(0xdb),'required':!![],'description':a17_0x3e61d5(0xcf)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a18_0x36548d=a18_0x4f61;function a18_0x4f61(_0x10b5c4,_0x58f415){_0x10b5c4=_0x10b5c4-0x193;const _0x595fc0=a18_0x595f();let _0x4f618f=_0x595fc0[_0x10b5c4];return _0x4f618f;}(function(_0x3e5231,_0x90468b){const _0x4da6e7=a18_0x4f61,_0x4f71d2=_0x3e5231();while(!![]){try{const _0x62f20f=-parseInt(_0x4da6e7(0x1a5))/0x1+parseInt(_0x4da6e7(0x1a0))/0x2*(parseInt(_0x4da6e7(0x1ca))/0x3)+-parseInt(_0x4da6e7(0x1a9))/0x4*(parseInt(_0x4da6e7(0x19e))/0x5)+-parseInt(_0x4da6e7(0x1cb))/0x6+-parseInt(_0x4da6e7(0x1a6))/0x7+parseInt(_0x4da6e7(0x1aa))/0x8+parseInt(_0x4da6e7(0x1bd))/0x9*(parseInt(_0x4da6e7(0x1b1))/0xa);if(_0x62f20f===_0x90468b)break;else _0x4f71d2['push'](_0x4f71d2['shift']());}catch(_0x2deac2){_0x4f71d2['push'](_0x4f71d2['shift']());}}}(a18_0x595f,0xcb62d));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';function a18_0x595f(){const _0x110dab=['90FyeYhR','../../context.js','Missing\x20key\x20or\x20value.','boolean','apps','Set\x20a\x20config\x20value','(none)','\x20config\x20delete\x20<key>\x20[--global]','validation','bool','project-or-global-explicit','trim','4596948vKcSRV','split','read','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','Get\x20a\x20config\x20value','Delete\x20a\x20config\x20value','\x20config\x20get\x20<key>','Deleted\x20`','\x20\x20project:\x20','Key\x20\x22','log','format',';\x20apps.<alias>.appcode','3tIymGy','7060332ooYJyR','args','write','key','raw','Top-level\x20key\x20\x22','`\x20=\x20\x22','config','global','delete','List\x20current\x20config','\x22\x20is\x20not\x20settable.','Key\x20not\x20found:\x20','set','Set\x20`','\x20(global)','alias','pretty','\x20\x20global:\x20\x20','value','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','includes','Usage:\x20','Settable\x20keys:\x20','Missing\x20key\x20argument.','Config\x20files:\x0a','5cFlPQQ','join','770378HTuBZp','Value\x20to\x20assign','Write\x20to\x20global\x20config','length','appcode','1420365oPHmUm','9427075cEebyE','stringify','pageSize\x20must\x20be\x20a\x20positive\x20number','4573972qckStY','7505896ZdORGl','riskLevel','isArray','object','pageSize','field','Invalid\x20value\x20for\x20\x22'];a18_0x595f=function(){return _0x110dab;};return a18_0x595f();}const GLOBAL_FLAG={'name':a18_0x36548d(0x1d3),'type':a18_0x36548d(0x1b4),'description':a18_0x36548d(0x1a2),'default':![]};function parseAliasAppcodeSetKey(_0x10e05a){const _0x31ec75=a18_0x36548d,_0x1ebc42=_0x10e05a[_0x31ec75(0x1be)]('.');if(_0x1ebc42[_0x31ec75(0x1a3)]!==0x3||_0x1ebc42[0x0]!==_0x31ec75(0x1b5)||_0x1ebc42[0x2]!==_0x31ec75(0x1a4))return undefined;const _0x3fe7ec=_0x1ebc42[0x1]?.[_0x31ec75(0x1bc)]();return _0x3fe7ec?_0x3fe7ec:undefined;}function parseAliasDeleteKey(_0x2107ac){const _0x106d20=a18_0x36548d,_0x152030=_0x2107ac[_0x106d20(0x1be)]('.');if(_0x152030['length']===0x2&&_0x152030[0x0]==='apps'){const _0x8b153d=_0x152030[0x1]?.[_0x106d20(0x1bc)]();return _0x8b153d?{'alias':_0x8b153d}:undefined;}if(_0x152030[_0x106d20(0x1a3)]===0x3&&_0x152030[0x0]==='apps'&&_0x152030[0x2]===_0x106d20(0x1a4)){const _0x604b8e=_0x152030[0x1]?.[_0x106d20(0x1bc)]();return _0x604b8e?{'alias':_0x604b8e,'field':_0x106d20(0x1a4)}:undefined;}return undefined;}function setLocalAppAlias(_0x774d1e,_0x447565,_0x418919){const _0x51306d=a18_0x36548d,_0x187051=_0x774d1e[_0x51306d(0x1b5)]&&typeof _0x774d1e[_0x51306d(0x1b5)]===_0x51306d(0x1ad)&&!Array[_0x51306d(0x1ac)](_0x774d1e[_0x51306d(0x1b5)])?_0x774d1e['apps']:{},_0x2ad0a9=_0x187051[_0x447565]&&typeof _0x187051[_0x447565]===_0x51306d(0x1ad)&&!Array['isArray'](_0x187051[_0x447565])?_0x187051[_0x447565]:{};_0x2ad0a9[_0x51306d(0x1a4)]=_0x418919,_0x187051[_0x447565]=_0x2ad0a9,_0x774d1e['apps']=_0x187051;}function deleteLocalAppAlias(_0x5b0ff2,_0x5002d4){const _0x1b4179=a18_0x36548d;if(!_0x5b0ff2[_0x1b4179(0x1b5)]||typeof _0x5b0ff2[_0x1b4179(0x1b5)]!==_0x1b4179(0x1ad)||Array[_0x1b4179(0x1ac)](_0x5b0ff2['apps']))return![];const _0x3e1a20=_0x5b0ff2[_0x1b4179(0x1b5)],_0x248f63=_0x3e1a20[_0x5002d4[_0x1b4179(0x194)]];if(!_0x248f63||typeof _0x248f63!==_0x1b4179(0x1ad)||Array[_0x1b4179(0x1ac)](_0x248f63))return![];if(!_0x5002d4[_0x1b4179(0x1af)])return delete _0x3e1a20[_0x5002d4['alias']],!![];if(!(_0x5002d4[_0x1b4179(0x1af)]in _0x248f63))return![];return delete _0x248f63[_0x5002d4['field']],Object['keys'](_0x248f63)[_0x1b4179(0x1a3)]===0x0&&delete _0x3e1a20[_0x5002d4[_0x1b4179(0x194)]],!![];}const listDef={'service':a18_0x36548d(0x1d2),'command':'list','description':a18_0x36548d(0x1d5),'risk':a18_0x36548d(0x1bf),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x562025){const _0x54e06d=a18_0x36548d,{buildConfigFromFlags:_0x30f552}=await import(_0x54e06d(0x1b2)),_0x1470f0=_0x30f552({}),_0x1582fa=getProjectConfigPath(),_0x5b3dd6=resolveWriteConfigPath('global');if(_0x562025[_0x54e06d(0x1c8)]===_0x54e06d(0x195))return{'ok':!![],'message':'#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a'+(JSON[_0x54e06d(0x1a7)](_0x1470f0['raw'],null,0x2)+'\x0a\x0a')+_0x54e06d(0x19d)+(_0x54e06d(0x1c5)+(_0x1582fa??_0x54e06d(0x1b7))+'\x0a')+(_0x54e06d(0x196)+_0x5b3dd6)};return{'ok':!![],'data':{'effective':_0x1470f0[_0x54e06d(0x1cf)],'configFiles':{'project':_0x1582fa??null,'global':_0x5b3dd6}}};}},getDef={'service':a18_0x36548d(0x1d2),'command':'get','description':a18_0x36548d(0x1c1),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x36548d(0x1ce),'description':a18_0x36548d(0x198),'required':!![]}],'flags':[],async 'execute'(_0x260214){const _0xa5aeae=a18_0x36548d,_0x8bfe69=_0x260214[_0xa5aeae(0x1cc)][0x0];if(!_0x8bfe69)throw CliErrors[_0xa5aeae(0x1b9)](_0xa5aeae(0x19c),_0xa5aeae(0x19a)+CLI_BIN_NAME+_0xa5aeae(0x1c3));const {buildConfigFromFlags:_0x152adf}=await import(_0xa5aeae(0x1b2)),{raw:_0x2863a2}=_0x152adf({});if(_0x8bfe69['includes']('.')){const _0x15ae87=_0x8bfe69['split']('.');let _0x2ed55e=_0x2863a2;for(const _0x5d5662 of _0x15ae87){if(_0x2ed55e==null||typeof _0x2ed55e!==_0xa5aeae(0x1ad))throw CliErrors['validation']('Key\x20not\x20found:\x20'+_0x8bfe69);_0x2ed55e=_0x2ed55e[_0x5d5662];}if(_0x2ed55e===undefined)throw CliErrors[_0xa5aeae(0x1b9)](_0xa5aeae(0x1d7)+_0x8bfe69);return console['log'](typeof _0x2ed55e===_0xa5aeae(0x1ad)?JSON[_0xa5aeae(0x1a7)](_0x2ed55e,null,0x2):String(_0x2ed55e)),{'ok':!![]};}const _0x5032f3=_0x2863a2[_0x8bfe69];if(_0x5032f3===undefined)throw CliErrors[_0xa5aeae(0x1b9)](_0xa5aeae(0x1d7)+_0x8bfe69);return console[_0xa5aeae(0x1c7)](typeof _0x5032f3==='object'?JSON[_0xa5aeae(0x1a7)](_0x5032f3,null,0x2):String(_0x5032f3)),{'ok':!![]};}},setDef={'service':a18_0x36548d(0x1d2),'command':a18_0x36548d(0x1d8),'description':a18_0x36548d(0x1b6),'risk':a18_0x36548d(0x1cd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x36548d(0x1ce),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a18_0x36548d(0x197),'description':a18_0x36548d(0x1a1),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x111574){const _0x5b2104=a18_0x36548d,_0x861179=_0x111574[_0x5b2104(0x1cc)][0x0],_0x4ce769=_0x111574['args'][0x1];if(!_0x861179||_0x4ce769===undefined)throw CliErrors[_0x5b2104(0x1b9)](_0x5b2104(0x1b3),'Usage:\x20'+CLI_BIN_NAME+'\x20config\x20set\x20<key>\x20<value>\x20[--global]');if(ENUM_KEYS[_0x861179]&&!ENUM_KEYS[_0x861179][_0x5b2104(0x199)](_0x4ce769))throw CliErrors[_0x5b2104(0x1b9)](_0x5b2104(0x1b0)+_0x861179+'\x22.\x20Allowed:\x20'+ENUM_KEYS[_0x861179][_0x5b2104(0x19f)](',\x20'));if(_0x861179===_0x5b2104(0x1ab))throw CliErrors[_0x5b2104(0x1b9)](_0x5b2104(0x1c0));if(_0x861179===_0x5b2104(0x1ae)){const _0x7622e7=Number(_0x4ce769);if(isNaN(_0x7622e7)||_0x7622e7<=0x0)throw CliErrors['validation'](_0x5b2104(0x1a8));}const _0x9d8a82=resolveWriteScope({'explicitGlobal':_0x111574[_0x5b2104(0x1ba)](_0x5b2104(0x1d3)),'policy':_0x5b2104(0x1bb)}),_0x516053=toScopeFlags(_0x9d8a82),_0x53f5e9=readScopedConfig(_0x516053),_0x44dcce=parseAliasAppcodeSetKey(_0x861179);if(!_0x44dcce&&!isTopLevelConfigKey(_0x861179))throw CliErrors[_0x5b2104(0x1b9)](_0x5b2104(0x1d0)+_0x861179+_0x5b2104(0x1d6),_0x5b2104(0x19b)+getTopLevelConfigKeySummary()+_0x5b2104(0x1c9));return _0x44dcce?setLocalAppAlias(_0x53f5e9,_0x44dcce,_0x4ce769):_0x53f5e9[_0x861179]=_0x861179==='pageSize'?Number(_0x4ce769):_0x4ce769,console[_0x5b2104(0x1c7)](_0x5b2104(0x1d9)+_0x861179+_0x5b2104(0x1d1)+_0x4ce769+'\x22'+(_0x9d8a82===_0x5b2104(0x1d3)?_0x5b2104(0x193):'')),writeScopedConfig(_0x53f5e9,_0x516053),{'ok':!![]};}},deleteDef={'service':a18_0x36548d(0x1d2),'command':a18_0x36548d(0x1d4),'description':a18_0x36548d(0x1c2),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x36548d(0x1ce),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x2470fa){const _0x1fb9fa=a18_0x36548d,_0x31442c=_0x2470fa[_0x1fb9fa(0x1cc)][0x0];if(!_0x31442c)throw CliErrors['validation'](_0x1fb9fa(0x19c),'Usage:\x20'+CLI_BIN_NAME+_0x1fb9fa(0x1b8));const _0x2a83c0=resolveWriteScope({'explicitGlobal':_0x2470fa['bool'](_0x1fb9fa(0x1d3)),'policy':_0x1fb9fa(0x1bb)}),_0x960d0=toScopeFlags(_0x2a83c0),_0x276576=readScopedConfig(_0x960d0),_0x432b0e=parseAliasDeleteKey(_0x31442c);if(_0x432b0e){if(!deleteLocalAppAlias(_0x276576,_0x432b0e))throw CliErrors['validation']('Key\x20not\x20found:\x20'+_0x31442c);return console[_0x1fb9fa(0x1c7)](_0x1fb9fa(0x1c4)+_0x31442c+'`'+(_0x2a83c0==='global'?'\x20(global)':'')),writeScopedConfig(_0x276576,_0x960d0),{'ok':!![]};}if(_0x276576[_0x31442c]===undefined)throw CliErrors['validation'](_0x1fb9fa(0x1c6)+_0x31442c+'\x22\x20not\x20found\x20at\x20top\x20level.');return delete _0x276576[_0x31442c],console[_0x1fb9fa(0x1c7)](_0x1fb9fa(0x1c4)+_0x31442c+'`'+(_0x2a83c0===_0x1fb9fa(0x1d3)?_0x1fb9fa(0x193):'')),writeScopedConfig(_0x276576,_0x960d0),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
1
|
+
const a18_0x411358=a18_0x50fe;(function(_0x3846db,_0x2e8006){const _0x4453d9=a18_0x50fe,_0x3b420c=_0x3846db();while(!![]){try{const _0x52e960=-parseInt(_0x4453d9(0x122))/0x1*(-parseInt(_0x4453d9(0x12f))/0x2)+-parseInt(_0x4453d9(0x116))/0x3+-parseInt(_0x4453d9(0x120))/0x4+-parseInt(_0x4453d9(0x145))/0x5*(parseInt(_0x4453d9(0x130))/0x6)+-parseInt(_0x4453d9(0x131))/0x7+-parseInt(_0x4453d9(0x147))/0x8+-parseInt(_0x4453d9(0x123))/0x9*(-parseInt(_0x4453d9(0x113))/0xa);if(_0x52e960===_0x2e8006)break;else _0x3b420c['push'](_0x3b420c['shift']());}catch(_0x1344d9){_0x3b420c['push'](_0x3b420c['shift']());}}}(a18_0x2a39,0xd8366));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_0x411358(0x117),'type':a18_0x411358(0x10c),'description':a18_0x411358(0x110),'default':![]};function parseAliasAppcodeSetKey(_0x2056f9){const _0x289d46=a18_0x411358,_0x3a6260=_0x2056f9[_0x289d46(0x114)]('.');if(_0x3a6260['length']!==0x3||_0x3a6260[0x0]!==_0x289d46(0x13d)||_0x3a6260[0x2]!==_0x289d46(0x148))return undefined;const _0x5376ad=_0x3a6260[0x1]?.[_0x289d46(0x11e)]();return _0x5376ad?_0x5376ad:undefined;}function parseAliasDeleteKey(_0x2fa4bc){const _0x578f4c=a18_0x411358,_0x413bfe=_0x2fa4bc[_0x578f4c(0x114)]('.');if(_0x413bfe[_0x578f4c(0x111)]===0x2&&_0x413bfe[0x0]==='apps'){const _0x2ccb34=_0x413bfe[0x1]?.[_0x578f4c(0x11e)]();return _0x2ccb34?{'alias':_0x2ccb34}:undefined;}if(_0x413bfe[_0x578f4c(0x111)]===0x3&&_0x413bfe[0x0]==='apps'&&_0x413bfe[0x2]===_0x578f4c(0x148)){const _0x352369=_0x413bfe[0x1]?.[_0x578f4c(0x11e)]();return _0x352369?{'alias':_0x352369,'field':'appcode'}:undefined;}return undefined;}function a18_0x2a39(){const _0x733689=['project-or-global-explicit','289884fsCuNG','Set\x20`','251oovtbN','162midXXW','join','stringify','validation','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','object','Missing\x20key\x20argument.','pageSize','raw','Set\x20a\x20config\x20value','field','write','7222cWRJyO','966glUGlc','11987647jjYYjC','\x22\x20is\x20not\x20settable.','\x20config\x20delete\x20<key>\x20[--global]','alias','`\x20=\x20\x22','Deleted\x20`','format','log','\x20\x20project:\x20','includes','Key\x20not\x20found:\x20','Value\x20to\x20assign','apps','(none)','isArray','Delete\x20a\x20config\x20value','Missing\x20key\x20or\x20value.','read','Top-level\x20key\x20\x22','delete','43405isuphS','Invalid\x20value\x20for\x20\x22','5852232IgtaHX','appcode','config','Config\x20files:\x0a','\x22.\x20Allowed:\x20','boolean','\x20\x20global:\x20\x20','key','get','Write\x20to\x20global\x20config','length','pretty','2914090cJqHol','split','List\x20current\x20config','4055865MwrTnd','global','Key\x20\x22','\x20(global)','bool','set','Usage:\x20','args','trim'];a18_0x2a39=function(){return _0x733689;};return a18_0x2a39();}function setLocalAppAlias(_0x400e17,_0x326777,_0x424e83){const _0x41be55=a18_0x411358,_0x12a885=_0x400e17[_0x41be55(0x13d)]&&typeof _0x400e17[_0x41be55(0x13d)]===_0x41be55(0x128)&&!Array[_0x41be55(0x13f)](_0x400e17['apps'])?_0x400e17[_0x41be55(0x13d)]:{},_0x571878=_0x12a885[_0x326777]&&typeof _0x12a885[_0x326777]===_0x41be55(0x128)&&!Array['isArray'](_0x12a885[_0x326777])?_0x12a885[_0x326777]:{};_0x571878[_0x41be55(0x148)]=_0x424e83,_0x12a885[_0x326777]=_0x571878,_0x400e17['apps']=_0x12a885;}function deleteLocalAppAlias(_0x469f5f,_0x4b0713){const _0x1c5cc5=a18_0x411358;if(!_0x469f5f[_0x1c5cc5(0x13d)]||typeof _0x469f5f[_0x1c5cc5(0x13d)]!==_0x1c5cc5(0x128)||Array[_0x1c5cc5(0x13f)](_0x469f5f[_0x1c5cc5(0x13d)]))return![];const _0x26209a=_0x469f5f['apps'],_0x33cbd1=_0x26209a[_0x4b0713['alias']];if(!_0x33cbd1||typeof _0x33cbd1!==_0x1c5cc5(0x128)||Array[_0x1c5cc5(0x13f)](_0x33cbd1))return![];if(!_0x4b0713[_0x1c5cc5(0x12d)])return delete _0x26209a[_0x4b0713[_0x1c5cc5(0x134)]],!![];if(!(_0x4b0713[_0x1c5cc5(0x12d)]in _0x33cbd1))return![];return delete _0x33cbd1[_0x4b0713[_0x1c5cc5(0x12d)]],Object['keys'](_0x33cbd1)['length']===0x0&&delete _0x26209a[_0x4b0713['alias']],!![];}const listDef={'service':a18_0x411358(0x149),'command':'list','description':a18_0x411358(0x115),'risk':a18_0x411358(0x142),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x48ed9e){const _0xcdfc7c=a18_0x411358,{buildConfigFromFlags:_0x39b9c9}=await import('../../context.js'),_0x27a0d9=_0x39b9c9({}),_0x28a0fc=getProjectConfigPath(),_0x4b421c=resolveWriteConfigPath('global');if(_0x48ed9e[_0xcdfc7c(0x137)]===_0xcdfc7c(0x112))return{'ok':!![],'message':_0xcdfc7c(0x127)+(JSON[_0xcdfc7c(0x125)](_0x27a0d9['raw'],null,0x2)+'\x0a\x0a')+_0xcdfc7c(0x14a)+(_0xcdfc7c(0x139)+(_0x28a0fc??_0xcdfc7c(0x13e))+'\x0a')+(_0xcdfc7c(0x10d)+_0x4b421c)};return{'ok':!![],'data':{'effective':_0x27a0d9[_0xcdfc7c(0x12b)],'configFiles':{'project':_0x28a0fc??null,'global':_0x4b421c}}};}},getDef={'service':a18_0x411358(0x149),'command':a18_0x411358(0x10f),'description':'Get\x20a\x20config\x20value','risk':a18_0x411358(0x142),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x411358(0x10e),'description':'Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','required':!![]}],'flags':[],async 'execute'(_0x44c167){const _0x3321e4=a18_0x411358,_0x2c5af7=_0x44c167[_0x3321e4(0x11d)][0x0];if(!_0x2c5af7)throw CliErrors[_0x3321e4(0x126)](_0x3321e4(0x129),_0x3321e4(0x11c)+CLI_BIN_NAME+'\x20config\x20get\x20<key>');const {buildConfigFromFlags:_0x34947c}=await import('../../context.js'),{raw:_0x1ad410}=_0x34947c({});if(_0x2c5af7[_0x3321e4(0x13a)]('.')){const _0x5b7f3e=_0x2c5af7[_0x3321e4(0x114)]('.');let _0x1636fe=_0x1ad410;for(const _0x34ef87 of _0x5b7f3e){if(_0x1636fe==null||typeof _0x1636fe!==_0x3321e4(0x128))throw CliErrors[_0x3321e4(0x126)](_0x3321e4(0x13b)+_0x2c5af7);_0x1636fe=_0x1636fe[_0x34ef87];}if(_0x1636fe===undefined)throw CliErrors[_0x3321e4(0x126)]('Key\x20not\x20found:\x20'+_0x2c5af7);return console[_0x3321e4(0x138)](typeof _0x1636fe===_0x3321e4(0x128)?JSON[_0x3321e4(0x125)](_0x1636fe,null,0x2):String(_0x1636fe)),{'ok':!![]};}const _0x4bd98b=_0x1ad410[_0x2c5af7];if(_0x4bd98b===undefined)throw CliErrors[_0x3321e4(0x126)](_0x3321e4(0x13b)+_0x2c5af7);return console['log'](typeof _0x4bd98b===_0x3321e4(0x128)?JSON[_0x3321e4(0x125)](_0x4bd98b,null,0x2):String(_0x4bd98b)),{'ok':!![]};}},setDef={'service':a18_0x411358(0x149),'command':a18_0x411358(0x11b),'description':a18_0x411358(0x12c),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x411358(0x10e),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':'value','description':a18_0x411358(0x13c),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x2cccb6){const _0x6e45a4=a18_0x411358,_0x3ae2c7=_0x2cccb6['args'][0x0],_0x292f30=_0x2cccb6[_0x6e45a4(0x11d)][0x1];if(!_0x3ae2c7||_0x292f30===undefined)throw CliErrors[_0x6e45a4(0x126)](_0x6e45a4(0x141),_0x6e45a4(0x11c)+CLI_BIN_NAME+'\x20config\x20set\x20<key>\x20<value>\x20[--global]');if(ENUM_KEYS[_0x3ae2c7]&&!ENUM_KEYS[_0x3ae2c7][_0x6e45a4(0x13a)](_0x292f30))throw CliErrors[_0x6e45a4(0x126)](_0x6e45a4(0x146)+_0x3ae2c7+_0x6e45a4(0x14b)+ENUM_KEYS[_0x3ae2c7][_0x6e45a4(0x124)](',\x20'));if(_0x3ae2c7==='riskLevel')throw CliErrors[_0x6e45a4(0x126)]('\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.');if(_0x3ae2c7===_0x6e45a4(0x12a)){const _0xfc523c=Number(_0x292f30);if(isNaN(_0xfc523c)||_0xfc523c<=0x0)throw CliErrors[_0x6e45a4(0x126)]('pageSize\x20must\x20be\x20a\x20positive\x20number');}const _0x4a4160=resolveWriteScope({'explicitGlobal':_0x2cccb6[_0x6e45a4(0x11a)]('global'),'policy':'project-or-global-explicit'}),_0x32a618=toScopeFlags(_0x4a4160),_0x5994f9=readScopedConfig(_0x32a618),_0x208fd6=parseAliasAppcodeSetKey(_0x3ae2c7);if(!_0x208fd6&&!isTopLevelConfigKey(_0x3ae2c7))throw CliErrors[_0x6e45a4(0x126)](_0x6e45a4(0x143)+_0x3ae2c7+_0x6e45a4(0x132),'Settable\x20keys:\x20'+getTopLevelConfigKeySummary()+';\x20apps.<alias>.appcode');return _0x208fd6?setLocalAppAlias(_0x5994f9,_0x208fd6,_0x292f30):_0x5994f9[_0x3ae2c7]=_0x3ae2c7===_0x6e45a4(0x12a)?Number(_0x292f30):_0x292f30,console[_0x6e45a4(0x138)](_0x6e45a4(0x121)+_0x3ae2c7+_0x6e45a4(0x135)+_0x292f30+'\x22'+(_0x4a4160==='global'?_0x6e45a4(0x119):'')),writeScopedConfig(_0x5994f9,_0x32a618),{'ok':!![]};}},deleteDef={'service':a18_0x411358(0x149),'command':a18_0x411358(0x144),'description':a18_0x411358(0x140),'risk':a18_0x411358(0x12e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x411358(0x10e),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x5c763a){const _0x17c38e=a18_0x411358,_0x2abfa7=_0x5c763a[_0x17c38e(0x11d)][0x0];if(!_0x2abfa7)throw CliErrors['validation'](_0x17c38e(0x129),'Usage:\x20'+CLI_BIN_NAME+_0x17c38e(0x133));const _0x74ff5c=resolveWriteScope({'explicitGlobal':_0x5c763a[_0x17c38e(0x11a)](_0x17c38e(0x117)),'policy':_0x17c38e(0x11f)}),_0x5e63e1=toScopeFlags(_0x74ff5c),_0x5c7e5e=readScopedConfig(_0x5e63e1),_0x44d2a5=parseAliasDeleteKey(_0x2abfa7);if(_0x44d2a5){if(!deleteLocalAppAlias(_0x5c7e5e,_0x44d2a5))throw CliErrors[_0x17c38e(0x126)](_0x17c38e(0x13b)+_0x2abfa7);return console[_0x17c38e(0x138)](_0x17c38e(0x136)+_0x2abfa7+'`'+(_0x74ff5c===_0x17c38e(0x117)?'\x20(global)':'')),writeScopedConfig(_0x5c7e5e,_0x5e63e1),{'ok':!![]};}if(_0x5c7e5e[_0x2abfa7]===undefined)throw CliErrors[_0x17c38e(0x126)](_0x17c38e(0x118)+_0x2abfa7+'\x22\x20not\x20found\x20at\x20top\x20level.');return delete _0x5c7e5e[_0x2abfa7],console[_0x17c38e(0x138)](_0x17c38e(0x136)+_0x2abfa7+'`'+(_0x74ff5c==='global'?_0x17c38e(0x119):'')),writeScopedConfig(_0x5c7e5e,_0x5e63e1),{'ok':!![]};}};function a18_0x50fe(_0x4534ad,_0x1be6ca){_0x4534ad=_0x4534ad-0x10c;const _0x2a39a4=a18_0x2a39();let _0x50fe97=_0x2a39a4[_0x4534ad];return _0x50fe97;}export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2d17ff,_0x1a05d8){var _0x2f5442=a19_0x538c,_0x24bc80=_0x2d17ff();while(!![]){try{var _0x578140=-parseInt(_0x2f5442(0x19b))/0x1+-parseInt(_0x2f5442(0x1a1))/0x2+parseInt(_0x2f5442(0x19f))/0x3+-parseInt(_0x2f5442(0x198))/0x4*(parseInt(_0x2f5442(0x19a))/0x5)+-parseInt(_0x2f5442(0x199))/0x6*(parseInt(_0x2f5442(0x19c))/0x7)+-parseInt(_0x2f5442(0x19d))/0x8+-parseInt(_0x2f5442(0x19e))/0x9*(-parseInt(_0x2f5442(0x1a0))/0xa);if(_0x578140===_0x1a05d8)break;else _0x24bc80['push'](_0x24bc80['shift']());}catch(_0x4a8188){_0x24bc80['push'](_0x24bc80['shift']());}}}(a19_0x2a13,0xa1c2a));import{CLI_BIN_NAME}from'../../constant/cli.js';export{CLI_BIN_NAME};export{readScopedConfig,writeScopedConfig}from'../../context.js';function a19_0x538c(_0x5b11dc,_0x4158b8){_0x5b11dc=_0x5b11dc-0x198;var _0x2a134f=a19_0x2a13();var _0x538ce7=_0x2a134f[_0x5b11dc];return _0x538ce7;}function a19_0x2a13(){var _0x75edd0=['3716EznPHW','7168038mXlXIm','2395qJrKdP','232344bgCUHx','7jHvcso','2256736OvNBte','3720771XeAFgB','3710970hhdnpX','50EFsgFI','974830cSxOMR'];a19_0x2a13=function(){return _0x75edd0;};return a19_0x2a13();}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_0x4eb904=a20_0x22bc;(function(_0x2d1df5,_0x490e24){const _0x3a5d6b=a20_0x22bc,_0x566d43=_0x2d1df5();while(!![]){try{const _0x20a70d=-parseInt(_0x3a5d6b(0x1b4))/0x1*(-parseInt(_0x3a5d6b(0x1b6))/0x2)+parseInt(_0x3a5d6b(0x17b))/0x3+parseInt(_0x3a5d6b(0x1aa))/0x4+-parseInt(_0x3a5d6b(0x1a1))/0x5*(parseInt(_0x3a5d6b(0x186))/0x6)+parseInt(_0x3a5d6b(0x1a7))/0x7*(parseInt(_0x3a5d6b(0x1b2))/0x8)+-parseInt(_0x3a5d6b(0x185))/0x9*(-parseInt(_0x3a5d6b(0x184))/0xa)+-parseInt(_0x3a5d6b(0x180))/0xb;if(_0x20a70d===_0x490e24)break;else _0x566d43['push'](_0x566d43['shift']());}catch(_0x16285a){_0x566d43['push'](_0x566d43['shift']());}}}(a20_0x408b,0x8a984));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';function a20_0x22bc(_0x17111d,_0xd3067d){_0x17111d=_0x17111d-0x173;const _0x408bb0=a20_0x408b();let _0x22bc92=_0x408bb0[_0x17111d];return _0x22bc92;}import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':'filter','operation':a20_0x4eb904(0x1ae),'risk':'read','paramsRequired':![],'description':'Filter\x20dataset\x20records\x20with\x20query\x20conditions','paramsHint':a20_0x4eb904(0x1ac)+a20_0x4eb904(0x1c1),'helpExtra':[a20_0x4eb904(0x19a),a20_0x4eb904(0x1a6),a20_0x4eb904(0x1a8),a20_0x4eb904(0x1a9),a20_0x4eb904(0x1a2),'\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_0x4eb904(0x1a3),'\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_0x4eb904(0x177),a20_0x4eb904(0x1b7),'','\x20\x20LOGICAL\x20COMBINATORS',a20_0x4eb904(0x173),a20_0x4eb904(0x18f),'',a20_0x4eb904(0x18a),a20_0x4eb904(0x1b1),a20_0x4eb904(0x190),a20_0x4eb904(0x182),'\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)',a20_0x4eb904(0x181),'','\x20\x20PAGINATION',a20_0x4eb904(0x19c),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27',a20_0x4eb904(0x199)]['join']('\x0a')},{'command':a20_0x4eb904(0x19b),'operation':'getOne','risk':a20_0x4eb904(0x178),'paramsRequired':!![],'description':a20_0x4eb904(0x1a4),'paramsHint':a20_0x4eb904(0x175)},{'command':a20_0x4eb904(0x189),'operation':'create','risk':a20_0x4eb904(0x1a5),'paramsRequired':!![],'description':'Create\x20a\x20new\x20record\x20in\x20a\x20dataset','paramsHint':'JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27'},{'command':a20_0x4eb904(0x18d),'operation':a20_0x4eb904(0x18d),'risk':a20_0x4eb904(0x1a5),'paramsRequired':!![],'description':a20_0x4eb904(0x1b0),'paramsHint':a20_0x4eb904(0x195)},{'command':'update','operation':a20_0x4eb904(0x1a0),'risk':a20_0x4eb904(0x1a5),'paramsRequired':!![],'description':'Update\x20an\x20existing\x20record','paramsHint':'JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27'},{'command':a20_0x4eb904(0x1c2),'operation':'delete','risk':a20_0x4eb904(0x192),'paramsRequired':!![],'description':a20_0x4eb904(0x1bd),'paramsHint':a20_0x4eb904(0x175)},{'command':a20_0x4eb904(0x183),'operation':a20_0x4eb904(0x183),'risk':a20_0x4eb904(0x178),'paramsRequired':![],'description':a20_0x4eb904(0x19d),'paramsHint':a20_0x4eb904(0x1ba)+'Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','helpExtra':['\x20\x20AGGREGATE\x20TYPES',a20_0x4eb904(0x1bf),a20_0x4eb904(0x174),'\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_0x4eb904(0x18c),'\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\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','','\x20\x20PARAMS\x20STRUCTURE',a20_0x4eb904(0x198),'\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)',a20_0x4eb904(0x188),a20_0x4eb904(0x17f),'\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_0x4eb904(0x176),'',a20_0x4eb904(0x1b8),a20_0x4eb904(0x197),a20_0x4eb904(0x1be),'',a20_0x4eb904(0x187),a20_0x4eb904(0x1bc),'',a20_0x4eb904(0x18b)][a20_0x4eb904(0x191)]('\x0a')}];function makeDataCommand(_0x274fa2){const _0x5f1d82=a20_0x4eb904,_0x246ce5=_0x5f1d82(0x1b3)+_0x274fa2['command'],_0x261bee={'service':_0x5f1d82(0x17a),'command':_0x274fa2[_0x5f1d82(0x196)],'description':_0x274fa2[_0x5f1d82(0x1af)],'risk':_0x274fa2[_0x5f1d82(0x19e)],'helpExtra':_0x274fa2[_0x5f1d82(0x194)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x274fa2[_0x5f1d82(0x1c0)]}],'validate':async _0x2e632b=>{const _0x28d0a0=_0x5f1d82;_0x274fa2[_0x28d0a0(0x17c)]&&requireAnyOf(_0x2e632b,[_0x28d0a0(0x1b9)],_0x246ce5),_0x274fa2[_0x28d0a0(0x1bb)]===_0x28d0a0(0x18d)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x2e632b['str'](_0x28d0a0(0x1b9))));},async 'execute'(_0x584796){const _0x12e002=_0x5f1d82,_0x2154d=_0x584796['str']('code'),_0x5f08ea=_0x274fa2[_0x12e002(0x1bb)]===_0x12e002(0x18d)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x584796[_0x12e002(0x17e)](_0x12e002(0x1b9)))):parseJsonParams(_0x584796[_0x12e002(0x17e)](_0x12e002(0x1b9)))??{},_0x58fe4b=Date['now'](),_0x448c4d=await executeData(_0x2154d,_0x274fa2['operation'],_0x5f08ea),_0x55781d=Date[_0x12e002(0x18e)]()-_0x58fe4b;return{'ok':!![],'data':{'result':_0x448c4d,'elapsed':_0x55781d},'message':_0x12e002(0x1b3)+_0x274fa2[_0x12e002(0x196)]+_0x12e002(0x19f)+_0x55781d+'ms'};}};return _0x274fa2[_0x5f1d82(0x19e)]!==_0x5f1d82(0x178)&&(_0x261bee['dryRun']=async _0x4320c1=>{const _0x103d7e=_0x5f1d82,_0x3a462f=_0x4320c1['str'](_0x103d7e(0x1ab)),_0x57f62f=_0x274fa2[_0x103d7e(0x1bb)]===_0x103d7e(0x18d)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x4320c1[_0x103d7e(0x17e)](_0x103d7e(0x1b9)))):parseJsonParams(_0x4320c1[_0x103d7e(0x17e)]('params'))??{};return dryRun(_0x103d7e(0x17d),_0x103d7e(0x193)+_0x3a462f+'/'+_0x274fa2[_0x103d7e(0x1bb)])[_0x103d7e(0x179)](_0x57f62f)['description'](_0x103d7e(0x1ad)+_0x274fa2[_0x103d7e(0x196)]+_0x103d7e(0x1b5)+_0x3a462f)['build']();}),_0x261bee;}function a20_0x408b(){const _0x368fff=['params','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','operation','\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','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','\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\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}','paramsHint','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','delete','\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\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}','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','read','body','data','1480806ZytLCC','paramsRequired','POST','str','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','21617684lDyOvV','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','\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}]','aggregate','58280VrHIej','567OnOAJd','220278lcatdO','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','create','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','\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}','batchCreate','now','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','join','high-risk-write','/api/{appCode}/','helpExtra','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','command','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','\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\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','\x20\x20WHERE\x20OPERATORS','getOne','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','risk','\x20completed\x20in\x20','update','135ejsApn','\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$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','Get\x20a\x20single\x20record\x20by\x20ID','write','\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}}','7nBSkiz','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','2175440AUSqbF','code','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','Preview:\x20data\x20','filter','description','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','8699664lndAzN','data\x20','5sZYLDh','\x20on\x20dataset\x20','412838XAnxAC','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','\x20\x20EXAMPLES'];a20_0x408b=function(){return _0x368fff;};return a20_0x408b();}export const dataDefinitions=specs['map'](makeDataCommand);
|
|
1
|
+
function a20_0xf43b(){const _0xd151a7=['join','/api/{appCode}/','operation','502372MiMVjp','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','batchCreate','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','map','data\x20','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','str','5CahmJI','1293422GyTxIJ','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\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}}','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','Filter\x20dataset\x20records\x20with\x20query\x20conditions','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','data','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','read','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','aggregate','build','write','Preview:\x20data\x20','8635635HYKSna','\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}]','162oSnmyy','\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]}}','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','create','\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}','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','update','7260953ZDSnZy','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','delete','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','paramsRequired','helpExtra','risk','filter','\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\x20EXAMPLES','\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\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\x20WHERE\x20OPERATORS','getOne','\x20completed\x20in\x20','\x20\x20PARAMS\x20STRUCTURE','Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','POST','\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\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\x20LOGICAL\x20COMBINATORS','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','\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]','8NtUXSl','command','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','2456660iVRTjV','now','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','5724654KYqLzu','code','dryRun','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','55096MiyTYx','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','\x20\x20\x20\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}}]','params','\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\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','Update\x20an\x20existing\x20record','\x20\x20AGGREGATE\x20TYPES'];a20_0xf43b=function(){return _0xd151a7;};return a20_0xf43b();}const a20_0x5e8073=a20_0x580e;(function(_0x22703c,_0x214d19){const _0x5359de=a20_0x580e,_0x32a420=_0x22703c();while(!![]){try{const _0x109806=parseInt(_0x5359de(0x1a1))/0x1+-parseInt(_0x5359de(0x198))/0x2+parseInt(_0x5359de(0x15d))/0x3*(parseInt(_0x5359de(0x18b))/0x4)+parseInt(_0x5359de(0x1a0))/0x5*(-parseInt(_0x5359de(0x184))/0x6)+parseInt(_0x5359de(0x165))/0x7*(parseInt(_0x5359de(0x17c))/0x8)+-parseInt(_0x5359de(0x15b))/0x9+-parseInt(_0x5359de(0x181))/0xa;if(_0x109806===_0x214d19)break;else _0x32a420['push'](_0x32a420['shift']());}catch(_0xb10e37){_0x32a420['push'](_0x32a420['shift']());}}}(a20_0xf43b,0xa21d5));import{executeData}from'../../core/sdk-client.js';function a20_0x580e(_0x6a047,_0x532b16){_0x6a047=_0x6a047-0x150;const _0xf43b0f=a20_0xf43b();let _0x580e5c=_0xf43b0f[_0x6a047];return _0x580e5c;}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_0x5e8073(0x16c),'operation':a20_0x5e8073(0x16c),'risk':a20_0x5e8073(0x154),'paramsRequired':![],'description':a20_0x5e8073(0x150),'paramsHint':a20_0x5e8073(0x155)+a20_0x5e8073(0x19e),'helpExtra':[a20_0x5e8073(0x171),a20_0x5e8073(0x191),a20_0x5e8073(0x187),a20_0x5e8073(0x177),'\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}}',a20_0x5e8073(0x1a4),a20_0x5e8073(0x178),a20_0x5e8073(0x15e),a20_0x5e8073(0x1a3),a20_0x5e8073(0x188),'\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}}','',a20_0x5e8073(0x179),'\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)',a20_0x5e8073(0x17e),a20_0x5e8073(0x17b),a20_0x5e8073(0x15c),a20_0x5e8073(0x1a2),a20_0x5e8073(0x180),'','\x20\x20PAGINATION',a20_0x5e8073(0x162),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27',a20_0x5e8073(0x17f)][a20_0x5e8073(0x195)]('\x0a')},{'command':a20_0x5e8073(0x172),'operation':a20_0x5e8073(0x172),'risk':a20_0x5e8073(0x154),'paramsRequired':!![],'description':'Get\x20a\x20single\x20record\x20by\x20ID','paramsHint':a20_0x5e8073(0x189)},{'command':a20_0x5e8073(0x160),'operation':a20_0x5e8073(0x160),'risk':a20_0x5e8073(0x159),'paramsRequired':!![],'description':a20_0x5e8073(0x153),'paramsHint':a20_0x5e8073(0x199)},{'command':'batchCreate','operation':a20_0x5e8073(0x19a),'risk':'write','paramsRequired':!![],'description':a20_0x5e8073(0x156),'paramsHint':a20_0x5e8073(0x168)},{'command':a20_0x5e8073(0x164),'operation':a20_0x5e8073(0x164),'risk':'write','paramsRequired':!![],'description':a20_0x5e8073(0x193),'paramsHint':'JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27'},{'command':a20_0x5e8073(0x167),'operation':a20_0x5e8073(0x167),'risk':'high-risk-write','paramsRequired':!![],'description':a20_0x5e8073(0x17a),'paramsHint':a20_0x5e8073(0x189)},{'command':a20_0x5e8073(0x157),'operation':'aggregate','risk':'read','paramsRequired':![],'description':a20_0x5e8073(0x18c),'paramsHint':a20_0x5e8073(0x15f)+a20_0x5e8073(0x175),'helpExtra':[a20_0x5e8073(0x194),'\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','\x20\x20\x20\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_0x5e8073(0x161),a20_0x5e8073(0x18e),a20_0x5e8073(0x16f),a20_0x5e8073(0x18d),'\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}','',a20_0x5e8073(0x174),a20_0x5e8073(0x170),a20_0x5e8073(0x183),a20_0x5e8073(0x151),a20_0x5e8073(0x166),a20_0x5e8073(0x18f),a20_0x5e8073(0x18a),'',a20_0x5e8073(0x16e),a20_0x5e8073(0x163),a20_0x5e8073(0x16d),'',a20_0x5e8073(0x192),'\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_0x5e8073(0x19b)][a20_0x5e8073(0x195)]('\x0a')}];function makeDataCommand(_0x1de73e){const _0x50f95d=a20_0x5e8073,_0x15a17e=_0x50f95d(0x19d)+_0x1de73e[_0x50f95d(0x17d)],_0x35962d={'service':_0x50f95d(0x152),'command':_0x1de73e[_0x50f95d(0x17d)],'description':_0x1de73e['description'],'risk':_0x1de73e['risk'],'helpExtra':_0x1de73e[_0x50f95d(0x16a)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x1de73e['paramsHint']}],'validate':async _0x294c6c=>{const _0x3ed456=_0x50f95d;_0x1de73e[_0x3ed456(0x169)]&&requireAnyOf(_0x294c6c,[_0x3ed456(0x190)],_0x15a17e),_0x1de73e['operation']===_0x3ed456(0x19a)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x294c6c[_0x3ed456(0x19f)](_0x3ed456(0x190))));},async 'execute'(_0xdf80df){const _0xdb6470=_0x50f95d,_0x36ce25=_0xdf80df[_0xdb6470(0x19f)](_0xdb6470(0x185)),_0x4a1cfb=_0x1de73e[_0xdb6470(0x197)]===_0xdb6470(0x19a)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0xdf80df[_0xdb6470(0x19f)](_0xdb6470(0x190)))):parseJsonParams(_0xdf80df[_0xdb6470(0x19f)](_0xdb6470(0x190)))??{},_0x309aa7=Date['now'](),_0x5c595e=await executeData(_0x36ce25,_0x1de73e[_0xdb6470(0x197)],_0x4a1cfb),_0x2d7795=Date[_0xdb6470(0x182)]()-_0x309aa7;return{'ok':!![],'data':{'result':_0x5c595e,'elapsed':_0x2d7795},'message':_0xdb6470(0x19d)+_0x1de73e[_0xdb6470(0x17d)]+_0xdb6470(0x173)+_0x2d7795+'ms'};}};return _0x1de73e[_0x50f95d(0x16b)]!==_0x50f95d(0x154)&&(_0x35962d[_0x50f95d(0x186)]=async _0x2d3271=>{const _0x4eccf1=_0x50f95d,_0x2da736=_0x2d3271[_0x4eccf1(0x19f)](_0x4eccf1(0x185)),_0x2834f4=_0x1de73e['operation']==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x2d3271[_0x4eccf1(0x19f)](_0x4eccf1(0x190)))):parseJsonParams(_0x2d3271[_0x4eccf1(0x19f)](_0x4eccf1(0x190)))??{};return dryRun(_0x4eccf1(0x176),_0x4eccf1(0x196)+_0x2da736+'/'+_0x1de73e[_0x4eccf1(0x197)])['body'](_0x2834f4)['description'](_0x4eccf1(0x15a)+_0x1de73e['command']+'\x20on\x20dataset\x20'+_0x2da736)[_0x4eccf1(0x158)]();}),_0x35962d;}export const dataDefinitions=specs[a20_0x5e8073(0x19c)](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x8e2973=a21_0x5017;(function(_0x565f9d,_0x6bf25c){const _0x552273=a21_0x5017,_0x580451=_0x565f9d();while(!![]){try{const _0x4a2738=-parseInt(_0x552273(0x9e))/0x1+parseInt(_0x552273(0x84))/0x2+-parseInt(_0x552273(0x94))/0x3+parseInt(_0x552273(0x9b))/0x4+-parseInt(_0x552273(0xbe))/0x5+-parseInt(_0x552273(0xae))/0x6+parseInt(_0x552273(0x98))/0x7;if(_0x4a2738===_0x6bf25c)break;else _0x580451['push'](_0x580451['shift']());}catch(_0x40e5b0){_0x580451['push'](_0x580451['shift']());}}}(a21_0x4fe7,0x4a547));import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x5932b5){const _0x640755=a21_0x5017;if(_0x5932b5[_0x640755(0xa5)])return null;const _0x20f7c7=Boolean(_0x5932b5[_0x640755(0xb3)]!==undefined||_0x5932b5[_0x640755(0xa6)]!==undefined);let _0x46ddc2={};if(!_0x20f7c7&&typeof _0x5932b5[_0x640755(0xb7)]===_0x640755(0xb2))try{_0x46ddc2=JSON[_0x640755(0x87)](_0x5932b5[_0x640755(0xb7)]);}catch{}const _0x62e851=_0x20f7c7?_0x5932b5[_0x640755(0x96)]:_0x5932b5[_0x640755(0x8e)],_0x2a1d10=_0x20f7c7?_0x5932b5[_0x640755(0xb3)]:_0x5932b5[_0x640755(0x96)],_0xc7b477=_0x20f7c7?_0x5932b5['doType']:_0x5932b5[_0x640755(0x7a)]||_0x5932b5[_0x640755(0x9f)],_0x1ba533=_0x20f7c7?_0x5932b5[_0x640755(0xaf)]===!![]:_0x46ddc2[_0x640755(0xaf)]===!![],_0x5acaa2=_0x20f7c7?_0x5932b5[_0x640755(0x7b)]===!![]:_0x46ddc2[_0x640755(0x7b)]===!![],_0x4acd00=_0x20f7c7?_0x5932b5[_0x640755(0xaa)]??null:_0x46ddc2[_0x640755(0xaa)]??null,_0x5aaeb4={'name':_0x62e851,'displayName':_0x2a1d10||_0x62e851,'type':_0xc7b477,'dbType':_0x5932b5[_0x640755(0xba)],'pk':_0x1ba533,'required':_0x5acaa2,'description':_0x5932b5[_0x640755(0xac)]||undefined};return Array['isArray'](_0x4acd00)&&_0x4acd00[_0x640755(0x9d)]>0x0&&(_0x5aaeb4[_0x640755(0xaa)]=_0x4acd00),_0x5aaeb4;}function parseJsonMaybe(_0x17b22e){const _0x386023=a21_0x5017;if(typeof _0x17b22e!==_0x386023(0xb2))return _0x17b22e;try{return JSON[_0x386023(0x87)](_0x17b22e);}catch{return _0x17b22e;}}function normalizeOperationEntry(_0x487785,_0x237695){const _0x211198=a21_0x5017;if(!_0x237695||typeof _0x237695!==_0x211198(0x93))return null;if(!_0x237695[_0x211198(0x83)]||!_0x237695[_0x211198(0xa2)])return null;const _0x5a6858={'name':_0x487785,'method':_0x237695[_0x211198(0x83)],'path':_0x237695[_0x211198(0xa2)]};if(_0x237695['host'])_0x5a6858[_0x211198(0xb9)]=_0x237695[_0x211198(0xb9)];if(_0x237695[_0x211198(0xb0)]!=null)_0x5a6858[_0x211198(0xb0)]=parseJsonMaybe(_0x237695[_0x211198(0xb0)]);if(_0x237695[_0x211198(0x85)]!=null)_0x5a6858['responseBody']=parseJsonMaybe(_0x237695[_0x211198(0x85)]);if(_0x237695[_0x211198(0x82)]!=null)_0x5a6858['beforeScriptId']=_0x237695[_0x211198(0x82)];if(_0x237695[_0x211198(0x7e)]!=null)_0x5a6858[_0x211198(0x7e)]=_0x237695['afterScriptId'];if(Array[_0x211198(0xad)](_0x237695[_0x211198(0x9c)]))_0x5a6858[_0x211198(0x9c)]=_0x237695['requestFields'];if(Array['isArray'](_0x237695[_0x211198(0x89)]))_0x5a6858['responseFields']=_0x237695['responseFields'];return _0x5a6858;}function a21_0x4fe7(){const _0x457d88=['312196FgdUPc','dataType','map','dbtableConfig','path','logicField','entries','deleted','doType','tableComment','dbId','str','options','title','description','isArray','636210dxcgev','pkField','requestBody','modifierNameField','string','displayName','indexes','modifierIdField','push','extend','properties','host','dbType','validateRules','datasetKey','fields','2700985hwPOOH','source','type','required','dblinkInfoDTO','formatRules','afterScriptId','dbName','relations','Get\x20dataset\x20detail\x20including\x20fields,\x20relations,\x20and\x20operations','beforeScriptId','method','594190vXEUXZ','responseBody','trim','parse','tableName','responseFields','modelId','appCode','allFieldNames','split','code','dataset','filter','creatorIdField','modelCode','object','1819128JKoaZc','updateTimeField','name','columnCodeListWithDeleted','9929822xslFXi','operations','allFields','614472LXozpJ','requestFields','length'];a21_0x4fe7=function(){return _0x457d88;};return a21_0x4fe7();}function summarizeDbtable(_0x325fb4){const _0x4c8d16=a21_0x5017,_0x963000={},_0x1c7000=['dbId',_0x4c8d16(0x7f),'tableName','datasetKey',_0x4c8d16(0xaf),'allFields',_0x4c8d16(0xa3),'createTimeField',_0x4c8d16(0x95),_0x4c8d16(0x91),'creatorNameField',_0x4c8d16(0xb5),_0x4c8d16(0xb1),'labelField',_0x4c8d16(0x7c)];for(const _0x1cbb65 of _0x1c7000){if(_0x325fb4[_0x1cbb65]!==undefined)_0x963000[_0x1cbb65]=_0x325fb4[_0x1cbb65];}return typeof _0x963000[_0x4c8d16(0x9a)]==='string'&&_0x963000['allFields'][_0x4c8d16(0x9d)]>0x0&&(_0x963000[_0x4c8d16(0x8c)]=_0x963000['allFields'][_0x4c8d16(0x8d)](',')[_0x4c8d16(0xa0)](_0x31b056=>_0x31b056['trim']())[_0x4c8d16(0x90)](Boolean)),_0x963000;}function normalizeRelatedPages(_0x1e1fb6){const _0x6da8f=a21_0x5017;if(!Array[_0x6da8f(0xad)](_0x1e1fb6))return[];return _0x1e1fb6['filter'](_0x496116=>_0x496116&&typeof _0x496116===_0x6da8f(0x93))[_0x6da8f(0xa0)](_0x417101=>({'id':_0x417101['id'],'type':_0x417101[_0x6da8f(0x7a)],'code':_0x417101[_0x6da8f(0x8e)],'title':_0x417101[_0x6da8f(0xab)],'deleted':_0x417101[_0x6da8f(0xa5)]===!![]}));}function a21_0x5017(_0x1fe995,_0x9d3e5){_0x1fe995=_0x1fe995-0x7a;const _0x4fe720=a21_0x4fe7();let _0x5017ec=_0x4fe720[_0x1fe995];return _0x5017ec;}function normalizeFallbackFieldName(_0x116d31,_0x4fd407){const _0x54a18b=a21_0x5017,_0x1fbfc1=_0x116d31[_0x54a18b(0x86)]();if(!_0x1fbfc1)return null;return{'name':_0x1fbfc1,'displayName':_0x1fbfc1,'type':undefined,'dbType':undefined,'pk':_0x1fbfc1===_0x4fd407,'required':![],'description':undefined};}async function loadListFieldFallback(_0x5217ef,_0x13bc66){const _0x15c57a=a21_0x5017;if(!_0x5217ef||!_0x13bc66)return[];try{const _0x2d93e2=await listDatasets(_0x5217ef,{'code':_0x13bc66}),_0x2e7f85=_0x2d93e2['find'](_0x46ef64=>_0x46ef64[_0x15c57a(0x8e)]===_0x13bc66)??_0x2d93e2[0x0],_0x42c123=_0x2e7f85?.[_0x15c57a(0xa1)]??{},_0x4ed4ab=typeof _0x42c123['allFields']==='string'?_0x42c123[_0x15c57a(0x9a)][_0x15c57a(0x8d)](','):[];return _0x4ed4ab[_0x15c57a(0xa0)](_0x3624ea=>normalizeFallbackFieldName(_0x3624ea,_0x42c123[_0x15c57a(0xaf)]))['filter'](_0x2a9435=>_0x2a9435!==null);}catch{return[];}}export const datasetDetail={'service':a21_0x8e2973(0x8f),'command':'detail','description':a21_0x8e2973(0x81),'risk':'read','flags':[CODE_FLAG],async 'execute'(_0x12a8ae){const _0x50a8b0=a21_0x8e2973,_0x272038=await getDatasetDetail(_0x12a8ae[_0x50a8b0(0xa9)](_0x50a8b0(0x8e))),_0x571beb=Array[_0x50a8b0(0xad)](_0x272038[_0x50a8b0(0xbd)])?_0x272038['fields']:Array[_0x50a8b0(0xad)](_0x272038[_0x50a8b0(0xb8)])?_0x272038[_0x50a8b0(0xb8)]:[];let _0x34cec9=_0x571beb['map'](_0x32c2d6=>normalizeField(_0x32c2d6))[_0x50a8b0(0x90)](_0x4ae960=>_0x4ae960!==null);_0x34cec9[_0x50a8b0(0x9d)]===0x0&&(_0x34cec9=await loadListFieldFallback(_0x12a8ae[_0x50a8b0(0x8b)],_0x12a8ae[_0x50a8b0(0xa9)]('code')));const _0x2a01ad=_0x272038[_0x50a8b0(0x99)]??{},_0x599d52=[];for(const [_0x1e1c70,_0x1e69f6]of Object[_0x50a8b0(0xa4)](_0x2a01ad)){const _0x2ed673=normalizeOperationEntry(_0x1e1c70,_0x1e69f6);if(_0x2ed673)_0x599d52[_0x50a8b0(0xb6)](_0x2ed673);}const _0x1b656=_0x272038[_0x50a8b0(0xa1)]??{},_0x2562a6=_0x272038[_0x50a8b0(0x8f)]??{},_0x4e7b59=_0x1b656[_0x50a8b0(0xa8)]!=null?{'id':_0x1b656[_0x50a8b0(0xa8)],'name':_0x1b656['dbName']??null}:undefined;let _0x4fe41c;return typeof _0x272038[_0x50a8b0(0xb7)]===_0x50a8b0(0xb2)&&(_0x4fe41c=parseJsonMaybe(_0x272038[_0x50a8b0(0xb7)])),{'ok':!![],'data':{'id':_0x272038[_0x50a8b0(0x8a)]??_0x272038['id'],'name':_0x272038[_0x50a8b0(0x96)],'code':_0x272038[_0x50a8b0(0x92)]||_0x272038[_0x50a8b0(0x8e)],'doVersion':_0x272038['doVersion'],'description':_0x272038[_0x50a8b0(0xac)]||_0x2562a6[_0x50a8b0(0xa7)]||undefined,'source':_0x272038[_0x50a8b0(0xbf)]||_0x2562a6['sourceType'],'table':_0x1b656[_0x50a8b0(0x88)]||_0x2562a6[_0x50a8b0(0x88)],'datasetKey':_0x1b656[_0x50a8b0(0xbc)],'pk':_0x1b656['pkField'],'db':_0x4e7b59,'dbtable':summarizeDbtable(_0x1b656),'fields':_0x34cec9,'operations':_0x599d52,'indexes':Array[_0x50a8b0(0xad)](_0x2562a6[_0x50a8b0(0xb4)])?_0x2562a6[_0x50a8b0(0xb4)]:[],'relations':_0x272038[_0x50a8b0(0x80)]??null,'relatedPages':normalizeRelatedPages(_0x272038['relatedPageInfoList']),...Array[_0x50a8b0(0xad)](_0x272038[_0x50a8b0(0x97)])?{'columnCodeListWithDeleted':_0x272038[_0x50a8b0(0x97)]}:{},'formatRules':Array[_0x50a8b0(0xad)](_0x272038[_0x50a8b0(0x7d)])?_0x272038[_0x50a8b0(0x7d)]:[],'validateRules':Array[_0x50a8b0(0xad)](_0x272038['validateRules'])?_0x272038[_0x50a8b0(0xbb)]:[],..._0x4fe41c!==undefined?{'extend':_0x4fe41c}:{},'stats':{'fieldCount':_0x34cec9['length'],'operationCount':_0x599d52['length']}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a22_0x30be(_0x392a54,_0x1c9335){_0x392a54=_0x392a54-0x1e5;const _0x3dad45=a22_0x3dad();let _0x30bec0=_0x3dad45[_0x392a54];return _0x30bec0;}(function(_0x26b225,_0x451ea3){const _0x485f2d=a22_0x30be,_0x554d38=_0x26b225();while(!![]){try{const _0x1304da=-parseInt(_0x485f2d(0x1e8))/0x1+parseInt(_0x485f2d(0x1eb))/0x2+-parseInt(_0x485f2d(0x1e7))/0x3+-parseInt(_0x485f2d(0x1e5))/0x4*(-parseInt(_0x485f2d(0x1e6))/0x5)+parseInt(_0x485f2d(0x1ec))/0x6*(-parseInt(_0x485f2d(0x1e9))/0x7)+-parseInt(_0x485f2d(0x1ee))/0x8*(parseInt(_0x485f2d(0x1ed))/0x9)+parseInt(_0x485f2d(0x1ea))/0xa;if(_0x1304da===_0x451ea3)break;else _0x554d38['push'](_0x554d38['shift']());}catch(_0x443833){_0x554d38['push'](_0x554d38['shift']());}}}(a22_0x3dad,0x2bbb7));function a22_0x3dad(){const _0x21dfa9=['3387530DYKHOg','76654sDhnGT','42cvXWET','655812ZFjbbC','8rTBmgS','12yGWBrz','192110ynEKKX','37266xVgjAa','209302IrhYXG','18627JYqznk'];a22_0x3dad=function(){return _0x21dfa9;};return a22_0x3dad();}import{datasetList}from'../../commands/dataset/list.js';import{datasetDetail}from'../../commands/dataset/detail.js';import{datasetSdkDoc}from'../../commands/dataset/sdk-doc.js';export const datasetDefinitions=[datasetList,datasetDetail,datasetSdkDoc];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a23_0x47e9e3=a23_0x2c6e;function a23_0x2c6e(_0x54413d,_0x32bfc6){_0x54413d=_0x54413d-0x78;const _0x38d88c=a23_0x38d8();let _0x2c6e81=_0x38d88c[_0x54413d];return _0x2c6e81;}function a23_0x38d8(){const _0x3b0ce2=['93hKcrlM','allFields','split','list','length','397080qDokTY','318aMWObK','trim','2616852EVCpbb','dbtableConfig','read','map','appCode','str','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','110hEpyHe','14380ZsBKky','dataset','description','1468973CdZyBE','pkField','source','10316ZdEjPA','842872lJSOHM','22484ILJsua','tableName','string','name','24TTjPpJ','code'];a23_0x38d8=function(){return _0x3b0ce2;};return a23_0x38d8();}(function(_0xb61c8b,_0xd3ebce){const _0x133767=a23_0x2c6e,_0x3d1814=_0xb61c8b();while(!![]){try{const _0x213a7f=-parseInt(_0x133767(0x93))/0x1+parseInt(_0x133767(0x92))/0x2+-parseInt(_0x133767(0x7c))/0x3*(-parseInt(_0x133767(0x94))/0x4)+-parseInt(_0x133767(0x8c))/0x5*(-parseInt(_0x133767(0x82))/0x6)+-parseInt(_0x133767(0x84))/0x7+parseInt(_0x133767(0x7a))/0x8*(-parseInt(_0x133767(0x81))/0x9)+parseInt(_0x133767(0x8b))/0xa*(parseInt(_0x133767(0x8f))/0xb);if(_0x213a7f===_0xd3ebce)break;else _0x3d1814['push'](_0x3d1814['shift']());}catch(_0x4a5ba3){_0x3d1814['push'](_0x3d1814['shift']());}}}(a23_0x38d8,0x6e49e));import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';export const datasetList={'service':a23_0x47e9e3(0x8d),'command':a23_0x47e9e3(0x7f),'description':'List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','risk':a23_0x47e9e3(0x86),'flags':[{'name':a23_0x47e9e3(0x79),'type':a23_0x47e9e3(0x78),'description':'Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)'},{...CODE_FLAG,'required':![],'description':a23_0x47e9e3(0x8a)}],async 'execute'(_0x47e310){const _0x16a29b=a23_0x47e9e3,_0x628aed=_0x47e310[_0x16a29b(0x89)]('name'),_0x2dda15=_0x47e310[_0x16a29b(0x89)](_0x16a29b(0x7b)),_0x2eab52=await listDatasets(_0x47e310[_0x16a29b(0x88)],{..._0x628aed&&{'name':_0x628aed},..._0x2dda15&&{'code':_0x2dda15}});return{'ok':!![],'data':{'total':_0x2eab52[_0x16a29b(0x80)],'datasets':_0x2eab52[_0x16a29b(0x87)](_0x1a88e6=>{const _0xcf85fc=_0x16a29b,_0x125446=_0x1a88e6[_0xcf85fc(0x85)]??{};return{'id':_0x1a88e6['id'],'code':_0x1a88e6[_0xcf85fc(0x7b)],'name':_0x1a88e6[_0xcf85fc(0x79)],'source':_0x1a88e6[_0xcf85fc(0x91)],'description':_0x1a88e6[_0xcf85fc(0x8e)],'table':_0x125446[_0xcf85fc(0x95)],'datasetKey':_0x125446['datasetKey'],'pk':_0x125446[_0xcf85fc(0x90)],'fields':_0x125446[_0xcf85fc(0x7d)]?_0x125446[_0xcf85fc(0x7d)][_0xcf85fc(0x7e)](',')['map'](_0x1a44c2=>_0x1a44c2[_0xcf85fc(0x83)]()):[]};})}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a24_0xd1a0(_0x31f96a,_0x432d3f){_0x31f96a=_0x31f96a-0xd1;const _0x131a39=a24_0x131a();let _0xd1a0d7=_0x131a39[_0x31f96a];return _0xd1a0d7;}const a24_0x2935a6=a24_0xd1a0;(function(_0x3b1a10,_0x35ec3c){const _0x340f3f=a24_0xd1a0,_0x196883=_0x3b1a10();while(!![]){try{const _0x3668bb=-parseInt(_0x340f3f(0xdd))/0x1+-parseInt(_0x340f3f(0xe1))/0x2+parseInt(_0x340f3f(0xdf))/0x3*(-parseInt(_0x340f3f(0xe0))/0x4)+parseInt(_0x340f3f(0xd5))/0x5*(-parseInt(_0x340f3f(0xd1))/0x6)+parseInt(_0x340f3f(0xe2))/0x7+-parseInt(_0x340f3f(0xde))/0x8*(parseInt(_0x340f3f(0xdb))/0x9)+-parseInt(_0x340f3f(0xd3))/0xa*(-parseInt(_0x340f3f(0xd6))/0xb);if(_0x3668bb===_0x35ec3c)break;else _0x196883['push'](_0x196883['shift']());}catch(_0x4d77b2){_0x196883['push'](_0x196883['shift']());}}}(a24_0x131a,0xb0804));import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';const DEFAULT_MARKDOWN=a24_0x2935a6(0xd7);function a24_0x131a(){const _0x42cc14=['890tAwkMa','dataset','924835XUzoyi','364177WQMqOJ','#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档','string','Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','4419tIYehk','appCode','550357nnVlLg','6256PYQiDs','1164351fnMYep','4JVkvyt','2506276rhHQOr','6348300hcvkmK','str','18uukuKj','read'];a24_0x131a=function(){return _0x42cc14;};return a24_0x131a();}export function formatDatasetSdkMarkdown(_0xfd21cc){const _0x535263=a24_0x2935a6,_0x1e8b59=typeof _0xfd21cc===_0x535263(0xd8)?_0xfd21cc['trim']():'';return _0x1e8b59||DEFAULT_MARKDOWN;}export const datasetSdkDoc={'service':a24_0x2935a6(0xd4),'command':'sdk-doc','description':a24_0x2935a6(0xda),'risk':a24_0x2935a6(0xd2),'flags':[{...CODE_FLAG,'description':a24_0x2935a6(0xd9)}],async 'execute'(_0x188193){const _0x39d118=a24_0x2935a6,_0x1e13ec=_0x188193[_0x39d118(0xe3)]('code'),_0x1a0b80=await getDatasetSdkUsageDoc(_0x1e13ec,_0x188193[_0x39d118(0xdc)]);return{'ok':!![],'data':{'code':_0x1e13ec,'appCode':_0x188193['appCode'],'markdown':formatDatasetSdkMarkdown(_0x1a0b80)}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a25_0x9f37(){const _0x21636c=['length','19096cnAqbc','path','Diagnose\x20CLI\x20configuration\x20and\x20environment','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','defaultApp','registryPath','\x20\x20runtimeDomain:\x20\x20\x20','\x20\x20auth\x20(effective):\x20','arch','✓\x20Loaded','check','pageSize','✓\x20Valid\x20JSON','doctor','1892872WsMMyv','40zdzUND','✗\x20Invalid','commandCount','missing','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','⚠\x20Empty','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','padEnd','status','green','riskLevel','1436936FJnVgY','verbose','248308GqPBeS','gray','message','(not\x20found)','\x20commands)','(none)','\x20\x20API\x20Endpoints','empty','\x20\x20Config\x20JSON','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','accessKey','currentApp','197874sOmtpX','appCode','(missing)','175512GruiNV','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20Imported\x20from:\x20','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','locale','services','\x20\x20Auth','Project','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','ClientAk','yellow','(not\x20set)','\x20\x20─','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','env','\x20\x20Config\x20Files','✗\x20Invalid\x20JSON','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Session\x20check:\x20\x20\x20','serviceCode','\x20(legacy/compat\x20only)','platform','528380cRlTIf','bold','(removed\x20—\x20cookie\x20auth\x20disabled)','serviceCount','14XUWoGS','log','36iGasdJ','red','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','version','(default:\x20','(set,\x20length=','format','repeat'];a25_0x9f37=function(){return _0x21636c;};return a25_0x9f37();}const a25_0x5dfc6e=a25_0x3118;(function(_0x2f4268,_0x1c6f90){const _0x2e1ae9=a25_0x3118,_0x9fe478=_0x2f4268();while(!![]){try{const _0x456d39=parseInt(_0x2e1ae9(0x1dc))/0x1+-parseInt(_0x2e1ae9(0x213))/0x2+-parseInt(_0x2e1ae9(0x1eb))/0x3+-parseInt(_0x2e1ae9(0x1da))/0x4+-parseInt(_0x2e1ae9(0x222))/0x5*(parseInt(_0x2e1ae9(0x1e8))/0x6)+-parseInt(_0x2e1ae9(0x206))/0x7*(-parseInt(_0x2e1ae9(0x221))/0x8)+-parseInt(_0x2e1ae9(0x208))/0x9*(-parseInt(_0x2e1ae9(0x202))/0xa);if(_0x456d39===_0x1c6f90)break;else _0x9fe478['push'](_0x9fe478['shift']());}catch(_0x379927){_0x9fe478['push'](_0x9fe478['shift']());}}}(a25_0x9f37,0x3b060));import a25_0x28baf6 from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';function a25_0x3118(_0x1608e6,_0x393ab8){_0x1608e6=_0x1608e6-0x1d4;const _0x9f37e=a25_0x9f37();let _0x311806=_0x9f37e[_0x1608e6];return _0x311806;}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(_0x2164a6){const _0x1b111d=a25_0x3118,_0xa14f76=getCliVersion(),_0x3f9f93=buildConfigFromFlags({});await initGlobalEnvironment(_0x3f9f93),console[_0x1b111d(0x207)](),console['log'](a25_0x28baf6[_0x1b111d(0x203)](CLI_BIN_NAME+'\x20doctor')),console[_0x1b111d(0x207)](a25_0x28baf6[_0x1b111d(0x1dd)]('─'[_0x1b111d(0x211)](0x32))),console['log'](_0x1b111d(0x1ef)+_0xa14f76),console[_0x1b111d(0x207)]('\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+process[_0x1b111d(0x20d)]),console['log'](_0x1b111d(0x1fd)+process[_0x1b111d(0x201)]+'\x20'+process[_0x1b111d(0x21b)]),console[_0x1b111d(0x207)](),console['log'](a25_0x28baf6['bold'](_0x1b111d(0x1fb))),console[_0x1b111d(0x207)](a25_0x28baf6[_0x1b111d(0x1dd)](_0x1b111d(0x1f8)[_0x1b111d(0x211)](0x1e)));const _0x4f1863=getGlobalConfigPath(),_0xf3f557=getProjectConfigPath();console['log'](_0x1b111d(0x20a)+(_0x4f1863||a25_0x28baf6['gray'](_0x1b111d(0x1df)))),console[_0x1b111d(0x207)]('\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0xf3f557||a25_0x28baf6[_0x1b111d(0x1dd)](_0x1b111d(0x1df)))),console[_0x1b111d(0x207)](),console[_0x1b111d(0x207)](a25_0x28baf6[_0x1b111d(0x203)](_0x1b111d(0x1e4))),console['log'](a25_0x28baf6[_0x1b111d(0x1dd)](_0x1b111d(0x1f8)['repeat'](0x1e)));const _0x36c837=(_0x42c58b,_0x5834b4)=>{const _0x931df4=_0x1b111d;if(!_0x5834b4){console[_0x931df4(0x207)]('\x20\x20'+_0x42c58b[_0x931df4(0x1d6)](0x11)+'\x20'+a25_0x28baf6[_0x931df4(0x1dd)]('(no\x20file)'));return;}const _0x5878e2=inspectCliConfigJsonFile(_0x5834b4);if(_0x5878e2[_0x931df4(0x1d7)]==='ok')console['log']('\x20\x20'+_0x42c58b['padEnd'](0x11)+'\x20'+a25_0x28baf6[_0x931df4(0x1d8)](_0x931df4(0x21f)));else{if(_0x5878e2[_0x931df4(0x1d7)]===_0x931df4(0x1e3))console[_0x931df4(0x207)]('\x20\x20'+_0x42c58b[_0x931df4(0x1d6)](0x11)+'\x20'+a25_0x28baf6[_0x931df4(0x1f6)]('⚠\x20Empty\x20(treated\x20as\x20{})'));else _0x5878e2['status']===_0x931df4(0x225)?console[_0x931df4(0x207)]('\x20\x20'+_0x42c58b[_0x931df4(0x1d6)](0x11)+'\x20'+a25_0x28baf6[_0x931df4(0x1dd)](_0x931df4(0x1ea))):(console[_0x931df4(0x207)]('\x20\x20'+_0x42c58b[_0x931df4(0x1d6)](0x11)+'\x20'+a25_0x28baf6['red'](_0x931df4(0x1fc))),console[_0x931df4(0x207)]('\x20\x20'+''[_0x931df4(0x1d6)](0x11)+'\x20'+a25_0x28baf6[_0x931df4(0x209)](_0x5878e2['message'])));}};_0x36c837('Global',_0x4f1863),_0x36c837(_0x1b111d(0x1f3),_0xf3f557),console[_0x1b111d(0x207)](),console[_0x1b111d(0x207)](a25_0x28baf6['bold']('\x20\x20Merged\x20Config')),console['log'](a25_0x28baf6['gray'](_0x1b111d(0x1f8)['repeat'](0x1e))),console[_0x1b111d(0x207)](_0x1b111d(0x1f4)+(_0x3f9f93[_0x1b111d(0x1e9)]||a25_0x28baf6[_0x1b111d(0x209)](_0x1b111d(0x1f7)))),console[_0x1b111d(0x207)](_0x1b111d(0x216)+_0x3f9f93[_0x1b111d(0x1fa)]);const _0x29bb64=isLegacyCompatConfigKey(_0x1b111d(0x1f0))?a25_0x28baf6[_0x1b111d(0x1dd)](_0x3f9f93['locale']+_0x1b111d(0x200)):_0x3f9f93['locale'];console[_0x1b111d(0x207)](_0x1b111d(0x1d5)+_0x29bb64),console[_0x1b111d(0x207)]('\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20'+(_0x3f9f93[_0x1b111d(0x217)]||a25_0x28baf6['gray'](_0x1b111d(0x1e1)))),console[_0x1b111d(0x207)]('\x20\x20currentApp:\x20\x20\x20\x20\x20\x20'+(_0x3f9f93[_0x1b111d(0x1e7)]||a25_0x28baf6[_0x1b111d(0x1dd)](_0x1b111d(0x1e1)))),console[_0x1b111d(0x207)]('\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x3f9f93[_0x1b111d(0x210)]||a25_0x28baf6[_0x1b111d(0x1dd)](_0x1b111d(0x20e)+DEFAULT_CONFIG_VALUES[_0x1b111d(0x210)]+')'))),console['log'](_0x1b111d(0x1ee)+(_0x3f9f93[_0x1b111d(0x21e)]??a25_0x28baf6['gray']('(default)'))),console[_0x1b111d(0x207)](_0x1b111d(0x1f9)+_0x3f9f93[_0x1b111d(0x1d9)]),console[_0x1b111d(0x207)](_0x1b111d(0x1ec)+_0x3f9f93[_0x1b111d(0x1db)]),console['log'](_0x1b111d(0x21a)+AUTH_MODE['ClientAk']),console[_0x1b111d(0x207)](_0x1b111d(0x227)+(_0x3f9f93[_0x1b111d(0x1e6)]?a25_0x28baf6[_0x1b111d(0x1d8)](_0x1b111d(0x20f)+_0x3f9f93['accessKey'][_0x1b111d(0x212)]+')'):a25_0x28baf6[_0x1b111d(0x1dd)](_0x1b111d(0x1e1)))),console['log'](),console[_0x1b111d(0x207)](a25_0x28baf6[_0x1b111d(0x203)](_0x1b111d(0x1e2))),console[_0x1b111d(0x207)](a25_0x28baf6[_0x1b111d(0x1dd)](_0x1b111d(0x1f8)[_0x1b111d(0x211)](0x1e))),console['log'](_0x1b111d(0x20c)+getApiDomain()),console[_0x1b111d(0x207)](_0x1b111d(0x20b)+getUserDomain()),console['log'](_0x1b111d(0x219)+getRuntimeDomain()),console[_0x1b111d(0x207)](),console[_0x1b111d(0x207)](a25_0x28baf6['bold']('\x20\x20Service\x20Tree')),console[_0x1b111d(0x207)](a25_0x28baf6[_0x1b111d(0x1dd)](_0x1b111d(0x1f8)['repeat'](0x1e)));const _0x232f8d=inspectServiceRegistry();console[_0x1b111d(0x207)]('\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20'+_0x232f8d[_0x1b111d(0x218)]),console['log'](_0x1b111d(0x226)+formatServiceRegistryStatus(_0x232f8d)),console['log']('\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20'+_0x232f8d[_0x1b111d(0x205)]),console['log']('\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20'+_0x232f8d['commandCount']);for(const _0x53a34b of _0x232f8d[_0x1b111d(0x1f1)]){console[_0x1b111d(0x207)]('\x20\x20'+(_0x53a34b[_0x1b111d(0x1ff)]+':')[_0x1b111d(0x1d6)](0x11)+'\x20'+(_0x53a34b['name']||a25_0x28baf6[_0x1b111d(0x1dd)]('(unnamed)'))+'\x20('+_0x53a34b[_0x1b111d(0x224)]+_0x1b111d(0x1e0)),console[_0x1b111d(0x207)]('\x20\x20'+''[_0x1b111d(0x1d6)](0x11)+_0x1b111d(0x1ed)+_0x53a34b['source'][_0x1b111d(0x214)]);}return console[_0x1b111d(0x207)](),console[_0x1b111d(0x207)](a25_0x28baf6[_0x1b111d(0x203)](_0x1b111d(0x1f2))),console['log'](a25_0x28baf6[_0x1b111d(0x1dd)](_0x1b111d(0x1f8)[_0x1b111d(0x211)](0x1e))),console['log'](_0x1b111d(0x1e5)+a25_0x28baf6[_0x1b111d(0x1d8)](AUTH_MODE[_0x1b111d(0x1f5)]+'\x20(accessKey)')),console[_0x1b111d(0x207)](_0x1b111d(0x1fe)+a25_0x28baf6['gray'](_0x1b111d(0x204))),console[_0x1b111d(0x207)](),{'ok':!![]};}function formatServiceRegistryStatus(_0x5559d7){const _0x3aaf8f=a25_0x3118;if(_0x5559d7[_0x3aaf8f(0x1d7)]==='ok')return a25_0x28baf6['green'](_0x3aaf8f(0x21c));if(_0x5559d7[_0x3aaf8f(0x1d7)]===_0x3aaf8f(0x225))return a25_0x28baf6['gray'](_0x3aaf8f(0x1df));if(_0x5559d7['status']===_0x3aaf8f(0x1e3))return a25_0x28baf6[_0x3aaf8f(0x1f6)](_0x3aaf8f(0x1d4));return a25_0x28baf6[_0x3aaf8f(0x209)](_0x3aaf8f(0x223)+(_0x5559d7[_0x3aaf8f(0x1de)]?':\x20'+_0x5559d7['message']:''));}export const doctorDefinition={'service':a25_0x5dfc6e(0x220),'command':a25_0x5dfc6e(0x21d),'description':a25_0x5dfc6e(0x215),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x4a6829=a26_0x1c17;(function(_0x2bc4a2,_0x541a1c){const _0x4617fe=a26_0x1c17,_0x3c73a2=_0x2bc4a2();while(!![]){try{const _0x5e30eb=parseInt(_0x4617fe(0x1cc))/0x1+parseInt(_0x4617fe(0x1ad))/0x2*(parseInt(_0x4617fe(0x1a7))/0x3)+parseInt(_0x4617fe(0x1a4))/0x4+-parseInt(_0x4617fe(0x1c0))/0x5+-parseInt(_0x4617fe(0x1a1))/0x6+parseInt(_0x4617fe(0x1d0))/0x7+-parseInt(_0x4617fe(0x19c))/0x8;if(_0x5e30eb===_0x541a1c)break;else _0x3c73a2['push'](_0x3c73a2['shift']());}catch(_0x4deccc){_0x3c73a2['push'](_0x3c73a2['shift']());}}}(a26_0x1dab,0x65e43));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';function a26_0x1dab(){const _0x10cf89=['Usage:\x20','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','Override\x20imported\x20default\x20appcode','name','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','app','validation','\x20\x20config:\x20\x20','boolean','):\x20','env','cwd','1936710QFWLwb','\x20\x20appcode:\x20','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','trim',')\x20instead\x20of\x20project','stdout','race','defaultApp','appcode','yes','log','apps','513297izOMee','object','cancelled','User\x20aborted\x20prompt','4572498sxMIfX','project','newConfigFileName','Write\x20to\x20global\x20(~/','message','file','entries','string','\x0aInitialized\x20','Target\x20environment\x20(default\x20','File\x20','\x20already\x20exists.\x20Overwrite?','4399992kJbnpO','question','\x20\x20default:\x20','parse','toLowerCase','3078840XeJNGM','once','removeListener','869472OqNWXX','riskLevel','App\x20code\x20for\x20the\x20project','1451847yrYFqq','SIGINT','[y/N]','Invalid\x20env\x20\x22','\x20\x20env:\x20\x20\x20\x20\x20','close','2klIpXs','AbortPrompt','Imported\x20from\x20','Skip\x20confirmation\x20when\x20overwriting','global','Override\x20imported\x20default\x20env'];a26_0x1dab=function(){return _0x10cf89;};return a26_0x1dab();}import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a26_0x4a6829(0x1c8),'type':a26_0x4a6829(0x197),'description':a26_0x4a6829(0x1a6)},{'name':a26_0x4a6829(0x1be),'type':'string','description':a26_0x4a6829(0x199)+DEFAULT_CONFIG_VALUES[a26_0x4a6829(0x1be)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x4a6829(0x1b1),'type':a26_0x4a6829(0x1bc),'description':a26_0x4a6829(0x193)+PRODUCT_CONFIG[a26_0x4a6829(0x1d2)]+')\x20instead\x20of\x20project','default':![]},{'name':a26_0x4a6829(0x1c9),'type':'boolean','description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':a26_0x4a6829(0x195),'type':a26_0x4a6829(0x197),'description':a26_0x4a6829(0x1b4),'required':!![]},{'name':a26_0x4a6829(0x1c8),'type':a26_0x4a6829(0x197),'description':a26_0x4a6829(0x1b6)},{'name':a26_0x4a6829(0x1be),'type':a26_0x4a6829(0x197),'description':a26_0x4a6829(0x1b2),'enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x4a6829(0x1b1),'type':a26_0x4a6829(0x1bc),'description':a26_0x4a6829(0x193)+PRODUCT_CONFIG[a26_0x4a6829(0x1d2)]+a26_0x4a6829(0x1c4),'default':![]},{'name':'yes','type':a26_0x4a6829(0x1bc),'description':a26_0x4a6829(0x1b0),'default':![]}];export async function runInit(_0x187b3e){const _0x116d4d=a26_0x4a6829,_0xeebb12=isNonInteractiveMode(_0x187b3e),_0x520c09=_0x187b3e[_0x116d4d(0x1b1)]?'global':_0x116d4d(0x1d1),_0x288a1a=resolveWriteConfigPath(_0x520c09);try{_0xeebb12?await runNonInteractive(_0x187b3e,_0x288a1a):await runInteractive(_0x187b3e,_0x288a1a);}catch(_0x344184){if(_0x344184 instanceof AbortPrompt)throw CliErrors[_0x116d4d(0x1ce)]();throw _0x344184;}}export async function runInitImport(_0x5f07b1){const _0x5bdbf0=a26_0x4a6829,_0xe897d3=_0x5f07b1[_0x5bdbf0(0x1b1)]?_0x5bdbf0(0x1b1):'project',_0x3895aa=resolveWriteConfigPath(_0xe897d3);await runFromImport(_0x5f07b1,_0x3895aa);}const RUNTIME_IRRELEVANT_KEYS=new Set(['apiDir']);async function runFromImport(_0xb1aca0,_0x293642){const _0x19fd31=a26_0x4a6829,_0x1958a5=resolveFilePath(_0xb1aca0[_0x19fd31(0x195)]);if(!existsSync(_0x1958a5))throw CliErrors[_0x19fd31(0x1ba)]('Source\x20file\x20not\x20found:\x20'+_0x1958a5);const _0x4e7cb0=readSourceFile(_0x1958a5),_0x1c30c4=convertToRuntimeConfig(_0x4e7cb0);_0xb1aca0['appcode']&&(_0x1c30c4[_0x19fd31(0x1c8)]=String(_0xb1aca0[_0x19fd31(0x1c8)]));_0xb1aca0[_0x19fd31(0x1be)]&&(_0x1c30c4[_0x19fd31(0x1be)]=resolveInitEnv(_0xb1aca0));if(!_0x1c30c4[_0x19fd31(0x1c8)])throw CliErrors[_0x19fd31(0x1ba)](_0x19fd31(0x1b8),_0x19fd31(0x1c2));await writeInitConfig(_0x293642,_0x1c30c4,_0xb1aca0),console[_0x19fd31(0x1ca)](_0x19fd31(0x1af)+_0x1958a5),console[_0x19fd31(0x1ca)](_0x19fd31(0x1bb)+_0x293642),console[_0x19fd31(0x1ca)](_0x19fd31(0x1c1)+_0x1c30c4[_0x19fd31(0x1c8)]);if(_0x1c30c4[_0x19fd31(0x1c7)])console[_0x19fd31(0x1ca)](_0x19fd31(0x19e)+_0x1c30c4[_0x19fd31(0x1c7)]);}function convertToRuntimeConfig(_0x153fd2){const _0x28b8fc=a26_0x4a6829;if(_0x153fd2[_0x28b8fc(0x1cb)]&&typeof _0x153fd2[_0x28b8fc(0x1cb)]===_0x28b8fc(0x1cd))throw CliErrors[_0x28b8fc(0x1ba)]('Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x771ee0={};for(const _0xc163cf of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x153fd2[_0xc163cf]!==undefined&&(_0x771ee0[_0xc163cf]=_0x153fd2[_0xc163cf]);}return!_0x771ee0[_0x28b8fc(0x1a5)]&&(_0x771ee0['riskLevel']=DEFAULT_CONFIG_VALUES[_0x28b8fc(0x1a5)]),_0x771ee0;}async function runNonInteractive(_0x2d1b3d,_0x1506ad){const _0x4106fa=a26_0x4a6829,_0x574ebf=_0x2d1b3d[_0x4106fa(0x1c8)];if(!_0x574ebf)throw CliErrors['flagMissing'](_0x4106fa(0x1c8),_0x4106fa(0x1b3)+CLI_BIN_NAME+_0x4106fa(0x1b5));const _0x20381e=resolveInitEnv(_0x2d1b3d);await writeInitConfig(_0x1506ad,{'appcode':_0x574ebf,'env':_0x20381e},_0x2d1b3d),console[_0x4106fa(0x1ca)]('Initialized\x20'+_0x1506ad),console[_0x4106fa(0x1ca)](_0x4106fa(0x1c1)+_0x574ebf),console[_0x4106fa(0x1ca)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x20381e);}function a26_0x1c17(_0x198d06,_0x230d04){_0x198d06=_0x198d06-0x193;const _0x1dabc7=a26_0x1dab();let _0x1c1713=_0x1dabc7[_0x198d06];return _0x1c1713;}async function runInteractive(_0x5d9e42,_0x207d95){const _0x2cdb4a=a26_0x4a6829,_0x41a7f7=loadExisting(_0x207d95),_0x51c6fe=typeof _0x41a7f7?.[_0x2cdb4a(0x1c8)]===_0x2cdb4a(0x197)?_0x41a7f7['appcode']:'',_0x5f2e61=resolveInitEnv(_0x5d9e42);console['log'](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG[_0x2cdb4a(0x1d2)]+'\x0a');if(existsSync(_0x207d95)&&!_0x5d9e42[_0x2cdb4a(0x1c9)]){const _0x1bf11f=await promptYesNo(_0x2cdb4a(0x19a)+_0x207d95+_0x2cdb4a(0x19b),![]);if(!_0x1bf11f){console[_0x2cdb4a(0x1ca)]('Aborted.');return;}}const _0x1113cf=typeof _0x5d9e42[_0x2cdb4a(0x1c8)]==='string'?_0x5d9e42[_0x2cdb4a(0x1c8)][_0x2cdb4a(0x1c3)]():'';let _0xa0d639=_0x1113cf;!_0xa0d639&&(_0xa0d639=await promptInput('App\x20code',_0x51c6fe));if(!_0xa0d639['trim']())throw CliErrors['validation']('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x207d95,{'appcode':_0xa0d639['trim'](),'env':_0x5f2e61},_0x5d9e42),console[_0x2cdb4a(0x1ca)](_0x2cdb4a(0x198)+_0x207d95),console[_0x2cdb4a(0x1ca)](_0x2cdb4a(0x1c1)+_0xa0d639[_0x2cdb4a(0x1c3)]()),console[_0x2cdb4a(0x1ca)](_0x2cdb4a(0x1ab)+_0x5f2e61);}async function writeInitConfig(_0x5b32d4,_0x5e61f0,_0x5ffcc7){const _0x4b9cb7=a26_0x4a6829;let _0x14c77d={};existsSync(_0x5b32d4)&&!_0x5ffcc7[_0x4b9cb7(0x1c9)]&&(_0x14c77d=readConfigFile(_0x5b32d4));for(const [_0x23a6d5,_0x22220e]of Object[_0x4b9cb7(0x196)](_0x5e61f0)){_0x22220e!==undefined&&(_0x14c77d[_0x23a6d5]=_0x22220e);}if(_0x14c77d['app'])delete _0x14c77d[_0x4b9cb7(0x1b9)];writeConfigFile(_0x5b32d4,_0x14c77d);}class AbortPrompt extends Error{constructor(){const _0x58a4ce=a26_0x4a6829;super(_0x58a4ce(0x1cf)),this[_0x58a4ce(0x1b7)]=_0x58a4ce(0x1ae);}}function createSafeRl(){const _0x3e43d7=a26_0x4a6829,_0x4df7f9=createInterface({'input':process['stdin'],'output':process[_0x3e43d7(0x1c5)]});let _0x20e65a;const _0x43ca2a=new Promise((_0x4aa16e,_0x4079b7)=>{const _0x116921=_0x3e43d7;_0x20e65a=()=>{const _0x229620=a26_0x1c17;_0x20e65a&&(_0x4df7f9[_0x229620(0x1a3)](_0x229620(0x1a8),_0x20e65a),_0x20e65a=undefined);try{_0x4df7f9['close']();}catch{}_0x4079b7(new AbortPrompt());},_0x4df7f9[_0x116921(0x1a2)](_0x116921(0x1a8),_0x20e65a);}),_0x2470d2=()=>{const _0x1163aa=_0x3e43d7;_0x20e65a&&(_0x4df7f9[_0x1163aa(0x1a3)](_0x1163aa(0x1a8),_0x20e65a),_0x20e65a=undefined);try{_0x4df7f9[_0x1163aa(0x1ac)]();}catch{}};return{'rl':_0x4df7f9,'abortPromise':_0x43ca2a,'disposeSuccess':_0x2470d2};}async function promptInput(_0x19527f,_0x1cc9fb){const {rl:_0x16ca14,abortPromise:_0x36e574,disposeSuccess:_0x306b72}=createSafeRl(),_0x84b3b0=new Promise(_0x53edf8=>{const _0x23c73f=a26_0x1c17,_0x3b8ff5=_0x1cc9fb?'\x20\x20'+_0x19527f+'\x20('+_0x1cc9fb+_0x23c73f(0x1bd):'\x20\x20'+_0x19527f+':\x20';_0x16ca14[_0x23c73f(0x19d)](_0x3b8ff5,_0x400bb0=>{const _0x10a321=_0x23c73f;_0x306b72(),_0x53edf8(_0x400bb0[_0x10a321(0x1c3)]()||_0x1cc9fb);});});return Promise['race']([_0x84b3b0,_0x36e574]);}async function promptYesNo(_0xb7f9e4,_0x5812b0){const _0x2e38c2=a26_0x4a6829,{rl:_0x1088e4,abortPromise:_0x24fa17,disposeSuccess:_0x5850ca}=createSafeRl(),_0x3111dd=new Promise(_0x37c5d1=>{const _0x431fd3=a26_0x1c17,_0x343251=_0x5812b0?'[Y/n]':_0x431fd3(0x1a9);_0x1088e4[_0x431fd3(0x19d)]('\x20\x20'+_0xb7f9e4+'\x20'+_0x343251+':\x20',_0x46729f=>{const _0x201209=_0x431fd3;_0x5850ca();const _0x34c1cc=_0x46729f[_0x201209(0x1c3)]()[_0x201209(0x1a0)]();if(_0x34c1cc==='y'||_0x34c1cc==='yes')_0x37c5d1(!![]);else{if(_0x34c1cc==='n'||_0x34c1cc==='no')_0x37c5d1(![]);else _0x37c5d1(_0x5812b0);}});});return Promise[_0x2e38c2(0x1c6)]([_0x3111dd,_0x24fa17]);}function loadExisting(_0x995174){if(!existsSync(_0x995174))return null;return readConfigFile(_0x995174);}function resolveFilePath(_0x3badfb){const _0x54295a=a26_0x4a6829;return isAbsolute(_0x3badfb)?_0x3badfb:resolve(process[_0x54295a(0x1bf)](),_0x3badfb);}function readSourceFile(_0x248a97){const _0x420b35=a26_0x4a6829;try{const _0x3e8992=readFileSync(_0x248a97,{'encoding':'utf8'});return JSON[_0x420b35(0x19f)](_0x3e8992);}catch(_0x35da08){throw CliErrors[_0x420b35(0x1ba)]('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x35da08[_0x420b35(0x194)]);}}function resolveInitEnv(_0x16a681){const _0x2b02ef=a26_0x4a6829,_0x50068a=_0x16a681[_0x2b02ef(0x1be)];if(_0x50068a===undefined||_0x50068a==='')return DEFAULT_CONFIG_VALUES[_0x2b02ef(0x1be)];if(!RUNTIME_ENV_VALUES['includes'](_0x50068a))throw CliErrors[_0x2b02ef(0x1ba)](_0x2b02ef(0x1aa)+_0x50068a+'\x22.\x20Allowed:\x20'+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x50068a;}
|
|
1
|
+
const a26_0xe50726=a26_0x3963;(function(_0x3045f5,_0x2467ba){const _0x1389e6=a26_0x3963,_0x53896d=_0x3045f5();while(!![]){try{const _0x2c8e4e=parseInt(_0x1389e6(0x18e))/0x1+-parseInt(_0x1389e6(0x185))/0x2*(-parseInt(_0x1389e6(0x180))/0x3)+-parseInt(_0x1389e6(0x17d))/0x4+-parseInt(_0x1389e6(0x1a3))/0x5*(-parseInt(_0x1389e6(0x198))/0x6)+parseInt(_0x1389e6(0x18f))/0x7*(parseInt(_0x1389e6(0x18c))/0x8)+parseInt(_0x1389e6(0x18d))/0x9*(-parseInt(_0x1389e6(0x19e))/0xa)+parseInt(_0x1389e6(0x17b))/0xb*(-parseInt(_0x1389e6(0x1ad))/0xc);if(_0x2c8e4e===_0x2467ba)break;else _0x53896d['push'](_0x53896d['shift']());}catch(_0x4a1e00){_0x53896d['push'](_0x53896d['shift']());}}}(a26_0x2d59,0x240ef));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';function a26_0x3963(_0x497da9,_0x3b285a){_0x497da9=_0x497da9-0x168;const _0x2d5999=a26_0x2d59();let _0x39630e=_0x2d5999[_0x497da9];return _0x39630e;}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_0xe50726(0x173),'type':a26_0xe50726(0x176),'description':a26_0xe50726(0x16e)},{'name':a26_0xe50726(0x17e),'type':a26_0xe50726(0x176),'description':a26_0xe50726(0x191)+DEFAULT_CONFIG_VALUES[a26_0xe50726(0x17e)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0xe50726(0x175),'type':a26_0xe50726(0x178),'description':a26_0xe50726(0x169)+PRODUCT_CONFIG[a26_0xe50726(0x1ac)]+a26_0xe50726(0x197),'default':![]},{'name':'yes','type':a26_0xe50726(0x178),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':'file','type':a26_0xe50726(0x176),'description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':'appcode','type':a26_0xe50726(0x176),'description':a26_0xe50726(0x1a7)},{'name':a26_0xe50726(0x17e),'type':a26_0xe50726(0x176),'description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a26_0xe50726(0x178),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a26_0xe50726(0x1ac)]+a26_0xe50726(0x197),'default':![]},{'name':'yes','type':a26_0xe50726(0x178),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x8bcd46){const _0x665fab=a26_0xe50726,_0x4dcf68=isNonInteractiveMode(_0x8bcd46),_0x549231=_0x8bcd46[_0x665fab(0x175)]?'global':_0x665fab(0x16f),_0x384704=resolveWriteConfigPath(_0x549231);try{_0x4dcf68?await runNonInteractive(_0x8bcd46,_0x384704):await runInteractive(_0x8bcd46,_0x384704);}catch(_0x625dbc){if(_0x625dbc instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0x625dbc;}}export async function runInitImport(_0x4ed3b3){const _0x3fcc69=a26_0xe50726,_0x556c91=_0x4ed3b3[_0x3fcc69(0x175)]?_0x3fcc69(0x175):_0x3fcc69(0x16f),_0x5edc3c=resolveWriteConfigPath(_0x556c91);await runFromImport(_0x4ed3b3,_0x5edc3c);}const RUNTIME_IRRELEVANT_KEYS=new Set([a26_0xe50726(0x192)]);async function runFromImport(_0x3cecdc,_0x2470c0){const _0x2e3b4b=a26_0xe50726,_0x5c0ffb=resolveFilePath(_0x3cecdc[_0x2e3b4b(0x1a2)]);if(!existsSync(_0x5c0ffb))throw CliErrors[_0x2e3b4b(0x177)](_0x2e3b4b(0x1a4)+_0x5c0ffb);const _0x1ced61=readSourceFile(_0x5c0ffb),_0x1720e4=convertToRuntimeConfig(_0x1ced61);_0x3cecdc[_0x2e3b4b(0x173)]&&(_0x1720e4[_0x2e3b4b(0x173)]=String(_0x3cecdc[_0x2e3b4b(0x173)]));_0x3cecdc[_0x2e3b4b(0x17e)]&&(_0x1720e4[_0x2e3b4b(0x17e)]=resolveInitEnv(_0x3cecdc));if(!_0x1720e4[_0x2e3b4b(0x173)])throw CliErrors[_0x2e3b4b(0x177)](_0x2e3b4b(0x1a9),_0x2e3b4b(0x196));await writeInitConfig(_0x2470c0,_0x1720e4,_0x3cecdc),console[_0x2e3b4b(0x181)](_0x2e3b4b(0x1a6)+_0x5c0ffb),console[_0x2e3b4b(0x181)](_0x2e3b4b(0x1b0)+_0x2470c0),console[_0x2e3b4b(0x181)]('\x20\x20appcode:\x20'+_0x1720e4['appcode']);if(_0x1720e4['defaultApp'])console['log']('\x20\x20default:\x20'+_0x1720e4[_0x2e3b4b(0x16a)]);}function convertToRuntimeConfig(_0x4482e3){const _0x204743=a26_0xe50726;if(_0x4482e3[_0x204743(0x193)]&&typeof _0x4482e3['apps']===_0x204743(0x19d))throw CliErrors[_0x204743(0x177)](_0x204743(0x19a),_0x204743(0x1a8));const _0x26eb64={};for(const _0x22c4e0 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x4482e3[_0x22c4e0]!==undefined&&(_0x26eb64[_0x22c4e0]=_0x4482e3[_0x22c4e0]);}return!_0x26eb64[_0x204743(0x170)]&&(_0x26eb64[_0x204743(0x170)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x26eb64;}async function runNonInteractive(_0x3de611,_0x43d8b3){const _0x348535=a26_0xe50726,_0x10b867=_0x3de611[_0x348535(0x173)];if(!_0x10b867)throw CliErrors[_0x348535(0x195)](_0x348535(0x173),_0x348535(0x1ab)+CLI_BIN_NAME+_0x348535(0x16d));const _0x46a14e=resolveInitEnv(_0x3de611);await writeInitConfig(_0x43d8b3,{'appcode':_0x10b867,'env':_0x46a14e},_0x3de611),console[_0x348535(0x181)](_0x348535(0x18a)+_0x43d8b3),console[_0x348535(0x181)]('\x20\x20appcode:\x20'+_0x10b867),console[_0x348535(0x181)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x46a14e);}async function runInteractive(_0x1b11fc,_0x1f5002){const _0x32f507=a26_0xe50726,_0xf31f97=loadExisting(_0x1f5002),_0x46b379=typeof _0xf31f97?.[_0x32f507(0x173)]==='string'?_0xf31f97[_0x32f507(0x173)]:'',_0x2ba15f=resolveInitEnv(_0x1b11fc);console[_0x32f507(0x181)](CLI_BIN_NAME+_0x32f507(0x17c)+PRODUCT_CONFIG[_0x32f507(0x1ac)]+'\x0a');if(existsSync(_0x1f5002)&&!_0x1b11fc['yes']){const _0x84ff23=await promptYesNo(_0x32f507(0x1ae)+_0x1f5002+_0x32f507(0x183),![]);if(!_0x84ff23){console[_0x32f507(0x181)](_0x32f507(0x172));return;}}const _0x4aff19=typeof _0x1b11fc[_0x32f507(0x173)]===_0x32f507(0x176)?_0x1b11fc[_0x32f507(0x173)][_0x32f507(0x19b)]():'';let _0x270c29=_0x4aff19;!_0x270c29&&(_0x270c29=await promptInput(_0x32f507(0x1a1),_0x46b379));if(!_0x270c29[_0x32f507(0x19b)]())throw CliErrors['validation'](_0x32f507(0x18b));await writeInitConfig(_0x1f5002,{'appcode':_0x270c29[_0x32f507(0x19b)](),'env':_0x2ba15f},_0x1b11fc),console[_0x32f507(0x181)](_0x32f507(0x16b)+_0x1f5002),console[_0x32f507(0x181)](_0x32f507(0x194)+_0x270c29[_0x32f507(0x19b)]()),console[_0x32f507(0x181)](_0x32f507(0x19f)+_0x2ba15f);}async function writeInitConfig(_0x217ed2,_0xcb4ea9,_0x21a416){const _0x2ac539=a26_0xe50726;let _0x211853={};existsSync(_0x217ed2)&&!_0x21a416[_0x2ac539(0x186)]&&(_0x211853=readConfigFile(_0x217ed2));for(const [_0x4fb4d6,_0x28ebf3]of Object['entries'](_0xcb4ea9)){_0x28ebf3!==undefined&&(_0x211853[_0x4fb4d6]=_0x28ebf3);}if(_0x211853[_0x2ac539(0x1a5)])delete _0x211853[_0x2ac539(0x1a5)];writeConfigFile(_0x217ed2,_0x211853);}class AbortPrompt extends Error{constructor(){const _0x452501=a26_0xe50726;super(_0x452501(0x168)),this['name']=_0x452501(0x17a);}}function createSafeRl(){const _0x1885a9=a26_0xe50726,_0x388a0f=createInterface({'input':process['stdin'],'output':process[_0x1885a9(0x189)]});let _0x5b6275;const _0x341dc3=new Promise((_0x343c9f,_0x49ce7f)=>{const _0x1d985f=_0x1885a9;_0x5b6275=()=>{const _0x5d48a2=a26_0x3963;_0x5b6275&&(_0x388a0f[_0x5d48a2(0x184)](_0x5d48a2(0x188),_0x5b6275),_0x5b6275=undefined);try{_0x388a0f[_0x5d48a2(0x190)]();}catch{}_0x49ce7f(new AbortPrompt());},_0x388a0f['once'](_0x1d985f(0x188),_0x5b6275);}),_0x4e7d3b=()=>{const _0x4dee2d=_0x1885a9;_0x5b6275&&(_0x388a0f[_0x4dee2d(0x184)]('SIGINT',_0x5b6275),_0x5b6275=undefined);try{_0x388a0f['close']();}catch{}};return{'rl':_0x388a0f,'abortPromise':_0x341dc3,'disposeSuccess':_0x4e7d3b};}async function promptInput(_0x138605,_0x607d1c){const _0x40d821=a26_0xe50726,{rl:_0x26bddd,abortPromise:_0x544af4,disposeSuccess:_0x54c257}=createSafeRl(),_0x35d05a=new Promise(_0x26816f=>{const _0x5ed67b=a26_0x3963,_0xd90b33=_0x607d1c?'\x20\x20'+_0x138605+'\x20('+_0x607d1c+'):\x20':'\x20\x20'+_0x138605+':\x20';_0x26bddd[_0x5ed67b(0x182)](_0xd90b33,_0x35362b=>{const _0x1d308b=_0x5ed67b;_0x54c257(),_0x26816f(_0x35362b[_0x1d308b(0x19b)]()||_0x607d1c);});});return Promise[_0x40d821(0x1aa)]([_0x35d05a,_0x544af4]);}async function promptYesNo(_0x15d6c4,_0x1ceb5a){const {rl:_0x3fe1cc,abortPromise:_0x23f4e4,disposeSuccess:_0x10c6a0}=createSafeRl(),_0x50ffec=new Promise(_0xb55376=>{const _0xe54be5=a26_0x3963,_0x54bef5=_0x1ceb5a?_0xe54be5(0x19c):_0xe54be5(0x1af);_0x3fe1cc[_0xe54be5(0x182)]('\x20\x20'+_0x15d6c4+'\x20'+_0x54bef5+':\x20',_0x5ed847=>{const _0x31bc75=_0xe54be5;_0x10c6a0();const _0x57db1d=_0x5ed847[_0x31bc75(0x19b)]()[_0x31bc75(0x199)]();if(_0x57db1d==='y'||_0x57db1d===_0x31bc75(0x186))_0xb55376(!![]);else{if(_0x57db1d==='n'||_0x57db1d==='no')_0xb55376(![]);else _0xb55376(_0x1ceb5a);}});});return Promise['race']([_0x50ffec,_0x23f4e4]);}function loadExisting(_0x341c34){if(!existsSync(_0x341c34))return null;return readConfigFile(_0x341c34);}function resolveFilePath(_0x2c2f43){const _0x3bc4b2=a26_0xe50726;return isAbsolute(_0x2c2f43)?_0x2c2f43:resolve(process[_0x3bc4b2(0x179)](),_0x2c2f43);}function readSourceFile(_0x1c181e){const _0x446294=a26_0xe50726;try{const _0x861f5f=readFileSync(_0x1c181e,{'encoding':'utf8'});return JSON[_0x446294(0x174)](_0x861f5f);}catch(_0x2cf9c5){throw CliErrors[_0x446294(0x177)]('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x2cf9c5[_0x446294(0x187)]);}}function a26_0x2d59(){const _0x330863=['Invalid\x20env\x20\x22','Aborted.','appcode','parse','global','string','validation','boolean','cwd','AbortPrompt','3586vxXvjq','\x20init\x20—\x20Create\x20','839168nAeSFp','env','\x22.\x20Allowed:\x20','12MMfYYE','log','question','\x20already\x20exists.\x20Overwrite?','removeListener','7194gBrLNF','yes','message','SIGINT','stdout','Initialized\x20','App\x20code\x20cannot\x20be\x20empty.','16DZvZUr','27XDXKFb','135598YuhlXz','699853EvVITE','close','Target\x20environment\x20(default\x20','apiDir','apps','\x20\x20appcode:\x20','flagMissing','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`.',')\x20instead\x20of\x20project','6GEMgUL','toLowerCase','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','trim','[Y/n]','object','169340vodBSL','\x20\x20env:\x20\x20\x20\x20\x20','includes','App\x20code','file','299875LhPiGr','Source\x20file\x20not\x20found:\x20','app','Imported\x20from\x20','Override\x20imported\x20default\x20appcode','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','race','Usage:\x20','newConfigFileName','60LTEVlk','File\x20','[y/N]','\x20\x20config:\x20\x20','User\x20aborted\x20prompt','Write\x20to\x20global\x20(~/','defaultApp','\x0aInitialized\x20','join','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','App\x20code\x20for\x20the\x20project','project','riskLevel'];a26_0x2d59=function(){return _0x330863;};return a26_0x2d59();}function resolveInitEnv(_0x40a349){const _0x490a19=a26_0xe50726,_0x603a71=_0x40a349[_0x490a19(0x17e)];if(_0x603a71===undefined||_0x603a71==='')return DEFAULT_CONFIG_VALUES[_0x490a19(0x17e)];if(!RUNTIME_ENV_VALUES[_0x490a19(0x1a0)](_0x603a71))throw CliErrors['validation'](_0x490a19(0x171)+_0x603a71+_0x490a19(0x17f)+RUNTIME_ENV_VALUES[_0x490a19(0x16c)](',\x20'));return _0x603a71;}
|