@lovrabet/rabetbase-cli 2.1.14-beta.2 → 2.1.14-beta.3
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/link-create.js +1 -1
- package/lib/commands/dataset/link-delete.js +1 -1
- package/lib/commands/dataset/link-shared.js +1 -1
- package/lib/commands/dataset/link-update.js +1 -1
- package/lib/commands/dataset/links.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.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/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/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/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a141_0x50ffaf=a141_0x2515;(function(_0x341e31,_0xc86687){const _0x20092a=a141_0x2515,_0x3c0c32=_0x341e31();while(!![]){try{const _0xde309a=parseInt(_0x20092a(0x163))/0x1+-parseInt(_0x20092a(0x127))/0x2+parseInt(_0x20092a(0x135))/0x3+-parseInt(_0x20092a(0x124))/0x4*(parseInt(_0x20092a(0x15a))/0x5)+-parseInt(_0x20092a(0x136))/0x6*(-parseInt(_0x20092a(0x129))/0x7)+parseInt(_0x20092a(0x15b))/0x8+-parseInt(_0x20092a(0x143))/0x9;if(_0xde309a===_0xc86687)break;else _0x3c0c32['push'](_0x3c0c32['shift']());}catch(_0x11dbbf){_0x3c0c32['push'](_0x3c0c32['shift']());}}}(a141_0x5ea4,0x39561));import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';import{resolve,dirname,parse}from'node:path';import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{getIsSessionValid}from'./auth/is-session-valid.js';import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'./constant/defaults.js';import{normalizeEnv,isDaily}from'./constant/env.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0x23f3af){return process.env[`RABETBASE_${_0x23f3af}`]||process.env[`LOVRABET_${_0x23f3af}`]||undefined;}export const NEW_CONFIG_NAME=a141_0x50ffaf(0x12c);export const CONFIG_NAMES=[a141_0x50ffaf(0x12c),a141_0x50ffaf(0x142),a141_0x50ffaf(0x156)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES['filter'](_0x54fe3a=>_0x54fe3a!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x486b18){for(const _0x579fa3 of CONFIG_NAMES){const _0x5acf64=resolve(_0x486b18,_0x579fa3);if(existsSync(_0x5acf64))return _0x5acf64;}return undefined;}export function findProjectRootDirectory(_0x2dde0c=process[a141_0x50ffaf(0x14d)]()){let _0x17b5dd=resolve(_0x2dde0c);const {root:_0x2e2448}=parse(_0x17b5dd),_0x557966=homedir();while(!![]){if(resolveConfigPath(_0x17b5dd)){if(_0x17b5dd===_0x557966)break;return _0x17b5dd;}if(_0x17b5dd===_0x2e2448||_0x17b5dd===_0x557966)break;const _0x4cae5e=dirname(_0x17b5dd);if(_0x4cae5e===_0x17b5dd)break;_0x17b5dd=_0x4cae5e;}return resolve(_0x2dde0c);}export async function createContext(_0x5ad476){const _0x1bf117=a141_0x50ffaf,_0x346e5=readRawConfig(),_0x8a4743=buildConfig(_0x346e5,_0x5ad476),{initEnv:_0x55de93}=await import(_0x1bf117(0x128));if(_0x8a4743[_0x1bf117(0x16e)])_0x55de93(_0x8a4743[_0x1bf117(0x16e)]);else _0x5ad476[_0x1bf117(0x16e)]&&typeof _0x5ad476[_0x1bf117(0x16e)]==='string'&&_0x55de93(_0x5ad476[_0x1bf117(0x16e)]);const {initDomains:_0x2bba3a,getUserDomain:_0x1426df,getApiDomain:_0x26ebee}=await import('./constant/domain.js');_0x2bba3a({'apiDomain':_0x346e5['apiDomain']||undefined,'userDomain':_0x346e5[_0x1bf117(0x130)]||undefined,'runtimeDomain':_0x346e5[_0x1bf117(0x13e)]||undefined});const _0x43cb3c={'apiDomain':_0x26ebee(),'userDomain':_0x1426df()},_0xb9434a=await buildAuth(_0x8a4743);logger[_0x1bf117(0x172)](process[_0x1bf117(0x14d)]());const _0x30d720=(CLI_BIN_NAME+'\x20'+process['argv'][_0x1bf117(0x171)](0x2)[_0x1bf117(0x158)]('\x20'))[_0x1bf117(0x15d)]();logger[_0x1bf117(0x125)](_0x30d720);const {isNonInteractive:_0x435d60}=await import(_0x1bf117(0x141)),_0x2cefcd=_0x435d60(_0x5ad476);return{'config':_0x8a4743,'auth':_0xb9434a,'logger':logger,'env':_0x43cb3c,'nonInteractive':_0x2cefcd};}export function buildConfigFromFlags(_0x1c9b04){return buildConfig(readRawConfig(),_0x1c9b04);}export function getProjectConfigPath(){const _0x4f004=a141_0x50ffaf;return resolveConfigPath(process[_0x4f004(0x14d)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0xbdc5df){const _0x31e331=a141_0x50ffaf;if(!existsSync(_0xbdc5df))return{'status':_0x31e331(0x153)};try{const _0x5e1fce=readFileSync(_0xbdc5df,{'encoding':_0x31e331(0x150)});if(!_0x5e1fce?.['trim']())return{'status':_0x31e331(0x14f)};const _0x5743d2=JSON[_0x31e331(0x15e)](_0x5e1fce);return{'status':'ok','data':_0x5743d2};}catch(_0x239a9c){return{'status':_0x31e331(0x16b),'message':_0x239a9c instanceof Error?_0x239a9c[_0x31e331(0x14b)]:String(_0x239a9c)};}}function parseCliConfigJsonFile(_0x2f0538,_0x1983a3,_0x31ca48){const _0x304d96=a141_0x50ffaf,_0x1f36da=inspectCliConfigJsonFile(_0x2f0538);if(_0x1f36da[_0x304d96(0x166)]===_0x304d96(0x153)||_0x1f36da[_0x304d96(0x166)]===_0x304d96(0x14f))return{};if(_0x1f36da[_0x304d96(0x166)]==='ok')return _0x1f36da[_0x304d96(0x134)];return _0x1983a3===_0x304d96(0x170)&&_0x31ca48&&console[_0x304d96(0x16b)](CLI_BIN_NAME+':\x20'+_0x31ca48+_0x304d96(0x16f)+_0x2f0538+'\x0a\x20\x20'+_0x1f36da[_0x304d96(0x14b)]),{};}const normalizedWriteCache=new Map();function normalizeLegacyConfigShape(_0x47d6c2){const _0x17ce31=a141_0x50ffaf;if(!_0x47d6c2||typeof _0x47d6c2!==_0x17ce31(0x147))return{'config':{},'migrated':![]};const _0x2a8d12={..._0x47d6c2},_0x53a57b=_0x2a8d12[_0x17ce31(0x13f)]&&typeof _0x2a8d12[_0x17ce31(0x13f)]===_0x17ce31(0x147)?{..._0x2a8d12[_0x17ce31(0x13f)]}:{},_0x247175=Object['keys'](_0x53a57b)[_0x17ce31(0x131)],_0x5ed063=_0x2a8d12[_0x17ce31(0x159)]||_0x2a8d12[_0x17ce31(0x160)];let _0x1d4b8b=![];if(_0x5ed063&&_0x247175===0x0){const _0x11754e=typeof _0x2a8d12['defaultApp']===_0x17ce31(0x157)&&_0x2a8d12['defaultApp'][_0x17ce31(0x15d)]()?_0x2a8d12[_0x17ce31(0x12f)]:String(_0x5ed063)[_0x17ce31(0x15d)]();_0x53a57b[_0x11754e]={'appcode':String(_0x5ed063)['trim'](),..._0x2a8d12[_0x17ce31(0x16e)]!=null?{'env':_0x2a8d12[_0x17ce31(0x16e)]}:{},..._0x2a8d12[_0x17ce31(0x132)]!=null?{'apiDir':_0x2a8d12['apiDir']}:{},..._0x2a8d12[_0x17ce31(0x168)]!=null?{'cookie':_0x2a8d12['cookie']}:{},..._0x2a8d12[_0x17ce31(0x16d)]!=null?{'accessKey':_0x2a8d12[_0x17ce31(0x16d)]}:{},..._0x2a8d12[_0x17ce31(0x138)]!=null?{'format':_0x2a8d12[_0x17ce31(0x138)]}:{},..._0x2a8d12['pageSize']!=null?{'pageSize':_0x2a8d12[_0x17ce31(0x13b)]}:{},..._0x2a8d12['riskLevel']!=null?{'riskLevel':_0x2a8d12['riskLevel']}:{},..._0x2a8d12[_0x17ce31(0x13c)]!=null?{'locale':_0x2a8d12['locale']}:{}},_0x2a8d12['apps']=_0x53a57b;if(!_0x2a8d12['defaultApp'])_0x2a8d12[_0x17ce31(0x12f)]=_0x11754e;_0x1d4b8b=!![];}return('appcode'in _0x2a8d12||_0x17ce31(0x160)in _0x2a8d12)&&(delete _0x2a8d12[_0x17ce31(0x159)],delete _0x2a8d12[_0x17ce31(0x160)],_0x1d4b8b=!![]),{'config':_0x2a8d12,'migrated':_0x1d4b8b};}function writeNormalizedConfigIfNeeded(_0x3c5224,_0x14ffc7){const _0x1a0f4e=a141_0x50ffaf,_0x5e83ae=JSON[_0x1a0f4e(0x14c)](_0x14ffc7,null,0x2)+'\x0a';if(normalizedWriteCache[_0x1a0f4e(0x12d)](_0x3c5224)===_0x5e83ae)return;writeConfigFile(_0x3c5224,_0x14ffc7),normalizedWriteCache[_0x1a0f4e(0x12a)](_0x3c5224,_0x5e83ae);}function parseAndNormalizeConfig(_0xadd38,_0x4cd835,_0xcd7acc){const _0x10f02a=a141_0x50ffaf,_0x52fabb=parseCliConfigJsonFile(_0xadd38,_0x4cd835,_0xcd7acc),_0x5e0dbc=normalizeLegacyConfigShape(_0x52fabb);if(_0x5e0dbc['migrated'])try{writeNormalizedConfigIfNeeded(_0xadd38,_0x5e0dbc[_0x10f02a(0x149)]);}catch{}return _0x5e0dbc[_0x10f02a(0x149)];}export function loadRawConfigLayers(_0x133326){const _0x43c52d=a141_0x50ffaf;let _0xc9e845={},_0x5ed6ef={};const _0x148102=resolveConfigPath(homedir());_0x148102&&(_0xc9e845=parseAndNormalizeConfig(_0x148102,'warn',_0x43c52d(0x13d)));const _0x2ac84e=_0x133326??findProjectRootDirectory(),_0x123f97=resolveConfigPath(_0x2ac84e);return _0x123f97&&(_0x5ed6ef=parseAndNormalizeConfig(_0x123f97,_0x43c52d(0x170),_0x43c52d(0x14e))),{'globalPath':_0x148102,'projectPath':_0x123f97,'globalConfig':_0xc9e845,'projectConfig':_0x5ed6ef};}const INHERIT_WHITELIST=[a141_0x50ffaf(0x168),a141_0x50ffaf(0x16d),a141_0x50ffaf(0x13c),a141_0x50ffaf(0x138),a141_0x50ffaf(0x16c),'pageSize'];function mergeRawConfigLayers(_0x4bd10d){const _0x1f8743=a141_0x50ffaf,{globalConfig:_0x94445b,projectConfig:_0xcdb4ef}=_0x4bd10d,_0x4e315f=Object[_0x1f8743(0x14a)](_0xcdb4ef)[_0x1f8743(0x131)]>0x0;if(!_0x4e315f)return mergeGlobalOnly(_0x94445b);if(_0xcdb4ef[_0x1f8743(0x144)]===!![])return mergeFullInherit(_0x94445b,_0xcdb4ef);if(_0xcdb4ef[_0x1f8743(0x144)]===![])return mergeIsolated(_0xcdb4ef);return mergeProjectFirst(_0x94445b,_0xcdb4ef);}function mergeGlobalOnly(_0x3ebd53){const _0x495241=a141_0x50ffaf,_0x49979d={..._0x3ebd53},_0x38ad14=_0x3ebd53['apps']&&typeof _0x3ebd53[_0x495241(0x13f)]==='object'?_0x3ebd53['apps']:{};Object[_0x495241(0x14a)](_0x38ad14)[_0x495241(0x131)]>0x0&&(_0x49979d[_0x495241(0x13f)]=_0x38ad14);if(_0x3ebd53[_0x495241(0x12f)])_0x49979d[_0x495241(0x12f)]=_0x3ebd53[_0x495241(0x12f)];else{const _0x19ed47=Object[_0x495241(0x14a)](_0x38ad14);if(_0x19ed47[_0x495241(0x131)]>0x0)_0x49979d[_0x495241(0x12f)]=_0x19ed47[0x0];}return _0x49979d;}function a141_0x2515(_0x160251,_0xa5a80d){_0x160251=_0x160251-0x122;const _0x5ea470=a141_0x5ea4();let _0x2515ac=_0x5ea470[_0x160251];return _0x2515ac;}function mergeIsolated(_0x38b8ea){const _0xc22333=a141_0x50ffaf,_0x636028={..._0x38b8ea};delete _0x636028[_0xc22333(0x144)];const _0x20e6b7=_0x38b8ea[_0xc22333(0x13f)]&&typeof _0x38b8ea[_0xc22333(0x13f)]===_0xc22333(0x147)?_0x38b8ea[_0xc22333(0x13f)]:{};Object[_0xc22333(0x14a)](_0x20e6b7)['length']>0x0?_0x636028[_0xc22333(0x13f)]=_0x20e6b7:delete _0x636028[_0xc22333(0x13f)];if('defaultApp'in _0x38b8ea)_0x636028[_0xc22333(0x12f)]=_0x38b8ea[_0xc22333(0x12f)];else Object['keys'](_0x20e6b7)[_0xc22333(0x131)]>0x0?_0x636028[_0xc22333(0x12f)]=Object[_0xc22333(0x14a)](_0x20e6b7)[0x0]:delete _0x636028[_0xc22333(0x12f)];return _0x636028;}function mergeProjectFirst(_0x53044c,_0x28caee){const _0x4d5aae=a141_0x50ffaf,_0x5ea34d={..._0x28caee};delete _0x5ea34d[_0x4d5aae(0x144)];for(const _0x2a3eec of INHERIT_WHITELIST){!(_0x2a3eec in _0x5ea34d)&&_0x2a3eec in _0x53044c&&(_0x5ea34d[_0x2a3eec]=_0x53044c[_0x2a3eec]);}const _0x13aefe=_0x28caee[_0x4d5aae(0x13f)]&&typeof _0x28caee['apps']===_0x4d5aae(0x147)?_0x28caee['apps']:{};Object[_0x4d5aae(0x14a)](_0x13aefe)[_0x4d5aae(0x131)]>0x0?_0x5ea34d[_0x4d5aae(0x13f)]=_0x13aefe:delete _0x5ea34d[_0x4d5aae(0x13f)];if(_0x4d5aae(0x12f)in _0x28caee)_0x5ea34d[_0x4d5aae(0x12f)]=_0x28caee['defaultApp'];else Object['keys'](_0x13aefe)[_0x4d5aae(0x131)]>0x0?_0x5ea34d['defaultApp']=Object[_0x4d5aae(0x14a)](_0x13aefe)[0x0]:delete _0x5ea34d[_0x4d5aae(0x12f)];return _0x5ea34d;}function mergeFullInherit(_0x1a4d22,_0x3d7a64){const _0x53af34=a141_0x50ffaf,_0x20c813=_0x1a4d22[_0x53af34(0x13f)]&&typeof _0x1a4d22[_0x53af34(0x13f)]===_0x53af34(0x147)?_0x1a4d22['apps']:{},_0x1cc0dd=_0x3d7a64['apps']&&typeof _0x3d7a64[_0x53af34(0x13f)]==='object'?_0x3d7a64[_0x53af34(0x13f)]:{},_0x450f7e={..._0x20c813,..._0x1cc0dd},_0x2b3d96={..._0x1a4d22,..._0x3d7a64};delete _0x2b3d96[_0x53af34(0x144)];Object['keys'](_0x450f7e)[_0x53af34(0x131)]>0x0&&(_0x2b3d96[_0x53af34(0x13f)]=_0x450f7e);if(_0x53af34(0x12f)in _0x3d7a64)_0x2b3d96['defaultApp']=_0x3d7a64[_0x53af34(0x12f)];else{if(Object[_0x53af34(0x14a)](_0x1cc0dd)[_0x53af34(0x131)]>0x0)_0x2b3d96['defaultApp']=Object[_0x53af34(0x14a)](_0x1cc0dd)[0x0];else{if(_0x1a4d22[_0x53af34(0x12f)])_0x2b3d96['defaultApp']=_0x1a4d22[_0x53af34(0x12f)];else{const _0x14149b=Object[_0x53af34(0x14a)](_0x20c813);if(_0x14149b[_0x53af34(0x131)]>0x0)_0x2b3d96[_0x53af34(0x12f)]=_0x14149b[0x0];}}}return _0x2b3d96;}export function readRawConfigWithLayers(_0x44d967){const _0xc253d3=loadRawConfigLayers(_0x44d967);return{'config':mergeRawConfigLayers(_0xc253d3),'layers':_0xc253d3};}export function readRawConfig(_0x3af1ad){return mergeRawConfigLayers(loadRawConfigLayers(_0x3af1ad));}export function getConfigAppCode(_0x4909d4){const _0x450d81=a141_0x50ffaf,_0x38fd37=readRawConfig(_0x4909d4);if(_0x38fd37['apps']&&typeof _0x38fd37['apps']===_0x450d81(0x147)){const _0x1fd387=_0x38fd37['defaultApp'];if(_0x1fd387&&_0x38fd37[_0x450d81(0x13f)][_0x1fd387]?.['appcode'])return String(_0x38fd37[_0x450d81(0x13f)][_0x1fd387][_0x450d81(0x159)])['trim']();const _0x1ac2ad=Object['values'](_0x38fd37['apps'])[0x0];if(_0x1ac2ad?.[_0x450d81(0x159)])return String(_0x1ac2ad[_0x450d81(0x159)])[_0x450d81(0x15d)]();}const _0x5caee0=_0x38fd37[_0x450d81(0x159)]||_0x38fd37['app'];if(typeof _0x5caee0!==_0x450d81(0x157)||_0x5caee0[_0x450d81(0x15d)]()==='')return undefined;return _0x5caee0['trim']();}export function getMultiAppConfigs(_0x317515=a141_0x50ffaf(0x155),_0x355aba){const _0x449620=a141_0x50ffaf,_0x1258af=loadRawConfigLayers(_0x355aba);let _0x4cbbeb,_0x5bbf04;if(_0x317515==='merged'){const _0x969479=_0x1258af[_0x449620(0x154)][_0x449620(0x13f)]&&typeof _0x1258af[_0x449620(0x154)][_0x449620(0x13f)]==='object'?_0x1258af[_0x449620(0x154)][_0x449620(0x13f)]:{},_0x12f4f7=_0x1258af[_0x449620(0x146)]['apps']&&typeof _0x1258af[_0x449620(0x146)][_0x449620(0x13f)]==='object'?_0x1258af[_0x449620(0x146)][_0x449620(0x13f)]:{};_0x4cbbeb={..._0x969479,..._0x12f4f7};const _0x21bd1e=readRawConfig(_0x355aba);_0x5bbf04=_0x21bd1e[_0x449620(0x12f)];}else _0x4cbbeb=_0x1258af[_0x449620(0x146)][_0x449620(0x13f)],_0x5bbf04=_0x1258af['projectConfig'][_0x449620(0x12f)];if(!_0x4cbbeb||typeof _0x4cbbeb!==_0x449620(0x147)||Object[_0x449620(0x14a)](_0x4cbbeb)[_0x449620(0x131)]===0x0)return null;return Object[_0x449620(0x126)](_0x4cbbeb)[_0x449620(0x148)](([_0x4420ad,_0xc98f29])=>({'name':_0x4420ad,'appcode':_0xc98f29?.[_0x449620(0x159)]||'','isDefault':_0x4420ad===_0x5bbf04,'env':_0xc98f29?.[_0x449620(0x16e)],'apiDir':_0xc98f29?.[_0x449620(0x132)],'cookie':_0xc98f29?.[_0x449620(0x168)]||undefined}))[_0x449620(0x164)](_0x53aa27=>_0x53aa27[_0x449620(0x159)]);}export function getTemplateBaseUrl(_0x5563d9){const _0x5ce0c3=a141_0x50ffaf,_0x195d24=readRawConfig(_0x5563d9);if(_0x195d24[_0x5ce0c3(0x140)]&&typeof _0x195d24['template_base_url']==='string')return _0x195d24['template_base_url'][_0x5ce0c3(0x167)](/\/$/,'');return _0x5ce0c3(0x174);}export function readConfigFile(_0x52621a){const _0xba55ff=a141_0x50ffaf;return parseAndNormalizeConfig(_0x52621a,_0xba55ff(0x145));}export function writeConfigFile(_0x4993c1,_0x9b8427){const _0x2aa4c7=a141_0x50ffaf,_0x48fbbd=dirname(_0x4993c1);!existsSync(_0x48fbbd)&&mkdirSync(_0x48fbbd,{'recursive':!![]});const _0x3f12b5=_0x4993c1+_0x2aa4c7(0x173);try{writeFileSync(_0x3f12b5,JSON[_0x2aa4c7(0x14c)](_0x9b8427,null,0x2)+'\x0a',{'encoding':_0x2aa4c7(0x150),'mode':0x180}),renameSync(_0x3f12b5,_0x4993c1);}catch(_0x515845){try{unlinkSync(_0x3f12b5);}catch{}throw _0x515845;}}export function resolveWriteConfigPath(_0x2396a3){const _0x5802a2=a141_0x50ffaf,_0x23cf96=_0x2396a3===_0x5802a2(0x155)?process[_0x5802a2(0x14d)]():homedir(),_0x322217=resolveConfigPath(_0x23cf96);return _0x322217??resolve(_0x23cf96,NEW_CONFIG_NAME);}function buildConfig(_0x594204,_0x4855a7){const _0x3ecd74=a141_0x50ffaf,_0x1a30cd={};if(_0x594204[_0x3ecd74(0x13f)]&&typeof _0x594204['apps']==='object')for(const [_0x221098,_0x2128bf]of Object['entries'](_0x594204['apps'])){_0x2128bf&&typeof _0x2128bf===_0x3ecd74(0x147)&&_0x2128bf['appcode']&&(_0x1a30cd[_0x221098]=_0x2128bf);}const _0x59b89e=_0x594204[_0x3ecd74(0x12f)]||undefined,_0x19d65c=Object[_0x3ecd74(0x14a)](_0x1a30cd)[_0x3ecd74(0x131)]>0x0,_0x5cf103=_0x4855a7[_0x3ecd74(0x160)]||env(_0x3ecd74(0x123))||undefined,_0x1c1d92=_0x5cf103||_0x59b89e||undefined,_0x236a14=_0x4855a7[_0x3ecd74(0x159)]||env(_0x3ecd74(0x122))||undefined,_0x87ab00=_0x236a14?Object['entries'](_0x1a30cd)[_0x3ecd74(0x16a)](([,_0x5d0792])=>_0x5d0792?.[_0x3ecd74(0x159)]===_0x236a14):undefined,_0x244771=_0x87ab00?.[0x0],_0x486813=_0x87ab00?.[0x1];let _0x111be0=_0x236a14?_0x244771:_0x1c1d92,_0x5609ae=_0x111be0&&_0x1a30cd[_0x111be0]?_0x1a30cd[_0x111be0]:undefined;_0x236a14&&_0x486813&&(_0x5609ae=_0x486813);const _0x3499fc=_0x236a14?_0x486813??_0x5609ae:_0x5609ae,_0x3dd7c1=_0x5cf103||(_0x236a14?_0x244771:undefined),_0x4df961=_0x236a14||_0x3499fc?.[_0x3ecd74(0x159)]||undefined,_0x2d80e1=_0x4855a7[_0x3ecd74(0x16e)]||env(_0x3ecd74(0x15f))||_0x3499fc?.['env']||_0x594204[_0x3ecd74(0x16e)]||DEFAULT_CONFIG_VALUES[_0x3ecd74(0x16e)],_0x5ae012=_0x3499fc?.[_0x3ecd74(0x13c)]||_0x594204['locale']||DEFAULT_CONFIG_VALUES[_0x3ecd74(0x13c)],_0x2b11b1=env(_0x3ecd74(0x161))||_0x3499fc?.['cookie']||_0x594204['cookie']||undefined,_0x3baf43=env(_0x3ecd74(0x13a))||_0x3499fc?.[_0x3ecd74(0x16d)]||_0x594204[_0x3ecd74(0x16d)]||undefined,_0x1731bd=_0x4855a7[_0x3ecd74(0x138)]||env('FORMAT')||_0x3499fc?.['format']||_0x594204['format'],_0x23e3d5=normalizeLegacyOutputFormat(_0x1731bd),_0x369b41=env(_0x3ecd74(0x165))||_0x3499fc?.[_0x3ecd74(0x13b)]||_0x594204[_0x3ecd74(0x13b)],_0x3494f2=_0x369b41?Number(_0x369b41)||undefined:undefined,_0x5baac6=env(_0x3ecd74(0x151))||env(_0x3ecd74(0x12b))||_0x3499fc?.[_0x3ecd74(0x16c)]||_0x594204[_0x3ecd74(0x16c)]||_0x594204[_0x3ecd74(0x152)],_0x37195a=_0x5baac6===_0x3ecd74(0x169)||_0x5baac6===_0x3ecd74(0x162)?_0x5baac6:DEFAULT_CONFIG_VALUES[_0x3ecd74(0x16c)],_0x1c3e8c=env(_0x3ecd74(0x139)),_0x55297b=_0x1c3e8c==='1'||_0x1c3e8c===_0x3ecd74(0x12e),_0x2cd003=_0x3499fc?.[_0x3ecd74(0x132)]||_0x594204[_0x3ecd74(0x132)]||DEFAULT_CONFIG_VALUES[_0x3ecd74(0x132)],_0x554b32=isDaily(normalizeEnv(String(_0x2d80e1)))?'daily':_0x3ecd74(0x137);return{'appCode':typeof _0x4df961==='string'&&_0x4df961['trim']()?_0x4df961[_0x3ecd74(0x15d)]():undefined,'env':_0x554b32,'locale':_0x5ae012,'cookie':_0x2b11b1,'accessKey':_0x3baf43,'format':_0x23e3d5,'pageSize':_0x3494f2,'riskLevel':_0x37195a,'verbose':_0x55297b,'apiDir':_0x2cd003,'apps':_0x1a30cd,'defaultApp':_0x59b89e,'currentApp':_0x19d65c?_0x111be0:undefined,'explicitAppName':_0x3dd7c1,'raw':_0x594204};}async function buildAuth(_0x5eb7b9){const {getCookie:_0x5c61ec}=await import('./auth/get-cookie.js'),_0x345f2f=_0x5eb7b9['cookie']||_0x5c61ec(),_0x556611=_0x345f2f?await getIsSessionValid():![];return{'cookie':_0x345f2f,'isLoggedIn':_0x556611,async 'getOrLogin'(){const _0x56b288=a141_0x2515;if(_0x345f2f&&_0x556611)return _0x345f2f;throw CliErrors[_0x56b288(0x133)]();}};}function a141_0x5ea4(){const _0x50b587=['data','475713QlboKq','6WqFNwY','production','format','VERBOSE','ACCESS_KEY','pageSize','locale','Global','runtimeDomain','apps','template_base_url','./utils/is-non-interactive.js','.lovrabet.json','3645387pjKcda','inherit','silent','projectConfig','object','map','config','keys','message','stringify','cwd','Project','empty','utf8','RISK_LEVEL','maxRisk','missing','globalConfig','project','.lovrabetrc','string','join','appcode','5QwgMQZ','3354624sLSxZS','api.ts','trim','parse','ENV','app','COOKIE','write','418604lcGYrm','filter','PAGE_SIZE','status','replace','cookie','read','find','error','riskLevel','accessKey','env','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','warn','slice','setLogPath','.tmp','https://g.lovrabet.com/dist/lovrabet-skill','APPCODE','APP','878664xBIjGC','setRawCommand','entries','509934YoXOaO','./constant/env.js','826154qukbUj','set','MAX_RISK','.rabetbase.json','get','true','defaultApp','userDomain','length','apiDir','authRequired'];a141_0x5ea4=function(){return _0x50b587;};return a141_0x5ea4();}export function resolveApiFilePath(_0x5f0a23,_0x50824f){const _0x3250bf=a141_0x50ffaf,_0x214e01=resolve(process['cwd'](),_0x5f0a23),_0x28ba64=resolve(_0x214e01,_0x3250bf(0x15c));if(!_0x50824f)return _0x28ba64;const _0x384ea8=readRawConfig(),_0x1c5f41=_0x384ea8[_0x3250bf(0x13f)]&&typeof _0x384ea8[_0x3250bf(0x13f)]===_0x3250bf(0x147)?_0x384ea8['apps']:{},_0x2acf73=Object[_0x3250bf(0x126)](_0x1c5f41)[_0x3250bf(0x16a)](([,_0x14b1f9])=>_0x14b1f9?.[_0x3250bf(0x159)]===_0x50824f);if(!_0x2acf73)return _0x28ba64;const [_0x40b612,_0x4cc0fe]=_0x2acf73,_0x4edec3=typeof _0x384ea8['defaultApp']===_0x3250bf(0x157)?_0x384ea8[_0x3250bf(0x12f)]:undefined;if(_0x4cc0fe?.[_0x3250bf(0x132)])return _0x28ba64;if(_0x4edec3&&_0x40b612!==_0x4edec3)return resolve(_0x214e01,_0x40b612+'-api.ts');return _0x28ba64;}
|
|
1
|
+
const a141_0x4372c9=a141_0x32f8;(function(_0x3e0cd2,_0x4adc26){const _0x5f1b2f=a141_0x32f8,_0x326c48=_0x3e0cd2();while(!![]){try{const _0x2e793f=-parseInt(_0x5f1b2f(0x21a))/0x1+-parseInt(_0x5f1b2f(0x1d5))/0x2*(-parseInt(_0x5f1b2f(0x1d8))/0x3)+-parseInt(_0x5f1b2f(0x1ec))/0x4*(-parseInt(_0x5f1b2f(0x214))/0x5)+parseInt(_0x5f1b2f(0x210))/0x6+-parseInt(_0x5f1b2f(0x1f8))/0x7+-parseInt(_0x5f1b2f(0x1db))/0x8+parseInt(_0x5f1b2f(0x1eb))/0x9;if(_0x2e793f===_0x4adc26)break;else _0x326c48['push'](_0x326c48['shift']());}catch(_0x1eb193){_0x326c48['push'](_0x326c48['shift']());}}}(a141_0x1a35,0x4e7e3));import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';import{resolve,dirname,parse}from'node:path';import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{getIsSessionValid}from'./auth/is-session-valid.js';import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'./constant/defaults.js';import{normalizeEnv,isDaily}from'./constant/env.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0x1e789c){return process.env[`RABETBASE_${_0x1e789c}`]||process.env[`LOVRABET_${_0x1e789c}`]||undefined;}export const NEW_CONFIG_NAME='.rabetbase.json';export const CONFIG_NAMES=[a141_0x4372c9(0x1df),a141_0x4372c9(0x1d2),'.lovrabetrc'];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a141_0x4372c9(0x1f9)](_0x359cc6=>_0x359cc6!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x3d46da){for(const _0x154e04 of CONFIG_NAMES){const _0x3012a3=resolve(_0x3d46da,_0x154e04);if(existsSync(_0x3012a3))return _0x3012a3;}return undefined;}function a141_0x1a35(){const _0x3ded56=['replace','112025eZjrPI','runtimeDomain','keys','./utils/is-non-interactive.js','entries','api.ts','453997esLXfl','silent','project','riskLevel','warn','string','userDomain','ACCESS_KEY','./constant/domain.js','map','.lovrabet.json','maxRisk','./auth/get-cookie.js','670024IaXFnx','projectConfig','env','3WoygVI','setLogPath','find','3855920ejfzSd','message','https://g.lovrabet.com/dist/lovrabet-skill','inherit','.rabetbase.json','config','true','PAGE_SIZE','set','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','migrated','authRequired','MAX_RISK','setRawCommand','missing','apiDir','10002141DoOGRe','8UPnolA','empty','status','app','read','APP','argv','trim','write','\x0a\x20\x20','values','length','3064411sMUVqP','filter','RISK_LEVEL','template_base_url','object','./constant/env.js','locale','get','format','VERBOSE','join','appcode','utf8','cwd','apps','pageSize','.tmp','stringify','cookie','defaultApp','merged','globalConfig','data','error','1224576NHUJfR','slice','accessKey'];a141_0x1a35=function(){return _0x3ded56;};return a141_0x1a35();}export function findProjectRootDirectory(_0x5b8d72=process[a141_0x4372c9(0x205)]()){let _0x31bd3e=resolve(_0x5b8d72);const {root:_0x1aafd9}=parse(_0x31bd3e),_0x264682=homedir();while(!![]){if(resolveConfigPath(_0x31bd3e)){if(_0x31bd3e===_0x264682)break;return _0x31bd3e;}if(_0x31bd3e===_0x1aafd9||_0x31bd3e===_0x264682)break;const _0x56aba5=dirname(_0x31bd3e);if(_0x56aba5===_0x31bd3e)break;_0x31bd3e=_0x56aba5;}return resolve(_0x5b8d72);}export async function createContext(_0x48d610){const _0x3c5e8f=a141_0x4372c9,_0x3cbb38=readRawConfig(),_0x527b74=buildConfig(_0x3cbb38,_0x48d610),{initEnv:_0x284d72}=await import(_0x3c5e8f(0x1fd));if(_0x527b74['env'])_0x284d72(_0x527b74[_0x3c5e8f(0x1d7)]);else _0x48d610[_0x3c5e8f(0x1d7)]&&typeof _0x48d610['env']===_0x3c5e8f(0x21f)&&_0x284d72(_0x48d610[_0x3c5e8f(0x1d7)]);const {initDomains:_0x4bc2e4,getUserDomain:_0x2ec5a9,getApiDomain:_0x5f0cc5}=await import(_0x3c5e8f(0x1d0));_0x4bc2e4({'apiDomain':_0x3cbb38['apiDomain']||undefined,'userDomain':_0x3cbb38[_0x3c5e8f(0x220)]||undefined,'runtimeDomain':_0x3cbb38[_0x3c5e8f(0x215)]||undefined});const _0x505c87={'apiDomain':_0x5f0cc5(),'userDomain':_0x2ec5a9()},_0x1366c4=await buildAuth(_0x527b74);logger[_0x3c5e8f(0x1d9)](process['cwd']());const _0x4f213b=(CLI_BIN_NAME+'\x20'+process[_0x3c5e8f(0x1f2)][_0x3c5e8f(0x211)](0x2)[_0x3c5e8f(0x202)]('\x20'))[_0x3c5e8f(0x1f3)]();logger[_0x3c5e8f(0x1e8)](_0x4f213b);const {isNonInteractive:_0x45a860}=await import(_0x3c5e8f(0x217)),_0x4e97b4=_0x45a860(_0x48d610);return{'config':_0x527b74,'auth':_0x1366c4,'logger':logger,'env':_0x505c87,'nonInteractive':_0x4e97b4};}export function buildConfigFromFlags(_0x4583f6){return buildConfig(readRawConfig(),_0x4583f6);}export function getProjectConfigPath(){const _0x3f8de9=a141_0x4372c9;return resolveConfigPath(process[_0x3f8de9(0x205)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x5a82e8){const _0x337b2c=a141_0x4372c9;if(!existsSync(_0x5a82e8))return{'status':_0x337b2c(0x1e9)};try{const _0x432444=readFileSync(_0x5a82e8,{'encoding':_0x337b2c(0x204)});if(!_0x432444?.[_0x337b2c(0x1f3)]())return{'status':'empty'};const _0x56ba44=JSON['parse'](_0x432444);return{'status':'ok','data':_0x56ba44};}catch(_0x190f73){return{'status':_0x337b2c(0x20f),'message':_0x190f73 instanceof Error?_0x190f73[_0x337b2c(0x1dc)]:String(_0x190f73)};}}function parseCliConfigJsonFile(_0x45bd2a,_0xb2ba5e,_0x4ef38e){const _0x5932a=a141_0x4372c9,_0x236178=inspectCliConfigJsonFile(_0x45bd2a);if(_0x236178[_0x5932a(0x1ee)]===_0x5932a(0x1e9)||_0x236178[_0x5932a(0x1ee)]===_0x5932a(0x1ed))return{};if(_0x236178['status']==='ok')return _0x236178[_0x5932a(0x20e)];return _0xb2ba5e===_0x5932a(0x21e)&&_0x4ef38e&&console[_0x5932a(0x20f)](CLI_BIN_NAME+':\x20'+_0x4ef38e+_0x5932a(0x1e4)+_0x45bd2a+_0x5932a(0x1f5)+_0x236178['message']),{};}const normalizedWriteCache=new Map();function normalizeLegacyConfigShape(_0x3a6b8b){const _0x5f23c1=a141_0x4372c9;if(!_0x3a6b8b||typeof _0x3a6b8b!==_0x5f23c1(0x1fc))return{'config':{},'migrated':![]};const _0x231bcf={..._0x3a6b8b},_0x15feb5=_0x231bcf[_0x5f23c1(0x206)]&&typeof _0x231bcf[_0x5f23c1(0x206)]===_0x5f23c1(0x1fc)?{..._0x231bcf[_0x5f23c1(0x206)]}:{},_0xe109fe=Object[_0x5f23c1(0x216)](_0x15feb5)['length'],_0x31b296=_0x231bcf[_0x5f23c1(0x203)]||_0x231bcf[_0x5f23c1(0x1ef)];let _0x54961a=![];if(_0x31b296&&_0xe109fe===0x0){const _0x2c4cfe=typeof _0x231bcf[_0x5f23c1(0x20b)]===_0x5f23c1(0x21f)&&_0x231bcf[_0x5f23c1(0x20b)][_0x5f23c1(0x1f3)]()?_0x231bcf[_0x5f23c1(0x20b)]:String(_0x31b296)['trim']();_0x15feb5[_0x2c4cfe]={'appcode':String(_0x31b296)[_0x5f23c1(0x1f3)](),..._0x231bcf[_0x5f23c1(0x1d7)]!=null?{'env':_0x231bcf[_0x5f23c1(0x1d7)]}:{},..._0x231bcf[_0x5f23c1(0x1ea)]!=null?{'apiDir':_0x231bcf[_0x5f23c1(0x1ea)]}:{},..._0x231bcf['cookie']!=null?{'cookie':_0x231bcf[_0x5f23c1(0x20a)]}:{},..._0x231bcf['accessKey']!=null?{'accessKey':_0x231bcf['accessKey']}:{},..._0x231bcf[_0x5f23c1(0x200)]!=null?{'format':_0x231bcf['format']}:{},..._0x231bcf[_0x5f23c1(0x207)]!=null?{'pageSize':_0x231bcf[_0x5f23c1(0x207)]}:{},..._0x231bcf[_0x5f23c1(0x21d)]!=null?{'riskLevel':_0x231bcf[_0x5f23c1(0x21d)]}:{},..._0x231bcf[_0x5f23c1(0x1fe)]!=null?{'locale':_0x231bcf[_0x5f23c1(0x1fe)]}:{}},_0x231bcf[_0x5f23c1(0x206)]=_0x15feb5;if(!_0x231bcf['defaultApp'])_0x231bcf[_0x5f23c1(0x20b)]=_0x2c4cfe;_0x54961a=!![];}return('appcode'in _0x231bcf||_0x5f23c1(0x1ef)in _0x231bcf)&&(delete _0x231bcf[_0x5f23c1(0x203)],delete _0x231bcf[_0x5f23c1(0x1ef)],_0x54961a=!![]),{'config':_0x231bcf,'migrated':_0x54961a};}function writeNormalizedConfigIfNeeded(_0x26d1bb,_0x3decbc){const _0x169623=a141_0x4372c9,_0x6a900=JSON[_0x169623(0x209)](_0x3decbc,null,0x2)+'\x0a';if(normalizedWriteCache[_0x169623(0x1ff)](_0x26d1bb)===_0x6a900)return;writeConfigFile(_0x26d1bb,_0x3decbc),normalizedWriteCache[_0x169623(0x1e3)](_0x26d1bb,_0x6a900);}function parseAndNormalizeConfig(_0xd9181,_0xbada4f,_0x507b59){const _0x3bc2fb=a141_0x4372c9,_0x5ec827=parseCliConfigJsonFile(_0xd9181,_0xbada4f,_0x507b59),_0x4f3ab7=normalizeLegacyConfigShape(_0x5ec827);if(_0x4f3ab7[_0x3bc2fb(0x1e5)])try{writeNormalizedConfigIfNeeded(_0xd9181,_0x4f3ab7['config']);}catch{}return _0x4f3ab7[_0x3bc2fb(0x1e0)];}export function loadRawConfigLayers(_0xd5371){const _0x44f70c=a141_0x4372c9;let _0x26232d={},_0x8fa8c6={};const _0x9017fc=resolveConfigPath(homedir());_0x9017fc&&(_0x26232d=parseAndNormalizeConfig(_0x9017fc,_0x44f70c(0x21e),'Global'));const _0x191190=_0xd5371??findProjectRootDirectory(),_0x3a07d2=resolveConfigPath(_0x191190);return _0x3a07d2&&(_0x8fa8c6=parseAndNormalizeConfig(_0x3a07d2,'warn','Project')),{'globalPath':_0x9017fc,'projectPath':_0x3a07d2,'globalConfig':_0x26232d,'projectConfig':_0x8fa8c6};}const INHERIT_WHITELIST=[a141_0x4372c9(0x20a),'accessKey',a141_0x4372c9(0x1fe),a141_0x4372c9(0x200),a141_0x4372c9(0x21d),a141_0x4372c9(0x207)];function mergeRawConfigLayers(_0x26e969){const _0x59441b=a141_0x4372c9,{globalConfig:_0x3d0ff4,projectConfig:_0x302666}=_0x26e969,_0x3a258d=Object['keys'](_0x302666)[_0x59441b(0x1f7)]>0x0;if(!_0x3a258d)return mergeGlobalOnly(_0x3d0ff4);if(_0x302666[_0x59441b(0x1de)]===!![])return mergeFullInherit(_0x3d0ff4,_0x302666);if(_0x302666['inherit']===![])return mergeIsolated(_0x302666);return mergeProjectFirst(_0x3d0ff4,_0x302666);}function mergeGlobalOnly(_0x2877e2){const _0x17a137=a141_0x4372c9,_0x42aee6={..._0x2877e2},_0xebf17d=_0x2877e2[_0x17a137(0x206)]&&typeof _0x2877e2[_0x17a137(0x206)]==='object'?_0x2877e2[_0x17a137(0x206)]:{};Object[_0x17a137(0x216)](_0xebf17d)[_0x17a137(0x1f7)]>0x0&&(_0x42aee6[_0x17a137(0x206)]=_0xebf17d);if(_0x2877e2['defaultApp'])_0x42aee6[_0x17a137(0x20b)]=_0x2877e2[_0x17a137(0x20b)];else{const _0xac9358=Object['keys'](_0xebf17d);if(_0xac9358[_0x17a137(0x1f7)]>0x0)_0x42aee6[_0x17a137(0x20b)]=_0xac9358[0x0];}return _0x42aee6;}function mergeIsolated(_0x2a2331){const _0x35737f=a141_0x4372c9,_0x4b6669={..._0x2a2331};delete _0x4b6669['inherit'];const _0x35492e=_0x2a2331[_0x35737f(0x206)]&&typeof _0x2a2331[_0x35737f(0x206)]===_0x35737f(0x1fc)?_0x2a2331['apps']:{};Object['keys'](_0x35492e)[_0x35737f(0x1f7)]>0x0?_0x4b6669['apps']=_0x35492e:delete _0x4b6669[_0x35737f(0x206)];if('defaultApp'in _0x2a2331)_0x4b6669[_0x35737f(0x20b)]=_0x2a2331['defaultApp'];else Object['keys'](_0x35492e)[_0x35737f(0x1f7)]>0x0?_0x4b6669[_0x35737f(0x20b)]=Object[_0x35737f(0x216)](_0x35492e)[0x0]:delete _0x4b6669[_0x35737f(0x20b)];return _0x4b6669;}function mergeProjectFirst(_0x3b92c8,_0x508e17){const _0x1e6c29=a141_0x4372c9,_0xcd9c01={..._0x508e17};delete _0xcd9c01[_0x1e6c29(0x1de)];for(const _0x5ef3e1 of INHERIT_WHITELIST){!(_0x5ef3e1 in _0xcd9c01)&&_0x5ef3e1 in _0x3b92c8&&(_0xcd9c01[_0x5ef3e1]=_0x3b92c8[_0x5ef3e1]);}const _0x421717=_0x508e17['apps']&&typeof _0x508e17[_0x1e6c29(0x206)]===_0x1e6c29(0x1fc)?_0x508e17[_0x1e6c29(0x206)]:{};Object['keys'](_0x421717)[_0x1e6c29(0x1f7)]>0x0?_0xcd9c01[_0x1e6c29(0x206)]=_0x421717:delete _0xcd9c01['apps'];if('defaultApp'in _0x508e17)_0xcd9c01[_0x1e6c29(0x20b)]=_0x508e17[_0x1e6c29(0x20b)];else Object['keys'](_0x421717)[_0x1e6c29(0x1f7)]>0x0?_0xcd9c01[_0x1e6c29(0x20b)]=Object['keys'](_0x421717)[0x0]:delete _0xcd9c01[_0x1e6c29(0x20b)];return _0xcd9c01;}function mergeFullInherit(_0x22fa90,_0x131777){const _0x31c453=a141_0x4372c9,_0x5850d0=_0x22fa90[_0x31c453(0x206)]&&typeof _0x22fa90[_0x31c453(0x206)]===_0x31c453(0x1fc)?_0x22fa90[_0x31c453(0x206)]:{},_0x5b4fb6=_0x131777[_0x31c453(0x206)]&&typeof _0x131777[_0x31c453(0x206)]===_0x31c453(0x1fc)?_0x131777[_0x31c453(0x206)]:{},_0x3a0d5e={..._0x5850d0,..._0x5b4fb6},_0x1668f7={..._0x22fa90,..._0x131777};delete _0x1668f7[_0x31c453(0x1de)];Object[_0x31c453(0x216)](_0x3a0d5e)[_0x31c453(0x1f7)]>0x0&&(_0x1668f7[_0x31c453(0x206)]=_0x3a0d5e);if('defaultApp'in _0x131777)_0x1668f7[_0x31c453(0x20b)]=_0x131777['defaultApp'];else{if(Object[_0x31c453(0x216)](_0x5b4fb6)[_0x31c453(0x1f7)]>0x0)_0x1668f7['defaultApp']=Object[_0x31c453(0x216)](_0x5b4fb6)[0x0];else{if(_0x22fa90[_0x31c453(0x20b)])_0x1668f7['defaultApp']=_0x22fa90[_0x31c453(0x20b)];else{const _0x1669ea=Object[_0x31c453(0x216)](_0x5850d0);if(_0x1669ea[_0x31c453(0x1f7)]>0x0)_0x1668f7[_0x31c453(0x20b)]=_0x1669ea[0x0];}}}return _0x1668f7;}export function readRawConfigWithLayers(_0xfd1f50){const _0x4dd22f=loadRawConfigLayers(_0xfd1f50);return{'config':mergeRawConfigLayers(_0x4dd22f),'layers':_0x4dd22f};}export function readRawConfig(_0x917c9d){return mergeRawConfigLayers(loadRawConfigLayers(_0x917c9d));}export function getConfigAppCode(_0x9443e){const _0x36f192=a141_0x4372c9,_0x3a2846=readRawConfig(_0x9443e);if(_0x3a2846[_0x36f192(0x206)]&&typeof _0x3a2846[_0x36f192(0x206)]==='object'){const _0x1133fb=_0x3a2846[_0x36f192(0x20b)];if(_0x1133fb&&_0x3a2846['apps'][_0x1133fb]?.[_0x36f192(0x203)])return String(_0x3a2846[_0x36f192(0x206)][_0x1133fb]['appcode'])[_0x36f192(0x1f3)]();const _0x2b3e7d=Object[_0x36f192(0x1f6)](_0x3a2846['apps'])[0x0];if(_0x2b3e7d?.[_0x36f192(0x203)])return String(_0x2b3e7d[_0x36f192(0x203)])['trim']();}const _0x86bc15=_0x3a2846['appcode']||_0x3a2846[_0x36f192(0x1ef)];if(typeof _0x86bc15!==_0x36f192(0x21f)||_0x86bc15[_0x36f192(0x1f3)]()==='')return undefined;return _0x86bc15[_0x36f192(0x1f3)]();}export function getMultiAppConfigs(_0x102359=a141_0x4372c9(0x21c),_0x4d6122){const _0xbe6681=a141_0x4372c9,_0x5e8f19=loadRawConfigLayers(_0x4d6122);let _0x3c68d6,_0x300799;if(_0x102359===_0xbe6681(0x20c)){const _0x28f36b=_0x5e8f19['globalConfig'][_0xbe6681(0x206)]&&typeof _0x5e8f19[_0xbe6681(0x20d)]['apps']===_0xbe6681(0x1fc)?_0x5e8f19[_0xbe6681(0x20d)][_0xbe6681(0x206)]:{},_0x3c20d2=_0x5e8f19['projectConfig']['apps']&&typeof _0x5e8f19['projectConfig'][_0xbe6681(0x206)]===_0xbe6681(0x1fc)?_0x5e8f19[_0xbe6681(0x1d6)][_0xbe6681(0x206)]:{};_0x3c68d6={..._0x28f36b,..._0x3c20d2};const _0x3935e9=readRawConfig(_0x4d6122);_0x300799=_0x3935e9['defaultApp'];}else _0x3c68d6=_0x5e8f19[_0xbe6681(0x1d6)][_0xbe6681(0x206)],_0x300799=_0x5e8f19['projectConfig'][_0xbe6681(0x20b)];if(!_0x3c68d6||typeof _0x3c68d6!==_0xbe6681(0x1fc)||Object[_0xbe6681(0x216)](_0x3c68d6)['length']===0x0)return null;return Object[_0xbe6681(0x218)](_0x3c68d6)[_0xbe6681(0x1d1)](([_0x2c09cb,_0x3a5a66])=>({'name':_0x2c09cb,'appcode':_0x3a5a66?.[_0xbe6681(0x203)]||'','isDefault':_0x2c09cb===_0x300799,'env':_0x3a5a66?.[_0xbe6681(0x1d7)],'apiDir':_0x3a5a66?.[_0xbe6681(0x1ea)],'cookie':_0x3a5a66?.[_0xbe6681(0x20a)]||undefined}))[_0xbe6681(0x1f9)](_0x352ad0=>_0x352ad0[_0xbe6681(0x203)]);}export function getTemplateBaseUrl(_0xe9958f){const _0xdee450=a141_0x4372c9,_0x1cbe8f=readRawConfig(_0xe9958f);if(_0x1cbe8f[_0xdee450(0x1fb)]&&typeof _0x1cbe8f[_0xdee450(0x1fb)]===_0xdee450(0x21f))return _0x1cbe8f[_0xdee450(0x1fb)][_0xdee450(0x213)](/\/$/,'');return _0xdee450(0x1dd);}function a141_0x32f8(_0x241c47,_0x4f4eea){_0x241c47=_0x241c47-0x1cf;const _0x1a35c9=a141_0x1a35();let _0x32f84b=_0x1a35c9[_0x241c47];return _0x32f84b;}export function readConfigFile(_0x28674b){const _0x3a6ce2=a141_0x4372c9;return parseAndNormalizeConfig(_0x28674b,_0x3a6ce2(0x21b));}export function writeConfigFile(_0x5729d2,_0x1006c2){const _0x31775b=a141_0x4372c9,_0x2d98dd=dirname(_0x5729d2);!existsSync(_0x2d98dd)&&mkdirSync(_0x2d98dd,{'recursive':!![]});const _0x21394d=_0x5729d2+_0x31775b(0x208);try{writeFileSync(_0x21394d,JSON[_0x31775b(0x209)](_0x1006c2,null,0x2)+'\x0a',{'encoding':_0x31775b(0x204),'mode':0x180}),renameSync(_0x21394d,_0x5729d2);}catch(_0x362ed3){try{unlinkSync(_0x21394d);}catch{}throw _0x362ed3;}}export function resolveWriteConfigPath(_0x5f27c1){const _0x3cdd3e=a141_0x4372c9,_0x59d78a=_0x5f27c1==='project'?process[_0x3cdd3e(0x205)]():homedir(),_0x1bca09=resolveConfigPath(_0x59d78a);return _0x1bca09??resolve(_0x59d78a,NEW_CONFIG_NAME);}function buildConfig(_0x3c71db,_0x103fea){const _0x3cc913=a141_0x4372c9,_0x4e0d24={};if(_0x3c71db['apps']&&typeof _0x3c71db[_0x3cc913(0x206)]==='object')for(const [_0x25fbc0,_0xbe1147]of Object[_0x3cc913(0x218)](_0x3c71db[_0x3cc913(0x206)])){_0xbe1147&&typeof _0xbe1147===_0x3cc913(0x1fc)&&_0xbe1147[_0x3cc913(0x203)]&&(_0x4e0d24[_0x25fbc0]=_0xbe1147);}const _0x3cdc07=_0x3c71db['defaultApp']||undefined,_0x5a82ce=Object[_0x3cc913(0x216)](_0x4e0d24)[_0x3cc913(0x1f7)]>0x0,_0x35fc8f=_0x103fea[_0x3cc913(0x1ef)]||env(_0x3cc913(0x1f1))||undefined,_0x22465d=_0x35fc8f||_0x3cdc07||undefined,_0x141fe4=_0x103fea[_0x3cc913(0x203)]||env('APPCODE')||undefined,_0x381dc7=_0x141fe4?Object[_0x3cc913(0x218)](_0x4e0d24)[_0x3cc913(0x1da)](([,_0x1e2f4a])=>_0x1e2f4a?.[_0x3cc913(0x203)]===_0x141fe4):undefined,_0x467c21=_0x381dc7?.[0x0],_0x3382de=_0x381dc7?.[0x1];let _0x1dadbc=_0x141fe4?_0x467c21:_0x22465d,_0x316415=_0x1dadbc&&_0x4e0d24[_0x1dadbc]?_0x4e0d24[_0x1dadbc]:undefined;_0x141fe4&&_0x3382de&&(_0x316415=_0x3382de);const _0x429d46=_0x141fe4?_0x3382de??_0x316415:_0x316415,_0x245565=_0x35fc8f||(_0x141fe4?_0x467c21:undefined),_0xe635e7=_0x141fe4||_0x429d46?.[_0x3cc913(0x203)]||undefined,_0x5aac60=_0x103fea[_0x3cc913(0x1d7)]||env('ENV')||_0x429d46?.['env']||_0x3c71db[_0x3cc913(0x1d7)]||DEFAULT_CONFIG_VALUES[_0x3cc913(0x1d7)],_0x359a5e=_0x429d46?.[_0x3cc913(0x1fe)]||_0x3c71db[_0x3cc913(0x1fe)]||DEFAULT_CONFIG_VALUES[_0x3cc913(0x1fe)],_0x1f3ea6=env('COOKIE')||_0x429d46?.[_0x3cc913(0x20a)]||_0x3c71db['cookie']||undefined,_0x442e3f=env(_0x3cc913(0x1cf))||_0x429d46?.['accessKey']||_0x3c71db[_0x3cc913(0x212)]||undefined,_0x4988c8=_0x103fea[_0x3cc913(0x200)]||env('FORMAT')||_0x429d46?.[_0x3cc913(0x200)]||_0x3c71db['format'],_0x4aa051=normalizeLegacyOutputFormat(_0x4988c8),_0x58a880=env(_0x3cc913(0x1e2))||_0x429d46?.[_0x3cc913(0x207)]||_0x3c71db['pageSize'],_0x590162=_0x58a880?Number(_0x58a880)||undefined:undefined,_0x516035=env(_0x3cc913(0x1fa))||env(_0x3cc913(0x1e7))||_0x429d46?.[_0x3cc913(0x21d)]||_0x3c71db[_0x3cc913(0x21d)]||_0x3c71db[_0x3cc913(0x1d3)],_0xcc0aa4=_0x516035===_0x3cc913(0x1f0)||_0x516035===_0x3cc913(0x1f4)?_0x516035:DEFAULT_CONFIG_VALUES[_0x3cc913(0x21d)],_0x49ad95=env(_0x3cc913(0x201)),_0x1ca8b6=_0x49ad95==='1'||_0x49ad95===_0x3cc913(0x1e1),_0x345b8e=_0x429d46?.[_0x3cc913(0x1ea)]||_0x3c71db['apiDir']||DEFAULT_CONFIG_VALUES['apiDir'],_0x1e5d83=isDaily(normalizeEnv(String(_0x5aac60)))?'daily':'production';return{'appCode':typeof _0xe635e7==='string'&&_0xe635e7[_0x3cc913(0x1f3)]()?_0xe635e7[_0x3cc913(0x1f3)]():undefined,'env':_0x1e5d83,'locale':_0x359a5e,'cookie':_0x1f3ea6,'accessKey':_0x442e3f,'format':_0x4aa051,'pageSize':_0x590162,'riskLevel':_0xcc0aa4,'verbose':_0x1ca8b6,'apiDir':_0x345b8e,'apps':_0x4e0d24,'defaultApp':_0x3cdc07,'currentApp':_0x5a82ce?_0x1dadbc:undefined,'explicitAppName':_0x245565,'raw':_0x3c71db};}async function buildAuth(_0x536863){const _0x51bc49=a141_0x4372c9,{getCookie:_0x43f3b8}=await import(_0x51bc49(0x1d4)),_0x3800fe=_0x536863[_0x51bc49(0x20a)]||_0x43f3b8(),_0x50c2b9=_0x3800fe?await getIsSessionValid():![];return{'cookie':_0x3800fe,'isLoggedIn':_0x50c2b9,async 'getOrLogin'(){const _0x292333=_0x51bc49;if(_0x3800fe&&_0x50c2b9)return _0x3800fe;throw CliErrors[_0x292333(0x1e6)]();}};}export function resolveApiFilePath(_0x15278a,_0x74bad6){const _0x5f0925=a141_0x4372c9,_0x1002be=resolve(process['cwd'](),_0x15278a),_0x54e3c9=resolve(_0x1002be,_0x5f0925(0x219));if(!_0x74bad6)return _0x54e3c9;const _0x221cae=readRawConfig(),_0x59dd53=_0x221cae['apps']&&typeof _0x221cae[_0x5f0925(0x206)]==='object'?_0x221cae[_0x5f0925(0x206)]:{},_0x5043ba=Object['entries'](_0x59dd53)[_0x5f0925(0x1da)](([,_0x4be263])=>_0x4be263?.[_0x5f0925(0x203)]===_0x74bad6);if(!_0x5043ba)return _0x54e3c9;const [_0x2cacfa,_0x4a5319]=_0x5043ba,_0x1c4154=typeof _0x221cae[_0x5f0925(0x20b)]===_0x5f0925(0x21f)?_0x221cae['defaultApp']:undefined;if(_0x4a5319?.[_0x5f0925(0x1ea)])return _0x54e3c9;if(_0x1c4154&&_0x2cacfa!==_0x1c4154)return resolve(_0x1002be,_0x2cacfa+'-api.ts');return _0x54e3c9;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x35e825,_0x43d7b9){const _0x52841f=a142_0x4a36,_0x31d2f3=_0x35e825();while(!![]){try{const _0x4b1a6b=parseInt(_0x52841f(0xa4))/0x1*(-parseInt(_0x52841f(0x9b))/0x2)+-parseInt(_0x52841f(0x96))/0x3*(-parseInt(_0x52841f(0xa0))/0x4)+parseInt(_0x52841f(0x95))/0x5+parseInt(_0x52841f(0x94))/0x6*(-parseInt(_0x52841f(0x98))/0x7)+parseInt(_0x52841f(0x92))/0x8+-parseInt(_0x52841f(0x93))/0x9*(-parseInt(_0x52841f(0x9e))/0xa)+-parseInt(_0x52841f(0x97))/0xb*(parseInt(_0x52841f(0x9a))/0xc);if(_0x4b1a6b===_0x43d7b9)break;else _0x31d2f3['push'](_0x31d2f3['shift']());}catch(_0x22a5da){_0x31d2f3['push'](_0x31d2f3['shift']());}}}(a142_0x2fd0,0xf3019));import{readFileSync,existsSync}from'node:fs';function a142_0x2fd0(){const _0x467157=['alias','utf-8','9911760rVpXyQ','543681OkLyXq','6pywzyV','4884170jwZQbs','2391njLQxz','18912443GlIXwV','3384696vKjgPM','exec','24hyUnXw','7518PltUSf','cwd','push','320cRjoWX','get','6744QQoYtO','find','set','api.ts','153VStsTw'];a142_0x2fd0=function(){return _0x467157;};return a142_0x2fd0();}import{resolve}from'node:path';const cache=new Map();function a142_0x4a36(_0x5a5966,_0x3246e3){_0x5a5966=_0x5a5966-0x92;const _0x2fd0bc=a142_0x2fd0();let _0x4a3690=_0x2fd0bc[_0x5a5966];return _0x4a3690;}function parseApiFile(_0x243aec){const _0x126bce=a142_0x4a36,_0x2ae9ef=[],_0x37c4ac=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x1e0ae1;while((_0x1e0ae1=_0x37c4ac[_0x126bce(0x99)](_0x243aec))!==null){_0x2ae9ef[_0x126bce(0x9d)]({'datasetCode':_0x1e0ae1[0x1],'tableName':_0x1e0ae1[0x2],'name':_0x1e0ae1[0x3],'alias':_0x1e0ae1[0x4]});}return _0x2ae9ef;}export function loadAliasMap(_0xc75fa4,_0x396d17,_0x33e231){const _0xa6c3c4=a142_0x4a36,_0x5bfc45=_0x33e231??resolve(process[_0xa6c3c4(0x9c)](),_0xc75fa4,_0xa6c3c4(0xa3));if(cache['has'](_0x5bfc45))return cache[_0xa6c3c4(0x9f)](_0x5bfc45);if(!existsSync(_0x5bfc45))return cache['set'](_0x5bfc45,[]),[];try{const _0x2604ee=readFileSync(_0x5bfc45,_0xa6c3c4(0xa6)),_0xff09a6=parseApiFile(_0x2604ee);return cache[_0xa6c3c4(0xa2)](_0x5bfc45,_0xff09a6),_0xff09a6;}catch{return cache[_0xa6c3c4(0xa2)](_0x5bfc45,[]),[];}}export function resolveAlias(_0x4df05f,_0x1e0319,_0x297bcb,_0x151ff1){const _0x55db2c=a142_0x4a36;if(!_0x1e0319)return undefined;const _0x14535c=loadAliasMap(_0x4df05f,_0x297bcb,_0x151ff1),_0x27eef2=_0x14535c[_0x55db2c(0xa1)](_0x2b1261=>_0x2b1261[_0x55db2c(0xa5)]===_0x1e0319);return _0x27eef2?.['datasetCode'];}export function listAliases(_0x35946b,_0x3e1628,_0x3584dd){return loadAliasMap(_0x35946b,_0x3e1628,_0x3584dd);}
|
package/lib/core/api-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1df654,_0x3e3a7a){const _0x1a5394=a143_0x5a92,_0x2cb505=_0x1df654();while(!![]){try{const _0x32cb42=parseInt(_0x1a5394(0x21f))/0x1+parseInt(_0x1a5394(0x1ed))/0x2+-parseInt(_0x1a5394(0x1e4))/0x3+-parseInt(_0x1a5394(0x228))/0x4+-parseInt(_0x1a5394(0x27f))/0x5*(-parseInt(_0x1a5394(0x1ec))/0x6)+parseInt(_0x1a5394(0x24b))/0x7+-parseInt(_0x1a5394(0x241))/0x8;if(_0x32cb42===_0x3e3a7a)break;else _0x2cb505['push'](_0x2cb505['shift']());}catch(_0x3bfdbc){_0x2cb505['push'](_0x2cb505['shift']());}}}(a143_0x35f9,0xba020));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';let _activeCookie;export function setActiveCookie(_0x3613bf){_activeCookie=_0x3613bf||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530;function createFetchFailureError(_0x4d909b,_0x10a33c){const _0x492c92=a143_0x5a92,_0x8643cd=_0x10a33c instanceof Error?_0x10a33c[_0x492c92(0x1ee)]:String(_0x10a33c);return CliErrors[_0x492c92(0x242)](_0x492c92(0x20b)+_0x4d909b+(_0x8643cd?'\x20('+_0x8643cd+')':''),_0x492c92(0x1e7));}async function apiRequest(_0x5bb840,_0xf88a54={}){const _0x2c5138=a143_0x5a92,{method:method=_0x2c5138(0x22f),body:_0x685d12,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![]}=_0xf88a54,_0x2df017=useRuntime?getRuntimeDomain():getApiDomain(),_0x4b8e26=_activeCookie||getCookie(),_0x1a61e4=''+_0x2df017+_0x5bb840,_0x214f08=new AbortController(),_0x2add3a=setTimeout(()=>_0x214f08[_0x2c5138(0x1fa)](),timeout);try{const _0x31e76c=await fetch(_0x1a61e4,{'method':method,'headers':{'Content-Type':_0x2c5138(0x201),'Cookie':_0x4b8e26,'X-Invoke-Source':_0x2c5138(0x1e5),...headers},'body':_0x685d12?JSON[_0x2c5138(0x251)](_0x685d12):undefined,'signal':_0x214f08[_0x2c5138(0x26c)]});let _0x38c111;try{_0x38c111=await _0x31e76c[_0x2c5138(0x262)]();}catch{throw CliErrors[_0x2c5138(0x242)](_0x2c5138(0x20e)+_0x31e76c[_0x2c5138(0x200)]+')',_0x31e76c[_0x2c5138(0x200)]>=0x190?_0x2c5138(0x265):undefined);}if(!_0x31e76c['ok']||_0x38c111['success']===![])throw CliErrors['apiError'](_0x38c111[_0x2c5138(0x269)]||_0x38c111['message']||'API\x20error:\x20'+_0x31e76c['status'],_0x38c111[_0x2c5138(0x1f4)]?_0x2c5138(0x275)+_0x38c111[_0x2c5138(0x1f4)]:undefined);return _0x38c111;}catch(_0x1c6103){if(_0x1c6103 instanceof CliError)throw _0x1c6103;if(_0x1c6103 instanceof Error&&_0x1c6103['name']===_0x2c5138(0x209))throw CliErrors[_0x2c5138(0x242)](_0x2c5138(0x277)+_0x1a61e4);throw createFetchFailureError(_0x1a61e4,_0x1c6103);}finally{clearTimeout(_0x2add3a);}}function a143_0x35f9(){const _0x2dda44=['/smartapi/dblink/delete','/api/custom/executeSql','const\x20results\x20=\x20data.execResult\x20||\x20[];','const\x20result\x20=\x20await\x20client.models.','validation','.getOne(id);','version','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','object','Dataset\x20not\x20found:\x20','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','/smartapi/db-analysis/start','dataset_','filter','1451788oUGosp','/standard-page-status?appCode=','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','functionName','push','type','target','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','remove','1478580kjxhjT','/smartapi/dblink/testConnect','/smartapi/dataset/update-driven-data','sdk','tableData','/smartapi/dblink/create','\x20failed','GET','\x20\x20pageSize:\x2020,','/smartapi/db-analysis/jobs/cancel','SQL\x20query\x20not\x20found:\x20','/smartapi/db-analysis/status/','/smartapi/dblink/getAllTableList','\x20of\x20','operationId','modelCode','const\x20data\x20=\x20await\x20client.sql.execute({','401','.filter({','getOne','name','dbId','/smartapi/dblink/getTableDiffV2ByPage','Warning:\x20showing\x20first\x20','/smartapi/custom/getUserCustomSql?id=','23666400MqmxtW','apiError','map','//\x20SQL:\x20','add','authRequired','/sync-to-pages','/generate-standard-pages/status?','toString','table','4939893kGdQQL','enabled','requestFields','/smartapi/question/er-config/update-single','find','includes','stringify','scriptType','/smartapi/dblink/update','POST','operationName','string','error','pageIndex','responseFields','\x20\x20return\x20rows;','\x22\x20not\x20found\x20in\x20dataset\x20','/generate-standard-pages/start','/api/management/library/scripts/info?id=','toLowerCase','dbtableConfig','clientOperationId','/smartapi/custom/saveUserCustomSql','json','BFF\x20script\x20not\x20found:\x20id=','body','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','label','errorMessage','sqlName','errorMsg','join','sqlCode','signal','/smartapi/custom/updateUserCustomSql','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','tableName','isArray','includeImports','.remove(id);','/smartapi/question/er-config/erDelete','displayName','API\x20error\x20code:\x20','UNAUTHORIZED','Request\x20timeout:\x20','BFF\x20save\x20returned\x20no\x20valid\x20id','pageSize','scriptName','//\x20','currentPage','/api/','/smartapi/lovrabet/dataset/','45YdfIMD','\x20\x20sqlCode:\x20\x27','api_error','/smartapi/custom/queryUserCustomSqlList','delete','description','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','operations','1579998UcTNNk','cli:rabetbase','/api/management/script/cache/clear','Check\x20network\x20connectivity\x20and\x20try\x20again.','/api/management/library/scripts/list?appCode=','update','test','\x20\x20where:\x20{},','936906koWHSp','2107306mhkSab','message','method','planId','/smartapi/dblink/getList','Page\x20not\x20found:\x20','?sqlCode=','errorCode','.create({\x20/*\x20fields\x20*/\x20});','/smartapi/lovrabet/detail?pageId=','replace','/api/management/library/scripts/save','tableList','abort','SQL\x20query\x20not\x20found:\x20id=','\x20apps.\x20','\x20\x20\x20\x20sqlCode:\x20\x27','/smartapi/dataset/get-dataset-list','/smartapi/custom/deleteUserCustomSql','status','application/json','warn','/smartapi/question/er-config/erCreate','set','/smartapi/custom/getUserCustomSql','data','});','/smartapi/question/er-config','AbortError','modelId','Request\x20failed:\x20','totalCount','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','/smartapi/app/getList','code'];a143_0x35f9=function(){return _0x2dda44;};return a143_0x35f9();}function isAuthFailure(_0x3950bc){const _0x5ada06=a143_0x5a92,_0x15bd72=_0x3950bc[_0x5ada06(0x269)]||_0x3950bc[_0x5ada06(0x1ee)]||_0x3950bc[_0x5ada06(0x206)]?.[_0x5ada06(0x1ee)]||_0x3950bc[_0x5ada06(0x267)]||_0x3950bc[_0x5ada06(0x257)]||'';return _0x3950bc[_0x5ada06(0x1f4)]===_0x5ada06(0x276)||_0x3950bc[_0x5ada06(0x210)]===0x191||_0x3950bc[_0x5ada06(0x210)]===_0x5ada06(0x239)||_0x15bd72['includes'](_0x5ada06(0x239))||_0x15bd72[_0x5ada06(0x250)]('Unauthorized')||_0x15bd72[_0x5ada06(0x250)]('登录')||_0x15bd72[_0x5ada06(0x250)]('认证');}export async function platformFetch(_0x55af58,_0x52ef7a){const _0x288222=a143_0x5a92;let _0x260861;try{_0x260861=await fetch(_0x55af58,{'method':_0x52ef7a[_0x288222(0x1ef)]??_0x288222(0x22f),'headers':{'Content-Type':_0x288222(0x201),'Cookie':_0x52ef7a['cookie'],'X-Invoke-Source':_0x288222(0x1e5)},..._0x52ef7a['body']&&{'body':JSON[_0x288222(0x251)](_0x52ef7a[_0x288222(0x264)])}});}catch(_0x5b85bb){throw createFetchFailureError(_0x55af58,_0x5b85bb);}if(!_0x260861['ok']){if(_0x260861[_0x288222(0x200)]===0x191)throw CliErrors[_0x288222(0x246)]();throw CliErrors[_0x288222(0x242)](_0x52ef7a[_0x288222(0x266)]+'\x20failed,\x20HTTP\x20'+_0x260861['status']);}const _0x1b6ea8=await _0x260861['json']();if(_0x1b6ea8['success']===![]){if(isAuthFailure(_0x1b6ea8))throw CliErrors['authRequired']();throw CliErrors[_0x288222(0x242)](_0x1b6ea8[_0x288222(0x269)]||_0x1b6ea8[_0x288222(0x1ee)]||_0x52ef7a[_0x288222(0x266)]+_0x288222(0x22e));}return _0x1b6ea8[_0x288222(0x206)];}export async function listBffScripts(_0x1e6cce,_0x5de6e2,_0x5324b2){const _0xf44bba=a143_0x5a92;let _0x416c15=_0xf44bba(0x1e8)+_0x1e6cce;if(_0x5de6e2)_0x416c15+='&type='+_0x5de6e2;const _0x4c832d=await apiRequest(_0x416c15);let _0xc76f00=extractList(_0x4c832d[_0xf44bba(0x206)]);if(_0x5324b2?.['scriptName']){const _0x53caee=_0x5324b2[_0xf44bba(0x27a)][_0xf44bba(0x25e)]();_0xc76f00=_0xc76f00[_0xf44bba(0x21e)](_0x36fe9a=>_0x36fe9a[_0xf44bba(0x222)]?.[_0xf44bba(0x25e)]()[_0xf44bba(0x250)](_0x53caee)||_0x36fe9a['description']?.[_0xf44bba(0x25e)]()[_0xf44bba(0x250)](_0x53caee));}return _0xc76f00;}export async function getBffScriptInfo(_0x40cbd2){const _0x2e8518=a143_0x5a92,_0x4afefe=await apiRequest(_0x2e8518(0x25d)+_0x40cbd2);if(!_0x4afefe[_0x2e8518(0x206)])throw CliErrors[_0x2e8518(0x215)](_0x2e8518(0x263)+_0x40cbd2);return _0x4afefe[_0x2e8518(0x206)];}export async function saveBffScript(_0xfbd3a6){const _0xa51922=a143_0x5a92,_0x323f80=await apiRequest(_0xa51922(0x1f8),{'method':_0xa51922(0x254),'body':_0xfbd3a6}),{id:_0x3c10c0,entity:_0x2078d3}=normalizeEntityWithIdResponse(_0x323f80['data']);if(_0x3c10c0!==undefined){const _0x19435c=typeof _0x2078d3[_0xa51922(0x222)]===_0xa51922(0x256)||typeof _0x2078d3[_0xa51922(0x252)]==='string'?_0x2078d3:undefined;return{'id':_0x3c10c0,'script':_0x19435c};}throw CliErrors['apiError'](_0xa51922(0x278));}export async function deleteBffScript(_0x4596cb){await apiRequest('/api/management/library/scripts/delete',{'method':'POST','body':{'id':_0x4596cb}});}export async function getBffScriptStatistics(_0x21e54e){const _0x3168bf=a143_0x5a92,_0x13644e=await apiRequest('/api/management/library/scripts/statistics?appCode='+_0x21e54e);return extractList(_0x13644e[_0x3168bf(0x206)]);}export async function clearBffScriptCache(){const _0x127e28=a143_0x5a92,_0x3ba435=await apiRequest(_0x127e28(0x1e6),{'method':_0x127e28(0x254),'useRuntime':!![]});return typeof _0x3ba435[_0x127e28(0x206)]===_0x127e28(0x256)?_0x3ba435['data']:'';}export async function listBffDatasetOperations(_0x47a46c,_0x4fa2f6){const _0x12cfd2=a143_0x5a92,_0x5d3d75=await apiRequest('/smartapi/dataset/get-dataset-operation',{'method':_0x12cfd2(0x254),'body':{'appCode':_0x47a46c,'datasetId':_0x4fa2f6}});return _0x5d3d75[_0x12cfd2(0x206)];}export async function listSqlQueries(_0x2ae950,_0x5186da){const _0x22e5b1=a143_0x5a92,_0x2438ed=await apiRequest(_0x22e5b1(0x282),{'method':_0x22e5b1(0x254),'body':{'appCode':_0x2ae950,'currentPage':_0x5186da?.[_0x22e5b1(0x27c)]??0x1,'pageSize':_0x5186da?.['pageSize']??0x32,'sqlCode':_0x5186da?.[_0x22e5b1(0x26b)],'sqlName':_0x5186da?.[_0x22e5b1(0x268)]}});return _0x2438ed[_0x22e5b1(0x206)];}export async function getSqlQueryInfo(_0x37826c,_0x35d0b1){const _0xfede79=a143_0x5a92,_0x4e115d=await listSqlQueries(_0x37826c,{'sqlCode':_0x35d0b1}),_0x1f2d13=_0x4e115d['tableData']?.[0x0];if(!_0x1f2d13)throw CliErrors['validation'](_0xfede79(0x232)+_0x35d0b1);return _0x1f2d13;}export async function getSqlQueryDetail(_0x5c56ac){const _0x5a6f0e=a143_0x5a92,_0x719f56=await apiRequest(_0x5a6f0e(0x205)+(_0x5a6f0e(0x1f3)+encodeURIComponent(_0x5c56ac)));if(!_0x719f56[_0x5a6f0e(0x206)])throw CliErrors[_0x5a6f0e(0x215)]('SQL\x20query\x20not\x20found:\x20'+_0x5c56ac);return _0x719f56[_0x5a6f0e(0x206)];}export async function getSqlQueryDetailById(_0x3a6460){const _0x5684f9=a143_0x5a92,_0x59e970=await apiRequest(_0x5684f9(0x240)+_0x3a6460);if(!_0x59e970[_0x5684f9(0x206)])throw CliErrors[_0x5684f9(0x215)](_0x5684f9(0x1fb)+_0x3a6460);return _0x59e970[_0x5684f9(0x206)];}export async function createSqlQuery(_0x157549){const _0x38e878=a143_0x5a92,_0x2394bb=await apiRequest(_0x38e878(0x261),{'method':_0x38e878(0x254),'body':_0x157549}),{id:_0x914526,entity:_0x3c9fd0}=normalizeEntityWithIdResponse(_0x2394bb['data']);if(!(_0x38e878(0x26b)in _0x3c9fd0)&&_0x914526)return getSqlQueryDetailById(_0x914526);return normalizeSqlQueryEntity(_0x3c9fd0);}export async function updateSqlQuery(_0x1f2d29){const _0x5b30da=a143_0x5a92,_0x392203=await apiRequest(_0x5b30da(0x26d),{'method':'POST','body':_0x1f2d29}),{id:_0xef4d7c,entity:_0x25b933}=normalizeEntityWithIdResponse(_0x392203[_0x5b30da(0x206)]);if(!(_0x5b30da(0x26b)in _0x25b933)){if(_0x1f2d29[_0x5b30da(0x26b)])return getSqlQueryDetail(_0x1f2d29['sqlCode']);if(_0xef4d7c)return getSqlQueryDetailById(_0xef4d7c);}return normalizeSqlQueryEntity(_0x25b933);}export async function deleteSqlQuery(_0x5ef7ef){const _0x2dac84=a143_0x5a92;await apiRequest(_0x2dac84(0x1ff),{'method':_0x2dac84(0x254),'body':_0x5ef7ef});}export async function saveSqlQuery(_0x110163){const _0xc1139e=a143_0x5a92,_0x74a14f=await apiRequest('/api/node-toolbox/sql/save',{'method':'POST','body':_0x110163});return _0x74a14f[_0xc1139e(0x206)];}function normalizeSqlQueryEntity(_0x294d93){const _0x5bd476=a143_0x5a92;return{..._0x294d93,'id':Number(_0x294d93['id']),'dbId':_0x294d93[_0x5bd476(0x23d)]==null?undefined:Number(_0x294d93[_0x5bd476(0x23d)]),'version':_0x294d93[_0x5bd476(0x217)]==null?undefined:Number(_0x294d93[_0x5bd476(0x217)])};}export async function executeSql(_0x3d4042,_0x2e7b88,_0x13ece8){const _0x1a05c8=a143_0x5a92,_0x3ea067=await apiRequest(_0x1a05c8(0x212),{'method':'POST','body':{'appCode':_0x3d4042,'sqlCode':_0x2e7b88,..._0x13ece8&&{'params':_0x13ece8}},'useRuntime':!![]});return _0x3ea067['data'];}export async function executeDatasetDataOperation(_0x139505,_0x520c8b,_0x25b1b1,_0x19cce7={}){const _0xe154a9=a143_0x5a92;try{const _0x23490a=await apiRequest(_0xe154a9(0x27d)+_0x139505+'/'+_0x520c8b+'/'+_0x25b1b1,{'method':_0xe154a9(0x254),'body':_0x19cce7,'useRuntime':!![]});return _0x23490a['data'];}catch(_0x27c2c3){if(_0x25b1b1===_0xe154a9(0x23b)&&_0x27c2c3 instanceof CliError&&_0x27c2c3[_0xe154a9(0x210)]===_0xe154a9(0x281)&&_0x19cce7['id']!==undefined&&_0x19cce7['id']!==null&&_0x19cce7['id']!==''){const _0x4e43cf=await apiRequest('/api/'+_0x139505+'/'+_0x520c8b+'/filter',{'method':_0xe154a9(0x254),'body':{'where':{'id':{'$eq':_0x19cce7['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x2d0984=Array[_0xe154a9(0x270)](_0x4e43cf[_0xe154a9(0x206)]?.['tableData'])?_0x4e43cf['data'][_0xe154a9(0x22c)]:[];return _0x2d0984[0x0]??null;}throw _0x27c2c3;}}export async function listDatasets(_0x371769,_0x28e707){const _0x2958a4=a143_0x5a92,_0x1d55de={'appCode':_0x371769,'deleted':![]};if(_0x28e707?.[_0x2958a4(0x210)])_0x1d55de['code']=_0x28e707[_0x2958a4(0x210)];if(_0x28e707?.[_0x2958a4(0x23c)])_0x1d55de[_0x2958a4(0x23c)]=_0x28e707['name'];const _0x33bed3=await apiRequest(_0x2958a4(0x1fe),{'method':_0x2958a4(0x254),'body':_0x1d55de});return extractList(_0x33bed3['data']);}export async function deleteDataset(_0x398ed2,_0x261970){const _0x2da992=a143_0x5a92;await apiRequest('/smartapi/dataset/delete-dataset',{'method':_0x2da992(0x254),'body':{'appCode':_0x398ed2,'datasetId':_0x261970}});}export async function searchDatasets(_0x753071,_0x39124d){const _0x5c8497=a143_0x5a92,_0x10d0bb=await listDatasets(_0x753071,{'name':_0x39124d}),_0x3235ba=_0x39124d[_0x5c8497(0x25e)](),_0x2fa0aa=new Set(_0x10d0bb[_0x5c8497(0x243)](_0x3a927e=>_0x3a927e['id'])),_0xc43da4=_0x10d0bb['filter'](_0x8a4077=>_0x8a4077[_0x5c8497(0x25f)]?.[_0x5c8497(0x26f)]?.[_0x5c8497(0x25e)]()[_0x5c8497(0x250)](_0x3235ba)||_0x8a4077[_0x5c8497(0x1e1)]?.['toLowerCase']()[_0x5c8497(0x250)](_0x3235ba)),_0x1649a2=await listDatasets(_0x753071,{'code':_0x39124d});for(const _0x58d9e0 of _0x1649a2){!_0x2fa0aa['has'](_0x58d9e0['id'])&&(_0x10d0bb['push'](_0x58d9e0),_0x2fa0aa[_0x5c8497(0x245)](_0x58d9e0['id']));}return _0x10d0bb;}export function normalizeDatasetOperations(_0x3307d3){const _0x30a55b=a143_0x5a92;if(Array[_0x30a55b(0x270)](_0x3307d3))return _0x3307d3[_0x30a55b(0x21e)](_0x3b4264=>_0x3b4264!=null&&typeof _0x3b4264===_0x30a55b(0x219));if(_0x3307d3&&typeof _0x3307d3==='object')return Object['entries'](_0x3307d3)[_0x30a55b(0x21e)](([,_0x36ff3e])=>_0x36ff3e!=null&&typeof _0x36ff3e===_0x30a55b(0x219))[_0x30a55b(0x243)](([_0x594626,_0x126324])=>({..._0x126324,'name':_0x126324[_0x30a55b(0x23c)]??_0x126324[_0x30a55b(0x255)]??_0x594626}));return[];}export async function getDatasetDetail(_0x5a31e9){const _0x57e703=a143_0x5a92,_0x116d94=/^\d+$/[_0x57e703(0x1ea)](_0x5a31e9)?'id':_0x57e703(0x210),_0x2373f2=await apiRequest('/smartapi/dataset/get-driven-data?'+_0x116d94+'='+_0x5a31e9);return _0x2373f2[_0x57e703(0x206)];}export async function updateDrivenData(_0x495ec3){const _0x168fe5=a143_0x5a92,_0x23aa44=await apiRequest(_0x168fe5(0x22a),{'method':_0x168fe5(0x254),'body':_0x495ec3});return _0x23aa44[_0x168fe5(0x206)];}export async function getDatasetOperations(_0x319f5b){const _0x4f479d=a143_0x5a92,_0x1b6e2e=await getDatasetDetail(_0x319f5b),_0x1d4527=normalizeDatasetOperations(_0x1b6e2e[_0x4f479d(0x1e3)])[_0x4f479d(0x243)](_0x5eadf3=>({'name':_0x5eadf3[_0x4f479d(0x23c)]||_0x5eadf3['operationName'],'displayName':_0x5eadf3[_0x4f479d(0x274)]||_0x5eadf3[_0x4f479d(0x23c)],'type':_0x5eadf3[_0x4f479d(0x224)],'method':_0x5eadf3[_0x4f479d(0x1ef)],'path':_0x5eadf3['path'],'enabled':_0x5eadf3[_0x4f479d(0x24c)]??!![],'requestFields':_0x5eadf3[_0x4f479d(0x24d)],'responseFields':_0x5eadf3[_0x4f479d(0x259)]}));return{'dataset':{'id':_0x1b6e2e['id']??_0x1b6e2e[_0x4f479d(0x20a)],'name':_0x1b6e2e['name'],'code':_0x1b6e2e[_0x4f479d(0x210)]||_0x1b6e2e[_0x4f479d(0x237)],'tableName':_0x1b6e2e[_0x4f479d(0x26f)]||_0x1b6e2e[_0x4f479d(0x25f)]?.['tableName']},'operations':_0x1d4527};}export async function getOperationDetail(_0xf31949,_0x1d4017,_0x894d49){const _0x21bf0a=a143_0x5a92;let _0x2f56ab=_0x1d4017;if(!/^\d+$/[_0x21bf0a(0x1ea)](_0x1d4017)){const _0x345386=await listDatasets(_0xf31949,{'code':_0x1d4017}),_0x54a95b=_0x345386[_0x21bf0a(0x24f)](_0x3d185c=>_0x3d185c[_0x21bf0a(0x210)]===_0x1d4017||String(_0x3d185c['id'])===_0x1d4017);if(!_0x54a95b)throw CliErrors[_0x21bf0a(0x215)](_0x21bf0a(0x21a)+_0x1d4017);_0x2f56ab=String(_0x54a95b['id']);}const _0x253ea7=await getDatasetDetail(_0x2f56ab),_0x3189e2=normalizeDatasetOperations(_0x253ea7[_0x21bf0a(0x1e3)])['find'](_0x1af73c=>(_0x1af73c[_0x21bf0a(0x23c)]||_0x1af73c['operationName'])===_0x894d49);if(!_0x3189e2)throw CliErrors[_0x21bf0a(0x215)]('Operation\x20\x22'+_0x894d49+_0x21bf0a(0x25b)+_0x1d4017);return{'dataset':{'id':_0x253ea7['id']??_0x253ea7[_0x21bf0a(0x20a)],'name':_0x253ea7[_0x21bf0a(0x23c)],'code':_0x253ea7[_0x21bf0a(0x210)]||_0x253ea7['modelCode'],'tableName':_0x253ea7[_0x21bf0a(0x26f)]||_0x253ea7['dbtableConfig']?.[_0x21bf0a(0x26f)]},'operation':_0x3189e2};}export async function startGenerateStandardPages(_0x487b29,_0x297d72,_0x2c20d3){const _0x5cb968=a143_0x5a92,_0x13d959=await apiRequest(_0x5cb968(0x27e)+_0x297d72+_0x5cb968(0x25c),{'method':_0x5cb968(0x254),'body':{'appCode':_0x487b29,..._0x2c20d3?.[_0x5cb968(0x260)]?{'clientOperationId':_0x2c20d3[_0x5cb968(0x260)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x13d959[_0x5cb968(0x206)];}export async function getGenerateStandardPagesStatus(_0x5c0ecc,_0x3873c,_0x58072d){const _0x2741a1=a143_0x5a92,_0x485c2d=new URLSearchParams({'appCode':_0x5c0ecc});_0x58072d[_0x2741a1(0x236)]&&_0x485c2d[_0x2741a1(0x204)](_0x2741a1(0x236),_0x58072d[_0x2741a1(0x236)]);_0x58072d[_0x2741a1(0x260)]&&_0x485c2d[_0x2741a1(0x204)](_0x2741a1(0x260),_0x58072d['clientOperationId']);const _0x3d8e71=await apiRequest('/smartapi/lovrabet/dataset/'+_0x3873c+_0x2741a1(0x248)+_0x485c2d[_0x2741a1(0x249)]());return _0x3d8e71[_0x2741a1(0x206)];}export async function getStandardPageStatus(_0xf54661,_0x177f9c){const _0x1f1725=a143_0x5a92,_0x6de309=await apiRequest(_0x1f1725(0x27e)+_0x177f9c+_0x1f1725(0x220)+encodeURIComponent(_0xf54661));return _0x6de309[_0x1f1725(0x206)];}export async function tryGetStandardPageStatus(_0x330192,_0x5f0393){const _0x318636=a143_0x5a92;try{return await getStandardPageStatus(_0x330192,_0x5f0393);}catch(_0x282e7c){if(_0x282e7c instanceof CliError&&_0x282e7c[_0x318636(0x210)]==='api_error'&&/404|not found|non-json response/i[_0x318636(0x1ea)](_0x282e7c[_0x318636(0x1ee)]))return null;throw _0x282e7c;}}export async function syncStandardPages(_0x47992b,_0x52a7e9){const _0x9fa93f=a143_0x5a92,_0x57ed96=await apiRequest(_0x9fa93f(0x27e)+_0x52a7e9+_0x9fa93f(0x247),{'method':_0x9fa93f(0x254),'body':{'appCode':_0x47992b}});return _0x57ed96[_0x9fa93f(0x206)];}export async function getPageDetail(_0x5ef7d7){const _0x5bacc1=a143_0x5a92,_0x4ddf90=await apiRequest(_0x5bacc1(0x1f6)+_0x5ef7d7);if(!_0x4ddf90[_0x5bacc1(0x206)])throw CliErrors['validation'](_0x5bacc1(0x1f2)+_0x5ef7d7);return _0x4ddf90[_0x5bacc1(0x206)];}export async function updatePage(_0x14bda6,_0x4e629c,_0x250678,_0x5f548e){const _0x4e35cd=a143_0x5a92,_0x435779=await apiRequest('/smartapi/lovrabet/update-page',{'method':_0x4e35cd(0x254),'body':{'appCode':_0x14bda6,'pageId':_0x4e629c,'code':_0x250678,'datasetIds':_0x5f548e}});return _0x435779[_0x4e35cd(0x206)];}export function generateSdkCode(_0x42c81d,_0x58468b,_0x273144){const _0x3d2183=a143_0x5a92,_0x3c59a5=_0x273144?.[_0x3d2183(0x271)]??!![],_0x251013=_0x3d2183(0x21d)+_0x42c81d[_0x3d2183(0x210)]?.[_0x3d2183(0x1f7)](/-/g,'_'),_0x45a590=_0x58468b[_0x3d2183(0x23c)]||_0x58468b[_0x3d2183(0x255)]||_0x3d2183(0x21e),_0x303622=[];_0x3c59a5&&_0x303622[_0x3d2183(0x223)](_0x3d2183(0x1e2),'',_0x3d2183(0x21b),'');_0x303622[_0x3d2183(0x223)](_0x3d2183(0x27b)+_0x42c81d[_0x3d2183(0x23c)]+'\x20('+(_0x42c81d[_0x3d2183(0x26f)]||_0x3d2183(0x24a))+')');if(_0x45a590===_0x3d2183(0x21e))_0x303622[_0x3d2183(0x223)](_0x3d2183(0x214)+_0x251013+_0x3d2183(0x23a),_0x3d2183(0x1eb),_0x3d2183(0x230),'\x20\x20currentPage:\x201,',_0x3d2183(0x207));else{if(_0x45a590==='getOne')_0x303622[_0x3d2183(0x223)](_0x3d2183(0x214)+_0x251013+_0x3d2183(0x216));else{if(_0x45a590==='create')_0x303622[_0x3d2183(0x223)](_0x3d2183(0x214)+_0x251013+_0x3d2183(0x1f5));else{if(_0x45a590===_0x3d2183(0x1e9))_0x303622[_0x3d2183(0x223)](_0x3d2183(0x214)+_0x251013+'.update(id,\x20{\x20/*\x20fields\x20*/\x20});');else _0x45a590===_0x3d2183(0x283)||_0x45a590===_0x3d2183(0x227)?_0x303622[_0x3d2183(0x223)](_0x3d2183(0x214)+_0x251013+_0x3d2183(0x272)):_0x303622['push'](_0x3d2183(0x214)+_0x251013+'.'+_0x45a590+'(/*\x20params\x20*/);');}}}return _0x303622[_0x3d2183(0x26a)]('\x0a');}export function generateSqlCodeTemplate(_0xa7452a,_0x1c7150){const _0x52727f=a143_0x5a92,_0x1b8625=_0x1c7150?.[_0x52727f(0x225)]??'sdk',_0x376aab=_0x1c7150?.['includeImports']??!![],_0x2ee263=[];return _0x2ee263['push'](_0x52727f(0x244)+_0xa7452a[_0x52727f(0x268)]+'\x20('+_0xa7452a['sqlCode']+')'),_0x1b8625===_0x52727f(0x22b)?(_0x376aab&&_0x2ee263['push'](_0x52727f(0x1e2),'','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});',''),_0x2ee263[_0x52727f(0x223)](_0x52727f(0x238),_0x52727f(0x280)+_0xa7452a['sqlCode']+'\x27,','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x52727f(0x207),_0x52727f(0x218),_0x52727f(0x213))):_0x2ee263[_0x52727f(0x223)](_0x52727f(0x20d),_0x52727f(0x26e),_0x52727f(0x226),_0x52727f(0x1fd)+_0xa7452a['sqlCode']+'\x27,','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','\x20\x20});',_0x52727f(0x25a),'}'),_0x2ee263[_0x52727f(0x26a)]('\x0a');}export async function getErConfig(_0x5d69ca,_0x53c853){const _0x5f0359=a143_0x5a92,_0x17a906=await apiRequest(_0x5f0359(0x208),{'method':_0x5f0359(0x254),'body':{'appCode':_0x5d69ca,'dblinkId':_0x53c853}});return _0x17a906[_0x5f0359(0x206)];}function a143_0x5a92(_0x4063f2,_0x3ac72d){_0x4063f2=_0x4063f2-0x1e1;const _0x35f9af=a143_0x35f9();let _0x5a92f6=_0x35f9af[_0x4063f2];return _0x5a92f6;}export async function createErRelation(_0x2f1efc){const _0x100cff=a143_0x5a92,_0x3f1a32=await apiRequest(_0x100cff(0x203),{'method':_0x100cff(0x254),'body':_0x2f1efc});return _0x3f1a32['data'];}export async function updateErRelation(_0x335613){const _0x3fea77=a143_0x5a92,_0x4c38a8=await apiRequest(_0x3fea77(0x24e),{'method':'POST','body':_0x335613});return _0x4c38a8[_0x3fea77(0x206)];}export async function deleteErRelation(_0x3eae78){const _0x1859d9=a143_0x5a92,_0x2250e3=await apiRequest(_0x1859d9(0x273),{'method':_0x1859d9(0x254),'body':_0x3eae78});return _0x2250e3[_0x1859d9(0x206)];}function buildQuery(_0x3cba2e){const _0x54a87e=a143_0x5a92,_0x51a8d1=new URLSearchParams();for(const [_0x267d11,_0x2b1781]of Object['entries'](_0x3cba2e)){if(_0x2b1781===undefined||_0x2b1781==='')continue;_0x51a8d1[_0x54a87e(0x204)](_0x267d11,String(_0x2b1781));}const _0x23a6e0=_0x51a8d1[_0x54a87e(0x249)]();return _0x23a6e0?'?'+_0x23a6e0:'';}export async function listDbLinks(_0xc2b902,_0x4d14bb){const _0x415f04=a143_0x5a92,_0x400105=await apiRequest(_0x415f04(0x1f1),{'method':_0x415f04(0x254),'body':{'appCode':_0xc2b902,'currentPage':_0x4d14bb?.[_0x415f04(0x27c)]??0x1,'pageSize':_0x4d14bb?.[_0x415f04(0x279)]??0x64}});return{'items':extractList(_0x400105[_0x415f04(0x206)]),'paging':extractPaging(_0x400105['data'])};}export async function getDbLinkInfo(_0x4786c2){const _0x1539f1=a143_0x5a92,_0x1070ad=await apiRequest('/smartapi/dblink/getOne'+buildQuery({'id':_0x4786c2}));return _0x1070ad[_0x1539f1(0x206)];}export async function createDbLink(_0x163231){const _0x48fc22=a143_0x5a92,_0x4e7acc=await apiRequest(_0x48fc22(0x22d),{'method':_0x48fc22(0x254),'body':_0x163231});return _0x4e7acc['data'];}export async function updateDbLink(_0x36108d){const _0xfe2ba=a143_0x5a92,_0x532e36=await apiRequest(_0xfe2ba(0x253),{'method':_0xfe2ba(0x254),'body':_0x36108d});return _0x532e36[_0xfe2ba(0x206)];}export async function deleteDbLink(_0x14c2fb){const _0x43c501=a143_0x5a92;await apiRequest(_0x43c501(0x211),{'method':_0x43c501(0x254),'body':{'id':_0x14c2fb}});}export async function testDbLinkConnect(_0x5a4e52){const _0x3127bf=a143_0x5a92,_0x53108e=await apiRequest(_0x3127bf(0x229)+buildQuery({'id':_0x5a4e52}));return _0x53108e['data'];}export async function startDbAnalysis(_0x2a598f,_0x17185d){const _0x36445d=a143_0x5a92,_0x13af8f=await apiRequest(_0x36445d(0x21c),{'method':_0x36445d(0x254),'body':{'dbLinkId':_0x2a598f,..._0x17185d&&_0x17185d['length']>0x0?{'tableNames':_0x17185d}:{}}}),_0x2dc397=_0x13af8f[_0x36445d(0x206)];if(typeof _0x2dc397===_0x36445d(0x256))return _0x2dc397;if(_0x2dc397&&typeof _0x2dc397===_0x36445d(0x219)&&typeof _0x2dc397[_0x36445d(0x1f0)]===_0x36445d(0x256))return _0x2dc397['planId'];return _0x2dc397!=null?String(_0x2dc397):'';}export async function cancelDbAnalysis(_0x21c60d){const _0x538ccb=a143_0x5a92;await apiRequest(_0x538ccb(0x231)+buildQuery({'planId':_0x21c60d}),{'method':_0x538ccb(0x254)});}export async function getDbAnalysisStatus(_0x203c4f){const _0x102121=a143_0x5a92,_0x387229=await apiRequest(_0x102121(0x233)+encodeURIComponent(_0x203c4f));return _0x387229[_0x102121(0x206)];}export async function getDbAllTableList(_0x54a6d1,_0x249f0b){const _0x34b88e=a143_0x5a92,_0x2b1122=await apiRequest(_0x34b88e(0x234)+buildQuery({'appCode':_0x54a6d1,'dbLinkId':_0x249f0b})),_0xe4c3e8=_0x2b1122[_0x34b88e(0x206)];if(Array[_0x34b88e(0x270)](_0xe4c3e8))return _0xe4c3e8;return extractList(_0xe4c3e8);}export async function getDbTableDiff(_0x4102e8,_0x444b94,_0x546249){const _0x2602a2=a143_0x5a92,_0x28d667=await apiRequest(_0x2602a2(0x23e)+buildQuery({'appCode':_0x4102e8,'dbLinkId':_0x444b94,'pageIndex':_0x546249?.[_0x2602a2(0x258)]??0x1,'pageSize':_0x546249?.[_0x2602a2(0x279)]??0x14,'tableName':_0x546249?.[_0x2602a2(0x26f)]})),_0x5d522=_0x28d667[_0x2602a2(0x206)];return{'totalCount':_0x5d522?.['totalCount']??0x0,'tableList':Array[_0x2602a2(0x270)](_0x5d522?.[_0x2602a2(0x1f9)])?_0x5d522[_0x2602a2(0x1f9)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x3d7845=a143_0x5a92,_0x4fbae0=await apiRequest(_0x3d7845(0x20f),{'method':_0x3d7845(0x254),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x251e93=extractList(_0x4fbae0[_0x3d7845(0x206)]),_0x15ab68=extractPaging(_0x4fbae0[_0x3d7845(0x206)]);return _0x15ab68&&_0x15ab68[_0x3d7845(0x20c)]>REMOTE_APP_PAGE_SIZE&&console[_0x3d7845(0x202)](_0x3d7845(0x23f)+REMOTE_APP_PAGE_SIZE+_0x3d7845(0x235)+_0x15ab68['totalCount']+_0x3d7845(0x1fc)+_0x3d7845(0x221)),_0x251e93;}
|
|
1
|
+
(function(_0x4aee99,_0x414a03){const _0x353019=a143_0x1804,_0x34b49d=_0x4aee99();while(!![]){try{const _0x5e6803=parseInt(_0x353019(0x13e))/0x1*(-parseInt(_0x353019(0x170))/0x2)+-parseInt(_0x353019(0x1a4))/0x3*(-parseInt(_0x353019(0x18a))/0x4)+-parseInt(_0x353019(0x1a7))/0x5*(parseInt(_0x353019(0x179))/0x6)+parseInt(_0x353019(0x134))/0x7*(-parseInt(_0x353019(0x189))/0x8)+parseInt(_0x353019(0x14a))/0x9*(parseInt(_0x353019(0x1a2))/0xa)+-parseInt(_0x353019(0x11a))/0xb*(parseInt(_0x353019(0x121))/0xc)+parseInt(_0x353019(0x153))/0xd;if(_0x5e6803===_0x414a03)break;else _0x34b49d['push'](_0x34b49d['shift']());}catch(_0x4019f9){_0x34b49d['push'](_0x34b49d['shift']());}}}(a143_0x5aa8,0x187e4));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';let _activeCookie;export function setActiveCookie(_0x172cd2){_activeCookie=_0x172cd2||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530;function createFetchFailureError(_0x2c1408,_0x4a1ecb){const _0x35a610=a143_0x1804,_0x3b8bc2=_0x4a1ecb instanceof Error?_0x4a1ecb[_0x35a610(0x137)]:String(_0x4a1ecb);return CliErrors[_0x35a610(0x16a)](_0x35a610(0x187)+_0x2c1408+(_0x3b8bc2?'\x20('+_0x3b8bc2+')':''),_0x35a610(0x181));}async function apiRequest(_0x57a561,_0x49f91d={}){const _0x4f7107=a143_0x1804,{method:method=_0x4f7107(0x15e),body:_0x4347b9,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![]}=_0x49f91d,_0xe6976d=useRuntime?getRuntimeDomain():getApiDomain(),_0x4ffed8=_activeCookie||getCookie(),_0x48695b=''+_0xe6976d+_0x57a561,_0x23dae7=new AbortController(),_0x525853=setTimeout(()=>_0x23dae7[_0x4f7107(0x158)](),timeout);try{const _0xee6523=await fetch(_0x48695b,{'method':method,'headers':{'Content-Type':_0x4f7107(0x135),'Cookie':_0x4ffed8,'X-Invoke-Source':_0x4f7107(0x13a),...headers},'body':_0x4347b9?JSON[_0x4f7107(0x147)](_0x4347b9):undefined,'signal':_0x23dae7['signal']});let _0x74a705;try{_0x74a705=await _0xee6523[_0x4f7107(0x15b)]();}catch{throw CliErrors[_0x4f7107(0x16a)]('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0xee6523[_0x4f7107(0x193)]+')',_0xee6523[_0x4f7107(0x193)]>=0x190?_0x4f7107(0x182):undefined);}if(!_0xee6523['ok']||_0x74a705[_0x4f7107(0x155)]===![])throw CliErrors[_0x4f7107(0x16a)](_0x74a705[_0x4f7107(0x1b0)]||_0x74a705[_0x4f7107(0x137)]||_0x4f7107(0x11f)+_0xee6523['status'],_0x74a705[_0x4f7107(0x127)]?_0x4f7107(0x168)+_0x74a705[_0x4f7107(0x127)]:undefined);return _0x74a705;}catch(_0x209bf0){if(_0x209bf0 instanceof CliError)throw _0x209bf0;if(_0x209bf0 instanceof Error&&_0x209bf0[_0x4f7107(0x1b2)]===_0x4f7107(0x1ae))throw CliErrors['apiError'](_0x4f7107(0x164)+_0x48695b);throw createFetchFailureError(_0x48695b,_0x209bf0);}finally{clearTimeout(_0x525853);}}function isAuthFailure(_0x3503c5){const _0x3df561=a143_0x1804,_0x7e37f3=_0x3503c5['errorMsg']||_0x3503c5[_0x3df561(0x137)]||_0x3503c5[_0x3df561(0x143)]?.['message']||_0x3503c5['errorMessage']||_0x3503c5[_0x3df561(0x171)]||'';return _0x3503c5[_0x3df561(0x127)]===_0x3df561(0x197)||_0x3503c5[_0x3df561(0x198)]===0x191||_0x3503c5[_0x3df561(0x198)]==='401'||_0x7e37f3[_0x3df561(0x11d)](_0x3df561(0x161))||_0x7e37f3['includes'](_0x3df561(0x178))||_0x7e37f3[_0x3df561(0x11d)]('登录')||_0x7e37f3[_0x3df561(0x11d)]('认证');}export async function platformFetch(_0x12d862,_0x4d94b1){const _0x462d03=a143_0x1804;let _0xbc411a;try{_0xbc411a=await fetch(_0x12d862,{'method':_0x4d94b1[_0x462d03(0x160)]??_0x462d03(0x15e),'headers':{'Content-Type':_0x462d03(0x135),'Cookie':_0x4d94b1[_0x462d03(0x19a)],'X-Invoke-Source':'cli:rabetbase'},..._0x4d94b1[_0x462d03(0x165)]&&{'body':JSON[_0x462d03(0x147)](_0x4d94b1[_0x462d03(0x165)])}});}catch(_0x4dc570){throw createFetchFailureError(_0x12d862,_0x4dc570);}if(!_0xbc411a['ok']){if(_0xbc411a['status']===0x191)throw CliErrors[_0x462d03(0x13c)]();throw CliErrors['apiError'](_0x4d94b1['label']+_0x462d03(0x19d)+_0xbc411a['status']);}const _0x41796b=await _0xbc411a['json']();if(_0x41796b['success']===![]){if(isAuthFailure(_0x41796b))throw CliErrors[_0x462d03(0x13c)]();throw CliErrors[_0x462d03(0x16a)](_0x41796b[_0x462d03(0x1b0)]||_0x41796b['message']||_0x4d94b1['label']+_0x462d03(0x1a8));}return _0x41796b[_0x462d03(0x143)];}export async function listBffScripts(_0x2a2fe4,_0x436679,_0x4ffce4){const _0x15f88d=a143_0x1804;let _0xd374f7=_0x15f88d(0x15d)+_0x2a2fe4;if(_0x436679)_0xd374f7+=_0x15f88d(0x192)+_0x436679;const _0x1be353=await apiRequest(_0xd374f7);let _0x4eb073=extractList(_0x1be353[_0x15f88d(0x143)]);if(_0x4ffce4?.[_0x15f88d(0x124)]){const _0x42cdb9=_0x4ffce4[_0x15f88d(0x124)][_0x15f88d(0x151)]();_0x4eb073=_0x4eb073[_0x15f88d(0x185)](_0x59d001=>_0x59d001['functionName']?.[_0x15f88d(0x151)]()[_0x15f88d(0x11d)](_0x42cdb9)||_0x59d001[_0x15f88d(0x1b3)]?.[_0x15f88d(0x151)]()['includes'](_0x42cdb9));}return _0x4eb073;}export async function getBffScriptInfo(_0x3bc3ae){const _0x5ccc17=a143_0x1804,_0x2c1c7d=await apiRequest('/api/management/library/scripts/info?id='+_0x3bc3ae);if(!_0x2c1c7d['data'])throw CliErrors[_0x5ccc17(0x191)](_0x5ccc17(0x11e)+_0x3bc3ae);return _0x2c1c7d[_0x5ccc17(0x143)];}export async function saveBffScript(_0x29a82b){const _0x2e51=a143_0x1804,_0x2736e7=await apiRequest(_0x2e51(0x12b),{'method':_0x2e51(0x18c),'body':_0x29a82b}),{id:_0x21a2b3,entity:_0x2cd4e5}=normalizeEntityWithIdResponse(_0x2736e7['data']);if(_0x21a2b3!==undefined){const _0x6e428b=typeof _0x2cd4e5['functionName']===_0x2e51(0x125)||typeof _0x2cd4e5[_0x2e51(0x12d)]===_0x2e51(0x125)?_0x2cd4e5:undefined;return{'id':_0x21a2b3,'script':_0x6e428b};}throw CliErrors[_0x2e51(0x16a)](_0x2e51(0x17c));}export async function deleteBffScript(_0x226ee0){const _0x95668f=a143_0x1804;await apiRequest('/api/management/library/scripts/delete',{'method':_0x95668f(0x18c),'body':{'id':_0x226ee0}});}export async function getBffScriptStatistics(_0x50cfb6){const _0x8989bc=a143_0x1804,_0x3eb5ed=await apiRequest(_0x8989bc(0x19b)+_0x50cfb6);return extractList(_0x3eb5ed[_0x8989bc(0x143)]);}export async function clearBffScriptCache(){const _0x57b622=a143_0x1804,_0x12cbd9=await apiRequest(_0x57b622(0x159),{'method':'POST','useRuntime':!![]});return typeof _0x12cbd9['data']===_0x57b622(0x125)?_0x12cbd9[_0x57b622(0x143)]:'';}export async function listBffDatasetOperations(_0x499fbf,_0x4df9c1){const _0x2ca746=a143_0x1804,_0x489f9b=await apiRequest('/smartapi/dataset/get-dataset-operation',{'method':_0x2ca746(0x18c),'body':{'appCode':_0x499fbf,'datasetId':_0x4df9c1}});return _0x489f9b[_0x2ca746(0x143)];}function a143_0x5aa8(){const _0x2d4d08=['pageIndex','type','/smartapi/custom/getUserCustomSql?id=','/smartapi/dblink/update','/smartapi/db-analysis/status/','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','7pBnFLK','application/json','getOne','message','.filter({','/smartapi/lovrabet/detail?pageId=','cli:rabetbase','/smartapi/dataset/delete-dataset','authRequired','dbId','1MZTWzC','/smartapi/question/er-config','(/*\x20params\x20*/);','sdk','length','data','/smartapi/question/er-config/erCreate','/smartapi/dataset/update-driven-data','currentPage','stringify','/standard-page-status?appCode=','/smartapi/custom/deleteUserCustomSql','468513ARRYIG','requestFields','operationName','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','/smartapi/dataset/get-driven-data?','/smartapi/custom/queryUserCustomSqlList','/smartapi/app/getList','toLowerCase','/filter','3632369eYjmSy','/generate-standard-pages/status?','success','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','/api/custom/executeSql','abort','/api/management/script/cache/clear','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','json','?sqlCode=','/api/management/library/scripts/list?appCode=','GET','sqlName','method','401','object','map','Request\x20timeout:\x20','body','/smartapi/dblink/testConnect','api_error','API\x20error\x20code:\x20','pageSize','apiError','.remove(id);','operationId','totalCount','join','const\x20result\x20=\x20await\x20client.models.','42892pQfqvT','error','tableList','set','tableData','includeImports','/smartapi/custom/getUserCustomSql','SQL\x20query\x20not\x20found:\x20','Unauthorized','41058jvVOgV','\x20apps.\x20','const\x20results\x20=\x20data.execResult\x20||\x20[];','BFF\x20save\x20returned\x20no\x20valid\x20id','delete','SQL\x20query\x20not\x20found:\x20id=','\x20\x20sqlCode:\x20\x27','/smartapi/db-analysis/start','Check\x20network\x20connectivity\x20and\x20try\x20again.','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','const\x20data\x20=\x20await\x20client.sql.execute({','\x22\x20not\x20found\x20in\x20dataset\x20','filter','/sync-to-pages','Request\x20failed:\x20','path','291944fSOjvV','4nIDyYM','/smartapi/custom/saveUserCustomSql','POST','\x20\x20});','Warning:\x20showing\x20first\x20','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','target','validation','&type=','status','Page\x20not\x20found:\x20','update','//\x20','UNAUTHORIZED','code','operations','cookie','/api/management/library/scripts/statistics?appCode=','modelId','\x20failed,\x20HTTP\x20','dataset_','table','/smartapi/question/er-config/update-single','push','10dFEOpY','/smartapi/dblink/getOne','321279KJtbRG','toString','tableName','130hETsIU','\x20failed','\x20\x20where:\x20{},','version','isArray','});','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','AbortError','find','errorMsg','dbtableConfig','name','description','warn','entries','modelCode','create','/smartapi/dblink/getList','15862HvWJGm','planId','\x20\x20return\x20rows;','includes','BFF\x20script\x20not\x20found:\x20id=','API\x20error:\x20','/smartapi/question/er-config/erDelete','852ttckAK','/smartapi/lovrabet/dataset/','replace','scriptName','string','Dataset\x20not\x20found:\x20','errorCode','/smartapi/custom/updateUserCustomSql','add','sqlCode','/api/management/library/scripts/save','clientOperationId','scriptType'];a143_0x5aa8=function(){return _0x2d4d08;};return a143_0x5aa8();}export async function listSqlQueries(_0x5635bc,_0x5c4d70){const _0x36fb09=a143_0x1804,_0x37e4e8=await apiRequest(_0x36fb09(0x14f),{'method':_0x36fb09(0x18c),'body':{'appCode':_0x5635bc,'currentPage':_0x5c4d70?.['currentPage']??0x1,'pageSize':_0x5c4d70?.[_0x36fb09(0x169)]??0x32,'sqlCode':_0x5c4d70?.[_0x36fb09(0x12a)],'sqlName':_0x5c4d70?.['sqlName']}});return _0x37e4e8[_0x36fb09(0x143)];}export async function getSqlQueryInfo(_0x209a37,_0x4efe7d){const _0xdeb29e=a143_0x1804,_0x7e19b8=await listSqlQueries(_0x209a37,{'sqlCode':_0x4efe7d}),_0x26805e=_0x7e19b8['tableData']?.[0x0];if(!_0x26805e)throw CliErrors['validation'](_0xdeb29e(0x177)+_0x4efe7d);return _0x26805e;}export async function getSqlQueryDetail(_0x22fa59){const _0x4cc2ea=a143_0x1804,_0x4f18fa=await apiRequest(_0x4cc2ea(0x176)+(_0x4cc2ea(0x15c)+encodeURIComponent(_0x22fa59)));if(!_0x4f18fa[_0x4cc2ea(0x143)])throw CliErrors[_0x4cc2ea(0x191)](_0x4cc2ea(0x177)+_0x22fa59);return _0x4f18fa[_0x4cc2ea(0x143)];}export async function getSqlQueryDetailById(_0x1eedb4){const _0x1d1ae9=a143_0x1804,_0x129803=await apiRequest(_0x1d1ae9(0x130)+_0x1eedb4);if(!_0x129803['data'])throw CliErrors['validation'](_0x1d1ae9(0x17e)+_0x1eedb4);return _0x129803[_0x1d1ae9(0x143)];}export async function createSqlQuery(_0x115d5d){const _0x14aba0=a143_0x1804,_0x1b1579=await apiRequest(_0x14aba0(0x18b),{'method':_0x14aba0(0x18c),'body':_0x115d5d}),{id:_0x1999f9,entity:_0x268e48}=normalizeEntityWithIdResponse(_0x1b1579[_0x14aba0(0x143)]);if(!('sqlCode'in _0x268e48)&&_0x1999f9)return getSqlQueryDetailById(_0x1999f9);return normalizeSqlQueryEntity(_0x268e48);}export async function updateSqlQuery(_0x55a20f){const _0x180d2d=a143_0x1804,_0x290be2=await apiRequest(_0x180d2d(0x128),{'method':_0x180d2d(0x18c),'body':_0x55a20f}),{id:_0xeb20f9,entity:_0x5e634e}=normalizeEntityWithIdResponse(_0x290be2[_0x180d2d(0x143)]);if(!(_0x180d2d(0x12a)in _0x5e634e)){if(_0x55a20f[_0x180d2d(0x12a)])return getSqlQueryDetail(_0x55a20f[_0x180d2d(0x12a)]);if(_0xeb20f9)return getSqlQueryDetailById(_0xeb20f9);}return normalizeSqlQueryEntity(_0x5e634e);}export async function deleteSqlQuery(_0x53b8b2){const _0x33c4df=a143_0x1804;await apiRequest(_0x33c4df(0x149),{'method':'POST','body':_0x53b8b2});}export async function saveSqlQuery(_0x1dd279){const _0x472f76=a143_0x1804,_0x174e6c=await apiRequest('/api/node-toolbox/sql/save',{'method':_0x472f76(0x18c),'body':_0x1dd279});return _0x174e6c[_0x472f76(0x143)];}function normalizeSqlQueryEntity(_0x5dbf07){const _0x4784fc=a143_0x1804;return{..._0x5dbf07,'id':Number(_0x5dbf07['id']),'dbId':_0x5dbf07[_0x4784fc(0x13d)]==null?undefined:Number(_0x5dbf07['dbId']),'version':_0x5dbf07[_0x4784fc(0x1aa)]==null?undefined:Number(_0x5dbf07[_0x4784fc(0x1aa)])};}export async function executeSql(_0x43f1c8,_0x10bb1e,_0x4e35f6){const _0x5adc7d=a143_0x1804,_0x37d88c=await apiRequest(_0x5adc7d(0x157),{'method':_0x5adc7d(0x18c),'body':{'appCode':_0x43f1c8,'sqlCode':_0x10bb1e,..._0x4e35f6&&{'params':_0x4e35f6}},'useRuntime':!![]});return _0x37d88c['data'];}export async function executeDatasetDataOperation(_0x9c369b,_0x24d3d4,_0x56b8ae,_0x4eb092={}){const _0x3687c1=a143_0x1804;try{const _0x365406=await apiRequest('/api/'+_0x9c369b+'/'+_0x24d3d4+'/'+_0x56b8ae,{'method':_0x3687c1(0x18c),'body':_0x4eb092,'useRuntime':!![]});return _0x365406[_0x3687c1(0x143)];}catch(_0x479833){if(_0x56b8ae===_0x3687c1(0x136)&&_0x479833 instanceof CliError&&_0x479833['code']===_0x3687c1(0x167)&&_0x4eb092['id']!==undefined&&_0x4eb092['id']!==null&&_0x4eb092['id']!==''){const _0x260fb4=await apiRequest('/api/'+_0x9c369b+'/'+_0x24d3d4+_0x3687c1(0x152),{'method':'POST','body':{'where':{'id':{'$eq':_0x4eb092['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x76886c=Array[_0x3687c1(0x1ab)](_0x260fb4[_0x3687c1(0x143)]?.[_0x3687c1(0x174)])?_0x260fb4[_0x3687c1(0x143)][_0x3687c1(0x174)]:[];return _0x76886c[0x0]??null;}throw _0x479833;}}export async function listDatasets(_0x4ec384,_0xc3a246){const _0x5523fb=a143_0x1804,_0x3d3964={'appCode':_0x4ec384,'deleted':![]};if(_0xc3a246?.[_0x5523fb(0x198)])_0x3d3964[_0x5523fb(0x198)]=_0xc3a246[_0x5523fb(0x198)];if(_0xc3a246?.['name'])_0x3d3964[_0x5523fb(0x1b2)]=_0xc3a246[_0x5523fb(0x1b2)];const _0xe06882=await apiRequest('/smartapi/dataset/get-dataset-list',{'method':_0x5523fb(0x18c),'body':_0x3d3964});return extractList(_0xe06882[_0x5523fb(0x143)]);}export async function deleteDataset(_0x19ecec,_0x3d5b52){const _0x439f17=a143_0x1804;await apiRequest(_0x439f17(0x13b),{'method':'POST','body':{'appCode':_0x19ecec,'datasetId':_0x3d5b52}});}export async function searchDatasets(_0x4f16fe,_0x57a20d){const _0x590767=a143_0x1804,_0x30d5e5=await listDatasets(_0x4f16fe,{'name':_0x57a20d}),_0x153c2a=_0x57a20d[_0x590767(0x151)](),_0x115c6e=new Set(_0x30d5e5['map'](_0x44c0f7=>_0x44c0f7['id'])),_0x5811a6=_0x30d5e5[_0x590767(0x185)](_0x36c8e6=>_0x36c8e6['dbtableConfig']?.[_0x590767(0x1a6)]?.['toLowerCase']()[_0x590767(0x11d)](_0x153c2a)||_0x36c8e6[_0x590767(0x1b3)]?.[_0x590767(0x151)]()['includes'](_0x153c2a)),_0x5b61ea=await listDatasets(_0x4f16fe,{'code':_0x57a20d});for(const _0x43c986 of _0x5b61ea){!_0x115c6e['has'](_0x43c986['id'])&&(_0x30d5e5[_0x590767(0x1a1)](_0x43c986),_0x115c6e[_0x590767(0x129)](_0x43c986['id']));}return _0x30d5e5;}export function normalizeDatasetOperations(_0x218ddd){const _0x3c8749=a143_0x1804;if(Array[_0x3c8749(0x1ab)](_0x218ddd))return _0x218ddd[_0x3c8749(0x185)](_0x34947c=>_0x34947c!=null&&typeof _0x34947c===_0x3c8749(0x162));if(_0x218ddd&&typeof _0x218ddd===_0x3c8749(0x162))return Object['entries'](_0x218ddd)[_0x3c8749(0x185)](([,_0x2ca0a9])=>_0x2ca0a9!=null&&typeof _0x2ca0a9===_0x3c8749(0x162))[_0x3c8749(0x163)](([_0x471fd9,_0x3728fc])=>({..._0x3728fc,'name':_0x3728fc[_0x3c8749(0x1b2)]??_0x3728fc[_0x3c8749(0x14c)]??_0x471fd9}));return[];}export async function getDatasetDetail(_0x202151){const _0x311caa=a143_0x1804,_0x55495d=/^\d+$/['test'](_0x202151)?'id':_0x311caa(0x198),_0x1facd8=await apiRequest(_0x311caa(0x14e)+_0x55495d+'='+_0x202151);return _0x1facd8[_0x311caa(0x143)];}export async function updateDrivenData(_0x5c0756){const _0x31dfa2=a143_0x1804,_0x419ccc=await apiRequest(_0x31dfa2(0x145),{'method':_0x31dfa2(0x18c),'body':_0x5c0756});return _0x419ccc[_0x31dfa2(0x143)];}export async function getDatasetOperations(_0x1b3783){const _0x524b88=a143_0x1804,_0x49e5bf=await getDatasetDetail(_0x1b3783),_0x5090b5=normalizeDatasetOperations(_0x49e5bf['operations'])[_0x524b88(0x163)](_0x42f22d=>({'name':_0x42f22d[_0x524b88(0x1b2)]||_0x42f22d[_0x524b88(0x14c)],'displayName':_0x42f22d['displayName']||_0x42f22d['name'],'type':_0x42f22d[_0x524b88(0x12f)],'method':_0x42f22d[_0x524b88(0x160)],'path':_0x42f22d[_0x524b88(0x188)],'enabled':_0x42f22d['enabled']??!![],'requestFields':_0x42f22d[_0x524b88(0x14b)],'responseFields':_0x42f22d['responseFields']}));return{'dataset':{'id':_0x49e5bf['id']??_0x49e5bf[_0x524b88(0x19c)],'name':_0x49e5bf['name'],'code':_0x49e5bf[_0x524b88(0x198)]||_0x49e5bf[_0x524b88(0x1b6)],'tableName':_0x49e5bf['tableName']||_0x49e5bf[_0x524b88(0x1b1)]?.['tableName']},'operations':_0x5090b5};}export async function getOperationDetail(_0x349dc8,_0x388836,_0xae8c1e){const _0x48b288=a143_0x1804;let _0x22165d=_0x388836;if(!/^\d+$/['test'](_0x388836)){const _0x37c6b6=await listDatasets(_0x349dc8,{'code':_0x388836}),_0x41d32f=_0x37c6b6[_0x48b288(0x1af)](_0x27a530=>_0x27a530[_0x48b288(0x198)]===_0x388836||String(_0x27a530['id'])===_0x388836);if(!_0x41d32f)throw CliErrors[_0x48b288(0x191)](_0x48b288(0x126)+_0x388836);_0x22165d=String(_0x41d32f['id']);}const _0x1f0f25=await getDatasetDetail(_0x22165d),_0x1a416a=normalizeDatasetOperations(_0x1f0f25[_0x48b288(0x199)])[_0x48b288(0x1af)](_0x3da115=>(_0x3da115[_0x48b288(0x1b2)]||_0x3da115[_0x48b288(0x14c)])===_0xae8c1e);if(!_0x1a416a)throw CliErrors[_0x48b288(0x191)]('Operation\x20\x22'+_0xae8c1e+_0x48b288(0x184)+_0x388836);return{'dataset':{'id':_0x1f0f25['id']??_0x1f0f25[_0x48b288(0x19c)],'name':_0x1f0f25[_0x48b288(0x1b2)],'code':_0x1f0f25[_0x48b288(0x198)]||_0x1f0f25['modelCode'],'tableName':_0x1f0f25[_0x48b288(0x1a6)]||_0x1f0f25[_0x48b288(0x1b1)]?.[_0x48b288(0x1a6)]},'operation':_0x1a416a};}export async function startGenerateStandardPages(_0x90b1a4,_0x3c106c,_0x49d627){const _0x497337=a143_0x1804,_0x4e3d71=await apiRequest(_0x497337(0x122)+_0x3c106c+'/generate-standard-pages/start',{'method':_0x497337(0x18c),'body':{'appCode':_0x90b1a4,..._0x49d627?.[_0x497337(0x12c)]?{'clientOperationId':_0x49d627['clientOperationId']}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x4e3d71[_0x497337(0x143)];}export async function getGenerateStandardPagesStatus(_0x37fae5,_0x25192b,_0xa98af0){const _0x393f47=a143_0x1804,_0x53e23e=new URLSearchParams({'appCode':_0x37fae5});_0xa98af0[_0x393f47(0x16c)]&&_0x53e23e[_0x393f47(0x173)](_0x393f47(0x16c),_0xa98af0['operationId']);_0xa98af0[_0x393f47(0x12c)]&&_0x53e23e[_0x393f47(0x173)]('clientOperationId',_0xa98af0[_0x393f47(0x12c)]);const _0x482f10=await apiRequest(_0x393f47(0x122)+_0x25192b+_0x393f47(0x154)+_0x53e23e['toString']());return _0x482f10[_0x393f47(0x143)];}export async function getStandardPageStatus(_0x616e65,_0x3154d8){const _0x5bb86c=a143_0x1804,_0x225e53=await apiRequest(_0x5bb86c(0x122)+_0x3154d8+_0x5bb86c(0x148)+encodeURIComponent(_0x616e65));return _0x225e53[_0x5bb86c(0x143)];}export async function tryGetStandardPageStatus(_0x14ade1,_0x315cc2){const _0xd982e0=a143_0x1804;try{return await getStandardPageStatus(_0x14ade1,_0x315cc2);}catch(_0x134599){if(_0x134599 instanceof CliError&&_0x134599['code']==='api_error'&&/404|not found|non-json response/i['test'](_0x134599[_0xd982e0(0x137)]))return null;throw _0x134599;}}export async function syncStandardPages(_0x516e15,_0x3bb63d){const _0x1018a9=a143_0x1804,_0x258d6d=await apiRequest(_0x1018a9(0x122)+_0x3bb63d+_0x1018a9(0x186),{'method':_0x1018a9(0x18c),'body':{'appCode':_0x516e15}});return _0x258d6d['data'];}export async function getPageDetail(_0x29e4be){const _0x539c5f=a143_0x1804,_0x145e04=await apiRequest(_0x539c5f(0x139)+_0x29e4be);if(!_0x145e04[_0x539c5f(0x143)])throw CliErrors[_0x539c5f(0x191)](_0x539c5f(0x194)+_0x29e4be);return _0x145e04[_0x539c5f(0x143)];}export async function updatePage(_0x35e229,_0x4eccd9,_0x259c4,_0x20d8fe){const _0x1a399d=a143_0x1804,_0x1a07bf=await apiRequest('/smartapi/lovrabet/update-page',{'method':_0x1a399d(0x18c),'body':{'appCode':_0x35e229,'pageId':_0x4eccd9,'code':_0x259c4,'datasetIds':_0x20d8fe}});return _0x1a07bf['data'];}export function generateSdkCode(_0x586fcf,_0x2de7d2,_0x2860b0){const _0x4d3d21=a143_0x1804,_0x3c87be=_0x2860b0?.[_0x4d3d21(0x175)]??!![],_0x40062f=_0x4d3d21(0x19e)+_0x586fcf['code']?.[_0x4d3d21(0x123)](/-/g,'_'),_0x72bc6=_0x2de7d2['name']||_0x2de7d2[_0x4d3d21(0x14c)]||_0x4d3d21(0x185),_0x259f49=[];_0x3c87be&&_0x259f49['push']('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','');_0x259f49['push'](_0x4d3d21(0x196)+_0x586fcf[_0x4d3d21(0x1b2)]+'\x20('+(_0x586fcf['tableName']||_0x4d3d21(0x19f))+')');if(_0x72bc6===_0x4d3d21(0x185))_0x259f49[_0x4d3d21(0x1a1)](_0x4d3d21(0x16f)+_0x40062f+_0x4d3d21(0x138),_0x4d3d21(0x1a9),'\x20\x20pageSize:\x2020,','\x20\x20currentPage:\x201,','});');else{if(_0x72bc6===_0x4d3d21(0x136))_0x259f49[_0x4d3d21(0x1a1)](_0x4d3d21(0x16f)+_0x40062f+'.getOne(id);');else{if(_0x72bc6===_0x4d3d21(0x1b7))_0x259f49[_0x4d3d21(0x1a1)](_0x4d3d21(0x16f)+_0x40062f+'.create({\x20/*\x20fields\x20*/\x20});');else{if(_0x72bc6===_0x4d3d21(0x195))_0x259f49[_0x4d3d21(0x1a1)](_0x4d3d21(0x16f)+_0x40062f+_0x4d3d21(0x18f));else _0x72bc6===_0x4d3d21(0x17d)||_0x72bc6==='remove'?_0x259f49[_0x4d3d21(0x1a1)](_0x4d3d21(0x16f)+_0x40062f+_0x4d3d21(0x16b)):_0x259f49[_0x4d3d21(0x1a1)](_0x4d3d21(0x16f)+_0x40062f+'.'+_0x72bc6+_0x4d3d21(0x140));}}}return _0x259f49[_0x4d3d21(0x16e)]('\x0a');}export function generateSqlCodeTemplate(_0x175370,_0x3c520c){const _0x509c6=a143_0x1804,_0x298d76=_0x3c520c?.[_0x509c6(0x190)]??_0x509c6(0x141),_0x4a1f8d=_0x3c520c?.[_0x509c6(0x175)]??!![],_0x52cdce=[];return _0x52cdce[_0x509c6(0x1a1)]('//\x20SQL:\x20'+_0x175370[_0x509c6(0x15f)]+'\x20('+_0x175370['sqlCode']+')'),_0x298d76===_0x509c6(0x141)?(_0x4a1f8d&&_0x52cdce[_0x509c6(0x1a1)](_0x509c6(0x1ad),'',_0x509c6(0x14d),''),_0x52cdce[_0x509c6(0x1a1)](_0x509c6(0x183),_0x509c6(0x17f)+_0x175370[_0x509c6(0x12a)]+'\x27,',_0x509c6(0x156),_0x509c6(0x1ac),'if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);',_0x509c6(0x17b))):_0x52cdce['push'](_0x509c6(0x133),'export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{',_0x509c6(0x15a),'\x20\x20\x20\x20sqlCode:\x20\x27'+_0x175370[_0x509c6(0x12a)]+'\x27,','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x509c6(0x18d),_0x509c6(0x11c),'}'),_0x52cdce[_0x509c6(0x16e)]('\x0a');}export async function getErConfig(_0x1c9703,_0x7bca5d){const _0x5ccdda=a143_0x1804,_0xf4ee1c=await apiRequest(_0x5ccdda(0x13f),{'method':_0x5ccdda(0x18c),'body':{'appCode':_0x1c9703,'dblinkId':_0x7bca5d}});return _0xf4ee1c[_0x5ccdda(0x143)];}export async function createErRelation(_0x499b63){const _0x3f49c1=a143_0x1804,_0x44171c=await apiRequest(_0x3f49c1(0x144),{'method':_0x3f49c1(0x18c),'body':_0x499b63});return _0x44171c['data'];}export async function updateErRelation(_0x4e2541){const _0x9b7086=a143_0x1804,_0x175615=await apiRequest(_0x9b7086(0x1a0),{'method':_0x9b7086(0x18c),'body':_0x4e2541});return _0x175615[_0x9b7086(0x143)];}export async function deleteErRelation(_0xb713e8){const _0x30f2e3=a143_0x1804,_0x40c64d=await apiRequest(_0x30f2e3(0x120),{'method':_0x30f2e3(0x18c),'body':_0xb713e8});return _0x40c64d[_0x30f2e3(0x143)];}function buildQuery(_0x17b392){const _0x4fb8e8=a143_0x1804,_0x12d41c=new URLSearchParams();for(const [_0x1f91f5,_0xe5a708]of Object[_0x4fb8e8(0x1b5)](_0x17b392)){if(_0xe5a708===undefined||_0xe5a708==='')continue;_0x12d41c[_0x4fb8e8(0x173)](_0x1f91f5,String(_0xe5a708));}const _0x5257b4=_0x12d41c[_0x4fb8e8(0x1a5)]();return _0x5257b4?'?'+_0x5257b4:'';}export async function listDbLinks(_0x48200c,_0x24b08f){const _0xf368bf=a143_0x1804,_0x1ac1db=await apiRequest(_0xf368bf(0x119),{'method':_0xf368bf(0x18c),'body':{'appCode':_0x48200c,'currentPage':_0x24b08f?.[_0xf368bf(0x146)]??0x1,'pageSize':_0x24b08f?.['pageSize']??0x64}});return{'items':extractList(_0x1ac1db[_0xf368bf(0x143)]),'paging':extractPaging(_0x1ac1db['data'])};}export async function getDbLinkInfo(_0x1045eb){const _0x4d09b1=a143_0x1804,_0x25ddb6=await apiRequest(_0x4d09b1(0x1a3)+buildQuery({'id':_0x1045eb}));return _0x25ddb6[_0x4d09b1(0x143)];}export async function createDbLink(_0x56ff3f){const _0x33fea3=a143_0x1804,_0x458cce=await apiRequest('/smartapi/dblink/create',{'method':_0x33fea3(0x18c),'body':_0x56ff3f});return _0x458cce[_0x33fea3(0x143)];}function a143_0x1804(_0x113be9,_0x234615){_0x113be9=_0x113be9-0x119;const _0x5aa82d=a143_0x5aa8();let _0x180454=_0x5aa82d[_0x113be9];return _0x180454;}export async function updateDbLink(_0x18dad1){const _0x3738e2=a143_0x1804,_0x27eff8=await apiRequest(_0x3738e2(0x131),{'method':_0x3738e2(0x18c),'body':_0x18dad1});return _0x27eff8['data'];}export async function deleteDbLink(_0x55b577){const _0x5b1343=a143_0x1804;await apiRequest('/smartapi/dblink/delete',{'method':_0x5b1343(0x18c),'body':{'id':_0x55b577}});}export async function testDbLinkConnect(_0x482d7e){const _0x207ed8=a143_0x1804,_0x5dc15f=await apiRequest(_0x207ed8(0x166)+buildQuery({'id':_0x482d7e}));return _0x5dc15f[_0x207ed8(0x143)];}export async function startDbAnalysis(_0x19ba94,_0x1d8691){const _0x2d69e4=a143_0x1804,_0x6ec84b=await apiRequest(_0x2d69e4(0x180),{'method':_0x2d69e4(0x18c),'body':{'dbLinkId':_0x19ba94,..._0x1d8691&&_0x1d8691[_0x2d69e4(0x142)]>0x0?{'tableNames':_0x1d8691}:{}}}),_0x2f13d3=_0x6ec84b[_0x2d69e4(0x143)];if(typeof _0x2f13d3==='string')return _0x2f13d3;if(_0x2f13d3&&typeof _0x2f13d3===_0x2d69e4(0x162)&&typeof _0x2f13d3[_0x2d69e4(0x11b)]===_0x2d69e4(0x125))return _0x2f13d3[_0x2d69e4(0x11b)];return _0x2f13d3!=null?String(_0x2f13d3):'';}export async function cancelDbAnalysis(_0x55b1e5){const _0x4bedc2=a143_0x1804;await apiRequest('/smartapi/db-analysis/jobs/cancel'+buildQuery({'planId':_0x55b1e5}),{'method':_0x4bedc2(0x18c)});}export async function getDbAnalysisStatus(_0x29e876){const _0x5dda67=a143_0x1804,_0x368d3c=await apiRequest(_0x5dda67(0x132)+encodeURIComponent(_0x29e876));return _0x368d3c[_0x5dda67(0x143)];}export async function getDbAllTableList(_0x345f29,_0x2da77f){const _0x10ea7b=a143_0x1804,_0x1e934d=await apiRequest('/smartapi/dblink/getAllTableList'+buildQuery({'appCode':_0x345f29,'dbLinkId':_0x2da77f})),_0x20c4ff=_0x1e934d['data'];if(Array[_0x10ea7b(0x1ab)](_0x20c4ff))return _0x20c4ff;return extractList(_0x20c4ff);}export async function getDbTableDiff(_0x5ec4e1,_0x59beb7,_0x367416){const _0x1400e9=a143_0x1804,_0x3877a7=await apiRequest('/smartapi/dblink/getTableDiffV2ByPage'+buildQuery({'appCode':_0x5ec4e1,'dbLinkId':_0x59beb7,'pageIndex':_0x367416?.[_0x1400e9(0x12e)]??0x1,'pageSize':_0x367416?.[_0x1400e9(0x169)]??0x14,'tableName':_0x367416?.[_0x1400e9(0x1a6)]})),_0x171010=_0x3877a7[_0x1400e9(0x143)];return{'totalCount':_0x171010?.[_0x1400e9(0x16d)]??0x0,'tableList':Array[_0x1400e9(0x1ab)](_0x171010?.[_0x1400e9(0x172)])?_0x171010[_0x1400e9(0x172)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x45da67=a143_0x1804,_0x5f4018=await apiRequest(_0x45da67(0x150),{'method':'POST','body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x4d39fe=extractList(_0x5f4018[_0x45da67(0x143)]),_0x3137da=extractPaging(_0x5f4018[_0x45da67(0x143)]);return _0x3137da&&_0x3137da['totalCount']>REMOTE_APP_PAGE_SIZE&&console[_0x45da67(0x1b4)](_0x45da67(0x18e)+REMOTE_APP_PAGE_SIZE+'\x20of\x20'+_0x3137da[_0x45da67(0x16d)]+_0x45da67(0x17a)+'Use\x20the\x20platform\x20console\x20to\x20see\x20all.'),_0x4d39fe;}
|
package/lib/core/bff/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a144_0x1c9bc0=a144_0x4260;(function(_0x40f1aa,_0x53984e){const _0x4ea36c=a144_0x4260,_0xcb52af=_0x40f1aa();while(!![]){try{const _0x5f067a=-parseInt(_0x4ea36c(0x1c9))/0x1+parseInt(_0x4ea36c(0x1d0))/0x2*(-parseInt(_0x4ea36c(0x1cb))/0x3)+-parseInt(_0x4ea36c(0x1ce))/0x4*(parseInt(_0x4ea36c(0x1ca))/0x5)+parseInt(_0x4ea36c(0x1cd))/0x6+-parseInt(_0x4ea36c(0x1c4))/0x7+parseInt(_0x4ea36c(0x1c7))/0x8*(-parseInt(_0x4ea36c(0x1d2))/0x9)+parseInt(_0x4ea36c(0x1d1))/0xa;if(_0x5f067a===_0x53984e)break;else _0xcb52af['push'](_0xcb52af['shift']());}catch(_0x226085){_0xcb52af['push'](_0xcb52af['shift']());}}}(a144_0x2167,0x70511));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a144_0x1c9bc0(0x1c8),LOCK_FILE_NAME=a144_0x1c9bc0(0x1c6),TRASH_DIR_NAME=a144_0x1c9bc0(0x1c5);export function loadBffProjectConfig(_0x27b7bb,_0x5c9dae){const _0x477eae=a144_0x1c9bc0,_0x4978af=resolve(_0x5c9dae??findProjectRootDirectory()),_0xad069b=DOT_DIR+_0x477eae(0x1cf),_0x21169f=_0xad069b+'/'+_0x27b7bb;return{'projectRoot':_0x4978af,'appCode':_0x27b7bb,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0xad069b,'scriptsRoot':_0x21169f,'scriptsRootDir':resolve(_0x4978af,DOT_DIR,_0x477eae(0x1cc),_0x27b7bb),'lockFilePath':resolve(_0x4978af,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x4978af,DOT_DIR,TRASH_DIR_NAME)};}function a144_0x4260(_0x2ff8ce,_0xc7bd44){_0x2ff8ce=_0x2ff8ce-0x1c4;const _0x2167f5=a144_0x2167();let _0x4260aa=_0x2167f5[_0x2ff8ce];return _0x4260aa;}function a144_0x2167(){const _0x5dcf26=['/bff','322006GgMXuJ','17837990exyWyK','29583MyVMUl','5012511uRnWwC','bff-trash','bff.lock.json','568eFrPba','.rabetbase','26484uYPyye','5cyCJPj','3JLNEAE','bff','1831236KcUWJd','1968076sMQEYK'];a144_0x2167=function(){return _0x5dcf26;};return a144_0x2167();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a145_0x42bd5f=a145_0x1eb7;(function(_0x386bdc,_0x22fc89){const _0x570f5c=a145_0x1eb7,_0x29a17=_0x386bdc();while(!![]){try{const _0x5058de=-parseInt(_0x570f5c(0x150))/0x1*(parseInt(_0x570f5c(0x16a))/0x2)+-parseInt(_0x570f5c(0x166))/0x3*(-parseInt(_0x570f5c(0x165))/0x4)+parseInt(_0x570f5c(0x168))/0x5*(-parseInt(_0x570f5c(0x15b))/0x6)+-parseInt(_0x570f5c(0x15c))/0x7*(-parseInt(_0x570f5c(0x159))/0x8)+-parseInt(_0x570f5c(0x14d))/0x9*(parseInt(_0x570f5c(0x16b))/0xa)+parseInt(_0x570f5c(0x157))/0xb+-parseInt(_0x570f5c(0x156))/0xc*(parseInt(_0x570f5c(0x15f))/0xd);if(_0x5058de===_0x22fc89)break;else _0x29a17['push'](_0x29a17['shift']());}catch(_0x3eb930){_0x29a17['push'](_0x29a17['shift']());}}}(a145_0x2399,0x262f9));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';function a145_0x1eb7(_0x280602,_0x28a682){_0x280602=_0x280602-0x14c;const _0x2399db=a145_0x2399();let _0x1eb70e=_0x2399db[_0x280602];return _0x1eb70e;}import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';function a145_0x2399(){const _0xe5ec1f=['operationType','toUpperCase','afterScriptId','ENDPOINT','28845vHgGZX','COMMON','split','1mTDnxT','functionNode','isFile','.js','endsWith','set','12vnlugX','3270179HtkocL','alias','33016kNrgOj','get','6OLuYAf','238aczfDO','functionName','push','784719nNNsDx','HOOK','name','code','datasetCode','isDirectory','664028mkadJC','3AnPtHb','all','691090gnFuXc','replace','433148dTIqur','100oIghcF','scriptsRootDir','scriptType','beforeScriptId','F_OK'];a145_0x2399=function(){return _0xe5ec1f;};return a145_0x2399();}export const SUPPORTED_BFF_TYPES=['COMMON',a145_0x42bd5f(0x14c),a145_0x42bd5f(0x160)];export function normalizeBffType(_0x5eaf1e){const _0xa711a4=a145_0x42bd5f;if(!_0x5eaf1e)return undefined;const _0x56b745=_0x5eaf1e['trim']()[_0xa711a4(0x171)]();return SUPPORTED_BFF_TYPES['includes'](_0x56b745)?_0x56b745:undefined;}async function scanJsFilesRecursively(_0x58fecc,_0x35d685){const _0x25eeef=a145_0x42bd5f,_0x583cd8=[];try{const _0x488156=await readdir(_0x58fecc,{'withFileTypes':!![]});for(const _0x19520b of _0x488156){const _0x4e7d55=join(_0x58fecc,_0x19520b[_0x25eeef(0x161)]);if(_0x19520b[_0x25eeef(0x164)]())_0x583cd8[_0x25eeef(0x15e)](...await scanJsFilesRecursively(_0x4e7d55,_0x35d685+'/'+_0x19520b[_0x25eeef(0x161)]));else _0x19520b[_0x25eeef(0x152)]()&&_0x19520b[_0x25eeef(0x161)][_0x25eeef(0x154)](_0x25eeef(0x153))&&_0x583cd8['push']({'lockKey':_0x35d685+'/'+_0x19520b['name']['replace'](/\.js$/,''),'filePath':_0x4e7d55});}}catch(_0x3d292d){if(_0x3d292d[_0x25eeef(0x162)]!=='ENOENT')throw _0x3d292d;}return _0x583cd8;}async function scanFlatFunctions(_0x5ba313,_0x39e495){const _0x43c0e=a145_0x42bd5f,_0x456965=join(_0x5ba313[_0x43c0e(0x16c)],_0x39e495),_0x79e104=await scanJsFilesRecursively(_0x456965,_0x39e495);return _0x79e104['map'](({lockKey:_0x110e1a,filePath:_0x3fcde6})=>({'type':_0x39e495,'name':_0x110e1a[_0x43c0e(0x14f)]('/')['at'](-0x1)??'','filePath':_0x3fcde6,'lockKey':_0x110e1a}));}async function scanHookFunctions(_0x2064a7){const _0xbc8df3=a145_0x42bd5f,_0x4f3c85=join(_0x2064a7[_0xbc8df3(0x16c)],'HOOK'),_0x1a7efe=[];try{const _0x59e67c=await readdir(_0x4f3c85,{'withFileTypes':!![]});for(const _0x5b38ab of _0x59e67c){if(!_0x5b38ab[_0xbc8df3(0x164)]())continue;const _0x373c7a=_0x5b38ab['name'],_0x4c835f=join(_0x4f3c85,_0x373c7a),_0x4b946d=await readdir(_0x4c835f,{'withFileTypes':!![]});for(const _0x32ec3e of _0x4b946d){if(!_0x32ec3e[_0xbc8df3(0x164)]())continue;const _0x77a930=_0x32ec3e[_0xbc8df3(0x161)],_0x5bc906=join(_0x4c835f,_0x77a930),_0x55cbfc=await readdir(_0x5bc906,{'withFileTypes':!![]});for(const _0x551d80 of _0x55cbfc){if(!_0x551d80[_0xbc8df3(0x164)]())continue;const _0x132719=_0x551d80['name'],_0x25a626=join(_0x5bc906,_0x132719),_0x235bc9=await readdir(_0x25a626,{'withFileTypes':!![]});for(const _0x1a38f9 of _0x235bc9){if(!_0x1a38f9['isFile']()||!_0x1a38f9[_0xbc8df3(0x161)][_0xbc8df3(0x154)](_0xbc8df3(0x153)))continue;const _0x1c1e6d=_0x1a38f9[_0xbc8df3(0x161)][_0xbc8df3(0x169)](/\.js$/,'');_0x1a7efe[_0xbc8df3(0x15e)]({'type':_0xbc8df3(0x160),'name':_0x1c1e6d,'filePath':join(_0x25a626,_0x1a38f9[_0xbc8df3(0x161)]),'lockKey':'HOOK/'+_0x373c7a+'/'+_0x77a930+'/'+_0x132719+'/'+_0x1c1e6d,'alias':_0x373c7a,'operationType':_0x77a930,'functionNode':_0x132719});}}}}}catch(_0x2fb76b){if(_0x2fb76b[_0xbc8df3(0x162)]!=='ENOENT')throw _0x2fb76b;}return _0x1a7efe;}export async function scanLocalBffFunctions(_0x1e10b4,_0x584449){const _0xd56542=a145_0x42bd5f;if(_0x584449===_0xd56542(0x14e)||_0x584449===_0xd56542(0x14c))return scanFlatFunctions(_0x1e10b4,_0x584449);if(_0x584449===_0xd56542(0x160))return scanHookFunctions(_0x1e10b4);const [_0x1f4326,_0x22d93f,_0x23b323]=await Promise[_0xd56542(0x167)]([scanFlatFunctions(_0x1e10b4,_0xd56542(0x14e)),scanFlatFunctions(_0x1e10b4,_0xd56542(0x14c)),scanHookFunctions(_0x1e10b4)]);return[..._0x1f4326,..._0x22d93f,..._0x23b323];}export function resolveLocalFilePathFromLockKey(_0x37c473,_0x1598e7){const _0x41736e=a145_0x42bd5f;return join(_0x37c473[_0x41736e(0x16c)],..._0x1598e7[_0x41736e(0x14f)]('/'))+'.js';}export function createHookLocationMap(_0x22d048){const _0x832be4=a145_0x42bd5f,_0x32f333=new Map();for(const _0x3b4256 of _0x22d048){_0x3b4256[_0x832be4(0x16e)]&&_0x32f333[_0x832be4(0x155)](_0x3b4256[_0x832be4(0x16e)],{'datasetCode':_0x3b4256[_0x832be4(0x163)],'operationType':snakeToCamel(_0x3b4256[_0x832be4(0x170)]),'functionNode':'before'}),_0x3b4256['afterScriptId']&&_0x32f333[_0x832be4(0x155)](_0x3b4256[_0x832be4(0x172)],{'datasetCode':_0x3b4256['datasetCode'],'operationType':snakeToCamel(_0x3b4256[_0x832be4(0x170)]),'functionNode':'after'});}return _0x32f333;}export function resolveRemoteScriptTarget(_0x5635bc,_0x30bcd4,_0x29ed7c,_0xfb6d1b,_0x2fd524){const _0x53eef7=a145_0x42bd5f,_0x38cf91=normalizeBffType(_0x30bcd4[_0x53eef7(0x16d)]);if(!_0x38cf91||!_0x30bcd4[_0x53eef7(0x15d)])return null;if(_0x38cf91===_0x53eef7(0x160)){const _0x36ce1e=(_0x30bcd4['id']?_0x29ed7c[_0x53eef7(0x15a)](_0x30bcd4['id']):undefined)??findHookLocationByRemoteId(_0xfb6d1b,_0x30bcd4['id']);if(!_0x36ce1e)return null;const _0x1eebe4=_0x36ce1e[_0x53eef7(0x158)]||_0x2fd524[_0x53eef7(0x15a)](_0x36ce1e[_0x53eef7(0x163)]),_0x17f46e=_0x1eebe4??_0x36ce1e[_0x53eef7(0x163)],_0x12ec71={..._0x36ce1e,'alias':_0x1eebe4},_0x4ac6b3='HOOK/'+_0x17f46e+'/'+_0x12ec71[_0x53eef7(0x170)]+'/'+_0x12ec71[_0x53eef7(0x151)]+'/'+_0x30bcd4['functionName'];return{'lockKey':_0x4ac6b3,'filePath':resolveLocalFilePathFromLockKey(_0x5635bc,_0x4ac6b3),'type':_0x53eef7(0x160),'hookLocation':_0x12ec71};}const _0x2d1528=_0x38cf91+'/'+_0x30bcd4[_0x53eef7(0x15d)];return{'lockKey':_0x2d1528,'filePath':resolveLocalFilePathFromLockKey(_0x5635bc,_0x2d1528),'type':_0x38cf91};}export async function ensureParentDirectory(_0x1e7dad){await mkdir(dirname(_0x1e7dad),{'recursive':!![]});}export async function fileExists(_0x2ce3a0){const _0x7c2fa9=a145_0x42bd5f;try{return await access(_0x2ce3a0,constants[_0x7c2fa9(0x16f)]),!![];}catch{return![];}}export async function directoryExists(_0x7927a){const _0x42b942=a145_0x42bd5f;try{const _0x1a2964=await stat(_0x7927a);return _0x1a2964[_0x42b942(0x164)]();}catch{return![];}}
|
package/lib/core/bff/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a146_0xc612(){const _0x3e6951=['2152520XNkgCU','59PALGBt','createHash','10YxdpIS','utf8','157704KDDfYc','663744gLBdER','484SwVsAM','hex','digest','28viVLiD','2906874aoYHIr','8rAlBHB','md5','9662bvFlBz','1113258YHDHKm','288141YlwdRM'];a146_0xc612=function(){return _0x3e6951;};return a146_0xc612();}(function(_0x33b531,_0xfa79a4){const _0x9646f1=a146_0xc79c,_0x30e510=_0x33b531();while(!![]){try{const _0x37d36b=parseInt(_0x9646f1(0x11a))/0x1*(-parseInt(_0x9646f1(0x116))/0x2)+-parseInt(_0x9646f1(0x118))/0x3*(parseInt(_0x9646f1(0x114))/0x4)+parseInt(_0x9646f1(0x10b))/0x5*(parseInt(_0x9646f1(0x117))/0x6)+-parseInt(_0x9646f1(0x112))/0x7*(parseInt(_0x9646f1(0x10e))/0x8)+parseInt(_0x9646f1(0x113))/0x9+-parseInt(_0x9646f1(0x119))/0xa+-parseInt(_0x9646f1(0x10f))/0xb*(-parseInt(_0x9646f1(0x10d))/0xc);if(_0x37d36b===_0xfa79a4)break;else _0x30e510['push'](_0x30e510['shift']());}catch(_0x2ec1d3){_0x30e510['push'](_0x30e510['shift']());}}}(a146_0xc612,0x3c909));import{readFile}from'node:fs/promises';import a146_0x3a257e from'node:crypto';export function computeContentHash(_0x41d52f){const _0x582385=a146_0xc79c;return a146_0x3a257e[_0x582385(0x11b)](_0x582385(0x115))['update'](_0x41d52f)[_0x582385(0x111)](_0x582385(0x110));}function a146_0xc79c(_0x5221f9,_0x41ba9a){_0x5221f9=_0x5221f9-0x10b;const _0xc61265=a146_0xc612();let _0xc79c48=_0xc61265[_0x5221f9];return _0xc79c48;}export async function computeFileHash(_0x8c65b6){const _0x28b8ff=a146_0xc79c,_0x3abff5=await readFile(_0x8c65b6,_0x28b8ff(0x10c));return computeContentHash(_0x3abff5);}
|
package/lib/core/bff/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x99bfc6,_0x2864f7){const _0x3cde3f=a147_0x23ab,_0x3b12d4=_0x99bfc6();while(!![]){try{const _0x52cd59=parseInt(_0x3cde3f(0x129))/0x1+parseInt(_0x3cde3f(0x136))/0x2+parseInt(_0x3cde3f(0x12e))/0x3*(-parseInt(_0x3cde3f(0x12d))/0x4)+-parseInt(_0x3cde3f(0x130))/0x5+parseInt(_0x3cde3f(0x127))/0x6+parseInt(_0x3cde3f(0x126))/0x7+-parseInt(_0x3cde3f(0x134))/0x8*(parseInt(_0x3cde3f(0x122))/0x9);if(_0x52cd59===_0x2864f7)break;else _0x3b12d4['push'](_0x3b12d4['shift']());}catch(_0x23c617){_0x3b12d4['push'](_0x3b12d4['shift']());}}}(a147_0x4470,0x9da83));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a147_0x4470(){const _0x3e568c=['ENOENT','functions','utf8','5258085EQBtKp','6007236nUGZbL','code','180329QOhoej','\x22\x20vs\x20lock\x20\x22','\x22.\x20','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','12IvBWJh','13008AbMiQX','parse','3393065zSbqih','current\x20\x22','stringify','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','13825536IzmdSh','scriptsRoot','2265772wKacrS','apps','9XEiGny'];a147_0x4470=function(){return _0x3e568c;};return a147_0x4470();}function a147_0x23ab(_0x83f9a7,_0x586e38){_0x83f9a7=_0x83f9a7-0x122;const _0x447059=a147_0x4470();let _0x23ab61=_0x447059[_0x83f9a7];return _0x23ab61;}export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x480c70,_0x2bfc71,_0x1789f6,_0x523dd3){const _0x29385f=a147_0x23ab,_0x3e9995={'apps':_0x480c70[_0x29385f(0x137)]&&typeof _0x480c70[_0x29385f(0x137)]==='object'?_0x480c70['apps']:{}};let _0x39adcb=_0x3e9995[_0x29385f(0x137)][_0x2bfc71];if(!_0x39adcb)return _0x39adcb={'scriptsRoot':_0x1789f6,'lastSync':'','functions':{}},_0x3e9995['apps'][_0x2bfc71]=_0x39adcb,{'lockData':_0x3e9995,'appLock':_0x39adcb};if(!_0x39adcb[_0x29385f(0x135)])_0x39adcb[_0x29385f(0x135)]=_0x1789f6;else{if(_0x39adcb[_0x29385f(0x135)]!==_0x1789f6)throw new Error(_0x523dd3+':\x20scriptsRoot\x20mismatch\x20—\x20'+(_0x29385f(0x131)+_0x1789f6+_0x29385f(0x12a)+_0x39adcb['scriptsRoot']+_0x29385f(0x12b))+_0x29385f(0x12c));}return!_0x39adcb[_0x29385f(0x124)]&&(_0x39adcb['functions']={}),!_0x39adcb['lastSync']&&(_0x39adcb['lastSync']=''),{'lockData':_0x3e9995,'appLock':_0x39adcb};}export async function readBffLockFile(_0xdf4f30){const _0x467a02=a147_0x23ab;try{const _0x16c681=await readFile(_0xdf4f30,_0x467a02(0x125)),_0x54050f=JSON[_0x467a02(0x12f)](_0x16c681);return{'apps':_0x54050f[_0x467a02(0x137)]&&typeof _0x54050f[_0x467a02(0x137)]==='object'?_0x54050f[_0x467a02(0x137)]:{}};}catch(_0x205bb1){if(_0x205bb1[_0x467a02(0x128)]===_0x467a02(0x123))return null;throw new Error(_0x467a02(0x133)+String(_0x205bb1));}}export async function writeBffLockFile(_0x5348e1,_0x5e71a0){const _0x503367=a147_0x23ab;await mkdir(dirname(_0x5348e1),{'recursive':!![]}),await writeFile(_0x5348e1,JSON[_0x503367(0x132)](_0x5e71a0,null,0x2),_0x503367(0x125));}
|
package/lib/core/bff/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a149_0x5942(_0x303b70,_0x40c441){_0x303b70=_0x303b70-0x1da;const _0x257cc8=a149_0x257c();let _0x59428b=_0x257cc8[_0x303b70];return _0x59428b;}(function(_0x3da513,_0x587dbd){const _0x2b7c1e=a149_0x5942,_0x4fab27=_0x3da513();while(!![]){try{const _0x31675e=parseInt(_0x2b7c1e(0x1dd))/0x1*(parseInt(_0x2b7c1e(0x1dc))/0x2)+-parseInt(_0x2b7c1e(0x1e5))/0x3*(-parseInt(_0x2b7c1e(0x1e7))/0x4)+parseInt(_0x2b7c1e(0x1eb))/0x5+-parseInt(_0x2b7c1e(0x1e2))/0x6*(parseInt(_0x2b7c1e(0x1da))/0x7)+-parseInt(_0x2b7c1e(0x1e8))/0x8*(-parseInt(_0x2b7c1e(0x1ed))/0x9)+parseInt(_0x2b7c1e(0x1e0))/0xa+parseInt(_0x2b7c1e(0x1e1))/0xb*(-parseInt(_0x2b7c1e(0x1de))/0xc);if(_0x31675e===_0x587dbd)break;else _0x4fab27['push'](_0x4fab27['shift']());}catch(_0x1605db){_0x4fab27['push'](_0x4fab27['shift']());}}}(a149_0x257c,0x4893c));export function snakeToCamel(_0x57b32e){const _0x40245e=a149_0x5942;return _0x57b32e['toLowerCase']()[_0x40245e(0x1e3)](/_([a-z])/g,(_0x143349,_0x46194e)=>_0x46194e[_0x40245e(0x1e9)]());}export function findHookLocationByRemoteId(_0x12dc6e,_0x12c527){const _0x2605d5=a149_0x5942;if(!_0x12c527)return undefined;for(const _0x534807 of Object[_0x2605d5(0x1ea)](_0x12dc6e)){if(_0x534807['remoteId']===_0x12c527&&_0x534807['datasetCode']&&_0x534807['operationType']&&_0x534807[_0x2605d5(0x1e6)])return{'datasetCode':_0x534807[_0x2605d5(0x1db)],'operationType':_0x534807[_0x2605d5(0x1df)],'functionNode':_0x534807[_0x2605d5(0x1e6)]};}return undefined;}export function extractScriptDescription(_0x4f26e5){const _0x8cd75c=_0x4f26e5['match'](/\[\s*脚本描述\s*]\s*(.+)/);return _0x8cd75c?.[0x1]?.['trim']()||undefined;}function a149_0x257c(){const _0x1b688a=['functionNode','64iEfBDv','8ykKOyf','toUpperCase','values','1776020ZziEzc','test','5021343foizNJ','343AOZeuT','datasetCode','2niLArB','427255mfcKNx','11788824qzEKNB','operationType','77970yfGTaT','11aXqAWc','29910sTBfTb','replace','after','32955RqXPNH'];a149_0x257c=function(){return _0x1b688a;};return a149_0x257c();}export function isValidBffFunctionName(_0x3fddb9){const _0x51739e=a149_0x5942;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x51739e(0x1ec)](_0x3fddb9);}export function normalizeHookFunctionNode(_0x2c0d8d){const _0x2dd861=a149_0x5942;if(!_0x2c0d8d)return undefined;const _0xcab52b=_0x2c0d8d['trim']()['toLowerCase']();if(_0xcab52b==='before'||_0xcab52b===_0x2dd861(0x1e4))return _0xcab52b;return undefined;}
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3be394,_0x10b88a){const _0x12580c=a150_0x535e,_0x41fce1=_0x3be394();while(!![]){try{const _0x162420=-parseInt(_0x12580c(0x125))/0x1*(parseInt(_0x12580c(0x11c))/0x2)+-parseInt(_0x12580c(0x12b))/0x3+-parseInt(_0x12580c(0x11f))/0x4+parseInt(_0x12580c(0x130))/0x5+parseInt(_0x12580c(0x11d))/0x6*(-parseInt(_0x12580c(0x132))/0x7)+parseInt(_0x12580c(0x129))/0x8*(-parseInt(_0x12580c(0x124))/0x9)+parseInt(_0x12580c(0x116))/0xa*(parseInt(_0x12580c(0x121))/0xb);if(_0x162420===_0x10b88a)break;else _0x41fce1['push'](_0x41fce1['shift']());}catch(_0x51b8da){_0x41fce1['push'](_0x41fce1['shift']());}}}(a150_0x54ee,0x7fc32));function a150_0x54ee(){const _0x90537=['toLowerCase','.\x20Be\x20more\x20specific.','get','8NxJqRQ','102066FistQf','find','3282452EZXFBh','includes','286AMHduS','dbId','\x22\x20matches\x20multiple\x20databases:\x20','7173VpBWHH','63285JKHehl','filter','length','\x22\x20under\x20app\x20\x22','7416YMjDIg','isNaN','1693464GDAMFA','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','map','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','set','3751965BtJAdW','dbName','427pKuJpj','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','join','1226020LKgoTO','dbtableConfig','\x22.\x20Available:\x20'];a150_0x54ee=function(){return _0x90537;};return a150_0x54ee();}import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x5d7da9){const _0x3b16be=a150_0x535e;if(cache['has'](_0x5d7da9))return cache[_0x3b16be(0x11b)](_0x5d7da9);const _0x17e25d=await listDatasets(_0x5d7da9),_0x1ea67b=new Map();for(const _0xca56e2 of _0x17e25d){const _0x424e78=_0xca56e2[_0x3b16be(0x117)];_0x424e78?.[_0x3b16be(0x122)]!=null&&_0x1ea67b[_0x3b16be(0x12f)](_0x424e78['dbId'],_0x424e78[_0x3b16be(0x131)]??'db-'+_0x424e78['dbId']);}const _0x3f1b37=[..._0x1ea67b['entries']()][_0x3b16be(0x12d)](([_0x39b912,_0x511762])=>({'dbId':_0x39b912,'dbName':_0x511762}));return cache['set'](_0x5d7da9,_0x3f1b37),_0x3f1b37;}export async function resolveDb(_0x50922f,_0x195d13){const _0x321007=a150_0x535e,_0x5bb2d2=await listDatabases(_0x50922f);if(_0x5bb2d2[_0x321007(0x127)]===0x0)return{'resolved':[],'error':_0x321007(0x12e)+_0x50922f+_0x321007(0x12c)};if(!_0x195d13)return{'resolved':_0x5bb2d2};const _0x1ca765=Number(_0x195d13);if(!Number[_0x321007(0x12a)](_0x1ca765)){const _0x548767=_0x5bb2d2[_0x321007(0x11e)](_0x56008d=>_0x56008d['dbId']===_0x1ca765);if(_0x548767)return{'resolved':[_0x548767]};}const _0x40ee61=_0x195d13[_0x321007(0x119)](),_0x3795ba=_0x5bb2d2[_0x321007(0x126)](_0x4245f8=>_0x4245f8[_0x321007(0x131)][_0x321007(0x119)]()[_0x321007(0x120)](_0x40ee61));if(_0x3795ba[_0x321007(0x127)]>0x0)return{'resolved':_0x3795ba};const _0x25cfc1=_0x5bb2d2[_0x321007(0x12d)](_0x1d61d1=>_0x1d61d1[_0x321007(0x131)]+'\x20('+_0x1d61d1['dbId']+')')[_0x321007(0x115)](',\x20');return{'resolved':[],'error':'No\x20database\x20matching\x20\x22'+_0x195d13+_0x321007(0x128)+_0x50922f+_0x321007(0x118)+_0x25cfc1+_0x321007(0x114)};}function a150_0x535e(_0x58c995,_0x173584){_0x58c995=_0x58c995-0x114;const _0x54ee1d=a150_0x54ee();let _0x535e38=_0x54ee1d[_0x58c995];return _0x535e38;}export async function resolveOneDb(_0x3736ca,_0x782796){const _0x3b2724=a150_0x535e,{resolved:_0x31647e,error:_0x22c71e}=await resolveDb(_0x3736ca,_0x782796);if(_0x22c71e)return{'db':null,'error':_0x22c71e};if(_0x31647e[_0x3b2724(0x127)]===0x1)return{'db':_0x31647e[0x0]};if(!_0x782796){const _0x208a71=_0x31647e['map'](_0x301227=>_0x301227[_0x3b2724(0x131)]+'\x20('+_0x301227[_0x3b2724(0x122)]+')')[_0x3b2724(0x115)](',\x20');return{'db':null,'error':'Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20'+_0x208a71};}const _0x14bf2d=_0x31647e['map'](_0x480b49=>_0x480b49[_0x3b2724(0x131)]+'\x20('+_0x480b49['dbId']+')')[_0x3b2724(0x115)](',\x20');return{'db':null,'error':'\x22'+_0x782796+_0x3b2724(0x123)+_0x14bf2d+_0x3b2724(0x11a)};}export async function getDbName(_0x5087c4,_0x3f79a3){const _0x25ce44=a150_0x535e,_0x40b925=await listDatabases(_0x5087c4);return _0x40b925[_0x25ce44(0x11e)](_0x1c24be=>_0x1c24be[_0x25ce44(0x122)]===_0x3f79a3)?.[_0x25ce44(0x131)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a151_0x5134(_0x58862a,_0x2a7f5e){_0x58862a=_0x58862a-0x151;const _0x4fd773=a151_0x4fd7();let _0x513475=_0x4fd773[_0x58862a];return _0x513475;}const a151_0x49300e=a151_0x5134;(function(_0x322a4b,_0x2479f7){const _0x1a851e=a151_0x5134,_0x4e434a=_0x322a4b();while(!![]){try{const _0x137d68=parseInt(_0x1a851e(0x15c))/0x1+parseInt(_0x1a851e(0x155))/0x2+parseInt(_0x1a851e(0x152))/0x3*(-parseInt(_0x1a851e(0x157))/0x4)+parseInt(_0x1a851e(0x15f))/0x5+parseInt(_0x1a851e(0x153))/0x6*(-parseInt(_0x1a851e(0x159))/0x7)+parseInt(_0x1a851e(0x15e))/0x8+parseInt(_0x1a851e(0x15a))/0x9*(parseInt(_0x1a851e(0x156))/0xa);if(_0x137d68===_0x2479f7)break;else _0x4e434a['push'](_0x4e434a['shift']());}catch(_0x5b19e0){_0x4e434a['push'](_0x4e434a['shift']());}}}(a151_0x4fd7,0xed23f));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';function a151_0x4fd7(){const _0x5718bb=['.rabetbase','12917632fLsloj','423965xuXVwR','F_OK','120biQinW','4746972iRdjpg','toUpperCase','1686318DdaozI','61430UkgVfD','172644vIIXNq','cwd','7VqiJWl','1359pqfdCV','page','18680feHRwQ'];a151_0x4fd7=function(){return _0x5718bb;};return a151_0x4fd7();}import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x5ce5ad,_0x4558a0=process[a151_0x49300e(0x158)]()){const _0x4ac6e0=a151_0x49300e,_0xe67ccb=resolve(_0x4558a0),_0x2376e6=join(_0xe67ccb,_0x4ac6e0(0x15d),_0x4ac6e0(0x15b));return{'projectRoot':_0xe67ccb,'pagesBaseDir':_0x2376e6,'appPagesDir':join(_0x2376e6,_0x5ce5ad),'lockFilePath':join(_0xe67ccb,_0x4ac6e0(0x15d),'page.lock.json')};}export function buildPageFileName(_0x530f1d,_0x51bb82){const _0x25201a=a151_0x49300e;return _0x530f1d+'-'+String(_0x51bb82)[_0x25201a(0x154)]()+'.json';}export function resolvePageFilePath(_0x5bfd62,_0x22b9d2,_0x5bb5a4){return join(_0x5bfd62['appPagesDir'],buildPageFileName(_0x22b9d2,_0x5bb5a4));}export async function ensureParentDirectory(_0x4f956b){await mkdir(dirname(_0x4f956b),{'recursive':!![]});}export async function fileExists(_0x53e1fd){const _0x2b67aa=a151_0x49300e;try{return await access(_0x53e1fd,constants[_0x2b67aa(0x151)]),!![];}catch{return![];}}
|
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1ba056,_0x4c2cd5){const _0x193d0b=a152_0x1263,_0x273936=_0x1ba056();while(!![]){try{const _0x4c0576=-parseInt(_0x193d0b(0x13f))/0x1*(parseInt(_0x193d0b(0x13c))/0x2)+-parseInt(_0x193d0b(0x13e))/0x3+-parseInt(_0x193d0b(0x138))/0x4+-parseInt(_0x193d0b(0x136))/0x5+parseInt(_0x193d0b(0x13a))/0x6+parseInt(_0x193d0b(0x135))/0x7+parseInt(_0x193d0b(0x139))/0x8*(parseInt(_0x193d0b(0x13b))/0x9);if(_0x4c0576===_0x4c2cd5)break;else _0x273936['push'](_0x273936['shift']());}catch(_0x5a4a54){_0x273936['push'](_0x273936['shift']());}}}(a152_0x25a3,0x39a22));import a152_0x45701e from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x3f4d30){const _0x535ecd=a152_0x1263;return JSON['stringify'](JSON[_0x535ecd(0x141)](_0x3f4d30),null,0x2)+'\x0a';}export function computePageContentHash(_0x3f186e){const _0x51c6f3=a152_0x1263;return a152_0x45701e[_0x51c6f3(0x134)]('md5')[_0x51c6f3(0x142)](_0x3f186e)[_0x51c6f3(0x13d)](_0x51c6f3(0x137));}function a152_0x25a3(){const _0x141f27=['1712436LWZeNZ','11976LgMUbo','2263920lEgYiO','4797ROgTXw','138ogyBIq','digest','386856EQcUcZ','132PpEcXy','utf8','parse','update','createHash','425313prbMDw','2168725pNNxpC','hex'];a152_0x25a3=function(){return _0x141f27;};return a152_0x25a3();}function a152_0x1263(_0x439079,_0x56e527){_0x439079=_0x439079-0x134;const _0x25a3bf=a152_0x25a3();let _0x126349=_0x25a3bf[_0x439079];return _0x126349;}export function computeSerializedSchemaHash(_0x25c1f5){return computePageContentHash(serializePageSchemaForFile(_0x25c1f5));}export async function computePageFileHash(_0x14f4fb){const _0x2ed9d9=a152_0x1263,_0xa75a47=await readFile(_0x14f4fb,_0x2ed9d9(0x140));return computePageContentHash(_0xa75a47);}
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x9072d0,_0x468dc2){const _0x122cb1=a153_0x13e5,_0x243a20=_0x9072d0();while(!![]){try{const _0x1d7046=parseInt(_0x122cb1(0x76))/0x1*(parseInt(_0x122cb1(0x6f))/0x2)+-parseInt(_0x122cb1(0x79))/0x3+-parseInt(_0x122cb1(0x7c))/0x4+parseInt(_0x122cb1(0x6e))/0x5*(-parseInt(_0x122cb1(0x77))/0x6)+-parseInt(_0x122cb1(0x74))/0x7*(-parseInt(_0x122cb1(0x6c))/0x8)+parseInt(_0x122cb1(0x70))/0x9+-parseInt(_0x122cb1(0x75))/0xa*(-parseInt(_0x122cb1(0x7e))/0xb);if(_0x1d7046===_0x468dc2)break;else _0x243a20['push'](_0x243a20['shift']());}catch(_0x35ae68){_0x243a20['push'](_0x243a20['shift']());}}}(a153_0x7424,0x7c08c));import{mkdir,readFile,writeFile}from'node:fs/promises';function a153_0x7424(){const _0x5ef879=['parse','107212TqTgOq','10SPhgqd','35361cYJDou','1722WzfBHZ','stringify','1762689OnqTmO','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','code','3607948KkcPcI','object','10801439smlnCG','pages','464FglIVc','apps','8815idODYy','18wkbLhy','2835441RRBtWl','utf8','lastSync'];a153_0x7424=function(){return _0x5ef879;};return a153_0x7424();}import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x351ddd,_0xd3adc){const _0x2cbeb8=a153_0x13e5,_0x3d5f92={'apps':_0x351ddd['apps']&&typeof _0x351ddd[_0x2cbeb8(0x6d)]===_0x2cbeb8(0x7d)?_0x351ddd[_0x2cbeb8(0x6d)]:{}};let _0x3dc8b0=_0x3d5f92[_0x2cbeb8(0x6d)][_0xd3adc];if(!_0x3dc8b0)return _0x3dc8b0={'lastSync':'','pages':{}},_0x3d5f92[_0x2cbeb8(0x6d)][_0xd3adc]=_0x3dc8b0,{'lockData':_0x3d5f92,'appLock':_0x3dc8b0};return!_0x3dc8b0[_0x2cbeb8(0x72)]&&(_0x3dc8b0[_0x2cbeb8(0x72)]=''),(!_0x3dc8b0[_0x2cbeb8(0x6b)]||typeof _0x3dc8b0[_0x2cbeb8(0x6b)]!==_0x2cbeb8(0x7d))&&(_0x3dc8b0[_0x2cbeb8(0x6b)]={}),{'lockData':_0x3d5f92,'appLock':_0x3dc8b0};}function a153_0x13e5(_0x20b33d,_0x404858){_0x20b33d=_0x20b33d-0x6b;const _0x742474=a153_0x7424();let _0x13e5f6=_0x742474[_0x20b33d];return _0x13e5f6;}export async function readPageLockFile(_0x3a6b63){const _0x6e45f3=a153_0x13e5;try{const _0x92003e=await readFile(_0x3a6b63,_0x6e45f3(0x71)),_0x43ff9b=JSON[_0x6e45f3(0x73)](_0x92003e);return{'apps':_0x43ff9b[_0x6e45f3(0x6d)]&&typeof _0x43ff9b[_0x6e45f3(0x6d)]===_0x6e45f3(0x7d)?_0x43ff9b['apps']:{}};}catch(_0x1b73f0){if(_0x1b73f0[_0x6e45f3(0x7b)]==='ENOENT')return null;throw new Error(_0x6e45f3(0x7a)+String(_0x1b73f0));}}export async function writePageLockFile(_0x4f2055,_0x3cfa66){const _0x420839=a153_0x13e5;await mkdir(dirname(_0x4f2055),{'recursive':!![]}),await writeFile(_0x4f2055,JSON[_0x420839(0x78)](_0x3cfa66,null,0x2),_0x420839(0x71));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a155_0xdbce(_0x113c3e,_0x7682f4){_0x113c3e=_0x113c3e-0x119;const _0x28a08d=a155_0x28a0();let _0xdbcea3=_0x28a08d[_0x113c3e];return _0xdbcea3;}const a155_0x190f54=a155_0xdbce;(function(_0x282abc,_0x4ced92){const _0x521b99=a155_0xdbce,_0x2d109f=_0x282abc();while(!![]){try{const _0x48a463=parseInt(_0x521b99(0x125))/0x1+parseInt(_0x521b99(0x123))/0x2*(-parseInt(_0x521b99(0x126))/0x3)+-parseInt(_0x521b99(0x119))/0x4*(-parseInt(_0x521b99(0x11d))/0x5)+-parseInt(_0x521b99(0x122))/0x6+-parseInt(_0x521b99(0x11f))/0x7+parseInt(_0x521b99(0x11b))/0x8*(-parseInt(_0x521b99(0x11e))/0x9)+-parseInt(_0x521b99(0x121))/0xa*(-parseInt(_0x521b99(0x124))/0xb);if(_0x48a463===_0x4ced92)break;else _0x2d109f['push'](_0x2d109f['shift']());}catch(_0x32d963){_0x2d109f['push'](_0x2d109f['shift']());}}}(a155_0x28a0,0x62e34));function a155_0x28a0(){const _0x2f7a79=['2624fnaqxM','.rabetbase','1652045ddGCvv','13617mLVBcB','4070654tcrgQy','sql.lock.json','20CScPgj','4105338TkiSHE','136354zGkCiB','8062824qsXCzr','438853bzIfjw','3NkQShM','4hZaePm','sql-trash'];a155_0x28a0=function(){return _0x2f7a79;};return a155_0x28a0();}import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a155_0x190f54(0x11c),LOCK_FILE_NAME=a155_0x190f54(0x120),TRASH_DIR_NAME=a155_0x190f54(0x11a);export function loadSqlProjectConfig(_0xbf42f5,_0x39289e){const _0x4e554a=resolve(_0x39289e??findProjectRootDirectory()),_0x4ffb51=DOT_DIR+'/sql',_0x279003=_0x4ffb51+'/'+_0xbf42f5;return{'projectRoot':_0x4e554a,'appCode':_0xbf42f5,'sqlWorkspaceRoot':_0x4ffb51,'sqlRoot':_0x279003,'sqlRootDir':resolve(_0x4e554a,DOT_DIR,'sql',_0xbf42f5),'lockFilePath':resolve(_0x4e554a,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x4e554a,DOT_DIR,TRASH_DIR_NAME)};}
|