@lovrabet/lovrabet-cli 2.1.0-beta.1 → 2.1.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a15_0x1934(_0x130d01,_0x59db1c){_0x130d01=_0x130d01-0x99;const _0x2944c9=a15_0x2944();let _0x1934eb=_0x2944c9[_0x130d01];return _0x1934eb;}(function(_0x25cf4f,_0x13be19){const _0x21672c=a15_0x1934,_0x301bdd=_0x25cf4f();while(!![]){try{const _0x265596=parseInt(_0x21672c(0x9e))/0x1*(parseInt(_0x21672c(0xa4))/0x2)+parseInt(_0x21672c(0xa5))/0x3+parseInt(_0x21672c(0xa3))/0x4*(parseInt(_0x21672c(0xa6))/0x5)+parseInt(_0x21672c(0xae))/0x6*(parseInt(_0x21672c(0xa7))/0x7)+parseInt(_0x21672c(0xab))/0x8*(parseInt(_0x21672c(0x9f))/0x9)+-parseInt(_0x21672c(0x99))/0xa+-parseInt(_0x21672c(0xac))/0xb*(parseInt(_0x21672c(0x9b))/0xc);if(_0x265596===_0x13be19)break;else _0x301bdd['push'](_0x301bdd['shift']());}catch(_0x225704){_0x301bdd['push'](_0x301bdd['shift']());}}}(a15_0x2944,0x4afda));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';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(_0x2f267a){const _0x3db2bc=a15_0x1934,{explicitGlobal:explicitGlobal=![],explicitProject:explicitProject=![],policy:_0x4f8727}=_0x2f267a;if(explicitGlobal&&explicitProject)throw CliErrors['validation']('Flags\x20--global\x20and\x20--project\x20are\x20mutually\x20exclusive.','Use\x20only\x20one\x20config\x20scope\x20flag.');if(explicitGlobal)return _0x3db2bc(0x9c);if(explicitProject)return _0x3db2bc(0xad);switch(_0x4f8727){case _0x3db2bc(0x9a):return _0x3db2bc(0x9c);case _0x3db2bc(0xa9):return _0x2f267a[_0x3db2bc(0xa0)]??isInProject()?_0x3db2bc(0xad):_0x3db2bc(0x9c);case'project-or-global-explicit':if(!(_0x2f267a[_0x3db2bc(0xa0)]??isInProject()))throw CliErrors[_0x3db2bc(0x9d)](_0x3db2bc(0xa8)+PRODUCT_CONFIG[_0x3db2bc(0xa2)]+'\x20found).',_0x3db2bc(0xa1)+PRODUCT_CONFIG[_0x3db2bc(0xa2)]+_0x3db2bc(0xaa)+CLI_BIN_NAME+'\x20init`\x20first.');return'project';}}export function toScopeFlags(_0x5aaef5){const _0x359d3a=a15_0x1934;return{'global':_0x5aaef5===_0x359d3a(0x9c)};}function a15_0x2944(){const _0x17eb10=['Not\x20inside\x20a\x20project\x20(no\x20','project-default',',\x20or\x20run\x20`','780824qFHbeQ','25718uoyItX','project','2848722ePDUyo','5803610vsnxKY','global-default','5352dQfEEQ','global','validation','7594jjpbId','27HtnNtH','inProject','Add\x20--global\x20to\x20write\x20to\x20~/','newConfigFileName','8hTsGMX','64gtiRpE','1282557CKeqyd','1230370pvrzNi','7VrEWOI'];a15_0x2944=function(){return _0x17eb10;};return a15_0x2944();}export function formatScopeLabel(_0x8807b4){const _0x537298=a15_0x1934;return _0x8807b4===_0x537298(0x9c)?'\x20(global)':'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x41ecb8,_0x56d71a){const _0x30db11=a16_0x2500,_0x405932=_0x41ecb8();while(!![]){try{const _0x27f44c=parseInt(_0x30db11(0x15e))/0x1+-parseInt(_0x30db11(0x15d))/0x2+parseInt(_0x30db11(0x164))/0x3+-parseInt(_0x30db11(0x15a))/0x4*(-parseInt(_0x30db11(0x165))/0x5)+-parseInt(_0x30db11(0x15f))/0x6*(-parseInt(_0x30db11(0x14f))/0x7)+-parseInt(_0x30db11(0x163))/0x8*(parseInt(_0x30db11(0x14c))/0x9)+-parseInt(_0x30db11(0x158))/0xa*(parseInt(_0x30db11(0x157))/0xb);if(_0x27f44c===_0x56d71a)break;else _0x405932['push'](_0x405932['shift']());}catch(_0x1c65e2){_0x405932['push'](_0x405932['shift']());}}}(a16_0x4909,0xb341e));import{CliErrors}from'../../errors.js';function isSet(_0x30f1d6,_0xe07fdb){const _0x484703=a16_0x2500,_0x55a6e3=_0x30f1d6[_0x484703(0x161)](_0xe07fdb);return _0x55a6e3!==undefined&&_0x55a6e3!==''&&_0x55a6e3!==![]&&_0x55a6e3!==0x0;}function fmtNames(_0x112a5a){const _0x2027a5=a16_0x2500;return _0x112a5a[_0x2027a5(0x156)](_0x2a07d1=>'--'+_0x2a07d1)[_0x2027a5(0x151)](',\x20');}function a16_0x4909(){const _0x350449=['890700VtuRmA','\x20is\x20required\x20for\x20`','Provide\x20one\x20of:\x20','2609770kvUBrW','760763MNXVhl','2523396WINMUX','\x20are\x20mutually\x20exclusive\x20for\x20`','flag','Only\x20one\x20of\x20','3580520Sqbfjf','1850703qHBzJu','15AyLGPP','length','Use\x20only\x20one\x20of:\x20','filter','9dzDFbl','str','test','14xQOQVp',':\x20expected\x20','join','Exactly\x20one\x20of\x20',',\x20got\x20\x22','validation','Remove\x20all\x20but\x20one.','map','38951AnHSMl','1130vkFabr','At\x20least\x20one\x20of\x20'];a16_0x4909=function(){return _0x350449;};return a16_0x4909();}export function requireOneOf(_0x316308,_0x55c125,_0x4aaf9f){const _0x1fd76e=a16_0x2500,_0x349f5a=_0x55c125[_0x1fd76e(0x14b)](_0x492475=>isSet(_0x316308,_0x492475));if(_0x349f5a[_0x1fd76e(0x166)]!==0x1)throw CliErrors[_0x1fd76e(0x154)](_0x349f5a['length']===0x0?_0x1fd76e(0x152)+fmtNames(_0x55c125)+_0x1fd76e(0x15b)+_0x4aaf9f+'`.':_0x1fd76e(0x162)+fmtNames(_0x55c125)+'\x20is\x20allowed,\x20found:\x20'+fmtNames(_0x349f5a)+'.',_0x349f5a['length']===0x0?_0x1fd76e(0x15c)+fmtNames(_0x55c125):_0x1fd76e(0x155));}export function requireAnyOf(_0x572051,_0x3f6abd,_0x51cefa){const _0x1db27c=a16_0x2500;if(!_0x3f6abd['some'](_0x50cad4=>isSet(_0x572051,_0x50cad4)))throw CliErrors[_0x1db27c(0x154)](_0x1db27c(0x159)+fmtNames(_0x3f6abd)+'\x20is\x20required\x20for\x20`'+_0x51cefa+'`.',_0x1db27c(0x15c)+fmtNames(_0x3f6abd));}function a16_0x2500(_0x158b01,_0x18d329){_0x158b01=_0x158b01-0x14b;const _0x490954=a16_0x4909();let _0x25007a=_0x490954[_0x158b01];return _0x25007a;}export function mutuallyExclusive(_0x37289d,_0x14f44d,_0x4614bf){const _0x51dffb=a16_0x2500,_0x3e3cba=_0x14f44d[_0x51dffb(0x14b)](_0x42bc7d=>isSet(_0x37289d,_0x42bc7d));if(_0x3e3cba[_0x51dffb(0x166)]>0x1)throw CliErrors[_0x51dffb(0x154)]('Flags\x20'+fmtNames(_0x3e3cba)+_0x51dffb(0x160)+_0x4614bf+'`.',_0x51dffb(0x167)+fmtNames(_0x14f44d));}export function validatePattern(_0x432a3a,_0xf7dc84,_0x3add83,_0x272303){const _0x369fa9=a16_0x2500,_0xe8f0b6=_0x432a3a[_0x369fa9(0x14d)](_0xf7dc84);if(_0xe8f0b6&&!_0x3add83[_0x369fa9(0x14e)](_0xe8f0b6))throw CliErrors['validation']('Invalid\x20--'+_0xf7dc84+_0x369fa9(0x150)+_0x272303+_0x369fa9(0x153)+_0xe8f0b6+'\x22.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a17_0x2fcff2=a17_0x14d6;(function(_0x1761e9,_0x204b8f){const _0x2eb18e=a17_0x14d6,_0x1c2edf=_0x1761e9();while(!![]){try{const _0x5c70fe=parseInt(_0x2eb18e(0x1aa))/0x1*(parseInt(_0x2eb18e(0x1a3))/0x2)+-parseInt(_0x2eb18e(0x1a5))/0x3+parseInt(_0x2eb18e(0x1ad))/0x4+-parseInt(_0x2eb18e(0x1b6))/0x5+parseInt(_0x2eb18e(0x1b1))/0x6*(parseInt(_0x2eb18e(0x1a4))/0x7)+-parseInt(_0x2eb18e(0x1a8))/0x8+parseInt(_0x2eb18e(0x1a2))/0x9;if(_0x5c70fe===_0x204b8f)break;else _0x1c2edf['push'](_0x1c2edf['shift']());}catch(_0x405a90){_0x1c2edf['push'](_0x1c2edf['shift']());}}}(a17_0x3d8c,0x77971));export const CODE_FLAG={'name':'code','type':a17_0x2fcff2(0x1b5),'required':!![],'description':a17_0x2fcff2(0x1ac),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a17_0x2fcff2(0x1ae)}};export const SQLCODE_FLAG={'name':a17_0x2fcff2(0x1b3),'type':a17_0x2fcff2(0x1b5),'required':!![],'description':a17_0x2fcff2(0x1b4),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a17_0x2fcff2(0x1b2)}};function a17_0x14d6(_0x595f26,_0x8e07d6){_0x595f26=_0x595f26-0x1a2;const _0x3d8c72=a17_0x3d8c();let _0x14d6ec=_0x3d8c72[_0x595f26];return _0x14d6ec;}export const VERBOSE_FLAG={'name':a17_0x2fcff2(0x1a7),'type':'boolean','description':a17_0x2fcff2(0x1ab)};export const PARAMS_FLAG={'name':a17_0x2fcff2(0x1a6),'type':a17_0x2fcff2(0x1b5),'description':a17_0x2fcff2(0x1a9)};export const NAME_FLAG={'name':a17_0x2fcff2(0x1b0),'type':a17_0x2fcff2(0x1b5),'description':a17_0x2fcff2(0x1af)};export const ID_FLAG={'name':'id','type':'number','required':!![],'description':'Resource\x20ID'};function a17_0x3d8c(){const _0x11d0b6=['1281004CDWmaH','a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)','Resource\x20name\x20for\x20lookup','name','6oBVPvR','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','sqlcode','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','string','3221980lJJjFP','10678347imoKEj','853386ndlatW','2087148UAIpCD','2826432dEwTED','params','verbose','1241680eEdzAg','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','1BsGBDK','Return\x20full\x20raw\x20response\x20object','Dataset\x20code\x20(32-char\x20hex\x20UUID)'];a17_0x3d8c=function(){return _0x11d0b6;};return a17_0x3d8c();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a18_0xbf27e9=a18_0x5a78;function a18_0x5a78(_0x12d3e0,_0x7fe4ce){_0x12d3e0=_0x12d3e0-0x13c;const _0x1ce61=a18_0x1ce6();let _0x5a78aa=_0x1ce61[_0x12d3e0];return _0x5a78aa;}(function(_0x1e1aad,_0x2514a8){const _0x1c582a=a18_0x5a78,_0x2762e3=_0x1e1aad();while(!![]){try{const _0x101300=-parseInt(_0x1c582a(0x15c))/0x1+parseInt(_0x1c582a(0x166))/0x2+-parseInt(_0x1c582a(0x140))/0x3+-parseInt(_0x1c582a(0x14a))/0x4+parseInt(_0x1c582a(0x13c))/0x5+-parseInt(_0x1c582a(0x16c))/0x6*(-parseInt(_0x1c582a(0x17d))/0x7)+parseInt(_0x1c582a(0x17b))/0x8*(parseInt(_0x1c582a(0x150))/0x9);if(_0x101300===_0x2514a8)break;else _0x2762e3['push'](_0x2762e3['shift']());}catch(_0x1c42be){_0x2762e3['push'](_0x2762e3['shift']());}}}(a18_0x1ce6,0x3504d));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':a18_0xbf27e9(0x153),'type':a18_0xbf27e9(0x16b),'description':'Write\x20to\x20global\x20config','default':![]};function parseAliasAppcodeSetKey(_0xe6711a){const _0x262225=a18_0xbf27e9,_0x1b072d=_0xe6711a[_0x262225(0x13e)]('.');if(_0x1b072d[_0x262225(0x14f)]!==0x3||_0x1b072d[0x0]!==_0x262225(0x16e)||_0x1b072d[0x2]!==_0x262225(0x162))return undefined;const _0x3fe779=_0x1b072d[0x1]?.['trim']();return _0x3fe779?_0x3fe779:undefined;}function parseAliasDeleteKey(_0x231c36){const _0x1f2481=a18_0xbf27e9,_0x33f3d9=_0x231c36[_0x1f2481(0x13e)]('.');if(_0x33f3d9[_0x1f2481(0x14f)]===0x2&&_0x33f3d9[0x0]===_0x1f2481(0x16e)){const _0xe6c04f=_0x33f3d9[0x1]?.[_0x1f2481(0x15d)]();return _0xe6c04f?{'alias':_0xe6c04f}:undefined;}if(_0x33f3d9[_0x1f2481(0x14f)]===0x3&&_0x33f3d9[0x0]==='apps'&&_0x33f3d9[0x2]==='appcode'){const _0x52405b=_0x33f3d9[0x1]?.['trim']();return _0x52405b?{'alias':_0x52405b,'field':_0x1f2481(0x162)}:undefined;}return undefined;}function setLocalAppAlias(_0x481f2c,_0x298418,_0x5f5131){const _0x2d6851=a18_0xbf27e9,_0xd83eed=_0x481f2c['apps']&&typeof _0x481f2c[_0x2d6851(0x16e)]===_0x2d6851(0x17e)&&!Array['isArray'](_0x481f2c[_0x2d6851(0x16e)])?_0x481f2c[_0x2d6851(0x16e)]:{},_0x122962=_0xd83eed[_0x298418]&&typeof _0xd83eed[_0x298418]===_0x2d6851(0x17e)&&!Array[_0x2d6851(0x175)](_0xd83eed[_0x298418])?_0xd83eed[_0x298418]:{};_0x122962[_0x2d6851(0x162)]=_0x5f5131,_0xd83eed[_0x298418]=_0x122962,_0x481f2c[_0x2d6851(0x16e)]=_0xd83eed;}function deleteLocalAppAlias(_0x27aa84,_0x37dc2b){const _0x12e24a=a18_0xbf27e9;if(!_0x27aa84[_0x12e24a(0x16e)]||typeof _0x27aa84[_0x12e24a(0x16e)]!==_0x12e24a(0x17e)||Array[_0x12e24a(0x175)](_0x27aa84['apps']))return![];const _0x4c5e7b=_0x27aa84[_0x12e24a(0x16e)],_0x412ed0=_0x4c5e7b[_0x37dc2b['alias']];if(!_0x412ed0||typeof _0x412ed0!==_0x12e24a(0x17e)||Array[_0x12e24a(0x175)](_0x412ed0))return![];if(!_0x37dc2b[_0x12e24a(0x157)])return delete _0x4c5e7b[_0x37dc2b[_0x12e24a(0x15b)]],!![];if(!(_0x37dc2b[_0x12e24a(0x157)]in _0x412ed0))return![];return delete _0x412ed0[_0x37dc2b[_0x12e24a(0x157)]],Object[_0x12e24a(0x15f)](_0x412ed0)[_0x12e24a(0x14f)]===0x0&&delete _0x4c5e7b[_0x37dc2b[_0x12e24a(0x15b)]],!![];}function a18_0x1ce6(){const _0x377a6f=['includes','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','appcode','Get\x20a\x20config\x20value','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','config','62894NDIgqd','`\x20=\x20\x22','riskLevel','Set\x20`','\x20config\x20set\x20<key>\x20<value>\x20[--global]','boolean','268338BCzeak','Key\x20\x22','apps','get','set','\x20config\x20delete\x20<key>\x20[--global]','List\x20current\x20config',';\x20apps.<alias>.appcode','Deleted\x20`','isArray','\x20\x20project:\x20','project-or-global-explicit','Missing\x20key\x20argument.','Missing\x20key\x20or\x20value.','key','976072zbpOkc','(none)','7eseKqX','object','\x20(global)','pretty','2044925BWWRDM','list','split','format','324AODOZB','read','pageSize','Delete\x20a\x20config\x20value','join','args','Set\x20a\x20config\x20value','\x20config\x20get\x20<key>','Value\x20to\x20assign','value','1459740idqnmN','Key\x20not\x20found:\x20','stringify','Invalid\x20value\x20for\x20\x22','log','length','18jXEpTr','validation','\x22\x20not\x20found\x20at\x20top\x20level.','global','\x20\x20global:\x20\x20','raw','bool','field','\x22\x20is\x20not\x20settable.','Usage:\x20','write','alias','146965geNDQS','trim','Top-level\x20key\x20\x22','keys'];a18_0x1ce6=function(){return _0x377a6f;};return a18_0x1ce6();}const listDef={'service':a18_0xbf27e9(0x165),'command':a18_0xbf27e9(0x13d),'description':a18_0xbf27e9(0x172),'risk':a18_0xbf27e9(0x141),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x5362e5){const _0x30a3df=a18_0xbf27e9,{buildConfigFromFlags:_0x58151a}=await import('../../context.js'),_0x5aefd1=_0x58151a({}),_0x3ade51=getProjectConfigPath(),_0x3a4f5a=resolveWriteConfigPath(_0x30a3df(0x153));if(_0x5362e5[_0x30a3df(0x13f)]===_0x30a3df(0x180))return{'ok':!![],'message':_0x30a3df(0x161)+(JSON[_0x30a3df(0x14c)](_0x5aefd1[_0x30a3df(0x155)],null,0x2)+'\x0a\x0a')+'Config\x20files:\x0a'+(_0x30a3df(0x176)+(_0x3ade51??_0x30a3df(0x17c))+'\x0a')+(_0x30a3df(0x154)+_0x3a4f5a)};return{'ok':!![],'data':{'effective':_0x5aefd1[_0x30a3df(0x155)],'configFiles':{'project':_0x3ade51??null,'global':_0x3a4f5a}}};}},getDef={'service':a18_0xbf27e9(0x165),'command':a18_0xbf27e9(0x16f),'description':a18_0xbf27e9(0x163),'risk':a18_0xbf27e9(0x141),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0xbf27e9(0x17a),'description':'Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','required':!![]}],'flags':[],async 'execute'(_0x48c69c){const _0xa7ebcc=a18_0xbf27e9,_0x50cfa7=_0x48c69c['args'][0x0];if(!_0x50cfa7)throw CliErrors[_0xa7ebcc(0x151)](_0xa7ebcc(0x178),_0xa7ebcc(0x159)+CLI_BIN_NAME+_0xa7ebcc(0x147));const {buildConfigFromFlags:_0x3b6fdb}=await import('../../context.js'),{raw:_0x111e96}=_0x3b6fdb({});if(_0x50cfa7[_0xa7ebcc(0x160)]('.')){const _0x14b50a=_0x50cfa7[_0xa7ebcc(0x13e)]('.');let _0x1bad04=_0x111e96;for(const _0x1d685f of _0x14b50a){if(_0x1bad04==null||typeof _0x1bad04!=='object')throw CliErrors[_0xa7ebcc(0x151)](_0xa7ebcc(0x14b)+_0x50cfa7);_0x1bad04=_0x1bad04[_0x1d685f];}if(_0x1bad04===undefined)throw CliErrors['validation']('Key\x20not\x20found:\x20'+_0x50cfa7);return console[_0xa7ebcc(0x14e)](typeof _0x1bad04===_0xa7ebcc(0x17e)?JSON[_0xa7ebcc(0x14c)](_0x1bad04,null,0x2):String(_0x1bad04)),{'ok':!![]};}const _0x36cb87=_0x111e96[_0x50cfa7];if(_0x36cb87===undefined)throw CliErrors['validation'](_0xa7ebcc(0x14b)+_0x50cfa7);return console[_0xa7ebcc(0x14e)](typeof _0x36cb87===_0xa7ebcc(0x17e)?JSON[_0xa7ebcc(0x14c)](_0x36cb87,null,0x2):String(_0x36cb87)),{'ok':!![]};}},setDef={'service':'config','command':a18_0xbf27e9(0x170),'description':a18_0xbf27e9(0x146),'risk':a18_0xbf27e9(0x15a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0xbf27e9(0x17a),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a18_0xbf27e9(0x149),'description':a18_0xbf27e9(0x148),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x1ceb97){const _0x14f15d=a18_0xbf27e9,_0x3945c8=_0x1ceb97[_0x14f15d(0x145)][0x0],_0x33240d=_0x1ceb97[_0x14f15d(0x145)][0x1];if(!_0x3945c8||_0x33240d===undefined)throw CliErrors[_0x14f15d(0x151)](_0x14f15d(0x179),_0x14f15d(0x159)+CLI_BIN_NAME+_0x14f15d(0x16a));if(ENUM_KEYS[_0x3945c8]&&!ENUM_KEYS[_0x3945c8][_0x14f15d(0x160)](_0x33240d))throw CliErrors['validation'](_0x14f15d(0x14d)+_0x3945c8+'\x22.\x20Allowed:\x20'+ENUM_KEYS[_0x3945c8][_0x14f15d(0x144)](',\x20'));if(_0x3945c8===_0x14f15d(0x168))throw CliErrors['validation'](_0x14f15d(0x164));if(_0x3945c8===_0x14f15d(0x142)){const _0x152b8f=Number(_0x33240d);if(isNaN(_0x152b8f)||_0x152b8f<=0x0)throw CliErrors[_0x14f15d(0x151)]('pageSize\x20must\x20be\x20a\x20positive\x20number');}const _0x4ff061=resolveWriteScope({'explicitGlobal':_0x1ceb97[_0x14f15d(0x156)](_0x14f15d(0x153)),'policy':_0x14f15d(0x177)}),_0x33c6ec=toScopeFlags(_0x4ff061),_0x46db39=readScopedConfig(_0x33c6ec),_0x3e648b=parseAliasAppcodeSetKey(_0x3945c8);if(!_0x3e648b&&!isTopLevelConfigKey(_0x3945c8))throw CliErrors[_0x14f15d(0x151)](_0x14f15d(0x15e)+_0x3945c8+_0x14f15d(0x158),'Settable\x20keys:\x20'+getTopLevelConfigKeySummary()+_0x14f15d(0x173));return _0x3e648b?setLocalAppAlias(_0x46db39,_0x3e648b,_0x33240d):_0x46db39[_0x3945c8]=_0x3945c8===_0x14f15d(0x142)?Number(_0x33240d):_0x33240d,console[_0x14f15d(0x14e)](_0x14f15d(0x169)+_0x3945c8+_0x14f15d(0x167)+_0x33240d+'\x22'+(_0x4ff061===_0x14f15d(0x153)?'\x20(global)':'')),writeScopedConfig(_0x46db39,_0x33c6ec),{'ok':!![]};}},deleteDef={'service':a18_0xbf27e9(0x165),'command':'delete','description':a18_0xbf27e9(0x143),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0xbf27e9(0x17a),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x4c7cc3){const _0x141155=a18_0xbf27e9,_0x17e3e9=_0x4c7cc3['args'][0x0];if(!_0x17e3e9)throw CliErrors[_0x141155(0x151)](_0x141155(0x178),'Usage:\x20'+CLI_BIN_NAME+_0x141155(0x171));const _0x44ab73=resolveWriteScope({'explicitGlobal':_0x4c7cc3['bool'](_0x141155(0x153)),'policy':_0x141155(0x177)}),_0x20ecee=toScopeFlags(_0x44ab73),_0x13a2a0=readScopedConfig(_0x20ecee),_0x1cb8cc=parseAliasDeleteKey(_0x17e3e9);if(_0x1cb8cc){if(!deleteLocalAppAlias(_0x13a2a0,_0x1cb8cc))throw CliErrors[_0x141155(0x151)]('Key\x20not\x20found:\x20'+_0x17e3e9);return console[_0x141155(0x14e)](_0x141155(0x174)+_0x17e3e9+'`'+(_0x44ab73===_0x141155(0x153)?_0x141155(0x17f):'')),writeScopedConfig(_0x13a2a0,_0x20ecee),{'ok':!![]};}if(_0x13a2a0[_0x17e3e9]===undefined)throw CliErrors['validation'](_0x141155(0x16d)+_0x17e3e9+_0x141155(0x152));return delete _0x13a2a0[_0x17e3e9],console['log'](_0x141155(0x174)+_0x17e3e9+'`'+(_0x44ab73===_0x141155(0x153)?_0x141155(0x17f):'')),writeScopedConfig(_0x13a2a0,_0x20ecee),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
1
|
+
const a18_0x215860=a18_0x11c0;(function(_0x4b628e,_0x48e339){const _0x6730a1=a18_0x11c0,_0x33c75e=_0x4b628e();while(!![]){try{const _0x59b45d=parseInt(_0x6730a1(0xc2))/0x1+parseInt(_0x6730a1(0xc3))/0x2*(parseInt(_0x6730a1(0xef))/0x3)+parseInt(_0x6730a1(0xdb))/0x4*(parseInt(_0x6730a1(0xd2))/0x5)+-parseInt(_0x6730a1(0xe8))/0x6*(-parseInt(_0x6730a1(0xb5))/0x7)+-parseInt(_0x6730a1(0xea))/0x8*(parseInt(_0x6730a1(0xda))/0x9)+parseInt(_0x6730a1(0xe9))/0xa+-parseInt(_0x6730a1(0xbc))/0xb;if(_0x59b45d===_0x48e339)break;else _0x33c75e['push'](_0x33c75e['shift']());}catch(_0x5ae5d5){_0x33c75e['push'](_0x33c75e['shift']());}}}(a18_0x4dfd,0x78da8));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':a18_0x215860(0xed),'type':a18_0x215860(0xdf),'description':a18_0x215860(0xc6),'default':![]};function parseAliasAppcodeSetKey(_0x44e3a2){const _0x6f52d1=a18_0x215860,_0x614ce5=_0x44e3a2[_0x6f52d1(0xb7)]('.');if(_0x614ce5[_0x6f52d1(0xb6)]!==0x3||_0x614ce5[0x0]!=='apps'||_0x614ce5[0x2]!==_0x6f52d1(0xe4))return undefined;const _0x539b45=_0x614ce5[0x1]?.[_0x6f52d1(0xb8)]();return _0x539b45?_0x539b45:undefined;}function parseAliasDeleteKey(_0x2bce01){const _0xf01e34=a18_0x215860,_0x167292=_0x2bce01[_0xf01e34(0xb7)]('.');if(_0x167292['length']===0x2&&_0x167292[0x0]==='apps'){const _0x528ebe=_0x167292[0x1]?.[_0xf01e34(0xb8)]();return _0x528ebe?{'alias':_0x528ebe}:undefined;}if(_0x167292[_0xf01e34(0xb6)]===0x3&&_0x167292[0x0]===_0xf01e34(0xcd)&&_0x167292[0x2]==='appcode'){const _0x5cf8f3=_0x167292[0x1]?.[_0xf01e34(0xb8)]();return _0x5cf8f3?{'alias':_0x5cf8f3,'field':'appcode'}:undefined;}return undefined;}function setLocalAppAlias(_0x76d7bc,_0x12323d,_0x36d5ab){const _0x5f59ac=a18_0x215860,_0x34963d=_0x76d7bc['apps']&&typeof _0x76d7bc[_0x5f59ac(0xcd)]===_0x5f59ac(0xce)&&!Array[_0x5f59ac(0xb9)](_0x76d7bc['apps'])?_0x76d7bc[_0x5f59ac(0xcd)]:{},_0x273c1b=_0x34963d[_0x12323d]&&typeof _0x34963d[_0x12323d]===_0x5f59ac(0xce)&&!Array[_0x5f59ac(0xb9)](_0x34963d[_0x12323d])?_0x34963d[_0x12323d]:{};_0x273c1b[_0x5f59ac(0xe4)]=_0x36d5ab,_0x34963d[_0x12323d]=_0x273c1b,_0x76d7bc['apps']=_0x34963d;}function deleteLocalAppAlias(_0x1c66d6,_0x3d892c){const _0x367864=a18_0x215860;if(!_0x1c66d6[_0x367864(0xcd)]||typeof _0x1c66d6[_0x367864(0xcd)]!=='object'||Array['isArray'](_0x1c66d6[_0x367864(0xcd)]))return![];const _0x35a7ac=_0x1c66d6['apps'],_0x3133bb=_0x35a7ac[_0x3d892c['alias']];if(!_0x3133bb||typeof _0x3133bb!==_0x367864(0xce)||Array[_0x367864(0xb9)](_0x3133bb))return![];if(!_0x3d892c[_0x367864(0xdd)])return delete _0x35a7ac[_0x3d892c[_0x367864(0xc5)]],!![];if(!(_0x3d892c[_0x367864(0xdd)]in _0x3133bb))return![];return delete _0x3133bb[_0x3d892c[_0x367864(0xdd)]],Object[_0x367864(0xc0)](_0x3133bb)['length']===0x0&&delete _0x35a7ac[_0x3d892c[_0x367864(0xc5)]],!![];}function a18_0x4dfd(){const _0x25096a=['object','read','\x22\x20not\x20found\x20at\x20top\x20level.','set','30fYNCHr','pageSize\x20must\x20be\x20a\x20positive\x20number','\x20\x20project:\x20','write','../../context.js','Delete\x20a\x20config\x20value','Usage:\x20','\x20(global)','3843ZzAdbz','48392eQBBbC','validation','field','pageSize','boolean','project-or-global-explicit','(none)','Settable\x20keys:\x20','list','appcode','stringify','List\x20current\x20config','Set\x20`','29388zJHxvI','3319030aTXEZJ','8488FYrdQo','Value\x20to\x20assign','\x22\x20is\x20not\x20settable.','global','Missing\x20key\x20argument.','24wNWaPc','key','includes','\x20config\x20delete\x20<key>\x20[--global]','\x22.\x20Allowed:\x20','Get\x20a\x20config\x20value','Top-level\x20key\x20\x22','Invalid\x20value\x20for\x20\x22','args','riskLevel','1218PlUhWC','length','split','trim','isArray','`\x20=\x20\x22',';\x20apps.<alias>.appcode','11303006xUGJcl','Deleted\x20`','log','bool','keys','value','667922mHUjhy','12736IOZvCK','config','alias','Write\x20to\x20global\x20config','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','Key\x20not\x20found:\x20','Config\x20files:\x0a','\x20\x20global:\x20\x20','delete','get','apps'];a18_0x4dfd=function(){return _0x25096a;};return a18_0x4dfd();}function a18_0x11c0(_0x4efd77,_0x48339f){_0x4efd77=_0x4efd77-0xb2;const _0x4dfd39=a18_0x4dfd();let _0x11c0ba=_0x4dfd39[_0x4efd77];return _0x11c0ba;}const listDef={'service':a18_0x215860(0xc4),'command':a18_0x215860(0xe3),'description':a18_0x215860(0xe6),'risk':a18_0x215860(0xcf),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0xf1cc13){const _0x5f34b7=a18_0x215860,{buildConfigFromFlags:_0x1e1887}=await import(_0x5f34b7(0xd6)),_0x923365=_0x1e1887({}),_0x26ab50=getProjectConfigPath(),_0x2f1c49=resolveWriteConfigPath(_0x5f34b7(0xed));if(_0xf1cc13['format']==='pretty')return{'ok':!![],'message':_0x5f34b7(0xc7)+(JSON['stringify'](_0x923365['raw'],null,0x2)+'\x0a\x0a')+_0x5f34b7(0xc9)+(_0x5f34b7(0xd4)+(_0x26ab50??_0x5f34b7(0xe1))+'\x0a')+(_0x5f34b7(0xca)+_0x2f1c49)};return{'ok':!![],'data':{'effective':_0x923365['raw'],'configFiles':{'project':_0x26ab50??null,'global':_0x2f1c49}}};}},getDef={'service':a18_0x215860(0xc4),'command':a18_0x215860(0xcc),'description':a18_0x215860(0xf4),'risk':a18_0x215860(0xcf),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x215860(0xf0),'description':'Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','required':!![]}],'flags':[],async 'execute'(_0x318b26){const _0x5aac10=a18_0x215860,_0x588aee=_0x318b26[_0x5aac10(0xb3)][0x0];if(!_0x588aee)throw CliErrors['validation'](_0x5aac10(0xee),_0x5aac10(0xd8)+CLI_BIN_NAME+'\x20config\x20get\x20<key>');const {buildConfigFromFlags:_0x39c36b}=await import(_0x5aac10(0xd6)),{raw:_0x4e3396}=_0x39c36b({});if(_0x588aee[_0x5aac10(0xf1)]('.')){const _0x4f0e21=_0x588aee['split']('.');let _0x4bcafb=_0x4e3396;for(const _0x1fb0fa of _0x4f0e21){if(_0x4bcafb==null||typeof _0x4bcafb!==_0x5aac10(0xce))throw CliErrors[_0x5aac10(0xdc)](_0x5aac10(0xc8)+_0x588aee);_0x4bcafb=_0x4bcafb[_0x1fb0fa];}if(_0x4bcafb===undefined)throw CliErrors[_0x5aac10(0xdc)](_0x5aac10(0xc8)+_0x588aee);return console[_0x5aac10(0xbe)](typeof _0x4bcafb===_0x5aac10(0xce)?JSON[_0x5aac10(0xe5)](_0x4bcafb,null,0x2):String(_0x4bcafb)),{'ok':!![]};}const _0x94628a=_0x4e3396[_0x588aee];if(_0x94628a===undefined)throw CliErrors[_0x5aac10(0xdc)](_0x5aac10(0xc8)+_0x588aee);return console['log'](typeof _0x94628a===_0x5aac10(0xce)?JSON['stringify'](_0x94628a,null,0x2):String(_0x94628a)),{'ok':!![]};}},setDef={'service':'config','command':a18_0x215860(0xd1),'description':'Set\x20a\x20config\x20value','risk':a18_0x215860(0xd5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]},{'name':a18_0x215860(0xc1),'description':a18_0x215860(0xeb),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x11910c){const _0x57926d=a18_0x215860,_0x22655b=_0x11910c[_0x57926d(0xb3)][0x0],_0x485c84=_0x11910c[_0x57926d(0xb3)][0x1];if(!_0x22655b||_0x485c84===undefined)throw CliErrors[_0x57926d(0xdc)]('Missing\x20key\x20or\x20value.',_0x57926d(0xd8)+CLI_BIN_NAME+'\x20config\x20set\x20<key>\x20<value>\x20[--global]');if(ENUM_KEYS[_0x22655b]&&!ENUM_KEYS[_0x22655b]['includes'](_0x485c84))throw CliErrors[_0x57926d(0xdc)](_0x57926d(0xb2)+_0x22655b+_0x57926d(0xf3)+ENUM_KEYS[_0x22655b]['join'](',\x20'));if(_0x22655b===_0x57926d(0xb4))throw CliErrors['validation']('\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.');if(_0x22655b===_0x57926d(0xde)){const _0x4ea89d=Number(_0x485c84);if(isNaN(_0x4ea89d)||_0x4ea89d<=0x0)throw CliErrors[_0x57926d(0xdc)](_0x57926d(0xd3));}const _0x1f09e3=resolveWriteScope({'explicitGlobal':_0x11910c[_0x57926d(0xbf)](_0x57926d(0xed)),'policy':'project-or-global-explicit'}),_0x4d88fb=toScopeFlags(_0x1f09e3),_0x4784b4=readScopedConfig(_0x4d88fb),_0x34fc57=parseAliasAppcodeSetKey(_0x22655b);if(!_0x34fc57&&!isTopLevelConfigKey(_0x22655b))throw CliErrors[_0x57926d(0xdc)](_0x57926d(0xf5)+_0x22655b+_0x57926d(0xec),_0x57926d(0xe2)+getTopLevelConfigKeySummary()+_0x57926d(0xbb));return _0x34fc57?setLocalAppAlias(_0x4784b4,_0x34fc57,_0x485c84):_0x4784b4[_0x22655b]=_0x22655b===_0x57926d(0xde)?Number(_0x485c84):_0x485c84,console['log'](_0x57926d(0xe7)+_0x22655b+_0x57926d(0xba)+_0x485c84+'\x22'+(_0x1f09e3==='global'?_0x57926d(0xd9):'')),writeScopedConfig(_0x4784b4,_0x4d88fb),{'ok':!![]};}},deleteDef={'service':a18_0x215860(0xc4),'command':a18_0x215860(0xcb),'description':a18_0x215860(0xd7),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x215860(0xf0),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x4e6193){const _0x29b810=a18_0x215860,_0x1f7862=_0x4e6193[_0x29b810(0xb3)][0x0];if(!_0x1f7862)throw CliErrors[_0x29b810(0xdc)](_0x29b810(0xee),_0x29b810(0xd8)+CLI_BIN_NAME+_0x29b810(0xf2));const _0x458a6f=resolveWriteScope({'explicitGlobal':_0x4e6193[_0x29b810(0xbf)](_0x29b810(0xed)),'policy':_0x29b810(0xe0)}),_0x227e7c=toScopeFlags(_0x458a6f),_0x1e7e6e=readScopedConfig(_0x227e7c),_0x59a306=parseAliasDeleteKey(_0x1f7862);if(_0x59a306){if(!deleteLocalAppAlias(_0x1e7e6e,_0x59a306))throw CliErrors[_0x29b810(0xdc)]('Key\x20not\x20found:\x20'+_0x1f7862);return console[_0x29b810(0xbe)](_0x29b810(0xbd)+_0x1f7862+'`'+(_0x458a6f==='global'?_0x29b810(0xd9):'')),writeScopedConfig(_0x1e7e6e,_0x227e7c),{'ok':!![]};}if(_0x1e7e6e[_0x1f7862]===undefined)throw CliErrors['validation']('Key\x20\x22'+_0x1f7862+_0x29b810(0xd0));return delete _0x1e7e6e[_0x1f7862],console[_0x29b810(0xbe)](_0x29b810(0xbd)+_0x1f7862+'`'+(_0x458a6f===_0x29b810(0xed)?_0x29b810(0xd9):'')),writeScopedConfig(_0x1e7e6e,_0x227e7c),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a19_0x6f89(){var _0x3f2773=['3133408vrESFS','21426OrJXwo','99673VYIuNX','25471emqlEr','2vDAXyt','430yMVQNq','10004148keXVob','330750HonFeP','937468NSoxiO'];a19_0x6f89=function(){return _0x3f2773;};return a19_0x6f89();}(function(_0x21acf7,_0x2fbbd8){var _0x139199=a19_0x4cb5,_0x232439=_0x21acf7();while(!![]){try{var _0xe2b7d5=parseInt(_0x139199(0xb2))/0x1*(-parseInt(_0x139199(0xaa))/0x2)+parseInt(_0x139199(0xad))/0x3+-parseInt(_0x139199(0xae))/0x4+parseInt(_0x139199(0xab))/0x5*(-parseInt(_0x139199(0xb0))/0x6)+parseInt(_0x139199(0xb1))/0x7+-parseInt(_0x139199(0xaf))/0x8+parseInt(_0x139199(0xac))/0x9;if(_0xe2b7d5===_0x2fbbd8)break;else _0x232439['push'](_0x232439['shift']());}catch(_0xd88fca){_0x232439['push'](_0x232439['shift']());}}}(a19_0x6f89,0x43bc1));import{CLI_BIN_NAME}from'../../constant/cli.js';function a19_0x4cb5(_0x372bcf,_0x351978){_0x372bcf=_0x372bcf-0xaa;var _0x6f897d=a19_0x6f89();var _0x4cb5a1=_0x6f897d[_0x372bcf];return _0x4cb5a1;}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_0x12ae43=a20_0x221e;(function(_0x18178e,_0x42190b){const _0x8ca945=a20_0x221e,_0x3aaf6d=_0x18178e();while(!![]){try{const _0x18ac88=-parseInt(_0x8ca945(0x22e))/0x1+-parseInt(_0x8ca945(0x231))/0x2+parseInt(_0x8ca945(0x243))/0x3*(parseInt(_0x8ca945(0x23c))/0x4)+parseInt(_0x8ca945(0x23f))/0x5*(parseInt(_0x8ca945(0x218))/0x6)+-parseInt(_0x8ca945(0x216))/0x7*(-parseInt(_0x8ca945(0x222))/0x8)+-parseInt(_0x8ca945(0x242))/0x9*(-parseInt(_0x8ca945(0x235))/0xa)+parseInt(_0x8ca945(0x205))/0xb*(-parseInt(_0x8ca945(0x202))/0xc);if(_0x18ac88===_0x42190b)break;else _0x3aaf6d['push'](_0x3aaf6d['shift']());}catch(_0x1fe373){_0x3aaf6d['push'](_0x3aaf6d['shift']());}}}(a20_0x1c59,0x3f37f));function a20_0x221e(_0x116cf1,_0x3b3b5e){_0x116cf1=_0x116cf1-0x1f1;const _0x1c59e0=a20_0x1c59();let _0x221e35=_0x1c59e0[_0x116cf1];return _0x221e35;}import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';function a20_0x1c59(){const _0xabcff6=['\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}}','operation','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','22840MSXbHB','\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}]','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','\x20\x20\x20\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}','join','\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$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}}]}','4OSRUhx','\x20\x20WHERE\x20OPERATORS','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','38770LWNbdj','Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','helpExtra','297KEADkj','1253793WunTxs','str','map','\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','Get\x20a\x20single\x20record\x20by\x20ID','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','high-risk-write','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','\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}}','\x20completed\x20in\x20','read','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','params','1716EBnJdf','create','aggregate','37433APWDKr','\x20\x20PAGINATION','\x20\x20AGGREGATE\x20TYPES','\x20\x20EXAMPLES','\x20\x20PARAMS\x20STRUCTURE','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','write','POST','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','getOne','dryRun','description','\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\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','update','\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}}','105cHtwVz','\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}}','24dbRSbj','\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]','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','\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}}]','delete','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','data\x20','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','225312sLnkrv','batchCreate','\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}','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','filter','\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}','Update\x20an\x20existing\x20record','code','now','command','build','data','14318PprxnV','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','risk','373778jwXJEZ'];a20_0x1c59=function(){return _0xabcff6;};return a20_0x1c59();}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_0x12ae43(0x226),'operation':a20_0x12ae43(0x226),'risk':a20_0x12ae43(0x1fc),'paramsRequired':![],'description':'Filter\x20dataset\x20records\x20with\x20query\x20conditions','paramsHint':a20_0x12ae43(0x21d)+'Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','helpExtra':[a20_0x12ae43(0x23d),'\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$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}',a20_0x12ae43(0x1fa),'\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}',a20_0x12ae43(0x215),a20_0x12ae43(0x1f3),'\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_0x12ae43(0x232),a20_0x12ae43(0x217),'','\x20\x20LOGICAL\x20COMBINATORS',a20_0x12ae43(0x23b),a20_0x12ae43(0x237),'','\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)',a20_0x12ae43(0x219),a20_0x12ae43(0x236),a20_0x12ae43(0x213),a20_0x12ae43(0x225),'',a20_0x12ae43(0x206),a20_0x12ae43(0x234),a20_0x12ae43(0x1f9),a20_0x12ae43(0x22f)][a20_0x12ae43(0x239)]('\x0a')},{'command':a20_0x12ae43(0x20f),'operation':a20_0x12ae43(0x20f),'risk':'read','paramsRequired':!![],'description':a20_0x12ae43(0x1f6),'paramsHint':a20_0x12ae43(0x1ff)},{'command':a20_0x12ae43(0x203),'operation':a20_0x12ae43(0x203),'risk':a20_0x12ae43(0x20b),'paramsRequired':!![],'description':a20_0x12ae43(0x21a),'paramsHint':a20_0x12ae43(0x20e)},{'command':a20_0x12ae43(0x223),'operation':a20_0x12ae43(0x223),'risk':a20_0x12ae43(0x20b),'paramsRequired':!![],'description':a20_0x12ae43(0x23e),'paramsHint':'JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27'},{'command':a20_0x12ae43(0x214),'operation':a20_0x12ae43(0x214),'risk':a20_0x12ae43(0x20b),'paramsRequired':!![],'description':a20_0x12ae43(0x228),'paramsHint':a20_0x12ae43(0x1f7)},{'command':a20_0x12ae43(0x21c),'operation':a20_0x12ae43(0x21c),'risk':a20_0x12ae43(0x1f8),'paramsRequired':!![],'description':a20_0x12ae43(0x1f5),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a20_0x12ae43(0x204),'operation':a20_0x12ae43(0x204),'risk':a20_0x12ae43(0x1fc),'paramsRequired':![],'description':a20_0x12ae43(0x20d),'paramsHint':a20_0x12ae43(0x1fe)+a20_0x12ae43(0x240),'helpExtra':[a20_0x12ae43(0x207),a20_0x12ae43(0x227),a20_0x12ae43(0x224),'\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}',a20_0x12ae43(0x220),'\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}',a20_0x12ae43(0x238),'',a20_0x12ae43(0x209),a20_0x12ae43(0x23a),a20_0x12ae43(0x221),a20_0x12ae43(0x21e),a20_0x12ae43(0x200),a20_0x12ae43(0x21b),a20_0x12ae43(0x20a),'',a20_0x12ae43(0x208),a20_0x12ae43(0x1f4),'\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\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter',a20_0x12ae43(0x212),'',a20_0x12ae43(0x1fd)][a20_0x12ae43(0x239)]('\x0a')}];function makeDataCommand(_0x21d052){const _0x491e0b=a20_0x12ae43,_0x1bcef6=_0x491e0b(0x21f)+_0x21d052[_0x491e0b(0x22b)],_0x6d7e5f={'service':_0x491e0b(0x22d),'command':_0x21d052[_0x491e0b(0x22b)],'description':_0x21d052['description'],'risk':_0x21d052[_0x491e0b(0x230)],'helpExtra':_0x21d052[_0x491e0b(0x241)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x21d052['paramsHint']}],'validate':async _0x26630b=>{const _0x47ebea=_0x491e0b;_0x21d052['paramsRequired']&&requireAnyOf(_0x26630b,[_0x47ebea(0x201)],_0x1bcef6),_0x21d052[_0x47ebea(0x233)]===_0x47ebea(0x223)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x26630b[_0x47ebea(0x1f1)](_0x47ebea(0x201))));},async 'execute'(_0x84ebed){const _0x7801bd=_0x491e0b,_0x5267cd=_0x84ebed[_0x7801bd(0x1f1)](_0x7801bd(0x229)),_0x3800ce=_0x21d052[_0x7801bd(0x233)]===_0x7801bd(0x223)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x84ebed[_0x7801bd(0x1f1)](_0x7801bd(0x201)))):parseJsonParams(_0x84ebed[_0x7801bd(0x1f1)](_0x7801bd(0x201)))??{},_0x57b595=Date[_0x7801bd(0x22a)](),_0x5cb85b=await executeData(_0x5267cd,_0x21d052[_0x7801bd(0x233)],_0x3800ce),_0x39284f=Date['now']()-_0x57b595;return{'ok':!![],'data':{'result':_0x5cb85b,'elapsed':_0x39284f},'message':_0x7801bd(0x21f)+_0x21d052['command']+_0x7801bd(0x1fb)+_0x39284f+'ms'};}};return _0x21d052[_0x491e0b(0x230)]!=='read'&&(_0x6d7e5f[_0x491e0b(0x210)]=async _0x1d2c3c=>{const _0x1c3821=_0x491e0b,_0xb3892a=_0x1d2c3c[_0x1c3821(0x1f1)](_0x1c3821(0x229)),_0x3bc524=_0x21d052[_0x1c3821(0x233)]===_0x1c3821(0x223)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x1d2c3c[_0x1c3821(0x1f1)](_0x1c3821(0x201)))):parseJsonParams(_0x1d2c3c[_0x1c3821(0x1f1)](_0x1c3821(0x201)))??{};return dryRun(_0x1c3821(0x20c),'/api/{appCode}/'+_0xb3892a+'/'+_0x21d052['operation'])['body'](_0x3bc524)[_0x1c3821(0x211)]('Preview:\x20data\x20'+_0x21d052[_0x1c3821(0x22b)]+'\x20on\x20dataset\x20'+_0xb3892a)[_0x1c3821(0x22c)]();}),_0x6d7e5f;}export const dataDefinitions=specs[a20_0x12ae43(0x1f2)](makeDataCommand);
|
|
1
|
+
const a20_0x4f4649=a20_0x32e0;(function(_0x486ac6,_0x9cfdc2){const _0x173201=a20_0x32e0,_0x443ccd=_0x486ac6();while(!![]){try{const _0x49a41c=-parseInt(_0x173201(0x19e))/0x1+parseInt(_0x173201(0x15b))/0x2+-parseInt(_0x173201(0x170))/0x3*(-parseInt(_0x173201(0x18f))/0x4)+parseInt(_0x173201(0x16d))/0x5*(parseInt(_0x173201(0x1a4))/0x6)+parseInt(_0x173201(0x171))/0x7*(parseInt(_0x173201(0x17a))/0x8)+-parseInt(_0x173201(0x19b))/0x9+-parseInt(_0x173201(0x166))/0xa;if(_0x49a41c===_0x9cfdc2)break;else _0x443ccd['push'](_0x443ccd['shift']());}catch(_0xb71c52){_0x443ccd['push'](_0x443ccd['shift']());}}}(a20_0x1d43,0xb7cc6));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';function a20_0x1d43(){const _0x4f3b41=['\x20\x20LOGICAL\x20COMBINATORS','command','read','\x20completed\x20in\x20','4159350aNsqUM','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','1437247sfzRlY','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','paramsRequired','build','getOne','\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','560598bdiJok','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','2685386hnNIyk','POST','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','batchCreate','Preview:\x20data\x20','\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}','risk','dryRun','params','9492490fePxpW','filter','now','helpExtra','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','Get\x20a\x20single\x20record\x20by\x20ID','25eebKsC','map','write','726336fbixwc','2149UCoEFF','aggregate','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','\x20on\x20dataset\x20','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','\x20\x20AGGREGATE\x20TYPES','str','Filter\x20dataset\x20records\x20with\x20query\x20conditions','\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','27760Gvlszo','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','\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\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}}]}','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','data','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','\x20\x20EXAMPLES','Update\x20an\x20existing\x20record','update','\x20\x20PARAMS\x20STRUCTURE','\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\x20PAGINATION','\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}}','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','join','create','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\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}}','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','12crsoSo','\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}','/api/{appCode}/','operation','\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}]','code','data\x20','delete'];a20_0x1d43=function(){return _0x4f3b41;};return a20_0x1d43();}import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':'filter','operation':a20_0x4f4649(0x167),'risk':a20_0x4f4649(0x199),'paramsRequired':![],'description':a20_0x4f4649(0x178),'paramsHint':a20_0x4f4649(0x188)+a20_0x4f4649(0x15d),'helpExtra':['\x20\x20WHERE\x20OPERATORS','\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}',a20_0x4f4649(0x18d),'\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$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}',a20_0x4f4649(0x15e),a20_0x4f4649(0x159),a20_0x4f4649(0x187),'\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','',a20_0x4f4649(0x197),a20_0x4f4649(0x17d),'\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_0x4f4649(0x189),a20_0x4f4649(0x158),a20_0x4f4649(0x17c),a20_0x4f4649(0x193),a20_0x4f4649(0x18c),a20_0x4f4649(0x15f),'',a20_0x4f4649(0x186),'\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.',a20_0x4f4649(0x16b),a20_0x4f4649(0x180)][a20_0x4f4649(0x18a)]('\x0a')},{'command':a20_0x4f4649(0x1a2),'operation':a20_0x4f4649(0x1a2),'risk':a20_0x4f4649(0x199),'paramsRequired':!![],'description':a20_0x4f4649(0x16c),'paramsHint':a20_0x4f4649(0x15a)},{'command':a20_0x4f4649(0x18b),'operation':a20_0x4f4649(0x18b),'risk':a20_0x4f4649(0x16f),'paramsRequired':!![],'description':a20_0x4f4649(0x19d),'paramsHint':a20_0x4f4649(0x18e)},{'command':'batchCreate','operation':'batchCreate','risk':a20_0x4f4649(0x16f),'paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','paramsHint':a20_0x4f4649(0x17b)},{'command':a20_0x4f4649(0x183),'operation':'update','risk':'write','paramsRequired':!![],'description':a20_0x4f4649(0x182),'paramsHint':a20_0x4f4649(0x17e)},{'command':a20_0x4f4649(0x196),'operation':a20_0x4f4649(0x196),'risk':'high-risk-write','paramsRequired':!![],'description':'Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','paramsHint':a20_0x4f4649(0x15a)},{'command':a20_0x4f4649(0x172),'operation':a20_0x4f4649(0x172),'risk':a20_0x4f4649(0x199),'paramsRequired':![],'description':a20_0x4f4649(0x16a),'paramsHint':a20_0x4f4649(0x173)+'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_0x4f4649(0x176),'\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}',a20_0x4f4649(0x162),'\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}',a20_0x4f4649(0x190),a20_0x4f4649(0x185),'',a20_0x4f4649(0x184),'\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)',a20_0x4f4649(0x19f),'\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Post-aggregation\x20filters,\x20e.g.\x20[{\x22columnName\x22:\x22total\x22,\x22condition\x22:{\x22$gt\x22:1000}}]','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','',a20_0x4f4649(0x181),a20_0x4f4649(0x175),a20_0x4f4649(0x1a3),'','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter',a20_0x4f4649(0x179),'',a20_0x4f4649(0x19c)]['join']('\x0a')}];function makeDataCommand(_0x56c828){const _0xfe8415=a20_0x4f4649,_0x3fe29e=_0xfe8415(0x195)+_0x56c828[_0xfe8415(0x198)],_0x62e7a6={'service':_0xfe8415(0x17f),'command':_0x56c828[_0xfe8415(0x198)],'description':_0x56c828['description'],'risk':_0x56c828[_0xfe8415(0x163)],'helpExtra':_0x56c828[_0xfe8415(0x169)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x56c828['paramsHint']}],'validate':async _0x3929cd=>{const _0x247261=_0xfe8415;_0x56c828[_0x247261(0x1a0)]&&requireAnyOf(_0x3929cd,[_0x247261(0x165)],_0x3fe29e),_0x56c828[_0x247261(0x192)]===_0x247261(0x160)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x3929cd['str'](_0x247261(0x165))));},async 'execute'(_0x20164d){const _0xe4cefd=_0xfe8415,_0x3ad8cb=_0x20164d['str']('code'),_0x1e9542=_0x56c828[_0xe4cefd(0x192)]===_0xe4cefd(0x160)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x20164d[_0xe4cefd(0x177)]('params'))):parseJsonParams(_0x20164d['str'](_0xe4cefd(0x165)))??{},_0x4c8cb6=Date[_0xe4cefd(0x168)](),_0x3feeca=await executeData(_0x3ad8cb,_0x56c828['operation'],_0x1e9542),_0x3157d0=Date[_0xe4cefd(0x168)]()-_0x4c8cb6;return{'ok':!![],'data':{'result':_0x3feeca,'elapsed':_0x3157d0},'message':_0xe4cefd(0x195)+_0x56c828[_0xe4cefd(0x198)]+_0xe4cefd(0x19a)+_0x3157d0+'ms'};}};return _0x56c828[_0xfe8415(0x163)]!=='read'&&(_0x62e7a6[_0xfe8415(0x164)]=async _0x34ba3b=>{const _0x1ab82b=_0xfe8415,_0x5e3ecc=_0x34ba3b[_0x1ab82b(0x177)](_0x1ab82b(0x194)),_0x572f4c=_0x56c828[_0x1ab82b(0x192)]===_0x1ab82b(0x160)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x34ba3b[_0x1ab82b(0x177)](_0x1ab82b(0x165)))):parseJsonParams(_0x34ba3b[_0x1ab82b(0x177)](_0x1ab82b(0x165)))??{};return dryRun(_0x1ab82b(0x15c),_0x1ab82b(0x191)+_0x5e3ecc+'/'+_0x56c828[_0x1ab82b(0x192)])['body'](_0x572f4c)['description'](_0x1ab82b(0x161)+_0x56c828['command']+_0x1ab82b(0x174)+_0x5e3ecc)[_0x1ab82b(0x1a1)]();}),_0x62e7a6;}function a20_0x32e0(_0x53eabc,_0x5c2e59){_0x53eabc=_0x53eabc-0x158;const _0x1d4328=a20_0x1d43();let _0x32e0e9=_0x1d4328[_0x53eabc];return _0x32e0e9;}export const dataDefinitions=specs[a20_0x4f4649(0x16e)](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x5e122b=a21_0x6adc;(function(_0x2a4c5a,_0x415197){const _0x484b1e=a21_0x6adc,_0x382715=_0x2a4c5a();while(!![]){try{const _0x309a5d=-parseInt(_0x484b1e(0x1e0))/0x1*(-parseInt(_0x484b1e(0x1ff))/0x2)+parseInt(_0x484b1e(0x1ec))/0x3+-parseInt(_0x484b1e(0x1e9))/0x4*(-parseInt(_0x484b1e(0x1e6))/0x5)+parseInt(_0x484b1e(0x1dd))/0x6*(parseInt(_0x484b1e(0x220))/0x7)+parseInt(_0x484b1e(0x1f0))/0x8+parseInt(_0x484b1e(0x204))/0x9+-parseInt(_0x484b1e(0x216))/0xa*(parseInt(_0x484b1e(0x214))/0xb);if(_0x309a5d===_0x415197)break;else _0x382715['push'](_0x382715['shift']());}catch(_0xe21fa7){_0x382715['push'](_0x382715['shift']());}}}(a21_0x22a0,0x53c4f));import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x13960c){const _0x4dc8f6=a21_0x6adc;if(_0x13960c['deleted'])return null;const _0x5a0e06=Boolean(_0x13960c['displayName']!==undefined||_0x13960c[_0x4dc8f6(0x20c)]!==undefined);let _0x12b5de={};if(!_0x5a0e06&&typeof _0x13960c[_0x4dc8f6(0x1eb)]===_0x4dc8f6(0x213))try{_0x12b5de=JSON[_0x4dc8f6(0x1d9)](_0x13960c[_0x4dc8f6(0x1eb)]);}catch{}const _0xfaa526=_0x5a0e06?_0x13960c['name']:_0x13960c[_0x4dc8f6(0x1f3)],_0x4b7e4f=_0x5a0e06?_0x13960c[_0x4dc8f6(0x224)]:_0x13960c['name'],_0xf1d766=_0x5a0e06?_0x13960c['doType']:_0x13960c['type']||_0x13960c[_0x4dc8f6(0x20e)],_0x16bab0=_0x5a0e06?_0x13960c[_0x4dc8f6(0x1f7)]===!![]:_0x12b5de[_0x4dc8f6(0x1f7)]===!![],_0x47e779=_0x5a0e06?_0x13960c[_0x4dc8f6(0x1ef)]===!![]:_0x12b5de['required']===!![],_0x3a8b24=_0x5a0e06?_0x13960c[_0x4dc8f6(0x223)]??null:_0x12b5de[_0x4dc8f6(0x223)]??null,_0x417550={'name':_0xfaa526,'displayName':_0x4b7e4f||_0xfaa526,'type':_0xf1d766,'dbType':_0x13960c[_0x4dc8f6(0x1e4)],'pk':_0x16bab0,'required':_0x47e779,'description':_0x13960c[_0x4dc8f6(0x1e7)]||undefined};return Array[_0x4dc8f6(0x20b)](_0x3a8b24)&&_0x3a8b24[_0x4dc8f6(0x1f1)]>0x0&&(_0x417550[_0x4dc8f6(0x223)]=_0x3a8b24),_0x417550;}function parseJsonMaybe(_0x5de88b){const _0x37ef61=a21_0x6adc;if(typeof _0x5de88b!==_0x37ef61(0x213))return _0x5de88b;try{return JSON[_0x37ef61(0x1d9)](_0x5de88b);}catch{return _0x5de88b;}}function normalizeOperationEntry(_0x397d6e,_0x1877af){const _0x4c6622=a21_0x6adc;if(!_0x1877af||typeof _0x1877af!==_0x4c6622(0x1e2))return null;if(!_0x1877af[_0x4c6622(0x1df)]||!_0x1877af[_0x4c6622(0x1f6)])return null;const _0xa297eb={'name':_0x397d6e,'method':_0x1877af['method'],'path':_0x1877af[_0x4c6622(0x1f6)]};if(_0x1877af['host'])_0xa297eb[_0x4c6622(0x1dc)]=_0x1877af['host'];if(_0x1877af['requestBody']!=null)_0xa297eb['requestBody']=parseJsonMaybe(_0x1877af['requestBody']);if(_0x1877af[_0x4c6622(0x218)]!=null)_0xa297eb[_0x4c6622(0x218)]=parseJsonMaybe(_0x1877af[_0x4c6622(0x218)]);if(_0x1877af[_0x4c6622(0x1e3)]!=null)_0xa297eb[_0x4c6622(0x1e3)]=_0x1877af[_0x4c6622(0x1e3)];if(_0x1877af['afterScriptId']!=null)_0xa297eb[_0x4c6622(0x1fe)]=_0x1877af['afterScriptId'];if(Array['isArray'](_0x1877af[_0x4c6622(0x227)]))_0xa297eb[_0x4c6622(0x227)]=_0x1877af[_0x4c6622(0x227)];if(Array['isArray'](_0x1877af[_0x4c6622(0x226)]))_0xa297eb[_0x4c6622(0x226)]=_0x1877af[_0x4c6622(0x226)];return _0xa297eb;}function summarizeDbtable(_0x20ea06){const _0x400a5d=a21_0x6adc,_0x2f90cc={},_0x4f7f8d=[_0x400a5d(0x207),'dbName',_0x400a5d(0x1e1),_0x400a5d(0x202),_0x400a5d(0x1f7),'allFields',_0x400a5d(0x20a),'createTimeField',_0x400a5d(0x1ea),_0x400a5d(0x219),_0x400a5d(0x222),_0x400a5d(0x200),_0x400a5d(0x208),_0x400a5d(0x210),'dblinkInfoDTO'];for(const _0x2f558e of _0x4f7f8d){if(_0x20ea06[_0x2f558e]!==undefined)_0x2f90cc[_0x2f558e]=_0x20ea06[_0x2f558e];}return typeof _0x2f90cc['allFields']===_0x400a5d(0x213)&&_0x2f90cc[_0x400a5d(0x201)][_0x400a5d(0x1f1)]>0x0&&(_0x2f90cc[_0x400a5d(0x1f4)]=_0x2f90cc[_0x400a5d(0x201)][_0x400a5d(0x20f)](',')[_0x400a5d(0x1f2)](_0x25f56c=>_0x25f56c[_0x400a5d(0x1f5)]())[_0x400a5d(0x20d)](Boolean)),_0x2f90cc;}function normalizeRelatedPages(_0x1705ba){const _0x835896=a21_0x6adc;if(!Array['isArray'](_0x1705ba))return[];return _0x1705ba['filter'](_0x13bd12=>_0x13bd12&&typeof _0x13bd12===_0x835896(0x1e2))[_0x835896(0x1f2)](_0x1d53e9=>({'id':_0x1d53e9['id'],'type':_0x1d53e9[_0x835896(0x215)],'code':_0x1d53e9[_0x835896(0x1f3)],'title':_0x1d53e9[_0x835896(0x1fc)],'deleted':_0x1d53e9[_0x835896(0x1fd)]===!![]}));}function normalizeFallbackFieldName(_0x1d53e7,_0x1ade21){const _0x16b0b8=_0x1d53e7['trim']();if(!_0x16b0b8)return null;return{'name':_0x16b0b8,'displayName':_0x16b0b8,'type':undefined,'dbType':undefined,'pk':_0x16b0b8===_0x1ade21,'required':![],'description':undefined};}function a21_0x6adc(_0x36ebfc,_0x25e10e){_0x36ebfc=_0x36ebfc-0x1d9;const _0x22a04e=a21_0x22a0();let _0x6adc99=_0x22a04e[_0x36ebfc];return _0x6adc99;}async function loadListFieldFallback(_0x5d2a1a,_0x218800){const _0x5e4991=a21_0x6adc;if(!_0x5d2a1a||!_0x218800)return[];try{const _0x3c656f=await listDatasets(_0x5d2a1a,{'code':_0x218800}),_0x3f7b92=_0x3c656f['find'](_0x2e2a6b=>_0x2e2a6b[_0x5e4991(0x1f3)]===_0x218800)??_0x3c656f[0x0],_0x2676eb=_0x3f7b92?.[_0x5e4991(0x1ee)]??{},_0x9ad884=typeof _0x2676eb[_0x5e4991(0x201)]===_0x5e4991(0x213)?_0x2676eb[_0x5e4991(0x201)][_0x5e4991(0x20f)](','):[];return _0x9ad884[_0x5e4991(0x1f2)](_0x4582da=>normalizeFallbackFieldName(_0x4582da,_0x2676eb['pkField']))[_0x5e4991(0x20d)](_0x40adbf=>_0x40adbf!==null);}catch{return[];}}export const datasetDetail={'service':'dataset','command':a21_0x5e122b(0x1f9),'description':'Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','risk':'read','flags':[CODE_FLAG],async 'execute'(_0x260288){const _0x7ee4cb=a21_0x5e122b,_0x43a38c=await getDatasetDetail(_0x260288['str']('code')),_0x2f7011=Array[_0x7ee4cb(0x20b)](_0x43a38c[_0x7ee4cb(0x21a)])?_0x43a38c[_0x7ee4cb(0x21a)]:Array[_0x7ee4cb(0x20b)](_0x43a38c[_0x7ee4cb(0x1da)])?_0x43a38c[_0x7ee4cb(0x1da)]:[];let _0x1fdb2e=_0x2f7011[_0x7ee4cb(0x1f2)](_0x4cf355=>normalizeField(_0x4cf355))[_0x7ee4cb(0x20d)](_0xedff9e=>_0xedff9e!==null);_0x1fdb2e['length']===0x0&&(_0x1fdb2e=await loadListFieldFallback(_0x260288['appCode'],_0x260288['str'](_0x7ee4cb(0x1f3))));const _0x113022=_0x43a38c[_0x7ee4cb(0x1ed)]??{},_0xe5d19b=[];for(const [_0x13e083,_0x58e717]of Object[_0x7ee4cb(0x21d)](_0x113022)){const _0x4a49e9=normalizeOperationEntry(_0x13e083,_0x58e717);if(_0x4a49e9)_0xe5d19b[_0x7ee4cb(0x205)](_0x4a49e9);}const _0x8375f1=_0x43a38c[_0x7ee4cb(0x1ee)]??{},_0x1e08d1=_0x43a38c[_0x7ee4cb(0x1fb)]??{},_0x23128e=_0x8375f1['dbId']!=null?{'id':_0x8375f1[_0x7ee4cb(0x207)],'name':_0x8375f1[_0x7ee4cb(0x1e5)]??null}:undefined;let _0x4ffb0e;return typeof _0x43a38c[_0x7ee4cb(0x1eb)]===_0x7ee4cb(0x213)&&(_0x4ffb0e=parseJsonMaybe(_0x43a38c[_0x7ee4cb(0x1eb)])),{'ok':!![],'data':{'id':_0x43a38c[_0x7ee4cb(0x21c)]??_0x43a38c['id'],'name':_0x43a38c[_0x7ee4cb(0x211)],'code':_0x43a38c[_0x7ee4cb(0x1f8)]||_0x43a38c[_0x7ee4cb(0x1f3)],'doVersion':_0x43a38c[_0x7ee4cb(0x21e)],'description':_0x43a38c['description']||_0x1e08d1[_0x7ee4cb(0x221)]||undefined,'source':_0x43a38c[_0x7ee4cb(0x212)]||_0x1e08d1[_0x7ee4cb(0x1db)],'table':_0x8375f1[_0x7ee4cb(0x1e1)]||_0x1e08d1['tableName'],'datasetKey':_0x8375f1[_0x7ee4cb(0x202)],'pk':_0x8375f1[_0x7ee4cb(0x1f7)],'db':_0x23128e,'dbtable':summarizeDbtable(_0x8375f1),'fields':_0x1fdb2e,'operations':_0xe5d19b,'indexes':Array[_0x7ee4cb(0x20b)](_0x1e08d1['indexes'])?_0x1e08d1[_0x7ee4cb(0x21f)]:[],'relations':Array[_0x7ee4cb(0x20b)](_0x43a38c[_0x7ee4cb(0x1e8)])?_0x43a38c[_0x7ee4cb(0x1e8)]['map'](_0x5791bd=>({'fromField':_0x5791bd[_0x7ee4cb(0x217)],'toDataset':_0x5791bd[_0x7ee4cb(0x1de)],'toCode':_0x5791bd[_0x7ee4cb(0x21b)],'toTable':_0x5791bd[_0x7ee4cb(0x203)],'toField':_0x5791bd['toField'],'labelField':_0x5791bd[_0x7ee4cb(0x225)]||undefined})):[],'relatedPages':normalizeRelatedPages(_0x43a38c[_0x7ee4cb(0x206)]),...Array[_0x7ee4cb(0x20b)](_0x43a38c[_0x7ee4cb(0x1fa)])?{'columnCodeListWithDeleted':_0x43a38c[_0x7ee4cb(0x1fa)]}:{},'formatRules':Array[_0x7ee4cb(0x20b)](_0x43a38c['formatRules'])?_0x43a38c[_0x7ee4cb(0x228)]:[],'validateRules':Array[_0x7ee4cb(0x20b)](_0x43a38c[_0x7ee4cb(0x209)])?_0x43a38c[_0x7ee4cb(0x209)]:[],..._0x4ffb0e!==undefined?{'extend':_0x4ffb0e}:{},'stats':{'fieldCount':_0x1fdb2e[_0x7ee4cb(0x1f1)],'operationCount':_0xe5d19b[_0x7ee4cb(0x1f1)]}}};}};function a21_0x22a0(){const _0x259b31=['title','deleted','afterScriptId','224554QgLSwT','modifierIdField','allFields','datasetKey','toTableName','478305ivqfcv','push','relatedPageInfoList','dbId','modifierNameField','validateRules','logicField','isArray','doType','filter','dataType','split','labelField','name','source','string','4213eNArfX','type','45260sEKlQq','fromField','responseBody','creatorIdField','fields','toDatasetCode','modelId','entries','doVersion','indexes','171311rjotlz','tableComment','creatorNameField','options','displayName','toFieldLabel','responseFields','requestFields','formatRules','parse','properties','sourceType','host','78YBHhGy','toDatasetName','method','2VllwgD','tableName','object','beforeScriptId','dbType','dbName','248305ZCTpoX','description','relations','40DwtZXW','updateTimeField','extend','1853880cBsdTm','operations','dbtableConfig','required','2929272IqBQlw','length','map','code','allFieldNames','trim','path','pkField','modelCode','detail','columnCodeListWithDeleted','dataset'];a21_0x22a0=function(){return _0x259b31;};return a21_0x22a0();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x56d7c9,_0x576be3){const _0x412919=a22_0x3f74,_0x334030=_0x56d7c9();while(!![]){try{const _0x526e50=parseInt(_0x412919(0x15a))/0x1*(parseInt(_0x412919(0x14e))/0x2)+parseInt(_0x412919(0x151))/0x3*(-parseInt(_0x412919(0x150))/0x4)+parseInt(_0x412919(0x158))/0x5*(-parseInt(_0x412919(0x156))/0x6)+-parseInt(_0x412919(0x152))/0x7+-parseInt(_0x412919(0x14f))/0x8*(parseInt(_0x412919(0x153))/0x9)+-parseInt(_0x412919(0x157))/0xa*(parseInt(_0x412919(0x159))/0xb)+-parseInt(_0x412919(0x154))/0xc*(-parseInt(_0x412919(0x155))/0xd);if(_0x526e50===_0x576be3)break;else _0x334030['push'](_0x334030['shift']());}catch(_0x58028b){_0x334030['push'](_0x334030['shift']());}}}(a22_0x509a,0xedb06));import{datasetList}from'../../commands/dataset/list.js';function a22_0x3f74(_0x29c2d5,_0x4e935c){_0x29c2d5=_0x29c2d5-0x14e;const _0x509a71=a22_0x509a();let _0x3f748b=_0x509a71[_0x29c2d5];return _0x3f748b;}import{datasetDetail}from'../../commands/dataset/detail.js';function a22_0x509a(){const _0x2918ce=['315620uyCkLz','12419TewWFK','427895rrnyHC','4SyxEAW','14765696FMmvFM','4713836pRxoio','3KFdxVc','219233BJFlle','9tpfzPf','36NSdeCv','15280421dFArem','24xpZlOQ','890wdpFtZ'];a22_0x509a=function(){return _0x2918ce;};return a22_0x509a();}import{datasetSdkDoc}from'../../commands/dataset/sdk-doc.js';export const datasetDefinitions=[datasetList,datasetDetail,datasetSdkDoc];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x45a6e6=a23_0x5979;(function(_0x575952,_0x1c920e){const _0x5d4db2=a23_0x5979,_0x3b1ce1=_0x575952();while(!![]){try{const _0x35e3c7=-parseInt(_0x5d4db2(0x1a0))/0x1+-parseInt(_0x5d4db2(0x1b8))/0x2*(-parseInt(_0x5d4db2(0x1b5))/0x3)+-parseInt(_0x5d4db2(0x1a7))/0x4*(parseInt(_0x5d4db2(0x1a5))/0x5)+parseInt(_0x5d4db2(0x1a6))/0x6+-parseInt(_0x5d4db2(0x1a9))/0x7*(-parseInt(_0x5d4db2(0x1b4))/0x8)+-parseInt(_0x5d4db2(0x1a1))/0x9*(-parseInt(_0x5d4db2(0x1aa))/0xa)+parseInt(_0x5d4db2(0x1ab))/0xb;if(_0x35e3c7===_0x1c920e)break;else _0x3b1ce1['push'](_0x3b1ce1['shift']());}catch(_0x1a4370){_0x3b1ce1['push'](_0x3b1ce1['shift']());}}}(a23_0x2995,0xc2f43));function a23_0x5979(_0x33f7fa,_0x5aff51){_0x33f7fa=_0x33f7fa-0x19d;const _0x29952d=a23_0x2995();let _0x59799f=_0x29952d[_0x33f7fa];return _0x59799f;}import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';export const datasetList={'service':'dataset','command':a23_0x45a6e6(0x1b3),'description':a23_0x45a6e6(0x1b7),'risk':a23_0x45a6e6(0x1ae),'flags':[{'name':a23_0x45a6e6(0x1b2),'type':a23_0x45a6e6(0x1af),'description':a23_0x45a6e6(0x19d)},{...CODE_FLAG,'required':![],'description':a23_0x45a6e6(0x1b9)}],async 'execute'(_0xdce4b9){const _0x2b813b=a23_0x45a6e6,_0x53cdce=_0xdce4b9[_0x2b813b(0x1b1)](_0x2b813b(0x1b2)),_0x506a7b=_0xdce4b9['str'](_0x2b813b(0x1a4)),_0x51ecf3=await listDatasets(_0xdce4b9['appCode'],{..._0x53cdce&&{'name':_0x53cdce},..._0x506a7b&&{'code':_0x506a7b}});return{'ok':!![],'data':{'total':_0x51ecf3[_0x2b813b(0x1a3)],'datasets':_0x51ecf3[_0x2b813b(0x19e)](_0x18cfd7=>{const _0x4fc10e=_0x2b813b,_0x490312=_0x18cfd7[_0x4fc10e(0x1a8)]??{};return{'id':_0x18cfd7['id'],'code':_0x18cfd7[_0x4fc10e(0x1a4)],'name':_0x18cfd7[_0x4fc10e(0x1b2)],'source':_0x18cfd7[_0x4fc10e(0x1ac)],'description':_0x18cfd7[_0x4fc10e(0x1a2)],'table':_0x490312[_0x4fc10e(0x1b0)],'datasetKey':_0x490312[_0x4fc10e(0x1ad)],'pk':_0x490312['pkField'],'fields':_0x490312[_0x4fc10e(0x1b6)]?_0x490312['allFields']['split'](',')['map'](_0x3939ef=>_0x3939ef[_0x4fc10e(0x19f)]()):[]};})}};}};function a23_0x2995(){const _0x5b6db0=['Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)','map','trim','1332676xIqFyV','927dTwqac','description','length','code','83415CrAGAJ','2708166XvUaxs','332gnyJxv','dbtableConfig','164836pELfxN','40940CMqKuY','20821933kUUqPR','source','datasetKey','read','string','tableName','str','name','list','168NVPBRd','1122QfCgAL','allFields','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','1366qAfuUy','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)'];a23_0x2995=function(){return _0x5b6db0;};return a23_0x2995();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a24_0x57b5(){const _0x578c47=['#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档','sdk-doc','dataset','999fEFGdg','7nfvPwD','3211256tqLQNM','278763pMmLpu','code','appCode','3152096lamfmj','Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','trim','107550KRpCJt','80725gYOtMn','76693TUBJnS','438PsSLsj','4ZqqlWL','18617786HjNerw'];a24_0x57b5=function(){return _0x578c47;};return a24_0x57b5();}function a24_0x183e(_0x22c73e,_0x418e4b){_0x22c73e=_0x22c73e-0xc7;const _0x57b56b=a24_0x57b5();let _0x183efd=_0x57b56b[_0x22c73e];return _0x183efd;}const a24_0x2c5d79=a24_0x183e;(function(_0x16fa45,_0x5e600a){const _0x2d8605=a24_0x183e,_0x1ae620=_0x16fa45();while(!![]){try{const _0x30a39c=-parseInt(_0x2d8605(0xd8))/0x1+parseInt(_0x2d8605(0xc8))/0x2*(parseInt(_0x2d8605(0xd0))/0x3)+-parseInt(_0x2d8605(0xd3))/0x4+parseInt(_0x2d8605(0xd7))/0x5*(parseInt(_0x2d8605(0xc7))/0x6)+-parseInt(_0x2d8605(0xce))/0x7*(parseInt(_0x2d8605(0xcf))/0x8)+-parseInt(_0x2d8605(0xcd))/0x9*(parseInt(_0x2d8605(0xd6))/0xa)+parseInt(_0x2d8605(0xc9))/0xb;if(_0x30a39c===_0x5e600a)break;else _0x1ae620['push'](_0x1ae620['shift']());}catch(_0x40e6ca){_0x1ae620['push'](_0x1ae620['shift']());}}}(a24_0x57b5,0x91c20));import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';const DEFAULT_MARKDOWN=a24_0x2c5d79(0xca);export function formatDatasetSdkMarkdown(_0x1ea227){const _0x3f173b=a24_0x2c5d79,_0x5c74fe=typeof _0x1ea227==='string'?_0x1ea227[_0x3f173b(0xd5)]():'';return _0x5c74fe||DEFAULT_MARKDOWN;}export const datasetSdkDoc={'service':a24_0x2c5d79(0xcc),'command':a24_0x2c5d79(0xcb),'description':'Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','risk':'read','flags':[{...CODE_FLAG,'description':a24_0x2c5d79(0xd4)}],async 'execute'(_0x53e917){const _0x4ab9b8=a24_0x2c5d79,_0x435f5=_0x53e917['str'](_0x4ab9b8(0xd1)),_0x3e95d2=await getDatasetSdkUsageDoc(_0x435f5,_0x53e917['appCode']);return{'ok':!![],'data':{'code':_0x435f5,'appCode':_0x53e917[_0x4ab9b8(0xd2)],'markdown':formatDatasetSdkMarkdown(_0x3e95d2)}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x1995b7=a25_0x5cad;(function(_0x3337b1,_0x4b10d0){const _0x2abd40=a25_0x5cad,_0x28a34b=_0x3337b1();while(!![]){try{const _0x40743c=parseInt(_0x2abd40(0x12b))/0x1*(parseInt(_0x2abd40(0x13c))/0x2)+-parseInt(_0x2abd40(0x132))/0x3+parseInt(_0x2abd40(0x138))/0x4+-parseInt(_0x2abd40(0x134))/0x5+-parseInt(_0x2abd40(0xfd))/0x6*(-parseInt(_0x2abd40(0x13e))/0x7)+parseInt(_0x2abd40(0xec))/0x8+parseInt(_0x2abd40(0x10f))/0x9*(parseInt(_0x2abd40(0x142))/0xa);if(_0x40743c===_0x4b10d0)break;else _0x28a34b['push'](_0x28a34b['shift']());}catch(_0x283a39){_0x28a34b['push'](_0x28a34b['shift']());}}}(a25_0x10af,0x8df23));function a25_0x10af(){const _0xf31fbe=['\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','length','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','(unnamed)','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Session\x20check:\x20\x20\x20','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','commandCount','accessKey','✓\x20Valid\x20JSON','\x20\x20Config\x20JSON','57492AlCdSV','(default:\x20','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','Global','\x20\x20─','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','\x20(accessKey)','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','green','repeat','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','(default)','appCode','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','(set,\x20length=','gray','\x20(legacy/compat\x20only)','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20API\x20Endpoints','platform','env','⚠\x20Empty','message','read','\x20commands)','status','(none)','(no\x20file)','5521QiAXUR','✗\x20Invalid','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','ClientAk','(not\x20found)','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','✓\x20Loaded','1814895BNbRCV','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','4383420zqFhzH','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','format','registryPath','474452xgIduw','bold','yellow','doctor','130cGCobL','pageSize','1253TolTfg','riskLevel','locale','services','1930zatNhV','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','arch','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','705088zrOwvA','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','version','\x20doctor','padEnd','currentApp','⚠\x20Empty\x20(treated\x20as\x20{})','(not\x20set)','missing','\x20\x20auth\x20(effective):\x20','\x20\x20Service\x20Tree','log','red','check','defaultApp','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','verbose','8868TrrnGE','empty','\x20\x20Auth','name','serviceCode'];a25_0x10af=function(){return _0xf31fbe;};return a25_0x10af();}import a25_0x12fb29 from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';import{inspectServiceRegistry}from'../commands/service/registry.js';async function execute(_0x55423b){const _0x599132=a25_0x5cad,_0x2cec04=getCliVersion(),_0x5cf7dc=buildConfigFromFlags({});await initGlobalEnvironment(_0x5cf7dc),console['log'](),console[_0x599132(0xf7)](a25_0x12fb29['bold'](CLI_BIN_NAME+_0x599132(0xef))),console[_0x599132(0xf7)](a25_0x12fb29[_0x599132(0x11e)]('─'[_0x599132(0x118)](0x32))),console[_0x599132(0xf7)](_0x599132(0xfb)+_0x2cec04),console[_0x599132(0xf7)](_0x599132(0x120)+process[_0x599132(0xee)]),console['log'](_0x599132(0x111)+process[_0x599132(0x122)]+'\x20'+process[_0x599132(0xea)]),console['log'](),console[_0x599132(0xf7)](a25_0x12fb29[_0x599132(0x139)]('\x20\x20Config\x20Files')),console['log'](a25_0x12fb29[_0x599132(0x11e)]('\x20\x20─'[_0x599132(0x118)](0x1e)));const _0x46b0f1=getGlobalConfigPath(),_0x4b3255=getProjectConfigPath();console[_0x599132(0xf7)](_0x599132(0x12d)+(_0x46b0f1||a25_0x12fb29[_0x599132(0x11e)]('(not\x20found)'))),console['log'](_0x599132(0x107)+(_0x4b3255||a25_0x12fb29[_0x599132(0x11e)](_0x599132(0x12f)))),console[_0x599132(0xf7)](),console['log'](a25_0x12fb29[_0x599132(0x139)](_0x599132(0x10e))),console[_0x599132(0xf7)](a25_0x12fb29[_0x599132(0x11e)](_0x599132(0x113)['repeat'](0x1e)));const _0x1bfd56=(_0x53a012,_0x5651af)=>{const _0x4e82db=_0x599132;if(!_0x5651af){console[_0x4e82db(0xf7)]('\x20\x20'+_0x53a012[_0x4e82db(0xf0)](0x11)+'\x20'+a25_0x12fb29[_0x4e82db(0x11e)](_0x4e82db(0x12a)));return;}const _0x4e538e=inspectCliConfigJsonFile(_0x5651af);if(_0x4e538e[_0x4e82db(0x128)]==='ok')console[_0x4e82db(0xf7)]('\x20\x20'+_0x53a012['padEnd'](0x11)+'\x20'+a25_0x12fb29[_0x4e82db(0x117)](_0x4e82db(0x10d)));else{if(_0x4e538e[_0x4e82db(0x128)]===_0x4e82db(0xfe))console[_0x4e82db(0xf7)]('\x20\x20'+_0x53a012[_0x4e82db(0xf0)](0x11)+'\x20'+a25_0x12fb29['yellow'](_0x4e82db(0xf2)));else _0x4e538e['status']==='missing'?console[_0x4e82db(0xf7)]('\x20\x20'+_0x53a012[_0x4e82db(0xf0)](0x11)+'\x20'+a25_0x12fb29[_0x4e82db(0x11e)]('(missing)')):(console['log']('\x20\x20'+_0x53a012[_0x4e82db(0xf0)](0x11)+'\x20'+a25_0x12fb29['red']('✗\x20Invalid\x20JSON')),console[_0x4e82db(0xf7)]('\x20\x20'+''[_0x4e82db(0xf0)](0x11)+'\x20'+a25_0x12fb29['red'](_0x4e538e[_0x4e82db(0x125)])));}};_0x1bfd56(_0x599132(0x112),_0x46b0f1),_0x1bfd56('Project',_0x4b3255),console[_0x599132(0xf7)](),console[_0x599132(0xf7)](a25_0x12fb29[_0x599132(0x139)]('\x20\x20Merged\x20Config')),console[_0x599132(0xf7)](a25_0x12fb29[_0x599132(0x11e)](_0x599132(0x113)['repeat'](0x1e))),console['log']('\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x5cf7dc[_0x599132(0x11b)]||a25_0x12fb29[_0x599132(0xf8)](_0x599132(0xf3)))),console[_0x599132(0xf7)]('\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x5cf7dc[_0x599132(0x123)]);const _0xfcbe18=isLegacyCompatConfigKey(_0x599132(0x140))?a25_0x12fb29[_0x599132(0x11e)](_0x5cf7dc[_0x599132(0x140)]+_0x599132(0x11f)):_0x5cf7dc[_0x599132(0x140)];console[_0x599132(0xf7)](_0x599132(0x130)+_0xfcbe18),console[_0x599132(0xf7)](_0x599132(0x10a)+(_0x5cf7dc[_0x599132(0xfa)]||a25_0x12fb29[_0x599132(0x11e)]('(none)'))),console['log'](_0x599132(0x106)+(_0x5cf7dc[_0x599132(0xf1)]||a25_0x12fb29[_0x599132(0x11e)](_0x599132(0x129)))),console[_0x599132(0xf7)](_0x599132(0xeb)+(_0x5cf7dc[_0x599132(0x136)]||a25_0x12fb29[_0x599132(0x11e)](_0x599132(0x110)+DEFAULT_CONFIG_VALUES[_0x599132(0x136)]+')'))),console[_0x599132(0xf7)](_0x599132(0x133)+(_0x5cf7dc[_0x599132(0x13d)]??a25_0x12fb29['gray'](_0x599132(0x11a)))),console['log'](_0x599132(0x11c)+_0x5cf7dc[_0x599132(0x13f)]),console['log'](_0x599132(0x104)+_0x5cf7dc[_0x599132(0xfc)]),console[_0x599132(0xf7)](_0x599132(0xf5)+AUTH_MODE[_0x599132(0x12e)]),console['log'](_0x599132(0xe9)+(_0x5cf7dc['accessKey']?a25_0x12fb29[_0x599132(0x117)](_0x599132(0x11d)+_0x5cf7dc[_0x599132(0x10c)][_0x599132(0x103)]+')'):a25_0x12fb29['gray'](_0x599132(0x129)))),console[_0x599132(0xf7)](),console['log'](a25_0x12fb29[_0x599132(0x139)](_0x599132(0x121))),console[_0x599132(0xf7)](a25_0x12fb29['gray'](_0x599132(0x113)[_0x599132(0x118)](0x1e))),console[_0x599132(0xf7)](_0x599132(0x109)+getApiDomain()),console['log'](_0x599132(0x102)+getUserDomain()),console[_0x599132(0xf7)]('\x20\x20runtimeDomain:\x20\x20\x20'+getRuntimeDomain()),console[_0x599132(0xf7)](),console[_0x599132(0xf7)](a25_0x12fb29[_0x599132(0x139)](_0x599132(0xf6))),console[_0x599132(0xf7)](a25_0x12fb29['gray']('\x20\x20─'[_0x599132(0x118)](0x1e)));const _0x2c9f7d=inspectServiceRegistry();console['log'](_0x599132(0x119)+_0x2c9f7d[_0x599132(0x137)]),console['log'](_0x599132(0x116)+formatServiceRegistryStatus(_0x2c9f7d)),console['log'](_0x599132(0x114)+_0x2c9f7d['serviceCount']),console[_0x599132(0xf7)](_0x599132(0xed)+_0x2c9f7d[_0x599132(0x10b)]);for(const _0x52bd87 of _0x2c9f7d[_0x599132(0x141)]){console[_0x599132(0xf7)]('\x20\x20'+(_0x52bd87[_0x599132(0x101)]+':')[_0x599132(0xf0)](0x11)+'\x20'+(_0x52bd87[_0x599132(0x100)]||a25_0x12fb29[_0x599132(0x11e)](_0x599132(0x105)))+'\x20('+_0x52bd87[_0x599132(0x10b)]+_0x599132(0x127)),console[_0x599132(0xf7)]('\x20\x20'+''[_0x599132(0xf0)](0x11)+'\x20Imported\x20from:\x20'+_0x52bd87['source']['path']);}return console[_0x599132(0xf7)](),console[_0x599132(0xf7)](a25_0x12fb29[_0x599132(0x139)](_0x599132(0xff))),console[_0x599132(0xf7)](a25_0x12fb29[_0x599132(0x11e)](_0x599132(0x113)[_0x599132(0x118)](0x1e))),console[_0x599132(0xf7)](_0x599132(0x135)+a25_0x12fb29[_0x599132(0x117)](AUTH_MODE[_0x599132(0x12e)]+_0x599132(0x115))),console[_0x599132(0xf7)](_0x599132(0x108)+a25_0x12fb29[_0x599132(0x11e)]('(removed\x20—\x20cookie\x20auth\x20disabled)')),console[_0x599132(0xf7)](),{'ok':!![]};}function a25_0x5cad(_0x1929cc,_0x4d5338){_0x1929cc=_0x1929cc-0xe9;const _0x10aff9=a25_0x10af();let _0x5cad7d=_0x10aff9[_0x1929cc];return _0x5cad7d;}function formatServiceRegistryStatus(_0x27de7e){const _0x21aaef=a25_0x5cad;if(_0x27de7e['status']==='ok')return a25_0x12fb29[_0x21aaef(0x117)](_0x21aaef(0x131));if(_0x27de7e[_0x21aaef(0x128)]===_0x21aaef(0xf4))return a25_0x12fb29[_0x21aaef(0x11e)](_0x21aaef(0x12f));if(_0x27de7e[_0x21aaef(0x128)]===_0x21aaef(0xfe))return a25_0x12fb29[_0x21aaef(0x13a)](_0x21aaef(0x124));return a25_0x12fb29[_0x21aaef(0xf8)](_0x21aaef(0x12c)+(_0x27de7e[_0x21aaef(0x125)]?':\x20'+_0x27de7e[_0x21aaef(0x125)]:''));}export const doctorDefinition={'service':a25_0x1995b7(0x13b),'command':a25_0x1995b7(0xf9),'description':'Diagnose\x20CLI\x20configuration\x20and\x20environment','risk':a25_0x1995b7(0x126),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0xda1409=a26_0x1967;(function(_0x299302,_0x8fc697){const _0x259983=a26_0x1967,_0x3cf5d2=_0x299302();while(!![]){try{const _0x397056=parseInt(_0x259983(0x14e))/0x1*(parseInt(_0x259983(0x133))/0x2)+-parseInt(_0x259983(0x163))/0x3*(parseInt(_0x259983(0x159))/0x4)+-parseInt(_0x259983(0x140))/0x5*(parseInt(_0x259983(0x156))/0x6)+-parseInt(_0x259983(0x164))/0x7*(-parseInt(_0x259983(0x15b))/0x8)+parseInt(_0x259983(0x153))/0x9+parseInt(_0x259983(0x15e))/0xa*(parseInt(_0x259983(0x168))/0xb)+-parseInt(_0x259983(0x16b))/0xc;if(_0x397056===_0x8fc697)break;else _0x3cf5d2['push'](_0x3cf5d2['shift']());}catch(_0x3f9596){_0x3cf5d2['push'](_0x3cf5d2['shift']());}}}(a26_0x5d39,0xb12a6));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';function a26_0x1967(_0x1599ee,_0x12bcd5){_0x1599ee=_0x1599ee-0x12c;const _0x5d39f5=a26_0x5d39();let _0x196793=_0x5d39f5[_0x1599ee];return _0x196793;}import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';function a26_0x5d39(){const _0x101bef=['app','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','User\x20aborted\x20prompt','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','message','toLowerCase','5chuoYo','Write\x20to\x20global\x20(~/','env','cwd','\x20init\x20—\x20Create\x20','race','removeListener','entries','close','File\x20','once','Imported\x20from\x20','cancelled','appcode','1ZiSwNG','parse','\x0aInitialized\x20','global','\x22.\x20Allowed:\x20','545112bBtriv','riskLevel','file','7536762OrNiHD','Override\x20imported\x20default\x20appcode','question','4LHwfps','Source\x20file\x20not\x20found:\x20','16CaZAzg','validation','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','20esdzSc',')\x20instead\x20of\x20project','):\x20','Failed\x20to\x20parse\x20source\x20file:\x20','Initialized\x20','1940289LKjNlS','4290209UOtaiI','boolean','stdout','App\x20code\x20for\x20the\x20project','1432706jbmRWe','Invalid\x20env\x20\x22','log','1151424rEmJYQ','project','apiDir','[y/N]','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','stdin','\x20\x20env:\x20\x20\x20\x20\x20','newConfigFileName','\x20already\x20exists.\x20Overwrite?','SIGINT','includes','Override\x20imported\x20default\x20env','flagMissing','trim','App\x20code\x20cannot\x20be\x20empty.','name','Skip\x20confirmation\x20when\x20overwriting','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','defaultApp','yes','2355356JHUcdQ','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','apps','string','\x20\x20appcode:\x20','Usage:\x20','utf8'];a26_0x5d39=function(){return _0x101bef;};return a26_0x5d39();}export const initCreateFlagDefs=[{'name':a26_0xda1409(0x14d),'type':a26_0xda1409(0x136),'description':a26_0xda1409(0x167)},{'name':a26_0xda1409(0x142),'type':a26_0xda1409(0x136),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES[a26_0xda1409(0x142)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0xda1409(0x151),'type':a26_0xda1409(0x165),'description':a26_0xda1409(0x141)+PRODUCT_CONFIG[a26_0xda1409(0x172)]+a26_0xda1409(0x15f),'default':![]},{'name':a26_0xda1409(0x132),'type':'boolean','description':a26_0xda1409(0x12f),'default':![]}];export const initImportFlagDefs=[{'name':a26_0xda1409(0x155),'type':a26_0xda1409(0x136),'description':a26_0xda1409(0x134),'required':!![]},{'name':a26_0xda1409(0x14d),'type':a26_0xda1409(0x136),'description':a26_0xda1409(0x157)},{'name':a26_0xda1409(0x142),'type':a26_0xda1409(0x136),'description':a26_0xda1409(0x176),'enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0xda1409(0x151),'type':a26_0xda1409(0x165),'description':a26_0xda1409(0x141)+PRODUCT_CONFIG[a26_0xda1409(0x172)]+a26_0xda1409(0x15f),'default':![]},{'name':'yes','type':a26_0xda1409(0x165),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x403e7e){const _0x376a2d=a26_0xda1409,_0x2b152c=isNonInteractiveMode(_0x403e7e),_0x3a605f=_0x403e7e[_0x376a2d(0x151)]?_0x376a2d(0x151):_0x376a2d(0x16c),_0x411043=resolveWriteConfigPath(_0x3a605f);try{_0x2b152c?await runNonInteractive(_0x403e7e,_0x411043):await runInteractive(_0x403e7e,_0x411043);}catch(_0x1ac713){if(_0x1ac713 instanceof AbortPrompt)throw CliErrors[_0x376a2d(0x14c)]();throw _0x1ac713;}}export async function runInitImport(_0x172877){const _0x1845d6=a26_0xda1409,_0x37fd53=_0x172877[_0x1845d6(0x151)]?_0x1845d6(0x151):_0x1845d6(0x16c),_0x222f94=resolveWriteConfigPath(_0x37fd53);await runFromImport(_0x172877,_0x222f94);}const RUNTIME_IRRELEVANT_KEYS=new Set([a26_0xda1409(0x16d)]);async function runFromImport(_0x8727f8,_0x273cfd){const _0x31a73b=a26_0xda1409,_0x3ffaac=resolveFilePath(_0x8727f8[_0x31a73b(0x155)]);if(!existsSync(_0x3ffaac))throw CliErrors[_0x31a73b(0x15c)](_0x31a73b(0x15a)+_0x3ffaac);const _0x237cdf=readSourceFile(_0x3ffaac),_0x5bce76=convertToRuntimeConfig(_0x237cdf);_0x8727f8['appcode']&&(_0x5bce76[_0x31a73b(0x14d)]=String(_0x8727f8[_0x31a73b(0x14d)]));_0x8727f8['env']&&(_0x5bce76[_0x31a73b(0x142)]=resolveInitEnv(_0x8727f8));if(!_0x5bce76[_0x31a73b(0x14d)])throw CliErrors[_0x31a73b(0x15c)](_0x31a73b(0x16f),_0x31a73b(0x15d));await writeInitConfig(_0x273cfd,_0x5bce76,_0x8727f8),console['log'](_0x31a73b(0x14b)+_0x3ffaac),console[_0x31a73b(0x16a)]('\x20\x20config:\x20\x20'+_0x273cfd),console['log'](_0x31a73b(0x137)+_0x5bce76[_0x31a73b(0x14d)]);if(_0x5bce76[_0x31a73b(0x131)])console[_0x31a73b(0x16a)]('\x20\x20default:\x20'+_0x5bce76[_0x31a73b(0x131)]);}function convertToRuntimeConfig(_0x49992d){const _0x2bc252=a26_0xda1409;if(_0x49992d[_0x2bc252(0x135)]&&typeof _0x49992d[_0x2bc252(0x135)]==='object')throw CliErrors[_0x2bc252(0x15c)](_0x2bc252(0x130),_0x2bc252(0x13d));const _0x503a51={};for(const _0x451b7d of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x49992d[_0x451b7d]!==undefined&&(_0x503a51[_0x451b7d]=_0x49992d[_0x451b7d]);}return!_0x503a51[_0x2bc252(0x154)]&&(_0x503a51['riskLevel']=DEFAULT_CONFIG_VALUES[_0x2bc252(0x154)]),_0x503a51;}async function runNonInteractive(_0x54184e,_0x5a27d2){const _0x27bd80=a26_0xda1409,_0x10839b=_0x54184e[_0x27bd80(0x14d)];if(!_0x10839b)throw CliErrors[_0x27bd80(0x177)](_0x27bd80(0x14d),_0x27bd80(0x138)+CLI_BIN_NAME+_0x27bd80(0x13b));const _0x535047=resolveInitEnv(_0x54184e);await writeInitConfig(_0x5a27d2,{'appcode':_0x10839b,'env':_0x535047},_0x54184e),console[_0x27bd80(0x16a)](_0x27bd80(0x162)+_0x5a27d2),console['log'](_0x27bd80(0x137)+_0x10839b),console[_0x27bd80(0x16a)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x535047);}async function runInteractive(_0x15117f,_0x348aa6){const _0x48f18f=a26_0xda1409,_0x3292c6=loadExisting(_0x348aa6),_0x562481=typeof _0x3292c6?.['appcode']===_0x48f18f(0x136)?_0x3292c6[_0x48f18f(0x14d)]:'',_0x2025f3=resolveInitEnv(_0x15117f);console[_0x48f18f(0x16a)](CLI_BIN_NAME+_0x48f18f(0x144)+PRODUCT_CONFIG[_0x48f18f(0x172)]+'\x0a');if(existsSync(_0x348aa6)&&!_0x15117f[_0x48f18f(0x132)]){const _0x19121a=await promptYesNo(_0x48f18f(0x149)+_0x348aa6+_0x48f18f(0x173),![]);if(!_0x19121a){console[_0x48f18f(0x16a)]('Aborted.');return;}}const _0x29175a=typeof _0x15117f[_0x48f18f(0x14d)]===_0x48f18f(0x136)?_0x15117f['appcode'][_0x48f18f(0x12c)]():'';let _0x42d4f5=_0x29175a;!_0x42d4f5&&(_0x42d4f5=await promptInput('App\x20code',_0x562481));if(!_0x42d4f5['trim']())throw CliErrors[_0x48f18f(0x15c)](_0x48f18f(0x12d));await writeInitConfig(_0x348aa6,{'appcode':_0x42d4f5[_0x48f18f(0x12c)](),'env':_0x2025f3},_0x15117f),console[_0x48f18f(0x16a)](_0x48f18f(0x150)+_0x348aa6),console['log'](_0x48f18f(0x137)+_0x42d4f5[_0x48f18f(0x12c)]()),console[_0x48f18f(0x16a)](_0x48f18f(0x171)+_0x2025f3);}async function writeInitConfig(_0x299dda,_0x466152,_0x48ae65){const _0x169e2b=a26_0xda1409;let _0x16b48d={};existsSync(_0x299dda)&&!_0x48ae65['yes']&&(_0x16b48d=readConfigFile(_0x299dda));for(const [_0x22c881,_0x3e90e0]of Object[_0x169e2b(0x147)](_0x466152)){_0x3e90e0!==undefined&&(_0x16b48d[_0x22c881]=_0x3e90e0);}if(_0x16b48d[_0x169e2b(0x13a)])delete _0x16b48d[_0x169e2b(0x13a)];writeConfigFile(_0x299dda,_0x16b48d);}class AbortPrompt extends Error{constructor(){const _0x4a5aa1=a26_0xda1409;super(_0x4a5aa1(0x13c)),this[_0x4a5aa1(0x12e)]='AbortPrompt';}}function createSafeRl(){const _0xbe0d18=a26_0xda1409,_0x48e06b=createInterface({'input':process[_0xbe0d18(0x170)],'output':process[_0xbe0d18(0x166)]});let _0x17d7aa;const _0x424a95=new Promise((_0x2da8d4,_0x370fea)=>{const _0x3813ab=_0xbe0d18;_0x17d7aa=()=>{const _0x2b5ae6=a26_0x1967;_0x17d7aa&&(_0x48e06b[_0x2b5ae6(0x146)]('SIGINT',_0x17d7aa),_0x17d7aa=undefined);try{_0x48e06b['close']();}catch{}_0x370fea(new AbortPrompt());},_0x48e06b[_0x3813ab(0x14a)](_0x3813ab(0x174),_0x17d7aa);}),_0x4dc8cc=()=>{const _0x5b91ae=_0xbe0d18;_0x17d7aa&&(_0x48e06b['removeListener'](_0x5b91ae(0x174),_0x17d7aa),_0x17d7aa=undefined);try{_0x48e06b[_0x5b91ae(0x148)]();}catch{}};return{'rl':_0x48e06b,'abortPromise':_0x424a95,'disposeSuccess':_0x4dc8cc};}async function promptInput(_0x434545,_0xa8b5bb){const _0x525602=a26_0xda1409,{rl:_0x5bf3b0,abortPromise:_0x42a405,disposeSuccess:_0x31de20}=createSafeRl(),_0x54e7cb=new Promise(_0x11416c=>{const _0x1675f0=a26_0x1967,_0x106fbb=_0xa8b5bb?'\x20\x20'+_0x434545+'\x20('+_0xa8b5bb+_0x1675f0(0x160):'\x20\x20'+_0x434545+':\x20';_0x5bf3b0['question'](_0x106fbb,_0x2fa88c=>{const _0x463638=_0x1675f0;_0x31de20(),_0x11416c(_0x2fa88c[_0x463638(0x12c)]()||_0xa8b5bb);});});return Promise[_0x525602(0x145)]([_0x54e7cb,_0x42a405]);}async function promptYesNo(_0x1ff6a5,_0x26b887){const _0x3a7281=a26_0xda1409,{rl:_0x12379c,abortPromise:_0x4e03f1,disposeSuccess:_0x304ebe}=createSafeRl(),_0x4c9378=new Promise(_0x59ca95=>{const _0x3f2969=a26_0x1967,_0x2293eb=_0x26b887?'[Y/n]':_0x3f2969(0x16e);_0x12379c[_0x3f2969(0x158)]('\x20\x20'+_0x1ff6a5+'\x20'+_0x2293eb+':\x20',_0x2dd07f=>{const _0x3d52c0=_0x3f2969;_0x304ebe();const _0x1b03a3=_0x2dd07f[_0x3d52c0(0x12c)]()[_0x3d52c0(0x13f)]();if(_0x1b03a3==='y'||_0x1b03a3===_0x3d52c0(0x132))_0x59ca95(!![]);else{if(_0x1b03a3==='n'||_0x1b03a3==='no')_0x59ca95(![]);else _0x59ca95(_0x26b887);}});});return Promise[_0x3a7281(0x145)]([_0x4c9378,_0x4e03f1]);}function loadExisting(_0xa5a38b){if(!existsSync(_0xa5a38b))return null;return readConfigFile(_0xa5a38b);}function resolveFilePath(_0xce89d5){const _0x62bd38=a26_0xda1409;return isAbsolute(_0xce89d5)?_0xce89d5:resolve(process[_0x62bd38(0x143)](),_0xce89d5);}function readSourceFile(_0x28088d){const _0xfbfd6f=a26_0xda1409;try{const _0x506420=readFileSync(_0x28088d,{'encoding':_0xfbfd6f(0x139)});return JSON[_0xfbfd6f(0x14f)](_0x506420);}catch(_0x1bf6fc){throw CliErrors[_0xfbfd6f(0x15c)](_0xfbfd6f(0x161)+_0x1bf6fc[_0xfbfd6f(0x13e)]);}}function resolveInitEnv(_0x47f637){const _0x1fe813=a26_0xda1409,_0x491f68=_0x47f637[_0x1fe813(0x142)];if(_0x491f68===undefined||_0x491f68==='')return DEFAULT_CONFIG_VALUES[_0x1fe813(0x142)];if(!RUNTIME_ENV_VALUES[_0x1fe813(0x175)](_0x491f68))throw CliErrors['validation'](_0x1fe813(0x169)+_0x491f68+_0x1fe813(0x152)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x491f68;}
|
|
1
|
+
const a26_0x11b204=a26_0x2d68;(function(_0x20acf3,_0x1a6519){const _0x5c7d2b=a26_0x2d68,_0x2827b5=_0x20acf3();while(!![]){try{const _0xa28a94=parseInt(_0x5c7d2b(0x146))/0x1*(parseInt(_0x5c7d2b(0x137))/0x2)+-parseInt(_0x5c7d2b(0x160))/0x3*(parseInt(_0x5c7d2b(0x142))/0x4)+parseInt(_0x5c7d2b(0x13c))/0x5*(-parseInt(_0x5c7d2b(0x14d))/0x6)+parseInt(_0x5c7d2b(0x135))/0x7*(parseInt(_0x5c7d2b(0x157))/0x8)+-parseInt(_0x5c7d2b(0x139))/0x9+parseInt(_0x5c7d2b(0x15d))/0xa*(parseInt(_0x5c7d2b(0x148))/0xb)+parseInt(_0x5c7d2b(0x13f))/0xc*(parseInt(_0x5c7d2b(0x168))/0xd);if(_0xa28a94===_0x1a6519)break;else _0x2827b5['push'](_0x2827b5['shift']());}catch(_0xa0db84){_0x2827b5['push'](_0x2827b5['shift']());}}}(a26_0x2788,0x42e02));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';function a26_0x2d68(_0x1cacf0,_0x4becef){_0x1cacf0=_0x1cacf0-0x132;const _0x2788ef=a26_0x2788();let _0x2d6835=_0x2788ef[_0x1cacf0];return _0x2d6835;}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':'appcode','type':'string','description':a26_0x11b204(0x174)},{'name':'env','type':a26_0x11b204(0x169),'description':a26_0x11b204(0x14b)+DEFAULT_CONFIG_VALUES[a26_0x11b204(0x132)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x11b204(0x149),'type':'boolean','description':a26_0x11b204(0x143)+PRODUCT_CONFIG[a26_0x11b204(0x13d)]+a26_0x11b204(0x156),'default':![]},{'name':a26_0x11b204(0x147),'type':a26_0x11b204(0x16c),'description':a26_0x11b204(0x141),'default':![]}];export const initImportFlagDefs=[{'name':a26_0x11b204(0x159),'type':a26_0x11b204(0x169),'description':a26_0x11b204(0x15a),'required':!![]},{'name':'appcode','type':a26_0x11b204(0x169),'description':a26_0x11b204(0x145)},{'name':a26_0x11b204(0x132),'type':a26_0x11b204(0x169),'description':a26_0x11b204(0x136),'enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x11b204(0x149),'type':'boolean','description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a26_0x11b204(0x13d)]+a26_0x11b204(0x156),'default':![]},{'name':'yes','type':a26_0x11b204(0x16c),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x4101c4){const _0xfb9b16=a26_0x11b204,_0x2bd8f6=isNonInteractiveMode(_0x4101c4),_0xb1b711=_0x4101c4[_0xfb9b16(0x149)]?_0xfb9b16(0x149):'project',_0x5e0eaa=resolveWriteConfigPath(_0xb1b711);try{_0x2bd8f6?await runNonInteractive(_0x4101c4,_0x5e0eaa):await runInteractive(_0x4101c4,_0x5e0eaa);}catch(_0x26a115){if(_0x26a115 instanceof AbortPrompt)throw CliErrors[_0xfb9b16(0x167)]();throw _0x26a115;}}export async function runInitImport(_0x3a0ad3){const _0x5cce41=a26_0x11b204,_0x5dcaa0=_0x3a0ad3['global']?_0x5cce41(0x149):'project',_0x355b15=resolveWriteConfigPath(_0x5dcaa0);await runFromImport(_0x3a0ad3,_0x355b15);}const RUNTIME_IRRELEVANT_KEYS=new Set(['apiDir']);async function runFromImport(_0x5d7629,_0x18e0ed){const _0x544a6d=a26_0x11b204,_0x5f17eb=resolveFilePath(_0x5d7629[_0x544a6d(0x159)]);if(!existsSync(_0x5f17eb))throw CliErrors[_0x544a6d(0x14f)]('Source\x20file\x20not\x20found:\x20'+_0x5f17eb);const _0x4a4dd4=readSourceFile(_0x5f17eb),_0x597f6e=convertToRuntimeConfig(_0x4a4dd4);_0x5d7629[_0x544a6d(0x13e)]&&(_0x597f6e[_0x544a6d(0x13e)]=String(_0x5d7629[_0x544a6d(0x13e)]));_0x5d7629[_0x544a6d(0x132)]&&(_0x597f6e[_0x544a6d(0x132)]=resolveInitEnv(_0x5d7629));if(!_0x597f6e[_0x544a6d(0x13e)])throw CliErrors[_0x544a6d(0x14f)]('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.',_0x544a6d(0x171));await writeInitConfig(_0x18e0ed,_0x597f6e,_0x5d7629),console[_0x544a6d(0x15e)]('Imported\x20from\x20'+_0x5f17eb),console[_0x544a6d(0x15e)]('\x20\x20config:\x20\x20'+_0x18e0ed),console[_0x544a6d(0x15e)]('\x20\x20appcode:\x20'+_0x597f6e[_0x544a6d(0x13e)]);if(_0x597f6e[_0x544a6d(0x138)])console[_0x544a6d(0x15e)](_0x544a6d(0x172)+_0x597f6e[_0x544a6d(0x138)]);}function convertToRuntimeConfig(_0x2be1e4){const _0x12f08a=a26_0x11b204;if(_0x2be1e4[_0x12f08a(0x134)]&&typeof _0x2be1e4[_0x12f08a(0x134)]===_0x12f08a(0x164))throw CliErrors[_0x12f08a(0x14f)](_0x12f08a(0x14c),_0x12f08a(0x15c));const _0x153048={};for(const _0x2ad7db of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x2be1e4[_0x2ad7db]!==undefined&&(_0x153048[_0x2ad7db]=_0x2be1e4[_0x2ad7db]);}return!_0x153048[_0x12f08a(0x175)]&&(_0x153048[_0x12f08a(0x175)]=DEFAULT_CONFIG_VALUES[_0x12f08a(0x175)]),_0x153048;}async function runNonInteractive(_0x484f3e,_0x358197){const _0x2e93be=a26_0x11b204,_0x2a101e=_0x484f3e['appcode'];if(!_0x2a101e)throw CliErrors[_0x2e93be(0x163)]('appcode',_0x2e93be(0x166)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x2225a8=resolveInitEnv(_0x484f3e);await writeInitConfig(_0x358197,{'appcode':_0x2a101e,'env':_0x2225a8},_0x484f3e),console['log'](_0x2e93be(0x158)+_0x358197),console[_0x2e93be(0x15e)](_0x2e93be(0x176)+_0x2a101e),console['log']('\x20\x20env:\x20\x20\x20\x20\x20'+_0x2225a8);}async function runInteractive(_0x3fecfc,_0x49b6b6){const _0x2afa76=a26_0x11b204,_0x21ed68=loadExisting(_0x49b6b6),_0x18f40b=typeof _0x21ed68?.[_0x2afa76(0x13e)]==='string'?_0x21ed68['appcode']:'',_0x2ed111=resolveInitEnv(_0x3fecfc);console[_0x2afa76(0x15e)](CLI_BIN_NAME+_0x2afa76(0x153)+PRODUCT_CONFIG[_0x2afa76(0x13d)]+'\x0a');if(existsSync(_0x49b6b6)&&!_0x3fecfc[_0x2afa76(0x147)]){const _0x35d8e5=await promptYesNo(_0x2afa76(0x161)+_0x49b6b6+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x35d8e5){console[_0x2afa76(0x15e)](_0x2afa76(0x16e));return;}}const _0x44060b=typeof _0x3fecfc[_0x2afa76(0x13e)]===_0x2afa76(0x169)?_0x3fecfc[_0x2afa76(0x13e)][_0x2afa76(0x16d)]():'';let _0x1f12ba=_0x44060b;!_0x1f12ba&&(_0x1f12ba=await promptInput(_0x2afa76(0x140),_0x18f40b));if(!_0x1f12ba[_0x2afa76(0x16d)]())throw CliErrors[_0x2afa76(0x14f)]('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x49b6b6,{'appcode':_0x1f12ba[_0x2afa76(0x16d)](),'env':_0x2ed111},_0x3fecfc),console[_0x2afa76(0x15e)](_0x2afa76(0x151)+_0x49b6b6),console[_0x2afa76(0x15e)](_0x2afa76(0x176)+_0x1f12ba[_0x2afa76(0x16d)]()),console[_0x2afa76(0x15e)](_0x2afa76(0x152)+_0x2ed111);}async function writeInitConfig(_0x51b0d8,_0x5002a0,_0x3b5ad2){const _0x205109=a26_0x11b204;let _0x1a7984={};existsSync(_0x51b0d8)&&!_0x3b5ad2[_0x205109(0x147)]&&(_0x1a7984=readConfigFile(_0x51b0d8));for(const [_0x435f50,_0xa48517]of Object['entries'](_0x5002a0)){_0xa48517!==undefined&&(_0x1a7984[_0x435f50]=_0xa48517);}if(_0x1a7984['app'])delete _0x1a7984[_0x205109(0x15b)];writeConfigFile(_0x51b0d8,_0x1a7984);}class AbortPrompt extends Error{constructor(){const _0x599f02=a26_0x11b204;super(_0x599f02(0x144)),this[_0x599f02(0x165)]=_0x599f02(0x15f);}}function createSafeRl(){const _0x456b79=createInterface({'input':process['stdin'],'output':process['stdout']});let _0x2dd817;const _0x3064b0=new Promise((_0x37d7d2,_0x1f8d2a)=>{const _0x548b57=a26_0x2d68;_0x2dd817=()=>{const _0x3f73e5=a26_0x2d68;_0x2dd817&&(_0x456b79[_0x3f73e5(0x133)](_0x3f73e5(0x13b),_0x2dd817),_0x2dd817=undefined);try{_0x456b79[_0x3f73e5(0x170)]();}catch{}_0x1f8d2a(new AbortPrompt());},_0x456b79['once'](_0x548b57(0x13b),_0x2dd817);}),_0x3bc00e=()=>{const _0x4cbf24=a26_0x2d68;_0x2dd817&&(_0x456b79[_0x4cbf24(0x133)](_0x4cbf24(0x13b),_0x2dd817),_0x2dd817=undefined);try{_0x456b79[_0x4cbf24(0x170)]();}catch{}};return{'rl':_0x456b79,'abortPromise':_0x3064b0,'disposeSuccess':_0x3bc00e};}async function promptInput(_0x4e0d1a,_0x3fde28){const _0xe8eb96=a26_0x11b204,{rl:_0x381dd8,abortPromise:_0x368e40,disposeSuccess:_0x3724fc}=createSafeRl(),_0x455ff1=new Promise(_0x46b97b=>{const _0x3b7128=a26_0x2d68,_0x238a43=_0x3fde28?'\x20\x20'+_0x4e0d1a+'\x20('+_0x3fde28+_0x3b7128(0x14a):'\x20\x20'+_0x4e0d1a+':\x20';_0x381dd8[_0x3b7128(0x154)](_0x238a43,_0x13e244=>{_0x3724fc(),_0x46b97b(_0x13e244['trim']()||_0x3fde28);});});return Promise[_0xe8eb96(0x16a)]([_0x455ff1,_0x368e40]);}async function promptYesNo(_0x578fa5,_0x48ddc3){const {rl:_0x332f90,abortPromise:_0x333725,disposeSuccess:_0x683c65}=createSafeRl(),_0x189fed=new Promise(_0x57d29e=>{const _0x373fd4=_0x48ddc3?'[Y/n]':'[y/N]';_0x332f90['question']('\x20\x20'+_0x578fa5+'\x20'+_0x373fd4+':\x20',_0x1c73b6=>{const _0xc0d339=a26_0x2d68;_0x683c65();const _0x31c0ec=_0x1c73b6['trim']()[_0xc0d339(0x14e)]();if(_0x31c0ec==='y'||_0x31c0ec===_0xc0d339(0x147))_0x57d29e(!![]);else{if(_0x31c0ec==='n'||_0x31c0ec==='no')_0x57d29e(![]);else _0x57d29e(_0x48ddc3);}});});return Promise['race']([_0x189fed,_0x333725]);}function loadExisting(_0x412d18){if(!existsSync(_0x412d18))return null;return readConfigFile(_0x412d18);}function resolveFilePath(_0x513582){const _0x4f67c3=a26_0x11b204;return isAbsolute(_0x513582)?_0x513582:resolve(process[_0x4f67c3(0x16b)](),_0x513582);}function readSourceFile(_0x56ba9e){const _0x1b9ed4=a26_0x11b204;try{const _0x1fe070=readFileSync(_0x56ba9e,{'encoding':_0x1b9ed4(0x162)});return JSON['parse'](_0x1fe070);}catch(_0x4eb04c){throw CliErrors[_0x1b9ed4(0x14f)](_0x1b9ed4(0x13a)+_0x4eb04c[_0x1b9ed4(0x155)]);}}function resolveInitEnv(_0x32916c){const _0x537a87=a26_0x11b204,_0x2cc568=_0x32916c[_0x537a87(0x132)];if(_0x2cc568===undefined||_0x2cc568==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x537a87(0x16f)](_0x2cc568))throw CliErrors[_0x537a87(0x14f)](_0x537a87(0x150)+_0x2cc568+_0x537a87(0x173)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x2cc568;}function a26_0x2788(){const _0x292e31=['trim','Aborted.','includes','close','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`.','\x20\x20default:\x20','\x22.\x20Allowed:\x20','App\x20code\x20for\x20the\x20project','riskLevel','\x20\x20appcode:\x20','env','removeListener','apps','69097lRWUfD','Override\x20imported\x20default\x20env','682626WfWSGZ','defaultApp','3302856xQPyTT','Failed\x20to\x20parse\x20source\x20file:\x20','SIGINT','5uExuqb','newConfigFileName','appcode','12zclGZY','App\x20code','Skip\x20confirmation\x20when\x20overwriting','252IWqCQP','Write\x20to\x20global\x20(~/','User\x20aborted\x20prompt','Override\x20imported\x20default\x20appcode','1EOAzpc','yes','22yNyfhg','global','):\x20','Target\x20environment\x20(default\x20','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','2559858PTqfHI','toLowerCase','validation','Invalid\x20env\x20\x22','\x0aInitialized\x20','\x20\x20env:\x20\x20\x20\x20\x20','\x20init\x20—\x20Create\x20','question','message',')\x20instead\x20of\x20project','320fHpZMK','Initialized\x20','file','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','app','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','1680370MIiulv','log','AbortPrompt','13641uhyjxl','File\x20','utf8','flagMissing','object','name','Usage:\x20','cancelled','3663179uzJGQa','string','race','cwd','boolean'];a26_0x2788=function(){return _0x292e31;};return a26_0x2788();}
|