@lovrabet/lovrabet-cli 2.3.4-beta.1 → 2.3.4
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_0x51dedc=a12_0x337d;(function(_0x299097,_0x2128a6){const _0x2ed651=a12_0x337d,_0x6d1d34=_0x299097();while(!![]){try{const _0x30fb5d=-parseInt(_0x2ed651(0xa7))/0x1+parseInt(_0x2ed651(0xa5))/0x2+parseInt(_0x2ed651(0xc3))/0x3+-parseInt(_0x2ed651(0xa6))/0x4*(-parseInt(_0x2ed651(0xd2))/0x5)+parseInt(_0x2ed651(0xba))/0x6+-parseInt(_0x2ed651(0xd4))/0x7+-parseInt(_0x2ed651(0xbb))/0x8*(parseInt(_0x2ed651(0xa4))/0x9);if(_0x30fb5d===_0x2128a6)break;else _0x6d1d34['push'](_0x6d1d34['shift']());}catch(_0x5d13da){_0x6d1d34['push'](_0x6d1d34['shift']());}}}(a12_0x2bf7,0xee83f));import{existsSync,mkdirSync,readFileSync,unlinkSync,writeFileSync}from'node:fs';import{dirname}from'node:path';function a12_0x337d(_0x63f48e,_0x44311d){_0x63f48e=_0x63f48e-0xa1;const _0x2bf75f=a12_0x2bf7();let _0x337d34=_0x2bf75f[_0x63f48e];return _0x337d34;}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(_0x8fa2e0){const _0x501354=a12_0x337d;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x8fa2e0['bool'](_0x501354(0xc1)),'explicitProject':_0x8fa2e0[_0x501354(0xc4)](_0x501354(0xb6)),'policy':_0x501354(0xca)}));}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 _0x2406d3=a12_0x337d;return crypto[_0x2406d3(0xee)]();}export function buildDeviceAuthUrl(_0x41d7b7,_0x38edb9,_0x59c44f=a12_0x51dedc(0xce)){const _0x1fd32c=a12_0x51dedc;return _0x41d7b7+'/device-auth?code='+encodeURIComponent(_0x38edb9)+_0x1fd32c(0xb0)+encodeURIComponent(_0x59c44f);}export function getDeviceCodePath(){const _0x591a5d=a12_0x51dedc;return homedir()+'/'+PRODUCT_CONFIG[_0x591a5d(0xe8)]+_0x591a5d(0xcd);}export function readStoredDeviceCode(){const _0x64eb3=a12_0x51dedc,_0x3dc3d1=getDeviceCodePath();if(!existsSync(_0x3dc3d1))return null;try{const _0x1aed79=readFileSync(_0x3dc3d1,{'encoding':_0x64eb3(0xb7)}),_0x49d167=JSON[_0x64eb3(0xe0)](_0x1aed79);if(_0x49d167&&typeof _0x49d167[_0x64eb3(0xae)]===_0x64eb3(0xe3)&&typeof _0x49d167['createdAt']===_0x64eb3(0xe3)&&(_0x49d167[_0x64eb3(0xa9)]===_0x64eb3(0xc1)||_0x49d167[_0x64eb3(0xa9)]===_0x64eb3(0xb6)))return _0x49d167;}catch{}return null;}export function writeStoredDeviceCode(_0x5693f5,_0x23799c){const _0x5f353c=a12_0x51dedc,_0x351551=getDeviceCodePath(),_0x3694e6=dirname(_0x351551);!existsSync(_0x3694e6)&&mkdirSync(_0x3694e6,{'recursive':!![]});const _0x4bf1d1={'code':_0x5693f5,'createdAt':new Date()[_0x5f353c(0xa8)](),'scope':_0x23799c};writeFileSync(_0x351551,JSON['stringify'](_0x4bf1d1),{'encoding':_0x5f353c(0xb7),'mode':0x180});}export function deleteStoredDeviceCode(){const _0x4cb8a2=getDeviceCodePath();try{unlinkSync(_0x4cb8a2);}catch{}}export function isStoredDeviceCodeExpired(_0x533909){const _0x351e86=a12_0x51dedc;return Date['now']()-new Date(_0x533909[_0x351e86(0xbd)])[_0x351e86(0xaa)]()>DEVICE_CODE_TTL_MS;}export async function fetchDeviceToken(_0x3cbc0d,_0x329bf8){const _0x3ba549=a12_0x51dedc,_0x239069=_0x3cbc0d+_0x3ba549(0xec),_0x122461=new AbortController(),_0x9523da=setTimeout(()=>_0x122461[_0x3ba549(0xb4)](),0x2710),_0x15696f=await fetch(_0x239069,{'method':'POST','headers':{'Content-Type':_0x3ba549(0xd1)},'body':JSON[_0x3ba549(0xb9)]({'code':_0x329bf8}),'signal':_0x122461[_0x3ba549(0xb5)]});clearTimeout(_0x9523da);if(!_0x15696f['ok'])throw CliErrors[_0x3ba549(0xdc)](_0x3ba549(0xde)+_0x15696f[_0x3ba549(0xd7)]);const _0x40a218=await _0x15696f[_0x3ba549(0xd8)](),_0x19f134=_0x40a218[_0x3ba549(0xda)]&&typeof _0x40a218[_0x3ba549(0xda)]==='object'?_0x40a218[_0x3ba549(0xda)]:_0x40a218;if(!_0x19f134||typeof _0x19f134[_0x3ba549(0xd7)]!==_0x3ba549(0xe3))throw CliErrors[_0x3ba549(0xd5)](_0x3ba549(0xe5));return{'status':_0x19f134[_0x3ba549(0xd7)],'access_key':typeof _0x19f134[_0x3ba549(0xc8)]==='string'?_0x19f134[_0x3ba549(0xc8)]:undefined};}export async function pollDeviceToken(_0x41c565,_0x56bd0a,_0x49e5ba){const _0x5852ef=a12_0x51dedc;let _0x49a41b=0x0;for(let _0x49ec97=0x0;_0x49ec97<MAX_POLLS;_0x49ec97++){if(_0x49e5ba[_0x5852ef(0xeb)])throw CliErrors['cancelled'](_0x5852ef(0xc7));let _0x2f0c7d;try{_0x2f0c7d=await fetchDeviceToken(_0x41c565,_0x56bd0a);}catch(_0xa485c2){if(_0xa485c2 instanceof Error&&_0xa485c2[_0x5852ef(0xc5)]==='AbortError')throw CliErrors[_0x5852ef(0xb1)](_0x5852ef(0xc7));_0x49a41b++;if(_0x49a41b>=MAX_CONSECUTIVE_NETWORK_ERRORS)throw CliErrors[_0x5852ef(0xdc)](_0x5852ef(0xd6));writeCliSideChannelLine(_0x5852ef(0xb3)+_0x49a41b+'/'+MAX_CONSECUTIVE_NETWORK_ERRORS+_0x5852ef(0xe2)),await sleep(POLL_INTERVAL_MS);continue;}_0x49a41b=0x0;if(_0x2f0c7d[_0x5852ef(0xd7)]==='success'){if(!_0x2f0c7d[_0x5852ef(0xc8)])throw CliErrors[_0x5852ef(0xd5)](_0x5852ef(0xcc));return _0x2f0c7d[_0x5852ef(0xc8)];}if(_0x2f0c7d[_0x5852ef(0xd7)]===_0x5852ef(0xdf)){deleteStoredDeviceCode();throw CliErrors[_0x5852ef(0xa2)](_0x5852ef(0xe6));}const _0x1d4baa=(_0x49ec97+0x1)*POLL_INTERVAL_MS,_0x1c23ce=DEVICE_CODE_TTL_MS-_0x1d4baa,_0x39f72a=Math[_0x5852ef(0xed)](_0x1c23ce/0xea60),_0x23f477=Math[_0x5852ef(0xed)](_0x1c23ce%0xea60/0x3e8);process[_0x5852ef(0xd3)][_0x5852ef(0xea)](_0x5852ef(0xab)+_0x39f72a+':'+String(_0x23f477)['padStart'](0x2,'0')+_0x5852ef(0xa3)),await sleep(POLL_INTERVAL_MS);}deleteStoredDeviceCode();throw CliErrors[_0x5852ef(0xa2)]('Device\x20authorization\x20timed\x20out\x20after\x2010\x20minutes.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.');}function sleep(_0x4d7e44){return new Promise(_0x34ed1b=>setTimeout(_0x34ed1b,_0x4d7e44));}export const authDeviceDefinition={'service':'auth','command':'device','description':'Authorize\x20with\x20the\x20device-code\x20flow\x20(complete\x20in\x20the\x20browser;\x20no\x20copy-paste\x20required)','risk':a12_0x51dedc(0xea),'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':a12_0x51dedc(0xc1),'type':'boolean','description':'Write\x20to\x20global\x20config\x20(default)','default':!![]},{'name':a12_0x51dedc(0xb6),'type':a12_0x51dedc(0xd0),'description':a12_0x51dedc(0xb2),'default':![]},{'name':'source','type':a12_0x51dedc(0xe3),'description':a12_0x51dedc(0xac),'default':a12_0x51dedc(0xce)},{'name':a12_0x51dedc(0xaf),'type':a12_0x51dedc(0xd0),'description':a12_0x51dedc(0xe1),'default':![]}],async 'execute'(_0x41688c){const _0x3dad19=a12_0x51dedc,_0x427d59=resolveAuthScopeFlags(_0x41688c),_0x58ba81=_0x427d59[_0x3dad19(0xc1)]?_0x3dad19(0xc1):_0x3dad19(0xb6),_0x5297f9=readScopedConfig(_0x427d59);if(_0x5297f9[_0x3dad19(0xbf)])return{'ok':!![],'message':_0x3dad19(0xd9)};const _0x2083ab=(_0x41688c[_0x3dad19(0xbe)](_0x3dad19(0xcf))||_0x3dad19(0xce))[_0x3dad19(0xe7)](),_0x35c917=getUserDomain(),_0x36e0e1=readStoredDeviceCode(),_0x1d1cd3=_0x36e0e1&&!isStoredDeviceCodeExpired(_0x36e0e1)?_0x36e0e1['code']:((()=>{const _0xb85be6=generateDeviceCode();return writeStoredDeviceCode(_0xb85be6,_0x58ba81),_0xb85be6;})()),_0x45b590=buildDeviceAuthUrl(_0x35c917,_0x1d1cd3,_0x2083ab);if(_0x41688c['bool']('url-only'))return console[_0x3dad19(0xb8)](_0x45b590),{'ok':!![]};writeCliSideChannelLine('Open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20authorize:'),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x45b590),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x3dad19(0xbc));if(_0x41688c[_0x3dad19(0xe9)])return writeCliSideChannelLine(_0x3dad19(0xc0)+CLI_BIN_NAME+_0x3dad19(0xcb)),{'ok':!![],'message':_0x3dad19(0xc9)};writeCliSideChannelLine(_0x3dad19(0xad));const _0x4ca12b=new AbortController(),_0x57e2eb=()=>{const _0x568685=_0x3dad19;_0x4ca12b[_0x568685(0xb4)](),process[_0x568685(0xc6)](_0x568685(0xa1),_0x57e2eb);};process['once']('SIGINT',_0x57e2eb);let _0x10ccd9;try{_0x10ccd9=await pollDeviceToken(_0x35c917,_0x1d1cd3,_0x4ca12b[_0x3dad19(0xb5)]);}finally{process[_0x3dad19(0xc6)](_0x3dad19(0xa1),_0x57e2eb);}if(!ACCESS_KEY_PATTERN['test'](_0x10ccd9))throw CliErrors['apiError'](_0x3dad19(0xcc));const _0x58c24d=readScopedConfig(_0x427d59);return _0x58c24d[_0x3dad19(0xbf)]=_0x10ccd9,writeScopedConfig(_0x58c24d,_0x427d59),deleteStoredDeviceCode(),process[_0x3dad19(0xd3)][_0x3dad19(0xea)]('\x0a'),writeCliSideChannelLine(_0x3dad19(0xc2)+_0x58ba81+_0x3dad19(0xdd)),writeCliSideChannelLine(_0x3dad19(0xe4)+CLI_BIN_NAME+_0x3dad19(0xdb)),{'ok':!![],'message':'Device\x20authorization\x20successful.'};}};function a12_0x2bf7(){const _0x319d04=['write','aborted','/api/device-auth/token','floor','randomUUID','SIGINT','validation','\x20remaining','9udiUXz','3005274RMJnDz','92JrUOXu','411824YFHCMs','toISOString','scope','getTime','\x0dWaiting\x20for\x20authorization...\x20','App\x20name\x20shown\x20on\x20authorization\x20page\x20(default:\x20lovrabet)','Waiting\x20for\x20authorization\x20(timeout:\x2010\x20minutes,\x20Ctrl+C\x20to\x20cancel)...','code','url-only','&source=','cancelled','Write\x20to\x20project\x20config','Device\x20auth\x20API\x20error\x20(','abort','signal','project','utf8','log','stringify','5106702wggIxZ','17182096taWZOk','The\x20device\x20code\x20is\x20valid\x20for\x2010\x20minutes.','createdAt','str','accessKey','After\x20authorizing,\x20re-run:\x20','global','AccessKey\x20saved\x20to\x20','4233309PoiaWv','bool','name','removeListener','Device\x20authorization\x20cancelled.','access_key','Device\x20authorization\x20URL\x20printed.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20re-run.','global-default','\x20auth\x20device','Invalid\x20access_key\x20returned\x20by\x20server.','/.device-auth','lovrabet-cli','source','boolean','application/json','181955uirHKW','stderr','7457135dJUnry','apiError','Device\x20auth\x20API\x20unreachable\x20after\x20multiple\x20retries.','status','json','Already\x20authorized.\x20Use\x20`lovrabet\x20auth\x20status`\x20to\x20verify.','data','\x20auth\x20status','networkError','\x20config.','Device\x20auth\x20API\x20returned\x20HTTP\x20','expired','parse','Print\x20URL\x20to\x20stdout\x20and\x20exit\x20(for\x20WorkBuddy\x20integration)','),\x20retrying...','string','Verify:\x20','Invalid\x20device\x20auth\x20response','Device\x20code\x20expired.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','trim','homeDirName','nonInteractive'];a12_0x2bf7=function(){return _0x319d04;};return a12_0x2bf7();}
|
|
@@ -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_0x2df2d7=a13_0x3afb;(function(_0x34b71e,_0xa3d2a4){const _0x243778=a13_0x3afb,_0x213edb=_0x34b71e();while(!![]){try{const _0x1003f6=-parseInt(_0x243778(0xf6))/0x1+parseInt(_0x243778(0x102))/0x2*(parseInt(_0x243778(0x103))/0x3)+parseInt(_0x243778(0x116))/0x4*(-parseInt(_0x243778(0xdf))/0x5)+parseInt(_0x243778(0x121))/0x6*(-parseInt(_0x243778(0xdb))/0x7)+parseInt(_0x243778(0x123))/0x8+-parseInt(_0x243778(0x104))/0x9+parseInt(_0x243778(0xf1))/0xa*(parseInt(_0x243778(0xdd))/0xb);if(_0x1003f6===_0xa3d2a4)break;else _0x213edb['push'](_0x213edb['shift']());}catch(_0x498148){_0x213edb['push'](_0x213edb['shift']());}}}(a13_0x1cca,0x377db));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';function a13_0x3afb(_0x44d531,_0x2b641c){_0x44d531=_0x44d531-0xcb;const _0x1cca88=a13_0x1cca();let _0x3afb5a=_0x1cca88[_0x44d531];return _0x3afb5a;}import{getLoginUserInfo}from'../../core/api-client.js';import{getUserDomain}from'../../constant/domain.js';function a13_0x1cca(){const _0x55684c=['\x20config.','login','global','Auth\x20mode:\x20','production','join','trim','access-key','auth','234xXSaCI','newConfigFileName','553776msBbpE','string','env','\x20\x20export\x20','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','stdout','AccessKey\x20(ak_xxx...)','scope','bool','authRequired','\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','development','write','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.','validation','No\x20AccessKey\x20found\x20in\x20','=ak_xxx','Save\x20the\x20AccessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20the\x20project\x20file)','Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20','Option\x20B:\x20apps\x20config\x20(','Option\x20C:\x20environment\x20variable','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','nonInteractive','\x20Current\x20env:\x20','48818oDfzXV','push','44xsgsYT','AccessKey\x20saved\x20to\x20','11005oAMIiO','\x20auth\x20login\x20--access-key\x20<ak_xxx>','access_key','accessKeyCreatePath','Write\x20to\x20global\x20config\x20(default)','Read\x20from\x20global\x20config\x20(default)','stdin','Status:\x20valid','read','Option\x20A:\x20','userCenterDisplayName','\x20config.\x20Nothing\x20to\x20clear.','Clear\x20the\x20AccessKey\x20from\x20config','Tip:\x20you\x20can\x20also\x20run:','str','test','Missing\x20accessKey.','Removes\x20the\x20AccessKey\x20from\x20the\x20selected\x20Lovrabet\x20config.\x20Commands\x20that\x20need\x20that\x20key\x20will\x20require\x20login\x20again.','1497370BkvEdO','success','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars','check','boolean','304190ucdcfZ','info','Clear\x20from\x20global\x20config\x20(default)','\x20env\x20var','yes','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','Then\x20verify\x20with:\x20','\x20(via\x20','envName','logout','Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','6DATrwm','236967MevGkT','657513RrNocZ','\x20doctor','global\x20config','isTTY','Device\x20authorization\x20pending.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20try\x20again.','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','status','global-default','\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`','Show\x20current\x20authentication\x20status','accessKey','\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.','AccessKey:\x20','expired','project','project\x20config','ACCESS_KEY','`auth\x20login`\x20does\x20not\x20support\x20--yes.','52fakPQM','\x20auth\x20status'];a13_0x1cca=function(){return _0x55684c;};return a13_0x1cca();}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(_0x4cb8d8=USER_ACCESS_KEY_CREATE_URL){const _0x394882=a13_0x3afb;writeCliSideChannelLine(_0x394882(0xd8)+PRODUCT_CONFIG['userCenterDisplayName']+':'),writeCliSideChannelLine('\x0a'+_0x4cb8d8+'\x0a'),writeCliSideChannelLine(_0x394882(0xec)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x394882(0xe0));}function buildAccessKeySetupGuide(_0x31b31a=USER_ACCESS_KEY_CREATE_URL){const _0x2a5326=a13_0x3afb;return['AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20'+PRODUCT_CONFIG[_0x2a5326(0xe9)]+':',_0x31b31a,_0x2a5326(0xd5)+CLI_BIN_NAME+_0x2a5326(0xcd)][_0x2a5326(0x11d)]('\x0a');}function canPromptForAccessKey(_0x3251ff){const _0x4b5afd=a13_0x3afb;return!_0x3251ff[_0x4b5afd(0xd9)]&&process[_0x4b5afd(0xe5)][_0x4b5afd(0x107)]!==![]&&process[_0x4b5afd(0x128)][_0x4b5afd(0x107)]!==![];}function resolveAuthScopeFlags(_0x5ec432){const _0x54aa3d=a13_0x3afb;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x5ec432[_0x54aa3d(0xcb)]('global'),'explicitProject':_0x5ec432[_0x54aa3d(0xcb)](_0x54aa3d(0x112)),'policy':_0x54aa3d(0x10b)}));}async function resolveAuthWriteInput(_0x1afd94){const _0x22c4a8=a13_0x3afb;let _0x1be53c=(_0x1afd94[_0x22c4a8(0xed)](_0x22c4a8(0x11f))||_0x1afd94['str']('ak')||'')[_0x22c4a8(0x11e)]();const _0x96addf=(_0x1afd94[_0x22c4a8(0xed)](_0x22c4a8(0x125))||'')['trim'](),_0x30e71e=''+getUserDomain()+PRODUCT_CONFIG[_0x22c4a8(0xe2)];if(!_0x1be53c&&canPromptForAccessKey(_0x1afd94))try{showAccessKeyCreateHint(_0x30e71e),_0x1be53c=await promptAccessKey('');}catch(_0x474212){if(isAbortPrompt(_0x474212))throw CliErrors['cancelled']();throw _0x474212;}if(!_0x1be53c)throw CliErrors[_0x22c4a8(0xd1)](_0x22c4a8(0xef),buildAccessKeySetupGuide(_0x30e71e));if(!ACCESS_KEY_PATTERN[_0x22c4a8(0xee)](_0x1be53c))throw CliErrors[_0x22c4a8(0xd1)]('Invalid\x20accessKey\x20format.',_0x22c4a8(0xf3));if(!_0x96addf)return{'accessKey':_0x1be53c};const _0x2e9f1a=normalizeEnv(_0x96addf);return{'accessKey':_0x1be53c,'env':isDaily(_0x2e9f1a)?'daily':isDev(_0x2e9f1a)?_0x22c4a8(0xce):_0x22c4a8(0x11c)};}export const authDefinitions=[{'service':a13_0x2df2d7(0x120),'command':a13_0x2df2d7(0x119),'description':a13_0x2df2d7(0xd4),'risk':a13_0x2df2d7(0xcf),'confirmationDescription':a13_0x2df2d7(0xd0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'access-key','type':a13_0x2df2d7(0x124),'description':a13_0x2df2d7(0x129)},{'name':'ak','type':a13_0x2df2d7(0x124),'description':'Shorthand\x20for\x20--access-key'},{'name':'global','type':'boolean','description':a13_0x2df2d7(0xe3),'default':!![]},{'name':a13_0x2df2d7(0x112),'type':'boolean','description':a13_0x2df2d7(0x109),'default':![]}],async 'execute'(_0x110d65){const _0xae4246=a13_0x2df2d7;if(_0x110d65[_0xae4246(0xcb)](_0xae4246(0xfa)))throw CliErrors[_0xae4246(0xd1)](_0xae4246(0x115),'Use\x20`'+CLI_BIN_NAME+_0xae4246(0x10c)+CLI_BIN_NAME+_0xae4246(0x10f));const _0x37d08a=(_0x110d65[_0xae4246(0xed)](_0xae4246(0x11f))||_0x110d65[_0xae4246(0xed)]('ak')||'')['trim']();if(!_0x37d08a&&_0x110d65[_0xae4246(0xd9)])return{'ok':!![],'message':buildAccessKeySetupGuide(''+getUserDomain()+PRODUCT_CONFIG[_0xae4246(0xe2)])};const _0x3eb8e8=await resolveAuthWriteInput(_0x110d65),_0x3a8ccb=resolveAuthScopeFlags(_0x110d65),_0x1d964d=readScopedConfig(_0x3a8ccb);_0x1d964d[_0xae4246(0x10e)]=_0x3eb8e8['accessKey'];_0x3eb8e8[_0xae4246(0x125)]&&(_0x1d964d[_0xae4246(0x125)]=_0x3eb8e8[_0xae4246(0x125)]);writeScopedConfig(_0x1d964d,_0x3a8ccb);const _0x283715=_0x3a8ccb[_0xae4246(0x11a)]?_0xae4246(0x11a):'project',_0x3f7949=_0x1d964d[_0xae4246(0x125)]?_0xae4246(0xda)+_0x1d964d[_0xae4246(0x125)]+'.':'';return{'ok':!![],'message':_0xae4246(0xde)+_0x283715+'\x20config.'+_0x3f7949+'\x20Verify:\x20'+CLI_BIN_NAME+_0xae4246(0x117)};}},{'service':a13_0x2df2d7(0x120),'command':a13_0x2df2d7(0x100),'description':a13_0x2df2d7(0xeb),'risk':a13_0x2df2d7(0xcf),'confirmationDescription':a13_0x2df2d7(0xf0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'global','type':a13_0x2df2d7(0xf5),'description':a13_0x2df2d7(0xf8),'default':!![]},{'name':a13_0x2df2d7(0x112),'type':'boolean','description':'Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]}],async 'execute'(_0x4083b3){const _0x4e152d=a13_0x2df2d7,_0x4f6b0c=resolveAuthScopeFlags(_0x4083b3),_0x508ed5=readScopedConfig(_0x4f6b0c),_0x111607=!!_0x508ed5['accessKey'];delete _0x508ed5[_0x4e152d(0x10e)],writeScopedConfig(_0x508ed5,_0x4f6b0c);const _0x427597=_0x4f6b0c[_0x4e152d(0x11a)]?'global':_0x4e152d(0x112);if(_0x111607)return{'ok':!![],'message':'AccessKey\x20cleared\x20from\x20'+_0x427597+_0x4e152d(0x118)};return{'ok':!![],'message':_0x4e152d(0xd2)+_0x427597+_0x4e152d(0xea)};}},{'service':a13_0x2df2d7(0x120),'command':a13_0x2df2d7(0x10a),'description':a13_0x2df2d7(0x10d),'risk':a13_0x2df2d7(0xe7),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'global','type':'boolean','description':a13_0x2df2d7(0xe4),'default':!![]},{'name':a13_0x2df2d7(0x112),'type':a13_0x2df2d7(0xf5),'description':a13_0x2df2d7(0xfc),'default':![]},{'name':a13_0x2df2d7(0xf4),'type':a13_0x2df2d7(0xf5),'description':'Exit\x20non-zero\x20when\x20no\x20AccessKey\x20is\x20configured','default':![]}],async 'execute'(_0x4a2dfa){const _0x32e8d4=a13_0x2df2d7,_0x1255f5=resolveAuthScopeFlags(_0x4a2dfa),_0x529d3d=readScopedConfig(_0x1255f5),_0x2145bf=productEnvName(_0x32e8d4(0x114)),_0x3dd521=productEnv(_0x32e8d4(0x114))||undefined,_0x135007=_0x529d3d[_0x32e8d4(0x10e)]||undefined,_0x4baede=_0x3dd521||_0x135007,_0x5afb1f=_0x3dd521?_0x2145bf+_0x32e8d4(0xf9):_0x135007?(_0x1255f5[_0x32e8d4(0x11a)]?'global':_0x32e8d4(0x112))+'\x20config':null,_0x4ef9a6=[_0x32e8d4(0x11b)+AUTH_MODE['ClientAk']];if(_0x4baede){const _0x515523=maskCliAccessKey(_0x4baede);_0x4ef9a6['push'](_0x32e8d4(0x110)+_0x515523+(_0x5afb1f?_0x32e8d4(0xfe)+_0x5afb1f+')':'')),_0x4ef9a6['push'](_0x32e8d4(0xe6));}if(!_0x4baede){_0x4ef9a6[_0x32e8d4(0xdc)](''),_0x4ef9a6[_0x32e8d4(0xdc)](_0x32e8d4(0x127)),_0x4ef9a6['push'](''),_0x4ef9a6[_0x32e8d4(0xdc)](_0x32e8d4(0xe8)+CLI_BIN_NAME+'\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]'),_0x4ef9a6['push'](''),_0x4ef9a6['push'](_0x32e8d4(0xd6)+PRODUCT_CONFIG[_0x32e8d4(0x122)]+')'),_0x4ef9a6[_0x32e8d4(0xdc)](_0x32e8d4(0xfb)),_0x4ef9a6[_0x32e8d4(0xdc)](''),_0x4ef9a6[_0x32e8d4(0xdc)](_0x32e8d4(0xd7)),_0x4ef9a6['push'](_0x32e8d4(0x126)+_0x2145bf+_0x32e8d4(0xd3)),_0x4ef9a6['push'](''),_0x4ef9a6['push'](_0x32e8d4(0xfd)+CLI_BIN_NAME+_0x32e8d4(0x117)),_0x4ef9a6['push']('If\x20command\x20execution\x20still\x20fails,\x20run:\x20'+CLI_BIN_NAME+_0x32e8d4(0x105));if(_0x4a2dfa[_0x32e8d4(0xcb)](_0x32e8d4(0xf4))){const _0x157876=readStoredDeviceCode();if(_0x157876&&!isStoredDeviceCodeExpired(_0x157876)){const _0x3cdcf9=getUserDomain(),_0x59dabe=await fetchDeviceToken(_0x3cdcf9,_0x157876['code']);if(_0x59dabe[_0x32e8d4(0x10a)]===_0x32e8d4(0xf2)&&_0x59dabe['access_key']){const _0x58daa4={'global':_0x157876[_0x32e8d4(0x12a)]===_0x32e8d4(0x11a)},_0x3b3146=readScopedConfig(_0x58daa4);_0x3b3146[_0x32e8d4(0x10e)]=_0x59dabe[_0x32e8d4(0xe1)],writeScopedConfig(_0x3b3146,_0x58daa4),deleteStoredDeviceCode();const _0x17233f=_0x59dabe[_0x32e8d4(0xe1)],_0x4ce6d6=maskCliAccessKey(_0x17233f),_0x3913d5=_0x157876[_0x32e8d4(0x12a)]==='global'?_0x32e8d4(0x106):_0x32e8d4(0x113);return{'ok':!![],'message':[_0x32e8d4(0x11b)+AUTH_MODE['ClientAk'],_0x32e8d4(0x110)+_0x4ce6d6+_0x32e8d4(0xfe)+_0x3913d5+')',_0x32e8d4(0xe6)][_0x32e8d4(0x11d)]('\x0a')};}_0x59dabe[_0x32e8d4(0x10a)]===_0x32e8d4(0x111)&&deleteStoredDeviceCode();throw CliErrors[_0x32e8d4(0xcc)](_0x32e8d4(0x108));}throw CliErrors[_0x32e8d4(0xcc)](_0x4ef9a6['join']('\x0a'));}}return{'ok':!![],'message':_0x4ef9a6[_0x32e8d4(0x11d)]('\x0a')};}},{'service':a13_0x2df2d7(0x120),'command':a13_0x2df2d7(0xf7),'description':a13_0x2df2d7(0x101),'risk':a13_0x2df2d7(0xe7),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x5151da){const _0x21d845=a13_0x2df2d7,_0x498b14=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x498b14,'meta':{'env':_0x5151da[_0x21d845(0xff)]??'production'}}};}},authDeviceDefinition];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x565088,_0x23af18){const _0x1aa6b7=a14_0x3da0,_0xb3aa52=_0x565088();while(!![]){try{const _0x7b8d17=parseInt(_0x1aa6b7(0x1f7))/0x1*(parseInt(_0x1aa6b7(0x1f0))/0x2)+-parseInt(_0x1aa6b7(0x1eb))/0x3+-parseInt(_0x1aa6b7(0x1ee))/0x4+-parseInt(_0x1aa6b7(0x1ea))/0x5*(parseInt(_0x1aa6b7(0x1f4))/0x6)+-parseInt(_0x1aa6b7(0x1f5))/0x7*(parseInt(_0x1aa6b7(0x1e8))/0x8)+-parseInt(_0x1aa6b7(0x1e1))/0x9*(-parseInt(_0x1aa6b7(0x1f2))/0xa)+-parseInt(_0x1aa6b7(0x1e5))/0xb*(-parseInt(_0x1aa6b7(0x1ef))/0xc);if(_0x7b8d17===_0x23af18)break;else _0xb3aa52['push'](_0xb3aa52['shift']());}catch(_0x470324){_0xb3aa52['push'](_0xb3aa52['shift']());}}}(a14_0x10c6,0x700e1));import{createInterface}from'node:readline';class AbortPrompt extends Error{constructor(){const _0x1d867b=a14_0x3da0;super(_0x1d867b(0x1ec)),this['name']=_0x1d867b(0x1e3);}}function createSafeRl(){const _0x225c3e=a14_0x3da0,_0x264e79=createInterface({'input':process[_0x225c3e(0x1e4)],'output':process[_0x225c3e(0x1f1)]});let _0x36078b;const _0x21729d=new Promise((_0x5a05c9,_0xbcb85e)=>{const _0x373a1b=_0x225c3e;_0x36078b=()=>{const _0x1bf53b=a14_0x3da0;_0x36078b&&(_0x264e79['removeListener'](_0x1bf53b(0x1e2),_0x36078b),_0x36078b=undefined);try{_0x264e79['close']();}catch{}_0xbcb85e(new AbortPrompt());},_0x264e79['once'](_0x373a1b(0x1e2),_0x36078b);}),_0xc28360=()=>{const _0x3bc89f=_0x225c3e;_0x36078b&&(_0x264e79['removeListener'](_0x3bc89f(0x1e2),_0x36078b),_0x36078b=undefined);try{_0x264e79[_0x3bc89f(0x1e6)]();}catch{}};return{'rl':_0x264e79,'abortPromise':_0x21729d,'disposeSuccess':_0xc28360};}export async function promptAccessKey(_0x50f9ca=''){const {rl:_0x1b02be,abortPromise:_0xe27524,disposeSuccess:_0x184e78}=createSafeRl(),_0x314c32=new Promise(_0x18e1a6=>{const _0x21804a=a14_0x3da0,_0x114e11=_0x50f9ca?_0x21804a(0x1e9)+_0x50f9ca+_0x21804a(0x1e7):_0x21804a(0x1ed);_0x1b02be[_0x21804a(0x1f3)](_0x114e11,_0x765e12=>{_0x184e78(),_0x18e1a6(_0x765e12['trim']()||_0x50f9ca);});});return Promise['race']([_0x314c32,_0xe27524]);}export function isAbortPrompt(_0x50a25a){const _0x6c77c4=a14_0x3da0;return _0x50a25a instanceof Error&&_0x50a25a[_0x6c77c4(0x1f6)]===_0x6c77c4(0x1e3);}function a14_0x3da0(_0x39ad40,_0x4dcdd9){_0x39ad40=_0x39ad40-0x1e1;const _0x10c6e4=a14_0x10c6();let _0x3da0dd=_0x10c6e4[_0x39ad40];return _0x3da0dd;}function a14_0x10c6(){const _0x3978ca=['10CwOYYR','question','1494414BudHVj','23142WkFZya','name','361360TNdzsV','3060198YgYSSP','SIGINT','AbortPrompt','stdin','9877054pRPbkD','close','):\x20','1216SEvIgm','AccessKey\x20(','5VXuBYW','44166uncwPC','User\x20aborted\x20prompt','AccessKey\x20(paste\x20ak_...):\x20','1496064cMCGVN','12gGPcNU','2nmfKQw','stdout'];a14_0x10c6=function(){return _0x3978ca;};return a14_0x10c6();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a15_0x19bdf3=a15_0x166e;function a15_0x166e(_0x88ab32,_0x42a546){_0x88ab32=_0x88ab32-0xb0;const _0x497fd8=a15_0x497f();let _0x166ef4=_0x497fd8[_0x88ab32];return _0x166ef4;}(function(_0xfed351,_0x226fa3){const _0x5624c8=a15_0x166e,_0x4b7375=_0xfed351();while(!![]){try{const _0x4aec6c=parseInt(_0x5624c8(0xb5))/0x1+-parseInt(_0x5624c8(0xbb))/0x2+-parseInt(_0x5624c8(0xc5))/0x3*(parseInt(_0x5624c8(0xb4))/0x4)+-parseInt(_0x5624c8(0xb3))/0x5*(-parseInt(_0x5624c8(0xb7))/0x6)+parseInt(_0x5624c8(0xba))/0x7*(parseInt(_0x5624c8(0xbc))/0x8)+-parseInt(_0x5624c8(0xbf))/0x9+-parseInt(_0x5624c8(0xb0))/0xa;if(_0x4aec6c===_0x226fa3)break;else _0x4b7375['push'](_0x4b7375['shift']());}catch(_0x1ab1d9){_0x4b7375['push'](_0x4b7375['shift']());}}}(a15_0x497f,0xdedbf));import{getBffEndpointContract}from'../../core/api-client.js';import{NAME_FLAG}from'../../commands/common/flags.js';export const bffDetail={'service':a15_0x19bdf3(0xc2),'command':a15_0x19bdf3(0xb6),'description':a15_0x19bdf3(0xc3),'risk':a15_0x19bdf3(0xc0),'flags':[{...NAME_FLAG,'required':!![],'description':a15_0x19bdf3(0xc1)}],async 'execute'(_0x1510be){const _0x4cbe7f=a15_0x19bdf3,_0x15b7c3=await getBffEndpointContract(_0x1510be[_0x4cbe7f(0xbe)],_0x1510be[_0x4cbe7f(0xc4)]('name'));return{'ok':!![],'data':{'appCode':_0x15b7c3[_0x4cbe7f(0xbe)],'functionName':_0x15b7c3[_0x4cbe7f(0xb2)],'description':_0x15b7c3[_0x4cbe7f(0xbd)]||_0x4cbe7f(0xb9),'version':_0x15b7c3[_0x4cbe7f(0xb8)],'gmtModified':_0x15b7c3[_0x4cbe7f(0xb1)]}};}};function a15_0x497f(){const _0x1cde9a=['bff','Get\x20a\x20Backend\x20Function\x20endpoint\x20contract\x20by\x20function\x20name','str','3PXJXar','8871080fTjIBN','gmtModified','functionName','1825735IBKOTM','1273268HizOgz','591192tBAKns','detail','24HlPzEs','version','(none)','336203ksrrfd','348692HJydiJ','296MxdddN','description','appCode','13826259VIUeZp','read','Backend\x20Function\x20name'];a15_0x497f=function(){return _0x1cde9a;};return a15_0x497f();}
|
package/lib/commands/bff/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a16_0x3c2d8f=a16_0x2814;(function(_0x3cbd0a,_0x54af40){const _0x47420b=a16_0x2814,_0x41196d=_0x3cbd0a();while(!![]){try{const _0x2a85e7=-parseInt(_0x47420b(0xc0))/0x1*(parseInt(_0x47420b(0xb1))/0x2)+-parseInt(_0x47420b(0xb6))/0x3+-parseInt(_0x47420b(0xb3))/0x4+parseInt(_0x47420b(0xb2))/0x5*(-parseInt(_0x47420b(0xb5))/0x6)+-parseInt(_0x47420b(0xb4))/0x7+parseInt(_0x47420b(0xba))/0x8*(-parseInt(_0x47420b(0xbc))/0x9)+parseInt(_0x47420b(0xb9))/0xa;if(_0x2a85e7===_0x54af40)break;else _0x41196d['push'](_0x41196d['shift']());}catch(_0x26f8e7){_0x41196d['push'](_0x41196d['shift']());}}}(a16_0x1ca8,0x4d57d));import{executeSdkBff}from'../../core/sdk-client.js';function a16_0x1ca8(){const _0x95a360=['Execute\x20a\x20Backend\x20Function\x20script\x20by\x20function\x20name','params','bff','1oSPifA','name','579434MKmcTj','379705tUwYIu','367524kAxMlV','778176TwVuDP','30WlFkNv','243552fOCeEg','read','str','18137780tbZAQJ','3152pStglF','Backend\x20Function\x20name\x20to\x20execute','12411tsVodD'];a16_0x1ca8=function(){return _0x95a360;};return a16_0x1ca8();}import{parseJsonParams}from'../../utils/params.js';function a16_0x2814(_0x9beb4c,_0x36f16e){_0x9beb4c=_0x9beb4c-0xb1;const _0x1ca8bd=a16_0x1ca8();let _0x2814ab=_0x1ca8bd[_0x9beb4c];return _0x2814ab;}import{NAME_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';export const bffExec={'service':a16_0x3c2d8f(0xbf),'command':'exec','description':a16_0x3c2d8f(0xbd),'risk':a16_0x3c2d8f(0xb7),'flags':[{...NAME_FLAG,'required':!![],'description':a16_0x3c2d8f(0xbb)},PARAMS_FLAG],async 'execute'(_0xb2e670){const _0x581cb7=a16_0x3c2d8f,_0x23da97=parseJsonParams(_0xb2e670[_0x581cb7(0xb8)](_0x581cb7(0xbe))),_0x23bafc=Date['now'](),_0x5427cc=await executeSdkBff(_0xb2e670[_0x581cb7(0xb8)](_0x581cb7(0xc1)),_0x23da97),_0x4b4e25=Date['now']()-_0x23bafc;return{'ok':!![],'data':{'result':_0x5427cc,'elapsed':_0x4b4e25},'message':'Backend\x20Function\x20executed\x20in\x20'+_0x4b4e25+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5d6f46,_0x4377af){const _0xba5c75=a17_0xf6a6,_0x29bae2=_0x5d6f46();while(!![]){try{const _0x281589=-parseInt(_0xba5c75(0x1fd))/0x1*(-parseInt(_0xba5c75(0x1f9))/0x2)+parseInt(_0xba5c75(0x1f5))/0x3+parseInt(_0xba5c75(0x1f8))/0x4*(-parseInt(_0xba5c75(0x1fb))/0x5)+parseInt(_0xba5c75(0x1f6))/0x6+-parseInt(_0xba5c75(0x1f7))/0x7+-parseInt(_0xba5c75(0x1f4))/0x8+parseInt(_0xba5c75(0x1fc))/0x9*(parseInt(_0xba5c75(0x1fa))/0xa);if(_0x281589===_0x4377af)break;else _0x29bae2['push'](_0x29bae2['shift']());}catch(_0x398839){_0x29bae2['push'](_0x29bae2['shift']());}}}(a17_0xa7ad,0x41d4b));import{bffDetail}from'../../commands/bff/detail.js';import{bffExec}from'../../commands/bff/exec.js';function a17_0xa7ad(){const _0x222002=['5owXCKL','36837RjBQEX','193504ZttZEY','516824gDQVMt','847566lMCXQu','1486008ztYZLB','1398642jurczn','2154720LcYKaj','4oQOGOg','380ypPZJH'];a17_0xa7ad=function(){return _0x222002;};return a17_0xa7ad();}function a17_0xf6a6(_0x60a16a,_0x23cc8d){_0x60a16a=_0x60a16a-0x1f4;const _0xa7ad3b=a17_0xa7ad();let _0xf6a630=_0xa7ad3b[_0x60a16a];return _0xf6a630;}export const bffDefinitions=[bffDetail,bffExec];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a18_0x296896=a18_0x1bfa;function a18_0x1bfa(_0x20a8d2,_0x372d7d){_0x20a8d2=_0x20a8d2-0x95;const _0x5a4625=a18_0x5a46();let _0x1bfaa4=_0x5a4625[_0x20a8d2];return _0x1bfaa4;}function a18_0x5a46(){const _0x991e6f=['install','repairCommand','28138671YKdOhP','37112WYbYmw','inherit','code','1ADsCND','CLI\x20Built-in\x20Skill\x20','cwd','244BPAASY','INSTALL_FAILED','installedPath','apiError','1305hQenss','setLogPath','log','19380URwwgC','nonInteractive','info','\x20at\x20','1249816QIurEO','read','Built-in\x20Skill\x20install\x20failed\x20[','\x20installed','2347190zFYEDW','325RbzpGN','9609wmjKcM','4778690RxadoG'];a18_0x5a46=function(){return _0x991e6f;};return a18_0x5a46();}(function(_0x3f194b,_0x35cdea){const _0x57e233=a18_0x1bfa,_0x3410b4=_0x3f194b();while(!![]){try{const _0x24b02e=parseInt(_0x57e233(0xa0))/0x1*(-parseInt(_0x57e233(0xae))/0x2)+parseInt(_0x57e233(0x98))/0x3*(-parseInt(_0x57e233(0xa3))/0x4)+-parseInt(_0x57e233(0x97))/0x5*(-parseInt(_0x57e233(0xaa))/0x6)+-parseInt(_0x57e233(0x99))/0x7+parseInt(_0x57e233(0x9d))/0x8*(-parseInt(_0x57e233(0xa7))/0x9)+-parseInt(_0x57e233(0x96))/0xa+parseInt(_0x57e233(0x9c))/0xb;if(_0x24b02e===_0x35cdea)break;else _0x3410b4['push'](_0x3410b4['shift']());}catch(_0x26fd4f){_0x3410b4['push'](_0x3410b4['shift']());}}}(a18_0x5a46,0x5752c));import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':'cli-skill','command':a18_0x296896(0x9a),'description':'Install\x20the\x20built-in\x20CLI\x20Skill\x20required\x20by\x20Lovrabet\x20runtime','risk':a18_0x296896(0xaf),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x14180e){const _0x557f75=a18_0x296896;logger[_0x557f75(0xa8)](process[_0x557f75(0xa2)]()),logger[_0x557f75(0xac)]('cli-skill-install','Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20npm\x20package.');const _0x21ece5=installBuiltinSkill({'stdio':_0x14180e[_0x557f75(0xab)]?'pipe':_0x557f75(0x9e)});if(!_0x21ece5['ok'])throw CliErrors[_0x557f75(0xa6)](_0x557f75(0xb0)+(_0x21ece5[_0x557f75(0x9f)]||_0x557f75(0xa4))+']:\x20'+(_0x21ece5['error']||'unknown'),'Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20'+_0x21ece5[_0x557f75(0x9b)]);const _0x2a320a=_0x21ece5[_0x557f75(0xa5)]?_0x557f75(0xad)+_0x21ece5[_0x557f75(0xa5)]:'';return console[_0x557f75(0xa9)](_0x21ece5['changed']?_0x557f75(0xa1)+_0x21ece5['skillVersion']+_0x557f75(0x95)+_0x2a320a:_0x557f75(0xa1)+_0x21ece5['skillVersion']+'\x20is\x20already\x20current'+_0x2a320a),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5dc8bc,_0x1a6f69){const _0x253779=a19_0x7a0c,_0xb054fc=_0x5dc8bc();while(!![]){try{const _0x1ec29c=parseInt(_0x253779(0xc5))/0x1+-parseInt(_0x253779(0xc2))/0x2*(-parseInt(_0x253779(0xc7))/0x3)+-parseInt(_0x253779(0xbe))/0x4*(-parseInt(_0x253779(0xca))/0x5)+parseInt(_0x253779(0xcb))/0x6+parseInt(_0x253779(0xc8))/0x7+-parseInt(_0x253779(0xce))/0x8*(parseInt(_0x253779(0xc3))/0x9)+parseInt(_0x253779(0xbf))/0xa*(-parseInt(_0x253779(0xd0))/0xb);if(_0x1ec29c===_0x1a6f69)break;else _0xb054fc['push'](_0xb054fc['shift']());}catch(_0x238216){_0xb054fc['push'](_0xb054fc['shift']());}}}(a19_0x2fb1,0xace3a));import{PRODUCT_CONFIG}from'../../constant/product.js';export{DEFAULT_APP_PROFILE_NAME,DEFAULT_CONFIG_VALUES}from'../../constant/defaults.js';export{RUNTIME_ENV_VALUES}from'../../constant/env.js';function a19_0x2fb1(){const _0x599ca0=[',\x20or\x20create\x20a\x20project-local\x20','Add\x20--global\x20to\x20write\x20to\x20~/','746260GHVzcG','581270HTfPfm','validation','\x20(global)','68aKvdyO','3074121XbEslq','\x20found).','189868TnGvxW','Not\x20inside\x20a\x20project\x20(no\x20','11202PTVsTg','2338567oKKRCw','global','5ucSmjk','3366090SPFFUi','project','newConfigFileName','8DINDYi','global-default','66mWSlLP'];a19_0x2fb1=function(){return _0x599ca0;};return a19_0x2fb1();}function a19_0x7a0c(_0x5138b3,_0x3d0cf2){_0x5138b3=_0x5138b3-0xbc;const _0x2fb1ef=a19_0x2fb1();let _0x7a0ca4=_0x2fb1ef[_0x5138b3];return _0x7a0ca4;}export{OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{isInProject}from'../../context.js';import{CliErrors}from'../../errors.js';export{buildAppProfileListFields,CONFIG_ENUM_VALUES,CLI_PROTECTED_CONFIG_KEYS,IMPORTABLE_RUNTIME_CONFIG_KEYS,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getConfigDefaultValue,getConfigEnumValues,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isLegacyCompatConfigKey,isCliProtectedConfigKey,isTopLevelConfigKey,normalizeLocale}from'../../config/schema.js';export function resolveConfigScope(_0x3652ed){const _0x34f91b=a19_0x7a0c,{explicitGlobal:explicitGlobal=![],explicitProject:explicitProject=![],policy:_0x132bd6}=_0x3652ed;if(explicitGlobal&&explicitProject)throw CliErrors[_0x34f91b(0xc0)]('Flags\x20--global\x20and\x20--project\x20are\x20mutually\x20exclusive.','Use\x20only\x20one\x20config\x20scope\x20flag.');if(explicitGlobal)return _0x34f91b(0xc9);if(explicitProject)return _0x34f91b(0xcc);switch(_0x132bd6){case _0x34f91b(0xcf):return _0x34f91b(0xc9);case'project-or-global-explicit':if(!(_0x3652ed['inProject']??isInProject()))throw CliErrors[_0x34f91b(0xc0)](_0x34f91b(0xc6)+PRODUCT_CONFIG['newConfigFileName']+_0x34f91b(0xc4),_0x34f91b(0xbd)+PRODUCT_CONFIG[_0x34f91b(0xcd)]+_0x34f91b(0xbc)+PRODUCT_CONFIG[_0x34f91b(0xcd)]+'\x20first.');return'project';}}export function toScopeFlags(_0x30f281){return{'global':_0x30f281==='global'};}export function formatScopeLabel(_0xdd92e6){const _0x489ffc=a19_0x7a0c;return _0xdd92e6===_0x489ffc(0xc9)?_0x489ffc(0xc1):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1b25cc,_0x45bb99){const _0xe2a5df=a20_0x285e,_0x5ac3fb=_0x1b25cc();while(!![]){try{const _0x114960=parseInt(_0xe2a5df(0x1a3))/0x1*(-parseInt(_0xe2a5df(0x1a2))/0x2)+-parseInt(_0xe2a5df(0x1b3))/0x3*(-parseInt(_0xe2a5df(0x1a1))/0x4)+-parseInt(_0xe2a5df(0x1bf))/0x5+parseInt(_0xe2a5df(0x1b1))/0x6*(-parseInt(_0xe2a5df(0x1ae))/0x7)+parseInt(_0xe2a5df(0x1a7))/0x8*(-parseInt(_0xe2a5df(0x1b2))/0x9)+-parseInt(_0xe2a5df(0x1ab))/0xa*(-parseInt(_0xe2a5df(0x1b6))/0xb)+parseInt(_0xe2a5df(0x1a9))/0xc;if(_0x114960===_0x45bb99)break;else _0x5ac3fb['push'](_0x5ac3fb['shift']());}catch(_0x609f92){_0x5ac3fb['push'](_0x5ac3fb['shift']());}}}(a20_0xcbcb,0x63dfc));import{CliErrors}from'../../errors.js';function isSet(_0x534373,_0x1b9e85){const _0x5cd2ba=a20_0x285e,_0x204841=_0x534373[_0x5cd2ba(0x1a6)](_0x1b9e85);return _0x204841!==undefined&&_0x204841!==''&&_0x204841!==![]&&_0x204841!==0x0;}function fmtNames(_0x4b8960){const _0x44cd98=a20_0x285e;return _0x4b8960['map'](_0x54978a=>'--'+_0x54978a)[_0x44cd98(0x1b9)](',\x20');}export function requireOneOf(_0xd542d8,_0x1bee57,_0x5ae378){const _0x5e49fe=a20_0x285e,_0x1b0ba6=_0x1bee57['filter'](_0x1d3d3c=>isSet(_0xd542d8,_0x1d3d3c));if(_0x1b0ba6[_0x5e49fe(0x1aa)]!==0x1)throw CliErrors['validation'](_0x1b0ba6[_0x5e49fe(0x1aa)]===0x0?_0x5e49fe(0x1a5)+fmtNames(_0x1bee57)+_0x5e49fe(0x1bb)+_0x5ae378+'`.':_0x5e49fe(0x1bc)+fmtNames(_0x1bee57)+_0x5e49fe(0x1be)+fmtNames(_0x1b0ba6)+'.',_0x1b0ba6[_0x5e49fe(0x1aa)]===0x0?_0x5e49fe(0x1b7)+fmtNames(_0x1bee57):_0x5e49fe(0x1b5));}export function requireAnyOf(_0x30eb6b,_0x2a0daa,_0x3c4dfd){const _0x107ae8=a20_0x285e;if(!_0x2a0daa[_0x107ae8(0x1ac)](_0x435c9b=>isSet(_0x30eb6b,_0x435c9b)))throw CliErrors[_0x107ae8(0x1ad)](_0x107ae8(0x1bd)+fmtNames(_0x2a0daa)+_0x107ae8(0x1bb)+_0x3c4dfd+'`.',_0x107ae8(0x1b7)+fmtNames(_0x2a0daa));}function a20_0xcbcb(){const _0xf98642=['Remove\x20all\x20but\x20one.','2420XjsVoX','Provide\x20one\x20of:\x20','test','join','\x20are\x20mutually\x20exclusive\x20for\x20`','\x20is\x20required\x20for\x20`','Only\x20one\x20of\x20','At\x20least\x20one\x20of\x20','\x20is\x20allowed,\x20found:\x20','2973480UdQSDR','12NjLbIl','18ejVAXq','47418hjhpMo','filter','Exactly\x20one\x20of\x20','flag','8wLYFMA',':\x20expected\x20','9785844lVSumk','length','36800YVIcgU','some','validation','7lxcqXq','Use\x20only\x20one\x20of:\x20',',\x20got\x20\x22','4813698kYlhwZ','1524357jzbIeZ','777111tDTUDl','Flags\x20'];a20_0xcbcb=function(){return _0xf98642;};return a20_0xcbcb();}export function mutuallyExclusive(_0x202b00,_0x47c7bc,_0x5665c5){const _0x56078a=a20_0x285e,_0x402027=_0x47c7bc[_0x56078a(0x1a4)](_0x3872f1=>isSet(_0x202b00,_0x3872f1));if(_0x402027['length']>0x1)throw CliErrors['validation'](_0x56078a(0x1b4)+fmtNames(_0x402027)+_0x56078a(0x1ba)+_0x5665c5+'`.',_0x56078a(0x1af)+fmtNames(_0x47c7bc));}function a20_0x285e(_0x1b59f6,_0x1ada63){_0x1b59f6=_0x1b59f6-0x1a1;const _0xcbcb84=a20_0xcbcb();let _0x285e74=_0xcbcb84[_0x1b59f6];return _0x285e74;}export function validatePattern(_0x12ab8a,_0x24719b,_0x356fc5,_0x1dd88b){const _0x51737c=a20_0x285e,_0x35a33d=_0x12ab8a['str'](_0x24719b);if(_0x35a33d&&!_0x356fc5[_0x51737c(0x1b8)](_0x35a33d))throw CliErrors[_0x51737c(0x1ad)]('Invalid\x20--'+_0x24719b+_0x51737c(0x1a8)+_0x1dd88b+_0x51737c(0x1b0)+_0x35a33d+'\x22.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0xb0a544=a21_0x5b27;(function(_0x47d320,_0x49f52d){const _0x37bfc=a21_0x5b27,_0xea4175=_0x47d320();while(!![]){try{const _0x56a2c3=-parseInt(_0x37bfc(0xa5))/0x1+-parseInt(_0x37bfc(0xa9))/0x2+-parseInt(_0x37bfc(0xa0))/0x3*(-parseInt(_0x37bfc(0x97))/0x4)+parseInt(_0x37bfc(0x98))/0x5+-parseInt(_0x37bfc(0x9b))/0x6+parseInt(_0x37bfc(0x9e))/0x7*(-parseInt(_0x37bfc(0x9f))/0x8)+parseInt(_0x37bfc(0xa4))/0x9*(parseInt(_0x37bfc(0xa3))/0xa);if(_0x56a2c3===_0x49f52d)break;else _0xea4175['push'](_0xea4175['shift']());}catch(_0x1b9f69){_0xea4175['push'](_0xea4175['shift']());}}}(a21_0x1a9b,0x38269));export const GLOBAL_SCOPE_FLAG={'name':a21_0xb0a544(0xaa),'type':'boolean','default':![],'description':a21_0xb0a544(0xa8)};export const CODE_FLAG={'name':'code','type':a21_0xb0a544(0xa6),'required':!![],'description':a21_0xb0a544(0xa7),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':'a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588)'}};function a21_0x5b27(_0x3cfe53,_0xb35a2c){_0x3cfe53=_0x3cfe53-0x95;const _0x1a9b7b=a21_0x1a9b();let _0x5b27e5=_0x1a9b7b[_0x3cfe53];return _0x5b27e5;}export const SQLCODE_FLAG={'name':'sqlcode','type':'string','required':!![],'description':'SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a21_0xb0a544(0x95)}};export const VERBOSE_FLAG={'name':a21_0xb0a544(0x9c),'type':a21_0xb0a544(0x99),'description':a21_0xb0a544(0xa1)};export const PARAMS_FLAG={'name':a21_0xb0a544(0x9d),'type':a21_0xb0a544(0xa6),'description':'Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)'};export const NAME_FLAG={'name':a21_0xb0a544(0x96),'type':'string','description':a21_0xb0a544(0xa2)};function a21_0x1a9b(){const _0x22a8dc=['Write\x20to\x20the\x20global\x20configuration','194426KNMeol','global','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','name','148364aPdYia','1902695bxbwyn','boolean','number','212100MgVVbR','verbose','params','343AEJLNx','47856uPgobL','15ZYLmbi','Return\x20full\x20raw\x20response\x20object','Resource\x20name\x20for\x20lookup','16780LpWMdK','1044BmWRhH','104968bDNURe','string','Dataset\x20code\x20(32-char\x20hex\x20UUID)'];a21_0x1a9b=function(){return _0x22a8dc;};return a21_0x1a9b();}export const ID_FLAG={'name':'id','type':a21_0xb0a544(0x9a),'required':!![],'description':'Resource\x20ID'};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a22_0x1bd1(){const _0x5b1f65=['296XHXJNh','4sODusv','2351907cpjobM','2388BGCSNK','22527dMzzdt','File\x20is\x20not\x20a\x20regular\x20file:\x20','899975GHkXbT','isFile','ceil','66xWweor','3258359MtAoga','size','trim','\x20path\x20is\x20required.','validation','12DBFNBO','867265qUyyke','17420avuBSR','3060vtNIhj','File\x20exceeds\x20the\x20runtime\x20upload\x20limit\x20of\x2050\x20MB:\x20','4wpkCzD'];a22_0x1bd1=function(){return _0x5b1f65;};return a22_0x1bd1();}(function(_0x4151ef,_0x7f5fc8){const _0x2f775c=a22_0x4131,_0x126e19=_0x4151ef();while(!![]){try{const _0x1beb7c=-parseInt(_0x2f775c(0x1f4))/0x1*(-parseInt(_0x2f775c(0x202))/0x2)+-parseInt(_0x2f775c(0x205))/0x3*(-parseInt(_0x2f775c(0x204))/0x4)+parseInt(_0x2f775c(0x1ff))/0x5*(-parseInt(_0x2f775c(0x206))/0x6)+parseInt(_0x2f775c(0x1fe))/0x7+parseInt(_0x2f775c(0x203))/0x8*(-parseInt(_0x2f775c(0x207))/0x9)+parseInt(_0x2f775c(0x200))/0xa*(parseInt(_0x2f775c(0x1f7))/0xb)+-parseInt(_0x2f775c(0x1fd))/0xc*(parseInt(_0x2f775c(0x1f8))/0xd);if(_0x1beb7c===_0x7f5fc8)break;else _0x126e19['push'](_0x126e19['shift']());}catch(_0x2d3cb9){_0x126e19['push'](_0x126e19['shift']());}}}(a22_0x1bd1,0xef334));import{existsSync,statSync}from'node:fs';import{CliErrors}from'../../errors.js';const BYTES_PER_MB=0x400*0x400;function a22_0x4131(_0x4edc83,_0x11ff03){_0x4edc83=_0x4edc83-0x1f3;const _0x1bd169=a22_0x1bd1();let _0x4131db=_0x1bd169[_0x4edc83];return _0x4131db;}export const RUNTIME_UPLOAD_MAX_BYTES=0x32*BYTES_PER_MB;function formatBytes(_0x310796){const _0x2f6116=a22_0x4131;if(_0x310796>=BYTES_PER_MB){const _0x4456a7=Math[_0x2f6116(0x1f6)](_0x310796/BYTES_PER_MB*0x64)/0x64;return _0x4456a7['toFixed'](0x2)+'\x20MB';}return _0x310796+'\x20B';}export function requireRuntimeUploadFile(_0x328b10,_0x12c71a){const _0x5539e4=a22_0x4131,_0x2ff939=_0x328b10[_0x5539e4(0x1fa)]();if(!_0x2ff939)throw CliErrors['validation'](_0x12c71a+_0x5539e4(0x1fb));if(!existsSync(_0x2ff939))throw CliErrors[_0x5539e4(0x1fc)]('File\x20not\x20found:\x20'+_0x2ff939);const _0x33cf38=statSync(_0x2ff939);if(!_0x33cf38[_0x5539e4(0x1f5)]())throw CliErrors['validation'](_0x5539e4(0x1f3)+_0x2ff939);if(_0x33cf38[_0x5539e4(0x1f9)]>RUNTIME_UPLOAD_MAX_BYTES)throw CliErrors[_0x5539e4(0x1fc)](_0x5539e4(0x201)+_0x2ff939+'\x20('+formatBytes(_0x33cf38[_0x5539e4(0x1f9)])+')');return{'path':_0x2ff939,'size':_0x33cf38[_0x5539e4(0x1f9)]};}
|
|
@@ -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
|
+
function a23_0x1863(){const _0x217b10=['55ccdlaH','project-or-global-explicit','object','log','\x20(global)','locale','alias','split','Invalid\x20value\x20for\x20\x22','field','appcode','global','\x22\x20is\x20protected\x20and\x20cannot\x20be\x20changed\x20via\x20config\x20commands.','length','write','7AwTMQQ','delete','\x20config\x20get\x20<key>','apps','pretty','\x20config\x20delete\x20<key>\x20[--global]','Config\x20files:\x0a','Set\x20`','Top-level\x20key\x20\x22','join','pageSize\x20must\x20be\x20a\x20positive\x20number','\x20\x20project:\x20','1645032xkjMyQ','397655zyWOMC','\x22\x20is\x20not\x20settable.','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','List\x20current\x20config','stringify','set','list','(none)','read','trim','760104MzsbPo','Key\x20already\x20absent:\x20','key','`\x20=\x20\x22','accessKey','args','396dVTViM','\x22.\x20Allowed:\x20','3359043msFoci','Delete\x20a\x20configuration\x20value','validation','get','format','pageSize','Set\x20a\x20configuration\x20value','653632mVzdAg','Usage:\x20','Settable\x20keys:\x20','config','Key\x20not\x20found:\x20','isArray','Invalid\x20locale\x20value.','Deleted\x20`','Get\x20a\x20config\x20value','1106176LHVkiJ','raw','../../context.js','value','Deletes\x20a\x20Lovrabet\x20CLI\x20config\x20key.\x20Later\x20commands\x20will\x20fall\x20back\x20to\x20another\x20config\x20layer\x20or\x20the\x20default.','Missing\x20key\x20argument.','includes'];a23_0x1863=function(){return _0x217b10;};return a23_0x1863();}const a23_0x68ed4a=a23_0x403b;(function(_0x5599af,_0xa90bcb){const _0x32f253=a23_0x403b,_0x57ceb0=_0x5599af();while(!![]){try{const _0x13bada=parseInt(_0x32f253(0x1ae))/0x1+parseInt(_0x32f253(0x1d0))/0x2+-parseInt(_0x32f253(0x1b8))/0x3+parseInt(_0x32f253(0x1c7))/0x4+parseInt(_0x32f253(0x1d7))/0x5*(parseInt(_0x32f253(0x1be))/0x6)+parseInt(_0x32f253(0x1e6))/0x7*(-parseInt(_0x32f253(0x1ad))/0x8)+-parseInt(_0x32f253(0x1c0))/0x9;if(_0x13bada===_0xa90bcb)break;else _0x57ceb0['push'](_0x57ceb0['shift']());}catch(_0x4f0f08){_0x57ceb0['push'](_0x57ceb0['shift']());}}}(a23_0x1863,0x4501d));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';function a23_0x403b(_0x42995c,_0x36d787){_0x42995c=_0x42995c-0x1aa;const _0x18630=a23_0x1863();let _0x403b50=_0x18630[_0x42995c];return _0x403b50;}import{GLOBAL_SCOPE_FLAG}from'../../commands/common/flags.js';import{maskCliAccessKey,redactCliConfigCredentials,redactCliConfigValue}from'../../utils/access-key-redaction.js';function parseAliasAppcodeSetKey(_0xa8cdfe){const _0x2668bc=a23_0x403b,_0x2dfd8a=_0xa8cdfe['split']('.');if(_0x2dfd8a[_0x2668bc(0x1e4)]!==0x3||_0x2dfd8a[0x0]!==_0x2668bc(0x1e9)||_0x2dfd8a[0x2]!==_0x2668bc(0x1e1))return undefined;const _0x3eaf97=_0x2dfd8a[0x1]?.[_0x2668bc(0x1b7)]();return _0x3eaf97?_0x3eaf97:undefined;}function parseAliasDeleteKey(_0x1a1bc5){const _0x5c944d=a23_0x403b,_0x4cc8e5=_0x1a1bc5[_0x5c944d(0x1de)]('.');if(_0x4cc8e5[_0x5c944d(0x1e4)]===0x2&&_0x4cc8e5[0x0]===_0x5c944d(0x1e9)){const _0x17a3a1=_0x4cc8e5[0x1]?.[_0x5c944d(0x1b7)]();return _0x17a3a1?{'alias':_0x17a3a1}:undefined;}if(_0x4cc8e5[_0x5c944d(0x1e4)]===0x3&&_0x4cc8e5[0x0]==='apps'&&_0x4cc8e5[0x2]==='appcode'){const _0x592ad9=_0x4cc8e5[0x1]?.[_0x5c944d(0x1b7)]();return _0x592ad9?{'alias':_0x592ad9,'field':_0x5c944d(0x1e1)}:undefined;}return undefined;}function setLocalAppAlias(_0x50ee6f,_0x56c34f,_0x4aabb6){const _0x518a1b=a23_0x403b,_0x4a8d10=_0x50ee6f[_0x518a1b(0x1e9)]&&typeof _0x50ee6f[_0x518a1b(0x1e9)]===_0x518a1b(0x1d9)&&!Array[_0x518a1b(0x1cc)](_0x50ee6f[_0x518a1b(0x1e9)])?_0x50ee6f['apps']:{},_0x202686=_0x4a8d10[_0x56c34f]&&typeof _0x4a8d10[_0x56c34f]===_0x518a1b(0x1d9)&&!Array['isArray'](_0x4a8d10[_0x56c34f])?_0x4a8d10[_0x56c34f]:{};_0x202686[_0x518a1b(0x1e1)]=_0x4aabb6,_0x4a8d10[_0x56c34f]=_0x202686,_0x50ee6f[_0x518a1b(0x1e9)]=_0x4a8d10;}function deleteLocalAppAlias(_0x2377d3,_0x37483b){const _0x517737=a23_0x403b;if(!_0x2377d3[_0x517737(0x1e9)]||typeof _0x2377d3['apps']!=='object'||Array['isArray'](_0x2377d3[_0x517737(0x1e9)]))return![];const _0x204792=_0x2377d3[_0x517737(0x1e9)],_0x14a963=_0x204792[_0x37483b['alias']];if(!_0x14a963||typeof _0x14a963!==_0x517737(0x1d9)||Array[_0x517737(0x1cc)](_0x14a963))return![];if(!_0x37483b['field'])return delete _0x204792[_0x37483b[_0x517737(0x1dd)]],!![];if(!(_0x37483b['field']in _0x14a963))return![];return delete _0x14a963[_0x37483b[_0x517737(0x1e0)]],Object['keys'](_0x14a963)['length']===0x0&&delete _0x204792[_0x37483b[_0x517737(0x1dd)]],!![];}const listDef={'service':'config','command':a23_0x68ed4a(0x1b4),'description':a23_0x68ed4a(0x1b1),'risk':a23_0x68ed4a(0x1b6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x9a8f76){const _0x8a92f2=a23_0x68ed4a,{buildConfigFromFlags:_0x341b80}=await import(_0x8a92f2(0x1d2)),_0x5a2d02=_0x341b80({}),_0x58e6e4=redactCliConfigCredentials(_0x5a2d02[_0x8a92f2(0x1d1)]),_0x29f9f8=getProjectConfigPath(),_0x3ad45b=resolveWriteConfigPath(_0x8a92f2(0x1e2));if(_0x9a8f76[_0x8a92f2(0x1c4)]===_0x8a92f2(0x1ea))return{'ok':!![],'message':'#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a'+(JSON[_0x8a92f2(0x1b2)](_0x58e6e4,null,0x2)+'\x0a\x0a')+_0x8a92f2(0x1ec)+(_0x8a92f2(0x1ac)+(_0x29f9f8??_0x8a92f2(0x1b5))+'\x0a')+('\x20\x20global:\x20\x20'+_0x3ad45b)};return{'ok':!![],'data':{'effective':_0x58e6e4,'configFiles':{'project':_0x29f9f8??null,'global':_0x3ad45b}}};}},getDef={'service':'config','command':a23_0x68ed4a(0x1c3),'description':a23_0x68ed4a(0x1cf),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a23_0x68ed4a(0x1ba),'description':a23_0x68ed4a(0x1b0),'required':!![]}],'flags':[],async 'execute'(_0x1b97c2){const _0x2b1bac=a23_0x68ed4a,_0x4d3b4f=_0x1b97c2[_0x2b1bac(0x1bd)][0x0];if(!_0x4d3b4f)throw CliErrors[_0x2b1bac(0x1c2)](_0x2b1bac(0x1d5),_0x2b1bac(0x1c8)+CLI_BIN_NAME+_0x2b1bac(0x1e8));const {buildConfigFromFlags:_0x418c28}=await import('../../context.js'),{raw:_0x36c236}=_0x418c28({});if(_0x4d3b4f[_0x2b1bac(0x1d6)]('.')){const _0x3c68fa=_0x4d3b4f[_0x2b1bac(0x1de)]('.');let _0x43f126=_0x36c236;for(const _0x5573e9 of _0x3c68fa){if(_0x43f126==null||typeof _0x43f126!==_0x2b1bac(0x1d9))throw CliErrors[_0x2b1bac(0x1c2)](_0x2b1bac(0x1cb)+_0x4d3b4f);_0x43f126=_0x43f126[_0x5573e9];}if(_0x43f126===undefined)throw CliErrors[_0x2b1bac(0x1c2)](_0x2b1bac(0x1cb)+_0x4d3b4f);const _0xcfbf86=redactCliConfigValue(_0x4d3b4f,_0x43f126);return console[_0x2b1bac(0x1da)](typeof _0xcfbf86===_0x2b1bac(0x1d9)?JSON['stringify'](_0xcfbf86,null,0x2):String(_0xcfbf86)),{'ok':!![]};}const _0x3743db=_0x36c236[_0x4d3b4f];if(_0x3743db===undefined)throw CliErrors[_0x2b1bac(0x1c2)](_0x2b1bac(0x1cb)+_0x4d3b4f);const _0x414ea1=redactCliConfigValue(_0x4d3b4f,_0x3743db);return console[_0x2b1bac(0x1da)](typeof _0x414ea1==='object'?JSON[_0x2b1bac(0x1b2)](_0x414ea1,null,0x2):String(_0x414ea1)),{'ok':!![]};}},setDef={'service':a23_0x68ed4a(0x1ca),'command':a23_0x68ed4a(0x1b3),'description':a23_0x68ed4a(0x1c6),'risk':a23_0x68ed4a(0x1e5),'confirmationDescription':'Changes\x20Lovrabet\x20CLI\x20configuration.\x20Later\x20commands\x20may\x20use\x20a\x20different\x20app,\x20environment,\x20or\x20output\x20behavior.','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a23_0x68ed4a(0x1ba),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a23_0x68ed4a(0x1d3),'description':'Value\x20to\x20assign','required':!![]}],'flags':[GLOBAL_SCOPE_FLAG],async 'execute'(_0x5cb1d7){const _0x467118=a23_0x68ed4a,_0x595e2a=_0x5cb1d7[_0x467118(0x1bd)][0x0],_0xd9db07=_0x5cb1d7[_0x467118(0x1bd)][0x1];if(!_0x595e2a||_0xd9db07===undefined)throw CliErrors[_0x467118(0x1c2)]('Missing\x20key\x20or\x20value.',_0x467118(0x1c8)+CLI_BIN_NAME+'\x20config\x20set\x20<key>\x20<value>\x20[--global]');if(ENUM_KEYS[_0x595e2a]&&!ENUM_KEYS[_0x595e2a][_0x467118(0x1d6)](_0xd9db07))throw CliErrors[_0x467118(0x1c2)](_0x467118(0x1df)+_0x595e2a+_0x467118(0x1bf)+ENUM_KEYS[_0x595e2a][_0x467118(0x1aa)](',\x20'));if(isCliProtectedConfigKey(_0x595e2a))throw CliErrors[_0x467118(0x1c2)]('\x22'+_0x595e2a+_0x467118(0x1e3));if(_0x595e2a==='pageSize'){const _0x240eb6=Number(_0xd9db07);if(isNaN(_0x240eb6)||_0x240eb6<=0x0)throw CliErrors['validation'](_0x467118(0x1ab));}const _0x55f668=resolveWriteScope({'explicitGlobal':_0x5cb1d7['bool'](_0x467118(0x1e2)),'policy':'project-or-global-explicit'}),_0x147c88=toScopeFlags(_0x55f668),_0x4ab67a=readScopedConfig(_0x147c88),_0x2c485a=parseAliasAppcodeSetKey(_0x595e2a);if(!_0x2c485a&&!isTopLevelConfigKey(_0x595e2a))throw CliErrors[_0x467118(0x1c2)](_0x467118(0x1ee)+_0x595e2a+_0x467118(0x1af),_0x467118(0x1c9)+getTopLevelConfigKeySummary()+';\x20apps.<alias>.appcode');if(_0x2c485a)setLocalAppAlias(_0x4ab67a,_0x2c485a,_0xd9db07);else{if(_0x595e2a===_0x467118(0x1dc)){const _0x526fe1=normalizeLocale(_0xd9db07);if(!_0x526fe1)throw CliErrors[_0x467118(0x1c2)](_0x467118(0x1cd),'Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US');_0x4ab67a[_0x467118(0x1dc)]=_0x526fe1;}else _0x4ab67a[_0x595e2a]=_0x595e2a===_0x467118(0x1c5)?Number(_0xd9db07):DOMAIN_CONFIG_FIELDS['includes'](_0x595e2a)?normalizeDomainOrigin(_0x595e2a,_0xd9db07):_0xd9db07;}const _0x96d03f=_0x595e2a===_0x467118(0x1bc)?maskCliAccessKey(_0xd9db07):!_0x2c485a&&_0x595e2a===_0x467118(0x1dc)?String(_0x4ab67a[_0x467118(0x1dc)]):_0xd9db07;return console[_0x467118(0x1da)](_0x467118(0x1ed)+_0x595e2a+_0x467118(0x1bb)+_0x96d03f+'\x22'+(_0x55f668===_0x467118(0x1e2)?_0x467118(0x1db):'')),writeScopedConfig(_0x4ab67a,_0x147c88),{'ok':!![]};}},deleteDef={'service':a23_0x68ed4a(0x1ca),'command':a23_0x68ed4a(0x1e7),'description':a23_0x68ed4a(0x1c1),'risk':'write','confirmationDescription':a23_0x68ed4a(0x1d4),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_SCOPE_FLAG],async 'execute'(_0x26a7db){const _0xeeaae7=a23_0x68ed4a,_0x5ddb2a=_0x26a7db[_0xeeaae7(0x1bd)][0x0];if(!_0x5ddb2a)throw CliErrors[_0xeeaae7(0x1c2)](_0xeeaae7(0x1d5),'Usage:\x20'+CLI_BIN_NAME+_0xeeaae7(0x1eb));if(isCliProtectedConfigKey(_0x5ddb2a))throw CliErrors['validation']('\x22'+_0x5ddb2a+_0xeeaae7(0x1e3));const _0x592e37=resolveWriteScope({'explicitGlobal':_0x26a7db['bool'](_0xeeaae7(0x1e2)),'policy':_0xeeaae7(0x1d8)}),_0x237826=toScopeFlags(_0x592e37),_0x3b06fb=readScopedConfig(_0x237826),_0x2f0513=parseAliasDeleteKey(_0x5ddb2a);if(_0x2f0513){if(!deleteLocalAppAlias(_0x3b06fb,_0x2f0513))return console[_0xeeaae7(0x1da)](_0xeeaae7(0x1b9)+_0x5ddb2a+(_0x592e37===_0xeeaae7(0x1e2)?_0xeeaae7(0x1db):'')),{'ok':!![],'data':{'key':_0x5ddb2a,'scope':_0x592e37,'changed':![]}};return console[_0xeeaae7(0x1da)](_0xeeaae7(0x1ce)+_0x5ddb2a+'`'+(_0x592e37==='global'?_0xeeaae7(0x1db):'')),writeScopedConfig(_0x3b06fb,_0x237826),{'ok':!![],'data':{'key':_0x5ddb2a,'scope':_0x592e37,'changed':!![]}};}if(_0x3b06fb[_0x5ddb2a]===undefined)return console[_0xeeaae7(0x1da)](_0xeeaae7(0x1b9)+_0x5ddb2a+(_0x592e37===_0xeeaae7(0x1e2)?_0xeeaae7(0x1db):'')),{'ok':!![],'data':{'key':_0x5ddb2a,'scope':_0x592e37,'changed':![]}};return delete _0x3b06fb[_0x5ddb2a],console['log'](_0xeeaae7(0x1ce)+_0x5ddb2a+'`'+(_0x592e37===_0xeeaae7(0x1e2)?_0xeeaae7(0x1db):'')),writeScopedConfig(_0x3b06fb,_0x237826),{'ok':!![],'data':{'key':_0x5ddb2a,'scope':_0x592e37,'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_0x57da43=a24_0x24a2;(function(_0x3f726b,_0x188a7f){const _0x5d80a7=a24_0x24a2,_0x8b8b42=_0x3f726b();while(!![]){try{const _0x345207=-parseInt(_0x5d80a7(0x84))/0x1+parseInt(_0x5d80a7(0x81))/0x2+-parseInt(_0x5d80a7(0x7a))/0x3*(parseInt(_0x5d80a7(0x72))/0x4)+-parseInt(_0x5d80a7(0x73))/0x5*(-parseInt(_0x5d80a7(0x83))/0x6)+parseInt(_0x5d80a7(0x6c))/0x7*(-parseInt(_0x5d80a7(0x78))/0x8)+parseInt(_0x5d80a7(0x8a))/0x9+parseInt(_0x5d80a7(0x74))/0xa*(-parseInt(_0x5d80a7(0x6d))/0xb);if(_0x345207===_0x188a7f)break;else _0x8b8b42['push'](_0x8b8b42['shift']());}catch(_0x3b2f0b){_0x8b8b42['push'](_0x8b8b42['shift']());}}}(a24_0x5f3d,0x8d51b));import{select}from'@inquirer/prompts';import{CliErrors}from'../../errors.js';import{readScopedConfig,writeScopedConfig}from'../../commands/config/shared.js';import{DOMAIN_CONFIG_FIELDS,LEGACY_DOMAIN_CONFIG_FIELDS,resolveDomainConfigInput}from'../../config/domain-config.js';import{ENTERPRISE_ROUTING_KIND,ENTERPRISE_ROUTING_PROTOCOL}from'../../generated/routing-contract.js';import{DEFAULT_LOVRABET_REGION,ENABLED_LOVRABET_REGION_VALUES,isEnabledLovrabetRegion}from'../../constant/region.js';import{OFFICIAL_ROUTING_PROFILES}from'../../generated/official-routing.js';const domainFlags=[{'name':'domain-config','type':a24_0x57da43(0x86),'description':a24_0x57da43(0x88)},{'name':a24_0x57da43(0x7f),'type':a24_0x57da43(0x86),'description':a24_0x57da43(0x75)},{'name':a24_0x57da43(0x66),'type':a24_0x57da43(0x86),'description':a24_0x57da43(0x82)},{'name':a24_0x57da43(0x6b),'type':a24_0x57da43(0x86),'description':a24_0x57da43(0x7b)},{'name':a24_0x57da43(0x8b),'type':a24_0x57da43(0x86),'description':a24_0x57da43(0x89)},{'name':a24_0x57da43(0x65),'type':'string','description':'Custom\x20KB\x20Service\x20HTTPS\x20origin'}];export const configInitFlags=[{'name':a24_0x57da43(0x90),'type':a24_0x57da43(0x86),'description':'Official\x20Lovrabet\x20region:\x20'+ENABLED_LOVRABET_REGION_VALUES[a24_0x57da43(0x7c)](',\x20'),'enum':[...ENABLED_LOVRABET_REGION_VALUES]},...domainFlags];async function resolveRegion(_0xceab2f){const _0x1f6952=a24_0x57da43,_0xe95e49=_0xceab2f['str'](_0x1f6952(0x90));if(_0xe95e49){if(!isEnabledLovrabetRegion(_0xe95e49))throw CliErrors[_0x1f6952(0x8e)](_0x1f6952(0x70)+_0xe95e49+_0x1f6952(0x7e),_0x1f6952(0x68)+ENABLED_LOVRABET_REGION_VALUES[_0x1f6952(0x7c)](',\x20'));return _0xe95e49;}if(_0xceab2f[_0x1f6952(0x91)])return DEFAULT_LOVRABET_REGION;try{return await select({'message':'Select\x20Lovrabet\x20region','default':DEFAULT_LOVRABET_REGION,'choices':ENABLED_LOVRABET_REGION_VALUES[_0x1f6952(0x85)](_0x10230b=>({'name':OFFICIAL_ROUTING_PROFILES[_0x10230b]['label']+'\x20('+_0x10230b+')','value':_0x10230b}))});}catch(_0x8a42f1){if(_0x8a42f1?.['name']==='ExitPromptError')throw CliErrors[_0x1f6952(0x8c)]();throw _0x8a42f1;}}export async function executeConfigInit(_0x54fa6b){const _0x56eb57=a24_0x57da43,_0x22ad76=resolveDomainConfigInput(_0x54fa6b),_0x2110ed=_0x22ad76[_0x56eb57(0x76)],_0x7bf1d5=Object[_0x56eb57(0x6a)](_0x2110ed)[_0x56eb57(0x80)]>0x0;if(_0x7bf1d5&&_0x54fa6b['str'](_0x56eb57(0x90)))throw CliErrors[_0x56eb57(0x8e)](_0x56eb57(0x6e));const _0x3cf192={'global':!![]},_0x4eeaa7=readScopedConfig(_0x3cf192);for(const _0x4f23a3 of DOMAIN_CONFIG_FIELDS)delete _0x4eeaa7[_0x4f23a3];for(const _0x1fd23c of LEGACY_DOMAIN_CONFIG_FIELDS)delete _0x4eeaa7[_0x1fd23c];delete _0x4eeaa7[_0x56eb57(0x67)];let _0x5bc3c1=null;if(_0x7bf1d5)delete _0x4eeaa7[_0x56eb57(0x90)],_0x22ad76['mode']==='enterprise-v1'?_0x4eeaa7[_0x56eb57(0x67)]={'protocol':ENTERPRISE_ROUTING_PROTOCOL,'kind':ENTERPRISE_ROUTING_KIND,'domains':_0x22ad76[_0x56eb57(0x6f)]}:Object['assign'](_0x4eeaa7,_0x2110ed);else{_0x5bc3c1=await resolveRegion(_0x54fa6b);if(_0x5bc3c1===DEFAULT_LOVRABET_REGION)delete _0x4eeaa7[_0x56eb57(0x90)];else _0x4eeaa7[_0x56eb57(0x90)]=_0x5bc3c1;}return writeScopedConfig(_0x4eeaa7,_0x3cf192),{'ok':!![],'message':_0x7bf1d5?_0x56eb57(0x7d)+Object[_0x56eb57(0x6a)](_0x22ad76[_0x56eb57(0x71)]===_0x56eb57(0x87)?_0x22ad76[_0x56eb57(0x6f)]:_0x2110ed)[_0x56eb57(0x7c)](',\x20')+'.':'Lovrabet\x20connection\x20configured\x20for\x20region:\x20'+_0x5bc3c1+'.','data':{'mode':_0x7bf1d5?_0x56eb57(0x77):_0x56eb57(0x8d),'protocol':_0x22ad76['mode']==='enterprise-v1'?ENTERPRISE_ROUTING_PROTOCOL:undefined,'region':_0x5bc3c1,'domains':_0x2110ed}};}function a24_0x24a2(_0x5a501c,_0x3e025e){_0x5a501c=_0x5a501c-0x65;const _0x5f3d5c=a24_0x5f3d();let _0x24a2ab=_0x5f3d5c[_0x5a501c];return _0x24a2ab;}function a24_0x5f3d(){const _0x448d9c=['enterprise-v1','Independent-deployment\x20Domain\x20JSON\x20file','Custom\x20SkillHub\x20HTTPS\x20origin','8478846jUwOey','skill-domain','cancelled','official','validation','Initialize\x20the\x20global\x20Lovrabet\x20region\x20or\x20independent-deployment\x20Domains','region','nonInteractive','kb-service-domain','api-domain','routing','Available\x20regions:\x20','config','keys','runtime-domain','126TajcuW','24893CZExfu','Choose\x20either\x20an\x20official\x20region\x20or\x20independent-deployment\x20Domains,\x20not\x20both.','manifestDomains','Region\x20\x22','mode','21384qYTPgZ','45XcOoJX','2170ESoaAp','Custom\x20User\x20HTTPS\x20origin','domains','independent','170784JZeksT','init','162BUuGXd','Custom\x20Runtime\x20HTTPS\x20origin','join','Lovrabet\x20connection\x20configured\x20for\x20independent\x20deployment.\x20Domains:\x20','\x22\x20is\x20not\x20currently\x20available.','user-domain','length','1544596WMQQhP','Custom\x20platform\x20API\x20HTTPS\x20origin','344616qQLHls','488454sRpoPH','map','string'];a24_0x5f3d=function(){return _0x448d9c;};return a24_0x5f3d();}export const configInitDefinition={'service':a24_0x57da43(0x69),'command':a24_0x57da43(0x79),'description':a24_0x57da43(0x8f),'risk':'write','confirmationDescription':'Updates\x20the\x20global\x20Lovrabet\x20region\x20or\x20independent-deployment\x20Domain\x20configuration.\x20AccessKey,\x20output\x20format,\x20and\x20app\x20bindings\x20stay\x20unchanged.','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':configInitFlags,'execute':executeConfigInit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a25_0x1f08(_0x54f881,_0x86ccdc){_0x54f881=_0x54f881-0x76;var _0x119b90=a25_0x119b();var _0x1f08d4=_0x119b90[_0x54f881];return _0x1f08d4;}(function(_0x40fb30,_0x55b0d6){var _0x4b4ce8=a25_0x1f08,_0xa96e73=_0x40fb30();while(!![]){try{var _0x1b9670=-parseInt(_0x4b4ce8(0x7d))/0x1+-parseInt(_0x4b4ce8(0x7a))/0x2+-parseInt(_0x4b4ce8(0x78))/0x3*(-parseInt(_0x4b4ce8(0x77))/0x4)+parseInt(_0x4b4ce8(0x79))/0x5+-parseInt(_0x4b4ce8(0x76))/0x6+parseInt(_0x4b4ce8(0x7e))/0x7+-parseInt(_0x4b4ce8(0x7b))/0x8*(-parseInt(_0x4b4ce8(0x7c))/0x9);if(_0x1b9670===_0x55b0d6)break;else _0xa96e73['push'](_0xa96e73['shift']());}catch(_0x1d2938){_0xa96e73['push'](_0xa96e73['shift']());}}}(a25_0x119b,0x5c194));function a25_0x119b(){var _0x5b1429=['204984ohlhrx','127772jgZAfK','12JTVORn','1903840JIhixW','1487810FkBVsF','24wJJxwd','1479375hXIxPd','239239UYOupx','2750153UGKVWl'];a25_0x119b=function(){return _0x5b1429;};return a25_0x119b();}import{CLI_BIN_NAME}from'../../constant/cli.js';export{CLI_BIN_NAME};export{readScopedConfig,writeScopedConfig}from'../../context.js';export{resolveConfigScope as resolveWriteScope,TOP_LEVEL_CONFIG_KEYS as TOP_LEVEL_KEYS,CONFIG_ENUM_VALUES as ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isCliProtectedConfigKey,isTopLevelConfigKey,normalizeLocale,toScopeFlags}from'../../commands/common/config-policy.js';
|
|
@@ -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
|
+
function a26_0x5a49(_0x15f06f,_0x2e402a){_0x15f06f=_0x15f06f-0xb3;const _0x4624d6=a26_0x4624();let _0x5a49bf=_0x4624d6[_0x15f06f];return _0x5a49bf;}const a26_0x9af0c2=a26_0x5a49;(function(_0x3b7a34,_0xc7c2b2){const _0x5ca88a=a26_0x5a49,_0x386419=_0x3b7a34();while(!![]){try{const _0x1d175c=parseInt(_0x5ca88a(0xdf))/0x1+-parseInt(_0x5ca88a(0xd0))/0x2*(parseInt(_0x5ca88a(0x11a))/0x3)+parseInt(_0x5ca88a(0xe1))/0x4*(parseInt(_0x5ca88a(0x118))/0x5)+parseInt(_0x5ca88a(0xe2))/0x6+-parseInt(_0x5ca88a(0xf8))/0x7*(parseInt(_0x5ca88a(0x109))/0x8)+parseInt(_0x5ca88a(0xbd))/0x9*(parseInt(_0x5ca88a(0xb4))/0xa)+-parseInt(_0x5ca88a(0xce))/0xb;if(_0x1d175c===_0xc7c2b2)break;else _0x386419['push'](_0x386419['shift']());}catch(_0x45ad70){_0x386419['push'](_0x386419['shift']());}}}(a26_0x4624,0x2199f));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';function a26_0x4624(){const _0x5751c5=['\x20\x20\x20\x20choose\x20the\x20capability\x20before\x20execution;\x20never\x20fall\x20back\x20at\x20runtime','\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}','delete','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','batchCreate','\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}','data','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','operation','\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','filter','14aMjDJY','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','\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\x20Filtering\x20and\x20pagination\x20are\x20controlled\x20only\x20via\x20one\x20JSON\x20object\x20in\x20--params.','\x20\x20LOGICAL\x20COMBINATORS','\x20\x20\x20\x20and\x20increment\x20only\x20currentPage.\x20Use\x20a\x20stable\x20unique\x20orderBy\x20field\x20to\x20avoid\x20duplicates\x20or\x20gaps.','data\x20','length','\x20\x20PAGINATION','Deletes\x20business\x20records\x20from\x20the\x20current\x20app\x20dataset.\x20This\x20may\x20not\x20be\x20recoverable.','\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.','batch','\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}]','POST','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','\x20\x20\x20\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}','\x20\x20DATASET\x20BOUNDARY','56136jlpByw','aggregate','\x20\x20\x20\x20orderBy\x20may\x20reference\x20aggregate\x20output\x20aliases','\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}','Get\x20a\x20single\x20record\x20by\x20ID','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','\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]}}','params','now','read','\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}','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\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}}','risk','\x20\x20\x20\x20aggregate\x20supports\x20a\x20single\x20DB_TABLE\x20dataset\x20only','35lSVbch','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','573jRQdFs','high-risk-write','451830zmtHHU','\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}}','getOne','\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}}','body','create','\x20\x20\x20\x20Page\x20numbers\x20start\x20at\x201.\x20To\x20fetch\x20the\x20next\x20page,\x20keep\x20where/select/orderBy/pageSize\x20unchanged','\x20\x20\x20\x20Verify\x20the\x20response\x20paging.currentPage/pageSize\x20and\x20that\x20tableData\x20satisfies\x20where\x20before\x20drawing\x20conclusions.','update','9fiKzsy','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','Writes\x20one\x20new\x20business\x20record\x20to\x20the\x20current\x20app\x20dataset.\x20It\x20is\x20saved\x20immediately\x20after\x20confirmation.','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','write','\x20completed\x20in\x20','Writes\x20multiple\x20new\x20business\x20records\x20to\x20the\x20current\x20app\x20dataset.\x20They\x20are\x20saved\x20immediately\x20after\x20confirmation.','\x20on\x20dataset\x20','\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}}]}','helpExtra','\x20\x20\x20\x20JOIN\x20and\x20cross-table\x20aggregation\x20require\x20an\x20existing\x20trusted\x20Custom\x20SQL','\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\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','join','3066426iiQQFB','code','396dFegwK','description','\x20\x20PARAMS\x20STRUCTURE','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','command','Update\x20an\x20existing\x20data\x20record','str','confirmationDescription','/api/{appCode}/','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','\x20\x20\x20\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\x20EXAMPLES','\x20\x20WHERE\x20OPERATORS','\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}]','155966MzqJyB','\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}}','66936tLEikD','899772PuooPl','\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}}','Delete\x20data\x20records\x20(non-interactive\x20mode\x20requires\x20--yes)','Filter\x20dataset\x20records\x20with\x20query\x20conditions','dryRun','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','\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$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}}','paramsHint'];a26_0x4624=function(){return _0x5751c5;};return a26_0x4624();}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_0x9af0c2(0xf7),'operation':'filter','risk':a26_0x9af0c2(0x112),'paramsRequired':![],'description':a26_0x9af0c2(0xe5),'paramsHint':a26_0x9af0c2(0xf9)+a26_0x9af0c2(0xd9),'helpExtra':[a26_0x9af0c2(0xdd),a26_0x9af0c2(0xe9),a26_0x9af0c2(0xe3),a26_0x9af0c2(0xda),a26_0x9af0c2(0xe0),'\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}}',a26_0x9af0c2(0xb5),a26_0x9af0c2(0x10f),'\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','\x20\x20\x20\x20$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_0x9af0c2(0x115),'',a26_0x9af0c2(0xfc),a26_0x9af0c2(0xc8),'\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}}]}','','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)',a26_0x9af0c2(0x119),a26_0x9af0c2(0xee),a26_0x9af0c2(0xde),'\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)',a26_0x9af0c2(0xef),'',a26_0x9af0c2(0x100),a26_0x9af0c2(0xfb),a26_0x9af0c2(0x102),a26_0x9af0c2(0xba),a26_0x9af0c2(0xfd),a26_0x9af0c2(0xf6),a26_0x9af0c2(0xdb),a26_0x9af0c2(0xbb)][a26_0x9af0c2(0xcd)]('\x0a')},{'command':a26_0x9af0c2(0xb6),'operation':a26_0x9af0c2(0xb6),'risk':'read','paramsRequired':!![],'description':a26_0x9af0c2(0x10d),'paramsHint':a26_0x9af0c2(0xc1)},{'command':a26_0x9af0c2(0xb9),'operation':a26_0x9af0c2(0xb9),'risk':'write','paramsRequired':!![],'description':'Create\x20one\x20record\x20in\x20the\x20dataset','confirmationDescription':a26_0x9af0c2(0xc0),'paramsHint':a26_0x9af0c2(0xbe)},{'command':'batchCreate','operation':a26_0x9af0c2(0xf0),'risk':a26_0x9af0c2(0xc4),'paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20the\x20dataset\x20in\x20one\x20request','confirmationDescription':a26_0x9af0c2(0xc6),'paramsHint':a26_0x9af0c2(0xd3)},{'command':a26_0x9af0c2(0xbc),'operation':'update','risk':a26_0x9af0c2(0xc4),'paramsRequired':!![],'description':a26_0x9af0c2(0xd5),'confirmationDescription':'Changes\x20an\x20existing\x20business\x20record\x20in\x20the\x20current\x20app\x20dataset.\x20The\x20new\x20values\x20are\x20saved\x20immediately\x20after\x20confirmation.','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_0x9af0c2(0xed),'operation':'delete','risk':a26_0x9af0c2(0xb3),'paramsRequired':!![],'description':a26_0x9af0c2(0xe4),'confirmationDescription':a26_0x9af0c2(0x101),'paramsHint':a26_0x9af0c2(0xc1)},{'command':a26_0x9af0c2(0x10a),'operation':a26_0x9af0c2(0x10a),'risk':'read','paramsRequired':![],'description':a26_0x9af0c2(0xc2),'paramsHint':a26_0x9af0c2(0xe7)+a26_0x9af0c2(0x114),'helpExtra':['\x20\x20AGGREGATE\x20TYPES',a26_0x9af0c2(0x10c),a26_0x9af0c2(0x107),a26_0x9af0c2(0xec),a26_0x9af0c2(0x106),a26_0x9af0c2(0xf1),a26_0x9af0c2(0xbf),a26_0x9af0c2(0x113),'',a26_0x9af0c2(0xd2),a26_0x9af0c2(0xfa),a26_0x9af0c2(0xf3),a26_0x9af0c2(0xc3),a26_0x9af0c2(0xf4),a26_0x9af0c2(0xb7),a26_0x9af0c2(0x104),'','\x20\x20AGGREGATE\x20ALIAS\x20BOUNDARY','\x20\x20\x20\x20aggregate[].alias\x20defines\x20the\x20output\x20field\x20name\x20only','\x20\x20\x20\x20select/where/having/groupBy\x20must\x20use\x20real\x20dataset\x20fields',a26_0x9af0c2(0x10b),'',a26_0x9af0c2(0x108),a26_0x9af0c2(0x117),'\x20\x20\x20\x20METADATA\x20datasets\x20do\x20not\x20support\x20aggregate\x20or\x20Custom\x20SQL',a26_0x9af0c2(0xca),a26_0x9af0c2(0xeb),'',a26_0x9af0c2(0xdc),'\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status',a26_0x9af0c2(0xcb),'',a26_0x9af0c2(0x10e),a26_0x9af0c2(0xcc),'',a26_0x9af0c2(0xe8)][a26_0x9af0c2(0xcd)]('\x0a')}];function makeDataCommand(_0x262193){const _0x56522a=a26_0x9af0c2,_0x1632a6='data\x20'+_0x262193[_0x56522a(0xd4)],_0x4acb29={'service':_0x56522a(0xf2),'command':_0x262193[_0x56522a(0xd4)],'description':_0x262193[_0x56522a(0xd1)],'risk':_0x262193[_0x56522a(0x116)],..._0x262193['confirmationDescription']?{'confirmationDescription':_0x262193[_0x56522a(0xd7)]}:{},'helpExtra':_0x262193[_0x56522a(0xc9)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x262193[_0x56522a(0xea)]}],'validate':async _0x2a9403=>{const _0x19c730=_0x56522a;_0x262193['paramsRequired']&&requireAnyOf(_0x2a9403,['params'],_0x1632a6),_0x262193['operation']==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x2a9403['str'](_0x19c730(0x110)))),_0x262193['operation']===_0x19c730(0xbc)&&parseUpdateIdsFromParams(parseJsonParams(_0x2a9403[_0x19c730(0xd6)](_0x19c730(0x110)))??{});},async 'execute'(_0x474a3c){const _0x50c06a=_0x56522a,_0xe2bfcd=_0x474a3c[_0x50c06a(0xd6)]('code'),_0x2c34d1=_0x262193[_0x50c06a(0xf5)]===_0x50c06a(0xf0)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x474a3c[_0x50c06a(0xd6)]('params'))):parseJsonParams(_0x474a3c[_0x50c06a(0xd6)](_0x50c06a(0x110)))??{},_0xea3817=_0x262193['operation']===_0x50c06a(0xbc)?parseUpdateIdsFromParams(_0x2c34d1):undefined,_0xb06c72=_0xea3817?normalizeUpdateParamsForRuntime(_0x2c34d1,_0xea3817):_0x2c34d1,_0x3426f3=Date[_0x50c06a(0x111)](),_0x57034b=await executeData(_0xe2bfcd,_0x262193['operation'],_0xb06c72),_0x4ff8e0=Date[_0x50c06a(0x111)]()-_0x3426f3,_0x4723ce=_0xea3817&&_0xea3817[_0x50c06a(0xff)]>0x1?buildBatchUpdateResult(_0xea3817,_0x57034b):_0x57034b;return{'ok':!![],'data':{'result':_0x4723ce,'elapsed':_0x4ff8e0},'message':_0x50c06a(0xfe)+_0x262193[_0x50c06a(0xd4)]+_0x50c06a(0xc5)+_0x4ff8e0+'ms'};}};return _0x262193['risk']!==_0x56522a(0x112)&&(_0x4acb29[_0x56522a(0xe6)]=async _0x5e829d=>{const _0x133abc=_0x56522a,_0x2edec5=_0x5e829d[_0x133abc(0xd6)](_0x133abc(0xcf)),_0x49b880=_0x262193[_0x133abc(0xf5)]===_0x133abc(0xf0)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x5e829d['str'](_0x133abc(0x110)))):parseJsonParams(_0x5e829d[_0x133abc(0xd6)](_0x133abc(0x110)))??{};let _0x487916=_0x49b880;if(_0x262193[_0x133abc(0xf5)]===_0x133abc(0xbc)){const _0x260e59=parseUpdateIdsFromParams(_0x49b880);_0x487916=normalizeUpdateParamsForRuntime(_0x49b880,_0x260e59);}return dryRun(_0x133abc(0x105),_0x133abc(0xd8)+_0x2edec5+'/'+_0x262193[_0x133abc(0xf5)])[_0x133abc(0xb8)](_0x487916)[_0x133abc(0xd1)]('Preview:\x20data\x20'+_0x262193[_0x133abc(0xd4)]+_0x133abc(0xc7)+_0x2edec5)['build']();}),_0x4acb29;}export const dataDefinitions=specs['map'](makeDataCommand);function buildBatchUpdateResult(_0x12f88e,_0x5a81bd){const _0x556e8a=a26_0x9af0c2;return{'operation':_0x556e8a(0xbc),'mode':_0x556e8a(0x103),'ids':_0x12f88e,'total':_0x12f88e[_0x556e8a(0xff)],'result':_0x5a81bd};}
|