@lovrabet/lovrabet-cli 2.3.1-beta.1 → 2.3.1-beta.3
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/README.md +53 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.d.ts +2 -0
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/init.d.ts +3 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/domain-config.d.ts +34 -2
- package/lib/config/domain-config.js +1 -1
- package/lib/config/schema.d.ts +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.d.ts +3 -6
- 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.d.ts +0 -51
- package/lib/constant/product.js +1 -1
- package/lib/constant/region.d.ts +3 -5
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.d.ts +16 -0
- 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/rate-limit.js +1 -1
- package/lib/framework/raw-flags.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/service-order.js +1 -1
- package/lib/framework/types.d.ts +0 -2
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.d.ts +59 -0
- package/lib/generated/official-routing.js +1 -0
- package/lib/generated/routing-contract.d.ts +9 -0
- package/lib/generated/routing-contract.js +1 -0
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/access-key-redaction.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +2 -1
- package/skills/lovrabet/SKILL.md +4 -4
- package/skills/lovrabet/guides/troubleshooting.md +3 -5
- package/skills/lovrabet/references/lovrabet-config-commands.md +35 -13
- package/skills/lovrabet/references/lovrabet-config.md +8 -21
- package/skills/lovrabet/references/lovrabet-doctor.md +0 -2
- package/skills/lovrabet/references/lovrabet-kb-workflow.md +1 -3
- package/skills/lovrabet.manifest.json +3 -3
- package/lib/core/kb-search-client.d.ts +0 -30
- package/lib/core/kb-search-client.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a11_0x1a8596=a11_0x209c;(function(_0x368215,_0x19d037){const _0x5424f8=a11_0x209c,_0x655ac5=_0x368215();while(!![]){try{const _0x1fadc6=-parseInt(_0x5424f8(0x104))/0x1*(-parseInt(_0x5424f8(0x110))/0x2)+parseInt(_0x5424f8(0xe1))/0x3*(-parseInt(_0x5424f8(0xd4))/0x4)+-parseInt(_0x5424f8(0xe6))/0x5+-parseInt(_0x5424f8(0xcc))/0x6+parseInt(_0x5424f8(0xf6))/0x7*(parseInt(_0x5424f8(0xde))/0x8)+parseInt(_0x5424f8(0xe3))/0x9*(-parseInt(_0x5424f8(0xd2))/0xa)+-parseInt(_0x5424f8(0xf3))/0xb*(-parseInt(_0x5424f8(0x102))/0xc);if(_0x1fadc6===_0x19d037)break;else _0x655ac5['push'](_0x655ac5['shift']());}catch(_0x115021){_0x655ac5['push'](_0x655ac5['shift']());}}}(a11_0x2a50,0xcee5b));import{existsSync,mkdirSync,readFileSync,unlinkSync,writeFileSync}from'node:fs';import{dirname}from'node:path';import{homedir}from'node:os';import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG}from'../../constant/product.js';import{getUserDomain}from'../../constant/domain.js';import{CliErrors}from'../../errors.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';function resolveAuthScopeFlags(_0x2079b7){const _0x5cce74=a11_0x209c;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x2079b7[_0x5cce74(0xfd)](_0x5cce74(0x100)),'explicitProject':_0x2079b7['bool']('project'),'policy':_0x5cce74(0xe2)}));}const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/,DEVICE_CODE_TTL_MS=0x927c0,POLL_INTERVAL_MS=0xbb8,MAX_POLLS=0xc8,MAX_CONSECUTIVE_NETWORK_ERRORS=0x5;export function generateDeviceCode(){return crypto['randomUUID']();}export function buildDeviceAuthUrl(_0x16c316,_0x5e31a6,_0x30d396=a11_0x1a8596(0xdf)){const _0x5830f4=a11_0x1a8596;return _0x16c316+_0x5830f4(0xd9)+encodeURIComponent(_0x5e31a6)+_0x5830f4(0xe0)+encodeURIComponent(_0x30d396);}export function getDeviceCodePath(){const _0xcba6a6=a11_0x1a8596;return homedir()+'/'+PRODUCT_CONFIG[_0xcba6a6(0xd0)]+_0xcba6a6(0x10a);}function a11_0x209c(_0x5877c4,_0x1e2634){_0x5877c4=_0x5877c4-0xc6;const _0x2a5017=a11_0x2a50();let _0x209c20=_0x2a5017[_0x5877c4];return _0x209c20;}export function readStoredDeviceCode(){const _0x3a3ca1=a11_0x1a8596,_0x1d022e=getDeviceCodePath();if(!existsSync(_0x1d022e))return null;try{const _0xa18361=readFileSync(_0x1d022e,{'encoding':_0x3a3ca1(0xfe)}),_0x3bd5df=JSON['parse'](_0xa18361);if(_0x3bd5df&&typeof _0x3bd5df[_0x3a3ca1(0xed)]==='string'&&typeof _0x3bd5df[_0x3a3ca1(0xc6)]==='string'&&(_0x3bd5df['scope']===_0x3a3ca1(0x100)||_0x3bd5df['scope']===_0x3a3ca1(0xdc)))return _0x3bd5df;}catch{}return null;}export function writeStoredDeviceCode(_0x5dbb23,_0x54f7c4){const _0x5ec8af=a11_0x1a8596,_0x2ae8f5=getDeviceCodePath(),_0x5a3824=dirname(_0x2ae8f5);!existsSync(_0x5a3824)&&mkdirSync(_0x5a3824,{'recursive':!![]});const _0x9762c2={'code':_0x5dbb23,'createdAt':new Date()[_0x5ec8af(0x113)](),'scope':_0x54f7c4};writeFileSync(_0x2ae8f5,JSON[_0x5ec8af(0xdd)](_0x9762c2),{'encoding':_0x5ec8af(0xfe),'mode':0x180});}export function deleteStoredDeviceCode(){const _0x4cae19=getDeviceCodePath();try{unlinkSync(_0x4cae19);}catch{}}export function isStoredDeviceCodeExpired(_0x39e1bf){const _0x2e874c=a11_0x1a8596;return Date[_0x2e874c(0x117)]()-new Date(_0x39e1bf[_0x2e874c(0xc6)])['getTime']()>DEVICE_CODE_TTL_MS;}function a11_0x2a50(){const _0x4a4403=['auth','access_key','abort','boolean','Device\x20authorization\x20URL\x20printed.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20re-run.','code','Waiting\x20for\x20authorization\x20(timeout:\x2010\x20minutes,\x20Ctrl+C\x20to\x20cancel)...','status','stderr','object','/api/device-auth/token','259391FbMuuS','The\x20device\x20code\x20is\x20valid\x20for\x2010\x20minutes.','networkError','34685sJagrc','application/json','Write\x20to\x20global\x20config\x20(default)','\x0dWaiting\x20for\x20authorization...\x20','test','Device\x20authorization\x20successful.','App\x20name\x20shown\x20on\x20authorization\x20page\x20(default:\x20lovrabet)','bool','utf8','aborted','global','signal','1884GHHmWs','success','3jLWTcD','\x20auth\x20device','),\x20retrying...','Open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20authorize:','SIGINT','Device\x20auth\x20API\x20unreachable\x20after\x20multiple\x20retries.','/.device-auth','nonInteractive','floor','device','\x20config.','Verify:\x20','214340dJnfKa','write','json','toISOString','Starts\x20the\x20device-code\x20login\x20flow.\x20On\x20success,\x20the\x20AccessKey\x20is\x20saved\x20to\x20the\x20selected\x20Lovrabet\x20config.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20the\x20device\x20code\x20or\x20secret.','Already\x20authorized.\x20Use\x20`lovrabet\x20auth\x20status`\x20to\x20verify.','string','now','createdAt','Print\x20URL\x20to\x20stdout\x20and\x20exit\x20(for\x20WorkBuddy\x20integration)','name','\x20auth\x20status','validation','AbortError','4853310vxPjpc','AccessKey\x20saved\x20to\x20','data','Device\x20authorization\x20cancelled.','homeDirName','apiError','52100szPiqP','cancelled','7772SDXlHq','source','removeListener','expired','log','/device-auth?code=','once','\x20remaining','project','stringify','1832iztKfe','lovrabet-cli','&source=','2349eOwhSk','global-default','2655mnaYEl','After\x20authorizing,\x20re-run:\x20','Authorize\x20with\x20the\x20device-code\x20flow\x20(complete\x20in\x20the\x20browser;\x20no\x20copy-paste\x20required)','2218835WoyieL','Invalid\x20access_key\x20returned\x20by\x20server.'];a11_0x2a50=function(){return _0x4a4403;};return a11_0x2a50();}export async function fetchDeviceToken(_0x833fb6,_0x206ba7){const _0x396e18=a11_0x1a8596,_0x50d087=_0x833fb6+_0x396e18(0xf2),_0x411bb0=new AbortController(),_0x42364d=setTimeout(()=>_0x411bb0[_0x396e18(0xea)](),0x2710),_0x4159cd=await fetch(_0x50d087,{'method':'POST','headers':{'Content-Type':_0x396e18(0xf7)},'body':JSON[_0x396e18(0xdd)]({'code':_0x206ba7}),'signal':_0x411bb0['signal']});clearTimeout(_0x42364d);if(!_0x4159cd['ok'])throw CliErrors['networkError']('Device\x20auth\x20API\x20returned\x20HTTP\x20'+_0x4159cd[_0x396e18(0xef)]);const _0x226870=await _0x4159cd[_0x396e18(0x112)](),_0x5ca9de=_0x226870[_0x396e18(0xce)]&&typeof _0x226870[_0x396e18(0xce)]===_0x396e18(0xf1)?_0x226870[_0x396e18(0xce)]:_0x226870;if(!_0x5ca9de||typeof _0x5ca9de[_0x396e18(0xef)]!==_0x396e18(0x116))throw CliErrors['apiError']('Invalid\x20device\x20auth\x20response');return{'status':_0x5ca9de[_0x396e18(0xef)],'access_key':typeof _0x5ca9de[_0x396e18(0xe9)]===_0x396e18(0x116)?_0x5ca9de['access_key']:undefined};}export async function pollDeviceToken(_0x12d5f8,_0x589fb8,_0x48e89b){const _0x3dd64c=a11_0x1a8596;let _0x497ee0=0x0;for(let _0x39fe41=0x0;_0x39fe41<MAX_POLLS;_0x39fe41++){if(_0x48e89b[_0x3dd64c(0xff)])throw CliErrors[_0x3dd64c(0xd3)](_0x3dd64c(0xcf));let _0x184417;try{_0x184417=await fetchDeviceToken(_0x12d5f8,_0x589fb8);}catch(_0xa5947d){if(_0xa5947d instanceof Error&&_0xa5947d[_0x3dd64c(0xc8)]===_0x3dd64c(0xcb))throw CliErrors['cancelled'](_0x3dd64c(0xcf));_0x497ee0++;if(_0x497ee0>=MAX_CONSECUTIVE_NETWORK_ERRORS)throw CliErrors[_0x3dd64c(0xf5)](_0x3dd64c(0x109));writeCliSideChannelLine('Device\x20auth\x20API\x20error\x20('+_0x497ee0+'/'+MAX_CONSECUTIVE_NETWORK_ERRORS+_0x3dd64c(0x106)),await sleep(POLL_INTERVAL_MS);continue;}_0x497ee0=0x0;if(_0x184417[_0x3dd64c(0xef)]===_0x3dd64c(0x103)){if(!_0x184417[_0x3dd64c(0xe9)])throw CliErrors[_0x3dd64c(0xd1)]('Invalid\x20access_key\x20returned\x20by\x20server.');return _0x184417['access_key'];}if(_0x184417[_0x3dd64c(0xef)]===_0x3dd64c(0xd7)){deleteStoredDeviceCode();throw CliErrors['validation']('Device\x20code\x20expired.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.');}const _0xa7b126=(_0x39fe41+0x1)*POLL_INTERVAL_MS,_0x2ad658=DEVICE_CODE_TTL_MS-_0xa7b126,_0x397c63=Math['floor'](_0x2ad658/0xea60),_0x4542ff=Math[_0x3dd64c(0x10c)](_0x2ad658%0xea60/0x3e8);process[_0x3dd64c(0xf0)][_0x3dd64c(0x111)](_0x3dd64c(0xf9)+_0x397c63+':'+String(_0x4542ff)['padStart'](0x2,'0')+_0x3dd64c(0xdb)),await sleep(POLL_INTERVAL_MS);}deleteStoredDeviceCode();throw CliErrors[_0x3dd64c(0xca)]('Device\x20authorization\x20timed\x20out\x20after\x2010\x20minutes.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.');}function sleep(_0x5629e7){return new Promise(_0x31c560=>setTimeout(_0x31c560,_0x5629e7));}export const authDeviceDefinition={'service':a11_0x1a8596(0xe8),'command':a11_0x1a8596(0x10d),'description':a11_0x1a8596(0xe5),'risk':'write','confirmationDescription':a11_0x1a8596(0x114),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a11_0x1a8596(0x100),'type':a11_0x1a8596(0xeb),'description':a11_0x1a8596(0xf8),'default':!![]},{'name':'project','type':a11_0x1a8596(0xeb),'description':'Write\x20to\x20project\x20config','default':![]},{'name':a11_0x1a8596(0xd5),'type':a11_0x1a8596(0x116),'description':a11_0x1a8596(0xfc),'default':a11_0x1a8596(0xdf)},{'name':'url-only','type':a11_0x1a8596(0xeb),'description':a11_0x1a8596(0xc7),'default':![]}],async 'execute'(_0x321156){const _0x46b29b=a11_0x1a8596,_0x2522b2=resolveAuthScopeFlags(_0x321156),_0x11eb80=_0x2522b2[_0x46b29b(0x100)]?_0x46b29b(0x100):'project',_0x10a7f1=readScopedConfig(_0x2522b2);if(_0x10a7f1['accessKey'])return{'ok':!![],'message':_0x46b29b(0x115)};const _0x29ad37=(_0x321156['str'](_0x46b29b(0xd5))||_0x46b29b(0xdf))['trim'](),_0x4ba0d5=getUserDomain(),_0x3b67b7=readStoredDeviceCode(),_0x309521=_0x3b67b7&&!isStoredDeviceCodeExpired(_0x3b67b7)?_0x3b67b7['code']:((()=>{const _0x56a1c1=generateDeviceCode();return writeStoredDeviceCode(_0x56a1c1,_0x11eb80),_0x56a1c1;})()),_0xf73ed2=buildDeviceAuthUrl(_0x4ba0d5,_0x309521,_0x29ad37);if(_0x321156[_0x46b29b(0xfd)]('url-only'))return console[_0x46b29b(0xd8)](_0xf73ed2),{'ok':!![]};writeCliSideChannelLine(_0x46b29b(0x107)),writeCliSideChannelLine(''),writeCliSideChannelLine(_0xf73ed2),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x46b29b(0xf4));if(_0x321156[_0x46b29b(0x10b)])return writeCliSideChannelLine(_0x46b29b(0xe4)+CLI_BIN_NAME+_0x46b29b(0x105)),{'ok':!![],'message':_0x46b29b(0xec)};writeCliSideChannelLine(_0x46b29b(0xee));const _0x13ccbb=new AbortController(),_0x2da7d1=()=>{const _0x5df8a6=_0x46b29b;_0x13ccbb[_0x5df8a6(0xea)](),process[_0x5df8a6(0xd6)](_0x5df8a6(0x108),_0x2da7d1);};process[_0x46b29b(0xda)]('SIGINT',_0x2da7d1);let _0x26d1c2;try{_0x26d1c2=await pollDeviceToken(_0x4ba0d5,_0x309521,_0x13ccbb[_0x46b29b(0x101)]);}finally{process[_0x46b29b(0xd6)](_0x46b29b(0x108),_0x2da7d1);}if(!ACCESS_KEY_PATTERN[_0x46b29b(0xfa)](_0x26d1c2))throw CliErrors[_0x46b29b(0xd1)](_0x46b29b(0xe7));const _0x222572=readScopedConfig(_0x2522b2);return _0x222572['accessKey']=_0x26d1c2,writeScopedConfig(_0x222572,_0x2522b2),deleteStoredDeviceCode(),process[_0x46b29b(0xf0)][_0x46b29b(0x111)]('\x0a'),writeCliSideChannelLine(_0x46b29b(0xcd)+_0x11eb80+_0x46b29b(0x10e)),writeCliSideChannelLine(_0x46b29b(0x10f)+CLI_BIN_NAME+_0x46b29b(0xc9)),{'ok':!![],'message':_0x46b29b(0xfb)};}};
|
|
1
|
+
const a11_0x706c26=a11_0x4ab3;(function(_0x30d8cb,_0x4a1b1f){const _0x25089a=a11_0x4ab3,_0x3a4925=_0x30d8cb();while(!![]){try{const _0x234773=parseInt(_0x25089a(0xd8))/0x1+-parseInt(_0x25089a(0xcd))/0x2+-parseInt(_0x25089a(0xb6))/0x3*(parseInt(_0x25089a(0xb3))/0x4)+-parseInt(_0x25089a(0xad))/0x5+-parseInt(_0x25089a(0xb8))/0x6*(-parseInt(_0x25089a(0xca))/0x7)+parseInt(_0x25089a(0xee))/0x8+parseInt(_0x25089a(0xaf))/0x9;if(_0x234773===_0x4a1b1f)break;else _0x3a4925['push'](_0x3a4925['shift']());}catch(_0x40338b){_0x3a4925['push'](_0x3a4925['shift']());}}}(a11_0xe5a6,0x7b56a));import{existsSync,mkdirSync,readFileSync,unlinkSync,writeFileSync}from'node:fs';import{dirname}from'node:path';import{homedir}from'node:os';import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG}from'../../constant/product.js';import{getUserDomain}from'../../constant/domain.js';import{CliErrors}from'../../errors.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';function resolveAuthScopeFlags(_0x564dbb){const _0x24f00b=a11_0x4ab3;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x564dbb[_0x24f00b(0xc5)](_0x24f00b(0xdd)),'explicitProject':_0x564dbb[_0x24f00b(0xc5)]('project'),'policy':_0x24f00b(0xd1)}));}const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/,DEVICE_CODE_TTL_MS=0x927c0,POLL_INTERVAL_MS=0xbb8,MAX_POLLS=0xc8,MAX_CONSECUTIVE_NETWORK_ERRORS=0x5;function a11_0x4ab3(_0x3a1b9e,_0x392570){_0x3a1b9e=_0x3a1b9e-0xa4;const _0xe5a6bc=a11_0xe5a6();let _0x4ab34e=_0xe5a6bc[_0x3a1b9e];return _0x4ab34e;}export function generateDeviceCode(){return crypto['randomUUID']();}function a11_0xe5a6(){const _0x147a45=['padStart','Open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20authorize:','auth','App\x20name\x20shown\x20on\x20authorization\x20page\x20(default:\x20lovrabet)','toISOString','device','str','bool','\x20remaining','Waiting\x20for\x20authorization\x20(timeout:\x2010\x20minutes,\x20Ctrl+C\x20to\x20cancel)...','/api/device-auth/token','Write\x20to\x20project\x20config','7LzJLkw','stderr','&source=','928858CDcnkG','Device\x20authorization\x20cancelled.','test','Device\x20authorization\x20timed\x20out\x20after\x2010\x20minutes.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','global-default','utf8','string','Device\x20code\x20expired.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','source','Invalid\x20access_key\x20returned\x20by\x20server.','application/json','919216ydknTd','removeListener','validation','Write\x20to\x20global\x20config\x20(default)','Already\x20authorized.\x20Use\x20`lovrabet\x20auth\x20status`\x20to\x20verify.','global','signal','abort','boolean','/.device-auth','),\x20retrying...','log','accessKey','Device\x20authorization\x20URL\x20printed.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20re-run.','\x20auth\x20device','json','Device\x20auth\x20API\x20returned\x20HTTP\x20','name','createdAt','\x20config.','SIGINT','stringify','2070008NpaxpP','lovrabet-cli','write','parse','POST','object','apiError','access_key','getTime','After\x20authorizing,\x20re-run:\x20','3924395iMzPdg','Print\x20URL\x20to\x20stdout\x20and\x20exit\x20(for\x20WorkBuddy\x20integration)','8080668LUIKJd','/device-auth?code=','cancelled','data','3464PzcuGv','floor','Verify:\x20','1317hRnCRt','project','353142ozOEvW','Starts\x20the\x20device-code\x20login\x20flow.\x20On\x20success,\x20the\x20AccessKey\x20is\x20saved\x20to\x20the\x20selected\x20Lovrabet\x20config.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20the\x20device\x20code\x20or\x20secret.','networkError','scope','status','expired'];a11_0xe5a6=function(){return _0x147a45;};return a11_0xe5a6();}export function buildDeviceAuthUrl(_0x1c2a98,_0x1984a4,_0x27f632=a11_0x706c26(0xa4)){const _0x4e2570=a11_0x706c26;return _0x1c2a98+_0x4e2570(0xb0)+encodeURIComponent(_0x1984a4)+_0x4e2570(0xcc)+encodeURIComponent(_0x27f632);}export function getDeviceCodePath(){const _0x5abb62=a11_0x706c26;return homedir()+'/'+PRODUCT_CONFIG['homeDirName']+_0x5abb62(0xe1);}export function readStoredDeviceCode(){const _0x20b3d6=a11_0x706c26,_0x2ff823=getDeviceCodePath();if(!existsSync(_0x2ff823))return null;try{const _0x1b0ee5=readFileSync(_0x2ff823,{'encoding':_0x20b3d6(0xd2)}),_0x58a708=JSON[_0x20b3d6(0xa6)](_0x1b0ee5);if(_0x58a708&&typeof _0x58a708['code']===_0x20b3d6(0xd3)&&typeof _0x58a708[_0x20b3d6(0xea)]==='string'&&(_0x58a708['scope']===_0x20b3d6(0xdd)||_0x58a708[_0x20b3d6(0xbb)]===_0x20b3d6(0xb7)))return _0x58a708;}catch{}return null;}export function writeStoredDeviceCode(_0x36b004,_0x4d4f78){const _0x4849b1=a11_0x706c26,_0x38ac9d=getDeviceCodePath(),_0x1edf34=dirname(_0x38ac9d);!existsSync(_0x1edf34)&&mkdirSync(_0x1edf34,{'recursive':!![]});const _0x580c1d={'code':_0x36b004,'createdAt':new Date()[_0x4849b1(0xc2)](),'scope':_0x4d4f78};writeFileSync(_0x38ac9d,JSON[_0x4849b1(0xed)](_0x580c1d),{'encoding':_0x4849b1(0xd2),'mode':0x180});}export function deleteStoredDeviceCode(){const _0x4c7851=getDeviceCodePath();try{unlinkSync(_0x4c7851);}catch{}}export function isStoredDeviceCodeExpired(_0x1092d4){const _0x393202=a11_0x706c26;return Date['now']()-new Date(_0x1092d4['createdAt'])[_0x393202(0xab)]()>DEVICE_CODE_TTL_MS;}export async function fetchDeviceToken(_0x465751,_0x5e0c5b){const _0x3a4889=a11_0x706c26,_0x1b9099=_0x465751+_0x3a4889(0xc8),_0x269501=new AbortController(),_0x459636=setTimeout(()=>_0x269501[_0x3a4889(0xdf)](),0x2710),_0x1a7307=await fetch(_0x1b9099,{'method':_0x3a4889(0xa7),'headers':{'Content-Type':_0x3a4889(0xd7)},'body':JSON[_0x3a4889(0xed)]({'code':_0x5e0c5b}),'signal':_0x269501[_0x3a4889(0xde)]});clearTimeout(_0x459636);if(!_0x1a7307['ok'])throw CliErrors[_0x3a4889(0xba)](_0x3a4889(0xe8)+_0x1a7307[_0x3a4889(0xbc)]);const _0x2d3d11=await _0x1a7307[_0x3a4889(0xe7)](),_0x42ffa8=_0x2d3d11['data']&&typeof _0x2d3d11[_0x3a4889(0xb2)]===_0x3a4889(0xa8)?_0x2d3d11[_0x3a4889(0xb2)]:_0x2d3d11;if(!_0x42ffa8||typeof _0x42ffa8['status']!==_0x3a4889(0xd3))throw CliErrors['apiError']('Invalid\x20device\x20auth\x20response');return{'status':_0x42ffa8[_0x3a4889(0xbc)],'access_key':typeof _0x42ffa8[_0x3a4889(0xaa)]==='string'?_0x42ffa8[_0x3a4889(0xaa)]:undefined};}export async function pollDeviceToken(_0x277854,_0x56a1d4,_0x337f0d){const _0x5192e4=a11_0x706c26;let _0x5579bb=0x0;for(let _0x403424=0x0;_0x403424<MAX_POLLS;_0x403424++){if(_0x337f0d['aborted'])throw CliErrors[_0x5192e4(0xb1)]('Device\x20authorization\x20cancelled.');let _0x40a3a8;try{_0x40a3a8=await fetchDeviceToken(_0x277854,_0x56a1d4);}catch(_0x103395){if(_0x103395 instanceof Error&&_0x103395[_0x5192e4(0xe9)]==='AbortError')throw CliErrors[_0x5192e4(0xb1)](_0x5192e4(0xce));_0x5579bb++;if(_0x5579bb>=MAX_CONSECUTIVE_NETWORK_ERRORS)throw CliErrors[_0x5192e4(0xba)]('Device\x20auth\x20API\x20unreachable\x20after\x20multiple\x20retries.');writeCliSideChannelLine('Device\x20auth\x20API\x20error\x20('+_0x5579bb+'/'+MAX_CONSECUTIVE_NETWORK_ERRORS+_0x5192e4(0xe2)),await sleep(POLL_INTERVAL_MS);continue;}_0x5579bb=0x0;if(_0x40a3a8['status']==='success'){if(!_0x40a3a8['access_key'])throw CliErrors[_0x5192e4(0xa9)](_0x5192e4(0xd6));return _0x40a3a8[_0x5192e4(0xaa)];}if(_0x40a3a8['status']===_0x5192e4(0xbd)){deleteStoredDeviceCode();throw CliErrors['validation'](_0x5192e4(0xd4));}const _0x4f0b88=(_0x403424+0x1)*POLL_INTERVAL_MS,_0x2db84c=DEVICE_CODE_TTL_MS-_0x4f0b88,_0x4b7e3a=Math[_0x5192e4(0xb4)](_0x2db84c/0xea60),_0x2727c4=Math['floor'](_0x2db84c%0xea60/0x3e8);process['stderr']['write']('\x0dWaiting\x20for\x20authorization...\x20'+_0x4b7e3a+':'+String(_0x2727c4)[_0x5192e4(0xbe)](0x2,'0')+_0x5192e4(0xc6)),await sleep(POLL_INTERVAL_MS);}deleteStoredDeviceCode();throw CliErrors[_0x5192e4(0xda)](_0x5192e4(0xd0));}function sleep(_0x3e5e24){return new Promise(_0x2671a7=>setTimeout(_0x2671a7,_0x3e5e24));}export const authDeviceDefinition={'service':a11_0x706c26(0xc0),'command':a11_0x706c26(0xc3),'description':'Authorize\x20with\x20the\x20device-code\x20flow\x20(complete\x20in\x20the\x20browser;\x20no\x20copy-paste\x20required)','risk':a11_0x706c26(0xa5),'confirmationDescription':a11_0x706c26(0xb9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a11_0x706c26(0xdd),'type':a11_0x706c26(0xe0),'description':a11_0x706c26(0xdb),'default':!![]},{'name':a11_0x706c26(0xb7),'type':a11_0x706c26(0xe0),'description':a11_0x706c26(0xc9),'default':![]},{'name':a11_0x706c26(0xd5),'type':'string','description':a11_0x706c26(0xc1),'default':a11_0x706c26(0xa4)},{'name':'url-only','type':a11_0x706c26(0xe0),'description':a11_0x706c26(0xae),'default':![]}],async 'execute'(_0x2c4525){const _0x2b3616=a11_0x706c26,_0x4be90d=resolveAuthScopeFlags(_0x2c4525),_0x4147d5=_0x4be90d[_0x2b3616(0xdd)]?_0x2b3616(0xdd):_0x2b3616(0xb7),_0x54bc28=readScopedConfig(_0x4be90d);if(_0x54bc28[_0x2b3616(0xe4)])return{'ok':!![],'message':_0x2b3616(0xdc)};const _0x4fef75=(_0x2c4525[_0x2b3616(0xc4)](_0x2b3616(0xd5))||_0x2b3616(0xa4))['trim'](),_0x552043=getUserDomain(),_0x29302b=readStoredDeviceCode(),_0xe45a6d=_0x29302b&&!isStoredDeviceCodeExpired(_0x29302b)?_0x29302b['code']:((()=>{const _0x1280ec=generateDeviceCode();return writeStoredDeviceCode(_0x1280ec,_0x4147d5),_0x1280ec;})()),_0x3a183d=buildDeviceAuthUrl(_0x552043,_0xe45a6d,_0x4fef75);if(_0x2c4525[_0x2b3616(0xc5)]('url-only'))return console[_0x2b3616(0xe3)](_0x3a183d),{'ok':!![]};writeCliSideChannelLine(_0x2b3616(0xbf)),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x3a183d),writeCliSideChannelLine(''),writeCliSideChannelLine('The\x20device\x20code\x20is\x20valid\x20for\x2010\x20minutes.');if(_0x2c4525['nonInteractive'])return writeCliSideChannelLine(_0x2b3616(0xac)+CLI_BIN_NAME+_0x2b3616(0xe6)),{'ok':!![],'message':_0x2b3616(0xe5)};writeCliSideChannelLine(_0x2b3616(0xc7));const _0x41a527=new AbortController(),_0x5109a1=()=>{const _0x3de7b2=_0x2b3616;_0x41a527[_0x3de7b2(0xdf)](),process[_0x3de7b2(0xd9)](_0x3de7b2(0xec),_0x5109a1);};process['once'](_0x2b3616(0xec),_0x5109a1);let _0x4e353d;try{_0x4e353d=await pollDeviceToken(_0x552043,_0xe45a6d,_0x41a527[_0x2b3616(0xde)]);}finally{process[_0x2b3616(0xd9)](_0x2b3616(0xec),_0x5109a1);}if(!ACCESS_KEY_PATTERN[_0x2b3616(0xcf)](_0x4e353d))throw CliErrors[_0x2b3616(0xa9)](_0x2b3616(0xd6));const _0x43d463=readScopedConfig(_0x4be90d);return _0x43d463[_0x2b3616(0xe4)]=_0x4e353d,writeScopedConfig(_0x43d463,_0x4be90d),deleteStoredDeviceCode(),process[_0x2b3616(0xcb)][_0x2b3616(0xa5)]('\x0a'),writeCliSideChannelLine('AccessKey\x20saved\x20to\x20'+_0x4147d5+_0x2b3616(0xeb)),writeCliSideChannelLine(_0x2b3616(0xb5)+CLI_BIN_NAME+'\x20auth\x20status'),{'ok':!![],'message':'Device\x20authorization\x20successful.'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a12_0x24fcf3=a12_0x49db;(function(_0x5ddfd7,_0x4b80ef){const _0x5479eb=a12_0x49db,_0x1a7825=_0x5ddfd7();while(!![]){try{const _0x2b9227=parseInt(_0x5479eb(0x192))/0x1+parseInt(_0x5479eb(0x185))/0x2+parseInt(_0x5479eb(0x168))/0x3+-parseInt(_0x5479eb(0x189))/0x4*(parseInt(_0x5479eb(0x17b))/0x5)+parseInt(_0x5479eb(0x18c))/0x6*(-parseInt(_0x5479eb(0x175))/0x7)+parseInt(_0x5479eb(0x18b))/0x8+parseInt(_0x5479eb(0x176))/0x9;if(_0x2b9227===_0x4b80ef)break;else _0x1a7825['push'](_0x1a7825['shift']());}catch(_0xac79a6){_0x1a7825['push'](_0x1a7825['shift']());}}}(a12_0x1e49,0x995e0));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';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{getLoginUserInfo}from'../../core/api-client.js';import{getUserDomain}from'../../constant/domain.js';import{authDeviceDefinition,readStoredDeviceCode,deleteStoredDeviceCode,fetchDeviceToken,isStoredDeviceCodeExpired}from'../../commands/auth/device.js';import{maskCliAccessKey}from'../../utils/access-key-redaction.js';const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/;function showAccessKeyCreateHint(_0x145081=USER_ACCESS_KEY_CREATE_URL){const _0x45f54c=a12_0x49db;writeCliSideChannelLine(_0x45f54c(0x17c)+PRODUCT_CONFIG[_0x45f54c(0x19e)]+':'),writeCliSideChannelLine('\x0a'+_0x145081+'\x0a'),writeCliSideChannelLine(_0x45f54c(0x196)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>');}function a12_0x49db(_0x2b35c1,_0x4b76f3){_0x2b35c1=_0x2b35c1-0x15f;const _0x1e49b2=a12_0x1e49();let _0x49db48=_0x1e49b2[_0x2b35c1];return _0x49db48;}function buildAccessKeySetupGuide(_0x1eb6c1=USER_ACCESS_KEY_CREATE_URL){const _0x287d30=a12_0x49db;return['AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20'+PRODUCT_CONFIG[_0x287d30(0x19e)]+':',_0x1eb6c1,'Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20'+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]'][_0x287d30(0x16f)]('\x0a');}function a12_0x1e49(){const _0x313867=['env','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars','AccessKey\x20saved\x20to\x20','daily','\x20auth\x20status','project\x20config','join','access-key','string','Invalid\x20accessKey\x20format.','global-default','Save\x20the\x20AccessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20the\x20project\x20file)','7LXMvuY','3522141SiuJdB','AccessKey\x20cleared\x20from\x20','Auth\x20mode:\x20','boolean','validation','10VuLBRI','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','auth','Write\x20to\x20global\x20config\x20(default)','push','Clear\x20from\x20global\x20config\x20(default)','\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`','\x20config.\x20Nothing\x20to\x20clear.','Clear\x20the\x20AccessKey\x20from\x20config','\x20env\x20var','1115878TVhqmx','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','No\x20AccessKey\x20found\x20in\x20','development','1606684gPXbXe','stdin','3599168hSwisM','4162542WLxJbY','global','scope','\x20doctor','login','\x20Verify:\x20','59447pECHsl','\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.','\x20config.','Status:\x20valid','Tip:\x20you\x20can\x20also\x20run:','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','logout','Option\x20A:\x20','str','ClientAk','Missing\x20accessKey.','trim','userCenterDisplayName','production','access_key','status','yes','stdout','If\x20command\x20execution\x20still\x20fails,\x20run:\x20','ACCESS_KEY','authRequired','\x20(via\x20','newConfigFileName','nonInteractive','expired','Show\x20current\x20authentication\x20status','check','code','read','Device\x20authorization\x20pending.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20try\x20again.','test','\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]','accessKeyCreatePath','Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','Removes\x20the\x20AccessKey\x20from\x20the\x20selected\x20Lovrabet\x20config.\x20Commands\x20that\x20need\x20that\x20key\x20will\x20require\x20login\x20again.','isTTY','AccessKey:\x20','global\x20config','bool','write','info','accessKey','Saves\x20a\x20new\x20AccessKey\x20to\x20the\x20selected\x20Lovrabet\x20config.\x20An\x20existing\x20key\x20in\x20that\x20scope\x20is\x20overwritten.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20the\x20secret.','project','\x20\x20export\x20','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','=ak_xxx','Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','1999980AsCKjp'];a12_0x1e49=function(){return _0x313867;};return a12_0x1e49();}function canPromptForAccessKey(_0x4c727b){const _0xc24dec=a12_0x49db;return!_0x4c727b[_0xc24dec(0x1a9)]&&process[_0xc24dec(0x18a)][_0xc24dec(0x1b5)]!==![]&&process[_0xc24dec(0x1a3)][_0xc24dec(0x1b5)]!==![];}function resolveAuthScopeFlags(_0x344264){const _0x7b8850=a12_0x49db;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x344264[_0x7b8850(0x1b8)](_0x7b8850(0x18d)),'explicitProject':_0x344264[_0x7b8850(0x1b8)](_0x7b8850(0x163)),'policy':_0x7b8850(0x173)}));}async function resolveAuthWriteInput(_0x440211){const _0x3b0e31=a12_0x49db;let _0x5ef22a=(_0x440211[_0x3b0e31(0x19a)](_0x3b0e31(0x170))||_0x440211['str']('ak')||'')[_0x3b0e31(0x19d)]();const _0x1d330d=(_0x440211[_0x3b0e31(0x19a)]('env')||'')[_0x3b0e31(0x19d)](),_0x59c2fd=''+getUserDomain()+PRODUCT_CONFIG[_0x3b0e31(0x1b2)];if(!_0x5ef22a&&canPromptForAccessKey(_0x440211))try{showAccessKeyCreateHint(_0x59c2fd),_0x5ef22a=await promptAccessKey('');}catch(_0x365ba3){if(isAbortPrompt(_0x365ba3))throw CliErrors['cancelled']();throw _0x365ba3;}if(!_0x5ef22a)throw CliErrors[_0x3b0e31(0x17a)](_0x3b0e31(0x19c),buildAccessKeySetupGuide(_0x59c2fd));if(!ACCESS_KEY_PATTERN[_0x3b0e31(0x1b0)](_0x5ef22a))throw CliErrors[_0x3b0e31(0x17a)](_0x3b0e31(0x172),_0x3b0e31(0x16a));if(!_0x1d330d)return{'accessKey':_0x5ef22a};const _0x1d8d6e=normalizeEnv(_0x1d330d);return{'accessKey':_0x5ef22a,'env':isDaily(_0x1d8d6e)?_0x3b0e31(0x16c):isDev(_0x1d8d6e)?_0x3b0e31(0x188):_0x3b0e31(0x19f)};}export const authDefinitions=[{'service':a12_0x24fcf3(0x17d),'command':a12_0x24fcf3(0x190),'description':a12_0x24fcf3(0x174),'risk':'write','confirmationDescription':a12_0x24fcf3(0x162),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'access-key','type':a12_0x24fcf3(0x171),'description':'AccessKey\x20(ak_xxx...)'},{'name':'ak','type':a12_0x24fcf3(0x171),'description':'Shorthand\x20for\x20--access-key'},{'name':a12_0x24fcf3(0x18d),'type':a12_0x24fcf3(0x179),'description':a12_0x24fcf3(0x17e),'default':!![]},{'name':'project','type':a12_0x24fcf3(0x179),'description':a12_0x24fcf3(0x186),'default':![]}],async 'execute'(_0x4fcab0){const _0x5a753e=a12_0x24fcf3;if(_0x4fcab0[_0x5a753e(0x1b8)](_0x5a753e(0x1a2)))throw CliErrors['validation']('`auth\x20login`\x20does\x20not\x20support\x20--yes.','Use\x20`'+CLI_BIN_NAME+_0x5a753e(0x181)+CLI_BIN_NAME+_0x5a753e(0x193));const _0x3898b8=(_0x4fcab0[_0x5a753e(0x19a)](_0x5a753e(0x170))||_0x4fcab0['str']('ak')||'')[_0x5a753e(0x19d)]();if(!_0x3898b8&&_0x4fcab0[_0x5a753e(0x1a9)])return{'ok':!![],'message':buildAccessKeySetupGuide(''+getUserDomain()+PRODUCT_CONFIG['accessKeyCreatePath'])};const _0x2a6b84=await resolveAuthWriteInput(_0x4fcab0),_0x2feac8=resolveAuthScopeFlags(_0x4fcab0),_0x4acc2d=readScopedConfig(_0x2feac8);_0x4acc2d[_0x5a753e(0x161)]=_0x2a6b84[_0x5a753e(0x161)];_0x2a6b84['env']&&(_0x4acc2d[_0x5a753e(0x169)]=_0x2a6b84['env']);writeScopedConfig(_0x4acc2d,_0x2feac8);const _0x63d9cb=_0x2feac8[_0x5a753e(0x18d)]?_0x5a753e(0x18d):'project',_0x28aa1a=_0x4acc2d[_0x5a753e(0x169)]?'\x20Current\x20env:\x20'+_0x4acc2d[_0x5a753e(0x169)]+'.':'';return{'ok':!![],'message':_0x5a753e(0x16b)+_0x63d9cb+_0x5a753e(0x194)+_0x28aa1a+_0x5a753e(0x191)+CLI_BIN_NAME+'\x20auth\x20status'};}},{'service':a12_0x24fcf3(0x17d),'command':a12_0x24fcf3(0x198),'description':a12_0x24fcf3(0x183),'risk':a12_0x24fcf3(0x15f),'confirmationDescription':a12_0x24fcf3(0x1b4),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'global','type':a12_0x24fcf3(0x179),'description':a12_0x24fcf3(0x180),'default':!![]},{'name':a12_0x24fcf3(0x163),'type':a12_0x24fcf3(0x179),'description':'Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]}],async 'execute'(_0x2cf975){const _0x17331b=a12_0x24fcf3,_0x420090=resolveAuthScopeFlags(_0x2cf975),_0x1ea645=readScopedConfig(_0x420090),_0x5c1b3e=!!_0x1ea645[_0x17331b(0x161)];delete _0x1ea645[_0x17331b(0x161)],writeScopedConfig(_0x1ea645,_0x420090);const _0x43cb22=_0x420090[_0x17331b(0x18d)]?_0x17331b(0x18d):_0x17331b(0x163);if(_0x5c1b3e)return{'ok':!![],'message':_0x17331b(0x177)+_0x43cb22+_0x17331b(0x194)};return{'ok':!![],'message':_0x17331b(0x187)+_0x43cb22+_0x17331b(0x182)};}},{'service':'auth','command':a12_0x24fcf3(0x1a1),'description':a12_0x24fcf3(0x1ab),'risk':a12_0x24fcf3(0x1ae),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x24fcf3(0x18d),'type':a12_0x24fcf3(0x179),'description':'Read\x20from\x20global\x20config\x20(default)','default':!![]},{'name':a12_0x24fcf3(0x163),'type':a12_0x24fcf3(0x179),'description':a12_0x24fcf3(0x167),'default':![]},{'name':a12_0x24fcf3(0x1ac),'type':a12_0x24fcf3(0x179),'description':'Exit\x20non-zero\x20when\x20no\x20AccessKey\x20is\x20configured','default':![]}],async 'execute'(_0x2e60ac){const _0x412391=a12_0x24fcf3,_0x250bed=resolveAuthScopeFlags(_0x2e60ac),_0x345313=readScopedConfig(_0x250bed),_0x5795a6=productEnvName(_0x412391(0x1a5)),_0x58fa71=productEnv(_0x412391(0x1a5))||undefined,_0x2341f4=_0x345313[_0x412391(0x161)]||undefined,_0x8b1352=_0x58fa71||_0x2341f4,_0x5b0cfb=_0x58fa71?_0x5795a6+_0x412391(0x184):_0x2341f4?(_0x250bed['global']?'global':_0x412391(0x163))+'\x20config':null,_0x3d68c9=[_0x412391(0x178)+AUTH_MODE['ClientAk']];if(_0x8b1352){const _0x33f572=maskCliAccessKey(_0x8b1352);_0x3d68c9[_0x412391(0x17f)](_0x412391(0x1b6)+_0x33f572+(_0x5b0cfb?_0x412391(0x1a7)+_0x5b0cfb+')':'')),_0x3d68c9['push'](_0x412391(0x195));}if(!_0x8b1352){_0x3d68c9[_0x412391(0x17f)](''),_0x3d68c9[_0x412391(0x17f)](_0x412391(0x197)),_0x3d68c9[_0x412391(0x17f)](''),_0x3d68c9[_0x412391(0x17f)](_0x412391(0x199)+CLI_BIN_NAME+_0x412391(0x1b1)),_0x3d68c9[_0x412391(0x17f)](''),_0x3d68c9[_0x412391(0x17f)]('Option\x20B:\x20apps\x20config\x20('+PRODUCT_CONFIG[_0x412391(0x1a8)]+')'),_0x3d68c9['push'](_0x412391(0x165)),_0x3d68c9['push'](''),_0x3d68c9[_0x412391(0x17f)]('Option\x20C:\x20environment\x20variable'),_0x3d68c9[_0x412391(0x17f)](_0x412391(0x164)+_0x5795a6+_0x412391(0x166)),_0x3d68c9[_0x412391(0x17f)](''),_0x3d68c9['push']('Then\x20verify\x20with:\x20'+CLI_BIN_NAME+_0x412391(0x16d)),_0x3d68c9[_0x412391(0x17f)](_0x412391(0x1a4)+CLI_BIN_NAME+_0x412391(0x18f));if(_0x2e60ac['bool'](_0x412391(0x1ac))){const _0x55c458=readStoredDeviceCode();if(_0x55c458&&!isStoredDeviceCodeExpired(_0x55c458)){const _0x1c7102=getUserDomain(),_0x4757e0=await fetchDeviceToken(_0x1c7102,_0x55c458[_0x412391(0x1ad)]);if(_0x4757e0[_0x412391(0x1a1)]==='success'&&_0x4757e0[_0x412391(0x1a0)]){const _0x4fe61f={'global':_0x55c458[_0x412391(0x18e)]===_0x412391(0x18d)},_0x48847f=readScopedConfig(_0x4fe61f);_0x48847f['accessKey']=_0x4757e0['access_key'],writeScopedConfig(_0x48847f,_0x4fe61f),deleteStoredDeviceCode();const _0x208230=_0x4757e0[_0x412391(0x1a0)],_0x1a42ba=maskCliAccessKey(_0x208230),_0x3bdacd=_0x55c458[_0x412391(0x18e)]===_0x412391(0x18d)?_0x412391(0x1b7):_0x412391(0x16e);return{'ok':!![],'message':['Auth\x20mode:\x20'+AUTH_MODE[_0x412391(0x19b)],'AccessKey:\x20'+_0x1a42ba+_0x412391(0x1a7)+_0x3bdacd+')',_0x412391(0x195)][_0x412391(0x16f)]('\x0a')};}_0x4757e0[_0x412391(0x1a1)]===_0x412391(0x1aa)&&deleteStoredDeviceCode();throw CliErrors['authRequired'](_0x412391(0x1af));}throw CliErrors[_0x412391(0x1a6)](_0x3d68c9[_0x412391(0x16f)]('\x0a'));}}return{'ok':!![],'message':_0x3d68c9[_0x412391(0x16f)]('\x0a')};}},{'service':a12_0x24fcf3(0x17d),'command':a12_0x24fcf3(0x160),'description':a12_0x24fcf3(0x1b3),'risk':a12_0x24fcf3(0x1ae),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x17e5f4){const _0x145e5e=a12_0x24fcf3,_0x5ec6c0=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x5ec6c0,'meta':{'env':_0x17e5f4['envName']??_0x145e5e(0x19f)}}};}},authDeviceDefinition];
|
|
1
|
+
const a12_0x35db22=a12_0x365a;function a12_0x365a(_0x3f6df2,_0x3bd52e){_0x3f6df2=_0x3f6df2-0x100;const _0x37a4e3=a12_0x37a4();let _0x365aff=_0x37a4e3[_0x3f6df2];return _0x365aff;}(function(_0x2b41b2,_0x56cb16){const _0x5a2037=a12_0x365a,_0x4adb1d=_0x2b41b2();while(!![]){try{const _0x28ed34=-parseInt(_0x5a2037(0x122))/0x1+parseInt(_0x5a2037(0x12f))/0x2*(-parseInt(_0x5a2037(0x102))/0x3)+parseInt(_0x5a2037(0x108))/0x4*(-parseInt(_0x5a2037(0x13c))/0x5)+-parseInt(_0x5a2037(0x114))/0x6+parseInt(_0x5a2037(0x12a))/0x7+-parseInt(_0x5a2037(0x104))/0x8+parseInt(_0x5a2037(0x100))/0x9;if(_0x28ed34===_0x56cb16)break;else _0x4adb1d['push'](_0x4adb1d['shift']());}catch(_0x43440a){_0x4adb1d['push'](_0x4adb1d['shift']());}}}(a12_0x37a4,0x71274));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';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{getLoginUserInfo}from'../../core/api-client.js';import{getUserDomain}from'../../constant/domain.js';import{authDeviceDefinition,readStoredDeviceCode,deleteStoredDeviceCode,fetchDeviceToken,isStoredDeviceCodeExpired}from'../../commands/auth/device.js';import{maskCliAccessKey}from'../../utils/access-key-redaction.js';const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/;function showAccessKeyCreateHint(_0x48e3eb=USER_ACCESS_KEY_CREATE_URL){const _0x38d9c5=a12_0x365a;writeCliSideChannelLine(_0x38d9c5(0x124)+PRODUCT_CONFIG[_0x38d9c5(0x10f)]+':'),writeCliSideChannelLine('\x0a'+_0x48e3eb+'\x0a'),writeCliSideChannelLine(_0x38d9c5(0x13e)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>');}function buildAccessKeySetupGuide(_0x3a5aab=USER_ACCESS_KEY_CREATE_URL){const _0x463ac2=a12_0x365a;return[_0x463ac2(0x124)+PRODUCT_CONFIG['userCenterDisplayName']+':',_0x3a5aab,_0x463ac2(0x145)+CLI_BIN_NAME+_0x463ac2(0x133)]['join']('\x0a');}function canPromptForAccessKey(_0x206f76){const _0x313d77=a12_0x365a;return!_0x206f76[_0x313d77(0x14d)]&&process[_0x313d77(0x113)][_0x313d77(0x14f)]!==![]&&process['stdout'][_0x313d77(0x14f)]!==![];}function resolveAuthScopeFlags(_0x84f20a){const _0x17ddfe=a12_0x365a;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x84f20a['bool'](_0x17ddfe(0x11a)),'explicitProject':_0x84f20a[_0x17ddfe(0x12d)](_0x17ddfe(0x12e)),'policy':_0x17ddfe(0x152)}));}function a12_0x37a4(){const _0x2a65b6=['cancelled','Tip:\x20you\x20can\x20also\x20run:','scope','\x20(via\x20','accessKeyCreatePath','AccessKey:\x20','Read\x20from\x20global\x20config\x20(default)','AccessKey\x20cleared\x20from\x20','Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20','\x20config.','global\x20config','If\x20command\x20execution\x20still\x20fails,\x20run:\x20','Save\x20the\x20AccessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20the\x20project\x20file)','Device\x20authorization\x20pending.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20try\x20again.','login','AccessKey\x20(ak_xxx...)','nonInteractive','\x20\x20export\x20','isTTY','status','\x20auth\x20status','global-default','\x20doctor','Option\x20C:\x20environment\x20variable','check','\x20config.\x20Nothing\x20to\x20clear.','auth','Option\x20A:\x20','19258425aVZBya','daily','6uLhanK','authRequired','3396576HLEINk','Clear\x20the\x20AccessKey\x20from\x20config','accessKey','Saves\x20a\x20new\x20AccessKey\x20to\x20the\x20selected\x20Lovrabet\x20config.\x20An\x20existing\x20key\x20in\x20that\x20scope\x20is\x20overwritten.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20the\x20secret.','273916LecszB','Clear\x20from\x20global\x20config\x20(default)','AccessKey\x20saved\x20to\x20','Exit\x20non-zero\x20when\x20no\x20AccessKey\x20is\x20configured','access_key','=ak_xxx','access-key','userCenterDisplayName','str','ACCESS_KEY','\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]','stdin','3049542tXmYIj','production','write','\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars','test','global','read','\x20env\x20var','expired','Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','Invalid\x20accessKey\x20format.','yes','trim','627887SOSKjg','Use\x20`','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','env','Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','newConfigFileName','Auth\x20mode:\x20','boolean','1730652ykVztM','Removes\x20the\x20AccessKey\x20from\x20the\x20selected\x20Lovrabet\x20config.\x20Commands\x20that\x20need\x20that\x20key\x20will\x20require\x20login\x20again.','ClientAk','bool','project','20474aSOmrK','\x20Current\x20env:\x20','Status:\x20valid','push','\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','envName','Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','\x20Verify:\x20','join','validation','Missing\x20accessKey.','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','`auth\x20login`\x20does\x20not\x20support\x20--yes.','25NNXiaI'];a12_0x37a4=function(){return _0x2a65b6;};return a12_0x37a4();}async function resolveAuthWriteInput(_0x204950){const _0x387575=a12_0x365a;let _0x1b1c5d=(_0x204950[_0x387575(0x110)](_0x387575(0x10e))||_0x204950[_0x387575(0x110)]('ak')||'')['trim']();const _0x288d5c=(_0x204950[_0x387575(0x110)](_0x387575(0x125))||'')['trim'](),_0x18ffe7=''+getUserDomain()+PRODUCT_CONFIG[_0x387575(0x141)];if(!_0x1b1c5d&&canPromptForAccessKey(_0x204950))try{showAccessKeyCreateHint(_0x18ffe7),_0x1b1c5d=await promptAccessKey('');}catch(_0x5d154d){if(isAbortPrompt(_0x5d154d))throw CliErrors[_0x387575(0x13d)]();throw _0x5d154d;}if(!_0x1b1c5d)throw CliErrors[_0x387575(0x138)](_0x387575(0x139),buildAccessKeySetupGuide(_0x18ffe7));if(!ACCESS_KEY_PATTERN[_0x387575(0x119)](_0x1b1c5d))throw CliErrors[_0x387575(0x138)](_0x387575(0x11f),_0x387575(0x118));if(!_0x288d5c)return{'accessKey':_0x1b1c5d};const _0x47047f=normalizeEnv(_0x288d5c);return{'accessKey':_0x1b1c5d,'env':isDaily(_0x47047f)?_0x387575(0x101):isDev(_0x47047f)?'development':_0x387575(0x115)};}export const authDefinitions=[{'service':a12_0x35db22(0x157),'command':a12_0x35db22(0x14b),'description':a12_0x35db22(0x149),'risk':a12_0x35db22(0x116),'confirmationDescription':a12_0x35db22(0x107),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x35db22(0x10e),'type':'string','description':a12_0x35db22(0x14c)},{'name':'ak','type':'string','description':'Shorthand\x20for\x20--access-key'},{'name':a12_0x35db22(0x11a),'type':'boolean','description':'Write\x20to\x20global\x20config\x20(default)','default':!![]},{'name':'project','type':'boolean','description':a12_0x35db22(0x13a),'default':![]}],async 'execute'(_0x260c15){const _0x405730=a12_0x35db22;if(_0x260c15['bool'](_0x405730(0x120)))throw CliErrors[_0x405730(0x138)](_0x405730(0x13b),_0x405730(0x123)+CLI_BIN_NAME+'\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`'+CLI_BIN_NAME+_0x405730(0x117));const _0x3d5f6b=(_0x260c15[_0x405730(0x110)]('access-key')||_0x260c15[_0x405730(0x110)]('ak')||'')[_0x405730(0x121)]();if(!_0x3d5f6b&&_0x260c15[_0x405730(0x14d)])return{'ok':!![],'message':buildAccessKeySetupGuide(''+getUserDomain()+PRODUCT_CONFIG[_0x405730(0x141)])};const _0x154d42=await resolveAuthWriteInput(_0x260c15),_0x3f915a=resolveAuthScopeFlags(_0x260c15),_0x534dbf=readScopedConfig(_0x3f915a);_0x534dbf[_0x405730(0x106)]=_0x154d42[_0x405730(0x106)];_0x154d42[_0x405730(0x125)]&&(_0x534dbf[_0x405730(0x125)]=_0x154d42[_0x405730(0x125)]);writeScopedConfig(_0x534dbf,_0x3f915a);const _0x322588=_0x3f915a[_0x405730(0x11a)]?_0x405730(0x11a):_0x405730(0x12e),_0x151688=_0x534dbf[_0x405730(0x125)]?_0x405730(0x130)+_0x534dbf[_0x405730(0x125)]+'.':'';return{'ok':!![],'message':_0x405730(0x10a)+_0x322588+_0x405730(0x146)+_0x151688+_0x405730(0x136)+CLI_BIN_NAME+_0x405730(0x151)};}},{'service':a12_0x35db22(0x157),'command':'logout','description':a12_0x35db22(0x105),'risk':a12_0x35db22(0x116),'confirmationDescription':a12_0x35db22(0x12b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x35db22(0x11a),'type':a12_0x35db22(0x129),'description':a12_0x35db22(0x109),'default':!![]},{'name':a12_0x35db22(0x12e),'type':a12_0x35db22(0x129),'description':a12_0x35db22(0x11e),'default':![]}],async 'execute'(_0xcdf24f){const _0x1f97e6=a12_0x35db22,_0x3fb9f1=resolveAuthScopeFlags(_0xcdf24f),_0x4280c0=readScopedConfig(_0x3fb9f1),_0xaebcfa=!!_0x4280c0[_0x1f97e6(0x106)];delete _0x4280c0[_0x1f97e6(0x106)],writeScopedConfig(_0x4280c0,_0x3fb9f1);const _0xfc5cb7=_0x3fb9f1[_0x1f97e6(0x11a)]?_0x1f97e6(0x11a):_0x1f97e6(0x12e);if(_0xaebcfa)return{'ok':!![],'message':_0x1f97e6(0x144)+_0xfc5cb7+_0x1f97e6(0x146)};return{'ok':!![],'message':'No\x20AccessKey\x20found\x20in\x20'+_0xfc5cb7+_0x1f97e6(0x156)};}},{'service':'auth','command':a12_0x35db22(0x150),'description':'Show\x20current\x20authentication\x20status','risk':a12_0x35db22(0x11b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x35db22(0x11a),'type':a12_0x35db22(0x129),'description':a12_0x35db22(0x143),'default':!![]},{'name':a12_0x35db22(0x12e),'type':'boolean','description':a12_0x35db22(0x135),'default':![]},{'name':a12_0x35db22(0x155),'type':a12_0x35db22(0x129),'description':a12_0x35db22(0x10b),'default':![]}],async 'execute'(_0x31721f){const _0x3aa0b9=a12_0x35db22,_0x5c756f=resolveAuthScopeFlags(_0x31721f),_0x4901df=readScopedConfig(_0x5c756f),_0x449b04=productEnvName(_0x3aa0b9(0x111)),_0x2850e1=productEnv('ACCESS_KEY')||undefined,_0x30adb2=_0x4901df[_0x3aa0b9(0x106)]||undefined,_0x5342f0=_0x2850e1||_0x30adb2,_0x498384=_0x2850e1?_0x449b04+_0x3aa0b9(0x11c):_0x30adb2?(_0x5c756f[_0x3aa0b9(0x11a)]?'global':'project')+'\x20config':null,_0x3fcc8e=[_0x3aa0b9(0x128)+AUTH_MODE[_0x3aa0b9(0x12c)]];if(_0x5342f0){const _0x50c4dc=maskCliAccessKey(_0x5342f0);_0x3fcc8e[_0x3aa0b9(0x132)](_0x3aa0b9(0x142)+_0x50c4dc+(_0x498384?_0x3aa0b9(0x140)+_0x498384+')':'')),_0x3fcc8e['push'](_0x3aa0b9(0x131));}if(!_0x5342f0){_0x3fcc8e[_0x3aa0b9(0x132)](''),_0x3fcc8e['push']('No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:'),_0x3fcc8e['push'](''),_0x3fcc8e[_0x3aa0b9(0x132)](_0x3aa0b9(0x158)+CLI_BIN_NAME+_0x3aa0b9(0x112)),_0x3fcc8e[_0x3aa0b9(0x132)](''),_0x3fcc8e[_0x3aa0b9(0x132)]('Option\x20B:\x20apps\x20config\x20('+PRODUCT_CONFIG[_0x3aa0b9(0x127)]+')'),_0x3fcc8e[_0x3aa0b9(0x132)]('{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}'),_0x3fcc8e[_0x3aa0b9(0x132)](''),_0x3fcc8e[_0x3aa0b9(0x132)](_0x3aa0b9(0x154)),_0x3fcc8e[_0x3aa0b9(0x132)](_0x3aa0b9(0x14e)+_0x449b04+_0x3aa0b9(0x10d)),_0x3fcc8e[_0x3aa0b9(0x132)](''),_0x3fcc8e[_0x3aa0b9(0x132)]('Then\x20verify\x20with:\x20'+CLI_BIN_NAME+_0x3aa0b9(0x151)),_0x3fcc8e[_0x3aa0b9(0x132)](_0x3aa0b9(0x148)+CLI_BIN_NAME+_0x3aa0b9(0x153));if(_0x31721f['bool'](_0x3aa0b9(0x155))){const _0x17926f=readStoredDeviceCode();if(_0x17926f&&!isStoredDeviceCodeExpired(_0x17926f)){const _0x5178a9=getUserDomain(),_0x564526=await fetchDeviceToken(_0x5178a9,_0x17926f['code']);if(_0x564526[_0x3aa0b9(0x150)]==='success'&&_0x564526[_0x3aa0b9(0x10c)]){const _0x2af219={'global':_0x17926f[_0x3aa0b9(0x13f)]===_0x3aa0b9(0x11a)},_0x5a30b7=readScopedConfig(_0x2af219);_0x5a30b7[_0x3aa0b9(0x106)]=_0x564526[_0x3aa0b9(0x10c)],writeScopedConfig(_0x5a30b7,_0x2af219),deleteStoredDeviceCode();const _0x117511=_0x564526[_0x3aa0b9(0x10c)],_0x47866a=maskCliAccessKey(_0x117511),_0x10f2aa=_0x17926f[_0x3aa0b9(0x13f)]===_0x3aa0b9(0x11a)?_0x3aa0b9(0x147):'project\x20config';return{'ok':!![],'message':['Auth\x20mode:\x20'+AUTH_MODE[_0x3aa0b9(0x12c)],_0x3aa0b9(0x142)+_0x47866a+'\x20(via\x20'+_0x10f2aa+')',_0x3aa0b9(0x131)]['join']('\x0a')};}_0x564526['status']===_0x3aa0b9(0x11d)&&deleteStoredDeviceCode();throw CliErrors[_0x3aa0b9(0x103)](_0x3aa0b9(0x14a));}throw CliErrors[_0x3aa0b9(0x103)](_0x3fcc8e[_0x3aa0b9(0x137)]('\x0a'));}}return{'ok':!![],'message':_0x3fcc8e['join']('\x0a')};}},{'service':'auth','command':'info','description':a12_0x35db22(0x126),'risk':'read','requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x3e62a6){const _0x1a60bb=a12_0x35db22,_0x4b0f7d=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x4b0f7d,'meta':{'env':_0x3e62a6[_0x1a60bb(0x134)]??_0x1a60bb(0x115)}}};}},authDeviceDefinition];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x36c9fc,_0x2c058f){const _0xe25d1b=a13_0x3996,_0x1d3f92=_0x36c9fc();while(!![]){try{const _0x57ab64=-parseInt(_0xe25d1b(0x15d))/0x1*(-parseInt(_0xe25d1b(0x161))/0x2)+parseInt(_0xe25d1b(0x158))/0x3*(parseInt(_0xe25d1b(0x154))/0x4)+-parseInt(_0xe25d1b(0x155))/0x5+parseInt(_0xe25d1b(0x15f))/0x6*(parseInt(_0xe25d1b(0x164))/0x7)+-parseInt(_0xe25d1b(0x15b))/0x8+-parseInt(_0xe25d1b(0x151))/0x9*(-parseInt(_0xe25d1b(0x160))/0xa)+-parseInt(_0xe25d1b(0x15c))/0xb;if(_0x57ab64===_0x2c058f)break;else _0x1d3f92['push'](_0x1d3f92['shift']());}catch(_0x545098){_0x1d3f92['push'](_0x1d3f92['shift']());}}}(a13_0x12f6,0x8b5bf));import{createInterface}from'node:readline';class AbortPrompt extends Error{constructor(){const _0x34c539=a13_0x3996;super(_0x34c539(0x153)),this[_0x34c539(0x159)]=_0x34c539(0x15a);}}function a13_0x12f6(){const _0x6be9de=['stdout','61593vyOsSH','close','stdin','once','removeListener','3123VLbAse','SIGINT','User\x20aborted\x20prompt','172264PlnIyP','1483870mnQJhz','race','question','54ndZxjJ','name','AbortPrompt','7618144AuOFoU','19664502oOdtsq','1ceHuOR','trim','498OlVYjD','30010vOZDcn','2121374PIzhMd','AccessKey\x20(paste\x20ak_...):\x20'];a13_0x12f6=function(){return _0x6be9de;};return a13_0x12f6();}function createSafeRl(){const _0x3c110f=a13_0x3996,_0x1ce18d=createInterface({'input':process[_0x3c110f(0x14e)],'output':process[_0x3c110f(0x163)]});let _0x824d9c;const _0x36629a=new Promise((_0x3982b1,_0xd422b)=>{const _0x491548=_0x3c110f;_0x824d9c=()=>{const _0x44b830=a13_0x3996;_0x824d9c&&(_0x1ce18d[_0x44b830(0x150)](_0x44b830(0x152),_0x824d9c),_0x824d9c=undefined);try{_0x1ce18d[_0x44b830(0x165)]();}catch{}_0xd422b(new AbortPrompt());},_0x1ce18d[_0x491548(0x14f)]('SIGINT',_0x824d9c);}),_0x39a7cf=()=>{const _0x35fe48=_0x3c110f;_0x824d9c&&(_0x1ce18d[_0x35fe48(0x150)](_0x35fe48(0x152),_0x824d9c),_0x824d9c=undefined);try{_0x1ce18d[_0x35fe48(0x165)]();}catch{}};return{'rl':_0x1ce18d,'abortPromise':_0x36629a,'disposeSuccess':_0x39a7cf};}export async function promptAccessKey(_0x2a2d58=''){const _0x4ca4f7=a13_0x3996,{rl:_0x24a57f,abortPromise:_0x46f7de,disposeSuccess:_0x5dfee1}=createSafeRl(),_0x48740f=new Promise(_0x5e6680=>{const _0x412600=a13_0x3996,_0x18dcbe=_0x2a2d58?'AccessKey\x20('+_0x2a2d58+'):\x20':_0x412600(0x162);_0x24a57f[_0x412600(0x157)](_0x18dcbe,_0xa063e0=>{const _0x28a914=_0x412600;_0x5dfee1(),_0x5e6680(_0xa063e0[_0x28a914(0x15e)]()||_0x2a2d58);});});return Promise[_0x4ca4f7(0x156)]([_0x48740f,_0x46f7de]);}function a13_0x3996(_0x2c0332,_0x4473fc){_0x2c0332=_0x2c0332-0x14e;const _0x12f632=a13_0x12f6();let _0x399673=_0x12f632[_0x2c0332];return _0x399673;}export function isAbortPrompt(_0x25a847){const _0x144759=a13_0x3996;return _0x25a847 instanceof Error&&_0x25a847[_0x144759(0x159)]===_0x144759(0x15a);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a14_0x5f9f(_0x49f029,_0xbca89f){_0x49f029=_0x49f029-0x1d2;const _0x410d74=a14_0x410d();let _0x5f9f0=_0x410d74[_0x49f029];return _0x5f9f0;}const a14_0x55eda6=a14_0x5f9f;(function(_0x4c7898,_0x17abba){const _0x2de17b=a14_0x5f9f,_0x48d571=_0x4c7898();while(!![]){try{const _0x305b88=-parseInt(_0x2de17b(0x1db))/0x1+-parseInt(_0x2de17b(0x1e2))/0x2*(-parseInt(_0x2de17b(0x1df))/0x3)+-parseInt(_0x2de17b(0x1de))/0x4+parseInt(_0x2de17b(0x1d3))/0x5*(-parseInt(_0x2de17b(0x1dd))/0x6)+-parseInt(_0x2de17b(0x1e1))/0x7+parseInt(_0x2de17b(0x1d4))/0x8+parseInt(_0x2de17b(0x1d6))/0x9;if(_0x305b88===_0x17abba)break;else _0x48d571['push'](_0x48d571['shift']());}catch(_0x50fe6d){_0x48d571['push'](_0x48d571['shift']());}}}(a14_0x410d,0x92080));import{getBffEndpointContract}from'../../core/api-client.js';import{NAME_FLAG}from'../../commands/common/flags.js';export const bffDetail={'service':a14_0x55eda6(0x1e0),'command':a14_0x55eda6(0x1d9),'description':'Get\x20a\x20Backend\x20Function\x20endpoint\x20contract\x20by\x20function\x20name','risk':a14_0x55eda6(0x1da),'flags':[{...NAME_FLAG,'required':!![],'description':'Backend\x20Function\x20name'}],async 'execute'(_0x27f02e){const _0x512cd7=a14_0x55eda6,_0x1cc2e7=await getBffEndpointContract(_0x27f02e[_0x512cd7(0x1dc)],_0x27f02e[_0x512cd7(0x1d7)](_0x512cd7(0x1d8)));return{'ok':!![],'data':{'appCode':_0x1cc2e7['appCode'],'functionName':_0x1cc2e7['functionName'],'description':_0x1cc2e7['description']||'(none)','version':_0x1cc2e7[_0x512cd7(0x1d5)],'gmtModified':_0x1cc2e7[_0x512cd7(0x1d2)]}};}};function a14_0x410d(){const _0x3b6fb6=['detail','read','286944iPAeHq','appCode','108lRKWmW','1072884BPBUsB','9wLaDcp','bff','5494496fgExmJ','446520zuyTJs','gmtModified','11045vlapnC','8060592WKHbEq','version','2705805MizKnY','str','name'];a14_0x410d=function(){return _0x3b6fb6;};return a14_0x410d();}
|
package/lib/commands/bff/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a15_0x126775=a15_0x4c2d;(function(_0xbe21de,_0x4f3232){const _0x29ad90=a15_0x4c2d,_0x386c6e=_0xbe21de();while(!![]){try{const _0x1e3c7c=parseInt(_0x29ad90(0x1e8))/0x1+-parseInt(_0x29ad90(0x1ed))/0x2+parseInt(_0x29ad90(0x1ef))/0x3*(-parseInt(_0x29ad90(0x1f1))/0x4)+parseInt(_0x29ad90(0x1ec))/0x5*(parseInt(_0x29ad90(0x1ea))/0x6)+parseInt(_0x29ad90(0x1f3))/0x7+-parseInt(_0x29ad90(0x1f6))/0x8+parseInt(_0x29ad90(0x1eb))/0x9*(parseInt(_0x29ad90(0x1e9))/0xa);if(_0x1e3c7c===_0x4f3232)break;else _0x386c6e['push'](_0x386c6e['shift']());}catch(_0x365178){_0x386c6e['push'](_0x386c6e['shift']());}}}(a15_0x2da7,0xea6a0));import{executeSdkBff}from'../../core/sdk-client.js';import{parseJsonParams}from'../../utils/params.js';function a15_0x4c2d(_0x52dd63,_0x1e4ca9){_0x52dd63=_0x52dd63-0x1e7;const _0x2da776=a15_0x2da7();let _0x4c2dc1=_0x2da776[_0x52dd63];return _0x4c2dc1;}import{NAME_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';function a15_0x2da7(){const _0x17f554=['Backend\x20Function\x20name\x20to\x20execute','933ICgkpz','read','11816DVRDch','exec','8453977bAUOrN','str','Backend\x20Function\x20executed\x20in\x20','9703872AwJouo','params','61498lnpHop','1066510vFxlIV','948EvvKhF','252kwsAZx','3055gTudLV','2520274OMCMjH'];a15_0x2da7=function(){return _0x17f554;};return a15_0x2da7();}export const bffExec={'service':'bff','command':a15_0x126775(0x1f2),'description':'Execute\x20a\x20Backend\x20Function\x20script\x20by\x20function\x20name','risk':a15_0x126775(0x1f0),'flags':[{...NAME_FLAG,'required':!![],'description':a15_0x126775(0x1ee)},PARAMS_FLAG],async 'execute'(_0x1288bd){const _0x3efa88=a15_0x126775,_0x9c7fff=parseJsonParams(_0x1288bd[_0x3efa88(0x1f4)](_0x3efa88(0x1e7))),_0x373ecd=Date['now'](),_0x5836d3=await executeSdkBff(_0x1288bd[_0x3efa88(0x1f4)]('name'),_0x9c7fff),_0x398b49=Date['now']()-_0x373ecd;return{'ok':!![],'data':{'result':_0x5836d3,'elapsed':_0x398b49},'message':_0x3efa88(0x1f5)+_0x398b49+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x21ae2e,_0x99c615){const _0x593767=a16_0x299f,_0x236541=_0x21ae2e();while(!![]){try{const _0x4233ca=parseInt(_0x593767(0x13f))/0x1*(-parseInt(_0x593767(0x147))/0x2)+-parseInt(_0x593767(0x146))/0x3+parseInt(_0x593767(0x140))/0x4+parseInt(_0x593767(0x148))/0x5*(parseInt(_0x593767(0x141))/0x6)+parseInt(_0x593767(0x142))/0x7+parseInt(_0x593767(0x144))/0x8+-parseInt(_0x593767(0x145))/0x9*(parseInt(_0x593767(0x143))/0xa);if(_0x4233ca===_0x99c615)break;else _0x236541['push'](_0x236541['shift']());}catch(_0x1265c5){_0x236541['push'](_0x236541['shift']());}}}(a16_0x2e63,0x4e10c));function a16_0x299f(_0x20a57e,_0x1756ba){_0x20a57e=_0x20a57e-0x13f;const _0x2e6334=a16_0x2e63();let _0x299fba=_0x2e6334[_0x20a57e];return _0x299fba;}import{bffDetail}from'../../commands/bff/detail.js';import{bffExec}from'../../commands/bff/exec.js';function a16_0x2e63(){const _0xabbcf2=['1150yhgxoF','1060664VpmZYr','61434ofOZqJ','134604mnqXcY','2SVgPnK','110dkExZo','56460KkwNIF','1345936BHrKSb','57138NHEdnt','3692507SBkURJ'];a16_0x2e63=function(){return _0xabbcf2;};return a16_0x2e63();}export const bffDefinitions=[bffDetail,bffExec];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a17_0x14d95b=a17_0x5842;function a17_0x5842(_0x1e0a45,_0x22e738){_0x1e0a45=_0x1e0a45-0x1ea;const _0xb463a8=a17_0xb463();let _0x5842d4=_0xb463a8[_0x1e0a45];return _0x5842d4;}(function(_0x17fefd,_0x3c14a5){const _0x5892e0=a17_0x5842,_0x21ab1c=_0x17fefd();while(!![]){try{const _0x9f0f1=-parseInt(_0x5892e0(0x200))/0x1+-parseInt(_0x5892e0(0x1f2))/0x2+parseInt(_0x5892e0(0x1ef))/0x3+parseInt(_0x5892e0(0x1f4))/0x4+parseInt(_0x5892e0(0x1fd))/0x5+-parseInt(_0x5892e0(0x1fb))/0x6+parseInt(_0x5892e0(0x1f1))/0x7;if(_0x9f0f1===_0x3c14a5)break;else _0x21ab1c['push'](_0x21ab1c['shift']());}catch(_0x7b84a6){_0x21ab1c['push'](_0x21ab1c['shift']());}}}(a17_0xb463,0xf4217));function a17_0xb463(){const _0x38b1a7=['info',']:\x20','repairCommand','CLI\x20Built-in\x20Skill\x20','setLogPath','read','Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20','unknown','5760894VKJxiR','installedPath','8375395bcZTtJ','2684372lSomri','INSTALL_FAILED','924320pvvpsg','code','Built-in\x20Skill\x20install\x20failed\x20[','\x20installed','Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20npm\x20package.','changed','nonInteractive','6794514odJCHi','\x20at\x20','6369430SUJaFs','cli-skill','pipe','1147185oZfPcq','skillVersion'];a17_0xb463=function(){return _0x38b1a7;};return a17_0xb463();}import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':a17_0x14d95b(0x1fe),'command':'install','description':'Install\x20the\x20built-in\x20CLI\x20Skill\x20required\x20by\x20Lovrabet\x20runtime','risk':a17_0x14d95b(0x1ec),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3d65f9){const _0x5c7bb2=a17_0x14d95b;logger[_0x5c7bb2(0x1eb)](process['cwd']()),logger[_0x5c7bb2(0x202)]('cli-skill-install',_0x5c7bb2(0x1f8));const _0x185893=installBuiltinSkill({'stdio':_0x3d65f9[_0x5c7bb2(0x1fa)]?_0x5c7bb2(0x1ff):'inherit'});if(!_0x185893['ok'])throw CliErrors['apiError'](_0x5c7bb2(0x1f6)+(_0x185893[_0x5c7bb2(0x1f5)]||_0x5c7bb2(0x1f3))+_0x5c7bb2(0x203)+(_0x185893['error']||_0x5c7bb2(0x1ee)),_0x5c7bb2(0x1ed)+_0x185893[_0x5c7bb2(0x204)]);const _0x270458=_0x185893[_0x5c7bb2(0x1f0)]?_0x5c7bb2(0x1fc)+_0x185893[_0x5c7bb2(0x1f0)]:'';return console['log'](_0x185893[_0x5c7bb2(0x1f9)]?_0x5c7bb2(0x1ea)+_0x185893[_0x5c7bb2(0x201)]+_0x5c7bb2(0x1f7)+_0x270458:'CLI\x20Built-in\x20Skill\x20'+_0x185893[_0x5c7bb2(0x201)]+'\x20is\x20already\x20current'+_0x270458),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1e9f49,_0x38a75f){const _0x4575fa=a18_0x2d60,_0x24e121=_0x1e9f49();while(!![]){try{const _0x559200=-parseInt(_0x4575fa(0xe3))/0x1*(parseInt(_0x4575fa(0xd2))/0x2)+-parseInt(_0x4575fa(0xd7))/0x3+-parseInt(_0x4575fa(0xe1))/0x4*(-parseInt(_0x4575fa(0xd6))/0x5)+-parseInt(_0x4575fa(0xe2))/0x6+-parseInt(_0x4575fa(0xe5))/0x7+parseInt(_0x4575fa(0xdc))/0x8+parseInt(_0x4575fa(0xda))/0x9;if(_0x559200===_0x38a75f)break;else _0x24e121['push'](_0x24e121['shift']());}catch(_0x2d8c8f){_0x24e121['push'](_0x24e121['shift']());}}}(a18_0x177b,0xc54df));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';function a18_0x2d60(_0xe48eae,_0x17c867){_0xe48eae=_0xe48eae-0xd1;const _0x177bee=a18_0x177b();let _0x2d60be=_0x177bee[_0xe48eae];return _0x2d60be;}export{OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{isInProject}from'../../context.js';import{CliErrors}from'../../errors.js';export{buildAppProfileListFields,CONFIG_ENUM_VALUES,CLI_PROTECTED_CONFIG_KEYS,IMPORTABLE_RUNTIME_CONFIG_KEYS,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getConfigDefaultValue,getConfigEnumValues,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isLegacyCompatConfigKey,isCliProtectedConfigKey,isTopLevelConfigKey,normalizeLocale}from'../../config/schema.js';function a18_0x177b(){const _0x21af24=['validation',',\x20or\x20create\x20a\x20project-local\x20','58728zLwusO','67212vcWklt','5TSaRPF','Flags\x20--global\x20and\x20--project\x20are\x20mutually\x20exclusive.','8956318prOChN','project-or-global-explicit','534116WZSCQF','Add\x20--global\x20to\x20write\x20to\x20~/','newConfigFileName','Use\x20only\x20one\x20config\x20scope\x20flag.','415lYqUNb','3667512cIZjox','inProject','project','17444331XdFHbV','\x20found).','11998112eqstlc','global-default','global'];a18_0x177b=function(){return _0x21af24;};return a18_0x177b();}export function resolveConfigScope(_0x184472){const _0x1743b3=a18_0x2d60,{explicitGlobal:explicitGlobal=![],explicitProject:explicitProject=![],policy:_0x5df972}=_0x184472;if(explicitGlobal&&explicitProject)throw CliErrors['validation'](_0x1743b3(0xe4),_0x1743b3(0xd5));if(explicitGlobal)return _0x1743b3(0xde);if(explicitProject)return'project';switch(_0x5df972){case _0x1743b3(0xdd):return _0x1743b3(0xde);case _0x1743b3(0xd1):if(!(_0x184472[_0x1743b3(0xd8)]??isInProject()))throw CliErrors[_0x1743b3(0xdf)]('Not\x20inside\x20a\x20project\x20(no\x20'+PRODUCT_CONFIG[_0x1743b3(0xd4)]+_0x1743b3(0xdb),_0x1743b3(0xd3)+PRODUCT_CONFIG['newConfigFileName']+_0x1743b3(0xe0)+PRODUCT_CONFIG[_0x1743b3(0xd4)]+'\x20first.');return _0x1743b3(0xd9);}}export function toScopeFlags(_0x466275){return{'global':_0x466275==='global'};}export function formatScopeLabel(_0x2a6e44){return _0x2a6e44==='global'?'\x20(global)':'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3cf5b3,_0x55717f){const _0x4057d8=a19_0x1ccc,_0xb18b4a=_0x3cf5b3();while(!![]){try{const _0x3e8738=-parseInt(_0x4057d8(0x1a0))/0x1+-parseInt(_0x4057d8(0x1a9))/0x2+-parseInt(_0x4057d8(0x19e))/0x3*(parseInt(_0x4057d8(0x1a4))/0x4)+-parseInt(_0x4057d8(0x1b3))/0x5+parseInt(_0x4057d8(0x1a5))/0x6+parseInt(_0x4057d8(0x1b6))/0x7+parseInt(_0x4057d8(0x1b2))/0x8;if(_0x3e8738===_0x55717f)break;else _0xb18b4a['push'](_0xb18b4a['shift']());}catch(_0x19890d){_0xb18b4a['push'](_0xb18b4a['shift']());}}}(a19_0x1deb,0x86918));function a19_0x1ccc(_0x46b259,_0x493369){_0x46b259=_0x46b259-0x19d;const _0x1debdc=a19_0x1deb();let _0x1ccc85=_0x1debdc[_0x46b259];return _0x1ccc85;}import{CliErrors}from'../../errors.js';function a19_0x1deb(){const _0x33862b=['flag','join','map','test','13358728FXNlWw','1455125LFZkDP','Provide\x20one\x20of:\x20','filter','5975116xfNaPa','some','At\x20least\x20one\x20of\x20','12VAbtSj','length','393272ArZnWm','Invalid\x20--','Flags\x20','str','695052rPQIWp','2967774cYoGLc','\x20are\x20mutually\x20exclusive\x20for\x20`','\x20is\x20allowed,\x20found:\x20','Remove\x20all\x20but\x20one.','2175034MfEONu','Only\x20one\x20of\x20','Use\x20only\x20one\x20of:\x20','\x20is\x20required\x20for\x20`','validation'];a19_0x1deb=function(){return _0x33862b;};return a19_0x1deb();}function isSet(_0x4627db,_0x1f35e6){const _0x4142db=a19_0x1ccc,_0x5c1588=_0x4627db[_0x4142db(0x1ae)](_0x1f35e6);return _0x5c1588!==undefined&&_0x5c1588!==''&&_0x5c1588!==![]&&_0x5c1588!==0x0;}function fmtNames(_0x2ee4f9){const _0xb4bfe6=a19_0x1ccc;return _0x2ee4f9[_0xb4bfe6(0x1b0)](_0x531537=>'--'+_0x531537)[_0xb4bfe6(0x1af)](',\x20');}export function requireOneOf(_0x1da791,_0x3e9937,_0x357dda){const _0x49fb17=a19_0x1ccc,_0x31503e=_0x3e9937[_0x49fb17(0x1b5)](_0x35ea6e=>isSet(_0x1da791,_0x35ea6e));if(_0x31503e[_0x49fb17(0x19f)]!==0x1)throw CliErrors[_0x49fb17(0x1ad)](_0x31503e[_0x49fb17(0x19f)]===0x0?'Exactly\x20one\x20of\x20'+fmtNames(_0x3e9937)+_0x49fb17(0x1ac)+_0x357dda+'`.':_0x49fb17(0x1aa)+fmtNames(_0x3e9937)+_0x49fb17(0x1a7)+fmtNames(_0x31503e)+'.',_0x31503e[_0x49fb17(0x19f)]===0x0?_0x49fb17(0x1b4)+fmtNames(_0x3e9937):_0x49fb17(0x1a8));}export function requireAnyOf(_0x23fc0f,_0x4494a4,_0x16dea8){const _0x288c2f=a19_0x1ccc;if(!_0x4494a4[_0x288c2f(0x1b7)](_0x2f79bf=>isSet(_0x23fc0f,_0x2f79bf)))throw CliErrors['validation'](_0x288c2f(0x19d)+fmtNames(_0x4494a4)+_0x288c2f(0x1ac)+_0x16dea8+'`.','Provide\x20one\x20of:\x20'+fmtNames(_0x4494a4));}export function mutuallyExclusive(_0xee82d8,_0x223e3b,_0x5ea8b8){const _0x160368=a19_0x1ccc,_0x1084b0=_0x223e3b[_0x160368(0x1b5)](_0x1f0b84=>isSet(_0xee82d8,_0x1f0b84));if(_0x1084b0[_0x160368(0x19f)]>0x1)throw CliErrors['validation'](_0x160368(0x1a2)+fmtNames(_0x1084b0)+_0x160368(0x1a6)+_0x5ea8b8+'`.',_0x160368(0x1ab)+fmtNames(_0x223e3b));}export function validatePattern(_0x213e37,_0x245f44,_0x3a14a6,_0x2c3b2b){const _0x5a8bff=a19_0x1ccc,_0x579749=_0x213e37[_0x5a8bff(0x1a3)](_0x245f44);if(_0x579749&&!_0x3a14a6[_0x5a8bff(0x1b1)](_0x579749))throw CliErrors[_0x5a8bff(0x1ad)](_0x5a8bff(0x1a1)+_0x245f44+':\x20expected\x20'+_0x2c3b2b+',\x20got\x20\x22'+_0x579749+'\x22.');}
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
* in their respective command modules to keep the shared module stable.
|
|
13
13
|
*/
|
|
14
14
|
import type { FlagDef } from "../../framework/types.js";
|
|
15
|
+
/** Write configuration to the user-level config instead of the current project. */
|
|
16
|
+
export declare const GLOBAL_SCOPE_FLAG: FlagDef;
|
|
15
17
|
/**
|
|
16
18
|
* Dataset `--code` flag: accepts only a 32-character lowercase hex string (UUID format).
|
|
17
19
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a20_0x4356(_0x2a4141,_0x426971){_0x2a4141=_0x2a4141-0x6f;const _0x12455b=a20_0x1245();let _0x43566e=_0x12455b[_0x2a4141];return _0x43566e;}const a20_0xfa15f2=a20_0x4356;(function(_0x51b870,_0x289ece){const _0x3e0bec=a20_0x4356,_0x24955d=_0x51b870();while(!![]){try{const _0x5924c6=-parseInt(_0x3e0bec(0x85))/0x1+parseInt(_0x3e0bec(0x72))/0x2*(parseInt(_0x3e0bec(0x71))/0x3)+-parseInt(_0x3e0bec(0x7e))/0x4+parseInt(_0x3e0bec(0x87))/0x5*(-parseInt(_0x3e0bec(0x73))/0x6)+parseInt(_0x3e0bec(0x82))/0x7*(parseInt(_0x3e0bec(0x70))/0x8)+-parseInt(_0x3e0bec(0x80))/0x9+-parseInt(_0x3e0bec(0x84))/0xa*(-parseInt(_0x3e0bec(0x7f))/0xb);if(_0x5924c6===_0x289ece)break;else _0x24955d['push'](_0x24955d['shift']());}catch(_0x5f1fe5){_0x24955d['push'](_0x24955d['shift']());}}}(a20_0x1245,0x5267e));export const GLOBAL_SCOPE_FLAG={'name':a20_0xfa15f2(0x6f),'type':a20_0xfa15f2(0x7a),'default':![],'description':a20_0xfa15f2(0x7b)};export const CODE_FLAG={'name':a20_0xfa15f2(0x77),'type':a20_0xfa15f2(0x86),'required':!![],'description':a20_0xfa15f2(0x75),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':'a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588)'}};export const SQLCODE_FLAG={'name':a20_0xfa15f2(0x7d),'type':a20_0xfa15f2(0x86),'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':a20_0xfa15f2(0x79)}};export const VERBOSE_FLAG={'name':a20_0xfa15f2(0x76),'type':a20_0xfa15f2(0x7a),'description':a20_0xfa15f2(0x7c)};function a20_0x1245(){const _0x4ef583=['string','3310CGVrwP','global','72vfGgXo','3chIQVH','490816VUoZhB','5916xTCLSS','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','Dataset\x20code\x20(32-char\x20hex\x20UUID)','verbose','code','name','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','boolean','Write\x20to\x20the\x20global\x20configuration','Return\x20full\x20raw\x20response\x20object','sqlcode','588848xifBOL','44qUnBFc','3904992zvRSAB','params','306796pspXWB','number','3682630qVAOfR','541546NqAwRH'];a20_0x1245=function(){return _0x4ef583;};return a20_0x1245();}export const PARAMS_FLAG={'name':a20_0xfa15f2(0x81),'type':a20_0xfa15f2(0x86),'description':a20_0xfa15f2(0x74)};export const NAME_FLAG={'name':a20_0xfa15f2(0x78),'type':a20_0xfa15f2(0x86),'description':'Resource\x20name\x20for\x20lookup'};export const ID_FLAG={'name':'id','type':a20_0xfa15f2(0x83),'required':!![],'description':'Resource\x20ID'};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5734db,_0x2b5029){const _0xd7ee9a=a21_0x47ff,_0x331b65=_0x5734db();while(!![]){try{const _0x5dd5fa=-parseInt(_0xd7ee9a(0xa0))/0x1+-parseInt(_0xd7ee9a(0xaf))/0x2+-parseInt(_0xd7ee9a(0xa8))/0x3+parseInt(_0xd7ee9a(0xa2))/0x4*(-parseInt(_0xd7ee9a(0xae))/0x5)+-parseInt(_0xd7ee9a(0xab))/0x6+parseInt(_0xd7ee9a(0xa1))/0x7+-parseInt(_0xd7ee9a(0xa5))/0x8*(-parseInt(_0xd7ee9a(0xb2))/0x9);if(_0x5dd5fa===_0x2b5029)break;else _0x331b65['push'](_0x331b65['shift']());}catch(_0x690d89){_0x331b65['push'](_0x331b65['shift']());}}}(a21_0x76ad,0xd1de0));import{existsSync,statSync}from'node:fs';function a21_0x47ff(_0x3a4957,_0x26ccf7){_0x3a4957=_0x3a4957-0xa0;const _0x76adac=a21_0x76ad();let _0x47ffc7=_0x76adac[_0x3a4957];return _0x47ffc7;}function a21_0x76ad(){const _0x73e17f=['File\x20not\x20found:\x20','size','4445439RuIvZv','File\x20exceeds\x20the\x20runtime\x20upload\x20limit\x20of\x2050\x20MB:\x20','isFile','70938oJwHPv','ceil','\x20MB','5rXbLjq','48908dhFLhL','validation','\x20path\x20is\x20required.','40437TbPqCw','914878MlCysa','6561184CORuAV','3788332GFNUyT','File\x20is\x20not\x20a\x20regular\x20file:\x20','trim','5880ECFtjF'];a21_0x76ad=function(){return _0x73e17f;};return a21_0x76ad();}import{CliErrors}from'../../errors.js';const BYTES_PER_MB=0x400*0x400;export const RUNTIME_UPLOAD_MAX_BYTES=0x32*BYTES_PER_MB;function formatBytes(_0x1f09c1){const _0x4ede78=a21_0x47ff;if(_0x1f09c1>=BYTES_PER_MB){const _0x51e036=Math[_0x4ede78(0xac)](_0x1f09c1/BYTES_PER_MB*0x64)/0x64;return _0x51e036['toFixed'](0x2)+_0x4ede78(0xad);}return _0x1f09c1+'\x20B';}export function requireRuntimeUploadFile(_0x1106f7,_0x228810){const _0x1cbaf2=a21_0x47ff,_0x3efb5b=_0x1106f7[_0x1cbaf2(0xa4)]();if(!_0x3efb5b)throw CliErrors['validation'](_0x228810+_0x1cbaf2(0xb1));if(!existsSync(_0x3efb5b))throw CliErrors[_0x1cbaf2(0xb0)](_0x1cbaf2(0xa6)+_0x3efb5b);const _0x3184f6=statSync(_0x3efb5b);if(!_0x3184f6[_0x1cbaf2(0xaa)]())throw CliErrors[_0x1cbaf2(0xb0)](_0x1cbaf2(0xa3)+_0x3efb5b);if(_0x3184f6[_0x1cbaf2(0xa7)]>RUNTIME_UPLOAD_MAX_BYTES)throw CliErrors['validation'](_0x1cbaf2(0xa9)+_0x3efb5b+'\x20('+formatBytes(_0x3184f6[_0x1cbaf2(0xa7)])+')');return{'path':_0x3efb5b,'size':_0x3184f6[_0x1cbaf2(0xa7)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a22_0xca8a12=a22_0x3334;(function(_0x380337,_0x54e9ab){const _0x38813c=a22_0x3334,_0x5eb7f5=_0x380337();while(!![]){try{const _0x69b363=-parseInt(_0x38813c(0x138))/0x1+parseInt(_0x38813c(0x166))/0x2*(-parseInt(_0x38813c(0x16b))/0x3)+-parseInt(_0x38813c(0x16a))/0x4+-parseInt(_0x38813c(0x13d))/0x5*(-parseInt(_0x38813c(0x13f))/0x6)+-parseInt(_0x38813c(0x154))/0x7*(-parseInt(_0x38813c(0x158))/0x8)+-parseInt(_0x38813c(0x12b))/0x9*(parseInt(_0x38813c(0x16e))/0xa)+parseInt(_0x38813c(0x133))/0xb;if(_0x69b363===_0x54e9ab)break;else _0x5eb7f5['push'](_0x5eb7f5['shift']());}catch(_0x1d86ab){_0x5eb7f5['push'](_0x5eb7f5['shift']());}}}(a22_0x257d,0x6fadf));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isCliProtectedConfigKey,isTopLevelConfigKey,normalizeLocale,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';import{DOMAIN_CONFIG_FIELDS,normalizeDomainOrigin}from'../../config/domain-config.js';function a22_0x3334(_0x1c2716,_0x30c29e){_0x1c2716=_0x1c2716-0x12b;const _0x257d54=a22_0x257d();let _0x33343b=_0x257d54[_0x1c2716];return _0x33343b;}function a22_0x257d(){const _0x197bdd=['Write\x20to\x20global\x20config','343777cgcOxT','length','includes','Missing\x20key\x20or\x20value.','appcode','60DMmxUV','pageSize','15588WhRwBT','Value\x20to\x20assign','Invalid\x20value\x20for\x20\x22','Delete\x20a\x20configuration\x20value','read','isArray','accessKey','locale','log','\x20config\x20delete\x20<key>\x20[--global]','args','pretty','apps','\x22\x20is\x20protected\x20and\x20cannot\x20be\x20changed\x20via\x20config\x20commands.','bool','get','Usage:\x20','\x22.\x20Allowed:\x20','boolean','Changes\x20Lovrabet\x20CLI\x20configuration.\x20Later\x20commands\x20may\x20use\x20a\x20different\x20app,\x20environment,\x20or\x20output\x20behavior.','Key\x20not\x20found:\x20','2143015RjXUCW','\x22\x20is\x20not\x20settable.','list','set','8lKQznA','trim','split','stringify','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','global','Deleted\x20`','Key\x20already\x20absent:\x20','config','Missing\x20key\x20argument.','List\x20current\x20config','\x20\x20project:\x20','key','write','113576nafQWK','object','join','Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US','1697368lJmOvN','6qzJiNW','field','Invalid\x20locale\x20value.','10wulBKa','2763657vNBNbp','project-or-global-explicit','alias','validation','`\x20=\x20\x22','Set\x20`','Get\x20a\x20config\x20value','\x20(global)','14397746LklhzV','format','value','Top-level\x20key\x20\x22'];a22_0x257d=function(){return _0x197bdd;};return a22_0x257d();}import{configInitDefinition}from'../../commands/config/init.js';import{maskCliAccessKey,redactCliConfigCredentials,redactCliConfigValue}from'../../utils/access-key-redaction.js';const GLOBAL_FLAG={'name':a22_0xca8a12(0x15d),'type':a22_0xca8a12(0x151),'description':a22_0xca8a12(0x137),'default':![]};function parseAliasAppcodeSetKey(_0x146cce){const _0x5e04c6=a22_0xca8a12,_0x37c895=_0x146cce[_0x5e04c6(0x15a)]('.');if(_0x37c895[_0x5e04c6(0x139)]!==0x3||_0x37c895[0x0]!==_0x5e04c6(0x14b)||_0x37c895[0x2]!==_0x5e04c6(0x13c))return undefined;const _0x2b8cf4=_0x37c895[0x1]?.['trim']();return _0x2b8cf4?_0x2b8cf4:undefined;}function parseAliasDeleteKey(_0x3eede0){const _0x386e34=a22_0xca8a12,_0x1da7b3=_0x3eede0[_0x386e34(0x15a)]('.');if(_0x1da7b3[_0x386e34(0x139)]===0x2&&_0x1da7b3[0x0]===_0x386e34(0x14b)){const _0x342732=_0x1da7b3[0x1]?.[_0x386e34(0x159)]();return _0x342732?{'alias':_0x342732}:undefined;}if(_0x1da7b3[_0x386e34(0x139)]===0x3&&_0x1da7b3[0x0]===_0x386e34(0x14b)&&_0x1da7b3[0x2]==='appcode'){const _0x51059c=_0x1da7b3[0x1]?.[_0x386e34(0x159)]();return _0x51059c?{'alias':_0x51059c,'field':_0x386e34(0x13c)}:undefined;}return undefined;}function setLocalAppAlias(_0x5459d9,_0xf705dc,_0x75edbc){const _0xa9255a=a22_0xca8a12,_0x298c15=_0x5459d9[_0xa9255a(0x14b)]&&typeof _0x5459d9[_0xa9255a(0x14b)]===_0xa9255a(0x167)&&!Array['isArray'](_0x5459d9[_0xa9255a(0x14b)])?_0x5459d9[_0xa9255a(0x14b)]:{},_0x4f1972=_0x298c15[_0xf705dc]&&typeof _0x298c15[_0xf705dc]===_0xa9255a(0x167)&&!Array[_0xa9255a(0x144)](_0x298c15[_0xf705dc])?_0x298c15[_0xf705dc]:{};_0x4f1972['appcode']=_0x75edbc,_0x298c15[_0xf705dc]=_0x4f1972,_0x5459d9[_0xa9255a(0x14b)]=_0x298c15;}function deleteLocalAppAlias(_0x5f0280,_0x34fe1d){const _0x4fafb2=a22_0xca8a12;if(!_0x5f0280[_0x4fafb2(0x14b)]||typeof _0x5f0280[_0x4fafb2(0x14b)]!==_0x4fafb2(0x167)||Array['isArray'](_0x5f0280[_0x4fafb2(0x14b)]))return![];const _0x2d42b4=_0x5f0280['apps'],_0x4f4d2f=_0x2d42b4[_0x34fe1d[_0x4fafb2(0x12d)]];if(!_0x4f4d2f||typeof _0x4f4d2f!=='object'||Array[_0x4fafb2(0x144)](_0x4f4d2f))return![];if(!_0x34fe1d[_0x4fafb2(0x16c)])return delete _0x2d42b4[_0x34fe1d[_0x4fafb2(0x12d)]],!![];if(!(_0x34fe1d[_0x4fafb2(0x16c)]in _0x4f4d2f))return![];return delete _0x4f4d2f[_0x34fe1d['field']],Object['keys'](_0x4f4d2f)[_0x4fafb2(0x139)]===0x0&&delete _0x2d42b4[_0x34fe1d[_0x4fafb2(0x12d)]],!![];}const listDef={'service':a22_0xca8a12(0x160),'command':a22_0xca8a12(0x156),'description':a22_0xca8a12(0x162),'risk':a22_0xca8a12(0x143),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x3ea688){const _0x4ce00a=a22_0xca8a12,{buildConfigFromFlags:_0x331d13}=await import('../../context.js'),_0x8972ad=_0x331d13({}),_0x30ffe5=redactCliConfigCredentials(_0x8972ad['raw']),_0x49e6f7=getProjectConfigPath(),_0x75cde=resolveWriteConfigPath(_0x4ce00a(0x15d));if(_0x3ea688[_0x4ce00a(0x134)]===_0x4ce00a(0x14a))return{'ok':!![],'message':_0x4ce00a(0x15c)+(JSON['stringify'](_0x30ffe5,null,0x2)+'\x0a\x0a')+'Config\x20files:\x0a'+(_0x4ce00a(0x163)+(_0x49e6f7??'(none)')+'\x0a')+('\x20\x20global:\x20\x20'+_0x75cde)};return{'ok':!![],'data':{'effective':_0x30ffe5,'configFiles':{'project':_0x49e6f7??null,'global':_0x75cde}}};}},getDef={'service':a22_0xca8a12(0x160),'command':a22_0xca8a12(0x14e),'description':a22_0xca8a12(0x131),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a22_0xca8a12(0x164),'description':'Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','required':!![]}],'flags':[],async 'execute'(_0x50a71b){const _0x253d87=a22_0xca8a12,_0x1e8d2c=_0x50a71b[_0x253d87(0x149)][0x0];if(!_0x1e8d2c)throw CliErrors[_0x253d87(0x12e)](_0x253d87(0x161),_0x253d87(0x14f)+CLI_BIN_NAME+'\x20config\x20get\x20<key>');const {buildConfigFromFlags:_0x1906f6}=await import('../../context.js'),{raw:_0x192fce}=_0x1906f6({});if(_0x1e8d2c['includes']('.')){const _0x4f3f34=_0x1e8d2c[_0x253d87(0x15a)]('.');let _0x513579=_0x192fce;for(const _0x7c61a7 of _0x4f3f34){if(_0x513579==null||typeof _0x513579!==_0x253d87(0x167))throw CliErrors['validation'](_0x253d87(0x153)+_0x1e8d2c);_0x513579=_0x513579[_0x7c61a7];}if(_0x513579===undefined)throw CliErrors['validation'](_0x253d87(0x153)+_0x1e8d2c);const _0x2eb7c1=redactCliConfigValue(_0x1e8d2c,_0x513579);return console[_0x253d87(0x147)](typeof _0x2eb7c1===_0x253d87(0x167)?JSON['stringify'](_0x2eb7c1,null,0x2):String(_0x2eb7c1)),{'ok':!![]};}const _0x3c67b5=_0x192fce[_0x1e8d2c];if(_0x3c67b5===undefined)throw CliErrors['validation'](_0x253d87(0x153)+_0x1e8d2c);const _0x3dadfa=redactCliConfigValue(_0x1e8d2c,_0x3c67b5);return console['log'](typeof _0x3dadfa===_0x253d87(0x167)?JSON[_0x253d87(0x15b)](_0x3dadfa,null,0x2):String(_0x3dadfa)),{'ok':!![]};}},setDef={'service':'config','command':a22_0xca8a12(0x157),'description':'Set\x20a\x20configuration\x20value','risk':a22_0xca8a12(0x165),'confirmationDescription':a22_0xca8a12(0x152),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a22_0xca8a12(0x164),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a22_0xca8a12(0x135),'description':a22_0xca8a12(0x140),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x4c67fd){const _0x18a390=a22_0xca8a12,_0xcb1d88=_0x4c67fd[_0x18a390(0x149)][0x0],_0xfb9cd0=_0x4c67fd[_0x18a390(0x149)][0x1];if(!_0xcb1d88||_0xfb9cd0===undefined)throw CliErrors[_0x18a390(0x12e)](_0x18a390(0x13b),_0x18a390(0x14f)+CLI_BIN_NAME+'\x20config\x20set\x20<key>\x20<value>\x20[--global]');if(ENUM_KEYS[_0xcb1d88]&&!ENUM_KEYS[_0xcb1d88][_0x18a390(0x13a)](_0xfb9cd0))throw CliErrors[_0x18a390(0x12e)](_0x18a390(0x141)+_0xcb1d88+_0x18a390(0x150)+ENUM_KEYS[_0xcb1d88][_0x18a390(0x168)](',\x20'));if(isCliProtectedConfigKey(_0xcb1d88))throw CliErrors[_0x18a390(0x12e)]('\x22'+_0xcb1d88+_0x18a390(0x14c));if(_0xcb1d88===_0x18a390(0x13e)){const _0x295f85=Number(_0xfb9cd0);if(isNaN(_0x295f85)||_0x295f85<=0x0)throw CliErrors[_0x18a390(0x12e)]('pageSize\x20must\x20be\x20a\x20positive\x20number');}const _0x35fa1d=resolveWriteScope({'explicitGlobal':_0x4c67fd[_0x18a390(0x14d)](_0x18a390(0x15d)),'policy':_0x18a390(0x12c)}),_0x569356=toScopeFlags(_0x35fa1d),_0x276391=readScopedConfig(_0x569356),_0x282592=parseAliasAppcodeSetKey(_0xcb1d88);if(!_0x282592&&!isTopLevelConfigKey(_0xcb1d88))throw CliErrors[_0x18a390(0x12e)](_0x18a390(0x136)+_0xcb1d88+_0x18a390(0x155),'Settable\x20keys:\x20'+getTopLevelConfigKeySummary()+';\x20apps.<alias>.appcode');if(_0x282592)setLocalAppAlias(_0x276391,_0x282592,_0xfb9cd0);else{if(_0xcb1d88===_0x18a390(0x146)){const _0x226172=normalizeLocale(_0xfb9cd0);if(!_0x226172)throw CliErrors[_0x18a390(0x12e)](_0x18a390(0x16d),_0x18a390(0x169));_0x276391[_0x18a390(0x146)]=_0x226172;}else _0x276391[_0xcb1d88]=_0xcb1d88===_0x18a390(0x13e)?Number(_0xfb9cd0):DOMAIN_CONFIG_FIELDS['includes'](_0xcb1d88)?normalizeDomainOrigin(_0xcb1d88,_0xfb9cd0):_0xfb9cd0;}const _0x56dee3=_0xcb1d88===_0x18a390(0x145)?maskCliAccessKey(_0xfb9cd0):!_0x282592&&_0xcb1d88===_0x18a390(0x146)?String(_0x276391[_0x18a390(0x146)]):_0xfb9cd0;return console[_0x18a390(0x147)](_0x18a390(0x130)+_0xcb1d88+_0x18a390(0x12f)+_0x56dee3+'\x22'+(_0x35fa1d==='global'?_0x18a390(0x132):'')),writeScopedConfig(_0x276391,_0x569356),{'ok':!![]};}},deleteDef={'service':a22_0xca8a12(0x160),'command':'delete','description':a22_0xca8a12(0x142),'risk':a22_0xca8a12(0x165),'confirmationDescription':'Deletes\x20a\x20Lovrabet\x20CLI\x20config\x20key.\x20Later\x20commands\x20will\x20fall\x20back\x20to\x20another\x20config\x20layer\x20or\x20the\x20default.','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a22_0xca8a12(0x164),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x3ff409){const _0x5dcf4=a22_0xca8a12,_0x5ec587=_0x3ff409['args'][0x0];if(!_0x5ec587)throw CliErrors[_0x5dcf4(0x12e)]('Missing\x20key\x20argument.',_0x5dcf4(0x14f)+CLI_BIN_NAME+_0x5dcf4(0x148));if(isCliProtectedConfigKey(_0x5ec587))throw CliErrors[_0x5dcf4(0x12e)]('\x22'+_0x5ec587+_0x5dcf4(0x14c));const _0x40a9cb=resolveWriteScope({'explicitGlobal':_0x3ff409[_0x5dcf4(0x14d)]('global'),'policy':'project-or-global-explicit'}),_0x4cbe15=toScopeFlags(_0x40a9cb),_0x19b54b=readScopedConfig(_0x4cbe15),_0x1f2a73=parseAliasDeleteKey(_0x5ec587);if(_0x1f2a73){if(!deleteLocalAppAlias(_0x19b54b,_0x1f2a73))return console[_0x5dcf4(0x147)]('Key\x20already\x20absent:\x20'+_0x5ec587+(_0x40a9cb==='global'?_0x5dcf4(0x132):'')),{'ok':!![],'data':{'key':_0x5ec587,'scope':_0x40a9cb,'changed':![]}};return console[_0x5dcf4(0x147)](_0x5dcf4(0x15e)+_0x5ec587+'`'+(_0x40a9cb===_0x5dcf4(0x15d)?_0x5dcf4(0x132):'')),writeScopedConfig(_0x19b54b,_0x4cbe15),{'ok':!![],'data':{'key':_0x5ec587,'scope':_0x40a9cb,'changed':!![]}};}if(_0x19b54b[_0x5ec587]===undefined)return console[_0x5dcf4(0x147)](_0x5dcf4(0x15f)+_0x5ec587+(_0x40a9cb===_0x5dcf4(0x15d)?_0x5dcf4(0x132):'')),{'ok':!![],'data':{'key':_0x5ec587,'scope':_0x40a9cb,'changed':![]}};return delete _0x19b54b[_0x5ec587],console[_0x5dcf4(0x147)](_0x5dcf4(0x15e)+_0x5ec587+'`'+(_0x40a9cb===_0x5dcf4(0x15d)?_0x5dcf4(0x132):'')),writeScopedConfig(_0x19b54b,_0x4cbe15),{'ok':!![],'data':{'key':_0x5ec587,'scope':_0x40a9cb,'changed':!![]}};}};export const configDefinitions=[configInitDefinition,listDef,getDef,setDef,deleteDef];
|
|
1
|
+
const a22_0x55d1b1=a22_0x5bd8;(function(_0xfc86,_0x417315){const _0x35181c=a22_0x5bd8,_0x110a30=_0xfc86();while(!![]){try{const _0x22a77f=-parseInt(_0x35181c(0x14b))/0x1+-parseInt(_0x35181c(0x161))/0x2*(parseInt(_0x35181c(0x157))/0x3)+-parseInt(_0x35181c(0x14e))/0x4*(-parseInt(_0x35181c(0x146))/0x5)+-parseInt(_0x35181c(0x171))/0x6+-parseInt(_0x35181c(0x143))/0x7*(-parseInt(_0x35181c(0x13a))/0x8)+-parseInt(_0x35181c(0x16d))/0x9+-parseInt(_0x35181c(0x13e))/0xa*(-parseInt(_0x35181c(0x162))/0xb);if(_0x22a77f===_0x417315)break;else _0x110a30['push'](_0x110a30['shift']());}catch(_0x3cdb0e){_0x110a30['push'](_0x110a30['shift']());}}}(a22_0x39c9,0x58640));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isCliProtectedConfigKey,isTopLevelConfigKey,normalizeLocale,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';import{DOMAIN_CONFIG_FIELDS,normalizeDomainOrigin}from'../../config/domain-config.js';function a22_0x5bd8(_0x428bd6,_0x3dc0bb){_0x428bd6=_0x428bd6-0x132;const _0x39c947=a22_0x39c9();let _0x5bd892=_0x39c947[_0x428bd6];return _0x5bd892;}import{configInitDefinition}from'../../commands/config/init.js';import{GLOBAL_SCOPE_FLAG}from'../../commands/common/flags.js';import{maskCliAccessKey,redactCliConfigCredentials,redactCliConfigValue}from'../../utils/access-key-redaction.js';function parseAliasAppcodeSetKey(_0x2d6956){const _0x29f92b=a22_0x5bd8,_0xffc524=_0x2d6956[_0x29f92b(0x135)]('.');if(_0xffc524[_0x29f92b(0x13c)]!==0x3||_0xffc524[0x0]!=='apps'||_0xffc524[0x2]!=='appcode')return undefined;const _0x9ff13f=_0xffc524[0x1]?.[_0x29f92b(0x152)]();return _0x9ff13f?_0x9ff13f:undefined;}function parseAliasDeleteKey(_0x24ecd1){const _0xebe378=a22_0x5bd8,_0x4f4301=_0x24ecd1[_0xebe378(0x135)]('.');if(_0x4f4301[_0xebe378(0x13c)]===0x2&&_0x4f4301[0x0]==='apps'){const _0xb68e31=_0x4f4301[0x1]?.[_0xebe378(0x152)]();return _0xb68e31?{'alias':_0xb68e31}:undefined;}if(_0x4f4301[_0xebe378(0x13c)]===0x3&&_0x4f4301[0x0]===_0xebe378(0x149)&&_0x4f4301[0x2]===_0xebe378(0x165)){const _0x471bba=_0x4f4301[0x1]?.[_0xebe378(0x152)]();return _0x471bba?{'alias':_0x471bba,'field':_0xebe378(0x165)}:undefined;}return undefined;}function setLocalAppAlias(_0x15f232,_0x6cc884,_0x3925b5){const _0x3a38e9=a22_0x5bd8,_0x411dbc=_0x15f232[_0x3a38e9(0x149)]&&typeof _0x15f232[_0x3a38e9(0x149)]===_0x3a38e9(0x138)&&!Array[_0x3a38e9(0x15b)](_0x15f232['apps'])?_0x15f232[_0x3a38e9(0x149)]:{},_0x3aa13a=_0x411dbc[_0x6cc884]&&typeof _0x411dbc[_0x6cc884]===_0x3a38e9(0x138)&&!Array[_0x3a38e9(0x15b)](_0x411dbc[_0x6cc884])?_0x411dbc[_0x6cc884]:{};_0x3aa13a[_0x3a38e9(0x165)]=_0x3925b5,_0x411dbc[_0x6cc884]=_0x3aa13a,_0x15f232[_0x3a38e9(0x149)]=_0x411dbc;}function a22_0x39c9(){const _0x673033=['isArray','pageSize','Usage:\x20','\x22\x20is\x20protected\x20and\x20cannot\x20be\x20changed\x20via\x20config\x20commands.','delete','alias','950738NMrzwv','500676jjBaca','Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US','bool','appcode','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','write','locale','validation','\x20\x20global:\x20\x20','config','(none)','2486295Rollva','args','\x22\x20is\x20not\x20settable.','\x20config\x20delete\x20<key>\x20[--global]','2785254TbsQJf','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','Key\x20already\x20absent:\x20','Deletes\x20a\x20Lovrabet\x20CLI\x20config\x20key.\x20Later\x20commands\x20will\x20fall\x20back\x20to\x20another\x20config\x20layer\x20or\x20the\x20default.','split','\x20(global)','pageSize\x20must\x20be\x20a\x20positive\x20number','object','stringify','8THxXwK','\x22.\x20Allowed:\x20','length','List\x20current\x20config','300mPnYBb','Deleted\x20`','Key\x20not\x20found:\x20','Invalid\x20locale\x20value.',';\x20apps.<alias>.appcode','1712123xlBcqV','Invalid\x20value\x20for\x20\x22','global','10zXqTWi','includes','join','apps','`\x20=\x20\x22','87854znREks','log','get','111332RrjQDg','Config\x20files:\x0a','Missing\x20key\x20argument.','\x20\x20project:\x20','trim','Delete\x20a\x20configuration\x20value','Changes\x20Lovrabet\x20CLI\x20configuration.\x20Later\x20commands\x20may\x20use\x20a\x20different\x20app,\x20environment,\x20or\x20output\x20behavior.','field','keys','3YoOjoP','key','Value\x20to\x20assign','Top-level\x20key\x20\x22'];a22_0x39c9=function(){return _0x673033;};return a22_0x39c9();}function deleteLocalAppAlias(_0x4ff717,_0x5114c8){const _0x264dad=a22_0x5bd8;if(!_0x4ff717[_0x264dad(0x149)]||typeof _0x4ff717['apps']!==_0x264dad(0x138)||Array[_0x264dad(0x15b)](_0x4ff717['apps']))return![];const _0x12dee5=_0x4ff717[_0x264dad(0x149)],_0x1c2eda=_0x12dee5[_0x5114c8[_0x264dad(0x160)]];if(!_0x1c2eda||typeof _0x1c2eda!==_0x264dad(0x138)||Array[_0x264dad(0x15b)](_0x1c2eda))return![];if(!_0x5114c8['field'])return delete _0x12dee5[_0x5114c8[_0x264dad(0x160)]],!![];if(!(_0x5114c8[_0x264dad(0x155)]in _0x1c2eda))return![];return delete _0x1c2eda[_0x5114c8['field']],Object[_0x264dad(0x156)](_0x1c2eda)[_0x264dad(0x13c)]===0x0&&delete _0x12dee5[_0x5114c8['alias']],!![];}const listDef={'service':'config','command':'list','description':a22_0x55d1b1(0x13d),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x2db60e){const _0x3cfab4=a22_0x55d1b1,{buildConfigFromFlags:_0x4afbc0}=await import('../../context.js'),_0x558feb=_0x4afbc0({}),_0x2add09=redactCliConfigCredentials(_0x558feb['raw']),_0x1d3d30=getProjectConfigPath(),_0x36bc33=resolveWriteConfigPath(_0x3cfab4(0x145));if(_0x2db60e['format']==='pretty')return{'ok':!![],'message':_0x3cfab4(0x132)+(JSON[_0x3cfab4(0x139)](_0x2add09,null,0x2)+'\x0a\x0a')+_0x3cfab4(0x14f)+(_0x3cfab4(0x151)+(_0x1d3d30??_0x3cfab4(0x16c))+'\x0a')+(_0x3cfab4(0x16a)+_0x36bc33)};return{'ok':!![],'data':{'effective':_0x2add09,'configFiles':{'project':_0x1d3d30??null,'global':_0x36bc33}}};}},getDef={'service':'config','command':a22_0x55d1b1(0x14d),'description':'Get\x20a\x20config\x20value','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a22_0x55d1b1(0x158),'description':a22_0x55d1b1(0x166),'required':!![]}],'flags':[],async 'execute'(_0x36ec92){const _0x4cdb71=a22_0x55d1b1,_0x38a67f=_0x36ec92[_0x4cdb71(0x16e)][0x0];if(!_0x38a67f)throw CliErrors[_0x4cdb71(0x169)](_0x4cdb71(0x150),'Usage:\x20'+CLI_BIN_NAME+'\x20config\x20get\x20<key>');const {buildConfigFromFlags:_0xe924f6}=await import('../../context.js'),{raw:_0x12578c}=_0xe924f6({});if(_0x38a67f[_0x4cdb71(0x147)]('.')){const _0x20d3f2=_0x38a67f['split']('.');let _0xd21873=_0x12578c;for(const _0x22db69 of _0x20d3f2){if(_0xd21873==null||typeof _0xd21873!==_0x4cdb71(0x138))throw CliErrors[_0x4cdb71(0x169)](_0x4cdb71(0x140)+_0x38a67f);_0xd21873=_0xd21873[_0x22db69];}if(_0xd21873===undefined)throw CliErrors['validation'](_0x4cdb71(0x140)+_0x38a67f);const _0x32c1e6=redactCliConfigValue(_0x38a67f,_0xd21873);return console[_0x4cdb71(0x14c)](typeof _0x32c1e6===_0x4cdb71(0x138)?JSON[_0x4cdb71(0x139)](_0x32c1e6,null,0x2):String(_0x32c1e6)),{'ok':!![]};}const _0x11792c=_0x12578c[_0x38a67f];if(_0x11792c===undefined)throw CliErrors[_0x4cdb71(0x169)](_0x4cdb71(0x140)+_0x38a67f);const _0x272622=redactCliConfigValue(_0x38a67f,_0x11792c);return console['log'](typeof _0x272622===_0x4cdb71(0x138)?JSON[_0x4cdb71(0x139)](_0x272622,null,0x2):String(_0x272622)),{'ok':!![]};}},setDef={'service':a22_0x55d1b1(0x16b),'command':'set','description':'Set\x20a\x20configuration\x20value','risk':a22_0x55d1b1(0x167),'confirmationDescription':a22_0x55d1b1(0x154),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]},{'name':'value','description':a22_0x55d1b1(0x159),'required':!![]}],'flags':[GLOBAL_SCOPE_FLAG],async 'execute'(_0x136817){const _0x43c0df=a22_0x55d1b1,_0x8b9195=_0x136817[_0x43c0df(0x16e)][0x0],_0x1ee219=_0x136817[_0x43c0df(0x16e)][0x1];if(!_0x8b9195||_0x1ee219===undefined)throw CliErrors[_0x43c0df(0x169)]('Missing\x20key\x20or\x20value.',_0x43c0df(0x15d)+CLI_BIN_NAME+'\x20config\x20set\x20<key>\x20<value>\x20[--global]');if(ENUM_KEYS[_0x8b9195]&&!ENUM_KEYS[_0x8b9195][_0x43c0df(0x147)](_0x1ee219))throw CliErrors['validation'](_0x43c0df(0x144)+_0x8b9195+_0x43c0df(0x13b)+ENUM_KEYS[_0x8b9195][_0x43c0df(0x148)](',\x20'));if(isCliProtectedConfigKey(_0x8b9195))throw CliErrors[_0x43c0df(0x169)]('\x22'+_0x8b9195+'\x22\x20is\x20protected\x20and\x20cannot\x20be\x20changed\x20via\x20config\x20commands.');if(_0x8b9195===_0x43c0df(0x15c)){const _0x171df9=Number(_0x1ee219);if(isNaN(_0x171df9)||_0x171df9<=0x0)throw CliErrors[_0x43c0df(0x169)](_0x43c0df(0x137));}const _0x264c98=resolveWriteScope({'explicitGlobal':_0x136817[_0x43c0df(0x164)](_0x43c0df(0x145)),'policy':'project-or-global-explicit'}),_0x380306=toScopeFlags(_0x264c98),_0x153e19=readScopedConfig(_0x380306),_0x218c06=parseAliasAppcodeSetKey(_0x8b9195);if(!_0x218c06&&!isTopLevelConfigKey(_0x8b9195))throw CliErrors[_0x43c0df(0x169)](_0x43c0df(0x15a)+_0x8b9195+_0x43c0df(0x16f),'Settable\x20keys:\x20'+getTopLevelConfigKeySummary()+_0x43c0df(0x142));if(_0x218c06)setLocalAppAlias(_0x153e19,_0x218c06,_0x1ee219);else{if(_0x8b9195==='locale'){const _0x5f0809=normalizeLocale(_0x1ee219);if(!_0x5f0809)throw CliErrors[_0x43c0df(0x169)](_0x43c0df(0x141),_0x43c0df(0x163));_0x153e19[_0x43c0df(0x168)]=_0x5f0809;}else _0x153e19[_0x8b9195]=_0x8b9195===_0x43c0df(0x15c)?Number(_0x1ee219):DOMAIN_CONFIG_FIELDS['includes'](_0x8b9195)?normalizeDomainOrigin(_0x8b9195,_0x1ee219):_0x1ee219;}const _0x4a33ce=_0x8b9195==='accessKey'?maskCliAccessKey(_0x1ee219):!_0x218c06&&_0x8b9195===_0x43c0df(0x168)?String(_0x153e19['locale']):_0x1ee219;return console[_0x43c0df(0x14c)]('Set\x20`'+_0x8b9195+_0x43c0df(0x14a)+_0x4a33ce+'\x22'+(_0x264c98==='global'?_0x43c0df(0x136):'')),writeScopedConfig(_0x153e19,_0x380306),{'ok':!![]};}},deleteDef={'service':a22_0x55d1b1(0x16b),'command':a22_0x55d1b1(0x15f),'description':a22_0x55d1b1(0x153),'risk':a22_0x55d1b1(0x167),'confirmationDescription':a22_0x55d1b1(0x134),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a22_0x55d1b1(0x158),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_SCOPE_FLAG],async 'execute'(_0x42873d){const _0xe6964a=a22_0x55d1b1,_0x16f72a=_0x42873d['args'][0x0];if(!_0x16f72a)throw CliErrors[_0xe6964a(0x169)]('Missing\x20key\x20argument.','Usage:\x20'+CLI_BIN_NAME+_0xe6964a(0x170));if(isCliProtectedConfigKey(_0x16f72a))throw CliErrors['validation']('\x22'+_0x16f72a+_0xe6964a(0x15e));const _0x1be8cf=resolveWriteScope({'explicitGlobal':_0x42873d[_0xe6964a(0x164)](_0xe6964a(0x145)),'policy':'project-or-global-explicit'}),_0x3e9730=toScopeFlags(_0x1be8cf),_0x1b398d=readScopedConfig(_0x3e9730),_0x4732e2=parseAliasDeleteKey(_0x16f72a);if(_0x4732e2){if(!deleteLocalAppAlias(_0x1b398d,_0x4732e2))return console[_0xe6964a(0x14c)](_0xe6964a(0x133)+_0x16f72a+(_0x1be8cf===_0xe6964a(0x145)?_0xe6964a(0x136):'')),{'ok':!![],'data':{'key':_0x16f72a,'scope':_0x1be8cf,'changed':![]}};return console[_0xe6964a(0x14c)](_0xe6964a(0x13f)+_0x16f72a+'`'+(_0x1be8cf==='global'?_0xe6964a(0x136):'')),writeScopedConfig(_0x1b398d,_0x3e9730),{'ok':!![],'data':{'key':_0x16f72a,'scope':_0x1be8cf,'changed':!![]}};}if(_0x1b398d[_0x16f72a]===undefined)return console['log'](_0xe6964a(0x133)+_0x16f72a+(_0x1be8cf==='global'?_0xe6964a(0x136):'')),{'ok':!![],'data':{'key':_0x16f72a,'scope':_0x1be8cf,'changed':![]}};return delete _0x1b398d[_0x16f72a],console[_0xe6964a(0x14c)](_0xe6964a(0x13f)+_0x16f72a+'`'+(_0x1be8cf==='global'?'\x20(global)':'')),writeScopedConfig(_0x1b398d,_0x3e9730),{'ok':!![],'data':{'key':_0x16f72a,'scope':_0x1be8cf,'changed':!![]}};}};export const configDefinitions=[configInitDefinition,listDef,getDef,setDef,deleteDef];
|
|
@@ -5,8 +5,10 @@ export declare function executeConfigInit(ctx: RuntimeContext): Promise<{
|
|
|
5
5
|
message: string;
|
|
6
6
|
data: {
|
|
7
7
|
mode: string;
|
|
8
|
+
protocol: "lovrabet-routing/v1" | undefined;
|
|
8
9
|
region: "global" | "id" | "cn" | null;
|
|
9
|
-
domains: Partial<Record<"userDomain" | "runtimeDomain" | "skillDomain" | "kbDomain" | "
|
|
10
|
+
domains: Partial<Record<"userDomain" | "runtimeDomain" | "skillDomain" | "kbDomain" | "apiDomain", string>>;
|
|
11
|
+
cdn: import("../../config/domain-config.js").EnterpriseRoutingCdn | undefined;
|
|
10
12
|
};
|
|
11
13
|
}>;
|
|
12
14
|
export declare const configInitDefinition: CommandDefinition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a23_0x5982(_0x21a1bb,_0x46df8d){_0x21a1bb=_0x21a1bb-0xbf;const _0x72afeb=a23_0x72af();let _0x5982ec=_0x72afeb[_0x21a1bb];return _0x5982ec;}const a23_0x4deec6=a23_0x5982;(function(_0x3a6148,_0x1a70b5){const _0x2adf79=a23_0x5982,_0x4f456b=_0x3a6148();while(!![]){try{const _0x1f3443=parseInt(_0x2adf79(0xbf))/0x1*(parseInt(_0x2adf79(0xc1))/0x2)+parseInt(_0x2adf79(0xc3))/0x3+parseInt(_0x2adf79(0xd8))/0x4+-parseInt(_0x2adf79(0xdd))/0x5*(parseInt(_0x2adf79(0xc6))/0x6)+parseInt(_0x2adf79(0xe5))/0x7*(-parseInt(_0x2adf79(0xe7))/0x8)+parseInt(_0x2adf79(0xd1))/0x9+parseInt(_0x2adf79(0xda))/0xa;if(_0x1f3443===_0x1a70b5)break;else _0x4f456b['push'](_0x4f456b['shift']());}catch(_0x34540f){_0x4f456b['push'](_0x4f456b['shift']());}}}(a23_0x72af,0x4e65a));import{select}from'@inquirer/prompts';import{CliErrors}from'../../errors.js';import{readScopedConfig,writeScopedConfig}from'../../commands/config/shared.js';import{DOMAIN_CONFIG_FIELDS,LEGACY_DOMAIN_CONFIG_FIELDS,resolveDomainConfigInput}from'../../config/domain-config.js';import{ENTERPRISE_ROUTING_KIND,ENTERPRISE_ROUTING_PROTOCOL}from'../../generated/routing-contract.js';import{DEFAULT_LOVRABET_REGION,ENABLED_LOVRABET_REGION_VALUES,isEnabledLovrabetRegion}from'../../constant/region.js';import{OFFICIAL_ROUTING_PROFILES}from'../../generated/official-routing.js';const domainFlags=[{'name':a23_0x4deec6(0xe8),'type':a23_0x4deec6(0xde),'description':'Independent-deployment\x20Domain\x20JSON\x20file'},{'name':a23_0x4deec6(0xe3),'type':a23_0x4deec6(0xde),'description':a23_0x4deec6(0xe9)},{'name':a23_0x4deec6(0xd6),'type':'string','description':a23_0x4deec6(0xc8)},{'name':a23_0x4deec6(0xee),'type':a23_0x4deec6(0xde),'description':'Custom\x20Runtime\x20HTTPS\x20origin'},{'name':a23_0x4deec6(0xd9),'type':'string','description':'Custom\x20SkillHub\x20HTTPS\x20origin'},{'name':a23_0x4deec6(0xce),'type':a23_0x4deec6(0xde),'description':'Custom\x20knowledge-base\x20HTTPS\x20origin'}];export const configInitFlags=[{'name':a23_0x4deec6(0xd7),'type':a23_0x4deec6(0xde),'description':a23_0x4deec6(0xcc)+ENABLED_LOVRABET_REGION_VALUES[a23_0x4deec6(0xcb)](',\x20'),'enum':[...ENABLED_LOVRABET_REGION_VALUES]},...domainFlags];async function resolveRegion(_0x487296){const _0x2d5450=a23_0x4deec6,_0x51673c=_0x487296[_0x2d5450(0xdf)](_0x2d5450(0xd7));if(_0x51673c){if(!isEnabledLovrabetRegion(_0x51673c))throw CliErrors[_0x2d5450(0xc0)]('Region\x20\x22'+_0x51673c+_0x2d5450(0xc9),_0x2d5450(0xcf)+ENABLED_LOVRABET_REGION_VALUES[_0x2d5450(0xcb)](',\x20'));return _0x51673c;}if(_0x487296[_0x2d5450(0xd2)])return DEFAULT_LOVRABET_REGION;try{return await select({'message':_0x2d5450(0xea),'default':DEFAULT_LOVRABET_REGION,'choices':ENABLED_LOVRABET_REGION_VALUES[_0x2d5450(0xcd)](_0x29bf74=>({'name':OFFICIAL_ROUTING_PROFILES[_0x29bf74][_0x2d5450(0xeb)]+'\x20('+_0x29bf74+')','value':_0x29bf74}))});}catch(_0x4685e5){if(_0x4685e5?.[_0x2d5450(0xca)]==='ExitPromptError')throw CliErrors[_0x2d5450(0xe6)]();throw _0x4685e5;}}export async function executeConfigInit(_0x16ab17){const _0x533a72=a23_0x4deec6,_0x5ba47d=resolveDomainConfigInput(_0x16ab17),_0x35eb68=_0x5ba47d['domains'],_0x4270ca=Object[_0x533a72(0xed)](_0x35eb68)[_0x533a72(0xd5)]>0x0;if(_0x4270ca&&_0x16ab17[_0x533a72(0xdf)](_0x533a72(0xd7)))throw CliErrors[_0x533a72(0xc0)](_0x533a72(0xec));const _0x22d1a8={'global':!![]},_0x18e9b8=readScopedConfig(_0x22d1a8);for(const _0x16ab6c of DOMAIN_CONFIG_FIELDS)delete _0x18e9b8[_0x16ab6c];for(const _0x3fd9af of LEGACY_DOMAIN_CONFIG_FIELDS)delete _0x18e9b8[_0x3fd9af];delete _0x18e9b8[_0x533a72(0xc4)];let _0x38c239=null;if(_0x4270ca)delete _0x18e9b8['region'],_0x5ba47d[_0x533a72(0xd0)]==='enterprise-v1'?_0x18e9b8['routing']={'protocol':ENTERPRISE_ROUTING_PROTOCOL,'kind':ENTERPRISE_ROUTING_KIND,'domains':_0x5ba47d[_0x533a72(0xe2)],'cdn':_0x5ba47d[_0x533a72(0xe1)]}:Object[_0x533a72(0xd3)](_0x18e9b8,_0x35eb68);else{_0x38c239=await resolveRegion(_0x16ab17);if(_0x38c239===DEFAULT_LOVRABET_REGION)delete _0x18e9b8[_0x533a72(0xd7)];else _0x18e9b8['region']=_0x38c239;}return writeScopedConfig(_0x18e9b8,_0x22d1a8),{'ok':!![],'message':_0x4270ca?'Lovrabet\x20connection\x20configured\x20for\x20independent\x20deployment.\x20Domains:\x20'+Object[_0x533a72(0xed)](_0x5ba47d[_0x533a72(0xd0)]===_0x533a72(0xc2)?_0x5ba47d[_0x533a72(0xe2)]:_0x35eb68)[_0x533a72(0xcb)](',\x20')+'.':_0x533a72(0xef)+_0x38c239+'.','data':{'mode':_0x4270ca?_0x533a72(0xc7):_0x533a72(0xe4),'protocol':_0x5ba47d[_0x533a72(0xd0)]===_0x533a72(0xc2)?ENTERPRISE_ROUTING_PROTOCOL:undefined,'region':_0x38c239,'domains':_0x35eb68,'cdn':_0x5ba47d['mode']==='enterprise-v1'?_0x5ba47d[_0x533a72(0xe1)]:undefined}};}export const configInitDefinition={'service':a23_0x4deec6(0xdc),'command':a23_0x4deec6(0xe0),'description':a23_0x4deec6(0xd4),'risk':a23_0x4deec6(0xc5),'confirmationDescription':a23_0x4deec6(0xdb),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':configInitFlags,'execute':executeConfigInit};function a23_0x72af(){const _0x5232dc=['59010Nhewgo','enterprise-v1','362271HQlpxm','routing','write','107538GwzKYi','independent','Custom\x20platform\x20API\x20HTTPS\x20origin','\x22\x20is\x20not\x20currently\x20available.','name','join','Official\x20Lovrabet\x20region:\x20','map','kb-domain','Available\x20regions:\x20','mode','671076PnKLmp','nonInteractive','assign','Initialize\x20the\x20global\x20Lovrabet\x20region\x20or\x20independent-deployment\x20Domains','length','api-domain','region','393696aoKaLW','skill-domain','8688880iQoWBG','Updates\x20the\x20global\x20Lovrabet\x20region\x20or\x20independent-deployment\x20Domain\x20configuration.\x20AccessKey,\x20output\x20format,\x20and\x20app\x20bindings\x20stay\x20unchanged.','config','155ZegHhb','string','str','init','cdn','manifestDomains','user-domain','official','21lcffjs','cancelled','998456qHcPHI','domain-config','Custom\x20User\x20HTTPS\x20origin','Select\x20Lovrabet\x20region','label','Choose\x20either\x20an\x20official\x20region\x20or\x20independent-deployment\x20Domains,\x20not\x20both.','keys','runtime-domain','Lovrabet\x20connection\x20configured\x20for\x20region:\x20','3MPXFqC','validation'];a23_0x72af=function(){return _0x5232dc;};return a23_0x72af();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x369e9e,_0x2e6317){var _0x5a47eb=a24_0x3697,_0x572f96=_0x369e9e();while(!![]){try{var _0x4f0889=-parseInt(_0x5a47eb(0xea))/0x1*(-parseInt(_0x5a47eb(0xec))/0x2)+-parseInt(_0x5a47eb(0xee))/0x3+parseInt(_0x5a47eb(0xf0))/0x4*(parseInt(_0x5a47eb(0xeb))/0x5)+parseInt(_0x5a47eb(0xe9))/0x6*(parseInt(_0x5a47eb(0xef))/0x7)+-parseInt(_0x5a47eb(0xf1))/0x8+-parseInt(_0x5a47eb(0xed))/0x9+parseInt(_0x5a47eb(0xf2))/0xa;if(_0x4f0889===_0x2e6317)break;else _0x572f96['push'](_0x572f96['shift']());}catch(_0x5a4338){_0x572f96['push'](_0x572f96['shift']());}}}(a24_0x22d9,0x53495));function a24_0x3697(_0x93ea8c,_0x1cc25e){_0x93ea8c=_0x93ea8c-0xe9;var _0x22d983=a24_0x22d9();var _0x3697c6=_0x22d983[_0x93ea8c];return _0x3697c6;}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,isCliProtectedConfigKey,isTopLevelConfigKey,normalizeLocale,toScopeFlags}from'../../commands/common/config-policy.js';function a24_0x22d9(){var _0x38f1ef=['4452792rhdOCI','6072190PAYgIf','276UYplFS','3897lWfbYC','10FYjmbs','202gtoUxz','2605824obVosu','1141104yoEliH','32599CXcfNL','705212lvYzvw'];a24_0x22d9=function(){return _0x38f1ef;};return a24_0x22d9();}
|