@lovrabet/lovrabet-cli 2.3.8-beta.1 → 2.3.8-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/import-excel.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.d.ts +32 -6
- 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.d.ts +2 -4
- 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.js +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.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.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.d.ts +20 -340
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-management-client.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/sdk-client.d.ts +7 -10
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/access-error.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.js +1 -1
- 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/services/dataset-import/auto-id-runner.js +1 -1
- package/lib/services/dataset-import/excel-reader.js +1 -1
- package/lib/services/dataset-import/image-bytes.js +1 -1
- package/lib/services/dataset-import/image-ooxml.js +1 -1
- package/lib/services/dataset-import/image-runner.js +1 -1
- package/lib/services/dataset-import/metadata.js +1 -1
- package/lib/services/dataset-import/preview.js +1 -1
- package/lib/services/dataset-import/runner.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/access-key-redaction.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/positive-safe-integer.js +1 -1
- package/lib/utils/redaction.js +1 -1
- package/lib/utils/runtime-user-id.d.ts +2 -0
- package/lib/utils/runtime-user-id.js +1 -0
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +2 -2
- package/skills/lovrabet/SKILL.md +1 -1
- package/skills/lovrabet/guides/role-and-permission-workflow.md +3 -2
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const a13_0x366447=a13_0x55c2;(function(_0x5a6c1e,_0x55dca9){const _0x9ebfa6=a13_0x55c2,_0x3c5022=_0x5a6c1e();while(!![]){try{const _0x54e084=-parseInt(_0x9ebfa6(0x147))/0x1*(parseInt(_0x9ebfa6(0x135))/0x2)+-parseInt(_0x9ebfa6(0x118))/0x3+-parseInt(_0x9ebfa6(0x10d))/0x4*(-parseInt(_0x9ebfa6(0x13e))/0x5)+-parseInt(_0x9ebfa6(0x136))/0x6*(parseInt(_0x9ebfa6(0x109))/0x7)+parseInt(_0x9ebfa6(0x15f))/0x8*(parseInt(_0x9ebfa6(0x116))/0x9)+parseInt(_0x9ebfa6(0x12d))/0xa*(parseInt(_0x9ebfa6(0x12f))/0xb)+parseInt(_0x9ebfa6(0x157))/0xc;if(_0x54e084===_0x55dca9)break;else _0x3c5022['push'](_0x3c5022['shift']());}catch(_0x263c47){_0x3c5022['push'](_0x3c5022['shift']());}}}(a13_0x42bc,0x2cf78));import{readScopedConfig,writeScopedConfig}from'../../context.js';function a13_0x42bc(){const _0x18ead1=['Write\x20to\x20global\x20config\x20(default)','info','692540OQJEWn','daily','development','isTTY','code','string','auth','global','bool','1467XedpKs','\x20auth\x20login\x20--access-key\x20<ak_xxx>','545568mscpNs','stdout','validation','accessKey','boolean','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.','\x20doctor','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.','access_key','\x20auth\x20status','AccessKey\x20cleared\x20from\x20','=ak_xxx','AccessKey\x20(ak_xxx...)','\x20(via\x20','Save\x20the\x20AccessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20the\x20project\x20file)','No\x20AccessKey\x20found\x20in\x20','Use\x20`','write','\x20\x20export\x20','Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','67290cNCptj','global-default','11HWrSbc','env','accessKeyCreatePath','production','userCenterDisplayName','Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','2806OYonOw','609330tUTlVa','test','\x20config.','status','str','\x20Verify:\x20','envName','nonInteractive','10juRpPa','Clear\x20the\x20AccessKey\x20from\x20config','\x20env\x20var','yes','check','global\x20config','trim','\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`','ACCESS_KEY','72Ixtjxc','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','login','success','project','Exit\x20non-zero\x20when\x20no\x20AccessKey\x20is\x20configured','Auth\x20mode:\x20','Option\x20B:\x20apps\x20config\x20(','push','`auth\x20login`\x20does\x20not\x20support\x20--yes.','Missing\x20accessKey.','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','\x20config.\x20Nothing\x20to\x20clear.','If\x20command\x20execution\x20still\x20fails,\x20run:\x20','expired','AccessKey:\x20','2583432rZxpzf','AccessKey\x20saved\x20to\x20','Shorthand\x20for\x20--access-key','join','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','Tip:\x20you\x20can\x20also\x20run:','stdin','ClientAk','16JvTpnf','newConfigFileName','read','access-key','Status:\x20valid','Show\x20current\x20authentication\x20status','\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','7nXaQnX','logout'];a13_0x42bc=function(){return _0x18ead1;};return a13_0x42bc();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvName}from'../../constant/product.js';import{AUTH_MODE}from'../../constant/auth-mode.js';import{normalizeEnv,isDaily,isDev}from'../../constant/env.js';import{USER_ACCESS_KEY_CREATE_URL}from'../../constant/url.js';import{CliErrors}from'../../errors.js';import{promptAccessKey,isAbortPrompt}from'../../commands/auth/prompt.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{getLoginUserInfo}from'../../core/api-client.js';import{getUserDomain}from'../../constant/domain.js';import{authDeviceDefinition,readStoredDeviceCode,deleteStoredDeviceCode,fetchDeviceToken,isStoredDeviceCodeExpired}from'../../commands/auth/device.js';import{maskCliAccessKey}from'../../utils/access-key-redaction.js';const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/;function showAccessKeyCreateHint(_0x32f6a2=USER_ACCESS_KEY_CREATE_URL){const _0x650d2c=a13_0x55c2;writeCliSideChannelLine(_0x650d2c(0x152)+PRODUCT_CONFIG[_0x650d2c(0x133)]+':'),writeCliSideChannelLine('\x0a'+_0x32f6a2+'\x0a'),writeCliSideChannelLine(_0x650d2c(0x15c)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x650d2c(0x117));}function buildAccessKeySetupGuide(_0x23eb89=USER_ACCESS_KEY_CREATE_URL){const _0x23b250=a13_0x55c2;return[_0x23b250(0x152)+PRODUCT_CONFIG['userCenterDisplayName']+':',_0x23eb89,'Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20'+CLI_BIN_NAME+_0x23b250(0x165)][_0x23b250(0x15a)]('\x0a');}function canPromptForAccessKey(_0x544420){const _0x592891=a13_0x55c2;return!_0x544420['nonInteractive']&&process[_0x592891(0x15d)][_0x592891(0x110)]!==![]&&process[_0x592891(0x119)]['isTTY']!==![];}function resolveAuthScopeFlags(_0x1d1fd3){const _0x4ed980=a13_0x55c2;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x1d1fd3[_0x4ed980(0x115)]('global'),'explicitProject':_0x1d1fd3['bool'](_0x4ed980(0x14b)),'policy':_0x4ed980(0x12e)}));}async function resolveAuthWriteInput(_0x4b40a8){const _0x111121=a13_0x55c2;let _0x5669c6=(_0x4b40a8[_0x111121(0x13a)](_0x111121(0x162))||_0x4b40a8[_0x111121(0x13a)]('ak')||'')[_0x111121(0x144)]();const _0x531ca1=(_0x4b40a8[_0x111121(0x13a)]('env')||'')[_0x111121(0x144)](),_0x18aac4=''+getUserDomain()+PRODUCT_CONFIG[_0x111121(0x131)];if(!_0x5669c6&&canPromptForAccessKey(_0x4b40a8))try{showAccessKeyCreateHint(_0x18aac4),_0x5669c6=await promptAccessKey('');}catch(_0x59e7ba){if(isAbortPrompt(_0x59e7ba))throw CliErrors['cancelled']();throw _0x59e7ba;}if(!_0x5669c6)throw CliErrors[_0x111121(0x11a)](_0x111121(0x151),buildAccessKeySetupGuide(_0x18aac4));if(!ACCESS_KEY_PATTERN[_0x111121(0x137)](_0x5669c6))throw CliErrors['validation']('Invalid\x20accessKey\x20format.','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars');if(!_0x531ca1)return{'accessKey':_0x5669c6};const _0x5e802e=normalizeEnv(_0x531ca1);return{'accessKey':_0x5669c6,'env':isDaily(_0x5e802e)?_0x111121(0x10e):isDev(_0x5e802e)?_0x111121(0x10f):_0x111121(0x132)};}function a13_0x55c2(_0xf1a95c,_0x2253f3){_0xf1a95c=_0xf1a95c-0x109;const _0x42bc31=a13_0x42bc();let _0x55c20a=_0x42bc31[_0xf1a95c];return _0x55c20a;}export const authDefinitions=[{'service':a13_0x366447(0x113),'command':a13_0x366447(0x149),'description':a13_0x366447(0x127),'risk':'write','confirmationDescription':a13_0x366447(0x120),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a13_0x366447(0x162),'type':a13_0x366447(0x112),'description':a13_0x366447(0x125)},{'name':'ak','type':a13_0x366447(0x112),'description':a13_0x366447(0x159)},{'name':a13_0x366447(0x114),'type':a13_0x366447(0x11c),'description':a13_0x366447(0x10b),'default':!![]},{'name':a13_0x366447(0x14b),'type':'boolean','description':a13_0x366447(0x15b),'default':![]}],async 'execute'(_0x119b90){const _0x548d6d=a13_0x366447;if(_0x119b90['bool'](_0x548d6d(0x141)))throw CliErrors['validation'](_0x548d6d(0x150),_0x548d6d(0x129)+CLI_BIN_NAME+_0x548d6d(0x145)+CLI_BIN_NAME+_0x548d6d(0x11e));const _0x5afa1b=(_0x119b90['str'](_0x548d6d(0x162))||_0x119b90['str']('ak')||'')[_0x548d6d(0x144)]();if(!_0x5afa1b&&_0x119b90[_0x548d6d(0x13d)])return{'ok':!![],'message':buildAccessKeySetupGuide(''+getUserDomain()+PRODUCT_CONFIG[_0x548d6d(0x131)])};const _0x33ab53=await resolveAuthWriteInput(_0x119b90),_0x5ad8cc=resolveAuthScopeFlags(_0x119b90),_0x1efd0f=readScopedConfig(_0x5ad8cc);_0x1efd0f['accessKey']=_0x33ab53[_0x548d6d(0x11b)];_0x33ab53[_0x548d6d(0x130)]&&(_0x1efd0f['env']=_0x33ab53[_0x548d6d(0x130)]);writeScopedConfig(_0x1efd0f,_0x5ad8cc);const _0x5c35ad=_0x5ad8cc['global']?_0x548d6d(0x114):_0x548d6d(0x14b),_0x3c811f=_0x1efd0f['env']?'\x20Current\x20env:\x20'+_0x1efd0f[_0x548d6d(0x130)]+'.':'';return{'ok':!![],'message':_0x548d6d(0x158)+_0x5c35ad+_0x548d6d(0x138)+_0x3c811f+_0x548d6d(0x13b)+CLI_BIN_NAME+_0x548d6d(0x122)};}},{'service':a13_0x366447(0x113),'command':a13_0x366447(0x10a),'description':a13_0x366447(0x13f),'risk':a13_0x366447(0x12a),'confirmationDescription':'Removes\x20the\x20AccessKey\x20from\x20the\x20selected\x20Lovrabet\x20config.\x20Commands\x20that\x20need\x20that\x20key\x20will\x20require\x20login\x20again.','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a13_0x366447(0x114),'type':a13_0x366447(0x11c),'description':'Clear\x20from\x20global\x20config\x20(default)','default':!![]},{'name':a13_0x366447(0x14b),'type':a13_0x366447(0x11c),'description':a13_0x366447(0x12c),'default':![]}],async 'execute'(_0x931c37){const _0x410229=a13_0x366447,_0x376389=resolveAuthScopeFlags(_0x931c37),_0x2a5539=readScopedConfig(_0x376389),_0x2a1dfb=!!_0x2a5539[_0x410229(0x11b)];delete _0x2a5539['accessKey'],writeScopedConfig(_0x2a5539,_0x376389);const _0x1db641=_0x376389['global']?_0x410229(0x114):_0x410229(0x14b);if(_0x2a1dfb)return{'ok':!![],'message':_0x410229(0x123)+_0x1db641+_0x410229(0x138)};return{'ok':!![],'message':_0x410229(0x128)+_0x1db641+_0x410229(0x153)};}},{'service':a13_0x366447(0x113),'command':a13_0x366447(0x139),'description':a13_0x366447(0x164),'risk':a13_0x366447(0x161),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a13_0x366447(0x114),'type':a13_0x366447(0x11c),'description':'Read\x20from\x20global\x20config\x20(default)','default':!![]},{'name':a13_0x366447(0x14b),'type':a13_0x366447(0x11c),'description':'Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]},{'name':a13_0x366447(0x142),'type':a13_0x366447(0x11c),'description':a13_0x366447(0x14c),'default':![]}],async 'execute'(_0x15b8c5){const _0x14ed2c=a13_0x366447,_0x36d481=resolveAuthScopeFlags(_0x15b8c5),_0x3fb236=readScopedConfig(_0x36d481),_0x276598=productEnvName(_0x14ed2c(0x146)),_0x5e9849=productEnv(_0x14ed2c(0x146))||undefined,_0x551efa=_0x3fb236[_0x14ed2c(0x11b)]||undefined,_0x188cb9=_0x5e9849||_0x551efa,_0x5bef11=_0x5e9849?_0x276598+_0x14ed2c(0x140):_0x551efa?(_0x36d481[_0x14ed2c(0x114)]?_0x14ed2c(0x114):'project')+'\x20config':null,_0x11fae8=[_0x14ed2c(0x14d)+AUTH_MODE[_0x14ed2c(0x15e)]];if(_0x188cb9){const _0x525e63=maskCliAccessKey(_0x188cb9);_0x11fae8[_0x14ed2c(0x14f)](_0x14ed2c(0x156)+_0x525e63+(_0x5bef11?_0x14ed2c(0x126)+_0x5bef11+')':'')),_0x11fae8[_0x14ed2c(0x14f)](_0x14ed2c(0x163));}if(!_0x188cb9){_0x11fae8[_0x14ed2c(0x14f)](''),_0x11fae8[_0x14ed2c(0x14f)](_0x14ed2c(0x148)),_0x11fae8['push'](''),_0x11fae8[_0x14ed2c(0x14f)]('Option\x20A:\x20'+CLI_BIN_NAME+'\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]'),_0x11fae8[_0x14ed2c(0x14f)](''),_0x11fae8['push'](_0x14ed2c(0x14e)+PRODUCT_CONFIG[_0x14ed2c(0x160)]+')'),_0x11fae8[_0x14ed2c(0x14f)](_0x14ed2c(0x11d)),_0x11fae8['push'](''),_0x11fae8[_0x14ed2c(0x14f)]('Option\x20C:\x20environment\x20variable'),_0x11fae8[_0x14ed2c(0x14f)](_0x14ed2c(0x12b)+_0x276598+_0x14ed2c(0x124)),_0x11fae8[_0x14ed2c(0x14f)](''),_0x11fae8['push']('Then\x20verify\x20with:\x20'+CLI_BIN_NAME+_0x14ed2c(0x122)),_0x11fae8[_0x14ed2c(0x14f)](_0x14ed2c(0x154)+CLI_BIN_NAME+_0x14ed2c(0x11f));if(_0x15b8c5[_0x14ed2c(0x115)](_0x14ed2c(0x142))){const _0x516761=readStoredDeviceCode();if(_0x516761&&!isStoredDeviceCodeExpired(_0x516761)){const _0x11a1c2=getUserDomain(),_0x2b1706=await fetchDeviceToken(_0x11a1c2,_0x516761[_0x14ed2c(0x111)]);if(_0x2b1706[_0x14ed2c(0x139)]===_0x14ed2c(0x14a)&&_0x2b1706[_0x14ed2c(0x121)]){const _0x161d83={'global':_0x516761['scope']===_0x14ed2c(0x114)},_0x84ba6=readScopedConfig(_0x161d83);_0x84ba6['accessKey']=_0x2b1706[_0x14ed2c(0x121)],writeScopedConfig(_0x84ba6,_0x161d83),deleteStoredDeviceCode();const _0x4afa5b=_0x2b1706['access_key'],_0x46fa17=maskCliAccessKey(_0x4afa5b),_0x1f7d9b=_0x516761['scope']===_0x14ed2c(0x114)?_0x14ed2c(0x143):'project\x20config';return{'ok':!![],'message':[_0x14ed2c(0x14d)+AUTH_MODE['ClientAk'],_0x14ed2c(0x156)+_0x46fa17+_0x14ed2c(0x126)+_0x1f7d9b+')',_0x14ed2c(0x163)][_0x14ed2c(0x15a)]('\x0a')};}_0x2b1706[_0x14ed2c(0x139)]===_0x14ed2c(0x155)&&deleteStoredDeviceCode();throw CliErrors['authRequired']('Device\x20authorization\x20pending.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20try\x20again.');}throw CliErrors['authRequired'](_0x11fae8[_0x14ed2c(0x15a)]('\x0a'));}}return{'ok':!![],'message':_0x11fae8[_0x14ed2c(0x15a)]('\x0a')};}},{'service':a13_0x366447(0x113),'command':a13_0x366447(0x10c),'description':a13_0x366447(0x134),'risk':a13_0x366447(0x161),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x594cd6){const _0x40efff=a13_0x366447,_0x43c291=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x43c291,'meta':{'env':_0x594cd6[_0x40efff(0x13c)]??_0x40efff(0x132)}}};}},authDeviceDefinition];
|
|
1
|
+
const a13_0x1d5bbb=a13_0x4b97;(function(_0x160735,_0x4c4f9c){const _0x31aab5=a13_0x4b97,_0x3931fb=_0x160735();while(!![]){try{const _0x2ff29f=-parseInt(_0x31aab5(0x1fb))/0x1+-parseInt(_0x31aab5(0x1f3))/0x2+parseInt(_0x31aab5(0x1eb))/0x3+-parseInt(_0x31aab5(0x1e0))/0x4*(parseInt(_0x31aab5(0x1ee))/0x5)+parseInt(_0x31aab5(0x218))/0x6+-parseInt(_0x31aab5(0x21f))/0x7*(-parseInt(_0x31aab5(0x1d1))/0x8)+parseInt(_0x31aab5(0x201))/0x9*(parseInt(_0x31aab5(0x209))/0xa);if(_0x2ff29f===_0x4c4f9c)break;else _0x3931fb['push'](_0x3931fb['shift']());}catch(_0x92650e){_0x3931fb['push'](_0x3931fb['shift']());}}}(a13_0xc271,0x9a791));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_0x4b97(_0x1eee3b,_0x1abb75){_0x1eee3b=_0x1eee3b-0x1c6;const _0xc271d=a13_0xc271();let _0x4b97c1=_0xc271d[_0x1eee3b];return _0x4b97c1;}import{getLoginUserInfo}from'../../core/api-client.js';function a13_0xc271(){const _0x3c255a=['\x20doctor','env','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','Option\x20B:\x20apps\x20config\x20(','access-key','`auth\x20login`\x20does\x20not\x20support\x20--yes.','code','\x20env\x20var','cancelled','status','Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','88TNcGwy','string','userCenterDisplayName','global','AccessKey:\x20','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','Then\x20verify\x20with:\x20','write','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','project\x20config','production','Status:\x20valid','yes','success','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.','12PGMVKA','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','isTTY','AccessKey\x20saved\x20to\x20','boolean','scope','ACCESS_KEY','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars','Option\x20C:\x20environment\x20variable','envName','\x20config.','1888149GTtqno','If\x20command\x20execution\x20still\x20fails,\x20run:\x20','\x20Verify:\x20','1725040xWzEAo','No\x20AccessKey\x20found\x20in\x20','Tip:\x20you\x20can\x20also\x20run:','=ak_xxx','Device\x20authorization\x20pending.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20try\x20again.','524902ucOasH','Use\x20`','daily','\x20auth\x20status','Shorthand\x20for\x20--access-key','Exit\x20non-zero\x20when\x20no\x20AccessKey\x20is\x20configured','\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]','Show\x20current\x20authentication\x20status','1063057iTTnhv','global-default','check','Clear\x20from\x20global\x20config\x20(default)','\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`','ClientAk','8767773lMjkKg','join','project','stdout','Write\x20to\x20global\x20config\x20(default)','bool','login','\x20config.\x20Nothing\x20to\x20clear.','10owbCLT','access_key','validation','read','\x20Current\x20env:\x20','stdin','\x20(via\x20','Missing\x20accessKey.','push','Read\x20from\x20global\x20config\x20(default)','global\x20config','nonInteractive','auth','expired','Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','5073744ClNVzi','\x20auth\x20login\x20--access-key\x20<ak_xxx>','accessKey','info','Clear\x20the\x20AccessKey\x20from\x20config','test','str','346213RepyZZ','\x20config','authRequired','development'];a13_0xc271=function(){return _0x3c255a;};return a13_0xc271();}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(_0x37d66f=USER_ACCESS_KEY_CREATE_URL){const _0x566322=a13_0x4b97;writeCliSideChannelLine(_0x566322(0x1e1)+PRODUCT_CONFIG[_0x566322(0x1d3)]+':'),writeCliSideChannelLine('\x0a'+_0x37d66f+'\x0a'),writeCliSideChannelLine(_0x566322(0x1f0)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x566322(0x219));}function buildAccessKeySetupGuide(_0x3b91cc=USER_ACCESS_KEY_CREATE_URL){const _0x496a47=a13_0x4b97;return['AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20'+PRODUCT_CONFIG[_0x496a47(0x1d3)]+':',_0x3b91cc,'Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20'+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]']['join']('\x0a');}function canPromptForAccessKey(_0x10c2cb){const _0xcbd5c9=a13_0x4b97;return!_0x10c2cb[_0xcbd5c9(0x214)]&&process[_0xcbd5c9(0x20e)]['isTTY']!==![]&&process[_0xcbd5c9(0x204)][_0xcbd5c9(0x1e2)]!==![];}function resolveAuthScopeFlags(_0x4dda8f){const _0x10756c=a13_0x4b97;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x4dda8f[_0x10756c(0x206)](_0x10756c(0x1d4)),'explicitProject':_0x4dda8f['bool'](_0x10756c(0x203)),'policy':_0x10756c(0x1fc)}));}async function resolveAuthWriteInput(_0x5e2af4){const _0x126906=a13_0x4b97;let _0x1f4158=(_0x5e2af4[_0x126906(0x21e)]('access-key')||_0x5e2af4[_0x126906(0x21e)]('ak')||'')['trim']();const _0x4039c6=(_0x5e2af4[_0x126906(0x21e)](_0x126906(0x1c7))||'')['trim'](),_0x18ff79=''+getUserDomain()+PRODUCT_CONFIG['accessKeyCreatePath'];if(!_0x1f4158&&canPromptForAccessKey(_0x5e2af4))try{showAccessKeyCreateHint(_0x18ff79),_0x1f4158=await promptAccessKey('');}catch(_0x34a063){if(isAbortPrompt(_0x34a063))throw CliErrors[_0x126906(0x1ce)]();throw _0x34a063;}if(!_0x1f4158)throw CliErrors[_0x126906(0x20b)](_0x126906(0x210),buildAccessKeySetupGuide(_0x18ff79));if(!ACCESS_KEY_PATTERN[_0x126906(0x21d)](_0x1f4158))throw CliErrors[_0x126906(0x20b)]('Invalid\x20accessKey\x20format.',_0x126906(0x1e7));if(!_0x4039c6)return{'accessKey':_0x1f4158};const _0x119168=normalizeEnv(_0x4039c6);return{'accessKey':_0x1f4158,'env':isDaily(_0x119168)?_0x126906(0x1f5):isDev(_0x119168)?_0x126906(0x222):_0x126906(0x1db)};}export const authDefinitions=[{'service':a13_0x1d5bbb(0x215),'command':a13_0x1d5bbb(0x207),'description':'Save\x20the\x20AccessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20the\x20project\x20file)','risk':a13_0x1d5bbb(0x1d8),'confirmationDescription':a13_0x1d5bbb(0x1df),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a13_0x1d5bbb(0x1ca),'type':a13_0x1d5bbb(0x1d2),'description':'AccessKey\x20(ak_xxx...)'},{'name':'ak','type':a13_0x1d5bbb(0x1d2),'description':a13_0x1d5bbb(0x1f7)},{'name':a13_0x1d5bbb(0x1d4),'type':a13_0x1d5bbb(0x1e4),'description':a13_0x1d5bbb(0x205),'default':!![]},{'name':a13_0x1d5bbb(0x203),'type':a13_0x1d5bbb(0x1e4),'description':a13_0x1d5bbb(0x1c8),'default':![]}],async 'execute'(_0x3153ae){const _0x29279f=a13_0x1d5bbb;if(_0x3153ae['bool'](_0x29279f(0x1dd)))throw CliErrors['validation'](_0x29279f(0x1cb),_0x29279f(0x1f4)+CLI_BIN_NAME+_0x29279f(0x1ff)+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.');const _0x5456df=(_0x3153ae[_0x29279f(0x21e)](_0x29279f(0x1ca))||_0x3153ae[_0x29279f(0x21e)]('ak')||'')['trim']();if(!_0x5456df&&_0x3153ae[_0x29279f(0x214)])return{'ok':!![],'message':buildAccessKeySetupGuide(''+getUserDomain()+PRODUCT_CONFIG['accessKeyCreatePath'])};const _0x41cbcb=await resolveAuthWriteInput(_0x3153ae),_0xb0e78d=resolveAuthScopeFlags(_0x3153ae),_0x285905=readScopedConfig(_0xb0e78d);_0x285905[_0x29279f(0x21a)]=_0x41cbcb[_0x29279f(0x21a)];_0x41cbcb[_0x29279f(0x1c7)]&&(_0x285905[_0x29279f(0x1c7)]=_0x41cbcb[_0x29279f(0x1c7)]);writeScopedConfig(_0x285905,_0xb0e78d);const _0x1d71e0=_0xb0e78d[_0x29279f(0x1d4)]?_0x29279f(0x1d4):'project',_0x5c31d0=_0x285905[_0x29279f(0x1c7)]?_0x29279f(0x20d)+_0x285905['env']+'.':'';return{'ok':!![],'message':_0x29279f(0x1e3)+_0x1d71e0+_0x29279f(0x1ea)+_0x5c31d0+_0x29279f(0x1ed)+CLI_BIN_NAME+'\x20auth\x20status'};}},{'service':a13_0x1d5bbb(0x215),'command':'logout','description':a13_0x1d5bbb(0x21c),'risk':a13_0x1d5bbb(0x1d8),'confirmationDescription':'Removes\x20the\x20AccessKey\x20from\x20the\x20selected\x20Lovrabet\x20config.\x20Commands\x20that\x20need\x20that\x20key\x20will\x20require\x20login\x20again.','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'global','type':a13_0x1d5bbb(0x1e4),'description':a13_0x1d5bbb(0x1fe),'default':!![]},{'name':a13_0x1d5bbb(0x203),'type':a13_0x1d5bbb(0x1e4),'description':a13_0x1d5bbb(0x217),'default':![]}],async 'execute'(_0x45d110){const _0xdb8795=a13_0x1d5bbb,_0x398765=resolveAuthScopeFlags(_0x45d110),_0x2cfd2f=readScopedConfig(_0x398765),_0x4b7bf6=!!_0x2cfd2f[_0xdb8795(0x21a)];delete _0x2cfd2f['accessKey'],writeScopedConfig(_0x2cfd2f,_0x398765);const _0x1759a9=_0x398765[_0xdb8795(0x1d4)]?_0xdb8795(0x1d4):_0xdb8795(0x203);if(_0x4b7bf6)return{'ok':!![],'message':'AccessKey\x20cleared\x20from\x20'+_0x1759a9+_0xdb8795(0x1ea)};return{'ok':!![],'message':_0xdb8795(0x1ef)+_0x1759a9+_0xdb8795(0x208)};}},{'service':a13_0x1d5bbb(0x215),'command':a13_0x1d5bbb(0x1cf),'description':a13_0x1d5bbb(0x1fa),'risk':a13_0x1d5bbb(0x20c),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'global','type':a13_0x1d5bbb(0x1e4),'description':a13_0x1d5bbb(0x212),'default':!![]},{'name':a13_0x1d5bbb(0x203),'type':a13_0x1d5bbb(0x1e4),'description':'Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]},{'name':a13_0x1d5bbb(0x1fd),'type':'boolean','description':a13_0x1d5bbb(0x1f8),'default':![]}],async 'execute'(_0x4ae8ab){const _0x5114d0=a13_0x1d5bbb,_0x47386a=resolveAuthScopeFlags(_0x4ae8ab),_0xdc06e2=readScopedConfig(_0x47386a),_0x4a0914=productEnvName(_0x5114d0(0x1e6)),_0x3cb88b=productEnv(_0x5114d0(0x1e6))||undefined,_0x5b7f3f=_0xdc06e2['accessKey']||undefined,_0xf149fd=_0x3cb88b||_0x5b7f3f,_0x4f00d8=_0x3cb88b?_0x4a0914+_0x5114d0(0x1cd):_0x5b7f3f?(_0x47386a[_0x5114d0(0x1d4)]?'global':_0x5114d0(0x203))+_0x5114d0(0x220):null,_0x5c4eba=['Auth\x20mode:\x20'+AUTH_MODE[_0x5114d0(0x200)]];if(_0xf149fd){const _0x136d6b=maskCliAccessKey(_0xf149fd);_0x5c4eba[_0x5114d0(0x211)]('AccessKey:\x20'+_0x136d6b+(_0x4f00d8?_0x5114d0(0x20f)+_0x4f00d8+')':'')),_0x5c4eba[_0x5114d0(0x211)](_0x5114d0(0x1dc));}if(!_0xf149fd){_0x5c4eba[_0x5114d0(0x211)](''),_0x5c4eba[_0x5114d0(0x211)](_0x5114d0(0x1d6)),_0x5c4eba[_0x5114d0(0x211)](''),_0x5c4eba[_0x5114d0(0x211)]('Option\x20A:\x20'+CLI_BIN_NAME+_0x5114d0(0x1f9)),_0x5c4eba[_0x5114d0(0x211)](''),_0x5c4eba[_0x5114d0(0x211)](_0x5114d0(0x1c9)+PRODUCT_CONFIG['newConfigFileName']+')'),_0x5c4eba[_0x5114d0(0x211)](_0x5114d0(0x1d9)),_0x5c4eba[_0x5114d0(0x211)](''),_0x5c4eba[_0x5114d0(0x211)](_0x5114d0(0x1e8)),_0x5c4eba[_0x5114d0(0x211)]('\x20\x20export\x20'+_0x4a0914+_0x5114d0(0x1f1)),_0x5c4eba[_0x5114d0(0x211)](''),_0x5c4eba[_0x5114d0(0x211)](_0x5114d0(0x1d7)+CLI_BIN_NAME+_0x5114d0(0x1f6)),_0x5c4eba[_0x5114d0(0x211)](_0x5114d0(0x1ec)+CLI_BIN_NAME+_0x5114d0(0x1c6));if(_0x4ae8ab[_0x5114d0(0x206)](_0x5114d0(0x1fd))){const _0x1bcd71=readStoredDeviceCode();if(_0x1bcd71&&!isStoredDeviceCodeExpired(_0x1bcd71)){const _0x106c62=getUserDomain(),_0x434bcf=await fetchDeviceToken(_0x106c62,_0x1bcd71[_0x5114d0(0x1cc)]);if(_0x434bcf[_0x5114d0(0x1cf)]===_0x5114d0(0x1de)&&_0x434bcf['access_key']){const _0x4d315f={'global':_0x1bcd71[_0x5114d0(0x1e5)]===_0x5114d0(0x1d4)},_0x45695b=readScopedConfig(_0x4d315f);_0x45695b[_0x5114d0(0x21a)]=_0x434bcf[_0x5114d0(0x20a)],writeScopedConfig(_0x45695b,_0x4d315f),deleteStoredDeviceCode();const _0x57517e=_0x434bcf[_0x5114d0(0x20a)],_0x16c6b2=maskCliAccessKey(_0x57517e),_0x4043a8=_0x1bcd71[_0x5114d0(0x1e5)]===_0x5114d0(0x1d4)?_0x5114d0(0x213):_0x5114d0(0x1da);return{'ok':!![],'message':['Auth\x20mode:\x20'+AUTH_MODE[_0x5114d0(0x200)],_0x5114d0(0x1d5)+_0x16c6b2+_0x5114d0(0x20f)+_0x4043a8+')',_0x5114d0(0x1dc)][_0x5114d0(0x202)]('\x0a')};}_0x434bcf[_0x5114d0(0x1cf)]===_0x5114d0(0x216)&&deleteStoredDeviceCode();throw CliErrors[_0x5114d0(0x221)](_0x5114d0(0x1f2));}throw CliErrors['authRequired'](_0x5c4eba[_0x5114d0(0x202)]('\x0a'));}}return{'ok':!![],'message':_0x5c4eba['join']('\x0a')};}},{'service':a13_0x1d5bbb(0x215),'command':a13_0x1d5bbb(0x21b),'description':a13_0x1d5bbb(0x1d0),'risk':a13_0x1d5bbb(0x20c),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x478042){const _0x3c623f=a13_0x1d5bbb,_0x26c9d3=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x26c9d3,'meta':{'env':_0x478042[_0x3c623f(0x1e9)]??_0x3c623f(0x1db)}}};}},authDeviceDefinition];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a14_0x28a1(){const _0x1fed3e=['48PnVOAB','):\x20','stdout','413983RMXVPQ','AbortPrompt','5653278qhGzjm','removeListener','User\x20aborted\x20prompt','573ELKVxp','764610nYuwBp','1402TMsesJ','AccessKey\x20(','name','SIGINT','once','16626650EpXADt','stdin','50826QxsyUF','question','AccessKey\x20(paste\x20ak_...):\x20','trim','close','2058052FMccjk','155mupOyc'];a14_0x28a1=function(){return _0x1fed3e;};return a14_0x28a1();}(function(_0x5cb99d,_0x10f77d){const _0x37723c=a14_0x29f0,_0x54b6ff=_0x5cb99d();while(!![]){try{const _0x49aa53=parseInt(_0x37723c(0xc3))/0x1+-parseInt(_0x37723c(0xca))/0x2*(parseInt(_0x37723c(0xc8))/0x3)+-parseInt(_0x37723c(0xbe))/0x4+-parseInt(_0x37723c(0xbf))/0x5*(-parseInt(_0x37723c(0xd1))/0x6)+parseInt(_0x37723c(0xc9))/0x7*(-parseInt(_0x37723c(0xc0))/0x8)+-parseInt(_0x37723c(0xc5))/0x9+parseInt(_0x37723c(0xcf))/0xa;if(_0x49aa53===_0x10f77d)break;else _0x54b6ff['push'](_0x54b6ff['shift']());}catch(_0xdfe744){_0x54b6ff['push'](_0x54b6ff['shift']());}}}(a14_0x28a1,0x6371b));function a14_0x29f0(_0x5a5183,_0x79a254){_0x5a5183=_0x5a5183-0xba;const _0x28a143=a14_0x28a1();let _0x29f064=_0x28a143[_0x5a5183];return _0x29f064;}import{createInterface}from'node:readline';class AbortPrompt extends Error{constructor(){const _0x563470=a14_0x29f0;super(_0x563470(0xc7)),this[_0x563470(0xcc)]=_0x563470(0xc4);}}function createSafeRl(){const _0x1bc424=a14_0x29f0,_0x1e03d8=createInterface({'input':process[_0x1bc424(0xd0)],'output':process[_0x1bc424(0xc2)]});let _0x519270;const _0x511da7=new Promise((_0x2b594e,_0x2b238a)=>{const _0x282826=_0x1bc424;_0x519270=()=>{const _0x2c2da3=a14_0x29f0;_0x519270&&(_0x1e03d8[_0x2c2da3(0xc6)](_0x2c2da3(0xcd),_0x519270),_0x519270=undefined);try{_0x1e03d8[_0x2c2da3(0xbd)]();}catch{}_0x2b238a(new AbortPrompt());},_0x1e03d8[_0x282826(0xce)]('SIGINT',_0x519270);}),_0x454a5d=()=>{const _0x541209=_0x1bc424;_0x519270&&(_0x1e03d8['removeListener'](_0x541209(0xcd),_0x519270),_0x519270=undefined);try{_0x1e03d8[_0x541209(0xbd)]();}catch{}};return{'rl':_0x1e03d8,'abortPromise':_0x511da7,'disposeSuccess':_0x454a5d};}export async function promptAccessKey(_0x2f2a5b=''){const {rl:_0x4edd4f,abortPromise:_0x479ecc,disposeSuccess:_0x33aa2f}=createSafeRl(),_0x1c63c6=new Promise(_0x3fbb35=>{const _0x2b88b8=a14_0x29f0,_0x30e254=_0x2f2a5b?_0x2b88b8(0xcb)+_0x2f2a5b+_0x2b88b8(0xc1):_0x2b88b8(0xbb);_0x4edd4f[_0x2b88b8(0xba)](_0x30e254,_0x2dc593=>{const _0x2d0734=_0x2b88b8;_0x33aa2f(),_0x3fbb35(_0x2dc593[_0x2d0734(0xbc)]()||_0x2f2a5b);});});return Promise['race']([_0x1c63c6,_0x479ecc]);}export function isAbortPrompt(_0x4f43d7){const _0x39d72c=a14_0x29f0;return _0x4f43d7 instanceof Error&&_0x4f43d7[_0x39d72c(0xcc)]===_0x39d72c(0xc4);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a15_0x5eee(_0x395309,_0x510478){_0x395309=_0x395309-0xcf;const _0x6efd2a=a15_0x6efd();let _0x5eee6f=_0x6efd2a[_0x395309];return _0x5eee6f;}function a15_0x6efd(){const _0x3e5f3c=['1414602AvWnoG','Get\x20a\x20Backend\x20Function\x20endpoint\x20contract\x20by\x20function\x20name','functionName','Backend\x20Function\x20name','gmtModified','version','(none)','404712SvHQVI','description','str','1JKucYr','79578SKtZME','bff','19804gzuBOf','182zmQlKB','read','643365vmixGV','appCode','8088780QfedXQ','872602PGKmil','174OIBKRX'];a15_0x6efd=function(){return _0x3e5f3c;};return a15_0x6efd();}const a15_0x4e3b1b=a15_0x5eee;(function(_0x274371,_0x323f3){const _0x42563e=a15_0x5eee,_0x4f4f65=_0x274371();while(!![]){try{const _0x434658=parseInt(_0x42563e(0xd5))/0x1*(parseInt(_0x42563e(0xde))/0x2)+parseInt(_0x42563e(0xdf))/0x3*(parseInt(_0x42563e(0xd8))/0x4)+parseInt(_0x42563e(0xdb))/0x5+-parseInt(_0x42563e(0xd6))/0x6*(-parseInt(_0x42563e(0xd9))/0x7)+parseInt(_0x42563e(0xd2))/0x8+-parseInt(_0x42563e(0xe0))/0x9+-parseInt(_0x42563e(0xdd))/0xa;if(_0x434658===_0x323f3)break;else _0x4f4f65['push'](_0x4f4f65['shift']());}catch(_0x246d68){_0x4f4f65['push'](_0x4f4f65['shift']());}}}(a15_0x6efd,0x44b9f));import{getBffEndpointContract}from'../../core/api-client.js';import{NAME_FLAG}from'../../commands/common/flags.js';export const bffDetail={'service':a15_0x4e3b1b(0xd7),'command':'detail','description':a15_0x4e3b1b(0xe1),'risk':a15_0x4e3b1b(0xda),'flags':[{...NAME_FLAG,'required':!![],'description':a15_0x4e3b1b(0xe3)}],async 'execute'(_0x1bb894){const _0x3369c7=a15_0x4e3b1b,_0x6bb1ef=await getBffEndpointContract(_0x1bb894[_0x3369c7(0xdc)],_0x1bb894[_0x3369c7(0xd4)]('name'));return{'ok':!![],'data':{'appCode':_0x6bb1ef[_0x3369c7(0xdc)],'functionName':_0x6bb1ef[_0x3369c7(0xe2)],'description':_0x6bb1ef[_0x3369c7(0xd3)]||_0x3369c7(0xd1),'version':_0x6bb1ef[_0x3369c7(0xd0)],'gmtModified':_0x6bb1ef[_0x3369c7(0xcf)]}};}};
|
package/lib/commands/bff/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a16_0x45aeef=a16_0x424a;(function(_0x75b366,_0x32ded8){const _0x15c8e1=a16_0x424a,_0x5f3774=_0x75b366();while(!![]){try{const _0x20938a=parseInt(_0x15c8e1(0x125))/0x1+-parseInt(_0x15c8e1(0x133))/0x2+-parseInt(_0x15c8e1(0x12c))/0x3+-parseInt(_0x15c8e1(0x12a))/0x4+parseInt(_0x15c8e1(0x12b))/0x5+parseInt(_0x15c8e1(0x134))/0x6*(parseInt(_0x15c8e1(0x132))/0x7)+-parseInt(_0x15c8e1(0x131))/0x8*(-parseInt(_0x15c8e1(0x12f))/0x9);if(_0x20938a===_0x32ded8)break;else _0x5f3774['push'](_0x5f3774['shift']());}catch(_0x11f88c){_0x5f3774['push'](_0x5f3774['shift']());}}}(a16_0x3389,0xc296f));function a16_0x3389(){const _0xb6227b=['exec','Backend\x20Function\x20name\x20to\x20execute','str','bff','2032616BwiMwY','4664910crkKsz','1366059tUQpsp','params','Execute\x20a\x20Backend\x20Function\x20script\x20by\x20function\x20name','63SUAylQ','now','1340584bbiOUu','7KmYOht','3082416TKwpYW','7059450mcvcHe','19186TETwEU'];a16_0x3389=function(){return _0xb6227b;};return a16_0x3389();}function a16_0x424a(_0x3ef58f,_0x156555){_0x3ef58f=_0x3ef58f-0x125;const _0x33893a=a16_0x3389();let _0x424af8=_0x33893a[_0x3ef58f];return _0x424af8;}import{executeSdkBff}from'../../core/sdk-client.js';import{parseJsonParams}from'../../utils/params.js';import{NAME_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';export const bffExec={'service':a16_0x45aeef(0x129),'command':a16_0x45aeef(0x126),'description':a16_0x45aeef(0x12e),'risk':'read','flags':[{...NAME_FLAG,'required':!![],'description':a16_0x45aeef(0x127)},PARAMS_FLAG],async 'execute'(_0x14c098){const _0x52996f=a16_0x45aeef,_0x5b7871=parseJsonParams(_0x14c098[_0x52996f(0x128)](_0x52996f(0x12d))),_0x54ae76=Date[_0x52996f(0x130)](),_0x33a516=await executeSdkBff(_0x14c098[_0x52996f(0x128)]('name'),_0x5b7871),_0x494f39=Date[_0x52996f(0x130)]()-_0x54ae76;return{'ok':!![],'data':{'result':_0x33a516,'elapsed':_0x494f39},'message':'Backend\x20Function\x20executed\x20in\x20'+_0x494f39+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a17_0x21f8(){const _0x238285=['647331WqKIQp','552380KBrNjM','124jUsXqQ','868522NxnyLj','1327436nbagkw','336264AkUKRb','3505ibWHes','207smUqnv','8rySydf','4GQgGOp','8408645wKLvVo'];a17_0x21f8=function(){return _0x238285;};return a17_0x21f8();}(function(_0x54cbf8,_0x138e82){const _0x2dda85=a17_0x4ad4,_0x5191c1=_0x54cbf8();while(!![]){try{const _0x51790f=-parseInt(_0x2dda85(0x12e))/0x1+-parseInt(_0x2dda85(0x134))/0x2*(parseInt(_0x2dda85(0x12b))/0x3)+parseInt(_0x2dda85(0x12d))/0x4*(-parseInt(_0x2dda85(0x131))/0x5)+-parseInt(_0x2dda85(0x130))/0x6+-parseInt(_0x2dda85(0x135))/0x7*(-parseInt(_0x2dda85(0x133))/0x8)+parseInt(_0x2dda85(0x132))/0x9*(parseInt(_0x2dda85(0x12c))/0xa)+-parseInt(_0x2dda85(0x12f))/0xb;if(_0x51790f===_0x138e82)break;else _0x5191c1['push'](_0x5191c1['shift']());}catch(_0x26545e){_0x5191c1['push'](_0x5191c1['shift']());}}}(a17_0x21f8,0xed97e));import{bffDetail}from'../../commands/bff/detail.js';function a17_0x4ad4(_0x504080,_0x58a610){_0x504080=_0x504080-0x12b;const _0x21f849=a17_0x21f8();let _0x4ad472=_0x21f849[_0x504080];return _0x4ad472;}import{bffExec}from'../../commands/bff/exec.js';export const bffDefinitions=[bffDetail,bffExec];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a18_0xd9236f=a18_0x4303;function a18_0x2e56(){const _0x21c048=['3WFdjdl','info','installedPath','repairCommand','\x20at\x20','14726493XkOegI','9694600AFovcX','2244612IQyPKA','CLI\x20Built-in\x20Skill\x20','8850SYybcm','7476ZsIyiD','setLogPath','7427875xtIfyz','nonInteractive','Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20','\x20is\x20already\x20current','error','10CquXIi','changed','cli-skill-install','Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20npm\x20package.','342zypGZj','7879Oigmnl','skillVersion','\x20installed','unknown','cli-skill','44Wtoeul','inherit','INSTALL_FAILED','1786252xGSkij',']:\x20','install'];a18_0x2e56=function(){return _0x21c048;};return a18_0x2e56();}(function(_0x4bfd27,_0x574447){const _0x491914=a18_0x4303,_0x4c031b=_0x4bfd27();while(!![]){try{const _0x39e243=-parseInt(_0x491914(0x1e8))/0x1*(-parseInt(_0x491914(0x1e7))/0x2)+-parseInt(_0x491914(0x1d2))/0x3*(-parseInt(_0x491914(0x1cf))/0x4)+-parseInt(_0x491914(0x1de))/0x5+parseInt(_0x491914(0x1db))/0x6*(-parseInt(_0x491914(0x1dc))/0x7)+parseInt(_0x491914(0x1d8))/0x8+parseInt(_0x491914(0x1d7))/0x9*(parseInt(_0x491914(0x1e3))/0xa)+parseInt(_0x491914(0x1ed))/0xb*(-parseInt(_0x491914(0x1d9))/0xc);if(_0x39e243===_0x574447)break;else _0x4c031b['push'](_0x4c031b['shift']());}catch(_0x3eab62){_0x4c031b['push'](_0x4c031b['shift']());}}}(a18_0x2e56,0xcb57f));import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';function a18_0x4303(_0x5d3592,_0x6e9780){_0x5d3592=_0x5d3592-0x1cd;const _0x2e564f=a18_0x2e56();let _0x43039c=_0x2e564f[_0x5d3592];return _0x43039c;}import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':a18_0xd9236f(0x1ec),'command':a18_0xd9236f(0x1d1),'description':'Install\x20the\x20built-in\x20CLI\x20Skill\x20required\x20by\x20Lovrabet\x20runtime','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x538643){const _0x3004ab=a18_0xd9236f;logger[_0x3004ab(0x1dd)](process['cwd']()),logger[_0x3004ab(0x1d3)](_0x3004ab(0x1e5),_0x3004ab(0x1e6));const _0x14180f=installBuiltinSkill({'stdio':_0x538643[_0x3004ab(0x1df)]?'pipe':_0x3004ab(0x1cd)});if(!_0x14180f['ok'])throw CliErrors['apiError']('Built-in\x20Skill\x20install\x20failed\x20['+(_0x14180f['code']||_0x3004ab(0x1ce))+_0x3004ab(0x1d0)+(_0x14180f[_0x3004ab(0x1e2)]||_0x3004ab(0x1eb)),_0x3004ab(0x1e0)+_0x14180f[_0x3004ab(0x1d5)]);const _0x4f815b=_0x14180f[_0x3004ab(0x1d4)]?_0x3004ab(0x1d6)+_0x14180f[_0x3004ab(0x1d4)]:'';return console['log'](_0x14180f[_0x3004ab(0x1e4)]?_0x3004ab(0x1da)+_0x14180f[_0x3004ab(0x1e9)]+_0x3004ab(0x1ea)+_0x4f815b:_0x3004ab(0x1da)+_0x14180f['skillVersion']+_0x3004ab(0x1e1)+_0x4f815b),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x52d8e6,_0x199afa){const _0x1f1532=a19_0x2046,_0x4fee93=_0x52d8e6();while(!![]){try{const _0x9193cf=parseInt(_0x1f1532(0x1d8))/0x1+parseInt(_0x1f1532(0x1de))/0x2+-parseInt(_0x1f1532(0x1e7))/0x3*(-parseInt(_0x1f1532(0x1e5))/0x4)+-parseInt(_0x1f1532(0x1e6))/0x5+parseInt(_0x1f1532(0x1e4))/0x6*(-parseInt(_0x1f1532(0x1e2))/0x7)+parseInt(_0x1f1532(0x1d9))/0x8+parseInt(_0x1f1532(0x1dd))/0x9*(parseInt(_0x1f1532(0x1da))/0xa);if(_0x9193cf===_0x199afa)break;else _0x4fee93['push'](_0x4fee93['shift']());}catch(_0x45134b){_0x4fee93['push'](_0x4fee93['shift']());}}}(a19_0x2041,0x468db));import{PRODUCT_CONFIG}from'../../constant/product.js';function a19_0x2046(_0x19d7d3,_0x266a7d){_0x19d7d3=_0x19d7d3-0x1d4;const _0x20413b=a19_0x2041();let _0x204615=_0x20413b[_0x19d7d3];return _0x204615;}export{DEFAULT_APP_PROFILE_NAME,DEFAULT_CONFIG_VALUES}from'../../constant/defaults.js';export{RUNTIME_ENV_VALUES}from'../../constant/env.js';export{OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{isInProject}from'../../context.js';function a19_0x2041(){const _0x15f482=['Use\x20only\x20one\x20config\x20scope\x20flag.','31085WjQfPR','621592TRQqAI','3450NXLFes','project-or-global-explicit','global','9783cYncnr','406192kwXCEt','\x20first.','newConfigFileName','\x20found).','7945rjZdbx','inProject','2166DwHKEL','4eNVODV','850650zEYUhM','545871BJjREJ','validation',',\x20or\x20create\x20a\x20project-local\x20','global-default','project','Not\x20inside\x20a\x20project\x20(no\x20'];a19_0x2041=function(){return _0x15f482;};return a19_0x2041();}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(_0x5e5045){const _0x54f870=a19_0x2046,{explicitGlobal:explicitGlobal=![],explicitProject:explicitProject=![],policy:_0x3b98c0}=_0x5e5045;if(explicitGlobal&&explicitProject)throw CliErrors[_0x54f870(0x1e8)]('Flags\x20--global\x20and\x20--project\x20are\x20mutually\x20exclusive.',_0x54f870(0x1d7));if(explicitGlobal)return _0x54f870(0x1dc);if(explicitProject)return _0x54f870(0x1d5);switch(_0x3b98c0){case _0x54f870(0x1d4):return'global';case _0x54f870(0x1db):if(!(_0x5e5045[_0x54f870(0x1e3)]??isInProject()))throw CliErrors[_0x54f870(0x1e8)](_0x54f870(0x1d6)+PRODUCT_CONFIG[_0x54f870(0x1e0)]+_0x54f870(0x1e1),'Add\x20--global\x20to\x20write\x20to\x20~/'+PRODUCT_CONFIG['newConfigFileName']+_0x54f870(0x1e9)+PRODUCT_CONFIG[_0x54f870(0x1e0)]+_0x54f870(0x1df));return _0x54f870(0x1d5);}}export function toScopeFlags(_0x56fef1){return{'global':_0x56fef1==='global'};}export function formatScopeLabel(_0x4d686e){const _0x47ef29=a19_0x2046;return _0x4d686e===_0x47ef29(0x1dc)?'\x20(global)':'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a20_0x5f4e(_0x4d69a1,_0x5a2a15){_0x4d69a1=_0x4d69a1-0x16f;const _0x1f1bca=a20_0x1f1b();let _0x5f4ed2=_0x1f1bca[_0x4d69a1];return _0x5f4ed2;}(function(_0x9f817e,_0x9adb5f){const _0x33d2aa=a20_0x5f4e,_0x3bb8fb=_0x9f817e();while(!![]){try{const _0x7fc46=-parseInt(_0x33d2aa(0x18c))/0x1+parseInt(_0x33d2aa(0x171))/0x2*(-parseInt(_0x33d2aa(0x185))/0x3)+-parseInt(_0x33d2aa(0x186))/0x4+parseInt(_0x33d2aa(0x178))/0x5*(-parseInt(_0x33d2aa(0x181))/0x6)+-parseInt(_0x33d2aa(0x174))/0x7*(-parseInt(_0x33d2aa(0x179))/0x8)+parseInt(_0x33d2aa(0x17a))/0x9+parseInt(_0x33d2aa(0x17b))/0xa;if(_0x7fc46===_0x9adb5f)break;else _0x3bb8fb['push'](_0x3bb8fb['shift']());}catch(_0x4e93dc){_0x3bb8fb['push'](_0x3bb8fb['shift']());}}}(a20_0x1f1b,0x82043));import{CliErrors}from'../../errors.js';function isSet(_0x421566,_0x20ee7e){const _0x18b669=a20_0x5f4e,_0x5848f5=_0x421566[_0x18b669(0x17f)](_0x20ee7e);return _0x5848f5!==undefined&&_0x5848f5!==''&&_0x5848f5!==![]&&_0x5848f5!==0x0;}function a20_0x1f1b(){const _0x4c467f=['Flags\x20','916790RhYPvB','validation','join','776114VsTQkt','\x20are\x20mutually\x20exclusive\x20for\x20`','filter','56ExwQLY','Remove\x20all\x20but\x20one.',':\x20expected\x20','length','235UmMPQL','854296gsPguV','6040098CONzYE','15198960VMIomF','Exactly\x20one\x20of\x20','Use\x20only\x20one\x20of:\x20','str','flag','test','27780EYuXdt','At\x20least\x20one\x20of\x20','some','\x20is\x20allowed,\x20found:\x20','3QSlFtn','3961240DFXFas','Invalid\x20--','map','Only\x20one\x20of\x20','Provide\x20one\x20of:\x20'];a20_0x1f1b=function(){return _0x4c467f;};return a20_0x1f1b();}function fmtNames(_0x5ca942){const _0x178c46=a20_0x5f4e;return _0x5ca942[_0x178c46(0x188)](_0x34cfc4=>'--'+_0x34cfc4)[_0x178c46(0x170)](',\x20');}export function requireOneOf(_0x1dd64a,_0x213eac,_0x42d40f){const _0x39bee2=a20_0x5f4e,_0x59bf6b=_0x213eac[_0x39bee2(0x173)](_0x11b256=>isSet(_0x1dd64a,_0x11b256));if(_0x59bf6b[_0x39bee2(0x177)]!==0x1)throw CliErrors[_0x39bee2(0x16f)](_0x59bf6b[_0x39bee2(0x177)]===0x0?_0x39bee2(0x17c)+fmtNames(_0x213eac)+'\x20is\x20required\x20for\x20`'+_0x42d40f+'`.':_0x39bee2(0x189)+fmtNames(_0x213eac)+_0x39bee2(0x184)+fmtNames(_0x59bf6b)+'.',_0x59bf6b[_0x39bee2(0x177)]===0x0?_0x39bee2(0x18a)+fmtNames(_0x213eac):_0x39bee2(0x175));}export function requireAnyOf(_0x17a8a4,_0x48f44e,_0x37d009){const _0x180937=a20_0x5f4e;if(!_0x48f44e[_0x180937(0x183)](_0x204f49=>isSet(_0x17a8a4,_0x204f49)))throw CliErrors[_0x180937(0x16f)](_0x180937(0x182)+fmtNames(_0x48f44e)+'\x20is\x20required\x20for\x20`'+_0x37d009+'`.',_0x180937(0x18a)+fmtNames(_0x48f44e));}export function mutuallyExclusive(_0x15eeed,_0x7ef24c,_0x1ad879){const _0x559d78=a20_0x5f4e,_0x57bde2=_0x7ef24c[_0x559d78(0x173)](_0x243de9=>isSet(_0x15eeed,_0x243de9));if(_0x57bde2['length']>0x1)throw CliErrors['validation'](_0x559d78(0x18b)+fmtNames(_0x57bde2)+_0x559d78(0x172)+_0x1ad879+'`.',_0x559d78(0x17d)+fmtNames(_0x7ef24c));}export function validatePattern(_0x5bc2fe,_0x43dc53,_0x31bc49,_0x590f55){const _0x1d8459=a20_0x5f4e,_0x1a34fb=_0x5bc2fe[_0x1d8459(0x17e)](_0x43dc53);if(_0x1a34fb&&!_0x31bc49[_0x1d8459(0x180)](_0x1a34fb))throw CliErrors['validation'](_0x1d8459(0x187)+_0x43dc53+_0x1d8459(0x176)+_0x590f55+',\x20got\x20\x22'+_0x1a34fb+'\x22.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x5b30a8=a21_0x6a2c;(function(_0x48d2e3,_0x597602){const _0x1510ab=a21_0x6a2c,_0x12fca4=_0x48d2e3();while(!![]){try{const _0x4d6127=-parseInt(_0x1510ab(0x153))/0x1*(parseInt(_0x1510ab(0x156))/0x2)+-parseInt(_0x1510ab(0x145))/0x3*(parseInt(_0x1510ab(0x148))/0x4)+-parseInt(_0x1510ab(0x142))/0x5+-parseInt(_0x1510ab(0x151))/0x6*(parseInt(_0x1510ab(0x154))/0x7)+parseInt(_0x1510ab(0x147))/0x8+-parseInt(_0x1510ab(0x159))/0x9+-parseInt(_0x1510ab(0x14f))/0xa*(-parseInt(_0x1510ab(0x14a))/0xb);if(_0x4d6127===_0x597602)break;else _0x12fca4['push'](_0x12fca4['shift']());}catch(_0x2e4a8e){_0x12fca4['push'](_0x12fca4['shift']());}}}(a21_0x2ae3,0xe0290));export const GLOBAL_SCOPE_FLAG={'name':a21_0x5b30a8(0x140),'type':'boolean','default':![],'description':a21_0x5b30a8(0x150)};export const CODE_FLAG={'name':a21_0x5b30a8(0x141),'type':'string','required':!![],'description':a21_0x5b30a8(0x14d),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a21_0x5b30a8(0x13f)}};function a21_0x6a2c(_0x2d9836,_0x4deaae){_0x2d9836=_0x2d9836-0x13f;const _0x2ae394=a21_0x2ae3();let _0x6a2cf0=_0x2ae394[_0x2d9836];return _0x6a2cf0;}export const SQLCODE_FLAG={'name':a21_0x5b30a8(0x14c),'type':a21_0x5b30a8(0x146),'required':!![],'description':a21_0x5b30a8(0x14e),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a21_0x5b30a8(0x143)}};export const VERBOSE_FLAG={'name':a21_0x5b30a8(0x144),'type':a21_0x5b30a8(0x158),'description':'Return\x20full\x20raw\x20response\x20object'};export const PARAMS_FLAG={'name':'params','type':a21_0x5b30a8(0x146),'description':a21_0x5b30a8(0x155)};export const NAME_FLAG={'name':a21_0x5b30a8(0x149),'type':'string','description':a21_0x5b30a8(0x157)};function a21_0x2ae3(){const _0xe4f0d=['boolean','11247975HrWbpr','a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588)','global','code','8188065obisVs','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','verbose','1472901rXAxxK','string','750936SRydhV','12BJDHXm','name','44Famlxg','number','sqlcode','Dataset\x20code\x20(32-char\x20hex\x20UUID)','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','14460210wClMaP','Write\x20to\x20the\x20global\x20configuration','6WfdlTw','Resource\x20ID','2KsjSWZ','3539354PqwYtn','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','93880NrRwTx','Resource\x20name\x20for\x20lookup'];a21_0x2ae3=function(){return _0xe4f0d;};return a21_0x2ae3();}export const ID_FLAG={'name':'id','type':a21_0x5b30a8(0x14b),'required':!![],'description':a21_0x5b30a8(0x152)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3d0818,_0x537c05){const _0x2b9e9b=a22_0x290c,_0x217508=_0x3d0818();while(!![]){try{const _0x41db9e=parseInt(_0x2b9e9b(0x103))/0x1+parseInt(_0x2b9e9b(0x101))/0x2+-parseInt(_0x2b9e9b(0xfa))/0x3+parseInt(_0x2b9e9b(0x102))/0x4*(-parseInt(_0x2b9e9b(0xfb))/0x5)+parseInt(_0x2b9e9b(0xfc))/0x6+parseInt(_0x2b9e9b(0x100))/0x7*(parseInt(_0x2b9e9b(0xf6))/0x8)+-parseInt(_0x2b9e9b(0xf9))/0x9;if(_0x41db9e===_0x537c05)break;else _0x217508['push'](_0x217508['shift']());}catch(_0x23d26b){_0x217508['push'](_0x217508['shift']());}}}(a22_0x342e,0xc7006));function a22_0x290c(_0x194157,_0x375d01){_0x194157=_0x194157-0xf5;const _0x342eaa=a22_0x342e();let _0x290c89=_0x342eaa[_0x194157];return _0x290c89;}import{existsSync,statSync}from'node:fs';import{CliErrors}from'../../errors.js';const BYTES_PER_MB=0x400*0x400;export const RUNTIME_UPLOAD_MAX_BYTES=0x32*BYTES_PER_MB;function a22_0x342e(){const _0x4a1f27=['isFile','17336edNXvv','size','validation','3894354mgUIpZ','1945770caKKaE','10fbJEsW','434382RWEPGT','ceil','toFixed','\x20MB','2821iImQzE','1528886hlgdIQ','427888RTQsSI','400209DnKyfT'];a22_0x342e=function(){return _0x4a1f27;};return a22_0x342e();}function formatBytes(_0x3e2236){const _0x15e240=a22_0x290c;if(_0x3e2236>=BYTES_PER_MB){const _0xcd6483=Math[_0x15e240(0xfd)](_0x3e2236/BYTES_PER_MB*0x64)/0x64;return _0xcd6483[_0x15e240(0xfe)](0x2)+_0x15e240(0xff);}return _0x3e2236+'\x20B';}export function requireRuntimeUploadFile(_0x514e6b,_0x58da1d){const _0x43024b=a22_0x290c,_0xf16957=_0x514e6b['trim']();if(!_0xf16957)throw CliErrors['validation'](_0x58da1d+'\x20path\x20is\x20required.');if(!existsSync(_0xf16957))throw CliErrors[_0x43024b(0xf8)]('File\x20not\x20found:\x20'+_0xf16957);const _0x4fe686=statSync(_0xf16957);if(!_0x4fe686[_0x43024b(0xf5)]())throw CliErrors['validation']('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0xf16957);if(_0x4fe686[_0x43024b(0xf7)]>RUNTIME_UPLOAD_MAX_BYTES)throw CliErrors['validation']('File\x20exceeds\x20the\x20runtime\x20upload\x20limit\x20of\x2050\x20MB:\x20'+_0xf16957+'\x20('+formatBytes(_0x4fe686['size'])+')');return{'path':_0xf16957,'size':_0x4fe686[_0x43024b(0xf7)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a23_0x436f04=a23_0x3a7e;(function(_0x38539c,_0xc339fe){const _0x12134d=a23_0x3a7e,_0x58152d=_0x38539c();while(!![]){try{const _0x2f1e2e=parseInt(_0x12134d(0x125))/0x1*(parseInt(_0x12134d(0xf6))/0x2)+parseInt(_0x12134d(0xe3))/0x3+-parseInt(_0x12134d(0x117))/0x4*(-parseInt(_0x12134d(0x103))/0x5)+parseInt(_0x12134d(0x111))/0x6*(-parseInt(_0x12134d(0x122))/0x7)+-parseInt(_0x12134d(0x11c))/0x8*(parseInt(_0x12134d(0xfd))/0x9)+-parseInt(_0x12134d(0x101))/0xa+-parseInt(_0x12134d(0x110))/0xb*(parseInt(_0x12134d(0x115))/0xc);if(_0x2f1e2e===_0xc339fe)break;else _0x58152d['push'](_0x58152d['shift']());}catch(_0x2409be){_0x58152d['push'](_0x58152d['shift']());}}}(a23_0x5b94,0x236e1));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(_0x556278){const _0x11c498=a23_0x3a7e,_0x57c81f=_0x556278[_0x11c498(0x11d)]('.');if(_0x57c81f[_0x11c498(0xfb)]!==0x3||_0x57c81f[0x0]!==_0x11c498(0x112)||_0x57c81f[0x2]!=='appcode')return undefined;const _0x1b1646=_0x57c81f[0x1]?.[_0x11c498(0xe9)]();return _0x1b1646?_0x1b1646:undefined;}function parseAliasDeleteKey(_0xca7483){const _0x24e9ee=a23_0x3a7e,_0x34b8d8=_0xca7483[_0x24e9ee(0x11d)]('.');if(_0x34b8d8[_0x24e9ee(0xfb)]===0x2&&_0x34b8d8[0x0]===_0x24e9ee(0x112)){const _0x5a0c28=_0x34b8d8[0x1]?.[_0x24e9ee(0xe9)]();return _0x5a0c28?{'alias':_0x5a0c28}:undefined;}if(_0x34b8d8['length']===0x3&&_0x34b8d8[0x0]==='apps'&&_0x34b8d8[0x2]===_0x24e9ee(0x10e)){const _0x3f6d29=_0x34b8d8[0x1]?.[_0x24e9ee(0xe9)]();return _0x3f6d29?{'alias':_0x3f6d29,'field':_0x24e9ee(0x10e)}:undefined;}return undefined;}function setLocalAppAlias(_0x20aad2,_0x225bab,_0x5f2434){const _0x133b90=a23_0x3a7e,_0x50dfc0=_0x20aad2[_0x133b90(0x112)]&&typeof _0x20aad2[_0x133b90(0x112)]==='object'&&!Array[_0x133b90(0xe5)](_0x20aad2['apps'])?_0x20aad2[_0x133b90(0x112)]:{},_0x314d67=_0x50dfc0[_0x225bab]&&typeof _0x50dfc0[_0x225bab]===_0x133b90(0xf4)&&!Array[_0x133b90(0xe5)](_0x50dfc0[_0x225bab])?_0x50dfc0[_0x225bab]:{};_0x314d67[_0x133b90(0x10e)]=_0x5f2434,_0x50dfc0[_0x225bab]=_0x314d67,_0x20aad2[_0x133b90(0x112)]=_0x50dfc0;}function a23_0x5b94(){const _0x431748=['stringify','raw','467510UBSisu','format','305gjFLPW',';\x20apps.<alias>.appcode','\x22.\x20Allowed:\x20','(none)','`\x20=\x20\x22','locale','Missing\x20key\x20or\x20value.','Missing\x20key\x20argument.','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','\x22\x20is\x20protected\x20and\x20cannot\x20be\x20changed\x20via\x20config\x20commands.','alias','appcode','Top-level\x20key\x20\x22','62018xjNSPd','198uJxAIz','apps','delete','../../context.js','204Uiorbo','accessKey','852ZojvPg','key','join','includes','project-or-global-explicit','8ccuYvx','split','log','Usage:\x20','value','global','1274ElzWLR','Config\x20files:\x0a','Key\x20not\x20found:\x20','34071NMtVuY','Invalid\x20locale\x20value.','Set\x20a\x20configuration\x20value','\x20(global)','Deletes\x20a\x20Lovrabet\x20CLI\x20config\x20key.\x20Later\x20commands\x20will\x20fall\x20back\x20to\x20another\x20config\x20layer\x20or\x20the\x20default.','list','config','args','308784DEuNnI','\x20config\x20delete\x20<key>\x20[--global]','isArray','Value\x20to\x20assign','pageSize','Invalid\x20value\x20for\x20\x22','trim','read','pageSize\x20must\x20be\x20a\x20positive\x20number','field','Set\x20`','write','Get\x20a\x20config\x20value','bool','validation','\x20config\x20set\x20<key>\x20<value>\x20[--global]','get','object','Deleted\x20`','16knGFpV','\x22\x20is\x20not\x20settable.','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','Key\x20already\x20absent:\x20','Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US','length','set','852885zdjZUv','Changes\x20Lovrabet\x20CLI\x20configuration.\x20Later\x20commands\x20may\x20use\x20a\x20different\x20app,\x20environment,\x20or\x20output\x20behavior.'];a23_0x5b94=function(){return _0x431748;};return a23_0x5b94();}function deleteLocalAppAlias(_0x456b3a,_0x18a6fb){const _0x358ce3=a23_0x3a7e;if(!_0x456b3a[_0x358ce3(0x112)]||typeof _0x456b3a['apps']!=='object'||Array['isArray'](_0x456b3a[_0x358ce3(0x112)]))return![];const _0x2be26c=_0x456b3a['apps'],_0x8fc3a=_0x2be26c[_0x18a6fb['alias']];if(!_0x8fc3a||typeof _0x8fc3a!==_0x358ce3(0xf4)||Array[_0x358ce3(0xe5)](_0x8fc3a))return![];if(!_0x18a6fb[_0x358ce3(0xec)])return delete _0x2be26c[_0x18a6fb[_0x358ce3(0x10d)]],!![];if(!(_0x18a6fb[_0x358ce3(0xec)]in _0x8fc3a))return![];return delete _0x8fc3a[_0x18a6fb['field']],Object['keys'](_0x8fc3a)[_0x358ce3(0xfb)]===0x0&&delete _0x2be26c[_0x18a6fb[_0x358ce3(0x10d)]],!![];}const listDef={'service':a23_0x436f04(0xe1),'command':a23_0x436f04(0xe0),'description':'List\x20current\x20config','risk':a23_0x436f04(0xea),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x2cc472){const _0x4d8e3f=a23_0x436f04,{buildConfigFromFlags:_0x4b3143}=await import(_0x4d8e3f(0x114)),_0x49aa8b=_0x4b3143({}),_0x3d4be2=redactCliConfigCredentials(_0x49aa8b[_0x4d8e3f(0x100)]),_0x51a68c=getProjectConfigPath(),_0x4b2969=resolveWriteConfigPath(_0x4d8e3f(0x121));if(_0x2cc472[_0x4d8e3f(0x102)]==='pretty')return{'ok':!![],'message':_0x4d8e3f(0x10b)+(JSON[_0x4d8e3f(0xff)](_0x3d4be2,null,0x2)+'\x0a\x0a')+_0x4d8e3f(0x123)+('\x20\x20project:\x20'+(_0x51a68c??_0x4d8e3f(0x106))+'\x0a')+('\x20\x20global:\x20\x20'+_0x4b2969)};return{'ok':!![],'data':{'effective':_0x3d4be2,'configFiles':{'project':_0x51a68c??null,'global':_0x4b2969}}};}},getDef={'service':a23_0x436f04(0xe1),'command':a23_0x436f04(0xf3),'description':a23_0x436f04(0xef),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a23_0x436f04(0x118),'description':a23_0x436f04(0xf8),'required':!![]}],'flags':[],async 'execute'(_0x42677f){const _0x108656=a23_0x436f04,_0x430c09=_0x42677f[_0x108656(0xe2)][0x0];if(!_0x430c09)throw CliErrors['validation'](_0x108656(0x10a),_0x108656(0x11f)+CLI_BIN_NAME+'\x20config\x20get\x20<key>');const {buildConfigFromFlags:_0x5eaca6}=await import(_0x108656(0x114)),{raw:_0x313cc9}=_0x5eaca6({});if(_0x430c09['includes']('.')){const _0x565523=_0x430c09[_0x108656(0x11d)]('.');let _0x3360f1=_0x313cc9;for(const _0x47f82c of _0x565523){if(_0x3360f1==null||typeof _0x3360f1!=='object')throw CliErrors[_0x108656(0xf1)](_0x108656(0x124)+_0x430c09);_0x3360f1=_0x3360f1[_0x47f82c];}if(_0x3360f1===undefined)throw CliErrors[_0x108656(0xf1)](_0x108656(0x124)+_0x430c09);const _0x52adb0=redactCliConfigValue(_0x430c09,_0x3360f1);return console['log'](typeof _0x52adb0===_0x108656(0xf4)?JSON['stringify'](_0x52adb0,null,0x2):String(_0x52adb0)),{'ok':!![]};}const _0x557389=_0x313cc9[_0x430c09];if(_0x557389===undefined)throw CliErrors['validation'](_0x108656(0x124)+_0x430c09);const _0x130f7a=redactCliConfigValue(_0x430c09,_0x557389);return console[_0x108656(0x11e)](typeof _0x130f7a===_0x108656(0xf4)?JSON[_0x108656(0xff)](_0x130f7a,null,0x2):String(_0x130f7a)),{'ok':!![]};}},setDef={'service':'config','command':a23_0x436f04(0xfc),'description':a23_0x436f04(0x127),'risk':a23_0x436f04(0xee),'confirmationDescription':a23_0x436f04(0xfe),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a23_0x436f04(0x118),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a23_0x436f04(0x120),'description':a23_0x436f04(0xe6),'required':!![]}],'flags':[GLOBAL_SCOPE_FLAG],async 'execute'(_0x2aae77){const _0x56dbc8=a23_0x436f04,_0x26c0c4=_0x2aae77[_0x56dbc8(0xe2)][0x0],_0x4b0d17=_0x2aae77[_0x56dbc8(0xe2)][0x1];if(!_0x26c0c4||_0x4b0d17===undefined)throw CliErrors[_0x56dbc8(0xf1)](_0x56dbc8(0x109),_0x56dbc8(0x11f)+CLI_BIN_NAME+_0x56dbc8(0xf2));if(ENUM_KEYS[_0x26c0c4]&&!ENUM_KEYS[_0x26c0c4][_0x56dbc8(0x11a)](_0x4b0d17))throw CliErrors[_0x56dbc8(0xf1)](_0x56dbc8(0xe8)+_0x26c0c4+_0x56dbc8(0x105)+ENUM_KEYS[_0x26c0c4][_0x56dbc8(0x119)](',\x20'));if(isCliProtectedConfigKey(_0x26c0c4))throw CliErrors[_0x56dbc8(0xf1)]('\x22'+_0x26c0c4+_0x56dbc8(0x10c));if(_0x26c0c4===_0x56dbc8(0xe7)){const _0x104ab6=Number(_0x4b0d17);if(isNaN(_0x104ab6)||_0x104ab6<=0x0)throw CliErrors[_0x56dbc8(0xf1)](_0x56dbc8(0xeb));}const _0xc76ca0=resolveWriteScope({'explicitGlobal':_0x2aae77['bool'](_0x56dbc8(0x121)),'policy':_0x56dbc8(0x11b)}),_0x80382=toScopeFlags(_0xc76ca0),_0x41724f=readScopedConfig(_0x80382),_0x3ddb31=parseAliasAppcodeSetKey(_0x26c0c4);if(!_0x3ddb31&&!isTopLevelConfigKey(_0x26c0c4))throw CliErrors[_0x56dbc8(0xf1)](_0x56dbc8(0x10f)+_0x26c0c4+_0x56dbc8(0xf7),'Settable\x20keys:\x20'+getTopLevelConfigKeySummary()+_0x56dbc8(0x104));if(_0x3ddb31)setLocalAppAlias(_0x41724f,_0x3ddb31,_0x4b0d17);else{if(_0x26c0c4===_0x56dbc8(0x108)){const _0x5bda75=normalizeLocale(_0x4b0d17);if(!_0x5bda75)throw CliErrors['validation'](_0x56dbc8(0x126),_0x56dbc8(0xfa));_0x41724f[_0x56dbc8(0x108)]=_0x5bda75;}else _0x41724f[_0x26c0c4]=_0x26c0c4===_0x56dbc8(0xe7)?Number(_0x4b0d17):DOMAIN_CONFIG_FIELDS[_0x56dbc8(0x11a)](_0x26c0c4)?normalizeDomainOrigin(_0x26c0c4,_0x4b0d17):_0x4b0d17;}const _0x224399=_0x26c0c4===_0x56dbc8(0x116)?maskCliAccessKey(_0x4b0d17):!_0x3ddb31&&_0x26c0c4===_0x56dbc8(0x108)?String(_0x41724f['locale']):_0x4b0d17;return console[_0x56dbc8(0x11e)](_0x56dbc8(0xed)+_0x26c0c4+_0x56dbc8(0x107)+_0x224399+'\x22'+(_0xc76ca0==='global'?_0x56dbc8(0x128):'')),writeScopedConfig(_0x41724f,_0x80382),{'ok':!![]};}},deleteDef={'service':'config','command':a23_0x436f04(0x113),'description':'Delete\x20a\x20configuration\x20value','risk':a23_0x436f04(0xee),'confirmationDescription':a23_0x436f04(0xdf),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a23_0x436f04(0x118),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_SCOPE_FLAG],async 'execute'(_0x1b3a18){const _0x3fb9fd=a23_0x436f04,_0x518050=_0x1b3a18[_0x3fb9fd(0xe2)][0x0];if(!_0x518050)throw CliErrors[_0x3fb9fd(0xf1)](_0x3fb9fd(0x10a),_0x3fb9fd(0x11f)+CLI_BIN_NAME+_0x3fb9fd(0xe4));if(isCliProtectedConfigKey(_0x518050))throw CliErrors[_0x3fb9fd(0xf1)]('\x22'+_0x518050+_0x3fb9fd(0x10c));const _0x4b7e32=resolveWriteScope({'explicitGlobal':_0x1b3a18[_0x3fb9fd(0xf0)](_0x3fb9fd(0x121)),'policy':_0x3fb9fd(0x11b)}),_0x148d6c=toScopeFlags(_0x4b7e32),_0x1c2d60=readScopedConfig(_0x148d6c),_0x3b94f1=parseAliasDeleteKey(_0x518050);if(_0x3b94f1){if(!deleteLocalAppAlias(_0x1c2d60,_0x3b94f1))return console[_0x3fb9fd(0x11e)](_0x3fb9fd(0xf9)+_0x518050+(_0x4b7e32===_0x3fb9fd(0x121)?_0x3fb9fd(0x128):'')),{'ok':!![],'data':{'key':_0x518050,'scope':_0x4b7e32,'changed':![]}};return console[_0x3fb9fd(0x11e)](_0x3fb9fd(0xf5)+_0x518050+'`'+(_0x4b7e32==='global'?'\x20(global)':'')),writeScopedConfig(_0x1c2d60,_0x148d6c),{'ok':!![],'data':{'key':_0x518050,'scope':_0x4b7e32,'changed':!![]}};}if(_0x1c2d60[_0x518050]===undefined)return console[_0x3fb9fd(0x11e)](_0x3fb9fd(0xf9)+_0x518050+(_0x4b7e32===_0x3fb9fd(0x121)?'\x20(global)':'')),{'ok':!![],'data':{'key':_0x518050,'scope':_0x4b7e32,'changed':![]}};return delete _0x1c2d60[_0x518050],console[_0x3fb9fd(0x11e)](_0x3fb9fd(0xf5)+_0x518050+'`'+(_0x4b7e32===_0x3fb9fd(0x121)?'\x20(global)':'')),writeScopedConfig(_0x1c2d60,_0x148d6c),{'ok':!![],'data':{'key':_0x518050,'scope':_0x4b7e32,'changed':!![]}};}};function a23_0x3a7e(_0xbf20d1,_0x7c209a){_0xbf20d1=_0xbf20d1-0xdf;const _0x5b94f5=a23_0x5b94();let _0x3a7e75=_0x5b94f5[_0xbf20d1];return _0x3a7e75;}export const configDefinitions=[configInitDefinition,listDef,getDef,setDef,deleteDef];
|
|
1
|
+
const a23_0x5a0eca=a23_0x1e21;(function(_0x5ee94e,_0x3a281d){const _0x1e570a=a23_0x1e21,_0x5460a9=_0x5ee94e();while(!![]){try{const _0x204d55=parseInt(_0x1e570a(0x170))/0x1*(-parseInt(_0x1e570a(0x134))/0x2)+parseInt(_0x1e570a(0x149))/0x3+-parseInt(_0x1e570a(0x148))/0x4*(parseInt(_0x1e570a(0x162))/0x5)+-parseInt(_0x1e570a(0x167))/0x6+parseInt(_0x1e570a(0x13c))/0x7*(parseInt(_0x1e570a(0x16e))/0x8)+-parseInt(_0x1e570a(0x14a))/0x9*(-parseInt(_0x1e570a(0x132))/0xa)+parseInt(_0x1e570a(0x139))/0xb*(parseInt(_0x1e570a(0x163))/0xc);if(_0x204d55===_0x3a281d)break;else _0x5460a9['push'](_0x5460a9['shift']());}catch(_0x428f51){_0x5460a9['push'](_0x5460a9['shift']());}}}(a23_0x5c57,0xb54ec));import{CliErrors}from'../../errors.js';function a23_0x5c57(){const _0x659f67=['get','1385834hDSHIv','Key\x20already\x20absent:\x20','validation','alias','Delete\x20a\x20configuration\x20value','11ATnlik','Set\x20`','set','158991fvUnCV','\x20(global)','log','apps','Get\x20a\x20config\x20value','(none)','join','list','args','bool','Config\x20files:\x0a','Deleted\x20`','21524zYptTD','2419785hallFi','9OtBMIu','\x22.\x20Allowed:\x20','value','config','\x20\x20global:\x20\x20','appcode','pageSize','includes','Invalid\x20value\x20for\x20\x22','Value\x20to\x20assign','object','write','Set\x20a\x20configuration\x20value','accessKey','List\x20current\x20config','delete','split','trim','key','Changes\x20Lovrabet\x20CLI\x20configuration.\x20Later\x20commands\x20may\x20use\x20a\x20different\x20app,\x20environment,\x20or\x20output\x20behavior.','pretty','global','\x22\x20is\x20protected\x20and\x20cannot\x20be\x20changed\x20via\x20config\x20commands.','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','695lRkQRb','23251764tATRGO',';\x20apps.<alias>.appcode','stringify','field','4747368uZvtoH','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','locale','isArray','read','\x20config\x20delete\x20<key>\x20[--global]','../../context.js','24qxcOrl','Key\x20not\x20found:\x20','1XvFpXe','Missing\x20key\x20argument.','`\x20=\x20\x22','\x20config\x20get\x20<key>','Deletes\x20a\x20Lovrabet\x20CLI\x20config\x20key.\x20Later\x20commands\x20will\x20fall\x20back\x20to\x20another\x20config\x20layer\x20or\x20the\x20default.','length','Usage:\x20','project-or-global-explicit','1623590LSJyZn'];a23_0x5c57=function(){return _0x659f67;};return a23_0x5c57();}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(_0x1f9d5e){const _0x3c06e0=a23_0x1e21,_0x67f9aa=_0x1f9d5e[_0x3c06e0(0x15a)]('.');if(_0x67f9aa[_0x3c06e0(0x12f)]!==0x3||_0x67f9aa[0x0]!=='apps'||_0x67f9aa[0x2]!==_0x3c06e0(0x14f))return undefined;const _0x489fb3=_0x67f9aa[0x1]?.['trim']();return _0x489fb3?_0x489fb3:undefined;}function a23_0x1e21(_0x4d78da,_0x1e7271){_0x4d78da=_0x4d78da-0x12b;const _0x5c577d=a23_0x5c57();let _0x1e21ef=_0x5c577d[_0x4d78da];return _0x1e21ef;}function parseAliasDeleteKey(_0x59e606){const _0x64e83c=a23_0x1e21,_0x156e9a=_0x59e606[_0x64e83c(0x15a)]('.');if(_0x156e9a['length']===0x2&&_0x156e9a[0x0]===_0x64e83c(0x13f)){const _0x1d7918=_0x156e9a[0x1]?.[_0x64e83c(0x15b)]();return _0x1d7918?{'alias':_0x1d7918}:undefined;}if(_0x156e9a[_0x64e83c(0x12f)]===0x3&&_0x156e9a[0x0]===_0x64e83c(0x13f)&&_0x156e9a[0x2]===_0x64e83c(0x14f)){const _0x3f0390=_0x156e9a[0x1]?.[_0x64e83c(0x15b)]();return _0x3f0390?{'alias':_0x3f0390,'field':_0x64e83c(0x14f)}:undefined;}return undefined;}function setLocalAppAlias(_0x1bea08,_0x5b8784,_0x51ea56){const _0x397d79=a23_0x1e21,_0xc5d93c=_0x1bea08[_0x397d79(0x13f)]&&typeof _0x1bea08[_0x397d79(0x13f)]===_0x397d79(0x154)&&!Array['isArray'](_0x1bea08['apps'])?_0x1bea08['apps']:{},_0x592365=_0xc5d93c[_0x5b8784]&&typeof _0xc5d93c[_0x5b8784]===_0x397d79(0x154)&&!Array[_0x397d79(0x16a)](_0xc5d93c[_0x5b8784])?_0xc5d93c[_0x5b8784]:{};_0x592365[_0x397d79(0x14f)]=_0x51ea56,_0xc5d93c[_0x5b8784]=_0x592365,_0x1bea08['apps']=_0xc5d93c;}function deleteLocalAppAlias(_0x52560d,_0x54ceb6){const _0x9cb0b8=a23_0x1e21;if(!_0x52560d['apps']||typeof _0x52560d[_0x9cb0b8(0x13f)]!==_0x9cb0b8(0x154)||Array[_0x9cb0b8(0x16a)](_0x52560d[_0x9cb0b8(0x13f)]))return![];const _0x33b513=_0x52560d[_0x9cb0b8(0x13f)],_0x476700=_0x33b513[_0x54ceb6[_0x9cb0b8(0x137)]];if(!_0x476700||typeof _0x476700!==_0x9cb0b8(0x154)||Array['isArray'](_0x476700))return![];if(!_0x54ceb6[_0x9cb0b8(0x166)])return delete _0x33b513[_0x54ceb6[_0x9cb0b8(0x137)]],!![];if(!(_0x54ceb6['field']in _0x476700))return![];return delete _0x476700[_0x54ceb6[_0x9cb0b8(0x166)]],Object['keys'](_0x476700)['length']===0x0&&delete _0x33b513[_0x54ceb6[_0x9cb0b8(0x137)]],!![];}const listDef={'service':a23_0x5a0eca(0x14d),'command':a23_0x5a0eca(0x143),'description':a23_0x5a0eca(0x158),'risk':a23_0x5a0eca(0x16b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x409e1d){const _0x4174cb=a23_0x5a0eca,{buildConfigFromFlags:_0x3d127f}=await import(_0x4174cb(0x16d)),_0x2c9de9=_0x3d127f({}),_0x55aa7d=redactCliConfigCredentials(_0x2c9de9['raw']),_0x2e6117=getProjectConfigPath(),_0x5a9eaf=resolveWriteConfigPath(_0x4174cb(0x15f));if(_0x409e1d['format']===_0x4174cb(0x15e))return{'ok':!![],'message':_0x4174cb(0x168)+(JSON[_0x4174cb(0x165)](_0x55aa7d,null,0x2)+'\x0a\x0a')+_0x4174cb(0x146)+('\x20\x20project:\x20'+(_0x2e6117??_0x4174cb(0x141))+'\x0a')+(_0x4174cb(0x14e)+_0x5a9eaf)};return{'ok':!![],'data':{'effective':_0x55aa7d,'configFiles':{'project':_0x2e6117??null,'global':_0x5a9eaf}}};}},getDef={'service':'config','command':a23_0x5a0eca(0x133),'description':a23_0x5a0eca(0x140),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a23_0x5a0eca(0x15c),'description':a23_0x5a0eca(0x161),'required':!![]}],'flags':[],async 'execute'(_0x5af49f){const _0x18e36e=a23_0x5a0eca,_0x48d399=_0x5af49f[_0x18e36e(0x144)][0x0];if(!_0x48d399)throw CliErrors['validation'](_0x18e36e(0x12b),_0x18e36e(0x130)+CLI_BIN_NAME+_0x18e36e(0x12d));const {buildConfigFromFlags:_0x1d660a}=await import(_0x18e36e(0x16d)),{raw:_0x4b76a7}=_0x1d660a({});if(_0x48d399[_0x18e36e(0x151)]('.')){const _0x51379f=_0x48d399[_0x18e36e(0x15a)]('.');let _0x5dfe5c=_0x4b76a7;for(const _0x32e41b of _0x51379f){if(_0x5dfe5c==null||typeof _0x5dfe5c!=='object')throw CliErrors[_0x18e36e(0x136)](_0x18e36e(0x16f)+_0x48d399);_0x5dfe5c=_0x5dfe5c[_0x32e41b];}if(_0x5dfe5c===undefined)throw CliErrors['validation'](_0x18e36e(0x16f)+_0x48d399);const _0x585735=redactCliConfigValue(_0x48d399,_0x5dfe5c);return console[_0x18e36e(0x13e)](typeof _0x585735===_0x18e36e(0x154)?JSON[_0x18e36e(0x165)](_0x585735,null,0x2):String(_0x585735)),{'ok':!![]};}const _0x1d62e0=_0x4b76a7[_0x48d399];if(_0x1d62e0===undefined)throw CliErrors[_0x18e36e(0x136)](_0x18e36e(0x16f)+_0x48d399);const _0x43178d=redactCliConfigValue(_0x48d399,_0x1d62e0);return console[_0x18e36e(0x13e)](typeof _0x43178d==='object'?JSON['stringify'](_0x43178d,null,0x2):String(_0x43178d)),{'ok':!![]};}},setDef={'service':a23_0x5a0eca(0x14d),'command':a23_0x5a0eca(0x13b),'description':a23_0x5a0eca(0x156),'risk':a23_0x5a0eca(0x155),'confirmationDescription':a23_0x5a0eca(0x15d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a23_0x5a0eca(0x15c),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a23_0x5a0eca(0x14c),'description':a23_0x5a0eca(0x153),'required':!![]}],'flags':[GLOBAL_SCOPE_FLAG],async 'execute'(_0x397d51){const _0x22795d=a23_0x5a0eca,_0x6a231a=_0x397d51[_0x22795d(0x144)][0x0],_0x3e4cf0=_0x397d51['args'][0x1];if(!_0x6a231a||_0x3e4cf0===undefined)throw CliErrors[_0x22795d(0x136)]('Missing\x20key\x20or\x20value.','Usage:\x20'+CLI_BIN_NAME+'\x20config\x20set\x20<key>\x20<value>\x20[--global]');if(ENUM_KEYS[_0x6a231a]&&!ENUM_KEYS[_0x6a231a][_0x22795d(0x151)](_0x3e4cf0))throw CliErrors[_0x22795d(0x136)](_0x22795d(0x152)+_0x6a231a+_0x22795d(0x14b)+ENUM_KEYS[_0x6a231a][_0x22795d(0x142)](',\x20'));if(isCliProtectedConfigKey(_0x6a231a))throw CliErrors['validation']('\x22'+_0x6a231a+'\x22\x20is\x20protected\x20and\x20cannot\x20be\x20changed\x20via\x20config\x20commands.');if(_0x6a231a===_0x22795d(0x150)){const _0x4edffa=Number(_0x3e4cf0);if(isNaN(_0x4edffa)||_0x4edffa<=0x0)throw CliErrors['validation']('pageSize\x20must\x20be\x20a\x20positive\x20number');}const _0x1dc6c9=resolveWriteScope({'explicitGlobal':_0x397d51['bool']('global'),'policy':_0x22795d(0x131)}),_0x3ae2ca=toScopeFlags(_0x1dc6c9),_0x93aabf=readScopedConfig(_0x3ae2ca),_0x551240=parseAliasAppcodeSetKey(_0x6a231a);if(!_0x551240&&!isTopLevelConfigKey(_0x6a231a))throw CliErrors[_0x22795d(0x136)]('Top-level\x20key\x20\x22'+_0x6a231a+'\x22\x20is\x20not\x20settable.','Settable\x20keys:\x20'+getTopLevelConfigKeySummary()+_0x22795d(0x164));if(_0x551240)setLocalAppAlias(_0x93aabf,_0x551240,_0x3e4cf0);else{if(_0x6a231a==='locale'){const _0x575b29=normalizeLocale(_0x3e4cf0);if(!_0x575b29)throw CliErrors['validation']('Invalid\x20locale\x20value.','Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US');_0x93aabf[_0x22795d(0x169)]=_0x575b29;}else _0x93aabf[_0x6a231a]=_0x6a231a===_0x22795d(0x150)?Number(_0x3e4cf0):DOMAIN_CONFIG_FIELDS[_0x22795d(0x151)](_0x6a231a)?normalizeDomainOrigin(_0x6a231a,_0x3e4cf0):_0x3e4cf0;}const _0x548bf7=_0x6a231a===_0x22795d(0x157)?maskCliAccessKey(_0x3e4cf0):!_0x551240&&_0x6a231a===_0x22795d(0x169)?String(_0x93aabf[_0x22795d(0x169)]):_0x3e4cf0;return console[_0x22795d(0x13e)](_0x22795d(0x13a)+_0x6a231a+_0x22795d(0x12c)+_0x548bf7+'\x22'+(_0x1dc6c9===_0x22795d(0x15f)?_0x22795d(0x13d):'')),writeScopedConfig(_0x93aabf,_0x3ae2ca),{'ok':!![]};}},deleteDef={'service':a23_0x5a0eca(0x14d),'command':a23_0x5a0eca(0x159),'description':a23_0x5a0eca(0x138),'risk':a23_0x5a0eca(0x155),'confirmationDescription':a23_0x5a0eca(0x12e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_SCOPE_FLAG],async 'execute'(_0x394480){const _0x14eedd=a23_0x5a0eca,_0x33accf=_0x394480[_0x14eedd(0x144)][0x0];if(!_0x33accf)throw CliErrors[_0x14eedd(0x136)]('Missing\x20key\x20argument.',_0x14eedd(0x130)+CLI_BIN_NAME+_0x14eedd(0x16c));if(isCliProtectedConfigKey(_0x33accf))throw CliErrors[_0x14eedd(0x136)]('\x22'+_0x33accf+_0x14eedd(0x160));const _0xc1a1ed=resolveWriteScope({'explicitGlobal':_0x394480[_0x14eedd(0x145)]('global'),'policy':'project-or-global-explicit'}),_0xead684=toScopeFlags(_0xc1a1ed),_0x479b7a=readScopedConfig(_0xead684),_0x57dc68=parseAliasDeleteKey(_0x33accf);if(_0x57dc68){if(!deleteLocalAppAlias(_0x479b7a,_0x57dc68))return console[_0x14eedd(0x13e)]('Key\x20already\x20absent:\x20'+_0x33accf+(_0xc1a1ed===_0x14eedd(0x15f)?'\x20(global)':'')),{'ok':!![],'data':{'key':_0x33accf,'scope':_0xc1a1ed,'changed':![]}};return console['log'](_0x14eedd(0x147)+_0x33accf+'`'+(_0xc1a1ed==='global'?_0x14eedd(0x13d):'')),writeScopedConfig(_0x479b7a,_0xead684),{'ok':!![],'data':{'key':_0x33accf,'scope':_0xc1a1ed,'changed':!![]}};}if(_0x479b7a[_0x33accf]===undefined)return console['log'](_0x14eedd(0x135)+_0x33accf+(_0xc1a1ed==='global'?_0x14eedd(0x13d):'')),{'ok':!![],'data':{'key':_0x33accf,'scope':_0xc1a1ed,'changed':![]}};return delete _0x479b7a[_0x33accf],console[_0x14eedd(0x13e)]('Deleted\x20`'+_0x33accf+'`'+(_0xc1a1ed===_0x14eedd(0x15f)?_0x14eedd(0x13d):'')),writeScopedConfig(_0x479b7a,_0xead684),{'ok':!![],'data':{'key':_0x33accf,'scope':_0xc1a1ed,'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<"
|
|
10
|
+
domains: Partial<Record<"runtimeDomain" | "userDomain" | "skillDomain" | "kbServiceDomain" | "apiDomain", string>>;
|
|
11
11
|
};
|
|
12
12
|
}>;
|
|
13
13
|
export declare const configInitDefinition: CommandDefinition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x2d1214=a24_0x446d;(function(_0x4dd4b3,_0x879558){const _0x5cbe0f=a24_0x446d,_0x56a96f=_0x4dd4b3();while(!![]){try{const _0x4aa230=-parseInt(_0x5cbe0f(0x186))/0x1*(-parseInt(_0x5cbe0f(0x193))/0x2)+parseInt(_0x5cbe0f(0x1a3))/0x3+parseInt(_0x5cbe0f(0x17b))/0x4*(-parseInt(_0x5cbe0f(0x187))/0x5)+parseInt(_0x5cbe0f(0x191))/0x6+-parseInt(_0x5cbe0f(0x184))/0x7+parseInt(_0x5cbe0f(0x176))/0x8+parseInt(_0x5cbe0f(0x18b))/0x9*(-parseInt(_0x5cbe0f(0x194))/0xa);if(_0x4aa230===_0x879558)break;else _0x56a96f['push'](_0x56a96f['shift']());}catch(_0x4e45e2){_0x56a96f['push'](_0x56a96f['shift']());}}}(a24_0x121f,0x72e2b));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';function a24_0x446d(_0x462cdd,_0x544d96){_0x462cdd=_0x462cdd-0x176;const _0x121fe2=a24_0x121f();let _0x446d93=_0x121fe2[_0x462cdd];return _0x446d93;}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_0x2d1214(0x188),'description':a24_0x2d1214(0x179)},{'name':a24_0x2d1214(0x1a2),'type':a24_0x2d1214(0x188),'description':'Custom\x20User\x20HTTPS\x20origin'},{'name':a24_0x2d1214(0x19e),'type':'string','description':a24_0x2d1214(0x17c)},{'name':a24_0x2d1214(0x182),'type':a24_0x2d1214(0x188),'description':a24_0x2d1214(0x185)},{'name':a24_0x2d1214(0x178),'type':'string','description':'Custom\x20SkillHub\x20HTTPS\x20origin'},{'name':'kb-service-domain','type':a24_0x2d1214(0x188),'description':a24_0x2d1214(0x195)}];export const configInitFlags=[{'name':a24_0x2d1214(0x18c),'type':a24_0x2d1214(0x188),'description':a24_0x2d1214(0x198)+ENABLED_LOVRABET_REGION_VALUES[a24_0x2d1214(0x17d)](',\x20'),'enum':[...ENABLED_LOVRABET_REGION_VALUES]},...domainFlags];async function resolveRegion(_0x136857){const _0x3d2a37=a24_0x2d1214,_0x45c625=_0x136857[_0x3d2a37(0x18f)]('region');if(_0x45c625){if(!isEnabledLovrabetRegion(_0x45c625))throw CliErrors['validation'](_0x3d2a37(0x17e)+_0x45c625+_0x3d2a37(0x19b),_0x3d2a37(0x196)+ENABLED_LOVRABET_REGION_VALUES[_0x3d2a37(0x17d)](',\x20'));return _0x45c625;}if(_0x136857[_0x3d2a37(0x180)])return DEFAULT_LOVRABET_REGION;try{return await select({'message':_0x3d2a37(0x17a),'default':DEFAULT_LOVRABET_REGION,'choices':ENABLED_LOVRABET_REGION_VALUES[_0x3d2a37(0x19d)](_0x353bd5=>({'name':OFFICIAL_ROUTING_PROFILES[_0x353bd5]['label']+'\x20('+_0x353bd5+')','value':_0x353bd5}))});}catch(_0x5a2d40){if(_0x5a2d40?.[_0x3d2a37(0x189)]===_0x3d2a37(0x197))throw CliErrors['cancelled']();throw _0x5a2d40;}}export async function executeConfigInit(_0x328653){const _0x3dc796=a24_0x2d1214,_0x2d7b86=resolveDomainConfigInput(_0x328653),_0x9f5ab1=_0x2d7b86[_0x3dc796(0x199)],_0x5ebc34=Object[_0x3dc796(0x1a4)](_0x9f5ab1)[_0x3dc796(0x190)]>0x0;if(_0x5ebc34&&_0x328653['str'](_0x3dc796(0x18c)))throw CliErrors[_0x3dc796(0x18a)](_0x3dc796(0x181));const _0x4e05a8={'global':!![]},_0x49790f=readScopedConfig(_0x4e05a8);for(const _0xd694b7 of DOMAIN_CONFIG_FIELDS)delete _0x49790f[_0xd694b7];for(const _0x9a695c of LEGACY_DOMAIN_CONFIG_FIELDS)delete _0x49790f[_0x9a695c];delete _0x49790f[_0x3dc796(0x18d)];let _0x2e4294=null;if(_0x5ebc34)delete _0x49790f['region'],_0x2d7b86[_0x3dc796(0x19c)]===_0x3dc796(0x177)?_0x49790f[_0x3dc796(0x18d)]={'protocol':ENTERPRISE_ROUTING_PROTOCOL,'kind':ENTERPRISE_ROUTING_KIND,'domains':_0x2d7b86[_0x3dc796(0x183)]}:Object[_0x3dc796(0x19a)](_0x49790f,_0x9f5ab1);else{_0x2e4294=await resolveRegion(_0x328653);if(_0x2e4294===DEFAULT_LOVRABET_REGION)delete _0x49790f[_0x3dc796(0x18c)];else _0x49790f[_0x3dc796(0x18c)]=_0x2e4294;}return writeScopedConfig(_0x49790f,_0x4e05a8),{'ok':!![],'message':_0x5ebc34?'Lovrabet\x20connection\x20configured\x20for\x20independent\x20deployment.\x20Domains:\x20'+Object[_0x3dc796(0x1a4)](_0x2d7b86[_0x3dc796(0x19c)]==='enterprise-v1'?_0x2d7b86[_0x3dc796(0x183)]:_0x9f5ab1)[_0x3dc796(0x17d)](',\x20')+'.':_0x3dc796(0x19f)+_0x2e4294+'.','data':{'mode':_0x5ebc34?_0x3dc796(0x17f):_0x3dc796(0x1a0),'protocol':_0x2d7b86[_0x3dc796(0x19c)]===_0x3dc796(0x177)?ENTERPRISE_ROUTING_PROTOCOL:undefined,'region':_0x2e4294,'domains':_0x9f5ab1}};}function a24_0x121f(){const _0x597a0d=['official','write','user-domain','797142bkWFhi','keys','1948528yQYNOi','enterprise-v1','skill-domain','Independent-deployment\x20Domain\x20JSON\x20file','Select\x20Lovrabet\x20region','56572FwBdNO','Custom\x20platform\x20API\x20HTTPS\x20origin','join','Region\x20\x22','independent','nonInteractive','Choose\x20either\x20an\x20official\x20region\x20or\x20independent-deployment\x20Domains,\x20not\x20both.','runtime-domain','manifestDomains','4626902sqGJfD','Custom\x20Runtime\x20HTTPS\x20origin','22769YEONzP','135DyQlOR','string','name','validation','39195rFNbze','region','routing','Updates\x20the\x20global\x20Lovrabet\x20region\x20or\x20independent-deployment\x20Domain\x20configuration.\x20AccessKey,\x20output\x20format,\x20and\x20app\x20bindings\x20stay\x20unchanged.','str','length','1289634aKFgBl','config','72GhltGt','70zzbzCD','Custom\x20KB\x20Service\x20HTTPS\x20origin','Available\x20regions:\x20','ExitPromptError','Official\x20Lovrabet\x20region:\x20','domains','assign','\x22\x20is\x20not\x20currently\x20available.','mode','map','api-domain','Lovrabet\x20connection\x20configured\x20for\x20region:\x20'];a24_0x121f=function(){return _0x597a0d;};return a24_0x121f();}export const configInitDefinition={'service':a24_0x2d1214(0x192),'command':'init','description':'Initialize\x20the\x20global\x20Lovrabet\x20region\x20or\x20independent-deployment\x20Domains','risk':a24_0x2d1214(0x1a1),'confirmationDescription':a24_0x2d1214(0x18e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':configInitFlags,'execute':executeConfigInit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a25_0x349e(_0x1b3655,_0x72e397){_0x1b3655=_0x1b3655-0x10a;var _0xe500d=a25_0xe500();var _0x349e71=_0xe500d[_0x1b3655];return _0x349e71;}(function(_0x5ef992,_0x10c071){var _0x5ba1ee=a25_0x349e,_0x1d48ac=_0x5ef992();while(!![]){try{var _0x23cf5f=parseInt(_0x5ba1ee(0x115))/0x1*(-parseInt(_0x5ba1ee(0x113))/0x2)+-parseInt(_0x5ba1ee(0x114))/0x3*(-parseInt(_0x5ba1ee(0x112))/0x4)+parseInt(_0x5ba1ee(0x10b))/0x5*(-parseInt(_0x5ba1ee(0x10e))/0x6)+-parseInt(_0x5ba1ee(0x10c))/0x7+parseInt(_0x5ba1ee(0x111))/0x8*(-parseInt(_0x5ba1ee(0x116))/0x9)+parseInt(_0x5ba1ee(0x10d))/0xa*(parseInt(_0x5ba1ee(0x110))/0xb)+-parseInt(_0x5ba1ee(0x10f))/0xc*(-parseInt(_0x5ba1ee(0x10a))/0xd);if(_0x23cf5f===_0x10c071)break;else _0x1d48ac['push'](_0x1d48ac['shift']());}catch(_0x3ee11c){_0x1d48ac['push'](_0x1d48ac['shift']());}}}(a25_0xe500,0x96a3f));import{CLI_BIN_NAME}from'../../constant/cli.js';export{CLI_BIN_NAME};function a25_0xe500(){var _0x163af9=['13904916lbpykI','165LEAssK','8GyeXpB','176aOPNLe','11734wrvVxb','13227KnUUHW','87HiFbhA','4379877NptOZt','26GXtBbu','1482780wSySVD','3922688ETRNNd','368450YiYtXA','18DMBsVF'];a25_0xe500=function(){return _0x163af9;};return a25_0xe500();}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_0x456257=a26_0x39f7;(function(_0x1cc9e7,_0x25ecaf){const _0x225c89=a26_0x39f7,_0x2e352f=_0x1cc9e7();while(!![]){try{const _0x54b7c6=parseInt(_0x225c89(0x195))/0x1+parseInt(_0x225c89(0x15f))/0x2*(parseInt(_0x225c89(0x19b))/0x3)+-parseInt(_0x225c89(0x156))/0x4*(-parseInt(_0x225c89(0x1a1))/0x5)+-parseInt(_0x225c89(0x14f))/0x6*(parseInt(_0x225c89(0x17e))/0x7)+parseInt(_0x225c89(0x1a0))/0x8*(-parseInt(_0x225c89(0x187))/0x9)+-parseInt(_0x225c89(0x172))/0xa*(-parseInt(_0x225c89(0x1a3))/0xb)+parseInt(_0x225c89(0x17a))/0xc*(parseInt(_0x225c89(0x155))/0xd);if(_0x54b7c6===_0x25ecaf)break;else _0x2e352f['push'](_0x2e352f['shift']());}catch(_0x13f1ab){_0x2e352f['push'](_0x2e352f['shift']());}}}(a26_0x23bb,0xa602f));import{readFile,realpath}from'node:fs/promises';import{resolve}from'node:path';import{CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,getDatasetImportContract,createDatasetImportBatch,readDatasetImportRows,readDatasetImportTaskRows,uploadDatasetImportImage,readDatasetImportImage}from'../../core/api-client.js';import{getRuntimeDomain}from'../../constant/domain.js';import{CliError,CliErrors}from'../../errors.js';function a26_0x23bb(){const _0x3a0cb9=['imageCells','.import-checkpoint.json','Source,\x20mapping,\x20checkpoint\x20and\x20report\x20must\x20be\x20different\x20files.','string','13FWRICH','28vIjZtS','Run\x20dataset\x20detail\x20to\x20confirm\x20the\x20source.\x20Only\x20DB_TABLE\x20has\x20the\x20documented\x20alternative\x20batchCreate\x20route;\x20do\x20not\x20guess\x20or\x20automatically\x20switch\x20APIs.','utf8','str','header-row','length','DB_TABLE\x20datasets\x20use\x20the\x20existing\x20batchCreate\x20operation;\x20import-excel\x20only\x20supports\x20METADATA\x20datasets.','validation','DB_TABLE','107206nYaCNf','Inspect\x20lovrabet\x20dataset\x20detail\x20--code\x20','max','schemaFingerprint','Maximum\x20records\x20per\x20request\x20(1..500)','num','bool','maxBatchSize','Mapping\x20file\x20exceeds\x201\x20MB.','file','Creates\x20real\x20dataset\x20records\x20immediately.\x20Keep\x20the\x20checkpoint\x20to\x20reconcile\x20and\x20resume\x20interrupted\x20imports.','batch-size','map','.rows.json','size','Worksheet\x20name\x20or\x201-based\x20index\x20(default:\x20first\x20worksheet)','all','toString','imageFields','134830Wbuizy','boolean','message','Local\x20Excel\x20validation\x20only;\x20no\x20records\x20or\x20checkpoint\x20were\x20written.','Excel\x20import\x20failed.','write','\x20--code\x20','code','11181684yUCFLc','errors','METADATA','JSON\x20file\x20mapping\x20Excel\x20headers\x20to\x20dataset\x20field\x20codes','5169724NGcsjO','some','import-excel','.lock.recovery','rows','/import-batch','isArray','--file\x20and\x20--mapping\x20are\x20required.','appCode','110241bFKIHK','mappingFile','warnings','Batch\x20size\x20exceeds\x20the\x20server\x20import\x20contract.','/client/','resume','\x20--params\x20\x27<JSON\x20array>\x27\x20--dry-run\x20using\x20the\x20target\x20app\x27s\x20User\x20AK\x20and\x20runtime\x20permissions.\x20Dry-run\x20only\x20previews\x20the\x20request;\x20verify\x20written\x20rows\x20before\x20advancing\x20and\x20reconcile\x20unknown\x20outcomes\x20before\x20retrying.\x20This\x20DB_TABLE\x20route\x20does\x20not\x20support\x20import\x20checkpoints\x20or\x20--resume.\x20See\x20references/lovrabet-db-table-excel-import.md\x20in\x20the\x20built-in\x20Skill.\x20No\x20import\x20request\x20was\x20sent.','\x20invalid\x20cells.\x20No\x20records\x20were\x20written.','values','Imported\x20and\x20verified\x20','mapping','See\x20','Mapping\x20file\x20must\x20contain\x20valid\x20JSON.','invalid','227792wavWcE','media','report','Reconcile\x20imported\x20records\x20and\x20resume\x20the\x20exact\x20original\x20file,\x20target\x20and\x20mapping','number','batchSize','21tFwniS','object','data','.import-report.json','isInteger','608FplIlN','235165WXUrBV','rowNumber','396SzKhmd','checkpoint','Dataset\x20source\x20is\x20missing\x20or\x20unsupported;\x20import-excel\x20requires\x20METADATA.','parse','sheet','6hfDvRK','Import\x20one\x20XLSX\x20worksheet\x20into\x20METADATA\x20with\x20checkpoint\x20recovery.\x20DB_TABLE\x20uses\x20lovrabet\x20data\x20batchCreate\x20after\x20mapping\x20and\x20validation;\x20that\x20route\x20has\x20no\x20import\x20checkpoint\x20or\x20--resume.'];a26_0x23bb=function(){return _0x3a0cb9;};return a26_0x23bb();}import{buildExcelManifest,normalizeImportFields}from'../../services/dataset-import/excel-reader.js';import{assertImportContract,assertImportPaths,runExcelImport,saveImportJson,resolveImportOutputPath}from'../../services/dataset-import/runner.js';import{assertDatasetImportTarget}from'../../services/dataset-import/metadata.js';import{runAutoIdExcelImport}from'../../services/dataset-import/auto-id-runner.js';import{assertImageImportCapability,runImageExcelImport}from'../../services/dataset-import/image-runner.js';import{previewImportBatchCount}from'../../services/dataset-import/preview.js';function input(_0x449143){const _0x4afc2c=a26_0x39f7,_0x21fea8=_0x449143['str']('file'),_0x1efd8b=_0x449143[_0x4afc2c(0x159)](_0x4afc2c(0x191));if(!_0x21fea8||!_0x1efd8b)throw CliErrors[_0x4afc2c(0x15d)](_0x4afc2c(0x185));const _0x4273f0=_0x449143[_0x4afc2c(0x164)](_0x4afc2c(0x15a),0x1),_0x405d45=_0x449143[_0x4afc2c(0x164)](_0x4afc2c(0x16a),0x1f4);if(!Number[_0x4afc2c(0x19f)](_0x4273f0)||_0x4273f0<0x1||!Number[_0x4afc2c(0x19f)](_0x405d45)||_0x405d45<0x1||_0x405d45>0x1f4)throw CliErrors[_0x4afc2c(0x15d)]('Header\x20row\x20must\x20be\x20positive\x20and\x20batch\x20size\x20must\x20be\x20between\x201\x20and\x20500.');const _0x4767c4=resolve(_0x449143[_0x4afc2c(0x159)]('checkpoint')||_0x21fea8+_0x4afc2c(0x152)),_0x24ff11=resolve(_0x449143[_0x4afc2c(0x159)](_0x4afc2c(0x197))||_0x21fea8+_0x4afc2c(0x19e)),_0x7cd97f=[resolve(_0x21fea8),resolve(_0x1efd8b),_0x4767c4,_0x24ff11];if(new Set(_0x7cd97f)[_0x4afc2c(0x16d)]!==_0x7cd97f[_0x4afc2c(0x15b)])throw CliErrors[_0x4afc2c(0x15d)](_0x4afc2c(0x153));return{'file':resolve(_0x21fea8),'mappingFile':resolve(_0x1efd8b),'headerRow':_0x4273f0,'batchSize':_0x405d45,'checkpoint':_0x4767c4,'report':_0x24ff11,'sheet':_0x449143['str']('sheet')||undefined,'resume':_0x449143[_0x4afc2c(0x165)](_0x4afc2c(0x18c))};}async function prepare(_0x40b7eb){const _0x5c9a47=a26_0x39f7,_0x2ac613=input(_0x40b7eb),_0x96073b=_0x40b7eb[_0x5c9a47(0x159)](_0x5c9a47(0x179));[_0x2ac613[_0x5c9a47(0x168)],_0x2ac613[_0x5c9a47(0x188)],_0x2ac613['checkpoint'],_0x2ac613[_0x5c9a47(0x197)]]=await Promise[_0x5c9a47(0x16f)]([realpath(_0x2ac613[_0x5c9a47(0x168)]),realpath(_0x2ac613['mappingFile']),resolveImportOutputPath(_0x2ac613[_0x5c9a47(0x14b)]),resolveImportOutputPath(_0x2ac613[_0x5c9a47(0x197)])]),assertImportPaths(_0x2ac613[_0x5c9a47(0x14b)],_0x2ac613['report'],[_0x2ac613[_0x5c9a47(0x168)],_0x2ac613['mappingFile']]);let _0x49f394;const _0x19f9ef=await readFile(_0x2ac613[_0x5c9a47(0x188)]);if(_0x19f9ef[_0x5c9a47(0x15b)]>0x400*0x400)throw CliErrors[_0x5c9a47(0x15d)](_0x5c9a47(0x167));try{_0x49f394=JSON[_0x5c9a47(0x14d)](_0x19f9ef[_0x5c9a47(0x170)](_0x5c9a47(0x158)));}catch{throw CliErrors[_0x5c9a47(0x15d)](_0x5c9a47(0x193));}if(!_0x49f394||typeof _0x49f394!==_0x5c9a47(0x19c)||Array[_0x5c9a47(0x184)](_0x49f394)||Object[_0x5c9a47(0x18f)](_0x49f394)[_0x5c9a47(0x17f)](_0x1413b8=>typeof _0x1413b8!==_0x5c9a47(0x154)))throw CliErrors[_0x5c9a47(0x15d)]('Mapping\x20must\x20be\x20an\x20object\x20from\x20Excel\x20headers\x20to\x20field\x20codes.');const _0xd59702=await getDatasetDetail(_0x96073b),_0x427eea=assertDatasetImportTarget(_0xd59702,_0x40b7eb[_0x5c9a47(0x186)],_0x96073b);if(_0x427eea===_0x5c9a47(0x15e))throw CliErrors[_0x5c9a47(0x15d)](_0x5c9a47(0x15c),_0x5c9a47(0x160)+_0x96073b+'.\x20Validate\x20fields\x20and\x20confirmed\x20unique\x20business\x20keys,\x20convert\x20Excel\x20rows\x20to\x20JSON,\x20and\x20split\x20within\x20the\x20target\x20API\x20row/byte\x20limits.\x20Preview\x20one\x20batch\x20with\x20lovrabet\x20data\x20batchCreate\x20--appcode\x20'+_0x40b7eb[_0x5c9a47(0x186)]+_0x5c9a47(0x178)+_0x96073b+_0x5c9a47(0x18d));if(_0x427eea!==_0x5c9a47(0x17c))throw CliErrors[_0x5c9a47(0x15d)](_0x5c9a47(0x14c),_0x5c9a47(0x157));const _0x1ee537=await buildExcelManifest({..._0x2ac613,'mapping':_0x49f394,'fields':normalizeImportFields(_0xd59702)}),_0x39e3ae=await getDatasetImportContract(_0x40b7eb[_0x5c9a47(0x186)],_0x96073b);assertImportContract(_0x39e3ae,_0x40b7eb[_0x5c9a47(0x186)],_0x96073b),assertImageImportCapability(_0x39e3ae,_0x1ee537);if(_0x1ee537['imageFields']?.[_0x5c9a47(0x15b)]){const _0xebddc6=await resolveImportOutputPath(_0x2ac613[_0x5c9a47(0x14b)]+_0x5c9a47(0x16c)),_0xdd31f0=await Promise[_0x5c9a47(0x16f)]([_0xebddc6,_0xebddc6+'.lock',_0xebddc6+_0x5c9a47(0x181),_0x2ac613['checkpoint']+'.lock',_0x2ac613[_0x5c9a47(0x14b)]+_0x5c9a47(0x181)][_0x5c9a47(0x16b)](resolveImportOutputPath));assertImportPaths(_0x2ac613['checkpoint'],_0x2ac613['report'],[_0x2ac613[_0x5c9a47(0x168)],_0x2ac613[_0x5c9a47(0x188)],..._0xdd31f0['slice'](0x0,0x3)]);}if(_0x2ac613['batchSize']>_0x39e3ae[_0x5c9a47(0x166)])throw CliErrors['validation'](_0x5c9a47(0x18a));return{'args':_0x2ac613,'manifest':_0x1ee537,'contract':_0x39e3ae,'code':_0x96073b};}function a26_0x39f7(_0x9d502f,_0x2d8ce6){_0x9d502f=_0x9d502f-0x14b;const _0x23bb98=a26_0x23bb();let _0x39f7ef=_0x23bb98[_0x9d502f];return _0x39f7ef;}async function checked(_0x1ccc12){const _0x3bca61=a26_0x39f7;try{return await _0x1ccc12();}catch(_0x55eecf){if(_0x55eecf instanceof CliError)throw _0x55eecf;throw CliErrors[_0x3bca61(0x15d)](_0x55eecf[_0x3bca61(0x174)]||_0x3bca61(0x176));}}export const dataImportExcel={'service':a26_0x456257(0x19d),'command':a26_0x456257(0x180),'risk':a26_0x456257(0x177),'description':a26_0x456257(0x150),'confirmationDescription':a26_0x456257(0x169),'flags':[CODE_FLAG,{'name':a26_0x456257(0x168),'type':a26_0x456257(0x154),'required':!![],'description':'Local\x20XLSX\x20file\x20(maximum\x2020\x20MB)'},{'name':a26_0x456257(0x191),'type':a26_0x456257(0x154),'required':!![],'description':a26_0x456257(0x17d)},{'name':a26_0x456257(0x14e),'type':a26_0x456257(0x154),'description':a26_0x456257(0x16e)},{'name':a26_0x456257(0x15a),'type':'number','default':0x1,'description':'1-based\x20Excel\x20header\x20row'},{'name':a26_0x456257(0x16a),'type':a26_0x456257(0x199),'default':0x1f4,'description':a26_0x456257(0x163)},{'name':'checkpoint','type':a26_0x456257(0x154),'description':'Private\x20checkpoint\x20file\x20(default:\x20XLSX\x20path\x20plus\x20.import-checkpoint.json)'},{'name':a26_0x456257(0x197),'type':a26_0x456257(0x154),'description':'Private\x20result\x20report\x20(default:\x20XLSX\x20path\x20plus\x20.import-report.json)'},{'name':a26_0x456257(0x18c),'type':a26_0x456257(0x173),'description':a26_0x456257(0x198)}],'validate':async _0x5087e5=>{input(_0x5087e5);},'dryRun':async _0x406768=>checked(async()=>{const _0x377dc9=a26_0x456257,{args:_0x2b18c2,manifest:_0x54200c,contract:_0x5146ed,code:_0x23e67d}=await prepare(_0x406768),_0x2f6115=new Set(_0x54200c[_0x377dc9(0x17b)][_0x377dc9(0x16b)](_0x4ffd89=>_0x4ffd89[_0x377dc9(0x1a2)]))['size'];return{'method':'POST','url':_0x377dc9(0x18b)+encodeURIComponent(_0x406768['appCode'])+'/'+encodeURIComponent(_0x23e67d)+_0x377dc9(0x183),'description':_0x377dc9(0x175),'body':{'schemaFingerprint':_0x5146ed['schemaFingerprint']},'validRows':Math[_0x377dc9(0x161)](0x0,_0x54200c[_0x377dc9(0x182)]['length']-_0x2f6115),'invalidRows':_0x2f6115,'invalidCells':_0x54200c[_0x377dc9(0x17b)]['length'],'emptyRows':_0x54200c['emptyRows'][_0x377dc9(0x15b)],'expectedBatches':previewImportBatchCount(_0x54200c,_0x5146ed,_0x2b18c2[_0x377dc9(0x19a)]),'imageCount':_0x54200c[_0x377dc9(0x151)]?.['reduce']((_0xa980f8,_0x5c0cd2)=>_0xa980f8+_0x5c0cd2['hashes']['length'],0x0)??0x0,'uniqueImages':_0x54200c[_0x377dc9(0x196)]?.[_0x377dc9(0x15b)]??0x0,'uniqueImageBytes':_0x54200c[_0x377dc9(0x196)]?.['reduce']((_0x25a28c,_0x1a0e0f)=>_0x25a28c+_0x1a0e0f[_0x377dc9(0x16d)],0x0)??0x0,'errors':_0x54200c['errors'],'warnings':_0x54200c[_0x377dc9(0x189)],'sheet':_0x54200c['sheet'],'checkpoint':_0x2b18c2[_0x377dc9(0x14b)],'report':_0x2b18c2['report']};}),'execute':async _0x55bbda=>checked(async()=>{const _0x4ce399=a26_0x456257,{args:_0x188346,manifest:_0x1c82ec,contract:_0xc30997,code:_0xe9db8}=await prepare(_0x55bbda);if(_0x1c82ec[_0x4ce399(0x17b)][_0x4ce399(0x15b)]){await saveImportJson(_0x188346[_0x4ce399(0x197)],{'status':_0x4ce399(0x194),'sourceRows':_0x1c82ec['rows'][_0x4ce399(0x15b)],'errors':_0x1c82ec[_0x4ce399(0x17b)],'emptyRows':_0x1c82ec['emptyRows'],'warnings':_0x1c82ec[_0x4ce399(0x189)]});throw CliErrors[_0x4ce399(0x15d)]('Excel\x20contains\x20'+_0x1c82ec['errors'][_0x4ce399(0x15b)]+_0x4ce399(0x18e),_0x4ce399(0x192)+_0x188346[_0x4ce399(0x197)]+'.');}const _0x965246=_0x1c82ec[_0x4ce399(0x171)]?.['length']?runImageExcelImport:_0xc30997['schemaVersion']===0x2?runAutoIdExcelImport:runExcelImport,_0x512ccd=await _0x965246({..._0x188346,'manifest':_0x1c82ec,'contract':_0xc30997,'appCode':_0x55bbda['appCode'],'datasetCode':_0xe9db8,'runtimeDomain':getRuntimeDomain(),'inputPaths':[_0x188346[_0x4ce399(0x168)],_0x188346['mappingFile']],'imageApi':{'upload':(_0x209edf,_0x13077b)=>uploadDatasetImportImage(_0x55bbda[_0x4ce399(0x186)],_0xe9db8,_0x209edf,_0x13077b),'readback':(_0x24fdb5,_0x4c4453)=>readDatasetImportImage(_0x55bbda[_0x4ce399(0x186)],_0xe9db8,_0x24fdb5,_0x4c4453)},'api':{'write':(_0x50df94,_0x285e8a)=>createDatasetImportBatch(_0x55bbda[_0x4ce399(0x186)],_0xe9db8,{'schemaFingerprint':_0xc30997[_0x4ce399(0x162)],'items':_0x50df94,..._0x285e8a===undefined?{}:{'taskId':_0x285e8a}}),'readback':_0x58ac32=>readDatasetImportRows(_0x55bbda[_0x4ce399(0x186)],_0xe9db8,_0x58ac32),'readTask':_0x5ed461=>readDatasetImportTaskRows(_0x55bbda[_0x4ce399(0x186)],_0xe9db8,_0x5ed461)}});return{'ok':!![],'data':_0x512ccd,'message':_0x4ce399(0x190)+_0x512ccd['succeeded']+'\x20records.'};})};
|
|
1
|
+
const a26_0x34f2f3=a26_0x39c2;(function(_0xc9922f,_0x237de7){const _0x528a99=a26_0x39c2,_0x25652c=_0xc9922f();while(!![]){try{const _0x863589=-parseInt(_0x528a99(0xf0))/0x1*(parseInt(_0x528a99(0x112))/0x2)+-parseInt(_0x528a99(0x126))/0x3*(-parseInt(_0x528a99(0x119))/0x4)+-parseInt(_0x528a99(0x13e))/0x5*(parseInt(_0x528a99(0x12f))/0x6)+-parseInt(_0x528a99(0x12b))/0x7*(parseInt(_0x528a99(0x13c))/0x8)+-parseInt(_0x528a99(0x12c))/0x9+-parseInt(_0x528a99(0xef))/0xa*(parseInt(_0x528a99(0xeb))/0xb)+parseInt(_0x528a99(0x122))/0xc*(parseInt(_0x528a99(0x115))/0xd);if(_0x863589===_0x237de7)break;else _0x25652c['push'](_0x25652c['shift']());}catch(_0x14f80b){_0x25652c['push'](_0x25652c['shift']());}}}(a26_0x1023,0x7fef9));import{readFile,realpath}from'node:fs/promises';import{resolve}from'node:path';import{CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,getDatasetImportContract,createDatasetImportBatch,readDatasetImportRows,readDatasetImportTaskRows,uploadDatasetImportImage,readDatasetImportImage}from'../../core/api-client.js';import{getRuntimeDomain}from'../../constant/domain.js';import{CliError,CliErrors}from'../../errors.js';function a26_0x1023(){const _0x62ea57=['/import-batch','15924IUHhnA','schemaVersion','See\x20','imageCells','rows','560896AqQrcX','3052368BDopkR','number','Run\x20dataset\x20detail\x20to\x20confirm\x20the\x20source.\x20Only\x20DB_TABLE\x20has\x20the\x20documented\x20alternative\x20batchCreate\x20route;\x20do\x20not\x20guess\x20or\x20automatically\x20switch\x20APIs.','630viaaBv','reduce','Mapping\x20file\x20must\x20contain\x20valid\x20JSON.','mappingFile','/client/','resume','mapping','sheet','errors','boolean','code','message','.lock.recovery','80ljnLSZ','some','28090irnKVS','Source,\x20mapping,\x20checkpoint\x20and\x20report\x20must\x20be\x20different\x20files.','Imported\x20and\x20verified\x20','Local\x20Excel\x20validation\x20only;\x20no\x20records\x20or\x20checkpoint\x20were\x20written.','POST','Import\x20one\x20XLSX\x20worksheet\x20into\x20METADATA\x20with\x20checkpoint\x20recovery.\x20DB_TABLE\x20uses\x20lovrabet\x20data\x20batchCreate\x20after\x20mapping\x20and\x20validation;\x20that\x20route\x20has\x20no\x20import\x20checkpoint\x20or\x20--resume.','hashes','11HLdHbQ','Header\x20row\x20must\x20be\x20positive\x20and\x20batch\x20size\x20must\x20be\x20between\x201\x20and\x20500.','succeeded','appCode','5061510TrXIQl','447243KWeOZr','isArray','\x20--code\x20','parse','batchSize','bool','--file\x20and\x20--mapping\x20are\x20required.','max','Private\x20result\x20report\x20(default:\x20XLSX\x20path\x20plus\x20.import-report.json)','.\x20Validate\x20fields\x20and\x20confirmed\x20unique\x20business\x20keys,\x20convert\x20Excel\x20rows\x20to\x20JSON,\x20and\x20split\x20within\x20the\x20target\x20API\x20row/byte\x20limits.\x20Preview\x20one\x20batch\x20with\x20lovrabet\x20data\x20batchCreate\x20--appcode\x20','JSON\x20file\x20mapping\x20Excel\x20headers\x20to\x20dataset\x20field\x20codes','map','Creates\x20real\x20dataset\x20records\x20immediately.\x20Keep\x20the\x20checkpoint\x20to\x20reconcile\x20and\x20resume\x20interrupted\x20imports.','all','Excel\x20contains\x20','Dataset\x20source\x20is\x20missing\x20or\x20unsupported;\x20import-excel\x20requires\x20METADATA.','Private\x20checkpoint\x20file\x20(default:\x20XLSX\x20path\x20plus\x20.import-checkpoint.json)','schemaFingerprint','Batch\x20size\x20exceeds\x20the\x20server\x20import\x20contract.','.lock','slice','report','Mapping\x20file\x20exceeds\x201\x20MB.','validation','imageFields','Mapping\x20must\x20be\x20an\x20object\x20from\x20Excel\x20headers\x20to\x20field\x20codes.','data','media','checkpoint','warnings','file','header-row','str','Excel\x20import\x20failed.','2uyHrrE','size','emptyRows','91THWbfu','rowNumber','.rows.json','.import-report.json','416iZejNR','DB_TABLE\x20datasets\x20use\x20the\x20existing\x20batchCreate\x20operation;\x20import-excel\x20only\x20supports\x20METADATA\x20datasets.','isInteger','METADATA','string','values','batch-size','num','Maximum\x20records\x20per\x20request\x20(1..500)','4552644CDYslI','length','object'];a26_0x1023=function(){return _0x62ea57;};return a26_0x1023();}import{buildExcelManifest,normalizeImportFields}from'../../services/dataset-import/excel-reader.js';import{assertImportContract,assertImportPaths,runExcelImport,saveImportJson,resolveImportOutputPath}from'../../services/dataset-import/runner.js';import{assertDatasetImportTarget}from'../../services/dataset-import/metadata.js';import{runAutoIdExcelImport}from'../../services/dataset-import/auto-id-runner.js';import{assertImageImportCapability,runImageExcelImport}from'../../services/dataset-import/image-runner.js';import{previewImportBatchCount}from'../../services/dataset-import/preview.js';function a26_0x39c2(_0x568197,_0x552e0f){_0x568197=_0x568197-0xe7;const _0x1023e7=a26_0x1023();let _0x39c27d=_0x1023e7[_0x568197];return _0x39c27d;}function input(_0x22769c){const _0x4331b1=a26_0x39c2,_0x1e6dbf=_0x22769c[_0x4331b1(0x110)]('file'),_0x215a27=_0x22769c[_0x4331b1(0x110)](_0x4331b1(0x135));if(!_0x1e6dbf||!_0x215a27)throw CliErrors[_0x4331b1(0x107)](_0x4331b1(0xf6));const _0x41234a=_0x22769c[_0x4331b1(0x120)](_0x4331b1(0x10f),0x1),_0x4ef144=_0x22769c[_0x4331b1(0x120)](_0x4331b1(0x11f),0x1f4);if(!Number['isInteger'](_0x41234a)||_0x41234a<0x1||!Number[_0x4331b1(0x11b)](_0x4ef144)||_0x4ef144<0x1||_0x4ef144>0x1f4)throw CliErrors[_0x4331b1(0x107)](_0x4331b1(0xec));const _0x210a45=resolve(_0x22769c['str'](_0x4331b1(0x10c))||_0x1e6dbf+'.import-checkpoint.json'),_0x40b115=resolve(_0x22769c[_0x4331b1(0x110)](_0x4331b1(0x105))||_0x1e6dbf+_0x4331b1(0x118)),_0x502c97=[resolve(_0x1e6dbf),resolve(_0x215a27),_0x210a45,_0x40b115];if(new Set(_0x502c97)['size']!==_0x502c97[_0x4331b1(0x123)])throw CliErrors['validation'](_0x4331b1(0x13f));return{'file':resolve(_0x1e6dbf),'mappingFile':resolve(_0x215a27),'headerRow':_0x41234a,'batchSize':_0x4ef144,'checkpoint':_0x210a45,'report':_0x40b115,'sheet':_0x22769c[_0x4331b1(0x110)]('sheet')||undefined,'resume':_0x22769c[_0x4331b1(0xf5)](_0x4331b1(0x134))};}async function prepare(_0x24401c){const _0x54dfbc=a26_0x39c2,_0x4ce534=input(_0x24401c),_0x2c7c32=_0x24401c[_0x54dfbc(0x110)](_0x54dfbc(0x139));[_0x4ce534[_0x54dfbc(0x10e)],_0x4ce534[_0x54dfbc(0x132)],_0x4ce534[_0x54dfbc(0x10c)],_0x4ce534['report']]=await Promise[_0x54dfbc(0xfd)]([realpath(_0x4ce534[_0x54dfbc(0x10e)]),realpath(_0x4ce534[_0x54dfbc(0x132)]),resolveImportOutputPath(_0x4ce534[_0x54dfbc(0x10c)]),resolveImportOutputPath(_0x4ce534[_0x54dfbc(0x105)])]),assertImportPaths(_0x4ce534['checkpoint'],_0x4ce534[_0x54dfbc(0x105)],[_0x4ce534['file'],_0x4ce534['mappingFile']]);let _0x28ec79;const _0x51c0de=await readFile(_0x4ce534['mappingFile']);if(_0x51c0de['length']>0x400*0x400)throw CliErrors[_0x54dfbc(0x107)](_0x54dfbc(0x106));try{_0x28ec79=JSON[_0x54dfbc(0xf3)](_0x51c0de['toString']('utf8'));}catch{throw CliErrors[_0x54dfbc(0x107)](_0x54dfbc(0x131));}if(!_0x28ec79||typeof _0x28ec79!==_0x54dfbc(0x124)||Array[_0x54dfbc(0xf1)](_0x28ec79)||Object[_0x54dfbc(0x11e)](_0x28ec79)[_0x54dfbc(0x13d)](_0x38c654=>typeof _0x38c654!=='string'))throw CliErrors[_0x54dfbc(0x107)](_0x54dfbc(0x109));const _0x50f870=await getDatasetDetail(_0x2c7c32),_0x46edd6=assertDatasetImportTarget(_0x50f870,_0x24401c['appCode'],_0x2c7c32);if(_0x46edd6==='DB_TABLE')throw CliErrors[_0x54dfbc(0x107)](_0x54dfbc(0x11a),'Inspect\x20lovrabet\x20dataset\x20detail\x20--code\x20'+_0x2c7c32+_0x54dfbc(0xf9)+_0x24401c[_0x54dfbc(0xee)]+_0x54dfbc(0xf2)+_0x2c7c32+'\x20--params\x20\x27<JSON\x20array>\x27\x20--dry-run\x20using\x20the\x20target\x20app\x27s\x20User\x20AK\x20and\x20runtime\x20permissions.\x20Dry-run\x20only\x20previews\x20the\x20request;\x20verify\x20written\x20rows\x20before\x20advancing\x20and\x20reconcile\x20unknown\x20outcomes\x20before\x20retrying.\x20This\x20DB_TABLE\x20route\x20does\x20not\x20support\x20import\x20checkpoints\x20or\x20--resume.\x20See\x20references/lovrabet-db-table-excel-import.md\x20in\x20the\x20built-in\x20Skill.\x20No\x20import\x20request\x20was\x20sent.');if(_0x46edd6!==_0x54dfbc(0x11c))throw CliErrors['validation'](_0x54dfbc(0xff),_0x54dfbc(0x12e));const _0x351b71=await buildExcelManifest({..._0x4ce534,'mapping':_0x28ec79,'fields':normalizeImportFields(_0x50f870)}),_0x494222=await getDatasetImportContract(_0x24401c[_0x54dfbc(0xee)],_0x2c7c32);assertImportContract(_0x494222,_0x24401c['appCode'],_0x2c7c32),assertImageImportCapability(_0x494222,_0x351b71);if(_0x351b71[_0x54dfbc(0x108)]?.[_0x54dfbc(0x123)]){const _0x3eaf78=await resolveImportOutputPath(_0x4ce534[_0x54dfbc(0x10c)]+_0x54dfbc(0x117)),_0x48ec49=await Promise['all']([_0x3eaf78,_0x3eaf78+_0x54dfbc(0x103),_0x3eaf78+_0x54dfbc(0x13b),_0x4ce534[_0x54dfbc(0x10c)]+_0x54dfbc(0x103),_0x4ce534[_0x54dfbc(0x10c)]+'.lock.recovery'][_0x54dfbc(0xfb)](resolveImportOutputPath));assertImportPaths(_0x4ce534['checkpoint'],_0x4ce534[_0x54dfbc(0x105)],[_0x4ce534[_0x54dfbc(0x10e)],_0x4ce534[_0x54dfbc(0x132)],..._0x48ec49[_0x54dfbc(0x104)](0x0,0x3)]);}if(_0x4ce534[_0x54dfbc(0xf4)]>_0x494222['maxBatchSize'])throw CliErrors[_0x54dfbc(0x107)](_0x54dfbc(0x102));return{'args':_0x4ce534,'manifest':_0x351b71,'contract':_0x494222,'code':_0x2c7c32};}async function checked(_0x5b8c6e){const _0x59729a=a26_0x39c2;try{return await _0x5b8c6e();}catch(_0x383ef2){if(_0x383ef2 instanceof CliError)throw _0x383ef2;throw CliErrors['validation'](_0x383ef2[_0x59729a(0x13a)]||_0x59729a(0x111));}}export const dataImportExcel={'service':a26_0x34f2f3(0x10a),'command':'import-excel','risk':'write','description':a26_0x34f2f3(0xe9),'confirmationDescription':a26_0x34f2f3(0xfc),'flags':[CODE_FLAG,{'name':a26_0x34f2f3(0x10e),'type':a26_0x34f2f3(0x11d),'required':!![],'description':'Local\x20XLSX\x20file\x20(maximum\x2020\x20MB)'},{'name':a26_0x34f2f3(0x135),'type':a26_0x34f2f3(0x11d),'required':!![],'description':a26_0x34f2f3(0xfa)},{'name':a26_0x34f2f3(0x136),'type':a26_0x34f2f3(0x11d),'description':'Worksheet\x20name\x20or\x201-based\x20index\x20(default:\x20first\x20worksheet)'},{'name':a26_0x34f2f3(0x10f),'type':a26_0x34f2f3(0x12d),'default':0x1,'description':'1-based\x20Excel\x20header\x20row'},{'name':'batch-size','type':a26_0x34f2f3(0x12d),'default':0x1f4,'description':a26_0x34f2f3(0x121)},{'name':a26_0x34f2f3(0x10c),'type':a26_0x34f2f3(0x11d),'description':a26_0x34f2f3(0x100)},{'name':a26_0x34f2f3(0x105),'type':a26_0x34f2f3(0x11d),'description':a26_0x34f2f3(0xf8)},{'name':a26_0x34f2f3(0x134),'type':a26_0x34f2f3(0x138),'description':'Reconcile\x20imported\x20records\x20and\x20resume\x20the\x20exact\x20original\x20file,\x20target\x20and\x20mapping'}],'validate':async _0x5d0932=>{input(_0x5d0932);},'dryRun':async _0x3c1a60=>checked(async()=>{const _0x1329df=a26_0x34f2f3,{args:_0x2aac2f,manifest:_0x5833a9,contract:_0x2ccb53,code:_0x50b5d8}=await prepare(_0x3c1a60),_0x26f3bc=new Set(_0x5833a9[_0x1329df(0x137)]['map'](_0x554ef1=>_0x554ef1[_0x1329df(0x116)]))[_0x1329df(0x113)];return{'method':_0x1329df(0xe8),'url':_0x1329df(0x133)+encodeURIComponent(_0x3c1a60[_0x1329df(0xee)])+'/'+encodeURIComponent(_0x50b5d8)+_0x1329df(0x125),'description':_0x1329df(0xe7),'body':{'schemaFingerprint':_0x2ccb53['schemaFingerprint']},'validRows':Math[_0x1329df(0xf7)](0x0,_0x5833a9[_0x1329df(0x12a)]['length']-_0x26f3bc),'invalidRows':_0x26f3bc,'invalidCells':_0x5833a9[_0x1329df(0x137)][_0x1329df(0x123)],'emptyRows':_0x5833a9['emptyRows'][_0x1329df(0x123)],'expectedBatches':previewImportBatchCount(_0x5833a9,_0x2ccb53,_0x2aac2f[_0x1329df(0xf4)]),'imageCount':_0x5833a9[_0x1329df(0x129)]?.[_0x1329df(0x130)]((_0x4226c2,_0x43d5fe)=>_0x4226c2+_0x43d5fe[_0x1329df(0xea)][_0x1329df(0x123)],0x0)??0x0,'uniqueImages':_0x5833a9[_0x1329df(0x10b)]?.['length']??0x0,'uniqueImageBytes':_0x5833a9[_0x1329df(0x10b)]?.['reduce']((_0x4ab76b,_0x1f6bed)=>_0x4ab76b+_0x1f6bed[_0x1329df(0x113)],0x0)??0x0,'errors':_0x5833a9[_0x1329df(0x137)],'warnings':_0x5833a9[_0x1329df(0x10d)],'sheet':_0x5833a9[_0x1329df(0x136)],'checkpoint':_0x2aac2f[_0x1329df(0x10c)],'report':_0x2aac2f['report']};}),'execute':async _0x3f204e=>checked(async()=>{const _0x2e7dfc=a26_0x34f2f3,{args:_0x6f0b94,manifest:_0x5ce23b,contract:_0x2b09f8,code:_0x13eede}=await prepare(_0x3f204e);if(_0x5ce23b[_0x2e7dfc(0x137)][_0x2e7dfc(0x123)]){await saveImportJson(_0x6f0b94[_0x2e7dfc(0x105)],{'status':'invalid','sourceRows':_0x5ce23b[_0x2e7dfc(0x12a)][_0x2e7dfc(0x123)],'errors':_0x5ce23b[_0x2e7dfc(0x137)],'emptyRows':_0x5ce23b[_0x2e7dfc(0x114)],'warnings':_0x5ce23b[_0x2e7dfc(0x10d)]});throw CliErrors[_0x2e7dfc(0x107)](_0x2e7dfc(0xfe)+_0x5ce23b[_0x2e7dfc(0x137)][_0x2e7dfc(0x123)]+'\x20invalid\x20cells.\x20No\x20records\x20were\x20written.',_0x2e7dfc(0x128)+_0x6f0b94['report']+'.');}const _0x127652=_0x5ce23b['imageFields']?.[_0x2e7dfc(0x123)]?runImageExcelImport:_0x2b09f8[_0x2e7dfc(0x127)]===0x2?runAutoIdExcelImport:runExcelImport,_0x198919=await _0x127652({..._0x6f0b94,'manifest':_0x5ce23b,'contract':_0x2b09f8,'appCode':_0x3f204e[_0x2e7dfc(0xee)],'datasetCode':_0x13eede,'runtimeDomain':getRuntimeDomain(),'inputPaths':[_0x6f0b94[_0x2e7dfc(0x10e)],_0x6f0b94[_0x2e7dfc(0x132)]],'imageApi':{'upload':(_0x520167,_0x51ea07)=>uploadDatasetImportImage(_0x3f204e[_0x2e7dfc(0xee)],_0x13eede,_0x520167,_0x51ea07),'readback':(_0xf0fa16,_0x50a683)=>readDatasetImportImage(_0x3f204e['appCode'],_0x13eede,_0xf0fa16,_0x50a683)},'api':{'write':(_0x471294,_0x5b6fb2)=>createDatasetImportBatch(_0x3f204e['appCode'],_0x13eede,{'schemaFingerprint':_0x2b09f8[_0x2e7dfc(0x101)],'items':_0x471294,..._0x5b6fb2===undefined?{}:{'taskId':_0x5b6fb2}}),'readback':_0x1992cf=>readDatasetImportRows(_0x3f204e['appCode'],_0x13eede,_0x1992cf),'readTask':_0x53ccc1=>readDatasetImportTaskRows(_0x3f204e[_0x2e7dfc(0xee)],_0x13eede,_0x53ccc1)}});return{'ok':!![],'data':_0x198919,'message':_0x2e7dfc(0x140)+_0x198919[_0x2e7dfc(0xed)]+'\x20records.'};})};
|