@lovrabet/lovrabet-cli 2.1.4-beta.1 → 2.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x571e0c,_0x6c676a){const _0x53b306=a15_0x2fb9,_0x325e85=_0x571e0c();while(!![]){try{const _0x3a3287=-parseInt(_0x53b306(0x178))/0x1*(parseInt(_0x53b306(0x176))/0x2)+-parseInt(_0x53b306(0x17d))/0x3+-parseInt(_0x53b306(0x17a))/0x4*(parseInt(_0x53b306(0x18a))/0x5)+parseInt(_0x53b306(0x182))/0x6+parseInt(_0x53b306(0x18d))/0x7*(-parseInt(_0x53b306(0x177))/0x8)+parseInt(_0x53b306(0x18c))/0x9*(-parseInt(_0x53b306(0x186))/0xa)+parseInt(_0x53b306(0x18e))/0xb;if(_0x3a3287===_0x6c676a)break;else _0x325e85['push'](_0x325e85['shift']());}catch(_0x13c562){_0x325e85['push'](_0x325e85['shift']());}}}(a15_0x18c0,0x91b4f));import{CLI_BIN_NAME}from'../../constant/cli.js';function a15_0x2fb9(_0x5824dc,_0x18424b){_0x5824dc=_0x5824dc-0x176;const _0x18c036=a15_0x18c0();let _0x2fb925=_0x18c036[_0x5824dc];return _0x2fb925;}function a15_0x18c0(){const _0x57d313=['62qkTLaT','224888REPwnw','469bJNxVJ','global-default','20UrILhW','\x20found).','validation','3050127KRVhjp','Add\x20--global\x20to\x20write\x20to\x20~/','Flags\x20--global\x20and\x20--project\x20are\x20mutually\x20exclusive.','\x20init`\x20first.','newConfigFileName','475542BkWTVM','project-or-global-explicit','project-default','project','730gpUsYy',',\x20or\x20run\x20`','inProject','global','687550JBFPXX','Not\x20inside\x20a\x20project\x20(no\x20','2349ZJSnTI','294zZvxhS','37796781lfcIvL'];a15_0x18c0=function(){return _0x57d313;};return a15_0x18c0();}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(_0x34eb08){const _0x533db9=a15_0x2fb9,{explicitGlobal:explicitGlobal=![],explicitProject:explicitProject=![],policy:_0x5c4408}=_0x34eb08;if(explicitGlobal&&explicitProject)throw CliErrors[_0x533db9(0x17c)](_0x533db9(0x17f),'Use\x20only\x20one\x20config\x20scope\x20flag.');if(explicitGlobal)return _0x533db9(0x189);if(explicitProject)return'project';switch(_0x5c4408){case _0x533db9(0x179):return _0x533db9(0x189);case _0x533db9(0x184):return _0x34eb08[_0x533db9(0x188)]??isInProject()?'project':_0x533db9(0x189);case _0x533db9(0x183):if(!(_0x34eb08[_0x533db9(0x188)]??isInProject()))throw CliErrors[_0x533db9(0x17c)](_0x533db9(0x18b)+PRODUCT_CONFIG[_0x533db9(0x181)]+_0x533db9(0x17b),_0x533db9(0x17e)+PRODUCT_CONFIG[_0x533db9(0x181)]+_0x533db9(0x187)+CLI_BIN_NAME+_0x533db9(0x180));return _0x533db9(0x185);}}export function toScopeFlags(_0x51ccef){return{'global':_0x51ccef==='global'};}export function formatScopeLabel(_0x25e7b8){const _0x5100eb=a15_0x2fb9;return _0x25e7b8===_0x5100eb(0x189)?'\x20(global)':'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x8f03d2,_0xed54b){const _0x1bb0fb=a16_0x4c5e,_0x5c8711=_0x8f03d2();while(!![]){try{const _0x3a0dea=-parseInt(_0x1bb0fb(0x1a4))/0x1*(-parseInt(_0x1bb0fb(0x196))/0x2)+-parseInt(_0x1bb0fb(0x18c))/0x3*(parseInt(_0x1bb0fb(0x198))/0x4)+-parseInt(_0x1bb0fb(0x19a))/0x5*(-parseInt(_0x1bb0fb(0x195))/0x6)+-parseInt(_0x1bb0fb(0x18e))/0x7+parseInt(_0x1bb0fb(0x1a1))/0x8+-parseInt(_0x1bb0fb(0x199))/0x9+parseInt(_0x1bb0fb(0x191))/0xa;if(_0x3a0dea===_0xed54b)break;else _0x5c8711['push'](_0x5c8711['shift']());}catch(_0x317b62){_0x5c8711['push'](_0x5c8711['shift']());}}}(a16_0x1efc,0x56ad3));import{CliErrors}from'../../errors.js';function a16_0x1efc(){const _0x5c4331=['flag','4134508tECYAj','Remove\x20all\x20but\x20one.','Use\x20only\x20one\x20of:\x20','7995840huiGTG','filter',':\x20expected\x20','join','1354656agVsyb','56890JJwGcz','\x20are\x20mutually\x20exclusive\x20for\x20`','2050388ecKRIj','2026206qMOyyh','10pDFYoj','\x20is\x20allowed,\x20found:\x20','\x20is\x20required\x20for\x20`','Exactly\x20one\x20of\x20','map','validation','Provide\x20one\x20of:\x20','44728kxagpM','str',',\x20got\x20\x22','15MmpoqM','length','Invalid\x20--','3BUajrN'];a16_0x1efc=function(){return _0x5c4331;};return a16_0x1efc();}function isSet(_0x4e7833,_0x14772a){const _0x44162b=a16_0x4c5e,_0x46e7ff=_0x4e7833[_0x44162b(0x18d)](_0x14772a);return _0x46e7ff!==undefined&&_0x46e7ff!==''&&_0x46e7ff!==![]&&_0x46e7ff!==0x0;}function fmtNames(_0x46b5b1){const _0x4c2c8e=a16_0x4c5e;return _0x46b5b1[_0x4c2c8e(0x19e)](_0x21228c=>'--'+_0x21228c)[_0x4c2c8e(0x194)](',\x20');}export function requireOneOf(_0x4f0454,_0x32a1f7,_0xd9d05f){const _0x4a1498=a16_0x4c5e,_0x160cd2=_0x32a1f7[_0x4a1498(0x192)](_0x4bb11d=>isSet(_0x4f0454,_0x4bb11d));if(_0x160cd2[_0x4a1498(0x1a5)]!==0x1)throw CliErrors['validation'](_0x160cd2[_0x4a1498(0x1a5)]===0x0?_0x4a1498(0x19d)+fmtNames(_0x32a1f7)+_0x4a1498(0x19c)+_0xd9d05f+'`.':'Only\x20one\x20of\x20'+fmtNames(_0x32a1f7)+_0x4a1498(0x19b)+fmtNames(_0x160cd2)+'.',_0x160cd2[_0x4a1498(0x1a5)]===0x0?_0x4a1498(0x1a0)+fmtNames(_0x32a1f7):_0x4a1498(0x18f));}function a16_0x4c5e(_0x154dba,_0x557ab6){_0x154dba=_0x154dba-0x18b;const _0x1efc22=a16_0x1efc();let _0x4c5e58=_0x1efc22[_0x154dba];return _0x4c5e58;}export function requireAnyOf(_0x547c12,_0x47a13f,_0x532fba){const _0x5b051d=a16_0x4c5e;if(!_0x47a13f['some'](_0xb09019=>isSet(_0x547c12,_0xb09019)))throw CliErrors['validation']('At\x20least\x20one\x20of\x20'+fmtNames(_0x47a13f)+_0x5b051d(0x19c)+_0x532fba+'`.',_0x5b051d(0x1a0)+fmtNames(_0x47a13f));}export function mutuallyExclusive(_0x4c0234,_0xee3efd,_0x4ca8af){const _0x379857=a16_0x4c5e,_0x3f3baf=_0xee3efd[_0x379857(0x192)](_0x24d02a=>isSet(_0x4c0234,_0x24d02a));if(_0x3f3baf[_0x379857(0x1a5)]>0x1)throw CliErrors[_0x379857(0x19f)]('Flags\x20'+fmtNames(_0x3f3baf)+_0x379857(0x197)+_0x4ca8af+'`.',_0x379857(0x190)+fmtNames(_0xee3efd));}export function validatePattern(_0x466b27,_0x1b48b3,_0x2d31b2,_0x249aa8){const _0x46050b=a16_0x4c5e,_0x14436d=_0x466b27[_0x46050b(0x1a2)](_0x1b48b3);if(_0x14436d&&!_0x2d31b2['test'](_0x14436d))throw CliErrors['validation'](_0x46050b(0x18b)+_0x1b48b3+_0x46050b(0x193)+_0x249aa8+_0x46050b(0x1a3)+_0x14436d+'\x22.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a17_0x36e7d7=a17_0xa1cd;(function(_0x9a4573,_0x42d473){const _0x2f752f=a17_0xa1cd,_0x59c993=_0x9a4573();while(!![]){try{const _0x2b69c7=-parseInt(_0x2f752f(0x191))/0x1*(-parseInt(_0x2f752f(0x188))/0x2)+-parseInt(_0x2f752f(0x18e))/0x3+-parseInt(_0x2f752f(0x194))/0x4+parseInt(_0x2f752f(0x19a))/0x5+-parseInt(_0x2f752f(0x190))/0x6+-parseInt(_0x2f752f(0x195))/0x7+-parseInt(_0x2f752f(0x193))/0x8*(-parseInt(_0x2f752f(0x199))/0x9);if(_0x2b69c7===_0x42d473)break;else _0x59c993['push'](_0x59c993['shift']());}catch(_0x1a1b5a){_0x59c993['push'](_0x59c993['shift']());}}}(a17_0x14ad,0x94f3f));export const CODE_FLAG={'name':a17_0x36e7d7(0x18c),'type':a17_0x36e7d7(0x18b),'required':!![],'description':a17_0x36e7d7(0x18d),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a17_0x36e7d7(0x192)}};function a17_0x14ad(){const _0x10a2af=['3VEJptP','a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)','1339216CDmDxi','561780hWKkYN','4333238histMU','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','number','Resource\x20name\x20for\x20lookup','54ABVkXL','6026570HFtDYT','params','sqlcode','271582XCZDsC','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','Return\x20full\x20raw\x20response\x20object','string','code','Dataset\x20code\x20(32-char\x20hex\x20UUID)','3187791teLqge','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','1109472RRXdhf'];a17_0x14ad=function(){return _0x10a2af;};return a17_0x14ad();}export const SQLCODE_FLAG={'name':a17_0x36e7d7(0x187),'type':a17_0x36e7d7(0x18b),'required':!![],'description':a17_0x36e7d7(0x196),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a17_0x36e7d7(0x18f)}};export const VERBOSE_FLAG={'name':'verbose','type':'boolean','description':a17_0x36e7d7(0x18a)};export const PARAMS_FLAG={'name':a17_0x36e7d7(0x19b),'type':a17_0x36e7d7(0x18b),'description':a17_0x36e7d7(0x189)};export const NAME_FLAG={'name':'name','type':a17_0x36e7d7(0x18b),'description':a17_0x36e7d7(0x198)};function a17_0xa1cd(_0x20e3d6,_0xdc9aa){_0x20e3d6=_0x20e3d6-0x187;const _0x14ad9f=a17_0x14ad();let _0xa1cdb6=_0x14ad9f[_0x20e3d6];return _0xa1cdb6;}export const ID_FLAG={'name':'id','type':a17_0x36e7d7(0x197),'required':!![],'description':'Resource\x20ID'};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a18_0x2b5ddd=a18_0x2fc4;(function(_0x31d91b,_0x4fbe3c){const _0x4e80fc=a18_0x2fc4,_0x22eb20=_0x31d91b();while(!![]){try{const _0x319238=-parseInt(_0x4e80fc(0x1e1))/0x1*(parseInt(_0x4e80fc(0x1e6))/0x2)+-parseInt(_0x4e80fc(0x1e8))/0x3*(parseInt(_0x4e80fc(0x1e7))/0x4)+-parseInt(_0x4e80fc(0x1c9))/0x5*(parseInt(_0x4e80fc(0x1d4))/0x6)+parseInt(_0x4e80fc(0x207))/0x7+parseInt(_0x4e80fc(0x1e2))/0x8+parseInt(_0x4e80fc(0x1f9))/0x9*(parseInt(_0x4e80fc(0x1fd))/0xa)+-parseInt(_0x4e80fc(0x1f1))/0xb;if(_0x319238===_0x4fbe3c)break;else _0x22eb20['push'](_0x22eb20['shift']());}catch(_0x3f5341){_0x22eb20['push'](_0x22eb20['shift']());}}}(a18_0x3884,0xdd2f8));function a18_0x2fc4(_0x1b3320,_0x377c4e){_0x1b3320=_0x1b3320-0x1c6;const _0x388456=a18_0x3884();let _0x2fc416=_0x388456[_0x1b3320];return _0x2fc416;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':'global','type':'boolean','description':a18_0x2b5ddd(0x1f3),'default':![]};function parseAliasAppcodeSetKey(_0x38789d){const _0xffab5d=a18_0x2b5ddd,_0xc8332a=_0x38789d[_0xffab5d(0x1f8)]('.');if(_0xc8332a['length']!==0x3||_0xc8332a[0x0]!==_0xffab5d(0x1ed)||_0xc8332a[0x2]!==_0xffab5d(0x1c6))return undefined;const _0x13c139=_0xc8332a[0x1]?.['trim']();return _0x13c139?_0x13c139:undefined;}function a18_0x3884(){const _0x3fe28f=['pageSize\x20must\x20be\x20a\x20positive\x20number','write','List\x20current\x20config','Delete\x20a\x20config\x20value','includes','1VUZzmf','14188912DwTgVp','Get\x20a\x20config\x20value','isArray','log','1585074TxlxLz','3148IwZSqk','2637XxsadM','join','global','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','pageSize','apps','project-or-global-explicit','Usage:\x20','Invalid\x20value\x20for\x20\x22','9031671kyqNNe','\x22\x20is\x20not\x20settable.','Write\x20to\x20global\x20config','value','field','\x20(global)','config','split','27YyMVNO','keys','bool','format','3199210IEZOJm','alias','\x20config\x20get\x20<key>','../../context.js','riskLevel','get','list','Missing\x20key\x20argument.','\x20\x20global:\x20\x20','\x20config\x20set\x20<key>\x20<value>\x20[--global]','6631072moCjzQ','Top-level\x20key\x20\x22','appcode','raw','\x20\x20project:\x20','4290nbqamV','args','(none)','stringify','read','Set\x20`','Key\x20\x22','validation','Set\x20a\x20config\x20value','object','length','3282kKFyXY','key','Key\x20not\x20found:\x20','set','Deleted\x20`','trim','pretty','Config\x20files:\x0a'];a18_0x3884=function(){return _0x3fe28f;};return a18_0x3884();}function parseAliasDeleteKey(_0x66fb9a){const _0x3a5ec7=a18_0x2b5ddd,_0x59e323=_0x66fb9a['split']('.');if(_0x59e323['length']===0x2&&_0x59e323[0x0]==='apps'){const _0x20a40f=_0x59e323[0x1]?.[_0x3a5ec7(0x1d9)]();return _0x20a40f?{'alias':_0x20a40f}:undefined;}if(_0x59e323[_0x3a5ec7(0x1d3)]===0x3&&_0x59e323[0x0]===_0x3a5ec7(0x1ed)&&_0x59e323[0x2]===_0x3a5ec7(0x1c6)){const _0x45c1ba=_0x59e323[0x1]?.['trim']();return _0x45c1ba?{'alias':_0x45c1ba,'field':_0x3a5ec7(0x1c6)}:undefined;}return undefined;}function setLocalAppAlias(_0xcc136a,_0x40f127,_0x2a6c44){const _0x58ddb7=a18_0x2b5ddd,_0x4b150a=_0xcc136a[_0x58ddb7(0x1ed)]&&typeof _0xcc136a[_0x58ddb7(0x1ed)]===_0x58ddb7(0x1d2)&&!Array[_0x58ddb7(0x1e4)](_0xcc136a[_0x58ddb7(0x1ed)])?_0xcc136a[_0x58ddb7(0x1ed)]:{},_0x4905fb=_0x4b150a[_0x40f127]&&typeof _0x4b150a[_0x40f127]===_0x58ddb7(0x1d2)&&!Array[_0x58ddb7(0x1e4)](_0x4b150a[_0x40f127])?_0x4b150a[_0x40f127]:{};_0x4905fb['appcode']=_0x2a6c44,_0x4b150a[_0x40f127]=_0x4905fb,_0xcc136a[_0x58ddb7(0x1ed)]=_0x4b150a;}function deleteLocalAppAlias(_0x3fcd18,_0x2118ef){const _0x3f5925=a18_0x2b5ddd;if(!_0x3fcd18[_0x3f5925(0x1ed)]||typeof _0x3fcd18[_0x3f5925(0x1ed)]!==_0x3f5925(0x1d2)||Array['isArray'](_0x3fcd18[_0x3f5925(0x1ed)]))return![];const _0x36fa12=_0x3fcd18[_0x3f5925(0x1ed)],_0x2120da=_0x36fa12[_0x2118ef[_0x3f5925(0x1fe)]];if(!_0x2120da||typeof _0x2120da!=='object'||Array[_0x3f5925(0x1e4)](_0x2120da))return![];if(!_0x2118ef['field'])return delete _0x36fa12[_0x2118ef[_0x3f5925(0x1fe)]],!![];if(!(_0x2118ef[_0x3f5925(0x1f5)]in _0x2120da))return![];return delete _0x2120da[_0x2118ef[_0x3f5925(0x1f5)]],Object[_0x3f5925(0x1fa)](_0x2120da)[_0x3f5925(0x1d3)]===0x0&&delete _0x36fa12[_0x2118ef[_0x3f5925(0x1fe)]],!![];}const listDef={'service':a18_0x2b5ddd(0x1f7),'command':a18_0x2b5ddd(0x203),'description':a18_0x2b5ddd(0x1de),'risk':a18_0x2b5ddd(0x1cd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x29703e){const _0x58734e=a18_0x2b5ddd,{buildConfigFromFlags:_0x141cb2}=await import('../../context.js'),_0x2493aa=_0x141cb2({}),_0x351e3e=getProjectConfigPath(),_0x5b9291=resolveWriteConfigPath('global');if(_0x29703e[_0x58734e(0x1fc)]===_0x58734e(0x1da))return{'ok':!![],'message':'#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a'+(JSON[_0x58734e(0x1cc)](_0x2493aa['raw'],null,0x2)+'\x0a\x0a')+_0x58734e(0x1db)+(_0x58734e(0x1c8)+(_0x351e3e??_0x58734e(0x1cb))+'\x0a')+(_0x58734e(0x205)+_0x5b9291)};return{'ok':!![],'data':{'effective':_0x2493aa[_0x58734e(0x1c7)],'configFiles':{'project':_0x351e3e??null,'global':_0x5b9291}}};}},getDef={'service':a18_0x2b5ddd(0x1f7),'command':a18_0x2b5ddd(0x202),'description':a18_0x2b5ddd(0x1e3),'risk':a18_0x2b5ddd(0x1cd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':a18_0x2b5ddd(0x1eb),'required':!![]}],'flags':[],async 'execute'(_0x5edd62){const _0x5ae0f1=a18_0x2b5ddd,_0x205ef0=_0x5edd62[_0x5ae0f1(0x1ca)][0x0];if(!_0x205ef0)throw CliErrors[_0x5ae0f1(0x1d0)](_0x5ae0f1(0x204),_0x5ae0f1(0x1ef)+CLI_BIN_NAME+_0x5ae0f1(0x1ff));const {buildConfigFromFlags:_0x518c2b}=await import(_0x5ae0f1(0x200)),{raw:_0x16a67b}=_0x518c2b({});if(_0x205ef0[_0x5ae0f1(0x1e0)]('.')){const _0x4caaaa=_0x205ef0[_0x5ae0f1(0x1f8)]('.');let _0x11b6e1=_0x16a67b;for(const _0x1ebbfd of _0x4caaaa){if(_0x11b6e1==null||typeof _0x11b6e1!==_0x5ae0f1(0x1d2))throw CliErrors[_0x5ae0f1(0x1d0)](_0x5ae0f1(0x1d6)+_0x205ef0);_0x11b6e1=_0x11b6e1[_0x1ebbfd];}if(_0x11b6e1===undefined)throw CliErrors[_0x5ae0f1(0x1d0)]('Key\x20not\x20found:\x20'+_0x205ef0);return console['log'](typeof _0x11b6e1===_0x5ae0f1(0x1d2)?JSON[_0x5ae0f1(0x1cc)](_0x11b6e1,null,0x2):String(_0x11b6e1)),{'ok':!![]};}const _0x5dcbe2=_0x16a67b[_0x205ef0];if(_0x5dcbe2===undefined)throw CliErrors['validation'](_0x5ae0f1(0x1d6)+_0x205ef0);return console['log'](typeof _0x5dcbe2==='object'?JSON[_0x5ae0f1(0x1cc)](_0x5dcbe2,null,0x2):String(_0x5dcbe2)),{'ok':!![]};}},setDef={'service':a18_0x2b5ddd(0x1f7),'command':a18_0x2b5ddd(0x1d7),'description':a18_0x2b5ddd(0x1d1),'risk':a18_0x2b5ddd(0x1dd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x2b5ddd(0x1d5),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a18_0x2b5ddd(0x1f4),'description':'Value\x20to\x20assign','required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x4ee9b8){const _0x32cc69=a18_0x2b5ddd,_0xec481f=_0x4ee9b8['args'][0x0],_0x4a0e29=_0x4ee9b8[_0x32cc69(0x1ca)][0x1];if(!_0xec481f||_0x4a0e29===undefined)throw CliErrors[_0x32cc69(0x1d0)]('Missing\x20key\x20or\x20value.','Usage:\x20'+CLI_BIN_NAME+_0x32cc69(0x206));if(ENUM_KEYS[_0xec481f]&&!ENUM_KEYS[_0xec481f][_0x32cc69(0x1e0)](_0x4a0e29))throw CliErrors[_0x32cc69(0x1d0)](_0x32cc69(0x1f0)+_0xec481f+'\x22.\x20Allowed:\x20'+ENUM_KEYS[_0xec481f][_0x32cc69(0x1e9)](',\x20'));if(_0xec481f===_0x32cc69(0x201))throw CliErrors[_0x32cc69(0x1d0)]('\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.');if(_0xec481f===_0x32cc69(0x1ec)){const _0x179a5d=Number(_0x4a0e29);if(isNaN(_0x179a5d)||_0x179a5d<=0x0)throw CliErrors['validation'](_0x32cc69(0x1dc));}const _0x51037c=resolveWriteScope({'explicitGlobal':_0x4ee9b8[_0x32cc69(0x1fb)]('global'),'policy':_0x32cc69(0x1ee)}),_0x5dfd9e=toScopeFlags(_0x51037c),_0xbb8232=readScopedConfig(_0x5dfd9e),_0x1b211f=parseAliasAppcodeSetKey(_0xec481f);if(!_0x1b211f&&!isTopLevelConfigKey(_0xec481f))throw CliErrors['validation'](_0x32cc69(0x208)+_0xec481f+_0x32cc69(0x1f2),'Settable\x20keys:\x20'+getTopLevelConfigKeySummary()+';\x20apps.<alias>.appcode');return _0x1b211f?setLocalAppAlias(_0xbb8232,_0x1b211f,_0x4a0e29):_0xbb8232[_0xec481f]=_0xec481f===_0x32cc69(0x1ec)?Number(_0x4a0e29):_0x4a0e29,console[_0x32cc69(0x1e5)](_0x32cc69(0x1ce)+_0xec481f+'`\x20=\x20\x22'+_0x4a0e29+'\x22'+(_0x51037c===_0x32cc69(0x1ea)?_0x32cc69(0x1f6):'')),writeScopedConfig(_0xbb8232,_0x5dfd9e),{'ok':!![]};}},deleteDef={'service':a18_0x2b5ddd(0x1f7),'command':'delete','description':a18_0x2b5ddd(0x1df),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x2b5ddd(0x1d5),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x1366df){const _0x161509=a18_0x2b5ddd,_0xa41520=_0x1366df[_0x161509(0x1ca)][0x0];if(!_0xa41520)throw CliErrors[_0x161509(0x1d0)](_0x161509(0x204),_0x161509(0x1ef)+CLI_BIN_NAME+'\x20config\x20delete\x20<key>\x20[--global]');const _0x588419=resolveWriteScope({'explicitGlobal':_0x1366df[_0x161509(0x1fb)](_0x161509(0x1ea)),'policy':_0x161509(0x1ee)}),_0x5845ef=toScopeFlags(_0x588419),_0x52d467=readScopedConfig(_0x5845ef),_0x176566=parseAliasDeleteKey(_0xa41520);if(_0x176566){if(!deleteLocalAppAlias(_0x52d467,_0x176566))throw CliErrors['validation']('Key\x20not\x20found:\x20'+_0xa41520);return console[_0x161509(0x1e5)](_0x161509(0x1d8)+_0xa41520+'`'+(_0x588419===_0x161509(0x1ea)?_0x161509(0x1f6):'')),writeScopedConfig(_0x52d467,_0x5845ef),{'ok':!![]};}if(_0x52d467[_0xa41520]===undefined)throw CliErrors['validation'](_0x161509(0x1cf)+_0xa41520+'\x22\x20not\x20found\x20at\x20top\x20level.');return delete _0x52d467[_0xa41520],console[_0x161509(0x1e5)](_0x161509(0x1d8)+_0xa41520+'`'+(_0x588419===_0x161509(0x1ea)?_0x161509(0x1f6):'')),writeScopedConfig(_0x52d467,_0x5845ef),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
1
|
+
const a18_0x375681=a18_0x5a47;function a18_0x2203(){const _0xde847a=['length','Key\x20not\x20found:\x20','Missing\x20key\x20argument.','split','raw','7554660sLxZbr','stringify','alias','4107120manveK','`\x20=\x20\x22','20426832itSZvg','(none)','Delete\x20a\x20config\x20value','log','Write\x20to\x20global\x20config','appcode','trim','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','27739bpewHu','join','5857152UYUBOc','2824410YTYarG','pageSize','Deleted\x20`','36rXoRVK','Value\x20to\x20assign','read','boolean','isArray','Missing\x20key\x20or\x20value.','includes','\x22.\x20Allowed:\x20','global','delete','\x22\x20is\x20not\x20settable.',';\x20apps.<alias>.appcode','write','field','List\x20current\x20config','pageSize\x20must\x20be\x20a\x20positive\x20number','keys','config','project-or-global-explicit','Set\x20a\x20config\x20value','args','pretty','Usage:\x20','Key\x20\x22','\x20config\x20get\x20<key>','6508964fRGJpq','validation','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','value','Invalid\x20value\x20for\x20\x22','riskLevel','apps','object','Top-level\x20key\x20\x22','bool','\x20config\x20set\x20<key>\x20<value>\x20[--global]','key','\x22\x20not\x20found\x20at\x20top\x20level.','\x20(global)','list','\x20\x20global:\x20\x20','../../context.js','Settable\x20keys:\x20','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.'];a18_0x2203=function(){return _0xde847a;};return a18_0x2203();}(function(_0x3ee1d5,_0x24350b){const _0x6b753f=a18_0x5a47,_0x4d3e97=_0x3ee1d5();while(!![]){try{const _0x56acc4=-parseInt(_0x6b753f(0x1d4))/0x1*(parseInt(_0x6b753f(0x1da))/0x2)+-parseInt(_0x6b753f(0x1d7))/0x3+-parseInt(_0x6b753f(0x1d6))/0x4+parseInt(_0x6b753f(0x20b))/0x5+parseInt(_0x6b753f(0x20e))/0x6+-parseInt(_0x6b753f(0x1f3))/0x7+parseInt(_0x6b753f(0x210))/0x8;if(_0x56acc4===_0x24350b)break;else _0x4d3e97['push'](_0x4d3e97['shift']());}catch(_0x11a8e2){_0x4d3e97['push'](_0x4d3e97['shift']());}}}(a18_0x2203,0xdf1e6));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':a18_0x375681(0x1e2),'type':a18_0x375681(0x1dd),'description':a18_0x375681(0x214),'default':![]};function parseAliasAppcodeSetKey(_0xa73950){const _0x1a5a83=a18_0x375681,_0x109011=_0xa73950[_0x1a5a83(0x209)]('.');if(_0x109011[_0x1a5a83(0x206)]!==0x3||_0x109011[0x0]!==_0x1a5a83(0x1f9)||_0x109011[0x2]!==_0x1a5a83(0x1d1))return undefined;const _0xd35838=_0x109011[0x1]?.[_0x1a5a83(0x1d2)]();return _0xd35838?_0xd35838:undefined;}function parseAliasDeleteKey(_0x326b2e){const _0x595ec0=a18_0x375681,_0x224d5a=_0x326b2e[_0x595ec0(0x209)]('.');if(_0x224d5a[_0x595ec0(0x206)]===0x2&&_0x224d5a[0x0]==='apps'){const _0x4503fb=_0x224d5a[0x1]?.['trim']();return _0x4503fb?{'alias':_0x4503fb}:undefined;}if(_0x224d5a['length']===0x3&&_0x224d5a[0x0]===_0x595ec0(0x1f9)&&_0x224d5a[0x2]===_0x595ec0(0x1d1)){const _0x2e6084=_0x224d5a[0x1]?.[_0x595ec0(0x1d2)]();return _0x2e6084?{'alias':_0x2e6084,'field':'appcode'}:undefined;}return undefined;}function setLocalAppAlias(_0x22123c,_0x2f368b,_0x4c242){const _0x169c41=a18_0x375681,_0x34e8ec=_0x22123c[_0x169c41(0x1f9)]&&typeof _0x22123c[_0x169c41(0x1f9)]==='object'&&!Array['isArray'](_0x22123c['apps'])?_0x22123c['apps']:{},_0xe06910=_0x34e8ec[_0x2f368b]&&typeof _0x34e8ec[_0x2f368b]===_0x169c41(0x1fa)&&!Array[_0x169c41(0x1de)](_0x34e8ec[_0x2f368b])?_0x34e8ec[_0x2f368b]:{};_0xe06910['appcode']=_0x4c242,_0x34e8ec[_0x2f368b]=_0xe06910,_0x22123c[_0x169c41(0x1f9)]=_0x34e8ec;}function deleteLocalAppAlias(_0x2e1f28,_0x44c2ef){const _0x3c836a=a18_0x375681;if(!_0x2e1f28[_0x3c836a(0x1f9)]||typeof _0x2e1f28[_0x3c836a(0x1f9)]!==_0x3c836a(0x1fa)||Array['isArray'](_0x2e1f28[_0x3c836a(0x1f9)]))return![];const _0x8d3d43=_0x2e1f28[_0x3c836a(0x1f9)],_0x117407=_0x8d3d43[_0x44c2ef[_0x3c836a(0x20d)]];if(!_0x117407||typeof _0x117407!==_0x3c836a(0x1fa)||Array[_0x3c836a(0x1de)](_0x117407))return![];if(!_0x44c2ef['field'])return delete _0x8d3d43[_0x44c2ef[_0x3c836a(0x20d)]],!![];if(!(_0x44c2ef[_0x3c836a(0x1e7)]in _0x117407))return![];return delete _0x117407[_0x44c2ef[_0x3c836a(0x1e7)]],Object[_0x3c836a(0x1ea)](_0x117407)[_0x3c836a(0x206)]===0x0&&delete _0x8d3d43[_0x44c2ef[_0x3c836a(0x20d)]],!![];}const listDef={'service':a18_0x375681(0x1eb),'command':a18_0x375681(0x201),'description':a18_0x375681(0x1e8),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x154a79){const _0x482784=a18_0x375681,{buildConfigFromFlags:_0x6a1183}=await import(_0x482784(0x203)),_0x102bf3=_0x6a1183({}),_0x2425ec=getProjectConfigPath(),_0x4be673=resolveWriteConfigPath(_0x482784(0x1e2));if(_0x154a79['format']===_0x482784(0x1ef))return{'ok':!![],'message':_0x482784(0x1d3)+(JSON[_0x482784(0x20c)](_0x102bf3['raw'],null,0x2)+'\x0a\x0a')+'Config\x20files:\x0a'+('\x20\x20project:\x20'+(_0x2425ec??_0x482784(0x211))+'\x0a')+(_0x482784(0x202)+_0x4be673)};return{'ok':!![],'data':{'effective':_0x102bf3[_0x482784(0x20a)],'configFiles':{'project':_0x2425ec??null,'global':_0x4be673}}};}},getDef={'service':a18_0x375681(0x1eb),'command':'get','description':'Get\x20a\x20config\x20value','risk':a18_0x375681(0x1dc),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x375681(0x1fe),'description':a18_0x375681(0x1f5),'required':!![]}],'flags':[],async 'execute'(_0x1035f1){const _0x3adc5c=a18_0x375681,_0x4fc023=_0x1035f1[_0x3adc5c(0x1ee)][0x0];if(!_0x4fc023)throw CliErrors[_0x3adc5c(0x1f4)](_0x3adc5c(0x208),_0x3adc5c(0x1f0)+CLI_BIN_NAME+_0x3adc5c(0x1f2));const {buildConfigFromFlags:_0xe36a1}=await import('../../context.js'),{raw:_0x784188}=_0xe36a1({});if(_0x4fc023[_0x3adc5c(0x1e0)]('.')){const _0x4837b7=_0x4fc023[_0x3adc5c(0x209)]('.');let _0x509061=_0x784188;for(const _0x46f1be of _0x4837b7){if(_0x509061==null||typeof _0x509061!==_0x3adc5c(0x1fa))throw CliErrors['validation'](_0x3adc5c(0x207)+_0x4fc023);_0x509061=_0x509061[_0x46f1be];}if(_0x509061===undefined)throw CliErrors[_0x3adc5c(0x1f4)](_0x3adc5c(0x207)+_0x4fc023);return console[_0x3adc5c(0x213)](typeof _0x509061===_0x3adc5c(0x1fa)?JSON['stringify'](_0x509061,null,0x2):String(_0x509061)),{'ok':!![]};}const _0x2befb8=_0x784188[_0x4fc023];if(_0x2befb8===undefined)throw CliErrors[_0x3adc5c(0x1f4)]('Key\x20not\x20found:\x20'+_0x4fc023);return console['log'](typeof _0x2befb8===_0x3adc5c(0x1fa)?JSON[_0x3adc5c(0x20c)](_0x2befb8,null,0x2):String(_0x2befb8)),{'ok':!![]};}},setDef={'service':a18_0x375681(0x1eb),'command':'set','description':a18_0x375681(0x1ed),'risk':a18_0x375681(0x1e6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x375681(0x1fe),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a18_0x375681(0x1f6),'description':a18_0x375681(0x1db),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x1c4952){const _0x10326d=a18_0x375681,_0x45c944=_0x1c4952['args'][0x0],_0x55eb34=_0x1c4952[_0x10326d(0x1ee)][0x1];if(!_0x45c944||_0x55eb34===undefined)throw CliErrors['validation'](_0x10326d(0x1df),'Usage:\x20'+CLI_BIN_NAME+_0x10326d(0x1fd));if(ENUM_KEYS[_0x45c944]&&!ENUM_KEYS[_0x45c944][_0x10326d(0x1e0)](_0x55eb34))throw CliErrors['validation'](_0x10326d(0x1f7)+_0x45c944+_0x10326d(0x1e1)+ENUM_KEYS[_0x45c944][_0x10326d(0x1d5)](',\x20'));if(_0x45c944===_0x10326d(0x1f8))throw CliErrors['validation'](_0x10326d(0x205));if(_0x45c944===_0x10326d(0x1d8)){const _0x7534d9=Number(_0x55eb34);if(isNaN(_0x7534d9)||_0x7534d9<=0x0)throw CliErrors[_0x10326d(0x1f4)](_0x10326d(0x1e9));}const _0x5b43d0=resolveWriteScope({'explicitGlobal':_0x1c4952[_0x10326d(0x1fc)](_0x10326d(0x1e2)),'policy':_0x10326d(0x1ec)}),_0x13a7fe=toScopeFlags(_0x5b43d0),_0x2bbfc8=readScopedConfig(_0x13a7fe),_0x2ca14f=parseAliasAppcodeSetKey(_0x45c944);if(!_0x2ca14f&&!isTopLevelConfigKey(_0x45c944))throw CliErrors[_0x10326d(0x1f4)](_0x10326d(0x1fb)+_0x45c944+_0x10326d(0x1e4),_0x10326d(0x204)+getTopLevelConfigKeySummary()+_0x10326d(0x1e5));return _0x2ca14f?setLocalAppAlias(_0x2bbfc8,_0x2ca14f,_0x55eb34):_0x2bbfc8[_0x45c944]=_0x45c944===_0x10326d(0x1d8)?Number(_0x55eb34):_0x55eb34,console[_0x10326d(0x213)]('Set\x20`'+_0x45c944+_0x10326d(0x20f)+_0x55eb34+'\x22'+(_0x5b43d0===_0x10326d(0x1e2)?_0x10326d(0x200):'')),writeScopedConfig(_0x2bbfc8,_0x13a7fe),{'ok':!![]};}},deleteDef={'service':'config','command':a18_0x375681(0x1e3),'description':a18_0x375681(0x212),'risk':a18_0x375681(0x1e6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x375681(0x1fe),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x1fece2){const _0x2e3b21=a18_0x375681,_0x5aab04=_0x1fece2[_0x2e3b21(0x1ee)][0x0];if(!_0x5aab04)throw CliErrors['validation'](_0x2e3b21(0x208),_0x2e3b21(0x1f0)+CLI_BIN_NAME+'\x20config\x20delete\x20<key>\x20[--global]');const _0xb23ebb=resolveWriteScope({'explicitGlobal':_0x1fece2[_0x2e3b21(0x1fc)](_0x2e3b21(0x1e2)),'policy':_0x2e3b21(0x1ec)}),_0x454270=toScopeFlags(_0xb23ebb),_0x13222c=readScopedConfig(_0x454270),_0x3b0b6b=parseAliasDeleteKey(_0x5aab04);if(_0x3b0b6b){if(!deleteLocalAppAlias(_0x13222c,_0x3b0b6b))throw CliErrors[_0x2e3b21(0x1f4)](_0x2e3b21(0x207)+_0x5aab04);return console[_0x2e3b21(0x213)](_0x2e3b21(0x1d9)+_0x5aab04+'`'+(_0xb23ebb==='global'?_0x2e3b21(0x200):'')),writeScopedConfig(_0x13222c,_0x454270),{'ok':!![]};}if(_0x13222c[_0x5aab04]===undefined)throw CliErrors[_0x2e3b21(0x1f4)](_0x2e3b21(0x1f1)+_0x5aab04+_0x2e3b21(0x1ff));return delete _0x13222c[_0x5aab04],console[_0x2e3b21(0x213)]('Deleted\x20`'+_0x5aab04+'`'+(_0xb23ebb===_0x2e3b21(0x1e2)?_0x2e3b21(0x200):'')),writeScopedConfig(_0x13222c,_0x454270),{'ok':!![]};}};function a18_0x5a47(_0x5cdbc0,_0x4d6984){_0x5cdbc0=_0x5cdbc0-0x1d1;const _0x220330=a18_0x2203();let _0x5a47b7=_0x220330[_0x5cdbc0];return _0x5a47b7;}export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x586b11,_0x1c2aab){var _0x452cc8=a19_0x283c,_0x5c213b=_0x586b11();while(!![]){try{var _0x5c7d65=-parseInt(_0x452cc8(0xb1))/0x1*(-parseInt(_0x452cc8(0xb0))/0x2)+parseInt(_0x452cc8(0xb6))/0x3+-parseInt(_0x452cc8(0xb2))/0x4*(parseInt(_0x452cc8(0xad))/0x5)+-parseInt(_0x452cc8(0xb5))/0x6+parseInt(_0x452cc8(0xaf))/0x7*(-parseInt(_0x452cc8(0xae))/0x8)+-parseInt(_0x452cc8(0xb3))/0x9+parseInt(_0x452cc8(0xb4))/0xa;if(_0x5c7d65===_0x1c2aab)break;else _0x5c213b['push'](_0x5c213b['shift']());}catch(_0x86100f){_0x5c213b['push'](_0x5c213b['shift']());}}}(a19_0x104c,0xce138));import{CLI_BIN_NAME}from'../../constant/cli.js';function a19_0x104c(){var _0x9e5547=['2340450JCXLTA','4033779JUMLrD','17150RHRqNl','5480416NbSNWM','14pKRCGW','20626loFdRL','137CETVAw','580MimNbX','14273253ltwHui','19300600ChxAEx'];a19_0x104c=function(){return _0x9e5547;};return a19_0x104c();}export{CLI_BIN_NAME};export{readScopedConfig,writeScopedConfig}from'../../context.js';function a19_0x283c(_0x4addc0,_0x509cd7){_0x4addc0=_0x4addc0-0xad;var _0x104cfd=a19_0x104c();var _0x283ccd=_0x104cfd[_0x4addc0];return _0x283ccd;}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_0x2a4e7d=a20_0x45d5;(function(_0x2bdfc3,_0x6dea7c){const _0x33e924=a20_0x45d5,_0x105732=_0x2bdfc3();while(!![]){try{const _0x8723c7=-parseInt(_0x33e924(0x20a))/0x1+parseInt(_0x33e924(0x220))/0x2+parseInt(_0x33e924(0x235))/0x3+parseInt(_0x33e924(0x21e))/0x4*(parseInt(_0x33e924(0x231))/0x5)+parseInt(_0x33e924(0x1f9))/0x6*(-parseInt(_0x33e924(0x224))/0x7)+parseInt(_0x33e924(0x206))/0x8*(parseInt(_0x33e924(0x22d))/0x9)+-parseInt(_0x33e924(0x228))/0xa;if(_0x8723c7===_0x6dea7c)break;else _0x105732['push'](_0x105732['shift']());}catch(_0x51d6fa){_0x105732['push'](_0x105732['shift']());}}}(a20_0x27b4,0x460a4));function a20_0x27b4(){const _0x507f98=['\x20\x20PAGINATION','params','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','24eMVSTV','high-risk-write','\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$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\x20LOGICAL\x20COMBINATORS','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','str','\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]}}','/api/{appCode}/','\x20\x20EXAMPLES','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','Preview:\x20data\x20','paramsHint','218664hSoYKz','batchCreate','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','read','249494cWMHId','data\x20','\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}}','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','\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','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','getOne','write','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','\x20\x20PARAMS\x20STRUCTURE','\x20\x20WHERE\x20OPERATORS','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','operation','description','create','\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\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','1403660KEybho','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','147494cyHYIQ','POST','\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}}','command','49763vQXWIj','now','dryRun','\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}','1160760AVQgTr','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}','\x20\x20\x20\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\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','9qoPugg','update','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','data','5VYGaMZ','\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}','map','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','686685gCenwA','code','body','build','delete','\x20\x20AGGREGATE\x20TYPES','\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}]','risk','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','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\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}','join','filter'];a20_0x27b4=function(){return _0x507f98;};return a20_0x27b4();}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_0x2a4e7d(0x1f5),'operation':a20_0x2a4e7d(0x1f5),'risk':'read','paramsRequired':![],'description':'Filter\x20dataset\x20records\x20with\x20query\x20conditions','paramsHint':'JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20'+a20_0x2a4e7d(0x211),'helpExtra':[a20_0x2a4e7d(0x217),a20_0x2a4e7d(0x22a),a20_0x2a4e7d(0x1ef),a20_0x2a4e7d(0x21c),a20_0x2a4e7d(0x222),a20_0x2a4e7d(0x229),'\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}}',a20_0x2a4e7d(0x200),'\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}}',a20_0x2a4e7d(0x1fc),a20_0x2a4e7d(0x20c),'',a20_0x2a4e7d(0x1fd),'\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','',a20_0x2a4e7d(0x212),'\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)',a20_0x2a4e7d(0x21d),a20_0x2a4e7d(0x1ed),a20_0x2a4e7d(0x22c),a20_0x2a4e7d(0x20f),'',a20_0x2a4e7d(0x1f6),'\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27',a20_0x2a4e7d(0x1f1)][a20_0x2a4e7d(0x1f4)]('\x0a')},{'command':a20_0x2a4e7d(0x213),'operation':a20_0x2a4e7d(0x213),'risk':'read','paramsRequired':!![],'description':'Get\x20a\x20single\x20record\x20by\x20ID','paramsHint':a20_0x2a4e7d(0x1f8)},{'command':a20_0x2a4e7d(0x21b),'operation':a20_0x2a4e7d(0x21b),'risk':a20_0x2a4e7d(0x214),'paramsRequired':!![],'description':'Create\x20a\x20new\x20record\x20in\x20a\x20dataset','paramsHint':a20_0x2a4e7d(0x1fe)},{'command':a20_0x2a4e7d(0x207),'operation':a20_0x2a4e7d(0x207),'risk':a20_0x2a4e7d(0x214),'paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','paramsHint':a20_0x2a4e7d(0x210)},{'command':a20_0x2a4e7d(0x22e),'operation':a20_0x2a4e7d(0x22e),'risk':'write','paramsRequired':!![],'description':'Update\x20an\x20existing\x20record','paramsHint':a20_0x2a4e7d(0x215)},{'command':a20_0x2a4e7d(0x1eb),'operation':a20_0x2a4e7d(0x1eb),'risk':a20_0x2a4e7d(0x1fa),'paramsRequired':!![],'description':a20_0x2a4e7d(0x20d),'paramsHint':a20_0x2a4e7d(0x1f8)},{'command':'aggregate','operation':'aggregate','risk':a20_0x2a4e7d(0x209),'paramsRequired':![],'description':'Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','paramsHint':a20_0x2a4e7d(0x21f)+a20_0x2a4e7d(0x1f2),'helpExtra':[a20_0x2a4e7d(0x1ec),'\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}',a20_0x2a4e7d(0x227),'\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\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}',a20_0x2a4e7d(0x232),a20_0x2a4e7d(0x1f3),'\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','',a20_0x2a4e7d(0x216),a20_0x2a4e7d(0x1f0),a20_0x2a4e7d(0x203),a20_0x2a4e7d(0x234),a20_0x2a4e7d(0x1fb),'\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_0x2a4e7d(0x22f),'',a20_0x2a4e7d(0x202),'\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status',a20_0x2a4e7d(0x22b),'',a20_0x2a4e7d(0x208),a20_0x2a4e7d(0x20e),'',a20_0x2a4e7d(0x218)]['join']('\x0a')}];function a20_0x45d5(_0x3e9366,_0x2f59d9){_0x3e9366=_0x3e9366-0x1e9;const _0x27b4a5=a20_0x27b4();let _0x45d574=_0x27b4a5[_0x3e9366];return _0x45d574;}function makeDataCommand(_0x5bab9b){const _0x5c0c6b=a20_0x2a4e7d,_0x24ca54=_0x5c0c6b(0x20b)+_0x5bab9b['command'],_0x526211={'service':_0x5c0c6b(0x230),'command':_0x5bab9b[_0x5c0c6b(0x223)],'description':_0x5bab9b['description'],'risk':_0x5bab9b['risk'],'helpExtra':_0x5bab9b['helpExtra'],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x5bab9b[_0x5c0c6b(0x205)]}],'validate':async _0x8a541b=>{const _0x2850e7=_0x5c0c6b;_0x5bab9b['paramsRequired']&&requireAnyOf(_0x8a541b,[_0x2850e7(0x1f7)],_0x24ca54),_0x5bab9b[_0x2850e7(0x219)]===_0x2850e7(0x207)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x8a541b[_0x2850e7(0x1ff)](_0x2850e7(0x1f7))));},async 'execute'(_0x4ec0ae){const _0xc8bbe1=_0x5c0c6b,_0x21dcc8=_0x4ec0ae[_0xc8bbe1(0x1ff)](_0xc8bbe1(0x236)),_0x398733=_0x5bab9b[_0xc8bbe1(0x219)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x4ec0ae[_0xc8bbe1(0x1ff)](_0xc8bbe1(0x1f7)))):parseJsonParams(_0x4ec0ae[_0xc8bbe1(0x1ff)](_0xc8bbe1(0x1f7)))??{},_0x3fd90b=Date[_0xc8bbe1(0x225)](),_0x3aedc6=await executeData(_0x21dcc8,_0x5bab9b[_0xc8bbe1(0x219)],_0x398733),_0x1ddd3d=Date[_0xc8bbe1(0x225)]()-_0x3fd90b;return{'ok':!![],'data':{'result':_0x3aedc6,'elapsed':_0x1ddd3d},'message':_0xc8bbe1(0x20b)+_0x5bab9b[_0xc8bbe1(0x223)]+'\x20completed\x20in\x20'+_0x1ddd3d+'ms'};}};return _0x5bab9b[_0x5c0c6b(0x1ee)]!==_0x5c0c6b(0x209)&&(_0x526211[_0x5c0c6b(0x226)]=async _0x3cc740=>{const _0x2ac84b=_0x5c0c6b,_0x4aa10a=_0x3cc740[_0x2ac84b(0x1ff)](_0x2ac84b(0x236)),_0x26861c=_0x5bab9b[_0x2ac84b(0x219)]===_0x2ac84b(0x207)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x3cc740[_0x2ac84b(0x1ff)]('params'))):parseJsonParams(_0x3cc740[_0x2ac84b(0x1ff)](_0x2ac84b(0x1f7)))??{};return dryRun(_0x2ac84b(0x221),_0x2ac84b(0x201)+_0x4aa10a+'/'+_0x5bab9b[_0x2ac84b(0x219)])[_0x2ac84b(0x1e9)](_0x26861c)[_0x2ac84b(0x21a)](_0x2ac84b(0x204)+_0x5bab9b[_0x2ac84b(0x223)]+'\x20on\x20dataset\x20'+_0x4aa10a)[_0x2ac84b(0x1ea)]();}),_0x526211;}export const dataDefinitions=specs[a20_0x2a4e7d(0x233)](makeDataCommand);
|
|
1
|
+
const a20_0x33c1b3=a20_0x142d;(function(_0x43af1b,_0x33a51c){const _0x27684e=a20_0x142d,_0x45bdaf=_0x43af1b();while(!![]){try{const _0x4cfdbf=parseInt(_0x27684e(0x14f))/0x1*(parseInt(_0x27684e(0x126))/0x2)+parseInt(_0x27684e(0x153))/0x3*(parseInt(_0x27684e(0x148))/0x4)+-parseInt(_0x27684e(0x162))/0x5*(parseInt(_0x27684e(0x13f))/0x6)+-parseInt(_0x27684e(0x151))/0x7+-parseInt(_0x27684e(0x14e))/0x8+parseInt(_0x27684e(0x154))/0x9+-parseInt(_0x27684e(0x156))/0xa*(-parseInt(_0x27684e(0x12b))/0xb);if(_0x4cfdbf===_0x33a51c)break;else _0x45bdaf['push'](_0x45bdaf['shift']());}catch(_0x35ddad){_0x45bdaf['push'](_0x45bdaf['shift']());}}}(a20_0x5d18,0xca45e));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';function a20_0x5d18(){const _0x5673c2=['\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','7283766qrJqAt','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','command','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','high-risk-write','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','operation','filter','delete','12676dUdtas','\x20\x20EXAMPLES','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','create','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','\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','4620216UVWFWD','25698gdQJYC','\x20\x20WHERE\x20OPERATORS','8259139fuYOOZ','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','1389xqrUxg','5121054XjZAGF','\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}}','274420vDGgQG','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','batchCreate','dryRun','\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\x20LOGICAL\x20COMBINATORS','\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}}','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','aggregate','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','\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}}]}','body','5byFnpa','Update\x20an\x20existing\x20record','write','\x20on\x20dataset\x20','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','str','\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}}]}','data','risk','\x20\x20AGGREGATE\x20TYPES','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','\x20\x20PAGINATION','read','code','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','update','params','86skSLQD','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','join','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','264yCIiBj','getOne','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','Filter\x20dataset\x20records\x20with\x20query\x20conditions','data\x20','now','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20$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\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}}]','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','Preview:\x20data\x20','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\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','/api/{appCode}/','helpExtra','paramsHint','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\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}'];a20_0x5d18=function(){return _0x5673c2;};return a20_0x5d18();}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_0x33c1b3(0x146),'operation':a20_0x33c1b3(0x146),'risk':a20_0x33c1b3(0x120),'paramsRequired':![],'description':a20_0x33c1b3(0x12e),'paramsHint':'JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20'+a20_0x33c1b3(0x168),'helpExtra':[a20_0x33c1b3(0x150),'\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}',a20_0x33c1b3(0x15c),a20_0x33c1b3(0x166),a20_0x33c1b3(0x155),a20_0x33c1b3(0x15a),'\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}}',a20_0x33c1b3(0x132),'\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','',a20_0x33c1b3(0x15b),a20_0x33c1b3(0x16a),a20_0x33c1b3(0x160),'',a20_0x33c1b3(0x142),a20_0x33c1b3(0x11e),a20_0x33c1b3(0x137),'\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]',a20_0x33c1b3(0x12d),a20_0x33c1b3(0x138),'',a20_0x33c1b3(0x11f),a20_0x33c1b3(0x15f),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27',a20_0x33c1b3(0x12a)][a20_0x33c1b3(0x129)]('\x0a')},{'command':'getOne','operation':a20_0x33c1b3(0x12c),'risk':a20_0x33c1b3(0x120),'paramsRequired':!![],'description':a20_0x33c1b3(0x136),'paramsHint':a20_0x33c1b3(0x140)},{'command':a20_0x33c1b3(0x14b),'operation':a20_0x33c1b3(0x14b),'risk':a20_0x33c1b3(0x164),'paramsRequired':!![],'description':a20_0x33c1b3(0x15d),'paramsHint':a20_0x33c1b3(0x14a)},{'command':a20_0x33c1b3(0x158),'operation':'batchCreate','risk':'write','paramsRequired':!![],'description':a20_0x33c1b3(0x144),'paramsHint':a20_0x33c1b3(0x123)},{'command':a20_0x33c1b3(0x124),'operation':'update','risk':a20_0x33c1b3(0x164),'paramsRequired':!![],'description':a20_0x33c1b3(0x163),'paramsHint':a20_0x33c1b3(0x134)},{'command':a20_0x33c1b3(0x147),'operation':'delete','risk':a20_0x33c1b3(0x143),'paramsRequired':!![],'description':'Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a20_0x33c1b3(0x15e),'operation':'aggregate','risk':a20_0x33c1b3(0x120),'paramsRequired':![],'description':'Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','paramsHint':a20_0x33c1b3(0x152)+a20_0x33c1b3(0x13c),'helpExtra':[a20_0x33c1b3(0x16d),a20_0x33c1b3(0x13d),a20_0x33c1b3(0x167),'\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\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}',a20_0x33c1b3(0x127),'\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','','\x20\x20PARAMS\x20STRUCTURE',a20_0x33c1b3(0x131),a20_0x33c1b3(0x122),a20_0x33c1b3(0x157),'\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]',a20_0x33c1b3(0x133),'\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','',a20_0x33c1b3(0x149),'\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status',a20_0x33c1b3(0x14d),'',a20_0x33c1b3(0x128),a20_0x33c1b3(0x13e),'',a20_0x33c1b3(0x14c)][a20_0x33c1b3(0x129)]('\x0a')}];function a20_0x142d(_0xcb81fa,_0x126e41){_0xcb81fa=_0xcb81fa-0x11e;const _0x5d18d8=a20_0x5d18();let _0x142d98=_0x5d18d8[_0xcb81fa];return _0x142d98;}function makeDataCommand(_0xdd98d){const _0x1c3924=a20_0x33c1b3,_0x3da7ab='data\x20'+_0xdd98d['command'],_0x374fb4={'service':_0x1c3924(0x16b),'command':_0xdd98d[_0x1c3924(0x141)],'description':_0xdd98d['description'],'risk':_0xdd98d[_0x1c3924(0x16c)],'helpExtra':_0xdd98d[_0x1c3924(0x13a)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0xdd98d[_0x1c3924(0x13b)]}],'validate':async _0x5f105e=>{const _0xef175e=_0x1c3924;_0xdd98d['paramsRequired']&&requireAnyOf(_0x5f105e,[_0xef175e(0x125)],_0x3da7ab),_0xdd98d[_0xef175e(0x145)]===_0xef175e(0x158)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x5f105e['str'](_0xef175e(0x125))));},async 'execute'(_0x41fffc){const _0x3a13b8=_0x1c3924,_0x5113d8=_0x41fffc['str']('code'),_0x15bd00=_0xdd98d[_0x3a13b8(0x145)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x41fffc[_0x3a13b8(0x169)](_0x3a13b8(0x125)))):parseJsonParams(_0x41fffc['str'](_0x3a13b8(0x125)))??{},_0x216bec=Date[_0x3a13b8(0x130)](),_0x395ee5=await executeData(_0x5113d8,_0xdd98d[_0x3a13b8(0x145)],_0x15bd00),_0x2d525e=Date[_0x3a13b8(0x130)]()-_0x216bec;return{'ok':!![],'data':{'result':_0x395ee5,'elapsed':_0x2d525e},'message':_0x3a13b8(0x12f)+_0xdd98d[_0x3a13b8(0x141)]+'\x20completed\x20in\x20'+_0x2d525e+'ms'};}};return _0xdd98d[_0x1c3924(0x16c)]!=='read'&&(_0x374fb4[_0x1c3924(0x159)]=async _0x29d426=>{const _0xb14fdd=_0x1c3924,_0x35f8ce=_0x29d426[_0xb14fdd(0x169)](_0xb14fdd(0x121)),_0x9a0475=_0xdd98d[_0xb14fdd(0x145)]===_0xb14fdd(0x158)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x29d426[_0xb14fdd(0x169)](_0xb14fdd(0x125)))):parseJsonParams(_0x29d426[_0xb14fdd(0x169)]('params'))??{};return dryRun('POST',_0xb14fdd(0x139)+_0x35f8ce+'/'+_0xdd98d[_0xb14fdd(0x145)])[_0xb14fdd(0x161)](_0x9a0475)['description'](_0xb14fdd(0x135)+_0xdd98d[_0xb14fdd(0x141)]+_0xb14fdd(0x165)+_0x35f8ce)['build']();}),_0x374fb4;}export const dataDefinitions=specs['map'](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a21_0x20602d=a21_0x159f;(function(_0x377abf,_0x5b0614){const _0xfbb3eb=a21_0x159f,_0x3d9958=_0x377abf();while(!![]){try{const _0x2b8258=-parseInt(_0xfbb3eb(0x175))/0x1+-parseInt(_0xfbb3eb(0x177))/0x2*(parseInt(_0xfbb3eb(0x160))/0x3)+-parseInt(_0xfbb3eb(0x15c))/0x4+-parseInt(_0xfbb3eb(0x144))/0x5*(parseInt(_0xfbb3eb(0x18d))/0x6)+parseInt(_0xfbb3eb(0x15e))/0x7+parseInt(_0xfbb3eb(0x183))/0x8*(-parseInt(_0xfbb3eb(0x157))/0x9)+parseInt(_0xfbb3eb(0x168))/0xa;if(_0x2b8258===_0x5b0614)break;else _0x3d9958['push'](_0x3d9958['shift']());}catch(_0x4ada9c){_0x3d9958['push'](_0x3d9958['shift']());}}}(a21_0x1ee9,0xc2fc0));import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x346196){const _0x1fd7cd=a21_0x159f;if(_0x346196[_0x1fd7cd(0x16c)])return null;const _0x160baf=Boolean(_0x346196[_0x1fd7cd(0x184)]!==undefined||_0x346196[_0x1fd7cd(0x16e)]!==undefined);let _0x3b314d={};if(!_0x160baf&&typeof _0x346196[_0x1fd7cd(0x158)]===_0x1fd7cd(0x17d))try{_0x3b314d=JSON[_0x1fd7cd(0x192)](_0x346196[_0x1fd7cd(0x158)]);}catch{}const _0x59e1be=_0x160baf?_0x346196[_0x1fd7cd(0x15b)]:_0x346196[_0x1fd7cd(0x18c)],_0x19b94a=_0x160baf?_0x346196[_0x1fd7cd(0x184)]:_0x346196['name'],_0x173bf7=_0x160baf?_0x346196[_0x1fd7cd(0x16e)]:_0x346196[_0x1fd7cd(0x169)]||_0x346196[_0x1fd7cd(0x14b)],_0x4a781e=_0x160baf?_0x346196[_0x1fd7cd(0x164)]===!![]:_0x3b314d[_0x1fd7cd(0x164)]===!![],_0x144ae7=_0x160baf?_0x346196[_0x1fd7cd(0x14d)]===!![]:_0x3b314d[_0x1fd7cd(0x14d)]===!![],_0x587ac9=_0x160baf?_0x346196['options']??null:_0x3b314d[_0x1fd7cd(0x162)]??null,_0x4fccd2={'name':_0x59e1be,'displayName':_0x19b94a||_0x59e1be,'type':_0x173bf7,'dbType':_0x346196[_0x1fd7cd(0x159)],'pk':_0x4a781e,'required':_0x144ae7,'description':_0x346196[_0x1fd7cd(0x15a)]||undefined};return Array[_0x1fd7cd(0x143)](_0x587ac9)&&_0x587ac9[_0x1fd7cd(0x151)]>0x0&&(_0x4fccd2[_0x1fd7cd(0x162)]=_0x587ac9),_0x4fccd2;}function parseJsonMaybe(_0x3cb1c7){const _0x3240a9=a21_0x159f;if(typeof _0x3cb1c7!==_0x3240a9(0x17d))return _0x3cb1c7;try{return JSON[_0x3240a9(0x192)](_0x3cb1c7);}catch{return _0x3cb1c7;}}function normalizeOperationEntry(_0x5b8d89,_0x3aef0c){const _0x1a747a=a21_0x159f;if(!_0x3aef0c||typeof _0x3aef0c!==_0x1a747a(0x16b))return null;if(!_0x3aef0c[_0x1a747a(0x189)]||!_0x3aef0c[_0x1a747a(0x149)])return null;const _0x553a0c={'name':_0x5b8d89,'method':_0x3aef0c['method'],'path':_0x3aef0c['path']};if(_0x3aef0c[_0x1a747a(0x166)])_0x553a0c[_0x1a747a(0x166)]=_0x3aef0c[_0x1a747a(0x166)];if(_0x3aef0c[_0x1a747a(0x18a)]!=null)_0x553a0c[_0x1a747a(0x18a)]=parseJsonMaybe(_0x3aef0c['requestBody']);if(_0x3aef0c[_0x1a747a(0x153)]!=null)_0x553a0c[_0x1a747a(0x153)]=parseJsonMaybe(_0x3aef0c[_0x1a747a(0x153)]);if(_0x3aef0c['beforeScriptId']!=null)_0x553a0c[_0x1a747a(0x193)]=_0x3aef0c[_0x1a747a(0x193)];if(_0x3aef0c['afterScriptId']!=null)_0x553a0c[_0x1a747a(0x145)]=_0x3aef0c['afterScriptId'];if(Array[_0x1a747a(0x143)](_0x3aef0c[_0x1a747a(0x17e)]))_0x553a0c[_0x1a747a(0x17e)]=_0x3aef0c[_0x1a747a(0x17e)];if(Array[_0x1a747a(0x143)](_0x3aef0c[_0x1a747a(0x17a)]))_0x553a0c[_0x1a747a(0x17a)]=_0x3aef0c[_0x1a747a(0x17a)];return _0x553a0c;}function summarizeDbtable(_0x45d970){const _0x781383=a21_0x159f,_0x8ae693={},_0x278f39=[_0x781383(0x16d),_0x781383(0x18b),_0x781383(0x16a),'datasetKey',_0x781383(0x164),_0x781383(0x17f),_0x781383(0x16f),_0x781383(0x173),_0x781383(0x150),_0x781383(0x15f),_0x781383(0x172),_0x781383(0x156),_0x781383(0x18f),'labelField',_0x781383(0x187)];for(const _0x5cc6cf of _0x278f39){if(_0x45d970[_0x5cc6cf]!==undefined)_0x8ae693[_0x5cc6cf]=_0x45d970[_0x5cc6cf];}return typeof _0x8ae693['allFields']==='string'&&_0x8ae693[_0x781383(0x17f)][_0x781383(0x151)]>0x0&&(_0x8ae693[_0x781383(0x190)]=_0x8ae693[_0x781383(0x17f)][_0x781383(0x179)](',')[_0x781383(0x147)](_0x503602=>_0x503602[_0x781383(0x176)]())['filter'](Boolean)),_0x8ae693;}function normalizeRelatedPages(_0x346b10){const _0x32c151=a21_0x159f;if(!Array['isArray'](_0x346b10))return[];return _0x346b10[_0x32c151(0x14c)](_0x1fbae9=>_0x1fbae9&&typeof _0x1fbae9===_0x32c151(0x16b))[_0x32c151(0x147)](_0x543d42=>({'id':_0x543d42['id'],'type':_0x543d42[_0x32c151(0x169)],'code':_0x543d42[_0x32c151(0x18c)],'title':_0x543d42[_0x32c151(0x14e)],'deleted':_0x543d42[_0x32c151(0x16c)]===!![]}));}function normalizeFallbackFieldName(_0x1df02f,_0x3af155){const _0x2f40ac=a21_0x159f,_0x14141a=_0x1df02f[_0x2f40ac(0x176)]();if(!_0x14141a)return null;return{'name':_0x14141a,'displayName':_0x14141a,'type':undefined,'dbType':undefined,'pk':_0x14141a===_0x3af155,'required':![],'description':undefined};}function a21_0x159f(_0x4a99c5,_0x338126){_0x4a99c5=_0x4a99c5-0x141;const _0x1ee9c2=a21_0x1ee9();let _0x159f20=_0x1ee9c2[_0x4a99c5];return _0x159f20;}async function loadListFieldFallback(_0x10b9f9,_0x37bebd){const _0x2cc2a3=a21_0x159f;if(!_0x10b9f9||!_0x37bebd)return[];try{const _0x5685c5=await listDatasets(_0x10b9f9,{'code':_0x37bebd}),_0x597652=_0x5685c5['find'](_0x819200=>_0x819200[_0x2cc2a3(0x18c)]===_0x37bebd)??_0x5685c5[0x0],_0x43aeae=_0x597652?.[_0x2cc2a3(0x186)]??{},_0x505444=typeof _0x43aeae['allFields']===_0x2cc2a3(0x17d)?_0x43aeae[_0x2cc2a3(0x17f)][_0x2cc2a3(0x179)](','):[];return _0x505444[_0x2cc2a3(0x147)](_0x11356e=>normalizeFallbackFieldName(_0x11356e,_0x43aeae[_0x2cc2a3(0x164)]))[_0x2cc2a3(0x14c)](_0x3a86f1=>_0x3a86f1!==null);}catch{return[];}}export const datasetDetail={'service':a21_0x20602d(0x152),'command':'detail','description':'Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','risk':a21_0x20602d(0x154),'flags':[CODE_FLAG],async 'execute'(_0x58010c){const _0x53a61c=a21_0x20602d,_0x425f0a=await getDatasetDetail(_0x58010c[_0x53a61c(0x188)](_0x53a61c(0x18c))),_0x311cbe=Array[_0x53a61c(0x143)](_0x425f0a[_0x53a61c(0x161)])?_0x425f0a[_0x53a61c(0x161)]:Array['isArray'](_0x425f0a[_0x53a61c(0x163)])?_0x425f0a[_0x53a61c(0x163)]:[];let _0x522658=_0x311cbe[_0x53a61c(0x147)](_0x4869b7=>normalizeField(_0x4869b7))[_0x53a61c(0x14c)](_0x47f682=>_0x47f682!==null);_0x522658[_0x53a61c(0x151)]===0x0&&(_0x522658=await loadListFieldFallback(_0x58010c[_0x53a61c(0x142)],_0x58010c[_0x53a61c(0x188)](_0x53a61c(0x18c))));const _0x12005a=_0x425f0a[_0x53a61c(0x178)]??{},_0x1af28e=[];for(const [_0x55fb25,_0x290cd7]of Object[_0x53a61c(0x14f)](_0x12005a)){const _0xf5aac6=normalizeOperationEntry(_0x55fb25,_0x290cd7);if(_0xf5aac6)_0x1af28e[_0x53a61c(0x174)](_0xf5aac6);}const _0x4842c9=_0x425f0a[_0x53a61c(0x186)]??{},_0x27875d=_0x425f0a['dataset']??{},_0x1716bd=_0x4842c9['dbId']!=null?{'id':_0x4842c9['dbId'],'name':_0x4842c9['dbName']??null}:undefined;let _0x413a70;return typeof _0x425f0a['extend']===_0x53a61c(0x17d)&&(_0x413a70=parseJsonMaybe(_0x425f0a['extend'])),{'ok':!![],'data':{'id':_0x425f0a[_0x53a61c(0x180)]??_0x425f0a['id'],'name':_0x425f0a['name'],'code':_0x425f0a[_0x53a61c(0x171)]||_0x425f0a[_0x53a61c(0x18c)],'doVersion':_0x425f0a[_0x53a61c(0x181)],'description':_0x425f0a['description']||_0x27875d[_0x53a61c(0x170)]||undefined,'source':_0x425f0a[_0x53a61c(0x148)]||_0x27875d[_0x53a61c(0x165)],'table':_0x4842c9['tableName']||_0x27875d[_0x53a61c(0x16a)],'datasetKey':_0x4842c9['datasetKey'],'pk':_0x4842c9[_0x53a61c(0x164)],'db':_0x1716bd,'dbtable':summarizeDbtable(_0x4842c9),'fields':_0x522658,'operations':_0x1af28e,'indexes':Array[_0x53a61c(0x143)](_0x27875d[_0x53a61c(0x17b)])?_0x27875d[_0x53a61c(0x17b)]:[],'relations':Array['isArray'](_0x425f0a['relations'])?_0x425f0a[_0x53a61c(0x185)]['map'](_0x4b8bfa=>({'fromField':_0x4b8bfa[_0x53a61c(0x182)],'toDataset':_0x4b8bfa[_0x53a61c(0x146)],'toCode':_0x4b8bfa[_0x53a61c(0x18e)],'toTable':_0x4b8bfa[_0x53a61c(0x191)],'toField':_0x4b8bfa[_0x53a61c(0x17c)],'labelField':_0x4b8bfa[_0x53a61c(0x14a)]||undefined})):[],'relatedPages':normalizeRelatedPages(_0x425f0a[_0x53a61c(0x15d)]),...Array[_0x53a61c(0x143)](_0x425f0a[_0x53a61c(0x141)])?{'columnCodeListWithDeleted':_0x425f0a['columnCodeListWithDeleted']}:{},'formatRules':Array[_0x53a61c(0x143)](_0x425f0a[_0x53a61c(0x167)])?_0x425f0a[_0x53a61c(0x167)]:[],'validateRules':Array[_0x53a61c(0x143)](_0x425f0a[_0x53a61c(0x155)])?_0x425f0a['validateRules']:[],..._0x413a70!==undefined?{'extend':_0x413a70}:{},'stats':{'fieldCount':_0x522658[_0x53a61c(0x151)],'operationCount':_0x1af28e['length']}}};}};function a21_0x1ee9(){const _0x516df6=['1191494dPYYlq','operations','split','responseFields','indexes','toField','string','requestFields','allFields','modelId','doVersion','fromField','752oaTJgG','displayName','relations','dbtableConfig','dblinkInfoDTO','str','method','requestBody','dbName','code','366RvoxFv','toDatasetCode','modifierNameField','allFieldNames','toTableName','parse','beforeScriptId','columnCodeListWithDeleted','appCode','isArray','99535CIjHnF','afterScriptId','toDatasetName','map','source','path','toFieldLabel','dataType','filter','required','title','entries','updateTimeField','length','dataset','responseBody','read','validateRules','modifierIdField','143658XSviec','extend','dbType','description','name','372032KQkoeK','relatedPageInfoList','10470908waMfwG','creatorIdField','6GfqZGG','fields','options','properties','pkField','sourceType','host','formatRules','35202460sKJqjd','type','tableName','object','deleted','dbId','doType','logicField','tableComment','modelCode','creatorNameField','createTimeField','push','218177XbWdfv','trim'];a21_0x1ee9=function(){return _0x516df6;};return a21_0x1ee9();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x169a37,_0xd060f5){const _0x20d440=a22_0x49ac,_0x36c6d1=_0x169a37();while(!![]){try{const _0x295415=-parseInt(_0x20d440(0xdd))/0x1*(parseInt(_0x20d440(0xe3))/0x2)+parseInt(_0x20d440(0xe1))/0x3*(-parseInt(_0x20d440(0xde))/0x4)+-parseInt(_0x20d440(0xe0))/0x5+-parseInt(_0x20d440(0xdf))/0x6*(-parseInt(_0x20d440(0xda))/0x7)+-parseInt(_0x20d440(0xdc))/0x8+parseInt(_0x20d440(0xe2))/0x9*(-parseInt(_0x20d440(0xdb))/0xa)+-parseInt(_0x20d440(0xe5))/0xb*(-parseInt(_0x20d440(0xe4))/0xc);if(_0x295415===_0xd060f5)break;else _0x36c6d1['push'](_0x36c6d1['shift']());}catch(_0x6b6878){_0x36c6d1['push'](_0x36c6d1['shift']());}}}(a22_0x540f,0x21ee5));function a22_0x49ac(_0x2f0dc2,_0x12b105){_0x2f0dc2=_0x2f0dc2-0xda;const _0x540fc5=a22_0x540f();let _0x49ac35=_0x540fc5[_0x2f0dc2];return _0x49ac35;}function a22_0x540f(){const _0x40b80e=['180hosebi','400103MKsDGF','61586Jtboeo','11410aBCvwA','822144iBTWRU','8wRcpDw','4GISGgS','108thjjLA','1240650aFYMkr','132819cuESDf','531ALkfUb','25622eaVWKl'];a22_0x540f=function(){return _0x40b80e;};return a22_0x540f();}import{datasetList}from'../../commands/dataset/list.js';import{datasetDetail}from'../../commands/dataset/detail.js';import{datasetSdkDoc}from'../../commands/dataset/sdk-doc.js';export const datasetDefinitions=[datasetList,datasetDetail,datasetSdkDoc];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a23_0x27a594=a23_0x1546;(function(_0x31ddbc,_0x2b819d){const _0x3d031b=a23_0x1546,_0x59779b=_0x31ddbc();while(!![]){try{const _0x5b48d4=-parseInt(_0x3d031b(0x1c8))/0x1+parseInt(_0x3d031b(0x1da))/0x2+parseInt(_0x3d031b(0x1dd))/0x3+parseInt(_0x3d031b(0x1ca))/0x4+-parseInt(_0x3d031b(0x1d9))/0x5*(-parseInt(_0x3d031b(0x1d1))/0x6)+-parseInt(_0x3d031b(0x1d6))/0x7+-parseInt(_0x3d031b(0x1dc))/0x8;if(_0x5b48d4===_0x2b819d)break;else _0x59779b['push'](_0x59779b['shift']());}catch(_0x57bb6e){_0x59779b['push'](_0x59779b['shift']());}}}(a23_0x42a7,0xa6ec9));import{listDatasets}from'../../core/api-client.js';function a23_0x1546(_0x174d24,_0x3e3071){_0x174d24=_0x174d24-0x1c6;const _0x42a785=a23_0x42a7();let _0x1546d3=_0x42a785[_0x174d24];return _0x1546d3;}import{CODE_FLAG}from'../../commands/common/flags.js';function a23_0x42a7(){const _0x9f3c34=['Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)','str','length','764250WpZojP','code','appCode','allFields','list','5989326jpDHNF','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','pkField','5PhjmCt','212730CXfmtb','string','897776fwUMdX','3966441vSgXrj','source','map','206915ayQecv','dbtableConfig','1210356zChsSE','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','datasetKey','trim'];a23_0x42a7=function(){return _0x9f3c34;};return a23_0x42a7();}export const datasetList={'service':'dataset','command':a23_0x27a594(0x1d5),'description':a23_0x27a594(0x1d7),'risk':'read','flags':[{'name':'name','type':a23_0x27a594(0x1db),'description':a23_0x27a594(0x1ce)},{...CODE_FLAG,'required':![],'description':a23_0x27a594(0x1cb)}],async 'execute'(_0x189c84){const _0x437cd5=a23_0x27a594,_0x14e932=_0x189c84[_0x437cd5(0x1cf)]('name'),_0x1740de=_0x189c84[_0x437cd5(0x1cf)]('code'),_0x2e9c2a=await listDatasets(_0x189c84[_0x437cd5(0x1d3)],{..._0x14e932&&{'name':_0x14e932},..._0x1740de&&{'code':_0x1740de}});return{'ok':!![],'data':{'total':_0x2e9c2a[_0x437cd5(0x1d0)],'datasets':_0x2e9c2a[_0x437cd5(0x1c7)](_0x2c4328=>{const _0x368215=_0x437cd5,_0x64200d=_0x2c4328[_0x368215(0x1c9)]??{};return{'id':_0x2c4328['id'],'code':_0x2c4328[_0x368215(0x1d2)],'name':_0x2c4328['name'],'source':_0x2c4328[_0x368215(0x1c6)],'description':_0x2c4328['description'],'table':_0x64200d['tableName'],'datasetKey':_0x64200d[_0x368215(0x1cc)],'pk':_0x64200d[_0x368215(0x1d8)],'fields':_0x64200d[_0x368215(0x1d4)]?_0x64200d[_0x368215(0x1d4)]['split'](',')[_0x368215(0x1c7)](_0x56e001=>_0x56e001[_0x368215(0x1cd)]()):[]};})}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0xa3b7bb=a24_0x4918;function a24_0x3157(){const _0x42c2b6=['7FeSobo','read','2vGJvMz','54tFgGDm','16968237VpHnJv','1187835PuFvlF','2879144DoBxWE','appCode','code','trim','#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档','Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','str','619950dBKRoH','14370Jzpwkb','dataset','144zJmXPa','string','Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','332133JoBxrK','888032dfNmbM'];a24_0x3157=function(){return _0x42c2b6;};return a24_0x3157();}(function(_0x468d54,_0x48f0f9){const _0x5ab865=a24_0x4918,_0x4eba99=_0x468d54();while(!![]){try{const _0x136c12=parseInt(_0x5ab865(0xa9))/0x1*(-parseInt(_0x5ab865(0xad))/0x2)+-parseInt(_0x5ab865(0x9b))/0x3+parseInt(_0x5ab865(0xaa))/0x4+-parseInt(_0x5ab865(0xa4))/0x5*(parseInt(_0x5ab865(0xa6))/0x6)+-parseInt(_0x5ab865(0xab))/0x7*(parseInt(_0x5ab865(0x9c))/0x8)+-parseInt(_0x5ab865(0xae))/0x9*(parseInt(_0x5ab865(0xa3))/0xa)+parseInt(_0x5ab865(0x9a))/0xb;if(_0x136c12===_0x48f0f9)break;else _0x4eba99['push'](_0x4eba99['shift']());}catch(_0x1f4e87){_0x4eba99['push'](_0x4eba99['shift']());}}}(a24_0x3157,0x3988a));import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';const DEFAULT_MARKDOWN=a24_0xa3b7bb(0xa0);export function formatDatasetSdkMarkdown(_0x23be1d){const _0x7a6a92=a24_0xa3b7bb,_0x4ee262=typeof _0x23be1d===_0x7a6a92(0xa7)?_0x23be1d[_0x7a6a92(0x9f)]():'';return _0x4ee262||DEFAULT_MARKDOWN;}function a24_0x4918(_0x6d0c8b,_0x5a77a7){_0x6d0c8b=_0x6d0c8b-0x9a;const _0x3157ae=a24_0x3157();let _0x491885=_0x3157ae[_0x6d0c8b];return _0x491885;}export const datasetSdkDoc={'service':a24_0xa3b7bb(0xa5),'command':'sdk-doc','description':a24_0xa3b7bb(0xa1),'risk':a24_0xa3b7bb(0xac),'flags':[{...CODE_FLAG,'description':a24_0xa3b7bb(0xa8)}],async 'execute'(_0x3baf61){const _0x17b68b=a24_0xa3b7bb,_0x4f55cf=_0x3baf61[_0x17b68b(0xa2)](_0x17b68b(0x9e)),_0xc2c44f=await getDatasetSdkUsageDoc(_0x4f55cf,_0x3baf61['appCode']);return{'ok':!![],'data':{'code':_0x4f55cf,'appCode':_0x3baf61[_0x17b68b(0x9d)],'markdown':formatDatasetSdkMarkdown(_0xc2c44f)}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x168d37=a25_0x4180;(function(_0xc85503,_0x104bf8){const _0x250bf1=a25_0x4180,_0x571a15=_0xc85503();while(!![]){try{const _0x3a42ac=-parseInt(_0x250bf1(0x140))/0x1*(parseInt(_0x250bf1(0x101))/0x2)+parseInt(_0x250bf1(0x115))/0x3*(-parseInt(_0x250bf1(0x116))/0x4)+-parseInt(_0x250bf1(0x10b))/0x5+parseInt(_0x250bf1(0x102))/0x6+-parseInt(_0x250bf1(0xfd))/0x7*(parseInt(_0x250bf1(0x144))/0x8)+parseInt(_0x250bf1(0xfa))/0x9+parseInt(_0x250bf1(0x105))/0xa;if(_0x3a42ac===_0x104bf8)break;else _0x571a15['push'](_0x571a15['shift']());}catch(_0x3ed58a){_0x571a15['push'](_0x571a15['shift']());}}}(a25_0x4e4b,0x46653));import a25_0xdbac7 from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';function a25_0x4e4b(){const _0x531840=['arch','120qomsLs','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Config\x20JSON','80vilZWs','\x20\x20runtimeDomain:\x20\x20\x20','\x20\x20Auth','\x20\x20Service\x20Tree','Diagnose\x20CLI\x20configuration\x20and\x20environment','env','1023786TXmMno','✓\x20Valid\x20JSON','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','209335rGggZd','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20auth\x20(effective):\x20','(default)','586HZfKAM','2855154fiOMTD','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','9790670fNnACp','bold','✓\x20Loaded','(removed\x20—\x20cookie\x20auth\x20disabled)','appCode','registryPath','2137905pSHUGC','locale','(unnamed)','defaultApp','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','status','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Project','doctor','padEnd','51855znhWfU','120OSwvFq','✗\x20Invalid','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','check','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','currentApp','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','Global','red','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','source','accessKey','(none)','⚠\x20Empty\x20(treated\x20as\x20{})','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','empty','message','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20─','\x20(accessKey)','\x20commands)','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','serviceCount','(not\x20set)','\x20\x20API\x20Endpoints','commandCount','version','log','repeat','green','gray','(not\x20found)','length','yellow','path','(no\x20file)','(default:\x20','name','\x20\x20Merged\x20Config','serviceCode','\x20Imported\x20from:\x20'];a25_0x4e4b=function(){return _0x531840;};return a25_0x4e4b();}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(_0x1e5d30){const _0x24c257=a25_0x4180,_0x3b8840=getCliVersion(),_0x3f2307=buildConfigFromFlags({});await initGlobalEnvironment(_0x3f2307),console[_0x24c257(0x131)](),console[_0x24c257(0x131)](a25_0xdbac7[_0x24c257(0x106)](CLI_BIN_NAME+'\x20doctor')),console[_0x24c257(0x131)](a25_0xdbac7[_0x24c257(0x134)]('─'['repeat'](0x32))),console['log'](_0x24c257(0x104)+_0x3b8840),console[_0x24c257(0x131)]('\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+process[_0x24c257(0x130)]),console[_0x24c257(0x131)]('\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20'+process['platform']+'\x20'+process[_0x24c257(0x13f)]),console[_0x24c257(0x131)](),console[_0x24c257(0x131)](a25_0xdbac7[_0x24c257(0x106)]('\x20\x20Config\x20Files')),console['log'](a25_0xdbac7['gray']('\x20\x20─'['repeat'](0x1e)));const _0x2a329c=getGlobalConfigPath(),_0x507fd6=getProjectConfigPath();console[_0x24c257(0x131)](_0x24c257(0x12b)+(_0x2a329c||a25_0xdbac7[_0x24c257(0x134)]('(not\x20found)'))),console[_0x24c257(0x131)](_0x24c257(0x141)+(_0x507fd6||a25_0xdbac7['gray'](_0x24c257(0x135)))),console[_0x24c257(0x131)](),console[_0x24c257(0x131)](a25_0xdbac7[_0x24c257(0x106)](_0x24c257(0x143))),console[_0x24c257(0x131)](a25_0xdbac7[_0x24c257(0x134)](_0x24c257(0x128)['repeat'](0x1e)));const _0x114ae1=(_0x51b731,_0x120da9)=>{const _0xe321ef=_0x24c257;if(!_0x120da9){console['log']('\x20\x20'+_0x51b731['padEnd'](0x11)+'\x20'+a25_0xdbac7[_0xe321ef(0x134)](_0xe321ef(0x139)));return;}const _0x4da246=inspectCliConfigJsonFile(_0x120da9);if(_0x4da246[_0xe321ef(0x110)]==='ok')console[_0xe321ef(0x131)]('\x20\x20'+_0x51b731['padEnd'](0x11)+'\x20'+a25_0xdbac7[_0xe321ef(0x133)](_0xe321ef(0xfb)));else{if(_0x4da246['status']==='empty')console['log']('\x20\x20'+_0x51b731['padEnd'](0x11)+'\x20'+a25_0xdbac7[_0xe321ef(0x137)](_0xe321ef(0x123)));else _0x4da246[_0xe321ef(0x110)]==='missing'?console[_0xe321ef(0x131)]('\x20\x20'+_0x51b731['padEnd'](0x11)+'\x20'+a25_0xdbac7[_0xe321ef(0x134)]('(missing)')):(console[_0xe321ef(0x131)]('\x20\x20'+_0x51b731[_0xe321ef(0x114)](0x11)+'\x20'+a25_0xdbac7[_0xe321ef(0x11e)]('✗\x20Invalid\x20JSON')),console[_0xe321ef(0x131)]('\x20\x20'+''[_0xe321ef(0x114)](0x11)+'\x20'+a25_0xdbac7['red'](_0x4da246[_0xe321ef(0x126)])));}};_0x114ae1(_0x24c257(0x11d),_0x2a329c),_0x114ae1(_0x24c257(0x112),_0x507fd6),console[_0x24c257(0x131)](),console['log'](a25_0xdbac7['bold'](_0x24c257(0x13c))),console[_0x24c257(0x131)](a25_0xdbac7[_0x24c257(0x134)](_0x24c257(0x128)[_0x24c257(0x132)](0x1e))),console[_0x24c257(0x131)]('\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x3f2307[_0x24c257(0x109)]||a25_0xdbac7[_0x24c257(0x11e)](_0x24c257(0x12d)))),console[_0x24c257(0x131)](_0x24c257(0x142)+_0x3f2307[_0x24c257(0xf9)]);const _0x34d585=isLegacyCompatConfigKey(_0x24c257(0x10c))?a25_0xdbac7[_0x24c257(0x134)](_0x3f2307[_0x24c257(0x10c)]+'\x20(legacy/compat\x20only)'):_0x3f2307['locale'];console[_0x24c257(0x131)](_0x24c257(0x111)+_0x34d585),console[_0x24c257(0x131)](_0x24c257(0xfc)+(_0x3f2307[_0x24c257(0x10e)]||a25_0xdbac7[_0x24c257(0x134)](_0x24c257(0x122)))),console['log'](_0x24c257(0x11f)+(_0x3f2307[_0x24c257(0x11b)]||a25_0xdbac7['gray'](_0x24c257(0x122)))),console['log']('\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x3f2307['format']||a25_0xdbac7[_0x24c257(0x134)](_0x24c257(0x13a)+DEFAULT_CONFIG_VALUES['format']+')'))),console['log'](_0x24c257(0x118)+(_0x3f2307['pageSize']??a25_0xdbac7[_0x24c257(0x134)](_0x24c257(0x100)))),console[_0x24c257(0x131)](_0x24c257(0x103)+_0x3f2307['riskLevel']),console[_0x24c257(0x131)](_0x24c257(0xfe)+_0x3f2307['verbose']),console[_0x24c257(0x131)](_0x24c257(0xff)+AUTH_MODE['ClientAk']),console['log'](_0x24c257(0x11a)+(_0x3f2307['accessKey']?a25_0xdbac7[_0x24c257(0x133)]('(set,\x20length='+_0x3f2307[_0x24c257(0x121)][_0x24c257(0x136)]+')'):a25_0xdbac7[_0x24c257(0x134)](_0x24c257(0x122)))),console[_0x24c257(0x131)](),console[_0x24c257(0x131)](a25_0xdbac7[_0x24c257(0x106)](_0x24c257(0x12e))),console['log'](a25_0xdbac7[_0x24c257(0x134)]('\x20\x20─'[_0x24c257(0x132)](0x1e))),console[_0x24c257(0x131)]('\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20'+getApiDomain()),console['log'](_0x24c257(0x124)+getUserDomain()),console['log'](_0x24c257(0xf5)+getRuntimeDomain()),console[_0x24c257(0x131)](),console[_0x24c257(0x131)](a25_0xdbac7[_0x24c257(0x106)](_0x24c257(0xf7))),console[_0x24c257(0x131)](a25_0xdbac7['gray'](_0x24c257(0x128)[_0x24c257(0x132)](0x1e)));const _0x354bc3=inspectServiceRegistry();console[_0x24c257(0x131)](_0x24c257(0x127)+_0x354bc3[_0x24c257(0x10a)]),console['log'](_0x24c257(0x10f)+formatServiceRegistryStatus(_0x354bc3)),console[_0x24c257(0x131)]('\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20'+_0x354bc3[_0x24c257(0x12c)]),console[_0x24c257(0x131)](_0x24c257(0x11c)+_0x354bc3[_0x24c257(0x12f)]);for(const _0x481568 of _0x354bc3['services']){console['log']('\x20\x20'+(_0x481568[_0x24c257(0x13d)]+':')[_0x24c257(0x114)](0x11)+'\x20'+(_0x481568[_0x24c257(0x13b)]||a25_0xdbac7[_0x24c257(0x134)](_0x24c257(0x10d)))+'\x20('+_0x481568[_0x24c257(0x12f)]+_0x24c257(0x12a)),console['log']('\x20\x20'+''['padEnd'](0x11)+_0x24c257(0x13e)+_0x481568[_0x24c257(0x120)][_0x24c257(0x138)]);}return console[_0x24c257(0x131)](),console['log'](a25_0xdbac7[_0x24c257(0x106)](_0x24c257(0xf6))),console[_0x24c257(0x131)](a25_0xdbac7[_0x24c257(0x134)](_0x24c257(0x128)[_0x24c257(0x132)](0x1e))),console['log']('\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+a25_0xdbac7[_0x24c257(0x133)](AUTH_MODE['ClientAk']+_0x24c257(0x129))),console[_0x24c257(0x131)]('\x20\x20Session\x20check:\x20\x20\x20'+a25_0xdbac7['gray'](_0x24c257(0x108))),console[_0x24c257(0x131)](),{'ok':!![]};}function a25_0x4180(_0x4df565,_0x245101){_0x4df565=_0x4df565-0xf5;const _0x4e4b16=a25_0x4e4b();let _0x41804b=_0x4e4b16[_0x4df565];return _0x41804b;}function formatServiceRegistryStatus(_0x5aa356){const _0x545e40=a25_0x4180;if(_0x5aa356['status']==='ok')return a25_0xdbac7[_0x545e40(0x133)](_0x545e40(0x107));if(_0x5aa356[_0x545e40(0x110)]==='missing')return a25_0xdbac7[_0x545e40(0x134)](_0x545e40(0x135));if(_0x5aa356[_0x545e40(0x110)]===_0x545e40(0x125))return a25_0xdbac7[_0x545e40(0x137)]('⚠\x20Empty');return a25_0xdbac7['red'](_0x545e40(0x117)+(_0x5aa356[_0x545e40(0x126)]?':\x20'+_0x5aa356[_0x545e40(0x126)]:''));}export const doctorDefinition={'service':a25_0x168d37(0x113),'command':a25_0x168d37(0x119),'description':a25_0x168d37(0xf8),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x4ab39d=a26_0x58e0;(function(_0x2a4132,_0x3bf57b){const _0x461c75=a26_0x58e0,_0x81a0cb=_0x2a4132();while(!![]){try{const _0x7f266e=parseInt(_0x461c75(0x1a0))/0x1*(-parseInt(_0x461c75(0x1cc))/0x2)+-parseInt(_0x461c75(0x188))/0x3*(parseInt(_0x461c75(0x187))/0x4)+-parseInt(_0x461c75(0x18d))/0x5+-parseInt(_0x461c75(0x1c7))/0x6*(parseInt(_0x461c75(0x1a3))/0x7)+-parseInt(_0x461c75(0x191))/0x8*(parseInt(_0x461c75(0x1ca))/0x9)+-parseInt(_0x461c75(0x190))/0xa+-parseInt(_0x461c75(0x1a6))/0xb*(-parseInt(_0x461c75(0x1ac))/0xc);if(_0x7f266e===_0x3bf57b)break;else _0x81a0cb['push'](_0x81a0cb['shift']());}catch(_0x1bd28b){_0x81a0cb['push'](_0x81a0cb['shift']());}}}(a26_0x3865,0xcea7c));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a26_0x4ab39d(0x1a8),'type':a26_0x4ab39d(0x1be),'description':a26_0x4ab39d(0x199)},{'name':a26_0x4ab39d(0x18e),'type':a26_0x4ab39d(0x1be),'description':a26_0x4ab39d(0x19d)+DEFAULT_CONFIG_VALUES['env']+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x4ab39d(0x1b0),'type':a26_0x4ab39d(0x194),'description':a26_0x4ab39d(0x1a2)+PRODUCT_CONFIG[a26_0x4ab39d(0x184)]+a26_0x4ab39d(0x1ba),'default':![]},{'name':a26_0x4ab39d(0x195),'type':a26_0x4ab39d(0x194),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':a26_0x4ab39d(0x18c),'type':'string','description':a26_0x4ab39d(0x1c8),'required':!![]},{'name':a26_0x4ab39d(0x1a8),'type':a26_0x4ab39d(0x1be),'description':'Override\x20imported\x20default\x20appcode'},{'name':a26_0x4ab39d(0x18e),'type':'string','description':a26_0x4ab39d(0x189),'enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':'boolean','description':a26_0x4ab39d(0x1a2)+PRODUCT_CONFIG[a26_0x4ab39d(0x184)]+a26_0x4ab39d(0x1ba),'default':![]},{'name':'yes','type':a26_0x4ab39d(0x194),'description':a26_0x4ab39d(0x1a4),'default':![]}];export async function runInit(_0x3d8c70){const _0x4804eb=a26_0x4ab39d,_0x444dff=isNonInteractiveMode(_0x3d8c70),_0x438fa0=_0x3d8c70['global']?_0x4804eb(0x1b0):_0x4804eb(0x1b9),_0x18bf01=resolveWriteConfigPath(_0x438fa0);try{_0x444dff?await runNonInteractive(_0x3d8c70,_0x18bf01):await runInteractive(_0x3d8c70,_0x18bf01);}catch(_0x2a5d17){if(_0x2a5d17 instanceof AbortPrompt)throw CliErrors[_0x4804eb(0x181)]();throw _0x2a5d17;}}export async function runInitImport(_0x12ed09){const _0x18ea78=a26_0x4ab39d,_0x5a343d=_0x12ed09[_0x18ea78(0x1b0)]?'global':'project',_0x408391=resolveWriteConfigPath(_0x5a343d);await runFromImport(_0x12ed09,_0x408391);}const RUNTIME_IRRELEVANT_KEYS=new Set([a26_0x4ab39d(0x1af)]);async function runFromImport(_0x569530,_0x2fe64c){const _0x36723c=a26_0x4ab39d,_0x38e12a=resolveFilePath(_0x569530['file']);if(!existsSync(_0x38e12a))throw CliErrors[_0x36723c(0x197)](_0x36723c(0x1bf)+_0x38e12a);const _0x2bd3f5=readSourceFile(_0x38e12a),_0x15fbbd=convertToRuntimeConfig(_0x2bd3f5);_0x569530[_0x36723c(0x1a8)]&&(_0x15fbbd[_0x36723c(0x1a8)]=String(_0x569530['appcode']));_0x569530[_0x36723c(0x18e)]&&(_0x15fbbd[_0x36723c(0x18e)]=resolveInitEnv(_0x569530));if(!_0x15fbbd[_0x36723c(0x1a8)])throw CliErrors[_0x36723c(0x197)](_0x36723c(0x1b7),_0x36723c(0x1bb));await writeInitConfig(_0x2fe64c,_0x15fbbd,_0x569530),console['log'](_0x36723c(0x1cb)+_0x38e12a),console[_0x36723c(0x1b1)](_0x36723c(0x192)+_0x2fe64c),console[_0x36723c(0x1b1)]('\x20\x20appcode:\x20'+_0x15fbbd['appcode']);if(_0x15fbbd['defaultApp'])console['log'](_0x36723c(0x1b6)+_0x15fbbd[_0x36723c(0x185)]);}function convertToRuntimeConfig(_0xb687b2){const _0x1df42c=a26_0x4ab39d;if(_0xb687b2[_0x1df42c(0x1ad)]&&typeof _0xb687b2[_0x1df42c(0x1ad)]===_0x1df42c(0x193))throw CliErrors[_0x1df42c(0x197)](_0x1df42c(0x186),_0x1df42c(0x1b8));const _0x532e49={};for(const _0x2f07f6 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0xb687b2[_0x2f07f6]!==undefined&&(_0x532e49[_0x2f07f6]=_0xb687b2[_0x2f07f6]);}return!_0x532e49[_0x1df42c(0x1aa)]&&(_0x532e49['riskLevel']=DEFAULT_CONFIG_VALUES[_0x1df42c(0x1aa)]),_0x532e49;}async function runNonInteractive(_0x4e9e12,_0x5efe5a){const _0x5c1b95=a26_0x4ab39d,_0x4dcfb3=_0x4e9e12[_0x5c1b95(0x1a8)];if(!_0x4dcfb3)throw CliErrors[_0x5c1b95(0x19b)](_0x5c1b95(0x1a8),_0x5c1b95(0x183)+CLI_BIN_NAME+_0x5c1b95(0x1b5));const _0x4bcf43=resolveInitEnv(_0x4e9e12);await writeInitConfig(_0x5efe5a,{'appcode':_0x4dcfb3,'env':_0x4bcf43},_0x4e9e12),console[_0x5c1b95(0x1b1)](_0x5c1b95(0x1c5)+_0x5efe5a),console[_0x5c1b95(0x1b1)](_0x5c1b95(0x1a1)+_0x4dcfb3),console[_0x5c1b95(0x1b1)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x4bcf43);}async function runInteractive(_0x40fec3,_0x4aed2d){const _0xf24e66=a26_0x4ab39d,_0x2dfe64=loadExisting(_0x4aed2d),_0x18e5c4=typeof _0x2dfe64?.[_0xf24e66(0x1a8)]===_0xf24e66(0x1be)?_0x2dfe64[_0xf24e66(0x1a8)]:'',_0x15e089=resolveInitEnv(_0x40fec3);console['log'](CLI_BIN_NAME+_0xf24e66(0x1ae)+PRODUCT_CONFIG[_0xf24e66(0x184)]+'\x0a');if(existsSync(_0x4aed2d)&&!_0x40fec3[_0xf24e66(0x195)]){const _0xbf0446=await promptYesNo(_0xf24e66(0x1a5)+_0x4aed2d+_0xf24e66(0x198),![]);if(!_0xbf0446){console[_0xf24e66(0x1b1)](_0xf24e66(0x1c9));return;}}const _0x27da9c=typeof _0x40fec3[_0xf24e66(0x1a8)]==='string'?_0x40fec3[_0xf24e66(0x1a8)][_0xf24e66(0x18a)]():'';let _0x540d98=_0x27da9c;!_0x540d98&&(_0x540d98=await promptInput(_0xf24e66(0x19e),_0x18e5c4));if(!_0x540d98[_0xf24e66(0x18a)]())throw CliErrors['validation'](_0xf24e66(0x1c0));await writeInitConfig(_0x4aed2d,{'appcode':_0x540d98[_0xf24e66(0x18a)](),'env':_0x15e089},_0x40fec3),console[_0xf24e66(0x1b1)](_0xf24e66(0x1c6)+_0x4aed2d),console[_0xf24e66(0x1b1)](_0xf24e66(0x1a1)+_0x540d98[_0xf24e66(0x18a)]()),console['log']('\x20\x20env:\x20\x20\x20\x20\x20'+_0x15e089);}async function writeInitConfig(_0x3db41a,_0x8c3a25,_0x3a5eb4){const _0x4ce7c0=a26_0x4ab39d;let _0x1cd372={};existsSync(_0x3db41a)&&!_0x3a5eb4['yes']&&(_0x1cd372=readConfigFile(_0x3db41a));for(const [_0x14095e,_0x1a89a9]of Object['entries'](_0x8c3a25)){_0x1a89a9!==undefined&&(_0x1cd372[_0x14095e]=_0x1a89a9);}if(_0x1cd372[_0x4ce7c0(0x1c4)])delete _0x1cd372['app'];writeConfigFile(_0x3db41a,_0x1cd372);}class AbortPrompt extends Error{constructor(){const _0x129f1e=a26_0x4ab39d;super(_0x129f1e(0x18f)),this[_0x129f1e(0x196)]=_0x129f1e(0x1b3);}}function createSafeRl(){const _0x534aa6=a26_0x4ab39d,_0x5eae1d=createInterface({'input':process[_0x534aa6(0x1c3)],'output':process['stdout']});let _0x32013c;const _0x17f86f=new Promise((_0x37a002,_0x3987f5)=>{_0x32013c=()=>{const _0x37b22e=a26_0x58e0;_0x32013c&&(_0x5eae1d[_0x37b22e(0x1a7)](_0x37b22e(0x19f),_0x32013c),_0x32013c=undefined);try{_0x5eae1d[_0x37b22e(0x1a9)]();}catch{}_0x3987f5(new AbortPrompt());},_0x5eae1d['once']('SIGINT',_0x32013c);}),_0x3e54dc=()=>{const _0x5919a4=_0x534aa6;_0x32013c&&(_0x5eae1d[_0x5919a4(0x1a7)](_0x5919a4(0x19f),_0x32013c),_0x32013c=undefined);try{_0x5eae1d['close']();}catch{}};return{'rl':_0x5eae1d,'abortPromise':_0x17f86f,'disposeSuccess':_0x3e54dc};}async function promptInput(_0x3b7222,_0x30f4f8){const _0x315485=a26_0x4ab39d,{rl:_0x48f330,abortPromise:_0x77f4a3,disposeSuccess:_0x30aa62}=createSafeRl(),_0x24cdda=new Promise(_0x1bf32f=>{const _0x1b2780=_0x30f4f8?'\x20\x20'+_0x3b7222+'\x20('+_0x30f4f8+'):\x20':'\x20\x20'+_0x3b7222+':\x20';_0x48f330['question'](_0x1b2780,_0x534bd2=>{const _0x45d346=a26_0x58e0;_0x30aa62(),_0x1bf32f(_0x534bd2[_0x45d346(0x18a)]()||_0x30f4f8);});});return Promise[_0x315485(0x1c2)]([_0x24cdda,_0x77f4a3]);}function a26_0x3865(){const _0x18f79d=['Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','8wrvQIN','925341eElSpE','Override\x20imported\x20default\x20env','trim','\x22.\x20Allowed:\x20','file','2920530RlcRQH','env','User\x20aborted\x20prompt','3101310yGjlzQ','20976NsMOUb','\x20\x20config:\x20\x20','object','boolean','yes','name','validation','\x20already\x20exists.\x20Overwrite?','App\x20code\x20for\x20the\x20project','Invalid\x20env\x20\x22','flagMissing','Failed\x20to\x20parse\x20source\x20file:\x20','Target\x20environment\x20(default\x20','App\x20code','SIGINT','92401mFIjhZ','\x20\x20appcode:\x20','Write\x20to\x20global\x20(~/','1396199DRghQS','Skip\x20confirmation\x20when\x20overwriting','File\x20','50701717ovFyHb','removeListener','appcode','close','riskLevel','join','12SwJrsB','apps','\x20init\x20—\x20Create\x20','apiDir','global','log','message','AbortPrompt','utf8','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','\x20\x20default:\x20','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','project',')\x20instead\x20of\x20project','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`.','includes','cwd','string','Source\x20file\x20not\x20found:\x20','App\x20code\x20cannot\x20be\x20empty.','parse','race','stdin','app','Initialized\x20','\x0aInitialized\x20','6QHpQJz','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','Aborted.','4824QDgWjr','Imported\x20from\x20','14znZPdm','cancelled','question','Usage:\x20','newConfigFileName','defaultApp'];a26_0x3865=function(){return _0x18f79d;};return a26_0x3865();}async function promptYesNo(_0x117a4a,_0x1f36bd){const _0x27aa56=a26_0x4ab39d,{rl:_0x439bac,abortPromise:_0x30d920,disposeSuccess:_0x27f2f9}=createSafeRl(),_0x297835=new Promise(_0x49897a=>{const _0x20f092=a26_0x58e0,_0x55c14c=_0x1f36bd?'[Y/n]':'[y/N]';_0x439bac[_0x20f092(0x182)]('\x20\x20'+_0x117a4a+'\x20'+_0x55c14c+':\x20',_0x214741=>{const _0x124ada=_0x20f092;_0x27f2f9();const _0xec89a4=_0x214741[_0x124ada(0x18a)]()['toLowerCase']();if(_0xec89a4==='y'||_0xec89a4===_0x124ada(0x195))_0x49897a(!![]);else{if(_0xec89a4==='n'||_0xec89a4==='no')_0x49897a(![]);else _0x49897a(_0x1f36bd);}});});return Promise[_0x27aa56(0x1c2)]([_0x297835,_0x30d920]);}function loadExisting(_0x35e496){if(!existsSync(_0x35e496))return null;return readConfigFile(_0x35e496);}function a26_0x58e0(_0x6f55a9,_0x791282){_0x6f55a9=_0x6f55a9-0x181;const _0x3865c7=a26_0x3865();let _0x58e051=_0x3865c7[_0x6f55a9];return _0x58e051;}function resolveFilePath(_0x11fd96){const _0x50483f=a26_0x4ab39d;return isAbsolute(_0x11fd96)?_0x11fd96:resolve(process[_0x50483f(0x1bd)](),_0x11fd96);}function readSourceFile(_0x2ed2ae){const _0x18cda6=a26_0x4ab39d;try{const _0x5b7964=readFileSync(_0x2ed2ae,{'encoding':_0x18cda6(0x1b4)});return JSON[_0x18cda6(0x1c1)](_0x5b7964);}catch(_0x369101){throw CliErrors['validation'](_0x18cda6(0x19c)+_0x369101[_0x18cda6(0x1b2)]);}}function resolveInitEnv(_0xf74f84){const _0x1fafc1=a26_0x4ab39d,_0x1c938c=_0xf74f84['env'];if(_0x1c938c===undefined||_0x1c938c==='')return DEFAULT_CONFIG_VALUES[_0x1fafc1(0x18e)];if(!RUNTIME_ENV_VALUES[_0x1fafc1(0x1bc)](_0x1c938c))throw CliErrors[_0x1fafc1(0x197)](_0x1fafc1(0x19a)+_0x1c938c+_0x1fafc1(0x18b)+RUNTIME_ENV_VALUES[_0x1fafc1(0x1ab)](',\x20'));return _0x1c938c;}
|
|
1
|
+
const a26_0x1366c4=a26_0x2d35;(function(_0x53330a,_0x24e3dc){const _0x3ff478=a26_0x2d35,_0x1ca549=_0x53330a();while(!![]){try{const _0x2f0111=-parseInt(_0x3ff478(0x11c))/0x1+parseInt(_0x3ff478(0xf8))/0x2*(parseInt(_0x3ff478(0x120))/0x3)+parseInt(_0x3ff478(0x133))/0x4+-parseInt(_0x3ff478(0xfa))/0x5+-parseInt(_0x3ff478(0xff))/0x6*(parseInt(_0x3ff478(0x10a))/0x7)+parseInt(_0x3ff478(0x116))/0x8*(parseInt(_0x3ff478(0xf7))/0x9)+parseInt(_0x3ff478(0x110))/0xa*(-parseInt(_0x3ff478(0x10c))/0xb);if(_0x2f0111===_0x24e3dc)break;else _0x1ca549['push'](_0x1ca549['shift']());}catch(_0xd06bc2){_0x1ca549['push'](_0x1ca549['shift']());}}}(a26_0x5cde,0x92b4d));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a26_0x1366c4(0x106),'type':a26_0x1366c4(0x12a),'description':a26_0x1366c4(0xfc)},{'name':a26_0x1366c4(0x102),'type':a26_0x1366c4(0x12a),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES[a26_0x1366c4(0x102)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x1366c4(0x11a),'type':a26_0x1366c4(0x123),'description':a26_0x1366c4(0x117)+PRODUCT_CONFIG[a26_0x1366c4(0x105)]+a26_0x1366c4(0x136),'default':![]},{'name':a26_0x1366c4(0x137),'type':a26_0x1366c4(0x123),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':a26_0x1366c4(0x128),'type':a26_0x1366c4(0x12a),'description':a26_0x1366c4(0x113),'required':!![]},{'name':a26_0x1366c4(0x106),'type':a26_0x1366c4(0x12a),'description':'Override\x20imported\x20default\x20appcode'},{'name':'env','type':a26_0x1366c4(0x12a),'description':a26_0x1366c4(0xfd),'enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x1366c4(0x11a),'type':a26_0x1366c4(0x123),'description':a26_0x1366c4(0x117)+PRODUCT_CONFIG[a26_0x1366c4(0x105)]+a26_0x1366c4(0x136),'default':![]},{'name':a26_0x1366c4(0x137),'type':'boolean','description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x3d7c4c){const _0x333aad=a26_0x1366c4,_0x44cd30=isNonInteractiveMode(_0x3d7c4c),_0x4a0cef=_0x3d7c4c[_0x333aad(0x11a)]?'global':_0x333aad(0x12f),_0x3fde7d=resolveWriteConfigPath(_0x4a0cef);try{_0x44cd30?await runNonInteractive(_0x3d7c4c,_0x3fde7d):await runInteractive(_0x3d7c4c,_0x3fde7d);}catch(_0x113e27){if(_0x113e27 instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0x113e27;}}export async function runInitImport(_0x36a0ed){const _0x11fa56=a26_0x1366c4,_0x325c10=_0x36a0ed[_0x11fa56(0x11a)]?_0x11fa56(0x11a):_0x11fa56(0x12f),_0x55f6bc=resolveWriteConfigPath(_0x325c10);await runFromImport(_0x36a0ed,_0x55f6bc);}const RUNTIME_IRRELEVANT_KEYS=new Set([a26_0x1366c4(0xfe)]);async function runFromImport(_0x300875,_0x3afac7){const _0x3b89f8=a26_0x1366c4,_0x3599cd=resolveFilePath(_0x300875[_0x3b89f8(0x128)]);if(!existsSync(_0x3599cd))throw CliErrors[_0x3b89f8(0x138)](_0x3b89f8(0x11e)+_0x3599cd);const _0x2ceae9=readSourceFile(_0x3599cd),_0x3a46d5=convertToRuntimeConfig(_0x2ceae9);_0x300875[_0x3b89f8(0x106)]&&(_0x3a46d5['appcode']=String(_0x300875['appcode']));_0x300875[_0x3b89f8(0x102)]&&(_0x3a46d5[_0x3b89f8(0x102)]=resolveInitEnv(_0x300875));if(!_0x3a46d5['appcode'])throw CliErrors[_0x3b89f8(0x138)](_0x3b89f8(0x12b),'Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.');await writeInitConfig(_0x3afac7,_0x3a46d5,_0x300875),console[_0x3b89f8(0x10d)](_0x3b89f8(0x115)+_0x3599cd),console[_0x3b89f8(0x10d)](_0x3b89f8(0x118)+_0x3afac7),console[_0x3b89f8(0x10d)](_0x3b89f8(0x12c)+_0x3a46d5[_0x3b89f8(0x106)]);if(_0x3a46d5['defaultApp'])console[_0x3b89f8(0x10d)](_0x3b89f8(0x124)+_0x3a46d5[_0x3b89f8(0x129)]);}function convertToRuntimeConfig(_0x331ed5){const _0x29404c=a26_0x1366c4;if(_0x331ed5[_0x29404c(0x10b)]&&typeof _0x331ed5['apps']===_0x29404c(0x111))throw CliErrors[_0x29404c(0x138)](_0x29404c(0x139),_0x29404c(0x131));const _0x4a478d={};for(const _0x17ee88 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x331ed5[_0x17ee88]!==undefined&&(_0x4a478d[_0x17ee88]=_0x331ed5[_0x17ee88]);}return!_0x4a478d[_0x29404c(0x100)]&&(_0x4a478d[_0x29404c(0x100)]=DEFAULT_CONFIG_VALUES[_0x29404c(0x100)]),_0x4a478d;}async function runNonInteractive(_0x3884f5,_0x1de065){const _0x326913=a26_0x1366c4,_0x1e96f6=_0x3884f5[_0x326913(0x106)];if(!_0x1e96f6)throw CliErrors[_0x326913(0x108)](_0x326913(0x106),'Usage:\x20'+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x408ed7=resolveInitEnv(_0x3884f5);await writeInitConfig(_0x1de065,{'appcode':_0x1e96f6,'env':_0x408ed7},_0x3884f5),console['log'](_0x326913(0x12e)+_0x1de065),console[_0x326913(0x10d)](_0x326913(0x12c)+_0x1e96f6),console[_0x326913(0x10d)](_0x326913(0x132)+_0x408ed7);}async function runInteractive(_0xb2f3fa,_0x32ab90){const _0x59642f=a26_0x1366c4,_0x8031ee=loadExisting(_0x32ab90),_0x59e843=typeof _0x8031ee?.[_0x59642f(0x106)]==='string'?_0x8031ee[_0x59642f(0x106)]:'',_0x19ce8a=resolveInitEnv(_0xb2f3fa);console[_0x59642f(0x10d)](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG[_0x59642f(0x105)]+'\x0a');if(existsSync(_0x32ab90)&&!_0xb2f3fa[_0x59642f(0x137)]){const _0x2254c4=await promptYesNo('File\x20'+_0x32ab90+_0x59642f(0x11d),![]);if(!_0x2254c4){console[_0x59642f(0x10d)](_0x59642f(0x10f));return;}}const _0x4400a9=typeof _0xb2f3fa[_0x59642f(0x106)]===_0x59642f(0x12a)?_0xb2f3fa[_0x59642f(0x106)]['trim']():'';let _0x1c3ea0=_0x4400a9;!_0x1c3ea0&&(_0x1c3ea0=await promptInput(_0x59642f(0x127),_0x59e843));if(!_0x1c3ea0[_0x59642f(0x10e)]())throw CliErrors[_0x59642f(0x138)](_0x59642f(0x13a));await writeInitConfig(_0x32ab90,{'appcode':_0x1c3ea0[_0x59642f(0x10e)](),'env':_0x19ce8a},_0xb2f3fa),console[_0x59642f(0x10d)](_0x59642f(0x125)+_0x32ab90),console[_0x59642f(0x10d)](_0x59642f(0x12c)+_0x1c3ea0['trim']()),console['log'](_0x59642f(0x132)+_0x19ce8a);}async function writeInitConfig(_0x25481e,_0x460bd6,_0x525b8f){const _0x3e8e95=a26_0x1366c4;let _0x5448d7={};existsSync(_0x25481e)&&!_0x525b8f[_0x3e8e95(0x137)]&&(_0x5448d7=readConfigFile(_0x25481e));for(const [_0x29d21a,_0x16f89a]of Object['entries'](_0x460bd6)){_0x16f89a!==undefined&&(_0x5448d7[_0x29d21a]=_0x16f89a);}if(_0x5448d7[_0x3e8e95(0x122)])delete _0x5448d7['app'];writeConfigFile(_0x25481e,_0x5448d7);}class AbortPrompt extends Error{constructor(){const _0x1a0401=a26_0x1366c4;super(_0x1a0401(0xfb)),this[_0x1a0401(0x11f)]='AbortPrompt';}}function createSafeRl(){const _0x2a5097=a26_0x1366c4,_0x22abc3=createInterface({'input':process[_0x2a5097(0xf9)],'output':process[_0x2a5097(0x103)]});let _0x3c48d9;const _0x2c8984=new Promise((_0x47e439,_0x4f8bf4)=>{const _0x28e49a=_0x2a5097;_0x3c48d9=()=>{const _0x50973f=a26_0x2d35;_0x3c48d9&&(_0x22abc3[_0x50973f(0x109)](_0x50973f(0x126),_0x3c48d9),_0x3c48d9=undefined);try{_0x22abc3['close']();}catch{}_0x4f8bf4(new AbortPrompt());},_0x22abc3[_0x28e49a(0x112)](_0x28e49a(0x126),_0x3c48d9);}),_0x165025=()=>{const _0x2a1ef6=_0x2a5097;_0x3c48d9&&(_0x22abc3[_0x2a1ef6(0x109)](_0x2a1ef6(0x126),_0x3c48d9),_0x3c48d9=undefined);try{_0x22abc3['close']();}catch{}};return{'rl':_0x22abc3,'abortPromise':_0x2c8984,'disposeSuccess':_0x165025};}async function promptInput(_0x3b867c,_0x30a797){const _0x256775=a26_0x1366c4,{rl:_0x32e2f4,abortPromise:_0xabf554,disposeSuccess:_0xebbc7a}=createSafeRl(),_0x47fdec=new Promise(_0x298295=>{const _0x25a4c0=a26_0x2d35,_0x3f6751=_0x30a797?'\x20\x20'+_0x3b867c+'\x20('+_0x30a797+_0x25a4c0(0x11b):'\x20\x20'+_0x3b867c+':\x20';_0x32e2f4[_0x25a4c0(0x130)](_0x3f6751,_0x3e68f7=>{const _0x1710d5=_0x25a4c0;_0xebbc7a(),_0x298295(_0x3e68f7[_0x1710d5(0x10e)]()||_0x30a797);});});return Promise[_0x256775(0x119)]([_0x47fdec,_0xabf554]);}async function promptYesNo(_0x5a5af3,_0x1cc064){const _0x2aac78=a26_0x1366c4,{rl:_0x295194,abortPromise:_0x319fbd,disposeSuccess:_0x259638}=createSafeRl(),_0x2fdf3d=new Promise(_0x5c4a9f=>{const _0x1ec59b=a26_0x2d35,_0x576fc7=_0x1cc064?'[Y/n]':_0x1ec59b(0x121);_0x295194[_0x1ec59b(0x130)]('\x20\x20'+_0x5a5af3+'\x20'+_0x576fc7+':\x20',_0x3d125b=>{const _0x379ae1=_0x1ec59b;_0x259638();const _0x4b0f3b=_0x3d125b[_0x379ae1(0x10e)]()['toLowerCase']();if(_0x4b0f3b==='y'||_0x4b0f3b===_0x379ae1(0x137))_0x5c4a9f(!![]);else{if(_0x4b0f3b==='n'||_0x4b0f3b==='no')_0x5c4a9f(![]);else _0x5c4a9f(_0x1cc064);}});});return Promise[_0x2aac78(0x119)]([_0x2fdf3d,_0x319fbd]);}function loadExisting(_0x5d4fff){if(!existsSync(_0x5d4fff))return null;return readConfigFile(_0x5d4fff);}function resolveFilePath(_0x3fe8e2){const _0x12dbf5=a26_0x1366c4;return isAbsolute(_0x3fe8e2)?_0x3fe8e2:resolve(process[_0x12dbf5(0x104)](),_0x3fe8e2);}function readSourceFile(_0x44cd02){const _0x10ac1c=a26_0x1366c4;try{const _0x2fb13a=readFileSync(_0x44cd02,{'encoding':_0x10ac1c(0x13b)});return JSON[_0x10ac1c(0x12d)](_0x2fb13a);}catch(_0x214256){throw CliErrors['validation'](_0x10ac1c(0x107)+_0x214256['message']);}}function resolveInitEnv(_0x5e7f3c){const _0x3dab2d=a26_0x1366c4,_0x521392=_0x5e7f3c[_0x3dab2d(0x102)];if(_0x521392===undefined||_0x521392==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x3dab2d(0x114)](_0x521392))throw CliErrors[_0x3dab2d(0x138)](_0x3dab2d(0x134)+_0x521392+_0x3dab2d(0x101)+RUNTIME_ENV_VALUES[_0x3dab2d(0x135)](',\x20'));return _0x521392;}function a26_0x2d35(_0x287afc,_0x58587c){_0x287afc=_0x287afc-0xf7;const _0x5cde90=a26_0x5cde();let _0x2d3501=_0x5cde90[_0x287afc];return _0x2d3501;}function a26_0x5cde(){const _0x50324e=['utf8','333pOyDle','172mBTnzD','stdin','204005TVEXzE','User\x20aborted\x20prompt','App\x20code\x20for\x20the\x20project','Override\x20imported\x20default\x20env','apiDir','30ZPZQkA','riskLevel','\x22.\x20Allowed:\x20','env','stdout','cwd','newConfigFileName','appcode','Failed\x20to\x20parse\x20source\x20file:\x20','flagMissing','removeListener','1390585wKVPRR','apps','836xVQbcR','log','trim','Aborted.','35530XGaPwd','object','once','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','includes','Imported\x20from\x20','143048wHdeai','Write\x20to\x20global\x20(~/','\x20\x20config:\x20\x20','race','global','):\x20','346744yFAKkS','\x20already\x20exists.\x20Overwrite?','Source\x20file\x20not\x20found:\x20','name','32418Qzgxpw','[y/N]','app','boolean','\x20\x20default:\x20','\x0aInitialized\x20','SIGINT','App\x20code','file','defaultApp','string','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','\x20\x20appcode:\x20','parse','Initialized\x20','project','question','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','\x20\x20env:\x20\x20\x20\x20\x20','2643376QwSHHc','Invalid\x20env\x20\x22','join',')\x20instead\x20of\x20project','yes','validation','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','App\x20code\x20cannot\x20be\x20empty.'];a26_0x5cde=function(){return _0x50324e;};return a26_0x5cde();}
|