@lovrabet/lovrabet-cli 2.3.10-beta.2 → 2.3.10
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.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/issue/context.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/domain-config.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.d.ts +1 -3
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.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.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-management-client.js +1 -1
- package/lib/core/kb-sdk-errors.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/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.d.ts +4 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.d.ts +2 -2
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/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.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/lovrabet/SKILL.md +1 -1
- package/skills/lovrabet/references/lovrabet-config-commands.md +17 -33
- package/skills/lovrabet/references/lovrabet-config.md +11 -3
- package/skills/lovrabet/references/lovrabet-doctor.md +1 -1
- package/skills/lovrabet/references/lovrabet-kb-workflow.md +4 -4
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const a13_0x381c56=a13_0x3613;(function(_0xe97b53,_0x2c2840){const _0x41fcc9=a13_0x3613,_0x539be5=_0xe97b53();while(!![]){try{const _0x953c4b=-parseInt(_0x41fcc9(0x1e5))/0x1+parseInt(_0x41fcc9(0x1da))/0x2+parseInt(_0x41fcc9(0x1d7))/0x3+-parseInt(_0x41fcc9(0x222))/0x4*(parseInt(_0x41fcc9(0x1ed))/0x5)+parseInt(_0x41fcc9(0x215))/0x6*(-parseInt(_0x41fcc9(0x1db))/0x7)+parseInt(_0x41fcc9(0x200))/0x8*(-parseInt(_0x41fcc9(0x1e8))/0x9)+parseInt(_0x41fcc9(0x211))/0xa*(parseInt(_0x41fcc9(0x1f8))/0xb);if(_0x953c4b===_0x2c2840)break;else _0x539be5['push'](_0x539be5['shift']());}catch(_0x579a68){_0x539be5['push'](_0x539be5['shift']());}}}(a13_0xafac,0x7593a));import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG,productEnvName}from'../../constant/product.js';import{AUTH_MODE}from'../../constant/auth-mode.js';function a13_0x3613(_0x1c46a4,_0x1c810e){_0x1c46a4=_0x1c46a4-0x1cd;const _0xafac8d=a13_0xafac();let _0x361315=_0xafac8d[_0x1c46a4];return _0x361315;}import{normalizeEnv,isDaily,isDev,isProduction}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(_0x5f0866=USER_ACCESS_KEY_CREATE_URL){const _0x149574=a13_0x3613;writeCliSideChannelLine(_0x149574(0x21b)+PRODUCT_CONFIG['userCenterDisplayName']+':'),writeCliSideChannelLine('\x0a'+_0x5f0866+'\x0a'),writeCliSideChannelLine(_0x149574(0x20a)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x149574(0x217));}function buildAccessKeySetupGuide(_0x7d8fc8=USER_ACCESS_KEY_CREATE_URL){const _0x2d1d28=a13_0x3613;return[_0x2d1d28(0x21b)+PRODUCT_CONFIG[_0x2d1d28(0x1cd)]+':',_0x7d8fc8,'Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20'+CLI_BIN_NAME+_0x2d1d28(0x216)][_0x2d1d28(0x1d5)]('\x0a');}function canPromptForAccessKey(_0x3b9722){const _0x21ecea=a13_0x3613;return!_0x3b9722[_0x21ecea(0x1f6)]&&process['stdin'][_0x21ecea(0x21a)]!==![]&&process['stdout']['isTTY']!==![];}function a13_0xafac(){const _0xd7f2d0=['1750DOEoHv','global-default','scope','accessKeySource','AccessKey\x20saved\x20to\x20','check','Clear\x20the\x20user\x20AccessKey\x20from\x20config','info','\x20config.','yes','281302sWvBBw','Clear\x20from\x20global\x20config\x20(default)','Removes\x20the\x20user\x20AccessKey\x20from\x20the\x20selected\x20Lovrabet\x20config.\x20Credentials\x20in\x20another\x20scope\x20or\x20environment\x20variables\x20are\x20unchanged.','31689UOfcQo','project','AccessKey\x20(ak_xxx...)','bool','\x20auth\x20status','172820aRxZTj','No\x20AccessKey\x20found\x20in\x20','Status:\x20configured\x20(not\x20remotely\x20verified)','Option\x20A:\x20','development','envName','boolean','Then\x20verify\x20with:\x20','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','nonInteractive','login','11cFSBpb','access_key','status','\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]','accessKey','production','Save\x20the\x20user\x20AccessKey\x20(global\x20by\x20default;\x20--project\x20for\x20project\x20config)','\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`','1976tWkEWH','ClientAk','Environment:\x20','push','\x20config.\x20Nothing\x20to\x20clear.','\x20doctor','ACCESS_KEY','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','Shorthand\x20for\x20--access-key','accessKeyCreatePath','Tip:\x20you\x20can\x20also\x20run:','Saves\x20a\x20user\x20AccessKey\x20to\x20the\x20selected\x20Lovrabet\x20config.\x20An\x20existing\x20key\x20in\x20that\x20scope\x20is\x20overwritten.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20the\x20secret.','test','logout','success','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','str','10863350RVHuwu','\x20\x20export\x20','global','project\x20config','3282sPbhkQ','\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','\x20auth\x20login\x20--access-key\x20<ak_xxx>','auth','access-key','isTTY','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','authRequired','env','AccessKey:\x20','write','trim','\x20(via\x20','88HveYLo','Auth\x20mode:\x20','code','userCenterDisplayName','newConfigFileName','=ak_xxx','If\x20command\x20execution\x20still\x20fails,\x20run:\x20','Option\x20B:\x20apps\x20config\x20(','read','Use\x20`','global\x20config','join','validation','1790559wAEDRg','Device\x20authorization\x20completed.','Read\x20from\x20global\x20config\x20(default)','1693106DVoFnn'];a13_0xafac=function(){return _0xd7f2d0;};return a13_0xafac();}function resolveAuthScopeFlags(_0x1ce5f4){const _0x2659db=a13_0x3613;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x1ce5f4[_0x2659db(0x1eb)]('global'),'explicitProject':_0x1ce5f4['bool'](_0x2659db(0x1e9)),'policy':_0x2659db(0x1dc)}));}async function resolveAuthWriteInput(_0x19d428){const _0x3a0a6f=a13_0x3613;let _0x4e5310=(_0x19d428['str'](_0x3a0a6f(0x219))||_0x19d428[_0x3a0a6f(0x210)]('ak')||'')[_0x3a0a6f(0x220)]();const _0x2f47e0=(_0x19d428[_0x3a0a6f(0x210)]('env')||'')[_0x3a0a6f(0x220)](),_0x31c7d1=''+getUserDomain()+PRODUCT_CONFIG['accessKeyCreatePath'];if(!_0x4e5310&&canPromptForAccessKey(_0x19d428))try{showAccessKeyCreateHint(_0x31c7d1),_0x4e5310=await promptAccessKey('');}catch(_0x443790){if(isAbortPrompt(_0x443790))throw CliErrors['cancelled']();throw _0x443790;}if(!_0x4e5310)throw CliErrors[_0x3a0a6f(0x1d6)]('Missing\x20accessKey.',buildAccessKeySetupGuide(_0x31c7d1));if(!ACCESS_KEY_PATTERN[_0x3a0a6f(0x20c)](_0x4e5310))throw CliErrors['validation']('Invalid\x20accessKey\x20format.','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars');if(!_0x2f47e0)return{'accessKey':_0x4e5310};const _0x166350=normalizeEnv(_0x2f47e0);return{'accessKey':_0x4e5310,'env':isDaily(_0x166350)?'daily':isDev(_0x166350)?_0x3a0a6f(0x1f1):_0x3a0a6f(0x1fd)};}export const authDefinitions=[{'service':'auth','command':a13_0x381c56(0x1f7),'description':a13_0x381c56(0x1fe),'risk':a13_0x381c56(0x21f),'confirmationDescription':a13_0x381c56(0x20b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a13_0x381c56(0x219),'type':'string','description':a13_0x381c56(0x1ea)},{'name':'ak','type':'string','description':a13_0x381c56(0x208)},{'name':a13_0x381c56(0x213),'type':a13_0x381c56(0x1f3),'description':'Write\x20to\x20global\x20config\x20(default)','default':!![]},{'name':a13_0x381c56(0x1e9),'type':'boolean','description':a13_0x381c56(0x1f5),'default':![]}],async 'execute'(_0x24f2e9){const _0x3a1369=a13_0x381c56;if(_0x24f2e9['bool'](_0x3a1369(0x1e4)))throw CliErrors['validation']('`auth\x20login`\x20does\x20not\x20support\x20--yes.',_0x3a1369(0x1d3)+CLI_BIN_NAME+_0x3a1369(0x1ff)+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.');const _0x4cf4b0=(_0x24f2e9[_0x3a1369(0x210)](_0x3a1369(0x219))||_0x24f2e9[_0x3a1369(0x210)]('ak')||'')[_0x3a1369(0x220)]();if(!_0x4cf4b0&&_0x24f2e9[_0x3a1369(0x1f6)])return{'ok':!![],'message':buildAccessKeySetupGuide(''+getUserDomain()+PRODUCT_CONFIG[_0x3a1369(0x209)])};const _0x584964=await resolveAuthWriteInput(_0x24f2e9),_0x838a16=resolveAuthScopeFlags(_0x24f2e9),_0x38b406=readScopedConfig(_0x838a16);_0x38b406[_0x3a1369(0x1fc)]=_0x584964['accessKey'];_0x584964['env']&&(_0x38b406['env']=_0x584964['env']);writeScopedConfig(_0x38b406,_0x838a16);const _0x4b83cf=_0x838a16['global']?'global':_0x3a1369(0x1e9),_0x5bf8eb=_0x38b406['env']?'\x20Current\x20env:\x20'+_0x38b406[_0x3a1369(0x21d)]+'.':'';return{'ok':!![],'message':_0x3a1369(0x1df)+_0x4b83cf+_0x3a1369(0x1e3)+_0x5bf8eb+'\x20Verify:\x20'+CLI_BIN_NAME+'\x20auth\x20status'};}},{'service':'auth','command':a13_0x381c56(0x20d),'description':a13_0x381c56(0x1e1),'risk':a13_0x381c56(0x21f),'confirmationDescription':a13_0x381c56(0x1e7),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a13_0x381c56(0x213),'type':a13_0x381c56(0x1f3),'description':a13_0x381c56(0x1e6),'default':!![]},{'name':'project','type':a13_0x381c56(0x1f3),'description':'Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]}],async 'execute'(_0x3fc4f5){const _0x4e41eb=a13_0x381c56,_0x4a4075=resolveAuthScopeFlags(_0x3fc4f5),_0xed252d=readScopedConfig(_0x4a4075),_0x455708=!!_0xed252d[_0x4e41eb(0x1fc)];delete _0xed252d[_0x4e41eb(0x1fc)],writeScopedConfig(_0xed252d,_0x4a4075);const _0x5c2794=_0x4a4075[_0x4e41eb(0x213)]?_0x4e41eb(0x213):'project';if(_0x455708)return{'ok':!![],'message':'AccessKey\x20cleared\x20from\x20'+_0x5c2794+_0x4e41eb(0x1e3)};return{'ok':!![],'message':_0x4e41eb(0x1ee)+_0x5c2794+_0x4e41eb(0x204)};}},{'service':a13_0x381c56(0x218),'command':'status','description':'Show\x20current\x20authentication\x20status','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a13_0x381c56(0x213),'type':a13_0x381c56(0x1f3),'description':a13_0x381c56(0x1d9),'default':!![]},{'name':a13_0x381c56(0x1e9),'type':a13_0x381c56(0x1f3),'description':'Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]},{'name':a13_0x381c56(0x1e0),'type':'boolean','description':'Exit\x20non-zero\x20when\x20no\x20AccessKey\x20is\x20configured','default':![]}],async 'execute'(_0xb92045){const _0x14c951=a13_0x381c56,_0x9c00a4=resolveAuthScopeFlags(_0xb92045),_0x407eeb=readScopedConfig(_0x9c00a4),_0x2c1f0e=productEnvName(_0x14c951(0x206)),_0x350294=_0xb92045['accessKey'],_0x3eb4c8=_0xb92045[_0x14c951(0x1de)],_0x58d9bd=[_0x14c951(0x223)+AUTH_MODE[_0x14c951(0x201)]];if(_0xb92045[_0x14c951(0x1f2)]&&!isProduction(_0xb92045[_0x14c951(0x1f2)]))_0x58d9bd['push'](_0x14c951(0x202)+_0xb92045[_0x14c951(0x1f2)]);_0x58d9bd[_0x14c951(0x203)]('Stored\x20AccessKey\x20('+(_0x9c00a4[_0x14c951(0x213)]?_0x14c951(0x213):'project')+'\x20config):\x20'+(_0x407eeb['accessKey']?maskCliAccessKey(_0x407eeb['accessKey']):'(not\x20set)'));if(_0x350294){const _0x3c0f08=maskCliAccessKey(_0x350294);_0x58d9bd[_0x14c951(0x203)](_0x14c951(0x21e)+_0x3c0f08+(_0x3eb4c8?_0x14c951(0x221)+_0x3eb4c8+')':'')),_0x58d9bd[_0x14c951(0x203)](_0x14c951(0x1ef));}if(!_0x350294){_0x58d9bd[_0x14c951(0x203)](''),_0x58d9bd['push'](_0x14c951(0x20f)),_0x58d9bd[_0x14c951(0x203)](''),_0x58d9bd[_0x14c951(0x203)](_0x14c951(0x1f0)+CLI_BIN_NAME+_0x14c951(0x1fb)),_0x58d9bd[_0x14c951(0x203)](''),_0x58d9bd[_0x14c951(0x203)](_0x14c951(0x1d1)+PRODUCT_CONFIG[_0x14c951(0x1ce)]+')'),_0x58d9bd[_0x14c951(0x203)](_0x14c951(0x207)),_0x58d9bd[_0x14c951(0x203)](''),_0x58d9bd[_0x14c951(0x203)]('Option\x20C:\x20environment\x20variable'),_0x58d9bd[_0x14c951(0x203)](_0x14c951(0x212)+_0x2c1f0e+_0x14c951(0x1cf)),_0x58d9bd[_0x14c951(0x203)](''),_0x58d9bd['push'](_0x14c951(0x1f4)+CLI_BIN_NAME+_0x14c951(0x1ec)),_0x58d9bd[_0x14c951(0x203)](_0x14c951(0x1d0)+CLI_BIN_NAME+_0x14c951(0x205));if(_0xb92045[_0x14c951(0x1eb)](_0x14c951(0x1e0))){const _0x3c4f29=readStoredDeviceCode();if(_0x3c4f29&&!isStoredDeviceCodeExpired(_0x3c4f29)){const _0x3e5250=getUserDomain(),_0x20f462=await fetchDeviceToken(_0x3e5250,_0x3c4f29[_0x14c951(0x224)]);if(_0x20f462['status']===_0x14c951(0x20e)&&_0x20f462[_0x14c951(0x1f9)]){const _0x21b874={'global':_0x3c4f29[_0x14c951(0x1dd)]===_0x14c951(0x213)},_0x1f8991=readScopedConfig(_0x21b874);_0x1f8991['accessKey']=_0x20f462['access_key'],writeScopedConfig(_0x1f8991,_0x21b874),deleteStoredDeviceCode();const _0x127529=_0x20f462[_0x14c951(0x1f9)],_0x28cad9=maskCliAccessKey(_0x127529),_0x3e701e=_0x3c4f29[_0x14c951(0x1dd)]===_0x14c951(0x213)?_0x14c951(0x1d4):_0x14c951(0x214);return{'ok':!![],'message':[_0x14c951(0x223)+AUTH_MODE['ClientAk'],..._0xb92045[_0x14c951(0x1f2)]&&!isProduction(_0xb92045['envName'])?[_0x14c951(0x202)+_0xb92045['envName']]:[],_0x14c951(0x21e)+_0x28cad9+_0x14c951(0x221)+_0x3e701e+')',_0x14c951(0x1ef),_0x14c951(0x1d8)]['join']('\x0a')};}_0x20f462[_0x14c951(0x1fa)]==='expired'&&deleteStoredDeviceCode();throw CliErrors[_0x14c951(0x21c)]('Device\x20authorization\x20pending.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20try\x20again.');}throw CliErrors[_0x14c951(0x21c)](_0x58d9bd[_0x14c951(0x1d5)]('\x0a'));}}return{'ok':!![],'message':_0x58d9bd[_0x14c951(0x1d5)]('\x0a')};}},{'service':a13_0x381c56(0x218),'command':a13_0x381c56(0x1e2),'description':'Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','risk':a13_0x381c56(0x1d2),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x58b2ec){const _0x4610c9=a13_0x381c56,_0x5022af=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x5022af,'meta':{'env':_0x58b2ec[_0x4610c9(0x1f2)]??'production'}}};}},authDeviceDefinition];
|
|
1
|
+
const a13_0x5edbf2=a13_0x5b3d;(function(_0x401b1d,_0x451c8d){const _0x3ce9b6=a13_0x5b3d,_0x4a0af7=_0x401b1d();while(!![]){try{const _0x32f161=parseInt(_0x3ce9b6(0xf3))/0x1*(-parseInt(_0x3ce9b6(0xfe))/0x2)+parseInt(_0x3ce9b6(0xe2))/0x3+parseInt(_0x3ce9b6(0xce))/0x4*(parseInt(_0x3ce9b6(0xff))/0x5)+parseInt(_0x3ce9b6(0x125))/0x6*(-parseInt(_0x3ce9b6(0x116))/0x7)+parseInt(_0x3ce9b6(0xe9))/0x8*(-parseInt(_0x3ce9b6(0x113))/0x9)+-parseInt(_0x3ce9b6(0xf4))/0xa+parseInt(_0x3ce9b6(0x112))/0xb;if(_0x32f161===_0x451c8d)break;else _0x4a0af7['push'](_0x4a0af7['shift']());}catch(_0x2216ff){_0x4a0af7['push'](_0x4a0af7['shift']());}}}(a13_0xaac2,0x21190));import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG,productEnvName}from'../../constant/product.js';import{AUTH_MODE}from'../../constant/auth-mode.js';import{normalizeEnv,isDaily,isDev,isProduction}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_0x5b3d(_0x10f1c7,_0x4f598a){_0x10f1c7=_0x10f1c7-0xca;const _0xaac252=a13_0xaac2();let _0x5b3dbb=_0xaac252[_0x10f1c7];return _0x5b3dbb;}function a13_0xaac2(){const _0x24ec0c=['nonInteractive','\x20(via\x20','join','access-key','Option\x20A:\x20','\x20config.\x20Nothing\x20to\x20clear.','AccessKey\x20(ak_xxx...)','global-default','test','check','43464mixoSP','Auth\x20mode:\x20','\x20Current\x20env:\x20','Exit\x20non-zero\x20when\x20no\x20AccessKey\x20is\x20configured','auth','stdin','485036vRAyRV','\x20auth\x20login\x20--access-key\x20<ak_xxx>','AccessKey\x20saved\x20to\x20','Status:\x20configured\x20(not\x20remotely\x20verified)','\x20Verify:\x20','status','code','Option\x20B:\x20apps\x20config\x20(','If\x20command\x20execution\x20still\x20fails,\x20run:\x20','No\x20AccessKey\x20found\x20in\x20','\x20auth\x20status','cancelled','\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]','(not\x20set)','Use\x20`','access_key','accessKey','Save\x20the\x20user\x20AccessKey\x20(global\x20by\x20default;\x20--project\x20for\x20project\x20config)','\x20\x20export\x20','Shorthand\x20for\x20--access-key','586743OcNUvu','read','Clear\x20the\x20user\x20AccessKey\x20from\x20config','boolean','`auth\x20login`\x20does\x20not\x20support\x20--yes.','Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','daily','40QltKyK','expired','project\x20config','global','development','project','str','Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20','bool','production','1dwERjo','261490mIiDPY','\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.','write','AccessKey\x20cleared\x20from\x20','login','newConfigFileName','trim','userCenterDisplayName','\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','Read\x20from\x20global\x20config\x20(default)','31422xIoIZb','10QWPqPX','=ak_xxx','Missing\x20accessKey.','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','scope','\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`','\x20config):\x20','ClientAk','string','authRequired','push','Removes\x20the\x20user\x20AccessKey\x20from\x20the\x20selected\x20Lovrabet\x20config.\x20Credentials\x20in\x20another\x20scope\x20or\x20environment\x20variables\x20are\x20unchanged.','validation','Show\x20current\x20authentication\x20status','\x20config.','global\x20config','accessKeyCreatePath','envName','isTTY','834306SjFRsm','240633AtBgGE','env','AccessKey:\x20','196yXcMpn','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','\x20doctor','Then\x20verify\x20with:\x20','info'];a13_0xaac2=function(){return _0x24ec0c;};return a13_0xaac2();}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(_0x377553=USER_ACCESS_KEY_CREATE_URL){const _0x118b04=a13_0x5b3d;writeCliSideChannelLine(_0x118b04(0x102)+PRODUCT_CONFIG[_0x118b04(0xfb)]+':'),writeCliSideChannelLine('\x0a'+_0x377553+'\x0a'),writeCliSideChannelLine('Tip:\x20you\x20can\x20also\x20run:'),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x118b04(0xcf));}function buildAccessKeySetupGuide(_0x158125=USER_ACCESS_KEY_CREATE_URL){const _0x22211a=a13_0x5b3d;return[_0x22211a(0x102)+PRODUCT_CONFIG['userCenterDisplayName']+':',_0x158125,_0x22211a(0xf0)+CLI_BIN_NAME+_0x22211a(0xfc)][_0x22211a(0x11d)]('\x0a');}function canPromptForAccessKey(_0x4638cd){const _0x2ad592=a13_0x5b3d;return!_0x4638cd[_0x2ad592(0x11b)]&&process[_0x2ad592(0xcd)]['isTTY']!==![]&&process['stdout'][_0x2ad592(0x111)]!==![];}function resolveAuthScopeFlags(_0x4652a3){const _0x45df1c=a13_0x5b3d;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x4652a3['bool'](_0x45df1c(0xec)),'explicitProject':_0x4652a3[_0x45df1c(0xf1)](_0x45df1c(0xee)),'policy':_0x45df1c(0x122)}));}async function resolveAuthWriteInput(_0x27848d){const _0x307633=a13_0x5b3d;let _0x201390=(_0x27848d['str'](_0x307633(0x11e))||_0x27848d['str']('ak')||'')[_0x307633(0xfa)]();const _0x1a9be2=(_0x27848d['str']('env')||'')[_0x307633(0xfa)](),_0xa0d859=''+getUserDomain()+PRODUCT_CONFIG['accessKeyCreatePath'];if(!_0x201390&&canPromptForAccessKey(_0x27848d))try{showAccessKeyCreateHint(_0xa0d859),_0x201390=await promptAccessKey('');}catch(_0x136743){if(isAbortPrompt(_0x136743))throw CliErrors[_0x307633(0xd9)]();throw _0x136743;}if(!_0x201390)throw CliErrors['validation'](_0x307633(0x101),buildAccessKeySetupGuide(_0xa0d859));if(!ACCESS_KEY_PATTERN[_0x307633(0x123)](_0x201390))throw CliErrors[_0x307633(0x10b)]('Invalid\x20accessKey\x20format.','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars');if(!_0x1a9be2)return{'accessKey':_0x201390};const _0x314403=normalizeEnv(_0x1a9be2);return{'accessKey':_0x201390,'env':isDaily(_0x314403)?_0x307633(0xe8):isDev(_0x314403)?_0x307633(0xed):_0x307633(0xf2)};}export const authDefinitions=[{'service':'auth','command':a13_0x5edbf2(0xf8),'description':a13_0x5edbf2(0xdf),'risk':a13_0x5edbf2(0xf6),'confirmationDescription':'Saves\x20a\x20user\x20AccessKey\x20to\x20the\x20selected\x20Lovrabet\x20config.\x20An\x20existing\x20key\x20in\x20that\x20scope\x20is\x20overwritten.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20the\x20secret.','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a13_0x5edbf2(0x11e),'type':a13_0x5edbf2(0x107),'description':a13_0x5edbf2(0x121)},{'name':'ak','type':a13_0x5edbf2(0x107),'description':a13_0x5edbf2(0xe1)},{'name':a13_0x5edbf2(0xec),'type':a13_0x5edbf2(0xe5),'description':'Write\x20to\x20global\x20config\x20(default)','default':!![]},{'name':a13_0x5edbf2(0xee),'type':a13_0x5edbf2(0xe5),'description':'Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]}],async 'execute'(_0x3382e7){const _0x142b6c=a13_0x5edbf2;if(_0x3382e7[_0x142b6c(0xf1)]('yes'))throw CliErrors['validation'](_0x142b6c(0xe6),_0x142b6c(0xdc)+CLI_BIN_NAME+_0x142b6c(0x104)+CLI_BIN_NAME+_0x142b6c(0xf5));const _0x1aeafe=(_0x3382e7[_0x142b6c(0xef)](_0x142b6c(0x11e))||_0x3382e7[_0x142b6c(0xef)]('ak')||'')['trim']();if(!_0x1aeafe&&_0x3382e7[_0x142b6c(0x11b)])return{'ok':!![],'message':buildAccessKeySetupGuide(''+getUserDomain()+PRODUCT_CONFIG[_0x142b6c(0x10f)])};const _0x4b5789=await resolveAuthWriteInput(_0x3382e7),_0x2b6ba7=resolveAuthScopeFlags(_0x3382e7),_0x4e4d6e=readScopedConfig(_0x2b6ba7);_0x4e4d6e[_0x142b6c(0xde)]=_0x4b5789[_0x142b6c(0xde)];_0x4b5789[_0x142b6c(0x114)]&&(_0x4e4d6e[_0x142b6c(0x114)]=_0x4b5789[_0x142b6c(0x114)]);writeScopedConfig(_0x4e4d6e,_0x2b6ba7);const _0x5bf4f6=_0x2b6ba7['global']?_0x142b6c(0xec):_0x142b6c(0xee),_0x66fc20=_0x4e4d6e[_0x142b6c(0x114)]?_0x142b6c(0xca)+_0x4e4d6e[_0x142b6c(0x114)]+'.':'';return{'ok':!![],'message':_0x142b6c(0xd0)+_0x5bf4f6+_0x142b6c(0x10d)+_0x66fc20+_0x142b6c(0xd2)+CLI_BIN_NAME+'\x20auth\x20status'};}},{'service':'auth','command':'logout','description':a13_0x5edbf2(0xe4),'risk':a13_0x5edbf2(0xf6),'confirmationDescription':a13_0x5edbf2(0x10a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a13_0x5edbf2(0xec),'type':'boolean','description':'Clear\x20from\x20global\x20config\x20(default)','default':!![]},{'name':'project','type':a13_0x5edbf2(0xe5),'description':a13_0x5edbf2(0xe7),'default':![]}],async 'execute'(_0x1fac51){const _0x4fef41=a13_0x5edbf2,_0x53b3e0=resolveAuthScopeFlags(_0x1fac51),_0x13a868=readScopedConfig(_0x53b3e0),_0x398a33=!!_0x13a868[_0x4fef41(0xde)];delete _0x13a868[_0x4fef41(0xde)],writeScopedConfig(_0x13a868,_0x53b3e0);const _0x501ef5=_0x53b3e0['global']?_0x4fef41(0xec):_0x4fef41(0xee);if(_0x398a33)return{'ok':!![],'message':_0x4fef41(0xf7)+_0x501ef5+_0x4fef41(0x10d)};return{'ok':!![],'message':_0x4fef41(0xd7)+_0x501ef5+_0x4fef41(0x120)};}},{'service':'auth','command':a13_0x5edbf2(0xd3),'description':a13_0x5edbf2(0x10c),'risk':a13_0x5edbf2(0xe3),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'global','type':a13_0x5edbf2(0xe5),'description':a13_0x5edbf2(0xfd),'default':!![]},{'name':a13_0x5edbf2(0xee),'type':a13_0x5edbf2(0xe5),'description':'Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]},{'name':a13_0x5edbf2(0x124),'type':a13_0x5edbf2(0xe5),'description':a13_0x5edbf2(0xcb),'default':![]}],async 'execute'(_0x3283c2){const _0x2b2cc3=a13_0x5edbf2,_0xe6bf92=resolveAuthScopeFlags(_0x3283c2),_0x36b09f=readScopedConfig(_0xe6bf92),_0x452059=productEnvName('ACCESS_KEY'),_0x165724=_0x3283c2[_0x2b2cc3(0xde)],_0x30b9f8=_0x3283c2['accessKeySource'],_0x4e2784=[_0x2b2cc3(0x126)+AUTH_MODE[_0x2b2cc3(0x106)]];if(_0x3283c2['envName']&&!isProduction(_0x3283c2[_0x2b2cc3(0x110)]))_0x4e2784[_0x2b2cc3(0x109)]('Environment:\x20'+_0x3283c2['envName']);_0x4e2784[_0x2b2cc3(0x109)]('Stored\x20AccessKey\x20('+(_0xe6bf92['global']?_0x2b2cc3(0xec):_0x2b2cc3(0xee))+_0x2b2cc3(0x105)+(_0x36b09f[_0x2b2cc3(0xde)]?maskCliAccessKey(_0x36b09f[_0x2b2cc3(0xde)]):_0x2b2cc3(0xdb)));if(_0x165724){const _0x4ff913=maskCliAccessKey(_0x165724);_0x4e2784[_0x2b2cc3(0x109)]('AccessKey:\x20'+_0x4ff913+(_0x30b9f8?_0x2b2cc3(0x11c)+_0x30b9f8+')':'')),_0x4e2784['push'](_0x2b2cc3(0xd1));}if(!_0x165724){_0x4e2784[_0x2b2cc3(0x109)](''),_0x4e2784[_0x2b2cc3(0x109)]('No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:'),_0x4e2784['push'](''),_0x4e2784[_0x2b2cc3(0x109)](_0x2b2cc3(0x11f)+CLI_BIN_NAME+_0x2b2cc3(0xda)),_0x4e2784[_0x2b2cc3(0x109)](''),_0x4e2784[_0x2b2cc3(0x109)](_0x2b2cc3(0xd5)+PRODUCT_CONFIG[_0x2b2cc3(0xf9)]+')'),_0x4e2784['push'](_0x2b2cc3(0x117)),_0x4e2784[_0x2b2cc3(0x109)](''),_0x4e2784['push']('Option\x20C:\x20environment\x20variable'),_0x4e2784[_0x2b2cc3(0x109)](_0x2b2cc3(0xe0)+_0x452059+_0x2b2cc3(0x100)),_0x4e2784[_0x2b2cc3(0x109)](''),_0x4e2784['push'](_0x2b2cc3(0x119)+CLI_BIN_NAME+_0x2b2cc3(0xd8)),_0x4e2784['push'](_0x2b2cc3(0xd6)+CLI_BIN_NAME+_0x2b2cc3(0x118));if(_0x3283c2[_0x2b2cc3(0xf1)](_0x2b2cc3(0x124))){const _0x3d169a=readStoredDeviceCode();if(_0x3d169a&&!isStoredDeviceCodeExpired(_0x3d169a)){const _0x4a9e7a=getUserDomain(),_0x51fd9d=await fetchDeviceToken(_0x4a9e7a,_0x3d169a[_0x2b2cc3(0xd4)]);if(_0x51fd9d[_0x2b2cc3(0xd3)]==='success'&&_0x51fd9d['access_key']){const _0x2ebaf9={'global':_0x3d169a[_0x2b2cc3(0x103)]===_0x2b2cc3(0xec)},_0xa287db=readScopedConfig(_0x2ebaf9);_0xa287db[_0x2b2cc3(0xde)]=_0x51fd9d[_0x2b2cc3(0xdd)],writeScopedConfig(_0xa287db,_0x2ebaf9),deleteStoredDeviceCode();const _0x3c399a=_0x51fd9d[_0x2b2cc3(0xdd)],_0x95388e=maskCliAccessKey(_0x3c399a),_0x3dfc43=_0x3d169a[_0x2b2cc3(0x103)]===_0x2b2cc3(0xec)?_0x2b2cc3(0x10e):_0x2b2cc3(0xeb);return{'ok':!![],'message':[_0x2b2cc3(0x126)+AUTH_MODE[_0x2b2cc3(0x106)],..._0x3283c2[_0x2b2cc3(0x110)]&&!isProduction(_0x3283c2[_0x2b2cc3(0x110)])?['Environment:\x20'+_0x3283c2[_0x2b2cc3(0x110)]]:[],_0x2b2cc3(0x115)+_0x95388e+'\x20(via\x20'+_0x3dfc43+')',_0x2b2cc3(0xd1),'Device\x20authorization\x20completed.'][_0x2b2cc3(0x11d)]('\x0a')};}_0x51fd9d[_0x2b2cc3(0xd3)]===_0x2b2cc3(0xea)&&deleteStoredDeviceCode();throw CliErrors['authRequired']('Device\x20authorization\x20pending.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20try\x20again.');}throw CliErrors[_0x2b2cc3(0x108)](_0x4e2784[_0x2b2cc3(0x11d)]('\x0a'));}}return{'ok':!![],'message':_0x4e2784[_0x2b2cc3(0x11d)]('\x0a')};}},{'service':a13_0x5edbf2(0xcc),'command':a13_0x5edbf2(0x11a),'description':'Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','risk':a13_0x5edbf2(0xe3),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x574a96){const _0x3f9d5e=a13_0x5edbf2,_0x109059=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x109059,'meta':{'env':_0x574a96[_0x3f9d5e(0x110)]??'production'}}};}},authDeviceDefinition];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2ce48e,_0x43f9e8){const _0x223501=a14_0x3152,_0x4334e9=_0x2ce48e();while(!![]){try{const _0x3d7cb1=-parseInt(_0x223501(0x101))/0x1*(parseInt(_0x223501(0x102))/0x2)+-parseInt(_0x223501(0x110))/0x3+-parseInt(_0x223501(0x104))/0x4*(parseInt(_0x223501(0x10f))/0x5)+-parseInt(_0x223501(0x10b))/0x6+parseInt(_0x223501(0x10d))/0x7*(parseInt(_0x223501(0x113))/0x8)+-parseInt(_0x223501(0x111))/0x9*(-parseInt(_0x223501(0x115))/0xa)+-parseInt(_0x223501(0x10a))/0xb*(-parseInt(_0x223501(0x106))/0xc);if(_0x3d7cb1===_0x43f9e8)break;else _0x4334e9['push'](_0x4334e9['shift']());}catch(_0x2bfcfd){_0x4334e9['push'](_0x4334e9['shift']());}}}(a14_0x4476,0x9a5dc));import{createInterface}from'node:readline';class AbortPrompt extends Error{constructor(){const _0xcb87f5=a14_0x3152;super(_0xcb87f5(0x109)),this[_0xcb87f5(0x108)]=_0xcb87f5(0x103);}}function a14_0x4476(){const _0x2487f3=['question','341117ORUZkU','once','10085ipJwFS','360483wTUIqN','38988nwjWng','trim','32SnQWeI','SIGINT','570NGFNHg','close','AccessKey\x20(paste\x20ak_...):\x20','removeListener','26063ugQnaE','10joUnRS','AbortPrompt','1484wiYRtc','stdout','24OvlNtp','stdin','name','User\x20aborted\x20prompt','12798192FpgAzr','6826350ytsHRi'];a14_0x4476=function(){return _0x2487f3;};return a14_0x4476();}function createSafeRl(){const _0x14b4b4=a14_0x3152,_0x4748d8=createInterface({'input':process[_0x14b4b4(0x107)],'output':process[_0x14b4b4(0x105)]});let _0x73ca82;const _0x389d32=new Promise((_0xa5d091,_0xc61d64)=>{const _0x41f6df=_0x14b4b4;_0x73ca82=()=>{const _0x2534a2=a14_0x3152;_0x73ca82&&(_0x4748d8[_0x2534a2(0x100)]('SIGINT',_0x73ca82),_0x73ca82=undefined);try{_0x4748d8[_0x2534a2(0x116)]();}catch{}_0xc61d64(new AbortPrompt());},_0x4748d8[_0x41f6df(0x10e)](_0x41f6df(0x114),_0x73ca82);}),_0x387728=()=>{const _0x59b349=_0x14b4b4;_0x73ca82&&(_0x4748d8[_0x59b349(0x100)](_0x59b349(0x114),_0x73ca82),_0x73ca82=undefined);try{_0x4748d8[_0x59b349(0x116)]();}catch{}};return{'rl':_0x4748d8,'abortPromise':_0x389d32,'disposeSuccess':_0x387728};}export async function promptAccessKey(_0x5aa306=''){const {rl:_0x5890bf,abortPromise:_0x208a15,disposeSuccess:_0x2a2a26}=createSafeRl(),_0x15c26d=new Promise(_0x320797=>{const _0x1348d4=a14_0x3152,_0x1d5626=_0x5aa306?'AccessKey\x20('+_0x5aa306+'):\x20':_0x1348d4(0x117);_0x5890bf[_0x1348d4(0x10c)](_0x1d5626,_0x437381=>{const _0x3f0237=_0x1348d4;_0x2a2a26(),_0x320797(_0x437381[_0x3f0237(0x112)]()||_0x5aa306);});});return Promise['race']([_0x15c26d,_0x208a15]);}function a14_0x3152(_0x5a3d6,_0x37fea2){_0x5a3d6=_0x5a3d6-0x100;const _0x4476bd=a14_0x4476();let _0x31528f=_0x4476bd[_0x5a3d6];return _0x31528f;}export function isAbortPrompt(_0x160a07){const _0x1b9c82=a14_0x3152;return _0x160a07 instanceof Error&&_0x160a07[_0x1b9c82(0x108)]==='AbortPrompt';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a15_0x126f6e=a15_0x4094;(function(_0x27bf8a,_0x27f521){const _0x4f0039=a15_0x4094,_0x400c2a=_0x27bf8a();while(!![]){try{const _0x4ad00e=parseInt(_0x4f0039(0x193))/0x1+-parseInt(_0x4f0039(0x197))/0x2+parseInt(_0x4f0039(0x199))/0x3*(-parseInt(_0x4f0039(0x194))/0x4)+-parseInt(_0x4f0039(0x18e))/0x5+parseInt(_0x4f0039(0x19b))/0x6+parseInt(_0x4f0039(0x18c))/0x7+-parseInt(_0x4f0039(0x18b))/0x8;if(_0x4ad00e===_0x27f521)break;else _0x400c2a['push'](_0x400c2a['shift']());}catch(_0x223ffa){_0x400c2a['push'](_0x400c2a['shift']());}}}(a15_0xc58f,0x76f2f));import{getBffEndpointContract}from'../../core/api-client.js';function a15_0x4094(_0x5ded15,_0x1c5a31){_0x5ded15=_0x5ded15-0x18b;const _0xc58f7d=a15_0xc58f();let _0x40942f=_0xc58f7d[_0x5ded15];return _0x40942f;}function a15_0xc58f(){const _0x44d62d=['str','889719lznIwh','description','3028386jGWNzw','2423520pFySIq','2218545dzVHAa','read','148330Igmley','(none)','bff','appCode','gmtModified','468928pinlyR','4SKSZQS','Get\x20a\x20Backend\x20Function\x20endpoint\x20contract\x20by\x20function\x20name','detail','348400FSxVyT'];a15_0xc58f=function(){return _0x44d62d;};return a15_0xc58f();}import{NAME_FLAG}from'../../commands/common/flags.js';export const bffDetail={'service':a15_0x126f6e(0x190),'command':a15_0x126f6e(0x196),'description':a15_0x126f6e(0x195),'risk':a15_0x126f6e(0x18d),'flags':[{...NAME_FLAG,'required':!![],'description':'Backend\x20Function\x20name'}],async 'execute'(_0x4ef802){const _0x4b3e10=a15_0x126f6e,_0xddcd93=await getBffEndpointContract(_0x4ef802['appCode'],_0x4ef802[_0x4b3e10(0x198)]('name'));return{'ok':!![],'data':{'appCode':_0xddcd93[_0x4b3e10(0x191)],'functionName':_0xddcd93['functionName'],'description':_0xddcd93[_0x4b3e10(0x19a)]||_0x4b3e10(0x18f),'version':_0xddcd93['version'],'gmtModified':_0xddcd93[_0x4b3e10(0x192)]}};}};
|
package/lib/commands/bff/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a16_0x4c68c9=a16_0x2d9a;function a16_0x2d9a(_0x4783b1,_0x24ac2b){_0x4783b1=_0x4783b1-0x12d;const _0x438f96=a16_0x438f();let _0x2d9a92=_0x438f96[_0x4783b1];return _0x2d9a92;}function a16_0x438f(){const _0x3db1b1=['138988oedybt','Backend\x20Function\x20executed\x20in\x20','read','5WkzZmi','now','20122FzviuY','bff','13616622nklRHK','name','975792WFIaKS','125GhMGrf','57xHciQC','params','7zwXBVm','Backend\x20Function\x20name\x20to\x20execute','20clylfD','str','Execute\x20a\x20Backend\x20Function\x20script\x20by\x20function\x20name','47110020eSdySt','8658920zwzICU','5353271JusWPz','13thxlyD'];a16_0x438f=function(){return _0x3db1b1;};return a16_0x438f();}(function(_0x49981d,_0x4b7a95){const _0x438f55=a16_0x2d9a,_0x20fe5d=_0x49981d();while(!![]){try{const _0x4e2cdf=parseInt(_0x438f55(0x13f))/0x1*(parseInt(_0x438f55(0x13a))/0x2)+parseInt(_0x438f55(0x140))/0x3*(-parseInt(_0x438f55(0x135))/0x4)+parseInt(_0x438f55(0x138))/0x5*(-parseInt(_0x438f55(0x13e))/0x6)+parseInt(_0x438f55(0x142))/0x7*(-parseInt(_0x438f55(0x132))/0x8)+-parseInt(_0x438f55(0x13c))/0x9+-parseInt(_0x438f55(0x12e))/0xa*(parseInt(_0x438f55(0x133))/0xb)+-parseInt(_0x438f55(0x131))/0xc*(-parseInt(_0x438f55(0x134))/0xd);if(_0x4e2cdf===_0x4b7a95)break;else _0x20fe5d['push'](_0x20fe5d['shift']());}catch(_0x5ef81f){_0x20fe5d['push'](_0x20fe5d['shift']());}}}(a16_0x438f,0xc15b6));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_0x4c68c9(0x13b),'command':'exec','description':a16_0x4c68c9(0x130),'risk':a16_0x4c68c9(0x137),'flags':[{...NAME_FLAG,'required':!![],'description':a16_0x4c68c9(0x12d)},PARAMS_FLAG],async 'execute'(_0x4d450d){const _0x3936ae=a16_0x4c68c9,_0x27fa6f=parseJsonParams(_0x4d450d[_0x3936ae(0x12f)](_0x3936ae(0x141))),_0x32f042=Date[_0x3936ae(0x139)](),_0x264423=await executeSdkBff(_0x4d450d['str'](_0x3936ae(0x13d)),_0x27fa6f),_0x1df8ef=Date[_0x3936ae(0x139)]()-_0x32f042;return{'ok':!![],'data':{'result':_0x264423,'elapsed':_0x1df8ef},'message':_0x3936ae(0x136)+_0x1df8ef+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x172589,_0x4d87f2){const _0x3a2cb6=a17_0x4db7,_0x280c6e=_0x172589();while(!![]){try{const _0x5df87a=parseInt(_0x3a2cb6(0x18a))/0x1+parseInt(_0x3a2cb6(0x188))/0x2*(parseInt(_0x3a2cb6(0x184))/0x3)+-parseInt(_0x3a2cb6(0x183))/0x4*(-parseInt(_0x3a2cb6(0x18b))/0x5)+parseInt(_0x3a2cb6(0x182))/0x6+-parseInt(_0x3a2cb6(0x185))/0x7+parseInt(_0x3a2cb6(0x186))/0x8+parseInt(_0x3a2cb6(0x189))/0x9*(-parseInt(_0x3a2cb6(0x187))/0xa);if(_0x5df87a===_0x4d87f2)break;else _0x280c6e['push'](_0x280c6e['shift']());}catch(_0x123c04){_0x280c6e['push'](_0x280c6e['shift']());}}}(a17_0x4215,0x86918));function a17_0x4215(){const _0x205e3a=['4932070ZtVmMG','130376ycnxcQ','36wHyeHP','201137oElVvw','4305570eorwPO','2926368cuArhg','4CHHFes','3JPunNS','9653UvuAVD','7281856fxsmMu'];a17_0x4215=function(){return _0x205e3a;};return a17_0x4215();}import{bffDetail}from'../../commands/bff/detail.js';import{bffExec}from'../../commands/bff/exec.js';function a17_0x4db7(_0x2f4288,_0x1b2fdf){_0x2f4288=_0x2f4288-0x182;const _0x421581=a17_0x4215();let _0x4db712=_0x421581[_0x2f4288];return _0x4db712;}export const bffDefinitions=[bffDetail,bffExec];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a18_0x406612=a18_0x2416;(function(_0x90dc42,_0x243433){const _0x505f1f=a18_0x2416,_0x457b10=_0x90dc42();while(!![]){try{const _0x450691=-parseInt(_0x505f1f(0x14a))/0x1+parseInt(_0x505f1f(0x156))/0x2*(parseInt(_0x505f1f(0x141))/0x3)+-parseInt(_0x505f1f(0x152))/0x4+-parseInt(_0x505f1f(0x144))/0x5+parseInt(_0x505f1f(0x147))/0x6*(-parseInt(_0x505f1f(0x14e))/0x7)+-parseInt(_0x505f1f(0x146))/0x8*(-parseInt(_0x505f1f(0x142))/0x9)+parseInt(_0x505f1f(0x14b))/0xa;if(_0x450691===_0x243433)break;else _0x457b10['push'](_0x457b10['shift']());}catch(_0x4bbe28){_0x457b10['push'](_0x457b10['shift']());}}}(a18_0x3f47,0x77404));import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';function a18_0x3f47(){const _0x867e51=['info','3vbeBZi','6847317AreKlx','skillVersion','4700820XlxiHX','apiError','8VCMdYn','48714zXpHiA','code','Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20npm\x20package.','643440ExMGht','21682530QBloYp','inherit','unknown','840wQSGiB','cwd','log','install','2831488LnWDod','installedPath','cli-skill-install','\x20at\x20','1650284FhuaMz','CLI\x20Built-in\x20Skill\x20','\x20installed','changed','nonInteractive','repairCommand','error','setLogPath','\x20is\x20already\x20current',']:\x20','read'];a18_0x3f47=function(){return _0x867e51;};return a18_0x3f47();}function a18_0x2416(_0x1a1ea0,_0x455271){_0x1a1ea0=_0x1a1ea0-0x13d;const _0x3f472a=a18_0x3f47();let _0x241628=_0x3f472a[_0x1a1ea0];return _0x241628;}import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':'cli-skill','command':a18_0x406612(0x151),'description':'Install\x20the\x20built-in\x20CLI\x20Skill\x20required\x20by\x20Lovrabet\x20runtime','risk':a18_0x406612(0x13f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3deaef){const _0x29baf7=a18_0x406612;logger[_0x29baf7(0x15d)](process[_0x29baf7(0x14f)]()),logger[_0x29baf7(0x140)](_0x29baf7(0x154),_0x29baf7(0x149));const _0x322b6a=installBuiltinSkill({'stdio':_0x3deaef[_0x29baf7(0x15a)]?'pipe':_0x29baf7(0x14c)});if(!_0x322b6a['ok'])throw CliErrors[_0x29baf7(0x145)]('Built-in\x20Skill\x20install\x20failed\x20['+(_0x322b6a[_0x29baf7(0x148)]||'INSTALL_FAILED')+_0x29baf7(0x13e)+(_0x322b6a[_0x29baf7(0x15c)]||_0x29baf7(0x14d)),'Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20'+_0x322b6a[_0x29baf7(0x15b)]);const _0x2af005=_0x322b6a[_0x29baf7(0x153)]?_0x29baf7(0x155)+_0x322b6a['installedPath']:'';return console[_0x29baf7(0x150)](_0x322b6a[_0x29baf7(0x159)]?_0x29baf7(0x157)+_0x322b6a[_0x29baf7(0x143)]+_0x29baf7(0x158)+_0x2af005:_0x29baf7(0x157)+_0x322b6a[_0x29baf7(0x143)]+_0x29baf7(0x13d)+_0x2af005),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2565c0,_0x5e6573){const _0x65cea9=a19_0x2880,_0x2ec0bf=_0x2565c0();while(!![]){try{const _0x3b8c62=parseInt(_0x65cea9(0x1e7))/0x1+parseInt(_0x65cea9(0x1e9))/0x2+-parseInt(_0x65cea9(0x1dd))/0x3+parseInt(_0x65cea9(0x1e3))/0x4+-parseInt(_0x65cea9(0x1de))/0x5+-parseInt(_0x65cea9(0x1e2))/0x6*(parseInt(_0x65cea9(0x1e1))/0x7)+parseInt(_0x65cea9(0x1df))/0x8*(parseInt(_0x65cea9(0x1e4))/0x9);if(_0x3b8c62===_0x5e6573)break;else _0x2ec0bf['push'](_0x2ec0bf['shift']());}catch(_0x47be08){_0x2ec0bf['push'](_0x2ec0bf['shift']());}}}(a19_0x2836,0x311f1));import{PRODUCT_CONFIG}from'../../constant/product.js';export{DEFAULT_APP_PROFILE_NAME,DEFAULT_CONFIG_VALUES}from'../../constant/defaults.js';export{RUNTIME_ENV_VALUES}from'../../constant/env.js';function a19_0x2880(_0x322a72,_0x5230db){_0x322a72=_0x322a72-0x1dd;const _0x283670=a19_0x2836();let _0x288001=_0x283670[_0x322a72];return _0x288001;}export{OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{isInProject}from'../../context.js';import{CliErrors}from'../../errors.js';export{buildAppProfileListFields,CONFIG_ENUM_VALUES,CLI_PROTECTED_CONFIG_KEYS,IMPORTABLE_RUNTIME_CONFIG_KEYS,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getConfigDefaultValue,getConfigEnumValues,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isLegacyCompatConfigKey,isCliProtectedConfigKey,isTopLevelConfigKey,normalizeLocale}from'../../config/schema.js';export function resolveConfigScope(_0x20a89e){const _0x48d4ac=a19_0x2880,{explicitGlobal:explicitGlobal=![],explicitProject:explicitProject=![],policy:_0x4d6bf2}=_0x20a89e;if(explicitGlobal&&explicitProject)throw CliErrors[_0x48d4ac(0x1ea)](_0x48d4ac(0x1ed),_0x48d4ac(0x1ec));if(explicitGlobal)return _0x48d4ac(0x1e5);if(explicitProject)return _0x48d4ac(0x1ee);switch(_0x4d6bf2){case'global-default':return'global';case'project-or-global-explicit':if(!(_0x20a89e[_0x48d4ac(0x1eb)]??isInProject()))throw CliErrors[_0x48d4ac(0x1ea)]('Not\x20inside\x20a\x20project\x20(no\x20'+PRODUCT_CONFIG[_0x48d4ac(0x1e0)]+_0x48d4ac(0x1e8),_0x48d4ac(0x1e6)+PRODUCT_CONFIG[_0x48d4ac(0x1e0)]+',\x20or\x20create\x20a\x20project-local\x20'+PRODUCT_CONFIG[_0x48d4ac(0x1e0)]+'\x20first.');return _0x48d4ac(0x1ee);}}function a19_0x2836(){const _0x25cf58=['newConfigFileName','2307655zWhXEL','6SSLJfN','1424000BTGVLg','45TTBIoS','global','Add\x20--global\x20to\x20write\x20to\x20~/','173198IEjKvW','\x20found).','615906PhVdqv','validation','inProject','Use\x20only\x20one\x20config\x20scope\x20flag.','Flags\x20--global\x20and\x20--project\x20are\x20mutually\x20exclusive.','project','391356urHMjX','1286040xvddez','130200jlwUEV'];a19_0x2836=function(){return _0x25cf58;};return a19_0x2836();}export function toScopeFlags(_0x487480){const _0xce5489=a19_0x2880;return{'global':_0x487480===_0xce5489(0x1e5)};}export function formatScopeLabel(_0x294a9a){const _0x2c3185=a19_0x2880;return _0x294a9a===_0x2c3185(0x1e5)?'\x20(global)':'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4d770e,_0xfe2ee2){const _0x2e3499=a20_0x3ab8,_0x4f7e21=_0x4d770e();while(!![]){try{const _0x3c28fb=parseInt(_0x2e3499(0xa8))/0x1*(parseInt(_0x2e3499(0xa3))/0x2)+parseInt(_0x2e3499(0xad))/0x3+parseInt(_0x2e3499(0xaa))/0x4*(-parseInt(_0x2e3499(0xa0))/0x5)+parseInt(_0x2e3499(0x9e))/0x6*(parseInt(_0x2e3499(0xa2))/0x7)+-parseInt(_0x2e3499(0xb0))/0x8*(-parseInt(_0x2e3499(0xb5))/0x9)+parseInt(_0x2e3499(0x97))/0xa*(parseInt(_0x2e3499(0x9c))/0xb)+parseInt(_0x2e3499(0x9f))/0xc*(-parseInt(_0x2e3499(0xb6))/0xd);if(_0x3c28fb===_0xfe2ee2)break;else _0x4f7e21['push'](_0x4f7e21['shift']());}catch(_0xb1e482){_0x4f7e21['push'](_0x4f7e21['shift']());}}}(a20_0x5925,0x51ea8));function a20_0x3ab8(_0x4e756d,_0x339c37){_0x4e756d=_0x4e756d-0x97;const _0x592568=a20_0x5925();let _0x3ab898=_0x592568[_0x4e756d];return _0x3ab898;}import{CliErrors}from'../../errors.js';function isSet(_0x319083,_0x312c9f){const _0x25af4b=a20_0x3ab8,_0x43aa0c=_0x319083[_0x25af4b(0xa4)](_0x312c9f);return _0x43aa0c!==undefined&&_0x43aa0c!==''&&_0x43aa0c!==![]&&_0x43aa0c!==0x0;}function fmtNames(_0x325ec5){const _0x4a544a=a20_0x3ab8;return _0x325ec5[_0x4a544a(0xab)](_0x584dec=>'--'+_0x584dec)[_0x4a544a(0x9a)](',\x20');}export function requireOneOf(_0x2d6cee,_0x24015d,_0x28ea02){const _0x29e49a=a20_0x3ab8,_0x486213=_0x24015d[_0x29e49a(0x99)](_0x5929a8=>isSet(_0x2d6cee,_0x5929a8));if(_0x486213[_0x29e49a(0x9b)]!==0x1)throw CliErrors[_0x29e49a(0xa9)](_0x486213[_0x29e49a(0x9b)]===0x0?'Exactly\x20one\x20of\x20'+fmtNames(_0x24015d)+_0x29e49a(0xac)+_0x28ea02+'`.':_0x29e49a(0xa7)+fmtNames(_0x24015d)+'\x20is\x20allowed,\x20found:\x20'+fmtNames(_0x486213)+'.',_0x486213[_0x29e49a(0x9b)]===0x0?'Provide\x20one\x20of:\x20'+fmtNames(_0x24015d):_0x29e49a(0xb4));}export function requireAnyOf(_0x25cc2f,_0x4f357b,_0x482419){const _0x378710=a20_0x3ab8;if(!_0x4f357b['some'](_0x58fcb4=>isSet(_0x25cc2f,_0x58fcb4)))throw CliErrors[_0x378710(0xa9)](_0x378710(0xa5)+fmtNames(_0x4f357b)+'\x20is\x20required\x20for\x20`'+_0x482419+'`.',_0x378710(0x9d)+fmtNames(_0x4f357b));}export function mutuallyExclusive(_0x5f1059,_0x47908f,_0x4ee9cf){const _0x1166cf=a20_0x3ab8,_0x29a67c=_0x47908f[_0x1166cf(0x99)](_0x2ffdfb=>isSet(_0x5f1059,_0x2ffdfb));if(_0x29a67c[_0x1166cf(0x9b)]>0x1)throw CliErrors[_0x1166cf(0xa9)](_0x1166cf(0x98)+fmtNames(_0x29a67c)+_0x1166cf(0xaf)+_0x4ee9cf+'`.',_0x1166cf(0xb1)+fmtNames(_0x47908f));}function a20_0x5925(){const _0x5cd75c=['Use\x20only\x20one\x20of:\x20','str',':\x20expected\x20','Remove\x20all\x20but\x20one.','9qJYTto','377spdNWd','210710DiZpJr','Flags\x20','filter','join','length','33sfbXHt','Provide\x20one\x20of:\x20','3877032szWOwS','362184vECOPi','616495dKbaYQ','test','7uwOPCd','2XYfeBi','flag','At\x20least\x20one\x20of\x20','Invalid\x20--','Only\x20one\x20of\x20','330643pgUicS','validation','4ZtIFhH','map','\x20is\x20required\x20for\x20`','809787mQXLnk',',\x20got\x20\x22','\x20are\x20mutually\x20exclusive\x20for\x20`','193184bTabJE'];a20_0x5925=function(){return _0x5cd75c;};return a20_0x5925();}export function validatePattern(_0x5ed931,_0xeb0e8f,_0x53b285,_0x543dd7){const _0x1cf0af=a20_0x3ab8,_0x3ee4bd=_0x5ed931[_0x1cf0af(0xb2)](_0xeb0e8f);if(_0x3ee4bd&&!_0x53b285[_0x1cf0af(0xa1)](_0x3ee4bd))throw CliErrors[_0x1cf0af(0xa9)](_0x1cf0af(0xa6)+_0xeb0e8f+_0x1cf0af(0xb3)+_0x543dd7+_0x1cf0af(0xae)+_0x3ee4bd+'\x22.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a21_0x48ca(_0x12b861,_0xc0c12){_0x12b861=_0x12b861-0xbb;const _0x53ab7b=a21_0x53ab();let _0x48caa7=_0x53ab7b[_0x12b861];return _0x48caa7;}const a21_0x51b8da=a21_0x48ca;(function(_0x45551a,_0x374dc0){const _0x127d4a=a21_0x48ca,_0x5252fe=_0x45551a();while(!![]){try{const _0x4c36c3=parseInt(_0x127d4a(0xd0))/0x1*(-parseInt(_0x127d4a(0xca))/0x2)+-parseInt(_0x127d4a(0xc5))/0x3+-parseInt(_0x127d4a(0xc7))/0x4*(-parseInt(_0x127d4a(0xcb))/0x5)+-parseInt(_0x127d4a(0xc3))/0x6+parseInt(_0x127d4a(0xc2))/0x7+-parseInt(_0x127d4a(0xc6))/0x8*(parseInt(_0x127d4a(0xc1))/0x9)+parseInt(_0x127d4a(0xcd))/0xa;if(_0x4c36c3===_0x374dc0)break;else _0x5252fe['push'](_0x5252fe['shift']());}catch(_0x1a32d8){_0x5252fe['push'](_0x5252fe['shift']());}}}(a21_0x53ab,0x66ead));function a21_0x53ab(){const _0x377aad=['14364250XthRqo','name','string','1ZLalqY','Resource\x20ID','boolean','global','Write\x20to\x20the\x20global\x20configuration','Resource\x20name\x20for\x20lookup','verbose','a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588)','9rBfxTr','1527897BbgeIO','2721306NuYYMR','params','598668FVdxUs','2561336lRuPTf','188vXYwcd','number','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','760574bEmBzJ','12810iBgFoH','sqlcode'];a21_0x53ab=function(){return _0x377aad;};return a21_0x53ab();}export const GLOBAL_SCOPE_FLAG={'name':a21_0x51b8da(0xbc),'type':a21_0x51b8da(0xbb),'default':![],'description':a21_0x51b8da(0xbd)};export const CODE_FLAG={'name':'code','type':'string','required':!![],'description':'Dataset\x20code\x20(32-char\x20hex\x20UUID)','pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a21_0x51b8da(0xc0)}};export const SQLCODE_FLAG={'name':a21_0x51b8da(0xcc),'type':a21_0x51b8da(0xcf),'required':!![],'description':'SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':'SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)'}};export const VERBOSE_FLAG={'name':a21_0x51b8da(0xbf),'type':'boolean','description':'Return\x20full\x20raw\x20response\x20object'};export const PARAMS_FLAG={'name':a21_0x51b8da(0xc4),'type':a21_0x51b8da(0xcf),'description':a21_0x51b8da(0xc9)};export const NAME_FLAG={'name':a21_0x51b8da(0xce),'type':a21_0x51b8da(0xcf),'description':a21_0x51b8da(0xbe)};export const ID_FLAG={'name':'id','type':a21_0x51b8da(0xc8),'required':!![],'description':a21_0x51b8da(0xd1)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a22_0x3cbe(_0x2aade1,_0x2bb1ca){_0x2aade1=_0x2aade1-0x1f3;const _0x2c834e=a22_0x2c83();let _0x3cbe37=_0x2c834e[_0x2aade1];return _0x3cbe37;}(function(_0x5744eb,_0x27119b){const _0x1942fe=a22_0x3cbe,_0x3687e8=_0x5744eb();while(!![]){try{const _0x139c9b=-parseInt(_0x1942fe(0x1fc))/0x1*(parseInt(_0x1942fe(0x1f5))/0x2)+-parseInt(_0x1942fe(0x203))/0x3*(parseInt(_0x1942fe(0x1f4))/0x4)+-parseInt(_0x1942fe(0x1f8))/0x5+-parseInt(_0x1942fe(0x1fd))/0x6*(parseInt(_0x1942fe(0x204))/0x7)+-parseInt(_0x1942fe(0x1fa))/0x8*(parseInt(_0x1942fe(0x206))/0x9)+-parseInt(_0x1942fe(0x1f6))/0xa*(-parseInt(_0x1942fe(0x205))/0xb)+parseInt(_0x1942fe(0x207))/0xc;if(_0x139c9b===_0x27119b)break;else _0x3687e8['push'](_0x3687e8['shift']());}catch(_0x20b286){_0x3687e8['push'](_0x3687e8['shift']());}}}(a22_0x2c83,0xd7883));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_0x2c83(){const _0x2b8ac9=['\x20path\x20is\x20required.','File\x20exceeds\x20the\x20runtime\x20upload\x20limit\x20of\x2050\x20MB:\x20','3UAbfxP','14987FZrWwC','176SJlXSP','495EGKzXf','44382492PKgaAK','validation','size','3183344yauibi','2PxmRaP','278870obJYui','isFile','3216400yUXlFg','ceil','202480rzycph','toFixed','26099VDcGip','1134mmzTmX','\x20MB','trim','File\x20is\x20not\x20a\x20regular\x20file:\x20'];a22_0x2c83=function(){return _0x2b8ac9;};return a22_0x2c83();}function formatBytes(_0x554f22){const _0x43d6c9=a22_0x3cbe;if(_0x554f22>=BYTES_PER_MB){const _0x536e1f=Math[_0x43d6c9(0x1f9)](_0x554f22/BYTES_PER_MB*0x64)/0x64;return _0x536e1f[_0x43d6c9(0x1fb)](0x2)+_0x43d6c9(0x1fe);}return _0x554f22+'\x20B';}export function requireRuntimeUploadFile(_0xcf31c,_0x25d0ab){const _0x31acca=a22_0x3cbe,_0x3b4063=_0xcf31c[_0x31acca(0x1ff)]();if(!_0x3b4063)throw CliErrors[_0x31acca(0x208)](_0x25d0ab+_0x31acca(0x201));if(!existsSync(_0x3b4063))throw CliErrors[_0x31acca(0x208)]('File\x20not\x20found:\x20'+_0x3b4063);const _0x511a84=statSync(_0x3b4063);if(!_0x511a84[_0x31acca(0x1f7)]())throw CliErrors[_0x31acca(0x208)](_0x31acca(0x200)+_0x3b4063);if(_0x511a84['size']>RUNTIME_UPLOAD_MAX_BYTES)throw CliErrors[_0x31acca(0x208)](_0x31acca(0x202)+_0x3b4063+'\x20('+formatBytes(_0x511a84[_0x31acca(0x1f3)])+')');return{'path':_0x3b4063,'size':_0x511a84[_0x31acca(0x1f3)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a23_0x39bdb1=a23_0x3ec4;(function(_0x46ff9f,_0x500215){const _0x5997e6=a23_0x3ec4,_0x7b9b37=_0x46ff9f();while(!![]){try{const _0x1a346c=parseInt(_0x5997e6(0xca))/0x1*(-parseInt(_0x5997e6(0x9c))/0x2)+parseInt(_0x5997e6(0x9f))/0x3*(parseInt(_0x5997e6(0xc1))/0x4)+parseInt(_0x5997e6(0x96))/0x5*(-parseInt(_0x5997e6(0xbe))/0x6)+-parseInt(_0x5997e6(0xc4))/0x7+-parseInt(_0x5997e6(0x97))/0x8*(-parseInt(_0x5997e6(0xc2))/0x9)+parseInt(_0x5997e6(0xc8))/0xa+-parseInt(_0x5997e6(0xbc))/0xb*(-parseInt(_0x5997e6(0xb1))/0xc);if(_0x1a346c===_0x500215)break;else _0x7b9b37['push'](_0x7b9b37['shift']());}catch(_0x3cafac){_0x7b9b37['push'](_0x7b9b37['shift']());}}}(a23_0x38f5,0x54f34));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(_0x457455){const _0x66d103=a23_0x3ec4,_0x56dc93=_0x457455['split']('.');if(_0x56dc93[_0x66d103(0xcc)]!==0x3||_0x56dc93[0x0]!=='apps'||_0x56dc93[0x2]!==_0x66d103(0x98))return undefined;const _0x3fc3f9=_0x56dc93[0x1]?.[_0x66d103(0xce)]();return _0x3fc3f9?_0x3fc3f9:undefined;}function parseAliasDeleteKey(_0x5c0015){const _0x3caf35=a23_0x3ec4,_0xa423a5=_0x5c0015[_0x3caf35(0xc5)]('.');if(_0xa423a5[_0x3caf35(0xcc)]===0x2&&_0xa423a5[0x0]==='apps'){const _0x243d87=_0xa423a5[0x1]?.[_0x3caf35(0xce)]();return _0x243d87?{'alias':_0x243d87}:undefined;}if(_0xa423a5[_0x3caf35(0xcc)]===0x3&&_0xa423a5[0x0]===_0x3caf35(0x8e)&&_0xa423a5[0x2]===_0x3caf35(0x98)){const _0x25cb2d=_0xa423a5[0x1]?.[_0x3caf35(0xce)]();return _0x25cb2d?{'alias':_0x25cb2d,'field':_0x3caf35(0x98)}:undefined;}return undefined;}function setLocalAppAlias(_0x39ee6c,_0x289017,_0x269f1c){const _0x5120df=a23_0x3ec4,_0x6d979e=_0x39ee6c['apps']&&typeof _0x39ee6c['apps']==='object'&&!Array['isArray'](_0x39ee6c[_0x5120df(0x8e)])?_0x39ee6c[_0x5120df(0x8e)]:{},_0x1dd7e0=_0x6d979e[_0x289017]&&typeof _0x6d979e[_0x289017]===_0x5120df(0xc3)&&!Array[_0x5120df(0xa4)](_0x6d979e[_0x289017])?_0x6d979e[_0x289017]:{};_0x1dd7e0[_0x5120df(0x98)]=_0x269f1c,_0x6d979e[_0x289017]=_0x1dd7e0,_0x39ee6c[_0x5120df(0x8e)]=_0x6d979e;}function a23_0x3ec4(_0x4a6246,_0x4f7993){_0x4a6246=_0x4a6246-0x8d;const _0x38f515=a23_0x38f5();let _0x3ec4db=_0x38f515[_0x4a6246];return _0x3ec4db;}function deleteLocalAppAlias(_0x2c7e1a,_0x26ccc5){const _0x59d6dd=a23_0x3ec4;if(!_0x2c7e1a[_0x59d6dd(0x8e)]||typeof _0x2c7e1a[_0x59d6dd(0x8e)]!==_0x59d6dd(0xc3)||Array[_0x59d6dd(0xa4)](_0x2c7e1a['apps']))return![];const _0x585fc0=_0x2c7e1a['apps'],_0x28239b=_0x585fc0[_0x26ccc5[_0x59d6dd(0xaf)]];if(!_0x28239b||typeof _0x28239b!==_0x59d6dd(0xc3)||Array[_0x59d6dd(0xa4)](_0x28239b))return![];if(!_0x26ccc5['field'])return delete _0x585fc0[_0x26ccc5[_0x59d6dd(0xaf)]],!![];if(!(_0x26ccc5['field']in _0x28239b))return![];return delete _0x28239b[_0x26ccc5['field']],Object[_0x59d6dd(0xb5)](_0x28239b)['length']===0x0&&delete _0x585fc0[_0x26ccc5[_0x59d6dd(0xaf)]],!![];}function a23_0x38f5(){const _0xca2f89=['log','85MvhgUT','8DLsiau','appcode','(none)','raw','config','516EzEeKW','delete','set','3909gNBXvF','value','format','validation','Set\x20`','isArray','Deletes\x20a\x20Lovrabet\x20CLI\x20config\x20key.\x20Later\x20commands\x20will\x20fall\x20back\x20to\x20another\x20config\x20layer\x20or\x20the\x20default.','Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US','Key\x20already\x20absent:\x20','stringify','\x20\x20project:\x20','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','Delete\x20a\x20configuration\x20value','global','\x20config\x20set\x20<key>\x20<value>\x20[--global]','bool','alias','\x22.\x20Allowed:\x20','24DRKEse','Invalid\x20locale\x20value.','Settable\x20keys:\x20','Deleted\x20`','keys','\x22\x20is\x20not\x20settable.','write','Key\x20not\x20found:\x20','Missing\x20key\x20argument.','Get\x20a\x20config\x20value','Config\x20files:\x0a','6288997QtwmSr','List\x20current\x20config','5790zScTYg','args','key','36MFYnMh','1558278MCsxop','object','3171686qbPRdj','split','pretty','get','1057560wHNhnR','Changes\x20Lovrabet\x20CLI\x20configuration.\x20Later\x20commands\x20may\x20use\x20a\x20different\x20app,\x20environment,\x20or\x20output\x20behavior.','2390YnRsUP','Usage:\x20','length','pageSize','trim','Value\x20to\x20assign','\x20config\x20delete\x20<key>\x20[--global]','apps','\x22\x20is\x20protected\x20and\x20cannot\x20be\x20changed\x20via\x20config\x20commands.','locale','\x20(global)','Top-level\x20key\x20\x22','../../context.js','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a'];a23_0x38f5=function(){return _0xca2f89;};return a23_0x38f5();}const listDef={'service':a23_0x39bdb1(0x9b),'command':'list','description':a23_0x39bdb1(0xbd),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x4c9356){const _0x36e16e=a23_0x39bdb1,{buildConfigFromFlags:_0x5d8206}=await import(_0x36e16e(0x93)),_0x15bd1f=_0x5d8206({}),_0x466e7c=redactCliConfigCredentials(_0x15bd1f[_0x36e16e(0x9a)]),_0xba614=getProjectConfigPath(),_0x5a200d=resolveWriteConfigPath(_0x36e16e(0xac));if(_0x4c9356[_0x36e16e(0xa1)]===_0x36e16e(0xc6))return{'ok':!![],'message':_0x36e16e(0x94)+(JSON[_0x36e16e(0xa8)](_0x466e7c,null,0x2)+'\x0a\x0a')+_0x36e16e(0xbb)+(_0x36e16e(0xa9)+(_0xba614??_0x36e16e(0x99))+'\x0a')+('\x20\x20global:\x20\x20'+_0x5a200d)};return{'ok':!![],'data':{'effective':_0x466e7c,'configFiles':{'project':_0xba614??null,'global':_0x5a200d}}};}},getDef={'service':a23_0x39bdb1(0x9b),'command':a23_0x39bdb1(0xc7),'description':a23_0x39bdb1(0xba),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a23_0x39bdb1(0xc0),'description':a23_0x39bdb1(0xaa),'required':!![]}],'flags':[],async 'execute'(_0x5ad748){const _0xbda4e7=a23_0x39bdb1,_0x215daa=_0x5ad748['args'][0x0];if(!_0x215daa)throw CliErrors[_0xbda4e7(0xa2)](_0xbda4e7(0xb9),_0xbda4e7(0xcb)+CLI_BIN_NAME+'\x20config\x20get\x20<key>');const {buildConfigFromFlags:_0x58deb5}=await import(_0xbda4e7(0x93)),{raw:_0x25facb}=_0x58deb5({});if(_0x215daa['includes']('.')){const _0x51156a=_0x215daa['split']('.');let _0xfa9d4d=_0x25facb;for(const _0x4d6ec3 of _0x51156a){if(_0xfa9d4d==null||typeof _0xfa9d4d!==_0xbda4e7(0xc3))throw CliErrors[_0xbda4e7(0xa2)](_0xbda4e7(0xb8)+_0x215daa);_0xfa9d4d=_0xfa9d4d[_0x4d6ec3];}if(_0xfa9d4d===undefined)throw CliErrors[_0xbda4e7(0xa2)](_0xbda4e7(0xb8)+_0x215daa);const _0x2073f2=redactCliConfigValue(_0x215daa,_0xfa9d4d);return console[_0xbda4e7(0x95)](typeof _0x2073f2===_0xbda4e7(0xc3)?JSON[_0xbda4e7(0xa8)](_0x2073f2,null,0x2):String(_0x2073f2)),{'ok':!![]};}const _0xf65862=_0x25facb[_0x215daa];if(_0xf65862===undefined)throw CliErrors[_0xbda4e7(0xa2)](_0xbda4e7(0xb8)+_0x215daa);const _0x481061=redactCliConfigValue(_0x215daa,_0xf65862);return console[_0xbda4e7(0x95)](typeof _0x481061===_0xbda4e7(0xc3)?JSON[_0xbda4e7(0xa8)](_0x481061,null,0x2):String(_0x481061)),{'ok':!![]};}},setDef={'service':a23_0x39bdb1(0x9b),'command':a23_0x39bdb1(0x9e),'description':'Set\x20a\x20configuration\x20value','risk':a23_0x39bdb1(0xb7),'confirmationDescription':a23_0x39bdb1(0xc9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]},{'name':a23_0x39bdb1(0xa0),'description':a23_0x39bdb1(0xcf),'required':!![]}],'flags':[GLOBAL_SCOPE_FLAG],async 'execute'(_0xef6bf2){const _0x464060=a23_0x39bdb1,_0x35eba9=_0xef6bf2[_0x464060(0xbf)][0x0],_0x154705=_0xef6bf2[_0x464060(0xbf)][0x1];if(!_0x35eba9||_0x154705===undefined)throw CliErrors['validation']('Missing\x20key\x20or\x20value.',_0x464060(0xcb)+CLI_BIN_NAME+_0x464060(0xad));if(ENUM_KEYS[_0x35eba9]&&!ENUM_KEYS[_0x35eba9]['includes'](_0x154705))throw CliErrors[_0x464060(0xa2)]('Invalid\x20value\x20for\x20\x22'+_0x35eba9+_0x464060(0xb0)+ENUM_KEYS[_0x35eba9]['join'](',\x20'));if(isCliProtectedConfigKey(_0x35eba9))throw CliErrors[_0x464060(0xa2)]('\x22'+_0x35eba9+_0x464060(0x8f));if(_0x35eba9===_0x464060(0xcd)){const _0x240db8=Number(_0x154705);if(isNaN(_0x240db8)||_0x240db8<=0x0)throw CliErrors[_0x464060(0xa2)]('pageSize\x20must\x20be\x20a\x20positive\x20number');}const _0x339a12=resolveWriteScope({'explicitGlobal':_0xef6bf2[_0x464060(0xae)](_0x464060(0xac)),'policy':'project-or-global-explicit'}),_0x41c32f=toScopeFlags(_0x339a12),_0x216858=readScopedConfig(_0x41c32f),_0x30da8d=parseAliasAppcodeSetKey(_0x35eba9);if(!_0x30da8d&&!isTopLevelConfigKey(_0x35eba9))throw CliErrors[_0x464060(0xa2)](_0x464060(0x92)+_0x35eba9+_0x464060(0xb6),_0x464060(0xb3)+getTopLevelConfigKeySummary()+';\x20apps.<alias>.appcode');if(_0x30da8d)setLocalAppAlias(_0x216858,_0x30da8d,_0x154705);else{if(_0x35eba9===_0x464060(0x90)){const _0x3c9122=normalizeLocale(_0x154705);if(!_0x3c9122)throw CliErrors[_0x464060(0xa2)](_0x464060(0xb2),_0x464060(0xa6));_0x216858[_0x464060(0x90)]=_0x3c9122;}else _0x216858[_0x35eba9]=_0x35eba9===_0x464060(0xcd)?Number(_0x154705):DOMAIN_CONFIG_FIELDS['includes'](_0x35eba9)?normalizeDomainOrigin(_0x35eba9,_0x154705):_0x154705;}const _0x4ad7c1=_0x35eba9==='accessKey'?maskCliAccessKey(_0x154705):!_0x30da8d&&_0x35eba9==='locale'?String(_0x216858[_0x464060(0x90)]):_0x154705;return console['log'](_0x464060(0xa3)+_0x35eba9+'`\x20=\x20\x22'+_0x4ad7c1+'\x22'+(_0x339a12===_0x464060(0xac)?_0x464060(0x91):'')),writeScopedConfig(_0x216858,_0x41c32f),{'ok':!![]};}},deleteDef={'service':'config','command':a23_0x39bdb1(0x9d),'description':a23_0x39bdb1(0xab),'risk':a23_0x39bdb1(0xb7),'confirmationDescription':a23_0x39bdb1(0xa5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_SCOPE_FLAG],async 'execute'(_0x4da0b3){const _0x2b02ac=a23_0x39bdb1,_0x5d93d4=_0x4da0b3[_0x2b02ac(0xbf)][0x0];if(!_0x5d93d4)throw CliErrors[_0x2b02ac(0xa2)](_0x2b02ac(0xb9),_0x2b02ac(0xcb)+CLI_BIN_NAME+_0x2b02ac(0x8d));if(isCliProtectedConfigKey(_0x5d93d4))throw CliErrors[_0x2b02ac(0xa2)]('\x22'+_0x5d93d4+_0x2b02ac(0x8f));const _0x4582b3=resolveWriteScope({'explicitGlobal':_0x4da0b3[_0x2b02ac(0xae)](_0x2b02ac(0xac)),'policy':'project-or-global-explicit'}),_0x89de67=toScopeFlags(_0x4582b3),_0x346578=readScopedConfig(_0x89de67),_0x24e59d=parseAliasDeleteKey(_0x5d93d4);if(_0x24e59d){if(!deleteLocalAppAlias(_0x346578,_0x24e59d))return console['log'](_0x2b02ac(0xa7)+_0x5d93d4+(_0x4582b3===_0x2b02ac(0xac)?_0x2b02ac(0x91):'')),{'ok':!![],'data':{'key':_0x5d93d4,'scope':_0x4582b3,'changed':![]}};return console['log'](_0x2b02ac(0xb4)+_0x5d93d4+'`'+(_0x4582b3===_0x2b02ac(0xac)?'\x20(global)':'')),writeScopedConfig(_0x346578,_0x89de67),{'ok':!![],'data':{'key':_0x5d93d4,'scope':_0x4582b3,'changed':!![]}};}if(_0x346578[_0x5d93d4]===undefined)return console['log'](_0x2b02ac(0xa7)+_0x5d93d4+(_0x4582b3===_0x2b02ac(0xac)?'\x20(global)':'')),{'ok':!![],'data':{'key':_0x5d93d4,'scope':_0x4582b3,'changed':![]}};return delete _0x346578[_0x5d93d4],console[_0x2b02ac(0x95)](_0x2b02ac(0xb4)+_0x5d93d4+'`'+(_0x4582b3==='global'?'\x20(global)':'')),writeScopedConfig(_0x346578,_0x89de67),{'ok':!![],'data':{'key':_0x5d93d4,'scope':_0x4582b3,'changed':!![]}};}};export const configDefinitions=[configInitDefinition,listDef,getDef,setDef,deleteDef];
|
|
1
|
+
const a23_0xdc7412=a23_0x2d22;(function(_0x35adcd,_0x400726){const _0xadcb5c=a23_0x2d22,_0x360c37=_0x35adcd();while(!![]){try{const _0x1532a7=parseInt(_0xadcb5c(0x15f))/0x1+-parseInt(_0xadcb5c(0x156))/0x2+-parseInt(_0xadcb5c(0x13a))/0x3*(parseInt(_0xadcb5c(0x16a))/0x4)+-parseInt(_0xadcb5c(0x166))/0x5*(parseInt(_0xadcb5c(0x142))/0x6)+parseInt(_0xadcb5c(0x146))/0x7+-parseInt(_0xadcb5c(0x16d))/0x8+-parseInt(_0xadcb5c(0x164))/0x9*(-parseInt(_0xadcb5c(0x170))/0xa);if(_0x1532a7===_0x400726)break;else _0x360c37['push'](_0x360c37['shift']());}catch(_0x551ca7){_0x360c37['push'](_0x360c37['shift']());}}}(a23_0x3f9b,0x59d29));function a23_0x2d22(_0x52d4d1,_0x5f2706){_0x52d4d1=_0x52d4d1-0x139;const _0x3f9b67=a23_0x3f9b();let _0x2d22bf=_0x3f9b67[_0x52d4d1];return _0x2d22bf;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isCliProtectedConfigKey,isTopLevelConfigKey,normalizeLocale,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';import{DOMAIN_CONFIG_FIELDS,normalizeDomainOrigin}from'../../config/domain-config.js';import{configInitDefinition}from'../../commands/config/init.js';function a23_0x3f9b(){const _0x3926b7=['Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','\x20config\x20get\x20<key>','Deletes\x20a\x20Lovrabet\x20CLI\x20config\x20key.\x20Later\x20commands\x20will\x20fall\x20back\x20to\x20another\x20config\x20layer\x20or\x20the\x20default.','79432SCPMno','length','Deleted\x20`','4976176VdzPXg','raw','pageSize\x20must\x20be\x20a\x20positive\x20number','16550jJkUIo','args','\x22.\x20Allowed:\x20','isArray','project-or-global-explicit','value','accessKey','Missing\x20key\x20argument.','delete','global','validation',';\x20apps.<alias>.appcode','trim','\x20\x20global:\x20\x20','6kScKVH','Key\x20not\x20found:\x20','Get\x20a\x20config\x20value','Set\x20`','Delete\x20a\x20configuration\x20value','join','../../context.js','Key\x20already\x20absent:\x20','289242EzvsSw','list','List\x20current\x20config','alias','898828eBWHiM','Invalid\x20locale\x20value.','locale','Settable\x20keys:\x20','\x20(global)','\x20config\x20set\x20<key>\x20<value>\x20[--global]','format','Set\x20a\x20configuration\x20value','field','includes','Invalid\x20value\x20for\x20\x22','key','Value\x20to\x20assign','appcode','write','log','1467486FbGRGe','`\x20=\x20\x22','pageSize','pretty','config','read','object','Usage:\x20','bool','10457OmSguF','apps','split','stringify','Missing\x20key\x20or\x20value.','11718zzrFTP','\x22\x20is\x20not\x20settable.','55BQiaBy'];a23_0x3f9b=function(){return _0x3926b7;};return a23_0x3f9b();}import{GLOBAL_SCOPE_FLAG}from'../../commands/common/flags.js';import{maskCliAccessKey,redactCliConfigCredentials,redactCliConfigValue}from'../../utils/access-key-redaction.js';function parseAliasAppcodeSetKey(_0x5ac9d6){const _0x500d26=a23_0x2d22,_0x18d73f=_0x5ac9d6['split']('.');if(_0x18d73f[_0x500d26(0x16b)]!==0x3||_0x18d73f[0x0]!==_0x500d26(0x160)||_0x18d73f[0x2]!=='appcode')return undefined;const _0x5e558d=_0x18d73f[0x1]?.[_0x500d26(0x17c)]();return _0x5e558d?_0x5e558d:undefined;}function parseAliasDeleteKey(_0x10712f){const _0x1ffbad=a23_0x2d22,_0x4cf8ed=_0x10712f[_0x1ffbad(0x161)]('.');if(_0x4cf8ed[_0x1ffbad(0x16b)]===0x2&&_0x4cf8ed[0x0]===_0x1ffbad(0x160)){const _0x3cfccc=_0x4cf8ed[0x1]?.[_0x1ffbad(0x17c)]();return _0x3cfccc?{'alias':_0x3cfccc}:undefined;}if(_0x4cf8ed['length']===0x3&&_0x4cf8ed[0x0]===_0x1ffbad(0x160)&&_0x4cf8ed[0x2]==='appcode'){const _0x47f9b3=_0x4cf8ed[0x1]?.['trim']();return _0x47f9b3?{'alias':_0x47f9b3,'field':_0x1ffbad(0x153)}:undefined;}return undefined;}function setLocalAppAlias(_0xfc1f28,_0x56426c,_0x5f1375){const _0x122cd7=a23_0x2d22,_0x540513=_0xfc1f28[_0x122cd7(0x160)]&&typeof _0xfc1f28[_0x122cd7(0x160)]===_0x122cd7(0x15c)&&!Array[_0x122cd7(0x173)](_0xfc1f28['apps'])?_0xfc1f28[_0x122cd7(0x160)]:{},_0x386fad=_0x540513[_0x56426c]&&typeof _0x540513[_0x56426c]===_0x122cd7(0x15c)&&!Array[_0x122cd7(0x173)](_0x540513[_0x56426c])?_0x540513[_0x56426c]:{};_0x386fad['appcode']=_0x5f1375,_0x540513[_0x56426c]=_0x386fad,_0xfc1f28[_0x122cd7(0x160)]=_0x540513;}function deleteLocalAppAlias(_0x170930,_0x1f2971){const _0xd8ac3b=a23_0x2d22;if(!_0x170930[_0xd8ac3b(0x160)]||typeof _0x170930[_0xd8ac3b(0x160)]!==_0xd8ac3b(0x15c)||Array['isArray'](_0x170930[_0xd8ac3b(0x160)]))return![];const _0x3c41b3=_0x170930[_0xd8ac3b(0x160)],_0x6a23f6=_0x3c41b3[_0x1f2971[_0xd8ac3b(0x145)]];if(!_0x6a23f6||typeof _0x6a23f6!=='object'||Array['isArray'](_0x6a23f6))return![];if(!_0x1f2971['field'])return delete _0x3c41b3[_0x1f2971[_0xd8ac3b(0x145)]],!![];if(!(_0x1f2971[_0xd8ac3b(0x14e)]in _0x6a23f6))return![];return delete _0x6a23f6[_0x1f2971[_0xd8ac3b(0x14e)]],Object['keys'](_0x6a23f6)['length']===0x0&&delete _0x3c41b3[_0x1f2971[_0xd8ac3b(0x145)]],!![];}const listDef={'service':a23_0xdc7412(0x15a),'command':a23_0xdc7412(0x143),'description':a23_0xdc7412(0x144),'risk':a23_0xdc7412(0x15b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x40b5ca){const _0x8cd47d=a23_0xdc7412,{buildConfigFromFlags:_0x5c538c}=await import(_0x8cd47d(0x140)),_0x3f9fbd=_0x5c538c({}),_0x777b53=redactCliConfigCredentials(_0x3f9fbd[_0x8cd47d(0x16e)]),_0x5548de=getProjectConfigPath(),_0x4a6014=resolveWriteConfigPath(_0x8cd47d(0x179));if(_0x40b5ca[_0x8cd47d(0x14c)]===_0x8cd47d(0x159))return{'ok':!![],'message':'#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a'+(JSON[_0x8cd47d(0x162)](_0x777b53,null,0x2)+'\x0a\x0a')+'Config\x20files:\x0a'+('\x20\x20project:\x20'+(_0x5548de??'(none)')+'\x0a')+(_0x8cd47d(0x139)+_0x4a6014)};return{'ok':!![],'data':{'effective':_0x777b53,'configFiles':{'project':_0x5548de??null,'global':_0x4a6014}}};}},getDef={'service':a23_0xdc7412(0x15a),'command':'get','description':a23_0xdc7412(0x13c),'risk':a23_0xdc7412(0x15b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a23_0xdc7412(0x151),'description':a23_0xdc7412(0x167),'required':!![]}],'flags':[],async 'execute'(_0x14e22a){const _0x120fb9=a23_0xdc7412,_0x22f61f=_0x14e22a[_0x120fb9(0x171)][0x0];if(!_0x22f61f)throw CliErrors[_0x120fb9(0x17a)]('Missing\x20key\x20argument.',_0x120fb9(0x15d)+CLI_BIN_NAME+_0x120fb9(0x168));const {buildConfigFromFlags:_0x9c35ad}=await import(_0x120fb9(0x140)),{raw:_0x3f735a}=_0x9c35ad({});if(_0x22f61f[_0x120fb9(0x14f)]('.')){const _0x46c3cb=_0x22f61f[_0x120fb9(0x161)]('.');let _0x1c1537=_0x3f735a;for(const _0x381478 of _0x46c3cb){if(_0x1c1537==null||typeof _0x1c1537!==_0x120fb9(0x15c))throw CliErrors[_0x120fb9(0x17a)](_0x120fb9(0x13b)+_0x22f61f);_0x1c1537=_0x1c1537[_0x381478];}if(_0x1c1537===undefined)throw CliErrors[_0x120fb9(0x17a)]('Key\x20not\x20found:\x20'+_0x22f61f);const _0x159712=redactCliConfigValue(_0x22f61f,_0x1c1537);return console[_0x120fb9(0x155)](typeof _0x159712===_0x120fb9(0x15c)?JSON[_0x120fb9(0x162)](_0x159712,null,0x2):String(_0x159712)),{'ok':!![]};}const _0x9af2d0=_0x3f735a[_0x22f61f];if(_0x9af2d0===undefined)throw CliErrors['validation']('Key\x20not\x20found:\x20'+_0x22f61f);const _0x4f4402=redactCliConfigValue(_0x22f61f,_0x9af2d0);return console[_0x120fb9(0x155)](typeof _0x4f4402===_0x120fb9(0x15c)?JSON[_0x120fb9(0x162)](_0x4f4402,null,0x2):String(_0x4f4402)),{'ok':!![]};}},setDef={'service':'config','command':'set','description':a23_0xdc7412(0x14d),'risk':a23_0xdc7412(0x154),'confirmationDescription':'Changes\x20Lovrabet\x20CLI\x20configuration.\x20Later\x20commands\x20may\x20use\x20a\x20different\x20app,\x20environment,\x20or\x20output\x20behavior.','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]},{'name':a23_0xdc7412(0x175),'description':a23_0xdc7412(0x152),'required':!![]}],'flags':[GLOBAL_SCOPE_FLAG],async 'execute'(_0x147b67){const _0x29b356=a23_0xdc7412,_0x489211=_0x147b67[_0x29b356(0x171)][0x0],_0x72068d=_0x147b67[_0x29b356(0x171)][0x1];if(!_0x489211||_0x72068d===undefined)throw CliErrors[_0x29b356(0x17a)](_0x29b356(0x163),_0x29b356(0x15d)+CLI_BIN_NAME+_0x29b356(0x14b));if(ENUM_KEYS[_0x489211]&&!ENUM_KEYS[_0x489211][_0x29b356(0x14f)](_0x72068d))throw CliErrors[_0x29b356(0x17a)](_0x29b356(0x150)+_0x489211+_0x29b356(0x172)+ENUM_KEYS[_0x489211][_0x29b356(0x13f)](',\x20'));if(isCliProtectedConfigKey(_0x489211))throw CliErrors[_0x29b356(0x17a)]('\x22'+_0x489211+'\x22\x20is\x20protected\x20and\x20cannot\x20be\x20changed\x20via\x20config\x20commands.');if(_0x489211==='pageSize'){const _0x92c569=Number(_0x72068d);if(isNaN(_0x92c569)||_0x92c569<=0x0)throw CliErrors[_0x29b356(0x17a)](_0x29b356(0x16f));}const _0x5e1289=resolveWriteScope({'explicitGlobal':_0x147b67[_0x29b356(0x15e)](_0x29b356(0x179)),'policy':_0x29b356(0x174)}),_0x48da61=toScopeFlags(_0x5e1289),_0x1083fd=readScopedConfig(_0x48da61),_0x284723=parseAliasAppcodeSetKey(_0x489211);if(!_0x284723&&!isTopLevelConfigKey(_0x489211))throw CliErrors['validation']('Top-level\x20key\x20\x22'+_0x489211+_0x29b356(0x165),_0x29b356(0x149)+getTopLevelConfigKeySummary()+_0x29b356(0x17b));if(_0x284723)setLocalAppAlias(_0x1083fd,_0x284723,_0x72068d);else{if(_0x489211==='locale'){const _0x4d496f=normalizeLocale(_0x72068d);if(!_0x4d496f)throw CliErrors[_0x29b356(0x17a)](_0x29b356(0x147),'Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US');_0x1083fd[_0x29b356(0x148)]=_0x4d496f;}else _0x1083fd[_0x489211]=_0x489211===_0x29b356(0x158)?Number(_0x72068d):DOMAIN_CONFIG_FIELDS[_0x29b356(0x14f)](_0x489211)?normalizeDomainOrigin(_0x489211,_0x72068d):_0x72068d;}const _0x4ec28b=_0x489211===_0x29b356(0x176)?maskCliAccessKey(_0x72068d):!_0x284723&&_0x489211==='locale'?String(_0x1083fd['locale']):_0x72068d;return console[_0x29b356(0x155)](_0x29b356(0x13d)+_0x489211+_0x29b356(0x157)+_0x4ec28b+'\x22'+(_0x5e1289===_0x29b356(0x179)?_0x29b356(0x14a):'')),writeScopedConfig(_0x1083fd,_0x48da61),{'ok':!![]};}},deleteDef={'service':a23_0xdc7412(0x15a),'command':a23_0xdc7412(0x178),'description':a23_0xdc7412(0x13e),'risk':'write','confirmationDescription':a23_0xdc7412(0x169),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a23_0xdc7412(0x151),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_SCOPE_FLAG],async 'execute'(_0x311eb3){const _0x12db85=a23_0xdc7412,_0x707f76=_0x311eb3[_0x12db85(0x171)][0x0];if(!_0x707f76)throw CliErrors[_0x12db85(0x17a)](_0x12db85(0x177),_0x12db85(0x15d)+CLI_BIN_NAME+'\x20config\x20delete\x20<key>\x20[--global]');if(isCliProtectedConfigKey(_0x707f76))throw CliErrors[_0x12db85(0x17a)]('\x22'+_0x707f76+'\x22\x20is\x20protected\x20and\x20cannot\x20be\x20changed\x20via\x20config\x20commands.');const _0x20b99e=resolveWriteScope({'explicitGlobal':_0x311eb3[_0x12db85(0x15e)](_0x12db85(0x179)),'policy':_0x12db85(0x174)}),_0x43a90b=toScopeFlags(_0x20b99e),_0x28d434=readScopedConfig(_0x43a90b),_0x570aad=parseAliasDeleteKey(_0x707f76);if(_0x570aad){if(!deleteLocalAppAlias(_0x28d434,_0x570aad))return console[_0x12db85(0x155)](_0x12db85(0x141)+_0x707f76+(_0x20b99e==='global'?_0x12db85(0x14a):'')),{'ok':!![],'data':{'key':_0x707f76,'scope':_0x20b99e,'changed':![]}};return console[_0x12db85(0x155)](_0x12db85(0x16c)+_0x707f76+'`'+(_0x20b99e===_0x12db85(0x179)?_0x12db85(0x14a):'')),writeScopedConfig(_0x28d434,_0x43a90b),{'ok':!![],'data':{'key':_0x707f76,'scope':_0x20b99e,'changed':!![]}};}if(_0x28d434[_0x707f76]===undefined)return console[_0x12db85(0x155)](_0x12db85(0x141)+_0x707f76+(_0x20b99e===_0x12db85(0x179)?_0x12db85(0x14a):'')),{'ok':!![],'data':{'key':_0x707f76,'scope':_0x20b99e,'changed':![]}};return delete _0x28d434[_0x707f76],console[_0x12db85(0x155)]('Deleted\x20`'+_0x707f76+'`'+(_0x20b99e===_0x12db85(0x179)?'\x20(global)':'')),writeScopedConfig(_0x28d434,_0x43a90b),{'ok':!![],'data':{'key':_0x707f76,'scope':_0x20b99e,'changed':!![]}};}};export const configDefinitions=[configInitDefinition,listDef,getDef,setDef,deleteDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x40336f=a24_0x12e7;(function(_0x1296d1,_0xa40d24){const _0x2ff409=a24_0x12e7,_0x1c25d4=_0x1296d1();while(!![]){try{const _0x64e524=-parseInt(_0x2ff409(0x9c))/0x1*(-parseInt(_0x2ff409(0xb7))/0x2)+parseInt(_0x2ff409(0xc1))/0x3*(parseInt(_0x2ff409(0x98))/0x4)+-parseInt(_0x2ff409(0xa4))/0x5*(parseInt(_0x2ff409(0xbd))/0x6)+parseInt(_0x2ff409(0x9e))/0x7+-parseInt(_0x2ff409(0xa9))/0x8*(-parseInt(_0x2ff409(0xae))/0x9)+parseInt(_0x2ff409(0xa6))/0xa+-parseInt(_0x2ff409(0xaa))/0xb;if(_0x64e524===_0xa40d24)break;else _0x1c25d4['push'](_0x1c25d4['shift']());}catch(_0x24413a){_0x1c25d4['push'](_0x1c25d4['shift']());}}}(a24_0x517f,0x8b8fc));import{select}from'@inquirer/prompts';import{CliErrors}from'../../errors.js';function a24_0x12e7(_0x4c8beb,_0x11e958){_0x4c8beb=_0x4c8beb-0x93;const _0x517f1f=a24_0x517f();let _0x12e79f=_0x517f1f[_0x4c8beb];return _0x12e79f;}import{readScopedConfig,writeScopedConfig}from'../../commands/config/shared.js';import{DOMAIN_CONFIG_FIELDS,LEGACY_DOMAIN_CONFIG_FIELDS,resolveDomainConfigInput}from'../../config/domain-config.js';import{ENTERPRISE_ROUTING_KIND,ENTERPRISE_ROUTING_PROTOCOL}from'../../generated/routing-contract.js';import{DEFAULT_LOVRABET_REGION,ENABLED_LOVRABET_REGION_VALUES,isEnabledLovrabetRegion}from'../../constant/region.js';import{OFFICIAL_ROUTING_PROFILES}from'../../generated/official-routing.js';const domainFlags=[{'name':'domain-config','type':'string','description':a24_0x40336f(0x94)},{'name':'user-domain','type':a24_0x40336f(0xb0),'description':a24_0x40336f(0xa5)},{'name':'api-domain','type':a24_0x40336f(0xb0),'description':a24_0x40336f(0xad)},{'name':a24_0x40336f(0xbb),'type':a24_0x40336f(0xb0),'description':'Custom\x20Runtime\x20HTTPS\x20origin'},{'name':a24_0x40336f(0xb8),'type':a24_0x40336f(0xb0),'description':a24_0x40336f(0x96)},{'name':a24_0x40336f(0xb3),'type':a24_0x40336f(0xb0),'description':a24_0x40336f(0xa8)},{'name':'harness-domain','type':a24_0x40336f(0xb0),'description':a24_0x40336f(0xb9)}];export const configInitFlags=[{'name':'region','type':a24_0x40336f(0xb0),'description':a24_0x40336f(0x9a)+ENABLED_LOVRABET_REGION_VALUES[a24_0x40336f(0xaf)](',\x20'),'enum':[...ENABLED_LOVRABET_REGION_VALUES]},...domainFlags];async function resolveRegion(_0x318067){const _0x54bf94=a24_0x40336f,_0x33eabd=_0x318067[_0x54bf94(0x95)](_0x54bf94(0xb6));if(_0x33eabd){if(!isEnabledLovrabetRegion(_0x33eabd))throw CliErrors[_0x54bf94(0xb1)](_0x54bf94(0xc3)+_0x33eabd+_0x54bf94(0xb4),_0x54bf94(0xa3)+ENABLED_LOVRABET_REGION_VALUES['join'](',\x20'));return _0x33eabd;}if(_0x318067[_0x54bf94(0xb5)])return DEFAULT_LOVRABET_REGION;try{return await select({'message':_0x54bf94(0x97),'default':DEFAULT_LOVRABET_REGION,'choices':ENABLED_LOVRABET_REGION_VALUES[_0x54bf94(0xbe)](_0xd11fbe=>({'name':OFFICIAL_ROUTING_PROFILES[_0xd11fbe][_0x54bf94(0x99)]+'\x20('+_0xd11fbe+')','value':_0xd11fbe}))});}catch(_0x5b8fb1){if(_0x5b8fb1?.[_0x54bf94(0xa7)]==='ExitPromptError')throw CliErrors[_0x54bf94(0xbc)]();throw _0x5b8fb1;}}export async function executeConfigInit(_0x3848fa){const _0x4c0ad5=a24_0x40336f,_0x36cb4f=resolveDomainConfigInput(_0x3848fa),_0x24852e=_0x36cb4f['domains'],_0x4dfbd1=Object[_0x4c0ad5(0xc0)](_0x24852e)[_0x4c0ad5(0x9b)]>0x0||_0x36cb4f['mode']===_0x4c0ad5(0xab);if(_0x4dfbd1&&_0x3848fa[_0x4c0ad5(0x95)](_0x4c0ad5(0xb6)))throw CliErrors[_0x4c0ad5(0xb1)]('Choose\x20either\x20an\x20official\x20region\x20or\x20independent-deployment\x20Domains,\x20not\x20both.');const _0x162caf={'global':!![]},_0x4ccef7=readScopedConfig(_0x162caf);for(const _0x4ac388 of DOMAIN_CONFIG_FIELDS)delete _0x4ccef7[_0x4ac388];for(const _0x466941 of LEGACY_DOMAIN_CONFIG_FIELDS)delete _0x4ccef7[_0x466941];delete _0x4ccef7[_0x4c0ad5(0xac)];let _0x31ee23=null;if(_0x4dfbd1)delete _0x4ccef7[_0x4c0ad5(0xb6)],_0x36cb4f[_0x4c0ad5(0x93)]==='enterprise-v1'?_0x4ccef7['routing']={'protocol':ENTERPRISE_ROUTING_PROTOCOL,'kind':ENTERPRISE_ROUTING_KIND,'domains':_0x36cb4f['manifestDomains']}:Object[_0x4c0ad5(0xa0)](_0x4ccef7,_0x24852e);else{_0x31ee23=await resolveRegion(_0x3848fa);if(_0x31ee23===DEFAULT_LOVRABET_REGION)delete _0x4ccef7[_0x4c0ad5(0xb6)];else _0x4ccef7['region']=_0x31ee23;}return writeScopedConfig(_0x4ccef7,_0x162caf),{'ok':!![],'message':_0x4dfbd1?_0x4c0ad5(0xa2)+Object[_0x4c0ad5(0xc0)](_0x36cb4f[_0x4c0ad5(0x93)]==='enterprise-v1'?_0x36cb4f['manifestDomains']:_0x24852e)['join'](',\x20')+'.':_0x4c0ad5(0xa1)+_0x31ee23+'.','data':{'mode':_0x4dfbd1?_0x4c0ad5(0x9d):_0x4c0ad5(0x9f),'protocol':_0x36cb4f[_0x4c0ad5(0x93)]===_0x4c0ad5(0xab)?ENTERPRISE_ROUTING_PROTOCOL:undefined,'region':_0x31ee23,'domains':_0x24852e}};}export const configInitDefinition={'service':a24_0x40336f(0xc2),'command':'init','description':a24_0x40336f(0xba),'risk':a24_0x40336f(0xb2),'confirmationDescription':a24_0x40336f(0xbf),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':configInitFlags,'execute':executeConfigInit};function a24_0x517f(){const _0x3e0c78=['961848ZMvSiF','7648498mIzkdj','enterprise-v1','routing','Custom\x20platform\x20API\x20HTTPS\x20origin','63sZubbf','join','string','validation','write','kb-service-domain','\x22\x20is\x20not\x20currently\x20available.','nonInteractive','region','6OtlWmr','skill-domain','Custom\x20Harness\x20HTTPS\x20origin','Initialize\x20the\x20global\x20Lovrabet\x20region\x20or\x20independent-deployment\x20Domains','runtime-domain','cancelled','18unhqfZ','map','Updates\x20the\x20global\x20Lovrabet\x20region\x20or\x20independent-deployment\x20Domain\x20configuration.\x20AccessKey,\x20output\x20format,\x20and\x20app\x20bindings\x20stay\x20unchanged.','keys','1476750wIbXmH','config','Region\x20\x22','mode','Independent-deployment\x20Domain\x20JSON\x20file','str','Custom\x20SkillHub\x20HTTPS\x20origin','Select\x20Lovrabet\x20region','4mVIKWB','label','Official\x20Lovrabet\x20region:\x20','length','102417QQkOMq','independent','380856FJgGEc','official','assign','Lovrabet\x20connection\x20configured\x20for\x20region:\x20','Lovrabet\x20connection\x20configured\x20for\x20independent\x20deployment.\x20Domains:\x20','Available\x20regions:\x20','1345585fLkRBZ','Custom\x20User\x20HTTPS\x20origin','3787870VYCrPq','name','Custom\x20KB\x20Service\x20HTTPS\x20origin'];a24_0x517f=function(){return _0x3e0c78;};return a24_0x517f();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x18e454,_0x361a5f){var _0x1c24ca=a25_0x32f4,_0xa4d63b=_0x18e454();while(!![]){try{var _0x15f186=parseInt(_0x1c24ca(0xfa))/0x1*(parseInt(_0x1c24ca(0xfd))/0x2)+parseInt(_0x1c24ca(0xfe))/0x3*(parseInt(_0x1c24ca(0xfc))/0x4)+-parseInt(_0x1c24ca(0xff))/0x5*(parseInt(_0x1c24ca(0x100))/0x6)+parseInt(_0x1c24ca(0xf8))/0x7*(-parseInt(_0x1c24ca(0xfb))/0x8)+parseInt(_0x1c24ca(0xf6))/0x9+parseInt(_0x1c24ca(0xf5))/0xa*(parseInt(_0x1c24ca(0xf9))/0xb)+-parseInt(_0x1c24ca(0xf7))/0xc;if(_0x15f186===_0x361a5f)break;else _0xa4d63b['push'](_0xa4d63b['shift']());}catch(_0x4276f7){_0xa4d63b['push'](_0xa4d63b['shift']());}}}(a25_0x3e1e,0xa998a));function a25_0x3e1e(){var _0x37cdb4=['4918zNRmlu','3952635VGDPsR','57295Irnyyn','6rvVXcG','2297830xqemch','1234242hXpJCO','13060536RSiiJh','14yEdrtE','55NTkehi','223Byhzju','5429808FTfHNp','4TYaUhO'];a25_0x3e1e=function(){return _0x37cdb4;};return a25_0x3e1e();}import{CLI_BIN_NAME}from'../../constant/cli.js';function a25_0x32f4(_0x51fd3d,_0x44eaa3){_0x51fd3d=_0x51fd3d-0xf5;var _0x3e1ec9=a25_0x3e1e();var _0x32f4d6=_0x3e1ec9[_0x51fd3d];return _0x32f4d6;}export{CLI_BIN_NAME};export{readScopedConfig,writeScopedConfig}from'../../context.js';export{resolveConfigScope as resolveWriteScope,TOP_LEVEL_CONFIG_KEYS as TOP_LEVEL_KEYS,CONFIG_ENUM_VALUES as ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isCliProtectedConfigKey,isTopLevelConfigKey,normalizeLocale,toScopeFlags}from'../../commands/common/config-policy.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x214e13=a26_0xa912;(function(_0x379f23,_0x1c8ff3){const _0x31003e=a26_0xa912,_0x534f8a=_0x379f23();while(!![]){try{const _0x37fadc=parseInt(_0x31003e(0x142))/0x1*(parseInt(_0x31003e(0x10d))/0x2)+parseInt(_0x31003e(0x109))/0x3+-parseInt(_0x31003e(0x132))/0x4+-parseInt(_0x31003e(0xff))/0x5+-parseInt(_0x31003e(0x136))/0x6*(parseInt(_0x31003e(0x12c))/0x7)+parseInt(_0x31003e(0x13d))/0x8+-parseInt(_0x31003e(0x13f))/0x9*(parseInt(_0x31003e(0x10c))/0xa);if(_0x37fadc===_0x1c8ff3)break;else _0x534f8a['push'](_0x534f8a['shift']());}catch(_0x10332f){_0x534f8a['push'](_0x534f8a['shift']());}}}(a26_0x49f2,0x7157b));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';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';function a26_0xa912(_0x483883,_0x23b34b){_0x483883=_0x483883-0xee;const _0x49f2cd=a26_0x49f2();let _0xa912d9=_0x49f2cd[_0x483883];return _0xa912d9;}import{assertImageImportCapability,runImageExcelImport}from'../../services/dataset-import/image-runner.js';import{previewImportBatchCount}from'../../services/dataset-import/preview.js';function a26_0x49f2(){const _0x24ab46=['Reconcile\x20imported\x20records\x20and\x20resume\x20the\x20exact\x20original\x20file,\x20target\x20and\x20mapping','length','1-based\x20Excel\x20header\x20row','slice','.lock','Source,\x20mapping,\x20checkpoint\x20and\x20report\x20must\x20be\x20different\x20files.','number','Maximum\x20records\x20per\x20request\x20(1..500)','.import-checkpoint.json','/client/','sheet','Local\x20XLSX\x20file\x20(maximum\x2020\x20MB)','file','map','toString','batch-size','imageCells','.rows.json','Private\x20checkpoint\x20file\x20(default:\x20XLSX\x20path\x20plus\x20.import-checkpoint.json)','POST','JSON\x20file\x20mapping\x20Excel\x20headers\x20to\x20dataset\x20field\x20codes','hashes','batchSize','\x20invalid\x20cells.\x20No\x20records\x20were\x20written.','.import-report.json','schemaFingerprint','reduce','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.','errors','imageFields','637Ddufae','.\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','checkpoint','Run\x20dataset\x20detail\x20to\x20confirm\x20the\x20source.\x20Only\x20DB_TABLE\x20has\x20the\x20documented\x20alternative\x20batchCreate\x20route;\x20do\x20not\x20guess\x20or\x20automatically\x20switch\x20APIs.','.lock.recovery','mappingFile','698808AKMZiT','num','--file\x20and\x20--mapping\x20are\x20required.','validation','31698btaSOV','str','media','some','warnings','import-excel','values','6756672NpwpsF','maxBatchSize','1492749nISYPh','code','Local\x20Excel\x20validation\x20only;\x20no\x20records\x20or\x20checkpoint\x20were\x20written.','170395OVrAfA','isArray','emptyRows','Inspect\x20lovrabet\x20dataset\x20detail\x20--code\x20','message','Creates\x20real\x20dataset\x20records\x20immediately.\x20Keep\x20the\x20checkpoint\x20to\x20reconcile\x20and\x20resume\x20interrupted\x20imports.','Header\x20row\x20must\x20be\x20positive\x20and\x20batch\x20size\x20must\x20be\x20between\x201\x20and\x20500.','parse','size','appCode','rows','DB_TABLE\x20datasets\x20use\x20the\x20existing\x20batchCreate\x20operation;\x20import-excel\x20only\x20supports\x20METADATA\x20datasets.','write','Excel\x20contains\x20','report','/import-batch','all','rowNumber','string','1684655meHbWU','Batch\x20size\x20exceeds\x20the\x20server\x20import\x20contract.','isInteger','invalid','Mapping\x20file\x20must\x20contain\x20valid\x20JSON.','Worksheet\x20name\x20or\x201-based\x20index\x20(default:\x20first\x20worksheet)','max','data','resume','bool','786585EJamgb','DB_TABLE','\x20--code\x20','20zxoacw','8suDTYG'];a26_0x49f2=function(){return _0x24ab46;};return a26_0x49f2();}function input(_0x4cba1a){const _0x24c0c5=a26_0xa912,_0x21ff29=_0x4cba1a[_0x24c0c5(0x137)](_0x24c0c5(0x11a)),_0x4e3aea=_0x4cba1a[_0x24c0c5(0x137)]('mapping');if(!_0x21ff29||!_0x4e3aea)throw CliErrors[_0x24c0c5(0x135)](_0x24c0c5(0x134));const _0x43891f=_0x4cba1a['num']('header-row',0x1),_0x4ec8ea=_0x4cba1a[_0x24c0c5(0x133)](_0x24c0c5(0x11d),0x1f4);if(!Number['isInteger'](_0x43891f)||_0x43891f<0x1||!Number[_0x24c0c5(0x101)](_0x4ec8ea)||_0x4ec8ea<0x1||_0x4ec8ea>0x1f4)throw CliErrors[_0x24c0c5(0x135)](_0x24c0c5(0xf2));const _0x320997=resolve(_0x4cba1a[_0x24c0c5(0x137)](_0x24c0c5(0x12e))||_0x21ff29+_0x24c0c5(0x116)),_0x2217e5=resolve(_0x4cba1a[_0x24c0c5(0x137)](_0x24c0c5(0xfa))||_0x21ff29+_0x24c0c5(0x126)),_0x2ee751=[resolve(_0x21ff29),resolve(_0x4e3aea),_0x320997,_0x2217e5];if(new Set(_0x2ee751)[_0x24c0c5(0xf4)]!==_0x2ee751[_0x24c0c5(0x10f)])throw CliErrors[_0x24c0c5(0x135)](_0x24c0c5(0x113));return{'file':resolve(_0x21ff29),'mappingFile':resolve(_0x4e3aea),'headerRow':_0x43891f,'batchSize':_0x4ec8ea,'checkpoint':_0x320997,'report':_0x2217e5,'sheet':_0x4cba1a[_0x24c0c5(0x137)]('sheet')||undefined,'resume':_0x4cba1a[_0x24c0c5(0x108)]('resume')};}async function prepare(_0x2e0eb7){const _0x127074=a26_0xa912,_0x38a6e6=input(_0x2e0eb7),_0x501763=_0x2e0eb7[_0x127074(0x137)](_0x127074(0x140));[_0x38a6e6['file'],_0x38a6e6['mappingFile'],_0x38a6e6[_0x127074(0x12e)],_0x38a6e6[_0x127074(0xfa)]]=await Promise['all']([realpath(_0x38a6e6[_0x127074(0x11a)]),realpath(_0x38a6e6[_0x127074(0x131)]),resolveImportOutputPath(_0x38a6e6[_0x127074(0x12e)]),resolveImportOutputPath(_0x38a6e6[_0x127074(0xfa)])]),assertImportPaths(_0x38a6e6[_0x127074(0x12e)],_0x38a6e6[_0x127074(0xfa)],[_0x38a6e6[_0x127074(0x11a)],_0x38a6e6[_0x127074(0x131)]]);let _0x1c345d;const _0x1cc15c=await readFile(_0x38a6e6[_0x127074(0x131)]);if(_0x1cc15c[_0x127074(0x10f)]>0x400*0x400)throw CliErrors[_0x127074(0x135)]('Mapping\x20file\x20exceeds\x201\x20MB.');try{_0x1c345d=JSON[_0x127074(0xf3)](_0x1cc15c[_0x127074(0x11c)]('utf8'));}catch{throw CliErrors['validation'](_0x127074(0x103));}if(!_0x1c345d||typeof _0x1c345d!=='object'||Array[_0x127074(0x143)](_0x1c345d)||Object[_0x127074(0x13c)](_0x1c345d)[_0x127074(0x139)](_0x46ff53=>typeof _0x46ff53!=='string'))throw CliErrors[_0x127074(0x135)]('Mapping\x20must\x20be\x20an\x20object\x20from\x20Excel\x20headers\x20to\x20field\x20codes.');const _0x2c9a93=await getDatasetDetail(_0x501763),_0x387327=assertDatasetImportTarget(_0x2c9a93,_0x2e0eb7['appCode'],_0x501763);if(_0x387327===_0x127074(0x10a))throw CliErrors[_0x127074(0x135)](_0x127074(0xf7),_0x127074(0xef)+_0x501763+_0x127074(0x12d)+_0x2e0eb7['appCode']+_0x127074(0x10b)+_0x501763+'\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(_0x387327!=='METADATA')throw CliErrors[_0x127074(0x135)]('Dataset\x20source\x20is\x20missing\x20or\x20unsupported;\x20import-excel\x20requires\x20METADATA.',_0x127074(0x12f));const _0x2f990e=await buildExcelManifest({..._0x38a6e6,'mapping':_0x1c345d,'fields':normalizeImportFields(_0x2c9a93)}),_0x241157=await getDatasetImportContract(_0x2e0eb7[_0x127074(0xf5)],_0x501763);assertImportContract(_0x241157,_0x2e0eb7['appCode'],_0x501763),assertImageImportCapability(_0x241157,_0x2f990e);if(_0x2f990e[_0x127074(0x12b)]?.[_0x127074(0x10f)]){const _0x402a96=await resolveImportOutputPath(_0x38a6e6[_0x127074(0x12e)]+_0x127074(0x11f)),_0x42a94f=await Promise[_0x127074(0xfc)]([_0x402a96,_0x402a96+_0x127074(0x112),_0x402a96+_0x127074(0x130),_0x38a6e6['checkpoint']+_0x127074(0x112),_0x38a6e6['checkpoint']+_0x127074(0x130)][_0x127074(0x11b)](resolveImportOutputPath));assertImportPaths(_0x38a6e6['checkpoint'],_0x38a6e6[_0x127074(0xfa)],[_0x38a6e6[_0x127074(0x11a)],_0x38a6e6[_0x127074(0x131)],..._0x42a94f[_0x127074(0x111)](0x0,0x3)]);}if(_0x38a6e6[_0x127074(0x124)]>_0x241157[_0x127074(0x13e)])throw CliErrors[_0x127074(0x135)](_0x127074(0x100));return{'args':_0x38a6e6,'manifest':_0x2f990e,'contract':_0x241157,'code':_0x501763};}async function checked(_0x5394c1){const _0x17d92e=a26_0xa912;try{return await _0x5394c1();}catch(_0x3e71e4){if(_0x3e71e4 instanceof CliError)throw _0x3e71e4;throw CliErrors[_0x17d92e(0x135)](_0x3e71e4[_0x17d92e(0xf0)]||'Excel\x20import\x20failed.');}}export const dataImportExcel={'service':a26_0x214e13(0x106),'command':a26_0x214e13(0x13b),'risk':a26_0x214e13(0xf8),'description':a26_0x214e13(0x129),'confirmationDescription':a26_0x214e13(0xf1),'flags':[CODE_FLAG,{'name':a26_0x214e13(0x11a),'type':a26_0x214e13(0xfe),'required':!![],'description':a26_0x214e13(0x119)},{'name':'mapping','type':a26_0x214e13(0xfe),'required':!![],'description':a26_0x214e13(0x122)},{'name':a26_0x214e13(0x118),'type':a26_0x214e13(0xfe),'description':a26_0x214e13(0x104)},{'name':'header-row','type':a26_0x214e13(0x114),'default':0x1,'description':a26_0x214e13(0x110)},{'name':a26_0x214e13(0x11d),'type':a26_0x214e13(0x114),'default':0x1f4,'description':a26_0x214e13(0x115)},{'name':a26_0x214e13(0x12e),'type':'string','description':a26_0x214e13(0x120)},{'name':a26_0x214e13(0xfa),'type':'string','description':'Private\x20result\x20report\x20(default:\x20XLSX\x20path\x20plus\x20.import-report.json)'},{'name':a26_0x214e13(0x107),'type':'boolean','description':a26_0x214e13(0x10e)}],'validate':async _0x501959=>{input(_0x501959);},'dryRun':async _0x3dbdc1=>checked(async()=>{const _0x49b3f1=a26_0x214e13,{args:_0x2d4a95,manifest:_0x374422,contract:_0x2146cd,code:_0x7eff5d}=await prepare(_0x3dbdc1),_0xed1fbc=new Set(_0x374422[_0x49b3f1(0x12a)][_0x49b3f1(0x11b)](_0x1e6c96=>_0x1e6c96[_0x49b3f1(0xfd)]))[_0x49b3f1(0xf4)];return{'method':_0x49b3f1(0x121),'url':_0x49b3f1(0x117)+encodeURIComponent(_0x3dbdc1[_0x49b3f1(0xf5)])+'/'+encodeURIComponent(_0x7eff5d)+_0x49b3f1(0xfb),'description':_0x49b3f1(0x141),'body':{'schemaFingerprint':_0x2146cd[_0x49b3f1(0x127)]},'validRows':Math[_0x49b3f1(0x105)](0x0,_0x374422[_0x49b3f1(0xf6)]['length']-_0xed1fbc),'invalidRows':_0xed1fbc,'invalidCells':_0x374422[_0x49b3f1(0x12a)][_0x49b3f1(0x10f)],'emptyRows':_0x374422[_0x49b3f1(0xee)][_0x49b3f1(0x10f)],'expectedBatches':previewImportBatchCount(_0x374422,_0x2146cd,_0x2d4a95[_0x49b3f1(0x124)]),'imageCount':_0x374422[_0x49b3f1(0x11e)]?.[_0x49b3f1(0x128)]((_0x6cbbf4,_0x4ad93e)=>_0x6cbbf4+_0x4ad93e[_0x49b3f1(0x123)][_0x49b3f1(0x10f)],0x0)??0x0,'uniqueImages':_0x374422[_0x49b3f1(0x138)]?.[_0x49b3f1(0x10f)]??0x0,'uniqueImageBytes':_0x374422[_0x49b3f1(0x138)]?.[_0x49b3f1(0x128)]((_0x427f19,_0x53b6a2)=>_0x427f19+_0x53b6a2['size'],0x0)??0x0,'errors':_0x374422['errors'],'warnings':_0x374422[_0x49b3f1(0x13a)],'sheet':_0x374422['sheet'],'checkpoint':_0x2d4a95['checkpoint'],'report':_0x2d4a95[_0x49b3f1(0xfa)]};}),'execute':async _0x2267de=>checked(async()=>{const _0x16c6cc=a26_0x214e13,{args:_0x20dff3,manifest:_0x705adf,contract:_0x1da0fb,code:_0x526a3c}=await prepare(_0x2267de);if(_0x705adf['errors'][_0x16c6cc(0x10f)]){await saveImportJson(_0x20dff3[_0x16c6cc(0xfa)],{'status':_0x16c6cc(0x102),'sourceRows':_0x705adf[_0x16c6cc(0xf6)][_0x16c6cc(0x10f)],'errors':_0x705adf[_0x16c6cc(0x12a)],'emptyRows':_0x705adf[_0x16c6cc(0xee)],'warnings':_0x705adf['warnings']});throw CliErrors[_0x16c6cc(0x135)](_0x16c6cc(0xf9)+_0x705adf[_0x16c6cc(0x12a)][_0x16c6cc(0x10f)]+_0x16c6cc(0x125),'See\x20'+_0x20dff3[_0x16c6cc(0xfa)]+'.');}const _0x82c985=_0x705adf['imageFields']?.[_0x16c6cc(0x10f)]?runImageExcelImport:_0x1da0fb['schemaVersion']===0x2?runAutoIdExcelImport:runExcelImport,_0xa0ff67=await _0x82c985({..._0x20dff3,'manifest':_0x705adf,'contract':_0x1da0fb,'appCode':_0x2267de[_0x16c6cc(0xf5)],'datasetCode':_0x526a3c,'runtimeDomain':getRuntimeDomain(),'inputPaths':[_0x20dff3[_0x16c6cc(0x11a)],_0x20dff3[_0x16c6cc(0x131)]],'imageApi':{'upload':(_0x5acafd,_0x322adb)=>uploadDatasetImportImage(_0x2267de[_0x16c6cc(0xf5)],_0x526a3c,_0x5acafd,_0x322adb),'readback':(_0x3a59e8,_0x3e5c1c)=>readDatasetImportImage(_0x2267de[_0x16c6cc(0xf5)],_0x526a3c,_0x3a59e8,_0x3e5c1c)},'api':{'write':(_0xd4b4a8,_0x5cfc42)=>createDatasetImportBatch(_0x2267de[_0x16c6cc(0xf5)],_0x526a3c,{'schemaFingerprint':_0x1da0fb[_0x16c6cc(0x127)],'items':_0xd4b4a8,..._0x5cfc42===undefined?{}:{'taskId':_0x5cfc42}}),'readback':_0x6d85b9=>readDatasetImportRows(_0x2267de[_0x16c6cc(0xf5)],_0x526a3c,_0x6d85b9),'readTask':_0x424b25=>readDatasetImportTaskRows(_0x2267de[_0x16c6cc(0xf5)],_0x526a3c,_0x424b25)}});return{'ok':!![],'data':_0xa0ff67,'message':'Imported\x20and\x20verified\x20'+_0xa0ff67['succeeded']+'\x20records.'};})};
|
|
1
|
+
const a26_0x4010fc=a26_0x2344;(function(_0xbd0ac6,_0xe3c864){const _0x4418b4=a26_0x2344,_0x566699=_0xbd0ac6();while(!![]){try{const _0x278ecd=-parseInt(_0x4418b4(0x9d))/0x1*(parseInt(_0x4418b4(0xcb))/0x2)+parseInt(_0x4418b4(0x9a))/0x3*(-parseInt(_0x4418b4(0xbc))/0x4)+-parseInt(_0x4418b4(0xb1))/0x5*(parseInt(_0x4418b4(0xce))/0x6)+parseInt(_0x4418b4(0xc8))/0x7*(-parseInt(_0x4418b4(0x9c))/0x8)+-parseInt(_0x4418b4(0xb8))/0x9+parseInt(_0x4418b4(0xcf))/0xa*(-parseInt(_0x4418b4(0x9e))/0xb)+parseInt(_0x4418b4(0x8b))/0xc;if(_0x278ecd===_0xe3c864)break;else _0x566699['push'](_0x566699['shift']());}catch(_0x29253e){_0x566699['push'](_0x566699['shift']());}}}(a26_0x48d6,0x6c1d0));import{readFile,realpath}from'node:fs/promises';import{resolve}from'node:path';function a26_0x2344(_0xe60eb0,_0x464087){_0xe60eb0=_0xe60eb0-0x7b;const _0x48d6ea=a26_0x48d6();let _0x234454=_0x48d6ea[_0xe60eb0];return _0x234454;}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';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';function a26_0x48d6(){const _0x1d3210=['boolean','DB_TABLE','12JfxqVq','271780UoHUTl','num','mappingFile','imageCells','str','Header\x20row\x20must\x20be\x20positive\x20and\x20batch\x20size\x20must\x20be\x20between\x201\x20and\x20500.','file','import-excel','media','/client/','report','data','schemaVersion','Private\x20result\x20report\x20(default:\x20XLSX\x20path\x20plus\x20.import-report.json)','batch-size','Local\x20Excel\x20validation\x20only;\x20no\x20records\x20or\x20checkpoint\x20were\x20written.','JSON\x20file\x20mapping\x20Excel\x20headers\x20to\x20dataset\x20field\x20codes','resume','emptyRows','29927460zVfztT','Reconcile\x20imported\x20records\x20and\x20resume\x20the\x20exact\x20original\x20file,\x20target\x20and\x20mapping','Batch\x20size\x20exceeds\x20the\x20server\x20import\x20contract.','/import-batch','header-row','checkpoint','batchSize','\x20records.','Dataset\x20source\x20is\x20missing\x20or\x20unsupported;\x20import-excel\x20requires\x20METADATA.','Mapping\x20must\x20be\x20an\x20object\x20from\x20Excel\x20headers\x20to\x20field\x20codes.','warnings','number','.lock.recovery','Mapping\x20file\x20exceeds\x201\x20MB.','Local\x20XLSX\x20file\x20(maximum\x2020\x20MB)','3nxEnQe','string','1416iryOEK','47LiELyK','55zbwKga','--file\x20and\x20--mapping\x20are\x20required.','utf8','reduce','max','size','Maximum\x20records\x20per\x20request\x20(1..500)','mapping','\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.','succeeded','length','METADATA','validation','\x20--code\x20','Source,\x20mapping,\x20checkpoint\x20and\x20report\x20must\x20be\x20different\x20files.','Worksheet\x20name\x20or\x201-based\x20index\x20(default:\x20first\x20worksheet)','POST','DB_TABLE\x20datasets\x20use\x20the\x20existing\x20batchCreate\x20operation;\x20import-excel\x20only\x20supports\x20METADATA\x20datasets.','Private\x20checkpoint\x20file\x20(default:\x20XLSX\x20path\x20plus\x20.import-checkpoint.json)','129770gCjPYd','bool','1-based\x20Excel\x20header\x20row','.import-checkpoint.json','imageFields','object','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.','6335946RUXHdi','all','errors','sheet','1134096uvBHZP','Excel\x20import\x20failed.','.import-report.json','values','\x20invalid\x20cells.\x20No\x20records\x20were\x20written.','message','some','rowNumber','schemaFingerprint','invalid','isInteger','appCode','3703cZQRcn','.lock','parse','33284oXfDan'];a26_0x48d6=function(){return _0x1d3210;};return a26_0x48d6();}import{assertImageImportCapability,runImageExcelImport}from'../../services/dataset-import/image-runner.js';import{previewImportBatchCount}from'../../services/dataset-import/preview.js';function input(_0x363c6b){const _0x37358e=a26_0x2344,_0xd6da12=_0x363c6b[_0x37358e(0x7c)](_0x37358e(0x7e)),_0x3fc12f=_0x363c6b[_0x37358e(0x7c)]('mapping');if(!_0xd6da12||!_0x3fc12f)throw CliErrors[_0x37358e(0xaa)](_0x37358e(0x9f));const _0x416519=_0x363c6b[_0x37358e(0xd0)](_0x37358e(0x8f),0x1),_0x1cd3ca=_0x363c6b[_0x37358e(0xd0)]('batch-size',0x1f4);if(!Number[_0x37358e(0xc6)](_0x416519)||_0x416519<0x1||!Number[_0x37358e(0xc6)](_0x1cd3ca)||_0x1cd3ca<0x1||_0x1cd3ca>0x1f4)throw CliErrors[_0x37358e(0xaa)](_0x37358e(0x7d));const _0x52bcad=resolve(_0x363c6b[_0x37358e(0x7c)](_0x37358e(0x90))||_0xd6da12+_0x37358e(0xb4)),_0x669460=resolve(_0x363c6b[_0x37358e(0x7c)]('report')||_0xd6da12+_0x37358e(0xbe)),_0x158faa=[resolve(_0xd6da12),resolve(_0x3fc12f),_0x52bcad,_0x669460];if(new Set(_0x158faa)[_0x37358e(0xa3)]!==_0x158faa[_0x37358e(0xa8)])throw CliErrors[_0x37358e(0xaa)](_0x37358e(0xac));return{'file':resolve(_0xd6da12),'mappingFile':resolve(_0x3fc12f),'headerRow':_0x416519,'batchSize':_0x1cd3ca,'checkpoint':_0x52bcad,'report':_0x669460,'sheet':_0x363c6b[_0x37358e(0x7c)]('sheet')||undefined,'resume':_0x363c6b[_0x37358e(0xb2)]('resume')};}async function prepare(_0x52235a){const _0xb47048=a26_0x2344,_0x54471c=input(_0x52235a),_0x266686=_0x52235a['str']('code');[_0x54471c[_0xb47048(0x7e)],_0x54471c[_0xb47048(0xd1)],_0x54471c['checkpoint'],_0x54471c['report']]=await Promise[_0xb47048(0xb9)]([realpath(_0x54471c[_0xb47048(0x7e)]),realpath(_0x54471c['mappingFile']),resolveImportOutputPath(_0x54471c[_0xb47048(0x90)]),resolveImportOutputPath(_0x54471c[_0xb47048(0x82)])]),assertImportPaths(_0x54471c[_0xb47048(0x90)],_0x54471c[_0xb47048(0x82)],[_0x54471c[_0xb47048(0x7e)],_0x54471c[_0xb47048(0xd1)]]);let _0x469efd;const _0x1d2f5c=await readFile(_0x54471c['mappingFile']);if(_0x1d2f5c['length']>0x400*0x400)throw CliErrors['validation'](_0xb47048(0x98));try{_0x469efd=JSON[_0xb47048(0xca)](_0x1d2f5c['toString'](_0xb47048(0xa0)));}catch{throw CliErrors[_0xb47048(0xaa)]('Mapping\x20file\x20must\x20contain\x20valid\x20JSON.');}if(!_0x469efd||typeof _0x469efd!==_0xb47048(0xb6)||Array['isArray'](_0x469efd)||Object[_0xb47048(0xbf)](_0x469efd)[_0xb47048(0xc2)](_0x5cda05=>typeof _0x5cda05!=='string'))throw CliErrors[_0xb47048(0xaa)](_0xb47048(0x94));const _0x15ce35=await getDatasetDetail(_0x266686),_0x310cd1=assertDatasetImportTarget(_0x15ce35,_0x52235a[_0xb47048(0xc7)],_0x266686);if(_0x310cd1===_0xb47048(0xcd))throw CliErrors[_0xb47048(0xaa)](_0xb47048(0xaf),'Inspect\x20lovrabet\x20dataset\x20detail\x20--code\x20'+_0x266686+'.\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'+_0x52235a[_0xb47048(0xc7)]+_0xb47048(0xab)+_0x266686+_0xb47048(0xa6));if(_0x310cd1!==_0xb47048(0xa9))throw CliErrors[_0xb47048(0xaa)](_0xb47048(0x93),'Run\x20dataset\x20detail\x20to\x20confirm\x20the\x20source.\x20Only\x20DB_TABLE\x20has\x20the\x20documented\x20alternative\x20batchCreate\x20route;\x20do\x20not\x20guess\x20or\x20automatically\x20switch\x20APIs.');const _0x4a8a05=await buildExcelManifest({..._0x54471c,'mapping':_0x469efd,'fields':normalizeImportFields(_0x15ce35)}),_0x79551a=await getDatasetImportContract(_0x52235a['appCode'],_0x266686);assertImportContract(_0x79551a,_0x52235a[_0xb47048(0xc7)],_0x266686),assertImageImportCapability(_0x79551a,_0x4a8a05);if(_0x4a8a05[_0xb47048(0xb5)]?.[_0xb47048(0xa8)]){const _0x2d16c3=await resolveImportOutputPath(_0x54471c['checkpoint']+'.rows.json'),_0x4f4f3b=await Promise[_0xb47048(0xb9)]([_0x2d16c3,_0x2d16c3+_0xb47048(0xc9),_0x2d16c3+'.lock.recovery',_0x54471c[_0xb47048(0x90)]+_0xb47048(0xc9),_0x54471c[_0xb47048(0x90)]+_0xb47048(0x97)]['map'](resolveImportOutputPath));assertImportPaths(_0x54471c[_0xb47048(0x90)],_0x54471c[_0xb47048(0x82)],[_0x54471c[_0xb47048(0x7e)],_0x54471c[_0xb47048(0xd1)],..._0x4f4f3b['slice'](0x0,0x3)]);}if(_0x54471c[_0xb47048(0x91)]>_0x79551a['maxBatchSize'])throw CliErrors[_0xb47048(0xaa)](_0xb47048(0x8d));return{'args':_0x54471c,'manifest':_0x4a8a05,'contract':_0x79551a,'code':_0x266686};}async function checked(_0x1ed7d5){const _0xa98c8=a26_0x2344;try{return await _0x1ed7d5();}catch(_0x5c8c24){if(_0x5c8c24 instanceof CliError)throw _0x5c8c24;throw CliErrors['validation'](_0x5c8c24[_0xa98c8(0xc1)]||_0xa98c8(0xbd));}}export const dataImportExcel={'service':a26_0x4010fc(0x83),'command':a26_0x4010fc(0x7f),'risk':'write','description':a26_0x4010fc(0xb7),'confirmationDescription':'Creates\x20real\x20dataset\x20records\x20immediately.\x20Keep\x20the\x20checkpoint\x20to\x20reconcile\x20and\x20resume\x20interrupted\x20imports.','flags':[CODE_FLAG,{'name':'file','type':a26_0x4010fc(0x9b),'required':!![],'description':a26_0x4010fc(0x99)},{'name':a26_0x4010fc(0xa5),'type':a26_0x4010fc(0x9b),'required':!![],'description':a26_0x4010fc(0x88)},{'name':a26_0x4010fc(0xbb),'type':'string','description':a26_0x4010fc(0xad)},{'name':'header-row','type':a26_0x4010fc(0x96),'default':0x1,'description':a26_0x4010fc(0xb3)},{'name':a26_0x4010fc(0x86),'type':a26_0x4010fc(0x96),'default':0x1f4,'description':a26_0x4010fc(0xa4)},{'name':'checkpoint','type':a26_0x4010fc(0x9b),'description':a26_0x4010fc(0xb0)},{'name':'report','type':'string','description':a26_0x4010fc(0x85)},{'name':a26_0x4010fc(0x89),'type':a26_0x4010fc(0xcc),'description':a26_0x4010fc(0x8c)}],'validate':async _0x1729bf=>{input(_0x1729bf);},'dryRun':async _0x3ecac2=>checked(async()=>{const _0x108a12=a26_0x4010fc,{args:_0x3027ee,manifest:_0x22e297,contract:_0x96ae60,code:_0x20f7e1}=await prepare(_0x3ecac2),_0x584659=new Set(_0x22e297[_0x108a12(0xba)]['map'](_0x5be918=>_0x5be918[_0x108a12(0xc3)]))[_0x108a12(0xa3)];return{'method':_0x108a12(0xae),'url':_0x108a12(0x81)+encodeURIComponent(_0x3ecac2['appCode'])+'/'+encodeURIComponent(_0x20f7e1)+_0x108a12(0x8e),'description':_0x108a12(0x87),'body':{'schemaFingerprint':_0x96ae60[_0x108a12(0xc4)]},'validRows':Math[_0x108a12(0xa2)](0x0,_0x22e297['rows']['length']-_0x584659),'invalidRows':_0x584659,'invalidCells':_0x22e297[_0x108a12(0xba)]['length'],'emptyRows':_0x22e297[_0x108a12(0x8a)][_0x108a12(0xa8)],'expectedBatches':previewImportBatchCount(_0x22e297,_0x96ae60,_0x3027ee[_0x108a12(0x91)]),'imageCount':_0x22e297[_0x108a12(0x7b)]?.[_0x108a12(0xa1)]((_0x41bb43,_0x157120)=>_0x41bb43+_0x157120['hashes'][_0x108a12(0xa8)],0x0)??0x0,'uniqueImages':_0x22e297[_0x108a12(0x80)]?.[_0x108a12(0xa8)]??0x0,'uniqueImageBytes':_0x22e297[_0x108a12(0x80)]?.[_0x108a12(0xa1)]((_0x1495a4,_0x565b91)=>_0x1495a4+_0x565b91[_0x108a12(0xa3)],0x0)??0x0,'errors':_0x22e297[_0x108a12(0xba)],'warnings':_0x22e297[_0x108a12(0x95)],'sheet':_0x22e297['sheet'],'checkpoint':_0x3027ee[_0x108a12(0x90)],'report':_0x3027ee[_0x108a12(0x82)]};}),'execute':async _0x31c6a1=>checked(async()=>{const _0xbed5a7=a26_0x4010fc,{args:_0xadfa79,manifest:_0x28ba14,contract:_0x428e3d,code:_0x2b39cf}=await prepare(_0x31c6a1);if(_0x28ba14[_0xbed5a7(0xba)][_0xbed5a7(0xa8)]){await saveImportJson(_0xadfa79['report'],{'status':_0xbed5a7(0xc5),'sourceRows':_0x28ba14['rows']['length'],'errors':_0x28ba14[_0xbed5a7(0xba)],'emptyRows':_0x28ba14[_0xbed5a7(0x8a)],'warnings':_0x28ba14['warnings']});throw CliErrors['validation']('Excel\x20contains\x20'+_0x28ba14[_0xbed5a7(0xba)][_0xbed5a7(0xa8)]+_0xbed5a7(0xc0),'See\x20'+_0xadfa79[_0xbed5a7(0x82)]+'.');}const _0x1124a8=_0x28ba14[_0xbed5a7(0xb5)]?.['length']?runImageExcelImport:_0x428e3d[_0xbed5a7(0x84)]===0x2?runAutoIdExcelImport:runExcelImport,_0x3a4b91=await _0x1124a8({..._0xadfa79,'manifest':_0x28ba14,'contract':_0x428e3d,'appCode':_0x31c6a1['appCode'],'datasetCode':_0x2b39cf,'runtimeDomain':getRuntimeDomain(),'inputPaths':[_0xadfa79[_0xbed5a7(0x7e)],_0xadfa79[_0xbed5a7(0xd1)]],'imageApi':{'upload':(_0x418adf,_0x2496b6)=>uploadDatasetImportImage(_0x31c6a1[_0xbed5a7(0xc7)],_0x2b39cf,_0x418adf,_0x2496b6),'readback':(_0x43b393,_0x963c38)=>readDatasetImportImage(_0x31c6a1[_0xbed5a7(0xc7)],_0x2b39cf,_0x43b393,_0x963c38)},'api':{'write':(_0x487314,_0x5a2f25)=>createDatasetImportBatch(_0x31c6a1['appCode'],_0x2b39cf,{'schemaFingerprint':_0x428e3d[_0xbed5a7(0xc4)],'items':_0x487314,..._0x5a2f25===undefined?{}:{'taskId':_0x5a2f25}}),'readback':_0x3e4b46=>readDatasetImportRows(_0x31c6a1[_0xbed5a7(0xc7)],_0x2b39cf,_0x3e4b46),'readTask':_0x2df0e9=>readDatasetImportTaskRows(_0x31c6a1[_0xbed5a7(0xc7)],_0x2b39cf,_0x2df0e9)}});return{'ok':!![],'data':_0x3a4b91,'message':'Imported\x20and\x20verified\x20'+_0x3a4b91[_0xbed5a7(0xa7)]+_0xbed5a7(0x92)};})};
|