@lovrabet/rabetbase-cli 2.1.14-beta.3 → 2.2.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/discover.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app/use.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -0
- package/lib/commands/dataset/relation-delete.js +1 -0
- package/lib/commands/dataset/relation-shared.js +1 -0
- package/lib/commands/dataset/relation-update.js +1 -0
- package/lib/commands/dataset/relations.js +1 -0
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -0
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.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/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.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/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.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/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -0
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/lib/commands/dataset/link-create.js +0 -1
- package/lib/commands/dataset/link-delete.js +0 -1
- package/lib/commands/dataset/link-shared.js +0 -1
- package/lib/commands/dataset/link-update.js +0 -1
- package/lib/commands/dataset/links.js +0 -1
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a32_0x4d84a8=a32_0x291e;(function(_0x28ee63,_0x44ee2a){const _0x396064=a32_0x291e,_0x2a6ef9=_0x28ee63();while(!![]){try{const _0x4d2497=parseInt(_0x396064(0x236))/0x1+parseInt(_0x396064(0x220))/0x2*(parseInt(_0x396064(0x1f5))/0x3)+-parseInt(_0x396064(0x22f))/0x4*(parseInt(_0x396064(0x22c))/0x5)+parseInt(_0x396064(0x1e9))/0x6*(-parseInt(_0x396064(0x1ff))/0x7)+-parseInt(_0x396064(0x227))/0x8+parseInt(_0x396064(0x21d))/0x9*(-parseInt(_0x396064(0x1f4))/0xa)+parseInt(_0x396064(0x1ed))/0xb;if(_0x4d2497===_0x44ee2a)break;else _0x2a6ef9['push'](_0x2a6ef9['shift']());}catch(_0x49cfce){_0x2a6ef9['push'](_0x2a6ef9['shift']());}}}(a32_0x1a1d,0xc1ec1));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{assertDatasetSupportsLocalDevelopment}from'../../commands/dataset/capability.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':'bff','command':'push','description':a32_0x4d84a8(0x204),'risk':'high-risk-write','flags':[{'name':a32_0x4d84a8(0x210),'type':'string','description':a32_0x4d84a8(0x20d),'enum':[a32_0x4d84a8(0x1f7),a32_0x4d84a8(0x201),a32_0x4d84a8(0x23a)]},{'name':a32_0x4d84a8(0x226),'type':a32_0x4d84a8(0x232),'description':a32_0x4d84a8(0x21a)},{'name':a32_0x4d84a8(0x225),'type':a32_0x4d84a8(0x238),'description':a32_0x4d84a8(0x21e)}],async 'dryRun'(_0x52fe0d){const _0x58a651=a32_0x4d84a8,_0x183c5e=loadBffProjectConfig(_0x52fe0d[_0x58a651(0x1f0)]),_0x1e708d=await readBffLockFile(_0x183c5e['lockFilePath']),{appLock:_0x184104}=ensureLockScope(_0x1e708d??createEmptyBffLock(),_0x52fe0d[_0x58a651(0x1f0)],_0x183c5e[_0x58a651(0x221)],'push'),_0xf4f81c=await getTargetFunctions(_0x183c5e,_0x52fe0d),_0x15cde5=_0x52fe0d[_0x58a651(0x209)]('force'),_0x24dbf5=[];for(const _0x21301e of _0xf4f81c){const _0x599306=await computeFileHash(_0x21301e[_0x58a651(0x235)]),_0x3ca119=_0x184104[_0x58a651(0x233)][_0x21301e[_0x58a651(0x208)]],_0x5c63a5=!!_0x3ca119&&_0x3ca119['hash']===_0x599306;_0x24dbf5[_0x58a651(0x222)]({'lockKey':_0x21301e[_0x58a651(0x208)],'filePath':_0x21301e['filePath'],'remoteId':_0x3ca119?.['remoteId']??null,'mode':_0x3ca119?.[_0x58a651(0x239)]?_0x58a651(0x218):_0x58a651(0x1e8),'status':!_0x15cde5&&_0x5c63a5?_0x58a651(0x1f1):'would_push'});}return{'method':_0x58a651(0x215),'url':_0x58a651(0x207),'body':{'appCode':_0x52fe0d['appCode'],'force':_0x15cde5,'files':_0x24dbf5,'cacheClearAtRuntime':_0x24dbf5[_0x58a651(0x20f)](_0x3d6ec0=>_0x3d6ec0[_0x58a651(0x1ec)]===_0x58a651(0x22e)),'cacheClearAtRuntimeTimes':_0x24dbf5['some'](_0x434955=>_0x434955[_0x58a651(0x1ec)]==='would_push')?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x58a651(0x22d)+_0x24dbf5[_0x58a651(0x21f)]+_0x58a651(0x202)};},async 'execute'(_0x58275a){const _0x2cf02f=a32_0x4d84a8,_0x3aa8e1=loadBffProjectConfig(_0x58275a[_0x2cf02f(0x1f0)]),_0xa9a987=await readBffLockFile(_0x3aa8e1[_0x2cf02f(0x203)]),{lockData:_0x44d9f4,appLock:_0x11455c}=ensureLockScope(_0xa9a987??createEmptyBffLock(),_0x58275a['appCode'],_0x3aa8e1[_0x2cf02f(0x221)],_0x2cf02f(0x222)),_0x4f08b7=await getTargetFunctions(_0x3aa8e1,_0x58275a);if(_0x4f08b7[_0x2cf02f(0x21f)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x2cf02f(0x234)};const _0x35a20d=_0x58275a['bool'](_0x2cf02f(0x225)),_0x4ebbf0=JSON['parse'](JSON['stringify'](_0x44d9f4)),_0x207610=_0x4ebbf0[_0x2cf02f(0x1fe)][_0x58275a[_0x2cf02f(0x1f0)]];if(!_0x207610)throw new Error(_0x2cf02f(0x1ee)+_0x58275a['appCode']+_0x2cf02f(0x23b));const _0x5b42b1=await buildHookMaps(_0x58275a[_0x2cf02f(0x1f0)],_0x58275a[_0x2cf02f(0x205)],_0x4f08b7,_0x207610),_0x251714=[],_0x22c3e9=[],_0xacb03=[];for(const _0x5052f3 of _0x4f08b7){const _0x23a5a2=await computeFileHash(_0x5052f3[_0x2cf02f(0x235)]),_0x432e40=_0x207610['functions'][_0x5052f3[_0x2cf02f(0x208)]];if(!_0x35a20d&&_0x432e40&&_0x432e40[_0x2cf02f(0x20b)]===_0x23a5a2){_0x22c3e9[_0x2cf02f(0x222)]({'lockKey':_0x5052f3['lockKey'],'reason':_0x2cf02f(0x1f1)});continue;}try{await uploadSingleFunction(_0x58275a[_0x2cf02f(0x1f0)],_0x5052f3,_0x207610,_0x5b42b1);const _0x1f4d3b=_0x207610[_0x2cf02f(0x233)][_0x5052f3[_0x2cf02f(0x208)]];_0x251714[_0x2cf02f(0x222)]({'lockKey':_0x5052f3[_0x2cf02f(0x208)],'remoteId':_0x1f4d3b?.[_0x2cf02f(0x239)]??0x0});}catch(_0x39d7d6){_0xacb03[_0x2cf02f(0x222)]({'lockKey':_0x5052f3[_0x2cf02f(0x208)],'error':_0x39d7d6 instanceof Error?_0x39d7d6['message']:String(_0x39d7d6)});}}_0x207610[_0x2cf02f(0x22a)]=new Date()[_0x2cf02f(0x1fb)](),await writeBffLockFile(_0x3aa8e1['lockFilePath'],_0x4ebbf0),await waitForUploadedLockEntries(_0x3aa8e1[_0x2cf02f(0x203)],_0x58275a[_0x2cf02f(0x1f0)],_0x251714['map'](_0x45f57c=>_0x45f57c[_0x2cf02f(0x208)]));let _0x488eea={'attempted':![],'cleared':![]};if(_0x251714[_0x2cf02f(0x21f)]>0x0)try{let _0x1d604b='';for(let _0x52aa12=0x0;_0x52aa12<CACHE_CLEAR_ATTEMPTS;_0x52aa12+=0x1){_0x1d604b=await clearBffScriptCache(),_0x52aa12<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x488eea={'attempted':!![],'cleared':!![],'message':_0x1d604b||_0x2cf02f(0x228)};}catch(_0x1a9fd2){_0x488eea={'attempted':!![],'cleared':![],'error':_0x1a9fd2 instanceof Error?_0x1a9fd2[_0x2cf02f(0x22b)]:String(_0x1a9fd2)};}const _0x543f69=_0xacb03['length']===0x0&&(_0x488eea['attempted']?_0x488eea[_0x2cf02f(0x1f8)]:!![]),_0x5b7fa0=_0x488eea[_0x2cf02f(0x23c)]?_0x488eea[_0x2cf02f(0x1f8)]?'runtime\x20cache\x20cleared':_0x2cf02f(0x1ea):_0x2cf02f(0x23d);return{'ok':_0x543f69,'data':{'uploaded':_0x251714,'skipped':_0x22c3e9,'failed':_0xacb03,'cacheClear':_0x488eea},'message':_0x2cf02f(0x20c)+_0x251714['length']+_0x2cf02f(0x1f9)+_0x22c3e9[_0x2cf02f(0x21f)]+_0x2cf02f(0x230)+_0xacb03[_0x2cf02f(0x21f)]+'\x20failed,\x20'+_0x5b7fa0};}};async function getTargetFunctions(_0x4d6b61,_0xec0051){const _0xcddacd=a32_0x4d84a8,_0xb4db22=_0xec0051[_0xcddacd(0x214)](_0xcddacd(0x210)),_0x1d329b=_0xec0051[_0xcddacd(0x214)](_0xcddacd(0x226)),_0x1e9604=normalizeBffType(_0xb4db22)??undefined;if(_0x1d329b&&!_0x1e9604)throw CliErrors[_0xcddacd(0x231)](_0xcddacd(0x21c));const _0x536739=await scanLocalBffFunctions(_0x4d6b61,_0x1e9604);if(_0x1d329b){const _0xe6e96a=_0x536739[_0xcddacd(0x1f2)](_0x11f638=>_0x11f638[_0xcddacd(0x226)]===_0x1d329b);if(_0xe6e96a[_0xcddacd(0x21f)]===0x0)throw CliErrors[_0xcddacd(0x231)](_0xcddacd(0x229)+_0x1e9604+'/'+_0x1d329b);return _0xe6e96a;}return _0x536739;}function a32_0x291e(_0x3645a0,_0xbc9687){_0x3645a0=_0x3645a0-0x1e6;const _0x1a1d42=a32_0x1a1d();let _0x291ee8=_0x1a1d42[_0x3645a0];return _0x291ee8;}async function buildHookMaps(_0x154bec,_0x162cf8,_0x5876ee,_0x38f726){const _0x4f4bc8=a32_0x4d84a8,_0x4a1fec=_0x5876ee[_0x4f4bc8(0x20f)](_0x1a0f25=>_0x1a0f25[_0x4f4bc8(0x210)]==='HOOK');if(!_0x4a1fec)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x39b595=loadAliasMap(_0x162cf8,undefined,resolveApiFilePath(_0x162cf8,_0x154bec)),_0x2a2b3b=new Map(_0x39b595['map'](_0x4d8e99=>[_0x4d8e99['alias'],_0x4d8e99[_0x4f4bc8(0x216)]]));for(const _0x1d9415 of Object[_0x4f4bc8(0x20a)](_0x38f726[_0x4f4bc8(0x233)])){_0x1d9415[_0x4f4bc8(0x1fc)]&&_0x1d9415[_0x4f4bc8(0x216)]&&!_0x2a2b3b[_0x4f4bc8(0x212)](_0x1d9415[_0x4f4bc8(0x1fc)])&&_0x2a2b3b[_0x4f4bc8(0x1f6)](_0x1d9415[_0x4f4bc8(0x1fc)],_0x1d9415[_0x4f4bc8(0x216)]);}const _0x29dc48=await listDatasets(_0x154bec),_0x227652=new Map(_0x29dc48[_0x4f4bc8(0x21b)](_0x1c09c4=>[_0x1c09c4[_0x4f4bc8(0x1fd)],_0x1c09c4]));return{'aliasToDatasetCode':_0x2a2b3b,'datasetCodeToDataset':_0x227652};}async function uploadSingleFunction(_0x57121a,_0x4fcc7f,_0x39b240,_0x44eaa8){const _0x313c1c=a32_0x4d84a8,_0x4553d9=await readFile(_0x4fcc7f[_0x313c1c(0x235)],_0x313c1c(0x1fa)),_0x1af722=await computeFileHash(_0x4fcc7f[_0x313c1c(0x235)]),_0x4969ff=_0x39b240[_0x313c1c(0x233)][_0x4fcc7f['lockKey']];if(_0x4969ff?.[_0x313c1c(0x239)]&&_0x4969ff[_0x313c1c(0x20e)]==null)throw CliErrors[_0x313c1c(0x231)](_0x4fcc7f[_0x313c1c(0x208)]+':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.');let _0x1ae1f8=extractScriptDescription(_0x4553d9);if(!_0x1ae1f8&&_0x4969ff?.[_0x313c1c(0x239)]){const _0x8bbbf=await getBffScriptInfo(_0x4969ff[_0x313c1c(0x239)]);_0x1ae1f8=_0x8bbbf[_0x313c1c(0x213)]||undefined;}const _0x4cf9ae={'appCode':_0x57121a,'functionName':_0x4fcc7f[_0x313c1c(0x226)],'scriptType':_0x4fcc7f[_0x313c1c(0x210)],'scriptContent':_0x4553d9};if(_0x4969ff?.[_0x313c1c(0x239)])_0x4cf9ae['id']=_0x4969ff[_0x313c1c(0x239)];if(_0x4969ff?.[_0x313c1c(0x20e)]!=null)_0x4cf9ae[_0x313c1c(0x20e)]=_0x4969ff[_0x313c1c(0x20e)];if(_0x1ae1f8)_0x4cf9ae['description']=_0x1ae1f8;if(_0x4fcc7f[_0x313c1c(0x210)]==='HOOK'){const _0x39f806=_0x4fcc7f['alias'];if(!_0x39f806||!_0x4fcc7f[_0x313c1c(0x217)]||!_0x4fcc7f['functionNode'])throw CliErrors[_0x313c1c(0x231)](_0x313c1c(0x237)+_0x4fcc7f[_0x313c1c(0x208)]);const _0x21631e=_0x44eaa8['aliasToDatasetCode'][_0x313c1c(0x1e7)](_0x39f806)??_0x4969ff?.['datasetCode']??_0x39f806,_0x46c875=_0x44eaa8['datasetCodeToDataset'][_0x313c1c(0x1e7)](_0x21631e);if(!_0x46c875)throw CliErrors[_0x313c1c(0x231)](_0x313c1c(0x1ef)+_0x39f806+_0x313c1c(0x219)+(_0x313c1c(0x200)+CLI_BIN_NAME+_0x313c1c(0x1eb)));assertDatasetSupportsLocalDevelopment(_0x46c875,'BFF\x20HOOK\x20'+_0x4fcc7f[_0x313c1c(0x208)]),_0x4cf9ae['datasetId']=_0x46c875['id'],_0x4cf9ae[_0x313c1c(0x217)]=_0x4fcc7f[_0x313c1c(0x217)],_0x4cf9ae['functionNode']=_0x4fcc7f[_0x313c1c(0x206)];}const _0x1f66d5=await saveBffScript(_0x4cf9ae),_0x2ff31f=_0x1f66d5['id'],_0x33eeeb=_0x1f66d5[_0x313c1c(0x223)]??await getBffScriptInfo(_0x2ff31f),_0x4d5c9f={'hash':_0x1af722,'remoteId':_0x2ff31f,'version':_0x33eeeb[_0x313c1c(0x20e)]};if(_0x4fcc7f['type']===_0x313c1c(0x23a)){const _0xfbf79=_0x4fcc7f[_0x313c1c(0x1fc)],_0x2545c7=_0x44eaa8['aliasToDatasetCode']['get'](_0xfbf79)??_0x4969ff?.[_0x313c1c(0x216)]??_0xfbf79;_0x44eaa8[_0x313c1c(0x211)][_0x313c1c(0x212)](_0xfbf79)?_0x4d5c9f[_0x313c1c(0x1fc)]=_0xfbf79:_0x4d5c9f[_0x313c1c(0x1fc)]=_0x4969ff?.[_0x313c1c(0x1fc)],_0x4d5c9f[_0x313c1c(0x216)]=_0x2545c7,_0x4d5c9f[_0x313c1c(0x217)]=_0x4fcc7f[_0x313c1c(0x217)],_0x4d5c9f['functionNode']=_0x4fcc7f[_0x313c1c(0x206)];}_0x39b240[_0x313c1c(0x233)][_0x4fcc7f[_0x313c1c(0x208)]]=_0x4d5c9f;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;function a32_0x1a1d(){const _0x49db5e=['\x22\x20not\x20found\x20after\x20ensureLockScope.','attempted','runtime\x20cache\x20not\x20needed','every','get','create','6FOytna','runtime\x20cache\x20clear\x20failed','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','status','2125871wuiUAl','Lock\x20scope\x20for\x20app\x20\x22','Cannot\x20resolve\x20dataset\x20for\x20\x22','appCode','unchanged','filter','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','30hBApEh','2307543sBWzVE','set','COMMON','cleared','\x20uploaded,\x20','utf8','toISOString','alias','code','apps','1385363nDqQer','Run\x20`','ENDPOINT','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','lockFilePath','Push\x20local\x20BFF\x20scripts\x20to\x20remote','apiDir','functionNode','/api/management/library/scripts/save','lockKey','bool','values','hash','Push\x20complete:\x20','Push\x20only\x20this\x20script\x20type','version','some','type','aliasToDatasetCode','has','description','str','POST','datasetCode','operationType','update','\x22.\x20','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','map','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','370134tfyxTL','Force\x20push\x20ignoring\x20hash\x20protection','length','2Wtqwsv','scriptsRoot','push','script','join','force','name','589656AdnifP','Runtime\x20script\x20cache\x20cleared.','Local\x20function\x20not\x20found:\x20','lastSync','message','10585mCObXe','Would\x20inspect\x20','would_push','636ClBfrC','\x20skipped,\x20','validation','string','functions','No\x20local\x20BFF\x20functions\x20found.','filePath','563460hwNVRk','Incomplete\x20HOOK\x20path:\x20','boolean','remoteId','HOOK'];a32_0x1a1d=function(){return _0x49db5e;};return a32_0x1a1d();}async function waitForUploadedLockEntries(_0x1ee791,_0x1a9d1d,_0x2035ca){const _0x120daf=a32_0x4d84a8;if(_0x2035ca[_0x120daf(0x21f)]===0x0)return;for(let _0x23b092=0x0;_0x23b092<LOCK_SETTLE_RETRY_COUNT;_0x23b092+=0x1){const _0x101a59=await readBffLockFile(_0x1ee791),_0x2b309a=_0x101a59?.[_0x120daf(0x1fe)]?.[_0x1a9d1d]?.[_0x120daf(0x233)]??{},_0x4320c5=_0x2035ca[_0x120daf(0x1e6)](_0x507c06=>!!_0x2b309a[_0x507c06]?.[_0x120daf(0x239)]);if(_0x4320c5)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x120daf(0x1f3)+_0x2035ca[_0x120daf(0x224)](',\x20')+'.');}
|
|
1
|
+
function a32_0x5d5b(){const _0x367621=['filePath','7vKjqBY','Lock\x20scope\x20for\x20app\x20\x22','alias',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','attempted','values','2498274BrfXvW','type','has','scriptsRoot','push','1312900FKkSgj','datasetCode','Run\x20`','appCode','status','cleared','name','toISOString','datasetCodeToDataset','filter','set','\x22.\x20','lockKey','datasetId','unchanged','bool','40ScLHND','functionNode','\x22\x20not\x20found\x20after\x20ensureLockScope.','apps','runtime\x20cache\x20clear\x20failed','Would\x20inspect\x20','every','join','Push\x20local\x20BFF\x20scripts\x20to\x20remote','boolean','parse','aliasToDatasetCode','would_push','4575373XRtnGN','350oqgmgZ','bff','get','HOOK','/api/management/library/scripts/save','ENDPOINT','remoteId','validation','message','Cannot\x20resolve\x20dataset\x20for\x20\x22','version','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','1077774DmfURU','2350XvBkPn','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','POST','Push\x20only\x20this\x20script\x20type','Local\x20function\x20not\x20found:\x20','557178GbBUMD','force','update','lastSync','1226216pTcuDE','runtime\x20cache\x20not\x20needed','string','str','functions','Force\x20push\x20ignoring\x20hash\x20protection','operationType','some','description','\x20uploaded,\x20','\x20skipped,\x20','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','\x20failed,\x20','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','length','stringify','runtime\x20cache\x20cleared','lockFilePath','hash','5WHNGSC'];a32_0x5d5b=function(){return _0x367621;};return a32_0x5d5b();}const a32_0x1df605=a32_0xda43;(function(_0x18ecad,_0x23475c){const _0x5a1869=a32_0xda43,_0x43cea4=_0x18ecad();while(!![]){try{const _0x2068c9=-parseInt(_0x5a1869(0x18e))/0x1*(parseInt(_0x5a1869(0x147))/0x2)+-parseInt(_0x5a1869(0x146))/0x3+-parseInt(_0x5a1869(0x170))/0x4+-parseInt(_0x5a1869(0x163))/0x5*(-parseInt(_0x5a1869(0x14c))/0x6)+-parseInt(_0x5a1869(0x165))/0x7*(parseInt(_0x5a1869(0x150))/0x8)+-parseInt(_0x5a1869(0x16b))/0x9+-parseInt(_0x5a1869(0x180))/0xa*(-parseInt(_0x5a1869(0x18d))/0xb);if(_0x2068c9===_0x23475c)break;else _0x43cea4['push'](_0x43cea4['shift']());}catch(_0x28ad22){_0x43cea4['push'](_0x43cea4['shift']());}}}(a32_0x5d5b,0x376df));function a32_0xda43(_0x5e9413,_0x2898c2){_0x5e9413=_0x5e9413-0x13b;const _0x5d5b2e=a32_0x5d5b();let _0xda4311=_0x5d5b2e[_0x5e9413];return _0xda4311;}import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':a32_0x1df605(0x13b),'command':a32_0x1df605(0x16f),'description':a32_0x1df605(0x188),'risk':'high-risk-write','flags':[{'name':a32_0x1df605(0x16c),'type':a32_0x1df605(0x152),'description':a32_0x1df605(0x14a),'enum':['COMMON',a32_0x1df605(0x13f),a32_0x1df605(0x13d)]},{'name':'name','type':a32_0x1df605(0x152),'description':a32_0x1df605(0x148)},{'name':a32_0x1df605(0x14d),'type':a32_0x1df605(0x189),'description':a32_0x1df605(0x155)}],async 'dryRun'(_0xc9ed11){const _0x1e0a34=a32_0x1df605,_0x3ea1b6=loadBffProjectConfig(_0xc9ed11[_0x1e0a34(0x173)]),_0x185609=await readBffLockFile(_0x3ea1b6[_0x1e0a34(0x161)]),{appLock:_0x2c1673}=ensureLockScope(_0x185609??createEmptyBffLock(),_0xc9ed11[_0x1e0a34(0x173)],_0x3ea1b6[_0x1e0a34(0x16e)],_0x1e0a34(0x16f)),_0x3204ab=await getTargetFunctions(_0x3ea1b6,_0xc9ed11),_0x363e9f=_0xc9ed11[_0x1e0a34(0x17f)](_0x1e0a34(0x14d)),_0x38d060=[];for(const _0x148e4d of _0x3204ab){const _0x5562b1=await computeFileHash(_0x148e4d[_0x1e0a34(0x164)]),_0x52fe32=_0x2c1673[_0x1e0a34(0x154)][_0x148e4d['lockKey']],_0x473402=!!_0x52fe32&&_0x52fe32[_0x1e0a34(0x162)]===_0x5562b1;_0x38d060[_0x1e0a34(0x16f)]({'lockKey':_0x148e4d[_0x1e0a34(0x17c)],'filePath':_0x148e4d[_0x1e0a34(0x164)],'remoteId':_0x52fe32?.[_0x1e0a34(0x140)]??null,'mode':_0x52fe32?.[_0x1e0a34(0x140)]?_0x1e0a34(0x14e):'create','status':!_0x363e9f&&_0x473402?_0x1e0a34(0x17e):_0x1e0a34(0x18c)});}return{'method':_0x1e0a34(0x149),'url':_0x1e0a34(0x13e),'body':{'appCode':_0xc9ed11['appCode'],'force':_0x363e9f,'files':_0x38d060,'cacheClearAtRuntime':_0x38d060[_0x1e0a34(0x157)](_0x4694ab=>_0x4694ab[_0x1e0a34(0x174)]===_0x1e0a34(0x18c)),'cacheClearAtRuntimeTimes':_0x38d060[_0x1e0a34(0x157)](_0x3ccd07=>_0x3ccd07['status']===_0x1e0a34(0x18c))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x1e0a34(0x185)+_0x38d060[_0x1e0a34(0x15e)]+_0x1e0a34(0x15d)};},async 'execute'(_0x35b86e){const _0x16aeb0=a32_0x1df605,_0x50ee1b=loadBffProjectConfig(_0x35b86e[_0x16aeb0(0x173)]),_0x38a720=await readBffLockFile(_0x50ee1b[_0x16aeb0(0x161)]),{lockData:_0x2c7aab,appLock:_0x1d89b4}=ensureLockScope(_0x38a720??createEmptyBffLock(),_0x35b86e[_0x16aeb0(0x173)],_0x50ee1b[_0x16aeb0(0x16e)],_0x16aeb0(0x16f)),_0x35bc69=await getTargetFunctions(_0x50ee1b,_0x35b86e);if(_0x35bc69[_0x16aeb0(0x15e)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':'No\x20local\x20BFF\x20functions\x20found.'};const _0x734cc9=_0x35b86e[_0x16aeb0(0x17f)](_0x16aeb0(0x14d)),_0x2b28b1=JSON[_0x16aeb0(0x18a)](JSON[_0x16aeb0(0x15f)](_0x2c7aab)),_0x5da47e=_0x2b28b1['apps'][_0x35b86e[_0x16aeb0(0x173)]];if(!_0x5da47e)throw new Error(_0x16aeb0(0x166)+_0x35b86e[_0x16aeb0(0x173)]+_0x16aeb0(0x182));const _0x4746c6=await buildHookMaps(_0x35b86e[_0x16aeb0(0x173)],_0x35b86e['apiDir'],_0x35bc69,_0x5da47e),_0x26dd67=[],_0x383f8c=[],_0x4221d3=[];for(const _0x59d011 of _0x35bc69){const _0x5336f7=await computeFileHash(_0x59d011[_0x16aeb0(0x164)]),_0x19775d=_0x5da47e[_0x16aeb0(0x154)][_0x59d011[_0x16aeb0(0x17c)]];if(!_0x734cc9&&_0x19775d&&_0x19775d[_0x16aeb0(0x162)]===_0x5336f7){_0x383f8c['push']({'lockKey':_0x59d011[_0x16aeb0(0x17c)],'reason':'unchanged'});continue;}try{await uploadSingleFunction(_0x35b86e[_0x16aeb0(0x173)],_0x59d011,_0x5da47e,_0x4746c6);const _0x6a7a29=_0x5da47e[_0x16aeb0(0x154)][_0x59d011[_0x16aeb0(0x17c)]];_0x26dd67[_0x16aeb0(0x16f)]({'lockKey':_0x59d011['lockKey'],'remoteId':_0x6a7a29?.[_0x16aeb0(0x140)]??0x0});}catch(_0x480cdc){_0x4221d3[_0x16aeb0(0x16f)]({'lockKey':_0x59d011[_0x16aeb0(0x17c)],'error':_0x480cdc instanceof Error?_0x480cdc['message']:String(_0x480cdc)});}}_0x5da47e[_0x16aeb0(0x14f)]=new Date()[_0x16aeb0(0x177)](),await writeBffLockFile(_0x50ee1b['lockFilePath'],_0x2b28b1),await waitForUploadedLockEntries(_0x50ee1b[_0x16aeb0(0x161)],_0x35b86e[_0x16aeb0(0x173)],_0x26dd67['map'](_0x12037f=>_0x12037f[_0x16aeb0(0x17c)]));let _0x5e0c70={'attempted':![],'cleared':![]};if(_0x26dd67[_0x16aeb0(0x15e)]>0x0)try{let _0x3b0275='';for(let _0x17e298=0x0;_0x17e298<CACHE_CLEAR_ATTEMPTS;_0x17e298+=0x1){_0x3b0275=await clearBffScriptCache(),_0x17e298<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x5e0c70={'attempted':!![],'cleared':!![],'message':_0x3b0275||'Runtime\x20script\x20cache\x20cleared.'};}catch(_0xa3e962){_0x5e0c70={'attempted':!![],'cleared':![],'error':_0xa3e962 instanceof Error?_0xa3e962[_0x16aeb0(0x142)]:String(_0xa3e962)};}const _0x370293=_0x4221d3[_0x16aeb0(0x15e)]===0x0&&(_0x5e0c70[_0x16aeb0(0x169)]?_0x5e0c70['cleared']:!![]),_0x3f7b99=_0x5e0c70[_0x16aeb0(0x169)]?_0x5e0c70[_0x16aeb0(0x175)]?_0x16aeb0(0x160):_0x16aeb0(0x184):_0x16aeb0(0x151);return{'ok':_0x370293,'data':{'uploaded':_0x26dd67,'skipped':_0x383f8c,'failed':_0x4221d3,'cacheClear':_0x5e0c70},'message':'Push\x20complete:\x20'+_0x26dd67[_0x16aeb0(0x15e)]+_0x16aeb0(0x159)+_0x383f8c[_0x16aeb0(0x15e)]+_0x16aeb0(0x15a)+_0x4221d3['length']+_0x16aeb0(0x15c)+_0x3f7b99};}};async function getTargetFunctions(_0x169a76,_0x499587){const _0x3622a9=a32_0x1df605,_0x3c910c=_0x499587[_0x3622a9(0x153)](_0x3622a9(0x16c)),_0x451f51=_0x499587[_0x3622a9(0x153)](_0x3622a9(0x176)),_0x78ea19=normalizeBffType(_0x3c910c)??undefined;if(_0x451f51&&!_0x78ea19)throw CliErrors[_0x3622a9(0x141)]('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x44f57d=await scanLocalBffFunctions(_0x169a76,_0x78ea19);if(_0x451f51){const _0x3637ef=_0x44f57d[_0x3622a9(0x179)](_0x516914=>_0x516914[_0x3622a9(0x176)]===_0x451f51);if(_0x3637ef[_0x3622a9(0x15e)]===0x0)throw CliErrors['validation'](_0x3622a9(0x14b)+_0x78ea19+'/'+_0x451f51);return _0x3637ef;}return _0x44f57d;}async function buildHookMaps(_0x379f10,_0x50f2a0,_0x4f4840,_0x2e7102){const _0x191d68=a32_0x1df605,_0x4ac18e=_0x4f4840['some'](_0x2c5a7d=>_0x2c5a7d[_0x191d68(0x16c)]==='HOOK');if(!_0x4ac18e)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x59014f=loadAliasMap(_0x50f2a0,undefined,resolveApiFilePath(_0x50f2a0,_0x379f10)),_0x35dfca=new Map(_0x59014f['map'](_0x2bef4e=>[_0x2bef4e[_0x191d68(0x167)],_0x2bef4e[_0x191d68(0x171)]]));for(const _0x122161 of Object[_0x191d68(0x16a)](_0x2e7102[_0x191d68(0x154)])){_0x122161[_0x191d68(0x167)]&&_0x122161[_0x191d68(0x171)]&&!_0x35dfca[_0x191d68(0x16d)](_0x122161[_0x191d68(0x167)])&&_0x35dfca[_0x191d68(0x17a)](_0x122161['alias'],_0x122161[_0x191d68(0x171)]);}const _0x12026f=await listDatasets(_0x379f10),_0x4b39e2=new Map(_0x12026f['map'](_0x1a5233=>[_0x1a5233['code'],_0x1a5233]));return{'aliasToDatasetCode':_0x35dfca,'datasetCodeToDataset':_0x4b39e2};}async function uploadSingleFunction(_0x4a6fd3,_0x582fcf,_0xa03355,_0x241742){const _0x14a340=a32_0x1df605,_0x3214ee=await readFile(_0x582fcf[_0x14a340(0x164)],'utf8'),_0x400beb=await computeFileHash(_0x582fcf['filePath']),_0x4d74ab=_0xa03355[_0x14a340(0x154)][_0x582fcf[_0x14a340(0x17c)]];if(_0x4d74ab?.[_0x14a340(0x140)]&&_0x4d74ab[_0x14a340(0x144)]==null)throw CliErrors[_0x14a340(0x141)](_0x582fcf[_0x14a340(0x17c)]+_0x14a340(0x168));let _0x1f671e=extractScriptDescription(_0x3214ee);if(!_0x1f671e&&_0x4d74ab?.['remoteId']){const _0x20c74b=await getBffScriptInfo(_0x4d74ab['remoteId']);_0x1f671e=_0x20c74b[_0x14a340(0x158)]||undefined;}const _0x10a51a={'appCode':_0x4a6fd3,'functionName':_0x582fcf[_0x14a340(0x176)],'scriptType':_0x582fcf['type'],'scriptContent':_0x3214ee};if(_0x4d74ab?.[_0x14a340(0x140)])_0x10a51a['id']=_0x4d74ab[_0x14a340(0x140)];if(_0x4d74ab?.[_0x14a340(0x144)]!=null)_0x10a51a[_0x14a340(0x144)]=_0x4d74ab['version'];if(_0x1f671e)_0x10a51a[_0x14a340(0x158)]=_0x1f671e;if(_0x582fcf['type']==='HOOK'){const _0x4458f3=_0x582fcf[_0x14a340(0x167)];if(!_0x4458f3||!_0x582fcf[_0x14a340(0x156)]||!_0x582fcf[_0x14a340(0x181)])throw CliErrors['validation']('Incomplete\x20HOOK\x20path:\x20'+_0x582fcf[_0x14a340(0x17c)]);const _0x431e3c=_0x241742[_0x14a340(0x18b)][_0x14a340(0x13c)](_0x4458f3)??_0x4d74ab?.['datasetCode']??_0x4458f3,_0x5b3702=_0x241742[_0x14a340(0x178)]['get'](_0x431e3c);if(!_0x5b3702)throw CliErrors['validation'](_0x14a340(0x143)+_0x4458f3+_0x14a340(0x17b)+(_0x14a340(0x172)+CLI_BIN_NAME+_0x14a340(0x145)));_0x10a51a[_0x14a340(0x17d)]=_0x5b3702['id'],_0x10a51a[_0x14a340(0x156)]=_0x582fcf[_0x14a340(0x156)],_0x10a51a['functionNode']=_0x582fcf[_0x14a340(0x181)];}const _0xdb82c6=await saveBffScript(_0x10a51a),_0xbb694d=_0xdb82c6['id'],_0x3a2d16=_0xdb82c6['script']??await getBffScriptInfo(_0xbb694d),_0x54f249={'hash':_0x400beb,'remoteId':_0xbb694d,'version':_0x3a2d16[_0x14a340(0x144)]};if(_0x582fcf[_0x14a340(0x16c)]===_0x14a340(0x13d)){const _0x27ee01=_0x582fcf['alias'],_0x1732d3=_0x241742[_0x14a340(0x18b)][_0x14a340(0x13c)](_0x27ee01)??_0x4d74ab?.['datasetCode']??_0x27ee01;_0x241742[_0x14a340(0x18b)]['has'](_0x27ee01)?_0x54f249[_0x14a340(0x167)]=_0x27ee01:_0x54f249['alias']=_0x4d74ab?.[_0x14a340(0x167)],_0x54f249['datasetCode']=_0x1732d3,_0x54f249[_0x14a340(0x156)]=_0x582fcf[_0x14a340(0x156)],_0x54f249[_0x14a340(0x181)]=_0x582fcf[_0x14a340(0x181)];}_0xa03355['functions'][_0x582fcf[_0x14a340(0x17c)]]=_0x54f249;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x5ada40,_0xa1fa43,_0x51a4b4){const _0x5e4de7=a32_0x1df605;if(_0x51a4b4[_0x5e4de7(0x15e)]===0x0)return;for(let _0x46ad91=0x0;_0x46ad91<LOCK_SETTLE_RETRY_COUNT;_0x46ad91+=0x1){const _0x4fd81d=await readBffLockFile(_0x5ada40),_0x454d06=_0x4fd81d?.[_0x5e4de7(0x183)]?.[_0xa1fa43]?.[_0x5e4de7(0x154)]??{},_0x407af8=_0x51a4b4[_0x5e4de7(0x186)](_0x560562=>!!_0x454d06[_0x560562]?.[_0x5e4de7(0x140)]);if(_0x407af8)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x5e4de7(0x15b)+_0x51a4b4[_0x5e4de7(0x187)](',\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0xee0ac6=a33_0x5de2;(function(_0x55d251,_0x304a5b){const _0x44fadf=a33_0x5de2,_0x1bd7a=_0x55d251();while(!![]){try{const _0x2bd383=-parseInt(_0x44fadf(0x1b4))/0x1+parseInt(_0x44fadf(0x19c))/0x2*(-parseInt(_0x44fadf(0x1a0))/0x3)+parseInt(_0x44fadf(0x1ab))/0x4*(-parseInt(_0x44fadf(0x1b1))/0x5)+-parseInt(_0x44fadf(0x1b2))/0x6*(parseInt(_0x44fadf(0x1bd))/0x7)+-parseInt(_0x44fadf(0x1a6))/0x8+-parseInt(_0x44fadf(0x1a4))/0x9+-parseInt(_0x44fadf(0x1ac))/0xa*(-parseInt(_0x44fadf(0x1aa))/0xb);if(_0x2bd383===_0x304a5b)break;else _0x1bd7a['push'](_0x1bd7a['shift']());}catch(_0x38dfe5){_0x1bd7a['push'](_0x1bd7a['shift']());}}}(a33_0x58f8,0x93877));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';function a33_0x5de2(_0x3c65b2,_0x53c3be){_0x3c65b2=_0x3c65b2-0x19c;const _0x58f8db=a33_0x58f8();let _0x5de2dc=_0x58f8db[_0x3c65b2];return _0x5de2dc;}import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';function a33_0x58f8(){const _0x5e203f=['370187XRWUMv','scriptsRoot','read','\x20added,\x20','bool','push','boolean','lockKey','All\x20BFF\x20scripts\x20are\x20in\x20sync.','273DOqyOr','appCode','2PscYmR','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','has','\x20remote-only','3117909YOYNZw','functions','length','\x20modified,\x20','4981374BfLfMx','map','2915480gNkfOi','alias','hash','\x20unchanged','253uFyLug','2897996NoztvY','1845640pgSRFl','remote','status','datasetCode','apiDir','5LobVLU','90582ZWacAi','filePath'];a33_0x58f8=function(){return _0x5e203f;};return a33_0x58f8();}import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':'bff','command':a33_0xee0ac6(0x1ae),'description':'Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','risk':a33_0xee0ac6(0x1b6),'flags':[{'name':a33_0xee0ac6(0x1ad),'type':a33_0xee0ac6(0x1ba),'description':a33_0xee0ac6(0x19d)}],async 'execute'(_0x5e3b95){const _0x2d19b8=a33_0xee0ac6,_0xe9491d=loadBffProjectConfig(_0x5e3b95[_0x2d19b8(0x1be)]),_0x7c9c24=await readBffLockFile(_0xe9491d['lockFilePath']),{appLock:_0x2c76eb}=ensureLockScope(_0x7c9c24??createEmptyBffLock(),_0x5e3b95[_0x2d19b8(0x1be)],_0xe9491d[_0x2d19b8(0x1b5)],_0x2d19b8(0x1ae)),_0x89bbc7=await scanLocalBffFunctions(_0xe9491d),_0x50bb5d=[],_0x6afb1e=[],_0x47b914=[];for(const _0x2be8e1 of _0x89bbc7){const _0xbacf3c=await computeFileHash(_0x2be8e1[_0x2d19b8(0x1b3)]),_0x11c421=_0x2c76eb[_0x2d19b8(0x1a1)][_0x2be8e1[_0x2d19b8(0x1bb)]];if(!_0x11c421)_0x50bb5d[_0x2d19b8(0x1b9)](_0x2be8e1['lockKey']);else _0x11c421[_0x2d19b8(0x1a8)]!==_0xbacf3c?_0x6afb1e[_0x2d19b8(0x1b9)](_0x2be8e1['lockKey']):_0x47b914[_0x2d19b8(0x1b9)](_0x2be8e1[_0x2d19b8(0x1bb)]);}const _0x88aacd=[];if(_0x5e3b95[_0x2d19b8(0x1b8)](_0x2d19b8(0x1ad))){const _0x37e15b=loadAliasMap(_0x5e3b95[_0x2d19b8(0x1b0)],undefined,resolveApiFilePath(_0x5e3b95[_0x2d19b8(0x1b0)],_0x5e3b95['appCode'])),_0x824f4b=new Map(_0x37e15b[_0x2d19b8(0x1a5)](_0x4334d4=>[_0x4334d4[_0x2d19b8(0x1af)],_0x4334d4[_0x2d19b8(0x1a7)]])),[_0x4df169,_0x4c3190]=await Promise['all']([listBffScripts(_0x5e3b95[_0x2d19b8(0x1be)]),getBffScriptStatistics(_0x5e3b95[_0x2d19b8(0x1be)])]),_0xb69f86=createHookLocationMap(_0x4c3190),_0x1da3c2=new Set(_0x89bbc7['map'](_0x297445=>_0x297445[_0x2d19b8(0x1bb)]));for(const _0x1307dd of _0x4df169){const _0x4cfef0=resolveRemoteScriptTarget(_0xe9491d,_0x1307dd,_0xb69f86,_0x2c76eb[_0x2d19b8(0x1a1)],_0x824f4b);_0x4cfef0&&!_0x1da3c2[_0x2d19b8(0x19e)](_0x4cfef0['lockKey'])&&_0x88aacd['push'](_0x4cfef0[_0x2d19b8(0x1bb)]);}}const _0x380f71=_0x50bb5d[_0x2d19b8(0x1a2)]===0x0&&_0x6afb1e['length']===0x0&&_0x88aacd[_0x2d19b8(0x1a2)]===0x0;return{'ok':!![],'data':{'added':_0x50bb5d,'modified':_0x6afb1e,'unchanged':_0x47b914,'remoteOnly':_0x88aacd},'message':_0x380f71?_0x2d19b8(0x1bc):_0x50bb5d[_0x2d19b8(0x1a2)]+_0x2d19b8(0x1b7)+_0x6afb1e[_0x2d19b8(0x1a2)]+_0x2d19b8(0x1a3)+_0x47b914['length']+_0x2d19b8(0x1a9)+(_0x88aacd['length']>0x0?',\x20'+_0x88aacd[_0x2d19b8(0x1a2)]+_0x2d19b8(0x19f):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a34_0x23e48d=a34_0x11b2;(function(_0x40b645,_0x49ca55){const _0x26a812=a34_0x11b2,_0x5a57a3=_0x40b645();while(!![]){try{const _0x415432=parseInt(_0x26a812(0xb1))/0x1*(-parseInt(_0x26a812(0x89))/0x2)+-parseInt(_0x26a812(0xc6))/0x3*(parseInt(_0x26a812(0xaf))/0x4)+-parseInt(_0x26a812(0x90))/0x5+-parseInt(_0x26a812(0x84))/0x6+parseInt(_0x26a812(0xa1))/0x7*(parseInt(_0x26a812(0xca))/0x8)+-parseInt(_0x26a812(0xbd))/0x9+parseInt(_0x26a812(0xb8))/0xa*(parseInt(_0x26a812(0x9c))/0xb);if(_0x415432===_0x49ca55)break;else _0x5a57a3['push'](_0x5a57a3['shift']());}catch(_0x424b27){_0x5a57a3['push'](_0x5a57a3['shift']());}}}(a34_0x5153,0xefa5c));import a34_0x154dcc from'chalk';import a34_0x5a8f21 from'ora';import a34_0x2abcd8 from'semver';import{execa}from'execa';import{NPM_PACKAGE_NAME}from'../constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';import{CliErrors}from'../errors.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,RABETBASE_SKILL_SOURCE,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{getCdnConfig}from'../utils/cdn-config.js';function a34_0x5153(){const _0x2c7ad2=['230383uxGLxp','entries','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','beta','fromEntries','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','Already\x20up\x20to\x20date\x20(v','80sZgJYX','unknown','skills','gray','pipe','17132688QMyIdz','inherit','no-skills','object','execPath','\x20→\x20','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','run','cwd','2178yeYVLM','Skipping\x20official\x20skill\x20package\x20(--no-skills).','version','Beta\x20version:\x20','5812600lxmsYp','Invalid\x20version:\x20','toLowerCase','write','source','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','nonInteractive','trim','message','/dist-tags','Update\x20available:\x20','3175194tQfCTF','stableVersion','slice','boolean','install','4FMhTqf','flag','Update\x20failed','filter','validation','Install\x20a\x20specific\x20CLI\x20version','Current\x20version:\x20','6789495aoJyXj','green','Refresh\x20official\x20skill\x20package\x20after\x20updating','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','start','timeout','latest','log','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','Checking\x20for\x20updates...','valid','\x20\x20Run\x20manually:\x20','7528334vvbBpf','bool','bun','fail','error','14SprHmt','warn','Updating\x20via\x20','info','Checking\x20official\x20skill\x20package...','yellow','\x20\x20Official\x20skill\x20update\x20failed:\x20','Already\x20on\x20requested\x20version\x20(v','npm','Skip\x20official\x20skill\x20package\x20refresh\x20after\x20updating','Updated\x20to\x20v','Version\x20comparison\x20failed','string','str','9340BzvFgb','\x20\x20Skipped\x20skill\x20install\x20(RABETBASE_SKIP_NPX_SKILLS=1).'];a34_0x5153=function(){return _0x2c7ad2;};return a34_0x5153();}import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x51573a=a34_0x11b2;return GIT_COMMIT!==_0x51573a(0xb9)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x51573a(0x86)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x10f4ff=a34_0x11b2,_0x3958ff=process[_0x10f4ff(0xc1)][_0x10f4ff(0xcc)]();if(_0x3958ff['includes'](_0x10f4ff(0x9e)))return _0x10f4ff(0x9e);return'npm';}const updateFlags=[{'name':'beta','type':a34_0x23e48d(0x87),'description':'Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','default':![]},{'name':a34_0x23e48d(0xc8),'type':a34_0x23e48d(0xad),'description':a34_0x23e48d(0x8e)},{'name':a34_0x23e48d(0xbf),'type':a34_0x23e48d(0x87),'description':a34_0x23e48d(0xaa),'default':![]},{'name':a34_0x23e48d(0xba),'type':'boolean','description':a34_0x23e48d(0x92),'default':!![],'hidden':!![]}];function getRequestedVersion(_0x554268){const _0x380ff7=a34_0x23e48d;return _0x554268[_0x380ff7(0xae)]('version')[_0x380ff7(0xd1)]();}function shouldSkipOfficialSkill(_0x439ae7){const _0x414929=a34_0x23e48d;return _0x439ae7['bool'](_0x414929(0xbf))||_0x439ae7[_0x414929(0x8a)](_0x414929(0xba))===![];}async function validateUpdateFlags(_0x2fea43){const _0x59b161=a34_0x23e48d,_0x433345=_0x2fea43['bool'](_0x59b161(0xb4)),_0x4a9b6e=getRequestedVersion(_0x2fea43);if(_0x433345&&_0x4a9b6e)throw CliErrors[_0x59b161(0x8d)]('--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.');if(_0x4a9b6e&&!a34_0x2abcd8[_0x59b161(0x9a)](_0x4a9b6e))throw CliErrors[_0x59b161(0x8d)](_0x59b161(0xcb)+_0x4a9b6e,_0x59b161(0xcf));}async function fetchNpmDistTags(){const _0x4795ff=a34_0x23e48d;try{const _0x1c7fb9=await fetch('https://registry.npmjs.org/-/package/'+encodeURIComponent(NPM_PACKAGE_NAME)+_0x4795ff(0xd3),{'signal':AbortSignal[_0x4795ff(0x95)](0x2710)});if(!_0x1c7fb9['ok'])return null;const _0x4f1f94=await _0x1c7fb9['json']();if(!_0x4f1f94||typeof _0x4f1f94!==_0x4795ff(0xc0))return null;return Object[_0x4795ff(0xb5)](Object[_0x4795ff(0xb2)](_0x4f1f94)[_0x4795ff(0x8c)](([,_0x2ea940])=>typeof _0x2ea940==='string'&&_0x2ea940[_0x4795ff(0xd1)]()['length']>0x0)['map'](([_0x4bc233,_0x4d7e0e])=>[_0x4bc233,String(_0x4d7e0e)[_0x4795ff(0xd1)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x57a55e){const _0x110088=await fetchNpmDistTags();return _0x110088?.[_0x57a55e]??null;}async function fetchLatestVersion(){const _0x3f189c=a34_0x23e48d,_0x1d5ca4=await fetchNpmDistTagVersion(_0x3f189c(0x96));if(_0x1d5ca4)return _0x1d5ca4;const _0x42489d=await getCdnConfig();return _0x42489d?.['cli']?.[_0x3f189c(0x85)]??null;}async function resolveTargetVersion(_0xb8ea95){const _0x74103c=a34_0x23e48d,_0x2d3a90=getRequestedVersion(_0xb8ea95);if(_0x2d3a90)return{'version':_0x2d3a90,'source':_0x74103c(0xc8)};if(_0xb8ea95['bool']('beta')){const _0x2ee189=await fetchNpmDistTagVersion(_0x74103c(0xb4));if(!_0x2ee189)return null;return{'version':_0x2ee189,'source':_0x74103c(0xb4)};}const _0x21eafa=await fetchLatestVersion();if(!_0x21eafa)return null;return{'version':_0x21eafa,'source':'latest'};}function shouldInstallTarget(_0x469e03,_0xd1ea81){const _0x1c4d5e=a34_0x23e48d;if(_0xd1ea81[_0x1c4d5e(0xce)]==='version'||_0xd1ea81['source']==='beta')return!a34_0x2abcd8['eq'](_0x469e03,_0xd1ea81[_0x1c4d5e(0xc8)]);return a34_0x2abcd8['lt'](_0x469e03,_0xd1ea81[_0x1c4d5e(0xc8)]);}function a34_0x11b2(_0x39eaa0,_0x1adfcb){_0x39eaa0=_0x39eaa0-0x84;const _0x515393=a34_0x5153();let _0x11b26b=_0x515393[_0x39eaa0];return _0x11b26b;}function getInstallPlanLabel(_0x199a59,_0x195609){const _0x3da09f=a34_0x23e48d;switch(_0x195609[_0x3da09f(0xce)]){case _0x3da09f(0xb4):return _0x3da09f(0xc9)+a34_0x154dcc[_0x3da09f(0xa6)](_0x199a59)+'\x20→\x20'+a34_0x154dcc[_0x3da09f(0x91)](_0x195609[_0x3da09f(0xc8)]);case _0x3da09f(0xc8):return'Requested\x20version:\x20'+a34_0x154dcc[_0x3da09f(0xa6)](_0x199a59)+_0x3da09f(0xc2)+a34_0x154dcc[_0x3da09f(0x91)](_0x195609[_0x3da09f(0xc8)]);case _0x3da09f(0x96):default:return _0x3da09f(0xd4)+a34_0x154dcc['yellow'](_0x199a59)+_0x3da09f(0xc2)+a34_0x154dcc[_0x3da09f(0x91)](_0x195609[_0x3da09f(0xc8)]);}}async function installOfficialSkill(_0x589d4c){const _0x1f0d1d=a34_0x23e48d;console['log'](a34_0x154dcc[_0x1f0d1d(0xbb)](_0x1f0d1d(0xa5)));const _0x14a8e2=runNpxSkillsAddGlobal(process[_0x1f0d1d(0xc5)](),RABETBASE_SKILL_SOURCE,{'stdio':_0x589d4c?_0x1f0d1d(0xbc):_0x1f0d1d(0xbe)});if(_0x14a8e2['skipped']){console[_0x1f0d1d(0x97)](a34_0x154dcc[_0x1f0d1d(0xbb)](_0x1f0d1d(0xb0)));return;}if(_0x14a8e2['ok']){console['log'](a34_0x154dcc[_0x1f0d1d(0xbb)]('\x20\x20Official\x20skill\x20package\x20is\x20up\x20to\x20date.'));return;}console[_0x1f0d1d(0xa2)](a34_0x154dcc[_0x1f0d1d(0xa6)](_0x1f0d1d(0xa7)+(_0x14a8e2[_0x1f0d1d(0xa0)]||_0x1f0d1d(0xb9)))),console[_0x1f0d1d(0x97)](a34_0x154dcc[_0x1f0d1d(0xbb)](_0x1f0d1d(0x9b)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE));}async function execute(_0x3505e9){const _0x38c5bf=a34_0x23e48d;await validateUpdateFlags(_0x3505e9);const _0x392729=getCurrentVersion();console['log'](_0x38c5bf(0x8f)+_0x392729);const _0x373210=a34_0x5a8f21(_0x38c5bf(0x99))[_0x38c5bf(0x94)](),_0x14d377=await resolveTargetVersion(_0x3505e9);if(!_0x14d377){const _0xdfd60c=_0x3505e9[_0x38c5bf(0x9d)]('beta')?_0x38c5bf(0xb6):_0x38c5bf(0xc3);return _0x373210[_0x38c5bf(0x9f)](_0xdfd60c),console[_0x38c5bf(0x97)](a34_0x154dcc[_0x38c5bf(0xbb)](_0x38c5bf(0x98)+NPM_PACKAGE_NAME+'@latest')),{'ok':![],'message':_0xdfd60c};}const _0x3a29c2=a34_0x2abcd8[_0x38c5bf(0x9a)](VERSION),_0x365610=a34_0x2abcd8[_0x38c5bf(0x9a)](_0x14d377[_0x38c5bf(0xc8)]);if(!_0x3a29c2||!_0x365610)return _0x373210[_0x38c5bf(0x9f)](_0x38c5bf(0xac)),{'ok':![],'message':_0x38c5bf(0xac)};if(!shouldInstallTarget(_0x3a29c2,_0x14d377)){const _0x3b4cae=_0x14d377['source']===_0x38c5bf(0xc8)?_0x38c5bf(0xa8)+_0x14d377[_0x38c5bf(0xc8)]+')':_0x38c5bf(0xb7)+_0x14d377['version']+')';return _0x373210['succeed'](_0x3b4cae),shouldSkipOfficialSkill(_0x3505e9)?console[_0x38c5bf(0x97)](a34_0x154dcc[_0x38c5bf(0xbb)](_0x38c5bf(0xc7))):await installOfficialSkill(_0x3505e9['nonInteractive']),{'ok':!![]};}_0x373210[_0x38c5bf(0xa4)](getInstallPlanLabel(_0x392729,_0x14d377));const _0x597ea5=detectPackageManager(),_0x3e7032=_0x597ea5===_0x38c5bf(0xa9)?resolveNpmBin(_0x38c5bf(0xa9)):_0x597ea5,_0x5d9087=a34_0x5a8f21(_0x38c5bf(0xa3)+_0x597ea5+'...')[_0x38c5bf(0x94)]();try{return await execa(_0x3e7032,[_0x38c5bf(0x88),'-g',NPM_PACKAGE_NAME+'@'+_0x14d377[_0x38c5bf(0xc8)]],{'stdio':'pipe'}),_0x5d9087['succeed'](_0x38c5bf(0xab)+_0x14d377[_0x38c5bf(0xc8)]),console[_0x38c5bf(0x97)](a34_0x154dcc['gray'](_0x38c5bf(0xb3))),shouldSkipOfficialSkill(_0x3505e9)?console[_0x38c5bf(0x97)](a34_0x154dcc[_0x38c5bf(0xbb)](_0x38c5bf(0xc7))):await installOfficialSkill(_0x3505e9[_0x38c5bf(0xd0)]),{'ok':!![]};}catch(_0x413887){return _0x5d9087[_0x38c5bf(0x9f)](_0x38c5bf(0x8b)),console[_0x38c5bf(0xa0)](a34_0x154dcc['red']('\x20\x20'+_0x413887['message'])),console[_0x38c5bf(0x97)](a34_0x154dcc['gray']('\x20\x20Try\x20manually:\x20'+_0x597ea5+'\x20install\x20-g\x20'+NPM_PACKAGE_NAME+'@'+_0x14d377[_0x38c5bf(0xc8)])),{'ok':![],'message':_0x413887[_0x38c5bf(0xd2)]};}}export const updateDefinition={'service':'update','command':a34_0x23e48d(0xc4),'description':a34_0x23e48d(0x93),'risk':a34_0x23e48d(0xcd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a34_0x895ab=a34_0x414f;function a34_0x414f(_0x1f22e1,_0x5acac7){_0x1f22e1=_0x1f22e1-0xcf;const _0x6c9901=a34_0x6c99();let _0x414f9e=_0x6c9901[_0x1f22e1];return _0x414f9e;}(function(_0x1115bb,_0x4ca2ab){const _0x32adee=a34_0x414f,_0x3d95e8=_0x1115bb();while(!![]){try{const _0x471f97=parseInt(_0x32adee(0xd1))/0x1+parseInt(_0x32adee(0xf8))/0x2+parseInt(_0x32adee(0xff))/0x3+-parseInt(_0x32adee(0xde))/0x4*(-parseInt(_0x32adee(0x110))/0x5)+-parseInt(_0x32adee(0xee))/0x6+-parseInt(_0x32adee(0xfc))/0x7*(parseInt(_0x32adee(0xef))/0x8)+parseInt(_0x32adee(0x10b))/0x9*(-parseInt(_0x32adee(0xea))/0xa);if(_0x471f97===_0x4ca2ab)break;else _0x3d95e8['push'](_0x3d95e8['shift']());}catch(_0x59e84e){_0x3d95e8['push'](_0x3d95e8['shift']());}}}(a34_0x6c99,0xe17a5));import a34_0x471d34 from'chalk';import a34_0x790cc1 from'ora';import a34_0x3df130 from'semver';import{execa}from'execa';import{NPM_PACKAGE_NAME}from'../constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';import{CliErrors}from'../errors.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,RABETBASE_SKILL_SOURCE,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{getCdnConfig}from'../utils/cdn-config.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x48f146=a34_0x414f;return GIT_COMMIT!==_0x48f146(0xe0)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME['slice'](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x280b08=a34_0x414f,_0x242132=process[_0x280b08(0xfe)][_0x280b08(0xf5)]();if(_0x242132['includes']('bun'))return _0x280b08(0x10f);return _0x280b08(0xed);}const updateFlags=[{'name':a34_0x895ab(0x10a),'type':a34_0x895ab(0xf3),'description':'Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','default':![]},{'name':a34_0x895ab(0xf2),'type':a34_0x895ab(0x102),'description':a34_0x895ab(0xd0)},{'name':a34_0x895ab(0x106),'type':'boolean','description':a34_0x895ab(0xf1),'default':![]},{'name':a34_0x895ab(0x10e),'type':a34_0x895ab(0xf3),'description':'Refresh\x20official\x20skill\x20package\x20after\x20updating','default':!![],'hidden':!![]}];function a34_0x6c99(){const _0x441451=['Version\x20comparison\x20failed','nonInteractive','686406LCZTnT','\x20install\x20-g\x20','\x20\x20Official\x20skill\x20package\x20is\x20up\x20to\x20date.','install','52451YsqfAV','entries','execPath','2311845xyxowN','validation','\x20\x20Try\x20manually:\x20','string','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','str','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','no-skills','Requested\x20version:\x20','run','\x20\x20Skipped\x20skill\x20install\x20(RABETBASE_SKIP_NPX_SKILLS=1).','beta','609426caDaux','error','Already\x20on\x20requested\x20version\x20(v','skills','bun','541435YRetgl','write','gray','source','green','info','object','Current\x20version:\x20','pipe','latest','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','bool','Updated\x20to\x20v','Install\x20a\x20specific\x20CLI\x20version','1468749qwsmNe','\x20→\x20','inherit','fail','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','succeed','log','Skipping\x20official\x20skill\x20package\x20(--no-skills).','Checking\x20for\x20updates...','...','Update\x20failed','skipped','https://registry.npmjs.org/-/package/','60rDJoca','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','unknown','message','trim','Checking\x20official\x20skill\x20package...','json','cwd','\x20\x20Run\x20manually:\x20','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','Invalid\x20version:\x20','10WCKjJE','Updating\x20via\x20','length','npm','8548644EpbJCf','1912DhYYJu','yellow','Skip\x20official\x20skill\x20package\x20refresh\x20after\x20updating','version','boolean','valid','toLowerCase'];a34_0x6c99=function(){return _0x441451;};return a34_0x6c99();}function getRequestedVersion(_0x2210f7){const _0x4bab03=a34_0x895ab;return _0x2210f7[_0x4bab03(0x104)](_0x4bab03(0xf2))[_0x4bab03(0xe2)]();}function shouldSkipOfficialSkill(_0x146669){const _0x12babd=a34_0x895ab;return _0x146669[_0x12babd(0x11b)](_0x12babd(0x106))||_0x146669['flag'](_0x12babd(0x10e))===![];}async function validateUpdateFlags(_0x16cb77){const _0x1ff5dd=a34_0x895ab,_0x3aafe5=_0x16cb77['bool'](_0x1ff5dd(0x10a)),_0x1f85e9=getRequestedVersion(_0x16cb77);if(_0x3aafe5&&_0x1f85e9)throw CliErrors[_0x1ff5dd(0x100)](_0x1ff5dd(0x11a),_0x1ff5dd(0xe7));if(_0x1f85e9&&!a34_0x3df130[_0x1ff5dd(0xf4)](_0x1f85e9))throw CliErrors[_0x1ff5dd(0x100)](_0x1ff5dd(0xe9)+_0x1f85e9,_0x1ff5dd(0x103));}async function fetchNpmDistTags(){const _0xdc29ee=a34_0x895ab;try{const _0x1c9348=await fetch(_0xdc29ee(0xdd)+encodeURIComponent(NPM_PACKAGE_NAME)+'/dist-tags',{'signal':AbortSignal['timeout'](0x2710)});if(!_0x1c9348['ok'])return null;const _0x215c1=await _0x1c9348[_0xdc29ee(0xe4)]();if(!_0x215c1||typeof _0x215c1!==_0xdc29ee(0x116))return null;return Object['fromEntries'](Object[_0xdc29ee(0xfd)](_0x215c1)['filter'](([,_0x53d356])=>typeof _0x53d356===_0xdc29ee(0x102)&&_0x53d356[_0xdc29ee(0xe2)]()[_0xdc29ee(0xec)]>0x0)['map'](([_0x1331be,_0x16b7d9])=>[_0x1331be,String(_0x16b7d9)[_0xdc29ee(0xe2)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x5a627f){const _0x596bf6=await fetchNpmDistTags();return _0x596bf6?.[_0x5a627f]??null;}async function fetchLatestVersion(){const _0xf90c8d=a34_0x895ab,_0x477dac=await fetchNpmDistTagVersion(_0xf90c8d(0x119));if(_0x477dac)return _0x477dac;const _0x264a6a=await getCdnConfig();return _0x264a6a?.['cli']?.['stableVersion']??null;}async function resolveTargetVersion(_0x45a7eb){const _0x366835=a34_0x895ab,_0x20989d=getRequestedVersion(_0x45a7eb);if(_0x20989d)return{'version':_0x20989d,'source':_0x366835(0xf2)};if(_0x45a7eb[_0x366835(0x11b)](_0x366835(0x10a))){const _0x2f32eb=await fetchNpmDistTagVersion(_0x366835(0x10a));if(!_0x2f32eb)return null;return{'version':_0x2f32eb,'source':_0x366835(0x10a)};}const _0x50e07d=await fetchLatestVersion();if(!_0x50e07d)return null;return{'version':_0x50e07d,'source':_0x366835(0x119)};}function shouldInstallTarget(_0x335634,_0x5c0a24){const _0x4e76ff=a34_0x895ab;if(_0x5c0a24['source']===_0x4e76ff(0xf2)||_0x5c0a24[_0x4e76ff(0x113)]===_0x4e76ff(0x10a))return!a34_0x3df130['eq'](_0x335634,_0x5c0a24[_0x4e76ff(0xf2)]);return a34_0x3df130['lt'](_0x335634,_0x5c0a24[_0x4e76ff(0xf2)]);}function getInstallPlanLabel(_0x56ee40,_0x3f9420){const _0x45b0f0=a34_0x895ab;switch(_0x3f9420[_0x45b0f0(0x113)]){case _0x45b0f0(0x10a):return'Beta\x20version:\x20'+a34_0x471d34['yellow'](_0x56ee40)+_0x45b0f0(0xd2)+a34_0x471d34[_0x45b0f0(0x114)](_0x3f9420['version']);case _0x45b0f0(0xf2):return _0x45b0f0(0x107)+a34_0x471d34['yellow'](_0x56ee40)+_0x45b0f0(0xd2)+a34_0x471d34[_0x45b0f0(0x114)](_0x3f9420[_0x45b0f0(0xf2)]);case _0x45b0f0(0x119):default:return'Update\x20available:\x20'+a34_0x471d34[_0x45b0f0(0xf0)](_0x56ee40)+_0x45b0f0(0xd2)+a34_0x471d34[_0x45b0f0(0x114)](_0x3f9420[_0x45b0f0(0xf2)]);}}async function installOfficialSkill(_0x58e4ff){const _0x4fbfdb=a34_0x895ab;console['log'](a34_0x471d34[_0x4fbfdb(0x112)](_0x4fbfdb(0xe3)));const _0x5471d9=runNpxSkillsAddGlobal(process[_0x4fbfdb(0xe5)](),RABETBASE_SKILL_SOURCE,{'stdio':_0x58e4ff?_0x4fbfdb(0x118):_0x4fbfdb(0xd3)});if(_0x5471d9[_0x4fbfdb(0xdc)]){console[_0x4fbfdb(0xd7)](a34_0x471d34['gray'](_0x4fbfdb(0x109)));return;}if(_0x5471d9['ok']){console['log'](a34_0x471d34[_0x4fbfdb(0x112)](_0x4fbfdb(0xfa)));return;}console['warn'](a34_0x471d34[_0x4fbfdb(0xf0)]('\x20\x20Official\x20skill\x20update\x20failed:\x20'+(_0x5471d9[_0x4fbfdb(0x10c)]||_0x4fbfdb(0xe0)))),console[_0x4fbfdb(0xd7)](a34_0x471d34['gray'](_0x4fbfdb(0xe6)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE));}async function execute(_0x43928d){const _0x2d9753=a34_0x895ab;await validateUpdateFlags(_0x43928d);const _0x29d6d7=getCurrentVersion();console[_0x2d9753(0xd7)](_0x2d9753(0x117)+_0x29d6d7);const _0x318c7b=a34_0x790cc1(_0x2d9753(0xd9))['start'](),_0x3f4c73=await resolveTargetVersion(_0x43928d);if(!_0x3f4c73){const _0x2251db=_0x43928d[_0x2d9753(0x11b)]('beta')?_0x2d9753(0x105):_0x2d9753(0xe8);return _0x318c7b[_0x2d9753(0xd4)](_0x2251db),console[_0x2d9753(0xd7)](a34_0x471d34[_0x2d9753(0x112)](_0x2d9753(0xdf)+NPM_PACKAGE_NAME+'@latest')),{'ok':![],'message':_0x2251db};}const _0x17b813=a34_0x3df130[_0x2d9753(0xf4)](VERSION),_0x5696bc=a34_0x3df130[_0x2d9753(0xf4)](_0x3f4c73['version']);if(!_0x17b813||!_0x5696bc)return _0x318c7b[_0x2d9753(0xd4)](_0x2d9753(0xf6)),{'ok':![],'message':_0x2d9753(0xf6)};if(!shouldInstallTarget(_0x17b813,_0x3f4c73)){const _0x203eda=_0x3f4c73['source']==='version'?_0x2d9753(0x10d)+_0x3f4c73['version']+')':'Already\x20up\x20to\x20date\x20(v'+_0x3f4c73['version']+')';return _0x318c7b[_0x2d9753(0xd6)](_0x203eda),shouldSkipOfficialSkill(_0x43928d)?console['log'](a34_0x471d34['gray'](_0x2d9753(0xd8))):await installOfficialSkill(_0x43928d['nonInteractive']),{'ok':!![]};}_0x318c7b[_0x2d9753(0x115)](getInstallPlanLabel(_0x29d6d7,_0x3f4c73));const _0x54b0ed=detectPackageManager(),_0x43d408=_0x54b0ed==='npm'?resolveNpmBin('npm'):_0x54b0ed,_0x3ae172=a34_0x790cc1(_0x2d9753(0xeb)+_0x54b0ed+_0x2d9753(0xda))['start']();try{return await execa(_0x43d408,[_0x2d9753(0xfb),'-g',NPM_PACKAGE_NAME+'@'+_0x3f4c73[_0x2d9753(0xf2)]],{'stdio':_0x2d9753(0x118)}),_0x3ae172[_0x2d9753(0xd6)](_0x2d9753(0xcf)+_0x3f4c73['version']),console[_0x2d9753(0xd7)](a34_0x471d34[_0x2d9753(0x112)](_0x2d9753(0xd5))),shouldSkipOfficialSkill(_0x43928d)?console[_0x2d9753(0xd7)](a34_0x471d34[_0x2d9753(0x112)](_0x2d9753(0xd8))):await installOfficialSkill(_0x43928d[_0x2d9753(0xf7)]),{'ok':!![]};}catch(_0x35cfaf){return _0x3ae172[_0x2d9753(0xd4)](_0x2d9753(0xdb)),console[_0x2d9753(0x10c)](a34_0x471d34['red']('\x20\x20'+_0x35cfaf[_0x2d9753(0xe1)])),console['log'](a34_0x471d34[_0x2d9753(0x112)](_0x2d9753(0x101)+_0x54b0ed+_0x2d9753(0xf9)+NPM_PACKAGE_NAME+'@'+_0x3f4c73[_0x2d9753(0xf2)])),{'ok':![],'message':_0x35cfaf[_0x2d9753(0xe1)]};}}export const updateDefinition={'service':'update','command':a34_0x895ab(0x108),'description':'Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','risk':a34_0x895ab(0x111),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x6e64d5,_0x8f8862){const _0x11cd59=a35_0x156a,_0x356fcd=_0x6e64d5();while(!![]){try{const _0x340595=-parseInt(_0x11cd59(0x1d8))/0x1+parseInt(_0x11cd59(0x1de))/0x2*(-parseInt(_0x11cd59(0x1e1))/0x3)+-parseInt(_0x11cd59(0x1dc))/0x4+parseInt(_0x11cd59(0x1d9))/0x5*(parseInt(_0x11cd59(0x1df))/0x6)+parseInt(_0x11cd59(0x1dd))/0x7+parseInt(_0x11cd59(0x1e0))/0x8+parseInt(_0x11cd59(0x1db))/0x9*(-parseInt(_0x11cd59(0x1da))/0xa);if(_0x340595===_0x8f8862)break;else _0x356fcd['push'](_0x356fcd['shift']());}catch(_0x362ba6){_0x356fcd['push'](_0x356fcd['shift']());}}}(a35_0x1c7c,0x9b4ae));function a35_0x156a(_0x282cfb,_0x3eb68f){_0x282cfb=_0x282cfb-0x1d8;const _0x1c7c80=a35_0x1c7c();let _0x156afb=_0x1c7c80[_0x282cfb];return _0x156afb;}function a35_0x1c7c(){const _0x5c752c=['2364eidFfp','4249880sdLgkp','1875jsEFnK','965933oAoEdG','15915OMpVcB','182740iAWPOu','81jhARMv','3053788WUBjRx','6388984nDDLWD','538MvnbwI'];a35_0x1c7c=function(){return _0x5c752c;};return a35_0x1c7c();}import{codegenSdk}from'../../commands/codegen/sdk.js';import{codegenSql}from'../../commands/codegen/sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x1d5dfe=a36_0x3252;function a36_0x4344(){const _0x5d9769=['skip-imports','41797HRgLPA','codegen','4644720gclycl','tableName','string','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','2476038ASkOEp','3245565TwqjVN','operation','267966jrKnbf','370749CdsROy','8xWPnhq','boolean','read','568UwAIny','sdk','code','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','str','3Pnlrls','appCode','14903370AHoDVx','Omit\x20import\x20statements\x20from\x20generated\x20code'];a36_0x4344=function(){return _0x5d9769;};return a36_0x4344();}(function(_0x4a0629,_0x595897){const _0x21f7ad=a36_0x3252,_0x174e36=_0x4a0629();while(!![]){try{const _0x2e7d4b=-parseInt(_0x21f7ad(0x1f5))/0x1*(-parseInt(_0x21f7ad(0x203))/0x2)+parseInt(_0x21f7ad(0x204))/0x3*(-parseInt(_0x21f7ad(0x205))/0x4)+-parseInt(_0x21f7ad(0x201))/0x5+parseInt(_0x21f7ad(0x200))/0x6+-parseInt(_0x21f7ad(0x1fa))/0x7*(parseInt(_0x21f7ad(0x208))/0x8)+-parseInt(_0x21f7ad(0x1fc))/0x9+parseInt(_0x21f7ad(0x1f7))/0xa;if(_0x2e7d4b===_0x595897)break;else _0x174e36['push'](_0x174e36['shift']());}catch(_0x356099){_0x174e36['push'](_0x174e36['shift']());}}}(a36_0x4344,0x726b3));import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';function a36_0x3252(_0x2c03a3,_0xca6087){_0x2c03a3=_0x2c03a3-0x1f1;const _0x434475=a36_0x4344();let _0x3252a0=_0x434475[_0x2c03a3];return _0x3252a0;}import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const codegenSdk={'service':a36_0x1d5dfe(0x1fb),'command':a36_0x1d5dfe(0x1f1),'description':a36_0x1d5dfe(0x1ff),'risk':a36_0x1d5dfe(0x207),'flags':[CODE_FLAG_OPTIONAL,{'name':'alias','type':a36_0x1d5dfe(0x1fe),'description':a36_0x1d5dfe(0x1f3)},{'name':a36_0x1d5dfe(0x202),'type':'string','required':!![],'description':'Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)'},{'name':a36_0x1d5dfe(0x1f9),'type':a36_0x1d5dfe(0x206),'description':a36_0x1d5dfe(0x1f8)}],async 'execute'(_0x125d66){const _0x197b11=a36_0x1d5dfe,{dataset:_0x4a2229,operation:_0x4219e7}=await getOperationDetail(_0x125d66[_0x197b11(0x1f6)],_0x125d66[_0x197b11(0x1f4)](_0x197b11(0x1f2)),_0x125d66['str'](_0x197b11(0x202))),_0x4fbd8f=generateSdkCode(_0x4a2229,_0x4219e7,{'includeImports':!_0x125d66['bool']('skip-imports')});return{'ok':!![],'data':{'dataset':{'name':_0x4a2229['name'],'code':_0x4a2229[_0x197b11(0x1f2)],'tableName':_0x4a2229[_0x197b11(0x1fd)]},'operation':_0x125d66[_0x197b11(0x1f4)](_0x197b11(0x202)),'code':_0x4fbd8f}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a37_0x3091d3=a37_0x3d22;(function(_0x335a81,_0x5c10eb){const _0x3813cf=a37_0x3d22,_0x5c6129=_0x335a81();while(!![]){try{const _0x5b40c2=parseInt(_0x3813cf(0xcf))/0x1*(parseInt(_0x3813cf(0xca))/0x2)+-parseInt(_0x3813cf(0xd4))/0x3+-parseInt(_0x3813cf(0xbf))/0x4*(-parseInt(_0x3813cf(0xc7))/0x5)+parseInt(_0x3813cf(0xc5))/0x6*(-parseInt(_0x3813cf(0xd0))/0x7)+-parseInt(_0x3813cf(0xc9))/0x8*(parseInt(_0x3813cf(0xd2))/0x9)+parseInt(_0x3813cf(0xc6))/0xa+-parseInt(_0x3813cf(0xd1))/0xb*(parseInt(_0x3813cf(0xc1))/0xc);if(_0x5b40c2===_0x5c10eb)break;else _0x5c6129['push'](_0x5c6129['shift']());}catch(_0x4bcc2b){_0x5c6129['push'](_0x5c6129['shift']());}}}(a37_0xa05f,0x73791));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';function a37_0xa05f(){const _0x1b9847=['44068ZCynxa','21tyxRpA','2320813Cnowzg','2529THthrO','bff','360120rUKDbU','sqlCode','sqlcode','target','str','appCode','4eEuyyk','read','24IgWYGC','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','sdk','sql','1387452KwlepK','7863250hpbWNn','4296530IlBajW','boolean','1968KTpTPD','6lJZBsO','no-imports','sqlName','codegen','string'];a37_0xa05f=function(){return _0x1b9847;};return a37_0xa05f();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a37_0x3d22(_0xfbdb8c,_0x5147b5){_0xfbdb8c=_0xfbdb8c-0xbc;const _0xa05fee=a37_0xa05f();let _0x3d2265=_0xa05fee[_0xfbdb8c];return _0x3d2265;}export const codegenSql={'service':a37_0x3091d3(0xcd),'command':a37_0x3091d3(0xc4),'description':a37_0x3091d3(0xc2),'risk':a37_0x3091d3(0xc0),'flags':[SQLCODE_FLAG,{'name':a37_0x3091d3(0xbc),'type':a37_0x3091d3(0xce),'description':'Code\x20target:\x20sdk\x20(default)\x20or\x20bff','default':a37_0x3091d3(0xc3),'enum':[a37_0x3091d3(0xc3),a37_0x3091d3(0xd3)]},{'name':'no-imports','type':a37_0x3091d3(0xc8),'description':'Omit\x20import\x20statements\x20from\x20generated\x20code'}],async 'execute'(_0x36e787){const _0x70f6aa=a37_0x3091d3,_0x4f559d=await getSqlQueryInfo(_0x36e787[_0x70f6aa(0xbe)],_0x36e787[_0x70f6aa(0xbd)](_0x70f6aa(0xd6))),_0xebc014=_0x36e787[_0x70f6aa(0xbd)](_0x70f6aa(0xbc))||_0x70f6aa(0xc3),_0x387c82=generateSqlCodeTemplate(_0x4f559d,{'target':_0xebc014,'includeImports':!_0x36e787['bool'](_0x70f6aa(0xcb))});return{'ok':!![],'data':{'sqlCode':_0x4f559d[_0x70f6aa(0xd5)],'sqlName':_0x4f559d[_0x70f6aa(0xcc)],'target':_0xebc014,'code':_0x387c82}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xa2208a,_0x564b97){const _0x42c75f=a38_0x16ae,_0x1ebf67=_0xa2208a();while(!![]){try{const _0x2eca79=-parseInt(_0x42c75f(0x1c4))/0x1+parseInt(_0x42c75f(0x1cd))/0x2+-parseInt(_0x42c75f(0x1e1))/0x3*(-parseInt(_0x42c75f(0x1c2))/0x4)+-parseInt(_0x42c75f(0x1cf))/0x5*(parseInt(_0x42c75f(0x1d7))/0x6)+-parseInt(_0x42c75f(0x1c3))/0x7*(parseInt(_0x42c75f(0x1d1))/0x8)+-parseInt(_0x42c75f(0x1c0))/0x9*(-parseInt(_0x42c75f(0x1c6))/0xa)+parseInt(_0x42c75f(0x1df))/0xb*(parseInt(_0x42c75f(0x1d5))/0xc);if(_0x2eca79===_0x564b97)break;else _0x1ebf67['push'](_0x1ebf67['shift']());}catch(_0x1091a2){_0x1ebf67['push'](_0x1ebf67['shift']());}}}(a38_0x2ac6,0x8de9a));import{input,checkbox,select}from'@inquirer/prompts';function a38_0x2ac6(){const _0x3c0117=['103317JdOHTc','(跳过,稍后通过\x20config\x20set\x20appcode\x20配置)','includes','18CNJUDz','appName','124eQhWLy','15029QosEXe','922052pTZbMW','\x0a无法获取远程应用列表,请手动输入。','3857440DNdkZR','(未检测到登录态,请手动输入\x20App\x20Code\x20或直接跳过)','trim','map','\x20个应用,请选择\x20(空格勾选,\x20a=全选,\x20i=反选):','\x20\x20(','custom','92890YkTTzf','✎\x20自定义输入\x20appcode','5MGjQOH','skip','1384gLtKuF','cyan','message','\x0a未找到可用应用。','84bOociO','length','296592skrJSM','正在获取可用应用列表...','App\x20Code:','yellow','获取到\x20','gray','(跳过,稍后配置)','appCode','60731nlcqmb','请输入\x20App\x20Code:'];a38_0x2ac6=function(){return _0x3c0117;};return a38_0x2ac6();}import a38_0x395946 from'chalk';import{validateAppcode}from'../../commands/common/validate.js';import{listRemoteApps}from'../../core/api-client.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';function a38_0x16ae(_0x5a4b49,_0x17dc93){_0x5a4b49=_0x5a4b49-0x1c0;const _0x2ac619=a38_0x2ac6();let _0x16ae63=_0x2ac619[_0x5a4b49];return _0x16ae63;}import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';export async function promptCustomAppcode(){const _0x655c67=a38_0x16ae,_0x235c01=await input({'message':_0x655c67(0x1e0),'validate':_0x274d7d=>{const _0x5d5227=_0x655c67,_0x86a73e=validateAppcode(_0x274d7d[_0x5d5227(0x1c8)]());return _0x86a73e['valid']||_0x86a73e[_0x5d5227(0x1d3)]||'Invalid\x20App\x20Code';}});return _0x235c01[_0x655c67(0x1c8)]();}export async function promptAppSelection(_0x4c37bf){const _0x51ba2f=a38_0x16ae,_0x118989=[{'name':a38_0x395946['yellow'](_0x51ba2f(0x1ce)),'value':-0x1},..._0x4c37bf['map']((_0x2aac24,_0x585960)=>({'name':_0x2aac24[_0x51ba2f(0x1c1)]+'\x20\x20'+a38_0x395946[_0x51ba2f(0x1dc)]('('+_0x2aac24[_0x51ba2f(0x1de)]+')'),'value':_0x585960}))],_0x48cb22=await checkbox({'message':_0x51ba2f(0x1db)+a38_0x395946[_0x51ba2f(0x1d2)](_0x4c37bf[_0x51ba2f(0x1d6)])+_0x51ba2f(0x1ca),'choices':_0x118989,'loop':![]});if(_0x48cb22[_0x51ba2f(0x1e3)](-0x1))return _0x51ba2f(0x1cc);if(_0x48cb22[_0x51ba2f(0x1d6)]===0x0)return _0x51ba2f(0x1cc);return _0x48cb22[_0x51ba2f(0x1c9)](_0x339c25=>_0x4c37bf[_0x339c25]);}export async function promptSingleAppSelection(_0x4ccbb4){const _0x1a9c7a=a38_0x16ae,_0x5849ab=[{'name':a38_0x395946[_0x1a9c7a(0x1dc)](_0x1a9c7a(0x1e2)),'value':_0x1a9c7a(0x1d0)},{'name':a38_0x395946[_0x1a9c7a(0x1da)](_0x1a9c7a(0x1ce)),'value':_0x1a9c7a(0x1cc)},..._0x4ccbb4[_0x1a9c7a(0x1c9)](_0x54d3da=>({'name':_0x54d3da['appName']+'\x20\x20'+a38_0x395946[_0x1a9c7a(0x1dc)]('('+_0x54d3da['appCode']+')'),'value':_0x54d3da[_0x1a9c7a(0x1de)]}))],_0x2e7499=await select({'message':'请选择要绑定的应用:','choices':_0x5849ab});if(_0x2e7499===_0x1a9c7a(0x1d0))return _0x1a9c7a(0x1d0);if(_0x2e7499===_0x1a9c7a(0x1cc))return'custom';return _0x4ccbb4['find'](_0x292ad6=>_0x292ad6[_0x1a9c7a(0x1de)]===_0x2e7499);}export async function selectSingleAppcode(_0x5d3125){const _0x4b2aee=a38_0x16ae;if(!_0x5d3125)return writeCliSideChannelLine(a38_0x395946[_0x4b2aee(0x1dc)](_0x4b2aee(0x1c7))),_fallbackOrSkip();writeCliSideChannelLine(_0x4b2aee(0x1d8));let _0x8b288b;try{_0x8b288b=await withActiveCookie(_0x5d3125,()=>listRemoteApps());}catch(_0x4f5c2d){writeCliSideChannelLine(a38_0x395946[_0x4b2aee(0x1da)]('无法获取远程应用列表,请手动输入。'));if(_0x4f5c2d instanceof Error)writeCliSideChannelLine(a38_0x395946[_0x4b2aee(0x1dc)](_0x4b2aee(0x1cb)+_0x4f5c2d[_0x4b2aee(0x1d3)]+')'));return _fallbackOrSkip();}if(_0x8b288b[_0x4b2aee(0x1d6)]===0x0)return writeCliSideChannelLine(a38_0x395946[_0x4b2aee(0x1da)]('未找到可用应用。')),_fallbackOrSkip();const _0x1432c4=await promptSingleAppSelection(_0x8b288b);if(_0x1432c4===_0x4b2aee(0x1d0))return'';if(_0x1432c4===_0x4b2aee(0x1cc))return promptCustomAppcode();return _0x1432c4[_0x4b2aee(0x1de)];}export async function selectMultipleApps(_0x10ce4d){const _0x35f644=a38_0x16ae;writeCliSideChannelLine(_0x35f644(0x1d8));let _0x36ad09;try{_0x36ad09=await withActiveCookie(_0x10ce4d,()=>listRemoteApps());}catch(_0x4ac5fc){writeCliSideChannelLine(_0x35f644(0x1c5));if(_0x4ac5fc instanceof Error)writeCliSideChannelLine(_0x35f644(0x1cb)+_0x4ac5fc['message']+')');return _0x35f644(0x1cc);}if(_0x36ad09[_0x35f644(0x1d6)]===0x0)return writeCliSideChannelLine(_0x35f644(0x1d4)),'custom';return promptAppSelection(_0x36ad09);}async function _fallbackOrSkip(){const _0x27a141=a38_0x16ae,_0x194f07=await select({'message':_0x27a141(0x1d9),'choices':[{'name':a38_0x395946['gray'](_0x27a141(0x1dd)),'value':_0x27a141(0x1d0)},{'name':a38_0x395946['yellow']('✎\x20手动输入'),'value':'manual'}]});if(_0x194f07==='skip')return'';return promptCustomAppcode();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a39_0x22419e=a39_0x77fb;(function(_0x1c8e1f,_0xeb6469){const _0x3a9e50=a39_0x77fb,_0x5b951c=_0x1c8e1f();while(!![]){try{const _0x30a3a3=parseInt(_0x3a9e50(0x14d))/0x1*(parseInt(_0x3a9e50(0x15c))/0x2)+parseInt(_0x3a9e50(0x14b))/0x3*(parseInt(_0x3a9e50(0x153))/0x4)+parseInt(_0x3a9e50(0x150))/0x5+-parseInt(_0x3a9e50(0x14f))/0x6*(-parseInt(_0x3a9e50(0x15f))/0x7)+parseInt(_0x3a9e50(0x158))/0x8*(parseInt(_0x3a9e50(0x15e))/0x9)+-parseInt(_0x3a9e50(0x15d))/0xa+-parseInt(_0x3a9e50(0x155))/0xb*(parseInt(_0x3a9e50(0x154))/0xc);if(_0x30a3a3===_0xeb6469)break;else _0x5b951c['push'](_0x5b951c['shift']());}catch(_0xc6c363){_0x5b951c['push'](_0x5b951c['shift']());}}}(a39_0x2954,0x7e57d));export const DATASET_CODE_PATTERN={'regex':/^[a-f0-9]{32}$/i,'description':'a\x2032-character\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588)'};export const CODE_FLAG={'name':a39_0x22419e(0x159),'type':a39_0x22419e(0x156),'required':!![],'description':a39_0x22419e(0x14c),'pattern':DATASET_CODE_PATTERN};export const CODE_FLAG_OPTIONAL={...CODE_FLAG,'required':![]};export const DATASETCODE_FLAG_OPTIONAL={...CODE_FLAG_OPTIONAL,'name':'datasetcode','description':a39_0x22419e(0x14c)};export const SQLCODE_FLAG={'name':a39_0x22419e(0x161),'type':a39_0x22419e(0x156),'required':!![],'description':a39_0x22419e(0x151),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':'SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)'}};export const APPCODE_FLAG_OPTIONAL={'name':a39_0x22419e(0x15b),'type':'string','required':![],'description':a39_0x22419e(0x160)};export const SQLCODE_FLAG_OPTIONAL={...SQLCODE_FLAG,'required':![]};function a39_0x77fb(_0x451ca2,_0x22fe41){_0x451ca2=_0x451ca2-0x14b;const _0x295445=a39_0x2954();let _0x77fba3=_0x295445[_0x451ca2];return _0x77fba3;}export const DBLINK_ID_FLAG={'name':'id','type':a39_0x22419e(0x14e),'required':!![],'description':a39_0x22419e(0x152)};function a39_0x2954(){const _0x379881=['Dataset\x20code\x20(32-char\x20hex\x20UUID)','1vtXUqs','number','2477796MJtQqa','3494070GYoYwb','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)','276GYhUIC','12UygDNn','14310329pzBuel','string','Database\x20product\x20type','80UpnUuV','code','dbtype','appcode','1005336ZlVAjJ','7894660VCQjqj','33903epuBsp','7hHWNTg','App\x20code\x20(overrides\x20config\x20file,\x20e.g.\x20app-xxxxx)','sqlcode','41556EAqNvX'];a39_0x2954=function(){return _0x379881;};return a39_0x2954();}export const DB_TYPE_FLAG={'name':a39_0x22419e(0x15a),'type':a39_0x22419e(0x156),'required':!![],'description':a39_0x22419e(0x157),'enum':['MYSQL','POSTGRESQL']};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xb4e415,_0x36883e){const _0x29fbf7=a40_0x4d36,_0x4a426d=_0xb4e415();while(!![]){try{const _0x359582=parseInt(_0x29fbf7(0xdf))/0x1+parseInt(_0x29fbf7(0xd7))/0x2+-parseInt(_0x29fbf7(0xe2))/0x3*(-parseInt(_0x29fbf7(0xdd))/0x4)+parseInt(_0x29fbf7(0xdc))/0x5+-parseInt(_0x29fbf7(0xd8))/0x6+parseInt(_0x29fbf7(0xe4))/0x7+-parseInt(_0x29fbf7(0xd9))/0x8*(parseInt(_0x29fbf7(0xe1))/0x9);if(_0x359582===_0x36883e)break;else _0x4a426d['push'](_0x4a426d['shift']());}catch(_0x4b7bdb){_0x4a426d['push'](_0x4a426d['shift']());}}}(a40_0x5bc4,0x88d6c));function a40_0x4d36(_0x2e563f,_0x3bd622){_0x2e563f=_0x2e563f-0xd7;const _0x5bc4cd=a40_0x5bc4();let _0x4d3666=_0x5bc4cd[_0x2e563f];return _0x4d3666;}export function validateAppcode(_0x1f28ae){const _0x2380b0=a40_0x4d36,_0x3583d4=_0x1f28ae[_0x2380b0(0xdb)]();if(!_0x3583d4)return{'valid':![],'message':_0x2380b0(0xde)};if(_0x3583d4[_0x2380b0(0xe3)]>0x64)return{'valid':![],'message':_0x2380b0(0xe0)};if(!/^[A-Za-z0-9_-]+$/[_0x2380b0(0xda)](_0x3583d4))return{'valid':![],'message':'Only\x20letters,\x20numbers,\x20-\x20and\x20_\x20are\x20allowed'};return{'valid':!![]};}function a40_0x5bc4(){const _0x243081=['6NklWNs','length','5966716ZDYTwW','1807058EtAxsI','3257544TTGHpk','627472XJCZyz','test','trim','5157955VJBHiP','1156948NhpDza','App\x20Code\x20cannot\x20be\x20empty','561058JmuYaP','App\x20Code\x20cannot\x20exceed\x20100\x20characters','324jVWcFk'];a40_0x5bc4=function(){return _0x243081;};return a40_0x5bc4();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a41_0x51711b=a41_0x3278;(function(_0x35cf1e,_0x4829e2){const _0x2b47f1=a41_0x3278,_0x2cfff8=_0x35cf1e();while(!![]){try{const _0x4e7015=-parseInt(_0x2b47f1(0x1c1))/0x1*(-parseInt(_0x2b47f1(0x1c0))/0x2)+-parseInt(_0x2b47f1(0x1cd))/0x3*(parseInt(_0x2b47f1(0x1c2))/0x4)+parseInt(_0x2b47f1(0x1c4))/0x5*(-parseInt(_0x2b47f1(0x1bd))/0x6)+parseInt(_0x2b47f1(0x1ce))/0x7*(-parseInt(_0x2b47f1(0x1be))/0x8)+parseInt(_0x2b47f1(0x1d2))/0x9+-parseInt(_0x2b47f1(0x1ca))/0xa*(-parseInt(_0x2b47f1(0x1d1))/0xb)+parseInt(_0x2b47f1(0x1d0))/0xc;if(_0x4e7015===_0x4829e2)break;else _0x2cfff8['push'](_0x2cfff8['shift']());}catch(_0x30f6fa){_0x2cfff8['push'](_0x2cfff8['shift']());}}}(a41_0x36c1,0x769a9));function a41_0x3278(_0x443bb2,_0x4591a2){_0x443bb2=_0x443bb2-0x1bd;const _0x36c192=a41_0x36c1();let _0x3278c1=_0x36c192[_0x443bb2];return _0x3278c1;}import{CliErrors}from'../../errors.js';import{readConfig}from'../../utils/config.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a41_0x36c1(){const _0x48f116=['read','18765FsBYLG','appcode','key','config','str','object','70zNqhyM','Usage:\x20','validation','187608LHOoYk','252WbgEzb','Missing\x20key.','2735688DqUpCh','46695lyYyef','8002701Fpfpfg','app','942vLCbQZ','91864phCMnV','Get\x20a\x20config\x20value\x20by\x20key','3436uLoQpu','490HguWwQ','32UsaijH'];a41_0x36c1=function(){return _0x48f116;};return a41_0x36c1();}import{getConfigCommandKeyDescription}from'../../commands/config/shared.js';async function execute(_0x5ee1a8){const _0x5f3006=a41_0x3278,_0xcd64aa=_0x5ee1a8[_0x5f3006(0x1c8)]('key');if(!_0xcd64aa)throw CliErrors[_0x5f3006(0x1cc)](_0x5f3006(0x1cf),_0x5f3006(0x1cb)+CLI_BIN_NAME+'\x20config\x20get\x20--key\x20<key>');const _0x300133=readConfig(),_0x4bdc8c=_0xcd64aa===_0x5f3006(0x1d3)?_0x5f3006(0x1c5):_0xcd64aa,_0x1d962c=_0x300133[_0x4bdc8c];if(_0x1d962c===undefined)throw CliErrors['validation']('Key\x20not\x20found:\x20'+_0xcd64aa);return{'ok':!![],'data':typeof _0x1d962c===_0x5f3006(0x1c9)?_0x1d962c:{[_0x4bdc8c]:_0x1d962c},'message':typeof _0x1d962c===_0x5f3006(0x1c9)?undefined:String(_0x1d962c)};}export const configGetDefinition={'service':a41_0x51711b(0x1c7),'command':'get','description':a41_0x51711b(0x1bf),'risk':a41_0x51711b(0x1c3),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a41_0x51711b(0x1c6),'type':'string','description':getConfigCommandKeyDescription(),'required':!![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2b4f9f,_0x4e98dc){const _0x3b6300=a42_0x5250,_0x4baff8=_0x2b4f9f();while(!![]){try{const _0x28263b=parseInt(_0x3b6300(0xe1))/0x1+-parseInt(_0x3b6300(0xe2))/0x2+parseInt(_0x3b6300(0xdf))/0x3+parseInt(_0x3b6300(0xde))/0x4*(-parseInt(_0x3b6300(0xe4))/0x5)+-parseInt(_0x3b6300(0xe0))/0x6*(-parseInt(_0x3b6300(0xe3))/0x7)+-parseInt(_0x3b6300(0xdd))/0x8+-parseInt(_0x3b6300(0xe5))/0x9*(-parseInt(_0x3b6300(0xdc))/0xa);if(_0x28263b===_0x4e98dc)break;else _0x4baff8['push'](_0x4baff8['shift']());}catch(_0x22c8de){_0x4baff8['push'](_0x4baff8['shift']());}}}(a42_0x394b,0xb9d66));import{configListDefinition}from'../../commands/config/list.js';import{configGetDefinition}from'../../commands/config/get.js';import{configSetDefinition}from'../../commands/config/set.js';export const configDefinitions=[configListDefinition,configGetDefinition,configSetDefinition];function a42_0x5250(_0x1d1e9f,_0x3e795a){_0x1d1e9f=_0x1d1e9f-0xdc;const _0x394bfd=a42_0x394b();let _0x525072=_0x394bfd[_0x1d1e9f];return _0x525072;}function a42_0x394b(){const _0x577513=['10ggTvnM','6080760SToTeB','148wNNjBc','219708sKXDqH','887940dtVGqy','361164SLTZwJ','641576IgjjCh','49bOkIpM','15710ybQVRL','4391973YuoyiC'];a42_0x394b=function(){return _0x577513;};return a42_0x394b();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a43_0x2a80(){const _0x52693b=['list','1951803XMMAzt','132960aUuIfp','255650hgfSeA','3mgiWtc','52443zoIRYl','238UxCHpl','3611695uABgQv','Show\x20global\x20config\x20only\x20(~/.rabetbase.json)','global','config','boolean','2200290KEDPzT','read','4250qjxaUG','2373836ZDgwmi'];a43_0x2a80=function(){return _0x52693b;};return a43_0x2a80();}const a43_0x426f90=a43_0x21e9;(function(_0x4cc410,_0x1c9c3d){const _0x31b0d3=a43_0x21e9,_0x2aa162=_0x4cc410();while(!![]){try{const _0x550431=parseInt(_0x31b0d3(0x188))/0x1*(-parseInt(_0x31b0d3(0x187))/0x2)+-parseInt(_0x31b0d3(0x185))/0x3+parseInt(_0x31b0d3(0x183))/0x4+-parseInt(_0x31b0d3(0x18b))/0x5+-parseInt(_0x31b0d3(0x190))/0x6+parseInt(_0x31b0d3(0x18a))/0x7*(-parseInt(_0x31b0d3(0x186))/0x8)+-parseInt(_0x31b0d3(0x189))/0x9*(-parseInt(_0x31b0d3(0x182))/0xa);if(_0x550431===_0x1c9c3d)break;else _0x2aa162['push'](_0x2aa162['shift']());}catch(_0x3666eb){_0x2aa162['push'](_0x2aa162['shift']());}}}(a43_0x2a80,0x5d31c));import{readScopedConfig}from'../../commands/config/shared.js';function a43_0x21e9(_0x335bfb,_0x11af1b){_0x335bfb=_0x335bfb-0x181;const _0x2a80fd=a43_0x2a80();let _0x21e94f=_0x2a80fd[_0x335bfb];return _0x21e94f;}import{readConfig}from'../../utils/config.js';async function execute(_0x59d299){const _0x1bd197=a43_0x21e9,_0x4af3d5=_0x59d299['bool'](_0x1bd197(0x18d))?readScopedConfig(_0x1bd197(0x18d)):readConfig();return{'ok':!![],'data':_0x4af3d5};}export const configListDefinition={'service':a43_0x426f90(0x18e),'command':a43_0x426f90(0x184),'description':'List\x20all\x20config\x20values','risk':a43_0x426f90(0x181),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a43_0x426f90(0x18d),'type':a43_0x426f90(0x18f),'description':a43_0x426f90(0x18c),'default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a44_0x39ab62=a44_0x5630;(function(_0x4d56e4,_0x178eb1){const _0x466c22=a44_0x5630,_0x380d07=_0x4d56e4();while(!![]){try{const _0x5dd477=parseInt(_0x466c22(0x1f2))/0x1*(-parseInt(_0x466c22(0x1f3))/0x2)+-parseInt(_0x466c22(0x1f0))/0x3*(-parseInt(_0x466c22(0x1ce))/0x4)+parseInt(_0x466c22(0x1ef))/0x5*(-parseInt(_0x466c22(0x1cb))/0x6)+parseInt(_0x466c22(0x1d6))/0x7*(parseInt(_0x466c22(0x1f5))/0x8)+parseInt(_0x466c22(0x1dd))/0x9*(parseInt(_0x466c22(0x1e5))/0xa)+parseInt(_0x466c22(0x1e7))/0xb+-parseInt(_0x466c22(0x1d7))/0xc;if(_0x5dd477===_0x178eb1)break;else _0x380d07['push'](_0x380d07['shift']());}catch(_0x12ffa8){_0x380d07['push'](_0x380d07['shift']());}}}(a44_0x21d4,0x8fbbc));import{CliErrors}from'../../errors.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';import{CLI_BIN_NAME,CONFIG_ENUM_VALUES,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,normalizeLocale,resolveWriteScope,readScopedConfig,writeScopedConfig}from'../../commands/config/shared.js';import{normalizeEnv,isProduction,isDaily}from'../../constant/env.js';async function execute(_0x5c0d83){const _0x5ab340=a44_0x5630,_0x343c4f=_0x5c0d83[_0x5ab340(0x1fc)](_0x5ab340(0x1d8)),_0x47a91a=_0x5c0d83[_0x5ab340(0x1fc)]('value');if(!_0x343c4f)throw CliErrors[_0x5ab340(0x1f8)](_0x5ab340(0x1d2),'Usage:\x20'+CLI_BIN_NAME+_0x5ab340(0x1d5));if(_0x47a91a===undefined||_0x47a91a==='')throw CliErrors[_0x5ab340(0x1f8)](_0x5ab340(0x1d9),'Usage:\x20'+CLI_BIN_NAME+_0x5ab340(0x1d5));if(_0x47a91a['length']>0x1f4)throw CliErrors[_0x5ab340(0x1f8)](_0x5ab340(0x1e6));if(!isTopLevelConfigKey(_0x343c4f))throw CliErrors['validation']('Top-level\x20key\x20\x22'+_0x343c4f+_0x5ab340(0x1e2),'Settable\x20top-level\x20keys:\x20'+getTopLevelConfigKeySummary());if(_0x343c4f===_0x5ab340(0x1d3))throw CliErrors[_0x5ab340(0x1f8)](_0x5ab340(0x1fa));if(CONFIG_ENUM_VALUES[_0x343c4f]&&!CONFIG_ENUM_VALUES[_0x343c4f][_0x5ab340(0x1fd)](_0x47a91a))throw CliErrors[_0x5ab340(0x1f8)](_0x5ab340(0x1de)+_0x343c4f+_0x5ab340(0x1e4)+CONFIG_ENUM_VALUES[_0x343c4f][_0x5ab340(0x1d4)](',\x20'));if(_0x343c4f===_0x5ab340(0x1cc)&&!normalizeLocale(_0x47a91a))throw CliErrors[_0x5ab340(0x1f8)](_0x5ab340(0x1ea),'Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US');const _0xabc0e4={'global':_0x5c0d83[_0x5ab340(0x1c9)](_0x5ab340(0x1f9))},_0x3abefc=resolveWriteScope(_0xabc0e4),_0x1930eb=readScopedConfig(_0x3abefc);let _0x2bfd7f=_0x343c4f,_0x144034=_0x47a91a;_0x343c4f==='app'&&(_0x2bfd7f=_0x5ab340(0x1d1),delete _0x1930eb[_0x5ab340(0x1d0)]);_0x343c4f==='locale'&&(_0x144034=normalizeLocale(_0x47a91a));if(_0x343c4f===_0x5ab340(0x1e8)){_0x144034=normalizeEnv(_0x47a91a);if(!isProduction(_0x144034)&&!isDaily(_0x144034))throw CliErrors['validation'](_0x5ab340(0x1ee),_0x5ab340(0x1df));}if(_0x343c4f===_0x5ab340(0x1d1)){const _0x3bafa6=_0x1930eb['apps']&&typeof _0x1930eb['apps']===_0x5ab340(0x1cf)?Object[_0x5ab340(0x1f4)](_0x1930eb['apps']):[];if(_0x3bafa6[_0x5ab340(0x1cd)]>0x0)throw CliErrors['validation'](_0x5ab340(0x1e0),_0x5ab340(0x1e1)+CLI_BIN_NAME+_0x5ab340(0x1eb)+_0x144034+_0x5ab340(0x1db)+CLI_BIN_NAME+_0x5ab340(0x1dc));const _0xd3488d=buildCanonicalProjectConfig({..._0x1930eb},{'appCodes':[_0x144034],'env':typeof _0x1930eb[_0x5ab340(0x1e8)]===_0x5ab340(0x1e9)?_0x1930eb[_0x5ab340(0x1e8)]:undefined});writeScopedConfig(_0xd3488d,_0x3abefc);const _0x1e25ac=_0x3abefc===_0x5ab340(0x1f9)?_0x5ab340(0x1f7):'Project';return{'ok':!![],'message':'✓\x20'+_0x1e25ac+_0x5ab340(0x1ed)+_0x144034+'\x20(stored\x20as\x20apps\x20+\x20defaultApp)'};}_0x1930eb[_0x2bfd7f]=_0x144034,writeScopedConfig(_0x1930eb,_0x3abefc);const _0x2da1c4=_0x3abefc==='global'?_0x5ab340(0x1f7):_0x5ab340(0x1f1);return{'ok':!![],'message':'✓\x20'+_0x2da1c4+'\x20'+_0x2bfd7f+_0x5ab340(0x1ca)+_0x144034};}function a44_0x21d4(){const _0x453fe8=['riskLevel','join','\x20config\x20set\x20--key\x20<key>\x20--value\x20<value>','28MQcxbI','4406448deOrMU','key','Missing\x20value.','Set\x20a\x20config\x20value','`,\x20`','\x20app\x20use\x20<name>`,\x20or\x20pass\x20`--appcode`\x20on\x20the\x20command.','2374749dNSUma','Invalid\x20value\x20for\x20\x22','Legacy\x20alias\x20\x22online\x22\x20is\x20accepted\x20and\x20stored\x20as\x20production.','Cannot\x20set\x20top-level\x20\x22appcode\x22\x20when\x20multi-app\x20config\x20already\x20exists.','Use\x20`','\x22\x20is\x20not\x20settable.','Config\x20value','\x22.\x20Allowed:\x20','40nCeldW','Config\x20value\x20is\x20invalid\x20or\x20too\x20long.','1213674NgjfDn','env','string','Invalid\x20locale\x20value.','\x20app\x20add\x20<name>\x20--appcode\x20','config','\x20appcode\x20set\x20to:\x20','Invalid\x20value\x20for\x20env.\x20Allowed:\x20production,\x20daily.','2514465NpgFUn','3UCPPfn','Project','1ivXisg','1842772ZRbLWY','keys','268216mNKtEh','set','Global','validation','global','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','value','str','includes','Write\x20to\x20global\x20config\x20(~/.rabetbase.json)','bool','\x20set\x20to:\x20','6WzPBVX','locale','length','4321316WTTSGY','object','app','appcode','Missing\x20key.'];a44_0x21d4=function(){return _0x453fe8;};return a44_0x21d4();}function a44_0x5630(_0x4cf563,_0x36e93e){_0x4cf563=_0x4cf563-0x1c8;const _0x21d43b=a44_0x21d4();let _0x5630d0=_0x21d43b[_0x4cf563];return _0x5630d0;}export const configSetDefinition={'service':a44_0x39ab62(0x1ec),'command':a44_0x39ab62(0x1f6),'description':a44_0x39ab62(0x1da),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'key','type':a44_0x39ab62(0x1e9),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a44_0x39ab62(0x1fb),'type':a44_0x39ab62(0x1e9),'description':a44_0x39ab62(0x1e3),'required':!![]},{'name':a44_0x39ab62(0x1f9),'type':'boolean','description':a44_0x39ab62(0x1c8),'default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2296ec,_0x36c928){var _0x1d1562=a45_0x5af5,_0x44dc35=_0x2296ec();while(!![]){try{var _0x5d3256=parseInt(_0x1d1562(0x79))/0x1*(-parseInt(_0x1d1562(0x7c))/0x2)+-parseInt(_0x1d1562(0x77))/0x3+parseInt(_0x1d1562(0x7a))/0x4*(parseInt(_0x1d1562(0x76))/0x5)+parseInt(_0x1d1562(0x80))/0x6+-parseInt(_0x1d1562(0x81))/0x7+-parseInt(_0x1d1562(0x7f))/0x8+parseInt(_0x1d1562(0x7e))/0x9*(parseInt(_0x1d1562(0x75))/0xa);if(_0x5d3256===_0x36c928)break;else _0x44dc35['push'](_0x44dc35['shift']());}catch(_0x36b34e){_0x44dc35['push'](_0x44dc35['shift']());}}}(a45_0x83e6,0xbf6f3));import{CLI_BIN_NAME}from'../../constant/cli.js';import{isInProject,resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';import{CliErrors}from'../../errors.js';function a45_0x83e6(){var _0x3915d2=['920tIlwJO','245LdZtny','3076893NtoCjB','global','12905Sujrpa','67004mDcxCV','\x20init`\x20first.','124paaisi','Add\x20--global\x20to\x20write\x20to\x20~/.rabetbase.json,\x20or\x20run\x20`','392958pKJbGZ','10904432bXzdUu','4052634NsSltn','10781624TKHorh','validation'];a45_0x83e6=function(){return _0x3915d2;};return a45_0x83e6();}import{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey,normalizeLocale}from'../../config/schema.js';function a45_0x5af5(_0x280aab,_0x320527){_0x280aab=_0x280aab-0x74;var _0x83e6e2=a45_0x83e6();var _0x5af5b2=_0x83e6e2[_0x280aab];return _0x5af5b2;}export{CLI_BIN_NAME};export{normalizeLocale};export{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey};export function resolveWriteScope(_0x5c7af1){var _0x27a4b5=a45_0x5af5;if(_0x5c7af1[_0x27a4b5(0x78)])return _0x27a4b5(0x78);if(!isInProject())throw CliErrors[_0x27a4b5(0x74)]('Not\x20inside\x20a\x20project\x20(no\x20.rabetbase.json\x20found).',_0x27a4b5(0x7d)+CLI_BIN_NAME+_0x27a4b5(0x7b));return'project';}export function readScopedConfig(_0x6b13d1){return readConfigFile(resolveWriteConfigPath(_0x6b13d1));}export function writeScopedConfig(_0x1a03d4,_0x285c21){writeConfigFile(resolveWriteConfigPath(_0x285c21),_0x1a03d4);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a46_0x5769(){const _0x30f959=['\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page','join','197QNoXOw','4411752QXqPNl','513012RQcnxY','2445595OxEuos','9541aCvLiw','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','3250SHTrQa','99ytEbbr','34227FHKFgQ','Filter\x20dataset\x20records\x20with\x20query\x20conditions','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','56452LXpXYI','798UXoZUf','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','1578ctaqCA','filter','114bcejzt'];a46_0x5769=function(){return _0x30f959;};return a46_0x5769();}const a46_0x15fd3c=a46_0x3111;function a46_0x3111(_0xc2a17e,_0x5e3627){_0xc2a17e=_0xc2a17e-0x1f4;const _0x5769fa=a46_0x5769();let _0x31118a=_0x5769fa[_0xc2a17e];return _0x31118a;}(function(_0x39f570,_0x2d80ff){const _0x49a7b9=a46_0x3111,_0x762677=_0x39f570();while(!![]){try{const _0x25aa3e=parseInt(_0x49a7b9(0x1fb))/0x1*(-parseInt(_0x49a7b9(0x207))/0x2)+parseInt(_0x49a7b9(0x1f8))/0x3*(parseInt(_0x49a7b9(0x206))/0x4)+-parseInt(_0x49a7b9(0x1fe))/0x5+-parseInt(_0x49a7b9(0x1f6))/0x6*(parseInt(_0x49a7b9(0x1ff))/0x7)+-parseInt(_0x49a7b9(0x1fc))/0x8+-parseInt(_0x49a7b9(0x203))/0x9*(-parseInt(_0x49a7b9(0x201))/0xa)+-parseInt(_0x49a7b9(0x202))/0xb*(-parseInt(_0x49a7b9(0x1fd))/0xc);if(_0x25aa3e===_0x2d80ff)break;else _0x762677['push'](_0x762677['shift']());}catch(_0x5b822f){_0x762677['push'](_0x762677['shift']());}}}(a46_0x5769,0xa5dc8));import{buildDataCommand}from'../../commands/data/shared.js';export const dataFilter=buildDataCommand({'command':a46_0x15fd3c(0x1f7),'operation':a46_0x15fd3c(0x1f7),'description':a46_0x15fd3c(0x204),'paramsRequired':![],'paramsHint':a46_0x15fd3c(0x205),'helpExtra':[a46_0x15fd3c(0x200),'\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions',a46_0x15fd3c(0x1f5),a46_0x15fd3c(0x1f4),'\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)',a46_0x15fd3c(0x1f9)][a46_0x15fd3c(0x1fa)]('\x0a')});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a47_0x5e0e49=a47_0x1b33;function a47_0x5e4c(){const _0x5c5ca8=['99rrrJYj','545108vGNKea','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','240bfYAsO','getOne','6RynOik','33392qWAJGz','Get\x20a\x20single\x20record\x20by\x20ID','1454873rNNyfF','60wKIDAU','195138Pybajb','5747000qZZgOT','33626WZQllW','1104410rpcrVy'];a47_0x5e4c=function(){return _0x5c5ca8;};return a47_0x5e4c();}function a47_0x1b33(_0x4a0a9a,_0x426dbc){_0x4a0a9a=_0x4a0a9a-0x115;const _0x5e4c2b=a47_0x5e4c();let _0x1b337e=_0x5e4c2b[_0x4a0a9a];return _0x1b337e;}(function(_0x4d71fc,_0x1365f7){const _0x39f1ee=a47_0x1b33,_0x5d34df=_0x4d71fc();while(!![]){try{const _0x37203e=-parseInt(_0x39f1ee(0x11c))/0x1+parseInt(_0x39f1ee(0x11f))/0x2+-parseInt(_0x39f1ee(0x119))/0x3*(parseInt(_0x39f1ee(0x116))/0x4)+parseInt(_0x39f1ee(0x11b))/0x5+parseInt(_0x39f1ee(0x115))/0x6*(-parseInt(_0x39f1ee(0x118))/0x7)+-parseInt(_0x39f1ee(0x121))/0x8*(-parseInt(_0x39f1ee(0x11a))/0x9)+parseInt(_0x39f1ee(0x11d))/0xa*(-parseInt(_0x39f1ee(0x11e))/0xb);if(_0x37203e===_0x1365f7)break;else _0x5d34df['push'](_0x5d34df['shift']());}catch(_0x19261c){_0x5d34df['push'](_0x5d34df['shift']());}}}(a47_0x5e4c,0xa3944));import{buildDataCommand}from'../../commands/data/shared.js';export const dataGetOne=buildDataCommand({'command':a47_0x5e0e49(0x122),'operation':a47_0x5e0e49(0x122),'description':a47_0x5e0e49(0x117),'paramsRequired':!![],'paramsHint':a47_0x5e0e49(0x120)});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a48_0x4245(_0x5d942e,_0x262620){_0x5d942e=_0x5d942e-0xcf;const _0x281862=a48_0x2818();let _0x42452d=_0x281862[_0x5d942e];return _0x42452d;}(function(_0x513aac,_0x34c50e){const _0x46815f=a48_0x4245,_0x3a61f7=_0x513aac();while(!![]){try{const _0x476887=-parseInt(_0x46815f(0xd0))/0x1+-parseInt(_0x46815f(0xd3))/0x2+-parseInt(_0x46815f(0xd4))/0x3*(-parseInt(_0x46815f(0xd7))/0x4)+parseInt(_0x46815f(0xd8))/0x5*(parseInt(_0x46815f(0xd6))/0x6)+-parseInt(_0x46815f(0xd2))/0x7*(-parseInt(_0x46815f(0xd5))/0x8)+-parseInt(_0x46815f(0xd1))/0x9+parseInt(_0x46815f(0xcf))/0xa;if(_0x476887===_0x34c50e)break;else _0x3a61f7['push'](_0x3a61f7['shift']());}catch(_0x43f729){_0x3a61f7['push'](_0x3a61f7['shift']());}}}(a48_0x2818,0x1c990));import{dataFilter}from'../../commands/data/filter.js';function a48_0x2818(){const _0x43829d=['75981XOGkzJ','1926324mLCeBr','186032eoRmST','135260fbxFsQ','87lpDbtb','24qwWhwQ','316986okGiVn','26596pUDnuc','5CaPGlV','1494030XufeqV'];a48_0x2818=function(){return _0x43829d;};return a48_0x2818();}import{dataGetOne}from'../../commands/data/getOne.js';export const dataDefinitions=[dataFilter,dataGetOne];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x119970,_0x3f4c6d){const _0x43fe37=a49_0xc026,_0x52cbad=_0x119970();while(!![]){try{const _0x327189=-parseInt(_0x43fe37(0x15c))/0x1+-parseInt(_0x43fe37(0x15b))/0x2+parseInt(_0x43fe37(0x169))/0x3+-parseInt(_0x43fe37(0x163))/0x4*(-parseInt(_0x43fe37(0x16c))/0x5)+parseInt(_0x43fe37(0x167))/0x6*(-parseInt(_0x43fe37(0x16f))/0x7)+-parseInt(_0x43fe37(0x16e))/0x8+parseInt(_0x43fe37(0x171))/0x9*(parseInt(_0x43fe37(0x170))/0xa);if(_0x327189===_0x3f4c6d)break;else _0x52cbad['push'](_0x52cbad['shift']());}catch(_0x2c5902){_0x52cbad['push'](_0x52cbad['shift']());}}}(a49_0x5934,0x81bac));import{executeDatasetDataOperation}from'../../core/api-client.js';import{CODE_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{parseJsonParams}from'../../utils/params.js';function assertGetOneId(_0x5c8d45){const _0x355c21=a49_0xc026;if(!_0x5c8d45)throw CliErrors[_0x355c21(0x16b)](_0x355c21(0x15a),'Provide\x20--params\x20\x27{\x22id\x22:123}\x27\x20for\x20data\x20getOne.');const _0x519ab9=_0x5c8d45['id'];if(_0x519ab9===undefined||_0x519ab9===null||_0x519ab9==='')throw CliErrors[_0x355c21(0x165)](_0x355c21(0x160),'Example:\x20--params\x20\x27{\x22id\x22:123}\x27');}function a49_0xc026(_0x55aa0d,_0xb4890){_0x55aa0d=_0x55aa0d-0x159;const _0x5934cb=a49_0x5934();let _0xc026bd=_0x5934cb[_0x55aa0d];return _0xc026bd;}function parseCommandParams(_0x37415e){return parseJsonParams(_0x37415e)??{};}export function buildDataCommand(_0x2e056e){const _0x392ced=a49_0xc026,_0x1debe8='Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon).\x20Resolves\x20to\x20dataset\x20code\x20automatically';return{'service':_0x392ced(0x162),'command':_0x2e056e['command'],'description':_0x2e056e[_0x392ced(0x166)],'risk':'read','defaultOutputFormat':_0x392ced(0x161),'helpExtra':_0x2e056e[_0x392ced(0x15e)],'flags':[CODE_FLAG,APPCODE_FLAG_OPTIONAL,{'name':'alias','type':_0x392ced(0x168),'description':_0x1debe8},{'name':_0x392ced(0x15a),'type':'string','description':_0x2e056e['paramsHint']}],async 'validate'(_0x1ff089){const _0x30f39e=_0x392ced,_0x3d3d0f=_0x1ff089[_0x30f39e(0x159)](_0x30f39e(0x15a));if(_0x2e056e['paramsRequired']&&!_0x3d3d0f)throw CliErrors[_0x30f39e(0x16b)]('params',_0x2e056e[_0x30f39e(0x164)]);const _0x3cb851=parseJsonParams(_0x3d3d0f);_0x2e056e[_0x30f39e(0x15d)]==='getOne'&&assertGetOneId(_0x3cb851);},async 'execute'(_0x7a61b5){const _0x1b3ecf=_0x392ced,_0x1617ec=parseCommandParams(_0x7a61b5[_0x1b3ecf(0x159)](_0x1b3ecf(0x15a))),_0x14db7c=Date[_0x1b3ecf(0x16a)](),_0x3255fb=await executeDatasetDataOperation(_0x7a61b5[_0x1b3ecf(0x16d)],_0x7a61b5[_0x1b3ecf(0x159)](_0x1b3ecf(0x172)),_0x2e056e['operation'],_0x1617ec),_0x87531b=Date[_0x1b3ecf(0x16a)]()-_0x14db7c;return{'ok':!![],'data':{'result':_0x3255fb,'elapsed':_0x87531b},'message':_0x1b3ecf(0x15f)+_0x2e056e[_0x1b3ecf(0x173)]+'\x20completed\x20in\x20'+_0x87531b+'ms'};}};}function a49_0x5934(){const _0x4ee1bf=['data\x20','data\x20getOne\x20requires\x20\x22id\x22\x20in\x20--params','compress','data','8WnyOuI','paramsHint','validation','description','6zWpLdl','string','571029TpJbxP','now','flagMissing','229265mWkDaq','appCode','3661040LAwgyF','1573222FZhrCw','20csNbZx','6022818jwFeeI','code','command','str','params','393646JGgIDJ','209882crdGrJ','operation','helpExtra'];a49_0x5934=function(){return _0x4ee1bf;};return a49_0x5934();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a50_0x1c0728=a50_0x4de8;(function(_0x5a796b,_0x236b5e){const _0x896031=a50_0x4de8,_0x346560=_0x5a796b();while(!![]){try{const _0xd13280=parseInt(_0x896031(0x97))/0x1*(-parseInt(_0x896031(0x91))/0x2)+parseInt(_0x896031(0xa3))/0x3*(-parseInt(_0x896031(0x84))/0x4)+-parseInt(_0x896031(0x8a))/0x5*(parseInt(_0x896031(0x89))/0x6)+parseInt(_0x896031(0x9b))/0x7+-parseInt(_0x896031(0x8d))/0x8*(-parseInt(_0x896031(0x90))/0x9)+parseInt(_0x896031(0x9f))/0xa+-parseInt(_0x896031(0x93))/0xb*(-parseInt(_0x896031(0xa5))/0xc);if(_0xd13280===_0x236b5e)break;else _0x346560['push'](_0x346560['shift']());}catch(_0x4a3fbb){_0x346560['push'](_0x346560['shift']());}}}(a50_0x4810,0x259c5));import{CliErrors}from'../../errors.js';function a50_0x4de8(_0x6ca67c,_0x3a9df1){_0x6ca67c=_0x6ca67c-0x83;const _0x481006=a50_0x4810();let _0x4de8df=_0x481006[_0x6ca67c];return _0x4de8df;}export const RUNTIME_DATA_ACCESS_COMMANDS={'cli':a50_0x1c0728(0x85),'filter':a50_0x1c0728(0x96),'getOne':a50_0x1c0728(0x98)};export const RUNTIME_DATA_ACCESS_SUMMARY=a50_0x1c0728(0x87);function valueToString(_0xf0d01b){const _0x95bc31=a50_0x1c0728;return _0xf0d01b==null?'':String(_0xf0d01b)[_0x95bc31(0xa0)]();}function getDatasetCode(_0x907aca){const _0x1c9b31=a50_0x1c0728;return valueToString(_0x907aca['code']??_0x907aca[_0x1c9b31(0x8b)]??_0x907aca['dataset']?.[_0x1c9b31(0xa4)]);}function a50_0x4810(){const _0x2f12f6=['5gJfVRc','modelCode','UNKNOWN','272eQNhAo','当前数据集\x20\x22','datasetName','8487SnDDCn','402FXpWgt','object','141988zybRiW','tableName','getOne','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27<json>\x27\x20--format\x20compress','213uQMdlg','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27\x20--format\x20compress','dataset','source','184996wAqkHp','name','unknown','dbId','1641050isJWYC','trim','length','\x20的\x20DB_TABLE\x20数据源上下文。','114vNjaxz','datasetCode','156EvhCpB','sourceType','如果只是查看运行态真实行数据,请切换到\x20lovrabet\x20CLI:','filter','5396EhZINU','lovrabet','SQL\x20schema\x20validation','Use\x20lovrabet\x20data\x20filter/getOne\x20for\x20real\x20runtime\x20records.','原因:schema\x20introspection\x20与\x20custom\x20SQL\x20需要\x20source=DB_TABLE、dbtableConfig.dbId、dbtableConfig.tableName\x20与数据库连接上下文。','853626IQmcZC'];a50_0x4810=function(){return _0x2f12f6;};return a50_0x4810();}function getDatasetName(_0x5e2aa8){const _0x19fe8c=a50_0x1c0728;return valueToString(_0x5e2aa8[_0x19fe8c(0x9c)]??_0x5e2aa8['dataset']?.[_0x19fe8c(0x8f)])||_0x19fe8c(0x9d);}function getDatasetSource(_0xb43e3b){const _0xd4ab24=a50_0x1c0728;return valueToString(_0xb43e3b[_0xd4ab24(0x9a)]??_0xb43e3b[_0xd4ab24(0x99)]?.[_0xd4ab24(0xa6)])['toUpperCase']();}function getDbtableConfig(_0x271ecb){const _0x14d060=a50_0x1c0728,_0x475a58=_0x271ecb['dbtableConfig']??_0x271ecb['dbtable'];return _0x475a58&&typeof _0x475a58===_0x14d060(0x92)?_0x475a58:{};}export function isDbTableBackedDataset(_0x3e8ea6){const _0x51f3bc=a50_0x1c0728,_0x380d85=getDatasetSource(_0x3e8ea6);if(_0x380d85==='METADATA')return![];const _0x543c0a=getDbtableConfig(_0x3e8ea6),_0x37807f=_0x543c0a[_0x51f3bc(0x9e)]??_0x543c0a['id'],_0x7a24a=valueToString(_0x543c0a[_0x51f3bc(0x94)]??_0x3e8ea6[_0x51f3bc(0x94)]??_0x3e8ea6['dataset']?.[_0x51f3bc(0x94)]);return _0x37807f!==undefined&&_0x37807f!==null&&_0x7a24a[_0x51f3bc(0xa1)]>0x0;}export function filterDbTableBackedDatasets(_0x232ee7){return _0x232ee7['filter'](_0x52331a=>isDbTableBackedDataset(_0x52331a));}export function buildDbTableBackedRequirementMessage(_0x8eb562,_0x4d3647=a50_0x1c0728(0x86)){const _0xb03f=a50_0x1c0728,_0x40f956=getDatasetSource(_0x8eb562)||_0xb03f(0x8c),_0x1c09c8=getDatasetName(_0x8eb562),_0x511af4=getDatasetCode(_0x8eb562),_0x4716f3=_0x511af4?'\x20('+_0x511af4+')':'';return[_0xb03f(0x8e)+_0x1c09c8+'\x22'+_0x4716f3+'\x20是\x20'+_0x40f956+'\x20类型,没有可用于\x20'+_0x4d3647+_0xb03f(0xa2),_0xb03f(0x88),'请先将该数据集升级/迁移为\x20DB_TABLE\x20数据集,再基于新的\x20dataset\x20code\x20继续开发。',_0xb03f(0xa7)+RUNTIME_DATA_ACCESS_COMMANDS[_0xb03f(0x83)]+';'+RUNTIME_DATA_ACCESS_COMMANDS[_0xb03f(0x95)]+'。']['join']('\x20');}export function assertDatasetIsDbTableBacked(_0x4900c6,_0x25272c){if(!isDbTableBackedDataset(_0x4900c6))throw CliErrors['validation'](buildDbTableBackedRequirementMessage(_0x4900c6,_0x25272c));}
|