@lovrabet/lovrabet-cli 2.1.0-beta.3 → 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
|
-
const
|
|
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_0x4b23ce=a18_0x509a;(function(_0xe402bb,_0x34e61f){const _0x503409=a18_0x509a,_0x4a83d2=_0xe402bb();while(!![]){try{const _0x1a2e2c=parseInt(_0x503409(0x1ee))/0x1*(parseInt(_0x503409(0x1c1))/0x2)+-parseInt(_0x503409(0x1cf))/0x3+-parseInt(_0x503409(0x1eb))/0x4*(parseInt(_0x503409(0x1f6))/0x5)+parseInt(_0x503409(0x1ed))/0x6*(-parseInt(_0x503409(0x1c0))/0x7)+parseInt(_0x503409(0x1cd))/0x8*(-parseInt(_0x503409(0x1ff))/0x9)+parseInt(_0x503409(0x1c5))/0xa*(-parseInt(_0x503409(0x1d2))/0xb)+parseInt(_0x503409(0x1ef))/0xc;if(_0x1a2e2c===_0x34e61f)break;else _0x4a83d2['push'](_0x4a83d2['shift']());}catch(_0x23a722){_0x4a83d2['push'](_0x4a83d2['shift']());}}}(a18_0x1edd,0xd4d1c));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';function a18_0x509a(_0x9fc2e2,_0x2dc7c1){_0x9fc2e2=_0x9fc2e2-0x1bf;const _0x1edda9=a18_0x1edd();let _0x509add=_0x1edda9[_0x9fc2e2];return _0x509add;}function a18_0x1edd(){const _0x975219=['global','pretty','bool','includes','Deleted\x20`','Top-level\x20key\x20\x22','read','272mWZjLN','\x20\x20project:\x20','2987640bAjtxq','field','join','19008847tElOla','pageSize\x20must\x20be\x20a\x20positive\x20number','config','Get\x20a\x20config\x20value','key','get','riskLevel','\x20config\x20get\x20<key>','`\x20=\x20\x22','(none)','Key\x20\x22','appcode','trim','\x20config\x20set\x20<key>\x20<value>\x20[--global]','keys','../../context.js','Usage:\x20','pageSize','Set\x20a\x20config\x20value','Key\x20not\x20found:\x20','args','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','Value\x20to\x20assign','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','Settable\x20keys:\x20','6307348Tdyjot','write','168haEDPw','61043ostJex','71052888MrvCKW','project-or-global-explicit','Missing\x20key\x20argument.','\x20\x20global:\x20\x20','alias','stringify','Set\x20`','5jQDdEZ','log','raw','Missing\x20key\x20or\x20value.','boolean','length','split','apps','validation','86301WBuHkq','\x20(global)','\x22.\x20Allowed:\x20','Delete\x20a\x20config\x20value','format','list','258244IerrTg','20wmjDzn','object','isArray',';\x20apps.<alias>.appcode','10FsnOet'];a18_0x1edd=function(){return _0x975219;};return a18_0x1edd();}import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':a18_0x4b23ce(0x1c6),'type':a18_0x4b23ce(0x1fa),'description':'Write\x20to\x20global\x20config','default':![]};function parseAliasAppcodeSetKey(_0x10b953){const _0xe49110=a18_0x4b23ce,_0xf3e0a2=_0x10b953[_0xe49110(0x1fc)]('.');if(_0xf3e0a2[_0xe49110(0x1fb)]!==0x3||_0xf3e0a2[0x0]!==_0xe49110(0x1fd)||_0xf3e0a2[0x2]!==_0xe49110(0x1dd))return undefined;const _0x25b0c1=_0xf3e0a2[0x1]?.['trim']();return _0x25b0c1?_0x25b0c1:undefined;}function parseAliasDeleteKey(_0x16ee3c){const _0x2ce38a=a18_0x4b23ce,_0x3f7f49=_0x16ee3c[_0x2ce38a(0x1fc)]('.');if(_0x3f7f49['length']===0x2&&_0x3f7f49[0x0]===_0x2ce38a(0x1fd)){const _0x3f03dd=_0x3f7f49[0x1]?.['trim']();return _0x3f03dd?{'alias':_0x3f03dd}:undefined;}if(_0x3f7f49[_0x2ce38a(0x1fb)]===0x3&&_0x3f7f49[0x0]===_0x2ce38a(0x1fd)&&_0x3f7f49[0x2]===_0x2ce38a(0x1dd)){const _0x22c562=_0x3f7f49[0x1]?.[_0x2ce38a(0x1de)]();return _0x22c562?{'alias':_0x22c562,'field':_0x2ce38a(0x1dd)}:undefined;}return undefined;}function setLocalAppAlias(_0x5edadf,_0x4f8179,_0x4086e4){const _0x3175f9=a18_0x4b23ce,_0x3ddcb5=_0x5edadf[_0x3175f9(0x1fd)]&&typeof _0x5edadf[_0x3175f9(0x1fd)]===_0x3175f9(0x1c2)&&!Array['isArray'](_0x5edadf['apps'])?_0x5edadf[_0x3175f9(0x1fd)]:{},_0xff5a47=_0x3ddcb5[_0x4f8179]&&typeof _0x3ddcb5[_0x4f8179]===_0x3175f9(0x1c2)&&!Array[_0x3175f9(0x1c3)](_0x3ddcb5[_0x4f8179])?_0x3ddcb5[_0x4f8179]:{};_0xff5a47['appcode']=_0x4086e4,_0x3ddcb5[_0x4f8179]=_0xff5a47,_0x5edadf['apps']=_0x3ddcb5;}function deleteLocalAppAlias(_0x2ddc04,_0x5f2cbb){const _0x19bf90=a18_0x4b23ce;if(!_0x2ddc04[_0x19bf90(0x1fd)]||typeof _0x2ddc04[_0x19bf90(0x1fd)]!==_0x19bf90(0x1c2)||Array[_0x19bf90(0x1c3)](_0x2ddc04[_0x19bf90(0x1fd)]))return![];const _0x3877d1=_0x2ddc04[_0x19bf90(0x1fd)],_0x3995eb=_0x3877d1[_0x5f2cbb[_0x19bf90(0x1f3)]];if(!_0x3995eb||typeof _0x3995eb!==_0x19bf90(0x1c2)||Array['isArray'](_0x3995eb))return![];if(!_0x5f2cbb[_0x19bf90(0x1d0)])return delete _0x3877d1[_0x5f2cbb['alias']],!![];if(!(_0x5f2cbb[_0x19bf90(0x1d0)]in _0x3995eb))return![];return delete _0x3995eb[_0x5f2cbb[_0x19bf90(0x1d0)]],Object[_0x19bf90(0x1e0)](_0x3995eb)[_0x19bf90(0x1fb)]===0x0&&delete _0x3877d1[_0x5f2cbb[_0x19bf90(0x1f3)]],!![];}const listDef={'service':a18_0x4b23ce(0x1d4),'command':a18_0x4b23ce(0x1bf),'description':'List\x20current\x20config','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x59fd66){const _0xb0ec49=a18_0x4b23ce,{buildConfigFromFlags:_0x1fd9ea}=await import(_0xb0ec49(0x1e1)),_0x2973eb=_0x1fd9ea({}),_0x93acd0=getProjectConfigPath(),_0x7298d5=resolveWriteConfigPath(_0xb0ec49(0x1c6));if(_0x59fd66[_0xb0ec49(0x203)]===_0xb0ec49(0x1c7))return{'ok':!![],'message':'#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a'+(JSON[_0xb0ec49(0x1f4)](_0x2973eb[_0xb0ec49(0x1f8)],null,0x2)+'\x0a\x0a')+'Config\x20files:\x0a'+(_0xb0ec49(0x1ce)+(_0x93acd0??_0xb0ec49(0x1db))+'\x0a')+(_0xb0ec49(0x1f2)+_0x7298d5)};return{'ok':!![],'data':{'effective':_0x2973eb[_0xb0ec49(0x1f8)],'configFiles':{'project':_0x93acd0??null,'global':_0x7298d5}}};}},getDef={'service':a18_0x4b23ce(0x1d4),'command':a18_0x4b23ce(0x1d7),'description':a18_0x4b23ce(0x1d5),'risk':a18_0x4b23ce(0x1cc),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':a18_0x4b23ce(0x1e9),'required':!![]}],'flags':[],async 'execute'(_0x2a029c){const _0x27c1e1=a18_0x4b23ce,_0x5cd295=_0x2a029c['args'][0x0];if(!_0x5cd295)throw CliErrors[_0x27c1e1(0x1fe)](_0x27c1e1(0x1f1),_0x27c1e1(0x1e2)+CLI_BIN_NAME+_0x27c1e1(0x1d9));const {buildConfigFromFlags:_0x408204}=await import(_0x27c1e1(0x1e1)),{raw:_0x248d8b}=_0x408204({});if(_0x5cd295[_0x27c1e1(0x1c9)]('.')){const _0x2d423b=_0x5cd295['split']('.');let _0x3fc2bd=_0x248d8b;for(const _0x5a67e8 of _0x2d423b){if(_0x3fc2bd==null||typeof _0x3fc2bd!==_0x27c1e1(0x1c2))throw CliErrors['validation']('Key\x20not\x20found:\x20'+_0x5cd295);_0x3fc2bd=_0x3fc2bd[_0x5a67e8];}if(_0x3fc2bd===undefined)throw CliErrors['validation'](_0x27c1e1(0x1e5)+_0x5cd295);return console[_0x27c1e1(0x1f7)](typeof _0x3fc2bd===_0x27c1e1(0x1c2)?JSON[_0x27c1e1(0x1f4)](_0x3fc2bd,null,0x2):String(_0x3fc2bd)),{'ok':!![]};}const _0x510b6b=_0x248d8b[_0x5cd295];if(_0x510b6b===undefined)throw CliErrors['validation'](_0x27c1e1(0x1e5)+_0x5cd295);return console[_0x27c1e1(0x1f7)](typeof _0x510b6b===_0x27c1e1(0x1c2)?JSON[_0x27c1e1(0x1f4)](_0x510b6b,null,0x2):String(_0x510b6b)),{'ok':!![]};}},setDef={'service':a18_0x4b23ce(0x1d4),'command':'set','description':a18_0x4b23ce(0x1e4),'risk':a18_0x4b23ce(0x1ec),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x4b23ce(0x1d6),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':'value','description':a18_0x4b23ce(0x1e8),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x425f78){const _0x3c06d8=a18_0x4b23ce,_0x12f37d=_0x425f78[_0x3c06d8(0x1e6)][0x0],_0x3c3744=_0x425f78[_0x3c06d8(0x1e6)][0x1];if(!_0x12f37d||_0x3c3744===undefined)throw CliErrors[_0x3c06d8(0x1fe)](_0x3c06d8(0x1f9),'Usage:\x20'+CLI_BIN_NAME+_0x3c06d8(0x1df));if(ENUM_KEYS[_0x12f37d]&&!ENUM_KEYS[_0x12f37d]['includes'](_0x3c3744))throw CliErrors[_0x3c06d8(0x1fe)]('Invalid\x20value\x20for\x20\x22'+_0x12f37d+_0x3c06d8(0x201)+ENUM_KEYS[_0x12f37d][_0x3c06d8(0x1d1)](',\x20'));if(_0x12f37d===_0x3c06d8(0x1d8))throw CliErrors[_0x3c06d8(0x1fe)](_0x3c06d8(0x1e7));if(_0x12f37d===_0x3c06d8(0x1e3)){const _0x2d563e=Number(_0x3c3744);if(isNaN(_0x2d563e)||_0x2d563e<=0x0)throw CliErrors[_0x3c06d8(0x1fe)](_0x3c06d8(0x1d3));}const _0x19a4b8=resolveWriteScope({'explicitGlobal':_0x425f78[_0x3c06d8(0x1c8)]('global'),'policy':_0x3c06d8(0x1f0)}),_0x43b066=toScopeFlags(_0x19a4b8),_0x358945=readScopedConfig(_0x43b066),_0x10f665=parseAliasAppcodeSetKey(_0x12f37d);if(!_0x10f665&&!isTopLevelConfigKey(_0x12f37d))throw CliErrors[_0x3c06d8(0x1fe)](_0x3c06d8(0x1cb)+_0x12f37d+'\x22\x20is\x20not\x20settable.',_0x3c06d8(0x1ea)+getTopLevelConfigKeySummary()+_0x3c06d8(0x1c4));return _0x10f665?setLocalAppAlias(_0x358945,_0x10f665,_0x3c3744):_0x358945[_0x12f37d]=_0x12f37d===_0x3c06d8(0x1e3)?Number(_0x3c3744):_0x3c3744,console[_0x3c06d8(0x1f7)](_0x3c06d8(0x1f5)+_0x12f37d+_0x3c06d8(0x1da)+_0x3c3744+'\x22'+(_0x19a4b8===_0x3c06d8(0x1c6)?'\x20(global)':'')),writeScopedConfig(_0x358945,_0x43b066),{'ok':!![]};}},deleteDef={'service':a18_0x4b23ce(0x1d4),'command':'delete','description':a18_0x4b23ce(0x202),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x4b23ce(0x1d6),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x251ad9){const _0x5c4630=a18_0x4b23ce,_0x4dbae3=_0x251ad9[_0x5c4630(0x1e6)][0x0];if(!_0x4dbae3)throw CliErrors[_0x5c4630(0x1fe)]('Missing\x20key\x20argument.',_0x5c4630(0x1e2)+CLI_BIN_NAME+'\x20config\x20delete\x20<key>\x20[--global]');const _0x27782c=resolveWriteScope({'explicitGlobal':_0x251ad9[_0x5c4630(0x1c8)]('global'),'policy':_0x5c4630(0x1f0)}),_0x1ead5f=toScopeFlags(_0x27782c),_0xc59a39=readScopedConfig(_0x1ead5f),_0x36cb56=parseAliasDeleteKey(_0x4dbae3);if(_0x36cb56){if(!deleteLocalAppAlias(_0xc59a39,_0x36cb56))throw CliErrors['validation'](_0x5c4630(0x1e5)+_0x4dbae3);return console['log'](_0x5c4630(0x1ca)+_0x4dbae3+'`'+(_0x27782c===_0x5c4630(0x1c6)?_0x5c4630(0x200):'')),writeScopedConfig(_0xc59a39,_0x1ead5f),{'ok':!![]};}if(_0xc59a39[_0x4dbae3]===undefined)throw CliErrors[_0x5c4630(0x1fe)](_0x5c4630(0x1dc)+_0x4dbae3+'\x22\x20not\x20found\x20at\x20top\x20level.');return delete _0xc59a39[_0x4dbae3],console[_0x5c4630(0x1f7)](_0x5c4630(0x1ca)+_0x4dbae3+'`'+(_0x27782c===_0x5c4630(0x1c6)?_0x5c4630(0x200):'')),writeScopedConfig(_0xc59a39,_0x1ead5f),{'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
|
-
|
|
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_0x45adbe=a20_0x7dcf;(function(_0x192fe7,_0x289dee){const _0xef2602=a20_0x7dcf,_0x2e0ded=_0x192fe7();while(!![]){try{const _0xf0c64d=parseInt(_0xef2602(0x211))/0x1+parseInt(_0xef2602(0x208))/0x2*(parseInt(_0xef2602(0x216))/0x3)+-parseInt(_0xef2602(0x1d4))/0x4+parseInt(_0xef2602(0x1e2))/0x5+parseInt(_0xef2602(0x20b))/0x6*(parseInt(_0xef2602(0x1db))/0x7)+-parseInt(_0xef2602(0x1f5))/0x8+parseInt(_0xef2602(0x219))/0x9*(-parseInt(_0xef2602(0x1fd))/0xa);if(_0xf0c64d===_0x289dee)break;else _0x2e0ded['push'](_0x2e0ded['shift']());}catch(_0xa61aa5){_0x2e0ded['push'](_0x2e0ded['shift']());}}}(a20_0x3b01,0xa4364));import{executeData}from'../../core/sdk-client.js';function a20_0x3b01(){const _0x35c164=['\x20\x20LOGICAL\x20COMBINATORS','batchCreate','\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\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','now','risk','\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','\x20completed\x20in\x20','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','\x20\x20\x20\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\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}}','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','\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}','build','write','\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}','2687404YRTHhY','\x20\x20WHERE\x20OPERATORS','paramsHint','data\x20','\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}','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','Get\x20a\x20single\x20record\x20by\x20ID','1190RBTONs','\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\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','Filter\x20dataset\x20records\x20with\x20query\x20conditions','\x20\x20PARAMS\x20STRUCTURE','update','5114100EDvgqT','\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','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','\x20\x20AGGREGATE\x20TYPES','command','Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','join','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','body','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','read','helpExtra','filter','getOne','description','params','10021176sGNGej','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','create','paramsRequired','270zhERja','\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\x20PAGINATION','\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}}','aggregate','\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','\x20\x20\x20\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','/api/{appCode}/','\x20on\x20dataset\x20','data','16fNzRQQ','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','34926gewDXA','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Post-aggregation\x20filters,\x20e.g.\x20[{\x22columnName\x22:\x22total\x22,\x22condition\x22:{\x22$gt\x22:1000}}]','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','\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\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','1057785xxMipB','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','\x20\x20\x20\x20$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}}','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','\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}}','137154rPqSzJ','high-risk-write','Update\x20an\x20existing\x20record','279603JBsrJf','operation','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','Preview:\x20data\x20','dryRun','delete','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','\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_0x3b01=function(){return _0x35c164;};return a20_0x3b01();}function a20_0x7dcf(_0x3422b0,_0x5eacf1){_0x3422b0=_0x3422b0-0x1cb;const _0x3b01d5=a20_0x3b01();let _0x7dcf3f=_0x3b01d5[_0x3422b0];return _0x7dcf3f;}import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':'filter','operation':a20_0x45adbe(0x1f1),'risk':'read','paramsRequired':![],'description':a20_0x45adbe(0x1df),'paramsHint':a20_0x45adbe(0x21f)+a20_0x45adbe(0x1f7),'helpExtra':[a20_0x45adbe(0x1d5),a20_0x45adbe(0x200),a20_0x45adbe(0x215),a20_0x45adbe(0x1dc),a20_0x45adbe(0x227),a20_0x45adbe(0x1e3),a20_0x45adbe(0x1cd),a20_0x45adbe(0x20e),a20_0x45adbe(0x228),a20_0x45adbe(0x1ce),a20_0x45adbe(0x213),'',a20_0x45adbe(0x221),a20_0x45adbe(0x202),a20_0x45adbe(0x1de),'',a20_0x45adbe(0x20f),a20_0x45adbe(0x210),'\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]',a20_0x45adbe(0x1cc),a20_0x45adbe(0x1f6),a20_0x45adbe(0x209),'',a20_0x45adbe(0x1ff),'\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.',a20_0x45adbe(0x20a),'\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)'][a20_0x45adbe(0x1e9)]('\x0a')},{'command':'getOne','operation':a20_0x45adbe(0x1f2),'risk':a20_0x45adbe(0x1ef),'paramsRequired':!![],'description':a20_0x45adbe(0x1da),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a20_0x45adbe(0x1fb),'operation':a20_0x45adbe(0x1fb),'risk':a20_0x45adbe(0x1d2),'paramsRequired':!![],'description':'Create\x20a\x20new\x20record\x20in\x20a\x20dataset','paramsHint':a20_0x45adbe(0x21b)},{'command':a20_0x45adbe(0x222),'operation':a20_0x45adbe(0x222),'risk':a20_0x45adbe(0x1d2),'paramsRequired':!![],'description':a20_0x45adbe(0x1e5),'paramsHint':a20_0x45adbe(0x1cf)},{'command':a20_0x45adbe(0x1e1),'operation':'update','risk':'write','paramsRequired':!![],'description':a20_0x45adbe(0x218),'paramsHint':a20_0x45adbe(0x1f9)},{'command':a20_0x45adbe(0x21e),'operation':a20_0x45adbe(0x21e),'risk':a20_0x45adbe(0x217),'paramsRequired':!![],'description':'Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','paramsHint':a20_0x45adbe(0x1d9)},{'command':a20_0x45adbe(0x201),'operation':a20_0x45adbe(0x201),'risk':a20_0x45adbe(0x1ef),'paramsRequired':![],'description':a20_0x45adbe(0x1ee),'paramsHint':a20_0x45adbe(0x214)+a20_0x45adbe(0x1e8),'helpExtra':[a20_0x45adbe(0x1e6),a20_0x45adbe(0x1d0),a20_0x45adbe(0x1d8),a20_0x45adbe(0x1fe),a20_0x45adbe(0x203),a20_0x45adbe(0x212),a20_0x45adbe(0x220),a20_0x45adbe(0x1d3),'',a20_0x45adbe(0x1e0),a20_0x45adbe(0x223),a20_0x45adbe(0x1ed),a20_0x45adbe(0x224),a20_0x45adbe(0x1dd),a20_0x45adbe(0x20c),a20_0x45adbe(0x1ea),'','\x20\x20EXAMPLES',a20_0x45adbe(0x20d),a20_0x45adbe(0x1fa),'',a20_0x45adbe(0x1f8),'\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_0x45adbe(0x1ec)][a20_0x45adbe(0x1e9)]('\x0a')}];function makeDataCommand(_0x58b800){const _0x3688b1=a20_0x45adbe,_0x3e65cf=_0x3688b1(0x1d7)+_0x58b800['command'],_0x2737bc={'service':_0x3688b1(0x207),'command':_0x58b800[_0x3688b1(0x1e7)],'description':_0x58b800[_0x3688b1(0x1f3)],'risk':_0x58b800['risk'],'helpExtra':_0x58b800[_0x3688b1(0x1f0)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x58b800[_0x3688b1(0x1d6)]}],'validate':async _0x2ddd2b=>{const _0x511686=_0x3688b1;_0x58b800[_0x511686(0x1fc)]&&requireAnyOf(_0x2ddd2b,[_0x511686(0x1f4)],_0x3e65cf),_0x58b800[_0x511686(0x21a)]==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x2ddd2b[_0x511686(0x204)]('params')));},async 'execute'(_0x23aaae){const _0x268d26=_0x3688b1,_0x3570f7=_0x23aaae[_0x268d26(0x204)](_0x268d26(0x1e4)),_0x3051ba=_0x58b800['operation']===_0x268d26(0x222)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x23aaae[_0x268d26(0x204)](_0x268d26(0x1f4)))):parseJsonParams(_0x23aaae[_0x268d26(0x204)](_0x268d26(0x1f4)))??{},_0x8d071f=Date[_0x268d26(0x225)](),_0x2c04a5=await executeData(_0x3570f7,_0x58b800['operation'],_0x3051ba),_0xc2c7b=Date[_0x268d26(0x225)]()-_0x8d071f;return{'ok':!![],'data':{'result':_0x2c04a5,'elapsed':_0xc2c7b},'message':_0x268d26(0x1d7)+_0x58b800[_0x268d26(0x1e7)]+_0x268d26(0x1cb)+_0xc2c7b+'ms'};}};return _0x58b800[_0x3688b1(0x226)]!==_0x3688b1(0x1ef)&&(_0x2737bc[_0x3688b1(0x21d)]=async _0x1fb8b2=>{const _0x33935a=_0x3688b1,_0x3f9140=_0x1fb8b2['str'](_0x33935a(0x1e4)),_0x29c520=_0x58b800[_0x33935a(0x21a)]===_0x33935a(0x222)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x1fb8b2[_0x33935a(0x204)](_0x33935a(0x1f4)))):parseJsonParams(_0x1fb8b2[_0x33935a(0x204)](_0x33935a(0x1f4)))??{};return dryRun('POST',_0x33935a(0x205)+_0x3f9140+'/'+_0x58b800[_0x33935a(0x21a)])[_0x33935a(0x1eb)](_0x29c520)[_0x33935a(0x1f3)](_0x33935a(0x21c)+_0x58b800[_0x33935a(0x1e7)]+_0x33935a(0x206)+_0x3f9140)[_0x33935a(0x1d1)]();}),_0x2737bc;}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
|
-
|
|
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
|
-
const
|
|
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
|
-
function
|
|
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
|
-
const a26_0x434a27=a26_0x18d9;(function(_0x52ac84,_0x318c59){const _0x3ec30b=a26_0x18d9,_0x5cb126=_0x52ac84();while(!![]){try{const _0x275ab7=-parseInt(_0x3ec30b(0xda))/0x1+-parseInt(_0x3ec30b(0xd8))/0x2+-parseInt(_0x3ec30b(0xc8))/0x3+parseInt(_0x3ec30b(0xd9))/0x4+parseInt(_0x3ec30b(0xbb))/0x5*(-parseInt(_0x3ec30b(0xdb))/0x6)+parseInt(_0x3ec30b(0xd6))/0x7*(-parseInt(_0x3ec30b(0xed))/0x8)+-parseInt(_0x3ec30b(0xd1))/0x9*(-parseInt(_0x3ec30b(0xe9))/0xa);if(_0x275ab7===_0x318c59)break;else _0x5cb126['push'](_0x5cb126['shift']());}catch(_0x3b8a47){_0x5cb126['push'](_0x5cb126['shift']());}}}(a26_0xe64c,0x6ad51));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':'appcode','type':a26_0x434a27(0xd3),'description':a26_0x434a27(0xd2)},{'name':a26_0x434a27(0xfd),'type':'string','description':a26_0x434a27(0xc7)+DEFAULT_CONFIG_VALUES[a26_0x434a27(0xfd)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a26_0x434a27(0xf2),'description':a26_0x434a27(0xee)+PRODUCT_CONFIG[a26_0x434a27(0xba)]+a26_0x434a27(0xc4),'default':![]},{'name':a26_0x434a27(0xeb),'type':a26_0x434a27(0xf2),'description':a26_0x434a27(0xce),'default':![]}];export const initImportFlagDefs=[{'name':a26_0x434a27(0xbe),'type':a26_0x434a27(0xd3),'description':a26_0x434a27(0xe4),'required':!![]},{'name':a26_0x434a27(0xc1),'type':a26_0x434a27(0xd3),'description':'Override\x20imported\x20default\x20appcode'},{'name':'env','type':'string','description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x434a27(0xc2),'type':'boolean','description':a26_0x434a27(0xee)+PRODUCT_CONFIG[a26_0x434a27(0xba)]+')\x20instead\x20of\x20project','default':![]},{'name':a26_0x434a27(0xeb),'type':a26_0x434a27(0xf2),'description':a26_0x434a27(0xce),'default':![]}];export async function runInit(_0xe336d9){const _0x3e6ef1=a26_0x434a27,_0x5518c8=isNonInteractiveMode(_0xe336d9),_0x7566db=_0xe336d9['global']?_0x3e6ef1(0xc2):'project',_0x49c5af=resolveWriteConfigPath(_0x7566db);try{_0x5518c8?await runNonInteractive(_0xe336d9,_0x49c5af):await runInteractive(_0xe336d9,_0x49c5af);}catch(_0x2449ca){if(_0x2449ca instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0x2449ca;}}export async function runInitImport(_0x50b33e){const _0x3115d1=a26_0x434a27,_0x25c5ed=_0x50b33e[_0x3115d1(0xc2)]?_0x3115d1(0xc2):_0x3115d1(0xf9),_0x5d4869=resolveWriteConfigPath(_0x25c5ed);await runFromImport(_0x50b33e,_0x5d4869);}const RUNTIME_IRRELEVANT_KEYS=new Set([a26_0x434a27(0xdc)]);async function runFromImport(_0x56f26f,_0x569d21){const _0x9d9a12=a26_0x434a27,_0x3d548e=resolveFilePath(_0x56f26f['file']);if(!existsSync(_0x3d548e))throw CliErrors[_0x9d9a12(0xc5)](_0x9d9a12(0xe7)+_0x3d548e);const _0x200a5d=readSourceFile(_0x3d548e),_0x54ed33=convertToRuntimeConfig(_0x200a5d);_0x56f26f['appcode']&&(_0x54ed33[_0x9d9a12(0xc1)]=String(_0x56f26f[_0x9d9a12(0xc1)]));_0x56f26f['env']&&(_0x54ed33[_0x9d9a12(0xfd)]=resolveInitEnv(_0x56f26f));if(!_0x54ed33[_0x9d9a12(0xc1)])throw CliErrors[_0x9d9a12(0xc5)](_0x9d9a12(0xdd),_0x9d9a12(0xfb));await writeInitConfig(_0x569d21,_0x54ed33,_0x56f26f),console[_0x9d9a12(0xf1)](_0x9d9a12(0xcc)+_0x3d548e),console[_0x9d9a12(0xf1)]('\x20\x20config:\x20\x20'+_0x569d21),console['log'](_0x9d9a12(0xe5)+_0x54ed33['appcode']);if(_0x54ed33['defaultApp'])console[_0x9d9a12(0xf1)](_0x9d9a12(0xf0)+_0x54ed33['defaultApp']);}function convertToRuntimeConfig(_0xbebfc9){const _0x5cc9be=a26_0x434a27;if(_0xbebfc9[_0x5cc9be(0xc0)]&&typeof _0xbebfc9[_0x5cc9be(0xc0)]===_0x5cc9be(0xfc))throw CliErrors[_0x5cc9be(0xc5)](_0x5cc9be(0xca),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x124881={};for(const _0x60e8aa of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0xbebfc9[_0x60e8aa]!==undefined&&(_0x124881[_0x60e8aa]=_0xbebfc9[_0x60e8aa]);}return!_0x124881[_0x5cc9be(0xb9)]&&(_0x124881[_0x5cc9be(0xb9)]=DEFAULT_CONFIG_VALUES[_0x5cc9be(0xb9)]),_0x124881;}function a26_0xe64c(){const _0x4af177=['apiDir','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','\x20\x20env:\x20\x20\x20\x20\x20','utf8','\x0aInitialized\x20','SIGINT','[y/N]','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','\x20\x20appcode:\x20','\x20init\x20—\x20Create\x20','Source\x20file\x20not\x20found:\x20','removeListener','433040rSdlgo','):\x20','yes','toLowerCase','3928PBhoMw','Write\x20to\x20global\x20(~/','entries','\x20\x20default:\x20','log','boolean','trim','app','[Y/n]','includes','stdin','stdout','project','close','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','object','env','AbortPrompt','\x22.\x20Allowed:\x20','User\x20aborted\x20prompt','riskLevel','newConfigFileName','31115KbilFJ','question','once','file','File\x20','apps','appcode','global','parse',')\x20instead\x20of\x20project','validation','race','Target\x20environment\x20(default\x20','1514808raoWOK','Invalid\x20env\x20\x22','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Usage:\x20','Imported\x20from\x20','App\x20code','Skip\x20confirmation\x20when\x20overwriting','App\x20code\x20cannot\x20be\x20empty.','Aborted.','459eYIMov','App\x20code\x20for\x20the\x20project','string','\x20already\x20exists.\x20Overwrite?','join','1505GDTQEe','Initialized\x20','1674314tboGji','1395616EfKtUN','242778FwOcFf','414OEizIs'];a26_0xe64c=function(){return _0x4af177;};return a26_0xe64c();}function a26_0x18d9(_0x40bbd1,_0x3c13ee){_0x40bbd1=_0x40bbd1-0xb6;const _0xe64c4f=a26_0xe64c();let _0x18d91c=_0xe64c4f[_0x40bbd1];return _0x18d91c;}async function runNonInteractive(_0x329645,_0x473b13){const _0x680814=a26_0x434a27,_0x231c2d=_0x329645[_0x680814(0xc1)];if(!_0x231c2d)throw CliErrors['flagMissing'](_0x680814(0xc1),_0x680814(0xcb)+CLI_BIN_NAME+_0x680814(0xe3));const _0x41ea77=resolveInitEnv(_0x329645);await writeInitConfig(_0x473b13,{'appcode':_0x231c2d,'env':_0x41ea77},_0x329645),console['log'](_0x680814(0xd7)+_0x473b13),console['log'](_0x680814(0xe5)+_0x231c2d),console[_0x680814(0xf1)](_0x680814(0xde)+_0x41ea77);}async function runInteractive(_0xe6f716,_0x210bc2){const _0x5dd9ea=a26_0x434a27,_0x5717a0=loadExisting(_0x210bc2),_0x32099d=typeof _0x5717a0?.[_0x5dd9ea(0xc1)]===_0x5dd9ea(0xd3)?_0x5717a0['appcode']:'',_0x4d78fc=resolveInitEnv(_0xe6f716);console[_0x5dd9ea(0xf1)](CLI_BIN_NAME+_0x5dd9ea(0xe6)+PRODUCT_CONFIG[_0x5dd9ea(0xba)]+'\x0a');if(existsSync(_0x210bc2)&&!_0xe6f716[_0x5dd9ea(0xeb)]){const _0x4def80=await promptYesNo(_0x5dd9ea(0xbf)+_0x210bc2+_0x5dd9ea(0xd4),![]);if(!_0x4def80){console[_0x5dd9ea(0xf1)](_0x5dd9ea(0xd0));return;}}const _0x5d4f74=typeof _0xe6f716[_0x5dd9ea(0xc1)]==='string'?_0xe6f716[_0x5dd9ea(0xc1)][_0x5dd9ea(0xf3)]():'';let _0x667572=_0x5d4f74;!_0x667572&&(_0x667572=await promptInput(_0x5dd9ea(0xcd),_0x32099d));if(!_0x667572[_0x5dd9ea(0xf3)]())throw CliErrors[_0x5dd9ea(0xc5)](_0x5dd9ea(0xcf));await writeInitConfig(_0x210bc2,{'appcode':_0x667572[_0x5dd9ea(0xf3)](),'env':_0x4d78fc},_0xe6f716),console[_0x5dd9ea(0xf1)](_0x5dd9ea(0xe0)+_0x210bc2),console[_0x5dd9ea(0xf1)](_0x5dd9ea(0xe5)+_0x667572[_0x5dd9ea(0xf3)]()),console[_0x5dd9ea(0xf1)](_0x5dd9ea(0xde)+_0x4d78fc);}async function writeInitConfig(_0x1b2b7c,_0x438d08,_0x34718d){const _0x1fc631=a26_0x434a27;let _0x350301={};existsSync(_0x1b2b7c)&&!_0x34718d[_0x1fc631(0xeb)]&&(_0x350301=readConfigFile(_0x1b2b7c));for(const [_0x28e904,_0x4bf6d9]of Object[_0x1fc631(0xef)](_0x438d08)){_0x4bf6d9!==undefined&&(_0x350301[_0x28e904]=_0x4bf6d9);}if(_0x350301['app'])delete _0x350301[_0x1fc631(0xf4)];writeConfigFile(_0x1b2b7c,_0x350301);}class AbortPrompt extends Error{constructor(){const _0x404a24=a26_0x434a27;super(_0x404a24(0xb8)),this['name']=_0x404a24(0xb6);}}function createSafeRl(){const _0x588a58=a26_0x434a27,_0x502a93=createInterface({'input':process[_0x588a58(0xf7)],'output':process[_0x588a58(0xf8)]});let _0x5e0c84;const _0x541092=new Promise((_0x124f2f,_0x2d5d93)=>{const _0x29dad0=_0x588a58;_0x5e0c84=()=>{const _0x4ccca0=a26_0x18d9;_0x5e0c84&&(_0x502a93[_0x4ccca0(0xe8)](_0x4ccca0(0xe1),_0x5e0c84),_0x5e0c84=undefined);try{_0x502a93[_0x4ccca0(0xfa)]();}catch{}_0x2d5d93(new AbortPrompt());},_0x502a93[_0x29dad0(0xbd)]('SIGINT',_0x5e0c84);}),_0x47f216=()=>{const _0x44ed19=_0x588a58;_0x5e0c84&&(_0x502a93[_0x44ed19(0xe8)](_0x44ed19(0xe1),_0x5e0c84),_0x5e0c84=undefined);try{_0x502a93[_0x44ed19(0xfa)]();}catch{}};return{'rl':_0x502a93,'abortPromise':_0x541092,'disposeSuccess':_0x47f216};}async function promptInput(_0x39d82c,_0x22ad6e){const _0x1c2a23=a26_0x434a27,{rl:_0x1a4bee,abortPromise:_0x2f7085,disposeSuccess:_0xa533e6}=createSafeRl(),_0x418bf4=new Promise(_0x53ef7b=>{const _0x51887b=a26_0x18d9,_0xf0fc99=_0x22ad6e?'\x20\x20'+_0x39d82c+'\x20('+_0x22ad6e+_0x51887b(0xea):'\x20\x20'+_0x39d82c+':\x20';_0x1a4bee[_0x51887b(0xbc)](_0xf0fc99,_0x47b1ff=>{const _0x3b5b08=_0x51887b;_0xa533e6(),_0x53ef7b(_0x47b1ff[_0x3b5b08(0xf3)]()||_0x22ad6e);});});return Promise[_0x1c2a23(0xc6)]([_0x418bf4,_0x2f7085]);}async function promptYesNo(_0x3ee2a9,_0x300688){const {rl:_0x25651b,abortPromise:_0x21ebb2,disposeSuccess:_0x1c897c}=createSafeRl(),_0x563e10=new Promise(_0x1c3f3f=>{const _0x2b7ea0=a26_0x18d9,_0x3a5d1e=_0x300688?_0x2b7ea0(0xf5):_0x2b7ea0(0xe2);_0x25651b[_0x2b7ea0(0xbc)]('\x20\x20'+_0x3ee2a9+'\x20'+_0x3a5d1e+':\x20',_0x11319b=>{const _0x4c7a2d=_0x2b7ea0;_0x1c897c();const _0x139b47=_0x11319b[_0x4c7a2d(0xf3)]()[_0x4c7a2d(0xec)]();if(_0x139b47==='y'||_0x139b47===_0x4c7a2d(0xeb))_0x1c3f3f(!![]);else{if(_0x139b47==='n'||_0x139b47==='no')_0x1c3f3f(![]);else _0x1c3f3f(_0x300688);}});});return Promise['race']([_0x563e10,_0x21ebb2]);}function loadExisting(_0x3cf734){if(!existsSync(_0x3cf734))return null;return readConfigFile(_0x3cf734);}function resolveFilePath(_0x1dfa55){return isAbsolute(_0x1dfa55)?_0x1dfa55:resolve(process['cwd'](),_0x1dfa55);}function readSourceFile(_0xb02fac){const _0x54755b=a26_0x434a27;try{const _0x2d7b1a=readFileSync(_0xb02fac,{'encoding':_0x54755b(0xdf)});return JSON[_0x54755b(0xc3)](_0x2d7b1a);}catch(_0x13cbb0){throw CliErrors['validation']('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x13cbb0['message']);}}function resolveInitEnv(_0x45fa2e){const _0x16dd8b=a26_0x434a27,_0x2f7e2f=_0x45fa2e[_0x16dd8b(0xfd)];if(_0x2f7e2f===undefined||_0x2f7e2f==='')return DEFAULT_CONFIG_VALUES[_0x16dd8b(0xfd)];if(!RUNTIME_ENV_VALUES[_0x16dd8b(0xf6)](_0x2f7e2f))throw CliErrors[_0x16dd8b(0xc5)](_0x16dd8b(0xc9)+_0x2f7e2f+_0x16dd8b(0xb7)+RUNTIME_ENV_VALUES[_0x16dd8b(0xd5)](',\x20'));return _0x2f7e2f;}
|
|
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;}
|