@lovrabet/rabetbase-cli 2.2.2-beta.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/discover.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app/use.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -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_0x246b19=a32_0x2f92;(function(_0x1b6dff,_0x5e7dbe){const _0x54d0a8=a32_0x2f92,_0x2443ab=_0x1b6dff();while(!![]){try{const _0x1f7f17=parseInt(_0x54d0a8(0xf0))/0x1*(-parseInt(_0x54d0a8(0x102))/0x2)+-parseInt(_0x54d0a8(0xec))/0x3*(parseInt(_0x54d0a8(0x10a))/0x4)+parseInt(_0x54d0a8(0x114))/0x5*(-parseInt(_0x54d0a8(0x11a))/0x6)+-parseInt(_0x54d0a8(0x129))/0x7+-parseInt(_0x54d0a8(0xdc))/0x8+-parseInt(_0x54d0a8(0x122))/0x9*(-parseInt(_0x54d0a8(0x104))/0xa)+parseInt(_0x54d0a8(0xe6))/0xb;if(_0x1f7f17===_0x5e7dbe)break;else _0x2443ab['push'](_0x2443ab['shift']());}catch(_0x4dd8bd){_0x2443ab['push'](_0x2443ab['shift']());}}}(a32_0x2d82,0xee5a9));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';function a32_0x2d82(){const _0x3d2735=['\x20skipped,\x20','bool','Incomplete\x20HOOK\x20path:\x20','scriptsRoot','length','datasetCode','lockFilePath','alias','filter','Force\x20push\x20ignoring\x20hash\x20protection','appCode','HOOK','Runtime\x20script\x20cache\x20cleared.','1802366IUHdVJ','push','2410Iqwuwo','operationType','would_push','functions','toISOString','Would\x20inspect\x20','959132YkZhge','\x22.\x20','type','datasetCodeToDataset','lastSync','join','high-risk-write','POST','hash','description','60DPHkIC','string','validation','aliasToDatasetCode','update','remoteId','665094dozODT',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','script','values','boolean','/api/management/library/scripts/save','map','Run\x20`','28269RSVMpO','unchanged','code','filePath','runtime\x20cache\x20cleared','datasetId','Lock\x20scope\x20for\x20app\x20\x22','6617821CttvPh','\x20failed,\x20','COMMON','\x22\x20not\x20found\x20after\x20ensureLockScope.','Local\x20function\x20not\x20found:\x20','some','13700024qOskoi','name','apps','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','\x20uploaded,\x20','version','status','lockKey','str','force','64107362MyHhpG','bff','functionNode','No\x20local\x20BFF\x20functions\x20found.','message','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','9rvtlOS','create','get','has','1ukrahN','cleared','parse','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','set'];a32_0x2d82=function(){return _0x3d2735;};return a32_0x2d82();}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_0x246b19(0xe7),'command':'push','description':'Push\x20local\x20BFF\x20scripts\x20to\x20remote','risk':a32_0x246b19(0x110),'flags':[{'name':a32_0x246b19(0x10c),'type':a32_0x246b19(0x115),'description':'Push\x20only\x20this\x20script\x20type','enum':[a32_0x246b19(0x12b),'ENDPOINT','HOOK']},{'name':a32_0x246b19(0xdd),'type':a32_0x246b19(0x115),'description':a32_0x246b19(0xeb)},{'name':a32_0x246b19(0xe5),'type':a32_0x246b19(0x11e),'description':a32_0x246b19(0xfe)}],async 'dryRun'(_0x12d237){const _0x74599a=a32_0x246b19,_0x160f8d=loadBffProjectConfig(_0x12d237[_0x74599a(0xff)]),_0x25bfbd=await readBffLockFile(_0x160f8d[_0x74599a(0xfb)]),{appLock:_0x467c56}=ensureLockScope(_0x25bfbd??createEmptyBffLock(),_0x12d237[_0x74599a(0xff)],_0x160f8d[_0x74599a(0xf8)],_0x74599a(0x103)),_0x53f419=await getTargetFunctions(_0x160f8d,_0x12d237),_0x249edb=_0x12d237[_0x74599a(0xf6)](_0x74599a(0xe5)),_0x4d34bc=[];for(const _0x246291 of _0x53f419){const _0x4bc337=await computeFileHash(_0x246291[_0x74599a(0x125)]),_0x162f2c=_0x467c56[_0x74599a(0x107)][_0x246291[_0x74599a(0xe3)]],_0x1d8ba0=!!_0x162f2c&&_0x162f2c[_0x74599a(0x112)]===_0x4bc337;_0x4d34bc[_0x74599a(0x103)]({'lockKey':_0x246291['lockKey'],'filePath':_0x246291['filePath'],'remoteId':_0x162f2c?.['remoteId']??null,'mode':_0x162f2c?.[_0x74599a(0x119)]?_0x74599a(0x118):_0x74599a(0xed),'status':!_0x249edb&&_0x1d8ba0?'unchanged':_0x74599a(0x106)});}return{'method':_0x74599a(0x111),'url':_0x74599a(0x11f),'body':{'appCode':_0x12d237[_0x74599a(0xff)],'force':_0x249edb,'files':_0x4d34bc,'cacheClearAtRuntime':_0x4d34bc[_0x74599a(0x12e)](_0xfdba18=>_0xfdba18[_0x74599a(0xe2)]==='would_push'),'cacheClearAtRuntimeTimes':_0x4d34bc[_0x74599a(0x12e)](_0xd19098=>_0xd19098[_0x74599a(0xe2)]==='would_push')?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x74599a(0x109)+_0x4d34bc[_0x74599a(0xf9)]+'\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded'};},async 'execute'(_0x47a5cd){const _0x4ac5d0=a32_0x246b19,_0x2a5233=loadBffProjectConfig(_0x47a5cd[_0x4ac5d0(0xff)]),_0x34cb98=await readBffLockFile(_0x2a5233[_0x4ac5d0(0xfb)]),{lockData:_0x561658,appLock:_0x50e335}=ensureLockScope(_0x34cb98??createEmptyBffLock(),_0x47a5cd[_0x4ac5d0(0xff)],_0x2a5233[_0x4ac5d0(0xf8)],'push'),_0xba348a=await getTargetFunctions(_0x2a5233,_0x47a5cd);if(_0xba348a['length']===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x4ac5d0(0xe9)};const _0x115374=_0x47a5cd[_0x4ac5d0(0xf6)](_0x4ac5d0(0xe5)),_0x7a5155=JSON[_0x4ac5d0(0xf2)](JSON['stringify'](_0x561658)),_0x3fb6f4=_0x7a5155[_0x4ac5d0(0xde)][_0x47a5cd[_0x4ac5d0(0xff)]];if(!_0x3fb6f4)throw new Error(_0x4ac5d0(0x128)+_0x47a5cd['appCode']+_0x4ac5d0(0x12c));const _0x12e22b=await buildHookMaps(_0x47a5cd[_0x4ac5d0(0xff)],_0x47a5cd['apiDir'],_0xba348a,_0x3fb6f4),_0x213313=[],_0x114c79=[],_0x16da27=[];for(const _0x3dc7a6 of _0xba348a){const _0x3588ac=await computeFileHash(_0x3dc7a6['filePath']),_0x34f640=_0x3fb6f4[_0x4ac5d0(0x107)][_0x3dc7a6[_0x4ac5d0(0xe3)]];if(!_0x115374&&_0x34f640&&_0x34f640[_0x4ac5d0(0x112)]===_0x3588ac){_0x114c79[_0x4ac5d0(0x103)]({'lockKey':_0x3dc7a6[_0x4ac5d0(0xe3)],'reason':_0x4ac5d0(0x123)});continue;}try{await uploadSingleFunction(_0x47a5cd[_0x4ac5d0(0xff)],_0x3dc7a6,_0x3fb6f4,_0x12e22b);const _0x4e065d=_0x3fb6f4[_0x4ac5d0(0x107)][_0x3dc7a6[_0x4ac5d0(0xe3)]];_0x213313[_0x4ac5d0(0x103)]({'lockKey':_0x3dc7a6[_0x4ac5d0(0xe3)],'remoteId':_0x4e065d?.[_0x4ac5d0(0x119)]??0x0});}catch(_0x18afb7){_0x16da27[_0x4ac5d0(0x103)]({'lockKey':_0x3dc7a6['lockKey'],'error':_0x18afb7 instanceof Error?_0x18afb7[_0x4ac5d0(0xea)]:String(_0x18afb7)});}}_0x3fb6f4[_0x4ac5d0(0x10e)]=new Date()[_0x4ac5d0(0x108)](),await writeBffLockFile(_0x2a5233['lockFilePath'],_0x7a5155),await waitForUploadedLockEntries(_0x2a5233[_0x4ac5d0(0xfb)],_0x47a5cd[_0x4ac5d0(0xff)],_0x213313[_0x4ac5d0(0x120)](_0x4e2b16=>_0x4e2b16[_0x4ac5d0(0xe3)]));let _0x529c46={'attempted':![],'cleared':![]};if(_0x213313[_0x4ac5d0(0xf9)]>0x0)try{let _0x22826d='';for(let _0x10db62=0x0;_0x10db62<CACHE_CLEAR_ATTEMPTS;_0x10db62+=0x1){_0x22826d=await clearBffScriptCache(),_0x10db62<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x529c46={'attempted':!![],'cleared':!![],'message':_0x22826d||_0x4ac5d0(0x101)};}catch(_0x32dc1f){_0x529c46={'attempted':!![],'cleared':![],'error':_0x32dc1f instanceof Error?_0x32dc1f[_0x4ac5d0(0xea)]:String(_0x32dc1f)};}const _0x15cfd4=_0x16da27['length']===0x0&&(_0x529c46['attempted']?_0x529c46[_0x4ac5d0(0xf1)]:!![]),_0x8322ab=_0x529c46['attempted']?_0x529c46[_0x4ac5d0(0xf1)]?_0x4ac5d0(0x126):'runtime\x20cache\x20clear\x20failed':'runtime\x20cache\x20not\x20needed';return{'ok':_0x15cfd4,'data':{'uploaded':_0x213313,'skipped':_0x114c79,'failed':_0x16da27,'cacheClear':_0x529c46},'message':'Push\x20complete:\x20'+_0x213313['length']+_0x4ac5d0(0xe0)+_0x114c79[_0x4ac5d0(0xf9)]+_0x4ac5d0(0xf5)+_0x16da27[_0x4ac5d0(0xf9)]+_0x4ac5d0(0x12a)+_0x8322ab};}};async function getTargetFunctions(_0x43f91d,_0x45b996){const _0x32625c=a32_0x246b19,_0x1cdbcf=_0x45b996['str'](_0x32625c(0x10c)),_0x59f7d0=_0x45b996[_0x32625c(0xe4)](_0x32625c(0xdd)),_0x535253=normalizeBffType(_0x1cdbcf)??undefined;if(_0x59f7d0&&!_0x535253)throw CliErrors[_0x32625c(0x116)](_0x32625c(0xf3));const _0x1bd5ce=await scanLocalBffFunctions(_0x43f91d,_0x535253);if(_0x59f7d0){const _0xeeacb5=_0x1bd5ce[_0x32625c(0xfd)](_0x44b959=>_0x44b959[_0x32625c(0xdd)]===_0x59f7d0);if(_0xeeacb5[_0x32625c(0xf9)]===0x0)throw CliErrors[_0x32625c(0x116)](_0x32625c(0x12d)+_0x535253+'/'+_0x59f7d0);return _0xeeacb5;}return _0x1bd5ce;}function a32_0x2f92(_0x410725,_0x2ed327){_0x410725=_0x410725-0xdc;const _0x2d82c0=a32_0x2d82();let _0x2f926c=_0x2d82c0[_0x410725];return _0x2f926c;}async function buildHookMaps(_0x4f92f7,_0x5ac357,_0x29906b,_0x8e07df){const _0x41484f=a32_0x246b19,_0x48ac9a=_0x29906b[_0x41484f(0x12e)](_0x39338a=>_0x39338a['type']==='HOOK');if(!_0x48ac9a)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x28c07d=loadAliasMap(_0x5ac357,undefined,resolveApiFilePath(_0x5ac357,_0x4f92f7)),_0x1165c1=new Map(_0x28c07d[_0x41484f(0x120)](_0x2bf0c5=>[_0x2bf0c5[_0x41484f(0xfc)],_0x2bf0c5['datasetCode']]));for(const _0x58c643 of Object[_0x41484f(0x11d)](_0x8e07df[_0x41484f(0x107)])){_0x58c643[_0x41484f(0xfc)]&&_0x58c643[_0x41484f(0xfa)]&&!_0x1165c1[_0x41484f(0xef)](_0x58c643[_0x41484f(0xfc)])&&_0x1165c1[_0x41484f(0xf4)](_0x58c643[_0x41484f(0xfc)],_0x58c643['datasetCode']);}const _0x219664=await listDatasets(_0x4f92f7),_0x3708fd=new Map(_0x219664[_0x41484f(0x120)](_0x57246e=>[_0x57246e[_0x41484f(0x124)],_0x57246e]));return{'aliasToDatasetCode':_0x1165c1,'datasetCodeToDataset':_0x3708fd};}async function uploadSingleFunction(_0x4cf675,_0x259478,_0x5d6108,_0x2bf34a){const _0x4f61ee=a32_0x246b19,_0x599468=await readFile(_0x259478[_0x4f61ee(0x125)],'utf8'),_0x36be80=await computeFileHash(_0x259478['filePath']),_0x865018=_0x5d6108[_0x4f61ee(0x107)][_0x259478[_0x4f61ee(0xe3)]];if(_0x865018?.[_0x4f61ee(0x119)]&&_0x865018[_0x4f61ee(0xe1)]==null)throw CliErrors[_0x4f61ee(0x116)](_0x259478['lockKey']+_0x4f61ee(0x11b));let _0x685779=extractScriptDescription(_0x599468);if(!_0x685779&&_0x865018?.['remoteId']){const _0x3a32fe=await getBffScriptInfo(_0x865018['remoteId']);_0x685779=_0x3a32fe['description']||undefined;}const _0xc84076={'appCode':_0x4cf675,'functionName':_0x259478[_0x4f61ee(0xdd)],'scriptType':_0x259478[_0x4f61ee(0x10c)],'scriptContent':_0x599468};if(_0x865018?.[_0x4f61ee(0x119)])_0xc84076['id']=_0x865018['remoteId'];if(_0x865018?.[_0x4f61ee(0xe1)]!=null)_0xc84076[_0x4f61ee(0xe1)]=_0x865018[_0x4f61ee(0xe1)];if(_0x685779)_0xc84076[_0x4f61ee(0x113)]=_0x685779;if(_0x259478[_0x4f61ee(0x10c)]===_0x4f61ee(0x100)){const _0x1e1bf4=_0x259478[_0x4f61ee(0xfc)];if(!_0x1e1bf4||!_0x259478['operationType']||!_0x259478[_0x4f61ee(0xe8)])throw CliErrors[_0x4f61ee(0x116)](_0x4f61ee(0xf7)+_0x259478[_0x4f61ee(0xe3)]);const _0x38baf4=_0x2bf34a[_0x4f61ee(0x117)][_0x4f61ee(0xee)](_0x1e1bf4)??_0x865018?.[_0x4f61ee(0xfa)]??_0x1e1bf4,_0xb0ea38=_0x2bf34a[_0x4f61ee(0x10d)][_0x4f61ee(0xee)](_0x38baf4);if(!_0xb0ea38)throw CliErrors[_0x4f61ee(0x116)]('Cannot\x20resolve\x20dataset\x20for\x20\x22'+_0x1e1bf4+_0x4f61ee(0x10b)+(_0x4f61ee(0x121)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.'));_0xc84076[_0x4f61ee(0x127)]=_0xb0ea38['id'],_0xc84076[_0x4f61ee(0x105)]=_0x259478[_0x4f61ee(0x105)],_0xc84076[_0x4f61ee(0xe8)]=_0x259478[_0x4f61ee(0xe8)];}const _0x236426=await saveBffScript(_0xc84076),_0x5e88e8=_0x236426['id'],_0x2780cb=_0x236426[_0x4f61ee(0x11c)]??await getBffScriptInfo(_0x5e88e8),_0x4496f1={'hash':_0x36be80,'remoteId':_0x5e88e8,'version':_0x2780cb['version']};if(_0x259478['type']===_0x4f61ee(0x100)){const _0xcdcede=_0x259478[_0x4f61ee(0xfc)],_0x5ae43d=_0x2bf34a['aliasToDatasetCode'][_0x4f61ee(0xee)](_0xcdcede)??_0x865018?.['datasetCode']??_0xcdcede;_0x2bf34a[_0x4f61ee(0x117)][_0x4f61ee(0xef)](_0xcdcede)?_0x4496f1['alias']=_0xcdcede:_0x4496f1['alias']=_0x865018?.[_0x4f61ee(0xfc)],_0x4496f1[_0x4f61ee(0xfa)]=_0x5ae43d,_0x4496f1[_0x4f61ee(0x105)]=_0x259478[_0x4f61ee(0x105)],_0x4496f1[_0x4f61ee(0xe8)]=_0x259478['functionNode'];}_0x5d6108[_0x4f61ee(0x107)][_0x259478['lockKey']]=_0x4496f1;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x575edc,_0x5c3960,_0x429e15){const _0x46332c=a32_0x246b19;if(_0x429e15[_0x46332c(0xf9)]===0x0)return;for(let _0x32c8bf=0x0;_0x32c8bf<LOCK_SETTLE_RETRY_COUNT;_0x32c8bf+=0x1){const _0x2ce0e2=await readBffLockFile(_0x575edc),_0x5ea4e4=_0x2ce0e2?.[_0x46332c(0xde)]?.[_0x5c3960]?.[_0x46332c(0x107)]??{},_0x2d6cba=_0x429e15['every'](_0x518046=>!!_0x5ea4e4[_0x518046]?.['remoteId']);if(_0x2d6cba)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x46332c(0xdf)+_0x429e15[_0x46332c(0x10f)](',\x20')+'.');}
|
|
1
|
+
const a32_0x20d575=a32_0x2777;(function(_0x827cc1,_0x396314){const _0x16dec1=a32_0x2777,_0x11f428=_0x827cc1();while(!![]){try{const _0x3b44a0=parseInt(_0x16dec1(0xbd))/0x1+parseInt(_0x16dec1(0xc2))/0x2+parseInt(_0x16dec1(0xe9))/0x3*(-parseInt(_0x16dec1(0xc4))/0x4)+parseInt(_0x16dec1(0xb8))/0x5+-parseInt(_0x16dec1(0xe1))/0x6*(parseInt(_0x16dec1(0xec))/0x7)+parseInt(_0x16dec1(0xd7))/0x8+-parseInt(_0x16dec1(0xb6))/0x9;if(_0x3b44a0===_0x396314)break;else _0x11f428['push'](_0x11f428['shift']());}catch(_0x2d53e3){_0x11f428['push'](_0x11f428['shift']());}}}(a32_0x2d40,0xde2ae));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_0x2d40(){const _0x348922=['apps','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','map','bff','scriptsRoot','operationType','appCode','boolean','9782576CcUixO','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','hash','would_push',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','high-risk-write','\x22.\x20','code','\x22\x20not\x20found\x20after\x20ensureLockScope.','bool','2083182edNmNN','description','Run\x20`','has','Push\x20only\x20this\x20script\x20type','datasetCodeToDataset','parse','update','1898766gRYHAw','cleared','lockFilePath','21FNcRIa','Cannot\x20resolve\x20dataset\x20for\x20\x22','type','\x20failed,\x20','alias','No\x20local\x20BFF\x20functions\x20found.','script','version','name','lockKey','some','runtime\x20cache\x20cleared','Local\x20function\x20not\x20found:\x20','status','HOOK','Push\x20complete:\x20','Runtime\x20script\x20cache\x20cleared.','get','length','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','stringify','validation','string','POST','\x20uploaded,\x20','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','3747708jKTrkQ','datasetCode','2425840jwSQUU','str','force','functions','unchanged','845866OwxspN','remoteId','set','COMMON','/api/management/library/scripts/save','894134qodIPj','create','4jawdIB','runtime\x20cache\x20not\x20needed','\x20skipped,\x20','filter','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','push','functionNode','attempted','aliasToDatasetCode','filePath','Push\x20local\x20BFF\x20scripts\x20to\x20remote'];a32_0x2d40=function(){return _0x348922;};return a32_0x2d40();}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_0x20d575(0xd2),'command':'push','description':a32_0x20d575(0xce),'risk':a32_0x20d575(0xdc),'flags':[{'name':a32_0x20d575(0xee),'type':a32_0x20d575(0xb2),'description':a32_0x20d575(0xe5),'enum':[a32_0x20d575(0xc0),'ENDPOINT',a32_0x20d575(0xaa)]},{'name':a32_0x20d575(0xf4),'type':a32_0x20d575(0xb2),'description':a32_0x20d575(0xd0)},{'name':a32_0x20d575(0xba),'type':a32_0x20d575(0xd6),'description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'dryRun'(_0x131f3f){const _0x3e064c=a32_0x20d575,_0x3781d6=loadBffProjectConfig(_0x131f3f[_0x3e064c(0xd5)]),_0x11a08a=await readBffLockFile(_0x3781d6[_0x3e064c(0xeb)]),{appLock:_0x1d371d}=ensureLockScope(_0x11a08a??createEmptyBffLock(),_0x131f3f[_0x3e064c(0xd5)],_0x3781d6[_0x3e064c(0xd3)],_0x3e064c(0xc9)),_0x4be56c=await getTargetFunctions(_0x3781d6,_0x131f3f),_0x30f3f7=_0x131f3f[_0x3e064c(0xe0)]('force'),_0x2089d1=[];for(const _0x5697a2 of _0x4be56c){const _0x436c91=await computeFileHash(_0x5697a2[_0x3e064c(0xcd)]),_0x13c5a3=_0x1d371d[_0x3e064c(0xbb)][_0x5697a2[_0x3e064c(0xf5)]],_0x25dcd7=!!_0x13c5a3&&_0x13c5a3[_0x3e064c(0xd9)]===_0x436c91;_0x2089d1['push']({'lockKey':_0x5697a2[_0x3e064c(0xf5)],'filePath':_0x5697a2[_0x3e064c(0xcd)],'remoteId':_0x13c5a3?.[_0x3e064c(0xbe)]??null,'mode':_0x13c5a3?.[_0x3e064c(0xbe)]?_0x3e064c(0xe8):_0x3e064c(0xc3),'status':!_0x30f3f7&&_0x25dcd7?_0x3e064c(0xbc):_0x3e064c(0xda)});}return{'method':_0x3e064c(0xb3),'url':_0x3e064c(0xc1),'body':{'appCode':_0x131f3f[_0x3e064c(0xd5)],'force':_0x30f3f7,'files':_0x2089d1,'cacheClearAtRuntime':_0x2089d1[_0x3e064c(0xa6)](_0x3a4eda=>_0x3a4eda[_0x3e064c(0xa9)]===_0x3e064c(0xda)),'cacheClearAtRuntimeTimes':_0x2089d1[_0x3e064c(0xa6)](_0x52224c=>_0x52224c[_0x3e064c(0xa9)]===_0x3e064c(0xda))?CACHE_CLEAR_ATTEMPTS:0x0},'description':'Would\x20inspect\x20'+_0x2089d1[_0x3e064c(0xae)]+_0x3e064c(0xc8)};},async 'execute'(_0x39837e){const _0x14ab67=a32_0x20d575,_0x248783=loadBffProjectConfig(_0x39837e[_0x14ab67(0xd5)]),_0x4f60ed=await readBffLockFile(_0x248783[_0x14ab67(0xeb)]),{lockData:_0x3329df,appLock:_0x3afd76}=ensureLockScope(_0x4f60ed??createEmptyBffLock(),_0x39837e['appCode'],_0x248783[_0x14ab67(0xd3)],_0x14ab67(0xc9)),_0x1d23f3=await getTargetFunctions(_0x248783,_0x39837e);if(_0x1d23f3['length']===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x14ab67(0xf1)};const _0x35a5df=_0x39837e[_0x14ab67(0xe0)](_0x14ab67(0xba)),_0x35028b=JSON[_0x14ab67(0xe7)](JSON[_0x14ab67(0xb0)](_0x3329df)),_0x4b6529=_0x35028b[_0x14ab67(0xcf)][_0x39837e['appCode']];if(!_0x4b6529)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x39837e[_0x14ab67(0xd5)]+_0x14ab67(0xdf));const _0x1fd313=await buildHookMaps(_0x39837e[_0x14ab67(0xd5)],_0x39837e['apiDir'],_0x1d23f3,_0x4b6529),_0x7c341b=[],_0x5ebbe7=[],_0x4de336=[];for(const _0x472271 of _0x1d23f3){const _0x1155a6=await computeFileHash(_0x472271['filePath']),_0x35fb52=_0x4b6529[_0x14ab67(0xbb)][_0x472271[_0x14ab67(0xf5)]];if(!_0x35a5df&&_0x35fb52&&_0x35fb52['hash']===_0x1155a6){_0x5ebbe7[_0x14ab67(0xc9)]({'lockKey':_0x472271[_0x14ab67(0xf5)],'reason':_0x14ab67(0xbc)});continue;}try{await uploadSingleFunction(_0x39837e[_0x14ab67(0xd5)],_0x472271,_0x4b6529,_0x1fd313);const _0x5cd5e8=_0x4b6529[_0x14ab67(0xbb)][_0x472271[_0x14ab67(0xf5)]];_0x7c341b[_0x14ab67(0xc9)]({'lockKey':_0x472271[_0x14ab67(0xf5)],'remoteId':_0x5cd5e8?.[_0x14ab67(0xbe)]??0x0});}catch(_0x58e8c6){_0x4de336[_0x14ab67(0xc9)]({'lockKey':_0x472271['lockKey'],'error':_0x58e8c6 instanceof Error?_0x58e8c6['message']:String(_0x58e8c6)});}}_0x4b6529['lastSync']=new Date()['toISOString'](),await writeBffLockFile(_0x248783[_0x14ab67(0xeb)],_0x35028b),await waitForUploadedLockEntries(_0x248783[_0x14ab67(0xeb)],_0x39837e['appCode'],_0x7c341b[_0x14ab67(0xd1)](_0x59276e=>_0x59276e['lockKey']));let _0x508d96={'attempted':![],'cleared':![]};if(_0x7c341b[_0x14ab67(0xae)]>0x0)try{let _0x657330='';for(let _0xffc9c4=0x0;_0xffc9c4<CACHE_CLEAR_ATTEMPTS;_0xffc9c4+=0x1){_0x657330=await clearBffScriptCache(),_0xffc9c4<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x508d96={'attempted':!![],'cleared':!![],'message':_0x657330||_0x14ab67(0xac)};}catch(_0x528acc){_0x508d96={'attempted':!![],'cleared':![],'error':_0x528acc instanceof Error?_0x528acc['message']:String(_0x528acc)};}const _0x3ad6e5=_0x4de336['length']===0x0&&(_0x508d96[_0x14ab67(0xcb)]?_0x508d96[_0x14ab67(0xea)]:!![]),_0x4b1a60=_0x508d96[_0x14ab67(0xcb)]?_0x508d96[_0x14ab67(0xea)]?_0x14ab67(0xa7):'runtime\x20cache\x20clear\x20failed':_0x14ab67(0xc5);return{'ok':_0x3ad6e5,'data':{'uploaded':_0x7c341b,'skipped':_0x5ebbe7,'failed':_0x4de336,'cacheClear':_0x508d96},'message':_0x14ab67(0xab)+_0x7c341b[_0x14ab67(0xae)]+_0x14ab67(0xb4)+_0x5ebbe7['length']+_0x14ab67(0xc6)+_0x4de336[_0x14ab67(0xae)]+_0x14ab67(0xef)+_0x4b1a60};}};async function getTargetFunctions(_0x3a8bc5,_0x544c35){const _0x19355d=a32_0x20d575,_0x215842=_0x544c35[_0x19355d(0xb9)](_0x19355d(0xee)),_0xa859bd=_0x544c35['str'](_0x19355d(0xf4)),_0xb4f7d3=normalizeBffType(_0x215842)??undefined;if(_0xa859bd&&!_0xb4f7d3)throw CliErrors[_0x19355d(0xb1)](_0x19355d(0xd8));const _0x57df21=await scanLocalBffFunctions(_0x3a8bc5,_0xb4f7d3);if(_0xa859bd){const _0x1cdda3=_0x57df21[_0x19355d(0xc7)](_0x5d4ccc=>_0x5d4ccc[_0x19355d(0xf4)]===_0xa859bd);if(_0x1cdda3['length']===0x0)throw CliErrors[_0x19355d(0xb1)](_0x19355d(0xa8)+_0xb4f7d3+'/'+_0xa859bd);return _0x1cdda3;}return _0x57df21;}async function buildHookMaps(_0x28bc91,_0x3d60f4,_0x44c9a7,_0x1be5a9){const _0x52d0f8=a32_0x20d575,_0x4d1a1c=_0x44c9a7[_0x52d0f8(0xa6)](_0x827e8b=>_0x827e8b[_0x52d0f8(0xee)]===_0x52d0f8(0xaa));if(!_0x4d1a1c)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x12694b=loadAliasMap(_0x3d60f4,undefined,resolveApiFilePath(_0x3d60f4,_0x28bc91)),_0x5981f3=new Map(_0x12694b[_0x52d0f8(0xd1)](_0xacd65a=>[_0xacd65a['alias'],_0xacd65a[_0x52d0f8(0xb7)]]));for(const _0x1c08fc of Object['values'](_0x1be5a9[_0x52d0f8(0xbb)])){_0x1c08fc[_0x52d0f8(0xf0)]&&_0x1c08fc['datasetCode']&&!_0x5981f3['has'](_0x1c08fc[_0x52d0f8(0xf0)])&&_0x5981f3[_0x52d0f8(0xbf)](_0x1c08fc[_0x52d0f8(0xf0)],_0x1c08fc['datasetCode']);}const _0x21d000=await listDatasets(_0x28bc91),_0xb669b2=new Map(_0x21d000[_0x52d0f8(0xd1)](_0x2de6b8=>[_0x2de6b8[_0x52d0f8(0xde)],_0x2de6b8]));return{'aliasToDatasetCode':_0x5981f3,'datasetCodeToDataset':_0xb669b2};}function a32_0x2777(_0x487f87,_0x512fad){_0x487f87=_0x487f87-0xa6;const _0x2d40a3=a32_0x2d40();let _0x2777b5=_0x2d40a3[_0x487f87];return _0x2777b5;}async function uploadSingleFunction(_0x34db29,_0x3f0fc9,_0x3e3602,_0x10c01c){const _0x17a42d=a32_0x20d575,_0x5e78b4=await readFile(_0x3f0fc9['filePath'],'utf8'),_0x6c5d44=await computeFileHash(_0x3f0fc9['filePath']),_0x3adf03=_0x3e3602[_0x17a42d(0xbb)][_0x3f0fc9[_0x17a42d(0xf5)]];if(_0x3adf03?.[_0x17a42d(0xbe)]&&_0x3adf03[_0x17a42d(0xf3)]==null)throw CliErrors[_0x17a42d(0xb1)](_0x3f0fc9[_0x17a42d(0xf5)]+_0x17a42d(0xdb));let _0x3c2ad2=extractScriptDescription(_0x5e78b4);if(!_0x3c2ad2&&_0x3adf03?.['remoteId']){const _0x496e56=await getBffScriptInfo(_0x3adf03[_0x17a42d(0xbe)]);_0x3c2ad2=_0x496e56['description']||undefined;}const _0x3de87e={'appCode':_0x34db29,'functionName':_0x3f0fc9['name'],'scriptType':_0x3f0fc9[_0x17a42d(0xee)],'scriptContent':_0x5e78b4};if(_0x3adf03?.[_0x17a42d(0xbe)])_0x3de87e['id']=_0x3adf03[_0x17a42d(0xbe)];if(_0x3adf03?.[_0x17a42d(0xf3)]!=null)_0x3de87e[_0x17a42d(0xf3)]=_0x3adf03[_0x17a42d(0xf3)];if(_0x3c2ad2)_0x3de87e[_0x17a42d(0xe2)]=_0x3c2ad2;if(_0x3f0fc9['type']===_0x17a42d(0xaa)){const _0x2c05a9=_0x3f0fc9[_0x17a42d(0xf0)];if(!_0x2c05a9||!_0x3f0fc9[_0x17a42d(0xd4)]||!_0x3f0fc9[_0x17a42d(0xca)])throw CliErrors[_0x17a42d(0xb1)]('Incomplete\x20HOOK\x20path:\x20'+_0x3f0fc9[_0x17a42d(0xf5)]);const _0x5d8a98=_0x10c01c[_0x17a42d(0xcc)]['get'](_0x2c05a9)??_0x3adf03?.[_0x17a42d(0xb7)]??_0x2c05a9,_0xe65752=_0x10c01c[_0x17a42d(0xe6)]['get'](_0x5d8a98);if(!_0xe65752)throw CliErrors[_0x17a42d(0xb1)](_0x17a42d(0xed)+_0x2c05a9+_0x17a42d(0xdd)+(_0x17a42d(0xe3)+CLI_BIN_NAME+_0x17a42d(0xaf)));_0x3de87e['datasetId']=_0xe65752['id'],_0x3de87e[_0x17a42d(0xd4)]=_0x3f0fc9[_0x17a42d(0xd4)],_0x3de87e[_0x17a42d(0xca)]=_0x3f0fc9['functionNode'];}const _0x36d60d=await saveBffScript(_0x3de87e),_0x26b980=_0x36d60d['id'],_0x19867c=_0x36d60d[_0x17a42d(0xf2)]??await getBffScriptInfo(_0x26b980),_0x1fcc0e={'hash':_0x6c5d44,'remoteId':_0x26b980,'version':_0x19867c[_0x17a42d(0xf3)]};if(_0x3f0fc9[_0x17a42d(0xee)]===_0x17a42d(0xaa)){const _0x54c955=_0x3f0fc9[_0x17a42d(0xf0)],_0x508dc8=_0x10c01c[_0x17a42d(0xcc)][_0x17a42d(0xad)](_0x54c955)??_0x3adf03?.[_0x17a42d(0xb7)]??_0x54c955;_0x10c01c['aliasToDatasetCode'][_0x17a42d(0xe4)](_0x54c955)?_0x1fcc0e['alias']=_0x54c955:_0x1fcc0e[_0x17a42d(0xf0)]=_0x3adf03?.['alias'],_0x1fcc0e['datasetCode']=_0x508dc8,_0x1fcc0e[_0x17a42d(0xd4)]=_0x3f0fc9[_0x17a42d(0xd4)],_0x1fcc0e[_0x17a42d(0xca)]=_0x3f0fc9[_0x17a42d(0xca)];}_0x3e3602['functions'][_0x3f0fc9[_0x17a42d(0xf5)]]=_0x1fcc0e;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0xb0d9f,_0x9086ae,_0x4ea158){const _0x176b6c=a32_0x20d575;if(_0x4ea158[_0x176b6c(0xae)]===0x0)return;for(let _0x57b58d=0x0;_0x57b58d<LOCK_SETTLE_RETRY_COUNT;_0x57b58d+=0x1){const _0x49ea2f=await readBffLockFile(_0xb0d9f),_0x5ed6c1=_0x49ea2f?.['apps']?.[_0x9086ae]?.['functions']??{},_0x1dd7c6=_0x4ea158['every'](_0x4b6c8e=>!!_0x5ed6c1[_0x4b6c8e]?.['remoteId']);if(_0x1dd7c6)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x176b6c(0xb5)+_0x4ea158['join'](',\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0x4817e7=a33_0x55d5;(function(_0x1358eb,_0x172def){const _0xee285=a33_0x55d5,_0x5e87ec=_0x1358eb();while(!![]){try{const _0x3edfa4=parseInt(_0xee285(0xf7))/0x1*(-parseInt(_0xee285(0x10a))/0x2)+parseInt(_0xee285(0x111))/0x3+-parseInt(_0xee285(0x10f))/0x4*(-parseInt(_0xee285(0x107))/0x5)+parseInt(_0xee285(0x106))/0x6+parseInt(_0xee285(0x105))/0x7+parseInt(_0xee285(0xfe))/0x8*(-parseInt(_0xee285(0x112))/0x9)+-parseInt(_0xee285(0xfa))/0xa*(parseInt(_0xee285(0x114))/0xb);if(_0x3edfa4===_0x172def)break;else _0x5e87ec['push'](_0x5e87ec['shift']());}catch(_0x225569){_0x5e87ec['push'](_0x5e87ec['shift']());}}}(a33_0x4424,0x2bb3a));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';function a33_0x4424(){const _0x124752=['bff','6850Rfthpm','map','functions','lockKey','8hEfITH','boolean','push','\x20added,\x20','All\x20BFF\x20scripts\x20are\x20in\x20sync.','remote','read','1556604ZFzISo','1597410plPDoc','5boNycr','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','appCode','1108yExmbo','scriptsRoot','lockFilePath','\x20modified,\x20','length','91544VMKbGN','\x20remote-only','56631zYQxVj','361413ZUwgsy','all','4873IHqJdJ','bool','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','apiDir','status','has','alias','14CXeahh','hash'];a33_0x4424=function(){return _0x124752;};return a33_0x4424();}import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';function a33_0x55d5(_0x537054,_0x5bc7fb){_0x537054=_0x537054-0xf3;const _0x4424c3=a33_0x4424();let _0x55d592=_0x4424c3[_0x537054];return _0x55d592;}import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a33_0x4817e7(0xf9),'command':a33_0x4817e7(0xf4),'description':a33_0x4817e7(0x116),'risk':a33_0x4817e7(0x104),'flags':[{'name':a33_0x4817e7(0x103),'type':a33_0x4817e7(0xff),'description':a33_0x4817e7(0x108)}],async 'execute'(_0x53b271){const _0x204b89=a33_0x4817e7,_0x1ea8ca=loadBffProjectConfig(_0x53b271['appCode']),_0x8399b4=await readBffLockFile(_0x1ea8ca[_0x204b89(0x10c)]),{appLock:_0x12f3b1}=ensureLockScope(_0x8399b4??createEmptyBffLock(),_0x53b271[_0x204b89(0x109)],_0x1ea8ca[_0x204b89(0x10b)],_0x204b89(0xf4)),_0x1be8b9=await scanLocalBffFunctions(_0x1ea8ca),_0x5e4902=[],_0x26915e=[],_0x2001ac=[];for(const _0x350f25 of _0x1be8b9){const _0x342f9a=await computeFileHash(_0x350f25['filePath']),_0x4c0013=_0x12f3b1[_0x204b89(0xfc)][_0x350f25[_0x204b89(0xfd)]];if(!_0x4c0013)_0x5e4902[_0x204b89(0x100)](_0x350f25[_0x204b89(0xfd)]);else _0x4c0013[_0x204b89(0xf8)]!==_0x342f9a?_0x26915e[_0x204b89(0x100)](_0x350f25[_0x204b89(0xfd)]):_0x2001ac[_0x204b89(0x100)](_0x350f25[_0x204b89(0xfd)]);}const _0x1ea268=[];if(_0x53b271[_0x204b89(0x115)]('remote')){const _0x450066=loadAliasMap(_0x53b271['apiDir'],undefined,resolveApiFilePath(_0x53b271[_0x204b89(0xf3)],_0x53b271[_0x204b89(0x109)])),_0x5ef0b4=new Map(_0x450066['map'](_0x31fc40=>[_0x31fc40['datasetCode'],_0x31fc40[_0x204b89(0xf6)]])),[_0x1b0749,_0x403164]=await Promise[_0x204b89(0x113)]([listBffScripts(_0x53b271[_0x204b89(0x109)]),getBffScriptStatistics(_0x53b271['appCode'])]),_0x5a5afe=createHookLocationMap(_0x403164),_0x31b308=new Set(_0x1be8b9[_0x204b89(0xfb)](_0x3a41e7=>_0x3a41e7[_0x204b89(0xfd)]));for(const _0xb28150 of _0x1b0749){const _0x562845=resolveRemoteScriptTarget(_0x1ea8ca,_0xb28150,_0x5a5afe,_0x12f3b1[_0x204b89(0xfc)],_0x5ef0b4);_0x562845&&!_0x31b308[_0x204b89(0xf5)](_0x562845[_0x204b89(0xfd)])&&_0x1ea268['push'](_0x562845[_0x204b89(0xfd)]);}}const _0x9a1e3b=_0x5e4902['length']===0x0&&_0x26915e['length']===0x0&&_0x1ea268[_0x204b89(0x10e)]===0x0;return{'ok':!![],'data':{'added':_0x5e4902,'modified':_0x26915e,'unchanged':_0x2001ac,'remoteOnly':_0x1ea268},'message':_0x9a1e3b?_0x204b89(0x102):_0x5e4902[_0x204b89(0x10e)]+_0x204b89(0x101)+_0x26915e['length']+_0x204b89(0x10d)+_0x2001ac[_0x204b89(0x10e)]+'\x20unchanged'+(_0x1ea268[_0x204b89(0x10e)]>0x0?',\x20'+_0x1ea268[_0x204b89(0x10e)]+_0x204b89(0x110):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a34_0x6eb696=a34_0x3ea7;(function(_0x2278c3,_0x56a9b4){const _0x1c6c6f=a34_0x3ea7,_0x413750=_0x2278c3();while(!![]){try{const _0x4cab2f=parseInt(_0x1c6c6f(0x196))/0x1+parseInt(_0x1c6c6f(0x1a6))/0x2+-parseInt(_0x1c6c6f(0x1c0))/0x3*(parseInt(_0x1c6c6f(0x176))/0x4)+parseInt(_0x1c6c6f(0x191))/0x5+-parseInt(_0x1c6c6f(0x17c))/0x6*(-parseInt(_0x1c6c6f(0x178))/0x7)+parseInt(_0x1c6c6f(0x17d))/0x8+-parseInt(_0x1c6c6f(0x182))/0x9;if(_0x4cab2f===_0x56a9b4)break;else _0x413750['push'](_0x413750['shift']());}catch(_0x5462c8){_0x413750['push'](_0x413750['shift']());}}}(a34_0x1f53,0x50344));import a34_0x1da091 from'chalk';import a34_0x482764 from'ora';import a34_0x371b82 from'semver';import{execa}from'execa';import{NPM_PACKAGE_NAME}from'../constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';import{CliErrors}from'../errors.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,RABETBASE_SKILL_SOURCE,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x119623=a34_0x3ea7;return GIT_COMMIT!==_0x119623(0x170)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x119623(0x18d)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x4d9e6b=a34_0x3ea7,_0x3e2b26=process['execPath'][_0x4d9e6b(0x188)]();if(_0x3e2b26['includes'](_0x4d9e6b(0x174)))return _0x4d9e6b(0x174);return'npm';}const updateFlags=[{'name':a34_0x6eb696(0x1b9),'type':'boolean','description':'Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','default':![]},{'name':a34_0x6eb696(0x190),'type':a34_0x6eb696(0x173),'description':a34_0x6eb696(0x1ac)},{'name':a34_0x6eb696(0x19a),'type':a34_0x6eb696(0x1aa),'description':a34_0x6eb696(0x1ab),'default':![]},{'name':a34_0x6eb696(0x1bd),'type':a34_0x6eb696(0x1aa),'description':a34_0x6eb696(0x19b),'default':!![],'hidden':!![]}];function getRequestedVersion(_0x4445e7){const _0x25b231=a34_0x6eb696;return _0x4445e7['str'](_0x25b231(0x190))[_0x25b231(0x1a1)]();}function shouldSkipOfficialSkill(_0xa36a10){const _0x168dde=a34_0x6eb696;return _0xa36a10['bool'](_0x168dde(0x19a))||_0xa36a10[_0x168dde(0x1a2)](_0x168dde(0x1bd))===![];}function a34_0x1f53(){const _0x2231f4=['Updated\x20to\x20v','warn','message','filter','trim','flag','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','Already\x20on\x20requested\x20version\x20(v','timeout','246758KNDQpD','\x20\x20Official\x20skill\x20package\x20is\x20up\x20to\x20date.','green','Invalid\x20version:\x20','boolean','Skip\x20official\x20skill\x20package\x20refresh\x20after\x20updating','Install\x20a\x20specific\x20CLI\x20version','object','start','error','map','entries','...','Updating\x20via\x20','red','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','log','\x20\x20Skipped\x20skill\x20install\x20(RABETBASE_SKIP_NPX_SKILLS=1).','beta','nonInteractive','cwd','pipe','skills','latest','succeed','6159GOZGDE','Version\x20comparison\x20failed','\x20install\x20-g\x20','bool','unknown','\x20\x20Try\x20manually:\x20','json','string','bun','skipped','212CQLGtc','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','964257YiEFkA','run','valid','info','18ieyrrD','3620144fQoeEA','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','\x20→\x20','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','Update\x20failed','10951551NZWMyi','install','update','Update\x20available:\x20','Checking\x20for\x20updates...','\x20\x20Run\x20manually:\x20','toLowerCase','inherit','gray','Checking\x20official\x20skill\x20package...','@latest','slice','npm','fromEntries','version','3004880fhUQyv','Beta\x20version:\x20','yellow','source','/dist-tags','64038iBnZAt','https://registry.npmjs.org/-/package/','Already\x20up\x20to\x20date\x20(v','fail','no-skills','Refresh\x20official\x20skill\x20package\x20after\x20updating','validation'];a34_0x1f53=function(){return _0x2231f4;};return a34_0x1f53();}async function validateUpdateFlags(_0x18e2d7){const _0x33c862=a34_0x6eb696,_0x1f45c5=_0x18e2d7[_0x33c862(0x1c3)](_0x33c862(0x1b9)),_0x234cda=getRequestedVersion(_0x18e2d7);if(_0x1f45c5&&_0x234cda)throw CliErrors[_0x33c862(0x19c)](_0x33c862(0x17e),_0x33c862(0x1b5));if(_0x234cda&&!a34_0x371b82[_0x33c862(0x17a)](_0x234cda))throw CliErrors[_0x33c862(0x19c)](_0x33c862(0x1a9)+_0x234cda,'Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.');}async function fetchNpmDistTags(){const _0x5459ab=a34_0x6eb696;try{const _0x290f5d=await fetch(_0x5459ab(0x197)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x5459ab(0x195),{'signal':AbortSignal[_0x5459ab(0x1a5)](0x2710)});if(!_0x290f5d['ok'])return null;const _0x14064b=await _0x290f5d[_0x5459ab(0x172)]();if(!_0x14064b||typeof _0x14064b!==_0x5459ab(0x1ad))return null;return Object[_0x5459ab(0x18f)](Object[_0x5459ab(0x1b1)](_0x14064b)[_0x5459ab(0x1a0)](([,_0x576970])=>typeof _0x576970===_0x5459ab(0x173)&&_0x576970[_0x5459ab(0x1a1)]()['length']>0x0)[_0x5459ab(0x1b0)](([_0x38e5d2,_0x156936])=>[_0x38e5d2,String(_0x156936)[_0x5459ab(0x1a1)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x117d59){const _0x5227b7=await fetchNpmDistTags();return _0x5227b7?.[_0x117d59]??null;}async function fetchLatestVersion(){const _0x6a666a=a34_0x6eb696;return fetchNpmDistTagVersion(_0x6a666a(0x1be));}async function resolveTargetVersion(_0xdfb37c){const _0xb15570=a34_0x6eb696,_0x18b531=getRequestedVersion(_0xdfb37c);if(_0x18b531)return{'version':_0x18b531,'source':_0xb15570(0x190)};if(_0xdfb37c[_0xb15570(0x1c3)](_0xb15570(0x1b9))){const _0x5d1a6a=await fetchNpmDistTagVersion(_0xb15570(0x1b9));if(!_0x5d1a6a)return null;return{'version':_0x5d1a6a,'source':'beta'};}const _0x3ffa59=await fetchLatestVersion();if(!_0x3ffa59)return null;return{'version':_0x3ffa59,'source':'latest'};}function shouldInstallTarget(_0x3620a4,_0x39adcf){const _0x567a9b=a34_0x6eb696;if(_0x39adcf['source']==='version'||_0x39adcf[_0x567a9b(0x194)]===_0x567a9b(0x1b9))return!a34_0x371b82['eq'](_0x3620a4,_0x39adcf['version']);return a34_0x371b82['lt'](_0x3620a4,_0x39adcf[_0x567a9b(0x190)]);}function getInstallPlanLabel(_0x44ae59,_0x312269){const _0x16c0d9=a34_0x6eb696;switch(_0x312269[_0x16c0d9(0x194)]){case'beta':return _0x16c0d9(0x192)+a34_0x1da091['yellow'](_0x44ae59)+_0x16c0d9(0x17f)+a34_0x1da091['green'](_0x312269[_0x16c0d9(0x190)]);case _0x16c0d9(0x190):return'Requested\x20version:\x20'+a34_0x1da091['yellow'](_0x44ae59)+_0x16c0d9(0x17f)+a34_0x1da091[_0x16c0d9(0x1a8)](_0x312269[_0x16c0d9(0x190)]);case _0x16c0d9(0x1be):default:return _0x16c0d9(0x185)+a34_0x1da091[_0x16c0d9(0x193)](_0x44ae59)+_0x16c0d9(0x17f)+a34_0x1da091[_0x16c0d9(0x1a8)](_0x312269[_0x16c0d9(0x190)]);}}async function installOfficialSkill(_0x3e2b71){const _0x12f952=a34_0x6eb696;console['log'](a34_0x1da091[_0x12f952(0x18a)](_0x12f952(0x18b)));const _0x29cf1f=runNpxSkillsAddGlobal(process[_0x12f952(0x1bb)](),RABETBASE_SKILL_SOURCE,{'stdio':_0x3e2b71?_0x12f952(0x1bc):_0x12f952(0x189)});if(_0x29cf1f[_0x12f952(0x175)]){console[_0x12f952(0x1b7)](a34_0x1da091[_0x12f952(0x18a)](_0x12f952(0x1b8)));return;}if(_0x29cf1f['ok']){console[_0x12f952(0x1b7)](a34_0x1da091[_0x12f952(0x18a)](_0x12f952(0x1a7)));return;}console[_0x12f952(0x19e)](a34_0x1da091[_0x12f952(0x193)]('\x20\x20Official\x20skill\x20update\x20failed:\x20'+(_0x29cf1f[_0x12f952(0x1af)]||_0x12f952(0x170)))),console[_0x12f952(0x1b7)](a34_0x1da091[_0x12f952(0x18a)](_0x12f952(0x187)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE));}function a34_0x3ea7(_0x1d1aff,_0x3b77b0){_0x1d1aff=_0x1d1aff-0x170;const _0x1f5380=a34_0x1f53();let _0x3ea706=_0x1f5380[_0x1d1aff];return _0x3ea706;}async function execute(_0x687c50){const _0xadc11c=a34_0x6eb696;await validateUpdateFlags(_0x687c50);const _0xdcbfc2=getCurrentVersion();console[_0xadc11c(0x1b7)]('Current\x20version:\x20'+_0xdcbfc2);const _0x3fe760=a34_0x482764(_0xadc11c(0x186))[_0xadc11c(0x1ae)](),_0x26f102=await resolveTargetVersion(_0x687c50);if(!_0x26f102){const _0x5ac341=_0x687c50['bool'](_0xadc11c(0x1b9))?_0xadc11c(0x180):_0xadc11c(0x1a3);return _0x3fe760[_0xadc11c(0x199)](_0x5ac341),console[_0xadc11c(0x1b7)](a34_0x1da091[_0xadc11c(0x18a)](_0xadc11c(0x1b6)+NPM_PACKAGE_NAME+_0xadc11c(0x18c))),{'ok':![],'message':_0x5ac341};}const _0x3dc5c8=a34_0x371b82[_0xadc11c(0x17a)](VERSION),_0x3e845b=a34_0x371b82['valid'](_0x26f102[_0xadc11c(0x190)]);if(!_0x3dc5c8||!_0x3e845b)return _0x3fe760['fail'](_0xadc11c(0x1c1)),{'ok':![],'message':_0xadc11c(0x1c1)};if(!shouldInstallTarget(_0x3dc5c8,_0x26f102)){const _0x49f1d9=_0x26f102[_0xadc11c(0x194)]===_0xadc11c(0x190)?_0xadc11c(0x1a4)+_0x26f102['version']+')':_0xadc11c(0x198)+_0x26f102['version']+')';return _0x3fe760[_0xadc11c(0x1bf)](_0x49f1d9),shouldSkipOfficialSkill(_0x687c50)?console[_0xadc11c(0x1b7)](a34_0x1da091[_0xadc11c(0x18a)]('Skipping\x20official\x20skill\x20package\x20(--no-skills).')):await installOfficialSkill(_0x687c50[_0xadc11c(0x1ba)]),{'ok':!![]};}_0x3fe760[_0xadc11c(0x17b)](getInstallPlanLabel(_0xdcbfc2,_0x26f102));const _0x4abdbb=detectPackageManager(),_0x53bdc7=_0x4abdbb===_0xadc11c(0x18e)?resolveNpmBin(_0xadc11c(0x18e)):_0x4abdbb,_0x103536=a34_0x482764(_0xadc11c(0x1b3)+_0x4abdbb+_0xadc11c(0x1b2))['start']();try{return await execa(_0x53bdc7,[_0xadc11c(0x183),'-g',NPM_PACKAGE_NAME+'@'+_0x26f102[_0xadc11c(0x190)]],{'stdio':_0xadc11c(0x1bc)}),_0x103536[_0xadc11c(0x1bf)](_0xadc11c(0x19d)+_0x26f102[_0xadc11c(0x190)]),console[_0xadc11c(0x1b7)](a34_0x1da091[_0xadc11c(0x18a)](_0xadc11c(0x177))),shouldSkipOfficialSkill(_0x687c50)?console[_0xadc11c(0x1b7)](a34_0x1da091[_0xadc11c(0x18a)]('Skipping\x20official\x20skill\x20package\x20(--no-skills).')):await installOfficialSkill(_0x687c50[_0xadc11c(0x1ba)]),{'ok':!![]};}catch(_0x17c389){return _0x103536[_0xadc11c(0x199)](_0xadc11c(0x181)),console[_0xadc11c(0x1af)](a34_0x1da091[_0xadc11c(0x1b4)]('\x20\x20'+_0x17c389[_0xadc11c(0x19f)])),console[_0xadc11c(0x1b7)](a34_0x1da091[_0xadc11c(0x18a)](_0xadc11c(0x171)+_0x4abdbb+_0xadc11c(0x1c2)+NPM_PACKAGE_NAME+'@'+_0x26f102[_0xadc11c(0x190)])),{'ok':![],'message':_0x17c389[_0xadc11c(0x19f)]};}}export const updateDefinition={'service':a34_0x6eb696(0x184),'command':a34_0x6eb696(0x179),'description':'Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a34_0x27e0e8=a34_0x17cb;(function(_0x511914,_0x3c937c){const _0x3aba7b=a34_0x17cb,_0x582efc=_0x511914();while(!![]){try{const _0x1f2da5=-parseInt(_0x3aba7b(0x140))/0x1+-parseInt(_0x3aba7b(0x138))/0x2*(-parseInt(_0x3aba7b(0x12a))/0x3)+parseInt(_0x3aba7b(0x149))/0x4*(parseInt(_0x3aba7b(0x124))/0x5)+-parseInt(_0x3aba7b(0x172))/0x6*(-parseInt(_0x3aba7b(0x167))/0x7)+parseInt(_0x3aba7b(0x137))/0x8+-parseInt(_0x3aba7b(0x154))/0x9*(parseInt(_0x3aba7b(0x143))/0xa)+-parseInt(_0x3aba7b(0x141))/0xb;if(_0x1f2da5===_0x3c937c)break;else _0x582efc['push'](_0x582efc['shift']());}catch(_0x5b1ae8){_0x582efc['push'](_0x582efc['shift']());}}}(a34_0x4878,0x2fac2));import a34_0x240d1b from'chalk';import a34_0x1f22c1 from'ora';function a34_0x4878(){const _0x16a5f3=['string','fromEntries','includes','Invalid\x20version:\x20','length','4sSDIwc','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','toLowerCase','red','/dist-tags','\x20→\x20','Install\x20a\x20specific\x20CLI\x20version','info','map','Checking\x20for\x20updates...','error','56808EPgPow','valid','yellow','\x20\x20Try\x20manually:\x20','succeed','validation','Updated\x20to\x20v','version','unknown','green','latest','timeout','https://registry.npmjs.org/-/package/','Updating\x20via\x20','Refresh\x20official\x20skill\x20package\x20after\x20updating','trim','bun','\x20\x20Run\x20manually:\x20','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','937727LsLpXP','pipe','Skip\x20official\x20skill\x20package\x20refresh\x20after\x20updating','\x20install\x20-g\x20','Checking\x20official\x20skill\x20package...','Requested\x20version:\x20','bool','\x20\x20Official\x20skill\x20update\x20failed:\x20','inherit','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','cwd','6EgCzKU','warn','message','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','object','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','@latest','beta','Update\x20failed','skipped','41465VbXUGa','slice','fail','skills','no-skills','Current\x20version:\x20','42pWIPTO','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','run','Update\x20available:\x20','log','start','str','execPath','flag','Version\x20comparison\x20failed','...','npm','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','2834088YnZyKb','36298zeCXrJ','source','Already\x20on\x20requested\x20version\x20(v','Skipping\x20official\x20skill\x20package\x20(--no-skills).','\x20\x20Skipped\x20skill\x20install\x20(RABETBASE_SKIP_NPX_SKILLS=1).','gray','boolean','entries','89353hsTnny','3528866mtnlsz','filter','230SwycpG'];a34_0x4878=function(){return _0x16a5f3;};return a34_0x4878();}import a34_0x40004f from'semver';import{execa}from'execa';import{NPM_PACKAGE_NAME}from'../constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';import{CliErrors}from'../errors.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,RABETBASE_SKILL_SOURCE,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x5933f6=a34_0x17cb;return GIT_COMMIT!=='unknown'?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x5933f6(0x125)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x31a901=a34_0x17cb,_0x2d107f=process[_0x31a901(0x131)][_0x31a901(0x14b)]();if(_0x2d107f[_0x31a901(0x146)](_0x31a901(0x164)))return'bun';return _0x31a901(0x135);}const updateFlags=[{'name':a34_0x27e0e8(0x179),'type':a34_0x27e0e8(0x13e),'description':a34_0x27e0e8(0x170),'default':![]},{'name':a34_0x27e0e8(0x15b),'type':'string','description':a34_0x27e0e8(0x14f)},{'name':'no-skills','type':a34_0x27e0e8(0x13e),'description':a34_0x27e0e8(0x169),'default':![]},{'name':a34_0x27e0e8(0x127),'type':a34_0x27e0e8(0x13e),'description':a34_0x27e0e8(0x162),'default':!![],'hidden':!![]}];function getRequestedVersion(_0x5ecae8){const _0x4f3c6d=a34_0x27e0e8;return _0x5ecae8[_0x4f3c6d(0x130)](_0x4f3c6d(0x15b))['trim']();}function shouldSkipOfficialSkill(_0xf202c9){const _0x50dd7b=a34_0x27e0e8;return _0xf202c9[_0x50dd7b(0x16d)](_0x50dd7b(0x128))||_0xf202c9[_0x50dd7b(0x132)]('skills')===![];}async function validateUpdateFlags(_0x48926d){const _0x42b6bc=a34_0x27e0e8,_0x23defa=_0x48926d[_0x42b6bc(0x16d)](_0x42b6bc(0x179)),_0x412138=getRequestedVersion(_0x48926d);if(_0x23defa&&_0x412138)throw CliErrors[_0x42b6bc(0x159)](_0x42b6bc(0x12b),'Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.');if(_0x412138&&!a34_0x40004f[_0x42b6bc(0x155)](_0x412138))throw CliErrors[_0x42b6bc(0x159)](_0x42b6bc(0x147)+_0x412138,'Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.');}async function fetchNpmDistTags(){const _0xa78754=a34_0x27e0e8;try{const _0x58915c=await fetch(_0xa78754(0x160)+encodeURIComponent(NPM_PACKAGE_NAME)+_0xa78754(0x14d),{'signal':AbortSignal[_0xa78754(0x15f)](0x2710)});if(!_0x58915c['ok'])return null;const _0x35e75d=await _0x58915c['json']();if(!_0x35e75d||typeof _0x35e75d!==_0xa78754(0x176))return null;return Object[_0xa78754(0x145)](Object[_0xa78754(0x13f)](_0x35e75d)[_0xa78754(0x142)](([,_0x359c8a])=>typeof _0x359c8a===_0xa78754(0x144)&&_0x359c8a[_0xa78754(0x163)]()[_0xa78754(0x148)]>0x0)[_0xa78754(0x151)](([_0x373dfd,_0xb6ef75])=>[_0x373dfd,String(_0xb6ef75)[_0xa78754(0x163)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x12b1f7){const _0x312a23=await fetchNpmDistTags();return _0x312a23?.[_0x12b1f7]??null;}async function fetchLatestVersion(){return fetchNpmDistTagVersion('latest');}async function resolveTargetVersion(_0x2e15d0){const _0x57a37e=a34_0x27e0e8,_0x3fafa8=getRequestedVersion(_0x2e15d0);if(_0x3fafa8)return{'version':_0x3fafa8,'source':_0x57a37e(0x15b)};if(_0x2e15d0[_0x57a37e(0x16d)](_0x57a37e(0x179))){const _0x6b53e9=await fetchNpmDistTagVersion(_0x57a37e(0x179));if(!_0x6b53e9)return null;return{'version':_0x6b53e9,'source':'beta'};}const _0x4ced2b=await fetchLatestVersion();if(!_0x4ced2b)return null;return{'version':_0x4ced2b,'source':_0x57a37e(0x15e)};}function shouldInstallTarget(_0x243cef,_0x2ab765){const _0x511b0c=a34_0x27e0e8;if(_0x2ab765[_0x511b0c(0x139)]===_0x511b0c(0x15b)||_0x2ab765[_0x511b0c(0x139)]===_0x511b0c(0x179))return!a34_0x40004f['eq'](_0x243cef,_0x2ab765[_0x511b0c(0x15b)]);return a34_0x40004f['lt'](_0x243cef,_0x2ab765[_0x511b0c(0x15b)]);}function getInstallPlanLabel(_0x2233e8,_0x42daef){const _0x15a0fe=a34_0x27e0e8;switch(_0x42daef[_0x15a0fe(0x139)]){case _0x15a0fe(0x179):return'Beta\x20version:\x20'+a34_0x240d1b['yellow'](_0x2233e8)+_0x15a0fe(0x14e)+a34_0x240d1b[_0x15a0fe(0x15d)](_0x42daef['version']);case _0x15a0fe(0x15b):return _0x15a0fe(0x16c)+a34_0x240d1b['yellow'](_0x2233e8)+_0x15a0fe(0x14e)+a34_0x240d1b[_0x15a0fe(0x15d)](_0x42daef[_0x15a0fe(0x15b)]);case _0x15a0fe(0x15e):default:return _0x15a0fe(0x12d)+a34_0x240d1b[_0x15a0fe(0x156)](_0x2233e8)+_0x15a0fe(0x14e)+a34_0x240d1b[_0x15a0fe(0x15d)](_0x42daef[_0x15a0fe(0x15b)]);}}function a34_0x17cb(_0x268d92,_0x11aefe){_0x268d92=_0x268d92-0x124;const _0x4878f5=a34_0x4878();let _0x17cbd3=_0x4878f5[_0x268d92];return _0x17cbd3;}async function installOfficialSkill(_0x201df0){const _0x36baae=a34_0x27e0e8;console[_0x36baae(0x12e)](a34_0x240d1b[_0x36baae(0x13d)](_0x36baae(0x16b)));const _0x185ea6=runNpxSkillsAddGlobal(process[_0x36baae(0x171)](),RABETBASE_SKILL_SOURCE,{'stdio':_0x201df0?_0x36baae(0x168):_0x36baae(0x16f)});if(_0x185ea6[_0x36baae(0x17b)]){console['log'](a34_0x240d1b[_0x36baae(0x13d)](_0x36baae(0x13c)));return;}if(_0x185ea6['ok']){console['log'](a34_0x240d1b[_0x36baae(0x13d)]('\x20\x20Official\x20skill\x20package\x20is\x20up\x20to\x20date.'));return;}console[_0x36baae(0x173)](a34_0x240d1b[_0x36baae(0x156)](_0x36baae(0x16e)+(_0x185ea6[_0x36baae(0x153)]||_0x36baae(0x15c)))),console[_0x36baae(0x12e)](a34_0x240d1b[_0x36baae(0x13d)](_0x36baae(0x165)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE));}async function execute(_0x581cab){const _0x5ee14c=a34_0x27e0e8;await validateUpdateFlags(_0x581cab);const _0x3c9064=getCurrentVersion();console[_0x5ee14c(0x12e)](_0x5ee14c(0x129)+_0x3c9064);const _0x59aeda=a34_0x1f22c1(_0x5ee14c(0x152))['start'](),_0x2d17d4=await resolveTargetVersion(_0x581cab);if(!_0x2d17d4){const _0x1361e4=_0x581cab[_0x5ee14c(0x16d)](_0x5ee14c(0x179))?_0x5ee14c(0x14a):_0x5ee14c(0x175);return _0x59aeda[_0x5ee14c(0x126)](_0x1361e4),console[_0x5ee14c(0x12e)](a34_0x240d1b[_0x5ee14c(0x13d)](_0x5ee14c(0x136)+NPM_PACKAGE_NAME+_0x5ee14c(0x178))),{'ok':![],'message':_0x1361e4};}const _0xc6bc45=a34_0x40004f[_0x5ee14c(0x155)](VERSION),_0x40fe88=a34_0x40004f[_0x5ee14c(0x155)](_0x2d17d4[_0x5ee14c(0x15b)]);if(!_0xc6bc45||!_0x40fe88)return _0x59aeda[_0x5ee14c(0x126)](_0x5ee14c(0x133)),{'ok':![],'message':_0x5ee14c(0x133)};if(!shouldInstallTarget(_0xc6bc45,_0x2d17d4)){const _0x366ac1=_0x2d17d4[_0x5ee14c(0x139)]===_0x5ee14c(0x15b)?_0x5ee14c(0x13a)+_0x2d17d4[_0x5ee14c(0x15b)]+')':'Already\x20up\x20to\x20date\x20(v'+_0x2d17d4[_0x5ee14c(0x15b)]+')';return _0x59aeda[_0x5ee14c(0x158)](_0x366ac1),shouldSkipOfficialSkill(_0x581cab)?console[_0x5ee14c(0x12e)](a34_0x240d1b[_0x5ee14c(0x13d)](_0x5ee14c(0x13b))):await installOfficialSkill(_0x581cab['nonInteractive']),{'ok':!![]};}_0x59aeda[_0x5ee14c(0x150)](getInstallPlanLabel(_0x3c9064,_0x2d17d4));const _0xa7f45e=detectPackageManager(),_0x5d6d25=_0xa7f45e===_0x5ee14c(0x135)?resolveNpmBin('npm'):_0xa7f45e,_0x13c9fc=a34_0x1f22c1(_0x5ee14c(0x161)+_0xa7f45e+_0x5ee14c(0x134))[_0x5ee14c(0x12f)]();try{return await execa(_0x5d6d25,['install','-g',NPM_PACKAGE_NAME+'@'+_0x2d17d4['version']],{'stdio':'pipe'}),_0x13c9fc['succeed'](_0x5ee14c(0x15a)+_0x2d17d4['version']),console[_0x5ee14c(0x12e)](a34_0x240d1b['gray'](_0x5ee14c(0x177))),shouldSkipOfficialSkill(_0x581cab)?console[_0x5ee14c(0x12e)](a34_0x240d1b[_0x5ee14c(0x13d)](_0x5ee14c(0x13b))):await installOfficialSkill(_0x581cab['nonInteractive']),{'ok':!![]};}catch(_0x5ceb04){return _0x13c9fc[_0x5ee14c(0x126)](_0x5ee14c(0x17a)),console[_0x5ee14c(0x153)](a34_0x240d1b[_0x5ee14c(0x14c)]('\x20\x20'+_0x5ceb04[_0x5ee14c(0x174)])),console[_0x5ee14c(0x12e)](a34_0x240d1b['gray'](_0x5ee14c(0x157)+_0xa7f45e+_0x5ee14c(0x16a)+NPM_PACKAGE_NAME+'@'+_0x2d17d4[_0x5ee14c(0x15b)])),{'ok':![],'message':_0x5ceb04[_0x5ee14c(0x174)]};}}export const updateDefinition={'service':'update','command':a34_0x27e0e8(0x12c),'description':a34_0x27e0e8(0x166),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x23aa41,_0x3c218b){const _0x59ac80=a35_0x5407,_0x42e1fb=_0x23aa41();while(!![]){try{const _0x4450de=parseInt(_0x59ac80(0x16d))/0x1*(parseInt(_0x59ac80(0x165))/0x2)+parseInt(_0x59ac80(0x167))/0x3+-parseInt(_0x59ac80(0x16c))/0x4*(parseInt(_0x59ac80(0x16a))/0x5)+parseInt(_0x59ac80(0x170))/0x6*(-parseInt(_0x59ac80(0x168))/0x7)+-parseInt(_0x59ac80(0x16e))/0x8+-parseInt(_0x59ac80(0x169))/0x9*(parseInt(_0x59ac80(0x16f))/0xa)+-parseInt(_0x59ac80(0x166))/0xb*(-parseInt(_0x59ac80(0x16b))/0xc);if(_0x4450de===_0x3c218b)break;else _0x42e1fb['push'](_0x42e1fb['shift']());}catch(_0xb81a6a){_0x42e1fb['push'](_0x42e1fb['shift']());}}}(a35_0x3a4f,0x45214));import{codegenSdk}from'../../commands/codegen/sdk.js';function a35_0x3a4f(){const _0x576e34=['3505Ruhcpv','945624UmRAOH','20Jjggzc','3381162gDxDPW','178cPglCo','3839ponYXx','1523862SbOBhL','7qETjLg','2043162QpoHbs','2665JkHqgz','39180sPrpSn','4056HoOOwf'];a35_0x3a4f=function(){return _0x576e34;};return a35_0x3a4f();}import{codegenSql}from'../../commands/codegen/sql.js';function a35_0x5407(_0x411853,_0x410d03){_0x411853=_0x411853-0x165;const _0x3a4fd5=a35_0x3a4f();let _0x54075f=_0x3a4fd5[_0x411853];return _0x54075f;}export const codegenDefinitions=[codegenSdk,codegenSql];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a36_0x22f8(){const _0x3363be=['504704dGuVxE','skip-imports','29150LMepxY','369TgFBqD','305cGoHKW','string','bool','boolean','code','182172HCOPXT','appCode','operation','412030nzaGkB','274852crcEUK','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','5328ZPtIOT','682570dyycvn','name','21JziOVd','read','codegen','str','7VLwCdS','468708wHLCLZ'];a36_0x22f8=function(){return _0x3363be;};return a36_0x22f8();}const a36_0x19fcba=a36_0x57ad;(function(_0x58b4d1,_0x1681dc){const _0x1ada90=a36_0x57ad,_0x2e53e1=_0x58b4d1();while(!![]){try{const _0x179e5d=-parseInt(_0x1ada90(0x1cd))/0x1+parseInt(_0x1ada90(0x1d4))/0x2+-parseInt(_0x1ada90(0x1cf))/0x3*(-parseInt(_0x1ada90(0x1ca))/0x4)+parseInt(_0x1ada90(0x1d9))/0x5*(-parseInt(_0x1ada90(0x1c6))/0x6)+parseInt(_0x1ada90(0x1d3))/0x7*(-parseInt(_0x1ada90(0x1d5))/0x8)+parseInt(_0x1ada90(0x1d8))/0x9*(parseInt(_0x1ada90(0x1c9))/0xa)+parseInt(_0x1ada90(0x1d7))/0xb*(parseInt(_0x1ada90(0x1cc))/0xc);if(_0x179e5d===_0x1681dc)break;else _0x2e53e1['push'](_0x2e53e1['shift']());}catch(_0xc5f7e4){_0x2e53e1['push'](_0x2e53e1['shift']());}}}(a36_0x22f8,0xf01e8));function a36_0x57ad(_0x4c9c68,_0x3c3e80){_0x4c9c68=_0x4c9c68-0x1c5;const _0x22f8f2=a36_0x22f8();let _0x57ad00=_0x22f8f2[_0x4c9c68];return _0x57ad00;}import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const codegenSdk={'service':a36_0x19fcba(0x1d1),'command':'sdk','description':'Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','risk':a36_0x19fcba(0x1d0),'flags':[CODE_FLAG_OPTIONAL,{'name':'alias','type':'string','description':'Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)'},{'name':'operation','type':a36_0x19fcba(0x1da),'required':!![],'description':a36_0x19fcba(0x1cb)},{'name':'skip-imports','type':a36_0x19fcba(0x1dc),'description':'Omit\x20import\x20statements\x20from\x20generated\x20code'}],async 'execute'(_0x8511dd){const _0x3428d8=a36_0x19fcba,{dataset:_0x46b243,operation:_0x134c29}=await getOperationDetail(_0x8511dd[_0x3428d8(0x1c7)],_0x8511dd['str'](_0x3428d8(0x1c5)),_0x8511dd[_0x3428d8(0x1d2)](_0x3428d8(0x1c8))),_0x402095=generateSdkCode(_0x46b243,_0x134c29,{'includeImports':!_0x8511dd[_0x3428d8(0x1db)](_0x3428d8(0x1d6))});return{'ok':!![],'data':{'dataset':{'name':_0x46b243[_0x3428d8(0x1ce)],'code':_0x46b243['code'],'tableName':_0x46b243['tableName']},'operation':_0x8511dd[_0x3428d8(0x1d2)]('operation'),'code':_0x402095}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a37_0x305d(){const _0x569826=['1270dcdaqC','7451110aJlcVL','4HYKGzs','1434169FTlKgn','1959579xxeWHf','sqlCode','42327wTuHUy','Code\x20target:\x20sdk\x20(default)\x20or\x20bff','45416wpQfLc','8171874zYZEgO','string','bool','appCode','2647652RwnaiC','Omit\x20import\x20statements\x20from\x20generated\x20code','boolean','target','read','sdk','1141GoEGOu','sqlName','str'];a37_0x305d=function(){return _0x569826;};return a37_0x305d();}function a37_0x57ce(_0x2a28f5,_0x4f2e6d){_0x2a28f5=_0x2a28f5-0x171;const _0x305d7f=a37_0x305d();let _0x57ce24=_0x305d7f[_0x2a28f5];return _0x57ce24;}const a37_0xc46c56=a37_0x57ce;(function(_0x2e56b7,_0x442287){const _0x3442c5=a37_0x57ce,_0x3e7b63=_0x2e56b7();while(!![]){try{const _0x5262f0=parseInt(_0x3442c5(0x178))/0x1+parseInt(_0x3442c5(0x177))/0x2*(parseInt(_0x3442c5(0x179))/0x3)+parseInt(_0x3442c5(0x182))/0x4+-parseInt(_0x3442c5(0x176))/0x5+-parseInt(_0x3442c5(0x17e))/0x6+-parseInt(_0x3442c5(0x172))/0x7*(-parseInt(_0x3442c5(0x17d))/0x8)+parseInt(_0x3442c5(0x17b))/0x9*(-parseInt(_0x3442c5(0x175))/0xa);if(_0x5262f0===_0x442287)break;else _0x3e7b63['push'](_0x3e7b63['shift']());}catch(_0x1ddcd9){_0x3e7b63['push'](_0x3e7b63['shift']());}}}(a37_0x305d,0xd6701));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const codegenSql={'service':'codegen','command':'sql','description':'Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','risk':a37_0xc46c56(0x186),'flags':[SQLCODE_FLAG,{'name':a37_0xc46c56(0x185),'type':a37_0xc46c56(0x17f),'description':a37_0xc46c56(0x17c),'default':a37_0xc46c56(0x171),'enum':[a37_0xc46c56(0x171),'bff']},{'name':'no-imports','type':a37_0xc46c56(0x184),'description':a37_0xc46c56(0x183)}],async 'execute'(_0x3b8d06){const _0x5395ee=a37_0xc46c56,_0x1f3103=await getSqlQueryInfo(_0x3b8d06[_0x5395ee(0x181)],_0x3b8d06[_0x5395ee(0x174)]('sqlcode')),_0x113b4d=_0x3b8d06[_0x5395ee(0x174)](_0x5395ee(0x185))||_0x5395ee(0x171),_0x6a209e=generateSqlCodeTemplate(_0x1f3103,{'target':_0x113b4d,'includeImports':!_0x3b8d06[_0x5395ee(0x180)]('no-imports')});return{'ok':!![],'data':{'sqlCode':_0x1f3103[_0x5395ee(0x17a)],'sqlName':_0x1f3103[_0x5395ee(0x173)],'target':_0x113b4d,'code':_0x6a209e}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3154a5,_0x29e3e7){const _0x156de6=a38_0x5da3,_0x1cb951=_0x3154a5();while(!![]){try{const _0x21d93e=parseInt(_0x156de6(0x1d7))/0x1*(-parseInt(_0x156de6(0x1e3))/0x2)+-parseInt(_0x156de6(0x1dc))/0x3*(-parseInt(_0x156de6(0x1cf))/0x4)+parseInt(_0x156de6(0x1cb))/0x5+parseInt(_0x156de6(0x1de))/0x6*(parseInt(_0x156de6(0x1d5))/0x7)+parseInt(_0x156de6(0x1db))/0x8+-parseInt(_0x156de6(0x1c4))/0x9*(parseInt(_0x156de6(0x1d2))/0xa)+-parseInt(_0x156de6(0x1c8))/0xb*(parseInt(_0x156de6(0x1dd))/0xc);if(_0x21d93e===_0x29e3e7)break;else _0x1cb951['push'](_0x1cb951['shift']());}catch(_0xa8f306){_0x1cb951['push'](_0x1cb951['shift']());}}}(a38_0x4066,0xcb9a1));import{input,checkbox,select}from'@inquirer/prompts';import a38_0x566aa2 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 _0x4be109=a38_0x5da3,_0xd6b1cb=await input({'message':_0x4be109(0x1c6),'validate':_0x2c23cb=>{const _0x25520a=_0x4be109,_0x41c67e=validateAppcode(_0x2c23cb[_0x25520a(0x1e5)]());return _0x41c67e[_0x25520a(0x1cc)]||_0x41c67e[_0x25520a(0x1e2)]||_0x25520a(0x1cd);}});return _0xd6b1cb['trim']();}function a38_0x4066(){const _0x3550b0=['✎\x20自定义输入\x20appcode','find','message','338GdjAvQ','appCode','trim','\x20\x20(','gray','未找到可用应用。','length','10031058lOOYKP','custom','请输入\x20App\x20Code:','yellow','1661kPUVZq','skip','App\x20Code:','3401440zAOoNn','valid','Invalid\x20App\x20Code','includes','112004QdrFiU','(未检测到登录态,请手动输入\x20App\x20Code\x20或直接跳过)','(跳过,稍后配置)','10tZWFWs','无法获取远程应用列表,请手动输入。','正在获取可用应用列表...','7iadcRX','manual','9129GDMjpL','map','cyan','请选择要绑定的应用:','5171528wYNdxM','177BMnACz','70620zjeGKR','8406978ctacjx','\x20个应用,请选择\x20(空格勾选,\x20a=全选,\x20i=反选):'];a38_0x4066=function(){return _0x3550b0;};return a38_0x4066();}export async function promptAppSelection(_0x2daa92){const _0xc596fd=a38_0x5da3,_0x36b34a=[{'name':a38_0x566aa2[_0xc596fd(0x1c7)](_0xc596fd(0x1e0)),'value':-0x1},..._0x2daa92[_0xc596fd(0x1d8)]((_0x39a11d,_0x1ab011)=>({'name':_0x39a11d['appName']+'\x20\x20'+a38_0x566aa2[_0xc596fd(0x1c1)]('('+_0x39a11d[_0xc596fd(0x1e4)]+')'),'value':_0x1ab011}))],_0x491db9=await checkbox({'message':'获取到\x20'+a38_0x566aa2[_0xc596fd(0x1d9)](_0x2daa92[_0xc596fd(0x1c3)])+_0xc596fd(0x1df),'choices':_0x36b34a,'loop':![]});if(_0x491db9[_0xc596fd(0x1ce)](-0x1))return'custom';if(_0x491db9[_0xc596fd(0x1c3)]===0x0)return _0xc596fd(0x1c5);return _0x491db9[_0xc596fd(0x1d8)](_0x45ad96=>_0x2daa92[_0x45ad96]);}export async function promptSingleAppSelection(_0x179955){const _0x2c1ecd=a38_0x5da3,_0x546a8b=[{'name':a38_0x566aa2[_0x2c1ecd(0x1c1)]('(跳过,稍后通过\x20config\x20set\x20appcode\x20配置)'),'value':'skip'},{'name':a38_0x566aa2['yellow']('✎\x20自定义输入\x20appcode'),'value':_0x2c1ecd(0x1c5)},..._0x179955[_0x2c1ecd(0x1d8)](_0xcc96b8=>({'name':_0xcc96b8['appName']+'\x20\x20'+a38_0x566aa2[_0x2c1ecd(0x1c1)]('('+_0xcc96b8[_0x2c1ecd(0x1e4)]+')'),'value':_0xcc96b8[_0x2c1ecd(0x1e4)]}))],_0x140e9a=await select({'message':_0x2c1ecd(0x1da),'choices':_0x546a8b});if(_0x140e9a===_0x2c1ecd(0x1c9))return _0x2c1ecd(0x1c9);if(_0x140e9a===_0x2c1ecd(0x1c5))return'custom';return _0x179955[_0x2c1ecd(0x1e1)](_0x3a5fbb=>_0x3a5fbb[_0x2c1ecd(0x1e4)]===_0x140e9a);}export async function selectSingleAppcode(_0x48a12c){const _0x3fa6c8=a38_0x5da3;if(!_0x48a12c)return writeCliSideChannelLine(a38_0x566aa2['gray'](_0x3fa6c8(0x1d0))),_fallbackOrSkip();writeCliSideChannelLine(_0x3fa6c8(0x1d4));let _0x3f5015;try{_0x3f5015=await withActiveCookie(_0x48a12c,()=>listRemoteApps());}catch(_0x6f837c){writeCliSideChannelLine(a38_0x566aa2[_0x3fa6c8(0x1c7)](_0x3fa6c8(0x1d3)));if(_0x6f837c instanceof Error)writeCliSideChannelLine(a38_0x566aa2[_0x3fa6c8(0x1c1)]('\x20\x20('+_0x6f837c[_0x3fa6c8(0x1e2)]+')'));return _fallbackOrSkip();}if(_0x3f5015['length']===0x0)return writeCliSideChannelLine(a38_0x566aa2[_0x3fa6c8(0x1c7)](_0x3fa6c8(0x1c2))),_fallbackOrSkip();const _0x360e4b=await promptSingleAppSelection(_0x3f5015);if(_0x360e4b===_0x3fa6c8(0x1c9))return'';if(_0x360e4b===_0x3fa6c8(0x1c5))return promptCustomAppcode();return _0x360e4b[_0x3fa6c8(0x1e4)];}function a38_0x5da3(_0x2a83af,_0x689e31){_0x2a83af=_0x2a83af-0x1c0;const _0x406622=a38_0x4066();let _0x5da30e=_0x406622[_0x2a83af];return _0x5da30e;}export async function selectMultipleApps(_0x46c7ff){const _0x3e0f7e=a38_0x5da3;writeCliSideChannelLine(_0x3e0f7e(0x1d4));let _0x5222e7;try{_0x5222e7=await withActiveCookie(_0x46c7ff,()=>listRemoteApps());}catch(_0x498e8c){writeCliSideChannelLine('\x0a无法获取远程应用列表,请手动输入。');if(_0x498e8c instanceof Error)writeCliSideChannelLine(_0x3e0f7e(0x1c0)+_0x498e8c[_0x3e0f7e(0x1e2)]+')');return _0x3e0f7e(0x1c5);}if(_0x5222e7[_0x3e0f7e(0x1c3)]===0x0)return writeCliSideChannelLine('\x0a未找到可用应用。'),_0x3e0f7e(0x1c5);return promptAppSelection(_0x5222e7);}async function _fallbackOrSkip(){const _0x211f1d=a38_0x5da3,_0x22b6c9=await select({'message':_0x211f1d(0x1ca),'choices':[{'name':a38_0x566aa2[_0x211f1d(0x1c1)](_0x211f1d(0x1d1)),'value':_0x211f1d(0x1c9)},{'name':a38_0x566aa2[_0x211f1d(0x1c7)]('✎\x20手动输入'),'value':_0x211f1d(0x1d6)}]});if(_0x22b6c9===_0x211f1d(0x1c9))return'';return promptCustomAppcode();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a39_0x45fb(){const _0x1e9627=['Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)','994084dcPynC','54zdWojp','sqlcode','182660mhIXUL','116048MSzPYS','389814vBLYBe','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','number','27NILUpK','appcode','dbtype','MYSQL','917645sjhFVa','datasetcode','46417mIDgvy','App\x20code\x20(overrides\x20config\x20file,\x20e.g.\x20app-xxxxx)','3jqfvGL','220232HTPIMe','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','a\x2032-character\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588)','Dataset\x20code\x20(32-char\x20hex\x20UUID)','string'];a39_0x45fb=function(){return _0x1e9627;};return a39_0x45fb();}const a39_0x1192d6=a39_0x275d;(function(_0x1066f7,_0x4b1e12){const _0x2f6da0=a39_0x275d,_0x221b73=_0x1066f7();while(!![]){try{const _0x92652=parseInt(_0x2f6da0(0xd7))/0x1+parseInt(_0x2f6da0(0xd8))/0x2*(-parseInt(_0x2f6da0(0xcc))/0x3)+parseInt(_0x2f6da0(0xd3))/0x4+-parseInt(_0x2f6da0(0xdf))/0x5+-parseInt(_0x2f6da0(0xd4))/0x6*(-parseInt(_0x2f6da0(0xca))/0x7)+parseInt(_0x2f6da0(0xcd))/0x8*(parseInt(_0x2f6da0(0xdb))/0x9)+parseInt(_0x2f6da0(0xd6))/0xa;if(_0x92652===_0x4b1e12)break;else _0x221b73['push'](_0x221b73['shift']());}catch(_0x2efab0){_0x221b73['push'](_0x221b73['shift']());}}}(a39_0x45fb,0x23ce9));function a39_0x275d(_0x413e50,_0x24df3){_0x413e50=_0x413e50-0xca;const _0x45fb63=a39_0x45fb();let _0x275d22=_0x45fb63[_0x413e50];return _0x275d22;}export const DATASET_CODE_PATTERN={'regex':/^[a-f0-9]{32}$/i,'description':a39_0x1192d6(0xcf)};export const CODE_FLAG={'name':'code','type':a39_0x1192d6(0xd1),'required':!![],'description':a39_0x1192d6(0xd0),'pattern':DATASET_CODE_PATTERN};export const CODE_FLAG_OPTIONAL={...CODE_FLAG,'required':![]};export const DATASETCODE_FLAG_OPTIONAL={...CODE_FLAG_OPTIONAL,'name':a39_0x1192d6(0xe0),'description':a39_0x1192d6(0xd0)};export const SQLCODE_FLAG={'name':a39_0x1192d6(0xd5),'type':a39_0x1192d6(0xd1),'required':!![],'description':a39_0x1192d6(0xce),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a39_0x1192d6(0xd9)}};export const APPCODE_FLAG_OPTIONAL={'name':a39_0x1192d6(0xdc),'type':a39_0x1192d6(0xd1),'required':![],'description':a39_0x1192d6(0xcb)};export const SQLCODE_FLAG_OPTIONAL={...SQLCODE_FLAG,'required':![]};export const DBLINK_ID_FLAG={'name':'id','type':a39_0x1192d6(0xda),'required':!![],'description':a39_0x1192d6(0xd2)};export const DB_TYPE_FLAG={'name':a39_0x1192d6(0xdd),'type':a39_0x1192d6(0xd1),'required':!![],'description':'Database\x20product\x20type','enum':[a39_0x1192d6(0xde),'POSTGRESQL']};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a40_0x40b3(){const _0x298b6d=['120Qlyozm','35120090pfFFoH','12842627hYhjhn','646572MpcnxO','2501012uTVmXH','trim','App\x20Code\x20cannot\x20exceed\x20100\x20characters','test','897597DtcWdc','364351SfcLNP','App\x20Code\x20cannot\x20be\x20empty','11qpOojz','6YeieQx','333805YSxzNW','16RwGkep'];a40_0x40b3=function(){return _0x298b6d;};return a40_0x40b3();}function a40_0x45bf(_0x30c211,_0x2015b1){_0x30c211=_0x30c211-0xbd;const _0x40b37a=a40_0x40b3();let _0x45bf09=_0x40b37a[_0x30c211];return _0x45bf09;}(function(_0x91bb32,_0x1a7b43){const _0x51d460=a40_0x45bf,_0x415991=_0x91bb32();while(!![]){try{const _0x5e0669=-parseInt(_0x51d460(0xc9))/0x1+parseInt(_0x51d460(0xbf))/0x2*(parseInt(_0x51d460(0xc3))/0x3)+-parseInt(_0x51d460(0xc4))/0x4+-parseInt(_0x51d460(0xbe))/0x5*(-parseInt(_0x51d460(0xbd))/0x6)+-parseInt(_0x51d460(0xc2))/0x7+parseInt(_0x51d460(0xc0))/0x8*(-parseInt(_0x51d460(0xc8))/0x9)+parseInt(_0x51d460(0xc1))/0xa*(parseInt(_0x51d460(0xcb))/0xb);if(_0x5e0669===_0x1a7b43)break;else _0x415991['push'](_0x415991['shift']());}catch(_0x4a8bb7){_0x415991['push'](_0x415991['shift']());}}}(a40_0x40b3,0xefeae));export function validateAppcode(_0x3fb03d){const _0x3eee3b=a40_0x45bf,_0x41d04a=_0x3fb03d[_0x3eee3b(0xc5)]();if(!_0x41d04a)return{'valid':![],'message':_0x3eee3b(0xca)};if(_0x41d04a['length']>0x64)return{'valid':![],'message':_0x3eee3b(0xc6)};if(!/^[A-Za-z0-9_-]+$/[_0x3eee3b(0xc7)](_0x41d04a))return{'valid':![],'message':'Only\x20letters,\x20numbers,\x20-\x20and\x20_\x20are\x20allowed'};return{'valid':!![]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a41_0x2ad91c=a41_0x29eb;(function(_0x443caf,_0x71545){const _0x285ad5=a41_0x29eb,_0x1768a3=_0x443caf();while(!![]){try{const _0x1db453=parseInt(_0x285ad5(0x1af))/0x1*(-parseInt(_0x285ad5(0x1a4))/0x2)+parseInt(_0x285ad5(0x19c))/0x3*(parseInt(_0x285ad5(0x1a9))/0x4)+-parseInt(_0x285ad5(0x1aa))/0x5+parseInt(_0x285ad5(0x1a3))/0x6+-parseInt(_0x285ad5(0x1b0))/0x7+parseInt(_0x285ad5(0x1ad))/0x8+parseInt(_0x285ad5(0x19e))/0x9*(parseInt(_0x285ad5(0x1a7))/0xa);if(_0x1db453===_0x71545)break;else _0x1768a3['push'](_0x1768a3['shift']());}catch(_0x374979){_0x1768a3['push'](_0x1768a3['shift']());}}}(a41_0x4827,0x9ebd5));import{CliErrors}from'../../errors.js';import{readConfig}from'../../utils/config.js';function a41_0x29eb(_0x5d7428,_0x3811f3){_0x5d7428=_0x5d7428-0x19c;const _0x482719=a41_0x4827();let _0x29eb4d=_0x482719[_0x5d7428];return _0x29eb4d;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{getConfigCommandKeyDescription}from'../../commands/config/shared.js';async function execute(_0x47cfc5){const _0x3e9d2d=a41_0x29eb,_0x243a33=_0x47cfc5[_0x3e9d2d(0x19f)]('key');if(!_0x243a33)throw CliErrors[_0x3e9d2d(0x1a8)]('Missing\x20key.',_0x3e9d2d(0x1ac)+CLI_BIN_NAME+_0x3e9d2d(0x1a6));const _0x572161=readConfig(),_0x18fa49=_0x243a33==='app'?_0x3e9d2d(0x1a1):_0x243a33,_0x3a971a=_0x572161[_0x18fa49];if(_0x3a971a===undefined)throw CliErrors[_0x3e9d2d(0x1a8)](_0x3e9d2d(0x1ae)+_0x243a33);return{'ok':!![],'data':typeof _0x3a971a==='object'?_0x3a971a:{[_0x18fa49]:_0x3a971a},'message':typeof _0x3a971a===_0x3e9d2d(0x1a5)?undefined:String(_0x3a971a)};}function a41_0x4827(){const _0x5566c5=['4939839eYqYoU','str','get','appcode','config','4429746rceenJ','2rEVPxf','object','\x20config\x20get\x20--key\x20<key>','10LoHORH','validation','82672BeVllo','6139470WEaCNO','key','Usage:\x20','8815664vApOkQ','Key\x20not\x20found:\x20','799949nYuYlz','1305108YzyOLu','Get\x20a\x20config\x20value\x20by\x20key','69pykebT','string'];a41_0x4827=function(){return _0x5566c5;};return a41_0x4827();}export const configGetDefinition={'service':a41_0x2ad91c(0x1a2),'command':a41_0x2ad91c(0x1a0),'description':a41_0x2ad91c(0x1b1),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a41_0x2ad91c(0x1ab),'type':a41_0x2ad91c(0x19d),'description':getConfigCommandKeyDescription(),'required':!![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a42_0x161f(_0x2b4b3a,_0x53276b){_0x2b4b3a=_0x2b4b3a-0x144;const _0x1c0977=a42_0x1c09();let _0x161f22=_0x1c0977[_0x2b4b3a];return _0x161f22;}(function(_0x215be7,_0x35da7f){const _0x18e03f=a42_0x161f,_0x29195d=_0x215be7();while(!![]){try{const _0x2db3b3=-parseInt(_0x18e03f(0x14f))/0x1+-parseInt(_0x18e03f(0x146))/0x2*(parseInt(_0x18e03f(0x147))/0x3)+-parseInt(_0x18e03f(0x14b))/0x4+-parseInt(_0x18e03f(0x14e))/0x5*(-parseInt(_0x18e03f(0x145))/0x6)+parseInt(_0x18e03f(0x14d))/0x7*(-parseInt(_0x18e03f(0x148))/0x8)+-parseInt(_0x18e03f(0x14a))/0x9*(-parseInt(_0x18e03f(0x14c))/0xa)+parseInt(_0x18e03f(0x149))/0xb*(parseInt(_0x18e03f(0x144))/0xc);if(_0x2db3b3===_0x35da7f)break;else _0x29195d['push'](_0x29195d['shift']());}catch(_0x311040){_0x29195d['push'](_0x29195d['shift']());}}}(a42_0x1c09,0x25ad2));import{configListDefinition}from'../../commands/config/list.js';function a42_0x1c09(){const _0xbda0e9=['90oXhpYw','553500lYFYwD','60040Dtlzom','1099iaBTUu','257740FdQzOH','132091giNEfu','2674764mRsTKK','6pGSYKC','14jGYEkl','126381VyRWzq','3088hDpIhI','33PegSrN'];a42_0x1c09=function(){return _0xbda0e9;};return a42_0x1c09();}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
|
+
function a43_0xebbe(){const _0x16fd10=['7835EFJCCR','2478546gJhIYN','Show\x20global\x20config\x20only\x20(~/.rabetbase.json)','784716KYxCEx','2658894wYTeNq','global','bool','151112wbLQaZ','191370QRzjsj','7450oBOAXi','62CYMXwL','List\x20all\x20config\x20values','10BXdhIk','161OgtAUN','read','config','605gfXFyk'];a43_0xebbe=function(){return _0x16fd10;};return a43_0xebbe();}const a43_0x399d20=a43_0x2556;function a43_0x2556(_0x3aec64,_0x249de4){_0x3aec64=_0x3aec64-0x152;const _0xebbe6e=a43_0xebbe();let _0x25564e=_0xebbe6e[_0x3aec64];return _0x25564e;}(function(_0x3f0e1d,_0x445354){const _0x165f3b=a43_0x2556,_0x318aac=_0x3f0e1d();while(!![]){try{const _0xc8db4d=parseInt(_0x165f3b(0x159))/0x1*(parseInt(_0x165f3b(0x152))/0x2)+parseInt(_0x165f3b(0x161))/0x3+-parseInt(_0x165f3b(0x15c))/0x4*(parseInt(_0x165f3b(0x154))/0x5)+parseInt(_0x165f3b(0x15d))/0x6+parseInt(_0x165f3b(0x155))/0x7*(-parseInt(_0x165f3b(0x160))/0x8)+parseInt(_0x165f3b(0x15a))/0x9+parseInt(_0x165f3b(0x162))/0xa*(parseInt(_0x165f3b(0x158))/0xb);if(_0xc8db4d===_0x445354)break;else _0x318aac['push'](_0x318aac['shift']());}catch(_0x355398){_0x318aac['push'](_0x318aac['shift']());}}}(a43_0xebbe,0x3a71c));import{readScopedConfig}from'../../commands/config/shared.js';import{readConfig}from'../../utils/config.js';async function execute(_0xfa334b){const _0x4fa59c=a43_0x2556,_0x50e8ad=_0xfa334b[_0x4fa59c(0x15f)](_0x4fa59c(0x15e))?readScopedConfig('global'):readConfig();return{'ok':!![],'data':_0x50e8ad};}export const configListDefinition={'service':a43_0x399d20(0x157),'command':'list','description':a43_0x399d20(0x153),'risk':a43_0x399d20(0x156),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a43_0x399d20(0x15e),'type':'boolean','description':a43_0x399d20(0x15b),'default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a44_0x57fef6=a44_0x1ffa;function a44_0x34b1(){const _0x102809=['apps','30926EVgisa','config','env','Usage:\x20','write','Use\x20`','validation','string','82332qlSHWR','358416tDIDKm','Invalid\x20value\x20for\x20\x22','Config\x20value','\x20set\x20to:\x20','Invalid\x20locale\x20value.','155BIzoHO','1014761MWEODk','join','Project','40wunLCc','key','Settable\x20top-level\x20keys:\x20','\x20appcode\x20set\x20to:\x20','Global','`,\x20`','\x22.\x20Allowed:\x20','243nfIuth','global','boolean','Missing\x20value.','Set\x20a\x20config\x20value','bool','40whGvvz','set','str','object','\x20(stored\x20as\x20apps\x20+\x20defaultApp)','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','Invalid\x20value\x20for\x20env.\x20Allowed:\x20production,\x20daily.','value','Top-level\x20key\x20\x22','includes','3691VyvWgP','app','12bejKlV','locale','\x20app\x20add\x20<name>\x20--appcode\x20','length','19970LJdRcw','\x20app\x20use\x20<name>`,\x20or\x20pass\x20`--appcode`\x20on\x20the\x20command.','appcode','riskLevel','7924tnGHFK'];a44_0x34b1=function(){return _0x102809;};return a44_0x34b1();}(function(_0x376b99,_0x30bfbe){const _0x564339=a44_0x1ffa,_0x12ba1a=_0x376b99();while(!![]){try{const _0x321b6b=parseInt(_0x564339(0xf3))/0x1*(parseInt(_0x564339(0xdc))/0x2)+parseInt(_0x564339(0xd3))/0x3+parseInt(_0x564339(0xc8))/0x4*(parseInt(_0x564339(0xd8))/0x5)+-parseInt(_0x564339(0xd2))/0x6+-parseInt(_0x564339(0xca))/0x7*(-parseInt(_0x564339(0xe9))/0x8)+-parseInt(_0x564339(0xe3))/0x9*(parseInt(_0x564339(0xc4))/0xa)+-parseInt(_0x564339(0xd9))/0xb*(parseInt(_0x564339(0xf5))/0xc);if(_0x321b6b===_0x30bfbe)break;else _0x12ba1a['push'](_0x12ba1a['shift']());}catch(_0x22a20d){_0x12ba1a['push'](_0x12ba1a['shift']());}}}(a44_0x34b1,0x1c8a5));import{CliErrors}from'../../errors.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';function a44_0x1ffa(_0x38a32c,_0x237215){_0x38a32c=_0x38a32c-0xc1;const _0x34b16b=a44_0x34b1();let _0x1ffa5e=_0x34b16b[_0x38a32c];return _0x1ffa5e;}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(_0x36097f){const _0x5cba15=a44_0x1ffa,_0x37ec51=_0x36097f[_0x5cba15(0xeb)](_0x5cba15(0xdd)),_0x309e83=_0x36097f[_0x5cba15(0xeb)](_0x5cba15(0xf0));if(!_0x37ec51)throw CliErrors['validation']('Missing\x20key.',_0x5cba15(0xcd)+CLI_BIN_NAME+'\x20config\x20set\x20--key\x20<key>\x20--value\x20<value>');if(_0x309e83===undefined||_0x309e83==='')throw CliErrors[_0x5cba15(0xd0)](_0x5cba15(0xe6),_0x5cba15(0xcd)+CLI_BIN_NAME+'\x20config\x20set\x20--key\x20<key>\x20--value\x20<value>');if(_0x309e83[_0x5cba15(0xc3)]>0x1f4)throw CliErrors[_0x5cba15(0xd0)]('Config\x20value\x20is\x20invalid\x20or\x20too\x20long.');if(!isTopLevelConfigKey(_0x37ec51))throw CliErrors[_0x5cba15(0xd0)](_0x5cba15(0xf1)+_0x37ec51+'\x22\x20is\x20not\x20settable.',_0x5cba15(0xde)+getTopLevelConfigKeySummary());if(_0x37ec51===_0x5cba15(0xc7))throw CliErrors[_0x5cba15(0xd0)](_0x5cba15(0xee));if(CONFIG_ENUM_VALUES[_0x37ec51]&&!CONFIG_ENUM_VALUES[_0x37ec51][_0x5cba15(0xf2)](_0x309e83))throw CliErrors[_0x5cba15(0xd0)](_0x5cba15(0xd4)+_0x37ec51+_0x5cba15(0xe2)+CONFIG_ENUM_VALUES[_0x37ec51][_0x5cba15(0xda)](',\x20'));if(_0x37ec51===_0x5cba15(0xc1)&&!normalizeLocale(_0x309e83))throw CliErrors[_0x5cba15(0xd0)](_0x5cba15(0xd7),'Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US');const _0x534e5a={'global':_0x36097f[_0x5cba15(0xe8)]('global')},_0x5bb5c=resolveWriteScope(_0x534e5a),_0x167d85=readScopedConfig(_0x5bb5c);let _0x22ec80=_0x37ec51,_0x29f9c5=_0x309e83;_0x37ec51===_0x5cba15(0xf4)&&(_0x22ec80=_0x5cba15(0xc6),delete _0x167d85[_0x5cba15(0xf4)]);_0x37ec51===_0x5cba15(0xc1)&&(_0x29f9c5=normalizeLocale(_0x309e83));if(_0x37ec51===_0x5cba15(0xcc)){_0x29f9c5=normalizeEnv(_0x309e83);if(!isProduction(_0x29f9c5)&&!isDaily(_0x29f9c5))throw CliErrors['validation'](_0x5cba15(0xef),'Legacy\x20alias\x20\x22online\x22\x20is\x20accepted\x20and\x20stored\x20as\x20production.');}if(_0x37ec51===_0x5cba15(0xc6)){const _0x4c7833=_0x167d85[_0x5cba15(0xc9)]&&typeof _0x167d85[_0x5cba15(0xc9)]===_0x5cba15(0xec)?Object['keys'](_0x167d85[_0x5cba15(0xc9)]):[];if(_0x4c7833['length']>0x0)throw CliErrors[_0x5cba15(0xd0)]('Cannot\x20set\x20top-level\x20\x22appcode\x22\x20when\x20multi-app\x20config\x20already\x20exists.',_0x5cba15(0xcf)+CLI_BIN_NAME+_0x5cba15(0xc2)+_0x29f9c5+_0x5cba15(0xe1)+CLI_BIN_NAME+_0x5cba15(0xc5));const _0x3b271e=buildCanonicalProjectConfig({..._0x167d85},{'appCodes':[_0x29f9c5],'env':typeof _0x167d85[_0x5cba15(0xcc)]===_0x5cba15(0xd1)?_0x167d85['env']:undefined});writeScopedConfig(_0x3b271e,_0x5bb5c);const _0x5ccdb9=_0x5bb5c===_0x5cba15(0xe4)?_0x5cba15(0xe0):_0x5cba15(0xdb);return{'ok':!![],'message':'✓\x20'+_0x5ccdb9+_0x5cba15(0xdf)+_0x29f9c5+_0x5cba15(0xed)};}_0x167d85[_0x22ec80]=_0x29f9c5,writeScopedConfig(_0x167d85,_0x5bb5c);const _0x310883=_0x5bb5c===_0x5cba15(0xe4)?_0x5cba15(0xe0):_0x5cba15(0xdb);return{'ok':!![],'message':'✓\x20'+_0x310883+'\x20'+_0x22ec80+_0x5cba15(0xd6)+_0x29f9c5};}export const configSetDefinition={'service':a44_0x57fef6(0xcb),'command':a44_0x57fef6(0xea),'description':a44_0x57fef6(0xe7),'risk':a44_0x57fef6(0xce),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a44_0x57fef6(0xdd),'type':'string','description':getConfigCommandKeyDescription(),'required':!![]},{'name':a44_0x57fef6(0xf0),'type':'string','description':a44_0x57fef6(0xd5),'required':!![]},{'name':a44_0x57fef6(0xe4),'type':a44_0x57fef6(0xe5),'description':'Write\x20to\x20global\x20config\x20(~/.rabetbase.json)','default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5ebce4,_0x583120){var _0x1a00d7=a45_0x406e,_0x22987e=_0x5ebce4();while(!![]){try{var _0x33c8cd=parseInt(_0x1a00d7(0x15d))/0x1+parseInt(_0x1a00d7(0x160))/0x2*(-parseInt(_0x1a00d7(0x165))/0x3)+-parseInt(_0x1a00d7(0x163))/0x4+parseInt(_0x1a00d7(0x15a))/0x5+-parseInt(_0x1a00d7(0x161))/0x6+parseInt(_0x1a00d7(0x15c))/0x7+parseInt(_0x1a00d7(0x162))/0x8;if(_0x33c8cd===_0x583120)break;else _0x22987e['push'](_0x22987e['shift']());}catch(_0x4f71dc){_0x22987e['push'](_0x22987e['shift']());}}}(a45_0x22dd,0x2c7b6));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_0x406e(_0x1d851d,_0x2ea152){_0x1d851d=_0x1d851d-0x15a;var _0x22dde5=a45_0x22dd();var _0x406ef2=_0x22dde5[_0x1d851d];return _0x406ef2;}export{CLI_BIN_NAME};export{normalizeLocale};export{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey};export function resolveWriteScope(_0x5d5608){var _0x3c932e=a45_0x406e;if(_0x5d5608[_0x3c932e(0x15f)])return'global';if(!isInProject())throw CliErrors['validation'](_0x3c932e(0x15e),_0x3c932e(0x164)+CLI_BIN_NAME+'\x20init`\x20first.');return _0x3c932e(0x15b);}function a45_0x22dd(){var _0x5a8f4f=['49141MYMWGk','Not\x20inside\x20a\x20project\x20(no\x20.rabetbase.json\x20found).','global','4aRaWew','1864434KbHzzm','3396496dggTrq','1254568xoLnVN','Add\x20--global\x20to\x20write\x20to\x20~/.rabetbase.json,\x20or\x20run\x20`','208188KJJoYr','1647565aaRFEC','project','995085Dcekmq'];a45_0x22dd=function(){return _0x5a8f4f;};return a45_0x22dd();}export function readScopedConfig(_0x270137){return readConfigFile(resolveWriteConfigPath(_0x270137));}export function writeScopedConfig(_0x287ad3,_0x9a292b){writeConfigFile(resolveWriteConfigPath(_0x9a292b),_0x287ad3);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a46_0x177ccc=a46_0x5c03;function a46_0x5c03(_0x52b988,_0x98b28b){_0x52b988=_0x52b988-0x100;const _0x53a013=a46_0x53a0();let _0x5c0319=_0x53a013[_0x52b988];return _0x5c0319;}function a46_0x53a0(){const _0x3b0941=['1189748exnCMw','8kdqPij','342542EKzkuO','3040227dNKcRd','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','Filter\x20dataset\x20records\x20with\x20query\x20conditions','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','1432950DXaeYl','3149256AWbNqr','76DPDFDc','1PzARfV','20394517kCDRTK','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','filter','\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]','19165oCoBma','10BieSQc','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions'];a46_0x53a0=function(){return _0x3b0941;};return a46_0x53a0();}(function(_0x3d9fc4,_0x52801c){const _0x3eb808=a46_0x5c03,_0x282a6a=_0x3d9fc4();while(!![]){try{const _0x4ab13c=-parseInt(_0x3eb808(0x103))/0x1*(parseInt(_0x3eb808(0x10d))/0x2)+-parseInt(_0x3eb808(0x101))/0x3+-parseInt(_0x3eb808(0x102))/0x4*(-parseInt(_0x3eb808(0x108))/0x5)+-parseInt(_0x3eb808(0x100))/0x6+-parseInt(_0x3eb808(0x10b))/0x7*(parseInt(_0x3eb808(0x10c))/0x8)+-parseInt(_0x3eb808(0x10e))/0x9*(-parseInt(_0x3eb808(0x109))/0xa)+parseInt(_0x3eb808(0x104))/0xb;if(_0x4ab13c===_0x52801c)break;else _0x282a6a['push'](_0x282a6a['shift']());}catch(_0x3b9195){_0x282a6a['push'](_0x282a6a['shift']());}}}(a46_0x53a0,0x9aff1));import{buildDataCommand}from'../../commands/data/shared.js';export const dataFilter=buildDataCommand({'command':'filter','operation':a46_0x177ccc(0x106),'description':a46_0x177ccc(0x110),'paramsRequired':![],'paramsHint':a46_0x177ccc(0x111),'helpExtra':['\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)',a46_0x177ccc(0x10a),a46_0x177ccc(0x107),a46_0x177ccc(0x105),a46_0x177ccc(0x10f),'\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page']['join']('\x0a')});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a47_0x1d5ede=a47_0x575c;(function(_0x7a02b0,_0x294136){const _0x571381=a47_0x575c,_0x49bf07=_0x7a02b0();while(!![]){try{const _0x35c1df=parseInt(_0x571381(0xfa))/0x1+-parseInt(_0x571381(0xf9))/0x2+parseInt(_0x571381(0xf8))/0x3+-parseInt(_0x571381(0xfe))/0x4*(-parseInt(_0x571381(0xf6))/0x5)+parseInt(_0x571381(0xff))/0x6+-parseInt(_0x571381(0x100))/0x7*(-parseInt(_0x571381(0xfc))/0x8)+parseInt(_0x571381(0xfb))/0x9*(-parseInt(_0x571381(0xf5))/0xa);if(_0x35c1df===_0x294136)break;else _0x49bf07['push'](_0x49bf07['shift']());}catch(_0x5e2749){_0x49bf07['push'](_0x49bf07['shift']());}}}(a47_0x10eb,0x4a5eb));import{buildDataCommand}from'../../commands/data/shared.js';export const dataGetOne=buildDataCommand({'command':a47_0x1d5ede(0xf7),'operation':a47_0x1d5ede(0xf7),'description':a47_0x1d5ede(0xfd),'paramsRequired':!![],'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'});function a47_0x575c(_0x56d4e2,_0x30d3d4){_0x56d4e2=_0x56d4e2-0xf5;const _0x10eba2=a47_0x10eb();let _0x575cfb=_0x10eba2[_0x56d4e2];return _0x575cfb;}function a47_0x10eb(){const _0x13fd63=['719010tBpHdb','4149424oXXCZJ','Get\x20a\x20single\x20record\x20by\x20ID','42100GlEYup','1827588PFlkRK','7wnQkka','120EmSKLd','175LwbaNk','getOne','355110RLItxW','582568EdfTJh','244562jLKNIr'];a47_0x10eb=function(){return _0x13fd63;};return a47_0x10eb();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x54d890,_0x1ef427){const _0x22d51d=a48_0x3431,_0x1f1c31=_0x54d890();while(!![]){try{const _0x54b938=parseInt(_0x22d51d(0xc9))/0x1*(parseInt(_0x22d51d(0xc7))/0x2)+-parseInt(_0x22d51d(0xc4))/0x3+-parseInt(_0x22d51d(0xc3))/0x4+-parseInt(_0x22d51d(0xca))/0x5+parseInt(_0x22d51d(0xc8))/0x6+-parseInt(_0x22d51d(0xc5))/0x7+parseInt(_0x22d51d(0xc6))/0x8;if(_0x54b938===_0x1ef427)break;else _0x1f1c31['push'](_0x1f1c31['shift']());}catch(_0x482e12){_0x1f1c31['push'](_0x1f1c31['shift']());}}}(a48_0x3bd4,0xc5e60));import{dataFilter}from'../../commands/data/filter.js';function a48_0x3bd4(){const _0x5c57ae=['1585386WEMEjd','875880emKmsv','2871605lxNztd','3619376mRPmdf','126927jyVaaD','8647926IQjjbp','19418984IUOMle','2upmuZD'];a48_0x3bd4=function(){return _0x5c57ae;};return a48_0x3bd4();}function a48_0x3431(_0x2d8e13,_0x4c7740){_0x2d8e13=_0x2d8e13-0xc3;const _0x3bd411=a48_0x3bd4();let _0x34311b=_0x3bd411[_0x2d8e13];return _0x34311b;}import{dataGetOne}from'../../commands/data/getOne.js';export const dataDefinitions=[dataFilter,dataGetOne];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x27351d,_0x1d29b3){const _0x3df884=a49_0x4b67,_0x278477=_0x27351d();while(!![]){try{const _0x532901=-parseInt(_0x3df884(0x139))/0x1*(parseInt(_0x3df884(0x136))/0x2)+parseInt(_0x3df884(0x144))/0x3*(-parseInt(_0x3df884(0x151))/0x4)+parseInt(_0x3df884(0x138))/0x5+parseInt(_0x3df884(0x146))/0x6+parseInt(_0x3df884(0x13b))/0x7*(-parseInt(_0x3df884(0x14f))/0x8)+-parseInt(_0x3df884(0x150))/0x9+parseInt(_0x3df884(0x13f))/0xa;if(_0x532901===_0x1d29b3)break;else _0x278477['push'](_0x278477['shift']());}catch(_0x576a89){_0x278477['push'](_0x278477['shift']());}}}(a49_0x2697,0xaad9d));import{executeDatasetDataOperation}from'../../core/api-client.js';import{CODE_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{parseJsonParams}from'../../utils/params.js';function assertGetOneId(_0x551e2b){const _0x5a494b=a49_0x4b67;if(!_0x551e2b)throw CliErrors[_0x5a494b(0x142)](_0x5a494b(0x141),_0x5a494b(0x137));const _0x23d4e7=_0x551e2b['id'];if(_0x23d4e7===undefined||_0x23d4e7===null||_0x23d4e7==='')throw CliErrors[_0x5a494b(0x148)](_0x5a494b(0x143),_0x5a494b(0x145));}function a49_0x2697(){const _0x1ffdb1=['paramsRequired','command','compress','152iYHdyr','9375921FAGPuI','412TUXQiS','operation','read','2ImdpfK','Provide\x20--params\x20\x27{\x22id\x22:123}\x27\x20for\x20data\x20getOne.','4418055TFcuOm','1193665mqgzwm','\x20completed\x20in\x20','174405ZklMYw','data','str','helpExtra','27498820kbzvPK','data\x20','params','flagMissing','data\x20getOne\x20requires\x20\x22id\x22\x20in\x20--params','37299CPKjRj','Example:\x20--params\x20\x27{\x22id\x22:123}\x27','6334380kukGOT','paramsHint','validation','code','now','string'];a49_0x2697=function(){return _0x1ffdb1;};return a49_0x2697();}function parseCommandParams(_0x3d60a7){return parseJsonParams(_0x3d60a7)??{};}function a49_0x4b67(_0x18dbb5,_0x302050){_0x18dbb5=_0x18dbb5-0x136;const _0x269762=a49_0x2697();let _0x4b6726=_0x269762[_0x18dbb5];return _0x4b6726;}export function buildDataCommand(_0x35b57e){const _0x25460a=a49_0x4b67,_0x10239a='Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon).\x20Resolves\x20to\x20dataset\x20code\x20automatically';return{'service':_0x25460a(0x13c),'command':_0x35b57e[_0x25460a(0x14d)],'description':_0x35b57e['description'],'risk':_0x25460a(0x153),'defaultOutputFormat':_0x25460a(0x14e),'helpExtra':_0x35b57e[_0x25460a(0x13e)],'flags':[CODE_FLAG,APPCODE_FLAG_OPTIONAL,{'name':'alias','type':_0x25460a(0x14b),'description':_0x10239a},{'name':_0x25460a(0x141),'type':_0x25460a(0x14b),'description':_0x35b57e[_0x25460a(0x147)]}],async 'validate'(_0x557689){const _0x34055a=_0x25460a,_0x508445=_0x557689[_0x34055a(0x13d)](_0x34055a(0x141));if(_0x35b57e[_0x34055a(0x14c)]&&!_0x508445)throw CliErrors[_0x34055a(0x142)](_0x34055a(0x141),_0x35b57e[_0x34055a(0x147)]);const _0x169497=parseJsonParams(_0x508445);_0x35b57e['operation']==='getOne'&&assertGetOneId(_0x169497);},async 'execute'(_0x441706){const _0x148c1e=_0x25460a,_0x583a4f=parseCommandParams(_0x441706[_0x148c1e(0x13d)](_0x148c1e(0x141))),_0x31af16=Date[_0x148c1e(0x14a)](),_0x50a535=await executeDatasetDataOperation(_0x441706['appCode'],_0x441706[_0x148c1e(0x13d)](_0x148c1e(0x149)),_0x35b57e[_0x148c1e(0x152)],_0x583a4f),_0x28e69e=Date['now']()-_0x31af16;return{'ok':!![],'data':{'result':_0x50a535,'elapsed':_0x28e69e},'message':_0x148c1e(0x140)+_0x35b57e['command']+_0x148c1e(0x13a)+_0x28e69e+'ms'};}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a50_0x5ad604=a50_0x1ce9;function a50_0xd20c(){const _0x349102=['6KiuKmP','object','357994qQjNWL','trim','dbtable','toUpperCase','1310gqtPmB','getOne','lovrabet','\x20的\x20DB_TABLE\x20数据源上下文。','1015wgySJJ','name','33102EtUWsT','UNKNOWN','2328OHzbma','dbtableConfig','dbId','source','unknown','请先将该数据集升级/迁移为\x20DB_TABLE\x20数据集,再基于新的\x20dataset\x20code\x20继续开发。','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27\x20--format\x20compress','160762TmUsVE','1455556PRCiHp','tableName','length','dataset','如果只是查看运行态真实行数据,请切换到\x20lovrabet\x20CLI:','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27<json>\x27\x20--format\x20compress','Use\x20lovrabet\x20data\x20filter/getOne\x20for\x20real\x20runtime\x20records.','1460555wXFleM','2362877pCjnSb','9nZyKRF','sourceType','\x20是\x20','join','METADATA','当前数据集\x20\x22','\x20类型,没有可用于\x20','modelCode','datasetName','filter'];a50_0xd20c=function(){return _0x349102;};return a50_0xd20c();}(function(_0x3dc151,_0x4560e4){const _0x272adc=a50_0x1ce9,_0x10e729=_0x3dc151();while(!![]){try{const _0x2be15c=parseInt(_0x272adc(0x129))/0x1+parseInt(_0x272adc(0x13c))/0x2*(parseInt(_0x272adc(0x11d))/0x3)+-parseInt(_0x272adc(0x13d))/0x4+-parseInt(_0x272adc(0x11b))/0x5*(parseInt(_0x272adc(0x127))/0x6)+-parseInt(_0x272adc(0x131))/0x7*(-parseInt(_0x272adc(0x135))/0x8)+-parseInt(_0x272adc(0x133))/0x9*(-parseInt(_0x272adc(0x12d))/0xa)+-parseInt(_0x272adc(0x11c))/0xb;if(_0x2be15c===_0x4560e4)break;else _0x10e729['push'](_0x10e729['shift']());}catch(_0x396eae){_0x10e729['push'](_0x10e729['shift']());}}}(a50_0xd20c,0x3d9b7));import{CliErrors}from'../../errors.js';function a50_0x1ce9(_0x161787,_0xaf8144){_0x161787=_0x161787-0x119;const _0xd20c54=a50_0xd20c();let _0x1ce9b4=_0xd20c54[_0x161787];return _0x1ce9b4;}export const RUNTIME_DATA_ACCESS_COMMANDS={'cli':a50_0x5ad604(0x12f),'filter':a50_0x5ad604(0x119),'getOne':a50_0x5ad604(0x13b)};export const RUNTIME_DATA_ACCESS_SUMMARY=a50_0x5ad604(0x11a);function valueToString(_0x11ddd9){const _0x15a2ec=a50_0x5ad604;return _0x11ddd9==null?'':String(_0x11ddd9)[_0x15a2ec(0x12a)]();}function getDatasetCode(_0x3201b2){const _0x1aae22=a50_0x5ad604;return valueToString(_0x3201b2['code']??_0x3201b2[_0x1aae22(0x124)]??_0x3201b2[_0x1aae22(0x140)]?.['datasetCode']);}function getDatasetName(_0x1e1824){const _0xc3b88b=a50_0x5ad604;return valueToString(_0x1e1824[_0xc3b88b(0x132)]??_0x1e1824[_0xc3b88b(0x140)]?.[_0xc3b88b(0x125)])||_0xc3b88b(0x139);}function getDatasetSource(_0x4a1ef6){const _0x2438b2=a50_0x5ad604;return valueToString(_0x4a1ef6[_0x2438b2(0x138)]??_0x4a1ef6['dataset']?.[_0x2438b2(0x11e)])[_0x2438b2(0x12c)]();}function getDbtableConfig(_0x305301){const _0x3f9aea=a50_0x5ad604,_0x4c4070=_0x305301[_0x3f9aea(0x136)]??_0x305301[_0x3f9aea(0x12b)];return _0x4c4070&&typeof _0x4c4070===_0x3f9aea(0x128)?_0x4c4070:{};}export function isDbTableBackedDataset(_0x1d05af){const _0x3681b6=a50_0x5ad604,_0x5895b0=getDatasetSource(_0x1d05af);if(_0x5895b0===_0x3681b6(0x121))return![];const _0x5797cb=getDbtableConfig(_0x1d05af),_0x578097=_0x5797cb[_0x3681b6(0x137)]??_0x5797cb['id'],_0x13c43b=valueToString(_0x5797cb[_0x3681b6(0x13e)]??_0x1d05af[_0x3681b6(0x13e)]??_0x1d05af['dataset']?.[_0x3681b6(0x13e)]);return _0x578097!==undefined&&_0x578097!==null&&_0x13c43b[_0x3681b6(0x13f)]>0x0;}export function filterDbTableBackedDatasets(_0x38e69d){const _0x1be1b1=a50_0x5ad604;return _0x38e69d[_0x1be1b1(0x126)](_0x10f926=>isDbTableBackedDataset(_0x10f926));}export function buildDbTableBackedRequirementMessage(_0x5f2897,_0x58dbb0='SQL\x20schema\x20validation'){const _0x5e0936=a50_0x5ad604,_0x518a2b=getDatasetSource(_0x5f2897)||_0x5e0936(0x134),_0x24d322=getDatasetName(_0x5f2897),_0x5c2e17=getDatasetCode(_0x5f2897),_0x885254=_0x5c2e17?'\x20('+_0x5c2e17+')':'';return[_0x5e0936(0x122)+_0x24d322+'\x22'+_0x885254+_0x5e0936(0x11f)+_0x518a2b+_0x5e0936(0x123)+_0x58dbb0+_0x5e0936(0x130),'原因:schema\x20introspection\x20与\x20custom\x20SQL\x20需要\x20source=DB_TABLE、dbtableConfig.dbId、dbtableConfig.tableName\x20与数据库连接上下文。',_0x5e0936(0x13a),_0x5e0936(0x141)+RUNTIME_DATA_ACCESS_COMMANDS[_0x5e0936(0x126)]+';'+RUNTIME_DATA_ACCESS_COMMANDS[_0x5e0936(0x12e)]+'。'][_0x5e0936(0x120)]('\x20');}export function assertDatasetIsDbTableBacked(_0x506a30,_0x3f57b4){if(!isDbTableBackedDataset(_0x506a30))throw CliErrors['validation'](buildDbTableBackedRequirementMessage(_0x506a30,_0x3f57b4));}
|