@lovrabet/lovrabet-cli 2.3.12-beta.1 → 2.3.13-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/approval/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/import-excel.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/issue/context.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/metric/contract.d.ts +8 -0
- package/lib/commands/metric/contract.js +1 -0
- package/lib/commands/metric/definition.d.ts +35 -0
- package/lib/commands/metric/definition.js +1 -0
- package/lib/commands/metric/detail.d.ts +2 -0
- package/lib/commands/metric/detail.js +1 -0
- package/lib/commands/metric/exec.d.ts +2 -0
- package/lib/commands/metric/exec.js +1 -0
- package/lib/commands/metric/index.d.ts +1 -0
- package/lib/commands/metric/index.js +1 -0
- package/lib/commands/metric/list.d.ts +2 -0
- package/lib/commands/metric/list.js +1 -0
- package/lib/commands/metric/shared.d.ts +17 -0
- package/lib/commands/metric/shared.js +1 -0
- 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 +4 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-management-client.js +1 -1
- package/lib/core/kb-sdk-errors.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/access-error.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/services/dataset-import/auto-id-runner.js +1 -1
- package/lib/services/dataset-import/excel-reader.js +1 -1
- package/lib/services/dataset-import/image-bytes.js +1 -1
- package/lib/services/dataset-import/image-ooxml.js +1 -1
- package/lib/services/dataset-import/image-runner.js +1 -1
- package/lib/services/dataset-import/metadata.js +1 -1
- package/lib/services/dataset-import/preview.js +1 -1
- package/lib/services/dataset-import/runner.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/access-key-redaction.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/positive-safe-integer.js +1 -1
- package/lib/utils/redaction.js +1 -1
- package/lib/utils/runtime-user-id.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 +5 -2
- package/skills/lovrabet/SKILL.md +12 -4
- package/skills/lovrabet/guides/app-resolution.md +2 -0
- package/skills/lovrabet/guides/dataset-and-data-workflow.md +2 -0
- package/skills/lovrabet/guides/development-intent-handoff.md +19 -3
- package/skills/lovrabet/guides/metric-consumption.md +134 -0
- package/skills/lovrabet/guides/sql-and-bff-workflow.md +2 -0
- package/skills/lovrabet/references/lovrabet-auth.md +4 -0
- package/skills/lovrabet/references/lovrabet-schedule-workflow.md +16 -0
- package/skills/lovrabet/references/lovrabet-skill-authoring.md +27 -0
- package/skills/lovrabet-report-generation/SKILL.md +28 -0
- package/skills/lovrabet-report-generation/references/business-skill-reuse.md +19 -0
- package/skills/lovrabet-report-generation/references/quality-checks.md +16 -0
- package/skills/lovrabet-report-generation/references/report-workflow.md +42 -0
- package/skills/lovrabet-report-generation/templates/report-outline.md +10 -0
- package/skills/lovrabet.manifest.json +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const a12_0x52f044=a12_0x7407;(function(_0x2cd4ba,_0x3bd5ce){const _0x3b3496=a12_0x7407,_0x2e5642=_0x2cd4ba();while(!![]){try{const _0x22ed8b=parseInt(_0x3b3496(0x1e1))/0x1*(-parseInt(_0x3b3496(0x1cd))/0x2)+-parseInt(_0x3b3496(0x204))/0x3+parseInt(_0x3b3496(0x1d4))/0x4*(-parseInt(_0x3b3496(0x1f5))/0x5)+-parseInt(_0x3b3496(0x214))/0x6+parseInt(_0x3b3496(0x1e2))/0x7+-parseInt(_0x3b3496(0x1ee))/0x8*(parseInt(_0x3b3496(0x1e4))/0x9)+parseInt(_0x3b3496(0x213))/0xa;if(_0x22ed8b===_0x3bd5ce)break;else _0x2e5642['push'](_0x2e5642['shift']());}catch(_0x3c2183){_0x2e5642['push'](_0x2e5642['shift']());}}}(a12_0x54da,0x81c2d));import{existsSync,mkdirSync,readFileSync,unlinkSync,writeFileSync}from'node:fs';import{dirname}from'node:path';import{homedir}from'node:os';import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG}from'../../constant/product.js';import{getUserDomain}from'../../constant/domain.js';import{CliErrors}from'../../errors.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';function resolveAuthScopeFlags(_0x49b6dc){const _0xc74e67=a12_0x7407;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x49b6dc[_0xc74e67(0x20c)]('global'),'explicitProject':_0x49b6dc[_0xc74e67(0x20c)](_0xc74e67(0x1d7)),'policy':_0xc74e67(0x210)}));}const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/,DEVICE_CODE_TTL_MS=0x927c0,POLL_INTERVAL_MS=0xbb8,MAX_POLLS=0xc8,MAX_CONSECUTIVE_NETWORK_ERRORS=0x5;export function generateDeviceCode(){const _0x28a1d2=a12_0x7407;return crypto[_0x28a1d2(0x1c9)]();}export function buildDeviceAuthUrl(_0x20984d,_0x2672f5,_0x26d0cc=a12_0x52f044(0x1de)){const _0x59874c=a12_0x52f044;return _0x20984d+_0x59874c(0x1f9)+encodeURIComponent(_0x2672f5)+_0x59874c(0x1f8)+encodeURIComponent(_0x26d0cc);}export function getDeviceCodePath(){const _0x435a88=a12_0x52f044;return homedir()+'/'+PRODUCT_CONFIG['homeDirName']+_0x435a88(0x205);}export function readStoredDeviceCode(){const _0xf155a9=a12_0x52f044,_0x230996=getDeviceCodePath();if(!existsSync(_0x230996))return null;try{const _0x4a16dd=readFileSync(_0x230996,{'encoding':_0xf155a9(0x1db)}),_0x53daa2=JSON[_0xf155a9(0x1e0)](_0x4a16dd);if(_0x53daa2&&typeof _0x53daa2['code']==='string'&&typeof _0x53daa2[_0xf155a9(0x1e6)]==='string'&&(_0x53daa2[_0xf155a9(0x1cb)]===_0xf155a9(0x1d5)||_0x53daa2[_0xf155a9(0x1cb)]===_0xf155a9(0x1d7)))return _0x53daa2;}catch{}return null;}export function writeStoredDeviceCode(_0x3b7d37,_0x865476){const _0x351abb=a12_0x52f044,_0x415c72=getDeviceCodePath(),_0x454a7a=dirname(_0x415c72);!existsSync(_0x454a7a)&&mkdirSync(_0x454a7a,{'recursive':!![]});const _0x289e0a={'code':_0x3b7d37,'createdAt':new Date()['toISOString'](),'scope':_0x865476};writeFileSync(_0x415c72,JSON[_0x351abb(0x1ec)](_0x289e0a),{'encoding':'utf8','mode':0x180});}function a12_0x7407(_0x2f6dfa,_0x5bd725){_0x2f6dfa=_0x2f6dfa-0x1c9;const _0x54dadd=a12_0x54da();let _0x74075=_0x54dadd[_0x2f6dfa];return _0x74075;}export function deleteStoredDeviceCode(){const _0x2c5ab3=getDeviceCodePath();try{unlinkSync(_0x2c5ab3);}catch{}}export function isStoredDeviceCodeExpired(_0x98e7bf){const _0x4fdaa8=a12_0x52f044;return Date[_0x4fdaa8(0x207)]()-new Date(_0x98e7bf['createdAt'])['getTime']()>DEVICE_CODE_TTL_MS;}export async function fetchDeviceToken(_0x875581,_0x44df15){const _0x2489e3=a12_0x52f044,_0x5729b2=_0x875581+'/api/device-auth/token',_0x367448=new AbortController(),_0x586497=setTimeout(()=>_0x367448[_0x2489e3(0x212)](),0x2710),_0x26a365=await fetch(_0x5729b2,{'method':_0x2489e3(0x1f3),'headers':{'Content-Type':_0x2489e3(0x1f1)},'body':JSON['stringify']({'code':_0x44df15}),'signal':_0x367448[_0x2489e3(0x211)]});clearTimeout(_0x586497);if(!_0x26a365['ok'])throw CliErrors[_0x2489e3(0x1fe)](_0x2489e3(0x1d2)+_0x26a365[_0x2489e3(0x20a)]);const _0x5b8e00=await _0x26a365[_0x2489e3(0x206)](),_0x24e379=_0x5b8e00[_0x2489e3(0x1dc)]&&typeof _0x5b8e00['data']===_0x2489e3(0x1ea)?_0x5b8e00[_0x2489e3(0x1dc)]:_0x5b8e00;if(!_0x24e379||typeof _0x24e379[_0x2489e3(0x20a)]!==_0x2489e3(0x1f4))throw CliErrors[_0x2489e3(0x1f6)](_0x2489e3(0x1fb));return{'status':_0x24e379['status'],'access_key':typeof _0x24e379[_0x2489e3(0x203)]===_0x2489e3(0x1f4)?_0x24e379[_0x2489e3(0x203)]:undefined};}export async function pollDeviceToken(_0x4014e3,_0x2c6de0,_0x4c0742){const _0x2c3753=a12_0x52f044;let _0x278935=0x0;for(let _0x3d8201=0x0;_0x3d8201<MAX_POLLS;_0x3d8201++){if(_0x4c0742[_0x2c3753(0x1ed)])throw CliErrors['cancelled'](_0x2c3753(0x208));let _0x31b709;try{_0x31b709=await fetchDeviceToken(_0x4014e3,_0x2c6de0);}catch(_0x4186f1){if(_0x4186f1 instanceof Error&&_0x4186f1[_0x2c3753(0x1d6)]==='AbortError')throw CliErrors[_0x2c3753(0x1d9)](_0x2c3753(0x208));_0x278935++;if(_0x278935>=MAX_CONSECUTIVE_NETWORK_ERRORS)throw CliErrors[_0x2c3753(0x1fe)](_0x2c3753(0x1e7));writeCliSideChannelLine(_0x2c3753(0x20d)+_0x278935+'/'+MAX_CONSECUTIVE_NETWORK_ERRORS+_0x2c3753(0x1cf)),await sleep(POLL_INTERVAL_MS);continue;}_0x278935=0x0;if(_0x31b709[_0x2c3753(0x20a)]==='success'){if(!_0x31b709['access_key'])throw CliErrors[_0x2c3753(0x1f6)](_0x2c3753(0x1f2));return _0x31b709[_0x2c3753(0x203)];}if(_0x31b709[_0x2c3753(0x20a)]===_0x2c3753(0x1e9)){deleteStoredDeviceCode();throw CliErrors['validation'](_0x2c3753(0x219));}const _0x238b28=(_0x3d8201+0x1)*POLL_INTERVAL_MS,_0x4c5fac=DEVICE_CODE_TTL_MS-_0x238b28,_0xc7715c=Math[_0x2c3753(0x218)](_0x4c5fac/0xea60),_0x270167=Math['floor'](_0x4c5fac%0xea60/0x3e8);process[_0x2c3753(0x1e8)]['write'](_0x2c3753(0x1f7)+_0xc7715c+':'+String(_0x270167)['padStart'](0x2,'0')+'\x20remaining'),await sleep(POLL_INTERVAL_MS);}deleteStoredDeviceCode();throw CliErrors[_0x2c3753(0x1fc)](_0x2c3753(0x201));}function sleep(_0x2c6f10){return new Promise(_0x306dbc=>setTimeout(_0x306dbc,_0x2c6f10));}export const authDeviceDefinition={'service':a12_0x52f044(0x1e3),'command':a12_0x52f044(0x217),'description':'Authorize\x20with\x20the\x20device-code\x20flow\x20(complete\x20in\x20the\x20browser;\x20no\x20copy-paste\x20required)','risk':a12_0x52f044(0x20f),'confirmationDescription':'Starts\x20the\x20device-code\x20login\x20flow.\x20On\x20success,\x20the\x20AccessKey\x20is\x20saved\x20to\x20the\x20selected\x20Lovrabet\x20config.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20the\x20device\x20code\x20or\x20secret.','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'global','type':a12_0x52f044(0x1da),'description':a12_0x52f044(0x1eb),'default':!![]},{'name':'project','type':'boolean','description':a12_0x52f044(0x1d3),'default':![]},{'name':a12_0x52f044(0x1dd),'type':'string','description':a12_0x52f044(0x1df),'default':a12_0x52f044(0x1de)},{'name':a12_0x52f044(0x215),'type':a12_0x52f044(0x1da),'description':a12_0x52f044(0x1fd),'default':![]}],async 'execute'(_0x1e5c6c){const _0x170cf1=a12_0x52f044,_0x10db8e=resolveAuthScopeFlags(_0x1e5c6c),_0x1fdd73=_0x10db8e['global']?'global':_0x170cf1(0x1d7),_0x5492f3=readScopedConfig(_0x10db8e);if(_0x5492f3[_0x170cf1(0x20b)])return{'ok':!![],'message':'Already\x20authorized.\x20Use\x20`lovrabet\x20auth\x20status`\x20to\x20verify.'};const _0x33015b=(_0x1e5c6c[_0x170cf1(0x216)](_0x170cf1(0x1dd))||'lovrabet-cli')[_0x170cf1(0x1ef)](),_0x131c82=getUserDomain(),_0xd9ba0c=readStoredDeviceCode(),_0x53c068=_0xd9ba0c&&!isStoredDeviceCodeExpired(_0xd9ba0c)?_0xd9ba0c[_0x170cf1(0x202)]:((()=>{const _0x174428=generateDeviceCode();return writeStoredDeviceCode(_0x174428,_0x1fdd73),_0x174428;})()),_0x52512d=buildDeviceAuthUrl(_0x131c82,_0x53c068,_0x33015b);if(_0x1e5c6c[_0x170cf1(0x20c)](_0x170cf1(0x215)))return console[_0x170cf1(0x21a)](_0x52512d),{'ok':!![]};writeCliSideChannelLine('Open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20authorize:'),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x52512d),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x170cf1(0x1d8));if(_0x1e5c6c[_0x170cf1(0x1ce)])return writeCliSideChannelLine(_0x170cf1(0x1ca)+CLI_BIN_NAME+_0x170cf1(0x209)),{'ok':!![],'message':_0x170cf1(0x1d1)};writeCliSideChannelLine('Waiting\x20for\x20authorization\x20(timeout:\x2010\x20minutes,\x20Ctrl+C\x20to\x20cancel)...');const _0x1c1491=new AbortController(),_0x4b3f56=()=>{const _0x21fc43=_0x170cf1;_0x1c1491[_0x21fc43(0x212)](),process[_0x21fc43(0x1f0)](_0x21fc43(0x1d0),_0x4b3f56);};process[_0x170cf1(0x1cc)](_0x170cf1(0x1d0),_0x4b3f56);let _0x32cc7d;try{_0x32cc7d=await pollDeviceToken(_0x131c82,_0x53c068,_0x1c1491['signal']);}finally{process[_0x170cf1(0x1f0)]('SIGINT',_0x4b3f56);}if(!ACCESS_KEY_PATTERN[_0x170cf1(0x1ff)](_0x32cc7d))throw CliErrors[_0x170cf1(0x1f6)](_0x170cf1(0x1f2));const _0x5eae35=readScopedConfig(_0x10db8e);return _0x5eae35[_0x170cf1(0x20b)]=_0x32cc7d,writeScopedConfig(_0x5eae35,_0x10db8e),deleteStoredDeviceCode(),process['stderr']['write']('\x0a'),writeCliSideChannelLine(_0x170cf1(0x20e)+_0x1fdd73+_0x170cf1(0x1fa)),writeCliSideChannelLine('Verify:\x20'+CLI_BIN_NAME+_0x170cf1(0x1e5)),{'ok':!![],'message':_0x170cf1(0x200)};}};function a12_0x54da(){const _0xd3fc6a=['Device\x20authorization\x20successful.','Device\x20authorization\x20timed\x20out\x20after\x2010\x20minutes.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','code','access_key','3155565oCnOaz','/.device-auth','json','now','Device\x20authorization\x20cancelled.','\x20auth\x20device','status','accessKey','bool','Device\x20auth\x20API\x20error\x20(','AccessKey\x20saved\x20to\x20','write','global-default','signal','abort','24067430qxllCQ','1188486ZSadZj','url-only','str','device','floor','Device\x20code\x20expired.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','log','randomUUID','After\x20authorizing,\x20re-run:\x20','scope','once','278732khVDKh','nonInteractive','),\x20retrying...','SIGINT','Device\x20authorization\x20URL\x20printed.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20re-run.','Device\x20auth\x20API\x20returned\x20HTTP\x20','Write\x20to\x20project\x20config','300BZdovG','global','name','project','The\x20device\x20code\x20is\x20valid\x20for\x2010\x20minutes.','cancelled','boolean','utf8','data','source','lovrabet-cli','App\x20name\x20shown\x20on\x20authorization\x20page\x20(default:\x20lovrabet)','parse','2uLtbTH','4141137zlRjqu','auth','855GIjpXp','\x20auth\x20status','createdAt','Device\x20auth\x20API\x20unreachable\x20after\x20multiple\x20retries.','stderr','expired','object','Write\x20to\x20global\x20config\x20(default)','stringify','aborted','6416IHnysA','trim','removeListener','application/json','Invalid\x20access_key\x20returned\x20by\x20server.','POST','string','57465PxdkkU','apiError','\x0dWaiting\x20for\x20authorization...\x20','&source=','/device-auth?code=','\x20config.','Invalid\x20device\x20auth\x20response','validation','Print\x20URL\x20to\x20stdout\x20and\x20exit\x20(for\x20WorkBuddy\x20integration)','networkError','test'];a12_0x54da=function(){return _0xd3fc6a;};return a12_0x54da();}
|
|
1
|
+
function a12_0x327b(_0x5154ec,_0x1683fa){_0x5154ec=_0x5154ec-0x158;const _0x384f47=a12_0x384f();let _0x327b62=_0x384f47[_0x5154ec];return _0x327b62;}const a12_0x11f068=a12_0x327b;(function(_0x2430ac,_0x73cb6e){const _0x4e0c77=a12_0x327b,_0x51674b=_0x2430ac();while(!![]){try{const _0x3e3992=-parseInt(_0x4e0c77(0x195))/0x1*(parseInt(_0x4e0c77(0x18e))/0x2)+parseInt(_0x4e0c77(0x17c))/0x3*(-parseInt(_0x4e0c77(0x18a))/0x4)+parseInt(_0x4e0c77(0x184))/0x5+-parseInt(_0x4e0c77(0x182))/0x6*(-parseInt(_0x4e0c77(0x176))/0x7)+parseInt(_0x4e0c77(0x173))/0x8*(-parseInt(_0x4e0c77(0x16c))/0x9)+-parseInt(_0x4e0c77(0x1ab))/0xa*(parseInt(_0x4e0c77(0x1a0))/0xb)+parseInt(_0x4e0c77(0x17a))/0xc;if(_0x3e3992===_0x73cb6e)break;else _0x51674b['push'](_0x51674b['shift']());}catch(_0x7a2ce0){_0x51674b['push'](_0x51674b['shift']());}}}(a12_0x384f,0x8f327));import{existsSync,mkdirSync,readFileSync,unlinkSync,writeFileSync}from'node:fs';import{dirname}from'node:path';import{homedir}from'node:os';import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG}from'../../constant/product.js';import{getUserDomain}from'../../constant/domain.js';import{CliErrors}from'../../errors.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';function resolveAuthScopeFlags(_0x1be922){const _0x2f517c=a12_0x327b;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x1be922[_0x2f517c(0x179)](_0x2f517c(0x1a2)),'explicitProject':_0x1be922[_0x2f517c(0x179)](_0x2f517c(0x196)),'policy':_0x2f517c(0x170)}));}const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/,DEVICE_CODE_TTL_MS=0x927c0,POLL_INTERVAL_MS=0xbb8,MAX_POLLS=0xc8,MAX_CONSECUTIVE_NETWORK_ERRORS=0x5;export function generateDeviceCode(){return crypto['randomUUID']();}export function buildDeviceAuthUrl(_0x1435e4,_0x55b03b,_0x3daa71='lovrabet-cli'){const _0x3c276b=a12_0x327b;return _0x1435e4+_0x3c276b(0x19c)+encodeURIComponent(_0x55b03b)+_0x3c276b(0x18c)+encodeURIComponent(_0x3daa71);}export function getDeviceCodePath(){const _0x28b750=a12_0x327b;return homedir()+'/'+PRODUCT_CONFIG[_0x28b750(0x197)]+'/.device-auth';}export function readStoredDeviceCode(){const _0x17f558=a12_0x327b,_0x485bdd=getDeviceCodePath();if(!existsSync(_0x485bdd))return null;try{const _0x51cfdc=readFileSync(_0x485bdd,{'encoding':_0x17f558(0x18d)}),_0x3398b5=JSON[_0x17f558(0x190)](_0x51cfdc);if(_0x3398b5&&typeof _0x3398b5[_0x17f558(0x15a)]===_0x17f558(0x191)&&typeof _0x3398b5[_0x17f558(0x19d)]===_0x17f558(0x191)&&(_0x3398b5['scope']==='global'||_0x3398b5[_0x17f558(0x174)]===_0x17f558(0x196)))return _0x3398b5;}catch{}return null;}export function writeStoredDeviceCode(_0x4adf9c,_0x5c13f5){const _0x423b56=a12_0x327b,_0x2e47ce=getDeviceCodePath(),_0x126f18=dirname(_0x2e47ce);!existsSync(_0x126f18)&&mkdirSync(_0x126f18,{'recursive':!![]});const _0x44a27d={'code':_0x4adf9c,'createdAt':new Date()[_0x423b56(0x160)](),'scope':_0x5c13f5};writeFileSync(_0x2e47ce,JSON[_0x423b56(0x185)](_0x44a27d),{'encoding':'utf8','mode':0x180});}export function deleteStoredDeviceCode(){const _0xea8dc8=getDeviceCodePath();try{unlinkSync(_0xea8dc8);}catch{}}export function isStoredDeviceCodeExpired(_0x538add){return Date['now']()-new Date(_0x538add['createdAt'])['getTime']()>DEVICE_CODE_TTL_MS;}export async function fetchDeviceToken(_0x20e8e5,_0x11b756){const _0x2f051e=a12_0x327b,_0x377ae9=_0x20e8e5+_0x2f051e(0x167),_0x2b6491=new AbortController(),_0x490c1c=setTimeout(()=>_0x2b6491['abort'](),0x2710),_0x33302a=await fetch(_0x377ae9,{'method':_0x2f051e(0x169),'headers':{'Content-Type':_0x2f051e(0x1a4)},'body':JSON[_0x2f051e(0x185)]({'code':_0x11b756}),'signal':_0x2b6491[_0x2f051e(0x15d)]});clearTimeout(_0x490c1c);if(!_0x33302a['ok'])throw CliErrors[_0x2f051e(0x178)](_0x2f051e(0x164)+_0x33302a[_0x2f051e(0x19b)]);const _0x21a849=await _0x33302a[_0x2f051e(0x175)](),_0x387df5=_0x21a849['data']&&typeof _0x21a849[_0x2f051e(0x163)]==='object'?_0x21a849[_0x2f051e(0x163)]:_0x21a849;if(!_0x387df5||typeof _0x387df5[_0x2f051e(0x19b)]!==_0x2f051e(0x191))throw CliErrors[_0x2f051e(0x15b)]('Invalid\x20device\x20auth\x20response');return{'status':_0x387df5[_0x2f051e(0x19b)],'access_key':typeof _0x387df5[_0x2f051e(0x15f)]===_0x2f051e(0x191)?_0x387df5['access_key']:undefined};}export async function pollDeviceToken(_0x46aa6d,_0x38323a,_0x4a75fe){const _0x17cbf6=a12_0x327b;let _0x4a15f3=0x0;for(let _0x58d050=0x0;_0x58d050<MAX_POLLS;_0x58d050++){if(_0x4a75fe[_0x17cbf6(0x188)])throw CliErrors['cancelled'](_0x17cbf6(0x17f));let _0x476976;try{_0x476976=await fetchDeviceToken(_0x46aa6d,_0x38323a);}catch(_0x1651f6){if(_0x1651f6 instanceof Error&&_0x1651f6[_0x17cbf6(0x161)]===_0x17cbf6(0x19f))throw CliErrors[_0x17cbf6(0x1aa)]('Device\x20authorization\x20cancelled.');_0x4a15f3++;if(_0x4a15f3>=MAX_CONSECUTIVE_NETWORK_ERRORS)throw CliErrors['networkError'](_0x17cbf6(0x17d));writeCliSideChannelLine(_0x17cbf6(0x1a1)+_0x4a15f3+'/'+MAX_CONSECUTIVE_NETWORK_ERRORS+_0x17cbf6(0x198)),await sleep(POLL_INTERVAL_MS);continue;}_0x4a15f3=0x0;if(_0x476976[_0x17cbf6(0x19b)]===_0x17cbf6(0x18b)){if(!_0x476976[_0x17cbf6(0x15f)])throw CliErrors[_0x17cbf6(0x15b)](_0x17cbf6(0x168));return _0x476976[_0x17cbf6(0x15f)];}if(_0x476976[_0x17cbf6(0x19b)]===_0x17cbf6(0x193)){deleteStoredDeviceCode();throw CliErrors['validation'](_0x17cbf6(0x19a));}const _0x4a8491=(_0x58d050+0x1)*POLL_INTERVAL_MS,_0x756e0e=DEVICE_CODE_TTL_MS-_0x4a8491,_0x163079=Math[_0x17cbf6(0x15e)](_0x756e0e/0xea60),_0x3e7078=Math[_0x17cbf6(0x15e)](_0x756e0e%0xea60/0x3e8);process[_0x17cbf6(0x1a9)][_0x17cbf6(0x19e)](_0x17cbf6(0x158)+_0x163079+':'+String(_0x3e7078)[_0x17cbf6(0x180)](0x2,'0')+_0x17cbf6(0x17e)),await sleep(POLL_INTERVAL_MS);}deleteStoredDeviceCode();throw CliErrors[_0x17cbf6(0x177)](_0x17cbf6(0x16f));}function sleep(_0x3832fc){return new Promise(_0x180a0b=>setTimeout(_0x180a0b,_0x3832fc));}function a12_0x384f(){const _0x230c60=['scope','json','1017723NVyHmh','validation','networkError','bool','28780596XgAiiI','removeListener','6HgMwGS','Device\x20auth\x20API\x20unreachable\x20after\x20multiple\x20retries.','\x20remaining','Device\x20authorization\x20cancelled.','padStart','nonInteractive','6uchvtP','AccessKey\x20saved\x20to\x20','5474125SJHzgO','stringify','Authorize\x20with\x20the\x20device-code\x20flow\x20(complete\x20in\x20the\x20browser;\x20no\x20copy-paste\x20required)','once','aborted','auth','2291048FXrSkB','success','&source=','utf8','4aLxOgx','trim','parse','string','log','expired','boolean','47537JkSjEI','project','homeDirName','),\x20retrying...','Waiting\x20for\x20authorization\x20(timeout:\x2010\x20minutes,\x20Ctrl+C\x20to\x20cancel)...','Device\x20code\x20expired.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','status','/device-auth?code=','createdAt','write','AbortError','4112471zkfqvE','Device\x20auth\x20API\x20error\x20(','global','Device\x20authorization\x20URL\x20printed.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20re-run.','application/json','\x20auth\x20status','test','lovrabet-cli','device','stderr','cancelled','30ItJHDB','\x0dWaiting\x20for\x20authorization...\x20','SIGINT','code','apiError','The\x20device\x20code\x20is\x20valid\x20for\x2010\x20minutes.','signal','floor','access_key','toISOString','name','accessKey','data','Device\x20auth\x20API\x20returned\x20HTTP\x20','Verify:\x20','After\x20authorizing,\x20re-run:\x20','/api/device-auth/token','Invalid\x20access_key\x20returned\x20by\x20server.','POST','App\x20name\x20shown\x20on\x20authorization\x20page\x20(default:\x20lovrabet)','\x20config.','261pcOFdu','url-only','\x20auth\x20device','Device\x20authorization\x20timed\x20out\x20after\x2010\x20minutes.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','global-default','str','source','190312uPoYXX'];a12_0x384f=function(){return _0x230c60;};return a12_0x384f();}export const authDeviceDefinition={'service':a12_0x11f068(0x189),'command':a12_0x11f068(0x1a8),'description':a12_0x11f068(0x186),'risk':a12_0x11f068(0x19e),'confirmationDescription':'Starts\x20the\x20device-code\x20login\x20flow.\x20On\x20success,\x20the\x20AccessKey\x20is\x20saved\x20to\x20the\x20selected\x20Lovrabet\x20config.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20the\x20device\x20code\x20or\x20secret.','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x11f068(0x1a2),'type':a12_0x11f068(0x194),'description':'Write\x20to\x20global\x20config\x20(default)','default':!![]},{'name':a12_0x11f068(0x196),'type':a12_0x11f068(0x194),'description':'Write\x20to\x20project\x20config','default':![]},{'name':a12_0x11f068(0x172),'type':a12_0x11f068(0x191),'description':a12_0x11f068(0x16a),'default':a12_0x11f068(0x1a7)},{'name':a12_0x11f068(0x16d),'type':a12_0x11f068(0x194),'description':'Print\x20URL\x20to\x20stdout\x20and\x20exit\x20(for\x20WorkBuddy\x20integration)','default':![]}],async 'execute'(_0x3234c2){const _0x2cbc20=a12_0x11f068,_0x72560=resolveAuthScopeFlags(_0x3234c2),_0x453d21=_0x72560['global']?_0x2cbc20(0x1a2):_0x2cbc20(0x196),_0x42ee49=readScopedConfig(_0x72560);if(_0x42ee49['accessKey'])return{'ok':!![],'message':'Already\x20authorized.\x20Use\x20`lovrabet\x20auth\x20status`\x20to\x20verify.'};const _0x128bc0=(_0x3234c2[_0x2cbc20(0x171)](_0x2cbc20(0x172))||_0x2cbc20(0x1a7))[_0x2cbc20(0x18f)](),_0x40e3e0=getUserDomain(),_0x1ab05e=readStoredDeviceCode(),_0xc51461=_0x1ab05e&&!isStoredDeviceCodeExpired(_0x1ab05e)?_0x1ab05e['code']:((()=>{const _0x5b806c=generateDeviceCode();return writeStoredDeviceCode(_0x5b806c,_0x453d21),_0x5b806c;})()),_0x420327=buildDeviceAuthUrl(_0x40e3e0,_0xc51461,_0x128bc0);if(_0x3234c2[_0x2cbc20(0x179)](_0x2cbc20(0x16d)))return console[_0x2cbc20(0x192)](_0x420327),{'ok':!![]};writeCliSideChannelLine('Open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20authorize:'),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x420327),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x2cbc20(0x15c));if(_0x3234c2[_0x2cbc20(0x181)])return writeCliSideChannelLine(_0x2cbc20(0x166)+CLI_BIN_NAME+_0x2cbc20(0x16e)),{'ok':!![],'message':_0x2cbc20(0x1a3)};writeCliSideChannelLine(_0x2cbc20(0x199));const _0x36fc6b=new AbortController(),_0xbeeae5=()=>{const _0x2c5725=_0x2cbc20;_0x36fc6b['abort'](),process[_0x2c5725(0x17b)](_0x2c5725(0x159),_0xbeeae5);};process[_0x2cbc20(0x187)](_0x2cbc20(0x159),_0xbeeae5);let _0x361dd1;try{_0x361dd1=await pollDeviceToken(_0x40e3e0,_0xc51461,_0x36fc6b[_0x2cbc20(0x15d)]);}finally{process[_0x2cbc20(0x17b)](_0x2cbc20(0x159),_0xbeeae5);}if(!ACCESS_KEY_PATTERN[_0x2cbc20(0x1a6)](_0x361dd1))throw CliErrors[_0x2cbc20(0x15b)](_0x2cbc20(0x168));const _0x2b1c2c=readScopedConfig(_0x72560);return _0x2b1c2c[_0x2cbc20(0x162)]=_0x361dd1,writeScopedConfig(_0x2b1c2c,_0x72560),deleteStoredDeviceCode(),process[_0x2cbc20(0x1a9)][_0x2cbc20(0x19e)]('\x0a'),writeCliSideChannelLine(_0x2cbc20(0x183)+_0x453d21+_0x2cbc20(0x16b)),writeCliSideChannelLine(_0x2cbc20(0x165)+CLI_BIN_NAME+_0x2cbc20(0x1a5)),{'ok':!![],'message':'Device\x20authorization\x20successful.'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a13_0x25b940=a13_0x37e8;(function(_0x1ccd36,_0x5c085d){const _0x12aeba=a13_0x37e8,_0x5a603f=_0x1ccd36();while(!![]){try{const _0x3cdc3a=-parseInt(_0x12aeba(0xb8))/0x1+-parseInt(_0x12aeba(0xe7))/0x2+parseInt(_0x12aeba(0xd1))/0x3+-parseInt(_0x12aeba(0xfc))/0x4+parseInt(_0x12aeba(0xe2))/0x5*(-parseInt(_0x12aeba(0xcf))/0x6)+parseInt(_0x12aeba(0x105))/0x7+parseInt(_0x12aeba(0xfb))/0x8;if(_0x3cdc3a===_0x5c085d)break;else _0x5a603f['push'](_0x5a603f['shift']());}catch(_0x5e0daa){_0x5a603f['push'](_0x5a603f['shift']());}}}(a13_0x55a2,0xca767));import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG,productEnvName}from'../../constant/product.js';import{AUTH_MODE}from'../../constant/auth-mode.js';function a13_0x37e8(_0x53ed1f,_0x2132cc){_0x53ed1f=_0x53ed1f-0xb4;const _0x55a261=a13_0x55a2();let _0x37e8d3=_0x55a261[_0x53ed1f];return _0x37e8d3;}import{normalizeEnv,isDaily,isDev,isProduction}from'../../constant/env.js';import{USER_ACCESS_KEY_CREATE_URL}from'../../constant/url.js';import{CliErrors}from'../../errors.js';import{promptAccessKey,isAbortPrompt}from'../../commands/auth/prompt.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{getLoginUserInfo}from'../../core/api-client.js';import{getUserDomain}from'../../constant/domain.js';import{authDeviceDefinition,readStoredDeviceCode,deleteStoredDeviceCode,fetchDeviceToken,isStoredDeviceCodeExpired}from'../../commands/auth/device.js';import{maskCliAccessKey}from'../../utils/access-key-redaction.js';const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/;function showAccessKeyCreateHint(_0x4dbcf2=USER_ACCESS_KEY_CREATE_URL){const _0x133147=a13_0x37e8;writeCliSideChannelLine('AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20'+PRODUCT_CONFIG[_0x133147(0xbd)]+':'),writeCliSideChannelLine('\x0a'+_0x4dbcf2+'\x0a'),writeCliSideChannelLine(_0x133147(0xb7)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x133147(0x10a));}function buildAccessKeySetupGuide(_0x4d70bb=USER_ACCESS_KEY_CREATE_URL){const _0x633180=a13_0x37e8;return[_0x633180(0xe3)+PRODUCT_CONFIG[_0x633180(0xbd)]+':',_0x4d70bb,_0x633180(0xc5)+CLI_BIN_NAME+_0x633180(0x100)][_0x633180(0xff)]('\x0a');}function canPromptForAccessKey(_0x1574bb){const _0x3ecdc9=a13_0x37e8;return!_0x1574bb[_0x3ecdc9(0x107)]&&process[_0x3ecdc9(0xc7)][_0x3ecdc9(0xca)]!==![]&&process[_0x3ecdc9(0xc2)][_0x3ecdc9(0xca)]!==![];}function resolveAuthScopeFlags(_0x2c40a0){const _0x513441=a13_0x37e8;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x2c40a0['bool'](_0x513441(0xeb)),'explicitProject':_0x2c40a0[_0x513441(0xe6)](_0x513441(0xb9)),'policy':_0x513441(0xd9)}));}async function resolveAuthWriteInput(_0x51db3c){const _0x437a04=a13_0x37e8;let _0xcbf9ac=(_0x51db3c['str'](_0x437a04(0xb4))||_0x51db3c[_0x437a04(0x101)]('ak')||'')[_0x437a04(0xde)]();const _0xa1c313=(_0x51db3c[_0x437a04(0x101)](_0x437a04(0xf0))||'')[_0x437a04(0xde)](),_0x2aae6c=''+getUserDomain()+PRODUCT_CONFIG[_0x437a04(0xf8)];if(!_0xcbf9ac&&canPromptForAccessKey(_0x51db3c))try{showAccessKeyCreateHint(_0x2aae6c),_0xcbf9ac=await promptAccessKey('');}catch(_0x4541be){if(isAbortPrompt(_0x4541be))throw CliErrors['cancelled']();throw _0x4541be;}if(!_0xcbf9ac)throw CliErrors[_0x437a04(0xdb)](_0x437a04(0xc8),buildAccessKeySetupGuide(_0x2aae6c));if(!ACCESS_KEY_PATTERN[_0x437a04(0xdd)](_0xcbf9ac))throw CliErrors[_0x437a04(0xdb)](_0x437a04(0xf9),_0x437a04(0xd2));if(!_0xa1c313)return{'accessKey':_0xcbf9ac};const _0xb10f81=normalizeEnv(_0xa1c313);return{'accessKey':_0xcbf9ac,'env':isDaily(_0xb10f81)?_0x437a04(0xcb):isDev(_0xb10f81)?'development':'production'};}function a13_0x55a2(){const _0x64b441=['\x20auth\x20login\x20--access-key\x20<ak_xxx>','Exit\x20non-zero\x20when\x20no\x20AccessKey\x20is\x20configured','Saves\x20a\x20user\x20AccessKey\x20to\x20the\x20selected\x20Lovrabet\x20config.\x20An\x20existing\x20key\x20in\x20that\x20scope\x20is\x20overwritten.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20the\x20secret.','read','access-key','Shorthand\x20for\x20--access-key','expired','Tip:\x20you\x20can\x20also\x20run:','1159874XZunhc','project','\x20config):\x20','info','global\x20config','userCenterDisplayName','\x20Current\x20env:\x20','No\x20AccessKey\x20found\x20in\x20','Read\x20from\x20global\x20config\x20(default)','code','stdout','Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','Clear\x20the\x20user\x20AccessKey\x20from\x20config','Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20','string','stdin','Missing\x20accessKey.','ClientAk','isTTY','daily','envName','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','Device\x20authorization\x20pending.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20try\x20again.','348WyUczm','AccessKey\x20(ak_xxx...)','2481750vAvMqv','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars','Show\x20current\x20authentication\x20status','write','login','`auth\x20login`\x20does\x20not\x20support\x20--yes.','Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','boolean','global-default','accessKeySource','validation','Auth\x20mode:\x20','test','trim','newConfigFileName','check','Option\x20C:\x20environment\x20variable','92185CEcIGW','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]','\x20auth\x20status','bool','1033524SRYXLG','production','status','logout','global','AccessKey:\x20','push','\x20config.\x20Nothing\x20to\x20clear.','yes','env','auth','Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','success','=ak_xxx','Status:\x20configured\x20(not\x20remotely\x20verified)','Environment:\x20','AccessKey\x20cleared\x20from\x20','accessKeyCreatePath','Invalid\x20accessKey\x20format.','\x20(via\x20','26910088HYekdj','2775892sadfkp','ACCESS_KEY','accessKey','join','\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','str','\x20config.','project\x20config','Option\x20A:\x20','547617OPhoqK','Save\x20the\x20user\x20AccessKey\x20(global\x20by\x20default;\x20--project\x20for\x20project\x20config)','nonInteractive','authRequired','access_key'];a13_0x55a2=function(){return _0x64b441;};return a13_0x55a2();}export const authDefinitions=[{'service':'auth','command':a13_0x25b940(0xd5),'description':a13_0x25b940(0x106),'risk':'write','confirmationDescription':a13_0x25b940(0x10c),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a13_0x25b940(0xb4),'type':'string','description':a13_0x25b940(0xd0)},{'name':'ak','type':a13_0x25b940(0xc6),'description':a13_0x25b940(0xb5)},{'name':a13_0x25b940(0xeb),'type':a13_0x25b940(0xd8),'description':'Write\x20to\x20global\x20config\x20(default)','default':!![]},{'name':a13_0x25b940(0xb9),'type':'boolean','description':'Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]}],async 'execute'(_0xc2ebee){const _0x20218d=a13_0x25b940;if(_0xc2ebee[_0x20218d(0xe6)](_0x20218d(0xef)))throw CliErrors[_0x20218d(0xdb)](_0x20218d(0xd6),'Use\x20`'+CLI_BIN_NAME+'\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`'+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.');const _0x21ba35=(_0xc2ebee['str'](_0x20218d(0xb4))||_0xc2ebee[_0x20218d(0x101)]('ak')||'')[_0x20218d(0xde)]();if(!_0x21ba35&&_0xc2ebee['nonInteractive'])return{'ok':!![],'message':buildAccessKeySetupGuide(''+getUserDomain()+PRODUCT_CONFIG[_0x20218d(0xf8)])};const _0x4c7b5f=await resolveAuthWriteInput(_0xc2ebee),_0xeea0a1=resolveAuthScopeFlags(_0xc2ebee),_0x46e04d=readScopedConfig(_0xeea0a1);_0x46e04d[_0x20218d(0xfe)]=_0x4c7b5f[_0x20218d(0xfe)];_0x4c7b5f[_0x20218d(0xf0)]&&(_0x46e04d['env']=_0x4c7b5f[_0x20218d(0xf0)]);writeScopedConfig(_0x46e04d,_0xeea0a1);const _0x529cd5=_0xeea0a1[_0x20218d(0xeb)]?_0x20218d(0xeb):_0x20218d(0xb9),_0x4caf89=_0x46e04d[_0x20218d(0xf0)]?_0x20218d(0xbe)+_0x46e04d['env']+'.':'';return{'ok':!![],'message':'AccessKey\x20saved\x20to\x20'+_0x529cd5+_0x20218d(0x102)+_0x4caf89+'\x20Verify:\x20'+CLI_BIN_NAME+_0x20218d(0xe5)};}},{'service':a13_0x25b940(0xf1),'command':a13_0x25b940(0xea),'description':a13_0x25b940(0xc4),'risk':a13_0x25b940(0xd4),'confirmationDescription':'Removes\x20the\x20user\x20AccessKey\x20from\x20the\x20selected\x20Lovrabet\x20config.\x20Credentials\x20in\x20another\x20scope\x20or\x20environment\x20variables\x20are\x20unchanged.','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a13_0x25b940(0xeb),'type':a13_0x25b940(0xd8),'description':'Clear\x20from\x20global\x20config\x20(default)','default':!![]},{'name':'project','type':a13_0x25b940(0xd8),'description':a13_0x25b940(0xd7),'default':![]}],async 'execute'(_0x4fda73){const _0x206f63=a13_0x25b940,_0x5b314e=resolveAuthScopeFlags(_0x4fda73),_0x28ab48=readScopedConfig(_0x5b314e),_0x42f917=!!_0x28ab48[_0x206f63(0xfe)];delete _0x28ab48['accessKey'],writeScopedConfig(_0x28ab48,_0x5b314e);const _0x5bc88c=_0x5b314e[_0x206f63(0xeb)]?_0x206f63(0xeb):_0x206f63(0xb9);if(_0x42f917)return{'ok':!![],'message':_0x206f63(0xf7)+_0x5bc88c+_0x206f63(0x102)};return{'ok':!![],'message':_0x206f63(0xbf)+_0x5bc88c+_0x206f63(0xee)};}},{'service':a13_0x25b940(0xf1),'command':'status','description':a13_0x25b940(0xd3),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a13_0x25b940(0xeb),'type':a13_0x25b940(0xd8),'description':a13_0x25b940(0xc0),'default':!![]},{'name':a13_0x25b940(0xb9),'type':'boolean','description':a13_0x25b940(0xf2),'default':![]},{'name':a13_0x25b940(0xe0),'type':a13_0x25b940(0xd8),'description':a13_0x25b940(0x10b),'default':![]}],async 'execute'(_0x4f53be){const _0x4be585=a13_0x25b940,_0x43a419=resolveAuthScopeFlags(_0x4f53be),_0x13f161=readScopedConfig(_0x43a419),_0x4e043a=productEnvName(_0x4be585(0xfd)),_0x213454=_0x4f53be[_0x4be585(0xfe)],_0x1e9cc6=_0x4f53be[_0x4be585(0xda)],_0x4b7fde=[_0x4be585(0xdc)+AUTH_MODE['ClientAk']];if(_0x4f53be[_0x4be585(0xcc)]&&!isProduction(_0x4f53be[_0x4be585(0xcc)]))_0x4b7fde[_0x4be585(0xed)](_0x4be585(0xf6)+_0x4f53be[_0x4be585(0xcc)]);_0x4b7fde[_0x4be585(0xed)]('Stored\x20AccessKey\x20('+(_0x43a419[_0x4be585(0xeb)]?_0x4be585(0xeb):'project')+_0x4be585(0xba)+(_0x13f161['accessKey']?maskCliAccessKey(_0x13f161['accessKey']):'(not\x20set)'));if(_0x213454){const _0x32d846=maskCliAccessKey(_0x213454);_0x4b7fde[_0x4be585(0xed)](_0x4be585(0xec)+_0x32d846+(_0x1e9cc6?_0x4be585(0xfa)+_0x1e9cc6+')':'')),_0x4b7fde['push'](_0x4be585(0xf5));}if(!_0x213454){_0x4b7fde['push'](''),_0x4b7fde[_0x4be585(0xed)](_0x4be585(0xcd)),_0x4b7fde['push'](''),_0x4b7fde['push'](_0x4be585(0x104)+CLI_BIN_NAME+_0x4be585(0xe4)),_0x4b7fde[_0x4be585(0xed)](''),_0x4b7fde[_0x4be585(0xed)]('Option\x20B:\x20apps\x20config\x20('+PRODUCT_CONFIG[_0x4be585(0xdf)]+')'),_0x4b7fde[_0x4be585(0xed)]('{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}'),_0x4b7fde['push'](''),_0x4b7fde[_0x4be585(0xed)](_0x4be585(0xe1)),_0x4b7fde[_0x4be585(0xed)]('\x20\x20export\x20'+_0x4e043a+_0x4be585(0xf4)),_0x4b7fde[_0x4be585(0xed)](''),_0x4b7fde[_0x4be585(0xed)]('Then\x20verify\x20with:\x20'+CLI_BIN_NAME+'\x20auth\x20status'),_0x4b7fde['push']('If\x20command\x20execution\x20still\x20fails,\x20run:\x20'+CLI_BIN_NAME+'\x20doctor');if(_0x4f53be[_0x4be585(0xe6)](_0x4be585(0xe0))){const _0x2cbd51=readStoredDeviceCode();if(_0x2cbd51&&!isStoredDeviceCodeExpired(_0x2cbd51)){const _0x48e74d=getUserDomain(),_0x330446=await fetchDeviceToken(_0x48e74d,_0x2cbd51[_0x4be585(0xc1)]);if(_0x330446[_0x4be585(0xe9)]===_0x4be585(0xf3)&&_0x330446[_0x4be585(0x109)]){const _0x44c28e={'global':_0x2cbd51['scope']===_0x4be585(0xeb)},_0xaf6f7=readScopedConfig(_0x44c28e);_0xaf6f7[_0x4be585(0xfe)]=_0x330446['access_key'],writeScopedConfig(_0xaf6f7,_0x44c28e),deleteStoredDeviceCode();const _0x576d49=_0x330446[_0x4be585(0x109)],_0x1d58b1=maskCliAccessKey(_0x576d49),_0x5ae762=_0x2cbd51['scope']===_0x4be585(0xeb)?_0x4be585(0xbc):_0x4be585(0x103);return{'ok':!![],'message':[_0x4be585(0xdc)+AUTH_MODE[_0x4be585(0xc9)],..._0x4f53be['envName']&&!isProduction(_0x4f53be[_0x4be585(0xcc)])?['Environment:\x20'+_0x4f53be[_0x4be585(0xcc)]]:[],'AccessKey:\x20'+_0x1d58b1+_0x4be585(0xfa)+_0x5ae762+')',_0x4be585(0xf5),'Device\x20authorization\x20completed.'][_0x4be585(0xff)]('\x0a')};}_0x330446[_0x4be585(0xe9)]===_0x4be585(0xb6)&&deleteStoredDeviceCode();throw CliErrors[_0x4be585(0x108)](_0x4be585(0xce));}throw CliErrors['authRequired'](_0x4b7fde[_0x4be585(0xff)]('\x0a'));}}return{'ok':!![],'message':_0x4b7fde['join']('\x0a')};}},{'service':a13_0x25b940(0xf1),'command':a13_0x25b940(0xbb),'description':a13_0x25b940(0xc3),'risk':a13_0x25b940(0x10d),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x4e3af0){const _0x1d9abf=a13_0x25b940,_0x466bcb=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x466bcb,'meta':{'env':_0x4e3af0['envName']??_0x1d9abf(0xe8)}}};}},authDeviceDefinition];
|
|
1
|
+
const a13_0x3f66ba=a13_0x5052;(function(_0x316dee,_0x478979){const _0x1e0d66=a13_0x5052,_0x278876=_0x316dee();while(!![]){try{const _0x3113f6=parseInt(_0x1e0d66(0x11a))/0x1+-parseInt(_0x1e0d66(0x126))/0x2+-parseInt(_0x1e0d66(0xe3))/0x3*(parseInt(_0x1e0d66(0xfb))/0x4)+parseInt(_0x1e0d66(0xd5))/0x5+parseInt(_0x1e0d66(0x118))/0x6+-parseInt(_0x1e0d66(0xd1))/0x7+-parseInt(_0x1e0d66(0x10b))/0x8;if(_0x3113f6===_0x478979)break;else _0x278876['push'](_0x278876['shift']());}catch(_0xc50b5f){_0x278876['push'](_0x278876['shift']());}}}(a13_0x2613,0xe95c3));import{readScopedConfig,writeScopedConfig}from'../../context.js';function a13_0x2613(){const _0x1b68ce=['Read\x20from\x20global\x20config\x20(default)','\x20auth\x20status','Tip:\x20you\x20can\x20also\x20run:','global-default','Environment:\x20','Auth\x20mode:\x20','671468lmgdYF','nonInteractive','push','accessKeyCreatePath','join','AccessKey\x20saved\x20to\x20','\x20Verify:\x20','12661908lCnsJz','status','str','auth','384535NulrSW','\x20config.\x20Nothing\x20to\x20clear.','envName','Exit\x20non-zero\x20when\x20no\x20AccessKey\x20is\x20configured','project','Use\x20`','\x20Current\x20env:\x20','\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.','boolean','ACCESS_KEY','Shorthand\x20for\x20--access-key','string','\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','accessKey','6RRAVvt','development','No\x20AccessKey\x20found\x20in\x20','Device\x20authorization\x20completed.','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','ClientAk','production','Missing\x20accessKey.','access-key','Invalid\x20accessKey\x20format.','Status:\x20configured\x20(not\x20remotely\x20verified)','Option\x20B:\x20apps\x20config\x20(','check','global','logout','read','\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]','scope','Write\x20to\x20global\x20config\x20(default)','isTTY','Show\x20current\x20authentication\x20status','newConfigFileName','AccessKey:\x20','Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20','511684KBQqen','\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars','access_key','validation','AccessKey\x20(ak_xxx...)','Option\x20C:\x20environment\x20variable','cancelled','accessKeySource','bool','\x20(via\x20','login','Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','If\x20command\x20execution\x20still\x20fails,\x20run:\x20','yes','=ak_xxx','65808lIHrVz','userCenterDisplayName','expired','trim','code','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','\x20config.','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','AccessKey\x20cleared\x20from\x20','Stored\x20AccessKey\x20(','env','\x20doctor','9090882VGaixW','authRequired','1772435KeyHME','Clear\x20the\x20user\x20AccessKey\x20from\x20config','project\x20config','Then\x20verify\x20with:\x20','daily','write'];a13_0x2613=function(){return _0x1b68ce;};return a13_0x2613();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG,productEnvName}from'../../constant/product.js';import{AUTH_MODE}from'../../constant/auth-mode.js';import{normalizeEnv,isDaily,isDev,isProduction}from'../../constant/env.js';import{USER_ACCESS_KEY_CREATE_URL}from'../../constant/url.js';import{CliErrors}from'../../errors.js';import{promptAccessKey,isAbortPrompt}from'../../commands/auth/prompt.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{getLoginUserInfo}from'../../core/api-client.js';import{getUserDomain}from'../../constant/domain.js';import{authDeviceDefinition,readStoredDeviceCode,deleteStoredDeviceCode,fetchDeviceToken,isStoredDeviceCodeExpired}from'../../commands/auth/device.js';import{maskCliAccessKey}from'../../utils/access-key-redaction.js';const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/;function showAccessKeyCreateHint(_0x141f25=USER_ACCESS_KEY_CREATE_URL){const _0x5a5ac5=a13_0x5052;writeCliSideChannelLine(_0x5a5ac5(0x110)+PRODUCT_CONFIG[_0x5a5ac5(0x10c)]+':'),writeCliSideChannelLine('\x0a'+_0x141f25+'\x0a'),writeCliSideChannelLine(_0x5a5ac5(0x122)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>');}function buildAccessKeySetupGuide(_0x39c7d0=USER_ACCESS_KEY_CREATE_URL){const _0x5f2267=a13_0x5052;return[_0x5f2267(0x110)+PRODUCT_CONFIG[_0x5f2267(0x10c)]+':',_0x39c7d0,_0x5f2267(0xfa)+CLI_BIN_NAME+_0x5f2267(0xe1)]['join']('\x0a');}function a13_0x5052(_0x2b584e,_0x564e16){_0x2b584e=_0x2b584e-0xcd;const _0x2613f1=a13_0x2613();let _0x5052ca=_0x2613f1[_0x2b584e];return _0x5052ca;}function canPromptForAccessKey(_0x129760){const _0x698b42=a13_0x5052;return!_0x129760[_0x698b42(0x127)]&&process['stdin'][_0x698b42(0xf6)]!==![]&&process['stdout'][_0x698b42(0xf6)]!==![];}function resolveAuthScopeFlags(_0x4286d6){const _0xf61b04=a13_0x5052;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x4286d6[_0xf61b04(0x104)](_0xf61b04(0xf0)),'explicitProject':_0x4286d6[_0xf61b04(0x104)](_0xf61b04(0xd9)),'policy':_0xf61b04(0x123)}));}async function resolveAuthWriteInput(_0x31620b){const _0xc897b=a13_0x5052;let _0x378e8f=(_0x31620b[_0xc897b(0xd3)](_0xc897b(0xeb))||_0x31620b[_0xc897b(0xd3)]('ak')||'')['trim']();const _0x5888ee=(_0x31620b[_0xc897b(0xd3)](_0xc897b(0x116))||'')[_0xc897b(0x10e)](),_0x47e488=''+getUserDomain()+PRODUCT_CONFIG[_0xc897b(0xcd)];if(!_0x378e8f&&canPromptForAccessKey(_0x31620b))try{showAccessKeyCreateHint(_0x47e488),_0x378e8f=await promptAccessKey('');}catch(_0x2ae6b6){if(isAbortPrompt(_0x2ae6b6))throw CliErrors[_0xc897b(0x102)]();throw _0x2ae6b6;}if(!_0x378e8f)throw CliErrors['validation'](_0xc897b(0xea),buildAccessKeySetupGuide(_0x47e488));if(!ACCESS_KEY_PATTERN['test'](_0x378e8f))throw CliErrors[_0xc897b(0xff)](_0xc897b(0xec),_0xc897b(0xfd));if(!_0x5888ee)return{'accessKey':_0x378e8f};const _0x30cc4e=normalizeEnv(_0x5888ee);return{'accessKey':_0x378e8f,'env':isDaily(_0x30cc4e)?_0xc897b(0x11e):isDev(_0x30cc4e)?_0xc897b(0xe4):_0xc897b(0xe9)};}export const authDefinitions=[{'service':a13_0x3f66ba(0xd4),'command':a13_0x3f66ba(0x106),'description':'Save\x20the\x20user\x20AccessKey\x20(global\x20by\x20default;\x20--project\x20for\x20project\x20config)','risk':'write','confirmationDescription':'Saves\x20a\x20user\x20AccessKey\x20to\x20the\x20selected\x20Lovrabet\x20config.\x20An\x20existing\x20key\x20in\x20that\x20scope\x20is\x20overwritten.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20the\x20secret.','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a13_0x3f66ba(0xeb),'type':a13_0x3f66ba(0xe0),'description':a13_0x3f66ba(0x100)},{'name':'ak','type':a13_0x3f66ba(0xe0),'description':a13_0x3f66ba(0xdf)},{'name':a13_0x3f66ba(0xf0),'type':a13_0x3f66ba(0xdd),'description':a13_0x3f66ba(0xf5),'default':!![]},{'name':a13_0x3f66ba(0xd9),'type':a13_0x3f66ba(0xdd),'description':a13_0x3f66ba(0x112),'default':![]}],async 'execute'(_0x1a6854){const _0x1528db=a13_0x3f66ba;if(_0x1a6854[_0x1528db(0x104)](_0x1528db(0x109)))throw CliErrors[_0x1528db(0xff)]('`auth\x20login`\x20does\x20not\x20support\x20--yes.',_0x1528db(0xda)+CLI_BIN_NAME+_0x1528db(0xfc)+CLI_BIN_NAME+_0x1528db(0xdc));const _0x21b3c7=(_0x1a6854[_0x1528db(0xd3)](_0x1528db(0xeb))||_0x1a6854[_0x1528db(0xd3)]('ak')||'')['trim']();if(!_0x21b3c7&&_0x1a6854['nonInteractive'])return{'ok':!![],'message':buildAccessKeySetupGuide(''+getUserDomain()+PRODUCT_CONFIG['accessKeyCreatePath'])};const _0x32712a=await resolveAuthWriteInput(_0x1a6854),_0x291c09=resolveAuthScopeFlags(_0x1a6854),_0x4ff49a=readScopedConfig(_0x291c09);_0x4ff49a[_0x1528db(0xe2)]=_0x32712a[_0x1528db(0xe2)];_0x32712a['env']&&(_0x4ff49a[_0x1528db(0x116)]=_0x32712a[_0x1528db(0x116)]);writeScopedConfig(_0x4ff49a,_0x291c09);const _0x5f4d9c=_0x291c09[_0x1528db(0xf0)]?_0x1528db(0xf0):'project',_0x2c167b=_0x4ff49a[_0x1528db(0x116)]?_0x1528db(0xdb)+_0x4ff49a[_0x1528db(0x116)]+'.':'';return{'ok':!![],'message':_0x1528db(0xcf)+_0x5f4d9c+_0x1528db(0x111)+_0x2c167b+_0x1528db(0xd0)+CLI_BIN_NAME+_0x1528db(0x121)};}},{'service':a13_0x3f66ba(0xd4),'command':a13_0x3f66ba(0xf1),'description':a13_0x3f66ba(0x11b),'risk':a13_0x3f66ba(0x11f),'confirmationDescription':'Removes\x20the\x20user\x20AccessKey\x20from\x20the\x20selected\x20Lovrabet\x20config.\x20Credentials\x20in\x20another\x20scope\x20or\x20environment\x20variables\x20are\x20unchanged.','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a13_0x3f66ba(0xf0),'type':a13_0x3f66ba(0xdd),'description':'Clear\x20from\x20global\x20config\x20(default)','default':!![]},{'name':a13_0x3f66ba(0xd9),'type':a13_0x3f66ba(0xdd),'description':'Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]}],async 'execute'(_0x8f5494){const _0x34ee9e=a13_0x3f66ba,_0x28985a=resolveAuthScopeFlags(_0x8f5494),_0x22ca70=readScopedConfig(_0x28985a),_0x5cb91a=!!_0x22ca70[_0x34ee9e(0xe2)];delete _0x22ca70[_0x34ee9e(0xe2)],writeScopedConfig(_0x22ca70,_0x28985a);const _0x4f72ec=_0x28985a[_0x34ee9e(0xf0)]?_0x34ee9e(0xf0):_0x34ee9e(0xd9);if(_0x5cb91a)return{'ok':!![],'message':_0x34ee9e(0x114)+_0x4f72ec+_0x34ee9e(0x111)};return{'ok':!![],'message':_0x34ee9e(0xe5)+_0x4f72ec+_0x34ee9e(0xd6)};}},{'service':a13_0x3f66ba(0xd4),'command':'status','description':a13_0x3f66ba(0xf7),'risk':a13_0x3f66ba(0xf2),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a13_0x3f66ba(0xf0),'type':'boolean','description':a13_0x3f66ba(0x120),'default':!![]},{'name':a13_0x3f66ba(0xd9),'type':'boolean','description':a13_0x3f66ba(0x107),'default':![]},{'name':a13_0x3f66ba(0xef),'type':a13_0x3f66ba(0xdd),'description':a13_0x3f66ba(0xd8),'default':![]}],async 'execute'(_0x1347e2){const _0x1ed3c5=a13_0x3f66ba,_0x1cd900=resolveAuthScopeFlags(_0x1347e2),_0x275f64=readScopedConfig(_0x1cd900),_0x1cab5a=productEnvName(_0x1ed3c5(0xde)),_0x860936=_0x1347e2[_0x1ed3c5(0xe2)],_0x5834be=_0x1347e2[_0x1ed3c5(0x103)],_0x5092d7=[_0x1ed3c5(0x125)+AUTH_MODE['ClientAk']];if(_0x1347e2[_0x1ed3c5(0xd7)]&&!isProduction(_0x1347e2[_0x1ed3c5(0xd7)]))_0x5092d7[_0x1ed3c5(0x128)]('Environment:\x20'+_0x1347e2[_0x1ed3c5(0xd7)]);_0x5092d7[_0x1ed3c5(0x128)](_0x1ed3c5(0x115)+(_0x1cd900['global']?_0x1ed3c5(0xf0):_0x1ed3c5(0xd9))+'\x20config):\x20'+(_0x275f64[_0x1ed3c5(0xe2)]?maskCliAccessKey(_0x275f64[_0x1ed3c5(0xe2)]):'(not\x20set)'));if(_0x860936){const _0x683316=maskCliAccessKey(_0x860936);_0x5092d7[_0x1ed3c5(0x128)](_0x1ed3c5(0xf9)+_0x683316+(_0x5834be?_0x1ed3c5(0x105)+_0x5834be+')':'')),_0x5092d7[_0x1ed3c5(0x128)](_0x1ed3c5(0xed));}if(!_0x860936){_0x5092d7[_0x1ed3c5(0x128)](''),_0x5092d7[_0x1ed3c5(0x128)](_0x1ed3c5(0xe7)),_0x5092d7[_0x1ed3c5(0x128)](''),_0x5092d7[_0x1ed3c5(0x128)]('Option\x20A:\x20'+CLI_BIN_NAME+_0x1ed3c5(0xf3)),_0x5092d7['push'](''),_0x5092d7[_0x1ed3c5(0x128)](_0x1ed3c5(0xee)+PRODUCT_CONFIG[_0x1ed3c5(0xf8)]+')'),_0x5092d7[_0x1ed3c5(0x128)](_0x1ed3c5(0x113)),_0x5092d7[_0x1ed3c5(0x128)](''),_0x5092d7[_0x1ed3c5(0x128)](_0x1ed3c5(0x101)),_0x5092d7['push']('\x20\x20export\x20'+_0x1cab5a+_0x1ed3c5(0x10a)),_0x5092d7[_0x1ed3c5(0x128)](''),_0x5092d7[_0x1ed3c5(0x128)](_0x1ed3c5(0x11d)+CLI_BIN_NAME+_0x1ed3c5(0x121)),_0x5092d7['push'](_0x1ed3c5(0x108)+CLI_BIN_NAME+_0x1ed3c5(0x117));if(_0x1347e2['bool'](_0x1ed3c5(0xef))){const _0x553450=readStoredDeviceCode();if(_0x553450&&!isStoredDeviceCodeExpired(_0x553450)){const _0x530d0c=getUserDomain(),_0x4cf837=await fetchDeviceToken(_0x530d0c,_0x553450[_0x1ed3c5(0x10f)]);if(_0x4cf837[_0x1ed3c5(0xd2)]==='success'&&_0x4cf837[_0x1ed3c5(0xfe)]){const _0x116331={'global':_0x553450[_0x1ed3c5(0xf4)]===_0x1ed3c5(0xf0)},_0x4c3457=readScopedConfig(_0x116331);_0x4c3457['accessKey']=_0x4cf837['access_key'],writeScopedConfig(_0x4c3457,_0x116331),deleteStoredDeviceCode();const _0x589785=_0x4cf837[_0x1ed3c5(0xfe)],_0x3996cb=maskCliAccessKey(_0x589785),_0x577f80=_0x553450[_0x1ed3c5(0xf4)]===_0x1ed3c5(0xf0)?'global\x20config':_0x1ed3c5(0x11c);return{'ok':!![],'message':[_0x1ed3c5(0x125)+AUTH_MODE[_0x1ed3c5(0xe8)],..._0x1347e2['envName']&&!isProduction(_0x1347e2[_0x1ed3c5(0xd7)])?[_0x1ed3c5(0x124)+_0x1347e2['envName']]:[],'AccessKey:\x20'+_0x3996cb+_0x1ed3c5(0x105)+_0x577f80+')','Status:\x20configured\x20(not\x20remotely\x20verified)',_0x1ed3c5(0xe6)]['join']('\x0a')};}_0x4cf837[_0x1ed3c5(0xd2)]===_0x1ed3c5(0x10d)&&deleteStoredDeviceCode();throw CliErrors[_0x1ed3c5(0x119)]('Device\x20authorization\x20pending.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20try\x20again.');}throw CliErrors[_0x1ed3c5(0x119)](_0x5092d7[_0x1ed3c5(0xce)]('\x0a'));}}return{'ok':!![],'message':_0x5092d7[_0x1ed3c5(0xce)]('\x0a')};}},{'service':a13_0x3f66ba(0xd4),'command':'info','description':'Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','risk':a13_0x3f66ba(0xf2),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x39bb37){const _0x5a4c9b=a13_0x3f66ba,_0x29e5bd=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x29e5bd,'meta':{'env':_0x39bb37[_0x5a4c9b(0xd7)]??_0x5a4c9b(0xe9)}}};}},authDeviceDefinition];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3b6d16,_0x334a07){const _0x26ffdd=a14_0x58d5,_0x1cd412=_0x3b6d16();while(!![]){try{const _0x4c956d=-parseInt(_0x26ffdd(0x156))/0x1*(-parseInt(_0x26ffdd(0x15e))/0x2)+parseInt(_0x26ffdd(0x152))/0x3+-parseInt(_0x26ffdd(0x158))/0x4+parseInt(_0x26ffdd(0x153))/0x5*(-parseInt(_0x26ffdd(0x157))/0x6)+parseInt(_0x26ffdd(0x151))/0x7+parseInt(_0x26ffdd(0x159))/0x8+-parseInt(_0x26ffdd(0x14f))/0x9*(parseInt(_0x26ffdd(0x160))/0xa);if(_0x4c956d===_0x334a07)break;else _0x1cd412['push'](_0x1cd412['shift']());}catch(_0x1d0f9b){_0x1cd412['push'](_0x1cd412['shift']());}}}(a14_0x5d74,0x1e852));import{createInterface}from'node:readline';class AbortPrompt extends Error{constructor(){const _0x289a75=a14_0x58d5;super(_0x289a75(0x15b)),this[_0x289a75(0x14e)]=_0x289a75(0x15f);}}function createSafeRl(){const _0xd194af=createInterface({'input':process['stdin'],'output':process['stdout']});let _0x1ea47c;const _0x1364a2=new Promise((_0x2260c0,_0x312bdd)=>{const _0x55a8a7=a14_0x58d5;_0x1ea47c=()=>{const _0x3efd15=a14_0x58d5;_0x1ea47c&&(_0xd194af[_0x3efd15(0x150)]('SIGINT',_0x1ea47c),_0x1ea47c=undefined);try{_0xd194af[_0x3efd15(0x15d)]();}catch{}_0x312bdd(new AbortPrompt());},_0xd194af[_0x55a8a7(0x14d)](_0x55a8a7(0x154),_0x1ea47c);}),_0x7d812b=()=>{_0x1ea47c&&(_0xd194af['removeListener']('SIGINT',_0x1ea47c),_0x1ea47c=undefined);try{_0xd194af['close']();}catch{}};return{'rl':_0xd194af,'abortPromise':_0x1364a2,'disposeSuccess':_0x7d812b};}function a14_0x58d5(_0x11a4b2,_0x524a04){_0x11a4b2=_0x11a4b2-0x14d;const _0x5d7485=a14_0x5d74();let _0x58d559=_0x5d7485[_0x11a4b2];return _0x58d559;}export async function promptAccessKey(_0x3c58b7=''){const _0x36f2da=a14_0x58d5,{rl:_0x1c93ed,abortPromise:_0x56c89a,disposeSuccess:_0x21970c}=createSafeRl(),_0x31d06b=new Promise(_0x4ef833=>{const _0x26348c=a14_0x58d5,_0x179b6e=_0x3c58b7?_0x26348c(0x155)+_0x3c58b7+'):\x20':'AccessKey\x20(paste\x20ak_...):\x20';_0x1c93ed['question'](_0x179b6e,_0x56204a=>{const _0x17f338=_0x26348c;_0x21970c(),_0x4ef833(_0x56204a[_0x17f338(0x15c)]()||_0x3c58b7);});});return Promise[_0x36f2da(0x15a)]([_0x31d06b,_0x56c89a]);}function a14_0x5d74(){const _0x40be54=['403568IFZZyX','AbortPrompt','329540jKQDNQ','once','name','81ZFIHzT','removeListener','1680294jdUrkP','721794dfuaph','903425LpSuaY','SIGINT','AccessKey\x20(','1vqpDeD','6uFnCUL','714680htSPEy','788216giXZVy','race','User\x20aborted\x20prompt','trim','close'];a14_0x5d74=function(){return _0x40be54;};return a14_0x5d74();}export function isAbortPrompt(_0x53e5e6){const _0x5d8788=a14_0x58d5;return _0x53e5e6 instanceof Error&&_0x53e5e6[_0x5d8788(0x14e)]===_0x5d8788(0x15f);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a15_0x3526c9=a15_0x33f7;function a15_0x5c35(){const _0x20d231=['functionName','2307vVrXuG','read','3160KAyhcd','version','12181568vHwbfB','Backend\x20Function\x20name','appCode','Get\x20a\x20Backend\x20Function\x20endpoint\x20contract\x20by\x20function\x20name','278995ipxlPf','13626GDEXbR','(none)','description','1135506xFKocA','bff','56bWAxzl','gmtModified','960655UizFwd','953376EKvkLR','552naPKqm','name'];a15_0x5c35=function(){return _0x20d231;};return a15_0x5c35();}(function(_0x4429f6,_0x27ed6c){const _0x196574=a15_0x33f7,_0x39e3b0=_0x4429f6();while(!![]){try{const _0x42c0c2=parseInt(_0x196574(0x137))/0x1+parseInt(_0x196574(0x139))/0x2*(parseInt(_0x196574(0x13c))/0x3)+parseInt(_0x196574(0x138))/0x4+parseInt(_0x196574(0x12f))/0x5+-parseInt(_0x196574(0x133))/0x6*(parseInt(_0x196574(0x135))/0x7)+parseInt(_0x196574(0x140))/0x8+parseInt(_0x196574(0x130))/0x9*(-parseInt(_0x196574(0x13e))/0xa);if(_0x42c0c2===_0x27ed6c)break;else _0x39e3b0['push'](_0x39e3b0['shift']());}catch(_0x4441f0){_0x39e3b0['push'](_0x39e3b0['shift']());}}}(a15_0x5c35,0xf37ba));import{getBffEndpointContract}from'../../core/api-client.js';import{NAME_FLAG}from'../../commands/common/flags.js';function a15_0x33f7(_0x55cc57,_0x144480){_0x55cc57=_0x55cc57-0x12f;const _0x5c35c8=a15_0x5c35();let _0x33f75c=_0x5c35c8[_0x55cc57];return _0x33f75c;}export const bffDetail={'service':a15_0x3526c9(0x134),'command':'detail','description':a15_0x3526c9(0x143),'risk':a15_0x3526c9(0x13d),'flags':[{...NAME_FLAG,'required':!![],'description':a15_0x3526c9(0x141)}],async 'execute'(_0x32b487){const _0x1544d8=a15_0x3526c9,_0x427344=await getBffEndpointContract(_0x32b487[_0x1544d8(0x142)],_0x32b487['str'](_0x1544d8(0x13a)));return{'ok':!![],'data':{'appCode':_0x427344[_0x1544d8(0x142)],'functionName':_0x427344[_0x1544d8(0x13b)],'description':_0x427344[_0x1544d8(0x132)]||_0x1544d8(0x131),'version':_0x427344[_0x1544d8(0x13f)],'gmtModified':_0x427344[_0x1544d8(0x136)]}};}};
|
package/lib/commands/bff/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a16_0x4a74(_0x465512,_0x13def3){_0x465512=_0x465512-0x18f;const _0x584d54=a16_0x584d();let _0x4a74f0=_0x584d54[_0x465512];return _0x4a74f0;}const a16_0x1737cb=a16_0x4a74;(function(_0x2ee9bd,_0x111db1){const _0x26a269=a16_0x4a74,_0x1bd3ce=_0x2ee9bd();while(!![]){try{const _0x3a5717=-parseInt(_0x26a269(0x192))/0x1*(parseInt(_0x26a269(0x195))/0x2)+parseInt(_0x26a269(0x19e))/0x3*(parseInt(_0x26a269(0x1a1))/0x4)+-parseInt(_0x26a269(0x197))/0x5*(parseInt(_0x26a269(0x196))/0x6)+-parseInt(_0x26a269(0x19d))/0x7+-parseInt(_0x26a269(0x191))/0x8*(parseInt(_0x26a269(0x18f))/0x9)+parseInt(_0x26a269(0x199))/0xa+parseInt(_0x26a269(0x19f))/0xb*(parseInt(_0x26a269(0x19b))/0xc);if(_0x3a5717===_0x111db1)break;else _0x1bd3ce['push'](_0x1bd3ce['shift']());}catch(_0x219572){_0x1bd3ce['push'](_0x1bd3ce['shift']());}}}(a16_0x584d,0x40a9c));function a16_0x584d(){const _0x495c72=['8392mITTUn','12961nmZqyL','Backend\x20Function\x20executed\x20in\x20','str','22rVhhYI','144240GgCrIL','5wRqxJy','exec','1656940yNQBcA','Backend\x20Function\x20name\x20to\x20execute','264744QSphMm','bff','1163967kyUTij','141jZuaqy','198JvlYxu','read','3688LspZmQ','name','now','72HrflRe','params'];a16_0x584d=function(){return _0x495c72;};return a16_0x584d();}import{executeSdkBff}from'../../core/sdk-client.js';import{parseJsonParams}from'../../utils/params.js';import{NAME_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';export const bffExec={'service':a16_0x1737cb(0x19c),'command':a16_0x1737cb(0x198),'description':'Execute\x20a\x20Backend\x20Function\x20script\x20by\x20function\x20name','risk':a16_0x1737cb(0x1a0),'flags':[{...NAME_FLAG,'required':!![],'description':a16_0x1737cb(0x19a)},PARAMS_FLAG],async 'execute'(_0x561b44){const _0x2c771c=a16_0x1737cb,_0x32948d=parseJsonParams(_0x561b44[_0x2c771c(0x194)](_0x2c771c(0x190))),_0x27e21f=Date[_0x2c771c(0x1a3)](),_0x64a1ee=await executeSdkBff(_0x561b44[_0x2c771c(0x194)](_0x2c771c(0x1a2)),_0x32948d),_0x2574a3=Date['now']()-_0x27e21f;return{'ok':!![],'data':{'result':_0x64a1ee,'elapsed':_0x2574a3},'message':_0x2c771c(0x193)+_0x2574a3+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x12dcdd,_0x400a2a){const _0x1445ea=a17_0x255e,_0x5dd3ee=_0x12dcdd();while(!![]){try{const _0x4cb8e1=-parseInt(_0x1445ea(0x67))/0x1*(parseInt(_0x1445ea(0x6c))/0x2)+-parseInt(_0x1445ea(0x68))/0x3+-parseInt(_0x1445ea(0x69))/0x4*(parseInt(_0x1445ea(0x70))/0x5)+parseInt(_0x1445ea(0x6d))/0x6*(-parseInt(_0x1445ea(0x6e))/0x7)+parseInt(_0x1445ea(0x6a))/0x8+-parseInt(_0x1445ea(0x6b))/0x9+parseInt(_0x1445ea(0x6f))/0xa;if(_0x4cb8e1===_0x400a2a)break;else _0x5dd3ee['push'](_0x5dd3ee['shift']());}catch(_0x480d85){_0x5dd3ee['push'](_0x5dd3ee['shift']());}}}(a17_0x5c62,0xa7af0));function a17_0x255e(_0x1325da,_0xb35615){_0x1325da=_0x1325da-0x67;const _0x5c62ff=a17_0x5c62();let _0x255e7a=_0x5c62ff[_0x1325da];return _0x255e7a;}function a17_0x5c62(){const _0x45b6b0=['42526470LHgoTG','990IpBlQH','951YFenhy','1142529bOsJGV','23624AFfQVR','1267696dXnyuu','9829386QOgOfW','678Hflxon','6EZDhwI','5316521gsczcl'];a17_0x5c62=function(){return _0x45b6b0;};return a17_0x5c62();}import{bffDetail}from'../../commands/bff/detail.js';import{bffExec}from'../../commands/bff/exec.js';export const bffDefinitions=[bffDetail,bffExec];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a18_0x5465(_0x1fb849,_0x500fbd){_0x1fb849=_0x1fb849-0x122;const _0x4dbe0b=a18_0x4dbe();let _0x546583=_0x4dbe0b[_0x1fb849];return _0x546583;}const a18_0x2e73ad=a18_0x5465;(function(_0xc3f039,_0x68ee45){const _0x1fd894=a18_0x5465,_0x5d2869=_0xc3f039();while(!![]){try{const _0x5e39f3=parseInt(_0x1fd894(0x138))/0x1*(-parseInt(_0x1fd894(0x135))/0x2)+parseInt(_0x1fd894(0x140))/0x3+-parseInt(_0x1fd894(0x123))/0x4*(-parseInt(_0x1fd894(0x12e))/0x5)+-parseInt(_0x1fd894(0x12b))/0x6*(-parseInt(_0x1fd894(0x139))/0x7)+-parseInt(_0x1fd894(0x137))/0x8*(-parseInt(_0x1fd894(0x12f))/0x9)+-parseInt(_0x1fd894(0x128))/0xa*(parseInt(_0x1fd894(0x144))/0xb)+-parseInt(_0x1fd894(0x131))/0xc;if(_0x5e39f3===_0x68ee45)break;else _0x5d2869['push'](_0x5d2869['shift']());}catch(_0x59306d){_0x5d2869['push'](_0x5d2869['shift']());}}}(a18_0x4dbe,0xc722a));import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';function a18_0x4dbe(){const _0x4a17b6=['INSTALL_FAILED','\x20installed','pipe','2372836yJnIzW','cwd','16wpVQLY','1UVoCPB','7pJdzxa','Install\x20the\x20built-in\x20CLI\x20Skill\x20required\x20by\x20Lovrabet\x20runtime','read','install','\x20at\x20','nonInteractive','\x20is\x20already\x20current','3383943nvdixJ','Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20npm\x20package.','repairCommand','cli-skill','22RZDrXY','unknown','112868Qylzah','inherit','CLI\x20Built-in\x20Skill\x20','setLogPath','code','5277880SqoZUD','skillVersion','info','2438232UKdemV','changed','Built-in\x20Skill\x20install\x20failed\x20[','145MJOHEp','4277313NbptME','installedPath','2946096sYREDj'];a18_0x4dbe=function(){return _0x4a17b6;};return a18_0x4dbe();}import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':a18_0x2e73ad(0x143),'command':a18_0x2e73ad(0x13c),'description':a18_0x2e73ad(0x13a),'risk':a18_0x2e73ad(0x13b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1f4628){const _0x17c6bd=a18_0x2e73ad;logger[_0x17c6bd(0x126)](process[_0x17c6bd(0x136)]()),logger[_0x17c6bd(0x12a)]('cli-skill-install',_0x17c6bd(0x141));const _0x33e222=installBuiltinSkill({'stdio':_0x1f4628[_0x17c6bd(0x13e)]?_0x17c6bd(0x134):_0x17c6bd(0x124)});if(!_0x33e222['ok'])throw CliErrors['apiError'](_0x17c6bd(0x12d)+(_0x33e222[_0x17c6bd(0x127)]||_0x17c6bd(0x132))+']:\x20'+(_0x33e222['error']||_0x17c6bd(0x122)),'Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20'+_0x33e222[_0x17c6bd(0x142)]);const _0xe45996=_0x33e222[_0x17c6bd(0x130)]?_0x17c6bd(0x13d)+_0x33e222['installedPath']:'';return console['log'](_0x33e222[_0x17c6bd(0x12c)]?_0x17c6bd(0x125)+_0x33e222[_0x17c6bd(0x129)]+_0x17c6bd(0x133)+_0xe45996:_0x17c6bd(0x125)+_0x33e222['skillVersion']+_0x17c6bd(0x13f)+_0xe45996),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a19_0x5579(_0x2c429e,_0x845ed4){_0x2c429e=_0x2c429e-0x15b;const _0x44c090=a19_0x44c0();let _0x5579e5=_0x44c090[_0x2c429e];return _0x5579e5;}(function(_0xa0ae95,_0x3158e7){const _0x1ad67e=a19_0x5579,_0x47dbe3=_0xa0ae95();while(!![]){try{const _0x257348=-parseInt(_0x1ad67e(0x15e))/0x1+parseInt(_0x1ad67e(0x15f))/0x2*(parseInt(_0x1ad67e(0x163))/0x3)+-parseInt(_0x1ad67e(0x160))/0x4+-parseInt(_0x1ad67e(0x162))/0x5+parseInt(_0x1ad67e(0x16c))/0x6+-parseInt(_0x1ad67e(0x15b))/0x7*(-parseInt(_0x1ad67e(0x168))/0x8)+parseInt(_0x1ad67e(0x169))/0x9*(-parseInt(_0x1ad67e(0x165))/0xa);if(_0x257348===_0x3158e7)break;else _0x47dbe3['push'](_0x47dbe3['shift']());}catch(_0x182220){_0x47dbe3['push'](_0x47dbe3['shift']());}}}(a19_0x44c0,0x5a602));import{PRODUCT_CONFIG}from'../../constant/product.js';export{DEFAULT_APP_PROFILE_NAME,DEFAULT_CONFIG_VALUES}from'../../constant/defaults.js';function a19_0x44c0(){const _0x212ce3=['1128412YDfSXq','1651768NtRMOc','Use\x20only\x20one\x20config\x20scope\x20flag.','1937285UnQkFA','3hSaevi','global-default','32320EdFEDi','Flags\x20--global\x20and\x20--project\x20are\x20mutually\x20exclusive.','global','3651816WBzWmG','207GGvfPj','newConfigFileName','Add\x20--global\x20to\x20write\x20to\x20~/','1414494lCEUZK','\x20(global)','project-or-global-explicit','Not\x20inside\x20a\x20project\x20(no\x20','validation','\x20found).','project','7XEjNmm','\x20first.','inProject','11519NnrslX'];a19_0x44c0=function(){return _0x212ce3;};return a19_0x44c0();}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';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(_0x2b3f70){const _0x1f4da1=a19_0x5579,{explicitGlobal:explicitGlobal=![],explicitProject:explicitProject=![],policy:_0x350fb2}=_0x2b3f70;if(explicitGlobal&&explicitProject)throw CliErrors[_0x1f4da1(0x170)](_0x1f4da1(0x166),_0x1f4da1(0x161));if(explicitGlobal)return _0x1f4da1(0x167);if(explicitProject)return _0x1f4da1(0x172);switch(_0x350fb2){case _0x1f4da1(0x164):return _0x1f4da1(0x167);case _0x1f4da1(0x16e):if(!(_0x2b3f70[_0x1f4da1(0x15d)]??isInProject()))throw CliErrors['validation'](_0x1f4da1(0x16f)+PRODUCT_CONFIG[_0x1f4da1(0x16a)]+_0x1f4da1(0x171),_0x1f4da1(0x16b)+PRODUCT_CONFIG[_0x1f4da1(0x16a)]+',\x20or\x20create\x20a\x20project-local\x20'+PRODUCT_CONFIG['newConfigFileName']+_0x1f4da1(0x15c));return _0x1f4da1(0x172);}}export function toScopeFlags(_0x56ddfc){return{'global':_0x56ddfc==='global'};}export function formatScopeLabel(_0x41d775){const _0x3d0e8e=a19_0x5579;return _0x41d775==='global'?_0x3d0e8e(0x16d):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5f5c08,_0x53bcc0){const _0x37af1b=a20_0x596b,_0x4801cf=_0x5f5c08();while(!![]){try{const _0x39d5ed=-parseInt(_0x37af1b(0x195))/0x1*(parseInt(_0x37af1b(0x18a))/0x2)+-parseInt(_0x37af1b(0x179))/0x3+-parseInt(_0x37af1b(0x18c))/0x4*(parseInt(_0x37af1b(0x186))/0x5)+-parseInt(_0x37af1b(0x183))/0x6*(parseInt(_0x37af1b(0x184))/0x7)+parseInt(_0x37af1b(0x18e))/0x8*(parseInt(_0x37af1b(0x191))/0x9)+-parseInt(_0x37af1b(0x190))/0xa*(-parseInt(_0x37af1b(0x181))/0xb)+parseInt(_0x37af1b(0x17b))/0xc*(parseInt(_0x37af1b(0x185))/0xd);if(_0x39d5ed===_0x53bcc0)break;else _0x4801cf['push'](_0x4801cf['shift']());}catch(_0x3721f8){_0x4801cf['push'](_0x4801cf['shift']());}}}(a20_0x49d1,0xa43b3));import{CliErrors}from'../../errors.js';function isSet(_0x21d460,_0x41ac26){const _0x3b74d5=a20_0x596b,_0x54739b=_0x21d460[_0x3b74d5(0x192)](_0x41ac26);return _0x54739b!==undefined&&_0x54739b!==''&&_0x54739b!==![]&&_0x54739b!==0x0;}function fmtNames(_0xd1dc93){const _0x4addf4=a20_0x596b;return _0xd1dc93['map'](_0x2bb4ae=>'--'+_0x2bb4ae)[_0x4addf4(0x18f)](',\x20');}export function requireOneOf(_0x3d2858,_0x34311c,_0x99eff7){const _0x20828f=a20_0x596b,_0x1db4ec=_0x34311c[_0x20828f(0x17c)](_0x4b9817=>isSet(_0x3d2858,_0x4b9817));if(_0x1db4ec[_0x20828f(0x17f)]!==0x1)throw CliErrors[_0x20828f(0x188)](_0x1db4ec[_0x20828f(0x17f)]===0x0?_0x20828f(0x187)+fmtNames(_0x34311c)+_0x20828f(0x17a)+_0x99eff7+'`.':_0x20828f(0x194)+fmtNames(_0x34311c)+_0x20828f(0x182)+fmtNames(_0x1db4ec)+'.',_0x1db4ec[_0x20828f(0x17f)]===0x0?_0x20828f(0x18b)+fmtNames(_0x34311c):_0x20828f(0x17d));}export function requireAnyOf(_0x5bc2af,_0x331887,_0x19f6d3){const _0x3efcaa=a20_0x596b;if(!_0x331887['some'](_0x1fb645=>isSet(_0x5bc2af,_0x1fb645)))throw CliErrors[_0x3efcaa(0x188)](_0x3efcaa(0x180)+fmtNames(_0x331887)+_0x3efcaa(0x17a)+_0x19f6d3+'`.',_0x3efcaa(0x18b)+fmtNames(_0x331887));}function a20_0x596b(_0xe81362,_0x113297){_0xe81362=_0xe81362-0x179;const _0x49d138=a20_0x49d1();let _0x596b59=_0x49d138[_0xe81362];return _0x596b59;}export function mutuallyExclusive(_0x3c7a19,_0x41c4dc,_0xe15b40){const _0x455ecf=a20_0x596b,_0xda9d46=_0x41c4dc[_0x455ecf(0x17c)](_0x5241a6=>isSet(_0x3c7a19,_0x5241a6));if(_0xda9d46['length']>0x1)throw CliErrors[_0x455ecf(0x188)]('Flags\x20'+fmtNames(_0xda9d46)+_0x455ecf(0x17e)+_0xe15b40+'`.',_0x455ecf(0x18d)+fmtNames(_0x41c4dc));}function a20_0x49d1(){const _0x1e8aaf=['\x20is\x20required\x20for\x20`','347676Pkzeut','filter','Remove\x20all\x20but\x20one.','\x20are\x20mutually\x20exclusive\x20for\x20`','length','At\x20least\x20one\x20of\x20','793144pAYvDZ','\x20is\x20allowed,\x20found:\x20','422286OZAbDk','21bpTIIJ','546ppOqDF','1732385SNAVvX','Exactly\x20one\x20of\x20','validation','test','12fmKQMz','Provide\x20one\x20of:\x20','4YrgfqA','Use\x20only\x20one\x20of:\x20','8fqrgYN','join','60XiSxdc','1866897DFXfbp','flag',':\x20expected\x20','Only\x20one\x20of\x20','40319zALbrU','1154094awoMwj'];a20_0x49d1=function(){return _0x1e8aaf;};return a20_0x49d1();}export function validatePattern(_0x267fc2,_0x4dec20,_0x118adb,_0x4d06ef){const _0x46be60=a20_0x596b,_0x1ec054=_0x267fc2['str'](_0x4dec20);if(_0x1ec054&&!_0x118adb[_0x46be60(0x189)](_0x1ec054))throw CliErrors[_0x46be60(0x188)]('Invalid\x20--'+_0x4dec20+_0x46be60(0x193)+_0x4d06ef+',\x20got\x20\x22'+_0x1ec054+'\x22.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a21_0x142587=a21_0x5d4d;(function(_0x506ed5,_0x66196f){const _0x4fe361=a21_0x5d4d,_0xa11f01=_0x506ed5();while(!![]){try{const _0x352453=parseInt(_0x4fe361(0x1a0))/0x1+-parseInt(_0x4fe361(0x1a1))/0x2*(parseInt(_0x4fe361(0x1a6))/0x3)+parseInt(_0x4fe361(0x19d))/0x4+parseInt(_0x4fe361(0x18e))/0x5+parseInt(_0x4fe361(0x1a8))/0x6+parseInt(_0x4fe361(0x197))/0x7*(-parseInt(_0x4fe361(0x194))/0x8)+-parseInt(_0x4fe361(0x1a4))/0x9*(parseInt(_0x4fe361(0x1a5))/0xa);if(_0x352453===_0x66196f)break;else _0xa11f01['push'](_0xa11f01['shift']());}catch(_0x323775){_0xa11f01['push'](_0xa11f01['shift']());}}}(a21_0x1074,0x57b1e));function a21_0x1074(){const _0x40d3ba=['verbose','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','boolean','a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588)','72tJXGSX','params','sqlcode','4928KoTBhg','Write\x20to\x20the\x20global\x20configuration','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','name','code','2686576DmavPx','number','Resource\x20ID','522503EdKFAL','10OfVZuD','Dataset\x20code\x20(32-char\x20hex\x20UUID)','Resource\x20name\x20for\x20lookup','7225461NPLBKh','20fQHehc','139623pOjZWs','global','2736288DcmhVk','2768510upcjlQ','string'];a21_0x1074=function(){return _0x40d3ba;};return a21_0x1074();}export const GLOBAL_SCOPE_FLAG={'name':a21_0x142587(0x1a7),'type':a21_0x142587(0x192),'default':![],'description':a21_0x142587(0x198)};export const CODE_FLAG={'name':a21_0x142587(0x19c),'type':a21_0x142587(0x18f),'required':!![],'description':a21_0x142587(0x1a2),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a21_0x142587(0x193)}};export const SQLCODE_FLAG={'name':a21_0x142587(0x196),'type':a21_0x142587(0x18f),'required':!![],'description':a21_0x142587(0x199),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a21_0x142587(0x191)}};function a21_0x5d4d(_0x4ecb30,_0x7dfa6d){_0x4ecb30=_0x4ecb30-0x18e;const _0x107496=a21_0x1074();let _0x5d4dd5=_0x107496[_0x4ecb30];return _0x5d4dd5;}export const VERBOSE_FLAG={'name':a21_0x142587(0x190),'type':'boolean','description':'Return\x20full\x20raw\x20response\x20object'};export const PARAMS_FLAG={'name':a21_0x142587(0x195),'type':a21_0x142587(0x18f),'description':a21_0x142587(0x19a)};export const NAME_FLAG={'name':a21_0x142587(0x19b),'type':'string','description':a21_0x142587(0x1a3)};export const ID_FLAG={'name':'id','type':a21_0x142587(0x19e),'required':!![],'description':a21_0x142587(0x19f)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x558084,_0x1ec693){const _0xfb549e=a22_0x1bab,_0x21f49f=_0x558084();while(!![]){try{const _0x52ef8e=parseInt(_0xfb549e(0x1d8))/0x1+-parseInt(_0xfb549e(0x1db))/0x2*(parseInt(_0xfb549e(0x1cf))/0x3)+parseInt(_0xfb549e(0x1d7))/0x4+-parseInt(_0xfb549e(0x1d1))/0x5+-parseInt(_0xfb549e(0x1cb))/0x6*(-parseInt(_0xfb549e(0x1dc))/0x7)+-parseInt(_0xfb549e(0x1d9))/0x8+parseInt(_0xfb549e(0x1cc))/0x9*(parseInt(_0xfb549e(0x1d3))/0xa);if(_0x52ef8e===_0x1ec693)break;else _0x21f49f['push'](_0x21f49f['shift']());}catch(_0x2be8f4){_0x21f49f['push'](_0x21f49f['shift']());}}}(a22_0x5d63,0x1a7c1));function a22_0x1bab(_0x3e1cff,_0x3e3f67){_0x3e1cff=_0x3e1cff-0x1cb;const _0x5d63ba=a22_0x5d63();let _0x1babe0=_0x5d63ba[_0x3e1cff];return _0x1babe0;}import{existsSync,statSync}from'node:fs';import{CliErrors}from'../../errors.js';const BYTES_PER_MB=0x400*0x400;export const RUNTIME_UPLOAD_MAX_BYTES=0x32*BYTES_PER_MB;function a22_0x5d63(){const _0x1158c0=['16034qjnMyA','48643hLhLVh','102YVndRW','21303qNvNqu','File\x20not\x20found:\x20','ceil','9TnyRyY','File\x20exceeds\x20the\x20runtime\x20upload\x20limit\x20of\x2050\x20MB:\x20','274225GAjhEw','validation','20NjGiOY','\x20MB','size','File\x20is\x20not\x20a\x20regular\x20file:\x20','399036sKuNTw','79750lwmAhC','919992YdvFnd','\x20path\x20is\x20required.'];a22_0x5d63=function(){return _0x1158c0;};return a22_0x5d63();}function formatBytes(_0x27be9b){const _0x39204d=a22_0x1bab;if(_0x27be9b>=BYTES_PER_MB){const _0x2275f6=Math[_0x39204d(0x1ce)](_0x27be9b/BYTES_PER_MB*0x64)/0x64;return _0x2275f6['toFixed'](0x2)+_0x39204d(0x1d4);}return _0x27be9b+'\x20B';}export function requireRuntimeUploadFile(_0x218c8c,_0x1b87cd){const _0x18590f=a22_0x1bab,_0x2faf2a=_0x218c8c['trim']();if(!_0x2faf2a)throw CliErrors[_0x18590f(0x1d2)](_0x1b87cd+_0x18590f(0x1da));if(!existsSync(_0x2faf2a))throw CliErrors['validation'](_0x18590f(0x1cd)+_0x2faf2a);const _0x36db24=statSync(_0x2faf2a);if(!_0x36db24['isFile']())throw CliErrors['validation'](_0x18590f(0x1d6)+_0x2faf2a);if(_0x36db24['size']>RUNTIME_UPLOAD_MAX_BYTES)throw CliErrors['validation'](_0x18590f(0x1d0)+_0x2faf2a+'\x20('+formatBytes(_0x36db24[_0x18590f(0x1d5)])+')');return{'path':_0x2faf2a,'size':_0x36db24[_0x18590f(0x1d5)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a23_0x5eb9d7=a23_0x12c6;(function(_0xaee3aa,_0x514fdf){const _0x586605=a23_0x12c6,_0x35ccc0=_0xaee3aa();while(!![]){try{const _0x574583=parseInt(_0x586605(0x1f8))/0x1+parseInt(_0x586605(0x1cf))/0x2+parseInt(_0x586605(0x1fd))/0x3+parseInt(_0x586605(0x1e1))/0x4*(-parseInt(_0x586605(0x1f3))/0x5)+-parseInt(_0x586605(0x201))/0x6*(-parseInt(_0x586605(0x1eb))/0x7)+parseInt(_0x586605(0x1e0))/0x8+-parseInt(_0x586605(0x1fb))/0x9*(parseInt(_0x586605(0x1ff))/0xa);if(_0x574583===_0x514fdf)break;else _0x35ccc0['push'](_0x35ccc0['shift']());}catch(_0x1f0e34){_0x35ccc0['push'](_0x35ccc0['shift']());}}}(a23_0x3c9e,0xab07a));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(_0x20a3a4){const _0x24747e=a23_0x12c6,_0x24b8ef=_0x20a3a4['split']('.');if(_0x24b8ef[_0x24747e(0x203)]!==0x3||_0x24b8ef[0x0]!=='apps'||_0x24b8ef[0x2]!==_0x24747e(0x20c))return undefined;const _0x14341b=_0x24b8ef[0x1]?.[_0x24747e(0x1d1)]();return _0x14341b?_0x14341b:undefined;}function parseAliasDeleteKey(_0x4bccdf){const _0x5261df=a23_0x12c6,_0x3de442=_0x4bccdf[_0x5261df(0x208)]('.');if(_0x3de442[_0x5261df(0x203)]===0x2&&_0x3de442[0x0]===_0x5261df(0x1ed)){const _0xb84bc5=_0x3de442[0x1]?.[_0x5261df(0x1d1)]();return _0xb84bc5?{'alias':_0xb84bc5}:undefined;}if(_0x3de442['length']===0x3&&_0x3de442[0x0]==='apps'&&_0x3de442[0x2]===_0x5261df(0x20c)){const _0x36e294=_0x3de442[0x1]?.[_0x5261df(0x1d1)]();return _0x36e294?{'alias':_0x36e294,'field':_0x5261df(0x20c)}:undefined;}return undefined;}function setLocalAppAlias(_0x169c27,_0x466441,_0x2d14a3){const _0x4f600e=a23_0x12c6,_0x16376f=_0x169c27[_0x4f600e(0x1ed)]&&typeof _0x169c27[_0x4f600e(0x1ed)]===_0x4f600e(0x1ec)&&!Array[_0x4f600e(0x204)](_0x169c27['apps'])?_0x169c27[_0x4f600e(0x1ed)]:{},_0x37fb53=_0x16376f[_0x466441]&&typeof _0x16376f[_0x466441]===_0x4f600e(0x1ec)&&!Array['isArray'](_0x16376f[_0x466441])?_0x16376f[_0x466441]:{};_0x37fb53['appcode']=_0x2d14a3,_0x16376f[_0x466441]=_0x37fb53,_0x169c27[_0x4f600e(0x1ed)]=_0x16376f;}function deleteLocalAppAlias(_0xa41618,_0x59caa7){const _0x3afe62=a23_0x12c6;if(!_0xa41618[_0x3afe62(0x1ed)]||typeof _0xa41618[_0x3afe62(0x1ed)]!==_0x3afe62(0x1ec)||Array['isArray'](_0xa41618[_0x3afe62(0x1ed)]))return![];const _0x285fc7=_0xa41618[_0x3afe62(0x1ed)],_0x1bbb2e=_0x285fc7[_0x59caa7[_0x3afe62(0x1e3)]];if(!_0x1bbb2e||typeof _0x1bbb2e!==_0x3afe62(0x1ec)||Array['isArray'](_0x1bbb2e))return![];if(!_0x59caa7[_0x3afe62(0x1f5)])return delete _0x285fc7[_0x59caa7[_0x3afe62(0x1e3)]],!![];if(!(_0x59caa7[_0x3afe62(0x1f5)]in _0x1bbb2e))return![];return delete _0x1bbb2e[_0x59caa7['field']],Object[_0x3afe62(0x205)](_0x1bbb2e)[_0x3afe62(0x203)]===0x0&&delete _0x285fc7[_0x59caa7['alias']],!![];}function a23_0x3c9e(){const _0xa16a8d=[';\x20apps.<alias>.appcode','Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US','Delete\x20a\x20configuration\x20value','8331208jSzpJV','963116QxkDif','(none)','alias','locale','Missing\x20key\x20argument.','Changes\x20Lovrabet\x20CLI\x20configuration.\x20Later\x20commands\x20may\x20use\x20a\x20different\x20app,\x20environment,\x20or\x20output\x20behavior.','log','Missing\x20key\x20or\x20value.','value','\x22\x20is\x20protected\x20and\x20cannot\x20be\x20changed\x20via\x20config\x20commands.','7kVrHbW','object','apps','bool','Get\x20a\x20config\x20value','\x20\x20global:\x20\x20','validation','config','5XiFMgB','Invalid\x20locale\x20value.','field','Key\x20already\x20absent:\x20','includes','1016296NylYAX','format','\x20(global)','29792403PzZxHq','list','2214531cEwomy','global','10MkTwFZ','Settable\x20keys:\x20','3911664BdmeSL','pageSize\x20must\x20be\x20a\x20positive\x20number','length','isArray','keys','raw','Usage:\x20','split','project-or-global-explicit','set','Top-level\x20key\x20\x22','appcode','\x20config\x20get\x20<key>','delete','pageSize','args','Deleted\x20`','1607532kmdfgD','Key\x20not\x20found:\x20','trim','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','\x20\x20project:\x20','../../context.js','accessKey','read','write','stringify','\x20config\x20delete\x20<key>\x20[--global]','Deletes\x20a\x20Lovrabet\x20CLI\x20config\x20key.\x20Later\x20commands\x20will\x20fall\x20back\x20to\x20another\x20config\x20layer\x20or\x20the\x20default.','key','get'];a23_0x3c9e=function(){return _0xa16a8d;};return a23_0x3c9e();}const listDef={'service':a23_0x5eb9d7(0x1f2),'command':a23_0x5eb9d7(0x1fc),'description':'List\x20current\x20config','risk':a23_0x5eb9d7(0x1d6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x5ba744){const _0x27c75e=a23_0x5eb9d7,{buildConfigFromFlags:_0xdbb089}=await import(_0x27c75e(0x1d4)),_0x339c84=_0xdbb089({}),_0x20fddf=redactCliConfigCredentials(_0x339c84[_0x27c75e(0x206)]),_0x324ef8=getProjectConfigPath(),_0x8dbc19=resolveWriteConfigPath(_0x27c75e(0x1fe));if(_0x5ba744[_0x27c75e(0x1f9)]==='pretty')return{'ok':!![],'message':_0x27c75e(0x1d2)+(JSON[_0x27c75e(0x1d8)](_0x20fddf,null,0x2)+'\x0a\x0a')+'Config\x20files:\x0a'+(_0x27c75e(0x1d3)+(_0x324ef8??_0x27c75e(0x1e2))+'\x0a')+(_0x27c75e(0x1f0)+_0x8dbc19)};return{'ok':!![],'data':{'effective':_0x20fddf,'configFiles':{'project':_0x324ef8??null,'global':_0x8dbc19}}};}},getDef={'service':a23_0x5eb9d7(0x1f2),'command':a23_0x5eb9d7(0x1dc),'description':a23_0x5eb9d7(0x1ef),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':'Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','required':!![]}],'flags':[],async 'execute'(_0x1caacb){const _0x2ebf32=a23_0x5eb9d7,_0x367a48=_0x1caacb[_0x2ebf32(0x1cd)][0x0];if(!_0x367a48)throw CliErrors['validation'](_0x2ebf32(0x1e5),'Usage:\x20'+CLI_BIN_NAME+_0x2ebf32(0x20d));const {buildConfigFromFlags:_0x544736}=await import(_0x2ebf32(0x1d4)),{raw:_0x2d7f78}=_0x544736({});if(_0x367a48['includes']('.')){const _0x51867f=_0x367a48[_0x2ebf32(0x208)]('.');let _0x1fda53=_0x2d7f78;for(const _0x30409e of _0x51867f){if(_0x1fda53==null||typeof _0x1fda53!=='object')throw CliErrors[_0x2ebf32(0x1f1)](_0x2ebf32(0x1d0)+_0x367a48);_0x1fda53=_0x1fda53[_0x30409e];}if(_0x1fda53===undefined)throw CliErrors[_0x2ebf32(0x1f1)](_0x2ebf32(0x1d0)+_0x367a48);const _0x4ffd6a=redactCliConfigValue(_0x367a48,_0x1fda53);return console[_0x2ebf32(0x1e7)](typeof _0x4ffd6a===_0x2ebf32(0x1ec)?JSON[_0x2ebf32(0x1d8)](_0x4ffd6a,null,0x2):String(_0x4ffd6a)),{'ok':!![]};}const _0x3e8c7f=_0x2d7f78[_0x367a48];if(_0x3e8c7f===undefined)throw CliErrors['validation'](_0x2ebf32(0x1d0)+_0x367a48);const _0x5057e3=redactCliConfigValue(_0x367a48,_0x3e8c7f);return console[_0x2ebf32(0x1e7)](typeof _0x5057e3==='object'?JSON[_0x2ebf32(0x1d8)](_0x5057e3,null,0x2):String(_0x5057e3)),{'ok':!![]};}},setDef={'service':a23_0x5eb9d7(0x1f2),'command':a23_0x5eb9d7(0x20a),'description':'Set\x20a\x20configuration\x20value','risk':a23_0x5eb9d7(0x1d7),'confirmationDescription':a23_0x5eb9d7(0x1e6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]},{'name':a23_0x5eb9d7(0x1e9),'description':'Value\x20to\x20assign','required':!![]}],'flags':[GLOBAL_SCOPE_FLAG],async 'execute'(_0x29da13){const _0x219d9f=a23_0x5eb9d7,_0x2ed654=_0x29da13[_0x219d9f(0x1cd)][0x0],_0xcdf669=_0x29da13['args'][0x1];if(!_0x2ed654||_0xcdf669===undefined)throw CliErrors[_0x219d9f(0x1f1)](_0x219d9f(0x1e8),_0x219d9f(0x207)+CLI_BIN_NAME+'\x20config\x20set\x20<key>\x20<value>\x20[--global]');if(ENUM_KEYS[_0x2ed654]&&!ENUM_KEYS[_0x2ed654][_0x219d9f(0x1f7)](_0xcdf669))throw CliErrors['validation']('Invalid\x20value\x20for\x20\x22'+_0x2ed654+'\x22.\x20Allowed:\x20'+ENUM_KEYS[_0x2ed654]['join'](',\x20'));if(isCliProtectedConfigKey(_0x2ed654))throw CliErrors[_0x219d9f(0x1f1)]('\x22'+_0x2ed654+_0x219d9f(0x1ea));if(_0x2ed654===_0x219d9f(0x1cc)){const _0x47d2eb=Number(_0xcdf669);if(isNaN(_0x47d2eb)||_0x47d2eb<=0x0)throw CliErrors[_0x219d9f(0x1f1)](_0x219d9f(0x202));}const _0x42b85f=resolveWriteScope({'explicitGlobal':_0x29da13[_0x219d9f(0x1ee)](_0x219d9f(0x1fe)),'policy':_0x219d9f(0x209)}),_0x3d4714=toScopeFlags(_0x42b85f),_0x53bd5d=readScopedConfig(_0x3d4714),_0x3d3c3f=parseAliasAppcodeSetKey(_0x2ed654);if(!_0x3d3c3f&&!isTopLevelConfigKey(_0x2ed654))throw CliErrors['validation'](_0x219d9f(0x20b)+_0x2ed654+'\x22\x20is\x20not\x20settable.',_0x219d9f(0x200)+getTopLevelConfigKeySummary()+_0x219d9f(0x1dd));if(_0x3d3c3f)setLocalAppAlias(_0x53bd5d,_0x3d3c3f,_0xcdf669);else{if(_0x2ed654===_0x219d9f(0x1e4)){const _0x2a6c90=normalizeLocale(_0xcdf669);if(!_0x2a6c90)throw CliErrors[_0x219d9f(0x1f1)](_0x219d9f(0x1f4),_0x219d9f(0x1de));_0x53bd5d[_0x219d9f(0x1e4)]=_0x2a6c90;}else _0x53bd5d[_0x2ed654]=_0x2ed654===_0x219d9f(0x1cc)?Number(_0xcdf669):DOMAIN_CONFIG_FIELDS[_0x219d9f(0x1f7)](_0x2ed654)?normalizeDomainOrigin(_0x2ed654,_0xcdf669):_0xcdf669;}const _0xccff77=_0x2ed654===_0x219d9f(0x1d5)?maskCliAccessKey(_0xcdf669):!_0x3d3c3f&&_0x2ed654==='locale'?String(_0x53bd5d[_0x219d9f(0x1e4)]):_0xcdf669;return console['log']('Set\x20`'+_0x2ed654+'`\x20=\x20\x22'+_0xccff77+'\x22'+(_0x42b85f==='global'?_0x219d9f(0x1fa):'')),writeScopedConfig(_0x53bd5d,_0x3d4714),{'ok':!![]};}},deleteDef={'service':'config','command':a23_0x5eb9d7(0x1cb),'description':a23_0x5eb9d7(0x1df),'risk':'write','confirmationDescription':a23_0x5eb9d7(0x1da),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a23_0x5eb9d7(0x1db),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_SCOPE_FLAG],async 'execute'(_0x64239e){const _0x325158=a23_0x5eb9d7,_0x1f4acd=_0x64239e[_0x325158(0x1cd)][0x0];if(!_0x1f4acd)throw CliErrors[_0x325158(0x1f1)](_0x325158(0x1e5),_0x325158(0x207)+CLI_BIN_NAME+_0x325158(0x1d9));if(isCliProtectedConfigKey(_0x1f4acd))throw CliErrors['validation']('\x22'+_0x1f4acd+_0x325158(0x1ea));const _0x156d6f=resolveWriteScope({'explicitGlobal':_0x64239e[_0x325158(0x1ee)]('global'),'policy':'project-or-global-explicit'}),_0x3a0642=toScopeFlags(_0x156d6f),_0x638078=readScopedConfig(_0x3a0642),_0x4be352=parseAliasDeleteKey(_0x1f4acd);if(_0x4be352){if(!deleteLocalAppAlias(_0x638078,_0x4be352))return console[_0x325158(0x1e7)](_0x325158(0x1f6)+_0x1f4acd+(_0x156d6f===_0x325158(0x1fe)?_0x325158(0x1fa):'')),{'ok':!![],'data':{'key':_0x1f4acd,'scope':_0x156d6f,'changed':![]}};return console['log'](_0x325158(0x1ce)+_0x1f4acd+'`'+(_0x156d6f===_0x325158(0x1fe)?'\x20(global)':'')),writeScopedConfig(_0x638078,_0x3a0642),{'ok':!![],'data':{'key':_0x1f4acd,'scope':_0x156d6f,'changed':!![]}};}if(_0x638078[_0x1f4acd]===undefined)return console[_0x325158(0x1e7)]('Key\x20already\x20absent:\x20'+_0x1f4acd+(_0x156d6f===_0x325158(0x1fe)?_0x325158(0x1fa):'')),{'ok':!![],'data':{'key':_0x1f4acd,'scope':_0x156d6f,'changed':![]}};return delete _0x638078[_0x1f4acd],console['log']('Deleted\x20`'+_0x1f4acd+'`'+(_0x156d6f===_0x325158(0x1fe)?_0x325158(0x1fa):'')),writeScopedConfig(_0x638078,_0x3a0642),{'ok':!![],'data':{'key':_0x1f4acd,'scope':_0x156d6f,'changed':!![]}};}};function a23_0x12c6(_0xa67fd2,_0x2e30be){_0xa67fd2=_0xa67fd2-0x1cb;const _0x3c9e54=a23_0x3c9e();let _0x12c6ab=_0x3c9e54[_0xa67fd2];return _0x12c6ab;}export const configDefinitions=[configInitDefinition,listDef,getDef,setDef,deleteDef];
|
|
1
|
+
const a23_0x815d93=a23_0x5d24;(function(_0x2aab6c,_0x4db086){const _0x2fbae7=a23_0x5d24,_0x43c771=_0x2aab6c();while(!![]){try{const _0x5f2d8d=-parseInt(_0x2fbae7(0x146))/0x1+parseInt(_0x2fbae7(0x134))/0x2+-parseInt(_0x2fbae7(0x139))/0x3+-parseInt(_0x2fbae7(0x126))/0x4*(-parseInt(_0x2fbae7(0x140))/0x5)+-parseInt(_0x2fbae7(0x159))/0x6+parseInt(_0x2fbae7(0x143))/0x7+-parseInt(_0x2fbae7(0x130))/0x8*(-parseInt(_0x2fbae7(0x14e))/0x9);if(_0x5f2d8d===_0x4db086)break;else _0x43c771['push'](_0x43c771['shift']());}catch(_0x27cfa3){_0x43c771['push'](_0x43c771['shift']());}}}(a23_0x25a7,0x6dc70));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_0x25a7(){const _0x1da108=['delete','\x20\x20global:\x20\x20','length','Top-level\x20key\x20\x22','5jNFhDm','isArray','\x20(global)','2773974AGWwyO','\x20config\x20delete\x20<key>\x20[--global]','Deleted\x20`','335737jGwapW','\x20\x20project:\x20','project-or-global-explicit','accessKey','Usage:\x20','trim',';\x20apps.<alias>.appcode','join','338319UrWSAQ','config','value','Key\x20not\x20found:\x20','(none)','Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US','write','includes','Missing\x20key\x20or\x20value.','stringify','apps','4233486KEjnar','\x22\x20is\x20protected\x20and\x20cannot\x20be\x20changed\x20via\x20config\x20commands.','\x22\x20is\x20not\x20settable.','Set\x20a\x20configuration\x20value','bool','Changes\x20Lovrabet\x20CLI\x20configuration.\x20Later\x20commands\x20may\x20use\x20a\x20different\x20app,\x20environment,\x20or\x20output\x20behavior.','Missing\x20key\x20argument.','Invalid\x20locale\x20value.','\x22.\x20Allowed:\x20','Deletes\x20a\x20Lovrabet\x20CLI\x20config\x20key.\x20Later\x20commands\x20will\x20fall\x20back\x20to\x20another\x20config\x20layer\x20or\x20the\x20default.','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','Get\x20a\x20config\x20value','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','Settable\x20keys:\x20','keys','read','Config\x20files:\x0a','pageSize\x20must\x20be\x20a\x20positive\x20number','validation','global','pretty','locale','991516nneIka','object','field','set','\x20config\x20set\x20<key>\x20<value>\x20[--global]','Key\x20already\x20absent:\x20','../../context.js','appcode','alias','args','296YGojZw','log','Set\x20`','split','420484EbdYWC','key','pageSize','raw','get','2262912DGgLJl','`\x20=\x20\x22','List\x20current\x20config'];a23_0x25a7=function(){return _0x1da108;};return a23_0x25a7();}function a23_0x5d24(_0xaff98,_0x3f7910){_0xaff98=_0xaff98-0x11f;const _0x25a7f6=a23_0x25a7();let _0x5d24cf=_0x25a7f6[_0xaff98];return _0x5d24cf;}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(_0x38c727){const _0x1a549a=a23_0x5d24,_0x4f5924=_0x38c727[_0x1a549a(0x133)]('.');if(_0x4f5924[_0x1a549a(0x13e)]!==0x3||_0x4f5924[0x0]!=='apps'||_0x4f5924[0x2]!==_0x1a549a(0x12d))return undefined;const _0x5a336c=_0x4f5924[0x1]?.[_0x1a549a(0x14b)]();return _0x5a336c?_0x5a336c:undefined;}function parseAliasDeleteKey(_0x42a989){const _0x31fff0=a23_0x5d24,_0x512fc8=_0x42a989[_0x31fff0(0x133)]('.');if(_0x512fc8[_0x31fff0(0x13e)]===0x2&&_0x512fc8[0x0]===_0x31fff0(0x158)){const _0x4c2fab=_0x512fc8[0x1]?.[_0x31fff0(0x14b)]();return _0x4c2fab?{'alias':_0x4c2fab}:undefined;}if(_0x512fc8[_0x31fff0(0x13e)]===0x3&&_0x512fc8[0x0]==='apps'&&_0x512fc8[0x2]==='appcode'){const _0x2ad6e0=_0x512fc8[0x1]?.[_0x31fff0(0x14b)]();return _0x2ad6e0?{'alias':_0x2ad6e0,'field':_0x31fff0(0x12d)}:undefined;}return undefined;}function setLocalAppAlias(_0x168887,_0x37359a,_0x2f95ce){const _0xdd206d=a23_0x5d24,_0x80f5b5=_0x168887['apps']&&typeof _0x168887[_0xdd206d(0x158)]===_0xdd206d(0x127)&&!Array[_0xdd206d(0x141)](_0x168887[_0xdd206d(0x158)])?_0x168887[_0xdd206d(0x158)]:{},_0x3c6ff0=_0x80f5b5[_0x37359a]&&typeof _0x80f5b5[_0x37359a]===_0xdd206d(0x127)&&!Array['isArray'](_0x80f5b5[_0x37359a])?_0x80f5b5[_0x37359a]:{};_0x3c6ff0[_0xdd206d(0x12d)]=_0x2f95ce,_0x80f5b5[_0x37359a]=_0x3c6ff0,_0x168887['apps']=_0x80f5b5;}function deleteLocalAppAlias(_0x417cb3,_0x4c2f28){const _0x109112=a23_0x5d24;if(!_0x417cb3[_0x109112(0x158)]||typeof _0x417cb3['apps']!==_0x109112(0x127)||Array[_0x109112(0x141)](_0x417cb3[_0x109112(0x158)]))return![];const _0x26c492=_0x417cb3['apps'],_0x5a3efe=_0x26c492[_0x4c2f28[_0x109112(0x12e)]];if(!_0x5a3efe||typeof _0x5a3efe!=='object'||Array[_0x109112(0x141)](_0x5a3efe))return![];if(!_0x4c2f28[_0x109112(0x128)])return delete _0x26c492[_0x4c2f28[_0x109112(0x12e)]],!![];if(!(_0x4c2f28[_0x109112(0x128)]in _0x5a3efe))return![];return delete _0x5a3efe[_0x4c2f28['field']],Object[_0x109112(0x167)](_0x5a3efe)['length']===0x0&&delete _0x26c492[_0x4c2f28[_0x109112(0x12e)]],!![];}const listDef={'service':a23_0x815d93(0x14f),'command':'list','description':a23_0x815d93(0x13b),'risk':a23_0x815d93(0x11f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x876784){const _0x171e00=a23_0x815d93,{buildConfigFromFlags:_0x4ed017}=await import(_0x171e00(0x12c)),_0x536ab1=_0x4ed017({}),_0x1a8ba5=redactCliConfigCredentials(_0x536ab1[_0x171e00(0x137)]),_0x2de59a=getProjectConfigPath(),_0x41873d=resolveWriteConfigPath(_0x171e00(0x123));if(_0x876784['format']===_0x171e00(0x124))return{'ok':!![],'message':_0x171e00(0x165)+(JSON[_0x171e00(0x157)](_0x1a8ba5,null,0x2)+'\x0a\x0a')+_0x171e00(0x120)+(_0x171e00(0x147)+(_0x2de59a??_0x171e00(0x152))+'\x0a')+(_0x171e00(0x13d)+_0x41873d)};return{'ok':!![],'data':{'effective':_0x1a8ba5,'configFiles':{'project':_0x2de59a??null,'global':_0x41873d}}};}},getDef={'service':a23_0x815d93(0x14f),'command':a23_0x815d93(0x138),'description':a23_0x815d93(0x164),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a23_0x815d93(0x135),'description':a23_0x815d93(0x163),'required':!![]}],'flags':[],async 'execute'(_0x188d19){const _0x1243d8=a23_0x815d93,_0x1666b0=_0x188d19[_0x1243d8(0x12f)][0x0];if(!_0x1666b0)throw CliErrors[_0x1243d8(0x122)](_0x1243d8(0x15f),_0x1243d8(0x14a)+CLI_BIN_NAME+'\x20config\x20get\x20<key>');const {buildConfigFromFlags:_0x479e49}=await import(_0x1243d8(0x12c)),{raw:_0x4cd425}=_0x479e49({});if(_0x1666b0['includes']('.')){const _0x41a43e=_0x1666b0[_0x1243d8(0x133)]('.');let _0xe16c47=_0x4cd425;for(const _0x509b49 of _0x41a43e){if(_0xe16c47==null||typeof _0xe16c47!==_0x1243d8(0x127))throw CliErrors[_0x1243d8(0x122)](_0x1243d8(0x151)+_0x1666b0);_0xe16c47=_0xe16c47[_0x509b49];}if(_0xe16c47===undefined)throw CliErrors[_0x1243d8(0x122)]('Key\x20not\x20found:\x20'+_0x1666b0);const _0x120f52=redactCliConfigValue(_0x1666b0,_0xe16c47);return console[_0x1243d8(0x131)](typeof _0x120f52===_0x1243d8(0x127)?JSON['stringify'](_0x120f52,null,0x2):String(_0x120f52)),{'ok':!![]};}const _0x2ddfc4=_0x4cd425[_0x1666b0];if(_0x2ddfc4===undefined)throw CliErrors[_0x1243d8(0x122)](_0x1243d8(0x151)+_0x1666b0);const _0x49cc57=redactCliConfigValue(_0x1666b0,_0x2ddfc4);return console['log'](typeof _0x49cc57===_0x1243d8(0x127)?JSON['stringify'](_0x49cc57,null,0x2):String(_0x49cc57)),{'ok':!![]};}},setDef={'service':'config','command':a23_0x815d93(0x129),'description':a23_0x815d93(0x15c),'risk':a23_0x815d93(0x154),'confirmationDescription':a23_0x815d93(0x15e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a23_0x815d93(0x135),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a23_0x815d93(0x150),'description':'Value\x20to\x20assign','required':!![]}],'flags':[GLOBAL_SCOPE_FLAG],async 'execute'(_0x1a95cd){const _0x4a67c3=a23_0x815d93,_0x39e58f=_0x1a95cd[_0x4a67c3(0x12f)][0x0],_0x16063b=_0x1a95cd[_0x4a67c3(0x12f)][0x1];if(!_0x39e58f||_0x16063b===undefined)throw CliErrors[_0x4a67c3(0x122)](_0x4a67c3(0x156),'Usage:\x20'+CLI_BIN_NAME+_0x4a67c3(0x12a));if(ENUM_KEYS[_0x39e58f]&&!ENUM_KEYS[_0x39e58f][_0x4a67c3(0x155)](_0x16063b))throw CliErrors[_0x4a67c3(0x122)]('Invalid\x20value\x20for\x20\x22'+_0x39e58f+_0x4a67c3(0x161)+ENUM_KEYS[_0x39e58f][_0x4a67c3(0x14d)](',\x20'));if(isCliProtectedConfigKey(_0x39e58f))throw CliErrors[_0x4a67c3(0x122)]('\x22'+_0x39e58f+_0x4a67c3(0x15a));if(_0x39e58f===_0x4a67c3(0x136)){const _0xef4b42=Number(_0x16063b);if(isNaN(_0xef4b42)||_0xef4b42<=0x0)throw CliErrors[_0x4a67c3(0x122)](_0x4a67c3(0x121));}const _0x45b419=resolveWriteScope({'explicitGlobal':_0x1a95cd[_0x4a67c3(0x15d)](_0x4a67c3(0x123)),'policy':'project-or-global-explicit'}),_0x593eb1=toScopeFlags(_0x45b419),_0x16041c=readScopedConfig(_0x593eb1),_0x45ff2b=parseAliasAppcodeSetKey(_0x39e58f);if(!_0x45ff2b&&!isTopLevelConfigKey(_0x39e58f))throw CliErrors[_0x4a67c3(0x122)](_0x4a67c3(0x13f)+_0x39e58f+_0x4a67c3(0x15b),_0x4a67c3(0x166)+getTopLevelConfigKeySummary()+_0x4a67c3(0x14c));if(_0x45ff2b)setLocalAppAlias(_0x16041c,_0x45ff2b,_0x16063b);else{if(_0x39e58f==='locale'){const _0xa0572b=normalizeLocale(_0x16063b);if(!_0xa0572b)throw CliErrors[_0x4a67c3(0x122)](_0x4a67c3(0x160),_0x4a67c3(0x153));_0x16041c[_0x4a67c3(0x125)]=_0xa0572b;}else _0x16041c[_0x39e58f]=_0x39e58f===_0x4a67c3(0x136)?Number(_0x16063b):DOMAIN_CONFIG_FIELDS['includes'](_0x39e58f)?normalizeDomainOrigin(_0x39e58f,_0x16063b):_0x16063b;}const _0x233a60=_0x39e58f===_0x4a67c3(0x149)?maskCliAccessKey(_0x16063b):!_0x45ff2b&&_0x39e58f===_0x4a67c3(0x125)?String(_0x16041c[_0x4a67c3(0x125)]):_0x16063b;return console[_0x4a67c3(0x131)](_0x4a67c3(0x132)+_0x39e58f+_0x4a67c3(0x13a)+_0x233a60+'\x22'+(_0x45b419==='global'?_0x4a67c3(0x142):'')),writeScopedConfig(_0x16041c,_0x593eb1),{'ok':!![]};}},deleteDef={'service':a23_0x815d93(0x14f),'command':a23_0x815d93(0x13c),'description':'Delete\x20a\x20configuration\x20value','risk':a23_0x815d93(0x154),'confirmationDescription':a23_0x815d93(0x162),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a23_0x815d93(0x135),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_SCOPE_FLAG],async 'execute'(_0x5d70e4){const _0x1c7296=a23_0x815d93,_0x96dfd5=_0x5d70e4[_0x1c7296(0x12f)][0x0];if(!_0x96dfd5)throw CliErrors[_0x1c7296(0x122)](_0x1c7296(0x15f),_0x1c7296(0x14a)+CLI_BIN_NAME+_0x1c7296(0x144));if(isCliProtectedConfigKey(_0x96dfd5))throw CliErrors[_0x1c7296(0x122)]('\x22'+_0x96dfd5+'\x22\x20is\x20protected\x20and\x20cannot\x20be\x20changed\x20via\x20config\x20commands.');const _0x387a9c=resolveWriteScope({'explicitGlobal':_0x5d70e4[_0x1c7296(0x15d)](_0x1c7296(0x123)),'policy':_0x1c7296(0x148)}),_0x5a8805=toScopeFlags(_0x387a9c),_0x4ce9f4=readScopedConfig(_0x5a8805),_0x4337a1=parseAliasDeleteKey(_0x96dfd5);if(_0x4337a1){if(!deleteLocalAppAlias(_0x4ce9f4,_0x4337a1))return console[_0x1c7296(0x131)](_0x1c7296(0x12b)+_0x96dfd5+(_0x387a9c===_0x1c7296(0x123)?_0x1c7296(0x142):'')),{'ok':!![],'data':{'key':_0x96dfd5,'scope':_0x387a9c,'changed':![]}};return console[_0x1c7296(0x131)](_0x1c7296(0x145)+_0x96dfd5+'`'+(_0x387a9c==='global'?_0x1c7296(0x142):'')),writeScopedConfig(_0x4ce9f4,_0x5a8805),{'ok':!![],'data':{'key':_0x96dfd5,'scope':_0x387a9c,'changed':!![]}};}if(_0x4ce9f4[_0x96dfd5]===undefined)return console['log'](_0x1c7296(0x12b)+_0x96dfd5+(_0x387a9c==='global'?_0x1c7296(0x142):'')),{'ok':!![],'data':{'key':_0x96dfd5,'scope':_0x387a9c,'changed':![]}};return delete _0x4ce9f4[_0x96dfd5],console[_0x1c7296(0x131)](_0x1c7296(0x145)+_0x96dfd5+'`'+(_0x387a9c===_0x1c7296(0x123)?_0x1c7296(0x142):'')),writeScopedConfig(_0x4ce9f4,_0x5a8805),{'ok':!![],'data':{'key':_0x96dfd5,'scope':_0x387a9c,'changed':!![]}};}};export const configDefinitions=[configInitDefinition,listDef,getDef,setDef,deleteDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x77e274=a24_0xfe72;(function(_0x354ddf,_0x2f4c73){const _0x25593a=a24_0xfe72,_0x1a0525=_0x354ddf();while(!![]){try{const _0x1e2bd7=-parseInt(_0x25593a(0xe0))/0x1+parseInt(_0x25593a(0x10e))/0x2*(parseInt(_0x25593a(0x106))/0x3)+parseInt(_0x25593a(0xea))/0x4*(parseInt(_0x25593a(0x108))/0x5)+-parseInt(_0x25593a(0x10d))/0x6*(-parseInt(_0x25593a(0xe2))/0x7)+parseInt(_0x25593a(0xf5))/0x8*(parseInt(_0x25593a(0xfa))/0x9)+parseInt(_0x25593a(0xdf))/0xa+-parseInt(_0x25593a(0xe5))/0xb;if(_0x1e2bd7===_0x2f4c73)break;else _0x1a0525['push'](_0x1a0525['shift']());}catch(_0x182b53){_0x1a0525['push'](_0x1a0525['shift']());}}}(a24_0x831e,0xe19df));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';function a24_0x831e(){const _0x39f937=['208854OjPMpO','72XBGCMY','write','name','routing','4588690sprHMK','816538pPhCuP','Lovrabet\x20connection\x20configured\x20for\x20independent\x20deployment.\x20Domains:\x20','98UyasgO','Lovrabet\x20connection\x20configured\x20for\x20region:\x20','kb-service-domain','24304071owzwWc','Official\x20Lovrabet\x20region:\x20','assign','validation','enterprise-v1','2056eOSTgW','manifestDomains','Region\x20\x22','label','runtime-domain','map','string','official','\x22\x20is\x20not\x20currently\x20available.','Independent-deployment\x20Domain\x20JSON\x20file','Select\x20Lovrabet\x20region','24OBRUsZ','Available\x20regions:\x20','harness-domain','Custom\x20SkillHub\x20HTTPS\x20origin','Initialize\x20the\x20global\x20Lovrabet\x20region\x20or\x20independent-deployment\x20Domains','4532535HtFwuJ','cancelled','str','config','length','Custom\x20Runtime\x20HTTPS\x20origin','region','independent','domains','Choose\x20either\x20an\x20official\x20region\x20or\x20independent-deployment\x20Domains,\x20not\x20both.','Custom\x20platform\x20API\x20HTTPS\x20origin','api-domain','92256KRAIir','ExitPromptError','3755YlnwRO','keys','mode','join','domain-config'];a24_0x831e=function(){return _0x39f937;};return a24_0x831e();}import{OFFICIAL_ROUTING_PROFILES}from'../../generated/official-routing.js';const domainFlags=[{'name':a24_0x77e274(0x10c),'type':'string','description':a24_0x77e274(0xf3)},{'name':'user-domain','type':a24_0x77e274(0xf0),'description':'Custom\x20User\x20HTTPS\x20origin'},{'name':a24_0x77e274(0x105),'type':'string','description':a24_0x77e274(0x104)},{'name':a24_0x77e274(0xee),'type':a24_0x77e274(0xf0),'description':a24_0x77e274(0xff)},{'name':'skill-domain','type':a24_0x77e274(0xf0),'description':a24_0x77e274(0xf8)},{'name':a24_0x77e274(0xe4),'type':'string','description':'Custom\x20KB\x20Service\x20HTTPS\x20origin'},{'name':a24_0x77e274(0xf7),'type':a24_0x77e274(0xf0),'description':'Custom\x20Harness\x20HTTPS\x20origin'}];export const configInitFlags=[{'name':a24_0x77e274(0x100),'type':a24_0x77e274(0xf0),'description':a24_0x77e274(0xe6)+ENABLED_LOVRABET_REGION_VALUES[a24_0x77e274(0x10b)](',\x20'),'enum':[...ENABLED_LOVRABET_REGION_VALUES]},...domainFlags];async function resolveRegion(_0x190b46){const _0x1110e2=a24_0x77e274,_0x329da5=_0x190b46[_0x1110e2(0xfc)](_0x1110e2(0x100));if(_0x329da5){if(!isEnabledLovrabetRegion(_0x329da5))throw CliErrors[_0x1110e2(0xe8)](_0x1110e2(0xec)+_0x329da5+_0x1110e2(0xf2),_0x1110e2(0xf6)+ENABLED_LOVRABET_REGION_VALUES[_0x1110e2(0x10b)](',\x20'));return _0x329da5;}if(_0x190b46['nonInteractive'])return DEFAULT_LOVRABET_REGION;try{return await select({'message':_0x1110e2(0xf4),'default':DEFAULT_LOVRABET_REGION,'choices':ENABLED_LOVRABET_REGION_VALUES[_0x1110e2(0xef)](_0x503fa1=>({'name':OFFICIAL_ROUTING_PROFILES[_0x503fa1][_0x1110e2(0xed)]+'\x20('+_0x503fa1+')','value':_0x503fa1}))});}catch(_0x1242a5){if(_0x1242a5?.[_0x1110e2(0xdd)]===_0x1110e2(0x107))throw CliErrors[_0x1110e2(0xfb)]();throw _0x1242a5;}}export async function executeConfigInit(_0x36f8d7){const _0x93c5ef=a24_0x77e274,_0x575782=resolveDomainConfigInput(_0x36f8d7),_0x41efee=_0x575782[_0x93c5ef(0x102)],_0x34ef5a=Object[_0x93c5ef(0x109)](_0x41efee)[_0x93c5ef(0xfe)]>0x0||_0x575782[_0x93c5ef(0x10a)]===_0x93c5ef(0xe9);if(_0x34ef5a&&_0x36f8d7[_0x93c5ef(0xfc)](_0x93c5ef(0x100)))throw CliErrors[_0x93c5ef(0xe8)](_0x93c5ef(0x103));const _0x2f2bcb={'global':!![]},_0x5687ac=readScopedConfig(_0x2f2bcb);for(const _0x46499d of DOMAIN_CONFIG_FIELDS)delete _0x5687ac[_0x46499d];for(const _0x161661 of LEGACY_DOMAIN_CONFIG_FIELDS)delete _0x5687ac[_0x161661];delete _0x5687ac['routing'];let _0x520c95=null;if(_0x34ef5a)delete _0x5687ac[_0x93c5ef(0x100)],_0x575782[_0x93c5ef(0x10a)]==='enterprise-v1'?_0x5687ac[_0x93c5ef(0xde)]={'protocol':ENTERPRISE_ROUTING_PROTOCOL,'kind':ENTERPRISE_ROUTING_KIND,'domains':_0x575782[_0x93c5ef(0xeb)]}:Object[_0x93c5ef(0xe7)](_0x5687ac,_0x41efee);else{_0x520c95=await resolveRegion(_0x36f8d7);if(_0x520c95===DEFAULT_LOVRABET_REGION)delete _0x5687ac['region'];else _0x5687ac[_0x93c5ef(0x100)]=_0x520c95;}return writeScopedConfig(_0x5687ac,_0x2f2bcb),{'ok':!![],'message':_0x34ef5a?_0x93c5ef(0xe1)+Object[_0x93c5ef(0x109)](_0x575782['mode']===_0x93c5ef(0xe9)?_0x575782[_0x93c5ef(0xeb)]:_0x41efee)[_0x93c5ef(0x10b)](',\x20')+'.':_0x93c5ef(0xe3)+_0x520c95+'.','data':{'mode':_0x34ef5a?_0x93c5ef(0x101):_0x93c5ef(0xf1),'protocol':_0x575782[_0x93c5ef(0x10a)]==='enterprise-v1'?ENTERPRISE_ROUTING_PROTOCOL:undefined,'region':_0x520c95,'domains':_0x41efee}};}function a24_0xfe72(_0x39a841,_0x33b208){_0x39a841=_0x39a841-0xdc;const _0x831eed=a24_0x831e();let _0xfe7248=_0x831eed[_0x39a841];return _0xfe7248;}export const configInitDefinition={'service':a24_0x77e274(0xfd),'command':'init','description':a24_0x77e274(0xf9),'risk':a24_0x77e274(0xdc),'confirmationDescription':'Updates\x20the\x20global\x20Lovrabet\x20region\x20or\x20independent-deployment\x20Domain\x20configuration.\x20AccessKey,\x20output\x20format,\x20and\x20app\x20bindings\x20stay\x20unchanged.','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':configInitFlags,'execute':executeConfigInit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x55a3c4,_0x339f37){var _0x468942=a25_0x55c7,_0x4b1e61=_0x55a3c4();while(!![]){try{var _0x3107d0=parseInt(_0x468942(0x18a))/0x1*(-parseInt(_0x468942(0x18e))/0x2)+parseInt(_0x468942(0x190))/0x3+parseInt(_0x468942(0x18f))/0x4*(parseInt(_0x468942(0x18b))/0x5)+-parseInt(_0x468942(0x191))/0x6+parseInt(_0x468942(0x192))/0x7*(parseInt(_0x468942(0x18d))/0x8)+parseInt(_0x468942(0x18c))/0x9*(parseInt(_0x468942(0x193))/0xa)+-parseInt(_0x468942(0x189))/0xb;if(_0x3107d0===_0x339f37)break;else _0x4b1e61['push'](_0x4b1e61['shift']());}catch(_0x2da83e){_0x4b1e61['push'](_0x4b1e61['shift']());}}}(a25_0x38ed,0x2133c));function a25_0x38ed(){var _0x489615=['1590cKswlG','1692460pISHFz','111lOYgiM','8935tjgITg','14157UMcQWA','8ZCMsZR','1490WCQxjJ','260RzFqZC','300519uQxqLW','1166922XaQmGb','704221DIQqkX'];a25_0x38ed=function(){return _0x489615;};return a25_0x38ed();}import{CLI_BIN_NAME}from'../../constant/cli.js';function a25_0x55c7(_0x11cca7,_0x4929f7){_0x11cca7=_0x11cca7-0x189;var _0x38edb8=a25_0x38ed();var _0x55c7bc=_0x38edb8[_0x11cca7];return _0x55c7bc;}export{CLI_BIN_NAME};export{readScopedConfig,writeScopedConfig}from'../../context.js';export{resolveConfigScope as resolveWriteScope,TOP_LEVEL_CONFIG_KEYS as TOP_LEVEL_KEYS,CONFIG_ENUM_VALUES as ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isCliProtectedConfigKey,isTopLevelConfigKey,normalizeLocale,toScopeFlags}from'../../commands/common/config-policy.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a26_0xb2ea(){const _0x2e3fb2=['file','invalid','maxBatchSize','utf8','isArray','reduce','Local\x20Excel\x20validation\x20only;\x20no\x20records\x20or\x20checkpoint\x20were\x20written.','1-based\x20Excel\x20header\x20row','emptyRows','Mapping\x20file\x20exceeds\x201\x20MB.','batchSize','.lock','61860WBsvsF','appCode','65261ewzsur','2060470UTiCFE','POST','message','Mapping\x20must\x20be\x20an\x20object\x20from\x20Excel\x20headers\x20to\x20field\x20codes.','/client/','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.','rows','max','imageFields','828156lUtHWT','--file\x20and\x20--mapping\x20are\x20required.','Inspect\x20lovrabet\x20dataset\x20detail\x20--code\x20','Private\x20checkpoint\x20file\x20(default:\x20XLSX\x20path\x20plus\x20.import-checkpoint.json)','\x20--params\x20\x27<JSON\x20array>\x27\x20--dry-run\x20using\x20the\x20target\x20app\x27s\x20User\x20AK\x20and\x20runtime\x20permissions.\x20Dry-run\x20only\x20previews\x20the\x20request;\x20verify\x20written\x20rows\x20before\x20advancing\x20and\x20reconcile\x20unknown\x20outcomes\x20before\x20retrying.\x20This\x20DB_TABLE\x20route\x20does\x20not\x20support\x20import\x20checkpoints\x20or\x20--resume.\x20See\x20references/lovrabet-db-table-excel-import.md\x20in\x20the\x20built-in\x20Skill.\x20No\x20import\x20request\x20was\x20sent.','\x20invalid\x20cells.\x20No\x20records\x20were\x20written.','5041152ilcIrZ','some','checkpoint','map','succeeded','bool','all','toString','Excel\x20import\x20failed.','Imported\x20and\x20verified\x20','DB_TABLE','METADATA','Excel\x20contains\x20','.\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','values','schemaFingerprint','Reconcile\x20imported\x20records\x20and\x20resume\x20the\x20exact\x20original\x20file,\x20target\x20and\x20mapping','See\x20','isInteger','.import-checkpoint.json','media','mappingFile','string','538990UIiIiG','length','Local\x20XLSX\x20file\x20(maximum\x2020\x20MB)','Run\x20dataset\x20detail\x20to\x20confirm\x20the\x20source.\x20Only\x20DB_TABLE\x20has\x20the\x20documented\x20alternative\x20batchCreate\x20route;\x20do\x20not\x20guess\x20or\x20automatically\x20switch\x20APIs.','.import-report.json','report','warnings','Dataset\x20source\x20is\x20missing\x20or\x20unsupported;\x20import-excel\x20requires\x20METADATA.','.lock.recovery','import-excel','DB_TABLE\x20datasets\x20use\x20the\x20existing\x20batchCreate\x20operation;\x20import-excel\x20only\x20supports\x20METADATA\x20datasets.','Source,\x20mapping,\x20checkpoint\x20and\x20report\x20must\x20be\x20different\x20files.','3403377wQWodz','size','str','Worksheet\x20name\x20or\x201-based\x20index\x20(default:\x20first\x20worksheet)','108kJhlRc','Mapping\x20file\x20must\x20contain\x20valid\x20JSON.','\x20--code\x20','validation','object','errors','8jcBkmy','resume','Creates\x20real\x20dataset\x20records\x20immediately.\x20Keep\x20the\x20checkpoint\x20to\x20reconcile\x20and\x20resume\x20interrupted\x20imports.','num','boolean','parse','/import-batch','batch-size','code','sheet','imageCells','Private\x20result\x20report\x20(default:\x20XLSX\x20path\x20plus\x20.import-report.json)'];a26_0xb2ea=function(){return _0x2e3fb2;};return a26_0xb2ea();}const a26_0x2731e3=a26_0xb963;(function(_0x52422f,_0x18fb99){const _0x30b5b3=a26_0xb963,_0x3fd33d=_0x52422f();while(!![]){try{const _0x325393=-parseInt(_0x30b5b3(0x87))/0x1+-parseInt(_0x30b5b3(0x9d))/0x2*(parseInt(_0x30b5b3(0xb5))/0x3)+parseInt(_0x30b5b3(0xc1))/0x4+-parseInt(_0x30b5b3(0xb8))/0x5+parseInt(_0x30b5b3(0x97))/0x6*(parseInt(_0x30b5b3(0xb7))/0x7)+parseInt(_0x30b5b3(0x70))/0x8+parseInt(_0x30b5b3(0x93))/0x9;if(_0x325393===_0x18fb99)break;else _0x3fd33d['push'](_0x3fd33d['shift']());}catch(_0x118e05){_0x3fd33d['push'](_0x3fd33d['shift']());}}}(a26_0xb2ea,0x55592));import{readFile,realpath}from'node:fs/promises';import{resolve}from'node:path';import{CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,getDatasetImportContract,createDatasetImportBatch,readDatasetImportRows,readDatasetImportTaskRows,uploadDatasetImportImage,readDatasetImportImage}from'../../core/api-client.js';import{getRuntimeDomain}from'../../constant/domain.js';import{CliError,CliErrors}from'../../errors.js';import{buildExcelManifest,normalizeImportFields}from'../../services/dataset-import/excel-reader.js';import{assertImportContract,assertImportPaths,runExcelImport,saveImportJson,resolveImportOutputPath}from'../../services/dataset-import/runner.js';import{assertDatasetImportTarget}from'../../services/dataset-import/metadata.js';function a26_0xb963(_0x2f3fe8,_0x2b13e8){_0x2f3fe8=_0x2f3fe8-0x6e;const _0xb2eac3=a26_0xb2ea();let _0xb963e4=_0xb2eac3[_0x2f3fe8];return _0xb963e4;}import{runAutoIdExcelImport}from'../../services/dataset-import/auto-id-runner.js';import{assertImageImportCapability,runImageExcelImport}from'../../services/dataset-import/image-runner.js';import{previewImportBatchCount}from'../../services/dataset-import/preview.js';function input(_0x286237){const _0x3a4b29=a26_0xb963,_0x1b0238=_0x286237[_0x3a4b29(0x95)](_0x3a4b29(0xa9)),_0x19dc98=_0x286237[_0x3a4b29(0x95)]('mapping');if(!_0x1b0238||!_0x19dc98)throw CliErrors[_0x3a4b29(0x9a)](_0x3a4b29(0xc2));const _0x37002d=_0x286237[_0x3a4b29(0xa0)]('header-row',0x1),_0x7ec4a7=_0x286237['num'](_0x3a4b29(0xa4),0x1f4);if(!Number[_0x3a4b29(0x82)](_0x37002d)||_0x37002d<0x1||!Number[_0x3a4b29(0x82)](_0x7ec4a7)||_0x7ec4a7<0x1||_0x7ec4a7>0x1f4)throw CliErrors[_0x3a4b29(0x9a)]('Header\x20row\x20must\x20be\x20positive\x20and\x20batch\x20size\x20must\x20be\x20between\x201\x20and\x20500.');const _0x274e6f=resolve(_0x286237['str'](_0x3a4b29(0x72))||_0x1b0238+_0x3a4b29(0x83)),_0x2695cf=resolve(_0x286237['str'](_0x3a4b29(0x8c))||_0x1b0238+_0x3a4b29(0x8b)),_0x184aa1=[resolve(_0x1b0238),resolve(_0x19dc98),_0x274e6f,_0x2695cf];if(new Set(_0x184aa1)[_0x3a4b29(0x94)]!==_0x184aa1[_0x3a4b29(0x88)])throw CliErrors['validation'](_0x3a4b29(0x92));return{'file':resolve(_0x1b0238),'mappingFile':resolve(_0x19dc98),'headerRow':_0x37002d,'batchSize':_0x7ec4a7,'checkpoint':_0x274e6f,'report':_0x2695cf,'sheet':_0x286237[_0x3a4b29(0x95)](_0x3a4b29(0xa6))||undefined,'resume':_0x286237[_0x3a4b29(0x75)]('resume')};}async function prepare(_0x3fbc9e){const _0x57bd2c=a26_0xb963,_0x4f8383=input(_0x3fbc9e),_0x1d110a=_0x3fbc9e[_0x57bd2c(0x95)](_0x57bd2c(0xa5));[_0x4f8383[_0x57bd2c(0xa9)],_0x4f8383[_0x57bd2c(0x85)],_0x4f8383[_0x57bd2c(0x72)],_0x4f8383[_0x57bd2c(0x8c)]]=await Promise[_0x57bd2c(0x76)]([realpath(_0x4f8383['file']),realpath(_0x4f8383['mappingFile']),resolveImportOutputPath(_0x4f8383[_0x57bd2c(0x72)]),resolveImportOutputPath(_0x4f8383[_0x57bd2c(0x8c)])]),assertImportPaths(_0x4f8383[_0x57bd2c(0x72)],_0x4f8383[_0x57bd2c(0x8c)],[_0x4f8383[_0x57bd2c(0xa9)],_0x4f8383[_0x57bd2c(0x85)]]);let _0xd341db;const _0x2dbac2=await readFile(_0x4f8383[_0x57bd2c(0x85)]);if(_0x2dbac2[_0x57bd2c(0x88)]>0x400*0x400)throw CliErrors[_0x57bd2c(0x9a)](_0x57bd2c(0xb2));try{_0xd341db=JSON[_0x57bd2c(0xa2)](_0x2dbac2[_0x57bd2c(0x77)](_0x57bd2c(0xac)));}catch{throw CliErrors[_0x57bd2c(0x9a)](_0x57bd2c(0x98));}if(!_0xd341db||typeof _0xd341db!==_0x57bd2c(0x9b)||Array[_0x57bd2c(0xad)](_0xd341db)||Object[_0x57bd2c(0x7e)](_0xd341db)[_0x57bd2c(0x71)](_0x10f9e7=>typeof _0x10f9e7!==_0x57bd2c(0x86)))throw CliErrors[_0x57bd2c(0x9a)](_0x57bd2c(0xbb));const _0x53d36c=await getDatasetDetail(_0x1d110a),_0x33207e=assertDatasetImportTarget(_0x53d36c,_0x3fbc9e['appCode'],_0x1d110a);if(_0x33207e===_0x57bd2c(0x7a))throw CliErrors[_0x57bd2c(0x9a)](_0x57bd2c(0x91),_0x57bd2c(0xc3)+_0x1d110a+_0x57bd2c(0x7d)+_0x3fbc9e[_0x57bd2c(0xb6)]+_0x57bd2c(0x99)+_0x1d110a+_0x57bd2c(0x6e));if(_0x33207e!==_0x57bd2c(0x7b))throw CliErrors[_0x57bd2c(0x9a)](_0x57bd2c(0x8e),_0x57bd2c(0x8a));const _0x5eddc7=await buildExcelManifest({..._0x4f8383,'mapping':_0xd341db,'fields':normalizeImportFields(_0x53d36c)}),_0xd48cc=await getDatasetImportContract(_0x3fbc9e[_0x57bd2c(0xb6)],_0x1d110a);assertImportContract(_0xd48cc,_0x3fbc9e['appCode'],_0x1d110a),assertImageImportCapability(_0xd48cc,_0x5eddc7);if(_0x5eddc7[_0x57bd2c(0xc0)]?.[_0x57bd2c(0x88)]){const _0x29d781=await resolveImportOutputPath(_0x4f8383['checkpoint']+'.rows.json'),_0xf8e4b1=await Promise[_0x57bd2c(0x76)]([_0x29d781,_0x29d781+_0x57bd2c(0xb4),_0x29d781+'.lock.recovery',_0x4f8383[_0x57bd2c(0x72)]+_0x57bd2c(0xb4),_0x4f8383[_0x57bd2c(0x72)]+_0x57bd2c(0x8f)][_0x57bd2c(0x73)](resolveImportOutputPath));assertImportPaths(_0x4f8383['checkpoint'],_0x4f8383[_0x57bd2c(0x8c)],[_0x4f8383[_0x57bd2c(0xa9)],_0x4f8383[_0x57bd2c(0x85)],..._0xf8e4b1['slice'](0x0,0x3)]);}if(_0x4f8383[_0x57bd2c(0xb3)]>_0xd48cc[_0x57bd2c(0xab)])throw CliErrors[_0x57bd2c(0x9a)]('Batch\x20size\x20exceeds\x20the\x20server\x20import\x20contract.');return{'args':_0x4f8383,'manifest':_0x5eddc7,'contract':_0xd48cc,'code':_0x1d110a};}async function checked(_0x414ad7){const _0x4a13f5=a26_0xb963;try{return await _0x414ad7();}catch(_0x4fe3cb){if(_0x4fe3cb instanceof CliError)throw _0x4fe3cb;throw CliErrors[_0x4a13f5(0x9a)](_0x4fe3cb[_0x4a13f5(0xba)]||_0x4a13f5(0x78));}}export const dataImportExcel={'service':'data','command':a26_0x2731e3(0x90),'risk':'write','description':a26_0x2731e3(0xbd),'confirmationDescription':a26_0x2731e3(0x9f),'flags':[CODE_FLAG,{'name':a26_0x2731e3(0xa9),'type':a26_0x2731e3(0x86),'required':!![],'description':a26_0x2731e3(0x89)},{'name':'mapping','type':a26_0x2731e3(0x86),'required':!![],'description':'JSON\x20file\x20mapping\x20Excel\x20headers\x20to\x20dataset\x20field\x20codes'},{'name':a26_0x2731e3(0xa6),'type':a26_0x2731e3(0x86),'description':a26_0x2731e3(0x96)},{'name':'header-row','type':'number','default':0x1,'description':a26_0x2731e3(0xb0)},{'name':a26_0x2731e3(0xa4),'type':'number','default':0x1f4,'description':'Maximum\x20records\x20per\x20request\x20(1..500)'},{'name':a26_0x2731e3(0x72),'type':a26_0x2731e3(0x86),'description':a26_0x2731e3(0xc4)},{'name':a26_0x2731e3(0x8c),'type':a26_0x2731e3(0x86),'description':a26_0x2731e3(0xa8)},{'name':a26_0x2731e3(0x9e),'type':a26_0x2731e3(0xa1),'description':a26_0x2731e3(0x80)}],'validate':async _0x263ce8=>{input(_0x263ce8);},'dryRun':async _0x176383=>checked(async()=>{const _0x36c353=a26_0x2731e3,{args:_0x53479a,manifest:_0x5e2b5f,contract:_0x35ffaa,code:_0x4baa3c}=await prepare(_0x176383),_0xc89890=new Set(_0x5e2b5f[_0x36c353(0x9c)][_0x36c353(0x73)](_0x105b46=>_0x105b46['rowNumber']))['size'];return{'method':_0x36c353(0xb9),'url':_0x36c353(0xbc)+encodeURIComponent(_0x176383[_0x36c353(0xb6)])+'/'+encodeURIComponent(_0x4baa3c)+_0x36c353(0xa3),'description':_0x36c353(0xaf),'body':{'schemaFingerprint':_0x35ffaa[_0x36c353(0x7f)]},'validRows':Math[_0x36c353(0xbf)](0x0,_0x5e2b5f[_0x36c353(0xbe)][_0x36c353(0x88)]-_0xc89890),'invalidRows':_0xc89890,'invalidCells':_0x5e2b5f[_0x36c353(0x9c)][_0x36c353(0x88)],'emptyRows':_0x5e2b5f['emptyRows'][_0x36c353(0x88)],'expectedBatches':previewImportBatchCount(_0x5e2b5f,_0x35ffaa,_0x53479a[_0x36c353(0xb3)]),'imageCount':_0x5e2b5f[_0x36c353(0xa7)]?.[_0x36c353(0xae)]((_0x3f6965,_0x21dc20)=>_0x3f6965+_0x21dc20['hashes'][_0x36c353(0x88)],0x0)??0x0,'uniqueImages':_0x5e2b5f[_0x36c353(0x84)]?.[_0x36c353(0x88)]??0x0,'uniqueImageBytes':_0x5e2b5f[_0x36c353(0x84)]?.[_0x36c353(0xae)]((_0xeab7b2,_0x789db9)=>_0xeab7b2+_0x789db9[_0x36c353(0x94)],0x0)??0x0,'errors':_0x5e2b5f[_0x36c353(0x9c)],'warnings':_0x5e2b5f[_0x36c353(0x8d)],'sheet':_0x5e2b5f[_0x36c353(0xa6)],'checkpoint':_0x53479a[_0x36c353(0x72)],'report':_0x53479a[_0x36c353(0x8c)]};}),'execute':async _0x22aeb4=>checked(async()=>{const _0x546a77=a26_0x2731e3,{args:_0x18bbdf,manifest:_0x47ab8f,contract:_0x3d05a2,code:_0x24c525}=await prepare(_0x22aeb4);if(_0x47ab8f['errors']['length']){await saveImportJson(_0x18bbdf[_0x546a77(0x8c)],{'status':_0x546a77(0xaa),'sourceRows':_0x47ab8f['rows'][_0x546a77(0x88)],'errors':_0x47ab8f[_0x546a77(0x9c)],'emptyRows':_0x47ab8f[_0x546a77(0xb1)],'warnings':_0x47ab8f[_0x546a77(0x8d)]});throw CliErrors[_0x546a77(0x9a)](_0x546a77(0x7c)+_0x47ab8f[_0x546a77(0x9c)][_0x546a77(0x88)]+_0x546a77(0x6f),_0x546a77(0x81)+_0x18bbdf[_0x546a77(0x8c)]+'.');}const _0x3e484e=_0x47ab8f[_0x546a77(0xc0)]?.[_0x546a77(0x88)]?runImageExcelImport:_0x3d05a2['schemaVersion']===0x2?runAutoIdExcelImport:runExcelImport,_0x11b38a=await _0x3e484e({..._0x18bbdf,'manifest':_0x47ab8f,'contract':_0x3d05a2,'appCode':_0x22aeb4[_0x546a77(0xb6)],'datasetCode':_0x24c525,'runtimeDomain':getRuntimeDomain(),'inputPaths':[_0x18bbdf['file'],_0x18bbdf[_0x546a77(0x85)]],'imageApi':{'upload':(_0x21f8c6,_0x43590c)=>uploadDatasetImportImage(_0x22aeb4[_0x546a77(0xb6)],_0x24c525,_0x21f8c6,_0x43590c),'readback':(_0x291bb6,_0x3e6aa6)=>readDatasetImportImage(_0x22aeb4[_0x546a77(0xb6)],_0x24c525,_0x291bb6,_0x3e6aa6)},'api':{'write':(_0x1089aa,_0x2adc8c)=>createDatasetImportBatch(_0x22aeb4[_0x546a77(0xb6)],_0x24c525,{'schemaFingerprint':_0x3d05a2[_0x546a77(0x7f)],'items':_0x1089aa,..._0x2adc8c===undefined?{}:{'taskId':_0x2adc8c}}),'readback':_0x20ee45=>readDatasetImportRows(_0x22aeb4[_0x546a77(0xb6)],_0x24c525,_0x20ee45),'readTask':_0x326e91=>readDatasetImportTaskRows(_0x22aeb4['appCode'],_0x24c525,_0x326e91)}});return{'ok':!![],'data':_0x11b38a,'message':_0x546a77(0x79)+_0x11b38a[_0x546a77(0x74)]+'\x20records.'};})};
|
|
1
|
+
const a26_0x12505c=a26_0x59ac;(function(_0x45526d,_0x244c28){const _0x266415=a26_0x59ac,_0xc4e1e2=_0x45526d();while(!![]){try{const _0x40014d=parseInt(_0x266415(0x136))/0x1*(parseInt(_0x266415(0x166))/0x2)+-parseInt(_0x266415(0x11f))/0x3+parseInt(_0x266415(0x131))/0x4+-parseInt(_0x266415(0x12c))/0x5+-parseInt(_0x266415(0x119))/0x6+-parseInt(_0x266415(0x11b))/0x7*(parseInt(_0x266415(0x123))/0x8)+-parseInt(_0x266415(0x149))/0x9*(-parseInt(_0x266415(0x11a))/0xa);if(_0x40014d===_0x244c28)break;else _0xc4e1e2['push'](_0xc4e1e2['shift']());}catch(_0x5338f1){_0xc4e1e2['push'](_0xc4e1e2['shift']());}}}(a26_0x3ea9,0x8312c));import{readFile,realpath}from'node:fs/promises';import{resolve}from'node:path';import{CODE_FLAG}from'../../commands/common/flags.js';function a26_0x3ea9(){const _0x38836c=['validation','invalid','boolean','values','schemaVersion','mapping','mappingFile','schemaFingerprint','maxBatchSize','resume','.import-report.json','Mapping\x20file\x20must\x20contain\x20valid\x20JSON.','succeeded','Local\x20Excel\x20validation\x20only;\x20no\x20records\x20or\x20checkpoint\x20were\x20written.','METADATA','JSON\x20file\x20mapping\x20Excel\x20headers\x20to\x20dataset\x20field\x20codes','batch-size','2qJwsdH','all','Reconcile\x20imported\x20records\x20and\x20resume\x20the\x20exact\x20original\x20file,\x20target\x20and\x20mapping','parse','Mapping\x20file\x20exceeds\x201\x20MB.','Batch\x20size\x20exceeds\x20the\x20server\x20import\x20contract.','rows','1346214SkLxbp','10GNKiJr','17836jnHfGK','emptyRows','checkpoint','warnings','433944KWWdlZ','file','imageFields','rowNumber','2728EUFHtU','.\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','number','Private\x20result\x20report\x20(default:\x20XLSX\x20path\x20plus\x20.import-report.json)','size','toString','Excel\x20contains\x20','Run\x20dataset\x20detail\x20to\x20confirm\x20the\x20source.\x20Only\x20DB_TABLE\x20has\x20the\x20documented\x20alternative\x20batchCreate\x20route;\x20do\x20not\x20guess\x20or\x20automatically\x20switch\x20APIs.','DB_TABLE\x20datasets\x20use\x20the\x20existing\x20batchCreate\x20operation;\x20import-excel\x20only\x20supports\x20METADATA\x20datasets.','1121985zgNEiK','report','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.','Header\x20row\x20must\x20be\x20positive\x20and\x20batch\x20size\x20must\x20be\x20between\x201\x20and\x20500.','media','218528tcAngy','\x20--code\x20','map','isInteger','Imported\x20and\x20verified\x20','156543UtOXLm','.lock','errors','num','header-row','isArray','.lock.recovery','max','some','length','string','Source,\x20mapping,\x20checkpoint\x20and\x20report\x20must\x20be\x20different\x20files.','object','Private\x20checkpoint\x20file\x20(default:\x20XLSX\x20path\x20plus\x20.import-checkpoint.json)','appCode','Local\x20XLSX\x20file\x20(maximum\x2020\x20MB)','POST','reduce','Maximum\x20records\x20per\x20request\x20(1..500)','16091847yItkxF','\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.','batchSize','slice','--file\x20and\x20--mapping\x20are\x20required.','/client/','sheet','Creates\x20real\x20dataset\x20records\x20immediately.\x20Keep\x20the\x20checkpoint\x20to\x20reconcile\x20and\x20resume\x20interrupted\x20imports.','write','bool','str','\x20records.'];a26_0x3ea9=function(){return _0x38836c;};return a26_0x3ea9();}import{getDatasetDetail,getDatasetImportContract,createDatasetImportBatch,readDatasetImportRows,readDatasetImportTaskRows,uploadDatasetImportImage,readDatasetImportImage}from'../../core/api-client.js';import{getRuntimeDomain}from'../../constant/domain.js';import{CliError,CliErrors}from'../../errors.js';import{buildExcelManifest,normalizeImportFields}from'../../services/dataset-import/excel-reader.js';import{assertImportContract,assertImportPaths,runExcelImport,saveImportJson,resolveImportOutputPath}from'../../services/dataset-import/runner.js';import{assertDatasetImportTarget}from'../../services/dataset-import/metadata.js';function a26_0x59ac(_0x310693,_0x4d6106){_0x310693=_0x310693-0x116;const _0x3ea936=a26_0x3ea9();let _0x59ac31=_0x3ea936[_0x310693];return _0x59ac31;}import{runAutoIdExcelImport}from'../../services/dataset-import/auto-id-runner.js';import{assertImageImportCapability,runImageExcelImport}from'../../services/dataset-import/image-runner.js';import{previewImportBatchCount}from'../../services/dataset-import/preview.js';function input(_0x4ea24e){const _0x90f004=a26_0x59ac,_0x2d7430=_0x4ea24e[_0x90f004(0x153)]('file'),_0x21159e=_0x4ea24e[_0x90f004(0x153)](_0x90f004(0x15a));if(!_0x2d7430||!_0x21159e)throw CliErrors[_0x90f004(0x155)](_0x90f004(0x14d));const _0xbd94e8=_0x4ea24e['num'](_0x90f004(0x13a),0x1),_0x2d0a06=_0x4ea24e[_0x90f004(0x139)]('batch-size',0x1f4);if(!Number[_0x90f004(0x134)](_0xbd94e8)||_0xbd94e8<0x1||!Number[_0x90f004(0x134)](_0x2d0a06)||_0x2d0a06<0x1||_0x2d0a06>0x1f4)throw CliErrors['validation'](_0x90f004(0x12f));const _0x560830=resolve(_0x4ea24e[_0x90f004(0x153)](_0x90f004(0x11d))||_0x2d7430+'.import-checkpoint.json'),_0x5c1c0b=resolve(_0x4ea24e[_0x90f004(0x153)](_0x90f004(0x12d))||_0x2d7430+_0x90f004(0x15f)),_0x3240cd=[resolve(_0x2d7430),resolve(_0x21159e),_0x560830,_0x5c1c0b];if(new Set(_0x3240cd)['size']!==_0x3240cd[_0x90f004(0x13f)])throw CliErrors['validation'](_0x90f004(0x141));return{'file':resolve(_0x2d7430),'mappingFile':resolve(_0x21159e),'headerRow':_0xbd94e8,'batchSize':_0x2d0a06,'checkpoint':_0x560830,'report':_0x5c1c0b,'sheet':_0x4ea24e[_0x90f004(0x153)](_0x90f004(0x14f))||undefined,'resume':_0x4ea24e[_0x90f004(0x152)](_0x90f004(0x15e))};}async function prepare(_0xa32b70){const _0x5165d7=a26_0x59ac,_0x3a81d5=input(_0xa32b70),_0x9c6575=_0xa32b70[_0x5165d7(0x153)]('code');[_0x3a81d5[_0x5165d7(0x120)],_0x3a81d5[_0x5165d7(0x15b)],_0x3a81d5[_0x5165d7(0x11d)],_0x3a81d5[_0x5165d7(0x12d)]]=await Promise[_0x5165d7(0x167)]([realpath(_0x3a81d5[_0x5165d7(0x120)]),realpath(_0x3a81d5[_0x5165d7(0x15b)]),resolveImportOutputPath(_0x3a81d5[_0x5165d7(0x11d)]),resolveImportOutputPath(_0x3a81d5[_0x5165d7(0x12d)])]),assertImportPaths(_0x3a81d5[_0x5165d7(0x11d)],_0x3a81d5['report'],[_0x3a81d5[_0x5165d7(0x120)],_0x3a81d5[_0x5165d7(0x15b)]]);let _0x281611;const _0x3b8064=await readFile(_0x3a81d5['mappingFile']);if(_0x3b8064[_0x5165d7(0x13f)]>0x400*0x400)throw CliErrors[_0x5165d7(0x155)](_0x5165d7(0x116));try{_0x281611=JSON[_0x5165d7(0x169)](_0x3b8064[_0x5165d7(0x128)]('utf8'));}catch{throw CliErrors[_0x5165d7(0x155)](_0x5165d7(0x160));}if(!_0x281611||typeof _0x281611!==_0x5165d7(0x142)||Array[_0x5165d7(0x13b)](_0x281611)||Object[_0x5165d7(0x158)](_0x281611)[_0x5165d7(0x13e)](_0x3b2509=>typeof _0x3b2509!==_0x5165d7(0x140)))throw CliErrors[_0x5165d7(0x155)]('Mapping\x20must\x20be\x20an\x20object\x20from\x20Excel\x20headers\x20to\x20field\x20codes.');const _0x552ca8=await getDatasetDetail(_0x9c6575),_0x1a170b=assertDatasetImportTarget(_0x552ca8,_0xa32b70[_0x5165d7(0x144)],_0x9c6575);if(_0x1a170b==='DB_TABLE')throw CliErrors[_0x5165d7(0x155)](_0x5165d7(0x12b),'Inspect\x20lovrabet\x20dataset\x20detail\x20--code\x20'+_0x9c6575+_0x5165d7(0x124)+_0xa32b70['appCode']+_0x5165d7(0x132)+_0x9c6575+_0x5165d7(0x14a));if(_0x1a170b!==_0x5165d7(0x163))throw CliErrors[_0x5165d7(0x155)]('Dataset\x20source\x20is\x20missing\x20or\x20unsupported;\x20import-excel\x20requires\x20METADATA.',_0x5165d7(0x12a));const _0x475fe3=await buildExcelManifest({..._0x3a81d5,'mapping':_0x281611,'fields':normalizeImportFields(_0x552ca8)}),_0xca740c=await getDatasetImportContract(_0xa32b70[_0x5165d7(0x144)],_0x9c6575);assertImportContract(_0xca740c,_0xa32b70[_0x5165d7(0x144)],_0x9c6575),assertImageImportCapability(_0xca740c,_0x475fe3);if(_0x475fe3[_0x5165d7(0x121)]?.[_0x5165d7(0x13f)]){const _0x577d72=await resolveImportOutputPath(_0x3a81d5[_0x5165d7(0x11d)]+'.rows.json'),_0x2ea6ba=await Promise[_0x5165d7(0x167)]([_0x577d72,_0x577d72+_0x5165d7(0x137),_0x577d72+_0x5165d7(0x13c),_0x3a81d5[_0x5165d7(0x11d)]+_0x5165d7(0x137),_0x3a81d5['checkpoint']+'.lock.recovery'][_0x5165d7(0x133)](resolveImportOutputPath));assertImportPaths(_0x3a81d5[_0x5165d7(0x11d)],_0x3a81d5[_0x5165d7(0x12d)],[_0x3a81d5[_0x5165d7(0x120)],_0x3a81d5['mappingFile'],..._0x2ea6ba[_0x5165d7(0x14c)](0x0,0x3)]);}if(_0x3a81d5[_0x5165d7(0x14b)]>_0xca740c[_0x5165d7(0x15d)])throw CliErrors[_0x5165d7(0x155)](_0x5165d7(0x117));return{'args':_0x3a81d5,'manifest':_0x475fe3,'contract':_0xca740c,'code':_0x9c6575};}async function checked(_0x4470f2){const _0x31f24a=a26_0x59ac;try{return await _0x4470f2();}catch(_0x3cdc6e){if(_0x3cdc6e instanceof CliError)throw _0x3cdc6e;throw CliErrors[_0x31f24a(0x155)](_0x3cdc6e['message']||'Excel\x20import\x20failed.');}}export const dataImportExcel={'service':'data','command':'import-excel','risk':a26_0x12505c(0x151),'description':a26_0x12505c(0x12e),'confirmationDescription':a26_0x12505c(0x150),'flags':[CODE_FLAG,{'name':'file','type':a26_0x12505c(0x140),'required':!![],'description':a26_0x12505c(0x145)},{'name':a26_0x12505c(0x15a),'type':'string','required':!![],'description':a26_0x12505c(0x164)},{'name':a26_0x12505c(0x14f),'type':a26_0x12505c(0x140),'description':'Worksheet\x20name\x20or\x201-based\x20index\x20(default:\x20first\x20worksheet)'},{'name':a26_0x12505c(0x13a),'type':a26_0x12505c(0x125),'default':0x1,'description':'1-based\x20Excel\x20header\x20row'},{'name':a26_0x12505c(0x165),'type':a26_0x12505c(0x125),'default':0x1f4,'description':a26_0x12505c(0x148)},{'name':a26_0x12505c(0x11d),'type':a26_0x12505c(0x140),'description':a26_0x12505c(0x143)},{'name':'report','type':a26_0x12505c(0x140),'description':a26_0x12505c(0x126)},{'name':a26_0x12505c(0x15e),'type':a26_0x12505c(0x157),'description':a26_0x12505c(0x168)}],'validate':async _0x282122=>{input(_0x282122);},'dryRun':async _0x2ac68d=>checked(async()=>{const _0x1337ff=a26_0x12505c,{args:_0x2ea808,manifest:_0x1706f1,contract:_0x4ed8c9,code:_0x53a80d}=await prepare(_0x2ac68d),_0x5e9e22=new Set(_0x1706f1[_0x1337ff(0x138)]['map'](_0x33e546=>_0x33e546[_0x1337ff(0x122)]))[_0x1337ff(0x127)];return{'method':_0x1337ff(0x146),'url':_0x1337ff(0x14e)+encodeURIComponent(_0x2ac68d[_0x1337ff(0x144)])+'/'+encodeURIComponent(_0x53a80d)+'/import-batch','description':_0x1337ff(0x162),'body':{'schemaFingerprint':_0x4ed8c9[_0x1337ff(0x15c)]},'validRows':Math[_0x1337ff(0x13d)](0x0,_0x1706f1[_0x1337ff(0x118)][_0x1337ff(0x13f)]-_0x5e9e22),'invalidRows':_0x5e9e22,'invalidCells':_0x1706f1[_0x1337ff(0x138)][_0x1337ff(0x13f)],'emptyRows':_0x1706f1[_0x1337ff(0x11c)][_0x1337ff(0x13f)],'expectedBatches':previewImportBatchCount(_0x1706f1,_0x4ed8c9,_0x2ea808[_0x1337ff(0x14b)]),'imageCount':_0x1706f1['imageCells']?.[_0x1337ff(0x147)]((_0x57841b,_0x5ecd9b)=>_0x57841b+_0x5ecd9b['hashes'][_0x1337ff(0x13f)],0x0)??0x0,'uniqueImages':_0x1706f1[_0x1337ff(0x130)]?.[_0x1337ff(0x13f)]??0x0,'uniqueImageBytes':_0x1706f1[_0x1337ff(0x130)]?.[_0x1337ff(0x147)]((_0x183c19,_0x1df2d0)=>_0x183c19+_0x1df2d0['size'],0x0)??0x0,'errors':_0x1706f1[_0x1337ff(0x138)],'warnings':_0x1706f1[_0x1337ff(0x11e)],'sheet':_0x1706f1[_0x1337ff(0x14f)],'checkpoint':_0x2ea808[_0x1337ff(0x11d)],'report':_0x2ea808['report']};}),'execute':async _0x3eff28=>checked(async()=>{const _0xe7783c=a26_0x12505c,{args:_0x142760,manifest:_0x1d6409,contract:_0x33196b,code:_0x5598f3}=await prepare(_0x3eff28);if(_0x1d6409[_0xe7783c(0x138)]['length']){await saveImportJson(_0x142760['report'],{'status':_0xe7783c(0x156),'sourceRows':_0x1d6409[_0xe7783c(0x118)]['length'],'errors':_0x1d6409[_0xe7783c(0x138)],'emptyRows':_0x1d6409[_0xe7783c(0x11c)],'warnings':_0x1d6409[_0xe7783c(0x11e)]});throw CliErrors[_0xe7783c(0x155)](_0xe7783c(0x129)+_0x1d6409['errors'][_0xe7783c(0x13f)]+'\x20invalid\x20cells.\x20No\x20records\x20were\x20written.','See\x20'+_0x142760['report']+'.');}const _0x129e39=_0x1d6409['imageFields']?.[_0xe7783c(0x13f)]?runImageExcelImport:_0x33196b[_0xe7783c(0x159)]===0x2?runAutoIdExcelImport:runExcelImport,_0x25b827=await _0x129e39({..._0x142760,'manifest':_0x1d6409,'contract':_0x33196b,'appCode':_0x3eff28[_0xe7783c(0x144)],'datasetCode':_0x5598f3,'runtimeDomain':getRuntimeDomain(),'inputPaths':[_0x142760['file'],_0x142760['mappingFile']],'imageApi':{'upload':(_0xce75e0,_0x387655)=>uploadDatasetImportImage(_0x3eff28[_0xe7783c(0x144)],_0x5598f3,_0xce75e0,_0x387655),'readback':(_0x482879,_0x1d1644)=>readDatasetImportImage(_0x3eff28['appCode'],_0x5598f3,_0x482879,_0x1d1644)},'api':{'write':(_0x1e7921,_0x494027)=>createDatasetImportBatch(_0x3eff28[_0xe7783c(0x144)],_0x5598f3,{'schemaFingerprint':_0x33196b[_0xe7783c(0x15c)],'items':_0x1e7921,..._0x494027===undefined?{}:{'taskId':_0x494027}}),'readback':_0x71a065=>readDatasetImportRows(_0x3eff28[_0xe7783c(0x144)],_0x5598f3,_0x71a065),'readTask':_0x225f7c=>readDatasetImportTaskRows(_0x3eff28['appCode'],_0x5598f3,_0x225f7c)}});return{'ok':!![],'data':_0x25b827,'message':_0xe7783c(0x135)+_0x25b827[_0xe7783c(0x161)]+_0xe7783c(0x154)};})};
|