@lovrabet/lovrabet-cli 2.3.5-beta.1 → 2.3.5-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/approval/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/import-excel.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.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.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.d.ts +2 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/access-error.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/services/dataset-import/auto-id-runner.js +1 -1
- package/lib/services/dataset-import/excel-reader.js +1 -1
- package/lib/services/dataset-import/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/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.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const a13_0x3cade4=a13_0x2679;(function(_0x2869ac,_0xa7a205){const _0x55237a=a13_0x2679,_0x27b2e5=_0x2869ac();while(!![]){try{const _0x2a05a7=-parseInt(_0x55237a(0xd2))/0x1*(parseInt(_0x55237a(0x101))/0x2)+parseInt(_0x55237a(0xb6))/0x3*(-parseInt(_0x55237a(0xc2))/0x4)+-parseInt(_0x55237a(0xcb))/0x5+-parseInt(_0x55237a(0xcf))/0x6*(parseInt(_0x55237a(0xc5))/0x7)+-parseInt(_0x55237a(0xdc))/0x8+parseInt(_0x55237a(0xed))/0x9+parseInt(_0x55237a(0xcc))/0xa;if(_0x2a05a7===_0xa7a205)break;else _0x27b2e5['push'](_0x27b2e5['shift']());}catch(_0x282a84){_0x27b2e5['push'](_0x27b2e5['shift']());}}}(a13_0x481b,0x29525));import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvName}from'../../constant/product.js';import{AUTH_MODE}from'../../constant/auth-mode.js';import{normalizeEnv,isDaily,isDev}from'../../constant/env.js';import{USER_ACCESS_KEY_CREATE_URL}from'../../constant/url.js';import{CliErrors}from'../../errors.js';import{promptAccessKey,isAbortPrompt}from'../../commands/auth/prompt.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{getLoginUserInfo}from'../../core/api-client.js';import{getUserDomain}from'../../constant/domain.js';function a13_0x2679(_0x28bd0f,_0x133f35){_0x28bd0f=_0x28bd0f-0xb5;const _0x481b37=a13_0x481b();let _0x2679d0=_0x481b37[_0x28bd0f];return _0x2679d0;}function a13_0x481b(){const _0x1ad19d=['1343184vQGFeH','login','write','Status:\x20valid','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','Option\x20C:\x20environment\x20variable','Missing\x20accessKey.','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','accessKey','isTTY','read','AccessKey\x20(ak_xxx...)','join','Auth\x20mode:\x20','=ak_xxx','Saves\x20a\x20new\x20AccessKey\x20to\x20the\x20selected\x20Lovrabet\x20config.\x20An\x20existing\x20key\x20in\x20that\x20scope\x20is\x20overwritten.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20the\x20secret.','ClientAk','2005731ltWUTy','Device\x20authorization\x20pending.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20try\x20again.','\x20auth\x20login\x20--access-key\x20<ak_xxx>','accessKeyCreatePath','Then\x20verify\x20with:\x20','status','If\x20command\x20execution\x20still\x20fails,\x20run:\x20','No\x20AccessKey\x20found\x20in\x20','\x20config.','string','trim','scope','\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','Shorthand\x20for\x20--access-key','success','Use\x20`','yes','validation','Option\x20A:\x20','production','42OcjLpk','test','Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','daily','\x20Verify:\x20','str','stdin','cancelled','72DgTuVe','global-default','logout','userCenterDisplayName','\x20\x20export\x20','global\x20config','AccessKey\x20saved\x20to\x20','Clear\x20the\x20AccessKey\x20from\x20config','env','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','access-key','nonInteractive','36932wjFtqJ','boolean','authRequired','192521dTnahn','stdout','project\x20config','Tip:\x20you\x20can\x20also\x20run:','\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.','Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20','1545205HsTejH','10341250YjaQZA','AccessKey:\x20','auth','66jlqewl','Invalid\x20accessKey\x20format.','project','4127rvcLkt','\x20(via\x20','ACCESS_KEY','global','development','code','bool','push','\x20auth\x20status','access_key'];a13_0x481b=function(){return _0x1ad19d;};return a13_0x481b();}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(_0x56a750=USER_ACCESS_KEY_CREATE_URL){const _0x1bf3ec=a13_0x2679;writeCliSideChannelLine('AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20'+PRODUCT_CONFIG[_0x1bf3ec(0xb9)]+':'),writeCliSideChannelLine('\x0a'+_0x56a750+'\x0a'),writeCliSideChannelLine(_0x1bf3ec(0xc8)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x1bf3ec(0xef));}function buildAccessKeySetupGuide(_0x42899f=USER_ACCESS_KEY_CREATE_URL){const _0x2744b1=a13_0x2679;return[_0x2744b1(0xbf)+PRODUCT_CONFIG[_0x2744b1(0xb9)]+':',_0x42899f,_0x2744b1(0xca)+CLI_BIN_NAME+_0x2744b1(0xf9)][_0x2744b1(0xe8)]('\x0a');}function canPromptForAccessKey(_0x3217e5){const _0x4a2761=a13_0x2679;return!_0x3217e5[_0x4a2761(0xc1)]&&process[_0x4a2761(0x108)][_0x4a2761(0xe5)]!==![]&&process[_0x4a2761(0xc6)][_0x4a2761(0xe5)]!==![];}function resolveAuthScopeFlags(_0x4900bf){const _0x1f42c5=a13_0x2679;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x4900bf[_0x1f42c5(0xd8)]('global'),'explicitProject':_0x4900bf[_0x1f42c5(0xd8)](_0x1f42c5(0xd1)),'policy':_0x1f42c5(0xb7)}));}async function resolveAuthWriteInput(_0x424335){const _0xc74246=a13_0x2679;let _0x4df8e1=(_0x424335[_0xc74246(0x107)](_0xc74246(0xc0))||_0x424335[_0xc74246(0x107)]('ak')||'')['trim']();const _0x134dbe=(_0x424335[_0xc74246(0x107)](_0xc74246(0xbe))||'')[_0xc74246(0xf7)](),_0x17d4bf=''+getUserDomain()+PRODUCT_CONFIG['accessKeyCreatePath'];if(!_0x4df8e1&&canPromptForAccessKey(_0x424335))try{showAccessKeyCreateHint(_0x17d4bf),_0x4df8e1=await promptAccessKey('');}catch(_0x1fc64d){if(isAbortPrompt(_0x1fc64d))throw CliErrors[_0xc74246(0xb5)]();throw _0x1fc64d;}if(!_0x4df8e1)throw CliErrors['validation'](_0xc74246(0xe2),buildAccessKeySetupGuide(_0x17d4bf));if(!ACCESS_KEY_PATTERN[_0xc74246(0x102)](_0x4df8e1))throw CliErrors[_0xc74246(0xfe)](_0xc74246(0xd0),'Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars');if(!_0x134dbe)return{'accessKey':_0x4df8e1};const _0x48488c=normalizeEnv(_0x134dbe);return{'accessKey':_0x4df8e1,'env':isDaily(_0x48488c)?_0xc74246(0x105):isDev(_0x48488c)?_0xc74246(0xd6):_0xc74246(0x100)};}export const authDefinitions=[{'service':a13_0x3cade4(0xce),'command':a13_0x3cade4(0xdd),'description':'Save\x20the\x20AccessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20the\x20project\x20file)','risk':'write','confirmationDescription':a13_0x3cade4(0xeb),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a13_0x3cade4(0xc0),'type':a13_0x3cade4(0xf6),'description':a13_0x3cade4(0xe7)},{'name':'ak','type':a13_0x3cade4(0xf6),'description':a13_0x3cade4(0xfa)},{'name':a13_0x3cade4(0xd5),'type':a13_0x3cade4(0xc3),'description':'Write\x20to\x20global\x20config\x20(default)','default':!![]},{'name':'project','type':a13_0x3cade4(0xc3),'description':a13_0x3cade4(0xe0),'default':![]}],async 'execute'(_0x4fd95e){const _0x274490=a13_0x3cade4;if(_0x4fd95e[_0x274490(0xd8)](_0x274490(0xfd)))throw CliErrors[_0x274490(0xfe)]('`auth\x20login`\x20does\x20not\x20support\x20--yes.',_0x274490(0xfc)+CLI_BIN_NAME+'\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`'+CLI_BIN_NAME+_0x274490(0xc9));const _0x46aa24=(_0x4fd95e[_0x274490(0x107)](_0x274490(0xc0))||_0x4fd95e[_0x274490(0x107)]('ak')||'')['trim']();if(!_0x46aa24&&_0x4fd95e[_0x274490(0xc1)])return{'ok':!![],'message':buildAccessKeySetupGuide(''+getUserDomain()+PRODUCT_CONFIG[_0x274490(0xf0)])};const _0x2d1f4c=await resolveAuthWriteInput(_0x4fd95e),_0x300584=resolveAuthScopeFlags(_0x4fd95e),_0x2892c9=readScopedConfig(_0x300584);_0x2892c9[_0x274490(0xe4)]=_0x2d1f4c[_0x274490(0xe4)];_0x2d1f4c[_0x274490(0xbe)]&&(_0x2892c9['env']=_0x2d1f4c['env']);writeScopedConfig(_0x2892c9,_0x300584);const _0x494d63=_0x300584[_0x274490(0xd5)]?'global':'project',_0x3bd77f=_0x2892c9[_0x274490(0xbe)]?'\x20Current\x20env:\x20'+_0x2892c9[_0x274490(0xbe)]+'.':'';return{'ok':!![],'message':_0x274490(0xbc)+_0x494d63+_0x274490(0xf5)+_0x3bd77f+_0x274490(0x106)+CLI_BIN_NAME+_0x274490(0xda)};}},{'service':a13_0x3cade4(0xce),'command':a13_0x3cade4(0xb8),'description':a13_0x3cade4(0xbd),'risk':a13_0x3cade4(0xde),'confirmationDescription':'Removes\x20the\x20AccessKey\x20from\x20the\x20selected\x20Lovrabet\x20config.\x20Commands\x20that\x20need\x20that\x20key\x20will\x20require\x20login\x20again.','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a13_0x3cade4(0xd5),'type':a13_0x3cade4(0xc3),'description':'Clear\x20from\x20global\x20config\x20(default)','default':!![]},{'name':'project','type':'boolean','description':a13_0x3cade4(0x104),'default':![]}],async 'execute'(_0x2708c5){const _0xff1db5=a13_0x3cade4,_0x586f16=resolveAuthScopeFlags(_0x2708c5),_0x3b7e07=readScopedConfig(_0x586f16),_0x305b81=!!_0x3b7e07[_0xff1db5(0xe4)];delete _0x3b7e07['accessKey'],writeScopedConfig(_0x3b7e07,_0x586f16);const _0xe2b14e=_0x586f16['global']?'global':_0xff1db5(0xd1);if(_0x305b81)return{'ok':!![],'message':'AccessKey\x20cleared\x20from\x20'+_0xe2b14e+'\x20config.'};return{'ok':!![],'message':_0xff1db5(0xf4)+_0xe2b14e+'\x20config.\x20Nothing\x20to\x20clear.'};}},{'service':a13_0x3cade4(0xce),'command':a13_0x3cade4(0xf2),'description':'Show\x20current\x20authentication\x20status','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a13_0x3cade4(0xd5),'type':a13_0x3cade4(0xc3),'description':'Read\x20from\x20global\x20config\x20(default)','default':!![]},{'name':'project','type':a13_0x3cade4(0xc3),'description':'Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]},{'name':'check','type':'boolean','description':'Exit\x20non-zero\x20when\x20no\x20AccessKey\x20is\x20configured','default':![]}],async 'execute'(_0x16cdd8){const _0x28399a=a13_0x3cade4,_0x310a7e=resolveAuthScopeFlags(_0x16cdd8),_0x159cdd=readScopedConfig(_0x310a7e),_0x22b452=productEnvName(_0x28399a(0xd4)),_0x47cc3a=productEnv(_0x28399a(0xd4))||undefined,_0x3a941d=_0x159cdd[_0x28399a(0xe4)]||undefined,_0x114a2d=_0x47cc3a||_0x3a941d,_0x10e0d1=_0x47cc3a?_0x22b452+'\x20env\x20var':_0x3a941d?(_0x310a7e[_0x28399a(0xd5)]?_0x28399a(0xd5):_0x28399a(0xd1))+'\x20config':null,_0x38526b=[_0x28399a(0xe9)+AUTH_MODE[_0x28399a(0xec)]];if(_0x114a2d){const _0x2551d8=maskCliAccessKey(_0x114a2d);_0x38526b[_0x28399a(0xd9)](_0x28399a(0xcd)+_0x2551d8+(_0x10e0d1?'\x20(via\x20'+_0x10e0d1+')':'')),_0x38526b[_0x28399a(0xd9)](_0x28399a(0xdf));}if(!_0x114a2d){_0x38526b[_0x28399a(0xd9)](''),_0x38526b[_0x28399a(0xd9)](_0x28399a(0xe3)),_0x38526b[_0x28399a(0xd9)](''),_0x38526b['push'](_0x28399a(0xff)+CLI_BIN_NAME+'\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]'),_0x38526b['push'](''),_0x38526b['push']('Option\x20B:\x20apps\x20config\x20('+PRODUCT_CONFIG['newConfigFileName']+')'),_0x38526b[_0x28399a(0xd9)]('{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}'),_0x38526b[_0x28399a(0xd9)](''),_0x38526b[_0x28399a(0xd9)](_0x28399a(0xe1)),_0x38526b[_0x28399a(0xd9)](_0x28399a(0xba)+_0x22b452+_0x28399a(0xea)),_0x38526b[_0x28399a(0xd9)](''),_0x38526b[_0x28399a(0xd9)](_0x28399a(0xf1)+CLI_BIN_NAME+'\x20auth\x20status'),_0x38526b[_0x28399a(0xd9)](_0x28399a(0xf3)+CLI_BIN_NAME+'\x20doctor');if(_0x16cdd8['bool']('check')){const _0xa47fa2=readStoredDeviceCode();if(_0xa47fa2&&!isStoredDeviceCodeExpired(_0xa47fa2)){const _0x12a807=getUserDomain(),_0x2137ef=await fetchDeviceToken(_0x12a807,_0xa47fa2[_0x28399a(0xd7)]);if(_0x2137ef[_0x28399a(0xf2)]===_0x28399a(0xfb)&&_0x2137ef[_0x28399a(0xdb)]){const _0x354e82={'global':_0xa47fa2[_0x28399a(0xf8)]==='global'},_0x2917c5=readScopedConfig(_0x354e82);_0x2917c5[_0x28399a(0xe4)]=_0x2137ef[_0x28399a(0xdb)],writeScopedConfig(_0x2917c5,_0x354e82),deleteStoredDeviceCode();const _0x1a1f86=_0x2137ef[_0x28399a(0xdb)],_0x1cc91a=maskCliAccessKey(_0x1a1f86),_0x28e59d=_0xa47fa2['scope']==='global'?_0x28399a(0xbb):_0x28399a(0xc7);return{'ok':!![],'message':[_0x28399a(0xe9)+AUTH_MODE[_0x28399a(0xec)],_0x28399a(0xcd)+_0x1cc91a+_0x28399a(0xd3)+_0x28e59d+')',_0x28399a(0xdf)][_0x28399a(0xe8)]('\x0a')};}_0x2137ef[_0x28399a(0xf2)]==='expired'&&deleteStoredDeviceCode();throw CliErrors[_0x28399a(0xc4)](_0x28399a(0xee));}throw CliErrors[_0x28399a(0xc4)](_0x38526b[_0x28399a(0xe8)]('\x0a'));}}return{'ok':!![],'message':_0x38526b['join']('\x0a')};}},{'service':a13_0x3cade4(0xce),'command':'info','description':a13_0x3cade4(0x103),'risk':a13_0x3cade4(0xe6),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x3a85d0){const _0x21fddf=a13_0x3cade4,_0x597f3e=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x597f3e,'meta':{'env':_0x3a85d0['envName']??_0x21fddf(0x100)}}};}},authDeviceDefinition];
|
|
1
|
+
const a13_0x136abe=a13_0x2191;(function(_0x3f99c1,_0x20584c){const _0x2b6210=a13_0x2191,_0x55468e=_0x3f99c1();while(!![]){try{const _0x552580=-parseInt(_0x2b6210(0xeb))/0x1+parseInt(_0x2b6210(0x102))/0x2+parseInt(_0x2b6210(0x10a))/0x3+-parseInt(_0x2b6210(0xd0))/0x4*(parseInt(_0x2b6210(0x11e))/0x5)+parseInt(_0x2b6210(0xd9))/0x6*(-parseInt(_0x2b6210(0xe7))/0x7)+-parseInt(_0x2b6210(0xe4))/0x8*(-parseInt(_0x2b6210(0x11c))/0x9)+-parseInt(_0x2b6210(0x120))/0xa*(-parseInt(_0x2b6210(0xe6))/0xb);if(_0x552580===_0x20584c)break;else _0x55468e['push'](_0x55468e['shift']());}catch(_0x1d7b47){_0x55468e['push'](_0x55468e['shift']());}}}(a13_0x28de,0xec5da));import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvName}from'../../constant/product.js';function a13_0x2191(_0x962a6c,_0x12efed){_0x962a6c=_0x962a6c-0xc9;const _0x28de1d=a13_0x28de();let _0x219122=_0x28de1d[_0x962a6c];return _0x219122;}import{AUTH_MODE}from'../../constant/auth-mode.js';import{normalizeEnv,isDaily,isDev}from'../../constant/env.js';import{USER_ACCESS_KEY_CREATE_URL}from'../../constant/url.js';import{CliErrors}from'../../errors.js';import{promptAccessKey,isAbortPrompt}from'../../commands/auth/prompt.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{getLoginUserInfo}from'../../core/api-client.js';import{getUserDomain}from'../../constant/domain.js';function a13_0x28de(){const _0x5831a4=['Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','scope','AccessKey\x20(ak_xxx...)','\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.','trim','Then\x20verify\x20with:\x20','access-key','envName','1461808uXRABA','push','22wCCEAr','7UkfcSx','Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','If\x20command\x20execution\x20still\x20fails,\x20run:\x20','userCenterDisplayName','417904lFnfbN','\x20auth\x20login\x20--access-key\x20<ak_xxx>','Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20','AccessKey\x20saved\x20to\x20','Auth\x20mode:\x20','check','\x20Verify:\x20','validation','Exit\x20non-zero\x20when\x20no\x20AccessKey\x20is\x20configured','\x20(via\x20','production','\x20config','\x20auth\x20status','project\x20config','Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','\x20config.','Missing\x20accessKey.','Status:\x20valid','accessKey','join','stdout','expired','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','2367132KyHVJG','Show\x20current\x20authentication\x20status','success','Clear\x20the\x20AccessKey\x20from\x20config','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars','AccessKey\x20cleared\x20from\x20','read','global-default','1283235kDbRwE','cancelled','newConfigFileName','\x20Current\x20env:\x20','isTTY','auth','bool','ACCESS_KEY','AccessKey:\x20','global','\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','nonInteractive','Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','Option\x20B:\x20apps\x20config\x20(','info','Option\x20C:\x20environment\x20variable','\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`','authRequired','9CRSRCO','access_key','150OHZszC','yes','14370520HatBAD','\x20doctor','Save\x20the\x20AccessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20the\x20project\x20file)','env','daily','test','Tip:\x20you\x20can\x20also\x20run:','\x20\x20export\x20','code','boolean','str','204244hDjkgR','write','\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]','status','`auth\x20login`\x20does\x20not\x20support\x20--yes.','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','project','Read\x20from\x20global\x20config\x20(default)','development','10501518OtOmJx','Clear\x20from\x20global\x20config\x20(default)','Shorthand\x20for\x20--access-key'];a13_0x28de=function(){return _0x5831a4;};return a13_0x28de();}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(_0x1d201f=USER_ACCESS_KEY_CREATE_URL){const _0x43a27b=a13_0x2191;writeCliSideChannelLine(_0x43a27b(0x101)+PRODUCT_CONFIG['userCenterDisplayName']+':'),writeCliSideChannelLine('\x0a'+_0x1d201f+'\x0a'),writeCliSideChannelLine(_0x43a27b(0xcb)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x43a27b(0xec));}function buildAccessKeySetupGuide(_0x20fb1d=USER_ACCESS_KEY_CREATE_URL){const _0x4af645=a13_0x2191;return[_0x4af645(0x101)+PRODUCT_CONFIG[_0x4af645(0xea)]+':',_0x20fb1d,_0x4af645(0xed)+CLI_BIN_NAME+_0x4af645(0x114)][_0x4af645(0xfe)]('\x0a');}function canPromptForAccessKey(_0x32cf7e){const _0x1c5f55=a13_0x2191;return!_0x32cf7e[_0x1c5f55(0x115)]&&process['stdin'][_0x1c5f55(0x10e)]!==![]&&process[_0x1c5f55(0xff)][_0x1c5f55(0x10e)]!==![];}function resolveAuthScopeFlags(_0x25831c){const _0x2b3d40=a13_0x2191;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x25831c[_0x2b3d40(0x110)](_0x2b3d40(0x113)),'explicitProject':_0x25831c['bool'](_0x2b3d40(0xd6)),'policy':_0x2b3d40(0x109)}));}async function resolveAuthWriteInput(_0x2ee5a8){const _0x235f55=a13_0x2191;let _0xa8873a=(_0x2ee5a8[_0x235f55(0xcf)](_0x235f55(0xe2))||_0x2ee5a8['str']('ak')||'')[_0x235f55(0xe0)]();const _0x262da8=(_0x2ee5a8[_0x235f55(0xcf)]('env')||'')[_0x235f55(0xe0)](),_0x40ea28=''+getUserDomain()+PRODUCT_CONFIG['accessKeyCreatePath'];if(!_0xa8873a&&canPromptForAccessKey(_0x2ee5a8))try{showAccessKeyCreateHint(_0x40ea28),_0xa8873a=await promptAccessKey('');}catch(_0x76d974){if(isAbortPrompt(_0x76d974))throw CliErrors[_0x235f55(0x10b)]();throw _0x76d974;}if(!_0xa8873a)throw CliErrors['validation'](_0x235f55(0xfb),buildAccessKeySetupGuide(_0x40ea28));if(!ACCESS_KEY_PATTERN[_0x235f55(0xca)](_0xa8873a))throw CliErrors[_0x235f55(0xf2)]('Invalid\x20accessKey\x20format.',_0x235f55(0x106));if(!_0x262da8)return{'accessKey':_0xa8873a};const _0x422a96=normalizeEnv(_0x262da8);return{'accessKey':_0xa8873a,'env':isDaily(_0x422a96)?_0x235f55(0xc9):isDev(_0x422a96)?_0x235f55(0xd8):_0x235f55(0xf5)};}export const authDefinitions=[{'service':a13_0x136abe(0x10f),'command':'login','description':a13_0x136abe(0x122),'risk':a13_0x136abe(0xd1),'confirmationDescription':'Saves\x20a\x20new\x20AccessKey\x20to\x20the\x20selected\x20Lovrabet\x20config.\x20An\x20existing\x20key\x20in\x20that\x20scope\x20is\x20overwritten.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20the\x20secret.','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'access-key','type':'string','description':a13_0x136abe(0xde)},{'name':'ak','type':'string','description':a13_0x136abe(0xdb)},{'name':a13_0x136abe(0x113),'type':a13_0x136abe(0xce),'description':'Write\x20to\x20global\x20config\x20(default)','default':!![]},{'name':a13_0x136abe(0xd6),'type':a13_0x136abe(0xce),'description':a13_0x136abe(0xdc),'default':![]}],async 'execute'(_0x3d4272){const _0x3e42b9=a13_0x136abe;if(_0x3d4272['bool'](_0x3e42b9(0x11f)))throw CliErrors[_0x3e42b9(0xf2)](_0x3e42b9(0xd4),'Use\x20`'+CLI_BIN_NAME+_0x3e42b9(0x11a)+CLI_BIN_NAME+_0x3e42b9(0xdf));const _0x26671b=(_0x3d4272[_0x3e42b9(0xcf)]('access-key')||_0x3d4272[_0x3e42b9(0xcf)]('ak')||'')[_0x3e42b9(0xe0)]();if(!_0x26671b&&_0x3d4272[_0x3e42b9(0x115)])return{'ok':!![],'message':buildAccessKeySetupGuide(''+getUserDomain()+PRODUCT_CONFIG['accessKeyCreatePath'])};const _0x44ec4d=await resolveAuthWriteInput(_0x3d4272),_0x1b59c5=resolveAuthScopeFlags(_0x3d4272),_0xbf927f=readScopedConfig(_0x1b59c5);_0xbf927f['accessKey']=_0x44ec4d['accessKey'];_0x44ec4d[_0x3e42b9(0x123)]&&(_0xbf927f[_0x3e42b9(0x123)]=_0x44ec4d[_0x3e42b9(0x123)]);writeScopedConfig(_0xbf927f,_0x1b59c5);const _0x1bd604=_0x1b59c5[_0x3e42b9(0x113)]?_0x3e42b9(0x113):_0x3e42b9(0xd6),_0x4b2e42=_0xbf927f[_0x3e42b9(0x123)]?_0x3e42b9(0x10d)+_0xbf927f['env']+'.':'';return{'ok':!![],'message':_0x3e42b9(0xee)+_0x1bd604+'\x20config.'+_0x4b2e42+_0x3e42b9(0xf1)+CLI_BIN_NAME+_0x3e42b9(0xf7)};}},{'service':a13_0x136abe(0x10f),'command':'logout','description':a13_0x136abe(0x105),'risk':a13_0x136abe(0xd1),'confirmationDescription':'Removes\x20the\x20AccessKey\x20from\x20the\x20selected\x20Lovrabet\x20config.\x20Commands\x20that\x20need\x20that\x20key\x20will\x20require\x20login\x20again.','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a13_0x136abe(0x113),'type':a13_0x136abe(0xce),'description':a13_0x136abe(0xda),'default':!![]},{'name':'project','type':a13_0x136abe(0xce),'description':a13_0x136abe(0xf9),'default':![]}],async 'execute'(_0x1a2526){const _0x3321c8=a13_0x136abe,_0x16f4a1=resolveAuthScopeFlags(_0x1a2526),_0x3db293=readScopedConfig(_0x16f4a1),_0x4a8d9a=!!_0x3db293[_0x3321c8(0xfd)];delete _0x3db293['accessKey'],writeScopedConfig(_0x3db293,_0x16f4a1);const _0x39c562=_0x16f4a1[_0x3321c8(0x113)]?_0x3321c8(0x113):_0x3321c8(0xd6);if(_0x4a8d9a)return{'ok':!![],'message':_0x3321c8(0x107)+_0x39c562+_0x3321c8(0xfa)};return{'ok':!![],'message':'No\x20AccessKey\x20found\x20in\x20'+_0x39c562+'\x20config.\x20Nothing\x20to\x20clear.'};}},{'service':a13_0x136abe(0x10f),'command':a13_0x136abe(0xd3),'description':a13_0x136abe(0x103),'risk':a13_0x136abe(0x108),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a13_0x136abe(0x113),'type':a13_0x136abe(0xce),'description':a13_0x136abe(0xd7),'default':!![]},{'name':'project','type':a13_0x136abe(0xce),'description':a13_0x136abe(0x116),'default':![]},{'name':a13_0x136abe(0xf0),'type':a13_0x136abe(0xce),'description':a13_0x136abe(0xf3),'default':![]}],async 'execute'(_0x4eb215){const _0x4feacb=a13_0x136abe,_0x11dcc9=resolveAuthScopeFlags(_0x4eb215),_0x4485ed=readScopedConfig(_0x11dcc9),_0x51c3b5=productEnvName(_0x4feacb(0x111)),_0x116c7c=productEnv(_0x4feacb(0x111))||undefined,_0x4955ca=_0x4485ed[_0x4feacb(0xfd)]||undefined,_0xe5d503=_0x116c7c||_0x4955ca,_0x1c04bd=_0x116c7c?_0x51c3b5+'\x20env\x20var':_0x4955ca?(_0x11dcc9[_0x4feacb(0x113)]?_0x4feacb(0x113):_0x4feacb(0xd6))+_0x4feacb(0xf6):null,_0x32c82e=['Auth\x20mode:\x20'+AUTH_MODE['ClientAk']];if(_0xe5d503){const _0xf6168f=maskCliAccessKey(_0xe5d503);_0x32c82e[_0x4feacb(0xe5)](_0x4feacb(0x112)+_0xf6168f+(_0x1c04bd?_0x4feacb(0xf4)+_0x1c04bd+')':'')),_0x32c82e[_0x4feacb(0xe5)](_0x4feacb(0xfc));}if(!_0xe5d503){_0x32c82e[_0x4feacb(0xe5)](''),_0x32c82e[_0x4feacb(0xe5)]('No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:'),_0x32c82e[_0x4feacb(0xe5)](''),_0x32c82e[_0x4feacb(0xe5)]('Option\x20A:\x20'+CLI_BIN_NAME+_0x4feacb(0xd2)),_0x32c82e[_0x4feacb(0xe5)](''),_0x32c82e['push'](_0x4feacb(0x117)+PRODUCT_CONFIG[_0x4feacb(0x10c)]+')'),_0x32c82e[_0x4feacb(0xe5)](_0x4feacb(0xd5)),_0x32c82e[_0x4feacb(0xe5)](''),_0x32c82e['push'](_0x4feacb(0x119)),_0x32c82e[_0x4feacb(0xe5)](_0x4feacb(0xcc)+_0x51c3b5+'=ak_xxx'),_0x32c82e[_0x4feacb(0xe5)](''),_0x32c82e[_0x4feacb(0xe5)](_0x4feacb(0xe1)+CLI_BIN_NAME+_0x4feacb(0xf7)),_0x32c82e['push'](_0x4feacb(0xe9)+CLI_BIN_NAME+_0x4feacb(0x121));if(_0x4eb215[_0x4feacb(0x110)](_0x4feacb(0xf0))){const _0x1d452e=readStoredDeviceCode();if(_0x1d452e&&!isStoredDeviceCodeExpired(_0x1d452e)){const _0x2e8acd=getUserDomain(),_0x6a4836=await fetchDeviceToken(_0x2e8acd,_0x1d452e[_0x4feacb(0xcd)]);if(_0x6a4836['status']===_0x4feacb(0x104)&&_0x6a4836[_0x4feacb(0x11d)]){const _0x4b48d8={'global':_0x1d452e[_0x4feacb(0xdd)]===_0x4feacb(0x113)},_0x5e2709=readScopedConfig(_0x4b48d8);_0x5e2709[_0x4feacb(0xfd)]=_0x6a4836[_0x4feacb(0x11d)],writeScopedConfig(_0x5e2709,_0x4b48d8),deleteStoredDeviceCode();const _0x41946d=_0x6a4836['access_key'],_0x3bb73a=maskCliAccessKey(_0x41946d),_0x2c3bee=_0x1d452e[_0x4feacb(0xdd)]===_0x4feacb(0x113)?'global\x20config':_0x4feacb(0xf8);return{'ok':!![],'message':[_0x4feacb(0xef)+AUTH_MODE['ClientAk'],_0x4feacb(0x112)+_0x3bb73a+_0x4feacb(0xf4)+_0x2c3bee+')',_0x4feacb(0xfc)][_0x4feacb(0xfe)]('\x0a')};}_0x6a4836[_0x4feacb(0xd3)]===_0x4feacb(0x100)&&deleteStoredDeviceCode();throw CliErrors[_0x4feacb(0x11b)]('Device\x20authorization\x20pending.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20try\x20again.');}throw CliErrors['authRequired'](_0x32c82e[_0x4feacb(0xfe)]('\x0a'));}}return{'ok':!![],'message':_0x32c82e[_0x4feacb(0xfe)]('\x0a')};}},{'service':'auth','command':a13_0x136abe(0x118),'description':a13_0x136abe(0xe8),'risk':'read','requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x486a75){const _0x16c928=a13_0x136abe,_0x29ddaf=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x29ddaf,'meta':{'env':_0x486a75[_0x16c928(0xe3)]??_0x16c928(0xf5)}}};}},authDeviceDefinition];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xbdb8de,_0xcb53a2){const _0x73f249=a14_0x2723,_0x255e96=_0xbdb8de();while(!![]){try{const _0x189351=-parseInt(_0x73f249(0x6f))/0x1+-parseInt(_0x73f249(0x7d))/0x2+parseInt(_0x73f249(0x7f))/0x3+parseInt(_0x73f249(0x7c))/0x4*(-parseInt(_0x73f249(0x77))/0x5)+parseInt(_0x73f249(0x78))/0x6*(parseInt(_0x73f249(0x71))/0x7)+-parseInt(_0x73f249(0x7e))/0x8*(parseInt(_0x73f249(0x69))/0x9)+-parseInt(_0x73f249(0x74))/0xa*(-parseInt(_0x73f249(0x73))/0xb);if(_0x189351===_0xcb53a2)break;else _0x255e96['push'](_0x255e96['shift']());}catch(_0x4d9b7c){_0x255e96['push'](_0x255e96['shift']());}}}(a14_0x527b,0x7094e));import{createInterface}from'node:readline';function a14_0x2723(_0xf44d0f,_0x162f82){_0xf44d0f=_0xf44d0f-0x67;const _0x527bcb=a14_0x527b();let _0x2723bd=_0x527bcb[_0xf44d0f];return _0x2723bd;}class AbortPrompt extends Error{constructor(){const _0x63cdfc=a14_0x2723;super('User\x20aborted\x20prompt'),this[_0x63cdfc(0x6c)]=_0x63cdfc(0x6e);}}function createSafeRl(){const _0x374c71=a14_0x2723,_0x39c336=createInterface({'input':process[_0x374c71(0x68)],'output':process[_0x374c71(0x6a)]});let _0x381c8e;const _0x4c6a7c=new Promise((_0xcb0d3d,_0x58b7ee)=>{const _0x246e6f=_0x374c71;_0x381c8e=()=>{const _0x1a07a7=a14_0x2723;_0x381c8e&&(_0x39c336['removeListener'](_0x1a07a7(0x6b),_0x381c8e),_0x381c8e=undefined);try{_0x39c336[_0x1a07a7(0x75)]();}catch{}_0x58b7ee(new AbortPrompt());},_0x39c336[_0x246e6f(0x76)](_0x246e6f(0x6b),_0x381c8e);}),_0x5501f9=()=>{const _0x5ea369=_0x374c71;_0x381c8e&&(_0x39c336[_0x5ea369(0x67)](_0x5ea369(0x6b),_0x381c8e),_0x381c8e=undefined);try{_0x39c336['close']();}catch{}};return{'rl':_0x39c336,'abortPromise':_0x4c6a7c,'disposeSuccess':_0x5501f9};}function a14_0x527b(){const _0x514227=['SIGINT','name','question','AbortPrompt','130860WbXYtd','AccessKey\x20(paste\x20ak_...):\x20','677418YAmaUh','trim','12015861byojZS','10GkcdRB','close','once','7605EXRoxQ','6TCgUqT','):\x20','race','AccessKey\x20(','1304qZSpvk','850696DNscTb','223864lwwgHX','2483271uiOtHA','removeListener','stdin','162qwiRYV','stdout'];a14_0x527b=function(){return _0x514227;};return a14_0x527b();}export async function promptAccessKey(_0x2c35fe=''){const _0x31872d=a14_0x2723,{rl:_0x1ecba0,abortPromise:_0x106b48,disposeSuccess:_0xcc54e1}=createSafeRl(),_0x9f70cc=new Promise(_0x55f01c=>{const _0x88e19e=a14_0x2723,_0x5e4c9b=_0x2c35fe?_0x88e19e(0x7b)+_0x2c35fe+_0x88e19e(0x79):_0x88e19e(0x70);_0x1ecba0[_0x88e19e(0x6d)](_0x5e4c9b,_0x59e4d6=>{const _0x35e643=_0x88e19e;_0xcc54e1(),_0x55f01c(_0x59e4d6[_0x35e643(0x72)]()||_0x2c35fe);});});return Promise[_0x31872d(0x7a)]([_0x9f70cc,_0x106b48]);}export function isAbortPrompt(_0x265844){const _0x99aa2c=a14_0x2723;return _0x265844 instanceof Error&&_0x265844[_0x99aa2c(0x6c)]===_0x99aa2c(0x6e);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a15_0xe6803a=a15_0x29f2;(function(_0x3262a5,_0x2dc5b6){const _0x316c01=a15_0x29f2,_0x4266a8=_0x3262a5();while(!![]){try{const _0x83467d=parseInt(_0x316c01(0x9d))/0x1*(parseInt(_0x316c01(0x98))/0x2)+parseInt(_0x316c01(0x90))/0x3*(-parseInt(_0x316c01(0x9f))/0x4)+-parseInt(_0x316c01(0x97))/0x5+parseInt(_0x316c01(0x95))/0x6*(-parseInt(_0x316c01(0x91))/0x7)+parseInt(_0x316c01(0x93))/0x8*(-parseInt(_0x316c01(0x9a))/0x9)+-parseInt(_0x316c01(0xa1))/0xa+parseInt(_0x316c01(0x92))/0xb;if(_0x83467d===_0x2dc5b6)break;else _0x4266a8['push'](_0x4266a8['shift']());}catch(_0x2e4954){_0x4266a8['push'](_0x4266a8['shift']());}}}(a15_0x5838,0xbb67a));import{getBffEndpointContract}from'../../core/api-client.js';function a15_0x5838(){const _0x47b547=['name','3lWvijx','43001cVzfif','40121873SDSHRo','40SbzOyS','gmtModified','180rxgtBz','appCode','4913875ojzedj','6PGLdDE','Get\x20a\x20Backend\x20Function\x20endpoint\x20contract\x20by\x20function\x20name','1323306LcDEie','bff','detail','374897PgFrPR','str','4564828rDIAeN','functionName','9610820mlciyU','description'];a15_0x5838=function(){return _0x47b547;};return a15_0x5838();}function a15_0x29f2(_0x3bc0b8,_0x53f155){_0x3bc0b8=_0x3bc0b8-0x90;const _0x583812=a15_0x5838();let _0x29f252=_0x583812[_0x3bc0b8];return _0x29f252;}import{NAME_FLAG}from'../../commands/common/flags.js';export const bffDetail={'service':a15_0xe6803a(0x9b),'command':a15_0xe6803a(0x9c),'description':a15_0xe6803a(0x99),'risk':'read','flags':[{...NAME_FLAG,'required':!![],'description':'Backend\x20Function\x20name'}],async 'execute'(_0x58b8d2){const _0x364e89=a15_0xe6803a,_0x3d5b89=await getBffEndpointContract(_0x58b8d2['appCode'],_0x58b8d2[_0x364e89(0x9e)](_0x364e89(0xa3)));return{'ok':!![],'data':{'appCode':_0x3d5b89[_0x364e89(0x96)],'functionName':_0x3d5b89[_0x364e89(0xa0)],'description':_0x3d5b89[_0x364e89(0xa2)]||'(none)','version':_0x3d5b89['version'],'gmtModified':_0x3d5b89[_0x364e89(0x94)]}};}};
|
package/lib/commands/bff/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a16_0x148322=a16_0x45a8;(function(_0xd32b13,_0x492dc7){const _0x1aa20c=a16_0x45a8,_0x2a16e1=_0xd32b13();while(!![]){try{const _0x5e977a=parseInt(_0x1aa20c(0x11f))/0x1*(-parseInt(_0x1aa20c(0x11e))/0x2)+parseInt(_0x1aa20c(0x122))/0x3*(parseInt(_0x1aa20c(0x119))/0x4)+parseInt(_0x1aa20c(0x11d))/0x5+-parseInt(_0x1aa20c(0x11a))/0x6*(-parseInt(_0x1aa20c(0x121))/0x7)+parseInt(_0x1aa20c(0x115))/0x8+parseInt(_0x1aa20c(0x117))/0x9+-parseInt(_0x1aa20c(0x11c))/0xa*(parseInt(_0x1aa20c(0x11b))/0xb);if(_0x5e977a===_0x492dc7)break;else _0x2a16e1['push'](_0x2a16e1['shift']());}catch(_0x229678){_0x2a16e1['push'](_0x2a16e1['shift']());}}}(a16_0x5df2,0xe689f));import{executeSdkBff}from'../../core/sdk-client.js';function a16_0x5df2(){const _0x237d75=['now','255016fXFpWS','params','11331918HEseaQ','Backend\x20Function\x20executed\x20in\x20','3053392mGTxGp','18DzDDKv','11sQIuPc','27529930YzbRGp','4226895VaGkIR','1094KfjyLs','1153RgAWFt','exec','1551473zJsvXi','6myXark','bff','name','Execute\x20a\x20Backend\x20Function\x20script\x20by\x20function\x20name','Backend\x20Function\x20name\x20to\x20execute'];a16_0x5df2=function(){return _0x237d75;};return a16_0x5df2();}import{parseJsonParams}from'../../utils/params.js';import{NAME_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';function a16_0x45a8(_0x225a78,_0x3b7709){_0x225a78=_0x225a78-0x114;const _0x5df204=a16_0x5df2();let _0x45a890=_0x5df204[_0x225a78];return _0x45a890;}export const bffExec={'service':a16_0x148322(0x123),'command':a16_0x148322(0x120),'description':a16_0x148322(0x125),'risk':'read','flags':[{...NAME_FLAG,'required':!![],'description':a16_0x148322(0x126)},PARAMS_FLAG],async 'execute'(_0xfdd4df){const _0x5edeac=a16_0x148322,_0x26338a=parseJsonParams(_0xfdd4df['str'](_0x5edeac(0x116))),_0x77ae3f=Date[_0x5edeac(0x114)](),_0x121595=await executeSdkBff(_0xfdd4df['str'](_0x5edeac(0x124)),_0x26338a),_0x360037=Date[_0x5edeac(0x114)]()-_0x77ae3f;return{'ok':!![],'data':{'result':_0x121595,'elapsed':_0x360037},'message':_0x5edeac(0x118)+_0x360037+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x48f4cf,_0x5e4dee){const _0x2b1edc=a17_0x3f14,_0x106870=_0x48f4cf();while(!![]){try{const _0x1f4d30=-parseInt(_0x2b1edc(0x7c))/0x1+parseInt(_0x2b1edc(0x7f))/0x2*(parseInt(_0x2b1edc(0x7e))/0x3)+-parseInt(_0x2b1edc(0x80))/0x4+parseInt(_0x2b1edc(0x82))/0x5+-parseInt(_0x2b1edc(0x81))/0x6+parseInt(_0x2b1edc(0x83))/0x7+parseInt(_0x2b1edc(0x7d))/0x8*(parseInt(_0x2b1edc(0x84))/0x9);if(_0x1f4d30===_0x5e4dee)break;else _0x106870['push'](_0x106870['shift']());}catch(_0x382c81){_0x106870['push'](_0x106870['shift']());}}}(a17_0x1048,0x5dc2e));import{bffDetail}from'../../commands/bff/detail.js';import{bffExec}from'../../commands/bff/exec.js';function a17_0x1048(){const _0x2509c1=['536953jxYtxY','500592DZeIbG','1887483WxOjma','2MFVIjc','2291128qUWxNz','2398098ZcyWzg','1103645CrSNbN','4238892goVPel','63AdAByx'];a17_0x1048=function(){return _0x2509c1;};return a17_0x1048();}function a17_0x3f14(_0x4022cb,_0x129625){_0x4022cb=_0x4022cb-0x7c;const _0x10480d=a17_0x1048();let _0x3f14de=_0x10480d[_0x4022cb];return _0x3f14de;}export const bffDefinitions=[bffDetail,bffExec];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a18_0x1151(){const _0xe5f1b0=['1963524reUYbr','log','1938516eZpfVs','skillVersion','591PrPCBv','INSTALL_FAILED','Install\x20the\x20built-in\x20CLI\x20Skill\x20required\x20by\x20Lovrabet\x20runtime','apiError','pipe','info','\x20at\x20',']:\x20','cwd','Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20npm\x20package.','changed','cli-skill','nonInteractive','install','6631911oMNGyq','Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20','inherit','CLI\x20Built-in\x20Skill\x20','\x20installed','installedPath','Built-in\x20Skill\x20install\x20failed\x20[','1029721ilUzdv','7715050VXuBfT','1574hwnZNT','code','cli-skill-install','9782320PwfPiY','5XhqSSf','error'];a18_0x1151=function(){return _0xe5f1b0;};return a18_0x1151();}const a18_0x51caaa=a18_0x5ae4;(function(_0xc2a3c7,_0x5af670){const _0xfd3dfb=a18_0x5ae4,_0x453107=_0xc2a3c7();while(!![]){try{const _0x240bd1=parseInt(_0xfd3dfb(0x1f6))/0x1+-parseInt(_0xfd3dfb(0x1f8))/0x2*(parseInt(_0xfd3dfb(0x202))/0x3)+parseInt(_0xfd3dfb(0x200))/0x4*(-parseInt(_0xfd3dfb(0x1fc))/0x5)+-parseInt(_0xfd3dfb(0x1fe))/0x6+parseInt(_0xfd3dfb(0x1f7))/0x7+-parseInt(_0xfd3dfb(0x1fb))/0x8+parseInt(_0xfd3dfb(0x210))/0x9;if(_0x240bd1===_0x5af670)break;else _0x453107['push'](_0x453107['shift']());}catch(_0xb57b38){_0x453107['push'](_0x453107['shift']());}}}(a18_0x1151,0xa5c7e));import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';function a18_0x5ae4(_0x1a1b75,_0x1923d5){_0x1a1b75=_0x1a1b75-0x1f4;const _0x1151a3=a18_0x1151();let _0x5ae421=_0x1151a3[_0x1a1b75];return _0x5ae421;}import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':a18_0x51caaa(0x20d),'command':a18_0x51caaa(0x20f),'description':a18_0x51caaa(0x204),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x50c814){const _0x13beff=a18_0x51caaa;logger['setLogPath'](process[_0x13beff(0x20a)]()),logger[_0x13beff(0x207)](_0x13beff(0x1fa),_0x13beff(0x20b));const _0x2201e6=installBuiltinSkill({'stdio':_0x50c814[_0x13beff(0x20e)]?_0x13beff(0x206):_0x13beff(0x212)});if(!_0x2201e6['ok'])throw CliErrors[_0x13beff(0x205)](_0x13beff(0x1f5)+(_0x2201e6[_0x13beff(0x1f9)]||_0x13beff(0x203))+_0x13beff(0x209)+(_0x2201e6[_0x13beff(0x1fd)]||'unknown'),_0x13beff(0x211)+_0x2201e6['repairCommand']);const _0xf9f6d9=_0x2201e6[_0x13beff(0x1f4)]?_0x13beff(0x208)+_0x2201e6[_0x13beff(0x1f4)]:'';return console[_0x13beff(0x1ff)](_0x2201e6[_0x13beff(0x20c)]?_0x13beff(0x213)+_0x2201e6[_0x13beff(0x201)]+_0x13beff(0x214)+_0xf9f6d9:'CLI\x20Built-in\x20Skill\x20'+_0x2201e6['skillVersion']+'\x20is\x20already\x20current'+_0xf9f6d9),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x36418f,_0x4d01cb){const _0x5b88ae=a19_0x35a7,_0x517872=_0x36418f();while(!![]){try{const _0x76c689=-parseInt(_0x5b88ae(0x1f3))/0x1*(parseInt(_0x5b88ae(0x1e6))/0x2)+-parseInt(_0x5b88ae(0x1e9))/0x3+-parseInt(_0x5b88ae(0x1ee))/0x4*(parseInt(_0x5b88ae(0x1e2))/0x5)+-parseInt(_0x5b88ae(0x1ed))/0x6+parseInt(_0x5b88ae(0x1e7))/0x7+parseInt(_0x5b88ae(0x1f2))/0x8+parseInt(_0x5b88ae(0x1ea))/0x9*(parseInt(_0x5b88ae(0x1eb))/0xa);if(_0x76c689===_0x4d01cb)break;else _0x517872['push'](_0x517872['shift']());}catch(_0x4ccb8e){_0x517872['push'](_0x517872['shift']());}}}(a19_0x1171,0xe0ba5));import{PRODUCT_CONFIG}from'../../constant/product.js';function a19_0x35a7(_0x4ddc7a,_0x161094){_0x4ddc7a=_0x4ddc7a-0x1e1;const _0x117106=a19_0x1171();let _0x35a7f9=_0x117106[_0x4ddc7a];return _0x35a7f9;}export{DEFAULT_APP_PROFILE_NAME,DEFAULT_CONFIG_VALUES}from'../../constant/defaults.js';export{RUNTIME_ENV_VALUES}from'../../constant/env.js';export{OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{isInProject}from'../../context.js';import{CliErrors}from'../../errors.js';function a19_0x1171(){const _0x40181e=['\x20found).','newConfigFileName','global-default','1605925vysmMl','Add\x20--global\x20to\x20write\x20to\x20~/','validation','project','19834wEaHpO','2523948uhxVsC','project-or-global-explicit','4366272siCykm','45PKLtcF','7051480nncGmZ','inProject','3153948EtqVIa','20ozOPTU','Use\x20only\x20one\x20config\x20scope\x20flag.','global','\x20(global)','6476888dgDcef','19YUMgsk'];a19_0x1171=function(){return _0x40181e;};return a19_0x1171();}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(_0x762e03){const _0x32b971=a19_0x35a7,{explicitGlobal:explicitGlobal=![],explicitProject:explicitProject=![],policy:_0x5f0ee8}=_0x762e03;if(explicitGlobal&&explicitProject)throw CliErrors[_0x32b971(0x1e4)]('Flags\x20--global\x20and\x20--project\x20are\x20mutually\x20exclusive.',_0x32b971(0x1ef));if(explicitGlobal)return _0x32b971(0x1f0);if(explicitProject)return _0x32b971(0x1e5);switch(_0x5f0ee8){case _0x32b971(0x1e1):return _0x32b971(0x1f0);case _0x32b971(0x1e8):if(!(_0x762e03[_0x32b971(0x1ec)]??isInProject()))throw CliErrors['validation']('Not\x20inside\x20a\x20project\x20(no\x20'+PRODUCT_CONFIG[_0x32b971(0x1f5)]+_0x32b971(0x1f4),_0x32b971(0x1e3)+PRODUCT_CONFIG[_0x32b971(0x1f5)]+',\x20or\x20create\x20a\x20project-local\x20'+PRODUCT_CONFIG[_0x32b971(0x1f5)]+'\x20first.');return _0x32b971(0x1e5);}}export function toScopeFlags(_0x15e538){const _0x1ed5cf=a19_0x35a7;return{'global':_0x15e538===_0x1ed5cf(0x1f0)};}export function formatScopeLabel(_0x9ee74b){const _0x27edd7=a19_0x35a7;return _0x9ee74b===_0x27edd7(0x1f0)?_0x27edd7(0x1f1):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4f6834,_0x1c85e6){const _0x507905=a20_0xa8e2,_0xfb0903=_0x4f6834();while(!![]){try{const _0x4812d4=parseInt(_0x507905(0xde))/0x1*(parseInt(_0x507905(0xf0))/0x2)+parseInt(_0x507905(0xe3))/0x3+-parseInt(_0x507905(0xe1))/0x4*(parseInt(_0x507905(0xf6))/0x5)+parseInt(_0x507905(0xdf))/0x6+-parseInt(_0x507905(0xef))/0x7+parseInt(_0x507905(0xea))/0x8+-parseInt(_0x507905(0xf8))/0x9;if(_0x4812d4===_0x1c85e6)break;else _0xfb0903['push'](_0xfb0903['shift']());}catch(_0x41150b){_0xfb0903['push'](_0xfb0903['shift']());}}}(a20_0x16bd,0xe1f4f));import{CliErrors}from'../../errors.js';function isSet(_0x3745c6,_0x33f3e7){const _0x145af8=a20_0xa8e2,_0x555491=_0x3745c6[_0x145af8(0xe4)](_0x33f3e7);return _0x555491!==undefined&&_0x555491!==''&&_0x555491!==![]&&_0x555491!==0x0;}function a20_0xa8e2(_0x360e4f,_0x40cb6b){_0x360e4f=_0x360e4f-0xde;const _0x16bdc=a20_0x16bd();let _0xa8e268=_0x16bdc[_0x360e4f];return _0xa8e268;}function a20_0x16bd(){const _0x2480d7=['test',':\x20expected\x20','Exactly\x20one\x20of\x20','some','\x20is\x20allowed,\x20found:\x20','8650872CuLHpT','Invalid\x20--',',\x20got\x20\x22','validation','join','1020215ETubOY','34512rofyLk','\x20is\x20required\x20for\x20`','Provide\x20one\x20of:\x20','\x20are\x20mutually\x20exclusive\x20for\x20`','map','filter','13815knGmat','Only\x20one\x20of\x20','6276708YBMDBN','length','str','41CynVEx','1202190MnVXkV','Use\x20only\x20one\x20of:\x20','2524aIKeXK','Flags\x20','4568727jdDfoP','flag'];a20_0x16bd=function(){return _0x2480d7;};return a20_0x16bd();}function fmtNames(_0x3be7aa){const _0x5dcec9=a20_0xa8e2;return _0x3be7aa[_0x5dcec9(0xf4)](_0x4eff56=>'--'+_0x4eff56)[_0x5dcec9(0xee)](',\x20');}export function requireOneOf(_0xc895aa,_0x22ef9c,_0x348a7e){const _0x5df2f3=a20_0xa8e2,_0x431d9e=_0x22ef9c[_0x5df2f3(0xf5)](_0x325565=>isSet(_0xc895aa,_0x325565));if(_0x431d9e[_0x5df2f3(0xf9)]!==0x1)throw CliErrors[_0x5df2f3(0xed)](_0x431d9e[_0x5df2f3(0xf9)]===0x0?_0x5df2f3(0xe7)+fmtNames(_0x22ef9c)+'\x20is\x20required\x20for\x20`'+_0x348a7e+'`.':_0x5df2f3(0xf7)+fmtNames(_0x22ef9c)+_0x5df2f3(0xe9)+fmtNames(_0x431d9e)+'.',_0x431d9e[_0x5df2f3(0xf9)]===0x0?_0x5df2f3(0xf2)+fmtNames(_0x22ef9c):'Remove\x20all\x20but\x20one.');}export function requireAnyOf(_0x3b6bf8,_0x1b16d7,_0x70e463){const _0x4d2b44=a20_0xa8e2;if(!_0x1b16d7[_0x4d2b44(0xe8)](_0x38a570=>isSet(_0x3b6bf8,_0x38a570)))throw CliErrors['validation']('At\x20least\x20one\x20of\x20'+fmtNames(_0x1b16d7)+_0x4d2b44(0xf1)+_0x70e463+'`.','Provide\x20one\x20of:\x20'+fmtNames(_0x1b16d7));}export function mutuallyExclusive(_0x29051a,_0x367758,_0x43df90){const _0x4c43c5=a20_0xa8e2,_0x32dce1=_0x367758['filter'](_0x1b0540=>isSet(_0x29051a,_0x1b0540));if(_0x32dce1[_0x4c43c5(0xf9)]>0x1)throw CliErrors[_0x4c43c5(0xed)](_0x4c43c5(0xe2)+fmtNames(_0x32dce1)+_0x4c43c5(0xf3)+_0x43df90+'`.',_0x4c43c5(0xe0)+fmtNames(_0x367758));}export function validatePattern(_0x37f583,_0x2ca1ca,_0x5296e6,_0x4f9b28){const _0x32e5cb=a20_0xa8e2,_0x5edb19=_0x37f583[_0x32e5cb(0xfa)](_0x2ca1ca);if(_0x5edb19&&!_0x5296e6[_0x32e5cb(0xe5)](_0x5edb19))throw CliErrors['validation'](_0x32e5cb(0xeb)+_0x2ca1ca+_0x32e5cb(0xe6)+_0x4f9b28+_0x32e5cb(0xec)+_0x5edb19+'\x22.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a21_0xfbc9cf=a21_0x5eb3;(function(_0x56319f,_0x45e6e7){const _0x391e02=a21_0x5eb3,_0xdbaf23=_0x56319f();while(!![]){try{const _0x53f852=parseInt(_0x391e02(0x169))/0x1*(parseInt(_0x391e02(0x168))/0x2)+-parseInt(_0x391e02(0x163))/0x3*(parseInt(_0x391e02(0x16d))/0x4)+parseInt(_0x391e02(0x15f))/0x5*(-parseInt(_0x391e02(0x161))/0x6)+parseInt(_0x391e02(0x155))/0x7+-parseInt(_0x391e02(0x157))/0x8*(parseInt(_0x391e02(0x167))/0x9)+-parseInt(_0x391e02(0x159))/0xa*(-parseInt(_0x391e02(0x15b))/0xb)+parseInt(_0x391e02(0x166))/0xc;if(_0x53f852===_0x45e6e7)break;else _0xdbaf23['push'](_0xdbaf23['shift']());}catch(_0x372ae9){_0xdbaf23['push'](_0xdbaf23['shift']());}}}(a21_0x4e6d,0xecfa8));export const GLOBAL_SCOPE_FLAG={'name':a21_0xfbc9cf(0x16c),'type':a21_0xfbc9cf(0x16a),'default':![],'description':'Write\x20to\x20the\x20global\x20configuration'};export const CODE_FLAG={'name':a21_0xfbc9cf(0x15a),'type':'string','required':!![],'description':a21_0xfbc9cf(0x158),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a21_0xfbc9cf(0x15c)}};export const SQLCODE_FLAG={'name':'sqlcode','type':'string','required':!![],'description':'SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a21_0xfbc9cf(0x164)}};export const VERBOSE_FLAG={'name':a21_0xfbc9cf(0x162),'type':a21_0xfbc9cf(0x16a),'description':a21_0xfbc9cf(0x15e)};export const PARAMS_FLAG={'name':a21_0xfbc9cf(0x160),'type':a21_0xfbc9cf(0x15d),'description':a21_0xfbc9cf(0x16b)};function a21_0x4e6d(){const _0x379d35=['Return\x20full\x20raw\x20response\x20object','15KiHvxu','params','3761262SODMcN','verbose','4905iscwrT','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','name','48795624iMminB','14998617DmfdxJ','38dKiDIe','27659DloNBK','boolean','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','global','3484DGdaaB','9300130qrdHdW','Resource\x20ID','8kSLPJQ','Dataset\x20code\x20(32-char\x20hex\x20UUID)','600ZqOFLo','code','3938hKILnA','a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588)','string'];a21_0x4e6d=function(){return _0x379d35;};return a21_0x4e6d();}function a21_0x5eb3(_0x21bb8a,_0x57a719){_0x21bb8a=_0x21bb8a-0x155;const _0x4e6dfa=a21_0x4e6d();let _0x5eb3f1=_0x4e6dfa[_0x21bb8a];return _0x5eb3f1;}export const NAME_FLAG={'name':a21_0xfbc9cf(0x165),'type':'string','description':'Resource\x20name\x20for\x20lookup'};export const ID_FLAG={'name':'id','type':'number','required':!![],'description':a21_0xfbc9cf(0x156)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1c51a8,_0x492a61){const _0x4992b1=a22_0x1aef,_0x86a5b7=_0x1c51a8();while(!![]){try{const _0x585251=-parseInt(_0x4992b1(0x184))/0x1*(-parseInt(_0x4992b1(0x17f))/0x2)+-parseInt(_0x4992b1(0x17d))/0x3+parseInt(_0x4992b1(0x175))/0x4*(parseInt(_0x4992b1(0x177))/0x5)+parseInt(_0x4992b1(0x186))/0x6+parseInt(_0x4992b1(0x178))/0x7+parseInt(_0x4992b1(0x176))/0x8+parseInt(_0x4992b1(0x181))/0x9*(-parseInt(_0x4992b1(0x182))/0xa);if(_0x585251===_0x492a61)break;else _0x86a5b7['push'](_0x86a5b7['shift']());}catch(_0x340520){_0x86a5b7['push'](_0x86a5b7['shift']());}}}(a22_0x237d,0xbce4e));function a22_0x237d(){const _0x40b4db=['File\x20not\x20found:\x20','1827cyfQDH','88300JPdRKB','toFixed','1939yYWRly','isFile','7260924hdZkhT','ceil','1308584yMxywv','3904456auuVXo','10rOacTI','1880074NTBygT','validation','File\x20exceeds\x20the\x20runtime\x20upload\x20limit\x20of\x2050\x20MB:\x20','\x20MB','size','4079496FxeXFM','trim','1346NbwJoF'];a22_0x237d=function(){return _0x40b4db;};return a22_0x237d();}import{existsSync,statSync}from'node:fs';function a22_0x1aef(_0x4b51f0,_0x536504){_0x4b51f0=_0x4b51f0-0x175;const _0x237dfd=a22_0x237d();let _0x1aeff4=_0x237dfd[_0x4b51f0];return _0x1aeff4;}import{CliErrors}from'../../errors.js';const BYTES_PER_MB=0x400*0x400;export const RUNTIME_UPLOAD_MAX_BYTES=0x32*BYTES_PER_MB;function formatBytes(_0x3eb35f){const _0x1dff97=a22_0x1aef;if(_0x3eb35f>=BYTES_PER_MB){const _0x3b5bb7=Math[_0x1dff97(0x187)](_0x3eb35f/BYTES_PER_MB*0x64)/0x64;return _0x3b5bb7[_0x1dff97(0x183)](0x2)+_0x1dff97(0x17b);}return _0x3eb35f+'\x20B';}export function requireRuntimeUploadFile(_0x1fbd36,_0xbd1c66){const _0x126560=a22_0x1aef,_0x21fed1=_0x1fbd36[_0x126560(0x17e)]();if(!_0x21fed1)throw CliErrors[_0x126560(0x179)](_0xbd1c66+'\x20path\x20is\x20required.');if(!existsSync(_0x21fed1))throw CliErrors[_0x126560(0x179)](_0x126560(0x180)+_0x21fed1);const _0x28110b=statSync(_0x21fed1);if(!_0x28110b[_0x126560(0x185)]())throw CliErrors[_0x126560(0x179)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x21fed1);if(_0x28110b[_0x126560(0x17c)]>RUNTIME_UPLOAD_MAX_BYTES)throw CliErrors[_0x126560(0x179)](_0x126560(0x17a)+_0x21fed1+'\x20('+formatBytes(_0x28110b[_0x126560(0x17c)])+')');return{'path':_0x21fed1,'size':_0x28110b['size']};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a23_0x180c44=a23_0x1064;(function(_0x3dc4c5,_0x1019e4){const _0x2be692=a23_0x1064,_0x345df1=_0x3dc4c5();while(!![]){try{const _0x4ad788=parseInt(_0x2be692(0x19c))/0x1*(-parseInt(_0x2be692(0x195))/0x2)+-parseInt(_0x2be692(0x184))/0x3+-parseInt(_0x2be692(0x18a))/0x4*(-parseInt(_0x2be692(0x191))/0x5)+parseInt(_0x2be692(0x199))/0x6+-parseInt(_0x2be692(0x197))/0x7*(-parseInt(_0x2be692(0x17c))/0x8)+parseInt(_0x2be692(0x175))/0x9*(-parseInt(_0x2be692(0x17f))/0xa)+-parseInt(_0x2be692(0x171))/0xb*(-parseInt(_0x2be692(0x180))/0xc);if(_0x4ad788===_0x1019e4)break;else _0x345df1['push'](_0x345df1['shift']());}catch(_0x4dea88){_0x345df1['push'](_0x345df1['shift']());}}}(a23_0x45d2,0x3f046));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(_0x282573){const _0x505c9e=a23_0x1064,_0x2fcdd4=_0x282573['split']('.');if(_0x2fcdd4['length']!==0x3||_0x2fcdd4[0x0]!==_0x505c9e(0x16d)||_0x2fcdd4[0x2]!==_0x505c9e(0x16a))return undefined;const _0xa844d5=_0x2fcdd4[0x1]?.[_0x505c9e(0x19f)]();return _0xa844d5?_0xa844d5:undefined;}function parseAliasDeleteKey(_0x157f81){const _0x37fe91=a23_0x1064,_0x359bfb=_0x157f81[_0x37fe91(0x162)]('.');if(_0x359bfb[_0x37fe91(0x181)]===0x2&&_0x359bfb[0x0]===_0x37fe91(0x16d)){const _0x45aed4=_0x359bfb[0x1]?.[_0x37fe91(0x19f)]();return _0x45aed4?{'alias':_0x45aed4}:undefined;}if(_0x359bfb[_0x37fe91(0x181)]===0x3&&_0x359bfb[0x0]===_0x37fe91(0x16d)&&_0x359bfb[0x2]===_0x37fe91(0x16a)){const _0x2d9319=_0x359bfb[0x1]?.[_0x37fe91(0x19f)]();return _0x2d9319?{'alias':_0x2d9319,'field':'appcode'}:undefined;}return undefined;}function a23_0x45d2(){const _0x325727=['215793TRRUDv','field','Set\x20a\x20configuration\x20value','Key\x20not\x20found:\x20','../../context.js','Invalid\x20value\x20for\x20\x22','\x20(global)','8rkGRYR','\x22\x20is\x20protected\x20and\x20cannot\x20be\x20changed\x20via\x20config\x20commands.','\x22\x20is\x20not\x20settable.','190NDoLVD','372eZdswb','length','bool',';\x20apps.<alias>.appcode','1198959FPdgJa','Deletes\x20a\x20Lovrabet\x20CLI\x20config\x20key.\x20Later\x20commands\x20will\x20fall\x20back\x20to\x20another\x20config\x20layer\x20or\x20the\x20default.','Top-level\x20key\x20\x22','Changes\x20Lovrabet\x20CLI\x20configuration.\x20Later\x20commands\x20may\x20use\x20a\x20different\x20app,\x20environment,\x20or\x20output\x20behavior.','accessKey','isArray','16uYBOLP','alias','stringify','Key\x20already\x20absent:\x20','global','\x20\x20project:\x20','pageSize','292310yxwpPv','\x20config\x20set\x20<key>\x20<value>\x20[--global]','\x20config\x20get\x20<key>','Get\x20a\x20config\x20value','34726iInSHc','List\x20current\x20config','2361464ZNNQTK','read','1588098IwXQtD','validation','Usage:\x20','10KEZOKt','value','raw','trim','Config\x20files:\x0a','\x22.\x20Allowed:\x20','\x20\x20global:\x20\x20','project-or-global-explicit','set','Deleted\x20`','`\x20=\x20\x22','split','args','key','write','includes','list','\x20config\x20delete\x20<key>\x20[--global]','config','appcode','Missing\x20key\x20or\x20value.','get','apps','object','log','format','160061EBLzQZ','Value\x20to\x20assign','locale','join'];a23_0x45d2=function(){return _0x325727;};return a23_0x45d2();}function setLocalAppAlias(_0x1bc28b,_0x610cdb,_0x17d240){const _0x49aae3=a23_0x1064,_0x36ed2d=_0x1bc28b['apps']&&typeof _0x1bc28b[_0x49aae3(0x16d)]===_0x49aae3(0x16e)&&!Array['isArray'](_0x1bc28b[_0x49aae3(0x16d)])?_0x1bc28b[_0x49aae3(0x16d)]:{},_0x3165a5=_0x36ed2d[_0x610cdb]&&typeof _0x36ed2d[_0x610cdb]==='object'&&!Array['isArray'](_0x36ed2d[_0x610cdb])?_0x36ed2d[_0x610cdb]:{};_0x3165a5[_0x49aae3(0x16a)]=_0x17d240,_0x36ed2d[_0x610cdb]=_0x3165a5,_0x1bc28b[_0x49aae3(0x16d)]=_0x36ed2d;}function a23_0x1064(_0x3c8136,_0x424b46){_0x3c8136=_0x3c8136-0x162;const _0x45d239=a23_0x45d2();let _0x106417=_0x45d239[_0x3c8136];return _0x106417;}function deleteLocalAppAlias(_0x3656f5,_0x3d87c6){const _0x58bd2e=a23_0x1064;if(!_0x3656f5[_0x58bd2e(0x16d)]||typeof _0x3656f5[_0x58bd2e(0x16d)]!==_0x58bd2e(0x16e)||Array['isArray'](_0x3656f5[_0x58bd2e(0x16d)]))return![];const _0x553e8d=_0x3656f5[_0x58bd2e(0x16d)],_0x6774f4=_0x553e8d[_0x3d87c6[_0x58bd2e(0x18b)]];if(!_0x6774f4||typeof _0x6774f4!=='object'||Array[_0x58bd2e(0x189)](_0x6774f4))return![];if(!_0x3d87c6[_0x58bd2e(0x176)])return delete _0x553e8d[_0x3d87c6[_0x58bd2e(0x18b)]],!![];if(!(_0x3d87c6[_0x58bd2e(0x176)]in _0x6774f4))return![];return delete _0x6774f4[_0x3d87c6[_0x58bd2e(0x176)]],Object['keys'](_0x6774f4)[_0x58bd2e(0x181)]===0x0&&delete _0x553e8d[_0x3d87c6[_0x58bd2e(0x18b)]],!![];}const listDef={'service':a23_0x180c44(0x169),'command':a23_0x180c44(0x167),'description':a23_0x180c44(0x196),'risk':a23_0x180c44(0x198),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x4bc28d){const _0x88f5f7=a23_0x180c44,{buildConfigFromFlags:_0x22c012}=await import(_0x88f5f7(0x179)),_0x3e3669=_0x22c012({}),_0xf8ab21=redactCliConfigCredentials(_0x3e3669[_0x88f5f7(0x19e)]),_0x423248=getProjectConfigPath(),_0x55c7d1=resolveWriteConfigPath(_0x88f5f7(0x18e));if(_0x4bc28d[_0x88f5f7(0x170)]==='pretty')return{'ok':!![],'message':'#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a'+(JSON[_0x88f5f7(0x18c)](_0xf8ab21,null,0x2)+'\x0a\x0a')+_0x88f5f7(0x1a0)+(_0x88f5f7(0x18f)+(_0x423248??'(none)')+'\x0a')+(_0x88f5f7(0x1a2)+_0x55c7d1)};return{'ok':!![],'data':{'effective':_0xf8ab21,'configFiles':{'project':_0x423248??null,'global':_0x55c7d1}}};}},getDef={'service':'config','command':a23_0x180c44(0x16c),'description':a23_0x180c44(0x194),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a23_0x180c44(0x164),'description':'Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','required':!![]}],'flags':[],async 'execute'(_0x33f54a){const _0x32e392=a23_0x180c44,_0x166604=_0x33f54a[_0x32e392(0x163)][0x0];if(!_0x166604)throw CliErrors[_0x32e392(0x19a)]('Missing\x20key\x20argument.',_0x32e392(0x19b)+CLI_BIN_NAME+_0x32e392(0x193));const {buildConfigFromFlags:_0x2c3e23}=await import(_0x32e392(0x179)),{raw:_0x4af48b}=_0x2c3e23({});if(_0x166604[_0x32e392(0x166)]('.')){const _0x29ca42=_0x166604['split']('.');let _0x373905=_0x4af48b;for(const _0x46108d of _0x29ca42){if(_0x373905==null||typeof _0x373905!==_0x32e392(0x16e))throw CliErrors[_0x32e392(0x19a)](_0x32e392(0x178)+_0x166604);_0x373905=_0x373905[_0x46108d];}if(_0x373905===undefined)throw CliErrors[_0x32e392(0x19a)]('Key\x20not\x20found:\x20'+_0x166604);const _0x220bc8=redactCliConfigValue(_0x166604,_0x373905);return console[_0x32e392(0x16f)](typeof _0x220bc8===_0x32e392(0x16e)?JSON['stringify'](_0x220bc8,null,0x2):String(_0x220bc8)),{'ok':!![]};}const _0x433498=_0x4af48b[_0x166604];if(_0x433498===undefined)throw CliErrors['validation'](_0x32e392(0x178)+_0x166604);const _0x265ab0=redactCliConfigValue(_0x166604,_0x433498);return console[_0x32e392(0x16f)](typeof _0x265ab0===_0x32e392(0x16e)?JSON['stringify'](_0x265ab0,null,0x2):String(_0x265ab0)),{'ok':!![]};}},setDef={'service':a23_0x180c44(0x169),'command':a23_0x180c44(0x1a4),'description':a23_0x180c44(0x177),'risk':a23_0x180c44(0x165),'confirmationDescription':a23_0x180c44(0x187),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]},{'name':a23_0x180c44(0x19d),'description':a23_0x180c44(0x172),'required':!![]}],'flags':[GLOBAL_SCOPE_FLAG],async 'execute'(_0x302c66){const _0x15da98=a23_0x180c44,_0x15a160=_0x302c66[_0x15da98(0x163)][0x0],_0x36d7ac=_0x302c66['args'][0x1];if(!_0x15a160||_0x36d7ac===undefined)throw CliErrors['validation'](_0x15da98(0x16b),_0x15da98(0x19b)+CLI_BIN_NAME+_0x15da98(0x192));if(ENUM_KEYS[_0x15a160]&&!ENUM_KEYS[_0x15a160][_0x15da98(0x166)](_0x36d7ac))throw CliErrors['validation'](_0x15da98(0x17a)+_0x15a160+_0x15da98(0x1a1)+ENUM_KEYS[_0x15a160][_0x15da98(0x174)](',\x20'));if(isCliProtectedConfigKey(_0x15a160))throw CliErrors['validation']('\x22'+_0x15a160+'\x22\x20is\x20protected\x20and\x20cannot\x20be\x20changed\x20via\x20config\x20commands.');if(_0x15a160===_0x15da98(0x190)){const _0x2019b4=Number(_0x36d7ac);if(isNaN(_0x2019b4)||_0x2019b4<=0x0)throw CliErrors['validation']('pageSize\x20must\x20be\x20a\x20positive\x20number');}const _0x310db2=resolveWriteScope({'explicitGlobal':_0x302c66[_0x15da98(0x182)](_0x15da98(0x18e)),'policy':_0x15da98(0x1a3)}),_0x3b9dd2=toScopeFlags(_0x310db2),_0x1102b2=readScopedConfig(_0x3b9dd2),_0x456741=parseAliasAppcodeSetKey(_0x15a160);if(!_0x456741&&!isTopLevelConfigKey(_0x15a160))throw CliErrors[_0x15da98(0x19a)](_0x15da98(0x186)+_0x15a160+_0x15da98(0x17e),'Settable\x20keys:\x20'+getTopLevelConfigKeySummary()+_0x15da98(0x183));if(_0x456741)setLocalAppAlias(_0x1102b2,_0x456741,_0x36d7ac);else{if(_0x15a160==='locale'){const _0x5ee30f=normalizeLocale(_0x36d7ac);if(!_0x5ee30f)throw CliErrors[_0x15da98(0x19a)]('Invalid\x20locale\x20value.','Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US');_0x1102b2[_0x15da98(0x173)]=_0x5ee30f;}else _0x1102b2[_0x15a160]=_0x15a160===_0x15da98(0x190)?Number(_0x36d7ac):DOMAIN_CONFIG_FIELDS[_0x15da98(0x166)](_0x15a160)?normalizeDomainOrigin(_0x15a160,_0x36d7ac):_0x36d7ac;}const _0x1ff151=_0x15a160===_0x15da98(0x188)?maskCliAccessKey(_0x36d7ac):!_0x456741&&_0x15a160===_0x15da98(0x173)?String(_0x1102b2['locale']):_0x36d7ac;return console[_0x15da98(0x16f)]('Set\x20`'+_0x15a160+_0x15da98(0x1a6)+_0x1ff151+'\x22'+(_0x310db2===_0x15da98(0x18e)?_0x15da98(0x17b):'')),writeScopedConfig(_0x1102b2,_0x3b9dd2),{'ok':!![]};}},deleteDef={'service':a23_0x180c44(0x169),'command':'delete','description':'Delete\x20a\x20configuration\x20value','risk':'write','confirmationDescription':a23_0x180c44(0x185),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_SCOPE_FLAG],async 'execute'(_0x6053a7){const _0x1e826e=a23_0x180c44,_0x231dda=_0x6053a7[_0x1e826e(0x163)][0x0];if(!_0x231dda)throw CliErrors[_0x1e826e(0x19a)]('Missing\x20key\x20argument.','Usage:\x20'+CLI_BIN_NAME+_0x1e826e(0x168));if(isCliProtectedConfigKey(_0x231dda))throw CliErrors[_0x1e826e(0x19a)]('\x22'+_0x231dda+_0x1e826e(0x17d));const _0x357935=resolveWriteScope({'explicitGlobal':_0x6053a7[_0x1e826e(0x182)](_0x1e826e(0x18e)),'policy':'project-or-global-explicit'}),_0x47c283=toScopeFlags(_0x357935),_0x9d97c9=readScopedConfig(_0x47c283),_0x1d2227=parseAliasDeleteKey(_0x231dda);if(_0x1d2227){if(!deleteLocalAppAlias(_0x9d97c9,_0x1d2227))return console['log'](_0x1e826e(0x18d)+_0x231dda+(_0x357935===_0x1e826e(0x18e)?_0x1e826e(0x17b):'')),{'ok':!![],'data':{'key':_0x231dda,'scope':_0x357935,'changed':![]}};return console['log']('Deleted\x20`'+_0x231dda+'`'+(_0x357935==='global'?_0x1e826e(0x17b):'')),writeScopedConfig(_0x9d97c9,_0x47c283),{'ok':!![],'data':{'key':_0x231dda,'scope':_0x357935,'changed':!![]}};}if(_0x9d97c9[_0x231dda]===undefined)return console[_0x1e826e(0x16f)](_0x1e826e(0x18d)+_0x231dda+(_0x357935===_0x1e826e(0x18e)?_0x1e826e(0x17b):'')),{'ok':!![],'data':{'key':_0x231dda,'scope':_0x357935,'changed':![]}};return delete _0x9d97c9[_0x231dda],console[_0x1e826e(0x16f)](_0x1e826e(0x1a5)+_0x231dda+'`'+(_0x357935===_0x1e826e(0x18e)?'\x20(global)':'')),writeScopedConfig(_0x9d97c9,_0x47c283),{'ok':!![],'data':{'key':_0x231dda,'scope':_0x357935,'changed':!![]}};}};export const configDefinitions=[configInitDefinition,listDef,getDef,setDef,deleteDef];
|
|
1
|
+
const a23_0x2e252e=a23_0x2e23;(function(_0x2deccb,_0x198425){const _0xe1847f=a23_0x2e23,_0x10e8a7=_0x2deccb();while(!![]){try{const _0x57edf3=-parseInt(_0xe1847f(0x1a4))/0x1+-parseInt(_0xe1847f(0x1b9))/0x2*(-parseInt(_0xe1847f(0x1b1))/0x3)+-parseInt(_0xe1847f(0x197))/0x4+parseInt(_0xe1847f(0x1bc))/0x5*(-parseInt(_0xe1847f(0x193))/0x6)+-parseInt(_0xe1847f(0x1ba))/0x7+-parseInt(_0xe1847f(0x19a))/0x8*(parseInt(_0xe1847f(0x19c))/0x9)+parseInt(_0xe1847f(0x1d3))/0xa*(parseInt(_0xe1847f(0x1a6))/0xb);if(_0x57edf3===_0x198425)break;else _0x10e8a7['push'](_0x10e8a7['shift']());}catch(_0x473b86){_0x10e8a7['push'](_0x10e8a7['shift']());}}}(a23_0x4d48,0x937aa));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';function a23_0x4d48(){const _0x3f466f=['Value\x20to\x20assign','field','Set\x20a\x20configuration\x20value','Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US','args','trim','read','1646qXKgCw','1223894iaTJnV','Deleted\x20`','5TyFPtU','global','format','log','raw','pageSize','stringify','config','Missing\x20key\x20or\x20value.','isArray','\x22\x20is\x20not\x20settable.','Key\x20already\x20absent:\x20','Invalid\x20value\x20for\x20\x22','apps','get','Key\x20not\x20found:\x20','length','accessKey','(none)','pageSize\x20must\x20be\x20a\x20positive\x20number','set','Get\x20a\x20config\x20value','key','13605500uCLMpj','\x20\x20project:\x20','includes','Top-level\x20key\x20\x22','object','864570lNwpoc','Config\x20files:\x0a','locale','bool','2874344zGpOvw','write','\x20(global)','8JLoPRP','split','8107443tLANvP','\x20config\x20get\x20<key>','List\x20current\x20config','Settable\x20keys:\x20','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','\x20config\x20delete\x20<key>\x20[--global]','Deletes\x20a\x20Lovrabet\x20CLI\x20config\x20key.\x20Later\x20commands\x20will\x20fall\x20back\x20to\x20another\x20config\x20layer\x20or\x20the\x20default.','Invalid\x20locale\x20value.','1097967uQDKvd','Changes\x20Lovrabet\x20CLI\x20configuration.\x20Later\x20commands\x20may\x20use\x20a\x20different\x20app,\x20environment,\x20or\x20output\x20behavior.','22oaHebo','Missing\x20key\x20argument.','validation','value','Usage:\x20','delete','alias','../../context.js','\x20config\x20set\x20<key>\x20<value>\x20[--global]','\x20\x20global:\x20\x20','appcode','3351WMmuMt'];a23_0x4d48=function(){return _0x3f466f;};return a23_0x4d48();}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(_0x4239e2){const _0x4553cf=a23_0x2e23,_0x124b6b=_0x4239e2[_0x4553cf(0x19b)]('.');if(_0x124b6b[_0x4553cf(0x1cc)]!==0x3||_0x124b6b[0x0]!=='apps'||_0x124b6b[0x2]!==_0x4553cf(0x1b0))return undefined;const _0x399ba4=_0x124b6b[0x1]?.[_0x4553cf(0x1b7)]();return _0x399ba4?_0x399ba4:undefined;}function parseAliasDeleteKey(_0x5520a2){const _0x3be48b=a23_0x2e23,_0x3108e1=_0x5520a2[_0x3be48b(0x19b)]('.');if(_0x3108e1[_0x3be48b(0x1cc)]===0x2&&_0x3108e1[0x0]===_0x3be48b(0x1c9)){const _0x412cf2=_0x3108e1[0x1]?.[_0x3be48b(0x1b7)]();return _0x412cf2?{'alias':_0x412cf2}:undefined;}if(_0x3108e1[_0x3be48b(0x1cc)]===0x3&&_0x3108e1[0x0]===_0x3be48b(0x1c9)&&_0x3108e1[0x2]===_0x3be48b(0x1b0)){const _0x1c52ad=_0x3108e1[0x1]?.['trim']();return _0x1c52ad?{'alias':_0x1c52ad,'field':'appcode'}:undefined;}return undefined;}function setLocalAppAlias(_0x106ebf,_0x43bf2e,_0xed89a8){const _0x2ae942=a23_0x2e23,_0x353375=_0x106ebf[_0x2ae942(0x1c9)]&&typeof _0x106ebf[_0x2ae942(0x1c9)]===_0x2ae942(0x192)&&!Array[_0x2ae942(0x1c5)](_0x106ebf[_0x2ae942(0x1c9)])?_0x106ebf[_0x2ae942(0x1c9)]:{},_0x3da7ea=_0x353375[_0x43bf2e]&&typeof _0x353375[_0x43bf2e]===_0x2ae942(0x192)&&!Array['isArray'](_0x353375[_0x43bf2e])?_0x353375[_0x43bf2e]:{};_0x3da7ea[_0x2ae942(0x1b0)]=_0xed89a8,_0x353375[_0x43bf2e]=_0x3da7ea,_0x106ebf[_0x2ae942(0x1c9)]=_0x353375;}function a23_0x2e23(_0x46935b,_0x3c6a09){_0x46935b=_0x46935b-0x191;const _0x4d48ba=a23_0x4d48();let _0x2e23f9=_0x4d48ba[_0x46935b];return _0x2e23f9;}function deleteLocalAppAlias(_0x2fb56c,_0x14e220){const _0x21bb2c=a23_0x2e23;if(!_0x2fb56c[_0x21bb2c(0x1c9)]||typeof _0x2fb56c[_0x21bb2c(0x1c9)]!==_0x21bb2c(0x192)||Array[_0x21bb2c(0x1c5)](_0x2fb56c[_0x21bb2c(0x1c9)]))return![];const _0x1394b1=_0x2fb56c['apps'],_0x225824=_0x1394b1[_0x14e220[_0x21bb2c(0x1ac)]];if(!_0x225824||typeof _0x225824!==_0x21bb2c(0x192)||Array[_0x21bb2c(0x1c5)](_0x225824))return![];if(!_0x14e220[_0x21bb2c(0x1b3)])return delete _0x1394b1[_0x14e220[_0x21bb2c(0x1ac)]],!![];if(!(_0x14e220[_0x21bb2c(0x1b3)]in _0x225824))return![];return delete _0x225824[_0x14e220[_0x21bb2c(0x1b3)]],Object['keys'](_0x225824)[_0x21bb2c(0x1cc)]===0x0&&delete _0x1394b1[_0x14e220[_0x21bb2c(0x1ac)]],!![];}const listDef={'service':a23_0x2e252e(0x1c3),'command':'list','description':a23_0x2e252e(0x19e),'risk':a23_0x2e252e(0x1b8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x360627){const _0x5b499a=a23_0x2e252e,{buildConfigFromFlags:_0x328329}=await import(_0x5b499a(0x1ad)),_0x49ed1=_0x328329({}),_0x335f5f=redactCliConfigCredentials(_0x49ed1[_0x5b499a(0x1c0)]),_0x3bd678=getProjectConfigPath(),_0xe15cb4=resolveWriteConfigPath(_0x5b499a(0x1bd));if(_0x360627[_0x5b499a(0x1be)]==='pretty')return{'ok':!![],'message':_0x5b499a(0x1a0)+(JSON[_0x5b499a(0x1c2)](_0x335f5f,null,0x2)+'\x0a\x0a')+_0x5b499a(0x194)+(_0x5b499a(0x1d4)+(_0x3bd678??_0x5b499a(0x1ce))+'\x0a')+(_0x5b499a(0x1af)+_0xe15cb4)};return{'ok':!![],'data':{'effective':_0x335f5f,'configFiles':{'project':_0x3bd678??null,'global':_0xe15cb4}}};}},getDef={'service':a23_0x2e252e(0x1c3),'command':a23_0x2e252e(0x1ca),'description':a23_0x2e252e(0x1d1),'risk':a23_0x2e252e(0x1b8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':'Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','required':!![]}],'flags':[],async 'execute'(_0x251e1d){const _0x24e45b=a23_0x2e252e,_0x238eda=_0x251e1d[_0x24e45b(0x1b6)][0x0];if(!_0x238eda)throw CliErrors[_0x24e45b(0x1a8)](_0x24e45b(0x1a7),'Usage:\x20'+CLI_BIN_NAME+_0x24e45b(0x19d));const {buildConfigFromFlags:_0x4ef449}=await import(_0x24e45b(0x1ad)),{raw:_0xd592d0}=_0x4ef449({});if(_0x238eda[_0x24e45b(0x1d5)]('.')){const _0x5cab37=_0x238eda[_0x24e45b(0x19b)]('.');let _0x3493ac=_0xd592d0;for(const _0x4e7e3d of _0x5cab37){if(_0x3493ac==null||typeof _0x3493ac!==_0x24e45b(0x192))throw CliErrors[_0x24e45b(0x1a8)]('Key\x20not\x20found:\x20'+_0x238eda);_0x3493ac=_0x3493ac[_0x4e7e3d];}if(_0x3493ac===undefined)throw CliErrors[_0x24e45b(0x1a8)](_0x24e45b(0x1cb)+_0x238eda);const _0x3e86a1=redactCliConfigValue(_0x238eda,_0x3493ac);return console['log'](typeof _0x3e86a1===_0x24e45b(0x192)?JSON[_0x24e45b(0x1c2)](_0x3e86a1,null,0x2):String(_0x3e86a1)),{'ok':!![]};}const _0x5c0fb8=_0xd592d0[_0x238eda];if(_0x5c0fb8===undefined)throw CliErrors[_0x24e45b(0x1a8)](_0x24e45b(0x1cb)+_0x238eda);const _0x549b3a=redactCliConfigValue(_0x238eda,_0x5c0fb8);return console['log'](typeof _0x549b3a==='object'?JSON[_0x24e45b(0x1c2)](_0x549b3a,null,0x2):String(_0x549b3a)),{'ok':!![]};}},setDef={'service':a23_0x2e252e(0x1c3),'command':a23_0x2e252e(0x1d0),'description':a23_0x2e252e(0x1b4),'risk':a23_0x2e252e(0x198),'confirmationDescription':a23_0x2e252e(0x1a5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a23_0x2e252e(0x1d2),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a23_0x2e252e(0x1a9),'description':a23_0x2e252e(0x1b2),'required':!![]}],'flags':[GLOBAL_SCOPE_FLAG],async 'execute'(_0x423e1d){const _0x25c797=a23_0x2e252e,_0x40941b=_0x423e1d[_0x25c797(0x1b6)][0x0],_0x3adf72=_0x423e1d[_0x25c797(0x1b6)][0x1];if(!_0x40941b||_0x3adf72===undefined)throw CliErrors[_0x25c797(0x1a8)](_0x25c797(0x1c4),_0x25c797(0x1aa)+CLI_BIN_NAME+_0x25c797(0x1ae));if(ENUM_KEYS[_0x40941b]&&!ENUM_KEYS[_0x40941b][_0x25c797(0x1d5)](_0x3adf72))throw CliErrors[_0x25c797(0x1a8)](_0x25c797(0x1c8)+_0x40941b+'\x22.\x20Allowed:\x20'+ENUM_KEYS[_0x40941b]['join'](',\x20'));if(isCliProtectedConfigKey(_0x40941b))throw CliErrors['validation']('\x22'+_0x40941b+'\x22\x20is\x20protected\x20and\x20cannot\x20be\x20changed\x20via\x20config\x20commands.');if(_0x40941b===_0x25c797(0x1c1)){const _0x4959a8=Number(_0x3adf72);if(isNaN(_0x4959a8)||_0x4959a8<=0x0)throw CliErrors[_0x25c797(0x1a8)](_0x25c797(0x1cf));}const _0xf5469=resolveWriteScope({'explicitGlobal':_0x423e1d['bool']('global'),'policy':'project-or-global-explicit'}),_0x385c99=toScopeFlags(_0xf5469),_0x35ef25=readScopedConfig(_0x385c99),_0x38dc89=parseAliasAppcodeSetKey(_0x40941b);if(!_0x38dc89&&!isTopLevelConfigKey(_0x40941b))throw CliErrors['validation'](_0x25c797(0x191)+_0x40941b+_0x25c797(0x1c6),_0x25c797(0x19f)+getTopLevelConfigKeySummary()+';\x20apps.<alias>.appcode');if(_0x38dc89)setLocalAppAlias(_0x35ef25,_0x38dc89,_0x3adf72);else{if(_0x40941b===_0x25c797(0x195)){const _0x421e83=normalizeLocale(_0x3adf72);if(!_0x421e83)throw CliErrors[_0x25c797(0x1a8)](_0x25c797(0x1a3),_0x25c797(0x1b5));_0x35ef25['locale']=_0x421e83;}else _0x35ef25[_0x40941b]=_0x40941b==='pageSize'?Number(_0x3adf72):DOMAIN_CONFIG_FIELDS[_0x25c797(0x1d5)](_0x40941b)?normalizeDomainOrigin(_0x40941b,_0x3adf72):_0x3adf72;}const _0x19a983=_0x40941b===_0x25c797(0x1cd)?maskCliAccessKey(_0x3adf72):!_0x38dc89&&_0x40941b===_0x25c797(0x195)?String(_0x35ef25[_0x25c797(0x195)]):_0x3adf72;return console[_0x25c797(0x1bf)]('Set\x20`'+_0x40941b+'`\x20=\x20\x22'+_0x19a983+'\x22'+(_0xf5469==='global'?'\x20(global)':'')),writeScopedConfig(_0x35ef25,_0x385c99),{'ok':!![]};}},deleteDef={'service':a23_0x2e252e(0x1c3),'command':a23_0x2e252e(0x1ab),'description':'Delete\x20a\x20configuration\x20value','risk':a23_0x2e252e(0x198),'confirmationDescription':a23_0x2e252e(0x1a2),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a23_0x2e252e(0x1d2),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_SCOPE_FLAG],async 'execute'(_0x30c4a2){const _0x183df1=a23_0x2e252e,_0x5dcc23=_0x30c4a2[_0x183df1(0x1b6)][0x0];if(!_0x5dcc23)throw CliErrors[_0x183df1(0x1a8)](_0x183df1(0x1a7),_0x183df1(0x1aa)+CLI_BIN_NAME+_0x183df1(0x1a1));if(isCliProtectedConfigKey(_0x5dcc23))throw CliErrors['validation']('\x22'+_0x5dcc23+'\x22\x20is\x20protected\x20and\x20cannot\x20be\x20changed\x20via\x20config\x20commands.');const _0x3f42a1=resolveWriteScope({'explicitGlobal':_0x30c4a2[_0x183df1(0x196)](_0x183df1(0x1bd)),'policy':'project-or-global-explicit'}),_0x438908=toScopeFlags(_0x3f42a1),_0x24d768=readScopedConfig(_0x438908),_0x499dcb=parseAliasDeleteKey(_0x5dcc23);if(_0x499dcb){if(!deleteLocalAppAlias(_0x24d768,_0x499dcb))return console[_0x183df1(0x1bf)](_0x183df1(0x1c7)+_0x5dcc23+(_0x3f42a1===_0x183df1(0x1bd)?'\x20(global)':'')),{'ok':!![],'data':{'key':_0x5dcc23,'scope':_0x3f42a1,'changed':![]}};return console['log'](_0x183df1(0x1bb)+_0x5dcc23+'`'+(_0x3f42a1===_0x183df1(0x1bd)?'\x20(global)':'')),writeScopedConfig(_0x24d768,_0x438908),{'ok':!![],'data':{'key':_0x5dcc23,'scope':_0x3f42a1,'changed':!![]}};}if(_0x24d768[_0x5dcc23]===undefined)return console[_0x183df1(0x1bf)](_0x183df1(0x1c7)+_0x5dcc23+(_0x3f42a1===_0x183df1(0x1bd)?_0x183df1(0x199):'')),{'ok':!![],'data':{'key':_0x5dcc23,'scope':_0x3f42a1,'changed':![]}};return delete _0x24d768[_0x5dcc23],console[_0x183df1(0x1bf)](_0x183df1(0x1bb)+_0x5dcc23+'`'+(_0x3f42a1===_0x183df1(0x1bd)?_0x183df1(0x199):'')),writeScopedConfig(_0x24d768,_0x438908),{'ok':!![],'data':{'key':_0x5dcc23,'scope':_0x3f42a1,'changed':!![]}};}};export const configDefinitions=[configInitDefinition,listDef,getDef,setDef,deleteDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x517a14=a24_0x2f1e;(function(_0x422b8a,_0x4a64d1){const _0x55be01=a24_0x2f1e,_0x479aa3=_0x422b8a();while(!![]){try{const _0x42dafb=-parseInt(_0x55be01(0x1e9))/0x1+-parseInt(_0x55be01(0x20a))/0x2*(parseInt(_0x55be01(0x1f5))/0x3)+-parseInt(_0x55be01(0x20c))/0x4+-parseInt(_0x55be01(0x1ee))/0x5*(parseInt(_0x55be01(0x20b))/0x6)+-parseInt(_0x55be01(0x20e))/0x7+parseInt(_0x55be01(0x208))/0x8+parseInt(_0x55be01(0x200))/0x9;if(_0x42dafb===_0x4a64d1)break;else _0x479aa3['push'](_0x479aa3['shift']());}catch(_0x17f732){_0x479aa3['push'](_0x479aa3['shift']());}}}(a24_0x2140,0xa802b));import{select}from'@inquirer/prompts';import{CliErrors}from'../../errors.js';import{readScopedConfig,writeScopedConfig}from'../../commands/config/shared.js';import{DOMAIN_CONFIG_FIELDS,LEGACY_DOMAIN_CONFIG_FIELDS,resolveDomainConfigInput}from'../../config/domain-config.js';import{ENTERPRISE_ROUTING_KIND,ENTERPRISE_ROUTING_PROTOCOL}from'../../generated/routing-contract.js';import{DEFAULT_LOVRABET_REGION,ENABLED_LOVRABET_REGION_VALUES,isEnabledLovrabetRegion}from'../../constant/region.js';import{OFFICIAL_ROUTING_PROFILES}from'../../generated/official-routing.js';const domainFlags=[{'name':a24_0x517a14(0x1e8),'type':a24_0x517a14(0x1f6),'description':'Independent-deployment\x20Domain\x20JSON\x20file'},{'name':a24_0x517a14(0x1e3),'type':'string','description':'Custom\x20User\x20HTTPS\x20origin'},{'name':'api-domain','type':'string','description':a24_0x517a14(0x204)},{'name':a24_0x517a14(0x1f3),'type':'string','description':a24_0x517a14(0x1f9)},{'name':a24_0x517a14(0x201),'type':a24_0x517a14(0x1f6),'description':a24_0x517a14(0x203)},{'name':a24_0x517a14(0x1ea),'type':'string','description':a24_0x517a14(0x202)}];function a24_0x2f1e(_0x2787f5,_0x3b7254){_0x2787f5=_0x2787f5-0x1df;const _0x2140d2=a24_0x2140();let _0x2f1e93=_0x2140d2[_0x2787f5];return _0x2f1e93;}export const configInitFlags=[{'name':a24_0x517a14(0x206),'type':a24_0x517a14(0x1f6),'description':a24_0x517a14(0x205)+ENABLED_LOVRABET_REGION_VALUES[a24_0x517a14(0x209)](',\x20'),'enum':[...ENABLED_LOVRABET_REGION_VALUES]},...domainFlags];async function resolveRegion(_0x11c2cc){const _0x395714=a24_0x517a14,_0x579510=_0x11c2cc['str'](_0x395714(0x206));if(_0x579510){if(!isEnabledLovrabetRegion(_0x579510))throw CliErrors[_0x395714(0x1fe)](_0x395714(0x1ec)+_0x579510+_0x395714(0x1eb),'Available\x20regions:\x20'+ENABLED_LOVRABET_REGION_VALUES[_0x395714(0x209)](',\x20'));return _0x579510;}if(_0x11c2cc[_0x395714(0x1f1)])return DEFAULT_LOVRABET_REGION;try{return await select({'message':_0x395714(0x1e6),'default':DEFAULT_LOVRABET_REGION,'choices':ENABLED_LOVRABET_REGION_VALUES[_0x395714(0x1e0)](_0x518fdd=>({'name':OFFICIAL_ROUTING_PROFILES[_0x518fdd][_0x395714(0x1fc)]+'\x20('+_0x518fdd+')','value':_0x518fdd}))});}catch(_0x1a4613){if(_0x1a4613?.[_0x395714(0x1e4)]===_0x395714(0x1f2))throw CliErrors[_0x395714(0x20d)]();throw _0x1a4613;}}export async function executeConfigInit(_0x3e6373){const _0x15197d=a24_0x517a14,_0x2e6c96=resolveDomainConfigInput(_0x3e6373),_0xf4a83=_0x2e6c96[_0x15197d(0x1e1)],_0x3b5e7d=Object['keys'](_0xf4a83)[_0x15197d(0x1fd)]>0x0;if(_0x3b5e7d&&_0x3e6373[_0x15197d(0x1e2)](_0x15197d(0x206)))throw CliErrors['validation']('Choose\x20either\x20an\x20official\x20region\x20or\x20independent-deployment\x20Domains,\x20not\x20both.');const _0x5a3279={'global':!![]},_0xef0255=readScopedConfig(_0x5a3279);for(const _0x4ec2eb of DOMAIN_CONFIG_FIELDS)delete _0xef0255[_0x4ec2eb];for(const _0x2fe2e1 of LEGACY_DOMAIN_CONFIG_FIELDS)delete _0xef0255[_0x2fe2e1];delete _0xef0255[_0x15197d(0x207)];let _0x43fce3=null;if(_0x3b5e7d)delete _0xef0255[_0x15197d(0x206)],_0x2e6c96['mode']===_0x15197d(0x1fb)?_0xef0255[_0x15197d(0x207)]={'protocol':ENTERPRISE_ROUTING_PROTOCOL,'kind':ENTERPRISE_ROUTING_KIND,'domains':_0x2e6c96['manifestDomains']}:Object[_0x15197d(0x1f7)](_0xef0255,_0xf4a83);else{_0x43fce3=await resolveRegion(_0x3e6373);if(_0x43fce3===DEFAULT_LOVRABET_REGION)delete _0xef0255[_0x15197d(0x206)];else _0xef0255['region']=_0x43fce3;}return writeScopedConfig(_0xef0255,_0x5a3279),{'ok':!![],'message':_0x3b5e7d?_0x15197d(0x1f4)+Object[_0x15197d(0x1ed)](_0x2e6c96[_0x15197d(0x20f)]===_0x15197d(0x1fb)?_0x2e6c96[_0x15197d(0x1df)]:_0xf4a83)['join'](',\x20')+'.':_0x15197d(0x1e7)+_0x43fce3+'.','data':{'mode':_0x3b5e7d?_0x15197d(0x1f8):_0x15197d(0x1fa),'protocol':_0x2e6c96[_0x15197d(0x20f)]===_0x15197d(0x1fb)?ENTERPRISE_ROUTING_PROTOCOL:undefined,'region':_0x43fce3,'domains':_0xf4a83}};}function a24_0x2140(){const _0x2a2289=['\x22\x20is\x20not\x20currently\x20available.','Region\x20\x22','keys','423230YzvInO','Initialize\x20the\x20global\x20Lovrabet\x20region\x20or\x20independent-deployment\x20Domains','Updates\x20the\x20global\x20Lovrabet\x20region\x20or\x20independent-deployment\x20Domain\x20configuration.\x20AccessKey,\x20output\x20format,\x20and\x20app\x20bindings\x20stay\x20unchanged.','nonInteractive','ExitPromptError','runtime-domain','Lovrabet\x20connection\x20configured\x20for\x20independent\x20deployment.\x20Domains:\x20','36501vpdNDj','string','assign','independent','Custom\x20Runtime\x20HTTPS\x20origin','official','enterprise-v1','label','length','validation','config','42865785pfJjrq','skill-domain','Custom\x20KB\x20Service\x20HTTPS\x20origin','Custom\x20SkillHub\x20HTTPS\x20origin','Custom\x20platform\x20API\x20HTTPS\x20origin','Official\x20Lovrabet\x20region:\x20','region','routing','5218432yyZoKd','join','172cLCneN','84tLVCnQ','4045596nneJHb','cancelled','8476811QWeKUv','mode','manifestDomains','map','domains','str','user-domain','name','init','Select\x20Lovrabet\x20region','Lovrabet\x20connection\x20configured\x20for\x20region:\x20','domain-config','273220MCCzdE','kb-service-domain'];a24_0x2140=function(){return _0x2a2289;};return a24_0x2140();}export const configInitDefinition={'service':a24_0x517a14(0x1ff),'command':a24_0x517a14(0x1e5),'description':a24_0x517a14(0x1ef),'risk':'write','confirmationDescription':a24_0x517a14(0x1f0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':configInitFlags,'execute':executeConfigInit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x447f8b,_0x4ec067){var _0x385b9a=a25_0x24e8,_0x57568f=_0x447f8b();while(!![]){try{var _0x9f8e2a=-parseInt(_0x385b9a(0x194))/0x1+parseInt(_0x385b9a(0x19a))/0x2*(-parseInt(_0x385b9a(0x195))/0x3)+-parseInt(_0x385b9a(0x193))/0x4*(parseInt(_0x385b9a(0x199))/0x5)+parseInt(_0x385b9a(0x196))/0x6+-parseInt(_0x385b9a(0x19b))/0x7*(parseInt(_0x385b9a(0x197))/0x8)+-parseInt(_0x385b9a(0x198))/0x9+parseInt(_0x385b9a(0x192))/0xa;if(_0x9f8e2a===_0x4ec067)break;else _0x57568f['push'](_0x57568f['shift']());}catch(_0x3d3bce){_0x57568f['push'](_0x57568f['shift']());}}}(a25_0x45c9,0xe0c07));import{CLI_BIN_NAME}from'../../constant/cli.js';function a25_0x45c9(){var _0x5599ca=['43865660zfZCJQ','132qHcRyu','364354JsCWcS','15aayPlf','6793668qabNuQ','8prUmsC','4445964xuDhAj','160180DjdIoV','441734euXkuv','11048716qQijzM'];a25_0x45c9=function(){return _0x5599ca;};return a25_0x45c9();}export{CLI_BIN_NAME};function a25_0x24e8(_0x495ef2,_0x37c6ba){_0x495ef2=_0x495ef2-0x192;var _0x45c94b=a25_0x45c9();var _0x24e87f=_0x45c94b[_0x495ef2];return _0x24e87f;}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
|
-
function a26_0x1135(){const _0x372912=['maxBatchSize','number','313014LHLTAb','utf8','object','size','checkpoint','1-based\x20Excel\x20header\x20row','all','appCode','2991456InGYOc','str','Local\x20Excel\x20validation\x20only;\x20no\x20records\x20or\x20checkpoint\x20were\x20written.','Source,\x20mapping,\x20checkpoint\x20and\x20report\x20must\x20be\x20different\x20files.','mappingFile','string','JSON\x20file\x20mapping\x20Excel\x20headers\x20to\x20dataset\x20field\x20codes','.import-checkpoint.json','--file\x20and\x20--mapping\x20are\x20required.','/import-batch','succeeded','parse','Header\x20row\x20must\x20be\x20positive\x20and\x20batch\x20size\x20must\x20be\x20between\x201\x20and\x20500.','isArray','Mapping\x20file\x20must\x20contain\x20valid\x20JSON.','invalid','errors','Private\x20checkpoint\x20file\x20(default:\x20XLSX\x20path\x20plus\x20.import-checkpoint.json)','METADATA','/client/','emptyRows','isInteger','message','schemaFingerprint','validation','191278CYbljl','Worksheet\x20name\x20or\x201-based\x20index\x20(default:\x20first\x20worksheet)','DB_TABLE\x20datasets\x20use\x20the\x20existing\x20batchCreate\x20operation;\x20import-excel\x20only\x20supports\x20METADATA\x20datasets.','schemaVersion','See\x20','mapping','map','.\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','Batch\x20size\x20exceeds\x20the\x20server\x20import\x20contract.','some','2291240wFiURc','DB_TABLE','header-row','POST','803496vxUCVE','rows','sheet','write','batchSize','Local\x20XLSX\x20file\x20(maximum\x2020\x20MB)','num','values','resume','30450EtFAyB','file','report','Maximum\x20records\x20per\x20request\x20(1..500)','105qIQXyI','rowNumber','\x20--code\x20','756159QQsDkz','Run\x20dataset\x20detail\x20to\x20confirm\x20the\x20source.\x20Only\x20DB_TABLE\x20has\x20the\x20documented\x20alternative\x20batchCreate\x20route;\x20do\x20not\x20guess\x20or\x20automatically\x20switch\x20APIs.','\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.','toString','length','warnings','Mapping\x20must\x20be\x20an\x20object\x20from\x20Excel\x20headers\x20to\x20field\x20codes.','\x20invalid\x20cells.\x20No\x20records\x20were\x20written.','Private\x20result\x20report\x20(default:\x20XLSX\x20path\x20plus\x20.import-report.json)','boolean','Imported\x20and\x20verified\x20','\x20records.','16poQTLQ'];a26_0x1135=function(){return _0x372912;};return a26_0x1135();}const a26_0x40d4b7=a26_0x8f54;(function(_0x41c999,_0x61e77f){const _0x4ef2ce=a26_0x8f54,_0x50f324=_0x41c999();while(!![]){try{const _0x1409a9=-parseInt(_0x4ef2ce(0x139))/0x1+-parseInt(_0x4ef2ce(0x15a))/0x2+parseInt(_0x4ef2ce(0x178))/0x3+parseInt(_0x4ef2ce(0x168))/0x4+parseInt(_0x4ef2ce(0x175))/0x5*(-parseInt(_0x4ef2ce(0x171))/0x6)+-parseInt(_0x4ef2ce(0x164))/0x7+parseInt(_0x4ef2ce(0x136))/0x8*(parseInt(_0x4ef2ce(0x141))/0x9);if(_0x1409a9===_0x61e77f)break;else _0x50f324['push'](_0x50f324['shift']());}catch(_0x2d6e4a){_0x50f324['push'](_0x50f324['shift']());}}}(a26_0x1135,0x432cb));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}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';function a26_0x8f54(_0x581d11,_0x5b6092){_0x581d11=_0x581d11-0x130;const _0x113510=a26_0x1135();let _0x8f543=_0x113510[_0x581d11];return _0x8f543;}import{runAutoIdExcelImport}from'../../services/dataset-import/auto-id-runner.js';import{previewImportBatchCount}from'../../services/dataset-import/preview.js';function input(_0x2a5fe3){const _0x482575=a26_0x8f54,_0x374257=_0x2a5fe3[_0x482575(0x142)](_0x482575(0x172)),_0x73cfbd=_0x2a5fe3[_0x482575(0x142)](_0x482575(0x15f));if(!_0x374257||!_0x73cfbd)throw CliErrors[_0x482575(0x159)](_0x482575(0x149));const _0x55e8fe=_0x2a5fe3[_0x482575(0x16e)](_0x482575(0x166),0x1),_0x5a3038=_0x2a5fe3['num']('batch-size',0x1f4);if(!Number[_0x482575(0x156)](_0x55e8fe)||_0x55e8fe<0x1||!Number[_0x482575(0x156)](_0x5a3038)||_0x5a3038<0x1||_0x5a3038>0x1f4)throw CliErrors[_0x482575(0x159)](_0x482575(0x14d));const _0x1483dc=resolve(_0x2a5fe3[_0x482575(0x142)]('checkpoint')||_0x374257+_0x482575(0x148)),_0x40ee78=resolve(_0x2a5fe3[_0x482575(0x142)](_0x482575(0x173))||_0x374257+'.import-report.json'),_0x4e39cd=[resolve(_0x374257),resolve(_0x73cfbd),_0x1483dc,_0x40ee78];if(new Set(_0x4e39cd)['size']!==_0x4e39cd['length'])throw CliErrors[_0x482575(0x159)](_0x482575(0x144));return{'file':resolve(_0x374257),'mappingFile':resolve(_0x73cfbd),'headerRow':_0x55e8fe,'batchSize':_0x5a3038,'checkpoint':_0x1483dc,'report':_0x40ee78,'sheet':_0x2a5fe3[_0x482575(0x142)](_0x482575(0x16a))||undefined,'resume':_0x2a5fe3['bool'](_0x482575(0x170))};}async function prepare(_0x590919){const _0x3f0a50=a26_0x8f54,_0x1c5a97=input(_0x590919),_0x23b6ee=_0x590919[_0x3f0a50(0x142)]('code');[_0x1c5a97['file'],_0x1c5a97[_0x3f0a50(0x145)],_0x1c5a97['checkpoint'],_0x1c5a97[_0x3f0a50(0x173)]]=await Promise[_0x3f0a50(0x13f)]([realpath(_0x1c5a97['file']),realpath(_0x1c5a97['mappingFile']),resolveImportOutputPath(_0x1c5a97[_0x3f0a50(0x13d)]),resolveImportOutputPath(_0x1c5a97[_0x3f0a50(0x173)])]),assertImportPaths(_0x1c5a97[_0x3f0a50(0x13d)],_0x1c5a97[_0x3f0a50(0x173)],[_0x1c5a97['file'],_0x1c5a97['mappingFile']]);let _0x443d0e;const _0xfa0c6b=await readFile(_0x1c5a97['mappingFile']);if(_0xfa0c6b[_0x3f0a50(0x17c)]>0x400*0x400)throw CliErrors['validation']('Mapping\x20file\x20exceeds\x201\x20MB.');try{_0x443d0e=JSON[_0x3f0a50(0x14c)](_0xfa0c6b[_0x3f0a50(0x17b)](_0x3f0a50(0x13a)));}catch{throw CliErrors[_0x3f0a50(0x159)](_0x3f0a50(0x14f));}if(!_0x443d0e||typeof _0x443d0e!==_0x3f0a50(0x13b)||Array[_0x3f0a50(0x14e)](_0x443d0e)||Object[_0x3f0a50(0x16f)](_0x443d0e)[_0x3f0a50(0x163)](_0x22f006=>typeof _0x22f006!==_0x3f0a50(0x146)))throw CliErrors['validation'](_0x3f0a50(0x130));const _0x29b122=await getDatasetDetail(_0x23b6ee),_0x45e14c=assertDatasetImportTarget(_0x29b122,_0x590919[_0x3f0a50(0x140)],_0x23b6ee);if(_0x45e14c===_0x3f0a50(0x165))throw CliErrors[_0x3f0a50(0x159)](_0x3f0a50(0x15c),'Inspect\x20lovrabet\x20dataset\x20detail\x20--code\x20'+_0x23b6ee+_0x3f0a50(0x161)+_0x590919[_0x3f0a50(0x140)]+_0x3f0a50(0x177)+_0x23b6ee+_0x3f0a50(0x17a));if(_0x45e14c!==_0x3f0a50(0x153))throw CliErrors['validation']('Dataset\x20source\x20is\x20missing\x20or\x20unsupported;\x20import-excel\x20requires\x20METADATA.',_0x3f0a50(0x179));const _0xf20f06=await buildExcelManifest({..._0x1c5a97,'mapping':_0x443d0e,'fields':normalizeImportFields(_0x29b122)}),_0x2c0e10=await getDatasetImportContract(_0x590919[_0x3f0a50(0x140)],_0x23b6ee);assertImportContract(_0x2c0e10,_0x590919[_0x3f0a50(0x140)],_0x23b6ee);if(_0x1c5a97['batchSize']>_0x2c0e10[_0x3f0a50(0x137)])throw CliErrors['validation'](_0x3f0a50(0x162));return{'args':_0x1c5a97,'manifest':_0xf20f06,'contract':_0x2c0e10,'code':_0x23b6ee};}async function checked(_0x547353){const _0x78f94f=a26_0x8f54;try{return await _0x547353();}catch(_0x324c1d){if(_0x324c1d instanceof CliError)throw _0x324c1d;throw CliErrors[_0x78f94f(0x159)](_0x324c1d[_0x78f94f(0x157)]||'Excel\x20import\x20failed.');}}export const dataImportExcel={'service':'data','command':'import-excel','risk':a26_0x40d4b7(0x16b),'description':'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.','confirmationDescription':'Creates\x20real\x20dataset\x20records\x20immediately.\x20Keep\x20the\x20checkpoint\x20to\x20reconcile\x20and\x20resume\x20interrupted\x20imports.','flags':[CODE_FLAG,{'name':a26_0x40d4b7(0x172),'type':a26_0x40d4b7(0x146),'required':!![],'description':a26_0x40d4b7(0x16d)},{'name':a26_0x40d4b7(0x15f),'type':a26_0x40d4b7(0x146),'required':!![],'description':a26_0x40d4b7(0x147)},{'name':a26_0x40d4b7(0x16a),'type':a26_0x40d4b7(0x146),'description':a26_0x40d4b7(0x15b)},{'name':'header-row','type':a26_0x40d4b7(0x138),'default':0x1,'description':a26_0x40d4b7(0x13e)},{'name':'batch-size','type':a26_0x40d4b7(0x138),'default':0x1f4,'description':a26_0x40d4b7(0x174)},{'name':'checkpoint','type':a26_0x40d4b7(0x146),'description':a26_0x40d4b7(0x152)},{'name':a26_0x40d4b7(0x173),'type':a26_0x40d4b7(0x146),'description':a26_0x40d4b7(0x132)},{'name':a26_0x40d4b7(0x170),'type':a26_0x40d4b7(0x133),'description':'Reconcile\x20imported\x20records\x20and\x20resume\x20the\x20exact\x20original\x20file,\x20target\x20and\x20mapping'}],'validate':async _0x5bf201=>{input(_0x5bf201);},'dryRun':async _0x41be79=>checked(async()=>{const _0x4ab29e=a26_0x40d4b7,{args:_0x588d71,manifest:_0x2898fc,contract:_0x23d4c5,code:_0x3f3312}=await prepare(_0x41be79),_0x5931a0=new Set(_0x2898fc[_0x4ab29e(0x151)][_0x4ab29e(0x160)](_0x46d2fe=>_0x46d2fe[_0x4ab29e(0x176)]))[_0x4ab29e(0x13c)];return{'method':_0x4ab29e(0x167),'url':_0x4ab29e(0x154)+encodeURIComponent(_0x41be79['appCode'])+'/'+encodeURIComponent(_0x3f3312)+_0x4ab29e(0x14a),'description':_0x4ab29e(0x143),'body':{'schemaFingerprint':_0x23d4c5[_0x4ab29e(0x158)]},'validRows':Math['max'](0x0,_0x2898fc[_0x4ab29e(0x169)][_0x4ab29e(0x17c)]-_0x5931a0),'invalidRows':_0x5931a0,'invalidCells':_0x2898fc[_0x4ab29e(0x151)][_0x4ab29e(0x17c)],'emptyRows':_0x2898fc[_0x4ab29e(0x155)]['length'],'expectedBatches':previewImportBatchCount(_0x2898fc,_0x23d4c5,_0x588d71[_0x4ab29e(0x16c)]),'errors':_0x2898fc[_0x4ab29e(0x151)],'warnings':_0x2898fc[_0x4ab29e(0x17d)],'sheet':_0x2898fc[_0x4ab29e(0x16a)],'checkpoint':_0x588d71['checkpoint'],'report':_0x588d71[_0x4ab29e(0x173)]};}),'execute':async _0x14520d=>checked(async()=>{const _0x121d5b=a26_0x40d4b7,{args:_0x16f539,manifest:_0x4bc149,contract:_0x405afa,code:_0x374e05}=await prepare(_0x14520d);if(_0x4bc149['errors'][_0x121d5b(0x17c)]){await saveImportJson(_0x16f539['report'],{'status':_0x121d5b(0x150),'sourceRows':_0x4bc149['rows'][_0x121d5b(0x17c)],'errors':_0x4bc149[_0x121d5b(0x151)],'emptyRows':_0x4bc149['emptyRows'],'warnings':_0x4bc149[_0x121d5b(0x17d)]});throw CliErrors[_0x121d5b(0x159)]('Excel\x20contains\x20'+_0x4bc149[_0x121d5b(0x151)][_0x121d5b(0x17c)]+_0x121d5b(0x131),_0x121d5b(0x15e)+_0x16f539['report']+'.');}const _0x37f44c=_0x405afa[_0x121d5b(0x15d)]===0x2?runAutoIdExcelImport:runExcelImport,_0x157c9f=await _0x37f44c({..._0x16f539,'manifest':_0x4bc149,'contract':_0x405afa,'appCode':_0x14520d[_0x121d5b(0x140)],'datasetCode':_0x374e05,'runtimeDomain':getRuntimeDomain(),'api':{'write':(_0x2d3a3f,_0x5af55e)=>createDatasetImportBatch(_0x14520d[_0x121d5b(0x140)],_0x374e05,{'schemaFingerprint':_0x405afa[_0x121d5b(0x158)],'items':_0x2d3a3f,..._0x5af55e===undefined?{}:{'taskId':_0x5af55e}}),'readback':_0x5d7605=>readDatasetImportRows(_0x14520d['appCode'],_0x374e05,_0x5d7605),'readTask':_0x594844=>readDatasetImportTaskRows(_0x14520d[_0x121d5b(0x140)],_0x374e05,_0x594844)}});return{'ok':!![],'data':_0x157c9f,'message':_0x121d5b(0x134)+_0x157c9f[_0x121d5b(0x14b)]+_0x121d5b(0x135)};})};
|
|
1
|
+
const a26_0x41d4cf=a26_0x4271;(function(_0x391ff1,_0x2f13c2){const _0x12821f=a26_0x4271,_0x224573=_0x391ff1();while(!![]){try{const _0x58f7fd=parseInt(_0x12821f(0x21b))/0x1*(parseInt(_0x12821f(0x219))/0x2)+parseInt(_0x12821f(0x220))/0x3+parseInt(_0x12821f(0x208))/0x4*(parseInt(_0x12821f(0x1f5))/0x5)+-parseInt(_0x12821f(0x229))/0x6*(-parseInt(_0x12821f(0x221))/0x7)+-parseInt(_0x12821f(0x1fc))/0x8+-parseInt(_0x12821f(0x21d))/0x9*(parseInt(_0x12821f(0x1fd))/0xa)+-parseInt(_0x12821f(0x212))/0xb;if(_0x58f7fd===_0x2f13c2)break;else _0x224573['push'](_0x224573['shift']());}catch(_0x26a17d){_0x224573['push'](_0x224573['shift']());}}}(a26_0x1a42,0xb4359));import{readFile,realpath}from'node:fs/promises';import{resolve}from'node:path';function a26_0x4271(_0x497980,_0x5652eb){_0x497980=_0x497980-0x1f4;const _0x1a4218=a26_0x1a42();let _0x42715c=_0x1a4218[_0x497980];return _0x42715c;}import{CODE_FLAG}from'../../commands/common/flags.js';function a26_0x1a42(){const _0x580f89=['\x20invalid\x20cells.\x20No\x20records\x20were\x20written.','Reconcile\x20imported\x20records\x20and\x20resume\x20the\x20exact\x20original\x20file,\x20target\x20and\x20mapping','.import-report.json','bool','resume','Excel\x20contains\x20','JSON\x20file\x20mapping\x20Excel\x20headers\x20to\x20dataset\x20field\x20codes','message','schemaFingerprint','POST','some','/import-batch','appCode','file','rows','invalid','Header\x20row\x20must\x20be\x20positive\x20and\x20batch\x20size\x20must\x20be\x20between\x201\x20and\x20500.','Mapping\x20file\x20must\x20contain\x20valid\x20JSON.','DB_TABLE\x20datasets\x20use\x20the\x20existing\x20batchCreate\x20operation;\x20import-excel\x20only\x20supports\x20METADATA\x20datasets.','--file\x20and\x20--mapping\x20are\x20required.','10UFDeRi','sheet','map','batch-size','\x20records.','Run\x20dataset\x20detail\x20to\x20confirm\x20the\x20source.\x20Only\x20DB_TABLE\x20has\x20the\x20documented\x20alternative\x20batchCreate\x20route;\x20do\x20not\x20guess\x20or\x20automatically\x20switch\x20APIs.','Creates\x20real\x20dataset\x20records\x20immediately.\x20Keep\x20the\x20checkpoint\x20to\x20reconcile\x20and\x20resume\x20interrupted\x20imports.','8677152rYtVfm','70gnbToN','schemaVersion','Dataset\x20source\x20is\x20missing\x20or\x20unsupported;\x20import-excel\x20requires\x20METADATA.','emptyRows','validation','rowNumber','write','string','batchSize','.\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','Local\x20Excel\x20validation\x20only;\x20no\x20records\x20or\x20checkpoint\x20were\x20written.','2690228LIVboM','Local\x20XLSX\x20file\x20(maximum\x2020\x20MB)','str','/client/','Source,\x20mapping,\x20checkpoint\x20and\x20report\x20must\x20be\x20different\x20files.','warnings','mappingFile','Private\x20result\x20report\x20(default:\x20XLSX\x20path\x20plus\x20.import-report.json)','isArray','values','4915339GQMxQt','size','Private\x20checkpoint\x20file\x20(default:\x20XLSX\x20path\x20plus\x20.import-checkpoint.json)','errors','isInteger','mapping','report','394facCDa','max','6494nfuVcu','number','672561sqtWps','succeeded','toString','209016jnPYjG','203OnGJNm','header-row','checkpoint','length','parse','Excel\x20import\x20failed.','num','maxBatchSize','20406sEvauW','Maximum\x20records\x20per\x20request\x20(1..500)','Inspect\x20lovrabet\x20dataset\x20detail\x20--code\x20','Batch\x20size\x20exceeds\x20the\x20server\x20import\x20contract.','utf8','DB_TABLE'];a26_0x1a42=function(){return _0x580f89;};return a26_0x1a42();}import{getDatasetDetail,getDatasetImportContract,createDatasetImportBatch,readDatasetImportRows,readDatasetImportTaskRows}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';import{previewImportBatchCount}from'../../services/dataset-import/preview.js';function input(_0x435929){const _0x1fdf52=a26_0x4271,_0x54d5fb=_0x435929[_0x1fdf52(0x20a)]('file'),_0x43b1d6=_0x435929['str'](_0x1fdf52(0x217));if(!_0x54d5fb||!_0x43b1d6)throw CliErrors[_0x1fdf52(0x201)](_0x1fdf52(0x1f4));const _0x32c212=_0x435929[_0x1fdf52(0x227)](_0x1fdf52(0x222),0x1),_0x4f7204=_0x435929[_0x1fdf52(0x227)]('batch-size',0x1f4);if(!Number[_0x1fdf52(0x216)](_0x32c212)||_0x32c212<0x1||!Number[_0x1fdf52(0x216)](_0x4f7204)||_0x4f7204<0x1||_0x4f7204>0x1f4)throw CliErrors[_0x1fdf52(0x201)](_0x1fdf52(0x23f));const _0x48ea60=resolve(_0x435929['str']('checkpoint')||_0x54d5fb+'.import-checkpoint.json'),_0x2f1335=resolve(_0x435929[_0x1fdf52(0x20a)]('report')||_0x54d5fb+_0x1fdf52(0x231)),_0x224eca=[resolve(_0x54d5fb),resolve(_0x43b1d6),_0x48ea60,_0x2f1335];if(new Set(_0x224eca)[_0x1fdf52(0x213)]!==_0x224eca[_0x1fdf52(0x224)])throw CliErrors['validation'](_0x1fdf52(0x20c));return{'file':resolve(_0x54d5fb),'mappingFile':resolve(_0x43b1d6),'headerRow':_0x32c212,'batchSize':_0x4f7204,'checkpoint':_0x48ea60,'report':_0x2f1335,'sheet':_0x435929[_0x1fdf52(0x20a)]('sheet')||undefined,'resume':_0x435929[_0x1fdf52(0x232)](_0x1fdf52(0x233))};}async function prepare(_0x21d9cf){const _0x18a040=a26_0x4271,_0x4def6c=input(_0x21d9cf),_0x1c80d9=_0x21d9cf[_0x18a040(0x20a)]('code');[_0x4def6c['file'],_0x4def6c[_0x18a040(0x20e)],_0x4def6c[_0x18a040(0x223)],_0x4def6c[_0x18a040(0x218)]]=await Promise['all']([realpath(_0x4def6c['file']),realpath(_0x4def6c[_0x18a040(0x20e)]),resolveImportOutputPath(_0x4def6c[_0x18a040(0x223)]),resolveImportOutputPath(_0x4def6c[_0x18a040(0x218)])]),assertImportPaths(_0x4def6c[_0x18a040(0x223)],_0x4def6c[_0x18a040(0x218)],[_0x4def6c[_0x18a040(0x23c)],_0x4def6c[_0x18a040(0x20e)]]);let _0x37c041;const _0x3a9787=await readFile(_0x4def6c[_0x18a040(0x20e)]);if(_0x3a9787[_0x18a040(0x224)]>0x400*0x400)throw CliErrors[_0x18a040(0x201)]('Mapping\x20file\x20exceeds\x201\x20MB.');try{_0x37c041=JSON[_0x18a040(0x225)](_0x3a9787[_0x18a040(0x21f)](_0x18a040(0x22d)));}catch{throw CliErrors[_0x18a040(0x201)](_0x18a040(0x240));}if(!_0x37c041||typeof _0x37c041!=='object'||Array[_0x18a040(0x210)](_0x37c041)||Object[_0x18a040(0x211)](_0x37c041)[_0x18a040(0x239)](_0x446e4f=>typeof _0x446e4f!==_0x18a040(0x204)))throw CliErrors['validation']('Mapping\x20must\x20be\x20an\x20object\x20from\x20Excel\x20headers\x20to\x20field\x20codes.');const _0x1af3d2=await getDatasetDetail(_0x1c80d9),_0x983746=assertDatasetImportTarget(_0x1af3d2,_0x21d9cf[_0x18a040(0x23b)],_0x1c80d9);if(_0x983746===_0x18a040(0x22e))throw CliErrors[_0x18a040(0x201)](_0x18a040(0x241),_0x18a040(0x22b)+_0x1c80d9+_0x18a040(0x206)+_0x21d9cf[_0x18a040(0x23b)]+'\x20--code\x20'+_0x1c80d9+'\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(_0x983746!=='METADATA')throw CliErrors[_0x18a040(0x201)](_0x18a040(0x1ff),_0x18a040(0x1fa));const _0x2bf489=await buildExcelManifest({..._0x4def6c,'mapping':_0x37c041,'fields':normalizeImportFields(_0x1af3d2)}),_0xf04f93=await getDatasetImportContract(_0x21d9cf[_0x18a040(0x23b)],_0x1c80d9);assertImportContract(_0xf04f93,_0x21d9cf['appCode'],_0x1c80d9);if(_0x4def6c[_0x18a040(0x205)]>_0xf04f93[_0x18a040(0x228)])throw CliErrors['validation'](_0x18a040(0x22c));return{'args':_0x4def6c,'manifest':_0x2bf489,'contract':_0xf04f93,'code':_0x1c80d9};}async function checked(_0x331b3e){const _0x576ea7=a26_0x4271;try{return await _0x331b3e();}catch(_0x51ccf5){if(_0x51ccf5 instanceof CliError)throw _0x51ccf5;throw CliErrors[_0x576ea7(0x201)](_0x51ccf5[_0x576ea7(0x236)]||_0x576ea7(0x226));}}export const dataImportExcel={'service':'data','command':'import-excel','risk':a26_0x41d4cf(0x203),'description':'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.','confirmationDescription':a26_0x41d4cf(0x1fb),'flags':[CODE_FLAG,{'name':a26_0x41d4cf(0x23c),'type':a26_0x41d4cf(0x204),'required':!![],'description':a26_0x41d4cf(0x209)},{'name':a26_0x41d4cf(0x217),'type':a26_0x41d4cf(0x204),'required':!![],'description':a26_0x41d4cf(0x235)},{'name':a26_0x41d4cf(0x1f6),'type':a26_0x41d4cf(0x204),'description':'Worksheet\x20name\x20or\x201-based\x20index\x20(default:\x20first\x20worksheet)'},{'name':a26_0x41d4cf(0x222),'type':a26_0x41d4cf(0x21c),'default':0x1,'description':'1-based\x20Excel\x20header\x20row'},{'name':a26_0x41d4cf(0x1f8),'type':a26_0x41d4cf(0x21c),'default':0x1f4,'description':a26_0x41d4cf(0x22a)},{'name':a26_0x41d4cf(0x223),'type':a26_0x41d4cf(0x204),'description':a26_0x41d4cf(0x214)},{'name':a26_0x41d4cf(0x218),'type':'string','description':a26_0x41d4cf(0x20f)},{'name':a26_0x41d4cf(0x233),'type':'boolean','description':a26_0x41d4cf(0x230)}],'validate':async _0x3649ef=>{input(_0x3649ef);},'dryRun':async _0x5b385a=>checked(async()=>{const _0x20c302=a26_0x41d4cf,{args:_0x37faf9,manifest:_0x13bbb8,contract:_0x309315,code:_0x3b17da}=await prepare(_0x5b385a),_0x36e6f4=new Set(_0x13bbb8[_0x20c302(0x215)][_0x20c302(0x1f7)](_0x1cb9b0=>_0x1cb9b0[_0x20c302(0x202)]))[_0x20c302(0x213)];return{'method':_0x20c302(0x238),'url':_0x20c302(0x20b)+encodeURIComponent(_0x5b385a['appCode'])+'/'+encodeURIComponent(_0x3b17da)+_0x20c302(0x23a),'description':_0x20c302(0x207),'body':{'schemaFingerprint':_0x309315['schemaFingerprint']},'validRows':Math[_0x20c302(0x21a)](0x0,_0x13bbb8[_0x20c302(0x23d)][_0x20c302(0x224)]-_0x36e6f4),'invalidRows':_0x36e6f4,'invalidCells':_0x13bbb8[_0x20c302(0x215)][_0x20c302(0x224)],'emptyRows':_0x13bbb8[_0x20c302(0x200)][_0x20c302(0x224)],'expectedBatches':previewImportBatchCount(_0x13bbb8,_0x309315,_0x37faf9[_0x20c302(0x205)]),'errors':_0x13bbb8[_0x20c302(0x215)],'warnings':_0x13bbb8[_0x20c302(0x20d)],'sheet':_0x13bbb8[_0x20c302(0x1f6)],'checkpoint':_0x37faf9[_0x20c302(0x223)],'report':_0x37faf9[_0x20c302(0x218)]};}),'execute':async _0x5c5d19=>checked(async()=>{const _0x269b49=a26_0x41d4cf,{args:_0x2ddf2a,manifest:_0xef8121,contract:_0x55ed34,code:_0x560a2c}=await prepare(_0x5c5d19);if(_0xef8121['errors']['length']){await saveImportJson(_0x2ddf2a[_0x269b49(0x218)],{'status':_0x269b49(0x23e),'sourceRows':_0xef8121[_0x269b49(0x23d)][_0x269b49(0x224)],'errors':_0xef8121[_0x269b49(0x215)],'emptyRows':_0xef8121[_0x269b49(0x200)],'warnings':_0xef8121[_0x269b49(0x20d)]});throw CliErrors[_0x269b49(0x201)](_0x269b49(0x234)+_0xef8121[_0x269b49(0x215)]['length']+_0x269b49(0x22f),'See\x20'+_0x2ddf2a[_0x269b49(0x218)]+'.');}const _0x5d1aa7=_0x55ed34[_0x269b49(0x1fe)]===0x2?runAutoIdExcelImport:runExcelImport,_0x96871f=await _0x5d1aa7({..._0x2ddf2a,'manifest':_0xef8121,'contract':_0x55ed34,'appCode':_0x5c5d19[_0x269b49(0x23b)],'datasetCode':_0x560a2c,'runtimeDomain':getRuntimeDomain(),'api':{'write':(_0x2aa635,_0x5d1a71)=>createDatasetImportBatch(_0x5c5d19[_0x269b49(0x23b)],_0x560a2c,{'schemaFingerprint':_0x55ed34[_0x269b49(0x237)],'items':_0x2aa635,..._0x5d1a71===undefined?{}:{'taskId':_0x5d1a71}}),'readback':_0xb9249f=>readDatasetImportRows(_0x5c5d19[_0x269b49(0x23b)],_0x560a2c,_0xb9249f),'readTask':_0x13c7d2=>readDatasetImportTaskRows(_0x5c5d19[_0x269b49(0x23b)],_0x560a2c,_0x13c7d2)}});return{'ok':!![],'data':_0x96871f,'message':'Imported\x20and\x20verified\x20'+_0x96871f[_0x269b49(0x21e)]+_0x269b49(0x1f9)};})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x2b1f92=a27_0x5cf6;(function(_0x1534ed,_0x204492){const _0x4bf623=a27_0x5cf6,_0x5ba095=_0x1534ed();while(!![]){try{const _0x17402b=-parseInt(_0x4bf623(0x16b))/0x1*(parseInt(_0x4bf623(0x161))/0x2)+parseInt(_0x4bf623(0x117))/0x3+-parseInt(_0x4bf623(0x166))/0x4*(parseInt(_0x4bf623(0x110))/0x5)+parseInt(_0x4bf623(0x11d))/0x6+parseInt(_0x4bf623(0x12f))/0x7*(parseInt(_0x4bf623(0x113))/0x8)+parseInt(_0x4bf623(0x124))/0x9*(parseInt(_0x4bf623(0x109))/0xa)+parseInt(_0x4bf623(0x135))/0xb;if(_0x17402b===_0x204492)break;else _0x5ba095['push'](_0x5ba095['shift']());}catch(_0x2fae44){_0x5ba095['push'](_0x5ba095['shift']());}}}(a27_0x35ac,0xe27aa));import{dataImportExcel}from'./import-excel.js';import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams,parseUpdateIdsFromParams,normalizeUpdateParamsForRuntime}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a27_0x2b1f92(0x167),'operation':a27_0x2b1f92(0x167),'risk':a27_0x2b1f92(0x148),'paramsRequired':![],'description':a27_0x2b1f92(0x163),'paramsHint':a27_0x2b1f92(0x157)+a27_0x2b1f92(0x16c),'helpExtra':[a27_0x2b1f92(0x10b),a27_0x2b1f92(0x127),a27_0x2b1f92(0x146),a27_0x2b1f92(0x168),a27_0x2b1f92(0x10a),a27_0x2b1f92(0x138),'\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}',a27_0x2b1f92(0x134),a27_0x2b1f92(0x13d),'',a27_0x2b1f92(0x11c),a27_0x2b1f92(0x15d),'\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','',a27_0x2b1f92(0x16f),a27_0x2b1f92(0x136),'\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]',a27_0x2b1f92(0x162),'\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)',a27_0x2b1f92(0x130),'','\x20\x20PAGINATION','\x20\x20\x20\x20Filtering\x20and\x20pagination\x20are\x20controlled\x20only\x20via\x20one\x20JSON\x20object\x20in\x20--params.',a27_0x2b1f92(0x12c),'\x20\x20\x20\x20Page\x20numbers\x20start\x20at\x201.\x20To\x20fetch\x20the\x20next\x20page,\x20keep\x20where/select/orderBy/pageSize\x20unchanged',a27_0x2b1f92(0x158),a27_0x2b1f92(0x14e),a27_0x2b1f92(0x120),a27_0x2b1f92(0x15b)][a27_0x2b1f92(0x14b)]('\x0a')},{'command':a27_0x2b1f92(0x133),'operation':a27_0x2b1f92(0x133),'risk':a27_0x2b1f92(0x148),'paramsRequired':!![],'description':a27_0x2b1f92(0x12e),'paramsHint':a27_0x2b1f92(0x154)},{'command':a27_0x2b1f92(0x11e),'operation':a27_0x2b1f92(0x11e),'risk':'write','paramsRequired':!![],'description':a27_0x2b1f92(0x173),'confirmationDescription':a27_0x2b1f92(0x14c),'paramsHint':a27_0x2b1f92(0x15a)},{'command':a27_0x2b1f92(0x151),'operation':'batchCreate','risk':a27_0x2b1f92(0x11a),'paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20the\x20dataset\x20in\x20one\x20request','helpExtra':[a27_0x2b1f92(0x132),'\x20\x20\x20\x20METADATA:\x20use\x20lovrabet\x20data\x20import-excel\x20with\x20checkpoint\x20recovery.',a27_0x2b1f92(0x14d),'\x20\x20\x20\x20then\x20convert\x20rows\x20to\x20JSON\x20and\x20split\x20within\x20the\x20target\x20API\x20row/byte\x20and\x20local\x20argument\x20limits.',a27_0x2b1f92(0x112),a27_0x2b1f92(0x126),a27_0x2b1f92(0x13e),a27_0x2b1f92(0x16d),a27_0x2b1f92(0x118),'\x20\x20\x20\x20Built-in\x20Skill\x20guide:\x20references/lovrabet-db-table-excel-import.md',a27_0x2b1f92(0x139)][a27_0x2b1f92(0x14b)]('\x0a'),'confirmationDescription':'Writes\x20multiple\x20new\x20business\x20records\x20to\x20the\x20current\x20app\x20dataset.\x20They\x20are\x20saved\x20immediately\x20after\x20confirmation.','paramsHint':a27_0x2b1f92(0x10e)},{'command':a27_0x2b1f92(0x13a),'operation':'update','risk':a27_0x2b1f92(0x11a),'paramsRequired':!![],'description':a27_0x2b1f92(0x121),'confirmationDescription':a27_0x2b1f92(0x147),'paramsHint':a27_0x2b1f92(0x12a)+a27_0x2b1f92(0x137)},{'command':a27_0x2b1f92(0x114),'operation':'delete','risk':'high-risk-write','paramsRequired':!![],'description':a27_0x2b1f92(0x115),'confirmationDescription':'Deletes\x20business\x20records\x20from\x20the\x20current\x20app\x20dataset.\x20This\x20may\x20not\x20be\x20recoverable.','paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a27_0x2b1f92(0x145),'operation':'aggregate','risk':a27_0x2b1f92(0x148),'paramsRequired':![],'description':'Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','paramsHint':'JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20'+a27_0x2b1f92(0x156),'helpExtra':[a27_0x2b1f92(0x122),a27_0x2b1f92(0x15e),a27_0x2b1f92(0x160),a27_0x2b1f92(0x149),'\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}',a27_0x2b1f92(0x16e),a27_0x2b1f92(0x11b),a27_0x2b1f92(0x164),'','\x20\x20PARAMS\x20STRUCTURE',a27_0x2b1f92(0x171),'\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]',a27_0x2b1f92(0x15c),a27_0x2b1f92(0x152),'','\x20\x20AGGREGATE\x20ALIAS\x20BOUNDARY',a27_0x2b1f92(0x12d),a27_0x2b1f92(0x131),a27_0x2b1f92(0x143),'',a27_0x2b1f92(0x14a),a27_0x2b1f92(0x119),a27_0x2b1f92(0x150),a27_0x2b1f92(0x111),a27_0x2b1f92(0x13f),'',a27_0x2b1f92(0x16a),a27_0x2b1f92(0x159),a27_0x2b1f92(0x12b),'',a27_0x2b1f92(0x11f),a27_0x2b1f92(0x153),'',a27_0x2b1f92(0x141)][a27_0x2b1f92(0x14b)]('\x0a')}];function makeDataCommand(_0x2bb5ef){const _0x1e2b6e=a27_0x2b1f92,_0x5b6496=_0x1e2b6e(0x123)+_0x2bb5ef[_0x1e2b6e(0x169)],_0x45c772={'service':'data','command':_0x2bb5ef[_0x1e2b6e(0x169)],'description':_0x2bb5ef[_0x1e2b6e(0x116)],'risk':_0x2bb5ef[_0x1e2b6e(0x13c)],..._0x2bb5ef[_0x1e2b6e(0x13b)]?{'confirmationDescription':_0x2bb5ef[_0x1e2b6e(0x13b)]}:{},'helpExtra':_0x2bb5ef[_0x1e2b6e(0x10f)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x2bb5ef[_0x1e2b6e(0x14f)]}],'validate':async _0x412330=>{const _0x14f5f3=_0x1e2b6e;_0x2bb5ef['paramsRequired']&&requireAnyOf(_0x412330,[_0x14f5f3(0x10c)],_0x5b6496),_0x2bb5ef[_0x14f5f3(0x142)]===_0x14f5f3(0x151)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x412330[_0x14f5f3(0x140)](_0x14f5f3(0x10c)))),_0x2bb5ef[_0x14f5f3(0x142)]===_0x14f5f3(0x13a)&&parseUpdateIdsFromParams(parseJsonParams(_0x412330['str'](_0x14f5f3(0x10c)))??{});},async 'execute'(_0x5abc2c){const _0x1ac24b=_0x1e2b6e,_0x289765=_0x5abc2c['str'](_0x1ac24b(0x129)),_0x42fd43=_0x2bb5ef[_0x1ac24b(0x142)]===_0x1ac24b(0x151)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x5abc2c[_0x1ac24b(0x140)]('params'))):parseJsonParams(_0x5abc2c['str'](_0x1ac24b(0x10c)))??{},_0x3c8461=_0x2bb5ef[_0x1ac24b(0x142)]===_0x1ac24b(0x13a)?parseUpdateIdsFromParams(_0x42fd43):undefined,_0x44f516=_0x3c8461?normalizeUpdateParamsForRuntime(_0x42fd43,_0x3c8461):_0x42fd43,_0x42d855=Date[_0x1ac24b(0x155)](),_0x382d6a=await executeData(_0x289765,_0x2bb5ef[_0x1ac24b(0x142)],_0x44f516),_0x34b6be=Date[_0x1ac24b(0x155)]()-_0x42d855,_0x4df15c=_0x3c8461&&_0x3c8461[_0x1ac24b(0x125)]>0x1?buildBatchUpdateResult(_0x3c8461,_0x382d6a):_0x382d6a;return{'ok':!![],'data':{'result':_0x4df15c,'elapsed':_0x34b6be},'message':_0x1ac24b(0x123)+_0x2bb5ef[_0x1ac24b(0x169)]+_0x1ac24b(0x15f)+_0x34b6be+'ms'};}};return _0x2bb5ef[_0x1e2b6e(0x13c)]!=='read'&&(_0x45c772['dryRun']=async _0x1a936d=>{const _0x193cd3=_0x1e2b6e,_0x3d1c12=_0x1a936d[_0x193cd3(0x140)]('code'),_0x1a6a86=_0x2bb5ef[_0x193cd3(0x142)]===_0x193cd3(0x151)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x1a936d['str'](_0x193cd3(0x10c)))):parseJsonParams(_0x1a936d['str']('params'))??{};let _0x2ff804=_0x1a6a86;if(_0x2bb5ef['operation']===_0x193cd3(0x13a)){const _0x2ea3cc=parseUpdateIdsFromParams(_0x1a6a86);_0x2ff804=normalizeUpdateParamsForRuntime(_0x1a6a86,_0x2ea3cc);}return dryRun(_0x193cd3(0x172),_0x193cd3(0x128)+_0x3d1c12+'/'+_0x2bb5ef[_0x193cd3(0x142)])[_0x193cd3(0x174)](_0x2ff804)[_0x193cd3(0x116)](_0x193cd3(0x170)+_0x2bb5ef[_0x193cd3(0x169)]+_0x193cd3(0x10d)+_0x3d1c12)[_0x193cd3(0x165)]();}),_0x45c772;}export const dataDefinitions=[...specs[a27_0x2b1f92(0x144)](makeDataCommand),dataImportExcel];function buildBatchUpdateResult(_0x3cb116,_0x37efb5){const _0x158d81=a27_0x2b1f92;return{'operation':_0x158d81(0x13a),'mode':'batch','ids':_0x3cb116,'total':_0x3cb116[_0x158d81(0x125)],'result':_0x37efb5};}function a27_0x5cf6(_0x677807,_0x1d977c){_0x677807=_0x677807-0x109;const _0x35ac93=a27_0x35ac();let _0x5cf695=_0x35ac93[_0x677807];return _0x5cf695;}function a27_0x35ac(){const _0x3a0d4c=['data\x20','3843sLwuWf','length','\x20\x20\x20\x20--dry-run\x20previews\x20the\x20request\x20only;\x20it\x20does\x20not\x20validate\x20server\x20constraints\x20or\x20write\x20permissions.','\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}','/api/{appCode}/','code','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20id\x20may\x20be\x20a\x20single\x20value\x20or\x20array.\x20','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\x20Do\x20NOT\x20use\x20--where,\x20--select,\x20--order-by,\x20--current-page,\x20--page,\x20or\x20--page-size\x20as\x20CLI\x20flags.','\x20\x20\x20\x20aggregate[].alias\x20defines\x20the\x20output\x20field\x20name\x20only','Get\x20a\x20single\x20record\x20by\x20ID','7SQhoXW','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','\x20\x20\x20\x20select/where/having/groupBy\x20must\x20use\x20real\x20dataset\x20fields','\x20\x20EXCEL\x20ROUTES','getOne','\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','13497000chyCxL','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','Examples:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27,\x20\x27{\x22id\x22:[1,2,3],\x22status\x22:\x22completed\x22}\x27','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','\x20\x20\x20\x20Non-Excel\x20batchCreate\x20remains\x20available\x20for\x20METADATA\x20and\x20DB_TABLE.','update','confirmationDescription','risk','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','\x20\x20\x20\x20Record\x20each\x20batch\x20and\x20verify\x20its\x20IDs\x20or\x20unique\x20business\x20keys\x20before\x20continuing.','\x20\x20\x20\x20choose\x20the\x20capability\x20before\x20execution;\x20never\x20fall\x20back\x20at\x20runtime','str','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','operation','\x20\x20\x20\x20orderBy\x20may\x20reference\x20aggregate\x20output\x20aliases','map','aggregate','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','Changes\x20an\x20existing\x20business\x20record\x20in\x20the\x20current\x20app\x20dataset.\x20The\x20new\x20values\x20are\x20saved\x20immediately\x20after\x20confirmation.','read','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','\x20\x20DATASET\x20BOUNDARY','join','Writes\x20one\x20new\x20business\x20record\x20to\x20the\x20current\x20app\x20dataset.\x20It\x20is\x20saved\x20immediately\x20after\x20confirmation.','\x20\x20\x20\x20DB_TABLE:\x20inspect\x20dataset\x20detail,\x20validate\x20the\x20full\x20file\x20and\x20confirmed\x20unique\x20business\x20keys,','\x20\x20\x20\x20Page\x201:\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','paramsHint','\x20\x20\x20\x20METADATA\x20datasets\x20do\x20not\x20support\x20aggregate\x20or\x20Custom\x20SQL','batchCreate','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order;\x20may\x20reference\x20aggregate\x20output\x20aliases,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','now','Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','\x20\x20\x20\x20and\x20increment\x20only\x20currentPage.\x20Use\x20a\x20stable\x20unique\x20orderBy\x20field\x20to\x20avoid\x20duplicates\x20or\x20gaps.','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','\x20\x20\x20\x20Verify\x20the\x20response\x20paging.currentPage/pageSize\x20and\x20that\x20tableData\x20satisfies\x20where\x20before\x20drawing\x20conclusions.','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Post-aggregation\x20filters\x20using\x20real\x20dataset\x20fields,\x20e.g.\x20{\x22category_id\x22:{\x22$notNull\x22:true}}','\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','\x20completed\x20in\x20','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','8MLSaEU','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','Filter\x20dataset\x20records\x20with\x20query\x20conditions','\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','build','3355788pzeGvZ','filter','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','command','\x20\x20EXAMPLES','198158xDDdMT','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\x20\x20\x20\x20Stop\x20on\x20unknown\x20outcomes\x20or\x20conflicts;\x20reconcile\x20before\x20retrying,\x20never\x20blindly\x20resend\x20a\x20batch.','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','Preview:\x20data\x20','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','POST','Create\x20one\x20record\x20in\x20the\x20dataset','body','8790CXpBVe','\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','\x20\x20WHERE\x20OPERATORS','params','\x20on\x20dataset\x20','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','helpExtra','10nMYAIu','\x20\x20\x20\x20JOIN\x20and\x20cross-table\x20aggregation\x20require\x20an\x20existing\x20trusted\x20Custom\x20SQL','\x20\x20\x20\x20This\x20command\x20sends\x20one\x20prepared\x20batch;\x20it\x20does\x20not\x20read\x20XLSX\x20or\x20split\x20batches.','2887816vodhIf','delete','Delete\x20data\x20records\x20(non-interactive\x20mode\x20requires\x20--yes)','description','3769842BFqVAT','\x20\x20\x20\x20No\x20import\x20checkpoint,\x20--resume,\x20automatic\x20upsert,\x20or\x20atomic\x20rollback\x20guarantee.','\x20\x20\x20\x20aggregate\x20supports\x20a\x20single\x20DB_TABLE\x20dataset\x20only','write','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','\x20\x20LOGICAL\x20COMBINATORS','1069560cvAiRx','create','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','\x20\x20\x20\x20Page\x202:\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:2,\x22pageSize\x22:20}\x27','Update\x20an\x20existing\x20data\x20record','\x20\x20AGGREGATE\x20TYPES'];a27_0x35ac=function(){return _0x3a0d4c;};return a27_0x35ac();}
|
|
1
|
+
function a27_0x5547(){const _0x386354=['\x20\x20\x20\x20Non-Excel\x20batchCreate\x20remains\x20available\x20for\x20METADATA\x20and\x20DB_TABLE.','\x20\x20\x20\x20Page\x202:\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:2,\x22pageSize\x22:20}\x27','\x20\x20\x20\x20This\x20command\x20sends\x20one\x20prepared\x20batch;\x20it\x20does\x20not\x20read\x20XLSX\x20or\x20split\x20batches.','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','operation','read','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','update','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Post-aggregation\x20filters\x20using\x20real\x20dataset\x20fields,\x20e.g.\x20{\x22category_id\x22:{\x22$notNull\x22:true}}','\x20\x20\x20\x20METADATA:\x20use\x20lovrabet\x20data\x20import-excel\x20with\x20checkpoint\x20recovery.','\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','\x20\x20WHERE\x20OPERATORS','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','5468136HPLFZe','\x20\x20AGGREGATE\x20TYPES','build','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','high-risk-write','data\x20','Changes\x20an\x20existing\x20business\x20record\x20in\x20the\x20current\x20app\x20dataset.\x20The\x20new\x20values\x20are\x20saved\x20immediately\x20after\x20confirmation.','\x20\x20\x20\x20then\x20convert\x20rows\x20to\x20JSON\x20and\x20split\x20within\x20the\x20target\x20API\x20row/byte\x20and\x20local\x20argument\x20limits.','description','2999180nTJdDd','Filter\x20dataset\x20records\x20with\x20query\x20conditions','222YsspiR','\x20\x20\x20\x20Built-in\x20Skill\x20guide:\x20references/lovrabet-db-table-excel-import.md','\x20\x20\x20\x20aggregate[].alias\x20defines\x20the\x20output\x20field\x20name\x20only','filter','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','body','Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','/api/{appCode}/','16SAQzIP','1512261VoSuJj','batchCreate','command','\x20\x20DATASET\x20BOUNDARY','str','660431jkoUPk','risk','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','\x20\x20\x20\x20choose\x20the\x20capability\x20before\x20execution;\x20never\x20fall\x20back\x20at\x20runtime','Get\x20a\x20single\x20record\x20by\x20ID','Create\x20one\x20record\x20in\x20the\x20dataset','20zvUgKH','Update\x20an\x20existing\x20data\x20record','paramsRequired','\x20\x20\x20\x20METADATA\x20datasets\x20do\x20not\x20support\x20aggregate\x20or\x20Custom\x20SQL','dryRun','params','confirmationDescription','batch','now','\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','join','\x20\x20\x20\x20Filtering\x20and\x20pagination\x20are\x20controlled\x20only\x20via\x20one\x20JSON\x20object\x20in\x20--params.','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','\x20\x20EXAMPLES','\x20\x20\x20\x20Verify\x20the\x20response\x20paging.currentPage/pageSize\x20and\x20that\x20tableData\x20satisfies\x20where\x20before\x20drawing\x20conclusions.','278571IAYqEi','write','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','\x20\x20\x20\x20Record\x20each\x20batch\x20and\x20verify\x20its\x20IDs\x20or\x20unique\x20business\x20keys\x20before\x20continuing.','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order;\x20may\x20reference\x20aggregate\x20output\x20aliases,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','\x20\x20PAGINATION','POST','\x20\x20\x20\x20JOIN\x20and\x20cross-table\x20aggregation\x20require\x20an\x20existing\x20trusted\x20Custom\x20SQL','\x20\x20\x20\x20and\x20increment\x20only\x20currentPage.\x20Use\x20a\x20stable\x20unique\x20orderBy\x20field\x20to\x20avoid\x20duplicates\x20or\x20gaps.','\x20completed\x20in\x20','paramsHint','delete','aggregate','43526xUFUUo','Writes\x20multiple\x20new\x20business\x20records\x20to\x20the\x20current\x20app\x20dataset.\x20They\x20are\x20saved\x20immediately\x20after\x20confirmation.','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20id\x20may\x20be\x20a\x20single\x20value\x20or\x20array.\x20','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\x20\x20PARAMS\x20STRUCTURE','\x20\x20\x20\x20Stop\x20on\x20unknown\x20outcomes\x20or\x20conflicts;\x20reconcile\x20before\x20retrying,\x20never\x20blindly\x20resend\x20a\x20batch.','Delete\x20data\x20records\x20(non-interactive\x20mode\x20requires\x20--yes)','\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','\x20on\x20dataset\x20','\x20\x20EXCEL\x20ROUTES','Deletes\x20business\x20records\x20from\x20the\x20current\x20app\x20dataset.\x20This\x20may\x20not\x20be\x20recoverable.','1325698fmkcjN','create','\x20\x20\x20\x20Page\x20numbers\x20start\x20at\x201.\x20To\x20fetch\x20the\x20next\x20page,\x20keep\x20where/select/orderBy/pageSize\x20unchanged','length','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\x20\x20\x20\x20orderBy\x20may\x20reference\x20aggregate\x20output\x20aliases','helpExtra','\x20\x20AGGREGATE\x20ALIAS\x20BOUNDARY','getOne'];a27_0x5547=function(){return _0x386354;};return a27_0x5547();}const a27_0x5e6a5e=a27_0x5680;(function(_0xf6bae2,_0x164d27){const _0x360317=a27_0x5680,_0x258388=_0xf6bae2();while(!![]){try{const _0x50087b=-parseInt(_0x360317(0x1ec))/0x1+-parseInt(_0x360317(0x220))/0x2+-parseInt(_0x360317(0x203))/0x3*(-parseInt(_0x360317(0x1e6))/0x4)+parseInt(_0x360317(0x1dc))/0x5+parseInt(_0x360317(0x1de))/0x6*(-parseInt(_0x360317(0x214))/0x7)+parseInt(_0x360317(0x1d3))/0x8+-parseInt(_0x360317(0x1e7))/0x9*(-parseInt(_0x360317(0x1f3))/0xa);if(_0x50087b===_0x164d27)break;else _0x258388['push'](_0x258388['shift']());}catch(_0x3f2435){_0x258388['push'](_0x258388['shift']());}}}(a27_0x5547,0x6acf5));import{dataImportExcel}from'./import-excel.js';import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';function a27_0x5680(_0x4f8be0,_0x49b85b){_0x4f8be0=_0x4f8be0-0x1c9;const _0x5547da=a27_0x5547();let _0x56806a=_0x5547da[_0x4f8be0];return _0x56806a;}import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams,parseUpdateIdsFromParams,normalizeUpdateParamsForRuntime}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':'filter','operation':a27_0x5e6a5e(0x1e1),'risk':a27_0x5e6a5e(0x1ca),'paramsRequired':![],'description':a27_0x5e6a5e(0x1dd),'paramsHint':a27_0x5e6a5e(0x208)+a27_0x5e6a5e(0x224),'helpExtra':[a27_0x5e6a5e(0x1d1),'\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}',a27_0x5e6a5e(0x206),a27_0x5e6a5e(0x205),a27_0x5e6a5e(0x1d0),'\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}',a27_0x5e6a5e(0x22d),a27_0x5e6a5e(0x21c),'\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}',a27_0x5e6a5e(0x209),'','\x20\x20LOGICAL\x20COMBINATORS',a27_0x5e6a5e(0x21b),'\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','',a27_0x5e6a5e(0x200),a27_0x5e6a5e(0x20a),a27_0x5e6a5e(0x1ef),a27_0x5e6a5e(0x1cc),'\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','',a27_0x5e6a5e(0x20c),a27_0x5e6a5e(0x1ff),'\x20\x20\x20\x20Do\x20NOT\x20use\x20--where,\x20--select,\x20--order-by,\x20--current-page,\x20--page,\x20or\x20--page-size\x20as\x20CLI\x20flags.',a27_0x5e6a5e(0x222),a27_0x5e6a5e(0x20f),'\x20\x20\x20\x20Page\x201:\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:1,\x22pageSize\x22:20}\x27',a27_0x5e6a5e(0x22a),a27_0x5e6a5e(0x202)]['join']('\x0a')},{'command':a27_0x5e6a5e(0x228),'operation':'getOne','risk':'read','paramsRequired':!![],'description':a27_0x5e6a5e(0x1f1),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a27_0x5e6a5e(0x221),'operation':'create','risk':a27_0x5e6a5e(0x204),'paramsRequired':!![],'description':a27_0x5e6a5e(0x1f2),'confirmationDescription':'Writes\x20one\x20new\x20business\x20record\x20to\x20the\x20current\x20app\x20dataset.\x20It\x20is\x20saved\x20immediately\x20after\x20confirmation.','paramsHint':a27_0x5e6a5e(0x1e2)},{'command':'batchCreate','operation':a27_0x5e6a5e(0x1e8),'risk':a27_0x5e6a5e(0x204),'paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20the\x20dataset\x20in\x20one\x20request','helpExtra':[a27_0x5e6a5e(0x21e),a27_0x5e6a5e(0x1cf),'\x20\x20\x20\x20DB_TABLE:\x20inspect\x20dataset\x20detail,\x20validate\x20the\x20full\x20file\x20and\x20confirmed\x20unique\x20business\x20keys,',a27_0x5e6a5e(0x1da),a27_0x5e6a5e(0x22b),'\x20\x20\x20\x20--dry-run\x20previews\x20the\x20request\x20only;\x20it\x20does\x20not\x20validate\x20server\x20constraints\x20or\x20write\x20permissions.',a27_0x5e6a5e(0x207),a27_0x5e6a5e(0x219),'\x20\x20\x20\x20No\x20import\x20checkpoint,\x20--resume,\x20automatic\x20upsert,\x20or\x20atomic\x20rollback\x20guarantee.',a27_0x5e6a5e(0x1df),a27_0x5e6a5e(0x229)][a27_0x5e6a5e(0x1fe)]('\x0a'),'confirmationDescription':a27_0x5e6a5e(0x215),'paramsHint':'JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27'},{'command':a27_0x5e6a5e(0x1cd),'operation':a27_0x5e6a5e(0x1cd),'risk':a27_0x5e6a5e(0x204),'paramsRequired':!![],'description':a27_0x5e6a5e(0x1f4),'confirmationDescription':a27_0x5e6a5e(0x1d9),'paramsHint':a27_0x5e6a5e(0x216)+'Examples:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27,\x20\x27{\x22id\x22:[1,2,3],\x22status\x22:\x22completed\x22}\x27'},{'command':a27_0x5e6a5e(0x212),'operation':a27_0x5e6a5e(0x212),'risk':a27_0x5e6a5e(0x1d7),'paramsRequired':!![],'description':a27_0x5e6a5e(0x21a),'confirmationDescription':a27_0x5e6a5e(0x21f),'paramsHint':a27_0x5e6a5e(0x1cb)},{'command':a27_0x5e6a5e(0x213),'operation':a27_0x5e6a5e(0x213),'risk':a27_0x5e6a5e(0x1ca),'paramsRequired':![],'description':'Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','paramsHint':a27_0x5e6a5e(0x1fd)+a27_0x5e6a5e(0x1e4),'helpExtra':[a27_0x5e6a5e(0x1d4),'\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}',a27_0x5e6a5e(0x1ee),'\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}',a27_0x5e6a5e(0x1fc),'',a27_0x5e6a5e(0x218),'\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]',a27_0x5e6a5e(0x217),'\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]',a27_0x5e6a5e(0x1ce),a27_0x5e6a5e(0x20b),'',a27_0x5e6a5e(0x227),a27_0x5e6a5e(0x1e0),'\x20\x20\x20\x20select/where/having/groupBy\x20must\x20use\x20real\x20dataset\x20fields',a27_0x5e6a5e(0x225),'',a27_0x5e6a5e(0x1ea),'\x20\x20\x20\x20aggregate\x20supports\x20a\x20single\x20DB_TABLE\x20dataset\x20only',a27_0x5e6a5e(0x1f6),a27_0x5e6a5e(0x20e),a27_0x5e6a5e(0x1f0),'',a27_0x5e6a5e(0x201),'\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status',a27_0x5e6a5e(0x1d6),'','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter',a27_0x5e6a5e(0x22c),'',a27_0x5e6a5e(0x1d2)][a27_0x5e6a5e(0x1fe)]('\x0a')}];function makeDataCommand(_0x103f82){const _0x560c3c=a27_0x5e6a5e,_0x132849=_0x560c3c(0x1d8)+_0x103f82[_0x560c3c(0x1e9)],_0x4917dd={'service':'data','command':_0x103f82[_0x560c3c(0x1e9)],'description':_0x103f82[_0x560c3c(0x1db)],'risk':_0x103f82[_0x560c3c(0x1ed)],..._0x103f82[_0x560c3c(0x1f9)]?{'confirmationDescription':_0x103f82['confirmationDescription']}:{},'helpExtra':_0x103f82[_0x560c3c(0x226)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x103f82[_0x560c3c(0x211)]}],'validate':async _0x5adada=>{const _0x4f9fd0=_0x560c3c;_0x103f82[_0x4f9fd0(0x1f5)]&&requireAnyOf(_0x5adada,[_0x4f9fd0(0x1f8)],_0x132849),_0x103f82[_0x4f9fd0(0x1c9)]==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x5adada['str'](_0x4f9fd0(0x1f8)))),_0x103f82['operation']===_0x4f9fd0(0x1cd)&&parseUpdateIdsFromParams(parseJsonParams(_0x5adada[_0x4f9fd0(0x1eb)]('params'))??{});},async 'execute'(_0x13c5a9){const _0x58a909=_0x560c3c,_0x314c6f=_0x13c5a9[_0x58a909(0x1eb)]('code'),_0x1599fe=_0x103f82[_0x58a909(0x1c9)]===_0x58a909(0x1e8)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x13c5a9[_0x58a909(0x1eb)](_0x58a909(0x1f8)))):parseJsonParams(_0x13c5a9[_0x58a909(0x1eb)](_0x58a909(0x1f8)))??{},_0x83c92b=_0x103f82[_0x58a909(0x1c9)]===_0x58a909(0x1cd)?parseUpdateIdsFromParams(_0x1599fe):undefined,_0x3a27e6=_0x83c92b?normalizeUpdateParamsForRuntime(_0x1599fe,_0x83c92b):_0x1599fe,_0x2076db=Date[_0x58a909(0x1fb)](),_0x2e3aec=await executeData(_0x314c6f,_0x103f82[_0x58a909(0x1c9)],_0x3a27e6),_0x2e4046=Date[_0x58a909(0x1fb)]()-_0x2076db,_0x51b3fd=_0x83c92b&&_0x83c92b[_0x58a909(0x223)]>0x1?buildBatchUpdateResult(_0x83c92b,_0x2e3aec):_0x2e3aec;return{'ok':!![],'data':{'result':_0x51b3fd,'elapsed':_0x2e4046},'message':_0x58a909(0x1d8)+_0x103f82[_0x58a909(0x1e9)]+_0x58a909(0x210)+_0x2e4046+'ms'};}};return _0x103f82[_0x560c3c(0x1ed)]!==_0x560c3c(0x1ca)&&(_0x4917dd[_0x560c3c(0x1f7)]=async _0x2a7489=>{const _0x4fa3f5=_0x560c3c,_0x362677=_0x2a7489['str']('code'),_0x2e880f=_0x103f82[_0x4fa3f5(0x1c9)]===_0x4fa3f5(0x1e8)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x2a7489[_0x4fa3f5(0x1eb)](_0x4fa3f5(0x1f8)))):parseJsonParams(_0x2a7489[_0x4fa3f5(0x1eb)]('params'))??{};let _0x7efc64=_0x2e880f;if(_0x103f82['operation']===_0x4fa3f5(0x1cd)){const _0x3c11f4=parseUpdateIdsFromParams(_0x2e880f);_0x7efc64=normalizeUpdateParamsForRuntime(_0x2e880f,_0x3c11f4);}return dryRun(_0x4fa3f5(0x20d),_0x4fa3f5(0x1e5)+_0x362677+'/'+_0x103f82[_0x4fa3f5(0x1c9)])[_0x4fa3f5(0x1e3)](_0x7efc64)[_0x4fa3f5(0x1db)]('Preview:\x20data\x20'+_0x103f82[_0x4fa3f5(0x1e9)]+_0x4fa3f5(0x21d)+_0x362677)[_0x4fa3f5(0x1d5)]();}),_0x4917dd;}export const dataDefinitions=[...specs['map'](makeDataCommand),dataImportExcel];function buildBatchUpdateResult(_0xbd899c,_0x5c4e00){const _0x57ab4f=a27_0x5e6a5e;return{'operation':_0x57ab4f(0x1cd),'mode':_0x57ab4f(0x1fa),'ids':_0xbd899c,'total':_0xbd899c[_0x57ab4f(0x223)],'result':_0x5c4e00};}
|