@lovrabet/lovrabet-cli 2.1.0 → 2.1.1-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/index.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a15_0x5836(_0x1d1f31,_0x355edf){_0x1d1f31=_0x1d1f31-0x16e;const _0x128490=a15_0x1284();let _0x5836be=_0x128490[_0x1d1f31];return _0x5836be;}(function(_0x2b1d85,_0x92926e){const _0x887c04=a15_0x5836,_0x5d36bd=_0x2b1d85();while(!![]){try{const _0x59db2b=parseInt(_0x887c04(0x181))/0x1+-parseInt(_0x887c04(0x17d))/0x2+-parseInt(_0x887c04(0x177))/0x3+parseInt(_0x887c04(0x171))/0x4*(-parseInt(_0x887c04(0x16f))/0x5)+-parseInt(_0x887c04(0x179))/0x6*(parseInt(_0x887c04(0x180))/0x7)+parseInt(_0x887c04(0x17e))/0x8+-parseInt(_0x887c04(0x175))/0x9;if(_0x59db2b===_0x92926e)break;else _0x5d36bd['push'](_0x5d36bd['shift']());}catch(_0x40fe55){_0x5d36bd['push'](_0x5d36bd['shift']());}}}(a15_0x1284,0x5be68));function a15_0x1284(){const _0x1372ab=['Use\x20only\x20one\x20config\x20scope\x20flag.','863604wQLFCs','\x20init`\x20first.','1025505ywjjlC',',\x20or\x20run\x20`','12SEHbwJ','global-default','inProject','project-default','316302nSeiur','5720344jzbtRa','\x20(global)','135009iAplJC','658157fMbHzY','Flags\x20--global\x20and\x20--project\x20are\x20mutually\x20exclusive.','validation','project','25SHSsuU','newConfigFileName','289808aigTYA','\x20found).','global'];a15_0x1284=function(){return _0x1372ab;};return a15_0x1284();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG}from'../../constant/product.js';export{DEFAULT_APP_PROFILE_NAME,DEFAULT_CONFIG_VALUES}from'../../constant/defaults.js';export{RUNTIME_ENV_VALUES}from'../../constant/env.js';export{OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{isInProject}from'../../context.js';import{CliErrors}from'../../errors.js';export{buildAppProfileListFields,CONFIG_ENUM_VALUES,IMPORTABLE_RUNTIME_CONFIG_KEYS,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getConfigDefaultValue,getConfigEnumValues,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isLegacyCompatConfigKey,isTopLevelConfigKey}from'../../config/schema.js';export function resolveConfigScope(_0x40db94){const _0x4f49a4=a15_0x5836,{explicitGlobal:explicitGlobal=![],explicitProject:explicitProject=![],policy:_0x47e1a1}=_0x40db94;if(explicitGlobal&&explicitProject)throw CliErrors[_0x4f49a4(0x183)](_0x4f49a4(0x182),_0x4f49a4(0x174));if(explicitGlobal)return _0x4f49a4(0x173);if(explicitProject)return _0x4f49a4(0x16e);switch(_0x47e1a1){case _0x4f49a4(0x17a):return'global';case _0x4f49a4(0x17c):return _0x40db94[_0x4f49a4(0x17b)]??isInProject()?_0x4f49a4(0x16e):_0x4f49a4(0x173);case'project-or-global-explicit':if(!(_0x40db94[_0x4f49a4(0x17b)]??isInProject()))throw CliErrors[_0x4f49a4(0x183)]('Not\x20inside\x20a\x20project\x20(no\x20'+PRODUCT_CONFIG[_0x4f49a4(0x170)]+_0x4f49a4(0x172),'Add\x20--global\x20to\x20write\x20to\x20~/'+PRODUCT_CONFIG['newConfigFileName']+_0x4f49a4(0x178)+CLI_BIN_NAME+_0x4f49a4(0x176));return'project';}}export function toScopeFlags(_0x4a0668){return{'global':_0x4a0668==='global'};}export function formatScopeLabel(_0x566405){const _0x3699a5=a15_0x5836;return _0x566405===_0x3699a5(0x173)?_0x3699a5(0x17f):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x438c57,_0x15b246){const _0x3b0888=a16_0x2b25,_0x349aac=_0x438c57();while(!![]){try{const _0x2c2435=-parseInt(_0x3b0888(0x13a))/0x1+parseInt(_0x3b0888(0x131))/0x2*(parseInt(_0x3b0888(0x129))/0x3)+parseInt(_0x3b0888(0x145))/0x4*(parseInt(_0x3b0888(0x143))/0x5)+parseInt(_0x3b0888(0x133))/0x6*(parseInt(_0x3b0888(0x132))/0x7)+-parseInt(_0x3b0888(0x144))/0x8+parseInt(_0x3b0888(0x130))/0x9+-parseInt(_0x3b0888(0x135))/0xa*(-parseInt(_0x3b0888(0x13f))/0xb);if(_0x2c2435===_0x15b246)break;else _0x349aac['push'](_0x349aac['shift']());}catch(_0x236e10){_0x349aac['push'](_0x349aac['shift']());}}}(a16_0x149e,0x8b5c3));import{CliErrors}from'../../errors.js';function isSet(_0x17d916,_0x36098a){const _0x489aa7=_0x17d916['flag'](_0x36098a);return _0x489aa7!==undefined&&_0x489aa7!==''&&_0x489aa7!==![]&&_0x489aa7!==0x0;}function fmtNames(_0x4ccd31){const _0x52aa59=a16_0x2b25;return _0x4ccd31[_0x52aa59(0x128)](_0x59ae73=>'--'+_0x59ae73)[_0x52aa59(0x12e)](',\x20');}export function requireOneOf(_0x223751,_0x3bce97,_0x19565b){const _0x2d3c31=a16_0x2b25,_0x2537b0=_0x3bce97[_0x2d3c31(0x12c)](_0x4449f5=>isSet(_0x223751,_0x4449f5));if(_0x2537b0[_0x2d3c31(0x13b)]!==0x1)throw CliErrors['validation'](_0x2537b0[_0x2d3c31(0x13b)]===0x0?_0x2d3c31(0x138)+fmtNames(_0x3bce97)+'\x20is\x20required\x20for\x20`'+_0x19565b+'`.':_0x2d3c31(0x13e)+fmtNames(_0x3bce97)+_0x2d3c31(0x13c)+fmtNames(_0x2537b0)+'.',_0x2537b0[_0x2d3c31(0x13b)]===0x0?'Provide\x20one\x20of:\x20'+fmtNames(_0x3bce97):_0x2d3c31(0x12d));}function a16_0x149e(){const _0x5ad2dc=[':\x20expected\x20','map','747dYeysJ','Flags\x20','str','filter','Remove\x20all\x20but\x20one.','join','Use\x20only\x20one\x20of:\x20','6310998MbmikN','1954PHSFWw','1719431XbpIDw','6IDydQd',',\x20got\x20\x22','590JitobG','Provide\x20one\x20of:\x20','Invalid\x20--','Exactly\x20one\x20of\x20','validation','1049892taVmLK','length','\x20is\x20allowed,\x20found:\x20','some','Only\x20one\x20of\x20','42482JWFelk','test','\x20are\x20mutually\x20exclusive\x20for\x20`','At\x20least\x20one\x20of\x20','4123660kOjcLO','4976056LJvEhm','4jAFlEE'];a16_0x149e=function(){return _0x5ad2dc;};return a16_0x149e();}export function requireAnyOf(_0x2d3476,_0x295cbd,_0x17fd3c){const _0x52afb7=a16_0x2b25;if(!_0x295cbd[_0x52afb7(0x13d)](_0x31f378=>isSet(_0x2d3476,_0x31f378)))throw CliErrors[_0x52afb7(0x139)](_0x52afb7(0x142)+fmtNames(_0x295cbd)+'\x20is\x20required\x20for\x20`'+_0x17fd3c+'`.',_0x52afb7(0x136)+fmtNames(_0x295cbd));}export function mutuallyExclusive(_0x4a6332,_0x19f1d2,_0x24855f){const _0x4a5907=a16_0x2b25,_0x47d5d5=_0x19f1d2[_0x4a5907(0x12c)](_0x510a72=>isSet(_0x4a6332,_0x510a72));if(_0x47d5d5[_0x4a5907(0x13b)]>0x1)throw CliErrors[_0x4a5907(0x139)](_0x4a5907(0x12a)+fmtNames(_0x47d5d5)+_0x4a5907(0x141)+_0x24855f+'`.',_0x4a5907(0x12f)+fmtNames(_0x19f1d2));}function a16_0x2b25(_0xa31fbf,_0x3154b9){_0xa31fbf=_0xa31fbf-0x128;const _0x149e9f=a16_0x149e();let _0x2b25e6=_0x149e9f[_0xa31fbf];return _0x2b25e6;}export function validatePattern(_0x382aeb,_0x39ad72,_0x525193,_0x209896){const _0x3726dd=a16_0x2b25,_0x2ba916=_0x382aeb[_0x3726dd(0x12b)](_0x39ad72);if(_0x2ba916&&!_0x525193[_0x3726dd(0x140)](_0x2ba916))throw CliErrors[_0x3726dd(0x139)](_0x3726dd(0x137)+_0x39ad72+_0x3726dd(0x146)+_0x209896+_0x3726dd(0x134)+_0x2ba916+'\x22.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a17_0x1d49(_0x1b6b9d,_0x1f07fc){_0x1b6b9d=_0x1b6b9d-0x127;const _0x186005=a17_0x1860();let _0x1d4957=_0x186005[_0x1b6b9d];return _0x1d4957;}const a17_0x22397f=a17_0x1d49;(function(_0x5cc4e7,_0x5940c0){const _0x2b65a0=a17_0x1d49,_0x3c7b80=_0x5cc4e7();while(!![]){try{const _0x1d0b01=-parseInt(_0x2b65a0(0x12b))/0x1+parseInt(_0x2b65a0(0x12e))/0x2+parseInt(_0x2b65a0(0x12a))/0x3*(-parseInt(_0x2b65a0(0x128))/0x4)+-parseInt(_0x2b65a0(0x130))/0x5+-parseInt(_0x2b65a0(0x136))/0x6+-parseInt(_0x2b65a0(0x139))/0x7+parseInt(_0x2b65a0(0x12f))/0x8;if(_0x1d0b01===_0x5940c0)break;else _0x3c7b80['push'](_0x3c7b80['shift']());}catch(_0xa6c8a8){_0x3c7b80['push'](_0x3c7b80['shift']());}}}(a17_0x1860,0x9e3dc));export const CODE_FLAG={'name':a17_0x22397f(0x13a),'type':a17_0x22397f(0x135),'required':!![],'description':a17_0x22397f(0x13c),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a17_0x22397f(0x12c)}};function a17_0x1860(){const _0xd01f9c=['a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','2061582uOvjXP','20762112LynQdX','3996950uKRiSt','sqlcode','verbose','number','Resource\x20ID','string','953508RwASVd','name','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','5619040Cusypz','code','Resource\x20name\x20for\x20lookup','Dataset\x20code\x20(32-char\x20hex\x20UUID)','boolean','Return\x20full\x20raw\x20response\x20object','424RKCrmn','params','31242ZFJXxS','112987PcvfLm'];a17_0x1860=function(){return _0xd01f9c;};return a17_0x1860();}export const SQLCODE_FLAG={'name':a17_0x22397f(0x131),'type':a17_0x22397f(0x135),'required':!![],'description':'SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a17_0x22397f(0x12d)}};export const VERBOSE_FLAG={'name':a17_0x22397f(0x132),'type':a17_0x22397f(0x13d),'description':a17_0x22397f(0x127)};export const PARAMS_FLAG={'name':a17_0x22397f(0x129),'type':'string','description':a17_0x22397f(0x138)};export const NAME_FLAG={'name':a17_0x22397f(0x137),'type':'string','description':a17_0x22397f(0x13b)};export const ID_FLAG={'name':'id','type':a17_0x22397f(0x133),'required':!![],'description':a17_0x22397f(0x134)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a18_0x1101c0=a18_0x1273;(function(_0x4db409,_0x41e953){const _0x56584b=a18_0x1273,_0x46a1c6=_0x4db409();while(!![]){try{const _0x2e92cd=parseInt(_0x56584b(0xce))/0x1*(-parseInt(_0x56584b(0xac))/0x2)+-parseInt(_0x56584b(0x9d))/0x3*(-parseInt(_0x56584b(0xa9))/0x4)+parseInt(_0x56584b(0xbf))/0x5*(parseInt(_0x56584b(0x93))/0x6)+parseInt(_0x56584b(0xb8))/0x7+-parseInt(_0x56584b(0xc1))/0x8*(parseInt(_0x56584b(0xa1))/0x9)+-parseInt(_0x56584b(0xd2))/0xa+parseInt(_0x56584b(0xc7))/0xb*(parseInt(_0x56584b(0xd6))/0xc);if(_0x2e92cd===_0x41e953)break;else _0x46a1c6['push'](_0x46a1c6['shift']());}catch(_0x37c29a){_0x46a1c6['push'](_0x46a1c6['shift']());}}}(a18_0x3d93,0xdb5ef));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':a18_0x1101c0(0xa5),'type':'boolean','description':a18_0x1101c0(0xb0),'default':![]};function parseAliasAppcodeSetKey(_0x21c4e9){const _0x1b3201=a18_0x1101c0,_0x5cd4b9=_0x21c4e9['split']('.');if(_0x5cd4b9[_0x1b3201(0x97)]!==0x3||_0x5cd4b9[0x0]!==_0x1b3201(0xb4)||_0x5cd4b9[0x2]!==_0x1b3201(0xaf))return undefined;const _0x1649f1=_0x5cd4b9[0x1]?.[_0x1b3201(0xbb)]();return _0x1649f1?_0x1649f1:undefined;}function a18_0x3d93(){const _0x3c65d3=['format','validation','Deleted\x20`','1EKjtVh','\x20config\x20set\x20<key>\x20<value>\x20[--global]',';\x20apps.<alias>.appcode','`\x20=\x20\x22','10576340iAXQKq','args','isArray','write','24zPOlSS','\x20config\x20delete\x20<key>\x20[--global]','1007982oFoIqC','bool','join','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','length','riskLevel','Usage:\x20','field','(none)','Set\x20`','41919cQyXyE','pageSize\x20must\x20be\x20a\x20positive\x20number','Delete\x20a\x20config\x20value','object','1079928LUQedL','pretty','Set\x20a\x20config\x20value','Key\x20not\x20found:\x20','global','pageSize','keys','\x20config\x20get\x20<key>','356ztrfIi','Missing\x20key\x20or\x20value.','Missing\x20key\x20argument.','2333630hbvgwx','list','config','appcode','Write\x20to\x20global\x20config','Key\x20\x22','\x20(global)','\x22.\x20Allowed:\x20','apps','Top-level\x20key\x20\x22','List\x20current\x20config','alias','8215067BVHWBD','Invalid\x20value\x20for\x20\x22','Config\x20files:\x0a','trim','log','raw','includes','10STeWmP','read','32lSLMFZ','project-or-global-explicit','../../context.js','stringify','set','get','4673834wDvZwD','split','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','key'];a18_0x3d93=function(){return _0x3c65d3;};return a18_0x3d93();}function a18_0x1273(_0x57719f,_0x38935b){_0x57719f=_0x57719f-0x93;const _0x3d93d3=a18_0x3d93();let _0x127308=_0x3d93d3[_0x57719f];return _0x127308;}function parseAliasDeleteKey(_0xc29ed4){const _0x4d5ddf=a18_0x1101c0,_0x348125=_0xc29ed4['split']('.');if(_0x348125[_0x4d5ddf(0x97)]===0x2&&_0x348125[0x0]===_0x4d5ddf(0xb4)){const _0x408683=_0x348125[0x1]?.[_0x4d5ddf(0xbb)]();return _0x408683?{'alias':_0x408683}:undefined;}if(_0x348125[_0x4d5ddf(0x97)]===0x3&&_0x348125[0x0]===_0x4d5ddf(0xb4)&&_0x348125[0x2]===_0x4d5ddf(0xaf)){const _0x45bce3=_0x348125[0x1]?.['trim']();return _0x45bce3?{'alias':_0x45bce3,'field':_0x4d5ddf(0xaf)}:undefined;}return undefined;}function setLocalAppAlias(_0x4fbc8a,_0x2f922b,_0x160967){const _0x1b47e0=a18_0x1101c0,_0x346a2a=_0x4fbc8a[_0x1b47e0(0xb4)]&&typeof _0x4fbc8a[_0x1b47e0(0xb4)]==='object'&&!Array[_0x1b47e0(0xd4)](_0x4fbc8a['apps'])?_0x4fbc8a['apps']:{},_0x176298=_0x346a2a[_0x2f922b]&&typeof _0x346a2a[_0x2f922b]===_0x1b47e0(0xa0)&&!Array['isArray'](_0x346a2a[_0x2f922b])?_0x346a2a[_0x2f922b]:{};_0x176298[_0x1b47e0(0xaf)]=_0x160967,_0x346a2a[_0x2f922b]=_0x176298,_0x4fbc8a[_0x1b47e0(0xb4)]=_0x346a2a;}function deleteLocalAppAlias(_0x4ff234,_0x2b4e74){const _0x385470=a18_0x1101c0;if(!_0x4ff234[_0x385470(0xb4)]||typeof _0x4ff234[_0x385470(0xb4)]!==_0x385470(0xa0)||Array[_0x385470(0xd4)](_0x4ff234[_0x385470(0xb4)]))return![];const _0x16cd95=_0x4ff234[_0x385470(0xb4)],_0x548468=_0x16cd95[_0x2b4e74[_0x385470(0xb7)]];if(!_0x548468||typeof _0x548468!=='object'||Array[_0x385470(0xd4)](_0x548468))return![];if(!_0x2b4e74[_0x385470(0x9a)])return delete _0x16cd95[_0x2b4e74[_0x385470(0xb7)]],!![];if(!(_0x2b4e74[_0x385470(0x9a)]in _0x548468))return![];return delete _0x548468[_0x2b4e74[_0x385470(0x9a)]],Object[_0x385470(0xa7)](_0x548468)[_0x385470(0x97)]===0x0&&delete _0x16cd95[_0x2b4e74[_0x385470(0xb7)]],!![];}const listDef={'service':a18_0x1101c0(0xae),'command':a18_0x1101c0(0xad),'description':a18_0x1101c0(0xb6),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x32c93b){const _0x40f53c=a18_0x1101c0,{buildConfigFromFlags:_0x2d4cbf}=await import(_0x40f53c(0xc3)),_0x2a88a2=_0x2d4cbf({}),_0x37d978=getProjectConfigPath(),_0x1bbc41=resolveWriteConfigPath('global');if(_0x32c93b[_0x40f53c(0xcb)]===_0x40f53c(0xa2))return{'ok':!![],'message':_0x40f53c(0xc9)+(JSON[_0x40f53c(0xc4)](_0x2a88a2[_0x40f53c(0xbd)],null,0x2)+'\x0a\x0a')+_0x40f53c(0xba)+('\x20\x20project:\x20'+(_0x37d978??_0x40f53c(0x9b))+'\x0a')+('\x20\x20global:\x20\x20'+_0x1bbc41)};return{'ok':!![],'data':{'effective':_0x2a88a2[_0x40f53c(0xbd)],'configFiles':{'project':_0x37d978??null,'global':_0x1bbc41}}};}},getDef={'service':a18_0x1101c0(0xae),'command':a18_0x1101c0(0xc6),'description':'Get\x20a\x20config\x20value','risk':a18_0x1101c0(0xc0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x1101c0(0xca),'description':'Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','required':!![]}],'flags':[],async 'execute'(_0xf578ff){const _0xe968d9=a18_0x1101c0,_0x4bc5b8=_0xf578ff['args'][0x0];if(!_0x4bc5b8)throw CliErrors['validation'](_0xe968d9(0xab),_0xe968d9(0x99)+CLI_BIN_NAME+_0xe968d9(0xa8));const {buildConfigFromFlags:_0x318aff}=await import(_0xe968d9(0xc3)),{raw:_0x526744}=_0x318aff({});if(_0x4bc5b8[_0xe968d9(0xbe)]('.')){const _0xdc31b4=_0x4bc5b8[_0xe968d9(0xc8)]('.');let _0xf9be0a=_0x526744;for(const _0x4ed37a of _0xdc31b4){if(_0xf9be0a==null||typeof _0xf9be0a!==_0xe968d9(0xa0))throw CliErrors[_0xe968d9(0xcc)](_0xe968d9(0xa4)+_0x4bc5b8);_0xf9be0a=_0xf9be0a[_0x4ed37a];}if(_0xf9be0a===undefined)throw CliErrors[_0xe968d9(0xcc)](_0xe968d9(0xa4)+_0x4bc5b8);return console['log'](typeof _0xf9be0a===_0xe968d9(0xa0)?JSON['stringify'](_0xf9be0a,null,0x2):String(_0xf9be0a)),{'ok':!![]};}const _0x5f05cf=_0x526744[_0x4bc5b8];if(_0x5f05cf===undefined)throw CliErrors['validation'](_0xe968d9(0xa4)+_0x4bc5b8);return console[_0xe968d9(0xbc)](typeof _0x5f05cf===_0xe968d9(0xa0)?JSON['stringify'](_0x5f05cf,null,0x2):String(_0x5f05cf)),{'ok':!![]};}},setDef={'service':'config','command':a18_0x1101c0(0xc5),'description':a18_0x1101c0(0xa3),'risk':a18_0x1101c0(0xd5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x1101c0(0xca),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':'value','description':'Value\x20to\x20assign','required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x1c8818){const _0x2e8561=a18_0x1101c0,_0x3be588=_0x1c8818[_0x2e8561(0xd3)][0x0],_0x24e172=_0x1c8818[_0x2e8561(0xd3)][0x1];if(!_0x3be588||_0x24e172===undefined)throw CliErrors['validation'](_0x2e8561(0xaa),_0x2e8561(0x99)+CLI_BIN_NAME+_0x2e8561(0xcf));if(ENUM_KEYS[_0x3be588]&&!ENUM_KEYS[_0x3be588][_0x2e8561(0xbe)](_0x24e172))throw CliErrors['validation'](_0x2e8561(0xb9)+_0x3be588+_0x2e8561(0xb3)+ENUM_KEYS[_0x3be588][_0x2e8561(0x95)](',\x20'));if(_0x3be588===_0x2e8561(0x98))throw CliErrors[_0x2e8561(0xcc)](_0x2e8561(0x96));if(_0x3be588===_0x2e8561(0xa6)){const _0x27b2cd=Number(_0x24e172);if(isNaN(_0x27b2cd)||_0x27b2cd<=0x0)throw CliErrors[_0x2e8561(0xcc)](_0x2e8561(0x9e));}const _0x44a457=resolveWriteScope({'explicitGlobal':_0x1c8818[_0x2e8561(0x94)]('global'),'policy':_0x2e8561(0xc2)}),_0x22f4b0=toScopeFlags(_0x44a457),_0x1f1c95=readScopedConfig(_0x22f4b0),_0x4698ea=parseAliasAppcodeSetKey(_0x3be588);if(!_0x4698ea&&!isTopLevelConfigKey(_0x3be588))throw CliErrors[_0x2e8561(0xcc)](_0x2e8561(0xb5)+_0x3be588+'\x22\x20is\x20not\x20settable.','Settable\x20keys:\x20'+getTopLevelConfigKeySummary()+_0x2e8561(0xd0));return _0x4698ea?setLocalAppAlias(_0x1f1c95,_0x4698ea,_0x24e172):_0x1f1c95[_0x3be588]=_0x3be588==='pageSize'?Number(_0x24e172):_0x24e172,console['log'](_0x2e8561(0x9c)+_0x3be588+_0x2e8561(0xd1)+_0x24e172+'\x22'+(_0x44a457===_0x2e8561(0xa5)?_0x2e8561(0xb2):'')),writeScopedConfig(_0x1f1c95,_0x22f4b0),{'ok':!![]};}},deleteDef={'service':a18_0x1101c0(0xae),'command':'delete','description':a18_0x1101c0(0x9f),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x1101c0(0xca),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x3296eb){const _0x15f7f4=a18_0x1101c0,_0x4fdde6=_0x3296eb[_0x15f7f4(0xd3)][0x0];if(!_0x4fdde6)throw CliErrors['validation'](_0x15f7f4(0xab),_0x15f7f4(0x99)+CLI_BIN_NAME+_0x15f7f4(0xd7));const _0x1a0ecd=resolveWriteScope({'explicitGlobal':_0x3296eb['bool']('global'),'policy':_0x15f7f4(0xc2)}),_0x5d196f=toScopeFlags(_0x1a0ecd),_0x5c79c4=readScopedConfig(_0x5d196f),_0x2c3a2e=parseAliasDeleteKey(_0x4fdde6);if(_0x2c3a2e){if(!deleteLocalAppAlias(_0x5c79c4,_0x2c3a2e))throw CliErrors['validation'](_0x15f7f4(0xa4)+_0x4fdde6);return console[_0x15f7f4(0xbc)](_0x15f7f4(0xcd)+_0x4fdde6+'`'+(_0x1a0ecd==='global'?'\x20(global)':'')),writeScopedConfig(_0x5c79c4,_0x5d196f),{'ok':!![]};}if(_0x5c79c4[_0x4fdde6]===undefined)throw CliErrors[_0x15f7f4(0xcc)](_0x15f7f4(0xb1)+_0x4fdde6+'\x22\x20not\x20found\x20at\x20top\x20level.');return delete _0x5c79c4[_0x4fdde6],console[_0x15f7f4(0xbc)](_0x15f7f4(0xcd)+_0x4fdde6+'`'+(_0x1a0ecd===_0x15f7f4(0xa5)?_0x15f7f4(0xb2):'')),writeScopedConfig(_0x5c79c4,_0x5d196f),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
1
|
+
const a18_0xbe9d31=a18_0x5270;(function(_0x4c8a6,_0xd4f59a){const _0x8b550=a18_0x5270,_0x420c1a=_0x4c8a6();while(!![]){try{const _0xe0555b=-parseInt(_0x8b550(0x144))/0x1*(parseInt(_0x8b550(0x143))/0x2)+parseInt(_0x8b550(0x173))/0x3+parseInt(_0x8b550(0x13b))/0x4+parseInt(_0x8b550(0x172))/0x5*(parseInt(_0x8b550(0x152))/0x6)+parseInt(_0x8b550(0x167))/0x7+-parseInt(_0x8b550(0x155))/0x8*(parseInt(_0x8b550(0x14f))/0x9)+-parseInt(_0x8b550(0x175))/0xa*(parseInt(_0x8b550(0x159))/0xb);if(_0xe0555b===_0xd4f59a)break;else _0x420c1a['push'](_0x420c1a['shift']());}catch(_0x199790){_0x420c1a['push'](_0x420c1a['shift']());}}}(a18_0x3af2,0xa56b2));import{CliErrors}from'../../errors.js';function a18_0x5270(_0x30642b,_0x54c26e){_0x30642b=_0x30642b-0x13a;const _0x3af273=a18_0x3af2();let _0x5270a7=_0x3af273[_0x30642b];return _0x5270a7;}import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';function a18_0x3af2(){const _0x5f2d25=['2398880MiWOzZ','\x22.\x20Allowed:\x20','log','value','delete','set','trim','args','547442yISfbh','2MDXecD','project-or-global-explicit','boolean','validation','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','get','apps','\x20\x20project:\x20','includes','`\x20=\x20\x22','length','27InccFa','join','field','6GzWJAM','split','Key\x20\x22','80192qVcOzD','list','key','Settable\x20keys:\x20','588412nZoqbx','raw',';\x20apps.<alias>.appcode','List\x20current\x20config','alias','Value\x20to\x20assign','Usage:\x20','../../context.js','\x20config\x20delete\x20<key>\x20[--global]','isArray','Missing\x20key\x20or\x20value.','keys','\x22\x20not\x20found\x20at\x20top\x20level.','riskLevel','942711kbVDCc','\x22\x20is\x20not\x20settable.','Key\x20not\x20found:\x20','Set\x20a\x20config\x20value','Config\x20files:\x0a','Missing\x20key\x20argument.','stringify','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','appcode','Delete\x20a\x20config\x20value','\x20(global)','6498905jmkRER','1514106jzjzSz','Deleted\x20`','240OXvCFj','write','object','(none)','global','read','format'];a18_0x3af2=function(){return _0x5f2d25;};return a18_0x3af2();}const GLOBAL_FLAG={'name':'global','type':a18_0xbe9d31(0x146),'description':'Write\x20to\x20global\x20config','default':![]};function parseAliasAppcodeSetKey(_0x1c6eeb){const _0x4175d7=a18_0xbe9d31,_0x1d909d=_0x1c6eeb['split']('.');if(_0x1d909d[_0x4175d7(0x14e)]!==0x3||_0x1d909d[0x0]!==_0x4175d7(0x14a)||_0x1d909d[0x2]!==_0x4175d7(0x16f))return undefined;const _0x3c617a=_0x1d909d[0x1]?.[_0x4175d7(0x141)]();return _0x3c617a?_0x3c617a:undefined;}function parseAliasDeleteKey(_0x24fdc7){const _0x1463cd=a18_0xbe9d31,_0x29108c=_0x24fdc7['split']('.');if(_0x29108c[_0x1463cd(0x14e)]===0x2&&_0x29108c[0x0]===_0x1463cd(0x14a)){const _0xd52d66=_0x29108c[0x1]?.[_0x1463cd(0x141)]();return _0xd52d66?{'alias':_0xd52d66}:undefined;}if(_0x29108c[_0x1463cd(0x14e)]===0x3&&_0x29108c[0x0]===_0x1463cd(0x14a)&&_0x29108c[0x2]==='appcode'){const _0x29b294=_0x29108c[0x1]?.[_0x1463cd(0x141)]();return _0x29b294?{'alias':_0x29b294,'field':'appcode'}:undefined;}return undefined;}function setLocalAppAlias(_0x4fbe7e,_0x5e9a11,_0x4706ad){const _0x2dde22=a18_0xbe9d31,_0x4ed8ca=_0x4fbe7e['apps']&&typeof _0x4fbe7e[_0x2dde22(0x14a)]===_0x2dde22(0x177)&&!Array[_0x2dde22(0x162)](_0x4fbe7e[_0x2dde22(0x14a)])?_0x4fbe7e[_0x2dde22(0x14a)]:{},_0x24685b=_0x4ed8ca[_0x5e9a11]&&typeof _0x4ed8ca[_0x5e9a11]==='object'&&!Array[_0x2dde22(0x162)](_0x4ed8ca[_0x5e9a11])?_0x4ed8ca[_0x5e9a11]:{};_0x24685b[_0x2dde22(0x16f)]=_0x4706ad,_0x4ed8ca[_0x5e9a11]=_0x24685b,_0x4fbe7e[_0x2dde22(0x14a)]=_0x4ed8ca;}function deleteLocalAppAlias(_0x5eb076,_0x5c74d1){const _0x1502e6=a18_0xbe9d31;if(!_0x5eb076[_0x1502e6(0x14a)]||typeof _0x5eb076[_0x1502e6(0x14a)]!=='object'||Array[_0x1502e6(0x162)](_0x5eb076[_0x1502e6(0x14a)]))return![];const _0x565c5c=_0x5eb076[_0x1502e6(0x14a)],_0x43f418=_0x565c5c[_0x5c74d1['alias']];if(!_0x43f418||typeof _0x43f418!=='object'||Array[_0x1502e6(0x162)](_0x43f418))return![];if(!_0x5c74d1[_0x1502e6(0x151)])return delete _0x565c5c[_0x5c74d1[_0x1502e6(0x15d)]],!![];if(!(_0x5c74d1[_0x1502e6(0x151)]in _0x43f418))return![];return delete _0x43f418[_0x5c74d1[_0x1502e6(0x151)]],Object[_0x1502e6(0x164)](_0x43f418)['length']===0x0&&delete _0x565c5c[_0x5c74d1['alias']],!![];}const listDef={'service':'config','command':a18_0xbe9d31(0x156),'description':a18_0xbe9d31(0x15c),'risk':a18_0xbe9d31(0x17a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x5ef1d3){const _0x4b8033=a18_0xbe9d31,{buildConfigFromFlags:_0x3318b5}=await import(_0x4b8033(0x160)),_0x5e70ef=_0x3318b5({}),_0x5e3a0c=getProjectConfigPath(),_0x3da313=resolveWriteConfigPath('global');if(_0x5ef1d3[_0x4b8033(0x13a)]==='pretty')return{'ok':!![],'message':_0x4b8033(0x16e)+(JSON[_0x4b8033(0x16d)](_0x5e70ef[_0x4b8033(0x15a)],null,0x2)+'\x0a\x0a')+_0x4b8033(0x16b)+(_0x4b8033(0x14b)+(_0x5e3a0c??_0x4b8033(0x178))+'\x0a')+('\x20\x20global:\x20\x20'+_0x3da313)};return{'ok':!![],'data':{'effective':_0x5e70ef['raw'],'configFiles':{'project':_0x5e3a0c??null,'global':_0x3da313}}};}},getDef={'service':'config','command':a18_0xbe9d31(0x149),'description':'Get\x20a\x20config\x20value','risk':a18_0xbe9d31(0x17a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0xbe9d31(0x157),'description':'Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','required':!![]}],'flags':[],async 'execute'(_0x3bed17){const _0x34e8ab=a18_0xbe9d31,_0xb749c9=_0x3bed17[_0x34e8ab(0x142)][0x0];if(!_0xb749c9)throw CliErrors[_0x34e8ab(0x147)]('Missing\x20key\x20argument.','Usage:\x20'+CLI_BIN_NAME+'\x20config\x20get\x20<key>');const {buildConfigFromFlags:_0x4a4dd5}=await import(_0x34e8ab(0x160)),{raw:_0x3f07a2}=_0x4a4dd5({});if(_0xb749c9['includes']('.')){const _0x1f918b=_0xb749c9[_0x34e8ab(0x153)]('.');let _0x491cb4=_0x3f07a2;for(const _0xfc9efb of _0x1f918b){if(_0x491cb4==null||typeof _0x491cb4!==_0x34e8ab(0x177))throw CliErrors[_0x34e8ab(0x147)](_0x34e8ab(0x169)+_0xb749c9);_0x491cb4=_0x491cb4[_0xfc9efb];}if(_0x491cb4===undefined)throw CliErrors['validation'](_0x34e8ab(0x169)+_0xb749c9);return console[_0x34e8ab(0x13d)](typeof _0x491cb4==='object'?JSON[_0x34e8ab(0x16d)](_0x491cb4,null,0x2):String(_0x491cb4)),{'ok':!![]};}const _0x506e3b=_0x3f07a2[_0xb749c9];if(_0x506e3b===undefined)throw CliErrors[_0x34e8ab(0x147)]('Key\x20not\x20found:\x20'+_0xb749c9);return console['log'](typeof _0x506e3b===_0x34e8ab(0x177)?JSON[_0x34e8ab(0x16d)](_0x506e3b,null,0x2):String(_0x506e3b)),{'ok':!![]};}},setDef={'service':'config','command':a18_0xbe9d31(0x140),'description':a18_0xbe9d31(0x16a),'risk':a18_0xbe9d31(0x176),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0xbe9d31(0x157),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a18_0xbe9d31(0x13e),'description':a18_0xbe9d31(0x15e),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x281178){const _0x44a94d=a18_0xbe9d31,_0x39a85d=_0x281178[_0x44a94d(0x142)][0x0],_0x3e9d83=_0x281178[_0x44a94d(0x142)][0x1];if(!_0x39a85d||_0x3e9d83===undefined)throw CliErrors[_0x44a94d(0x147)](_0x44a94d(0x163),_0x44a94d(0x15f)+CLI_BIN_NAME+'\x20config\x20set\x20<key>\x20<value>\x20[--global]');if(ENUM_KEYS[_0x39a85d]&&!ENUM_KEYS[_0x39a85d][_0x44a94d(0x14c)](_0x3e9d83))throw CliErrors[_0x44a94d(0x147)]('Invalid\x20value\x20for\x20\x22'+_0x39a85d+_0x44a94d(0x13c)+ENUM_KEYS[_0x39a85d][_0x44a94d(0x150)](',\x20'));if(_0x39a85d===_0x44a94d(0x166))throw CliErrors[_0x44a94d(0x147)](_0x44a94d(0x148));if(_0x39a85d==='pageSize'){const _0x2e9256=Number(_0x3e9d83);if(isNaN(_0x2e9256)||_0x2e9256<=0x0)throw CliErrors['validation']('pageSize\x20must\x20be\x20a\x20positive\x20number');}const _0x137661=resolveWriteScope({'explicitGlobal':_0x281178['bool'](_0x44a94d(0x179)),'policy':_0x44a94d(0x145)}),_0x37d045=toScopeFlags(_0x137661),_0x53599d=readScopedConfig(_0x37d045),_0x358373=parseAliasAppcodeSetKey(_0x39a85d);if(!_0x358373&&!isTopLevelConfigKey(_0x39a85d))throw CliErrors[_0x44a94d(0x147)]('Top-level\x20key\x20\x22'+_0x39a85d+_0x44a94d(0x168),_0x44a94d(0x158)+getTopLevelConfigKeySummary()+_0x44a94d(0x15b));return _0x358373?setLocalAppAlias(_0x53599d,_0x358373,_0x3e9d83):_0x53599d[_0x39a85d]=_0x39a85d==='pageSize'?Number(_0x3e9d83):_0x3e9d83,console[_0x44a94d(0x13d)]('Set\x20`'+_0x39a85d+_0x44a94d(0x14d)+_0x3e9d83+'\x22'+(_0x137661==='global'?_0x44a94d(0x171):'')),writeScopedConfig(_0x53599d,_0x37d045),{'ok':!![]};}},deleteDef={'service':'config','command':a18_0xbe9d31(0x13f),'description':a18_0xbe9d31(0x170),'risk':a18_0xbe9d31(0x176),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0xbe9d31(0x157),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x2cb998){const _0x43c9ad=a18_0xbe9d31,_0x205f66=_0x2cb998[_0x43c9ad(0x142)][0x0];if(!_0x205f66)throw CliErrors[_0x43c9ad(0x147)](_0x43c9ad(0x16c),'Usage:\x20'+CLI_BIN_NAME+_0x43c9ad(0x161));const _0x571d3a=resolveWriteScope({'explicitGlobal':_0x2cb998['bool']('global'),'policy':_0x43c9ad(0x145)}),_0x90d0f5=toScopeFlags(_0x571d3a),_0x57ab1c=readScopedConfig(_0x90d0f5),_0xb7ca1e=parseAliasDeleteKey(_0x205f66);if(_0xb7ca1e){if(!deleteLocalAppAlias(_0x57ab1c,_0xb7ca1e))throw CliErrors[_0x43c9ad(0x147)](_0x43c9ad(0x169)+_0x205f66);return console[_0x43c9ad(0x13d)](_0x43c9ad(0x174)+_0x205f66+'`'+(_0x571d3a===_0x43c9ad(0x179)?_0x43c9ad(0x171):'')),writeScopedConfig(_0x57ab1c,_0x90d0f5),{'ok':!![]};}if(_0x57ab1c[_0x205f66]===undefined)throw CliErrors[_0x43c9ad(0x147)](_0x43c9ad(0x154)+_0x205f66+_0x43c9ad(0x165));return delete _0x57ab1c[_0x205f66],console['log'](_0x43c9ad(0x174)+_0x205f66+'`'+(_0x571d3a==='global'?_0x43c9ad(0x171):'')),writeScopedConfig(_0x57ab1c,_0x90d0f5),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5c887f,_0x282b56){var _0x21e6f7=a19_0x5b4e,_0x26d445=_0x5c887f();while(!![]){try{var _0x3d13af=-parseInt(_0x21e6f7(0x15c))/0x1*(parseInt(_0x21e6f7(0x159))/0x2)+parseInt(_0x21e6f7(0x15d))/0x3*(-parseInt(_0x21e6f7(0x15b))/0x4)+-parseInt(_0x21e6f7(0x151))/0x5*(-parseInt(_0x21e6f7(0x155))/0x6)+parseInt(_0x21e6f7(0x153))/0x7*(parseInt(_0x21e6f7(0x154))/0x8)+parseInt(_0x21e6f7(0x157))/0x9*(parseInt(_0x21e6f7(0x158))/0xa)+parseInt(_0x21e6f7(0x156))/0xb*(-parseInt(_0x21e6f7(0x152))/0xc)+parseInt(_0x21e6f7(0x15a))/0xd;if(_0x3d13af===_0x282b56)break;else _0x26d445['push'](_0x26d445['shift']());}catch(_0x4c5421){_0x26d445['push'](_0x26d445['shift']());}}}(a19_0x5b02,0x25dff));import{CLI_BIN_NAME}from'../../constant/cli.js';export{CLI_BIN_NAME};function a19_0x5b02(){var _0x386baf=['63rBPQzv','117270pyXBfV','18kBzhVN','10457655pUIIdm','4FnspYb','29221NPPNBf','783129ZwdNqu','50PdGVog','84bVZECw','439789JMgXcr','8PMTIlE','5100jydWaV','437932PzHiDE'];a19_0x5b02=function(){return _0x386baf;};return a19_0x5b02();}export{readScopedConfig,writeScopedConfig}from'../../context.js';function a19_0x5b4e(_0x124830,_0x394b74){_0x124830=_0x124830-0x151;var _0x5b0280=a19_0x5b02();var _0x5b4efe=_0x5b0280[_0x124830];return _0x5b4efe;}export{resolveConfigScope as resolveWriteScope,TOP_LEVEL_CONFIG_KEYS as TOP_LEVEL_KEYS,CONFIG_ENUM_VALUES as ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey,toScopeFlags}from'../../commands/common/config-policy.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a20_0x245263=a20_0x4d7c;(function(_0x3deab1,_0x5cf86e){const _0xbfa976=a20_0x4d7c,_0x278958=_0x3deab1();while(!![]){try{const _0x5db09b=parseInt(_0xbfa976(0x190))/0x1*(parseInt(_0xbfa976(0x16f))/0x2)+parseInt(_0xbfa976(0x178))/0x3+-parseInt(_0xbfa976(0x183))/0x4*(-parseInt(_0xbfa976(0x193))/0x5)+parseInt(_0xbfa976(0x164))/0x6*(-parseInt(_0xbfa976(0x18b))/0x7)+parseInt(_0xbfa976(0x191))/0x8+parseInt(_0xbfa976(0x198))/0x9+parseInt(_0xbfa976(0x1ae))/0xa*(-parseInt(_0xbfa976(0x17e))/0xb);if(_0x5db09b===_0x5cf86e)break;else _0x278958['push'](_0x278958['shift']());}catch(_0x3c262d){_0x278958['push'](_0x278958['shift']());}}}(a20_0x4cf1,0x46a73));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';function a20_0x4cf1(){const _0x3fb011=['\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','code','55GLmFtk','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','risk','290064zuDnTh','\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','join','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','create','7zabdee','write','Preview:\x20data\x20','\x20\x20PARAMS\x20STRUCTURE','filter','3ESkFLs','4183800FUqszD','Get\x20a\x20single\x20record\x20by\x20ID','15hQiGbr','build','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','getOne','3488544giChhk','operation','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','dryRun','params','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\x20\x20WHERE\x20OPERATORS','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','command','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','POST','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','\x20\x20AGGREGATE\x20TYPES','data\x20','Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Post-aggregation\x20filters,\x20e.g.\x20[{\x22columnName\x22:\x22total\x22,\x22condition\x22:{\x22$gt\x22:1000}}]','paramsHint','Filter\x20dataset\x20records\x20with\x20query\x20conditions','2494230PFSPdZ','read','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','aggregate','\x20\x20LOGICAL\x20COMBINATORS','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','1855926qtpDPN','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','delete','data','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','100186DHxuor','\x20completed\x20in\x20','description','/api/{appCode}/','paramsRequired','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','update','str','Update\x20an\x20existing\x20record','1702239rTgJYR','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','batchCreate'];a20_0x4cf1=function(){return _0x3fb011;};return a20_0x4cf1();}import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a20_0x245263(0x18f),'operation':a20_0x245263(0x18f),'risk':a20_0x245263(0x1af),'paramsRequired':![],'description':a20_0x245263(0x1ad),'paramsHint':'JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20'+a20_0x245263(0x1a0),'helpExtra':[a20_0x245263(0x19f),'\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}',a20_0x245263(0x180),a20_0x245263(0x16b),'\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}',a20_0x245263(0x17c),a20_0x245263(0x162),a20_0x245263(0x184),a20_0x245263(0x16e),a20_0x245263(0x185),a20_0x245263(0x17f),'',a20_0x245263(0x161),'\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}',a20_0x245263(0x195),'',a20_0x245263(0x167),'\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)',a20_0x245263(0x181),'\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]',a20_0x245263(0x16c),a20_0x245263(0x19a),'','\x20\x20PAGINATION','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.',a20_0x245263(0x196),a20_0x245263(0x179)][a20_0x245263(0x186)]('\x0a')},{'command':'getOne','operation':a20_0x245263(0x197),'risk':a20_0x245263(0x1af),'paramsRequired':!![],'description':a20_0x245263(0x192),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a20_0x245263(0x18a),'operation':'create','risk':a20_0x245263(0x18c),'paramsRequired':!![],'description':a20_0x245263(0x16d),'paramsHint':a20_0x245263(0x174)},{'command':a20_0x245263(0x17a),'operation':a20_0x245263(0x17a),'risk':a20_0x245263(0x18c),'paramsRequired':!![],'description':a20_0x245263(0x187),'paramsHint':a20_0x245263(0x188)},{'command':a20_0x245263(0x175),'operation':a20_0x245263(0x175),'risk':a20_0x245263(0x18c),'paramsRequired':!![],'description':a20_0x245263(0x177),'paramsHint':a20_0x245263(0x19b)},{'command':a20_0x245263(0x168),'operation':a20_0x245263(0x168),'risk':'high-risk-write','paramsRequired':!![],'description':'Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','paramsHint':a20_0x245263(0x19e)},{'command':'aggregate','operation':a20_0x245263(0x1b1),'risk':a20_0x245263(0x1af),'paramsRequired':![],'description':'Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','paramsHint':a20_0x245263(0x189)+a20_0x245263(0x1a9),'helpExtra':[a20_0x245263(0x1a7),'\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}',a20_0x245263(0x1a4),a20_0x245263(0x1a6),'\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}',a20_0x245263(0x1a2),'\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','',a20_0x245263(0x18e),'\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]',a20_0x245263(0x17b),a20_0x245263(0x163),a20_0x245263(0x1aa),a20_0x245263(0x1ab),a20_0x245263(0x16a),'','\x20\x20EXAMPLES',a20_0x245263(0x165),a20_0x245263(0x166),'',a20_0x245263(0x1a3),'\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','',a20_0x245263(0x1b0)]['join']('\x0a')}];function makeDataCommand(_0x281ad4){const _0x53db2e=a20_0x245263,_0x4209d6=_0x53db2e(0x1a8)+_0x281ad4[_0x53db2e(0x1a1)],_0x35780c={'service':_0x53db2e(0x169),'command':_0x281ad4[_0x53db2e(0x1a1)],'description':_0x281ad4[_0x53db2e(0x171)],'risk':_0x281ad4[_0x53db2e(0x182)],'helpExtra':_0x281ad4['helpExtra'],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x281ad4[_0x53db2e(0x1ac)]}],'validate':async _0x5634f5=>{const _0x5d1cc5=_0x53db2e;_0x281ad4[_0x5d1cc5(0x173)]&&requireAnyOf(_0x5634f5,[_0x5d1cc5(0x19d)],_0x4209d6),_0x281ad4['operation']===_0x5d1cc5(0x17a)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x5634f5[_0x5d1cc5(0x176)](_0x5d1cc5(0x19d))));},async 'execute'(_0x4ca9ba){const _0x4484d4=_0x53db2e,_0x537f03=_0x4ca9ba['str'](_0x4484d4(0x17d)),_0x29b53d=_0x281ad4[_0x4484d4(0x199)]===_0x4484d4(0x17a)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x4ca9ba[_0x4484d4(0x176)](_0x4484d4(0x19d)))):parseJsonParams(_0x4ca9ba[_0x4484d4(0x176)]('params'))??{},_0x169cfc=Date['now'](),_0x3fefd4=await executeData(_0x537f03,_0x281ad4['operation'],_0x29b53d),_0x490fae=Date['now']()-_0x169cfc;return{'ok':!![],'data':{'result':_0x3fefd4,'elapsed':_0x490fae},'message':_0x4484d4(0x1a8)+_0x281ad4[_0x4484d4(0x1a1)]+_0x4484d4(0x170)+_0x490fae+'ms'};}};return _0x281ad4['risk']!==_0x53db2e(0x1af)&&(_0x35780c[_0x53db2e(0x19c)]=async _0x241883=>{const _0x1179da=_0x53db2e,_0x33e8f2=_0x241883[_0x1179da(0x176)](_0x1179da(0x17d)),_0x322369=_0x281ad4[_0x1179da(0x199)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x241883[_0x1179da(0x176)]('params'))):parseJsonParams(_0x241883['str'](_0x1179da(0x19d)))??{};return dryRun(_0x1179da(0x1a5),_0x1179da(0x172)+_0x33e8f2+'/'+_0x281ad4['operation'])['body'](_0x322369)['description'](_0x1179da(0x18d)+_0x281ad4[_0x1179da(0x1a1)]+'\x20on\x20dataset\x20'+_0x33e8f2)[_0x1179da(0x194)]();}),_0x35780c;}function a20_0x4d7c(_0x1c603e,_0x4d438c){_0x1c603e=_0x1c603e-0x161;const _0x4cf1f0=a20_0x4cf1();let _0x4d7c9f=_0x4cf1f0[_0x1c603e];return _0x4d7c9f;}export const dataDefinitions=specs['map'](makeDataCommand);
|
|
1
|
+
const a20_0x230f48=a20_0x36d1;(function(_0xb70eb6,_0xec7188){const _0x3f9840=a20_0x36d1,_0x5e8455=_0xb70eb6();while(!![]){try{const _0x596f4a=-parseInt(_0x3f9840(0x1e0))/0x1*(-parseInt(_0x3f9840(0x22f))/0x2)+parseInt(_0x3f9840(0x1fc))/0x3*(parseInt(_0x3f9840(0x21c))/0x4)+parseInt(_0x3f9840(0x217))/0x5*(parseInt(_0x3f9840(0x1e7))/0x6)+parseInt(_0x3f9840(0x210))/0x7*(-parseInt(_0x3f9840(0x20e))/0x8)+parseInt(_0x3f9840(0x21e))/0x9*(parseInt(_0x3f9840(0x228))/0xa)+-parseInt(_0x3f9840(0x204))/0xb+parseInt(_0x3f9840(0x234))/0xc;if(_0x596f4a===_0xec7188)break;else _0x5e8455['push'](_0x5e8455['shift']());}catch(_0x3c997e){_0x5e8455['push'](_0x5e8455['shift']());}}}(a20_0x1aa5,0x5c399));function a20_0x1aa5(){const _0x142ce9=['read','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','6732451KkfKxd','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\x20on\x20dataset\x20','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','\x20\x20AGGREGATE\x20TYPES','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','helpExtra','8scRQsO','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','559412FKIzwo','Update\x20an\x20existing\x20record','operation','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','aggregate','3070960sPNDUm','\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','map','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','316WiLuTE','POST','6489vAghjN','now','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','str','description','\x20\x20EXAMPLES','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','delete','1810OldjqM','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','code','high-risk-write','\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','params','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','3162ynErAT','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','\x20completed\x20in\x20','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','764952WJibjP','command','update','body','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','97caARRI','\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}','paramsHint','Preview:\x20data\x20','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','risk','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','6uagJaZ','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','filter','data\x20','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','batchCreate','write','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','build','Get\x20a\x20single\x20record\x20by\x20ID','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','create','join','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','4098zdnQNf','data','\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','getOne','\x20\x20WHERE\x20OPERATORS'];a20_0x1aa5=function(){return _0x142ce9;};return a20_0x1aa5();}import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a20_0x230f48(0x1e9),'operation':a20_0x230f48(0x1e9),'risk':a20_0x230f48(0x202),'paramsRequired':![],'description':'Filter\x20dataset\x20records\x20with\x20query\x20conditions','paramsHint':'JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20'+a20_0x230f48(0x1e6),'helpExtra':[a20_0x230f48(0x201),a20_0x230f48(0x1e1),a20_0x230f48(0x213),'\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}',a20_0x230f48(0x1fe),a20_0x230f48(0x215),a20_0x230f48(0x1df),'\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}',a20_0x230f48(0x20c),a20_0x230f48(0x1f3),a20_0x230f48(0x1e8),'','\x20\x20LOGICAL\x20COMBINATORS',a20_0x230f48(0x22c),a20_0x230f48(0x21a),'',a20_0x230f48(0x21b),a20_0x230f48(0x1ee),a20_0x230f48(0x1f1),a20_0x230f48(0x20f),a20_0x230f48(0x22e),a20_0x230f48(0x231),'','\x20\x20PAGINATION',a20_0x230f48(0x229),a20_0x230f48(0x206),a20_0x230f48(0x20a)][a20_0x230f48(0x1f6)]('\x0a')},{'command':a20_0x230f48(0x200),'operation':a20_0x230f48(0x200),'risk':'read','paramsRequired':!![],'description':a20_0x230f48(0x1f0),'paramsHint':a20_0x230f48(0x207)},{'command':'create','operation':a20_0x230f48(0x1f5),'risk':a20_0x230f48(0x1ed),'paramsRequired':!![],'description':a20_0x230f48(0x203),'paramsHint':a20_0x230f48(0x209)},{'command':a20_0x230f48(0x1ec),'operation':a20_0x230f48(0x1ec),'risk':a20_0x230f48(0x1ed),'paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','paramsHint':a20_0x230f48(0x225)},{'command':a20_0x230f48(0x236),'operation':'update','risk':a20_0x230f48(0x1ed),'paramsRequired':!![],'description':a20_0x230f48(0x211),'paramsHint':a20_0x230f48(0x1fb)},{'command':a20_0x230f48(0x227),'operation':a20_0x230f48(0x227),'risk':a20_0x230f48(0x22b),'paramsRequired':!![],'description':a20_0x230f48(0x1fa),'paramsHint':a20_0x230f48(0x207)},{'command':a20_0x230f48(0x216),'operation':a20_0x230f48(0x216),'risk':a20_0x230f48(0x202),'paramsRequired':![],'description':'Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','paramsHint':a20_0x230f48(0x1ff)+a20_0x230f48(0x214),'helpExtra':[a20_0x230f48(0x20b),a20_0x230f48(0x218),'\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}',a20_0x230f48(0x1f9),a20_0x230f48(0x220),a20_0x230f48(0x230),'\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}',a20_0x230f48(0x1f2),'','\x20\x20PARAMS\x20STRUCTURE',a20_0x230f48(0x205),a20_0x230f48(0x233),a20_0x230f48(0x1f7),a20_0x230f48(0x1f4),'\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Post-aggregation\x20filters,\x20e.g.\x20[{\x22columnName\x22:\x22total\x22,\x22condition\x22:{\x22$gt\x22:1000}}]',a20_0x230f48(0x224),'',a20_0x230f48(0x223),a20_0x230f48(0x1e4),a20_0x230f48(0x1f8),'',a20_0x230f48(0x226),'\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','',a20_0x230f48(0x1eb)][a20_0x230f48(0x1f6)]('\x0a')}];function makeDataCommand(_0x1f6f02){const _0x5ea026=a20_0x230f48,_0x159030=_0x5ea026(0x1ea)+_0x1f6f02[_0x5ea026(0x235)],_0x3eeea7={'service':_0x5ea026(0x1fd),'command':_0x1f6f02['command'],'description':_0x1f6f02[_0x5ea026(0x222)],'risk':_0x1f6f02[_0x5ea026(0x1e5)],'helpExtra':_0x1f6f02[_0x5ea026(0x20d)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x1f6f02[_0x5ea026(0x1e2)]}],'validate':async _0x30f8b6=>{const _0x368106=_0x5ea026;_0x1f6f02['paramsRequired']&&requireAnyOf(_0x30f8b6,[_0x368106(0x22d)],_0x159030),_0x1f6f02[_0x368106(0x212)]==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x30f8b6[_0x368106(0x221)](_0x368106(0x22d))));},async 'execute'(_0x48ef00){const _0x1cd2b1=_0x5ea026,_0x2f59a7=_0x48ef00[_0x1cd2b1(0x221)](_0x1cd2b1(0x22a)),_0x5317d0=_0x1f6f02[_0x1cd2b1(0x212)]===_0x1cd2b1(0x1ec)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x48ef00[_0x1cd2b1(0x221)](_0x1cd2b1(0x22d)))):parseJsonParams(_0x48ef00[_0x1cd2b1(0x221)](_0x1cd2b1(0x22d)))??{},_0x41a835=Date['now'](),_0x23f366=await executeData(_0x2f59a7,_0x1f6f02[_0x1cd2b1(0x212)],_0x5317d0),_0x4f5832=Date[_0x1cd2b1(0x21f)]()-_0x41a835;return{'ok':!![],'data':{'result':_0x23f366,'elapsed':_0x4f5832},'message':'data\x20'+_0x1f6f02['command']+_0x1cd2b1(0x232)+_0x4f5832+'ms'};}};return _0x1f6f02['risk']!=='read'&&(_0x3eeea7['dryRun']=async _0x486ab6=>{const _0x490cfc=_0x5ea026,_0x430b00=_0x486ab6['str'](_0x490cfc(0x22a)),_0x599e74=_0x1f6f02[_0x490cfc(0x212)]===_0x490cfc(0x1ec)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x486ab6[_0x490cfc(0x221)]('params'))):parseJsonParams(_0x486ab6[_0x490cfc(0x221)]('params'))??{};return dryRun(_0x490cfc(0x21d),'/api/{appCode}/'+_0x430b00+'/'+_0x1f6f02[_0x490cfc(0x212)])[_0x490cfc(0x237)](_0x599e74)[_0x490cfc(0x222)](_0x490cfc(0x1e3)+_0x1f6f02[_0x490cfc(0x235)]+_0x490cfc(0x208)+_0x430b00)[_0x490cfc(0x1ef)]();}),_0x3eeea7;}function a20_0x36d1(_0x2bfed2,_0x4fab55){_0x2bfed2=_0x2bfed2-0x1df;const _0x1aa5df=a20_0x1aa5();let _0x36d151=_0x1aa5df[_0x2bfed2];return _0x36d151;}export const dataDefinitions=specs[a20_0x230f48(0x219)](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0xfb27ec=a21_0x4900;(function(_0x5e2ad7,_0x405934){const _0xa302f5=a21_0x4900,_0x340bca=_0x5e2ad7();while(!![]){try{const _0x10bd72=-parseInt(_0xa302f5(0xb0))/0x1+-parseInt(_0xa302f5(0xce))/0x2+-parseInt(_0xa302f5(0xe1))/0x3*(-parseInt(_0xa302f5(0xaa))/0x4)+-parseInt(_0xa302f5(0xef))/0x5+-parseInt(_0xa302f5(0xdf))/0x6*(-parseInt(_0xa302f5(0xb2))/0x7)+-parseInt(_0xa302f5(0xbb))/0x8+parseInt(_0xa302f5(0xf3))/0x9;if(_0x10bd72===_0x405934)break;else _0x340bca['push'](_0x340bca['shift']());}catch(_0x4636db){_0x340bca['push'](_0x340bca['shift']());}}}(a21_0x55d8,0x9c02e));import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x1a3bf2){const _0x2f7a5e=a21_0x4900;if(_0x1a3bf2[_0x2f7a5e(0xde)])return null;const _0xc9a09d=Boolean(_0x1a3bf2['displayName']!==undefined||_0x1a3bf2['doType']!==undefined);let _0xc846b3={};if(!_0xc9a09d&&typeof _0x1a3bf2[_0x2f7a5e(0xea)]==='string')try{_0xc846b3=JSON['parse'](_0x1a3bf2[_0x2f7a5e(0xea)]);}catch{}const _0x461c82=_0xc9a09d?_0x1a3bf2['name']:_0x1a3bf2['code'],_0x42dc27=_0xc9a09d?_0x1a3bf2[_0x2f7a5e(0xbd)]:_0x1a3bf2[_0x2f7a5e(0xbe)],_0x6566b3=_0xc9a09d?_0x1a3bf2['doType']:_0x1a3bf2[_0x2f7a5e(0xf0)]||_0x1a3bf2[_0x2f7a5e(0xb1)],_0x4a083c=_0xc9a09d?_0x1a3bf2[_0x2f7a5e(0xec)]===!![]:_0xc846b3[_0x2f7a5e(0xec)]===!![],_0x28e553=_0xc9a09d?_0x1a3bf2[_0x2f7a5e(0xed)]===!![]:_0xc846b3['required']===!![],_0x22c5c9=_0xc9a09d?_0x1a3bf2[_0x2f7a5e(0xf2)]??null:_0xc846b3['options']??null,_0x9c9abf={'name':_0x461c82,'displayName':_0x42dc27||_0x461c82,'type':_0x6566b3,'dbType':_0x1a3bf2[_0x2f7a5e(0xb7)],'pk':_0x4a083c,'required':_0x28e553,'description':_0x1a3bf2[_0x2f7a5e(0xb9)]||undefined};return Array['isArray'](_0x22c5c9)&&_0x22c5c9[_0x2f7a5e(0xb6)]>0x0&&(_0x9c9abf[_0x2f7a5e(0xf2)]=_0x22c5c9),_0x9c9abf;}function parseJsonMaybe(_0x52be23){const _0x43f71d=a21_0x4900;if(typeof _0x52be23!==_0x43f71d(0xad))return _0x52be23;try{return JSON[_0x43f71d(0xd7)](_0x52be23);}catch{return _0x52be23;}}function normalizeOperationEntry(_0x410aca,_0x373c20){const _0x154796=a21_0x4900;if(!_0x373c20||typeof _0x373c20!==_0x154796(0xcb))return null;if(!_0x373c20[_0x154796(0xe6)]||!_0x373c20[_0x154796(0xa9)])return null;const _0x1eb3bf={'name':_0x410aca,'method':_0x373c20[_0x154796(0xe6)],'path':_0x373c20[_0x154796(0xa9)]};if(_0x373c20['host'])_0x1eb3bf[_0x154796(0xb5)]=_0x373c20[_0x154796(0xb5)];if(_0x373c20['requestBody']!=null)_0x1eb3bf['requestBody']=parseJsonMaybe(_0x373c20[_0x154796(0xba)]);if(_0x373c20['responseBody']!=null)_0x1eb3bf[_0x154796(0xc3)]=parseJsonMaybe(_0x373c20[_0x154796(0xc3)]);if(_0x373c20['beforeScriptId']!=null)_0x1eb3bf[_0x154796(0xd8)]=_0x373c20[_0x154796(0xd8)];if(_0x373c20['afterScriptId']!=null)_0x1eb3bf[_0x154796(0xd3)]=_0x373c20['afterScriptId'];if(Array[_0x154796(0xc9)](_0x373c20['requestFields']))_0x1eb3bf[_0x154796(0xc6)]=_0x373c20[_0x154796(0xc6)];if(Array[_0x154796(0xc9)](_0x373c20['responseFields']))_0x1eb3bf[_0x154796(0xca)]=_0x373c20['responseFields'];return _0x1eb3bf;}function summarizeDbtable(_0x389626){const _0x14941c=a21_0x4900,_0x4b0b46={},_0x310562=['dbId',_0x14941c(0xc1),_0x14941c(0xcd),_0x14941c(0xb4),_0x14941c(0xec),_0x14941c(0xc4),'logicField',_0x14941c(0xd6),'updateTimeField',_0x14941c(0xc0),'creatorNameField',_0x14941c(0xd4),_0x14941c(0xe0),_0x14941c(0xdb),_0x14941c(0xa8)];for(const _0x267914 of _0x310562){if(_0x389626[_0x267914]!==undefined)_0x4b0b46[_0x267914]=_0x389626[_0x267914];}return typeof _0x4b0b46[_0x14941c(0xc4)]===_0x14941c(0xad)&&_0x4b0b46[_0x14941c(0xc4)][_0x14941c(0xb6)]>0x0&&(_0x4b0b46[_0x14941c(0xeb)]=_0x4b0b46[_0x14941c(0xc4)]['split'](',')[_0x14941c(0xd1)](_0x290062=>_0x290062[_0x14941c(0xac)]())[_0x14941c(0xee)](Boolean)),_0x4b0b46;}function a21_0x4900(_0x5079c3,_0x383699){_0x5079c3=_0x5079c3-0xa8;const _0x55d819=a21_0x55d8();let _0x49005a=_0x55d819[_0x5079c3];return _0x49005a;}function normalizeRelatedPages(_0x438290){const _0x5e5df0=a21_0x4900;if(!Array['isArray'](_0x438290))return[];return _0x438290[_0x5e5df0(0xee)](_0x524b59=>_0x524b59&&typeof _0x524b59===_0x5e5df0(0xcb))[_0x5e5df0(0xd1)](_0x42a06f=>({'id':_0x42a06f['id'],'type':_0x42a06f[_0x5e5df0(0xf0)],'code':_0x42a06f[_0x5e5df0(0xdd)],'title':_0x42a06f[_0x5e5df0(0xd2)],'deleted':_0x42a06f[_0x5e5df0(0xde)]===!![]}));}function normalizeFallbackFieldName(_0x51be83,_0x24b402){const _0x1dfc17=a21_0x4900,_0x5a0746=_0x51be83[_0x1dfc17(0xac)]();if(!_0x5a0746)return null;return{'name':_0x5a0746,'displayName':_0x5a0746,'type':undefined,'dbType':undefined,'pk':_0x5a0746===_0x24b402,'required':![],'description':undefined};}async function loadListFieldFallback(_0x5c2839,_0x18f89f){const _0x2cdc97=a21_0x4900;if(!_0x5c2839||!_0x18f89f)return[];try{const _0x22e1f3=await listDatasets(_0x5c2839,{'code':_0x18f89f}),_0x5056fd=_0x22e1f3[_0x2cdc97(0xbf)](_0x4e08c8=>_0x4e08c8[_0x2cdc97(0xdd)]===_0x18f89f)??_0x22e1f3[0x0],_0x50bb71=_0x5056fd?.[_0x2cdc97(0xb8)]??{},_0x2991cc=typeof _0x50bb71[_0x2cdc97(0xc4)]===_0x2cdc97(0xad)?_0x50bb71[_0x2cdc97(0xc4)][_0x2cdc97(0xda)](','):[];return _0x2991cc[_0x2cdc97(0xd1)](_0x522ae5=>normalizeFallbackFieldName(_0x522ae5,_0x50bb71[_0x2cdc97(0xec)]))[_0x2cdc97(0xee)](_0x41099e=>_0x41099e!==null);}catch{return[];}}export const datasetDetail={'service':a21_0xfb27ec(0xcf),'command':a21_0xfb27ec(0xab),'description':'Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','risk':'read','flags':[CODE_FLAG],async 'execute'(_0x1154f4){const _0x1d3593=a21_0xfb27ec,_0x4ab912=await getDatasetDetail(_0x1154f4[_0x1d3593(0xd5)](_0x1d3593(0xdd))),_0x97546b=Array[_0x1d3593(0xc9)](_0x4ab912[_0x1d3593(0xdc)])?_0x4ab912[_0x1d3593(0xdc)]:Array[_0x1d3593(0xc9)](_0x4ab912[_0x1d3593(0xd0)])?_0x4ab912['properties']:[];let _0x446fcf=_0x97546b[_0x1d3593(0xd1)](_0x1659ca=>normalizeField(_0x1659ca))[_0x1d3593(0xee)](_0x5ca9cc=>_0x5ca9cc!==null);_0x446fcf['length']===0x0&&(_0x446fcf=await loadListFieldFallback(_0x1154f4[_0x1d3593(0xc7)],_0x1154f4['str'](_0x1d3593(0xdd))));const _0x4fe6bf=_0x4ab912[_0x1d3593(0xb3)]??{},_0x4d7895=[];for(const [_0x53d5e7,_0x34942f]of Object['entries'](_0x4fe6bf)){const _0x1523d5=normalizeOperationEntry(_0x53d5e7,_0x34942f);if(_0x1523d5)_0x4d7895[_0x1d3593(0xe4)](_0x1523d5);}const _0x1b1df7=_0x4ab912['dbtableConfig']??{},_0x2b4414=_0x4ab912[_0x1d3593(0xcf)]??{},_0x10acfa=_0x1b1df7[_0x1d3593(0xf1)]!=null?{'id':_0x1b1df7[_0x1d3593(0xf1)],'name':_0x1b1df7['dbName']??null}:undefined;let _0xa05643;return typeof _0x4ab912[_0x1d3593(0xea)]===_0x1d3593(0xad)&&(_0xa05643=parseJsonMaybe(_0x4ab912[_0x1d3593(0xea)])),{'ok':!![],'data':{'id':_0x4ab912[_0x1d3593(0xe7)]??_0x4ab912['id'],'name':_0x4ab912[_0x1d3593(0xbe)],'code':_0x4ab912[_0x1d3593(0xc5)]||_0x4ab912[_0x1d3593(0xdd)],'doVersion':_0x4ab912[_0x1d3593(0xbc)],'description':_0x4ab912['description']||_0x2b4414[_0x1d3593(0xe3)]||undefined,'source':_0x4ab912[_0x1d3593(0xe2)]||_0x2b4414[_0x1d3593(0xae)],'table':_0x1b1df7[_0x1d3593(0xcd)]||_0x2b4414[_0x1d3593(0xcd)],'datasetKey':_0x1b1df7[_0x1d3593(0xb4)],'pk':_0x1b1df7[_0x1d3593(0xec)],'db':_0x10acfa,'dbtable':summarizeDbtable(_0x1b1df7),'fields':_0x446fcf,'operations':_0x4d7895,'indexes':Array[_0x1d3593(0xc9)](_0x2b4414[_0x1d3593(0xc2)])?_0x2b4414[_0x1d3593(0xc2)]:[],'relations':Array[_0x1d3593(0xc9)](_0x4ab912[_0x1d3593(0xc8)])?_0x4ab912[_0x1d3593(0xc8)][_0x1d3593(0xd1)](_0x20d57c=>({'fromField':_0x20d57c['fromField'],'toDataset':_0x20d57c['toDatasetName'],'toCode':_0x20d57c['toDatasetCode'],'toTable':_0x20d57c[_0x1d3593(0xaf)],'toField':_0x20d57c['toField'],'labelField':_0x20d57c[_0x1d3593(0xe9)]||undefined})):[],'relatedPages':normalizeRelatedPages(_0x4ab912[_0x1d3593(0xe5)]),...Array[_0x1d3593(0xc9)](_0x4ab912[_0x1d3593(0xcc)])?{'columnCodeListWithDeleted':_0x4ab912[_0x1d3593(0xcc)]}:{},'formatRules':Array[_0x1d3593(0xc9)](_0x4ab912[_0x1d3593(0xe8)])?_0x4ab912[_0x1d3593(0xe8)]:[],'validateRules':Array['isArray'](_0x4ab912['validateRules'])?_0x4ab912[_0x1d3593(0xd9)]:[],..._0xa05643!==undefined?{'extend':_0xa05643}:{},'stats':{'fieldCount':_0x446fcf[_0x1d3593(0xb6)],'operationCount':_0x4d7895['length']}}};}};function a21_0x55d8(){const _0x5d3b6d=['modifierIdField','str','createTimeField','parse','beforeScriptId','validateRules','split','labelField','fields','code','deleted','5538mcslfe','modifierNameField','28794eXHlmY','source','tableComment','push','relatedPageInfoList','method','modelId','formatRules','toFieldLabel','extend','allFieldNames','pkField','required','filter','5593775CNmnQx','type','dbId','options','30401631uRSWAU','dblinkInfoDTO','path','532WmBHWx','detail','trim','string','sourceType','toTableName','958399AzYpoF','dataType','91XbIOym','operations','datasetKey','host','length','dbType','dbtableConfig','description','requestBody','7200624YdIPeT','doVersion','displayName','name','find','creatorIdField','dbName','indexes','responseBody','allFields','modelCode','requestFields','appCode','relations','isArray','responseFields','object','columnCodeListWithDeleted','tableName','2100476CWoqwW','dataset','properties','map','title','afterScriptId'];a21_0x55d8=function(){return _0x5d3b6d;};return a21_0x55d8();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4db8b4,_0x150260){const _0x29cc52=a22_0x5d31,_0x25057b=_0x4db8b4();while(!![]){try{const _0xd749f9=parseInt(_0x29cc52(0x1aa))/0x1*(-parseInt(_0x29cc52(0x1a8))/0x2)+-parseInt(_0x29cc52(0x1ac))/0x3*(parseInt(_0x29cc52(0x1a7))/0x4)+parseInt(_0x29cc52(0x1ad))/0x5*(-parseInt(_0x29cc52(0x1a5))/0x6)+-parseInt(_0x29cc52(0x1a9))/0x7+parseInt(_0x29cc52(0x1ae))/0x8+-parseInt(_0x29cc52(0x1a4))/0x9*(-parseInt(_0x29cc52(0x1ab))/0xa)+parseInt(_0x29cc52(0x1a6))/0xb;if(_0xd749f9===_0x150260)break;else _0x25057b['push'](_0x25057b['shift']());}catch(_0x1d742c){_0x25057b['push'](_0x25057b['shift']());}}}(a22_0x29a5,0x4a00f));function a22_0x29a5(){const _0x5a682d=['157527dMFOPS','6VpdKFE','10528639ZifaQI','73832yJiACG','2oqOdUo','1987286PAJbqE','396159pseRjB','290DfZNNa','93eCZfZg','1165835YYsjkA','2590440PrpyYb'];a22_0x29a5=function(){return _0x5a682d;};return a22_0x29a5();}function a22_0x5d31(_0x436095,_0xadcfd5){_0x436095=_0x436095-0x1a4;const _0x29a520=a22_0x29a5();let _0x5d31fa=_0x29a520[_0x436095];return _0x5d31fa;}import{datasetList}from'../../commands/dataset/list.js';import{datasetDetail}from'../../commands/dataset/detail.js';import{datasetSdkDoc}from'../../commands/dataset/sdk-doc.js';export const datasetDefinitions=[datasetList,datasetDetail,datasetSdkDoc];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a23_0x1a84fd=a23_0x1b08;(function(_0x2418a2,_0x106801){const _0x4e8a16=a23_0x1b08,_0x3b2c39=_0x2418a2();while(!![]){try{const _0x46e1eb=-parseInt(_0x4e8a16(0x76))/0x1+parseInt(_0x4e8a16(0x80))/0x2+parseInt(_0x4e8a16(0x86))/0x3*(-parseInt(_0x4e8a16(0x7b))/0x4)+-parseInt(_0x4e8a16(0x83))/0x5*(parseInt(_0x4e8a16(0x79))/0x6)+parseInt(_0x4e8a16(0x75))/0x7*(parseInt(_0x4e8a16(0x7c))/0x8)+parseInt(_0x4e8a16(0x82))/0x9*(-parseInt(_0x4e8a16(0x87))/0xa)+parseInt(_0x4e8a16(0x6f))/0xb;if(_0x46e1eb===_0x106801)break;else _0x3b2c39['push'](_0x3b2c39['shift']());}catch(_0x46dc06){_0x3b2c39['push'](_0x3b2c39['shift']());}}}(a23_0x2bad,0xa177f));import{listDatasets}from'../../core/api-client.js';function a23_0x2bad(){const _0x40fe27=['allFields','appCode','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','tableName','98SgeSsw','562717cUPsrU','datasetKey','pkField','19380keQFSk','string','75336SAqjto','553224hPHhre','split','map','trim','1625746EUCzvi','description','2112831qlrsKZ','1910iLimhg','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','list','36iYvxlT','20dhhsUT','str','dataset','Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)','code','dbtableConfig','15097093fARmzU','length'];a23_0x2bad=function(){return _0x40fe27;};return a23_0x2bad();}import{CODE_FLAG}from'../../commands/common/flags.js';function a23_0x1b08(_0x2ba118,_0x66911c){_0x2ba118=_0x2ba118-0x6b;const _0x2bad50=a23_0x2bad();let _0x1b08f0=_0x2bad50[_0x2ba118];return _0x1b08f0;}export const datasetList={'service':a23_0x1a84fd(0x6b),'command':a23_0x1a84fd(0x85),'description':a23_0x1a84fd(0x73),'risk':'read','flags':[{'name':'name','type':a23_0x1a84fd(0x7a),'description':a23_0x1a84fd(0x6c)},{...CODE_FLAG,'required':![],'description':a23_0x1a84fd(0x84)}],async 'execute'(_0x2f331a){const _0xdab780=a23_0x1a84fd,_0x5180b1=_0x2f331a[_0xdab780(0x88)]('name'),_0x56a79b=_0x2f331a[_0xdab780(0x88)](_0xdab780(0x6d)),_0x5f3933=await listDatasets(_0x2f331a[_0xdab780(0x72)],{..._0x5180b1&&{'name':_0x5180b1},..._0x56a79b&&{'code':_0x56a79b}});return{'ok':!![],'data':{'total':_0x5f3933[_0xdab780(0x70)],'datasets':_0x5f3933['map'](_0xe3cba9=>{const _0x23cc7f=_0xdab780,_0x39b4f1=_0xe3cba9[_0x23cc7f(0x6e)]??{};return{'id':_0xe3cba9['id'],'code':_0xe3cba9[_0x23cc7f(0x6d)],'name':_0xe3cba9['name'],'source':_0xe3cba9['source'],'description':_0xe3cba9[_0x23cc7f(0x81)],'table':_0x39b4f1[_0x23cc7f(0x74)],'datasetKey':_0x39b4f1[_0x23cc7f(0x77)],'pk':_0x39b4f1[_0x23cc7f(0x78)],'fields':_0x39b4f1[_0x23cc7f(0x71)]?_0x39b4f1[_0x23cc7f(0x71)][_0x23cc7f(0x7d)](',')[_0x23cc7f(0x7e)](_0x5c8b39=>_0x5c8b39[_0x23cc7f(0x7f)]()):[]};})}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x428451=a24_0x4687;function a24_0xb7ff(){const _0x1cc41e=['trim','8EYAweu','appCode','sdk-doc','606549RGNxle','496040LhnKoV','Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','2705022BWZneY','string','dataset','499902MeXWZr','code','2916230rUtXMh','8481095flVEHF','str','1348772SzXRwd','4MOMqcv','#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档','81ROJexY','Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code'];a24_0xb7ff=function(){return _0x1cc41e;};return a24_0xb7ff();}(function(_0xaec759,_0x3d165a){const _0x36d944=a24_0x4687,_0x558f57=_0xaec759();while(!![]){try{const _0x261ac2=parseInt(_0x36d944(0x1f1))/0x1+-parseInt(_0x36d944(0x1f6))/0x2+-parseInt(_0x36d944(0x1ff))/0x3*(parseInt(_0x36d944(0x1f7))/0x4)+parseInt(_0x36d944(0x200))/0x5+-parseInt(_0x36d944(0x1ee))/0x6+parseInt(_0x36d944(0x1f4))/0x7*(-parseInt(_0x36d944(0x1fc))/0x8)+parseInt(_0x36d944(0x1f9))/0x9*(parseInt(_0x36d944(0x1f3))/0xa);if(_0x261ac2===_0x3d165a)break;else _0x558f57['push'](_0x558f57['shift']());}catch(_0xb3420b){_0x558f57['push'](_0x558f57['shift']());}}}(a24_0xb7ff,0xa72b6));function a24_0x4687(_0xdc0b5d,_0x13020f){_0xdc0b5d=_0xdc0b5d-0x1ed;const _0xb7ff29=a24_0xb7ff();let _0x4687dd=_0xb7ff29[_0xdc0b5d];return _0x4687dd;}import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';const DEFAULT_MARKDOWN=a24_0x428451(0x1f8);export function formatDatasetSdkMarkdown(_0x1ead93){const _0x185a4b=a24_0x428451,_0x51db49=typeof _0x1ead93===_0x185a4b(0x1ef)?_0x1ead93[_0x185a4b(0x1fb)]():'';return _0x51db49||DEFAULT_MARKDOWN;}export const datasetSdkDoc={'service':a24_0x428451(0x1f0),'command':a24_0x428451(0x1fe),'description':a24_0x428451(0x1fa),'risk':'read','flags':[{...CODE_FLAG,'description':a24_0x428451(0x1ed)}],async 'execute'(_0x403e82){const _0x49b70f=a24_0x428451,_0x560e50=_0x403e82[_0x49b70f(0x1f5)](_0x49b70f(0x1f2)),_0x24b64c=await getDatasetSdkUsageDoc(_0x560e50,_0x403e82[_0x49b70f(0x1fd)]);return{'ok':!![],'data':{'code':_0x560e50,'appCode':_0x403e82[_0x49b70f(0x1fd)],'markdown':formatDatasetSdkMarkdown(_0x24b64c)}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x4ceca6=a25_0x10c8;(function(_0x26188a,_0x5ff08e){const _0x366ecc=a25_0x10c8,_0x1bc07b=_0x26188a();while(!![]){try{const _0x39be9a=parseInt(_0x366ecc(0x1c5))/0x1+parseInt(_0x366ecc(0x188))/0x2+-parseInt(_0x366ecc(0x1b1))/0x3+-parseInt(_0x366ecc(0x1c3))/0x4+-parseInt(_0x366ecc(0x1aa))/0x5+parseInt(_0x366ecc(0x190))/0x6*(parseInt(_0x366ecc(0x172))/0x7)+-parseInt(_0x366ecc(0x1a4))/0x8;if(_0x39be9a===_0x5ff08e)break;else _0x1bc07b['push'](_0x1bc07b['shift']());}catch(_0xe84087){_0x1bc07b['push'](_0x1bc07b['shift']());}}}(a25_0x1cf0,0xba918));import a25_0x246463 from'chalk';function a25_0x10c8(_0x7f8746,_0x491c56){_0x7f8746=_0x7f8746-0x171;const _0x1cf02d=a25_0x1cf0();let _0x10c847=_0x1cf02d[_0x7f8746];return _0x10c847;}import{CLI_BIN_NAME}from'../constant/cli.js';function a25_0x1cf0(){const _0x4c5e97=['(default:\x20','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','missing','length','\x20\x20Config\x20JSON','(unnamed)','\x20\x20Session\x20check:\x20\x20\x20','commandCount','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','✓\x20Loaded','gray','currentApp','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','(not\x20found)','read','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20auth\x20(effective):\x20','message','\x20doctor','2409924NvIJgD','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','✗\x20Invalid','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','bold','✗\x20Invalid\x20JSON','\x20\x20runtimeDomain:\x20\x20\x20','green','6emSHSu','yellow','Global','\x20\x20Merged\x20Config','empty','✓\x20Valid\x20JSON','ClientAk','red','(set,\x20length=','status','path','format','platform','locale','appCode','log','serviceCount','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','name','pageSize','255448bBwuqx','repeat','\x20(accessKey)','(removed\x20—\x20cookie\x20auth\x20disabled)','\x20\x20─','(no\x20file)','6424740jgRKpB','accessKey','version','serviceCode','(not\x20set)','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Diagnose\x20CLI\x20configuration\x20and\x20environment','667767aUgEOF','\x20\x20Config\x20Files','\x20commands)','services','(default)','\x20(legacy/compat\x20only)','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','verbose','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','(missing)','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','\x20\x20Auth','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','padEnd','700628JvDuja','⚠\x20Empty','122701UIQjgh','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','registryPath','8058022AHImhq','(none)'];a25_0x1cf0=function(){return _0x4c5e97;};return a25_0x1cf0();}import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';import{inspectServiceRegistry}from'../commands/service/registry.js';async function execute(_0x33e776){const _0x36f4ee=a25_0x10c8,_0xe1cc48=getCliVersion(),_0x7881e8=buildConfigFromFlags({});await initGlobalEnvironment(_0x7881e8),console[_0x36f4ee(0x19f)](),console[_0x36f4ee(0x19f)](a25_0x246463[_0x36f4ee(0x18c)](CLI_BIN_NAME+_0x36f4ee(0x187))),console[_0x36f4ee(0x19f)](a25_0x246463[_0x36f4ee(0x17f)]('─'[_0x36f4ee(0x1a5)](0x32))),console['log']('\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20'+_0xe1cc48),console[_0x36f4ee(0x19f)](_0x36f4ee(0x1c6)+process[_0x36f4ee(0x1ac)]),console['log'](_0x36f4ee(0x184)+process[_0x36f4ee(0x19c)]+'\x20'+process['arch']),console[_0x36f4ee(0x19f)](),console[_0x36f4ee(0x19f)](a25_0x246463[_0x36f4ee(0x18c)](_0x36f4ee(0x1b2))),console[_0x36f4ee(0x19f)](a25_0x246463[_0x36f4ee(0x17f)]('\x20\x20─'[_0x36f4ee(0x1a5)](0x1e)));const _0x5734ce=getGlobalConfigPath(),_0x1ad29a=getProjectConfigPath();console[_0x36f4ee(0x19f)](_0x36f4ee(0x18b)+(_0x5734ce||a25_0x246463[_0x36f4ee(0x17f)](_0x36f4ee(0x182)))),console[_0x36f4ee(0x19f)](_0x36f4ee(0x1af)+(_0x1ad29a||a25_0x246463[_0x36f4ee(0x17f)](_0x36f4ee(0x182)))),console[_0x36f4ee(0x19f)](),console['log'](a25_0x246463[_0x36f4ee(0x18c)](_0x36f4ee(0x178))),console[_0x36f4ee(0x19f)](a25_0x246463[_0x36f4ee(0x17f)](_0x36f4ee(0x1a8)['repeat'](0x1e)));const _0x295aa5=(_0x3a411f,_0x449889)=>{const _0x13d984=_0x36f4ee;if(!_0x449889){console['log']('\x20\x20'+_0x3a411f[_0x13d984(0x1c2)](0x11)+'\x20'+a25_0x246463[_0x13d984(0x17f)](_0x13d984(0x1a9)));return;}const _0xa44960=inspectCliConfigJsonFile(_0x449889);if(_0xa44960[_0x13d984(0x199)]==='ok')console[_0x13d984(0x19f)]('\x20\x20'+_0x3a411f[_0x13d984(0x1c2)](0x11)+'\x20'+a25_0x246463[_0x13d984(0x18f)](_0x13d984(0x195)));else{if(_0xa44960['status']===_0x13d984(0x194))console[_0x13d984(0x19f)]('\x20\x20'+_0x3a411f[_0x13d984(0x1c2)](0x11)+'\x20'+a25_0x246463[_0x13d984(0x191)]('⚠\x20Empty\x20(treated\x20as\x20{})'));else _0xa44960[_0x13d984(0x199)]==='missing'?console[_0x13d984(0x19f)]('\x20\x20'+_0x3a411f[_0x13d984(0x1c2)](0x11)+'\x20'+a25_0x246463[_0x13d984(0x17f)](_0x13d984(0x1bb))):(console[_0x13d984(0x19f)]('\x20\x20'+_0x3a411f[_0x13d984(0x1c2)](0x11)+'\x20'+a25_0x246463['red'](_0x13d984(0x18d))),console[_0x13d984(0x19f)]('\x20\x20'+''['padEnd'](0x11)+'\x20'+a25_0x246463[_0x13d984(0x197)](_0xa44960['message'])));}};_0x295aa5(_0x36f4ee(0x192),_0x5734ce),_0x295aa5('Project',_0x1ad29a),console[_0x36f4ee(0x19f)](),console[_0x36f4ee(0x19f)](a25_0x246463['bold'](_0x36f4ee(0x193))),console[_0x36f4ee(0x19f)](a25_0x246463['gray']('\x20\x20─'['repeat'](0x1e))),console[_0x36f4ee(0x19f)](_0x36f4ee(0x1c0)+(_0x7881e8[_0x36f4ee(0x19e)]||a25_0x246463[_0x36f4ee(0x197)](_0x36f4ee(0x1ae)))),console[_0x36f4ee(0x19f)](_0x36f4ee(0x189)+_0x7881e8['env']);const _0x9c8033=isLegacyCompatConfigKey(_0x36f4ee(0x19d))?a25_0x246463[_0x36f4ee(0x17f)](_0x7881e8[_0x36f4ee(0x19d)]+_0x36f4ee(0x1b6)):_0x7881e8[_0x36f4ee(0x19d)];console[_0x36f4ee(0x19f)](_0x36f4ee(0x17d)+_0x9c8033),console['log']('\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20'+(_0x7881e8['defaultApp']||a25_0x246463[_0x36f4ee(0x17f)](_0x36f4ee(0x173)))),console[_0x36f4ee(0x19f)](_0x36f4ee(0x1bf)+(_0x7881e8[_0x36f4ee(0x180)]||a25_0x246463[_0x36f4ee(0x17f)]('(none)'))),console[_0x36f4ee(0x19f)](_0x36f4ee(0x1bc)+(_0x7881e8['format']||a25_0x246463[_0x36f4ee(0x17f)](_0x36f4ee(0x174)+DEFAULT_CONFIG_VALUES[_0x36f4ee(0x19b)]+')'))),console[_0x36f4ee(0x19f)](_0x36f4ee(0x1a1)+(_0x7881e8[_0x36f4ee(0x1a3)]??a25_0x246463['gray'](_0x36f4ee(0x1b5)))),console['log'](_0x36f4ee(0x1b7)+_0x7881e8['riskLevel']),console[_0x36f4ee(0x19f)]('\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x7881e8[_0x36f4ee(0x1b9)]),console[_0x36f4ee(0x19f)](_0x36f4ee(0x185)+AUTH_MODE['ClientAk']),console[_0x36f4ee(0x19f)](_0x36f4ee(0x1bd)+(_0x7881e8['accessKey']?a25_0x246463['green'](_0x36f4ee(0x198)+_0x7881e8[_0x36f4ee(0x1ab)][_0x36f4ee(0x177)]+')'):a25_0x246463[_0x36f4ee(0x17f)](_0x36f4ee(0x173)))),console[_0x36f4ee(0x19f)](),console[_0x36f4ee(0x19f)](a25_0x246463['bold']('\x20\x20API\x20Endpoints')),console['log'](a25_0x246463[_0x36f4ee(0x17f)](_0x36f4ee(0x1a8)['repeat'](0x1e))),console[_0x36f4ee(0x19f)](_0x36f4ee(0x1b8)+getApiDomain()),console[_0x36f4ee(0x19f)](_0x36f4ee(0x181)+getUserDomain()),console[_0x36f4ee(0x19f)](_0x36f4ee(0x18e)+getRuntimeDomain()),console[_0x36f4ee(0x19f)](),console[_0x36f4ee(0x19f)](a25_0x246463['bold']('\x20\x20Service\x20Tree')),console[_0x36f4ee(0x19f)](a25_0x246463[_0x36f4ee(0x17f)](_0x36f4ee(0x1a8)[_0x36f4ee(0x1a5)](0x1e)));const _0x5e1f9b=inspectServiceRegistry();console[_0x36f4ee(0x19f)]('\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20'+_0x5e1f9b[_0x36f4ee(0x171)]),console[_0x36f4ee(0x19f)](_0x36f4ee(0x17c)+formatServiceRegistryStatus(_0x5e1f9b)),console['log'](_0x36f4ee(0x1ba)+_0x5e1f9b[_0x36f4ee(0x1a0)]),console[_0x36f4ee(0x19f)](_0x36f4ee(0x175)+_0x5e1f9b[_0x36f4ee(0x17b)]);for(const _0x5df1b5 of _0x5e1f9b[_0x36f4ee(0x1b4)]){console['log']('\x20\x20'+(_0x5df1b5[_0x36f4ee(0x1ad)]+':')['padEnd'](0x11)+'\x20'+(_0x5df1b5[_0x36f4ee(0x1a2)]||a25_0x246463[_0x36f4ee(0x17f)](_0x36f4ee(0x179)))+'\x20('+_0x5df1b5[_0x36f4ee(0x17b)]+_0x36f4ee(0x1b3)),console[_0x36f4ee(0x19f)]('\x20\x20'+''[_0x36f4ee(0x1c2)](0x11)+'\x20Imported\x20from:\x20'+_0x5df1b5['source'][_0x36f4ee(0x19a)]);}return console[_0x36f4ee(0x19f)](),console[_0x36f4ee(0x19f)](a25_0x246463[_0x36f4ee(0x18c)](_0x36f4ee(0x1be))),console[_0x36f4ee(0x19f)](a25_0x246463['gray']('\x20\x20─'[_0x36f4ee(0x1a5)](0x1e))),console[_0x36f4ee(0x19f)](_0x36f4ee(0x1c1)+a25_0x246463['green'](AUTH_MODE[_0x36f4ee(0x196)]+_0x36f4ee(0x1a6))),console['log'](_0x36f4ee(0x17a)+a25_0x246463[_0x36f4ee(0x17f)](_0x36f4ee(0x1a7))),console['log'](),{'ok':!![]};}function formatServiceRegistryStatus(_0x483879){const _0x80dfd2=a25_0x10c8;if(_0x483879['status']==='ok')return a25_0x246463[_0x80dfd2(0x18f)](_0x80dfd2(0x17e));if(_0x483879[_0x80dfd2(0x199)]===_0x80dfd2(0x176))return a25_0x246463['gray'](_0x80dfd2(0x182));if(_0x483879[_0x80dfd2(0x199)]===_0x80dfd2(0x194))return a25_0x246463[_0x80dfd2(0x191)](_0x80dfd2(0x1c4));return a25_0x246463[_0x80dfd2(0x197)](_0x80dfd2(0x18a)+(_0x483879[_0x80dfd2(0x186)]?':\x20'+_0x483879[_0x80dfd2(0x186)]:''));}export const doctorDefinition={'service':'doctor','command':'check','description':a25_0x4ceca6(0x1b0),'risk':a25_0x4ceca6(0x183),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a26_0x1d08(){const _0x57250f=['validation','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','stdin','project','riskLevel','env','defaultApp','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','name','stdout','removeListener','utf8','parse','Override\x20imported\x20default\x20env','once','cancelled','boolean','\x20\x20env:\x20\x20\x20\x20\x20','newConfigFileName','entries','appcode','85024DgGiWi','trim',')\x20instead\x20of\x20project','includes','apiDir','Override\x20imported\x20default\x20appcode','join','close','111qXxHFg','1438899RBUkZO','Initialized\x20','\x20init\x20—\x20Create\x20','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','Failed\x20to\x20parse\x20source\x20file:\x20','Skip\x20confirmation\x20when\x20overwriting','\x22.\x20Allowed:\x20','Imported\x20from\x20','apps','App\x20code\x20cannot\x20be\x20empty.','global','Invalid\x20env\x20\x22','[y/N]','Target\x20environment\x20(default\x20','\x0aInitialized\x20','SIGINT','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','yes','toLowerCase','string','303126rkthVg','app','log','question','860064ldSPXO','960875ytexGK','\x20\x20config:\x20\x20','User\x20aborted\x20prompt','race','):\x20','AbortPrompt','Write\x20to\x20global\x20(~/','\x20\x20appcode:\x20','423672PLViuO','File\x20','\x20\x20default:\x20','file','14164hNPJIy'];a26_0x1d08=function(){return _0x57250f;};return a26_0x1d08();}const a26_0x39e593=a26_0x8510;function a26_0x8510(_0x173703,_0x3757cd){_0x173703=_0x173703-0x75;const _0x1d08d5=a26_0x1d08();let _0x851078=_0x1d08d5[_0x173703];return _0x851078;}(function(_0xecf066,_0x337b08){const _0x9406d7=a26_0x8510,_0x3c61a9=_0xecf066();while(!![]){try{const _0x143cb3=-parseInt(_0x9406d7(0xb6))/0x1+parseInt(_0x9406d7(0x7f))/0x2+-parseInt(_0x9406d7(0xa1))/0x3*(-parseInt(_0x9406d7(0x83))/0x4)+parseInt(_0x9406d7(0x77))/0x5+parseInt(_0x9406d7(0x76))/0x6+-parseInt(_0x9406d7(0xa2))/0x7+-parseInt(_0x9406d7(0x99))/0x8;if(_0x143cb3===_0x337b08)break;else _0x3c61a9['push'](_0x3c61a9['shift']());}catch(_0xc4b8e){_0x3c61a9['push'](_0x3c61a9['shift']());}}}(a26_0x1d08,0x26d55));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a26_0x39e593(0x98),'type':a26_0x39e593(0xb5),'description':'App\x20code\x20for\x20the\x20project'},{'name':a26_0x39e593(0x89),'type':'string','description':a26_0x39e593(0xaf)+DEFAULT_CONFIG_VALUES[a26_0x39e593(0x89)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x39e593(0xac),'type':'boolean','description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a26_0x39e593(0x96)]+a26_0x39e593(0x9b),'default':![]},{'name':a26_0x39e593(0xb3),'type':a26_0x39e593(0x94),'description':a26_0x39e593(0xa7),'default':![]}];export const initImportFlagDefs=[{'name':a26_0x39e593(0x82),'type':a26_0x39e593(0xb5),'description':a26_0x39e593(0xb2),'required':!![]},{'name':a26_0x39e593(0x98),'type':a26_0x39e593(0xb5),'description':a26_0x39e593(0x9e)},{'name':a26_0x39e593(0x89),'type':a26_0x39e593(0xb5),'description':a26_0x39e593(0x91),'enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x39e593(0xac),'type':a26_0x39e593(0x94),'description':a26_0x39e593(0x7d)+PRODUCT_CONFIG[a26_0x39e593(0x96)]+')\x20instead\x20of\x20project','default':![]},{'name':'yes','type':a26_0x39e593(0x94),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x2b989d){const _0x4e8b41=a26_0x39e593,_0x45529a=isNonInteractiveMode(_0x2b989d),_0x372e3c=_0x2b989d['global']?'global':_0x4e8b41(0x87),_0x2afd61=resolveWriteConfigPath(_0x372e3c);try{_0x45529a?await runNonInteractive(_0x2b989d,_0x2afd61):await runInteractive(_0x2b989d,_0x2afd61);}catch(_0x1bb8e2){if(_0x1bb8e2 instanceof AbortPrompt)throw CliErrors[_0x4e8b41(0x93)]();throw _0x1bb8e2;}}export async function runInitImport(_0x13bd6a){const _0x233930=a26_0x39e593,_0x31b08b=_0x13bd6a[_0x233930(0xac)]?_0x233930(0xac):_0x233930(0x87),_0x16ee3e=resolveWriteConfigPath(_0x31b08b);await runFromImport(_0x13bd6a,_0x16ee3e);}const RUNTIME_IRRELEVANT_KEYS=new Set([a26_0x39e593(0x9d)]);async function runFromImport(_0xc2bc6,_0x4c5a2c){const _0x31b287=a26_0x39e593,_0x99cd41=resolveFilePath(_0xc2bc6[_0x31b287(0x82)]);if(!existsSync(_0x99cd41))throw CliErrors['validation']('Source\x20file\x20not\x20found:\x20'+_0x99cd41);const _0x2e23fd=readSourceFile(_0x99cd41),_0x51a6a1=convertToRuntimeConfig(_0x2e23fd);_0xc2bc6[_0x31b287(0x98)]&&(_0x51a6a1[_0x31b287(0x98)]=String(_0xc2bc6[_0x31b287(0x98)]));_0xc2bc6[_0x31b287(0x89)]&&(_0x51a6a1[_0x31b287(0x89)]=resolveInitEnv(_0xc2bc6));if(!_0x51a6a1['appcode'])throw CliErrors['validation']('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.');await writeInitConfig(_0x4c5a2c,_0x51a6a1,_0xc2bc6),console[_0x31b287(0xb8)](_0x31b287(0xa9)+_0x99cd41),console[_0x31b287(0xb8)](_0x31b287(0x78)+_0x4c5a2c),console[_0x31b287(0xb8)](_0x31b287(0x7e)+_0x51a6a1[_0x31b287(0x98)]);if(_0x51a6a1[_0x31b287(0x8a)])console[_0x31b287(0xb8)](_0x31b287(0x81)+_0x51a6a1[_0x31b287(0x8a)]);}function convertToRuntimeConfig(_0x28bece){const _0x1a6b13=a26_0x39e593;if(_0x28bece['apps']&&typeof _0x28bece[_0x1a6b13(0xaa)]==='object')throw CliErrors[_0x1a6b13(0x84)](_0x1a6b13(0x85),_0x1a6b13(0x8b));const _0x1a088a={};for(const _0x358ffa of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x28bece[_0x358ffa]!==undefined&&(_0x1a088a[_0x358ffa]=_0x28bece[_0x358ffa]);}return!_0x1a088a['riskLevel']&&(_0x1a088a[_0x1a6b13(0x88)]=DEFAULT_CONFIG_VALUES[_0x1a6b13(0x88)]),_0x1a088a;}async function runNonInteractive(_0x5ce5db,_0x22d447){const _0x22722b=a26_0x39e593,_0xd8892a=_0x5ce5db[_0x22722b(0x98)];if(!_0xd8892a)throw CliErrors['flagMissing'](_0x22722b(0x98),'Usage:\x20'+CLI_BIN_NAME+_0x22722b(0xa5));const _0x8cf9b8=resolveInitEnv(_0x5ce5db);await writeInitConfig(_0x22d447,{'appcode':_0xd8892a,'env':_0x8cf9b8},_0x5ce5db),console['log'](_0x22722b(0xa3)+_0x22d447),console[_0x22722b(0xb8)](_0x22722b(0x7e)+_0xd8892a),console[_0x22722b(0xb8)](_0x22722b(0x95)+_0x8cf9b8);}async function runInteractive(_0x15f269,_0x4fd9e8){const _0x27c84f=a26_0x39e593,_0x5550a4=loadExisting(_0x4fd9e8),_0x11bf92=typeof _0x5550a4?.[_0x27c84f(0x98)]===_0x27c84f(0xb5)?_0x5550a4[_0x27c84f(0x98)]:'',_0xa8c4b9=resolveInitEnv(_0x15f269);console[_0x27c84f(0xb8)](CLI_BIN_NAME+_0x27c84f(0xa4)+PRODUCT_CONFIG[_0x27c84f(0x96)]+'\x0a');if(existsSync(_0x4fd9e8)&&!_0x15f269[_0x27c84f(0xb3)]){const _0x2a064e=await promptYesNo(_0x27c84f(0x80)+_0x4fd9e8+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x2a064e){console[_0x27c84f(0xb8)]('Aborted.');return;}}const _0x1b34b0=typeof _0x15f269['appcode']===_0x27c84f(0xb5)?_0x15f269[_0x27c84f(0x98)][_0x27c84f(0x9a)]():'';let _0x30b7ed=_0x1b34b0;!_0x30b7ed&&(_0x30b7ed=await promptInput('App\x20code',_0x11bf92));if(!_0x30b7ed[_0x27c84f(0x9a)]())throw CliErrors[_0x27c84f(0x84)](_0x27c84f(0xab));await writeInitConfig(_0x4fd9e8,{'appcode':_0x30b7ed[_0x27c84f(0x9a)](),'env':_0xa8c4b9},_0x15f269),console['log'](_0x27c84f(0xb0)+_0x4fd9e8),console['log'](_0x27c84f(0x7e)+_0x30b7ed[_0x27c84f(0x9a)]()),console['log']('\x20\x20env:\x20\x20\x20\x20\x20'+_0xa8c4b9);}async function writeInitConfig(_0x4d10bd,_0x17650e,_0x4e88b8){const _0x2b9c5e=a26_0x39e593;let _0x32b0e8={};existsSync(_0x4d10bd)&&!_0x4e88b8['yes']&&(_0x32b0e8=readConfigFile(_0x4d10bd));for(const [_0x1eb63b,_0x3c4c38]of Object[_0x2b9c5e(0x97)](_0x17650e)){_0x3c4c38!==undefined&&(_0x32b0e8[_0x1eb63b]=_0x3c4c38);}if(_0x32b0e8[_0x2b9c5e(0xb7)])delete _0x32b0e8['app'];writeConfigFile(_0x4d10bd,_0x32b0e8);}class AbortPrompt extends Error{constructor(){const _0x52560c=a26_0x39e593;super(_0x52560c(0x79)),this[_0x52560c(0x8c)]=_0x52560c(0x7c);}}function createSafeRl(){const _0xb67040=a26_0x39e593,_0x29e729=createInterface({'input':process[_0xb67040(0x86)],'output':process[_0xb67040(0x8d)]});let _0x2ad39e;const _0x470967=new Promise((_0x58a333,_0x4eec4d)=>{const _0x96a652=_0xb67040;_0x2ad39e=()=>{const _0x3b92d9=a26_0x8510;_0x2ad39e&&(_0x29e729[_0x3b92d9(0x8e)]('SIGINT',_0x2ad39e),_0x2ad39e=undefined);try{_0x29e729[_0x3b92d9(0xa0)]();}catch{}_0x4eec4d(new AbortPrompt());},_0x29e729[_0x96a652(0x92)](_0x96a652(0xb1),_0x2ad39e);}),_0x47c37e=()=>{const _0x280df6=_0xb67040;_0x2ad39e&&(_0x29e729[_0x280df6(0x8e)](_0x280df6(0xb1),_0x2ad39e),_0x2ad39e=undefined);try{_0x29e729[_0x280df6(0xa0)]();}catch{}};return{'rl':_0x29e729,'abortPromise':_0x470967,'disposeSuccess':_0x47c37e};}async function promptInput(_0x482558,_0x216ecb){const _0x392517=a26_0x39e593,{rl:_0x1cc6ee,abortPromise:_0x1dabcf,disposeSuccess:_0x2cd116}=createSafeRl(),_0x2b28c7=new Promise(_0x5b4311=>{const _0x32e24e=a26_0x8510,_0x5340f8=_0x216ecb?'\x20\x20'+_0x482558+'\x20('+_0x216ecb+_0x32e24e(0x7b):'\x20\x20'+_0x482558+':\x20';_0x1cc6ee[_0x32e24e(0x75)](_0x5340f8,_0x2d9699=>{const _0x5c82e2=_0x32e24e;_0x2cd116(),_0x5b4311(_0x2d9699[_0x5c82e2(0x9a)]()||_0x216ecb);});});return Promise[_0x392517(0x7a)]([_0x2b28c7,_0x1dabcf]);}async function promptYesNo(_0xa2257,_0x316f10){const _0x8a0a92=a26_0x39e593,{rl:_0x523f91,abortPromise:_0x2e3173,disposeSuccess:_0x3133d6}=createSafeRl(),_0x69e496=new Promise(_0x4412dc=>{const _0x150771=a26_0x8510,_0x505030=_0x316f10?'[Y/n]':_0x150771(0xae);_0x523f91['question']('\x20\x20'+_0xa2257+'\x20'+_0x505030+':\x20',_0x28bc81=>{const _0x5e7d8f=_0x150771;_0x3133d6();const _0x2367c7=_0x28bc81['trim']()[_0x5e7d8f(0xb4)]();if(_0x2367c7==='y'||_0x2367c7===_0x5e7d8f(0xb3))_0x4412dc(!![]);else{if(_0x2367c7==='n'||_0x2367c7==='no')_0x4412dc(![]);else _0x4412dc(_0x316f10);}});});return Promise[_0x8a0a92(0x7a)]([_0x69e496,_0x2e3173]);}function loadExisting(_0x4c18e9){if(!existsSync(_0x4c18e9))return null;return readConfigFile(_0x4c18e9);}function resolveFilePath(_0xa43011){return isAbsolute(_0xa43011)?_0xa43011:resolve(process['cwd'](),_0xa43011);}function readSourceFile(_0x529b9d){const _0x2851d5=a26_0x39e593;try{const _0x4d8225=readFileSync(_0x529b9d,{'encoding':_0x2851d5(0x8f)});return JSON[_0x2851d5(0x90)](_0x4d8225);}catch(_0x52bf99){throw CliErrors[_0x2851d5(0x84)](_0x2851d5(0xa6)+_0x52bf99['message']);}}function resolveInitEnv(_0x516795){const _0x33a7c6=a26_0x39e593,_0x4532a2=_0x516795[_0x33a7c6(0x89)];if(_0x4532a2===undefined||_0x4532a2==='')return DEFAULT_CONFIG_VALUES[_0x33a7c6(0x89)];if(!RUNTIME_ENV_VALUES[_0x33a7c6(0x9c)](_0x4532a2))throw CliErrors[_0x33a7c6(0x84)](_0x33a7c6(0xad)+_0x4532a2+_0x33a7c6(0xa8)+RUNTIME_ENV_VALUES[_0x33a7c6(0x9f)](',\x20'));return _0x4532a2;}
|
|
1
|
+
const a26_0x20a72c=a26_0x1074;(function(_0xf51377,_0x2f9a34){const _0x12446d=a26_0x1074,_0x1758c3=_0xf51377();while(!![]){try{const _0x51617e=-parseInt(_0x12446d(0x231))/0x1+-parseInt(_0x12446d(0x214))/0x2*(parseInt(_0x12446d(0x221))/0x3)+parseInt(_0x12446d(0x1f2))/0x4*(parseInt(_0x12446d(0x1fa))/0x5)+parseInt(_0x12446d(0x21b))/0x6+-parseInt(_0x12446d(0x239))/0x7+-parseInt(_0x12446d(0x226))/0x8*(parseInt(_0x12446d(0x22e))/0x9)+parseInt(_0x12446d(0x238))/0xa;if(_0x51617e===_0x2f9a34)break;else _0x1758c3['push'](_0x1758c3['shift']());}catch(_0x223a1b){_0x1758c3['push'](_0x1758c3['shift']());}}}(a26_0x1e8e,0x2bf40));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';function a26_0x1e8e(){const _0x216e25=['appcode','SIGINT','[Y/n]','includes','yes','\x20\x20config:\x20\x20','3935yMfMQo','project','name','log','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','[y/N]','trim','newConfigFileName','\x20\x20appcode:\x20','boolean','\x22.\x20Allowed:\x20','entries','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','App\x20code\x20cannot\x20be\x20empty.','stdout','file','join','parse','File\x20','App\x20code\x20for\x20the\x20project','\x20init\x20—\x20Create\x20','Imported\x20from\x20','string','env','Invalid\x20env\x20\x22','Override\x20imported\x20default\x20appcode','264332KtPxjB','message','App\x20code','Write\x20to\x20global\x20(~/','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.',')\x20instead\x20of\x20project','Aborted.','2121678AOmmbt','validation','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','removeListener','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','apps','3VvSmpX','flagMissing','close','Source\x20file\x20not\x20found:\x20','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','152tQUSRR','riskLevel','cwd','\x20\x20env:\x20\x20\x20\x20\x20','\x20\x20default:\x20','object','Initialized\x20','app','83385vZDVls','\x0aInitialized\x20','race','281181LaRzut','toLowerCase','Override\x20imported\x20default\x20env','question','Target\x20environment\x20(default\x20','AbortPrompt','defaultApp','3922820jYXlyI','1443995RxhQot','utf8','Skip\x20confirmation\x20when\x20overwriting','global','User\x20aborted\x20prompt','1168nwmAEF','stdin'];a26_0x1e8e=function(){return _0x216e25;};return a26_0x1e8e();}function a26_0x1074(_0x2f78d9,_0x2337b3){_0x2f78d9=_0x2f78d9-0x1ef;const _0x1e8eda=a26_0x1e8e();let _0x107490=_0x1e8eda[_0x2f78d9];return _0x107490;}import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a26_0x20a72c(0x1f4),'type':a26_0x20a72c(0x210),'description':a26_0x20a72c(0x20d)},{'name':a26_0x20a72c(0x211),'type':a26_0x20a72c(0x210),'description':a26_0x20a72c(0x235)+DEFAULT_CONFIG_VALUES['env']+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x20a72c(0x1f0),'type':a26_0x20a72c(0x203),'description':a26_0x20a72c(0x217)+PRODUCT_CONFIG[a26_0x20a72c(0x201)]+a26_0x20a72c(0x219),'default':![]},{'name':'yes','type':a26_0x20a72c(0x203),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':a26_0x20a72c(0x209),'type':a26_0x20a72c(0x210),'description':a26_0x20a72c(0x21f),'required':!![]},{'name':a26_0x20a72c(0x1f4),'type':a26_0x20a72c(0x210),'description':a26_0x20a72c(0x213)},{'name':'env','type':'string','description':a26_0x20a72c(0x233),'enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a26_0x20a72c(0x203),'description':a26_0x20a72c(0x217)+PRODUCT_CONFIG[a26_0x20a72c(0x201)]+')\x20instead\x20of\x20project','default':![]},{'name':a26_0x20a72c(0x1f8),'type':a26_0x20a72c(0x203),'description':a26_0x20a72c(0x1ef),'default':![]}];export async function runInit(_0x59b018){const _0x307505=a26_0x20a72c,_0x22e079=isNonInteractiveMode(_0x59b018),_0x40e892=_0x59b018[_0x307505(0x1f0)]?_0x307505(0x1f0):_0x307505(0x1fb),_0x51dd15=resolveWriteConfigPath(_0x40e892);try{_0x22e079?await runNonInteractive(_0x59b018,_0x51dd15):await runInteractive(_0x59b018,_0x51dd15);}catch(_0x5cb1e8){if(_0x5cb1e8 instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0x5cb1e8;}}export async function runInitImport(_0x198372){const _0x4411ee=a26_0x20a72c,_0x5013f5=_0x198372[_0x4411ee(0x1f0)]?_0x4411ee(0x1f0):_0x4411ee(0x1fb),_0xb66ff7=resolveWriteConfigPath(_0x5013f5);await runFromImport(_0x198372,_0xb66ff7);}const RUNTIME_IRRELEVANT_KEYS=new Set(['apiDir']);async function runFromImport(_0x1e1bba,_0x1f3ef0){const _0x5b181b=a26_0x20a72c,_0x155e17=resolveFilePath(_0x1e1bba[_0x5b181b(0x209)]);if(!existsSync(_0x155e17))throw CliErrors[_0x5b181b(0x21c)](_0x5b181b(0x224)+_0x155e17);const _0x17c9fe=readSourceFile(_0x155e17),_0x551eee=convertToRuntimeConfig(_0x17c9fe);_0x1e1bba[_0x5b181b(0x1f4)]&&(_0x551eee['appcode']=String(_0x1e1bba[_0x5b181b(0x1f4)]));_0x1e1bba[_0x5b181b(0x211)]&&(_0x551eee[_0x5b181b(0x211)]=resolveInitEnv(_0x1e1bba));if(!_0x551eee[_0x5b181b(0x1f4)])throw CliErrors[_0x5b181b(0x21c)](_0x5b181b(0x206),_0x5b181b(0x21d));await writeInitConfig(_0x1f3ef0,_0x551eee,_0x1e1bba),console['log'](_0x5b181b(0x20f)+_0x155e17),console[_0x5b181b(0x1fd)](_0x5b181b(0x1f9)+_0x1f3ef0),console[_0x5b181b(0x1fd)](_0x5b181b(0x202)+_0x551eee[_0x5b181b(0x1f4)]);if(_0x551eee['defaultApp'])console[_0x5b181b(0x1fd)](_0x5b181b(0x22a)+_0x551eee[_0x5b181b(0x237)]);}function convertToRuntimeConfig(_0x5c2dc4){const _0x497321=a26_0x20a72c;if(_0x5c2dc4[_0x497321(0x220)]&&typeof _0x5c2dc4[_0x497321(0x220)]===_0x497321(0x22b))throw CliErrors[_0x497321(0x21c)](_0x497321(0x218),_0x497321(0x225));const _0x5ef876={};for(const _0xfded38 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x5c2dc4[_0xfded38]!==undefined&&(_0x5ef876[_0xfded38]=_0x5c2dc4[_0xfded38]);}return!_0x5ef876[_0x497321(0x227)]&&(_0x5ef876['riskLevel']=DEFAULT_CONFIG_VALUES[_0x497321(0x227)]),_0x5ef876;}async function runNonInteractive(_0x5dc396,_0x465b5b){const _0x3f1a3f=a26_0x20a72c,_0xd2127a=_0x5dc396[_0x3f1a3f(0x1f4)];if(!_0xd2127a)throw CliErrors[_0x3f1a3f(0x222)](_0x3f1a3f(0x1f4),'Usage:\x20'+CLI_BIN_NAME+_0x3f1a3f(0x1fe));const _0x21e11c=resolveInitEnv(_0x5dc396);await writeInitConfig(_0x465b5b,{'appcode':_0xd2127a,'env':_0x21e11c},_0x5dc396),console[_0x3f1a3f(0x1fd)](_0x3f1a3f(0x22c)+_0x465b5b),console[_0x3f1a3f(0x1fd)]('\x20\x20appcode:\x20'+_0xd2127a),console[_0x3f1a3f(0x1fd)](_0x3f1a3f(0x229)+_0x21e11c);}async function runInteractive(_0x26ab22,_0x2dd31f){const _0x3dbf8b=a26_0x20a72c,_0x1a6d28=loadExisting(_0x2dd31f),_0x2fcfb8=typeof _0x1a6d28?.[_0x3dbf8b(0x1f4)]==='string'?_0x1a6d28[_0x3dbf8b(0x1f4)]:'',_0x19fd8f=resolveInitEnv(_0x26ab22);console['log'](CLI_BIN_NAME+_0x3dbf8b(0x20e)+PRODUCT_CONFIG[_0x3dbf8b(0x201)]+'\x0a');if(existsSync(_0x2dd31f)&&!_0x26ab22['yes']){const _0x153715=await promptYesNo(_0x3dbf8b(0x20c)+_0x2dd31f+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x153715){console[_0x3dbf8b(0x1fd)](_0x3dbf8b(0x21a));return;}}const _0x28921b=typeof _0x26ab22[_0x3dbf8b(0x1f4)]==='string'?_0x26ab22[_0x3dbf8b(0x1f4)][_0x3dbf8b(0x200)]():'';let _0x362a15=_0x28921b;!_0x362a15&&(_0x362a15=await promptInput(_0x3dbf8b(0x216),_0x2fcfb8));if(!_0x362a15['trim']())throw CliErrors['validation'](_0x3dbf8b(0x207));await writeInitConfig(_0x2dd31f,{'appcode':_0x362a15['trim'](),'env':_0x19fd8f},_0x26ab22),console[_0x3dbf8b(0x1fd)](_0x3dbf8b(0x22f)+_0x2dd31f),console['log'](_0x3dbf8b(0x202)+_0x362a15[_0x3dbf8b(0x200)]()),console[_0x3dbf8b(0x1fd)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x19fd8f);}async function writeInitConfig(_0x45c814,_0x2785e2,_0x2f1be2){const _0x79d34f=a26_0x20a72c;let _0x1d4f00={};existsSync(_0x45c814)&&!_0x2f1be2[_0x79d34f(0x1f8)]&&(_0x1d4f00=readConfigFile(_0x45c814));for(const [_0x5ee3e7,_0x32f649]of Object[_0x79d34f(0x205)](_0x2785e2)){_0x32f649!==undefined&&(_0x1d4f00[_0x5ee3e7]=_0x32f649);}if(_0x1d4f00[_0x79d34f(0x22d)])delete _0x1d4f00[_0x79d34f(0x22d)];writeConfigFile(_0x45c814,_0x1d4f00);}class AbortPrompt extends Error{constructor(){const _0x448397=a26_0x20a72c;super(_0x448397(0x1f1)),this[_0x448397(0x1fc)]=_0x448397(0x236);}}function createSafeRl(){const _0x56d380=a26_0x20a72c,_0x3784b8=createInterface({'input':process[_0x56d380(0x1f3)],'output':process[_0x56d380(0x208)]});let _0x5ed3e1;const _0x5c1802=new Promise((_0x372e6a,_0x267b69)=>{const _0xe729d1=_0x56d380;_0x5ed3e1=()=>{const _0x708be7=a26_0x1074;_0x5ed3e1&&(_0x3784b8[_0x708be7(0x21e)]('SIGINT',_0x5ed3e1),_0x5ed3e1=undefined);try{_0x3784b8[_0x708be7(0x223)]();}catch{}_0x267b69(new AbortPrompt());},_0x3784b8['once'](_0xe729d1(0x1f5),_0x5ed3e1);}),_0x4778f6=()=>{const _0x527106=_0x56d380;_0x5ed3e1&&(_0x3784b8[_0x527106(0x21e)](_0x527106(0x1f5),_0x5ed3e1),_0x5ed3e1=undefined);try{_0x3784b8[_0x527106(0x223)]();}catch{}};return{'rl':_0x3784b8,'abortPromise':_0x5c1802,'disposeSuccess':_0x4778f6};}async function promptInput(_0x3f9b8a,_0x2c982b){const _0x11d707=a26_0x20a72c,{rl:_0x15b162,abortPromise:_0x12e43d,disposeSuccess:_0xfab01a}=createSafeRl(),_0x5810ce=new Promise(_0x329202=>{const _0x327ada=a26_0x1074,_0x4bf3c9=_0x2c982b?'\x20\x20'+_0x3f9b8a+'\x20('+_0x2c982b+'):\x20':'\x20\x20'+_0x3f9b8a+':\x20';_0x15b162[_0x327ada(0x234)](_0x4bf3c9,_0x61d4f3=>{_0xfab01a(),_0x329202(_0x61d4f3['trim']()||_0x2c982b);});});return Promise[_0x11d707(0x230)]([_0x5810ce,_0x12e43d]);}async function promptYesNo(_0x30c91a,_0x40c4aa){const {rl:_0x555177,abortPromise:_0x324828,disposeSuccess:_0x2a6b1b}=createSafeRl(),_0x5b94d9=new Promise(_0x4464c7=>{const _0x3cac8b=a26_0x1074,_0x2f1620=_0x40c4aa?_0x3cac8b(0x1f6):_0x3cac8b(0x1ff);_0x555177[_0x3cac8b(0x234)]('\x20\x20'+_0x30c91a+'\x20'+_0x2f1620+':\x20',_0x311f06=>{const _0x27e4de=_0x3cac8b;_0x2a6b1b();const _0x41b018=_0x311f06['trim']()[_0x27e4de(0x232)]();if(_0x41b018==='y'||_0x41b018===_0x27e4de(0x1f8))_0x4464c7(!![]);else{if(_0x41b018==='n'||_0x41b018==='no')_0x4464c7(![]);else _0x4464c7(_0x40c4aa);}});});return Promise['race']([_0x5b94d9,_0x324828]);}function loadExisting(_0x168747){if(!existsSync(_0x168747))return null;return readConfigFile(_0x168747);}function resolveFilePath(_0x5a2861){const _0x2ae02b=a26_0x20a72c;return isAbsolute(_0x5a2861)?_0x5a2861:resolve(process[_0x2ae02b(0x228)](),_0x5a2861);}function readSourceFile(_0x24477a){const _0x318ea2=a26_0x20a72c;try{const _0x1534d3=readFileSync(_0x24477a,{'encoding':_0x318ea2(0x23a)});return JSON[_0x318ea2(0x20b)](_0x1534d3);}catch(_0x472815){throw CliErrors[_0x318ea2(0x21c)]('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x472815[_0x318ea2(0x215)]);}}function resolveInitEnv(_0x45e8af){const _0x1a460f=a26_0x20a72c,_0x92f957=_0x45e8af[_0x1a460f(0x211)];if(_0x92f957===undefined||_0x92f957==='')return DEFAULT_CONFIG_VALUES[_0x1a460f(0x211)];if(!RUNTIME_ENV_VALUES[_0x1a460f(0x1f7)](_0x92f957))throw CliErrors[_0x1a460f(0x21c)](_0x1a460f(0x212)+_0x92f957+_0x1a460f(0x204)+RUNTIME_ENV_VALUES[_0x1a460f(0x20a)](',\x20'));return _0x92f957;}
|