@lovrabet/lovrabet-cli 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x56beda,_0x5a9fed){const _0x50693b=a15_0x318a,_0x4666ce=_0x56beda();while(!![]){try{const _0x5309f2=-parseInt(_0x50693b(0xae))/0x1*(-parseInt(_0x50693b(0xb7))/0x2)+-parseInt(_0x50693b(0xad))/0x3*(-parseInt(_0x50693b(0xc3))/0x4)+parseInt(_0x50693b(0xbd))/0x5+-parseInt(_0x50693b(0xaf))/0x6+-parseInt(_0x50693b(0xab))/0x7*(parseInt(_0x50693b(0xb0))/0x8)+-parseInt(_0x50693b(0xac))/0x9*(parseInt(_0x50693b(0xbb))/0xa)+-parseInt(_0x50693b(0xb3))/0xb*(-parseInt(_0x50693b(0xbc))/0xc);if(_0x5309f2===_0x5a9fed)break;else _0x4666ce['push'](_0x4666ce['shift']());}catch(_0x166015){_0x4666ce['push'](_0x4666ce['shift']());}}}(a15_0x3ec2,0xe09ca));function a15_0x318a(_0x3c4abf,_0x142579){_0x3c4abf=_0x3c4abf-0xab;const _0x3ec2a=a15_0x3ec2();let _0x318abf=_0x3ec2a[_0x3c4abf];return _0x318abf;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG}from'../../constant/product.js';export{DEFAULT_APP_PROFILE_NAME,DEFAULT_CONFIG_VALUES}from'../../constant/defaults.js';function a15_0x3ec2(){const _0x3e95ed=['33365oHORPR','6436458XVrLeM','26728UyXNGT','Use\x20only\x20one\x20config\x20scope\x20flag.','\x20(global)','4708NTlmRL','project','\x20init`\x20first.',',\x20or\x20run\x20`','58prmGhR','Not\x20inside\x20a\x20project\x20(no\x20','validation','project-or-global-explicit','9770OKWsBD','11652nOqnFb','3756880TQFfHm','\x20found).','inProject','project-default','global','newConfigFileName','428rLaiyX','global-default','553GieKrN','3816hkzkIz','15039kUomqs'];a15_0x3ec2=function(){return _0x3e95ed;};return a15_0x3ec2();}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(_0xf4982c){const _0x3826c9=a15_0x318a,{explicitGlobal:explicitGlobal=![],explicitProject:explicitProject=![],policy:_0x42580e}=_0xf4982c;if(explicitGlobal&&explicitProject)throw CliErrors[_0x3826c9(0xb9)]('Flags\x20--global\x20and\x20--project\x20are\x20mutually\x20exclusive.',_0x3826c9(0xb1));if(explicitGlobal)return _0x3826c9(0xc1);if(explicitProject)return _0x3826c9(0xb4);switch(_0x42580e){case _0x3826c9(0xc4):return _0x3826c9(0xc1);case _0x3826c9(0xc0):return _0xf4982c[_0x3826c9(0xbf)]??isInProject()?_0x3826c9(0xb4):_0x3826c9(0xc1);case _0x3826c9(0xba):if(!(_0xf4982c[_0x3826c9(0xbf)]??isInProject()))throw CliErrors['validation'](_0x3826c9(0xb8)+PRODUCT_CONFIG[_0x3826c9(0xc2)]+_0x3826c9(0xbe),'Add\x20--global\x20to\x20write\x20to\x20~/'+PRODUCT_CONFIG[_0x3826c9(0xc2)]+_0x3826c9(0xb6)+CLI_BIN_NAME+_0x3826c9(0xb5));return _0x3826c9(0xb4);}}export function toScopeFlags(_0x98bda4){const _0x438d1f=a15_0x318a;return{'global':_0x98bda4===_0x438d1f(0xc1)};}export function formatScopeLabel(_0x1ed578){const _0x49be83=a15_0x318a;return _0x1ed578===_0x49be83(0xc1)?_0x49be83(0xb2):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x441a55,_0x3e569e){const _0x4e7a33=a16_0x4e91,_0xdbd202=_0x441a55();while(!![]){try{const _0xd52c2b=-parseInt(_0x4e7a33(0x1f7))/0x1*(parseInt(_0x4e7a33(0x201))/0x2)+parseInt(_0x4e7a33(0x1fb))/0x3+-parseInt(_0x4e7a33(0x1e9))/0x4+-parseInt(_0x4e7a33(0x1f1))/0x5*(-parseInt(_0x4e7a33(0x1ff))/0x6)+-parseInt(_0x4e7a33(0x1fe))/0x7*(parseInt(_0x4e7a33(0x1e8))/0x8)+-parseInt(_0x4e7a33(0x1f8))/0x9+parseInt(_0x4e7a33(0x1ec))/0xa*(parseInt(_0x4e7a33(0x1f6))/0xb);if(_0xd52c2b===_0x3e569e)break;else _0xdbd202['push'](_0xdbd202['shift']());}catch(_0x363f8d){_0xdbd202['push'](_0xdbd202['shift']());}}}(a16_0x56b5,0x2e3c5));import{CliErrors}from'../../errors.js';function isSet(_0x56c087,_0x1421e6){const _0x147fe6=_0x56c087['flag'](_0x1421e6);return _0x147fe6!==undefined&&_0x147fe6!==''&&_0x147fe6!==![]&&_0x147fe6!==0x0;}function fmtNames(_0x1fb97a){const _0x584b49=a16_0x4e91;return _0x1fb97a['map'](_0x95d30e=>'--'+_0x95d30e)[_0x584b49(0x1ed)](',\x20');}export function requireOneOf(_0x5287ad,_0x11a8d2,_0x437e7e){const _0x22f048=a16_0x4e91,_0x1f3970=_0x11a8d2[_0x22f048(0x1f4)](_0x27d010=>isSet(_0x5287ad,_0x27d010));if(_0x1f3970[_0x22f048(0x200)]!==0x1)throw CliErrors[_0x22f048(0x1fa)](_0x1f3970[_0x22f048(0x200)]===0x0?_0x22f048(0x1fd)+fmtNames(_0x11a8d2)+'\x20is\x20required\x20for\x20`'+_0x437e7e+'`.':_0x22f048(0x1ef)+fmtNames(_0x11a8d2)+_0x22f048(0x1ea)+fmtNames(_0x1f3970)+'.',_0x1f3970[_0x22f048(0x200)]===0x0?_0x22f048(0x203)+fmtNames(_0x11a8d2):_0x22f048(0x1ee));}function a16_0x56b5(){const _0x29e736=['1437070cdoaaK','join','Remove\x20all\x20but\x20one.','Only\x20one\x20of\x20',',\x20got\x20\x22','10195vxPxAq','str',':\x20expected\x20','filter','Use\x20only\x20one\x20of:\x20','11tLUXvv','67283MrDFGA','335511ImBIDW','test','validation','1086567idubwX','some','Exactly\x20one\x20of\x20','287gbavVu','528NppzxI','length','4YCCPEz','At\x20least\x20one\x20of\x20','Provide\x20one\x20of:\x20','Invalid\x20--','23712rNWyIo','810312SgaPme','\x20is\x20allowed,\x20found:\x20','Flags\x20'];a16_0x56b5=function(){return _0x29e736;};return a16_0x56b5();}function a16_0x4e91(_0x4136c5,_0x577a0e){_0x4136c5=_0x4136c5-0x1e8;const _0x56b5e4=a16_0x56b5();let _0x4e91c3=_0x56b5e4[_0x4136c5];return _0x4e91c3;}export function requireAnyOf(_0x3ec77b,_0x1c982f,_0x496a60){const _0x2ff5b6=a16_0x4e91;if(!_0x1c982f[_0x2ff5b6(0x1fc)](_0x57eabb=>isSet(_0x3ec77b,_0x57eabb)))throw CliErrors[_0x2ff5b6(0x1fa)](_0x2ff5b6(0x202)+fmtNames(_0x1c982f)+'\x20is\x20required\x20for\x20`'+_0x496a60+'`.',_0x2ff5b6(0x203)+fmtNames(_0x1c982f));}export function mutuallyExclusive(_0x55e451,_0x126846,_0x98f533){const _0x524973=a16_0x4e91,_0x5ca104=_0x126846[_0x524973(0x1f4)](_0x2ac1d9=>isSet(_0x55e451,_0x2ac1d9));if(_0x5ca104[_0x524973(0x200)]>0x1)throw CliErrors[_0x524973(0x1fa)](_0x524973(0x1eb)+fmtNames(_0x5ca104)+'\x20are\x20mutually\x20exclusive\x20for\x20`'+_0x98f533+'`.',_0x524973(0x1f5)+fmtNames(_0x126846));}export function validatePattern(_0x7e0e1,_0x50451b,_0x34a753,_0x3850b0){const _0x53aadc=a16_0x4e91,_0x3bc2ec=_0x7e0e1[_0x53aadc(0x1f2)](_0x50451b);if(_0x3bc2ec&&!_0x34a753[_0x53aadc(0x1f9)](_0x3bc2ec))throw CliErrors[_0x53aadc(0x1fa)](_0x53aadc(0x204)+_0x50451b+_0x53aadc(0x1f3)+_0x3850b0+_0x53aadc(0x1f0)+_0x3bc2ec+'\x22.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a17_0x240e97=a17_0x5b47;(function(_0x58663e,_0xbd0137){const _0x4d06b8=a17_0x5b47,_0x27253d=_0x58663e();while(!![]){try{const _0x4673b7=-parseInt(_0x4d06b8(0x82))/0x1*(-parseInt(_0x4d06b8(0x7d))/0x2)+parseInt(_0x4d06b8(0x84))/0x3*(parseInt(_0x4d06b8(0x77))/0x4)+parseInt(_0x4d06b8(0x80))/0x5*(parseInt(_0x4d06b8(0x8b))/0x6)+-parseInt(_0x4d06b8(0x83))/0x7*(parseInt(_0x4d06b8(0x86))/0x8)+parseInt(_0x4d06b8(0x88))/0x9+parseInt(_0x4d06b8(0x78))/0xa*(-parseInt(_0x4d06b8(0x81))/0xb)+-parseInt(_0x4d06b8(0x7c))/0xc*(parseInt(_0x4d06b8(0x76))/0xd);if(_0x4673b7===_0xbd0137)break;else _0x27253d['push'](_0x27253d['shift']());}catch(_0x33f4a9){_0x27253d['push'](_0x27253d['shift']());}}}(a17_0x4430,0xd9a67));export const CODE_FLAG={'name':a17_0x240e97(0x7e),'type':a17_0x240e97(0x87),'required':!![],'description':a17_0x240e97(0x79),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a17_0x240e97(0x89)}};export const SQLCODE_FLAG={'name':a17_0x240e97(0x85),'type':a17_0x240e97(0x87),'required':!![],'description':a17_0x240e97(0x8d),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':'SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)'}};export const VERBOSE_FLAG={'name':a17_0x240e97(0x75),'type':a17_0x240e97(0x7a),'description':'Return\x20full\x20raw\x20response\x20object'};function a17_0x5b47(_0x571200,_0x4dc2c9){_0x571200=_0x571200-0x75;const _0x443041=a17_0x4430();let _0x5b4717=_0x443041[_0x571200];return _0x5b4717;}export const PARAMS_FLAG={'name':'params','type':a17_0x240e97(0x87),'description':a17_0x240e97(0x7b)};export const NAME_FLAG={'name':a17_0x240e97(0x8c),'type':a17_0x240e97(0x87),'description':'Resource\x20name\x20for\x20lookup'};function a17_0x4430(){const _0x1d8e4a=['11062449wAYQoQ','a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)','number','6gySube','name','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','verbose','312hlhdbm','2327196rynAMr','247930tIDqHW','Dataset\x20code\x20(32-char\x20hex\x20UUID)','boolean','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','739476jSgQzC','414362obnMck','code','Resource\x20ID','7459185ZuysiE','704yDuBqu','3xiWKEf','2638391gPMdsj','9klJwMF','sqlcode','24iRALbt','string'];a17_0x4430=function(){return _0x1d8e4a;};return a17_0x4430();}export const ID_FLAG={'name':'id','type':a17_0x240e97(0x8a),'required':!![],'description':a17_0x240e97(0x7f)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a18_0x1101c0=a18_0x1273;(function(_0x4db409,_0x41e953){const _0x56584b=a18_0x1273,_0x46a1c6=_0x4db409();while(!![]){try{const _0x2e92cd=parseInt(_0x56584b(0xce))/0x1*(-parseInt(_0x56584b(0xac))/0x2)+-parseInt(_0x56584b(0x9d))/0x3*(-parseInt(_0x56584b(0xa9))/0x4)+parseInt(_0x56584b(0xbf))/0x5*(parseInt(_0x56584b(0x93))/0x6)+parseInt(_0x56584b(0xb8))/0x7+-parseInt(_0x56584b(0xc1))/0x8*(parseInt(_0x56584b(0xa1))/0x9)+-parseInt(_0x56584b(0xd2))/0xa+parseInt(_0x56584b(0xc7))/0xb*(parseInt(_0x56584b(0xd6))/0xc);if(_0x2e92cd===_0x41e953)break;else _0x46a1c6['push'](_0x46a1c6['shift']());}catch(_0x37c29a){_0x46a1c6['push'](_0x46a1c6['shift']());}}}(a18_0x3d93,0xdb5ef));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_0x1101c0(0xa5),'type':'boolean','description':a18_0x1101c0(0xb0),'default':![]};function parseAliasAppcodeSetKey(_0x21c4e9){const _0x1b3201=a18_0x1101c0,_0x5cd4b9=_0x21c4e9['split']('.');if(_0x5cd4b9[_0x1b3201(0x97)]!==0x3||_0x5cd4b9[0x0]!==_0x1b3201(0xb4)||_0x5cd4b9[0x2]!==_0x1b3201(0xaf))return undefined;const _0x1649f1=_0x5cd4b9[0x1]?.[_0x1b3201(0xbb)]();return _0x1649f1?_0x1649f1:undefined;}function a18_0x3d93(){const _0x3c65d3=['format','validation','Deleted\x20`','1EKjtVh','\x20config\x20set\x20<key>\x20<value>\x20[--global]',';\x20apps.<alias>.appcode','`\x20=\x20\x22','10576340iAXQKq','args','isArray','write','24zPOlSS','\x20config\x20delete\x20<key>\x20[--global]','1007982oFoIqC','bool','join','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','length','riskLevel','Usage:\x20','field','(none)','Set\x20`','41919cQyXyE','pageSize\x20must\x20be\x20a\x20positive\x20number','Delete\x20a\x20config\x20value','object','1079928LUQedL','pretty','Set\x20a\x20config\x20value','Key\x20not\x20found:\x20','global','pageSize','keys','\x20config\x20get\x20<key>','356ztrfIi','Missing\x20key\x20or\x20value.','Missing\x20key\x20argument.','2333630hbvgwx','list','config','appcode','Write\x20to\x20global\x20config','Key\x20\x22','\x20(global)','\x22.\x20Allowed:\x20','apps','Top-level\x20key\x20\x22','List\x20current\x20config','alias','8215067BVHWBD','Invalid\x20value\x20for\x20\x22','Config\x20files:\x0a','trim','log','raw','includes','10STeWmP','read','32lSLMFZ','project-or-global-explicit','../../context.js','stringify','set','get','4673834wDvZwD','split','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','key'];a18_0x3d93=function(){return _0x3c65d3;};return a18_0x3d93();}function a18_0x1273(_0x57719f,_0x38935b){_0x57719f=_0x57719f-0x93;const _0x3d93d3=a18_0x3d93();let _0x127308=_0x3d93d3[_0x57719f];return _0x127308;}function parseAliasDeleteKey(_0xc29ed4){const _0x4d5ddf=a18_0x1101c0,_0x348125=_0xc29ed4['split']('.');if(_0x348125[_0x4d5ddf(0x97)]===0x2&&_0x348125[0x0]===_0x4d5ddf(0xb4)){const _0x408683=_0x348125[0x1]?.[_0x4d5ddf(0xbb)]();return _0x408683?{'alias':_0x408683}:undefined;}if(_0x348125[_0x4d5ddf(0x97)]===0x3&&_0x348125[0x0]===_0x4d5ddf(0xb4)&&_0x348125[0x2]===_0x4d5ddf(0xaf)){const _0x45bce3=_0x348125[0x1]?.['trim']();return _0x45bce3?{'alias':_0x45bce3,'field':_0x4d5ddf(0xaf)}:undefined;}return undefined;}function setLocalAppAlias(_0x4fbc8a,_0x2f922b,_0x160967){const _0x1b47e0=a18_0x1101c0,_0x346a2a=_0x4fbc8a[_0x1b47e0(0xb4)]&&typeof _0x4fbc8a[_0x1b47e0(0xb4)]==='object'&&!Array[_0x1b47e0(0xd4)](_0x4fbc8a['apps'])?_0x4fbc8a['apps']:{},_0x176298=_0x346a2a[_0x2f922b]&&typeof _0x346a2a[_0x2f922b]===_0x1b47e0(0xa0)&&!Array['isArray'](_0x346a2a[_0x2f922b])?_0x346a2a[_0x2f922b]:{};_0x176298[_0x1b47e0(0xaf)]=_0x160967,_0x346a2a[_0x2f922b]=_0x176298,_0x4fbc8a[_0x1b47e0(0xb4)]=_0x346a2a;}function deleteLocalAppAlias(_0x4ff234,_0x2b4e74){const _0x385470=a18_0x1101c0;if(!_0x4ff234[_0x385470(0xb4)]||typeof _0x4ff234[_0x385470(0xb4)]!==_0x385470(0xa0)||Array[_0x385470(0xd4)](_0x4ff234[_0x385470(0xb4)]))return![];const _0x16cd95=_0x4ff234[_0x385470(0xb4)],_0x548468=_0x16cd95[_0x2b4e74[_0x385470(0xb7)]];if(!_0x548468||typeof _0x548468!=='object'||Array[_0x385470(0xd4)](_0x548468))return![];if(!_0x2b4e74[_0x385470(0x9a)])return delete _0x16cd95[_0x2b4e74[_0x385470(0xb7)]],!![];if(!(_0x2b4e74[_0x385470(0x9a)]in _0x548468))return![];return delete _0x548468[_0x2b4e74[_0x385470(0x9a)]],Object[_0x385470(0xa7)](_0x548468)[_0x385470(0x97)]===0x0&&delete _0x16cd95[_0x2b4e74[_0x385470(0xb7)]],!![];}const listDef={'service':a18_0x1101c0(0xae),'command':a18_0x1101c0(0xad),'description':a18_0x1101c0(0xb6),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x32c93b){const _0x40f53c=a18_0x1101c0,{buildConfigFromFlags:_0x2d4cbf}=await import(_0x40f53c(0xc3)),_0x2a88a2=_0x2d4cbf({}),_0x37d978=getProjectConfigPath(),_0x1bbc41=resolveWriteConfigPath('global');if(_0x32c93b[_0x40f53c(0xcb)]===_0x40f53c(0xa2))return{'ok':!![],'message':_0x40f53c(0xc9)+(JSON[_0x40f53c(0xc4)](_0x2a88a2[_0x40f53c(0xbd)],null,0x2)+'\x0a\x0a')+_0x40f53c(0xba)+('\x20\x20project:\x20'+(_0x37d978??_0x40f53c(0x9b))+'\x0a')+('\x20\x20global:\x20\x20'+_0x1bbc41)};return{'ok':!![],'data':{'effective':_0x2a88a2[_0x40f53c(0xbd)],'configFiles':{'project':_0x37d978??null,'global':_0x1bbc41}}};}},getDef={'service':a18_0x1101c0(0xae),'command':a18_0x1101c0(0xc6),'description':'Get\x20a\x20config\x20value','risk':a18_0x1101c0(0xc0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x1101c0(0xca),'description':'Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','required':!![]}],'flags':[],async 'execute'(_0xf578ff){const _0xe968d9=a18_0x1101c0,_0x4bc5b8=_0xf578ff['args'][0x0];if(!_0x4bc5b8)throw CliErrors['validation'](_0xe968d9(0xab),_0xe968d9(0x99)+CLI_BIN_NAME+_0xe968d9(0xa8));const {buildConfigFromFlags:_0x318aff}=await import(_0xe968d9(0xc3)),{raw:_0x526744}=_0x318aff({});if(_0x4bc5b8[_0xe968d9(0xbe)]('.')){const _0xdc31b4=_0x4bc5b8[_0xe968d9(0xc8)]('.');let _0xf9be0a=_0x526744;for(const _0x4ed37a of _0xdc31b4){if(_0xf9be0a==null||typeof _0xf9be0a!==_0xe968d9(0xa0))throw CliErrors[_0xe968d9(0xcc)](_0xe968d9(0xa4)+_0x4bc5b8);_0xf9be0a=_0xf9be0a[_0x4ed37a];}if(_0xf9be0a===undefined)throw CliErrors[_0xe968d9(0xcc)](_0xe968d9(0xa4)+_0x4bc5b8);return console['log'](typeof _0xf9be0a===_0xe968d9(0xa0)?JSON['stringify'](_0xf9be0a,null,0x2):String(_0xf9be0a)),{'ok':!![]};}const _0x5f05cf=_0x526744[_0x4bc5b8];if(_0x5f05cf===undefined)throw CliErrors['validation'](_0xe968d9(0xa4)+_0x4bc5b8);return console[_0xe968d9(0xbc)](typeof _0x5f05cf===_0xe968d9(0xa0)?JSON['stringify'](_0x5f05cf,null,0x2):String(_0x5f05cf)),{'ok':!![]};}},setDef={'service':'config','command':a18_0x1101c0(0xc5),'description':a18_0x1101c0(0xa3),'risk':a18_0x1101c0(0xd5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x1101c0(0xca),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':'value','description':'Value\x20to\x20assign','required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x1c8818){const _0x2e8561=a18_0x1101c0,_0x3be588=_0x1c8818[_0x2e8561(0xd3)][0x0],_0x24e172=_0x1c8818[_0x2e8561(0xd3)][0x1];if(!_0x3be588||_0x24e172===undefined)throw CliErrors['validation'](_0x2e8561(0xaa),_0x2e8561(0x99)+CLI_BIN_NAME+_0x2e8561(0xcf));if(ENUM_KEYS[_0x3be588]&&!ENUM_KEYS[_0x3be588][_0x2e8561(0xbe)](_0x24e172))throw CliErrors['validation'](_0x2e8561(0xb9)+_0x3be588+_0x2e8561(0xb3)+ENUM_KEYS[_0x3be588][_0x2e8561(0x95)](',\x20'));if(_0x3be588===_0x2e8561(0x98))throw CliErrors[_0x2e8561(0xcc)](_0x2e8561(0x96));if(_0x3be588===_0x2e8561(0xa6)){const _0x27b2cd=Number(_0x24e172);if(isNaN(_0x27b2cd)||_0x27b2cd<=0x0)throw CliErrors[_0x2e8561(0xcc)](_0x2e8561(0x9e));}const _0x44a457=resolveWriteScope({'explicitGlobal':_0x1c8818[_0x2e8561(0x94)]('global'),'policy':_0x2e8561(0xc2)}),_0x22f4b0=toScopeFlags(_0x44a457),_0x1f1c95=readScopedConfig(_0x22f4b0),_0x4698ea=parseAliasAppcodeSetKey(_0x3be588);if(!_0x4698ea&&!isTopLevelConfigKey(_0x3be588))throw CliErrors[_0x2e8561(0xcc)](_0x2e8561(0xb5)+_0x3be588+'\x22\x20is\x20not\x20settable.','Settable\x20keys:\x20'+getTopLevelConfigKeySummary()+_0x2e8561(0xd0));return _0x4698ea?setLocalAppAlias(_0x1f1c95,_0x4698ea,_0x24e172):_0x1f1c95[_0x3be588]=_0x3be588==='pageSize'?Number(_0x24e172):_0x24e172,console['log'](_0x2e8561(0x9c)+_0x3be588+_0x2e8561(0xd1)+_0x24e172+'\x22'+(_0x44a457===_0x2e8561(0xa5)?_0x2e8561(0xb2):'')),writeScopedConfig(_0x1f1c95,_0x22f4b0),{'ok':!![]};}},deleteDef={'service':a18_0x1101c0(0xae),'command':'delete','description':a18_0x1101c0(0x9f),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x1101c0(0xca),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x3296eb){const _0x15f7f4=a18_0x1101c0,_0x4fdde6=_0x3296eb[_0x15f7f4(0xd3)][0x0];if(!_0x4fdde6)throw CliErrors['validation'](_0x15f7f4(0xab),_0x15f7f4(0x99)+CLI_BIN_NAME+_0x15f7f4(0xd7));const _0x1a0ecd=resolveWriteScope({'explicitGlobal':_0x3296eb['bool']('global'),'policy':_0x15f7f4(0xc2)}),_0x5d196f=toScopeFlags(_0x1a0ecd),_0x5c79c4=readScopedConfig(_0x5d196f),_0x2c3a2e=parseAliasDeleteKey(_0x4fdde6);if(_0x2c3a2e){if(!deleteLocalAppAlias(_0x5c79c4,_0x2c3a2e))throw CliErrors['validation'](_0x15f7f4(0xa4)+_0x4fdde6);return console[_0x15f7f4(0xbc)](_0x15f7f4(0xcd)+_0x4fdde6+'`'+(_0x1a0ecd==='global'?'\x20(global)':'')),writeScopedConfig(_0x5c79c4,_0x5d196f),{'ok':!![]};}if(_0x5c79c4[_0x4fdde6]===undefined)throw CliErrors[_0x15f7f4(0xcc)](_0x15f7f4(0xb1)+_0x4fdde6+'\x22\x20not\x20found\x20at\x20top\x20level.');return delete _0x5c79c4[_0x4fdde6],console[_0x15f7f4(0xbc)](_0x15f7f4(0xcd)+_0x4fdde6+'`'+(_0x1a0ecd===_0x15f7f4(0xa5)?_0x15f7f4(0xb2):'')),writeScopedConfig(_0x5c79c4,_0x5d196f),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
1
|
+
const a18_0x550f8f=a18_0x4078;(function(_0x790151,_0x1e681c){const _0x1c222b=a18_0x4078,_0x46b227=_0x790151();while(!![]){try{const _0x426b25=-parseInt(_0x1c222b(0x150))/0x1*(parseInt(_0x1c222b(0x171))/0x2)+-parseInt(_0x1c222b(0x156))/0x3*(-parseInt(_0x1c222b(0x16c))/0x4)+-parseInt(_0x1c222b(0x186))/0x5+-parseInt(_0x1c222b(0x14a))/0x6*(-parseInt(_0x1c222b(0x161))/0x7)+parseInt(_0x1c222b(0x168))/0x8*(-parseInt(_0x1c222b(0x181))/0x9)+-parseInt(_0x1c222b(0x184))/0xa+-parseInt(_0x1c222b(0x185))/0xb*(-parseInt(_0x1c222b(0x146))/0xc);if(_0x426b25===_0x1e681c)break;else _0x46b227['push'](_0x46b227['shift']());}catch(_0x2ee64c){_0x46b227['push'](_0x46b227['shift']());}}}(a18_0x22ea,0x8a46d));import{CliErrors}from'../../errors.js';function a18_0x22ea(){const _0x2aeda5=['includes','Missing\x20key\x20or\x20value.','appcode','\x20\x20global:\x20\x20','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','value','Top-level\x20key\x20\x22','\x20config\x20get\x20<key>','\x22.\x20Allowed:\x20','stringify','\x20\x20project:\x20','Set\x20`','trim','pretty','193761yEkItf','Usage:\x20','log','9052750FElQaT','2527976qYqjxW','4289030RPZmbu','Missing\x20key\x20argument.','validation','\x22\x20not\x20found\x20at\x20top\x20level.','global','boolean','144rvRKTV','isArray','Key\x20not\x20found:\x20','Write\x20to\x20global\x20config','498KQUEKU','../../context.js','\x20(global)','pageSize\x20must\x20be\x20a\x20positive\x20number','apps','read','2xZTlwL','Set\x20a\x20config\x20value','bool','field','length','project-or-global-explicit','3319551QqHOTo','List\x20current\x20config','raw','list','(none)','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','format','alias','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','config','args','812zWgBWx','Invalid\x20value\x20for\x20\x22','object','\x20config\x20delete\x20<key>\x20[--global]','Deleted\x20`','`\x20=\x20\x22','Delete\x20a\x20config\x20value','232PIuKOa','\x20config\x20set\x20<key>\x20<value>\x20[--global]','Config\x20files:\x0a','Value\x20to\x20assign','4yGSMWE','pageSize','split','riskLevel','\x22\x20is\x20not\x20settable.','920134EdBqRu','key'];a18_0x22ea=function(){return _0x2aeda5;};return a18_0x22ea();}import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';function a18_0x4078(_0x20c29b,_0x3fa9cf){_0x20c29b=_0x20c29b-0x141;const _0x22ea8e=a18_0x22ea();let _0x40788b=_0x22ea8e[_0x20c29b];return _0x40788b;}import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':a18_0x550f8f(0x144),'type':a18_0x550f8f(0x145),'description':a18_0x550f8f(0x149),'default':![]};function parseAliasAppcodeSetKey(_0x2ed279){const _0x14c4fe=a18_0x550f8f,_0x20defa=_0x2ed279[_0x14c4fe(0x16e)]('.');if(_0x20defa[_0x14c4fe(0x154)]!==0x3||_0x20defa[0x0]!==_0x14c4fe(0x14e)||_0x20defa[0x2]!=='appcode')return undefined;const _0x2691f1=_0x20defa[0x1]?.[_0x14c4fe(0x17f)]();return _0x2691f1?_0x2691f1:undefined;}function parseAliasDeleteKey(_0x1db415){const _0x528a71=a18_0x550f8f,_0x59b0b3=_0x1db415[_0x528a71(0x16e)]('.');if(_0x59b0b3['length']===0x2&&_0x59b0b3[0x0]===_0x528a71(0x14e)){const _0x4b58f0=_0x59b0b3[0x1]?.[_0x528a71(0x17f)]();return _0x4b58f0?{'alias':_0x4b58f0}:undefined;}if(_0x59b0b3[_0x528a71(0x154)]===0x3&&_0x59b0b3[0x0]==='apps'&&_0x59b0b3[0x2]==='appcode'){const _0x398e3d=_0x59b0b3[0x1]?.[_0x528a71(0x17f)]();return _0x398e3d?{'alias':_0x398e3d,'field':_0x528a71(0x175)}:undefined;}return undefined;}function setLocalAppAlias(_0x5c6161,_0x508755,_0xc0fcc4){const _0x4ec0ff=a18_0x550f8f,_0x4c5936=_0x5c6161['apps']&&typeof _0x5c6161['apps']===_0x4ec0ff(0x163)&&!Array[_0x4ec0ff(0x147)](_0x5c6161[_0x4ec0ff(0x14e)])?_0x5c6161[_0x4ec0ff(0x14e)]:{},_0x3006b8=_0x4c5936[_0x508755]&&typeof _0x4c5936[_0x508755]===_0x4ec0ff(0x163)&&!Array[_0x4ec0ff(0x147)](_0x4c5936[_0x508755])?_0x4c5936[_0x508755]:{};_0x3006b8[_0x4ec0ff(0x175)]=_0xc0fcc4,_0x4c5936[_0x508755]=_0x3006b8,_0x5c6161[_0x4ec0ff(0x14e)]=_0x4c5936;}function deleteLocalAppAlias(_0x13bbbc,_0x9ce8c6){const _0x4d87b6=a18_0x550f8f;if(!_0x13bbbc[_0x4d87b6(0x14e)]||typeof _0x13bbbc['apps']!==_0x4d87b6(0x163)||Array[_0x4d87b6(0x147)](_0x13bbbc['apps']))return![];const _0x52fa26=_0x13bbbc['apps'],_0x1bf4fa=_0x52fa26[_0x9ce8c6[_0x4d87b6(0x15d)]];if(!_0x1bf4fa||typeof _0x1bf4fa!==_0x4d87b6(0x163)||Array[_0x4d87b6(0x147)](_0x1bf4fa))return![];if(!_0x9ce8c6[_0x4d87b6(0x153)])return delete _0x52fa26[_0x9ce8c6['alias']],!![];if(!(_0x9ce8c6[_0x4d87b6(0x153)]in _0x1bf4fa))return![];return delete _0x1bf4fa[_0x9ce8c6['field']],Object['keys'](_0x1bf4fa)[_0x4d87b6(0x154)]===0x0&&delete _0x52fa26[_0x9ce8c6[_0x4d87b6(0x15d)]],!![];}const listDef={'service':'config','command':a18_0x550f8f(0x159),'description':a18_0x550f8f(0x157),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x363e46){const _0x33b347=a18_0x550f8f,{buildConfigFromFlags:_0x5d6134}=await import(_0x33b347(0x14b)),_0x1fc426=_0x5d6134({}),_0x2d0001=getProjectConfigPath(),_0x378be9=resolveWriteConfigPath('global');if(_0x363e46[_0x33b347(0x15c)]===_0x33b347(0x180))return{'ok':!![],'message':_0x33b347(0x177)+(JSON['stringify'](_0x1fc426[_0x33b347(0x158)],null,0x2)+'\x0a\x0a')+_0x33b347(0x16a)+(_0x33b347(0x17d)+(_0x2d0001??_0x33b347(0x15a))+'\x0a')+(_0x33b347(0x176)+_0x378be9)};return{'ok':!![],'data':{'effective':_0x1fc426[_0x33b347(0x158)],'configFiles':{'project':_0x2d0001??null,'global':_0x378be9}}};}},getDef={'service':a18_0x550f8f(0x15f),'command':'get','description':'Get\x20a\x20config\x20value','risk':a18_0x550f8f(0x14f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':a18_0x550f8f(0x15e),'required':!![]}],'flags':[],async 'execute'(_0x3c54c7){const _0x343053=a18_0x550f8f,_0x438cf0=_0x3c54c7[_0x343053(0x160)][0x0];if(!_0x438cf0)throw CliErrors[_0x343053(0x142)](_0x343053(0x141),_0x343053(0x182)+CLI_BIN_NAME+_0x343053(0x17a));const {buildConfigFromFlags:_0x2a5e10}=await import(_0x343053(0x14b)),{raw:_0x18952e}=_0x2a5e10({});if(_0x438cf0[_0x343053(0x173)]('.')){const _0x2d7822=_0x438cf0[_0x343053(0x16e)]('.');let _0x9a9d5b=_0x18952e;for(const _0x4df9b2 of _0x2d7822){if(_0x9a9d5b==null||typeof _0x9a9d5b!==_0x343053(0x163))throw CliErrors['validation'](_0x343053(0x148)+_0x438cf0);_0x9a9d5b=_0x9a9d5b[_0x4df9b2];}if(_0x9a9d5b===undefined)throw CliErrors[_0x343053(0x142)](_0x343053(0x148)+_0x438cf0);return console[_0x343053(0x183)](typeof _0x9a9d5b===_0x343053(0x163)?JSON[_0x343053(0x17c)](_0x9a9d5b,null,0x2):String(_0x9a9d5b)),{'ok':!![]};}const _0x34995b=_0x18952e[_0x438cf0];if(_0x34995b===undefined)throw CliErrors[_0x343053(0x142)](_0x343053(0x148)+_0x438cf0);return console['log'](typeof _0x34995b===_0x343053(0x163)?JSON[_0x343053(0x17c)](_0x34995b,null,0x2):String(_0x34995b)),{'ok':!![]};}},setDef={'service':'config','command':'set','description':a18_0x550f8f(0x151),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x550f8f(0x172),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a18_0x550f8f(0x178),'description':a18_0x550f8f(0x16b),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x3627cf){const _0x101421=a18_0x550f8f,_0x58e861=_0x3627cf[_0x101421(0x160)][0x0],_0x4e7422=_0x3627cf[_0x101421(0x160)][0x1];if(!_0x58e861||_0x4e7422===undefined)throw CliErrors[_0x101421(0x142)](_0x101421(0x174),_0x101421(0x182)+CLI_BIN_NAME+_0x101421(0x169));if(ENUM_KEYS[_0x58e861]&&!ENUM_KEYS[_0x58e861]['includes'](_0x4e7422))throw CliErrors[_0x101421(0x142)](_0x101421(0x162)+_0x58e861+_0x101421(0x17b)+ENUM_KEYS[_0x58e861]['join'](',\x20'));if(_0x58e861===_0x101421(0x16f))throw CliErrors[_0x101421(0x142)](_0x101421(0x15b));if(_0x58e861==='pageSize'){const _0x1e9a1b=Number(_0x4e7422);if(isNaN(_0x1e9a1b)||_0x1e9a1b<=0x0)throw CliErrors[_0x101421(0x142)](_0x101421(0x14d));}const _0x1bf772=resolveWriteScope({'explicitGlobal':_0x3627cf[_0x101421(0x152)](_0x101421(0x144)),'policy':_0x101421(0x155)}),_0x51c007=toScopeFlags(_0x1bf772),_0x59aef2=readScopedConfig(_0x51c007),_0x33bb82=parseAliasAppcodeSetKey(_0x58e861);if(!_0x33bb82&&!isTopLevelConfigKey(_0x58e861))throw CliErrors[_0x101421(0x142)](_0x101421(0x179)+_0x58e861+_0x101421(0x170),'Settable\x20keys:\x20'+getTopLevelConfigKeySummary()+';\x20apps.<alias>.appcode');return _0x33bb82?setLocalAppAlias(_0x59aef2,_0x33bb82,_0x4e7422):_0x59aef2[_0x58e861]=_0x58e861===_0x101421(0x16d)?Number(_0x4e7422):_0x4e7422,console['log'](_0x101421(0x17e)+_0x58e861+_0x101421(0x166)+_0x4e7422+'\x22'+(_0x1bf772===_0x101421(0x144)?'\x20(global)':'')),writeScopedConfig(_0x59aef2,_0x51c007),{'ok':!![]};}},deleteDef={'service':a18_0x550f8f(0x15f),'command':'delete','description':a18_0x550f8f(0x167),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x550f8f(0x172),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x370b4e){const _0x5f447a=a18_0x550f8f,_0x527fcf=_0x370b4e['args'][0x0];if(!_0x527fcf)throw CliErrors[_0x5f447a(0x142)](_0x5f447a(0x141),'Usage:\x20'+CLI_BIN_NAME+_0x5f447a(0x164));const _0xbe5439=resolveWriteScope({'explicitGlobal':_0x370b4e[_0x5f447a(0x152)](_0x5f447a(0x144)),'policy':_0x5f447a(0x155)}),_0x498d14=toScopeFlags(_0xbe5439),_0x328553=readScopedConfig(_0x498d14),_0x5a7d3a=parseAliasDeleteKey(_0x527fcf);if(_0x5a7d3a){if(!deleteLocalAppAlias(_0x328553,_0x5a7d3a))throw CliErrors[_0x5f447a(0x142)](_0x5f447a(0x148)+_0x527fcf);return console[_0x5f447a(0x183)](_0x5f447a(0x165)+_0x527fcf+'`'+(_0xbe5439===_0x5f447a(0x144)?_0x5f447a(0x14c):'')),writeScopedConfig(_0x328553,_0x498d14),{'ok':!![]};}if(_0x328553[_0x527fcf]===undefined)throw CliErrors[_0x5f447a(0x142)]('Key\x20\x22'+_0x527fcf+_0x5f447a(0x143));return delete _0x328553[_0x527fcf],console[_0x5f447a(0x183)](_0x5f447a(0x165)+_0x527fcf+'`'+(_0xbe5439===_0x5f447a(0x144)?_0x5f447a(0x14c):'')),writeScopedConfig(_0x328553,_0x498d14),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a19_0x4cab(){var _0x51179a=['13895019peoBYT','1320268YWvBcM','8avLumi','4040IfYoMb','9369738fAkGeE','4950732foBbME','5AoBGAb','104049JblkoY','2034VreQRn','9LuBfMo','78178AqqnWD'];a19_0x4cab=function(){return _0x51179a;};return a19_0x4cab();}(function(_0x5a50b0,_0x366fcb){var _0x1a300a=a19_0x5bad,_0x42121e=_0x5a50b0();while(!![]){try{var _0x493df0=-parseInt(_0x1a300a(0x17f))/0x1*(-parseInt(_0x1a300a(0x180))/0x2)+parseInt(_0x1a300a(0x17e))/0x3+parseInt(_0x1a300a(0x182))/0x4+parseInt(_0x1a300a(0x17c))/0x5*(-parseInt(_0x1a300a(0x17b))/0x6)+-parseInt(_0x1a300a(0x185))/0x7+-parseInt(_0x1a300a(0x183))/0x8*(parseInt(_0x1a300a(0x181))/0x9)+parseInt(_0x1a300a(0x184))/0xa*(parseInt(_0x1a300a(0x17d))/0xb);if(_0x493df0===_0x366fcb)break;else _0x42121e['push'](_0x42121e['shift']());}catch(_0x528098){_0x42121e['push'](_0x42121e['shift']());}}}(a19_0x4cab,0xc2713));function a19_0x5bad(_0x33cd1d,_0x2de6e2){_0x33cd1d=_0x33cd1d-0x17b;var _0x4cab53=a19_0x4cab();var _0x5bad5c=_0x4cab53[_0x33cd1d];return _0x5bad5c;}import{CLI_BIN_NAME}from'../../constant/cli.js';export{CLI_BIN_NAME};export{readScopedConfig,writeScopedConfig}from'../../context.js';export{resolveConfigScope as resolveWriteScope,TOP_LEVEL_CONFIG_KEYS as TOP_LEVEL_KEYS,CONFIG_ENUM_VALUES as ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey,toScopeFlags}from'../../commands/common/config-policy.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a20_0x245263=a20_0x4d7c;(function(_0x3deab1,_0x5cf86e){const _0xbfa976=a20_0x4d7c,_0x278958=_0x3deab1();while(!![]){try{const _0x5db09b=parseInt(_0xbfa976(0x190))/0x1*(parseInt(_0xbfa976(0x16f))/0x2)+parseInt(_0xbfa976(0x178))/0x3+-parseInt(_0xbfa976(0x183))/0x4*(-parseInt(_0xbfa976(0x193))/0x5)+parseInt(_0xbfa976(0x164))/0x6*(-parseInt(_0xbfa976(0x18b))/0x7)+parseInt(_0xbfa976(0x191))/0x8+parseInt(_0xbfa976(0x198))/0x9+parseInt(_0xbfa976(0x1ae))/0xa*(-parseInt(_0xbfa976(0x17e))/0xb);if(_0x5db09b===_0x5cf86e)break;else _0x278958['push'](_0x278958['shift']());}catch(_0x3c262d){_0x278958['push'](_0x278958['shift']());}}}(a20_0x4cf1,0x46a73));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';function a20_0x4cf1(){const _0x3fb011=['\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\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}}','code','55GLmFtk','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','risk','290064zuDnTh','\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','join','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','create','7zabdee','write','Preview:\x20data\x20','\x20\x20PARAMS\x20STRUCTURE','filter','3ESkFLs','4183800FUqszD','Get\x20a\x20single\x20record\x20by\x20ID','15hQiGbr','build','\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\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','getOne','3488544giChhk','operation','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','dryRun','params','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\x20\x20WHERE\x20OPERATORS','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','command','\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\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','\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}','POST','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','\x20\x20AGGREGATE\x20TYPES','data\x20','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\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}}]','paramsHint','Filter\x20dataset\x20records\x20with\x20query\x20conditions','2494230PFSPdZ','read','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','aggregate','\x20\x20LOGICAL\x20COMBINATORS','\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\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','1855926qtpDPN','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','\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\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','delete','data','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','\x20\x20\x20\x20$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\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','\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}}','100186DHxuor','\x20completed\x20in\x20','description','/api/{appCode}/','paramsRequired','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','update','str','Update\x20an\x20existing\x20record','1702239rTgJYR','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','batchCreate'];a20_0x4cf1=function(){return _0x3fb011;};return a20_0x4cf1();}import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a20_0x245263(0x18f),'operation':a20_0x245263(0x18f),'risk':a20_0x245263(0x1af),'paramsRequired':![],'description':a20_0x245263(0x1ad),'paramsHint':'JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20'+a20_0x245263(0x1a0),'helpExtra':[a20_0x245263(0x19f),'\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_0x245263(0x180),a20_0x245263(0x16b),'\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}',a20_0x245263(0x17c),a20_0x245263(0x162),a20_0x245263(0x184),a20_0x245263(0x16e),a20_0x245263(0x185),a20_0x245263(0x17f),'',a20_0x245263(0x161),'\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}}]}',a20_0x245263(0x195),'',a20_0x245263(0x167),'\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)',a20_0x245263(0x181),'\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]',a20_0x245263(0x16c),a20_0x245263(0x19a),'','\x20\x20PAGINATION','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.',a20_0x245263(0x196),a20_0x245263(0x179)][a20_0x245263(0x186)]('\x0a')},{'command':'getOne','operation':a20_0x245263(0x197),'risk':a20_0x245263(0x1af),'paramsRequired':!![],'description':a20_0x245263(0x192),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a20_0x245263(0x18a),'operation':'create','risk':a20_0x245263(0x18c),'paramsRequired':!![],'description':a20_0x245263(0x16d),'paramsHint':a20_0x245263(0x174)},{'command':a20_0x245263(0x17a),'operation':a20_0x245263(0x17a),'risk':a20_0x245263(0x18c),'paramsRequired':!![],'description':a20_0x245263(0x187),'paramsHint':a20_0x245263(0x188)},{'command':a20_0x245263(0x175),'operation':a20_0x245263(0x175),'risk':a20_0x245263(0x18c),'paramsRequired':!![],'description':a20_0x245263(0x177),'paramsHint':a20_0x245263(0x19b)},{'command':a20_0x245263(0x168),'operation':a20_0x245263(0x168),'risk':'high-risk-write','paramsRequired':!![],'description':'Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','paramsHint':a20_0x245263(0x19e)},{'command':'aggregate','operation':a20_0x245263(0x1b1),'risk':a20_0x245263(0x1af),'paramsRequired':![],'description':'Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','paramsHint':a20_0x245263(0x189)+a20_0x245263(0x1a9),'helpExtra':[a20_0x245263(0x1a7),'\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}',a20_0x245263(0x1a4),a20_0x245263(0x1a6),'\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','\x20\x20\x20\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_0x245263(0x1a2),'\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','',a20_0x245263(0x18e),'\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]',a20_0x245263(0x17b),a20_0x245263(0x163),a20_0x245263(0x1aa),a20_0x245263(0x1ab),a20_0x245263(0x16a),'','\x20\x20EXAMPLES',a20_0x245263(0x165),a20_0x245263(0x166),'',a20_0x245263(0x1a3),'\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','',a20_0x245263(0x1b0)]['join']('\x0a')}];function makeDataCommand(_0x281ad4){const _0x53db2e=a20_0x245263,_0x4209d6=_0x53db2e(0x1a8)+_0x281ad4[_0x53db2e(0x1a1)],_0x35780c={'service':_0x53db2e(0x169),'command':_0x281ad4[_0x53db2e(0x1a1)],'description':_0x281ad4[_0x53db2e(0x171)],'risk':_0x281ad4[_0x53db2e(0x182)],'helpExtra':_0x281ad4['helpExtra'],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x281ad4[_0x53db2e(0x1ac)]}],'validate':async _0x5634f5=>{const _0x5d1cc5=_0x53db2e;_0x281ad4[_0x5d1cc5(0x173)]&&requireAnyOf(_0x5634f5,[_0x5d1cc5(0x19d)],_0x4209d6),_0x281ad4['operation']===_0x5d1cc5(0x17a)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x5634f5[_0x5d1cc5(0x176)](_0x5d1cc5(0x19d))));},async 'execute'(_0x4ca9ba){const _0x4484d4=_0x53db2e,_0x537f03=_0x4ca9ba['str'](_0x4484d4(0x17d)),_0x29b53d=_0x281ad4[_0x4484d4(0x199)]===_0x4484d4(0x17a)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x4ca9ba[_0x4484d4(0x176)](_0x4484d4(0x19d)))):parseJsonParams(_0x4ca9ba[_0x4484d4(0x176)]('params'))??{},_0x169cfc=Date['now'](),_0x3fefd4=await executeData(_0x537f03,_0x281ad4['operation'],_0x29b53d),_0x490fae=Date['now']()-_0x169cfc;return{'ok':!![],'data':{'result':_0x3fefd4,'elapsed':_0x490fae},'message':_0x4484d4(0x1a8)+_0x281ad4[_0x4484d4(0x1a1)]+_0x4484d4(0x170)+_0x490fae+'ms'};}};return _0x281ad4['risk']!==_0x53db2e(0x1af)&&(_0x35780c[_0x53db2e(0x19c)]=async _0x241883=>{const _0x1179da=_0x53db2e,_0x33e8f2=_0x241883[_0x1179da(0x176)](_0x1179da(0x17d)),_0x322369=_0x281ad4[_0x1179da(0x199)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x241883[_0x1179da(0x176)]('params'))):parseJsonParams(_0x241883['str'](_0x1179da(0x19d)))??{};return dryRun(_0x1179da(0x1a5),_0x1179da(0x172)+_0x33e8f2+'/'+_0x281ad4['operation'])['body'](_0x322369)['description'](_0x1179da(0x18d)+_0x281ad4[_0x1179da(0x1a1)]+'\x20on\x20dataset\x20'+_0x33e8f2)[_0x1179da(0x194)]();}),_0x35780c;}function a20_0x4d7c(_0x1c603e,_0x4d438c){_0x1c603e=_0x1c603e-0x161;const _0x4cf1f0=a20_0x4cf1();let _0x4d7c9f=_0x4cf1f0[_0x1c603e];return _0x4d7c9f;}export const dataDefinitions=specs['map'](makeDataCommand);
|
|
1
|
+
const a20_0x21a95c=a20_0x2c8d;(function(_0xdaca1a,_0x236220){const _0x286102=a20_0x2c8d,_0x117496=_0xdaca1a();while(!![]){try{const _0x5ecc43=parseInt(_0x286102(0x114))/0x1+parseInt(_0x286102(0xfc))/0x2+-parseInt(_0x286102(0x10c))/0x3+-parseInt(_0x286102(0xf3))/0x4*(-parseInt(_0x286102(0xf8))/0x5)+-parseInt(_0x286102(0x10d))/0x6+-parseInt(_0x286102(0x116))/0x7*(-parseInt(_0x286102(0x130))/0x8)+-parseInt(_0x286102(0x106))/0x9*(parseInt(_0x286102(0x138))/0xa);if(_0x5ecc43===_0x236220)break;else _0x117496['push'](_0x117496['shift']());}catch(_0xb63c80){_0x117496['push'](_0x117496['shift']());}}}(a20_0x3655,0x83be3));function a20_0x3655(){const _0x383a94=['read','update','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','\x20\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}','Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','helpExtra','str','POST','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','data','create','Update\x20an\x20existing\x20record','data\x20','\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}','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','map','\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}}','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','paramsRequired','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','8MDHOLE','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','risk','\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}}','Preview:\x20data\x20','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','\x20\x20\x20\x20$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$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','10JLGzdS','Get\x20a\x20single\x20record\x20by\x20ID','command','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','delete','\x20\x20EXAMPLES','\x20\x20PAGINATION','write','\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\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','Filter\x20dataset\x20records\x20with\x20query\x20conditions','\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}}','now','join','92DyAbPp','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','getOne','code','141285KMSBIX','\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}','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\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','816666QkTPAg','\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}}]','batchCreate','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\x20\x20AGGREGATE\x20TYPES','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','filter','paramsHint','operation','build','5295033XTptAH','\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\x20LOGICAL\x20COMBINATORS','\x20on\x20dataset\x20','\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','dryRun','1867629LxuWOH','3605472fNvzkP','aggregate','description','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','967266nAZzrH','params','2281307OuFBOA','\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}'];a20_0x3655=function(){return _0x383a94;};return a20_0x3655();}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';function a20_0x2c8d(_0x2a19c3,_0x4239be){_0x2a19c3=_0x2a19c3-0xe6;const _0x365511=a20_0x3655();let _0x2c8d93=_0x365511[_0x2a19c3];return _0x2c8d93;}import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a20_0x21a95c(0x102),'operation':'filter','risk':'read','paramsRequired':![],'description':a20_0x21a95c(0xef),'paramsHint':a20_0x21a95c(0x12c)+a20_0x21a95c(0xfa),'helpExtra':[a20_0x21a95c(0x12a),a20_0x21a95c(0x12b),'\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}',a20_0x21a95c(0x107),a20_0x21a95c(0x136),a20_0x21a95c(0x101),a20_0x21a95c(0xf0),'\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}',a20_0x21a95c(0x133),a20_0x21a95c(0x137),a20_0x21a95c(0x11a),'',a20_0x21a95c(0x108),'\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','',a20_0x21a95c(0x120),a20_0x21a95c(0x127),a20_0x21a95c(0xed),'\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]',a20_0x21a95c(0x128),'\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','',a20_0x21a95c(0xeb),a20_0x21a95c(0xee),a20_0x21a95c(0x12e),a20_0x21a95c(0x112)][a20_0x21a95c(0xf2)]('\x0a')},{'command':'getOne','operation':a20_0x21a95c(0xf6),'risk':a20_0x21a95c(0x118),'paramsRequired':!![],'description':a20_0x21a95c(0xe6),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a20_0x21a95c(0x122),'operation':a20_0x21a95c(0x122),'risk':'write','paramsRequired':!![],'description':a20_0x21a95c(0x110),'paramsHint':'JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27'},{'command':a20_0x21a95c(0xfe),'operation':a20_0x21a95c(0xfe),'risk':'write','paramsRequired':!![],'description':a20_0x21a95c(0xf4),'paramsHint':'JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27'},{'command':a20_0x21a95c(0x119),'operation':'update','risk':a20_0x21a95c(0xec),'paramsRequired':!![],'description':a20_0x21a95c(0x123),'paramsHint':a20_0x21a95c(0x126)},{'command':a20_0x21a95c(0xe9),'operation':'delete','risk':'high-risk-write','paramsRequired':!![],'description':a20_0x21a95c(0x111),'paramsHint':a20_0x21a95c(0xff)},{'command':a20_0x21a95c(0x10e),'operation':a20_0x21a95c(0x10e),'risk':a20_0x21a95c(0x118),'paramsRequired':![],'description':a20_0x21a95c(0x131),'paramsHint':a20_0x21a95c(0xe8)+a20_0x21a95c(0x11c),'helpExtra':[a20_0x21a95c(0x100),a20_0x21a95c(0x117),a20_0x21a95c(0x11b),a20_0x21a95c(0x12f),a20_0x21a95c(0xf9),a20_0x21a95c(0x125),'\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','','\x20\x20PARAMS\x20STRUCTURE','\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)','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)',a20_0x21a95c(0x113),a20_0x21a95c(0xfd),a20_0x21a95c(0x135),'',a20_0x21a95c(0xea),'\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status',a20_0x21a95c(0xfb),'',a20_0x21a95c(0xf5),a20_0x21a95c(0x10a),'','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.'][a20_0x21a95c(0xf2)]('\x0a')}];function makeDataCommand(_0x1acbcc){const _0x1cc841=a20_0x21a95c,_0x874313=_0x1cc841(0x124)+_0x1acbcc[_0x1cc841(0xe7)],_0xbb86fd={'service':_0x1cc841(0x121),'command':_0x1acbcc[_0x1cc841(0xe7)],'description':_0x1acbcc[_0x1cc841(0x10f)],'risk':_0x1acbcc[_0x1cc841(0x132)],'helpExtra':_0x1acbcc[_0x1cc841(0x11d)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x1acbcc[_0x1cc841(0x103)]}],'validate':async _0x3cf6fc=>{const _0x168923=_0x1cc841;_0x1acbcc[_0x168923(0x12d)]&&requireAnyOf(_0x3cf6fc,['params'],_0x874313),_0x1acbcc[_0x168923(0x104)]==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x3cf6fc[_0x168923(0x11e)]('params')));},async 'execute'(_0x403fda){const _0xf7719=_0x1cc841,_0x44f0ed=_0x403fda['str'](_0xf7719(0xf7)),_0x4e3c91=_0x1acbcc[_0xf7719(0x104)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x403fda['str'](_0xf7719(0x115)))):parseJsonParams(_0x403fda[_0xf7719(0x11e)](_0xf7719(0x115)))??{},_0xc5a0d3=Date['now'](),_0xdc1eb9=await executeData(_0x44f0ed,_0x1acbcc[_0xf7719(0x104)],_0x4e3c91),_0x26d143=Date[_0xf7719(0xf1)]()-_0xc5a0d3;return{'ok':!![],'data':{'result':_0xdc1eb9,'elapsed':_0x26d143},'message':_0xf7719(0x124)+_0x1acbcc[_0xf7719(0xe7)]+'\x20completed\x20in\x20'+_0x26d143+'ms'};}};return _0x1acbcc[_0x1cc841(0x132)]!==_0x1cc841(0x118)&&(_0xbb86fd[_0x1cc841(0x10b)]=async _0x35519f=>{const _0x5c0add=_0x1cc841,_0xf7954e=_0x35519f['str']('code'),_0xdcb7c5=_0x1acbcc[_0x5c0add(0x104)]===_0x5c0add(0xfe)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x35519f[_0x5c0add(0x11e)](_0x5c0add(0x115)))):parseJsonParams(_0x35519f['str'](_0x5c0add(0x115)))??{};return dryRun(_0x5c0add(0x11f),'/api/{appCode}/'+_0xf7954e+'/'+_0x1acbcc[_0x5c0add(0x104)])['body'](_0xdcb7c5)['description'](_0x5c0add(0x134)+_0x1acbcc[_0x5c0add(0xe7)]+_0x5c0add(0x109)+_0xf7954e)[_0x5c0add(0x105)]();}),_0xbb86fd;}export const dataDefinitions=specs[a20_0x21a95c(0x129)](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0xc09a57=a21_0x4b5d;function a21_0x8346(){const _0x35eb69=['Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','afterScriptId','tableName','modifierNameField','code','allFields','30936AxMDkV','extend','object','relatedPageInfoList','allFieldNames','split','properties','length','doType','beforeScriptId','str','12vFArcM','2328516OlkAax','toField','host','toDatasetName','name','type','labelField','responseBody','requestBody','8679EMrWiX','method','dataType','7109830PzOzxY','dbId','2140Dsgmzv','fromField','filter','string','appCode','sourceType','displayName','toFieldLabel','dataset','8UQFRas','dbName','source','1034719Qwsvmo','dblinkInfoDTO','deleted','5zGcHpJ','validateRules','entries','createTimeField','title','map','modelId','27333lfAlAj','modelCode','150642RWCyUg','formatRules','614186OPsHUT','dbType','isArray','logicField','detail','toDatasetCode','datasetKey','trim','dbtableConfig','options','pkField','parse','requestFields','fields','path','description','required','indexes','responseFields','columnCodeListWithDeleted'];a21_0x8346=function(){return _0x35eb69;};return a21_0x8346();}(function(_0x47c844,_0x5d6c8d){const _0x4f00b5=a21_0x4b5d,_0x483c48=_0x47c844();while(!![]){try{const _0x2b351e=parseInt(_0x4f00b5(0x11a))/0x1+-parseInt(_0x4f00b5(0x128))/0x2*(parseInt(_0x4f00b5(0xff))/0x3)+parseInt(_0x4f00b5(0x100))/0x4+parseInt(_0x4f00b5(0x11d))/0x5*(-parseInt(_0x4f00b5(0x126))/0x6)+parseInt(_0x4f00b5(0x10c))/0x7*(-parseInt(_0x4f00b5(0x117))/0x8)+-parseInt(_0x4f00b5(0x124))/0x9*(parseInt(_0x4f00b5(0x10e))/0xa)+-parseInt(_0x4f00b5(0x109))/0xb*(-parseInt(_0x4f00b5(0xf4))/0xc);if(_0x2b351e===_0x5d6c8d)break;else _0x483c48['push'](_0x483c48['shift']());}catch(_0x3f13ad){_0x483c48['push'](_0x483c48['shift']());}}}(a21_0x8346,0xb2a9b));function a21_0x4b5d(_0x34efb5,_0x282480){_0x34efb5=_0x34efb5-0xdd;const _0x83467e=a21_0x8346();let _0x4b5d81=_0x83467e[_0x34efb5];return _0x4b5d81;}import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x417811){const _0x1a9c4d=a21_0x4b5d;if(_0x417811[_0x1a9c4d(0x11c)])return null;const _0x1905bf=Boolean(_0x417811['displayName']!==undefined||_0x417811[_0x1a9c4d(0xfc)]!==undefined);let _0x39d64c={};if(!_0x1905bf&&typeof _0x417811[_0x1a9c4d(0xf5)]===_0x1a9c4d(0x111))try{_0x39d64c=JSON[_0x1a9c4d(0xe5)](_0x417811[_0x1a9c4d(0xf5)]);}catch{}const _0x212461=_0x1905bf?_0x417811[_0x1a9c4d(0x104)]:_0x417811[_0x1a9c4d(0xf2)],_0x1ad493=_0x1905bf?_0x417811[_0x1a9c4d(0x114)]:_0x417811[_0x1a9c4d(0x104)],_0x384f7e=_0x1905bf?_0x417811[_0x1a9c4d(0xfc)]:_0x417811[_0x1a9c4d(0x105)]||_0x417811[_0x1a9c4d(0x10b)],_0x168976=_0x1905bf?_0x417811[_0x1a9c4d(0xe4)]===!![]:_0x39d64c[_0x1a9c4d(0xe4)]===!![],_0x233bd1=_0x1905bf?_0x417811[_0x1a9c4d(0xea)]===!![]:_0x39d64c['required']===!![],_0x4e332d=_0x1905bf?_0x417811[_0x1a9c4d(0xe3)]??null:_0x39d64c[_0x1a9c4d(0xe3)]??null,_0xc38587={'name':_0x212461,'displayName':_0x1ad493||_0x212461,'type':_0x384f7e,'dbType':_0x417811[_0x1a9c4d(0x129)],'pk':_0x168976,'required':_0x233bd1,'description':_0x417811[_0x1a9c4d(0xe9)]||undefined};return Array[_0x1a9c4d(0x12a)](_0x4e332d)&&_0x4e332d[_0x1a9c4d(0xfb)]>0x0&&(_0xc38587['options']=_0x4e332d),_0xc38587;}function parseJsonMaybe(_0x43fbf0){const _0x250d2=a21_0x4b5d;if(typeof _0x43fbf0!==_0x250d2(0x111))return _0x43fbf0;try{return JSON[_0x250d2(0xe5)](_0x43fbf0);}catch{return _0x43fbf0;}}function normalizeOperationEntry(_0x9f2ba3,_0x25f1ea){const _0x233dc1=a21_0x4b5d;if(!_0x25f1ea||typeof _0x25f1ea!==_0x233dc1(0xf6))return null;if(!_0x25f1ea['method']||!_0x25f1ea['path'])return null;const _0x8719b1={'name':_0x9f2ba3,'method':_0x25f1ea[_0x233dc1(0x10a)],'path':_0x25f1ea[_0x233dc1(0xe8)]};if(_0x25f1ea['host'])_0x8719b1[_0x233dc1(0x102)]=_0x25f1ea['host'];if(_0x25f1ea[_0x233dc1(0x108)]!=null)_0x8719b1[_0x233dc1(0x108)]=parseJsonMaybe(_0x25f1ea['requestBody']);if(_0x25f1ea[_0x233dc1(0x107)]!=null)_0x8719b1[_0x233dc1(0x107)]=parseJsonMaybe(_0x25f1ea[_0x233dc1(0x107)]);if(_0x25f1ea[_0x233dc1(0xfd)]!=null)_0x8719b1['beforeScriptId']=_0x25f1ea[_0x233dc1(0xfd)];if(_0x25f1ea[_0x233dc1(0xef)]!=null)_0x8719b1[_0x233dc1(0xef)]=_0x25f1ea['afterScriptId'];if(Array[_0x233dc1(0x12a)](_0x25f1ea['requestFields']))_0x8719b1[_0x233dc1(0xe6)]=_0x25f1ea['requestFields'];if(Array[_0x233dc1(0x12a)](_0x25f1ea[_0x233dc1(0xec)]))_0x8719b1['responseFields']=_0x25f1ea[_0x233dc1(0xec)];return _0x8719b1;}function summarizeDbtable(_0x55a178){const _0x588ead=a21_0x4b5d,_0x451401={},_0x5d8042=[_0x588ead(0x10d),_0x588ead(0x118),_0x588ead(0xf0),_0x588ead(0xe0),_0x588ead(0xe4),_0x588ead(0xf3),_0x588ead(0xdd),_0x588ead(0x120),'updateTimeField','creatorIdField','creatorNameField','modifierIdField',_0x588ead(0xf1),_0x588ead(0x106),_0x588ead(0x11b)];for(const _0x279e09 of _0x5d8042){if(_0x55a178[_0x279e09]!==undefined)_0x451401[_0x279e09]=_0x55a178[_0x279e09];}return typeof _0x451401[_0x588ead(0xf3)]===_0x588ead(0x111)&&_0x451401[_0x588ead(0xf3)][_0x588ead(0xfb)]>0x0&&(_0x451401[_0x588ead(0xf8)]=_0x451401[_0x588ead(0xf3)][_0x588ead(0xf9)](',')['map'](_0x14bbd0=>_0x14bbd0[_0x588ead(0xe1)]())[_0x588ead(0x110)](Boolean)),_0x451401;}function normalizeRelatedPages(_0x1c08e8){const _0x448650=a21_0x4b5d;if(!Array['isArray'](_0x1c08e8))return[];return _0x1c08e8[_0x448650(0x110)](_0x3712ff=>_0x3712ff&&typeof _0x3712ff===_0x448650(0xf6))[_0x448650(0x122)](_0x4cbcee=>({'id':_0x4cbcee['id'],'type':_0x4cbcee[_0x448650(0x105)],'code':_0x4cbcee[_0x448650(0xf2)],'title':_0x4cbcee[_0x448650(0x121)],'deleted':_0x4cbcee[_0x448650(0x11c)]===!![]}));}function normalizeFallbackFieldName(_0x445dcc,_0x26b0a0){const _0x158eb2=a21_0x4b5d,_0x277f09=_0x445dcc[_0x158eb2(0xe1)]();if(!_0x277f09)return null;return{'name':_0x277f09,'displayName':_0x277f09,'type':undefined,'dbType':undefined,'pk':_0x277f09===_0x26b0a0,'required':![],'description':undefined};}async function loadListFieldFallback(_0x58489a,_0xf71b9c){const _0x369bb8=a21_0x4b5d;if(!_0x58489a||!_0xf71b9c)return[];try{const _0x1980d1=await listDatasets(_0x58489a,{'code':_0xf71b9c}),_0x1eaab1=_0x1980d1['find'](_0x440c20=>_0x440c20[_0x369bb8(0xf2)]===_0xf71b9c)??_0x1980d1[0x0],_0x533e8b=_0x1eaab1?.['dbtableConfig']??{},_0x24e607=typeof _0x533e8b[_0x369bb8(0xf3)]===_0x369bb8(0x111)?_0x533e8b[_0x369bb8(0xf3)][_0x369bb8(0xf9)](','):[];return _0x24e607[_0x369bb8(0x122)](_0x5213a1=>normalizeFallbackFieldName(_0x5213a1,_0x533e8b['pkField']))[_0x369bb8(0x110)](_0x5b4855=>_0x5b4855!==null);}catch{return[];}}export const datasetDetail={'service':a21_0xc09a57(0x116),'command':a21_0xc09a57(0xde),'description':a21_0xc09a57(0xee),'risk':'read','flags':[CODE_FLAG],async 'execute'(_0x336e55){const _0x3e23a4=a21_0xc09a57,_0x511cfa=await getDatasetDetail(_0x336e55[_0x3e23a4(0xfe)](_0x3e23a4(0xf2))),_0x5121ff=Array['isArray'](_0x511cfa[_0x3e23a4(0xe7)])?_0x511cfa[_0x3e23a4(0xe7)]:Array[_0x3e23a4(0x12a)](_0x511cfa[_0x3e23a4(0xfa)])?_0x511cfa[_0x3e23a4(0xfa)]:[];let _0x118821=_0x5121ff[_0x3e23a4(0x122)](_0x4190ec=>normalizeField(_0x4190ec))[_0x3e23a4(0x110)](_0x311117=>_0x311117!==null);_0x118821[_0x3e23a4(0xfb)]===0x0&&(_0x118821=await loadListFieldFallback(_0x336e55[_0x3e23a4(0x112)],_0x336e55[_0x3e23a4(0xfe)](_0x3e23a4(0xf2))));const _0xb25a14=_0x511cfa['operations']??{},_0x2ef9d4=[];for(const [_0x5662b9,_0x839198]of Object[_0x3e23a4(0x11f)](_0xb25a14)){const _0x1dff40=normalizeOperationEntry(_0x5662b9,_0x839198);if(_0x1dff40)_0x2ef9d4['push'](_0x1dff40);}const _0xdf7850=_0x511cfa[_0x3e23a4(0xe2)]??{},_0xa70a8c=_0x511cfa['dataset']??{},_0x4fd3c0=_0xdf7850[_0x3e23a4(0x10d)]!=null?{'id':_0xdf7850[_0x3e23a4(0x10d)],'name':_0xdf7850[_0x3e23a4(0x118)]??null}:undefined;let _0x53b8b7;return typeof _0x511cfa[_0x3e23a4(0xf5)]===_0x3e23a4(0x111)&&(_0x53b8b7=parseJsonMaybe(_0x511cfa['extend'])),{'ok':!![],'data':{'id':_0x511cfa[_0x3e23a4(0x123)]??_0x511cfa['id'],'name':_0x511cfa[_0x3e23a4(0x104)],'code':_0x511cfa[_0x3e23a4(0x125)]||_0x511cfa[_0x3e23a4(0xf2)],'doVersion':_0x511cfa['doVersion'],'description':_0x511cfa['description']||_0xa70a8c['tableComment']||undefined,'source':_0x511cfa[_0x3e23a4(0x119)]||_0xa70a8c[_0x3e23a4(0x113)],'table':_0xdf7850[_0x3e23a4(0xf0)]||_0xa70a8c['tableName'],'datasetKey':_0xdf7850[_0x3e23a4(0xe0)],'pk':_0xdf7850[_0x3e23a4(0xe4)],'db':_0x4fd3c0,'dbtable':summarizeDbtable(_0xdf7850),'fields':_0x118821,'operations':_0x2ef9d4,'indexes':Array[_0x3e23a4(0x12a)](_0xa70a8c[_0x3e23a4(0xeb)])?_0xa70a8c[_0x3e23a4(0xeb)]:[],'relations':Array[_0x3e23a4(0x12a)](_0x511cfa['relations'])?_0x511cfa['relations'][_0x3e23a4(0x122)](_0x199c7b=>({'fromField':_0x199c7b[_0x3e23a4(0x10f)],'toDataset':_0x199c7b[_0x3e23a4(0x103)],'toCode':_0x199c7b[_0x3e23a4(0xdf)],'toTable':_0x199c7b['toTableName'],'toField':_0x199c7b[_0x3e23a4(0x101)],'labelField':_0x199c7b[_0x3e23a4(0x115)]||undefined})):[],'relatedPages':normalizeRelatedPages(_0x511cfa[_0x3e23a4(0xf7)]),...Array[_0x3e23a4(0x12a)](_0x511cfa['columnCodeListWithDeleted'])?{'columnCodeListWithDeleted':_0x511cfa[_0x3e23a4(0xed)]}:{},'formatRules':Array[_0x3e23a4(0x12a)](_0x511cfa[_0x3e23a4(0x127)])?_0x511cfa[_0x3e23a4(0x127)]:[],'validateRules':Array[_0x3e23a4(0x12a)](_0x511cfa[_0x3e23a4(0x11e)])?_0x511cfa['validateRules']:[],..._0x53b8b7!==undefined?{'extend':_0x53b8b7}:{},'stats':{'fieldCount':_0x118821[_0x3e23a4(0xfb)],'operationCount':_0x2ef9d4['length']}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x248f7b,_0x582f34){const _0x5d2ca0=a22_0x5ad3,_0x21271f=_0x248f7b();while(!![]){try{const _0x584ca5=parseInt(_0x5d2ca0(0xe1))/0x1+parseInt(_0x5d2ca0(0xdc))/0x2+parseInt(_0x5d2ca0(0xe2))/0x3*(parseInt(_0x5d2ca0(0xe3))/0x4)+-parseInt(_0x5d2ca0(0xe4))/0x5+parseInt(_0x5d2ca0(0xdb))/0x6*(parseInt(_0x5d2ca0(0xde))/0x7)+-parseInt(_0x5d2ca0(0xe0))/0x8+parseInt(_0x5d2ca0(0xdf))/0x9*(parseInt(_0x5d2ca0(0xdd))/0xa);if(_0x584ca5===_0x582f34)break;else _0x21271f['push'](_0x21271f['shift']());}catch(_0x757cc4){_0x21271f['push'](_0x21271f['shift']());}}}(a22_0x4751,0x2db7d));function a22_0x4751(){const _0xcf70b=['1456235EGgAug','36246ehyQDj','87198OMWYLo','10DXrvQL','112zMlWOX','1080603HblGCj','819000fPEWrM','187034wLqcIm','141Qmwhvo','11364BRiNmI'];a22_0x4751=function(){return _0xcf70b;};return a22_0x4751();}import{datasetList}from'../../commands/dataset/list.js';import{datasetDetail}from'../../commands/dataset/detail.js';function a22_0x5ad3(_0x22fced,_0x16cc3f){_0x22fced=_0x22fced-0xdb;const _0x47515b=a22_0x4751();let _0x5ad3f0=_0x47515b[_0x22fced];return _0x5ad3f0;}import{datasetSdkDoc}from'../../commands/dataset/sdk-doc.js';export const datasetDefinitions=[datasetList,datasetDetail,datasetSdkDoc];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a23_0x37bf73=a23_0x44f4;(function(_0x234f11,_0x53660a){const _0x2d49b2=a23_0x44f4,_0x2769cd=_0x234f11();while(!![]){try{const _0x332e26=parseInt(_0x2d49b2(0x1e2))/0x1*(parseInt(_0x2d49b2(0x1e1))/0x2)+-parseInt(_0x2d49b2(0x1d4))/0x3*(-parseInt(_0x2d49b2(0x1db))/0x4)+-parseInt(_0x2d49b2(0x1e4))/0x5*(-parseInt(_0x2d49b2(0x1d3))/0x6)+-parseInt(_0x2d49b2(0x1e5))/0x7+-parseInt(_0x2d49b2(0x1d1))/0x8*(parseInt(_0x2d49b2(0x1d9))/0x9)+-parseInt(_0x2d49b2(0x1e6))/0xa*(-parseInt(_0x2d49b2(0x1d2))/0xb)+parseInt(_0x2d49b2(0x1df))/0xc;if(_0x332e26===_0x53660a)break;else _0x2769cd['push'](_0x2769cd['shift']());}catch(_0x3da822){_0x2769cd['push'](_0x2769cd['shift']());}}}(a23_0x5e7e,0x936aa));function a23_0x44f4(_0x58f85d,_0x3947b9){_0x58f85d=_0x58f85d-0x1d0;const _0x5e7e27=a23_0x5e7e();let _0x44f49e=_0x5e7e27[_0x58f85d];return _0x44f49e;}import{listDatasets}from'../../core/api-client.js';function a23_0x5e7e(){const _0x5182a7=['list','165QUXTbM','4039021YpNsQB','2269140zFVlMi','dbtableConfig','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','str','appCode','length','datasetKey','name','4323232ZtnsGf','11RBfQTr','100506gfTaAz','375339WANJuE','allFields','string','source','code','18LDaXSz','tableName','12CcBhsG','read','map','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','7660320UkKTdN','description','158gCQWCG','5927FigisG'];a23_0x5e7e=function(){return _0x5182a7;};return a23_0x5e7e();}import{CODE_FLAG}from'../../commands/common/flags.js';export const datasetList={'service':'dataset','command':a23_0x37bf73(0x1e3),'description':a23_0x37bf73(0x1de),'risk':a23_0x37bf73(0x1dc),'flags':[{'name':'name','type':a23_0x37bf73(0x1d6),'description':'Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)'},{...CODE_FLAG,'required':![],'description':a23_0x37bf73(0x1e8)}],async 'execute'(_0x57b50a){const _0x5bcaee=a23_0x37bf73,_0x326bcf=_0x57b50a[_0x5bcaee(0x1e9)]('name'),_0x53711e=_0x57b50a[_0x5bcaee(0x1e9)](_0x5bcaee(0x1d8)),_0x3fd0a6=await listDatasets(_0x57b50a[_0x5bcaee(0x1ea)],{..._0x326bcf&&{'name':_0x326bcf},..._0x53711e&&{'code':_0x53711e}});return{'ok':!![],'data':{'total':_0x3fd0a6[_0x5bcaee(0x1eb)],'datasets':_0x3fd0a6[_0x5bcaee(0x1dd)](_0x37a19c=>{const _0x137cfd=_0x5bcaee,_0x549730=_0x37a19c[_0x137cfd(0x1e7)]??{};return{'id':_0x37a19c['id'],'code':_0x37a19c[_0x137cfd(0x1d8)],'name':_0x37a19c[_0x137cfd(0x1d0)],'source':_0x37a19c[_0x137cfd(0x1d7)],'description':_0x37a19c[_0x137cfd(0x1e0)],'table':_0x549730[_0x137cfd(0x1da)],'datasetKey':_0x549730[_0x137cfd(0x1ec)],'pk':_0x549730['pkField'],'fields':_0x549730[_0x137cfd(0x1d5)]?_0x549730[_0x137cfd(0x1d5)]['split'](',')['map'](_0x18d8e7=>_0x18d8e7['trim']()):[]};})}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x5170d2=a24_0xbce2;function a24_0xbce2(_0x1a188d,_0x54be0c){_0x1a188d=_0x1a188d-0x18b;const _0x424a19=a24_0x424a();let _0xbce245=_0x424a19[_0x1a188d];return _0xbce245;}(function(_0x432958,_0x403962){const _0x2a3229=a24_0xbce2,_0x23ef54=_0x432958();while(!![]){try{const _0x4fa90a=parseInt(_0x2a3229(0x19c))/0x1*(parseInt(_0x2a3229(0x196))/0x2)+parseInt(_0x2a3229(0x190))/0x3*(-parseInt(_0x2a3229(0x18c))/0x4)+parseInt(_0x2a3229(0x194))/0x5+parseInt(_0x2a3229(0x193))/0x6+parseInt(_0x2a3229(0x18f))/0x7*(parseInt(_0x2a3229(0x191))/0x8)+-parseInt(_0x2a3229(0x18b))/0x9*(-parseInt(_0x2a3229(0x197))/0xa)+-parseInt(_0x2a3229(0x195))/0xb;if(_0x4fa90a===_0x403962)break;else _0x23ef54['push'](_0x23ef54['shift']());}catch(_0x9e525f){_0x23ef54['push'](_0x23ef54['shift']());}}}(a24_0x424a,0xc7eba));function a24_0x424a(){const _0x397487=['sdk-doc','Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','string','1592882XPujGZ','9OTRyzY','264epBWrI','#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档','appCode','57862ICNIYu','4923gVbLyo','488ThMEMk','read','1772688jtReZy','5053355zzHumO','37976180ehUfJa','2KSndRL','9763330UHInHB'];a24_0x424a=function(){return _0x397487;};return a24_0x424a();}import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';const DEFAULT_MARKDOWN=a24_0x5170d2(0x18d);export function formatDatasetSdkMarkdown(_0x18d05b){const _0xd58b0c=a24_0x5170d2,_0xb02fef=typeof _0x18d05b===_0xd58b0c(0x19b)?_0x18d05b['trim']():'';return _0xb02fef||DEFAULT_MARKDOWN;}export const datasetSdkDoc={'service':'dataset','command':a24_0x5170d2(0x198),'description':a24_0x5170d2(0x199),'risk':a24_0x5170d2(0x192),'flags':[{...CODE_FLAG,'description':a24_0x5170d2(0x19a)}],async 'execute'(_0x3380f2){const _0xad36b7=a24_0x5170d2,_0x458876=_0x3380f2['str']('code'),_0x53cd94=await getDatasetSdkUsageDoc(_0x458876,_0x3380f2[_0xad36b7(0x18e)]);return{'ok':!![],'data':{'code':_0x458876,'appCode':_0x3380f2[_0xad36b7(0x18e)],'markdown':formatDatasetSdkMarkdown(_0x53cd94)}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x32c121=a25_0x3d21;function a25_0x3d21(_0x406c78,_0x30ddc1){_0x406c78=_0x406c78-0x9f;const _0x14e995=a25_0x14e9();let _0x3d21f1=_0x14e995[_0x406c78];return _0x3d21f1;}(function(_0x1ad5bc,_0x509b94){const _0x25a858=a25_0x3d21,_0xfd06af=_0x1ad5bc();while(!![]){try{const _0xe28d18=parseInt(_0x25a858(0xd8))/0x1+parseInt(_0x25a858(0xf6))/0x2+-parseInt(_0x25a858(0xe5))/0x3+parseInt(_0x25a858(0xde))/0x4+parseInt(_0x25a858(0x9f))/0x5*(parseInt(_0x25a858(0xbf))/0x6)+-parseInt(_0x25a858(0xc4))/0x7*(parseInt(_0x25a858(0xa1))/0x8)+-parseInt(_0x25a858(0xa2))/0x9;if(_0xe28d18===_0x509b94)break;else _0xfd06af['push'](_0xfd06af['shift']());}catch(_0x41e762){_0xfd06af['push'](_0xfd06af['shift']());}}}(a25_0x14e9,0xd5f4b));import a25_0x4fb098 from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';function a25_0x14e9(){const _0x2c7925=['\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','doctor','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','defaultApp','version','name','status','⚠\x20Empty','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','✓\x20Loaded','red','1609066NFTfTs','\x20\x20Service\x20Tree','commandCount','(default:\x20','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','(default)','6051148zngWDa','env','registryPath','platform','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','accessKey','padEnd','3081369ocjaWy','message','missing','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','⚠\x20Empty\x20(treated\x20as\x20{})','read','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','\x20\x20API\x20Endpoints','gray','\x20doctor','yellow','✗\x20Invalid','✓\x20Valid\x20JSON','Diagnose\x20CLI\x20configuration\x20and\x20environment','\x20(accessKey)','(not\x20found)','check','555662EVLvZc','5wlUyBc','source','104qEWzPI','26174133iUdpfc','(set,\x20length=','path','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','log','riskLevel','length','ClientAk','\x20commands)','(removed\x20—\x20cookie\x20auth\x20disabled)','\x20\x20─','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','green','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','(missing)','\x20\x20Config\x20Files','repeat','Project','format','arch','✗\x20Invalid\x20JSON','(unnamed)','(none)','\x20\x20Merged\x20Config','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','\x20(legacy/compat\x20only)','\x20\x20Session\x20check:\x20\x20\x20','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','empty','9385458PMEyUY','\x20\x20Auth','bold','(not\x20set)','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','81956BrxnZS','\x20\x20auth\x20(effective):\x20','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','serviceCount','locale','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20'];a25_0x14e9=function(){return _0x2c7925;};return a25_0x14e9();}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(_0x2a28c7){const _0x1d3834=a25_0x3d21,_0x3cf050=getCliVersion(),_0x30014f=buildConfigFromFlags({});await initGlobalEnvironment(_0x30014f),console[_0x1d3834(0xa6)](),console[_0x1d3834(0xa6)](a25_0x4fb098[_0x1d3834(0xc1)](CLI_BIN_NAME+_0x1d3834(0xee))),console['log'](a25_0x4fb098[_0x1d3834(0xed)]('─'[_0x1d3834(0xb2)](0x32))),console['log'](_0x1d3834(0xcd)+_0x3cf050),console[_0x1d3834(0xa6)](_0x1d3834(0xe8)+process[_0x1d3834(0xd0)]),console['log'](_0x1d3834(0xc9)+process[_0x1d3834(0xe1)]+'\x20'+process[_0x1d3834(0xb5)]),console[_0x1d3834(0xa6)](),console[_0x1d3834(0xa6)](a25_0x4fb098[_0x1d3834(0xc1)](_0x1d3834(0xb1))),console[_0x1d3834(0xa6)](a25_0x4fb098[_0x1d3834(0xed)](_0x1d3834(0xac)[_0x1d3834(0xb2)](0x1e)));const _0x114b8e=getGlobalConfigPath(),_0x14ff01=getProjectConfigPath();console[_0x1d3834(0xa6)](_0x1d3834(0xdc)+(_0x114b8e||a25_0x4fb098[_0x1d3834(0xed)](_0x1d3834(0xf4)))),console['log'](_0x1d3834(0xc3)+(_0x14ff01||a25_0x4fb098[_0x1d3834(0xed)](_0x1d3834(0xf4)))),console[_0x1d3834(0xa6)](),console['log'](a25_0x4fb098['bold']('\x20\x20Config\x20JSON')),console[_0x1d3834(0xa6)](a25_0x4fb098[_0x1d3834(0xed)]('\x20\x20─'[_0x1d3834(0xb2)](0x1e)));const _0x301e43=(_0x1729ec,_0x40ce8e)=>{const _0x56f4d2=_0x1d3834;if(!_0x40ce8e){console[_0x56f4d2(0xa6)]('\x20\x20'+_0x1729ec['padEnd'](0x11)+'\x20'+a25_0x4fb098['gray']('(no\x20file)'));return;}const _0x41e007=inspectCliConfigJsonFile(_0x40ce8e);if(_0x41e007[_0x56f4d2(0xd2)]==='ok')console[_0x56f4d2(0xa6)]('\x20\x20'+_0x1729ec[_0x56f4d2(0xe4)](0x11)+'\x20'+a25_0x4fb098['green'](_0x56f4d2(0xf1)));else{if(_0x41e007[_0x56f4d2(0xd2)]===_0x56f4d2(0xbe))console[_0x56f4d2(0xa6)]('\x20\x20'+_0x1729ec[_0x56f4d2(0xe4)](0x11)+'\x20'+a25_0x4fb098[_0x56f4d2(0xef)](_0x56f4d2(0xe9)));else _0x41e007['status']==='missing'?console['log']('\x20\x20'+_0x1729ec[_0x56f4d2(0xe4)](0x11)+'\x20'+a25_0x4fb098[_0x56f4d2(0xed)](_0x56f4d2(0xb0))):(console[_0x56f4d2(0xa6)]('\x20\x20'+_0x1729ec[_0x56f4d2(0xe4)](0x11)+'\x20'+a25_0x4fb098[_0x56f4d2(0xd7)](_0x56f4d2(0xb6))),console[_0x56f4d2(0xa6)]('\x20\x20'+''[_0x56f4d2(0xe4)](0x11)+'\x20'+a25_0x4fb098[_0x56f4d2(0xd7)](_0x41e007[_0x56f4d2(0xe6)])));}};_0x301e43('Global',_0x114b8e),_0x301e43(_0x1d3834(0xb3),_0x14ff01),console[_0x1d3834(0xa6)](),console[_0x1d3834(0xa6)](a25_0x4fb098['bold'](_0x1d3834(0xb9))),console[_0x1d3834(0xa6)](a25_0x4fb098[_0x1d3834(0xed)](_0x1d3834(0xac)[_0x1d3834(0xb2)](0x1e))),console[_0x1d3834(0xa6)]('\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x30014f['appCode']||a25_0x4fb098['red'](_0x1d3834(0xc2)))),console[_0x1d3834(0xa6)](_0x1d3834(0xd4)+_0x30014f[_0x1d3834(0xdf)]);const _0xbb92e1=isLegacyCompatConfigKey(_0x1d3834(0xc8))?a25_0x4fb098[_0x1d3834(0xed)](_0x30014f['locale']+_0x1d3834(0xbb)):_0x30014f[_0x1d3834(0xc8)];console['log'](_0x1d3834(0xca)+_0xbb92e1),console['log']('\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20'+(_0x30014f[_0x1d3834(0xcf)]||a25_0x4fb098[_0x1d3834(0xed)](_0x1d3834(0xb8)))),console['log'](_0x1d3834(0xaf)+(_0x30014f['currentApp']||a25_0x4fb098[_0x1d3834(0xed)](_0x1d3834(0xb8)))),console[_0x1d3834(0xa6)](_0x1d3834(0xe2)+(_0x30014f[_0x1d3834(0xb4)]||a25_0x4fb098[_0x1d3834(0xed)](_0x1d3834(0xdb)+DEFAULT_CONFIG_VALUES[_0x1d3834(0xb4)]+')'))),console[_0x1d3834(0xa6)](_0x1d3834(0xa5)+(_0x30014f['pageSize']??a25_0x4fb098[_0x1d3834(0xed)](_0x1d3834(0xdd)))),console[_0x1d3834(0xa6)](_0x1d3834(0xba)+_0x30014f[_0x1d3834(0xa7)]),console[_0x1d3834(0xa6)](_0x1d3834(0xad)+_0x30014f['verbose']),console['log'](_0x1d3834(0xc5)+AUTH_MODE['ClientAk']),console[_0x1d3834(0xa6)](_0x1d3834(0xce)+(_0x30014f[_0x1d3834(0xe3)]?a25_0x4fb098[_0x1d3834(0xae)](_0x1d3834(0xa3)+_0x30014f[_0x1d3834(0xe3)][_0x1d3834(0xa8)]+')'):a25_0x4fb098['gray'](_0x1d3834(0xb8)))),console[_0x1d3834(0xa6)](),console[_0x1d3834(0xa6)](a25_0x4fb098[_0x1d3834(0xc1)](_0x1d3834(0xec))),console['log'](a25_0x4fb098[_0x1d3834(0xed)](_0x1d3834(0xac)[_0x1d3834(0xb2)](0x1e))),console['log'](_0x1d3834(0xeb)+getApiDomain()),console[_0x1d3834(0xa6)]('\x20\x20userDomain:\x20\x20\x20\x20\x20\x20'+getUserDomain()),console['log']('\x20\x20runtimeDomain:\x20\x20\x20'+getRuntimeDomain()),console[_0x1d3834(0xa6)](),console[_0x1d3834(0xa6)](a25_0x4fb098[_0x1d3834(0xc1)](_0x1d3834(0xd9))),console[_0x1d3834(0xa6)](a25_0x4fb098[_0x1d3834(0xed)]('\x20\x20─'['repeat'](0x1e)));const _0x105e6b=inspectServiceRegistry();console[_0x1d3834(0xa6)]('\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20'+_0x105e6b[_0x1d3834(0xe0)]),console['log'](_0x1d3834(0xc6)+formatServiceRegistryStatus(_0x105e6b)),console['log'](_0x1d3834(0xcb)+_0x105e6b[_0x1d3834(0xc7)]),console['log'](_0x1d3834(0xbd)+_0x105e6b[_0x1d3834(0xda)]);for(const _0x1ec8d7 of _0x105e6b['services']){console[_0x1d3834(0xa6)]('\x20\x20'+(_0x1ec8d7['serviceCode']+':')[_0x1d3834(0xe4)](0x11)+'\x20'+(_0x1ec8d7[_0x1d3834(0xd1)]||a25_0x4fb098['gray'](_0x1d3834(0xb7)))+'\x20('+_0x1ec8d7[_0x1d3834(0xda)]+_0x1d3834(0xaa)),console[_0x1d3834(0xa6)]('\x20\x20'+''['padEnd'](0x11)+'\x20Imported\x20from:\x20'+_0x1ec8d7[_0x1d3834(0xa0)][_0x1d3834(0xa4)]);}return console[_0x1d3834(0xa6)](),console[_0x1d3834(0xa6)](a25_0x4fb098[_0x1d3834(0xc1)](_0x1d3834(0xc0))),console['log'](a25_0x4fb098[_0x1d3834(0xed)](_0x1d3834(0xac)[_0x1d3834(0xb2)](0x1e))),console[_0x1d3834(0xa6)](_0x1d3834(0xd5)+a25_0x4fb098[_0x1d3834(0xae)](AUTH_MODE[_0x1d3834(0xa9)]+_0x1d3834(0xf3))),console['log'](_0x1d3834(0xbc)+a25_0x4fb098['gray'](_0x1d3834(0xab))),console[_0x1d3834(0xa6)](),{'ok':!![]};}function formatServiceRegistryStatus(_0x421f9c){const _0x19d648=a25_0x3d21;if(_0x421f9c[_0x19d648(0xd2)]==='ok')return a25_0x4fb098['green'](_0x19d648(0xd6));if(_0x421f9c[_0x19d648(0xd2)]===_0x19d648(0xe7))return a25_0x4fb098[_0x19d648(0xed)](_0x19d648(0xf4));if(_0x421f9c['status']===_0x19d648(0xbe))return a25_0x4fb098[_0x19d648(0xef)](_0x19d648(0xd3));return a25_0x4fb098[_0x19d648(0xd7)](_0x19d648(0xf0)+(_0x421f9c[_0x19d648(0xe6)]?':\x20'+_0x421f9c[_0x19d648(0xe6)]:''));}export const doctorDefinition={'service':a25_0x32c121(0xcc),'command':a25_0x32c121(0xf5),'description':a25_0x32c121(0xf2),'risk':a25_0x32c121(0xea),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a26_0x1d08(){const _0x57250f=['validation','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','stdin','project','riskLevel','env','defaultApp','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','name','stdout','removeListener','utf8','parse','Override\x20imported\x20default\x20env','once','cancelled','boolean','\x20\x20env:\x20\x20\x20\x20\x20','newConfigFileName','entries','appcode','85024DgGiWi','trim',')\x20instead\x20of\x20project','includes','apiDir','Override\x20imported\x20default\x20appcode','join','close','111qXxHFg','1438899RBUkZO','Initialized\x20','\x20init\x20—\x20Create\x20','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','Failed\x20to\x20parse\x20source\x20file:\x20','Skip\x20confirmation\x20when\x20overwriting','\x22.\x20Allowed:\x20','Imported\x20from\x20','apps','App\x20code\x20cannot\x20be\x20empty.','global','Invalid\x20env\x20\x22','[y/N]','Target\x20environment\x20(default\x20','\x0aInitialized\x20','SIGINT','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','yes','toLowerCase','string','303126rkthVg','app','log','question','860064ldSPXO','960875ytexGK','\x20\x20config:\x20\x20','User\x20aborted\x20prompt','race','):\x20','AbortPrompt','Write\x20to\x20global\x20(~/','\x20\x20appcode:\x20','423672PLViuO','File\x20','\x20\x20default:\x20','file','14164hNPJIy'];a26_0x1d08=function(){return _0x57250f;};return a26_0x1d08();}const a26_0x39e593=a26_0x8510;function a26_0x8510(_0x173703,_0x3757cd){_0x173703=_0x173703-0x75;const _0x1d08d5=a26_0x1d08();let _0x851078=_0x1d08d5[_0x173703];return _0x851078;}(function(_0xecf066,_0x337b08){const _0x9406d7=a26_0x8510,_0x3c61a9=_0xecf066();while(!![]){try{const _0x143cb3=-parseInt(_0x9406d7(0xb6))/0x1+parseInt(_0x9406d7(0x7f))/0x2+-parseInt(_0x9406d7(0xa1))/0x3*(-parseInt(_0x9406d7(0x83))/0x4)+parseInt(_0x9406d7(0x77))/0x5+parseInt(_0x9406d7(0x76))/0x6+-parseInt(_0x9406d7(0xa2))/0x7+-parseInt(_0x9406d7(0x99))/0x8;if(_0x143cb3===_0x337b08)break;else _0x3c61a9['push'](_0x3c61a9['shift']());}catch(_0xc4b8e){_0x3c61a9['push'](_0x3c61a9['shift']());}}}(a26_0x1d08,0x26d55));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a26_0x39e593(0x98),'type':a26_0x39e593(0xb5),'description':'App\x20code\x20for\x20the\x20project'},{'name':a26_0x39e593(0x89),'type':'string','description':a26_0x39e593(0xaf)+DEFAULT_CONFIG_VALUES[a26_0x39e593(0x89)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x39e593(0xac),'type':'boolean','description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a26_0x39e593(0x96)]+a26_0x39e593(0x9b),'default':![]},{'name':a26_0x39e593(0xb3),'type':a26_0x39e593(0x94),'description':a26_0x39e593(0xa7),'default':![]}];export const initImportFlagDefs=[{'name':a26_0x39e593(0x82),'type':a26_0x39e593(0xb5),'description':a26_0x39e593(0xb2),'required':!![]},{'name':a26_0x39e593(0x98),'type':a26_0x39e593(0xb5),'description':a26_0x39e593(0x9e)},{'name':a26_0x39e593(0x89),'type':a26_0x39e593(0xb5),'description':a26_0x39e593(0x91),'enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x39e593(0xac),'type':a26_0x39e593(0x94),'description':a26_0x39e593(0x7d)+PRODUCT_CONFIG[a26_0x39e593(0x96)]+')\x20instead\x20of\x20project','default':![]},{'name':'yes','type':a26_0x39e593(0x94),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x2b989d){const _0x4e8b41=a26_0x39e593,_0x45529a=isNonInteractiveMode(_0x2b989d),_0x372e3c=_0x2b989d['global']?'global':_0x4e8b41(0x87),_0x2afd61=resolveWriteConfigPath(_0x372e3c);try{_0x45529a?await runNonInteractive(_0x2b989d,_0x2afd61):await runInteractive(_0x2b989d,_0x2afd61);}catch(_0x1bb8e2){if(_0x1bb8e2 instanceof AbortPrompt)throw CliErrors[_0x4e8b41(0x93)]();throw _0x1bb8e2;}}export async function runInitImport(_0x13bd6a){const _0x233930=a26_0x39e593,_0x31b08b=_0x13bd6a[_0x233930(0xac)]?_0x233930(0xac):_0x233930(0x87),_0x16ee3e=resolveWriteConfigPath(_0x31b08b);await runFromImport(_0x13bd6a,_0x16ee3e);}const RUNTIME_IRRELEVANT_KEYS=new Set([a26_0x39e593(0x9d)]);async function runFromImport(_0xc2bc6,_0x4c5a2c){const _0x31b287=a26_0x39e593,_0x99cd41=resolveFilePath(_0xc2bc6[_0x31b287(0x82)]);if(!existsSync(_0x99cd41))throw CliErrors['validation']('Source\x20file\x20not\x20found:\x20'+_0x99cd41);const _0x2e23fd=readSourceFile(_0x99cd41),_0x51a6a1=convertToRuntimeConfig(_0x2e23fd);_0xc2bc6[_0x31b287(0x98)]&&(_0x51a6a1[_0x31b287(0x98)]=String(_0xc2bc6[_0x31b287(0x98)]));_0xc2bc6[_0x31b287(0x89)]&&(_0x51a6a1[_0x31b287(0x89)]=resolveInitEnv(_0xc2bc6));if(!_0x51a6a1['appcode'])throw CliErrors['validation']('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','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`.');await writeInitConfig(_0x4c5a2c,_0x51a6a1,_0xc2bc6),console[_0x31b287(0xb8)](_0x31b287(0xa9)+_0x99cd41),console[_0x31b287(0xb8)](_0x31b287(0x78)+_0x4c5a2c),console[_0x31b287(0xb8)](_0x31b287(0x7e)+_0x51a6a1[_0x31b287(0x98)]);if(_0x51a6a1[_0x31b287(0x8a)])console[_0x31b287(0xb8)](_0x31b287(0x81)+_0x51a6a1[_0x31b287(0x8a)]);}function convertToRuntimeConfig(_0x28bece){const _0x1a6b13=a26_0x39e593;if(_0x28bece['apps']&&typeof _0x28bece[_0x1a6b13(0xaa)]==='object')throw CliErrors[_0x1a6b13(0x84)](_0x1a6b13(0x85),_0x1a6b13(0x8b));const _0x1a088a={};for(const _0x358ffa of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x28bece[_0x358ffa]!==undefined&&(_0x1a088a[_0x358ffa]=_0x28bece[_0x358ffa]);}return!_0x1a088a['riskLevel']&&(_0x1a088a[_0x1a6b13(0x88)]=DEFAULT_CONFIG_VALUES[_0x1a6b13(0x88)]),_0x1a088a;}async function runNonInteractive(_0x5ce5db,_0x22d447){const _0x22722b=a26_0x39e593,_0xd8892a=_0x5ce5db[_0x22722b(0x98)];if(!_0xd8892a)throw CliErrors['flagMissing'](_0x22722b(0x98),'Usage:\x20'+CLI_BIN_NAME+_0x22722b(0xa5));const _0x8cf9b8=resolveInitEnv(_0x5ce5db);await writeInitConfig(_0x22d447,{'appcode':_0xd8892a,'env':_0x8cf9b8},_0x5ce5db),console['log'](_0x22722b(0xa3)+_0x22d447),console[_0x22722b(0xb8)](_0x22722b(0x7e)+_0xd8892a),console[_0x22722b(0xb8)](_0x22722b(0x95)+_0x8cf9b8);}async function runInteractive(_0x15f269,_0x4fd9e8){const _0x27c84f=a26_0x39e593,_0x5550a4=loadExisting(_0x4fd9e8),_0x11bf92=typeof _0x5550a4?.[_0x27c84f(0x98)]===_0x27c84f(0xb5)?_0x5550a4[_0x27c84f(0x98)]:'',_0xa8c4b9=resolveInitEnv(_0x15f269);console[_0x27c84f(0xb8)](CLI_BIN_NAME+_0x27c84f(0xa4)+PRODUCT_CONFIG[_0x27c84f(0x96)]+'\x0a');if(existsSync(_0x4fd9e8)&&!_0x15f269[_0x27c84f(0xb3)]){const _0x2a064e=await promptYesNo(_0x27c84f(0x80)+_0x4fd9e8+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x2a064e){console[_0x27c84f(0xb8)]('Aborted.');return;}}const _0x1b34b0=typeof _0x15f269['appcode']===_0x27c84f(0xb5)?_0x15f269[_0x27c84f(0x98)][_0x27c84f(0x9a)]():'';let _0x30b7ed=_0x1b34b0;!_0x30b7ed&&(_0x30b7ed=await promptInput('App\x20code',_0x11bf92));if(!_0x30b7ed[_0x27c84f(0x9a)]())throw CliErrors[_0x27c84f(0x84)](_0x27c84f(0xab));await writeInitConfig(_0x4fd9e8,{'appcode':_0x30b7ed[_0x27c84f(0x9a)](),'env':_0xa8c4b9},_0x15f269),console['log'](_0x27c84f(0xb0)+_0x4fd9e8),console['log'](_0x27c84f(0x7e)+_0x30b7ed[_0x27c84f(0x9a)]()),console['log']('\x20\x20env:\x20\x20\x20\x20\x20'+_0xa8c4b9);}async function writeInitConfig(_0x4d10bd,_0x17650e,_0x4e88b8){const _0x2b9c5e=a26_0x39e593;let _0x32b0e8={};existsSync(_0x4d10bd)&&!_0x4e88b8['yes']&&(_0x32b0e8=readConfigFile(_0x4d10bd));for(const [_0x1eb63b,_0x3c4c38]of Object[_0x2b9c5e(0x97)](_0x17650e)){_0x3c4c38!==undefined&&(_0x32b0e8[_0x1eb63b]=_0x3c4c38);}if(_0x32b0e8[_0x2b9c5e(0xb7)])delete _0x32b0e8['app'];writeConfigFile(_0x4d10bd,_0x32b0e8);}class AbortPrompt extends Error{constructor(){const _0x52560c=a26_0x39e593;super(_0x52560c(0x79)),this[_0x52560c(0x8c)]=_0x52560c(0x7c);}}function createSafeRl(){const _0xb67040=a26_0x39e593,_0x29e729=createInterface({'input':process[_0xb67040(0x86)],'output':process[_0xb67040(0x8d)]});let _0x2ad39e;const _0x470967=new Promise((_0x58a333,_0x4eec4d)=>{const _0x96a652=_0xb67040;_0x2ad39e=()=>{const _0x3b92d9=a26_0x8510;_0x2ad39e&&(_0x29e729[_0x3b92d9(0x8e)]('SIGINT',_0x2ad39e),_0x2ad39e=undefined);try{_0x29e729[_0x3b92d9(0xa0)]();}catch{}_0x4eec4d(new AbortPrompt());},_0x29e729[_0x96a652(0x92)](_0x96a652(0xb1),_0x2ad39e);}),_0x47c37e=()=>{const _0x280df6=_0xb67040;_0x2ad39e&&(_0x29e729[_0x280df6(0x8e)](_0x280df6(0xb1),_0x2ad39e),_0x2ad39e=undefined);try{_0x29e729[_0x280df6(0xa0)]();}catch{}};return{'rl':_0x29e729,'abortPromise':_0x470967,'disposeSuccess':_0x47c37e};}async function promptInput(_0x482558,_0x216ecb){const _0x392517=a26_0x39e593,{rl:_0x1cc6ee,abortPromise:_0x1dabcf,disposeSuccess:_0x2cd116}=createSafeRl(),_0x2b28c7=new Promise(_0x5b4311=>{const _0x32e24e=a26_0x8510,_0x5340f8=_0x216ecb?'\x20\x20'+_0x482558+'\x20('+_0x216ecb+_0x32e24e(0x7b):'\x20\x20'+_0x482558+':\x20';_0x1cc6ee[_0x32e24e(0x75)](_0x5340f8,_0x2d9699=>{const _0x5c82e2=_0x32e24e;_0x2cd116(),_0x5b4311(_0x2d9699[_0x5c82e2(0x9a)]()||_0x216ecb);});});return Promise[_0x392517(0x7a)]([_0x2b28c7,_0x1dabcf]);}async function promptYesNo(_0xa2257,_0x316f10){const _0x8a0a92=a26_0x39e593,{rl:_0x523f91,abortPromise:_0x2e3173,disposeSuccess:_0x3133d6}=createSafeRl(),_0x69e496=new Promise(_0x4412dc=>{const _0x150771=a26_0x8510,_0x505030=_0x316f10?'[Y/n]':_0x150771(0xae);_0x523f91['question']('\x20\x20'+_0xa2257+'\x20'+_0x505030+':\x20',_0x28bc81=>{const _0x5e7d8f=_0x150771;_0x3133d6();const _0x2367c7=_0x28bc81['trim']()[_0x5e7d8f(0xb4)]();if(_0x2367c7==='y'||_0x2367c7===_0x5e7d8f(0xb3))_0x4412dc(!![]);else{if(_0x2367c7==='n'||_0x2367c7==='no')_0x4412dc(![]);else _0x4412dc(_0x316f10);}});});return Promise[_0x8a0a92(0x7a)]([_0x69e496,_0x2e3173]);}function loadExisting(_0x4c18e9){if(!existsSync(_0x4c18e9))return null;return readConfigFile(_0x4c18e9);}function resolveFilePath(_0xa43011){return isAbsolute(_0xa43011)?_0xa43011:resolve(process['cwd'](),_0xa43011);}function readSourceFile(_0x529b9d){const _0x2851d5=a26_0x39e593;try{const _0x4d8225=readFileSync(_0x529b9d,{'encoding':_0x2851d5(0x8f)});return JSON[_0x2851d5(0x90)](_0x4d8225);}catch(_0x52bf99){throw CliErrors[_0x2851d5(0x84)](_0x2851d5(0xa6)+_0x52bf99['message']);}}function resolveInitEnv(_0x516795){const _0x33a7c6=a26_0x39e593,_0x4532a2=_0x516795[_0x33a7c6(0x89)];if(_0x4532a2===undefined||_0x4532a2==='')return DEFAULT_CONFIG_VALUES[_0x33a7c6(0x89)];if(!RUNTIME_ENV_VALUES[_0x33a7c6(0x9c)](_0x4532a2))throw CliErrors[_0x33a7c6(0x84)](_0x33a7c6(0xad)+_0x4532a2+_0x33a7c6(0xa8)+RUNTIME_ENV_VALUES[_0x33a7c6(0x9f)](',\x20'));return _0x4532a2;}
|
|
1
|
+
const a26_0x673cad=a26_0x9359;(function(_0x522d47,_0x400eab){const _0xb8cdf7=a26_0x9359,_0x587a99=_0x522d47();while(!![]){try{const _0x5e3acf=-parseInt(_0xb8cdf7(0x1b5))/0x1*(-parseInt(_0xb8cdf7(0x1a5))/0x2)+parseInt(_0xb8cdf7(0x1aa))/0x3*(-parseInt(_0xb8cdf7(0x1eb))/0x4)+-parseInt(_0xb8cdf7(0x1d0))/0x5+parseInt(_0xb8cdf7(0x1de))/0x6*(parseInt(_0xb8cdf7(0x1d1))/0x7)+parseInt(_0xb8cdf7(0x1d6))/0x8+parseInt(_0xb8cdf7(0x1da))/0x9+-parseInt(_0xb8cdf7(0x1a7))/0xa;if(_0x5e3acf===_0x400eab)break;else _0x587a99['push'](_0x587a99['shift']());}catch(_0x2a5918){_0x587a99['push'](_0x587a99['shift']());}}}(a26_0x563a,0xcb7de));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';function a26_0x563a(){const _0x2316e6=['boolean','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','defaultApp','apps','trim','race','\x20\x20default:\x20',')\x20instead\x20of\x20project','Write\x20to\x20global\x20(~/','App\x20code','toLowerCase','entries','name','Source\x20file\x20not\x20found:\x20','\x20\x20config:\x20\x20','env','\x20\x20appcode:\x20','\x20already\x20exists.\x20Overwrite?','\x20\x20env:\x20\x20\x20\x20\x20','cwd','file','676015XDLJLv','49Kdgqwu','string','newConfigFileName','validation','User\x20aborted\x20prompt','12956512ZvfdDU','AbortPrompt','Failed\x20to\x20parse\x20source\x20file:\x20','appcode','5582862NtDSQd','[y/N]','Initialized\x20','cancelled','1135842ByzFlw','stdout','\x0aInitialized\x20','question','Imported\x20from\x20','join','message','\x20init\x20—\x20Create\x20','yes','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`.','Target\x20environment\x20(default\x20','App\x20code\x20cannot\x20be\x20empty.','global','5169272iyntWD','Skip\x20confirmation\x20when\x20overwriting','2408216dOICuF','apiDir','25081160LAdqzy','\x22.\x20Allowed:\x20','flagMissing','3sgUbVY','Override\x20imported\x20default\x20env','app','project','log','riskLevel','stdin','App\x20code\x20for\x20the\x20project','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Usage:\x20','1BODPiC','close','SIGINT','Invalid\x20env\x20\x22','includes','Aborted.'];a26_0x563a=function(){return _0x2316e6;};return a26_0x563a();}import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a26_0x673cad(0x1d9),'type':a26_0x673cad(0x1d2),'description':a26_0x673cad(0x1b1)},{'name':a26_0x673cad(0x1ca),'type':'string','description':a26_0x673cad(0x1e8)+DEFAULT_CONFIG_VALUES[a26_0x673cad(0x1ca)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x673cad(0x1ea),'type':a26_0x673cad(0x1bb),'description':a26_0x673cad(0x1c3)+PRODUCT_CONFIG[a26_0x673cad(0x1d3)]+a26_0x673cad(0x1c2),'default':![]},{'name':a26_0x673cad(0x1e6),'type':'boolean','description':a26_0x673cad(0x1ec),'default':![]}];export const initImportFlagDefs=[{'name':a26_0x673cad(0x1cf),'type':'string','description':a26_0x673cad(0x1b2),'required':!![]},{'name':a26_0x673cad(0x1d9),'type':a26_0x673cad(0x1d2),'description':'Override\x20imported\x20default\x20appcode'},{'name':a26_0x673cad(0x1ca),'type':a26_0x673cad(0x1d2),'description':a26_0x673cad(0x1ab),'enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x673cad(0x1ea),'type':a26_0x673cad(0x1bb),'description':a26_0x673cad(0x1c3)+PRODUCT_CONFIG[a26_0x673cad(0x1d3)]+')\x20instead\x20of\x20project','default':![]},{'name':a26_0x673cad(0x1e6),'type':a26_0x673cad(0x1bb),'description':a26_0x673cad(0x1ec),'default':![]}];export async function runInit(_0x250a4f){const _0x3b309c=a26_0x673cad,_0x3350b6=isNonInteractiveMode(_0x250a4f),_0x1631cd=_0x250a4f[_0x3b309c(0x1ea)]?_0x3b309c(0x1ea):_0x3b309c(0x1ad),_0x2d3f8f=resolveWriteConfigPath(_0x1631cd);try{_0x3350b6?await runNonInteractive(_0x250a4f,_0x2d3f8f):await runInteractive(_0x250a4f,_0x2d3f8f);}catch(_0x16050a){if(_0x16050a instanceof AbortPrompt)throw CliErrors[_0x3b309c(0x1dd)]();throw _0x16050a;}}export async function runInitImport(_0x105ee3){const _0x367372=a26_0x673cad,_0x379545=_0x105ee3['global']?_0x367372(0x1ea):_0x367372(0x1ad),_0x328e0b=resolveWriteConfigPath(_0x379545);await runFromImport(_0x105ee3,_0x328e0b);}const RUNTIME_IRRELEVANT_KEYS=new Set([a26_0x673cad(0x1a6)]);async function runFromImport(_0x413451,_0x386e15){const _0x4ad329=a26_0x673cad,_0x1f9475=resolveFilePath(_0x413451[_0x4ad329(0x1cf)]);if(!existsSync(_0x1f9475))throw CliErrors[_0x4ad329(0x1d4)](_0x4ad329(0x1c8)+_0x1f9475);const _0x37ae08=readSourceFile(_0x1f9475),_0x3eb028=convertToRuntimeConfig(_0x37ae08);_0x413451['appcode']&&(_0x3eb028[_0x4ad329(0x1d9)]=String(_0x413451[_0x4ad329(0x1d9)]));_0x413451['env']&&(_0x3eb028[_0x4ad329(0x1ca)]=resolveInitEnv(_0x413451));if(!_0x3eb028[_0x4ad329(0x1d9)])throw CliErrors[_0x4ad329(0x1d4)](_0x4ad329(0x1bc),_0x4ad329(0x1e7));await writeInitConfig(_0x386e15,_0x3eb028,_0x413451),console[_0x4ad329(0x1ae)](_0x4ad329(0x1e2)+_0x1f9475),console[_0x4ad329(0x1ae)](_0x4ad329(0x1c9)+_0x386e15),console[_0x4ad329(0x1ae)]('\x20\x20appcode:\x20'+_0x3eb028['appcode']);if(_0x3eb028['defaultApp'])console[_0x4ad329(0x1ae)](_0x4ad329(0x1c1)+_0x3eb028[_0x4ad329(0x1bd)]);}function convertToRuntimeConfig(_0x31d237){const _0x17a4ff=a26_0x673cad;if(_0x31d237['apps']&&typeof _0x31d237[_0x17a4ff(0x1be)]==='object')throw CliErrors[_0x17a4ff(0x1d4)](_0x17a4ff(0x1b3),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x31e8b5={};for(const _0x2e4d17 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x31d237[_0x2e4d17]!==undefined&&(_0x31e8b5[_0x2e4d17]=_0x31d237[_0x2e4d17]);}return!_0x31e8b5[_0x17a4ff(0x1af)]&&(_0x31e8b5[_0x17a4ff(0x1af)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x31e8b5;}async function runNonInteractive(_0x293681,_0xdda148){const _0x5a8a87=a26_0x673cad,_0x15dc24=_0x293681['appcode'];if(!_0x15dc24)throw CliErrors[_0x5a8a87(0x1a9)](_0x5a8a87(0x1d9),_0x5a8a87(0x1b4)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0xb05980=resolveInitEnv(_0x293681);await writeInitConfig(_0xdda148,{'appcode':_0x15dc24,'env':_0xb05980},_0x293681),console[_0x5a8a87(0x1ae)](_0x5a8a87(0x1dc)+_0xdda148),console[_0x5a8a87(0x1ae)](_0x5a8a87(0x1cb)+_0x15dc24),console[_0x5a8a87(0x1ae)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0xb05980);}async function runInteractive(_0x58cc0b,_0x5ce12e){const _0x12c53b=a26_0x673cad,_0x54ad2e=loadExisting(_0x5ce12e),_0x1d53a9=typeof _0x54ad2e?.[_0x12c53b(0x1d9)]===_0x12c53b(0x1d2)?_0x54ad2e[_0x12c53b(0x1d9)]:'',_0x4ad219=resolveInitEnv(_0x58cc0b);console[_0x12c53b(0x1ae)](CLI_BIN_NAME+_0x12c53b(0x1e5)+PRODUCT_CONFIG[_0x12c53b(0x1d3)]+'\x0a');if(existsSync(_0x5ce12e)&&!_0x58cc0b[_0x12c53b(0x1e6)]){const _0x1442ed=await promptYesNo('File\x20'+_0x5ce12e+_0x12c53b(0x1cc),![]);if(!_0x1442ed){console['log'](_0x12c53b(0x1ba));return;}}const _0x280b13=typeof _0x58cc0b['appcode']==='string'?_0x58cc0b[_0x12c53b(0x1d9)][_0x12c53b(0x1bf)]():'';let _0x3a6ebf=_0x280b13;!_0x3a6ebf&&(_0x3a6ebf=await promptInput(_0x12c53b(0x1c4),_0x1d53a9));if(!_0x3a6ebf[_0x12c53b(0x1bf)]())throw CliErrors[_0x12c53b(0x1d4)](_0x12c53b(0x1e9));await writeInitConfig(_0x5ce12e,{'appcode':_0x3a6ebf[_0x12c53b(0x1bf)](),'env':_0x4ad219},_0x58cc0b),console[_0x12c53b(0x1ae)](_0x12c53b(0x1e0)+_0x5ce12e),console[_0x12c53b(0x1ae)](_0x12c53b(0x1cb)+_0x3a6ebf[_0x12c53b(0x1bf)]()),console[_0x12c53b(0x1ae)](_0x12c53b(0x1cd)+_0x4ad219);}function a26_0x9359(_0x300215,_0x3de408){_0x300215=_0x300215-0x1a5;const _0x563a75=a26_0x563a();let _0x93597a=_0x563a75[_0x300215];return _0x93597a;}async function writeInitConfig(_0x13ce85,_0x6130bd,_0x117a87){const _0x59331a=a26_0x673cad;let _0x3d6e7a={};existsSync(_0x13ce85)&&!_0x117a87[_0x59331a(0x1e6)]&&(_0x3d6e7a=readConfigFile(_0x13ce85));for(const [_0x49a839,_0x4c5cbd]of Object[_0x59331a(0x1c6)](_0x6130bd)){_0x4c5cbd!==undefined&&(_0x3d6e7a[_0x49a839]=_0x4c5cbd);}if(_0x3d6e7a['app'])delete _0x3d6e7a[_0x59331a(0x1ac)];writeConfigFile(_0x13ce85,_0x3d6e7a);}class AbortPrompt extends Error{constructor(){const _0x32827c=a26_0x673cad;super(_0x32827c(0x1d5)),this[_0x32827c(0x1c7)]=_0x32827c(0x1d7);}}function createSafeRl(){const _0x214a8d=a26_0x673cad,_0x6d1a77=createInterface({'input':process[_0x214a8d(0x1b0)],'output':process[_0x214a8d(0x1df)]});let _0x4e368b;const _0x28062b=new Promise((_0x35916f,_0x3c6067)=>{_0x4e368b=()=>{const _0x519695=a26_0x9359;_0x4e368b&&(_0x6d1a77['removeListener'](_0x519695(0x1b7),_0x4e368b),_0x4e368b=undefined);try{_0x6d1a77[_0x519695(0x1b6)]();}catch{}_0x3c6067(new AbortPrompt());},_0x6d1a77['once']('SIGINT',_0x4e368b);}),_0x390b4c=()=>{const _0x166498=_0x214a8d;_0x4e368b&&(_0x6d1a77['removeListener'](_0x166498(0x1b7),_0x4e368b),_0x4e368b=undefined);try{_0x6d1a77[_0x166498(0x1b6)]();}catch{}};return{'rl':_0x6d1a77,'abortPromise':_0x28062b,'disposeSuccess':_0x390b4c};}async function promptInput(_0x47e819,_0x176c73){const _0x2356a4=a26_0x673cad,{rl:_0x8598af,abortPromise:_0x40260b,disposeSuccess:_0x248af1}=createSafeRl(),_0x7cf2cd=new Promise(_0xfb5c81=>{const _0x66ee43=a26_0x9359,_0x386999=_0x176c73?'\x20\x20'+_0x47e819+'\x20('+_0x176c73+'):\x20':'\x20\x20'+_0x47e819+':\x20';_0x8598af[_0x66ee43(0x1e1)](_0x386999,_0x1877cf=>{_0x248af1(),_0xfb5c81(_0x1877cf['trim']()||_0x176c73);});});return Promise[_0x2356a4(0x1c0)]([_0x7cf2cd,_0x40260b]);}async function promptYesNo(_0x5bb9ce,_0x3b2b60){const _0x35ef99=a26_0x673cad,{rl:_0x12b111,abortPromise:_0x583500,disposeSuccess:_0x4ab7a2}=createSafeRl(),_0x331e62=new Promise(_0x2b9bac=>{const _0x68e3ae=a26_0x9359,_0x44502d=_0x3b2b60?'[Y/n]':_0x68e3ae(0x1db);_0x12b111['question']('\x20\x20'+_0x5bb9ce+'\x20'+_0x44502d+':\x20',_0x39dc53=>{const _0xb0f864=_0x68e3ae;_0x4ab7a2();const _0x491aff=_0x39dc53[_0xb0f864(0x1bf)]()[_0xb0f864(0x1c5)]();if(_0x491aff==='y'||_0x491aff===_0xb0f864(0x1e6))_0x2b9bac(!![]);else{if(_0x491aff==='n'||_0x491aff==='no')_0x2b9bac(![]);else _0x2b9bac(_0x3b2b60);}});});return Promise[_0x35ef99(0x1c0)]([_0x331e62,_0x583500]);}function loadExisting(_0x4f840a){if(!existsSync(_0x4f840a))return null;return readConfigFile(_0x4f840a);}function resolveFilePath(_0x174c3c){const _0x408ab3=a26_0x673cad;return isAbsolute(_0x174c3c)?_0x174c3c:resolve(process[_0x408ab3(0x1ce)](),_0x174c3c);}function readSourceFile(_0x23aeae){const _0x78f559=a26_0x673cad;try{const _0x1ebfd4=readFileSync(_0x23aeae,{'encoding':'utf8'});return JSON['parse'](_0x1ebfd4);}catch(_0x52e00a){throw CliErrors[_0x78f559(0x1d4)](_0x78f559(0x1d8)+_0x52e00a[_0x78f559(0x1e4)]);}}function resolveInitEnv(_0x5aa21e){const _0x13fcb6=a26_0x673cad,_0x4bbe5b=_0x5aa21e[_0x13fcb6(0x1ca)];if(_0x4bbe5b===undefined||_0x4bbe5b==='')return DEFAULT_CONFIG_VALUES[_0x13fcb6(0x1ca)];if(!RUNTIME_ENV_VALUES[_0x13fcb6(0x1b9)](_0x4bbe5b))throw CliErrors[_0x13fcb6(0x1d4)](_0x13fcb6(0x1b8)+_0x4bbe5b+_0x13fcb6(0x1a8)+RUNTIME_ENV_VALUES[_0x13fcb6(0x1e3)](',\x20'));return _0x4bbe5b;}
|