@lovrabet/lovrabet-cli 2.0.6 → 2.0.8
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/app/cache.js +1 -1
- package/lib/commands/app/definitions.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/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/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/doctor.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.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 -0
- package/lib/config/schema.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 -0
- 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 -0
- 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/help.js +1 -1
- package/lib/skills/npx-skills-add.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/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
package/lib/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
const a0_0x4b29dc=a0_0x1a67;(function(_0x28c9e3,_0x20be6e){const _0x232eb3=a0_0x1a67,_0x5e1232=_0x28c9e3();while(!![]){try{const _0xb8855d=parseInt(_0x232eb3(0xdd))/0x1*(-parseInt(_0x232eb3(0xda))/0x2)+-parseInt(_0x232eb3(0xe2))/0x3*(parseInt(_0x232eb3(0xdb))/0x4)+parseInt(_0x232eb3(0xe5))/0x5*(-parseInt(_0x232eb3(0xef))/0x6)+-parseInt(_0x232eb3(0xce))/0x7*(parseInt(_0x232eb3(0xed))/0x8)+-parseInt(_0x232eb3(0xc5))/0x9*(parseInt(_0x232eb3(0xe9))/0xa)+-parseInt(_0x232eb3(0xc3))/0xb*(-parseInt(_0x232eb3(0xc6))/0xc)+parseInt(_0x232eb3(0xde))/0xd;if(_0xb8855d===_0x20be6e)break;else _0x5e1232['push'](_0x5e1232['shift']());}catch(_0x3ccc7e){_0x5e1232['push'](_0x5e1232['shift']());}}}(a0_0x140a,0x18c49));import{jsx as a0_0x106b03}from'react/jsx-runtime';import a0_0x51d9d8 from'meow';import{render}from'ink';function a0_0x140a(){const _0x7383fc=['defaultCommand','8JSgDjK','ExitPromptError','3570kIMNOa','catch','stderr',':\x20--','2596SYildm','hint','99reTsQb','4968vmYCrW','log','length','input','exit','flatMap','Error:\x20','code','430787kxZYwF','message','Hint:\x20','cancelled','error','assign','./framework/preparse.js','\x0aCancelled.\x0a','name','\x20->\x20--','[preparse]\x20','original','1186wvjExT','37292qiooKb','args','155hSwiVx','2981914QoVAZN','Unexpected\x20error:','handler','slice','3XHcsAi','write','help','385WEuDeD','ERR_STREAM_DESTROYED','ERR_USE_AFTER_CLOSE','exitCode','15490NAoUzV','unknownCommand','flags'];a0_0x140a=function(){return _0x7383fc;};return a0_0x140a();}import{Help}from'./help.js';import{CliError,CliErrors}from'./errors.js';import{buildConfigFromFlags,initGlobalEnvironment}from'./context.js';import{isKnownService,getServiceEntry,findDefinition,getAllDefinitions}from'./commands/registry.js';import{runCommand,createPipelineEnv}from'./framework/runner.js';import{generateCommandHelp,generateServiceHelp,generateFullHelp}from'./framework/help.js';function a0_0x1a67(_0x1102f1,_0x2fa911){_0x1102f1=_0x1102f1-0xc3;const _0x140ae1=a0_0x140a();let _0x1a676c=_0x140ae1[_0x1102f1];return _0x1a676c;}import{buildMeowFlags}from'./constant/cli.js';const helpText=generateFullHelp(),cli=a0_0x51d9d8(helpText,{'importMeta':import.meta,'flags':buildMeowFlags(),'autoVersion':!![]});void main()[a0_0x4b29dc(0xf0)](handleError);async function main(){try{await run();}catch(_0x5eed70){handleError(_0x5eed70);}}async function run(){const _0x37a3d5=a0_0x4b29dc;let _0x2544a5=cli[_0x37a3d5(0xc9)][0x0],_0x28bc55=cli[_0x37a3d5(0xc9)][0x1];const _0x1c6f3e=cli[_0x37a3d5(0xeb)];try{const {correctFlags:_0x5b0ce2}=await import(_0x37a3d5(0xd4)),_0x115866=getAllDefinitions()[_0x37a3d5(0xcb)](_0x1cdb73=>_0x1cdb73[_0x37a3d5(0xeb)]??[]),{flags:_0xc8941,corrections:_0x3d2ee1}=_0x5b0ce2(_0x1c6f3e,_0x115866);if(_0x3d2ee1[_0x37a3d5(0xc8)]>0x0){for(const _0x166a65 of _0x3d2ee1){process[_0x37a3d5(0xf1)]['write'](_0x37a3d5(0xd8)+_0x166a65[_0x37a3d5(0xe0)]+_0x37a3d5(0xf2)+_0x166a65[_0x37a3d5(0xd9)]+_0x37a3d5(0xd7)+_0x166a65['corrected']+'\x0a');}Object[_0x37a3d5(0xd3)](_0x1c6f3e,_0xc8941);}}catch{}if(!_0x2544a5||!isKnownService(_0x2544a5)){const {waitUntilExit:_0x49605a}=render(a0_0x106b03(Help,{}));await _0x49605a();return;}const _0xc31c74=getServiceEntry(_0x2544a5);if(!_0x28bc55){if(_0x1c6f3e[_0x37a3d5(0xe4)]){console[_0x37a3d5(0xc7)](generateServiceHelp(_0x2544a5));return;}if(_0xc31c74[_0x37a3d5(0xec)])_0x28bc55=_0xc31c74[_0x37a3d5(0xec)];else{console['log'](generateServiceHelp(_0x2544a5));return;}}const _0x1e24ab=findDefinition(_0x2544a5,_0x28bc55);!_0x1e24ab&&(console[_0x37a3d5(0xc7)](generateServiceHelp(_0x2544a5)),handleError(CliErrors[_0x37a3d5(0xea)](_0x2544a5+'\x20'+_0x28bc55)));if(_0x1c6f3e[_0x37a3d5(0xe4)]){console[_0x37a3d5(0xc7)](generateCommandHelp(_0x1e24ab));return;}const _0x3af511=buildConfigFromFlags(_0x1c6f3e);await initGlobalEnvironment(_0x3af511);const _0xd6f537=createPipelineEnv(_0x3af511,_0x1c6f3e);_0xd6f537[_0x37a3d5(0xdc)]=cli[_0x37a3d5(0xc9)][_0x37a3d5(0xe1)](0x2),await runCommand(_0x1e24ab,_0xd6f537);}function handleError(_0x329d25){const _0x200c4b=a0_0x4b29dc;if(_0x329d25 instanceof CliError){_0x329d25[_0x200c4b(0xcd)]===_0x200c4b(0xd1)&&(process[_0x200c4b(0xf1)][_0x200c4b(0xe3)](_0x200c4b(0xd5)),process['exit'](0x0));console[_0x200c4b(0xd2)](_0x200c4b(0xcc)+_0x329d25[_0x200c4b(0xcf)]);if(_0x329d25[_0x200c4b(0xc4)])console['error'](_0x200c4b(0xd0)+_0x329d25[_0x200c4b(0xc4)]);process[_0x200c4b(0xca)](_0x329d25[_0x200c4b(0xe8)]);}isUserCancellation(_0x329d25)&&(process[_0x200c4b(0xf1)][_0x200c4b(0xe3)](_0x200c4b(0xd5)),process[_0x200c4b(0xca)](0x0)),console[_0x200c4b(0xd2)](_0x200c4b(0xdf),_0x329d25),process[_0x200c4b(0xca)](0x1);}function isUserCancellation(_0xb8e7ae){const _0x434359=a0_0x4b29dc;if(!(_0xb8e7ae instanceof Error))return![];if(_0xb8e7ae[_0x434359(0xd6)]===_0x434359(0xee))return!![];if(_0xb8e7ae[_0x434359(0xcd)]===_0x434359(0xe7))return!![];if(_0xb8e7ae['code']===_0x434359(0xe6))return!![];return![];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5eadf4,_0xa3b810){const _0x50bce4=a1_0x2143,_0x5e362e=_0x5eadf4();while(!![]){try{const _0x1ea21=parseInt(_0x50bce4(0x18d))/0x1*(parseInt(_0x50bce4(0x19b))/0x2)+-parseInt(_0x50bce4(0x17e))/0x3*(parseInt(_0x50bce4(0x18c))/0x4)+-parseInt(_0x50bce4(0x19a))/0x5+parseInt(_0x50bce4(0x192))/0x6+parseInt(_0x50bce4(0x180))/0x7+parseInt(_0x50bce4(0x191))/0x8+-parseInt(_0x50bce4(0x186))/0x9;if(_0x1ea21===_0xa3b810)break;else _0x5e362e['push'](_0x5e362e['shift']());}catch(_0x5a88f6){_0x5e362e['push'](_0x5e362e['shift']());}}}(a1_0x207e,0x2ff23));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';function a1_0x2143(_0x110914,_0x47c240){_0x110914=_0x110914-0x17e;const _0x207e28=a1_0x207e();let _0x21436f=_0x207e28[_0x110914];return _0x21436f;}function a1_0x207e(){const _0x514752=['EACCES','EXDEV','appName','28NcjDID','1BZAybT','cache','stringify','find','2856552LpDjpv','1189386wkfAhm','parse','homeDirName','digest','code','slice','items','appCode','1413405MGCKNL','768932OnvVZh','trim','98403CnBloZ','my-apps.json','284536JRyUZD','.tmp','EPERM','sha256','utf8','ak_','2445651gfknOF','update','isArray'];a1_0x207e=function(){return _0x514752;};return a1_0x207e();}import{dirname,resolve}from'node:path';import{PRODUCT_CONFIG}from'../../constant/product.js';function fingerprintAccessKey(_0x270a7b){const _0x3f1b9e=a1_0x2143,_0x28f41d=_0x270a7b['trim'](),_0x2563ac=_0x28f41d[_0x3f1b9e(0x197)](-0x6)||'unknown',_0x37f620=createHash(_0x3f1b9e(0x183))[_0x3f1b9e(0x187)](_0x28f41d)[_0x3f1b9e(0x195)]('hex')[_0x3f1b9e(0x197)](0x0,0xc);return _0x3f1b9e(0x185)+_0x2563ac+'_'+_0x37f620;}export function getAppCacheFilePath(_0x248541,_0x4be290){const _0x150d0=a1_0x2143;return resolve(homedir(),PRODUCT_CONFIG[_0x150d0(0x194)],_0x150d0(0x18e),_0x248541,fingerprintAccessKey(_0x4be290),_0x150d0(0x17f));}export function readCachedAppList(_0x57605d,_0x5922e7){const _0x50c330=a1_0x2143;if(!_0x5922e7?.[_0x50c330(0x19c)]())return null;const _0xd7681e=getAppCacheFilePath(_0x57605d,_0x5922e7);if(!existsSync(_0xd7681e))return null;try{const _0x2546d3=readFileSync(_0xd7681e,_0x50c330(0x184));if(!_0x2546d3[_0x50c330(0x19c)]())return null;const _0x1ae1e3=JSON[_0x50c330(0x193)](_0x2546d3);if(!Array[_0x50c330(0x188)](_0x1ae1e3[_0x50c330(0x198)]))return null;return _0x1ae1e3;}catch{return null;}}export function writeCachedAppList(_0xacda7d,_0x5f2adc,_0x5be9c0){const _0x2f1af6=a1_0x2143,_0x2e782f=getAppCacheFilePath(_0xacda7d,_0x5f2adc),_0x3d2eab=dirname(_0x2e782f);!existsSync(_0x3d2eab)&&mkdirSync(_0x3d2eab,{'recursive':!![]});const _0x6f5bfe=_0x2e782f+_0x2f1af6(0x181);try{writeFileSync(_0x6f5bfe,JSON[_0x2f1af6(0x18f)](_0x5be9c0,null,0x2)+'\x0a',{'encoding':_0x2f1af6(0x184),'mode':0x180});try{renameSync(_0x6f5bfe,_0x2e782f);}catch(_0x2f58dc){if(_0x2f58dc[_0x2f1af6(0x196)]===_0x2f1af6(0x182)||_0x2f58dc['code']===_0x2f1af6(0x18a)||_0x2f58dc['code']===_0x2f1af6(0x189)){writeFileSync(_0x2e782f,JSON[_0x2f1af6(0x18f)](_0x5be9c0,null,0x2)+'\x0a',{'encoding':_0x2f1af6(0x184)});try{unlinkSync(_0x6f5bfe);}catch{}}else throw _0x2f58dc;}}catch(_0x3490b9){try{unlinkSync(_0x6f5bfe);}catch{}throw _0x3490b9;}return _0x2e782f;}export function resolveCachedAppCode(_0x587dc8,_0x2ed688,_0x440df3){const _0xccbe3a=a1_0x2143;if(!_0x587dc8)return undefined;const _0xa2ad37=readCachedAppList(_0x2ed688,_0x440df3),_0x3b88b0=_0xa2ad37?.[_0xccbe3a(0x198)][_0xccbe3a(0x190)](_0x49d505=>_0x49d505[_0xccbe3a(0x18b)]===_0x587dc8);return _0x3b88b0?.[_0xccbe3a(0x199)]?.[_0xccbe3a(0x19c)]()||undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a2_0x51bf(_0x591655,_0xfa893b){_0x591655=_0x591655-0xaf;const _0x1e758e=a2_0x1e75();let _0x51bf74=_0x1e758e[_0x591655];return _0x51bf74;}function a2_0x1e75(){const _0x324213=['Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','map','list','no-cache','Refresh\x20the\x20local\x20app\x20cache\x20from\x20the\x20platform','items','\x20cached\x20app(s)\x20for\x20env=\x22','Missing\x20app\x20name.','source','\x22\x20not\x20found.','1612PxggyE','166672FjNIPY','List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','global','cache','appName','Use\x20`','production','appPublishStatus','type','Filter\x20by\x20environment\x20(default:\x20current\x20env)','bool','import','nonInteractive','fetchedAt','../../commands/app/cache.js','isCurrent','No\x20cached\x20apps\x20found.','str','boolean','project-default','defaultApp','mergedCli','Import\x20the\x20default\x20app\x20selection\x20from\x20a\x20.rabetbase.json\x20file','use','envName','accessKey','validation','length','5210wnxfVf','write','Default\x20app\x20set\x20to\x20\x22','Loaded\x20','23604690XzRWEy','find','init','150yBBlcn','string','from','cachePath','\x20app(s)\x20for\x20env=\x22','Available:\x20','name','local','appCode','globalPath','8843eUKDsL','env','\x20app\x20list`\x20to\x20discover\x20remote\x20apps.','Target\x20environment\x20(default:\x20current\x20env)','30522ouDZdU','projectPath','../../context.js','810669gKKkwy','Remote\x20app\x20name\x20to\x20activate','Usage:\x20','No\x20apps\x20found\x20on\x20the\x20platform.','1281wLEuti','app','7296660twPhSg','read','pull','args','../../commands/app/remote-source.js','Read\x20from\x20local\x20cache\x20only','Use\x20global\x20config\x20scope'];a2_0x1e75=function(){return _0x324213;};return a2_0x1e75();}const a2_0x165ac0=a2_0x51bf;(function(_0x314d7f,_0x45f02c){const _0x327b0d=a2_0x51bf,_0x313779=_0x314d7f();while(!![]){try{const _0x88e3b1=parseInt(_0x327b0d(0xd9))/0x1*(-parseInt(_0x327b0d(0xcf))/0x2)+parseInt(_0x327b0d(0xe0))/0x3+parseInt(_0x327b0d(0xf7))/0x4*(parseInt(_0x327b0d(0xc8))/0x5)+parseInt(_0x327b0d(0xdd))/0x6*(-parseInt(_0x327b0d(0xe4))/0x7)+parseInt(_0x327b0d(0xf8))/0x8+-parseInt(_0x327b0d(0xe6))/0x9+parseInt(_0x327b0d(0xcc))/0xa;if(_0x88e3b1===_0x45f02c)break;else _0x313779['push'](_0x313779['shift']());}catch(_0x5655ee){_0x313779['push'](_0x313779['shift']());}}}(a2_0x1e75,0xa2bc6));import{CliErrors}from'../../errors.js';import{initCreateFlagDefs,initImportFlagDefs,runInit,runInitImport}from'../../commands/init.js';import{getEnv,RUNTIME_ENV_VALUES}from'../../constant/env.js';import{buildAppProfileListFields}from'../../config/schema.js';import{CLI_BIN_NAME,readConfig,writeConfig,scopeLabel,enrichAppListItemsWithMergedSelection}from'../../commands/app/shared.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';const GLOBAL_FLAG={'name':a2_0x165ac0(0xfa),'type':a2_0x165ac0(0xbe),'description':a2_0x165ac0(0xec),'default':![]};function collectFlags(_0x30ffb5,_0x61b861){const _0x333519=a2_0x165ac0,_0x373462={};for(const _0x55f866 of _0x61b861){const _0x3713c5=_0x55f866[_0x333519(0xb4)]===_0x333519(0xbe)?_0x30ffb5[_0x333519(0xb6)](_0x55f866['name']):_0x30ffb5[_0x333519(0xbd)](_0x55f866[_0x333519(0xd5)]);if(_0x3713c5!==''&&_0x3713c5!==![])_0x373462[_0x55f866['name']]=_0x3713c5;}if(_0x30ffb5[_0x333519(0xb8)])_0x373462[_0x333519(0xb8)]=!![];return _0x373462;}const initDef={'service':a2_0x165ac0(0xe5),'command':a2_0x165ac0(0xce),'description':'Initialize\x20.lovrabet.json\x20config\x20file','risk':a2_0x165ac0(0xc9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initCreateFlagDefs,async 'execute'(_0x553f66){return await runInit(collectFlags(_0x553f66,initCreateFlagDefs)),{'ok':!![]};}},listDef={'service':a2_0x165ac0(0xe5),'command':a2_0x165ac0(0xef),'description':a2_0x165ac0(0xf9),'risk':a2_0x165ac0(0xe7),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':'env','type':a2_0x165ac0(0xd0),'description':a2_0x165ac0(0xb5),'enum':[...RUNTIME_ENV_VALUES]},{'name':a2_0x165ac0(0xd6),'type':a2_0x165ac0(0xbe),'description':'Read\x20app\x20list\x20from\x20local\x20cache\x20only','default':![]},{'name':a2_0x165ac0(0xf0),'type':'boolean','description':a2_0x165ac0(0xed),'default':![]}],async 'execute'(_0x181a85){const _0x313ea3=a2_0x165ac0,_0x121a7a=_0x181a85['str'](_0x313ea3(0xda))||_0x181a85[_0x313ea3(0xc4)]||getEnv()||_0x313ea3(0xb2),_0x49ec60=_0x181a85['bool']('local'),_0x1ef513=_0x181a85[_0x313ea3(0xb6)]('no-cache'),{readRawConfigWithLayers:_0x30a4d6,resolveDefaultAppSource:_0x708b67}=await import(_0x313ea3(0xdf)),{getRemoteAppList:_0x10cfe2}=await import(_0x313ea3(0xea)),{config:_0xde0f5,layers:_0x30f4f5}=_0x30a4d6(),_0x354c36=_0x708b67(_0x30f4f5),{defaultApp:_0x791b27}=_0xde0f5,_0x2f3211=await _0x10cfe2({'env':_0x121a7a,'accessKey':_0x181a85[_0x313ea3(0xc5)],'localOnly':_0x49ec60,'noCache':_0x1ef513}),_0x356dab=_0x2f3211[_0x313ea3(0xf2)][_0x313ea3(0xee)](_0x22d17e=>{const _0x288a5b=_0x313ea3;return{'name':_0x22d17e[_0x288a5b(0xb0)],'appcode':_0x22d17e[_0x288a5b(0xd7)],'named':!![],'definedIn':'remote','isDefault':_0x22d17e[_0x288a5b(0xb0)]===_0x791b27,...buildAppProfileListFields(_0x121a7a),'source':_0x2f3211['source'],'owner':_0x22d17e['appOwnerName']??null,'status':_0x22d17e[_0x288a5b(0xb3)]??null,'cachedAt':_0x2f3211['fetchedAt']};});enrichAppListItemsWithMergedSelection(_0x356dab,_0x181a85[_0x313ea3(0xc1)]);if(_0x356dab[_0x313ea3(0xc7)]===0x0)return{'ok':!![],'data':[],'message':_0x2f3211[_0x313ea3(0xf5)]==='cache'?_0x313ea3(0xbc):_0x313ea3(0xe3)};const _0x29ff82=_0x356dab[_0x313ea3(0xcd)](_0x2e2b0b=>_0x2e2b0b[_0x313ea3(0xbb)]===!![]),_0x2e1c1b=_0x791b27??_0x29ff82?.[_0x313ea3(0xd5)]??null,_0x2ae2e9={'env':_0x121a7a,'source':_0x2f3211[_0x313ea3(0xf5)],'fetchedAt':_0x2f3211[_0x313ea3(0xb9)],'cachePath':_0x2f3211[_0x313ea3(0xd2)],'globalPath':_0x30f4f5[_0x313ea3(0xd8)]??null,'projectPath':_0x30f4f5[_0x313ea3(0xde)]??null,'defaultApp':_0x2e1c1b,'defaultAppSource':_0x791b27!=null?_0x354c36:null};return{'ok':!![],'data':{'items':_0x356dab,'meta':_0x2ae2e9}};}},pullDef={'service':a2_0x165ac0(0xe5),'command':a2_0x165ac0(0xe8),'description':a2_0x165ac0(0xf1),'risk':a2_0x165ac0(0xc9),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a2_0x165ac0(0xda),'type':a2_0x165ac0(0xd0),'description':a2_0x165ac0(0xdc),'enum':[...RUNTIME_ENV_VALUES]},{'name':a2_0x165ac0(0xd6),'type':a2_0x165ac0(0xbe),'description':a2_0x165ac0(0xeb),'default':![]},{'name':a2_0x165ac0(0xf0),'type':a2_0x165ac0(0xbe),'description':a2_0x165ac0(0xed),'default':![]}],async 'execute'(_0xd2c136){const _0x532e78=a2_0x165ac0,_0x401372=_0xd2c136[_0x532e78(0xbd)](_0x532e78(0xda))||_0xd2c136[_0x532e78(0xc4)]||getEnv()||'production',_0x2497f5=_0xd2c136[_0x532e78(0xb6)](_0x532e78(0xd6)),_0x3a6523=_0xd2c136['bool'](_0x532e78(0xf0)),{getRemoteAppList:_0x3a2f1e}=await import(_0x532e78(0xea)),_0x2acaa3=await _0x3a2f1e({'env':_0x401372,'accessKey':_0xd2c136[_0x532e78(0xc5)],'localOnly':_0x2497f5,'noCache':_0x3a6523});return{'ok':!![],'data':{'total':_0x2acaa3['items'][_0x532e78(0xc7)],'env':_0x401372,'source':_0x2acaa3[_0x532e78(0xf5)],'fetchedAt':_0x2acaa3[_0x532e78(0xb9)],'cachePath':_0x2acaa3[_0x532e78(0xd2)]},'message':_0x2acaa3[_0x532e78(0xf5)]===_0x532e78(0xaf)?_0x532e78(0xcb)+_0x2acaa3['items']['length']+_0x532e78(0xf3)+_0x401372+'\x22.':'Refreshed\x20app\x20cache\x20with\x20'+_0x2acaa3['items'][_0x532e78(0xc7)]+_0x532e78(0xd3)+_0x401372+'\x22.'};}},useDef={'service':a2_0x165ac0(0xe5),'command':a2_0x165ac0(0xc3),'description':'Switch\x20the\x20default\x20app','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a2_0x165ac0(0xd5),'description':a2_0x165ac0(0xe1),'required':!![]}],'flags':[GLOBAL_FLAG],async 'validate'(_0x52a804){const _0x226f75=a2_0x165ac0;if(!_0x52a804['args'][0x0])throw CliErrors[_0x226f75(0xc6)](_0x226f75(0xf4),'Usage:\x20'+CLI_BIN_NAME+'\x20app\x20use\x20<name>\x20[--global]');},async 'execute'(_0x486c96){const _0x1c7a87=a2_0x165ac0,_0x4270f4=_0x486c96[_0x1c7a87(0xe9)][0x0];if(!_0x4270f4)throw CliErrors[_0x1c7a87(0xc6)](_0x1c7a87(0xf4),_0x1c7a87(0xe2)+CLI_BIN_NAME+'\x20app\x20use\x20<name>\x20[--global]');const {buildConfigFromFlags:_0x53930f}=await import('../../context.js'),{readCachedAppList:_0x4051fc}=await import(_0x1c7a87(0xba)),_0x3f0663=_0x53930f({}),_0x1a1ad7=_0x4051fc(_0x3f0663[_0x1c7a87(0xda)],_0x3f0663['accessKey']),_0x23c8c7=_0x1a1ad7?.[_0x1c7a87(0xf2)][_0x1c7a87(0xcd)](_0x300751=>_0x300751[_0x1c7a87(0xb0)]===_0x4270f4);if(!_0x23c8c7&&_0x3f0663[_0x1c7a87(0xc0)]!==_0x4270f4){const _0x2a6ee9=[..._0x1a1ad7?.[_0x1c7a87(0xf2)][_0x1c7a87(0xee)](_0x284900=>_0x284900['appName'])??[]],_0x461d5b=_0x2a6ee9[_0x1c7a87(0xc7)]===0x0?_0x1c7a87(0xb1)+CLI_BIN_NAME+_0x1c7a87(0xdb):_0x1c7a87(0xd4)+Array[_0x1c7a87(0xd1)](new Set(_0x2a6ee9))['join'](',\x20');throw CliErrors[_0x1c7a87(0xc6)]('App\x20\x22'+_0x4270f4+_0x1c7a87(0xf6),_0x461d5b);}const _0x125a46=_0x486c96['bool'](_0x1c7a87(0xfa));let _0xd9b23a;if(_0x125a46)_0xd9b23a={'global':!![]};else{const {isInProject:_0x26b641}=await import('../../context.js'),_0x21dd1d=_0x26b641();_0xd9b23a=toScopeFlags(resolveConfigScope({'explicitGlobal':![],'policy':_0x1c7a87(0xbf),'inProject':_0x21dd1d}));}const _0x119698=readConfig(_0xd9b23a);return _0x119698[_0x1c7a87(0xc0)]=_0x4270f4,writeConfig(_0x119698,_0xd9b23a),{'ok':!![],'message':_0x1c7a87(0xca)+_0x4270f4+'\x22'+scopeLabel(_0xd9b23a)+'.'};}},importDef={'service':'app','command':a2_0x165ac0(0xb7),'description':a2_0x165ac0(0xc2),'risk':a2_0x165ac0(0xc9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initImportFlagDefs,async 'execute'(_0x4cc236){return await runInitImport(collectFlags(_0x4cc236,initImportFlagDefs)),{'ok':!![]};}};export const appDefinitions=[initDef,listDef,pullDef,useDef,importDef];
|
|
1
|
+
const a2_0x1b6da5=a2_0x15bf;(function(_0x313e56,_0x53fa7a){const _0x42ef52=a2_0x15bf,_0x1883fd=_0x313e56();while(!![]){try{const _0xd2423b=parseInt(_0x42ef52(0x114))/0x1*(-parseInt(_0x42ef52(0x132))/0x2)+-parseInt(_0x42ef52(0x125))/0x3*(-parseInt(_0x42ef52(0x151))/0x4)+-parseInt(_0x42ef52(0x130))/0x5+-parseInt(_0x42ef52(0x10a))/0x6+parseInt(_0x42ef52(0x15a))/0x7*(parseInt(_0x42ef52(0x158))/0x8)+-parseInt(_0x42ef52(0x15b))/0x9+parseInt(_0x42ef52(0x13c))/0xa;if(_0xd2423b===_0x53fa7a)break;else _0x1883fd['push'](_0x1883fd['shift']());}catch(_0x21dc9e){_0x1883fd['push'](_0x1883fd['shift']());}}}(a2_0x580a,0x5e6a1));import{CliErrors}from'../../errors.js';function a2_0x15bf(_0x25e285,_0xac27b6){_0x25e285=_0x25e285-0x108;const _0x580a78=a2_0x580a();let _0x15bf8c=_0x580a78[_0x25e285];return _0x15bf8c;}import{PRODUCT_CONFIG}from'../../constant/product.js';import{initCreateFlagDefs,initImportFlagDefs,runInit,runInitImport}from'../../commands/init.js';import{getEnv,RUNTIME_ENV_VALUES}from'../../constant/env.js';import{buildAppProfileListFields}from'../../config/schema.js';import{CLI_BIN_NAME,readConfig,writeConfig,scopeLabel,enrichAppListItemsWithMergedSelection}from'../../commands/app/shared.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';const GLOBAL_FLAG={'name':a2_0x1b6da5(0x110),'type':a2_0x1b6da5(0x147),'description':'Use\x20global\x20config\x20scope','default':![]};function collectFlags(_0x39548a,_0x1efc94){const _0x4d0013=a2_0x1b6da5,_0x48d9bb={};for(const _0x4a3a2b of _0x1efc94){const _0x75ff2d=_0x4a3a2b['type']==='boolean'?_0x39548a[_0x4d0013(0x116)](_0x4a3a2b[_0x4d0013(0x148)]):_0x39548a['str'](_0x4a3a2b[_0x4d0013(0x148)]);if(_0x75ff2d!==''&&_0x75ff2d!==![])_0x48d9bb[_0x4a3a2b[_0x4d0013(0x148)]]=_0x75ff2d;}if(_0x39548a[_0x4d0013(0x10d)])_0x48d9bb[_0x4d0013(0x10d)]=!![];return _0x48d9bb;}function a2_0x580a(){const _0x5d2bc5=['Use\x20`','production','import','.\x20Local\x20aliases\x20can\x20be\x20added\x20under\x20apps.<alias>.appcode.','Target\x20environment\x20(default:\x20current\x20env)','use','Default\x20app\x20candidate\x20set\x20to\x20\x22','no-cache','pull','1572930PQAzfw','appcode','19348MIlCui','Set\x20the\x20fallback\x20app\x20candidate','Remote\x20app\x20name\x20to\x20activate','config','Available\x20remote\x20apps:\x20','defaultApp','entries','.appcode\x20to\x20.lovrabet.json.','Refreshed\x20app\x20cache\x20with\x20','\x20app\x20list`\x20to\x20discover\x20remote\x20apps,\x20or\x20add\x20apps.','11822560dNauuI','projectPath','\x22\x20not\x20found.','local','read','join','string','accessKey','Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','Missing\x20app\x20name.','fetchedAt','boolean','name','Read\x20from\x20local\x20cache\x20only','appOwnerName','Import\x20the\x20default\x20app\x20selection\x20from\x20a\x20.rabetbase.json\x20file','../../commands/app/remote-source.js','init','length','Initialize\x20','appCode','2390556ZqoxPW','App\x20\x22','source','appPublishStatus','push','\x20app\x20use\x20<name>\x20[--global]','No\x20apps\x20found\x20on\x20the\x20platform.','569528VlLvvA','str','7EIcecT','1490679kfVsjH','write','map','newConfigFileName','4627920DzTlgb','Filter\x20by\x20environment\x20(default:\x20current\x20env)','env','nonInteractive','../../commands/app/cache.js','items','global','app','\x20app(s)\x20for\x20env=\x22','mergedCli','22XHePiU','globalPath','bool','remote','Refresh\x20the\x20local\x20app\x20cache\x20from\x20the\x20platform','envName','isCurrent','No\x20cached\x20apps\x20found.','Read\x20app\x20list\x20from\x20local\x20cache\x20only','trim','find','cachePath','from','appName','../../context.js','List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','list','3shRuwu','\x20config\x20file'];a2_0x580a=function(){return _0x5d2bc5;};return a2_0x580a();}const initDef={'service':a2_0x1b6da5(0x111),'command':a2_0x1b6da5(0x14d),'description':a2_0x1b6da5(0x14f)+PRODUCT_CONFIG[a2_0x1b6da5(0x109)]+a2_0x1b6da5(0x126),'risk':a2_0x1b6da5(0x15c),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initCreateFlagDefs,async 'execute'(_0x56346d){return await runInit(collectFlags(_0x56346d,initCreateFlagDefs)),{'ok':!![]};}},listDef={'service':'app','command':a2_0x1b6da5(0x124),'description':a2_0x1b6da5(0x123),'risk':a2_0x1b6da5(0x140),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':a2_0x1b6da5(0x10c),'type':a2_0x1b6da5(0x142),'description':a2_0x1b6da5(0x10b),'enum':[...RUNTIME_ENV_VALUES]},{'name':'local','type':'boolean','description':a2_0x1b6da5(0x11c),'default':![]},{'name':a2_0x1b6da5(0x12e),'type':a2_0x1b6da5(0x147),'description':'Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','default':![]}],async 'execute'(_0x272031){const _0x4c6449=a2_0x1b6da5,_0x472f20=_0x272031[_0x4c6449(0x159)]('env')||_0x272031[_0x4c6449(0x119)]||getEnv()||_0x4c6449(0x128),_0x40f8a1=_0x272031[_0x4c6449(0x116)](_0x4c6449(0x13f)),_0xf6c356=_0x272031[_0x4c6449(0x116)]('no-cache'),{readRawConfigWithLayers:_0x3d1a4d,resolveDefaultAppSource:_0x47b28f,getLocalAppAliases:_0x13ffe9}=await import('../../context.js'),{getRemoteAppList:_0x9f1620}=await import('../../commands/app/remote-source.js'),{config:_0x2b3377,layers:_0x41dab8}=_0x3d1a4d(),_0x215bfd=_0x47b28f(_0x41dab8),{defaultApp:_0x227623}=_0x2b3377,_0x54df6a=await _0x9f1620({'env':_0x472f20,'accessKey':_0x272031[_0x4c6449(0x143)],'localOnly':_0x40f8a1,'noCache':_0xf6c356}),_0x338079=_0x54df6a[_0x4c6449(0x10f)]['map'](_0x11d5c0=>{const _0x87cad9=_0x4c6449;return{'name':_0x11d5c0['appName'],'appcode':_0x11d5c0[_0x87cad9(0x150)],'named':!![],'definedIn':_0x87cad9(0x117),'isDefault':_0x11d5c0[_0x87cad9(0x121)]===_0x227623,...buildAppProfileListFields(_0x472f20),'source':_0x54df6a['source'],'owner':_0x11d5c0[_0x87cad9(0x14a)]??null,'status':_0x11d5c0[_0x87cad9(0x154)]??null,'cachedAt':_0x54df6a[_0x87cad9(0x146)]};}),_0x3f367c=_0x13ffe9(_0x2b3377);let _0x5a6ae0=0x0;for(const [_0x253be3,_0x2f3d19]of Object[_0x4c6449(0x138)](_0x3f367c)){const _0x3cc586=typeof _0x2f3d19[_0x4c6449(0x131)]===_0x4c6449(0x142)?_0x2f3d19['appcode'][_0x4c6449(0x11d)]():'';if(!_0x3cc586)continue;_0x5a6ae0+=0x1,_0x338079[_0x4c6449(0x155)]({'name':_0x253be3,'appcode':_0x3cc586,'named':!![],'definedIn':'local','isDefault':_0x253be3===_0x227623,...buildAppProfileListFields(_0x472f20),'source':_0x4c6449(0x135),'owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0x338079,_0x272031[_0x4c6449(0x113)]);if(_0x338079[_0x4c6449(0x14e)]===0x0)return{'ok':!![],'data':[],'message':_0x54df6a[_0x4c6449(0x153)]==='cache'?_0x4c6449(0x11b):_0x4c6449(0x157)};const _0x456339=_0x338079[_0x4c6449(0x11e)](_0x4bb756=>_0x4bb756[_0x4c6449(0x11a)]===!![]),_0x234b12=_0x227623??_0x456339?.[_0x4c6449(0x148)]??null,_0x44dba9={'env':_0x472f20,'source':_0x54df6a[_0x4c6449(0x153)],'fetchedAt':_0x54df6a[_0x4c6449(0x146)],'cachePath':_0x54df6a[_0x4c6449(0x11f)],'globalPath':_0x41dab8[_0x4c6449(0x115)]??null,'projectPath':_0x41dab8[_0x4c6449(0x13d)]??null,'defaultApp':_0x234b12,'defaultAppSource':_0x227623!=null?_0x215bfd:null,'localAliasCount':_0x5a6ae0};return{'ok':!![],'data':{'items':_0x338079,'meta':_0x44dba9}};}},pullDef={'service':a2_0x1b6da5(0x111),'command':a2_0x1b6da5(0x12f),'description':a2_0x1b6da5(0x118),'risk':a2_0x1b6da5(0x15c),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'env','type':a2_0x1b6da5(0x142),'description':a2_0x1b6da5(0x12b),'enum':[...RUNTIME_ENV_VALUES]},{'name':a2_0x1b6da5(0x13f),'type':a2_0x1b6da5(0x147),'description':a2_0x1b6da5(0x149),'default':![]},{'name':a2_0x1b6da5(0x12e),'type':a2_0x1b6da5(0x147),'description':a2_0x1b6da5(0x144),'default':![]}],async 'execute'(_0x57ce18){const _0x19771b=a2_0x1b6da5,_0x387918=_0x57ce18[_0x19771b(0x159)](_0x19771b(0x10c))||_0x57ce18[_0x19771b(0x119)]||getEnv()||'production',_0x4bb9c7=_0x57ce18['bool']('local'),_0x569e71=_0x57ce18[_0x19771b(0x116)](_0x19771b(0x12e)),{getRemoteAppList:_0x20a36d}=await import(_0x19771b(0x14c)),_0x41ecc8=await _0x20a36d({'env':_0x387918,'accessKey':_0x57ce18[_0x19771b(0x143)],'localOnly':_0x4bb9c7,'noCache':_0x569e71});return{'ok':!![],'data':{'total':_0x41ecc8[_0x19771b(0x10f)][_0x19771b(0x14e)],'env':_0x387918,'source':_0x41ecc8[_0x19771b(0x153)],'fetchedAt':_0x41ecc8[_0x19771b(0x146)],'cachePath':_0x41ecc8['cachePath']},'message':_0x41ecc8['source']==='cache'?'Loaded\x20'+_0x41ecc8[_0x19771b(0x10f)][_0x19771b(0x14e)]+'\x20cached\x20app(s)\x20for\x20env=\x22'+_0x387918+'\x22.':_0x19771b(0x13a)+_0x41ecc8[_0x19771b(0x10f)][_0x19771b(0x14e)]+_0x19771b(0x112)+_0x387918+'\x22.'};}},useDef={'service':'app','command':a2_0x1b6da5(0x12c),'description':a2_0x1b6da5(0x133),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a2_0x1b6da5(0x148),'description':a2_0x1b6da5(0x134),'required':!![]}],'flags':[GLOBAL_FLAG],async 'validate'(_0x3fa78a){const _0x2bffa4=a2_0x1b6da5;if(!_0x3fa78a['args'][0x0])throw CliErrors['validation'](_0x2bffa4(0x145),'Usage:\x20'+CLI_BIN_NAME+_0x2bffa4(0x156));},async 'execute'(_0x1deb34){const _0x16f019=a2_0x1b6da5,_0x47f121=_0x1deb34['args'][0x0];if(!_0x47f121)throw CliErrors['validation']('Missing\x20app\x20name.','Usage:\x20'+CLI_BIN_NAME+'\x20app\x20use\x20<name>\x20[--global]');const {buildConfigFromFlags:_0x46950f,resolveLocalAppAliasCode:_0xaf3c4a}=await import(_0x16f019(0x122)),{readCachedAppList:_0x223917}=await import(_0x16f019(0x10e)),_0x267918=_0x1deb34['str'](_0x16f019(0x10c)),_0x2b07d0=_0x46950f(_0x267918?{'env':_0x267918}:{}),_0x274568=_0x223917(_0x2b07d0[_0x16f019(0x10c)],_0x2b07d0[_0x16f019(0x143)]),_0x41fdf2=_0x274568?.['items'][_0x16f019(0x11e)](_0x49f1da=>_0x49f1da[_0x16f019(0x121)]===_0x47f121),_0x19eb96=_0xaf3c4a(_0x2b07d0['raw']??{},_0x47f121);if(!_0x41fdf2&&!_0x19eb96&&_0x2b07d0[_0x16f019(0x137)]!==_0x47f121){const _0x3d36e4=[..._0x274568?.[_0x16f019(0x10f)][_0x16f019(0x108)](_0x470b9e=>_0x470b9e[_0x16f019(0x121)])??[]],_0x372327=_0x3d36e4[_0x16f019(0x14e)]===0x0?_0x16f019(0x127)+CLI_BIN_NAME+_0x16f019(0x13b)+_0x47f121+_0x16f019(0x139):_0x16f019(0x136)+Array[_0x16f019(0x120)](new Set(_0x3d36e4))[_0x16f019(0x141)](',\x20')+_0x16f019(0x12a);throw CliErrors['validation'](_0x16f019(0x152)+_0x47f121+_0x16f019(0x13e),_0x372327);}const _0x227141=_0x1deb34[_0x16f019(0x116)](_0x16f019(0x110));let _0x455d21;if(_0x227141)_0x455d21={'global':!![]};else{const {isInProject:_0x3ca805}=await import(_0x16f019(0x122)),_0x30fa51=_0x3ca805();_0x455d21=toScopeFlags(resolveConfigScope({'explicitGlobal':![],'policy':'project-default','inProject':_0x30fa51}));}const _0xae3695=readConfig(_0x455d21);return _0xae3695[_0x16f019(0x137)]=_0x47f121,writeConfig(_0xae3695,_0x455d21),{'ok':!![],'message':_0x16f019(0x12d)+_0x47f121+'\x22'+scopeLabel(_0x455d21)+'.'};}},importDef={'service':a2_0x1b6da5(0x111),'command':a2_0x1b6da5(0x129),'description':a2_0x1b6da5(0x14b),'risk':a2_0x1b6da5(0x15c),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initImportFlagDefs,async 'execute'(_0x4a7353){return await runInitImport(collectFlags(_0x4a7353,initImportFlagDefs)),{'ok':!![]};}};export const appDefinitions=[initDef,listDef,pullDef,useDef,importDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x12a08b,_0x5a9496){const _0x380e57=a3_0x26a5,_0x151566=_0x12a08b();while(!![]){try{const _0xda80d2=parseInt(_0x380e57(0x1b8))/0x1+-parseInt(_0x380e57(0x1bc))/0x2*(-parseInt(_0x380e57(0x1af))/0x3)+-parseInt(_0x380e57(0x1b9))/0x4*(parseInt(_0x380e57(0x1bf))/0x5)+parseInt(_0x380e57(0x1b6))/0x6+-parseInt(_0x380e57(0x1b4))/0x7*(-parseInt(_0x380e57(0x1ba))/0x8)+parseInt(_0x380e57(0x1b1))/0x9*(-parseInt(_0x380e57(0x1b7))/0xa)+parseInt(_0x380e57(0x1b0))/0xb*(parseInt(_0x380e57(0x1b5))/0xc);if(_0xda80d2===_0x5a9496)break;else _0x151566['push'](_0x151566['shift']());}catch(_0x3992cc){_0x151566['push'](_0x151566['shift']());}}}(a3_0xd1b6,0x99d12));import{fileURLToPath}from'url';function a3_0xd1b6(){const _0x1fcac7=['120hDmpGO','errorMsg','3822IkojEZ','../../../mock/app-list.json','tableData','2410oYpPCY','1803JMTlNp','11pADctU','28098YgZBPM','success','errorCode','66899nnDDXP','4381932dcOFwA','3018498sCVEuh','3360bwjjJJ','109848BGsqlJ','4904ZrERkb'];a3_0xd1b6=function(){return _0x1fcac7;};return a3_0xd1b6();}function a3_0x26a5(_0x225e27,_0x504bbf){_0x225e27=_0x225e27-0x1af;const _0xd1b6b6=a3_0xd1b6();let _0x26a502=_0xd1b6b6[_0x225e27];return _0x26a502;}import{dirname,join}from'path';import{readFileSync}from'fs';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function loadMockAppList(){const _0x1e32ab=a3_0x26a5,_0x1f487c=join(__dirname,_0x1e32ab(0x1bd)),_0x38a625=readFileSync(_0x1f487c,'utf-8');return JSON['parse'](_0x38a625);}let _cached=null;export function getMockAppList(){return!_cached&&(_cached=loadMockAppList()),_cached;}export function getMockRemoteAppItems(){const _0x437c63=a3_0x26a5,_0x58ef55=getMockAppList();if(!_0x58ef55[_0x437c63(0x1b2)])throw new Error('Mock\x20API\x20error:\x20'+_0x58ef55[_0x437c63(0x1bb)]+'\x20('+_0x58ef55[_0x437c63(0x1b3)]+')');return _0x58ef55['data'][_0x437c63(0x1be)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2f9368,_0x4618a9){const _0x2c1318=a4_0x46ec,_0x1c0a4f=_0x2f9368();while(!![]){try{const _0x66335f=-parseInt(_0x2c1318(0x11b))/0x1+-parseInt(_0x2c1318(0x120))/0x2*(parseInt(_0x2c1318(0x119))/0x3)+-parseInt(_0x2c1318(0x11e))/0x4*(-parseInt(_0x2c1318(0x11d))/0x5)+-parseInt(_0x2c1318(0x122))/0x6+-parseInt(_0x2c1318(0x117))/0x7+parseInt(_0x2c1318(0x11f))/0x8+parseInt(_0x2c1318(0x123))/0x9*(parseInt(_0x2c1318(0x11c))/0xa);if(_0x66335f===_0x4618a9)break;else _0x1c0a4f['push'](_0x1c0a4f['shift']());}catch(_0x4f4677){_0x1c0a4f['push'](_0x1c0a4f['shift']());}}}(a4_0xb133,0x7c7ba));import{getMyApps}from'../../core/api-client.js';function a4_0xb133(){const _0x367841=['5987550gflcaM','1122255hkTuzj','items','cache','fetchedAt','APP_LIST_SOURCE','890015YrFvtw','toLowerCase','951387mUdFMU','mock','75465HHBBGN','50WRgtcJ','8585jMfOMx','2188pMLDcL','6256008eLXQJy','4kMBNUx','toISOString'];a4_0xb133=function(){return _0x367841;};return a4_0xb133();}function a4_0x46ec(_0x2efe89,_0x24922c){_0x2efe89=_0x2efe89-0x114;const _0xb133a3=a4_0xb133();let _0x46ec44=_0xb133a3[_0x2efe89];return _0x46ec44;}import{getMockRemoteAppItems}from'../../commands/app/mock-loader.js';import{getAppCacheFilePath,readCachedAppList,writeCachedAppList}from'../../commands/app/cache.js';import{productEnv}from'../../constant/product.js';export function shouldUseMockRemoteApps(){const _0xe8e95=a4_0x46ec,_0x521e12=(productEnv(_0xe8e95(0x116))||'')['trim']()[_0xe8e95(0x118)]();return _0x521e12==='mock';}export async function getRemoteAppItems(){if(shouldUseMockRemoteApps())return getMockRemoteAppItems();return getMyApps();}export async function getRemoteAppList(_0x1495c8){const _0xac849c=a4_0x46ec,{env:_0x4ceb2b,accessKey:_0x5ea997,localOnly:localOnly=![],noCache:noCache=![]}=_0x1495c8,_0x700563=readCachedAppList(_0x4ceb2b,_0x5ea997),_0x244243=_0x5ea997?.['trim']()?getAppCacheFilePath(_0x4ceb2b,_0x5ea997):null;if(localOnly)return{'items':_0x700563?.[_0xac849c(0x124)]??[],'source':_0xac849c(0x114),'fetchedAt':_0x700563?.['fetchedAt']??null,'cachePath':_0x244243};try{const _0x13126f=await getRemoteAppItems(),_0x18ec65=shouldUseMockRemoteApps()?_0xac849c(0x11a):'remote',_0x147cb8=new Date()[_0xac849c(0x121)](),_0x5ba54d=_0x5ea997?.['trim']()?writeCachedAppList(_0x4ceb2b,_0x5ea997,{'env':_0x4ceb2b,'fetchedAt':_0x147cb8,'source':_0x18ec65,'items':_0x13126f}):null;return{'items':_0x13126f,'source':_0x18ec65,'fetchedAt':_0x147cb8,'cachePath':_0x5ba54d};}catch(_0x299f48){if(!noCache&&_0x700563)return{'items':_0x700563[_0xac849c(0x124)],'source':_0xac849c(0x114),'fetchedAt':_0x700563[_0xac849c(0x115)],'cachePath':_0x244243};throw _0x299f48;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x438f67,_0x284afe){const _0x3d43a3=a5_0x4bf9,_0xe30b52=_0x438f67();while(!![]){try{const _0x57a577=-parseInt(_0x3d43a3(0x1e0))/0x1*(parseInt(_0x3d43a3(0x1de))/0x2)+-parseInt(_0x3d43a3(0x1e7))/0x3*(parseInt(_0x3d43a3(0x1dc))/0x4)+parseInt(_0x3d43a3(0x1d9))/0x5+-parseInt(_0x3d43a3(0x1d7))/0x6+-parseInt(_0x3d43a3(0x1dd))/0x7+-parseInt(_0x3d43a3(0x1df))/0x8*(-parseInt(_0x3d43a3(0x1e5))/0x9)+parseInt(_0x3d43a3(0x1e4))/0xa;if(_0x57a577===_0x284afe)break;else _0xe30b52['push'](_0xe30b52['shift']());}catch(_0x4bf717){_0xe30b52['push'](_0xe30b52['shift']());}}}(a5_0x2930,0xead4c));import{CLI_BIN_NAME}from'../../constant/cli.js';function a5_0x2930(){const _0x47eab1=['definedIn','appcode','named','local','4133778FYxgZy','name','2345490nBRTvW','find','global','4BuZLJw','5966303zJEjgH','2RYXxFW','8DKAWiw','958465fXNOOL','isCurrent','currentApp','defaultApp','29207830wVTzcI','1498437FsTslp','trim','284247JQhkzO','appCode'];a5_0x2930=function(){return _0x47eab1;};return a5_0x2930();}import{formatScopeLabel}from'../../commands/common/config-policy.js';function a5_0x4bf9(_0x3129b1,_0x66f3ce){_0x3129b1=_0x3129b1-0x1d2;const _0x2930a0=a5_0x2930();let _0x4bf9f0=_0x2930a0[_0x3129b1];return _0x4bf9f0;}export{CLI_BIN_NAME};export function enrichAppListItemsWithMergedSelection(_0x5e11b5,_0x17b7b6){const _0x3aab9c=a5_0x4bf9;if(!_0x17b7b6)return;const _0x417da2=!!(_0x17b7b6[_0x3aab9c(0x1e2)]??_0x17b7b6[_0x3aab9c(0x1e3)]);for(const _0xf3dedd of _0x5e11b5){_0xf3dedd[_0x3aab9c(0x1e1)]=![];}const _0x5b5635=_0x17b7b6[_0x3aab9c(0x1d2)]!=null?String(_0x17b7b6[_0x3aab9c(0x1d2)])[_0x3aab9c(0x1e6)]():'';if(_0x417da2){const _0x36e61e=_0x17b7b6[_0x3aab9c(0x1e2)]??_0x17b7b6[_0x3aab9c(0x1e3)];if(_0x36e61e){const _0x1dc519=_0x5e11b5[_0x3aab9c(0x1da)](_0x595ffa=>_0x595ffa[_0x3aab9c(0x1d5)]===!![]&&_0x595ffa['name']===_0x36e61e&&_0x595ffa[_0x3aab9c(0x1d3)]===_0x3aab9c(0x1d6)),_0x1d39bb=_0x1dc519??_0x5e11b5['find'](_0x463ecd=>_0x463ecd[_0x3aab9c(0x1d5)]===!![]&&_0x463ecd[_0x3aab9c(0x1d8)]===_0x36e61e);_0x1d39bb&&(_0x1d39bb['isCurrent']=!![]);}return;}if(!_0x5b5635)return;for(const _0xbb77d3 of _0x5e11b5){String(_0xbb77d3[_0x3aab9c(0x1d4)]??'')[_0x3aab9c(0x1e6)]()===_0x5b5635&&(_0xbb77d3[_0x3aab9c(0x1e1)]=!![]);}}export{readScopedConfig as readConfig,writeScopedConfig as writeConfig,isInProject}from'../../context.js';export function scopeLabel(_0x5a6304){const _0x121474=a5_0x4bf9;return formatScopeLabel(_0x5a6304['global']?_0x121474(0x1db):'project');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a6_0x1fe5b5=a6_0x1e61;(function(_0x45739f,_0x3ada61){const _0x367be9=a6_0x1e61,_0x2f7125=_0x45739f();while(!![]){try{const _0x5f5a16=parseInt(_0x367be9(0x20f))/0x1*(parseInt(_0x367be9(0x231))/0x2)+-parseInt(_0x367be9(0x229))/0x3+-parseInt(_0x367be9(0x1f1))/0x4*(-parseInt(_0x367be9(0x21d))/0x5)+-parseInt(_0x367be9(0x23c))/0x6*(-parseInt(_0x367be9(0x237))/0x7)+parseInt(_0x367be9(0x206))/0x8*(parseInt(_0x367be9(0x20e))/0x9)+-parseInt(_0x367be9(0x1f0))/0xa+-parseInt(_0x367be9(0x218))/0xb*(parseInt(_0x367be9(0x211))/0xc);if(_0x5f5a16===_0x3ada61)break;else _0x2f7125['push'](_0x2f7125['shift']());}catch(_0x167ddd){_0x2f7125['push'](_0x2f7125['shift']());}}}(a6_0x5d9a,0x36766));import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a6_0x1e61(_0xcf1e36,_0x3098dd){_0xcf1e36=_0xcf1e36-0x1f0;const _0x5d9ad1=a6_0x5d9a();let _0x1e6145=_0x5d9ad1[_0xcf1e36];return _0x1e6145;}import{AUTH_MODE}from'../../constant/auth-mode.js';import{normalizeEnv,isDaily,isDev}from'../../constant/env.js';import{USER_ACCESS_KEY_CREATE_URL}from'../../constant/url.js';import{CliErrors}from'../../errors.js';import{promptAccessKey,isAbortPrompt}from'../../commands/auth/prompt.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{getLoginUserInfo}from'../../core/api-client.js';const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/;function showAccessKeyCreateHint(){const _0x2a7470=a6_0x1e61;writeCliSideChannelLine('AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20Lovrabet\x20User\x20Center:'),writeCliSideChannelLine('\x0a'+USER_ACCESS_KEY_CREATE_URL+'\x0a'),writeCliSideChannelLine('Tip:\x20you\x20can\x20also\x20run:'),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x2a7470(0x220));}function resolveAuthScopeFlags(_0x1be59a){const _0xdd5d4f=a6_0x1e61;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x1be59a[_0xdd5d4f(0x222)]('global'),'explicitProject':_0x1be59a[_0xdd5d4f(0x222)](_0xdd5d4f(0x226)),'policy':_0xdd5d4f(0x235)}));}async function resolveAuthWriteInput(_0x5b181e){const _0x26f964=a6_0x1e61;let _0x3e900c=(_0x5b181e[_0x26f964(0x234)](_0x26f964(0x1fd))||_0x5b181e['str']('ak')||'')[_0x26f964(0x239)]();const _0x25ec84=(_0x5b181e[_0x26f964(0x234)]('env')||'')[_0x26f964(0x239)]();if(!_0x3e900c&&!_0x5b181e[_0x26f964(0x1f5)])try{showAccessKeyCreateHint(),_0x3e900c=await promptAccessKey('');}catch(_0x1d34de){if(isAbortPrompt(_0x1d34de))throw CliErrors[_0x26f964(0x207)]();throw _0x1d34de;}if(!_0x3e900c)throw CliErrors['validation'](_0x26f964(0x22f),[_0x26f964(0x213)+USER_ACCESS_KEY_CREATE_URL,_0x26f964(0x238)+CLI_BIN_NAME+_0x26f964(0x22e)][_0x26f964(0x23f)]('\x0a'));if(!ACCESS_KEY_PATTERN[_0x26f964(0x1f9)](_0x3e900c))throw CliErrors[_0x26f964(0x21a)](_0x26f964(0x1fb)+_0x3e900c+'\x22',_0x26f964(0x21f));if(!_0x25ec84)return{'accessKey':_0x3e900c};const _0x5c3071=normalizeEnv(_0x25ec84);return{'accessKey':_0x3e900c,'env':isDaily(_0x5c3071)?_0x26f964(0x1f7):isDev(_0x5c3071)?_0x26f964(0x205):_0x26f964(0x200)};}function a6_0x5d9a(){const _0x2a35f1=['\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','Missing\x20accessKey.','logout','2WuTUxG','Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','Write\x20to\x20global\x20config\x20(default)','str','global-default','boolean','4823ROgRfM','Then\x20run:\x20','trim','Clear\x20from\x20global\x20config\x20(default)','\x20doctor','2016sMoVes','Clear\x20all\x20config\x20in\x20scope\x20and\x20initialize\x20auth\x20from\x20scratch','\x20\x20export\x20LOVRABET_ACCESS_KEY=ak_xxx','join','AccessKey\x20cleared\x20from\x20','3006400UAFldD','371096IgEQBe','slice','\x20Current\x20env:\x20','push','nonInteractive','Save\x20accessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20project\x20config)','daily','info','test','global','Invalid\x20accessKey\x20format:\x20\x22','\x20config.\x20Nothing\x20to\x20clear.','access-key','Option\x20A:\x20','AccessKey\x20(ak_xxx...)','production','Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','Option\x20C:\x20environment\x20variable','env','envName','development','96ZBcfQn','cancelled','\x20auth\x20status','length','\x20(via\x20','Auth\x20mode:\x20','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','\x20Verify:\x20','327384dsJhnN','372227jCRLqe','AccessKey\x20saved\x20to\x20','9924SqFBaN','Read\x20from\x20global\x20config\x20(default)','Create\x20one\x20in\x20Lovrabet\x20User\x20Center:\x20','LOVRABET_ACCESS_KEY\x20env\x20var','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','accessKey','Show\x20current\x20authentication\x20status','2563SFDUSS','Then\x20verify\x20with:\x20','validation','Option\x20B:\x20apps\x20config\x20(.lovrabet.json)','Shorthand\x20for\x20--access-key','5yeJbZg','auth','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars','\x20auth\x20login\x20--access-key\x20<ak_xxx>','string','bool','\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]','\x20config','login','project','Auth\x20config\x20reinitialized\x20in\x20','read','1249824PksFmi','write','\x20config.','repeat','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:'];a6_0x5d9a=function(){return _0x2a35f1;};return a6_0x5d9a();}export const authDefinitions=[{'service':'auth','command':a6_0x1fe5b5(0x225),'description':a6_0x1fe5b5(0x1f6),'risk':a6_0x1fe5b5(0x22a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a6_0x1fe5b5(0x1fd),'type':a6_0x1fe5b5(0x221),'description':a6_0x1fe5b5(0x1ff)},{'name':'ak','type':a6_0x1fe5b5(0x221),'description':a6_0x1fe5b5(0x21c)},{'name':a6_0x1fe5b5(0x1fa),'type':a6_0x1fe5b5(0x236),'description':a6_0x1fe5b5(0x233),'default':!![]},{'name':a6_0x1fe5b5(0x226),'type':a6_0x1fe5b5(0x236),'description':a6_0x1fe5b5(0x20c),'default':![]}],async 'execute'(_0x164639){const _0xff8124=a6_0x1fe5b5,_0x2ebf8f=await resolveAuthWriteInput(_0x164639),_0x41eb2e=resolveAuthScopeFlags(_0x164639),_0x51c3b3=readScopedConfig(_0x41eb2e);_0x51c3b3[_0xff8124(0x216)]=_0x2ebf8f[_0xff8124(0x216)];_0x2ebf8f[_0xff8124(0x203)]&&(_0x51c3b3['env']=_0x2ebf8f[_0xff8124(0x203)]);writeScopedConfig(_0x51c3b3,_0x41eb2e);const _0x1ea040=_0x41eb2e[_0xff8124(0x1fa)]?_0xff8124(0x1fa):_0xff8124(0x226),_0x2bf728=_0x51c3b3['env']?'\x20Current\x20env:\x20'+_0x51c3b3[_0xff8124(0x203)]+'.':'';return{'ok':!![],'message':_0xff8124(0x210)+_0x1ea040+'\x20config.'+_0x2bf728+_0xff8124(0x20d)+CLI_BIN_NAME+_0xff8124(0x208)};}},{'service':a6_0x1fe5b5(0x21e),'command':'init','description':a6_0x1fe5b5(0x23d),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a6_0x1fe5b5(0x1fd),'type':'string','description':a6_0x1fe5b5(0x1ff)},{'name':'ak','type':a6_0x1fe5b5(0x221),'description':'Shorthand\x20for\x20--access-key'},{'name':a6_0x1fe5b5(0x203),'type':'string','description':'Target\x20environment\x20to\x20persist\x20with\x20the\x20new\x20auth\x20config'},{'name':a6_0x1fe5b5(0x1fa),'type':a6_0x1fe5b5(0x236),'description':a6_0x1fe5b5(0x233),'default':!![]},{'name':a6_0x1fe5b5(0x226),'type':a6_0x1fe5b5(0x236),'description':'Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]}],async 'execute'(_0x771ad8){const _0x590aa1=a6_0x1fe5b5,_0x359814=await resolveAuthWriteInput(_0x771ad8),_0x7f799c=resolveAuthScopeFlags(_0x771ad8),_0x3b5096={'accessKey':_0x359814[_0x590aa1(0x216)]};_0x359814[_0x590aa1(0x203)]&&(_0x3b5096[_0x590aa1(0x203)]=_0x359814[_0x590aa1(0x203)]);writeScopedConfig(_0x3b5096,_0x7f799c);const _0x1afef2=_0x7f799c['global']?_0x590aa1(0x1fa):_0x590aa1(0x226),_0x5f19b0=_0x3b5096[_0x590aa1(0x203)]?_0x590aa1(0x1f3)+_0x3b5096['env']+'.':'';return{'ok':!![],'message':_0x590aa1(0x227)+_0x1afef2+'\x20scope.'+_0x5f19b0+_0x590aa1(0x20d)+CLI_BIN_NAME+_0x590aa1(0x208)};}},{'service':a6_0x1fe5b5(0x21e),'command':a6_0x1fe5b5(0x230),'description':'Clear\x20accessKey\x20from\x20config','risk':a6_0x1fe5b5(0x22a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a6_0x1fe5b5(0x1fa),'type':a6_0x1fe5b5(0x236),'description':a6_0x1fe5b5(0x23a),'default':!![]},{'name':a6_0x1fe5b5(0x226),'type':a6_0x1fe5b5(0x236),'description':a6_0x1fe5b5(0x232),'default':![]}],async 'execute'(_0x58d8f5){const _0x398fab=a6_0x1fe5b5,_0x517946=resolveAuthScopeFlags(_0x58d8f5),_0x17f7f2=readScopedConfig(_0x517946),_0x92b394=!!_0x17f7f2[_0x398fab(0x216)];delete _0x17f7f2[_0x398fab(0x216)],writeScopedConfig(_0x17f7f2,_0x517946);const _0x2961b5=_0x517946[_0x398fab(0x1fa)]?_0x398fab(0x1fa):'project';if(_0x92b394)return{'ok':!![],'message':_0x398fab(0x240)+_0x2961b5+_0x398fab(0x22b)};return{'ok':!![],'message':'No\x20AccessKey\x20found\x20in\x20'+_0x2961b5+_0x398fab(0x1fc)};}},{'service':a6_0x1fe5b5(0x21e),'command':'status','description':a6_0x1fe5b5(0x217),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a6_0x1fe5b5(0x1fa),'type':'boolean','description':a6_0x1fe5b5(0x212),'default':!![]},{'name':a6_0x1fe5b5(0x226),'type':'boolean','description':a6_0x1fe5b5(0x201),'default':![]}],async 'execute'(_0x167e8c){const _0x557576=a6_0x1fe5b5,_0x12c882=resolveAuthScopeFlags(_0x167e8c),_0x1f657e=readScopedConfig(_0x12c882),_0x414e78=process.env.LOVRABET_ACCESS_KEY||undefined,_0x336508=_0x1f657e[_0x557576(0x216)]||undefined,_0x1f3901=_0x414e78||_0x336508,_0x511f74=_0x414e78?_0x557576(0x214):_0x336508?(_0x12c882[_0x557576(0x1fa)]?_0x557576(0x1fa):_0x557576(0x226))+_0x557576(0x224):null,_0x1e8a96=[_0x557576(0x20b)+AUTH_MODE['ClientAk']];if(_0x1f3901){const _0x116899=_0x1f3901[_0x557576(0x209)]>0x8?''+_0x1f3901[_0x557576(0x1f2)](0x0,0x8)+'*'[_0x557576(0x22c)](_0x1f3901[_0x557576(0x209)]-0x8):_0x1f3901;_0x1e8a96[_0x557576(0x1f4)]('AccessKey:\x20'+_0x116899+(_0x511f74?_0x557576(0x20a)+_0x511f74+')':''));}return!_0x1f3901&&(_0x1e8a96['push'](''),_0x1e8a96[_0x557576(0x1f4)](_0x557576(0x22d)),_0x1e8a96[_0x557576(0x1f4)](''),_0x1e8a96[_0x557576(0x1f4)](_0x557576(0x1fe)+CLI_BIN_NAME+_0x557576(0x223)),_0x1e8a96[_0x557576(0x1f4)](''),_0x1e8a96[_0x557576(0x1f4)](_0x557576(0x21b)),_0x1e8a96[_0x557576(0x1f4)](_0x557576(0x215)),_0x1e8a96[_0x557576(0x1f4)](''),_0x1e8a96[_0x557576(0x1f4)](_0x557576(0x202)),_0x1e8a96[_0x557576(0x1f4)](_0x557576(0x23e)),_0x1e8a96[_0x557576(0x1f4)](''),_0x1e8a96[_0x557576(0x1f4)](_0x557576(0x219)+CLI_BIN_NAME+'\x20auth\x20status'),_0x1e8a96[_0x557576(0x1f4)]('If\x20command\x20execution\x20still\x20fails,\x20run:\x20'+CLI_BIN_NAME+_0x557576(0x23b))),{'ok':!![],'message':_0x1e8a96[_0x557576(0x23f)]('\x0a')};}},{'service':a6_0x1fe5b5(0x21e),'command':a6_0x1fe5b5(0x1f8),'description':'Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','risk':a6_0x1fe5b5(0x228),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x19fee3){const _0x4797a5=a6_0x1fe5b5,_0x5de264=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x5de264,'meta':{'env':_0x19fee3[_0x4797a5(0x204)]??_0x4797a5(0x200)}}};}}];
|
|
1
|
+
const a6_0x24fb07=a6_0x5b27;function a6_0x5b27(_0xc565e,_0x2cba9f){_0xc565e=_0xc565e-0xb4;const _0x4d401d=a6_0x4d40();let _0x5b2720=_0x4d401d[_0xc565e];return _0x5b2720;}(function(_0x14cfe7,_0x4790e3){const _0x4d9cee=a6_0x5b27,_0x4fb945=_0x14cfe7();while(!![]){try{const _0x4a8dd2=parseInt(_0x4d9cee(0xca))/0x1*(-parseInt(_0x4d9cee(0xf1))/0x2)+parseInt(_0x4d9cee(0x10a))/0x3*(-parseInt(_0x4d9cee(0xf3))/0x4)+-parseInt(_0x4d9cee(0xda))/0x5*(parseInt(_0x4d9cee(0xb6))/0x6)+parseInt(_0x4d9cee(0x10b))/0x7+-parseInt(_0x4d9cee(0x109))/0x8*(parseInt(_0x4d9cee(0xc6))/0x9)+parseInt(_0x4d9cee(0x105))/0xa+parseInt(_0x4d9cee(0xce))/0xb*(parseInt(_0x4d9cee(0xe3))/0xc);if(_0x4a8dd2===_0x4790e3)break;else _0x4fb945['push'](_0x4fb945['shift']());}catch(_0x477493){_0x4fb945['push'](_0x4fb945['shift']());}}}(a6_0x4d40,0x7087a));import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvName}from'../../constant/product.js';import{AUTH_MODE}from'../../constant/auth-mode.js';import{normalizeEnv,isDaily,isDev}from'../../constant/env.js';import{USER_ACCESS_KEY_CREATE_URL}from'../../constant/url.js';import{CliErrors}from'../../errors.js';import{promptAccessKey,isAbortPrompt}from'../../commands/auth/prompt.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';function a6_0x4d40(){const _0x291111=['AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','312584ElVRNM','831057USbCMm','2466205UKtNCr','Invalid\x20accessKey\x20format:\x20\x22','logout','validation','str','Option\x20A:\x20','6SRToiX','Missing\x20accessKey.','Then\x20verify\x20with:\x20','Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','envName','trim','status','ACCESS_KEY','Save\x20accessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20project\x20config)','auth','Tip:\x20you\x20can\x20also\x20run:','stdout','\x20\x20export\x20','cancelled','global','AccessKey\x20cleared\x20from\x20','81SfGxKm','AccessKey\x20(ak_xxx...)','repeat','env','698AnUeQG','Shorthand\x20for\x20--access-key','access-key','daily','11ksqQad','\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','\x20config.','info','`auth\x20login`\x20does\x20not\x20support\x20--yes.','\x20doctor','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars','Option\x20B:\x20apps\x20config\x20(','\x20Current\x20env:\x20','Target\x20environment\x20to\x20persist\x20with\x20the\x20new\x20auth\x20config','boolean','init','3660845gJkgkI','push','\x20config.\x20Nothing\x20to\x20clear.','Option\x20C:\x20environment\x20variable','read','AccessKey:\x20','yes','newConfigFileName','length','28886244IXQmwV','login','Auth\x20config\x20reinitialized\x20in\x20','join','accessKey','AccessKey\x20saved\x20to\x20','Show\x20current\x20authentication\x20status','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','Read\x20from\x20global\x20config\x20(default)','=ak_xxx','\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`','project','\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.','2532hZDeMU','\x20auth\x20status','12BrRZTm','\x20auth\x20login\x20--access-key\x20<ak_xxx>','write','Write\x20to\x20global\x20config\x20(default)','Use\x20`','test','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','development','production','\x20(via\x20','isTTY','No\x20AccessKey\x20found\x20in\x20','\x20Verify:\x20','ClientAk','Auth\x20mode:\x20','string','stdin','\x20env\x20var','4999710ptnaXm','slice','bool'];a6_0x4d40=function(){return _0x291111;};return a6_0x4d40();}import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{getLoginUserInfo}from'../../core/api-client.js';const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/;function showAccessKeyCreateHint(){const _0x3469bf=a6_0x5b27;writeCliSideChannelLine(_0x3469bf(0x108)+PRODUCT_CONFIG['userCenterDisplayName']+':'),writeCliSideChannelLine('\x0a'+USER_ACCESS_KEY_CREATE_URL+'\x0a'),writeCliSideChannelLine(_0x3469bf(0xc0)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x3469bf(0xf4));}function buildAccessKeySetupGuide(){const _0x5f2283=a6_0x5b27;return['AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20'+PRODUCT_CONFIG['userCenterDisplayName']+':',USER_ACCESS_KEY_CREATE_URL,'Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20'+CLI_BIN_NAME+_0x5f2283(0xcf)]['join']('\x0a');}function canPromptForAccessKey(_0x39520a){const _0x5c6f14=a6_0x5b27;return!_0x39520a['nonInteractive']&&process[_0x5c6f14(0x103)][_0x5c6f14(0xfd)]!==![]&&process[_0x5c6f14(0xc1)][_0x5c6f14(0xfd)]!==![];}function resolveAuthScopeFlags(_0x20ad7a){const _0x5964bb=a6_0x5b27;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x20ad7a[_0x5964bb(0x107)]('global'),'explicitProject':_0x20ad7a[_0x5964bb(0x107)]('project'),'policy':'global-default'}));}async function resolveAuthWriteInput(_0xeded74){const _0x1e5f9c=a6_0x5b27;let _0x4845a7=(_0xeded74[_0x1e5f9c(0xb4)]('access-key')||_0xeded74[_0x1e5f9c(0xb4)]('ak')||'')[_0x1e5f9c(0xbb)]();const _0x4373a8=(_0xeded74[_0x1e5f9c(0xb4)](_0x1e5f9c(0xc9))||'')['trim']();if(!_0x4845a7&&canPromptForAccessKey(_0xeded74))try{showAccessKeyCreateHint(),_0x4845a7=await promptAccessKey('');}catch(_0xaad5ae){if(isAbortPrompt(_0xaad5ae))throw CliErrors[_0x1e5f9c(0xc3)]();throw _0xaad5ae;}if(!_0x4845a7)throw CliErrors[_0x1e5f9c(0x10e)](_0x1e5f9c(0xb7),buildAccessKeySetupGuide());if(!ACCESS_KEY_PATTERN[_0x1e5f9c(0xf8)](_0x4845a7))throw CliErrors[_0x1e5f9c(0x10e)](_0x1e5f9c(0x10c)+_0x4845a7+'\x22',_0x1e5f9c(0xd4));if(!_0x4373a8)return{'accessKey':_0x4845a7};const _0x517fa0=normalizeEnv(_0x4373a8);return{'accessKey':_0x4845a7,'env':isDaily(_0x517fa0)?_0x1e5f9c(0xcd):isDev(_0x517fa0)?_0x1e5f9c(0xfa):_0x1e5f9c(0xfb)};}export const authDefinitions=[{'service':a6_0x24fb07(0xbf),'command':a6_0x24fb07(0xe4),'description':a6_0x24fb07(0xbe),'risk':a6_0x24fb07(0xf5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a6_0x24fb07(0xcc),'type':a6_0x24fb07(0x102),'description':a6_0x24fb07(0xc7)},{'name':'ak','type':a6_0x24fb07(0x102),'description':a6_0x24fb07(0xcb)},{'name':a6_0x24fb07(0xc4),'type':a6_0x24fb07(0xd8),'description':a6_0x24fb07(0xf6),'default':!![]},{'name':a6_0x24fb07(0xef),'type':a6_0x24fb07(0xd8),'description':'Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]}],async 'execute'(_0x3d325f){const _0x3b5427=a6_0x24fb07;if(_0x3d325f['bool'](_0x3b5427(0xe0)))throw CliErrors[_0x3b5427(0x10e)](_0x3b5427(0xd2),_0x3b5427(0xf7)+CLI_BIN_NAME+_0x3b5427(0xee)+CLI_BIN_NAME+_0x3b5427(0xf0));const _0x21b00e=(_0x3d325f[_0x3b5427(0xb4)](_0x3b5427(0xcc))||_0x3d325f['str']('ak')||'')[_0x3b5427(0xbb)]();if(!_0x21b00e&&_0x3d325f['nonInteractive'])return{'ok':!![],'message':buildAccessKeySetupGuide()};const _0x2941ef=await resolveAuthWriteInput(_0x3d325f),_0x2693b9=resolveAuthScopeFlags(_0x3d325f),_0x5a2756=readScopedConfig(_0x2693b9);_0x5a2756[_0x3b5427(0xe7)]=_0x2941ef[_0x3b5427(0xe7)];_0x2941ef[_0x3b5427(0xc9)]&&(_0x5a2756[_0x3b5427(0xc9)]=_0x2941ef[_0x3b5427(0xc9)]);writeScopedConfig(_0x5a2756,_0x2693b9);const _0x278258=_0x2693b9[_0x3b5427(0xc4)]?_0x3b5427(0xc4):_0x3b5427(0xef),_0x1af91e=_0x5a2756[_0x3b5427(0xc9)]?_0x3b5427(0xd6)+_0x5a2756[_0x3b5427(0xc9)]+'.':'';return{'ok':!![],'message':_0x3b5427(0xe8)+_0x278258+_0x3b5427(0xd0)+_0x1af91e+_0x3b5427(0xff)+CLI_BIN_NAME+'\x20auth\x20status'};}},{'service':a6_0x24fb07(0xbf),'command':a6_0x24fb07(0xd9),'description':'Clear\x20all\x20config\x20in\x20scope\x20and\x20initialize\x20auth\x20from\x20scratch','risk':a6_0x24fb07(0xf5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'access-key','type':'string','description':a6_0x24fb07(0xc7)},{'name':'ak','type':a6_0x24fb07(0x102),'description':a6_0x24fb07(0xcb)},{'name':'env','type':a6_0x24fb07(0x102),'description':a6_0x24fb07(0xd7)},{'name':'global','type':a6_0x24fb07(0xd8),'description':'Write\x20to\x20global\x20config\x20(default)','default':!![]},{'name':a6_0x24fb07(0xef),'type':'boolean','description':a6_0x24fb07(0xea),'default':![]}],async 'execute'(_0x5a947a){const _0x19c93d=a6_0x24fb07,_0x35fbe5=await resolveAuthWriteInput(_0x5a947a),_0x9b5a58=resolveAuthScopeFlags(_0x5a947a),_0x287a61={'accessKey':_0x35fbe5[_0x19c93d(0xe7)]};_0x35fbe5['env']&&(_0x287a61[_0x19c93d(0xc9)]=_0x35fbe5[_0x19c93d(0xc9)]);writeScopedConfig(_0x287a61,_0x9b5a58);const _0x22b440=_0x9b5a58[_0x19c93d(0xc4)]?_0x19c93d(0xc4):_0x19c93d(0xef),_0x1a1915=_0x287a61['env']?'\x20Current\x20env:\x20'+_0x287a61[_0x19c93d(0xc9)]+'.':'';return{'ok':!![],'message':_0x19c93d(0xe5)+_0x22b440+'\x20scope.'+_0x1a1915+_0x19c93d(0xff)+CLI_BIN_NAME+'\x20auth\x20status'};}},{'service':a6_0x24fb07(0xbf),'command':a6_0x24fb07(0x10d),'description':'Clear\x20accessKey\x20from\x20config','risk':a6_0x24fb07(0xf5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a6_0x24fb07(0xc4),'type':a6_0x24fb07(0xd8),'description':'Clear\x20from\x20global\x20config\x20(default)','default':!![]},{'name':'project','type':a6_0x24fb07(0xd8),'description':'Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]}],async 'execute'(_0x3a77da){const _0x188a7f=a6_0x24fb07,_0x5831a1=resolveAuthScopeFlags(_0x3a77da),_0x5a8e55=readScopedConfig(_0x5831a1),_0x14414b=!!_0x5a8e55[_0x188a7f(0xe7)];delete _0x5a8e55['accessKey'],writeScopedConfig(_0x5a8e55,_0x5831a1);const _0x371270=_0x5831a1[_0x188a7f(0xc4)]?_0x188a7f(0xc4):'project';if(_0x14414b)return{'ok':!![],'message':_0x188a7f(0xc5)+_0x371270+'\x20config.'};return{'ok':!![],'message':_0x188a7f(0xfe)+_0x371270+_0x188a7f(0xdc)};}},{'service':a6_0x24fb07(0xbf),'command':a6_0x24fb07(0xbc),'description':a6_0x24fb07(0xe9),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a6_0x24fb07(0xc4),'type':a6_0x24fb07(0xd8),'description':a6_0x24fb07(0xec),'default':!![]},{'name':a6_0x24fb07(0xef),'type':'boolean','description':a6_0x24fb07(0xb9),'default':![]}],async 'execute'(_0x134b61){const _0x2976af=a6_0x24fb07,_0x47a25a=resolveAuthScopeFlags(_0x134b61),_0x338c7d=readScopedConfig(_0x47a25a),_0x439e98=productEnvName(_0x2976af(0xbd)),_0x1e4a0e=productEnv('ACCESS_KEY')||undefined,_0x5c81f8=_0x338c7d[_0x2976af(0xe7)]||undefined,_0xe63d57=_0x1e4a0e||_0x5c81f8,_0x2a254c=_0x1e4a0e?_0x439e98+_0x2976af(0x104):_0x5c81f8?(_0x47a25a[_0x2976af(0xc4)]?_0x2976af(0xc4):_0x2976af(0xef))+'\x20config':null,_0x450010=[_0x2976af(0x101)+AUTH_MODE[_0x2976af(0x100)]];if(_0xe63d57){const _0x563f51=_0xe63d57['length']>0x8?''+_0xe63d57[_0x2976af(0x106)](0x0,0x8)+'*'[_0x2976af(0xc8)](_0xe63d57[_0x2976af(0xe2)]-0x8):_0xe63d57;_0x450010[_0x2976af(0xdb)](_0x2976af(0xdf)+_0x563f51+(_0x2a254c?_0x2976af(0xfc)+_0x2a254c+')':''));}return!_0xe63d57&&(_0x450010[_0x2976af(0xdb)](''),_0x450010[_0x2976af(0xdb)]('No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:'),_0x450010[_0x2976af(0xdb)](''),_0x450010[_0x2976af(0xdb)](_0x2976af(0xb5)+CLI_BIN_NAME+'\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]'),_0x450010['push'](''),_0x450010[_0x2976af(0xdb)](_0x2976af(0xd5)+PRODUCT_CONFIG[_0x2976af(0xe1)]+')'),_0x450010[_0x2976af(0xdb)](_0x2976af(0xf9)),_0x450010[_0x2976af(0xdb)](''),_0x450010[_0x2976af(0xdb)](_0x2976af(0xdd)),_0x450010[_0x2976af(0xdb)](_0x2976af(0xc2)+_0x439e98+_0x2976af(0xed)),_0x450010['push'](''),_0x450010[_0x2976af(0xdb)](_0x2976af(0xb8)+CLI_BIN_NAME+_0x2976af(0xf2)),_0x450010[_0x2976af(0xdb)]('If\x20command\x20execution\x20still\x20fails,\x20run:\x20'+CLI_BIN_NAME+_0x2976af(0xd3))),{'ok':!![],'message':_0x450010[_0x2976af(0xe6)]('\x0a')};}},{'service':a6_0x24fb07(0xbf),'command':a6_0x24fb07(0xd1),'description':a6_0x24fb07(0xeb),'risk':a6_0x24fb07(0xde),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x5d89d6){const _0x296bb6=a6_0x24fb07,_0x21a96c=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x21a96c,'meta':{'env':_0x5d89d6[_0x296bb6(0xba)]??'production'}}};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xbd6c56,_0x207828){const _0x395a1f=a7_0x4b96,_0x3c2302=_0xbd6c56();while(!![]){try{const _0x387a56=parseInt(_0x395a1f(0x143))/0x1+-parseInt(_0x395a1f(0x139))/0x2+-parseInt(_0x395a1f(0x13e))/0x3*(-parseInt(_0x395a1f(0x14a))/0x4)+-parseInt(_0x395a1f(0x146))/0x5+-parseInt(_0x395a1f(0x142))/0x6+-parseInt(_0x395a1f(0x141))/0x7+parseInt(_0x395a1f(0x140))/0x8;if(_0x387a56===_0x207828)break;else _0x3c2302['push'](_0x3c2302['shift']());}catch(_0x3a2909){_0x3c2302['push'](_0x3c2302['shift']());}}}(a7_0x1193,0xab48c));import{createInterface}from'node:readline';class AbortPrompt extends Error{constructor(){const _0x350238=a7_0x4b96;super(_0x350238(0x148)),this[_0x350238(0x13c)]='AbortPrompt';}}function createSafeRl(){const _0x286ea1=a7_0x4b96,_0x59c926=createInterface({'input':process[_0x286ea1(0x13d)],'output':process['stdout']});let _0x1e6a19;const _0x1b5ae4=new Promise((_0x54faae,_0x22bf3a)=>{const _0x5e2c3=_0x286ea1;_0x1e6a19=()=>{const _0x1986c6=a7_0x4b96;_0x1e6a19&&(_0x59c926['removeListener'](_0x1986c6(0x149),_0x1e6a19),_0x1e6a19=undefined);try{_0x59c926[_0x1986c6(0x14b)]();}catch{}_0x22bf3a(new AbortPrompt());},_0x59c926[_0x5e2c3(0x145)](_0x5e2c3(0x149),_0x1e6a19);}),_0x288aa4=()=>{const _0x16dd2c=_0x286ea1;_0x1e6a19&&(_0x59c926[_0x16dd2c(0x13b)](_0x16dd2c(0x149),_0x1e6a19),_0x1e6a19=undefined);try{_0x59c926[_0x16dd2c(0x14b)]();}catch{}};return{'rl':_0x59c926,'abortPromise':_0x1b5ae4,'disposeSuccess':_0x288aa4};}function a7_0x1193(){const _0x1dae71=['once','6000105cPPANg','AccessKey\x20(','User\x20aborted\x20prompt','SIGINT','60840lCkLcw','close','2625154TPUSyy','question','removeListener','name','stdin','54Yddlqn','race','24190232QUXfcs','3957023PpHqjA','416646LXayoX','551349XFJhap','):\x20'];a7_0x1193=function(){return _0x1dae71;};return a7_0x1193();}function a7_0x4b96(_0x498282,_0x33bbff){_0x498282=_0x498282-0x139;const _0x119389=a7_0x1193();let _0x4b96cf=_0x119389[_0x498282];return _0x4b96cf;}export async function promptAccessKey(_0x459456=''){const _0x410d99=a7_0x4b96,{rl:_0x32cd72,abortPromise:_0x147e88,disposeSuccess:_0x27a51d}=createSafeRl(),_0x1390c3=new Promise(_0x5d7727=>{const _0x42bd80=a7_0x4b96,_0xe0af2d=_0x459456?_0x42bd80(0x147)+_0x459456+_0x42bd80(0x144):'AccessKey\x20(paste\x20ak_...):\x20';_0x32cd72[_0x42bd80(0x13a)](_0xe0af2d,_0x246d11=>{_0x27a51d(),_0x5d7727(_0x246d11['trim']()||_0x459456);});});return Promise[_0x410d99(0x13f)]([_0x1390c3,_0x147e88]);}export function isAbortPrompt(_0x5c4243){return _0x5c4243 instanceof Error&&_0x5c4243['name']==='AbortPrompt';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a8_0x30b88c=a8_0x464c;function a8_0x464c(_0x555235,_0x1d4faf){_0x555235=_0x555235-0x1f4;const _0x41c74f=a8_0x41c7();let _0x464c2c=_0x41c74f[_0x555235];return _0x464c2c;}(function(_0x1d5f19,_0x2e40b4){const _0x319c69=a8_0x464c,_0xd5205=_0x1d5f19();while(!![]){try{const _0x4dbe32=parseInt(_0x319c69(0x202))/0x1+-parseInt(_0x319c69(0x1f5))/0x2*(parseInt(_0x319c69(0x1fb))/0x3)+parseInt(_0x319c69(0x203))/0x4+parseInt(_0x319c69(0x1f9))/0x5*(parseInt(_0x319c69(0x209))/0x6)+-parseInt(_0x319c69(0x1f6))/0x7+parseInt(_0x319c69(0x1f7))/0x8+-parseInt(_0x319c69(0x1ff))/0x9;if(_0x4dbe32===_0x2e40b4)break;else _0xd5205['push'](_0xd5205['shift']());}catch(_0x31b335){_0xd5205['push'](_0xd5205['shift']());}}}(a8_0x41c7,0x65e7e));import{getBffScriptInfo}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';export const bffDetail={'service':a8_0x30b88c(0x206),'command':a8_0x30b88c(0x201),'description':a8_0x30b88c(0x1f4),'risk':a8_0x30b88c(0x1fd),'flags':[{...ID_FLAG,'description':a8_0x30b88c(0x1f8)},VERBOSE_FLAG],async 'execute'(_0x279a19){const _0x5ae38d=a8_0x30b88c,_0x191e04=await getBffScriptInfo(_0x279a19[_0x5ae38d(0x1fe)]('id')),_0x381e84=_0x279a19['bool'](_0x5ae38d(0x204));if(_0x381e84)return{'ok':!![],'data':_0x191e04};return{'ok':!![],'data':{'id':_0x191e04['id'],'appCode':_0x191e04[_0x5ae38d(0x200)],'functionName':_0x191e04[_0x5ae38d(0x205)]??'','scriptType':_0x191e04[_0x5ae38d(0x208)],'description':_0x191e04['description']||_0x5ae38d(0x1fc),'createdTime':_0x191e04[_0x5ae38d(0x207)]??'','updatedTime':_0x191e04[_0x5ae38d(0x1fa)]??''}};}};function a8_0x41c7(){const _0x2f88f8=['detail','292319YRGKrW','1215316OxmXss','verbose','functionName','bff','createdTime','scriptType','6AQWxxd','Get\x20BFF\x20script\x20details\x20by\x20ID','149826fKzADh','5632053XiUeai','3894120OFORqh','Script\x20ID','1832915fJcqun','updatedTime','3fukHwH','(none)','read','num','1373382aqCKFi','appCode'];a8_0x41c7=function(){return _0x2f88f8;};return a8_0x41c7();}
|
package/lib/commands/bff/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a9_0x582373=a9_0x507c;function a9_0x507c(_0x348c76,_0x407e5d){_0x348c76=_0x348c76-0x81;const _0x38bee1=a9_0x38be();let _0x507c3c=_0x38bee1[_0x348c76];return _0x507c3c;}function a9_0x38be(){const _0x383dab=['33880HUEFHq','128658YUuIoc','name','3vMflfm','814coMeXA','1683nssKtW','2617404BTohaO','bff','now','159334eJhRlu','read','BFF\x20executed\x20in\x20','exec','18890XMcRXc','1336535jMMMGk','str','params','430686rBdnCG','36bZosAi'];a9_0x38be=function(){return _0x383dab;};return a9_0x38be();}(function(_0x21bd5b,_0x346e11){const _0x537547=a9_0x507c,_0x27c91a=_0x21bd5b();while(!![]){try{const _0x5a7048=-parseInt(_0x537547(0x90))/0x1+parseInt(_0x537547(0x8d))/0x2+-parseInt(_0x537547(0x92))/0x3*(parseInt(_0x537547(0x82))/0x4)+parseInt(_0x537547(0x8a))/0x5+-parseInt(_0x537547(0x8e))/0x6*(-parseInt(_0x537547(0x85))/0x7)+parseInt(_0x537547(0x8f))/0x8*(parseInt(_0x537547(0x81))/0x9)+parseInt(_0x537547(0x89))/0xa*(-parseInt(_0x537547(0x93))/0xb);if(_0x5a7048===_0x346e11)break;else _0x27c91a['push'](_0x27c91a['shift']());}catch(_0x2feaa4){_0x27c91a['push'](_0x27c91a['shift']());}}}(a9_0x38be,0x773b4));import{executeSdkBff}from'../../core/sdk-client.js';import{parseJsonParams}from'../../utils/params.js';import{NAME_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';export const bffExec={'service':a9_0x582373(0x83),'command':a9_0x582373(0x88),'description':'Execute\x20a\x20BFF\x20script\x20by\x20function\x20name','risk':a9_0x582373(0x86),'flags':[{...NAME_FLAG,'required':!![],'description':'BFF\x20function\x20name\x20to\x20execute'},PARAMS_FLAG],async 'execute'(_0x3d17fa){const _0x5d3df9=a9_0x582373,_0xcbd378=parseJsonParams(_0x3d17fa[_0x5d3df9(0x8b)](_0x5d3df9(0x8c))),_0x4d3c2c=Date[_0x5d3df9(0x84)](),_0x8cf90c=await executeSdkBff(_0x3d17fa[_0x5d3df9(0x8b)](_0x5d3df9(0x91)),_0xcbd378),_0xf8397a=Date[_0x5d3df9(0x84)]()-_0x4d3c2c;return{'ok':!![],'data':{'result':_0x8cf90c,'elapsed':_0xf8397a},'message':_0x5d3df9(0x87)+_0xf8397a+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a10_0x115f(){const _0x4a3129=['5961123XrwOQH','1062RytNWs','8aMBwzA','527071WLiJzO','131945YNGupf','1555816QLupjv','10gPauwZ','6KntHit','31678699uCELan','4UsUMYq','99290rmhoOD','12aSihHk','249816jmblaK'];a10_0x115f=function(){return _0x4a3129;};return a10_0x115f();}function a10_0x101f(_0x1ed6c7,_0x339d13){_0x1ed6c7=_0x1ed6c7-0x1b0;const _0x115f41=a10_0x115f();let _0x101f86=_0x115f41[_0x1ed6c7];return _0x101f86;}(function(_0x265b3a,_0x5f3d1b){const _0x2a009f=a10_0x101f,_0x2a5ec2=_0x265b3a();while(!![]){try{const _0x3eb378=parseInt(_0x2a009f(0x1b3))/0x1*(parseInt(_0x2a009f(0x1b9))/0x2)+parseInt(_0x2a009f(0x1b7))/0x3*(-parseInt(_0x2a009f(0x1b5))/0x4)+parseInt(_0x2a009f(0x1b6))/0x5*(-parseInt(_0x2a009f(0x1bc))/0x6)+-parseInt(_0x2a009f(0x1b0))/0x7*(parseInt(_0x2a009f(0x1b2))/0x8)+parseInt(_0x2a009f(0x1b1))/0x9*(-parseInt(_0x2a009f(0x1ba))/0xa)+-parseInt(_0x2a009f(0x1b4))/0xb+parseInt(_0x2a009f(0x1bb))/0xc*(parseInt(_0x2a009f(0x1b8))/0xd);if(_0x3eb378===_0x5f3d1b)break;else _0x2a5ec2['push'](_0x2a5ec2['shift']());}catch(_0x2326e4){_0x2a5ec2['push'](_0x2a5ec2['shift']());}}}(a10_0x115f,0x91293));import{bffDetail}from'../../commands/bff/detail.js';import{bffExec}from'../../commands/bff/exec.js';export const bffDefinitions=[bffDetail,bffExec];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x33252e,_0x4ffb4c){const _0x19e559=a11_0x5377,_0x142032=_0x33252e();while(!![]){try{const _0x2c2861=-parseInt(_0x19e559(0x1b2))/0x1+-parseInt(_0x19e559(0x1c1))/0x2+parseInt(_0x19e559(0x1b9))/0x3*(parseInt(_0x19e559(0x1ac))/0x4)+parseInt(_0x19e559(0x1b8))/0x5+-parseInt(_0x19e559(0x1b3))/0x6+parseInt(_0x19e559(0x1b1))/0x7+-parseInt(_0x19e559(0x1ad))/0x8*(-parseInt(_0x19e559(0x1bc))/0x9);if(_0x2c2861===_0x4ffb4c)break;else _0x142032['push'](_0x142032['shift']());}catch(_0x4a6400){_0x142032['push'](_0x142032['shift']());}}}(a11_0x220d,0xaeae0));function a11_0x5377(_0x48d3b5,_0x3e98d9){_0x48d3b5=_0x48d3b5-0x1ac;const _0x220d68=a11_0x220d();let _0x5377d8=_0x220d68[_0x48d3b5];return _0x5377d8;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG}from'../../constant/product.js';export{DEFAULT_APP_PROFILE_NAME,DEFAULT_CONFIG_VALUES}from'../../constant/defaults.js';export{RUNTIME_ENV_VALUES}from'../../constant/env.js';export{OUTPUT_FORMAT_VALUES}from'../../constant/output.js';function a11_0x220d(){const _0x1d1639=['73144PDCJVu','\x20found).','newConfigFileName','project-default','5560751UzqIVb','246117jbMxPf','6908850jBbbJa','project','Add\x20--global\x20to\x20write\x20to\x20~/',',\x20or\x20run\x20`','\x20(global)','6288655lyyeXo','3YXvsXc','inProject','global','261lPwFVA','validation','Not\x20inside\x20a\x20project\x20(no\x20','project-or-global-explicit','Flags\x20--global\x20and\x20--project\x20are\x20mutually\x20exclusive.','1449788kFVbBL','2082812oOjnvP'];a11_0x220d=function(){return _0x1d1639;};return a11_0x220d();}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(_0x6dbc1e){const _0x34abfb=a11_0x5377,{explicitGlobal:explicitGlobal=![],explicitProject:explicitProject=![],policy:_0x40ead3}=_0x6dbc1e;if(explicitGlobal&&explicitProject)throw CliErrors[_0x34abfb(0x1bd)](_0x34abfb(0x1c0),'Use\x20only\x20one\x20config\x20scope\x20flag.');if(explicitGlobal)return'global';if(explicitProject)return _0x34abfb(0x1b4);switch(_0x40ead3){case'global-default':return _0x34abfb(0x1bb);case _0x34abfb(0x1b0):return _0x6dbc1e[_0x34abfb(0x1ba)]??isInProject()?_0x34abfb(0x1b4):_0x34abfb(0x1bb);case _0x34abfb(0x1bf):if(!(_0x6dbc1e[_0x34abfb(0x1ba)]??isInProject()))throw CliErrors['validation'](_0x34abfb(0x1be)+PRODUCT_CONFIG['newConfigFileName']+_0x34abfb(0x1ae),_0x34abfb(0x1b5)+PRODUCT_CONFIG[_0x34abfb(0x1af)]+_0x34abfb(0x1b6)+CLI_BIN_NAME+'\x20init`\x20first.');return _0x34abfb(0x1b4);}}export function toScopeFlags(_0x1cdd66){const _0xddcc39=a11_0x5377;return{'global':_0x1cdd66===_0xddcc39(0x1bb)};}export function formatScopeLabel(_0x25081e){const _0x5a64a1=a11_0x5377;return _0x25081e===_0x5a64a1(0x1bb)?_0x5a64a1(0x1b7):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a12_0x132e(){const _0x2c1127=['test','Exactly\x20one\x20of\x20','2597483wlmzUY','some',',\x20got\x20\x22','join','428bgTIaa','\x20is\x20allowed,\x20found:\x20','49639wrDNhu','24185SXFNly','12120980OedYcr','3284724SFEmfu','Use\x20only\x20one\x20of:\x20','filter','4720504XQHIcA','\x20is\x20required\x20for\x20`','flag','18sMGeYC','1273732GopgYQ','Provide\x20one\x20of:\x20','9OehHNb','Only\x20one\x20of\x20','\x20are\x20mutually\x20exclusive\x20for\x20`','Remove\x20all\x20but\x20one.','map','length','validation',':\x20expected\x20'];a12_0x132e=function(){return _0x2c1127;};return a12_0x132e();}(function(_0x28c3e4,_0x4f9afe){const _0x57c128=a12_0x5118,_0x3b2696=_0x28c3e4();while(!![]){try{const _0x5525ff=-parseInt(_0x57c128(0x105))/0x1+-parseInt(_0x57c128(0xf3))/0x2+parseInt(_0x57c128(0xec))/0x3+-parseInt(_0x57c128(0x103))/0x4*(parseInt(_0x57c128(0x106))/0x5)+-parseInt(_0x57c128(0xf2))/0x6*(parseInt(_0x57c128(0xff))/0x7)+parseInt(_0x57c128(0xef))/0x8+-parseInt(_0x57c128(0xf5))/0x9*(-parseInt(_0x57c128(0xeb))/0xa);if(_0x5525ff===_0x4f9afe)break;else _0x3b2696['push'](_0x3b2696['shift']());}catch(_0x50ced9){_0x3b2696['push'](_0x3b2696['shift']());}}}(a12_0x132e,0x8d8d6));import{CliErrors}from'../../errors.js';function isSet(_0x1d2e98,_0x50ca80){const _0x5a8390=a12_0x5118,_0x38d76c=_0x1d2e98[_0x5a8390(0xf1)](_0x50ca80);return _0x38d76c!==undefined&&_0x38d76c!==''&&_0x38d76c!==![]&&_0x38d76c!==0x0;}function fmtNames(_0x4d1132){const _0x238202=a12_0x5118;return _0x4d1132[_0x238202(0xf9)](_0x62a214=>'--'+_0x62a214)[_0x238202(0x102)](',\x20');}export function requireOneOf(_0x500b7a,_0x249cd2,_0x588795){const _0x257e5c=a12_0x5118,_0x493523=_0x249cd2[_0x257e5c(0xee)](_0x511c9e=>isSet(_0x500b7a,_0x511c9e));if(_0x493523[_0x257e5c(0xfa)]!==0x1)throw CliErrors[_0x257e5c(0xfb)](_0x493523[_0x257e5c(0xfa)]===0x0?_0x257e5c(0xfe)+fmtNames(_0x249cd2)+_0x257e5c(0xf0)+_0x588795+'`.':_0x257e5c(0xf6)+fmtNames(_0x249cd2)+_0x257e5c(0x104)+fmtNames(_0x493523)+'.',_0x493523[_0x257e5c(0xfa)]===0x0?_0x257e5c(0xf4)+fmtNames(_0x249cd2):_0x257e5c(0xf8));}function a12_0x5118(_0x2ba5fa,_0x98f193){_0x2ba5fa=_0x2ba5fa-0xeb;const _0x132eff=a12_0x132e();let _0x511844=_0x132eff[_0x2ba5fa];return _0x511844;}export function requireAnyOf(_0x24e360,_0x2aeee1,_0x593159){const _0x35c995=a12_0x5118;if(!_0x2aeee1[_0x35c995(0x100)](_0x52149d=>isSet(_0x24e360,_0x52149d)))throw CliErrors[_0x35c995(0xfb)]('At\x20least\x20one\x20of\x20'+fmtNames(_0x2aeee1)+'\x20is\x20required\x20for\x20`'+_0x593159+'`.',_0x35c995(0xf4)+fmtNames(_0x2aeee1));}export function mutuallyExclusive(_0x29807e,_0x59664b,_0x615b59){const _0x5bb068=a12_0x5118,_0x33ee17=_0x59664b[_0x5bb068(0xee)](_0x197583=>isSet(_0x29807e,_0x197583));if(_0x33ee17[_0x5bb068(0xfa)]>0x1)throw CliErrors[_0x5bb068(0xfb)]('Flags\x20'+fmtNames(_0x33ee17)+_0x5bb068(0xf7)+_0x615b59+'`.',_0x5bb068(0xed)+fmtNames(_0x59664b));}export function validatePattern(_0x58ae0b,_0x3c4084,_0x1d5460,_0x1a57bd){const _0x120d98=a12_0x5118,_0x143a32=_0x58ae0b['str'](_0x3c4084);if(_0x143a32&&!_0x1d5460[_0x120d98(0xfd)](_0x143a32))throw CliErrors[_0x120d98(0xfb)]('Invalid\x20--'+_0x3c4084+_0x120d98(0xfc)+_0x1a57bd+_0x120d98(0x101)+_0x143a32+'\x22.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a13_0x7f905e=a13_0x1a1b;(function(_0x549016,_0x3e93a4){const _0x5bf0b0=a13_0x1a1b,_0x2e05ec=_0x549016();while(!![]){try{const _0x5ccd4b=-parseInt(_0x5bf0b0(0x149))/0x1+parseInt(_0x5bf0b0(0x141))/0x2*(parseInt(_0x5bf0b0(0x154))/0x3)+-parseInt(_0x5bf0b0(0x14e))/0x4*(parseInt(_0x5bf0b0(0x14d))/0x5)+-parseInt(_0x5bf0b0(0x151))/0x6*(parseInt(_0x5bf0b0(0x155))/0x7)+-parseInt(_0x5bf0b0(0x14c))/0x8*(parseInt(_0x5bf0b0(0x152))/0x9)+parseInt(_0x5bf0b0(0x144))/0xa*(-parseInt(_0x5bf0b0(0x13f))/0xb)+-parseInt(_0x5bf0b0(0x143))/0xc*(-parseInt(_0x5bf0b0(0x145))/0xd);if(_0x5ccd4b===_0x3e93a4)break;else _0x2e05ec['push'](_0x2e05ec['shift']());}catch(_0x2ada16){_0x2e05ec['push'](_0x2e05ec['shift']());}}}(a13_0x3ff7,0xcd0ab));export const CODE_FLAG={'name':a13_0x7f905e(0x150),'type':a13_0x7f905e(0x14a),'required':!![],'description':'Dataset\x20code\x20(32-char\x20hex\x20UUID)','pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a13_0x7f905e(0x140)}};function a13_0x3ff7(){const _0x3feeba=['368ZaLYpr','verbose','4080fCHbNx','92290hxoLNe','246129BkQVcA','Return\x20full\x20raw\x20response\x20object','params','number','1328532uRqGpk','string','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','8dMJJiJ','8078215bhcBXB','4nuNukJ','name','code','216XoOsFm','14145777iRMDTq','sqlcode','10767DLbUMl','265111zIDtoR','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','451JmkMNS','a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)'];a13_0x3ff7=function(){return _0x3feeba;};return a13_0x3ff7();}function a13_0x1a1b(_0x49a028,_0x145c91){_0x49a028=_0x49a028-0x13e;const _0x3ff75a=a13_0x3ff7();let _0x1a1b1d=_0x3ff75a[_0x49a028];return _0x1a1b1d;}export const SQLCODE_FLAG={'name':a13_0x7f905e(0x153),'type':'string','required':!![],'description':'SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a13_0x7f905e(0x13e)}};export const VERBOSE_FLAG={'name':a13_0x7f905e(0x142),'type':'boolean','description':a13_0x7f905e(0x146)};export const PARAMS_FLAG={'name':a13_0x7f905e(0x147),'type':'string','description':a13_0x7f905e(0x14b)};export const NAME_FLAG={'name':a13_0x7f905e(0x14f),'type':a13_0x7f905e(0x14a),'description':'Resource\x20name\x20for\x20lookup'};export const ID_FLAG={'name':'id','type':a13_0x7f905e(0x148),'required':!![],'description':'Resource\x20ID'};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a14_0x3fa855=a14_0x3f05;(function(_0x24b791,_0xb2de27){const _0x1d5685=a14_0x3f05,_0x37a76b=_0x24b791();while(!![]){try{const _0x43e1ca=-parseInt(_0x1d5685(0x101))/0x1+-parseInt(_0x1d5685(0x12b))/0x2*(parseInt(_0x1d5685(0x10e))/0x3)+-parseInt(_0x1d5685(0x112))/0x4+parseInt(_0x1d5685(0x122))/0x5*(parseInt(_0x1d5685(0x126))/0x6)+-parseInt(_0x1d5685(0xfe))/0x7*(parseInt(_0x1d5685(0x118))/0x8)+parseInt(_0x1d5685(0x127))/0x9+-parseInt(_0x1d5685(0x12c))/0xa*(-parseInt(_0x1d5685(0x108))/0xb);if(_0x43e1ca===_0xb2de27)break;else _0x37a76b['push'](_0x37a76b['shift']());}catch(_0x1024bb){_0x37a76b['push'](_0x37a76b['shift']());}}}(a14_0x1821,0xcf38a));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':a14_0x3fa855(0x106),'default':![]},listDef={'service':a14_0x3fa855(0x10f),'command':a14_0x3fa855(0x117),'description':'List\x20current\x20config','risk':a14_0x3fa855(0xfd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x50e934){const _0x2f9fe4=a14_0x3fa855,{buildConfigFromFlags:_0x509398}=await import(_0x2f9fe4(0x105)),_0x377f90=_0x509398({}),_0x226b07=getProjectConfigPath(),_0x465d40=resolveWriteConfigPath(_0x2f9fe4(0x11a));if(_0x50e934['format']===_0x2f9fe4(0xfa))return{'ok':!![],'message':'#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a'+(JSON[_0x2f9fe4(0xf7)](_0x377f90['raw'],null,0x2)+'\x0a\x0a')+_0x2f9fe4(0x10c)+('\x20\x20project:\x20'+(_0x226b07??_0x2f9fe4(0x111))+'\x0a')+(_0x2f9fe4(0x107)+_0x465d40)};return{'ok':!![],'data':{'effective':_0x377f90[_0x2f9fe4(0x120)],'configFiles':{'project':_0x226b07??null,'global':_0x465d40}}};}},getDef={'service':a14_0x3fa855(0x10f),'command':a14_0x3fa855(0x125),'description':a14_0x3fa855(0x113),'risk':a14_0x3fa855(0xfd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':a14_0x3fa855(0x104),'required':!![]}],'flags':[],async 'execute'(_0x59608a){const _0x5afba0=a14_0x3fa855,_0x5cf259=_0x59608a[_0x5afba0(0xf8)][0x0];if(!_0x5cf259)throw CliErrors[_0x5afba0(0x128)](_0x5afba0(0x129),_0x5afba0(0xf9)+CLI_BIN_NAME+_0x5afba0(0xf6));const {buildConfigFromFlags:_0x4450f4}=await import(_0x5afba0(0x105)),{raw:_0x223dee}=_0x4450f4({});if(_0x5cf259[_0x5afba0(0x110)]('.')){const _0x1b6789=_0x5cf259[_0x5afba0(0x103)]('.');let _0x17dad0=_0x223dee;for(const _0xa3f8fd of _0x1b6789){if(_0x17dad0==null||typeof _0x17dad0!==_0x5afba0(0x114))throw CliErrors['validation'](_0x5afba0(0x123)+_0x5cf259);_0x17dad0=_0x17dad0[_0xa3f8fd];}if(_0x17dad0===undefined)throw CliErrors[_0x5afba0(0x128)]('Key\x20not\x20found:\x20'+_0x5cf259);return console['log'](typeof _0x17dad0===_0x5afba0(0x114)?JSON['stringify'](_0x17dad0,null,0x2):String(_0x17dad0)),{'ok':!![]};}const _0x49ccc7=_0x223dee[_0x5cf259];if(_0x49ccc7===undefined)throw CliErrors[_0x5afba0(0x128)]('Key\x20not\x20found:\x20'+_0x5cf259);return console[_0x5afba0(0x12a)](typeof _0x49ccc7===_0x5afba0(0x114)?JSON['stringify'](_0x49ccc7,null,0x2):String(_0x49ccc7)),{'ok':!![]};}},setDef={'service':a14_0x3fa855(0x10f),'command':a14_0x3fa855(0x11b),'description':'Set\x20a\x20config\x20value','risk':a14_0x3fa855(0x11f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a14_0x3fa855(0x10d),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a14_0x3fa855(0x11d),'description':'Value\x20to\x20assign','required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x2a4ca5){const _0x2ca084=a14_0x3fa855,_0x56b4ee=_0x2a4ca5[_0x2ca084(0xf8)][0x0],_0x4b8fc6=_0x2a4ca5[_0x2ca084(0xf8)][0x1];if(!_0x56b4ee||_0x4b8fc6===undefined)throw CliErrors[_0x2ca084(0x128)]('Missing\x20key\x20or\x20value.',_0x2ca084(0xf9)+CLI_BIN_NAME+'\x20config\x20set\x20<key>\x20<value>\x20[--global]');if(ENUM_KEYS[_0x56b4ee]&&!ENUM_KEYS[_0x56b4ee][_0x2ca084(0x110)](_0x4b8fc6))throw CliErrors['validation'](_0x2ca084(0xff)+_0x56b4ee+'\x22.\x20Allowed:\x20'+ENUM_KEYS[_0x56b4ee][_0x2ca084(0x100)](',\x20'));if(_0x56b4ee==='riskLevel')throw CliErrors['validation'](_0x2ca084(0x121));if(_0x56b4ee===_0x2ca084(0x11c)){const _0x5694f2=Number(_0x4b8fc6);if(isNaN(_0x5694f2)||_0x5694f2<=0x0)throw CliErrors[_0x2ca084(0x128)](_0x2ca084(0x10b));}const _0x54a8e2=resolveWriteScope({'explicitGlobal':_0x2a4ca5[_0x2ca084(0xfb)](_0x2ca084(0x11a)),'policy':'project-or-global-explicit'}),_0xc5a193=toScopeFlags(_0x54a8e2),_0x41f5d4=readScopedConfig(_0xc5a193);if(!isTopLevelConfigKey(_0x56b4ee))throw CliErrors[_0x2ca084(0x128)](_0x2ca084(0x102)+_0x56b4ee+_0x2ca084(0x124),_0x2ca084(0x109)+getTopLevelConfigKeySummary());return _0x41f5d4[_0x56b4ee]=_0x56b4ee===_0x2ca084(0x11c)?Number(_0x4b8fc6):_0x4b8fc6,console[_0x2ca084(0x12a)](_0x2ca084(0x12d)+_0x56b4ee+_0x2ca084(0x12e)+_0x4b8fc6+'\x22'+(_0x54a8e2===_0x2ca084(0x11a)?'\x20(global)':'')),writeScopedConfig(_0x41f5d4,_0xc5a193),{'ok':!![]};}},deleteDef={'service':a14_0x3fa855(0x10f),'command':a14_0x3fa855(0x11e),'description':a14_0x3fa855(0x10a),'risk':a14_0x3fa855(0x11f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a14_0x3fa855(0x10d),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x4690ad){const _0x1c3cd1=a14_0x3fa855,_0x37232d=_0x4690ad[_0x1c3cd1(0xf8)][0x0];if(!_0x37232d)throw CliErrors[_0x1c3cd1(0x128)](_0x1c3cd1(0x129),'Usage:\x20'+CLI_BIN_NAME+'\x20config\x20delete\x20<key>\x20[--global]');const _0x4a5ba6=resolveWriteScope({'explicitGlobal':_0x4690ad[_0x1c3cd1(0xfb)](_0x1c3cd1(0x11a)),'policy':_0x1c3cd1(0x119)}),_0x37b954=toScopeFlags(_0x4a5ba6),_0x329965=readScopedConfig(_0x37b954);if(_0x329965[_0x37232d]===undefined)throw CliErrors[_0x1c3cd1(0x128)](_0x1c3cd1(0x115)+_0x37232d+'\x22\x20not\x20found\x20at\x20top\x20level.');return delete _0x329965[_0x37232d],console[_0x1c3cd1(0x12a)](_0x1c3cd1(0x116)+_0x37232d+'`'+(_0x4a5ba6==='global'?_0x1c3cd1(0xfc):'')),writeScopedConfig(_0x329965,_0x37b954),{'ok':!![]};}};function a14_0x3f05(_0x174a4f,_0x133a24){_0x174a4f=_0x174a4f-0xf6;const _0x18211c=a14_0x1821();let _0x3f0545=_0x18211c[_0x174a4f];return _0x3f0545;}function a14_0x1821(){const _0x2885af=['pretty','bool','\x20(global)','read','329KtNnwc','Invalid\x20value\x20for\x20\x22','join','178962rRmMua','Top-level\x20key\x20\x22','split','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','../../context.js','Write\x20to\x20global\x20config','\x20\x20global:\x20\x20','15422AdNsZG','Settable\x20top-level\x20keys:\x20','Delete\x20a\x20config\x20value','pageSize\x20must\x20be\x20a\x20positive\x20number','Config\x20files:\x0a','key','111417muClSa','config','includes','(none)','3722168UUGFDP','Get\x20a\x20config\x20value','object','Key\x20\x22','Deleted\x20`','list','213848gIexyz','project-or-global-explicit','global','set','pageSize','value','delete','write','raw','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','28925hbFQwH','Key\x20not\x20found:\x20','\x22\x20is\x20not\x20settable.','get','42AoTRTM','2944305tKiiLm','validation','Missing\x20key\x20argument.','log','34qajnfL','24810WTKkqp','Set\x20`','`\x20=\x20\x22','\x20config\x20get\x20<key>','stringify','args','Usage:\x20'];a14_0x1821=function(){return _0x2885af;};return a14_0x1821();}export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
1
|
+
const a14_0x590851=a14_0x5ce9;function a14_0x5ce9(_0x449f66,_0x3c9a3f){_0x449f66=_0x449f66-0x1c6;const _0xbf49ba=a14_0xbf49();let _0x5ce978=_0xbf49ba[_0x449f66];return _0x5ce978;}(function(_0x328309,_0x2f627a){const _0x365e5c=a14_0x5ce9,_0xc5627f=_0x328309();while(!![]){try{const _0xf8bd5e=parseInt(_0x365e5c(0x1f7))/0x1+parseInt(_0x365e5c(0x1d0))/0x2+-parseInt(_0x365e5c(0x203))/0x3*(-parseInt(_0x365e5c(0x1dc))/0x4)+-parseInt(_0x365e5c(0x1df))/0x5+-parseInt(_0x365e5c(0x1d3))/0x6+-parseInt(_0x365e5c(0x1d6))/0x7+-parseInt(_0x365e5c(0x1da))/0x8*(-parseInt(_0x365e5c(0x206))/0x9);if(_0xf8bd5e===_0x2f627a)break;else _0xc5627f['push'](_0xc5627f['shift']());}catch(_0x2cfe09){_0xc5627f['push'](_0xc5627f['shift']());}}}(a14_0xbf49,0xe254c));import{CliErrors}from'../../errors.js';function a14_0xbf49(){const _0x304c72=['Config\x20files:\x0a','stringify','log','\x22\x20not\x20found\x20at\x20top\x20level.','Write\x20to\x20global\x20config','Value\x20to\x20assign','object','includes','Settable\x20keys:\x20','\x22\x20is\x20not\x20settable.','value','field','pretty','trim','\x20(global)','\x20config\x20delete\x20<key>\x20[--global]','Invalid\x20value\x20for\x20\x22','List\x20current\x20config','bool','Usage:\x20','1246256misbye','length','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','Set\x20a\x20config\x20value','alias','format','Key\x20not\x20found:\x20','global','Key\x20\x22','raw','pageSize','pageSize\x20must\x20be\x20a\x20positive\x20number','89190jOHlYt','Get\x20a\x20config\x20value','\x22.\x20Allowed:\x20','604026EZQNhx','read','Top-level\x20key\x20\x22','../../context.js','key','split','isArray','validation','Delete\x20a\x20config\x20value','Missing\x20key\x20or\x20value.','\x20config\x20get\x20<key>','(none)','2666868SdSIPN','project-or-global-explicit','keys','3650094xcOJBZ','\x20config\x20set\x20<key>\x20<value>\x20[--global]','config','10366538RyZEOK','\x20\x20global:\x20\x20','appcode','args','56elqlLA','Missing\x20key\x20argument.','28TeBlaI',';\x20apps.<alias>.appcode','Set\x20`','1206315GEfrOl','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','write','apps'];a14_0xbf49=function(){return _0x304c72;};return a14_0xbf49();}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':a14_0x590851(0x1fe),'type':'boolean','description':a14_0x590851(0x1e7),'default':![]};function parseAliasAppcodeSetKey(_0x28f8c5){const _0x1e5800=a14_0x590851,_0x2abeb3=_0x28f8c5[_0x1e5800(0x1c9)]('.');if(_0x2abeb3[_0x1e5800(0x1f8)]!==0x3||_0x2abeb3[0x0]!==_0x1e5800(0x1e2)||_0x2abeb3[0x2]!=='appcode')return undefined;const _0x233a65=_0x2abeb3[0x1]?.[_0x1e5800(0x1f0)]();return _0x233a65?_0x233a65:undefined;}function parseAliasDeleteKey(_0x34be96){const _0x2df27c=a14_0x590851,_0x31508b=_0x34be96['split']('.');if(_0x31508b[_0x2df27c(0x1f8)]===0x2&&_0x31508b[0x0]===_0x2df27c(0x1e2)){const _0x402709=_0x31508b[0x1]?.[_0x2df27c(0x1f0)]();return _0x402709?{'alias':_0x402709}:undefined;}if(_0x31508b['length']===0x3&&_0x31508b[0x0]==='apps'&&_0x31508b[0x2]==='appcode'){const _0x4842ab=_0x31508b[0x1]?.['trim']();return _0x4842ab?{'alias':_0x4842ab,'field':_0x2df27c(0x1d8)}:undefined;}return undefined;}function setLocalAppAlias(_0x5373a6,_0x37b8d1,_0x22ad39){const _0x1eca9c=a14_0x590851,_0x2dd810=_0x5373a6['apps']&&typeof _0x5373a6[_0x1eca9c(0x1e2)]===_0x1eca9c(0x1e9)&&!Array['isArray'](_0x5373a6[_0x1eca9c(0x1e2)])?_0x5373a6['apps']:{},_0xa4260f=_0x2dd810[_0x37b8d1]&&typeof _0x2dd810[_0x37b8d1]==='object'&&!Array[_0x1eca9c(0x1ca)](_0x2dd810[_0x37b8d1])?_0x2dd810[_0x37b8d1]:{};_0xa4260f[_0x1eca9c(0x1d8)]=_0x22ad39,_0x2dd810[_0x37b8d1]=_0xa4260f,_0x5373a6[_0x1eca9c(0x1e2)]=_0x2dd810;}function deleteLocalAppAlias(_0x2dbf68,_0x2a1726){const _0x4b2ea1=a14_0x590851;if(!_0x2dbf68[_0x4b2ea1(0x1e2)]||typeof _0x2dbf68['apps']!==_0x4b2ea1(0x1e9)||Array[_0x4b2ea1(0x1ca)](_0x2dbf68[_0x4b2ea1(0x1e2)]))return![];const _0x1380cb=_0x2dbf68[_0x4b2ea1(0x1e2)],_0x301b57=_0x1380cb[_0x2a1726[_0x4b2ea1(0x1fb)]];if(!_0x301b57||typeof _0x301b57!=='object'||Array[_0x4b2ea1(0x1ca)](_0x301b57))return![];if(!_0x2a1726[_0x4b2ea1(0x1ee)])return delete _0x1380cb[_0x2a1726[_0x4b2ea1(0x1fb)]],!![];if(!(_0x2a1726['field']in _0x301b57))return![];return delete _0x301b57[_0x2a1726[_0x4b2ea1(0x1ee)]],Object[_0x4b2ea1(0x1d2)](_0x301b57)['length']===0x0&&delete _0x1380cb[_0x2a1726[_0x4b2ea1(0x1fb)]],!![];}const listDef={'service':'config','command':'list','description':a14_0x590851(0x1f4),'risk':a14_0x590851(0x207),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x38056c){const _0x520fe8=a14_0x590851,{buildConfigFromFlags:_0x5a0c39}=await import(_0x520fe8(0x1c7)),_0x32cc15=_0x5a0c39({}),_0x428e4f=getProjectConfigPath(),_0x759dae=resolveWriteConfigPath(_0x520fe8(0x1fe));if(_0x38056c[_0x520fe8(0x1fc)]===_0x520fe8(0x1ef))return{'ok':!![],'message':_0x520fe8(0x1f9)+(JSON[_0x520fe8(0x1e4)](_0x32cc15['raw'],null,0x2)+'\x0a\x0a')+_0x520fe8(0x1e3)+('\x20\x20project:\x20'+(_0x428e4f??_0x520fe8(0x1cf))+'\x0a')+(_0x520fe8(0x1d7)+_0x759dae)};return{'ok':!![],'data':{'effective':_0x32cc15[_0x520fe8(0x200)],'configFiles':{'project':_0x428e4f??null,'global':_0x759dae}}};}},getDef={'service':a14_0x590851(0x1d5),'command':'get','description':a14_0x590851(0x204),'risk':a14_0x590851(0x207),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a14_0x590851(0x1c8),'description':a14_0x590851(0x1e0),'required':!![]}],'flags':[],async 'execute'(_0x42832e){const _0x3eae64=a14_0x590851,_0x2e8d53=_0x42832e[_0x3eae64(0x1d9)][0x0];if(!_0x2e8d53)throw CliErrors['validation'](_0x3eae64(0x1db),_0x3eae64(0x1f6)+CLI_BIN_NAME+_0x3eae64(0x1ce));const {buildConfigFromFlags:_0x4b4684}=await import(_0x3eae64(0x1c7)),{raw:_0x26c68b}=_0x4b4684({});if(_0x2e8d53[_0x3eae64(0x1ea)]('.')){const _0x411b34=_0x2e8d53[_0x3eae64(0x1c9)]('.');let _0x23c3fa=_0x26c68b;for(const _0x57e547 of _0x411b34){if(_0x23c3fa==null||typeof _0x23c3fa!==_0x3eae64(0x1e9))throw CliErrors[_0x3eae64(0x1cb)](_0x3eae64(0x1fd)+_0x2e8d53);_0x23c3fa=_0x23c3fa[_0x57e547];}if(_0x23c3fa===undefined)throw CliErrors[_0x3eae64(0x1cb)](_0x3eae64(0x1fd)+_0x2e8d53);return console['log'](typeof _0x23c3fa==='object'?JSON[_0x3eae64(0x1e4)](_0x23c3fa,null,0x2):String(_0x23c3fa)),{'ok':!![]};}const _0x5d3fb3=_0x26c68b[_0x2e8d53];if(_0x5d3fb3===undefined)throw CliErrors[_0x3eae64(0x1cb)]('Key\x20not\x20found:\x20'+_0x2e8d53);return console[_0x3eae64(0x1e5)](typeof _0x5d3fb3===_0x3eae64(0x1e9)?JSON[_0x3eae64(0x1e4)](_0x5d3fb3,null,0x2):String(_0x5d3fb3)),{'ok':!![]};}},setDef={'service':'config','command':'set','description':a14_0x590851(0x1fa),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a14_0x590851(0x1c8),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a14_0x590851(0x1ed),'description':a14_0x590851(0x1e8),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x483cae){const _0x421136=a14_0x590851,_0x16e6a0=_0x483cae[_0x421136(0x1d9)][0x0],_0x3f3805=_0x483cae[_0x421136(0x1d9)][0x1];if(!_0x16e6a0||_0x3f3805===undefined)throw CliErrors['validation'](_0x421136(0x1cd),'Usage:\x20'+CLI_BIN_NAME+_0x421136(0x1d4));if(ENUM_KEYS[_0x16e6a0]&&!ENUM_KEYS[_0x16e6a0][_0x421136(0x1ea)](_0x3f3805))throw CliErrors[_0x421136(0x1cb)](_0x421136(0x1f3)+_0x16e6a0+_0x421136(0x205)+ENUM_KEYS[_0x16e6a0]['join'](',\x20'));if(_0x16e6a0==='riskLevel')throw CliErrors['validation']('\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.');if(_0x16e6a0===_0x421136(0x201)){const _0x2a65eb=Number(_0x3f3805);if(isNaN(_0x2a65eb)||_0x2a65eb<=0x0)throw CliErrors['validation'](_0x421136(0x202));}const _0x268af5=resolveWriteScope({'explicitGlobal':_0x483cae['bool'](_0x421136(0x1fe)),'policy':'project-or-global-explicit'}),_0x295945=toScopeFlags(_0x268af5),_0x3e82bd=readScopedConfig(_0x295945),_0x18cbff=parseAliasAppcodeSetKey(_0x16e6a0);if(!_0x18cbff&&!isTopLevelConfigKey(_0x16e6a0))throw CliErrors[_0x421136(0x1cb)](_0x421136(0x1c6)+_0x16e6a0+_0x421136(0x1ec),_0x421136(0x1eb)+getTopLevelConfigKeySummary()+_0x421136(0x1dd));return _0x18cbff?setLocalAppAlias(_0x3e82bd,_0x18cbff,_0x3f3805):_0x3e82bd[_0x16e6a0]=_0x16e6a0==='pageSize'?Number(_0x3f3805):_0x3f3805,console[_0x421136(0x1e5)](_0x421136(0x1de)+_0x16e6a0+'`\x20=\x20\x22'+_0x3f3805+'\x22'+(_0x268af5===_0x421136(0x1fe)?_0x421136(0x1f1):'')),writeScopedConfig(_0x3e82bd,_0x295945),{'ok':!![]};}},deleteDef={'service':a14_0x590851(0x1d5),'command':'delete','description':a14_0x590851(0x1cc),'risk':a14_0x590851(0x1e1),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a14_0x590851(0x1c8),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x3b235a){const _0x149d4b=a14_0x590851,_0x10f229=_0x3b235a[_0x149d4b(0x1d9)][0x0];if(!_0x10f229)throw CliErrors[_0x149d4b(0x1cb)]('Missing\x20key\x20argument.',_0x149d4b(0x1f6)+CLI_BIN_NAME+_0x149d4b(0x1f2));const _0x3cd90d=resolveWriteScope({'explicitGlobal':_0x3b235a[_0x149d4b(0x1f5)](_0x149d4b(0x1fe)),'policy':_0x149d4b(0x1d1)}),_0x19a9c4=toScopeFlags(_0x3cd90d),_0x14cf6f=readScopedConfig(_0x19a9c4),_0x3ecdbb=parseAliasDeleteKey(_0x10f229);if(_0x3ecdbb){if(!deleteLocalAppAlias(_0x14cf6f,_0x3ecdbb))throw CliErrors[_0x149d4b(0x1cb)](_0x149d4b(0x1fd)+_0x10f229);return console['log']('Deleted\x20`'+_0x10f229+'`'+(_0x3cd90d===_0x149d4b(0x1fe)?_0x149d4b(0x1f1):'')),writeScopedConfig(_0x14cf6f,_0x19a9c4),{'ok':!![]};}if(_0x14cf6f[_0x10f229]===undefined)throw CliErrors[_0x149d4b(0x1cb)](_0x149d4b(0x1ff)+_0x10f229+_0x149d4b(0x1e6));return delete _0x14cf6f[_0x10f229],console['log']('Deleted\x20`'+_0x10f229+'`'+(_0x3cd90d===_0x149d4b(0x1fe)?_0x149d4b(0x1f1):'')),writeScopedConfig(_0x14cf6f,_0x19a9c4),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a15_0xdf3c(){var _0x1a36eb=['8371027DBcbVv','2410QXXxks','1884dtoeet','999866UJPBhI','7557ZtnsZL','508vBDIGW','790128dJQNFZ','22511286mOcRCD','7161512lJrsLd'];a15_0xdf3c=function(){return _0x1a36eb;};return a15_0xdf3c();}(function(_0x2c5626,_0x724505){var _0x961b05=a15_0x5488,_0x19ad51=_0x2c5626();while(!![]){try{var _0x3db98a=-parseInt(_0x961b05(0x194))/0x1+-parseInt(_0x961b05(0x18d))/0x2*(parseInt(_0x961b05(0x18c))/0x3)+parseInt(_0x961b05(0x18e))/0x4+-parseInt(_0x961b05(0x192))/0x5*(parseInt(_0x961b05(0x193))/0x6)+-parseInt(_0x961b05(0x191))/0x7+parseInt(_0x961b05(0x190))/0x8+parseInt(_0x961b05(0x18f))/0x9;if(_0x3db98a===_0x724505)break;else _0x19ad51['push'](_0x19ad51['shift']());}catch(_0x5bfc52){_0x19ad51['push'](_0x19ad51['shift']());}}}(a15_0xdf3c,0x94362));function a15_0x5488(_0x1bf875,_0x3ae94f){_0x1bf875=_0x1bf875-0x18c;var _0xdf3c28=a15_0xdf3c();var _0x548871=_0xdf3c28[_0x1bf875];return _0x548871;}import{CLI_BIN_NAME}from'../../constant/cli.js';export{CLI_BIN_NAME};export{readScopedConfig,writeScopedConfig}from'../../context.js';export{resolveConfigScope as resolveWriteScope,TOP_LEVEL_CONFIG_KEYS as TOP_LEVEL_KEYS,CONFIG_ENUM_VALUES as ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey,toScopeFlags}from'../../commands/common/config-policy.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a16_0x2ed4(_0x41fd07,_0x261f0b){_0x41fd07=_0x41fd07-0x18e;const _0x20dbea=a16_0x20db();let _0x2ed4a8=_0x20dbea[_0x41fd07];return _0x2ed4a8;}const a16_0x484120=a16_0x2ed4;(function(_0x446e49,_0x2b1fdc){const _0x41939a=a16_0x2ed4,_0x5e56b1=_0x446e49();while(!![]){try{const _0x3cda45=parseInt(_0x41939a(0x199))/0x1*(-parseInt(_0x41939a(0x198))/0x2)+parseInt(_0x41939a(0x191))/0x3*(-parseInt(_0x41939a(0x1b7))/0x4)+parseInt(_0x41939a(0x1e0))/0x5*(-parseInt(_0x41939a(0x1c3))/0x6)+-parseInt(_0x41939a(0x1d9))/0x7+-parseInt(_0x41939a(0x1a8))/0x8*(parseInt(_0x41939a(0x1c1))/0x9)+parseInt(_0x41939a(0x1dd))/0xa*(-parseInt(_0x41939a(0x1da))/0xb)+parseInt(_0x41939a(0x1a5))/0xc*(parseInt(_0x41939a(0x19b))/0xd);if(_0x3cda45===_0x2b1fdc)break;else _0x5e56b1['push'](_0x5e56b1['shift']());}catch(_0x14a98f){_0x5e56b1['push'](_0x5e56b1['shift']());}}}(a16_0x20db,0x2aff2));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':a16_0x484120(0x1ab),'operation':'filter','risk':'read','paramsRequired':![],'description':a16_0x484120(0x18f),'paramsHint':a16_0x484120(0x1ca)+a16_0x484120(0x1a1),'helpExtra':[a16_0x484120(0x1e6),a16_0x484120(0x1b1),a16_0x484120(0x1c9),a16_0x484120(0x19f),a16_0x484120(0x1c0),a16_0x484120(0x193),a16_0x484120(0x1e1),a16_0x484120(0x1a4),a16_0x484120(0x1be),a16_0x484120(0x1b4),a16_0x484120(0x1cf),'',a16_0x484120(0x19c),a16_0x484120(0x1b3),'\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}}]}','',a16_0x484120(0x1d1),a16_0x484120(0x1e7),'\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]',a16_0x484120(0x1a2),a16_0x484120(0x1d0),'\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','',a16_0x484120(0x1a0),'\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.',a16_0x484120(0x1ae),a16_0x484120(0x1a9)][a16_0x484120(0x197)]('\x0a')},{'command':a16_0x484120(0x1ba),'operation':a16_0x484120(0x1ba),'risk':a16_0x484120(0x18e),'paramsRequired':!![],'description':a16_0x484120(0x1e5),'paramsHint':a16_0x484120(0x1af)},{'command':a16_0x484120(0x1aa),'operation':a16_0x484120(0x1aa),'risk':a16_0x484120(0x1bb),'paramsRequired':!![],'description':a16_0x484120(0x1d5),'paramsHint':a16_0x484120(0x1cd)},{'command':'batchCreate','operation':a16_0x484120(0x1db),'risk':'write','paramsRequired':!![],'description':a16_0x484120(0x1c2),'paramsHint':'JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27'},{'command':a16_0x484120(0x19e),'operation':a16_0x484120(0x19e),'risk':a16_0x484120(0x1bb),'paramsRequired':!![],'description':'Update\x20an\x20existing\x20record','paramsHint':a16_0x484120(0x1d7)},{'command':a16_0x484120(0x194),'operation':'delete','risk':a16_0x484120(0x1a3),'paramsRequired':!![],'description':'Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','paramsHint':a16_0x484120(0x1af)},{'command':a16_0x484120(0x1a6),'operation':a16_0x484120(0x1a6),'risk':'read','paramsRequired':![],'description':a16_0x484120(0x1bd),'paramsHint':a16_0x484120(0x1cc)+'Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','helpExtra':['\x20\x20AGGREGATE\x20TYPES',a16_0x484120(0x1d8),a16_0x484120(0x19a),a16_0x484120(0x192),'\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{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}',a16_0x484120(0x1b5),a16_0x484120(0x1e2),a16_0x484120(0x1dc),'',a16_0x484120(0x1b9),a16_0x484120(0x1ad),a16_0x484120(0x1ce),a16_0x484120(0x1bc),a16_0x484120(0x1b8),a16_0x484120(0x196),'\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','',a16_0x484120(0x190),'\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status',a16_0x484120(0x1b6),'',a16_0x484120(0x1d3),a16_0x484120(0x1c4)][a16_0x484120(0x197)]('\x0a')}];function makeDataCommand(_0xee00ec){const _0x353050=a16_0x484120,_0x266de0=_0x353050(0x1b0)+_0xee00ec['command'],_0x58aa94={'service':_0x353050(0x1d2),'command':_0xee00ec[_0x353050(0x1e4)],'description':_0xee00ec[_0x353050(0x1c5)],'risk':_0xee00ec[_0x353050(0x19d)],'helpExtra':_0xee00ec[_0x353050(0x1e3)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0xee00ec[_0x353050(0x1a7)]}],'validate':async _0x57ddb8=>{const _0x5b1525=_0x353050;_0xee00ec[_0x5b1525(0x195)]&&requireAnyOf(_0x57ddb8,[_0x5b1525(0x1de)],_0x266de0),_0xee00ec['operation']===_0x5b1525(0x1db)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x57ddb8[_0x5b1525(0x1b2)]('params')));},async 'execute'(_0x4b9f42){const _0x57fb94=_0x353050,_0x598a22=_0x4b9f42[_0x57fb94(0x1b2)](_0x57fb94(0x1c6)),_0x44a62a=_0xee00ec['operation']==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x4b9f42[_0x57fb94(0x1b2)]('params'))):parseJsonParams(_0x4b9f42['str'](_0x57fb94(0x1de)))??{},_0x206528=Date[_0x57fb94(0x1ac)](),_0x3c30f5=await executeData(_0x598a22,_0xee00ec[_0x57fb94(0x1d4)],_0x44a62a),_0x7691d7=Date[_0x57fb94(0x1ac)]()-_0x206528;return{'ok':!![],'data':{'result':_0x3c30f5,'elapsed':_0x7691d7},'message':_0x57fb94(0x1b0)+_0xee00ec['command']+_0x57fb94(0x1d6)+_0x7691d7+'ms'};}};return _0xee00ec['risk']!==_0x353050(0x18e)&&(_0x58aa94[_0x353050(0x1bf)]=async _0xe21152=>{const _0x393685=_0x353050,_0x596f83=_0xe21152[_0x393685(0x1b2)](_0x393685(0x1c6)),_0x5387f8=_0xee00ec[_0x393685(0x1d4)]===_0x393685(0x1db)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0xe21152[_0x393685(0x1b2)](_0x393685(0x1de)))):parseJsonParams(_0xe21152[_0x393685(0x1b2)](_0x393685(0x1de)))??{};return dryRun(_0x393685(0x1c8),_0x393685(0x1c7)+_0x596f83+'/'+_0xee00ec['operation'])[_0x393685(0x1df)](_0x5387f8)['description'](_0x393685(0x1cb)+_0xee00ec['command']+'\x20on\x20dataset\x20'+_0x596f83)['build']();}),_0x58aa94;}function a16_0x20db(){const _0x56d9f2=['\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{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','16sGNbyX','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20PARAMS\x20STRUCTURE','getOne','write','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','\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}}','dryRun','\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}}','9Ohxmnf','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','9768VyHzJJ','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\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','description','code','/api/{appCode}/','POST','\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}}','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','Preview:\x20data\x20','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','data','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','operation','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','\x20completed\x20in\x20','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20field\x20values\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','49511bGEsov','3007609GVgKGh','batchCreate','\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{\x22field\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','10dHgTVd','params','body','160iEdNwa','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','helpExtra','command','Get\x20a\x20single\x20record\x20by\x20ID','\x20\x20WHERE\x20OPERATORS','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','read','Filter\x20dataset\x20records\x20with\x20query\x20conditions','\x20\x20EXAMPLES','177549BKyTJE','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','\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}}','delete','paramsRequired','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Post-aggregation\x20filter,\x20e.g.\x20{\x22total\x22:{\x22$gt\x22:1000}}','join','2OvJttp','148639CmQPqu','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','65PaQuIj','\x20\x20LOGICAL\x20COMBINATORS','risk','update','\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\x20PAGINATION','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\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}]','high-risk-write','\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]}}','2245008hOgmZt','aggregate','paramsHint','330776tMqCpt','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','create','filter','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\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','data\x20','\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}}','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}}]}','\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}}'];a16_0x20db=function(){return _0x56d9f2;};return a16_0x20db();}export const dataDefinitions=specs['map'](makeDataCommand);
|
|
1
|
+
function a16_0x397a(_0x380659,_0x3932f8){_0x380659=_0x380659-0xde;const _0x40213a=a16_0x4021();let _0x397a86=_0x40213a[_0x380659];return _0x397a86;}const a16_0x360d1c=a16_0x397a;(function(_0x353a1c,_0x5b649d){const _0x1d191a=a16_0x397a,_0x52d4ba=_0x353a1c();while(!![]){try{const _0x4a64f7=parseInt(_0x1d191a(0xf9))/0x1*(-parseInt(_0x1d191a(0x10f))/0x2)+parseInt(_0x1d191a(0xff))/0x3*(-parseInt(_0x1d191a(0xe1))/0x4)+-parseInt(_0x1d191a(0x130))/0x5*(-parseInt(_0x1d191a(0x10a))/0x6)+parseInt(_0x1d191a(0xfd))/0x7+parseInt(_0x1d191a(0x108))/0x8+parseInt(_0x1d191a(0x11f))/0x9*(parseInt(_0x1d191a(0xf6))/0xa)+-parseInt(_0x1d191a(0xe4))/0xb*(-parseInt(_0x1d191a(0xe7))/0xc);if(_0x4a64f7===_0x5b649d)break;else _0x52d4ba['push'](_0x52d4ba['shift']());}catch(_0x2f42c0){_0x52d4ba['push'](_0x52d4ba['shift']());}}}(a16_0x4021,0x19c06));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';function a16_0x4021(){const _0x243703=['body','map','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','Get\x20a\x20single\x20record\x20by\x20ID','dryRun','370JUSEyc','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','2067gOkltq','delete','getOne','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','96397hNKZgt','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','1479dHQSrO','description','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','high-risk-write','filter','\x20\x20LOGICAL\x20COMBINATORS','\x20\x20PARAMS\x20STRUCTURE','paramsRequired','build','407600qAtZVg','\x20on\x20dataset\x20','2364euPXBf','command','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','str','batchCreate','110imgnmm','\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]','Update\x20an\x20existing\x20record','read','\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20field\x20values\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','update','data','\x20\x20WHERE\x20OPERATORS','\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{\x22field\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','\x20completed\x20in\x20','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','3339GPJfOF','\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}}','risk','paramsHint','write','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','\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}}','params','join','data\x20','\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}}','create','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Post-aggregation\x20filter,\x20e.g.\x20{\x22total\x22:{\x22$gt\x22:1000}}','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','2050OutDbH','now','\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\x20EXAMPLES','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','444PYgtvn','POST','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','186439Bsfjav','aggregate','\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{\x22field\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','24EaUOFF','Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\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','operation','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','code','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','Preview:\x20data\x20','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\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}]'];a16_0x4021=function(){return _0x243703;};return a16_0x4021();}import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a16_0x360d1c(0x103),'operation':a16_0x360d1c(0x103),'risk':a16_0x360d1c(0x112),'paramsRequired':![],'description':'Filter\x20dataset\x20records\x20with\x20query\x20conditions','paramsHint':a16_0x360d1c(0x126)+'Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','helpExtra':[a16_0x360d1c(0x116),a16_0x360d1c(0x127),'\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}}',a16_0x360d1c(0x12b),a16_0x360d1c(0x120),'\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}}',a16_0x360d1c(0x125),'\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]}}',a16_0x360d1c(0x124),'\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','',a16_0x360d1c(0x104),a16_0x360d1c(0xde),'\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}}]}','',a16_0x360d1c(0xfc),a16_0x360d1c(0xe0),'\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]',a16_0x360d1c(0xf0),'\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)',a16_0x360d1c(0x11b),'','\x20\x20PAGINATION',a16_0x360d1c(0xf7),a16_0x360d1c(0x11e),'\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)']['join']('\x0a')},{'command':a16_0x360d1c(0xfb),'operation':'getOne','risk':a16_0x360d1c(0x112),'paramsRequired':!![],'description':a16_0x360d1c(0xf4),'paramsHint':a16_0x360d1c(0xef)},{'command':a16_0x360d1c(0x12c),'operation':a16_0x360d1c(0x12c),'risk':a16_0x360d1c(0x123),'paramsRequired':!![],'description':a16_0x360d1c(0x12e),'paramsHint':a16_0x360d1c(0x12f)},{'command':a16_0x360d1c(0x10e),'operation':a16_0x360d1c(0x10e),'risk':a16_0x360d1c(0x123),'paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','paramsHint':a16_0x360d1c(0x101)},{'command':a16_0x360d1c(0x114),'operation':a16_0x360d1c(0x114),'risk':a16_0x360d1c(0x123),'paramsRequired':!![],'description':a16_0x360d1c(0x111),'paramsHint':a16_0x360d1c(0xf3)},{'command':a16_0x360d1c(0xfa),'operation':a16_0x360d1c(0xfa),'risk':a16_0x360d1c(0x102),'paramsRequired':!![],'description':a16_0x360d1c(0xfe),'paramsHint':a16_0x360d1c(0xef)},{'command':a16_0x360d1c(0xe5),'operation':a16_0x360d1c(0xe5),'risk':a16_0x360d1c(0x112),'paramsRequired':![],'description':a16_0x360d1c(0x11a),'paramsHint':a16_0x360d1c(0xeb)+a16_0x360d1c(0xe8),'helpExtra':['\x20\x20AGGREGATE\x20TYPES',a16_0x360d1c(0x113),a16_0x360d1c(0xe3),'\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\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{\x22field\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{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}',a16_0x360d1c(0xe6),a16_0x360d1c(0x117),'',a16_0x360d1c(0x105),a16_0x360d1c(0x110),a16_0x360d1c(0x118),a16_0x360d1c(0x10c),a16_0x360d1c(0xed),a16_0x360d1c(0x12d),a16_0x360d1c(0xf8),'',a16_0x360d1c(0xdf),'\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status',a16_0x360d1c(0x11d),'',a16_0x360d1c(0x119),a16_0x360d1c(0xe9)][a16_0x360d1c(0x129)]('\x0a')}];function makeDataCommand(_0x2eaf6d){const _0x312f2c=a16_0x360d1c,_0x4e5788='data\x20'+_0x2eaf6d[_0x312f2c(0x10b)],_0x4a2431={'service':_0x312f2c(0x115),'command':_0x2eaf6d[_0x312f2c(0x10b)],'description':_0x2eaf6d[_0x312f2c(0x100)],'risk':_0x2eaf6d[_0x312f2c(0x121)],'helpExtra':_0x2eaf6d['helpExtra'],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x2eaf6d[_0x312f2c(0x122)]}],'validate':async _0x1e0f97=>{const _0x316244=_0x312f2c;_0x2eaf6d[_0x316244(0x106)]&&requireAnyOf(_0x1e0f97,[_0x316244(0x128)],_0x4e5788),_0x2eaf6d[_0x316244(0xea)]==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x1e0f97['str'](_0x316244(0x128))));},async 'execute'(_0x139bae){const _0x34191f=_0x312f2c,_0x3cb7b0=_0x139bae[_0x34191f(0x10d)](_0x34191f(0xec)),_0x1a8763=_0x2eaf6d['operation']==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x139bae[_0x34191f(0x10d)](_0x34191f(0x128)))):parseJsonParams(_0x139bae[_0x34191f(0x10d)](_0x34191f(0x128)))??{},_0x53f32d=Date[_0x34191f(0x131)](),_0x3d0d98=await executeData(_0x3cb7b0,_0x2eaf6d['operation'],_0x1a8763),_0x5bc3d1=Date['now']()-_0x53f32d;return{'ok':!![],'data':{'result':_0x3d0d98,'elapsed':_0x5bc3d1},'message':_0x34191f(0x12a)+_0x2eaf6d['command']+_0x34191f(0x11c)+_0x5bc3d1+'ms'};}};return _0x2eaf6d[_0x312f2c(0x121)]!==_0x312f2c(0x112)&&(_0x4a2431[_0x312f2c(0xf5)]=async _0x2d2c51=>{const _0x71eee2=_0x312f2c,_0x3bf5e5=_0x2d2c51[_0x71eee2(0x10d)](_0x71eee2(0xec)),_0x114c0f=_0x2eaf6d[_0x71eee2(0xea)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x2d2c51[_0x71eee2(0x10d)](_0x71eee2(0x128)))):parseJsonParams(_0x2d2c51[_0x71eee2(0x10d)](_0x71eee2(0x128)))??{};return dryRun(_0x71eee2(0xe2),'/api/{appCode}/'+_0x3bf5e5+'/'+_0x2eaf6d[_0x71eee2(0xea)])[_0x71eee2(0xf1)](_0x114c0f)[_0x71eee2(0x100)](_0x71eee2(0xee)+_0x2eaf6d[_0x71eee2(0x10b)]+_0x71eee2(0x109)+_0x3bf5e5)[_0x71eee2(0x107)]();}),_0x4a2431;}export const dataDefinitions=specs[a16_0x360d1c(0xf2)](makeDataCommand);
|