@lovrabet/lovrabet-cli 2.3.4-beta.1 → 2.3.4-beta.2
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 +8 -6
- 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/approval/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.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 +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/domain-config.d.ts +2 -2
- package/lib/config/domain-config.js +1 -1
- package/lib/config/schema.d.ts +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.d.ts +4 -0
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/region.d.ts +1 -1
- 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.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-search-client.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.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 +12 -3
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.d.ts +2 -2
- package/lib/generated/routing-contract.js +1 -1
- 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.d.ts +5 -0
- 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/positive-safe-integer.js +1 -1
- package/lib/utils/redaction.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/lovrabet/SKILL.md +2 -2
- package/skills/lovrabet/guides/troubleshooting.md +1 -1
- package/skills/lovrabet/references/lovrabet-config-commands.md +8 -7
- package/skills/lovrabet/references/lovrabet-config.md +3 -2
- package/skills/lovrabet/references/lovrabet-doctor.md +1 -1
- package/skills/lovrabet/references/lovrabet-kb-workflow.md +8 -6
- package/skills/lovrabet/references/lovrabet-service-tree.md +1 -1
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const a12_0xf94840=a12_0x2b81;(function(_0x3d77f6,_0x2ee3ad){const _0x3e7df1=a12_0x2b81,_0x3d5b05=_0x3d77f6();while(!![]){try{const _0x2381b4=-parseInt(_0x3e7df1(0x181))/0x1+-parseInt(_0x3e7df1(0x18c))/0x2+parseInt(_0x3e7df1(0x1ae))/0x3*(-parseInt(_0x3e7df1(0x1af))/0x4)+parseInt(_0x3e7df1(0x1bf))/0x5+parseInt(_0x3e7df1(0x1c0))/0x6+parseInt(_0x3e7df1(0x1c9))/0x7+parseInt(_0x3e7df1(0x196))/0x8*(parseInt(_0x3e7df1(0x1c4))/0x9);if(_0x2381b4===_0x2ee3ad)break;else _0x3d5b05['push'](_0x3d5b05['shift']());}catch(_0x3c60fc){_0x3d5b05['push'](_0x3d5b05['shift']());}}}(a12_0x13e6,0xdb1c7));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(_0x1e1de6){const _0x4b2202=a12_0x2b81;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x1e1de6[_0x4b2202(0x1bb)]('global'),'explicitProject':_0x1e1de6[_0x4b2202(0x1bb)](_0x4b2202(0x1b6)),'policy':'global-default'}));}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 _0x104741=a12_0x2b81;return crypto[_0x104741(0x1a2)]();}export function buildDeviceAuthUrl(_0x4f9136,_0x1e8509,_0x3e2ad2='lovrabet-cli'){return _0x4f9136+'/device-auth?code='+encodeURIComponent(_0x1e8509)+'&source='+encodeURIComponent(_0x3e2ad2);}export function getDeviceCodePath(){return homedir()+'/'+PRODUCT_CONFIG['homeDirName']+'/.device-auth';}export function readStoredDeviceCode(){const _0x2f6e01=a12_0x2b81,_0x4a7700=getDeviceCodePath();if(!existsSync(_0x4a7700))return null;try{const _0x1f4f33=readFileSync(_0x4a7700,{'encoding':_0x2f6e01(0x1b0)}),_0x831a01=JSON['parse'](_0x1f4f33);if(_0x831a01&&typeof _0x831a01[_0x2f6e01(0x17f)]===_0x2f6e01(0x1a6)&&typeof _0x831a01[_0x2f6e01(0x191)]===_0x2f6e01(0x1a6)&&(_0x831a01['scope']==='global'||_0x831a01[_0x2f6e01(0x1be)]===_0x2f6e01(0x1b6)))return _0x831a01;}catch{}return null;}function a12_0x13e6(){const _0x5df2c8=['now','aborted','Open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20authorize:','Device\x20auth\x20API\x20unreachable\x20after\x20multiple\x20retries.','url-only','Device\x20authorization\x20successful.','apiError','\x20auth\x20device','2484678mDloVC','abort','auth','expired','\x20remaining','createdAt','The\x20device\x20code\x20is\x20valid\x20for\x2010\x20minutes.','source','once','getTime','148792rxXsbe','nonInteractive','write','Device\x20auth\x20API\x20error\x20(','SIGINT','stderr','/api/device-auth/token','\x20auth\x20status','Device\x20authorization\x20cancelled.','\x20config.','stringify','access_key','randomUUID','Authorize\x20with\x20the\x20device-code\x20flow\x20(complete\x20in\x20the\x20browser;\x20no\x20copy-paste\x20required)','object','networkError','string','Device\x20auth\x20API\x20returned\x20HTTP\x20','App\x20name\x20shown\x20on\x20authorization\x20page\x20(default:\x20lovrabet)','data','validation','After\x20authorizing,\x20re-run:\x20','global','trim','2170263dWOSGJ','4RrNRjM','utf8','Device\x20authorization\x20timed\x20out\x20after\x2010\x20minutes.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','Device\x20authorization\x20URL\x20printed.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20re-run.','POST','cancelled','toISOString','project','Invalid\x20device\x20auth\x20response','log','application/json','str','bool','Write\x20to\x20global\x20config\x20(default)','success','scope','582005NNenaD','6352032QgGgOW','Already\x20authorized.\x20Use\x20`lovrabet\x20auth\x20status`\x20to\x20verify.','removeListener','padStart','801rKlkEN','floor','boolean','test','signal','2696302nxUiUT','Device\x20code\x20expired.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','lovrabet-cli','json','status','Write\x20to\x20project\x20config','name','code','Invalid\x20access_key\x20returned\x20by\x20server.','352331KHWGRw','AbortError','Verify:\x20'];a12_0x13e6=function(){return _0x5df2c8;};return a12_0x13e6();}export function writeStoredDeviceCode(_0x4b1aab,_0x433ac2){const _0x34e0d0=a12_0x2b81,_0x4425b7=getDeviceCodePath(),_0x354d97=dirname(_0x4425b7);!existsSync(_0x354d97)&&mkdirSync(_0x354d97,{'recursive':!![]});const _0x22c88f={'code':_0x4b1aab,'createdAt':new Date()[_0x34e0d0(0x1b5)](),'scope':_0x433ac2};writeFileSync(_0x4425b7,JSON[_0x34e0d0(0x1a0)](_0x22c88f),{'encoding':_0x34e0d0(0x1b0),'mode':0x180});}function a12_0x2b81(_0x1fe60d,_0x4eb490){_0x1fe60d=_0x1fe60d-0x179;const _0x13e678=a12_0x13e6();let _0x2b8130=_0x13e678[_0x1fe60d];return _0x2b8130;}export function deleteStoredDeviceCode(){const _0x55f188=getDeviceCodePath();try{unlinkSync(_0x55f188);}catch{}}export function isStoredDeviceCodeExpired(_0xd7d767){const _0x476465=a12_0x2b81;return Date[_0x476465(0x184)]()-new Date(_0xd7d767[_0x476465(0x191)])[_0x476465(0x195)]()>DEVICE_CODE_TTL_MS;}export async function fetchDeviceToken(_0x3d4a67,_0x14595d){const _0x23d69a=a12_0x2b81,_0x3560bb=_0x3d4a67+_0x23d69a(0x19c),_0xaea16d=new AbortController(),_0x47f3a0=setTimeout(()=>_0xaea16d[_0x23d69a(0x18d)](),0x2710),_0x97fce0=await fetch(_0x3560bb,{'method':_0x23d69a(0x1b3),'headers':{'Content-Type':_0x23d69a(0x1b9)},'body':JSON[_0x23d69a(0x1a0)]({'code':_0x14595d}),'signal':_0xaea16d[_0x23d69a(0x1c8)]});clearTimeout(_0x47f3a0);if(!_0x97fce0['ok'])throw CliErrors['networkError'](_0x23d69a(0x1a7)+_0x97fce0[_0x23d69a(0x17c)]);const _0xb264a6=await _0x97fce0[_0x23d69a(0x17b)](),_0x49d4d1=_0xb264a6[_0x23d69a(0x1a9)]&&typeof _0xb264a6['data']===_0x23d69a(0x1a4)?_0xb264a6['data']:_0xb264a6;if(!_0x49d4d1||typeof _0x49d4d1[_0x23d69a(0x17c)]!=='string')throw CliErrors[_0x23d69a(0x18a)](_0x23d69a(0x1b7));return{'status':_0x49d4d1[_0x23d69a(0x17c)],'access_key':typeof _0x49d4d1[_0x23d69a(0x1a1)]===_0x23d69a(0x1a6)?_0x49d4d1[_0x23d69a(0x1a1)]:undefined};}export async function pollDeviceToken(_0x459db1,_0x196f6c,_0x4cf6f5){const _0x155e6b=a12_0x2b81;let _0x31417a=0x0;for(let _0x16a018=0x0;_0x16a018<MAX_POLLS;_0x16a018++){if(_0x4cf6f5[_0x155e6b(0x185)])throw CliErrors[_0x155e6b(0x1b4)](_0x155e6b(0x19e));let _0x5deead;try{_0x5deead=await fetchDeviceToken(_0x459db1,_0x196f6c);}catch(_0x412bfa){if(_0x412bfa instanceof Error&&_0x412bfa[_0x155e6b(0x17e)]===_0x155e6b(0x182))throw CliErrors[_0x155e6b(0x1b4)](_0x155e6b(0x19e));_0x31417a++;if(_0x31417a>=MAX_CONSECUTIVE_NETWORK_ERRORS)throw CliErrors[_0x155e6b(0x1a5)](_0x155e6b(0x187));writeCliSideChannelLine(_0x155e6b(0x199)+_0x31417a+'/'+MAX_CONSECUTIVE_NETWORK_ERRORS+'),\x20retrying...'),await sleep(POLL_INTERVAL_MS);continue;}_0x31417a=0x0;if(_0x5deead['status']===_0x155e6b(0x1bd)){if(!_0x5deead['access_key'])throw CliErrors[_0x155e6b(0x18a)]('Invalid\x20access_key\x20returned\x20by\x20server.');return _0x5deead['access_key'];}if(_0x5deead[_0x155e6b(0x17c)]===_0x155e6b(0x18f)){deleteStoredDeviceCode();throw CliErrors[_0x155e6b(0x1aa)](_0x155e6b(0x179));}const _0x171269=(_0x16a018+0x1)*POLL_INTERVAL_MS,_0x19ae0b=DEVICE_CODE_TTL_MS-_0x171269,_0x2ad807=Math[_0x155e6b(0x1c5)](_0x19ae0b/0xea60),_0x4e5f25=Math[_0x155e6b(0x1c5)](_0x19ae0b%0xea60/0x3e8);process[_0x155e6b(0x19b)][_0x155e6b(0x198)]('\x0dWaiting\x20for\x20authorization...\x20'+_0x2ad807+':'+String(_0x4e5f25)[_0x155e6b(0x1c3)](0x2,'0')+_0x155e6b(0x190)),await sleep(POLL_INTERVAL_MS);}deleteStoredDeviceCode();throw CliErrors[_0x155e6b(0x1aa)](_0x155e6b(0x1b1));}function sleep(_0x3c576c){return new Promise(_0x15a574=>setTimeout(_0x15a574,_0x3c576c));}export const authDeviceDefinition={'service':a12_0xf94840(0x18e),'command':'device','description':a12_0xf94840(0x1a3),'risk':a12_0xf94840(0x198),'confirmationDescription':'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.','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'global','type':a12_0xf94840(0x1c6),'description':a12_0xf94840(0x1bc),'default':!![]},{'name':a12_0xf94840(0x1b6),'type':a12_0xf94840(0x1c6),'description':a12_0xf94840(0x17d),'default':![]},{'name':a12_0xf94840(0x193),'type':a12_0xf94840(0x1a6),'description':a12_0xf94840(0x1a8),'default':a12_0xf94840(0x17a)},{'name':a12_0xf94840(0x188),'type':a12_0xf94840(0x1c6),'description':'Print\x20URL\x20to\x20stdout\x20and\x20exit\x20(for\x20WorkBuddy\x20integration)','default':![]}],async 'execute'(_0x40d3b5){const _0x40463f=a12_0xf94840,_0x3507ca=resolveAuthScopeFlags(_0x40d3b5),_0x234e1a=_0x3507ca[_0x40463f(0x1ac)]?'global':_0x40463f(0x1b6),_0x2e9d59=readScopedConfig(_0x3507ca);if(_0x2e9d59['accessKey'])return{'ok':!![],'message':_0x40463f(0x1c1)};const _0x24d8aa=(_0x40d3b5[_0x40463f(0x1ba)](_0x40463f(0x193))||'lovrabet-cli')[_0x40463f(0x1ad)](),_0x17218f=getUserDomain(),_0x3a63e7=readStoredDeviceCode(),_0x40df9d=_0x3a63e7&&!isStoredDeviceCodeExpired(_0x3a63e7)?_0x3a63e7[_0x40463f(0x17f)]:((()=>{const _0xeb9100=generateDeviceCode();return writeStoredDeviceCode(_0xeb9100,_0x234e1a),_0xeb9100;})()),_0x361991=buildDeviceAuthUrl(_0x17218f,_0x40df9d,_0x24d8aa);if(_0x40d3b5['bool'](_0x40463f(0x188)))return console[_0x40463f(0x1b8)](_0x361991),{'ok':!![]};writeCliSideChannelLine(_0x40463f(0x186)),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x361991),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x40463f(0x192));if(_0x40d3b5[_0x40463f(0x197)])return writeCliSideChannelLine(_0x40463f(0x1ab)+CLI_BIN_NAME+_0x40463f(0x18b)),{'ok':!![],'message':_0x40463f(0x1b2)};writeCliSideChannelLine('Waiting\x20for\x20authorization\x20(timeout:\x2010\x20minutes,\x20Ctrl+C\x20to\x20cancel)...');const _0x5a79cc=new AbortController(),_0x3e097a=()=>{const _0x1ed40b=_0x40463f;_0x5a79cc[_0x1ed40b(0x18d)](),process[_0x1ed40b(0x1c2)](_0x1ed40b(0x19a),_0x3e097a);};process[_0x40463f(0x194)](_0x40463f(0x19a),_0x3e097a);let _0x59113f;try{_0x59113f=await pollDeviceToken(_0x17218f,_0x40df9d,_0x5a79cc[_0x40463f(0x1c8)]);}finally{process[_0x40463f(0x1c2)]('SIGINT',_0x3e097a);}if(!ACCESS_KEY_PATTERN[_0x40463f(0x1c7)](_0x59113f))throw CliErrors[_0x40463f(0x18a)](_0x40463f(0x180));const _0x16430f=readScopedConfig(_0x3507ca);return _0x16430f['accessKey']=_0x59113f,writeScopedConfig(_0x16430f,_0x3507ca),deleteStoredDeviceCode(),process[_0x40463f(0x19b)][_0x40463f(0x198)]('\x0a'),writeCliSideChannelLine('AccessKey\x20saved\x20to\x20'+_0x234e1a+_0x40463f(0x19f)),writeCliSideChannelLine(_0x40463f(0x183)+CLI_BIN_NAME+_0x40463f(0x19d)),{'ok':!![],'message':_0x40463f(0x189)};}};
|
|
1
|
+
const a12_0x5da811=a12_0x4cd8;(function(_0x5533df,_0x4013b7){const _0x5a7674=a12_0x4cd8,_0x1b4754=_0x5533df();while(!![]){try{const _0x473d50=parseInt(_0x5a7674(0x1c5))/0x1*(-parseInt(_0x5a7674(0x18b))/0x2)+-parseInt(_0x5a7674(0x1d9))/0x3+parseInt(_0x5a7674(0x1a1))/0x4*(-parseInt(_0x5a7674(0x188))/0x5)+parseInt(_0x5a7674(0x1bf))/0x6*(-parseInt(_0x5a7674(0x1ba))/0x7)+parseInt(_0x5a7674(0x1c8))/0x8*(parseInt(_0x5a7674(0x1ab))/0x9)+-parseInt(_0x5a7674(0x1a8))/0xa*(-parseInt(_0x5a7674(0x1cd))/0xb)+parseInt(_0x5a7674(0x1d2))/0xc*(parseInt(_0x5a7674(0x189))/0xd);if(_0x473d50===_0x4013b7)break;else _0x1b4754['push'](_0x1b4754['shift']());}catch(_0x4422c0){_0x1b4754['push'](_0x1b4754['shift']());}}}(a12_0x3432,0x30d54));import{existsSync,mkdirSync,readFileSync,unlinkSync,writeFileSync}from'node:fs';import{dirname}from'node:path';function a12_0x3432(){const _0x5f1d03=['\x20auth\x20status','Device\x20authorization\x20cancelled.','apiError','426012FyxKtu','SIGINT','Verify:\x20','source','project','Invalid\x20access_key\x20returned\x20by\x20server.','Invalid\x20device\x20auth\x20response','243588LkbGbM','homeDirName','\x20config.','cancelled','global-default','nonInteractive','stringify','name','Print\x20URL\x20to\x20stdout\x20and\x20exit\x20(for\x20WorkBuddy\x20integration)','\x0dWaiting\x20for\x20authorization...\x20','1558430HZGHOd','208nEljtI','string','2FMPWRo','scope','data','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','signal','test','global','bool','Device\x20authorization\x20successful.','The\x20device\x20code\x20is\x20valid\x20for\x2010\x20minutes.','/api/device-auth/token','auth','status','abort','Open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20authorize:','createdAt','getTime','boolean','write','stderr','success','4VqCUYT','After\x20authorizing,\x20re-run:\x20','parse','toISOString','utf8','aborted','floor','10jYNqfg','str','),\x20retrying...','605547eRPNpx','Device\x20auth\x20API\x20error\x20(','Device\x20authorization\x20URL\x20printed.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20re-run.','access_key','application/json','\x20auth\x20device','once','AbortError','Write\x20to\x20project\x20config','now','code','Device\x20code\x20expired.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','App\x20name\x20shown\x20on\x20authorization\x20page\x20(default:\x20lovrabet)','Write\x20to\x20global\x20config\x20(default)','Device\x20auth\x20API\x20unreachable\x20after\x20multiple\x20retries.','12019atnEHV','removeListener','\x20remaining','expired','trim','522flLrJB','POST','lovrabet-cli','accessKey','log','&source=','290860nBoaML','networkError','validation','8FGVlkJ','url-only','Authorize\x20with\x20the\x20device-code\x20flow\x20(complete\x20in\x20the\x20browser;\x20no\x20copy-paste\x20required)','/device-auth?code=','padStart','4376262YrOhzp','object'];a12_0x3432=function(){return _0x5f1d03;};return a12_0x3432();}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(_0x5ba886){const _0x33d6f0=a12_0x4cd8;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x5ba886[_0x33d6f0(0x193)]('global'),'explicitProject':_0x5ba886[_0x33d6f0(0x193)]('project'),'policy':_0x33d6f0(0x1dd)}));}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 a12_0x4cd8(_0x52d2e6,_0x19d681){_0x52d2e6=_0x52d2e6-0x188;const _0x34329f=a12_0x3432();let _0x4cd847=_0x34329f[_0x52d2e6];return _0x4cd847;}export function generateDeviceCode(){return crypto['randomUUID']();}export function buildDeviceAuthUrl(_0x506d7d,_0x21f86b,_0x1dff50='lovrabet-cli'){const _0x15359a=a12_0x4cd8;return _0x506d7d+_0x15359a(0x1cb)+encodeURIComponent(_0x21f86b)+_0x15359a(0x1c4)+encodeURIComponent(_0x1dff50);}export function getDeviceCodePath(){const _0x3ab66e=a12_0x4cd8;return homedir()+'/'+PRODUCT_CONFIG[_0x3ab66e(0x1da)]+'/.device-auth';}export function readStoredDeviceCode(){const _0x1abc2a=a12_0x4cd8,_0x54764a=getDeviceCodePath();if(!existsSync(_0x54764a))return null;try{const _0x136b8c=readFileSync(_0x54764a,{'encoding':_0x1abc2a(0x1a5)}),_0x1194cc=JSON[_0x1abc2a(0x1a3)](_0x136b8c);if(_0x1194cc&&typeof _0x1194cc[_0x1abc2a(0x1b5)]==='string'&&typeof _0x1194cc[_0x1abc2a(0x19b)]==='string'&&(_0x1194cc[_0x1abc2a(0x18c)]===_0x1abc2a(0x192)||_0x1194cc[_0x1abc2a(0x18c)]===_0x1abc2a(0x1d6)))return _0x1194cc;}catch{}return null;}export function writeStoredDeviceCode(_0x4bf6b1,_0x24e5e0){const _0x2e1f39=a12_0x4cd8,_0x10e1fd=getDeviceCodePath(),_0x53cf86=dirname(_0x10e1fd);!existsSync(_0x53cf86)&&mkdirSync(_0x53cf86,{'recursive':!![]});const _0x32b36f={'code':_0x4bf6b1,'createdAt':new Date()[_0x2e1f39(0x1a4)](),'scope':_0x24e5e0};writeFileSync(_0x10e1fd,JSON[_0x2e1f39(0x1df)](_0x32b36f),{'encoding':_0x2e1f39(0x1a5),'mode':0x180});}export function deleteStoredDeviceCode(){const _0x510c5f=getDeviceCodePath();try{unlinkSync(_0x510c5f);}catch{}}export function isStoredDeviceCodeExpired(_0x4fe31c){const _0x18a79a=a12_0x4cd8;return Date[_0x18a79a(0x1b4)]()-new Date(_0x4fe31c[_0x18a79a(0x19b)])[_0x18a79a(0x19c)]()>DEVICE_CODE_TTL_MS;}export async function fetchDeviceToken(_0x40b7e5,_0x305e5a){const _0x13d8d3=a12_0x4cd8,_0x2a6b3f=_0x40b7e5+_0x13d8d3(0x196),_0x126f68=new AbortController(),_0x9b2886=setTimeout(()=>_0x126f68[_0x13d8d3(0x199)](),0x2710),_0x3ff076=await fetch(_0x2a6b3f,{'method':_0x13d8d3(0x1c0),'headers':{'Content-Type':_0x13d8d3(0x1af)},'body':JSON[_0x13d8d3(0x1df)]({'code':_0x305e5a}),'signal':_0x126f68[_0x13d8d3(0x190)]});clearTimeout(_0x9b2886);if(!_0x3ff076['ok'])throw CliErrors[_0x13d8d3(0x1c6)]('Device\x20auth\x20API\x20returned\x20HTTP\x20'+_0x3ff076[_0x13d8d3(0x198)]);const _0x5e8091=await _0x3ff076['json'](),_0x5166ee=_0x5e8091[_0x13d8d3(0x18d)]&&typeof _0x5e8091[_0x13d8d3(0x18d)]===_0x13d8d3(0x1ce)?_0x5e8091[_0x13d8d3(0x18d)]:_0x5e8091;if(!_0x5166ee||typeof _0x5166ee[_0x13d8d3(0x198)]!=='string')throw CliErrors[_0x13d8d3(0x1d1)](_0x13d8d3(0x1d8));return{'status':_0x5166ee['status'],'access_key':typeof _0x5166ee[_0x13d8d3(0x1ae)]===_0x13d8d3(0x18a)?_0x5166ee[_0x13d8d3(0x1ae)]:undefined};}export async function pollDeviceToken(_0x574dd1,_0x117293,_0x4a0520){const _0x22b1a7=a12_0x4cd8;let _0x5ee9db=0x0;for(let _0x2d3f71=0x0;_0x2d3f71<MAX_POLLS;_0x2d3f71++){if(_0x4a0520[_0x22b1a7(0x1a6)])throw CliErrors[_0x22b1a7(0x1dc)](_0x22b1a7(0x1d0));let _0x3d98c3;try{_0x3d98c3=await fetchDeviceToken(_0x574dd1,_0x117293);}catch(_0x28d3cf){if(_0x28d3cf instanceof Error&&_0x28d3cf[_0x22b1a7(0x1e0)]===_0x22b1a7(0x1b2))throw CliErrors['cancelled'](_0x22b1a7(0x1d0));_0x5ee9db++;if(_0x5ee9db>=MAX_CONSECUTIVE_NETWORK_ERRORS)throw CliErrors['networkError'](_0x22b1a7(0x1b9));writeCliSideChannelLine(_0x22b1a7(0x1ac)+_0x5ee9db+'/'+MAX_CONSECUTIVE_NETWORK_ERRORS+_0x22b1a7(0x1aa)),await sleep(POLL_INTERVAL_MS);continue;}_0x5ee9db=0x0;if(_0x3d98c3[_0x22b1a7(0x198)]===_0x22b1a7(0x1a0)){if(!_0x3d98c3[_0x22b1a7(0x1ae)])throw CliErrors[_0x22b1a7(0x1d1)](_0x22b1a7(0x1d7));return _0x3d98c3['access_key'];}if(_0x3d98c3[_0x22b1a7(0x198)]===_0x22b1a7(0x1bd)){deleteStoredDeviceCode();throw CliErrors[_0x22b1a7(0x1c7)](_0x22b1a7(0x1b6));}const _0x3a4994=(_0x2d3f71+0x1)*POLL_INTERVAL_MS,_0x4d1445=DEVICE_CODE_TTL_MS-_0x3a4994,_0x435aed=Math['floor'](_0x4d1445/0xea60),_0x20b424=Math[_0x22b1a7(0x1a7)](_0x4d1445%0xea60/0x3e8);process[_0x22b1a7(0x19f)][_0x22b1a7(0x19e)](_0x22b1a7(0x1e2)+_0x435aed+':'+String(_0x20b424)[_0x22b1a7(0x1cc)](0x2,'0')+_0x22b1a7(0x1bc)),await sleep(POLL_INTERVAL_MS);}deleteStoredDeviceCode();throw CliErrors[_0x22b1a7(0x1c7)]('Device\x20authorization\x20timed\x20out\x20after\x2010\x20minutes.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.');}function sleep(_0x4c6dbe){return new Promise(_0x56ed2c=>setTimeout(_0x56ed2c,_0x4c6dbe));}export const authDeviceDefinition={'service':a12_0x5da811(0x197),'command':a12_0x5da811(0x18f),'description':a12_0x5da811(0x1ca),'risk':a12_0x5da811(0x19e),'confirmationDescription':a12_0x5da811(0x18e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'global','type':a12_0x5da811(0x19d),'description':a12_0x5da811(0x1b8),'default':!![]},{'name':a12_0x5da811(0x1d6),'type':'boolean','description':a12_0x5da811(0x1b3),'default':![]},{'name':a12_0x5da811(0x1d5),'type':'string','description':a12_0x5da811(0x1b7),'default':a12_0x5da811(0x1c1)},{'name':a12_0x5da811(0x1c9),'type':'boolean','description':a12_0x5da811(0x1e1),'default':![]}],async 'execute'(_0x2b890d){const _0x289f4e=a12_0x5da811,_0x5c8f33=resolveAuthScopeFlags(_0x2b890d),_0x125a89=_0x5c8f33[_0x289f4e(0x192)]?_0x289f4e(0x192):_0x289f4e(0x1d6),_0x57efdb=readScopedConfig(_0x5c8f33);if(_0x57efdb[_0x289f4e(0x1c2)])return{'ok':!![],'message':'Already\x20authorized.\x20Use\x20`lovrabet\x20auth\x20status`\x20to\x20verify.'};const _0x394b38=(_0x2b890d[_0x289f4e(0x1a9)](_0x289f4e(0x1d5))||_0x289f4e(0x1c1))[_0x289f4e(0x1be)](),_0x26f229=getUserDomain(),_0x2bbd58=readStoredDeviceCode(),_0x1028a2=_0x2bbd58&&!isStoredDeviceCodeExpired(_0x2bbd58)?_0x2bbd58[_0x289f4e(0x1b5)]:((()=>{const _0x32c962=generateDeviceCode();return writeStoredDeviceCode(_0x32c962,_0x125a89),_0x32c962;})()),_0x3678a4=buildDeviceAuthUrl(_0x26f229,_0x1028a2,_0x394b38);if(_0x2b890d['bool']('url-only'))return console[_0x289f4e(0x1c3)](_0x3678a4),{'ok':!![]};writeCliSideChannelLine(_0x289f4e(0x19a)),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x3678a4),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x289f4e(0x195));if(_0x2b890d[_0x289f4e(0x1de)])return writeCliSideChannelLine(_0x289f4e(0x1a2)+CLI_BIN_NAME+_0x289f4e(0x1b0)),{'ok':!![],'message':_0x289f4e(0x1ad)};writeCliSideChannelLine('Waiting\x20for\x20authorization\x20(timeout:\x2010\x20minutes,\x20Ctrl+C\x20to\x20cancel)...');const _0x458f3d=new AbortController(),_0x34401e=()=>{const _0x1c622b=_0x289f4e;_0x458f3d['abort'](),process[_0x1c622b(0x1bb)](_0x1c622b(0x1d3),_0x34401e);};process[_0x289f4e(0x1b1)](_0x289f4e(0x1d3),_0x34401e);let _0x2fc6c2;try{_0x2fc6c2=await pollDeviceToken(_0x26f229,_0x1028a2,_0x458f3d[_0x289f4e(0x190)]);}finally{process[_0x289f4e(0x1bb)]('SIGINT',_0x34401e);}if(!ACCESS_KEY_PATTERN[_0x289f4e(0x191)](_0x2fc6c2))throw CliErrors[_0x289f4e(0x1d1)](_0x289f4e(0x1d7));const _0x23611a=readScopedConfig(_0x5c8f33);return _0x23611a[_0x289f4e(0x1c2)]=_0x2fc6c2,writeScopedConfig(_0x23611a,_0x5c8f33),deleteStoredDeviceCode(),process[_0x289f4e(0x19f)][_0x289f4e(0x19e)]('\x0a'),writeCliSideChannelLine('AccessKey\x20saved\x20to\x20'+_0x125a89+_0x289f4e(0x1db)),writeCliSideChannelLine(_0x289f4e(0x1d4)+CLI_BIN_NAME+_0x289f4e(0x1cf)),{'ok':!![],'message':_0x289f4e(0x194)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a13_0x3537de=a13_0x47b5;(function(_0x1589c7,_0x1c97d3){const _0x1d0690=a13_0x47b5,_0x32ab69=_0x1589c7();while(!![]){try{const _0x3ce7c0=-parseInt(_0x1d0690(0x115))/0x1+parseInt(_0x1d0690(0x10a))/0x2*(-parseInt(_0x1d0690(0x139))/0x3)+-parseInt(_0x1d0690(0xf2))/0x4+parseInt(_0x1d0690(0x11a))/0x5*(-parseInt(_0x1d0690(0x121))/0x6)+-parseInt(_0x1d0690(0x133))/0x7*(parseInt(_0x1d0690(0x103))/0x8)+-parseInt(_0x1d0690(0x122))/0x9*(-parseInt(_0x1d0690(0x145))/0xa)+parseInt(_0x1d0690(0x116))/0xb*(parseInt(_0x1d0690(0x13e))/0xc);if(_0x3ce7c0===_0x1c97d3)break;else _0x32ab69['push'](_0x32ab69['shift']());}catch(_0x8df9dd){_0x32ab69['push'](_0x32ab69['shift']());}}}(a13_0x403d,0x4c7fe));import{readScopedConfig,writeScopedConfig}from'../../context.js';function a13_0x47b5(_0x29cc37,_0x190f34){_0x29cc37=_0x29cc37-0xe5;const _0x403d65=a13_0x403d();let _0x47b5d6=_0x403d65[_0x29cc37];return _0x47b5d6;}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';function a13_0x403d(){const _0x178bbb=['Invalid\x20accessKey\x20format.','global\x20config','authRequired','cancelled','Show\x20current\x20authentication\x20status','access-key','push','\x20doctor','\x20\x20export\x20','143895npUTIz','21015775pNvcho','Option\x20C:\x20environment\x20variable','ACCESS_KEY','yes','78655RITHBR','newConfigFileName','\x20config','AccessKey\x20cleared\x20from\x20','AccessKey:\x20','bool','global-default','186pxGSzM','1418733IOcMTD','ClientAk','stdin','string','project','test','Tip:\x20you\x20can\x20also\x20run:','expired','access_key','code','=ak_xxx','boolean','logout','read','Write\x20to\x20global\x20config\x20(default)','\x20config.\x20Nothing\x20to\x20clear.','Device\x20authorization\x20pending.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20try\x20again.','2051hmytUD','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','production','Option\x20A:\x20','Use\x20`','global','18867XzcRpr','AccessKey\x20saved\x20to\x20','auth','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','Auth\x20mode:\x20','12GqpFPw','\x20config.','Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20','Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','Option\x20B:\x20apps\x20config\x20(','Save\x20the\x20AccessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20the\x20project\x20file)','\x20Verify:\x20','30UPGFio','trim','check','stdout','join','env','\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]','accessKeyCreatePath','No\x20AccessKey\x20found\x20in\x20','AccessKey\x20(ak_xxx...)','scope','status','\x20(via\x20','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','1467364zvTEmi','str','Then\x20verify\x20with:\x20','\x20Current\x20env:\x20','nonInteractive','write','\x20auth\x20status','validation','Shorthand\x20for\x20--access-key','Missing\x20accessKey.','Removes\x20the\x20AccessKey\x20from\x20the\x20selected\x20Lovrabet\x20config.\x20Commands\x20that\x20need\x20that\x20key\x20will\x20require\x20login\x20again.','\x20env\x20var','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','envName','info','Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','Status:\x20valid','15696dBrzVA','login','development','project\x20config','userCenterDisplayName','isTTY','accessKey','158LgotSC','Clear\x20the\x20AccessKey\x20from\x20config'];a13_0x403d=function(){return _0x178bbb;};return a13_0x403d();}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(_0x4d881f=USER_ACCESS_KEY_CREATE_URL){const _0x47f71c=a13_0x47b5;writeCliSideChannelLine(_0x47f71c(0xf1)+PRODUCT_CONFIG[_0x47f71c(0x107)]+':'),writeCliSideChannelLine('\x0a'+_0x4d881f+'\x0a'),writeCliSideChannelLine(_0x47f71c(0x128)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>');}function buildAccessKeySetupGuide(_0x7b2f73=USER_ACCESS_KEY_CREATE_URL){const _0x4c8b39=a13_0x47b5;return['AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20'+PRODUCT_CONFIG[_0x4c8b39(0x107)]+':',_0x7b2f73,_0x4c8b39(0x140)+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]']['join']('\x0a');}function canPromptForAccessKey(_0x53f99f){const _0x13064c=a13_0x47b5;return!_0x53f99f[_0x13064c(0xf6)]&&process[_0x13064c(0x124)][_0x13064c(0x108)]!==![]&&process[_0x13064c(0xe7)][_0x13064c(0x108)]!==![];}function resolveAuthScopeFlags(_0x45fa2f){const _0x27244e=a13_0x47b5;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x45fa2f[_0x27244e(0x11f)]('global'),'explicitProject':_0x45fa2f[_0x27244e(0x11f)](_0x27244e(0x126)),'policy':_0x27244e(0x120)}));}async function resolveAuthWriteInput(_0x46abe6){const _0x1c2bf6=a13_0x47b5;let _0x1e61e0=(_0x46abe6[_0x1c2bf6(0xf3)](_0x1c2bf6(0x111))||_0x46abe6[_0x1c2bf6(0xf3)]('ak')||'')[_0x1c2bf6(0xe5)]();const _0x4d8112=(_0x46abe6['str']('env')||'')[_0x1c2bf6(0xe5)](),_0x42273a=''+getUserDomain()+PRODUCT_CONFIG[_0x1c2bf6(0xeb)];if(!_0x1e61e0&&canPromptForAccessKey(_0x46abe6))try{showAccessKeyCreateHint(_0x42273a),_0x1e61e0=await promptAccessKey('');}catch(_0x5d26f7){if(isAbortPrompt(_0x5d26f7))throw CliErrors[_0x1c2bf6(0x10f)]();throw _0x5d26f7;}if(!_0x1e61e0)throw CliErrors[_0x1c2bf6(0xf9)](_0x1c2bf6(0xfb),buildAccessKeySetupGuide(_0x42273a));if(!ACCESS_KEY_PATTERN[_0x1c2bf6(0x127)](_0x1e61e0))throw CliErrors[_0x1c2bf6(0xf9)](_0x1c2bf6(0x10c),'Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars');if(!_0x4d8112)return{'accessKey':_0x1e61e0};const _0x5b601d=normalizeEnv(_0x4d8112);return{'accessKey':_0x1e61e0,'env':isDaily(_0x5b601d)?'daily':isDev(_0x5b601d)?_0x1c2bf6(0x105):_0x1c2bf6(0x135)};}export const authDefinitions=[{'service':a13_0x3537de(0x13b),'command':a13_0x3537de(0x104),'description':a13_0x3537de(0x143),'risk':a13_0x3537de(0xf7),'confirmationDescription':'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.','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a13_0x3537de(0x111),'type':a13_0x3537de(0x125),'description':a13_0x3537de(0xed)},{'name':'ak','type':a13_0x3537de(0x125),'description':a13_0x3537de(0xfa)},{'name':a13_0x3537de(0x138),'type':a13_0x3537de(0x12d),'description':a13_0x3537de(0x130),'default':!![]},{'name':'project','type':'boolean','description':a13_0x3537de(0x13c),'default':![]}],async 'execute'(_0x5aeae0){const _0x429b20=a13_0x3537de;if(_0x5aeae0[_0x429b20(0x11f)](_0x429b20(0x119)))throw CliErrors['validation']('`auth\x20login`\x20does\x20not\x20support\x20--yes.',_0x429b20(0x137)+CLI_BIN_NAME+'\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`'+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.');const _0x4ee127=(_0x5aeae0[_0x429b20(0xf3)]('access-key')||_0x5aeae0[_0x429b20(0xf3)]('ak')||'')['trim']();if(!_0x4ee127&&_0x5aeae0[_0x429b20(0xf6)])return{'ok':!![],'message':buildAccessKeySetupGuide(''+getUserDomain()+PRODUCT_CONFIG['accessKeyCreatePath'])};const _0x3a0e63=await resolveAuthWriteInput(_0x5aeae0),_0x33a83c=resolveAuthScopeFlags(_0x5aeae0),_0x2783e8=readScopedConfig(_0x33a83c);_0x2783e8['accessKey']=_0x3a0e63['accessKey'];_0x3a0e63[_0x429b20(0xe9)]&&(_0x2783e8[_0x429b20(0xe9)]=_0x3a0e63[_0x429b20(0xe9)]);writeScopedConfig(_0x2783e8,_0x33a83c);const _0x1e696c=_0x33a83c[_0x429b20(0x138)]?_0x429b20(0x138):_0x429b20(0x126),_0x288c40=_0x2783e8[_0x429b20(0xe9)]?_0x429b20(0xf5)+_0x2783e8[_0x429b20(0xe9)]+'.':'';return{'ok':!![],'message':_0x429b20(0x13a)+_0x1e696c+'\x20config.'+_0x288c40+_0x429b20(0x144)+CLI_BIN_NAME+_0x429b20(0xf8)};}},{'service':a13_0x3537de(0x13b),'command':a13_0x3537de(0x12e),'description':a13_0x3537de(0x10b),'risk':a13_0x3537de(0xf7),'confirmationDescription':a13_0x3537de(0xfc),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a13_0x3537de(0x138),'type':'boolean','description':'Clear\x20from\x20global\x20config\x20(default)','default':!![]},{'name':'project','type':a13_0x3537de(0x12d),'description':a13_0x3537de(0x141),'default':![]}],async 'execute'(_0x142fe0){const _0x5748bc=a13_0x3537de,_0x2e3ce3=resolveAuthScopeFlags(_0x142fe0),_0x49abcd=readScopedConfig(_0x2e3ce3),_0x3b42ac=!!_0x49abcd[_0x5748bc(0x109)];delete _0x49abcd[_0x5748bc(0x109)],writeScopedConfig(_0x49abcd,_0x2e3ce3);const _0x2d3b8e=_0x2e3ce3[_0x5748bc(0x138)]?_0x5748bc(0x138):_0x5748bc(0x126);if(_0x3b42ac)return{'ok':!![],'message':_0x5748bc(0x11d)+_0x2d3b8e+_0x5748bc(0x13f)};return{'ok':!![],'message':_0x5748bc(0xec)+_0x2d3b8e+_0x5748bc(0x131)};}},{'service':a13_0x3537de(0x13b),'command':a13_0x3537de(0xef),'description':a13_0x3537de(0x110),'risk':a13_0x3537de(0x12f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'global','type':a13_0x3537de(0x12d),'description':'Read\x20from\x20global\x20config\x20(default)','default':!![]},{'name':'project','type':'boolean','description':a13_0x3537de(0x101),'default':![]},{'name':a13_0x3537de(0xe6),'type':a13_0x3537de(0x12d),'description':'Exit\x20non-zero\x20when\x20no\x20AccessKey\x20is\x20configured','default':![]}],async 'execute'(_0x512127){const _0xccf303=a13_0x3537de,_0x4bea36=resolveAuthScopeFlags(_0x512127),_0x45cb0b=readScopedConfig(_0x4bea36),_0x30ff2a=productEnvName(_0xccf303(0x118)),_0x346342=productEnv(_0xccf303(0x118))||undefined,_0x33b105=_0x45cb0b[_0xccf303(0x109)]||undefined,_0x589d8d=_0x346342||_0x33b105,_0x22a389=_0x346342?_0x30ff2a+_0xccf303(0xfd):_0x33b105?(_0x4bea36[_0xccf303(0x138)]?_0xccf303(0x138):'project')+_0xccf303(0x11c):null,_0x4135b6=[_0xccf303(0x13d)+AUTH_MODE['ClientAk']];if(_0x589d8d){const _0x171034=maskCliAccessKey(_0x589d8d);_0x4135b6[_0xccf303(0x112)](_0xccf303(0x11e)+_0x171034+(_0x22a389?_0xccf303(0xf0)+_0x22a389+')':'')),_0x4135b6[_0xccf303(0x112)]('Status:\x20valid');}if(!_0x589d8d){_0x4135b6[_0xccf303(0x112)](''),_0x4135b6[_0xccf303(0x112)](_0xccf303(0xfe)),_0x4135b6['push'](''),_0x4135b6[_0xccf303(0x112)](_0xccf303(0x136)+CLI_BIN_NAME+_0xccf303(0xea)),_0x4135b6[_0xccf303(0x112)](''),_0x4135b6[_0xccf303(0x112)](_0xccf303(0x142)+PRODUCT_CONFIG[_0xccf303(0x11b)]+')'),_0x4135b6['push'](_0xccf303(0x134)),_0x4135b6[_0xccf303(0x112)](''),_0x4135b6[_0xccf303(0x112)](_0xccf303(0x117)),_0x4135b6[_0xccf303(0x112)](_0xccf303(0x114)+_0x30ff2a+_0xccf303(0x12c)),_0x4135b6[_0xccf303(0x112)](''),_0x4135b6[_0xccf303(0x112)](_0xccf303(0xf4)+CLI_BIN_NAME+_0xccf303(0xf8)),_0x4135b6[_0xccf303(0x112)]('If\x20command\x20execution\x20still\x20fails,\x20run:\x20'+CLI_BIN_NAME+_0xccf303(0x113));if(_0x512127[_0xccf303(0x11f)](_0xccf303(0xe6))){const _0x26ac00=readStoredDeviceCode();if(_0x26ac00&&!isStoredDeviceCodeExpired(_0x26ac00)){const _0x286f70=getUserDomain(),_0x59858e=await fetchDeviceToken(_0x286f70,_0x26ac00[_0xccf303(0x12b)]);if(_0x59858e[_0xccf303(0xef)]==='success'&&_0x59858e[_0xccf303(0x12a)]){const _0xc59af2={'global':_0x26ac00[_0xccf303(0xee)]===_0xccf303(0x138)},_0x478a16=readScopedConfig(_0xc59af2);_0x478a16['accessKey']=_0x59858e[_0xccf303(0x12a)],writeScopedConfig(_0x478a16,_0xc59af2),deleteStoredDeviceCode();const _0x2c25f4=_0x59858e[_0xccf303(0x12a)],_0x124309=maskCliAccessKey(_0x2c25f4),_0x2689d0=_0x26ac00[_0xccf303(0xee)]===_0xccf303(0x138)?_0xccf303(0x10d):_0xccf303(0x106);return{'ok':!![],'message':[_0xccf303(0x13d)+AUTH_MODE[_0xccf303(0x123)],_0xccf303(0x11e)+_0x124309+_0xccf303(0xf0)+_0x2689d0+')',_0xccf303(0x102)][_0xccf303(0xe8)]('\x0a')};}_0x59858e[_0xccf303(0xef)]===_0xccf303(0x129)&&deleteStoredDeviceCode();throw CliErrors[_0xccf303(0x10e)](_0xccf303(0x132));}throw CliErrors[_0xccf303(0x10e)](_0x4135b6[_0xccf303(0xe8)]('\x0a'));}}return{'ok':!![],'message':_0x4135b6[_0xccf303(0xe8)]('\x0a')};}},{'service':'auth','command':a13_0x3537de(0x100),'description':'Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','risk':'read','requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x38694e){const _0x5b418a=a13_0x3537de,_0x10d3ce=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x10d3ce,'meta':{'env':_0x38694e[_0x5b418a(0xff)]??'production'}}};}},authDeviceDefinition];
|
|
1
|
+
const a13_0x491d87=a13_0x54c8;(function(_0x4c15a5,_0x580630){const _0x5322fa=a13_0x54c8,_0x40aab0=_0x4c15a5();while(!![]){try{const _0x339227=-parseInt(_0x5322fa(0x210))/0x1+-parseInt(_0x5322fa(0x234))/0x2+-parseInt(_0x5322fa(0x1f4))/0x3*(-parseInt(_0x5322fa(0x230))/0x4)+-parseInt(_0x5322fa(0x1f7))/0x5*(parseInt(_0x5322fa(0x216))/0x6)+parseInt(_0x5322fa(0x206))/0x7*(-parseInt(_0x5322fa(0x1fd))/0x8)+-parseInt(_0x5322fa(0x228))/0x9+parseInt(_0x5322fa(0x236))/0xa;if(_0x339227===_0x580630)break;else _0x40aab0['push'](_0x40aab0['shift']());}catch(_0x1ebd4c){_0x40aab0['push'](_0x40aab0['shift']());}}}(a13_0x29e2,0x452ec));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';function a13_0x54c8(_0x5674f0,_0x508599){_0x5674f0=_0x5674f0-0x1f4;const _0x29e23b=a13_0x29e2();let _0x54c892=_0x29e23b[_0x5674f0];return _0x54c892;}const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/;function showAccessKeyCreateHint(_0x45840b=USER_ACCESS_KEY_CREATE_URL){const _0x2ac77b=a13_0x54c8;writeCliSideChannelLine(_0x2ac77b(0x251)+PRODUCT_CONFIG[_0x2ac77b(0x208)]+':'),writeCliSideChannelLine('\x0a'+_0x45840b+'\x0a'),writeCliSideChannelLine(_0x2ac77b(0x21b)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x2ac77b(0x24c));}function buildAccessKeySetupGuide(_0x509105=USER_ACCESS_KEY_CREATE_URL){const _0x5a642a=a13_0x54c8;return[_0x5a642a(0x251)+PRODUCT_CONFIG['userCenterDisplayName']+':',_0x509105,_0x5a642a(0x21e)+CLI_BIN_NAME+_0x5a642a(0x213)][_0x5a642a(0x23e)]('\x0a');}function canPromptForAccessKey(_0x43317a){const _0x328425=a13_0x54c8;return!_0x43317a[_0x328425(0x253)]&&process[_0x328425(0x203)][_0x328425(0x204)]!==![]&&process[_0x328425(0x200)][_0x328425(0x204)]!==![];}function resolveAuthScopeFlags(_0x3c17c7){const _0x368899=a13_0x54c8;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x3c17c7[_0x368899(0x21f)](_0x368899(0x225)),'explicitProject':_0x3c17c7[_0x368899(0x21f)](_0x368899(0x223)),'policy':_0x368899(0x247)}));}async function resolveAuthWriteInput(_0x23854b){const _0x8fe0b1=a13_0x54c8;let _0xeda828=(_0x23854b[_0x8fe0b1(0x226)]('access-key')||_0x23854b[_0x8fe0b1(0x226)]('ak')||'')[_0x8fe0b1(0x21c)]();const _0x530ce0=(_0x23854b[_0x8fe0b1(0x226)](_0x8fe0b1(0x21a))||'')[_0x8fe0b1(0x21c)](),_0x153176=''+getUserDomain()+PRODUCT_CONFIG[_0x8fe0b1(0x242)];if(!_0xeda828&&canPromptForAccessKey(_0x23854b))try{showAccessKeyCreateHint(_0x153176),_0xeda828=await promptAccessKey('');}catch(_0x136dca){if(isAbortPrompt(_0x136dca))throw CliErrors[_0x8fe0b1(0x23a)]();throw _0x136dca;}if(!_0xeda828)throw CliErrors[_0x8fe0b1(0x222)](_0x8fe0b1(0x1f8),buildAccessKeySetupGuide(_0x153176));if(!ACCESS_KEY_PATTERN[_0x8fe0b1(0x1fc)](_0xeda828))throw CliErrors[_0x8fe0b1(0x222)](_0x8fe0b1(0x20b),_0x8fe0b1(0x201));if(!_0x530ce0)return{'accessKey':_0xeda828};const _0x2ae9b0=normalizeEnv(_0x530ce0);return{'accessKey':_0xeda828,'env':isDaily(_0x2ae9b0)?'daily':isDev(_0x2ae9b0)?_0x8fe0b1(0x219):'production'};}export const authDefinitions=[{'service':'auth','command':a13_0x491d87(0x24d),'description':a13_0x491d87(0x209),'risk':a13_0x491d87(0x214),'confirmationDescription':a13_0x491d87(0x229),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a13_0x491d87(0x1f6),'type':a13_0x491d87(0x246),'description':'AccessKey\x20(ak_xxx...)'},{'name':'ak','type':a13_0x491d87(0x246),'description':a13_0x491d87(0x22f)},{'name':a13_0x491d87(0x225),'type':'boolean','description':'Write\x20to\x20global\x20config\x20(default)','default':!![]},{'name':a13_0x491d87(0x223),'type':a13_0x491d87(0x232),'description':a13_0x491d87(0x22c),'default':![]}],async 'execute'(_0x345905){const _0x1f8dd7=a13_0x491d87;if(_0x345905['bool'](_0x1f8dd7(0x255)))throw CliErrors[_0x1f8dd7(0x222)](_0x1f8dd7(0x22e),_0x1f8dd7(0x23c)+CLI_BIN_NAME+_0x1f8dd7(0x24f)+CLI_BIN_NAME+_0x1f8dd7(0x249));const _0x2f91a0=(_0x345905['str'](_0x1f8dd7(0x1f6))||_0x345905[_0x1f8dd7(0x226)]('ak')||'')['trim']();if(!_0x2f91a0&&_0x345905['nonInteractive'])return{'ok':!![],'message':buildAccessKeySetupGuide(''+getUserDomain()+PRODUCT_CONFIG[_0x1f8dd7(0x242)])};const _0x2bc185=await resolveAuthWriteInput(_0x345905),_0x2cfcfc=resolveAuthScopeFlags(_0x345905),_0x4e69ee=readScopedConfig(_0x2cfcfc);_0x4e69ee[_0x1f8dd7(0x248)]=_0x2bc185[_0x1f8dd7(0x248)];_0x2bc185[_0x1f8dd7(0x21a)]&&(_0x4e69ee[_0x1f8dd7(0x21a)]=_0x2bc185[_0x1f8dd7(0x21a)]);writeScopedConfig(_0x4e69ee,_0x2cfcfc);const _0x52f83b=_0x2cfcfc[_0x1f8dd7(0x225)]?_0x1f8dd7(0x225):'project',_0x11b3a1=_0x4e69ee[_0x1f8dd7(0x21a)]?_0x1f8dd7(0x24a)+_0x4e69ee[_0x1f8dd7(0x21a)]+'.':'';return{'ok':!![],'message':_0x1f8dd7(0x23b)+_0x52f83b+'\x20config.'+_0x11b3a1+_0x1f8dd7(0x239)+CLI_BIN_NAME+'\x20auth\x20status'};}},{'service':a13_0x491d87(0x20f),'command':'logout','description':a13_0x491d87(0x211),'risk':'write','confirmationDescription':a13_0x491d87(0x240),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a13_0x491d87(0x225),'type':a13_0x491d87(0x232),'description':a13_0x491d87(0x245),'default':!![]},{'name':a13_0x491d87(0x223),'type':'boolean','description':a13_0x491d87(0x1fb),'default':![]}],async 'execute'(_0x4f32b4){const _0x39dc87=a13_0x491d87,_0xc4bbce=resolveAuthScopeFlags(_0x4f32b4),_0x5be54b=readScopedConfig(_0xc4bbce),_0x17f9ce=!!_0x5be54b['accessKey'];delete _0x5be54b[_0x39dc87(0x248)],writeScopedConfig(_0x5be54b,_0xc4bbce);const _0x28d12a=_0xc4bbce[_0x39dc87(0x225)]?_0x39dc87(0x225):_0x39dc87(0x223);if(_0x17f9ce)return{'ok':!![],'message':_0x39dc87(0x218)+_0x28d12a+_0x39dc87(0x20a)};return{'ok':!![],'message':_0x39dc87(0x215)+_0x28d12a+_0x39dc87(0x20d)};}},{'service':a13_0x491d87(0x20f),'command':a13_0x491d87(0x217),'description':a13_0x491d87(0x1fa),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a13_0x491d87(0x225),'type':a13_0x491d87(0x232),'description':a13_0x491d87(0x233),'default':!![]},{'name':a13_0x491d87(0x223),'type':'boolean','description':'Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]},{'name':a13_0x491d87(0x20c),'type':a13_0x491d87(0x232),'description':a13_0x491d87(0x235),'default':![]}],async 'execute'(_0x98a7cb){const _0x3655d0=a13_0x491d87,_0x3f7919=resolveAuthScopeFlags(_0x98a7cb),_0x3f1069=readScopedConfig(_0x3f7919),_0x29da09=productEnvName(_0x3655d0(0x21d)),_0x436944=productEnv(_0x3655d0(0x21d))||undefined,_0x399a4f=_0x3f1069['accessKey']||undefined,_0x5144e0=_0x436944||_0x399a4f,_0x1ddafc=_0x436944?_0x29da09+_0x3655d0(0x207):_0x399a4f?(_0x3f7919[_0x3655d0(0x225)]?_0x3655d0(0x225):_0x3655d0(0x223))+_0x3655d0(0x20e):null,_0x5e187d=[_0x3655d0(0x250)+AUTH_MODE[_0x3655d0(0x220)]];if(_0x5144e0){const _0x43a682=maskCliAccessKey(_0x5144e0);_0x5e187d[_0x3655d0(0x221)](_0x3655d0(0x254)+_0x43a682+(_0x1ddafc?'\x20(via\x20'+_0x1ddafc+')':'')),_0x5e187d['push']('Status:\x20valid');}if(!_0x5144e0){_0x5e187d[_0x3655d0(0x221)](''),_0x5e187d[_0x3655d0(0x221)](_0x3655d0(0x1fe)),_0x5e187d[_0x3655d0(0x221)](''),_0x5e187d[_0x3655d0(0x221)]('Option\x20A:\x20'+CLI_BIN_NAME+_0x3655d0(0x22b)),_0x5e187d[_0x3655d0(0x221)](''),_0x5e187d[_0x3655d0(0x221)](_0x3655d0(0x24b)+PRODUCT_CONFIG[_0x3655d0(0x1f5)]+')'),_0x5e187d[_0x3655d0(0x221)](_0x3655d0(0x22a)),_0x5e187d[_0x3655d0(0x221)](''),_0x5e187d[_0x3655d0(0x221)](_0x3655d0(0x238)),_0x5e187d['push'](_0x3655d0(0x231)+_0x29da09+_0x3655d0(0x256)),_0x5e187d[_0x3655d0(0x221)](''),_0x5e187d['push'](_0x3655d0(0x205)+CLI_BIN_NAME+_0x3655d0(0x22d)),_0x5e187d[_0x3655d0(0x221)](_0x3655d0(0x23d)+CLI_BIN_NAME+'\x20doctor');if(_0x98a7cb['bool']('check')){const _0x413c47=readStoredDeviceCode();if(_0x413c47&&!isStoredDeviceCodeExpired(_0x413c47)){const _0x3ded1d=getUserDomain(),_0x2420e2=await fetchDeviceToken(_0x3ded1d,_0x413c47[_0x3655d0(0x224)]);if(_0x2420e2['status']==='success'&&_0x2420e2[_0x3655d0(0x252)]){const _0x3acbeb={'global':_0x413c47['scope']===_0x3655d0(0x225)},_0x1a5c60=readScopedConfig(_0x3acbeb);_0x1a5c60[_0x3655d0(0x248)]=_0x2420e2[_0x3655d0(0x252)],writeScopedConfig(_0x1a5c60,_0x3acbeb),deleteStoredDeviceCode();const _0x550b4f=_0x2420e2[_0x3655d0(0x252)],_0xe33c9=maskCliAccessKey(_0x550b4f),_0x53d739=_0x413c47[_0x3655d0(0x1f9)]===_0x3655d0(0x225)?_0x3655d0(0x243):_0x3655d0(0x237);return{'ok':!![],'message':[_0x3655d0(0x250)+AUTH_MODE['ClientAk'],_0x3655d0(0x254)+_0xe33c9+_0x3655d0(0x24e)+_0x53d739+')',_0x3655d0(0x241)][_0x3655d0(0x23e)]('\x0a')};}_0x2420e2[_0x3655d0(0x217)]===_0x3655d0(0x1ff)&&deleteStoredDeviceCode();throw CliErrors[_0x3655d0(0x202)]('Device\x20authorization\x20pending.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20try\x20again.');}throw CliErrors[_0x3655d0(0x202)](_0x5e187d[_0x3655d0(0x23e)]('\x0a'));}}return{'ok':!![],'message':_0x5e187d['join']('\x0a')};}},{'service':a13_0x491d87(0x20f),'command':a13_0x491d87(0x244),'description':a13_0x491d87(0x212),'risk':a13_0x491d87(0x23f),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x5e3dc8){const _0x5ed89c=a13_0x491d87,_0x2d2324=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x2d2324,'meta':{'env':_0x5e3dc8[_0x5ed89c(0x257)]??_0x5ed89c(0x227)}}};}},authDeviceDefinition];function a13_0x29e2(){const _0x3b0264=['AccessKey:\x20','yes','=ak_xxx','envName','51OEBunm','newConfigFileName','access-key','12910JlppwB','Missing\x20accessKey.','scope','Show\x20current\x20authentication\x20status','Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','test','152serGyy','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','expired','stdout','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars','authRequired','stdin','isTTY','Then\x20verify\x20with:\x20','171493iZhRcu','\x20env\x20var','userCenterDisplayName','Save\x20the\x20AccessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20the\x20project\x20file)','\x20config.','Invalid\x20accessKey\x20format.','check','\x20config.\x20Nothing\x20to\x20clear.','\x20config','auth','10151cAdjAm','Clear\x20the\x20AccessKey\x20from\x20config','Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','write','No\x20AccessKey\x20found\x20in\x20','942SHyrKV','status','AccessKey\x20cleared\x20from\x20','development','env','Tip:\x20you\x20can\x20also\x20run:','trim','ACCESS_KEY','Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20','bool','ClientAk','push','validation','project','code','global','str','production','2646909qNaWdu','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.','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','\x20auth\x20status','`auth\x20login`\x20does\x20not\x20support\x20--yes.','Shorthand\x20for\x20--access-key','92044MrqVxP','\x20\x20export\x20','boolean','Read\x20from\x20global\x20config\x20(default)','694258XKOQdL','Exit\x20non-zero\x20when\x20no\x20AccessKey\x20is\x20configured','14144210QkNIyC','project\x20config','Option\x20C:\x20environment\x20variable','\x20Verify:\x20','cancelled','AccessKey\x20saved\x20to\x20','Use\x20`','If\x20command\x20execution\x20still\x20fails,\x20run:\x20','join','read','Removes\x20the\x20AccessKey\x20from\x20the\x20selected\x20Lovrabet\x20config.\x20Commands\x20that\x20need\x20that\x20key\x20will\x20require\x20login\x20again.','Status:\x20valid','accessKeyCreatePath','global\x20config','info','Clear\x20from\x20global\x20config\x20(default)','string','global-default','accessKey','\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.','\x20Current\x20env:\x20','Option\x20B:\x20apps\x20config\x20(','\x20auth\x20login\x20--access-key\x20<ak_xxx>','login','\x20(via\x20','\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`','Auth\x20mode:\x20','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','access_key','nonInteractive'];a13_0x29e2=function(){return _0x3b0264;};return a13_0x29e2();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x359546,_0x3f8ca8){const _0x2921b5=a14_0x3cf3,_0x7b72f9=_0x359546();while(!![]){try{const _0x38b68a=-parseInt(_0x2921b5(0x17d))/0x1+parseInt(_0x2921b5(0x172))/0x2*(parseInt(_0x2921b5(0x185))/0x3)+-parseInt(_0x2921b5(0x178))/0x4+parseInt(_0x2921b5(0x176))/0x5+parseInt(_0x2921b5(0x17c))/0x6+parseInt(_0x2921b5(0x174))/0x7*(parseInt(_0x2921b5(0x17b))/0x8)+-parseInt(_0x2921b5(0x182))/0x9;if(_0x38b68a===_0x3f8ca8)break;else _0x7b72f9['push'](_0x7b72f9['shift']());}catch(_0x180cca){_0x7b72f9['push'](_0x7b72f9['shift']());}}}(a14_0x433a,0xe33d7));function a14_0x433a(){const _0x273519=['1947645KDlHAu','AccessKey\x20(paste\x20ak_...):\x20','once','15uUjNFe','531870nJcxwO','):\x20','7tGlXie','removeListener','5233725UPrpxD','AccessKey\x20(','3339312wbLUcQ','SIGINT','name','7933656gBjUHi','1736202SYeMHJ','1675486FoVHqb','stdin','User\x20aborted\x20prompt','AbortPrompt','race'];a14_0x433a=function(){return _0x273519;};return a14_0x433a();}function a14_0x3cf3(_0x3fed88,_0x50677d){_0x3fed88=_0x3fed88-0x172;const _0x433a80=a14_0x433a();let _0x3cf3f7=_0x433a80[_0x3fed88];return _0x3cf3f7;}import{createInterface}from'node:readline';class AbortPrompt extends Error{constructor(){const _0x45d8fa=a14_0x3cf3;super(_0x45d8fa(0x17f)),this[_0x45d8fa(0x17a)]=_0x45d8fa(0x180);}}function createSafeRl(){const _0x432d48=a14_0x3cf3,_0x2bacee=createInterface({'input':process[_0x432d48(0x17e)],'output':process['stdout']});let _0x1b9cea;const _0x1b10b2=new Promise((_0x5b85f3,_0x21510c)=>{const _0x295761=_0x432d48;_0x1b9cea=()=>{const _0x407dd1=a14_0x3cf3;_0x1b9cea&&(_0x2bacee[_0x407dd1(0x175)]('SIGINT',_0x1b9cea),_0x1b9cea=undefined);try{_0x2bacee['close']();}catch{}_0x21510c(new AbortPrompt());},_0x2bacee[_0x295761(0x184)](_0x295761(0x179),_0x1b9cea);}),_0x408b44=()=>{const _0x7a745a=_0x432d48;_0x1b9cea&&(_0x2bacee[_0x7a745a(0x175)](_0x7a745a(0x179),_0x1b9cea),_0x1b9cea=undefined);try{_0x2bacee['close']();}catch{}};return{'rl':_0x2bacee,'abortPromise':_0x1b10b2,'disposeSuccess':_0x408b44};}export async function promptAccessKey(_0x1941c3=''){const _0x8ab708=a14_0x3cf3,{rl:_0x19b22f,abortPromise:_0x2561ad,disposeSuccess:_0x596f81}=createSafeRl(),_0x2dc597=new Promise(_0x4a0888=>{const _0xec9839=a14_0x3cf3,_0x16bb56=_0x1941c3?_0xec9839(0x177)+_0x1941c3+_0xec9839(0x173):_0xec9839(0x183);_0x19b22f['question'](_0x16bb56,_0x2eb083=>{_0x596f81(),_0x4a0888(_0x2eb083['trim']()||_0x1941c3);});});return Promise[_0x8ab708(0x181)]([_0x2dc597,_0x2561ad]);}export function isAbortPrompt(_0x46691c){const _0x2114db=a14_0x3cf3;return _0x46691c instanceof Error&&_0x46691c['name']===_0x2114db(0x180);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a15_0x3f6267=a15_0x3f63;(function(_0x4ada8f,_0x16645f){const _0x1f187b=a15_0x3f63,_0x2aa21b=_0x4ada8f();while(!![]){try{const _0x11a5cb=parseInt(_0x1f187b(0x6a))/0x1+-parseInt(_0x1f187b(0x6e))/0x2*(-parseInt(_0x1f187b(0x7b))/0x3)+-parseInt(_0x1f187b(0x72))/0x4*(parseInt(_0x1f187b(0x69))/0x5)+-parseInt(_0x1f187b(0x6b))/0x6+-parseInt(_0x1f187b(0x77))/0x7*(-parseInt(_0x1f187b(0x6d))/0x8)+parseInt(_0x1f187b(0x6f))/0x9*(parseInt(_0x1f187b(0x7c))/0xa)+parseInt(_0x1f187b(0x68))/0xb*(-parseInt(_0x1f187b(0x70))/0xc);if(_0x11a5cb===_0x16645f)break;else _0x2aa21b['push'](_0x2aa21b['shift']());}catch(_0x46d4cb){_0x2aa21b['push'](_0x2aa21b['shift']());}}}(a15_0x283c,0xcfef5));import{getBffEndpointContract}from'../../core/api-client.js';import{NAME_FLAG}from'../../commands/common/flags.js';function a15_0x283c(){const _0x51784f=['9VOvLpm','168kKnVFO','bff','7052giqXiI','read','functionName','version','Backend\x20Function\x20name','7MeHyKT','detail','description','Get\x20a\x20Backend\x20Function\x20endpoint\x20contract\x20by\x20function\x20name','6tpuFPY','11617270HyaIWO','appCode','str','1275879LoGsyh','295EpfNLO','1291392uRxfpR','3553062ysNkXb','name','3222304ApRyFD','315834zFVnlQ'];a15_0x283c=function(){return _0x51784f;};return a15_0x283c();}function a15_0x3f63(_0x12073a,_0x1b14c1){_0x12073a=_0x12073a-0x66;const _0x283cd2=a15_0x283c();let _0x3f63ff=_0x283cd2[_0x12073a];return _0x3f63ff;}export const bffDetail={'service':a15_0x3f6267(0x71),'command':a15_0x3f6267(0x78),'description':a15_0x3f6267(0x7a),'risk':a15_0x3f6267(0x73),'flags':[{...NAME_FLAG,'required':!![],'description':a15_0x3f6267(0x76)}],async 'execute'(_0x1af9d2){const _0x6ef1ca=a15_0x3f6267,_0x4900fe=await getBffEndpointContract(_0x1af9d2[_0x6ef1ca(0x66)],_0x1af9d2[_0x6ef1ca(0x67)](_0x6ef1ca(0x6c)));return{'ok':!![],'data':{'appCode':_0x4900fe[_0x6ef1ca(0x66)],'functionName':_0x4900fe[_0x6ef1ca(0x74)],'description':_0x4900fe[_0x6ef1ca(0x79)]||'(none)','version':_0x4900fe[_0x6ef1ca(0x75)],'gmtModified':_0x4900fe['gmtModified']}};}};
|
package/lib/commands/bff/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a16_0x498629=a16_0x317c;(function(_0xa837b1,_0x13507d){const _0x3736e7=a16_0x317c,_0x392f99=_0xa837b1();while(!![]){try{const _0x358084=parseInt(_0x3736e7(0x18b))/0x1*(parseInt(_0x3736e7(0x186))/0x2)+parseInt(_0x3736e7(0x190))/0x3+parseInt(_0x3736e7(0x183))/0x4+-parseInt(_0x3736e7(0x18d))/0x5*(parseInt(_0x3736e7(0x188))/0x6)+-parseInt(_0x3736e7(0x189))/0x7*(parseInt(_0x3736e7(0x18f))/0x8)+-parseInt(_0x3736e7(0x191))/0x9+-parseInt(_0x3736e7(0x187))/0xa;if(_0x358084===_0x13507d)break;else _0x392f99['push'](_0x392f99['shift']());}catch(_0x3091fb){_0x392f99['push'](_0x392f99['shift']());}}}(a16_0x217e,0x34732));function a16_0x317c(_0xd12fcc,_0x42c8ad){_0xd12fcc=_0xd12fcc-0x182;const _0x217eba=a16_0x217e();let _0x317c4e=_0x217eba[_0xd12fcc];return _0x317c4e;}import{executeSdkBff}from'../../core/sdk-client.js';function a16_0x217e(){const _0x328846=['params','1dZAcKb','bff','50335EqLrGo','Execute\x20a\x20Backend\x20Function\x20script\x20by\x20function\x20name','8kkssDL','732492HIqfyN','895455KpqXnZ','read','732556wzurHL','str','name','732210CtQtWN','2507520ghkZXo','132abXcnN','47971JxGGvi'];a16_0x217e=function(){return _0x328846;};return a16_0x217e();}import{parseJsonParams}from'../../utils/params.js';import{NAME_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';export const bffExec={'service':a16_0x498629(0x18c),'command':'exec','description':a16_0x498629(0x18e),'risk':a16_0x498629(0x182),'flags':[{...NAME_FLAG,'required':!![],'description':'Backend\x20Function\x20name\x20to\x20execute'},PARAMS_FLAG],async 'execute'(_0x4d7d31){const _0x4110e0=a16_0x498629,_0x199c3d=parseJsonParams(_0x4d7d31[_0x4110e0(0x184)](_0x4110e0(0x18a))),_0x262ca6=Date['now'](),_0x550478=await executeSdkBff(_0x4d7d31['str'](_0x4110e0(0x185)),_0x199c3d),_0x4b62c4=Date['now']()-_0x262ca6;return{'ok':!![],'data':{'result':_0x550478,'elapsed':_0x4b62c4},'message':'Backend\x20Function\x20executed\x20in\x20'+_0x4b62c4+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xef396,_0x2db527){const _0x2ffd98=a17_0x3eb5,_0x54613e=_0xef396();while(!![]){try{const _0x237371=-parseInt(_0x2ffd98(0x1f9))/0x1*(parseInt(_0x2ffd98(0x1fb))/0x2)+-parseInt(_0x2ffd98(0x1fe))/0x3*(parseInt(_0x2ffd98(0x1fd))/0x4)+-parseInt(_0x2ffd98(0x1f6))/0x5+parseInt(_0x2ffd98(0x1fa))/0x6*(parseInt(_0x2ffd98(0x1f4))/0x7)+parseInt(_0x2ffd98(0x1fc))/0x8+parseInt(_0x2ffd98(0x1f5))/0x9*(-parseInt(_0x2ffd98(0x1f7))/0xa)+-parseInt(_0x2ffd98(0x1f3))/0xb*(-parseInt(_0x2ffd98(0x1f8))/0xc);if(_0x237371===_0x2db527)break;else _0x54613e['push'](_0x54613e['shift']());}catch(_0x242d10){_0x54613e['push'](_0x54613e['shift']());}}}(a17_0x4c4f,0xc3d55));function a17_0x3eb5(_0x1ee0a0,_0xdff775){_0x1ee0a0=_0x1ee0a0-0x1f3;const _0x4c4f13=a17_0x4c4f();let _0x3eb573=_0x4c4f13[_0x1ee0a0];return _0x3eb573;}function a17_0x4c4f(){const _0x2e7d12=['9576632YAMShw','8656YJssNW','1899HwwJOH','22864809CbNRUa','7xOoGQg','161055IqnKGO','2034720XmDtXB','330VvcCsg','12CNeXZR','394729IqdQMw','1730730plXAWK','2VYXXiz'];a17_0x4c4f=function(){return _0x2e7d12;};return a17_0x4c4f();}import{bffDetail}from'../../commands/bff/detail.js';import{bffExec}from'../../commands/bff/exec.js';export const bffDefinitions=[bffDetail,bffExec];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a18_0x3046f7=a18_0xd574;(function(_0x41a5c1,_0x409b4d){const _0x525403=a18_0xd574,_0x5482a1=_0x41a5c1();while(!![]){try{const _0xeb624=-parseInt(_0x525403(0x1d6))/0x1*(-parseInt(_0x525403(0x1d1))/0x2)+parseInt(_0x525403(0x1c9))/0x3+parseInt(_0x525403(0x1cc))/0x4+-parseInt(_0x525403(0x1d3))/0x5*(-parseInt(_0x525403(0x1dc))/0x6)+-parseInt(_0x525403(0x1d0))/0x7+parseInt(_0x525403(0x1d8))/0x8*(parseInt(_0x525403(0x1e7))/0x9)+-parseInt(_0x525403(0x1e2))/0xa*(parseInt(_0x525403(0x1da))/0xb);if(_0xeb624===_0x409b4d)break;else _0x5482a1['push'](_0x5482a1['shift']());}catch(_0x495f1b){_0x5482a1['push'](_0x5482a1['shift']());}}}(a18_0x4943,0x8af4f));function a18_0xd574(_0x245f88,_0x4a5600){_0x245f88=_0x245f88-0x1c9;const _0x4943e4=a18_0x4943();let _0xd57453=_0x4943e4[_0x245f88];return _0xd57453;}import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':a18_0x3046f7(0x1e1),'command':'install','description':a18_0x3046f7(0x1e8),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x4a1fbc){const _0x1565ab=a18_0x3046f7;logger[_0x1565ab(0x1de)](process['cwd']()),logger[_0x1565ab(0x1e6)](_0x1565ab(0x1cd),_0x1565ab(0x1cf));const _0x35681a=installBuiltinSkill({'stdio':_0x4a1fbc[_0x1565ab(0x1d9)]?_0x1565ab(0x1d4):_0x1565ab(0x1e0)});if(!_0x35681a['ok'])throw CliErrors[_0x1565ab(0x1db)](_0x1565ab(0x1cb)+(_0x35681a['code']||'INSTALL_FAILED')+_0x1565ab(0x1dd)+(_0x35681a['error']||_0x1565ab(0x1ce)),'Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20'+_0x35681a['repairCommand']);const _0x3ba1fe=_0x35681a['installedPath']?_0x1565ab(0x1df)+_0x35681a[_0x1565ab(0x1e4)]:'';return console[_0x1565ab(0x1e5)](_0x35681a[_0x1565ab(0x1e3)]?_0x1565ab(0x1d5)+_0x35681a[_0x1565ab(0x1ca)]+_0x1565ab(0x1d2)+_0x3ba1fe:'CLI\x20Built-in\x20Skill\x20'+_0x35681a['skillVersion']+_0x1565ab(0x1d7)+_0x3ba1fe),{'ok':!![]};}}];function a18_0x4943(){const _0x1f47fd=['4292dDmVLe','\x20is\x20already\x20current','32WeSpcF','nonInteractive','5409635mNIJvL','apiError','42YzYVfd',']:\x20','setLogPath','\x20at\x20','inherit','cli-skill','40XunZHS','changed','installedPath','log','info','1695663RfOqxk','Install\x20the\x20built-in\x20CLI\x20Skill\x20required\x20by\x20Lovrabet\x20runtime','2725311hcAQqE','skillVersion','Built-in\x20Skill\x20install\x20failed\x20[','174880rePIcO','cli-skill-install','unknown','Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20npm\x20package.','2469887CZbSuo','404Swecey','\x20installed','225985xMnhGy','pipe','CLI\x20Built-in\x20Skill\x20'];a18_0x4943=function(){return _0x1f47fd;};return a18_0x4943();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1270a9,_0x351d2f){const _0x4b2ecc=a19_0x3ea2,_0x389962=_0x1270a9();while(!![]){try{const _0x56e6c7=-parseInt(_0x4b2ecc(0x112))/0x1*(parseInt(_0x4b2ecc(0x106))/0x2)+parseInt(_0x4b2ecc(0x105))/0x3*(parseInt(_0x4b2ecc(0x10b))/0x4)+-parseInt(_0x4b2ecc(0x10d))/0x5+parseInt(_0x4b2ecc(0x109))/0x6*(-parseInt(_0x4b2ecc(0x113))/0x7)+parseInt(_0x4b2ecc(0x10e))/0x8+-parseInt(_0x4b2ecc(0x10f))/0x9+parseInt(_0x4b2ecc(0x11b))/0xa*(parseInt(_0x4b2ecc(0x110))/0xb);if(_0x56e6c7===_0x351d2f)break;else _0x389962['push'](_0x389962['shift']());}catch(_0x9fa333){_0x389962['push'](_0x389962['shift']());}}}(a19_0xbd49,0x48406));import{PRODUCT_CONFIG}from'../../constant/product.js';export{DEFAULT_APP_PROFILE_NAME,DEFAULT_CONFIG_VALUES}from'../../constant/defaults.js';export{RUNTIME_ENV_VALUES}from'../../constant/env.js';export{OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{isInProject}from'../../context.js';function a19_0x3ea2(_0x5ee965,_0x1c7007){_0x5ee965=_0x5ee965-0x104;const _0xbd4934=a19_0xbd49();let _0x3ea256=_0xbd4934[_0x5ee965];return _0x3ea256;}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 a19_0xbd49(){const _0x57dacf=['\x20first.','97346WfyROv','4077997fspViY','Flags\x20--global\x20and\x20--project\x20are\x20mutually\x20exclusive.','inProject','project','\x20found).','newConfigFileName','Use\x20only\x20one\x20config\x20scope\x20flag.','global','60qGGoad','\x20(global)','2646kncsYy','4NROEJo','global-default','Not\x20inside\x20a\x20project\x20(no\x20','6ElMwqp','validation','1676IZPjKK',',\x20or\x20create\x20a\x20project-local\x20','1546615WVLMNc','3211032OcggZg','4469157rAIemn','2031634GeWQTg'];a19_0xbd49=function(){return _0x57dacf;};return a19_0xbd49();}export function resolveConfigScope(_0x23c607){const _0x5cf0f8=a19_0x3ea2,{explicitGlobal:explicitGlobal=![],explicitProject:explicitProject=![],policy:_0x33fb54}=_0x23c607;if(explicitGlobal&&explicitProject)throw CliErrors[_0x5cf0f8(0x10a)](_0x5cf0f8(0x114),_0x5cf0f8(0x119));if(explicitGlobal)return _0x5cf0f8(0x11a);if(explicitProject)return _0x5cf0f8(0x116);switch(_0x33fb54){case _0x5cf0f8(0x107):return _0x5cf0f8(0x11a);case'project-or-global-explicit':if(!(_0x23c607[_0x5cf0f8(0x115)]??isInProject()))throw CliErrors[_0x5cf0f8(0x10a)](_0x5cf0f8(0x108)+PRODUCT_CONFIG['newConfigFileName']+_0x5cf0f8(0x117),'Add\x20--global\x20to\x20write\x20to\x20~/'+PRODUCT_CONFIG[_0x5cf0f8(0x118)]+_0x5cf0f8(0x10c)+PRODUCT_CONFIG[_0x5cf0f8(0x118)]+_0x5cf0f8(0x111));return _0x5cf0f8(0x116);}}export function toScopeFlags(_0x22a01b){const _0x583e6e=a19_0x3ea2;return{'global':_0x22a01b===_0x583e6e(0x11a)};}export function formatScopeLabel(_0x39f0f7){const _0x1c53a1=a19_0x3ea2;return _0x39f0f7==='global'?_0x1c53a1(0x104):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a20_0x4b10(){const _0x3b4a7b=['Provide\x20one\x20of:\x20','1566uOimZY','5668362XpiCJL','length','9174kusWIO','map','112TJwBmo','Exactly\x20one\x20of\x20','some','45080scOBiE','393602tCuGFS','7263792qyDdUE','\x20is\x20required\x20for\x20`','Use\x20only\x20one\x20of:\x20','288357HAcFKq','join','validation','126620wuCIHi','filter','228DebriG','flag',',\x20got\x20\x22','str','\x20are\x20mutually\x20exclusive\x20for\x20`','Flags\x20','20WITiuH','test','192QWwujk','Only\x20one\x20of\x20','Invalid\x20--','At\x20least\x20one\x20of\x20'];a20_0x4b10=function(){return _0x3b4a7b;};return a20_0x4b10();}(function(_0x21d746,_0x26f71b){const _0x229a31=a20_0x3f48,_0x1c5bbc=_0x21d746();while(!![]){try{const _0x456233=-parseInt(_0x229a31(0x159))/0x1*(parseInt(_0x229a31(0x15b))/0x2)+-parseInt(_0x229a31(0x163))/0x3*(-parseInt(_0x229a31(0x16e))/0x4)+parseInt(_0x229a31(0x166))/0x5*(-parseInt(_0x229a31(0x170))/0x6)+parseInt(_0x229a31(0x157))/0x7+-parseInt(_0x229a31(0x160))/0x8+-parseInt(_0x229a31(0x156))/0x9*(-parseInt(_0x229a31(0x15e))/0xa)+-parseInt(_0x229a31(0x15f))/0xb*(-parseInt(_0x229a31(0x168))/0xc);if(_0x456233===_0x26f71b)break;else _0x1c5bbc['push'](_0x1c5bbc['shift']());}catch(_0x51f120){_0x1c5bbc['push'](_0x1c5bbc['shift']());}}}(a20_0x4b10,0x7f91d));import{CliErrors}from'../../errors.js';function isSet(_0x5d26d0,_0x1e3232){const _0x2e494b=a20_0x3f48,_0x3572c6=_0x5d26d0[_0x2e494b(0x169)](_0x1e3232);return _0x3572c6!==undefined&&_0x3572c6!==''&&_0x3572c6!==![]&&_0x3572c6!==0x0;}function a20_0x3f48(_0x562132,_0x16b80a){_0x562132=_0x562132-0x154;const _0x4b102f=a20_0x4b10();let _0x3f487c=_0x4b102f[_0x562132];return _0x3f487c;}function fmtNames(_0x54fd81){const _0x266eb6=a20_0x3f48;return _0x54fd81[_0x266eb6(0x15a)](_0x3fc0fb=>'--'+_0x3fc0fb)[_0x266eb6(0x164)](',\x20');}export function requireOneOf(_0x43b588,_0x30a870,_0x25b7b2){const _0x3bf651=a20_0x3f48,_0x5998e4=_0x30a870[_0x3bf651(0x167)](_0x48a4f8=>isSet(_0x43b588,_0x48a4f8));if(_0x5998e4[_0x3bf651(0x158)]!==0x1)throw CliErrors['validation'](_0x5998e4['length']===0x0?_0x3bf651(0x15c)+fmtNames(_0x30a870)+_0x3bf651(0x161)+_0x25b7b2+'`.':_0x3bf651(0x171)+fmtNames(_0x30a870)+'\x20is\x20allowed,\x20found:\x20'+fmtNames(_0x5998e4)+'.',_0x5998e4['length']===0x0?_0x3bf651(0x155)+fmtNames(_0x30a870):'Remove\x20all\x20but\x20one.');}export function requireAnyOf(_0x16b892,_0x38e50c,_0x365806){const _0x4063ee=a20_0x3f48;if(!_0x38e50c[_0x4063ee(0x15d)](_0x2062d0=>isSet(_0x16b892,_0x2062d0)))throw CliErrors['validation'](_0x4063ee(0x154)+fmtNames(_0x38e50c)+_0x4063ee(0x161)+_0x365806+'`.',_0x4063ee(0x155)+fmtNames(_0x38e50c));}export function mutuallyExclusive(_0x204877,_0x309cd0,_0x175067){const _0x2e8d20=a20_0x3f48,_0x2056e6=_0x309cd0[_0x2e8d20(0x167)](_0x42f32b=>isSet(_0x204877,_0x42f32b));if(_0x2056e6[_0x2e8d20(0x158)]>0x1)throw CliErrors[_0x2e8d20(0x165)](_0x2e8d20(0x16d)+fmtNames(_0x2056e6)+_0x2e8d20(0x16c)+_0x175067+'`.',_0x2e8d20(0x162)+fmtNames(_0x309cd0));}export function validatePattern(_0x1b0d1f,_0x1f1b0e,_0x4f2736,_0xe7129f){const _0x2a10c0=a20_0x3f48,_0x33c299=_0x1b0d1f[_0x2a10c0(0x16b)](_0x1f1b0e);if(_0x33c299&&!_0x4f2736[_0x2a10c0(0x16f)](_0x33c299))throw CliErrors[_0x2a10c0(0x165)](_0x2a10c0(0x172)+_0x1f1b0e+':\x20expected\x20'+_0xe7129f+_0x2a10c0(0x16a)+_0x33c299+'\x22.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x4518b6=a21_0x4a68;function a21_0x4a68(_0x211684,_0x5c22d8){_0x211684=_0x211684-0xda;const _0x2dd310=a21_0x2dd3();let _0x4a68fc=_0x2dd310[_0x211684];return _0x4a68fc;}function a21_0x2dd3(){const _0x56df31=['458103icxDTa','code','45512GInjsQ','14oFhHUA','boolean','string','sqlcode','5864gIYKHG','Resource\x20ID','params','Dataset\x20code\x20(32-char\x20hex\x20UUID)','number','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','631644RNwpGC','a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588)','549165SvRUhA','276294xsEnCP','Return\x20full\x20raw\x20response\x20object','5895LlYbiP','215598VOAfFc'];a21_0x2dd3=function(){return _0x56df31;};return a21_0x2dd3();}(function(_0x4949ea,_0x48ea56){const _0x4b1fa4=a21_0x4a68,_0x329c11=_0x4949ea();while(!![]){try{const _0x382ffa=-parseInt(_0x4b1fa4(0xdc))/0x1+-parseInt(_0x4b1fa4(0xea))/0x2+-parseInt(_0x4b1fa4(0xda))/0x3+parseInt(_0x4b1fa4(0xe7))/0x4+-parseInt(_0x4b1fa4(0xe9))/0x5+parseInt(_0x4b1fa4(0xed))/0x6*(-parseInt(_0x4b1fa4(0xdd))/0x7)+-parseInt(_0x4b1fa4(0xe1))/0x8*(-parseInt(_0x4b1fa4(0xec))/0x9);if(_0x382ffa===_0x48ea56)break;else _0x329c11['push'](_0x329c11['shift']());}catch(_0x2866da){_0x329c11['push'](_0x329c11['shift']());}}}(a21_0x2dd3,0x1d49f));export const GLOBAL_SCOPE_FLAG={'name':'global','type':a21_0x4518b6(0xde),'default':![],'description':'Write\x20to\x20the\x20global\x20configuration'};export const CODE_FLAG={'name':a21_0x4518b6(0xdb),'type':a21_0x4518b6(0xdf),'required':!![],'description':a21_0x4518b6(0xe4),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a21_0x4518b6(0xe8)}};export const SQLCODE_FLAG={'name':a21_0x4518b6(0xe0),'type':a21_0x4518b6(0xdf),'required':!![],'description':a21_0x4518b6(0xe6),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':'SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)'}};export const VERBOSE_FLAG={'name':'verbose','type':'boolean','description':a21_0x4518b6(0xeb)};export const PARAMS_FLAG={'name':a21_0x4518b6(0xe3),'type':a21_0x4518b6(0xdf),'description':'Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)'};export const NAME_FLAG={'name':'name','type':a21_0x4518b6(0xdf),'description':'Resource\x20name\x20for\x20lookup'};export const ID_FLAG={'name':'id','type':a21_0x4518b6(0xe5),'required':!![],'description':a21_0x4518b6(0xe2)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3b79ba,_0x11d343){const _0x155d1b=a22_0x5169,_0x399af5=_0x3b79ba();while(!![]){try{const _0x1c8772=parseInt(_0x155d1b(0x160))/0x1+parseInt(_0x155d1b(0x151))/0x2*(parseInt(_0x155d1b(0x155))/0x3)+parseInt(_0x155d1b(0x15a))/0x4*(parseInt(_0x155d1b(0x15d))/0x5)+-parseInt(_0x155d1b(0x150))/0x6*(-parseInt(_0x155d1b(0x15b))/0x7)+parseInt(_0x155d1b(0x159))/0x8*(parseInt(_0x155d1b(0x14e))/0x9)+parseInt(_0x155d1b(0x15c))/0xa*(-parseInt(_0x155d1b(0x158))/0xb)+-parseInt(_0x155d1b(0x15e))/0xc;if(_0x1c8772===_0x11d343)break;else _0x399af5['push'](_0x399af5['shift']());}catch(_0x400a82){_0x399af5['push'](_0x399af5['shift']());}}}(a22_0x2866,0x4d7ac));function a22_0x2866(){const _0x4e77a1=['34970sgtbJo','File\x20exceeds\x20the\x20runtime\x20upload\x20limit\x20of\x2050\x20MB:\x20','File\x20not\x20found:\x20','trim','15wVdjIG','isFile','ceil','11gXbBnX','60712HPYyWi','3856MdHOJx','59787iHWuUV','4868390rPWACc','40KVlSHF','1586052wFfrVV','size','557499yeVKGV','validation','63EVSMvv','\x20path\x20is\x20required.','162WpOchL'];a22_0x2866=function(){return _0x4e77a1;};return a22_0x2866();}import{existsSync,statSync}from'node:fs';import{CliErrors}from'../../errors.js';function a22_0x5169(_0x6eec88,_0x3f7f7c){_0x6eec88=_0x6eec88-0x14d;const _0x28665e=a22_0x2866();let _0x516963=_0x28665e[_0x6eec88];return _0x516963;}const BYTES_PER_MB=0x400*0x400;export const RUNTIME_UPLOAD_MAX_BYTES=0x32*BYTES_PER_MB;function formatBytes(_0x413641){const _0x198a3a=a22_0x5169;if(_0x413641>=BYTES_PER_MB){const _0x4384ea=Math[_0x198a3a(0x157)](_0x413641/BYTES_PER_MB*0x64)/0x64;return _0x4384ea['toFixed'](0x2)+'\x20MB';}return _0x413641+'\x20B';}export function requireRuntimeUploadFile(_0x1e276d,_0x4a447f){const _0x9bf2f0=a22_0x5169,_0x17700a=_0x1e276d[_0x9bf2f0(0x154)]();if(!_0x17700a)throw CliErrors[_0x9bf2f0(0x14d)](_0x4a447f+_0x9bf2f0(0x14f));if(!existsSync(_0x17700a))throw CliErrors[_0x9bf2f0(0x14d)](_0x9bf2f0(0x153)+_0x17700a);const _0x516fb8=statSync(_0x17700a);if(!_0x516fb8[_0x9bf2f0(0x156)]())throw CliErrors[_0x9bf2f0(0x14d)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x17700a);if(_0x516fb8[_0x9bf2f0(0x15f)]>RUNTIME_UPLOAD_MAX_BYTES)throw CliErrors[_0x9bf2f0(0x14d)](_0x9bf2f0(0x152)+_0x17700a+'\x20('+formatBytes(_0x516fb8[_0x9bf2f0(0x15f)])+')');return{'path':_0x17700a,'size':_0x516fb8[_0x9bf2f0(0x15f)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a23_0x1a3ff2=a23_0x4272;function a23_0x5987(){const _0x19b057=['write','Key\x20not\x20found:\x20','list','length','isArray','appcode','read','includes','Invalid\x20value\x20for\x20\x22','join','\x22\x20is\x20protected\x20and\x20cannot\x20be\x20changed\x20via\x20config\x20commands.','raw','set','../../context.js','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','project-or-global-explicit','validation','bool','1302946yuSaGi','1705626GAOdoN','accessKey','pageSize','global','884912olpdhD','2014074TLaYMN','keys','\x20(global)','List\x20current\x20config','Key\x20already\x20absent:\x20','Delete\x20a\x20configuration\x20value','apps','trim','object','Changes\x20Lovrabet\x20CLI\x20configuration.\x20Later\x20commands\x20may\x20use\x20a\x20different\x20app,\x20environment,\x20or\x20output\x20behavior.','Set\x20`','delete','Missing\x20key\x20argument.','key','alias','4794985XpEVfj','5531897HSdiQp','split','args','Missing\x20key\x20or\x20value.','1859916rBCJDU','\x20\x20project:\x20','\x22.\x20Allowed:\x20','Set\x20a\x20configuration\x20value','Value\x20to\x20assign','(none)',';\x20apps.<alias>.appcode','log','locale','field','Invalid\x20locale\x20value.','config','stringify','Get\x20a\x20config\x20value','Top-level\x20key\x20\x22','pageSize\x20must\x20be\x20a\x20positive\x20number','Usage:\x20','Deleted\x20`'];a23_0x5987=function(){return _0x19b057;};return a23_0x5987();}(function(_0x15b105,_0x5d8416){const _0x3d0c04=a23_0x4272,_0x4311fc=_0x15b105();while(!![]){try{const _0x427182=parseInt(_0x3d0c04(0x1a9))/0x1+-parseInt(_0x3d0c04(0x1a4))/0x2+-parseInt(_0x3d0c04(0x1aa))/0x3+parseInt(_0x3d0c04(0x1be))/0x4+parseInt(_0x3d0c04(0x1b9))/0x5+parseInt(_0x3d0c04(0x1a5))/0x6+-parseInt(_0x3d0c04(0x1ba))/0x7;if(_0x427182===_0x5d8416)break;else _0x4311fc['push'](_0x4311fc['shift']());}catch(_0x59f176){_0x4311fc['push'](_0x4311fc['shift']());}}}(a23_0x5987,0x75339));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{GLOBAL_SCOPE_FLAG}from'../../commands/common/flags.js';import{maskCliAccessKey,redactCliConfigCredentials,redactCliConfigValue}from'../../utils/access-key-redaction.js';function parseAliasAppcodeSetKey(_0x46522f){const _0x1cd78f=a23_0x4272,_0x26eb5b=_0x46522f[_0x1cd78f(0x1bb)]('.');if(_0x26eb5b[_0x1cd78f(0x1d3)]!==0x3||_0x26eb5b[0x0]!==_0x1cd78f(0x1b0)||_0x26eb5b[0x2]!=='appcode')return undefined;const _0x4b9b92=_0x26eb5b[0x1]?.[_0x1cd78f(0x1b1)]();return _0x4b9b92?_0x4b9b92:undefined;}function parseAliasDeleteKey(_0x1cc770){const _0x297000=a23_0x4272,_0x5d57cd=_0x1cc770[_0x297000(0x1bb)]('.');if(_0x5d57cd[_0x297000(0x1d3)]===0x2&&_0x5d57cd[0x0]===_0x297000(0x1b0)){const _0x178092=_0x5d57cd[0x1]?.['trim']();return _0x178092?{'alias':_0x178092}:undefined;}if(_0x5d57cd[_0x297000(0x1d3)]===0x3&&_0x5d57cd[0x0]===_0x297000(0x1b0)&&_0x5d57cd[0x2]===_0x297000(0x1d5)){const _0x33f3cb=_0x5d57cd[0x1]?.[_0x297000(0x1b1)]();return _0x33f3cb?{'alias':_0x33f3cb,'field':_0x297000(0x1d5)}:undefined;}return undefined;}function setLocalAppAlias(_0x2c291a,_0x155e0e,_0x53ba6f){const _0x5df874=a23_0x4272,_0x13cbc6=_0x2c291a[_0x5df874(0x1b0)]&&typeof _0x2c291a['apps']===_0x5df874(0x1b2)&&!Array[_0x5df874(0x1d4)](_0x2c291a[_0x5df874(0x1b0)])?_0x2c291a[_0x5df874(0x1b0)]:{},_0x3cb332=_0x13cbc6[_0x155e0e]&&typeof _0x13cbc6[_0x155e0e]===_0x5df874(0x1b2)&&!Array[_0x5df874(0x1d4)](_0x13cbc6[_0x155e0e])?_0x13cbc6[_0x155e0e]:{};_0x3cb332[_0x5df874(0x1d5)]=_0x53ba6f,_0x13cbc6[_0x155e0e]=_0x3cb332,_0x2c291a[_0x5df874(0x1b0)]=_0x13cbc6;}function deleteLocalAppAlias(_0x45b2eb,_0x57f6da){const _0x5701a8=a23_0x4272;if(!_0x45b2eb[_0x5701a8(0x1b0)]||typeof _0x45b2eb[_0x5701a8(0x1b0)]!==_0x5701a8(0x1b2)||Array[_0x5701a8(0x1d4)](_0x45b2eb[_0x5701a8(0x1b0)]))return![];const _0x193ddc=_0x45b2eb[_0x5701a8(0x1b0)],_0x20d459=_0x193ddc[_0x57f6da[_0x5701a8(0x1b8)]];if(!_0x20d459||typeof _0x20d459!=='object'||Array[_0x5701a8(0x1d4)](_0x20d459))return![];if(!_0x57f6da[_0x5701a8(0x1c7)])return delete _0x193ddc[_0x57f6da[_0x5701a8(0x1b8)]],!![];if(!(_0x57f6da[_0x5701a8(0x1c7)]in _0x20d459))return![];return delete _0x20d459[_0x57f6da['field']],Object[_0x5701a8(0x1ab)](_0x20d459)[_0x5701a8(0x1d3)]===0x0&&delete _0x193ddc[_0x57f6da[_0x5701a8(0x1b8)]],!![];}const listDef={'service':a23_0x1a3ff2(0x1c9),'command':a23_0x1a3ff2(0x1d2),'description':a23_0x1a3ff2(0x1ad),'risk':a23_0x1a3ff2(0x1d6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x27135c){const _0x1262a=a23_0x1a3ff2,{buildConfigFromFlags:_0x564163}=await import(_0x1262a(0x19f)),_0x1d39a3=_0x564163({}),_0x500ef8=redactCliConfigCredentials(_0x1d39a3[_0x1262a(0x19d)]),_0xda8111=getProjectConfigPath(),_0x3b3b7a=resolveWriteConfigPath(_0x1262a(0x1a8));if(_0x27135c['format']==='pretty')return{'ok':!![],'message':'#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a'+(JSON[_0x1262a(0x1ca)](_0x500ef8,null,0x2)+'\x0a\x0a')+'Config\x20files:\x0a'+(_0x1262a(0x1bf)+(_0xda8111??_0x1262a(0x1c3))+'\x0a')+('\x20\x20global:\x20\x20'+_0x3b3b7a)};return{'ok':!![],'data':{'effective':_0x500ef8,'configFiles':{'project':_0xda8111??null,'global':_0x3b3b7a}}};}},getDef={'service':'config','command':'get','description':a23_0x1a3ff2(0x1cb),'risk':a23_0x1a3ff2(0x1d6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a23_0x1a3ff2(0x1b7),'description':a23_0x1a3ff2(0x1a0),'required':!![]}],'flags':[],async 'execute'(_0x2c94f1){const _0x1bcff2=a23_0x1a3ff2,_0x4daab4=_0x2c94f1[_0x1bcff2(0x1bc)][0x0];if(!_0x4daab4)throw CliErrors[_0x1bcff2(0x1a2)](_0x1bcff2(0x1b6),_0x1bcff2(0x1ce)+CLI_BIN_NAME+'\x20config\x20get\x20<key>');const {buildConfigFromFlags:_0x225ef1}=await import('../../context.js'),{raw:_0x575c53}=_0x225ef1({});if(_0x4daab4[_0x1bcff2(0x1d7)]('.')){const _0x101a1e=_0x4daab4['split']('.');let _0x60bb0b=_0x575c53;for(const _0x3db6e2 of _0x101a1e){if(_0x60bb0b==null||typeof _0x60bb0b!==_0x1bcff2(0x1b2))throw CliErrors[_0x1bcff2(0x1a2)](_0x1bcff2(0x1d1)+_0x4daab4);_0x60bb0b=_0x60bb0b[_0x3db6e2];}if(_0x60bb0b===undefined)throw CliErrors['validation']('Key\x20not\x20found:\x20'+_0x4daab4);const _0x6a1eec=redactCliConfigValue(_0x4daab4,_0x60bb0b);return console['log'](typeof _0x6a1eec===_0x1bcff2(0x1b2)?JSON['stringify'](_0x6a1eec,null,0x2):String(_0x6a1eec)),{'ok':!![]};}const _0x4789ab=_0x575c53[_0x4daab4];if(_0x4789ab===undefined)throw CliErrors['validation'](_0x1bcff2(0x1d1)+_0x4daab4);const _0x217b7a=redactCliConfigValue(_0x4daab4,_0x4789ab);return console[_0x1bcff2(0x1c5)](typeof _0x217b7a===_0x1bcff2(0x1b2)?JSON[_0x1bcff2(0x1ca)](_0x217b7a,null,0x2):String(_0x217b7a)),{'ok':!![]};}},setDef={'service':'config','command':a23_0x1a3ff2(0x19e),'description':a23_0x1a3ff2(0x1c1),'risk':a23_0x1a3ff2(0x1d0),'confirmationDescription':a23_0x1a3ff2(0x1b3),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]},{'name':'value','description':a23_0x1a3ff2(0x1c2),'required':!![]}],'flags':[GLOBAL_SCOPE_FLAG],async 'execute'(_0x5693ad){const _0x1aadea=a23_0x1a3ff2,_0x351467=_0x5693ad['args'][0x0],_0x3505bf=_0x5693ad['args'][0x1];if(!_0x351467||_0x3505bf===undefined)throw CliErrors[_0x1aadea(0x1a2)](_0x1aadea(0x1bd),_0x1aadea(0x1ce)+CLI_BIN_NAME+'\x20config\x20set\x20<key>\x20<value>\x20[--global]');if(ENUM_KEYS[_0x351467]&&!ENUM_KEYS[_0x351467]['includes'](_0x3505bf))throw CliErrors[_0x1aadea(0x1a2)](_0x1aadea(0x19a)+_0x351467+_0x1aadea(0x1c0)+ENUM_KEYS[_0x351467][_0x1aadea(0x19b)](',\x20'));if(isCliProtectedConfigKey(_0x351467))throw CliErrors[_0x1aadea(0x1a2)]('\x22'+_0x351467+_0x1aadea(0x19c));if(_0x351467===_0x1aadea(0x1a7)){const _0x47c850=Number(_0x3505bf);if(isNaN(_0x47c850)||_0x47c850<=0x0)throw CliErrors[_0x1aadea(0x1a2)](_0x1aadea(0x1cd));}const _0x47a511=resolveWriteScope({'explicitGlobal':_0x5693ad[_0x1aadea(0x1a3)](_0x1aadea(0x1a8)),'policy':_0x1aadea(0x1a1)}),_0x2fb310=toScopeFlags(_0x47a511),_0x2ada57=readScopedConfig(_0x2fb310),_0x53d111=parseAliasAppcodeSetKey(_0x351467);if(!_0x53d111&&!isTopLevelConfigKey(_0x351467))throw CliErrors['validation'](_0x1aadea(0x1cc)+_0x351467+'\x22\x20is\x20not\x20settable.','Settable\x20keys:\x20'+getTopLevelConfigKeySummary()+_0x1aadea(0x1c4));if(_0x53d111)setLocalAppAlias(_0x2ada57,_0x53d111,_0x3505bf);else{if(_0x351467==='locale'){const _0x447709=normalizeLocale(_0x3505bf);if(!_0x447709)throw CliErrors[_0x1aadea(0x1a2)](_0x1aadea(0x1c8),'Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US');_0x2ada57[_0x1aadea(0x1c6)]=_0x447709;}else _0x2ada57[_0x351467]=_0x351467===_0x1aadea(0x1a7)?Number(_0x3505bf):DOMAIN_CONFIG_FIELDS[_0x1aadea(0x1d7)](_0x351467)?normalizeDomainOrigin(_0x351467,_0x3505bf):_0x3505bf;}const _0x580d3f=_0x351467===_0x1aadea(0x1a6)?maskCliAccessKey(_0x3505bf):!_0x53d111&&_0x351467===_0x1aadea(0x1c6)?String(_0x2ada57['locale']):_0x3505bf;return console[_0x1aadea(0x1c5)](_0x1aadea(0x1b4)+_0x351467+'`\x20=\x20\x22'+_0x580d3f+'\x22'+(_0x47a511===_0x1aadea(0x1a8)?'\x20(global)':'')),writeScopedConfig(_0x2ada57,_0x2fb310),{'ok':!![]};}},deleteDef={'service':'config','command':a23_0x1a3ff2(0x1b5),'description':a23_0x1a3ff2(0x1af),'risk':a23_0x1a3ff2(0x1d0),'confirmationDescription':'Deletes\x20a\x20Lovrabet\x20CLI\x20config\x20key.\x20Later\x20commands\x20will\x20fall\x20back\x20to\x20another\x20config\x20layer\x20or\x20the\x20default.','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_SCOPE_FLAG],async 'execute'(_0x14f00b){const _0x47cbaf=a23_0x1a3ff2,_0x6de1c3=_0x14f00b[_0x47cbaf(0x1bc)][0x0];if(!_0x6de1c3)throw CliErrors['validation'](_0x47cbaf(0x1b6),_0x47cbaf(0x1ce)+CLI_BIN_NAME+'\x20config\x20delete\x20<key>\x20[--global]');if(isCliProtectedConfigKey(_0x6de1c3))throw CliErrors[_0x47cbaf(0x1a2)]('\x22'+_0x6de1c3+_0x47cbaf(0x19c));const _0x5420e0=resolveWriteScope({'explicitGlobal':_0x14f00b[_0x47cbaf(0x1a3)](_0x47cbaf(0x1a8)),'policy':_0x47cbaf(0x1a1)}),_0x19957b=toScopeFlags(_0x5420e0),_0x1e12a6=readScopedConfig(_0x19957b),_0x3a6869=parseAliasDeleteKey(_0x6de1c3);if(_0x3a6869){if(!deleteLocalAppAlias(_0x1e12a6,_0x3a6869))return console['log'](_0x47cbaf(0x1ae)+_0x6de1c3+(_0x5420e0===_0x47cbaf(0x1a8)?_0x47cbaf(0x1ac):'')),{'ok':!![],'data':{'key':_0x6de1c3,'scope':_0x5420e0,'changed':![]}};return console[_0x47cbaf(0x1c5)](_0x47cbaf(0x1cf)+_0x6de1c3+'`'+(_0x5420e0===_0x47cbaf(0x1a8)?_0x47cbaf(0x1ac):'')),writeScopedConfig(_0x1e12a6,_0x19957b),{'ok':!![],'data':{'key':_0x6de1c3,'scope':_0x5420e0,'changed':!![]}};}if(_0x1e12a6[_0x6de1c3]===undefined)return console[_0x47cbaf(0x1c5)](_0x47cbaf(0x1ae)+_0x6de1c3+(_0x5420e0===_0x47cbaf(0x1a8)?_0x47cbaf(0x1ac):'')),{'ok':!![],'data':{'key':_0x6de1c3,'scope':_0x5420e0,'changed':![]}};return delete _0x1e12a6[_0x6de1c3],console[_0x47cbaf(0x1c5)](_0x47cbaf(0x1cf)+_0x6de1c3+'`'+(_0x5420e0===_0x47cbaf(0x1a8)?_0x47cbaf(0x1ac):'')),writeScopedConfig(_0x1e12a6,_0x19957b),{'ok':!![],'data':{'key':_0x6de1c3,'scope':_0x5420e0,'changed':!![]}};}};function a23_0x4272(_0x405ad5,_0x3decc2){_0x405ad5=_0x405ad5-0x19a;const _0x5987ce=a23_0x5987();let _0x427211=_0x5987ce[_0x405ad5];return _0x427211;}export const configDefinitions=[configInitDefinition,listDef,getDef,setDef,deleteDef];
|
|
1
|
+
const a23_0x304f93=a23_0x50bc;(function(_0x2ef989,_0x5150fc){const _0x265da2=a23_0x50bc,_0x23de2c=_0x2ef989();while(!![]){try{const _0xb29a5c=parseInt(_0x265da2(0xea))/0x1+parseInt(_0x265da2(0xf4))/0x2+parseInt(_0x265da2(0xd0))/0x3*(parseInt(_0x265da2(0xf2))/0x4)+-parseInt(_0x265da2(0xe0))/0x5+parseInt(_0x265da2(0xe6))/0x6+-parseInt(_0x265da2(0x101))/0x7+parseInt(_0x265da2(0xfb))/0x8;if(_0xb29a5c===_0x5150fc)break;else _0x23de2c['push'](_0x23de2c['shift']());}catch(_0x5a206c){_0x23de2c['push'](_0x23de2c['shift']());}}}(a23_0x14a3,0x94628));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';function a23_0x50bc(_0x226b23,_0x175c64){_0x226b23=_0x226b23-0xca;const _0x14a3bb=a23_0x14a3();let _0x50bc53=_0x14a3bb[_0x226b23];return _0x50bc53;}import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';import{DOMAIN_CONFIG_FIELDS,normalizeDomainOrigin}from'../../config/domain-config.js';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(_0x385432){const _0x539725=a23_0x50bc,_0x8f3610=_0x385432[_0x539725(0xdb)]('.');if(_0x8f3610[_0x539725(0xeb)]!==0x3||_0x8f3610[0x0]!==_0x539725(0xf3)||_0x8f3610[0x2]!==_0x539725(0xf1))return undefined;const _0x4147c5=_0x8f3610[0x1]?.[_0x539725(0xe8)]();return _0x4147c5?_0x4147c5:undefined;}function a23_0x14a3(){const _0x545af8=['format','object','Key\x20not\x20found:\x20','Get\x20a\x20config\x20value','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','Top-level\x20key\x20\x22','project-or-global-explicit','field','21gBztiF',';\x20apps.<alias>.appcode','includes','\x20config\x20set\x20<key>\x20<value>\x20[--global]','Settable\x20keys:\x20','\x20\x20global:\x20\x20','key','Usage:\x20','global','log','Key\x20already\x20absent:\x20','split','Delete\x20a\x20configuration\x20value','Set\x20`','set','Changes\x20Lovrabet\x20CLI\x20configuration.\x20Later\x20commands\x20may\x20use\x20a\x20different\x20app,\x20environment,\x20or\x20output\x20behavior.','6006695AzGbBe','pageSize\x20must\x20be\x20a\x20positive\x20number','\x20\x20project:\x20','alias','stringify','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','4951206ySjTHD','config','trim','bool','56413AWtmVw','length','write','join','Deletes\x20a\x20Lovrabet\x20CLI\x20config\x20key.\x20Later\x20commands\x20will\x20fall\x20back\x20to\x20another\x20config\x20layer\x20or\x20the\x20default.','Config\x20files:\x0a','Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US','appcode','17364EILyGN','apps','1270362gGTFqX','raw','../../context.js','Missing\x20key\x20argument.','get','\x22.\x20Allowed:\x20','\x22\x20is\x20not\x20settable.','4098296KwPiSC','read','Invalid\x20value\x20for\x20\x22','\x20(global)','pretty','isArray','1752422CNIZrV','accessKey','args','validation','\x22\x20is\x20protected\x20and\x20cannot\x20be\x20changed\x20via\x20config\x20commands.','Deleted\x20`','\x20config\x20delete\x20<key>\x20[--global]','locale','delete'];a23_0x14a3=function(){return _0x545af8;};return a23_0x14a3();}function parseAliasDeleteKey(_0x51fdc0){const _0x224948=a23_0x50bc,_0x354317=_0x51fdc0[_0x224948(0xdb)]('.');if(_0x354317[_0x224948(0xeb)]===0x2&&_0x354317[0x0]===_0x224948(0xf3)){const _0x4e40bd=_0x354317[0x1]?.[_0x224948(0xe8)]();return _0x4e40bd?{'alias':_0x4e40bd}:undefined;}if(_0x354317[_0x224948(0xeb)]===0x3&&_0x354317[0x0]===_0x224948(0xf3)&&_0x354317[0x2]==='appcode'){const _0x5acef6=_0x354317[0x1]?.[_0x224948(0xe8)]();return _0x5acef6?{'alias':_0x5acef6,'field':_0x224948(0xf1)}:undefined;}return undefined;}function setLocalAppAlias(_0x47fe3a,_0x91952a,_0x327a67){const _0x52b3c3=a23_0x50bc,_0x3363a7=_0x47fe3a[_0x52b3c3(0xf3)]&&typeof _0x47fe3a[_0x52b3c3(0xf3)]===_0x52b3c3(0x10b)&&!Array['isArray'](_0x47fe3a['apps'])?_0x47fe3a['apps']:{},_0x482b5e=_0x3363a7[_0x91952a]&&typeof _0x3363a7[_0x91952a]===_0x52b3c3(0x10b)&&!Array[_0x52b3c3(0x100)](_0x3363a7[_0x91952a])?_0x3363a7[_0x91952a]:{};_0x482b5e[_0x52b3c3(0xf1)]=_0x327a67,_0x3363a7[_0x91952a]=_0x482b5e,_0x47fe3a['apps']=_0x3363a7;}function deleteLocalAppAlias(_0x414923,_0x586914){const _0x136996=a23_0x50bc;if(!_0x414923[_0x136996(0xf3)]||typeof _0x414923[_0x136996(0xf3)]!==_0x136996(0x10b)||Array[_0x136996(0x100)](_0x414923[_0x136996(0xf3)]))return![];const _0x41b956=_0x414923[_0x136996(0xf3)],_0xf362e4=_0x41b956[_0x586914['alias']];if(!_0xf362e4||typeof _0xf362e4!==_0x136996(0x10b)||Array[_0x136996(0x100)](_0xf362e4))return![];if(!_0x586914['field'])return delete _0x41b956[_0x586914[_0x136996(0xe3)]],!![];if(!(_0x586914[_0x136996(0xcf)]in _0xf362e4))return![];return delete _0xf362e4[_0x586914[_0x136996(0xcf)]],Object['keys'](_0xf362e4)[_0x136996(0xeb)]===0x0&&delete _0x41b956[_0x586914[_0x136996(0xe3)]],!![];}const listDef={'service':a23_0x304f93(0xe7),'command':'list','description':'List\x20current\x20config','risk':a23_0x304f93(0xfc),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x26fb9f){const _0x222e88=a23_0x304f93,{buildConfigFromFlags:_0x29d391}=await import('../../context.js'),_0x5368b9=_0x29d391({}),_0x2e0071=redactCliConfigCredentials(_0x5368b9[_0x222e88(0xf5)]),_0x28eb20=getProjectConfigPath(),_0x50e012=resolveWriteConfigPath(_0x222e88(0xd8));if(_0x26fb9f[_0x222e88(0x10a)]===_0x222e88(0xff))return{'ok':!![],'message':_0x222e88(0xcc)+(JSON[_0x222e88(0xe4)](_0x2e0071,null,0x2)+'\x0a\x0a')+_0x222e88(0xef)+(_0x222e88(0xe2)+(_0x28eb20??'(none)')+'\x0a')+(_0x222e88(0xd5)+_0x50e012)};return{'ok':!![],'data':{'effective':_0x2e0071,'configFiles':{'project':_0x28eb20??null,'global':_0x50e012}}};}},getDef={'service':'config','command':a23_0x304f93(0xf8),'description':a23_0x304f93(0xcb),'risk':a23_0x304f93(0xfc),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':a23_0x304f93(0xe5),'required':!![]}],'flags':[],async 'execute'(_0x50d355){const _0x48b177=a23_0x304f93,_0x59ffea=_0x50d355['args'][0x0];if(!_0x59ffea)throw CliErrors[_0x48b177(0x104)](_0x48b177(0xf7),_0x48b177(0xd7)+CLI_BIN_NAME+'\x20config\x20get\x20<key>');const {buildConfigFromFlags:_0x64e4ce}=await import(_0x48b177(0xf6)),{raw:_0x44877c}=_0x64e4ce({});if(_0x59ffea['includes']('.')){const _0x58af87=_0x59ffea[_0x48b177(0xdb)]('.');let _0x4314b7=_0x44877c;for(const _0x2c27bb of _0x58af87){if(_0x4314b7==null||typeof _0x4314b7!==_0x48b177(0x10b))throw CliErrors[_0x48b177(0x104)]('Key\x20not\x20found:\x20'+_0x59ffea);_0x4314b7=_0x4314b7[_0x2c27bb];}if(_0x4314b7===undefined)throw CliErrors[_0x48b177(0x104)](_0x48b177(0xca)+_0x59ffea);const _0x2e0b3f=redactCliConfigValue(_0x59ffea,_0x4314b7);return console[_0x48b177(0xd9)](typeof _0x2e0b3f===_0x48b177(0x10b)?JSON[_0x48b177(0xe4)](_0x2e0b3f,null,0x2):String(_0x2e0b3f)),{'ok':!![]};}const _0x28bd87=_0x44877c[_0x59ffea];if(_0x28bd87===undefined)throw CliErrors[_0x48b177(0x104)](_0x48b177(0xca)+_0x59ffea);const _0x1a88d0=redactCliConfigValue(_0x59ffea,_0x28bd87);return console[_0x48b177(0xd9)](typeof _0x1a88d0===_0x48b177(0x10b)?JSON['stringify'](_0x1a88d0,null,0x2):String(_0x1a88d0)),{'ok':!![]};}},setDef={'service':'config','command':a23_0x304f93(0xde),'description':'Set\x20a\x20configuration\x20value','risk':a23_0x304f93(0xec),'confirmationDescription':a23_0x304f93(0xdf),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a23_0x304f93(0xd6),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':'value','description':'Value\x20to\x20assign','required':!![]}],'flags':[GLOBAL_SCOPE_FLAG],async 'execute'(_0x2c0e28){const _0x1da9bb=a23_0x304f93,_0x6a754f=_0x2c0e28[_0x1da9bb(0x103)][0x0],_0x46cd37=_0x2c0e28[_0x1da9bb(0x103)][0x1];if(!_0x6a754f||_0x46cd37===undefined)throw CliErrors['validation']('Missing\x20key\x20or\x20value.',_0x1da9bb(0xd7)+CLI_BIN_NAME+_0x1da9bb(0xd3));if(ENUM_KEYS[_0x6a754f]&&!ENUM_KEYS[_0x6a754f][_0x1da9bb(0xd2)](_0x46cd37))throw CliErrors[_0x1da9bb(0x104)](_0x1da9bb(0xfd)+_0x6a754f+_0x1da9bb(0xf9)+ENUM_KEYS[_0x6a754f][_0x1da9bb(0xed)](',\x20'));if(isCliProtectedConfigKey(_0x6a754f))throw CliErrors[_0x1da9bb(0x104)]('\x22'+_0x6a754f+_0x1da9bb(0x105));if(_0x6a754f==='pageSize'){const _0xc8022e=Number(_0x46cd37);if(isNaN(_0xc8022e)||_0xc8022e<=0x0)throw CliErrors[_0x1da9bb(0x104)](_0x1da9bb(0xe1));}const _0x1b4d0d=resolveWriteScope({'explicitGlobal':_0x2c0e28[_0x1da9bb(0xe9)](_0x1da9bb(0xd8)),'policy':_0x1da9bb(0xce)}),_0x3f67ad=toScopeFlags(_0x1b4d0d),_0x22614f=readScopedConfig(_0x3f67ad),_0x1e02ee=parseAliasAppcodeSetKey(_0x6a754f);if(!_0x1e02ee&&!isTopLevelConfigKey(_0x6a754f))throw CliErrors['validation'](_0x1da9bb(0xcd)+_0x6a754f+_0x1da9bb(0xfa),_0x1da9bb(0xd4)+getTopLevelConfigKeySummary()+_0x1da9bb(0xd1));if(_0x1e02ee)setLocalAppAlias(_0x22614f,_0x1e02ee,_0x46cd37);else{if(_0x6a754f===_0x1da9bb(0x108)){const _0x1518a7=normalizeLocale(_0x46cd37);if(!_0x1518a7)throw CliErrors[_0x1da9bb(0x104)]('Invalid\x20locale\x20value.',_0x1da9bb(0xf0));_0x22614f[_0x1da9bb(0x108)]=_0x1518a7;}else _0x22614f[_0x6a754f]=_0x6a754f==='pageSize'?Number(_0x46cd37):DOMAIN_CONFIG_FIELDS[_0x1da9bb(0xd2)](_0x6a754f)?normalizeDomainOrigin(_0x6a754f,_0x46cd37):_0x46cd37;}const _0x4e728d=_0x6a754f===_0x1da9bb(0x102)?maskCliAccessKey(_0x46cd37):!_0x1e02ee&&_0x6a754f===_0x1da9bb(0x108)?String(_0x22614f[_0x1da9bb(0x108)]):_0x46cd37;return console['log'](_0x1da9bb(0xdd)+_0x6a754f+'`\x20=\x20\x22'+_0x4e728d+'\x22'+(_0x1b4d0d===_0x1da9bb(0xd8)?_0x1da9bb(0xfe):'')),writeScopedConfig(_0x22614f,_0x3f67ad),{'ok':!![]};}},deleteDef={'service':'config','command':a23_0x304f93(0x109),'description':a23_0x304f93(0xdc),'risk':'write','confirmationDescription':a23_0x304f93(0xee),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a23_0x304f93(0xd6),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_SCOPE_FLAG],async 'execute'(_0x32cc32){const _0x50b1e3=a23_0x304f93,_0x509dd3=_0x32cc32['args'][0x0];if(!_0x509dd3)throw CliErrors[_0x50b1e3(0x104)](_0x50b1e3(0xf7),'Usage:\x20'+CLI_BIN_NAME+_0x50b1e3(0x107));if(isCliProtectedConfigKey(_0x509dd3))throw CliErrors[_0x50b1e3(0x104)]('\x22'+_0x509dd3+_0x50b1e3(0x105));const _0x361c4f=resolveWriteScope({'explicitGlobal':_0x32cc32['bool'](_0x50b1e3(0xd8)),'policy':_0x50b1e3(0xce)}),_0x54bdb9=toScopeFlags(_0x361c4f),_0x4722e6=readScopedConfig(_0x54bdb9),_0x2f151f=parseAliasDeleteKey(_0x509dd3);if(_0x2f151f){if(!deleteLocalAppAlias(_0x4722e6,_0x2f151f))return console[_0x50b1e3(0xd9)](_0x50b1e3(0xda)+_0x509dd3+(_0x361c4f===_0x50b1e3(0xd8)?'\x20(global)':'')),{'ok':!![],'data':{'key':_0x509dd3,'scope':_0x361c4f,'changed':![]}};return console[_0x50b1e3(0xd9)](_0x50b1e3(0x106)+_0x509dd3+'`'+(_0x361c4f==='global'?_0x50b1e3(0xfe):'')),writeScopedConfig(_0x4722e6,_0x54bdb9),{'ok':!![],'data':{'key':_0x509dd3,'scope':_0x361c4f,'changed':!![]}};}if(_0x4722e6[_0x509dd3]===undefined)return console[_0x50b1e3(0xd9)](_0x50b1e3(0xda)+_0x509dd3+(_0x361c4f===_0x50b1e3(0xd8)?_0x50b1e3(0xfe):'')),{'ok':!![],'data':{'key':_0x509dd3,'scope':_0x361c4f,'changed':![]}};return delete _0x4722e6[_0x509dd3],console[_0x50b1e3(0xd9)]('Deleted\x20`'+_0x509dd3+'`'+(_0x361c4f===_0x50b1e3(0xd8)?_0x50b1e3(0xfe):'')),writeScopedConfig(_0x4722e6,_0x54bdb9),{'ok':!![],'data':{'key':_0x509dd3,'scope':_0x361c4f,'changed':!![]}};}};export const configDefinitions=[configInitDefinition,listDef,getDef,setDef,deleteDef];
|
|
@@ -7,7 +7,7 @@ export declare function executeConfigInit(ctx: RuntimeContext): Promise<{
|
|
|
7
7
|
mode: string;
|
|
8
8
|
protocol: "lovrabet-routing/v1" | undefined;
|
|
9
9
|
region: "global" | "id" | "cn" | null;
|
|
10
|
-
domains: Partial<Record<"userDomain" | "runtimeDomain" | "skillDomain" | "apiDomain", string>>;
|
|
10
|
+
domains: Partial<Record<"userDomain" | "runtimeDomain" | "skillDomain" | "kbServiceDomain" | "apiDomain", string>>;
|
|
11
11
|
};
|
|
12
12
|
}>;
|
|
13
13
|
export declare const configInitDefinition: CommandDefinition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0xea772e=a24_0x1d2c;(function(_0x54eeee,_0x3abcf8){const _0x2cd22b=a24_0x1d2c,_0x4964da=_0x54eeee();while(!![]){try{const _0x617901=-parseInt(_0x2cd22b(0x1c8))/0x1+parseInt(_0x2cd22b(0x1ca))/0x2*(-parseInt(_0x2cd22b(0x1c4))/0x3)+parseInt(_0x2cd22b(0x1be))/0x4+parseInt(_0x2cd22b(0x1c7))/0x5*(parseInt(_0x2cd22b(0x1c6))/0x6)+-parseInt(_0x2cd22b(0x1aa))/0x7+parseInt(_0x2cd22b(0x1cd))/0x8*(parseInt(_0x2cd22b(0x1c1))/0x9)+parseInt(_0x2cd22b(0x1b6))/0xa;if(_0x617901===_0x3abcf8)break;else _0x4964da['push'](_0x4964da['shift']());}catch(_0x33208c){_0x4964da['push'](_0x4964da['shift']());}}}(a24_0xe2e7,0x28458));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';function a24_0xe2e7(){const _0x5ad330=['Lovrabet\x20connection\x20configured\x20for\x20region:\x20','Custom\x20User\x20HTTPS\x20origin','independent','Available\x20regions:\x20','config','label','join','1662059cwxrUD','init','write','Region\x20\x22','skill-domain','keys','nonInteractive','domain-config','kb-service-domain','Custom\x20Runtime\x20HTTPS\x20origin','str','name','137010YYjZBr','string','Custom\x20SkillHub\x20HTTPS\x20origin','api-domain','Updates\x20the\x20global\x20Lovrabet\x20region\x20or\x20independent-deployment\x20Domain\x20configuration.\x20AccessKey,\x20output\x20format,\x20and\x20app\x20bindings\x20stay\x20unchanged.','Independent-deployment\x20Domain\x20JSON\x20file','enterprise-v1','manifestDomains','857076vswhQg','Custom\x20platform\x20API\x20HTTPS\x20origin','region','218925CWZEBb','cancelled','Official\x20Lovrabet\x20region:\x20','789VosCdW','routing','124764oMzHct','20FOcyjT','132406Jhjmbv','Custom\x20KB\x20Service\x20HTTPS\x20origin','704psuwlF','validation','Select\x20Lovrabet\x20region','104JadfPX','\x22\x20is\x20not\x20currently\x20available.','mode','Choose\x20either\x20an\x20official\x20region\x20or\x20independent-deployment\x20Domains,\x20not\x20both.'];a24_0xe2e7=function(){return _0x5ad330;};return a24_0xe2e7();}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':a24_0xea772e(0x1b1),'type':a24_0xea772e(0x1b7),'description':a24_0xea772e(0x1bb)},{'name':'user-domain','type':'string','description':a24_0xea772e(0x1d2)},{'name':a24_0xea772e(0x1b9),'type':a24_0xea772e(0x1b7),'description':a24_0xea772e(0x1bf)},{'name':'runtime-domain','type':a24_0xea772e(0x1b7),'description':a24_0xea772e(0x1b3)},{'name':a24_0xea772e(0x1ae),'type':a24_0xea772e(0x1b7),'description':a24_0xea772e(0x1b8)},{'name':a24_0xea772e(0x1b2),'type':a24_0xea772e(0x1b7),'description':a24_0xea772e(0x1c9)}];function a24_0x1d2c(_0x27f769,_0x40ee92){_0x27f769=_0x27f769-0x1aa;const _0xe2e795=a24_0xe2e7();let _0x1d2c49=_0xe2e795[_0x27f769];return _0x1d2c49;}export const configInitFlags=[{'name':a24_0xea772e(0x1c0),'type':'string','description':a24_0xea772e(0x1c3)+ENABLED_LOVRABET_REGION_VALUES['join'](',\x20'),'enum':[...ENABLED_LOVRABET_REGION_VALUES]},...domainFlags];async function resolveRegion(_0x24f2f9){const _0x1d5ff4=a24_0xea772e,_0x1c6bb8=_0x24f2f9[_0x1d5ff4(0x1b4)](_0x1d5ff4(0x1c0));if(_0x1c6bb8){if(!isEnabledLovrabetRegion(_0x1c6bb8))throw CliErrors[_0x1d5ff4(0x1cb)](_0x1d5ff4(0x1ad)+_0x1c6bb8+_0x1d5ff4(0x1ce),_0x1d5ff4(0x1d4)+ENABLED_LOVRABET_REGION_VALUES[_0x1d5ff4(0x1d7)](',\x20'));return _0x1c6bb8;}if(_0x24f2f9[_0x1d5ff4(0x1b0)])return DEFAULT_LOVRABET_REGION;try{return await select({'message':_0x1d5ff4(0x1cc),'default':DEFAULT_LOVRABET_REGION,'choices':ENABLED_LOVRABET_REGION_VALUES['map'](_0x49a983=>({'name':OFFICIAL_ROUTING_PROFILES[_0x49a983][_0x1d5ff4(0x1d6)]+'\x20('+_0x49a983+')','value':_0x49a983}))});}catch(_0x4a530b){if(_0x4a530b?.[_0x1d5ff4(0x1b5)]==='ExitPromptError')throw CliErrors[_0x1d5ff4(0x1c2)]();throw _0x4a530b;}}export async function executeConfigInit(_0x1fcf36){const _0x113871=a24_0xea772e,_0x88d50b=resolveDomainConfigInput(_0x1fcf36),_0x2fe21b=_0x88d50b['domains'],_0x4e0fdc=Object['keys'](_0x2fe21b)['length']>0x0;if(_0x4e0fdc&&_0x1fcf36[_0x113871(0x1b4)](_0x113871(0x1c0)))throw CliErrors[_0x113871(0x1cb)](_0x113871(0x1d0));const _0x264a66={'global':!![]},_0x413266=readScopedConfig(_0x264a66);for(const _0x9f344e of DOMAIN_CONFIG_FIELDS)delete _0x413266[_0x9f344e];for(const _0x2def59 of LEGACY_DOMAIN_CONFIG_FIELDS)delete _0x413266[_0x2def59];delete _0x413266[_0x113871(0x1c5)];let _0x2556d8=null;if(_0x4e0fdc)delete _0x413266['region'],_0x88d50b[_0x113871(0x1cf)]===_0x113871(0x1bc)?_0x413266['routing']={'protocol':ENTERPRISE_ROUTING_PROTOCOL,'kind':ENTERPRISE_ROUTING_KIND,'domains':_0x88d50b[_0x113871(0x1bd)]}:Object['assign'](_0x413266,_0x2fe21b);else{_0x2556d8=await resolveRegion(_0x1fcf36);if(_0x2556d8===DEFAULT_LOVRABET_REGION)delete _0x413266[_0x113871(0x1c0)];else _0x413266['region']=_0x2556d8;}return writeScopedConfig(_0x413266,_0x264a66),{'ok':!![],'message':_0x4e0fdc?'Lovrabet\x20connection\x20configured\x20for\x20independent\x20deployment.\x20Domains:\x20'+Object[_0x113871(0x1af)](_0x88d50b[_0x113871(0x1cf)]===_0x113871(0x1bc)?_0x88d50b['manifestDomains']:_0x2fe21b)[_0x113871(0x1d7)](',\x20')+'.':_0x113871(0x1d1)+_0x2556d8+'.','data':{'mode':_0x4e0fdc?_0x113871(0x1d3):'official','protocol':_0x88d50b[_0x113871(0x1cf)]===_0x113871(0x1bc)?ENTERPRISE_ROUTING_PROTOCOL:undefined,'region':_0x2556d8,'domains':_0x2fe21b}};}export const configInitDefinition={'service':a24_0xea772e(0x1d5),'command':a24_0xea772e(0x1ab),'description':'Initialize\x20the\x20global\x20Lovrabet\x20region\x20or\x20independent-deployment\x20Domains','risk':a24_0xea772e(0x1ac),'confirmationDescription':a24_0xea772e(0x1ba),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':configInitFlags,'execute':executeConfigInit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x12dbae,_0x26c080){var _0x4cf23d=a25_0x108a,_0x483669=_0x12dbae();while(!![]){try{var _0x37fd67=-parseInt(_0x4cf23d(0x1a8))/0x1+-parseInt(_0x4cf23d(0x1a5))/0x2*(-parseInt(_0x4cf23d(0x1ae))/0x3)+-parseInt(_0x4cf23d(0x1ab))/0x4*(-parseInt(_0x4cf23d(0x1ad))/0x5)+parseInt(_0x4cf23d(0x1a7))/0x6+-parseInt(_0x4cf23d(0x1aa))/0x7*(-parseInt(_0x4cf23d(0x1a9))/0x8)+parseInt(_0x4cf23d(0x1ac))/0x9+-parseInt(_0x4cf23d(0x1a6))/0xa;if(_0x37fd67===_0x26c080)break;else _0x483669['push'](_0x483669['shift']());}catch(_0x51894a){_0x483669['push'](_0x483669['shift']());}}}(a25_0x563a,0xcac52));import{CLI_BIN_NAME}from'../../constant/cli.js';function a25_0x108a(_0x1a5bd6,_0x451f19){_0x1a5bd6=_0x1a5bd6-0x1a5;var _0x563a87=a25_0x563a();var _0x108aac=_0x563a87[_0x1a5bd6];return _0x108aac;}export{CLI_BIN_NAME};function a25_0x563a(){var _0x2d8cb7=['19348000tpDFwI','6129894ZwuIRE','411237GpvlOp','6568dQgOWU','8197dHNJou','8mRoVWn','1673316dpBNMA','2301780yfvAjv','1473hLiLaV','354FCxDIM'];a25_0x563a=function(){return _0x2d8cb7;};return a25_0x563a();}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';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x597485=a26_0x22b9;(function(_0x387a05,_0x1b4ce2){const _0x45aa91=a26_0x22b9,_0x4f5ee0=_0x387a05();while(!![]){try{const _0x10080a=-parseInt(_0x45aa91(0xf6))/0x1+parseInt(_0x45aa91(0xf4))/0x2*(parseInt(_0x45aa91(0xe5))/0x3)+parseInt(_0x45aa91(0xd9))/0x4*(-parseInt(_0x45aa91(0x106))/0x5)+parseInt(_0x45aa91(0xc0))/0x6*(-parseInt(_0x45aa91(0x109))/0x7)+-parseInt(_0x45aa91(0xd7))/0x8*(-parseInt(_0x45aa91(0xe3))/0x9)+parseInt(_0x45aa91(0xcc))/0xa+parseInt(_0x45aa91(0x110))/0xb*(parseInt(_0x45aa91(0x104))/0xc);if(_0x10080a===_0x1b4ce2)break;else _0x4f5ee0['push'](_0x4f5ee0['shift']());}catch(_0x53298a){_0x4f5ee0['push'](_0x4f5ee0['shift']());}}}(a26_0x259a,0xde05f));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';function a26_0x22b9(_0x2b5651,_0x1f3806){_0x2b5651=_0x2b5651-0xbd;const _0x259aba=a26_0x259a();let _0x22b955=_0x259aba[_0x2b5651];return _0x22b955;}import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams,parseUpdateIdsFromParams,normalizeUpdateParamsForRuntime}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a26_0x597485(0xc6),'operation':a26_0x597485(0xc6),'risk':a26_0x597485(0xfa),'paramsRequired':![],'description':a26_0x597485(0xe0),'paramsHint':a26_0x597485(0xc9)+'Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','helpExtra':[a26_0x597485(0x10a),'\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}',a26_0x597485(0xef),'\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}',a26_0x597485(0xd5),'\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}',a26_0x597485(0x107),a26_0x597485(0x10b),'\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}',a26_0x597485(0xff),'',a26_0x597485(0x115),'\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}',a26_0x597485(0xd0),'',a26_0x597485(0x11e),a26_0x597485(0xed),'\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]',a26_0x597485(0xf2),a26_0x597485(0x11a),a26_0x597485(0xda),'','\x20\x20PAGINATION',a26_0x597485(0x101),a26_0x597485(0xe4),'\x20\x20\x20\x20Page\x20numbers\x20start\x20at\x201.\x20To\x20fetch\x20the\x20next\x20page,\x20keep\x20where/select/orderBy/pageSize\x20unchanged',a26_0x597485(0x10d),a26_0x597485(0xf8),a26_0x597485(0xcb),a26_0x597485(0xdd)][a26_0x597485(0x108)]('\x0a')},{'command':'getOne','operation':a26_0x597485(0x100),'risk':a26_0x597485(0xfa),'paramsRequired':!![],'description':a26_0x597485(0xd3),'paramsHint':a26_0x597485(0x105)},{'command':'create','operation':'create','risk':a26_0x597485(0xfb),'paramsRequired':!![],'description':a26_0x597485(0x11f),'confirmationDescription':a26_0x597485(0xbd),'paramsHint':a26_0x597485(0xbf)},{'command':'batchCreate','operation':a26_0x597485(0x117),'risk':a26_0x597485(0xfb),'paramsRequired':!![],'description':a26_0x597485(0xe1),'confirmationDescription':'Writes\x20multiple\x20new\x20business\x20records\x20to\x20the\x20current\x20app\x20dataset.\x20They\x20are\x20saved\x20immediately\x20after\x20confirmation.','paramsHint':a26_0x597485(0xc4)},{'command':a26_0x597485(0x118),'operation':a26_0x597485(0x118),'risk':a26_0x597485(0xfb),'paramsRequired':!![],'description':a26_0x597485(0xd1),'confirmationDescription':a26_0x597485(0x116),'paramsHint':'JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20id\x20may\x20be\x20a\x20single\x20value\x20or\x20array.\x20'+'Examples:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27,\x20\x27{\x22id\x22:[1,2,3],\x22status\x22:\x22completed\x22}\x27'},{'command':a26_0x597485(0x11d),'operation':a26_0x597485(0x11d),'risk':a26_0x597485(0xfe),'paramsRequired':!![],'description':'Delete\x20data\x20records\x20(non-interactive\x20mode\x20requires\x20--yes)','confirmationDescription':'Deletes\x20business\x20records\x20from\x20the\x20current\x20app\x20dataset.\x20This\x20may\x20not\x20be\x20recoverable.','paramsHint':a26_0x597485(0x105)},{'command':a26_0x597485(0xe8),'operation':a26_0x597485(0xe8),'risk':a26_0x597485(0xfa),'paramsRequired':![],'description':'Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','paramsHint':a26_0x597485(0xbe)+a26_0x597485(0xec),'helpExtra':[a26_0x597485(0xde),a26_0x597485(0xc2),'\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}',a26_0x597485(0xc1),a26_0x597485(0x11b),a26_0x597485(0xdb),'\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}',a26_0x597485(0xcf),'',a26_0x597485(0x112),a26_0x597485(0xf3),a26_0x597485(0xeb),a26_0x597485(0xe6),a26_0x597485(0x113),a26_0x597485(0xf1),a26_0x597485(0x10c),'','\x20\x20AGGREGATE\x20ALIAS\x20BOUNDARY',a26_0x597485(0xca),a26_0x597485(0xdc),a26_0x597485(0x120),'',a26_0x597485(0xd4),a26_0x597485(0xf9),a26_0x597485(0x114),a26_0x597485(0xdf),a26_0x597485(0x111),'',a26_0x597485(0xf5),a26_0x597485(0xee),a26_0x597485(0xf7),'','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter',a26_0x597485(0xfd),'',a26_0x597485(0xfc)][a26_0x597485(0x108)]('\x0a')}];function makeDataCommand(_0x56dbd3){const _0x5da563=a26_0x597485,_0x157da4=_0x5da563(0x10e)+_0x56dbd3['command'],_0xdf064b={'service':_0x5da563(0x11c),'command':_0x56dbd3[_0x5da563(0xce)],'description':_0x56dbd3[_0x5da563(0xe2)],'risk':_0x56dbd3['risk'],..._0x56dbd3[_0x5da563(0x10f)]?{'confirmationDescription':_0x56dbd3[_0x5da563(0x10f)]}:{},'helpExtra':_0x56dbd3[_0x5da563(0xf0)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x56dbd3[_0x5da563(0xd2)]}],'validate':async _0x57a964=>{const _0x15b480=_0x5da563;_0x56dbd3[_0x15b480(0xcd)]&&requireAnyOf(_0x57a964,['params'],_0x157da4),_0x56dbd3[_0x15b480(0xd6)]===_0x15b480(0x117)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x57a964[_0x15b480(0x119)](_0x15b480(0xe7)))),_0x56dbd3[_0x15b480(0xd6)]===_0x15b480(0x118)&&parseUpdateIdsFromParams(parseJsonParams(_0x57a964['str']('params'))??{});},async 'execute'(_0x40d50d){const _0x2ea93d=_0x5da563,_0xfe222a=_0x40d50d['str'](_0x2ea93d(0xc8)),_0x558b63=_0x56dbd3[_0x2ea93d(0xd6)]===_0x2ea93d(0x117)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x40d50d[_0x2ea93d(0x119)]('params'))):parseJsonParams(_0x40d50d[_0x2ea93d(0x119)](_0x2ea93d(0xe7)))??{},_0x420376=_0x56dbd3['operation']===_0x2ea93d(0x118)?parseUpdateIdsFromParams(_0x558b63):undefined,_0x467310=_0x420376?normalizeUpdateParamsForRuntime(_0x558b63,_0x420376):_0x558b63,_0xcb8b8f=Date[_0x2ea93d(0xe9)](),_0x433278=await executeData(_0xfe222a,_0x56dbd3[_0x2ea93d(0xd6)],_0x467310),_0x50e97e=Date['now']()-_0xcb8b8f,_0x3c3037=_0x420376&&_0x420376[_0x2ea93d(0xc3)]>0x1?buildBatchUpdateResult(_0x420376,_0x433278):_0x433278;return{'ok':!![],'data':{'result':_0x3c3037,'elapsed':_0x50e97e},'message':_0x2ea93d(0x10e)+_0x56dbd3[_0x2ea93d(0xce)]+'\x20completed\x20in\x20'+_0x50e97e+'ms'};}};return _0x56dbd3['risk']!==_0x5da563(0xfa)&&(_0xdf064b[_0x5da563(0xc7)]=async _0x99f2c6=>{const _0x1c963d=_0x5da563,_0x3a8478=_0x99f2c6[_0x1c963d(0x119)](_0x1c963d(0xc8)),_0x5d6067=_0x56dbd3['operation']===_0x1c963d(0x117)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x99f2c6[_0x1c963d(0x119)]('params'))):parseJsonParams(_0x99f2c6[_0x1c963d(0x119)](_0x1c963d(0xe7)))??{};let _0x253764=_0x5d6067;if(_0x56dbd3['operation']===_0x1c963d(0x118)){const _0x2e1615=parseUpdateIdsFromParams(_0x5d6067);_0x253764=normalizeUpdateParamsForRuntime(_0x5d6067,_0x2e1615);}return dryRun(_0x1c963d(0xd8),_0x1c963d(0xc5)+_0x3a8478+'/'+_0x56dbd3[_0x1c963d(0xd6)])[_0x1c963d(0x102)](_0x253764)['description'](_0x1c963d(0x103)+_0x56dbd3[_0x1c963d(0xce)]+_0x1c963d(0xea)+_0x3a8478)['build']();}),_0xdf064b;}function a26_0x259a(){const _0x5b639d=['Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','helpExtra','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Post-aggregation\x20filters\x20using\x20real\x20dataset\x20fields,\x20e.g.\x20{\x22category_id\x22:{\x22$notNull\x22:true}}','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','2267506BIytFR','\x20\x20EXAMPLES','1114151VEhKmn','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\x20Page\x201:\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\x20\x20\x20\x20aggregate\x20supports\x20a\x20single\x20DB_TABLE\x20dataset\x20only','read','write','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','high-risk-write','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','getOne','\x20\x20\x20\x20Filtering\x20and\x20pagination\x20are\x20controlled\x20only\x20via\x20one\x20JSON\x20object\x20in\x20--params.','body','Preview:\x20data\x20','716232dQZNeR','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','3748190cSWVWf','\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','join','192787GMbGRR','\x20\x20WHERE\x20OPERATORS','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order;\x20may\x20reference\x20aggregate\x20output\x20aliases,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','\x20\x20\x20\x20and\x20increment\x20only\x20currentPage.\x20Use\x20a\x20stable\x20unique\x20orderBy\x20field\x20to\x20avoid\x20duplicates\x20or\x20gaps.','data\x20','confirmationDescription','319OLOeVs','\x20\x20\x20\x20choose\x20the\x20capability\x20before\x20execution;\x20never\x20fall\x20back\x20at\x20runtime','\x20\x20PARAMS\x20STRUCTURE','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20METADATA\x20datasets\x20do\x20not\x20support\x20aggregate\x20or\x20Custom\x20SQL','\x20\x20LOGICAL\x20COMBINATORS','Changes\x20an\x20existing\x20business\x20record\x20in\x20the\x20current\x20app\x20dataset.\x20The\x20new\x20values\x20are\x20saved\x20immediately\x20after\x20confirmation.','batchCreate','update','str','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','data','delete','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','Create\x20one\x20record\x20in\x20the\x20dataset','\x20\x20\x20\x20orderBy\x20may\x20reference\x20aggregate\x20output\x20aliases','Writes\x20one\x20new\x20business\x20record\x20to\x20the\x20current\x20app\x20dataset.\x20It\x20is\x20saved\x20immediately\x20after\x20confirmation.','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','204WzvzrR','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','length','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','/api/{appCode}/','filter','dryRun','code','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','\x20\x20\x20\x20aggregate[].alias\x20defines\x20the\x20output\x20field\x20name\x20only','\x20\x20\x20\x20Page\x202:\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:2,\x22pageSize\x22:20}\x27','1502100GRhuYl','paramsRequired','command','\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','Update\x20an\x20existing\x20data\x20record','paramsHint','Get\x20a\x20single\x20record\x20by\x20ID','\x20\x20DATASET\x20BOUNDARY','\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','operation','5557864OefkuD','POST','4MJhonp','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','\x20\x20\x20\x20select/where/having/groupBy\x20must\x20use\x20real\x20dataset\x20fields','\x20\x20\x20\x20Verify\x20the\x20response\x20paging.currentPage/pageSize\x20and\x20that\x20tableData\x20satisfies\x20where\x20before\x20drawing\x20conclusions.','\x20\x20AGGREGATE\x20TYPES','\x20\x20\x20\x20JOIN\x20and\x20cross-table\x20aggregation\x20require\x20an\x20existing\x20trusted\x20Custom\x20SQL','Filter\x20dataset\x20records\x20with\x20query\x20conditions','Create\x20multiple\x20records\x20in\x20the\x20dataset\x20in\x20one\x20request','description','9OCcvyW','\x20\x20\x20\x20Do\x20NOT\x20use\x20--where,\x20--select,\x20--order-by,\x20--current-page,\x20--page,\x20or\x20--page-size\x20as\x20CLI\x20flags.','3YxPTRi','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','params','aggregate','now','\x20on\x20dataset\x20','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)'];a26_0x259a=function(){return _0x5b639d;};return a26_0x259a();}export const dataDefinitions=specs['map'](makeDataCommand);function buildBatchUpdateResult(_0x36c33e,_0x276d0d){const _0x53fda2=a26_0x597485;return{'operation':'update','mode':'batch','ids':_0x36c33e,'total':_0x36c33e[_0x53fda2(0xc3)],'result':_0x276d0d};}
|
|
1
|
+
const a26_0x54bb3a=a26_0x1c97;function a26_0x5c99(){const _0x503eee=['\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order;\x20may\x20reference\x20aggregate\x20output\x20aliases,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','length','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','params','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\x20\x20\x20\x20aggregate[].alias\x20defines\x20the\x20output\x20field\x20name\x20only','\x20\x20\x20\x20select/where/having/groupBy\x20must\x20use\x20real\x20dataset\x20fields','now','getOne','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','Changes\x20an\x20existing\x20business\x20record\x20in\x20the\x20current\x20app\x20dataset.\x20The\x20new\x20values\x20are\x20saved\x20immediately\x20after\x20confirmation.','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','code','filter','Writes\x20one\x20new\x20business\x20record\x20to\x20the\x20current\x20app\x20dataset.\x20It\x20is\x20saved\x20immediately\x20after\x20confirmation.','data','56RkLZiD','Writes\x20multiple\x20new\x20business\x20records\x20to\x20the\x20current\x20app\x20dataset.\x20They\x20are\x20saved\x20immediately\x20after\x20confirmation.','\x20on\x20dataset\x20','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','6815zkVeKc','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','1343259PXyoMZ','2370222qeUkCa','Create\x20multiple\x20records\x20in\x20the\x20dataset\x20in\x20one\x20request','\x20\x20\x20\x20Page\x20numbers\x20start\x20at\x201.\x20To\x20fetch\x20the\x20next\x20page,\x20keep\x20where/select/orderBy/pageSize\x20unchanged','\x20\x20DATASET\x20BOUNDARY','aggregate','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','1272064eaNZhW','\x20\x20EXAMPLES','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','delete','description','Update\x20an\x20existing\x20data\x20record','\x20\x20AGGREGATE\x20TYPES','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','\x20\x20WHERE\x20OPERATORS','\x20\x20LOGICAL\x20COMBINATORS','batchCreate','high-risk-write','update','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','\x20\x20PARAMS\x20STRUCTURE','read','\x20\x20AGGREGATE\x20ALIAS\x20BOUNDARY','2291073pwmlvP','\x20\x20\x20\x20Page\x201:\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','create','Create\x20one\x20record\x20in\x20the\x20dataset','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','32vzuWnr','join','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Post-aggregation\x20filters\x20using\x20real\x20dataset\x20fields,\x20e.g.\x20{\x22category_id\x22:{\x22$notNull\x22:true}}','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','write','dryRun','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','risk','data\x20','body','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20id\x20may\x20be\x20a\x20single\x20value\x20or\x20array.\x20','\x20\x20\x20\x20Do\x20NOT\x20use\x20--where,\x20--select,\x20--order-by,\x20--current-page,\x20--page,\x20or\x20--page-size\x20as\x20CLI\x20flags.','\x20\x20\x20\x20METADATA\x20datasets\x20do\x20not\x20support\x20aggregate\x20or\x20Custom\x20SQL','1821561CpjjhH','operation','721820EmMOvD','Filter\x20dataset\x20records\x20with\x20query\x20conditions','\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','map','\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','str','\x20\x20PAGINATION','\x20\x20\x20\x20Page\x202:\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:2,\x22pageSize\x22:20}\x27','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','command','\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}'];a26_0x5c99=function(){return _0x503eee;};return a26_0x5c99();}(function(_0x2aeba9,_0x158173){const _0x29d3bf=a26_0x1c97,_0x38882a=_0x2aeba9();while(!![]){try{const _0x524748=parseInt(_0x29d3bf(0x14e))/0x1+-parseInt(_0x29d3bf(0x122))/0x2+-parseInt(_0x29d3bf(0x135))/0x3+-parseInt(_0x29d3bf(0x13e))/0x4*(parseInt(_0x29d3bf(0x119))/0x5)+parseInt(_0x29d3bf(0x11c))/0x6+-parseInt(_0x29d3bf(0x14c))/0x7+-parseInt(_0x29d3bf(0x115))/0x8*(-parseInt(_0x29d3bf(0x11b))/0x9);if(_0x524748===_0x158173)break;else _0x38882a['push'](_0x38882a['shift']());}catch(_0x4216dc){_0x38882a['push'](_0x38882a['shift']());}}}(a26_0x5c99,0x77d0c));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams,parseUpdateIdsFromParams,normalizeUpdateParamsForRuntime}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';function a26_0x1c97(_0x18f015,_0x5eb17a){_0x18f015=_0x18f015-0xf5;const _0x5c99e4=a26_0x5c99();let _0x1c9719=_0x5c99e4[_0x18f015];return _0x1c9719;}const specs=[{'command':a26_0x54bb3a(0x112),'operation':a26_0x54bb3a(0x112),'risk':a26_0x54bb3a(0x133),'paramsRequired':![],'description':a26_0x54bb3a(0x14f),'paramsHint':a26_0x54bb3a(0x102)+a26_0x54bb3a(0x106),'helpExtra':[a26_0x54bb3a(0x12b),'\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}',a26_0x54bb3a(0x150),a26_0x54bb3a(0x11a),a26_0x54bb3a(0x10c),a26_0x54bb3a(0x138),a26_0x54bb3a(0x110),a26_0x54bb3a(0xf6),a26_0x54bb3a(0x118),'',a26_0x54bb3a(0x12c),a26_0x54bb3a(0xfc),a26_0x54bb3a(0x144),'',a26_0x54bb3a(0x130),a26_0x54bb3a(0x12a),a26_0x54bb3a(0x10e),'\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]',a26_0x54bb3a(0x13d),a26_0x54bb3a(0x124),'',a26_0x54bb3a(0xf8),'\x20\x20\x20\x20Filtering\x20and\x20pagination\x20are\x20controlled\x20only\x20via\x20one\x20JSON\x20object\x20in\x20--params.',a26_0x54bb3a(0x14a),a26_0x54bb3a(0x11e),'\x20\x20\x20\x20and\x20increment\x20only\x20currentPage.\x20Use\x20a\x20stable\x20unique\x20orderBy\x20field\x20to\x20avoid\x20duplicates\x20or\x20gaps.',a26_0x54bb3a(0x136),a26_0x54bb3a(0xf9),'\x20\x20\x20\x20Verify\x20the\x20response\x20paging.currentPage/pageSize\x20and\x20that\x20tableData\x20satisfies\x20where\x20before\x20drawing\x20conclusions.'][a26_0x54bb3a(0x13f)]('\x0a')},{'command':a26_0x54bb3a(0x10a),'operation':a26_0x54bb3a(0x10a),'risk':'read','paramsRequired':!![],'description':'Get\x20a\x20single\x20record\x20by\x20ID','paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a26_0x54bb3a(0x13a),'operation':a26_0x54bb3a(0x13a),'risk':a26_0x54bb3a(0x142),'paramsRequired':!![],'description':a26_0x54bb3a(0x13b),'confirmationDescription':a26_0x54bb3a(0x113),'paramsHint':a26_0x54bb3a(0x101)},{'command':'batchCreate','operation':a26_0x54bb3a(0x12d),'risk':'write','paramsRequired':!![],'description':a26_0x54bb3a(0x11d),'confirmationDescription':a26_0x54bb3a(0x116),'paramsHint':a26_0x54bb3a(0x148)},{'command':'update','operation':a26_0x54bb3a(0x12f),'risk':'write','paramsRequired':!![],'description':a26_0x54bb3a(0x128),'confirmationDescription':a26_0x54bb3a(0x10f),'paramsHint':a26_0x54bb3a(0x149)+'Examples:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27,\x20\x27{\x22id\x22:[1,2,3],\x22status\x22:\x22completed\x22}\x27'},{'command':a26_0x54bb3a(0x126),'operation':'delete','risk':a26_0x54bb3a(0x12e),'paramsRequired':!![],'description':'Delete\x20data\x20records\x20(non-interactive\x20mode\x20requires\x20--yes)','confirmationDescription':'Deletes\x20business\x20records\x20from\x20the\x20current\x20app\x20dataset.\x20This\x20may\x20not\x20be\x20recoverable.','paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a26_0x54bb3a(0x120),'operation':'aggregate','risk':a26_0x54bb3a(0x133),'paramsRequired':![],'description':a26_0x54bb3a(0x125),'paramsHint':a26_0x54bb3a(0x137)+'Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','helpExtra':[a26_0x54bb3a(0x129),'\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}',a26_0x54bb3a(0x100),a26_0x54bb3a(0x139),a26_0x54bb3a(0x105),a26_0x54bb3a(0x13c),'\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','',a26_0x54bb3a(0x132),a26_0x54bb3a(0x104),'\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)',a26_0x54bb3a(0x10d),a26_0x54bb3a(0xff),a26_0x54bb3a(0x140),a26_0x54bb3a(0xfd),'',a26_0x54bb3a(0x134),a26_0x54bb3a(0x107),a26_0x54bb3a(0x108),'\x20\x20\x20\x20orderBy\x20may\x20reference\x20aggregate\x20output\x20aliases','',a26_0x54bb3a(0x11f),'\x20\x20\x20\x20aggregate\x20supports\x20a\x20single\x20DB_TABLE\x20dataset\x20only',a26_0x54bb3a(0x14b),'\x20\x20\x20\x20JOIN\x20and\x20cross-table\x20aggregation\x20require\x20an\x20existing\x20trusted\x20Custom\x20SQL','\x20\x20\x20\x20choose\x20the\x20capability\x20before\x20execution;\x20never\x20fall\x20back\x20at\x20runtime','',a26_0x54bb3a(0x123),a26_0x54bb3a(0x10b),a26_0x54bb3a(0x141),'',a26_0x54bb3a(0x131),a26_0x54bb3a(0xfa),'',a26_0x54bb3a(0x121)][a26_0x54bb3a(0x13f)]('\x0a')}];function makeDataCommand(_0x23c6ff){const _0xa74766=a26_0x54bb3a,_0x572bf0=_0xa74766(0x146)+_0x23c6ff[_0xa74766(0xfb)],_0x14e6b0={'service':_0xa74766(0x114),'command':_0x23c6ff[_0xa74766(0xfb)],'description':_0x23c6ff[_0xa74766(0x127)],'risk':_0x23c6ff[_0xa74766(0x145)],..._0x23c6ff['confirmationDescription']?{'confirmationDescription':_0x23c6ff['confirmationDescription']}:{},'helpExtra':_0x23c6ff['helpExtra'],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x23c6ff['paramsHint']}],'validate':async _0xe462a2=>{const _0x3afac5=_0xa74766;_0x23c6ff['paramsRequired']&&requireAnyOf(_0xe462a2,['params'],_0x572bf0),_0x23c6ff[_0x3afac5(0x14d)]===_0x3afac5(0x12d)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0xe462a2[_0x3afac5(0xf7)](_0x3afac5(0x103)))),_0x23c6ff['operation']===_0x3afac5(0x12f)&&parseUpdateIdsFromParams(parseJsonParams(_0xe462a2[_0x3afac5(0xf7)](_0x3afac5(0x103)))??{});},async 'execute'(_0x52e1c4){const _0x1f12a5=_0xa74766,_0x374f66=_0x52e1c4[_0x1f12a5(0xf7)](_0x1f12a5(0x111)),_0x3e006a=_0x23c6ff[_0x1f12a5(0x14d)]===_0x1f12a5(0x12d)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x52e1c4[_0x1f12a5(0xf7)](_0x1f12a5(0x103)))):parseJsonParams(_0x52e1c4[_0x1f12a5(0xf7)](_0x1f12a5(0x103)))??{},_0x246670=_0x23c6ff[_0x1f12a5(0x14d)]===_0x1f12a5(0x12f)?parseUpdateIdsFromParams(_0x3e006a):undefined,_0x5448e6=_0x246670?normalizeUpdateParamsForRuntime(_0x3e006a,_0x246670):_0x3e006a,_0x1669fc=Date[_0x1f12a5(0x109)](),_0x289132=await executeData(_0x374f66,_0x23c6ff[_0x1f12a5(0x14d)],_0x5448e6),_0x1e0827=Date[_0x1f12a5(0x109)]()-_0x1669fc,_0x13d20e=_0x246670&&_0x246670['length']>0x1?buildBatchUpdateResult(_0x246670,_0x289132):_0x289132;return{'ok':!![],'data':{'result':_0x13d20e,'elapsed':_0x1e0827},'message':'data\x20'+_0x23c6ff[_0x1f12a5(0xfb)]+'\x20completed\x20in\x20'+_0x1e0827+'ms'};}};return _0x23c6ff['risk']!==_0xa74766(0x133)&&(_0x14e6b0[_0xa74766(0x143)]=async _0x4f4d69=>{const _0x45c2e7=_0xa74766,_0x5f5b17=_0x4f4d69['str'](_0x45c2e7(0x111)),_0x52f36c=_0x23c6ff[_0x45c2e7(0x14d)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x4f4d69['str'](_0x45c2e7(0x103)))):parseJsonParams(_0x4f4d69[_0x45c2e7(0xf7)]('params'))??{};let _0x233b53=_0x52f36c;if(_0x23c6ff[_0x45c2e7(0x14d)]===_0x45c2e7(0x12f)){const _0x2b077a=parseUpdateIdsFromParams(_0x52f36c);_0x233b53=normalizeUpdateParamsForRuntime(_0x52f36c,_0x2b077a);}return dryRun('POST','/api/{appCode}/'+_0x5f5b17+'/'+_0x23c6ff['operation'])[_0x45c2e7(0x147)](_0x233b53)['description']('Preview:\x20data\x20'+_0x23c6ff['command']+_0x45c2e7(0x117)+_0x5f5b17)['build']();}),_0x14e6b0;}export const dataDefinitions=specs[a26_0x54bb3a(0xf5)](makeDataCommand);function buildBatchUpdateResult(_0x126037,_0x5cc5a7){const _0x1b6b65=a26_0x54bb3a;return{'operation':'update','mode':'batch','ids':_0x126037,'total':_0x126037[_0x1b6b65(0xfe)],'result':_0x5cc5a7};}
|