@lovrabet/lovrabet-cli 2.1.4 → 2.1.6-beta.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/commands/create.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a15_0xfb18(){const _0x3904b7=['1305274nclHci','validation','project','242637NgoRpW','223496EVhIsd','\x20found).','project-default','11237958bgnMYl','global-default','3159615bKzpDy','4yaMdEe','inProject','Use\x20only\x20one\x20config\x20scope\x20flag.','global','newConfigFileName','Flags\x20--global\x20and\x20--project\x20are\x20mutually\x20exclusive.','51446DHQOJI','8QUXipe','Add\x20--global\x20to\x20write\x20to\x20~/','2807364cBeBrI'];a15_0xfb18=function(){return _0x3904b7;};return a15_0xfb18();}(function(_0x272852,_0x1e31cf){const _0x3fdf5c=a15_0xac55,_0x2403a9=_0x272852();while(!![]){try{const _0x14e891=-parseInt(_0x3fdf5c(0xa8))/0x1+-parseInt(_0x3fdf5c(0x98))/0x2+-parseInt(_0x3fdf5c(0x9b))/0x3*(parseInt(_0x3fdf5c(0xa2))/0x4)+-parseInt(_0x3fdf5c(0xa1))/0x5+parseInt(_0x3fdf5c(0x97))/0x6+parseInt(_0x3fdf5c(0x9c))/0x7+parseInt(_0x3fdf5c(0xa9))/0x8*(parseInt(_0x3fdf5c(0x9f))/0x9);if(_0x14e891===_0x1e31cf)break;else _0x2403a9['push'](_0x2403a9['shift']());}catch(_0x36d3dd){_0x2403a9['push'](_0x2403a9['shift']());}}}(a15_0xfb18,0x50f4f));import{CLI_BIN_NAME}from'../../constant/cli.js';function a15_0xac55(_0x118ee9,_0xb4ba98){_0x118ee9=_0x118ee9-0x97;const _0xfb1840=a15_0xfb18();let _0xac55c1=_0xfb1840[_0x118ee9];return _0xac55c1;}import{PRODUCT_CONFIG}from'../../constant/product.js';export{DEFAULT_APP_PROFILE_NAME,DEFAULT_CONFIG_VALUES}from'../../constant/defaults.js';export{RUNTIME_ENV_VALUES}from'../../constant/env.js';export{OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{isInProject}from'../../context.js';import{CliErrors}from'../../errors.js';export{buildAppProfileListFields,CONFIG_ENUM_VALUES,IMPORTABLE_RUNTIME_CONFIG_KEYS,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getConfigDefaultValue,getConfigEnumValues,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isLegacyCompatConfigKey,isTopLevelConfigKey}from'../../config/schema.js';export function resolveConfigScope(_0x2ad3d8){const _0x50da4d=a15_0xac55,{explicitGlobal:explicitGlobal=![],explicitProject:explicitProject=![],policy:_0x1453b8}=_0x2ad3d8;if(explicitGlobal&&explicitProject)throw CliErrors[_0x50da4d(0x99)](_0x50da4d(0xa7),_0x50da4d(0xa4));if(explicitGlobal)return _0x50da4d(0xa5);if(explicitProject)return _0x50da4d(0x9a);switch(_0x1453b8){case _0x50da4d(0xa0):return'global';case _0x50da4d(0x9e):return _0x2ad3d8[_0x50da4d(0xa3)]??isInProject()?_0x50da4d(0x9a):_0x50da4d(0xa5);case'project-or-global-explicit':if(!(_0x2ad3d8[_0x50da4d(0xa3)]??isInProject()))throw CliErrors[_0x50da4d(0x99)]('Not\x20inside\x20a\x20project\x20(no\x20'+PRODUCT_CONFIG[_0x50da4d(0xa6)]+_0x50da4d(0x9d),_0x50da4d(0xaa)+PRODUCT_CONFIG[_0x50da4d(0xa6)]+',\x20or\x20run\x20`'+CLI_BIN_NAME+'\x20init`\x20first.');return _0x50da4d(0x9a);}}export function toScopeFlags(_0x2e5792){const _0x32eff7=a15_0xac55;return{'global':_0x2e5792===_0x32eff7(0xa5)};}export function formatScopeLabel(_0x3cbb13){const _0x86d57=a15_0xac55;return _0x3cbb13===_0x86d57(0xa5)?'\x20(global)':'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5d2ef0,_0x46ee02){const _0x5963c5=a16_0x5df0,_0x3e13de=_0x5d2ef0();while(!![]){try{const _0x576c0b=parseInt(_0x5963c5(0x71))/0x1*(parseInt(_0x5963c5(0x80))/0x2)+parseInt(_0x5963c5(0x87))/0x3+-parseInt(_0x5963c5(0x82))/0x4+-parseInt(_0x5963c5(0x78))/0x5*(parseInt(_0x5963c5(0x75))/0x6)+-parseInt(_0x5963c5(0x73))/0x7*(parseInt(_0x5963c5(0x81))/0x8)+-parseInt(_0x5963c5(0x7f))/0x9*(-parseInt(_0x5963c5(0x6e))/0xa)+parseInt(_0x5963c5(0x83))/0xb*(parseInt(_0x5963c5(0x6d))/0xc);if(_0x576c0b===_0x46ee02)break;else _0x3e13de['push'](_0x3e13de['shift']());}catch(_0x4f2fd8){_0x3e13de['push'](_0x3e13de['shift']());}}}(a16_0x2c0a,0xb7155));import{CliErrors}from'../../errors.js';function isSet(_0x1aa2b9,_0x2b5522){const _0x42ff9e=a16_0x5df0,_0x3fd75c=_0x1aa2b9[_0x42ff9e(0x74)](_0x2b5522);return _0x3fd75c!==undefined&&_0x3fd75c!==''&&_0x3fd75c!==![]&&_0x3fd75c!==0x0;}function a16_0x5df0(_0x44e840,_0x199209){_0x44e840=_0x44e840-0x6b;const _0x2c0aac=a16_0x2c0a();let _0x5df0df=_0x2c0aac[_0x44e840];return _0x5df0df;}function fmtNames(_0x3d065d){return _0x3d065d['map'](_0x2b2abf=>'--'+_0x2b2abf)['join'](',\x20');}export function requireOneOf(_0x255fd3,_0x3646c0,_0x5a77f0){const _0x378abc=a16_0x5df0,_0x3ec6c3=_0x3646c0[_0x378abc(0x6f)](_0x4cdf6e=>isSet(_0x255fd3,_0x4cdf6e));if(_0x3ec6c3[_0x378abc(0x86)]!==0x1)throw CliErrors[_0x378abc(0x79)](_0x3ec6c3[_0x378abc(0x86)]===0x0?_0x378abc(0x7c)+fmtNames(_0x3646c0)+_0x378abc(0x6c)+_0x5a77f0+'`.':_0x378abc(0x72)+fmtNames(_0x3646c0)+_0x378abc(0x6b)+fmtNames(_0x3ec6c3)+'.',_0x3ec6c3[_0x378abc(0x86)]===0x0?_0x378abc(0x7e)+fmtNames(_0x3646c0):_0x378abc(0x84));}export function requireAnyOf(_0x21ee17,_0x33487d,_0x5bf932){const _0x5021a3=a16_0x5df0;if(!_0x33487d[_0x5021a3(0x70)](_0x1fb551=>isSet(_0x21ee17,_0x1fb551)))throw CliErrors['validation'](_0x5021a3(0x76)+fmtNames(_0x33487d)+_0x5021a3(0x6c)+_0x5bf932+'`.',_0x5021a3(0x7e)+fmtNames(_0x33487d));}function a16_0x2c0a(){const _0x50d46f=[':\x20expected\x20','Provide\x20one\x20of:\x20','3244986DkSiDr','28zUgIKH','77808qlMjSH','56832Gvgmnw','11gEWKGK','Remove\x20all\x20but\x20one.','test','length','2246928sVgXbc','\x20is\x20allowed,\x20found:\x20','\x20is\x20required\x20for\x20`','8675244FlEsjm','10ggvDIK','filter','some','313COeaWx','Only\x20one\x20of\x20','644okYxSI','flag','213528lTVRwE','At\x20least\x20one\x20of\x20','Flags\x20','25PKxMBT','validation','Invalid\x20--','str','Exactly\x20one\x20of\x20'];a16_0x2c0a=function(){return _0x50d46f;};return a16_0x2c0a();}export function mutuallyExclusive(_0x445074,_0x2b9145,_0x2068a9){const _0xb93c44=a16_0x5df0,_0x373f48=_0x2b9145[_0xb93c44(0x6f)](_0x415c0f=>isSet(_0x445074,_0x415c0f));if(_0x373f48['length']>0x1)throw CliErrors[_0xb93c44(0x79)](_0xb93c44(0x77)+fmtNames(_0x373f48)+'\x20are\x20mutually\x20exclusive\x20for\x20`'+_0x2068a9+'`.','Use\x20only\x20one\x20of:\x20'+fmtNames(_0x2b9145));}export function validatePattern(_0x327f01,_0x7c136a,_0x33af01,_0x240d0f){const _0x370b4e=a16_0x5df0,_0x4d81ee=_0x327f01[_0x370b4e(0x7b)](_0x7c136a);if(_0x4d81ee&&!_0x33af01[_0x370b4e(0x85)](_0x4d81ee))throw CliErrors['validation'](_0x370b4e(0x7a)+_0x7c136a+_0x370b4e(0x7d)+_0x240d0f+',\x20got\x20\x22'+_0x4d81ee+'\x22.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a17_0x4ca4(){const _0xcbeb3f=['624366sNjKoJ','127418yusOXJ','9pyewhy','11374710eynWWm','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','string','2201045wJxEpX','Resource\x20name\x20for\x20lookup','4iMnsac','verbose','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','params','a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','15fvJFqU','sqlcode','919580luCnCw','3194682mUkUNa','code','boolean','2685880yMgAZt'];a17_0x4ca4=function(){return _0xcbeb3f;};return a17_0x4ca4();}const a17_0x28c1af=a17_0xd135;function a17_0xd135(_0x2909c2,_0x589c6a){_0x2909c2=_0x2909c2-0xfb;const _0x4ca478=a17_0x4ca4();let _0xd13540=_0x4ca478[_0x2909c2];return _0xd13540;}(function(_0xb0c220,_0x2c73ec){const _0x40d2b2=a17_0xd135,_0x12b0ff=_0xb0c220();while(!![]){try{const _0x4057e3=parseInt(_0x40d2b2(0x101))/0x1*(parseInt(_0x40d2b2(0x108))/0x2)+parseInt(_0x40d2b2(0x100))/0x3+parseInt(_0x40d2b2(0xfb))/0x4*(-parseInt(_0x40d2b2(0x10e))/0x5)+-parseInt(_0x40d2b2(0xfc))/0x6+parseInt(_0x40d2b2(0x106))/0x7+-parseInt(_0x40d2b2(0xff))/0x8+-parseInt(_0x40d2b2(0x102))/0x9*(-parseInt(_0x40d2b2(0x103))/0xa);if(_0x4057e3===_0x2c73ec)break;else _0x12b0ff['push'](_0x12b0ff['shift']());}catch(_0x1f9c8b){_0x12b0ff['push'](_0x12b0ff['shift']());}}}(a17_0x4ca4,0x57285));export const CODE_FLAG={'name':a17_0x28c1af(0xfd),'type':a17_0x28c1af(0x105),'required':!![],'description':'Dataset\x20code\x20(32-char\x20hex\x20UUID)','pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a17_0x28c1af(0x10c)}};export const SQLCODE_FLAG={'name':a17_0x28c1af(0x10f),'type':a17_0x28c1af(0x105),'required':!![],'description':a17_0x28c1af(0x10a),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a17_0x28c1af(0x104)}};export const VERBOSE_FLAG={'name':a17_0x28c1af(0x109),'type':a17_0x28c1af(0xfe),'description':'Return\x20full\x20raw\x20response\x20object'};export const PARAMS_FLAG={'name':a17_0x28c1af(0x10b),'type':a17_0x28c1af(0x105),'description':a17_0x28c1af(0x10d)};export const NAME_FLAG={'name':'name','type':a17_0x28c1af(0x105),'description':a17_0x28c1af(0x107)};export const ID_FLAG={'name':'id','type':'number','required':!![],'description':'Resource\x20ID'};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a18_0x387c53=a18_0x92de;(function(_0x4bb5eb,_0x215960){const _0x35aa7f=a18_0x92de,_0x5ec291=_0x4bb5eb();while(!![]){try{const _0xe78a00=parseInt(_0x35aa7f(0xb3))/0x1+parseInt(_0x35aa7f(0x98))/0x2+parseInt(_0x35aa7f(0xab))/0x3+-parseInt(_0x35aa7f(0xb7))/0x4*(-parseInt(_0x35aa7f(0xad))/0x5)+parseInt(_0x35aa7f(0xa5))/0x6+-parseInt(_0x35aa7f(0xb4))/0x7*(-parseInt(_0x35aa7f(0xc5))/0x8)+-parseInt(_0x35aa7f(0x93))/0x9;if(_0xe78a00===_0x215960)break;else _0x5ec291['push'](_0x5ec291['shift']());}catch(_0x1eb2bf){_0x5ec291['push'](_0x5ec291['shift']());}}}(a18_0x4a9f,0x3bb94));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';function a18_0x4a9f(){const _0x1ffabd=['\x22\x20is\x20not\x20settable.','\x20config\x20delete\x20<key>\x20[--global]','raw','343764asnaSC','list','1435lHANNB','object','pageSize\x20must\x20be\x20a\x20positive\x20number','Missing\x20key\x20or\x20value.','field','read','90035mrAEBs','463281TQHMka','\x22\x20not\x20found\x20at\x20top\x20level.','config','2104BiMWJr','Top-level\x20key\x20\x22','set','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','Usage:\x20','log','project-or-global-explicit','Deleted\x20`','alias','\x22.\x20Allowed:\x20','Set\x20a\x20config\x20value','args','length','Get\x20a\x20config\x20value','8LszUIb','Key\x20\x22','bool','\x20\x20global:\x20\x20',';\x20apps.<alias>.appcode','trim','delete','keys','\x20\x20project:\x20','global','boolean','Invalid\x20value\x20for\x20\x22','`\x20=\x20\x22','split','Delete\x20a\x20config\x20value','Key\x20not\x20found:\x20','apps','2808774TlPFRB','includes','isArray','Settable\x20keys:\x20','\x20config\x20set\x20<key>\x20<value>\x20[--global]','155140PzQmjl','riskLevel','join','key','../../context.js','Missing\x20key\x20argument.','List\x20current\x20config','appcode','Value\x20to\x20assign','\x20(global)','validation','Write\x20to\x20global\x20config','stringify','344256aJrINo','pretty','write'];a18_0x4a9f=function(){return _0x1ffabd;};return a18_0x4a9f();}import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':a18_0x387c53(0x8b),'type':a18_0x387c53(0x8c),'description':a18_0x387c53(0xa3),'default':![]};function parseAliasAppcodeSetKey(_0x575e51){const _0x17246f=a18_0x387c53,_0x5a048e=_0x575e51[_0x17246f(0x8f)]('.');if(_0x5a048e['length']!==0x3||_0x5a048e[0x0]!=='apps'||_0x5a048e[0x2]!=='appcode')return undefined;const _0x48b3b1=_0x5a048e[0x1]?.[_0x17246f(0xca)]();return _0x48b3b1?_0x48b3b1:undefined;}function parseAliasDeleteKey(_0x4a8fbf){const _0x2a8226=a18_0x387c53,_0x20afb8=_0x4a8fbf[_0x2a8226(0x8f)]('.');if(_0x20afb8[_0x2a8226(0xc3)]===0x2&&_0x20afb8[0x0]==='apps'){const _0x1df59d=_0x20afb8[0x1]?.[_0x2a8226(0xca)]();return _0x1df59d?{'alias':_0x1df59d}:undefined;}if(_0x20afb8[_0x2a8226(0xc3)]===0x3&&_0x20afb8[0x0]===_0x2a8226(0x92)&&_0x20afb8[0x2]==='appcode'){const _0x3cc085=_0x20afb8[0x1]?.[_0x2a8226(0xca)]();return _0x3cc085?{'alias':_0x3cc085,'field':_0x2a8226(0x9f)}:undefined;}return undefined;}function setLocalAppAlias(_0x59cf7f,_0x15ec56,_0x181d6b){const _0x242a24=a18_0x387c53,_0x40cb77=_0x59cf7f['apps']&&typeof _0x59cf7f['apps']==='object'&&!Array['isArray'](_0x59cf7f[_0x242a24(0x92)])?_0x59cf7f['apps']:{},_0xd72633=_0x40cb77[_0x15ec56]&&typeof _0x40cb77[_0x15ec56]===_0x242a24(0xae)&&!Array[_0x242a24(0x95)](_0x40cb77[_0x15ec56])?_0x40cb77[_0x15ec56]:{};_0xd72633['appcode']=_0x181d6b,_0x40cb77[_0x15ec56]=_0xd72633,_0x59cf7f['apps']=_0x40cb77;}function a18_0x92de(_0x2e33e8,_0x45ea8d){_0x2e33e8=_0x2e33e8-0x8a;const _0x4a9f5a=a18_0x4a9f();let _0x92de3c=_0x4a9f5a[_0x2e33e8];return _0x92de3c;}function deleteLocalAppAlias(_0x245f2e,_0x12b263){const _0x172ec8=a18_0x387c53;if(!_0x245f2e[_0x172ec8(0x92)]||typeof _0x245f2e[_0x172ec8(0x92)]!=='object'||Array[_0x172ec8(0x95)](_0x245f2e[_0x172ec8(0x92)]))return![];const _0x481f08=_0x245f2e['apps'],_0x3f845f=_0x481f08[_0x12b263[_0x172ec8(0xbf)]];if(!_0x3f845f||typeof _0x3f845f!==_0x172ec8(0xae)||Array[_0x172ec8(0x95)](_0x3f845f))return![];if(!_0x12b263[_0x172ec8(0xb1)])return delete _0x481f08[_0x12b263['alias']],!![];if(!(_0x12b263[_0x172ec8(0xb1)]in _0x3f845f))return![];return delete _0x3f845f[_0x12b263['field']],Object[_0x172ec8(0xcc)](_0x3f845f)['length']===0x0&&delete _0x481f08[_0x12b263[_0x172ec8(0xbf)]],!![];}const listDef={'service':a18_0x387c53(0xb6),'command':a18_0x387c53(0xac),'description':a18_0x387c53(0x9e),'risk':a18_0x387c53(0xb2),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x4bea48){const _0x322dd6=a18_0x387c53,{buildConfigFromFlags:_0x87fd64}=await import(_0x322dd6(0x9c)),_0x8ac14b=_0x87fd64({}),_0x31d283=getProjectConfigPath(),_0x6ba3fd=resolveWriteConfigPath(_0x322dd6(0x8b));if(_0x4bea48['format']===_0x322dd6(0xa6))return{'ok':!![],'message':_0x322dd6(0xba)+(JSON[_0x322dd6(0xa4)](_0x8ac14b[_0x322dd6(0xaa)],null,0x2)+'\x0a\x0a')+'Config\x20files:\x0a'+(_0x322dd6(0x8a)+(_0x31d283??'(none)')+'\x0a')+(_0x322dd6(0xc8)+_0x6ba3fd)};return{'ok':!![],'data':{'effective':_0x8ac14b['raw'],'configFiles':{'project':_0x31d283??null,'global':_0x6ba3fd}}};}},getDef={'service':'config','command':'get','description':a18_0x387c53(0xc4),'risk':a18_0x387c53(0xb2),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x387c53(0x9b),'description':'Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','required':!![]}],'flags':[],async 'execute'(_0x581746){const _0x288e3a=a18_0x387c53,_0x3e53df=_0x581746['args'][0x0];if(!_0x3e53df)throw CliErrors[_0x288e3a(0xa2)](_0x288e3a(0x9d),_0x288e3a(0xbb)+CLI_BIN_NAME+'\x20config\x20get\x20<key>');const {buildConfigFromFlags:_0x2a07e9}=await import('../../context.js'),{raw:_0x5529d6}=_0x2a07e9({});if(_0x3e53df['includes']('.')){const _0x441b18=_0x3e53df[_0x288e3a(0x8f)]('.');let _0x563742=_0x5529d6;for(const _0x55a0ae of _0x441b18){if(_0x563742==null||typeof _0x563742!==_0x288e3a(0xae))throw CliErrors[_0x288e3a(0xa2)](_0x288e3a(0x91)+_0x3e53df);_0x563742=_0x563742[_0x55a0ae];}if(_0x563742===undefined)throw CliErrors['validation'](_0x288e3a(0x91)+_0x3e53df);return console['log'](typeof _0x563742==='object'?JSON['stringify'](_0x563742,null,0x2):String(_0x563742)),{'ok':!![]};}const _0x3d9dd8=_0x5529d6[_0x3e53df];if(_0x3d9dd8===undefined)throw CliErrors['validation'](_0x288e3a(0x91)+_0x3e53df);return console['log'](typeof _0x3d9dd8===_0x288e3a(0xae)?JSON[_0x288e3a(0xa4)](_0x3d9dd8,null,0x2):String(_0x3d9dd8)),{'ok':!![]};}},setDef={'service':'config','command':a18_0x387c53(0xb9),'description':a18_0x387c53(0xc1),'risk':a18_0x387c53(0xa7),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x387c53(0x9b),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':'value','description':a18_0x387c53(0xa0),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x3dfaba){const _0xf95111=a18_0x387c53,_0x3c9df6=_0x3dfaba[_0xf95111(0xc2)][0x0],_0xf8b45b=_0x3dfaba['args'][0x1];if(!_0x3c9df6||_0xf8b45b===undefined)throw CliErrors[_0xf95111(0xa2)](_0xf95111(0xb0),_0xf95111(0xbb)+CLI_BIN_NAME+_0xf95111(0x97));if(ENUM_KEYS[_0x3c9df6]&&!ENUM_KEYS[_0x3c9df6][_0xf95111(0x94)](_0xf8b45b))throw CliErrors[_0xf95111(0xa2)](_0xf95111(0x8d)+_0x3c9df6+_0xf95111(0xc0)+ENUM_KEYS[_0x3c9df6][_0xf95111(0x9a)](',\x20'));if(_0x3c9df6===_0xf95111(0x99))throw CliErrors[_0xf95111(0xa2)]('\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.');if(_0x3c9df6==='pageSize'){const _0x381282=Number(_0xf8b45b);if(isNaN(_0x381282)||_0x381282<=0x0)throw CliErrors[_0xf95111(0xa2)](_0xf95111(0xaf));}const _0x30380d=resolveWriteScope({'explicitGlobal':_0x3dfaba[_0xf95111(0xc7)](_0xf95111(0x8b)),'policy':_0xf95111(0xbd)}),_0x5bee8a=toScopeFlags(_0x30380d),_0x5705df=readScopedConfig(_0x5bee8a),_0x4749b6=parseAliasAppcodeSetKey(_0x3c9df6);if(!_0x4749b6&&!isTopLevelConfigKey(_0x3c9df6))throw CliErrors['validation'](_0xf95111(0xb8)+_0x3c9df6+_0xf95111(0xa8),_0xf95111(0x96)+getTopLevelConfigKeySummary()+_0xf95111(0xc9));return _0x4749b6?setLocalAppAlias(_0x5705df,_0x4749b6,_0xf8b45b):_0x5705df[_0x3c9df6]=_0x3c9df6==='pageSize'?Number(_0xf8b45b):_0xf8b45b,console[_0xf95111(0xbc)]('Set\x20`'+_0x3c9df6+_0xf95111(0x8e)+_0xf8b45b+'\x22'+(_0x30380d===_0xf95111(0x8b)?_0xf95111(0xa1):'')),writeScopedConfig(_0x5705df,_0x5bee8a),{'ok':!![]};}},deleteDef={'service':a18_0x387c53(0xb6),'command':a18_0x387c53(0xcb),'description':a18_0x387c53(0x90),'risk':a18_0x387c53(0xa7),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x387c53(0x9b),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x5460a8){const _0x2cddcd=a18_0x387c53,_0x266c06=_0x5460a8[_0x2cddcd(0xc2)][0x0];if(!_0x266c06)throw CliErrors[_0x2cddcd(0xa2)]('Missing\x20key\x20argument.','Usage:\x20'+CLI_BIN_NAME+_0x2cddcd(0xa9));const _0x454e7b=resolveWriteScope({'explicitGlobal':_0x5460a8['bool'](_0x2cddcd(0x8b)),'policy':_0x2cddcd(0xbd)}),_0x1b3bd7=toScopeFlags(_0x454e7b),_0x521cbd=readScopedConfig(_0x1b3bd7),_0x480b7f=parseAliasDeleteKey(_0x266c06);if(_0x480b7f){if(!deleteLocalAppAlias(_0x521cbd,_0x480b7f))throw CliErrors[_0x2cddcd(0xa2)](_0x2cddcd(0x91)+_0x266c06);return console[_0x2cddcd(0xbc)](_0x2cddcd(0xbe)+_0x266c06+'`'+(_0x454e7b==='global'?'\x20(global)':'')),writeScopedConfig(_0x521cbd,_0x1b3bd7),{'ok':!![]};}if(_0x521cbd[_0x266c06]===undefined)throw CliErrors['validation'](_0x2cddcd(0xc6)+_0x266c06+_0x2cddcd(0xb5));return delete _0x521cbd[_0x266c06],console[_0x2cddcd(0xbc)](_0x2cddcd(0xbe)+_0x266c06+'`'+(_0x454e7b==='global'?_0x2cddcd(0xa1):'')),writeScopedConfig(_0x521cbd,_0x1b3bd7),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
1
|
+
const a18_0x225bd5=a18_0x6294;(function(_0x16ed76,_0x56ecb4){const _0x390089=a18_0x6294,_0x105450=_0x16ed76();while(!![]){try{const _0xef3c09=-parseInt(_0x390089(0x13d))/0x1+-parseInt(_0x390089(0x14d))/0x2+-parseInt(_0x390089(0x11f))/0x3*(parseInt(_0x390089(0x119))/0x4)+parseInt(_0x390089(0x12c))/0x5+-parseInt(_0x390089(0x13a))/0x6+parseInt(_0x390089(0x117))/0x7*(-parseInt(_0x390089(0x14f))/0x8)+parseInt(_0x390089(0x132))/0x9*(parseInt(_0x390089(0x129))/0xa);if(_0xef3c09===_0x56ecb4)break;else _0x105450['push'](_0x105450['shift']());}catch(_0x247e99){_0x105450['push'](_0x105450['shift']());}}}(a18_0x48b6,0x69016));function a18_0x6294(_0x2f8b49,_0x10ba46){_0x2f8b49=_0x2f8b49-0x112;const _0x48b694=a18_0x48b6();let _0x629464=_0x48b694[_0x2f8b49];return _0x629464;}import{CliErrors}from'../../errors.js';function a18_0x48b6(){const _0x8c2580=['join','45eMrFau','global','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','log','pageSize\x20must\x20be\x20a\x20positive\x20number','key','trim','\x22\x20not\x20found\x20at\x20top\x20level.','1700772MjkYoH','field','\x20config\x20get\x20<key>','508601BwpEnn','pageSize','length','write','\x20config\x20delete\x20<key>\x20[--global]','bool','riskLevel','raw','Value\x20to\x20assign','Delete\x20a\x20config\x20value','includes','value','\x22\x20is\x20not\x20settable.','\x20\x20project:\x20','Write\x20to\x20global\x20config','alias','1350470WzjLKk','stringify','6486104FJRQXu','appcode','object','validation','Usage:\x20','pretty','Get\x20a\x20config\x20value','format','Key\x20not\x20found:\x20','7UEqfbO','project-or-global-explicit','2603044NIxMgL',';\x20apps.<alias>.appcode','args','Missing\x20key\x20argument.','\x20\x20global:\x20\x20','Top-level\x20key\x20\x22','3qiJnir','split','Key\x20\x22','keys','read','Settable\x20keys:\x20','List\x20current\x20config','Deleted\x20`','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','apps','5476390JtdQxO','config','delete','3103645uoJrsI','\x20(global)','\x20config\x20set\x20<key>\x20<value>\x20[--global]','list','isArray'];a18_0x48b6=function(){return _0x8c2580;};return a18_0x48b6();}import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':a18_0x225bd5(0x133),'type':'boolean','description':a18_0x225bd5(0x14b),'default':![]};function parseAliasAppcodeSetKey(_0x1e99d1){const _0x5360e9=a18_0x225bd5,_0x4715d5=_0x1e99d1[_0x5360e9(0x120)]('.');if(_0x4715d5[_0x5360e9(0x13f)]!==0x3||_0x4715d5[0x0]!==_0x5360e9(0x128)||_0x4715d5[0x2]!=='appcode')return undefined;const _0x19ab33=_0x4715d5[0x1]?.['trim']();return _0x19ab33?_0x19ab33:undefined;}function parseAliasDeleteKey(_0x4a5c33){const _0x5715c4=a18_0x225bd5,_0x2b68b7=_0x4a5c33[_0x5715c4(0x120)]('.');if(_0x2b68b7[_0x5715c4(0x13f)]===0x2&&_0x2b68b7[0x0]===_0x5715c4(0x128)){const _0x139e76=_0x2b68b7[0x1]?.[_0x5715c4(0x138)]();return _0x139e76?{'alias':_0x139e76}:undefined;}if(_0x2b68b7['length']===0x3&&_0x2b68b7[0x0]===_0x5715c4(0x128)&&_0x2b68b7[0x2]===_0x5715c4(0x150)){const _0x576344=_0x2b68b7[0x1]?.[_0x5715c4(0x138)]();return _0x576344?{'alias':_0x576344,'field':_0x5715c4(0x150)}:undefined;}return undefined;}function setLocalAppAlias(_0x33cc1a,_0x1e1cb8,_0x43cb87){const _0x953c25=a18_0x225bd5,_0x258c92=_0x33cc1a['apps']&&typeof _0x33cc1a['apps']==='object'&&!Array[_0x953c25(0x130)](_0x33cc1a['apps'])?_0x33cc1a['apps']:{},_0x27aabc=_0x258c92[_0x1e1cb8]&&typeof _0x258c92[_0x1e1cb8]==='object'&&!Array[_0x953c25(0x130)](_0x258c92[_0x1e1cb8])?_0x258c92[_0x1e1cb8]:{};_0x27aabc[_0x953c25(0x150)]=_0x43cb87,_0x258c92[_0x1e1cb8]=_0x27aabc,_0x33cc1a[_0x953c25(0x128)]=_0x258c92;}function deleteLocalAppAlias(_0x3013a1,_0x447a45){const _0xb946f5=a18_0x225bd5;if(!_0x3013a1[_0xb946f5(0x128)]||typeof _0x3013a1[_0xb946f5(0x128)]!==_0xb946f5(0x151)||Array[_0xb946f5(0x130)](_0x3013a1[_0xb946f5(0x128)]))return![];const _0x4718ee=_0x3013a1[_0xb946f5(0x128)],_0x4245ef=_0x4718ee[_0x447a45[_0xb946f5(0x14c)]];if(!_0x4245ef||typeof _0x4245ef!==_0xb946f5(0x151)||Array[_0xb946f5(0x130)](_0x4245ef))return![];if(!_0x447a45[_0xb946f5(0x13b)])return delete _0x4718ee[_0x447a45['alias']],!![];if(!(_0x447a45['field']in _0x4245ef))return![];return delete _0x4245ef[_0x447a45[_0xb946f5(0x13b)]],Object[_0xb946f5(0x122)](_0x4245ef)['length']===0x0&&delete _0x4718ee[_0x447a45[_0xb946f5(0x14c)]],!![];}const listDef={'service':a18_0x225bd5(0x12a),'command':a18_0x225bd5(0x12f),'description':a18_0x225bd5(0x125),'risk':a18_0x225bd5(0x123),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x536212){const _0x171929=a18_0x225bd5,{buildConfigFromFlags:_0x4f66cc}=await import('../../context.js'),_0x3b01e0=_0x4f66cc({}),_0x5a15a7=getProjectConfigPath(),_0x14a827=resolveWriteConfigPath(_0x171929(0x133));if(_0x536212[_0x171929(0x115)]===_0x171929(0x113))return{'ok':!![],'message':_0x171929(0x134)+(JSON['stringify'](_0x3b01e0[_0x171929(0x144)],null,0x2)+'\x0a\x0a')+'Config\x20files:\x0a'+(_0x171929(0x14a)+(_0x5a15a7??'(none)')+'\x0a')+(_0x171929(0x11d)+_0x14a827)};return{'ok':!![],'data':{'effective':_0x3b01e0[_0x171929(0x144)],'configFiles':{'project':_0x5a15a7??null,'global':_0x14a827}}};}},getDef={'service':'config','command':'get','description':a18_0x225bd5(0x114),'risk':a18_0x225bd5(0x123),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x225bd5(0x137),'description':'Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','required':!![]}],'flags':[],async 'execute'(_0x463451){const _0x4e16c1=a18_0x225bd5,_0x30e13e=_0x463451[_0x4e16c1(0x11b)][0x0];if(!_0x30e13e)throw CliErrors[_0x4e16c1(0x152)](_0x4e16c1(0x11c),_0x4e16c1(0x112)+CLI_BIN_NAME+_0x4e16c1(0x13c));const {buildConfigFromFlags:_0x1bff9f}=await import('../../context.js'),{raw:_0x5b2efd}=_0x1bff9f({});if(_0x30e13e[_0x4e16c1(0x147)]('.')){const _0x2d7a05=_0x30e13e['split']('.');let _0x473a50=_0x5b2efd;for(const _0x8cf54d of _0x2d7a05){if(_0x473a50==null||typeof _0x473a50!==_0x4e16c1(0x151))throw CliErrors['validation'](_0x4e16c1(0x116)+_0x30e13e);_0x473a50=_0x473a50[_0x8cf54d];}if(_0x473a50===undefined)throw CliErrors['validation'](_0x4e16c1(0x116)+_0x30e13e);return console[_0x4e16c1(0x135)](typeof _0x473a50===_0x4e16c1(0x151)?JSON[_0x4e16c1(0x14e)](_0x473a50,null,0x2):String(_0x473a50)),{'ok':!![]};}const _0x5a2e71=_0x5b2efd[_0x30e13e];if(_0x5a2e71===undefined)throw CliErrors[_0x4e16c1(0x152)](_0x4e16c1(0x116)+_0x30e13e);return console['log'](typeof _0x5a2e71===_0x4e16c1(0x151)?JSON[_0x4e16c1(0x14e)](_0x5a2e71,null,0x2):String(_0x5a2e71)),{'ok':!![]};}},setDef={'service':a18_0x225bd5(0x12a),'command':'set','description':'Set\x20a\x20config\x20value','risk':a18_0x225bd5(0x140),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x225bd5(0x137),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a18_0x225bd5(0x148),'description':a18_0x225bd5(0x145),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x421693){const _0x16c041=a18_0x225bd5,_0x2f5d8c=_0x421693[_0x16c041(0x11b)][0x0],_0x3ddd20=_0x421693['args'][0x1];if(!_0x2f5d8c||_0x3ddd20===undefined)throw CliErrors[_0x16c041(0x152)]('Missing\x20key\x20or\x20value.',_0x16c041(0x112)+CLI_BIN_NAME+_0x16c041(0x12e));if(ENUM_KEYS[_0x2f5d8c]&&!ENUM_KEYS[_0x2f5d8c][_0x16c041(0x147)](_0x3ddd20))throw CliErrors['validation']('Invalid\x20value\x20for\x20\x22'+_0x2f5d8c+'\x22.\x20Allowed:\x20'+ENUM_KEYS[_0x2f5d8c][_0x16c041(0x131)](',\x20'));if(_0x2f5d8c===_0x16c041(0x143))throw CliErrors[_0x16c041(0x152)](_0x16c041(0x127));if(_0x2f5d8c==='pageSize'){const _0x49e6b3=Number(_0x3ddd20);if(isNaN(_0x49e6b3)||_0x49e6b3<=0x0)throw CliErrors[_0x16c041(0x152)](_0x16c041(0x136));}const _0x30171c=resolveWriteScope({'explicitGlobal':_0x421693[_0x16c041(0x142)]('global'),'policy':_0x16c041(0x118)}),_0x2ab428=toScopeFlags(_0x30171c),_0x2ef044=readScopedConfig(_0x2ab428),_0x2eb93c=parseAliasAppcodeSetKey(_0x2f5d8c);if(!_0x2eb93c&&!isTopLevelConfigKey(_0x2f5d8c))throw CliErrors[_0x16c041(0x152)](_0x16c041(0x11e)+_0x2f5d8c+_0x16c041(0x149),_0x16c041(0x124)+getTopLevelConfigKeySummary()+_0x16c041(0x11a));return _0x2eb93c?setLocalAppAlias(_0x2ef044,_0x2eb93c,_0x3ddd20):_0x2ef044[_0x2f5d8c]=_0x2f5d8c===_0x16c041(0x13e)?Number(_0x3ddd20):_0x3ddd20,console[_0x16c041(0x135)]('Set\x20`'+_0x2f5d8c+'`\x20=\x20\x22'+_0x3ddd20+'\x22'+(_0x30171c===_0x16c041(0x133)?_0x16c041(0x12d):'')),writeScopedConfig(_0x2ef044,_0x2ab428),{'ok':!![]};}},deleteDef={'service':a18_0x225bd5(0x12a),'command':a18_0x225bd5(0x12b),'description':a18_0x225bd5(0x146),'risk':a18_0x225bd5(0x140),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x42d0cc){const _0x16725c=a18_0x225bd5,_0x4ed233=_0x42d0cc[_0x16725c(0x11b)][0x0];if(!_0x4ed233)throw CliErrors[_0x16725c(0x152)]('Missing\x20key\x20argument.',_0x16725c(0x112)+CLI_BIN_NAME+_0x16725c(0x141));const _0x5d442b=resolveWriteScope({'explicitGlobal':_0x42d0cc['bool'](_0x16725c(0x133)),'policy':_0x16725c(0x118)}),_0x22b0c0=toScopeFlags(_0x5d442b),_0x5a2692=readScopedConfig(_0x22b0c0),_0x318a34=parseAliasDeleteKey(_0x4ed233);if(_0x318a34){if(!deleteLocalAppAlias(_0x5a2692,_0x318a34))throw CliErrors[_0x16725c(0x152)](_0x16725c(0x116)+_0x4ed233);return console[_0x16725c(0x135)](_0x16725c(0x126)+_0x4ed233+'`'+(_0x5d442b==='global'?'\x20(global)':'')),writeScopedConfig(_0x5a2692,_0x22b0c0),{'ok':!![]};}if(_0x5a2692[_0x4ed233]===undefined)throw CliErrors[_0x16725c(0x152)](_0x16725c(0x121)+_0x4ed233+_0x16725c(0x139));return delete _0x5a2692[_0x4ed233],console[_0x16725c(0x135)](_0x16725c(0x126)+_0x4ed233+'`'+(_0x5d442b===_0x16725c(0x133)?_0x16725c(0x12d):'')),writeScopedConfig(_0x5a2692,_0x22b0c0),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a19_0xc75d(){var _0x58a43d=['157062aAaRiU','3034mjXnbz','652gnjkHE','1307216mIJLti','6061210xtrqpU','2649591UCswwv','3798948hnnWsW','18qucfWo','10675ANdeQE','48nfQczy'];a19_0xc75d=function(){return _0x58a43d;};return a19_0xc75d();}(function(_0x2e3fc0,_0x1c424b){var _0x2d38a7=a19_0xa5be,_0x207c60=_0x2e3fc0();while(!![]){try{var _0xf6f4e=parseInt(_0x2d38a7(0x1d6))/0x1+parseInt(_0x2d38a7(0x1cd))/0x2*(-parseInt(_0x2d38a7(0x1d5))/0x3)+parseInt(_0x2d38a7(0x1ce))/0x4*(parseInt(_0x2d38a7(0x1d4))/0x5)+parseInt(_0x2d38a7(0x1d2))/0x6+parseInt(_0x2d38a7(0x1d1))/0x7+parseInt(_0x2d38a7(0x1cf))/0x8+-parseInt(_0x2d38a7(0x1d3))/0x9*(parseInt(_0x2d38a7(0x1d0))/0xa);if(_0xf6f4e===_0x1c424b)break;else _0x207c60['push'](_0x207c60['shift']());}catch(_0x581a03){_0x207c60['push'](_0x207c60['shift']());}}}(a19_0xc75d,0x6c4ea));import{CLI_BIN_NAME}from'../../constant/cli.js';function a19_0xa5be(_0x32f132,_0x2cd53a){_0x32f132=_0x32f132-0x1cd;var _0xc75d9a=a19_0xc75d();var _0xa5be29=_0xc75d9a[_0x32f132];return _0xa5be29;}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_0x5e0794=a20_0x5587;(function(_0x4700a3,_0x311fa4){const _0x3b2b36=a20_0x5587,_0x4cbbb6=_0x4700a3();while(!![]){try{const _0x438f5f=-parseInt(_0x3b2b36(0x16e))/0x1+parseInt(_0x3b2b36(0x162))/0x2+parseInt(_0x3b2b36(0x152))/0x3*(-parseInt(_0x3b2b36(0x19c))/0x4)+parseInt(_0x3b2b36(0x190))/0x5+-parseInt(_0x3b2b36(0x1a1))/0x6+-parseInt(_0x3b2b36(0x182))/0x7*(-parseInt(_0x3b2b36(0x167))/0x8)+-parseInt(_0x3b2b36(0x172))/0x9;if(_0x438f5f===_0x311fa4)break;else _0x4cbbb6['push'](_0x4cbbb6['shift']());}catch(_0x57458a){_0x4cbbb6['push'](_0x4cbbb6['shift']());}}}(a20_0x8fdf,0x23dbb));import{executeData}from'../../core/sdk-client.js';function a20_0x5587(_0x29eb05,_0x5de824){_0x29eb05=_0x29eb05-0x152;const _0x8fdf37=a20_0x8fdf();let _0x5587ae=_0x8fdf37[_0x29eb05];return _0x5587ae;}import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';function a20_0x8fdf(){const _0x4ec6b6=['\x20\x20LOGICAL\x20COMBINATORS','Get\x20a\x20single\x20record\x20by\x20ID','Filter\x20dataset\x20records\x20with\x20query\x20conditions','now','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','\x20\x20PAGINATION','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','helpExtra','paramsRequired','\x20\x20AGGREGATE\x20TYPES','246958KhfpFL','command','write','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','Preview:\x20data\x20','909464zUNCyW','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','build','\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','58062vZegvS','aggregate','/api/{appCode}/','\x20\x20WHERE\x20OPERATORS','313407JOrAMc','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','body','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','dryRun','join','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','risk','str','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','getOne','\x20completed\x20in\x20','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','7ksPoGP','paramsHint','create','read','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Post-aggregation\x20filters,\x20e.g.\x20[{\x22columnName\x22:\x22total\x22,\x22condition\x22:{\x22$gt\x22:1000}}]','\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','params','\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','batchCreate','data\x20','1047415dXEmvO','code','filter','\x20\x20PARAMS\x20STRUCTURE','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','description','operation','POST','\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','delete','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','5988SPOiuG','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','high-risk-write','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','update','819156QUcObQ','\x20\x20EXAMPLES','141kwBkaf'];a20_0x8fdf=function(){return _0x4ec6b6;};return a20_0x8fdf();}const specs=[{'command':a20_0x5e0794(0x192),'operation':a20_0x5e0794(0x192),'risk':a20_0x5e0794(0x185),'paramsRequired':![],'description':a20_0x5e0794(0x155),'paramsHint':a20_0x5e0794(0x16d)+a20_0x5e0794(0x19b),'helpExtra':[a20_0x5e0794(0x171),a20_0x5e0794(0x16a),a20_0x5e0794(0x187),a20_0x5e0794(0x194),a20_0x5e0794(0x189),a20_0x5e0794(0x175),a20_0x5e0794(0x168),a20_0x5e0794(0x199),a20_0x5e0794(0x17e),a20_0x5e0794(0x178),a20_0x5e0794(0x195),'',a20_0x5e0794(0x153),'\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]',a20_0x5e0794(0x157),'\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','',a20_0x5e0794(0x15b),a20_0x5e0794(0x173),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27',a20_0x5e0794(0x19f)][a20_0x5e0794(0x17a)]('\x0a')},{'command':a20_0x5e0794(0x17f),'operation':'getOne','risk':a20_0x5e0794(0x185),'paramsRequired':!![],'description':a20_0x5e0794(0x154),'paramsHint':a20_0x5e0794(0x18d)},{'command':a20_0x5e0794(0x184),'operation':a20_0x5e0794(0x184),'risk':a20_0x5e0794(0x164),'paramsRequired':!![],'description':'Create\x20a\x20new\x20record\x20in\x20a\x20dataset','paramsHint':'JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27'},{'command':a20_0x5e0794(0x18e),'operation':a20_0x5e0794(0x18e),'risk':a20_0x5e0794(0x164),'paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','paramsHint':'JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27'},{'command':a20_0x5e0794(0x1a0),'operation':a20_0x5e0794(0x1a0),'risk':a20_0x5e0794(0x164),'paramsRequired':!![],'description':'Update\x20an\x20existing\x20record','paramsHint':a20_0x5e0794(0x176)},{'command':a20_0x5e0794(0x19a),'operation':'delete','risk':a20_0x5e0794(0x19e),'paramsRequired':!![],'description':a20_0x5e0794(0x17b),'paramsHint':a20_0x5e0794(0x18d)},{'command':a20_0x5e0794(0x16f),'operation':'aggregate','risk':a20_0x5e0794(0x185),'paramsRequired':![],'description':'Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','paramsHint':'JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20'+'Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','helpExtra':[a20_0x5e0794(0x161),a20_0x5e0794(0x18c),'\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}',a20_0x5e0794(0x18a),a20_0x5e0794(0x15e),a20_0x5e0794(0x177),a20_0x5e0794(0x15a),a20_0x5e0794(0x159),'',a20_0x5e0794(0x193),a20_0x5e0794(0x186),a20_0x5e0794(0x15c),a20_0x5e0794(0x16b),a20_0x5e0794(0x158),a20_0x5e0794(0x188),a20_0x5e0794(0x165),'',a20_0x5e0794(0x1a2),a20_0x5e0794(0x16c),a20_0x5e0794(0x19d),'',a20_0x5e0794(0x181),'\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','',a20_0x5e0794(0x15d)][a20_0x5e0794(0x17a)]('\x0a')}];function makeDataCommand(_0x326854){const _0x35dc1f=a20_0x5e0794,_0x422fc7=_0x35dc1f(0x18f)+_0x326854['command'],_0xee9f0a={'service':'data','command':_0x326854[_0x35dc1f(0x163)],'description':_0x326854[_0x35dc1f(0x196)],'risk':_0x326854[_0x35dc1f(0x17c)],'helpExtra':_0x326854[_0x35dc1f(0x15f)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x326854[_0x35dc1f(0x183)]}],'validate':async _0x172b92=>{const _0x325066=_0x35dc1f;_0x326854[_0x325066(0x160)]&&requireAnyOf(_0x172b92,[_0x325066(0x18b)],_0x422fc7),_0x326854[_0x325066(0x197)]===_0x325066(0x18e)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x172b92['str'](_0x325066(0x18b))));},async 'execute'(_0x16510d){const _0x2216b2=_0x35dc1f,_0x4c0996=_0x16510d['str'](_0x2216b2(0x191)),_0x4de7ff=_0x326854[_0x2216b2(0x197)]===_0x2216b2(0x18e)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x16510d['str'](_0x2216b2(0x18b)))):parseJsonParams(_0x16510d[_0x2216b2(0x17d)](_0x2216b2(0x18b)))??{},_0x30bf98=Date[_0x2216b2(0x156)](),_0x45261f=await executeData(_0x4c0996,_0x326854[_0x2216b2(0x197)],_0x4de7ff),_0x1f3a96=Date['now']()-_0x30bf98;return{'ok':!![],'data':{'result':_0x45261f,'elapsed':_0x1f3a96},'message':_0x2216b2(0x18f)+_0x326854[_0x2216b2(0x163)]+_0x2216b2(0x180)+_0x1f3a96+'ms'};}};return _0x326854['risk']!=='read'&&(_0xee9f0a[_0x35dc1f(0x179)]=async _0x39af6d=>{const _0x29f785=_0x35dc1f,_0xbc581d=_0x39af6d[_0x29f785(0x17d)](_0x29f785(0x191)),_0x2e4058=_0x326854[_0x29f785(0x197)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x39af6d[_0x29f785(0x17d)](_0x29f785(0x18b)))):parseJsonParams(_0x39af6d[_0x29f785(0x17d)](_0x29f785(0x18b)))??{};return dryRun(_0x29f785(0x198),_0x29f785(0x170)+_0xbc581d+'/'+_0x326854[_0x29f785(0x197)])[_0x29f785(0x174)](_0x2e4058)[_0x29f785(0x196)](_0x29f785(0x166)+_0x326854[_0x29f785(0x163)]+'\x20on\x20dataset\x20'+_0xbc581d)[_0x29f785(0x169)]();}),_0xee9f0a;}export const dataDefinitions=specs['map'](makeDataCommand);
|
|
1
|
+
const a20_0x2e1777=a20_0x41e7;(function(_0xbd5ca1,_0x9f28da){const _0x63a13c=a20_0x41e7,_0x327c25=_0xbd5ca1();while(!![]){try{const _0x683e29=parseInt(_0x63a13c(0x11c))/0x1*(-parseInt(_0x63a13c(0xe9))/0x2)+parseInt(_0x63a13c(0x117))/0x3+-parseInt(_0x63a13c(0x11d))/0x4*(parseInt(_0x63a13c(0x10d))/0x5)+-parseInt(_0x63a13c(0x115))/0x6+-parseInt(_0x63a13c(0xdf))/0x7+-parseInt(_0x63a13c(0xe2))/0x8*(-parseInt(_0x63a13c(0xde))/0x9)+parseInt(_0x63a13c(0x114))/0xa;if(_0x683e29===_0x9f28da)break;else _0x327c25['push'](_0x327c25['shift']());}catch(_0x303025){_0x327c25['push'](_0x327c25['shift']());}}}(a20_0x4574,0xa33ca));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';function a20_0x41e7(_0x414e86,_0x585355){_0x414e86=_0x414e86-0xd8;const _0x45746f=a20_0x4574();let _0x41e703=_0x45746f[_0x414e86];return _0x41e703;}function a20_0x4574(){const _0x3cf8be=['code','\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}}]}','high-risk-write','helpExtra','Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20on\x20dataset\x20','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','read','\x20\x20LOGICAL\x20COMBINATORS','\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}','dryRun','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','\x20\x20\x20\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}}]','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','risk','command','\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}','\x20\x20WHERE\x20OPERATORS','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','now','\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','Filter\x20dataset\x20records\x20with\x20query\x20conditions','\x20\x20AGGREGATE\x20TYPES','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','/api/{appCode}/','description','update','operation','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','10GdXzAD','delete','\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}]','filter','batchCreate','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','38102530IDJJGr','4823190mkqqcW','create','1152459talFPh','str','\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\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','4511KSsELo','2615132OyqPrv','write','\x20completed\x20in\x20','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','join','params','Preview:\x20data\x20','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','data\x20','Update\x20an\x20existing\x20record','build','map','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','paramsHint','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','\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]','9KZvvwy','8481795FezRzZ','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','\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}','7689328KCVyKP','\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\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','body','aggregate','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','\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}}]}','516JRARUD','\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}','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\x20\x20PAGINATION','data'];a20_0x4574=function(){return _0x3cf8be;};return a20_0x4574();}import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a20_0x2e1777(0x110),'operation':a20_0x2e1777(0x110),'risk':a20_0x2e1777(0xf6),'paramsRequired':![],'description':a20_0x2e1777(0x105),'paramsHint':a20_0x2e1777(0xe0)+a20_0x2e1777(0x126),'helpExtra':[a20_0x2e1777(0x100),a20_0x2e1777(0xff),'\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}',a20_0x2e1777(0x120),a20_0x2e1777(0xfa),'\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\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\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','',a20_0x2e1777(0xf7),a20_0x2e1777(0xe8),a20_0x2e1777(0xf0),'',a20_0x2e1777(0x101),'\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)',a20_0x2e1777(0x119),a20_0x2e1777(0x10f),a20_0x2e1777(0xec),a20_0x2e1777(0xe4),'',a20_0x2e1777(0xed),a20_0x2e1777(0xdc),a20_0x2e1777(0x113),'\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)'][a20_0x2e1777(0x122)]('\x0a')},{'command':'getOne','operation':'getOne','risk':a20_0x2e1777(0xf6),'paramsRequired':!![],'description':'Get\x20a\x20single\x20record\x20by\x20ID','paramsHint':a20_0x2e1777(0x107)},{'command':'create','operation':a20_0x2e1777(0x116),'risk':'write','paramsRequired':!![],'description':a20_0x2e1777(0x112),'paramsHint':a20_0x2e1777(0x125)},{'command':a20_0x2e1777(0x111),'operation':a20_0x2e1777(0x111),'risk':'write','paramsRequired':!![],'description':a20_0x2e1777(0xfc),'paramsHint':a20_0x2e1777(0x10c)},{'command':a20_0x2e1777(0x10a),'operation':a20_0x2e1777(0x10a),'risk':a20_0x2e1777(0x11e),'paramsRequired':!![],'description':a20_0x2e1777(0x128),'paramsHint':a20_0x2e1777(0xe7)},{'command':a20_0x2e1777(0x10e),'operation':a20_0x2e1777(0x10e),'risk':a20_0x2e1777(0xf1),'paramsRequired':!![],'description':a20_0x2e1777(0xeb),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':'aggregate','operation':a20_0x2e1777(0xe6),'risk':a20_0x2e1777(0xf6),'paramsRequired':![],'description':a20_0x2e1777(0xda),'paramsHint':'JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20'+a20_0x2e1777(0xf3),'helpExtra':[a20_0x2e1777(0x106),a20_0x2e1777(0xf8),a20_0x2e1777(0x11b),a20_0x2e1777(0xe1),a20_0x2e1777(0xf5),a20_0x2e1777(0xea),a20_0x2e1777(0xe3),'\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',a20_0x2e1777(0xdd),a20_0x2e1777(0x102),a20_0x2e1777(0x11a),'\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]',a20_0x2e1777(0xfb),'\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','','\x20\x20EXAMPLES','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status',a20_0x2e1777(0x121),'','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter',a20_0x2e1777(0x104),'','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.'][a20_0x2e1777(0x122)]('\x0a')}];function makeDataCommand(_0x572893){const _0x454a91=a20_0x2e1777,_0x1ec383=_0x454a91(0x127)+_0x572893[_0x454a91(0xfe)],_0x4b8751={'service':_0x454a91(0xee),'command':_0x572893[_0x454a91(0xfe)],'description':_0x572893[_0x454a91(0x109)],'risk':_0x572893[_0x454a91(0xfd)],'helpExtra':_0x572893[_0x454a91(0xf2)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x572893[_0x454a91(0xdb)]}],'validate':async _0x3cb87b=>{const _0x40a3d6=_0x454a91;_0x572893['paramsRequired']&&requireAnyOf(_0x3cb87b,[_0x40a3d6(0x123)],_0x1ec383),_0x572893[_0x40a3d6(0x10b)]===_0x40a3d6(0x111)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x3cb87b['str'](_0x40a3d6(0x123))));},async 'execute'(_0x4edaa6){const _0xab7c49=_0x454a91,_0x430538=_0x4edaa6[_0xab7c49(0x118)]('code'),_0x50689b=_0x572893[_0xab7c49(0x10b)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x4edaa6['str']('params'))):parseJsonParams(_0x4edaa6['str'](_0xab7c49(0x123)))??{},_0x1d5932=Date[_0xab7c49(0x103)](),_0x5bf59b=await executeData(_0x430538,_0x572893[_0xab7c49(0x10b)],_0x50689b),_0x4d20dd=Date[_0xab7c49(0x103)]()-_0x1d5932;return{'ok':!![],'data':{'result':_0x5bf59b,'elapsed':_0x4d20dd},'message':'data\x20'+_0x572893[_0xab7c49(0xfe)]+_0xab7c49(0x11f)+_0x4d20dd+'ms'};}};return _0x572893[_0x454a91(0xfd)]!==_0x454a91(0xf6)&&(_0x4b8751[_0x454a91(0xf9)]=async _0x549d60=>{const _0x47e820=_0x454a91,_0x4c6ceb=_0x549d60[_0x47e820(0x118)](_0x47e820(0xef)),_0x405cb6=_0x572893[_0x47e820(0x10b)]===_0x47e820(0x111)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x549d60[_0x47e820(0x118)](_0x47e820(0x123)))):parseJsonParams(_0x549d60['str'](_0x47e820(0x123)))??{};return dryRun('POST',_0x47e820(0x108)+_0x4c6ceb+'/'+_0x572893['operation'])[_0x47e820(0xe5)](_0x405cb6)[_0x47e820(0x109)](_0x47e820(0x124)+_0x572893[_0x47e820(0xfe)]+_0x47e820(0xf4)+_0x4c6ceb)[_0x47e820(0xd8)]();}),_0x4b8751;}export const dataDefinitions=specs[a20_0x2e1777(0xd9)](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a21_0x429be4=a21_0x1c7e;(function(_0x2f167c,_0x3f67e1){const _0x4d2b7a=a21_0x1c7e,_0xa0d4bb=_0x2f167c();while(!![]){try{const _0x70b9ed=parseInt(_0x4d2b7a(0x1bf))/0x1*(-parseInt(_0x4d2b7a(0x1c2))/0x2)+parseInt(_0x4d2b7a(0x1ce))/0x3+parseInt(_0x4d2b7a(0x1f2))/0x4+-parseInt(_0x4d2b7a(0x1fa))/0x5+-parseInt(_0x4d2b7a(0x1cc))/0x6*(parseInt(_0x4d2b7a(0x1ec))/0x7)+parseInt(_0x4d2b7a(0x1fd))/0x8+-parseInt(_0x4d2b7a(0x1e8))/0x9;if(_0x70b9ed===_0x3f67e1)break;else _0xa0d4bb['push'](_0xa0d4bb['shift']());}catch(_0x427e4f){_0xa0d4bb['push'](_0xa0d4bb['shift']());}}}(a21_0x49b3,0x7b165));function a21_0x1c7e(_0x4b8979,_0x22b45a){_0x4b8979=_0x4b8979-0x1b3;const _0x49b36d=a21_0x49b3();let _0x1c7e1c=_0x49b36d[_0x4b8979];return _0x1c7e1c;}import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x24adb5){const _0x230db1=a21_0x1c7e;if(_0x24adb5[_0x230db1(0x1bb)])return null;const _0x321bd3=Boolean(_0x24adb5['displayName']!==undefined||_0x24adb5['doType']!==undefined);let _0x1a98b1={};if(!_0x321bd3&&typeof _0x24adb5['extend']===_0x230db1(0x1d4))try{_0x1a98b1=JSON[_0x230db1(0x1df)](_0x24adb5[_0x230db1(0x1eb)]);}catch{}const _0x114986=_0x321bd3?_0x24adb5['name']:_0x24adb5[_0x230db1(0x1c6)],_0x2cf641=_0x321bd3?_0x24adb5[_0x230db1(0x1e7)]:_0x24adb5[_0x230db1(0x201)],_0x245403=_0x321bd3?_0x24adb5['doType']:_0x24adb5[_0x230db1(0x1b5)]||_0x24adb5[_0x230db1(0x1ff)],_0x290ee1=_0x321bd3?_0x24adb5[_0x230db1(0x1f8)]===!![]:_0x1a98b1['pkField']===!![],_0x4afee2=_0x321bd3?_0x24adb5[_0x230db1(0x1e1)]===!![]:_0x1a98b1[_0x230db1(0x1e1)]===!![],_0x7f8dda=_0x321bd3?_0x24adb5[_0x230db1(0x1fc)]??null:_0x1a98b1[_0x230db1(0x1fc)]??null,_0x16e158={'name':_0x114986,'displayName':_0x2cf641||_0x114986,'type':_0x245403,'dbType':_0x24adb5[_0x230db1(0x1c8)],'pk':_0x290ee1,'required':_0x4afee2,'description':_0x24adb5['description']||undefined};return Array['isArray'](_0x7f8dda)&&_0x7f8dda[_0x230db1(0x1f6)]>0x0&&(_0x16e158[_0x230db1(0x1fc)]=_0x7f8dda),_0x16e158;}function parseJsonMaybe(_0x7d2914){const _0x2dea68=a21_0x1c7e;if(typeof _0x7d2914!=='string')return _0x7d2914;try{return JSON[_0x2dea68(0x1df)](_0x7d2914);}catch{return _0x7d2914;}}function normalizeOperationEntry(_0x1c9773,_0xc33aa4){const _0x20ee6a=a21_0x1c7e;if(!_0xc33aa4||typeof _0xc33aa4!==_0x20ee6a(0x1b7))return null;if(!_0xc33aa4['method']||!_0xc33aa4[_0x20ee6a(0x1ee)])return null;const _0x32d966={'name':_0x1c9773,'method':_0xc33aa4[_0x20ee6a(0x1c9)],'path':_0xc33aa4[_0x20ee6a(0x1ee)]};if(_0xc33aa4[_0x20ee6a(0x1d9)])_0x32d966[_0x20ee6a(0x1d9)]=_0xc33aa4[_0x20ee6a(0x1d9)];if(_0xc33aa4['requestBody']!=null)_0x32d966[_0x20ee6a(0x1e0)]=parseJsonMaybe(_0xc33aa4[_0x20ee6a(0x1e0)]);if(_0xc33aa4[_0x20ee6a(0x1d0)]!=null)_0x32d966[_0x20ee6a(0x1d0)]=parseJsonMaybe(_0xc33aa4[_0x20ee6a(0x1d0)]);if(_0xc33aa4[_0x20ee6a(0x1c0)]!=null)_0x32d966[_0x20ee6a(0x1c0)]=_0xc33aa4['beforeScriptId'];if(_0xc33aa4['afterScriptId']!=null)_0x32d966[_0x20ee6a(0x1e6)]=_0xc33aa4[_0x20ee6a(0x1e6)];if(Array[_0x20ee6a(0x1ef)](_0xc33aa4[_0x20ee6a(0x1f1)]))_0x32d966[_0x20ee6a(0x1f1)]=_0xc33aa4[_0x20ee6a(0x1f1)];if(Array[_0x20ee6a(0x1ef)](_0xc33aa4[_0x20ee6a(0x1db)]))_0x32d966[_0x20ee6a(0x1db)]=_0xc33aa4[_0x20ee6a(0x1db)];return _0x32d966;}function summarizeDbtable(_0x24b896){const _0x23f0df=a21_0x1c7e,_0x1935f3={},_0x4845ca=[_0x23f0df(0x1c1),_0x23f0df(0x1c4),'tableName',_0x23f0df(0x1e2),_0x23f0df(0x1f8),_0x23f0df(0x1fe),'logicField',_0x23f0df(0x1b3),_0x23f0df(0x1de),_0x23f0df(0x1f9),'creatorNameField',_0x23f0df(0x1bd),'modifierNameField',_0x23f0df(0x1c7),_0x23f0df(0x1d8)];for(const _0x34e47f of _0x4845ca){if(_0x24b896[_0x34e47f]!==undefined)_0x1935f3[_0x34e47f]=_0x24b896[_0x34e47f];}return typeof _0x1935f3[_0x23f0df(0x1fe)]===_0x23f0df(0x1d4)&&_0x1935f3['allFields'][_0x23f0df(0x1f6)]>0x0&&(_0x1935f3[_0x23f0df(0x1f7)]=_0x1935f3['allFields'][_0x23f0df(0x1be)](',')['map'](_0x185fae=>_0x185fae[_0x23f0df(0x1b4)]())['filter'](Boolean)),_0x1935f3;}function normalizeRelatedPages(_0x1b9e8e){const _0x33ef3e=a21_0x1c7e;if(!Array['isArray'](_0x1b9e8e))return[];return _0x1b9e8e[_0x33ef3e(0x1f5)](_0x15f451=>_0x15f451&&typeof _0x15f451===_0x33ef3e(0x1b7))[_0x33ef3e(0x1d7)](_0x515711=>({'id':_0x515711['id'],'type':_0x515711[_0x33ef3e(0x1b5)],'code':_0x515711[_0x33ef3e(0x1c6)],'title':_0x515711['title'],'deleted':_0x515711['deleted']===!![]}));}function normalizeFallbackFieldName(_0x50b041,_0x17c8e5){const _0x579a71=_0x50b041['trim']();if(!_0x579a71)return null;return{'name':_0x579a71,'displayName':_0x579a71,'type':undefined,'dbType':undefined,'pk':_0x579a71===_0x17c8e5,'required':![],'description':undefined};}function a21_0x49b3(){const _0x2e1aa1=['fromField','updateTimeField','parse','requestBody','required','datasetKey','relations','modelId','toDatasetName','afterScriptId','displayName','1073763eHdBzl','properties','validateRules','extend','205289EKOusr','doVersion','path','isArray','indexes','requestFields','753292YeJrbf','detail','modelCode','filter','length','allFieldNames','pkField','creatorIdField','3764595NJnLPv','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','options','7811672DzhbBX','allFields','dataType','source','name','createTimeField','trim','type','relatedPageInfoList','object','appCode','operations','dataset','deleted','toFieldLabel','modifierIdField','split','4Senolc','beforeScriptId','dbId','168022GaZwRc','description','dbName','str','code','labelField','dbType','method','fields','push','36EfunwC','formatRules','2170845PBPEIf','toField','responseBody','dbtableConfig','read','columnCodeListWithDeleted','string','tableComment','tableName','map','dblinkInfoDTO','host','toTableName','responseFields','toDatasetCode'];a21_0x49b3=function(){return _0x2e1aa1;};return a21_0x49b3();}async function loadListFieldFallback(_0x290d24,_0x464fa2){const _0x5abc71=a21_0x1c7e;if(!_0x290d24||!_0x464fa2)return[];try{const _0xf1fec7=await listDatasets(_0x290d24,{'code':_0x464fa2}),_0xce0839=_0xf1fec7['find'](_0x4fc120=>_0x4fc120[_0x5abc71(0x1c6)]===_0x464fa2)??_0xf1fec7[0x0],_0xc52c64=_0xce0839?.[_0x5abc71(0x1d1)]??{},_0x48b14d=typeof _0xc52c64['allFields']==='string'?_0xc52c64[_0x5abc71(0x1fe)]['split'](','):[];return _0x48b14d[_0x5abc71(0x1d7)](_0x35d325=>normalizeFallbackFieldName(_0x35d325,_0xc52c64[_0x5abc71(0x1f8)]))['filter'](_0x2a6f16=>_0x2a6f16!==null);}catch{return[];}}export const datasetDetail={'service':a21_0x429be4(0x1ba),'command':a21_0x429be4(0x1f3),'description':a21_0x429be4(0x1fb),'risk':a21_0x429be4(0x1d2),'flags':[CODE_FLAG],async 'execute'(_0x341516){const _0xdeaaf8=a21_0x429be4,_0x4f4a1d=await getDatasetDetail(_0x341516[_0xdeaaf8(0x1c5)](_0xdeaaf8(0x1c6))),_0x4979f8=Array[_0xdeaaf8(0x1ef)](_0x4f4a1d[_0xdeaaf8(0x1ca)])?_0x4f4a1d['fields']:Array['isArray'](_0x4f4a1d[_0xdeaaf8(0x1e9)])?_0x4f4a1d[_0xdeaaf8(0x1e9)]:[];let _0x5632eb=_0x4979f8['map'](_0x3e2c43=>normalizeField(_0x3e2c43))['filter'](_0x244d62=>_0x244d62!==null);_0x5632eb[_0xdeaaf8(0x1f6)]===0x0&&(_0x5632eb=await loadListFieldFallback(_0x341516[_0xdeaaf8(0x1b8)],_0x341516[_0xdeaaf8(0x1c5)]('code')));const _0x59d07e=_0x4f4a1d[_0xdeaaf8(0x1b9)]??{},_0x354852=[];for(const [_0x1e1469,_0x132607]of Object['entries'](_0x59d07e)){const _0x138ef3=normalizeOperationEntry(_0x1e1469,_0x132607);if(_0x138ef3)_0x354852[_0xdeaaf8(0x1cb)](_0x138ef3);}const _0x9e18d5=_0x4f4a1d[_0xdeaaf8(0x1d1)]??{},_0x458de3=_0x4f4a1d[_0xdeaaf8(0x1ba)]??{},_0x3ed467=_0x9e18d5[_0xdeaaf8(0x1c1)]!=null?{'id':_0x9e18d5[_0xdeaaf8(0x1c1)],'name':_0x9e18d5[_0xdeaaf8(0x1c4)]??null}:undefined;let _0x25267d;return typeof _0x4f4a1d[_0xdeaaf8(0x1eb)]===_0xdeaaf8(0x1d4)&&(_0x25267d=parseJsonMaybe(_0x4f4a1d[_0xdeaaf8(0x1eb)])),{'ok':!![],'data':{'id':_0x4f4a1d[_0xdeaaf8(0x1e4)]??_0x4f4a1d['id'],'name':_0x4f4a1d[_0xdeaaf8(0x201)],'code':_0x4f4a1d[_0xdeaaf8(0x1f4)]||_0x4f4a1d[_0xdeaaf8(0x1c6)],'doVersion':_0x4f4a1d[_0xdeaaf8(0x1ed)],'description':_0x4f4a1d[_0xdeaaf8(0x1c3)]||_0x458de3[_0xdeaaf8(0x1d5)]||undefined,'source':_0x4f4a1d[_0xdeaaf8(0x200)]||_0x458de3['sourceType'],'table':_0x9e18d5[_0xdeaaf8(0x1d6)]||_0x458de3[_0xdeaaf8(0x1d6)],'datasetKey':_0x9e18d5[_0xdeaaf8(0x1e2)],'pk':_0x9e18d5[_0xdeaaf8(0x1f8)],'db':_0x3ed467,'dbtable':summarizeDbtable(_0x9e18d5),'fields':_0x5632eb,'operations':_0x354852,'indexes':Array[_0xdeaaf8(0x1ef)](_0x458de3[_0xdeaaf8(0x1f0)])?_0x458de3[_0xdeaaf8(0x1f0)]:[],'relations':Array[_0xdeaaf8(0x1ef)](_0x4f4a1d['relations'])?_0x4f4a1d[_0xdeaaf8(0x1e3)][_0xdeaaf8(0x1d7)](_0x36697d=>({'fromField':_0x36697d[_0xdeaaf8(0x1dd)],'toDataset':_0x36697d[_0xdeaaf8(0x1e5)],'toCode':_0x36697d[_0xdeaaf8(0x1dc)],'toTable':_0x36697d[_0xdeaaf8(0x1da)],'toField':_0x36697d[_0xdeaaf8(0x1cf)],'labelField':_0x36697d[_0xdeaaf8(0x1bc)]||undefined})):[],'relatedPages':normalizeRelatedPages(_0x4f4a1d[_0xdeaaf8(0x1b6)]),...Array['isArray'](_0x4f4a1d[_0xdeaaf8(0x1d3)])?{'columnCodeListWithDeleted':_0x4f4a1d[_0xdeaaf8(0x1d3)]}:{},'formatRules':Array[_0xdeaaf8(0x1ef)](_0x4f4a1d[_0xdeaaf8(0x1cd)])?_0x4f4a1d[_0xdeaaf8(0x1cd)]:[],'validateRules':Array[_0xdeaaf8(0x1ef)](_0x4f4a1d[_0xdeaaf8(0x1ea)])?_0x4f4a1d[_0xdeaaf8(0x1ea)]:[],..._0x25267d!==undefined?{'extend':_0x25267d}:{},'stats':{'fieldCount':_0x5632eb['length'],'operationCount':_0x354852[_0xdeaaf8(0x1f6)]}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4a42fe,_0x104033){const _0x126367=a22_0x176f,_0x422fdf=_0x4a42fe();while(!![]){try{const _0x1a01c2=parseInt(_0x126367(0x169))/0x1+parseInt(_0x126367(0x16b))/0x2*(parseInt(_0x126367(0x168))/0x3)+parseInt(_0x126367(0x171))/0x4+-parseInt(_0x126367(0x16a))/0x5*(-parseInt(_0x126367(0x16c))/0x6)+parseInt(_0x126367(0x16e))/0x7+-parseInt(_0x126367(0x170))/0x8*(-parseInt(_0x126367(0x172))/0x9)+parseInt(_0x126367(0x16f))/0xa*(-parseInt(_0x126367(0x16d))/0xb);if(_0x1a01c2===_0x104033)break;else _0x422fdf['push'](_0x422fdf['shift']());}catch(_0x679eb8){_0x422fdf['push'](_0x422fdf['shift']());}}}(a22_0x3581,0x3b63d));function a22_0x3581(){const _0x2e8024=['97864kLyRDq','996904exxkOm','135FXDwqu','686568hEntyb','45948hyAQSF','5RotusI','2zCdwTt','2491926GNuJQi','13133450ZzDtKW','2200555gbELKW','10LnGoYf'];a22_0x3581=function(){return _0x2e8024;};return a22_0x3581();}import{datasetList}from'../../commands/dataset/list.js';function a22_0x176f(_0x4b400d,_0x40e090){_0x4b400d=_0x4b400d-0x168;const _0x358135=a22_0x3581();let _0x176f0a=_0x358135[_0x4b400d];return _0x176f0a;}import{datasetDetail}from'../../commands/dataset/detail.js';import{datasetSdkDoc}from'../../commands/dataset/sdk-doc.js';export const datasetDefinitions=[datasetList,datasetDetail,datasetSdkDoc];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a23_0x4bfc(_0x47ff0d,_0x2fa14a){_0x47ff0d=_0x47ff0d-0x8c;const _0x22fbe8=a23_0x22fb();let _0x4bfcd0=_0x22fbe8[_0x47ff0d];return _0x4bfcd0;}const a23_0x544747=a23_0x4bfc;function a23_0x22fb(){const _0x232b94=['10KWiDgr','dbtableConfig','368980aEZdcb','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)','486484jnzpeM','pkField','read','148RAhSOa','7547103wwfjHl','264HjgFFe','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','split','str','map','9826104QpUkUh','allFields','name','2887200gkbpWp','29386YlbRKN','source','dataset','tableName','trim','12058xACaiY','code','341woJdIB','length'];a23_0x22fb=function(){return _0x232b94;};return a23_0x22fb();}(function(_0x2d3be5,_0x23631d){const _0x3102c6=a23_0x4bfc,_0x2107a8=_0x2d3be5();while(!![]){try{const _0x481aa1=parseInt(_0x3102c6(0x90))/0x1*(parseInt(_0x3102c6(0xa0))/0x2)+-parseInt(_0x3102c6(0x9a))/0x3+parseInt(_0x3102c6(0x8d))/0x4*(-parseInt(_0x3102c6(0xa4))/0x5)+parseInt(_0x3102c6(0x97))/0x6+parseInt(_0x3102c6(0x9b))/0x7*(-parseInt(_0x3102c6(0x92))/0x8)+parseInt(_0x3102c6(0x91))/0x9+-parseInt(_0x3102c6(0xa6))/0xa*(parseInt(_0x3102c6(0xa2))/0xb);if(_0x481aa1===_0x23631d)break;else _0x2107a8['push'](_0x2107a8['shift']());}catch(_0x289269){_0x2107a8['push'](_0x2107a8['shift']());}}}(a23_0x22fb,0xd6f91));import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';export const datasetList={'service':a23_0x544747(0x9d),'command':'list','description':a23_0x544747(0x93),'risk':a23_0x544747(0x8f),'flags':[{'name':'name','type':'string','description':a23_0x544747(0x8c)},{...CODE_FLAG,'required':![],'description':a23_0x544747(0xa7)}],async 'execute'(_0x480ee1){const _0x1ea5a9=a23_0x544747,_0xb16dcf=_0x480ee1['str'](_0x1ea5a9(0x99)),_0x25c567=_0x480ee1[_0x1ea5a9(0x95)]('code'),_0x4fc305=await listDatasets(_0x480ee1['appCode'],{..._0xb16dcf&&{'name':_0xb16dcf},..._0x25c567&&{'code':_0x25c567}});return{'ok':!![],'data':{'total':_0x4fc305[_0x1ea5a9(0xa3)],'datasets':_0x4fc305[_0x1ea5a9(0x96)](_0x5a7172=>{const _0x362fb0=_0x1ea5a9,_0x39ce7c=_0x5a7172[_0x362fb0(0xa5)]??{};return{'id':_0x5a7172['id'],'code':_0x5a7172[_0x362fb0(0xa1)],'name':_0x5a7172[_0x362fb0(0x99)],'source':_0x5a7172[_0x362fb0(0x9c)],'description':_0x5a7172['description'],'table':_0x39ce7c[_0x362fb0(0x9e)],'datasetKey':_0x39ce7c['datasetKey'],'pk':_0x39ce7c[_0x362fb0(0x8e)],'fields':_0x39ce7c[_0x362fb0(0x98)]?_0x39ce7c[_0x362fb0(0x98)][_0x362fb0(0x94)](',')['map'](_0x1538be=>_0x1538be[_0x362fb0(0x9f)]()):[]};})}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a24_0x21ba46=a24_0x3e8d;(function(_0x2ce9da,_0x1cf78f){const _0x42911d=a24_0x3e8d,_0x44256a=_0x2ce9da();while(!![]){try{const _0x37d838=-parseInt(_0x42911d(0x11a))/0x1*(-parseInt(_0x42911d(0x117))/0x2)+parseInt(_0x42911d(0x10f))/0x3*(-parseInt(_0x42911d(0x11f))/0x4)+-parseInt(_0x42911d(0x11d))/0x5*(parseInt(_0x42911d(0x110))/0x6)+-parseInt(_0x42911d(0x115))/0x7*(parseInt(_0x42911d(0x112))/0x8)+parseInt(_0x42911d(0x116))/0x9+parseInt(_0x42911d(0x113))/0xa+parseInt(_0x42911d(0x120))/0xb*(parseInt(_0x42911d(0x121))/0xc);if(_0x37d838===_0x1cf78f)break;else _0x44256a['push'](_0x44256a['shift']());}catch(_0x180d23){_0x44256a['push'](_0x44256a['shift']());}}}(a24_0x4099,0x45114));import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';const DEFAULT_MARKDOWN='#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档';function a24_0x3e8d(_0x1ce7c7,_0x376944){_0x1ce7c7=_0x1ce7c7-0x10e;const _0x4099d0=a24_0x4099();let _0x3e8deb=_0x4099d0[_0x1ce7c7];return _0x3e8deb;}export function formatDatasetSdkMarkdown(_0x407b55){const _0x5ced33=a24_0x3e8d,_0x166152=typeof _0x407b55===_0x5ced33(0x11e)?_0x407b55['trim']():'';return _0x166152||DEFAULT_MARKDOWN;}export const datasetSdkDoc={'service':'dataset','command':a24_0x21ba46(0x11b),'description':a24_0x21ba46(0x114),'risk':a24_0x21ba46(0x118),'flags':[{...CODE_FLAG,'description':a24_0x21ba46(0x111)}],async 'execute'(_0x43d7f){const _0x97c882=a24_0x21ba46,_0x30e5a2=_0x43d7f[_0x97c882(0x11c)](_0x97c882(0x119)),_0x42661c=await getDatasetSdkUsageDoc(_0x30e5a2,_0x43d7f[_0x97c882(0x10e)]);return{'ok':!![],'data':{'code':_0x30e5a2,'appCode':_0x43d7f[_0x97c882(0x10e)],'markdown':formatDatasetSdkMarkdown(_0x42661c)}};}};function a24_0x4099(){const _0x3be8d2=['1775673lxFADa','15944LhkfaI','read','code','3hQhInY','sdk-doc','str','405uQctfk','string','4ntJgme','33caYbzE','1585776eiDQba','appCode','997869IUmXmO','22188HieknV','Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','792PCDtdp','3004730kxKTbJ','Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','217lFXQKf'];a24_0x4099=function(){return _0x3be8d2;};return a24_0x4099();}
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x103f77=a25_0x1529;(function(_0x54748e,_0x53423b){const _0x1328a3=a25_0x1529,_0x437ad1=_0x54748e();while(!![]){try{const _0x5418b9=parseInt(_0x1328a3(0xc2))/0x1+parseInt(_0x1328a3(0xfb))/0x2*(-parseInt(_0x1328a3(0xce))/0x3)+-parseInt(_0x1328a3(0xdc))/0x4*(parseInt(_0x1328a3(0xc8))/0x5)+-parseInt(_0x1328a3(0xf6))/0x6*(-parseInt(_0x1328a3(0xc0))/0x7)+parseInt(_0x1328a3(0xda))/0x8*(-parseInt(_0x1328a3(0xb6))/0x9)+parseInt(_0x1328a3(0xcd))/0xa*(-parseInt(_0x1328a3(0xe2))/0xb)+-parseInt(_0x1328a3(0xec))/0xc*(-parseInt(_0x1328a3(0xeb))/0xd);if(_0x5418b9===_0x53423b)break;else _0x437ad1['push'](_0x437ad1['shift']());}catch(_0x3608e0){_0x437ad1['push'](_0x437ad1['shift']());}}}(a25_0x3a8b,0xb9a18));import a25_0x4fd191 from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';function a25_0x1529(_0x576d2c,_0x138e78){_0x576d2c=_0x576d2c-0xae;const _0x3a8b6b=a25_0x3a8b();let _0x152945=_0x3a8b6b[_0x576d2c];return _0x152945;}import{inspectServiceRegistry}from'../commands/service/registry.js';function a25_0x3a8b(){const _0x1d8bc8=['\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','(no\x20file)','bold','\x20(accessKey)','path','platform','(unnamed)','143lkomGc','688728iUHynt','(not\x20set)','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20auth\x20(effective):\x20','locale','length','appCode','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20commands)','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','12TeJtwA','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','riskLevel','red','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','617488XxERam','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20API\x20Endpoints','yellow','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20(legacy/compat\x20only)','gray','green','serviceCode','(not\x20found)','⚠\x20Empty\x20(treated\x20as\x20{})','currentApp','env','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','doctor','\x20\x20─','message','empty','verbose','Diagnose\x20CLI\x20configuration\x20and\x20environment','(default)','missing','read','324gtgIQj','\x20\x20Session\x20check:\x20\x20\x20','(set,\x20length=','(removed\x20—\x20cookie\x20auth\x20disabled)','registryPath','format','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','\x20\x20Merged\x20Config','\x20\x20Config\x20JSON','(none)','4991406RGXpiA','⚠\x20Empty','1167298DDqnSR','\x20\x20Config\x20Files','✓\x20Loaded','Project','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','✓\x20Valid\x20JSON','20dtDNac','status','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','✗\x20Invalid','\x20doctor','20BGOLLQ','6UWIpMK','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','ClientAk','arch','(default:\x20','check','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','repeat','\x20\x20Auth','source','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','accessKey','236888DfiXOR','defaultApp','527980dLvRDz','log','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Global','(missing)','padEnd','1391170FhFUGQ'];a25_0x3a8b=function(){return _0x1d8bc8;};return a25_0x3a8b();}async function execute(_0x54fa3c){const _0x56f6ff=a25_0x1529,_0x3773a2=getCliVersion(),_0x3da7f4=buildConfigFromFlags({});await initGlobalEnvironment(_0x3da7f4),console['log'](),console[_0x56f6ff(0xdd)](a25_0x4fd191['bold'](CLI_BIN_NAME+_0x56f6ff(0xcc))),console[_0x56f6ff(0xdd)](a25_0x4fd191[_0x56f6ff(0x101)]('─'[_0x56f6ff(0xd5)](0x32))),console['log'](_0x56f6ff(0xca)+_0x3773a2),console[_0x56f6ff(0xdd)](_0x56f6ff(0xd4)+process['version']),console[_0x56f6ff(0xdd)](_0x56f6ff(0xe4)+process[_0x56f6ff(0xe9)]+'\x20'+process[_0x56f6ff(0xd1)]),console[_0x56f6ff(0xdd)](),console['log'](a25_0x4fd191[_0x56f6ff(0xe6)](_0x56f6ff(0xc3))),console[_0x56f6ff(0xdd)](a25_0x4fd191['gray'](_0x56f6ff(0xae)[_0x56f6ff(0xd5)](0x1e)));const _0x30b40c=getGlobalConfigPath(),_0x1acb9e=getProjectConfigPath();console[_0x56f6ff(0xdd)](_0x56f6ff(0xd8)+(_0x30b40c||a25_0x4fd191[_0x56f6ff(0x101)](_0x56f6ff(0x104)))),console[_0x56f6ff(0xdd)](_0x56f6ff(0xff)+(_0x1acb9e||a25_0x4fd191[_0x56f6ff(0x101)](_0x56f6ff(0x104)))),console[_0x56f6ff(0xdd)](),console[_0x56f6ff(0xdd)](a25_0x4fd191[_0x56f6ff(0xe6)](_0x56f6ff(0xbe))),console['log'](a25_0x4fd191[_0x56f6ff(0x101)](_0x56f6ff(0xae)[_0x56f6ff(0xd5)](0x1e)));const _0x30597e=(_0x2f9d1c,_0x1a12c0)=>{const _0x3cce23=_0x56f6ff;if(!_0x1a12c0){console['log']('\x20\x20'+_0x2f9d1c[_0x3cce23(0xe1)](0x11)+'\x20'+a25_0x4fd191[_0x3cce23(0x101)](_0x3cce23(0xe5)));return;}const _0x1b2776=inspectCliConfigJsonFile(_0x1a12c0);if(_0x1b2776[_0x3cce23(0xc9)]==='ok')console[_0x3cce23(0xdd)]('\x20\x20'+_0x2f9d1c['padEnd'](0x11)+'\x20'+a25_0x4fd191[_0x3cce23(0x102)](_0x3cce23(0xc7)));else{if(_0x1b2776[_0x3cce23(0xc9)]===_0x3cce23(0xb0))console[_0x3cce23(0xdd)]('\x20\x20'+_0x2f9d1c[_0x3cce23(0xe1)](0x11)+'\x20'+a25_0x4fd191[_0x3cce23(0xfe)](_0x3cce23(0x105)));else _0x1b2776['status']===_0x3cce23(0xb4)?console[_0x3cce23(0xdd)]('\x20\x20'+_0x2f9d1c[_0x3cce23(0xe1)](0x11)+'\x20'+a25_0x4fd191[_0x3cce23(0x101)](_0x3cce23(0xe0))):(console[_0x3cce23(0xdd)]('\x20\x20'+_0x2f9d1c['padEnd'](0x11)+'\x20'+a25_0x4fd191[_0x3cce23(0xf9)]('✗\x20Invalid\x20JSON')),console[_0x3cce23(0xdd)]('\x20\x20'+''['padEnd'](0x11)+'\x20'+a25_0x4fd191[_0x3cce23(0xf9)](_0x1b2776[_0x3cce23(0xaf)])));}};_0x30597e(_0x56f6ff(0xdf),_0x30b40c),_0x30597e(_0x56f6ff(0xc5),_0x1acb9e),console[_0x56f6ff(0xdd)](),console[_0x56f6ff(0xdd)](a25_0x4fd191[_0x56f6ff(0xe6)](_0x56f6ff(0xbd))),console[_0x56f6ff(0xdd)](a25_0x4fd191[_0x56f6ff(0x101)](_0x56f6ff(0xae)['repeat'](0x1e))),console[_0x56f6ff(0xdd)](_0x56f6ff(0xde)+(_0x3da7f4[_0x56f6ff(0xf2)]||a25_0x4fd191[_0x56f6ff(0xf9)](_0x56f6ff(0xed)))),console[_0x56f6ff(0xdd)](_0x56f6ff(0xf7)+_0x3da7f4[_0x56f6ff(0x107)]);const _0x340d09=isLegacyCompatConfigKey(_0x56f6ff(0xf0))?a25_0x4fd191[_0x56f6ff(0x101)](_0x3da7f4[_0x56f6ff(0xf0)]+_0x56f6ff(0x100)):_0x3da7f4[_0x56f6ff(0xf0)];console[_0x56f6ff(0xdd)]('\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x340d09),console['log'](_0x56f6ff(0x108)+(_0x3da7f4[_0x56f6ff(0xdb)]||a25_0x4fd191['gray'](_0x56f6ff(0xbf)))),console[_0x56f6ff(0xdd)]('\x20\x20currentApp:\x20\x20\x20\x20\x20\x20'+(_0x3da7f4[_0x56f6ff(0x106)]||a25_0x4fd191[_0x56f6ff(0x101)](_0x56f6ff(0xbf)))),console['log'](_0x56f6ff(0xf5)+(_0x3da7f4['format']||a25_0x4fd191['gray'](_0x56f6ff(0xd2)+DEFAULT_CONFIG_VALUES[_0x56f6ff(0xbb)]+')'))),console[_0x56f6ff(0xdd)]('\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x3da7f4['pageSize']??a25_0x4fd191['gray'](_0x56f6ff(0xb3)))),console[_0x56f6ff(0xdd)](_0x56f6ff(0xc6)+_0x3da7f4[_0x56f6ff(0xf8)]),console[_0x56f6ff(0xdd)](_0x56f6ff(0xee)+_0x3da7f4[_0x56f6ff(0xb1)]),console[_0x56f6ff(0xdd)](_0x56f6ff(0xef)+AUTH_MODE[_0x56f6ff(0xd0)]),console[_0x56f6ff(0xdd)]('\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20'+(_0x3da7f4[_0x56f6ff(0xd9)]?a25_0x4fd191['green'](_0x56f6ff(0xb8)+_0x3da7f4['accessKey'][_0x56f6ff(0xf1)]+')'):a25_0x4fd191['gray'](_0x56f6ff(0xbf)))),console[_0x56f6ff(0xdd)](),console[_0x56f6ff(0xdd)](a25_0x4fd191[_0x56f6ff(0xe6)](_0x56f6ff(0xfd))),console[_0x56f6ff(0xdd)](a25_0x4fd191['gray'](_0x56f6ff(0xae)[_0x56f6ff(0xd5)](0x1e))),console[_0x56f6ff(0xdd)](_0x56f6ff(0xe3)+getApiDomain()),console['log'](_0x56f6ff(0xbc)+getUserDomain()),console['log']('\x20\x20runtimeDomain:\x20\x20\x20'+getRuntimeDomain()),console['log'](),console['log'](a25_0x4fd191[_0x56f6ff(0xe6)]('\x20\x20Service\x20Tree')),console[_0x56f6ff(0xdd)](a25_0x4fd191[_0x56f6ff(0x101)](_0x56f6ff(0xae)[_0x56f6ff(0xd5)](0x1e)));const _0x141c17=inspectServiceRegistry();console['log'](_0x56f6ff(0xfc)+_0x141c17[_0x56f6ff(0xba)]),console[_0x56f6ff(0xdd)](_0x56f6ff(0xf3)+formatServiceRegistryStatus(_0x141c17)),console[_0x56f6ff(0xdd)](_0x56f6ff(0xfa)+_0x141c17['serviceCount']),console[_0x56f6ff(0xdd)](_0x56f6ff(0xcf)+_0x141c17['commandCount']);for(const _0x5eb2ff of _0x141c17['services']){console['log']('\x20\x20'+(_0x5eb2ff[_0x56f6ff(0x103)]+':')[_0x56f6ff(0xe1)](0x11)+'\x20'+(_0x5eb2ff['name']||a25_0x4fd191['gray'](_0x56f6ff(0xea)))+'\x20('+_0x5eb2ff['commandCount']+_0x56f6ff(0xf4)),console[_0x56f6ff(0xdd)]('\x20\x20'+''[_0x56f6ff(0xe1)](0x11)+'\x20Imported\x20from:\x20'+_0x5eb2ff[_0x56f6ff(0xd7)][_0x56f6ff(0xe8)]);}return console[_0x56f6ff(0xdd)](),console[_0x56f6ff(0xdd)](a25_0x4fd191[_0x56f6ff(0xe6)](_0x56f6ff(0xd6))),console[_0x56f6ff(0xdd)](a25_0x4fd191[_0x56f6ff(0x101)](_0x56f6ff(0xae)[_0x56f6ff(0xd5)](0x1e))),console[_0x56f6ff(0xdd)]('\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+a25_0x4fd191[_0x56f6ff(0x102)](AUTH_MODE['ClientAk']+_0x56f6ff(0xe7))),console[_0x56f6ff(0xdd)](_0x56f6ff(0xb7)+a25_0x4fd191[_0x56f6ff(0x101)](_0x56f6ff(0xb9))),console[_0x56f6ff(0xdd)](),{'ok':!![]};}function formatServiceRegistryStatus(_0x41336a){const _0x59f555=a25_0x1529;if(_0x41336a['status']==='ok')return a25_0x4fd191[_0x59f555(0x102)](_0x59f555(0xc4));if(_0x41336a[_0x59f555(0xc9)]===_0x59f555(0xb4))return a25_0x4fd191[_0x59f555(0x101)](_0x59f555(0x104));if(_0x41336a[_0x59f555(0xc9)]===_0x59f555(0xb0))return a25_0x4fd191[_0x59f555(0xfe)](_0x59f555(0xc1));return a25_0x4fd191[_0x59f555(0xf9)](_0x59f555(0xcb)+(_0x41336a[_0x59f555(0xaf)]?':\x20'+_0x41336a[_0x59f555(0xaf)]:''));}export const doctorDefinition={'service':a25_0x103f77(0x109),'command':a25_0x103f77(0xd3),'description':a25_0x103f77(0xb2),'risk':a25_0x103f77(0xb5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a26_0x45a1(_0x352c16,_0x9e2660){_0x352c16=_0x352c16-0x143;const _0x43f4e4=a26_0x43f4();let _0x45a142=_0x43f4e4[_0x352c16];return _0x45a142;}const a26_0x4c761=a26_0x45a1;(function(_0x811ac4,_0xc88c39){const _0x2785bc=a26_0x45a1,_0x50abff=_0x811ac4();while(!![]){try{const _0x1cf47e=-parseInt(_0x2785bc(0x173))/0x1*(-parseInt(_0x2785bc(0x15d))/0x2)+parseInt(_0x2785bc(0x143))/0x3*(parseInt(_0x2785bc(0x15f))/0x4)+-parseInt(_0x2785bc(0x178))/0x5+parseInt(_0x2785bc(0x16c))/0x6+-parseInt(_0x2785bc(0x146))/0x7+-parseInt(_0x2785bc(0x151))/0x8+-parseInt(_0x2785bc(0x14a))/0x9*(parseInt(_0x2785bc(0x176))/0xa);if(_0x1cf47e===_0xc88c39)break;else _0x50abff['push'](_0x50abff['shift']());}catch(_0xaa4f6){_0x50abff['push'](_0x50abff['shift']());}}}(a26_0x43f4,0x99712));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a26_0x4c761(0x168),'type':a26_0x4c761(0x179),'description':'App\x20code\x20for\x20the\x20project'},{'name':a26_0x4c761(0x163),'type':a26_0x4c761(0x179),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES[a26_0x4c761(0x163)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x4c761(0x16a),'type':a26_0x4c761(0x153),'description':a26_0x4c761(0x174)+PRODUCT_CONFIG[a26_0x4c761(0x157)]+')\x20instead\x20of\x20project','default':![]},{'name':a26_0x4c761(0x159),'type':a26_0x4c761(0x153),'description':a26_0x4c761(0x183),'default':![]}];export const initImportFlagDefs=[{'name':a26_0x4c761(0x15c),'type':a26_0x4c761(0x179),'description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':a26_0x4c761(0x168),'type':a26_0x4c761(0x179),'description':a26_0x4c761(0x150)},{'name':'env','type':a26_0x4c761(0x179),'description':a26_0x4c761(0x148),'enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x4c761(0x16a),'type':'boolean','description':a26_0x4c761(0x174)+PRODUCT_CONFIG[a26_0x4c761(0x157)]+')\x20instead\x20of\x20project','default':![]},{'name':a26_0x4c761(0x159),'type':a26_0x4c761(0x153),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x57b64c){const _0x22f97b=a26_0x4c761,_0x1c8f7d=isNonInteractiveMode(_0x57b64c),_0x37b136=_0x57b64c[_0x22f97b(0x16a)]?_0x22f97b(0x16a):_0x22f97b(0x165),_0x334e09=resolveWriteConfigPath(_0x37b136);try{_0x1c8f7d?await runNonInteractive(_0x57b64c,_0x334e09):await runInteractive(_0x57b64c,_0x334e09);}catch(_0x39c7ce){if(_0x39c7ce instanceof AbortPrompt)throw CliErrors[_0x22f97b(0x172)]();throw _0x39c7ce;}}export async function runInitImport(_0x6032d5){const _0x5856f9=a26_0x4c761,_0x27f9ef=_0x6032d5[_0x5856f9(0x16a)]?_0x5856f9(0x16a):_0x5856f9(0x165),_0xc5bbc7=resolveWriteConfigPath(_0x27f9ef);await runFromImport(_0x6032d5,_0xc5bbc7);}const RUNTIME_IRRELEVANT_KEYS=new Set([a26_0x4c761(0x161)]);async function runFromImport(_0x5aff64,_0x89d6ff){const _0x32042b=a26_0x4c761,_0x280866=resolveFilePath(_0x5aff64[_0x32042b(0x15c)]);if(!existsSync(_0x280866))throw CliErrors['validation'](_0x32042b(0x181)+_0x280866);const _0x10230c=readSourceFile(_0x280866),_0x33151a=convertToRuntimeConfig(_0x10230c);_0x5aff64[_0x32042b(0x168)]&&(_0x33151a[_0x32042b(0x168)]=String(_0x5aff64[_0x32042b(0x168)]));_0x5aff64[_0x32042b(0x163)]&&(_0x33151a['env']=resolveInitEnv(_0x5aff64));if(!_0x33151a[_0x32042b(0x168)])throw CliErrors[_0x32042b(0x17c)]('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.',_0x32042b(0x14b));await writeInitConfig(_0x89d6ff,_0x33151a,_0x5aff64),console['log'](_0x32042b(0x175)+_0x280866),console[_0x32042b(0x17d)](_0x32042b(0x145)+_0x89d6ff),console['log']('\x20\x20appcode:\x20'+_0x33151a['appcode']);if(_0x33151a['defaultApp'])console['log']('\x20\x20default:\x20'+_0x33151a[_0x32042b(0x160)]);}function a26_0x43f4(){const _0x26b335=['53739IoeAnO','riskLevel','Override\x20imported\x20default\x20env','[y/N]','152829SyyowZ','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','join','name','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','app','Override\x20imported\x20default\x20appcode','2173736BIpMLW','AbortPrompt','boolean','removeListener','Usage:\x20','entries','newConfigFileName','stdout','yes','\x20\x20appcode:\x20','message','file','4KNoRqy','apps','844jMTKDK','defaultApp','apiDir','close','env','once','project','\x22.\x20Allowed:\x20','Aborted.','appcode','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','global','object','1002114EFfAxL','flagMissing','includes','race','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','User\x20aborted\x20prompt','cancelled','106298JGQIkD','Write\x20to\x20global\x20(~/','Imported\x20from\x20','140bYeoFf','SIGINT','2393390yrJHMA','string','toLowerCase','\x0aInitialized\x20','validation','log','trim','stdin','\x20init\x20—\x20Create\x20','Source\x20file\x20not\x20found:\x20','\x20already\x20exists.\x20Overwrite?','Skip\x20confirmation\x20when\x20overwriting','question','17697jMuWfm','Failed\x20to\x20parse\x20source\x20file:\x20','\x20\x20config:\x20\x20'];a26_0x43f4=function(){return _0x26b335;};return a26_0x43f4();}function convertToRuntimeConfig(_0x280eb9){const _0x57e726=a26_0x4c761;if(_0x280eb9[_0x57e726(0x15e)]&&typeof _0x280eb9[_0x57e726(0x15e)]===_0x57e726(0x16b))throw CliErrors[_0x57e726(0x17c)](_0x57e726(0x169),_0x57e726(0x14e));const _0x4c125c={};for(const _0xe2542a of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x280eb9[_0xe2542a]!==undefined&&(_0x4c125c[_0xe2542a]=_0x280eb9[_0xe2542a]);}return!_0x4c125c['riskLevel']&&(_0x4c125c[_0x57e726(0x147)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x4c125c;}async function runNonInteractive(_0x3976fe,_0x2adee7){const _0x4a3107=a26_0x4c761,_0x167c58=_0x3976fe['appcode'];if(!_0x167c58)throw CliErrors[_0x4a3107(0x16d)](_0x4a3107(0x168),_0x4a3107(0x155)+CLI_BIN_NAME+_0x4a3107(0x170));const _0x5a194c=resolveInitEnv(_0x3976fe);await writeInitConfig(_0x2adee7,{'appcode':_0x167c58,'env':_0x5a194c},_0x3976fe),console[_0x4a3107(0x17d)]('Initialized\x20'+_0x2adee7),console[_0x4a3107(0x17d)](_0x4a3107(0x15a)+_0x167c58),console['log']('\x20\x20env:\x20\x20\x20\x20\x20'+_0x5a194c);}async function runInteractive(_0x2c6ed0,_0x5a909f){const _0x106c16=a26_0x4c761,_0x46bf8b=loadExisting(_0x5a909f),_0x18cfa3=typeof _0x46bf8b?.['appcode']===_0x106c16(0x179)?_0x46bf8b[_0x106c16(0x168)]:'',_0xd81515=resolveInitEnv(_0x2c6ed0);console[_0x106c16(0x17d)](CLI_BIN_NAME+_0x106c16(0x180)+PRODUCT_CONFIG[_0x106c16(0x157)]+'\x0a');if(existsSync(_0x5a909f)&&!_0x2c6ed0[_0x106c16(0x159)]){const _0x497959=await promptYesNo('File\x20'+_0x5a909f+_0x106c16(0x182),![]);if(!_0x497959){console[_0x106c16(0x17d)](_0x106c16(0x167));return;}}const _0x384cb3=typeof _0x2c6ed0['appcode']===_0x106c16(0x179)?_0x2c6ed0['appcode'][_0x106c16(0x17e)]():'';let _0x50747f=_0x384cb3;!_0x50747f&&(_0x50747f=await promptInput('App\x20code',_0x18cfa3));if(!_0x50747f[_0x106c16(0x17e)]())throw CliErrors[_0x106c16(0x17c)]('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x5a909f,{'appcode':_0x50747f['trim'](),'env':_0xd81515},_0x2c6ed0),console[_0x106c16(0x17d)](_0x106c16(0x17b)+_0x5a909f),console[_0x106c16(0x17d)](_0x106c16(0x15a)+_0x50747f['trim']()),console[_0x106c16(0x17d)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0xd81515);}async function writeInitConfig(_0x28da51,_0x5c288d,_0x231d15){const _0x571d1f=a26_0x4c761;let _0x4ef3fe={};existsSync(_0x28da51)&&!_0x231d15['yes']&&(_0x4ef3fe=readConfigFile(_0x28da51));for(const [_0x7225dd,_0xdde14d]of Object[_0x571d1f(0x156)](_0x5c288d)){_0xdde14d!==undefined&&(_0x4ef3fe[_0x7225dd]=_0xdde14d);}if(_0x4ef3fe[_0x571d1f(0x14f)])delete _0x4ef3fe['app'];writeConfigFile(_0x28da51,_0x4ef3fe);}class AbortPrompt extends Error{constructor(){const _0x1e9133=a26_0x4c761;super(_0x1e9133(0x171)),this[_0x1e9133(0x14d)]=_0x1e9133(0x152);}}function createSafeRl(){const _0x5d32e1=a26_0x4c761,_0x3cfbbd=createInterface({'input':process[_0x5d32e1(0x17f)],'output':process[_0x5d32e1(0x158)]});let _0x25125a;const _0x1546dd=new Promise((_0x304c77,_0x4159b0)=>{const _0x98b837=_0x5d32e1;_0x25125a=()=>{const _0xb9a625=a26_0x45a1;_0x25125a&&(_0x3cfbbd[_0xb9a625(0x154)](_0xb9a625(0x177),_0x25125a),_0x25125a=undefined);try{_0x3cfbbd[_0xb9a625(0x162)]();}catch{}_0x4159b0(new AbortPrompt());},_0x3cfbbd[_0x98b837(0x164)](_0x98b837(0x177),_0x25125a);}),_0x1f548f=()=>{const _0x5bce33=_0x5d32e1;_0x25125a&&(_0x3cfbbd['removeListener']('SIGINT',_0x25125a),_0x25125a=undefined);try{_0x3cfbbd[_0x5bce33(0x162)]();}catch{}};return{'rl':_0x3cfbbd,'abortPromise':_0x1546dd,'disposeSuccess':_0x1f548f};}async function promptInput(_0x3ab17a,_0x21c60b){const _0x44c903=a26_0x4c761,{rl:_0x389004,abortPromise:_0x3700a3,disposeSuccess:_0x23589e}=createSafeRl(),_0x58ff87=new Promise(_0x40e3f3=>{const _0x581fc4=a26_0x45a1,_0x2d73d6=_0x21c60b?'\x20\x20'+_0x3ab17a+'\x20('+_0x21c60b+'):\x20':'\x20\x20'+_0x3ab17a+':\x20';_0x389004[_0x581fc4(0x184)](_0x2d73d6,_0x3ded63=>{const _0x9434bd=_0x581fc4;_0x23589e(),_0x40e3f3(_0x3ded63[_0x9434bd(0x17e)]()||_0x21c60b);});});return Promise[_0x44c903(0x16f)]([_0x58ff87,_0x3700a3]);}async function promptYesNo(_0x26dc6b,_0x568696){const _0x172085=a26_0x4c761,{rl:_0x19e724,abortPromise:_0x32cd26,disposeSuccess:_0x3d0201}=createSafeRl(),_0x27343a=new Promise(_0x43a965=>{const _0x4df0be=a26_0x45a1,_0x4cefa4=_0x568696?'[Y/n]':_0x4df0be(0x149);_0x19e724[_0x4df0be(0x184)]('\x20\x20'+_0x26dc6b+'\x20'+_0x4cefa4+':\x20',_0xa7ae38=>{const _0x2bdc87=_0x4df0be;_0x3d0201();const _0x1519a9=_0xa7ae38['trim']()[_0x2bdc87(0x17a)]();if(_0x1519a9==='y'||_0x1519a9===_0x2bdc87(0x159))_0x43a965(!![]);else{if(_0x1519a9==='n'||_0x1519a9==='no')_0x43a965(![]);else _0x43a965(_0x568696);}});});return Promise[_0x172085(0x16f)]([_0x27343a,_0x32cd26]);}function loadExisting(_0x4240dd){if(!existsSync(_0x4240dd))return null;return readConfigFile(_0x4240dd);}function resolveFilePath(_0x181b06){return isAbsolute(_0x181b06)?_0x181b06:resolve(process['cwd'](),_0x181b06);}function readSourceFile(_0x3737bc){const _0x12e7e2=a26_0x4c761;try{const _0x4d4bf6=readFileSync(_0x3737bc,{'encoding':'utf8'});return JSON['parse'](_0x4d4bf6);}catch(_0xed7d06){throw CliErrors[_0x12e7e2(0x17c)](_0x12e7e2(0x144)+_0xed7d06[_0x12e7e2(0x15b)]);}}function resolveInitEnv(_0x11e438){const _0x1ef6e8=a26_0x4c761,_0xf8808f=_0x11e438[_0x1ef6e8(0x163)];if(_0xf8808f===undefined||_0xf8808f==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x1ef6e8(0x16e)](_0xf8808f))throw CliErrors[_0x1ef6e8(0x17c)]('Invalid\x20env\x20\x22'+_0xf8808f+_0x1ef6e8(0x166)+RUNTIME_ENV_VALUES[_0x1ef6e8(0x14c)](',\x20'));return _0xf8808f;}
|
|
1
|
+
const a26_0x1c0917=a26_0x3d13;(function(_0x306b63,_0x22315a){const _0x3d94a7=a26_0x3d13,_0x3804a6=_0x306b63();while(!![]){try{const _0x313f60=parseInt(_0x3d94a7(0x124))/0x1*(parseInt(_0x3d94a7(0x135))/0x2)+-parseInt(_0x3d94a7(0x137))/0x3*(parseInt(_0x3d94a7(0x12a))/0x4)+-parseInt(_0x3d94a7(0x123))/0x5+parseInt(_0x3d94a7(0x11b))/0x6*(-parseInt(_0x3d94a7(0x130))/0x7)+-parseInt(_0x3d94a7(0x136))/0x8+-parseInt(_0x3d94a7(0x154))/0x9+parseInt(_0x3d94a7(0x143))/0xa;if(_0x313f60===_0x22315a)break;else _0x3804a6['push'](_0x3804a6['shift']());}catch(_0x3ba0b3){_0x3804a6['push'](_0x3804a6['shift']());}}}(a26_0x33f6,0x3841a));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a26_0x1c0917(0x12d),'type':a26_0x1c0917(0x149),'description':a26_0x1c0917(0x126)},{'name':a26_0x1c0917(0x153),'type':a26_0x1c0917(0x149),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES['env']+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x1c0917(0x150),'type':a26_0x1c0917(0x139),'description':a26_0x1c0917(0x129)+PRODUCT_CONFIG[a26_0x1c0917(0x13c)]+a26_0x1c0917(0x15a),'default':![]},{'name':'yes','type':a26_0x1c0917(0x139),'description':a26_0x1c0917(0x11e),'default':![]}];export const initImportFlagDefs=[{'name':'file','type':a26_0x1c0917(0x149),'description':a26_0x1c0917(0x11a),'required':!![]},{'name':a26_0x1c0917(0x12d),'type':a26_0x1c0917(0x149),'description':a26_0x1c0917(0x156)},{'name':a26_0x1c0917(0x153),'type':'string','description':a26_0x1c0917(0x14d),'enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x1c0917(0x150),'type':'boolean','description':a26_0x1c0917(0x129)+PRODUCT_CONFIG['newConfigFileName']+a26_0x1c0917(0x15a),'default':![]},{'name':a26_0x1c0917(0x140),'type':a26_0x1c0917(0x139),'description':a26_0x1c0917(0x11e),'default':![]}];export async function runInit(_0x2728de){const _0x27c433=a26_0x1c0917,_0x231d63=isNonInteractiveMode(_0x2728de),_0x481822=_0x2728de[_0x27c433(0x150)]?_0x27c433(0x150):_0x27c433(0x141),_0x2a0b6c=resolveWriteConfigPath(_0x481822);try{_0x231d63?await runNonInteractive(_0x2728de,_0x2a0b6c):await runInteractive(_0x2728de,_0x2a0b6c);}catch(_0x208dc0){if(_0x208dc0 instanceof AbortPrompt)throw CliErrors[_0x27c433(0x157)]();throw _0x208dc0;}}export async function runInitImport(_0x584bf8){const _0x41ae95=a26_0x1c0917,_0xf5470d=_0x584bf8[_0x41ae95(0x150)]?_0x41ae95(0x150):_0x41ae95(0x141),_0x242ebb=resolveWriteConfigPath(_0xf5470d);await runFromImport(_0x584bf8,_0x242ebb);}const RUNTIME_IRRELEVANT_KEYS=new Set([a26_0x1c0917(0x144)]);async function runFromImport(_0x2e97a4,_0x426462){const _0x9bf56c=a26_0x1c0917,_0x35927d=resolveFilePath(_0x2e97a4[_0x9bf56c(0x125)]);if(!existsSync(_0x35927d))throw CliErrors[_0x9bf56c(0x122)](_0x9bf56c(0x131)+_0x35927d);const _0x3dcc7a=readSourceFile(_0x35927d),_0x3c1389=convertToRuntimeConfig(_0x3dcc7a);_0x2e97a4[_0x9bf56c(0x12d)]&&(_0x3c1389[_0x9bf56c(0x12d)]=String(_0x2e97a4['appcode']));_0x2e97a4['env']&&(_0x3c1389[_0x9bf56c(0x153)]=resolveInitEnv(_0x2e97a4));if(!_0x3c1389[_0x9bf56c(0x12d)])throw CliErrors[_0x9bf56c(0x122)](_0x9bf56c(0x117),_0x9bf56c(0x12b));await writeInitConfig(_0x426462,_0x3c1389,_0x2e97a4),console['log'](_0x9bf56c(0x13d)+_0x35927d),console['log'](_0x9bf56c(0x147)+_0x426462),console['log'](_0x9bf56c(0x14c)+_0x3c1389[_0x9bf56c(0x12d)]);if(_0x3c1389[_0x9bf56c(0x13e)])console[_0x9bf56c(0x152)]('\x20\x20default:\x20'+_0x3c1389['defaultApp']);}function convertToRuntimeConfig(_0x2c716c){const _0x51ddc7=a26_0x1c0917;if(_0x2c716c[_0x51ddc7(0x119)]&&typeof _0x2c716c['apps']===_0x51ddc7(0x127))throw CliErrors[_0x51ddc7(0x122)](_0x51ddc7(0x142),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0xf8931d={};for(const _0x37e5c3 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x2c716c[_0x37e5c3]!==undefined&&(_0xf8931d[_0x37e5c3]=_0x2c716c[_0x37e5c3]);}return!_0xf8931d[_0x51ddc7(0x15b)]&&(_0xf8931d['riskLevel']=DEFAULT_CONFIG_VALUES[_0x51ddc7(0x15b)]),_0xf8931d;}async function runNonInteractive(_0x1c77cc,_0x44336d){const _0x3df7dc=a26_0x1c0917,_0x3d1fb7=_0x1c77cc['appcode'];if(!_0x3d1fb7)throw CliErrors[_0x3df7dc(0x12c)](_0x3df7dc(0x12d),_0x3df7dc(0x12f)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0xdb335f=resolveInitEnv(_0x1c77cc);await writeInitConfig(_0x44336d,{'appcode':_0x3d1fb7,'env':_0xdb335f},_0x1c77cc),console[_0x3df7dc(0x152)](_0x3df7dc(0x13a)+_0x44336d),console[_0x3df7dc(0x152)]('\x20\x20appcode:\x20'+_0x3d1fb7),console['log']('\x20\x20env:\x20\x20\x20\x20\x20'+_0xdb335f);}async function runInteractive(_0x10da86,_0x1aec65){const _0x4e4610=a26_0x1c0917,_0x1a1128=loadExisting(_0x1aec65),_0x87f0f6=typeof _0x1a1128?.[_0x4e4610(0x12d)]===_0x4e4610(0x149)?_0x1a1128[_0x4e4610(0x12d)]:'',_0x281c8f=resolveInitEnv(_0x10da86);console[_0x4e4610(0x152)](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG[_0x4e4610(0x13c)]+'\x0a');if(existsSync(_0x1aec65)&&!_0x10da86['yes']){const _0x52255d=await promptYesNo('File\x20'+_0x1aec65+_0x4e4610(0x134),![]);if(!_0x52255d){console[_0x4e4610(0x152)](_0x4e4610(0x15d));return;}}const _0x364959=typeof _0x10da86[_0x4e4610(0x12d)]===_0x4e4610(0x149)?_0x10da86[_0x4e4610(0x12d)]['trim']():'';let _0x2108d7=_0x364959;!_0x2108d7&&(_0x2108d7=await promptInput(_0x4e4610(0x14f),_0x87f0f6));if(!_0x2108d7[_0x4e4610(0x116)]())throw CliErrors[_0x4e4610(0x122)]('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x1aec65,{'appcode':_0x2108d7[_0x4e4610(0x116)](),'env':_0x281c8f},_0x10da86),console[_0x4e4610(0x152)](_0x4e4610(0x145)+_0x1aec65),console[_0x4e4610(0x152)]('\x20\x20appcode:\x20'+_0x2108d7[_0x4e4610(0x116)]()),console['log'](_0x4e4610(0x115)+_0x281c8f);}async function writeInitConfig(_0x8583a3,_0x50d90e,_0x155da7){const _0x35d858=a26_0x1c0917;let _0x133989={};existsSync(_0x8583a3)&&!_0x155da7[_0x35d858(0x140)]&&(_0x133989=readConfigFile(_0x8583a3));for(const [_0x1606bf,_0x2c09b4]of Object['entries'](_0x50d90e)){_0x2c09b4!==undefined&&(_0x133989[_0x1606bf]=_0x2c09b4);}if(_0x133989[_0x35d858(0x11c)])delete _0x133989[_0x35d858(0x11c)];writeConfigFile(_0x8583a3,_0x133989);}class AbortPrompt extends Error{constructor(){const _0x4b44c8=a26_0x1c0917;super(_0x4b44c8(0x118)),this[_0x4b44c8(0x155)]=_0x4b44c8(0x151);}}function createSafeRl(){const _0x11a6cd=a26_0x1c0917,_0x2c309a=createInterface({'input':process[_0x11a6cd(0x11f)],'output':process[_0x11a6cd(0x12e)]});let _0x206aa3;const _0x585a99=new Promise((_0x66419d,_0x92bfb9)=>{const _0x5d08be=_0x11a6cd;_0x206aa3=()=>{const _0x11f905=a26_0x3d13;_0x206aa3&&(_0x2c309a['removeListener']('SIGINT',_0x206aa3),_0x206aa3=undefined);try{_0x2c309a[_0x11f905(0x132)]();}catch{}_0x92bfb9(new AbortPrompt());},_0x2c309a[_0x5d08be(0x159)](_0x5d08be(0x121),_0x206aa3);}),_0x1b4f7e=()=>{const _0x39c6d0=_0x11a6cd;_0x206aa3&&(_0x2c309a[_0x39c6d0(0x148)]('SIGINT',_0x206aa3),_0x206aa3=undefined);try{_0x2c309a['close']();}catch{}};return{'rl':_0x2c309a,'abortPromise':_0x585a99,'disposeSuccess':_0x1b4f7e};}async function promptInput(_0x14bdf3,_0xc9233a){const _0x14323d=a26_0x1c0917,{rl:_0x8e687b,abortPromise:_0x34f684,disposeSuccess:_0x4cb141}=createSafeRl(),_0x4f22e5=new Promise(_0x38bb0e=>{const _0x31ea2b=a26_0x3d13,_0x5132be=_0xc9233a?'\x20\x20'+_0x14bdf3+'\x20('+_0xc9233a+_0x31ea2b(0x13b):'\x20\x20'+_0x14bdf3+':\x20';_0x8e687b['question'](_0x5132be,_0x3b3621=>{const _0x29ca6d=_0x31ea2b;_0x4cb141(),_0x38bb0e(_0x3b3621[_0x29ca6d(0x116)]()||_0xc9233a);});});return Promise[_0x14323d(0x14b)]([_0x4f22e5,_0x34f684]);}function a26_0x3d13(_0x5e98c5,_0x528095){_0x5e98c5=_0x5e98c5-0x115;const _0x33f634=a26_0x33f6();let _0x3d1309=_0x33f634[_0x5e98c5];return _0x3d1309;}async function promptYesNo(_0x40f8ae,_0x18099e){const _0x1a4519=a26_0x1c0917,{rl:_0x4eab11,abortPromise:_0x21e1de,disposeSuccess:_0x3d7505}=createSafeRl(),_0x24a888=new Promise(_0x24f6dd=>{const _0x3ef0b9=a26_0x3d13,_0x313716=_0x18099e?_0x3ef0b9(0x13f):'[y/N]';_0x4eab11[_0x3ef0b9(0x133)]('\x20\x20'+_0x40f8ae+'\x20'+_0x313716+':\x20',_0x39b184=>{const _0x51f415=_0x3ef0b9;_0x3d7505();const _0xd366c7=_0x39b184[_0x51f415(0x116)]()[_0x51f415(0x14e)]();if(_0xd366c7==='y'||_0xd366c7===_0x51f415(0x140))_0x24f6dd(!![]);else{if(_0xd366c7==='n'||_0xd366c7==='no')_0x24f6dd(![]);else _0x24f6dd(_0x18099e);}});});return Promise[_0x1a4519(0x14b)]([_0x24a888,_0x21e1de]);}function a26_0x33f6(){const _0x3353c5=['close','question','\x20already\x20exists.\x20Overwrite?','352UPRftu','513032DhwALH','18258FhcEhS','utf8','boolean','Initialized\x20','):\x20','newConfigFileName','Imported\x20from\x20','defaultApp','[Y/n]','yes','project','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','7795490ncNYeX','apiDir','\x0aInitialized\x20','message','\x20\x20config:\x20\x20','removeListener','string','Failed\x20to\x20parse\x20source\x20file:\x20','race','\x20\x20appcode:\x20','Override\x20imported\x20default\x20env','toLowerCase','App\x20code','global','AbortPrompt','log','env','1183905TIjgam','name','Override\x20imported\x20default\x20appcode','cancelled','\x22.\x20Allowed:\x20','once',')\x20instead\x20of\x20project','riskLevel','includes','Aborted.','\x20\x20env:\x20\x20\x20\x20\x20','trim','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','User\x20aborted\x20prompt','apps','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','6caOLpv','app','parse','Skip\x20confirmation\x20when\x20overwriting','stdin','Invalid\x20env\x20\x22','SIGINT','validation','245620EioUwf','661yVmuEn','file','App\x20code\x20for\x20the\x20project','object','join','Write\x20to\x20global\x20(~/','152FVqyrf','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`.','flagMissing','appcode','stdout','Usage:\x20','1325751DUhNbV','Source\x20file\x20not\x20found:\x20'];a26_0x33f6=function(){return _0x3353c5;};return a26_0x33f6();}function loadExisting(_0x4f6ae2){if(!existsSync(_0x4f6ae2))return null;return readConfigFile(_0x4f6ae2);}function resolveFilePath(_0x580cf2){return isAbsolute(_0x580cf2)?_0x580cf2:resolve(process['cwd'](),_0x580cf2);}function readSourceFile(_0x59595e){const _0x563bfb=a26_0x1c0917;try{const _0x2e9082=readFileSync(_0x59595e,{'encoding':_0x563bfb(0x138)});return JSON[_0x563bfb(0x11d)](_0x2e9082);}catch(_0x478d65){throw CliErrors['validation'](_0x563bfb(0x14a)+_0x478d65[_0x563bfb(0x146)]);}}function resolveInitEnv(_0x46961d){const _0x43cc0b=a26_0x1c0917,_0x421ed2=_0x46961d[_0x43cc0b(0x153)];if(_0x421ed2===undefined||_0x421ed2==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x43cc0b(0x15c)](_0x421ed2))throw CliErrors[_0x43cc0b(0x122)](_0x43cc0b(0x120)+_0x421ed2+_0x43cc0b(0x158)+RUNTIME_ENV_VALUES[_0x43cc0b(0x128)](',\x20'));return _0x421ed2;}
|