@lovrabet/lovrabet-cli 2.1.4-beta.1 → 2.1.4
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(_0x2a37c5,_0x4f6a08){const _0x8c28fb=a15_0x1085,_0x3d0427=_0x2a37c5();while(!![]){try{const _0x5f1ddc=-parseInt(_0x8c28fb(0x1c8))/0x1+-parseInt(_0x8c28fb(0x1c7))/0x2+parseInt(_0x8c28fb(0x1cb))/0x3+parseInt(_0x8c28fb(0x1c9))/0x4*(parseInt(_0x8c28fb(0x1c4))/0x5)+-parseInt(_0x8c28fb(0x1bb))/0x6+parseInt(_0x8c28fb(0x1bf))/0x7+-parseInt(_0x8c28fb(0x1cc))/0x8*(-parseInt(_0x8c28fb(0x1c3))/0x9);if(_0x5f1ddc===_0x4f6a08)break;else _0x3d0427['push'](_0x3d0427['shift']());}catch(_0xf78070){_0x3d0427['push'](_0x3d0427['shift']());}}}(a15_0x2de0,0xbf6a4));function a15_0x1085(_0x1e0179,_0x4d78c1){_0x1e0179=_0x1e0179-0x1b9;const _0x2de050=a15_0x2de0();let _0x108507=_0x2de050[_0x1e0179];return _0x108507;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG}from'../../constant/product.js';export{DEFAULT_APP_PROFILE_NAME,DEFAULT_CONFIG_VALUES}from'../../constant/defaults.js';export{RUNTIME_ENV_VALUES}from'../../constant/env.js';export{OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{isInProject}from'../../context.js';function a15_0x2de0(){const _0x4f9665=['1570NOjdAd',',\x20or\x20run\x20`','\x20(global)','278878mJEUOB','396265VepYtj','3032QRmiSf','newConfigFileName','852267cqwJAL','40DyfrZQ','project','validation','8734290hbhksp','inProject','Flags\x20--global\x20and\x20--project\x20are\x20mutually\x20exclusive.','\x20found).','10582033VequrX','Add\x20--global\x20to\x20write\x20to\x20~/','Not\x20inside\x20a\x20project\x20(no\x20','global','1334943szqTpP'];a15_0x2de0=function(){return _0x4f9665;};return a15_0x2de0();}import{CliErrors}from'../../errors.js';export{buildAppProfileListFields,CONFIG_ENUM_VALUES,IMPORTABLE_RUNTIME_CONFIG_KEYS,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getConfigDefaultValue,getConfigEnumValues,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isLegacyCompatConfigKey,isTopLevelConfigKey}from'../../config/schema.js';export function resolveConfigScope(_0x18dad2){const _0xde9ca4=a15_0x1085,{explicitGlobal:explicitGlobal=![],explicitProject:explicitProject=![],policy:_0x26a290}=_0x18dad2;if(explicitGlobal&&explicitProject)throw CliErrors[_0xde9ca4(0x1ba)](_0xde9ca4(0x1bd),'Use\x20only\x20one\x20config\x20scope\x20flag.');if(explicitGlobal)return _0xde9ca4(0x1c2);if(explicitProject)return _0xde9ca4(0x1b9);switch(_0x26a290){case'global-default':return'global';case'project-default':return _0x18dad2[_0xde9ca4(0x1bc)]??isInProject()?'project':_0xde9ca4(0x1c2);case'project-or-global-explicit':if(!(_0x18dad2['inProject']??isInProject()))throw CliErrors[_0xde9ca4(0x1ba)](_0xde9ca4(0x1c1)+PRODUCT_CONFIG[_0xde9ca4(0x1ca)]+_0xde9ca4(0x1be),_0xde9ca4(0x1c0)+PRODUCT_CONFIG[_0xde9ca4(0x1ca)]+_0xde9ca4(0x1c5)+CLI_BIN_NAME+'\x20init`\x20first.');return _0xde9ca4(0x1b9);}}export function toScopeFlags(_0x270f22){const _0x2146b1=a15_0x1085;return{'global':_0x270f22===_0x2146b1(0x1c2)};}export function formatScopeLabel(_0x4914f3){const _0x3b1593=a15_0x1085;return _0x4914f3===_0x3b1593(0x1c2)?_0x3b1593(0x1c6):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a16_0x32af(){const _0x406dc7=['1994153VsTRmG','\x20are\x20mutually\x20exclusive\x20for\x20`','4917141EMGfXz','504963zjHBxW','1197192kVUjBp',':\x20expected\x20','At\x20least\x20one\x20of\x20','Invalid\x20--','1037660ChxjaO','Use\x20only\x20one\x20of:\x20','8uklNKV','Exactly\x20one\x20of\x20','map','Remove\x20all\x20but\x20one.','Only\x20one\x20of\x20',',\x20got\x20\x22','Provide\x20one\x20of:\x20','test','64436mnSfqu','8JLhVTc','\x20is\x20required\x20for\x20`','str','94624VSBOuj','length','validation','filter'];a16_0x32af=function(){return _0x406dc7;};return a16_0x32af();}(function(_0x587970,_0x15e684){const _0x39b042=a16_0x4d1c,_0x4d7bab=_0x587970();while(!![]){try{const _0x2f5606=-parseInt(_0x39b042(0x16c))/0x1*(parseInt(_0x39b042(0x16b))/0x2)+parseInt(_0x39b042(0x176))/0x3+parseInt(_0x39b042(0x16f))/0x4+-parseInt(_0x39b042(0x161))/0x5+parseInt(_0x39b042(0x177))/0x6+-parseInt(_0x39b042(0x173))/0x7+-parseInt(_0x39b042(0x163))/0x8*(-parseInt(_0x39b042(0x175))/0x9);if(_0x2f5606===_0x15e684)break;else _0x4d7bab['push'](_0x4d7bab['shift']());}catch(_0x1854fd){_0x4d7bab['push'](_0x4d7bab['shift']());}}}(a16_0x32af,0x2dd37));function a16_0x4d1c(_0x522094,_0x5bedee){_0x522094=_0x522094-0x15e;const _0x32afdb=a16_0x32af();let _0x4d1cf8=_0x32afdb[_0x522094];return _0x4d1cf8;}import{CliErrors}from'../../errors.js';function isSet(_0x32ae77,_0x1912db){const _0x3e819e=_0x32ae77['flag'](_0x1912db);return _0x3e819e!==undefined&&_0x3e819e!==''&&_0x3e819e!==![]&&_0x3e819e!==0x0;}function fmtNames(_0x2564c9){const _0xa14cbc=a16_0x4d1c;return _0x2564c9[_0xa14cbc(0x165)](_0x19e362=>'--'+_0x19e362)['join'](',\x20');}export function requireOneOf(_0x16620e,_0x30e018,_0x40f0a7){const _0xb417cc=a16_0x4d1c,_0x24c331=_0x30e018[_0xb417cc(0x172)](_0x209775=>isSet(_0x16620e,_0x209775));if(_0x24c331[_0xb417cc(0x170)]!==0x1)throw CliErrors['validation'](_0x24c331[_0xb417cc(0x170)]===0x0?_0xb417cc(0x164)+fmtNames(_0x30e018)+'\x20is\x20required\x20for\x20`'+_0x40f0a7+'`.':_0xb417cc(0x167)+fmtNames(_0x30e018)+'\x20is\x20allowed,\x20found:\x20'+fmtNames(_0x24c331)+'.',_0x24c331[_0xb417cc(0x170)]===0x0?'Provide\x20one\x20of:\x20'+fmtNames(_0x30e018):_0xb417cc(0x166));}export function requireAnyOf(_0x4776de,_0x4d0d53,_0x4bdd6c){const _0x4ef132=a16_0x4d1c;if(!_0x4d0d53['some'](_0xbfaa58=>isSet(_0x4776de,_0xbfaa58)))throw CliErrors[_0x4ef132(0x171)](_0x4ef132(0x15f)+fmtNames(_0x4d0d53)+_0x4ef132(0x16d)+_0x4bdd6c+'`.',_0x4ef132(0x169)+fmtNames(_0x4d0d53));}export function mutuallyExclusive(_0x37bc3c,_0x56c3e3,_0x4cea57){const _0x13da6a=a16_0x4d1c,_0x2cb0d6=_0x56c3e3[_0x13da6a(0x172)](_0x1fd3da=>isSet(_0x37bc3c,_0x1fd3da));if(_0x2cb0d6[_0x13da6a(0x170)]>0x1)throw CliErrors[_0x13da6a(0x171)]('Flags\x20'+fmtNames(_0x2cb0d6)+_0x13da6a(0x174)+_0x4cea57+'`.',_0x13da6a(0x162)+fmtNames(_0x56c3e3));}export function validatePattern(_0xad9fa,_0x163c31,_0x44d543,_0x1879f0){const _0x544aa8=a16_0x4d1c,_0x258e62=_0xad9fa[_0x544aa8(0x16e)](_0x163c31);if(_0x258e62&&!_0x44d543[_0x544aa8(0x16a)](_0x258e62))throw CliErrors[_0x544aa8(0x171)](_0x544aa8(0x160)+_0x163c31+_0x544aa8(0x15e)+_0x1879f0+_0x544aa8(0x168)+_0x258e62+'\x22.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a17_0x4226(_0x58302b,_0x35e5f5){_0x58302b=_0x58302b-0xb5;const _0x29aec5=a17_0x29ae();let _0x42268b=_0x29aec5[_0x58302b];return _0x42268b;}const a17_0xfeb911=a17_0x4226;function a17_0x29ae(){const _0xe68e0=['code','name','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','params','boolean','6885pPyYQu','string','4384056CRqOST','Resource\x20name\x20for\x20lookup','Dataset\x20code\x20(32-char\x20hex\x20UUID)','649590IXlHUE','938819VscNKT','15653561sEpUUf','12nXxIht','verbose','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','45piCFGY','14711BCcCPn','number','36qhAUSF','4PbzNRD','a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)','1722843wQnDIR','78yfIwFZ'];a17_0x29ae=function(){return _0xe68e0;};return a17_0x29ae();}(function(_0x1e52f3,_0x20efd8){const _0x184bff=a17_0x4226,_0x58314a=_0x1e52f3();while(!![]){try{const _0x15ee2f=parseInt(_0x184bff(0xbb))/0x1*(-parseInt(_0x184bff(0xc1))/0x2)+parseInt(_0x184bff(0xc0))/0x3*(-parseInt(_0x184bff(0xbe))/0x4)+parseInt(_0x184bff(0xc7))/0x5*(parseInt(_0x184bff(0xbd))/0x6)+-parseInt(_0x184bff(0xb5))/0x7+parseInt(_0x184bff(0xc9))/0x8+-parseInt(_0x184bff(0xba))/0x9*(parseInt(_0x184bff(0xcc))/0xa)+parseInt(_0x184bff(0xb6))/0xb*(parseInt(_0x184bff(0xb7))/0xc);if(_0x15ee2f===_0x20efd8)break;else _0x58314a['push'](_0x58314a['shift']());}catch(_0x792f3d){_0x58314a['push'](_0x58314a['shift']());}}}(a17_0x29ae,0x5aeae));export const CODE_FLAG={'name':a17_0xfeb911(0xc2),'type':a17_0xfeb911(0xc8),'required':!![],'description':a17_0xfeb911(0xcb),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a17_0xfeb911(0xbf)}};export const SQLCODE_FLAG={'name':'sqlcode','type':a17_0xfeb911(0xc8),'required':!![],'description':'SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a17_0xfeb911(0xb9)}};export const VERBOSE_FLAG={'name':a17_0xfeb911(0xb8),'type':a17_0xfeb911(0xc6),'description':'Return\x20full\x20raw\x20response\x20object'};export const PARAMS_FLAG={'name':a17_0xfeb911(0xc5),'type':a17_0xfeb911(0xc8),'description':a17_0xfeb911(0xc4)};export const NAME_FLAG={'name':a17_0xfeb911(0xc3),'type':'string','description':a17_0xfeb911(0xca)};export const ID_FLAG={'name':'id','type':a17_0xfeb911(0xbc),'required':!![],'description':'Resource\x20ID'};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a18_0x2b5ddd=a18_0x2fc4;(function(_0x31d91b,_0x4fbe3c){const _0x4e80fc=a18_0x2fc4,_0x22eb20=_0x31d91b();while(!![]){try{const _0x319238=-parseInt(_0x4e80fc(0x1e1))/0x1*(parseInt(_0x4e80fc(0x1e6))/0x2)+-parseInt(_0x4e80fc(0x1e8))/0x3*(parseInt(_0x4e80fc(0x1e7))/0x4)+-parseInt(_0x4e80fc(0x1c9))/0x5*(parseInt(_0x4e80fc(0x1d4))/0x6)+parseInt(_0x4e80fc(0x207))/0x7+parseInt(_0x4e80fc(0x1e2))/0x8+parseInt(_0x4e80fc(0x1f9))/0x9*(parseInt(_0x4e80fc(0x1fd))/0xa)+-parseInt(_0x4e80fc(0x1f1))/0xb;if(_0x319238===_0x4fbe3c)break;else _0x22eb20['push'](_0x22eb20['shift']());}catch(_0x3f5341){_0x22eb20['push'](_0x22eb20['shift']());}}}(a18_0x3884,0xdd2f8));function a18_0x2fc4(_0x1b3320,_0x377c4e){_0x1b3320=_0x1b3320-0x1c6;const _0x388456=a18_0x3884();let _0x2fc416=_0x388456[_0x1b3320];return _0x2fc416;}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':'global','type':'boolean','description':a18_0x2b5ddd(0x1f3),'default':![]};function parseAliasAppcodeSetKey(_0x38789d){const _0xffab5d=a18_0x2b5ddd,_0xc8332a=_0x38789d[_0xffab5d(0x1f8)]('.');if(_0xc8332a['length']!==0x3||_0xc8332a[0x0]!==_0xffab5d(0x1ed)||_0xc8332a[0x2]!==_0xffab5d(0x1c6))return undefined;const _0x13c139=_0xc8332a[0x1]?.['trim']();return _0x13c139?_0x13c139:undefined;}function a18_0x3884(){const _0x3fe28f=['pageSize\x20must\x20be\x20a\x20positive\x20number','write','List\x20current\x20config','Delete\x20a\x20config\x20value','includes','1VUZzmf','14188912DwTgVp','Get\x20a\x20config\x20value','isArray','log','1585074TxlxLz','3148IwZSqk','2637XxsadM','join','global','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','pageSize','apps','project-or-global-explicit','Usage:\x20','Invalid\x20value\x20for\x20\x22','9031671kyqNNe','\x22\x20is\x20not\x20settable.','Write\x20to\x20global\x20config','value','field','\x20(global)','config','split','27YyMVNO','keys','bool','format','3199210IEZOJm','alias','\x20config\x20get\x20<key>','../../context.js','riskLevel','get','list','Missing\x20key\x20argument.','\x20\x20global:\x20\x20','\x20config\x20set\x20<key>\x20<value>\x20[--global]','6631072moCjzQ','Top-level\x20key\x20\x22','appcode','raw','\x20\x20project:\x20','4290nbqamV','args','(none)','stringify','read','Set\x20`','Key\x20\x22','validation','Set\x20a\x20config\x20value','object','length','3282kKFyXY','key','Key\x20not\x20found:\x20','set','Deleted\x20`','trim','pretty','Config\x20files:\x0a'];a18_0x3884=function(){return _0x3fe28f;};return a18_0x3884();}function parseAliasDeleteKey(_0x66fb9a){const _0x3a5ec7=a18_0x2b5ddd,_0x59e323=_0x66fb9a['split']('.');if(_0x59e323['length']===0x2&&_0x59e323[0x0]==='apps'){const _0x20a40f=_0x59e323[0x1]?.[_0x3a5ec7(0x1d9)]();return _0x20a40f?{'alias':_0x20a40f}:undefined;}if(_0x59e323[_0x3a5ec7(0x1d3)]===0x3&&_0x59e323[0x0]===_0x3a5ec7(0x1ed)&&_0x59e323[0x2]===_0x3a5ec7(0x1c6)){const _0x45c1ba=_0x59e323[0x1]?.['trim']();return _0x45c1ba?{'alias':_0x45c1ba,'field':_0x3a5ec7(0x1c6)}:undefined;}return undefined;}function setLocalAppAlias(_0xcc136a,_0x40f127,_0x2a6c44){const _0x58ddb7=a18_0x2b5ddd,_0x4b150a=_0xcc136a[_0x58ddb7(0x1ed)]&&typeof _0xcc136a[_0x58ddb7(0x1ed)]===_0x58ddb7(0x1d2)&&!Array[_0x58ddb7(0x1e4)](_0xcc136a[_0x58ddb7(0x1ed)])?_0xcc136a[_0x58ddb7(0x1ed)]:{},_0x4905fb=_0x4b150a[_0x40f127]&&typeof _0x4b150a[_0x40f127]===_0x58ddb7(0x1d2)&&!Array[_0x58ddb7(0x1e4)](_0x4b150a[_0x40f127])?_0x4b150a[_0x40f127]:{};_0x4905fb['appcode']=_0x2a6c44,_0x4b150a[_0x40f127]=_0x4905fb,_0xcc136a[_0x58ddb7(0x1ed)]=_0x4b150a;}function deleteLocalAppAlias(_0x3fcd18,_0x2118ef){const _0x3f5925=a18_0x2b5ddd;if(!_0x3fcd18[_0x3f5925(0x1ed)]||typeof _0x3fcd18[_0x3f5925(0x1ed)]!==_0x3f5925(0x1d2)||Array['isArray'](_0x3fcd18[_0x3f5925(0x1ed)]))return![];const _0x36fa12=_0x3fcd18[_0x3f5925(0x1ed)],_0x2120da=_0x36fa12[_0x2118ef[_0x3f5925(0x1fe)]];if(!_0x2120da||typeof _0x2120da!=='object'||Array[_0x3f5925(0x1e4)](_0x2120da))return![];if(!_0x2118ef['field'])return delete _0x36fa12[_0x2118ef[_0x3f5925(0x1fe)]],!![];if(!(_0x2118ef[_0x3f5925(0x1f5)]in _0x2120da))return![];return delete _0x2120da[_0x2118ef[_0x3f5925(0x1f5)]],Object[_0x3f5925(0x1fa)](_0x2120da)[_0x3f5925(0x1d3)]===0x0&&delete _0x36fa12[_0x2118ef[_0x3f5925(0x1fe)]],!![];}const listDef={'service':a18_0x2b5ddd(0x1f7),'command':a18_0x2b5ddd(0x203),'description':a18_0x2b5ddd(0x1de),'risk':a18_0x2b5ddd(0x1cd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x29703e){const _0x58734e=a18_0x2b5ddd,{buildConfigFromFlags:_0x141cb2}=await import('../../context.js'),_0x2493aa=_0x141cb2({}),_0x351e3e=getProjectConfigPath(),_0x5b9291=resolveWriteConfigPath('global');if(_0x29703e[_0x58734e(0x1fc)]===_0x58734e(0x1da))return{'ok':!![],'message':'#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a'+(JSON[_0x58734e(0x1cc)](_0x2493aa['raw'],null,0x2)+'\x0a\x0a')+_0x58734e(0x1db)+(_0x58734e(0x1c8)+(_0x351e3e??_0x58734e(0x1cb))+'\x0a')+(_0x58734e(0x205)+_0x5b9291)};return{'ok':!![],'data':{'effective':_0x2493aa[_0x58734e(0x1c7)],'configFiles':{'project':_0x351e3e??null,'global':_0x5b9291}}};}},getDef={'service':a18_0x2b5ddd(0x1f7),'command':a18_0x2b5ddd(0x202),'description':a18_0x2b5ddd(0x1e3),'risk':a18_0x2b5ddd(0x1cd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':a18_0x2b5ddd(0x1eb),'required':!![]}],'flags':[],async 'execute'(_0x5edd62){const _0x5ae0f1=a18_0x2b5ddd,_0x205ef0=_0x5edd62[_0x5ae0f1(0x1ca)][0x0];if(!_0x205ef0)throw CliErrors[_0x5ae0f1(0x1d0)](_0x5ae0f1(0x204),_0x5ae0f1(0x1ef)+CLI_BIN_NAME+_0x5ae0f1(0x1ff));const {buildConfigFromFlags:_0x518c2b}=await import(_0x5ae0f1(0x200)),{raw:_0x16a67b}=_0x518c2b({});if(_0x205ef0[_0x5ae0f1(0x1e0)]('.')){const _0x4caaaa=_0x205ef0[_0x5ae0f1(0x1f8)]('.');let _0x11b6e1=_0x16a67b;for(const _0x1ebbfd of _0x4caaaa){if(_0x11b6e1==null||typeof _0x11b6e1!==_0x5ae0f1(0x1d2))throw CliErrors[_0x5ae0f1(0x1d0)](_0x5ae0f1(0x1d6)+_0x205ef0);_0x11b6e1=_0x11b6e1[_0x1ebbfd];}if(_0x11b6e1===undefined)throw CliErrors[_0x5ae0f1(0x1d0)]('Key\x20not\x20found:\x20'+_0x205ef0);return console['log'](typeof _0x11b6e1===_0x5ae0f1(0x1d2)?JSON[_0x5ae0f1(0x1cc)](_0x11b6e1,null,0x2):String(_0x11b6e1)),{'ok':!![]};}const _0x5dcbe2=_0x16a67b[_0x205ef0];if(_0x5dcbe2===undefined)throw CliErrors['validation'](_0x5ae0f1(0x1d6)+_0x205ef0);return console['log'](typeof _0x5dcbe2==='object'?JSON[_0x5ae0f1(0x1cc)](_0x5dcbe2,null,0x2):String(_0x5dcbe2)),{'ok':!![]};}},setDef={'service':a18_0x2b5ddd(0x1f7),'command':a18_0x2b5ddd(0x1d7),'description':a18_0x2b5ddd(0x1d1),'risk':a18_0x2b5ddd(0x1dd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x2b5ddd(0x1d5),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a18_0x2b5ddd(0x1f4),'description':'Value\x20to\x20assign','required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x4ee9b8){const _0x32cc69=a18_0x2b5ddd,_0xec481f=_0x4ee9b8['args'][0x0],_0x4a0e29=_0x4ee9b8[_0x32cc69(0x1ca)][0x1];if(!_0xec481f||_0x4a0e29===undefined)throw CliErrors[_0x32cc69(0x1d0)]('Missing\x20key\x20or\x20value.','Usage:\x20'+CLI_BIN_NAME+_0x32cc69(0x206));if(ENUM_KEYS[_0xec481f]&&!ENUM_KEYS[_0xec481f][_0x32cc69(0x1e0)](_0x4a0e29))throw CliErrors[_0x32cc69(0x1d0)](_0x32cc69(0x1f0)+_0xec481f+'\x22.\x20Allowed:\x20'+ENUM_KEYS[_0xec481f][_0x32cc69(0x1e9)](',\x20'));if(_0xec481f===_0x32cc69(0x201))throw CliErrors[_0x32cc69(0x1d0)]('\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.');if(_0xec481f===_0x32cc69(0x1ec)){const _0x179a5d=Number(_0x4a0e29);if(isNaN(_0x179a5d)||_0x179a5d<=0x0)throw CliErrors['validation'](_0x32cc69(0x1dc));}const _0x51037c=resolveWriteScope({'explicitGlobal':_0x4ee9b8[_0x32cc69(0x1fb)]('global'),'policy':_0x32cc69(0x1ee)}),_0x5dfd9e=toScopeFlags(_0x51037c),_0xbb8232=readScopedConfig(_0x5dfd9e),_0x1b211f=parseAliasAppcodeSetKey(_0xec481f);if(!_0x1b211f&&!isTopLevelConfigKey(_0xec481f))throw CliErrors['validation'](_0x32cc69(0x208)+_0xec481f+_0x32cc69(0x1f2),'Settable\x20keys:\x20'+getTopLevelConfigKeySummary()+';\x20apps.<alias>.appcode');return _0x1b211f?setLocalAppAlias(_0xbb8232,_0x1b211f,_0x4a0e29):_0xbb8232[_0xec481f]=_0xec481f===_0x32cc69(0x1ec)?Number(_0x4a0e29):_0x4a0e29,console[_0x32cc69(0x1e5)](_0x32cc69(0x1ce)+_0xec481f+'`\x20=\x20\x22'+_0x4a0e29+'\x22'+(_0x51037c===_0x32cc69(0x1ea)?_0x32cc69(0x1f6):'')),writeScopedConfig(_0xbb8232,_0x5dfd9e),{'ok':!![]};}},deleteDef={'service':a18_0x2b5ddd(0x1f7),'command':'delete','description':a18_0x2b5ddd(0x1df),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x2b5ddd(0x1d5),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x1366df){const _0x161509=a18_0x2b5ddd,_0xa41520=_0x1366df[_0x161509(0x1ca)][0x0];if(!_0xa41520)throw CliErrors[_0x161509(0x1d0)](_0x161509(0x204),_0x161509(0x1ef)+CLI_BIN_NAME+'\x20config\x20delete\x20<key>\x20[--global]');const _0x588419=resolveWriteScope({'explicitGlobal':_0x1366df[_0x161509(0x1fb)](_0x161509(0x1ea)),'policy':_0x161509(0x1ee)}),_0x5845ef=toScopeFlags(_0x588419),_0x52d467=readScopedConfig(_0x5845ef),_0x176566=parseAliasDeleteKey(_0xa41520);if(_0x176566){if(!deleteLocalAppAlias(_0x52d467,_0x176566))throw CliErrors['validation']('Key\x20not\x20found:\x20'+_0xa41520);return console[_0x161509(0x1e5)](_0x161509(0x1d8)+_0xa41520+'`'+(_0x588419===_0x161509(0x1ea)?_0x161509(0x1f6):'')),writeScopedConfig(_0x52d467,_0x5845ef),{'ok':!![]};}if(_0x52d467[_0xa41520]===undefined)throw CliErrors['validation'](_0x161509(0x1cf)+_0xa41520+'\x22\x20not\x20found\x20at\x20top\x20level.');return delete _0x52d467[_0xa41520],console[_0x161509(0x1e5)](_0x161509(0x1d8)+_0xa41520+'`'+(_0x588419===_0x161509(0x1ea)?_0x161509(0x1f6):'')),writeScopedConfig(_0x52d467,_0x5845ef),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
1
|
+
const a18_0x387c53=a18_0x92de;(function(_0x4bb5eb,_0x215960){const _0x35aa7f=a18_0x92de,_0x5ec291=_0x4bb5eb();while(!![]){try{const _0xe78a00=parseInt(_0x35aa7f(0xb3))/0x1+parseInt(_0x35aa7f(0x98))/0x2+parseInt(_0x35aa7f(0xab))/0x3+-parseInt(_0x35aa7f(0xb7))/0x4*(-parseInt(_0x35aa7f(0xad))/0x5)+parseInt(_0x35aa7f(0xa5))/0x6+-parseInt(_0x35aa7f(0xb4))/0x7*(-parseInt(_0x35aa7f(0xc5))/0x8)+-parseInt(_0x35aa7f(0x93))/0x9;if(_0xe78a00===_0x215960)break;else _0x5ec291['push'](_0x5ec291['shift']());}catch(_0x1eb2bf){_0x5ec291['push'](_0x5ec291['shift']());}}}(a18_0x4a9f,0x3bb94));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';function a18_0x4a9f(){const _0x1ffabd=['\x22\x20is\x20not\x20settable.','\x20config\x20delete\x20<key>\x20[--global]','raw','343764asnaSC','list','1435lHANNB','object','pageSize\x20must\x20be\x20a\x20positive\x20number','Missing\x20key\x20or\x20value.','field','read','90035mrAEBs','463281TQHMka','\x22\x20not\x20found\x20at\x20top\x20level.','config','2104BiMWJr','Top-level\x20key\x20\x22','set','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','Usage:\x20','log','project-or-global-explicit','Deleted\x20`','alias','\x22.\x20Allowed:\x20','Set\x20a\x20config\x20value','args','length','Get\x20a\x20config\x20value','8LszUIb','Key\x20\x22','bool','\x20\x20global:\x20\x20',';\x20apps.<alias>.appcode','trim','delete','keys','\x20\x20project:\x20','global','boolean','Invalid\x20value\x20for\x20\x22','`\x20=\x20\x22','split','Delete\x20a\x20config\x20value','Key\x20not\x20found:\x20','apps','2808774TlPFRB','includes','isArray','Settable\x20keys:\x20','\x20config\x20set\x20<key>\x20<value>\x20[--global]','155140PzQmjl','riskLevel','join','key','../../context.js','Missing\x20key\x20argument.','List\x20current\x20config','appcode','Value\x20to\x20assign','\x20(global)','validation','Write\x20to\x20global\x20config','stringify','344256aJrINo','pretty','write'];a18_0x4a9f=function(){return _0x1ffabd;};return a18_0x4a9f();}import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':a18_0x387c53(0x8b),'type':a18_0x387c53(0x8c),'description':a18_0x387c53(0xa3),'default':![]};function parseAliasAppcodeSetKey(_0x575e51){const _0x17246f=a18_0x387c53,_0x5a048e=_0x575e51[_0x17246f(0x8f)]('.');if(_0x5a048e['length']!==0x3||_0x5a048e[0x0]!=='apps'||_0x5a048e[0x2]!=='appcode')return undefined;const _0x48b3b1=_0x5a048e[0x1]?.[_0x17246f(0xca)]();return _0x48b3b1?_0x48b3b1:undefined;}function parseAliasDeleteKey(_0x4a8fbf){const _0x2a8226=a18_0x387c53,_0x20afb8=_0x4a8fbf[_0x2a8226(0x8f)]('.');if(_0x20afb8[_0x2a8226(0xc3)]===0x2&&_0x20afb8[0x0]==='apps'){const _0x1df59d=_0x20afb8[0x1]?.[_0x2a8226(0xca)]();return _0x1df59d?{'alias':_0x1df59d}:undefined;}if(_0x20afb8[_0x2a8226(0xc3)]===0x3&&_0x20afb8[0x0]===_0x2a8226(0x92)&&_0x20afb8[0x2]==='appcode'){const _0x3cc085=_0x20afb8[0x1]?.[_0x2a8226(0xca)]();return _0x3cc085?{'alias':_0x3cc085,'field':_0x2a8226(0x9f)}:undefined;}return undefined;}function setLocalAppAlias(_0x59cf7f,_0x15ec56,_0x181d6b){const _0x242a24=a18_0x387c53,_0x40cb77=_0x59cf7f['apps']&&typeof _0x59cf7f['apps']==='object'&&!Array['isArray'](_0x59cf7f[_0x242a24(0x92)])?_0x59cf7f['apps']:{},_0xd72633=_0x40cb77[_0x15ec56]&&typeof _0x40cb77[_0x15ec56]===_0x242a24(0xae)&&!Array[_0x242a24(0x95)](_0x40cb77[_0x15ec56])?_0x40cb77[_0x15ec56]:{};_0xd72633['appcode']=_0x181d6b,_0x40cb77[_0x15ec56]=_0xd72633,_0x59cf7f['apps']=_0x40cb77;}function a18_0x92de(_0x2e33e8,_0x45ea8d){_0x2e33e8=_0x2e33e8-0x8a;const _0x4a9f5a=a18_0x4a9f();let _0x92de3c=_0x4a9f5a[_0x2e33e8];return _0x92de3c;}function deleteLocalAppAlias(_0x245f2e,_0x12b263){const _0x172ec8=a18_0x387c53;if(!_0x245f2e[_0x172ec8(0x92)]||typeof _0x245f2e[_0x172ec8(0x92)]!=='object'||Array[_0x172ec8(0x95)](_0x245f2e[_0x172ec8(0x92)]))return![];const _0x481f08=_0x245f2e['apps'],_0x3f845f=_0x481f08[_0x12b263[_0x172ec8(0xbf)]];if(!_0x3f845f||typeof _0x3f845f!==_0x172ec8(0xae)||Array[_0x172ec8(0x95)](_0x3f845f))return![];if(!_0x12b263[_0x172ec8(0xb1)])return delete _0x481f08[_0x12b263['alias']],!![];if(!(_0x12b263[_0x172ec8(0xb1)]in _0x3f845f))return![];return delete _0x3f845f[_0x12b263['field']],Object[_0x172ec8(0xcc)](_0x3f845f)['length']===0x0&&delete _0x481f08[_0x12b263[_0x172ec8(0xbf)]],!![];}const listDef={'service':a18_0x387c53(0xb6),'command':a18_0x387c53(0xac),'description':a18_0x387c53(0x9e),'risk':a18_0x387c53(0xb2),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x4bea48){const _0x322dd6=a18_0x387c53,{buildConfigFromFlags:_0x87fd64}=await import(_0x322dd6(0x9c)),_0x8ac14b=_0x87fd64({}),_0x31d283=getProjectConfigPath(),_0x6ba3fd=resolveWriteConfigPath(_0x322dd6(0x8b));if(_0x4bea48['format']===_0x322dd6(0xa6))return{'ok':!![],'message':_0x322dd6(0xba)+(JSON[_0x322dd6(0xa4)](_0x8ac14b[_0x322dd6(0xaa)],null,0x2)+'\x0a\x0a')+'Config\x20files:\x0a'+(_0x322dd6(0x8a)+(_0x31d283??'(none)')+'\x0a')+(_0x322dd6(0xc8)+_0x6ba3fd)};return{'ok':!![],'data':{'effective':_0x8ac14b['raw'],'configFiles':{'project':_0x31d283??null,'global':_0x6ba3fd}}};}},getDef={'service':'config','command':'get','description':a18_0x387c53(0xc4),'risk':a18_0x387c53(0xb2),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x387c53(0x9b),'description':'Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','required':!![]}],'flags':[],async 'execute'(_0x581746){const _0x288e3a=a18_0x387c53,_0x3e53df=_0x581746['args'][0x0];if(!_0x3e53df)throw CliErrors[_0x288e3a(0xa2)](_0x288e3a(0x9d),_0x288e3a(0xbb)+CLI_BIN_NAME+'\x20config\x20get\x20<key>');const {buildConfigFromFlags:_0x2a07e9}=await import('../../context.js'),{raw:_0x5529d6}=_0x2a07e9({});if(_0x3e53df['includes']('.')){const _0x441b18=_0x3e53df[_0x288e3a(0x8f)]('.');let _0x563742=_0x5529d6;for(const _0x55a0ae of _0x441b18){if(_0x563742==null||typeof _0x563742!==_0x288e3a(0xae))throw CliErrors[_0x288e3a(0xa2)](_0x288e3a(0x91)+_0x3e53df);_0x563742=_0x563742[_0x55a0ae];}if(_0x563742===undefined)throw CliErrors['validation'](_0x288e3a(0x91)+_0x3e53df);return console['log'](typeof _0x563742==='object'?JSON['stringify'](_0x563742,null,0x2):String(_0x563742)),{'ok':!![]};}const _0x3d9dd8=_0x5529d6[_0x3e53df];if(_0x3d9dd8===undefined)throw CliErrors['validation'](_0x288e3a(0x91)+_0x3e53df);return console['log'](typeof _0x3d9dd8===_0x288e3a(0xae)?JSON[_0x288e3a(0xa4)](_0x3d9dd8,null,0x2):String(_0x3d9dd8)),{'ok':!![]};}},setDef={'service':'config','command':a18_0x387c53(0xb9),'description':a18_0x387c53(0xc1),'risk':a18_0x387c53(0xa7),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x387c53(0x9b),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':'value','description':a18_0x387c53(0xa0),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x3dfaba){const _0xf95111=a18_0x387c53,_0x3c9df6=_0x3dfaba[_0xf95111(0xc2)][0x0],_0xf8b45b=_0x3dfaba['args'][0x1];if(!_0x3c9df6||_0xf8b45b===undefined)throw CliErrors[_0xf95111(0xa2)](_0xf95111(0xb0),_0xf95111(0xbb)+CLI_BIN_NAME+_0xf95111(0x97));if(ENUM_KEYS[_0x3c9df6]&&!ENUM_KEYS[_0x3c9df6][_0xf95111(0x94)](_0xf8b45b))throw CliErrors[_0xf95111(0xa2)](_0xf95111(0x8d)+_0x3c9df6+_0xf95111(0xc0)+ENUM_KEYS[_0x3c9df6][_0xf95111(0x9a)](',\x20'));if(_0x3c9df6===_0xf95111(0x99))throw CliErrors[_0xf95111(0xa2)]('\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.');if(_0x3c9df6==='pageSize'){const _0x381282=Number(_0xf8b45b);if(isNaN(_0x381282)||_0x381282<=0x0)throw CliErrors[_0xf95111(0xa2)](_0xf95111(0xaf));}const _0x30380d=resolveWriteScope({'explicitGlobal':_0x3dfaba[_0xf95111(0xc7)](_0xf95111(0x8b)),'policy':_0xf95111(0xbd)}),_0x5bee8a=toScopeFlags(_0x30380d),_0x5705df=readScopedConfig(_0x5bee8a),_0x4749b6=parseAliasAppcodeSetKey(_0x3c9df6);if(!_0x4749b6&&!isTopLevelConfigKey(_0x3c9df6))throw CliErrors['validation'](_0xf95111(0xb8)+_0x3c9df6+_0xf95111(0xa8),_0xf95111(0x96)+getTopLevelConfigKeySummary()+_0xf95111(0xc9));return _0x4749b6?setLocalAppAlias(_0x5705df,_0x4749b6,_0xf8b45b):_0x5705df[_0x3c9df6]=_0x3c9df6==='pageSize'?Number(_0xf8b45b):_0xf8b45b,console[_0xf95111(0xbc)]('Set\x20`'+_0x3c9df6+_0xf95111(0x8e)+_0xf8b45b+'\x22'+(_0x30380d===_0xf95111(0x8b)?_0xf95111(0xa1):'')),writeScopedConfig(_0x5705df,_0x5bee8a),{'ok':!![]};}},deleteDef={'service':a18_0x387c53(0xb6),'command':a18_0x387c53(0xcb),'description':a18_0x387c53(0x90),'risk':a18_0x387c53(0xa7),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x387c53(0x9b),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x5460a8){const _0x2cddcd=a18_0x387c53,_0x266c06=_0x5460a8[_0x2cddcd(0xc2)][0x0];if(!_0x266c06)throw CliErrors[_0x2cddcd(0xa2)]('Missing\x20key\x20argument.','Usage:\x20'+CLI_BIN_NAME+_0x2cddcd(0xa9));const _0x454e7b=resolveWriteScope({'explicitGlobal':_0x5460a8['bool'](_0x2cddcd(0x8b)),'policy':_0x2cddcd(0xbd)}),_0x1b3bd7=toScopeFlags(_0x454e7b),_0x521cbd=readScopedConfig(_0x1b3bd7),_0x480b7f=parseAliasDeleteKey(_0x266c06);if(_0x480b7f){if(!deleteLocalAppAlias(_0x521cbd,_0x480b7f))throw CliErrors[_0x2cddcd(0xa2)](_0x2cddcd(0x91)+_0x266c06);return console[_0x2cddcd(0xbc)](_0x2cddcd(0xbe)+_0x266c06+'`'+(_0x454e7b==='global'?'\x20(global)':'')),writeScopedConfig(_0x521cbd,_0x1b3bd7),{'ok':!![]};}if(_0x521cbd[_0x266c06]===undefined)throw CliErrors['validation'](_0x2cddcd(0xc6)+_0x266c06+_0x2cddcd(0xb5));return delete _0x521cbd[_0x266c06],console[_0x2cddcd(0xbc)](_0x2cddcd(0xbe)+_0x266c06+'`'+(_0x454e7b==='global'?_0x2cddcd(0xa1):'')),writeScopedConfig(_0x521cbd,_0x1b3bd7),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a19_0x52e3(){var _0x1128d0=['674492YpNNHl','190icffOD','506768hkhEjX','40851fjJHSd','570933WANcyL','16fdLrSm','124042eYOFNe','15cUMbPO','14CUuWDr','16158jMXfeY','1163955ecBbrW'];a19_0x52e3=function(){return _0x1128d0;};return a19_0x52e3();}(function(_0x4e7929,_0x591c06){var _0x438e3b=a19_0x58e5,_0x127416=_0x4e7929();while(!![]){try{var _0x2531db=parseInt(_0x438e3b(0xfa))/0x1+parseInt(_0x438e3b(0xf6))/0x2+parseInt(_0x438e3b(0xf3))/0x3+parseInt(_0x438e3b(0xf4))/0x4*(parseInt(_0x438e3b(0xfb))/0x5)+parseInt(_0x438e3b(0xf2))/0x6*(parseInt(_0x438e3b(0xf1))/0x7)+parseInt(_0x438e3b(0xf9))/0x8*(-parseInt(_0x438e3b(0xf7))/0x9)+parseInt(_0x438e3b(0xf5))/0xa*(-parseInt(_0x438e3b(0xf8))/0xb);if(_0x2531db===_0x591c06)break;else _0x127416['push'](_0x127416['shift']());}catch(_0x4e39f7){_0x127416['push'](_0x127416['shift']());}}}(a19_0x52e3,0x44b57));function a19_0x58e5(_0x2c352e,_0x2a4a0e){_0x2c352e=_0x2c352e-0xf1;var _0x52e335=a19_0x52e3();var _0x58e53d=_0x52e335[_0x2c352e];return _0x58e53d;}import{CLI_BIN_NAME}from'../../constant/cli.js';export{CLI_BIN_NAME};export{readScopedConfig,writeScopedConfig}from'../../context.js';export{resolveConfigScope as resolveWriteScope,TOP_LEVEL_CONFIG_KEYS as TOP_LEVEL_KEYS,CONFIG_ENUM_VALUES as ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey,toScopeFlags}from'../../commands/common/config-policy.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a20_0x2a4e7d=a20_0x45d5;(function(_0x2bdfc3,_0x6dea7c){const _0x33e924=a20_0x45d5,_0x105732=_0x2bdfc3();while(!![]){try{const _0x8723c7=-parseInt(_0x33e924(0x20a))/0x1+parseInt(_0x33e924(0x220))/0x2+parseInt(_0x33e924(0x235))/0x3+parseInt(_0x33e924(0x21e))/0x4*(parseInt(_0x33e924(0x231))/0x5)+parseInt(_0x33e924(0x1f9))/0x6*(-parseInt(_0x33e924(0x224))/0x7)+parseInt(_0x33e924(0x206))/0x8*(parseInt(_0x33e924(0x22d))/0x9)+-parseInt(_0x33e924(0x228))/0xa;if(_0x8723c7===_0x6dea7c)break;else _0x105732['push'](_0x105732['shift']());}catch(_0x51d6fa){_0x105732['push'](_0x105732['shift']());}}}(a20_0x27b4,0x460a4));function a20_0x27b4(){const _0x507f98=['\x20\x20PAGINATION','params','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','24eMVSTV','high-risk-write','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','\x20\x20LOGICAL\x20COMBINATORS','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','str','\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]}}','/api/{appCode}/','\x20\x20EXAMPLES','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','Preview:\x20data\x20','paramsHint','218664hSoYKz','batchCreate','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','read','249494cWMHId','data\x20','\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}}','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','\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','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','getOne','write','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','\x20\x20PARAMS\x20STRUCTURE','\x20\x20WHERE\x20OPERATORS','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','operation','description','create','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','1403660KEybho','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','147494cyHYIQ','POST','\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}}','command','49763vQXWIj','now','dryRun','\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}','1160760AVQgTr','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','\x20\x20\x20\x20$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--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\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','9qoPugg','update','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','data','5VYGaMZ','\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}','map','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','686685gCenwA','code','body','build','delete','\x20\x20AGGREGATE\x20TYPES','\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}]','risk','\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\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)','Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\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}','join','filter'];a20_0x27b4=function(){return _0x507f98;};return a20_0x27b4();}import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a20_0x2a4e7d(0x1f5),'operation':a20_0x2a4e7d(0x1f5),'risk':'read','paramsRequired':![],'description':'Filter\x20dataset\x20records\x20with\x20query\x20conditions','paramsHint':'JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20'+a20_0x2a4e7d(0x211),'helpExtra':[a20_0x2a4e7d(0x217),a20_0x2a4e7d(0x22a),a20_0x2a4e7d(0x1ef),a20_0x2a4e7d(0x21c),a20_0x2a4e7d(0x222),a20_0x2a4e7d(0x229),'\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}}',a20_0x2a4e7d(0x200),'\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_0x2a4e7d(0x1fc),a20_0x2a4e7d(0x20c),'',a20_0x2a4e7d(0x1fd),'\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','',a20_0x2a4e7d(0x212),'\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)',a20_0x2a4e7d(0x21d),a20_0x2a4e7d(0x1ed),a20_0x2a4e7d(0x22c),a20_0x2a4e7d(0x20f),'',a20_0x2a4e7d(0x1f6),'\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27',a20_0x2a4e7d(0x1f1)][a20_0x2a4e7d(0x1f4)]('\x0a')},{'command':a20_0x2a4e7d(0x213),'operation':a20_0x2a4e7d(0x213),'risk':'read','paramsRequired':!![],'description':'Get\x20a\x20single\x20record\x20by\x20ID','paramsHint':a20_0x2a4e7d(0x1f8)},{'command':a20_0x2a4e7d(0x21b),'operation':a20_0x2a4e7d(0x21b),'risk':a20_0x2a4e7d(0x214),'paramsRequired':!![],'description':'Create\x20a\x20new\x20record\x20in\x20a\x20dataset','paramsHint':a20_0x2a4e7d(0x1fe)},{'command':a20_0x2a4e7d(0x207),'operation':a20_0x2a4e7d(0x207),'risk':a20_0x2a4e7d(0x214),'paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','paramsHint':a20_0x2a4e7d(0x210)},{'command':a20_0x2a4e7d(0x22e),'operation':a20_0x2a4e7d(0x22e),'risk':'write','paramsRequired':!![],'description':'Update\x20an\x20existing\x20record','paramsHint':a20_0x2a4e7d(0x215)},{'command':a20_0x2a4e7d(0x1eb),'operation':a20_0x2a4e7d(0x1eb),'risk':a20_0x2a4e7d(0x1fa),'paramsRequired':!![],'description':a20_0x2a4e7d(0x20d),'paramsHint':a20_0x2a4e7d(0x1f8)},{'command':'aggregate','operation':'aggregate','risk':a20_0x2a4e7d(0x209),'paramsRequired':![],'description':'Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','paramsHint':a20_0x2a4e7d(0x21f)+a20_0x2a4e7d(0x1f2),'helpExtra':[a20_0x2a4e7d(0x1ec),'\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}',a20_0x2a4e7d(0x227),'\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\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}',a20_0x2a4e7d(0x232),a20_0x2a4e7d(0x1f3),'\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_0x2a4e7d(0x216),a20_0x2a4e7d(0x1f0),a20_0x2a4e7d(0x203),a20_0x2a4e7d(0x234),a20_0x2a4e7d(0x1fb),'\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_0x2a4e7d(0x22f),'',a20_0x2a4e7d(0x202),'\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status',a20_0x2a4e7d(0x22b),'',a20_0x2a4e7d(0x208),a20_0x2a4e7d(0x20e),'',a20_0x2a4e7d(0x218)]['join']('\x0a')}];function a20_0x45d5(_0x3e9366,_0x2f59d9){_0x3e9366=_0x3e9366-0x1e9;const _0x27b4a5=a20_0x27b4();let _0x45d574=_0x27b4a5[_0x3e9366];return _0x45d574;}function makeDataCommand(_0x5bab9b){const _0x5c0c6b=a20_0x2a4e7d,_0x24ca54=_0x5c0c6b(0x20b)+_0x5bab9b['command'],_0x526211={'service':_0x5c0c6b(0x230),'command':_0x5bab9b[_0x5c0c6b(0x223)],'description':_0x5bab9b['description'],'risk':_0x5bab9b['risk'],'helpExtra':_0x5bab9b['helpExtra'],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x5bab9b[_0x5c0c6b(0x205)]}],'validate':async _0x8a541b=>{const _0x2850e7=_0x5c0c6b;_0x5bab9b['paramsRequired']&&requireAnyOf(_0x8a541b,[_0x2850e7(0x1f7)],_0x24ca54),_0x5bab9b[_0x2850e7(0x219)]===_0x2850e7(0x207)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x8a541b[_0x2850e7(0x1ff)](_0x2850e7(0x1f7))));},async 'execute'(_0x4ec0ae){const _0xc8bbe1=_0x5c0c6b,_0x21dcc8=_0x4ec0ae[_0xc8bbe1(0x1ff)](_0xc8bbe1(0x236)),_0x398733=_0x5bab9b[_0xc8bbe1(0x219)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x4ec0ae[_0xc8bbe1(0x1ff)](_0xc8bbe1(0x1f7)))):parseJsonParams(_0x4ec0ae[_0xc8bbe1(0x1ff)](_0xc8bbe1(0x1f7)))??{},_0x3fd90b=Date[_0xc8bbe1(0x225)](),_0x3aedc6=await executeData(_0x21dcc8,_0x5bab9b[_0xc8bbe1(0x219)],_0x398733),_0x1ddd3d=Date[_0xc8bbe1(0x225)]()-_0x3fd90b;return{'ok':!![],'data':{'result':_0x3aedc6,'elapsed':_0x1ddd3d},'message':_0xc8bbe1(0x20b)+_0x5bab9b[_0xc8bbe1(0x223)]+'\x20completed\x20in\x20'+_0x1ddd3d+'ms'};}};return _0x5bab9b[_0x5c0c6b(0x1ee)]!==_0x5c0c6b(0x209)&&(_0x526211[_0x5c0c6b(0x226)]=async _0x3cc740=>{const _0x2ac84b=_0x5c0c6b,_0x4aa10a=_0x3cc740[_0x2ac84b(0x1ff)](_0x2ac84b(0x236)),_0x26861c=_0x5bab9b[_0x2ac84b(0x219)]===_0x2ac84b(0x207)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x3cc740[_0x2ac84b(0x1ff)]('params'))):parseJsonParams(_0x3cc740[_0x2ac84b(0x1ff)](_0x2ac84b(0x1f7)))??{};return dryRun(_0x2ac84b(0x221),_0x2ac84b(0x201)+_0x4aa10a+'/'+_0x5bab9b[_0x2ac84b(0x219)])[_0x2ac84b(0x1e9)](_0x26861c)[_0x2ac84b(0x21a)](_0x2ac84b(0x204)+_0x5bab9b[_0x2ac84b(0x223)]+'\x20on\x20dataset\x20'+_0x4aa10a)[_0x2ac84b(0x1ea)]();}),_0x526211;}export const dataDefinitions=specs[a20_0x2a4e7d(0x233)](makeDataCommand);
|
|
1
|
+
const a20_0x5e0794=a20_0x5587;(function(_0x4700a3,_0x311fa4){const _0x3b2b36=a20_0x5587,_0x4cbbb6=_0x4700a3();while(!![]){try{const _0x438f5f=-parseInt(_0x3b2b36(0x16e))/0x1+parseInt(_0x3b2b36(0x162))/0x2+parseInt(_0x3b2b36(0x152))/0x3*(-parseInt(_0x3b2b36(0x19c))/0x4)+parseInt(_0x3b2b36(0x190))/0x5+-parseInt(_0x3b2b36(0x1a1))/0x6+-parseInt(_0x3b2b36(0x182))/0x7*(-parseInt(_0x3b2b36(0x167))/0x8)+-parseInt(_0x3b2b36(0x172))/0x9;if(_0x438f5f===_0x311fa4)break;else _0x4cbbb6['push'](_0x4cbbb6['shift']());}catch(_0x57458a){_0x4cbbb6['push'](_0x4cbbb6['shift']());}}}(a20_0x8fdf,0x23dbb));import{executeData}from'../../core/sdk-client.js';function a20_0x5587(_0x29eb05,_0x5de824){_0x29eb05=_0x29eb05-0x152;const _0x8fdf37=a20_0x8fdf();let _0x5587ae=_0x8fdf37[_0x29eb05];return _0x5587ae;}import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';function a20_0x8fdf(){const _0x4ec6b6=['\x20\x20LOGICAL\x20COMBINATORS','Get\x20a\x20single\x20record\x20by\x20ID','Filter\x20dataset\x20records\x20with\x20query\x20conditions','now','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','\x20\x20\x20\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\x20PAGINATION','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\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}','helpExtra','paramsRequired','\x20\x20AGGREGATE\x20TYPES','246958KhfpFL','command','write','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','Preview:\x20data\x20','909464zUNCyW','\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}}','build','\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\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','58062vZegvS','aggregate','/api/{appCode}/','\x20\x20WHERE\x20OPERATORS','313407JOrAMc','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','body','\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}}','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','\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}}','dryRun','join','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','risk','str','\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}}','getOne','\x20completed\x20in\x20','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','7ksPoGP','paramsHint','create','read','\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\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\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}}]','\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\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}','params','\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','batchCreate','data\x20','1047415dXEmvO','code','filter','\x20\x20PARAMS\x20STRUCTURE','\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$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}}','description','operation','POST','\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]}}','delete','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','5988SPOiuG','\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','high-risk-write','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','update','819156QUcObQ','\x20\x20EXAMPLES','141kwBkaf'];a20_0x8fdf=function(){return _0x4ec6b6;};return a20_0x8fdf();}const specs=[{'command':a20_0x5e0794(0x192),'operation':a20_0x5e0794(0x192),'risk':a20_0x5e0794(0x185),'paramsRequired':![],'description':a20_0x5e0794(0x155),'paramsHint':a20_0x5e0794(0x16d)+a20_0x5e0794(0x19b),'helpExtra':[a20_0x5e0794(0x171),a20_0x5e0794(0x16a),a20_0x5e0794(0x187),a20_0x5e0794(0x194),a20_0x5e0794(0x189),a20_0x5e0794(0x175),a20_0x5e0794(0x168),a20_0x5e0794(0x199),a20_0x5e0794(0x17e),a20_0x5e0794(0x178),a20_0x5e0794(0x195),'',a20_0x5e0794(0x153),'\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)','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]',a20_0x5e0794(0x157),'\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','',a20_0x5e0794(0x15b),a20_0x5e0794(0x173),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27',a20_0x5e0794(0x19f)][a20_0x5e0794(0x17a)]('\x0a')},{'command':a20_0x5e0794(0x17f),'operation':'getOne','risk':a20_0x5e0794(0x185),'paramsRequired':!![],'description':a20_0x5e0794(0x154),'paramsHint':a20_0x5e0794(0x18d)},{'command':a20_0x5e0794(0x184),'operation':a20_0x5e0794(0x184),'risk':a20_0x5e0794(0x164),'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_0x5e0794(0x18e),'operation':a20_0x5e0794(0x18e),'risk':a20_0x5e0794(0x164),'paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','paramsHint':'JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27'},{'command':a20_0x5e0794(0x1a0),'operation':a20_0x5e0794(0x1a0),'risk':a20_0x5e0794(0x164),'paramsRequired':!![],'description':'Update\x20an\x20existing\x20record','paramsHint':a20_0x5e0794(0x176)},{'command':a20_0x5e0794(0x19a),'operation':'delete','risk':a20_0x5e0794(0x19e),'paramsRequired':!![],'description':a20_0x5e0794(0x17b),'paramsHint':a20_0x5e0794(0x18d)},{'command':a20_0x5e0794(0x16f),'operation':'aggregate','risk':a20_0x5e0794(0x185),'paramsRequired':![],'description':'Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','paramsHint':'JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20'+'Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','helpExtra':[a20_0x5e0794(0x161),a20_0x5e0794(0x18c),'\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_0x5e0794(0x18a),a20_0x5e0794(0x15e),a20_0x5e0794(0x177),a20_0x5e0794(0x15a),a20_0x5e0794(0x159),'',a20_0x5e0794(0x193),a20_0x5e0794(0x186),a20_0x5e0794(0x15c),a20_0x5e0794(0x16b),a20_0x5e0794(0x158),a20_0x5e0794(0x188),a20_0x5e0794(0x165),'',a20_0x5e0794(0x1a2),a20_0x5e0794(0x16c),a20_0x5e0794(0x19d),'',a20_0x5e0794(0x181),'\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_0x5e0794(0x15d)][a20_0x5e0794(0x17a)]('\x0a')}];function makeDataCommand(_0x326854){const _0x35dc1f=a20_0x5e0794,_0x422fc7=_0x35dc1f(0x18f)+_0x326854['command'],_0xee9f0a={'service':'data','command':_0x326854[_0x35dc1f(0x163)],'description':_0x326854[_0x35dc1f(0x196)],'risk':_0x326854[_0x35dc1f(0x17c)],'helpExtra':_0x326854[_0x35dc1f(0x15f)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x326854[_0x35dc1f(0x183)]}],'validate':async _0x172b92=>{const _0x325066=_0x35dc1f;_0x326854[_0x325066(0x160)]&&requireAnyOf(_0x172b92,[_0x325066(0x18b)],_0x422fc7),_0x326854[_0x325066(0x197)]===_0x325066(0x18e)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x172b92['str'](_0x325066(0x18b))));},async 'execute'(_0x16510d){const _0x2216b2=_0x35dc1f,_0x4c0996=_0x16510d['str'](_0x2216b2(0x191)),_0x4de7ff=_0x326854[_0x2216b2(0x197)]===_0x2216b2(0x18e)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x16510d['str'](_0x2216b2(0x18b)))):parseJsonParams(_0x16510d[_0x2216b2(0x17d)](_0x2216b2(0x18b)))??{},_0x30bf98=Date[_0x2216b2(0x156)](),_0x45261f=await executeData(_0x4c0996,_0x326854[_0x2216b2(0x197)],_0x4de7ff),_0x1f3a96=Date['now']()-_0x30bf98;return{'ok':!![],'data':{'result':_0x45261f,'elapsed':_0x1f3a96},'message':_0x2216b2(0x18f)+_0x326854[_0x2216b2(0x163)]+_0x2216b2(0x180)+_0x1f3a96+'ms'};}};return _0x326854['risk']!=='read'&&(_0xee9f0a[_0x35dc1f(0x179)]=async _0x39af6d=>{const _0x29f785=_0x35dc1f,_0xbc581d=_0x39af6d[_0x29f785(0x17d)](_0x29f785(0x191)),_0x2e4058=_0x326854[_0x29f785(0x197)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x39af6d[_0x29f785(0x17d)](_0x29f785(0x18b)))):parseJsonParams(_0x39af6d[_0x29f785(0x17d)](_0x29f785(0x18b)))??{};return dryRun(_0x29f785(0x198),_0x29f785(0x170)+_0xbc581d+'/'+_0x326854[_0x29f785(0x197)])[_0x29f785(0x174)](_0x2e4058)[_0x29f785(0x196)](_0x29f785(0x166)+_0x326854[_0x29f785(0x163)]+'\x20on\x20dataset\x20'+_0xbc581d)[_0x29f785(0x169)]();}),_0xee9f0a;}export const dataDefinitions=specs['map'](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a21_0xc1d4(_0x158303,_0x12521d){_0x158303=_0x158303-0xd2;const _0x11f268=a21_0x11f2();let _0xc1d4d3=_0x11f268[_0x158303];return _0xc1d4d3;}const a21_0x58d4bf=a21_0xc1d4;function a21_0x11f2(){const _0x56f284=['find','split','fromField','dataType','options','name','toDatasetCode','3yfXYnT','creatorIdField','trim','dblinkInfoDTO','4034946aCqNQc','push','required','requestFields','responseFields','code','allFields','4360310vczLSn','createTimeField','str','relations','columnCodeListWithDeleted','doType','indexes','2104QeaxKa','afterScriptId','validateRules','responseBody','dbtableConfig','detail','type','dbType','doVersion','dbName','modelCode','formatRules','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','673bswqZH','dataset','properties','sourceType','allFieldNames','source','9918iEvtOM','operations','length','extend','requestBody','tableName','4366HyOpwE','dbId','1539500xkzzDA','isArray','110LhdgVR','host','250zcFYXM','parse','string','displayName','updateTimeField','tableComment','map','toField','datasetKey','description','beforeScriptId','326496iaEhOq','read','relatedPageInfoList','title','38094wBqNnK','pkField','method','toDatasetName','logicField','filter'];a21_0x11f2=function(){return _0x56f284;};return a21_0x11f2();}(function(_0x2ea10e,_0x10f0d3){const _0x14c080=a21_0xc1d4,_0x4f8355=_0x2ea10e();while(!![]){try{const _0x3dece0=-parseInt(_0x14c080(0x113))/0x1*(parseInt(_0x14c080(0xd2))/0x2)+-parseInt(_0x14c080(0xf4))/0x3*(parseInt(_0x14c080(0xd4))/0x4)+parseInt(_0x14c080(0xff))/0x5+parseInt(_0x14c080(0xf8))/0x6+parseInt(_0x14c080(0xe7))/0x7*(parseInt(_0x14c080(0x106))/0x8)+parseInt(_0x14c080(0x119))/0x9*(parseInt(_0x14c080(0xd8))/0xa)+-parseInt(_0x14c080(0xd6))/0xb*(parseInt(_0x14c080(0xe3))/0xc);if(_0x3dece0===_0x10f0d3)break;else _0x4f8355['push'](_0x4f8355['shift']());}catch(_0x29db72){_0x4f8355['push'](_0x4f8355['shift']());}}}(a21_0x11f2,0xd62b3));import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x2acb59){const _0x127195=a21_0xc1d4;if(_0x2acb59['deleted'])return null;const _0x292990=Boolean(_0x2acb59[_0x127195(0xdb)]!==undefined||_0x2acb59[_0x127195(0x104)]!==undefined);let _0xd53da={};if(!_0x292990&&typeof _0x2acb59[_0x127195(0x11c)]===_0x127195(0xda))try{_0xd53da=JSON[_0x127195(0xd9)](_0x2acb59['extend']);}catch{}const _0x4825c2=_0x292990?_0x2acb59['name']:_0x2acb59[_0x127195(0xfd)],_0x895500=_0x292990?_0x2acb59[_0x127195(0xdb)]:_0x2acb59['name'],_0x54c4f9=_0x292990?_0x2acb59[_0x127195(0x104)]:_0x2acb59[_0x127195(0x10c)]||_0x2acb59[_0x127195(0xf0)],_0x8191b8=_0x292990?_0x2acb59[_0x127195(0xe8)]===!![]:_0xd53da['pkField']===!![],_0x311d0e=_0x292990?_0x2acb59[_0x127195(0xfa)]===!![]:_0xd53da['required']===!![],_0x48f27d=_0x292990?_0x2acb59[_0x127195(0xf1)]??null:_0xd53da[_0x127195(0xf1)]??null,_0x55e78a={'name':_0x4825c2,'displayName':_0x895500||_0x4825c2,'type':_0x54c4f9,'dbType':_0x2acb59[_0x127195(0x10d)],'pk':_0x8191b8,'required':_0x311d0e,'description':_0x2acb59[_0x127195(0xe1)]||undefined};return Array['isArray'](_0x48f27d)&&_0x48f27d[_0x127195(0x11b)]>0x0&&(_0x55e78a['options']=_0x48f27d),_0x55e78a;}function parseJsonMaybe(_0x55d64f){const _0x131a84=a21_0xc1d4;if(typeof _0x55d64f!==_0x131a84(0xda))return _0x55d64f;try{return JSON['parse'](_0x55d64f);}catch{return _0x55d64f;}}function normalizeOperationEntry(_0xca9886,_0x20aa00){const _0x1f66d5=a21_0xc1d4;if(!_0x20aa00||typeof _0x20aa00!=='object')return null;if(!_0x20aa00[_0x1f66d5(0xe9)]||!_0x20aa00['path'])return null;const _0x1002b2={'name':_0xca9886,'method':_0x20aa00['method'],'path':_0x20aa00['path']};if(_0x20aa00['host'])_0x1002b2[_0x1f66d5(0xd7)]=_0x20aa00[_0x1f66d5(0xd7)];if(_0x20aa00['requestBody']!=null)_0x1002b2['requestBody']=parseJsonMaybe(_0x20aa00[_0x1f66d5(0x11d)]);if(_0x20aa00[_0x1f66d5(0x109)]!=null)_0x1002b2['responseBody']=parseJsonMaybe(_0x20aa00['responseBody']);if(_0x20aa00['beforeScriptId']!=null)_0x1002b2[_0x1f66d5(0xe2)]=_0x20aa00['beforeScriptId'];if(_0x20aa00[_0x1f66d5(0x107)]!=null)_0x1002b2[_0x1f66d5(0x107)]=_0x20aa00[_0x1f66d5(0x107)];if(Array[_0x1f66d5(0xd5)](_0x20aa00[_0x1f66d5(0xfb)]))_0x1002b2['requestFields']=_0x20aa00[_0x1f66d5(0xfb)];if(Array[_0x1f66d5(0xd5)](_0x20aa00['responseFields']))_0x1002b2[_0x1f66d5(0xfc)]=_0x20aa00['responseFields'];return _0x1002b2;}function summarizeDbtable(_0x562aa8){const _0x22f39e=a21_0xc1d4,_0x3a9280={},_0xf8b97f=[_0x22f39e(0xd3),_0x22f39e(0x10f),'tableName',_0x22f39e(0xe0),_0x22f39e(0xe8),_0x22f39e(0xfe),_0x22f39e(0xeb),_0x22f39e(0x100),_0x22f39e(0xdc),_0x22f39e(0xf5),'creatorNameField','modifierIdField','modifierNameField','labelField',_0x22f39e(0xf7)];for(const _0x35eb17 of _0xf8b97f){if(_0x562aa8[_0x35eb17]!==undefined)_0x3a9280[_0x35eb17]=_0x562aa8[_0x35eb17];}return typeof _0x3a9280[_0x22f39e(0xfe)]==='string'&&_0x3a9280['allFields'][_0x22f39e(0x11b)]>0x0&&(_0x3a9280[_0x22f39e(0x117)]=_0x3a9280[_0x22f39e(0xfe)][_0x22f39e(0xee)](',')['map'](_0x3a7aab=>_0x3a7aab['trim']())[_0x22f39e(0xec)](Boolean)),_0x3a9280;}function normalizeRelatedPages(_0x2b3c43){const _0x2dbb46=a21_0xc1d4;if(!Array[_0x2dbb46(0xd5)](_0x2b3c43))return[];return _0x2b3c43[_0x2dbb46(0xec)](_0x308b34=>_0x308b34&&typeof _0x308b34==='object')[_0x2dbb46(0xde)](_0x5005b8=>({'id':_0x5005b8['id'],'type':_0x5005b8[_0x2dbb46(0x10c)],'code':_0x5005b8[_0x2dbb46(0xfd)],'title':_0x5005b8[_0x2dbb46(0xe6)],'deleted':_0x5005b8['deleted']===!![]}));}function normalizeFallbackFieldName(_0xcbf4eb,_0x55a075){const _0x59be35=a21_0xc1d4,_0x20ebc5=_0xcbf4eb[_0x59be35(0xf6)]();if(!_0x20ebc5)return null;return{'name':_0x20ebc5,'displayName':_0x20ebc5,'type':undefined,'dbType':undefined,'pk':_0x20ebc5===_0x55a075,'required':![],'description':undefined};}async function loadListFieldFallback(_0x29e404,_0x1d25a2){const _0x3db2bc=a21_0xc1d4;if(!_0x29e404||!_0x1d25a2)return[];try{const _0x57f1b2=await listDatasets(_0x29e404,{'code':_0x1d25a2}),_0x24c451=_0x57f1b2[_0x3db2bc(0xed)](_0x23265d=>_0x23265d['code']===_0x1d25a2)??_0x57f1b2[0x0],_0x67dde=_0x24c451?.['dbtableConfig']??{},_0x202255=typeof _0x67dde['allFields']===_0x3db2bc(0xda)?_0x67dde[_0x3db2bc(0xfe)]['split'](','):[];return _0x202255['map'](_0x34becf=>normalizeFallbackFieldName(_0x34becf,_0x67dde['pkField']))['filter'](_0x59ea26=>_0x59ea26!==null);}catch{return[];}}export const datasetDetail={'service':a21_0x58d4bf(0x114),'command':a21_0x58d4bf(0x10b),'description':a21_0x58d4bf(0x112),'risk':a21_0x58d4bf(0xe4),'flags':[CODE_FLAG],async 'execute'(_0x6721ae){const _0x5c3011=a21_0x58d4bf,_0x86a31c=await getDatasetDetail(_0x6721ae[_0x5c3011(0x101)](_0x5c3011(0xfd))),_0x3d784f=Array[_0x5c3011(0xd5)](_0x86a31c['fields'])?_0x86a31c['fields']:Array['isArray'](_0x86a31c[_0x5c3011(0x115)])?_0x86a31c[_0x5c3011(0x115)]:[];let _0x1ed076=_0x3d784f['map'](_0x100225=>normalizeField(_0x100225))[_0x5c3011(0xec)](_0x1fe122=>_0x1fe122!==null);_0x1ed076[_0x5c3011(0x11b)]===0x0&&(_0x1ed076=await loadListFieldFallback(_0x6721ae['appCode'],_0x6721ae[_0x5c3011(0x101)]('code')));const _0x1ef413=_0x86a31c[_0x5c3011(0x11a)]??{},_0x5a7ca9=[];for(const [_0x5e4061,_0x4f56b5]of Object['entries'](_0x1ef413)){const _0xaa0a2=normalizeOperationEntry(_0x5e4061,_0x4f56b5);if(_0xaa0a2)_0x5a7ca9[_0x5c3011(0xf9)](_0xaa0a2);}const _0x1211d9=_0x86a31c[_0x5c3011(0x10a)]??{},_0x55c792=_0x86a31c['dataset']??{},_0x4f042f=_0x1211d9[_0x5c3011(0xd3)]!=null?{'id':_0x1211d9[_0x5c3011(0xd3)],'name':_0x1211d9[_0x5c3011(0x10f)]??null}:undefined;let _0x19b0e0;return typeof _0x86a31c[_0x5c3011(0x11c)]===_0x5c3011(0xda)&&(_0x19b0e0=parseJsonMaybe(_0x86a31c[_0x5c3011(0x11c)])),{'ok':!![],'data':{'id':_0x86a31c['modelId']??_0x86a31c['id'],'name':_0x86a31c[_0x5c3011(0xf2)],'code':_0x86a31c[_0x5c3011(0x110)]||_0x86a31c[_0x5c3011(0xfd)],'doVersion':_0x86a31c[_0x5c3011(0x10e)],'description':_0x86a31c[_0x5c3011(0xe1)]||_0x55c792[_0x5c3011(0xdd)]||undefined,'source':_0x86a31c[_0x5c3011(0x118)]||_0x55c792[_0x5c3011(0x116)],'table':_0x1211d9['tableName']||_0x55c792[_0x5c3011(0x11e)],'datasetKey':_0x1211d9[_0x5c3011(0xe0)],'pk':_0x1211d9[_0x5c3011(0xe8)],'db':_0x4f042f,'dbtable':summarizeDbtable(_0x1211d9),'fields':_0x1ed076,'operations':_0x5a7ca9,'indexes':Array[_0x5c3011(0xd5)](_0x55c792[_0x5c3011(0x105)])?_0x55c792[_0x5c3011(0x105)]:[],'relations':Array[_0x5c3011(0xd5)](_0x86a31c[_0x5c3011(0x102)])?_0x86a31c['relations'][_0x5c3011(0xde)](_0x30bfbf=>({'fromField':_0x30bfbf[_0x5c3011(0xef)],'toDataset':_0x30bfbf[_0x5c3011(0xea)],'toCode':_0x30bfbf[_0x5c3011(0xf3)],'toTable':_0x30bfbf['toTableName'],'toField':_0x30bfbf[_0x5c3011(0xdf)],'labelField':_0x30bfbf['toFieldLabel']||undefined})):[],'relatedPages':normalizeRelatedPages(_0x86a31c[_0x5c3011(0xe5)]),...Array[_0x5c3011(0xd5)](_0x86a31c['columnCodeListWithDeleted'])?{'columnCodeListWithDeleted':_0x86a31c[_0x5c3011(0x103)]}:{},'formatRules':Array[_0x5c3011(0xd5)](_0x86a31c[_0x5c3011(0x111)])?_0x86a31c[_0x5c3011(0x111)]:[],'validateRules':Array[_0x5c3011(0xd5)](_0x86a31c[_0x5c3011(0x108)])?_0x86a31c[_0x5c3011(0x108)]:[],..._0x19b0e0!==undefined?{'extend':_0x19b0e0}:{},'stats':{'fieldCount':_0x1ed076[_0x5c3011(0x11b)],'operationCount':_0x5a7ca9[_0x5c3011(0x11b)]}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x10a551,_0x327255){const _0x314f36=a22_0x490d,_0x5286b2=_0x10a551();while(!![]){try{const _0x1b48ad=-parseInt(_0x314f36(0x9d))/0x1*(parseInt(_0x314f36(0x95))/0x2)+-parseInt(_0x314f36(0x99))/0x3*(parseInt(_0x314f36(0x96))/0x4)+-parseInt(_0x314f36(0x98))/0x5+parseInt(_0x314f36(0x94))/0x6*(parseInt(_0x314f36(0x9a))/0x7)+parseInt(_0x314f36(0x97))/0x8+-parseInt(_0x314f36(0x93))/0x9+-parseInt(_0x314f36(0x9b))/0xa*(-parseInt(_0x314f36(0x9c))/0xb);if(_0x1b48ad===_0x327255)break;else _0x5286b2['push'](_0x5286b2['shift']());}catch(_0x2b8620){_0x5286b2['push'](_0x5286b2['shift']());}}}(a22_0x1615,0x4802c));function a22_0x1615(){const _0x1ed556=['906fTIFEb','4ruiHWb','4YAttSg','2014024IqVfUY','1690810CWXxKo','353787pHTVHd','13853UqgIgA','10ENAAHU','9112708YAAEkA','148543frCCqH','2977893OQXvjv'];a22_0x1615=function(){return _0x1ed556;};return a22_0x1615();}import{datasetList}from'../../commands/dataset/list.js';import{datasetDetail}from'../../commands/dataset/detail.js';function a22_0x490d(_0x21db35,_0x3465a3){_0x21db35=_0x21db35-0x93;const _0x161534=a22_0x1615();let _0x490dae=_0x161534[_0x21db35];return _0x490dae;}import{datasetSdkDoc}from'../../commands/dataset/sdk-doc.js';export const datasetDefinitions=[datasetList,datasetDetail,datasetSdkDoc];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a23_0x5347(){const _0x369482=['datasetKey','split','pkField','description','77ZnMCFd','str','794893omClAy','5017880dUNpTx','source','tableName','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','map','allFields','read','2lcjTHY','25680864meTbZs','3327228jIijxZ','name','string','dbtableConfig','dataset','code','11148066eDPzkG','565782ZfxBki','trim','8oRUQSl','1118416kAcIDC','list','25wYYjco'];a23_0x5347=function(){return _0x369482;};return a23_0x5347();}const a23_0x922c4d=a23_0x2792;(function(_0x59c27e,_0x236104){const _0x18e952=a23_0x2792,_0x1bfb0d=_0x59c27e();while(!![]){try{const _0x3cbf22=-parseInt(_0x18e952(0x12e))/0x1*(parseInt(_0x18e952(0x136))/0x2)+-parseInt(_0x18e952(0x138))/0x3+parseInt(_0x18e952(0x142))/0x4*(-parseInt(_0x18e952(0x144))/0x5)+-parseInt(_0x18e952(0x13f))/0x6*(-parseInt(_0x18e952(0x12c))/0x7)+-parseInt(_0x18e952(0x141))/0x8*(-parseInt(_0x18e952(0x13e))/0x9)+-parseInt(_0x18e952(0x12f))/0xa+parseInt(_0x18e952(0x137))/0xb;if(_0x3cbf22===_0x236104)break;else _0x1bfb0d['push'](_0x1bfb0d['shift']());}catch(_0x11702f){_0x1bfb0d['push'](_0x1bfb0d['shift']());}}}(a23_0x5347,0xc4f84));import{listDatasets}from'../../core/api-client.js';function a23_0x2792(_0x20e0d8,_0x40fda9){_0x20e0d8=_0x20e0d8-0x12a;const _0x534747=a23_0x5347();let _0x27925e=_0x534747[_0x20e0d8];return _0x27925e;}import{CODE_FLAG}from'../../commands/common/flags.js';export const datasetList={'service':a23_0x922c4d(0x13c),'command':a23_0x922c4d(0x143),'description':'List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','risk':a23_0x922c4d(0x135),'flags':[{'name':a23_0x922c4d(0x139),'type':a23_0x922c4d(0x13a),'description':'Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)'},{...CODE_FLAG,'required':![],'description':a23_0x922c4d(0x132)}],async 'execute'(_0x1a40b1){const _0x32dc2a=a23_0x922c4d,_0x449e4b=_0x1a40b1[_0x32dc2a(0x12d)]('name'),_0x4bea58=_0x1a40b1['str'](_0x32dc2a(0x13d)),_0x190e13=await listDatasets(_0x1a40b1['appCode'],{..._0x449e4b&&{'name':_0x449e4b},..._0x4bea58&&{'code':_0x4bea58}});return{'ok':!![],'data':{'total':_0x190e13['length'],'datasets':_0x190e13[_0x32dc2a(0x133)](_0x5d75f5=>{const _0x42c6fd=_0x32dc2a,_0x36f250=_0x5d75f5[_0x42c6fd(0x13b)]??{};return{'id':_0x5d75f5['id'],'code':_0x5d75f5['code'],'name':_0x5d75f5[_0x42c6fd(0x139)],'source':_0x5d75f5[_0x42c6fd(0x130)],'description':_0x5d75f5[_0x42c6fd(0x12b)],'table':_0x36f250[_0x42c6fd(0x131)],'datasetKey':_0x36f250[_0x42c6fd(0x145)],'pk':_0x36f250[_0x42c6fd(0x12a)],'fields':_0x36f250[_0x42c6fd(0x134)]?_0x36f250[_0x42c6fd(0x134)][_0x42c6fd(0x146)](',')['map'](_0x5c12cd=>_0x5c12cd[_0x42c6fd(0x140)]()):[]};})}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a24_0x51ad(_0x431a9d,_0x143169){_0x431a9d=_0x431a9d-0xa7;const _0x3a03bb=a24_0x3a03();let _0x51adc2=_0x3a03bb[_0x431a9d];return _0x51adc2;}const a24_0x54a599=a24_0x51ad;function a24_0x3a03(){const _0x45b07e=['26987248SYrhDw','read','3902148QVShYl','1034257SVCKjw','5QfBJQn','Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','appCode','#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档','2114212pZWwyS','4841802OwTAMA','4489476BQaQOH','Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','str','trim','1272274fnettB','string','sdk-doc'];a24_0x3a03=function(){return _0x45b07e;};return a24_0x3a03();}(function(_0x54f593,_0x211dc4){const _0x1469ee=a24_0x51ad,_0x515139=_0x54f593();while(!![]){try{const _0x27c7b7=-parseInt(_0x1469ee(0xad))/0x1+-parseInt(_0x1469ee(0xa7))/0x2+-parseInt(_0x1469ee(0xb4))/0x3+-parseInt(_0x1469ee(0xb2))/0x4*(-parseInt(_0x1469ee(0xae))/0x5)+-parseInt(_0x1469ee(0xac))/0x6+parseInt(_0x1469ee(0xb3))/0x7+parseInt(_0x1469ee(0xaa))/0x8;if(_0x27c7b7===_0x211dc4)break;else _0x515139['push'](_0x515139['shift']());}catch(_0x186ed8){_0x515139['push'](_0x515139['shift']());}}}(a24_0x3a03,0xbd8d1));import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';const DEFAULT_MARKDOWN=a24_0x54a599(0xb1);export function formatDatasetSdkMarkdown(_0x3ca9f3){const _0x46dd4f=a24_0x54a599,_0x391ec4=typeof _0x3ca9f3===_0x46dd4f(0xa8)?_0x3ca9f3[_0x46dd4f(0xb7)]():'';return _0x391ec4||DEFAULT_MARKDOWN;}export const datasetSdkDoc={'service':'dataset','command':a24_0x54a599(0xa9),'description':a24_0x54a599(0xaf),'risk':a24_0x54a599(0xab),'flags':[{...CODE_FLAG,'description':a24_0x54a599(0xb5)}],async 'execute'(_0x4220a3){const _0x3d3607=a24_0x54a599,_0x3d7733=_0x4220a3[_0x3d3607(0xb6)]('code'),_0x5b029d=await getDatasetSdkUsageDoc(_0x3d7733,_0x4220a3[_0x3d3607(0xb0)]);return{'ok':!![],'data':{'code':_0x3d7733,'appCode':_0x4220a3['appCode'],'markdown':formatDatasetSdkMarkdown(_0x5b029d)}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x334e92=a25_0x1b8b;(function(_0x20260d,_0x20089d){const _0x394b5b=a25_0x1b8b,_0x39324a=_0x20260d();while(!![]){try{const _0x444af5=parseInt(_0x394b5b(0x91))/0x1*(parseInt(_0x394b5b(0xd8))/0x2)+parseInt(_0x394b5b(0xcc))/0x3+-parseInt(_0x394b5b(0xd2))/0x4*(parseInt(_0x394b5b(0xd7))/0x5)+-parseInt(_0x394b5b(0x88))/0x6+parseInt(_0x394b5b(0xa9))/0x7*(-parseInt(_0x394b5b(0xbe))/0x8)+-parseInt(_0x394b5b(0x9b))/0x9*(-parseInt(_0x394b5b(0xdb))/0xa)+parseInt(_0x394b5b(0xad))/0xb;if(_0x444af5===_0x20089d)break;else _0x39324a['push'](_0x39324a['shift']());}catch(_0x475f33){_0x39324a['push'](_0x39324a['shift']());}}}(a25_0x564d,0x54789));import a25_0x5e38b8 from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';function a25_0x564d(){const _0x54e99d=['\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','2069MCypTz','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','Project','⚠\x20Empty','⚠\x20Empty\x20(treated\x20as\x20{})','length','(default:\x20','(unnamed)','bold','(missing)','27VWMBma','\x20Imported\x20from:\x20','✓\x20Loaded','\x20\x20Service\x20Tree','gray','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20commands)','Global','(not\x20set)','path','pageSize','registryPath','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Auth','56kneNkm','\x20\x20Config\x20JSON','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','yellow','2674672TtJHWr','green','ClientAk','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','empty','format','name','✗\x20Invalid\x20JSON','commandCount','\x20\x20Session\x20check:\x20\x20\x20','\x20(accessKey)','source','padEnd','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Config\x20Files','555312NRdLXu','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','arch','message','env','(not\x20found)','\x20\x20Merged\x20Config','(default)','(none)','\x20doctor','log','services','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','1791810ptujhX','✗\x20Invalid','red','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20auth\x20(effective):\x20','Diagnose\x20CLI\x20configuration\x20and\x20environment','4XYaKEd','locale','(set,\x20length=','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','missing','747275kUFwzU','246xDRMjH','defaultApp','serviceCode','1344880mIIgZk','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','2685678wUKFpg','\x20\x20─','status','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','riskLevel','repeat','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','doctor'];a25_0x564d=function(){return _0x54e99d;};return a25_0x564d();}import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';import{inspectServiceRegistry}from'../commands/service/registry.js';function a25_0x1b8b(_0x429a04,_0x3e8911){_0x429a04=_0x429a04-0x88;const _0x564dde=a25_0x564d();let _0x1b8bb0=_0x564dde[_0x429a04];return _0x1b8bb0;}async function execute(_0x277e30){const _0x3d09c0=a25_0x1b8b,_0xd13922=getCliVersion(),_0x3054af=buildConfigFromFlags({});await initGlobalEnvironment(_0x3054af),console[_0x3d09c0(0xc9)](),console[_0x3d09c0(0xc9)](a25_0x5e38b8[_0x3d09c0(0x99)](CLI_BIN_NAME+_0x3d09c0(0xc8))),console[_0x3d09c0(0xc9)](a25_0x5e38b8['gray']('─'['repeat'](0x32))),console[_0x3d09c0(0xc9)](_0x3d09c0(0x8e)+_0xd13922),console[_0x3d09c0(0xc9)](_0x3d09c0(0xa0)+process['version']),console[_0x3d09c0(0xc9)](_0x3d09c0(0xab)+process['platform']+'\x20'+process[_0x3d09c0(0xc1)]),console[_0x3d09c0(0xc9)](),console[_0x3d09c0(0xc9)](a25_0x5e38b8[_0x3d09c0(0x99)](_0x3d09c0(0xbd))),console['log'](a25_0x5e38b8[_0x3d09c0(0x9f)]('\x20\x20─'[_0x3d09c0(0x8d)](0x1e)));const _0x1e7b8c=getGlobalConfigPath(),_0x2407fd=getProjectConfigPath();console['log'](_0x3d09c0(0xd5)+(_0x1e7b8c||a25_0x5e38b8[_0x3d09c0(0x9f)]('(not\x20found)'))),console[_0x3d09c0(0xc9)]('\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x2407fd||a25_0x5e38b8[_0x3d09c0(0x9f)](_0x3d09c0(0xc4)))),console[_0x3d09c0(0xc9)](),console[_0x3d09c0(0xc9)](a25_0x5e38b8[_0x3d09c0(0x99)](_0x3d09c0(0xaa))),console[_0x3d09c0(0xc9)](a25_0x5e38b8[_0x3d09c0(0x9f)]('\x20\x20─'[_0x3d09c0(0x8d)](0x1e)));const _0x149135=(_0x25deeb,_0x4cee19)=>{const _0x20eedb=_0x3d09c0;if(!_0x4cee19){console[_0x20eedb(0xc9)]('\x20\x20'+_0x25deeb[_0x20eedb(0xb9)](0x11)+'\x20'+a25_0x5e38b8['gray']('(no\x20file)'));return;}const _0x227b58=inspectCliConfigJsonFile(_0x4cee19);if(_0x227b58[_0x20eedb(0x8a)]==='ok')console['log']('\x20\x20'+_0x25deeb[_0x20eedb(0xb9)](0x11)+'\x20'+a25_0x5e38b8[_0x20eedb(0xae)]('✓\x20Valid\x20JSON'));else{if(_0x227b58[_0x20eedb(0x8a)]===_0x20eedb(0xb1))console[_0x20eedb(0xc9)]('\x20\x20'+_0x25deeb[_0x20eedb(0xb9)](0x11)+'\x20'+a25_0x5e38b8[_0x20eedb(0xac)](_0x20eedb(0x95)));else _0x227b58[_0x20eedb(0x8a)]===_0x20eedb(0xd6)?console[_0x20eedb(0xc9)]('\x20\x20'+_0x25deeb[_0x20eedb(0xb9)](0x11)+'\x20'+a25_0x5e38b8[_0x20eedb(0x9f)](_0x20eedb(0x9a))):(console[_0x20eedb(0xc9)]('\x20\x20'+_0x25deeb[_0x20eedb(0xb9)](0x11)+'\x20'+a25_0x5e38b8[_0x20eedb(0xce)](_0x20eedb(0xb4))),console[_0x20eedb(0xc9)]('\x20\x20'+''[_0x20eedb(0xb9)](0x11)+'\x20'+a25_0x5e38b8[_0x20eedb(0xce)](_0x227b58[_0x20eedb(0xc2)])));}};_0x149135(_0x3d09c0(0xa2),_0x1e7b8c),_0x149135(_0x3d09c0(0x93),_0x2407fd),console[_0x3d09c0(0xc9)](),console[_0x3d09c0(0xc9)](a25_0x5e38b8[_0x3d09c0(0x99)](_0x3d09c0(0xc5))),console[_0x3d09c0(0xc9)](a25_0x5e38b8[_0x3d09c0(0x9f)](_0x3d09c0(0x89)['repeat'](0x1e))),console[_0x3d09c0(0xc9)]('\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x3054af['appCode']||a25_0x5e38b8[_0x3d09c0(0xce)](_0x3d09c0(0xa3)))),console[_0x3d09c0(0xc9)](_0x3d09c0(0xbf)+_0x3054af[_0x3d09c0(0xc3)]);const _0x308a17=isLegacyCompatConfigKey(_0x3d09c0(0xd3))?a25_0x5e38b8[_0x3d09c0(0x9f)](_0x3054af[_0x3d09c0(0xd3)]+'\x20(legacy/compat\x20only)'):_0x3054af['locale'];console[_0x3d09c0(0xc9)](_0x3d09c0(0xa7)+_0x308a17),console['log'](_0x3d09c0(0xbb)+(_0x3054af[_0x3d09c0(0xd9)]||a25_0x5e38b8['gray']('(none)'))),console['log'](_0x3d09c0(0xcb)+(_0x3054af['currentApp']||a25_0x5e38b8[_0x3d09c0(0x9f)](_0x3d09c0(0xc7)))),console['log'](_0x3d09c0(0xcf)+(_0x3054af[_0x3d09c0(0xb2)]||a25_0x5e38b8[_0x3d09c0(0x9f)](_0x3d09c0(0x97)+DEFAULT_CONFIG_VALUES[_0x3d09c0(0xb2)]+')'))),console[_0x3d09c0(0xc9)](_0x3d09c0(0x92)+(_0x3054af[_0x3d09c0(0xa5)]??a25_0x5e38b8[_0x3d09c0(0x9f)](_0x3d09c0(0xc6)))),console[_0x3d09c0(0xc9)](_0x3d09c0(0x90)+_0x3054af[_0x3d09c0(0x8c)]),console['log']('\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x3054af['verbose']),console[_0x3d09c0(0xc9)](_0x3d09c0(0xd0)+AUTH_MODE[_0x3d09c0(0xaf)]),console['log'](_0x3d09c0(0xc0)+(_0x3054af['accessKey']?a25_0x5e38b8['green'](_0x3d09c0(0xd4)+_0x3054af['accessKey'][_0x3d09c0(0x96)]+')'):a25_0x5e38b8[_0x3d09c0(0x9f)](_0x3d09c0(0xc7)))),console[_0x3d09c0(0xc9)](),console['log'](a25_0x5e38b8[_0x3d09c0(0x99)]('\x20\x20API\x20Endpoints')),console[_0x3d09c0(0xc9)](a25_0x5e38b8[_0x3d09c0(0x9f)](_0x3d09c0(0x89)[_0x3d09c0(0x8d)](0x1e))),console['log']('\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20'+getApiDomain()),console[_0x3d09c0(0xc9)](_0x3d09c0(0xdc)+getUserDomain()),console[_0x3d09c0(0xc9)]('\x20\x20runtimeDomain:\x20\x20\x20'+getRuntimeDomain()),console['log'](),console[_0x3d09c0(0xc9)](a25_0x5e38b8[_0x3d09c0(0x99)](_0x3d09c0(0x9e))),console[_0x3d09c0(0xc9)](a25_0x5e38b8['gray'](_0x3d09c0(0x89)['repeat'](0x1e)));const _0x48135c=inspectServiceRegistry();console[_0x3d09c0(0xc9)](_0x3d09c0(0x8b)+_0x48135c[_0x3d09c0(0xa6)]),console[_0x3d09c0(0xc9)](_0x3d09c0(0xb0)+formatServiceRegistryStatus(_0x48135c)),console[_0x3d09c0(0xc9)](_0x3d09c0(0xbc)+_0x48135c['serviceCount']),console[_0x3d09c0(0xc9)]('\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20'+_0x48135c[_0x3d09c0(0xb5)]);for(const _0x293346 of _0x48135c[_0x3d09c0(0xca)]){console[_0x3d09c0(0xc9)]('\x20\x20'+(_0x293346[_0x3d09c0(0xda)]+':')[_0x3d09c0(0xb9)](0x11)+'\x20'+(_0x293346[_0x3d09c0(0xb3)]||a25_0x5e38b8[_0x3d09c0(0x9f)](_0x3d09c0(0x98)))+'\x20('+_0x293346[_0x3d09c0(0xb5)]+_0x3d09c0(0xa1)),console[_0x3d09c0(0xc9)]('\x20\x20'+''[_0x3d09c0(0xb9)](0x11)+_0x3d09c0(0x9c)+_0x293346[_0x3d09c0(0xb8)][_0x3d09c0(0xa4)]);}return console[_0x3d09c0(0xc9)](),console['log'](a25_0x5e38b8[_0x3d09c0(0x99)](_0x3d09c0(0xa8))),console['log'](a25_0x5e38b8['gray'](_0x3d09c0(0x89)[_0x3d09c0(0x8d)](0x1e))),console['log'](_0x3d09c0(0xba)+a25_0x5e38b8['green'](AUTH_MODE[_0x3d09c0(0xaf)]+_0x3d09c0(0xb7))),console[_0x3d09c0(0xc9)](_0x3d09c0(0xb6)+a25_0x5e38b8[_0x3d09c0(0x9f)]('(removed\x20—\x20cookie\x20auth\x20disabled)')),console[_0x3d09c0(0xc9)](),{'ok':!![]};}function formatServiceRegistryStatus(_0x46864f){const _0xea4ad8=a25_0x1b8b;if(_0x46864f['status']==='ok')return a25_0x5e38b8[_0xea4ad8(0xae)](_0xea4ad8(0x9d));if(_0x46864f[_0xea4ad8(0x8a)]===_0xea4ad8(0xd6))return a25_0x5e38b8[_0xea4ad8(0x9f)]('(not\x20found)');if(_0x46864f[_0xea4ad8(0x8a)]===_0xea4ad8(0xb1))return a25_0x5e38b8['yellow'](_0xea4ad8(0x94));return a25_0x5e38b8[_0xea4ad8(0xce)](_0xea4ad8(0xcd)+(_0x46864f[_0xea4ad8(0xc2)]?':\x20'+_0x46864f[_0xea4ad8(0xc2)]:''));}export const doctorDefinition={'service':a25_0x334e92(0x8f),'command':'check','description':a25_0x334e92(0xd1),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x4ab39d=a26_0x58e0;(function(_0x2a4132,_0x3bf57b){const _0x461c75=a26_0x58e0,_0x81a0cb=_0x2a4132();while(!![]){try{const _0x7f266e=parseInt(_0x461c75(0x1a0))/0x1*(-parseInt(_0x461c75(0x1cc))/0x2)+-parseInt(_0x461c75(0x188))/0x3*(parseInt(_0x461c75(0x187))/0x4)+-parseInt(_0x461c75(0x18d))/0x5+-parseInt(_0x461c75(0x1c7))/0x6*(parseInt(_0x461c75(0x1a3))/0x7)+-parseInt(_0x461c75(0x191))/0x8*(parseInt(_0x461c75(0x1ca))/0x9)+-parseInt(_0x461c75(0x190))/0xa+-parseInt(_0x461c75(0x1a6))/0xb*(-parseInt(_0x461c75(0x1ac))/0xc);if(_0x7f266e===_0x3bf57b)break;else _0x81a0cb['push'](_0x81a0cb['shift']());}catch(_0x1bd28b){_0x81a0cb['push'](_0x81a0cb['shift']());}}}(a26_0x3865,0xcea7c));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a26_0x4ab39d(0x1a8),'type':a26_0x4ab39d(0x1be),'description':a26_0x4ab39d(0x199)},{'name':a26_0x4ab39d(0x18e),'type':a26_0x4ab39d(0x1be),'description':a26_0x4ab39d(0x19d)+DEFAULT_CONFIG_VALUES['env']+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x4ab39d(0x1b0),'type':a26_0x4ab39d(0x194),'description':a26_0x4ab39d(0x1a2)+PRODUCT_CONFIG[a26_0x4ab39d(0x184)]+a26_0x4ab39d(0x1ba),'default':![]},{'name':a26_0x4ab39d(0x195),'type':a26_0x4ab39d(0x194),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':a26_0x4ab39d(0x18c),'type':'string','description':a26_0x4ab39d(0x1c8),'required':!![]},{'name':a26_0x4ab39d(0x1a8),'type':a26_0x4ab39d(0x1be),'description':'Override\x20imported\x20default\x20appcode'},{'name':a26_0x4ab39d(0x18e),'type':'string','description':a26_0x4ab39d(0x189),'enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':'boolean','description':a26_0x4ab39d(0x1a2)+PRODUCT_CONFIG[a26_0x4ab39d(0x184)]+a26_0x4ab39d(0x1ba),'default':![]},{'name':'yes','type':a26_0x4ab39d(0x194),'description':a26_0x4ab39d(0x1a4),'default':![]}];export async function runInit(_0x3d8c70){const _0x4804eb=a26_0x4ab39d,_0x444dff=isNonInteractiveMode(_0x3d8c70),_0x438fa0=_0x3d8c70['global']?_0x4804eb(0x1b0):_0x4804eb(0x1b9),_0x18bf01=resolveWriteConfigPath(_0x438fa0);try{_0x444dff?await runNonInteractive(_0x3d8c70,_0x18bf01):await runInteractive(_0x3d8c70,_0x18bf01);}catch(_0x2a5d17){if(_0x2a5d17 instanceof AbortPrompt)throw CliErrors[_0x4804eb(0x181)]();throw _0x2a5d17;}}export async function runInitImport(_0x12ed09){const _0x18ea78=a26_0x4ab39d,_0x5a343d=_0x12ed09[_0x18ea78(0x1b0)]?'global':'project',_0x408391=resolveWriteConfigPath(_0x5a343d);await runFromImport(_0x12ed09,_0x408391);}const RUNTIME_IRRELEVANT_KEYS=new Set([a26_0x4ab39d(0x1af)]);async function runFromImport(_0x569530,_0x2fe64c){const _0x36723c=a26_0x4ab39d,_0x38e12a=resolveFilePath(_0x569530['file']);if(!existsSync(_0x38e12a))throw CliErrors[_0x36723c(0x197)](_0x36723c(0x1bf)+_0x38e12a);const _0x2bd3f5=readSourceFile(_0x38e12a),_0x15fbbd=convertToRuntimeConfig(_0x2bd3f5);_0x569530[_0x36723c(0x1a8)]&&(_0x15fbbd[_0x36723c(0x1a8)]=String(_0x569530['appcode']));_0x569530[_0x36723c(0x18e)]&&(_0x15fbbd[_0x36723c(0x18e)]=resolveInitEnv(_0x569530));if(!_0x15fbbd[_0x36723c(0x1a8)])throw CliErrors[_0x36723c(0x197)](_0x36723c(0x1b7),_0x36723c(0x1bb));await writeInitConfig(_0x2fe64c,_0x15fbbd,_0x569530),console['log'](_0x36723c(0x1cb)+_0x38e12a),console[_0x36723c(0x1b1)](_0x36723c(0x192)+_0x2fe64c),console[_0x36723c(0x1b1)]('\x20\x20appcode:\x20'+_0x15fbbd['appcode']);if(_0x15fbbd['defaultApp'])console['log'](_0x36723c(0x1b6)+_0x15fbbd[_0x36723c(0x185)]);}function convertToRuntimeConfig(_0xb687b2){const _0x1df42c=a26_0x4ab39d;if(_0xb687b2[_0x1df42c(0x1ad)]&&typeof _0xb687b2[_0x1df42c(0x1ad)]===_0x1df42c(0x193))throw CliErrors[_0x1df42c(0x197)](_0x1df42c(0x186),_0x1df42c(0x1b8));const _0x532e49={};for(const _0x2f07f6 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0xb687b2[_0x2f07f6]!==undefined&&(_0x532e49[_0x2f07f6]=_0xb687b2[_0x2f07f6]);}return!_0x532e49[_0x1df42c(0x1aa)]&&(_0x532e49['riskLevel']=DEFAULT_CONFIG_VALUES[_0x1df42c(0x1aa)]),_0x532e49;}async function runNonInteractive(_0x4e9e12,_0x5efe5a){const _0x5c1b95=a26_0x4ab39d,_0x4dcfb3=_0x4e9e12[_0x5c1b95(0x1a8)];if(!_0x4dcfb3)throw CliErrors[_0x5c1b95(0x19b)](_0x5c1b95(0x1a8),_0x5c1b95(0x183)+CLI_BIN_NAME+_0x5c1b95(0x1b5));const _0x4bcf43=resolveInitEnv(_0x4e9e12);await writeInitConfig(_0x5efe5a,{'appcode':_0x4dcfb3,'env':_0x4bcf43},_0x4e9e12),console[_0x5c1b95(0x1b1)](_0x5c1b95(0x1c5)+_0x5efe5a),console[_0x5c1b95(0x1b1)](_0x5c1b95(0x1a1)+_0x4dcfb3),console[_0x5c1b95(0x1b1)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x4bcf43);}async function runInteractive(_0x40fec3,_0x4aed2d){const _0xf24e66=a26_0x4ab39d,_0x2dfe64=loadExisting(_0x4aed2d),_0x18e5c4=typeof _0x2dfe64?.[_0xf24e66(0x1a8)]===_0xf24e66(0x1be)?_0x2dfe64[_0xf24e66(0x1a8)]:'',_0x15e089=resolveInitEnv(_0x40fec3);console['log'](CLI_BIN_NAME+_0xf24e66(0x1ae)+PRODUCT_CONFIG[_0xf24e66(0x184)]+'\x0a');if(existsSync(_0x4aed2d)&&!_0x40fec3[_0xf24e66(0x195)]){const _0xbf0446=await promptYesNo(_0xf24e66(0x1a5)+_0x4aed2d+_0xf24e66(0x198),![]);if(!_0xbf0446){console[_0xf24e66(0x1b1)](_0xf24e66(0x1c9));return;}}const _0x27da9c=typeof _0x40fec3[_0xf24e66(0x1a8)]==='string'?_0x40fec3[_0xf24e66(0x1a8)][_0xf24e66(0x18a)]():'';let _0x540d98=_0x27da9c;!_0x540d98&&(_0x540d98=await promptInput(_0xf24e66(0x19e),_0x18e5c4));if(!_0x540d98[_0xf24e66(0x18a)]())throw CliErrors['validation'](_0xf24e66(0x1c0));await writeInitConfig(_0x4aed2d,{'appcode':_0x540d98[_0xf24e66(0x18a)](),'env':_0x15e089},_0x40fec3),console[_0xf24e66(0x1b1)](_0xf24e66(0x1c6)+_0x4aed2d),console[_0xf24e66(0x1b1)](_0xf24e66(0x1a1)+_0x540d98[_0xf24e66(0x18a)]()),console['log']('\x20\x20env:\x20\x20\x20\x20\x20'+_0x15e089);}async function writeInitConfig(_0x3db41a,_0x8c3a25,_0x3a5eb4){const _0x4ce7c0=a26_0x4ab39d;let _0x1cd372={};existsSync(_0x3db41a)&&!_0x3a5eb4['yes']&&(_0x1cd372=readConfigFile(_0x3db41a));for(const [_0x14095e,_0x1a89a9]of Object['entries'](_0x8c3a25)){_0x1a89a9!==undefined&&(_0x1cd372[_0x14095e]=_0x1a89a9);}if(_0x1cd372[_0x4ce7c0(0x1c4)])delete _0x1cd372['app'];writeConfigFile(_0x3db41a,_0x1cd372);}class AbortPrompt extends Error{constructor(){const _0x129f1e=a26_0x4ab39d;super(_0x129f1e(0x18f)),this[_0x129f1e(0x196)]=_0x129f1e(0x1b3);}}function createSafeRl(){const _0x534aa6=a26_0x4ab39d,_0x5eae1d=createInterface({'input':process[_0x534aa6(0x1c3)],'output':process['stdout']});let _0x32013c;const _0x17f86f=new Promise((_0x37a002,_0x3987f5)=>{_0x32013c=()=>{const _0x37b22e=a26_0x58e0;_0x32013c&&(_0x5eae1d[_0x37b22e(0x1a7)](_0x37b22e(0x19f),_0x32013c),_0x32013c=undefined);try{_0x5eae1d[_0x37b22e(0x1a9)]();}catch{}_0x3987f5(new AbortPrompt());},_0x5eae1d['once']('SIGINT',_0x32013c);}),_0x3e54dc=()=>{const _0x5919a4=_0x534aa6;_0x32013c&&(_0x5eae1d[_0x5919a4(0x1a7)](_0x5919a4(0x19f),_0x32013c),_0x32013c=undefined);try{_0x5eae1d['close']();}catch{}};return{'rl':_0x5eae1d,'abortPromise':_0x17f86f,'disposeSuccess':_0x3e54dc};}async function promptInput(_0x3b7222,_0x30f4f8){const _0x315485=a26_0x4ab39d,{rl:_0x48f330,abortPromise:_0x77f4a3,disposeSuccess:_0x30aa62}=createSafeRl(),_0x24cdda=new Promise(_0x1bf32f=>{const _0x1b2780=_0x30f4f8?'\x20\x20'+_0x3b7222+'\x20('+_0x30f4f8+'):\x20':'\x20\x20'+_0x3b7222+':\x20';_0x48f330['question'](_0x1b2780,_0x534bd2=>{const _0x45d346=a26_0x58e0;_0x30aa62(),_0x1bf32f(_0x534bd2[_0x45d346(0x18a)]()||_0x30f4f8);});});return Promise[_0x315485(0x1c2)]([_0x24cdda,_0x77f4a3]);}function a26_0x3865(){const _0x18f79d=['Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','8wrvQIN','925341eElSpE','Override\x20imported\x20default\x20env','trim','\x22.\x20Allowed:\x20','file','2920530RlcRQH','env','User\x20aborted\x20prompt','3101310yGjlzQ','20976NsMOUb','\x20\x20config:\x20\x20','object','boolean','yes','name','validation','\x20already\x20exists.\x20Overwrite?','App\x20code\x20for\x20the\x20project','Invalid\x20env\x20\x22','flagMissing','Failed\x20to\x20parse\x20source\x20file:\x20','Target\x20environment\x20(default\x20','App\x20code','SIGINT','92401mFIjhZ','\x20\x20appcode:\x20','Write\x20to\x20global\x20(~/','1396199DRghQS','Skip\x20confirmation\x20when\x20overwriting','File\x20','50701717ovFyHb','removeListener','appcode','close','riskLevel','join','12SwJrsB','apps','\x20init\x20—\x20Create\x20','apiDir','global','log','message','AbortPrompt','utf8','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','\x20\x20default:\x20','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','project',')\x20instead\x20of\x20project','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`.','includes','cwd','string','Source\x20file\x20not\x20found:\x20','App\x20code\x20cannot\x20be\x20empty.','parse','race','stdin','app','Initialized\x20','\x0aInitialized\x20','6QHpQJz','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','Aborted.','4824QDgWjr','Imported\x20from\x20','14znZPdm','cancelled','question','Usage:\x20','newConfigFileName','defaultApp'];a26_0x3865=function(){return _0x18f79d;};return a26_0x3865();}async function promptYesNo(_0x117a4a,_0x1f36bd){const _0x27aa56=a26_0x4ab39d,{rl:_0x439bac,abortPromise:_0x30d920,disposeSuccess:_0x27f2f9}=createSafeRl(),_0x297835=new Promise(_0x49897a=>{const _0x20f092=a26_0x58e0,_0x55c14c=_0x1f36bd?'[Y/n]':'[y/N]';_0x439bac[_0x20f092(0x182)]('\x20\x20'+_0x117a4a+'\x20'+_0x55c14c+':\x20',_0x214741=>{const _0x124ada=_0x20f092;_0x27f2f9();const _0xec89a4=_0x214741[_0x124ada(0x18a)]()['toLowerCase']();if(_0xec89a4==='y'||_0xec89a4===_0x124ada(0x195))_0x49897a(!![]);else{if(_0xec89a4==='n'||_0xec89a4==='no')_0x49897a(![]);else _0x49897a(_0x1f36bd);}});});return Promise[_0x27aa56(0x1c2)]([_0x297835,_0x30d920]);}function loadExisting(_0x35e496){if(!existsSync(_0x35e496))return null;return readConfigFile(_0x35e496);}function a26_0x58e0(_0x6f55a9,_0x791282){_0x6f55a9=_0x6f55a9-0x181;const _0x3865c7=a26_0x3865();let _0x58e051=_0x3865c7[_0x6f55a9];return _0x58e051;}function resolveFilePath(_0x11fd96){const _0x50483f=a26_0x4ab39d;return isAbsolute(_0x11fd96)?_0x11fd96:resolve(process[_0x50483f(0x1bd)](),_0x11fd96);}function readSourceFile(_0x2ed2ae){const _0x18cda6=a26_0x4ab39d;try{const _0x5b7964=readFileSync(_0x2ed2ae,{'encoding':_0x18cda6(0x1b4)});return JSON[_0x18cda6(0x1c1)](_0x5b7964);}catch(_0x369101){throw CliErrors['validation'](_0x18cda6(0x19c)+_0x369101[_0x18cda6(0x1b2)]);}}function resolveInitEnv(_0xf74f84){const _0x1fafc1=a26_0x4ab39d,_0x1c938c=_0xf74f84['env'];if(_0x1c938c===undefined||_0x1c938c==='')return DEFAULT_CONFIG_VALUES[_0x1fafc1(0x18e)];if(!RUNTIME_ENV_VALUES[_0x1fafc1(0x1bc)](_0x1c938c))throw CliErrors[_0x1fafc1(0x197)](_0x1fafc1(0x19a)+_0x1c938c+_0x1fafc1(0x18b)+RUNTIME_ENV_VALUES[_0x1fafc1(0x1ab)](',\x20'));return _0x1c938c;}
|
|
1
|
+
function a26_0x45a1(_0x352c16,_0x9e2660){_0x352c16=_0x352c16-0x143;const _0x43f4e4=a26_0x43f4();let _0x45a142=_0x43f4e4[_0x352c16];return _0x45a142;}const a26_0x4c761=a26_0x45a1;(function(_0x811ac4,_0xc88c39){const _0x2785bc=a26_0x45a1,_0x50abff=_0x811ac4();while(!![]){try{const _0x1cf47e=-parseInt(_0x2785bc(0x173))/0x1*(-parseInt(_0x2785bc(0x15d))/0x2)+parseInt(_0x2785bc(0x143))/0x3*(parseInt(_0x2785bc(0x15f))/0x4)+-parseInt(_0x2785bc(0x178))/0x5+parseInt(_0x2785bc(0x16c))/0x6+-parseInt(_0x2785bc(0x146))/0x7+-parseInt(_0x2785bc(0x151))/0x8+-parseInt(_0x2785bc(0x14a))/0x9*(parseInt(_0x2785bc(0x176))/0xa);if(_0x1cf47e===_0xc88c39)break;else _0x50abff['push'](_0x50abff['shift']());}catch(_0xaa4f6){_0x50abff['push'](_0x50abff['shift']());}}}(a26_0x43f4,0x99712));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a26_0x4c761(0x168),'type':a26_0x4c761(0x179),'description':'App\x20code\x20for\x20the\x20project'},{'name':a26_0x4c761(0x163),'type':a26_0x4c761(0x179),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES[a26_0x4c761(0x163)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x4c761(0x16a),'type':a26_0x4c761(0x153),'description':a26_0x4c761(0x174)+PRODUCT_CONFIG[a26_0x4c761(0x157)]+')\x20instead\x20of\x20project','default':![]},{'name':a26_0x4c761(0x159),'type':a26_0x4c761(0x153),'description':a26_0x4c761(0x183),'default':![]}];export const initImportFlagDefs=[{'name':a26_0x4c761(0x15c),'type':a26_0x4c761(0x179),'description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':a26_0x4c761(0x168),'type':a26_0x4c761(0x179),'description':a26_0x4c761(0x150)},{'name':'env','type':a26_0x4c761(0x179),'description':a26_0x4c761(0x148),'enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x4c761(0x16a),'type':'boolean','description':a26_0x4c761(0x174)+PRODUCT_CONFIG[a26_0x4c761(0x157)]+')\x20instead\x20of\x20project','default':![]},{'name':a26_0x4c761(0x159),'type':a26_0x4c761(0x153),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x57b64c){const _0x22f97b=a26_0x4c761,_0x1c8f7d=isNonInteractiveMode(_0x57b64c),_0x37b136=_0x57b64c[_0x22f97b(0x16a)]?_0x22f97b(0x16a):_0x22f97b(0x165),_0x334e09=resolveWriteConfigPath(_0x37b136);try{_0x1c8f7d?await runNonInteractive(_0x57b64c,_0x334e09):await runInteractive(_0x57b64c,_0x334e09);}catch(_0x39c7ce){if(_0x39c7ce instanceof AbortPrompt)throw CliErrors[_0x22f97b(0x172)]();throw _0x39c7ce;}}export async function runInitImport(_0x6032d5){const _0x5856f9=a26_0x4c761,_0x27f9ef=_0x6032d5[_0x5856f9(0x16a)]?_0x5856f9(0x16a):_0x5856f9(0x165),_0xc5bbc7=resolveWriteConfigPath(_0x27f9ef);await runFromImport(_0x6032d5,_0xc5bbc7);}const RUNTIME_IRRELEVANT_KEYS=new Set([a26_0x4c761(0x161)]);async function runFromImport(_0x5aff64,_0x89d6ff){const _0x32042b=a26_0x4c761,_0x280866=resolveFilePath(_0x5aff64[_0x32042b(0x15c)]);if(!existsSync(_0x280866))throw CliErrors['validation'](_0x32042b(0x181)+_0x280866);const _0x10230c=readSourceFile(_0x280866),_0x33151a=convertToRuntimeConfig(_0x10230c);_0x5aff64[_0x32042b(0x168)]&&(_0x33151a[_0x32042b(0x168)]=String(_0x5aff64[_0x32042b(0x168)]));_0x5aff64[_0x32042b(0x163)]&&(_0x33151a['env']=resolveInitEnv(_0x5aff64));if(!_0x33151a[_0x32042b(0x168)])throw CliErrors[_0x32042b(0x17c)]('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.',_0x32042b(0x14b));await writeInitConfig(_0x89d6ff,_0x33151a,_0x5aff64),console['log'](_0x32042b(0x175)+_0x280866),console[_0x32042b(0x17d)](_0x32042b(0x145)+_0x89d6ff),console['log']('\x20\x20appcode:\x20'+_0x33151a['appcode']);if(_0x33151a['defaultApp'])console['log']('\x20\x20default:\x20'+_0x33151a[_0x32042b(0x160)]);}function a26_0x43f4(){const _0x26b335=['53739IoeAnO','riskLevel','Override\x20imported\x20default\x20env','[y/N]','152829SyyowZ','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`.','join','name','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','app','Override\x20imported\x20default\x20appcode','2173736BIpMLW','AbortPrompt','boolean','removeListener','Usage:\x20','entries','newConfigFileName','stdout','yes','\x20\x20appcode:\x20','message','file','4KNoRqy','apps','844jMTKDK','defaultApp','apiDir','close','env','once','project','\x22.\x20Allowed:\x20','Aborted.','appcode','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','global','object','1002114EFfAxL','flagMissing','includes','race','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','User\x20aborted\x20prompt','cancelled','106298JGQIkD','Write\x20to\x20global\x20(~/','Imported\x20from\x20','140bYeoFf','SIGINT','2393390yrJHMA','string','toLowerCase','\x0aInitialized\x20','validation','log','trim','stdin','\x20init\x20—\x20Create\x20','Source\x20file\x20not\x20found:\x20','\x20already\x20exists.\x20Overwrite?','Skip\x20confirmation\x20when\x20overwriting','question','17697jMuWfm','Failed\x20to\x20parse\x20source\x20file:\x20','\x20\x20config:\x20\x20'];a26_0x43f4=function(){return _0x26b335;};return a26_0x43f4();}function convertToRuntimeConfig(_0x280eb9){const _0x57e726=a26_0x4c761;if(_0x280eb9[_0x57e726(0x15e)]&&typeof _0x280eb9[_0x57e726(0x15e)]===_0x57e726(0x16b))throw CliErrors[_0x57e726(0x17c)](_0x57e726(0x169),_0x57e726(0x14e));const _0x4c125c={};for(const _0xe2542a of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x280eb9[_0xe2542a]!==undefined&&(_0x4c125c[_0xe2542a]=_0x280eb9[_0xe2542a]);}return!_0x4c125c['riskLevel']&&(_0x4c125c[_0x57e726(0x147)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x4c125c;}async function runNonInteractive(_0x3976fe,_0x2adee7){const _0x4a3107=a26_0x4c761,_0x167c58=_0x3976fe['appcode'];if(!_0x167c58)throw CliErrors[_0x4a3107(0x16d)](_0x4a3107(0x168),_0x4a3107(0x155)+CLI_BIN_NAME+_0x4a3107(0x170));const _0x5a194c=resolveInitEnv(_0x3976fe);await writeInitConfig(_0x2adee7,{'appcode':_0x167c58,'env':_0x5a194c},_0x3976fe),console[_0x4a3107(0x17d)]('Initialized\x20'+_0x2adee7),console[_0x4a3107(0x17d)](_0x4a3107(0x15a)+_0x167c58),console['log']('\x20\x20env:\x20\x20\x20\x20\x20'+_0x5a194c);}async function runInteractive(_0x2c6ed0,_0x5a909f){const _0x106c16=a26_0x4c761,_0x46bf8b=loadExisting(_0x5a909f),_0x18cfa3=typeof _0x46bf8b?.['appcode']===_0x106c16(0x179)?_0x46bf8b[_0x106c16(0x168)]:'',_0xd81515=resolveInitEnv(_0x2c6ed0);console[_0x106c16(0x17d)](CLI_BIN_NAME+_0x106c16(0x180)+PRODUCT_CONFIG[_0x106c16(0x157)]+'\x0a');if(existsSync(_0x5a909f)&&!_0x2c6ed0[_0x106c16(0x159)]){const _0x497959=await promptYesNo('File\x20'+_0x5a909f+_0x106c16(0x182),![]);if(!_0x497959){console[_0x106c16(0x17d)](_0x106c16(0x167));return;}}const _0x384cb3=typeof _0x2c6ed0['appcode']===_0x106c16(0x179)?_0x2c6ed0['appcode'][_0x106c16(0x17e)]():'';let _0x50747f=_0x384cb3;!_0x50747f&&(_0x50747f=await promptInput('App\x20code',_0x18cfa3));if(!_0x50747f[_0x106c16(0x17e)]())throw CliErrors[_0x106c16(0x17c)]('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x5a909f,{'appcode':_0x50747f['trim'](),'env':_0xd81515},_0x2c6ed0),console[_0x106c16(0x17d)](_0x106c16(0x17b)+_0x5a909f),console[_0x106c16(0x17d)](_0x106c16(0x15a)+_0x50747f['trim']()),console[_0x106c16(0x17d)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0xd81515);}async function writeInitConfig(_0x28da51,_0x5c288d,_0x231d15){const _0x571d1f=a26_0x4c761;let _0x4ef3fe={};existsSync(_0x28da51)&&!_0x231d15['yes']&&(_0x4ef3fe=readConfigFile(_0x28da51));for(const [_0x7225dd,_0xdde14d]of Object[_0x571d1f(0x156)](_0x5c288d)){_0xdde14d!==undefined&&(_0x4ef3fe[_0x7225dd]=_0xdde14d);}if(_0x4ef3fe[_0x571d1f(0x14f)])delete _0x4ef3fe['app'];writeConfigFile(_0x28da51,_0x4ef3fe);}class AbortPrompt extends Error{constructor(){const _0x1e9133=a26_0x4c761;super(_0x1e9133(0x171)),this[_0x1e9133(0x14d)]=_0x1e9133(0x152);}}function createSafeRl(){const _0x5d32e1=a26_0x4c761,_0x3cfbbd=createInterface({'input':process[_0x5d32e1(0x17f)],'output':process[_0x5d32e1(0x158)]});let _0x25125a;const _0x1546dd=new Promise((_0x304c77,_0x4159b0)=>{const _0x98b837=_0x5d32e1;_0x25125a=()=>{const _0xb9a625=a26_0x45a1;_0x25125a&&(_0x3cfbbd[_0xb9a625(0x154)](_0xb9a625(0x177),_0x25125a),_0x25125a=undefined);try{_0x3cfbbd[_0xb9a625(0x162)]();}catch{}_0x4159b0(new AbortPrompt());},_0x3cfbbd[_0x98b837(0x164)](_0x98b837(0x177),_0x25125a);}),_0x1f548f=()=>{const _0x5bce33=_0x5d32e1;_0x25125a&&(_0x3cfbbd['removeListener']('SIGINT',_0x25125a),_0x25125a=undefined);try{_0x3cfbbd[_0x5bce33(0x162)]();}catch{}};return{'rl':_0x3cfbbd,'abortPromise':_0x1546dd,'disposeSuccess':_0x1f548f};}async function promptInput(_0x3ab17a,_0x21c60b){const _0x44c903=a26_0x4c761,{rl:_0x389004,abortPromise:_0x3700a3,disposeSuccess:_0x23589e}=createSafeRl(),_0x58ff87=new Promise(_0x40e3f3=>{const _0x581fc4=a26_0x45a1,_0x2d73d6=_0x21c60b?'\x20\x20'+_0x3ab17a+'\x20('+_0x21c60b+'):\x20':'\x20\x20'+_0x3ab17a+':\x20';_0x389004[_0x581fc4(0x184)](_0x2d73d6,_0x3ded63=>{const _0x9434bd=_0x581fc4;_0x23589e(),_0x40e3f3(_0x3ded63[_0x9434bd(0x17e)]()||_0x21c60b);});});return Promise[_0x44c903(0x16f)]([_0x58ff87,_0x3700a3]);}async function promptYesNo(_0x26dc6b,_0x568696){const _0x172085=a26_0x4c761,{rl:_0x19e724,abortPromise:_0x32cd26,disposeSuccess:_0x3d0201}=createSafeRl(),_0x27343a=new Promise(_0x43a965=>{const _0x4df0be=a26_0x45a1,_0x4cefa4=_0x568696?'[Y/n]':_0x4df0be(0x149);_0x19e724[_0x4df0be(0x184)]('\x20\x20'+_0x26dc6b+'\x20'+_0x4cefa4+':\x20',_0xa7ae38=>{const _0x2bdc87=_0x4df0be;_0x3d0201();const _0x1519a9=_0xa7ae38['trim']()[_0x2bdc87(0x17a)]();if(_0x1519a9==='y'||_0x1519a9===_0x2bdc87(0x159))_0x43a965(!![]);else{if(_0x1519a9==='n'||_0x1519a9==='no')_0x43a965(![]);else _0x43a965(_0x568696);}});});return Promise[_0x172085(0x16f)]([_0x27343a,_0x32cd26]);}function loadExisting(_0x4240dd){if(!existsSync(_0x4240dd))return null;return readConfigFile(_0x4240dd);}function resolveFilePath(_0x181b06){return isAbsolute(_0x181b06)?_0x181b06:resolve(process['cwd'](),_0x181b06);}function readSourceFile(_0x3737bc){const _0x12e7e2=a26_0x4c761;try{const _0x4d4bf6=readFileSync(_0x3737bc,{'encoding':'utf8'});return JSON['parse'](_0x4d4bf6);}catch(_0xed7d06){throw CliErrors[_0x12e7e2(0x17c)](_0x12e7e2(0x144)+_0xed7d06[_0x12e7e2(0x15b)]);}}function resolveInitEnv(_0x11e438){const _0x1ef6e8=a26_0x4c761,_0xf8808f=_0x11e438[_0x1ef6e8(0x163)];if(_0xf8808f===undefined||_0xf8808f==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x1ef6e8(0x16e)](_0xf8808f))throw CliErrors[_0x1ef6e8(0x17c)]('Invalid\x20env\x20\x22'+_0xf8808f+_0x1ef6e8(0x166)+RUNTIME_ENV_VALUES[_0x1ef6e8(0x14c)](',\x20'));return _0xf8808f;}
|