@lovrabet/lovrabet-cli 2.3.1-beta.2 → 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 +2 -0
- 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 +33 -1
- 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 -3
- 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 +33 -10
- package/skills/lovrabet/references/lovrabet-config.md +8 -20
- 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_0x47434d=a11_0x35bb;(function(_0x1aeceb,_0x22b670){const _0x1788df=a11_0x35bb,_0x5ded8e=_0x1aeceb();while(!![]){try{const _0x3eeff5=parseInt(_0x1788df(0x165))/0x1+-parseInt(_0x1788df(0x160))/0x2*(-parseInt(_0x1788df(0x16b))/0x3)+-parseInt(_0x1788df(0x190))/0x4*(-parseInt(_0x1788df(0x19f))/0x5)+parseInt(_0x1788df(0x1a1))/0x6*(-parseInt(_0x1788df(0x185))/0x7)+parseInt(_0x1788df(0x164))/0x8+-parseInt(_0x1788df(0x1a0))/0x9+-parseInt(_0x1788df(0x19e))/0xa;if(_0x3eeff5===_0x22b670)break;else _0x5ded8e['push'](_0x5ded8e['shift']());}catch(_0x3c5dcc){_0x5ded8e['push'](_0x5ded8e['shift']());}}}(a11_0x3cf0,0x394e4));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';function a11_0x35bb(_0x22ea92,_0x5928c2){_0x22ea92=_0x22ea92-0x15c;const _0x3cf05a=a11_0x3cf0();let _0x35bb3a=_0x3cf05a[_0x22ea92];return _0x35bb3a;}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(_0x4d7d4d){const _0x451c38=a11_0x35bb;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x4d7d4d['bool'](_0x451c38(0x179)),'explicitProject':_0x4d7d4d[_0x451c38(0x19a)](_0x451c38(0x162)),'policy':_0x451c38(0x186)}));}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(){const _0x49b610=a11_0x35bb;return crypto[_0x49b610(0x166)]();}export function buildDeviceAuthUrl(_0x46dd1f,_0x32efab,_0x36f57e='lovrabet-cli'){const _0x45feb6=a11_0x35bb;return _0x46dd1f+'/device-auth?code='+encodeURIComponent(_0x32efab)+_0x45feb6(0x18d)+encodeURIComponent(_0x36f57e);}export function getDeviceCodePath(){const _0x88fde3=a11_0x35bb;return homedir()+'/'+PRODUCT_CONFIG[_0x88fde3(0x15c)]+'/.device-auth';}export function readStoredDeviceCode(){const _0x590074=a11_0x35bb,_0x3383bb=getDeviceCodePath();if(!existsSync(_0x3383bb))return null;try{const _0x3243a6=readFileSync(_0x3383bb,{'encoding':_0x590074(0x192)}),_0x3da0f7=JSON['parse'](_0x3243a6);if(_0x3da0f7&&typeof _0x3da0f7[_0x590074(0x16d)]===_0x590074(0x193)&&typeof _0x3da0f7['createdAt']==='string'&&(_0x3da0f7[_0x590074(0x197)]===_0x590074(0x179)||_0x3da0f7['scope']===_0x590074(0x162)))return _0x3da0f7;}catch{}return null;}export function writeStoredDeviceCode(_0x442b21,_0x4c9f6c){const _0x2c3707=a11_0x35bb,_0x208d03=getDeviceCodePath(),_0x4d329a=dirname(_0x208d03);!existsSync(_0x4d329a)&&mkdirSync(_0x4d329a,{'recursive':!![]});const _0x4b05d2={'code':_0x442b21,'createdAt':new Date()[_0x2c3707(0x19c)](),'scope':_0x4c9f6c};writeFileSync(_0x208d03,JSON[_0x2c3707(0x191)](_0x4b05d2),{'encoding':_0x2c3707(0x192),'mode':0x180});}export function deleteStoredDeviceCode(){const _0x9411d3=getDeviceCodePath();try{unlinkSync(_0x9411d3);}catch{}}export function isStoredDeviceCodeExpired(_0x4a4f7a){const _0x37a5a7=a11_0x35bb;return Date['now']()-new Date(_0x4a4f7a[_0x37a5a7(0x15d)])['getTime']()>DEVICE_CODE_TTL_MS;}export async function fetchDeviceToken(_0x5279b9,_0xbdfed7){const _0x48d651=a11_0x35bb,_0xf724bb=_0x5279b9+_0x48d651(0x17c),_0x9eb3d2=new AbortController(),_0x4eb5ed=setTimeout(()=>_0x9eb3d2[_0x48d651(0x188)](),0x2710),_0x4ed9f3=await fetch(_0xf724bb,{'method':'POST','headers':{'Content-Type':_0x48d651(0x176)},'body':JSON[_0x48d651(0x191)]({'code':_0xbdfed7}),'signal':_0x9eb3d2['signal']});clearTimeout(_0x4eb5ed);if(!_0x4ed9f3['ok'])throw CliErrors[_0x48d651(0x163)](_0x48d651(0x18e)+_0x4ed9f3[_0x48d651(0x178)]);const _0x5e7636=await _0x4ed9f3[_0x48d651(0x17d)](),_0x18a871=_0x5e7636['data']&&typeof _0x5e7636['data']===_0x48d651(0x182)?_0x5e7636[_0x48d651(0x175)]:_0x5e7636;if(!_0x18a871||typeof _0x18a871[_0x48d651(0x178)]!==_0x48d651(0x193))throw CliErrors[_0x48d651(0x1a2)]('Invalid\x20device\x20auth\x20response');return{'status':_0x18a871[_0x48d651(0x178)],'access_key':typeof _0x18a871[_0x48d651(0x15f)]===_0x48d651(0x193)?_0x18a871[_0x48d651(0x15f)]:undefined};}export async function pollDeviceToken(_0xedf2ad,_0x465ea1,_0x4c0453){const _0x40a622=a11_0x35bb;let _0x369a81=0x0;for(let _0x436c65=0x0;_0x436c65<MAX_POLLS;_0x436c65++){if(_0x4c0453['aborted'])throw CliErrors[_0x40a622(0x17f)](_0x40a622(0x187));let _0x3ad757;try{_0x3ad757=await fetchDeviceToken(_0xedf2ad,_0x465ea1);}catch(_0x1270a9){if(_0x1270a9 instanceof Error&&_0x1270a9[_0x40a622(0x194)]===_0x40a622(0x174))throw CliErrors['cancelled']('Device\x20authorization\x20cancelled.');_0x369a81++;if(_0x369a81>=MAX_CONSECUTIVE_NETWORK_ERRORS)throw CliErrors[_0x40a622(0x163)](_0x40a622(0x1a3));writeCliSideChannelLine(_0x40a622(0x196)+_0x369a81+'/'+MAX_CONSECUTIVE_NETWORK_ERRORS+_0x40a622(0x180)),await sleep(POLL_INTERVAL_MS);continue;}_0x369a81=0x0;if(_0x3ad757[_0x40a622(0x178)]===_0x40a622(0x183)){if(!_0x3ad757[_0x40a622(0x15f)])throw CliErrors[_0x40a622(0x1a2)](_0x40a622(0x177));return _0x3ad757[_0x40a622(0x15f)];}if(_0x3ad757[_0x40a622(0x178)]===_0x40a622(0x18a)){deleteStoredDeviceCode();throw CliErrors[_0x40a622(0x16e)](_0x40a622(0x199));}const _0x140d91=(_0x436c65+0x1)*POLL_INTERVAL_MS,_0x49aaf7=DEVICE_CODE_TTL_MS-_0x140d91,_0x4424b3=Math['floor'](_0x49aaf7/0xea60),_0x50ee78=Math[_0x40a622(0x17b)](_0x49aaf7%0xea60/0x3e8);process[_0x40a622(0x16c)][_0x40a622(0x16a)]('\x0dWaiting\x20for\x20authorization...\x20'+_0x4424b3+':'+String(_0x50ee78)[_0x40a622(0x16f)](0x2,'0')+_0x40a622(0x181)),await sleep(POLL_INTERVAL_MS);}deleteStoredDeviceCode();throw CliErrors['validation'](_0x40a622(0x17a));}function sleep(_0x5da3a0){return new Promise(_0x131287=>setTimeout(_0x131287,_0x5da3a0));}function a11_0x3cf0(){const _0x141be0=['application/json','Invalid\x20access_key\x20returned\x20by\x20server.','status','global','Device\x20authorization\x20timed\x20out\x20after\x2010\x20minutes.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','floor','/api/device-auth/token','json','lovrabet-cli','cancelled','),\x20retrying...','\x20remaining','object','success','Device\x20authorization\x20successful.','21TQAgWe','global-default','Device\x20authorization\x20cancelled.','abort','Authorize\x20with\x20the\x20device-code\x20flow\x20(complete\x20in\x20the\x20browser;\x20no\x20copy-paste\x20required)','expired','boolean','Open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20authorize:','&source=','Device\x20auth\x20API\x20returned\x20HTTP\x20','The\x20device\x20code\x20is\x20valid\x20for\x2010\x20minutes.','16tlOmyR','stringify','utf8','string','name','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.','Device\x20auth\x20API\x20error\x20(','scope','once','Device\x20code\x20expired.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','bool','auth','toISOString','signal','2155570jAkgJF','368345ZoYBMn','1690686AjNOSS','849474fhoFZK','apiError','Device\x20auth\x20API\x20unreachable\x20after\x20multiple\x20retries.','After\x20authorizing,\x20re-run:\x20','Write\x20to\x20project\x20config','homeDirName','createdAt','trim','access_key','28894xmbbPg','\x20config.','project','networkError','3619280MdJffw','286892NOdnJB','randomUUID','nonInteractive','App\x20name\x20shown\x20on\x20authorization\x20page\x20(default:\x20lovrabet)','accessKey','write','6caBEBV','stderr','code','validation','padStart','Print\x20URL\x20to\x20stdout\x20and\x20exit\x20(for\x20WorkBuddy\x20integration)','url-only','SIGINT','removeListener','AbortError','data'];a11_0x3cf0=function(){return _0x141be0;};return a11_0x3cf0();}export const authDeviceDefinition={'service':a11_0x47434d(0x19b),'command':'device','description':a11_0x47434d(0x189),'risk':'write','confirmationDescription':a11_0x47434d(0x195),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a11_0x47434d(0x179),'type':a11_0x47434d(0x18b),'description':'Write\x20to\x20global\x20config\x20(default)','default':!![]},{'name':a11_0x47434d(0x162),'type':a11_0x47434d(0x18b),'description':a11_0x47434d(0x1a5),'default':![]},{'name':'source','type':a11_0x47434d(0x193),'description':a11_0x47434d(0x168),'default':a11_0x47434d(0x17e)},{'name':a11_0x47434d(0x171),'type':'boolean','description':a11_0x47434d(0x170),'default':![]}],async 'execute'(_0x132508){const _0x270eb9=a11_0x47434d,_0x302111=resolveAuthScopeFlags(_0x132508),_0x16ed56=_0x302111[_0x270eb9(0x179)]?_0x270eb9(0x179):_0x270eb9(0x162),_0x4c47d2=readScopedConfig(_0x302111);if(_0x4c47d2[_0x270eb9(0x169)])return{'ok':!![],'message':'Already\x20authorized.\x20Use\x20`lovrabet\x20auth\x20status`\x20to\x20verify.'};const _0x244cec=(_0x132508['str']('source')||_0x270eb9(0x17e))[_0x270eb9(0x15e)](),_0x31a80f=getUserDomain(),_0x127d03=readStoredDeviceCode(),_0xd8bd1a=_0x127d03&&!isStoredDeviceCodeExpired(_0x127d03)?_0x127d03[_0x270eb9(0x16d)]:((()=>{const _0x268f2e=generateDeviceCode();return writeStoredDeviceCode(_0x268f2e,_0x16ed56),_0x268f2e;})()),_0x40d5ed=buildDeviceAuthUrl(_0x31a80f,_0xd8bd1a,_0x244cec);if(_0x132508[_0x270eb9(0x19a)](_0x270eb9(0x171)))return console['log'](_0x40d5ed),{'ok':!![]};writeCliSideChannelLine(_0x270eb9(0x18c)),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x40d5ed),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x270eb9(0x18f));if(_0x132508[_0x270eb9(0x167)])return writeCliSideChannelLine(_0x270eb9(0x1a4)+CLI_BIN_NAME+'\x20auth\x20device'),{'ok':!![],'message':'Device\x20authorization\x20URL\x20printed.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20re-run.'};writeCliSideChannelLine('Waiting\x20for\x20authorization\x20(timeout:\x2010\x20minutes,\x20Ctrl+C\x20to\x20cancel)...');const _0x162176=new AbortController(),_0x2b207f=()=>{const _0x2638b6=_0x270eb9;_0x162176[_0x2638b6(0x188)](),process['removeListener'](_0x2638b6(0x172),_0x2b207f);};process[_0x270eb9(0x198)](_0x270eb9(0x172),_0x2b207f);let _0x539b47;try{_0x539b47=await pollDeviceToken(_0x31a80f,_0xd8bd1a,_0x162176[_0x270eb9(0x19d)]);}finally{process[_0x270eb9(0x173)]('SIGINT',_0x2b207f);}if(!ACCESS_KEY_PATTERN['test'](_0x539b47))throw CliErrors[_0x270eb9(0x1a2)]('Invalid\x20access_key\x20returned\x20by\x20server.');const _0x3191a7=readScopedConfig(_0x302111);return _0x3191a7[_0x270eb9(0x169)]=_0x539b47,writeScopedConfig(_0x3191a7,_0x302111),deleteStoredDeviceCode(),process[_0x270eb9(0x16c)][_0x270eb9(0x16a)]('\x0a'),writeCliSideChannelLine('AccessKey\x20saved\x20to\x20'+_0x16ed56+_0x270eb9(0x161)),writeCliSideChannelLine('Verify:\x20'+CLI_BIN_NAME+'\x20auth\x20status'),{'ok':!![],'message':_0x270eb9(0x184)};}};
|
|
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_0x4fae24=a12_0x3c48;(function(_0x428987,_0x8d798c){const _0x48447f=a12_0x3c48,_0x188fca=_0x428987();while(!![]){try{const _0x4f3d85=-parseInt(_0x48447f(0x1ed))/0x1*(-parseInt(_0x48447f(0x1e3))/0x2)+parseInt(_0x48447f(0x1d3))/0x3+-parseInt(_0x48447f(0x1d8))/0x4*(parseInt(_0x48447f(0x1be))/0x5)+parseInt(_0x48447f(0x1f7))/0x6+parseInt(_0x48447f(0x1f0))/0x7+-parseInt(_0x48447f(0x1e2))/0x8*(-parseInt(_0x48447f(0x206))/0x9)+parseInt(_0x48447f(0x20a))/0xa;if(_0x4f3d85===_0x8d798c)break;else _0x188fca['push'](_0x188fca['shift']());}catch(_0x35195c){_0x188fca['push'](_0x188fca['shift']());}}}(a12_0x2641,0xce8a9));function a12_0x2641(){const _0x1fbb10=['yes','\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`','AccessKey\x20cleared\x20from\x20','Auth\x20mode:\x20','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','\x20(via\x20','login','global','accessKeyCreatePath','264071FqFVeL','Device\x20authorization\x20pending.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20try\x20again.','No\x20AccessKey\x20found\x20in\x20','10540859FkAqhO','Status:\x20valid','Save\x20the\x20AccessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20the\x20project\x20file)','check','Write\x20to\x20global\x20config\x20(default)','str','ClientAk','1931916HiruBm','join','Option\x20A:\x20','auth','nonInteractive','info','Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','daily','\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]','\x20env\x20var','global\x20config','write','Use\x20`','Show\x20current\x20authentication\x20status','Clear\x20from\x20global\x20config\x20(default)','83259jyJNbL','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','stdin','read','1630870rgbBFF','access-key','\x20config.','\x20\x20export\x20','validation','\x20Verify:\x20','development','Missing\x20accessKey.','Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','env','Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20','authRequired','5qnlQPA','ACCESS_KEY','success','expired','Option\x20C:\x20environment\x20variable','userCenterDisplayName','status','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.','push','AccessKey:\x20','\x20auth\x20login\x20--access-key\x20<ak_xxx>','boolean','AccessKey\x20saved\x20to\x20','code','accessKey','stdout','project','isTTY','string','Then\x20verify\x20with:\x20','access_key','180672mvrQjf','bool','=ak_xxx','Clear\x20the\x20AccessKey\x20from\x20config','scope','6283892AqIyJk','Invalid\x20accessKey\x20format.','Read\x20from\x20global\x20config\x20(default)','trim','\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.','test','newConfigFileName','production','\x20config','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars','88burkYU','2WriEzx'];a12_0x2641=function(){return _0x1fbb10;};return a12_0x2641();}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(_0x1cfb53=USER_ACCESS_KEY_CREATE_URL){const _0x12752d=a12_0x3c48;writeCliSideChannelLine('AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20'+PRODUCT_CONFIG[_0x12752d(0x1c3)]+':'),writeCliSideChannelLine('\x0a'+_0x1cfb53+'\x0a'),writeCliSideChannelLine('Tip:\x20you\x20can\x20also\x20run:'),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x12752d(0x1c8));}function buildAccessKeySetupGuide(_0x549fa4=USER_ACCESS_KEY_CREATE_URL){const _0x476d6a=a12_0x3c48;return[_0x476d6a(0x207)+PRODUCT_CONFIG[_0x476d6a(0x1c3)]+':',_0x549fa4,_0x476d6a(0x1bc)+CLI_BIN_NAME+_0x476d6a(0x1ba)][_0x476d6a(0x1f8)]('\x0a');}function a12_0x3c48(_0x31274e,_0x56133b){_0x31274e=_0x31274e-0x1b6;const _0x2641f1=a12_0x2641();let _0x3c489c=_0x2641f1[_0x31274e];return _0x3c489c;}function canPromptForAccessKey(_0x491aa4){const _0x42eff0=a12_0x3c48;return!_0x491aa4[_0x42eff0(0x1fb)]&&process[_0x42eff0(0x208)][_0x42eff0(0x1cf)]!==![]&&process[_0x42eff0(0x1cd)][_0x42eff0(0x1cf)]!==![];}function resolveAuthScopeFlags(_0x5eef85){const _0x337349=a12_0x3c48;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x5eef85[_0x337349(0x1d4)](_0x337349(0x1eb)),'explicitProject':_0x5eef85['bool'](_0x337349(0x1ce)),'policy':'global-default'}));}async function resolveAuthWriteInput(_0x37e6f2){const _0x2d14a2=a12_0x3c48;let _0x17c22f=(_0x37e6f2[_0x2d14a2(0x1f5)](_0x2d14a2(0x20b))||_0x37e6f2[_0x2d14a2(0x1f5)]('ak')||'')[_0x2d14a2(0x1db)]();const _0xae7aba=(_0x37e6f2['str'](_0x2d14a2(0x1bb))||'')[_0x2d14a2(0x1db)](),_0x2b3005=''+getUserDomain()+PRODUCT_CONFIG[_0x2d14a2(0x1ec)];if(!_0x17c22f&&canPromptForAccessKey(_0x37e6f2))try{showAccessKeyCreateHint(_0x2b3005),_0x17c22f=await promptAccessKey('');}catch(_0x17186d){if(isAbortPrompt(_0x17186d))throw CliErrors['cancelled']();throw _0x17186d;}if(!_0x17c22f)throw CliErrors[_0x2d14a2(0x20e)](_0x2d14a2(0x1b8),buildAccessKeySetupGuide(_0x2b3005));if(!ACCESS_KEY_PATTERN[_0x2d14a2(0x1dd)](_0x17c22f))throw CliErrors[_0x2d14a2(0x20e)](_0x2d14a2(0x1d9),_0x2d14a2(0x1e1));if(!_0xae7aba)return{'accessKey':_0x17c22f};const _0x470caa=normalizeEnv(_0xae7aba);return{'accessKey':_0x17c22f,'env':isDaily(_0x470caa)?_0x2d14a2(0x1fe):isDev(_0x470caa)?_0x2d14a2(0x1b7):_0x2d14a2(0x1df)};}export const authDefinitions=[{'service':a12_0x4fae24(0x1fa),'command':a12_0x4fae24(0x1ea),'description':a12_0x4fae24(0x1f2),'risk':a12_0x4fae24(0x202),'confirmationDescription':a12_0x4fae24(0x1c5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x4fae24(0x20b),'type':a12_0x4fae24(0x1d0),'description':'AccessKey\x20(ak_xxx...)'},{'name':'ak','type':a12_0x4fae24(0x1d0),'description':'Shorthand\x20for\x20--access-key'},{'name':a12_0x4fae24(0x1eb),'type':'boolean','description':a12_0x4fae24(0x1f4),'default':!![]},{'name':a12_0x4fae24(0x1ce),'type':a12_0x4fae24(0x1c9),'description':'Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]}],async 'execute'(_0x3fab88){const _0x557cd9=a12_0x4fae24;if(_0x3fab88['bool'](_0x557cd9(0x1e4)))throw CliErrors['validation']('`auth\x20login`\x20does\x20not\x20support\x20--yes.',_0x557cd9(0x203)+CLI_BIN_NAME+_0x557cd9(0x1e5)+CLI_BIN_NAME+_0x557cd9(0x1dc));const _0x15cb9f=(_0x3fab88['str']('access-key')||_0x3fab88[_0x557cd9(0x1f5)]('ak')||'')[_0x557cd9(0x1db)]();if(!_0x15cb9f&&_0x3fab88[_0x557cd9(0x1fb)])return{'ok':!![],'message':buildAccessKeySetupGuide(''+getUserDomain()+PRODUCT_CONFIG['accessKeyCreatePath'])};const _0xbbfb20=await resolveAuthWriteInput(_0x3fab88),_0x45b00d=resolveAuthScopeFlags(_0x3fab88),_0xd7fb99=readScopedConfig(_0x45b00d);_0xd7fb99['accessKey']=_0xbbfb20[_0x557cd9(0x1cc)];_0xbbfb20[_0x557cd9(0x1bb)]&&(_0xd7fb99['env']=_0xbbfb20['env']);writeScopedConfig(_0xd7fb99,_0x45b00d);const _0x55d5cd=_0x45b00d[_0x557cd9(0x1eb)]?_0x557cd9(0x1eb):_0x557cd9(0x1ce),_0x20706b=_0xd7fb99['env']?'\x20Current\x20env:\x20'+_0xd7fb99['env']+'.':'';return{'ok':!![],'message':_0x557cd9(0x1ca)+_0x55d5cd+_0x557cd9(0x20c)+_0x20706b+_0x557cd9(0x1b6)+CLI_BIN_NAME+'\x20auth\x20status'};}},{'service':a12_0x4fae24(0x1fa),'command':'logout','description':a12_0x4fae24(0x1d6),'risk':a12_0x4fae24(0x202),'confirmationDescription':'Removes\x20the\x20AccessKey\x20from\x20the\x20selected\x20Lovrabet\x20config.\x20Commands\x20that\x20need\x20that\x20key\x20will\x20require\x20login\x20again.','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'global','type':a12_0x4fae24(0x1c9),'description':a12_0x4fae24(0x205),'default':!![]},{'name':a12_0x4fae24(0x1ce),'type':a12_0x4fae24(0x1c9),'description':a12_0x4fae24(0x1b9),'default':![]}],async 'execute'(_0x55e611){const _0x1f43ac=a12_0x4fae24,_0x185db1=resolveAuthScopeFlags(_0x55e611),_0x17b3b9=readScopedConfig(_0x185db1),_0x3d3314=!!_0x17b3b9['accessKey'];delete _0x17b3b9[_0x1f43ac(0x1cc)],writeScopedConfig(_0x17b3b9,_0x185db1);const _0x1ece7f=_0x185db1[_0x1f43ac(0x1eb)]?'global':'project';if(_0x3d3314)return{'ok':!![],'message':_0x1f43ac(0x1e6)+_0x1ece7f+_0x1f43ac(0x20c)};return{'ok':!![],'message':_0x1f43ac(0x1ef)+_0x1ece7f+'\x20config.\x20Nothing\x20to\x20clear.'};}},{'service':'auth','command':a12_0x4fae24(0x1c4),'description':a12_0x4fae24(0x204),'risk':a12_0x4fae24(0x209),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x4fae24(0x1eb),'type':a12_0x4fae24(0x1c9),'description':a12_0x4fae24(0x1da),'default':!![]},{'name':a12_0x4fae24(0x1ce),'type':'boolean','description':a12_0x4fae24(0x1fd),'default':![]},{'name':a12_0x4fae24(0x1f3),'type':a12_0x4fae24(0x1c9),'description':'Exit\x20non-zero\x20when\x20no\x20AccessKey\x20is\x20configured','default':![]}],async 'execute'(_0xb37003){const _0x3b337d=a12_0x4fae24,_0x1400c6=resolveAuthScopeFlags(_0xb37003),_0x2e03ef=readScopedConfig(_0x1400c6),_0x5d2773=productEnvName(_0x3b337d(0x1bf)),_0x20c947=productEnv(_0x3b337d(0x1bf))||undefined,_0x258269=_0x2e03ef[_0x3b337d(0x1cc)]||undefined,_0x260d37=_0x20c947||_0x258269,_0x32a40a=_0x20c947?_0x5d2773+_0x3b337d(0x200):_0x258269?(_0x1400c6[_0x3b337d(0x1eb)]?_0x3b337d(0x1eb):_0x3b337d(0x1ce))+_0x3b337d(0x1e0):null,_0x301a86=[_0x3b337d(0x1e7)+AUTH_MODE[_0x3b337d(0x1f6)]];if(_0x260d37){const _0x368cb2=maskCliAccessKey(_0x260d37);_0x301a86['push'](_0x3b337d(0x1c7)+_0x368cb2+(_0x32a40a?_0x3b337d(0x1e9)+_0x32a40a+')':'')),_0x301a86[_0x3b337d(0x1c6)](_0x3b337d(0x1f1));}if(!_0x260d37){_0x301a86[_0x3b337d(0x1c6)](''),_0x301a86['push']('No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:'),_0x301a86[_0x3b337d(0x1c6)](''),_0x301a86[_0x3b337d(0x1c6)](_0x3b337d(0x1f9)+CLI_BIN_NAME+_0x3b337d(0x1ff)),_0x301a86['push'](''),_0x301a86[_0x3b337d(0x1c6)]('Option\x20B:\x20apps\x20config\x20('+PRODUCT_CONFIG[_0x3b337d(0x1de)]+')'),_0x301a86[_0x3b337d(0x1c6)](_0x3b337d(0x1e8)),_0x301a86[_0x3b337d(0x1c6)](''),_0x301a86[_0x3b337d(0x1c6)](_0x3b337d(0x1c2)),_0x301a86[_0x3b337d(0x1c6)](_0x3b337d(0x20d)+_0x5d2773+_0x3b337d(0x1d5)),_0x301a86[_0x3b337d(0x1c6)](''),_0x301a86[_0x3b337d(0x1c6)](_0x3b337d(0x1d1)+CLI_BIN_NAME+'\x20auth\x20status'),_0x301a86['push']('If\x20command\x20execution\x20still\x20fails,\x20run:\x20'+CLI_BIN_NAME+'\x20doctor');if(_0xb37003['bool'](_0x3b337d(0x1f3))){const _0x3f5914=readStoredDeviceCode();if(_0x3f5914&&!isStoredDeviceCodeExpired(_0x3f5914)){const _0x39b1cd=getUserDomain(),_0x575ea7=await fetchDeviceToken(_0x39b1cd,_0x3f5914[_0x3b337d(0x1cb)]);if(_0x575ea7[_0x3b337d(0x1c4)]===_0x3b337d(0x1c0)&&_0x575ea7[_0x3b337d(0x1d2)]){const _0x54f366={'global':_0x3f5914[_0x3b337d(0x1d7)]===_0x3b337d(0x1eb)},_0x61dc47=readScopedConfig(_0x54f366);_0x61dc47['accessKey']=_0x575ea7[_0x3b337d(0x1d2)],writeScopedConfig(_0x61dc47,_0x54f366),deleteStoredDeviceCode();const _0x225b91=_0x575ea7[_0x3b337d(0x1d2)],_0x408641=maskCliAccessKey(_0x225b91),_0x3adedd=_0x3f5914[_0x3b337d(0x1d7)]===_0x3b337d(0x1eb)?_0x3b337d(0x201):'project\x20config';return{'ok':!![],'message':[_0x3b337d(0x1e7)+AUTH_MODE['ClientAk'],_0x3b337d(0x1c7)+_0x408641+_0x3b337d(0x1e9)+_0x3adedd+')',_0x3b337d(0x1f1)][_0x3b337d(0x1f8)]('\x0a')};}_0x575ea7[_0x3b337d(0x1c4)]===_0x3b337d(0x1c1)&&deleteStoredDeviceCode();throw CliErrors[_0x3b337d(0x1bd)](_0x3b337d(0x1ee));}throw CliErrors['authRequired'](_0x301a86[_0x3b337d(0x1f8)]('\x0a'));}}return{'ok':!![],'message':_0x301a86['join']('\x0a')};}},{'service':a12_0x4fae24(0x1fa),'command':a12_0x4fae24(0x1fc),'description':'Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','risk':'read','requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x2cd86c){const _0x26f033=a12_0x4fae24,_0x5b44d1=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x5b44d1,'meta':{'env':_0x2cd86c['envName']??_0x26f033(0x1df)}}};}},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
|
-
(function(
|
|
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
|
-
|
|
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
|
-
(function(
|
|
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_0x3898b3=a22_0x1d7e;(function(_0x4df7fe,_0x183e50){const _0x998809=a22_0x1d7e,_0x145c29=_0x4df7fe();while(!![]){try{const _0x24738a=parseInt(_0x998809(0x150))/0x1+-parseInt(_0x998809(0x17a))/0x2*(parseInt(_0x998809(0x16f))/0x3)+-parseInt(_0x998809(0x13a))/0x4+-parseInt(_0x998809(0x154))/0x5*(-parseInt(_0x998809(0x14d))/0x6)+-parseInt(_0x998809(0x16e))/0x7*(-parseInt(_0x998809(0x16d))/0x8)+parseInt(_0x998809(0x155))/0x9*(parseInt(_0x998809(0x14f))/0xa)+-parseInt(_0x998809(0x141))/0xb*(parseInt(_0x998809(0x180))/0xc);if(_0x24738a===_0x183e50)break;else _0x145c29['push'](_0x145c29['shift']());}catch(_0x27c209){_0x145c29['push'](_0x145c29['shift']());}}}(a22_0x2f89,0x23837));function a22_0x2f89(){const _0x11b7f9=['2080210DsIooD','\x20(global)','log','appcode','\x20\x20project:\x20','args','pageSize','value','apps','Value\x20to\x20assign','Deleted\x20`','split','402924xrTZQg','Usage:\x20','126190TsQzYh','232215HPXptJ','Write\x20to\x20global\x20config','Invalid\x20locale\x20value.','write','15PhSanY','18ANCaaZ','../../context.js','\x22\x20is\x20protected\x20and\x20cannot\x20be\x20changed\x20via\x20config\x20commands.','delete','includes','raw','field','(none)','read','Get\x20a\x20config\x20value','trim','Key\x20not\x20found:\x20','pretty','Deletes\x20a\x20Lovrabet\x20CLI\x20config\x20key.\x20Later\x20commands\x20will\x20fall\x20back\x20to\x20another\x20config\x20layer\x20or\x20the\x20default.','pageSize\x20must\x20be\x20a\x20positive\x20number','keys','locale','alias','\x20\x20global:\x20\x20','length','bool','`\x20=\x20\x22','Delete\x20a\x20configuration\x20value','list','1054952QIPXGT','7PQTHSH','91524RdOSkM','Set\x20`','List\x20current\x20config','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US','validation','config','Set\x20a\x20configuration\x20value','key','Config\x20files:\x0a','accessKey','4LxdBIV','\x22.\x20Allowed:\x20','Settable\x20keys:\x20','get','object',';\x20apps.<alias>.appcode','12DoKAsB','Missing\x20key\x20argument.','global','780780rpuuPa','isArray','Key\x20already\x20absent:\x20','Top-level\x20key\x20\x22','stringify','project-or-global-explicit','\x20config\x20set\x20<key>\x20<value>\x20[--global]'];a22_0x2f89=function(){return _0x11b7f9;};return a22_0x2f89();}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';import{configInitDefinition}from'../../commands/config/init.js';import{maskCliAccessKey,redactCliConfigCredentials,redactCliConfigValue}from'../../utils/access-key-redaction.js';const GLOBAL_FLAG={'name':'global','type':'boolean','description':a22_0x3898b3(0x151),'default':![]};function parseAliasAppcodeSetKey(_0x20ec01){const _0x231bb6=a22_0x3898b3,_0x3df048=_0x20ec01[_0x231bb6(0x14c)]('.');if(_0x3df048[_0x231bb6(0x168)]!==0x3||_0x3df048[0x0]!=='apps'||_0x3df048[0x2]!==_0x231bb6(0x144))return undefined;const _0x5267eb=_0x3df048[0x1]?.[_0x231bb6(0x15f)]();return _0x5267eb?_0x5267eb:undefined;}function parseAliasDeleteKey(_0x2ceb52){const _0xacbe61=a22_0x3898b3,_0x26e618=_0x2ceb52[_0xacbe61(0x14c)]('.');if(_0x26e618[_0xacbe61(0x168)]===0x2&&_0x26e618[0x0]===_0xacbe61(0x149)){const _0x3f604d=_0x26e618[0x1]?.[_0xacbe61(0x15f)]();return _0x3f604d?{'alias':_0x3f604d}:undefined;}if(_0x26e618[_0xacbe61(0x168)]===0x3&&_0x26e618[0x0]==='apps'&&_0x26e618[0x2]==='appcode'){const _0x3732b5=_0x26e618[0x1]?.['trim']();return _0x3732b5?{'alias':_0x3732b5,'field':_0xacbe61(0x144)}:undefined;}return undefined;}function setLocalAppAlias(_0x2d4798,_0x208234,_0x21cae8){const _0x324eb8=a22_0x3898b3,_0x3d700f=_0x2d4798['apps']&&typeof _0x2d4798[_0x324eb8(0x149)]===_0x324eb8(0x17e)&&!Array['isArray'](_0x2d4798[_0x324eb8(0x149)])?_0x2d4798[_0x324eb8(0x149)]:{},_0x301d9f=_0x3d700f[_0x208234]&&typeof _0x3d700f[_0x208234]===_0x324eb8(0x17e)&&!Array[_0x324eb8(0x13b)](_0x3d700f[_0x208234])?_0x3d700f[_0x208234]:{};_0x301d9f[_0x324eb8(0x144)]=_0x21cae8,_0x3d700f[_0x208234]=_0x301d9f,_0x2d4798[_0x324eb8(0x149)]=_0x3d700f;}function a22_0x1d7e(_0x50f5b0,_0x344a7f){_0x50f5b0=_0x50f5b0-0x138;const _0x2f8916=a22_0x2f89();let _0x1d7e80=_0x2f8916[_0x50f5b0];return _0x1d7e80;}function deleteLocalAppAlias(_0x37a479,_0x262304){const _0x39243e=a22_0x3898b3;if(!_0x37a479[_0x39243e(0x149)]||typeof _0x37a479[_0x39243e(0x149)]!==_0x39243e(0x17e)||Array[_0x39243e(0x13b)](_0x37a479[_0x39243e(0x149)]))return![];const _0x37fd50=_0x37a479['apps'],_0x359b68=_0x37fd50[_0x262304[_0x39243e(0x166)]];if(!_0x359b68||typeof _0x359b68!==_0x39243e(0x17e)||Array['isArray'](_0x359b68))return![];if(!_0x262304['field'])return delete _0x37fd50[_0x262304[_0x39243e(0x166)]],!![];if(!(_0x262304['field']in _0x359b68))return![];return delete _0x359b68[_0x262304[_0x39243e(0x15b)]],Object[_0x39243e(0x164)](_0x359b68)[_0x39243e(0x168)]===0x0&&delete _0x37fd50[_0x262304[_0x39243e(0x166)]],!![];}const listDef={'service':a22_0x3898b3(0x175),'command':a22_0x3898b3(0x16c),'description':a22_0x3898b3(0x171),'risk':a22_0x3898b3(0x15d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x29ed26){const _0x32b8bc=a22_0x3898b3,{buildConfigFromFlags:_0x4967b9}=await import(_0x32b8bc(0x156)),_0x5f072f=_0x4967b9({}),_0x56016e=redactCliConfigCredentials(_0x5f072f[_0x32b8bc(0x15a)]),_0x1bb644=getProjectConfigPath(),_0x418901=resolveWriteConfigPath('global');if(_0x29ed26['format']===_0x32b8bc(0x161))return{'ok':!![],'message':'#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a'+(JSON[_0x32b8bc(0x13e)](_0x56016e,null,0x2)+'\x0a\x0a')+_0x32b8bc(0x178)+(_0x32b8bc(0x145)+(_0x1bb644??_0x32b8bc(0x15c))+'\x0a')+(_0x32b8bc(0x167)+_0x418901)};return{'ok':!![],'data':{'effective':_0x56016e,'configFiles':{'project':_0x1bb644??null,'global':_0x418901}}};}},getDef={'service':a22_0x3898b3(0x175),'command':a22_0x3898b3(0x17d),'description':a22_0x3898b3(0x15e),'risk':a22_0x3898b3(0x15d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':a22_0x3898b3(0x172),'required':!![]}],'flags':[],async 'execute'(_0x5632fc){const _0x1c12c6=a22_0x3898b3,_0x4663b5=_0x5632fc['args'][0x0];if(!_0x4663b5)throw CliErrors[_0x1c12c6(0x174)](_0x1c12c6(0x138),_0x1c12c6(0x14e)+CLI_BIN_NAME+'\x20config\x20get\x20<key>');const {buildConfigFromFlags:_0x279fa0}=await import(_0x1c12c6(0x156)),{raw:_0x1383de}=_0x279fa0({});if(_0x4663b5[_0x1c12c6(0x159)]('.')){const _0x156a1e=_0x4663b5[_0x1c12c6(0x14c)]('.');let _0x233ff3=_0x1383de;for(const _0x3423b0 of _0x156a1e){if(_0x233ff3==null||typeof _0x233ff3!==_0x1c12c6(0x17e))throw CliErrors[_0x1c12c6(0x174)]('Key\x20not\x20found:\x20'+_0x4663b5);_0x233ff3=_0x233ff3[_0x3423b0];}if(_0x233ff3===undefined)throw CliErrors[_0x1c12c6(0x174)](_0x1c12c6(0x160)+_0x4663b5);const _0x1178e4=redactCliConfigValue(_0x4663b5,_0x233ff3);return console[_0x1c12c6(0x143)](typeof _0x1178e4===_0x1c12c6(0x17e)?JSON[_0x1c12c6(0x13e)](_0x1178e4,null,0x2):String(_0x1178e4)),{'ok':!![]};}const _0x57c314=_0x1383de[_0x4663b5];if(_0x57c314===undefined)throw CliErrors[_0x1c12c6(0x174)](_0x1c12c6(0x160)+_0x4663b5);const _0x1cba5b=redactCliConfigValue(_0x4663b5,_0x57c314);return console[_0x1c12c6(0x143)](typeof _0x1cba5b===_0x1c12c6(0x17e)?JSON['stringify'](_0x1cba5b,null,0x2):String(_0x1cba5b)),{'ok':!![]};}},setDef={'service':a22_0x3898b3(0x175),'command':'set','description':a22_0x3898b3(0x176),'risk':a22_0x3898b3(0x153),'confirmationDescription':'Changes\x20Lovrabet\x20CLI\x20configuration.\x20Later\x20commands\x20may\x20use\x20a\x20different\x20app,\x20environment,\x20or\x20output\x20behavior.','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a22_0x3898b3(0x177),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a22_0x3898b3(0x148),'description':a22_0x3898b3(0x14a),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x5ac161){const _0x3b8cb8=a22_0x3898b3,_0x30cf6c=_0x5ac161[_0x3b8cb8(0x146)][0x0],_0x16d1b5=_0x5ac161['args'][0x1];if(!_0x30cf6c||_0x16d1b5===undefined)throw CliErrors[_0x3b8cb8(0x174)]('Missing\x20key\x20or\x20value.','Usage:\x20'+CLI_BIN_NAME+_0x3b8cb8(0x140));if(ENUM_KEYS[_0x30cf6c]&&!ENUM_KEYS[_0x30cf6c][_0x3b8cb8(0x159)](_0x16d1b5))throw CliErrors[_0x3b8cb8(0x174)]('Invalid\x20value\x20for\x20\x22'+_0x30cf6c+_0x3b8cb8(0x17b)+ENUM_KEYS[_0x30cf6c]['join'](',\x20'));if(isCliProtectedConfigKey(_0x30cf6c))throw CliErrors[_0x3b8cb8(0x174)]('\x22'+_0x30cf6c+'\x22\x20is\x20protected\x20and\x20cannot\x20be\x20changed\x20via\x20config\x20commands.');if(_0x30cf6c===_0x3b8cb8(0x147)){const _0x256813=Number(_0x16d1b5);if(isNaN(_0x256813)||_0x256813<=0x0)throw CliErrors[_0x3b8cb8(0x174)](_0x3b8cb8(0x163));}const _0x48e9a4=resolveWriteScope({'explicitGlobal':_0x5ac161[_0x3b8cb8(0x169)](_0x3b8cb8(0x139)),'policy':_0x3b8cb8(0x13f)}),_0x8d5e85=toScopeFlags(_0x48e9a4),_0x5b45af=readScopedConfig(_0x8d5e85),_0x4a354b=parseAliasAppcodeSetKey(_0x30cf6c);if(!_0x4a354b&&!isTopLevelConfigKey(_0x30cf6c))throw CliErrors[_0x3b8cb8(0x174)](_0x3b8cb8(0x13d)+_0x30cf6c+'\x22\x20is\x20not\x20settable.',_0x3b8cb8(0x17c)+getTopLevelConfigKeySummary()+_0x3b8cb8(0x17f));if(_0x4a354b)setLocalAppAlias(_0x5b45af,_0x4a354b,_0x16d1b5);else{if(_0x30cf6c===_0x3b8cb8(0x165)){const _0x21b482=normalizeLocale(_0x16d1b5);if(!_0x21b482)throw CliErrors[_0x3b8cb8(0x174)](_0x3b8cb8(0x152),_0x3b8cb8(0x173));_0x5b45af['locale']=_0x21b482;}else _0x5b45af[_0x30cf6c]=_0x30cf6c===_0x3b8cb8(0x147)?Number(_0x16d1b5):DOMAIN_CONFIG_FIELDS[_0x3b8cb8(0x159)](_0x30cf6c)?normalizeDomainOrigin(_0x30cf6c,_0x16d1b5):_0x16d1b5;}const _0x5429df=_0x30cf6c===_0x3b8cb8(0x179)?maskCliAccessKey(_0x16d1b5):!_0x4a354b&&_0x30cf6c===_0x3b8cb8(0x165)?String(_0x5b45af['locale']):_0x16d1b5;return console[_0x3b8cb8(0x143)](_0x3b8cb8(0x170)+_0x30cf6c+_0x3b8cb8(0x16a)+_0x5429df+'\x22'+(_0x48e9a4===_0x3b8cb8(0x139)?'\x20(global)':'')),writeScopedConfig(_0x5b45af,_0x8d5e85),{'ok':!![]};}},deleteDef={'service':'config','command':a22_0x3898b3(0x158),'description':a22_0x3898b3(0x16b),'risk':a22_0x3898b3(0x153),'confirmationDescription':a22_0x3898b3(0x162),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a22_0x3898b3(0x177),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x28e9e8){const _0xacf633=a22_0x3898b3,_0x3bdf78=_0x28e9e8[_0xacf633(0x146)][0x0];if(!_0x3bdf78)throw CliErrors[_0xacf633(0x174)](_0xacf633(0x138),'Usage:\x20'+CLI_BIN_NAME+'\x20config\x20delete\x20<key>\x20[--global]');if(isCliProtectedConfigKey(_0x3bdf78))throw CliErrors[_0xacf633(0x174)]('\x22'+_0x3bdf78+_0xacf633(0x157));const _0x500789=resolveWriteScope({'explicitGlobal':_0x28e9e8[_0xacf633(0x169)](_0xacf633(0x139)),'policy':'project-or-global-explicit'}),_0x119458=toScopeFlags(_0x500789),_0x4ed6e3=readScopedConfig(_0x119458),_0xfd0f18=parseAliasDeleteKey(_0x3bdf78);if(_0xfd0f18){if(!deleteLocalAppAlias(_0x4ed6e3,_0xfd0f18))return console[_0xacf633(0x143)](_0xacf633(0x13c)+_0x3bdf78+(_0x500789===_0xacf633(0x139)?_0xacf633(0x142):'')),{'ok':!![],'data':{'key':_0x3bdf78,'scope':_0x500789,'changed':![]}};return console[_0xacf633(0x143)](_0xacf633(0x14b)+_0x3bdf78+'`'+(_0x500789===_0xacf633(0x139)?_0xacf633(0x142):'')),writeScopedConfig(_0x4ed6e3,_0x119458),{'ok':!![],'data':{'key':_0x3bdf78,'scope':_0x500789,'changed':!![]}};}if(_0x4ed6e3[_0x3bdf78]===undefined)return console[_0xacf633(0x143)](_0xacf633(0x13c)+_0x3bdf78+(_0x500789===_0xacf633(0x139)?_0xacf633(0x142):'')),{'ok':!![],'data':{'key':_0x3bdf78,'scope':_0x500789,'changed':![]}};return delete _0x4ed6e3[_0x3bdf78],console[_0xacf633(0x143)](_0xacf633(0x14b)+_0x3bdf78+'`'+(_0x500789===_0xacf633(0x139)?_0xacf633(0x142):'')),writeScopedConfig(_0x4ed6e3,_0x119458),{'ok':!![],'data':{'key':_0x3bdf78,'scope':_0x500789,'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
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
|
-
const
|
|
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();}
|