@lovrabet/lovrabet-cli 2.0.14-beta.9 → 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 -0
- 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
|
-
|
|
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 a17_0x2bbd9f=a17_0xe984;(function(_0x1a47c7,_0x10f417){const _0x2888a8=a17_0xe984,_0x1209c2=_0x1a47c7();while(!![]){try{const _0x2f021a=-parseInt(_0x2888a8(0x119))/0x1+-parseInt(_0x2888a8(0xd6))/0x2*(-parseInt(_0x2888a8(0x114))/0x3)+-parseInt(_0x2888a8(0xeb))/0x4+parseInt(_0x2888a8(0x113))/0x5*(parseInt(_0x2888a8(0x107))/0x6)+parseInt(_0x2888a8(0xd8))/0x7+parseInt(_0x2888a8(0xf2))/0x8+parseInt(_0x2888a8(0xdb))/0x9;if(_0x2f021a===_0x10f417)break;else _0x1209c2['push'](_0x1209c2['shift']());}catch(_0x31d058){_0x1209c2['push'](_0x1209c2['shift']());}}}(a17_0x3dfd,0x7a2b8));function a17_0xe984(_0x3bd285,_0x337608){_0x3bd285=_0x3bd285-0xd6;const _0x3dfd5d=a17_0x3dfd();let _0xe98443=_0x3dfd5d[_0x3bd285];return _0xe98443;}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':a17_0x2bbd9f(0xff),'type':a17_0x2bbd9f(0x109),'description':a17_0x2bbd9f(0x10a),'default':![]};function parseAliasAppcodeSetKey(_0x5388d8){const _0x2effcc=a17_0x2bbd9f,_0x4464c6=_0x5388d8[_0x2effcc(0x118)]('.');if(_0x4464c6[_0x2effcc(0xfe)]!==0x3||_0x4464c6[0x0]!==_0x2effcc(0xfc)||_0x4464c6[0x2]!==_0x2effcc(0xfb))return undefined;const _0xb93760=_0x4464c6[0x1]?.[_0x2effcc(0xe9)]();return _0xb93760?_0xb93760:undefined;}function a17_0x3dfd(){const _0x4d22d2=['3915lrCzMn','1461087VcLKgw','pretty','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','split','820791jutlAQ','2cywdEV','Key\x20not\x20found:\x20','6230147KkwUOR','Top-level\x20key\x20\x22','\x20\x20project:\x20','3969324qUdDjd','Deleted\x20`','read','field','Set\x20a\x20config\x20value','args','\x20\x20global:\x20\x20','alias','validation','pageSize\x20must\x20be\x20a\x20positive\x20number','\x20config\x20delete\x20<key>\x20[--global]','key','value','Missing\x20key\x20argument.','trim','pageSize','3913188wDIrbP','Value\x20to\x20assign','\x20(global)','\x20config\x20set\x20<key>\x20<value>\x20[--global]','write','isArray','\x22.\x20Allowed:\x20','3412800cFHdza','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','object','raw','Set\x20`','Key\x20\x22','bool','../../context.js','Missing\x20key\x20or\x20value.','appcode','apps','Settable\x20keys:\x20','length','global','\x20config\x20get\x20<key>','Usage:\x20','includes','join','log','keys','Delete\x20a\x20config\x20value','420lDnMBv','Get\x20a\x20config\x20value','boolean','Write\x20to\x20global\x20config','stringify','`\x20=\x20\x22','config','project-or-global-explicit','List\x20current\x20config','(none)','set','\x22\x20not\x20found\x20at\x20top\x20level.'];a17_0x3dfd=function(){return _0x4d22d2;};return a17_0x3dfd();}function parseAliasDeleteKey(_0x1ccf84){const _0x1ad723=a17_0x2bbd9f,_0x2541e2=_0x1ccf84['split']('.');if(_0x2541e2[_0x1ad723(0xfe)]===0x2&&_0x2541e2[0x0]===_0x1ad723(0xfc)){const _0x517c68=_0x2541e2[0x1]?.[_0x1ad723(0xe9)]();return _0x517c68?{'alias':_0x517c68}:undefined;}if(_0x2541e2[_0x1ad723(0xfe)]===0x3&&_0x2541e2[0x0]===_0x1ad723(0xfc)&&_0x2541e2[0x2]===_0x1ad723(0xfb)){const _0x2d955b=_0x2541e2[0x1]?.[_0x1ad723(0xe9)]();return _0x2d955b?{'alias':_0x2d955b,'field':_0x1ad723(0xfb)}:undefined;}return undefined;}function setLocalAppAlias(_0x421c89,_0x49163a,_0x1d1fe4){const _0x5057b9=a17_0x2bbd9f,_0x51365d=_0x421c89[_0x5057b9(0xfc)]&&typeof _0x421c89['apps']==='object'&&!Array[_0x5057b9(0xf0)](_0x421c89[_0x5057b9(0xfc)])?_0x421c89['apps']:{},_0x103ce6=_0x51365d[_0x49163a]&&typeof _0x51365d[_0x49163a]==='object'&&!Array[_0x5057b9(0xf0)](_0x51365d[_0x49163a])?_0x51365d[_0x49163a]:{};_0x103ce6[_0x5057b9(0xfb)]=_0x1d1fe4,_0x51365d[_0x49163a]=_0x103ce6,_0x421c89[_0x5057b9(0xfc)]=_0x51365d;}function deleteLocalAppAlias(_0x391b88,_0x2663e0){const _0x12f64f=a17_0x2bbd9f;if(!_0x391b88[_0x12f64f(0xfc)]||typeof _0x391b88[_0x12f64f(0xfc)]!=='object'||Array['isArray'](_0x391b88[_0x12f64f(0xfc)]))return![];const _0x8022f6=_0x391b88[_0x12f64f(0xfc)],_0x1c479a=_0x8022f6[_0x2663e0['alias']];if(!_0x1c479a||typeof _0x1c479a!==_0x12f64f(0xf4)||Array[_0x12f64f(0xf0)](_0x1c479a))return![];if(!_0x2663e0['field'])return delete _0x8022f6[_0x2663e0[_0x12f64f(0xe2)]],!![];if(!(_0x2663e0[_0x12f64f(0xde)]in _0x1c479a))return![];return delete _0x1c479a[_0x2663e0[_0x12f64f(0xde)]],Object[_0x12f64f(0x105)](_0x1c479a)['length']===0x0&&delete _0x8022f6[_0x2663e0[_0x12f64f(0xe2)]],!![];}const listDef={'service':'config','command':'list','description':a17_0x2bbd9f(0x10f),'risk':a17_0x2bbd9f(0xdd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x485e23){const _0x355a0f=a17_0x2bbd9f,{buildConfigFromFlags:_0xf1a956}=await import('../../context.js'),_0x595665=_0xf1a956({}),_0x53bf25=getProjectConfigPath(),_0x5d7b92=resolveWriteConfigPath(_0x355a0f(0xff));if(_0x485e23['format']===_0x355a0f(0x115))return{'ok':!![],'message':_0x355a0f(0xf3)+(JSON[_0x355a0f(0x10b)](_0x595665[_0x355a0f(0xf5)],null,0x2)+'\x0a\x0a')+'Config\x20files:\x0a'+(_0x355a0f(0xda)+(_0x53bf25??_0x355a0f(0x110))+'\x0a')+(_0x355a0f(0xe1)+_0x5d7b92)};return{'ok':!![],'data':{'effective':_0x595665[_0x355a0f(0xf5)],'configFiles':{'project':_0x53bf25??null,'global':_0x5d7b92}}};}},getDef={'service':a17_0x2bbd9f(0x10d),'command':'get','description':a17_0x2bbd9f(0x108),'risk':a17_0x2bbd9f(0xdd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':a17_0x2bbd9f(0x116),'required':!![]}],'flags':[],async 'execute'(_0x3a6dd2){const _0x4832fe=a17_0x2bbd9f,_0x49bc5e=_0x3a6dd2[_0x4832fe(0xe0)][0x0];if(!_0x49bc5e)throw CliErrors['validation'](_0x4832fe(0xe8),_0x4832fe(0x101)+CLI_BIN_NAME+_0x4832fe(0x100));const {buildConfigFromFlags:_0x57d213}=await import(_0x4832fe(0xf9)),{raw:_0x2c4414}=_0x57d213({});if(_0x49bc5e[_0x4832fe(0x102)]('.')){const _0x2d421d=_0x49bc5e[_0x4832fe(0x118)]('.');let _0x2cfbca=_0x2c4414;for(const _0x185deb of _0x2d421d){if(_0x2cfbca==null||typeof _0x2cfbca!==_0x4832fe(0xf4))throw CliErrors[_0x4832fe(0xe3)](_0x4832fe(0xd7)+_0x49bc5e);_0x2cfbca=_0x2cfbca[_0x185deb];}if(_0x2cfbca===undefined)throw CliErrors[_0x4832fe(0xe3)](_0x4832fe(0xd7)+_0x49bc5e);return console[_0x4832fe(0x104)](typeof _0x2cfbca===_0x4832fe(0xf4)?JSON[_0x4832fe(0x10b)](_0x2cfbca,null,0x2):String(_0x2cfbca)),{'ok':!![]};}const _0x21f83d=_0x2c4414[_0x49bc5e];if(_0x21f83d===undefined)throw CliErrors[_0x4832fe(0xe3)](_0x4832fe(0xd7)+_0x49bc5e);return console[_0x4832fe(0x104)](typeof _0x21f83d===_0x4832fe(0xf4)?JSON['stringify'](_0x21f83d,null,0x2):String(_0x21f83d)),{'ok':!![]};}},setDef={'service':'config','command':a17_0x2bbd9f(0x111),'description':a17_0x2bbd9f(0xdf),'risk':a17_0x2bbd9f(0xef),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]},{'name':a17_0x2bbd9f(0xe7),'description':a17_0x2bbd9f(0xec),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x15054d){const _0x5468a4=a17_0x2bbd9f,_0x213296=_0x15054d[_0x5468a4(0xe0)][0x0],_0x355fc8=_0x15054d[_0x5468a4(0xe0)][0x1];if(!_0x213296||_0x355fc8===undefined)throw CliErrors[_0x5468a4(0xe3)](_0x5468a4(0xfa),_0x5468a4(0x101)+CLI_BIN_NAME+_0x5468a4(0xee));if(ENUM_KEYS[_0x213296]&&!ENUM_KEYS[_0x213296]['includes'](_0x355fc8))throw CliErrors['validation']('Invalid\x20value\x20for\x20\x22'+_0x213296+_0x5468a4(0xf1)+ENUM_KEYS[_0x213296][_0x5468a4(0x103)](',\x20'));if(_0x213296==='riskLevel')throw CliErrors['validation'](_0x5468a4(0x117));if(_0x213296===_0x5468a4(0xea)){const _0x1e9698=Number(_0x355fc8);if(isNaN(_0x1e9698)||_0x1e9698<=0x0)throw CliErrors[_0x5468a4(0xe3)](_0x5468a4(0xe4));}const _0x460a44=resolveWriteScope({'explicitGlobal':_0x15054d['bool'](_0x5468a4(0xff)),'policy':_0x5468a4(0x10e)}),_0x431df0=toScopeFlags(_0x460a44),_0xed9a31=readScopedConfig(_0x431df0),_0x485771=parseAliasAppcodeSetKey(_0x213296);if(!_0x485771&&!isTopLevelConfigKey(_0x213296))throw CliErrors['validation'](_0x5468a4(0xd9)+_0x213296+'\x22\x20is\x20not\x20settable.',_0x5468a4(0xfd)+getTopLevelConfigKeySummary()+';\x20apps.<alias>.appcode');return _0x485771?setLocalAppAlias(_0xed9a31,_0x485771,_0x355fc8):_0xed9a31[_0x213296]=_0x213296==='pageSize'?Number(_0x355fc8):_0x355fc8,console['log'](_0x5468a4(0xf6)+_0x213296+_0x5468a4(0x10c)+_0x355fc8+'\x22'+(_0x460a44===_0x5468a4(0xff)?_0x5468a4(0xed):'')),writeScopedConfig(_0xed9a31,_0x431df0),{'ok':!![]};}},deleteDef={'service':a17_0x2bbd9f(0x10d),'command':'delete','description':a17_0x2bbd9f(0x106),'risk':a17_0x2bbd9f(0xef),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a17_0x2bbd9f(0xe6),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x26a446){const _0x408299=a17_0x2bbd9f,_0x289106=_0x26a446[_0x408299(0xe0)][0x0];if(!_0x289106)throw CliErrors[_0x408299(0xe3)]('Missing\x20key\x20argument.','Usage:\x20'+CLI_BIN_NAME+_0x408299(0xe5));const _0x4b9df3=resolveWriteScope({'explicitGlobal':_0x26a446[_0x408299(0xf8)]('global'),'policy':_0x408299(0x10e)}),_0x5ba7ed=toScopeFlags(_0x4b9df3),_0xeb1637=readScopedConfig(_0x5ba7ed),_0x4cdcfe=parseAliasDeleteKey(_0x289106);if(_0x4cdcfe){if(!deleteLocalAppAlias(_0xeb1637,_0x4cdcfe))throw CliErrors[_0x408299(0xe3)](_0x408299(0xd7)+_0x289106);return console[_0x408299(0x104)](_0x408299(0xdc)+_0x289106+'`'+(_0x4b9df3===_0x408299(0xff)?'\x20(global)':'')),writeScopedConfig(_0xeb1637,_0x5ba7ed),{'ok':!![]};}if(_0xeb1637[_0x289106]===undefined)throw CliErrors['validation'](_0x408299(0xf7)+_0x289106+_0x408299(0x112));return delete _0xeb1637[_0x289106],console[_0x408299(0x104)](_0x408299(0xdc)+_0x289106+'`'+(_0x4b9df3===_0x408299(0xff)?_0x408299(0xed):'')),writeScopedConfig(_0xeb1637,_0x5ba7ed),{'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 a19_0x3b228d=a19_0x38e3;(function(_0x293f44,_0x212d47){const _0xdee22f=a19_0x38e3,_0x14ffaa=_0x293f44();while(!![]){try{const _0x307c6c=-parseInt(_0xdee22f(0x119))/0x1*(parseInt(_0xdee22f(0x136))/0x2)+parseInt(_0xdee22f(0x12e))/0x3*(parseInt(_0xdee22f(0x149))/0x4)+-parseInt(_0xdee22f(0x123))/0x5+parseInt(_0xdee22f(0x148))/0x6+parseInt(_0xdee22f(0x14f))/0x7+parseInt(_0xdee22f(0x118))/0x8+parseInt(_0xdee22f(0x126))/0x9*(-parseInt(_0xdee22f(0x15b))/0xa);if(_0x307c6c===_0x212d47)break;else _0x14ffaa['push'](_0x14ffaa['shift']());}catch(_0x1fcb1a){_0x14ffaa['push'](_0x14ffaa['shift']());}}}(a19_0xf066,0x596d5));function a19_0xf066(){const _0x3d8b66=['getOne','write','132AdDMRZ','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','Filter\x20dataset\x20records\x20with\x20query\x20conditions','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','params','create','now','\x20\x20LOGICAL\x20COMBINATORS','\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$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\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','\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]','3677316OkUleu','17332WAZnsM','\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\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','join','\x20\x20PARAMS\x20STRUCTURE','\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}','2657424tlQpYg','operation','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','Get\x20a\x20single\x20record\x20by\x20ID','filter','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','/api/{appCode}/','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','command','high-risk-write','\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}}','\x20on\x20dataset\x20','30gzyysb','\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$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}}','read','\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}}','Update\x20an\x20existing\x20record','delete','\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}}','map','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\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}','data','4158952PwpGzx','7334SffJhw','helpExtra','description','build','code','dryRun','risk','str','batchCreate','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','1672370yPOsBx','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','\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}','2815587WkjDjr','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','\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}}','update','\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','423lJESlm','Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\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\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','paramsRequired','\x20\x20EXAMPLES'];a19_0xf066=function(){return _0x3d8b66;};return a19_0xf066();}function a19_0x38e3(_0x156e44,_0xb22e5b){_0x156e44=_0x156e44-0x118;const _0xf06673=a19_0xf066();let _0x38e3ac=_0xf06673[_0x156e44];return _0x38e3ac;}import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':'filter','operation':a19_0x3b228d(0x153),'risk':a19_0x3b228d(0x15e),'paramsRequired':![],'description':a19_0x3b228d(0x13c),'paramsHint':a19_0x3b228d(0x164)+'Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','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}}','\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}}',a19_0x3b228d(0x15d),a19_0x3b228d(0x12b),a19_0x3b228d(0x162),a19_0x3b228d(0x159),'\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]}}',a19_0x3b228d(0x15f),a19_0x3b228d(0x15c),a19_0x3b228d(0x129),'',a19_0x3b228d(0x143),'\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}}]}',a19_0x3b228d(0x145),'',a19_0x3b228d(0x127),a19_0x3b228d(0x156),a19_0x3b228d(0x147),a19_0x3b228d(0x130),a19_0x3b228d(0x13e),a19_0x3b228d(0x128),'','\x20\x20PAGINATION',a19_0x3b228d(0x139),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)'][a19_0x3b228d(0x14c)]('\x0a')},{'command':a19_0x3b228d(0x134),'operation':a19_0x3b228d(0x134),'risk':a19_0x3b228d(0x15e),'paramsRequired':!![],'description':a19_0x3b228d(0x152),'paramsHint':a19_0x3b228d(0x12c)},{'command':a19_0x3b228d(0x141),'operation':a19_0x3b228d(0x141),'risk':a19_0x3b228d(0x135),'paramsRequired':!![],'description':'Create\x20a\x20new\x20record\x20in\x20a\x20dataset','paramsHint':'JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27'},{'command':a19_0x3b228d(0x121),'operation':'batchCreate','risk':a19_0x3b228d(0x135),'paramsRequired':!![],'description':a19_0x3b228d(0x124),'paramsHint':a19_0x3b228d(0x12d)},{'command':a19_0x3b228d(0x12a),'operation':a19_0x3b228d(0x12a),'risk':'write','paramsRequired':!![],'description':a19_0x3b228d(0x160),'paramsHint':a19_0x3b228d(0x154)},{'command':a19_0x3b228d(0x161),'operation':'delete','risk':a19_0x3b228d(0x158),'paramsRequired':!![],'description':a19_0x3b228d(0x122),'paramsHint':a19_0x3b228d(0x12c)},{'command':'aggregate','operation':'aggregate','risk':a19_0x3b228d(0x15e),'paramsRequired':![],'description':a19_0x3b228d(0x151),'paramsHint':a19_0x3b228d(0x13d)+a19_0x3b228d(0x12f),'helpExtra':['\x20\x20AGGREGATE\x20TYPES',a19_0x3b228d(0x14e),'\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}',a19_0x3b228d(0x165),a19_0x3b228d(0x125),a19_0x3b228d(0x13a),a19_0x3b228d(0x138),'',a19_0x3b228d(0x14d),'\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]',a19_0x3b228d(0x14b),a19_0x3b228d(0x146),a19_0x3b228d(0x13b),a19_0x3b228d(0x14a),a19_0x3b228d(0x131),'',a19_0x3b228d(0x133),'\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status',a19_0x3b228d(0x144),'',a19_0x3b228d(0x137),'\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','',a19_0x3b228d(0x13f)][a19_0x3b228d(0x14c)]('\x0a')}];function makeDataCommand(_0x2f58b6){const _0x5b6d15=a19_0x3b228d,_0x39ea0a='data\x20'+_0x2f58b6[_0x5b6d15(0x157)],_0x34e39d={'service':_0x5b6d15(0x166),'command':_0x2f58b6[_0x5b6d15(0x157)],'description':_0x2f58b6[_0x5b6d15(0x11b)],'risk':_0x2f58b6[_0x5b6d15(0x11f)],'helpExtra':_0x2f58b6[_0x5b6d15(0x11a)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x2f58b6['paramsHint']}],'validate':async _0x132bc9=>{const _0x1e9f4c=_0x5b6d15;_0x2f58b6[_0x1e9f4c(0x132)]&&requireAnyOf(_0x132bc9,[_0x1e9f4c(0x140)],_0x39ea0a),_0x2f58b6['operation']==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x132bc9[_0x1e9f4c(0x120)](_0x1e9f4c(0x140))));},async 'execute'(_0x5064f1){const _0x46cb44=_0x5b6d15,_0x302746=_0x5064f1[_0x46cb44(0x120)](_0x46cb44(0x11d)),_0x38f021=_0x2f58b6[_0x46cb44(0x150)]===_0x46cb44(0x121)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x5064f1[_0x46cb44(0x120)](_0x46cb44(0x140)))):parseJsonParams(_0x5064f1[_0x46cb44(0x120)](_0x46cb44(0x140)))??{},_0x22e455=Date[_0x46cb44(0x142)](),_0x2ff486=await executeData(_0x302746,_0x2f58b6[_0x46cb44(0x150)],_0x38f021),_0x16bc41=Date[_0x46cb44(0x142)]()-_0x22e455;return{'ok':!![],'data':{'result':_0x2ff486,'elapsed':_0x16bc41},'message':'data\x20'+_0x2f58b6[_0x46cb44(0x157)]+'\x20completed\x20in\x20'+_0x16bc41+'ms'};}};return _0x2f58b6[_0x5b6d15(0x11f)]!==_0x5b6d15(0x15e)&&(_0x34e39d[_0x5b6d15(0x11e)]=async _0x35f032=>{const _0x2681f2=_0x5b6d15,_0x48e190=_0x35f032[_0x2681f2(0x120)](_0x2681f2(0x11d)),_0x379f01=_0x2f58b6['operation']==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x35f032['str'](_0x2681f2(0x140)))):parseJsonParams(_0x35f032['str'](_0x2681f2(0x140)))??{};return dryRun('POST',_0x2681f2(0x155)+_0x48e190+'/'+_0x2f58b6[_0x2681f2(0x150)])['body'](_0x379f01)[_0x2681f2(0x11b)]('Preview:\x20data\x20'+_0x2f58b6[_0x2681f2(0x157)]+_0x2681f2(0x15a)+_0x48e190)[_0x2681f2(0x11c)]();}),_0x34e39d;}export const dataDefinitions=specs[a19_0x3b228d(0x163)](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
|
-
|
|
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 a25_0x2b6240=a25_0xaac3;(function(_0x4164ac,_0x21f3f0){const _0x59e2de=a25_0xaac3,_0x26b74a=_0x4164ac();while(!![]){try{const _0x2c7c42=-parseInt(_0x59e2de(0xa0))/0x1+-parseInt(_0x59e2de(0x72))/0x2+-parseInt(_0x59e2de(0x7f))/0x3*(-parseInt(_0x59e2de(0x8e))/0x4)+-parseInt(_0x59e2de(0x9a))/0x5+parseInt(_0x59e2de(0x76))/0x6+-parseInt(_0x59e2de(0x79))/0x7+parseInt(_0x59e2de(0x6d))/0x8;if(_0x2c7c42===_0x21f3f0)break;else _0x26b74a['push'](_0x26b74a['shift']());}catch(_0x241916){_0x26b74a['push'](_0x26b74a['shift']());}}}(a25_0x2823,0xa98ba));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';function a25_0xaac3(_0x4e3586,_0x166512){_0x4e3586=_0x4e3586-0x68;const _0x282370=a25_0x2823();let _0xaac328=_0x282370[_0x4e3586];return _0xaac328;}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':a25_0x2b6240(0x97),'description':a25_0x2b6240(0x6a)},{'name':a25_0x2b6240(0x77),'type':a25_0x2b6240(0x97),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES[a25_0x2b6240(0x77)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a25_0x2b6240(0x6f),'type':a25_0x2b6240(0x9b),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a25_0x2b6240(0x80)]+a25_0x2b6240(0x81),'default':![]},{'name':'yes','type':a25_0x2b6240(0x9b),'description':a25_0x2b6240(0x7d),'default':![]}];export const initImportFlagDefs=[{'name':a25_0x2b6240(0x73),'type':a25_0x2b6240(0x97),'description':a25_0x2b6240(0x9c),'required':!![]},{'name':a25_0x2b6240(0x8c),'type':'string','description':a25_0x2b6240(0x7a)},{'name':a25_0x2b6240(0x77),'type':a25_0x2b6240(0x97),'description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':a25_0x2b6240(0x6f),'type':'boolean','description':a25_0x2b6240(0x7b)+PRODUCT_CONFIG[a25_0x2b6240(0x80)]+')\x20instead\x20of\x20project','default':![]},{'name':a25_0x2b6240(0x88),'type':'boolean','description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x3b182e){const _0x3ba0f4=a25_0x2b6240,_0x4e2585=isNonInteractiveMode(_0x3b182e),_0x4b751b=_0x3b182e[_0x3ba0f4(0x6f)]?_0x3ba0f4(0x6f):'project',_0x13d5f8=resolveWriteConfigPath(_0x4b751b);try{_0x4e2585?await runNonInteractive(_0x3b182e,_0x13d5f8):await runInteractive(_0x3b182e,_0x13d5f8);}catch(_0x558485){if(_0x558485 instanceof AbortPrompt)throw CliErrors[_0x3ba0f4(0x71)]();throw _0x558485;}}export async function runInitImport(_0x4b0e55){const _0x4e3b5f=a25_0x2b6240,_0x1b6582=_0x4b0e55[_0x4e3b5f(0x6f)]?_0x4e3b5f(0x6f):'project',_0x53cbdf=resolveWriteConfigPath(_0x1b6582);await runFromImport(_0x4b0e55,_0x53cbdf);}const RUNTIME_IRRELEVANT_KEYS=new Set([a25_0x2b6240(0x69)]);async function runFromImport(_0x35c6f8,_0x12012c){const _0x59011e=a25_0x2b6240,_0x43e16d=resolveFilePath(_0x35c6f8[_0x59011e(0x73)]);if(!existsSync(_0x43e16d))throw CliErrors[_0x59011e(0xa4)]('Source\x20file\x20not\x20found:\x20'+_0x43e16d);const _0xd3d3a3=readSourceFile(_0x43e16d),_0xa1cd0f=convertToRuntimeConfig(_0xd3d3a3);_0x35c6f8[_0x59011e(0x8c)]&&(_0xa1cd0f[_0x59011e(0x8c)]=String(_0x35c6f8[_0x59011e(0x8c)]));_0x35c6f8['env']&&(_0xa1cd0f[_0x59011e(0x77)]=resolveInitEnv(_0x35c6f8));if(!_0xa1cd0f[_0x59011e(0x8c)])throw CliErrors[_0x59011e(0xa4)]('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.',_0x59011e(0x93));await writeInitConfig(_0x12012c,_0xa1cd0f,_0x35c6f8),console[_0x59011e(0x7c)](_0x59011e(0x96)+_0x43e16d),console[_0x59011e(0x7c)]('\x20\x20config:\x20\x20'+_0x12012c),console[_0x59011e(0x7c)]('\x20\x20appcode:\x20'+_0xa1cd0f[_0x59011e(0x8c)]);if(_0xa1cd0f['defaultApp'])console[_0x59011e(0x7c)](_0x59011e(0x8a)+_0xa1cd0f[_0x59011e(0x83)]);}function convertToRuntimeConfig(_0x5982e1){const _0x4e239e=a25_0x2b6240;if(_0x5982e1[_0x4e239e(0x8d)]&&typeof _0x5982e1[_0x4e239e(0x8d)]===_0x4e239e(0x6e))throw CliErrors[_0x4e239e(0xa4)](_0x4e239e(0xa5),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x34723f={};for(const _0x2682e2 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x5982e1[_0x2682e2]!==undefined&&(_0x34723f[_0x2682e2]=_0x5982e1[_0x2682e2]);}return!_0x34723f['riskLevel']&&(_0x34723f['riskLevel']=DEFAULT_CONFIG_VALUES[_0x4e239e(0x92)]),_0x34723f;}async function runNonInteractive(_0x192f60,_0x398c9e){const _0x228011=a25_0x2b6240,_0x41b3df=_0x192f60[_0x228011(0x8c)];if(!_0x41b3df)throw CliErrors['flagMissing'](_0x228011(0x8c),_0x228011(0xa3)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x146cfe=resolveInitEnv(_0x192f60);await writeInitConfig(_0x398c9e,{'appcode':_0x41b3df,'env':_0x146cfe},_0x192f60),console[_0x228011(0x7c)](_0x228011(0x90)+_0x398c9e),console[_0x228011(0x7c)](_0x228011(0x8f)+_0x41b3df),console[_0x228011(0x7c)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x146cfe);}async function runInteractive(_0x2879da,_0x243394){const _0x24fc41=a25_0x2b6240,_0x3d5be5=loadExisting(_0x243394),_0x5204d9=typeof _0x3d5be5?.[_0x24fc41(0x8c)]==='string'?_0x3d5be5[_0x24fc41(0x8c)]:'',_0x366677=resolveInitEnv(_0x2879da);console[_0x24fc41(0x7c)](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG[_0x24fc41(0x80)]+'\x0a');if(existsSync(_0x243394)&&!_0x2879da[_0x24fc41(0x88)]){const _0x489c2f=await promptYesNo(_0x24fc41(0x89)+_0x243394+_0x24fc41(0x91),![]);if(!_0x489c2f){console[_0x24fc41(0x7c)]('Aborted.');return;}}const _0x4a4be3=typeof _0x2879da[_0x24fc41(0x8c)]===_0x24fc41(0x97)?_0x2879da[_0x24fc41(0x8c)][_0x24fc41(0xa2)]():'';let _0x425b75=_0x4a4be3;!_0x425b75&&(_0x425b75=await promptInput(_0x24fc41(0x78),_0x5204d9));if(!_0x425b75['trim']())throw CliErrors[_0x24fc41(0xa4)](_0x24fc41(0x70));await writeInitConfig(_0x243394,{'appcode':_0x425b75['trim'](),'env':_0x366677},_0x2879da),console[_0x24fc41(0x7c)](_0x24fc41(0x85)+_0x243394),console[_0x24fc41(0x7c)]('\x20\x20appcode:\x20'+_0x425b75['trim']()),console[_0x24fc41(0x7c)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x366677);}async function writeInitConfig(_0x2f92b1,_0x2225ee,_0x1f0075){const _0xaf0796=a25_0x2b6240;let _0xf85c1a={};existsSync(_0x2f92b1)&&!_0x1f0075['yes']&&(_0xf85c1a=readConfigFile(_0x2f92b1));for(const [_0x40faf5,_0x445bef]of Object[_0xaf0796(0x75)](_0x2225ee)){_0x445bef!==undefined&&(_0xf85c1a[_0x40faf5]=_0x445bef);}if(_0xf85c1a[_0xaf0796(0x7e)])delete _0xf85c1a[_0xaf0796(0x7e)];writeConfigFile(_0x2f92b1,_0xf85c1a);}class AbortPrompt extends Error{constructor(){const _0x475028=a25_0x2b6240;super(_0x475028(0x6b)),this[_0x475028(0x68)]=_0x475028(0x8b);}}function createSafeRl(){const _0x1d57ac=a25_0x2b6240,_0x1fc2dc=createInterface({'input':process[_0x1d57ac(0x87)],'output':process['stdout']});let _0xc09c7d;const _0x2906b1=new Promise((_0x365b87,_0x562d5d)=>{const _0x500376=_0x1d57ac;_0xc09c7d=()=>{const _0x1e75e0=a25_0xaac3;_0xc09c7d&&(_0x1fc2dc['removeListener'](_0x1e75e0(0x74),_0xc09c7d),_0xc09c7d=undefined);try{_0x1fc2dc[_0x1e75e0(0x95)]();}catch{}_0x562d5d(new AbortPrompt());},_0x1fc2dc[_0x500376(0x9f)](_0x500376(0x74),_0xc09c7d);}),_0x35bccc=()=>{const _0x8960a1=_0x1d57ac;_0xc09c7d&&(_0x1fc2dc[_0x8960a1(0x94)](_0x8960a1(0x74),_0xc09c7d),_0xc09c7d=undefined);try{_0x1fc2dc[_0x8960a1(0x95)]();}catch{}};return{'rl':_0x1fc2dc,'abortPromise':_0x2906b1,'disposeSuccess':_0x35bccc};}async function promptInput(_0x14f948,_0x5cd42f){const _0x5a3b7e=a25_0x2b6240,{rl:_0x481ea0,abortPromise:_0x5e3670,disposeSuccess:_0x5da696}=createSafeRl(),_0x472ee1=new Promise(_0x2042e4=>{const _0x3fda7a=a25_0xaac3,_0x47932f=_0x5cd42f?'\x20\x20'+_0x14f948+'\x20('+_0x5cd42f+_0x3fda7a(0x9d):'\x20\x20'+_0x14f948+':\x20';_0x481ea0[_0x3fda7a(0x86)](_0x47932f,_0x5a2081=>{const _0x2939bb=_0x3fda7a;_0x5da696(),_0x2042e4(_0x5a2081[_0x2939bb(0xa2)]()||_0x5cd42f);});});return Promise[_0x5a3b7e(0x9e)]([_0x472ee1,_0x5e3670]);}async function promptYesNo(_0x1cf1c6,_0x192907){const _0x59ad1e=a25_0x2b6240,{rl:_0x436884,abortPromise:_0x54f1c3,disposeSuccess:_0x5e4a64}=createSafeRl(),_0x2ddb6a=new Promise(_0x59df7b=>{const _0x218650=a25_0xaac3,_0x3edcbd=_0x192907?_0x218650(0x82):_0x218650(0xa1);_0x436884['question']('\x20\x20'+_0x1cf1c6+'\x20'+_0x3edcbd+':\x20',_0x867740=>{const _0x24eb69=_0x218650;_0x5e4a64();const _0x1d4a71=_0x867740[_0x24eb69(0xa2)]()[_0x24eb69(0x99)]();if(_0x1d4a71==='y'||_0x1d4a71===_0x24eb69(0x88))_0x59df7b(!![]);else{if(_0x1d4a71==='n'||_0x1d4a71==='no')_0x59df7b(![]);else _0x59df7b(_0x192907);}});});return Promise[_0x59ad1e(0x9e)]([_0x2ddb6a,_0x54f1c3]);}function loadExisting(_0x35336e){if(!existsSync(_0x35336e))return null;return readConfigFile(_0x35336e);}function resolveFilePath(_0x421f98){return isAbsolute(_0x421f98)?_0x421f98:resolve(process['cwd'](),_0x421f98);}function readSourceFile(_0x1fe24a){const _0x2db4d1=a25_0x2b6240;try{const _0x456bf6=readFileSync(_0x1fe24a,{'encoding':'utf8'});return JSON['parse'](_0x456bf6);}catch(_0x672334){throw CliErrors['validation'](_0x2db4d1(0x98)+_0x672334['message']);}}function a25_0x2823(){const _0x46ab89=['string','Failed\x20to\x20parse\x20source\x20file:\x20','toLowerCase','2691565WdVHPf','boolean','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','):\x20','race','once','865369ATrjNb','[y/N]','trim','Usage:\x20','validation','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','name','apiDir','App\x20code\x20for\x20the\x20project','User\x20aborted\x20prompt','includes','15010360MBTSFG','object','global','App\x20code\x20cannot\x20be\x20empty.','cancelled','1269620BfHmpk','file','SIGINT','entries','529284EvIbVS','env','App\x20code','2326660BkYoAN','Override\x20imported\x20default\x20appcode','Write\x20to\x20global\x20(~/','log','Skip\x20confirmation\x20when\x20overwriting','app','3KYAWda','newConfigFileName',')\x20instead\x20of\x20project','[Y/n]','defaultApp','Invalid\x20env\x20\x22','\x0aInitialized\x20','question','stdin','yes','File\x20','\x20\x20default:\x20','AbortPrompt','appcode','apps','4403284EPiPml','\x20\x20appcode:\x20','Initialized\x20','\x20already\x20exists.\x20Overwrite?','riskLevel','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','removeListener','close','Imported\x20from\x20'];a25_0x2823=function(){return _0x46ab89;};return a25_0x2823();}function resolveInitEnv(_0x37f889){const _0x1b10af=a25_0x2b6240,_0x204e05=_0x37f889[_0x1b10af(0x77)];if(_0x204e05===undefined||_0x204e05==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x1b10af(0x6c)](_0x204e05))throw CliErrors['validation'](_0x1b10af(0x84)+_0x204e05+'\x22.\x20Allowed:\x20'+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x204e05;}
|
|
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();}
|