@lovrabet/rabetbase-cli 2.2.1-beta.1 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- 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 -1
- 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 -1
- 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/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a32_0x43e65f=a32_0x43da;(function(_0xe75e53,_0x595981){const _0x1e25b9=a32_0x43da,_0x59026b=_0xe75e53();while(!![]){try{const _0x504386=-parseInt(_0x1e25b9(0x15c))/0x1*(-parseInt(_0x1e25b9(0x15d))/0x2)+parseInt(_0x1e25b9(0x162))/0x3*(parseInt(_0x1e25b9(0x19e))/0x4)+-parseInt(_0x1e25b9(0x197))/0x5+parseInt(_0x1e25b9(0x183))/0x6*(parseInt(_0x1e25b9(0x166))/0x7)+parseInt(_0x1e25b9(0x15a))/0x8+parseInt(_0x1e25b9(0x191))/0x9+parseInt(_0x1e25b9(0x193))/0xa*(-parseInt(_0x1e25b9(0x160))/0xb);if(_0x504386===_0x595981)break;else _0x59026b['push'](_0x59026b['shift']());}catch(_0x2b90a8){_0x59026b['push'](_0x59026b['shift']());}}}(a32_0x9a5f,0xc78c7));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';function a32_0x9a5f(){const _0xb1400e=['No\x20local\x20BFF\x20functions\x20found.','stringify','bool','create','script','lockKey','remoteId','every','code','6hTDLhd','filter','COMMON','str','Would\x20inspect\x20','functions','update','Push\x20only\x20this\x20script\x20type','filePath','high-risk-write','get','push','message','force','8486757rCKDlI','has','930vnKHDF','values','HOOK','datasetCode','5086055Hfxwky','validation','scriptsRoot','ENDPOINT','length','\x20skipped,\x20','version','574748UMtVCf','operationType','aliasToDatasetCode','POST','name','appCode','\x22\x20not\x20found\x20after\x20ensureLockScope.','lockFilePath','hash','Cannot\x20resolve\x20dataset\x20for\x20\x22','runtime\x20cache\x20cleared','description','apps','\x20uploaded,\x20','\x22.\x20','11535536UzFJpO','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','18877YUovqt','94qgksBK','Local\x20function\x20not\x20found:\x20','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','336083cMumQb','unchanged','3biKSwt','some','functionNode','/api/management/library/scripts/save','8821190vsXheG','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','runtime\x20cache\x20clear\x20failed','runtime\x20cache\x20not\x20needed','Force\x20push\x20ignoring\x20hash\x20protection','Lock\x20scope\x20for\x20app\x20\x22','alias','boolean','string','type','map','utf8',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','would_push','attempted','Incomplete\x20HOOK\x20path:\x20','toISOString','Push\x20complete:\x20','\x20failed,\x20','cleared'];a32_0x9a5f=function(){return _0xb1400e;};return a32_0x9a5f();}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':'bff','command':a32_0x43e65f(0x18e),'description':'Push\x20local\x20BFF\x20scripts\x20to\x20remote','risk':a32_0x43e65f(0x18c),'flags':[{'name':a32_0x43e65f(0x16f),'type':'string','description':a32_0x43e65f(0x18a),'enum':[a32_0x43e65f(0x185),a32_0x43e65f(0x19a),'HOOK']},{'name':a32_0x43e65f(0x1a2),'type':a32_0x43e65f(0x16e),'description':a32_0x43e65f(0x15b)},{'name':a32_0x43e65f(0x190),'type':a32_0x43e65f(0x16d),'description':a32_0x43e65f(0x16a)}],async 'dryRun'(_0xa90bdf){const _0xaede8f=a32_0x43e65f,_0x3f303c=loadBffProjectConfig(_0xa90bdf[_0xaede8f(0x1a3)]),_0x36425a=await readBffLockFile(_0x3f303c[_0xaede8f(0x1a5)]),{appLock:_0x299853}=ensureLockScope(_0x36425a??createEmptyBffLock(),_0xa90bdf[_0xaede8f(0x1a3)],_0x3f303c[_0xaede8f(0x199)],_0xaede8f(0x18e)),_0x18e9f9=await getTargetFunctions(_0x3f303c,_0xa90bdf),_0x43210f=_0xa90bdf['bool'](_0xaede8f(0x190)),_0x48b957=[];for(const _0x531cd6 of _0x18e9f9){const _0x49b12b=await computeFileHash(_0x531cd6[_0xaede8f(0x18b)]),_0x3b51eb=_0x299853['functions'][_0x531cd6[_0xaede8f(0x17f)]],_0x7ccb5b=!!_0x3b51eb&&_0x3b51eb['hash']===_0x49b12b;_0x48b957['push']({'lockKey':_0x531cd6[_0xaede8f(0x17f)],'filePath':_0x531cd6[_0xaede8f(0x18b)],'remoteId':_0x3b51eb?.['remoteId']??null,'mode':_0x3b51eb?.[_0xaede8f(0x180)]?_0xaede8f(0x189):_0xaede8f(0x17d),'status':!_0x43210f&&_0x7ccb5b?_0xaede8f(0x161):'would_push'});}return{'method':_0xaede8f(0x1a1),'url':_0xaede8f(0x165),'body':{'appCode':_0xa90bdf['appCode'],'force':_0x43210f,'files':_0x48b957,'cacheClearAtRuntime':_0x48b957[_0xaede8f(0x163)](_0x362c22=>_0x362c22['status']===_0xaede8f(0x173)),'cacheClearAtRuntimeTimes':_0x48b957[_0xaede8f(0x163)](_0x339d5d=>_0x339d5d['status']===_0xaede8f(0x173))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0xaede8f(0x187)+_0x48b957['length']+'\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded'};},async 'execute'(_0xd08245){const _0xef6bba=a32_0x43e65f,_0x226ba1=loadBffProjectConfig(_0xd08245[_0xef6bba(0x1a3)]),_0x1699d0=await readBffLockFile(_0x226ba1[_0xef6bba(0x1a5)]),{lockData:_0x440cf2,appLock:_0x39e72e}=ensureLockScope(_0x1699d0??createEmptyBffLock(),_0xd08245['appCode'],_0x226ba1['scriptsRoot'],'push'),_0x120939=await getTargetFunctions(_0x226ba1,_0xd08245);if(_0x120939[_0xef6bba(0x19b)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0xef6bba(0x17a)};const _0xbefca0=_0xd08245[_0xef6bba(0x17c)](_0xef6bba(0x190)),_0x2d901f=JSON['parse'](JSON[_0xef6bba(0x17b)](_0x440cf2)),_0x2c73d8=_0x2d901f[_0xef6bba(0x157)][_0xd08245['appCode']];if(!_0x2c73d8)throw new Error(_0xef6bba(0x16b)+_0xd08245[_0xef6bba(0x1a3)]+_0xef6bba(0x1a4));const _0x2bffbb=await buildHookMaps(_0xd08245[_0xef6bba(0x1a3)],_0xd08245['apiDir'],_0x120939,_0x2c73d8),_0x426a98=[],_0x1a2fff=[],_0x47949a=[];for(const _0x4388bd of _0x120939){const _0x572415=await computeFileHash(_0x4388bd[_0xef6bba(0x18b)]),_0x270ef0=_0x2c73d8['functions'][_0x4388bd[_0xef6bba(0x17f)]];if(!_0xbefca0&&_0x270ef0&&_0x270ef0[_0xef6bba(0x1a6)]===_0x572415){_0x1a2fff[_0xef6bba(0x18e)]({'lockKey':_0x4388bd[_0xef6bba(0x17f)],'reason':'unchanged'});continue;}try{await uploadSingleFunction(_0xd08245[_0xef6bba(0x1a3)],_0x4388bd,_0x2c73d8,_0x2bffbb);const _0x4fbf89=_0x2c73d8[_0xef6bba(0x188)][_0x4388bd['lockKey']];_0x426a98[_0xef6bba(0x18e)]({'lockKey':_0x4388bd[_0xef6bba(0x17f)],'remoteId':_0x4fbf89?.['remoteId']??0x0});}catch(_0x164400){_0x47949a[_0xef6bba(0x18e)]({'lockKey':_0x4388bd[_0xef6bba(0x17f)],'error':_0x164400 instanceof Error?_0x164400['message']:String(_0x164400)});}}_0x2c73d8['lastSync']=new Date()[_0xef6bba(0x176)](),await writeBffLockFile(_0x226ba1[_0xef6bba(0x1a5)],_0x2d901f),await waitForUploadedLockEntries(_0x226ba1['lockFilePath'],_0xd08245['appCode'],_0x426a98[_0xef6bba(0x170)](_0x2032fe=>_0x2032fe[_0xef6bba(0x17f)]));let _0x395d6d={'attempted':![],'cleared':![]};if(_0x426a98[_0xef6bba(0x19b)]>0x0)try{let _0xb70ed='';for(let _0x2ecb8a=0x0;_0x2ecb8a<CACHE_CLEAR_ATTEMPTS;_0x2ecb8a+=0x1){_0xb70ed=await clearBffScriptCache(),_0x2ecb8a<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x395d6d={'attempted':!![],'cleared':!![],'message':_0xb70ed||'Runtime\x20script\x20cache\x20cleared.'};}catch(_0x24be1c){_0x395d6d={'attempted':!![],'cleared':![],'error':_0x24be1c instanceof Error?_0x24be1c[_0xef6bba(0x18f)]:String(_0x24be1c)};}const _0x491299=_0x47949a[_0xef6bba(0x19b)]===0x0&&(_0x395d6d[_0xef6bba(0x174)]?_0x395d6d['cleared']:!![]),_0x169041=_0x395d6d[_0xef6bba(0x174)]?_0x395d6d[_0xef6bba(0x179)]?_0xef6bba(0x1a8):_0xef6bba(0x168):_0xef6bba(0x169);return{'ok':_0x491299,'data':{'uploaded':_0x426a98,'skipped':_0x1a2fff,'failed':_0x47949a,'cacheClear':_0x395d6d},'message':_0xef6bba(0x177)+_0x426a98[_0xef6bba(0x19b)]+_0xef6bba(0x158)+_0x1a2fff[_0xef6bba(0x19b)]+_0xef6bba(0x19c)+_0x47949a[_0xef6bba(0x19b)]+_0xef6bba(0x178)+_0x169041};}};async function getTargetFunctions(_0x55884a,_0x2269f6){const _0xdd1c7d=a32_0x43e65f,_0x49dc7e=_0x2269f6[_0xdd1c7d(0x186)](_0xdd1c7d(0x16f)),_0x4bac93=_0x2269f6['str']('name'),_0x2bf684=normalizeBffType(_0x49dc7e)??undefined;if(_0x4bac93&&!_0x2bf684)throw CliErrors[_0xdd1c7d(0x198)]('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0xbabf3d=await scanLocalBffFunctions(_0x55884a,_0x2bf684);if(_0x4bac93){const _0x4d1252=_0xbabf3d[_0xdd1c7d(0x184)](_0x2b2fa9=>_0x2b2fa9[_0xdd1c7d(0x1a2)]===_0x4bac93);if(_0x4d1252[_0xdd1c7d(0x19b)]===0x0)throw CliErrors[_0xdd1c7d(0x198)](_0xdd1c7d(0x15e)+_0x2bf684+'/'+_0x4bac93);return _0x4d1252;}return _0xbabf3d;}async function buildHookMaps(_0x9e43d8,_0x588a86,_0x5a0507,_0x563593){const _0x4748f3=a32_0x43e65f,_0x2d5dd6=_0x5a0507['some'](_0x28ea9e=>_0x28ea9e[_0x4748f3(0x16f)]===_0x4748f3(0x195));if(!_0x2d5dd6)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x2baa62=loadAliasMap(_0x588a86,undefined,resolveApiFilePath(_0x588a86,_0x9e43d8)),_0xfe2147=new Map(_0x2baa62[_0x4748f3(0x170)](_0x154971=>[_0x154971[_0x4748f3(0x16c)],_0x154971['datasetCode']]));for(const _0x5f53cf of Object[_0x4748f3(0x194)](_0x563593[_0x4748f3(0x188)])){_0x5f53cf['alias']&&_0x5f53cf['datasetCode']&&!_0xfe2147['has'](_0x5f53cf['alias'])&&_0xfe2147['set'](_0x5f53cf[_0x4748f3(0x16c)],_0x5f53cf[_0x4748f3(0x196)]);}const _0x3b83cb=await listDatasets(_0x9e43d8),_0xf2a61b=new Map(_0x3b83cb[_0x4748f3(0x170)](_0x58e330=>[_0x58e330[_0x4748f3(0x182)],_0x58e330]));return{'aliasToDatasetCode':_0xfe2147,'datasetCodeToDataset':_0xf2a61b};}async function uploadSingleFunction(_0x3de303,_0x5e933b,_0x35a786,_0x1298fd){const _0x24d64c=a32_0x43e65f,_0x31db56=await readFile(_0x5e933b[_0x24d64c(0x18b)],_0x24d64c(0x171)),_0x48373e=await computeFileHash(_0x5e933b[_0x24d64c(0x18b)]),_0x2c80ea=_0x35a786[_0x24d64c(0x188)][_0x5e933b[_0x24d64c(0x17f)]];if(_0x2c80ea?.[_0x24d64c(0x180)]&&_0x2c80ea[_0x24d64c(0x19d)]==null)throw CliErrors[_0x24d64c(0x198)](_0x5e933b[_0x24d64c(0x17f)]+_0x24d64c(0x172));let _0x49b889=extractScriptDescription(_0x31db56);if(!_0x49b889&&_0x2c80ea?.['remoteId']){const _0xa6e062=await getBffScriptInfo(_0x2c80ea[_0x24d64c(0x180)]);_0x49b889=_0xa6e062[_0x24d64c(0x156)]||undefined;}const _0x4e9275={'appCode':_0x3de303,'functionName':_0x5e933b[_0x24d64c(0x1a2)],'scriptType':_0x5e933b[_0x24d64c(0x16f)],'scriptContent':_0x31db56};if(_0x2c80ea?.[_0x24d64c(0x180)])_0x4e9275['id']=_0x2c80ea['remoteId'];if(_0x2c80ea?.[_0x24d64c(0x19d)]!=null)_0x4e9275[_0x24d64c(0x19d)]=_0x2c80ea[_0x24d64c(0x19d)];if(_0x49b889)_0x4e9275[_0x24d64c(0x156)]=_0x49b889;if(_0x5e933b[_0x24d64c(0x16f)]===_0x24d64c(0x195)){const _0x4cc8e5=_0x5e933b[_0x24d64c(0x16c)];if(!_0x4cc8e5||!_0x5e933b[_0x24d64c(0x19f)]||!_0x5e933b[_0x24d64c(0x164)])throw CliErrors[_0x24d64c(0x198)](_0x24d64c(0x175)+_0x5e933b[_0x24d64c(0x17f)]);const _0x3a93ec=_0x1298fd[_0x24d64c(0x1a0)]['get'](_0x4cc8e5)??_0x2c80ea?.[_0x24d64c(0x196)]??_0x4cc8e5,_0x42d7bd=_0x1298fd['datasetCodeToDataset'][_0x24d64c(0x18d)](_0x3a93ec);if(!_0x42d7bd)throw CliErrors[_0x24d64c(0x198)](_0x24d64c(0x1a7)+_0x4cc8e5+_0x24d64c(0x159)+('Run\x20`'+CLI_BIN_NAME+_0x24d64c(0x167)));_0x4e9275['datasetId']=_0x42d7bd['id'],_0x4e9275[_0x24d64c(0x19f)]=_0x5e933b[_0x24d64c(0x19f)],_0x4e9275[_0x24d64c(0x164)]=_0x5e933b[_0x24d64c(0x164)];}const _0x13fd85=await saveBffScript(_0x4e9275),_0x5ce77e=_0x13fd85['id'],_0x3f0604=_0x13fd85[_0x24d64c(0x17e)]??await getBffScriptInfo(_0x5ce77e),_0x5026f2={'hash':_0x48373e,'remoteId':_0x5ce77e,'version':_0x3f0604[_0x24d64c(0x19d)]};if(_0x5e933b[_0x24d64c(0x16f)]==='HOOK'){const _0x5e3858=_0x5e933b[_0x24d64c(0x16c)],_0x5a3696=_0x1298fd[_0x24d64c(0x1a0)][_0x24d64c(0x18d)](_0x5e3858)??_0x2c80ea?.[_0x24d64c(0x196)]??_0x5e3858;_0x1298fd[_0x24d64c(0x1a0)][_0x24d64c(0x192)](_0x5e3858)?_0x5026f2['alias']=_0x5e3858:_0x5026f2['alias']=_0x2c80ea?.[_0x24d64c(0x16c)],_0x5026f2['datasetCode']=_0x5a3696,_0x5026f2[_0x24d64c(0x19f)]=_0x5e933b[_0x24d64c(0x19f)],_0x5026f2['functionNode']=_0x5e933b[_0x24d64c(0x164)];}_0x35a786[_0x24d64c(0x188)][_0x5e933b['lockKey']]=_0x5026f2;}function a32_0x43da(_0x266597,_0xf13b75){_0x266597=_0x266597-0x156;const _0x9a5f60=a32_0x9a5f();let _0x43daa5=_0x9a5f60[_0x266597];return _0x43daa5;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x1a9b83,_0x5dd853,_0x53a014){const _0xf019ce=a32_0x43e65f;if(_0x53a014[_0xf019ce(0x19b)]===0x0)return;for(let _0x57bedb=0x0;_0x57bedb<LOCK_SETTLE_RETRY_COUNT;_0x57bedb+=0x1){const _0x59bd2f=await readBffLockFile(_0x1a9b83),_0x2772d1=_0x59bd2f?.[_0xf019ce(0x157)]?.[_0x5dd853]?.[_0xf019ce(0x188)]??{},_0x1ff437=_0x53a014[_0xf019ce(0x181)](_0x2abfed=>!!_0x2772d1[_0x2abfed]?.[_0xf019ce(0x180)]);if(_0x1ff437)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0xf019ce(0x15f)+_0x53a014['join'](',\x20')+'.');}
|
|
1
|
+
const a32_0x4762c2=a32_0x1345;(function(_0x2f606b,_0x16ef17){const _0x1b7f14=a32_0x1345,_0xa04f1a=_0x2f606b();while(!![]){try{const _0x4484e6=parseInt(_0x1b7f14(0xa5))/0x1*(-parseInt(_0x1b7f14(0x83))/0x2)+-parseInt(_0x1b7f14(0x8d))/0x3+-parseInt(_0x1b7f14(0xa9))/0x4*(-parseInt(_0x1b7f14(0xa1))/0x5)+-parseInt(_0x1b7f14(0x88))/0x6*(-parseInt(_0x1b7f14(0xa0))/0x7)+-parseInt(_0x1b7f14(0xc0))/0x8*(-parseInt(_0x1b7f14(0x97))/0x9)+parseInt(_0x1b7f14(0x99))/0xa*(parseInt(_0x1b7f14(0xcf))/0xb)+-parseInt(_0x1b7f14(0xbc))/0xc;if(_0x4484e6===_0x16ef17)break;else _0xa04f1a['push'](_0xa04f1a['shift']());}catch(_0x5d0956){_0xa04f1a['push'](_0xa04f1a['shift']());}}}(a32_0x5236,0x99caf));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';function a32_0x5236(){const _0x6ba5ca=['lockFilePath','No\x20local\x20BFF\x20functions\x20found.','2VagJuq','high-risk-write','\x20uploaded,\x20','Push\x20only\x20this\x20script\x20type','bool','5030778zrAmgt','Would\x20inspect\x20','message','Force\x20push\x20ignoring\x20hash\x20protection','\x20skipped,\x20','1080291RFHyux','\x22.\x20','attempted','scriptsRoot','set','datasetCode','Local\x20function\x20not\x20found:\x20','would_push','datasetId','\x20failed,\x20','1127142ndOEBV','get','249440vwusLL','type','apiDir','alias','str',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','force','7HTWcbn','671665CjrEPL','operationType','map','stringify','628400GWpsrv','push','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','/api/management/library/scripts/save','16kJqzOZ','\x22\x20not\x20found\x20after\x20ensureLockScope.','some','appCode','HOOK','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','functions','Push\x20complete:\x20','values','toISOString','string','Cannot\x20resolve\x20dataset\x20for\x20\x22','lockKey','datasetCodeToDataset','join','boolean','functionNode','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','version','5793732UgyxUI','code','aliasToDatasetCode','utf8','32KRKDDF','parse','COMMON','ENDPOINT','length','name','cleared','hash','apps','remoteId','filePath','validation','status','description','script','99vYADnc','runtime\x20cache\x20clear\x20failed','bff','Runtime\x20script\x20cache\x20cleared.','every'];a32_0x5236=function(){return _0x6ba5ca;};return a32_0x5236();}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_0x4762c2(0xd1),'command':a32_0x4762c2(0xa6),'description':'Push\x20local\x20BFF\x20scripts\x20to\x20remote','risk':a32_0x4762c2(0x84),'flags':[{'name':a32_0x4762c2(0x9a),'type':a32_0x4762c2(0xb3),'description':a32_0x4762c2(0x86),'enum':[a32_0x4762c2(0xc2),a32_0x4762c2(0xc3),a32_0x4762c2(0xad)]},{'name':a32_0x4762c2(0xc5),'type':a32_0x4762c2(0xb3),'description':a32_0x4762c2(0xa7)},{'name':a32_0x4762c2(0x9f),'type':a32_0x4762c2(0xb8),'description':a32_0x4762c2(0x8b)}],async 'dryRun'(_0x15df05){const _0x3776ad=a32_0x4762c2,_0x12084b=loadBffProjectConfig(_0x15df05[_0x3776ad(0xac)]),_0x14477a=await readBffLockFile(_0x12084b[_0x3776ad(0x81)]),{appLock:_0x26b1f0}=ensureLockScope(_0x14477a??createEmptyBffLock(),_0x15df05[_0x3776ad(0xac)],_0x12084b[_0x3776ad(0x90)],_0x3776ad(0xa6)),_0x8915e9=await getTargetFunctions(_0x12084b,_0x15df05),_0x4c145c=_0x15df05[_0x3776ad(0x87)](_0x3776ad(0x9f)),_0x237170=[];for(const _0x582dfd of _0x8915e9){const _0x2ac493=await computeFileHash(_0x582dfd[_0x3776ad(0xca)]),_0x5923b3=_0x26b1f0[_0x3776ad(0xaf)][_0x582dfd[_0x3776ad(0xb5)]],_0x1a34a4=!!_0x5923b3&&_0x5923b3[_0x3776ad(0xc7)]===_0x2ac493;_0x237170[_0x3776ad(0xa6)]({'lockKey':_0x582dfd[_0x3776ad(0xb5)],'filePath':_0x582dfd[_0x3776ad(0xca)],'remoteId':_0x5923b3?.[_0x3776ad(0xc9)]??null,'mode':_0x5923b3?.['remoteId']?'update':'create','status':!_0x4c145c&&_0x1a34a4?'unchanged':_0x3776ad(0x94)});}return{'method':'POST','url':_0x3776ad(0xa8),'body':{'appCode':_0x15df05[_0x3776ad(0xac)],'force':_0x4c145c,'files':_0x237170,'cacheClearAtRuntime':_0x237170['some'](_0x4da7d0=>_0x4da7d0[_0x3776ad(0xcc)]==='would_push'),'cacheClearAtRuntimeTimes':_0x237170[_0x3776ad(0xab)](_0x3e4deb=>_0x3e4deb[_0x3776ad(0xcc)]===_0x3776ad(0x94))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x3776ad(0x89)+_0x237170[_0x3776ad(0xc4)]+'\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded'};},async 'execute'(_0x47cf65){const _0x3d2f24=a32_0x4762c2,_0x20c6ce=loadBffProjectConfig(_0x47cf65[_0x3d2f24(0xac)]),_0x445405=await readBffLockFile(_0x20c6ce['lockFilePath']),{lockData:_0x1073cb,appLock:_0xab6197}=ensureLockScope(_0x445405??createEmptyBffLock(),_0x47cf65[_0x3d2f24(0xac)],_0x20c6ce[_0x3d2f24(0x90)],'push'),_0x480311=await getTargetFunctions(_0x20c6ce,_0x47cf65);if(_0x480311[_0x3d2f24(0xc4)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x3d2f24(0x82)};const _0x2197bb=_0x47cf65[_0x3d2f24(0x87)](_0x3d2f24(0x9f)),_0x30ae33=JSON[_0x3d2f24(0xc1)](JSON[_0x3d2f24(0xa4)](_0x1073cb)),_0x4e3f18=_0x30ae33[_0x3d2f24(0xc8)][_0x47cf65['appCode']];if(!_0x4e3f18)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x47cf65[_0x3d2f24(0xac)]+_0x3d2f24(0xaa));const _0x22eb8c=await buildHookMaps(_0x47cf65[_0x3d2f24(0xac)],_0x47cf65[_0x3d2f24(0x9b)],_0x480311,_0x4e3f18),_0x311f39=[],_0x2e2023=[],_0x11bd5f=[];for(const _0x4aea95 of _0x480311){const _0x1dd78c=await computeFileHash(_0x4aea95[_0x3d2f24(0xca)]),_0x526da1=_0x4e3f18[_0x3d2f24(0xaf)][_0x4aea95['lockKey']];if(!_0x2197bb&&_0x526da1&&_0x526da1[_0x3d2f24(0xc7)]===_0x1dd78c){_0x2e2023[_0x3d2f24(0xa6)]({'lockKey':_0x4aea95['lockKey'],'reason':'unchanged'});continue;}try{await uploadSingleFunction(_0x47cf65[_0x3d2f24(0xac)],_0x4aea95,_0x4e3f18,_0x22eb8c);const _0x55180c=_0x4e3f18[_0x3d2f24(0xaf)][_0x4aea95[_0x3d2f24(0xb5)]];_0x311f39[_0x3d2f24(0xa6)]({'lockKey':_0x4aea95[_0x3d2f24(0xb5)],'remoteId':_0x55180c?.[_0x3d2f24(0xc9)]??0x0});}catch(_0x48f91d){_0x11bd5f[_0x3d2f24(0xa6)]({'lockKey':_0x4aea95[_0x3d2f24(0xb5)],'error':_0x48f91d instanceof Error?_0x48f91d['message']:String(_0x48f91d)});}}_0x4e3f18['lastSync']=new Date()[_0x3d2f24(0xb2)](),await writeBffLockFile(_0x20c6ce[_0x3d2f24(0x81)],_0x30ae33),await waitForUploadedLockEntries(_0x20c6ce[_0x3d2f24(0x81)],_0x47cf65['appCode'],_0x311f39['map'](_0x523f3b=>_0x523f3b[_0x3d2f24(0xb5)]));let _0x1c0e12={'attempted':![],'cleared':![]};if(_0x311f39[_0x3d2f24(0xc4)]>0x0)try{let _0x8b72f4='';for(let _0x14d50e=0x0;_0x14d50e<CACHE_CLEAR_ATTEMPTS;_0x14d50e+=0x1){_0x8b72f4=await clearBffScriptCache(),_0x14d50e<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x1c0e12={'attempted':!![],'cleared':!![],'message':_0x8b72f4||_0x3d2f24(0xd2)};}catch(_0x52f7e2){_0x1c0e12={'attempted':!![],'cleared':![],'error':_0x52f7e2 instanceof Error?_0x52f7e2[_0x3d2f24(0x8a)]:String(_0x52f7e2)};}const _0x282e21=_0x11bd5f[_0x3d2f24(0xc4)]===0x0&&(_0x1c0e12[_0x3d2f24(0x8f)]?_0x1c0e12['cleared']:!![]),_0x419370=_0x1c0e12[_0x3d2f24(0x8f)]?_0x1c0e12[_0x3d2f24(0xc6)]?'runtime\x20cache\x20cleared':_0x3d2f24(0xd0):'runtime\x20cache\x20not\x20needed';return{'ok':_0x282e21,'data':{'uploaded':_0x311f39,'skipped':_0x2e2023,'failed':_0x11bd5f,'cacheClear':_0x1c0e12},'message':_0x3d2f24(0xb0)+_0x311f39[_0x3d2f24(0xc4)]+_0x3d2f24(0x85)+_0x2e2023['length']+_0x3d2f24(0x8c)+_0x11bd5f[_0x3d2f24(0xc4)]+_0x3d2f24(0x96)+_0x419370};}};async function getTargetFunctions(_0x9bd5f7,_0x5329b8){const _0x18b04c=a32_0x4762c2,_0x1415eb=_0x5329b8[_0x18b04c(0x9d)]('type'),_0x39bcb6=_0x5329b8[_0x18b04c(0x9d)](_0x18b04c(0xc5)),_0x5ecafd=normalizeBffType(_0x1415eb)??undefined;if(_0x39bcb6&&!_0x5ecafd)throw CliErrors[_0x18b04c(0xcb)]('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x1f9e06=await scanLocalBffFunctions(_0x9bd5f7,_0x5ecafd);if(_0x39bcb6){const _0x196886=_0x1f9e06['filter'](_0x4dd677=>_0x4dd677[_0x18b04c(0xc5)]===_0x39bcb6);if(_0x196886['length']===0x0)throw CliErrors[_0x18b04c(0xcb)](_0x18b04c(0x93)+_0x5ecafd+'/'+_0x39bcb6);return _0x196886;}return _0x1f9e06;}function a32_0x1345(_0x500e73,_0x48302b){_0x500e73=_0x500e73-0x81;const _0x523638=a32_0x5236();let _0x1345c8=_0x523638[_0x500e73];return _0x1345c8;}async function buildHookMaps(_0x43f7b7,_0x3c2f27,_0x2e37b7,_0xa0aaf4){const _0x5d1724=a32_0x4762c2,_0x1d6028=_0x2e37b7['some'](_0x3cd943=>_0x3cd943['type']===_0x5d1724(0xad));if(!_0x1d6028)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x31e7a1=loadAliasMap(_0x3c2f27,undefined,resolveApiFilePath(_0x3c2f27,_0x43f7b7)),_0x1c34d6=new Map(_0x31e7a1['map'](_0x6021b9=>[_0x6021b9[_0x5d1724(0x9c)],_0x6021b9[_0x5d1724(0x92)]]));for(const _0x515cd4 of Object[_0x5d1724(0xb1)](_0xa0aaf4[_0x5d1724(0xaf)])){_0x515cd4[_0x5d1724(0x9c)]&&_0x515cd4[_0x5d1724(0x92)]&&!_0x1c34d6['has'](_0x515cd4[_0x5d1724(0x9c)])&&_0x1c34d6[_0x5d1724(0x91)](_0x515cd4[_0x5d1724(0x9c)],_0x515cd4[_0x5d1724(0x92)]);}const _0x1bac75=await listDatasets(_0x43f7b7),_0x19fcf2=new Map(_0x1bac75[_0x5d1724(0xa3)](_0x309730=>[_0x309730[_0x5d1724(0xbd)],_0x309730]));return{'aliasToDatasetCode':_0x1c34d6,'datasetCodeToDataset':_0x19fcf2};}async function uploadSingleFunction(_0xd6a1e2,_0x54e1da,_0x14bb0e,_0xca4551){const _0xe6f78c=a32_0x4762c2,_0x41a6af=await readFile(_0x54e1da[_0xe6f78c(0xca)],_0xe6f78c(0xbf)),_0x569cca=await computeFileHash(_0x54e1da['filePath']),_0x58b7eb=_0x14bb0e[_0xe6f78c(0xaf)][_0x54e1da[_0xe6f78c(0xb5)]];if(_0x58b7eb?.[_0xe6f78c(0xc9)]&&_0x58b7eb[_0xe6f78c(0xbb)]==null)throw CliErrors['validation'](_0x54e1da['lockKey']+_0xe6f78c(0x9e));let _0x6fdc34=extractScriptDescription(_0x41a6af);if(!_0x6fdc34&&_0x58b7eb?.[_0xe6f78c(0xc9)]){const _0x55faa9=await getBffScriptInfo(_0x58b7eb['remoteId']);_0x6fdc34=_0x55faa9[_0xe6f78c(0xcd)]||undefined;}const _0x451780={'appCode':_0xd6a1e2,'functionName':_0x54e1da[_0xe6f78c(0xc5)],'scriptType':_0x54e1da[_0xe6f78c(0x9a)],'scriptContent':_0x41a6af};if(_0x58b7eb?.[_0xe6f78c(0xc9)])_0x451780['id']=_0x58b7eb['remoteId'];if(_0x58b7eb?.[_0xe6f78c(0xbb)]!=null)_0x451780[_0xe6f78c(0xbb)]=_0x58b7eb[_0xe6f78c(0xbb)];if(_0x6fdc34)_0x451780['description']=_0x6fdc34;if(_0x54e1da[_0xe6f78c(0x9a)]===_0xe6f78c(0xad)){const _0x4bbbbd=_0x54e1da[_0xe6f78c(0x9c)];if(!_0x4bbbbd||!_0x54e1da[_0xe6f78c(0xa2)]||!_0x54e1da['functionNode'])throw CliErrors[_0xe6f78c(0xcb)]('Incomplete\x20HOOK\x20path:\x20'+_0x54e1da[_0xe6f78c(0xb5)]);const _0x2a41fe=_0xca4551[_0xe6f78c(0xbe)][_0xe6f78c(0x98)](_0x4bbbbd)??_0x58b7eb?.['datasetCode']??_0x4bbbbd,_0x5c843b=_0xca4551[_0xe6f78c(0xb6)][_0xe6f78c(0x98)](_0x2a41fe);if(!_0x5c843b)throw CliErrors[_0xe6f78c(0xcb)](_0xe6f78c(0xb4)+_0x4bbbbd+_0xe6f78c(0x8e)+('Run\x20`'+CLI_BIN_NAME+_0xe6f78c(0xba)));_0x451780[_0xe6f78c(0x95)]=_0x5c843b['id'],_0x451780[_0xe6f78c(0xa2)]=_0x54e1da[_0xe6f78c(0xa2)],_0x451780[_0xe6f78c(0xb9)]=_0x54e1da[_0xe6f78c(0xb9)];}const _0x24081d=await saveBffScript(_0x451780),_0x4d1bae=_0x24081d['id'],_0x4b2193=_0x24081d[_0xe6f78c(0xce)]??await getBffScriptInfo(_0x4d1bae),_0x5dc98f={'hash':_0x569cca,'remoteId':_0x4d1bae,'version':_0x4b2193['version']};if(_0x54e1da[_0xe6f78c(0x9a)]===_0xe6f78c(0xad)){const _0x402b4a=_0x54e1da['alias'],_0x130ca4=_0xca4551[_0xe6f78c(0xbe)][_0xe6f78c(0x98)](_0x402b4a)??_0x58b7eb?.['datasetCode']??_0x402b4a;_0xca4551['aliasToDatasetCode']['has'](_0x402b4a)?_0x5dc98f['alias']=_0x402b4a:_0x5dc98f[_0xe6f78c(0x9c)]=_0x58b7eb?.['alias'],_0x5dc98f[_0xe6f78c(0x92)]=_0x130ca4,_0x5dc98f['operationType']=_0x54e1da['operationType'],_0x5dc98f[_0xe6f78c(0xb9)]=_0x54e1da[_0xe6f78c(0xb9)];}_0x14bb0e[_0xe6f78c(0xaf)][_0x54e1da[_0xe6f78c(0xb5)]]=_0x5dc98f;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x23153b,_0x5bc600,_0x56cca2){const _0x32cd8c=a32_0x4762c2;if(_0x56cca2['length']===0x0)return;for(let _0xac6d3f=0x0;_0xac6d3f<LOCK_SETTLE_RETRY_COUNT;_0xac6d3f+=0x1){const _0x4e60d4=await readBffLockFile(_0x23153b),_0x35b57c=_0x4e60d4?.[_0x32cd8c(0xc8)]?.[_0x5bc600]?.['functions']??{},_0x138d7c=_0x56cca2[_0x32cd8c(0xd3)](_0x5ee5d7=>!!_0x35b57c[_0x5ee5d7]?.['remoteId']);if(_0x138d7c)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x32cd8c(0xae)+_0x56cca2[_0x32cd8c(0xb7)](',\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a33_0x308d(){const _0x566373=['745464ElHsrj','hash','appCode','apiDir','length','status','3356LdwBcG','lockFilePath','read','remote','bff','map','1718160dJlQcK','push','1065ORXIDG','\x20unchanged','\x20modified,\x20','functions','datasetCode','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','scriptsRoot','189wAPvbs','4056666MxdUSC','129388uECvNN','lockKey','579185IQIeIQ','all','5bwOJHE','229100jjcKAL','filePath','\x20added,\x20','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file'];a33_0x308d=function(){return _0x566373;};return a33_0x308d();}const a33_0x5717a5=a33_0x5eef;(function(_0x7b596,_0x16d1b0){const _0x46de94=a33_0x5eef,_0x44e7f8=_0x7b596();while(!![]){try{const _0x422ad4=-parseInt(_0x46de94(0x188))/0x1+-parseInt(_0x46de94(0x195))/0x2*(-parseInt(_0x46de94(0x19d))/0x3)+parseInt(_0x46de94(0x19b))/0x4+-parseInt(_0x46de94(0x18a))/0x5*(-parseInt(_0x46de94(0x1a5))/0x6)+-parseInt(_0x46de94(0x1a6))/0x7+-parseInt(_0x46de94(0x18f))/0x8+parseInt(_0x46de94(0x1a4))/0x9*(-parseInt(_0x46de94(0x18b))/0xa);if(_0x422ad4===_0x16d1b0)break;else _0x44e7f8['push'](_0x44e7f8['shift']());}catch(_0x258392){_0x44e7f8['push'](_0x44e7f8['shift']());}}}(a33_0x308d,0x813e3));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a33_0x5eef(_0x5db964,_0x50dfa6){_0x5db964=_0x5db964-0x188;const _0x308d0b=a33_0x308d();let _0x5eefac=_0x308d0b[_0x5db964];return _0x5eefac;}import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a33_0x5717a5(0x199),'command':a33_0x5717a5(0x194),'description':a33_0x5717a5(0x18e),'risk':a33_0x5717a5(0x197),'flags':[{'name':a33_0x5717a5(0x198),'type':'boolean','description':a33_0x5717a5(0x1a2)}],async 'execute'(_0x3decf){const _0xb2d6ea=a33_0x5717a5,_0x2d486d=loadBffProjectConfig(_0x3decf[_0xb2d6ea(0x191)]),_0x10f310=await readBffLockFile(_0x2d486d[_0xb2d6ea(0x196)]),{appLock:_0xd417f5}=ensureLockScope(_0x10f310??createEmptyBffLock(),_0x3decf[_0xb2d6ea(0x191)],_0x2d486d[_0xb2d6ea(0x1a3)],_0xb2d6ea(0x194)),_0x495d4b=await scanLocalBffFunctions(_0x2d486d),_0x7fdf51=[],_0x8d46a2=[],_0x474787=[];for(const _0x5eac17 of _0x495d4b){const _0x3a9442=await computeFileHash(_0x5eac17[_0xb2d6ea(0x18c)]),_0x5a5404=_0xd417f5['functions'][_0x5eac17[_0xb2d6ea(0x1a7)]];if(!_0x5a5404)_0x7fdf51[_0xb2d6ea(0x19c)](_0x5eac17['lockKey']);else _0x5a5404[_0xb2d6ea(0x190)]!==_0x3a9442?_0x8d46a2[_0xb2d6ea(0x19c)](_0x5eac17[_0xb2d6ea(0x1a7)]):_0x474787[_0xb2d6ea(0x19c)](_0x5eac17['lockKey']);}const _0x3a085b=[];if(_0x3decf['bool'](_0xb2d6ea(0x198))){const _0x7968b4=loadAliasMap(_0x3decf[_0xb2d6ea(0x192)],undefined,resolveApiFilePath(_0x3decf[_0xb2d6ea(0x192)],_0x3decf[_0xb2d6ea(0x191)])),_0x3edf17=new Map(_0x7968b4[_0xb2d6ea(0x19a)](_0x1575cf=>[_0x1575cf[_0xb2d6ea(0x1a1)],_0x1575cf['alias']])),[_0x5eeba0,_0x5bb5a0]=await Promise[_0xb2d6ea(0x189)]([listBffScripts(_0x3decf['appCode']),getBffScriptStatistics(_0x3decf[_0xb2d6ea(0x191)])]),_0x160ee0=createHookLocationMap(_0x5bb5a0),_0x361e7e=new Set(_0x495d4b[_0xb2d6ea(0x19a)](_0x1c8f27=>_0x1c8f27[_0xb2d6ea(0x1a7)]));for(const _0x2cb377 of _0x5eeba0){const _0x21b179=resolveRemoteScriptTarget(_0x2d486d,_0x2cb377,_0x160ee0,_0xd417f5[_0xb2d6ea(0x1a0)],_0x3edf17);_0x21b179&&!_0x361e7e['has'](_0x21b179[_0xb2d6ea(0x1a7)])&&_0x3a085b[_0xb2d6ea(0x19c)](_0x21b179[_0xb2d6ea(0x1a7)]);}}const _0x106fa8=_0x7fdf51[_0xb2d6ea(0x193)]===0x0&&_0x8d46a2[_0xb2d6ea(0x193)]===0x0&&_0x3a085b[_0xb2d6ea(0x193)]===0x0;return{'ok':!![],'data':{'added':_0x7fdf51,'modified':_0x8d46a2,'unchanged':_0x474787,'remoteOnly':_0x3a085b},'message':_0x106fa8?'All\x20BFF\x20scripts\x20are\x20in\x20sync.':_0x7fdf51[_0xb2d6ea(0x193)]+_0xb2d6ea(0x18d)+_0x8d46a2[_0xb2d6ea(0x193)]+_0xb2d6ea(0x19f)+_0x474787[_0xb2d6ea(0x193)]+_0xb2d6ea(0x19e)+(_0x3a085b['length']>0x0?',\x20'+_0x3a085b[_0xb2d6ea(0x193)]+'\x20remote-only':'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a34_0x359208=a34_0x57fa;(function(_0x198361,_0x4e12ca){const _0x49d428=a34_0x57fa,_0xefe429=_0x198361();while(!![]){try{const _0x1ba27f=-parseInt(_0x49d428(0xa6))/0x1+-parseInt(_0x49d428(0xa5))/0x2*(-parseInt(_0x49d428(0xcf))/0x3)+-parseInt(_0x49d428(0x9b))/0x4*(parseInt(_0x49d428(0xb8))/0x5)+parseInt(_0x49d428(0x83))/0x6*(-parseInt(_0x49d428(0x97))/0x7)+parseInt(_0x49d428(0xb6))/0x8+parseInt(_0x49d428(0xcb))/0x9*(-parseInt(_0x49d428(0xbc))/0xa)+parseInt(_0x49d428(0xbb))/0xb*(parseInt(_0x49d428(0x8f))/0xc);if(_0x1ba27f===_0x4e12ca)break;else _0xefe429['push'](_0xefe429['shift']());}catch(_0x8546f6){_0xefe429['push'](_0xefe429['shift']());}}}(a34_0x20c1,0x9827d));import a34_0x385e78 from'chalk';import a34_0x599237 from'ora';import a34_0x5d802c 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';function a34_0x57fa(_0x4c464b,_0x276e0f){_0x4c464b=_0x4c464b-0x81;const _0x20c1d8=a34_0x20c1();let _0x57fa4d=_0x20c1d8[_0x4c464b];return _0x57fa4d;}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 _0x91b9a1=a34_0x57fa;return GIT_COMMIT!==_0x91b9a1(0xbe)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x91b9a1(0xac)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x290d7a=a34_0x57fa,_0x46ebca=process[_0x290d7a(0xa1)][_0x290d7a(0x9d)]();if(_0x46ebca['includes'](_0x290d7a(0xd4)))return _0x290d7a(0xd4);return _0x290d7a(0x86);}const updateFlags=[{'name':a34_0x359208(0xa8),'type':'boolean','description':a34_0x359208(0x8a),'default':![]},{'name':a34_0x359208(0xce),'type':'string','description':a34_0x359208(0xa9)},{'name':a34_0x359208(0xbf),'type':a34_0x359208(0xb4),'description':a34_0x359208(0xba),'default':![]},{'name':a34_0x359208(0xb2),'type':a34_0x359208(0xb4),'description':'Refresh\x20official\x20skill\x20package\x20after\x20updating','default':!![],'hidden':!![]}];function a34_0x20c1(){const _0x125b7b=['\x20\x20Run\x20manually:\x20','7XhWRPS','succeed','install','timeout','24oQqiUk','gray','toLowerCase','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','bool','fail','execPath','pipe','string','Already\x20up\x20to\x20date\x20(v','857998awgMLJ','401066AZPhpX','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','beta','Install\x20a\x20specific\x20CLI\x20version','length','Beta\x20version:\x20','slice','map','cwd','filter','Requested\x20version:\x20','/dist-tags','skills','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','boolean','green','8919016XduVwL','Current\x20version:\x20','228775VdLKZx','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','Skip\x20official\x20skill\x20package\x20refresh\x20after\x20updating','22VADmiK','170hiKudC','trim','unknown','no-skills','Version\x20comparison\x20failed','@latest','nonInteractive','entries','str','Checking\x20for\x20updates...','error','latest','https://registry.npmjs.org/-/package/','Update\x20available:\x20','\x20\x20Skipped\x20skill\x20install\x20(RABETBASE_SKIP_NPX_SKILLS=1).','261594TmbYgy','info','inherit','version','3TxiGzH','skipped','...','Updated\x20to\x20v','start','bun','cli','yellow','3867954inwBHx','source','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','npm','Updating\x20via\x20','Update\x20failed','message','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','valid','log','validation','5362380WecfUt','\x20→\x20','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','Skipping\x20official\x20skill\x20package\x20(--no-skills).','warn','write','fromEntries'];a34_0x20c1=function(){return _0x125b7b;};return a34_0x20c1();}function getRequestedVersion(_0x513618){const _0x37326c=a34_0x359208;return _0x513618[_0x37326c(0xc4)](_0x37326c(0xce))[_0x37326c(0xbd)]();}function shouldSkipOfficialSkill(_0x35813e){const _0x1b0435=a34_0x359208;return _0x35813e['bool']('no-skills')||_0x35813e['flag'](_0x1b0435(0xb2))===![];}async function validateUpdateFlags(_0x3bad7c){const _0x46ea2d=a34_0x359208,_0x576867=_0x3bad7c['bool']('beta'),_0x1ce204=getRequestedVersion(_0x3bad7c);if(_0x576867&&_0x1ce204)throw CliErrors['validation'](_0x46ea2d(0x9e),_0x46ea2d(0x91));if(_0x1ce204&&!a34_0x5d802c[_0x46ea2d(0x8c)](_0x1ce204))throw CliErrors[_0x46ea2d(0x8e)]('Invalid\x20version:\x20'+_0x1ce204,'Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.');}async function fetchNpmDistTags(){const _0x3b6ed4=a34_0x359208;try{const _0x1c7d83=await fetch(_0x3b6ed4(0xc8)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x3b6ed4(0xb1),{'signal':AbortSignal[_0x3b6ed4(0x9a)](0x2710)});if(!_0x1c7d83['ok'])return null;const _0x3e2093=await _0x1c7d83['json']();if(!_0x3e2093||typeof _0x3e2093!=='object')return null;return Object[_0x3b6ed4(0x95)](Object[_0x3b6ed4(0xc3)](_0x3e2093)[_0x3b6ed4(0xaf)](([,_0x53a6fb])=>typeof _0x53a6fb===_0x3b6ed4(0xa3)&&_0x53a6fb['trim']()[_0x3b6ed4(0xaa)]>0x0)[_0x3b6ed4(0xad)](([_0x4b172c,_0x13aff5])=>[_0x4b172c,String(_0x13aff5)[_0x3b6ed4(0xbd)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x159a74){const _0x33c3d9=await fetchNpmDistTags();return _0x33c3d9?.[_0x159a74]??null;}async function fetchLatestVersion(){const _0x162927=a34_0x359208,_0x8ec5a9=await fetchNpmDistTagVersion(_0x162927(0xc7));if(_0x8ec5a9)return _0x8ec5a9;const _0x5bf4fe=await getCdnConfig();return _0x5bf4fe?.[_0x162927(0x81)]?.['stableVersion']??null;}async function resolveTargetVersion(_0xfa41af){const _0x1891a1=a34_0x359208,_0x44dcf7=getRequestedVersion(_0xfa41af);if(_0x44dcf7)return{'version':_0x44dcf7,'source':_0x1891a1(0xce)};if(_0xfa41af[_0x1891a1(0x9f)](_0x1891a1(0xa8))){const _0x1cfc80=await fetchNpmDistTagVersion(_0x1891a1(0xa8));if(!_0x1cfc80)return null;return{'version':_0x1cfc80,'source':_0x1891a1(0xa8)};}const _0x151756=await fetchLatestVersion();if(!_0x151756)return null;return{'version':_0x151756,'source':_0x1891a1(0xc7)};}function shouldInstallTarget(_0x37a66e,_0x10a430){const _0x4d35cf=a34_0x359208;if(_0x10a430[_0x4d35cf(0x84)]===_0x4d35cf(0xce)||_0x10a430[_0x4d35cf(0x84)]===_0x4d35cf(0xa8))return!a34_0x5d802c['eq'](_0x37a66e,_0x10a430[_0x4d35cf(0xce)]);return a34_0x5d802c['lt'](_0x37a66e,_0x10a430[_0x4d35cf(0xce)]);}function getInstallPlanLabel(_0x527f23,_0x3c0d75){const _0x2026ef=a34_0x359208;switch(_0x3c0d75[_0x2026ef(0x84)]){case'beta':return _0x2026ef(0xab)+a34_0x385e78['yellow'](_0x527f23)+'\x20→\x20'+a34_0x385e78[_0x2026ef(0xb5)](_0x3c0d75[_0x2026ef(0xce)]);case _0x2026ef(0xce):return _0x2026ef(0xb0)+a34_0x385e78[_0x2026ef(0x82)](_0x527f23)+_0x2026ef(0x90)+a34_0x385e78[_0x2026ef(0xb5)](_0x3c0d75[_0x2026ef(0xce)]);case _0x2026ef(0xc7):default:return _0x2026ef(0xc9)+a34_0x385e78[_0x2026ef(0x82)](_0x527f23)+_0x2026ef(0x90)+a34_0x385e78['green'](_0x3c0d75[_0x2026ef(0xce)]);}}async function installOfficialSkill(_0x4b1132){const _0x595cd0=a34_0x359208;console['log'](a34_0x385e78['gray']('Checking\x20official\x20skill\x20package...'));const _0x3afe4d=runNpxSkillsAddGlobal(process[_0x595cd0(0xae)](),RABETBASE_SKILL_SOURCE,{'stdio':_0x4b1132?_0x595cd0(0xa2):_0x595cd0(0xcd)});if(_0x3afe4d[_0x595cd0(0xd0)]){console[_0x595cd0(0x8d)](a34_0x385e78[_0x595cd0(0x9c)](_0x595cd0(0xca)));return;}if(_0x3afe4d['ok']){console[_0x595cd0(0x8d)](a34_0x385e78['gray']('\x20\x20Official\x20skill\x20package\x20is\x20up\x20to\x20date.'));return;}console[_0x595cd0(0x93)](a34_0x385e78[_0x595cd0(0x82)]('\x20\x20Official\x20skill\x20update\x20failed:\x20'+(_0x3afe4d[_0x595cd0(0xc6)]||_0x595cd0(0xbe)))),console['log'](a34_0x385e78[_0x595cd0(0x9c)](_0x595cd0(0x96)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE));}async function execute(_0x325b57){const _0x3a1767=a34_0x359208;await validateUpdateFlags(_0x325b57);const _0x1a21bb=getCurrentVersion();console[_0x3a1767(0x8d)](_0x3a1767(0xb7)+_0x1a21bb);const _0x1ab86a=a34_0x599237(_0x3a1767(0xc5))[_0x3a1767(0xd3)](),_0x5aa939=await resolveTargetVersion(_0x325b57);if(!_0x5aa939){const _0x4866f5=_0x325b57[_0x3a1767(0x9f)](_0x3a1767(0xa8))?_0x3a1767(0x8b):_0x3a1767(0xb9);return _0x1ab86a[_0x3a1767(0xa0)](_0x4866f5),console[_0x3a1767(0x8d)](a34_0x385e78[_0x3a1767(0x9c)](_0x3a1767(0x85)+NPM_PACKAGE_NAME+_0x3a1767(0xc1))),{'ok':![],'message':_0x4866f5};}const _0x29a825=a34_0x5d802c['valid'](VERSION),_0x395e8b=a34_0x5d802c[_0x3a1767(0x8c)](_0x5aa939[_0x3a1767(0xce)]);if(!_0x29a825||!_0x395e8b)return _0x1ab86a[_0x3a1767(0xa0)](_0x3a1767(0xc0)),{'ok':![],'message':_0x3a1767(0xc0)};if(!shouldInstallTarget(_0x29a825,_0x5aa939)){const _0xe9e417=_0x5aa939[_0x3a1767(0x84)]===_0x3a1767(0xce)?'Already\x20on\x20requested\x20version\x20(v'+_0x5aa939[_0x3a1767(0xce)]+')':_0x3a1767(0xa4)+_0x5aa939[_0x3a1767(0xce)]+')';return _0x1ab86a[_0x3a1767(0x98)](_0xe9e417),shouldSkipOfficialSkill(_0x325b57)?console['log'](a34_0x385e78[_0x3a1767(0x9c)](_0x3a1767(0x92))):await installOfficialSkill(_0x325b57[_0x3a1767(0xc2)]),{'ok':!![]};}_0x1ab86a[_0x3a1767(0xcc)](getInstallPlanLabel(_0x1a21bb,_0x5aa939));const _0x4fd75f=detectPackageManager(),_0x1710ef=_0x4fd75f===_0x3a1767(0x86)?resolveNpmBin(_0x3a1767(0x86)):_0x4fd75f,_0x2968e6=a34_0x599237(_0x3a1767(0x87)+_0x4fd75f+_0x3a1767(0xd1))['start']();try{return await execa(_0x1710ef,[_0x3a1767(0x99),'-g',NPM_PACKAGE_NAME+'@'+_0x5aa939['version']],{'stdio':'pipe'}),_0x2968e6[_0x3a1767(0x98)](_0x3a1767(0xd2)+_0x5aa939[_0x3a1767(0xce)]),console[_0x3a1767(0x8d)](a34_0x385e78[_0x3a1767(0x9c)](_0x3a1767(0xa7))),shouldSkipOfficialSkill(_0x325b57)?console['log'](a34_0x385e78[_0x3a1767(0x9c)](_0x3a1767(0x92))):await installOfficialSkill(_0x325b57[_0x3a1767(0xc2)]),{'ok':!![]};}catch(_0x15d408){return _0x2968e6[_0x3a1767(0xa0)](_0x3a1767(0x88)),console[_0x3a1767(0xc6)](a34_0x385e78['red']('\x20\x20'+_0x15d408['message'])),console[_0x3a1767(0x8d)](a34_0x385e78[_0x3a1767(0x9c)]('\x20\x20Try\x20manually:\x20'+_0x4fd75f+'\x20install\x20-g\x20'+NPM_PACKAGE_NAME+'@'+_0x5aa939[_0x3a1767(0xce)])),{'ok':![],'message':_0x15d408[_0x3a1767(0x89)]};}}export const updateDefinition={'service':'update','command':'run','description':a34_0x359208(0xb3),'risk':a34_0x359208(0x94),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a34_0x55c9ca=a34_0x1d57;(function(_0x128cc3,_0x3c42f9){const _0x399825=a34_0x1d57,_0x2d247f=_0x128cc3();while(!![]){try{const _0x834bd5=-parseInt(_0x399825(0xc1))/0x1+parseInt(_0x399825(0x95))/0x2*(-parseInt(_0x399825(0xd1))/0x3)+-parseInt(_0x399825(0xa5))/0x4+-parseInt(_0x399825(0x8d))/0x5*(parseInt(_0x399825(0x9b))/0x6)+parseInt(_0x399825(0x8f))/0x7*(parseInt(_0x399825(0x88))/0x8)+-parseInt(_0x399825(0xbc))/0x9*(parseInt(_0x399825(0x99))/0xa)+parseInt(_0x399825(0xa1))/0xb*(parseInt(_0x399825(0xa6))/0xc);if(_0x834bd5===_0x3c42f9)break;else _0x2d247f['push'](_0x2d247f['shift']());}catch(_0x225036){_0x2d247f['push'](_0x2d247f['shift']());}}}(a34_0x27a6,0x97cea));import a34_0xbfe9b4 from'chalk';import a34_0x3ea418 from'ora';import a34_0x105833 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';function a34_0x1d57(_0x90176c,_0x28758b){_0x90176c=_0x90176c-0x88;const _0x27a6b1=a34_0x27a6();let _0x1d574d=_0x27a6b1[_0x90176c];return _0x1d574d;}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 _0x37eee9=a34_0x1d57;return GIT_COMMIT!==_0x37eee9(0xd8)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x37eee9(0xae)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x1f6d0e=a34_0x1d57,_0x3137f3=process[_0x1f6d0e(0xa8)][_0x1f6d0e(0xa3)]();if(_0x3137f3[_0x1f6d0e(0xdc)](_0x1f6d0e(0xd4)))return _0x1f6d0e(0xd4);return _0x1f6d0e(0xd0);}const updateFlags=[{'name':'beta','type':a34_0x55c9ca(0xc9),'description':a34_0x55c9ca(0xd7),'default':![]},{'name':a34_0x55c9ca(0xa0),'type':a34_0x55c9ca(0xdd),'description':a34_0x55c9ca(0xd9)},{'name':a34_0x55c9ca(0xcb),'type':'boolean','description':a34_0x55c9ca(0x94),'default':![]},{'name':a34_0x55c9ca(0xac),'type':a34_0x55c9ca(0xc9),'description':'Refresh\x20official\x20skill\x20package\x20after\x20updating','default':!![],'hidden':!![]}];function getRequestedVersion(_0x4db04d){const _0x3e5753=a34_0x55c9ca;return _0x4db04d[_0x3e5753(0xba)](_0x3e5753(0xa0))['trim']();}function shouldSkipOfficialSkill(_0xd9f6ad){const _0x39f2dc=a34_0x55c9ca;return _0xd9f6ad['bool']('no-skills')||_0xd9f6ad[_0x39f2dc(0xc7)]('skills')===![];}async function validateUpdateFlags(_0x3da555){const _0x3eebe5=a34_0x55c9ca,_0x2f311d=_0x3da555[_0x3eebe5(0x9d)](_0x3eebe5(0xc2)),_0x405009=getRequestedVersion(_0x3da555);if(_0x2f311d&&_0x405009)throw CliErrors[_0x3eebe5(0xaf)](_0x3eebe5(0xda),_0x3eebe5(0x9a));if(_0x405009&&!a34_0x105833[_0x3eebe5(0x9c)](_0x405009))throw CliErrors[_0x3eebe5(0xaf)](_0x3eebe5(0xc6)+_0x405009,_0x3eebe5(0x8e));}async function fetchNpmDistTags(){const _0x1bd48c=a34_0x55c9ca;try{const _0x47781d=await fetch(_0x1bd48c(0x92)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x1bd48c(0xb0),{'signal':AbortSignal[_0x1bd48c(0xb8)](0x2710)});if(!_0x47781d['ok'])return null;const _0xd61617=await _0x47781d[_0x1bd48c(0x98)]();if(!_0xd61617||typeof _0xd61617!==_0x1bd48c(0xb2))return null;return Object['fromEntries'](Object['entries'](_0xd61617)[_0x1bd48c(0xdb)](([,_0x1cfabc])=>typeof _0x1cfabc===_0x1bd48c(0xdd)&&_0x1cfabc[_0x1bd48c(0xcd)]()[_0x1bd48c(0x97)]>0x0)['map'](([_0x2a56bf,_0x324334])=>[_0x2a56bf,String(_0x324334)[_0x1bd48c(0xcd)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x5f25f6){const _0x5c9bbb=await fetchNpmDistTags();return _0x5c9bbb?.[_0x5f25f6]??null;}async function fetchLatestVersion(){const _0x1d471c=a34_0x55c9ca,_0x2be30c=await fetchNpmDistTagVersion(_0x1d471c(0xb9));if(_0x2be30c)return _0x2be30c;const _0x456a08=await getCdnConfig();return _0x456a08?.['cli']?.[_0x1d471c(0xbb)]??null;}async function resolveTargetVersion(_0x15a7d2){const _0x1d3056=a34_0x55c9ca,_0x38b639=getRequestedVersion(_0x15a7d2);if(_0x38b639)return{'version':_0x38b639,'source':_0x1d3056(0xa0)};if(_0x15a7d2[_0x1d3056(0x9d)](_0x1d3056(0xc2))){const _0x47221e=await fetchNpmDistTagVersion(_0x1d3056(0xc2));if(!_0x47221e)return null;return{'version':_0x47221e,'source':_0x1d3056(0xc2)};}const _0x1ff9b5=await fetchLatestVersion();if(!_0x1ff9b5)return null;return{'version':_0x1ff9b5,'source':_0x1d3056(0xb9)};}function shouldInstallTarget(_0x5d3f30,_0x58cfd5){const _0x380348=a34_0x55c9ca;if(_0x58cfd5[_0x380348(0x9e)]===_0x380348(0xa0)||_0x58cfd5[_0x380348(0x9e)]===_0x380348(0xc2))return!a34_0x105833['eq'](_0x5d3f30,_0x58cfd5[_0x380348(0xa0)]);return a34_0x105833['lt'](_0x5d3f30,_0x58cfd5[_0x380348(0xa0)]);}function getInstallPlanLabel(_0x41917e,_0x4d2581){const _0x8283bf=a34_0x55c9ca;switch(_0x4d2581[_0x8283bf(0x9e)]){case'beta':return'Beta\x20version:\x20'+a34_0xbfe9b4[_0x8283bf(0xb4)](_0x41917e)+_0x8283bf(0xad)+a34_0xbfe9b4[_0x8283bf(0xb7)](_0x4d2581['version']);case _0x8283bf(0xa0):return _0x8283bf(0xc3)+a34_0xbfe9b4['yellow'](_0x41917e)+_0x8283bf(0xad)+a34_0xbfe9b4[_0x8283bf(0xb7)](_0x4d2581[_0x8283bf(0xa0)]);case'latest':default:return _0x8283bf(0x93)+a34_0xbfe9b4[_0x8283bf(0xb4)](_0x41917e)+_0x8283bf(0xad)+a34_0xbfe9b4[_0x8283bf(0xb7)](_0x4d2581[_0x8283bf(0xa0)]);}}async function installOfficialSkill(_0x54e62d){const _0x2e8afc=a34_0x55c9ca;console['log'](a34_0xbfe9b4['gray'](_0x2e8afc(0xc0)));const _0x53a934=runNpxSkillsAddGlobal(process['cwd'](),RABETBASE_SKILL_SOURCE,{'stdio':_0x54e62d?_0x2e8afc(0xce):_0x2e8afc(0x8a)});if(_0x53a934[_0x2e8afc(0xb5)]){console['log'](a34_0xbfe9b4['gray'](_0x2e8afc(0x91)));return;}if(_0x53a934['ok']){console[_0x2e8afc(0xc4)](a34_0xbfe9b4[_0x2e8afc(0xb3)](_0x2e8afc(0xbd)));return;}console[_0x2e8afc(0x9f)](a34_0xbfe9b4[_0x2e8afc(0xb4)](_0x2e8afc(0xbf)+(_0x53a934[_0x2e8afc(0xc5)]||_0x2e8afc(0xd8)))),console[_0x2e8afc(0xc4)](a34_0xbfe9b4[_0x2e8afc(0xb3)](_0x2e8afc(0x8c)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE));}function a34_0x27a6(){const _0x14b256=['update','skills','\x20→\x20','slice','validation','/dist-tags','install','object','gray','yellow','skipped','red','green','timeout','latest','str','stableVersion','27CUbtRB','\x20\x20Official\x20skill\x20package\x20is\x20up\x20to\x20date.','write','\x20\x20Official\x20skill\x20update\x20failed:\x20','Checking\x20official\x20skill\x20package...','1018859otZwNJ','beta','Requested\x20version:\x20','log','error','Invalid\x20version:\x20','flag','info','boolean','\x20\x20Try\x20manually:\x20','no-skills','succeed','trim','pipe','Updating\x20via\x20','npm','838191fHSqrg','Version\x20comparison\x20failed','start','bun','...','fail','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','unknown','Install\x20a\x20specific\x20CLI\x20version','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','filter','includes','string','run','Skipping\x20official\x20skill\x20package\x20(--no-skills).','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','57112IuPWYT','message','inherit','Current\x20version:\x20','\x20\x20Run\x20manually:\x20','522230XDGGWi','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','679ENgOJX','@latest','\x20\x20Skipped\x20skill\x20install\x20(RABETBASE_SKIP_NPX_SKILLS=1).','https://registry.npmjs.org/-/package/','Update\x20available:\x20','Skip\x20official\x20skill\x20package\x20refresh\x20after\x20updating','4AjFqSh','Updated\x20to\x20v','length','json','1068020vYFVPm','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','30XGOCgg','valid','bool','source','warn','version','1859990ydoPND','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','toLowerCase','nonInteractive','3452408WTkWXW','228DbbRsy','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','execPath','Already\x20on\x20requested\x20version\x20(v','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.'];a34_0x27a6=function(){return _0x14b256;};return a34_0x27a6();}async function execute(_0x13e362){const _0x59034b=a34_0x55c9ca;await validateUpdateFlags(_0x13e362);const _0x1d8619=getCurrentVersion();console[_0x59034b(0xc4)](_0x59034b(0x8b)+_0x1d8619);const _0xb09404=a34_0x3ea418('Checking\x20for\x20updates...')[_0x59034b(0xd3)](),_0x586af7=await resolveTargetVersion(_0x13e362);if(!_0x586af7){const _0x14d6ad=_0x13e362[_0x59034b(0x9d)](_0x59034b(0xc2))?_0x59034b(0xa2):_0x59034b(0xa7);return _0xb09404[_0x59034b(0xd6)](_0x14d6ad),console[_0x59034b(0xc4)](a34_0xbfe9b4[_0x59034b(0xb3)](_0x59034b(0xe0)+NPM_PACKAGE_NAME+_0x59034b(0x90))),{'ok':![],'message':_0x14d6ad};}const _0x32429d=a34_0x105833['valid'](VERSION),_0x93f804=a34_0x105833[_0x59034b(0x9c)](_0x586af7[_0x59034b(0xa0)]);if(!_0x32429d||!_0x93f804)return _0xb09404[_0x59034b(0xd6)](_0x59034b(0xd2)),{'ok':![],'message':_0x59034b(0xd2)};if(!shouldInstallTarget(_0x32429d,_0x586af7)){const _0x404207=_0x586af7[_0x59034b(0x9e)]==='version'?_0x59034b(0xa9)+_0x586af7[_0x59034b(0xa0)]+')':'Already\x20up\x20to\x20date\x20(v'+_0x586af7[_0x59034b(0xa0)]+')';return _0xb09404[_0x59034b(0xcc)](_0x404207),shouldSkipOfficialSkill(_0x13e362)?console[_0x59034b(0xc4)](a34_0xbfe9b4[_0x59034b(0xb3)](_0x59034b(0xdf))):await installOfficialSkill(_0x13e362['nonInteractive']),{'ok':!![]};}_0xb09404[_0x59034b(0xc8)](getInstallPlanLabel(_0x1d8619,_0x586af7));const _0x505e35=detectPackageManager(),_0x5106ec=_0x505e35==='npm'?resolveNpmBin('npm'):_0x505e35,_0x568bba=a34_0x3ea418(_0x59034b(0xcf)+_0x505e35+_0x59034b(0xd5))[_0x59034b(0xd3)]();try{return await execa(_0x5106ec,[_0x59034b(0xb1),'-g',NPM_PACKAGE_NAME+'@'+_0x586af7['version']],{'stdio':_0x59034b(0xce)}),_0x568bba[_0x59034b(0xcc)](_0x59034b(0x96)+_0x586af7[_0x59034b(0xa0)]),console[_0x59034b(0xc4)](a34_0xbfe9b4['gray'](_0x59034b(0xaa))),shouldSkipOfficialSkill(_0x13e362)?console[_0x59034b(0xc4)](a34_0xbfe9b4[_0x59034b(0xb3)](_0x59034b(0xdf))):await installOfficialSkill(_0x13e362[_0x59034b(0xa4)]),{'ok':!![]};}catch(_0xe8c679){return _0x568bba[_0x59034b(0xd6)]('Update\x20failed'),console[_0x59034b(0xc5)](a34_0xbfe9b4[_0x59034b(0xb6)]('\x20\x20'+_0xe8c679['message'])),console['log'](a34_0xbfe9b4['gray'](_0x59034b(0xca)+_0x505e35+'\x20install\x20-g\x20'+NPM_PACKAGE_NAME+'@'+_0x586af7[_0x59034b(0xa0)])),{'ok':![],'message':_0xe8c679[_0x59034b(0x89)]};}}export const updateDefinition={'service':a34_0x55c9ca(0xab),'command':a34_0x55c9ca(0xde),'description':'Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','risk':a34_0x55c9ca(0xbe),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x44af89,_0xbb1ec8){const _0xbd6ac8=a35_0x59d7,_0x59ffa1=_0x44af89();while(!![]){try{const _0x27707f=parseInt(_0xbd6ac8(0x1a5))/0x1+parseInt(_0xbd6ac8(0x1a6))/0x2*(-parseInt(_0xbd6ac8(0x1af))/0x3)+-parseInt(_0xbd6ac8(0x1a9))/0x4*(-parseInt(_0xbd6ac8(0x1ae))/0x5)+parseInt(_0xbd6ac8(0x1aa))/0x6+-parseInt(_0xbd6ac8(0x1ad))/0x7*(-parseInt(_0xbd6ac8(0x1a8))/0x8)+-parseInt(_0xbd6ac8(0x1a7))/0x9*(-parseInt(_0xbd6ac8(0x1ac))/0xa)+-parseInt(_0xbd6ac8(0x1ab))/0xb;if(_0x27707f===_0xbb1ec8)break;else _0x59ffa1['push'](_0x59ffa1['shift']());}catch(_0xaf60f9){_0x59ffa1['push'](_0x59ffa1['shift']());}}}(a35_0x4a59,0x5bda6));import{codegenSdk}from'../../commands/codegen/sdk.js';import{codegenSql}from'../../commands/codegen/sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];function a35_0x59d7(_0xc6212a,_0x4c6877){_0xc6212a=_0xc6212a-0x1a5;const _0x4a5938=a35_0x4a59();let _0x59d7ee=_0x4a5938[_0xc6212a];return _0x59d7ee;}function a35_0x4a59(){const _0x275e14=['2151ieTsSt','128JMknUu','4vjRXYn','1021488aplMdz','6393508OTYdie','17540VZMNwx','292348kANzbx','383305GmIBTB','43446yzwtFv','43097HFsQMp','58pwFXTM'];a35_0x4a59=function(){return _0x275e14;};return a35_0x4a59();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x4a1844=a36_0x5a48;(function(_0xd12966,_0x4fdf3a){const _0x98e12d=a36_0x5a48,_0xeea171=_0xd12966();while(!![]){try{const _0x4fb03c=-parseInt(_0x98e12d(0x16c))/0x1*(-parseInt(_0x98e12d(0x15c))/0x2)+-parseInt(_0x98e12d(0x169))/0x3*(-parseInt(_0x98e12d(0x157))/0x4)+parseInt(_0x98e12d(0x168))/0x5*(parseInt(_0x98e12d(0x166))/0x6)+parseInt(_0x98e12d(0x158))/0x7+-parseInt(_0x98e12d(0x163))/0x8+-parseInt(_0x98e12d(0x16d))/0x9*(parseInt(_0x98e12d(0x15b))/0xa)+-parseInt(_0x98e12d(0x15d))/0xb;if(_0x4fb03c===_0x4fdf3a)break;else _0xeea171['push'](_0xeea171['shift']());}catch(_0x226475){_0xeea171['push'](_0xeea171['shift']());}}}(a36_0x31b3,0x1f471));import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';function a36_0x5a48(_0x1eb8ba,_0x3212a1){_0x1eb8ba=_0x1eb8ba-0x157;const _0x31b382=a36_0x31b3();let _0x5a48b3=_0x31b382[_0x1eb8ba];return _0x5a48b3;}function a36_0x31b3(){const _0x33f7d2=['sdk','name','tableName','9728Vvyqjy','1787618CkLyQI','string','str','317230FUEDbA','357210apMkUa','5083518kBerIx','read','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','appCode','operation','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','527192nSRrwC','alias','bool','516KoXcpU','codegen','7575sdEfGu','309HjhszS','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','Omit\x20import\x20statements\x20from\x20generated\x20code','1KxsuXj','45dNWUEj'];a36_0x31b3=function(){return _0x33f7d2;};return a36_0x31b3();}import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const codegenSdk={'service':a36_0x4a1844(0x167),'command':a36_0x4a1844(0x16e),'description':a36_0x4a1844(0x16a),'risk':a36_0x4a1844(0x15e),'flags':[CODE_FLAG_OPTIONAL,{'name':a36_0x4a1844(0x164),'type':a36_0x4a1844(0x159),'description':a36_0x4a1844(0x15f)},{'name':a36_0x4a1844(0x161),'type':a36_0x4a1844(0x159),'required':!![],'description':a36_0x4a1844(0x162)},{'name':'skip-imports','type':'boolean','description':a36_0x4a1844(0x16b)}],async 'execute'(_0x3b93f0){const _0x1ffa7d=a36_0x4a1844,{dataset:_0x4e8b1c,operation:_0x23d9c9}=await getOperationDetail(_0x3b93f0[_0x1ffa7d(0x160)],_0x3b93f0[_0x1ffa7d(0x15a)]('code'),_0x3b93f0[_0x1ffa7d(0x15a)](_0x1ffa7d(0x161))),_0x18652e=generateSdkCode(_0x4e8b1c,_0x23d9c9,{'includeImports':!_0x3b93f0[_0x1ffa7d(0x165)]('skip-imports')});return{'ok':!![],'data':{'dataset':{'name':_0x4e8b1c[_0x1ffa7d(0x16f)],'code':_0x4e8b1c['code'],'tableName':_0x4e8b1c[_0x1ffa7d(0x170)]},'operation':_0x3b93f0[_0x1ffa7d(0x15a)]('operation'),'code':_0x18652e}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0xf7c8f2=a37_0x15df;(function(_0x275fea,_0x47ec12){const _0x45b46b=a37_0x15df,_0x173aa7=_0x275fea();while(!![]){try{const _0xd5048f=parseInt(_0x45b46b(0x16a))/0x1*(parseInt(_0x45b46b(0x169))/0x2)+-parseInt(_0x45b46b(0x17d))/0x3*(-parseInt(_0x45b46b(0x179))/0x4)+-parseInt(_0x45b46b(0x173))/0x5+parseInt(_0x45b46b(0x16f))/0x6+parseInt(_0x45b46b(0x176))/0x7+parseInt(_0x45b46b(0x17e))/0x8+parseInt(_0x45b46b(0x175))/0x9*(-parseInt(_0x45b46b(0x16c))/0xa);if(_0xd5048f===_0x47ec12)break;else _0x173aa7['push'](_0x173aa7['shift']());}catch(_0x3b87ce){_0x173aa7['push'](_0x173aa7['shift']());}}}(a37_0x1dee,0x46852));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';function a37_0x15df(_0x32eee7,_0xeb8092){_0x32eee7=_0x32eee7-0x166;const _0x1dee64=a37_0x1dee();let _0x15df6e=_0x1dee64[_0x32eee7];return _0x15df6e;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a37_0x1dee(){const _0x37fd58=['Code\x20target:\x20sdk\x20(default)\x20or\x20bff','no-imports','134sNQCZQ','2630sLNRFH','sqlCode','1441420uCgOKC','appCode','codegen','745518KidcPZ','sqlcode','string','bff','524260mUXAJO','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','81rRYNki','3838380bQDfmf','Omit\x20import\x20statements\x20from\x20generated\x20code','sql','2224504LyAuhr','sdk','bool','target','3RyGQhp','2288408sFGxnw','str'];a37_0x1dee=function(){return _0x37fd58;};return a37_0x1dee();}export const codegenSql={'service':a37_0xf7c8f2(0x16e),'command':a37_0xf7c8f2(0x178),'description':a37_0xf7c8f2(0x174),'risk':'read','flags':[SQLCODE_FLAG,{'name':a37_0xf7c8f2(0x17c),'type':a37_0xf7c8f2(0x171),'description':a37_0xf7c8f2(0x167),'default':a37_0xf7c8f2(0x17a),'enum':[a37_0xf7c8f2(0x17a),a37_0xf7c8f2(0x172)]},{'name':a37_0xf7c8f2(0x168),'type':'boolean','description':a37_0xf7c8f2(0x177)}],async 'execute'(_0x2bc15e){const _0x2c0014=a37_0xf7c8f2,_0xc4130a=await getSqlQueryInfo(_0x2bc15e[_0x2c0014(0x16d)],_0x2bc15e[_0x2c0014(0x166)](_0x2c0014(0x170))),_0x2a6a78=_0x2bc15e[_0x2c0014(0x166)](_0x2c0014(0x17c))||'sdk',_0x8cfc9=generateSqlCodeTemplate(_0xc4130a,{'target':_0x2a6a78,'includeImports':!_0x2bc15e[_0x2c0014(0x17b)]('no-imports')});return{'ok':!![],'data':{'sqlCode':_0xc4130a[_0x2c0014(0x16b)],'sqlName':_0xc4130a['sqlName'],'target':_0x2a6a78,'code':_0x8cfc9}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xb62c81,_0x554ebd){const _0x2ebb2a=a38_0x154b,_0x512fbf=_0xb62c81();while(!![]){try{const _0x22b92d=-parseInt(_0x2ebb2a(0xbf))/0x1*(parseInt(_0x2ebb2a(0xac))/0x2)+parseInt(_0x2ebb2a(0xc2))/0x3+-parseInt(_0x2ebb2a(0xc3))/0x4*(parseInt(_0x2ebb2a(0xc0))/0x5)+-parseInt(_0x2ebb2a(0xaa))/0x6*(parseInt(_0x2ebb2a(0xbd))/0x7)+parseInt(_0x2ebb2a(0xa8))/0x8*(-parseInt(_0x2ebb2a(0xb6))/0x9)+parseInt(_0x2ebb2a(0xb5))/0xa*(parseInt(_0x2ebb2a(0xae))/0xb)+parseInt(_0x2ebb2a(0xa6))/0xc*(parseInt(_0x2ebb2a(0xa5))/0xd);if(_0x22b92d===_0x554ebd)break;else _0x512fbf['push'](_0x512fbf['shift']());}catch(_0xb5ff08){_0x512fbf['push'](_0x512fbf['shift']());}}}(a38_0x3677,0xa8247));function a38_0x3677(){const _0x2c6a34=['find','skip','Invalid\x20App\x20Code','93010KFngrQ','7448094VsnNfZ','appCode','\x0a无法获取远程应用列表,请手动输入。','length','includes','(跳过,稍后配置)','未找到可用应用。','913479ZLUvhr','cyan','73QykGUa','5TVHtXs','正在获取可用应用列表...','1526328tieVFr','2944092IHTzTt','请选择要绑定的应用:','\x20个应用,请选择\x20(空格勾选,\x20a=全选,\x20i=反选):','\x20\x20(','✎\x20自定义输入\x20appcode','yellow','manual','gray','message','获取到\x20','1053cvnIKM','257796BTyJqa','(未检测到登录态,请手动输入\x20App\x20Code\x20或直接跳过)','8xEvPKg','trim','6dgovQY','valid','20030bZIgDr','App\x20Code:','1023pkBwuQ','请输入\x20App\x20Code:','map','custom'];a38_0x3677=function(){return _0x2c6a34;};return a38_0x3677();}import{input,checkbox,select}from'@inquirer/prompts';import a38_0x352a2c from'chalk';import{validateAppcode}from'../../commands/common/validate.js';import{listRemoteApps}from'../../core/api-client.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';export async function promptCustomAppcode(){const _0x29f94b=a38_0x154b,_0x43d6de=await input({'message':_0x29f94b(0xaf),'validate':_0x48b1d3=>{const _0x50826a=_0x29f94b,_0x1abb32=validateAppcode(_0x48b1d3[_0x50826a(0xa9)]());return _0x1abb32[_0x50826a(0xab)]||_0x1abb32[_0x50826a(0xa3)]||_0x50826a(0xb4);}});return _0x43d6de[_0x29f94b(0xa9)]();}export async function promptAppSelection(_0x50efb7){const _0x3abab4=a38_0x154b,_0x38aff5=[{'name':a38_0x352a2c[_0x3abab4(0xa0)]('✎\x20自定义输入\x20appcode'),'value':-0x1},..._0x50efb7[_0x3abab4(0xb0)]((_0xea57d1,_0x590b7e)=>({'name':_0xea57d1['appName']+'\x20\x20'+a38_0x352a2c['gray']('('+_0xea57d1[_0x3abab4(0xb7)]+')'),'value':_0x590b7e}))],_0x19a047=await checkbox({'message':_0x3abab4(0xa4)+a38_0x352a2c[_0x3abab4(0xbe)](_0x50efb7[_0x3abab4(0xb9)])+_0x3abab4(0x9d),'choices':_0x38aff5,'loop':![]});if(_0x19a047[_0x3abab4(0xba)](-0x1))return'custom';if(_0x19a047['length']===0x0)return _0x3abab4(0xb1);return _0x19a047[_0x3abab4(0xb0)](_0x222f65=>_0x50efb7[_0x222f65]);}function a38_0x154b(_0x43e3a2,_0xb78bef){_0x43e3a2=_0x43e3a2-0x9d;const _0x36772f=a38_0x3677();let _0x154b55=_0x36772f[_0x43e3a2];return _0x154b55;}export async function promptSingleAppSelection(_0x2dfbdf){const _0x4244eb=a38_0x154b,_0x59558b=[{'name':a38_0x352a2c[_0x4244eb(0xa2)]('(跳过,稍后通过\x20config\x20set\x20appcode\x20配置)'),'value':_0x4244eb(0xb3)},{'name':a38_0x352a2c[_0x4244eb(0xa0)](_0x4244eb(0x9f)),'value':_0x4244eb(0xb1)},..._0x2dfbdf[_0x4244eb(0xb0)](_0x1dc4cb=>({'name':_0x1dc4cb['appName']+'\x20\x20'+a38_0x352a2c[_0x4244eb(0xa2)]('('+_0x1dc4cb['appCode']+')'),'value':_0x1dc4cb[_0x4244eb(0xb7)]}))],_0x38b5c6=await select({'message':_0x4244eb(0xc4),'choices':_0x59558b});if(_0x38b5c6===_0x4244eb(0xb3))return'skip';if(_0x38b5c6===_0x4244eb(0xb1))return _0x4244eb(0xb1);return _0x2dfbdf[_0x4244eb(0xb2)](_0x4ae997=>_0x4ae997['appCode']===_0x38b5c6);}export async function selectSingleAppcode(_0x503d76){const _0x1b7581=a38_0x154b;if(!_0x503d76)return writeCliSideChannelLine(a38_0x352a2c[_0x1b7581(0xa2)](_0x1b7581(0xa7))),_fallbackOrSkip();writeCliSideChannelLine(_0x1b7581(0xc1));let _0x7dadb1;try{_0x7dadb1=await withActiveCookie(_0x503d76,()=>listRemoteApps());}catch(_0x35272a){writeCliSideChannelLine(a38_0x352a2c[_0x1b7581(0xa0)]('无法获取远程应用列表,请手动输入。'));if(_0x35272a instanceof Error)writeCliSideChannelLine(a38_0x352a2c[_0x1b7581(0xa2)](_0x1b7581(0x9e)+_0x35272a[_0x1b7581(0xa3)]+')'));return _fallbackOrSkip();}if(_0x7dadb1['length']===0x0)return writeCliSideChannelLine(a38_0x352a2c[_0x1b7581(0xa0)](_0x1b7581(0xbc))),_fallbackOrSkip();const _0x2847f2=await promptSingleAppSelection(_0x7dadb1);if(_0x2847f2===_0x1b7581(0xb3))return'';if(_0x2847f2===_0x1b7581(0xb1))return promptCustomAppcode();return _0x2847f2['appCode'];}export async function selectMultipleApps(_0x4508b4){const _0x3c1666=a38_0x154b;writeCliSideChannelLine(_0x3c1666(0xc1));let _0x2a414e;try{_0x2a414e=await withActiveCookie(_0x4508b4,()=>listRemoteApps());}catch(_0x3be7f5){writeCliSideChannelLine(_0x3c1666(0xb8));if(_0x3be7f5 instanceof Error)writeCliSideChannelLine(_0x3c1666(0x9e)+_0x3be7f5[_0x3c1666(0xa3)]+')');return _0x3c1666(0xb1);}if(_0x2a414e[_0x3c1666(0xb9)]===0x0)return writeCliSideChannelLine('\x0a未找到可用应用。'),'custom';return promptAppSelection(_0x2a414e);}async function _fallbackOrSkip(){const _0x3d08e9=a38_0x154b,_0x51c66c=await select({'message':_0x3d08e9(0xad),'choices':[{'name':a38_0x352a2c[_0x3d08e9(0xa2)](_0x3d08e9(0xbb)),'value':_0x3d08e9(0xb3)},{'name':a38_0x352a2c[_0x3d08e9(0xa0)]('✎\x20手动输入'),'value':_0x3d08e9(0xa1)}]});if(_0x51c66c==='skip')return'';return promptCustomAppcode();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a39_0x235466=a39_0x3f0c;(function(_0x2ed77,_0x7550ac){const _0x1195c9=a39_0x3f0c,_0x5e601e=_0x2ed77();while(!![]){try{const _0x5beef2=-parseInt(_0x1195c9(0xc5))/0x1*(-parseInt(_0x1195c9(0xcd))/0x2)+parseInt(_0x1195c9(0xc4))/0x3+parseInt(_0x1195c9(0xc0))/0x4*(-parseInt(_0x1195c9(0xd0))/0x5)+-parseInt(_0x1195c9(0xbd))/0x6+parseInt(_0x1195c9(0xc7))/0x7+parseInt(_0x1195c9(0xcf))/0x8+-parseInt(_0x1195c9(0xc6))/0x9*(parseInt(_0x1195c9(0xbf))/0xa);if(_0x5beef2===_0x7550ac)break;else _0x5e601e['push'](_0x5e601e['shift']());}catch(_0x53d641){_0x5e601e['push'](_0x5e601e['shift']());}}}(a39_0xa085,0xf2b71));export const DATASET_CODE_PATTERN={'regex':/^[a-f0-9]{32}$/i,'description':a39_0x235466(0xc1)};export const CODE_FLAG={'name':a39_0x235466(0xca),'type':a39_0x235466(0xce),'required':!![],'description':'Dataset\x20code\x20(32-char\x20hex\x20UUID)','pattern':DATASET_CODE_PATTERN};export const CODE_FLAG_OPTIONAL={...CODE_FLAG,'required':![]};function a39_0x3f0c(_0x2f7d5f,_0x5aff2e){_0x2f7d5f=_0x2f7d5f-0xbd;const _0xa0851a=a39_0xa085();let _0x3f0c73=_0xa0851a[_0x2f7d5f];return _0x3f0c73;}export const DATASETCODE_FLAG_OPTIONAL={...CODE_FLAG_OPTIONAL,'name':a39_0x235466(0xcb),'description':a39_0x235466(0xbe)};export const SQLCODE_FLAG={'name':'sqlcode','type':a39_0x235466(0xce),'required':!![],'description':'SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a39_0x235466(0xc3)}};export const APPCODE_FLAG_OPTIONAL={'name':a39_0x235466(0xc2),'type':'string','required':![],'description':a39_0x235466(0xc8)};export const SQLCODE_FLAG_OPTIONAL={...SQLCODE_FLAG,'required':![]};export const DBLINK_ID_FLAG={'name':'id','type':'number','required':!![],'description':'Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)'};function a39_0xa085(){const _0x3cde31=['10DPykFr','7745826gbUzDx','Dataset\x20code\x20(32-char\x20hex\x20UUID)','4450QNtWoy','125216jsttQQ','a\x2032-character\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588)','appcode','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','5425560sjfcAp','19424lAZwVh','16857UkLjuw','3259746QwOMdu','App\x20code\x20(overrides\x20config\x20file,\x20e.g.\x20app-xxxxx)','MYSQL','code','datasetcode','POSTGRESQL','22HcOuGP','string','5546904iCKWfy'];a39_0xa085=function(){return _0x3cde31;};return a39_0xa085();}export const DB_TYPE_FLAG={'name':'dbtype','type':a39_0x235466(0xce),'required':!![],'description':'Database\x20product\x20type','enum':[a39_0x235466(0xc9),a39_0x235466(0xcc)]};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xa9bfa3,_0x4ab8b0){const _0x5dd8cc=a40_0x32f0,_0x22ff27=_0xa9bfa3();while(!![]){try{const _0x2a5f0d=-parseInt(_0x5dd8cc(0x1e0))/0x1*(parseInt(_0x5dd8cc(0x1d9))/0x2)+-parseInt(_0x5dd8cc(0x1e2))/0x3+-parseInt(_0x5dd8cc(0x1de))/0x4*(parseInt(_0x5dd8cc(0x1da))/0x5)+-parseInt(_0x5dd8cc(0x1db))/0x6*(parseInt(_0x5dd8cc(0x1e5))/0x7)+parseInt(_0x5dd8cc(0x1dd))/0x8+-parseInt(_0x5dd8cc(0x1e1))/0x9+parseInt(_0x5dd8cc(0x1dc))/0xa*(parseInt(_0x5dd8cc(0x1e4))/0xb);if(_0x2a5f0d===_0x4ab8b0)break;else _0x22ff27['push'](_0x22ff27['shift']());}catch(_0x1eb7e9){_0x22ff27['push'](_0x22ff27['shift']());}}}(a40_0x2b35,0x531d0));function a40_0x32f0(_0x936669,_0x179be8){_0x936669=_0x936669-0x1d8;const _0x2b35f0=a40_0x2b35();let _0x32f0aa=_0x2b35f0[_0x936669];return _0x32f0aa;}function a40_0x2b35(){const _0x332d6a=['2510Scrrgd','3935088wHnYOO','68pQXVWA','Only\x20letters,\x20numbers,\x20-\x20and\x20_\x20are\x20allowed','243jTTFoG','5206590eHLCIr','1046241jKzSDK','trim','68519RhJgcS','7fdemVg','length','3658VleYUV','84670tAyRtK','332106XCjvPQ'];a40_0x2b35=function(){return _0x332d6a;};return a40_0x2b35();}export function validateAppcode(_0x1cd144){const _0x42279e=a40_0x32f0,_0xddb04=_0x1cd144[_0x42279e(0x1e3)]();if(!_0xddb04)return{'valid':![],'message':'App\x20Code\x20cannot\x20be\x20empty'};if(_0xddb04[_0x42279e(0x1d8)]>0x64)return{'valid':![],'message':'App\x20Code\x20cannot\x20exceed\x20100\x20characters'};if(!/^[A-Za-z0-9_-]+$/['test'](_0xddb04))return{'valid':![],'message':_0x42279e(0x1df)};return{'valid':!![]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a41_0x3756d9=a41_0x209e;function a41_0x209e(_0x4591d0,_0x3876aa){_0x4591d0=_0x4591d0-0x121;const _0x531776=a41_0x5317();let _0x209eaa=_0x531776[_0x4591d0];return _0x209eaa;}(function(_0x2b4963,_0x52abc2){const _0x2be740=a41_0x209e,_0x52e1d5=_0x2b4963();while(!![]){try{const _0x9a0cf7=parseInt(_0x2be740(0x125))/0x1*(parseInt(_0x2be740(0x137))/0x2)+-parseInt(_0x2be740(0x131))/0x3+parseInt(_0x2be740(0x127))/0x4*(-parseInt(_0x2be740(0x12b))/0x5)+-parseInt(_0x2be740(0x12a))/0x6+-parseInt(_0x2be740(0x126))/0x7*(-parseInt(_0x2be740(0x135))/0x8)+parseInt(_0x2be740(0x128))/0x9*(-parseInt(_0x2be740(0x12c))/0xa)+parseInt(_0x2be740(0x130))/0xb;if(_0x9a0cf7===_0x52abc2)break;else _0x52e1d5['push'](_0x52e1d5['shift']());}catch(_0x57c868){_0x52e1d5['push'](_0x52e1d5['shift']());}}}(a41_0x5317,0x5bd36));import{CliErrors}from'../../errors.js';import{readConfig}from'../../utils/config.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getConfigCommandKeyDescription}from'../../commands/config/shared.js';async function execute(_0x515a0f){const _0x5c2935=a41_0x209e,_0x3f352a=_0x515a0f[_0x5c2935(0x133)](_0x5c2935(0x134));if(!_0x3f352a)throw CliErrors['validation']('Missing\x20key.',_0x5c2935(0x129)+CLI_BIN_NAME+_0x5c2935(0x132));const _0x4a66ca=readConfig(),_0x5374b4=_0x3f352a===_0x5c2935(0x121)?_0x5c2935(0x122):_0x3f352a,_0x41a9f5=_0x4a66ca[_0x5374b4];if(_0x41a9f5===undefined)throw CliErrors['validation']('Key\x20not\x20found:\x20'+_0x3f352a);return{'ok':!![],'data':typeof _0x41a9f5===_0x5c2935(0x12d)?_0x41a9f5:{[_0x5374b4]:_0x41a9f5},'message':typeof _0x41a9f5===_0x5c2935(0x12d)?undefined:String(_0x41a9f5)};}export const configGetDefinition={'service':a41_0x3756d9(0x124),'command':a41_0x3756d9(0x12e),'description':a41_0x3756d9(0x136),'risk':a41_0x3756d9(0x12f),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a41_0x3756d9(0x134),'type':a41_0x3756d9(0x123),'description':getConfigCommandKeyDescription(),'required':!![]}],'execute':execute};function a41_0x5317(){const _0x5473f2=['947792RhTzXG','app','appcode','string','config','1xcRwga','169358jOfiCJ','1604PqfqYx','369aYUxZa','Usage:\x20','3922644csTSDv','1805rmpsSF','21550eHyaHP','object','get','read','11636790TqRVeJ','2040228ZTcVDs','\x20config\x20get\x20--key\x20<key>','str','key','136DBIZWR','Get\x20a\x20config\x20value\x20by\x20key'];a41_0x5317=function(){return _0x5473f2;};return a41_0x5317();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a42_0x1bd9(_0x1be568,_0x26e3a4){_0x1be568=_0x1be568-0x1de;const _0x53e837=a42_0x53e8();let _0x1bd982=_0x53e837[_0x1be568];return _0x1bd982;}function a42_0x53e8(){const _0x29c623=['8089690pQvLTN','3pGMmPe','3423810zDLkOt','9kQmyDr','6006YqnfNP','9831338bQIFQE','997722wyKsRk','782680lguidQ','15JbkcJb','970589KAnVce','2376szwqed'];a42_0x53e8=function(){return _0x29c623;};return a42_0x53e8();}(function(_0xda445,_0x2edc91){const _0x4896d6=a42_0x1bd9,_0x50bd3a=_0xda445();while(!![]){try{const _0x33e10d=parseInt(_0x4896d6(0x1de))/0x1+parseInt(_0x4896d6(0x1e6))/0x2*(-parseInt(_0x4896d6(0x1e1))/0x3)+parseInt(_0x4896d6(0x1e7))/0x4*(parseInt(_0x4896d6(0x1e8))/0x5)+-parseInt(_0x4896d6(0x1e2))/0x6+-parseInt(_0x4896d6(0x1e4))/0x7*(-parseInt(_0x4896d6(0x1df))/0x8)+parseInt(_0x4896d6(0x1e3))/0x9*(-parseInt(_0x4896d6(0x1e0))/0xa)+parseInt(_0x4896d6(0x1e5))/0xb;if(_0x33e10d===_0x2edc91)break;else _0x50bd3a['push'](_0x50bd3a['shift']());}catch(_0x429c45){_0x50bd3a['push'](_0x50bd3a['shift']());}}}(a42_0x53e8,0xca146));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];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x4846a9=a43_0x5182;(function(_0x4b5618,_0x30bc6a){const _0x45f7b9=a43_0x5182,_0xe3a0f7=_0x4b5618();while(!![]){try{const _0x6b6c2d=parseInt(_0x45f7b9(0x8d))/0x1*(parseInt(_0x45f7b9(0x9a))/0x2)+parseInt(_0x45f7b9(0x96))/0x3*(-parseInt(_0x45f7b9(0x8e))/0x4)+parseInt(_0x45f7b9(0x8a))/0x5*(parseInt(_0x45f7b9(0x99))/0x6)+parseInt(_0x45f7b9(0x8c))/0x7*(parseInt(_0x45f7b9(0x8b))/0x8)+-parseInt(_0x45f7b9(0x98))/0x9+-parseInt(_0x45f7b9(0x97))/0xa+-parseInt(_0x45f7b9(0x93))/0xb*(-parseInt(_0x45f7b9(0x92))/0xc);if(_0x6b6c2d===_0x30bc6a)break;else _0xe3a0f7['push'](_0xe3a0f7['shift']());}catch(_0x44facd){_0xe3a0f7['push'](_0xe3a0f7['shift']());}}}(a43_0x4bce,0xd6f09));function a43_0x4bce(){const _0x5179ef=['7780180pMstNf','15409818HyjiCI','294wyHDJZ','2hojtTb','list','read','107575Urtomk','3978296kQFTJu','7HuTwzI','1106465ZJBoPy','40FKfxzW','Show\x20global\x20config\x20only\x20(~/.rabetbase.json)','boolean','global','24IwShny','13338248pqmBqc','config','List\x20all\x20config\x20values','513753ftzEDM'];a43_0x4bce=function(){return _0x5179ef;};return a43_0x4bce();}function a43_0x5182(_0x5c1d9f,_0x172339){_0x5c1d9f=_0x5c1d9f-0x88;const _0x4bce22=a43_0x4bce();let _0x51821f=_0x4bce22[_0x5c1d9f];return _0x51821f;}import{readScopedConfig}from'../../commands/config/shared.js';import{readConfig}from'../../utils/config.js';async function execute(_0x2c631b){const _0x36cc89=a43_0x5182,_0x5d37fb=_0x2c631b['bool'](_0x36cc89(0x91))?readScopedConfig(_0x36cc89(0x91)):readConfig();return{'ok':!![],'data':_0x5d37fb};}export const configListDefinition={'service':a43_0x4846a9(0x94),'command':a43_0x4846a9(0x88),'description':a43_0x4846a9(0x95),'risk':a43_0x4846a9(0x89),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a43_0x4846a9(0x91),'type':a43_0x4846a9(0x90),'description':a43_0x4846a9(0x8f),'default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a44_0x2b431a=a44_0x1936;function a44_0x5f43(){const _0xf25a0a=['14UPiwJn','Cannot\x20set\x20top-level\x20\x22appcode\x22\x20when\x20multi-app\x20config\x20already\x20exists.','global','\x20config\x20set\x20--key\x20<key>\x20--value\x20<value>','locale','Use\x20`','Legacy\x20alias\x20\x22online\x22\x20is\x20accepted\x20and\x20stored\x20as\x20production.','join','\x22\x20is\x20not\x20settable.','\x20(stored\x20as\x20apps\x20+\x20defaultApp)','2601876lQFzeP','set','env','\x20appcode\x20set\x20to:\x20','value','3692688nKcUJz','5JLnxWw','225890wCUSTX','\x22.\x20Allowed:\x20','key','3KRsngl','validation','Config\x20value','Settable\x20top-level\x20keys:\x20','bool','Top-level\x20key\x20\x22','app','Missing\x20value.','522sWVfWj','config','str','\x20app\x20add\x20<name>\x20--appcode\x20','length','Invalid\x20value\x20for\x20env.\x20Allowed:\x20production,\x20daily.','string','2206218UrAwME','3469560KjENal','object','includes','142684lifPfJ','Global','Project','20381427kYGviV','apps','appcode','Invalid\x20locale\x20value.'];a44_0x5f43=function(){return _0xf25a0a;};return a44_0x5f43();}(function(_0x410233,_0x2d93fc){const _0x84f3e7=a44_0x1936,_0x29c5b1=_0x410233();while(!![]){try{const _0x504236=parseInt(_0x84f3e7(0x99))/0x1*(-parseInt(_0x84f3e7(0xac))/0x2)+-parseInt(_0x84f3e7(0x8f))/0x3+-parseInt(_0x84f3e7(0x94))/0x4+parseInt(_0x84f3e7(0x95))/0x5*(parseInt(_0x84f3e7(0xa8))/0x6)+-parseInt(_0x84f3e7(0xb3))/0x7*(parseInt(_0x84f3e7(0xa9))/0x8)+-parseInt(_0x84f3e7(0xa1))/0x9*(-parseInt(_0x84f3e7(0x96))/0xa)+parseInt(_0x84f3e7(0xaf))/0xb;if(_0x504236===_0x2d93fc)break;else _0x29c5b1['push'](_0x29c5b1['shift']());}catch(_0x167dd3){_0x29c5b1['push'](_0x29c5b1['shift']());}}}(a44_0x5f43,0xa0d9a));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(_0x659c2f){const _0x14eb0f=a44_0x1936,_0x5eb078=_0x659c2f[_0x14eb0f(0xa3)](_0x14eb0f(0x98)),_0x1e32c9=_0x659c2f[_0x14eb0f(0xa3)](_0x14eb0f(0x93));if(!_0x5eb078)throw CliErrors['validation']('Missing\x20key.','Usage:\x20'+CLI_BIN_NAME+_0x14eb0f(0xb6));if(_0x1e32c9===undefined||_0x1e32c9==='')throw CliErrors['validation'](_0x14eb0f(0xa0),'Usage:\x20'+CLI_BIN_NAME+_0x14eb0f(0xb6));if(_0x1e32c9[_0x14eb0f(0xa5)]>0x1f4)throw CliErrors[_0x14eb0f(0x9a)]('Config\x20value\x20is\x20invalid\x20or\x20too\x20long.');if(!isTopLevelConfigKey(_0x5eb078))throw CliErrors['validation'](_0x14eb0f(0x9e)+_0x5eb078+_0x14eb0f(0xbb),_0x14eb0f(0x9c)+getTopLevelConfigKeySummary());if(_0x5eb078==='riskLevel')throw CliErrors[_0x14eb0f(0x9a)]('\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.');if(CONFIG_ENUM_VALUES[_0x5eb078]&&!CONFIG_ENUM_VALUES[_0x5eb078][_0x14eb0f(0xab)](_0x1e32c9))throw CliErrors[_0x14eb0f(0x9a)]('Invalid\x20value\x20for\x20\x22'+_0x5eb078+_0x14eb0f(0x97)+CONFIG_ENUM_VALUES[_0x5eb078][_0x14eb0f(0xba)](',\x20'));if(_0x5eb078===_0x14eb0f(0xb7)&&!normalizeLocale(_0x1e32c9))throw CliErrors[_0x14eb0f(0x9a)](_0x14eb0f(0xb2),'Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US');const _0x17501d={'global':_0x659c2f[_0x14eb0f(0x9d)](_0x14eb0f(0xb5))},_0xb28d6c=resolveWriteScope(_0x17501d),_0x1eafd3=readScopedConfig(_0xb28d6c);let _0x1af56d=_0x5eb078,_0x4af114=_0x1e32c9;_0x5eb078===_0x14eb0f(0x9f)&&(_0x1af56d='appcode',delete _0x1eafd3['app']);_0x5eb078==='locale'&&(_0x4af114=normalizeLocale(_0x1e32c9));if(_0x5eb078===_0x14eb0f(0x91)){_0x4af114=normalizeEnv(_0x1e32c9);if(!isProduction(_0x4af114)&&!isDaily(_0x4af114))throw CliErrors[_0x14eb0f(0x9a)](_0x14eb0f(0xa6),_0x14eb0f(0xb9));}if(_0x5eb078===_0x14eb0f(0xb1)){const _0x46c9af=_0x1eafd3[_0x14eb0f(0xb0)]&&typeof _0x1eafd3[_0x14eb0f(0xb0)]===_0x14eb0f(0xaa)?Object['keys'](_0x1eafd3[_0x14eb0f(0xb0)]):[];if(_0x46c9af[_0x14eb0f(0xa5)]>0x0)throw CliErrors[_0x14eb0f(0x9a)](_0x14eb0f(0xb4),_0x14eb0f(0xb8)+CLI_BIN_NAME+_0x14eb0f(0xa4)+_0x4af114+'`,\x20`'+CLI_BIN_NAME+'\x20app\x20use\x20<name>`,\x20or\x20pass\x20`--appcode`\x20on\x20the\x20command.');const _0x3b4a8b=buildCanonicalProjectConfig({..._0x1eafd3},{'appCodes':[_0x4af114],'env':typeof _0x1eafd3[_0x14eb0f(0x91)]===_0x14eb0f(0xa7)?_0x1eafd3[_0x14eb0f(0x91)]:undefined});writeScopedConfig(_0x3b4a8b,_0xb28d6c);const _0x77b6b5=_0xb28d6c===_0x14eb0f(0xb5)?'Global':_0x14eb0f(0xae);return{'ok':!![],'message':'✓\x20'+_0x77b6b5+_0x14eb0f(0x92)+_0x4af114+_0x14eb0f(0xbc)};}_0x1eafd3[_0x1af56d]=_0x4af114,writeScopedConfig(_0x1eafd3,_0xb28d6c);const _0x1f3d2d=_0xb28d6c===_0x14eb0f(0xb5)?_0x14eb0f(0xad):_0x14eb0f(0xae);return{'ok':!![],'message':'✓\x20'+_0x1f3d2d+'\x20'+_0x1af56d+'\x20set\x20to:\x20'+_0x4af114};}function a44_0x1936(_0x22af50,_0x3c4d92){_0x22af50=_0x22af50-0x8f;const _0x5f434c=a44_0x5f43();let _0x193627=_0x5f434c[_0x22af50];return _0x193627;}export const configSetDefinition={'service':a44_0x2b431a(0xa2),'command':a44_0x2b431a(0x90),'description':'Set\x20a\x20config\x20value','risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a44_0x2b431a(0x98),'type':'string','description':getConfigCommandKeyDescription(),'required':!![]},{'name':a44_0x2b431a(0x93),'type':'string','description':a44_0x2b431a(0x9b),'required':!![]},{'name':a44_0x2b431a(0xb5),'type':'boolean','description':'Write\x20to\x20global\x20config\x20(~/.rabetbase.json)','default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x325cd3,_0x2c813d){var _0x44e75b=a45_0x44cb,_0xde39c5=_0x325cd3();while(!![]){try{var _0x24a710=parseInt(_0x44e75b(0x196))/0x1+-parseInt(_0x44e75b(0x197))/0x2+parseInt(_0x44e75b(0x19a))/0x3*(parseInt(_0x44e75b(0x198))/0x4)+-parseInt(_0x44e75b(0x1a0))/0x5+-parseInt(_0x44e75b(0x199))/0x6*(-parseInt(_0x44e75b(0x19e))/0x7)+-parseInt(_0x44e75b(0x19d))/0x8+parseInt(_0x44e75b(0x19c))/0x9;if(_0x24a710===_0x2c813d)break;else _0xde39c5['push'](_0xde39c5['shift']());}catch(_0x5ab96b){_0xde39c5['push'](_0xde39c5['shift']());}}}(a45_0x4929,0xa3451));import{CLI_BIN_NAME}from'../../constant/cli.js';import{isInProject,resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';import{CliErrors}from'../../errors.js';import{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey,normalizeLocale}from'../../config/schema.js';function a45_0x44cb(_0x5c835,_0x1fabbc){_0x5c835=_0x5c835-0x195;var _0x4929d2=a45_0x4929();var _0x44cb27=_0x4929d2[_0x5c835];return _0x44cb27;}export{CLI_BIN_NAME};export{normalizeLocale};export{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey};export function resolveWriteScope(_0x1894d6){var _0x57661e=a45_0x44cb;if(_0x1894d6[_0x57661e(0x195)])return _0x57661e(0x195);if(!isInProject())throw CliErrors[_0x57661e(0x1a1)]('Not\x20inside\x20a\x20project\x20(no\x20.rabetbase.json\x20found).',_0x57661e(0x1a2)+CLI_BIN_NAME+_0x57661e(0x19f));return _0x57661e(0x19b);}function a45_0x4929(){var _0x13c6af=['6181FWtIqp','\x20init`\x20first.','2662745rbBObq','validation','Add\x20--global\x20to\x20write\x20to\x20~/.rabetbase.json,\x20or\x20run\x20`','global','173347CnzXnr','1230948FBbpZN','4jYukKb','4446rkshBJ','1503729xhfBRB','project','10843137HzaWJq','5735280SfMlnT'];a45_0x4929=function(){return _0x13c6af;};return a45_0x4929();}export function readScopedConfig(_0x519b51){return readConfigFile(resolveWriteConfigPath(_0x519b51));}export function writeScopedConfig(_0x4b9e21,_0x277acb){writeConfigFile(resolveWriteConfigPath(_0x277acb),_0x4b9e21);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a46_0x2a46(_0x1397b1,_0x1fdfc0){_0x1397b1=_0x1397b1-0xa5;const _0x377abd=a46_0x377a();let _0x2a4603=_0x377abd[_0x1397b1];return _0x2a4603;}const a46_0x31abcf=a46_0x2a46;function a46_0x377a(){const _0x1b971b=['30wSdyOu','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','1313018VggbRF','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','1028646hZkFjf','10khoKtJ','48747YdDIfd','5043192qkSKDt','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions','3226010Dbzcie','\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\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','1872512pWrEMl','join','18vtXNoc','filter','6919533KflTBp','\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]'];a46_0x377a=function(){return _0x1b971b;};return a46_0x377a();}(function(_0x488bc9,_0x32154b){const _0x5e031d=a46_0x2a46,_0x25275e=_0x488bc9();while(!![]){try{const _0x3b1ff2=parseInt(_0x5e031d(0xa5))/0x1*(-parseInt(_0x5e031d(0xb1))/0x2)+parseInt(_0x5e031d(0xb5))/0x3+-parseInt(_0x5e031d(0xab))/0x4+parseInt(_0x5e031d(0xa8))/0x5+parseInt(_0x5e031d(0xad))/0x6*(parseInt(_0x5e031d(0xb3))/0x7)+-parseInt(_0x5e031d(0xa6))/0x8+parseInt(_0x5e031d(0xaf))/0x9*(parseInt(_0x5e031d(0xb6))/0xa);if(_0x3b1ff2===_0x32154b)break;else _0x25275e['push'](_0x25275e['shift']());}catch(_0x5585f6){_0x25275e['push'](_0x25275e['shift']());}}}(a46_0x377a,0x779b7));import{buildDataCommand}from'../../commands/data/shared.js';export const dataFilter=buildDataCommand({'command':a46_0x31abcf(0xae),'operation':a46_0x31abcf(0xae),'description':'Filter\x20dataset\x20records\x20with\x20query\x20conditions','paramsRequired':![],'paramsHint':a46_0x31abcf(0xb2),'helpExtra':[a46_0x31abcf(0xb4),a46_0x31abcf(0xa7),a46_0x31abcf(0xb0),a46_0x31abcf(0xa9),a46_0x31abcf(0xaa),'\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page'][a46_0x31abcf(0xac)]('\x0a')});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a47_0x199adf=a47_0x1e03;(function(_0x24a1cb,_0x11a523){const _0x4082cc=a47_0x1e03,_0x3e511f=_0x24a1cb();while(!![]){try{const _0x18ff59=-parseInt(_0x4082cc(0x152))/0x1+parseInt(_0x4082cc(0x14b))/0x2*(parseInt(_0x4082cc(0x14a))/0x3)+-parseInt(_0x4082cc(0x146))/0x4*(-parseInt(_0x4082cc(0x14f))/0x5)+-parseInt(_0x4082cc(0x14c))/0x6+-parseInt(_0x4082cc(0x154))/0x7*(-parseInt(_0x4082cc(0x14e))/0x8)+-parseInt(_0x4082cc(0x149))/0x9*(parseInt(_0x4082cc(0x151))/0xa)+-parseInt(_0x4082cc(0x153))/0xb*(-parseInt(_0x4082cc(0x148))/0xc);if(_0x18ff59===_0x11a523)break;else _0x3e511f['push'](_0x3e511f['shift']());}catch(_0x3125f8){_0x3e511f['push'](_0x3e511f['shift']());}}}(a47_0x4b1f,0x655da));import{buildDataCommand}from'../../commands/data/shared.js';function a47_0x1e03(_0x1768d5,_0x3e6b5e){_0x1768d5=_0x1768d5-0x146;const _0x4b1f75=a47_0x4b1f();let _0x1e03cd=_0x4b1f75[_0x1768d5];return _0x1e03cd;}export const dataGetOne=buildDataCommand({'command':a47_0x199adf(0x147),'operation':'getOne','description':a47_0x199adf(0x150),'paramsRequired':!![],'paramsHint':a47_0x199adf(0x14d)});function a47_0x4b1f(){const _0x3765d3=['getOne','516AkkFkE','9jniVVK','435939NIxuQa','6mgwUdO','405894iGlLCS','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','966104DSXKqH','85HbuoqE','Get\x20a\x20single\x20record\x20by\x20ID','7028390pOebmJ','259213RbAkLQ','156013agWURM','7sqeZlX','65488fGTPyf'];a47_0x4b1f=function(){return _0x3765d3;};return a47_0x4b1f();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a48_0x20dd(_0x42adbf,_0x1cfba4){_0x42adbf=_0x42adbf-0x98;const _0x13802f=a48_0x1380();let _0x20ddf2=_0x13802f[_0x42adbf];return _0x20ddf2;}(function(_0x40f8e4,_0x47a349){const _0x5946cd=a48_0x20dd,_0x4efaa8=_0x40f8e4();while(!![]){try{const _0x46c25e=parseInt(_0x5946cd(0x99))/0x1*(parseInt(_0x5946cd(0x9a))/0x2)+parseInt(_0x5946cd(0x9d))/0x3*(parseInt(_0x5946cd(0x9f))/0x4)+parseInt(_0x5946cd(0x9e))/0x5*(-parseInt(_0x5946cd(0xa2))/0x6)+parseInt(_0x5946cd(0x9b))/0x7+-parseInt(_0x5946cd(0x9c))/0x8+-parseInt(_0x5946cd(0xa1))/0x9*(parseInt(_0x5946cd(0xa3))/0xa)+-parseInt(_0x5946cd(0xa0))/0xb*(-parseInt(_0x5946cd(0x98))/0xc);if(_0x46c25e===_0x47a349)break;else _0x4efaa8['push'](_0x4efaa8['shift']());}catch(_0x3f14a9){_0x4efaa8['push'](_0x4efaa8['shift']());}}}(a48_0x1380,0x622e8));import{dataFilter}from'../../commands/data/filter.js';import{dataGetOne}from'../../commands/data/getOne.js';export const dataDefinitions=[dataFilter,dataGetOne];function a48_0x1380(){const _0x4be541=['4rUPfGp','118232vyXbXF','4353510oBRMWd','5434880MIpriO','222009kbkwbL','5tmEUov','20VIXGCA','11XEzxZz','45nQBSpS','1511646QjUIGI','1506490YMGOwe','10299468srfnon'];a48_0x1380=function(){return _0x4be541;};return a48_0x1380();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x413d46,_0x51dbf7){const _0x57a0af=a49_0x2d6e,_0x217397=_0x413d46();while(!![]){try{const _0x5c8cfc=parseInt(_0x57a0af(0x1ec))/0x1+parseInt(_0x57a0af(0x1e6))/0x2+-parseInt(_0x57a0af(0x1d4))/0x3+-parseInt(_0x57a0af(0x1e9))/0x4+parseInt(_0x57a0af(0x1d3))/0x5*(parseInt(_0x57a0af(0x1e3))/0x6)+parseInt(_0x57a0af(0x1e4))/0x7*(parseInt(_0x57a0af(0x1d6))/0x8)+-parseInt(_0x57a0af(0x1df))/0x9;if(_0x5c8cfc===_0x51dbf7)break;else _0x217397['push'](_0x217397['shift']());}catch(_0x46daf2){_0x217397['push'](_0x217397['shift']());}}}(a49_0x2aaa,0x5166a));import{executeDatasetDataOperation}from'../../core/api-client.js';import{CODE_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a49_0x2d6e(_0x17866d,_0x207bb3){_0x17866d=_0x17866d-0x1d1;const _0x2aaaee=a49_0x2aaa();let _0x2d6e0a=_0x2aaaee[_0x17866d];return _0x2d6e0a;}import{CliErrors}from'../../errors.js';import{parseJsonParams}from'../../utils/params.js';function assertGetOneId(_0x4af263){const _0x297e6a=a49_0x2d6e;if(!_0x4af263)throw CliErrors[_0x297e6a(0x1d8)](_0x297e6a(0x1d7),'Provide\x20--params\x20\x27{\x22id\x22:123}\x27\x20for\x20data\x20getOne.');const _0x267725=_0x4af263['id'];if(_0x267725===undefined||_0x267725===null||_0x267725==='')throw CliErrors[_0x297e6a(0x1e2)](_0x297e6a(0x1d9),_0x297e6a(0x1da));}function parseCommandParams(_0x22a6ba){return parseJsonParams(_0x22a6ba)??{};}function a49_0x2aaa(){const _0x4743e9=['49746fFTazk','compress','4329544UGdUrD','params','flagMissing','data\x20getOne\x20requires\x20\x22id\x22\x20in\x20--params','Example:\x20--params\x20\x27{\x22id\x22:123}\x27','read','paramsHint','now','data\x20','11815038lGBAlw','command','operation','validation','3168816iGsMSl','7pNowzj','string','1054888rmMOJY','str','paramsRequired','978244sufKRv','alias','code','310570lzvTyw','description','helpExtra','5PvIFWZ'];a49_0x2aaa=function(){return _0x4743e9;};return a49_0x2aaa();}export function buildDataCommand(_0x485c4f){const _0x28cb4f=a49_0x2d6e,_0x5444ee='Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon).\x20Resolves\x20to\x20dataset\x20code\x20automatically';return{'service':'data','command':_0x485c4f[_0x28cb4f(0x1e0)],'description':_0x485c4f[_0x28cb4f(0x1d1)],'risk':_0x28cb4f(0x1db),'defaultOutputFormat':_0x28cb4f(0x1d5),'helpExtra':_0x485c4f[_0x28cb4f(0x1d2)],'flags':[CODE_FLAG,APPCODE_FLAG_OPTIONAL,{'name':_0x28cb4f(0x1ea),'type':_0x28cb4f(0x1e5),'description':_0x5444ee},{'name':_0x28cb4f(0x1d7),'type':_0x28cb4f(0x1e5),'description':_0x485c4f[_0x28cb4f(0x1dc)]}],async 'validate'(_0x527cf7){const _0x5685=_0x28cb4f,_0x5e6a71=_0x527cf7[_0x5685(0x1e7)]('params');if(_0x485c4f[_0x5685(0x1e8)]&&!_0x5e6a71)throw CliErrors['flagMissing'](_0x5685(0x1d7),_0x485c4f[_0x5685(0x1dc)]);const _0x2a6e08=parseJsonParams(_0x5e6a71);_0x485c4f[_0x5685(0x1e1)]==='getOne'&&assertGetOneId(_0x2a6e08);},async 'execute'(_0x3aa379){const _0x2c8f43=_0x28cb4f,_0x1a6ce8=parseCommandParams(_0x3aa379[_0x2c8f43(0x1e7)]('params')),_0x487933=Date['now'](),_0x38c142=await executeDatasetDataOperation(_0x3aa379['appCode'],_0x3aa379[_0x2c8f43(0x1e7)](_0x2c8f43(0x1eb)),_0x485c4f[_0x2c8f43(0x1e1)],_0x1a6ce8),_0x1469c6=Date[_0x2c8f43(0x1dd)]()-_0x487933;return{'ok':!![],'data':{'result':_0x38c142,'elapsed':_0x1469c6},'message':_0x2c8f43(0x1de)+_0x485c4f[_0x2c8f43(0x1e0)]+'\x20completed\x20in\x20'+_0x1469c6+'ms'};}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a50_0x299a5b=a50_0x191d;(function(_0x4dcad3,_0x5e3d97){const _0x31a5b4=a50_0x191d,_0x1ee39b=_0x4dcad3();while(!![]){try{const _0x16b160=parseInt(_0x31a5b4(0xf1))/0x1*(-parseInt(_0x31a5b4(0xf4))/0x2)+-parseInt(_0x31a5b4(0x10b))/0x3*(-parseInt(_0x31a5b4(0x107))/0x4)+-parseInt(_0x31a5b4(0xf2))/0x5*(-parseInt(_0x31a5b4(0x10d))/0x6)+-parseInt(_0x31a5b4(0x10e))/0x7+parseInt(_0x31a5b4(0x102))/0x8*(-parseInt(_0x31a5b4(0x10c))/0x9)+parseInt(_0x31a5b4(0x103))/0xa+parseInt(_0x31a5b4(0x106))/0xb*(parseInt(_0x31a5b4(0x100))/0xc);if(_0x16b160===_0x5e3d97)break;else _0x1ee39b['push'](_0x1ee39b['shift']());}catch(_0x136aff){_0x1ee39b['push'](_0x1ee39b['shift']());}}}(a50_0x2b1d,0xdb6ec));import{CliErrors}from'../../errors.js';export const RUNTIME_DATA_ACCESS_COMMANDS={'cli':a50_0x299a5b(0xfb),'filter':'lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27<json>\x27\x20--format\x20compress','getOne':a50_0x299a5b(0x109)};export const RUNTIME_DATA_ACCESS_SUMMARY='Use\x20lovrabet\x20data\x20filter/getOne\x20for\x20real\x20runtime\x20records.';function valueToString(_0x3a58cb){const _0x2596ca=a50_0x299a5b;return _0x3a58cb==null?'':String(_0x3a58cb)[_0x2596ca(0xf6)]();}function getDatasetCode(_0x4b4722){const _0x216ff3=a50_0x299a5b;return valueToString(_0x4b4722[_0x216ff3(0xfc)]??_0x4b4722[_0x216ff3(0x101)]??_0x4b4722[_0x216ff3(0x10a)]?.[_0x216ff3(0x104)]);}function getDatasetName(_0x5a8fa9){const _0x31de7b=a50_0x299a5b;return valueToString(_0x5a8fa9['name']??_0x5a8fa9[_0x31de7b(0x10a)]?.['datasetName'])||'unknown';}function a50_0x191d(_0x114d73,_0x2e8861){_0x114d73=_0x114d73-0xf1;const _0x2b1d26=a50_0x2b1d();let _0x191dea=_0x2b1d26[_0x114d73];return _0x191dea;}function a50_0x2b1d(){const _0x3c6021=['METADATA','\x20类型,没有可用于\x20','getOne','object','lovrabet','code','dbtable','SQL\x20schema\x20validation','当前数据集\x20\x22','48rJhRfg','modelCode','8EdBxmP','3562890bmROuY','datasetCode','toUpperCase','3899830LiXwSO','4GhORxB','filter','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27\x20--format\x20compress','dataset','4886331EOvseX','5225103qziQwF','10542xXpAUH','4471019RAUUcF','tableName','请先将该数据集升级/迁移为\x20DB_TABLE\x20数据集,再基于新的\x20dataset\x20code\x20继续开发。','原因:schema\x20introspection\x20与\x20custom\x20SQL\x20需要\x20source=DB_TABLE、dbtableConfig.dbId、dbtableConfig.tableName\x20与数据库连接上下文。','join','UNKNOWN','dbId','20891HpMFyS','445yxRvvI','如果只是查看运行态真实行数据,请切换到\x20lovrabet\x20CLI:','138etJuFo','dbtableConfig','trim'];a50_0x2b1d=function(){return _0x3c6021;};return a50_0x2b1d();}function getDatasetSource(_0x3f8527){const _0x19e029=a50_0x299a5b;return valueToString(_0x3f8527['source']??_0x3f8527[_0x19e029(0x10a)]?.['sourceType'])[_0x19e029(0x105)]();}function getDbtableConfig(_0x3c0f4b){const _0x1c6ec2=a50_0x299a5b,_0x5ece18=_0x3c0f4b[_0x1c6ec2(0xf5)]??_0x3c0f4b[_0x1c6ec2(0xfd)];return _0x5ece18&&typeof _0x5ece18===_0x1c6ec2(0xfa)?_0x5ece18:{};}export function isDbTableBackedDataset(_0x3db48b){const _0x6c3dfd=a50_0x299a5b,_0x3e4889=getDatasetSource(_0x3db48b);if(_0x3e4889===_0x6c3dfd(0xf7))return![];const _0x5df9b7=getDbtableConfig(_0x3db48b),_0x2d69da=_0x5df9b7[_0x6c3dfd(0x114)]??_0x5df9b7['id'],_0x78228d=valueToString(_0x5df9b7[_0x6c3dfd(0x10f)]??_0x3db48b[_0x6c3dfd(0x10f)]??_0x3db48b[_0x6c3dfd(0x10a)]?.[_0x6c3dfd(0x10f)]);return _0x2d69da!==undefined&&_0x2d69da!==null&&_0x78228d['length']>0x0;}export function filterDbTableBackedDatasets(_0xf0262f){const _0x4e6e1a=a50_0x299a5b;return _0xf0262f[_0x4e6e1a(0x108)](_0x54c681=>isDbTableBackedDataset(_0x54c681));}export function buildDbTableBackedRequirementMessage(_0x837b47,_0x5db3e4=a50_0x299a5b(0xfe)){const _0x1b715b=a50_0x299a5b,_0x3275bd=getDatasetSource(_0x837b47)||_0x1b715b(0x113),_0x2cabb9=getDatasetName(_0x837b47),_0x5500e5=getDatasetCode(_0x837b47),_0x1c9af7=_0x5500e5?'\x20('+_0x5500e5+')':'';return[_0x1b715b(0xff)+_0x2cabb9+'\x22'+_0x1c9af7+'\x20是\x20'+_0x3275bd+_0x1b715b(0xf8)+_0x5db3e4+'\x20的\x20DB_TABLE\x20数据源上下文。',_0x1b715b(0x111),_0x1b715b(0x110),_0x1b715b(0xf3)+RUNTIME_DATA_ACCESS_COMMANDS[_0x1b715b(0x108)]+';'+RUNTIME_DATA_ACCESS_COMMANDS[_0x1b715b(0xf9)]+'。'][_0x1b715b(0x112)]('\x20');}export function assertDatasetIsDbTableBacked(_0x1ac50d,_0x4b5c6e){if(!isDbTableBackedDataset(_0x1ac50d))throw CliErrors['validation'](buildDbTableBackedRequirementMessage(_0x1ac50d,_0x4b5c6e));}
|