@lovrabet/lovrabet-cli 2.1.1-beta.1 → 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
|
-
|
|
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
|
-
(function(
|
|
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
|
-
|
|
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_0xbe9d31=a18_0x5270;(function(_0x4c8a6,_0xd4f59a){const _0x8b550=a18_0x5270,_0x420c1a=_0x4c8a6();while(!![]){try{const _0xe0555b=-parseInt(_0x8b550(0x144))/0x1*(parseInt(_0x8b550(0x143))/0x2)+parseInt(_0x8b550(0x173))/0x3+parseInt(_0x8b550(0x13b))/0x4+parseInt(_0x8b550(0x172))/0x5*(parseInt(_0x8b550(0x152))/0x6)+parseInt(_0x8b550(0x167))/0x7+-parseInt(_0x8b550(0x155))/0x8*(parseInt(_0x8b550(0x14f))/0x9)+-parseInt(_0x8b550(0x175))/0xa*(parseInt(_0x8b550(0x159))/0xb);if(_0xe0555b===_0xd4f59a)break;else _0x420c1a['push'](_0x420c1a['shift']());}catch(_0x199790){_0x420c1a['push'](_0x420c1a['shift']());}}}(a18_0x3af2,0xa56b2));import{CliErrors}from'../../errors.js';function a18_0x5270(_0x30642b,_0x54c26e){_0x30642b=_0x30642b-0x13a;const _0x3af273=a18_0x3af2();let _0x5270a7=_0x3af273[_0x30642b];return _0x5270a7;}import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';function a18_0x3af2(){const _0x5f2d25=['2398880MiWOzZ','\x22.\x20Allowed:\x20','log','value','delete','set','trim','args','547442yISfbh','2MDXecD','project-or-global-explicit','boolean','validation','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','get','apps','\x20\x20project:\x20','includes','`\x20=\x20\x22','length','27InccFa','join','field','6GzWJAM','split','Key\x20\x22','80192qVcOzD','list','key','Settable\x20keys:\x20','588412nZoqbx','raw',';\x20apps.<alias>.appcode','List\x20current\x20config','alias','Value\x20to\x20assign','Usage:\x20','../../context.js','\x20config\x20delete\x20<key>\x20[--global]','isArray','Missing\x20key\x20or\x20value.','keys','\x22\x20not\x20found\x20at\x20top\x20level.','riskLevel','942711kbVDCc','\x22\x20is\x20not\x20settable.','Key\x20not\x20found:\x20','Set\x20a\x20config\x20value','Config\x20files:\x0a','Missing\x20key\x20argument.','stringify','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','appcode','Delete\x20a\x20config\x20value','\x20(global)','6498905jmkRER','1514106jzjzSz','Deleted\x20`','240OXvCFj','write','object','(none)','global','read','format'];a18_0x3af2=function(){return _0x5f2d25;};return a18_0x3af2();}const GLOBAL_FLAG={'name':'global','type':a18_0xbe9d31(0x146),'description':'Write\x20to\x20global\x20config','default':![]};function parseAliasAppcodeSetKey(_0x1c6eeb){const _0x4175d7=a18_0xbe9d31,_0x1d909d=_0x1c6eeb['split']('.');if(_0x1d909d[_0x4175d7(0x14e)]!==0x3||_0x1d909d[0x0]!==_0x4175d7(0x14a)||_0x1d909d[0x2]!==_0x4175d7(0x16f))return undefined;const _0x3c617a=_0x1d909d[0x1]?.[_0x4175d7(0x141)]();return _0x3c617a?_0x3c617a:undefined;}function parseAliasDeleteKey(_0x24fdc7){const _0x1463cd=a18_0xbe9d31,_0x29108c=_0x24fdc7['split']('.');if(_0x29108c[_0x1463cd(0x14e)]===0x2&&_0x29108c[0x0]===_0x1463cd(0x14a)){const _0xd52d66=_0x29108c[0x1]?.[_0x1463cd(0x141)]();return _0xd52d66?{'alias':_0xd52d66}:undefined;}if(_0x29108c[_0x1463cd(0x14e)]===0x3&&_0x29108c[0x0]===_0x1463cd(0x14a)&&_0x29108c[0x2]==='appcode'){const _0x29b294=_0x29108c[0x1]?.[_0x1463cd(0x141)]();return _0x29b294?{'alias':_0x29b294,'field':'appcode'}:undefined;}return undefined;}function setLocalAppAlias(_0x4fbe7e,_0x5e9a11,_0x4706ad){const _0x2dde22=a18_0xbe9d31,_0x4ed8ca=_0x4fbe7e['apps']&&typeof _0x4fbe7e[_0x2dde22(0x14a)]===_0x2dde22(0x177)&&!Array[_0x2dde22(0x162)](_0x4fbe7e[_0x2dde22(0x14a)])?_0x4fbe7e[_0x2dde22(0x14a)]:{},_0x24685b=_0x4ed8ca[_0x5e9a11]&&typeof _0x4ed8ca[_0x5e9a11]==='object'&&!Array[_0x2dde22(0x162)](_0x4ed8ca[_0x5e9a11])?_0x4ed8ca[_0x5e9a11]:{};_0x24685b[_0x2dde22(0x16f)]=_0x4706ad,_0x4ed8ca[_0x5e9a11]=_0x24685b,_0x4fbe7e[_0x2dde22(0x14a)]=_0x4ed8ca;}function deleteLocalAppAlias(_0x5eb076,_0x5c74d1){const _0x1502e6=a18_0xbe9d31;if(!_0x5eb076[_0x1502e6(0x14a)]||typeof _0x5eb076[_0x1502e6(0x14a)]!=='object'||Array[_0x1502e6(0x162)](_0x5eb076[_0x1502e6(0x14a)]))return![];const _0x565c5c=_0x5eb076[_0x1502e6(0x14a)],_0x43f418=_0x565c5c[_0x5c74d1['alias']];if(!_0x43f418||typeof _0x43f418!=='object'||Array[_0x1502e6(0x162)](_0x43f418))return![];if(!_0x5c74d1[_0x1502e6(0x151)])return delete _0x565c5c[_0x5c74d1[_0x1502e6(0x15d)]],!![];if(!(_0x5c74d1[_0x1502e6(0x151)]in _0x43f418))return![];return delete _0x43f418[_0x5c74d1[_0x1502e6(0x151)]],Object[_0x1502e6(0x164)](_0x43f418)['length']===0x0&&delete _0x565c5c[_0x5c74d1['alias']],!![];}const listDef={'service':'config','command':a18_0xbe9d31(0x156),'description':a18_0xbe9d31(0x15c),'risk':a18_0xbe9d31(0x17a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x5ef1d3){const _0x4b8033=a18_0xbe9d31,{buildConfigFromFlags:_0x3318b5}=await import(_0x4b8033(0x160)),_0x5e70ef=_0x3318b5({}),_0x5e3a0c=getProjectConfigPath(),_0x3da313=resolveWriteConfigPath('global');if(_0x5ef1d3[_0x4b8033(0x13a)]==='pretty')return{'ok':!![],'message':_0x4b8033(0x16e)+(JSON[_0x4b8033(0x16d)](_0x5e70ef[_0x4b8033(0x15a)],null,0x2)+'\x0a\x0a')+_0x4b8033(0x16b)+(_0x4b8033(0x14b)+(_0x5e3a0c??_0x4b8033(0x178))+'\x0a')+('\x20\x20global:\x20\x20'+_0x3da313)};return{'ok':!![],'data':{'effective':_0x5e70ef['raw'],'configFiles':{'project':_0x5e3a0c??null,'global':_0x3da313}}};}},getDef={'service':'config','command':a18_0xbe9d31(0x149),'description':'Get\x20a\x20config\x20value','risk':a18_0xbe9d31(0x17a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0xbe9d31(0x157),'description':'Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','required':!![]}],'flags':[],async 'execute'(_0x3bed17){const _0x34e8ab=a18_0xbe9d31,_0xb749c9=_0x3bed17[_0x34e8ab(0x142)][0x0];if(!_0xb749c9)throw CliErrors[_0x34e8ab(0x147)]('Missing\x20key\x20argument.','Usage:\x20'+CLI_BIN_NAME+'\x20config\x20get\x20<key>');const {buildConfigFromFlags:_0x4a4dd5}=await import(_0x34e8ab(0x160)),{raw:_0x3f07a2}=_0x4a4dd5({});if(_0xb749c9['includes']('.')){const _0x1f918b=_0xb749c9[_0x34e8ab(0x153)]('.');let _0x491cb4=_0x3f07a2;for(const _0xfc9efb of _0x1f918b){if(_0x491cb4==null||typeof _0x491cb4!==_0x34e8ab(0x177))throw CliErrors[_0x34e8ab(0x147)](_0x34e8ab(0x169)+_0xb749c9);_0x491cb4=_0x491cb4[_0xfc9efb];}if(_0x491cb4===undefined)throw CliErrors['validation'](_0x34e8ab(0x169)+_0xb749c9);return console[_0x34e8ab(0x13d)](typeof _0x491cb4==='object'?JSON[_0x34e8ab(0x16d)](_0x491cb4,null,0x2):String(_0x491cb4)),{'ok':!![]};}const _0x506e3b=_0x3f07a2[_0xb749c9];if(_0x506e3b===undefined)throw CliErrors[_0x34e8ab(0x147)]('Key\x20not\x20found:\x20'+_0xb749c9);return console['log'](typeof _0x506e3b===_0x34e8ab(0x177)?JSON[_0x34e8ab(0x16d)](_0x506e3b,null,0x2):String(_0x506e3b)),{'ok':!![]};}},setDef={'service':'config','command':a18_0xbe9d31(0x140),'description':a18_0xbe9d31(0x16a),'risk':a18_0xbe9d31(0x176),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0xbe9d31(0x157),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a18_0xbe9d31(0x13e),'description':a18_0xbe9d31(0x15e),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x281178){const _0x44a94d=a18_0xbe9d31,_0x39a85d=_0x281178[_0x44a94d(0x142)][0x0],_0x3e9d83=_0x281178[_0x44a94d(0x142)][0x1];if(!_0x39a85d||_0x3e9d83===undefined)throw CliErrors[_0x44a94d(0x147)](_0x44a94d(0x163),_0x44a94d(0x15f)+CLI_BIN_NAME+'\x20config\x20set\x20<key>\x20<value>\x20[--global]');if(ENUM_KEYS[_0x39a85d]&&!ENUM_KEYS[_0x39a85d][_0x44a94d(0x14c)](_0x3e9d83))throw CliErrors[_0x44a94d(0x147)]('Invalid\x20value\x20for\x20\x22'+_0x39a85d+_0x44a94d(0x13c)+ENUM_KEYS[_0x39a85d][_0x44a94d(0x150)](',\x20'));if(_0x39a85d===_0x44a94d(0x166))throw CliErrors[_0x44a94d(0x147)](_0x44a94d(0x148));if(_0x39a85d==='pageSize'){const _0x2e9256=Number(_0x3e9d83);if(isNaN(_0x2e9256)||_0x2e9256<=0x0)throw CliErrors['validation']('pageSize\x20must\x20be\x20a\x20positive\x20number');}const _0x137661=resolveWriteScope({'explicitGlobal':_0x281178['bool'](_0x44a94d(0x179)),'policy':_0x44a94d(0x145)}),_0x37d045=toScopeFlags(_0x137661),_0x53599d=readScopedConfig(_0x37d045),_0x358373=parseAliasAppcodeSetKey(_0x39a85d);if(!_0x358373&&!isTopLevelConfigKey(_0x39a85d))throw CliErrors[_0x44a94d(0x147)]('Top-level\x20key\x20\x22'+_0x39a85d+_0x44a94d(0x168),_0x44a94d(0x158)+getTopLevelConfigKeySummary()+_0x44a94d(0x15b));return _0x358373?setLocalAppAlias(_0x53599d,_0x358373,_0x3e9d83):_0x53599d[_0x39a85d]=_0x39a85d==='pageSize'?Number(_0x3e9d83):_0x3e9d83,console[_0x44a94d(0x13d)]('Set\x20`'+_0x39a85d+_0x44a94d(0x14d)+_0x3e9d83+'\x22'+(_0x137661==='global'?_0x44a94d(0x171):'')),writeScopedConfig(_0x53599d,_0x37d045),{'ok':!![]};}},deleteDef={'service':'config','command':a18_0xbe9d31(0x13f),'description':a18_0xbe9d31(0x170),'risk':a18_0xbe9d31(0x176),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0xbe9d31(0x157),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x2cb998){const _0x43c9ad=a18_0xbe9d31,_0x205f66=_0x2cb998[_0x43c9ad(0x142)][0x0];if(!_0x205f66)throw CliErrors[_0x43c9ad(0x147)](_0x43c9ad(0x16c),'Usage:\x20'+CLI_BIN_NAME+_0x43c9ad(0x161));const _0x571d3a=resolveWriteScope({'explicitGlobal':_0x2cb998['bool']('global'),'policy':_0x43c9ad(0x145)}),_0x90d0f5=toScopeFlags(_0x571d3a),_0x57ab1c=readScopedConfig(_0x90d0f5),_0xb7ca1e=parseAliasDeleteKey(_0x205f66);if(_0xb7ca1e){if(!deleteLocalAppAlias(_0x57ab1c,_0xb7ca1e))throw CliErrors[_0x43c9ad(0x147)](_0x43c9ad(0x169)+_0x205f66);return console[_0x43c9ad(0x13d)](_0x43c9ad(0x174)+_0x205f66+'`'+(_0x571d3a===_0x43c9ad(0x179)?_0x43c9ad(0x171):'')),writeScopedConfig(_0x57ab1c,_0x90d0f5),{'ok':!![]};}if(_0x57ab1c[_0x205f66]===undefined)throw CliErrors[_0x43c9ad(0x147)](_0x43c9ad(0x154)+_0x205f66+_0x43c9ad(0x165));return delete _0x57ab1c[_0x205f66],console['log'](_0x43c9ad(0x174)+_0x205f66+'`'+(_0x571d3a==='global'?_0x43c9ad(0x171):'')),writeScopedConfig(_0x57ab1c,_0x90d0f5),{'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_0x230f48=a20_0x36d1;(function(_0xb70eb6,_0xec7188){const _0x3f9840=a20_0x36d1,_0x5e8455=_0xb70eb6();while(!![]){try{const _0x596f4a=-parseInt(_0x3f9840(0x1e0))/0x1*(-parseInt(_0x3f9840(0x22f))/0x2)+parseInt(_0x3f9840(0x1fc))/0x3*(parseInt(_0x3f9840(0x21c))/0x4)+parseInt(_0x3f9840(0x217))/0x5*(parseInt(_0x3f9840(0x1e7))/0x6)+parseInt(_0x3f9840(0x210))/0x7*(-parseInt(_0x3f9840(0x20e))/0x8)+parseInt(_0x3f9840(0x21e))/0x9*(parseInt(_0x3f9840(0x228))/0xa)+-parseInt(_0x3f9840(0x204))/0xb+parseInt(_0x3f9840(0x234))/0xc;if(_0x596f4a===_0xec7188)break;else _0x5e8455['push'](_0x5e8455['shift']());}catch(_0x3c997e){_0x5e8455['push'](_0x5e8455['shift']());}}}(a20_0x1aa5,0x5c399));function a20_0x1aa5(){const _0x142ce9=['read','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','6732451KkfKxd','\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\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\x20on\x20dataset\x20','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','\x20\x20AGGREGATE\x20TYPES','\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}}','helpExtra','8scRQsO','\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}]','559412FKIzwo','Update\x20an\x20existing\x20record','operation','\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}}','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\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}}','aggregate','3070960sPNDUm','\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}','map','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','316WiLuTE','POST','6489vAghjN','now','\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}','str','description','\x20\x20EXAMPLES','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','delete','1810OldjqM','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','code','high-risk-write','\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}}]}','params','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','3162ynErAT','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','\x20completed\x20in\x20','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','764952WJibjP','command','update','body','\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}}','97caARRI','\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}}','paramsHint','Preview:\x20data\x20','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','risk','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','6uagJaZ','\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}}','filter','data\x20','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','batchCreate','write','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','build','Get\x20a\x20single\x20record\x20by\x20ID','\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\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','create','join','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\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}','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','4098zdnQNf','data','\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','getOne','\x20\x20WHERE\x20OPERATORS'];a20_0x1aa5=function(){return _0x142ce9;};return a20_0x1aa5();}import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a20_0x230f48(0x1e9),'operation':a20_0x230f48(0x1e9),'risk':a20_0x230f48(0x202),'paramsRequired':![],'description':'Filter\x20dataset\x20records\x20with\x20query\x20conditions','paramsHint':'JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20'+a20_0x230f48(0x1e6),'helpExtra':[a20_0x230f48(0x201),a20_0x230f48(0x1e1),a20_0x230f48(0x213),'\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}}',a20_0x230f48(0x1fe),a20_0x230f48(0x215),a20_0x230f48(0x1df),'\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_0x230f48(0x20c),a20_0x230f48(0x1f3),a20_0x230f48(0x1e8),'','\x20\x20LOGICAL\x20COMBINATORS',a20_0x230f48(0x22c),a20_0x230f48(0x21a),'',a20_0x230f48(0x21b),a20_0x230f48(0x1ee),a20_0x230f48(0x1f1),a20_0x230f48(0x20f),a20_0x230f48(0x22e),a20_0x230f48(0x231),'','\x20\x20PAGINATION',a20_0x230f48(0x229),a20_0x230f48(0x206),a20_0x230f48(0x20a)][a20_0x230f48(0x1f6)]('\x0a')},{'command':a20_0x230f48(0x200),'operation':a20_0x230f48(0x200),'risk':'read','paramsRequired':!![],'description':a20_0x230f48(0x1f0),'paramsHint':a20_0x230f48(0x207)},{'command':'create','operation':a20_0x230f48(0x1f5),'risk':a20_0x230f48(0x1ed),'paramsRequired':!![],'description':a20_0x230f48(0x203),'paramsHint':a20_0x230f48(0x209)},{'command':a20_0x230f48(0x1ec),'operation':a20_0x230f48(0x1ec),'risk':a20_0x230f48(0x1ed),'paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','paramsHint':a20_0x230f48(0x225)},{'command':a20_0x230f48(0x236),'operation':'update','risk':a20_0x230f48(0x1ed),'paramsRequired':!![],'description':a20_0x230f48(0x211),'paramsHint':a20_0x230f48(0x1fb)},{'command':a20_0x230f48(0x227),'operation':a20_0x230f48(0x227),'risk':a20_0x230f48(0x22b),'paramsRequired':!![],'description':a20_0x230f48(0x1fa),'paramsHint':a20_0x230f48(0x207)},{'command':a20_0x230f48(0x216),'operation':a20_0x230f48(0x216),'risk':a20_0x230f48(0x202),'paramsRequired':![],'description':'Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','paramsHint':a20_0x230f48(0x1ff)+a20_0x230f48(0x214),'helpExtra':[a20_0x230f48(0x20b),a20_0x230f48(0x218),'\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}',a20_0x230f48(0x1f9),a20_0x230f48(0x220),a20_0x230f48(0x230),'\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}',a20_0x230f48(0x1f2),'','\x20\x20PARAMS\x20STRUCTURE',a20_0x230f48(0x205),a20_0x230f48(0x233),a20_0x230f48(0x1f7),a20_0x230f48(0x1f4),'\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Post-aggregation\x20filters,\x20e.g.\x20[{\x22columnName\x22:\x22total\x22,\x22condition\x22:{\x22$gt\x22:1000}}]',a20_0x230f48(0x224),'',a20_0x230f48(0x223),a20_0x230f48(0x1e4),a20_0x230f48(0x1f8),'',a20_0x230f48(0x226),'\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_0x230f48(0x1eb)][a20_0x230f48(0x1f6)]('\x0a')}];function makeDataCommand(_0x1f6f02){const _0x5ea026=a20_0x230f48,_0x159030=_0x5ea026(0x1ea)+_0x1f6f02[_0x5ea026(0x235)],_0x3eeea7={'service':_0x5ea026(0x1fd),'command':_0x1f6f02['command'],'description':_0x1f6f02[_0x5ea026(0x222)],'risk':_0x1f6f02[_0x5ea026(0x1e5)],'helpExtra':_0x1f6f02[_0x5ea026(0x20d)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x1f6f02[_0x5ea026(0x1e2)]}],'validate':async _0x30f8b6=>{const _0x368106=_0x5ea026;_0x1f6f02['paramsRequired']&&requireAnyOf(_0x30f8b6,[_0x368106(0x22d)],_0x159030),_0x1f6f02[_0x368106(0x212)]==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x30f8b6[_0x368106(0x221)](_0x368106(0x22d))));},async 'execute'(_0x48ef00){const _0x1cd2b1=_0x5ea026,_0x2f59a7=_0x48ef00[_0x1cd2b1(0x221)](_0x1cd2b1(0x22a)),_0x5317d0=_0x1f6f02[_0x1cd2b1(0x212)]===_0x1cd2b1(0x1ec)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x48ef00[_0x1cd2b1(0x221)](_0x1cd2b1(0x22d)))):parseJsonParams(_0x48ef00[_0x1cd2b1(0x221)](_0x1cd2b1(0x22d)))??{},_0x41a835=Date['now'](),_0x23f366=await executeData(_0x2f59a7,_0x1f6f02[_0x1cd2b1(0x212)],_0x5317d0),_0x4f5832=Date[_0x1cd2b1(0x21f)]()-_0x41a835;return{'ok':!![],'data':{'result':_0x23f366,'elapsed':_0x4f5832},'message':'data\x20'+_0x1f6f02['command']+_0x1cd2b1(0x232)+_0x4f5832+'ms'};}};return _0x1f6f02['risk']!=='read'&&(_0x3eeea7['dryRun']=async _0x486ab6=>{const _0x490cfc=_0x5ea026,_0x430b00=_0x486ab6['str'](_0x490cfc(0x22a)),_0x599e74=_0x1f6f02[_0x490cfc(0x212)]===_0x490cfc(0x1ec)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x486ab6[_0x490cfc(0x221)]('params'))):parseJsonParams(_0x486ab6[_0x490cfc(0x221)]('params'))??{};return dryRun(_0x490cfc(0x21d),'/api/{appCode}/'+_0x430b00+'/'+_0x1f6f02[_0x490cfc(0x212)])[_0x490cfc(0x237)](_0x599e74)[_0x490cfc(0x222)](_0x490cfc(0x1e3)+_0x1f6f02[_0x490cfc(0x235)]+_0x490cfc(0x208)+_0x430b00)[_0x490cfc(0x1ef)]();}),_0x3eeea7;}function a20_0x36d1(_0x2bfed2,_0x4fab55){_0x2bfed2=_0x2bfed2-0x1df;const _0x1aa5df=a20_0x1aa5();let _0x36d151=_0x1aa5df[_0x2bfed2];return _0x36d151;}export const dataDefinitions=specs[a20_0x230f48(0x219)](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
|
-
(function(
|
|
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
|
-
const
|
|
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
|
-
const a26_0x20a72c=a26_0x1074;(function(_0xf51377,_0x2f9a34){const _0x12446d=a26_0x1074,_0x1758c3=_0xf51377();while(!![]){try{const _0x51617e=-parseInt(_0x12446d(0x231))/0x1+-parseInt(_0x12446d(0x214))/0x2*(parseInt(_0x12446d(0x221))/0x3)+parseInt(_0x12446d(0x1f2))/0x4*(parseInt(_0x12446d(0x1fa))/0x5)+parseInt(_0x12446d(0x21b))/0x6+-parseInt(_0x12446d(0x239))/0x7+-parseInt(_0x12446d(0x226))/0x8*(parseInt(_0x12446d(0x22e))/0x9)+parseInt(_0x12446d(0x238))/0xa;if(_0x51617e===_0x2f9a34)break;else _0x1758c3['push'](_0x1758c3['shift']());}catch(_0x223a1b){_0x1758c3['push'](_0x1758c3['shift']());}}}(a26_0x1e8e,0x2bf40));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';function a26_0x1e8e(){const _0x216e25=['appcode','SIGINT','[Y/n]','includes','yes','\x20\x20config:\x20\x20','3935yMfMQo','project','name','log','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','[y/N]','trim','newConfigFileName','\x20\x20appcode:\x20','boolean','\x22.\x20Allowed:\x20','entries','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','App\x20code\x20cannot\x20be\x20empty.','stdout','file','join','parse','File\x20','App\x20code\x20for\x20the\x20project','\x20init\x20—\x20Create\x20','Imported\x20from\x20','string','env','Invalid\x20env\x20\x22','Override\x20imported\x20default\x20appcode','264332KtPxjB','message','App\x20code','Write\x20to\x20global\x20(~/','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.',')\x20instead\x20of\x20project','Aborted.','2121678AOmmbt','validation','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','removeListener','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','apps','3VvSmpX','flagMissing','close','Source\x20file\x20not\x20found:\x20','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','152tQUSRR','riskLevel','cwd','\x20\x20env:\x20\x20\x20\x20\x20','\x20\x20default:\x20','object','Initialized\x20','app','83385vZDVls','\x0aInitialized\x20','race','281181LaRzut','toLowerCase','Override\x20imported\x20default\x20env','question','Target\x20environment\x20(default\x20','AbortPrompt','defaultApp','3922820jYXlyI','1443995RxhQot','utf8','Skip\x20confirmation\x20when\x20overwriting','global','User\x20aborted\x20prompt','1168nwmAEF','stdin'];a26_0x1e8e=function(){return _0x216e25;};return a26_0x1e8e();}function a26_0x1074(_0x2f78d9,_0x2337b3){_0x2f78d9=_0x2f78d9-0x1ef;const _0x1e8eda=a26_0x1e8e();let _0x107490=_0x1e8eda[_0x2f78d9];return _0x107490;}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_0x20a72c(0x1f4),'type':a26_0x20a72c(0x210),'description':a26_0x20a72c(0x20d)},{'name':a26_0x20a72c(0x211),'type':a26_0x20a72c(0x210),'description':a26_0x20a72c(0x235)+DEFAULT_CONFIG_VALUES['env']+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x20a72c(0x1f0),'type':a26_0x20a72c(0x203),'description':a26_0x20a72c(0x217)+PRODUCT_CONFIG[a26_0x20a72c(0x201)]+a26_0x20a72c(0x219),'default':![]},{'name':'yes','type':a26_0x20a72c(0x203),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':a26_0x20a72c(0x209),'type':a26_0x20a72c(0x210),'description':a26_0x20a72c(0x21f),'required':!![]},{'name':a26_0x20a72c(0x1f4),'type':a26_0x20a72c(0x210),'description':a26_0x20a72c(0x213)},{'name':'env','type':'string','description':a26_0x20a72c(0x233),'enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a26_0x20a72c(0x203),'description':a26_0x20a72c(0x217)+PRODUCT_CONFIG[a26_0x20a72c(0x201)]+')\x20instead\x20of\x20project','default':![]},{'name':a26_0x20a72c(0x1f8),'type':a26_0x20a72c(0x203),'description':a26_0x20a72c(0x1ef),'default':![]}];export async function runInit(_0x59b018){const _0x307505=a26_0x20a72c,_0x22e079=isNonInteractiveMode(_0x59b018),_0x40e892=_0x59b018[_0x307505(0x1f0)]?_0x307505(0x1f0):_0x307505(0x1fb),_0x51dd15=resolveWriteConfigPath(_0x40e892);try{_0x22e079?await runNonInteractive(_0x59b018,_0x51dd15):await runInteractive(_0x59b018,_0x51dd15);}catch(_0x5cb1e8){if(_0x5cb1e8 instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0x5cb1e8;}}export async function runInitImport(_0x198372){const _0x4411ee=a26_0x20a72c,_0x5013f5=_0x198372[_0x4411ee(0x1f0)]?_0x4411ee(0x1f0):_0x4411ee(0x1fb),_0xb66ff7=resolveWriteConfigPath(_0x5013f5);await runFromImport(_0x198372,_0xb66ff7);}const RUNTIME_IRRELEVANT_KEYS=new Set(['apiDir']);async function runFromImport(_0x1e1bba,_0x1f3ef0){const _0x5b181b=a26_0x20a72c,_0x155e17=resolveFilePath(_0x1e1bba[_0x5b181b(0x209)]);if(!existsSync(_0x155e17))throw CliErrors[_0x5b181b(0x21c)](_0x5b181b(0x224)+_0x155e17);const _0x17c9fe=readSourceFile(_0x155e17),_0x551eee=convertToRuntimeConfig(_0x17c9fe);_0x1e1bba[_0x5b181b(0x1f4)]&&(_0x551eee['appcode']=String(_0x1e1bba[_0x5b181b(0x1f4)]));_0x1e1bba[_0x5b181b(0x211)]&&(_0x551eee[_0x5b181b(0x211)]=resolveInitEnv(_0x1e1bba));if(!_0x551eee[_0x5b181b(0x1f4)])throw CliErrors[_0x5b181b(0x21c)](_0x5b181b(0x206),_0x5b181b(0x21d));await writeInitConfig(_0x1f3ef0,_0x551eee,_0x1e1bba),console['log'](_0x5b181b(0x20f)+_0x155e17),console[_0x5b181b(0x1fd)](_0x5b181b(0x1f9)+_0x1f3ef0),console[_0x5b181b(0x1fd)](_0x5b181b(0x202)+_0x551eee[_0x5b181b(0x1f4)]);if(_0x551eee['defaultApp'])console[_0x5b181b(0x1fd)](_0x5b181b(0x22a)+_0x551eee[_0x5b181b(0x237)]);}function convertToRuntimeConfig(_0x5c2dc4){const _0x497321=a26_0x20a72c;if(_0x5c2dc4[_0x497321(0x220)]&&typeof _0x5c2dc4[_0x497321(0x220)]===_0x497321(0x22b))throw CliErrors[_0x497321(0x21c)](_0x497321(0x218),_0x497321(0x225));const _0x5ef876={};for(const _0xfded38 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x5c2dc4[_0xfded38]!==undefined&&(_0x5ef876[_0xfded38]=_0x5c2dc4[_0xfded38]);}return!_0x5ef876[_0x497321(0x227)]&&(_0x5ef876['riskLevel']=DEFAULT_CONFIG_VALUES[_0x497321(0x227)]),_0x5ef876;}async function runNonInteractive(_0x5dc396,_0x465b5b){const _0x3f1a3f=a26_0x20a72c,_0xd2127a=_0x5dc396[_0x3f1a3f(0x1f4)];if(!_0xd2127a)throw CliErrors[_0x3f1a3f(0x222)](_0x3f1a3f(0x1f4),'Usage:\x20'+CLI_BIN_NAME+_0x3f1a3f(0x1fe));const _0x21e11c=resolveInitEnv(_0x5dc396);await writeInitConfig(_0x465b5b,{'appcode':_0xd2127a,'env':_0x21e11c},_0x5dc396),console[_0x3f1a3f(0x1fd)](_0x3f1a3f(0x22c)+_0x465b5b),console[_0x3f1a3f(0x1fd)]('\x20\x20appcode:\x20'+_0xd2127a),console[_0x3f1a3f(0x1fd)](_0x3f1a3f(0x229)+_0x21e11c);}async function runInteractive(_0x26ab22,_0x2dd31f){const _0x3dbf8b=a26_0x20a72c,_0x1a6d28=loadExisting(_0x2dd31f),_0x2fcfb8=typeof _0x1a6d28?.[_0x3dbf8b(0x1f4)]==='string'?_0x1a6d28[_0x3dbf8b(0x1f4)]:'',_0x19fd8f=resolveInitEnv(_0x26ab22);console['log'](CLI_BIN_NAME+_0x3dbf8b(0x20e)+PRODUCT_CONFIG[_0x3dbf8b(0x201)]+'\x0a');if(existsSync(_0x2dd31f)&&!_0x26ab22['yes']){const _0x153715=await promptYesNo(_0x3dbf8b(0x20c)+_0x2dd31f+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x153715){console[_0x3dbf8b(0x1fd)](_0x3dbf8b(0x21a));return;}}const _0x28921b=typeof _0x26ab22[_0x3dbf8b(0x1f4)]==='string'?_0x26ab22[_0x3dbf8b(0x1f4)][_0x3dbf8b(0x200)]():'';let _0x362a15=_0x28921b;!_0x362a15&&(_0x362a15=await promptInput(_0x3dbf8b(0x216),_0x2fcfb8));if(!_0x362a15['trim']())throw CliErrors['validation'](_0x3dbf8b(0x207));await writeInitConfig(_0x2dd31f,{'appcode':_0x362a15['trim'](),'env':_0x19fd8f},_0x26ab22),console[_0x3dbf8b(0x1fd)](_0x3dbf8b(0x22f)+_0x2dd31f),console['log'](_0x3dbf8b(0x202)+_0x362a15[_0x3dbf8b(0x200)]()),console[_0x3dbf8b(0x1fd)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x19fd8f);}async function writeInitConfig(_0x45c814,_0x2785e2,_0x2f1be2){const _0x79d34f=a26_0x20a72c;let _0x1d4f00={};existsSync(_0x45c814)&&!_0x2f1be2[_0x79d34f(0x1f8)]&&(_0x1d4f00=readConfigFile(_0x45c814));for(const [_0x5ee3e7,_0x32f649]of Object[_0x79d34f(0x205)](_0x2785e2)){_0x32f649!==undefined&&(_0x1d4f00[_0x5ee3e7]=_0x32f649);}if(_0x1d4f00[_0x79d34f(0x22d)])delete _0x1d4f00[_0x79d34f(0x22d)];writeConfigFile(_0x45c814,_0x1d4f00);}class AbortPrompt extends Error{constructor(){const _0x448397=a26_0x20a72c;super(_0x448397(0x1f1)),this[_0x448397(0x1fc)]=_0x448397(0x236);}}function createSafeRl(){const _0x56d380=a26_0x20a72c,_0x3784b8=createInterface({'input':process[_0x56d380(0x1f3)],'output':process[_0x56d380(0x208)]});let _0x5ed3e1;const _0x5c1802=new Promise((_0x372e6a,_0x267b69)=>{const _0xe729d1=_0x56d380;_0x5ed3e1=()=>{const _0x708be7=a26_0x1074;_0x5ed3e1&&(_0x3784b8[_0x708be7(0x21e)]('SIGINT',_0x5ed3e1),_0x5ed3e1=undefined);try{_0x3784b8[_0x708be7(0x223)]();}catch{}_0x267b69(new AbortPrompt());},_0x3784b8['once'](_0xe729d1(0x1f5),_0x5ed3e1);}),_0x4778f6=()=>{const _0x527106=_0x56d380;_0x5ed3e1&&(_0x3784b8[_0x527106(0x21e)](_0x527106(0x1f5),_0x5ed3e1),_0x5ed3e1=undefined);try{_0x3784b8[_0x527106(0x223)]();}catch{}};return{'rl':_0x3784b8,'abortPromise':_0x5c1802,'disposeSuccess':_0x4778f6};}async function promptInput(_0x3f9b8a,_0x2c982b){const _0x11d707=a26_0x20a72c,{rl:_0x15b162,abortPromise:_0x12e43d,disposeSuccess:_0xfab01a}=createSafeRl(),_0x5810ce=new Promise(_0x329202=>{const _0x327ada=a26_0x1074,_0x4bf3c9=_0x2c982b?'\x20\x20'+_0x3f9b8a+'\x20('+_0x2c982b+'):\x20':'\x20\x20'+_0x3f9b8a+':\x20';_0x15b162[_0x327ada(0x234)](_0x4bf3c9,_0x61d4f3=>{_0xfab01a(),_0x329202(_0x61d4f3['trim']()||_0x2c982b);});});return Promise[_0x11d707(0x230)]([_0x5810ce,_0x12e43d]);}async function promptYesNo(_0x30c91a,_0x40c4aa){const {rl:_0x555177,abortPromise:_0x324828,disposeSuccess:_0x2a6b1b}=createSafeRl(),_0x5b94d9=new Promise(_0x4464c7=>{const _0x3cac8b=a26_0x1074,_0x2f1620=_0x40c4aa?_0x3cac8b(0x1f6):_0x3cac8b(0x1ff);_0x555177[_0x3cac8b(0x234)]('\x20\x20'+_0x30c91a+'\x20'+_0x2f1620+':\x20',_0x311f06=>{const _0x27e4de=_0x3cac8b;_0x2a6b1b();const _0x41b018=_0x311f06['trim']()[_0x27e4de(0x232)]();if(_0x41b018==='y'||_0x41b018===_0x27e4de(0x1f8))_0x4464c7(!![]);else{if(_0x41b018==='n'||_0x41b018==='no')_0x4464c7(![]);else _0x4464c7(_0x40c4aa);}});});return Promise['race']([_0x5b94d9,_0x324828]);}function loadExisting(_0x168747){if(!existsSync(_0x168747))return null;return readConfigFile(_0x168747);}function resolveFilePath(_0x5a2861){const _0x2ae02b=a26_0x20a72c;return isAbsolute(_0x5a2861)?_0x5a2861:resolve(process[_0x2ae02b(0x228)](),_0x5a2861);}function readSourceFile(_0x24477a){const _0x318ea2=a26_0x20a72c;try{const _0x1534d3=readFileSync(_0x24477a,{'encoding':_0x318ea2(0x23a)});return JSON[_0x318ea2(0x20b)](_0x1534d3);}catch(_0x472815){throw CliErrors[_0x318ea2(0x21c)]('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x472815[_0x318ea2(0x215)]);}}function resolveInitEnv(_0x45e8af){const _0x1a460f=a26_0x20a72c,_0x92f957=_0x45e8af[_0x1a460f(0x211)];if(_0x92f957===undefined||_0x92f957==='')return DEFAULT_CONFIG_VALUES[_0x1a460f(0x211)];if(!RUNTIME_ENV_VALUES[_0x1a460f(0x1f7)](_0x92f957))throw CliErrors[_0x1a460f(0x21c)](_0x1a460f(0x212)+_0x92f957+_0x1a460f(0x204)+RUNTIME_ENV_VALUES[_0x1a460f(0x20a)](',\x20'));return _0x92f957;}
|
|
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;}
|